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.
Files changed (95) hide show
  1. package/README.md +27 -1
  2. package/dist/cjs/UI/ContentSelector.cjs +1 -1
  3. package/dist/cjs/client/index.cjs +1 -1
  4. package/dist/cjs/client/installIntlayer.cjs +1 -1
  5. package/dist/cjs/client/useDictionary.cjs +1 -1
  6. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  7. package/dist/cjs/client/useIntlayer.cjs +1 -1
  8. package/dist/cjs/client/useLoadDynamic.cjs +1 -1
  9. package/dist/cjs/client/useLocale.cjs +1 -1
  10. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  11. package/dist/cjs/client/useRewriteURL.cjs +1 -1
  12. package/dist/cjs/editor/ContentSelector.cjs +1 -1
  13. package/dist/cjs/editor/useEditor.cjs +1 -1
  14. package/dist/cjs/format/useCompact.cjs +1 -1
  15. package/dist/cjs/format/useCurrency.cjs +1 -1
  16. package/dist/cjs/format/useDate.cjs +1 -1
  17. package/dist/cjs/format/useIntl.cjs +1 -1
  18. package/dist/cjs/format/useList.cjs +1 -1
  19. package/dist/cjs/format/useNumber.cjs +1 -1
  20. package/dist/cjs/format/usePercentage.cjs +1 -1
  21. package/dist/cjs/format/useRelativeTime.cjs +1 -1
  22. package/dist/cjs/format/useUnit.cjs +1 -1
  23. package/dist/cjs/getDictionary.cjs +1 -1
  24. package/dist/cjs/getIntlayer.cjs +1 -1
  25. package/dist/cjs/html/HTMLRenderer.cjs +1 -1
  26. package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
  27. package/dist/cjs/index.cjs +1 -1
  28. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
  29. package/dist/cjs/markdown/compiler.cjs +1 -1
  30. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
  31. package/dist/cjs/markdown/runtime.cjs +1 -1
  32. package/dist/cjs/plugins.cjs +1 -1
  33. package/dist/cjs/renderIntlayerNode.cjs +1 -1
  34. package/dist/{types/editor → editor}/ContentSelector.vue.d.ts +3 -2
  35. package/dist/esm/client/index.mjs +2 -2
  36. package/dist/esm/client/installIntlayer.mjs +23 -2
  37. package/dist/esm/client/useDictionary.mjs +1 -1
  38. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  39. package/dist/esm/client/useIntlayer.mjs +1 -1
  40. package/dist/esm/client/useLocale.mjs +1 -1
  41. package/dist/esm/editor/ContentSelector.mjs +25 -2
  42. package/dist/esm/editor/useEditor.mjs +47 -2
  43. package/dist/esm/format/useCompact.mjs +1 -1
  44. package/dist/esm/format/useCurrency.mjs +1 -1
  45. package/dist/esm/format/useDate.mjs +1 -1
  46. package/dist/esm/format/useIntl.mjs +1 -1
  47. package/dist/esm/format/useList.mjs +1 -1
  48. package/dist/esm/format/useNumber.mjs +1 -1
  49. package/dist/esm/format/usePercentage.mjs +1 -1
  50. package/dist/esm/format/useRelativeTime.mjs +1 -1
  51. package/dist/esm/format/useUnit.mjs +1 -1
  52. package/dist/esm/index.mjs +10 -9
  53. package/dist/esm/plugins.mjs +80 -81
  54. package/dist/plugins-DCpi7fYK.js +1 -0
  55. package/package.json +8 -8
  56. package/dist/ContentSelector-BUs8zVld.js +0 -1
  57. package/dist/ContentSelector-CJ8wOzKS.mjs +0 -24
  58. package/dist/installIntlayer-BkiEiexB.mjs +0 -62
  59. package/dist/installIntlayer-mdeEN-3u.js +0 -1
  60. package/dist/plugins-DqGu9jRk.js +0 -1
  61. package/dist/{types/client → client}/index.d.ts +0 -0
  62. package/dist/{types/client → client}/installIntlayer.d.ts +0 -0
  63. package/dist/{types/client → client}/useDictionary.d.ts +0 -0
  64. package/dist/{types/client → client}/useDictionaryAsync.d.ts +0 -0
  65. package/dist/{types/client → client}/useDictionaryDynamic.d.ts +0 -0
  66. package/dist/{types/client → client}/useIntlayer.d.ts +0 -0
  67. package/dist/{types/client → client}/useLoadDynamic.d.ts +0 -0
  68. package/dist/{types/client → client}/useLocale.d.ts +0 -0
  69. package/dist/{types/client → client}/useLocaleStorage.d.ts +0 -0
  70. package/dist/{types/client → client}/useRewriteURL.d.ts +0 -0
  71. package/dist/{types/editor → editor}/useEditor.d.ts +0 -0
  72. package/dist/{types/format → format}/index.d.ts +0 -0
  73. package/dist/{types/format → format}/useCompact.d.ts +0 -0
  74. package/dist/{types/format → format}/useCurrency.d.ts +0 -0
  75. package/dist/{types/format → format}/useDate.d.ts +0 -0
  76. package/dist/{types/format → format}/useIntl.d.ts +0 -0
  77. package/dist/{types/format → format}/useList.d.ts +0 -0
  78. package/dist/{types/format → format}/useNumber.d.ts +0 -0
  79. package/dist/{types/format → format}/usePercentage.d.ts +0 -0
  80. package/dist/{types/format → format}/useRelativeTime.d.ts +0 -0
  81. package/dist/{types/format → format}/useUnit.d.ts +0 -0
  82. package/dist/{types/getDictionary.d.ts → getDictionary.d.ts} +0 -0
  83. package/dist/{types/getIntlayer.d.ts → getIntlayer.d.ts} +0 -0
  84. package/dist/{types/html → html}/HTMLRenderer.d.ts +98 -98
  85. package/dist/{types/html → html}/index.d.ts +0 -0
  86. package/dist/{types/html → html}/installIntlayerHTML.d.ts +0 -0
  87. package/dist/{types/html → html}/types.d.ts +0 -0
  88. package/dist/{types/index.d.ts → index.d.ts} +0 -0
  89. package/dist/{types/markdown → markdown}/MarkdownRenderer.d.ts +98 -98
  90. /package/dist/{types/markdown → markdown}/compiler.d.ts +0 -0
  91. /package/dist/{types/markdown → markdown}/index.d.ts +0 -0
  92. /package/dist/{types/markdown → markdown}/installIntlayerMarkdown.d.ts +0 -0
  93. /package/dist/{types/markdown → markdown}/runtime.d.ts +0 -0
  94. /package/dist/{types/plugins.d.ts → plugins.d.ts} +0 -0
  95. /package/dist/{types/renderIntlayerNode.d.ts → renderIntlayerNode.d.ts} +0 -0
