vue-intlayer 8.3.4 → 8.4.0

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 (125) hide show
  1. package/dist/ContentSelector-4HDV-6f8.mjs +31 -0
  2. package/dist/ContentSelector-CAg85Zo3.js +1 -0
  3. package/dist/chunk-C91j1N6u.js +1 -0
  4. package/dist/cjs/UI/ContentSelector.cjs +1 -1
  5. package/dist/cjs/client/index.cjs +1 -1
  6. package/dist/cjs/client/installIntlayer.cjs +1 -1
  7. package/dist/cjs/client/useDictionary.cjs +1 -1
  8. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  9. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  10. package/dist/cjs/client/useIntlayer.cjs +1 -1
  11. package/dist/cjs/client/useLoadDynamic.cjs +1 -1
  12. package/dist/cjs/client/useLocale.cjs +1 -1
  13. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  14. package/dist/cjs/client/useRewriteURL.cjs +1 -1
  15. package/dist/cjs/editor/{ContentSelectorWrapper.cjs → ContentSelector.cjs} +1 -1
  16. package/dist/cjs/editor/useEditor.cjs +1 -1
  17. package/dist/cjs/format/useCompact.cjs +1 -1
  18. package/dist/cjs/format/useCurrency.cjs +1 -1
  19. package/dist/cjs/format/useDate.cjs +1 -1
  20. package/dist/cjs/format/useIntl.cjs +1 -1
  21. package/dist/cjs/format/useList.cjs +1 -1
  22. package/dist/cjs/format/useNumber.cjs +1 -1
  23. package/dist/cjs/format/usePercentage.cjs +1 -1
  24. package/dist/cjs/format/useRelativeTime.cjs +1 -1
  25. package/dist/cjs/format/useUnit.cjs +1 -1
  26. package/dist/cjs/getDictionary.cjs +1 -1
  27. package/dist/cjs/getIntlayer.cjs +1 -1
  28. package/dist/cjs/html/HTMLRenderer.cjs +1 -1
  29. package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
  30. package/dist/cjs/index.cjs +1 -1
  31. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
  32. package/dist/cjs/markdown/compiler.cjs +1 -1
  33. package/dist/cjs/markdown/index.cjs +1 -1
  34. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
  35. package/dist/cjs/markdown/runtime.cjs +1 -1
  36. package/dist/cjs/plugins.cjs +1 -1
  37. package/dist/cjs/renderIntlayerNode.cjs +1 -1
  38. package/dist/esm/client/index.mjs +9 -3
  39. package/dist/esm/client/installIntlayer.mjs +2 -2
  40. package/dist/esm/client/useDictionary.mjs +75 -2
  41. package/dist/esm/client/useDictionaryAsync.mjs +14 -2
  42. package/dist/esm/client/useDictionaryDynamic.mjs +5 -2
  43. package/dist/esm/client/useIntlayer.mjs +49 -2
  44. package/dist/esm/client/useLocale.mjs +22 -2
  45. package/dist/esm/client/useLocaleStorage.mjs +11 -11
  46. package/dist/esm/client/useRewriteURL.mjs +15 -2
  47. package/dist/esm/editor/ContentSelector.mjs +2 -0
  48. package/dist/esm/editor/useEditor.mjs +1 -1
  49. package/dist/esm/format/useCompact.mjs +1 -1
  50. package/dist/esm/format/useCurrency.mjs +1 -1
  51. package/dist/esm/format/useDate.mjs +1 -1
  52. package/dist/esm/format/useIntl.mjs +1 -1
  53. package/dist/esm/format/useList.mjs +1 -1
  54. package/dist/esm/format/useNumber.mjs +1 -1
  55. package/dist/esm/format/usePercentage.mjs +1 -1
  56. package/dist/esm/format/useRelativeTime.mjs +1 -1
  57. package/dist/esm/format/useUnit.mjs +1 -1
  58. package/dist/esm/getDictionary.mjs +6 -2
  59. package/dist/esm/getIntlayer.mjs +6 -2
  60. package/dist/esm/index.mjs +19 -19
  61. package/dist/esm/plugins.mjs +171 -2
  62. package/dist/installIntlayer-CJaEylqu.mjs +60 -0
  63. package/dist/installIntlayer-DXaXXzB5.js +1 -0
  64. package/dist/types/client/installIntlayer.d.ts +1 -1
  65. package/dist/types/client/useDictionary.d.ts +1 -1
  66. package/dist/types/editor/useEditor.d.ts +11 -1
  67. package/dist/types/html/HTMLRenderer.d.ts +97 -97
  68. package/dist/types/index.d.ts +1 -1
  69. package/dist/types/markdown/MarkdownRenderer.d.ts +98 -98
  70. package/package.json +7 -7
  71. package/dist/ContentSelectorWrapper-B7p44V28.mjs +0 -52
  72. package/dist/ContentSelectorWrapper-DpyRYcE8.js +0 -1
  73. package/dist/EditedContentRenderer-BFVoITDN.js +0 -1
  74. package/dist/EditedContentRenderer-DNBqpZpl.mjs +0 -28
  75. package/dist/cjs/editor/EditedContentRenderer.cjs +0 -1
  76. package/dist/cjs/editor/EditorSelectorRenderer.cjs +0 -1
  77. package/dist/cjs/editor/communicator.cjs +0 -1
  78. package/dist/cjs/editor/configuration.cjs +0 -1
  79. package/dist/cjs/editor/createSharedComposable.cjs +0 -1
  80. package/dist/cjs/editor/dictionariesRecord.cjs +0 -1
  81. package/dist/cjs/editor/editedContent.cjs +0 -1
  82. package/dist/cjs/editor/editorEnabled.cjs +0 -1
  83. package/dist/cjs/editor/editorLocale.cjs +0 -1
  84. package/dist/cjs/editor/focusDictionary.cjs +0 -1
  85. package/dist/cjs/editor/index.cjs +0 -1
  86. package/dist/cjs/editor/installIntlayerEditor.cjs +0 -1
  87. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +0 -1
  88. package/dist/cjs/editor/useCrossFrameState.cjs +0 -1
  89. package/dist/cjs/editor/useCrossURLPathState.cjs +0 -1
  90. package/dist/cjs/editor/useEditedContentRenderer.cjs +0 -1
  91. package/dist/cjs/editor/useIframeClickInterceptor.cjs +0 -1
  92. package/dist/esm/editor/ContentSelectorWrapper.mjs +0 -2
  93. package/dist/esm/editor/EditedContentRenderer.mjs +0 -2
  94. package/dist/esm/editor/EditorSelectorRenderer.mjs +0 -44
  95. package/dist/esm/editor/communicator.mjs +0 -12
  96. package/dist/esm/editor/configuration.mjs +0 -15
  97. package/dist/esm/editor/createSharedComposable.mjs +0 -10
  98. package/dist/esm/editor/dictionariesRecord.mjs +0 -19
  99. package/dist/esm/editor/editedContent.mjs +0 -26
  100. package/dist/esm/editor/editorEnabled.mjs +0 -15
  101. package/dist/esm/editor/editorLocale.mjs +0 -2
  102. package/dist/esm/editor/focusDictionary.mjs +0 -19
  103. package/dist/esm/editor/index.mjs +0 -12
  104. package/dist/esm/editor/installIntlayerEditor.mjs +0 -22
  105. package/dist/esm/editor/useCrossFrameMessageListener.mjs +0 -9
  106. package/dist/esm/editor/useCrossFrameState.mjs +0 -39
  107. package/dist/esm/editor/useCrossURLPathState.mjs +0 -8
  108. package/dist/esm/editor/useEditedContentRenderer.mjs +0 -9
  109. package/dist/esm/editor/useIframeClickInterceptor.mjs +0 -10
  110. package/dist/getDictionary-5DAguynf.mjs +0 -332
  111. package/dist/getDictionary-yKxg53ez.js +0 -1
  112. package/dist/installIntlayerEditor-BpsBr4EN.js +0 -1
  113. package/dist/types/editor/communicator.d.ts +0 -4
  114. package/dist/types/editor/createSharedComposable.d.ts +0 -12
  115. package/dist/types/editor/editorEnabled.d.ts +0 -3
  116. package/dist/types/editor/editorLocale.d.ts +0 -2
  117. package/dist/types/editor/focusDictionary.d.ts +0 -88
  118. package/dist/types/editor/index.d.ts +0 -12
  119. package/dist/types/editor/installIntlayerEditor.d.ts +0 -5
  120. package/dist/types/editor/useCrossFrameMessageListener.d.ts +0 -2
  121. package/dist/types/editor/useCrossFrameState.d.ts +0 -7
  122. package/dist/types/editor/useCrossURLPathState.d.ts +0 -1
  123. package/dist/types/editor/useEditedContentRenderer.d.ts +0 -9
  124. package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -2
  125. /package/dist/types/editor/{ContentSelectorWrapper.vue.d.ts → ContentSelector.vue.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { C as e } from "../../getDictionary-5DAguynf.mjs";
1
+ import { t as e } from "../../installIntlayer-CJaEylqu.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { number as r } from "@intlayer/core/formatters";
4
4
  //#region src/format/useNumber.ts
@@ -1,4 +1,4 @@
1
- import { C as e } from "../../getDictionary-5DAguynf.mjs";
1
+ import { t as e } from "../../installIntlayer-CJaEylqu.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { percentage as r } from "@intlayer/core/formatters";
4
4
  //#region src/format/usePercentage.ts
@@ -1,4 +1,4 @@
1
- import { C as e } from "../../getDictionary-5DAguynf.mjs";
1
+ import { t as e } from "../../installIntlayer-CJaEylqu.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { relativeTime as r } from "@intlayer/core/formatters";
4
4
  //#region src/format/useRelativeTime.ts
@@ -1,4 +1,4 @@
1
- import { C as e } from "../../getDictionary-5DAguynf.mjs";
1
+ import { t as e } from "../../installIntlayer-CJaEylqu.mjs";
2
2
  import { computed as t, inject as n } from "vue";
3
3
  import { units as r } from "@intlayer/core/formatters";
4
4
  //#region src/format/useUnit.ts
@@ -1,2 +1,6 @@
1
- import { t as e } from "../getDictionary-5DAguynf.mjs";
2
- export { e as getDictionary };
1
+ import { getPlugins as e } from "./plugins.mjs";
2
+ import { getDictionary as t } from "@intlayer/core/interpreter";
3
+ //#region src/getDictionary.ts
4
+ var n = (n, r) => t(n, r, e(r));
5
+ //#endregion
6
+ export { n as getDictionary };
@@ -1,2 +1,6 @@
1
- import { p as e } from "../getDictionary-5DAguynf.mjs";
2
- export { e as getIntlayer };
1
+ import { getPlugins as e } from "./plugins.mjs";
2
+ import { getIntlayer as t } from "@intlayer/core/interpreter";
3
+ //#region src/getIntlayer.ts
4
+ var n = (n, r) => t(n, r, e(r));
5
+ //#endregion
6
+ export { n as getIntlayer };
@@ -1,22 +1,22 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t, installIntlayerEditor as n } from "./editor/installIntlayerEditor.mjs";
2
- import { useEditorEnabled as r } from "./editor/editorEnabled.mjs";
3
- import { useFocusDictionary as i } from "./editor/focusDictionary.mjs";
4
- import { t as a } from "../ContentSelectorWrapper-B7p44V28.mjs";
5
- import { useConfiguration as o } from "./editor/configuration.mjs";
6
- import { useDictionariesRecord as s } from "./editor/dictionariesRecord.mjs";
7
- import { useEditedContent as c } from "./editor/editedContent.mjs";
8
- import { C as l, S as u, T as d, _ as f, a as p, b as m, c as h, d as g, f as _, g as v, h as y, i as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A, w as j, x as M, y as N } from "../getDictionary-5DAguynf.mjs";
1
+ import e, { createVueRuntime as t } from "./markdown/runtime.mjs";
2
+ import { RuleType as n, compile as r, compileMarkdown as i, compiler as a, sanitizer as o, slugify as s } from "./markdown/compiler.mjs";
3
+ import { INTLAYER_MARKDOWN_SYMBOL as c, createIntlayerMarkdownClient as l, installIntlayerMarkdown as u, useMarkdown as d } from "./markdown/installIntlayerMarkdown.mjs";
4
+ import { getPlugins as f, htmlPlugin as p, insertionPlugin as m, intlayerNodePlugins as h, markdownPlugin as g, markdownStringPlugin as _ } from "./plugins.mjs";
5
+ import { getDictionary as v } from "./getDictionary.mjs";
6
+ import { getIntlayer as y } from "./getIntlayer.mjs";
7
+ import { i as b, n as x, r as S, t as C } from "../installIntlayer-CJaEylqu.mjs";
8
+ import { atPath as w, createIntlayerLeafProxy as T, isComponentLike as E, isIntlayerNode as D, isObjectLike as O, toComponent as k, useDictionary as A } from "./client/useDictionary.mjs";
9
+ import { useDictionaryAsync as j } from "./client/useDictionaryAsync.mjs";
10
+ import { useDictionaryDynamic as M } from "./client/useDictionaryDynamic.mjs";
11
+ import { useIntlayer as N } from "./client/useIntlayer.mjs";
9
12
  import { useLoadDynamic as P } from "./client/useLoadDynamic.mjs";
