@lapismd/mira 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (911) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE.md +4 -0
  3. package/README.md +52 -0
  4. package/dist/codemirror.d.ts +5 -0
  5. package/dist/codemirror.d.ts.map +1 -0
  6. package/dist/codemirror.js +4 -0
  7. package/dist/core/code-mirror.d.ts +29 -0
  8. package/dist/core/code-mirror.d.ts.map +1 -0
  9. package/dist/core/code-mirror.js +74 -0
  10. package/dist/core/code-mirror.test.d.ts +2 -0
  11. package/dist/core/code-mirror.test.d.ts.map +1 -0
  12. package/dist/core/code-mirror.test.js +68 -0
  13. package/dist/core/images.d.ts +30 -0
  14. package/dist/core/images.d.ts.map +1 -0
  15. package/dist/core/images.js +226 -0
  16. package/dist/core/images.test.d.ts +2 -0
  17. package/dist/core/images.test.d.ts.map +1 -0
  18. package/dist/core/images.test.js +109 -0
  19. package/dist/core/index.d.ts +69 -0
  20. package/dist/core/index.d.ts.map +1 -0
  21. package/dist/core/index.js +138 -0
  22. package/dist/core/index.test.d.ts +2 -0
  23. package/dist/core/index.test.d.ts.map +1 -0
  24. package/dist/core/index.test.js +11 -0
  25. package/dist/core/markdown-actions.d.ts +11 -0
  26. package/dist/core/markdown-actions.d.ts.map +1 -0
  27. package/dist/core/markdown-actions.js +603 -0
  28. package/dist/core/markdown-actions.test.d.ts +2 -0
  29. package/dist/core/markdown-actions.test.d.ts.map +1 -0
  30. package/dist/core/markdown-actions.test.js +182 -0
  31. package/dist/extensions/doodle-dividers.d.ts +44 -0
  32. package/dist/extensions/doodle-dividers.d.ts.map +1 -0
  33. package/dist/extensions/doodle-dividers.js +909 -0
  34. package/dist/extensions/doodle-dividers.test.d.ts +2 -0
  35. package/dist/extensions/doodle-dividers.test.d.ts.map +1 -0
  36. package/dist/extensions/doodle-dividers.test.js +296 -0
  37. package/dist/extensions/index.d.ts +342 -0
  38. package/dist/extensions/index.d.ts.map +1 -0
  39. package/dist/extensions/index.js +279 -0
  40. package/dist/extensions/index.test.d.ts +2 -0
  41. package/dist/extensions/index.test.d.ts.map +1 -0
  42. package/dist/extensions/index.test.js +283 -0
  43. package/dist/extensions/selection-toolbar.d.ts +6 -0
  44. package/dist/extensions/selection-toolbar.d.ts.map +1 -0
  45. package/dist/extensions/selection-toolbar.js +14 -0
  46. package/dist/index.d.ts +9 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +5 -0
  49. package/dist/index.test.d.ts +2 -0
  50. package/dist/index.test.d.ts.map +1 -0
  51. package/dist/index.test.js +64 -0
  52. package/dist/internal/appearance-context.d.ts +12 -0
  53. package/dist/internal/appearance-context.d.ts.map +1 -0
  54. package/dist/internal/appearance-context.js +31 -0
  55. package/dist/internal/appearance-context.test.d.ts +2 -0
  56. package/dist/internal/appearance-context.test.d.ts.map +1 -0
  57. package/dist/internal/appearance-context.test.js +31 -0
  58. package/dist/internal/codemirror/base/index.d.ts +24 -0
  59. package/dist/internal/codemirror/base/index.d.ts.map +1 -0
  60. package/dist/internal/codemirror/base/index.js +489 -0
  61. package/dist/internal/codemirror/base/index.test.d.ts +2 -0
  62. package/dist/internal/codemirror/base/index.test.d.ts.map +1 -0
  63. package/dist/internal/codemirror/base/index.test.js +303 -0
  64. package/dist/internal/codemirror/base/search-panel.svelte +590 -0
  65. package/dist/internal/codemirror/base/search-panel.svelte.d.ts +8 -0
  66. package/dist/internal/codemirror/base/search-panel.svelte.d.ts.map +1 -0
  67. package/dist/internal/codemirror/base/search.d.ts +46 -0
  68. package/dist/internal/codemirror/base/search.d.ts.map +1 -0
  69. package/dist/internal/codemirror/base/search.js +58 -0
  70. package/dist/internal/codemirror/base/search.test.d.ts +2 -0
  71. package/dist/internal/codemirror/base/search.test.d.ts.map +1 -0
  72. package/dist/internal/codemirror/base/search.test.js +155 -0
  73. package/dist/internal/codemirror/base/selection-toolbar.d.ts +21 -0
  74. package/dist/internal/codemirror/base/selection-toolbar.d.ts.map +1 -0
  75. package/dist/internal/codemirror/base/selection-toolbar.js +306 -0
  76. package/dist/internal/codemirror/base/selection-toolbar.test.d.ts +2 -0
  77. package/dist/internal/codemirror/base/selection-toolbar.test.d.ts.map +1 -0
  78. package/dist/internal/codemirror/base/selection-toolbar.test.js +149 -0
  79. package/dist/internal/codemirror/base/slash-commands.d.ts +61 -0
  80. package/dist/internal/codemirror/base/slash-commands.d.ts.map +1 -0
  81. package/dist/internal/codemirror/base/slash-commands.js +463 -0
  82. package/dist/internal/codemirror/markdown/authoring.d.ts +9 -0
  83. package/dist/internal/codemirror/markdown/authoring.d.ts.map +1 -0
  84. package/dist/internal/codemirror/markdown/authoring.js +14 -0
  85. package/dist/internal/codemirror/markdown/authoring.test.d.ts +2 -0
  86. package/dist/internal/codemirror/markdown/authoring.test.d.ts.map +1 -0
  87. package/dist/internal/codemirror/markdown/authoring.test.js +222 -0
  88. package/dist/internal/codemirror/markdown/completion.d.ts +12 -0
  89. package/dist/internal/codemirror/markdown/completion.d.ts.map +1 -0
  90. package/dist/internal/codemirror/markdown/completion.js +302 -0
  91. package/dist/internal/codemirror/markdown/directives.d.ts +3 -0
  92. package/dist/internal/codemirror/markdown/directives.d.ts.map +1 -0
  93. package/dist/internal/codemirror/markdown/directives.js +154 -0
  94. package/dist/internal/codemirror/markdown/grid-table.d.ts +3 -0
  95. package/dist/internal/codemirror/markdown/grid-table.d.ts.map +1 -0
  96. package/dist/internal/codemirror/markdown/grid-table.js +129 -0
  97. package/dist/internal/codemirror/markdown/index.d.ts +16 -0
  98. package/dist/internal/codemirror/markdown/index.d.ts.map +1 -0
  99. package/dist/internal/codemirror/markdown/index.js +125 -0
  100. package/dist/internal/codemirror/markdown/index.test.d.ts +2 -0
  101. package/dist/internal/codemirror/markdown/index.test.d.ts.map +1 -0
  102. package/dist/internal/codemirror/markdown/index.test.js +158 -0
  103. package/dist/internal/codemirror/markdown/input-handlers.d.ts +4 -0
  104. package/dist/internal/codemirror/markdown/input-handlers.d.ts.map +1 -0
  105. package/dist/internal/codemirror/markdown/input-handlers.js +56 -0
  106. package/dist/internal/codemirror/markdown/lapis-inline.d.ts +11 -0
  107. package/dist/internal/codemirror/markdown/lapis-inline.d.ts.map +1 -0
  108. package/dist/internal/codemirror/markdown/lapis-inline.js +189 -0
  109. package/dist/internal/codemirror/markdown/latex.d.ts +5 -0
  110. package/dist/internal/codemirror/markdown/latex.d.ts.map +1 -0
  111. package/dist/internal/codemirror/markdown/latex.js +97 -0
  112. package/dist/internal/codemirror/markdown/list-after-lazy-quote.d.ts +10 -0
  113. package/dist/internal/codemirror/markdown/list-after-lazy-quote.d.ts.map +1 -0
  114. package/dist/internal/codemirror/markdown/list-after-lazy-quote.js +28 -0
  115. package/dist/internal/codemirror/markdown/paste.d.ts +5 -0
  116. package/dist/internal/codemirror/markdown/paste.d.ts.map +1 -0
  117. package/dist/internal/codemirror/markdown/paste.js +84 -0
  118. package/dist/internal/codemirror/markdown/showcase-fixture.test.d.ts +2 -0
  119. package/dist/internal/codemirror/markdown/showcase-fixture.test.d.ts.map +1 -0
  120. package/dist/internal/codemirror/markdown/showcase-fixture.test.js +50 -0
  121. package/dist/internal/codemirror/markdown/types.d.ts +6 -0
  122. package/dist/internal/codemirror/rich/block-controls.d.ts +4 -0
  123. package/dist/internal/codemirror/rich/block-controls.d.ts.map +1 -0
  124. package/dist/internal/codemirror/rich/block-controls.js +1419 -0
  125. package/dist/internal/codemirror/rich/block-controls.test.d.ts +2 -0
  126. package/dist/internal/codemirror/rich/block-controls.test.d.ts.map +1 -0
  127. package/dist/internal/codemirror/rich/block-controls.test.js +401 -0
  128. package/dist/internal/codemirror/rich/block-ranges.d.ts +22 -0
  129. package/dist/internal/codemirror/rich/block-ranges.d.ts.map +1 -0
  130. package/dist/internal/codemirror/rich/block-ranges.js +736 -0
  131. package/dist/internal/codemirror/rich/block-ranges.test.d.ts +2 -0
  132. package/dist/internal/codemirror/rich/block-ranges.test.d.ts.map +1 -0
  133. package/dist/internal/codemirror/rich/block-ranges.test.js +310 -0
  134. package/dist/internal/codemirror/rich/block-toolbar.d.ts +25 -0
  135. package/dist/internal/codemirror/rich/block-toolbar.d.ts.map +1 -0
  136. package/dist/internal/codemirror/rich/block-toolbar.js +506 -0
  137. package/dist/internal/codemirror/rich/block-toolbar.test.d.ts +2 -0
  138. package/dist/internal/codemirror/rich/block-toolbar.test.d.ts.map +1 -0
  139. package/dist/internal/codemirror/rich/block-toolbar.test.js +178 -0
  140. package/dist/internal/codemirror/rich/decorations/fold-indicators.d.ts +7 -0
  141. package/dist/internal/codemirror/rich/decorations/fold-indicators.d.ts.map +1 -0
  142. package/dist/internal/codemirror/rich/decorations/fold-indicators.js +122 -0
  143. package/dist/internal/codemirror/rich/decorations/fold-indicators.test.d.ts +2 -0
  144. package/dist/internal/codemirror/rich/decorations/fold-indicators.test.d.ts.map +1 -0
  145. package/dist/internal/codemirror/rich/decorations/fold-indicators.test.js +8 -0
  146. package/dist/internal/codemirror/rich/decorations/heading-gutter.d.ts +3 -0
  147. package/dist/internal/codemirror/rich/decorations/heading-gutter.d.ts.map +1 -0
  148. package/dist/internal/codemirror/rich/decorations/heading-gutter.js +43 -0
  149. package/dist/internal/codemirror/rich/index.d.ts +17 -0
  150. package/dist/internal/codemirror/rich/index.d.ts.map +1 -0
  151. package/dist/internal/codemirror/rich/index.js +727 -0
  152. package/dist/internal/codemirror/rich/index.test.d.ts +2 -0
  153. package/dist/internal/codemirror/rich/index.test.d.ts.map +1 -0
  154. package/dist/internal/codemirror/rich/index.test.js +544 -0
  155. package/dist/internal/codemirror/rich/theme.d.ts +2 -0
  156. package/dist/internal/codemirror/rich/theme.d.ts.map +1 -0
  157. package/dist/internal/codemirror/rich/theme.js +268 -0
  158. package/dist/internal/codemirror/rich/types.d.ts +22 -0
  159. package/dist/internal/codemirror/rich/types.d.ts.map +1 -0
  160. package/dist/internal/codemirror/rich/types.js +1 -0
  161. package/dist/internal/codemirror/rich/utils/activation.d.ts +3 -0
  162. package/dist/internal/codemirror/rich/utils/activation.d.ts.map +1 -0
  163. package/dist/internal/codemirror/rich/utils/activation.js +27 -0
  164. package/dist/internal/codemirror/rich/utils/code-block-lines.d.ts +8 -0
  165. package/dist/internal/codemirror/rich/utils/code-block-lines.d.ts.map +1 -0
  166. package/dist/internal/codemirror/rich/utils/code-block-lines.js +143 -0
  167. package/dist/internal/codemirror/rich/utils/code-block-lines.test.d.ts +2 -0
  168. package/dist/internal/codemirror/rich/utils/code-block-lines.test.d.ts.map +1 -0
  169. package/dist/internal/codemirror/rich/utils/code-block-lines.test.js +82 -0
  170. package/dist/internal/codemirror/rich/utils/fenced-code.d.ts +4 -0
  171. package/dist/internal/codemirror/rich/utils/fenced-code.d.ts.map +1 -0
  172. package/dist/internal/codemirror/rich/utils/fenced-code.js +25 -0
  173. package/dist/internal/codemirror/rich/utils/fenced-code.test.d.ts +2 -0
  174. package/dist/internal/codemirror/rich/utils/fenced-code.test.d.ts.map +1 -0
  175. package/dist/internal/codemirror/rich/utils/fenced-code.test.js +12 -0
  176. package/dist/internal/codemirror/rich/utils/headings.d.ts +5 -0
  177. package/dist/internal/codemirror/rich/utils/headings.d.ts.map +1 -0
  178. package/dist/internal/codemirror/rich/utils/headings.js +20 -0
  179. package/dist/internal/codemirror/rich/utils/headings.test.d.ts +2 -0
  180. package/dist/internal/codemirror/rich/utils/headings.test.d.ts.map +1 -0
  181. package/dist/internal/codemirror/rich/utils/headings.test.js +27 -0
  182. package/dist/internal/codemirror/rich/utils/height-estimates.d.ts +2 -0
  183. package/dist/internal/codemirror/rich/utils/height-estimates.d.ts.map +1 -0
  184. package/dist/internal/codemirror/rich/utils/height-estimates.js +82 -0
  185. package/dist/internal/codemirror/rich/utils/height-estimates.test.d.ts +2 -0
  186. package/dist/internal/codemirror/rich/utils/height-estimates.test.d.ts.map +1 -0
  187. package/dist/internal/codemirror/rich/utils/height-estimates.test.js +10 -0
  188. package/dist/internal/codemirror/rich/utils/images.d.ts +9 -0
  189. package/dist/internal/codemirror/rich/utils/images.d.ts.map +1 -0
  190. package/dist/internal/codemirror/rich/utils/images.js +103 -0
  191. package/dist/internal/codemirror/rich/utils/images.test.d.ts +2 -0
  192. package/dist/internal/codemirror/rich/utils/images.test.d.ts.map +1 -0
  193. package/dist/internal/codemirror/rich/utils/images.test.js +37 -0
  194. package/dist/internal/codemirror/rich/utils/indent.d.ts +38 -0
  195. package/dist/internal/codemirror/rich/utils/indent.d.ts.map +1 -0
  196. package/dist/internal/codemirror/rich/utils/indent.js +435 -0
  197. package/dist/internal/codemirror/rich/utils/indent.test.d.ts +2 -0
  198. package/dist/internal/codemirror/rich/utils/indent.test.d.ts.map +1 -0
  199. package/dist/internal/codemirror/rich/utils/indent.test.js +169 -0
  200. package/dist/internal/codemirror/rich/utils/inline-code.d.ts +7 -0
  201. package/dist/internal/codemirror/rich/utils/inline-code.d.ts.map +1 -0
  202. package/dist/internal/codemirror/rich/utils/inline-code.js +43 -0
  203. package/dist/internal/codemirror/rich/utils/inline-math.d.ts +6 -0
  204. package/dist/internal/codemirror/rich/utils/inline-math.d.ts.map +1 -0
  205. package/dist/internal/codemirror/rich/utils/inline-math.js +45 -0
  206. package/dist/internal/codemirror/rich/utils/inline-math.test.d.ts +2 -0
  207. package/dist/internal/codemirror/rich/utils/inline-math.test.d.ts.map +1 -0
  208. package/dist/internal/codemirror/rich/utils/inline-math.test.js +15 -0
  209. package/dist/internal/codemirror/rich/utils/links.d.ts +6 -0
  210. package/dist/internal/codemirror/rich/utils/links.d.ts.map +1 -0
  211. package/dist/internal/codemirror/rich/utils/links.js +36 -0
  212. package/dist/internal/codemirror/rich/utils/links.test.d.ts +2 -0
  213. package/dist/internal/codemirror/rich/utils/links.test.d.ts.map +1 -0
  214. package/dist/internal/codemirror/rich/utils/links.test.js +28 -0
  215. package/dist/internal/codemirror/rich/utils/list-callouts.d.ts +15 -0
  216. package/dist/internal/codemirror/rich/utils/list-callouts.d.ts.map +1 -0
  217. package/dist/internal/codemirror/rich/utils/list-callouts.js +41 -0
  218. package/dist/internal/codemirror/rich/utils/list-callouts.test.d.ts +2 -0
  219. package/dist/internal/codemirror/rich/utils/list-callouts.test.d.ts.map +1 -0
  220. package/dist/internal/codemirror/rich/utils/list-callouts.test.js +47 -0
  221. package/dist/internal/codemirror/rich/utils/measured-indent.d.ts +18 -0
  222. package/dist/internal/codemirror/rich/utils/measured-indent.d.ts.map +1 -0
  223. package/dist/internal/codemirror/rich/utils/measured-indent.js +419 -0
  224. package/dist/internal/codemirror/rich/utils/measured-indent.test.d.ts +2 -0
  225. package/dist/internal/codemirror/rich/utils/measured-indent.test.d.ts.map +1 -0
  226. package/dist/internal/codemirror/rich/utils/measured-indent.test.js +102 -0
  227. package/dist/internal/codemirror/rich/utils/ranges.d.ts +13 -0
  228. package/dist/internal/codemirror/rich/utils/ranges.d.ts.map +1 -0
  229. package/dist/internal/codemirror/rich/utils/ranges.js +42 -0
  230. package/dist/internal/codemirror/rich/utils/ranges.test.d.ts +2 -0
  231. package/dist/internal/codemirror/rich/utils/ranges.test.d.ts.map +1 -0
  232. package/dist/internal/codemirror/rich/utils/ranges.test.js +22 -0
  233. package/dist/internal/codemirror/rich/utils/tasks.d.ts +11 -0
  234. package/dist/internal/codemirror/rich/utils/tasks.d.ts.map +1 -0
  235. package/dist/internal/codemirror/rich/utils/tasks.js +23 -0
  236. package/dist/internal/codemirror/rich/utils/tasks.test.d.ts +2 -0
  237. package/dist/internal/codemirror/rich/utils/tasks.test.d.ts.map +1 -0
  238. package/dist/internal/codemirror/rich/utils/tasks.test.js +57 -0
  239. package/dist/internal/codemirror/rich/widgets/list-callout.d.ts +19 -0
  240. package/dist/internal/codemirror/rich/widgets/list-callout.d.ts.map +1 -0
  241. package/dist/internal/codemirror/rich/widgets/list-callout.js +58 -0
  242. package/dist/internal/codemirror/rich/widgets/preview-widgets.d.ts +50 -0
  243. package/dist/internal/codemirror/rich/widgets/preview-widgets.d.ts.map +1 -0
  244. package/dist/internal/codemirror/rich/widgets/preview-widgets.js +311 -0
  245. package/dist/internal/codemirror/rich/widgets/source-toggle.d.ts +4 -0
  246. package/dist/internal/codemirror/rich/widgets/source-toggle.d.ts.map +1 -0
  247. package/dist/internal/codemirror/rich/widgets/source-toggle.js +47 -0
  248. package/dist/internal/codemirror/rich/widgets/task-checkbox.d.ts +14 -0
  249. package/dist/internal/codemirror/rich/widgets/task-checkbox.d.ts.map +1 -0
  250. package/dist/internal/codemirror/rich/widgets/task-checkbox.js +54 -0
  251. package/dist/internal/doodle-dividers.d.ts +62 -0
  252. package/dist/internal/doodle-dividers.d.ts.map +1 -0
  253. package/dist/internal/doodle-dividers.js +103 -0
  254. package/dist/internal/task-states.d.ts +73 -0
  255. package/dist/internal/task-states.d.ts.map +1 -0
  256. package/dist/internal/task-states.js +27 -0
  257. package/dist/internal/task-states.test.d.ts +2 -0
  258. package/dist/internal/task-states.test.d.ts.map +1 -0
  259. package/dist/internal/task-states.test.js +36 -0
  260. package/dist/mira-code-editor.css +222 -0
  261. package/dist/mira-code-editor.d.ts +40 -0
  262. package/dist/mira-code-editor.d.ts.map +1 -0
  263. package/dist/mira-code-editor.js +1 -0
  264. package/dist/mira-code-editor.svelte +181 -0
  265. package/dist/mira-code-editor.svelte.d.ts +17 -0
  266. package/dist/mira-code-editor.svelte.d.ts.map +1 -0
  267. package/dist/mira-code-editor.test.d.ts +2 -0
  268. package/dist/mira-code-editor.test.d.ts.map +1 -0
  269. package/dist/mira-code-editor.test.js +93 -0
  270. package/dist/mira.svelte +581 -0
  271. package/dist/mira.svelte.d.ts +23 -0
  272. package/dist/mira.svelte.d.ts.map +1 -0
  273. package/dist/mode-position.d.ts +18 -0
  274. package/dist/mode-position.d.ts.map +1 -0
  275. package/dist/mode-position.js +99 -0
  276. package/dist/mode-position.test.d.ts +2 -0
  277. package/dist/mode-position.test.d.ts.map +1 -0
  278. package/dist/mode-position.test.js +60 -0
  279. package/dist/preview/adobe-gridtables.d.ts +11 -0
  280. package/dist/preview/code-language.d.ts +2 -0
  281. package/dist/preview/code-language.d.ts.map +1 -0
  282. package/dist/preview/code-language.js +58 -0
  283. package/dist/preview/code-language.test.d.ts +2 -0
  284. package/dist/preview/code-language.test.d.ts.map +1 -0
  285. package/dist/preview/code-language.test.js +12 -0
  286. package/dist/preview/components/callout.svelte +123 -0
  287. package/dist/preview/components/callout.svelte.d.ts +17 -0
  288. package/dist/preview/components/callout.svelte.d.ts.map +1 -0
  289. package/dist/preview/components/checkbox.svelte +151 -0
  290. package/dist/preview/components/checkbox.svelte.d.ts +12 -0
  291. package/dist/preview/components/checkbox.svelte.d.ts.map +1 -0
  292. package/dist/preview/components/code.svelte +146 -0
  293. package/dist/preview/components/code.svelte.d.ts +12 -0
  294. package/dist/preview/components/code.svelte.d.ts.map +1 -0
  295. package/dist/preview/components/embed.svelte +236 -0
  296. package/dist/preview/components/embed.svelte.d.ts +14 -0
  297. package/dist/preview/components/embed.svelte.d.ts.map +1 -0
  298. package/dist/preview/components/embedded-markdown-preview.svelte +53 -0
  299. package/dist/preview/components/embedded-markdown-preview.svelte.d.ts +12 -0
  300. package/dist/preview/components/embedded-markdown-preview.svelte.d.ts.map +1 -0
  301. package/dist/preview/components/frontmatter-property-name-input.svelte +207 -0
  302. package/dist/preview/components/frontmatter-property-name-input.svelte.d.ts +14 -0
  303. package/dist/preview/components/frontmatter-property-name-input.svelte.d.ts.map +1 -0
  304. package/dist/preview/components/frontmatter-property-text-input.svelte +228 -0
  305. package/dist/preview/components/frontmatter-property-text-input.svelte.d.ts +13 -0
  306. package/dist/preview/components/frontmatter-property-text-input.svelte.d.ts.map +1 -0
  307. package/dist/preview/components/frontmatter-property-value-input.svelte +232 -0
  308. package/dist/preview/components/frontmatter-property-value-input.svelte.d.ts +13 -0
  309. package/dist/preview/components/frontmatter-property-value-input.svelte.d.ts.map +1 -0
  310. package/dist/preview/components/frontmatter-utils.d.ts +2 -0
  311. package/dist/preview/components/frontmatter-utils.d.ts.map +1 -0
  312. package/dist/preview/components/frontmatter-utils.js +1 -0
  313. package/dist/preview/components/frontmatter.svelte +857 -0
  314. package/dist/preview/components/frontmatter.svelte.d.ts +18 -0
  315. package/dist/preview/components/frontmatter.svelte.d.ts.map +1 -0
  316. package/dist/preview/components/icon.svelte +225 -0
  317. package/dist/preview/components/icon.svelte.d.ts +9 -0
  318. package/dist/preview/components/icon.svelte.d.ts.map +1 -0
  319. package/dist/preview/components/icon.test.d.ts +2 -0
  320. package/dist/preview/components/icon.test.d.ts.map +1 -0
  321. package/dist/preview/components/icon.test.js +20 -0
  322. package/dist/preview/components/image.svelte +266 -0
  323. package/dist/preview/components/image.svelte.d.ts +10 -0
  324. package/dist/preview/components/image.svelte.d.ts.map +1 -0
  325. package/dist/preview/components/link.svelte +382 -0
  326. package/dist/preview/components/link.svelte.d.ts +16 -0
  327. package/dist/preview/components/link.svelte.d.ts.map +1 -0
  328. package/dist/preview/components/list-callout-control.svelte +138 -0
  329. package/dist/preview/components/list-callout-control.svelte.d.ts +10 -0
  330. package/dist/preview/components/list-callout-control.svelte.d.ts.map +1 -0
  331. package/dist/preview/components/list-callout-marker.svelte +108 -0
  332. package/dist/preview/components/list-callout-marker.svelte.d.ts +15 -0
  333. package/dist/preview/components/list-callout-marker.svelte.d.ts.map +1 -0
  334. package/dist/preview/components/list-item.svelte +161 -0
  335. package/dist/preview/components/list-item.svelte.d.ts +11 -0
  336. package/dist/preview/components/list-item.svelte.d.ts.map +1 -0
  337. package/dist/preview/components/tag.svelte +18 -0
  338. package/dist/preview/components/tag.svelte.d.ts +10 -0
  339. package/dist/preview/components/tag.svelte.d.ts.map +1 -0
  340. package/dist/preview/components/task-checkbox-control.svelte +113 -0
  341. package/dist/preview/components/task-checkbox-control.svelte.d.ts +14 -0
  342. package/dist/preview/components/task-checkbox-control.svelte.d.ts.map +1 -0
  343. package/dist/preview/editable-markdown-preview/behavior.d.ts +6 -0
  344. package/dist/preview/editable-markdown-preview/behavior.d.ts.map +1 -0
  345. package/dist/preview/editable-markdown-preview/behavior.js +57 -0
  346. package/dist/preview/editable-markdown-preview/behavior.test.d.ts +2 -0
  347. package/dist/preview/editable-markdown-preview/behavior.test.d.ts.map +1 -0
  348. package/dist/preview/editable-markdown-preview/behavior.test.js +36 -0
  349. package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte +386 -0
  350. package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte.d.ts +35 -0
  351. package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte.d.ts.map +1 -0
  352. package/dist/preview/editable-markdown-preview/editor-surface.svelte +228 -0
  353. package/dist/preview/editable-markdown-preview/editor-surface.svelte.d.ts +22 -0
  354. package/dist/preview/editable-markdown-preview/editor-surface.svelte.d.ts.map +1 -0
  355. package/dist/preview/editable-markdown-preview/serialized-writer.d.ts +36 -0
  356. package/dist/preview/editable-markdown-preview/serialized-writer.d.ts.map +1 -0
  357. package/dist/preview/editable-markdown-preview/serialized-writer.js +109 -0
  358. package/dist/preview/editable-markdown-preview/serialized-writer.test.d.ts +2 -0
  359. package/dist/preview/editable-markdown-preview/serialized-writer.test.d.ts.map +1 -0
  360. package/dist/preview/editable-markdown-preview/serialized-writer.test.js +59 -0
  361. package/dist/preview/editable-markdown-preview.svelte +195 -0
  362. package/dist/preview/editable-markdown-preview.svelte.d.ts +37 -0
  363. package/dist/preview/editable-markdown-preview.svelte.d.ts.map +1 -0
  364. package/dist/preview/embed-target.d.ts +13 -0
  365. package/dist/preview/embed-target.d.ts.map +1 -0
  366. package/dist/preview/embed-target.js +133 -0
  367. package/dist/preview/embed-target.test.d.ts +2 -0
  368. package/dist/preview/embed-target.test.d.ts.map +1 -0
  369. package/dist/preview/embed-target.test.js +78 -0
  370. package/dist/preview/file-embed.svelte +56 -0
  371. package/dist/preview/file-embed.svelte.d.ts +32 -0
  372. package/dist/preview/file-embed.svelte.d.ts.map +1 -0
  373. package/dist/preview/frontmatter/controller.svelte.d.ts +58 -0
  374. package/dist/preview/frontmatter/controller.svelte.d.ts.map +1 -0
  375. package/dist/preview/frontmatter/controller.svelte.js +195 -0
  376. package/dist/preview/frontmatter/defaults.d.ts +3 -0
  377. package/dist/preview/frontmatter/defaults.d.ts.map +1 -0
  378. package/dist/preview/frontmatter/defaults.js +32 -0
  379. package/dist/preview/frontmatter/frontmatter.test.d.ts +2 -0
  380. package/dist/preview/frontmatter/frontmatter.test.d.ts.map +1 -0
  381. package/dist/preview/frontmatter/frontmatter.test.js +190 -0
  382. package/dist/preview/frontmatter/index.d.ts +12 -0
  383. package/dist/preview/frontmatter/index.d.ts.map +1 -0
  384. package/dist/preview/frontmatter/index.js +11 -0
  385. package/dist/preview/frontmatter/manager.d.ts +28 -0
  386. package/dist/preview/frontmatter/manager.d.ts.map +1 -0
  387. package/dist/preview/frontmatter/manager.js +46 -0
  388. package/dist/preview/frontmatter/parse.d.ts +4 -0
  389. package/dist/preview/frontmatter/parse.d.ts.map +1 -0
  390. package/dist/preview/frontmatter/parse.js +49 -0
  391. package/dist/preview/frontmatter/predicates.d.ts +3 -0
  392. package/dist/preview/frontmatter/predicates.d.ts.map +1 -0
  393. package/dist/preview/frontmatter/predicates.js +7 -0
  394. package/dist/preview/frontmatter/properties.d.ts +13 -0
  395. package/dist/preview/frontmatter/properties.d.ts.map +1 -0
  396. package/dist/preview/frontmatter/properties.js +250 -0
  397. package/dist/preview/frontmatter/serialize.d.ts +3 -0
  398. package/dist/preview/frontmatter/serialize.d.ts.map +1 -0
  399. package/dist/preview/frontmatter/serialize.js +10 -0
  400. package/dist/preview/frontmatter/suggestions.d.ts +11 -0
  401. package/dist/preview/frontmatter/suggestions.d.ts.map +1 -0
  402. package/dist/preview/frontmatter/suggestions.js +91 -0
  403. package/dist/preview/frontmatter/suggestions.test.d.ts +2 -0
  404. package/dist/preview/frontmatter/suggestions.test.d.ts.map +1 -0
  405. package/dist/preview/frontmatter/suggestions.test.js +45 -0
  406. package/dist/preview/frontmatter/types.d.ts +66 -0
  407. package/dist/preview/frontmatter/types.d.ts.map +1 -0
  408. package/dist/preview/frontmatter/types.js +27 -0
  409. package/dist/preview/frontmatter/values.d.ts +5 -0
  410. package/dist/preview/frontmatter/values.d.ts.map +1 -0
  411. package/dist/preview/frontmatter/values.js +96 -0
  412. package/dist/preview/frontmatter/widgets.d.ts +9 -0
  413. package/dist/preview/frontmatter/widgets.d.ts.map +1 -0
  414. package/dist/preview/frontmatter/widgets.js +104 -0
  415. package/dist/preview/index.d.ts +18 -0
  416. package/dist/preview/index.d.ts.map +1 -0
  417. package/dist/preview/index.js +15 -0
  418. package/dist/preview/markdown-embed.svelte +80 -0
  419. package/dist/preview/markdown-embed.svelte.d.ts +27 -0
  420. package/dist/preview/markdown-embed.svelte.d.ts.map +1 -0
  421. package/dist/preview/markdown-outline.svelte +256 -0
  422. package/dist/preview/markdown-outline.svelte.d.ts +15 -0
  423. package/dist/preview/markdown-outline.svelte.d.ts.map +1 -0
  424. package/dist/preview/markdown-preview.svelte +500 -0
  425. package/dist/preview/markdown-preview.svelte.d.ts +30 -0
  426. package/dist/preview/markdown-preview.svelte.d.ts.map +1 -0
  427. package/dist/preview/note-link.svelte +78 -0
  428. package/dist/preview/note-link.svelte.d.ts +25 -0
  429. package/dist/preview/note-link.svelte.d.ts.map +1 -0
  430. package/dist/preview/outline.d.ts +16 -0
  431. package/dist/preview/outline.d.ts.map +1 -0
  432. package/dist/preview/outline.js +54 -0
  433. package/dist/preview/outline.test.d.ts +2 -0
  434. package/dist/preview/outline.test.d.ts.map +1 -0
  435. package/dist/preview/outline.test.js +98 -0
  436. package/dist/preview/portable-surfaces.test.d.ts +2 -0
  437. package/dist/preview/portable-surfaces.test.d.ts.map +1 -0
  438. package/dist/preview/portable-surfaces.test.js +482 -0
  439. package/dist/preview/preview.test.d.ts +2 -0
  440. package/dist/preview/preview.test.d.ts.map +1 -0
  441. package/dist/preview/preview.test.js +124 -0
  442. package/dist/preview/rehype-code-context.d.ts +5 -0
  443. package/dist/preview/rehype-code-context.d.ts.map +1 -0
  444. package/dist/preview/rehype-code-context.js +17 -0
  445. package/dist/preview/rehype-highlight-lines.d.ts +9 -0
  446. package/dist/preview/rehype-highlight-lines.d.ts.map +1 -0
  447. package/dist/preview/rehype-highlight-lines.js +257 -0
  448. package/dist/preview/rehype-table-spans.d.ts +4 -0
  449. package/dist/preview/rehype-table-spans.d.ts.map +1 -0
  450. package/dist/preview/rehype-table-spans.js +120 -0
  451. package/dist/preview/remark/callouts.d.ts +4 -0
  452. package/dist/preview/remark/callouts.d.ts.map +1 -0
  453. package/dist/preview/remark/callouts.js +81 -0
  454. package/dist/preview/remark/callouts.test.d.ts +2 -0
  455. package/dist/preview/remark/callouts.test.d.ts.map +1 -0
  456. package/dist/preview/remark/callouts.test.js +23 -0
  457. package/dist/preview/remark/custom-checklists.d.ts +25 -0
  458. package/dist/preview/remark/custom-checklists.d.ts.map +1 -0
  459. package/dist/preview/remark/custom-checklists.js +204 -0
  460. package/dist/preview/remark/custom-checklists.test.d.ts +2 -0
  461. package/dist/preview/remark/custom-checklists.test.d.ts.map +1 -0
  462. package/dist/preview/remark/custom-checklists.test.js +51 -0
  463. package/dist/preview/remark/external-links.d.ts +4 -0
  464. package/dist/preview/remark/external-links.d.ts.map +1 -0
  465. package/dist/preview/remark/external-links.js +34 -0
  466. package/dist/preview/remark/hast.d.ts +6 -0
  467. package/dist/preview/remark/hast.d.ts.map +1 -0
  468. package/dist/preview/remark/hast.js +60 -0
  469. package/dist/preview/remark/headings.d.ts +8 -0
  470. package/dist/preview/remark/headings.d.ts.map +1 -0
  471. package/dist/preview/remark/headings.js +40 -0
  472. package/dist/preview/remark/links.test.d.ts +2 -0
  473. package/dist/preview/remark/links.test.d.ts.map +1 -0
  474. package/dist/preview/remark/links.test.js +62 -0
  475. package/dist/preview/remark/list-callouts.d.ts +14 -0
  476. package/dist/preview/remark/list-callouts.d.ts.map +1 -0
  477. package/dist/preview/remark/list-callouts.js +91 -0
  478. package/dist/preview/remark/multimarkdown-table.d.ts +11 -0
  479. package/dist/preview/remark/multimarkdown-table.d.ts.map +1 -0
  480. package/dist/preview/remark/multimarkdown-table.js +138 -0
  481. package/dist/preview/remark/parity.test.d.ts +2 -0
  482. package/dist/preview/remark/parity.test.d.ts.map +1 -0
  483. package/dist/preview/remark/parity.test.js +105 -0
  484. package/dist/preview/remark/pathlink.d.ts +4 -0
  485. package/dist/preview/remark/pathlink.d.ts.map +1 -0
  486. package/dist/preview/remark/pathlink.js +26 -0
  487. package/dist/preview/remark/tags.d.ts +4 -0
  488. package/dist/preview/remark/tags.d.ts.map +1 -0
  489. package/dist/preview/remark/tags.js +22 -0
  490. package/dist/preview/remark/utils.d.ts +12 -0
  491. package/dist/preview/remark/utils.d.ts.map +1 -0
  492. package/dist/preview/remark/utils.js +74 -0
  493. package/dist/preview/remark/wikilink.d.ts +4 -0
  494. package/dist/preview/remark/wikilink.d.ts.map +1 -0
  495. package/dist/preview/remark/wikilink.js +23 -0
  496. package/dist/preview/remark.d.ts +12 -0
  497. package/dist/preview/remark.d.ts.map +1 -0
  498. package/dist/preview/remark.js +11 -0
  499. package/dist/preview/renderer/context.svelte.d.ts +37 -0
  500. package/dist/preview/renderer/context.svelte.d.ts.map +1 -0
  501. package/dist/preview/renderer/context.svelte.js +47 -0
  502. package/dist/preview/renderer/markdown.svelte +109 -0
  503. package/dist/preview/renderer/markdown.svelte.d.ts +28 -0
  504. package/dist/preview/renderer/markdown.svelte.d.ts.map +1 -0
  505. package/dist/preview/renderer/renderer.svelte +122 -0
  506. package/dist/preview/renderer/renderer.svelte.d.ts +9 -0
  507. package/dist/preview/renderer/renderer.svelte.d.ts.map +1 -0
  508. package/dist/preview/renderer/types.d.ts +20 -0
  509. package/dist/preview/renderer/types.d.ts.map +1 -0
  510. package/dist/preview/renderer/types.js +1 -0
  511. package/dist/preview/renderer/utils.d.ts +9 -0
  512. package/dist/preview/renderer/utils.d.ts.map +1 -0
  513. package/dist/preview/renderer/utils.js +135 -0
  514. package/dist/preview/styles/blockquotes-footnotes.css +78 -0
  515. package/dist/preview/styles/callouts.css +171 -0
  516. package/dist/preview/styles/code-katex.css +213 -0
  517. package/dist/preview/styles/editor-shared.css +132 -0
  518. package/dist/preview/styles/frontmatter-collapsible.css +94 -0
  519. package/dist/preview/styles/frontmatter-properties.css +532 -0
  520. package/dist/preview/styles/frontmatter-properties.test.d.ts +2 -0
  521. package/dist/preview/styles/frontmatter-properties.test.d.ts.map +1 -0
  522. package/dist/preview/styles/frontmatter-properties.test.js +57 -0
  523. package/dist/preview/styles/headings.css +183 -0
  524. package/dist/preview/styles/images.css +177 -0
  525. package/dist/preview/styles/links-embeds-tags.css +275 -0
  526. package/dist/preview/styles/list-callouts.css +281 -0
  527. package/dist/preview/styles/lists-tasks.css +638 -0
  528. package/dist/preview/styles/live-preview.css +58 -0
  529. package/dist/preview/styles/mermaid-highlight.css +112 -0
  530. package/dist/preview/styles/outline.css +219 -0
  531. package/dist/preview/styles/reading-mode.css +151 -0
  532. package/dist/preview/styles/source-mode.css +498 -0
  533. package/dist/preview/styles/source-mode.test.d.ts +2 -0
  534. package/dist/preview/styles/source-mode.test.d.ts.map +1 -0
  535. package/dist/preview/styles/source-mode.test.js +13 -0
  536. package/dist/preview/styles/surfaces.css +56 -0
  537. package/dist/preview/styles/tables.css +550 -0
  538. package/dist/preview/styles/tokens.css +269 -0
  539. package/dist/preview/styles/utilities.css +700 -0
  540. package/dist/preview/styles.css +22 -0
  541. package/dist/preview/test-utils.d.ts +3 -0
  542. package/dist/preview/test-utils.d.ts.map +1 -0
  543. package/dist/preview/test-utils.js +15 -0
  544. package/dist/styles.css +139 -0
  545. package/dist/tables/adobe-gridtables.d.ts +6 -0
  546. package/dist/tables/editor-column.svelte +136 -0
  547. package/dist/tables/editor-column.svelte.d.ts +12 -0
  548. package/dist/tables/editor-column.svelte.d.ts.map +1 -0
  549. package/dist/tables/editor-table.svelte +967 -0
  550. package/dist/tables/editor-table.svelte.d.ts +12 -0
  551. package/dist/tables/editor-table.svelte.d.ts.map +1 -0
  552. package/dist/tables/extension.d.ts +19 -0
  553. package/dist/tables/extension.d.ts.map +1 -0
  554. package/dist/tables/extension.js +189 -0
  555. package/dist/tables/extension.test.d.ts +2 -0
  556. package/dist/tables/extension.test.d.ts.map +1 -0
  557. package/dist/tables/extension.test.js +100 -0
  558. package/dist/tables/from-markdown.d.ts +1 -0
  559. package/dist/tables/from-markdown.js +378 -0
  560. package/dist/tables/grid-editor-column.svelte +127 -0
  561. package/dist/tables/grid-editor-column.svelte.d.ts +10 -0
  562. package/dist/tables/grid-editor-column.svelte.d.ts.map +1 -0
  563. package/dist/tables/grid-editor-column.test.d.ts +2 -0
  564. package/dist/tables/grid-editor-column.test.d.ts.map +1 -0
  565. package/dist/tables/grid-editor-column.test.js +27 -0
  566. package/dist/tables/grid-editor-table.svelte +1260 -0
  567. package/dist/tables/grid-editor-table.svelte.d.ts +12 -0
  568. package/dist/tables/grid-editor-table.svelte.d.ts.map +1 -0
  569. package/dist/tables/grid-table-extension.d.ts +14 -0
  570. package/dist/tables/grid-table-extension.d.ts.map +1 -0
  571. package/dist/tables/grid-table-extension.js +183 -0
  572. package/dist/tables/grid-table.d.ts +141 -0
  573. package/dist/tables/grid-table.d.ts.map +1 -0
  574. package/dist/tables/grid-table.js +425 -0
  575. package/dist/tables/grid-table.test.d.ts +2 -0
  576. package/dist/tables/grid-table.test.d.ts.map +1 -0
  577. package/dist/tables/grid-table.test.js +140 -0
  578. package/dist/tables/index.d.ts +13 -0
  579. package/dist/tables/index.d.ts.map +1 -0
  580. package/dist/tables/index.js +12 -0
  581. package/dist/tables/index.test.d.ts +2 -0
  582. package/dist/tables/index.test.d.ts.map +1 -0
  583. package/dist/tables/index.test.js +7 -0
  584. package/dist/tables/inline-editor-extensions.d.ts +3 -0
  585. package/dist/tables/inline-editor-extensions.d.ts.map +1 -0
  586. package/dist/tables/inline-editor-extensions.js +16 -0
  587. package/dist/tables/inline-editor-extensions.test.d.ts +2 -0
  588. package/dist/tables/inline-editor-extensions.test.d.ts.map +1 -0
  589. package/dist/tables/inline-editor-extensions.test.js +23 -0
  590. package/dist/tables/markdown-table-column-head.svelte +103 -0
  591. package/dist/tables/markdown-table-column-head.svelte.d.ts +14 -0
  592. package/dist/tables/markdown-table-column-head.svelte.d.ts.map +1 -0
  593. package/dist/tables/markdown-table-data-cell.svelte +121 -0
  594. package/dist/tables/markdown-table-data-cell.svelte.d.ts +24 -0
  595. package/dist/tables/markdown-table-data-cell.svelte.d.ts.map +1 -0
  596. package/dist/tables/markdown-table-dnd.d.ts +6 -0
  597. package/dist/tables/markdown-table-dnd.d.ts.map +1 -0
  598. package/dist/tables/markdown-table-dnd.js +6 -0
  599. package/dist/tables/markdown-table-row-gutter-cell.svelte +161 -0
  600. package/dist/tables/markdown-table-row-gutter-cell.svelte.d.ts +15 -0
  601. package/dist/tables/markdown-table-row-gutter-cell.svelte.d.ts.map +1 -0
  602. package/dist/tables/menu-component.svelte +109 -0
  603. package/dist/tables/menu-component.svelte.d.ts +8 -0
  604. package/dist/tables/menu-component.svelte.d.ts.map +1 -0
  605. package/dist/tables/menu.d.ts +21 -0
  606. package/dist/tables/menu.d.ts.map +1 -0
  607. package/dist/tables/menu.js +41 -0
  608. package/dist/tables/pipe-table.d.ts +4 -0
  609. package/dist/tables/pipe-table.d.ts.map +1 -0
  610. package/dist/tables/pipe-table.js +62 -0
  611. package/dist/tables/pipe-table.test.d.ts +2 -0
  612. package/dist/tables/pipe-table.test.d.ts.map +1 -0
  613. package/dist/tables/pipe-table.test.js +13 -0
  614. package/dist/tables/syntax.d.ts +1 -0
  615. package/dist/tables/syntax.js +436 -0
  616. package/dist/tables/table-line-scroll-sync.d.ts +5 -0
  617. package/dist/tables/table-line-scroll-sync.d.ts.map +1 -0
  618. package/dist/tables/table-line-scroll-sync.js +123 -0
  619. package/dist/tables/table-node.d.ts +92 -0
  620. package/dist/tables/table-node.d.ts.map +1 -0
  621. package/dist/tables/table-node.js +514 -0
  622. package/dist/tables/table-node.test.d.ts +2 -0
  623. package/dist/tables/table-node.test.d.ts.map +1 -0
  624. package/dist/tables/table-node.test.js +167 -0
  625. package/dist/tables/types.d.ts +25 -0
  626. package/dist/tables/types.d.ts.map +1 -0
  627. package/dist/tables/types.js +8 -0
  628. package/dist/tables/utils.d.ts +4 -0
  629. package/dist/tables/utils.d.ts.map +1 -0
  630. package/dist/tables/utils.js +16 -0
  631. package/dist/tables/widgets/grid-table-widget.d.ts +3 -0
  632. package/dist/tables/widgets/grid-table-widget.d.ts.map +1 -0
  633. package/dist/tables/widgets/grid-table-widget.js +26 -0
  634. package/dist/tables/widgets/pipe-table-widget.d.ts +3 -0
  635. package/dist/tables/widgets/pipe-table-widget.d.ts.map +1 -0
  636. package/dist/tables/widgets/pipe-table-widget.js +25 -0
  637. package/dist/tables/widgets/source-button.d.ts +2 -0
  638. package/dist/tables/widgets/source-button.d.ts.map +1 -0
  639. package/dist/tables/widgets/source-button.js +20 -0
  640. package/dist/tables/widgets/source-button.test.d.ts +2 -0
  641. package/dist/tables/widgets/source-button.test.d.ts.map +1 -0
  642. package/dist/tables/widgets/source-button.test.js +11 -0
  643. package/dist/test-setup.d.ts +2 -0
  644. package/dist/test-setup.d.ts.map +1 -0
  645. package/dist/test-setup.js +31 -0
  646. package/dist/themes/_contract.css +88 -0
  647. package/dist/themes/_mira-palette.css +187 -0
  648. package/dist/themes/_obsidian-palette.css +183 -0
  649. package/dist/themes/mira.css +2 -0
  650. package/dist/themes/obsidian.css +2 -0
  651. package/dist/themes/theme-contract.test.d.ts +2 -0
  652. package/dist/themes/theme-contract.test.d.ts.map +1 -0
  653. package/dist/themes/theme-contract.test.js +88 -0
  654. package/dist/themes.css +3 -0
  655. package/dist/types.d.ts +55 -0
  656. package/dist/types.d.ts.map +1 -0
  657. package/dist/types.js +1 -0
  658. package/dist/ui/appearance/index.d.ts +6 -0
  659. package/dist/ui/appearance/index.d.ts.map +1 -0
  660. package/dist/ui/appearance/index.js +9 -0
  661. package/dist/ui/button/button.shared.d.ts +59 -0
  662. package/dist/ui/button/button.shared.d.ts.map +1 -0
  663. package/dist/ui/button/button.shared.js +25 -0
  664. package/dist/ui/button/button.svelte +42 -0
  665. package/dist/ui/button/button.svelte.d.ts +5 -0
  666. package/dist/ui/button/button.svelte.d.ts.map +1 -0
  667. package/dist/ui/button/index.d.ts +4 -0
  668. package/dist/ui/button/index.d.ts.map +1 -0
  669. package/dist/ui/button/index.js +5 -0
  670. package/dist/ui/context-menu/context-menu-checkbox-item.svelte +40 -0
  671. package/dist/ui/context-menu/context-menu-checkbox-item.svelte.d.ts +10 -0
  672. package/dist/ui/context-menu/context-menu-checkbox-item.svelte.d.ts.map +1 -0
  673. package/dist/ui/context-menu/context-menu-content.svelte +61 -0
  674. package/dist/ui/context-menu/context-menu-content.svelte.d.ts +8 -0
  675. package/dist/ui/context-menu/context-menu-content.svelte.d.ts.map +1 -0
  676. package/dist/ui/context-menu/context-menu-group-heading.svelte +24 -0
  677. package/dist/ui/context-menu/context-menu-group-heading.svelte.d.ts +8 -0
  678. package/dist/ui/context-menu/context-menu-group-heading.svelte.d.ts.map +1 -0
  679. package/dist/ui/context-menu/context-menu-group.svelte +12 -0
  680. package/dist/ui/context-menu/context-menu-group.svelte.d.ts +5 -0
  681. package/dist/ui/context-menu/context-menu-group.svelte.d.ts.map +1 -0
  682. package/dist/ui/context-menu/context-menu-item.svelte +27 -0
  683. package/dist/ui/context-menu/context-menu-item.svelte.d.ts +9 -0
  684. package/dist/ui/context-menu/context-menu-item.svelte.d.ts.map +1 -0
  685. package/dist/ui/context-menu/context-menu-label.svelte +27 -0
  686. package/dist/ui/context-menu/context-menu-label.svelte.d.ts +9 -0
  687. package/dist/ui/context-menu/context-menu-label.svelte.d.ts.map +1 -0
  688. package/dist/ui/context-menu/context-menu-radio-group.svelte +16 -0
  689. package/dist/ui/context-menu/context-menu-radio-group.svelte.d.ts +5 -0
  690. package/dist/ui/context-menu/context-menu-radio-group.svelte.d.ts.map +1 -0
  691. package/dist/ui/context-menu/context-menu-radio-item.svelte +33 -0
  692. package/dist/ui/context-menu/context-menu-radio-item.svelte.d.ts +5 -0
  693. package/dist/ui/context-menu/context-menu-radio-item.svelte.d.ts.map +1 -0
  694. package/dist/ui/context-menu/context-menu-root.svelte +17 -0
  695. package/dist/ui/context-menu/context-menu-root.svelte.d.ts +4 -0
  696. package/dist/ui/context-menu/context-menu-root.svelte.d.ts.map +1 -0
  697. package/dist/ui/context-menu/context-menu-separator.svelte +17 -0
  698. package/dist/ui/context-menu/context-menu-separator.svelte.d.ts +5 -0
  699. package/dist/ui/context-menu/context-menu-separator.svelte.d.ts.map +1 -0
  700. package/dist/ui/context-menu/context-menu-shortcut.svelte +20 -0
  701. package/dist/ui/context-menu/context-menu-shortcut.svelte.d.ts +6 -0
  702. package/dist/ui/context-menu/context-menu-shortcut.svelte.d.ts.map +1 -0
  703. package/dist/ui/context-menu/context-menu-sub-content.svelte +20 -0
  704. package/dist/ui/context-menu/context-menu-sub-content.svelte.d.ts +5 -0
  705. package/dist/ui/context-menu/context-menu-sub-content.svelte.d.ts.map +1 -0
  706. package/dist/ui/context-menu/context-menu-sub-trigger.svelte +29 -0
  707. package/dist/ui/context-menu/context-menu-sub-trigger.svelte.d.ts +9 -0
  708. package/dist/ui/context-menu/context-menu-sub-trigger.svelte.d.ts.map +1 -0
  709. package/dist/ui/context-menu/context-menu-trigger.svelte +29 -0
  710. package/dist/ui/context-menu/context-menu-trigger.svelte.d.ts +5 -0
  711. package/dist/ui/context-menu/context-menu-trigger.svelte.d.ts.map +1 -0
  712. package/dist/ui/context-menu/index.d.ts +17 -0
  713. package/dist/ui/context-menu/index.d.ts.map +1 -0
  714. package/dist/ui/context-menu/index.js +19 -0
  715. package/dist/ui/dialog/dialog-close.svelte +8 -0
  716. package/dist/ui/dialog/dialog-close.svelte.d.ts +5 -0
  717. package/dist/ui/dialog/dialog-close.svelte.d.ts.map +1 -0
  718. package/dist/ui/dialog/dialog-content.svelte +66 -0
  719. package/dist/ui/dialog/dialog-content.svelte.d.ts +12 -0
  720. package/dist/ui/dialog/dialog-content.svelte.d.ts.map +1 -0
  721. package/dist/ui/dialog/dialog-description.svelte +17 -0
  722. package/dist/ui/dialog/dialog-description.svelte.d.ts +5 -0
  723. package/dist/ui/dialog/dialog-description.svelte.d.ts.map +1 -0
  724. package/dist/ui/dialog/dialog-footer.svelte +23 -0
  725. package/dist/ui/dialog/dialog-footer.svelte.d.ts +6 -0
  726. package/dist/ui/dialog/dialog-footer.svelte.d.ts.map +1 -0
  727. package/dist/ui/dialog/dialog-header.svelte +20 -0
  728. package/dist/ui/dialog/dialog-header.svelte.d.ts +6 -0
  729. package/dist/ui/dialog/dialog-header.svelte.d.ts.map +1 -0
  730. package/dist/ui/dialog/dialog-overlay.svelte +21 -0
  731. package/dist/ui/dialog/dialog-overlay.svelte.d.ts +5 -0
  732. package/dist/ui/dialog/dialog-overlay.svelte.d.ts.map +1 -0
  733. package/dist/ui/dialog/dialog-title.svelte +17 -0
  734. package/dist/ui/dialog/dialog-title.svelte.d.ts +5 -0
  735. package/dist/ui/dialog/dialog-title.svelte.d.ts.map +1 -0
  736. package/dist/ui/dialog/dialog-trigger.svelte +8 -0
  737. package/dist/ui/dialog/dialog-trigger.svelte.d.ts +5 -0
  738. package/dist/ui/dialog/dialog-trigger.svelte.d.ts.map +1 -0
  739. package/dist/ui/dialog/index.d.ts +12 -0
  740. package/dist/ui/dialog/index.d.ts.map +1 -0
  741. package/dist/ui/dialog/index.js +14 -0
  742. package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +43 -0
  743. package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +10 -0
  744. package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts.map +1 -0
  745. package/dist/ui/dropdown-menu/dropdown-menu-content.svelte +63 -0
  746. package/dist/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +8 -0
  747. package/dist/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts.map +1 -0
  748. package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
  749. package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +9 -0
  750. package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts.map +1 -0
  751. package/dist/ui/dropdown-menu/dropdown-menu-group.svelte +14 -0
  752. package/dist/ui/dropdown-menu/dropdown-menu-group.svelte.d.ts +5 -0
  753. package/dist/ui/dropdown-menu/dropdown-menu-group.svelte.d.ts.map +1 -0
  754. package/dist/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
  755. package/dist/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +9 -0
  756. package/dist/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts.map +1 -0
  757. package/dist/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
  758. package/dist/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +9 -0
  759. package/dist/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts.map +1 -0
  760. package/dist/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
  761. package/dist/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +5 -0
  762. package/dist/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts.map +1 -0
  763. package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte +33 -0
  764. package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +5 -0
  765. package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts.map +1 -0
  766. package/dist/ui/dropdown-menu/dropdown-menu-root.svelte +27 -0
  767. package/dist/ui/dropdown-menu/dropdown-menu-root.svelte.d.ts +4 -0
  768. package/dist/ui/dropdown-menu/dropdown-menu-root.svelte.d.ts.map +1 -0
  769. package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
  770. package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +5 -0
  771. package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts.map +1 -0
  772. package/dist/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
  773. package/dist/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +6 -0
  774. package/dist/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts.map +1 -0
  775. package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
  776. package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +5 -0
  777. package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts.map +1 -0
  778. package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
  779. package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +8 -0
  780. package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts.map +1 -0
  781. package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte +29 -0
  782. package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +5 -0
  783. package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts.map +1 -0
  784. package/dist/ui/dropdown-menu/index.d.ts +17 -0
  785. package/dist/ui/dropdown-menu/index.d.ts.map +1 -0
  786. package/dist/ui/dropdown-menu/index.js +17 -0
  787. package/dist/ui/index.d.ts +13 -0
  788. package/dist/ui/index.d.ts.map +1 -0
  789. package/dist/ui/index.js +12 -0
  790. package/dist/ui/index.test.d.ts +2 -0
  791. package/dist/ui/index.test.d.ts.map +1 -0
  792. package/dist/ui/index.test.js +7 -0
  793. package/dist/ui/internal/overlay-portal-context.d.ts +19 -0
  794. package/dist/ui/internal/overlay-portal-context.d.ts.map +1 -0
  795. package/dist/ui/internal/overlay-portal-context.js +39 -0
  796. package/dist/ui/popover/index.d.ts +7 -0
  797. package/dist/ui/popover/index.d.ts.map +1 -0
  798. package/dist/ui/popover/index.js +6 -0
  799. package/dist/ui/popover/popover-content.svelte +65 -0
  800. package/dist/ui/popover/popover-content.svelte.d.ts +8 -0
  801. package/dist/ui/popover/popover-content.svelte.d.ts.map +1 -0
  802. package/dist/ui/popover/popover-root.svelte +15 -0
  803. package/dist/ui/popover/popover-root.svelte.d.ts +4 -0
  804. package/dist/ui/popover/popover-root.svelte.d.ts.map +1 -0
  805. package/dist/ui/popover/popover-trigger.svelte +23 -0
  806. package/dist/ui/popover/popover-trigger.svelte.d.ts +5 -0
  807. package/dist/ui/popover/popover-trigger.svelte.d.ts.map +1 -0
  808. package/dist/ui/scroll-area/index.d.ts +2 -0
  809. package/dist/ui/scroll-area/index.d.ts.map +1 -0
  810. package/dist/ui/scroll-area/index.js +1 -0
  811. package/dist/ui/scroll-area/scroll-area.svelte +14 -0
  812. package/dist/ui/scroll-area/scroll-area.svelte.d.ts +9 -0
  813. package/dist/ui/scroll-area/scroll-area.svelte.d.ts.map +1 -0
  814. package/dist/ui/separator/index.d.ts +2 -0
  815. package/dist/ui/separator/index.d.ts.map +1 -0
  816. package/dist/ui/separator/index.js +1 -0
  817. package/dist/ui/separator/separator.svelte +14 -0
  818. package/dist/ui/separator/separator.svelte.d.ts +8 -0
  819. package/dist/ui/separator/separator.svelte.d.ts.map +1 -0
  820. package/dist/ui/styles.css +760 -0
  821. package/dist/ui/styles.test.d.ts +2 -0
  822. package/dist/ui/styles.test.d.ts.map +1 -0
  823. package/dist/ui/styles.test.js +26 -0
  824. package/dist/ui/table/index.d.ts +10 -0
  825. package/dist/ui/table/index.d.ts.map +1 -0
  826. package/dist/ui/table/index.js +11 -0
  827. package/dist/ui/table/table-body.svelte +20 -0
  828. package/dist/ui/table/table-body.svelte.d.ts +6 -0
  829. package/dist/ui/table/table-body.svelte.d.ts.map +1 -0
  830. package/dist/ui/table/table-caption.svelte +20 -0
  831. package/dist/ui/table/table-caption.svelte.d.ts +6 -0
  832. package/dist/ui/table/table-caption.svelte.d.ts.map +1 -0
  833. package/dist/ui/table/table-cell.svelte +23 -0
  834. package/dist/ui/table/table-cell.svelte.d.ts +6 -0
  835. package/dist/ui/table/table-cell.svelte.d.ts.map +1 -0
  836. package/dist/ui/table/table-footer.svelte +23 -0
  837. package/dist/ui/table/table-footer.svelte.d.ts +6 -0
  838. package/dist/ui/table/table-footer.svelte.d.ts.map +1 -0
  839. package/dist/ui/table/table-head.svelte +23 -0
  840. package/dist/ui/table/table-head.svelte.d.ts +6 -0
  841. package/dist/ui/table/table-head.svelte.d.ts.map +1 -0
  842. package/dist/ui/table/table-header.svelte +20 -0
  843. package/dist/ui/table/table-header.svelte.d.ts +6 -0
  844. package/dist/ui/table/table-header.svelte.d.ts.map +1 -0
  845. package/dist/ui/table/table-row.svelte +23 -0
  846. package/dist/ui/table/table-row.svelte.d.ts +6 -0
  847. package/dist/ui/table/table-row.svelte.d.ts.map +1 -0
  848. package/dist/ui/table/table.svelte +21 -0
  849. package/dist/ui/table/table.svelte.d.ts +9 -0
  850. package/dist/ui/table/table.svelte.d.ts.map +1 -0
  851. package/dist/ui/table-dnd/index.d.ts +4 -0
  852. package/dist/ui/table-dnd/index.d.ts.map +1 -0
  853. package/dist/ui/table-dnd/index.js +3 -0
  854. package/dist/ui/table-dnd/table-dnd-sensors.d.ts +3 -0
  855. package/dist/ui/table-dnd/table-dnd-sensors.d.ts.map +1 -0
  856. package/dist/ui/table-dnd/table-dnd-sensors.js +11 -0
  857. package/dist/ui/table-dnd/table-dnd-utils.d.ts +30 -0
  858. package/dist/ui/table-dnd/table-dnd-utils.d.ts.map +1 -0
  859. package/dist/ui/table-dnd/table-dnd-utils.js +77 -0
  860. package/dist/ui/table-dnd/table-dnd-utils.test.d.ts +2 -0
  861. package/dist/ui/table-dnd/table-dnd-utils.test.d.ts.map +1 -0
  862. package/dist/ui/table-dnd/table-dnd-utils.test.js +46 -0
  863. package/dist/ui/table-dnd/table-drag-grip.svelte +60 -0
  864. package/dist/ui/table-dnd/table-drag-grip.svelte.d.ts +17 -0
  865. package/dist/ui/table-dnd/table-drag-grip.svelte.d.ts.map +1 -0
  866. package/dist/ui/toggle-group/context.d.ts +7 -0
  867. package/dist/ui/toggle-group/context.d.ts.map +1 -0
  868. package/dist/ui/toggle-group/context.js +8 -0
  869. package/dist/ui/toggle-group/index.d.ts +3 -0
  870. package/dist/ui/toggle-group/index.d.ts.map +1 -0
  871. package/dist/ui/toggle-group/index.js +2 -0
  872. package/dist/ui/toggle-group/toggle-group-item.svelte +33 -0
  873. package/dist/ui/toggle-group/toggle-group-item.svelte.d.ts +11 -0
  874. package/dist/ui/toggle-group/toggle-group-item.svelte.d.ts.map +1 -0
  875. package/dist/ui/toggle-group/toggle-group.svelte +74 -0
  876. package/dist/ui/toggle-group/toggle-group.svelte.d.ts +12 -0
  877. package/dist/ui/toggle-group/toggle-group.svelte.d.ts.map +1 -0
  878. package/dist/ui/toolbar/index.d.ts +7 -0
  879. package/dist/ui/toolbar/index.d.ts.map +1 -0
  880. package/dist/ui/toolbar/index.js +6 -0
  881. package/dist/ui/toolbar/toolbar-button.svelte +17 -0
  882. package/dist/ui/toolbar/toolbar-button.svelte.d.ts +5 -0
  883. package/dist/ui/toolbar/toolbar-button.svelte.d.ts.map +1 -0
  884. package/dist/ui/toolbar/toolbar-group-item.svelte +17 -0
  885. package/dist/ui/toolbar/toolbar-group-item.svelte.d.ts +4 -0
  886. package/dist/ui/toolbar/toolbar-group-item.svelte.d.ts.map +1 -0
  887. package/dist/ui/toolbar/toolbar-group.svelte +19 -0
  888. package/dist/ui/toolbar/toolbar-group.svelte.d.ts +5 -0
  889. package/dist/ui/toolbar/toolbar-group.svelte.d.ts.map +1 -0
  890. package/dist/ui/toolbar/toolbar-link.svelte +17 -0
  891. package/dist/ui/toolbar/toolbar-link.svelte.d.ts +5 -0
  892. package/dist/ui/toolbar/toolbar-link.svelte.d.ts.map +1 -0
  893. package/dist/ui/toolbar/toolbar.svelte +21 -0
  894. package/dist/ui/toolbar/toolbar.svelte.d.ts +5 -0
  895. package/dist/ui/toolbar/toolbar.svelte.d.ts.map +1 -0
  896. package/dist/ui/tooltip/index.d.ts +8 -0
  897. package/dist/ui/tooltip/index.d.ts.map +1 -0
  898. package/dist/ui/tooltip/index.js +9 -0
  899. package/dist/ui/tooltip/tooltip-content.svelte +85 -0
  900. package/dist/ui/tooltip/tooltip-content.svelte.d.ts +9 -0
  901. package/dist/ui/tooltip/tooltip-content.svelte.d.ts.map +1 -0
  902. package/dist/ui/tooltip/tooltip-root.svelte +15 -0
  903. package/dist/ui/tooltip/tooltip-root.svelte.d.ts +5 -0
  904. package/dist/ui/tooltip/tooltip-root.svelte.d.ts.map +1 -0
  905. package/dist/ui/tooltip/tooltip-trigger.svelte +23 -0
  906. package/dist/ui/tooltip/tooltip-trigger.svelte.d.ts +5 -0
  907. package/dist/ui/tooltip/tooltip-trigger.svelte.d.ts.map +1 -0
  908. package/dist/ui/utils.d.ts +13 -0
  909. package/dist/ui/utils.d.ts.map +1 -0
  910. package/dist/ui/utils.js +5 -0
  911. package/package.json +171 -0
