vue-intlayer 7.1.4 → 7.1.6
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/types/client/useLocaleStorage.d.ts +4 -4
- package/dist/types/format/useCompact.d.ts +1 -1
- package/dist/types/format/useCurrency.d.ts +1 -1
- package/dist/types/format/useDate.d.ts +1 -1
- package/dist/types/format/useList.d.ts +1 -1
- package/dist/types/format/useNumber.d.ts +1 -1
- package/dist/types/format/usePercentage.d.ts +1 -1
- package/dist/types/format/useRelativeTime.d.ts +1 -1
- package/dist/types/format/useUnit.d.ts +1 -1
- package/package.json +9 -9
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-BD8AzVI8.js +0 -1
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-BkgFa1XU.mjs +0 -63
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-Cb_MV4HT.js +0 -1
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-Ckh-fn8X.mjs +0 -62
- package/dist/EditorSelectorRenderer.vue_vue_type_script_setup_true_lang-BS6_0nfg.mjs +0 -39
- package/dist/EditorSelectorRenderer.vue_vue_type_script_setup_true_lang-BaAbbmXy.js +0 -1
- package/dist/installIntlayerEditor-CFcdNmPy.mjs +0 -112
- package/dist/installIntlayerEditor-DmHeL-Bu.js +0 -1
- package/dist/types/editor/EditedContentRenderer.vue.d.ts +0 -8
- package/dist/types/editor/EditorSelectorRenderer.vue.d.ts +0 -24
|
@@ -2,13 +2,13 @@ import { LocalesValues } from '@intlayer/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Get the locale cookie
|
|
4
4
|
*/
|
|
5
|
-
export declare const localeInStorage: import('intlayer').Locale | undefined;
|
|
5
|
+
export declare const localeInStorage: import('@intlayer/types').Locale | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use localeInStorage instead
|
|
8
8
|
*
|
|
9
9
|
* Get the locale cookie
|
|
10
10
|
*/
|
|
11
|
-
export declare const localeCookie: import('intlayer').Locale | undefined;
|
|
11
|
+
export declare const localeCookie: import('@intlayer/types').Locale | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Set the locale cookie
|
|
14
14
|
*/
|
|
@@ -23,7 +23,7 @@ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: b
|
|
|
23
23
|
* Composable that provides the locale storage and a function to set it
|
|
24
24
|
*/
|
|
25
25
|
export declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
26
|
-
localeStorage: import('vue').ComputedRef<import('intlayer').Locale>;
|
|
26
|
+
localeStorage: import('vue').ComputedRef<import('@intlayer/types').Locale>;
|
|
27
27
|
setLocaleStorage: (locale: LocalesValues) => void;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
@@ -34,6 +34,6 @@ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
|
34
34
|
* Composable that provides the locale cookie and a function to set it
|
|
35
35
|
*/
|
|
36
36
|
export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
|
|
37
|
-
localeCookie: import('vue').ComputedRef<import('intlayer').Locale>;
|
|
37
|
+
localeCookie: import('vue').ComputedRef<import('@intlayer/types').Locale>;
|
|
38
38
|
setLocaleCookie: (locale: LocalesValues) => void;
|
|
39
39
|
};
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
11
|
export declare const useCompact: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
12
|
-
locale?: import('intlayer').LocalesValues;
|
|
12
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
13
13
|
}) | undefined) => string>;
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare const useCurrency: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
23
|
-
locale?: import('intlayer').LocalesValues;
|
|
23
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
24
24
|
}) | undefined) => string>;
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export declare const useDate: () => import('vue').ComputedRef<(date: string | number | Date, options?: (Intl.DateTimeFormatOptions & {
|
|
21
|
-
locale?: import('intlayer').LocalesValues;
|
|
21
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
22
22
|
}) | undefined) => string>;
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export declare const useList: () => import('vue').ComputedRef<(values: (string | number)[], options?: (Intl.ListFormatOptions & {
|
|
20
|
-
locale?: import('intlayer').LocalesValues;
|
|
20
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
21
21
|
}) | undefined) => string>;
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export declare const useNumber: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
21
|
-
locale?: import('intlayer').LocalesValues;
|
|
21
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
22
22
|
}) | undefined) => string>;
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export declare const usePercentage: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
15
|
-
locale?: import('intlayer').LocalesValues;
|
|
15
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
16
16
|
}) | undefined) => string>;
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
export declare const useRelativeTime: () => import('vue').ComputedRef<(from: string | number | Date, to?: string | number | Date | undefined, options?: (Intl.RelativeTimeFormatOptions & {
|
|
18
|
-
locale?: import('intlayer').LocalesValues;
|
|
18
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
19
19
|
unit?: Intl.RelativeTimeFormatUnit;
|
|
20
20
|
}) | undefined) => string>;
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
export declare const useUnit: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
17
|
-
locale?: import('intlayer').LocalesValues;
|
|
17
|
+
locale?: import('@intlayer/types').LocalesValues;
|
|
18
18
|
}) | undefined) => string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
"typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@intlayer/api": "7.1.
|
|
90
|
-
"@intlayer/config": "7.1.
|
|
91
|
-
"@intlayer/core": "7.1.
|
|
92
|
-
"@intlayer/editor": "7.1.
|
|
93
|
-
"@intlayer/types": "7.1.
|
|
94
|
-
"@intlayer/unmerged-dictionaries-entry": "7.1.
|
|
89
|
+
"@intlayer/api": "7.1.6",
|
|
90
|
+
"@intlayer/config": "7.1.6",
|
|
91
|
+
"@intlayer/core": "7.1.6",
|
|
92
|
+
"@intlayer/editor": "7.1.6",
|
|
93
|
+
"@intlayer/types": "7.1.6",
|
|
94
|
+
"@intlayer/unmerged-dictionaries-entry": "7.1.6"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@types/node": "24.10.1",
|
|
@@ -104,13 +104,13 @@
|
|
|
104
104
|
"rimraf": "6.1.0",
|
|
105
105
|
"tsdown": "0.16.5",
|
|
106
106
|
"typescript": "5.9.3",
|
|
107
|
-
"vite": "7.2.
|
|
107
|
+
"vite": "7.2.2",
|
|
108
108
|
"vite-plugin-dts": "4.5.4",
|
|
109
109
|
"vitest": "4.0.8",
|
|
110
110
|
"vue-tsc": "3.1.1"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
|
-
"intlayer": "7.1.
|
|
113
|
+
"intlayer": "7.1.6",
|
|
114
114
|
"vue": ">=3.0.0"
|
|
115
115
|
},
|
|
116
116
|
"peerDependenciesMeta": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),_=require("@intlayer/core"),s=require("@intlayer/editor"),i=require("@intlayer/types"),p=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),h=require("./cjs/editor/communicator.cjs"),E=require("./cjs/editor/editorEnabled.cjs"),f=require("./cjs/editor/focusDictionary.cjs"),m=require("./cjs/editor/useEditor.cjs"),C=e.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(a){const t=a,n=f.useFocusDictionary(),c=E.useEditorEnabled(),r=h.useCommunicator();m.useEditor();const u=e.computed(()=>n?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(n?.focusedContent.value.keyPath?.length??0)>0&&_.isSameKeyPath(n?.focusedContent.value.keyPath??[],t.keyPath.filter(o=>o.type!==i.NodeType.Translation))),d=()=>{n?.setFocusedContent({dictionaryKey:t.dictionaryKey,keyPath:t.keyPath.filter(o=>o.type!==i.NodeType.Translation)})},l=()=>{r?.postMessage({type:`${s.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:{dictionaryKey:t.dictionaryKey,keyPath:t.keyPath}})},y=()=>{r?.postMessage({type:`${s.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:null})};return(o,k)=>e.unref(c)?.enabled.value?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,onPress:d,isSelecting:u.value,onHover:l,onUnhover:y},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["isSelecting"])):e.renderSlot(o.$slots,"default",{key:1})}});exports._sfc_main=C;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { defineComponent as m, computed as u, createBlock as f, renderSlot as a, unref as h, openBlock as _, withCtx as E } from "vue";
|
|
2
|
-
import { isSameKeyPath as k } from "@intlayer/core";
|
|
3
|
-
import { MessageKey as r } from "@intlayer/editor";
|
|
4
|
-
import { NodeType as i } from "@intlayer/types";
|
|
5
|
-
import { _ as C } from "./ContentSelector.vue_vue_type_script_setup_true_lang-pC3olEPG.mjs";
|
|
6
|
-
import { useCommunicator as P } from "./esm/editor/communicator.mjs";
|
|
7
|
-
import { useEditorEnabled as v } from "./esm/editor/editorEnabled.mjs";
|
|
8
|
-
import { useFocusDictionary as K } from "./esm/editor/focusDictionary.mjs";
|
|
9
|
-
import { useEditor as N } from "./esm/editor/useEditor.mjs";
|
|
10
|
-
const M = /* @__PURE__ */ m({
|
|
11
|
-
__name: "ContentSelectorWrapper",
|
|
12
|
-
props: {
|
|
13
|
-
dictionaryKey: {},
|
|
14
|
-
keyPath: {},
|
|
15
|
-
plugins: {},
|
|
16
|
-
locale: {},
|
|
17
|
-
dictionaryPath: {},
|
|
18
|
-
children: {}
|
|
19
|
-
},
|
|
20
|
-
setup(s) {
|
|
21
|
-
const e = s, o = K(), c = v(), n = P();
|
|
22
|
-
N();
|
|
23
|
-
const l = u(
|
|
24
|
-
() => o?.focusedContent.value?.dictionaryKey === e.dictionaryKey && (o?.focusedContent.value.keyPath?.length ?? 0) > 0 && k(
|
|
25
|
-
o?.focusedContent.value.keyPath ?? [],
|
|
26
|
-
e.keyPath.filter((t) => t.type !== i.Translation)
|
|
27
|
-
)
|
|
28
|
-
), y = () => {
|
|
29
|
-
o?.setFocusedContent({
|
|
30
|
-
dictionaryKey: e.dictionaryKey,
|
|
31
|
-
keyPath: e.keyPath.filter((t) => t.type !== i.Translation)
|
|
32
|
-
});
|
|
33
|
-
}, d = () => {
|
|
34
|
-
n?.postMessage({
|
|
35
|
-
type: `${r.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
36
|
-
data: {
|
|
37
|
-
dictionaryKey: e.dictionaryKey,
|
|
38
|
-
keyPath: e.keyPath
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}, p = () => {
|
|
42
|
-
n?.postMessage({
|
|
43
|
-
type: `${r.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
44
|
-
data: null
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
return (t, T) => h(c)?.enabled.value ? (_(), f(C, {
|
|
48
|
-
key: 0,
|
|
49
|
-
onPress: y,
|
|
50
|
-
isSelecting: l.value,
|
|
51
|
-
onHover: d,
|
|
52
|
-
onUnhover: p
|
|
53
|
-
}, {
|
|
54
|
-
default: E(() => [
|
|
55
|
-
a(t.$slots, "default")
|
|
56
|
-
]),
|
|
57
|
-
_: 3
|
|
58
|
-
}, 8, ["isSelecting"])) : a(t.$slots, "default", { key: 1 });
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
export {
|
|
62
|
-
M as _
|
|
63
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),y=require("@intlayer/core"),s=require("@intlayer/editor"),_=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),p=require("./cjs/editor/communicator.cjs"),h=require("./cjs/editor/editorEnabled.cjs"),E=require("./cjs/editor/focusDictionary.cjs"),f=require("./cjs/editor/useEditor.cjs"),m=e.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(c){const t=c,o=E.useFocusDictionary(),i=h.useEditorEnabled(),n=p.useCommunicator();f.useEditor();const a=e.computed(()=>o?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(o?.focusedContent.value.keyPath?.length??0)>0&&y.isSameKeyPath(o?.focusedContent.value.keyPath??[],t.keyPath)),u=()=>{o?.setFocusedContent({dictionaryKey:t.dictionaryKey,keyPath:t.keyPath})},d=()=>{n?.postMessage({type:`${s.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:{dictionaryKey:t.dictionaryKey,keyPath:t.keyPath}})},l=()=>{n?.postMessage({type:`${s.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:null})};return(r,C)=>e.unref(i)?.enabled.value?(e.openBlock(),e.createBlock(_._sfc_main,{key:0,onPress:u,isSelecting:a.value,onHover:d,onUnhover:l},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},8,["isSelecting"])):e.renderSlot(r.$slots,"default",{key:1})}});exports._sfc_main=m;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { defineComponent as u, computed as m, createBlock as p, renderSlot as a, unref as f, openBlock as h, withCtx as _ } from "vue";
|
|
2
|
-
import { isSameKeyPath as E } from "@intlayer/core";
|
|
3
|
-
import { MessageKey as r } from "@intlayer/editor";
|
|
4
|
-
import { _ as k } from "./ContentSelector.vue_vue_type_script_setup_true_lang-pC3olEPG.mjs";
|
|
5
|
-
import { useCommunicator as C } from "./esm/editor/communicator.mjs";
|
|
6
|
-
import { useEditorEnabled as P } from "./esm/editor/editorEnabled.mjs";
|
|
7
|
-
import { useFocusDictionary as v } from "./esm/editor/focusDictionary.mjs";
|
|
8
|
-
import { useEditor as K } from "./esm/editor/useEditor.mjs";
|
|
9
|
-
const R = /* @__PURE__ */ u({
|
|
10
|
-
__name: "ContentSelectorWrapper",
|
|
11
|
-
props: {
|
|
12
|
-
dictionaryKey: {},
|
|
13
|
-
keyPath: {},
|
|
14
|
-
plugins: {},
|
|
15
|
-
locale: {},
|
|
16
|
-
dictionaryPath: {},
|
|
17
|
-
children: {}
|
|
18
|
-
},
|
|
19
|
-
setup(s) {
|
|
20
|
-
const e = s, t = v(), i = P(), o = C();
|
|
21
|
-
K();
|
|
22
|
-
const c = m(
|
|
23
|
-
() => t?.focusedContent.value?.dictionaryKey === e.dictionaryKey && (t?.focusedContent.value.keyPath?.length ?? 0) > 0 && E(
|
|
24
|
-
t?.focusedContent.value.keyPath ?? [],
|
|
25
|
-
e.keyPath
|
|
26
|
-
)
|
|
27
|
-
), d = () => {
|
|
28
|
-
t?.setFocusedContent({
|
|
29
|
-
dictionaryKey: e.dictionaryKey,
|
|
30
|
-
keyPath: e.keyPath
|
|
31
|
-
});
|
|
32
|
-
}, l = () => {
|
|
33
|
-
o?.postMessage({
|
|
34
|
-
type: `${r.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
35
|
-
data: {
|
|
36
|
-
dictionaryKey: e.dictionaryKey,
|
|
37
|
-
keyPath: e.keyPath
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}, y = () => {
|
|
41
|
-
o?.postMessage({
|
|
42
|
-
type: `${r.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
43
|
-
data: null
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
return (n, N) => f(i)?.enabled.value ? (h(), p(k, {
|
|
47
|
-
key: 0,
|
|
48
|
-
onPress: d,
|
|
49
|
-
isSelecting: c.value,
|
|
50
|
-
onHover: l,
|
|
51
|
-
onUnhover: y
|
|
52
|
-
}, {
|
|
53
|
-
default: _(() => [
|
|
54
|
-
a(n.$slots, "default")
|
|
55
|
-
]),
|
|
56
|
-
_: 3
|
|
57
|
-
}, 8, ["isSelecting"])) : a(n.$slots, "default", { key: 1 });
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
export {
|
|
61
|
-
R as _
|
|
62
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { defineComponent as d, createBlock as y, openBlock as l, unref as e, withCtx as n, createVNode as h, renderSlot as s } from "vue";
|
|
2
|
-
import { _ } from "./ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
|
|
3
|
-
import { _ as p } from "./EditedContentRenderer.vue_vue_type_script_setup_true_lang-GmacOkG4.mjs";
|
|
4
|
-
const P = /* @__PURE__ */ d({
|
|
5
|
-
__name: "EditorSelectorRenderer",
|
|
6
|
-
props: {
|
|
7
|
-
dictionaryKey: {},
|
|
8
|
-
keyPath: {},
|
|
9
|
-
plugins: {},
|
|
10
|
-
locale: {},
|
|
11
|
-
dictionaryPath: {},
|
|
12
|
-
children: {}
|
|
13
|
-
},
|
|
14
|
-
setup(o) {
|
|
15
|
-
const a = o, { keyPath: t, children: r, dictionaryKey: i } = a;
|
|
16
|
-
return (c, f) => (l(), y(_, {
|
|
17
|
-
dictionaryKey: e(i),
|
|
18
|
-
keyPath: e(t),
|
|
19
|
-
children: e(r)
|
|
20
|
-
}, {
|
|
21
|
-
default: n(() => [
|
|
22
|
-
h(p, {
|
|
23
|
-
dictionaryKey: e(i),
|
|
24
|
-
keyPath: e(t),
|
|
25
|
-
children: e(r)
|
|
26
|
-
}, {
|
|
27
|
-
default: n(() => [
|
|
28
|
-
s(c.$slots, "default")
|
|
29
|
-
]),
|
|
30
|
-
_: 3
|
|
31
|
-
}, 8, ["dictionaryKey", "keyPath", "children"])
|
|
32
|
-
]),
|
|
33
|
-
_: 3
|
|
34
|
-
}, 8, ["dictionaryKey", "keyPath", "children"]));
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
export {
|
|
38
|
-
P as _
|
|
39
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),o=require("./ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.js"),_=require("./EditedContentRenderer.vue_vue_type_script_setup_true_lang-CilQuo_6.js"),u=e.defineComponent({__name:"EditorSelectorRenderer",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(i){const c=i,{keyPath:t,children:r,dictionaryKey:n}=c;return(a,d)=>(e.openBlock(),e.createBlock(o._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.createVNode(_._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["dictionaryKey","keyPath","children"])]),_:3},8,["dictionaryKey","keyPath","children"]))}});exports._sfc_main=u;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import E from "@intlayer/config/built";
|
|
2
|
-
import { installCommunicator as T } from "./esm/editor/communicator.mjs";
|
|
3
|
-
import { installDictionariesRecord as v } from "./esm/editor/dictionariesRecord.mjs";
|
|
4
|
-
import { getContentNodeByKeyPath as m } from "@intlayer/core";
|
|
5
|
-
import { MessageKey as C } from "@intlayer/editor";
|
|
6
|
-
import { NodeType as h } from "@intlayer/types";
|
|
7
|
-
import { ref as L, readonly as p, inject as w, watch as d } from "vue";
|
|
8
|
-
import { createSharedComposable as R } from "./esm/editor/createSharedComposable.mjs";
|
|
9
|
-
import "./esm/client/useLocaleStorage.mjs";
|
|
10
|
-
import { installEditorEnabled as U } from "./esm/editor/editorEnabled.mjs";
|
|
11
|
-
import { installFocusDictionary as _ } from "./esm/editor/focusDictionary.mjs";
|
|
12
|
-
import { useCrossFrameState as I } from "./esm/editor/useCrossFrameState.mjs";
|
|
13
|
-
const N = Symbol("intlayer");
|
|
14
|
-
let c = null;
|
|
15
|
-
const D = (t, n = !0) => {
|
|
16
|
-
if (c) return c;
|
|
17
|
-
const { defaultLocale: e } = E.internationalization ?? {}, o = L(t ?? e), s = (a) => {
|
|
18
|
-
o.value = a;
|
|
19
|
-
};
|
|
20
|
-
return c = {
|
|
21
|
-
locale: p(o),
|
|
22
|
-
setLocale: s,
|
|
23
|
-
isCookieEnabled: n
|
|
24
|
-
}, c;
|
|
25
|
-
}, Q = (t, n, e = !0) => {
|
|
26
|
-
const o = D(n, e);
|
|
27
|
-
t.provide(N, o), j(t);
|
|
28
|
-
}, M = R(() => {
|
|
29
|
-
const t = w(N);
|
|
30
|
-
if (!t)
|
|
31
|
-
throw new Error("IntlayerEditor state not found");
|
|
32
|
-
const [n, e] = I(
|
|
33
|
-
C.INTLAYER_CURRENT_LOCALE
|
|
34
|
-
);
|
|
35
|
-
return d(
|
|
36
|
-
t.locale,
|
|
37
|
-
(o) => {
|
|
38
|
-
e(o);
|
|
39
|
-
},
|
|
40
|
-
{ immediate: !0 }
|
|
41
|
-
), t;
|
|
42
|
-
});
|
|
43
|
-
let l = null;
|
|
44
|
-
const y = Symbol("EditedContent"), b = () => {
|
|
45
|
-
if (l) return l;
|
|
46
|
-
const t = M(), n = L({});
|
|
47
|
-
return l = {
|
|
48
|
-
editedContent: p(n),
|
|
49
|
-
getEditedContentValue: (e, o) => {
|
|
50
|
-
const s = n.value;
|
|
51
|
-
if (!s) return;
|
|
52
|
-
const a = o.filter(
|
|
53
|
-
(i) => i.type !== h.Translation
|
|
54
|
-
);
|
|
55
|
-
if (e.includes(":local:") || e.includes(":remote:")) {
|
|
56
|
-
const i = s?.[e]?.content ?? {};
|
|
57
|
-
return m(
|
|
58
|
-
i,
|
|
59
|
-
a,
|
|
60
|
-
t.locale.value
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
const g = Object.keys(s).filter(
|
|
64
|
-
(i) => i.startsWith(`${e}:`)
|
|
65
|
-
);
|
|
66
|
-
for (const i of g) {
|
|
67
|
-
const u = s?.[i]?.content ?? {}, f = m(
|
|
68
|
-
u,
|
|
69
|
-
a,
|
|
70
|
-
t.locale.value
|
|
71
|
-
);
|
|
72
|
-
if (f) return f;
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
setEditedContent: (e) => {
|
|
76
|
-
n.value = e;
|
|
77
|
-
}
|
|
78
|
-
}, l;
|
|
79
|
-
}, A = (t) => {
|
|
80
|
-
const n = b();
|
|
81
|
-
t.provide(y, n);
|
|
82
|
-
}, X = R(() => {
|
|
83
|
-
const t = w(y);
|
|
84
|
-
if (!t)
|
|
85
|
-
throw new Error("EditedContent state not found");
|
|
86
|
-
const [n, e] = I(
|
|
87
|
-
C.INTLAYER_EDITED_CONTENT_CHANGED,
|
|
88
|
-
{}
|
|
89
|
-
);
|
|
90
|
-
return d(n, (o) => {
|
|
91
|
-
t.editedContent.value = o ?? {};
|
|
92
|
-
}), d(t, (o) => {
|
|
93
|
-
e(o.editedContent.value);
|
|
94
|
-
}), t;
|
|
95
|
-
}), { editor: r } = E, { applicationURL: S, editorURL: Y, cmsURL: O } = r ?? {}, B = (t) => {
|
|
96
|
-
typeof window > "u" || !(window.self !== window.top) || (r.applicationURL.length > 0 && window.postMessage(t, r.applicationURL), r.editorURL.length > 0 && window.parent.postMessage(t, r.editorURL), r.cmsURL.length > 0 && window.parent.postMessage(t, r.cmsURL));
|
|
97
|
-
}, j = (t) => {
|
|
98
|
-
T(t, {
|
|
99
|
-
postMessage: B,
|
|
100
|
-
allowedOrigins: [S, Y, O]
|
|
101
|
-
}), U(t), v(t), A(t), _(t);
|
|
102
|
-
};
|
|
103
|
-
export {
|
|
104
|
-
N as I,
|
|
105
|
-
j as a,
|
|
106
|
-
b,
|
|
107
|
-
D as c,
|
|
108
|
-
A as d,
|
|
109
|
-
X as e,
|
|
110
|
-
Q as i,
|
|
111
|
-
M as u
|
|
112
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const L=require("@intlayer/config/built"),p=require("./cjs/editor/communicator.cjs"),q=require("./cjs/editor/dictionariesRecord.cjs"),f=require("@intlayer/core"),y=require("@intlayer/editor"),v=require("@intlayer/types"),i=require("vue"),m=require("./cjs/editor/createSharedComposable.cjs");require("./cjs/client/useLocaleStorage.cjs");const S=require("./cjs/editor/editorEnabled.cjs"),D=require("./cjs/editor/focusDictionary.cjs"),w=require("./cjs/editor/useCrossFrameState.cjs"),u=Symbol("intlayer");let l=null;const I=(e,n=!0)=>{if(l)return l;const{defaultLocale:t}=L.internationalization??{},o=i.ref(e??t),c=a=>{o.value=a};return l={locale:i.readonly(o),setLocale:c,isCookieEnabled:n},l},U=(e,n,t=!0)=>{const o=I(n,t);e.provide(u,o),h(e)},R=m.createSharedComposable(()=>{const e=i.inject(u);if(!e)throw new Error("IntlayerEditor state not found");const[n,t]=w.useCrossFrameState(y.MessageKey.INTLAYER_CURRENT_LOCALE);return i.watch(e.locale,o=>{t(o)},{immediate:!0}),e});let d=null;const N=Symbol("EditedContent"),_=()=>{if(d)return d;const e=R(),n=i.ref({});return d={editedContent:i.readonly(n),getEditedContentValue:(t,o)=>{const c=n.value;if(!c)return;const a=o.filter(r=>r.type!==v.NodeType.Translation);if(t.includes(":local:")||t.includes(":remote:")){const r=c?.[t]?.content??{};return f.getContentNodeByKeyPath(r,a,e.locale.value)}const T=Object.keys(c).filter(r=>r.startsWith(`${t}:`));for(const r of T){const C=c?.[r]?.content??{},E=f.getContentNodeByKeyPath(C,a,e.locale.value);if(E)return E}},setEditedContent:t=>{n.value=t}},d},g=e=>{const n=_();e.provide(N,n)},M=m.createSharedComposable(()=>{const e=i.inject(N);if(!e)throw new Error("EditedContent state not found");const[n,t]=w.useCrossFrameState(y.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED,{});return i.watch(n,o=>{e.editedContent.value=o??{}}),i.watch(e,o=>{t(o.editedContent.value)}),e}),{editor:s}=L,{applicationURL:b,editorURL:Y,cmsURL:A}=s??{},B=e=>{typeof window>"u"||!(window.self!==window.top)||(s.applicationURL.length>0&&window.postMessage(e,s.applicationURL),s.editorURL.length>0&&window.parent.postMessage(e,s.editorURL),s.cmsURL.length>0&&window.parent.postMessage(e,s.cmsURL))},h=e=>{p.installCommunicator(e,{postMessage:B,allowedOrigins:[b,Y,A]}),S.installEditorEnabled(e),q.installDictionariesRecord(e),g(e),D.installFocusDictionary(e)};exports.INTLAYER_SYMBOL=u;exports.createEditedContentClient=_;exports.createIntlayerClient=I;exports.installEditedContent=g;exports.installIntlayer=U;exports.installIntlayerEditor=h;exports.useEditedContent=M;exports.useEditorLocale=R;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { KeyPath, Locale } from '@intlayer/types';
|
|
2
|
-
type Props = {
|
|
3
|
-
dictionaryKey: string;
|
|
4
|
-
keyPath: KeyPath[];
|
|
5
|
-
locale?: Locale;
|
|
6
|
-
};
|
|
7
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'vue';
|
|
2
|
-
import { NodeProps } from '@intlayer/core';
|
|
3
|
-
/**
|
|
4
|
-
* Combine your NodeProps (which include dictionaryKey & keyPath)
|
|
5
|
-
* with any other div‐like attributes (omitting Vue's `children`).
|
|
6
|
-
*/
|
|
7
|
-
type Props = NodeProps & /* @vue-ignore */ Omit<HTMLAttributes, 'children'>;
|
|
8
|
-
declare function __VLS_template(): {
|
|
9
|
-
attrs: Partial<{}>;
|
|
10
|
-
slots: {
|
|
11
|
-
default?(_: {}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {};
|
|
14
|
-
rootEl: any;
|
|
15
|
-
};
|
|
16
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
-
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
-
export default _default;
|
|
20
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
-
new (): {
|
|
22
|
-
$slots: S;
|
|
23
|
-
};
|
|
24
|
-
};
|