10
- import { useCrossFrameMessageListener as F } from "./editor/useCrossFrameMessageListener.mjs";
11
- import { useCrossFrameState as I } from "./editor/useCrossFrameState.mjs";
12
- import { useIframeClickInterceptor as L, useIframeClickMerger as R } from "./editor/useIframeClickInterceptor.mjs";
13
- import z, { createVueRuntime as B } from "./markdown/runtime.mjs";
14
- import { RuleType as V, compile as H, compileMarkdown as U, compiler as W, sanitizer as G, slugify as K } from "./markdown/compiler.mjs";
15
- import { INTLAYER_MARKDOWN_SYMBOL as q, createIntlayerMarkdownClient as J, installIntlayerMarkdown as Y, useMarkdown as X } from "./markdown/installIntlayerMarkdown.mjs";
16
- import { useIntl as Z } from "./format/useIntl.mjs";
17
- import { INTLAYER_HTML_SYMBOL as Q, createIntlayerHTMLClient as $, installIntlayerHTML as ee, useHTML as te } from "./html/installIntlayerHTML.mjs";
18
- import { HTMLRenderer as ne, renderHTML as re, useHTMLRenderer as ie } from "./html/HTMLRenderer.mjs";
13
+ import { useLocale as F } from "./client/useLocale.mjs";
14
+ import { useRewriteURL as I } from "./client/useRewriteURL.mjs";
15
+ import "./client/index.mjs";
16
+ import { useIntl as L } from "./format/useIntl.mjs";
17
+ import { INTLAYER_HTML_SYMBOL as R, createIntlayerHTMLClient as z, installIntlayerHTML as B, useHTML as V } from "./html/installIntlayerHTML.mjs";
18
+ import { HTMLRenderer as H, renderHTML as U, useHTMLRenderer as W } from "./html/HTMLRenderer.mjs";
19
19
  import "./html/index.mjs";