@@ -0,0 +1,727 @@
1
+ import { ensureSyntaxTree, syntaxTree } from "@codemirror/language";
2
+ import { EditorState, StateField, } from "@codemirror/state";
3
+ import { Decoration, EditorView, ViewPlugin, WidgetType, } from "@codemirror/view";
4
+ import { resolveMiraExtensions, resolveMiraListCallouts, } from "@lapismd/mira/extensions";
5
+ import { resolveMiraDoodleDividerPair } from "../../doodle-dividers";
6
+ import { miraRichEditorTheme } from "./theme";
7
+ import { codeBlockLineDecorations } from "./utils/code-block-lines";
8
+ import { getFencedCodeLanguage } from "./utils/fenced-code";
9
+ import { getAtxHeadingMarkerRange, selectionTouchesLine, } from "./utils/headings";
10
+ import { getTaskMarkerRange, selectionTouchesTaskMarker } from "./utils/tasks";
11
+ import { findMarkdownImageRanges, isStandaloneMarkdownImageLine, resolveMarkdownImageWidgetSource, } from "./utils/images";
12
+ import { findInlineCodeRanges, isPositionInsideRanges, } from "./utils/inline-code";
13
+ import { findInlineMathRanges } from "./utils/inline-math";
14
+ import { indentGuideDecorations } from "./utils/indent";
15
+ import { measuredIndentExtension } from "./utils/measured-indent";
16
+ import { getMarkdownLinkTextRange, isBareExternalAutolinkUrl, isExternalMarkdownLink, } from "./utils/links";
17
+ import { createListCalloutMatcher, } from "./utils/list-callouts";
18
+ import { hasInitialFrontmatterCursor, hasRenderedInitialFrontmatterCursor, rangeContainsSelectionCursor, rangeIntersectsSelection, rangesOverlap, sortRanges, } from "./utils/ranges";
19
+ import { blockControlExtensions } from "./block-controls";
20
+ import { foldIndicatorDecorations } from "./decorations/fold-indicators";
21
+ import { headingGutterExtension } from "./decorations/heading-gutter";
22
+ import { BlockPreviewWidget, InlineMarkdownWidget, InlineMathWidget, } from "./widgets/preview-widgets";
23
+ import { ListCalloutWidget } from "./widgets/list-callout";
24
+ import { TaskCheckboxWidget } from "./widgets/task-checkbox";
25
+ export { getFoldAnchor } from "./decorations/fold-indicators";
26
+ export { PREVIEW_INTERACTIVE_SELECTOR, shouldActivateEditablePreview, } from "./utils/activation";
27
+ export { buildCodeBlockLineDecorations, codeBlockLineDecorations, isFencedCodeLine, } from "./utils/code-block-lines";
28
+ export { getFencedCodeLanguage, getFencedCodeWidgetRange, } from "./utils/fenced-code";
29
+ export { getAtxHeadingMarkerRange, selectionTouchesLine, } from "./utils/headings";
30
+ export { getTaskMarkerRange, selectionTouchesTaskMarker } from "./utils/tasks";
31
+ export { estimateMarkdownBlockHeight } from "./utils/height-estimates";
32
+ export { findInlineMathRanges, } from "./utils/inline-math";
33
+ export { getIndentLineLayout, getLineIndentInfo, normalizeIndentText, selectionTouchesIndent, splitIndentSegments, toMarkdownColumns, } from "./utils/indent";
34
+ export { measuredIndentExtension, syncMeasuredIndentStyles, } from "./utils/measured-indent";
35
+ export { getMarkdownLinkTextRange, isBareExternalAutolinkUrl, isExternalMarkdownDestination, isExternalMarkdownLink, } from "./utils/links";
36
+ export { collectMarkdownBlockHandles, collectMarkdownBlockRanges, deleteMarkdownBlockHandle, deleteMarkdownBlockRange, duplicateMarkdownBlockHandle, duplicateMarkdownBlockRange, markdownBlockAt, moveMarkdownBlockHandle, moveMarkdownBlockRange, replaceMarkdownRange, } from "./block-ranges";
37
+ const BLOCK_WIDGET_NODE_NAMES = new Set([
38
+ "Frontmatter",
39
+ "FencedCode",
40
+ "HorizontalRule",
41
+ "BlockMathDollar",
42
+ "BlockMathBracket",
43
+ "Blockquote",
44
+ "Table",
45
+ "GridTable",
46
+ "LeafDirective",
47
+ "ContainerDirective",
48
+ ]);
49
+ const hiddenFormattingMark = Decoration.mark({
50
+ class: "cm-formatting cm-formatting-hidden",
51
+ });
52
+ const strongMark = Decoration.mark({ class: "cm-strong" });
53
+ const emphasisMark = Decoration.mark({ class: "cm-emphasis" });
54
+ const strikethroughMark = Decoration.mark({ class: "cm-strikethrough" });
55
+ const inlineCodeMark = Decoration.mark({ class: "cm-inline-code" });
56
+ const internalLinkMark = Decoration.mark({ class: "cm-internal-link" });
57
+ const externalLinkMark = Decoration.mark({ class: "cm-external-link" });
58
+ const linkTextMark = Decoration.mark({
59
+ class: "cm-link-text cm-link-string",
60
+ });
61
+ const linkTargetMark = Decoration.mark({ class: "cm-link-target" });
62
+ const linkPathTargetMark = Decoration.mark({
63
+ class: "cm-path cm-link-target",
64
+ });
65
+ const INLINE_SOURCE_TOKEN_NAMES = new Set([
66
+ "Emphasis",
67
+ "StrongEmphasis",
68
+ "Strikethrough",
69
+ "StrikethroughEmphasis",
70
+ "InlineCode",
71
+ "CodeBlock",
72
+ "Link",
73
+ "PathLink",
74
+ "WikiLink",
75
+ "EmbedLink",
76
+ "Image",
77
+ ]);
78
+ const INLINE_FORMATTING_NODE_NAMES = new Set([
79
+ "HardBreak",
80
+ "LinkMark",
81
+ "PathLinkMark",
82
+ "PathLinkDestination",
83
+ "EmphasisMark",
84
+ "CodeMark",
85
+ "StrikethroughMark",
86
+ "URL",
87
+ ]);
88
+ export function createRichEditorExtensions(options = {}) {
89
+ if (options.enabled === false) {
90
+ return [];
91
+ }
92
+ const livePreview = options.livePreview ?? true;
93
+ const extensionListCallouts = resolveMiraExtensions(options.extensions, {
94
+ mode: livePreview ? "live-preview" : "source",
95
+ readonly: false,
96
+ sourcePath: options.sourcePath,
97
+ }).listCallouts;
98
+ const resolvedOptions = {
99
+ ...options,
100
+ listCallouts: [...extensionListCallouts, ...(options.listCallouts ?? [])],
101
+ };
102
+ return [
103
+ miraRichEditorTheme,
104
+ codeBlockLineDecorations(),
105
+ headingGutterExtension(),
106
+ headingLineDecorations(),
107
+ resolvedOptions.indentGuides !== false
108
+ ? [
109
+ EditorView.editorAttributes.of({
110
+ class: "cm-show-indentation-guides",
111
+ }),
112
+ indentGuideDecorations({ livePreview }),
113
+ measuredIndentExtension(),
114
+ ]
115
+ : [],
116
+ // Lapis only mounts richEditor() for live-preview. Source keeps delimiters
117
+ // (`>`, backticks, fences) with HyperMD line classes only.
118
+ livePreview ? blockPreviewDecorations(resolvedOptions) : [],
119
+ livePreview
120
+ ? inlinePreviewDecorations({ ...resolvedOptions, livePreview })
121
+ : [],
122
+ foldIndicatorDecorations(),
123
+ blockControlExtensions(resolvedOptions),
124
+ livePreview
125
+ ? EditorView.editorAttributes.compute(["doc", "selection"], (state) => ({
126
+ class: [
127
+ "mira-live-preview-mode markdown-live-preview-mode markdown-live-preview-view cm-live-preview",
128
+ hasRenderedInitialFrontmatterCursor(state)
129
+ ? "mira-live-preview-hide-cursor"
130
+ : "",
131
+ ]
132
+ .filter(Boolean)
133
+ .join(" "),
134
+ }))
135
+ : [],
136
+ ];
137
+ }
138
+ function blockPreviewDecorations(options) {
139
+ return StateField.define({
140
+ create(state) {
141
+ return buildBlockPreviewDecorations(state, options);
142
+ },
143
+ update(value, transaction) {
144
+ if (transaction.docChanged || transaction.selection) {
145
+ return buildBlockPreviewDecorations(transaction.state, options);
146
+ }
147
+ return value.map(transaction.changes);
148
+ },
149
+ provide: (field) => EditorView.decorations.from(field),
150
+ });
151
+ }
152
+ function inlinePreviewDecorations(options) {
153
+ return ViewPlugin.fromClass(class {
154
+ view;
155
+ decorations;
156
+ constructor(view) {
157
+ this.view = view;
158
+ this.decorations = buildInlinePreviewDecorations(view, options);
159
+ }
160
+ update(update) {
161
+ if (update.docChanged ||
162
+ update.selectionSet ||
163
+ update.viewportChanged) {
164
+ this.decorations = buildInlinePreviewDecorations(update.view, options);
165
+ }
166
+ }
167
+ }, {
168
+ decorations: (value) => value.decorations,
169
+ });
170
+ }
171
+ function buildBlockPreviewDecorations(state, options) {
172
+ const ranges = [];
173
+ const replacedRanges = [];
174
+ const tree = ensureSyntaxTree(state, state.doc.length, 100) ?? syntaxTree(state);
175
+ tree.iterate({
176
+ from: 0,
177
+ to: state.doc.length,
178
+ enter: (node) => {
179
+ if (!BLOCK_WIDGET_NODE_NAMES.has(node.name)) {
180
+ return;
181
+ }
182
+ let from = state.doc.lineAt(node.from).from;
183
+ let to = state.doc.lineAt(node.to).to;
184
+ if (node.name === "HorizontalRule") {
185
+ const pair = resolveMiraDoodleDividerPair(state, node.from, node.to);
186
+ if (pair) {
187
+ from = pair.from;
188
+ to = pair.to;
189
+ }
190
+ }
191
+ const selectionInside = node.name === "Frontmatter"
192
+ ? rangeContainsSelectionCursor(state, from, to) &&
193
+ !hasInitialFrontmatterCursor(state, from)
194
+ : rangeContainsSelectionCursor(state, from, to);
195
+ if (selectionInside &&
196
+ (node.name === "BlockMathDollar" || node.name === "BlockMathBracket") &&
197
+ !replacedRanges.some((range) => rangesOverlap(range, { from, to }))) {
198
+ const markdown = state.doc.sliceString(from, to);
199
+ ranges.push(Decoration.widget({
200
+ block: true,
201
+ side: 1,
202
+ widget: new BlockPreviewWidget({
203
+ from,
204
+ to,
205
+ markdown,
206
+ nodeName: node.name,
207
+ options,
208
+ }),
209
+ }).range(to));
210
+ return false;
211
+ }
212
+ if (selectionInside ||
213
+ replacedRanges.some((range) => rangesOverlap(range, { from, to }))) {
214
+ return;
215
+ }
216
+ const previewSource = getBlockPreviewSource(state, node.name, node.from, node.to, from, to);
217
+ ranges.push(Decoration.replace({
218
+ block: true,
219
+ widget: new BlockPreviewWidget({
220
+ from,
221
+ to,
222
+ markdown: previewSource.markdown,
223
+ markdownFrom: previewSource.from,
224
+ markdownIndentLength: previewSource.indentLength,
225
+ markdownIndentedLineStarts: previewSource.indentedLineStarts,
226
+ nodeName: node.name,
227
+ options,
228
+ }),
229
+ }).range(from, to));
230
+ replacedRanges.push({ from, to });
231
+ return false;
232
+ },
233
+ });
234
+ for (let lineNumber = 1; lineNumber <= state.doc.lines; lineNumber += 1) {
235
+ const line = state.doc.line(lineNumber);
236
+ const standaloneEmbed = isStandaloneEmbedLine(line.text);
237
+ const standaloneImage = isStandaloneMarkdownImageLine(line.text);
238
+ if (!standaloneEmbed && !standaloneImage) {
239
+ continue;
240
+ }
241
+ const from = line.from;
242
+ const to = line.to;
243
+ if (rangeContainsSelectionCursor(state, from, to) ||
244
+ replacedRanges.some((range) => rangesOverlap(range, { from, to }))) {
245
+ continue;
246
+ }
247
+ const markdown = standaloneEmbed
248
+ ? line.text.trim()
249
+ : resolveMarkdownImageWidgetSource(line.text, state.doc.toString());
250
+ if (!markdown) {
251
+ continue;
252
+ }
253
+ ranges.push(Decoration.replace({
254
+ block: true,
255
+ widget: new BlockPreviewWidget({
256
+ from,
257
+ to,
258
+ markdown,
259
+ nodeName: standaloneEmbed ? "EmbedLink" : "Image",
260
+ options,
261
+ }),
262
+ }).range(from, to));
263
+ replacedRanges.push({ from, to });
264
+ }
265
+ return Decoration.set(sortRanges(ranges), true);
266
+ }
267
+ function getBlockPreviewSource(state, nodeName, nodeFrom, nodeTo, replacementFrom, replacementTo) {
268
+ if (nodeName === "Blockquote" &&
269
+ /^[\t ]+$/u.test(state.doc.sliceString(replacementFrom, nodeFrom))) {
270
+ const indent = state.doc.sliceString(replacementFrom, nodeFrom);
271
+ const lines = state.doc.sliceString(nodeFrom, nodeTo).split("\n");
272
+ const indentedLineStarts = [];
273
+ let markdown = "";
274
+ for (const [index, sourceLine] of lines.entries()) {
275
+ if (index > 0) {
276
+ markdown += "\n";
277
+ }
278
+ const removesParentIndent = index > 0 && sourceLine.startsWith(indent);
279
+ if (removesParentIndent) {
280
+ indentedLineStarts.push(markdown.length);
281
+ }
282
+ markdown += removesParentIndent
283
+ ? sourceLine.slice(indent.length)
284
+ : sourceLine;
285
+ }
286
+ return {
287
+ from: nodeFrom,
288
+ to: nodeTo,
289
+ indentLength: indent.length,
290
+ indentedLineStarts,
291
+ markdown,
292
+ };
293
+ }
294
+ return {
295
+ from: replacementFrom,
296
+ to: replacementTo,
297
+ markdown: state.doc.sliceString(replacementFrom, replacementTo),
298
+ };
299
+ }
300
+ function buildInlinePreviewDecorations(view, options) {
301
+ const ranges = [];
302
+ const replaceWidgets = options.livePreview ?? true;
303
+ const fencedCodeLineClasses = getFencedCodeLineClasses(view.state);
304
+ const listCallouts = resolveMiraListCallouts(options.listCallouts);
305
+ const listCalloutMatcher = createListCalloutMatcher(options.listCallouts);
306
+ const syntaxHiddenRanges = [];
307
+ const activeInlineSourceRanges = [];
308
+ if (replaceWidgets) {
309
+ collectActiveTaskMarkerRanges(view, activeInlineSourceRanges);
310
+ }
311
+ decorateInlineSyntax(view, ranges, syntaxHiddenRanges, activeInlineSourceRanges);
312
+ for (const visibleRange of view.visibleRanges) {
313
+ let line = view.state.doc.lineAt(visibleRange.from);
314
+ while (line.from <= visibleRange.to) {
315
+ const fencedCodeLineClass = fencedCodeLineClasses.get(line.number);
316
+ if (fencedCodeLineClass) {
317
+ ranges.push(Decoration.line({ class: fencedCodeLineClass }).range(line.from));
318
+ }
319
+ // Heading line classes come from always-on headingLineDecorations().
320
+ decorateFootnotes(line.text, line.from, ranges);
321
+ if (replaceWidgets) {
322
+ decorateListCallouts(line.text, line.from, ranges, view.state, listCalloutMatcher, listCallouts);
323
+ decorateTaskCheckboxes(line.text, line.from, ranges, options, view.state, activeInlineSourceRanges);
324
+ }
325
+ decorateStrikethroughRanges(line.text, line.from, ranges, syntaxHiddenRanges, activeInlineSourceRanges, view.state);
326
+ const inlineMathRanges = replaceWidgets && !fencedCodeLineClass
327
+ ? decorateInlineMath(line.text, line.from, ranges, options, view.state)
328
+ : [];
329
+ const inlineMarkdownWidgetRanges = replaceWidgets && !fencedCodeLineClass
330
+ ? decorateInlineMarkdownWidgets(line.text, line.from, ranges, options, view.state)
331
+ : [];
332
+ // Lapis: hide formatting marks only in live preview; source keeps delimiters.
333
+ if (replaceWidgets && !fencedCodeLineClass) {
334
+ decorateHiddenFormatting(line.text, line.from, ranges, {
335
+ excludedRanges: [
336
+ ...inlineMathRanges,
337
+ ...inlineMarkdownWidgetRanges,
338
+ ...syntaxHiddenRanges,
339
+ ...activeInlineSourceRanges,
340
+ ],
341
+ state: view.state,
342
+ });
343
+ }
344
+ if (line.to >= visibleRange.to || line.number >= view.state.doc.lines) {
345
+ break;
346
+ }
347
+ line = view.state.doc.line(line.number + 1);
348
+ }
349
+ }
350
+ return Decoration.set(sortRanges(ranges), true);
351
+ }
352
+ class ListCalloutBackgroundWidget extends WidgetType {
353
+ toDOM() {
354
+ const span = document.createElement("span");
355
+ span.className = "lc-list-bg";
356
+ span.setAttribute("aria-hidden", "true");
357
+ return span;
358
+ }
359
+ eq() {
360
+ return true;
361
+ }
362
+ }
363
+ function decorateListCallouts(text, lineStart, ranges, state, matchListCallout, listCallouts) {
364
+ const markerRange = matchListCallout(text, lineStart);
365
+ if (!markerRange) {
366
+ return;
367
+ }
368
+ ranges.push(Decoration.line({
369
+ class: "lc-list-callout",
370
+ attributes: {
371
+ "data-callout": markerRange.marker,
372
+ style: `--lc-callout-color: ${markerRange.color}`,
373
+ },
374
+ }).range(lineStart));
375
+ ranges.push(Decoration.widget({
376
+ side: -1,
377
+ widget: new ListCalloutBackgroundWidget(),
378
+ }).range(lineStart));
379
+ if (rangeIntersectsSelection(state, markerRange.markerStart, markerRange.markerEnd)) {
380
+ return;
381
+ }
382
+ ranges.push(Decoration.replace({
383
+ widget: new ListCalloutWidget({
384
+ from: markerRange.markerStart,
385
+ to: markerRange.markerEnd,
386
+ removeTo: markerRange.removeEnd,
387
+ callout: markerRange.callout,
388
+ callouts: listCallouts,
389
+ }),
390
+ }).range(markerRange.markerStart, markerRange.markerEnd));
391
+ }
392
+ function decorateInlineSyntax(view, ranges, hiddenRanges, activeSourceRanges) {
393
+ const tree = ensureSyntaxTree(view.state, view.state.doc.length, 100) ??
394
+ syntaxTree(view.state);
395
+ for (const visibleRange of view.visibleRanges) {
396
+ tree.iterate({
397
+ from: visibleRange.from,
398
+ to: visibleRange.to,
399
+ enter(node) {
400
+ const parent = node.node.parent;
401
+ const parentName = parent?.name;
402
+ const parentFrom = parent?.from ?? node.from;
403
+ const parentTo = parent?.to ?? node.to;
404
+ const nodeSource = view.state.sliceDoc(node.from, node.to);
405
+ if (INLINE_SOURCE_TOKEN_NAMES.has(node.name)) {
406
+ decorateInlineTokenElement(view, node.name, node.from, node.to, ranges);
407
+ if (rangeIntersectsSelection(view.state, node.from, node.to)) {
408
+ activeSourceRanges.push({ from: node.from, to: node.to });
409
+ }
410
+ }
411
+ decorateInlineTokenPart(view, node.name, node.from, node.to, nodeSource, parentName, ranges);
412
+ if (INLINE_FORMATTING_NODE_NAMES.has(node.name) &&
413
+ !isBareExternalAutolinkUrl(node.name, parentName, nodeSource) &&
414
+ !rangeIntersectsSelection(view.state, parentFrom, parentTo) &&
415
+ !activeSourceRanges.some((range) => rangesOverlap(range, { from: node.from, to: node.to }))) {
416
+ hiddenRanges.push({ from: node.from, to: node.to });
417
+ ranges.push(hiddenFormattingMark.range(node.from, node.to));
418
+ }
419
+ },
420
+ });
421
+ }
422
+ }
423
+ function collectActiveTaskMarkerRanges(view, activeSourceRanges) {
424
+ for (const visibleRange of view.visibleRanges) {
425
+ let line = view.state.doc.lineAt(visibleRange.from);
426
+ while (line.from <= visibleRange.to) {
427
+ const taskRange = getTaskMarkerRange(line.text, line.from);
428
+ if (taskRange &&
429
+ selectionTouchesTaskMarker(view.state, line.from, taskRange.markerEnd)) {
430
+ activeSourceRanges.push({
431
+ from: taskRange.markerStart,
432
+ to: taskRange.markerEnd,
433
+ });
434
+ }
435
+ if (line.to >= visibleRange.to || line.number >= view.state.doc.lines) {
436
+ break;
437
+ }
438
+ line = view.state.doc.line(line.number + 1);
439
+ }
440
+ }
441
+ }
442
+ function decorateInlineMarkdownWidgets(text, lineStart, ranges, options, state) {
443
+ const widgetRanges = [];
444
+ const codeRanges = findInlineCodeRanges(text);
445
+ if (isStandaloneEmbedLine(text) || isStandaloneMarkdownImageLine(text)) {
446
+ widgetRanges.push({ from: lineStart, to: lineStart + text.length });
447
+ return widgetRanges;
448
+ }
449
+ for (const match of text.matchAll(/!?\[\[[^\]\r\n]+\]\]/gu)) {
450
+ const localFrom = match.index ?? 0;
451
+ const localTo = localFrom + match[0].length;
452
+ if (isPositionInsideRanges(localFrom, codeRanges) ||
453
+ isPositionInsideRanges(localTo - 1, codeRanges)) {
454
+ continue;
455
+ }
456
+ const from = lineStart + localFrom;
457
+ const to = lineStart + localTo;
458
+ if (rangeContainsSelectionCursor(state, from, to)) {
459
+ continue;
460
+ }
461
+ widgetRanges.push({ from, to });
462
+ ranges.push(Decoration.replace({
463
+ widget: new InlineMarkdownWidget({
464
+ from,
465
+ to,
466
+ markdown: match[0],
467
+ options,
468
+ }),
469
+ }).range(from, to));
470
+ }
471
+ for (const image of findMarkdownImageRanges(text, state.doc.toString())) {
472
+ const from = lineStart + image.from;
473
+ const to = lineStart + image.to;
474
+ if (rangeContainsSelectionCursor(state, from, to) ||
475
+ widgetRanges.some((range) => rangesOverlap(range, { from, to }))) {
476
+ continue;
477
+ }
478
+ widgetRanges.push({ from, to });
479
+ ranges.push(Decoration.replace({
480
+ widget: new InlineMarkdownWidget({
481
+ from,
482
+ to,
483
+ markdown: image.source,
484
+ options,
485
+ }),
486
+ }).range(from, to));
487
+ }
488
+ return widgetRanges;
489
+ }
490
+ function isStandaloneEmbedLine(text) {
491
+ return /^\s*!\[\[[^\]\r\n]+\]\]\s*$/u.test(text);
492
+ }
493
+ function decorateInlineTokenElement(view, name, from, to, ranges) {
494
+ if (name === "StrongEmphasis") {
495
+ ranges.push(strongMark.range(from, to));
496
+ return;
497
+ }
498
+ if (name === "Emphasis") {
499
+ ranges.push(emphasisMark.range(from, to));
500
+ return;
501
+ }
502
+ if (name === "Strikethrough" || name === "StrikethroughEmphasis") {
503
+ ranges.push(strikethroughMark.range(from, to));
504
+ return;
505
+ }
506
+ if (name === "InlineCode" || name === "CodeBlock") {
507
+ ranges.push(inlineCodeMark.range(from, to));
508
+ return;
509
+ }
510
+ if (name === "Link" || name === "PathLink") {
511
+ const source = view.state.sliceDoc(from, to);
512
+ ranges.push((isExternalMarkdownLink(source)
513
+ ? externalLinkMark
514
+ : internalLinkMark).range(from, to));
515
+ const textRange = getMarkdownLinkTextRange(source, from, to);
516
+ if (textRange) {
517
+ ranges.push(linkTextMark.range(textRange.from, textRange.to));
518
+ }
519
+ return;
520
+ }
521
+ if (name === "WikiLink" || name === "EmbedLink" || name === "Image") {
522
+ ranges.push(internalLinkMark.range(from, to));
523
+ }
524
+ }
525
+ function decorateInlineTokenPart(view, name, from, to, source, parentName, ranges) {
526
+ if (name === "URL") {
527
+ ranges.push((parentName === "Link" ? linkTargetMark : externalLinkMark).range(from, to));
528
+ if (parentName !== "Link" && isExternalMarkdownLink(source)) {
529
+ const textRange = getMarkdownLinkTextRange(source, from, to);
530
+ if (textRange) {
531
+ ranges.push(linkTextMark.range(textRange.from, textRange.to));
532
+ }
533
+ }
534
+ return;
535
+ }
536
+ if (name === "PathLinkDestination") {
537
+ ranges.push(linkPathTargetMark.range(from, to));
538
+ return;
539
+ }
540
+ if (name === "WikiLinkPath" ||
541
+ name === "WikiLinkAnchor" ||
542
+ name === "EmbedLinkPath" ||
543
+ name === "EmbedLinkAnchor") {
544
+ ranges.push(linkTargetMark.range(from, to));
545
+ return;
546
+ }
547
+ if (name === "WikiLinkText" || name === "EmbedLinkText") {
548
+ ranges.push(linkTextMark.range(from, to));
549
+ }
550
+ }
551
+ function decorateStrikethroughRanges(text, lineStart, ranges, hiddenRanges, activeSourceRanges, state) {
552
+ for (const match of text.matchAll(/~~(?=\S)(.+?)(?<=\S)~~/gu)) {
553
+ const from = lineStart + (match.index ?? 0);
554
+ const to = from + match[0].length;
555
+ const opening = { from, to: from + 2 };
556
+ const closing = { from: to - 2, to };
557
+ ranges.push(strikethroughMark.range(from, to));
558
+ if (rangeIntersectsSelection(state, from, to)) {
559
+ activeSourceRanges.push({ from, to });
560
+ continue;
561
+ }
562
+ hiddenRanges.push(opening, closing);
563
+ ranges.push(hiddenFormattingMark.range(opening.from, opening.to));
564
+ ranges.push(hiddenFormattingMark.range(closing.from, closing.to));
565
+ }
566
+ }
567
+ function getFencedCodeLineClasses(state) {
568
+ const classes = new Map();
569
+ const tree = ensureSyntaxTree(state, state.doc.length, 100) ?? syntaxTree(state);
570
+ tree.iterate({
571
+ from: 0,
572
+ to: state.doc.length,
573
+ enter(node) {
574
+ if (node.name !== "FencedCode") {
575
+ return;
576
+ }
577
+ const start = state.doc.lineAt(node.from);
578
+ const end = state.doc.lineAt(node.to);
579
+ const markdown = state.doc.sliceString(start.from, end.to);
580
+ const language = getFencedCodeLanguage(markdown);
581
+ const isTextCode = language === "text";
582
+ for (let lineNumber = start.number; lineNumber <= end.number; lineNumber += 1) {
583
+ const classNames = ["cm-formatting-code"];
584
+ if (isTextCode) {
585
+ classNames.push("cm-formatting-code-language-text");
586
+ }
587
+ if (lineNumber === start.number) {
588
+ classNames.push("cm-formatting-code-start");
589
+ }
590
+ if (lineNumber === end.number) {
591
+ classNames.push("cm-formatting-code-end");
592
+ }
593
+ classes.set(lineNumber, classNames.join(" "));
594
+ }
595
+ },
596
+ });
597
+ return classes;
598
+ }
599
+ function decorateTaskCheckboxes(text, lineStart, ranges, options, state, activeSourceRanges) {
600
+ const taskRange = getTaskMarkerRange(text, lineStart);
601
+ if (taskRange) {
602
+ ranges.push(Decoration.line({
603
+ class: "cm-task-line HyperMD-task-line",
604
+ attributes: {
605
+ "data-task": taskRange.taskValue,
606
+ },
607
+ }).range(lineStart));
608
+ if (selectionTouchesTaskMarker(state, lineStart, taskRange.markerEnd)) {
609
+ activeSourceRanges.push({
610
+ from: taskRange.markerStart,
611
+ to: taskRange.markerEnd,
612
+ });
613
+ return;
614
+ }
615
+ ranges.push(Decoration.replace({
616
+ widget: new TaskCheckboxWidget({
617
+ from: taskRange.checkboxStart,
618
+ value: taskRange.taskValue,
619
+ checked: taskRange.taskValue.trim().length > 0,
620
+ }),
621
+ }).range(taskRange.markerStart, taskRange.checkboxEnd));
622
+ }
623
+ }
624
+ function decorateFootnotes(text, lineStart, ranges) {
625
+ const definition = text.match(/^\[\^([^\]\r\n]+)\]:/u);
626
+ if (definition) {
627
+ ranges.push(Decoration.line({
628
+ class: "cm-footnote cm-footnote-definition",
629
+ }).range(lineStart));
630
+ }
631
+ for (const match of text.matchAll(/\[\^([^\]\r\n]+)\]/gu)) {
632
+ const from = lineStart + (match.index ?? 0);
633
+ ranges.push(Decoration.mark({
634
+ class: "cm-footnote cm-footnote-ref",
635
+ }).range(from, from + match[0].length));
636
+ }
637
+ }
638
+ function decorateInlineMath(text, lineStart, ranges, options, state) {
639
+ const mathRanges = findInlineMathRanges(text);
640
+ const absoluteRanges = [];
641
+ for (const range of mathRanges) {
642
+ const from = lineStart + range.from;
643
+ const to = lineStart + range.to;
644
+ absoluteRanges.push({ from, to });
645
+ const widget = new InlineMathWidget({
646
+ from,
647
+ to,
648
+ source: range.source,
649
+ options,
650
+ });
651
+ if (rangeIntersectsSelection(state, from, to)) {
652
+ ranges.push(Decoration.widget({
653
+ side: 1,
654
+ widget,
655
+ }).range(to));
656
+ }
657
+ else {
658
+ ranges.push(Decoration.replace({
659
+ widget,
660
+ }).range(from, to));
661
+ }
662
+ }
663
+ return absoluteRanges;
664
+ }
665
+ const headingLineDecorationMarks = Array.from({ length: 6 }, (_, index) => Decoration.line({
666
+ class: [
667
+ "cm-header",
668
+ "HyperMD-header",
669
+ `cm-header-${index + 1}`,
670
+ `HyperMD-header-${index + 1}`,
671
+ ].join(" "),
672
+ }));
673
+ function buildHeadingLineDecorations(state) {
674
+ const ranges = [];
675
+ for (let number = 1; number <= state.doc.lines; number += 1) {
676
+ const line = state.doc.line(number);
677
+ const match = line.text.match(/^(#{1,6})(?=\s)/);
678
+ if (match?.[1]) {
679
+ ranges.push(headingLineDecorationMarks[match[1].length - 1].range(line.from));
680
+ }
681
+ }
682
+ return Decoration.set(sortRanges(ranges));
683
+ }
684
+ function headingLineDecorations() {
685
+ return StateField.define({
686
+ create: buildHeadingLineDecorations,
687
+ update(value, transaction) {
688
+ return transaction.docChanged
689
+ ? buildHeadingLineDecorations(transaction.state)
690
+ : value.map(transaction.changes);
691
+ },
692
+ provide: (field) => EditorView.decorations.from(field),
693
+ });
694
+ }
695
+ function decorateHiddenFormatting(text, lineStart, ranges, options = {}) {
696
+ addRegexMarks(text, lineStart, ranges, /(\*\*|__|\*|_|~~|`)/g, options);
697
+ addRegexMarks(text, lineStart, ranges, /(!?\[|\]\(|\[\[|\]\])/g, options);
698
+ decorateHeadingFormatting(text, lineStart, ranges, options);
699
+ // Blockquote `>` is owned by indent quote chrome + .cm-formatting-quote CSS
700
+ // (transparent / faint on active line). Collapsing it with formatting-hidden
701
+ // removes marker width and the hanging quote padding as soon as focus leaves
702
+ // the `>` characters.
703
+ }
704
+ function decorateHeadingFormatting(text, lineStart, ranges, options) {
705
+ const markerRange = getAtxHeadingMarkerRange(text, lineStart);
706
+ if (!markerRange ||
707
+ options.excludedRanges?.some((range) => rangesOverlap(range, markerRange)) ||
708
+ (options.state &&
709
+ selectionTouchesLine(options.state, lineStart, lineStart + text.length))) {
710
+ return;
711
+ }
712
+ ranges.push(hiddenFormattingMark.range(markerRange.from, markerRange.to));
713
+ }
714
+ function addRegexMarks(text, lineStart, ranges, regexp, options = {}) {
715
+ for (const match of text.matchAll(regexp)) {
716
+ const token = match[1] ?? match[0];
717
+ const start = lineStart + (match.index ?? 0);
718
+ const tokenStart = match[0].indexOf(token);
719
+ const from = start + Math.max(0, tokenStart);
720
+ const to = from + token.length;
721
+ if (options.excludedRanges?.some((range) => rangesOverlap(range, { from, to })) ||
722
+ (options.state && rangeIntersectsSelection(options.state, from, to))) {
723
+ continue;
724
+ }
725
+ ranges.push(hiddenFormattingMark.range(from, to));
726
+ }
727
+ }