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.
Files changed (75) 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/Chart/GanttChart.vue.d.ts +13 -1
  6. package/components/Chart/GanttChart.vue.js +2 -2
  7. package/components/Chart/GanttChart.vue2.js +1185 -607
  8. package/components/Chart/GanttChartDateUtils.d.ts +38 -0
  9. package/components/Chart/GanttChartDateUtils.js +79 -0
  10. package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
  11. package/components/Chart/GanttChartDependencyUtils.js +113 -0
  12. package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
  13. package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
  14. package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
  15. package/components/Chart/GanttChartTooltipUtils.js +63 -0
  16. package/components/Chart/index.d.ts +3 -1
  17. package/components/Chart/types.d.ts +76 -1
  18. package/components/Chart/types.js +8 -0
  19. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  20. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  21. package/components/Form/AccordionView.vue2.js +5 -2
  22. package/components/Form/AccordionView.vue3.js +250 -0
  23. package/components/Form/Form.vue.js +2 -2
  24. package/components/Form/Form.vue2.js +309 -280
  25. package/components/Form/FormField.vue.js +175 -196
  26. package/components/Form/FormFields.vue.js +1 -1
  27. package/components/Form/FormFields.vue2.js +60 -60
  28. package/components/Form/FormSkeleton.vue.js +50 -35
  29. package/components/Form/TableView.vue.js +59 -43
  30. package/components/Form/composables/useForm.js +159 -148
  31. package/components/Form/index.vue2.js +8 -8
  32. package/components/Form/utils/form.utils.d.ts +2 -0
  33. package/components/Form/utils/form.utils.js +17 -13
  34. package/components/GoogleMap.vue.d.ts +1 -1
  35. package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
  36. package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
  37. package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
  38. package/components/PanZoomViewport/index.d.ts +2 -0
  39. package/components/PanZoomViewport/types.d.ts +121 -0
  40. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
  41. package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
  42. package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
  43. package/components/ScaleGenerator/types.d.ts +2 -0
  44. package/components/Screen/ScreenFilter.vue.js +19 -18
  45. package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
  46. package/components/SeoProvider/SeoProvider.vue.js +39 -33
  47. package/components/SeoProvider/domAdapter.d.ts +1 -4
  48. package/components/SeoProvider/domAdapter.js +71 -58
  49. package/components/SeoProvider/index.d.ts +5 -2
  50. package/components/SeoProvider/normalizeSeo.d.ts +10 -49
  51. package/components/SeoProvider/normalizeSeo.js +246 -182
  52. package/components/SeoProvider/plainText.d.ts +8 -0
  53. package/components/SeoProvider/plainText.js +117 -0
  54. package/components/SeoProvider/seoUrl.d.ts +13 -0
  55. package/components/SeoProvider/seoUrl.js +25 -0
  56. package/components/SeoProvider/structuredData.d.ts +100 -0
  57. package/components/SeoProvider/structuredData.js +33 -0
  58. package/components/SeoProvider/types.d.ts +47 -109
  59. package/components/Tabes/Tabes.vue.js +1 -1
  60. package/components/Tabes/Tabes.vue2.js +215 -193
  61. package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
  62. package/components/Tabes/TabesMarkerGeometry.js +21 -0
  63. package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
  64. package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
  65. package/components/ThemeProvider/index.d.ts +1 -1
  66. package/components/ThemeProvider/themeVars.d.ts +9 -13
  67. package/components/ThemeProvider/themeVars.js +173 -125
  68. package/components/ThemeProvider/types.d.ts +10 -0
  69. package/components/index.d.ts +2 -1
  70. package/index.d.ts +1 -0
  71. package/index.js +415 -387
  72. package/package.json +3 -2
  73. package/style.css +1 -1
  74. package/components/Form/AccordionView.vue.js +0 -222
  75. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,68 +1,81 @@
