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