vlite3 1.4.31 → 1.4.33

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.
Files changed (102) hide show
  1. package/components/Accordion/Accordion.vue.js +19 -16
  2. package/components/Accordion/AccordionContent.vue.js +2 -2
  3. package/components/Accordion/AccordionItem.vue.js +38 -36
  4. package/components/CategoryManager/CategoryManager.vue2.js +4 -3
  5. package/components/CategoryManager/CategoryNode.vue.js +30 -30
  6. package/components/CategoryMenu/CategoryMenu.vue.js +9 -11
  7. package/components/Chart/GanttChart.vue.d.ts +18 -2
  8. package/components/Chart/GanttChart.vue.js +1 -1
  9. package/components/Chart/GanttChart.vue2.js +1347 -604
  10. package/components/Chart/GanttChartConnectorRouting.d.ts +83 -0
  11. package/components/Chart/GanttChartConnectorRouting.js +405 -0
  12. package/components/Chart/GanttChartDateUtils.d.ts +38 -0
  13. package/components/Chart/GanttChartDateUtils.js +79 -0
  14. package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
  15. package/components/Chart/GanttChartDependencyUtils.js +109 -0
  16. package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
  17. package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
  18. package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
  19. package/components/Chart/GanttChartTooltipUtils.js +63 -0
  20. package/components/Chart/index.d.ts +3 -1
  21. package/components/Chart/types.d.ts +92 -2
  22. package/components/Chart/types.js +8 -0
  23. package/components/ColorPicker/ColorIro.vue2.js +155 -0
  24. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  25. package/components/ColorPicker/ColorPicker.vue.d.ts +5 -0
  26. package/components/ColorPicker/ColorPicker.vue.js +111 -65
  27. package/components/ColorPicker/constants.d.ts +2 -0
  28. package/components/ColorPicker/constants.js +4 -0
  29. package/components/ColorPicker/index.d.ts +1 -0
  30. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  31. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  32. package/components/Dropdown/Dropdown.vue.js +100 -97
  33. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  34. package/components/Form/AccordionView.vue.js +5 -220
  35. package/components/Form/AccordionView.vue3.js +250 -0
  36. package/components/Form/Form.vue.js +2 -2
  37. package/components/Form/Form.vue2.js +309 -280
  38. package/components/Form/FormField.vue.js +177 -197
  39. package/components/Form/FormFields.vue.js +1 -1
  40. package/components/Form/FormFields.vue2.js +60 -60
  41. package/components/Form/FormSkeleton.vue.js +50 -35
  42. package/components/Form/TableView.vue.js +59 -43
  43. package/components/Form/composables/useForm.js +159 -148
  44. package/components/Form/index.vue2.js +7 -7
  45. package/components/Form/utils/form.utils.d.ts +2 -0
  46. package/components/Form/utils/form.utils.js +17 -13
  47. package/components/GoogleMap.vue.d.ts +1 -1
  48. package/components/Kanban/Kanban.vue.d.ts +16 -2
  49. package/components/Kanban/Kanban.vue.js +2 -2
  50. package/components/Kanban/Kanban.vue2.js +150 -86
  51. package/components/Kanban/types.d.ts +37 -0
  52. package/components/NavbarCommandPalette.vue.js +1 -1
  53. package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
  54. package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
  55. package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
  56. package/components/PanZoomViewport/index.d.ts +2 -0
  57. package/components/PanZoomViewport/types.d.ts +121 -0
  58. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
  59. package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
  60. package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
  61. package/components/ScaleGenerator/types.d.ts +2 -0
  62. package/components/Screen/ScreenFilter.vue.js +19 -18
  63. package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
  64. package/components/SeoProvider/SeoProvider.vue.js +39 -33
  65. package/components/SeoProvider/domAdapter.d.ts +1 -4
  66. package/components/SeoProvider/domAdapter.js +71 -58
  67. package/components/SeoProvider/index.d.ts +5 -2
  68. package/components/SeoProvider/normalizeSeo.d.ts +10 -49
  69. package/components/SeoProvider/normalizeSeo.js +246 -182
  70. package/components/SeoProvider/plainText.d.ts +8 -0
  71. package/components/SeoProvider/plainText.js +117 -0
  72. package/components/SeoProvider/seoUrl.d.ts +13 -0
  73. package/components/SeoProvider/seoUrl.js +25 -0
  74. package/components/SeoProvider/structuredData.d.ts +100 -0
  75. package/components/SeoProvider/structuredData.js +33 -0
  76. package/components/SeoProvider/types.d.ts +47 -109
  77. package/components/Tabes/Tabes.vue.js +1 -1
  78. package/components/Tabes/Tabes.vue2.js +215 -193
  79. package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
  80. package/components/Tabes/TabesMarkerGeometry.js +21 -0
  81. package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
  82. package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
  83. package/components/ThemeProvider/index.d.ts +1 -1
  84. package/components/ThemeProvider/themeVars.d.ts +9 -13
  85. package/components/ThemeProvider/themeVars.js +173 -125
  86. package/components/ThemeProvider/types.d.ts +10 -0
  87. package/components/ToastNotification.vue.js +1 -1
  88. package/components/ToastNotification.vue2.js +3 -3
  89. package/components/index.d.ts +3 -2
  90. package/composables/useKeyStroke.d.ts +18 -0
  91. package/composables/useKeyStroke.js +103 -77
  92. package/composables/useTheme.js +1 -1
  93. package/index.d.ts +2 -0
  94. package/index.js +380 -350
  95. package/package.json +12 -4
  96. package/style.css +1 -1
  97. package/utils/environment.d.ts +29 -0
  98. package/utils/environment.js +4 -0
  99. package/utils/functions.js +14 -13
  100. package/components/ColorPicker/ColorIro.vue.js +0 -141
  101. package/components/Form/AccordionView.vue2.js +0 -4
  102. /package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +0 -0
