markdown-flow-ui 0.2.35 → 0.3.0-dev.1

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