markdown-flow-ui 0.3.1 → 0.3.2-dev.2

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