@purestack/ts-components 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ts-components.d.mts +1 -1
- package/dist/ts-components.d.mts.map +1 -1
- package/dist/ts-components.mjs +9 -5
- package/dist/ts-components.mjs.map +1 -1
- package/package.json +9 -8
- package/src/standard/btn/btn.ts +3 -5
- package/src/standard/form/form.ts +5 -5
- package/src/standard/pageToc/pageToc.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purestack/ts-components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"packageManager": "yarn@4.9.2",
|
|
5
5
|
"module": "./dist/ts-components.mjs",
|
|
6
6
|
"types": "./dist/ts-components.d.mts",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"test": "vitest"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@purestack/ts-minidom": "^1.1.
|
|
50
|
-
"@purestack/ts-render": "^1.1.
|
|
49
|
+
"@purestack/ts-minidom": "^1.1.2",
|
|
50
|
+
"@purestack/ts-render": "^1.1.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@purestack/ts-common": "^1.1.
|
|
54
|
-
"@purestack/ts-css": "^1.1.
|
|
55
|
-
"@purestack/ts-page-scripts": "^1.1.
|
|
56
|
-
"@purestack/ts-style": "^1.1.
|
|
57
|
-
"@purestack/ts-util": "^1.1.
|
|
53
|
+
"@purestack/ts-common": "^1.1.2",
|
|
54
|
+
"@purestack/ts-css": "^1.1.2",
|
|
55
|
+
"@purestack/ts-page-scripts": "^1.1.2",
|
|
56
|
+
"@purestack/ts-style": "^1.1.2",
|
|
57
|
+
"@purestack/ts-util": "^1.1.2",
|
|
58
58
|
"regor": "^1.7.3"
|
|
59
59
|
},
|
|
60
60
|
"regorComponents": [
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"BtnGroup",
|
|
69
69
|
"BtnGroupDropDown",
|
|
70
70
|
"BtnLink",
|
|
71
|
+
"ClassicLogo",
|
|
71
72
|
"CodeShowcase",
|
|
72
73
|
"ComparisonColumn",
|
|
73
74
|
"ComparisonFeature",
|
package/src/standard/btn/btn.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type TsSsgContext, tryResolveTsSsgContext } from '@purestack/ts-common'
|
|
2
2
|
import type { SemanticTone } from '@purestack/ts-style'
|
|
3
|
-
import { urlNormalizer } from '@purestack/ts-util'
|
|
4
3
|
import {
|
|
5
4
|
type ComputedRef,
|
|
6
5
|
computed,
|
|
@@ -178,10 +177,9 @@ function resolveShowEndIcon(props: BtnBase) {
|
|
|
178
177
|
}
|
|
179
178
|
|
|
180
179
|
function resolveButtonHref(props: BtnLink, context: TsSsgContext | undefined) {
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
: undefined
|
|
180
|
+
const value = unref(props.href)
|
|
181
|
+
const href = typeof value === 'string' ? value.trim() : undefined
|
|
182
|
+
return href ? (context?.resolvePublicHref(href) ?? href) : undefined
|
|
185
183
|
}
|
|
186
184
|
|
|
187
185
|
function resolveButtonRel(props: BtnLink) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { tryResolveTsSsgContext } from '@purestack/ts-common'
|
|
2
2
|
import type { SemanticTone } from '@purestack/ts-style'
|
|
3
|
-
import { urlNormalizer } from '@purestack/ts-util'
|
|
4
3
|
import {
|
|
5
4
|
type ComponentHead,
|
|
6
5
|
type ComputedRef,
|
|
@@ -164,10 +163,7 @@ function resolveFormAssistLink(
|
|
|
164
163
|
return {
|
|
165
164
|
...head.props,
|
|
166
165
|
normalizedHref: computed(() =>
|
|
167
|
-
resolvePublicHref(
|
|
168
|
-
urlNormalizer.normalizeHref(unref(head.props.href)),
|
|
169
|
-
head,
|
|
170
|
-
),
|
|
166
|
+
resolvePublicHref(toTrimmedHref(unref(head.props.href)), head),
|
|
171
167
|
),
|
|
172
168
|
resolvedRel: computed(
|
|
173
169
|
() =>
|
|
@@ -179,6 +175,10 @@ function resolveFormAssistLink(
|
|
|
179
175
|
}
|
|
180
176
|
}
|
|
181
177
|
|
|
178
|
+
function toTrimmedHref(value: unknown) {
|
|
179
|
+
return typeof value === 'string' ? value.trim() : undefined
|
|
180
|
+
}
|
|
181
|
+
|
|
182
182
|
function resolvePublicHref(
|
|
183
183
|
href: string | undefined,
|
|
184
184
|
head: ComponentHead<FormAssistLink>,
|
|
@@ -114,7 +114,7 @@ function toPageTocItems(items: PageOutlineItem[]): PageTocItem[] {
|
|
|
114
114
|
function omitSingleDocumentHeading(items: PageOutlineItem[]) {
|
|
115
115
|
if (items.length !== 1) return items
|
|
116
116
|
const [item] = items
|
|
117
|
-
if (
|
|
117
|
+
if (item?.depth !== 1) return items
|
|
118
118
|
return item.children ?? []
|
|
119
119
|
}
|
|
120
120
|
|