@@ -1,195 +1,259 @@
1
- const P = /\{\{(\w+)\}\}/g, q = (o, i = {}) => o ? o.replace(P, (e, n) => {
2
- const d = i[n];
3
- return d == null ? "" : String(d);
4
- }) : "", v = (...o) => {
5
- for (const i of o)
6
- if (typeof i == "string" && i.length > 0) return i;
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
- }, r = (...o) => {
9
- for (const i of o) {
10
- if (typeof i == "string")
11
- return i.length > 0 ? i : null;
12
- if (i === null) return null;
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
- }, B = (o, i) => ({
16
- ...o ?? {},
17
- ...i ?? {}
18
- }), F = ({
19
- defaults: o,
20
- context: i,
21
- fallback: e,
22
- pageType: n = "home",
23
- globalReplacements: d
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 c = B(
26
- d,
27
- i?.replacements
28
- ), t = (O) => q(O, c), g = t(
29
- v(
30
- i?.title ?? void 0,
31
- e?.title ?? void 0,
32
- o?.title ?? void 0
33
- )
34
- ), m = t(
35
- v(
36
- i?.description ?? void 0,
37
- e?.description ?? void 0,
38
- o?.description ?? void 0
39
- )
40
- ), T = t(
41
- v(
42
- i?.keywords ?? void 0,
43
- e?.keywords ?? void 0,
44
- o?.keywords ?? void 0
45
- )
46
- ), p = r(
47
- i?.canonicalUrl ?? void 0,
48
- e?.canonicalUrl ?? void 0,
49
- o?.canonicalUrl ?? void 0
50
- ), S = r(
51
- i?.robots ?? void 0,
52
- e?.robots ?? void 0,
53
- o?.robots ?? void 0
54
- ), y = r(
55
- i?.overrides?.favicon ?? void 0,
56
- e?.favicon ?? void 0,
57
- o?.favicon ?? void 0
58
- ), s = r(
59
- i?.image ?? void 0,
60
- e?.image ?? void 0,
61
- o?.image ?? void 0
62
- ), I = t(
63
- v(
64
- i?.overrides?.ogTitle ?? void 0,
65
- i?.title ?? void 0,
66
- e?.ogTitle ?? void 0,
67
- e?.title ?? void 0,
68
- o?.ogTitle ?? void 0,
69
- o?.title ?? void 0,
70
- g
71
- )
72
- ), U = t(
73
- v(
74
- i?.overrides?.ogDescription ?? void 0,
75
- i?.description ?? void 0,
76
- e?.ogDescription ?? void 0,
77
- e?.description ?? void 0,
78
- o?.ogDescription ?? void 0,
79
- o?.description ?? void 0,
80
- m
81
- )
82
- ), L = r(
83
- i?.overrides?.ogImage ?? void 0,
84
- i?.image ?? void 0,
85
- e?.ogImage ?? void 0,
86
- e?.image ?? void 0,
87
- o?.ogImage ?? void 0,
88
- s
89
- ), C = r(
90
- i?.overrides?.ogImageAlt ?? void 0,
91
- e?.ogImageAlt ?? void 0,
92
- o?.ogImageAlt ?? void 0
93
- ), D = r(
94
- i?.overrides?.ogUrl ?? void 0,
95
- i?.canonicalUrl ?? void 0,
96
- e?.ogUrl ?? void 0,
97
- e?.canonicalUrl ?? void 0,
98
- o?.ogUrl ?? void 0,
99
- o?.canonicalUrl ?? void 0,
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
- ), N = r(
102
- i?.overrides?.ogType ?? void 0,
103
- e?.ogType ?? void 0,
104
- o?.ogType ?? void 0,
105
- n === "home" ? "website" : null
106
- ), w = r(
107
- i?.overrides?.ogSiteName ?? void 0,
108
- e?.ogSiteName ?? void 0,
109
- o?.ogSiteName ?? void 0,
110
- o?.siteName ?? void 0
111
- ), A = r(
112
- i?.overrides?.ogLocale ?? void 0,
113
- e?.ogLocale ?? void 0,
114
- o?.ogLocale ?? void 0
115
- ), h = r(
116
- i?.overrides?.twitterCard ?? void 0,
117
- e?.twitterCard ?? void 0,
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: n,
158
- title: g,
159
- titleTemplate: r(
160
- i?.overrides?.titleTemplate ?? void 0,
161
- e?.titleTemplate ?? void 0,
162
- o?.titleTemplate ?? void 0
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: m,
165
- keywords: T,
166
- canonicalUrl: p,
167
- robots: S,
168
- favicon: y,
169
- image: s,
170
- ogTitle: I,
171
- ogDescription: U,
172
- ogImage: L,
173
- ogImageAlt: C,
174
- ogUrl: D,
175
- ogType: N,
176
- ogSiteName: w,
177
- ogLocale: A,
178
- twitterCard: h,
179
- twitterTitle: j,
180
- twitterDescription: _,
181
- twitterImage: E,
182
- twitterSite: R,
183
- twitterCreator: z,
184
- siteName: H,
185
- jsonLd: i?.overrides?.jsonLd ?? e?.jsonLd ?? o?.jsonLd ?? null
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
- }, G = {
248
+ }, x = {
188
249
  apply: () => {
189
250
  }
190
251
  };
191
252
  export {
192
- G as noopSeoAdapter,
193
- F as normalizeSeo,
194
- q as replaceSeoTokens
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
+ };