markdown-flow-ui 0.3.5 → 0.3.7

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 (352) hide show
  1. package/dist/_virtual/index8.cjs +1 -1
  2. package/dist/_virtual/index8.es.js +2 -2
  3. package/dist/_virtual/index9.cjs +1 -1
  4. package/dist/_virtual/index9.es.js +2 -2
  5. package/dist/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  7. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  8. package/dist/components/ContentRender/ContentRender.d.ts +2 -0
  9. package/dist/components/ContentRender/ContentRender.es.js +513 -509
  10. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  11. package/dist/components/ContentRender/MarkdownFlowInput.cjs +1 -1
  12. package/dist/components/ContentRender/MarkdownFlowInput.cjs.map +1 -1
  13. package/dist/components/ContentRender/MarkdownFlowInput.d.ts +2 -0
  14. package/dist/components/ContentRender/MarkdownFlowInput.es.js +40 -38
  15. package/dist/components/ContentRender/MarkdownFlowInput.es.js.map +1 -1
  16. package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
  17. package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
  18. package/dist/components/ContentRender/plugins/CustomVariable.d.ts +2 -1
  19. package/dist/components/ContentRender/plugins/CustomVariable.es.js +110 -90
  20. package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
  21. package/dist/components/ContentRender/utils/accept-placeholder.cjs +2 -0
  22. package/dist/components/ContentRender/utils/accept-placeholder.cjs.map +1 -0
  23. package/dist/components/ContentRender/utils/accept-placeholder.d.ts +3 -0
  24. package/dist/components/ContentRender/utils/accept-placeholder.es.js +10 -0
  25. package/dist/components/ContentRender/utils/accept-placeholder.es.js.map +1 -0
  26. package/dist/components/MarkdownFlow/MarkdownFlow.cjs +1 -1
  27. package/dist/components/MarkdownFlow/MarkdownFlow.cjs.map +1 -1
  28. package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +2 -0
  29. package/dist/components/MarkdownFlow/MarkdownFlow.es.js +23 -21
  30. package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
  31. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
  32. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
  33. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +145 -143
  34. package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
  35. package/dist/components/Slide/Slide.cjs +1 -1
  36. package/dist/components/Slide/Slide.cjs.map +1 -1
  37. package/dist/components/Slide/Slide.d.ts +2 -0
  38. package/dist/components/Slide/Slide.es.js +348 -344
  39. package/dist/components/Slide/Slide.es.js.map +1 -1
  40. package/dist/markdown-flow-ui-lib.css +1 -1
  41. package/dist/markdown-flow-ui.css +1 -1
  42. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  43. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  44. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -0
  45. package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -0
  46. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -1
  47. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
  48. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +92 -89
  49. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
  50. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +2 -0
  51. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -0
  52. package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-popper → react-popper}/dist/index.es.js +5 -5
  53. package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -0
  54. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
  55. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
  56. package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +50 -47
  57. package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
  58. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +1 -1
  59. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs.map +1 -1
  60. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js +9 -9
  61. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +1 -1
  62. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
  63. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +10 -7
  64. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -1
  65. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
  66. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs.map +1 -1
  67. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +1 -1
  68. package/dist/node_modules/classnames/index.cjs +1 -1
  69. package/dist/node_modules/classnames/index.es.js +1 -1
  70. package/dist/node_modules/i18next/dist/esm/i18next.cjs +1 -1
  71. package/dist/node_modules/i18next/dist/esm/i18next.cjs.map +1 -1
  72. package/dist/node_modules/i18next/dist/esm/i18next.es.js +809 -900
  73. package/dist/node_modules/i18next/dist/esm/i18next.es.js.map +1 -1
  74. package/dist/node_modules/katex/dist/katex.cjs +14 -14
  75. package/dist/node_modules/katex/dist/katex.cjs.map +1 -1
  76. package/dist/node_modules/katex/dist/katex.es.js +1302 -1192
  77. package/dist/node_modules/katex/dist/katex.es.js.map +1 -1
  78. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -1
  79. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
  80. package/dist/node_modules/lucide-react/dist/esm/Icon.es.js +52 -29
  81. package/dist/node_modules/lucide-react/dist/esm/Icon.es.js.map +1 -1
  82. package/dist/node_modules/lucide-react/dist/esm/context.cjs +2 -0
  83. package/dist/node_modules/lucide-react/dist/esm/context.cjs.map +1 -0
  84. package/dist/node_modules/lucide-react/dist/esm/context.es.js +6 -0
  85. package/dist/node_modules/lucide-react/dist/esm/context.es.js.map +1 -0
  86. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -1
  87. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
  88. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js +13 -16
  89. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js.map +1 -1
  90. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs +1 -1
  91. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.map +1 -1
  92. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +16 -10
  93. package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -1
  94. package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs +1 -1
  95. package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs.map +1 -1
  96. package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js +13 -6
  97. package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -1
  98. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -1
  99. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
  100. package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js +8 -2
  101. package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js.map +1 -1
  102. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +1 -1
  103. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.map +1 -1
  104. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js +10 -4
  105. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js.map +1 -1
  106. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs +1 -1
  107. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -1
  108. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js +12 -6
  109. package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -1
  110. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs +1 -1
  111. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.map +1 -1
  112. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js +14 -7
  113. package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js.map +1 -1
  114. package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs +1 -1
  115. package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs.map +1 -1
  116. package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js +11 -5
  117. package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js.map +1 -1
  118. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs +1 -1
  119. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.map +1 -1
  120. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js +13 -6
  121. package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js.map +1 -1
  122. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs +1 -1
  123. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs.map +1 -1
  124. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js +22 -7
  125. package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js.map +1 -1
  126. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs +1 -1
  127. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs.map +1 -1
  128. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js +20 -8
  129. package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js.map +1 -1
  130. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs +1 -1
  131. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.map +1 -1
  132. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +17 -11
  133. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +1 -1
  134. package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs +1 -1
  135. package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs.map +1 -1
  136. package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js +14 -8
  137. package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js.map +1 -1
  138. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -1
  139. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.map +1 -1
  140. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js +11 -4
  141. package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js.map +1 -1
  142. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs +1 -1
  143. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs.map +1 -1
  144. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js +15 -9
  145. package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js.map +1 -1
  146. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs +1 -1
  147. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs.map +1 -1
  148. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js +25 -7
  149. package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js.map +1 -1
  150. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs +1 -1
  151. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.map +1 -1
  152. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js +16 -10
  153. package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js.map +1 -1
  154. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs +1 -1
  155. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.map +1 -1
  156. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js +19 -7
  157. package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js.map +1 -1
  158. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs +1 -1
  159. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.map +1 -1
  160. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js +19 -7
  161. package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js.map +1 -1
  162. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs +1 -1
  163. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs.map +1 -1
  164. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js +14 -7
  165. package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js.map +1 -1
  166. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs +1 -1
  167. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs.map +1 -1
  168. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js +19 -6
  169. package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js.map +1 -1
  170. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs +1 -1
  171. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs.map +1 -1
  172. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js +15 -9
  173. package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js.map +1 -1
  174. package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs +1 -1
  175. package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs.map +1 -1
  176. package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js +13 -7
  177. package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js.map +1 -1
  178. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs +1 -1
  179. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.map +1 -1
  180. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js +19 -13
  181. package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js.map +1 -1
  182. package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -1
  183. package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.map +1 -1
  184. package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js +13 -7
  185. package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js.map +1 -1
  186. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs +2 -0
  187. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs.map +1 -0
  188. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js +18 -0
  189. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js.map +1 -0
  190. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs +2 -0
  191. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs.map +1 -0
  192. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js +44 -0
  193. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js.map +1 -0
  194. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs +2 -0
  195. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs.map +1 -0
  196. package/dist/node_modules/lucide-react/dist/esm/{defaultAttributes.es.js → shared/src/build/defaultAttributes.es.js} +4 -4
  197. package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.es.js.map +1 -0
  198. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs +2 -0
  199. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs.map +1 -0
  200. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js +10 -0
  201. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js.map +1 -0
  202. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs +2 -0
  203. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs.map +1 -0
  204. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js +5 -0
  205. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js.map +1 -0
  206. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs +2 -0
  207. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs.map +1 -0
  208. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js +15 -0
  209. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js.map +1 -0
  210. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs +2 -0
  211. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs.map +1 -0
  212. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js +5 -0
  213. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js.map +1 -0
  214. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs +2 -0
  215. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs.map +1 -0
  216. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js +15 -0
  217. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js.map +1 -0
  218. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs +2 -0
  219. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs.map +1 -0
  220. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js +9 -0
  221. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js.map +1 -0
  222. package/dist/node_modules/micromark/lib/create-tokenizer.cjs +3 -3
  223. package/dist/node_modules/micromark/lib/create-tokenizer.cjs.map +1 -1
  224. package/dist/node_modules/micromark/lib/create-tokenizer.es.js +78 -76
  225. package/dist/node_modules/micromark/lib/create-tokenizer.es.js.map +1 -1
  226. package/dist/node_modules/micromark/lib/initialize/document.cjs +1 -1
  227. package/dist/node_modules/micromark/lib/initialize/document.cjs.map +1 -1
  228. package/dist/node_modules/micromark/lib/initialize/document.es.js +77 -75
  229. package/dist/node_modules/micromark/lib/initialize/document.es.js.map +1 -1
  230. package/dist/node_modules/micromark/lib/initialize/text.cjs +1 -1
  231. package/dist/node_modules/micromark/lib/initialize/text.cjs.map +1 -1
  232. package/dist/node_modules/micromark/lib/initialize/text.es.js +67 -64
  233. package/dist/node_modules/micromark/lib/initialize/text.es.js.map +1 -1
  234. package/dist/node_modules/micromark/lib/preprocess.cjs +1 -1
  235. package/dist/node_modules/micromark/lib/preprocess.cjs.map +1 -1
  236. package/dist/node_modules/micromark/lib/preprocess.es.js +19 -14
  237. package/dist/node_modules/micromark/lib/preprocess.es.js.map +1 -1
  238. package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs +1 -1
  239. package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs.map +1 -1
  240. package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js +36 -32
  241. package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js.map +1 -1
  242. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs +1 -1
  243. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +1 -1
  244. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js +49 -61
  245. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js.map +1 -1
  246. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs +1 -1
  247. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +1 -1
  248. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js +21 -27
  249. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js.map +1 -1
  250. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs +1 -1
  251. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +1 -1
  252. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js +18 -14
  253. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js.map +1 -1
  254. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs +1 -1
  255. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +1 -1
  256. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js +59 -71
  257. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js.map +1 -1
  258. package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs +1 -1
  259. package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs.map +1 -1
  260. package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js +87 -85
  261. package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js.map +1 -1
  262. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs +1 -1
  263. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +1 -1
  264. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js +11 -10
  265. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js.map +1 -1
  266. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs +1 -1
  267. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +1 -1
  268. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js +12 -11
  269. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js.map +1 -1
  270. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs +2 -0
  271. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs.map +1 -0
  272. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js +18 -0
  273. package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js.map +1 -0
  274. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs +1 -1
  275. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +1 -1
  276. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js +35 -33
  277. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js.map +1 -1
  278. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs +1 -1
  279. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs.map +1 -1
  280. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js +32 -28
  281. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js.map +1 -1
  282. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs +1 -1
  283. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs.map +1 -1
  284. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js +18 -14
  285. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js.map +1 -1
  286. package/dist/node_modules/micromark-factory-space/index.cjs +1 -1
  287. package/dist/node_modules/micromark-factory-space/index.cjs.map +1 -1
  288. package/dist/node_modules/micromark-factory-space/index.es.js +24 -10
  289. package/dist/node_modules/micromark-factory-space/index.es.js.map +1 -1
  290. package/dist/node_modules/micromark-util-edit-map/index.cjs +2 -0
  291. package/dist/node_modules/micromark-util-edit-map/index.cjs.map +1 -0
  292. package/dist/node_modules/micromark-util-edit-map/index.es.js +83 -0
  293. package/dist/node_modules/micromark-util-edit-map/index.es.js.map +1 -0
  294. package/package.json +24 -17
  295. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs +0 -2
  296. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs.map +0 -1
  297. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js +0 -50
  298. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js.map +0 -1
  299. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +0 -1
  300. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +0 -1
  301. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs +0 -2
  302. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs.map +0 -1
  303. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js +0 -82
  304. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js.map +0 -1
  305. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +0 -2
  306. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +0 -1
  307. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +0 -216
  308. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +0 -1
  309. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +0 -2
  310. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +0 -1
  311. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +0 -105
  312. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +0 -1
  313. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs +0 -2
  314. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs.map +0 -1
  315. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.es.js.map +0 -1
  316. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs +0 -2
  317. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs.map +0 -1
  318. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js +0 -18
  319. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js.map +0 -1
  320. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
  321. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
  322. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
  323. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
  324. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
  325. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
  326. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
  327. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
  328. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -2
  329. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +0 -1
  330. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +0 -16
  331. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +0 -1
  332. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +0 -2
  333. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +0 -1
  334. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +0 -70
  335. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +0 -1
  336. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
  337. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
  338. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
  339. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
  340. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
  341. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
  342. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
  343. package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
  344. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +0 -2
  345. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +0 -1
  346. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.es.js.map +0 -1
  347. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +0 -2
  348. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +0 -1
  349. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js +0 -19
  350. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js.map +0 -1
  351. /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.cjs +0 -0
  352. /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.es.js +0 -0
