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

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