vue-intlayer 6.1.6 → 7.0.0-canary.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.
Files changed (129) hide show
  1. package/dist/{ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-kiSW4cfM.js → ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-Cb_MV4HT.js} +1 -1
  2. package/dist/{ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CBP8x_i1.mjs → ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-Ckh-fn8X.mjs} +7 -7
  3. package/dist/cjs/client/index.cjs +1 -1
  4. package/dist/cjs/client/installIntlayer.cjs +1 -1
  5. package/dist/cjs/client/useDictionary.cjs +1 -1
  6. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  7. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  8. package/dist/cjs/client/useIntlayer.cjs +1 -1
  9. package/dist/cjs/client/useLoadDynamic.cjs +1 -1
  10. package/dist/cjs/client/useLocale.cjs +1 -1
  11. package/dist/cjs/client/useLocaleStorage.cjs +1 -0
  12. package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
  13. package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
  14. package/dist/cjs/editor/dictionariesRecord.cjs +1 -1
  15. package/dist/cjs/editor/editedContent.cjs +1 -1
  16. package/dist/cjs/editor/editorLocale.cjs +1 -1
  17. package/dist/cjs/editor/index.cjs +1 -1
  18. package/dist/cjs/index.cjs +1 -1
  19. package/dist/cjs/plugins.cjs +1 -1
  20. package/dist/esm/client/index.mjs +18 -15
  21. package/dist/esm/client/installIntlayer.mjs +18 -16
  22. package/dist/esm/client/useDictionary.mjs +42 -19
  23. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  24. package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
  25. package/dist/esm/client/useIntlayer.mjs +52 -19
  26. package/dist/esm/client/useLoadDynamic.mjs +3 -2
  27. package/dist/esm/client/useLocale.mjs +18 -10
  28. package/dist/esm/client/useLocaleStorage.mjs +29 -0
  29. package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
  30. package/dist/esm/editor/EditorSelectorRenderer.mjs +1 -1
  31. package/dist/esm/editor/dictionariesRecord.mjs +18 -18
  32. package/dist/esm/editor/editedContent.mjs +37 -27
  33. package/dist/esm/editor/editorEnabled.mjs +2 -2
  34. package/dist/esm/editor/editorLocale.mjs +5 -4
  35. package/dist/esm/editor/index.mjs +1 -1
  36. package/dist/esm/getDictionary.mjs +1 -5
  37. package/dist/esm/index.mjs +22 -19
  38. package/dist/esm/plugins.mjs +7 -6
  39. package/dist/types/UI/ContentSelector.vue.d.ts +0 -1
  40. package/dist/types/client/index.d.ts +0 -1
  41. package/dist/types/client/installIntlayer.d.ts +5 -5
  42. package/dist/types/client/useDictionary.d.ts +2 -5
  43. package/dist/types/client/useDictionaryAsync.d.ts +2 -4
  44. package/dist/types/client/useDictionaryDynamic.d.ts +2 -4
  45. package/dist/types/client/useIntlayer.d.ts +8 -9
  46. package/dist/types/client/useLoadDynamic.d.ts +0 -1
  47. package/dist/types/client/useLocale.d.ts +10 -8
  48. package/dist/types/client/useLocaleStorage.d.ts +39 -0
  49. package/dist/types/editor/ContentSelectorWrapper.vue.d.ts +1 -2
  50. package/dist/types/editor/communicator.d.ts +0 -1
  51. package/dist/types/editor/configuration.d.ts +0 -1
  52. package/dist/types/editor/createSharedComposable.d.ts +0 -1
  53. package/dist/types/editor/dictionariesRecord.d.ts +1 -2
  54. package/dist/types/editor/editedContent.d.ts +2 -3
  55. package/dist/types/editor/editorEnabled.d.ts +0 -1
  56. package/dist/types/editor/editorLocale.d.ts +0 -1
  57. package/dist/types/editor/focusDictionary.d.ts +1 -2
  58. package/dist/types/editor/index.d.ts +0 -1
  59. package/dist/types/editor/installIntlayerEditor.d.ts +0 -1
  60. package/dist/types/editor/useCrossFrameMessageListener.d.ts +0 -1
  61. package/dist/types/editor/useCrossFrameState.d.ts +0 -1
  62. package/dist/types/editor/useCrossURLPathState.d.ts +0 -1
  63. package/dist/types/editor/useEditedContentRenderer.d.ts +1 -2
  64. package/dist/types/editor/useEditor.d.ts +0 -1
  65. package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -1
  66. package/dist/types/format/index.d.ts +0 -1
  67. package/dist/types/format/useCompact.d.ts +0 -1
  68. package/dist/types/format/useCurrency.d.ts +0 -1
  69. package/dist/types/format/useDate.d.ts +0 -1
  70. package/dist/types/format/useList.d.ts +0 -1
  71. package/dist/types/format/useNumber.d.ts +0 -1
  72. package/dist/types/format/usePercentage.d.ts +0 -1
  73. package/dist/types/format/useRelativeTime.d.ts +0 -1
  74. package/dist/types/format/useUnit.d.ts +0 -1
  75. package/dist/types/getDictionary.d.ts +3 -4
  76. package/dist/types/getIntlayer.d.ts +3 -4
  77. package/dist/types/index.d.ts +1 -2
  78. package/dist/types/markdown/index.d.ts +0 -1
  79. package/dist/types/markdown/installIntlayerMarkdown.d.ts +1 -2
  80. package/dist/types/plugins.d.ts +3 -3
  81. package/dist/types/renderIntlayerNode.d.ts +0 -1
  82. package/package.json +47 -47
  83. package/LICENSE +0 -202
  84. package/dist/cjs/client/useLocaleCookie.cjs +0 -1
  85. package/dist/esm/client/useLocaleCookie.mjs +0 -19
  86. package/dist/types/UI/ContentSelector.vue.d.ts.map +0 -1
  87. package/dist/types/client/index.d.ts.map +0 -1
  88. package/dist/types/client/installIntlayer.d.ts.map +0 -1
  89. package/dist/types/client/useDictionary.d.ts.map +0 -1
  90. package/dist/types/client/useDictionaryAsync.d.ts.map +0 -1
  91. package/dist/types/client/useDictionaryDynamic.d.ts.map +0 -1
  92. package/dist/types/client/useIntlayer.d.ts.map +0 -1
  93. package/dist/types/client/useLoadDynamic.d.ts.map +0 -1
  94. package/dist/types/client/useLocale.d.ts.map +0 -1
  95. package/dist/types/client/useLocaleCookie.d.ts +0 -17
  96. package/dist/types/client/useLocaleCookie.d.ts.map +0 -1
  97. package/dist/types/editor/ContentSelectorWrapper.vue.d.ts.map +0 -1
  98. package/dist/types/editor/communicator.d.ts.map +0 -1
  99. package/dist/types/editor/configuration.d.ts.map +0 -1
  100. package/dist/types/editor/createSharedComposable.d.ts.map +0 -1
  101. package/dist/types/editor/dictionariesRecord.d.ts.map +0 -1
  102. package/dist/types/editor/editedContent.d.ts.map +0 -1
  103. package/dist/types/editor/editorEnabled.d.ts.map +0 -1
  104. package/dist/types/editor/editorLocale.d.ts.map +0 -1
  105. package/dist/types/editor/focusDictionary.d.ts.map +0 -1
  106. package/dist/types/editor/index.d.ts.map +0 -1
  107. package/dist/types/editor/installIntlayerEditor.d.ts.map +0 -1
  108. package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +0 -1
  109. package/dist/types/editor/useCrossFrameState.d.ts.map +0 -1
  110. package/dist/types/editor/useCrossURLPathState.d.ts.map +0 -1
  111. package/dist/types/editor/useEditedContentRenderer.d.ts.map +0 -1
  112. package/dist/types/editor/useEditor.d.ts.map +0 -1
  113. package/dist/types/editor/useIframeClickInterceptor.d.ts.map +0 -1
  114. package/dist/types/format/index.d.ts.map +0 -1
  115. package/dist/types/format/useCompact.d.ts.map +0 -1
  116. package/dist/types/format/useCurrency.d.ts.map +0 -1
  117. package/dist/types/format/useDate.d.ts.map +0 -1
  118. package/dist/types/format/useList.d.ts.map +0 -1
  119. package/dist/types/format/useNumber.d.ts.map +0 -1
  120. package/dist/types/format/usePercentage.d.ts.map +0 -1
  121. package/dist/types/format/useRelativeTime.d.ts.map +0 -1
  122. package/dist/types/format/useUnit.d.ts.map +0 -1
  123. package/dist/types/getDictionary.d.ts.map +0 -1
  124. package/dist/types/getIntlayer.d.ts.map +0 -1
  125. package/dist/types/index.d.ts.map +0 -1
  126. package/dist/types/markdown/index.d.ts.map +0 -1
  127. package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +0 -1
  128. package/dist/types/plugins.d.ts.map +0 -1
  129. package/dist/types/renderIntlayerNode.d.ts.map +0 -1