20
- import { MarkdownRenderer as ae, renderMarkdown as oe, useMarkdownRenderer as se } from "./markdown/MarkdownRenderer.mjs";
20
+ import { MarkdownRenderer as G, renderMarkdown as K, useMarkdownRenderer as q } from "./markdown/MarkdownRenderer.mjs";
21
21
  import "./markdown/index.mjs";
22
- export { a as ContentSelectorWrapper, ne as HTMLRenderer, e as INTLAYER_EDITOR_MANAGER_SYMBOL, Q as INTLAYER_HTML_SYMBOL, q as INTLAYER_MARKDOWN_SYMBOL, l as INTLAYER_SYMBOL, ae as MarkdownRenderer, V as RuleType, v as atPath, H as compile, U as compileMarkdown, W as compiler, j as createIntlayerClient, $ as createIntlayerHTMLClient, f as createIntlayerLeafProxy, J as createIntlayerMarkdownClient, B as createVueRuntime, O as getDictionary, t as getEditorStateManager, T as getIntlayer, C as getPlugins, E as htmlPlugin, b as insertionPlugin, d as installIntlayer, n as installIntlayerEditor, ee as installIntlayerHTML, Y as installIntlayerMarkdown, p as intlayerNodePlugins, A as isComponentLike, N as isIntlayerNode, m as isObjectLike, w as markdownPlugin, D as markdownStringPlugin, re as renderHTML, oe as renderMarkdown, G as sanitizer, K as slugify, M as toComponent, o as useConfiguration, F as useCrossFrameMessageListener, I as useCrossFrameState, s as useDictionariesRecord, u as useDictionary, y as useDictionaryAsync, S as useDictionaryDynamic, c as useEditedContent, h as useEditor, r as useEditorEnabled, x as useEditorLocale, i as useFocusDictionary, te as useHTML, ie as useHTMLRenderer, L as useIframeClickInterceptor, R as useIframeClickMerger, Z as useIntl, _ as useIntlayer, P as useLoadDynamic, g as useLocale, X as useMarkdown, se as useMarkdownRenderer, k as useRewriteURL, z as vueRuntime };
22
+ export { H as HTMLRenderer, R as INTLAYER_HTML_SYMBOL, c as INTLAYER_MARKDOWN_SYMBOL, C as INTLAYER_SYMBOL, G as MarkdownRenderer, n as RuleType, w as atPath, r as compile, i as compileMarkdown, a as compiler, x as createIntlayerClient, z as createIntlayerHTMLClient, T as createIntlayerLeafProxy, l as createIntlayerMarkdownClient, t as createVueRuntime, v as getDictionary, y as getIntlayer, f as getPlugins, p as htmlPlugin, m as insertionPlugin, S as installIntlayer, B as installIntlayerHTML, u as installIntlayerMarkdown, h as intlayerNodePlugins, E as isComponentLike, D as isIntlayerNode, O as isObjectLike, g as markdownPlugin, _ as markdownStringPlugin, U as renderHTML, K as renderMarkdown, o as sanitizer, s as slugify, k as toComponent, A as useDictionary, j as useDictionaryAsync, M as useDictionaryDynamic, b as useEditor, V as useHTML, W as useHTMLRenderer, L as useIntl, N as useIntlayer, P as useLoadDynamic, F as useLocale, d as useMarkdown, q as useMarkdownRenderer, I as useRewriteURL, e as vueRuntime };
@@ -1,2 +1,171 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a } from "../getDictionary-5DAguynf.mjs";
2
- export { n as getPlugins, i as htmlPlugin, t as insertionPlugin, e as intlayerNodePlugins, r as markdownPlugin, a as markdownStringPlugin };
1
+ import { t as e } from "../ContentSelector-4HDV-6f8.mjs";
2
+ import { useMarkdown as t } from "./markdown/installIntlayerMarkdown.mjs";
3
+ import { renderIntlayerNode as n } from "./renderIntlayerNode.mjs";
4
+ import { conditionPlugin as r, enumerationPlugin as i, filePlugin as a, genderPlugin as o, getHTML as s, nestedPlugin as c, splitInsertionTemplate as l, translationPlugin as u } from "@intlayer/core/interpreter";
5
+ import d from "@intlayer/config/built";
6
+ import { getMarkdownMetadata as f } from "@intlayer/core/markdown";
7
+ import { HTML_TAGS as p } from "@intlayer/core/transpiler";
8
+ import { NodeType as m } from "@intlayer/types/nodeType";
9
+ import { Fragment as h, h as g, markRaw as _ } from "vue";
10
+ //#region src/plugins.ts
11
+ var v = {
12
+ id: "intlayer-node-plugin",
13
+ canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
14
+ transform: (t, { children: r, ...i }) => {
15
+ let a = (t) => n({
16
+ ...i,
17
+ value: t,
18
+ children: d?.editor.enabled ? () => g(e, {
19
+ dictionaryKey: i.dictionaryKey,
20
+ keyPath: i.keyPath
21
+ }, { default: () => typeof t == "function" ? t() : t }) : t
22
+ }), o = a(r);
23
+ if (typeof r != "function") return o;
24
+ let s = (...e) => a(r(...e));
25
+ Object.setPrototypeOf(s, Object.getPrototypeOf(o));
26
+ for (let e of Object.getOwnPropertyNames(o)) {
27
+ let t = Object.getOwnPropertyDescriptor(o, e);
28
+ t && Object.defineProperty(s, e, t);
29
+ }
30
+ for (let e of Object.getOwnPropertySymbols(o)) {
31
+ let t = Object.getOwnPropertyDescriptor(o, e);
32
+ t && Object.defineProperty(s, e, t);
33
+ }
34
+ return _(s);
35
+ }
36
+ }, y = (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 i = l(e, r);
40
+ if (n.size > 0) {
41
+ let e = [];
42
+ if (i.isSimple) {
43
+ let t = i.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);
47
+ }
48
+ return r < t.length && e.push(t.substring(r)), g(h, null, ...e);
49
+ } else return i.parts.forEach((t) => {
50
+ if (typeof t == "string") {
51
+ let r = t;
52
+ for (let [t] of n) {
53
+ let i = `__VNODE_${t}__`, a = r.indexOf(i);
54
+ a !== -1 && (a > 0 && e.push(r.substring(0, a)), e.push(n.get(t)), r = r.substring(a + i.length));
55
+ }
56
+ r.length > 0 && e.push(r);
57
+ } else e.push(t);
58
+ }), g(h, null, ...e);
59
+ }
60
+ return i.isSimple ? i.parts : g(h, null, i.parts);
61
+ }, b = {
62
+ id: "insertion-plugin",
63
+ canHandle: (e) => typeof e == "object" && e?.nodeType === m.Insertion,
64
+ transform: (e, t, n) => {
65
+ let r = [...t.keyPath, { type: m.Insertion }], i = e[m.Insertion], a = {
66
+ id: "insertion-string-plugin",
67
+ canHandle: (e) => typeof e == "string",
68
+ transform: (e, n, r) => {
69
+ let i = r(e, {
70
+ ...n,
71
+ children: e,
72
+ plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
73
+ });
74
+ return (e) => {
75
+ let a = y(i, e);
76
+ return r(a, {
77
+ ...n,
78
+ plugins: t.plugins,
79
+ children: a
80
+ });
81
+ };
82
+ }
83
+ };
84
+ return n(i, {
85
+ ...t,
86
+ children: i,
87
+ keyPath: r,
88
+ plugins: [a, ...t.plugins ?? []]
89
+ });
90
+ }
91
+ }, x = {
92
+ id: "markdown-string-plugin",
93
+ canHandle: (e) => typeof e == "string",
94
+ transform: (r, i, a) => {
95
+ let { plugins: o, ...s } = i, c = a(f(r), {
96
+ plugins: [{
97
+ id: "markdown-metadata-plugin",
98
+ canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
99
+ transform: (e, t) => n({
100
+ ...t,
101
+ value: e,
102
+ children: r
103
+ })
104
+ }],
105
+ dictionaryKey: s.dictionaryKey,
106
+ keyPath: []
107
+ }), l = (a) => n({
108
+ ...i,
109
+ value: r,
110
+ children: () => g(e, {
111
+ dictionaryKey: s.dictionaryKey,
112
+ keyPath: s.keyPath
113
+ }, { default: () => {
114
+ let { renderMarkdown: e, components: n } = t();
115
+ return e(r, void 0, {
116
+ ...n ?? {},
117
+ ...a ?? {}
118
+ });
119
+ } }),
120
+ additionalProps: { metadata: c }
121
+ }), u = l();
122
+ return new Proxy(u, { get(e, t, n) {
123
+ return t === "value" ? r : t === "metadata" ? c : t === "use" ? (e) => l(e) : Reflect.get(e, t, n);
124
+ } });
125
+ }
126
+ }, S = {
127
+ id: "markdown-plugin",
128
+ canHandle: (e) => typeof e == "object" && e?.nodeType === m.Markdown,
129
+ transform: (e, t, n) => {
130
+ let r = [...t.keyPath, { type: m.Markdown }], i = e[m.Markdown];
131
+ return n(i, {
132
+ ...t,
133
+ children: i,
134
+ keyPath: r,
135
+ plugins: [x, ...t.plugins ?? []]
136
+ });
137
+ }
138
+ }, C = (() => {
139
+ let e = {};
140
+ for (let t of p) e[t] = ({ children: e, ...n }) => g(t, n, e);
141
+ return e;
142
+ })(), w = {
143
+ id: "html-plugin",
144
+ canHandle: (e) => typeof e == "object" && e?.nodeType === m.HTML,
145
+ transform: (e, t) => {
146
+ let r = e[m.HTML];
147
+ e.tags;
148
+ let i = (e) => s(r, {
149
+ ...C,
150
+ ...e
151
+ });
152
+ return n({
153
+ ...t,
154
+ value: r,
155
+ children: (e) => i(e)
156
+ });
157
+ }
158
+ }, T = (e, t = !0) => [
159
+ u(e ?? d.internationalization.defaultLocale, t ? d.internationalization.defaultLocale : void 0),
160
+ i,
161
+ r,
162
+ c(e ?? d.internationalization.defaultLocale),
163
+ a,
164
+ o,
165
+ v,
166
+ b,
167
+ S,
168
+ w
169
+ ];
170
+ //#endregion
171
+ export { T as getPlugins, w as htmlPlugin, b as insertionPlugin, v as intlayerNodePlugins, S as markdownPlugin, x as markdownStringPlugin };
@@ -0,0 +1,60 @@
1
+ import e from "@intlayer/config/built";
2
+ import { inject as t, onMounted as n, onUnmounted as r, readonly as i, ref as a, watchEffect as o } from "vue";
3
+ import { isEnabled as s } from "@intlayer/editor/isEnabled";
4
+ //#region src/editor/useEditor.ts
5
+ var c = (e) => {
6
+ let t = null, n = !1;
7
+ return import("@intlayer/editor").then(({ initEditorClient: r }) => {
8
+ if (n) return;
9
+ let i = r();
10
+ e && (t = o(() => {
11
+ let t = e.value;
12
+ t && i.currentLocale.set(t);
13
+ }));
14
+ }), () => {
15
+ n = !0, t?.(), import("@intlayer/editor").then(({ stopEditorClient: e }) => {
16
+ e();
17
+ });
18
+ };
19
+ }, l = (e) => {
20
+ if (!s) return;
21
+ if (e) {
22
+ let t = null;
23
+ e.mixin({
24
+ inject: { _intlayerClient: {
25
+ from: u,
26
+ default: null
27
+ } },
28
+ mounted() {
29
+ if (this.$parent !== null) return;
30
+ let e = this._intlayerClient;
31
+ t = c(e?.locale);
32
+ },
33
+ unmounted() {
34
+ this.$parent === null && t?.();
35
+ }
36
+ });
37
+ return;
38
+ }
39
+ let i = t(u), a = null;
40
+ n(() => {
41
+ a = c(i?.locale);
42
+ }), r(() => {
43
+ a?.();
44
+ });
45
+ }, u = Symbol("intlayer"), d = null, f = (t, n = !0) => {
46
+ if (d) return d;
47
+ let { defaultLocale: r } = e.internationalization ?? {}, o = a(t ?? r);
48
+ return d = {
49
+ locale: i(o),
50
+ setLocale: (e) => {
51
+ o.value = e;
52
+ },
53
+ isCookieEnabled: n
54
+ }, d;
55
+ }, p = (e, t, n = !0) => {
56
+ let r = f(t, n);
57
+ return e.provide(u, r), l(e), e;
58
+ };
59
+ //#endregion
60
+ export { l as i, f as n, p as r, u as t };
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-C91j1N6u.js`);let t=require(`@intlayer/config/built`);t=e.t(t);let n=require(`vue`),r=require(`@intlayer/editor/isEnabled`);var i=e=>{let t=null,r=!1;return import(`@intlayer/editor`).then(({initEditorClient:i})=>{if(r)return;let a=i();e&&(t=(0,n.watchEffect)(()=>{let t=e.value;t&&a.currentLocale.set(t)}))}),()=>{r=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}},a=e=>{if(!r.isEnabled)return;if(e){let t=null;e.mixin({inject:{_intlayerClient:{from:o,default:null}},mounted(){if(this.$parent!==null)return;let e=this._intlayerClient;t=i(e?.locale)},unmounted(){this.$parent===null&&t?.()}});return}let t=(0,n.inject)(o),a=null;(0,n.onMounted)(()=>{a=i(t?.locale)}),(0,n.onUnmounted)(()=>{a?.()})},o=Symbol(`intlayer`),s=null,c=(e,r=!0)=>{if(s)return s;let{defaultLocale:i}=t.default.internationalization??{},a=(0,n.ref)(e??i);return s={locale:(0,n.readonly)(a),setLocale:e=>{a.value=e},isCookieEnabled:r},s},l=(e,t,n=!0)=>{let r=c(t,n);return e.provide(o,r),a(e),e};Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
@@ -1,5 +1,5 @@
1
- import { LocalesValues } from '@intlayer/types/module_augmentation';
2
1
  import { Locale } from '@intlayer/types/allLocales';
2
+ import { LocalesValues } from '@intlayer/types/module_augmentation';
3
3
  import { App, Ref } from 'vue';
4
4
  export declare const INTLAYER_SYMBOL: unique symbol;
5
5
  export type IntlayerProvider = {
@@ -1,5 +1,5 @@
1
- import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
2
1
  import { Dictionary } from '@intlayer/types/dictionary';
2
+ import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
3
3
  import { ComputedRef, MaybeRefOrGetter } from 'vue';
4
4
  import { DeepTransformContent } from '../plugins';
5
5
  export declare const atPath: (obj: any, path: (string | number)[]) => any;
@@ -1 +1,11 @@
1
- export declare const useEditor: () => void;
1
+ import { App } from 'vue';
2
+ /**
3
+ * Initialises the Intlayer editor client singleton when the editor is enabled.
4
+ * Syncs the current locale from the Intlayer context into the editor manager so
5
+ * the editor always knows which locale the app is displaying.
6
+ *
7
+ * @param app - When provided, hooks into the root component lifecycle via
8
+ * `app.mixin` (use from `installIntlayer`). When omitted, uses Vue composable
9
+ * lifecycle hooks (use from a component's `setup`).
10
+ */
11
+ export declare const useEditor: (app?: App) => void;