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 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../installIntlayerEditor-BpsBr4EN.js`),t=require(`./editorEnabled.cjs`),n=require(`./focusDictionary.cjs`),r=require(`../../ContentSelectorWrapper-DpyRYcE8.js`),i=require(`./configuration.cjs`),a=require(`./dictionariesRecord.cjs`),o=require(`./editedContent.cjs`),s=require(`../../getDictionary-yKxg53ez.js`),c=require(`./useCrossFrameMessageListener.cjs`),l=require(`./useCrossFrameState.cjs`),u=require(`./useIframeClickInterceptor.cjs`);exports.ContentSelectorWrapper=r.t,exports.INTLAYER_EDITOR_MANAGER_SYMBOL=e.t,exports.getEditorStateManager=e.n,exports.installIntlayerEditor=e.r,exports.useConfiguration=i.useConfiguration,exports.useCrossFrameMessageListener=c.useCrossFrameMessageListener,exports.useCrossFrameState=l.useCrossFrameState,exports.useDictionariesRecord=a.useDictionariesRecord,exports.useEditedContent=o.useEditedContent,exports.useEditor=s.c,exports.useEditorEnabled=t.useEditorEnabled,exports.useEditorLocale=s.l,exports.useFocusDictionary=n.useFocusDictionary,exports.useIframeClickInterceptor=u.useIframeClickInterceptor,exports.useIframeClickMerger=u.useIframeClickMerger;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../installIntlayerEditor-BpsBr4EN.js`);exports.INTLAYER_EDITOR_MANAGER_SYMBOL=e.t,exports.getEditorStateManager=e.n,exports.installIntlayerEditor=e.r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../installIntlayerEditor-BpsBr4EN.js`);let t=require(`vue`);var n=(n,r)=>{let i=(0,t.inject)(e.t)??e.n();return r&&i&&(0,t.onScopeDispose)(i.messenger.subscribe(n,r)),e=>i?.messenger.send(n,e)};exports.useCrossFrameMessageListener=n;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../installIntlayerEditor-BpsBr4EN.js`);let t=require(`vue`),n=require(`@intlayer/editor`);var r=(r,i,a={emit:!0,receive:!0})=>{let o=(0,t.inject)(e.t)??e.n(),{emit:s=!0,receive:c=!0}=a,l=(0,t.ref)(i);if(o){let e=new n.CrossFrameStateManager(r,o.messenger,{emit:s,receive:c,initialValue:i});e.start();let a=e=>{l.value=e.detail};return e.addEventListener(`change`,a),(0,t.onScopeDispose)(()=>{e.removeEventListener(`change`,a),e.stop()}),[l,t=>{e.set(t)},()=>e.postCurrentValue()]}return[l,e=>{l.value=e},()=>{}]};exports.useCrossFrameState=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../installIntlayerEditor-BpsBr4EN.js`);let t=require(`vue`);var n=()=>{(0,t.inject)(e.t)??e.n()};exports.useCrossURLPathSetter=n;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayerEditor-BpsBr4EN.js`);const e=require(`./createSharedComposable.cjs`);let t=require(`vue`);var n=e.createSharedComposable((e,n,r)=>{let i=(0,t.inject)(`editedContentActions`,null);return(0,t.computed)(()=>i?.getEditedContentValue(e,n)??r)});exports.useEditedContentRenderer=n;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../installIntlayerEditor-BpsBr4EN.js`);const e=require(`./useCrossFrameMessageListener.cjs`);let t=require(`@intlayer/editor`);var n=()=>{e.useCrossFrameMessageListener(t.MessageKey.INTLAYER_IFRAME_CLICKED)},r=()=>{e.useCrossFrameMessageListener(t.MessageKey.INTLAYER_IFRAME_CLICKED,t.mergeIframeClick)};exports.useIframeClickInterceptor=n,exports.useIframeClickMerger=r;
@@ -1,2 +0,0 @@
1
- import { t as e } from "../../ContentSelectorWrapper-B7p44V28.mjs";
2
- export { e as default };
@@ -1,2 +0,0 @@
1
- import { t as e } from "../../EditedContentRenderer-DNBqpZpl.mjs";
2
- export { e as default };
@@ -1,44 +0,0 @@
1
- import { t as e } from "../../ContentSelectorWrapper-B7p44V28.mjs";
2
- import { t } from "../../EditedContentRenderer-DNBqpZpl.mjs";
3
- import { createBlock as n, createVNode as r, defineComponent as i, openBlock as a, renderSlot as o, unref as s, withCtx as c } from "vue";
4
- //#endregion
5
- //#region src/editor/EditorSelectorRenderer.vue
6
- var l = /* @__PURE__ */ i({
7
- __name: "EditorSelectorRenderer",
8
- props: {
9
- dictionaryKey: {},
10
- keyPath: {},
11
- plugins: {},
12
- locale: {},
13
- dictionaryPath: {},
14
- children: {}
15
- },
16
- setup(i) {
17
- let { keyPath: l, children: u, dictionaryKey: d } = i;
18
- return (i, f) => (a(), n(e, {
19
- dictionaryKey: s(d),
20
- keyPath: s(l),
21
- children: s(u)
22
- }, {
23
- default: c(() => [r(t, {
24
- dictionaryKey: s(d),
25
- keyPath: s(l),
26
- children: s(u)
27
- }, {
28
- default: c(() => [o(i.$slots, "default")]),
29
- _: 3
30
- }, 8, [
31
- "dictionaryKey",
32
- "keyPath",
33
- "children"
34
- ])]),
35
- _: 3
36
- }, 8, [
37
- "dictionaryKey",
38
- "keyPath",
39
- "children"
40
- ]));
41
- }
42
- });
43
- //#endregion
44
- export { l as default };
@@ -1,12 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n } from "vue";
3
- //#region src/editor/communicator.ts
4
- var r = () => {
5
- let r = n(e) ?? t();
6
- return r ? {
7
- postMessage: (e) => r.messenger.send(e.type, e.data),
8
- senderId: r.messenger.senderId
9
- } : null;
10
- };
11
- //#endregion
12
- export { r as useCommunicator };
@@ -1,15 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n, onBeforeUnmount as r, onMounted as i, ref as a } from "vue";
3
- //#region src/editor/configuration.ts
4
- var o = () => {
5
- let o = n(e) ?? t(), s = a(o?.configuration.value), c = (e) => {
6
- s.value = e.detail;
7
- };
8
- return i(() => {
9
- o?.configuration.addEventListener("change", c);
10
- }), r(() => {
11
- o?.configuration.removeEventListener("change", c);
12
- }), s;
13
- };
14
- //#endregion
15
- export { o as useConfiguration };
@@ -1,10 +0,0 @@
1
- import { effectScope as e, getCurrentScope as t, onScopeDispose as n } from "vue";
2
- //#region src/editor/createSharedComposable.ts
3
- var r = (e) => t() ? (n(e), !0) : !1, i = (t) => {
4
- let n = 0, i, a, o = () => {
5
- --n, a && n <= 0 && (a.stop(), i = void 0, a = void 0);
6
- };
7
- return ((...s) => (n += 1, a || (a = e(!0), i = a.run(() => t(...s))), r(o), i));
8
- };
9
- //#endregion
10
- export { i as createSharedComposable, r as tryOnScopeDispose };
@@ -1,19 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n, onBeforeUnmount as r, onMounted as i, readonly as a, ref as o } from "vue";
3
- //#region src/editor/dictionariesRecord.ts
4
- var s = () => {
5
- let s = n(e) ?? t(), c = o(s?.localeDictionaries.value ?? {}), l = (e) => {
6
- c.value = e.detail ?? {};
7
- };
8
- return i(() => {
9
- s?.localeDictionaries.addEventListener("change", l);
10
- }), r(() => {
11
- s?.localeDictionaries.removeEventListener("change", l);
12
- }), {
13
- localeDictionaries: a(c),
14
- setLocaleDictionaries: (e) => s?.localeDictionaries.set(e),
15
- setLocaleDictionary: (e) => s?.setLocaleDictionary(e)
16
- };
17
- };
18
- //#endregion
19
- export { s as useDictionariesRecord };
@@ -1,26 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n, onBeforeUnmount as r, onMounted as i, readonly as a, ref as o } from "vue";
3
- //#region src/editor/editedContent.ts
4
- var s = () => {
5
- let s = n(e) ?? t(), c = o(s?.editedContent.value ?? {}), l = (e) => {
6
- c.value = e.detail ?? {};
7
- };
8
- return i(() => {
9
- s?.editedContent.addEventListener("change", l);
10
- }), r(() => {
11
- s?.editedContent.removeEventListener("change", l);
12
- }), {
13
- editedContent: a(c),
14
- setEditedContent: (e, t) => s?.setEditedContent(e, t),
15
- setEditedDictionary: (e) => s?.setEditedDictionary(e),
16
- addEditedContent: (e, t, n, r) => s?.addContent(e, t, n, r),
17
- renameEditedContent: (e, t, n) => s?.renameContent(e, t, n),
18
- removeEditedContent: (e, t) => s?.removeContent(e, t),
19
- restoreEditedContent: (e) => s?.restoreContent(e),
20
- clearEditedDictionaryContent: (e) => s?.clearContent(e),
21
- clearEditedContent: () => s?.clearAllContent(),
22
- getEditedContentValue: (e, t) => s?.getContentValue(e, t)
23
- };
24
- };
25
- //#endregion
26
- export { s as useEditedContent };
@@ -1,15 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n, onBeforeUnmount as r, onMounted as i, ref as a } from "vue";
3
- //#region src/editor/editorEnabled.ts
4
- var o = () => {
5
- let o = n(e) ?? t(), s = a(o?.editorEnabled.value ?? !1), c = (e) => {
6
- s.value = e.detail;
7
- };
8
- return i(() => {
9
- o?.editorEnabled.addEventListener("change", c);
10
- }), r(() => {
11
- o?.editorEnabled.removeEventListener("change", c);
12
- }), { enabled: s };
13
- };
14
- //#endregion
15
- export { o as useEditorEnabled };
@@ -1,2 +0,0 @@
1
- import { l as e } from "../../getDictionary-5DAguynf.mjs";
2
- export { e as useEditorLocale };
@@ -1,19 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n, onBeforeUnmount as r, onMounted as i, readonly as a, ref as o } from "vue";
3
- //#region src/editor/focusDictionary.ts
4
- var s = () => {
5
- let s = n(e) ?? t(), c = o(s?.focusedContent.value ?? null), l = (e) => {
6
- c.value = e.detail;
7
- };
8
- return i(() => {
9
- s?.focusedContent.addEventListener("change", l);
10
- }), r(() => {
11
- s?.focusedContent.removeEventListener("change", l);
12
- }), {
13
- focusedContent: a(c),
14
- setFocusedContent: (e) => s?.focusedContent.set(e),
15
- setFocusedContentKeyPath: (e) => s?.setFocusedContentKeyPath(e)
16
- };
17
- };
18
- //#endregion
19
- export { s as useFocusDictionary };
@@ -1,12 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t, installIntlayerEditor as n } from "./installIntlayerEditor.mjs";
2
- import { useEditorEnabled as r } from "./editorEnabled.mjs";
3
- import { useFocusDictionary as i } from "./focusDictionary.mjs";
4
- import { t as a } from "../../ContentSelectorWrapper-B7p44V28.mjs";
5
- import { useConfiguration as o } from "./configuration.mjs";
6
- import { useDictionariesRecord as s } from "./dictionariesRecord.mjs";
7
- import { useEditedContent as c } from "./editedContent.mjs";
8
- import { c as l, l as u } from "../../getDictionary-5DAguynf.mjs";
9
- import { useCrossFrameMessageListener as d } from "./useCrossFrameMessageListener.mjs";
10
- import { useCrossFrameState as f } from "./useCrossFrameState.mjs";
11
- import { useIframeClickInterceptor as p, useIframeClickMerger as m } from "./useIframeClickInterceptor.mjs";
12
- export { a as ContentSelectorWrapper, e as INTLAYER_EDITOR_MANAGER_SYMBOL, t as getEditorStateManager, n as installIntlayerEditor, o as useConfiguration, d as useCrossFrameMessageListener, f as useCrossFrameState, s as useDictionariesRecord, c as useEditedContent, l as useEditor, r as useEditorEnabled, u as useEditorLocale, i as useFocusDictionary, p as useIframeClickInterceptor, m as useIframeClickMerger };
@@ -1,22 +0,0 @@
1
- import e from "@intlayer/config/built";
2
- import { EditorStateManager as t, defineIntlayerElements as n } from "@intlayer/editor";
3
- //#region src/editor/installIntlayerEditor.ts
4
- var { editor: r } = e ?? {}, i = () => ({
5
- allowedOrigins: [
6
- r?.applicationURL,
7
- r?.editorURL,
8
- r?.cmsURL
9
- ].filter(Boolean),
10
- postMessageFn: (e, t) => {
11
- typeof window > "u" || window.self !== window.top && (window.parent?.postMessage(e, t), window.postMessage(e, t));
12
- }
13
- }), a = Symbol("INTLAYER_EDITOR_STATE_MANAGER"), o = null, s = (r) => {
14
- let s = new t({
15
- mode: "client",
16
- messenger: i(),
17
- configuration: e
18
- });
19
- r.provide(a, s), o = s, n(), s.start();
20
- }, c = () => o;
21
- //#endregion
22
- export { a as INTLAYER_EDITOR_MANAGER_SYMBOL, c as getEditorStateManager, s as installIntlayerEditor };
@@ -1,9 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n, onScopeDispose as r } from "vue";
3
- //#region src/editor/useCrossFrameMessageListener.ts
4
- var i = (i, a) => {
5
- let o = n(e) ?? t();
6
- return a && o && r(o.messenger.subscribe(i, a)), (e) => o?.messenger.send(i, e);
7
- };
8
- //#endregion
9
- export { i as useCrossFrameMessageListener };
@@ -1,39 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n, onScopeDispose as r, ref as i } from "vue";
3
- import { CrossFrameStateManager as a } from "@intlayer/editor";
4
- //#region src/editor/useCrossFrameState.ts
5
- var o = (o, s, c = {
6
- emit: !0,
7
- receive: !0
8
- }) => {
9
- let l = n(e) ?? t(), { emit: u = !0, receive: d = !0 } = c, f = i(s);
10
- if (l) {
11
- let e = new a(o, l.messenger, {
12
- emit: u,
13
- receive: d,
14
- initialValue: s
15
- });
16
- e.start();
17
- let t = (e) => {
18
- f.value = e.detail;
19
- };
20
- return e.addEventListener("change", t), r(() => {
21
- e.removeEventListener("change", t), e.stop();
22
- }), [
23
- f,
24
- (t) => {
25
- e.set(t);
26
- },
27
- () => e.postCurrentValue()
28
- ];
29
- }
30
- return [
31
- f,
32
- (e) => {
33
- f.value = e;
34
- },
35
- () => {}
36
- ];
37
- };
38
- //#endregion
39
- export { o as useCrossFrameState };
@@ -1,8 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
2
- import { inject as n } from "vue";
3
- //#region src/editor/useCrossURLPathState.ts
4
- var r = () => {
5
- n(e) ?? t();
6
- };
7
- //#endregion
8
- export { r as useCrossURLPathSetter };
@@ -1,9 +0,0 @@
1
- import { createSharedComposable as e } from "./createSharedComposable.mjs";
2
- import { computed as t, inject as n } from "vue";
3
- //#region src/editor/useEditedContentRenderer.ts
4
- var r = e((e, r, i) => {
5
- let a = n("editedContentActions", null);
6
- return t(() => a?.getEditedContentValue(e, r) ?? i);
7
- });
8
- //#endregion
9
- export { r as useEditedContentRenderer };
@@ -1,10 +0,0 @@
1
- import { useCrossFrameMessageListener as e } from "./useCrossFrameMessageListener.mjs";
2
- import { MessageKey as t, mergeIframeClick as n } from "@intlayer/editor";
3
- //#region src/editor/useIframeClickInterceptor.ts
4
- var r = () => {
5
- e(t.INTLAYER_IFRAME_CLICKED);
6
- }, i = () => {
7
- e(t.INTLAYER_IFRAME_CLICKED, n);
8
- };
9
- //#endregion
10
- export { r as useIframeClickInterceptor, i as useIframeClickMerger };
@@ -1,332 +0,0 @@
1
- import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t, installIntlayerEditor as n } from "./esm/editor/installIntlayerEditor.mjs";
2
- import { useEditorEnabled as r } from "./esm/editor/editorEnabled.mjs";
3
- import { useFocusDictionary as i } from "./esm/editor/focusDictionary.mjs";
4
- import { t as a } from "./ContentSelectorWrapper-B7p44V28.mjs";
5
- import { useDictionariesRecord as o } from "./esm/editor/dictionariesRecord.mjs";
6
- import { setLocaleInStorage as s } from "./esm/client/useLocaleStorage.mjs";
7
- import { useIframeClickMerger as c } from "./esm/editor/useIframeClickInterceptor.mjs";
8
- import { useMarkdown as l } from "./esm/markdown/installIntlayerMarkdown.mjs";
9
- import { renderIntlayerNode as u } from "./esm/renderIntlayerNode.mjs";
10
- import { conditionPlugin as d, enumerationPlugin as f, filePlugin as ee, genderPlugin as p, getDictionary as te, getHTML as m, getIntlayer as ne, nestedPlugin as re, splitInsertionTemplate as ie, translationPlugin as h } from "@intlayer/core/interpreter";
11
- import g from "@intlayer/config/built";
12
- import { getMarkdownMetadata as ae } from "@intlayer/core/markdown";
13
- import { HTML_TAGS as oe } from "@intlayer/core/transpiler";
14
- import { NodeType as _ } from "@intlayer/types/nodeType";
15
- import { Fragment as v, computed as y, defineComponent as b, h as x, inject as S, isRef as C, markRaw as w, readonly as T, ref as E, shallowRef as D, toValue as O, watch as k } from "vue";
16
- import { getRewritePath as A } from "@intlayer/core/localization";
17
- //#region src/client/installIntlayer.ts
18
- var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
19
- if (M) return M;
20
- let { defaultLocale: n } = g.internationalization ?? {}, r = E(e ?? n);
21
- return M = {
22
- locale: T(r),
23
- setLocale: (e) => {
24
- r.value = e;
25
- },
26
- isCookieEnabled: t
27
- }, M;
28
- }, se = (e, t, r = !0) => {
29
- let i = N(t, r);
30
- return e.provide(j, i), n(e, i), e;
31
- }, P = (e, t) => t.reduce((e, t) => e?.[t], e), F = (e) => typeof e == "object" && !!e, I = (e) => typeof e == "function" || F(e) && ("render" in e || "setup" in e), L = (e) => typeof e == "object" && !!e && "__update" in e && "render" in e && "raw" in e, R = (e) => w(b({
32
- name: "IntlayerLeaf",
33
- setup() {
34
- return () => {
35
- let t = e();
36
- return t == null ? null : I(t) ? x(t) : Array.isArray(t) ? x("span", t) : t;
37
- };
38
- }
39
- })), z = (e) => new Proxy({}, {
40
- get(t, n) {
41
- let r = e.value;
42
- if (n === "__v_isRef") return !0;
43
- if (n === "value") return r ?? "";
44
- if (n === "$raw") return e;
45
- if (n === "__v_skip") return !0;
46
- if (n === "c" || n === "asComponent") return R(() => e.value);
47
- if (r == null) return n === Symbol.toPrimitive || n === "toString" ? () => "" : void 0;
48
- let i = r[n];
49
- return typeof i == "function" ? i.bind(r) : i;
50
- },
51
- ownKeys() {
52
- let t = e.value;
53
- return typeof t == "object" && t ? Reflect.ownKeys(t) : [];
54
- },
55
- getOwnPropertyDescriptor() {
56
- return {
57
- enumerable: !0,
58
- configurable: !0
59
- };
60
- }
61
- }), B = (e, t) => {
62
- let n = S(j), r = C(n?.locale) ? n.locale : E(n?.locale ?? g.internationalization.defaultLocale), i = y(() => (t === void 0 ? void 0 : O(t)) ?? r.value), a = D({});
63
- k([() => O(e), () => i.value], ([e, t]) => {
64
- a.value = $(e, t);
65
- }, {
66
- immediate: !0,
67
- flush: "sync"
68
- });
69
- let o = (e) => new Proxy({}, {
70
- get(t, n, r) {
71
- if (n === "__v_isRef") return !0;
72
- let i = y(() => P(a.value, e));
73
- if (n === "value") return i.value ?? "";
74
- if (n === "then") return;
75
- if (n === "c" || n === "asComponent") return R(() => i.value);
76
- if (n === "$raw") return i;
77
- if (n === Symbol.toPrimitive) return () => i.value;
78
- let s = e.concat(n), c = P(a.value, s);
79
- if (c === void 0 || F(c) && !I(c)) return o(s);
80
- if (L(c)) return z(y(() => P(a.value, s)));
81
- let l = y(() => P(a.value, s));
82
- return new Proxy(l, { get(e, t, n) {
83
- return t === "value" ? e.value ?? "" : Reflect.get(e, t, n);
84
- } });
85
- },
86
- ownKeys() {
87
- let t = P(a.value, e);
88
- return F(t) ? Reflect.ownKeys(t) : [];
89
- },
90
- getOwnPropertyDescriptor() {
91
- return {
92
- enumerable: !0,
93
- configurable: !0
94
- };
95
- }
96
- });
97
- return o([]);
98
- }, V = async (e, t) => {
99
- let n = S(j), r = y(() => t ?? n?.locale?.value ?? g?.internationalization.defaultLocale), i = E(await e[r.value]?.());
100
- return k(() => r.value, async (t) => {
101
- let n = await e[t]?.();
102
- n && (i.value = n);
103
- }), B(i, r);
104
- }, H = async (e, t, n) => await V(e, n), U = (e, t) => ne(e, t, Q(t)), W = (e, t) => {
105
- let n = S(j), r = C(n?.locale) ? n.locale : E(n?.locale ?? g.internationalization.defaultLocale), i = y(() => (t === void 0 ? void 0 : O(t)) ?? r.value), a = D({});
106
- k([() => O(e), () => i.value], ([e, t]) => {
107
- a.value = U(e, t);
108
- }, {
109
- immediate: !0,
110
- flush: "sync"
111
- });
112
- let o = /* @__PURE__ */ new Map(), s = (e) => {
113
- let t = e.join(".");
114
- if (o.has(t)) return o.get(t);
115
- let n = y(() => P(a.value, e)), r = new Proxy({}, {
116
- get(t, r, i) {
117
- if (typeof r == "symbol" || typeof r == "string" && (r.startsWith("__") || r.startsWith("$"))) return r === "__v_isRef" ? !0 : r === "then" ? void 0 : Reflect.get(t, r, i);
118
- if (r === "value") return n.value ?? "";
119
- if (r === "c" || r === "asComponent") return R(() => n.value);
120
- if (r === "$raw") return n;
121
- if (r === Symbol.toPrimitive) return () => String(n.value ?? "");
122
- let o = e.concat(r), c = P(a.value, o);
123
- if (c === void 0 || F(c) && !I(c)) return s(o);
124
- if (L(c)) return z(y(() => P(a.value, o)));
125
- let l = y(() => P(a.value, o));
126
- return new Proxy(l, { get(e, t, n) {
127
- return t === "value" ? e.value ?? "" : t === "__v_isRef" ? !0 : Reflect.get(e, t, n);
128
- } });
129
- },
130
- ownKeys() {
131
- let t = P(a.value, e);
132
- return F(t) ? Reflect.ownKeys(t) : [];
133
- },
134
- getOwnPropertyDescriptor() {
135
- return {
136
- enumerable: !0,
137
- configurable: !0
138
- };
139
- }
140
- });
141
- return o.set(t, r), r;
142
- };
143
- return s([]);
144
- }, G = ({ isCookieEnabled: e, onLocaleChange: t } = {}) => {
145
- let { defaultLocale: n, locales: r } = g?.internationalization ?? {}, i = S(j);
146
- return {
147
- locale: y(() => i?.locale?.value ?? n),
148
- defaultLocale: n,
149
- availableLocales: r,
150
- setLocale: (n) => {
151
- if (!r?.map(String).includes(n)) {
152
- console.error(`Locale ${n} is not available`);
153
- return;
154
- }
155
- i && i.setLocale(n), s(n, e ?? i?.isCookieEnabled ?? !0), t?.(n);
156
- }
157
- };
158
- }, ce = () => {
159
- let { locale: e } = G(), t = g?.routing?.rewrite;
160
- k(e, (e) => {
161
- if (typeof window > "u" || !t) return;
162
- let n = window.location.pathname, r = A(n, e, t);
163
- r && r !== n && window.history.replaceState(window.history.state, "", r + window.location.search + window.location.hash);
164
- }, { immediate: !0 });
165
- }, K = () => {
166
- let n = S(e) ?? t(), r = S(j);
167
- return r && k(r.locale, (e) => {
168
- n?.currentLocale.set(e);
169
- }, { immediate: !0 }), r;
170
- }, le = () => {
171
- r(), i(), c(), K(), o();
172
- }, q = {
173
- id: "intlayer-node-plugin",
174
- canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
175
- transform: (e, { children: t, ...n }) => {
176
- let r = (e) => u({
177
- ...n,
178
- value: e,
179
- children: g?.editor.enabled ? () => x(a, {
180
- dictionaryKey: n.dictionaryKey,
181
- keyPath: n.keyPath
182
- }, { default: () => typeof e == "function" ? e() : e }) : e
183
- }), i = r(t);
184
- if (typeof t != "function") return i;
185
- let o = (...e) => r(t(...e));
186
- Object.setPrototypeOf(o, Object.getPrototypeOf(i));
187
- for (let e of Object.getOwnPropertyNames(i)) {
188
- let t = Object.getOwnPropertyDescriptor(i, e);
189
- t && Object.defineProperty(o, e, t);
190
- }
191
- for (let e of Object.getOwnPropertySymbols(i)) {
192
- let t = Object.getOwnPropertyDescriptor(i, e);
193
- t && Object.defineProperty(o, e, t);
194
- }
195
- return w(o);
196
- }
197
- }, ue = (e, t) => {
198
- let n = /* @__PURE__ */ new Map(), r = {};
199
- 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}__`);
200
- let i = ie(e, r);
201
- if (n.size > 0) {
202
- let e = [];
203
- if (i.isSimple) {
204
- let t = i.parts, r = 0;
205
- for (let [i] of n) {
206
- let a = `__VNODE_${i}__`, o = t.indexOf(a);
207
- o !== -1 && (o > r && e.push(t.substring(r, o)), e.push(n.get(i)), r = o + a.length);
208
- }
209
- return r < t.length && e.push(t.substring(r)), x(v, null, ...e);
210
- } else return i.parts.forEach((t) => {
211
- if (typeof t == "string") {
212
- let r = t;
213
- for (let [t] of n) {
214
- let i = `__VNODE_${t}__`, a = r.indexOf(i);
215
- a !== -1 && (a > 0 && e.push(r.substring(0, a)), e.push(n.get(t)), r = r.substring(a + i.length));
216
- }
217
- r.length > 0 && e.push(r);
218
- } else e.push(t);
219
- }), x(v, null, ...e);
220
- }
221
- return i.isSimple ? i.parts : x(v, null, i.parts);
222
- }, J = {
223
- id: "insertion-plugin",
224
- canHandle: (e) => typeof e == "object" && e?.nodeType === _.Insertion,
225
- transform: (e, t, n) => {
226
- let r = [...t.keyPath, { type: _.Insertion }], i = e[_.Insertion], a = {
227
- id: "insertion-string-plugin",
228
- canHandle: (e) => typeof e == "string",
229
- transform: (e, n, r) => {
230
- let i = r(e, {
231
- ...n,
232
- children: e,
233
- plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
234
- });
235
- return (e) => {
236
- let a = ue(i, e);
237
- return r(a, {
238
- ...n,
239
- plugins: t.plugins,
240
- children: a
241
- });
242
- };
243
- }
244
- };
245
- return n(i, {
246
- ...t,
247
- children: i,
248
- keyPath: r,
249
- plugins: [a, ...t.plugins ?? []]
250
- });
251
- }
252
- }, Y = {
253
- id: "markdown-string-plugin",
254
- canHandle: (e) => typeof e == "string",
255
- transform: (e, t, n) => {
256
- let { plugins: r, ...i } = t, o = n(ae(e), {
257
- plugins: [{
258
- id: "markdown-metadata-plugin",
259
- canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
260
- transform: (t, n) => u({
261
- ...n,
262
- value: t,
263
- children: e
264
- })
265
- }],
266
- dictionaryKey: i.dictionaryKey,
267
- keyPath: []
268
- }), s = (n) => u({
269
- ...t,
270
- value: e,
271
- children: () => x(a, {
272
- dictionaryKey: i.dictionaryKey,
273
- keyPath: i.keyPath
274
- }, { default: () => {
275
- let { renderMarkdown: t, components: r } = l();
276
- return t(e, void 0, {
277
- ...r ?? {},
278
- ...n ?? {}
279
- });
280
- } }),
281
- additionalProps: { metadata: o }
282
- }), c = s();
283
- return new Proxy(c, { get(t, n, r) {
284
- return n === "value" ? e : n === "metadata" ? o : n === "use" ? (e) => s(e) : Reflect.get(t, n, r);
285
- } });
286
- }
287
- }, X = {
288
- id: "markdown-plugin",
289
- canHandle: (e) => typeof e == "object" && e?.nodeType === _.Markdown,
290
- transform: (e, t, n) => {
291
- let r = [...t.keyPath, { type: _.Markdown }], i = e[_.Markdown];
292
- return n(i, {
293
- ...t,
294
- children: i,
295
- keyPath: r,
296
- plugins: [Y, ...t.plugins ?? []]
297
- });
298
- }
299
- }, de = (() => {
300
- let e = {};
301
- for (let t of oe) e[t] = ({ children: e, ...n }) => x(t, n, e);
302
- return e;
303
- })(), Z = {
304
- id: "html-plugin",
305
- canHandle: (e) => typeof e == "object" && e?.nodeType === _.HTML,
306
- transform: (e, t) => {
307
- let n = e[_.HTML];
308
- e.tags;
309
- let r = (e) => m(n, {
310
- ...de,
311
- ...e
312
- });
313
- return u({
314
- ...t,
315
- value: n,
316
- children: (e) => r(e)
317
- });
318
- }
319
- }, Q = (e, t = !0) => [
320
- h(e ?? g.internationalization.defaultLocale, t ? g.internationalization.defaultLocale : void 0),
321
- f,
322
- d,
323
- re(e ?? g.internationalization.defaultLocale),
324
- ee,
325
- p,
326
- q,
327
- J,
328
- X,
329
- Z
330
- ], $ = (e, t) => te(e, t, Q(t));
331
- //#endregion
332
- export { j as C, B as S, se as T, z as _, q as a, F as b, le as c, G as d, W as f, P as g, V as h, J as i, K as l, H as m, Q as n, X as o, U as p, Z as r, Y as s, $ as t, ce as u, I as v, N as w, R as x, L as y };