@@ -1,42 +1,52 @@
1
- import { getContentNodeByKeyPath as s } from "@intlayer/core";
2
- import { MessageKey as a } from "@intlayer/editor";
3
- import { ref as c, readonly as C, inject as E, watch as d } from "vue";
4
- import { createSharedComposable as l } from "./createSharedComposable.mjs";
5
- import { useCrossFrameState as u } from "./useCrossFrameState.mjs";
6
- let o = null;
7
- const i = Symbol("EditedContent"), m = () => {
8
- if (o) return o;
9
- const t = c({});
10
- return o = {
11
- editedContent: C(t),
1
+ import { getContentNodeByKeyPath as c } from "@intlayer/core";
2
+ import { MessageKey as l } from "@intlayer/editor";
3
+ import { ref as E, readonly as f, inject as m, watch as C } from "vue";
4
+ import { createSharedComposable as N } from "./createSharedComposable.mjs";
5
+ import { useCrossFrameState as p } from "./useCrossFrameState.mjs";
6
+ let i = null;
7
+ const u = Symbol("EditedContent"), T = () => {
8
+ if (i) return i;
9
+ const t = E({});
10
+ return i = {
11
+ editedContent: f(t),
12
12
  getEditedContentValue: (e, r) => {
13
- const n = t.value?.[e]?.content;
14
- if (n)
15
- return s(n, r);
13
+ const n = t.value;
14
+ if (!n) return;
15
+ if (e.includes(":local:") || e.includes(":remote:")) {
16
+ const o = n?.[e]?.content ?? {};
17
+ return c(o, r);
18
+ }
19
+ const a = Object.keys(n).filter(
20
+ (o) => o.startsWith(`${e}:`)
21
+ );
22
+ for (const o of a) {
23
+ const d = n?.[o]?.content ?? {}, s = c(d, r);
24
+ if (s) return s;
25
+ }
16
26
  },
17
27
  setEditedContent: (e) => {
18
28
  t.value = e;
19
29
  }
20
- }, o;
21
- }, _ = (t) => {
22
- const e = m();
23
- t.provide(i, e);
24
- }, y = l(() => {
25
- const t = E(i);
30
+ }, i;
31
+ }, S = (t) => {
32
+ const e = T();
33
+ t.provide(u, e);
34
+ }, b = N(() => {
35
+ const t = m(u);
26
36
  if (!t)
27
37
  throw new Error("EditedContent state not found");
28
- const [e, r] = u(
29
- a.INTLAYER_EDITED_CONTENT_CHANGED,
38
+ const [e, r] = p(
39
+ l.INTLAYER_EDITED_CONTENT_CHANGED,
30
40
  {}
31
41
  );
32
- return d(e, (n) => {
42
+ return C(e, (n) => {
33
43
  t.editedContent.value = n ?? {};
34
- }), d(t, (n) => {
44
+ }), C(t, (n) => {
35
45
  r(n.editedContent.value);
36
46
  }), t;
37
47
  });
38
48
  export {
39
- m as createEditedContentClient,
40
- _ as installEditedContent,
41
- y as useEditedContent
49
+ T as createEditedContentClient,
50
+ S as installEditedContent,
51
+ b as useEditedContent
42
52
  };
@@ -15,7 +15,7 @@ const s = Symbol("EditorEnabled"), l = () => typeof window > "u" ? !1 : window.s
15
15
  isInIframe: t,
16
16
  enabled: d
17
17
  }, r;
18
- }, _ = (e) => {
18
+ }, T = (e) => {
19
19
  const n = b();
20
20
  typeof window < "u" && (n.isInIframe.value = l()), e.provide(s, n);
21
21
  }, A = I(() => {
@@ -51,6 +51,6 @@ const s = Symbol("EditorEnabled"), l = () => typeof window > "u" ? !1 : window.s
51
51
  });
52
52
  export {
53
53
  b as createEditorEnabledClient,
54
- _ as installEditorEnabled,
54
+ T as installEditorEnabled,
55
55
  A as useEditorEnabled
56
56
  };
@@ -2,14 +2,15 @@ import { MessageKey as e } from "@intlayer/editor";
2
2
  import { inject as m, watch as i } from "vue";
3
3
  import { INTLAYER_SYMBOL as a } from "../client/installIntlayer.mjs";
4
4
  import "@intlayer/core";
5
+ import "@intlayer/types";
6
+ import "./communicator.mjs";
5
7
  import "@intlayer/config/built";
6
8
  import { createSharedComposable as p } from "./createSharedComposable.mjs";
7
- import "./communicator.mjs";
8
9
  import { useCrossFrameState as s } from "./useCrossFrameState.mjs";
9
10
  import "@intlayer/dictionaries-entry";
10
11
  import "./installIntlayerEditor.mjs";
11
- import "../client/useLocaleCookie.mjs";
12
- const w = p(() => {
12
+ import "../client/useLocaleStorage.mjs";
13
+ const A = p(() => {
13
14
  const t = m(a);
14
15
  if (!t)
15
16
  throw new Error("IntlayerEditor state not found");
@@ -25,5 +26,5 @@ const w = p(() => {
25
26
  ), t;
26
27
  });
27
28
  export {
28
- w as useEditorLocale
29
+ A as useEditorLocale
29
30
  };
@@ -1,4 +1,4 @@
1
- import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CBP8x_i1.mjs";
1
+ import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-Ckh-fn8X.mjs";
2
2
  import { installIntlayerEditor as a } from "./installIntlayerEditor.mjs";
3
3
  export {
4
4
  e as ContentSelectorWrapper,
@@ -6,11 +6,7 @@ const m = (t, i, o) => {
6
6
  a,
7
7
  ...o ?? []
8
8
  ];
9
- return n(
10
- t,
11
- i,
12
- r
13
- );
9
+ return n(t, i, r);
14
10
  };
15
11
  export {
16
12
  m as getDictionary
@@ -2,31 +2,34 @@ import { INTLAYER_SYMBOL as o, createIntlayerClient as t, installIntlayer as n }
2
2
  import { useDictionary as i } from "./client/useDictionary.mjs";
3
3
  import { useDictionaryAsync as m } from "./client/useDictionaryAsync.mjs";
4
4
  import { useDictionaryDynamic as p } from "./client/useDictionaryDynamic.mjs";
5
- import { isUpdatableNode as f, useIntlayer as x } from "./client/useIntlayer.mjs";
6
- import { useLoadDynamic as u } from "./client/useLoadDynamic.mjs";
7
- import { useLocale as I } from "./client/useLocale.mjs";
8
- import { getDictionary as g } from "./getDictionary.mjs";
9
- import { getIntlayer as M } from "./getIntlayer.mjs";
10
- import { INTLAYER_MARKDOWN_SYMBOL as w, createIntlayerMarkdownClient as N, installIntlayerMarkdown as A, useMarkdown as Y } from "./markdown/installIntlayerMarkdown.mjs";
11
- import { intlayerNodePlugins as P, markdownPlugin as R, markdownStringPlugin as S } from "./plugins.mjs";
5
+ import { atPath as c, isComponentLike as f, isObjectLike as x, toComponent as u, useIntlayer as I } from "./client/useIntlayer.mjs";
6
+ import { useLoadDynamic as d } from "./client/useLoadDynamic.mjs";
7
+ import { useLocale as D } from "./client/useLocale.mjs";
8
+ import { getDictionary as M } from "./getDictionary.mjs";
9
+ import { getIntlayer as A } from "./getIntlayer.mjs";
10
+ import { INTLAYER_MARKDOWN_SYMBOL as N, createIntlayerMarkdownClient as O, installIntlayerMarkdown as P, useMarkdown as Y } from "./markdown/installIntlayerMarkdown.mjs";
11
+ import { intlayerNodePlugins as S, markdownPlugin as _, markdownStringPlugin as B } from "./plugins.mjs";
12
12
  export {
13
- w as INTLAYER_MARKDOWN_SYMBOL,
13
+ N as INTLAYER_MARKDOWN_SYMBOL,
14
14
  o as INTLAYER_SYMBOL,
15
+ c as atPath,
15
16
  t as createIntlayerClient,
16
- N as createIntlayerMarkdownClient,
17
- g as getDictionary,
18
- M as getIntlayer,
17
+ O as createIntlayerMarkdownClient,
18
+ M as getDictionary,
19
+ A as getIntlayer,
19
20
  n as installIntlayer,
20
- A as installIntlayerMarkdown,
21
- P as intlayerNodePlugins,
22
- f as isUpdatableNode,
23
- R as markdownPlugin,
24
- S as markdownStringPlugin,
21
+ P as installIntlayerMarkdown,
22
+ S as intlayerNodePlugins,
23
+ f as isComponentLike,
24
+ x as isObjectLike,
25
+ _ as markdownPlugin,
26
+ B as markdownStringPlugin,
27
+ u as toComponent,
25
28
  i as useDictionary,
26
29
  m as useDictionaryAsync,
27
30
  p as useDictionaryDynamic,
28
- x as useIntlayer,
29
- u as useLoadDynamic,
30
- I as useLocale,
31
+ I as useIntlayer,
32
+ d as useLoadDynamic,
33
+ D as useLocale,
31
34
  Y as useMarkdown
32
35
  };
@@ -1,10 +1,11 @@
1
- import { getMarkdownMetadata as u, NodeType as o } from "@intlayer/core";
1
+ import { getMarkdownMetadata as u } from "@intlayer/core";
2
+ import { NodeType as o } from "@intlayer/types";
2
3
  import { h as y } from "vue";
3
- import { _ as l } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CBP8x_i1.mjs";
4
+ import { _ as l } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-Ckh-fn8X.mjs";
4
5
  import "./editor/installIntlayerEditor.mjs";
5
6
  import { useMarkdown as p } from "./markdown/installIntlayerMarkdown.mjs";
6
7
  import { renderIntlayerNode as i } from "./renderIntlayerNode.mjs";
7
- const b = {
8
+ const H = {
8
9
  id: "intlayer-node-plugin",
9
10
  canHandle: (n) => typeof n == "bigint" || typeof n == "string" || typeof n == "number",
10
11
  transform: (n, { children: t, ...r }) => i({
@@ -65,7 +66,7 @@ const b = {
65
66
  }
66
67
  });
67
68
  }
68
- }, H = {
69
+ }, _ = {
69
70
  id: "markdown-plugin",
70
71
  canHandle: (n) => typeof n == "object" && n?.nodeType === o.Markdown,
71
72
  transform: (n, t, r) => {
@@ -84,7 +85,7 @@ const b = {
84
85
  }
85
86
  };
86
87
  export {
87
- b as intlayerNodePlugins,
88
- H as markdownPlugin,
88
+ H as intlayerNodePlugins,
89
+ _ as markdownPlugin,
89
90
  f as markdownStringPlugin
90
91
  };
@@ -34,4 +34,3 @@ type __VLS_WithTemplateSlots<T, S> = T & {
34
34
  $slots: S;
35
35
  };
36
36
  };
37
- //# sourceMappingURL=ContentSelector.vue.d.ts.map
@@ -5,4 +5,3 @@ export * from './useDictionaryDynamic';
5
5
  export * from './useIntlayer';
6
6
  export * from './useLoadDynamic';
7
7
  export * from './useLocale';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,16 +1,16 @@
1
- import { Locales, LocalesValues } from '@intlayer/config/client';
1
+ import { Locale, LocalesValues } from '@intlayer/types';
2
2
  import { App, Ref } from 'vue';
3
3
  export declare const INTLAYER_SYMBOL: unique symbol;
4
4
  export type IntlayerProvider = {
5
- locale: Ref<Locales>;
5
+ locale: Ref<Locale>;
6
6
  setLocale: (locale: LocalesValues) => void;
7
+ isCookieEnabled?: boolean;
7
8
  };
8
9
  /**
9
10
  * Create and return a single IntlayerProvider instance
10
11
  */
11
- export declare const createIntlayerClient: (locale?: LocalesValues) => IntlayerProvider;
12
+ export declare const createIntlayerClient: (locale?: LocalesValues, isCookieEnabled?: boolean) => IntlayerProvider;
12
13
  /**
13
14
  * Helper to install the Intlayer provider into the app
14
15
  */
15
- export declare const installIntlayer: (app: App, locale?: LocalesValues) => void;
16
- //# sourceMappingURL=installIntlayer.d.ts.map
16
+ export declare const installIntlayer: (app: App, locale?: LocalesValues, isCookieEnabled?: boolean) => void;
@@ -1,6 +1,3 @@
1
- import { LocalesValues } from '@intlayer/config/client';
2
- import { Dictionary } from '@intlayer/core';
3
- import { ToRefs } from 'vue';
1
+ import { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
4
2
  import { DeepTransformContent } from '../plugins';
5
- export declare const useDictionary: <T extends Dictionary>(dictionary: T, locale?: LocalesValues) => ToRefs<DeepTransformContent<T["content"]>>;
6
- //# sourceMappingURL=useDictionary.d.ts.map
3
+ export declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L) => DeepTransformContent<T["content"], L>;
@@ -1,9 +1,7 @@
1
- import { LocalesValues } from '@intlayer/config/client';
2
- import { Dictionary, LanguageContent } from '@intlayer/core';
1
+ import { Dictionary, LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
3
2
  /**
4
3
  * On the server side, Hook that transform a dictionary and return the content
5
4
  *
6
5
  * If the locale is not provided, it will use the locale from the client context
7
6
  */
8
- export declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: LanguageContent<() => Promise<T>>, locale?: LocalesValues) => Promise<any>;
9
- //# sourceMappingURL=useDictionaryAsync.d.ts.map
7
+ export declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: LocalesValues) => Promise<any>;
@@ -1,9 +1,7 @@
1
- import { LocalesValues } from '@intlayer/config/client';
2
- import { Dictionary, DictionaryKeys, LanguageContent } from '@intlayer/core';
1
+ import { Dictionary, DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
3
2
  /**
4
3
  * On the server side, Hook that transform a dictionary and return the content
5
4
  *
6
5
  * If the locale is not provided, it will use the locale from the client context
7
6
  */
8
- export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: LanguageContent<() => Promise<T>>, key: K, locale?: LocalesValues) => import('vue').ToRefs<import('@intlayer/core').DeepTransformContent<T["content"], import('..').IInterpreterPluginState>>;
9
- //# sourceMappingURL=useDictionaryDynamic.d.ts.map
7
+ export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('@intlayer/core').DeepTransformContent<T["content"], import('..').IInterpreterPluginState, any>;
@@ -1,10 +1,9 @@
1
- import { LocalesValues } from '@intlayer/config/client';
2
- import { DictionaryKeys } from '@intlayer/core';
3
- import { IntlayerDictionaryTypesConnector } from 'intlayer';
4
- import { MaybeRefOrGetter, ToRefs } from 'vue';
1
+ import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
2
+ import { MaybeRefOrGetter } from 'vue';
5
3
  import { DeepTransformContent } from '../plugins';
6
- export declare const isUpdatableNode: (val: unknown) => val is {
7
- __update: (n: unknown) => void;
8
- };
9
- export declare const useIntlayer: <T extends DictionaryKeys>(key: MaybeRefOrGetter<T>, locale?: MaybeRefOrGetter<LocalesValues | null | undefined>) => ToRefs<DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>>;
10
- //# sourceMappingURL=useIntlayer.d.ts.map
4
+ export declare const atPath: (obj: any, path: (string | number)[]) => any;
5
+ export declare const isObjectLike: (v: any) => boolean;
6
+ export declare const isComponentLike: (v: any) => boolean;
7
+ /** Wrap a getter into a lightweight functional component */
8
+ export declare const toComponent: (getter: () => any) => import('vue').DefineComponent<{}, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
9
+ export declare const useIntlayer: <T extends DictionaryKeys>(key: T, locale?: MaybeRefOrGetter<LocalesValues | null | undefined>) => DeepTransformContent<DictionaryRegistryContent<T>>;
@@ -5,4 +5,3 @@
5
5
  * - When the Promise resolves, it replaces the object's properties with the real data.
6
6
  */
7
7
  export declare const useLoadDynamic: <T extends Record<string, any>>(key: string, promise: Promise<T>) => T;
8
- //# sourceMappingURL=useLoadDynamic.d.ts.map
@@ -1,15 +1,17 @@
1
- import { LocalesValues } from '@intlayer/config/client';
1
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types';
2
+ import { ComputedRef } from 'vue';
2
3
  type useLocaleProps = {
4
+ isCookieEnabled?: boolean;
3
5
  onLocaleChange?: (locale: LocalesValues) => void;
4
6
  };
7
+ type UseLocaleResult = {
8
+ locale: ComputedRef<DeclaredLocales>;
9
+ defaultLocale: DeclaredLocales;
10
+ availableLocales: DeclaredLocales[];
11
+ setLocale: (locale: LocalesValues) => void;
12
+ };
5
13
  /**
6
14
  * On the client side, composable to get the current locale and all related fields
7
15
  */
8
- export declare const useLocale: ({ onLocaleChange }?: useLocaleProps) => {
9
- locale: import('vue').ComputedRef<import('intlayer').Locales>;
10
- defaultLocale: import('intlayer').Locales;
11
- availableLocales: import('intlayer').Locales[];
12
- setLocale: (newLocale: LocalesValues) => void;
13
- };
16
+ export declare const useLocale: ({ isCookieEnabled, onLocaleChange, }?: useLocaleProps) => UseLocaleResult;
14
17
  export {};
15
- //# sourceMappingURL=useLocale.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { LocalesValues } from '@intlayer/types';
2
+ /**
3
+ * Get the locale cookie
4
+ */
5
+ export declare const localeInStorage: import('intlayer').Locale | undefined;
6
+ /**
7
+ * @deprecated Use localeInStorage instead
8
+ *
9
+ * Get the locale cookie
10
+ */
11
+ export declare const localeCookie: import('intlayer').Locale | undefined;
12
+ /**
13
+ * Set the locale cookie
14
+ */
15
+ export declare const setLocaleInStorage: (locale: LocalesValues, isCookieEnabled: boolean) => void;
16
+ /**
17
+ * @deprecated Use setLocaleInStorage instead
18
+ *
19
+ * Set the locale cookie
20
+ */
21
+ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: boolean) => void;
22
+ /**
23
+ * Composable that provides the locale storage and a function to set it
24
+ */
25
+ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
26
+ localeStorage: import('vue').ComputedRef<import('intlayer').Locale>;
27
+ setLocaleStorage: (locale: LocalesValues) => void;
28
+ };
29
+ /**
30
+ * @deprecated Use useLocaleStorage instead
31
+ *
32
+ * For GDPR compliance, use useLocaleStorage instead
33
+ *
34
+ * Composable that provides the locale cookie and a function to set it
35
+ */
36
+ export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
37
+ localeCookie: import('vue').ComputedRef<import('intlayer').Locale>;
38
+ setLocaleCookie: (locale: LocalesValues) => void;
39
+ };
@@ -1,5 +1,5 @@
1
- import { HTMLAttributes } from 'vue';
2
1
  import { NodeProps } from '@intlayer/core';
2
+ import { HTMLAttributes } from 'vue';
3
3
  /**
4
4
  * Combine your NodeProps (which include dictionaryKey & keyPath)
5
5
  * with any other div‐like attributes (omitting Vue's `children`).
@@ -23,4 +23,3 @@ type __VLS_WithTemplateSlots<T, S> = T & {
23
23
  $slots: S;
24
24
  };
25
25
  };
26
- //# sourceMappingURL=ContentSelectorWrapper.vue.d.ts.map
@@ -25,4 +25,3 @@ export declare const installCommunicator: (app: App, options?: CommunicatorOptio
25
25
  * @returns The communicator instance
26
26
  */
27
27
  export declare const useCommunicator: () => Communicator;
28
- //# sourceMappingURL=communicator.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare const useConfiguration: () => void;
2
- //# sourceMappingURL=configuration.d.ts.map
@@ -10,4 +10,3 @@ export declare function tryOnScopeDispose(fn: () => void): boolean;
10
10
  */
11
11
  export declare const createSharedComposable: <Fn extends AnyFn>(composable: Fn) => SharedComposableReturn<Fn>;
12
12
  export {};
13
- //# sourceMappingURL=createSharedComposable.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Dictionary } from '@intlayer/core';
1
+ import { Dictionary } from '@intlayer/types';
2
2
  import { App, Ref } from 'vue';
3
3
  export type DictionaryContent = Record<Dictionary['key'], Dictionary>;
4
4
  type DictionariesRecordClient = {
@@ -13,4 +13,3 @@ export declare const createDictionaryRecordClient: () => DictionariesRecordClien
13
13
  export declare const installDictionariesRecord: (app: App) => void;
14
14
  export declare const useDictionariesRecord: () => void;
15
15
  export {};
16
- //# sourceMappingURL=dictionariesRecord.d.ts.map
@@ -1,10 +1,10 @@
1
- import { ContentNode, Dictionary, KeyPath } from '@intlayer/core';
1
+ import { ContentNode, Dictionary, KeyPath, LocalDictionaryId } from '@intlayer/types';
2
2
  import { App, Ref } from 'vue';
3
3
  export type EditedContent = Record<Dictionary['key'], Dictionary>;
4
4
  type EditedContentClient = {
5
5
  editedContent: Ref<EditedContent>;
6
6
  setEditedContent: (editedContent: EditedContent) => void;
7
- getEditedContentValue: (dictionaryKey: Dictionary['key'], keyPath: KeyPath[]) => ContentNode | undefined;
7
+ getEditedContentValue: (localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string, keyPath: KeyPath[]) => ContentNode | undefined;
8
8
  };
9
9
  /**
10
10
  * Creates an edited content client
@@ -16,4 +16,3 @@ export declare const createEditedContentClient: () => EditedContentClient;
16
16
  export declare const installEditedContent: (app: App) => void;
17
17
  export declare const useEditedContent: () => EditedContentClient;
18
18
  export {};
19
- //# sourceMappingURL=editedContent.d.ts.map
@@ -14,4 +14,3 @@ export declare const createEditorEnabledClient: () => EditorEnabledStateProps;
14
14
  */
15
15
  export declare const installEditorEnabled: (app: App) => void;
16
16
  export declare const useEditorEnabled: () => EditorEnabledStateProps;
17
- //# sourceMappingURL=editorEnabled.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { IntlayerProvider } from '../client';
2
2
  export declare const useEditorLocale: () => IntlayerProvider;
3
- //# sourceMappingURL=editorLocale.d.ts.map
@@ -1,4 +1,4 @@
1
- import { KeyPath } from '@intlayer/core';
1
+ import { KeyPath } from '@intlayer/types';
2
2
  import { App, Ref } from 'vue';
3
3
  export type FileContent = {
4
4
  dictionaryKey: string;
@@ -21,4 +21,3 @@ export declare const installFocusDictionary: (app: App) => void;
21
21
  /** consumer */
22
22
  export declare const useFocusDictionary: () => FocusDictionaryClient;
23
23
  export {};
24
- //# sourceMappingURL=focusDictionary.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { default as ContentSelectorWrapper } from './ContentSelectorWrapper.vue';
2
2
  export * from './installIntlayerEditor';
3
- //# sourceMappingURL=index.d.ts.map
@@ -12,4 +12,3 @@ import { App } from 'vue';
12
12
  * ```
13
13
  */
14
14
  export declare const installIntlayerEditor: (app: App) => void;
15
- //# sourceMappingURL=installIntlayerEditor.d.ts.map
@@ -8,4 +8,3 @@ import { MessageKey } from '@intlayer/editor';
8
8
  * @returns postMessage(data?) helper scoped to this key
9
9
  */
10
10
  export declare const useCrossFrameMessageListener: <S>(key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`, onEventTriggered?: (data: S) => void) => (data?: S) => void;
11
- //# sourceMappingURL=useCrossFrameMessageListener.d.ts.map
@@ -21,4 +21,3 @@ export type CrossFrameStateOptions = {
21
21
  * - `postState` – Manually broadcast the current state (useful after mutations outside `setState`).
22
22
  */
23
23
  export declare const useCrossFrameState: <S>(key: `${MessageKey}`, initialState?: S | (() => S), options?: CrossFrameStateOptions) => [Ref<S | undefined>, (v: S | ((prev: S | undefined) => S)) => void, () => void];
24
- //# sourceMappingURL=useCrossFrameState.d.ts.map
@@ -13,4 +13,3 @@ export declare const useCrossURLPathState: (initial?: string, opts?: Parameters<
13
13
  * @returns A tuple containing [state ref, setState function]
14
14
  */
15
15
  export declare const useCrossURLPathSetter: (initial?: string) => readonly [import('vue').Ref<string | undefined, string | undefined>, (v: string | ((prev: string | undefined) => string)) => void];
16
- //# sourceMappingURL=useCrossURLPathState.d.ts.map
@@ -1,4 +1,4 @@
1
- import { KeyPath } from '@intlayer/core';
1
+ import { KeyPath } from '@intlayer/types';
2
2
  import { ComputedRef } from 'vue';
3
3
  export interface EditedContentActions {
4
4
  getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;
@@ -7,4 +7,3 @@ export interface EditedContentActions {
7
7
  * Mirrors the React hook one-for-one.
8
8
  */
9
9
  export declare const useEditedContentRenderer: (dictionaryKey: string, keyPath: KeyPath[], fallback: unknown) => ComputedRef<unknown>;
10
- //# sourceMappingURL=useEditedContentRenderer.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare const useEditor: () => void;
2
- //# sourceMappingURL=useEditor.d.ts.map
@@ -8,4 +8,3 @@ export declare const useIframeClickInterceptor: () => void;
8
8
  * This makes iframe clicks behave as if they happened in the parent window
9
9
  */
10
10
  export declare const useIframeClickMerger: () => void;
11
- //# sourceMappingURL=useIframeClickInterceptor.d.ts.map
@@ -6,4 +6,3 @@ export { useNumber } from './useNumber';
6
6
  export { usePercentage } from './usePercentage';
7
7
  export { useRelativeTime } from './useRelativeTime';
8
8
  export { useUnit } from './useUnit';
9
- //# sourceMappingURL=index.d.ts.map
@@ -11,4 +11,3 @@
11
11
  export declare const useCompact: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
12
12
  locale?: import('intlayer').LocalesValues;
13
13
  }) | undefined) => string>;
14
- //# sourceMappingURL=useCompact.d.ts.map
@@ -22,4 +22,3 @@
22
22
  export declare const useCurrency: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
23
23
  locale?: import('intlayer').LocalesValues;
24
24
  }) | undefined) => string>;
25
- //# sourceMappingURL=useCurrency.d.ts.map
@@ -20,4 +20,3 @@
20
20
  export declare const useDate: () => import('vue').ComputedRef<(date: string | number | Date, options?: (Intl.DateTimeFormatOptions & {
21
21
  locale?: import('intlayer').LocalesValues;
22
22
  }) | undefined) => string>;
23
- //# sourceMappingURL=useDate.d.ts.map
@@ -19,4 +19,3 @@
19
19
  export declare const useList: () => import('vue').ComputedRef<(values: (string | number)[], options?: (Intl.ListFormatOptions & {
20
20
  locale?: import('intlayer').LocalesValues;
21
21
  }) | undefined) => string>;
22
- //# sourceMappingURL=useList.d.ts.map
@@ -20,4 +20,3 @@
20
20
  export declare const useNumber: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
21
21
  locale?: import('intlayer').LocalesValues;
22
22
  }) | undefined) => string>;
