markdown-flow-ui 0.2.35 → 0.3.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/_virtual/index.es10.js +2 -2
- package/dist/_virtual/index.es3.js +5 -4
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +4 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +5 -5
- package/dist/_virtual/index.es6.js +5 -3
- package/dist/_virtual/index.es6.js.map +1 -1
- package/dist/_virtual/index.es7.js +3 -5
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/_virtual/index.es8.js +2 -2
- package/dist/_virtual/index10.cjs +1 -1
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index4.cjs +1 -1
- package/dist/_virtual/index5.cjs +1 -1
- package/dist/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/variable-marker.cjs +2 -0
- package/dist/_virtual/variable-marker.cjs.map +1 -0
- package/dist/_virtual/variable-marker.es.js +5 -0
- package/dist/_virtual/variable-marker.es.js.map +1 -0
- package/dist/_virtual/variable-name.cjs +2 -0
- package/dist/_virtual/variable-name.cjs.map +1 -0
- package/dist/_virtual/variable-name.es.js +5 -0
- package/dist/_virtual/variable-name.es.js.map +1 -0
- package/dist/components/ContentRender/ContentRender.cjs +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
- package/dist/components/ContentRender/ContentRender.es.js +206 -205
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.es.js +52 -51
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- package/dist/components/ContentRender/utils/inline-code-ranges.cjs +9 -9
- package/dist/components/ContentRender/utils/inline-code-ranges.cjs.map +1 -1
- package/dist/components/ContentRender/utils/inline-code-ranges.d.ts +3 -0
- package/dist/components/ContentRender/utils/inline-code-ranges.es.js +185 -161
- package/dist/components/ContentRender/utils/inline-code-ranges.es.js.map +1 -1
- package/dist/components/ContentRender/utils/mermaid-parse.cjs +4 -4
- package/dist/components/ContentRender/utils/mermaid-parse.cjs.map +1 -1
- package/dist/components/ContentRender/utils/mermaid-parse.es.js +53 -48
- package/dist/components/ContentRender/utils/mermaid-parse.es.js.map +1 -1
- package/dist/components/ContentRender/utils/split-content.cjs +6 -6
- package/dist/components/ContentRender/utils/split-content.cjs.map +1 -1
- package/dist/components/ContentRender/utils/split-content.d.ts +1 -0
- package/dist/components/ContentRender/utils/split-content.es.js +361 -313
- package/dist/components/ContentRender/utils/split-content.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +286 -290
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js +62 -63
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.es.js +13 -13
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +19 -19
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.es.js +13 -13
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.es.js +16 -16
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +13 -13
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.es.js +13 -13
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +176 -174
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs +2 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.d.ts +3 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js +38 -55
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.test.d.ts +1 -0
- package/dist/components/MarkdownFlowEditor/utils.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/utils.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.d.ts +2 -3
- package/dist/components/MarkdownFlowEditor/utils.es.js +47 -51
- package/dist/components/MarkdownFlowEditor/utils.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.variables.test.d.ts +1 -0
- package/dist/components/ui/inputGroup/textarea.cjs +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +1 -1
- package/dist/lib/interaction-defaults.cjs +1 -1
- package/dist/lib/interaction-defaults.cjs.map +1 -1
- package/dist/lib/interaction-defaults.es.js +123 -132
- package/dist/lib/interaction-defaults.es.js.map +1 -1
- package/dist/lib/interaction-defaults.failure.test.d.ts +1 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs.map +1 -1
- package/dist/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs.map +1 -1
- package/dist/node_modules/layout-base/layout-base.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAMF2YG6.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OMD6QJNC.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U37J5Y7L.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-WV7ZQ7D5.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-4MX5Z3NR.es.js +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
- package/dist/node_modules/remark-flow/dist/escaping.cjs +2 -2
- package/dist/node_modules/remark-flow/dist/escaping.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/escaping.es.js +128 -63
- package/dist/node_modules/remark-flow/dist/escaping.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/index.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/index.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/index.es.js +62 -33
- package/dist/node_modules/remark-flow/dist/index.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-parser.es.js +260 -256
- package/dist/node_modules/remark-flow/dist/interaction-parser.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +71 -42
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.cjs.map +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js +500 -46
- package/dist/node_modules/remark-flow/dist/interaction-syntax.es.js.map +1 -1
- package/dist/node_modules/remark-flow/dist/variable-marker.cjs +2 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.cjs.map +1 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.es.js +77 -0
- package/dist/node_modules/remark-flow/dist/variable-marker.es.js.map +1 -0
- package/dist/node_modules/remark-flow/dist/variable-name.cjs +15 -0
- package/dist/node_modules/remark-flow/dist/variable-name.cjs.map +1 -0
- package/dist/node_modules/remark-flow/dist/variable-name.es.js +748 -0
- package/dist/node_modules/remark-flow/dist/variable-name.es.js.map +1 -0
- package/dist/node_modules/style-to-object/cjs/index.cjs +1 -1
- package/dist/node_modules/style-to-object/cjs/index.cjs.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.es.js +1 -1
- package/dist/node_modules/unified/lib/index.cjs +1 -1
- package/dist/node_modules/unified/lib/index.es.js +1 -1
- package/package.json +2 -2
|
@@ -1,81 +1,77 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import
|
|
4
|
-
import { autocompletion as
|
|
5
|
-
import { EditorView as
|
|
6
|
-
import { markdown as
|
|
7
|
-
import { syntaxHighlighting as
|
|
8
|
-
import { Tooltip as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
1
|
+
import { jsx as m, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as C, useMemo as v, useState as w, useRef as K, useCallback as l } from "react";
|
|
3
|
+
import Ye from "../../node_modules/@uiw/react-codemirror/esm/index.es.js";
|
|
4
|
+
import { autocompletion as Je } from "../../node_modules/@codemirror/autocomplete/dist/index.es.js";
|
|
5
|
+
import { EditorView as we } from "../../node_modules/@codemirror/view/dist/index.es.js";
|
|
6
|
+
import { markdown as Xe } from "../../node_modules/@codemirror/lang-markdown/dist/index.es.js";
|
|
7
|
+
import { syntaxHighlighting as Ze, defaultHighlightStyle as et } from "../../node_modules/@codemirror/language/dist/index.es.js";
|
|
8
|
+
import { Tooltip as tt, TooltipTrigger as ot, TooltipContent as nt } from "../ui/tooltip.es.js";
|
|
9
|
+
import rt from "./components/CustomDialog.es.js";
|
|
10
|
+
import it from "./components/CustomPopover.es.js";
|
|
11
|
+
import at from "./components/EditorToolbar.es.js";
|
|
12
|
+
import lt from "./components/VariableSearchDropdown.es.js";
|
|
13
|
+
import st from "./editor-context.es.js";
|
|
14
|
+
import ct from "./components/ImageInject.es.js";
|
|
15
|
+
import ut from "./components/VideoInject.es.js";
|
|
16
|
+
import mt from "./components/VariableSelect.es.js";
|
|
17
17
|
import { SelectedOption as f } from "./types.es.js";
|
|
18
18
|
/* empty css */
|
|
19
|
-
import {
|
|
19
|
+
import { getImageContentToInsert as ft, getVideoContentToInsert as ht, createSlashCommands as pt, parseContentInfo as gt } from "./utils.es.js";
|
|
20
20
|
import dt from "./plugins/ImgPlaceholder.es.js";
|
|
21
21
|
import Vt from "./plugins/VideoPlaceholder.es.js";
|
|
22
|
-
import { mediaPlaceholderLabels as
|
|
23
|
-
import
|
|
22
|
+
import { mediaPlaceholderLabels as bt } from "./plugins/mediaPlaceholderLabels.es.js";
|
|
23
|
+
import Ct from "./plugins/VariablePlaceholder.es.js";
|
|
24
24
|
import St from "./plugins/SyntaxHighlighter.es.js";
|
|
25
|
-
import
|
|
26
|
-
import { DEFAULT_EDITOR_LOCALE as
|
|
27
|
-
import { normalizeMarkdownFlowLocale as
|
|
28
|
-
import { useDetachedLanguage as
|
|
29
|
-
import { useResolvedDirection as
|
|
30
|
-
import { initReactI18next as
|
|
25
|
+
import ne from "../../node_modules/i18next/dist/esm/i18next.es.js";
|
|
26
|
+
import { DEFAULT_EDITOR_LOCALE as re, editorLocaleResources as Te, getEditorLocaleMessages as It } from "./editorI18n.es.js";
|
|
27
|
+
import { normalizeMarkdownFlowLocale as vt, getMarkdownFlowDirection as wt, getMarkdownFlowLanguage as Tt } from "../../lib/locale.es.js";
|
|
28
|
+
import { useDetachedLanguage as Lt } from "../../lib/useDetachedLanguage.es.js";
|
|
29
|
+
import { useResolvedDirection as kt } from "../../lib/useResolvedDirection.es.js";
|
|
30
|
+
import { initReactI18next as Et } from "../../node_modules/react-i18next/dist/es/initReactI18next.es.js";
|
|
31
31
|
import { useTranslation as Ot } from "../../node_modules/react-i18next/dist/es/useTranslation.es.js";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
import { d as N } from "../../_virtual/index.es.js";
|
|
33
|
+
ne.isInitialized ? Object.entries(Te).forEach(([V, h]) => {
|
|
34
|
+
ne.addResourceBundle(
|
|
35
|
+
V,
|
|
35
36
|
"translation",
|
|
36
37
|
h.translation,
|
|
37
38
|
!0,
|
|
38
39
|
!0
|
|
39
40
|
);
|
|
40
|
-
}) :
|
|
41
|
-
resources:
|
|
42
|
-
lng:
|
|
43
|
-
fallbackLng:
|
|
41
|
+
}) : ne.use(Et).init({
|
|
42
|
+
resources: Te,
|
|
43
|
+
lng: re,
|
|
44
|
+
fallbackLng: re,
|
|
44
45
|
interpolation: { escapeValue: !1 }
|
|
45
46
|
});
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
47
|
+
const Le = [], ke = (V, h) => {
|
|
48
|
+
if (!V || h < 0)
|
|
48
49
|
return !1;
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
for (; (L = O.exec(C)) !== null; ) {
|
|
52
|
-
const E = L.index ?? 0, U = E + L[0].length, R = E + 2, Y = U - 2;
|
|
53
|
-
if (h >= R && h <= Y)
|
|
50
|
+
for (const k of N.findDocumentVariableMarkers(V))
|
|
51
|
+
if (k.name !== null && h >= k.start + 2 && h <= k.end - 2)
|
|
54
52
|
return !0;
|
|
55
|
-
O.lastIndex === L.index && O.lastIndex++;
|
|
56
|
-
}
|
|
57
53
|
return !1;
|
|
58
|
-
},
|
|
59
|
-
content:
|
|
54
|
+
}, yt = (V = "") => V ? N.formatVariableReference(V) : "{{ }}", so = ({
|
|
55
|
+
content: V = "",
|
|
60
56
|
editMode: h = "codeEdit",
|
|
61
|
-
variables:
|
|
62
|
-
systemVariables:
|
|
63
|
-
onChange:
|
|
64
|
-
onBlur:
|
|
65
|
-
locale:
|
|
66
|
-
lang:
|
|
67
|
-
uploadProps:
|
|
57
|
+
variables: k,
|
|
58
|
+
systemVariables: ie,
|
|
59
|
+
onChange: F,
|
|
60
|
+
onBlur: Ee,
|
|
61
|
+
locale: Q,
|
|
62
|
+
lang: Oe,
|
|
63
|
+
uploadProps: ye,
|
|
68
64
|
disabled: n = !1,
|
|
69
|
-
toolbarActionsRight:
|
|
65
|
+
toolbarActionsRight: U,
|
|
70
66
|
onReady: xe
|
|
71
67
|
}) => {
|
|
72
|
-
const { t: a, i18n:
|
|
73
|
-
|
|
74
|
-
),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
const
|
|
68
|
+
const { t: a, i18n: Y } = Ot(), j = vt(
|
|
69
|
+
Q ?? re
|
|
70
|
+
), ae = wt(Q), le = Oe ?? Tt(Q);
|
|
71
|
+
C(() => {
|
|
72
|
+
Y.language !== j && Y.changeLanguage(j);
|
|
73
|
+
}, [Y, j]);
|
|
74
|
+
const E = It(j), b = v(
|
|
79
75
|
() => ({
|
|
80
76
|
image: a("toolbarInsertImage", {
|
|
81
77
|
defaultValue: "Insert image"
|
|
@@ -121,7 +117,7 @@ const Te = [], ke = (C, h) => {
|
|
|
121
117
|
})
|
|
122
118
|
}),
|
|
123
119
|
[a]
|
|
124
|
-
),
|
|
120
|
+
), Pe = v(
|
|
125
121
|
() => ({
|
|
126
122
|
searchPlaceholder: a("variableSearchPlaceholder", {
|
|
127
123
|
defaultValue: "Search variable"
|
|
@@ -131,115 +127,113 @@ const Te = [], ke = (C, h) => {
|
|
|
131
127
|
emptyLabel: a("variableNotFound", "No variables found")
|
|
132
128
|
}),
|
|
133
129
|
[a]
|
|
134
|
-
),
|
|
130
|
+
), Ne = h === "quickEdit" ? a("placeholderQuickEdit", {
|
|
135
131
|
defaultValue: a("placeholderCodeEdit", {
|
|
136
132
|
defaultValue: a("placeholder")
|
|
137
133
|
})
|
|
138
|
-
}) : a("placeholderCodeEdit", { defaultValue: a("placeholder") }),
|
|
134
|
+
}) : a("placeholderCodeEdit", { defaultValue: a("placeholder") }), D = v(() => {
|
|
139
135
|
const e = /* @__PURE__ */ new Set();
|
|
140
|
-
return (
|
|
141
|
-
const r = typeof o?.name == "string" ? o.name
|
|
142
|
-
return
|
|
136
|
+
return (ie ?? Le).flatMap((o) => {
|
|
137
|
+
const r = typeof o?.name == "string" ? N.normalizeVariableName(o.name) : null;
|
|
138
|
+
return r === null || e.has(r) ? [] : (e.add(r), [{ ...o, name: r }]);
|
|
143
139
|
});
|
|
144
|
-
}, [
|
|
140
|
+
}, [ie]), J = v(() => {
|
|
145
141
|
const e = new Set(
|
|
146
|
-
|
|
142
|
+
D.map((r) => r.name)
|
|
147
143
|
), o = /* @__PURE__ */ new Set();
|
|
148
|
-
return (
|
|
149
|
-
const t = typeof r?.name == "string" ? r.name
|
|
150
|
-
return
|
|
144
|
+
return (k ?? Le).flatMap((r) => {
|
|
145
|
+
const t = typeof r?.name == "string" ? N.normalizeVariableName(r.name) : null;
|
|
146
|
+
return t === null || e.has(t) || o.has(t) ? [] : (o.add(t), [{ ...r, name: t }]);
|
|
151
147
|
});
|
|
152
|
-
}, [
|
|
148
|
+
}, [k, D]), [X, T] = w(!1), [Z, O] = w(!1), H = K(null), R = Lt(H, le), { resolvedDirection: A } = kt(
|
|
153
149
|
H,
|
|
154
|
-
|
|
155
|
-
), [
|
|
156
|
-
|
|
157
|
-
), [
|
|
158
|
-
|
|
150
|
+
ae
|
|
151
|
+
), [De, z] = w(null), [se, ee] = w(
|
|
152
|
+
J
|
|
153
|
+
), [$, Re] = w(
|
|
154
|
+
D
|
|
159
155
|
);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}, [
|
|
163
|
-
|
|
164
|
-
}, [
|
|
165
|
-
const [S,
|
|
156
|
+
C(() => {
|
|
157
|
+
ee(J);
|
|
158
|
+
}, [J]), C(() => {
|
|
159
|
+
Re(D);
|
|
160
|
+
}, [D]);
|
|
161
|
+
const [S, L] = w(
|
|
166
162
|
f.Empty
|
|
167
|
-
), [
|
|
168
|
-
|
|
169
|
-
}, []),
|
|
163
|
+
), [s, M] = w(), i = K(null), q = K(null), _ = K(null), [te, ce] = w(!1), d = l(() => {
|
|
164
|
+
ce(!1), _.current = null;
|
|
165
|
+
}, []), Ae = l(
|
|
170
166
|
(e) => {
|
|
171
167
|
if (!n) {
|
|
172
|
-
if (
|
|
173
|
-
|
|
168
|
+
if (te && _.current === e) {
|
|
169
|
+
d();
|
|
174
170
|
return;
|
|
175
171
|
}
|
|
176
|
-
|
|
172
|
+
_.current = e, ce(!0);
|
|
177
173
|
}
|
|
178
174
|
},
|
|
179
|
-
[
|
|
180
|
-
),
|
|
175
|
+
[d, n, te]
|
|
176
|
+
), ze = {
|
|
181
177
|
selectedOption: S,
|
|
182
|
-
setSelectedOption:
|
|
183
|
-
dialogOpen:
|
|
178
|
+
setSelectedOption: L,
|
|
179
|
+
dialogOpen: X,
|
|
184
180
|
setDialogOpen: T,
|
|
185
|
-
popoverOpen:
|
|
186
|
-
setPopoverOpen:
|
|
187
|
-
popoverPosition:
|
|
188
|
-
setPopoverPosition:
|
|
181
|
+
popoverOpen: Z,
|
|
182
|
+
setPopoverOpen: O,
|
|
183
|
+
popoverPosition: De,
|
|
184
|
+
setPopoverPosition: z
|
|
189
185
|
};
|
|
190
|
-
|
|
191
|
-
n && (T(!1),
|
|
186
|
+
C(() => {
|
|
187
|
+
n && (T(!1), O(!1), L(f.Empty), M(null), z(null), d());
|
|
192
188
|
}, [
|
|
193
|
-
|
|
189
|
+
d,
|
|
194
190
|
n,
|
|
195
191
|
T,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
O,
|
|
193
|
+
z,
|
|
194
|
+
L,
|
|
199
195
|
M
|
|
200
196
|
]);
|
|
201
|
-
const
|
|
197
|
+
const y = l(
|
|
202
198
|
(e) => {
|
|
203
199
|
if (h !== "quickEdit" || !e)
|
|
204
200
|
return;
|
|
205
|
-
const o =
|
|
201
|
+
const o = N.extractVariableNames(e);
|
|
206
202
|
if (!o.length)
|
|
207
203
|
return;
|
|
208
204
|
const r = new Set(
|
|
209
|
-
|
|
205
|
+
$.map((t) => t.name)
|
|
210
206
|
);
|
|
211
|
-
|
|
212
|
-
const c = new Set(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const I = d.toLowerCase();
|
|
217
|
-
!d || r.has(I) || c.has(I) || u.has(I) || (p.push({ name: d }), u.add(I));
|
|
207
|
+
ee((t) => {
|
|
208
|
+
const c = new Set(t.map((g) => g.name)), u = /* @__PURE__ */ new Set(), p = [];
|
|
209
|
+
return o.forEach((g) => {
|
|
210
|
+
const I = g;
|
|
211
|
+
!g || r.has(I) || c.has(I) || u.has(I) || (p.push({ name: g }), u.add(I));
|
|
218
212
|
}), p.length ? [...p, ...t] : t;
|
|
219
213
|
});
|
|
220
214
|
},
|
|
221
|
-
[h,
|
|
215
|
+
[h, $]
|
|
222
216
|
);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}, [
|
|
226
|
-
const
|
|
217
|
+
C(() => {
|
|
218
|
+
y(V);
|
|
219
|
+
}, [V, y]);
|
|
220
|
+
const oe = l(
|
|
227
221
|
(e) => {
|
|
228
222
|
if (!n)
|
|
229
|
-
if (
|
|
223
|
+
if (d(), L(e), e === f.Variable) {
|
|
230
224
|
if (i.current) {
|
|
231
225
|
const { state: o } = i.current, r = o.selection.main.from, t = i.current.coordsAtPos(r);
|
|
232
|
-
t &&
|
|
226
|
+
t && z({
|
|
233
227
|
x: t.left,
|
|
234
228
|
y: t.bottom
|
|
235
229
|
});
|
|
236
230
|
}
|
|
237
|
-
|
|
231
|
+
O(!0);
|
|
238
232
|
} else
|
|
239
233
|
T(!0);
|
|
240
234
|
},
|
|
241
|
-
[
|
|
242
|
-
),
|
|
235
|
+
[d, n]
|
|
236
|
+
), x = l(
|
|
243
237
|
(e) => {
|
|
244
238
|
if (n || !i.current) return;
|
|
245
239
|
const { state: o, dispatch: r } = i.current, t = o.selection.main.from;
|
|
@@ -249,7 +243,7 @@ const Te = [], ke = (C, h) => {
|
|
|
249
243
|
});
|
|
250
244
|
},
|
|
251
245
|
[i, n]
|
|
252
|
-
),
|
|
246
|
+
), ue = l(
|
|
253
247
|
(e) => {
|
|
254
248
|
if (n || !i.current)
|
|
255
249
|
return;
|
|
@@ -260,14 +254,14 @@ const Te = [], ke = (C, h) => {
|
|
|
260
254
|
});
|
|
261
255
|
},
|
|
262
256
|
[n]
|
|
263
|
-
),
|
|
257
|
+
), me = l(() => {
|
|
264
258
|
i.current?.focus();
|
|
265
|
-
}, []),
|
|
259
|
+
}, []), fe = l(() => i.current?.state.doc.toString() ?? "", []), he = l(
|
|
266
260
|
(e) => {
|
|
267
261
|
if (n)
|
|
268
262
|
return;
|
|
269
263
|
if (!i.current) {
|
|
270
|
-
|
|
264
|
+
F?.(e);
|
|
271
265
|
return;
|
|
272
266
|
}
|
|
273
267
|
const o = i.current, { state: r, dispatch: t } = o;
|
|
@@ -276,34 +270,36 @@ const Te = [], ke = (C, h) => {
|
|
|
276
270
|
selection: { anchor: e.length }
|
|
277
271
|
});
|
|
278
272
|
},
|
|
279
|
-
[n,
|
|
280
|
-
),
|
|
281
|
-
if (n || !
|
|
273
|
+
[n, F]
|
|
274
|
+
), G = l(() => {
|
|
275
|
+
if (n || !s || !i.current || s.from === -1)
|
|
282
276
|
return;
|
|
283
|
-
const { from: e, to: o } =
|
|
277
|
+
const { from: e, to: o } = s, { dispatch: r } = i.current;
|
|
284
278
|
r({
|
|
285
279
|
changes: { from: e, to: o, insert: "" }
|
|
286
280
|
});
|
|
287
|
-
}, [
|
|
281
|
+
}, [s, i, n]), W = l(
|
|
288
282
|
(e, o, r = !1) => {
|
|
289
283
|
if (n || !i.current)
|
|
290
284
|
return;
|
|
291
|
-
const t = i.current, { state: c, dispatch: u } = t, p = o ?? c.selection.main,
|
|
285
|
+
const t = i.current, { state: c, dispatch: u } = t, p = o ?? c.selection.main, g = yt(e);
|
|
286
|
+
if (!g) return;
|
|
287
|
+
const I = N.normalizeVariableName(e) ?? "", Ue = r ? g.length : 3 + I.length;
|
|
292
288
|
u({
|
|
293
289
|
changes: {
|
|
294
290
|
from: p.from,
|
|
295
291
|
to: p.to,
|
|
296
|
-
insert:
|
|
292
|
+
insert: g
|
|
297
293
|
},
|
|
298
294
|
selection: {
|
|
299
|
-
anchor: p.from +
|
|
295
|
+
anchor: p.from + Ue
|
|
300
296
|
}
|
|
301
297
|
}), t.focus();
|
|
302
298
|
},
|
|
303
299
|
[n]
|
|
304
|
-
),
|
|
305
|
-
n || (
|
|
306
|
-
}, [
|
|
300
|
+
), Me = l(() => {
|
|
301
|
+
n || (d(), W(""));
|
|
302
|
+
}, [d, n, W]), Be = l(() => {
|
|
307
303
|
if (n || !i.current)
|
|
308
304
|
return;
|
|
309
305
|
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main;
|
|
@@ -317,7 +313,7 @@ const Te = [], ke = (C, h) => {
|
|
|
317
313
|
anchor: t.from + 3
|
|
318
314
|
}
|
|
319
315
|
}), e.focus();
|
|
320
|
-
}, [n]), Fe =
|
|
316
|
+
}, [n]), Fe = l(() => {
|
|
321
317
|
if (n || !i.current)
|
|
322
318
|
return;
|
|
323
319
|
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main;
|
|
@@ -331,7 +327,7 @@ const Te = [], ke = (C, h) => {
|
|
|
331
327
|
anchor: t.from + 1
|
|
332
328
|
}
|
|
333
329
|
}), e.focus();
|
|
334
|
-
}, [n]),
|
|
330
|
+
}, [n]), je = l(() => {
|
|
335
331
|
if (n || !i.current)
|
|
336
332
|
return;
|
|
337
333
|
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main;
|
|
@@ -345,10 +341,10 @@ const Te = [], ke = (C, h) => {
|
|
|
345
341
|
anchor: t.from + 2
|
|
346
342
|
}
|
|
347
343
|
}), e.focus();
|
|
348
|
-
}, [n]),
|
|
344
|
+
}, [n]), He = l(() => {
|
|
349
345
|
if (n || !i.current)
|
|
350
346
|
return;
|
|
351
|
-
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main, c =
|
|
347
|
+
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main, c = b.singleChoiceOption1, u = b.singleChoiceOption2, p = `?[%{{ }} ${c} | ${u}]`;
|
|
352
348
|
r({
|
|
353
349
|
changes: {
|
|
354
350
|
from: t.from,
|
|
@@ -356,17 +352,17 @@ const Te = [], ke = (C, h) => {
|
|
|
356
352
|
insert: p
|
|
357
353
|
},
|
|
358
354
|
selection: {
|
|
359
|
-
anchor: t.from +
|
|
355
|
+
anchor: t.from + 6
|
|
360
356
|
}
|
|
361
357
|
}), e.focus();
|
|
362
358
|
}, [
|
|
363
359
|
n,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
]),
|
|
360
|
+
b.singleChoiceOption1,
|
|
361
|
+
b.singleChoiceOption2
|
|
362
|
+
]), $e = l(() => {
|
|
367
363
|
if (n || !i.current)
|
|
368
364
|
return;
|
|
369
|
-
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main, c =
|
|
365
|
+
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main, c = b.singleChoiceOption1, u = b.singleChoiceOption2, p = `?[%{{ }} ${c} || ${u}]`;
|
|
370
366
|
r({
|
|
371
367
|
changes: {
|
|
372
368
|
from: t.from,
|
|
@@ -374,17 +370,17 @@ const Te = [], ke = (C, h) => {
|
|
|
374
370
|
insert: p
|
|
375
371
|
},
|
|
376
372
|
selection: {
|
|
377
|
-
anchor: t.from +
|
|
373
|
+
anchor: t.from + 6
|
|
378
374
|
}
|
|
379
375
|
}), e.focus();
|
|
380
376
|
}, [
|
|
381
377
|
n,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
]),
|
|
378
|
+
b.singleChoiceOption1,
|
|
379
|
+
b.singleChoiceOption2
|
|
380
|
+
]), qe = l(() => {
|
|
385
381
|
if (n || !i.current)
|
|
386
382
|
return;
|
|
387
|
-
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main, u = `?[%{{}}...${
|
|
383
|
+
const e = i.current, { state: o, dispatch: r } = e, t = o.selection.main, u = `?[%{{ }}...${b.inputPlaceholder ?? "请输入"}]`;
|
|
388
384
|
r({
|
|
389
385
|
changes: {
|
|
390
386
|
from: t.from,
|
|
@@ -392,157 +388,157 @@ const Te = [], ke = (C, h) => {
|
|
|
392
388
|
insert: u
|
|
393
389
|
},
|
|
394
390
|
selection: {
|
|
395
|
-
anchor: t.from +
|
|
391
|
+
anchor: t.from + 6
|
|
396
392
|
}
|
|
397
393
|
}), e.focus();
|
|
398
|
-
}, [n,
|
|
394
|
+
}, [n, b.inputPlaceholder]), _e = l(
|
|
399
395
|
({
|
|
400
396
|
resourceUrl: e,
|
|
401
397
|
resourceTitle: o,
|
|
402
398
|
scalePercent: r
|
|
403
399
|
}) => {
|
|
404
400
|
if (!e || n) return;
|
|
405
|
-
const t =
|
|
401
|
+
const t = ft({
|
|
406
402
|
resourceUrl: e,
|
|
407
403
|
resourceTitle: o,
|
|
408
404
|
scalePercent: r
|
|
409
405
|
});
|
|
410
|
-
if (
|
|
411
|
-
if (
|
|
406
|
+
if (s?.type === f.Image) {
|
|
407
|
+
if (G(), !i.current) return;
|
|
412
408
|
const { dispatch: c } = i.current;
|
|
413
409
|
c({
|
|
414
|
-
changes: { from:
|
|
410
|
+
changes: { from: s.from, insert: t }
|
|
415
411
|
});
|
|
416
412
|
} else
|
|
417
|
-
|
|
413
|
+
x(t);
|
|
418
414
|
T(!1);
|
|
419
415
|
},
|
|
420
|
-
[
|
|
421
|
-
),
|
|
416
|
+
[G, n, x, s]
|
|
417
|
+
), Ge = l(
|
|
422
418
|
({
|
|
423
419
|
resourceUrl: e,
|
|
424
420
|
resourceTitle: o
|
|
425
421
|
}) => {
|
|
426
422
|
if (n)
|
|
427
423
|
return;
|
|
428
|
-
const r =
|
|
429
|
-
if (
|
|
430
|
-
if (
|
|
424
|
+
const r = ht(e, o);
|
|
425
|
+
if (s?.type === f.Video) {
|
|
426
|
+
if (G(), !i.current) return;
|
|
431
427
|
const { dispatch: t } = i.current;
|
|
432
428
|
t({
|
|
433
|
-
changes: { from:
|
|
429
|
+
changes: { from: s.from, insert: r }
|
|
434
430
|
});
|
|
435
431
|
} else
|
|
436
|
-
|
|
432
|
+
x(r);
|
|
437
433
|
T(!1);
|
|
438
434
|
},
|
|
439
|
-
[
|
|
440
|
-
),
|
|
435
|
+
[G, n, x, s]
|
|
436
|
+
), pe = l(
|
|
441
437
|
(e) => {
|
|
442
438
|
if (n)
|
|
443
439
|
return;
|
|
444
|
-
const o =
|
|
445
|
-
|
|
440
|
+
const o = s?.type === f.Variable ? { from: s.from, to: s.to } : void 0;
|
|
441
|
+
W(e.name, o, !0), O(!1), d();
|
|
446
442
|
},
|
|
447
|
-
[n,
|
|
448
|
-
),
|
|
443
|
+
[n, W, s, d]
|
|
444
|
+
), ge = l(() => Je({
|
|
449
445
|
override: [
|
|
450
|
-
|
|
446
|
+
pt(oe, {
|
|
451
447
|
// divider: currentStrings.slashDivider,
|
|
452
448
|
// fixedText: currentStrings.slashFixedText,
|
|
453
|
-
image:
|
|
454
|
-
video:
|
|
455
|
-
variable:
|
|
449
|
+
image: E.slashImage,
|
|
450
|
+
video: E.slashVideo,
|
|
451
|
+
variable: E.slashVariable
|
|
456
452
|
})
|
|
457
453
|
]
|
|
458
454
|
}), [
|
|
459
455
|
// currentStrings.slashDivider,
|
|
460
456
|
// currentStrings.slashFixedText,
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
]),
|
|
457
|
+
E.slashImage,
|
|
458
|
+
E.slashVideo,
|
|
459
|
+
E.slashVariable,
|
|
460
|
+
oe
|
|
461
|
+
]), de = l(
|
|
466
462
|
(e) => {
|
|
467
|
-
if (i.current = e.view, h === "quickEdit" &&
|
|
463
|
+
if (i.current = e.view, h === "quickEdit" && q.current && e.selectionSet) {
|
|
468
464
|
const o = e.state.selection.main.head, r = e.state.doc.toString();
|
|
469
465
|
ke(
|
|
470
466
|
r,
|
|
471
467
|
o
|
|
472
|
-
) || (
|
|
468
|
+
) || (y(r), q.current = null);
|
|
473
469
|
}
|
|
474
470
|
},
|
|
475
|
-
[
|
|
476
|
-
),
|
|
471
|
+
[y, h]
|
|
472
|
+
), Ve = l(
|
|
477
473
|
(e) => {
|
|
478
474
|
if (e.stopPropagation(), n)
|
|
479
475
|
return;
|
|
480
|
-
const { type: o, from: r, to: t, dataset: c, target: u } = e.detail, p =
|
|
476
|
+
const { type: o, from: r, to: t, dataset: c, target: u } = e.detail, p = gt(o, c);
|
|
481
477
|
if (M({
|
|
482
478
|
type: o,
|
|
483
479
|
value: p,
|
|
484
480
|
from: r,
|
|
485
481
|
to: t
|
|
486
|
-
}),
|
|
482
|
+
}), L(o), o === f.Variable) {
|
|
487
483
|
if (u) {
|
|
488
|
-
const
|
|
484
|
+
const g = u.getBoundingClientRect(), I = u.ownerDocument.defaultView?.getComputedStyle(
|
|
489
485
|
H.current ?? u
|
|
490
486
|
).direction;
|
|
491
|
-
|
|
492
|
-
x: I === "rtl" ?
|
|
493
|
-
y:
|
|
487
|
+
z({
|
|
488
|
+
x: I === "rtl" ? g.right : g.left,
|
|
489
|
+
y: g.bottom
|
|
494
490
|
});
|
|
495
491
|
}
|
|
496
|
-
|
|
492
|
+
O(!0);
|
|
497
493
|
} else
|
|
498
494
|
T(!0);
|
|
499
495
|
},
|
|
500
496
|
[n]
|
|
501
497
|
);
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}, [
|
|
505
|
-
!
|
|
506
|
-
}, [
|
|
498
|
+
C(() => {
|
|
499
|
+
X || (L(f.Empty), M(null));
|
|
500
|
+
}, [X]), C(() => {
|
|
501
|
+
!Z && S === f.Variable && (L(f.Empty), M(null));
|
|
502
|
+
}, [Z, S]), C(() => {
|
|
507
503
|
const e = (o) => {
|
|
508
|
-
o.detail.view === i.current &&
|
|
504
|
+
o.detail.view === i.current && Ve(o);
|
|
509
505
|
};
|
|
510
506
|
return window.addEventListener("globalTagClick", e), () => {
|
|
511
507
|
window.removeEventListener("globalTagClick", e);
|
|
512
508
|
};
|
|
513
|
-
}, [
|
|
514
|
-
const be = a("imageDefaultTitle"),
|
|
515
|
-
() =>
|
|
509
|
+
}, [Ve]);
|
|
510
|
+
const be = a("imageDefaultTitle"), Ce = a("videoDefaultTitle"), Se = v(
|
|
511
|
+
() => bt.of({
|
|
516
512
|
image: be,
|
|
517
|
-
video:
|
|
513
|
+
video: Ce
|
|
518
514
|
}),
|
|
519
|
-
[be,
|
|
520
|
-
),
|
|
515
|
+
[be, Ce]
|
|
516
|
+
), We = v(() => {
|
|
521
517
|
const e = [
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
518
|
+
we.lineWrapping,
|
|
519
|
+
Xe(),
|
|
520
|
+
Ze(et),
|
|
525
521
|
St
|
|
526
522
|
];
|
|
527
|
-
return n || e.push(
|
|
528
|
-
|
|
523
|
+
return n || e.push(ge()), h === "quickEdit" && e.push(
|
|
524
|
+
Se,
|
|
529
525
|
dt,
|
|
530
526
|
Vt,
|
|
531
|
-
|
|
527
|
+
Ct
|
|
532
528
|
// fixedTextPlaceholderExtension,
|
|
533
529
|
// DividerPlaceholder,
|
|
534
530
|
), e.push(
|
|
535
|
-
|
|
536
|
-
|
|
531
|
+
we.updateListener.of((o) => {
|
|
532
|
+
de(o);
|
|
537
533
|
})
|
|
538
534
|
), e;
|
|
539
535
|
}, [
|
|
540
536
|
n,
|
|
541
537
|
h,
|
|
538
|
+
ge,
|
|
542
539
|
de,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
]), We = s(
|
|
540
|
+
Se
|
|
541
|
+
]), Ke = l(
|
|
546
542
|
(e) => {
|
|
547
543
|
if (n)
|
|
548
544
|
return;
|
|
@@ -550,34 +546,34 @@ const Te = [], ke = (C, h) => {
|
|
|
550
546
|
ke(
|
|
551
547
|
e,
|
|
552
548
|
o
|
|
553
|
-
) ?
|
|
549
|
+
) ? q.current = e : (q.current = null, y(e)), F?.(e);
|
|
554
550
|
},
|
|
555
|
-
[
|
|
556
|
-
),
|
|
551
|
+
[y, F, n]
|
|
552
|
+
), Ie = !n && te, P = v(
|
|
557
553
|
() => ({
|
|
558
|
-
insertTextAtCursor:
|
|
559
|
-
replaceSelection:
|
|
560
|
-
focus:
|
|
561
|
-
getContent:
|
|
562
|
-
setContent:
|
|
554
|
+
insertTextAtCursor: x,
|
|
555
|
+
replaceSelection: ue,
|
|
556
|
+
focus: me,
|
|
557
|
+
getContent: fe,
|
|
558
|
+
setContent: he
|
|
563
559
|
}),
|
|
564
|
-
[
|
|
565
|
-
), ve =
|
|
560
|
+
[me, fe, x, ue, he]
|
|
561
|
+
), ve = l(
|
|
566
562
|
(e) => {
|
|
567
|
-
n || "render" in e || e.onClick?.(
|
|
563
|
+
n || "render" in e || e.onClick?.(P);
|
|
568
564
|
},
|
|
569
|
-
[n,
|
|
570
|
-
),
|
|
565
|
+
[n, P]
|
|
566
|
+
), Qe = v(() => U?.length ? /* @__PURE__ */ m("div", { className: "markdown-flow-editor-toolbar-right", children: U.map((e) => {
|
|
571
567
|
if ("render" in e)
|
|
572
568
|
return /* @__PURE__ */ m(
|
|
573
569
|
"div",
|
|
574
570
|
{
|
|
575
571
|
className: "markdown-flow-editor-toolbar-right-item",
|
|
576
|
-
children: e.render(
|
|
572
|
+
children: e.render(P)
|
|
577
573
|
},
|
|
578
574
|
e.key
|
|
579
575
|
);
|
|
580
|
-
const o = e.label || e.tooltip || void 0, r = /* @__PURE__ */
|
|
576
|
+
const o = e.label || e.tooltip || void 0, r = /* @__PURE__ */ B(
|
|
581
577
|
"button",
|
|
582
578
|
{
|
|
583
579
|
type: "button",
|
|
@@ -592,14 +588,14 @@ const Te = [], ke = (C, h) => {
|
|
|
592
588
|
]
|
|
593
589
|
},
|
|
594
590
|
e.key
|
|
595
|
-
), t = e.tooltip ? /* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */ m(
|
|
591
|
+
), t = e.tooltip ? /* @__PURE__ */ B(tt, { children: [
|
|
592
|
+
/* @__PURE__ */ m(ot, { asChild: !0, children: r }),
|
|
597
593
|
/* @__PURE__ */ m(
|
|
598
|
-
|
|
594
|
+
nt,
|
|
599
595
|
{
|
|
600
596
|
side: "top",
|
|
601
|
-
dir:
|
|
602
|
-
lang:
|
|
597
|
+
dir: A,
|
|
598
|
+
lang: R,
|
|
603
599
|
children: e.tooltip
|
|
604
600
|
}
|
|
605
601
|
)
|
|
@@ -614,62 +610,62 @@ const Te = [], ke = (C, h) => {
|
|
|
614
610
|
);
|
|
615
611
|
}) }) : null, [
|
|
616
612
|
n,
|
|
617
|
-
|
|
613
|
+
P,
|
|
618
614
|
ve,
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
615
|
+
A,
|
|
616
|
+
R,
|
|
617
|
+
U
|
|
622
618
|
]);
|
|
623
|
-
return
|
|
624
|
-
xe?.(
|
|
625
|
-
}, [
|
|
619
|
+
return C(() => {
|
|
620
|
+
xe?.(P);
|
|
621
|
+
}, [P]), /* @__PURE__ */ B(
|
|
626
622
|
"div",
|
|
627
623
|
{
|
|
628
624
|
className: "markdown-flow-editor",
|
|
629
625
|
ref: H,
|
|
630
|
-
dir:
|
|
626
|
+
dir: ae,
|
|
631
627
|
lang: le,
|
|
632
628
|
"data-disabled": n ? "true" : void 0,
|
|
633
629
|
"aria-disabled": n,
|
|
634
630
|
children: [
|
|
635
631
|
/* @__PURE__ */ m(
|
|
636
|
-
|
|
632
|
+
at,
|
|
637
633
|
{
|
|
638
634
|
disabled: n,
|
|
639
|
-
labels:
|
|
640
|
-
tooltipDirection:
|
|
641
|
-
tooltipLanguage:
|
|
642
|
-
onSelect:
|
|
643
|
-
onInsertVariablePlaceholder:
|
|
644
|
-
onVariableSearchToggle:
|
|
645
|
-
onVariableSearchClose:
|
|
635
|
+
labels: b,
|
|
636
|
+
tooltipDirection: A,
|
|
637
|
+
tooltipLanguage: R,
|
|
638
|
+
onSelect: oe,
|
|
639
|
+
onInsertVariablePlaceholder: Me,
|
|
640
|
+
onVariableSearchToggle: Ae,
|
|
641
|
+
onVariableSearchClose: d,
|
|
646
642
|
onInsertConfirmOutput: Be,
|
|
647
643
|
onInsertLink: Fe,
|
|
648
|
-
onInsertButton:
|
|
649
|
-
onInsertSingleChoice:
|
|
650
|
-
onInsertMultiChoice:
|
|
651
|
-
onInsertInputField:
|
|
652
|
-
variableSearchActive:
|
|
653
|
-
rightSlot:
|
|
644
|
+
onInsertButton: je,
|
|
645
|
+
onInsertSingleChoice: He,
|
|
646
|
+
onInsertMultiChoice: $e,
|
|
647
|
+
onInsertInputField: qe,
|
|
648
|
+
variableSearchActive: Ie,
|
|
649
|
+
rightSlot: Qe
|
|
654
650
|
}
|
|
655
651
|
),
|
|
656
652
|
/* @__PURE__ */ m(
|
|
657
|
-
|
|
653
|
+
lt,
|
|
658
654
|
{
|
|
659
|
-
open:
|
|
660
|
-
anchorElement:
|
|
661
|
-
onClose:
|
|
662
|
-
onSelect:
|
|
663
|
-
variables:
|
|
664
|
-
systemVariables:
|
|
665
|
-
labels:
|
|
655
|
+
open: Ie,
|
|
656
|
+
anchorElement: _.current,
|
|
657
|
+
onClose: d,
|
|
658
|
+
onSelect: pe,
|
|
659
|
+
variables: se,
|
|
660
|
+
systemVariables: $,
|
|
661
|
+
labels: Pe
|
|
666
662
|
}
|
|
667
663
|
),
|
|
668
|
-
/* @__PURE__ */ m("div", { className: "markdown-flow-editor-body relative overflow-auto", children: /* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ m("div", { className: "markdown-flow-editor-body relative overflow-auto", children: /* @__PURE__ */ B(st.Provider, { value: ze, children: [
|
|
669
665
|
/* @__PURE__ */ m(
|
|
670
|
-
|
|
666
|
+
Ye,
|
|
671
667
|
{
|
|
672
|
-
extensions:
|
|
668
|
+
extensions: We,
|
|
673
669
|
basicSetup: {
|
|
674
670
|
lineNumbers: !1,
|
|
675
671
|
searchKeymap: !1,
|
|
@@ -679,55 +675,55 @@ const Te = [], ke = (C, h) => {
|
|
|
679
675
|
foldGutter: !1
|
|
680
676
|
},
|
|
681
677
|
className: "rounded-md",
|
|
682
|
-
placeholder:
|
|
683
|
-
value:
|
|
678
|
+
placeholder: Ne,
|
|
679
|
+
value: V,
|
|
684
680
|
theme: "light",
|
|
685
681
|
minHeight: "2rem",
|
|
686
682
|
editable: !n,
|
|
687
|
-
onChange:
|
|
688
|
-
onBlur:
|
|
683
|
+
onChange: Ke,
|
|
684
|
+
onBlur: Ee
|
|
689
685
|
}
|
|
690
686
|
),
|
|
691
|
-
!n && /* @__PURE__ */
|
|
692
|
-
|
|
687
|
+
!n && /* @__PURE__ */ B(
|
|
688
|
+
rt,
|
|
693
689
|
{
|
|
694
|
-
dir:
|
|
695
|
-
lang:
|
|
690
|
+
dir: A,
|
|
691
|
+
lang: R,
|
|
696
692
|
labels: {
|
|
697
693
|
closeButtonLabel: a("dialogCloseLabel"),
|
|
698
694
|
title: S === f.Image ? a("dialogTitleImage") : S === f.Video ? a("dialogTitleVideo") : S === f.Variable ? a("dialogTitleVariable") : a("dialogTitle")
|
|
699
695
|
},
|
|
700
696
|
children: [
|
|
701
697
|
S === f.Image && /* @__PURE__ */ m(
|
|
702
|
-
|
|
698
|
+
ct,
|
|
703
699
|
{
|
|
704
|
-
value:
|
|
705
|
-
onSelect:
|
|
706
|
-
uploadProps:
|
|
700
|
+
value: s?.value,
|
|
701
|
+
onSelect: _e,
|
|
702
|
+
uploadProps: ye
|
|
707
703
|
}
|
|
708
704
|
),
|
|
709
705
|
S === f.Video && /* @__PURE__ */ m(
|
|
710
|
-
|
|
706
|
+
ut,
|
|
711
707
|
{
|
|
712
|
-
value:
|
|
713
|
-
onSelect:
|
|
708
|
+
value: s?.value,
|
|
709
|
+
onSelect: Ge
|
|
714
710
|
}
|
|
715
711
|
)
|
|
716
712
|
]
|
|
717
713
|
}
|
|
718
714
|
),
|
|
719
|
-
!n && /* @__PURE__ */ m(
|
|
720
|
-
|
|
715
|
+
!n && /* @__PURE__ */ m(it, { dir: A, lang: R, children: /* @__PURE__ */ m(
|
|
716
|
+
mt,
|
|
721
717
|
{
|
|
722
|
-
variables:
|
|
723
|
-
systemVariables:
|
|
724
|
-
selectedName:
|
|
725
|
-
onSelect:
|
|
718
|
+
variables: se,
|
|
719
|
+
systemVariables: $,
|
|
720
|
+
selectedName: s?.value?.variableName,
|
|
721
|
+
onSelect: pe,
|
|
726
722
|
onAddVariable: (e) => {
|
|
727
|
-
|
|
728
|
-
const r = e.name
|
|
723
|
+
ee((o) => {
|
|
724
|
+
const r = e.name;
|
|
729
725
|
return o.some(
|
|
730
|
-
(c) => c.name
|
|
726
|
+
(c) => c.name === r
|
|
731
727
|
) ? o : [e, ...o];
|
|
732
728
|
});
|
|
733
729
|
}
|