markdown-flow-ui 0.2.14 → 0.2.16-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 (465) hide show
  1. package/README.md +7 -0
  2. package/dist/assets/markdown-flow-ui.css +10 -1
  3. package/dist/components/ContentRender/CodeBlock.cjs +1 -1
  4. package/dist/components/ContentRender/CodeBlock.cjs.map +1 -1
  5. package/dist/components/ContentRender/CodeBlock.d.ts +5 -0
  6. package/dist/components/ContentRender/CodeBlock.es.js +41 -38
  7. package/dist/components/ContentRender/CodeBlock.es.js.map +1 -1
  8. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  9. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  10. package/dist/components/ContentRender/ContentRender.d.ts +12 -4
  11. package/dist/components/ContentRender/ContentRender.es.js +436 -306
  12. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  13. package/dist/components/ContentRender/IframeSandbox.cjs +7 -7
  14. package/dist/components/ContentRender/IframeSandbox.cjs.map +1 -1
  15. package/dist/components/ContentRender/IframeSandbox.d.ts +5 -1
  16. package/dist/components/ContentRender/IframeSandbox.es.js +311 -266
  17. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  18. package/dist/components/ContentRender/MarkdownFlowInput.cjs +1 -1
  19. package/dist/components/ContentRender/MarkdownFlowInput.cjs.map +1 -1
  20. package/dist/components/ContentRender/MarkdownFlowInput.d.ts +5 -1
  21. package/dist/components/ContentRender/MarkdownFlowInput.es.js +37 -32
  22. package/dist/components/ContentRender/MarkdownFlowInput.es.js.map +1 -1
  23. package/dist/components/ContentRender/SandboxApp.cjs +2 -2
  24. package/dist/components/ContentRender/SandboxApp.cjs.map +1 -1
  25. package/dist/components/ContentRender/SandboxApp.d.ts +5 -1
  26. package/dist/components/ContentRender/SandboxApp.es.js +108 -103
  27. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  28. package/dist/components/ContentRender/blackboard-vendor.d.ts +1 -1
  29. package/dist/components/ContentRender/contentRenderI18n.cjs +1 -1
  30. package/dist/components/ContentRender/contentRenderI18n.cjs.map +1 -1
  31. package/dist/components/ContentRender/contentRenderI18n.d.ts +6 -1
  32. package/dist/components/ContentRender/contentRenderI18n.es.js +5 -56
  33. package/dist/components/ContentRender/contentRenderI18n.es.js.map +1 -1
  34. package/dist/components/ContentRender/contentRenderI18n.test.d.ts +1 -0
  35. package/dist/components/ContentRender/index.cjs +1 -1
  36. package/dist/components/ContentRender/index.d.ts +11 -11
  37. package/dist/components/ContentRender/index.es.js +1 -2
  38. package/dist/components/ContentRender/index.es.js.map +1 -1
  39. package/dist/components/ContentRender/locales/contentRender.json.cjs +2 -0
  40. package/dist/components/ContentRender/locales/contentRender.json.cjs.map +1 -0
  41. package/dist/components/ContentRender/locales/contentRender.json.d.ts +90 -0
  42. package/dist/components/ContentRender/locales/contentRender.json.es.js +11 -0
  43. package/dist/components/ContentRender/locales/contentRender.json.es.js.map +1 -0
  44. package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
  45. package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
  46. package/dist/components/ContentRender/plugins/CustomVariable.d.ts +7 -3
  47. package/dist/components/ContentRender/plugins/CustomVariable.es.js +165 -151
  48. package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
  49. package/dist/components/ContentRender/plugins/MermaidChart.cjs +1 -1
  50. package/dist/components/ContentRender/plugins/MermaidChart.cjs.map +1 -1
  51. package/dist/components/ContentRender/plugins/MermaidChart.d.ts +1 -0
  52. package/dist/components/ContentRender/plugins/MermaidChart.es.js +68 -44
  53. package/dist/components/ContentRender/plugins/MermaidChart.es.js.map +1 -1
  54. package/dist/components/ContentRender/typewriterPacing.fixtures.d.ts +14 -0
  55. package/dist/components/ContentRender/utils/typewriter-pacing.cjs +3 -0
  56. package/dist/components/ContentRender/utils/typewriter-pacing.cjs.map +1 -0
  57. package/dist/components/ContentRender/utils/typewriter-pacing.d.ts +27 -0
  58. package/dist/components/ContentRender/utils/typewriter-pacing.es.js +98 -0
  59. package/dist/components/ContentRender/utils/typewriter-pacing.es.js.map +1 -0
  60. package/dist/components/ContentRender/utils/typewriter-pacing.test.d.ts +1 -0
  61. package/dist/components/MarkdownFlow/MarkdownFlow.cjs +1 -1
  62. package/dist/components/MarkdownFlow/MarkdownFlow.cjs.map +1 -1
  63. package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +12 -4
  64. package/dist/components/MarkdownFlow/MarkdownFlow.es.js +51 -39
  65. package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
  66. package/dist/components/MarkdownFlow/ScrollToBottomButton.cjs +1 -1
  67. package/dist/components/MarkdownFlow/ScrollToBottomButton.cjs.map +1 -1
  68. package/dist/components/MarkdownFlow/ScrollToBottomButton.d.ts +31 -1
  69. package/dist/components/MarkdownFlow/ScrollToBottomButton.es.js +46 -17
  70. package/dist/components/MarkdownFlow/ScrollToBottomButton.es.js.map +1 -1
  71. package/dist/components/MarkdownFlow/ScrollToBottomControl.cjs +2 -0
  72. package/dist/components/MarkdownFlow/ScrollToBottomControl.cjs.map +1 -0
  73. package/dist/components/MarkdownFlow/ScrollToBottomControl.d.ts +18 -0
  74. package/dist/components/MarkdownFlow/ScrollToBottomControl.es.js +47 -0
  75. package/dist/components/MarkdownFlow/ScrollToBottomControl.es.js.map +1 -0
  76. package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.cjs +1 -1
  77. package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.cjs.map +1 -1
  78. package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.d.ts +1 -1
  79. package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.es.js +33 -52
  80. package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.es.js.map +1 -1
  81. package/dist/components/MarkdownFlow/index.cjs +1 -1
  82. package/dist/components/MarkdownFlow/index.d.ts +9 -6
  83. package/dist/components/MarkdownFlow/index.es.js +6 -6
  84. package/dist/components/MarkdownFlow/index.es.js.map +1 -1
  85. package/dist/components/MarkdownFlow/useScrollToBottom.cjs +1 -1
  86. package/dist/components/MarkdownFlow/useScrollToBottom.cjs.map +1 -1
  87. package/dist/components/MarkdownFlow/useScrollToBottom.d.ts +40 -8
  88. package/dist/components/MarkdownFlow/useScrollToBottom.es.js +352 -83
  89. package/dist/components/MarkdownFlow/useScrollToBottom.es.js.map +1 -1
  90. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs +1 -1
  91. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs.map +1 -1
  92. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.d.ts +5 -3
  93. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +371 -324
  94. package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +1 -1
  95. package/dist/components/MarkdownFlowEditor/components/CustomDialog.cjs +1 -1
  96. package/dist/components/MarkdownFlowEditor/components/CustomDialog.cjs.map +1 -1
  97. package/dist/components/MarkdownFlowEditor/components/CustomDialog.d.ts +10 -0
  98. package/dist/components/MarkdownFlowEditor/components/CustomDialog.es.js +22 -19
  99. package/dist/components/MarkdownFlowEditor/components/CustomDialog.es.js.map +1 -1
  100. package/dist/components/MarkdownFlowEditor/components/CustomPopover.cjs +1 -1
  101. package/dist/components/MarkdownFlowEditor/components/CustomPopover.cjs.map +1 -1
  102. package/dist/components/MarkdownFlowEditor/components/CustomPopover.d.ts +8 -0
  103. package/dist/components/MarkdownFlowEditor/components/CustomPopover.es.js +19 -15
  104. package/dist/components/MarkdownFlowEditor/components/CustomPopover.es.js.map +1 -1
  105. package/dist/components/MarkdownFlowEditor/components/EditorToolbar.cjs +1 -1
  106. package/dist/components/MarkdownFlowEditor/components/EditorToolbar.cjs.map +1 -1
  107. package/dist/components/MarkdownFlowEditor/components/EditorToolbar.d.ts +4 -1
  108. package/dist/components/MarkdownFlowEditor/components/EditorToolbar.es.js +99 -93
  109. package/dist/components/MarkdownFlowEditor/components/EditorToolbar.es.js.map +1 -1
  110. package/dist/components/MarkdownFlowEditor/components/ImageInject.cjs +1 -1
  111. package/dist/components/MarkdownFlowEditor/components/ImageInject.cjs.map +1 -1
  112. package/dist/components/MarkdownFlowEditor/components/ImageInject.d.ts +1 -1
  113. package/dist/components/MarkdownFlowEditor/components/ImageInject.es.js +183 -182
  114. package/dist/components/MarkdownFlowEditor/components/ImageInject.es.js.map +1 -1
  115. package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.cjs +1 -1
  116. package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.cjs.map +1 -1
  117. package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.d.ts +1 -1
  118. package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.es.js +107 -103
  119. package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.es.js.map +1 -1
  120. package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs +1 -1
  121. package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs.map +1 -1
  122. package/dist/components/MarkdownFlowEditor/components/VariableSelect.d.ts +1 -1
  123. package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js +106 -106
  124. package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js.map +1 -1
  125. package/dist/components/MarkdownFlowEditor/components/VideoInject.cjs +1 -1
  126. package/dist/components/MarkdownFlowEditor/components/VideoInject.cjs.map +1 -1
  127. package/dist/components/MarkdownFlowEditor/components/VideoInject.es.js +64 -63
  128. package/dist/components/MarkdownFlowEditor/components/VideoInject.es.js.map +1 -1
  129. package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.cjs +1 -1
  130. package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.cjs.map +1 -1
  131. package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.es.js +13 -13
  132. package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.es.js.map +1 -1
  133. package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.cjs +1 -1
  134. package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.cjs.map +1 -1
  135. package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.es.js +12 -12
  136. package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.es.js.map +1 -1
  137. package/dist/components/MarkdownFlowEditor/editor-context.d.ts +1 -1
  138. package/dist/components/MarkdownFlowEditor/editorI18n.cjs +1 -1
  139. package/dist/components/MarkdownFlowEditor/editorI18n.cjs.map +1 -1
  140. package/dist/components/MarkdownFlowEditor/editorI18n.d.ts +290 -0
  141. package/dist/components/MarkdownFlowEditor/editorI18n.es.js +12 -8
  142. package/dist/components/MarkdownFlowEditor/editorI18n.es.js.map +1 -1
  143. package/dist/components/MarkdownFlowEditor/editorI18n.test.d.ts +1 -0
  144. package/dist/components/MarkdownFlowEditor/index.d.ts +6 -6
  145. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +2 -0
  146. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs.map +1 -0
  147. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +72 -0
  148. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +140 -0
  149. package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js.map +1 -0
  150. package/dist/components/MarkdownFlowEditor/locales/en-US.json.cjs +1 -1
  151. package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +2 -0
  152. package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +118 -114
  153. package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js.map +1 -1
  154. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.cjs +1 -1
  155. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.d.ts +2 -0
  156. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +118 -114
  157. package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js.map +1 -1
  158. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs +2 -0
  159. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs.map +1 -0
  160. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.d.ts +72 -0
  161. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +140 -0
  162. package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js.map +1 -0
  163. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.cjs +1 -1
  164. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +2 -0
  165. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +70 -66
  166. package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js.map +1 -1
  167. package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.cjs +1 -1
  168. package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.cjs.map +1 -1
  169. package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.es.js +40 -35
  170. package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.es.js.map +1 -1
  171. package/dist/components/MarkdownFlowEditor/plugins/PlaceholderWidget.d.ts +1 -1
  172. package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.cjs +1 -1
  173. package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.cjs.map +1 -1
  174. package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.es.js +27 -23
  175. package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.es.js.map +1 -1
  176. package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.cjs +2 -0
  177. package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.cjs.map +1 -0
  178. package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.d.ts +7 -0
  179. package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.es.js +12 -0
  180. package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.es.js.map +1 -0
  181. package/dist/components/MarkdownFlowEditor/utils.d.ts +1 -1
  182. package/dist/components/Slide/MarkdownSlideScaling.cjs +1 -1
  183. package/dist/components/Slide/MarkdownSlideScaling.cjs.map +1 -1
  184. package/dist/components/Slide/MarkdownSlideScaling.d.ts +1 -1
  185. package/dist/components/Slide/MarkdownSlideScaling.es.js +20 -20
  186. package/dist/components/Slide/MarkdownSlideScaling.es.js.map +1 -1
  187. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs +1 -1
  188. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.map +1 -1
  189. package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +7 -2
  190. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +61 -57
  191. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
  192. package/dist/components/Slide/Player.cjs +1 -1
  193. package/dist/components/Slide/Player.cjs.map +1 -1
  194. package/dist/components/Slide/Player.d.ts +6 -6
  195. package/dist/components/Slide/Player.es.js +547 -541
  196. package/dist/components/Slide/Player.es.js.map +1 -1
  197. package/dist/components/Slide/Slide.cjs +1 -1
  198. package/dist/components/Slide/Slide.cjs.map +1 -1
  199. package/dist/components/Slide/Slide.d.ts +14 -12
  200. package/dist/components/Slide/Slide.es.js +745 -726
  201. package/dist/components/Slide/Slide.es.js.map +1 -1
  202. package/dist/components/Slide/SubtitleOverlay.cjs +1 -1
  203. package/dist/components/Slide/SubtitleOverlay.cjs.map +1 -1
  204. package/dist/components/Slide/SubtitleOverlay.d.ts +2 -2
  205. package/dist/components/Slide/SubtitleOverlay.es.js +17 -17
  206. package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
  207. package/dist/components/Slide/diff-utils.d.ts +1 -1
  208. package/dist/components/Slide/index.d.ts +12 -12
  209. package/dist/components/Slide/locales/slide.json.cjs +2 -0
  210. package/dist/components/Slide/locales/slide.json.cjs.map +1 -0
  211. package/dist/components/Slide/locales/slide.json.d.ts +205 -0
  212. package/dist/components/Slide/locales/slide.json.es.js +11 -0
  213. package/dist/components/Slide/locales/slide.json.es.js.map +1 -0
  214. package/dist/components/Slide/slideI18n.cjs +1 -1
  215. package/dist/components/Slide/slideI18n.cjs.map +1 -1
  216. package/dist/components/Slide/slideI18n.d.ts +6 -3
  217. package/dist/components/Slide/slideI18n.es.js +10 -155
  218. package/dist/components/Slide/slideI18n.es.js.map +1 -1
  219. package/dist/components/Slide/useSlide.d.ts +1 -1
  220. package/dist/components/Slide/utils/appendedMarkerAdvance.d.ts +1 -1
  221. package/dist/components/Slide/utils/audioSegments.d.ts +1 -1
  222. package/dist/components/Slide/utils/interactionResolution.d.ts +2 -2
  223. package/dist/components/Slide/utils/listenModeElementList.d.ts +2 -2
  224. package/dist/components/Slide/utils/markdownScaling.d.ts +1 -1
  225. package/dist/components/Slide/utils/playerCustomActions.d.ts +2 -2
  226. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
  227. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
  228. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
  229. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +20 -20
  230. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
  231. package/dist/components/Slide/utils/runStreamFixture.d.ts +1 -1
  232. package/dist/components/Slide/utils/segmentSeek.d.ts +1 -1
  233. package/dist/components/Slide/utils/silentStepAutoAdvance.d.ts +1 -1
  234. package/dist/components/Slide/utils/streamingNavigation.d.ts +1 -1
  235. package/dist/components/Slide/utils/subtitleCue.d.ts +1 -1
  236. package/dist/components/Slide/utils/subtitleJumpNavigation.d.ts +1 -1
  237. package/dist/components/index.d.ts +22 -18
  238. package/dist/components/ui/button.cjs +1 -1
  239. package/dist/components/ui/button.cjs.map +1 -1
  240. package/dist/components/ui/button.es.js +12 -13
  241. package/dist/components/ui/button.es.js.map +1 -1
  242. package/dist/components/ui/checkbox.cjs +1 -1
  243. package/dist/components/ui/checkbox.cjs.map +1 -1
  244. package/dist/components/ui/checkbox.es.js +35 -35
  245. package/dist/components/ui/checkbox.es.js.map +1 -1
  246. package/dist/components/ui/dialog.cjs +1 -1
  247. package/dist/components/ui/dialog.cjs.map +1 -1
  248. package/dist/components/ui/dialog.d.ts +5 -1
  249. package/dist/components/ui/dialog.es.js +37 -37
  250. package/dist/components/ui/dialog.es.js.map +1 -1
  251. package/dist/components/ui/input.cjs +1 -1
  252. package/dist/components/ui/input.cjs.map +1 -1
  253. package/dist/components/ui/input.es.js +4 -4
  254. package/dist/components/ui/input.es.js.map +1 -1
  255. package/dist/components/ui/inputGroup/button.cjs +1 -1
  256. package/dist/components/ui/inputGroup/button.cjs.map +1 -1
  257. package/dist/components/ui/inputGroup/button.es.js +9 -10
  258. package/dist/components/ui/inputGroup/button.es.js.map +1 -1
  259. package/dist/components/ui/inputGroup/input-group.cjs +1 -1
  260. package/dist/components/ui/inputGroup/input-group.cjs.map +1 -1
  261. package/dist/components/ui/inputGroup/input-group.d.ts +1 -1
  262. package/dist/components/ui/inputGroup/input-group.es.js +10 -10
  263. package/dist/components/ui/inputGroup/input-group.es.js.map +1 -1
  264. package/dist/components/ui/inputGroup/textarea.cjs +1 -1
  265. package/dist/components/ui/inputGroup/textarea.cjs.map +1 -1
  266. package/dist/components/ui/inputGroup/textarea.es.js +2 -2
  267. package/dist/components/ui/inputGroup/textarea.es.js.map +1 -1
  268. package/dist/components/ui/loading-overlay-card.cjs +2 -2
  269. package/dist/components/ui/loading-overlay-card.cjs.map +1 -1
  270. package/dist/components/ui/loading-overlay-card.es.js +11 -11
  271. package/dist/components/ui/loading-overlay-card.es.js.map +1 -1
  272. package/dist/components/ui/popover.cjs +1 -1
  273. package/dist/components/ui/popover.cjs.map +1 -1
  274. package/dist/components/ui/popover.es.js +6 -6
  275. package/dist/components/ui/popover.es.js.map +1 -1
  276. package/dist/components/ui/tooltip.cjs +1 -1
  277. package/dist/components/ui/tooltip.cjs.map +1 -1
  278. package/dist/components/ui/tooltip.es.js +16 -16
  279. package/dist/components/ui/tooltip.es.js.map +1 -1
  280. package/dist/editor.d.ts +2 -2
  281. package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  282. package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  283. package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  284. package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  285. package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  286. package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  287. package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  288. package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  289. package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  290. package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  291. package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  292. package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  293. package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  294. package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  295. package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  296. package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  297. package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  298. package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  299. package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  300. package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  301. package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  302. package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  303. package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  304. package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  305. package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  306. package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  307. package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  308. package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  309. package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  310. package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  311. package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  312. package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  313. package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  314. package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  315. package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  316. package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  317. package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  318. package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  319. package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  320. package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  321. package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  322. package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  323. package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  324. package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  325. package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  326. package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  327. package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  328. package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  329. package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  330. package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  331. package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  332. package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  333. package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  334. package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  335. package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  336. package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  337. package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  338. package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  339. package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  340. package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  341. package/dist/index.cjs +1 -1
  342. package/dist/index.d.ts +2 -2
  343. package/dist/index.es.js +22 -19
  344. package/dist/index.es.js.map +1 -1
  345. package/dist/lib/locale.cjs +1 -1
  346. package/dist/lib/locale.cjs.map +1 -1
  347. package/dist/lib/locale.d.ts +5 -1
  348. package/dist/lib/locale.es.js +26 -13
  349. package/dist/lib/locale.es.js.map +1 -1
  350. package/dist/lib/locale.test.d.ts +1 -0
  351. package/dist/lib/useDetachedLanguage.cjs +2 -0
  352. package/dist/lib/useDetachedLanguage.cjs.map +1 -0
  353. package/dist/lib/useDetachedLanguage.d.ts +3 -0
  354. package/dist/lib/useDetachedLanguage.es.js +25 -0
  355. package/dist/lib/useDetachedLanguage.es.js.map +1 -0
  356. package/dist/lib/useResolvedDirection.cjs +2 -0
  357. package/dist/lib/useResolvedDirection.cjs.map +1 -0
  358. package/dist/lib/useResolvedDirection.d.ts +6 -0
  359. package/dist/lib/useResolvedDirection.es.js +37 -0
  360. package/dist/lib/useResolvedDirection.es.js.map +1 -0
  361. package/dist/markdown-flow-ui-lib.css +1 -1
  362. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs +1 -1
  363. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -1
  364. package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js +6 -6
  365. package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -1
  366. package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +1 -1
  367. package/dist/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
  368. package/dist/node_modules/@radix-ui/react-context/dist/index.es.js +21 -21
  369. package/dist/node_modules/@radix-ui/react-context/dist/index.es.js.map +1 -1
  370. package/dist/node_modules/@radix-ui/react-dialog/dist/index.cjs +2 -2
  371. package/dist/node_modules/@radix-ui/react-dialog/dist/index.cjs.map +1 -1
  372. package/dist/node_modules/@radix-ui/react-dialog/dist/index.es.js +100 -100
  373. package/dist/node_modules/@radix-ui/react-dialog/dist/index.es.js.map +1 -1
  374. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +1 -1
  375. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +1 -1
  376. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +38 -38
  377. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +1 -1
  378. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -1
  379. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
  380. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +9 -9
  381. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
  382. package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs +1 -1
  383. package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs.map +1 -1
  384. package/dist/node_modules/@radix-ui/react-popover/dist/index.es.js +95 -95
  385. package/dist/node_modules/@radix-ui/react-popover/dist/index.es.js.map +1 -1
  386. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +1 -1
  387. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -1
  388. package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js +48 -48
  389. package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -1
  390. package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs +1 -1
  391. package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs.map +1 -1
  392. package/dist/node_modules/@radix-ui/react-portal/dist/index.es.js +6 -6
  393. package/dist/node_modules/@radix-ui/react-portal/dist/index.es.js.map +1 -1
  394. package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +1 -1
  395. package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
  396. package/dist/node_modules/@radix-ui/react-primitive/dist/index.es.js +9 -9
  397. package/dist/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +1 -1
  398. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
  399. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
  400. package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +17 -17
  401. package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
  402. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +1 -1
  403. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs.map +1 -1
  404. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js +100 -100
  405. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js.map +1 -1
  406. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
  407. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs.map +1 -1
  408. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +6 -6
  409. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js.map +1 -1
  410. package/dist/node_modules/@uiw/react-codemirror/esm/index.cjs +1 -1
  411. package/dist/node_modules/@uiw/react-codemirror/esm/index.cjs.map +1 -1
  412. package/dist/node_modules/@uiw/react-codemirror/esm/index.es.js +27 -27
  413. package/dist/node_modules/@uiw/react-codemirror/esm/index.es.js.map +1 -1
  414. package/dist/node_modules/lucide-react/dist/esm/icons/{chevron-down.cjs → chevrons-down.cjs} +2 -2
  415. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -0
  416. package/dist/node_modules/lucide-react/dist/esm/icons/{chevron-down.es.js → chevrons-down.es.js} +6 -3
  417. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -0
  418. package/dist/node_modules/react-markdown/lib/index.cjs +1 -1
  419. package/dist/node_modules/react-markdown/lib/index.cjs.map +1 -1
  420. package/dist/node_modules/react-markdown/lib/index.es.js +39 -39
  421. package/dist/node_modules/react-markdown/lib/index.es.js.map +1 -1
  422. package/dist/renderer.cjs +1 -1
  423. package/dist/renderer.d.ts +18 -17
  424. package/dist/renderer.es.js +20 -17
  425. package/dist/renderer.es.js.map +1 -1
  426. package/dist/scroll.cjs +1 -1
  427. package/dist/scroll.d.ts +6 -3
  428. package/dist/scroll.es.js +4 -2
  429. package/dist/scroll.es.js.map +1 -1
  430. package/dist/slide.d.ts +3 -3
  431. package/package.json +5 -2
  432. package/dist/_virtual/jsx-runtime.cjs +0 -2
  433. package/dist/_virtual/jsx-runtime.cjs.map +0 -1
  434. package/dist/_virtual/jsx-runtime.es.js +0 -6
  435. package/dist/_virtual/jsx-runtime.es.js.map +0 -1
  436. package/dist/_virtual/jsx-runtime.es2.js +0 -5
  437. package/dist/_virtual/jsx-runtime.es2.js.map +0 -1
  438. package/dist/_virtual/jsx-runtime2.cjs +0 -2
  439. package/dist/_virtual/jsx-runtime2.cjs.map +0 -1
  440. package/dist/_virtual/react-jsx-runtime.development.cjs +0 -2
  441. package/dist/_virtual/react-jsx-runtime.development.cjs.map +0 -1
  442. package/dist/_virtual/react-jsx-runtime.development.es.js +0 -5
  443. package/dist/_virtual/react-jsx-runtime.development.es.js.map +0 -1
  444. package/dist/_virtual/react-jsx-runtime.production.cjs +0 -2
  445. package/dist/_virtual/react-jsx-runtime.production.cjs.map +0 -1
  446. package/dist/_virtual/react-jsx-runtime.production.es.js +0 -5
  447. package/dist/_virtual/react-jsx-runtime.production.es.js.map +0 -1
  448. package/dist/lib/localeTextMap.cjs +0 -2
  449. package/dist/lib/localeTextMap.cjs.map +0 -1
  450. package/dist/lib/localeTextMap.es.js +0 -5
  451. package/dist/lib/localeTextMap.es.js.map +0 -1
  452. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs.map +0 -1
  453. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.es.js.map +0 -1
  454. package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +0 -24
  455. package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.map +0 -1
  456. package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +0 -409
  457. package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js.map +0 -1
  458. package/dist/node_modules/react/cjs/react-jsx-runtime.production.cjs +0 -10
  459. package/dist/node_modules/react/cjs/react-jsx-runtime.production.cjs.map +0 -1
  460. package/dist/node_modules/react/cjs/react-jsx-runtime.production.es.js +0 -36
  461. package/dist/node_modules/react/cjs/react-jsx-runtime.production.es.js.map +0 -1
  462. package/dist/node_modules/react/jsx-runtime.cjs +0 -2
  463. package/dist/node_modules/react/jsx-runtime.cjs.map +0 -1
  464. package/dist/node_modules/react/jsx-runtime.es.js +0 -11
  465. package/dist/node_modules/react/jsx-runtime.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownFlowEditor.es.js","sources":["../../../src/components/MarkdownFlowEditor/MarkdownFlowEditor.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useCallback, useRef, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { autocompletion } from \"@codemirror/autocomplete\";\nimport { EditorView, ViewUpdate } from \"@codemirror/view\";\nimport { markdown } from \"@codemirror/lang-markdown\";\nimport {\n syntaxHighlighting,\n defaultHighlightStyle,\n} from \"@codemirror/language\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../ui/tooltip\";\nimport CustomDialog from \"./components/CustomDialog\";\nimport CustomPopover from \"./components/CustomPopover\";\nimport EditorToolbar from \"./components/EditorToolbar\";\nimport VariableSearchDropdown from \"./components/VariableSearchDropdown\";\nimport EditorContext from \"./editor-context\";\nimport ImageInject from \"./components/ImageInject\";\nimport VideoInject from \"./components/VideoInject\";\nimport VariableSelect from \"./components/VariableSelect\";\nimport {\n SelectedOption,\n IEditorContext,\n Variable,\n SelectContentInfo,\n PopoverPosition,\n EditorAction,\n EditorApi,\n} from \"./types\";\nimport \"./markdownFlowEditor.css\";\n\nimport {\n createSlashCommands,\n parseContentInfo,\n getImageContentToInsert,\n getVideoContentToInsert,\n extractVariableNames,\n createVariableExpressionRegexp,\n} from \"./utils\";\nimport ImgPlaceholder from \"./plugins/ImgPlaceholder\";\nimport VideoPlaceholder from \"./plugins/VideoPlaceholder\";\nimport VariablePlaceholder from \"./plugins/VariablePlaceholder\";\nimport SyntaxHighlighter from \"./plugins/SyntaxHighlighter\";\n// import createFixedTextPlaceholder from \"./plugins/FixedTextPlaceholder\";\n// import DividerPlaceholder from \"./plugins/DividerPlaceholder\";\nimport { initReactI18next, useTranslation } from \"react-i18next\";\nimport i18next from \"i18next\";\nimport { UploadProps } from \"./uploadTypes\";\nimport {\n DEFAULT_EDITOR_LOCALE,\n editorLocaleResources,\n getEditorLocaleMessages,\n} from \"./editorI18n\";\nimport {\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\n\nif (!i18next.isInitialized) {\n i18next.use(initReactI18next).init({\n resources: editorLocaleResources,\n lng: DEFAULT_EDITOR_LOCALE,\n fallbackLng: DEFAULT_EDITOR_LOCALE,\n interpolation: { escapeValue: false },\n });\n} else {\n Object.entries(editorLocaleResources).forEach(([lng, resource]) => {\n i18next.addResourceBundle(\n lng,\n \"translation\",\n resource.translation,\n true,\n true\n );\n });\n}\n\nexport enum EditMode {\n CodeEdit = \"codeEdit\",\n QuickEdit = \"quickEdit\",\n}\n\ntype EditorProps = {\n content?: string;\n editMode?: EditMode;\n variables?: Variable[];\n systemVariables?: Variable[];\n onChange?: (value: string) => void;\n onBlur?: () => void;\n locale?: MarkdownFlowLocale;\n uploadProps?: UploadProps;\n disabled?: boolean;\n toolbarActionsRight?: EditorAction[];\n onReady?: (api: EditorApi) => void;\n};\n\nconst EMPTY_VARIABLES: Variable[] = [];\n\n// Detect whether cursor is still inside a {{variable}} expression\nconst isCursorInsideVariableExpression = (\n content: string,\n cursorPosition: number\n) => {\n if (!content || cursorPosition < 0) {\n return false;\n }\n const regexp = createVariableExpressionRegexp();\n let match: RegExpExecArray | null;\n\n while ((match = regexp.exec(content)) !== null) {\n const matchStart = match.index ?? 0;\n const matchEnd = matchStart + match[0].length;\n const innerStart = matchStart + 2;\n const innerEnd = matchEnd - 2;\n if (cursorPosition >= innerStart && cursorPosition <= innerEnd) {\n return true;\n }\n if (regexp.lastIndex === match.index) {\n regexp.lastIndex++;\n }\n }\n\n return false;\n};\n\nconst buildVariableTemplate = (variableName = \"\") => `{{${variableName}}}`;\n\nconst Editor: React.FC<EditorProps> = ({\n content = \"\",\n editMode = EditMode.CodeEdit,\n variables: initialVariables,\n systemVariables: initialSystemVariables,\n onChange,\n onBlur,\n locale = DEFAULT_EDITOR_LOCALE,\n uploadProps,\n disabled = false,\n toolbarActionsRight,\n onReady,\n}) => {\n const { t, i18n } = useTranslation();\n const resolvedLocale = normalizeMarkdownFlowLocale(locale || i18n.language);\n\n useEffect(() => {\n if (i18n.language !== resolvedLocale) {\n i18n.changeLanguage(resolvedLocale);\n }\n }, [i18n, resolvedLocale]);\n\n const currentStrings = getEditorLocaleMessages(resolvedLocale);\n const toolbarLabels = useMemo(\n () => ({\n image: t(\"toolbarInsertImage\", {\n defaultValue: \"Insert image\",\n }),\n video: t(\"toolbarInsertVideo\", {\n defaultValue: \"Insert video\",\n }),\n variable: t(\"slashVariable\", {\n defaultValue: \"Variable\",\n }),\n addVariable: t(\"toolbarInsertNewVariable\", {\n defaultValue: \"Insert new variable\",\n }),\n search: t(\"toolbarInsertExistingVariable\", {\n defaultValue: \"Insert existing variable\",\n }),\n confirmOutput: t(\"toolbarConfirmOutput\", {\n defaultValue: \"Confirm output\",\n }),\n insertLink: t(\"toolbarInsertLink\", {\n defaultValue: \"Insert link\",\n }),\n insertButton: t(\"toolbarInsertButton\", {\n defaultValue: \"Insert button\",\n }),\n insertSingleChoice: t(\"toolbarInsertSingleChoice\", {\n defaultValue: \"Insert single choice\",\n }),\n insertMultiChoice: t(\"toolbarInsertMultiChoice\", {\n defaultValue: \"Insert multi choice\",\n }),\n insertInput: t(\"toolbarInsertInput\", {\n defaultValue: \"Insert input\",\n }),\n singleChoiceOption1: t(\"toolbarChoiceOption1\", {\n defaultValue: \"Option 1\",\n }),\n singleChoiceOption2: t(\"toolbarChoiceOption2\", {\n defaultValue: \"Option 2\",\n }),\n inputPlaceholder: t(\"toolbarInputPlaceholder\", {\n defaultValue: \"Please enter\",\n }),\n }),\n [t]\n );\n const variableSearchLabels = useMemo(\n () => ({\n searchPlaceholder: t(\"variableSearchPlaceholder\", {\n defaultValue: \"Search variable\",\n }),\n systemLabel: t(\"variableSectionSystem\", \"System Variables\"),\n customLabel: t(\"variableSectionCustom\", \"Custom Variables\"),\n emptyLabel: t(\"variableNotFound\", \"No variables found\"),\n }),\n [t]\n );\n const placeholderText =\n editMode === EditMode.QuickEdit\n ? t(\"placeholderQuickEdit\", {\n defaultValue: t(\"placeholderCodeEdit\", {\n defaultValue: t(\"placeholder\"),\n }),\n })\n : t(\"placeholderCodeEdit\", { defaultValue: t(\"placeholder\") });\n // Normalize variables to avoid duplicating system variables in the custom list\n const normalizedSystemVariables = useMemo(() => {\n const seen = new Set<string>();\n return (initialSystemVariables ?? EMPTY_VARIABLES).filter((variable) => {\n const normalized =\n typeof variable?.name === \"string\" ? variable.name.toLowerCase() : \"\";\n if (!normalized || seen.has(normalized)) {\n return false;\n }\n seen.add(normalized);\n return true;\n });\n }, [initialSystemVariables]);\n\n const normalizedCustomVariables = useMemo(() => {\n const systemNameSet = new Set(\n normalizedSystemVariables.map((variable) => variable.name.toLowerCase())\n );\n const seen = new Set<string>();\n return (initialVariables ?? EMPTY_VARIABLES).filter((variable) => {\n const normalized =\n typeof variable?.name === \"string\" ? variable.name.toLowerCase() : \"\";\n if (\n !normalized ||\n systemNameSet.has(normalized) ||\n seen.has(normalized)\n ) {\n return false;\n }\n seen.add(normalized);\n return true;\n });\n }, [initialVariables, normalizedSystemVariables]);\n\n const [dialogOpen, setDialogOpen] = useState(false);\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [popoverPosition, setPopoverPosition] =\n useState<PopoverPosition | null>(null);\n const [variables, setVariables] = useState<Variable[]>(\n normalizedCustomVariables\n );\n const [systemVariables, setSystemVariables] = useState<Variable[]>(\n normalizedSystemVariables\n );\n\n useEffect(() => {\n setVariables(normalizedCustomVariables);\n }, [normalizedCustomVariables]);\n\n useEffect(() => {\n setSystemVariables(normalizedSystemVariables);\n }, [normalizedSystemVariables]);\n\n const [selectedOption, setSelectedOption] = useState<SelectedOption>(\n SelectedOption.Empty\n );\n const [selectContentInfo, setSelectContentInfo] =\n useState<SelectContentInfo | null>();\n const editorViewRef = useRef<EditorView | null>(null);\n const pendingVariableContentRef = useRef<string | null>(null);\n const variableSearchAnchorRef = useRef<HTMLButtonElement | null>(null);\n const [variableSearchOpen, setVariableSearchOpen] = useState(false);\n const closeVariableSearch = useCallback(() => {\n setVariableSearchOpen(false);\n variableSearchAnchorRef.current = null;\n }, []);\n const handleVariableSearchToggle = useCallback(\n (button: HTMLButtonElement) => {\n if (disabled) {\n return;\n }\n if (variableSearchOpen && variableSearchAnchorRef.current === button) {\n closeVariableSearch();\n return;\n }\n variableSearchAnchorRef.current = button;\n setVariableSearchOpen(true);\n },\n [closeVariableSearch, disabled, variableSearchOpen]\n );\n\n const editorContextValue: IEditorContext = {\n selectedOption,\n setSelectedOption,\n dialogOpen,\n setDialogOpen,\n popoverOpen,\n setPopoverOpen,\n popoverPosition,\n setPopoverPosition,\n };\n\n useEffect(() => {\n if (!disabled) {\n return;\n }\n setDialogOpen(false);\n setPopoverOpen(false);\n setSelectedOption(SelectedOption.Empty);\n setSelectContentInfo(null);\n setPopoverPosition(null);\n closeVariableSearch();\n }, [\n closeVariableSearch,\n disabled,\n setDialogOpen,\n setPopoverOpen,\n setPopoverPosition,\n setSelectedOption,\n setSelectContentInfo,\n ]);\n\n const addVariablesFromContent = useCallback(\n (text: string) => {\n if (editMode !== EditMode.QuickEdit || !text) {\n return;\n }\n\n const names = extractVariableNames(text);\n if (!names.length) {\n return;\n }\n\n const systemNameSet = new Set(\n systemVariables.map((variable) => variable.name.toLowerCase())\n );\n\n setVariables((prev) => {\n const existingNames = new Set(\n prev.map((variable) => variable.name.toLowerCase())\n );\n const addedNames = new Set<string>();\n const newVariables: Variable[] = [];\n\n names.forEach((rawName) => {\n const normalized = rawName.toLowerCase();\n if (\n !rawName ||\n systemNameSet.has(normalized) ||\n existingNames.has(normalized) ||\n addedNames.has(normalized)\n ) {\n return;\n }\n newVariables.push({ name: rawName });\n addedNames.add(normalized);\n });\n\n if (!newVariables.length) {\n return prev;\n }\n\n return [...newVariables, ...prev];\n });\n },\n [editMode, systemVariables]\n );\n\n useEffect(() => {\n addVariablesFromContent(content);\n }, [content, addVariablesFromContent]);\n\n // const insertFixedText = useCallback(() => {\n // if (!editorViewRef.current) return;\n // const view = editorViewRef.current;\n // const { state, dispatch } = view;\n // const selection = state.selection.main;\n // const selectedText = state.sliceDoc(selection.from, selection.to);\n // const startTag = \"===\";\n // const endTag = \"===\";\n // const insertContent = `${startTag}${selectedText ?? \"\"}${endTag}`;\n\n // dispatch({\n // changes: {\n // from: selection.from,\n // to: selection.to,\n // insert: insertContent,\n // },\n // selection: {\n // anchor: selection.from + startTag.length + (selectedText?.length ?? 0),\n // },\n // });\n // view.focus();\n // }, []);\n\n // const insertDivider = useCallback(() => {\n // if (!editorViewRef.current) return;\n // const view = editorViewRef.current;\n // const { state, dispatch } = view;\n // const selection = state.selection.main;\n // const insertContent = `\\n\\n---\\n\\n`;\n\n // dispatch({\n // changes: {\n // from: selection.from,\n // to: selection.to,\n // insert: insertContent,\n // },\n // selection: {\n // anchor: selection.from + insertContent.length,\n // },\n // });\n // view.focus();\n // }, []);\n\n const onSelectedOption = useCallback(\n (option: SelectedOption) => {\n if (disabled) {\n return;\n }\n closeVariableSearch();\n // if (option === SelectedOption.FixedText) {\n // insertFixedText();\n // setSelectedOption(SelectedOption.Empty);\n // setDialogOpen(false);\n // setPopoverOpen(false);\n // setSelectContentInfo(null);\n // setPopoverPosition(null);\n // return;\n // }\n\n // if (option === SelectedOption.Divider) {\n // insertDivider();\n // setSelectedOption(SelectedOption.Empty);\n // setDialogOpen(false);\n // setPopoverOpen(false);\n // setSelectContentInfo(null);\n // setPopoverPosition(null);\n // return;\n // }\n\n setSelectedOption(option);\n\n if (option === SelectedOption.Variable) {\n if (editorViewRef.current) {\n const { state } = editorViewRef.current;\n const pos = state.selection.main.from;\n const coords = editorViewRef.current.coordsAtPos(pos);\n if (coords) {\n setPopoverPosition({\n x: coords.left,\n y: coords.bottom,\n });\n }\n }\n setPopoverOpen(true);\n } else {\n setDialogOpen(true);\n }\n },\n [closeVariableSearch, disabled]\n );\n\n const insertText = useCallback(\n (text: string) => {\n if (disabled || !editorViewRef.current) return;\n\n const { state, dispatch } = editorViewRef.current;\n const from = state.selection.main.from;\n\n dispatch({\n changes: { from, insert: text },\n selection: { anchor: from + text.length },\n });\n },\n [editorViewRef, disabled]\n );\n\n const replaceSelection = useCallback(\n (text: string) => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const { state, dispatch } = editorViewRef.current;\n const selection = state.selection.main;\n dispatch({\n changes: { from: selection.from, to: selection.to, insert: text },\n selection: { anchor: selection.from + text.length },\n });\n },\n [disabled]\n );\n\n const focusEditor = useCallback(() => {\n editorViewRef.current?.focus();\n }, []);\n\n const getContent = useCallback(() => {\n return editorViewRef.current?.state.doc.toString() ?? \"\";\n }, []);\n\n const setContent = useCallback(\n (text: string) => {\n if (disabled) {\n return;\n }\n if (!editorViewRef.current) {\n onChange?.(text);\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n dispatch({\n changes: { from: 0, to: state.doc.length, insert: text },\n selection: { anchor: text.length },\n });\n },\n [disabled, onChange]\n );\n\n const deleteSelectedContent = useCallback(() => {\n if (disabled) {\n return;\n }\n if (\n !selectContentInfo ||\n !editorViewRef.current ||\n selectContentInfo.from === -1\n )\n return;\n\n const { from, to } = selectContentInfo;\n const { dispatch } = editorViewRef.current;\n\n dispatch({\n changes: { from, to, insert: \"\" },\n });\n }, [selectContentInfo, editorViewRef, disabled]);\n\n const insertVariableContent = useCallback(\n (\n variableName: string,\n range?: { from: number; to: number },\n placeCursorAtEnd = false\n ) => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = range ?? state.selection.main;\n const template = buildVariableTemplate(variableName);\n const cursorOffset = placeCursorAtEnd\n ? template.length\n : 2 + variableName.length; // 2 braces before variable content\n\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + cursorOffset,\n },\n });\n view.focus();\n },\n [disabled]\n );\n\n const insertVariableTemplate = useCallback(() => {\n if (disabled) {\n return;\n }\n closeVariableSearch();\n insertVariableContent(\"\");\n }, [closeVariableSearch, disabled, insertVariableContent]);\n\n const insertConfirmOutputMarker = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const template = \"======\";\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 3,\n },\n });\n view.focus();\n }, [disabled]);\n\n const insertLinkTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const template = \"[]()\";\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 1,\n },\n });\n view.focus();\n }, [disabled]);\n\n const insertButtonTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const template = \"?[]\";\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 2,\n },\n });\n view.focus();\n }, [disabled]);\n\n const insertSingleChoiceTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const optionLabel1 = toolbarLabels.singleChoiceOption1;\n const optionLabel2 = toolbarLabels.singleChoiceOption2;\n const template = `?[%{{}} ${optionLabel1} | ${optionLabel2}]`;\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 5,\n },\n });\n view.focus();\n }, [\n disabled,\n toolbarLabels.singleChoiceOption1,\n toolbarLabels.singleChoiceOption2,\n ]);\n\n const insertMultiChoiceTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const optionLabel1 = toolbarLabels.singleChoiceOption1;\n const optionLabel2 = toolbarLabels.singleChoiceOption2;\n const template = `?[%{{}} ${optionLabel1} || ${optionLabel2}]`;\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 5,\n },\n });\n view.focus();\n }, [\n disabled,\n toolbarLabels.singleChoiceOption1,\n toolbarLabels.singleChoiceOption2,\n ]);\n\n const insertInputFieldTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const placeholder = toolbarLabels.inputPlaceholder ?? \"请输入\";\n const template = `?[%{{}}...${placeholder}]`;\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 5,\n },\n });\n view.focus();\n }, [disabled, toolbarLabels.inputPlaceholder]);\n\n const handleSelectImage = useCallback(\n ({\n resourceUrl,\n resourceTitle,\n scalePercent,\n }: {\n resourceUrl?: string;\n resourceTitle?: string;\n scalePercent?: number;\n }) => {\n if (!resourceUrl || disabled) return;\n const textToInsert = getImageContentToInsert({\n resourceUrl,\n resourceTitle,\n scalePercent,\n });\n if (selectContentInfo?.type === SelectedOption.Image) {\n deleteSelectedContent();\n if (!editorViewRef.current) return;\n const { dispatch } = editorViewRef.current;\n dispatch({\n changes: { from: selectContentInfo.from, insert: textToInsert },\n });\n } else {\n insertText(textToInsert);\n }\n setDialogOpen(false);\n },\n [deleteSelectedContent, disabled, insertText, selectContentInfo]\n );\n\n const handleSelectVideo = useCallback(\n ({\n resourceUrl,\n resourceTitle,\n }: {\n resourceUrl: string;\n resourceTitle: string;\n }) => {\n if (disabled) {\n return;\n }\n const textToInsert = getVideoContentToInsert(resourceUrl, resourceTitle);\n if (selectContentInfo?.type === SelectedOption.Video) {\n deleteSelectedContent();\n if (!editorViewRef.current) return;\n const { dispatch } = editorViewRef.current;\n dispatch({\n changes: { from: selectContentInfo.from, insert: textToInsert },\n });\n } else {\n insertText(textToInsert);\n }\n setDialogOpen(false);\n },\n [deleteSelectedContent, disabled, insertText, selectContentInfo]\n );\n\n const handleSelectVariable = useCallback(\n (variable: Variable) => {\n if (disabled) {\n return;\n }\n const selectionRange =\n selectContentInfo?.type === SelectedOption.Variable\n ? { from: selectContentInfo.from, to: selectContentInfo.to }\n : undefined;\n insertVariableContent(variable.name, selectionRange, true);\n setPopoverOpen(false);\n closeVariableSearch();\n },\n [disabled, insertVariableContent, selectContentInfo, closeVariableSearch]\n );\n\n const slashCommandsExtension = useCallback(() => {\n return autocompletion({\n override: [\n createSlashCommands(onSelectedOption, {\n // divider: currentStrings.slashDivider,\n // fixedText: currentStrings.slashFixedText,\n image: currentStrings.slashImage,\n video: currentStrings.slashVideo,\n variable: currentStrings.slashVariable,\n }),\n ],\n });\n }, [\n // currentStrings.slashDivider,\n // currentStrings.slashFixedText,\n currentStrings.slashImage,\n currentStrings.slashVideo,\n currentStrings.slashVariable,\n onSelectedOption,\n ]);\n\n // const fixedTextPlaceholderExtension = useMemo(\n // () =>\n // createFixedTextPlaceholder(\n // currentStrings.fixedTextPlaceholder ?? \"添加固定文本\",\n // currentStrings.fixedTextTooltip ??\n // currentStrings.slashFixedText ??\n // \"固定文本\"\n // ),\n // [\n // currentStrings.fixedTextPlaceholder,\n // currentStrings.fixedTextTooltip,\n // currentStrings.slashFixedText,\n // ]\n // );\n\n const handleEditorUpdate = useCallback(\n (update: ViewUpdate) => {\n editorViewRef.current = update.view;\n if (\n editMode === EditMode.QuickEdit &&\n pendingVariableContentRef.current &&\n update.selectionSet\n ) {\n const cursorPosition = update.state.selection.main.head;\n const docText = update.state.doc.toString();\n const stillInside = isCursorInsideVariableExpression(\n docText,\n cursorPosition\n );\n if (!stillInside) {\n addVariablesFromContent(docText);\n pendingVariableContentRef.current = null;\n }\n }\n },\n [addVariablesFromContent, editMode]\n );\n\n const handleTagClick = useCallback(\n (event: any) => {\n event.stopPropagation();\n if (disabled) {\n return;\n }\n const { type, from, to, dataset, target } = event.detail;\n const value = parseContentInfo(type, dataset);\n setSelectContentInfo({\n type,\n value,\n from,\n to,\n });\n setSelectedOption(type);\n\n if (type === SelectedOption.Variable) {\n if (target) {\n const rect = target.getBoundingClientRect();\n setPopoverPosition({\n x: rect.left,\n y: rect.bottom,\n });\n }\n setPopoverOpen(true);\n } else {\n setDialogOpen(true);\n }\n },\n [disabled]\n );\n\n useEffect(() => {\n if (!dialogOpen) {\n setSelectedOption(SelectedOption.Empty);\n setSelectContentInfo(null);\n }\n }, [dialogOpen]);\n\n useEffect(() => {\n if (!popoverOpen && selectedOption === SelectedOption.Variable) {\n setSelectedOption(SelectedOption.Empty);\n setSelectContentInfo(null);\n }\n }, [popoverOpen, selectedOption]);\n\n useEffect(() => {\n const handleWrap = (e: any) => {\n if (e.detail.view === editorViewRef.current) {\n handleTagClick(e);\n }\n };\n window.addEventListener(\"globalTagClick\", handleWrap);\n return () => {\n window.removeEventListener(\"globalTagClick\", handleWrap);\n };\n }, [handleTagClick]);\n\n const editorExtensions = useMemo(() => {\n const extensions = [\n EditorView.lineWrapping,\n markdown(),\n syntaxHighlighting(defaultHighlightStyle),\n SyntaxHighlighter,\n ];\n\n if (!disabled) {\n extensions.push(slashCommandsExtension());\n }\n\n if (editMode === EditMode.QuickEdit) {\n extensions.push(\n ImgPlaceholder,\n VideoPlaceholder,\n VariablePlaceholder\n // fixedTextPlaceholderExtension,\n // DividerPlaceholder,\n );\n }\n\n extensions.push(\n EditorView.updateListener.of((update) => {\n handleEditorUpdate(update);\n })\n );\n\n return extensions;\n }, [disabled, editMode, slashCommandsExtension, handleEditorUpdate]);\n\n const handleContentChange = useCallback(\n (value: string) => {\n if (disabled) {\n return;\n }\n const cursorPosition =\n editorViewRef.current?.state.selection.main.head ?? -1;\n const skipAddition = isCursorInsideVariableExpression(\n value,\n cursorPosition\n );\n if (skipAddition) {\n pendingVariableContentRef.current = value;\n } else {\n pendingVariableContentRef.current = null;\n addVariablesFromContent(value);\n }\n onChange?.(value);\n },\n [addVariablesFromContent, onChange, disabled]\n );\n\n const isVariableSearchOpen = !disabled && variableSearchOpen;\n const editorApi = useMemo(\n () => ({\n insertTextAtCursor: insertText,\n replaceSelection,\n focus: focusEditor,\n getContent,\n setContent,\n }),\n [focusEditor, getContent, insertText, replaceSelection, setContent]\n );\n\n const handleToolbarActionClick = useCallback(\n (action: EditorAction) => {\n if (disabled || \"render\" in action) {\n return;\n }\n action.onClick?.(editorApi);\n },\n [disabled, editorApi]\n );\n\n const toolbarRightSlot = useMemo(() => {\n if (!toolbarActionsRight?.length) {\n return null;\n }\n return (\n <div className=\"markdown-flow-editor-toolbar-right\">\n {toolbarActionsRight.map((action) => {\n if (\"render\" in action) {\n return (\n <div\n className=\"markdown-flow-editor-toolbar-right-item\"\n key={action.key}\n >\n {action.render(editorApi)}\n </div>\n );\n }\n const ariaLabel = action.label || action.tooltip || undefined;\n const button = (\n <button\n type=\"button\"\n key={action.key}\n disabled={disabled || action.disabled}\n onClick={() => handleToolbarActionClick(action)}\n className=\"markdown-flow-editor-toolbar-right-button\"\n aria-label={ariaLabel}\n title={action.label || action.tooltip}\n >\n {action.icon ? (\n <span className=\"toolbar-right-icon\">{action.icon}</span>\n ) : null}\n {action.label ? (\n <span className=\"toolbar-right-label\">{action.label}</span>\n ) : null}\n </button>\n );\n const wrapped = action.tooltip ? (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent side=\"top\">{action.tooltip}</TooltipContent>\n </Tooltip>\n ) : (\n button\n );\n return (\n <div\n className=\"markdown-flow-editor-toolbar-right-item\"\n key={action.key}\n >\n {wrapped}\n </div>\n );\n })}\n </div>\n );\n }, [disabled, editorApi, handleToolbarActionClick, toolbarActionsRight]);\n\n useEffect(() => {\n onReady?.(editorApi);\n }, [editorApi]);\n\n return (\n <div\n className=\"markdown-flow-editor\"\n data-disabled={disabled ? \"true\" : undefined}\n aria-disabled={disabled}\n >\n <EditorToolbar\n disabled={disabled}\n labels={toolbarLabels}\n onSelect={onSelectedOption}\n onInsertVariablePlaceholder={insertVariableTemplate}\n onVariableSearchToggle={handleVariableSearchToggle}\n onVariableSearchClose={closeVariableSearch}\n onInsertConfirmOutput={insertConfirmOutputMarker}\n onInsertLink={insertLinkTemplate}\n onInsertButton={insertButtonTemplate}\n onInsertSingleChoice={insertSingleChoiceTemplate}\n onInsertMultiChoice={insertMultiChoiceTemplate}\n onInsertInputField={insertInputFieldTemplate}\n variableSearchActive={isVariableSearchOpen}\n rightSlot={toolbarRightSlot}\n />\n <VariableSearchDropdown\n open={isVariableSearchOpen}\n anchorElement={variableSearchAnchorRef.current}\n onClose={closeVariableSearch}\n onSelect={handleSelectVariable}\n variables={variables}\n systemVariables={systemVariables}\n labels={variableSearchLabels}\n />\n <div className=\"markdown-flow-editor-body relative overflow-auto\">\n <EditorContext.Provider value={editorContextValue}>\n <CodeMirror\n extensions={editorExtensions}\n basicSetup={{\n lineNumbers: false,\n syntaxHighlighting: true,\n highlightActiveLine: true,\n highlightActiveLineGutter: true,\n foldGutter: false,\n }}\n className=\"rounded-md\"\n placeholder={placeholderText}\n value={content}\n theme=\"light\"\n minHeight=\"2rem\"\n editable={!disabled}\n onChange={handleContentChange}\n onBlur={onBlur}\n />\n {!disabled && (\n <CustomDialog\n labels={{\n title:\n selectedOption === SelectedOption.Image\n ? t(\"dialogTitleImage\")\n : selectedOption === SelectedOption.Video\n ? t(\"dialogTitleVideo\")\n : selectedOption === SelectedOption.Variable\n ? t(\"dialogTitleVariable\")\n : t(\"dialogTitle\"),\n }}\n >\n {selectedOption === SelectedOption.Image && (\n <ImageInject\n value={selectContentInfo?.value}\n onSelect={handleSelectImage}\n uploadProps={uploadProps}\n />\n )}\n {selectedOption === SelectedOption.Video && (\n <VideoInject\n value={selectContentInfo?.value}\n onSelect={handleSelectVideo}\n />\n )}\n </CustomDialog>\n )}\n\n {!disabled && (\n <CustomPopover>\n <VariableSelect\n variables={variables}\n systemVariables={systemVariables}\n selectedName={selectContentInfo?.value?.variableName}\n onSelect={handleSelectVariable}\n onAddVariable={(variable) => {\n setVariables((prev) => {\n const normalized = variable.name.toLowerCase();\n const exists = prev.some(\n (item) => item.name.toLowerCase() === normalized\n );\n if (exists) {\n return prev;\n }\n return [variable, ...prev];\n });\n }}\n />\n </CustomPopover>\n )}\n </EditorContext.Provider>\n </div>\n </div>\n );\n};\n\nexport default Editor;\n"],"names":["i18next","editorLocaleResources","lng","resource","initReactI18next","DEFAULT_EDITOR_LOCALE","EMPTY_VARIABLES","isCursorInsideVariableExpression","content","cursorPosition","regexp","createVariableExpressionRegexp","match","matchStart","matchEnd","innerStart","innerEnd","buildVariableTemplate","variableName","Editor","editMode","initialVariables","initialSystemVariables","onChange","onBlur","locale","uploadProps","disabled","toolbarActionsRight","onReady","t","i18n","useTranslation","resolvedLocale","normalizeMarkdownFlowLocale","useEffect","currentStrings","getEditorLocaleMessages","toolbarLabels","useMemo","variableSearchLabels","placeholderText","normalizedSystemVariables","seen","variable","normalized","normalizedCustomVariables","systemNameSet","dialogOpen","setDialogOpen","useState","popoverOpen","setPopoverOpen","popoverPosition","setPopoverPosition","variables","setVariables","systemVariables","setSystemVariables","selectedOption","setSelectedOption","SelectedOption","selectContentInfo","setSelectContentInfo","editorViewRef","useRef","pendingVariableContentRef","variableSearchAnchorRef","variableSearchOpen","setVariableSearchOpen","closeVariableSearch","useCallback","handleVariableSearchToggle","button","editorContextValue","addVariablesFromContent","text","names","extractVariableNames","prev","existingNames","addedNames","newVariables","rawName","onSelectedOption","option","state","pos","coords","insertText","dispatch","from","replaceSelection","selection","focusEditor","getContent","setContent","view","deleteSelectedContent","to","insertVariableContent","range","placeCursorAtEnd","template","cursorOffset","insertVariableTemplate","insertConfirmOutputMarker","insertLinkTemplate","insertButtonTemplate","insertSingleChoiceTemplate","optionLabel1","optionLabel2","insertMultiChoiceTemplate","insertInputFieldTemplate","handleSelectImage","resourceUrl","resourceTitle","scalePercent","textToInsert","getImageContentToInsert","handleSelectVideo","getVideoContentToInsert","handleSelectVariable","selectionRange","slashCommandsExtension","autocompletion","createSlashCommands","handleEditorUpdate","update","docText","handleTagClick","event","type","dataset","target","value","parseContentInfo","rect","handleWrap","e","editorExtensions","extensions","EditorView","markdown","syntaxHighlighting","defaultHighlightStyle","SyntaxHighlighter","ImgPlaceholder","VideoPlaceholder","VariablePlaceholder","handleContentChange","isVariableSearchOpen","editorApi","handleToolbarActionClick","action","toolbarRightSlot","jsx","ariaLabel","jsxs","wrapped","Tooltip","TooltipTrigger","TooltipContent","EditorToolbar","VariableSearchDropdown","EditorContext","CodeMirror","CustomDialog","ImageInject","VideoInject","CustomPopover","VariableSelect","item"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DKA,GAAQ,gBAQX,OAAO,QAAQC,EAAqB,EAAE,QAAQ,CAAC,CAACC,GAAKC,CAAQ,MAAM;AACjEH,EAAAA,GAAQ;AAAA,IACNE;AAAA,IACA;AA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;AAAA,cACA,cAAcK,GAAmB,OAAO;AAAA,cACxC,UAAU4D;AAAA,cACV,eAAe,CAAC9E,MAAa;AAC3B,gBAAAY,EAAa,CAACuB,MAAS;AACrB,wBAAMlC,IAAaD,EAAS,KAAK,YAAA;AAIjC,yBAHemC,EAAK;AAAA,oBAClB,CAAC6F,MAASA,EAAK,KAAK,kBAAkB/H;AAAA,kBAAA,IAG/BkC,IAEF,CAACnC,GAAU,GAAGmC,CAAI;AAAA,gBAC3B,CAAC;AAAA,cACH;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA,EAAA,CAEJ,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"MarkdownFlowEditor.es.js","sources":["../../../src/components/MarkdownFlowEditor/MarkdownFlowEditor.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useCallback, useRef, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { autocompletion } from \"@codemirror/autocomplete\";\nimport { EditorView, ViewUpdate } from \"@codemirror/view\";\nimport { markdown } from \"@codemirror/lang-markdown\";\nimport {\n syntaxHighlighting,\n defaultHighlightStyle,\n} from \"@codemirror/language\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../ui/tooltip\";\nimport CustomDialog from \"./components/CustomDialog\";\nimport CustomPopover from \"./components/CustomPopover\";\nimport EditorToolbar from \"./components/EditorToolbar\";\nimport VariableSearchDropdown from \"./components/VariableSearchDropdown\";\nimport EditorContext from \"./editor-context\";\nimport ImageInject from \"./components/ImageInject\";\nimport VideoInject from \"./components/VideoInject\";\nimport VariableSelect from \"./components/VariableSelect\";\nimport {\n SelectedOption,\n IEditorContext,\n Variable,\n SelectContentInfo,\n PopoverPosition,\n EditorAction,\n EditorApi,\n} from \"./types\";\nimport \"./markdownFlowEditor.css\";\n\nimport {\n createSlashCommands,\n parseContentInfo,\n getImageContentToInsert,\n getVideoContentToInsert,\n extractVariableNames,\n createVariableExpressionRegexp,\n} from \"./utils\";\nimport ImgPlaceholder from \"./plugins/ImgPlaceholder\";\nimport VideoPlaceholder from \"./plugins/VideoPlaceholder\";\nimport { mediaPlaceholderLabels } from \"./plugins/mediaPlaceholderLabels\";\nimport VariablePlaceholder from \"./plugins/VariablePlaceholder\";\nimport SyntaxHighlighter from \"./plugins/SyntaxHighlighter\";\n// import createFixedTextPlaceholder from \"./plugins/FixedTextPlaceholder\";\n// import DividerPlaceholder from \"./plugins/DividerPlaceholder\";\nimport { initReactI18next, useTranslation } from \"react-i18next\";\nimport i18next from \"i18next\";\nimport { UploadProps } from \"./uploadTypes\";\nimport {\n DEFAULT_EDITOR_LOCALE,\n editorLocaleResources,\n getEditorLocaleMessages,\n} from \"./editorI18n\";\nimport {\n getMarkdownFlowDirection,\n getMarkdownFlowLanguage,\n normalizeMarkdownFlowLocale,\n type MarkdownFlowLocale,\n} from \"../../lib/locale\";\nimport { useDetachedLanguage } from \"../../lib/useDetachedLanguage\";\nimport { useResolvedDirection } from \"../../lib/useResolvedDirection\";\n\nif (!i18next.isInitialized) {\n i18next.use(initReactI18next).init({\n resources: editorLocaleResources,\n lng: DEFAULT_EDITOR_LOCALE,\n fallbackLng: DEFAULT_EDITOR_LOCALE,\n interpolation: { escapeValue: false },\n });\n} else {\n Object.entries(editorLocaleResources).forEach(([lng, resource]) => {\n i18next.addResourceBundle(\n lng,\n \"translation\",\n resource.translation,\n true,\n true\n );\n });\n}\n\nexport enum EditMode {\n CodeEdit = \"codeEdit\",\n QuickEdit = \"quickEdit\",\n}\n\ntype EditorProps = {\n content?: string;\n editMode?: EditMode;\n variables?: Variable[];\n systemVariables?: Variable[];\n onChange?: (value: string) => void;\n onBlur?: () => void;\n locale?: MarkdownFlowLocale;\n /** Overrides the locale-derived language. */\n lang?: string;\n uploadProps?: UploadProps;\n disabled?: boolean;\n toolbarActionsRight?: EditorAction[];\n onReady?: (api: EditorApi) => void;\n};\n\nconst EMPTY_VARIABLES: Variable[] = [];\n\n// Detect whether cursor is still inside a {{variable}} expression\nconst isCursorInsideVariableExpression = (\n content: string,\n cursorPosition: number\n) => {\n if (!content || cursorPosition < 0) {\n return false;\n }\n const regexp = createVariableExpressionRegexp();\n let match: RegExpExecArray | null;\n\n while ((match = regexp.exec(content)) !== null) {\n const matchStart = match.index ?? 0;\n const matchEnd = matchStart + match[0].length;\n const innerStart = matchStart + 2;\n const innerEnd = matchEnd - 2;\n if (cursorPosition >= innerStart && cursorPosition <= innerEnd) {\n return true;\n }\n if (regexp.lastIndex === match.index) {\n regexp.lastIndex++;\n }\n }\n\n return false;\n};\n\nconst buildVariableTemplate = (variableName = \"\") => `{{${variableName}}}`;\n\nconst Editor: React.FC<EditorProps> = ({\n content = \"\",\n editMode = EditMode.CodeEdit,\n variables: initialVariables,\n systemVariables: initialSystemVariables,\n onChange,\n onBlur,\n locale,\n lang,\n uploadProps,\n disabled = false,\n toolbarActionsRight,\n onReady,\n}) => {\n const { t, i18n } = useTranslation();\n const resolvedLocale = normalizeMarkdownFlowLocale(\n locale ?? DEFAULT_EDITOR_LOCALE\n );\n const direction = getMarkdownFlowDirection(locale);\n const language = lang ?? getMarkdownFlowLanguage(locale);\n\n useEffect(() => {\n if (i18n.language !== resolvedLocale) {\n i18n.changeLanguage(resolvedLocale);\n }\n }, [i18n, resolvedLocale]);\n\n const currentStrings = getEditorLocaleMessages(resolvedLocale);\n const toolbarLabels = useMemo(\n () => ({\n image: t(\"toolbarInsertImage\", {\n defaultValue: \"Insert image\",\n }),\n video: t(\"toolbarInsertVideo\", {\n defaultValue: \"Insert video\",\n }),\n variable: t(\"slashVariable\", {\n defaultValue: \"Variable\",\n }),\n addVariable: t(\"toolbarInsertNewVariable\", {\n defaultValue: \"Insert new variable\",\n }),\n search: t(\"toolbarInsertExistingVariable\", {\n defaultValue: \"Insert existing variable\",\n }),\n confirmOutput: t(\"toolbarConfirmOutput\", {\n defaultValue: \"Confirm output\",\n }),\n insertLink: t(\"toolbarInsertLink\", {\n defaultValue: \"Insert link\",\n }),\n insertButton: t(\"toolbarInsertButton\", {\n defaultValue: \"Insert button\",\n }),\n insertSingleChoice: t(\"toolbarInsertSingleChoice\", {\n defaultValue: \"Insert single choice\",\n }),\n insertMultiChoice: t(\"toolbarInsertMultiChoice\", {\n defaultValue: \"Insert multi choice\",\n }),\n insertInput: t(\"toolbarInsertInput\", {\n defaultValue: \"Insert input\",\n }),\n singleChoiceOption1: t(\"toolbarChoiceOption1\", {\n defaultValue: \"Option 1\",\n }),\n singleChoiceOption2: t(\"toolbarChoiceOption2\", {\n defaultValue: \"Option 2\",\n }),\n inputPlaceholder: t(\"toolbarInputPlaceholder\", {\n defaultValue: \"Please enter\",\n }),\n }),\n [t]\n );\n const variableSearchLabels = useMemo(\n () => ({\n searchPlaceholder: t(\"variableSearchPlaceholder\", {\n defaultValue: \"Search variable\",\n }),\n systemLabel: t(\"variableSectionSystem\", \"System Variables\"),\n customLabel: t(\"variableSectionCustom\", \"Custom Variables\"),\n emptyLabel: t(\"variableNotFound\", \"No variables found\"),\n }),\n [t]\n );\n const placeholderText =\n editMode === EditMode.QuickEdit\n ? t(\"placeholderQuickEdit\", {\n defaultValue: t(\"placeholderCodeEdit\", {\n defaultValue: t(\"placeholder\"),\n }),\n })\n : t(\"placeholderCodeEdit\", { defaultValue: t(\"placeholder\") });\n // Normalize variables to avoid duplicating system variables in the custom list\n const normalizedSystemVariables = useMemo(() => {\n const seen = new Set<string>();\n return (initialSystemVariables ?? EMPTY_VARIABLES).filter((variable) => {\n const normalized =\n typeof variable?.name === \"string\" ? variable.name.toLowerCase() : \"\";\n if (!normalized || seen.has(normalized)) {\n return false;\n }\n seen.add(normalized);\n return true;\n });\n }, [initialSystemVariables]);\n\n const normalizedCustomVariables = useMemo(() => {\n const systemNameSet = new Set(\n normalizedSystemVariables.map((variable) => variable.name.toLowerCase())\n );\n const seen = new Set<string>();\n return (initialVariables ?? EMPTY_VARIABLES).filter((variable) => {\n const normalized =\n typeof variable?.name === \"string\" ? variable.name.toLowerCase() : \"\";\n if (\n !normalized ||\n systemNameSet.has(normalized) ||\n seen.has(normalized)\n ) {\n return false;\n }\n seen.add(normalized);\n return true;\n });\n }, [initialVariables, normalizedSystemVariables]);\n\n const [dialogOpen, setDialogOpen] = useState(false);\n const [popoverOpen, setPopoverOpen] = useState(false);\n const editorRootRef = useRef<HTMLDivElement>(null);\n const portalLanguage = useDetachedLanguage(editorRootRef, language);\n const { resolvedDirection: portalDirection } = useResolvedDirection(\n editorRootRef,\n direction\n );\n const [popoverPosition, setPopoverPosition] =\n useState<PopoverPosition | null>(null);\n const [variables, setVariables] = useState<Variable[]>(\n normalizedCustomVariables\n );\n const [systemVariables, setSystemVariables] = useState<Variable[]>(\n normalizedSystemVariables\n );\n\n useEffect(() => {\n setVariables(normalizedCustomVariables);\n }, [normalizedCustomVariables]);\n\n useEffect(() => {\n setSystemVariables(normalizedSystemVariables);\n }, [normalizedSystemVariables]);\n\n const [selectedOption, setSelectedOption] = useState<SelectedOption>(\n SelectedOption.Empty\n );\n const [selectContentInfo, setSelectContentInfo] =\n useState<SelectContentInfo | null>();\n const editorViewRef = useRef<EditorView | null>(null);\n const pendingVariableContentRef = useRef<string | null>(null);\n const variableSearchAnchorRef = useRef<HTMLButtonElement | null>(null);\n const [variableSearchOpen, setVariableSearchOpen] = useState(false);\n const closeVariableSearch = useCallback(() => {\n setVariableSearchOpen(false);\n variableSearchAnchorRef.current = null;\n }, []);\n const handleVariableSearchToggle = useCallback(\n (button: HTMLButtonElement) => {\n if (disabled) {\n return;\n }\n if (variableSearchOpen && variableSearchAnchorRef.current === button) {\n closeVariableSearch();\n return;\n }\n variableSearchAnchorRef.current = button;\n setVariableSearchOpen(true);\n },\n [closeVariableSearch, disabled, variableSearchOpen]\n );\n\n const editorContextValue: IEditorContext = {\n selectedOption,\n setSelectedOption,\n dialogOpen,\n setDialogOpen,\n popoverOpen,\n setPopoverOpen,\n popoverPosition,\n setPopoverPosition,\n };\n\n useEffect(() => {\n if (!disabled) {\n return;\n }\n setDialogOpen(false);\n setPopoverOpen(false);\n setSelectedOption(SelectedOption.Empty);\n setSelectContentInfo(null);\n setPopoverPosition(null);\n closeVariableSearch();\n }, [\n closeVariableSearch,\n disabled,\n setDialogOpen,\n setPopoverOpen,\n setPopoverPosition,\n setSelectedOption,\n setSelectContentInfo,\n ]);\n\n const addVariablesFromContent = useCallback(\n (text: string) => {\n if (editMode !== EditMode.QuickEdit || !text) {\n return;\n }\n\n const names = extractVariableNames(text);\n if (!names.length) {\n return;\n }\n\n const systemNameSet = new Set(\n systemVariables.map((variable) => variable.name.toLowerCase())\n );\n\n setVariables((prev) => {\n const existingNames = new Set(\n prev.map((variable) => variable.name.toLowerCase())\n );\n const addedNames = new Set<string>();\n const newVariables: Variable[] = [];\n\n names.forEach((rawName) => {\n const normalized = rawName.toLowerCase();\n if (\n !rawName ||\n systemNameSet.has(normalized) ||\n existingNames.has(normalized) ||\n addedNames.has(normalized)\n ) {\n return;\n }\n newVariables.push({ name: rawName });\n addedNames.add(normalized);\n });\n\n if (!newVariables.length) {\n return prev;\n }\n\n return [...newVariables, ...prev];\n });\n },\n [editMode, systemVariables]\n );\n\n useEffect(() => {\n addVariablesFromContent(content);\n }, [content, addVariablesFromContent]);\n\n // const insertFixedText = useCallback(() => {\n // if (!editorViewRef.current) return;\n // const view = editorViewRef.current;\n // const { state, dispatch } = view;\n // const selection = state.selection.main;\n // const selectedText = state.sliceDoc(selection.from, selection.to);\n // const startTag = \"===\";\n // const endTag = \"===\";\n // const insertContent = `${startTag}${selectedText ?? \"\"}${endTag}`;\n\n // dispatch({\n // changes: {\n // from: selection.from,\n // to: selection.to,\n // insert: insertContent,\n // },\n // selection: {\n // anchor: selection.from + startTag.length + (selectedText?.length ?? 0),\n // },\n // });\n // view.focus();\n // }, []);\n\n // const insertDivider = useCallback(() => {\n // if (!editorViewRef.current) return;\n // const view = editorViewRef.current;\n // const { state, dispatch } = view;\n // const selection = state.selection.main;\n // const insertContent = `\\n\\n---\\n\\n`;\n\n // dispatch({\n // changes: {\n // from: selection.from,\n // to: selection.to,\n // insert: insertContent,\n // },\n // selection: {\n // anchor: selection.from + insertContent.length,\n // },\n // });\n // view.focus();\n // }, []);\n\n const onSelectedOption = useCallback(\n (option: SelectedOption) => {\n if (disabled) {\n return;\n }\n closeVariableSearch();\n // if (option === SelectedOption.FixedText) {\n // insertFixedText();\n // setSelectedOption(SelectedOption.Empty);\n // setDialogOpen(false);\n // setPopoverOpen(false);\n // setSelectContentInfo(null);\n // setPopoverPosition(null);\n // return;\n // }\n\n // if (option === SelectedOption.Divider) {\n // insertDivider();\n // setSelectedOption(SelectedOption.Empty);\n // setDialogOpen(false);\n // setPopoverOpen(false);\n // setSelectContentInfo(null);\n // setPopoverPosition(null);\n // return;\n // }\n\n setSelectedOption(option);\n\n if (option === SelectedOption.Variable) {\n if (editorViewRef.current) {\n const { state } = editorViewRef.current;\n const pos = state.selection.main.from;\n const coords = editorViewRef.current.coordsAtPos(pos);\n if (coords) {\n setPopoverPosition({\n x: coords.left,\n y: coords.bottom,\n });\n }\n }\n setPopoverOpen(true);\n } else {\n setDialogOpen(true);\n }\n },\n [closeVariableSearch, disabled]\n );\n\n const insertText = useCallback(\n (text: string) => {\n if (disabled || !editorViewRef.current) return;\n\n const { state, dispatch } = editorViewRef.current;\n const from = state.selection.main.from;\n\n dispatch({\n changes: { from, insert: text },\n selection: { anchor: from + text.length },\n });\n },\n [editorViewRef, disabled]\n );\n\n const replaceSelection = useCallback(\n (text: string) => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const { state, dispatch } = editorViewRef.current;\n const selection = state.selection.main;\n dispatch({\n changes: { from: selection.from, to: selection.to, insert: text },\n selection: { anchor: selection.from + text.length },\n });\n },\n [disabled]\n );\n\n const focusEditor = useCallback(() => {\n editorViewRef.current?.focus();\n }, []);\n\n const getContent = useCallback(() => {\n return editorViewRef.current?.state.doc.toString() ?? \"\";\n }, []);\n\n const setContent = useCallback(\n (text: string) => {\n if (disabled) {\n return;\n }\n if (!editorViewRef.current) {\n onChange?.(text);\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n dispatch({\n changes: { from: 0, to: state.doc.length, insert: text },\n selection: { anchor: text.length },\n });\n },\n [disabled, onChange]\n );\n\n const deleteSelectedContent = useCallback(() => {\n if (disabled) {\n return;\n }\n if (\n !selectContentInfo ||\n !editorViewRef.current ||\n selectContentInfo.from === -1\n )\n return;\n\n const { from, to } = selectContentInfo;\n const { dispatch } = editorViewRef.current;\n\n dispatch({\n changes: { from, to, insert: \"\" },\n });\n }, [selectContentInfo, editorViewRef, disabled]);\n\n const insertVariableContent = useCallback(\n (\n variableName: string,\n range?: { from: number; to: number },\n placeCursorAtEnd = false\n ) => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = range ?? state.selection.main;\n const template = buildVariableTemplate(variableName);\n const cursorOffset = placeCursorAtEnd\n ? template.length\n : 2 + variableName.length; // 2 braces before variable content\n\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + cursorOffset,\n },\n });\n view.focus();\n },\n [disabled]\n );\n\n const insertVariableTemplate = useCallback(() => {\n if (disabled) {\n return;\n }\n closeVariableSearch();\n insertVariableContent(\"\");\n }, [closeVariableSearch, disabled, insertVariableContent]);\n\n const insertConfirmOutputMarker = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const template = \"======\";\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 3,\n },\n });\n view.focus();\n }, [disabled]);\n\n const insertLinkTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const template = \"[]()\";\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 1,\n },\n });\n view.focus();\n }, [disabled]);\n\n const insertButtonTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const template = \"?[]\";\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 2,\n },\n });\n view.focus();\n }, [disabled]);\n\n const insertSingleChoiceTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const optionLabel1 = toolbarLabels.singleChoiceOption1;\n const optionLabel2 = toolbarLabels.singleChoiceOption2;\n const template = `?[%{{}} ${optionLabel1} | ${optionLabel2}]`;\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 5,\n },\n });\n view.focus();\n }, [\n disabled,\n toolbarLabels.singleChoiceOption1,\n toolbarLabels.singleChoiceOption2,\n ]);\n\n const insertMultiChoiceTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const optionLabel1 = toolbarLabels.singleChoiceOption1;\n const optionLabel2 = toolbarLabels.singleChoiceOption2;\n const template = `?[%{{}} ${optionLabel1} || ${optionLabel2}]`;\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 5,\n },\n });\n view.focus();\n }, [\n disabled,\n toolbarLabels.singleChoiceOption1,\n toolbarLabels.singleChoiceOption2,\n ]);\n\n const insertInputFieldTemplate = useCallback(() => {\n if (disabled || !editorViewRef.current) {\n return;\n }\n const view = editorViewRef.current;\n const { state, dispatch } = view;\n const selection = state.selection.main;\n const placeholder = toolbarLabels.inputPlaceholder ?? \"请输入\";\n const template = `?[%{{}}...${placeholder}]`;\n dispatch({\n changes: {\n from: selection.from,\n to: selection.to,\n insert: template,\n },\n selection: {\n anchor: selection.from + 5,\n },\n });\n view.focus();\n }, [disabled, toolbarLabels.inputPlaceholder]);\n\n const handleSelectImage = useCallback(\n ({\n resourceUrl,\n resourceTitle,\n scalePercent,\n }: {\n resourceUrl?: string;\n resourceTitle?: string;\n scalePercent?: number;\n }) => {\n if (!resourceUrl || disabled) return;\n const textToInsert = getImageContentToInsert({\n resourceUrl,\n resourceTitle,\n scalePercent,\n });\n if (selectContentInfo?.type === SelectedOption.Image) {\n deleteSelectedContent();\n if (!editorViewRef.current) return;\n const { dispatch } = editorViewRef.current;\n dispatch({\n changes: { from: selectContentInfo.from, insert: textToInsert },\n });\n } else {\n insertText(textToInsert);\n }\n setDialogOpen(false);\n },\n [deleteSelectedContent, disabled, insertText, selectContentInfo]\n );\n\n const handleSelectVideo = useCallback(\n ({\n resourceUrl,\n resourceTitle,\n }: {\n resourceUrl: string;\n resourceTitle: string;\n }) => {\n if (disabled) {\n return;\n }\n const textToInsert = getVideoContentToInsert(resourceUrl, resourceTitle);\n if (selectContentInfo?.type === SelectedOption.Video) {\n deleteSelectedContent();\n if (!editorViewRef.current) return;\n const { dispatch } = editorViewRef.current;\n dispatch({\n changes: { from: selectContentInfo.from, insert: textToInsert },\n });\n } else {\n insertText(textToInsert);\n }\n setDialogOpen(false);\n },\n [deleteSelectedContent, disabled, insertText, selectContentInfo]\n );\n\n const handleSelectVariable = useCallback(\n (variable: Variable) => {\n if (disabled) {\n return;\n }\n const selectionRange =\n selectContentInfo?.type === SelectedOption.Variable\n ? { from: selectContentInfo.from, to: selectContentInfo.to }\n : undefined;\n insertVariableContent(variable.name, selectionRange, true);\n setPopoverOpen(false);\n closeVariableSearch();\n },\n [disabled, insertVariableContent, selectContentInfo, closeVariableSearch]\n );\n\n const slashCommandsExtension = useCallback(() => {\n return autocompletion({\n override: [\n createSlashCommands(onSelectedOption, {\n // divider: currentStrings.slashDivider,\n // fixedText: currentStrings.slashFixedText,\n image: currentStrings.slashImage,\n video: currentStrings.slashVideo,\n variable: currentStrings.slashVariable,\n }),\n ],\n });\n }, [\n // currentStrings.slashDivider,\n // currentStrings.slashFixedText,\n currentStrings.slashImage,\n currentStrings.slashVideo,\n currentStrings.slashVariable,\n onSelectedOption,\n ]);\n\n // const fixedTextPlaceholderExtension = useMemo(\n // () =>\n // createFixedTextPlaceholder(\n // currentStrings.fixedTextPlaceholder ?? \"添加固定文本\",\n // currentStrings.fixedTextTooltip ??\n // currentStrings.slashFixedText ??\n // \"固定文本\"\n // ),\n // [\n // currentStrings.fixedTextPlaceholder,\n // currentStrings.fixedTextTooltip,\n // currentStrings.slashFixedText,\n // ]\n // );\n\n const handleEditorUpdate = useCallback(\n (update: ViewUpdate) => {\n editorViewRef.current = update.view;\n if (\n editMode === EditMode.QuickEdit &&\n pendingVariableContentRef.current &&\n update.selectionSet\n ) {\n const cursorPosition = update.state.selection.main.head;\n const docText = update.state.doc.toString();\n const stillInside = isCursorInsideVariableExpression(\n docText,\n cursorPosition\n );\n if (!stillInside) {\n addVariablesFromContent(docText);\n pendingVariableContentRef.current = null;\n }\n }\n },\n [addVariablesFromContent, editMode]\n );\n\n const handleTagClick = useCallback(\n (event: any) => {\n event.stopPropagation();\n if (disabled) {\n return;\n }\n const { type, from, to, dataset, target } = event.detail;\n const value = parseContentInfo(type, dataset);\n setSelectContentInfo({\n type,\n value,\n from,\n to,\n });\n setSelectedOption(type);\n\n if (type === SelectedOption.Variable) {\n if (target) {\n const rect = target.getBoundingClientRect();\n const anchorDirection =\n target.ownerDocument.defaultView?.getComputedStyle(\n editorRootRef.current ?? target\n ).direction;\n setPopoverPosition({\n x: anchorDirection === \"rtl\" ? rect.right : rect.left,\n y: rect.bottom,\n });\n }\n setPopoverOpen(true);\n } else {\n setDialogOpen(true);\n }\n },\n [disabled]\n );\n\n useEffect(() => {\n if (!dialogOpen) {\n setSelectedOption(SelectedOption.Empty);\n setSelectContentInfo(null);\n }\n }, [dialogOpen]);\n\n useEffect(() => {\n if (!popoverOpen && selectedOption === SelectedOption.Variable) {\n setSelectedOption(SelectedOption.Empty);\n setSelectContentInfo(null);\n }\n }, [popoverOpen, selectedOption]);\n\n useEffect(() => {\n const handleWrap = (e: any) => {\n if (e.detail.view === editorViewRef.current) {\n handleTagClick(e);\n }\n };\n window.addEventListener(\"globalTagClick\", handleWrap);\n return () => {\n window.removeEventListener(\"globalTagClick\", handleWrap);\n };\n }, [handleTagClick]);\n\n const imagePlaceholderTitle = t(\"imageDefaultTitle\");\n const videoPlaceholderTitle = t(\"videoDefaultTitle\");\n const mediaPlaceholderLabelsExtension = useMemo(\n () =>\n mediaPlaceholderLabels.of({\n image: imagePlaceholderTitle,\n video: videoPlaceholderTitle,\n }),\n [imagePlaceholderTitle, videoPlaceholderTitle]\n );\n\n const editorExtensions = useMemo(() => {\n const extensions = [\n EditorView.lineWrapping,\n markdown(),\n syntaxHighlighting(defaultHighlightStyle),\n SyntaxHighlighter,\n ];\n\n if (!disabled) {\n extensions.push(slashCommandsExtension());\n }\n\n if (editMode === EditMode.QuickEdit) {\n extensions.push(\n mediaPlaceholderLabelsExtension,\n ImgPlaceholder,\n VideoPlaceholder,\n VariablePlaceholder\n // fixedTextPlaceholderExtension,\n // DividerPlaceholder,\n );\n }\n\n extensions.push(\n EditorView.updateListener.of((update) => {\n handleEditorUpdate(update);\n })\n );\n\n return extensions;\n }, [\n disabled,\n editMode,\n slashCommandsExtension,\n handleEditorUpdate,\n mediaPlaceholderLabelsExtension,\n ]);\n\n const handleContentChange = useCallback(\n (value: string) => {\n if (disabled) {\n return;\n }\n const cursorPosition =\n editorViewRef.current?.state.selection.main.head ?? -1;\n const skipAddition = isCursorInsideVariableExpression(\n value,\n cursorPosition\n );\n if (skipAddition) {\n pendingVariableContentRef.current = value;\n } else {\n pendingVariableContentRef.current = null;\n addVariablesFromContent(value);\n }\n onChange?.(value);\n },\n [addVariablesFromContent, onChange, disabled]\n );\n\n const isVariableSearchOpen = !disabled && variableSearchOpen;\n const editorApi = useMemo(\n () => ({\n insertTextAtCursor: insertText,\n replaceSelection,\n focus: focusEditor,\n getContent,\n setContent,\n }),\n [focusEditor, getContent, insertText, replaceSelection, setContent]\n );\n\n const handleToolbarActionClick = useCallback(\n (action: EditorAction) => {\n if (disabled || \"render\" in action) {\n return;\n }\n action.onClick?.(editorApi);\n },\n [disabled, editorApi]\n );\n\n const toolbarRightSlot = useMemo(() => {\n if (!toolbarActionsRight?.length) {\n return null;\n }\n return (\n <div className=\"markdown-flow-editor-toolbar-right\">\n {toolbarActionsRight.map((action) => {\n if (\"render\" in action) {\n return (\n <div\n className=\"markdown-flow-editor-toolbar-right-item\"\n key={action.key}\n >\n {action.render(editorApi)}\n </div>\n );\n }\n const ariaLabel = action.label || action.tooltip || undefined;\n const button = (\n <button\n type=\"button\"\n key={action.key}\n disabled={disabled || action.disabled}\n onClick={() => handleToolbarActionClick(action)}\n className=\"markdown-flow-editor-toolbar-right-button\"\n aria-label={ariaLabel}\n title={action.label || action.tooltip}\n >\n {action.icon ? (\n <span className=\"toolbar-right-icon\">{action.icon}</span>\n ) : null}\n {action.label ? (\n <span className=\"toolbar-right-label\">{action.label}</span>\n ) : null}\n </button>\n );\n const wrapped = action.tooltip ? (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"top\"\n dir={portalDirection}\n lang={portalLanguage}\n >\n {action.tooltip}\n </TooltipContent>\n </Tooltip>\n ) : (\n button\n );\n return (\n <div\n className=\"markdown-flow-editor-toolbar-right-item\"\n key={action.key}\n >\n {wrapped}\n </div>\n );\n })}\n </div>\n );\n }, [\n disabled,\n editorApi,\n handleToolbarActionClick,\n portalDirection,\n portalLanguage,\n toolbarActionsRight,\n ]);\n\n useEffect(() => {\n onReady?.(editorApi);\n }, [editorApi]);\n\n return (\n <div\n className=\"markdown-flow-editor\"\n ref={editorRootRef}\n dir={direction}\n lang={language}\n data-disabled={disabled ? \"true\" : undefined}\n aria-disabled={disabled}\n >\n <EditorToolbar\n disabled={disabled}\n labels={toolbarLabels}\n tooltipDirection={portalDirection}\n tooltipLanguage={portalLanguage}\n onSelect={onSelectedOption}\n onInsertVariablePlaceholder={insertVariableTemplate}\n onVariableSearchToggle={handleVariableSearchToggle}\n onVariableSearchClose={closeVariableSearch}\n onInsertConfirmOutput={insertConfirmOutputMarker}\n onInsertLink={insertLinkTemplate}\n onInsertButton={insertButtonTemplate}\n onInsertSingleChoice={insertSingleChoiceTemplate}\n onInsertMultiChoice={insertMultiChoiceTemplate}\n onInsertInputField={insertInputFieldTemplate}\n variableSearchActive={isVariableSearchOpen}\n rightSlot={toolbarRightSlot}\n />\n <VariableSearchDropdown\n open={isVariableSearchOpen}\n anchorElement={variableSearchAnchorRef.current}\n onClose={closeVariableSearch}\n onSelect={handleSelectVariable}\n variables={variables}\n systemVariables={systemVariables}\n labels={variableSearchLabels}\n />\n <div className=\"markdown-flow-editor-body relative overflow-auto\">\n <EditorContext.Provider value={editorContextValue}>\n <CodeMirror\n extensions={editorExtensions}\n basicSetup={{\n lineNumbers: false,\n syntaxHighlighting: true,\n highlightActiveLine: true,\n highlightActiveLineGutter: true,\n foldGutter: false,\n }}\n className=\"rounded-md\"\n placeholder={placeholderText}\n value={content}\n theme=\"light\"\n minHeight=\"2rem\"\n editable={!disabled}\n onChange={handleContentChange}\n onBlur={onBlur}\n />\n {!disabled && (\n <CustomDialog\n dir={portalDirection}\n lang={portalLanguage}\n labels={{\n closeButtonLabel: t(\"dialogCloseLabel\"),\n title:\n selectedOption === SelectedOption.Image\n ? t(\"dialogTitleImage\")\n : selectedOption === SelectedOption.Video\n ? t(\"dialogTitleVideo\")\n : selectedOption === SelectedOption.Variable\n ? t(\"dialogTitleVariable\")\n : t(\"dialogTitle\"),\n }}\n >\n {selectedOption === SelectedOption.Image && (\n <ImageInject\n value={selectContentInfo?.value}\n onSelect={handleSelectImage}\n uploadProps={uploadProps}\n />\n )}\n {selectedOption === SelectedOption.Video && (\n <VideoInject\n value={selectContentInfo?.value}\n onSelect={handleSelectVideo}\n />\n )}\n </CustomDialog>\n )}\n\n {!disabled && (\n <CustomPopover dir={portalDirection} lang={portalLanguage}>\n <VariableSelect\n variables={variables}\n systemVariables={systemVariables}\n selectedName={selectContentInfo?.value?.variableName}\n onSelect={handleSelectVariable}\n onAddVariable={(variable) => {\n setVariables((prev) => {\n const normalized = variable.name.toLowerCase();\n const exists = prev.some(\n (item) => item.name.toLowerCase() === normalized\n );\n if (exists) {\n return prev;\n }\n return [variable, ...prev];\n });\n }}\n />\n </CustomPopover>\n )}\n </EditorContext.Provider>\n </div>\n </div>\n );\n};\n\nexport default Editor;\n"],"names":["i18next","editorLocaleResources","lng","resource","initReactI18next","DEFAULT_EDITOR_LOCALE","EMPTY_VARIABLES","isCursorInsideVariableExpression","content","cursorPosition","regexp","createVariableExpressionRegexp","match","matchStart","matchEnd","innerStart","innerEnd","buildVariableTemplate","variableName","Editor","editMode","initialVariables","initialSystemVariables","onChange","onBlur","locale","lang","uploadProps","disabled","toolbarActionsRight","onReady","t","i18n","useTranslation","resolvedLocale","normalizeMarkdownFlowLocale","direction","getMarkdownFlowDirection","language","getMarkdownFlowLanguage","useEffect","currentStrings","getEditorLocaleMessages","toolbarLabels","useMemo","variableSearchLabels","placeholderText","normalizedSystemVariables","seen","variable","normalized","normalizedCustomVariables","systemNameSet","dialogOpen","setDialogOpen","useState","popoverOpen","setPopoverOpen","editorRootRef","useRef","portalLanguage","useDetachedLanguage","portalDirection","useResolvedDirection","popoverPosition","setPopoverPosition","variables","setVariables","systemVariables","setSystemVariables","selectedOption","setSelectedOption","SelectedOption","selectContentInfo","setSelectContentInfo","editorViewRef","pendingVariableContentRef","variableSearchAnchorRef","variableSearchOpen","setVariableSearchOpen","closeVariableSearch","useCallback","handleVariableSearchToggle","button","editorContextValue","addVariablesFromContent","text","names","extractVariableNames","prev","existingNames","addedNames","newVariables","rawName","onSelectedOption","option","state","pos","coords","insertText","dispatch","from","replaceSelection","selection","focusEditor","getContent","setContent","view","deleteSelectedContent","to","insertVariableContent","range","placeCursorAtEnd","template","cursorOffset","insertVariableTemplate","insertConfirmOutputMarker","insertLinkTemplate","insertButtonTemplate","insertSingleChoiceTemplate","optionLabel1","optionLabel2","insertMultiChoiceTemplate","insertInputFieldTemplate","handleSelectImage","resourceUrl","resourceTitle","scalePercent","textToInsert","getImageContentToInsert","handleSelectVideo","getVideoContentToInsert","handleSelectVariable","selectionRange","slashCommandsExtension","autocompletion","createSlashCommands","handleEditorUpdate","update","docText","handleTagClick","event","type","dataset","target","value","parseContentInfo","rect","anchorDirection","handleWrap","e","imagePlaceholderTitle","videoPlaceholderTitle","mediaPlaceholderLabelsExtension","mediaPlaceholderLabels","editorExtensions","extensions","EditorView","markdown","syntaxHighlighting","defaultHighlightStyle","SyntaxHighlighter","ImgPlaceholder","VideoPlaceholder","VariablePlaceholder","handleContentChange","isVariableSearchOpen","editorApi","handleToolbarActionClick","action","toolbarRightSlot","jsx","ariaLabel","jsxs","wrapped","Tooltip","TooltipTrigger","TooltipContent","EditorToolbar","VariableSearchDropdown","EditorContext","CodeMirror","CustomDialog","ImageInject","VideoInject","CustomPopover","VariableSelect","item"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DKA,GAAQ,gBAQX,OAAO,QAAQC,EAAqB,EAAE,QAAQ,CAAC,CAACC,GAAKC,CAAQ,MAAM;AACjEH,EAAAA,GAAQ;AAAA,IACNE;AAAA,IACA;AAAA,IACAC,EAAS;AAAA,IACT;AAAA,IACA;AAAA,EAAA;AAEJ,CAAC,IAfDH,GAAQ,IAAII,EAAgB,EAAE,KAAK;AAAA,EACjC,WAAWH;AAAA,EACX,KAAKI;AAAA,EACL,aAAaA;AAAA,EACb,eAAe,EAAE,aAAa,GAAA;AAAM,CACrC;AAkCH,MAAMC,KAA8B,CAAA,GAG9BC,KAAmC,CACvCC,GACAC,MACG;AACH,MAAI,CAACD,KAAWC,IAAiB;AA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AA;AAAA,cAG1B,UAAA;AAAA,gBAAAuC,MAAmBE,EAAe,SACjC,gBAAAmG;AAAA,kBAACY;AAAA,kBAAA;AAAA,oBACC,OAAO9G,GAAmB;AAAA,oBAC1B,UAAUmD;AAAA,oBACV,aAAAjG;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGH2C,MAAmBE,EAAe,SACjC,gBAAAmG;AAAA,kBAACa;AAAA,kBAAA;AAAA,oBACC,OAAO/G,GAAmB;AAAA,oBAC1B,UAAUyD;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACZ;AAAA,YAAA;AAAA,UAAA;AAAA,UAKL,CAACtG,KACA,gBAAA+I,EAACc,MAAc,KAAK3H,GAAiB,MAAMF,GACzC,UAAA,gBAAA+G;AAAA,YAACe;AAAA,YAAA;AAAA,cACC,WAAAxH;AAAA,cACA,iBAAAE;AAAA,cACA,cAAcK,GAAmB,OAAO;AAAA,cACxC,UAAU2D;AAAA,cACV,eAAe,CAACnF,MAAa;AAC3B,gBAAAkB,GAAa,CAACsB,MAAS;AACrB,wBAAMvC,IAAaD,EAAS,KAAK,YAAA;AAIjC,yBAHewC,EAAK;AAAA,oBAClB,CAACkG,MAASA,EAAK,KAAK,kBAAkBzI;AAAA,kBAAA,IAG/BuC,IAEF,CAACxC,GAAU,GAAGwC,CAAI;AAAA,gBAC3B,CAAC;AAAA,cACH;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA,EAAA,CAEJ,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../../_virtual/jsx-runtime.cjs"),o=require("react"),n=require("../../ui/dialog.cjs"),c=require("../editor-context.cjs"),m=require("../../../lib/utils.cjs"),s=o.forwardRef(({children:i,className:r,labels:u},l)=>{const{dialogOpen:a,setDialogOpen:d}=o.useContext(c.default);return e.jsxRuntimeExports.jsx(n.Dialog,{open:a,onOpenChange:d,modal:!0,children:e.jsxRuntimeExports.jsxs(n.DialogContent,{ref:l,className:m.cn("min-w-[300px]",r),onPointerDownOutside:t=>{t.preventDefault()},onInteractOutside:t=>{t.preventDefault()},children:[e.jsxRuntimeExports.jsx(n.DialogTitle,{className:"font-medium mb-4",children:u?.title??"Settings"}),e.jsxRuntimeExports.jsx("div",{children:i})]})})});s.displayName="CustomDialog";exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),i=require("react"),o=require("../../ui/dialog.cjs"),m=require("../editor-context.cjs"),p=require("../../../lib/utils.cjs"),s=i.forwardRef(({children:l,className:r,dir:a,lang:u,labels:n},c)=>{const{dialogOpen:d,setDialogOpen:g}=i.useContext(m.default);return e.jsx(o.Dialog,{open:d,onOpenChange:g,modal:!0,children:e.jsxs(o.DialogContent,{ref:c,className:p.cn("min-w-[300px]",r),dir:a,lang:u,closeButtonLabel:n?.closeButtonLabel,onPointerDownOutside:t=>{t.preventDefault()},onInteractOutside:t=>{t.preventDefault()},children:[e.jsx(o.DialogTitle,{className:"font-medium mb-4",children:n?.title??"Settings"}),e.jsx("div",{children:l})]})})});s.displayName="CustomDialog";exports.default=s;
2
2
  //# sourceMappingURL=CustomDialog.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomDialog.cjs","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomDialog.tsx"],"sourcesContent":["import React, { useContext, forwardRef } from \"react\";\nimport { Dialog, DialogContent, DialogTitle } from \"../../ui/dialog\";\nimport EditorContext from \"../editor-context\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomDialogProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomDialogLabels {\n title?: string;\n}\nexport interface CustomDialogAllProps extends CustomDialogProps {\n className?: string;\n labels?: CustomDialogLabels;\n}\n\nconst CustomDialog = forwardRef<HTMLDivElement, CustomDialogAllProps>(\n ({ children, className, labels }, ref) => {\n const { dialogOpen, setDialogOpen } = useContext(EditorContext);\n return (\n <Dialog open={dialogOpen} onOpenChange={setDialogOpen} modal>\n <DialogContent\n ref={ref}\n className={cn(\"min-w-[300px]\", className)}\n onPointerDownOutside={(e) => {\n e.preventDefault();\n }}\n onInteractOutside={(e) => {\n e.preventDefault();\n }}\n >\n <DialogTitle className=\"font-medium mb-4\">\n {labels?.title ?? \"Settings\"}\n </DialogTitle>\n <div>{children}</div>\n </DialogContent>\n </Dialog>\n );\n }\n);\n\nCustomDialog.displayName = \"CustomDialog\";\n\nexport default CustomDialog;\n"],"names":["CustomDialog","forwardRef","children","className","labels","ref","dialogOpen","setDialogOpen","useContext","EditorContext","Dialog","jsxs","DialogContent","cn","e","jsx","DialogTitle"],"mappings":"4RAiBMA,EAAeC,EAAAA,WACnB,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,OAAAC,CAAA,EAAUC,IAAQ,CACxC,KAAM,CAAE,WAAAC,EAAY,cAAAC,GAAkBC,EAAAA,WAAWC,EAAAA,OAAa,EAC9D,+BACGC,EAAAA,OAAA,CAAO,KAAMJ,EAAY,aAAcC,EAAe,MAAK,GAC1D,SAAAI,EAAAA,kBAAAA,KAACC,EAAAA,cAAA,CACC,IAAAP,EACA,UAAWQ,EAAAA,GAAG,gBAAiBV,CAAS,EACxC,qBAAuBW,GAAM,CAC3BA,EAAE,eAAA,CACJ,EACA,kBAAoBA,GAAM,CACxBA,EAAE,eAAA,CACJ,EAEA,SAAA,CAAAC,wBAACC,EAAAA,YAAA,CAAY,UAAU,mBACpB,SAAAZ,GAAQ,OAAS,WACpB,EACAW,wBAAC,OAAK,SAAAb,CAAA,CAAS,CAAA,CAAA,CAAA,EAEnB,CAEJ,CACF,EAEAF,EAAa,YAAc"}
1
+ {"version":3,"file":"CustomDialog.cjs","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomDialog.tsx"],"sourcesContent":["import React, { useContext, forwardRef } from \"react\";\nimport { Dialog, DialogContent, DialogTitle } from \"../../ui/dialog\";\nimport EditorContext from \"../editor-context\";\nimport type { MarkdownFlowDirection } from \"../../../lib/locale\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomDialogProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomDialogLabels {\n title?: string;\n /** Accessible label for the dialog close button. */\n closeButtonLabel?: string;\n}\nexport interface CustomDialogAllProps extends CustomDialogProps {\n className?: string;\n /**\n * Sets \"ltr\" or \"rtl\" on the dialog content, including its reading and layout direction.\n * When omitted, the content inherits direction from its portal container, not the trigger.\n */\n dir?: MarkdownFlowDirection;\n /** Language of the detached dialog content. */\n lang?: string;\n labels?: CustomDialogLabels;\n}\n\nconst CustomDialog = forwardRef<HTMLDivElement, CustomDialogAllProps>(\n ({ children, className, dir, lang, labels }, ref) => {\n const { dialogOpen, setDialogOpen } = useContext(EditorContext);\n return (\n <Dialog open={dialogOpen} onOpenChange={setDialogOpen} modal>\n <DialogContent\n ref={ref}\n className={cn(\"min-w-[300px]\", className)}\n dir={dir}\n lang={lang}\n closeButtonLabel={labels?.closeButtonLabel}\n onPointerDownOutside={(e) => {\n e.preventDefault();\n }}\n onInteractOutside={(e) => {\n e.preventDefault();\n }}\n >\n <DialogTitle className=\"font-medium mb-4\">\n {labels?.title ?? \"Settings\"}\n </DialogTitle>\n <div>{children}</div>\n </DialogContent>\n </Dialog>\n );\n }\n);\n\nCustomDialog.displayName = \"CustomDialog\";\n\nexport default CustomDialog;\n"],"names":["CustomDialog","forwardRef","children","className","dir","lang","labels","ref","dialogOpen","setDialogOpen","useContext","EditorContext","Dialog","jsxs","DialogContent","cn","e","jsx","DialogTitle"],"mappings":"4QA2BMA,EAAeC,EAAAA,WACnB,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,IAAAC,EAAK,KAAAC,EAAM,OAAAC,CAAA,EAAUC,IAAQ,CACnD,KAAM,CAAE,WAAAC,EAAY,cAAAC,GAAkBC,EAAAA,WAAWC,EAAAA,OAAa,EAC9D,aACGC,EAAAA,OAAA,CAAO,KAAMJ,EAAY,aAAcC,EAAe,MAAK,GAC1D,SAAAI,EAAAA,KAACC,EAAAA,cAAA,CACC,IAAAP,EACA,UAAWQ,EAAAA,GAAG,gBAAiBZ,CAAS,EACxC,IAAAC,EACA,KAAAC,EACA,iBAAkBC,GAAQ,iBAC1B,qBAAuBU,GAAM,CAC3BA,EAAE,eAAA,CACJ,EACA,kBAAoBA,GAAM,CACxBA,EAAE,eAAA,CACJ,EAEA,SAAA,CAAAC,MAACC,EAAAA,YAAA,CAAY,UAAU,mBACpB,SAAAZ,GAAQ,OAAS,WACpB,EACAW,MAAC,OAAK,SAAAf,CAAA,CAAS,CAAA,CAAA,CAAA,EAEnB,CAEJ,CACF,EAEAF,EAAa,YAAc"}
@@ -1,12 +1,22 @@
1
1
  import { default as React } from 'react';
2
+ import { MarkdownFlowDirection } from '../../../lib/locale.js';
2
3
  type CustomDialogProps = {
3
4
  children?: React.ReactNode;
4
5
  };
5
6
  export interface CustomDialogLabels {
6
7
  title?: string;
8
+ /** Accessible label for the dialog close button. */
9
+ closeButtonLabel?: string;
7
10
  }
8
11
  export interface CustomDialogAllProps extends CustomDialogProps {
9
12
  className?: string;
13
+ /**
14
+ * Sets "ltr" or "rtl" on the dialog content, including its reading and layout direction.
15
+ * When omitted, the content inherits direction from its portal container, not the trigger.
16
+ */
17
+ dir?: MarkdownFlowDirection;
18
+ /** Language of the detached dialog content. */
19
+ lang?: string;
10
20
  labels?: CustomDialogLabels;
11
21
  }
12
22
  declare const CustomDialog: React.ForwardRefExoticComponent<CustomDialogAllProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,32 +1,35 @@
1
- import { j as t } from "../../../_virtual/jsx-runtime.es.js";
2
- import { forwardRef as m, useContext as l } from "react";
3
- import { Dialog as p, DialogContent as d, DialogTitle as u } from "../../ui/dialog.es.js";
4
- import f from "../editor-context.es.js";
1
+ import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
+ import { forwardRef as d, useContext as u } from "react";
3
+ import { Dialog as c, DialogContent as f, DialogTitle as g } from "../../ui/dialog.es.js";
4
+ import D from "../editor-context.es.js";
5
5
  import { cn as x } from "../../../lib/utils.es.js";
6
- const c = m(
7
- ({ children: o, className: n, labels: i }, r) => {
8
- const { dialogOpen: s, setDialogOpen: a } = l(f);
9
- return /* @__PURE__ */ t.jsx(p, { open: s, onOpenChange: a, modal: !0, children: /* @__PURE__ */ t.jsxs(
10
- d,
6
+ const C = d(
7
+ ({ children: n, className: i, dir: r, lang: a, labels: e }, l) => {
8
+ const { dialogOpen: m, setDialogOpen: s } = u(D);
9
+ return /* @__PURE__ */ o(c, { open: m, onOpenChange: s, modal: !0, children: /* @__PURE__ */ p(
10
+ f,
11
11
  {
12
- ref: r,
13
- className: x("min-w-[300px]", n),
14
- onPointerDownOutside: (e) => {
15
- e.preventDefault();
12
+ ref: l,
13
+ className: x("min-w-[300px]", i),
14
+ dir: r,
15
+ lang: a,
16
+ closeButtonLabel: e?.closeButtonLabel,
17
+ onPointerDownOutside: (t) => {
18
+ t.preventDefault();
16
19
  },
17
- onInteractOutside: (e) => {
18
- e.preventDefault();
20
+ onInteractOutside: (t) => {
21
+ t.preventDefault();
19
22
  },
20
23
  children: [
21
- /* @__PURE__ */ t.jsx(u, { className: "font-medium mb-4", children: i?.title ?? "Settings" }),
22
- /* @__PURE__ */ t.jsx("div", { children: o })
24
+ /* @__PURE__ */ o(g, { className: "font-medium mb-4", children: e?.title ?? "Settings" }),
25
+ /* @__PURE__ */ o("div", { children: n })
23
26
  ]
24
27
  }
25
28
  ) });
26
29
  }
27
30
  );
28
- c.displayName = "CustomDialog";
31
+ C.displayName = "CustomDialog";
29
32
  export {
30
- c as default
33
+ C as default
31
34
  };
32
35
  //# sourceMappingURL=CustomDialog.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomDialog.es.js","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomDialog.tsx"],"sourcesContent":["import React, { useContext, forwardRef } from \"react\";\nimport { Dialog, DialogContent, DialogTitle } from \"../../ui/dialog\";\nimport EditorContext from \"../editor-context\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomDialogProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomDialogLabels {\n title?: string;\n}\nexport interface CustomDialogAllProps extends CustomDialogProps {\n className?: string;\n labels?: CustomDialogLabels;\n}\n\nconst CustomDialog = forwardRef<HTMLDivElement, CustomDialogAllProps>(\n ({ children, className, labels }, ref) => {\n const { dialogOpen, setDialogOpen } = useContext(EditorContext);\n return (\n <Dialog open={dialogOpen} onOpenChange={setDialogOpen} modal>\n <DialogContent\n ref={ref}\n className={cn(\"min-w-[300px]\", className)}\n onPointerDownOutside={(e) => {\n e.preventDefault();\n }}\n onInteractOutside={(e) => {\n e.preventDefault();\n }}\n >\n <DialogTitle className=\"font-medium mb-4\">\n {labels?.title ?? \"Settings\"}\n </DialogTitle>\n <div>{children}</div>\n </DialogContent>\n </Dialog>\n );\n }\n);\n\nCustomDialog.displayName = \"CustomDialog\";\n\nexport default CustomDialog;\n"],"names":["CustomDialog","forwardRef","children","className","labels","ref","dialogOpen","setDialogOpen","useContext","EditorContext","Dialog","jsxs","DialogContent","cn","jsx","DialogTitle"],"mappings":";;;;;AAiBA,MAAMA,IAAeC;AAAA,EACnB,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,QAAAC,EAAA,GAAUC,MAAQ;AACxC,UAAM,EAAE,YAAAC,GAAY,eAAAC,MAAkBC,EAAWC,CAAa;AAC9D,iCACGC,GAAA,EAAO,MAAMJ,GAAY,cAAcC,GAAe,OAAK,IAC1D,UAAAI,gBAAAA,EAAAA;AAAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAP;AAAA,QACA,WAAWQ,EAAG,iBAAiBV,CAAS;AAAA,QACxC,sBAAsB,CAAC,MAAM;AAC3B,YAAE,eAAA;AAAA,QACJ;AAAA,QACA,mBAAmB,CAAC,MAAM;AACxB,YAAE,eAAA;AAAA,QACJ;AAAA,QAEA,UAAA;AAAA,UAAAW,gBAAAA,MAACC,GAAA,EAAY,WAAU,oBACpB,UAAAX,GAAQ,SAAS,YACpB;AAAA,UACAU,gBAAAA,MAAC,SAAK,UAAAZ,EAAA,CAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEnB;AAAA,EAEJ;AACF;AAEAF,EAAa,cAAc;"}
1
+ {"version":3,"file":"CustomDialog.es.js","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomDialog.tsx"],"sourcesContent":["import React, { useContext, forwardRef } from \"react\";\nimport { Dialog, DialogContent, DialogTitle } from \"../../ui/dialog\";\nimport EditorContext from \"../editor-context\";\nimport type { MarkdownFlowDirection } from \"../../../lib/locale\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomDialogProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomDialogLabels {\n title?: string;\n /** Accessible label for the dialog close button. */\n closeButtonLabel?: string;\n}\nexport interface CustomDialogAllProps extends CustomDialogProps {\n className?: string;\n /**\n * Sets \"ltr\" or \"rtl\" on the dialog content, including its reading and layout direction.\n * When omitted, the content inherits direction from its portal container, not the trigger.\n */\n dir?: MarkdownFlowDirection;\n /** Language of the detached dialog content. */\n lang?: string;\n labels?: CustomDialogLabels;\n}\n\nconst CustomDialog = forwardRef<HTMLDivElement, CustomDialogAllProps>(\n ({ children, className, dir, lang, labels }, ref) => {\n const { dialogOpen, setDialogOpen } = useContext(EditorContext);\n return (\n <Dialog open={dialogOpen} onOpenChange={setDialogOpen} modal>\n <DialogContent\n ref={ref}\n className={cn(\"min-w-[300px]\", className)}\n dir={dir}\n lang={lang}\n closeButtonLabel={labels?.closeButtonLabel}\n onPointerDownOutside={(e) => {\n e.preventDefault();\n }}\n onInteractOutside={(e) => {\n e.preventDefault();\n }}\n >\n <DialogTitle className=\"font-medium mb-4\">\n {labels?.title ?? \"Settings\"}\n </DialogTitle>\n <div>{children}</div>\n </DialogContent>\n </Dialog>\n );\n }\n);\n\nCustomDialog.displayName = \"CustomDialog\";\n\nexport default CustomDialog;\n"],"names":["CustomDialog","forwardRef","children","className","dir","lang","labels","ref","dialogOpen","setDialogOpen","useContext","EditorContext","Dialog","jsxs","DialogContent","cn","e","jsx","DialogTitle"],"mappings":";;;;;AA2BA,MAAMA,IAAeC;AAAA,EACnB,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,KAAAC,GAAK,MAAAC,GAAM,QAAAC,EAAA,GAAUC,MAAQ;AACnD,UAAM,EAAE,YAAAC,GAAY,eAAAC,MAAkBC,EAAWC,CAAa;AAC9D,6BACGC,GAAA,EAAO,MAAMJ,GAAY,cAAcC,GAAe,OAAK,IAC1D,UAAA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAP;AAAA,QACA,WAAWQ,EAAG,iBAAiBZ,CAAS;AAAA,QACxC,KAAAC;AAAA,QACA,MAAAC;AAAA,QACA,kBAAkBC,GAAQ;AAAA,QAC1B,sBAAsB,CAACU,MAAM;AAC3B,UAAAA,EAAE,eAAA;AAAA,QACJ;AAAA,QACA,mBAAmB,CAACA,MAAM;AACxB,UAAAA,EAAE,eAAA;AAAA,QACJ;AAAA,QAEA,UAAA;AAAA,UAAA,gBAAAC,EAACC,GAAA,EAAY,WAAU,oBACpB,UAAAZ,GAAQ,SAAS,YACpB;AAAA,UACA,gBAAAW,EAAC,SAAK,UAAAf,EAAA,CAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEnB;AAAA,EAEJ;AACF;AAEAF,EAAa,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../../_virtual/jsx-runtime.cjs"),u=require("react"),t=require("../../ui/popover.cjs"),a=require("../editor-context.cjs"),l=require("../../../lib/utils.cjs"),s=({children:n,className:i})=>{const{popoverOpen:r,setPopoverOpen:p,popoverPosition:e}=u.useContext(a.default);return!r||!e?null:o.jsxRuntimeExports.jsxs(t.Popover,{open:r,onOpenChange:p,children:[o.jsxRuntimeExports.jsx(t.PopoverAnchor,{style:{position:"fixed",left:`${e.x}px`,top:`${e.y}px`,width:0,height:0}}),o.jsxRuntimeExports.jsx(t.PopoverContent,{className:l.cn("p-0 border-0 shadow-none bg-transparent w-auto",i),align:"start",sideOffset:5,children:n})]})};s.displayName="CustomPopover";exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),l=require("react"),t=require("../../ui/popover.cjs"),c=require("../editor-context.cjs"),d=require("../../../lib/utils.cjs"),n=({children:s,className:i,dir:p,lang:u})=>{const{popoverOpen:r,setPopoverOpen:a,popoverPosition:e}=l.useContext(c.default);return!r||!e?null:o.jsxs(t.Popover,{open:r,onOpenChange:a,children:[o.jsx(t.PopoverAnchor,{style:{position:"fixed",left:`${e.x}px`,top:`${e.y}px`,width:0,height:0}}),o.jsx(t.PopoverContent,{className:d.cn("p-0 border-0 shadow-none bg-transparent w-auto",i),align:"start",dir:p,lang:u,sideOffset:5,children:s})]})};n.displayName="CustomPopover";exports.default=n;
2
2
  //# sourceMappingURL=CustomPopover.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomPopover.cjs","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomPopover.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { Popover, PopoverContent, PopoverAnchor } from \"../../ui/popover\";\nimport EditorContext from \"../editor-context\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomPopoverProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomPopoverAllProps extends CustomPopoverProps {\n className?: string;\n}\n\nconst CustomPopover: React.FC<CustomPopoverAllProps> = ({\n children,\n className,\n}) => {\n const { popoverOpen, setPopoverOpen, popoverPosition } =\n useContext(EditorContext);\n\n if (!popoverOpen || !popoverPosition) {\n return null;\n }\n\n return (\n <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>\n <PopoverAnchor\n style={{\n position: \"fixed\",\n left: `${popoverPosition.x}px`,\n top: `${popoverPosition.y}px`,\n width: 0,\n height: 0,\n }}\n />\n <PopoverContent\n className={cn(\n \"p-0 border-0 shadow-none bg-transparent w-auto\",\n className\n )}\n align=\"start\"\n sideOffset={5}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n};\n\nCustomPopover.displayName = \"CustomPopover\";\n\nexport default CustomPopover;\n"],"names":["CustomPopover","children","className","popoverOpen","setPopoverOpen","popoverPosition","useContext","EditorContext","jsxs","Popover","jsx","PopoverAnchor","PopoverContent","cn"],"mappings":"6RAaMA,EAAiD,CAAC,CACtD,SAAAC,EACA,UAAAC,CACF,IAAM,CACJ,KAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,gBAAAC,CAAA,EACnCC,EAAAA,WAAWC,EAAAA,OAAa,EAE1B,MAAI,CAACJ,GAAe,CAACE,EACZ,KAIPG,EAAAA,kBAAAA,KAACC,EAAAA,QAAA,CAAQ,KAAMN,EAAa,aAAcC,EACxC,SAAA,CAAAM,EAAAA,kBAAAA,IAACC,EAAAA,cAAA,CACC,MAAO,CACL,SAAU,QACV,KAAM,GAAGN,EAAgB,CAAC,KAC1B,IAAK,GAAGA,EAAgB,CAAC,KACzB,MAAO,EACP,OAAQ,CAAA,CACV,CAAA,EAEFK,EAAAA,kBAAAA,IAACE,EAAAA,eAAA,CACC,UAAWC,EAAAA,GACT,iDACAX,CAAA,EAEF,MAAM,QACN,WAAY,EAEX,SAAAD,CAAA,CAAA,CACH,EACF,CAEJ,EAEAD,EAAc,YAAc"}
1
+ {"version":3,"file":"CustomPopover.cjs","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomPopover.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { Popover, PopoverContent, PopoverAnchor } from \"../../ui/popover\";\nimport EditorContext from \"../editor-context\";\nimport type { MarkdownFlowDirection } from \"../../../lib/locale\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomPopoverProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomPopoverAllProps extends CustomPopoverProps {\n className?: string;\n /**\n * Sets \"ltr\" or \"rtl\" on the popover content, including its reading and layout direction.\n * When omitted, the content inherits direction from its portal container, not the trigger.\n */\n dir?: MarkdownFlowDirection;\n /** Language of the detached popover content. */\n lang?: string;\n}\n\nconst CustomPopover: React.FC<CustomPopoverAllProps> = ({\n children,\n className,\n dir,\n lang,\n}) => {\n const { popoverOpen, setPopoverOpen, popoverPosition } =\n useContext(EditorContext);\n\n if (!popoverOpen || !popoverPosition) {\n return null;\n }\n\n return (\n <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>\n <PopoverAnchor\n style={{\n position: \"fixed\",\n left: `${popoverPosition.x}px`,\n top: `${popoverPosition.y}px`,\n width: 0,\n height: 0,\n }}\n />\n <PopoverContent\n className={cn(\n \"p-0 border-0 shadow-none bg-transparent w-auto\",\n className\n )}\n align=\"start\"\n dir={dir}\n lang={lang}\n sideOffset={5}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n};\n\nCustomPopover.displayName = \"CustomPopover\";\n\nexport default CustomPopover;\n"],"names":["CustomPopover","children","className","dir","lang","popoverOpen","setPopoverOpen","popoverPosition","useContext","EditorContext","jsxs","Popover","jsx","PopoverAnchor","PopoverContent","cn"],"mappings":"6QAqBMA,EAAiD,CAAC,CACtD,SAAAC,EACA,UAAAC,EACA,IAAAC,EACA,KAAAC,CACF,IAAM,CACJ,KAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,gBAAAC,CAAA,EACnCC,EAAAA,WAAWC,EAAAA,OAAa,EAE1B,MAAI,CAACJ,GAAe,CAACE,EACZ,KAIPG,EAAAA,KAACC,EAAAA,QAAA,CAAQ,KAAMN,EAAa,aAAcC,EACxC,SAAA,CAAAM,EAAAA,IAACC,EAAAA,cAAA,CACC,MAAO,CACL,SAAU,QACV,KAAM,GAAGN,EAAgB,CAAC,KAC1B,IAAK,GAAGA,EAAgB,CAAC,KACzB,MAAO,EACP,OAAQ,CAAA,CACV,CAAA,EAEFK,EAAAA,IAACE,EAAAA,eAAA,CACC,UAAWC,EAAAA,GACT,iDACAb,CAAA,EAEF,MAAM,QACN,IAAAC,EACA,KAAAC,EACA,WAAY,EAEX,SAAAH,CAAA,CAAA,CACH,EACF,CAEJ,EAEAD,EAAc,YAAc"}
@@ -1,9 +1,17 @@
1
1
  import { default as React } from 'react';
2
+ import { MarkdownFlowDirection } from '../../../lib/locale.js';
2
3
  type CustomPopoverProps = {
3
4
  children?: React.ReactNode;
4
5
  };
5
6
  export interface CustomPopoverAllProps extends CustomPopoverProps {
6
7
  className?: string;
8
+ /**
9
+ * Sets "ltr" or "rtl" on the popover content, including its reading and layout direction.
10
+ * When omitted, the content inherits direction from its portal container, not the trigger.
11
+ */
12
+ dir?: MarkdownFlowDirection;
13
+ /** Language of the detached popover content. */
14
+ lang?: string;
7
15
  }
8
16
  declare const CustomPopover: React.FC<CustomPopoverAllProps>;
9
17
  export default CustomPopover;
@@ -1,16 +1,18 @@
1
- import { j as t } from "../../../_virtual/jsx-runtime.es.js";
2
- import { useContext as s } from "react";
3
- import { Popover as i, PopoverAnchor as m, PopoverContent as a } from "../../ui/popover.es.js";
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { useContext as a } from "react";
3
+ import { Popover as f, PopoverAnchor as d, PopoverContent as l } from "../../ui/popover.es.js";
4
4
  import x from "../editor-context.es.js";
5
- import { cn as f } from "../../../lib/utils.es.js";
6
- const d = ({
5
+ import { cn as u } from "../../../lib/utils.es.js";
6
+ const v = ({
7
7
  children: r,
8
- className: p
8
+ className: p,
9
+ dir: n,
10
+ lang: s
9
11
  }) => {
10
- const { popoverOpen: e, setPopoverOpen: n, popoverPosition: o } = s(x);
11
- return !e || !o ? null : /* @__PURE__ */ t.jsxs(i, { open: e, onOpenChange: n, children: [
12
- /* @__PURE__ */ t.jsx(
13
- m,
12
+ const { popoverOpen: e, setPopoverOpen: i, popoverPosition: o } = a(x);
13
+ return !e || !o ? null : /* @__PURE__ */ m(f, { open: e, onOpenChange: i, children: [
14
+ /* @__PURE__ */ t(
15
+ d,
14
16
  {
15
17
  style: {
16
18
  position: "fixed",
@@ -21,22 +23,24 @@ const d = ({
21
23
  }
22
24
  }
23
25
  ),
24
- /* @__PURE__ */ t.jsx(
25
- a,
26
+ /* @__PURE__ */ t(
27
+ l,
26
28
  {
27
- className: f(
29
+ className: u(
28
30
  "p-0 border-0 shadow-none bg-transparent w-auto",
29
31
  p
30
32
  ),
31
33
  align: "start",
34
+ dir: n,
35
+ lang: s,
32
36
  sideOffset: 5,
33
37
  children: r
34
38
  }
35
39
  )
36
40
  ] });
37
41
  };
38
- d.displayName = "CustomPopover";
42
+ v.displayName = "CustomPopover";
39
43
  export {
40
- d as default
44
+ v as default
41
45
  };
42
46
  //# sourceMappingURL=CustomPopover.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomPopover.es.js","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomPopover.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { Popover, PopoverContent, PopoverAnchor } from \"../../ui/popover\";\nimport EditorContext from \"../editor-context\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomPopoverProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomPopoverAllProps extends CustomPopoverProps {\n className?: string;\n}\n\nconst CustomPopover: React.FC<CustomPopoverAllProps> = ({\n children,\n className,\n}) => {\n const { popoverOpen, setPopoverOpen, popoverPosition } =\n useContext(EditorContext);\n\n if (!popoverOpen || !popoverPosition) {\n return null;\n }\n\n return (\n <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>\n <PopoverAnchor\n style={{\n position: \"fixed\",\n left: `${popoverPosition.x}px`,\n top: `${popoverPosition.y}px`,\n width: 0,\n height: 0,\n }}\n />\n <PopoverContent\n className={cn(\n \"p-0 border-0 shadow-none bg-transparent w-auto\",\n className\n )}\n align=\"start\"\n sideOffset={5}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n};\n\nCustomPopover.displayName = \"CustomPopover\";\n\nexport default CustomPopover;\n"],"names":["CustomPopover","children","className","popoverOpen","setPopoverOpen","popoverPosition","useContext","EditorContext","jsxs","Popover","jsx","PopoverAnchor","PopoverContent","cn"],"mappings":";;;;;AAaA,MAAMA,IAAiD,CAAC;AAAA,EACtD,UAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACJ,QAAM,EAAE,aAAAC,GAAa,gBAAAC,GAAgB,iBAAAC,EAAA,IACnCC,EAAWC,CAAa;AAE1B,SAAI,CAACJ,KAAe,CAACE,IACZ,OAIPG,gBAAAA,EAAAA,KAACC,GAAA,EAAQ,MAAMN,GAAa,cAAcC,GACxC,UAAA;AAAA,IAAAM,gBAAAA,EAAAA;AAAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,MAAM,GAAGN,EAAgB,CAAC;AAAA,UAC1B,KAAK,GAAGA,EAAgB,CAAC;AAAA,UACzB,OAAO;AAAA,UACP,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IAAA;AAAA,IAEFK,gBAAAA,EAAAA;AAAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAX;AAAA,QAAA;AAAA,QAEF,OAAM;AAAA,QACN,YAAY;AAAA,QAEX,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;AAEAD,EAAc,cAAc;"}
1
+ {"version":3,"file":"CustomPopover.es.js","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomPopover.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { Popover, PopoverContent, PopoverAnchor } from \"../../ui/popover\";\nimport EditorContext from \"../editor-context\";\nimport type { MarkdownFlowDirection } from \"../../../lib/locale\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomPopoverProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomPopoverAllProps extends CustomPopoverProps {\n className?: string;\n /**\n * Sets \"ltr\" or \"rtl\" on the popover content, including its reading and layout direction.\n * When omitted, the content inherits direction from its portal container, not the trigger.\n */\n dir?: MarkdownFlowDirection;\n /** Language of the detached popover content. */\n lang?: string;\n}\n\nconst CustomPopover: React.FC<CustomPopoverAllProps> = ({\n children,\n className,\n dir,\n lang,\n}) => {\n const { popoverOpen, setPopoverOpen, popoverPosition } =\n useContext(EditorContext);\n\n if (!popoverOpen || !popoverPosition) {\n return null;\n }\n\n return (\n <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>\n <PopoverAnchor\n style={{\n position: \"fixed\",\n left: `${popoverPosition.x}px`,\n top: `${popoverPosition.y}px`,\n width: 0,\n height: 0,\n }}\n />\n <PopoverContent\n className={cn(\n \"p-0 border-0 shadow-none bg-transparent w-auto\",\n className\n )}\n align=\"start\"\n dir={dir}\n lang={lang}\n sideOffset={5}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n};\n\nCustomPopover.displayName = \"CustomPopover\";\n\nexport default CustomPopover;\n"],"names":["CustomPopover","children","className","dir","lang","popoverOpen","setPopoverOpen","popoverPosition","useContext","EditorContext","jsxs","Popover","jsx","PopoverAnchor","PopoverContent","cn"],"mappings":";;;;;AAqBA,MAAMA,IAAiD,CAAC;AAAA,EACtD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,KAAAC;AAAA,EACA,MAAAC;AACF,MAAM;AACJ,QAAM,EAAE,aAAAC,GAAa,gBAAAC,GAAgB,iBAAAC,EAAA,IACnCC,EAAWC,CAAa;AAE1B,SAAI,CAACJ,KAAe,CAACE,IACZ,OAIP,gBAAAG,EAACC,GAAA,EAAQ,MAAMN,GAAa,cAAcC,GACxC,UAAA;AAAA,IAAA,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,MAAM,GAAGN,EAAgB,CAAC;AAAA,UAC1B,KAAK,GAAGA,EAAgB,CAAC;AAAA,UACzB,OAAO;AAAA,UACP,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IAAA;AAAA,IAEF,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAb;AAAA,QAAA;AAAA,QAEF,OAAM;AAAA,QACN,KAAAC;AAAA,QACA,MAAAC;AAAA,QACA,YAAY;AAAA,QAEX,UAAAH;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;AAEAD,EAAc,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../../_virtual/jsx-runtime.cjs"),s=require("react"),a=require("../types.cjs"),v=require("./icons/SearchBracesIcon.cjs"),z=require("./icons/ButtonIcon.cjs"),e=require("../../ui/tooltip.cjs"),W=require("../../../node_modules/lucide-react/dist/esm/icons/braces.cjs"),w=require("../../../node_modules/lucide-react/dist/esm/icons/circle-check.cjs"),I=require("../../../node_modules/lucide-react/dist/esm/icons/square-check.cjs"),O=require("../../../node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs"),S=require("../../../node_modules/lucide-react/dist/esm/icons/file-type.cjs"),B=require("../../../node_modules/lucide-react/dist/esm/icons/image.cjs"),M=require("../../../node_modules/lucide-react/dist/esm/icons/square-play.cjs"),r=18,N=({disabled:i=!1,labels:o,onSelect:n,onInsertVariablePlaceholder:x,onVariableSearchToggle:u,onVariableSearchClose:p,onInsertConfirmOutput:c,onInsertButton:j,onInsertSingleChoice:l,onInsertMultiChoice:h,onInsertInputField:m,variableSearchActive:E=!1,rightSlot:d})=>{const R=s.useCallback(()=>{i||(p?.(),x?.())},[i,x,p]),C=s.useCallback(y=>{i||u?.(y.currentTarget)},[i,u]),T=s.useCallback(()=>{i||c?.()},[i,c]),k=s.useCallback(()=>{i||j?.()},[i,j]),g=s.useCallback(()=>{i||l?.()},[i,l]),f=s.useCallback(()=>{i||h?.()},[i,h]),q=s.useCallback(()=>{i||m?.()},[i,m]);return t.jsxRuntimeExports.jsx(e.TooltipProvider,{delayDuration:150,children:t.jsxRuntimeExports.jsxs("div",{className:"markdown-flow-editor-toolbar","aria-disabled":i,children:[t.jsxRuntimeExports.jsxs("div",{className:"markdown-flow-editor-toolbar-left",children:[t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:R,children:t.jsxRuntimeExports.jsx(W.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.addVariable??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:C,"data-active":!i&&E?"true":void 0,"aria-label":o.search,title:o.search,children:t.jsxRuntimeExports.jsx(v.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.search??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:g,"aria-label":o.insertSingleChoice,title:o.insertSingleChoice,children:t.jsxRuntimeExports.jsx(w.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.insertSingleChoice??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:f,"aria-label":o.insertMultiChoice,title:o.insertMultiChoice,children:t.jsxRuntimeExports.jsx(I.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.insertMultiChoice??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:q,"aria-label":o.insertInput,title:o.insertInput,children:t.jsxRuntimeExports.jsx(O.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.insertInput??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:k,"aria-label":o.insertButton,title:o.insertButton,children:t.jsxRuntimeExports.jsx(z.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.insertButton??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:T,"aria-label":o.confirmOutput,title:o.confirmOutput,children:t.jsxRuntimeExports.jsx(S.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.confirmOutput??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:()=>n(a.SelectedOption.Image),"aria-label":o.image,title:o.image,children:t.jsxRuntimeExports.jsx(B.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.image??""})]}),t.jsxRuntimeExports.jsxs(e.Tooltip,{children:[t.jsxRuntimeExports.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsxRuntimeExports.jsx("button",{type:"button",disabled:i,onClick:()=>n(a.SelectedOption.Video),"aria-label":o.video,title:o.video,children:t.jsxRuntimeExports.jsx(M.default,{strokeWidth:1.75,size:r})})}),t.jsxRuntimeExports.jsx(e.TooltipContent,{side:"top",children:o.video??""})]})]}),d?t.jsxRuntimeExports.jsx("div",{className:"markdown-flow-editor-toolbar-right-wrapper",children:d}):null]})})},_=s.memo(N);exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),c=require("react"),T=require("../types.cjs"),O=require("./icons/SearchBracesIcon.cjs"),S=require("./icons/ButtonIcon.cjs"),e=require("../../ui/tooltip.cjs"),B=require("../../../node_modules/lucide-react/dist/esm/icons/braces.cjs"),M=require("../../../node_modules/lucide-react/dist/esm/icons/circle-check.cjs"),N=require("../../../node_modules/lucide-react/dist/esm/icons/square-check.cjs"),E=require("../../../node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs"),P=require("../../../node_modules/lucide-react/dist/esm/icons/file-type.cjs"),_=require("../../../node_modules/lucide-react/dist/esm/icons/image.cjs"),R=require("../../../node_modules/lucide-react/dist/esm/icons/square-play.cjs"),n=18,A=({disabled:i=!1,labels:r,tooltipDirection:g,tooltipLanguage:k,onSelect:s,onInsertVariablePlaceholder:l,onVariableSearchToggle:u,onVariableSearchClose:h,onInsertConfirmOutput:a,onInsertButton:d,onInsertSingleChoice:p,onInsertMultiChoice:j,onInsertInputField:x,variableSearchActive:f=!1,rightSlot:C})=>{const m=c.useCallback(()=>{i||(h?.(),l?.())},[i,l,h]),q=c.useCallback(I=>{i||u?.(I.currentTarget)},[i,u]),y=c.useCallback(()=>{i||a?.()},[i,a]),v=c.useCallback(()=>{i||d?.()},[i,d]),z=c.useCallback(()=>{i||p?.()},[i,p]),W=c.useCallback(()=>{i||j?.()},[i,j]),w=c.useCallback(()=>{i||x?.()},[i,x]),o={dir:g,lang:k,side:"top"};return t.jsx(e.TooltipProvider,{delayDuration:150,children:t.jsxs("div",{className:"markdown-flow-editor-toolbar","aria-disabled":i,children:[t.jsxs("div",{className:"markdown-flow-editor-toolbar-left",children:[t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:m,children:t.jsx(B.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.addVariable??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:q,"data-active":!i&&f?"true":void 0,"aria-label":r.search,title:r.search,children:t.jsx(O.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.search??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:z,"aria-label":r.insertSingleChoice,title:r.insertSingleChoice,children:t.jsx(M.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.insertSingleChoice??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:W,"aria-label":r.insertMultiChoice,title:r.insertMultiChoice,children:t.jsx(N.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.insertMultiChoice??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:w,"aria-label":r.insertInput,title:r.insertInput,children:t.jsx(E.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.insertInput??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:v,"aria-label":r.insertButton,title:r.insertButton,children:t.jsx(S.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.insertButton??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:y,"aria-label":r.confirmOutput,title:r.confirmOutput,children:t.jsx(P.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.confirmOutput??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:()=>s(T.SelectedOption.Image),"aria-label":r.image,title:r.image,children:t.jsx(_.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.image??""})]}),t.jsxs(e.Tooltip,{children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("button",{type:"button",disabled:i,onClick:()=>s(T.SelectedOption.Video),"aria-label":r.video,title:r.video,children:t.jsx(R.default,{strokeWidth:1.75,size:n})})}),t.jsx(e.TooltipContent,{...o,children:r.video??""})]})]}),C?t.jsx("div",{className:"markdown-flow-editor-toolbar-right-wrapper",children:C}):null]})})},D=c.memo(A);exports.default=D;
2
2
  //# sourceMappingURL=EditorToolbar.cjs.map