vlite3 1.4.31 → 1.4.32
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/components/Accordion/Accordion.vue.js +19 -16
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionItem.vue.js +38 -36
- package/components/CategoryManager/CategoryManager.vue2.js +4 -3
- package/components/Chart/GanttChart.vue.d.ts +13 -1
- package/components/Chart/GanttChart.vue.js +2 -2
- package/components/Chart/GanttChart.vue2.js +1185 -607
- package/components/Chart/GanttChartDateUtils.d.ts +38 -0
- package/components/Chart/GanttChartDateUtils.js +79 -0
- package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
- package/components/Chart/GanttChartDependencyUtils.js +113 -0
- package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
- package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
- package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
- package/components/Chart/GanttChartTooltipUtils.js +63 -0
- package/components/Chart/index.d.ts +3 -1
- package/components/Chart/types.d.ts +76 -1
- package/components/Chart/types.js +8 -0
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/Form/AccordionView.vue2.js +5 -2
- package/components/Form/AccordionView.vue3.js +250 -0
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +309 -280
- package/components/Form/FormField.vue.js +175 -196
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +60 -60
- package/components/Form/FormSkeleton.vue.js +50 -35
- package/components/Form/TableView.vue.js +59 -43
- package/components/Form/composables/useForm.js +159 -148
- package/components/Form/index.vue2.js +8 -8
- package/components/Form/utils/form.utils.d.ts +2 -0
- package/components/Form/utils/form.utils.js +17 -13
- package/components/GoogleMap.vue.d.ts +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
- package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
- package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
- package/components/PanZoomViewport/index.d.ts +2 -0
- package/components/PanZoomViewport/types.d.ts +121 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
- package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
- package/components/ScaleGenerator/types.d.ts +2 -0
- package/components/Screen/ScreenFilter.vue.js +19 -18
- package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
- package/components/SeoProvider/SeoProvider.vue.js +39 -33
- package/components/SeoProvider/domAdapter.d.ts +1 -4
- package/components/SeoProvider/domAdapter.js +71 -58
- package/components/SeoProvider/index.d.ts +5 -2
- package/components/SeoProvider/normalizeSeo.d.ts +10 -49
- package/components/SeoProvider/normalizeSeo.js +246 -182
- package/components/SeoProvider/plainText.d.ts +8 -0
- package/components/SeoProvider/plainText.js +117 -0
- package/components/SeoProvider/seoUrl.d.ts +13 -0
- package/components/SeoProvider/seoUrl.js +25 -0
- package/components/SeoProvider/structuredData.d.ts +100 -0
- package/components/SeoProvider/structuredData.js +33 -0
- package/components/SeoProvider/types.d.ts +47 -109
- package/components/Tabes/Tabes.vue.js +1 -1
- package/components/Tabes/Tabes.vue2.js +215 -193
- package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
- package/components/Tabes/TabesMarkerGeometry.js +21 -0
- package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
- package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
- package/components/ThemeProvider/index.d.ts +1 -1
- package/components/ThemeProvider/themeVars.d.ts +9 -13
- package/components/ThemeProvider/themeVars.js +173 -125
- package/components/ThemeProvider/types.d.ts +10 -0
- package/components/index.d.ts +2 -1
- package/index.d.ts +1 -0
- package/index.js +415 -387
- package/package.json +3 -2
- package/style.css +1 -1
- package/components/Form/AccordionView.vue.js +0 -222
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,195 +1,259 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { htmlToPlainText as z } from "./plainText.js";
|
|
2
|
+
const q = /\{\{(\w+)\}\}/g, y = (t, e = {}) => t ? t.replace(q, (o, r) => {
|
|
3
|
+
const n = e[r];
|
|
4
|
+
return n == null ? "" : String(n);
|
|
5
|
+
}) : "", F = (t, e, o) => {
|
|
6
|
+
const r = y(t, e);
|
|
7
|
+
return o ? z(r) : r;
|
|
8
|
+
}, L = (t, e, o = !1) => {
|
|
9
|
+
for (const r of t) {
|
|
10
|
+
if (r === null) return null;
|
|
11
|
+
if (typeof r != "string") continue;
|
|
12
|
+
const n = F(r, e, o);
|
|
13
|
+
if (n.length > 0) return n;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}, G = (t, e = {}, o = !1) => {
|
|
17
|
+
const n = (Array.isArray(t) ? t : typeof t == "string" ? [t] : []).flatMap((m) => y(m, e).split(",")).map((m) => o ? z(m) : m.trim()).filter(Boolean);
|
|
18
|
+
return [...new Set(n)].join(", ");
|
|
19
|
+
}, Q = (t, e, o) => {
|
|
20
|
+
for (const r of t) {
|
|
21
|
+
if (r === null) return "";
|
|
22
|
+
const n = G(r, e, o);
|
|
23
|
+
if (n) return n;
|
|
24
|
+
}
|
|
7
25
|
return "";
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
26
|
+
}, c = (t, e, o, r) => {
|
|
27
|
+
e !== void 0 && t.push(e ? o : r);
|
|
28
|
+
}, V = (t) => {
|
|
29
|
+
const e = [];
|
|
30
|
+
c(e, t.index, "index", "noindex"), c(e, t.follow, "follow", "nofollow"), c(e, t.archive, "archive", "noarchive"), c(e, t.imageIndex, "indeximage", "noimageindex"), c(e, t.translate, "translate", "notranslate");
|
|
31
|
+
for (const o of t.additional ?? []) {
|
|
32
|
+
const r = o.trim().toLowerCase();
|
|
33
|
+
r && e.push(r);
|
|
34
|
+
}
|
|
35
|
+
return [...new Set(e)].join(", ");
|
|
36
|
+
}, W = (t, e = {}) => t == null ? null : typeof t == "boolean" ? t ? "index, follow" : "noindex, nofollow" : typeof t == "string" ? y(t, e).trim() || null : V(t) || null, X = (t, e) => {
|
|
37
|
+
for (const o of t) {
|
|
38
|
+
if (o === null) return null;
|
|
39
|
+
if (o === void 0) continue;
|
|
40
|
+
const r = W(o, e);
|
|
41
|
+
if (r) return r;
|
|
13
42
|
}
|
|
14
43
|
return null;
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
}, Y = (t) => !!t && typeof t == "object" && !Array.isArray(t), Z = (t) => t ? (Array.isArray(t) ? t : [t]).filter(Y) : [], $ = (t) => {
|
|
45
|
+
for (const e of t) {
|
|
46
|
+
if (e === null) return [];
|
|
47
|
+
const o = Z(e);
|
|
48
|
+
if (o.length > 0) return o;
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
51
|
+
}, u = (t, e) => ({
|
|
52
|
+
...t ?? {},
|
|
53
|
+
...e ?? {}
|
|
54
|
+
}), b = ({
|
|
55
|
+
defaults: t,
|
|
56
|
+
context: e,
|
|
57
|
+
fallback: o,
|
|
58
|
+
pageType: r = "home",
|
|
59
|
+
globalReplacements: n,
|
|
60
|
+
sanitizeText: m
|
|
24
61
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
),
|
|
51
|
-
i?.
|
|
52
|
-
e?.
|
|
53
|
-
o?.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
i?.
|
|
85
|
-
e?.ogImage
|
|
86
|
-
e?.image
|
|
87
|
-
o?.ogImage
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
62
|
+
const w = u(n, e?.replacements), T = !!(m || e?.sanitizeText), i = e?.overrides, s = (...d) => L(d, w, T), g = (...d) => L(d, w), a = s(
|
|
63
|
+
i?.title,
|
|
64
|
+
e?.title,
|
|
65
|
+
o?.title,
|
|
66
|
+
t?.title
|
|
67
|
+
) ?? "", l = s(
|
|
68
|
+
i?.description,
|
|
69
|
+
e?.description,
|
|
70
|
+
o?.description,
|
|
71
|
+
t?.description
|
|
72
|
+
) ?? "", D = Q([
|
|
73
|
+
i?.keywords,
|
|
74
|
+
e?.keywords,
|
|
75
|
+
o?.keywords,
|
|
76
|
+
t?.keywords
|
|
77
|
+
], w, T), S = g(
|
|
78
|
+
i?.canonicalUrl,
|
|
79
|
+
e?.canonicalUrl,
|
|
80
|
+
o?.canonicalUrl,
|
|
81
|
+
t?.canonicalUrl
|
|
82
|
+
), U = X([
|
|
83
|
+
i?.robots,
|
|
84
|
+
e?.robots,
|
|
85
|
+
o?.robots,
|
|
86
|
+
t?.robots
|
|
87
|
+
], w), C = g(
|
|
88
|
+
i?.favicon,
|
|
89
|
+
e?.favicon,
|
|
90
|
+
o?.favicon,
|
|
91
|
+
t?.favicon
|
|
92
|
+
), p = g(
|
|
93
|
+
i?.image,
|
|
94
|
+
e?.image,
|
|
95
|
+
o?.image,
|
|
96
|
+
t?.image
|
|
97
|
+
), I = s(
|
|
98
|
+
i?.siteName,
|
|
99
|
+
e?.siteName,
|
|
100
|
+
o?.siteName,
|
|
101
|
+
t?.siteName
|
|
102
|
+
), h = s(
|
|
103
|
+
i?.ogTitle,
|
|
104
|
+
e?.ogTitle,
|
|
105
|
+
e?.title,
|
|
106
|
+
o?.ogTitle,
|
|
107
|
+
o?.title,
|
|
108
|
+
t?.ogTitle,
|
|
109
|
+
t?.title,
|
|
110
|
+
a
|
|
111
|
+
), N = s(
|
|
112
|
+
i?.ogDescription,
|
|
113
|
+
e?.ogDescription,
|
|
114
|
+
e?.description,
|
|
115
|
+
o?.ogDescription,
|
|
116
|
+
o?.description,
|
|
117
|
+
t?.ogDescription,
|
|
118
|
+
t?.description,
|
|
119
|
+
l
|
|
120
|
+
), v = g(
|
|
121
|
+
i?.ogImage,
|
|
122
|
+
e?.ogImage,
|
|
123
|
+
e?.image,
|
|
124
|
+
o?.ogImage,
|
|
125
|
+
o?.image,
|
|
126
|
+
t?.ogImage,
|
|
127
|
+
t?.image,
|
|
128
|
+
p
|
|
129
|
+
), A = s(
|
|
130
|
+
i?.ogImageAlt,
|
|
131
|
+
e?.ogImageAlt,
|
|
132
|
+
o?.ogImageAlt,
|
|
133
|
+
t?.ogImageAlt
|
|
134
|
+
), j = g(
|
|
135
|
+
i?.ogUrl,
|
|
136
|
+
e?.ogUrl,
|
|
137
|
+
e?.canonicalUrl,
|
|
138
|
+
o?.ogUrl,
|
|
139
|
+
o?.canonicalUrl,
|
|
140
|
+
t?.ogUrl,
|
|
141
|
+
t?.canonicalUrl,
|
|
142
|
+
S
|
|
143
|
+
), R = g(
|
|
144
|
+
i?.ogType,
|
|
145
|
+
e?.ogType,
|
|
146
|
+
o?.ogType,
|
|
147
|
+
t?.ogType,
|
|
148
|
+
r === "home" ? "website" : void 0
|
|
149
|
+
), B = s(
|
|
150
|
+
i?.ogSiteName,
|
|
151
|
+
e?.ogSiteName,
|
|
152
|
+
o?.ogSiteName,
|
|
153
|
+
t?.ogSiteName,
|
|
154
|
+
I
|
|
155
|
+
), _ = g(
|
|
156
|
+
i?.ogLocale,
|
|
157
|
+
e?.ogLocale,
|
|
158
|
+
o?.ogLocale,
|
|
159
|
+
t?.ogLocale
|
|
160
|
+
), E = g(
|
|
161
|
+
i?.twitterCard,
|
|
162
|
+
e?.twitterCard,
|
|
163
|
+
o?.twitterCard,
|
|
164
|
+
t?.twitterCard,
|
|
165
|
+
p ? "summary_large_image" : "summary"
|
|
166
|
+
), J = s(
|
|
167
|
+
i?.twitterTitle,
|
|
168
|
+
e?.twitterTitle,
|
|
169
|
+
e?.title,
|
|
170
|
+
o?.twitterTitle,
|
|
171
|
+
o?.title,
|
|
172
|
+
t?.twitterTitle,
|
|
173
|
+
t?.title,
|
|
174
|
+
a
|
|
175
|
+
), K = s(
|
|
176
|
+
i?.twitterDescription,
|
|
177
|
+
e?.twitterDescription,
|
|
178
|
+
e?.description,
|
|
179
|
+
o?.twitterDescription,
|
|
180
|
+
o?.description,
|
|
181
|
+
t?.twitterDescription,
|
|
182
|
+
t?.description,
|
|
183
|
+
l
|
|
184
|
+
), P = g(
|
|
185
|
+
i?.twitterImage,
|
|
186
|
+
e?.twitterImage,
|
|
187
|
+
e?.image,
|
|
188
|
+
o?.twitterImage,
|
|
189
|
+
o?.image,
|
|
190
|
+
t?.twitterImage,
|
|
191
|
+
t?.image,
|
|
100
192
|
p
|
|
101
|
-
),
|
|
102
|
-
i?.
|
|
103
|
-
e?.
|
|
104
|
-
o?.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
o?.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
o?.twitterCard ?? void 0,
|
|
119
|
-
s ? "summary_large_image" : "summary"
|
|
120
|
-
), j = t(
|
|
121
|
-
v(
|
|
122
|
-
i?.overrides?.twitterTitle ?? void 0,
|
|
123
|
-
i?.title ?? void 0,
|
|
124
|
-
e?.twitterTitle ?? void 0,
|
|
125
|
-
e?.title ?? void 0,
|
|
126
|
-
o?.twitterTitle ?? void 0,
|
|
127
|
-
o?.title ?? void 0,
|
|
128
|
-
g
|
|
129
|
-
)
|
|
130
|
-
), _ = t(
|
|
131
|
-
v(
|
|
132
|
-
i?.overrides?.twitterDescription ?? void 0,
|
|
133
|
-
i?.description ?? void 0,
|
|
134
|
-
e?.twitterDescription ?? void 0,
|
|
135
|
-
e?.description ?? void 0,
|
|
136
|
-
o?.twitterDescription ?? void 0,
|
|
137
|
-
o?.description ?? void 0,
|
|
138
|
-
m
|
|
139
|
-
)
|
|
140
|
-
), E = r(
|
|
141
|
-
i?.overrides?.twitterImage ?? void 0,
|
|
142
|
-
i?.image ?? void 0,
|
|
143
|
-
e?.twitterImage ?? void 0,
|
|
144
|
-
e?.image ?? void 0,
|
|
145
|
-
o?.twitterImage ?? void 0,
|
|
146
|
-
s
|
|
147
|
-
), R = r(
|
|
148
|
-
i?.overrides?.twitterSite ?? void 0,
|
|
149
|
-
e?.twitterSite ?? void 0,
|
|
150
|
-
o?.twitterSite ?? void 0
|
|
151
|
-
), z = r(
|
|
152
|
-
i?.overrides?.twitterCreator ?? void 0,
|
|
153
|
-
e?.twitterCreator ?? void 0,
|
|
154
|
-
o?.twitterCreator ?? void 0
|
|
155
|
-
), H = w ?? o?.siteName ?? null;
|
|
193
|
+
), H = s(
|
|
194
|
+
i?.twitterImageAlt,
|
|
195
|
+
e?.twitterImageAlt,
|
|
196
|
+
o?.twitterImageAlt,
|
|
197
|
+
t?.twitterImageAlt,
|
|
198
|
+
A
|
|
199
|
+
), M = g(
|
|
200
|
+
i?.twitterSite,
|
|
201
|
+
e?.twitterSite,
|
|
202
|
+
o?.twitterSite,
|
|
203
|
+
t?.twitterSite
|
|
204
|
+
), O = g(
|
|
205
|
+
i?.twitterCreator,
|
|
206
|
+
e?.twitterCreator,
|
|
207
|
+
o?.twitterCreator,
|
|
208
|
+
t?.twitterCreator
|
|
209
|
+
);
|
|
156
210
|
return {
|
|
157
|
-
pageType:
|
|
158
|
-
title:
|
|
159
|
-
titleTemplate:
|
|
160
|
-
i?.
|
|
161
|
-
e?.titleTemplate
|
|
162
|
-
o?.titleTemplate
|
|
211
|
+
pageType: r,
|
|
212
|
+
title: a,
|
|
213
|
+
titleTemplate: s(
|
|
214
|
+
i?.titleTemplate,
|
|
215
|
+
e?.titleTemplate,
|
|
216
|
+
o?.titleTemplate,
|
|
217
|
+
t?.titleTemplate
|
|
163
218
|
),
|
|
164
|
-
description:
|
|
165
|
-
keywords:
|
|
166
|
-
canonicalUrl:
|
|
167
|
-
robots:
|
|
168
|
-
favicon:
|
|
169
|
-
image:
|
|
170
|
-
ogTitle:
|
|
171
|
-
ogDescription:
|
|
172
|
-
ogImage:
|
|
173
|
-
ogImageAlt:
|
|
174
|
-
ogUrl:
|
|
175
|
-
ogType:
|
|
176
|
-
ogSiteName:
|
|
177
|
-
ogLocale:
|
|
178
|
-
twitterCard:
|
|
179
|
-
twitterTitle:
|
|
180
|
-
twitterDescription:
|
|
181
|
-
twitterImage:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
219
|
+
description: l,
|
|
220
|
+
keywords: D,
|
|
221
|
+
canonicalUrl: S,
|
|
222
|
+
robots: U,
|
|
223
|
+
favicon: C,
|
|
224
|
+
image: p,
|
|
225
|
+
ogTitle: h,
|
|
226
|
+
ogDescription: N,
|
|
227
|
+
ogImage: v,
|
|
228
|
+
ogImageAlt: A,
|
|
229
|
+
ogUrl: j,
|
|
230
|
+
ogType: R,
|
|
231
|
+
ogSiteName: B,
|
|
232
|
+
ogLocale: _,
|
|
233
|
+
twitterCard: E,
|
|
234
|
+
twitterTitle: J,
|
|
235
|
+
twitterDescription: K,
|
|
236
|
+
twitterImage: P,
|
|
237
|
+
twitterImageAlt: H,
|
|
238
|
+
twitterSite: M,
|
|
239
|
+
twitterCreator: O,
|
|
240
|
+
siteName: I,
|
|
241
|
+
jsonLd: $([
|
|
242
|
+
i?.jsonLd,
|
|
243
|
+
e?.jsonLd,
|
|
244
|
+
o?.jsonLd,
|
|
245
|
+
t?.jsonLd
|
|
246
|
+
])
|
|
186
247
|
};
|
|
187
|
-
},
|
|
248
|
+
}, x = {
|
|
188
249
|
apply: () => {
|
|
189
250
|
}
|
|
190
251
|
};
|
|
191
252
|
export {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
253
|
+
x as noopSeoAdapter,
|
|
254
|
+
b as normalizeSeo,
|
|
255
|
+
Z as normalizeSeoJsonLd,
|
|
256
|
+
G as normalizeSeoKeywords,
|
|
257
|
+
W as normalizeSeoRobots,
|
|
258
|
+
y as replaceSeoTokens
|
|
195
259
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface HtmlToPlainTextOptions {
|
|
2
|
+
preserveLineBreaks?: boolean;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Convert HTML/rich text into plain text without requiring DOM APIs.
|
|
6
|
+
* The scanner advances monotonically, so runtime is O(input length).
|
|
7
|
+
*/
|
|
8
|
+
export declare const htmlToPlainText: (value: string | null | undefined, options?: HtmlToPlainTextOptions) => string;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
const f = {
|
|
2
|
+
amp: "&",
|
|
3
|
+
apos: "'",
|
|
4
|
+
copy: "©",
|
|
5
|
+
emsp: " ",
|
|
6
|
+
ensp: " ",
|
|
7
|
+
gt: ">",
|
|
8
|
+
hellip: "…",
|
|
9
|
+
laquo: "«",
|
|
10
|
+
lt: "<",
|
|
11
|
+
mdash: "—",
|
|
12
|
+
nbsp: " ",
|
|
13
|
+
ndash: "–",
|
|
14
|
+
quot: '"',
|
|
15
|
+
raquo: "»",
|
|
16
|
+
reg: "®",
|
|
17
|
+
trade: "™"
|
|
18
|
+
}, g = /* @__PURE__ */ new Set([
|
|
19
|
+
"address",
|
|
20
|
+
"article",
|
|
21
|
+
"aside",
|
|
22
|
+
"blockquote",
|
|
23
|
+
"br",
|
|
24
|
+
"dd",
|
|
25
|
+
"div",
|
|
26
|
+
"dl",
|
|
27
|
+
"dt",
|
|
28
|
+
"figcaption",
|
|
29
|
+
"figure",
|
|
30
|
+
"footer",
|
|
31
|
+
"h1",
|
|
32
|
+
"h2",
|
|
33
|
+
"h3",
|
|
34
|
+
"h4",
|
|
35
|
+
"h5",
|
|
36
|
+
"h6",
|
|
37
|
+
"header",
|
|
38
|
+
"hr",
|
|
39
|
+
"li",
|
|
40
|
+
"main",
|
|
41
|
+
"nav",
|
|
42
|
+
"ol",
|
|
43
|
+
"p",
|
|
44
|
+
"pre",
|
|
45
|
+
"section",
|
|
46
|
+
"table",
|
|
47
|
+
"tbody",
|
|
48
|
+
"td",
|
|
49
|
+
"tfoot",
|
|
50
|
+
"th",
|
|
51
|
+
"thead",
|
|
52
|
+
"tr",
|
|
53
|
+
"ul"
|
|
54
|
+
]), u = (t) => {
|
|
55
|
+
if (t.startsWith("#")) {
|
|
56
|
+
const r = t[1]?.toLowerCase() === "x", a = t.slice(r ? 2 : 1), n = Number.parseInt(a, r ? 16 : 10);
|
|
57
|
+
if (!a || !Number.isFinite(n) || n <= 0 || n > 1114111)
|
|
58
|
+
return null;
|
|
59
|
+
try {
|
|
60
|
+
return String.fromCodePoint(n);
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return f[t.toLowerCase()] ?? null;
|
|
66
|
+
}, m = (t, r = {}) => {
|
|
67
|
+
if (!t) return "";
|
|
68
|
+
const a = t.toLowerCase(), n = [], l = () => {
|
|
69
|
+
const o = r.preserveLineBreaks ? `
|
|
70
|
+
` : " ";
|
|
71
|
+
n[n.length - 1] !== o && n.push(o);
|
|
72
|
+
};
|
|
73
|
+
let e = 0;
|
|
74
|
+
for (; e < t.length; ) {
|
|
75
|
+
if (t[e] === "<") {
|
|
76
|
+
if (t.startsWith("<!--", e)) {
|
|
77
|
+
const c = t.indexOf("-->", e + 4);
|
|
78
|
+
e = c === -1 ? t.length : c + 3;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const o = t.indexOf(">", e + 1);
|
|
82
|
+
if (o === -1) {
|
|
83
|
+
n.push(t.slice(e));
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
const s = t.slice(e + 1, o).trim(), p = s.startsWith("/"), i = s.replace(/^\//, "").match(/^[a-zA-Z][a-zA-Z0-9:-]*/)?.[0]?.toLowerCase() ?? "";
|
|
87
|
+
if (!p && (i === "script" || i === "style")) {
|
|
88
|
+
const c = a.indexOf(`</${i}`, o + 1);
|
|
89
|
+
if (c === -1) break;
|
|
90
|
+
const h = t.indexOf(">", c + i.length + 2);
|
|
91
|
+
e = h === -1 ? t.length : h + 1;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
g.has(i) && l(), e = o + 1;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (t[e] === "&") {
|
|
98
|
+
const o = t.indexOf(";", e + 1);
|
|
99
|
+
if (o !== -1 && o - e <= 32) {
|
|
100
|
+
const s = u(t.slice(e + 1, o));
|
|
101
|
+
if (s !== null) {
|
|
102
|
+
n.push(s), e = o + 1;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
n.push(t[e] ?? ""), e += 1;
|
|
108
|
+
}
|
|
109
|
+
const d = n.join("").replace(/\u00a0/g, " ");
|
|
110
|
+
return r.preserveLineBreaks ? d.replace(/[\t\f\v ]+/g, " ").replace(/ *\n */g, `
|
|
111
|
+
`).replace(/\n{3,}/g, `
|
|
112
|
+
|
|
113
|
+
`).trim() : d.replace(/\s+/g, " ").trim();
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
m as htmlToPlainText
|
|
117
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SeoUrlTrailingSlash = 'remove' | 'preserve' | 'add';
|
|
2
|
+
export interface ComposeSeoUrlOptions {
|
|
3
|
+
trailingSlash?: SeoUrlTrailingSlash;
|
|
4
|
+
includeSearch?: boolean;
|
|
5
|
+
includeHash?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Compose an absolute canonical/OG URL from an origin and route path.
|
|
9
|
+
* Invalid or non-HTTP(S) origins return an empty string.
|
|
10
|
+
*/
|
|
11
|
+
export declare const composeSeoUrl: (origin: string | null | undefined, path?: string, options?: ComposeSeoUrlOptions) => string;
|
|
12
|
+
/** Canonical-specific alias for discoverability. */
|
|
13
|
+
export declare const composeCanonicalUrl: (origin: string | null | undefined, path?: string, options?: ComposeSeoUrlOptions) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const h = (c, n = "/", a = {}) => {
|
|
2
|
+
if (!c) return "";
|
|
3
|
+
let r;
|
|
4
|
+
try {
|
|
5
|
+
r = new URL(c);
|
|
6
|
+
} catch {
|
|
7
|
+
return "";
|
|
8
|
+
}
|
|
9
|
+
if (r.protocol !== "http:" && r.protocol !== "https:") return "";
|
|
10
|
+
let t;
|
|
11
|
+
try {
|
|
12
|
+
t = new URL(n || "/", `${r.origin}/`);
|
|
13
|
+
} catch {
|
|
14
|
+
return "";
|
|
15
|
+
}
|
|
16
|
+
let e = t.pathname || "/";
|
|
17
|
+
const l = a.trailingSlash ?? "remove";
|
|
18
|
+
l === "remove" ? e = e === "/" ? "" : e.replace(/\/+$/, "") : l === "add" && (e = e === "/" ? "/" : `${e.replace(/\/+$/, "")}/`);
|
|
19
|
+
const o = a.includeSearch === !1 ? "" : t.search, s = a.includeHash === !0 ? t.hash : "";
|
|
20
|
+
return `${r.origin}${e}${o}${s}`;
|
|
21
|
+
}, i = h;
|
|
22
|
+
export {
|
|
23
|
+
i as composeCanonicalUrl,
|
|
24
|
+
h as composeSeoUrl
|
|
25
|
+
};
|