23
- //# sourceMappingURL=useNumber.d.ts.map
@@ -14,4 +14,3 @@
14
14
  export declare const usePercentage: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
15
15
  locale?: import('intlayer').LocalesValues;
16
16
  }) | undefined) => string>;
17
- //# sourceMappingURL=usePercentage.d.ts.map
@@ -18,4 +18,3 @@ export declare const useRelativeTime: () => import('vue').ComputedRef<(from: str
18
18
  locale?: import('intlayer').LocalesValues;
19
19
  unit?: Intl.RelativeTimeFormatUnit;
20
20
  }) | undefined) => string>;
21
- //# sourceMappingURL=useRelativeTime.d.ts.map
@@ -16,4 +16,3 @@
16
16
  export declare const useUnit: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
17
17
  locale?: import('intlayer').LocalesValues;
18
18
  }) | undefined) => string>;
19
- //# sourceMappingURL=useUnit.d.ts.map
@@ -1,5 +1,4 @@
1
- import { Locales, LocalesValues } from '@intlayer/config/client';
2
- import { Dictionary, Plugins } from '@intlayer/core';
1
+ import { Plugins } from '@intlayer/core';
2
+ import { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
3
3
  import { DeepTransformContent } from './plugins';
4
- export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = Locales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"]>;
5
- //# sourceMappingURL=getDictionary.d.ts.map
4
+ export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"], L>;
@@ -1,5 +1,4 @@
1
- import { DictionaryKeys, Plugins } from '@intlayer/core';
2
- import { IntlayerDictionaryTypesConnector, LocalesValues } from 'intlayer';
1
+ import { Plugins } from '@intlayer/core';
2
+ import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
3
3
  import { DeepTransformContent } from './plugins';
4
- export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]>;
5
- //# sourceMappingURL=getIntlayer.d.ts.map
4
+ export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<DictionaryRegistryContent<T>, L>;