@@ -1,51 +1,50 @@
1
1
  import { renderIntlayerNode as e } from "./renderIntlayerNode.mjs";
2
- import { t } from "../ContentSelector-CJ8wOzKS.mjs";
3
- import { renderHTML as n } from "./html/HTMLRenderer.mjs";
4
- import { useMarkdown as r } from "./markdown/installIntlayerMarkdown.mjs";
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.INTLAYER_NODE_TYPE_INTLAYER_NODE === "false", b = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false", x = process.env.INTLAYER_NODE_TYPE_HTML === "false", S = process.env.INTLAYER_NODE_TYPE_INSERTION === "false", C = process.env.INTLAYER_EDITOR_ENABLED === "false", w = y ? l : {
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: (n, { children: r, ...i }) => {
15
- let s = (n) => e({
16
- ...i,
17
- value: n,
18
- children: !C && h.enabled ? () => a(t, {
19
- dictionaryKey: i.dictionaryKey,
20
- keyPath: i.keyPath
21
- }, { default: () => typeof n == "function" ? n() : n }) : n
22
- }), c = s(r);
23
- if (typeof r != "function") return c;
24
- let l = (...e) => s(r(...e));
25
- Object.setPrototypeOf(l, Object.getPrototypeOf(c));
26
- for (let e of Object.getOwnPropertyNames(c)) {
27
- let t = Object.getOwnPropertyDescriptor(c, e);
28
- t && Object.defineProperty(l, e, t);
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(c)) {
31
- let t = Object.getOwnPropertyDescriptor(c, e);
32
- t && Object.defineProperty(l, e, t);
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(l);
33
+ return o(c);
35
34
  }
36
- }, T = (e, t) => {
37
- let n = /* @__PURE__ */ new Map(), r = {};
38
- 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}__`);
39
- let o = p(e, r);
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, r = 0;
44
- for (let [i] of n) {
45
- let a = `__VNODE_${i}__`, o = t.indexOf(a);
46
- o !== -1 && (o > r && e.push(t.substring(r, o)), e.push(n.get(i)), r = o + a.length);
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 r < t.length && e.push(t.substring(r)), a(i, null, ...e);
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(i, null, ...e);
57
+ }), a(r, null, ...e);
59
58
  }
60
- return o.isSimple ? o.parts : a(i, null, o.parts);
61
- }, E = S ? l : {
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 = T(i, e);
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
- }, D = b ? l : {
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: (n, i, o) => {
95
- let { plugins: s, ...c } = i, l = o(_(n) ?? {}, {
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: (t, r) => e({
98
+ transform: (n, r) => e({
100
99
  ...r,
101
- value: t,
102
- children: n
100
+ value: n,
101
+ children: t
103
102
  })
104
103
  }],
105
- dictionaryKey: c.dictionaryKey,
104
+ dictionaryKey: s.dictionaryKey,
106
105
  keyPath: []
107
- }), u = (o) => e({
108
- ...i,
109
- value: n,
106
+ }), l = (i) => e({
107
+ ...r,
108
+ value: t,
110
109
  children: () => {
111
- let { renderMarkdown: e, components: i } = r(), s = e(n, void 0, {
112
- ...i ?? {},
113
- ...o ?? {}
110
+ let { renderMarkdown: e, components: r } = n(), o = e(t, void 0, {
111
+ ...r ?? {},
112
+ ...i ?? {}
114
113
  });
115
- return !C && h.enabled ? a(t, {
116
- dictionaryKey: c.dictionaryKey,
117
- keyPath: c.keyPath
118
- }, { default: () => s }) : s;
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: l,
122
- use: (e) => u(e)
120
+ metadata: c,
121
+ use: (e) => l(e)
123
122
  }
124
123
  });
125
- return u();
124
+ return l();
126
125
  }
127
- }, O = b ? l : {
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: [D, ...t.plugins ?? []]
135
+ plugins: [C, ...t.plugins ?? []]
137
136
  });
138
137
  }
139
- }, k = x ? l : {
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: (r, i) => {
143
- let o = r[v.HTML];
144
- r.tags;
145
- let s = (r = {}) => {
146
- let c = n(o, { components: r });
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
- ...i,
149
- value: o,
150
- children: !C && h.enabled ? () => a(t, {
151
- dictionaryKey: i.dictionaryKey,
152
- keyPath: i.keyPath,
153
- ...r
154
- }, { default: () => c }) : c,
155
- additionalProps: { use: (e) => s(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 s();
157
+ return o();
159
158
  }
160
- }, A = /* @__PURE__ */ new Map(), j = (e, t = !0) => {
159
+ }, E = /* @__PURE__ */ new Map(), D = (e, t = !0) => {
161
160
  let n = `${e ?? g.defaultLocale}_${t}`;
162
- if (A.has(n)) return A.get(n);
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
- E,
172
- O,
173
- k
172
+ T
174
173
  ];
175
- return A.set(n, r), r;
174
+ return E.set(n, r), r;
176
175
  };
177
176
  //#endregion
178
- export { j as getPlugins, k as htmlPlugin, E as insertionPlugin, w as intlayerNodePlugins, O as markdownPlugin, D as markdownStringPlugin };
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.11",
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.11",
106
- "@intlayer/config": "8.7.11",
107
- "@intlayer/core": "8.7.11",
108
- "@intlayer/editor": "8.7.11",
109
- "@intlayer/types": "8.7.11"
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": "4.5.4",
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.11",
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}});
@@ -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