vlite3 1.4.16 → 1.4.18

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 (32) hide show
  1. package/components/CategoryManager/CategoryManager.vue2.js +2 -2
  2. package/components/Invoice/InvoiceVariant1.vue.js +8 -8
  3. package/components/Invoice/InvoiceVariant2.vue.js +9 -9
  4. package/components/Invoice/InvoiceVariant3.vue.js +7 -7
  5. package/components/Invoice/InvoiceVariant4.vue.js +56 -56
  6. package/components/Invoice/types.d.ts +2 -0
  7. package/components/QRCode/QRCode.vue.d.ts +4 -10
  8. package/components/QRCode/QRCode.vue.js +45 -15
  9. package/components/QRCode/index.d.ts +1 -0
  10. package/components/QRCode/types.d.ts +14 -0
  11. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  12. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  13. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  14. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +1 -1
  15. package/components/Screen/ScreenFilter.vue.js +2 -2
  16. package/components/SeoProvider/SeoProvider.vue.d.ts +70 -0
  17. package/components/SeoProvider/SeoProvider.vue.js +52 -0
  18. package/components/SeoProvider/SeoProvider.vue2.js +4 -0
  19. package/components/SeoProvider/domAdapter.d.ts +6 -0
  20. package/components/SeoProvider/domAdapter.js +68 -0
  21. package/components/SeoProvider/index.d.ts +4 -0
  22. package/components/SeoProvider/normalizeSeo.d.ts +61 -0
  23. package/components/SeoProvider/normalizeSeo.js +195 -0
  24. package/components/SeoProvider/types.d.ts +146 -0
  25. package/components/ThemeToggle.vue.d.ts +1 -1
  26. package/composables/useSeo.d.ts +34 -0
  27. package/composables/useSeo.js +28 -0
  28. package/index.d.ts +2 -0
  29. package/index.js +230 -219
  30. package/package.json +1 -1
  31. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  32. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
@@ -0,0 +1,34 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { SeoContextInput } from '../components/SeoProvider/types';
3
+ /**
4
+ * Mutable, reactive bag of SEO contexts. The provider owns the
5
+ * ref; pages push into it. We keep it as a `Map` so multiple
6
+ * pages on the same route (e.g. a checkout step embedded in a
7
+ * parent) can each contribute, and so `clear()` removes only
8
+ * the calling page's contribution.
9
+ */
10
+ export type SeoContextBag = Ref<Map<symbol, SeoContextInput>>;
11
+ export declare const SEO_CONTEXT_KEY: InjectionKey<SeoContextBag>;
12
+ /**
13
+ * Minimal interface the page-level composable needs from the
14
+ * provider. Exposed as a separate type so the provider component
15
+ * doesn't have to import Vue's `provide` / `inject` machinery
16
+ * from the composable side.
17
+ */
18
+ export interface SeoContextRegistrar {
19
+ register(input: SeoContextInput): SeoContextHandle;
20
+ }
21
+ /**
22
+ * Per-page handle. `update()` replaces the registered context
23
+ * in place; `clear()` removes it.
24
+ */
25
+ export interface SeoContextHandle {
26
+ update(next: SeoContextInput): void;
27
+ clear(): void;
28
+ }
29
+ /**
30
+ * Public composable. Safe to call outside a provider — falls
31
+ * back to a no-op registrar so admin shells and one-off tests
32
+ * don't have to wire the provider up just to render.
33
+ */
34
+ export declare const useSeo: (input?: SeoContextInput) => SeoContextHandle;
@@ -0,0 +1,28 @@
1
+ import { inject as r, onBeforeUnmount as u } from "vue";
2
+ const a = /* @__PURE__ */ Symbol("vlite3:seo-context"), s = (o = {}) => {
3
+ const e = r(a, null);
4
+ if (!e)
5
+ return {
6
+ update: () => {
7
+ },
8
+ clear: () => {
9
+ }
10
+ };
11
+ const t = /* @__PURE__ */ Symbol("vlite3:seo-context-entry");
12
+ e.value.set(t, o);
13
+ const n = {
14
+ update(l) {
15
+ e.value.set(t, l);
16
+ },
17
+ clear() {
18
+ e.value.delete(t);
19
+ }
20
+ };
21
+ return u(() => {
22
+ e.value.delete(t);
23
+ }), n;
24
+ };
25
+ export {
26
+ a as SEO_CONTEXT_KEY,
27
+ s as useSeo
28
+ };
package/index.d.ts CHANGED
@@ -63,8 +63,10 @@ export * from './components/AsyncSelect';
63
63
  export * from './components/ImageComparison';
64
64
  export { default as ImageMagnifier } from './components/ImageMagnifier.vue';
65
65
  export * from './components/ThemeProvider';
66
+ export * from './components/SeoProvider';
66
67
  export * from './components/ScaleGenerator';
67
68
  export { THEME_STYLES_KEY, useThemeStyles } from './composables/useThemeStyles';
69
+ export { useSeo, SEO_CONTEXT_KEY, type SeoContextBag, type SeoContextHandle } from './composables/useSeo';
68
70
  export { default as Icon } from './components/Icon.vue';
69
71
  export { default as Logo } from './components/Logo.vue';
70
72
  export { default as Alert } from './components/Alert.vue';