@@ -1,207 +1,209 @@
1
- import { ViewPlugin as H, Decoration as P } from "../../../node_modules/@codemirror/view/dist/index.es.js";
2
- import { RangeSetBuilder as L } from "../../../node_modules/@codemirror/state/dist/index.es.js";
3
- import { getMarkdownSourceAnalysis as _ } from "../../ContentRender/utils/inline-code-ranges.es.js";
4
- import { d as A } from "../../../_virtual/index.es.js";
5
- import { findDocumentVariableMarkers as B, trimVariablePadding as U, findVariableMarkers as $ } from "../utils.es.js";
6
- const M = /<!--[\s\S]*?-->/g, F = (n) => {
7
- const i = $(n), f = n.indexOf("{{", i.at(-1)?.end ?? 0);
8
- return f === -1 ? i : [...i, { start: f, end: n.length, name: null }];
9
- }, V = new RegExp(
10
- `\\?\\[(${A.INTERACTION_CONTENT_SOURCE})\\](?!\\()`,
1
+ import { ViewPlugin as _, Decoration as U } from "../../../node_modules/@codemirror/view/dist/index.es.js";
2
+ import { RangeSetBuilder as $ } from "../../../node_modules/@codemirror/state/dist/index.es.js";
3
+ import { getMarkdownSourceAnalysis as j } from "../../ContentRender/utils/inline-code-ranges.es.js";
4
+ import { d as P } from "../../../_virtual/index.es.js";
5
+ import { findDocumentVariableMarkers as B, trimVariablePadding as M, findVariableMarkers as q } from "../utils.es.js";
6
+ const F = /<!--[\s\S]*?-->/g, W = (n) => {
7
+ const l = q(n), f = n.indexOf("{{", l.at(-1)?.end ?? 0);
8
+ return f === -1 ? l : [...l, { start: f, end: n.length, name: null }];
9
+ }, C = new RegExp(
10
+ `\\?\\[(${P.INTERACTION_CONTENT_SOURCE})\\](?!\\()`,
11
11
  "g"
12
- ), j = (n) => _(n).interactions;
13
- function q(n, i) {
12
+ ), z = (n) => j(n).interactions;
13
+ function G(n, l) {
14
14
  const f = [];
15
- let l = null, s = 0;
15
+ let c = null, s = 0;
16
16
  for (; s <= n.length; ) {
17
- const u = n.indexOf(`
18
- `, s), e = u === -1 ? n.length : u;
19
- if (n.slice(s, e).trim() === "!===" && !i(s) && (l === null ? l = s : (f.push({
20
- from: l,
21
- to: e,
17
+ const m = n.indexOf(`
18
+ `, s), o = m === -1 ? n.length : m;
19
+ if (n.slice(s, o).trim() === "!===" && !l(s) && (c === null ? c = s : (f.push({
20
+ from: c,
21
+ to: o,
22
22
  className: "syntax-fixed"
23
- }), l = null)), u === -1)
23
+ }), c = null)), m === -1)
24
24
  break;
25
- s = u + 1;
25
+ s = m + 1;
26
26
  }
27
27
  return f;
28
28
  }
29
- function z(n, i, f) {
30
- const l = [];
29
+ function J(n, l, f) {
30
+ const c = [];
31
31
  let s = 0;
32
- const u = (t) => {
33
- for (; s < i.length && i[s].to <= t; )
32
+ const m = (t) => {
33
+ for (; s < l.length && l[s].to <= t; )
34
34
  s++;
35
- const r = i[s];
35
+ const r = l[s];
36
36
  return !!r && t >= r.from && t < r.to;
37
37
  };
38
- let e = 0;
39
- for (; e <= n.length; ) {
38
+ let o = 0;
39
+ for (; o <= n.length; ) {
40
40
  const t = n.indexOf(`
41
- `, e), r = t === -1 ? n.length : t, d = n.slice(e, r), x = [];
42
- let g = 0;
43
- for (; g < d.length; ) {
44
- const c = d.indexOf("===", g);
45
- if (c === -1)
41
+ `, o), r = t === -1 ? n.length : t, u = n.slice(o, r), x = [];
42
+ let d = 0;
43
+ for (; d < u.length; ) {
44
+ const a = u.indexOf("===", d);
45
+ if (a === -1)
46
46
  break;
47
- const p = e + c;
48
- !(p > 0 && n[p - 1] === "!") && !u(p) && !f(p) && x.push(p), g = c + 3;
47
+ const y = o + a;
48
+ !(y > 0 && n[y - 1] === "!") && !m(y) && !f(y) && x.push(y), d = a + 3;
49
49
  }
50
- for (let c = 0; c + 1 < x.length; c += 2)
51
- l.push({
52
- from: x[c],
53
- to: x[c + 1] + 3,
50
+ for (let a = 0; a + 1 < x.length; a += 2)
51
+ c.push({
52
+ from: x[a],
53
+ to: x[a + 1] + 3,
54
54
  className: "syntax-fixed"
55
55
  });
56
56
  if (t === -1)
57
57
  break;
58
- e = t + 1;
58
+ o = t + 1;
59
59
  }
60
- return l;
60
+ return c;
61
61
  }
62
- function G(n, i) {
62
+ function K(n, l) {
63
63
  const f = [];
64
- let l;
65
- for (M.lastIndex = 0; (l = M.exec(n)) !== null; )
66
- i(l.index) || f.push({
67
- from: l.index,
68
- to: l.index + l[0].length,
64
+ let c;
65
+ for (F.lastIndex = 0; (c = F.exec(n)) !== null; )
66
+ l(c.index) || f.push({
67
+ from: c.index,
68
+ to: c.index + c[0].length,
69
69
  className: "syntax-comment"
70
70
  });
71
71
  return f;
72
72
  }
73
- function J(n) {
74
- const i = B(n), f = (e) => i.some(
75
- (t) => e >= t.start && e < t.end
76
- ), l = G(n, f), s = [
77
- ...q(n, f),
78
- ...z(
73
+ function Q(n) {
74
+ const l = B(n), f = (o) => l.some(
75
+ (t) => o >= t.start && o < t.end
76
+ ), c = K(n, f), s = [
77
+ ...G(n, f),
78
+ ...J(
79
79
  n,
80
- l,
80
+ c,
81
81
  f
82
82
  ),
83
- ...l
84
- ].sort((e, t) => e.from !== t.from ? e.from - t.from : t.to - e.to), u = [];
85
- for (const e of s) {
86
- const t = u[u.length - 1];
87
- (!t || e.from >= t.to) && u.push(e);
83
+ ...c
84
+ ].sort((o, t) => o.from !== t.from ? o.from - t.from : t.to - o.to), m = [];
85
+ for (const o of s) {
86
+ const t = m[m.length - 1];
87
+ (!t || o.from >= t.to) && m.push(o);
88
88
  }
89
- return u;
89
+ return m;
90
90
  }
91
- function K(n, i = () => !1) {
92
- const f = [], l = B(n), s = [];
93
- V.lastIndex = 0;
94
- const u = (t, r) => s.some((d) => !(r <= d.from || t >= d.to)), e = (t, r, d) => t >= r || u(t, r) ? !1 : (s.push({ from: t, to: r }), f.push({ from: t, to: r, className: d }), !0);
95
- for (const t of J(n))
96
- e(t.from, t.to, t.className);
97
- for (const t of j(n)) {
98
- V.lastIndex = t.start;
99
- const r = V.exec(n);
91
+ function T(n, l = () => !1) {
92
+ const f = [], c = B(n), s = [];
93
+ C.lastIndex = 0;
94
+ const m = (t, r) => s.some((u) => !(r <= u.from || t >= u.to)), o = (t, r, u) => t >= r || m(t, r) ? !1 : (s.push({ from: t, to: r }), f.push({ from: t, to: r, className: u }), !0);
95
+ for (const t of Q(n))
96
+ o(t.from, t.to, t.className);
97
+ for (const t of z(n)) {
98
+ C.lastIndex = t.start;
99
+ const r = C.exec(n);
100
100
  if (!r || r.index !== t.start || r.index + r[0].length !== t.end)
101
101
  continue;
102
- const d = r.index, x = r.index + r[0].length, g = r[1], c = d + 2;
103
- if (u(d, x) || l.some(
104
- (b) => b.start <= d && d < b.end
102
+ const u = r.index, x = r.index + r[0].length, d = r[1], a = u + 2;
103
+ if (m(u, x) || c.some(
104
+ (b) => b.start <= u && u < b.end
105
105
  ))
106
106
  continue;
107
- e(d, d + 1, "syntax-keyword"), e(d + 1, d + 2, "syntax-bracket"), e(x - 1, x, "syntax-bracket");
108
- const p = F(g), y = p[0], w = y ? y.start - 1 : -1, E = w >= 0 && g[w] === "%" && U(g.slice(0, w)) === "";
109
- if (g.startsWith("%") || E) {
110
- let b = "syntax-percent-invalid";
111
- if (y && E) {
112
- const o = c + y.start, h = c + y.end, I = i(o, h);
113
- b = y.name !== null && !I ? "syntax-percent-valid" : "syntax-percent-invalid";
107
+ o(u, u + 1, "syntax-keyword"), o(u + 1, u + 2, "syntax-bracket"), o(x - 1, x, "syntax-bracket");
108
+ const y = W(d), p = y[0], w = p ? p.start - 1 : -1, V = w >= 0 && d[w] === "%" && M(d.slice(0, w)) === "", D = p && M(d.slice(0, p.start)) === "", E = d.startsWith("%") || V;
109
+ if (E || D) {
110
+ const b = a + (V ? w : 0);
111
+ if (E) {
112
+ let e = "syntax-percent-invalid";
113
+ if (p && V) {
114
+ const h = a + p.start, I = a + p.end, L = l(h, I);
115
+ e = p.name !== null && !L ? "syntax-percent-valid" : "syntax-percent-invalid";
116
+ }
117
+ o(b, b + 1, e);
114
118
  }
115
- const v = c + (E ? w : 0);
116
- e(v, v + 1, b);
117
- const O = [], N = [], R = [];
118
- for (const o of p)
119
- N.push({
120
- from: c + o.start,
121
- to: c + o.end,
122
- className: o.name === null ? "syntax-variable-invalid" : "syntax-variable"
119
+ const R = [], S = [], O = [];
120
+ for (const e of y)
121
+ S.push({
122
+ from: a + e.start,
123
+ to: a + e.end,
124
+ className: e.name === null ? "syntax-variable-invalid" : "syntax-variable"
123
125
  });
124
- let m = 0;
125
- for (; m < g.length; ) {
126
- const o = N.find(
127
- (I) => c + m === I.from
126
+ let g = 0;
127
+ for (; g < d.length; ) {
128
+ const e = S.find(
129
+ (I) => a + g === I.from
128
130
  );
129
- if (o) {
130
- m = o.to - c;
131
+ if (e) {
132
+ g = e.to - a;
131
133
  continue;
132
134
  }
133
- if (A.isEscape(g, m)) {
134
- m += 2;
135
+ if (P.isEscape(d, g)) {
136
+ g += 2;
135
137
  continue;
136
138
  }
137
- const h = g.startsWith("||", m) ? "||" : g[m] === "|" ? "|" : g.startsWith("...", m) ? "..." : null;
139
+ const h = d.startsWith("||", g) ? "||" : d[g] === "|" ? "|" : d.startsWith("...", g) ? "..." : null;
138
140
  if (!h) {
139
- m += 1;
141
+ g += 1;
140
142
  continue;
141
143
  }
142
- O.push({
143
- from: c + m,
144
- to: c + m + h.length
145
- }), m += h.length;
144
+ R.push({
145
+ from: a + g,
146
+ to: a + g + h.length
147
+ }), g += h.length;
146
148
  }
147
- const a = [
148
- ...O.map((o) => ({
149
- ...o,
149
+ const v = [
150
+ ...R.map((e) => ({
151
+ ...e,
150
152
  className: "syntax-keyword"
151
153
  })),
152
- ...N.map((o) => ({
153
- ...o,
154
- className: o.className
154
+ ...S.map((e) => ({
155
+ ...e,
156
+ className: e.className
155
157
  }))
156
- ].sort((o, h) => o.from !== h.from ? o.from - h.from : o.to - h.to);
157
- for (const o of a)
158
- o.className.startsWith("syntax-variable") && i(o.from, o.to) || e(o.from, o.to, o.className) && R.push({ from: o.from, to: o.to });
159
- const S = v + 1, C = x - 1;
160
- let k = S;
161
- const D = R.sort((o, h) => o.from !== h.from ? o.from - h.from : o.to - h.to);
162
- for (const o of D)
163
- k < o.from && e(k, o.from, "syntax-string"), k = Math.max(k, o.to);
164
- k < C && e(k, C, "syntax-string");
158
+ ].sort((e, h) => e.from !== h.from ? e.from - h.from : e.to - h.to);
159
+ for (const e of v)
160
+ e.className.startsWith("syntax-variable") && l(e.from, e.to) || o(e.from, e.to, e.className) && O.push({ from: e.from, to: e.to });
161
+ const i = E ? b + 1 : a, k = x - 1;
162
+ let N = i;
163
+ const H = O.sort((e, h) => e.from !== h.from ? e.from - h.from : e.to - h.to);
164
+ for (const e of H)
165
+ N < e.from && o(N, e.from, "syntax-string"), N = Math.max(N, e.to);
166
+ N < k && o(N, k, "syntax-string");
165
167
  } else {
166
- const b = [], v = [];
167
- for (const a of F(g))
168
+ const b = [], R = [];
169
+ for (const i of W(d))
168
170
  b.push({
169
- from: c + a.start,
170
- to: c + a.end,
171
- className: a.name === null ? "syntax-variable-invalid" : "syntax-variable"
171
+ from: a + i.start,
172
+ to: a + i.end,
173
+ className: i.name === null ? "syntax-variable-invalid" : "syntax-variable"
172
174
  });
173
- const O = b.sort((a, S) => a.from !== S.from ? a.from - S.from : a.to - S.to);
174
- for (const a of O)
175
- a.className.startsWith("syntax-variable") && i(a.from, a.to) || e(a.from, a.to, a.className) && v.push({ from: a.from, to: a.to });
176
- const N = c, R = x - 1;
177
- let m = N;
178
- for (const a of v)
179
- m < a.from && e(m, a.from, "syntax-button-text"), m = Math.max(m, a.to);
180
- m < R && e(m, R, "syntax-button-text");
175
+ const S = b.sort((i, k) => i.from !== k.from ? i.from - k.from : i.to - k.to);
176
+ for (const i of S)
177
+ i.className.startsWith("syntax-variable") && l(i.from, i.to) || o(i.from, i.to, i.className) && R.push({ from: i.from, to: i.to });
178
+ const O = a, g = x - 1;
179
+ let v = O;
180
+ for (const i of R)
181
+ v < i.from && o(v, i.from, "syntax-button-text"), v = Math.max(v, i.to);
182
+ v < g && o(v, g, "syntax-button-text");
181
183
  }
182
184
  }
183
- for (const t of l)
184
- t.name !== null && !i(t.start, t.end) && e(t.start, t.end, "syntax-variable");
185
+ for (const t of c)
186
+ t.name !== null && !l(t.start, t.end) && o(t.start, t.end, "syntax-variable");
185
187
  return f.sort((t, r) => t.from !== r.from ? t.from - r.from : r.to - t.to), f;
186
188
  }
187
- function W(n) {
188
- const i = new L(), f = n.state.doc.toString(), l = K(f, (s, u) => n.state.selection.ranges.some((e) => e.from >= s && e.to <= u));
189
- for (const s of l)
189
+ function A(n) {
190
+ const l = new $(), f = n.state.doc.toString(), c = T(f, (s, m) => n.state.selection.ranges.some((o) => o.from >= s && o.to <= m));
191
+ for (const s of c)
190
192
  if (s.from < s.to)
191
193
  try {
192
- i.add(s.from, s.to, P.mark({ class: s.className }));
193
- } catch (u) {
194
- console.warn("SyntaxHighlighter: Failed to add decoration", s, u);
194
+ l.add(s.from, s.to, U.mark({ class: s.className }));
195
+ } catch (m) {
196
+ console.warn("SyntaxHighlighter: Failed to add decoration", s, m);
195
197
  }
196
- return i.finish();
198
+ return l.finish();
197
199
  }
198
- const tt = H.fromClass(
200
+ const et = _.fromClass(
199
201
  class {
200
202
  constructor(n) {
201
- this.decorations = W(n);
203
+ this.decorations = A(n);
202
204
  }
203
205
  update(n) {
204
- (n.docChanged || n.viewportChanged || n.selectionSet) && (this.decorations = W(n.view));
206
+ (n.docChanged || n.viewportChanged || n.selectionSet) && (this.decorations = A(n.view));
205
207
  }
206
208
  },
207
209
  {
@@ -209,8 +211,8 @@ const tt = H.fromClass(
209
211
  }
210
212
  );
211
213
  export {
212
- J as collectOuterBlockRanges,
213
- K as collectSyntaxHighlightRanges,
214
- tt as default
214
+ Q as collectOuterBlockRanges,
215
+ T as collectSyntaxHighlightRanges,
216
+ et as default
215
217
  };
216
218
  //# sourceMappingURL=SyntaxHighlighter.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SyntaxHighlighter.es.js","sources":["../../../../src/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.ts"],"sourcesContent":["import {\n Decoration,\n DecorationSet,\n EditorView,\n ViewPlugin,\n ViewUpdate,\n} from \"@codemirror/view\";\nimport { RangeSetBuilder } from \"@codemirror/state\";\nimport { getMarkdownSourceAnalysis } from \"../../ContentRender/utils/inline-code-ranges\";\nimport { INTERACTION_CONTENT_SOURCE, isEscape } from \"remark-flow\";\n\nimport {\n findVariableMarkers,\n findDocumentVariableMarkers,\n trimVariablePadding,\n} from \"../utils\";\n\nconst commentRegex = /<!--[\\s\\S]*?-->/g;\n\n// An unfinished marker still owns its tail, so nested syntax stays literal while typing.\nconst interactionVariableRanges = (text: string) => {\n const markers = findVariableMarkers(text);\n const pending = text.indexOf(\"{{\", markers.at(-1)?.end ?? 0);\n return pending === -1\n ? markers\n : [...markers, { start: pending, end: text.length, name: null }];\n};\n// The grammar's own definition of where an interaction ends, so a `\\]` an option escaped does\n// not cut the highlight short, and the same `(?!\\()` the parser uses, so `?[text](url)` stays a\n// markdown link. Taken from remark-flow rather than written again here: the editor and the\n// parser have to agree about what they are looking at.\nconst controlBlockRegex = new RegExp(\n `\\\\?\\\\[(${INTERACTION_CONTENT_SOURCE})\\\\](?!\\\\()`,\n \"g\"\n);\n\nconst documentControlRanges = (text: string) =>\n getMarkdownSourceAnalysis(text).interactions;\n\nexport interface SyntaxHighlightRange {\n from: number;\n to: number;\n className: string;\n}\n\nfunction collectMultilineFixedOutputRanges(\n docText: string,\n isInsideVariable: (position: number) => boolean\n): SyntaxHighlightRange[] {\n const ranges: SyntaxHighlightRange[] = [];\n let pendingStart: number | null = null;\n let lineStart = 0;\n\n while (lineStart <= docText.length) {\n const newlineIndex = docText.indexOf(\"\\n\", lineStart);\n const lineEnd = newlineIndex === -1 ? docText.length : newlineIndex;\n const lineText = docText.slice(lineStart, lineEnd);\n\n if (lineText.trim() === \"!===\" && !isInsideVariable(lineStart)) {\n if (pendingStart === null) {\n pendingStart = lineStart;\n } else {\n ranges.push({\n from: pendingStart,\n to: lineEnd,\n className: \"syntax-fixed\",\n });\n pendingStart = null;\n }\n }\n\n if (newlineIndex === -1) {\n break;\n }\n\n lineStart = newlineIndex + 1;\n }\n\n return ranges;\n}\n\nfunction collectSingleLineFixedOutputRanges(\n docText: string,\n commentRanges: SyntaxHighlightRange[],\n isInsideVariable: (position: number) => boolean\n): SyntaxHighlightRange[] {\n const ranges: SyntaxHighlightRange[] = [];\n let commentIndex = 0;\n\n const isInsideComment = (index: number) => {\n while (\n commentIndex < commentRanges.length &&\n commentRanges[commentIndex].to <= index\n ) {\n commentIndex++;\n }\n\n const range = commentRanges[commentIndex];\n return !!range && index >= range.from && index < range.to;\n };\n\n let lineStart = 0;\n while (lineStart <= docText.length) {\n const newlineIndex = docText.indexOf(\"\\n\", lineStart);\n const lineEnd = newlineIndex === -1 ? docText.length : newlineIndex;\n const lineText = docText.slice(lineStart, lineEnd);\n const markerPositions: number[] = [];\n let searchFrom = 0;\n\n while (searchFrom < lineText.length) {\n const markerOffset = lineText.indexOf(\"===\", searchFrom);\n if (markerOffset === -1) {\n break;\n }\n\n const markerIndex = lineStart + markerOffset;\n const isNegated = markerIndex > 0 && docText[markerIndex - 1] === \"!\";\n if (\n !isNegated &&\n !isInsideComment(markerIndex) &&\n !isInsideVariable(markerIndex)\n ) {\n markerPositions.push(markerIndex);\n }\n\n searchFrom = markerOffset + 3;\n }\n\n for (let i = 0; i + 1 < markerPositions.length; i += 2) {\n ranges.push({\n from: markerPositions[i],\n to: markerPositions[i + 1] + 3,\n className: \"syntax-fixed\",\n });\n }\n\n if (newlineIndex === -1) {\n break;\n }\n\n lineStart = newlineIndex + 1;\n }\n\n return ranges;\n}\n\nfunction collectCommentRanges(\n docText: string,\n isInsideVariable: (position: number) => boolean\n): SyntaxHighlightRange[] {\n const ranges: SyntaxHighlightRange[] = [];\n let match;\n\n commentRegex.lastIndex = 0;\n while ((match = commentRegex.exec(docText)) !== null) {\n if (isInsideVariable(match.index)) continue;\n ranges.push({\n from: match.index,\n to: match.index + match[0].length,\n className: \"syntax-comment\",\n });\n }\n\n return ranges;\n}\n\n/**\n * Collects non-overlapping preserved output and comment wrapper ranges.\n *\n * @param docText - Document text to scan.\n * @returns Outer syntax highlight ranges sorted by document position.\n */\nexport function collectOuterBlockRanges(\n docText: string\n): SyntaxHighlightRange[] {\n const variables = findDocumentVariableMarkers(docText);\n const isInsideVariable = (position: number) =>\n variables.some(\n (marker) => position >= marker.start && position < marker.end\n );\n const commentRanges = collectCommentRanges(docText, isInsideVariable);\n const blockRanges = [\n ...collectMultilineFixedOutputRanges(docText, isInsideVariable),\n ...collectSingleLineFixedOutputRanges(\n docText,\n commentRanges,\n isInsideVariable\n ),\n ...commentRanges,\n ].sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return b.to - a.to;\n });\n\n const outerRanges: SyntaxHighlightRange[] = [];\n\n for (const range of blockRanges) {\n const lastOuter = outerRanges[outerRanges.length - 1];\n if (!lastOuter || range.from >= lastOuter.to) {\n outerRanges.push(range);\n }\n }\n\n return outerRanges;\n}\n\n/**\n * Collects all custom syntax highlight ranges for editor decorations.\n *\n * @param docText - Document text to scan.\n * @param isCursorInside - Returns true when the current cursor is inside a range.\n * @returns Non-overlapping syntax highlight ranges sorted by document position.\n */\nexport function collectSyntaxHighlightRanges(\n docText: string,\n isCursorInside: (from: number, to: number) => boolean = () => false\n): SyntaxHighlightRange[] {\n const matches: SyntaxHighlightRange[] = [];\n const documentVariables = findDocumentVariableMarkers(docText);\n const occupied: { from: number; to: number }[] = [];\n\n controlBlockRegex.lastIndex = 0;\n\n // Prevent overlapping decorations so styling stays deterministic\n const isOverlapping = (from: number, to: number) =>\n occupied.some((range) => !(to <= range.from || from >= range.to));\n\n const addMatch = (from: number, to: number, className: string) => {\n if (from >= to) return false;\n if (isOverlapping(from, to)) return false;\n occupied.push({ from, to });\n matches.push({ from, to, className });\n return true;\n };\n\n // 1. Outer block ranges win over any syntax inside them.\n for (const range of collectOuterBlockRanges(docText)) {\n addMatch(range.from, range.to, range.className);\n }\n\n // 2. Control Blocks\n for (const control of documentControlRanges(docText)) {\n // Native Markdown owns document boundaries. The shared token grammar still\n // supplies the exact source offsets used for individual editor decorations.\n controlBlockRegex.lastIndex = control.start;\n const match = controlBlockRegex.exec(docText);\n if (\n !match ||\n match.index !== control.start ||\n match.index + match[0].length !== control.end\n )\n continue;\n const fullStart = match.index;\n const fullEnd = match.index + match[0].length;\n const content = match[1];\n const contentStart = fullStart + 2; // after ?[\n if (\n isOverlapping(fullStart, fullEnd) ||\n documentVariables.some(\n (marker) => marker.start <= fullStart && fullStart < marker.end\n )\n ) {\n continue;\n }\n\n // Outer brackets and question mark\n addMatch(fullStart, fullStart + 1, \"syntax-keyword\"); // ?\n addMatch(fullStart + 1, fullStart + 2, \"syntax-bracket\"); // [\n addMatch(fullEnd - 1, fullEnd, \"syntax-bracket\"); // ]\n\n const variables = interactionVariableRanges(content);\n const firstVariable = variables[0];\n const percentIndex = firstVariable ? firstVariable.start - 1 : -1;\n const hasLeadingAssignment =\n percentIndex >= 0 &&\n content[percentIndex] === \"%\" &&\n trimVariablePadding(content.slice(0, percentIndex)) === \"\";\n if (content.startsWith(\"%\") || hasLeadingAssignment) {\n // Input / Select\n let percentClass = \"syntax-percent-invalid\";\n if (firstVariable && hasLeadingAssignment) {\n const varFrom = contentStart + firstVariable.start;\n const varTo = contentStart + firstVariable.end;\n const cursorInsideVar = isCursorInside(varFrom, varTo);\n percentClass =\n firstVariable.name !== null && !cursorInsideVar\n ? \"syntax-percent-valid\"\n : \"syntax-percent-invalid\";\n }\n const percentStart =\n contentStart + (hasLeadingAssignment ? percentIndex : 0);\n addMatch(percentStart, percentStart + 1, percentClass); // %\n\n const operatorRanges: { from: number; to: number }[] = [];\n const variableRanges: { from: number; to: number; className: string }[] =\n [];\n const appliedTokenRanges: { from: number; to: number }[] = [];\n\n // Keep a variable name atomic even when it contains option punctuation.\n for (const variable of variables) {\n variableRanges.push({\n from: contentStart + variable.start,\n to: contentStart + variable.end,\n className:\n variable.name === null\n ? \"syntax-variable-invalid\"\n : \"syntax-variable\",\n });\n }\n\n // Inner operators | || ... -- skipping any an option escaped, the way the parser does.\n // Painted as separators, they told the author the grammar had split an option that it\n // had in fact left whole.\n let scanIndex = 0;\n while (scanIndex < content.length) {\n const variable = variableRanges.find(\n (range) => contentStart + scanIndex === range.from\n );\n if (variable) {\n scanIndex = variable.to - contentStart;\n continue;\n }\n if (isEscape(content, scanIndex)) {\n scanIndex += 2;\n continue;\n }\n const operator = content.startsWith(\"||\", scanIndex)\n ? \"||\"\n : content[scanIndex] === \"|\"\n ? \"|\"\n : content.startsWith(\"...\", scanIndex)\n ? \"...\"\n : null;\n if (!operator) {\n scanIndex += 1;\n continue;\n }\n operatorRanges.push({\n from: contentStart + scanIndex,\n to: contentStart + scanIndex + operator.length,\n });\n scanIndex += operator.length;\n }\n\n const allTokens = [\n ...operatorRanges.map((range) => ({\n ...range,\n className: \"syntax-keyword\",\n })),\n ...variableRanges.map((range) => ({\n ...range,\n className: range.className,\n })),\n ].sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return a.to - b.to;\n });\n\n for (const token of allTokens) {\n if (\n token.className.startsWith(\"syntax-variable\") &&\n isCursorInside(token.from, token.to)\n ) {\n continue;\n }\n if (addMatch(token.from, token.to, token.className)) {\n appliedTokenRanges.push({ from: token.from, to: token.to });\n }\n }\n\n // Content (Dark Blue) for remaining text segments\n const stringStart = percentStart + 1;\n const stringEnd = fullEnd - 1;\n let cursor = stringStart;\n const sortedApplied = appliedTokenRanges.sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return a.to - b.to;\n });\n\n for (const token of sortedApplied) {\n if (cursor < token.from) {\n addMatch(cursor, token.from, \"syntax-string\");\n }\n cursor = Math.max(cursor, token.to);\n }\n if (cursor < stringEnd) {\n addMatch(cursor, stringEnd, \"syntax-string\");\n }\n } else {\n // Button ?[text]\n const variableRanges: { from: number; to: number; className: string }[] =\n [];\n const appliedVariableRanges: { from: number; to: number }[] = [];\n\n for (const variable of interactionVariableRanges(content)) {\n variableRanges.push({\n from: contentStart + variable.start,\n to: contentStart + variable.end,\n className:\n variable.name === null\n ? \"syntax-variable-invalid\"\n : \"syntax-variable\",\n });\n }\n\n const sortedVariables = variableRanges.sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return a.to - b.to;\n });\n\n for (const variable of sortedVariables) {\n if (\n variable.className.startsWith(\"syntax-variable\") &&\n isCursorInside(variable.from, variable.to)\n ) {\n continue;\n }\n if (addMatch(variable.from, variable.to, variable.className)) {\n appliedVariableRanges.push({ from: variable.from, to: variable.to });\n }\n }\n\n const buttonTextStart = contentStart;\n const buttonTextEnd = fullEnd - 1;\n let cursor = buttonTextStart;\n\n for (const variable of appliedVariableRanges) {\n if (cursor < variable.from) {\n addMatch(cursor, variable.from, \"syntax-button-text\");\n }\n cursor = Math.max(cursor, variable.to);\n }\n if (cursor < buttonTextEnd) {\n addMatch(cursor, buttonTextEnd, \"syntax-button-text\");\n }\n }\n }\n\n // 3. Variables (only if not already decorated; invalid ones stay default outside control blocks)\n for (const variable of documentVariables) {\n if (\n variable.name !== null &&\n !isCursorInside(variable.start, variable.end)\n ) {\n addMatch(variable.start, variable.end, \"syntax-variable\");\n }\n }\n\n // Sort matches by 'from' asc, then 'to' desc (longest first)\n matches.sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return b.to - a.to;\n });\n\n return matches;\n}\n\nfunction buildDecorations(view: EditorView): DecorationSet {\n const builder = new RangeSetBuilder<Decoration>();\n const docText = view.state.doc.toString();\n const matches = collectSyntaxHighlightRanges(docText, (from, to) => {\n return view.state.selection.ranges.some((range) => {\n return range.from >= from && range.to <= to;\n });\n });\n\n for (const m of matches) {\n if (m.from < m.to) {\n try {\n builder.add(m.from, m.to, Decoration.mark({ class: m.className }));\n } catch (e) {\n console.warn(\"SyntaxHighlighter: Failed to add decoration\", m, e);\n }\n }\n }\n\n return builder.finish();\n}\n\nconst SyntaxHighlighter = ViewPlugin.fromClass(\n class {\n decorations: DecorationSet;\n\n constructor(view: EditorView) {\n this.decorations = buildDecorations(view);\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged || update.viewportChanged || update.selectionSet) {\n this.decorations = buildDecorations(update.view);\n }\n }\n },\n {\n decorations: (instance) => instance.decorations,\n }\n);\n\nexport default SyntaxHighlighter;\n"],"names":["commentRegex","interactionVariableRanges","text","markers","findVariableMarkers","pending","controlBlockRegex","INTERACTION_CONTENT_SOURCE","documentControlRanges","getMarkdownSourceAnalysis","collectMultilineFixedOutputRanges","docText","isInsideVariable","ranges","pendingStart","lineStart","newlineIndex","lineEnd","collectSingleLineFixedOutputRanges","commentRanges","commentIndex","isInsideComment","index","range","lineText","markerPositions","searchFrom","markerOffset","markerIndex","i","collectCommentRanges","match","collectOuterBlockRanges","variables","findDocumentVariableMarkers","position","marker","blockRanges","a","b","outerRanges","lastOuter","collectSyntaxHighlightRanges","isCursorInside","matches","documentVariables","occupied","isOverlapping","from","to","addMatch","className","control","fullStart","fullEnd","content","contentStart","firstVariable","percentIndex","hasLeadingAssignment","trimVariablePadding","percentClass","varFrom","varTo","cursorInsideVar","percentStart","operatorRanges","variableRanges","appliedTokenRanges","variable","scanIndex","isEscape","operator","allTokens","token","stringStart","stringEnd","cursor","sortedApplied","appliedVariableRanges","sortedVariables","buttonTextStart","buttonTextEnd","buildDecorations","view","builder","RangeSetBuilder","m","Decoration","e","SyntaxHighlighter","ViewPlugin","update","instance"],"mappings":";;;;;AAiBA,MAAMA,IAAe,oBAGfC,IAA4B,CAACC,MAAiB;AAClD,QAAMC,IAAUC,EAAoBF,CAAI,GAClCG,IAAUH,EAAK,QAAQ,MAAMC,EAAQ,GAAG,EAAE,GAAG,OAAO,CAAC;AAC3D,SAAOE,MAAY,KACfF,IACA,CAAC,GAAGA,GAAS,EAAE,OAAOE,GAAS,KAAKH,EAAK,QAAQ,MAAM,MAAM;AACnE,GAKMI,IAAoB,IAAI;AAAA,EAC5B,UAAUC,EAAAA,0BAA0B;AAAA,EACpC;AACF,GAEMC,IAAwB,CAACN,MAC7BO,EAA0BP,CAAI,EAAE;AAQlC,SAASQ,EACPC,GACAC,GACwB;AACxB,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAA8B,MAC9BC,IAAY;AAEhB,SAAOA,KAAaJ,EAAQ,UAAQ;AAClC,UAAMK,IAAeL,EAAQ,QAAQ;AAAA,GAAMI,CAAS,GAC9CE,IAAUD,MAAiB,KAAKL,EAAQ,SAASK;AAgBvD,QAfiBL,EAAQ,MAAMI,GAAWE,CAAO,EAEpC,KAAA,MAAW,UAAU,CAACL,EAAiBG,CAAS,MACvDD,MAAiB,OACnBA,IAAeC,KAEfF,EAAO,KAAK;AAAA,MACV,MAAMC;AAAA,MACN,IAAIG;AAAA,MACJ,WAAW;AAAA,IAAA,CACZ,GACDH,IAAe,QAIfE,MAAiB;AACnB;AAGF,IAAAD,IAAYC,IAAe;AAAA,EAC7B;AAEA,SAAOH;AACT;AAEA,SAASK,EACPP,GACAQ,GACAP,GACwB;AACxB,QAAMC,IAAiC,CAAA;AACvC,MAAIO,IAAe;AAEnB,QAAMC,IAAkB,CAACC,MAAkB;AACzC,WACEF,IAAeD,EAAc,UAC7BA,EAAcC,CAAY,EAAE,MAAME;AAElC,MAAAF;AAGF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,OAAOQ,GAAoB;AACzB,OAAIA,EAAO,cAAcA,EAAO,mBAAmBA,EAAO,kBACxD,KAAK,cAAcT,EAAiBS,EAAO,IAAI;AAAA,IAEnD;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,aAAa,CAACC,MAAaA,EAAS;AAAA,EAAA;AAExC;"}
1
+ {"version":3,"file":"SyntaxHighlighter.es.js","sources":["../../../../src/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.ts"],"sourcesContent":["import {\n Decoration,\n DecorationSet,\n EditorView,\n ViewPlugin,\n ViewUpdate,\n} from \"@codemirror/view\";\nimport { RangeSetBuilder } from \"@codemirror/state\";\nimport { getMarkdownSourceAnalysis } from \"../../ContentRender/utils/inline-code-ranges\";\nimport { INTERACTION_CONTENT_SOURCE, isEscape } from \"remark-flow\";\n\nimport {\n findVariableMarkers,\n findDocumentVariableMarkers,\n trimVariablePadding,\n} from \"../utils\";\n\nconst commentRegex = /<!--[\\s\\S]*?-->/g;\n\n// An unfinished marker still owns its tail, so nested syntax stays literal while typing.\nconst interactionVariableRanges = (text: string) => {\n const markers = findVariableMarkers(text);\n const pending = text.indexOf(\"{{\", markers.at(-1)?.end ?? 0);\n return pending === -1\n ? markers\n : [...markers, { start: pending, end: text.length, name: null }];\n};\n// The grammar's own definition of where an interaction ends, so a `\\]` an option escaped does\n// not cut the highlight short, and the same `(?!\\()` the parser uses, so `?[text](url)` stays a\n// markdown link. Taken from remark-flow rather than written again here: the editor and the\n// parser have to agree about what they are looking at.\nconst controlBlockRegex = new RegExp(\n `\\\\?\\\\[(${INTERACTION_CONTENT_SOURCE})\\\\](?!\\\\()`,\n \"g\"\n);\n\nconst documentControlRanges = (text: string) =>\n getMarkdownSourceAnalysis(text).interactions;\n\nexport interface SyntaxHighlightRange {\n from: number;\n to: number;\n className: string;\n}\n\nfunction collectMultilineFixedOutputRanges(\n docText: string,\n isInsideVariable: (position: number) => boolean\n): SyntaxHighlightRange[] {\n const ranges: SyntaxHighlightRange[] = [];\n let pendingStart: number | null = null;\n let lineStart = 0;\n\n while (lineStart <= docText.length) {\n const newlineIndex = docText.indexOf(\"\\n\", lineStart);\n const lineEnd = newlineIndex === -1 ? docText.length : newlineIndex;\n const lineText = docText.slice(lineStart, lineEnd);\n\n if (lineText.trim() === \"!===\" && !isInsideVariable(lineStart)) {\n if (pendingStart === null) {\n pendingStart = lineStart;\n } else {\n ranges.push({\n from: pendingStart,\n to: lineEnd,\n className: \"syntax-fixed\",\n });\n pendingStart = null;\n }\n }\n\n if (newlineIndex === -1) {\n break;\n }\n\n lineStart = newlineIndex + 1;\n }\n\n return ranges;\n}\n\nfunction collectSingleLineFixedOutputRanges(\n docText: string,\n commentRanges: SyntaxHighlightRange[],\n isInsideVariable: (position: number) => boolean\n): SyntaxHighlightRange[] {\n const ranges: SyntaxHighlightRange[] = [];\n let commentIndex = 0;\n\n const isInsideComment = (index: number) => {\n while (\n commentIndex < commentRanges.length &&\n commentRanges[commentIndex].to <= index\n ) {\n commentIndex++;\n }\n\n const range = commentRanges[commentIndex];\n return !!range && index >= range.from && index < range.to;\n };\n\n let lineStart = 0;\n while (lineStart <= docText.length) {\n const newlineIndex = docText.indexOf(\"\\n\", lineStart);\n const lineEnd = newlineIndex === -1 ? docText.length : newlineIndex;\n const lineText = docText.slice(lineStart, lineEnd);\n const markerPositions: number[] = [];\n let searchFrom = 0;\n\n while (searchFrom < lineText.length) {\n const markerOffset = lineText.indexOf(\"===\", searchFrom);\n if (markerOffset === -1) {\n break;\n }\n\n const markerIndex = lineStart + markerOffset;\n const isNegated = markerIndex > 0 && docText[markerIndex - 1] === \"!\";\n if (\n !isNegated &&\n !isInsideComment(markerIndex) &&\n !isInsideVariable(markerIndex)\n ) {\n markerPositions.push(markerIndex);\n }\n\n searchFrom = markerOffset + 3;\n }\n\n for (let i = 0; i + 1 < markerPositions.length; i += 2) {\n ranges.push({\n from: markerPositions[i],\n to: markerPositions[i + 1] + 3,\n className: \"syntax-fixed\",\n });\n }\n\n if (newlineIndex === -1) {\n break;\n }\n\n lineStart = newlineIndex + 1;\n }\n\n return ranges;\n}\n\nfunction collectCommentRanges(\n docText: string,\n isInsideVariable: (position: number) => boolean\n): SyntaxHighlightRange[] {\n const ranges: SyntaxHighlightRange[] = [];\n let match;\n\n commentRegex.lastIndex = 0;\n while ((match = commentRegex.exec(docText)) !== null) {\n if (isInsideVariable(match.index)) continue;\n ranges.push({\n from: match.index,\n to: match.index + match[0].length,\n className: \"syntax-comment\",\n });\n }\n\n return ranges;\n}\n\n/**\n * Collects non-overlapping preserved output and comment wrapper ranges.\n *\n * @param docText - Document text to scan.\n * @returns Outer syntax highlight ranges sorted by document position.\n */\nexport function collectOuterBlockRanges(\n docText: string\n): SyntaxHighlightRange[] {\n const variables = findDocumentVariableMarkers(docText);\n const isInsideVariable = (position: number) =>\n variables.some(\n (marker) => position >= marker.start && position < marker.end\n );\n const commentRanges = collectCommentRanges(docText, isInsideVariable);\n const blockRanges = [\n ...collectMultilineFixedOutputRanges(docText, isInsideVariable),\n ...collectSingleLineFixedOutputRanges(\n docText,\n commentRanges,\n isInsideVariable\n ),\n ...commentRanges,\n ].sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return b.to - a.to;\n });\n\n const outerRanges: SyntaxHighlightRange[] = [];\n\n for (const range of blockRanges) {\n const lastOuter = outerRanges[outerRanges.length - 1];\n if (!lastOuter || range.from >= lastOuter.to) {\n outerRanges.push(range);\n }\n }\n\n return outerRanges;\n}\n\n/**\n * Collects all custom syntax highlight ranges for editor decorations.\n *\n * @param docText - Document text to scan.\n * @param isCursorInside - Returns true when the current cursor is inside a range.\n * @returns Non-overlapping syntax highlight ranges sorted by document position.\n */\nexport function collectSyntaxHighlightRanges(\n docText: string,\n isCursorInside: (from: number, to: number) => boolean = () => false\n): SyntaxHighlightRange[] {\n const matches: SyntaxHighlightRange[] = [];\n const documentVariables = findDocumentVariableMarkers(docText);\n const occupied: { from: number; to: number }[] = [];\n\n controlBlockRegex.lastIndex = 0;\n\n // Prevent overlapping decorations so styling stays deterministic\n const isOverlapping = (from: number, to: number) =>\n occupied.some((range) => !(to <= range.from || from >= range.to));\n\n const addMatch = (from: number, to: number, className: string) => {\n if (from >= to) return false;\n if (isOverlapping(from, to)) return false;\n occupied.push({ from, to });\n matches.push({ from, to, className });\n return true;\n };\n\n // 1. Outer block ranges win over any syntax inside them.\n for (const range of collectOuterBlockRanges(docText)) {\n addMatch(range.from, range.to, range.className);\n }\n\n // 2. Control Blocks\n for (const control of documentControlRanges(docText)) {\n // Native Markdown owns document boundaries. The shared token grammar still\n // supplies the exact source offsets used for individual editor decorations.\n controlBlockRegex.lastIndex = control.start;\n const match = controlBlockRegex.exec(docText);\n if (\n !match ||\n match.index !== control.start ||\n match.index + match[0].length !== control.end\n )\n continue;\n const fullStart = match.index;\n const fullEnd = match.index + match[0].length;\n const content = match[1];\n const contentStart = fullStart + 2; // after ?[\n if (\n isOverlapping(fullStart, fullEnd) ||\n documentVariables.some(\n (marker) => marker.start <= fullStart && fullStart < marker.end\n )\n ) {\n continue;\n }\n\n // Outer brackets and question mark\n addMatch(fullStart, fullStart + 1, \"syntax-keyword\"); // ?\n addMatch(fullStart + 1, fullStart + 2, \"syntax-bracket\"); // [\n addMatch(fullEnd - 1, fullEnd, \"syntax-bracket\"); // ]\n\n const variables = interactionVariableRanges(content);\n const firstVariable = variables[0];\n const percentIndex = firstVariable ? firstVariable.start - 1 : -1;\n const hasLeadingAssignment =\n percentIndex >= 0 &&\n content[percentIndex] === \"%\" &&\n trimVariablePadding(content.slice(0, percentIndex)) === \"\";\n const hasLeadingVariable =\n firstVariable &&\n trimVariablePadding(content.slice(0, firstVariable.start)) === \"\";\n const hasPercent = content.startsWith(\"%\") || hasLeadingAssignment;\n if (hasPercent || hasLeadingVariable) {\n // Input / Select\n const percentStart =\n contentStart + (hasLeadingAssignment ? percentIndex : 0);\n if (hasPercent) {\n let percentClass = \"syntax-percent-invalid\";\n if (firstVariable && hasLeadingAssignment) {\n const varFrom = contentStart + firstVariable.start;\n const varTo = contentStart + firstVariable.end;\n const cursorInsideVar = isCursorInside(varFrom, varTo);\n percentClass =\n firstVariable.name !== null && !cursorInsideVar\n ? \"syntax-percent-valid\"\n : \"syntax-percent-invalid\";\n }\n addMatch(percentStart, percentStart + 1, percentClass); // %\n }\n\n const operatorRanges: { from: number; to: number }[] = [];\n const variableRanges: { from: number; to: number; className: string }[] =\n [];\n const appliedTokenRanges: { from: number; to: number }[] = [];\n\n // Keep a variable name atomic even when it contains option punctuation.\n for (const variable of variables) {\n variableRanges.push({\n from: contentStart + variable.start,\n to: contentStart + variable.end,\n className:\n variable.name === null\n ? \"syntax-variable-invalid\"\n : \"syntax-variable\",\n });\n }\n\n // Inner operators | || ... -- skipping any an option escaped, the way the parser does.\n // Painted as separators, they told the author the grammar had split an option that it\n // had in fact left whole.\n let scanIndex = 0;\n while (scanIndex < content.length) {\n const variable = variableRanges.find(\n (range) => contentStart + scanIndex === range.from\n );\n if (variable) {\n scanIndex = variable.to - contentStart;\n continue;\n }\n if (isEscape(content, scanIndex)) {\n scanIndex += 2;\n continue;\n }\n const operator = content.startsWith(\"||\", scanIndex)\n ? \"||\"\n : content[scanIndex] === \"|\"\n ? \"|\"\n : content.startsWith(\"...\", scanIndex)\n ? \"...\"\n : null;\n if (!operator) {\n scanIndex += 1;\n continue;\n }\n operatorRanges.push({\n from: contentStart + scanIndex,\n to: contentStart + scanIndex + operator.length,\n });\n scanIndex += operator.length;\n }\n\n const allTokens = [\n ...operatorRanges.map((range) => ({\n ...range,\n className: \"syntax-keyword\",\n })),\n ...variableRanges.map((range) => ({\n ...range,\n className: range.className,\n })),\n ].sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return a.to - b.to;\n });\n\n for (const token of allTokens) {\n if (\n token.className.startsWith(\"syntax-variable\") &&\n isCursorInside(token.from, token.to)\n ) {\n continue;\n }\n if (addMatch(token.from, token.to, token.className)) {\n appliedTokenRanges.push({ from: token.from, to: token.to });\n }\n }\n\n // Content (Dark Blue) for remaining text segments\n const stringStart = hasPercent ? percentStart + 1 : contentStart;\n const stringEnd = fullEnd - 1;\n let cursor = stringStart;\n const sortedApplied = appliedTokenRanges.sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return a.to - b.to;\n });\n\n for (const token of sortedApplied) {\n if (cursor < token.from) {\n addMatch(cursor, token.from, \"syntax-string\");\n }\n cursor = Math.max(cursor, token.to);\n }\n if (cursor < stringEnd) {\n addMatch(cursor, stringEnd, \"syntax-string\");\n }\n } else {\n // Button ?[text]\n const variableRanges: { from: number; to: number; className: string }[] =\n [];\n const appliedVariableRanges: { from: number; to: number }[] = [];\n\n for (const variable of interactionVariableRanges(content)) {\n variableRanges.push({\n from: contentStart + variable.start,\n to: contentStart + variable.end,\n className:\n variable.name === null\n ? \"syntax-variable-invalid\"\n : \"syntax-variable\",\n });\n }\n\n const sortedVariables = variableRanges.sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return a.to - b.to;\n });\n\n for (const variable of sortedVariables) {\n if (\n variable.className.startsWith(\"syntax-variable\") &&\n isCursorInside(variable.from, variable.to)\n ) {\n continue;\n }\n if (addMatch(variable.from, variable.to, variable.className)) {\n appliedVariableRanges.push({ from: variable.from, to: variable.to });\n }\n }\n\n const buttonTextStart = contentStart;\n const buttonTextEnd = fullEnd - 1;\n let cursor = buttonTextStart;\n\n for (const variable of appliedVariableRanges) {\n if (cursor < variable.from) {\n addMatch(cursor, variable.from, \"syntax-button-text\");\n }\n cursor = Math.max(cursor, variable.to);\n }\n if (cursor < buttonTextEnd) {\n addMatch(cursor, buttonTextEnd, \"syntax-button-text\");\n }\n }\n }\n\n // 3. Variables (only if not already decorated; invalid ones stay default outside control blocks)\n for (const variable of documentVariables) {\n if (\n variable.name !== null &&\n !isCursorInside(variable.start, variable.end)\n ) {\n addMatch(variable.start, variable.end, \"syntax-variable\");\n }\n }\n\n // Sort matches by 'from' asc, then 'to' desc (longest first)\n matches.sort((a, b) => {\n if (a.from !== b.from) return a.from - b.from;\n return b.to - a.to;\n });\n\n return matches;\n}\n\nfunction buildDecorations(view: EditorView): DecorationSet {\n const builder = new RangeSetBuilder<Decoration>();\n const docText = view.state.doc.toString();\n const matches = collectSyntaxHighlightRanges(docText, (from, to) => {\n return view.state.selection.ranges.some((range) => {\n return range.from >= from && range.to <= to;\n });\n });\n\n for (const m of matches) {\n if (m.from < m.to) {\n try {\n builder.add(m.from, m.to, Decoration.mark({ class: m.className }));\n } catch (e) {\n console.warn(\"SyntaxHighlighter: Failed to add decoration\", m, e);\n }\n }\n }\n\n return builder.finish();\n}\n\nconst SyntaxHighlighter = ViewPlugin.fromClass(\n class {\n decorations: DecorationSet;\n\n constructor(view: EditorView) {\n this.decorations = buildDecorations(view);\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged || update.viewportChanged || update.selectionSet) {\n this.decorations = buildDecorations(update.view);\n }\n }\n },\n {\n decorations: (instance) => instance.decorations,\n }\n);\n\nexport default SyntaxHighlighter;\n"],"names":["commentRegex","interactionVariableRanges","text","markers","findVariableMarkers","pending","controlBlockRegex","INTERACTION_CONTENT_SOURCE","documentControlRanges","getMarkdownSourceAnalysis","collectMultilineFixedOutputRanges","docText","isInsideVariable","ranges","pendingStart","lineStart","newlineIndex","lineEnd","collectSingleLineFixedOutputRanges","commentRanges","commentIndex","isInsideComment","index","range","lineText","markerPositions","searchFrom","markerOffset","markerIndex","i","collectCommentRanges","match","collectOuterBlockRanges","variables","findDocumentVariableMarkers","position","marker","blockRanges","a","b","outerRanges","lastOuter","collectSyntaxHighlightRanges","isCursorInside","matches","documentVariables","occupied","isOverlapping","from","to","addMatch","className","control","fullStart","fullEnd","content","contentStart","firstVariable","percentIndex","hasLeadingAssignment","trimVariablePadding","hasLeadingVariable","hasPercent","percentStart","percentClass","varFrom","varTo","cursorInsideVar","operatorRanges","variableRanges","appliedTokenRanges","variable","scanIndex","isEscape","operator","allTokens","token","stringStart","stringEnd","cursor","sortedApplied","appliedVariableRanges","sortedVariables","buttonTextStart","buttonTextEnd","buildDecorations","view","builder","RangeSetBuilder","m","Decoration","e","SyntaxHighlighter","ViewPlugin","update","instance"],"mappings":";;;;;AAiBA,MAAMA,IAAe,oBAGfC,IAA4B,CAACC,MAAiB;AAClD,QAAMC,IAAUC,EAAoBF,CAAI,GAClCG,IAAUH,EAAK,QAAQ,MAAMC,EAAQ,GAAG,EAAE,GAAG,OAAO,CAAC;AAC3D,SAAOE,MAAY,KACfF,IACA,CAAC,GAAGA,GAAS,EAAE,OAAOE,GAAS,KAAKH,EAAK,QAAQ,MAAM,MAAM;AACnE,GAKMI,IAAoB,IAAI;AAAA,EAC5B,UAAUC,EAAAA,0BAA0B;AAAA,EACpC;AACF,GAEMC,IAAwB,CAACN,MAC7BO,EAA0BP,CAAI,EAAE;AAQlC,SAASQ,EACPC,GACAC,GACwB;AACxB,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAA8B,MAC9BC,IAAY;AAEhB,SAAOA,KAAaJ,EAAQ,UAAQ;AAClC,UAAMK,IAAeL,EAAQ,QAAQ;AAAA,GAAMI,CAAS,GAC9CE,IAAUD,MAAiB,KAAKL,EAAQ,SAASK;AAgBvD,QAfiBL,EAAQ,MAAMI,GAAWE,CAAO,EAEpC,KAAA,MAAW,UAAU,CAACL,EAAiBG,CAAS,MACvDD,MAAiB,OACnBA,IAAeC,KAEfF,EAAO,KAAK;AAAA,MACV,MAAMC;AAAA,MACN,IAAIG;AAAA,MACJ,WAAW;AAAA,IAAA,CACZ,GACDH,IAAe,QAIfE,MAAiB;AACnB;AAGF,IAAAD,IAAYC,IAAe;AAAA,EAC7B;AAEA,SAAOH;AACT;AAEA,SAASK,EACPP,GACAQ,GACAP,GACwB;AACxB,QAAMC,IAAiC,CAAA;AACvC,MAAIO,IAAe;AAEnB,QAAMC,IAAkB,CAACC,MAAkB;AACzC,WACEF,IAAeD,EAAc,UAC7BA,EAAcC,CAAY,EAAE,MAAME;AAElC,MAAAF;AAGF,UAAMG,IAAQJ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