1
- const m = () => typeof document < "u" && typeof document.head < "u", a = (o, s, e, t) => {
2
- let i = o.head.querySelector(
3
- `meta[${s}="${e}"]`
4
- );
5
- return i || (i = o.createElement("meta"), i.setAttribute(s, e), o.head.appendChild(i)), i.setAttribute("content", t), i;
6
- }, p = (o, s, e) => {
7
- const t = o.head.querySelector(`meta[${s}="${e}"]`);
8
- t && t.remove();
9
- }, g = (o, s, e, t = {}) => {
10
- let i = o.head.querySelector(
11
- `link[rel="${s}"]${t.sizes ? `[sizes="${t.sizes}"]` : ""}`
12
- );
13
- if (!i) {
14
- i = o.createElement("link"), i.setAttribute("rel", s);
15
- for (const [n, r] of Object.entries(t))
16
- r && i.setAttribute(n, r);
17
- o.head.appendChild(i);
1
+ const f = "data-vlite3-seo", g = `script[type="application/ld+json"][${f}]`, d = () => typeof document < "u" && typeof document.head < "u", h = (i, o) => `${i}:${o}`, A = (i, o, s, t) => {
2
+ const r = `meta[${o}="${s}"]`, c = Array.from(i.head.querySelectorAll(r)), e = c.shift() ?? i.createElement("meta");
3
+ e.setAttribute(o, s), e.setAttribute(f, "meta"), e.setAttribute("content", t);
4
+ for (const n of c) n.remove();
5
+ return e.parentNode || i.head.appendChild(e), e;
6
+ }, u = (i, o, s) => {
7
+ const t = `meta[${o}="${s}"]`;
8
+ for (const r of i.head.querySelectorAll(t)) r.remove();
9
+ }, p = (i, o, s) => {
10
+ const t = Array.from(
11
+ i.head.querySelectorAll(`link[rel="${o}"]`)
12
+ ), r = t.shift() ?? i.createElement("link");
13
+ r.setAttribute("rel", o), r.setAttribute(f, "link"), r.setAttribute("href", s);
14
+ for (const c of t) c.remove();
15
+ return r.parentNode || i.head.appendChild(r), r;
16
+ }, m = (i, o) => {
17
+ for (const s of i.head.querySelectorAll(`link[rel="${o}"]`))
18
+ s.remove();
19
+ }, w = (i) => {
20
+ const o = /* @__PURE__ */ new Set(), s = [];
21
+ return i.jsonLd.forEach((t, r) => {
22
+ try {
23
+ const c = typeof t["@id"] == "string" ? t["@id"] : "", e = c ? `id:${c}` : `index:${r}`;
24
+ let n = e, l = 1;
25
+ for (; o.has(n); )
26
+ n = `${e}:${l}`, l += 1;
27
+ o.add(n);
28
+ const a = JSON.stringify(t);
29
+ a && s.push({ key: n, value: a });
30
+ } catch {
31
+ }
32
+ }), s;
33
+ }, k = (i, o) => {
34
+ const s = Array.from(
35
+ i.head.querySelectorAll(g)
36
+ ), t = /* @__PURE__ */ new Map();
37
+ for (const e of s) {
38
+ const n = e.getAttribute("data-vlite3-seo-key");
39
+ n && !t.has(n) && t.set(n, e);
40
+ }
41
+ const r = /* @__PURE__ */ new Set(), c = s.filter((e) => !e.hasAttribute("data-vlite3-seo-key"));
42
+ for (const e of w(o)) {
43
+ const n = t.get(e.key) ?? c.shift() ?? i.createElement("script");
44
+ n.setAttribute("type", "application/ld+json"), n.setAttribute(f, "json-ld"), n.setAttribute("data-vlite3-seo-key", e.key), n.textContent = e.value, n.parentNode || i.head.appendChild(n), r.add(n);
18
45
  }
19
- return i.setAttribute("href", e), i;
20
- }, f = (o, s) => {
21
- const e = o.head.querySelector(`link[rel="${s}"]`);
22
- e && e.remove();
23
- }, u = () => {
24
- const o = [], s = [];
46
+ for (const e of s)
47
+ r.has(e) || e.remove();
48
+ }, S = () => {
49
+ const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
50
+ let s = null;
25
51
  return {
26
- apply(e) {
27
- if (!m()) return;
28
- const t = document, i = e.titleTemplate ? e.titleTemplate.includes("%s") ? e.titleTemplate.replace("%s", e.title) : `${e.title} · ${e.titleTemplate}` : e.title;
29
- i && (t.title = i);
30
- const n = (r, c, l) => {
31
- l && l.length > 0 ? (a(t, r, c, l), o.push({ attribute: r, key: c })) : p(t, r, c);
52
+ apply(t) {
53
+ if (!d()) return;
54
+ const r = document;
55
+ s === null && (s = r.title);
56
+ const c = t.titleTemplate ? t.titleTemplate.includes("%s") ? t.titleTemplate.replace("%s", t.title) : `${t.title} · ${t.titleTemplate}` : t.title;
57
+ r.title = c;
58
+ const e = (n, l, a) => {
59
+ a ? (A(r, n, l, a), i.add(h(n, l))) : u(r, n, l);
32
60
  };
33
- if (n("name", "description", e.description), n("name", "keywords", e.keywords), n("name", "robots", e.robots), n("property", "og:title", e.ogTitle), n("property", "og:description", e.ogDescription), n("property", "og:image", e.ogImage), n("property", "og:image:alt", e.ogImageAlt), n("property", "og:url", e.ogUrl), n("property", "og:type", e.ogType), n("property", "og:site_name", e.ogSiteName), n("property", "og:locale", e.ogLocale), n("name", "twitter:card", e.twitterCard), n("name", "twitter:title", e.twitterTitle), n("name", "twitter:description", e.twitterDescription), n("name", "twitter:image", e.twitterImage), n("name", "twitter:site", e.twitterSite), n("name", "twitter:creator", e.twitterCreator), e.canonicalUrl) {
34
- let r = t.head.querySelector('link[rel="canonical"]');
35
- r || (r = t.createElement("link"), r.setAttribute("rel", "canonical"), t.head.appendChild(r)), r.setAttribute("href", e.canonicalUrl), s.push({ rel: "canonical" });
36
- } else
37
- f(t, "canonical");
38
- if (e.favicon && (g(t, "icon", e.favicon), s.push({ rel: "icon" })), e.jsonLd) {
39
- let r = t.head.querySelector(
40
- 'script[type="application/ld+json"][data-vlite3-seo]'
41
- );
42
- r || (r = t.createElement("script"), r.setAttribute("type", "application/ld+json"), r.setAttribute("data-vlite3-seo", ""), t.head.appendChild(r)), r.textContent = JSON.stringify(e.jsonLd);
43
- } else {
44
- const r = t.head.querySelector(
45
- 'script[type="application/ld+json"][data-vlite3-seo]'
46
- );
47
- r && r.remove();
48
- }
61
+ e("name", "description", t.description), e("name", "keywords", t.keywords), e("name", "robots", t.robots), e("property", "og:title", t.ogTitle), e("property", "og:description", t.ogDescription), e("property", "og:image", t.ogImage), e("property", "og:image:alt", t.ogImageAlt), e("property", "og:url", t.ogUrl), e("property", "og:type", t.ogType), e("property", "og:site_name", t.ogSiteName), e("property", "og:locale", t.ogLocale), e("name", "twitter:card", t.twitterCard), e("name", "twitter:title", t.twitterTitle), e("name", "twitter:description", t.twitterDescription), e("name", "twitter:image", t.twitterImage), e("name", "twitter:image:alt", t.twitterImageAlt), e("name", "twitter:site", t.twitterSite), e("name", "twitter:creator", t.twitterCreator), t.canonicalUrl ? (p(r, "canonical", t.canonicalUrl), o.add("canonical")) : m(r, "canonical"), t.favicon ? (p(r, "icon", t.favicon), o.add("icon")) : m(r, "icon"), k(r, t);
49
62
  },
50
63
  reset() {
51
- if (!m()) return;
52
- const e = document;
53
- for (const { attribute: i, key: n } of o)
54
- p(e, i, n);
55
- o.length = 0;
56
- for (const { rel: i } of s)
57
- f(e, i);
58
- s.length = 0;
59
- const t = e.head.querySelector(
60
- 'script[type="application/ld+json"][data-vlite3-seo]'
61
- );
62
- t && t.remove();
64
+ if (!d()) return;
65
+ const t = document;
66
+ for (const r of i) {
67
+ const c = r.indexOf(":"), e = r.slice(0, c);
68
+ u(t, e, r.slice(c + 1));
69
+ }
70
+ i.clear();
71
+ for (const r of o) m(t, r);
72
+ o.clear();
73
+ for (const r of t.head.querySelectorAll(g))
74
+ r.remove();
75
+ s !== null && (t.title = s), s = null;
63
76
  }
64
77
  };
65
78
  };
66
79
  export {
67
- u as createDomSeoAdapter
80
+ S as createDomSeoAdapter
68
81
  };
@@ -1,4 +1,7 @@
1
1
  export { default as SeoProvider } from './SeoProvider.vue';
2
- export { normalizeSeo, noopSeoAdapter, replaceSeoTokens, type NormalizeSeoInput, type SeoReplacements, } from './normalizeSeo';
2
+ export { normalizeSeo, noopSeoAdapter, normalizeSeoJsonLd, normalizeSeoKeywords, normalizeSeoRobots, replaceSeoTokens, type NormalizeSeoInput, type SeoReplacements, } from './normalizeSeo';
3
3
  export { createDomSeoAdapter } from './domAdapter';
4
- export type { SeoData, SeoPayload, SeoContextInput, SeoAdapter, } from './types';
4
+ export { htmlToPlainText, type HtmlToPlainTextOptions } from './plainText';
5
+ export { composeCanonicalUrl, composeSeoUrl, type ComposeSeoUrlOptions, type SeoUrlTrailingSlash, } from './seoUrl';
6
+ export * from './structuredData';
7
+ export type { SeoData, SeoPayload, SeoContextInput, SeoAdapter, SeoJsonLdInput, SeoKeywordsInput, SeoRobotsDirectives, SeoRobotsInput, } from './types';
@@ -1,61 +1,22 @@
1
- import { SeoAdapter, SeoContextInput, SeoData, SeoPayload } from './types';
2
- /**
3
- * The two token replacement scopes. Global tokens are always
4
- * applied (e.g. `{{storeName}}`); per-call tokens are supplied
5
- * by the page (`useSeo({ replacements: { productName } })`).
6
- */
1
+ import { SeoStructuredData } from './structuredData';
2
+ import { SeoAdapter, SeoContextInput, SeoData, SeoJsonLdInput, SeoKeywordsInput, SeoPayload, SeoRobotsInput } from './types';
7
3
  export type SeoReplacements = Record<string, string | number | null | undefined>;
8
- /**
9
- * Replace `{{key}}` occurrences in `value` using the supplied
10
- * replacements. Unknown / null / undefined keys collapse to an
11
- * empty string (matches the existing `shop-data` behaviour so
12
- * SEO strings with `{{productName}}` still resolve to a valid
13
- * meta tag when the page is missing the data).
14
- */
15
4
  export declare const replaceSeoTokens: (value: string | null | undefined, replacements?: SeoReplacements) => string;
16
- /**
17
- * Inputs to the normalizer.
18
- *
19
- * `defaults` is the **store / site-level** baseline (logo,
20
- * favicon, OG image, store name, …). `context` is the **page-
21
- * level** overlay (`useSeo({ … })`). `resolveFallback` lets the
22
- * caller plug in a domain-specific fallback (e.g. resolve
23
- * `pagesSeo[pageType]` for the shop). `pageType` is the final
24
- * string used in the payload (falls back to `'home'`).
25
- */
5
+ export declare const normalizeSeoKeywords: (value: SeoKeywordsInput | null | undefined, replacements?: SeoReplacements, sanitize?: boolean) => string;
6
+ export declare const normalizeSeoRobots: (value: SeoRobotsInput | null | undefined, replacements?: SeoReplacements) => string | null;
7
+ export declare const normalizeSeoJsonLd: (value: SeoJsonLdInput | null | undefined) => SeoStructuredData[];
26
8
  export interface NormalizeSeoInput {
27
9
  defaults?: Partial<SeoData> | null;
28
10
  context?: SeoContextInput | null;
29
11
  fallback?: Partial<SeoData> | null;
30
12
  pageType?: string;
31
- /**
32
- * Extra global replacements applied **before** per-context ones.
33
- * Used by the shop layer to inject `{{storeName}}` automatically.
34
- */
35
13
  globalReplacements?: SeoReplacements;
14
+ /** Sanitize textual fields after token replacement. */
15
+ sanitizeText?: boolean;
36
16
  }
37
17
  /**
38
- * Resolve the final SEO payload.
39
- *
40
- * Precedence (highest wins):
41
- *
42
- * 1. `context.overrides` — raw, unrestricted fields from
43
- * the page (`useSeo({ overrides })`).
44
- * 2. `context.<field>` — per-page explicit value.
45
- * 3. `fallback.<field>` — store / domain fallback
46
- * (e.g. `pagesSeo[pageType]`).
47
- * 4. `defaults.<field>` — site-level baseline (logo, OG
48
- * image, site name, …).
49
- *
50
- * Empty strings are treated as "use the next layer", matching
51
- * the existing `resolveStoreSeo` contract. `null` is treated as
52
- * "explicitly clear" and forces `null` in the output. (Useful
53
- * for `noindex` overrides etc.)
54
- */
55
- export declare const normalizeSeo: ({ defaults, context, fallback, pageType, globalReplacements, }: NormalizeSeoInput) => SeoPayload;
56
- /**
57
- * No-op adapter. Useful as a fallback in tests / SSR-only
58
- * contexts where SEO is already rendered by the host template
59
- * and the generic provider should not touch the DOM.
18
+ * Precedence: context overrides context fields → page fallback → defaults.
19
+ * Empty values fall through; `null` explicitly clears the inherited value.
60
20
  */
21
+ export declare const normalizeSeo: ({ defaults, context, fallback, pageType, globalReplacements, sanitizeText, }: NormalizeSeoInput) => SeoPayload;
61
22
  export declare const noopSeoAdapter: SeoAdapter;