vue-intlayer 7.1.4 → 7.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intlayer",
3
- "version": "7.1.4",
3
+ "version": "7.1.5",
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.4",
90
- "@intlayer/config": "7.1.4",
91
- "@intlayer/core": "7.1.4",
92
- "@intlayer/editor": "7.1.4",
93
- "@intlayer/types": "7.1.4",
94
- "@intlayer/unmerged-dictionaries-entry": "7.1.4"
89
+ "@intlayer/api": "7.1.5",
90
+ "@intlayer/config": "7.1.5",
91
+ "@intlayer/core": "7.1.5",
92
+ "@intlayer/editor": "7.1.5",
93
+ "@intlayer/types": "7.1.5",
94
+ "@intlayer/unmerged-dictionaries-entry": "7.1.5"
95
95
  },
96
96
  "devDependencies": {
97
97
  "@types/node": "24.10.1",
@@ -110,7 +110,7 @@
110
110
  "vue-tsc": "3.1.1"
111
111
  },
112
112
  "peerDependencies": {
113
- "intlayer": "7.1.4",
113
+ "intlayer": "7.1.5",
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
- };