vue-intlayer 8.7.11 → 8.7.13
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/README.md +27 -1
- package/dist/cjs/UI/ContentSelector.cjs +1 -1
- 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/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 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/editor/ContentSelector.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/format/useCompact.cjs +1 -1
- package/dist/cjs/format/useCurrency.cjs +1 -1
- package/dist/cjs/format/useDate.cjs +1 -1
- package/dist/cjs/format/useIntl.cjs +1 -1
- package/dist/cjs/format/useList.cjs +1 -1
- package/dist/cjs/format/useNumber.cjs +1 -1
- package/dist/cjs/format/usePercentage.cjs +1 -1
- package/dist/cjs/format/useRelativeTime.cjs +1 -1
- package/dist/cjs/format/useUnit.cjs +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +1 -1
- package/dist/{types/editor → editor}/ContentSelector.vue.d.ts +3 -2
- package/dist/esm/client/index.mjs +2 -2
- package/dist/esm/client/installIntlayer.mjs +23 -2
- package/dist/esm/client/useDictionary.mjs +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/editor/ContentSelector.mjs +25 -2
- package/dist/esm/editor/useEditor.mjs +47 -2
- package/dist/esm/format/useCompact.mjs +1 -1
- package/dist/esm/format/useCurrency.mjs +1 -1
- package/dist/esm/format/useDate.mjs +1 -1
- package/dist/esm/format/useIntl.mjs +1 -1
- package/dist/esm/format/useList.mjs +1 -1
- package/dist/esm/format/useNumber.mjs +1 -1
- package/dist/esm/format/usePercentage.mjs +1 -1
- package/dist/esm/format/useRelativeTime.mjs +1 -1
- package/dist/esm/format/useUnit.mjs +1 -1
- package/dist/esm/index.mjs +10 -9
- package/dist/esm/plugins.mjs +80 -81
- package/dist/plugins-DCpi7fYK.js +1 -0
- package/package.json +8 -8
- package/dist/ContentSelector-BUs8zVld.js +0 -1
- package/dist/ContentSelector-CJ8wOzKS.mjs +0 -24
- package/dist/installIntlayer-BkiEiexB.mjs +0 -62
- package/dist/installIntlayer-mdeEN-3u.js +0 -1
- package/dist/plugins-DqGu9jRk.js +0 -1
- package/dist/{types/client → client}/index.d.ts +0 -0
- package/dist/{types/client → client}/installIntlayer.d.ts +0 -0
- package/dist/{types/client → client}/useDictionary.d.ts +0 -0
- package/dist/{types/client → client}/useDictionaryAsync.d.ts +0 -0
- package/dist/{types/client → client}/useDictionaryDynamic.d.ts +0 -0
- package/dist/{types/client → client}/useIntlayer.d.ts +0 -0
- package/dist/{types/client → client}/useLoadDynamic.d.ts +0 -0
- package/dist/{types/client → client}/useLocale.d.ts +0 -0
- package/dist/{types/client → client}/useLocaleStorage.d.ts +0 -0
- package/dist/{types/client → client}/useRewriteURL.d.ts +0 -0
- package/dist/{types/editor → editor}/useEditor.d.ts +0 -0
- package/dist/{types/format → format}/index.d.ts +0 -0
- package/dist/{types/format → format}/useCompact.d.ts +0 -0
- package/dist/{types/format → format}/useCurrency.d.ts +0 -0
- package/dist/{types/format → format}/useDate.d.ts +0 -0
- package/dist/{types/format → format}/useIntl.d.ts +0 -0
- package/dist/{types/format → format}/useList.d.ts +0 -0
- package/dist/{types/format → format}/useNumber.d.ts +0 -0
- package/dist/{types/format → format}/usePercentage.d.ts +0 -0
- package/dist/{types/format → format}/useRelativeTime.d.ts +0 -0
- package/dist/{types/format → format}/useUnit.d.ts +0 -0
- package/dist/{types/getDictionary.d.ts → getDictionary.d.ts} +0 -0
- package/dist/{types/getIntlayer.d.ts → getIntlayer.d.ts} +0 -0
- package/dist/{types/html → html}/HTMLRenderer.d.ts +98 -98
- package/dist/{types/html → html}/index.d.ts +0 -0
- package/dist/{types/html → html}/installIntlayerHTML.d.ts +0 -0
- package/dist/{types/html → html}/types.d.ts +0 -0
- package/dist/{types/index.d.ts → index.d.ts} +0 -0
- package/dist/{types/markdown → markdown}/MarkdownRenderer.d.ts +98 -98
- /package/dist/{types/markdown → markdown}/compiler.d.ts +0 -0
- /package/dist/{types/markdown → markdown}/index.d.ts +0 -0
- /package/dist/{types/markdown → markdown}/installIntlayerMarkdown.d.ts +0 -0
- /package/dist/{types/markdown → markdown}/runtime.d.ts +0 -0
- /package/dist/{types/plugins.d.ts → plugins.d.ts} +0 -0
- /package/dist/{types/renderIntlayerNode.d.ts → renderIntlayerNode.d.ts} +0 -0
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,51 +1,50 @@
|
|
|
1
1
|
import { renderIntlayerNode as e } from "./renderIntlayerNode.mjs";
|
|
2
|
-
import { t } from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Fragment as i, h as a, markRaw as o } from "vue";
|
|
2
|
+
import { renderHTML as t } from "./html/HTMLRenderer.mjs";
|
|
3
|
+
import { useMarkdown as n } from "./markdown/installIntlayerMarkdown.mjs";
|
|
4
|
+
import { Fragment as r, defineAsyncComponent as i, h as a, markRaw as o } from "vue";
|
|
6
5
|
import { conditionPlugin as s, enumerationPlugin as c, fallbackPlugin as l, filePlugin as u, genderPlugin as d, nestedPlugin as f, splitInsertionTemplate as p, translationPlugin as m } from "@intlayer/core/interpreter";
|
|
7
6
|
import { editor as h, internationalization as g } from "@intlayer/config/built";
|
|
8
7
|
import { getMarkdownMetadata as _ } from "@intlayer/core/markdown";
|
|
9
8
|
import * as v from "@intlayer/types/nodeType";
|
|
10
9
|
//#region src/plugins.ts
|
|
11
|
-
var y = process.env.
|
|
10
|
+
var y = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : i(() => import("./editor/ContentSelector.mjs")), b = {
|
|
12
11
|
id: "intlayer-node-plugin",
|
|
13
12
|
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
14
|
-
transform: (
|
|
15
|
-
let
|
|
16
|
-
...
|
|
17
|
-
value:
|
|
18
|
-
children:
|
|
19
|
-
dictionaryKey:
|
|
20
|
-
keyPath:
|
|
21
|
-
}, { default: () => typeof
|
|
22
|
-
}),
|
|
23
|
-
if (typeof
|
|
24
|
-
let
|
|
25
|
-
Object.setPrototypeOf(
|
|
26
|
-
for (let e of Object.getOwnPropertyNames(
|
|
27
|
-
let t = Object.getOwnPropertyDescriptor(
|
|
28
|
-
t && Object.defineProperty(
|
|
13
|
+
transform: (t, { children: n, ...r }) => {
|
|
14
|
+
let i = (t) => e({
|
|
15
|
+
...r,
|
|
16
|
+
value: t,
|
|
17
|
+
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && h.enabled ? () => a(y, {
|
|
18
|
+
dictionaryKey: r.dictionaryKey,
|
|
19
|
+
keyPath: r.keyPath
|
|
20
|
+
}, { default: () => typeof t == "function" ? t() : t }) : t
|
|
21
|
+
}), s = i(n);
|
|
22
|
+
if (typeof n != "function") return s;
|
|
23
|
+
let c = (...e) => i(n(...e));
|
|
24
|
+
Object.setPrototypeOf(c, Object.getPrototypeOf(s));
|
|
25
|
+
for (let e of Object.getOwnPropertyNames(s)) {
|
|
26
|
+
let t = Object.getOwnPropertyDescriptor(s, e);
|
|
27
|
+
t && Object.defineProperty(c, e, t);
|
|
29
28
|
}
|
|
30
|
-
for (let e of Object.getOwnPropertySymbols(
|
|
31
|
-
let t = Object.getOwnPropertyDescriptor(
|
|
32
|
-
t && Object.defineProperty(
|
|
29
|
+
for (let e of Object.getOwnPropertySymbols(s)) {
|
|
30
|
+
let t = Object.getOwnPropertyDescriptor(s, e);
|
|
31
|
+
t && Object.defineProperty(c, e, t);
|
|
33
32
|
}
|
|
34
|
-
return o(
|
|
33
|
+
return o(c);
|
|
35
34
|
}
|
|
36
|
-
},
|
|
37
|
-
let n = /* @__PURE__ */ new Map(),
|
|
38
|
-
for (let [e,
|
|
39
|
-
let o = p(e,
|
|
35
|
+
}, x = (e, t) => {
|
|
36
|
+
let n = /* @__PURE__ */ new Map(), i = {};
|
|
37
|
+
for (let [e, r] of Object.entries(t)) typeof r == "string" || typeof r == "number" ? i[e] = r : (n.set(e, r), i[e] = `__VNODE_${e}__`);
|
|
38
|
+
let o = p(e, i);
|
|
40
39
|
if (n.size > 0) {
|
|
41
40
|
let e = [];
|
|
42
41
|
if (o.isSimple) {
|
|
43
|
-
let t = o.parts,
|
|
44
|
-
for (let [
|
|
45
|
-
let a = `__VNODE_${
|
|
46
|
-
o !== -1 && (o >
|
|
42
|
+
let t = o.parts, i = 0;
|
|
43
|
+
for (let [r] of n) {
|
|
44
|
+
let a = `__VNODE_${r}__`, o = t.indexOf(a);
|
|
45
|
+
o !== -1 && (o > i && e.push(t.substring(i, o)), e.push(n.get(r)), i = o + a.length);
|
|
47
46
|
}
|
|
48
|
-
return
|
|
47
|
+
return i < t.length && e.push(t.substring(i)), a(r, null, ...e);
|
|
49
48
|
} else return o.parts.forEach((t) => {
|
|
50
49
|
if (typeof t == "string") {
|
|
51
50
|
let r = t;
|
|
@@ -55,10 +54,10 @@ var y = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", b = process.en
|
|
|
55
54
|
}
|
|
56
55
|
r.length > 0 && e.push(r);
|
|
57
56
|
} else e.push(t);
|
|
58
|
-
}), a(
|
|
57
|
+
}), a(r, null, ...e);
|
|
59
58
|
}
|
|
60
|
-
return o.isSimple ? o.parts : a(
|
|
61
|
-
},
|
|
59
|
+
return o.isSimple ? o.parts : a(r, null, o.parts);
|
|
60
|
+
}, S = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? l : {
|
|
62
61
|
id: "insertion-plugin",
|
|
63
62
|
canHandle: (e) => typeof e == "object" && e?.nodeType === v.INSERTION,
|
|
64
63
|
transform: (e, t, n) => {
|
|
@@ -72,7 +71,7 @@ var y = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", b = process.en
|
|
|
72
71
|
plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
|
|
73
72
|
});
|
|
74
73
|
return (e) => {
|
|
75
|
-
let a =
|
|
74
|
+
let a = x(i, e);
|
|
76
75
|
return r(a, {
|
|
77
76
|
...n,
|
|
78
77
|
plugins: t.plugins,
|
|
@@ -88,43 +87,43 @@ var y = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", b = process.en
|
|
|
88
87
|
plugins: [a, ...t.plugins ?? []]
|
|
89
88
|
});
|
|
90
89
|
}
|
|
91
|
-
},
|
|
90
|
+
}, C = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? l : {
|
|
92
91
|
id: "markdown-string-plugin",
|
|
93
92
|
canHandle: (e) => typeof e == "string",
|
|
94
|
-
transform: (
|
|
95
|
-
let { plugins:
|
|
93
|
+
transform: (t, r, i) => {
|
|
94
|
+
let { plugins: o, ...s } = r, c = i(_(t) ?? {}, {
|
|
96
95
|
plugins: [{
|
|
97
96
|
id: "markdown-metadata-plugin",
|
|
98
97
|
canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
|
|
99
|
-
transform: (
|
|
98
|
+
transform: (n, r) => e({
|
|
100
99
|
...r,
|
|
101
|
-
value:
|
|
102
|
-
children:
|
|
100
|
+
value: n,
|
|
101
|
+
children: t
|
|
103
102
|
})
|
|
104
103
|
}],
|
|
105
|
-
dictionaryKey:
|
|
104
|
+
dictionaryKey: s.dictionaryKey,
|
|
106
105
|
keyPath: []
|
|
107
|
-
}),
|
|
108
|
-
...
|
|
109
|
-
value:
|
|
106
|
+
}), l = (i) => e({
|
|
107
|
+
...r,
|
|
108
|
+
value: t,
|
|
110
109
|
children: () => {
|
|
111
|
-
let { renderMarkdown: e, components:
|
|
112
|
-
...
|
|
113
|
-
...
|
|
110
|
+
let { renderMarkdown: e, components: r } = n(), o = e(t, void 0, {
|
|
111
|
+
...r ?? {},
|
|
112
|
+
...i ?? {}
|
|
114
113
|
});
|
|
115
|
-
return
|
|
116
|
-
dictionaryKey:
|
|
117
|
-
keyPath:
|
|
118
|
-
}, { default: () =>
|
|
114
|
+
return process.env.INTLAYER_EDITOR_ENABLED !== "false" && h.enabled ? a(y, {
|
|
115
|
+
dictionaryKey: s.dictionaryKey,
|
|
116
|
+
keyPath: s.keyPath
|
|
117
|
+
}, { default: () => o }) : o;
|
|
119
118
|
},
|
|
120
119
|
additionalProps: {
|
|
121
|
-
metadata:
|
|
122
|
-
use: (e) =>
|
|
120
|
+
metadata: c,
|
|
121
|
+
use: (e) => l(e)
|
|
123
122
|
}
|
|
124
123
|
});
|
|
125
|
-
return
|
|
124
|
+
return l();
|
|
126
125
|
}
|
|
127
|
-
},
|
|
126
|
+
}, w = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? l : {
|
|
128
127
|
id: "markdown-plugin",
|
|
129
128
|
canHandle: (e) => typeof e == "object" && e?.nodeType === v.MARKDOWN,
|
|
130
129
|
transform: (e, t, n) => {
|
|
@@ -133,33 +132,33 @@ var y = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", b = process.en
|
|
|
133
132
|
...t,
|
|
134
133
|
children: i,
|
|
135
134
|
keyPath: r,
|
|
136
|
-
plugins: [
|
|
135
|
+
plugins: [C, ...t.plugins ?? []]
|
|
137
136
|
});
|
|
138
137
|
}
|
|
139
|
-
},
|
|
138
|
+
}, T = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? l : {
|
|
140
139
|
id: "html-plugin",
|
|
141
140
|
canHandle: (e) => typeof e == "object" && e?.nodeType === v.HTML,
|
|
142
|
-
transform: (
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
let
|
|
146
|
-
let
|
|
141
|
+
transform: (n, r) => {
|
|
142
|
+
let i = n[v.HTML];
|
|
143
|
+
n.tags;
|
|
144
|
+
let o = (n = {}) => {
|
|
145
|
+
let s = t(i, { components: n });
|
|
147
146
|
return e({
|
|
148
|
-
...
|
|
149
|
-
value:
|
|
150
|
-
children:
|
|
151
|
-
dictionaryKey:
|
|
152
|
-
keyPath:
|
|
153
|
-
...
|
|
154
|
-
}, { default: () =>
|
|
155
|
-
additionalProps: { use: (e) =>
|
|
147
|
+
...r,
|
|
148
|
+
value: i,
|
|
149
|
+
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && h.enabled ? () => a(y, {
|
|
150
|
+
dictionaryKey: r.dictionaryKey,
|
|
151
|
+
keyPath: r.keyPath,
|
|
152
|
+
...n
|
|
153
|
+
}, { default: () => s }) : s,
|
|
154
|
+
additionalProps: { use: (e) => o(e) }
|
|
156
155
|
});
|
|
157
156
|
};
|
|
158
|
-
return
|
|
157
|
+
return o();
|
|
159
158
|
}
|
|
160
|
-
},
|
|
159
|
+
}, E = /* @__PURE__ */ new Map(), D = (e, t = !0) => {
|
|
161
160
|
let n = `${e ?? g.defaultLocale}_${t}`;
|
|
162
|
-
if (
|
|
161
|
+
if (E.has(n)) return E.get(n);
|
|
163
162
|
let r = [
|
|
164
163
|
m(e ?? g.defaultLocale, t ? g.defaultLocale : void 0),
|
|
165
164
|
c,
|
|
@@ -167,12 +166,12 @@ var y = process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", b = process.en
|
|
|
167
166
|
f(e ?? g.defaultLocale),
|
|
168
167
|
u,
|
|
169
168
|
d,
|
|
169
|
+
b,
|
|
170
|
+
S,
|
|
170
171
|
w,
|
|
171
|
-
|
|
172
|
-
O,
|
|
173
|
-
k
|
|
172
|
+
T
|
|
174
173
|
];
|
|
175
|
-
return
|
|
174
|
+
return E.set(n, r), r;
|
|
176
175
|
};
|
|
177
176
|
//#endregion
|
|
178
|
-
export {
|
|
177
|
+
export { D as getPlugins, T as htmlPlugin, S as insertionPlugin, b as intlayerNodePlugins, w as markdownPlugin, C as markdownStringPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./cjs/renderIntlayerNode.cjs`),l=require(`./cjs/html/HTMLRenderer.cjs`),u=require(`./cjs/markdown/installIntlayerMarkdown.cjs`);let d=require(`vue`),f=require(`@intlayer/core/interpreter`),p=require(`@intlayer/config/built`),m=require(`@intlayer/core/markdown`),h=require(`@intlayer/types/nodeType`);h=s(h);var g=process.env.INTLAYER_EDITOR_ENABLED===`false`?null:(0,d.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./cjs/editor/ContentSelector.cjs`))),_={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,...n})=>{let r=e=>c.renderIntlayerNode({...n,value:e,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?()=>(0,d.h)(g,{dictionaryKey:n.dictionaryKey,keyPath:n.keyPath},{default:()=>typeof e==`function`?e():e}):e}),i=r(t);if(typeof t!=`function`)return i;let a=(...e)=>r(t(...e));Object.setPrototypeOf(a,Object.getPrototypeOf(i));for(let e of Object.getOwnPropertyNames(i)){let t=Object.getOwnPropertyDescriptor(i,e);t&&Object.defineProperty(a,e,t)}for(let e of Object.getOwnPropertySymbols(i)){let t=Object.getOwnPropertyDescriptor(i,e);t&&Object.defineProperty(a,e,t)}return(0,d.markRaw)(a)}},v=(e,t)=>{let n=new Map,r={};for(let[e,i]of Object.entries(t))typeof i==`string`||typeof i==`number`?r[e]=i:(n.set(e,i),r[e]=`__VNODE_${e}__`);let i=(0,f.splitInsertionTemplate)(e,r);if(n.size>0){let e=[];if(i.isSimple){let t=i.parts,r=0;for(let[i]of n){let a=`__VNODE_${i}__`,o=t.indexOf(a);o!==-1&&(o>r&&e.push(t.substring(r,o)),e.push(n.get(i)),r=o+a.length)}return r<t.length&&e.push(t.substring(r)),(0,d.h)(d.Fragment,null,...e)}else return i.parts.forEach(t=>{if(typeof t==`string`){let r=t;for(let[t]of n){let i=`__VNODE_${t}__`,a=r.indexOf(i);a!==-1&&(a>0&&e.push(r.substring(0,a)),e.push(n.get(t)),r=r.substring(a+i.length))}r.length>0&&e.push(r)}else e.push(t)}),(0,d.h)(d.Fragment,null,...e)}return i.isSimple?i.parts:(0,d.h)(d.Fragment,null,i.parts)},y=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?f.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.INSERTION}],i=e[h.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,r)=>{let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let a=v(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}},b=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?f.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,a=n((0,m.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>c.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),o=n=>c.renderIntlayerNode({...t,value:e,children:()=>{let{renderMarkdown:t,components:r}=u.useMarkdown(),a=t(e,void 0,{...r??{},...n??{}});return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?(0,d.h)(g,{dictionaryKey:i.dictionaryKey,keyPath:i.keyPath},{default:()=>a}):a},additionalProps:{metadata:a,use:e=>o(e)}});return o()}},x=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?f.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.MARKDOWN}],i=e[h.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[b,...t.plugins??[]]})}},S=process.env.INTLAYER_NODE_TYPE_HTML===`false`?f.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.HTML,transform:(e,t)=>{let n=e[h.HTML];e.tags;let r=(e={})=>{let i=l.renderHTML(n,{components:e});return c.renderIntlayerNode({...t,value:n,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&p.editor.enabled?()=>(0,d.h)(g,{dictionaryKey:t.dictionaryKey,keyPath:t.keyPath,...e},{default:()=>i}):i,additionalProps:{use:e=>r(e)}})};return r()}},C=new Map,w=(e,t=!0)=>{let n=`${e??p.internationalization.defaultLocale}_${t}`;if(C.has(n))return C.get(n);let r=[(0,f.translationPlugin)(e??p.internationalization.defaultLocale,t?p.internationalization.defaultLocale:void 0),f.enumerationPlugin,f.conditionPlugin,(0,f.nestedPlugin)(e??p.internationalization.defaultLocale),f.filePlugin,f.genderPlugin,_,y,x,S];return C.set(n,r),r};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -102,11 +102,11 @@
|
|
|
102
102
|
"typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@intlayer/api": "8.7.
|
|
106
|
-
"@intlayer/config": "8.7.
|
|
107
|
-
"@intlayer/core": "8.7.
|
|
108
|
-
"@intlayer/editor": "8.7.
|
|
109
|
-
"@intlayer/types": "8.7.
|
|
105
|
+
"@intlayer/api": "8.7.13",
|
|
106
|
+
"@intlayer/config": "8.7.13",
|
|
107
|
+
"@intlayer/core": "8.7.13",
|
|
108
|
+
"@intlayer/editor": "8.7.13",
|
|
109
|
+
"@intlayer/types": "8.7.13"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@types/node": "25.6.0",
|
|
@@ -120,12 +120,12 @@
|
|
|
120
120
|
"tsdown": "0.21.10",
|
|
121
121
|
"typescript": "6.0.3",
|
|
122
122
|
"vite": "8.0.10",
|
|
123
|
-
"vite-plugin-dts": "
|
|
123
|
+
"vite-plugin-dts": "5.0.0",
|
|
124
124
|
"vitest": "4.1.5",
|
|
125
125
|
"vue-tsc": "3.1.8"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
|
-
"intlayer": "8.7.
|
|
128
|
+
"intlayer": "8.7.13",
|
|
129
129
|
"vue": ">=3.0.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependenciesMeta": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./plugins-DqGu9jRk.js`);let e=require(`vue`),t=require(`@intlayer/editor/isEnabled`);var n=process.env.INTLAYER_EDITOR_ENABLED===`false`,r=(0,e.defineComponent)({name:`ContentSelector`,props:{dictionaryKey:{type:String,required:!0},keyPath:{type:Array,required:!0}},setup(r,{slots:i}){return()=>n||!t.isEnabled?i.default?.():(0,e.h)(`intlayer-content-selector-wrapper`,{"key-path":JSON.stringify(r.keyPath),"dictionary-key":r.dictionaryKey},i.default?.())}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineComponent as e, h as t } from "vue";
|
|
2
|
-
import { isEnabled as n } from "@intlayer/editor/isEnabled";
|
|
3
|
-
//#region src/editor/ContentSelector.vue?vue&type=script&lang.ts
|
|
4
|
-
var r = process.env.INTLAYER_EDITOR_ENABLED === "false", i = e({
|
|
5
|
-
name: "ContentSelector",
|
|
6
|
-
props: {
|
|
7
|
-
dictionaryKey: {
|
|
8
|
-
type: String,
|
|
9
|
-
required: !0
|
|
10
|
-
},
|
|
11
|
-
keyPath: {
|
|
12
|
-
type: Array,
|
|
13
|
-
required: !0
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
setup(e, { slots: i }) {
|
|
17
|
-
return () => r || !n ? i.default?.() : t("intlayer-content-selector-wrapper", {
|
|
18
|
-
"key-path": JSON.stringify(e.keyPath),
|
|
19
|
-
"dictionary-key": e.dictionaryKey
|
|
20
|
-
}, i.default?.());
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
//#endregion
|
|
24
|
-
export { i as t };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { inject as e, onMounted as t, onUnmounted as n, readonly as r, ref as i, watchEffect as a } from "vue";
|
|
2
|
-
import { internationalization as o } from "@intlayer/config/built";
|
|
3
|
-
import { isEnabled as s } from "@intlayer/editor/isEnabled";
|
|
4
|
-
import { setIntlayerIdentifier as c } from "@intlayer/config/client";
|
|
5
|
-
//#region src/editor/useEditor.ts
|
|
6
|
-
var l = process.env.INTLAYER_EDITOR_ENABLED === "false", u = (e) => {
|
|
7
|
-
let t = null, n = !1;
|
|
8
|
-
return import("@intlayer/editor").then(({ initEditorClient: r }) => {
|
|
9
|
-
if (n) return;
|
|
10
|
-
let i = r();
|
|
11
|
-
e && (t = a(() => {
|
|
12
|
-
let t = e.value;
|
|
13
|
-
t && i.currentLocale.set(t);
|
|
14
|
-
}));
|
|
15
|
-
}), () => {
|
|
16
|
-
n = !0, t?.(), import("@intlayer/editor").then(({ stopEditorClient: e }) => {
|
|
17
|
-
e();
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
}, d = (r) => {
|
|
21
|
-
if (l || !s) return;
|
|
22
|
-
if (r) {
|
|
23
|
-
let e = null;
|
|
24
|
-
r.mixin({
|
|
25
|
-
inject: { _intlayerClient: {
|
|
26
|
-
from: f,
|
|
27
|
-
default: null
|
|
28
|
-
} },
|
|
29
|
-
mounted() {
|
|
30
|
-
if (this.$parent !== null) return;
|
|
31
|
-
let t = this._intlayerClient;
|
|
32
|
-
e = u(t?.locale);
|
|
33
|
-
},
|
|
34
|
-
unmounted() {
|
|
35
|
-
this.$parent === null && e?.();
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
let i = e(f), a = null;
|
|
41
|
-
t(() => {
|
|
42
|
-
a = u(i?.locale);
|
|
43
|
-
}), n(() => {
|
|
44
|
-
a?.();
|
|
45
|
-
});
|
|
46
|
-
}, f = Symbol("intlayer"), p = null, m = (e, t = !0) => {
|
|
47
|
-
if (p) return p;
|
|
48
|
-
c();
|
|
49
|
-
let { defaultLocale: n } = o ?? {}, a = i(e ?? n);
|
|
50
|
-
return p = {
|
|
51
|
-
locale: r(a),
|
|
52
|
-
setLocale: (e) => {
|
|
53
|
-
a.value = e;
|
|
54
|
-
},
|
|
55
|
-
isCookieEnabled: t
|
|
56
|
-
}, p;
|
|
57
|
-
}, h = (e, t) => {
|
|
58
|
-
let { locale: n, isCookieEnabled: r } = t ?? {}, i = m(n, r);
|
|
59
|
-
return e.provide(f, i), d(e), e;
|
|
60
|
-
}, g = { install: h };
|
|
61
|
-
//#endregion
|
|
62
|
-
export { d as a, g as i, m as n, h as r, f as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./plugins-DqGu9jRk.js`);let e=require(`vue`),t=require(`@intlayer/config/built`),n=require(`@intlayer/editor/isEnabled`),r=require(`@intlayer/config/client`);var i=process.env.INTLAYER_EDITOR_ENABLED===`false`,a=t=>{let n=null,r=!1;return import(`@intlayer/editor`).then(({initEditorClient:i})=>{if(r)return;let a=i();t&&(n=(0,e.watchEffect)(()=>{let e=t.value;e&&a.currentLocale.set(e)}))}),()=>{r=!0,n?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}},o=t=>{if(i||!n.isEnabled)return;if(t){let e=null;t.mixin({inject:{_intlayerClient:{from:s,default:null}},mounted(){if(this.$parent!==null)return;let t=this._intlayerClient;e=a(t?.locale)},unmounted(){this.$parent===null&&e?.()}});return}let r=(0,e.inject)(s),o=null;(0,e.onMounted)(()=>{o=a(r?.locale)}),(0,e.onUnmounted)(()=>{o?.()})},s=Symbol(`intlayer`),c=null,l=(n,i=!0)=>{if(c)return c;(0,r.setIntlayerIdentifier)();let{defaultLocale:a}=t.internationalization??{},o=(0,e.ref)(n??a);return c={locale:(0,e.readonly)(o),setLocale:e=>{o.value=e},isCookieEnabled:i},c},u=(e,t)=>{let{locale:n,isCookieEnabled:r}=t??{},i=l(n,r);return e.provide(s,i),o(e),e},d={install:u};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
package/dist/plugins-DqGu9jRk.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./cjs/renderIntlayerNode.cjs`),l=require(`./ContentSelector-BUs8zVld.js`),u=require(`./cjs/html/HTMLRenderer.cjs`),d=require(`./cjs/markdown/installIntlayerMarkdown.cjs`);let f=require(`vue`),p=require(`@intlayer/core/interpreter`),m=require(`@intlayer/config/built`),h=require(`@intlayer/core/markdown`),g=require(`@intlayer/types/nodeType`);g=s(g);var _=process.env.INTLAYER_NODE_TYPE_INTLAYER_NODE===`false`,v=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`,y=process.env.INTLAYER_NODE_TYPE_HTML===`false`,b=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`,x=process.env.INTLAYER_EDITOR_ENABLED===`false`,S=_?p.fallbackPlugin:{id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,...n})=>{let r=e=>c.renderIntlayerNode({...n,value:e,children:!x&&m.editor.enabled?()=>(0,f.h)(l.t,{dictionaryKey:n.dictionaryKey,keyPath:n.keyPath},{default:()=>typeof e==`function`?e():e}):e}),i=r(t);if(typeof t!=`function`)return i;let a=(...e)=>r(t(...e));Object.setPrototypeOf(a,Object.getPrototypeOf(i));for(let e of Object.getOwnPropertyNames(i)){let t=Object.getOwnPropertyDescriptor(i,e);t&&Object.defineProperty(a,e,t)}for(let e of Object.getOwnPropertySymbols(i)){let t=Object.getOwnPropertyDescriptor(i,e);t&&Object.defineProperty(a,e,t)}return(0,f.markRaw)(a)}},C=(e,t)=>{let n=new Map,r={};for(let[e,i]of Object.entries(t))typeof i==`string`||typeof i==`number`?r[e]=i:(n.set(e,i),r[e]=`__VNODE_${e}__`);let i=(0,p.splitInsertionTemplate)(e,r);if(n.size>0){let e=[];if(i.isSimple){let t=i.parts,r=0;for(let[i]of n){let a=`__VNODE_${i}__`,o=t.indexOf(a);o!==-1&&(o>r&&e.push(t.substring(r,o)),e.push(n.get(i)),r=o+a.length)}return r<t.length&&e.push(t.substring(r)),(0,f.h)(f.Fragment,null,...e)}else return i.parts.forEach(t=>{if(typeof t==`string`){let r=t;for(let[t]of n){let i=`__VNODE_${t}__`,a=r.indexOf(i);a!==-1&&(a>0&&e.push(r.substring(0,a)),e.push(n.get(t)),r=r.substring(a+i.length))}r.length>0&&e.push(r)}else e.push(t)}),(0,f.h)(f.Fragment,null,...e)}return i.isSimple?i.parts:(0,f.h)(f.Fragment,null,i.parts)},w=b?p.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===g.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:g.INSERTION}],i=e[g.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,r)=>{let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let a=C(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}},T=v?p.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,a=n((0,h.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>c.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),o=n=>c.renderIntlayerNode({...t,value:e,children:()=>{let{renderMarkdown:t,components:r}=d.useMarkdown(),a=t(e,void 0,{...r??{},...n??{}});return!x&&m.editor.enabled?(0,f.h)(l.t,{dictionaryKey:i.dictionaryKey,keyPath:i.keyPath},{default:()=>a}):a},additionalProps:{metadata:a,use:e=>o(e)}});return o()}},E=v?p.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===g.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:g.MARKDOWN}],i=e[g.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[T,...t.plugins??[]]})}},D=y?p.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===g.HTML,transform:(e,t)=>{let n=e[g.HTML];e.tags;let r=(e={})=>{let i=u.renderHTML(n,{components:e});return c.renderIntlayerNode({...t,value:n,children:!x&&m.editor.enabled?()=>(0,f.h)(l.t,{dictionaryKey:t.dictionaryKey,keyPath:t.keyPath,...e},{default:()=>i}):i,additionalProps:{use:e=>r(e)}})};return r()}},O=new Map,k=(e,t=!0)=>{let n=`${e??m.internationalization.defaultLocale}_${t}`;if(O.has(n))return O.get(n);let r=[(0,p.translationPlugin)(e??m.internationalization.defaultLocale,t?m.internationalization.defaultLocale:void 0),p.enumerationPlugin,p.conditionPlugin,(0,p.nestedPlugin)(e??m.internationalization.defaultLocale),p.filePlugin,p.genderPlugin,S,w,E,D];return O.set(n,r),r};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return k}});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|