vue-intlayer 8.3.0 → 8.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ContentSelector-BaMG67_z.js +1 -0
- package/dist/ContentSelector-D9fc9D1G.mjs +76 -0
- package/dist/EditedContentRenderer-CXoF8k9R.mjs +25 -0
- package/dist/EditedContentRenderer-S0zWbUak.js +1 -0
- package/dist/cjs/UI/ContentSelector.cjs +1 -1
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/installIntlayer.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLoadDynamic.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/EditedContentRenderer.cjs +1 -1
- package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
- package/dist/cjs/editor/communicator.cjs +1 -1
- package/dist/cjs/editor/configuration.cjs +1 -1
- package/dist/cjs/editor/createSharedComposable.cjs +1 -1
- package/dist/cjs/editor/dictionariesRecord.cjs +1 -1
- package/dist/cjs/editor/editedContent.cjs +1 -1
- package/dist/cjs/editor/editorEnabled.cjs +1 -1
- package/dist/cjs/editor/editorLocale.cjs +1 -1
- package/dist/cjs/editor/focusDictionary.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/installIntlayerEditor.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameState.cjs +1 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/editor/useIframeClickInterceptor.cjs +1 -1
- package/dist/cjs/format/index.cjs +1 -1
- package/dist/cjs/format/useCompact.cjs +1 -1
- package/dist/cjs/format/useCurrency.cjs +1 -1
- package/dist/cjs/format/useDate.cjs +1 -1
- package/dist/cjs/format/useIntl.cjs +1 -1
- package/dist/cjs/format/useList.cjs +1 -1
- package/dist/cjs/format/useNumber.cjs +1 -1
- package/dist/cjs/format/usePercentage.cjs +1 -1
- package/dist/cjs/format/useRelativeTime.cjs +1 -1
- package/dist/cjs/format/useUnit.cjs +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/html/index.cjs +1 -1
- package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
- package/dist/cjs/html/types.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/markdown/index.cjs +1 -1
- package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +1 -1
- package/dist/communicator-1rnoOTtT.js +1 -0
- package/dist/esm/UI/ContentSelector.mjs +2 -4
- package/dist/esm/client/index.mjs +3 -26
- package/dist/esm/client/installIntlayer.mjs +2 -16
- package/dist/esm/client/useDictionary.mjs +2 -100
- package/dist/esm/client/useDictionaryAsync.mjs +2 -21
- package/dist/esm/client/useDictionaryDynamic.mjs +2 -5
- package/dist/esm/client/useIntlayer.mjs +2 -59
- package/dist/esm/client/useLoadDynamic.mjs +14 -16
- package/dist/esm/client/useLocale.mjs +2 -34
- package/dist/esm/client/useLocaleStorage.mjs +24 -29
- package/dist/esm/client/useRewriteURL.mjs +2 -23
- package/dist/esm/editor/ContentSelectorWrapper.mjs +2 -4
- package/dist/esm/editor/EditedContentRenderer.mjs +2 -4
- package/dist/esm/editor/EditorSelectorRenderer.mjs +43 -38
- package/dist/esm/editor/communicator.mjs +26 -32
- package/dist/esm/editor/configuration.mjs +10 -10
- package/dist/esm/editor/createSharedComposable.mjs +9 -11
- package/dist/esm/editor/dictionariesRecord.mjs +35 -52
- package/dist/esm/editor/editedContent.mjs +41 -63
- package/dist/esm/editor/editorEnabled.mjs +37 -55
- package/dist/esm/editor/editorLocale.mjs +2 -12
- package/dist/esm/editor/focusDictionary.mjs +33 -38
- package/dist/esm/editor/index.mjs +3 -7
- package/dist/esm/editor/installIntlayerEditor.mjs +20 -16
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +28 -28
- package/dist/esm/editor/useCrossFrameState.mjs +51 -43
- package/dist/esm/editor/useCrossURLPathState.mjs +20 -25
- package/dist/esm/editor/useEditedContentRenderer.mjs +9 -17
- package/dist/esm/editor/useEditor.mjs +2 -11
- package/dist/esm/editor/useIframeClickInterceptor.mjs +14 -22
- package/dist/esm/format/index.mjs +10 -20
- package/dist/esm/format/useCompact.mjs +15 -15
- package/dist/esm/format/useCurrency.mjs +15 -15
- package/dist/esm/format/useDate.mjs +15 -15
- package/dist/esm/format/useIntl.mjs +9 -12
- package/dist/esm/format/useList.mjs +15 -15
- package/dist/esm/format/useNumber.mjs +15 -15
- package/dist/esm/format/usePercentage.mjs +14 -14
- package/dist/esm/format/useRelativeTime.mjs +15 -15
- package/dist/esm/format/useUnit.mjs +15 -15
- package/dist/esm/getDictionary.mjs +2 -15
- package/dist/esm/getIntlayer.mjs +2 -15
- package/dist/esm/html/HTMLRenderer.mjs +25 -31
- package/dist/esm/html/index.mjs +3 -11
- package/dist/esm/html/installIntlayerHTML.mjs +23 -33
- package/dist/esm/html/types.mjs +0 -1
- package/dist/esm/index.mjs +12 -69
- package/dist/esm/markdown/MarkdownRenderer.mjs +105 -131
- package/dist/esm/markdown/compiler.mjs +6 -12
- package/dist/esm/markdown/index.mjs +5 -22
- package/dist/esm/markdown/installIntlayerMarkdown.mjs +47 -80
- package/dist/esm/markdown/runtime.mjs +19 -54
- package/dist/esm/plugins.mjs +2 -21
- package/dist/esm/renderIntlayerNode.mjs +33 -47
- package/dist/getDictionary-BE4ZLuzI.mjs +387 -0
- package/dist/getDictionary-DMdOvXMh.js +1 -0
- package/dist/types/getDictionary.d.ts +1 -2
- package/dist/types/getIntlayer.d.ts +1 -2
- package/dist/types/plugins.d.ts +5 -0
- package/package.json +13 -13
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js +0 -1
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-CR8kSRs9.mjs +0 -73
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-BlN498QG.mjs +0 -36
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-DYN7KHa_.js +0 -1
- package/dist/plugins-Bzptc2vR.js +0 -1
- package/dist/plugins-rixQm8YE.mjs +0 -293
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defineComponent as l, useSlots as d, computed as c, openBlock as p, createBlock as u, unref as f } from "vue";
|
|
2
|
-
import { getContent as m } from "@intlayer/core/interpreter";
|
|
3
|
-
import { useEditedContentRenderer as y } from "./esm/editor/useEditedContentRenderer.mjs";
|
|
4
|
-
const g = /* @__PURE__ */ l({
|
|
5
|
-
__name: "EditedContentRenderer",
|
|
6
|
-
props: {
|
|
7
|
-
dictionaryKey: {},
|
|
8
|
-
keyPath: {},
|
|
9
|
-
locale: {}
|
|
10
|
-
},
|
|
11
|
-
setup(s) {
|
|
12
|
-
const t = s, a = d(), r = c(() => (a.default?.() ?? []).map((o) => typeof o.children == "string" ? o.children : "").join("")), n = y(
|
|
13
|
-
t.dictionaryKey,
|
|
14
|
-
t.keyPath,
|
|
15
|
-
r
|
|
16
|
-
), i = c(() => {
|
|
17
|
-
if (typeof n.value == "object" && n.value !== null) {
|
|
18
|
-
const e = m(
|
|
19
|
-
n.value,
|
|
20
|
-
t,
|
|
21
|
-
t.locale
|
|
22
|
-
);
|
|
23
|
-
return typeof e != "string" ? (console.error(
|
|
24
|
-
`Incorrect edited content format. Content type: ${typeof e}. Expected string. Value ${JSON.stringify(
|
|
25
|
-
e
|
|
26
|
-
)}`
|
|
27
|
-
), r.value) : e;
|
|
28
|
-
}
|
|
29
|
-
return n.value;
|
|
30
|
-
});
|
|
31
|
-
return (e, o) => (p(), u(f(i)));
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
export {
|
|
35
|
-
g as _
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),u=require("@intlayer/core/interpreter"),a=require("./cjs/editor/useEditedContentRenderer.cjs"),l=e.defineComponent({__name:"EditedContentRenderer",props:{dictionaryKey:{},keyPath:{},locale:{}},setup(s){const n=s,i=e.useSlots(),c=e.computed(()=>(i.default?.()??[]).map(o=>typeof o.children=="string"?o.children:"").join("")),r=a.useEditedContentRenderer(n.dictionaryKey,n.keyPath,c),d=e.computed(()=>{if(typeof r.value=="object"&&r.value!==null){const t=u.getContent(r.value,n,n.locale);return typeof t!="string"?(console.error(`Incorrect edited content format. Content type: ${typeof t}. Expected string. Value ${JSON.stringify(t)}`),c.value):t}return r.value});return(t,o)=>(e.openBlock(),e.createBlock(e.unref(d)))}});exports._sfc_main=l;
|
package/dist/plugins-Bzptc2vR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const k=require("@intlayer/config/built"),C=require("@intlayer/core/interpreter"),v=require("@intlayer/core/markdown"),L=require("@intlayer/core/transpiler"),d=require("@intlayer/types/nodeType"),a=require("vue"),M=require("@intlayer/core/utils"),h=require("@intlayer/editor"),O=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),K=require("./cjs/editor/communicator.cjs"),T=require("./cjs/editor/editorEnabled.cjs"),E=require("./cjs/editor/focusDictionary.cjs"),H=require("./cjs/editor/configuration.cjs"),w=require("./cjs/editor/createSharedComposable.cjs"),R=require("./cjs/editor/dictionariesRecord.cjs"),D=require("./cjs/editor/installIntlayerEditor.cjs");require("./cjs/client/useLocaleStorage.cjs");require("@intlayer/core/localization");const j=require("./cjs/markdown/installIntlayerMarkdown.cjs"),g=require("./cjs/renderIntlayerNode.cjs"),A=require("./cjs/editor/useCrossFrameState.cjs"),Y=require("./cjs/editor/useCrossURLPathState.cjs"),B=require("./cjs/editor/useIframeClickInterceptor.cjs"),P=Symbol("intlayer");let f=null;const I=(e,t=!0)=>{if(f)return f;const{defaultLocale:n}=k.internationalization??{},o=a.ref(e??n),r=c=>{o.value=c};return f={locale:a.readonly(o),setLocale:r,isCookieEnabled:t},f},F=(e,t,n=!0)=>{const o=I(t,n);return e.provide(P,o),D.installIntlayerEditor(e,o),e},N=w.createSharedComposable(()=>{const e=a.inject(P);if(!e)throw new Error("IntlayerEditor state not found");const[t,n]=A.useCrossFrameState(h.MessageKey.INTLAYER_CURRENT_LOCALE);return a.watch(e.locale,o=>{n(o)},{immediate:!0}),e}),S=w.createSharedComposable(()=>{H.useConfiguration(),T.useEditorEnabled(),E.useFocusDictionary(),B.useIframeClickMerger(),Y.useCrossURLPathSetter(),N(),R.useDictionariesRecord()}),U={key:1,style:{display:"contents"}},_=a.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(e){const t=e,n=E.useFocusDictionary(),o=T.useEditorEnabled(),r=K.useCommunicator();S();const c=a.computed(()=>t.keyPath.filter(s=>s.type!==d.NodeType.Translation)),i=a.computed(()=>n?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(n?.focusedContent.value.keyPath?.length??0)>0&&M.isSameKeyPath(n?.focusedContent.value.keyPath??[],c.value)),l=()=>{n?.setFocusedContent({dictionaryKey:t.dictionaryKey,keyPath:c.value})},y=()=>{r?.postMessage({type:`${h.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:{dictionaryKey:t.dictionaryKey,keyPath:c.value}})},p=()=>{r?.postMessage({type:`${h.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:null})};return(s,u)=>a.unref(o)?.enabled.value?(a.openBlock(),a.createBlock(O._sfc_main,{key:0,onPress:l,isSelecting:i.value,onHover:y,onUnhover:p},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},8,["isSelecting"])):(a.openBlock(),a.createElementBlock("span",U,[a.renderSlot(s.$slots,"default")]))}}),$={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{children:t,...n})=>{const o=i=>g.renderIntlayerNode({...n,value:i,children:k?.editor.enabled?()=>a.h(_,{dictionaryKey:n.dictionaryKey,keyPath:n.keyPath},{default:()=>typeof i=="function"?i():i}):i}),r=o(t);if(typeof t!="function")return r;const c=(...i)=>{const l=t(...i);return o(l)};Object.setPrototypeOf(c,Object.getPrototypeOf(r));for(const i of Object.getOwnPropertyNames(r)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(c,i,l)}for(const i of Object.getOwnPropertySymbols(r)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(c,i,l)}return a.markRaw(c)}},G=(e,t)=>{const n=C.splitInsertionTemplate(e,t);return n.isSimple?n.parts:a.h(a.Fragment,null,n.parts)},x={id:"insertion-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Insertion,transform:(e,t,n)=>{const o=[...t.keyPath,{type:d.NodeType.Insertion}],r=e[d.NodeType.Insertion];return n(r,{...t,children:r,keyPath:o,plugins:[{id:"insertion-string-plugin",canHandle:i=>typeof i=="string",transform:(i,l,y)=>{const p=y(i,{...l,children:i,plugins:[...(t.plugins??[]).filter(s=>s.id!=="intlayer-node-plugin")]});return s=>{const u=G(p,s);return y(u,{...l,plugins:t.plugins,children:u})}}},...t.plugins??[]]})}},b={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,t,n)=>{const{plugins:o,...r}=t,c=v.getMarkdownMetadata(e),l=n(c,{plugins:[{id:"markdown-metadata-plugin",canHandle:s=>typeof s=="string"||typeof s=="number"||typeof s=="boolean"||!s,transform:(s,u)=>g.renderIntlayerNode({...u,value:s,children:e})}],dictionaryKey:r.dictionaryKey,keyPath:[]}),y=s=>g.renderIntlayerNode({...t,value:e,children:()=>a.h(_,{dictionaryKey:r.dictionaryKey,keyPath:r.keyPath},{default:()=>{const{renderMarkdown:u,components:m}=j.useMarkdown();return u(e,void 0,{...m??{},...s??{}})}}),additionalProps:{metadata:l}}),p=y();return new Proxy(p,{get(s,u,m){return u==="value"?e:u==="metadata"?l:u==="use"?q=>y(q):Reflect.get(s,u,m)}})}},V={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Markdown,transform:(e,t,n)=>{const o=[...t.keyPath,{type:d.NodeType.Markdown}],r=e[d.NodeType.Markdown];return n(r,{...t,children:r,keyPath:o,plugins:[b,...t.plugins??[]]})}},z=()=>{const e={};for(const t of L.HTML_TAGS)e[t]=({children:n,...o})=>a.h(t,o,n);return e},J=z(),W={id:"html-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.HTML,transform:(e,t)=>{const n=e[d.NodeType.HTML];e.tags;const o=r=>{const c={...J,...r};return C.getHTML(n,c)};return g.renderIntlayerNode({...t,value:n,children:r=>o(r)})}};exports.INTLAYER_SYMBOL=P;exports._sfc_main=_;exports.createIntlayerClient=I;exports.htmlPlugin=W;exports.insertionPlugin=x;exports.installIntlayer=F;exports.intlayerNodePlugins=$;exports.markdownPlugin=V;exports.markdownStringPlugin=b;exports.useEditor=S;exports.useEditorLocale=N;
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
import w from "@intlayer/config/built";
|
|
2
|
-
import { splitInsertionTemplate as H, getHTML as K } from "@intlayer/core/interpreter";
|
|
3
|
-
import { getMarkdownMetadata as L } from "@intlayer/core/markdown";
|
|
4
|
-
import { HTML_TAGS as M } from "@intlayer/core/transpiler";
|
|
5
|
-
import { NodeType as u } from "@intlayer/types/nodeType";
|
|
6
|
-
import { ref as S, readonly as I, inject as R, watch as j, defineComponent as N, computed as P, unref as D, openBlock as k, createBlock as A, withCtx as Y, renderSlot as C, createElementBlock as $, markRaw as B, h as p, Fragment as F } from "vue";
|
|
7
|
-
import { isSameKeyPath as U } from "@intlayer/core/utils";
|
|
8
|
-
import { MessageKey as h } from "@intlayer/editor";
|
|
9
|
-
import { _ as x } from "./ContentSelector.vue_vue_type_script_setup_true_lang-CR8kSRs9.mjs";
|
|
10
|
-
import { useCommunicator as G } from "./esm/editor/communicator.mjs";
|
|
11
|
-
import { useEditorEnabled as E } from "./esm/editor/editorEnabled.mjs";
|
|
12
|
-
import { useFocusDictionary as _ } from "./esm/editor/focusDictionary.mjs";
|
|
13
|
-
import { useConfiguration as V } from "./esm/editor/configuration.mjs";
|
|
14
|
-
import { createSharedComposable as b } from "./esm/editor/createSharedComposable.mjs";
|
|
15
|
-
import { useDictionariesRecord as z } from "./esm/editor/dictionariesRecord.mjs";
|
|
16
|
-
import { installIntlayerEditor as J } from "./esm/editor/installIntlayerEditor.mjs";
|
|
17
|
-
import "./esm/client/useLocaleStorage.mjs";
|
|
18
|
-
import "@intlayer/core/localization";
|
|
19
|
-
import { useMarkdown as W } from "./esm/markdown/installIntlayerMarkdown.mjs";
|
|
20
|
-
import { renderIntlayerNode as f } from "./esm/renderIntlayerNode.mjs";
|
|
21
|
-
import { useCrossFrameState as q } from "./esm/editor/useCrossFrameState.mjs";
|
|
22
|
-
import { useCrossURLPathSetter as Q } from "./esm/editor/useCrossURLPathState.mjs";
|
|
23
|
-
import { useIframeClickMerger as X } from "./esm/editor/useIframeClickInterceptor.mjs";
|
|
24
|
-
const T = /* @__PURE__ */ Symbol("intlayer");
|
|
25
|
-
let y = null;
|
|
26
|
-
const Z = (t, e = !0) => {
|
|
27
|
-
if (y) return y;
|
|
28
|
-
const { defaultLocale: n } = w.internationalization ?? {}, r = S(t ?? n), o = (s) => {
|
|
29
|
-
r.value = s;
|
|
30
|
-
};
|
|
31
|
-
return y = {
|
|
32
|
-
locale: I(r),
|
|
33
|
-
setLocale: o,
|
|
34
|
-
isCookieEnabled: e
|
|
35
|
-
}, y;
|
|
36
|
-
}, Lt = (t, e, n = !0) => {
|
|
37
|
-
const r = Z(e, n);
|
|
38
|
-
return t.provide(T, r), J(t, r), t;
|
|
39
|
-
}, tt = b(() => {
|
|
40
|
-
const t = R(T);
|
|
41
|
-
if (!t)
|
|
42
|
-
throw new Error("IntlayerEditor state not found");
|
|
43
|
-
const [e, n] = q(
|
|
44
|
-
h.INTLAYER_CURRENT_LOCALE
|
|
45
|
-
);
|
|
46
|
-
return j(
|
|
47
|
-
t.locale,
|
|
48
|
-
(r) => {
|
|
49
|
-
n(r);
|
|
50
|
-
},
|
|
51
|
-
{ immediate: !0 }
|
|
52
|
-
), t;
|
|
53
|
-
}), et = b(() => {
|
|
54
|
-
V(), E(), _(), X(), Q(), tt(), z();
|
|
55
|
-
}), nt = {
|
|
56
|
-
key: 1,
|
|
57
|
-
style: { display: "contents" }
|
|
58
|
-
}, v = /* @__PURE__ */ N({
|
|
59
|
-
__name: "ContentSelectorWrapper",
|
|
60
|
-
props: {
|
|
61
|
-
dictionaryKey: {},
|
|
62
|
-
keyPath: {},
|
|
63
|
-
plugins: {},
|
|
64
|
-
locale: {},
|
|
65
|
-
dictionaryPath: {},
|
|
66
|
-
children: {}
|
|
67
|
-
},
|
|
68
|
-
setup(t) {
|
|
69
|
-
const e = t, n = _(), r = E(), o = G();
|
|
70
|
-
et();
|
|
71
|
-
const s = P(
|
|
72
|
-
() => e.keyPath.filter((i) => i.type !== u.Translation)
|
|
73
|
-
), a = P(
|
|
74
|
-
() => n?.focusedContent.value?.dictionaryKey === e.dictionaryKey && (n?.focusedContent.value.keyPath?.length ?? 0) > 0 && U(
|
|
75
|
-
n?.focusedContent.value.keyPath ?? [],
|
|
76
|
-
s.value
|
|
77
|
-
)
|
|
78
|
-
), c = () => {
|
|
79
|
-
n?.setFocusedContent({
|
|
80
|
-
dictionaryKey: e.dictionaryKey,
|
|
81
|
-
keyPath: s.value
|
|
82
|
-
});
|
|
83
|
-
}, d = () => {
|
|
84
|
-
o?.postMessage({
|
|
85
|
-
type: `${h.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
86
|
-
data: {
|
|
87
|
-
dictionaryKey: e.dictionaryKey,
|
|
88
|
-
keyPath: s.value
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}, m = () => {
|
|
92
|
-
o?.postMessage({
|
|
93
|
-
type: `${h.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
94
|
-
data: null
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
return (i, l) => D(r)?.enabled.value ? (k(), A(x, {
|
|
98
|
-
key: 0,
|
|
99
|
-
onPress: c,
|
|
100
|
-
isSelecting: a.value,
|
|
101
|
-
onHover: d,
|
|
102
|
-
onUnhover: m
|
|
103
|
-
}, {
|
|
104
|
-
default: Y(() => [
|
|
105
|
-
C(i.$slots, "default")
|
|
106
|
-
]),
|
|
107
|
-
_: 3
|
|
108
|
-
}, 8, ["isSelecting"])) : (k(), $("span", nt, [
|
|
109
|
-
C(i.$slots, "default")
|
|
110
|
-
]));
|
|
111
|
-
}
|
|
112
|
-
}), Mt = {
|
|
113
|
-
id: "intlayer-node-plugin",
|
|
114
|
-
canHandle: (t) => typeof t == "bigint" || typeof t == "string" || typeof t == "number",
|
|
115
|
-
transform: (t, { children: e, ...n }) => {
|
|
116
|
-
const r = (a) => f({
|
|
117
|
-
...n,
|
|
118
|
-
value: a,
|
|
119
|
-
children: w?.editor.enabled ? () => p(
|
|
120
|
-
// EditorSelectorRenderer, // Maximum stack size exceeded
|
|
121
|
-
v,
|
|
122
|
-
{
|
|
123
|
-
dictionaryKey: n.dictionaryKey,
|
|
124
|
-
keyPath: n.keyPath
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
default: () => typeof a == "function" ? a() : a
|
|
128
|
-
}
|
|
129
|
-
) : a
|
|
130
|
-
}), o = r(e);
|
|
131
|
-
if (typeof e != "function")
|
|
132
|
-
return o;
|
|
133
|
-
const s = (...a) => {
|
|
134
|
-
const c = e(...a);
|
|
135
|
-
return r(c);
|
|
136
|
-
};
|
|
137
|
-
Object.setPrototypeOf(s, Object.getPrototypeOf(o));
|
|
138
|
-
for (const a of Object.getOwnPropertyNames(o)) {
|
|
139
|
-
const c = Object.getOwnPropertyDescriptor(o, a);
|
|
140
|
-
c && Object.defineProperty(s, a, c);
|
|
141
|
-
}
|
|
142
|
-
for (const a of Object.getOwnPropertySymbols(o)) {
|
|
143
|
-
const c = Object.getOwnPropertyDescriptor(o, a);
|
|
144
|
-
c && Object.defineProperty(s, a, c);
|
|
145
|
-
}
|
|
146
|
-
return B(s);
|
|
147
|
-
}
|
|
148
|
-
}, ot = (t, e) => {
|
|
149
|
-
const n = H(t, e);
|
|
150
|
-
return n.isSimple ? n.parts : p(F, null, n.parts);
|
|
151
|
-
}, St = {
|
|
152
|
-
id: "insertion-plugin",
|
|
153
|
-
canHandle: (t) => typeof t == "object" && t?.nodeType === u.Insertion,
|
|
154
|
-
transform: (t, e, n) => {
|
|
155
|
-
const r = [
|
|
156
|
-
...e.keyPath,
|
|
157
|
-
{
|
|
158
|
-
type: u.Insertion
|
|
159
|
-
}
|
|
160
|
-
], o = t[u.Insertion];
|
|
161
|
-
return n(o, {
|
|
162
|
-
...e,
|
|
163
|
-
children: o,
|
|
164
|
-
keyPath: r,
|
|
165
|
-
plugins: [{
|
|
166
|
-
id: "insertion-string-plugin",
|
|
167
|
-
canHandle: (a) => typeof a == "string",
|
|
168
|
-
transform: (a, c, d) => {
|
|
169
|
-
const m = d(a, {
|
|
170
|
-
...c,
|
|
171
|
-
children: a,
|
|
172
|
-
plugins: [
|
|
173
|
-
...(e.plugins ?? []).filter(
|
|
174
|
-
(i) => i.id !== "intlayer-node-plugin"
|
|
175
|
-
)
|
|
176
|
-
]
|
|
177
|
-
});
|
|
178
|
-
return (i) => {
|
|
179
|
-
const l = ot(m, i);
|
|
180
|
-
return d(l, {
|
|
181
|
-
...c,
|
|
182
|
-
plugins: e.plugins,
|
|
183
|
-
children: l
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
}, ...e.plugins ?? []]
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}, rt = {
|
|
191
|
-
id: "markdown-string-plugin",
|
|
192
|
-
canHandle: (t) => typeof t == "string",
|
|
193
|
-
transform: (t, e, n) => {
|
|
194
|
-
const {
|
|
195
|
-
plugins: r,
|
|
196
|
-
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
197
|
-
...o
|
|
198
|
-
} = e, s = L(t), c = n(s, {
|
|
199
|
-
plugins: [{
|
|
200
|
-
id: "markdown-metadata-plugin",
|
|
201
|
-
canHandle: (i) => typeof i == "string" || typeof i == "number" || typeof i == "boolean" || !i,
|
|
202
|
-
transform: (i, l) => f({
|
|
203
|
-
...l,
|
|
204
|
-
value: i,
|
|
205
|
-
children: t
|
|
206
|
-
})
|
|
207
|
-
}],
|
|
208
|
-
dictionaryKey: o.dictionaryKey,
|
|
209
|
-
keyPath: []
|
|
210
|
-
}), d = (i) => f({
|
|
211
|
-
...e,
|
|
212
|
-
value: t,
|
|
213
|
-
children: () => p(
|
|
214
|
-
v,
|
|
215
|
-
{
|
|
216
|
-
dictionaryKey: o.dictionaryKey,
|
|
217
|
-
keyPath: o.keyPath
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
default: () => {
|
|
221
|
-
const { renderMarkdown: l, components: g } = W();
|
|
222
|
-
return l(t, void 0, {
|
|
223
|
-
...g ?? {},
|
|
224
|
-
...i ?? {}
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
),
|
|
229
|
-
additionalProps: {
|
|
230
|
-
metadata: c
|
|
231
|
-
}
|
|
232
|
-
}), m = d();
|
|
233
|
-
return new Proxy(m, {
|
|
234
|
-
get(i, l, g) {
|
|
235
|
-
return l === "value" ? t : l === "metadata" ? c : l === "use" ? (O) => d(O) : Reflect.get(i, l, g);
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}, It = {
|
|
240
|
-
id: "markdown-plugin",
|
|
241
|
-
canHandle: (t) => typeof t == "object" && t?.nodeType === u.Markdown,
|
|
242
|
-
transform: (t, e, n) => {
|
|
243
|
-
const r = [
|
|
244
|
-
...e.keyPath,
|
|
245
|
-
{
|
|
246
|
-
type: u.Markdown
|
|
247
|
-
}
|
|
248
|
-
], o = t[u.Markdown];
|
|
249
|
-
return n(o, {
|
|
250
|
-
...e,
|
|
251
|
-
children: o,
|
|
252
|
-
keyPath: r,
|
|
253
|
-
plugins: [rt, ...e.plugins ?? []]
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
}, at = () => {
|
|
257
|
-
const t = {};
|
|
258
|
-
for (const e of M)
|
|
259
|
-
t[e] = ({ children: n, ...r }) => p(e, r, n);
|
|
260
|
-
return t;
|
|
261
|
-
}, it = at(), Rt = {
|
|
262
|
-
id: "html-plugin",
|
|
263
|
-
canHandle: (t) => typeof t == "object" && t?.nodeType === u.HTML,
|
|
264
|
-
transform: (t, e) => {
|
|
265
|
-
const n = t[u.HTML];
|
|
266
|
-
t.tags;
|
|
267
|
-
const r = (o) => {
|
|
268
|
-
const s = {
|
|
269
|
-
...it,
|
|
270
|
-
...o
|
|
271
|
-
};
|
|
272
|
-
return K(n, s);
|
|
273
|
-
};
|
|
274
|
-
return f({
|
|
275
|
-
...e,
|
|
276
|
-
value: n,
|
|
277
|
-
children: (o) => r(o)
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
export {
|
|
282
|
-
T as I,
|
|
283
|
-
v as _,
|
|
284
|
-
Lt as a,
|
|
285
|
-
Mt as b,
|
|
286
|
-
Z as c,
|
|
287
|
-
rt as d,
|
|
288
|
-
tt as e,
|
|
289
|
-
Rt as h,
|
|
290
|
-
St as i,
|
|
291
|
-
It as m,
|
|
292
|
-
et as u
|
|
293
|
-
};
|