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.
- 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
- 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
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/installIntlayer.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLoadDynamic.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +1 -0
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
- package/dist/cjs/editor/dictionariesRecord.cjs +1 -1
- package/dist/cjs/editor/editedContent.cjs +1 -1
- package/dist/cjs/editor/editorLocale.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/client/index.mjs +18 -15
- package/dist/esm/client/installIntlayer.mjs +18 -16
- package/dist/esm/client/useDictionary.mjs +42 -19
- package/dist/esm/client/useDictionaryAsync.mjs +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +52 -19
- package/dist/esm/client/useLoadDynamic.mjs +3 -2
- package/dist/esm/client/useLocale.mjs +18 -10
- package/dist/esm/client/useLocaleStorage.mjs +29 -0
- package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
- package/dist/esm/editor/EditorSelectorRenderer.mjs +1 -1
- package/dist/esm/editor/dictionariesRecord.mjs +18 -18
- package/dist/esm/editor/editedContent.mjs +37 -27
- package/dist/esm/editor/editorEnabled.mjs +2 -2
- package/dist/esm/editor/editorLocale.mjs +5 -4
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/getDictionary.mjs +1 -5
- package/dist/esm/index.mjs +22 -19
- package/dist/esm/plugins.mjs +7 -6
- package/dist/types/UI/ContentSelector.vue.d.ts +0 -1
- package/dist/types/client/index.d.ts +0 -1
- package/dist/types/client/installIntlayer.d.ts +5 -5
- package/dist/types/client/useDictionary.d.ts +2 -5
- package/dist/types/client/useDictionaryAsync.d.ts +2 -4
- package/dist/types/client/useDictionaryDynamic.d.ts +2 -4
- package/dist/types/client/useIntlayer.d.ts +8 -9
- package/dist/types/client/useLoadDynamic.d.ts +0 -1
- package/dist/types/client/useLocale.d.ts +10 -8
- package/dist/types/client/useLocaleStorage.d.ts +39 -0
- package/dist/types/editor/ContentSelectorWrapper.vue.d.ts +1 -2
- package/dist/types/editor/communicator.d.ts +0 -1
- package/dist/types/editor/configuration.d.ts +0 -1
- package/dist/types/editor/createSharedComposable.d.ts +0 -1
- package/dist/types/editor/dictionariesRecord.d.ts +1 -2
- package/dist/types/editor/editedContent.d.ts +2 -3
- package/dist/types/editor/editorEnabled.d.ts +0 -1
- package/dist/types/editor/editorLocale.d.ts +0 -1
- package/dist/types/editor/focusDictionary.d.ts +1 -2
- package/dist/types/editor/index.d.ts +0 -1
- package/dist/types/editor/installIntlayerEditor.d.ts +0 -1
- package/dist/types/editor/useCrossFrameMessageListener.d.ts +0 -1
- package/dist/types/editor/useCrossFrameState.d.ts +0 -1
- package/dist/types/editor/useCrossURLPathState.d.ts +0 -1
- package/dist/types/editor/useEditedContentRenderer.d.ts +1 -2
- package/dist/types/editor/useEditor.d.ts +0 -1
- package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -1
- package/dist/types/format/index.d.ts +0 -1
- package/dist/types/format/useCompact.d.ts +0 -1
- package/dist/types/format/useCurrency.d.ts +0 -1
- package/dist/types/format/useDate.d.ts +0 -1
- package/dist/types/format/useList.d.ts +0 -1
- package/dist/types/format/useNumber.d.ts +0 -1
- package/dist/types/format/usePercentage.d.ts +0 -1
- package/dist/types/format/useRelativeTime.d.ts +0 -1
- package/dist/types/format/useUnit.d.ts +0 -1
- package/dist/types/getDictionary.d.ts +3 -4
- package/dist/types/getIntlayer.d.ts +3 -4
- package/dist/types/index.d.ts +1 -2
- package/dist/types/markdown/index.d.ts +0 -1
- package/dist/types/markdown/installIntlayerMarkdown.d.ts +1 -2
- package/dist/types/plugins.d.ts +3 -3
- package/dist/types/renderIntlayerNode.d.ts +0 -1
- package/package.json +47 -47
- package/LICENSE +0 -202
- package/dist/cjs/client/useLocaleCookie.cjs +0 -1
- package/dist/esm/client/useLocaleCookie.mjs +0 -19
- package/dist/types/UI/ContentSelector.vue.d.ts.map +0 -1
- package/dist/types/client/index.d.ts.map +0 -1
- package/dist/types/client/installIntlayer.d.ts.map +0 -1
- package/dist/types/client/useDictionary.d.ts.map +0 -1
- package/dist/types/client/useDictionaryAsync.d.ts.map +0 -1
- package/dist/types/client/useDictionaryDynamic.d.ts.map +0 -1
- package/dist/types/client/useIntlayer.d.ts.map +0 -1
- package/dist/types/client/useLoadDynamic.d.ts.map +0 -1
- package/dist/types/client/useLocale.d.ts.map +0 -1
- package/dist/types/client/useLocaleCookie.d.ts +0 -17
- package/dist/types/client/useLocaleCookie.d.ts.map +0 -1
- package/dist/types/editor/ContentSelectorWrapper.vue.d.ts.map +0 -1
- package/dist/types/editor/communicator.d.ts.map +0 -1
- package/dist/types/editor/configuration.d.ts.map +0 -1
- package/dist/types/editor/createSharedComposable.d.ts.map +0 -1
- package/dist/types/editor/dictionariesRecord.d.ts.map +0 -1
- package/dist/types/editor/editedContent.d.ts.map +0 -1
- package/dist/types/editor/editorEnabled.d.ts.map +0 -1
- package/dist/types/editor/editorLocale.d.ts.map +0 -1
- package/dist/types/editor/focusDictionary.d.ts.map +0 -1
- package/dist/types/editor/index.d.ts.map +0 -1
- package/dist/types/editor/installIntlayerEditor.d.ts.map +0 -1
- package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +0 -1
- package/dist/types/editor/useCrossFrameState.d.ts.map +0 -1
- package/dist/types/editor/useCrossURLPathState.d.ts.map +0 -1
- package/dist/types/editor/useEditedContentRenderer.d.ts.map +0 -1
- package/dist/types/editor/useEditor.d.ts.map +0 -1
- package/dist/types/editor/useIframeClickInterceptor.d.ts.map +0 -1
- package/dist/types/format/index.d.ts.map +0 -1
- package/dist/types/format/useCompact.d.ts.map +0 -1
- package/dist/types/format/useCurrency.d.ts.map +0 -1
- package/dist/types/format/useDate.d.ts.map +0 -1
- package/dist/types/format/useList.d.ts.map +0 -1
- package/dist/types/format/useNumber.d.ts.map +0 -1
- package/dist/types/format/usePercentage.d.ts.map +0 -1
- package/dist/types/format/useRelativeTime.d.ts.map +0 -1
- package/dist/types/format/useUnit.d.ts.map +0 -1
- package/dist/types/getDictionary.d.ts.map +0 -1
- package/dist/types/getIntlayer.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/markdown/index.d.ts.map +0 -1
- package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +0 -1
- package/dist/types/plugins.d.ts.map +0 -1
- package/dist/types/renderIntlayerNode.d.ts.map +0 -1
|
@@ -1,42 +1,52 @@
|
|
|
1
|
-
import { getContentNodeByKeyPath as
|
|
2
|
-
import { MessageKey as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { createSharedComposable as
|
|
5
|
-
import { useCrossFrameState as
|
|
6
|
-
let
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
const t =
|
|
10
|
-
return
|
|
11
|
-
editedContent:
|
|
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
|
|
14
|
-
if (n)
|
|
15
|
-
|
|
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
|
-
},
|
|
21
|
-
},
|
|
22
|
-
const e =
|
|
23
|
-
t.provide(
|
|
24
|
-
},
|
|
25
|
-
const t =
|
|
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] =
|
|
29
|
-
|
|
38
|
+
const [e, r] = p(
|
|
39
|
+
l.INTLAYER_EDITED_CONTENT_CHANGED,
|
|
30
40
|
{}
|
|
31
41
|
);
|
|
32
|
-
return
|
|
42
|
+
return C(e, (n) => {
|
|
33
43
|
t.editedContent.value = n ?? {};
|
|
34
|
-
}),
|
|
44
|
+
}), C(t, (n) => {
|
|
35
45
|
r(n.editedContent.value);
|
|
36
46
|
}), t;
|
|
37
47
|
});
|
|
38
48
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
},
|
|
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
|
-
|
|
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/
|
|
12
|
-
const
|
|
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
|
-
|
|
29
|
+
A as useEditorLocale
|
|
29
30
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-
|
|
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,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -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 {
|
|
6
|
-
import { useLoadDynamic as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { getDictionary as
|
|
9
|
-
import { getIntlayer as
|
|
10
|
-
import { INTLAYER_MARKDOWN_SYMBOL as
|
|
11
|
-
import { intlayerNodePlugins as
|
|
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
|
-
|
|
13
|
+
N as INTLAYER_MARKDOWN_SYMBOL,
|
|
14
14
|
o as INTLAYER_SYMBOL,
|
|
15
|
+
c as atPath,
|
|
15
16
|
t as createIntlayerClient,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
O as createIntlayerMarkdownClient,
|
|
18
|
+
M as getDictionary,
|
|
19
|
+
A as getIntlayer,
|
|
19
20
|
n as installIntlayer,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
f as
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
I as useIntlayer,
|
|
32
|
+
d as useLoadDynamic,
|
|
33
|
+
D as useLocale,
|
|
31
34
|
Y as useMarkdown
|
|
32
35
|
};
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { getMarkdownMetadata as u
|
|
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-
|
|
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
|
|
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
|
-
},
|
|
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
|
-
|
|
88
|
-
|
|
88
|
+
H as intlayerNodePlugins,
|
|
89
|
+
_ as markdownPlugin,
|
|
89
90
|
f as markdownStringPlugin
|
|
90
91
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
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<
|
|
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/
|
|
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?:
|
|
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/
|
|
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:
|
|
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/
|
|
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:
|
|
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/
|
|
2
|
-
import {
|
|
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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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>>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { LocalesValues } from '@intlayer/
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dictionary } from '@intlayer/
|
|
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/
|
|
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: (
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyPath } from '@intlayer/
|
|
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
|
|
@@ -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/
|
|
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,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dictionary,
|
|
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 =
|
|
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 {
|
|
2
|
-
import {
|
|
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<
|
|
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>;
|