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