@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,435 @@
1
+ import { ensureSyntaxTree, syntaxTree } from "@codemirror/language";
2
+ import {} from "@codemirror/state";
3
+ import { Decoration, EditorView, ViewPlugin, WidgetType, } from "@codemirror/view";
4
+ import { isFencedCodeLine } from "./code-block-lines";
5
+ import { sortRanges } from "./ranges";
6
+ const INDENT_UNIT = 4;
7
+ export function toMarkdownColumns(text) {
8
+ let columns = 0;
9
+ for (const char of text) {
10
+ if (char === "\t") {
11
+ columns += INDENT_UNIT - (columns % INDENT_UNIT || 0);
12
+ continue;
13
+ }
14
+ columns += 1;
15
+ }
16
+ return columns;
17
+ }
18
+ export function normalizeIndentText(text) {
19
+ let columns = 0;
20
+ let normalized = "";
21
+ for (const char of text) {
22
+ if (char === "\t") {
23
+ const tabWidth = INDENT_UNIT - (columns % INDENT_UNIT || 0);
24
+ normalized += " ".repeat(tabWidth);
25
+ columns += tabWidth;
26
+ continue;
27
+ }
28
+ normalized += char;
29
+ columns += 1;
30
+ }
31
+ return normalized;
32
+ }
33
+ export function splitIndentSegments(indentText) {
34
+ const normalized = normalizeIndentText(indentText);
35
+ const segments = [];
36
+ for (let index = 0; index < normalized.length; index += INDENT_UNIT) {
37
+ const text = normalized.slice(index, index + INDENT_UNIT);
38
+ segments.push({ text, guide: text.length === INDENT_UNIT });
39
+ }
40
+ return segments;
41
+ }
42
+ export function getLineIndentInfo(lineText) {
43
+ const listMatch = lineText.match(/^(\s*)([-*+]|\d+[.)])\s+/);
44
+ if (listMatch) {
45
+ const indentText = listMatch[1] ?? "";
46
+ const columns = toMarkdownColumns(indentText);
47
+ return {
48
+ columns,
49
+ depth: Math.max(1, Math.floor(columns / INDENT_UNIT) + 1),
50
+ kind: /^\d/u.test(listMatch[2] ?? "") ? "ol" : "ul",
51
+ text: indentText,
52
+ };
53
+ }
54
+ const plainMatch = lineText.match(/^(\s+)(?=\S)/);
55
+ if (!plainMatch) {
56
+ return null;
57
+ }
58
+ const indentText = plainMatch[1] ?? "";
59
+ const columns = toMarkdownColumns(indentText);
60
+ if (columns < 1) {
61
+ return null;
62
+ }
63
+ return {
64
+ columns,
65
+ depth: Math.max(1, Math.ceil(columns / INDENT_UNIT)),
66
+ kind: "plain",
67
+ text: indentText,
68
+ };
69
+ }
70
+ export function selectionTouchesIndent(selectionFrom, selectionTo, indentFrom, indentTo) {
71
+ if (selectionFrom === selectionTo) {
72
+ return selectionFrom >= indentFrom && selectionFrom <= indentTo;
73
+ }
74
+ return selectionFrom < indentTo && selectionTo > indentFrom;
75
+ }
76
+ export function shouldRenderStyledUnorderedMarker(livePreview, cursorFrom, markerFrom) {
77
+ return (livePreview && cursorFrom !== markerFrom && cursorFrom !== markerFrom + 1);
78
+ }
79
+ export function getIndentLineLayout(lineText) {
80
+ const leading = lineText.match(/^\s*/u)?.[0] ?? "";
81
+ const quote = lineText.slice(leading.length).match(/^(?:>\s*)+/u)?.[0] ?? "";
82
+ const structuredOffset = leading.length + quote.length;
83
+ const list = lineText.slice(structuredOffset).match(/^([-*+]|\d+[.)])(\s+)/u);
84
+ if (list) {
85
+ const marker = `${list[1] ?? ""}${list[2] ?? ""}`;
86
+ const markerFrom = structuredOffset;
87
+ const markerTo = markerFrom + marker.length;
88
+ const task = lineText.slice(markerTo).match(/^(\[[^\]]\]\s+)/u)?.[0] ?? "";
89
+ const prefixTo = markerTo + task.length;
90
+ const indentColumns = toMarkdownColumns(leading);
91
+ const listKind = /^\d/u.test(list[1] ?? "") ? "ol" : "ul";
92
+ return {
93
+ contentFrom: prefixTo,
94
+ depth: Math.max(1, Math.floor(indentColumns / INDENT_UNIT) + 1),
95
+ fallbackColumns: toMarkdownColumns(lineText.slice(0, prefixTo)),
96
+ guideCount: Math.max(0, Math.floor(indentColumns / INDENT_UNIT)),
97
+ indentColumns,
98
+ indentText: leading,
99
+ kind: quote ? "quote-list" : listKind,
100
+ listKind,
101
+ markerFrom,
102
+ markerTo,
103
+ ...(quote
104
+ ? {
105
+ quoteFrom: leading.length,
106
+ quoteTo: structuredOffset,
107
+ }
108
+ : {}),
109
+ };
110
+ }
111
+ if (quote) {
112
+ const prefixTo = structuredOffset;
113
+ return {
114
+ contentFrom: prefixTo,
115
+ depth: 1,
116
+ fallbackColumns: toMarkdownColumns(lineText.slice(0, prefixTo)),
117
+ guideCount: Math.max(0, Math.floor(toMarkdownColumns(leading) / INDENT_UNIT)),
118
+ indentColumns: toMarkdownColumns(leading),
119
+ // Lapis list/plain-indent only replace leading whitespace; `>` stays
120
+ // visible until live-preview rich decorations style/hide it.
121
+ indentText: leading,
122
+ kind: "quote",
123
+ quoteFrom: leading.length,
124
+ quoteTo: prefixTo,
125
+ };
126
+ }
127
+ const plain = getLineIndentInfo(lineText);
128
+ if (!plain || plain.kind !== "plain") {
129
+ return null;
130
+ }
131
+ return {
132
+ contentFrom: plain.text.length,
133
+ depth: plain.depth,
134
+ fallbackColumns: plain.columns,
135
+ guideCount: Math.max(0, Math.floor(plain.columns / INDENT_UNIT)),
136
+ indentColumns: plain.columns,
137
+ indentText: plain.text,
138
+ kind: "plain",
139
+ };
140
+ }
141
+ function fallbackLength(columns, adjustment) {
142
+ if (columns <= 0 && !adjustment) {
143
+ return "";
144
+ }
145
+ return adjustment
146
+ ? `calc(${Math.max(columns, 0)}ch + ${adjustment})`
147
+ : `${columns}ch`;
148
+ }
149
+ function unorderedMarkerAdjustment(markerColumns) {
150
+ return `var(--hmd-unordered-list-marker-slot-width, ${Math.max(markerColumns, 0)}ch) - ${Math.max(markerColumns, 0)}ch`;
151
+ }
152
+ function widgetFallbackLength(layout, adjustment) {
153
+ const segmentCount = splitIndentSegments(layout.indentText).length;
154
+ if (segmentCount === 0) {
155
+ return fallbackLength(layout.fallbackColumns, adjustment);
156
+ }
157
+ const parts = Array.from({ length: segmentCount }, () => "var(--list-indent)");
158
+ const suffixColumns = Math.max(layout.fallbackColumns - layout.indentColumns, 0);
159
+ if (suffixColumns > 0) {
160
+ parts.push(`${suffixColumns}ch`);
161
+ }
162
+ if (adjustment) {
163
+ parts.push(adjustment);
164
+ }
165
+ return parts.length === 1 ? parts[0] : `calc(${parts.join(" + ")})`;
166
+ }
167
+ function buildIndentStyle(layout, anchor, usesUnorderedMarkerSlot) {
168
+ const markerColumns = layout.markerFrom === undefined || layout.markerTo === undefined
169
+ ? 0
170
+ : layout.markerTo - layout.markerFrom;
171
+ const listMarkerAdjustment = layout.listKind === "ul" && usesUnorderedMarkerSlot
172
+ ? unorderedMarkerAdjustment(markerColumns)
173
+ : undefined;
174
+ const paddingFallback = fallbackLength(anchor?.fallbackPaddingColumns ?? layout.fallbackColumns, anchor?.fallbackPaddingAdjustment ?? listMarkerAdjustment);
175
+ const prefixFallback = fallbackLength(layout.fallbackColumns, listMarkerAdjustment);
176
+ const widgetPrefixFallback = widgetFallbackLength(layout, listMarkerAdjustment);
177
+ return [
178
+ layout.guideCount > 0 ? `--indent-guide-count: ${layout.guideCount};` : "",
179
+ anchor?.guideOffset || layout.listKind === "ul"
180
+ ? `--hmd-indent-guide-offset: ${anchor?.guideOffset ?? "var(--hmd-unordered-list-marker-guide-offset, 0px)"};`
181
+ : "",
182
+ paddingFallback ? `--hmd-indent-padding-fallback: ${paddingFallback};` : "",
183
+ prefixFallback ? `--hmd-indent-prefix-fallback: ${prefixFallback};` : "",
184
+ widgetPrefixFallback
185
+ ? `--hmd-indent-widget-prefix-fallback: ${widgetPrefixFallback};`
186
+ : "",
187
+ ]
188
+ .filter(Boolean)
189
+ .join(" ");
190
+ }
191
+ class IndentGuideWidget extends WidgetType {
192
+ segments;
193
+ plain;
194
+ constructor(segments, plain) {
195
+ super();
196
+ this.segments = segments;
197
+ this.plain = plain;
198
+ }
199
+ eq(other) {
200
+ return (this.plain === other.plain &&
201
+ JSON.stringify(this.segments) === JSON.stringify(other.segments));
202
+ }
203
+ toDOM() {
204
+ const guideCount = this.segments.filter((segment) => segment.guide).length;
205
+ const root = document.createElement("span");
206
+ root.className = [
207
+ "cm-hmd-list-indent",
208
+ `cm-hmd-list-indent-${guideCount}`,
209
+ this.plain ? "cm-plain-indent-widget" : "",
210
+ ]
211
+ .filter(Boolean)
212
+ .join(" ");
213
+ root.setAttribute("aria-hidden", "true");
214
+ for (const segment of this.segments) {
215
+ const indent = document.createElement("span");
216
+ indent.className = [
217
+ "cm-indent",
218
+ segment.guide ? "cm-indent-guide" : "cm-indent-spacer",
219
+ ].join(" ");
220
+ indent.textContent = segment.text;
221
+ root.append(indent);
222
+ }
223
+ return root;
224
+ }
225
+ ignoreEvent() {
226
+ return true;
227
+ }
228
+ }
229
+ export function indentGuideDecorations(options = {}) {
230
+ const livePreview = options.livePreview ?? true;
231
+ return ViewPlugin.fromClass(class {
232
+ decorations;
233
+ constructor(view) {
234
+ this.decorations = this.createDecorations(view);
235
+ }
236
+ update(update) {
237
+ if (update.docChanged ||
238
+ update.viewportChanged ||
239
+ update.selectionSet ||
240
+ update.focusChanged) {
241
+ this.decorations = this.createDecorations(update.view);
242
+ }
243
+ }
244
+ createDecorations(view) {
245
+ const decorations = [];
246
+ const cursor = view.state.selection.main;
247
+ for (const { from, to } of view.visibleRanges) {
248
+ let line = view.state.doc.lineAt(from);
249
+ while (line.from <= to) {
250
+ const layout = getIndentLineLayout(line.text);
251
+ if (layout && isMarkdownIndentLine(view, line, layout)) {
252
+ // Pure quote chrome (`>`, blockquote border) is live-preview-only
253
+ // in Lapis (RichEditPlugin). Source keeps literal `>` text.
254
+ if (!livePreview && layout.kind === "quote") {
255
+ if (line.number >= view.state.doc.lines) {
256
+ break;
257
+ }
258
+ line = view.state.doc.line(line.number + 1);
259
+ continue;
260
+ }
261
+ const indentTo = line.from + layout.indentText.length;
262
+ const anchor = layout.kind === "plain"
263
+ ? findPlainIndentAnchor(view, line, layout.indentColumns, livePreview)
264
+ : null;
265
+ const quoteChrome = livePreview &&
266
+ (layout.kind === "quote" || layout.kind === "quote-list");
267
+ decorations.push(Decoration.line({
268
+ attributes: {
269
+ "data-indent-prefix": layout.indentText,
270
+ "data-indent-fallback-columns": `${layout.fallbackColumns}`,
271
+ "data-indent-variant": layout.kind,
272
+ "data-line-from": `${line.from}`,
273
+ "data-list-depth": `${layout.depth}`,
274
+ ...(layout.listKind
275
+ ? { "data-list-kind": layout.listKind }
276
+ : {}),
277
+ ...(anchor
278
+ ? {
279
+ "data-indent-anchor-line-from": `${anchor.lineFrom}`,
280
+ }
281
+ : {}),
282
+ style: buildIndentStyle(layout, anchor, livePreview),
283
+ },
284
+ class: [
285
+ "indented-wrapped-line",
286
+ layout.kind === "plain" ? "cm-plain-indent-line" : "",
287
+ quoteChrome ? "cm-blockquote" : "",
288
+ layout.listKind || layout.kind === "plain"
289
+ ? "HyperMD-list-line"
290
+ : "",
291
+ layout.listKind || layout.kind === "plain"
292
+ ? `HyperMD-list-line-${layout.depth}`
293
+ : "",
294
+ !layout.listKind ? "cm-formatting" : "",
295
+ layout.kind === "plain" ? "cm-formatting-list" : "",
296
+ layout.kind === "plain" ? "cm-formatting-list-ul" : "",
297
+ layout.kind === "plain" ? `cm-list-${layout.depth}` : "",
298
+ ]
299
+ .filter(Boolean)
300
+ .join(" "),
301
+ }).range(line.from));
302
+ if (layout.indentText.length > 0 &&
303
+ !selectionTouchesIndent(cursor.from, cursor.to, line.from, indentTo)) {
304
+ decorations.push(Decoration.replace({
305
+ widget: new IndentGuideWidget(splitIndentSegments(layout.indentText), layout.kind === "plain"),
306
+ }).range(line.from, indentTo));
307
+ }
308
+ if (layout.markerFrom !== undefined &&
309
+ layout.markerTo !== undefined) {
310
+ const markerFrom = line.from + layout.markerFrom;
311
+ const styledUnorderedMarker = layout.listKind === "ul" &&
312
+ shouldRenderStyledUnorderedMarker(livePreview, cursor.from, markerFrom);
313
+ decorations.push(Decoration.mark({
314
+ class: [
315
+ "cm-formatting",
316
+ "cm-formatting-list",
317
+ layout.listKind === "ol"
318
+ ? "cm-formatting-list-ol"
319
+ : "cm-formatting-list-ul",
320
+ `cm-list-${layout.depth}`,
321
+ styledUnorderedMarker ? "cm-formatting-list-bullet" : "",
322
+ ]
323
+ .filter(Boolean)
324
+ .join(" "),
325
+ }).range(markerFrom, line.from + layout.markerTo));
326
+ }
327
+ if (livePreview &&
328
+ layout.quoteFrom !== undefined &&
329
+ layout.quoteTo !== undefined) {
330
+ const quoteDepth = (line.text
331
+ .slice(layout.quoteFrom, layout.quoteTo)
332
+ .match(/>/gu) ?? []).length;
333
+ decorations.push(Decoration.mark({
334
+ class: [
335
+ "cm-formatting-quote",
336
+ `cm-formatting-quote-${quoteDepth}`,
337
+ "cm-quote",
338
+ `cm-quote-${quoteDepth}`,
339
+ quoteDepth > 1 ? "cm-blockquote-border" : "",
340
+ ]
341
+ .filter(Boolean)
342
+ .join(" "),
343
+ }).range(line.from + layout.quoteFrom, line.from + layout.quoteTo));
344
+ }
345
+ if (layout.contentFrom < line.text.length) {
346
+ decorations.push(Decoration.mark({
347
+ class: `cm-list-${layout.depth}`,
348
+ }).range(line.from + layout.contentFrom, line.to));
349
+ }
350
+ }
351
+ if (line.number >= view.state.doc.lines) {
352
+ break;
353
+ }
354
+ line = view.state.doc.line(line.number + 1);
355
+ }
356
+ }
357
+ return Decoration.set(sortRanges(decorations));
358
+ }
359
+ }, {
360
+ decorations: (plugin) => plugin.decorations,
361
+ });
362
+ }
363
+ function isMarkdownIndentLine(view, line, layout) {
364
+ // Fenced code keeps literal leading whitespace + the shared 24px fence
365
+ // padding. Hanging-indent chrome here pulls lines left of that padding
366
+ // until the cursor sits on the indent and clears the replace widget.
367
+ if (isFencedCodeLine(view.state, line.number)) {
368
+ return false;
369
+ }
370
+ if (!layout.listKind && layout.kind !== "quote") {
371
+ return true;
372
+ }
373
+ let list = false;
374
+ let quote = false;
375
+ const tree = ensureSyntaxTree(view.state, line.to, 25) ?? syntaxTree(view.state);
376
+ tree.iterate({
377
+ from: line.from,
378
+ to: line.to,
379
+ enter(node) {
380
+ list ||= node.name === "ListMark";
381
+ quote ||= node.name === "QuoteMark";
382
+ },
383
+ });
384
+ return layout.listKind ? list : quote;
385
+ }
386
+ export function shouldAnchorPlainIndentToListItem(indentColumns, parentContentColumns) {
387
+ return indentColumns < parentContentColumns + INDENT_UNIT;
388
+ }
389
+ function getMarkerEnd(lineText, lineFrom, markerFrom, markerTo) {
390
+ const markerOffset = markerFrom - lineFrom;
391
+ const spaceOffset = lineText.indexOf(" ", markerOffset);
392
+ return spaceOffset === -1 ? markerTo : lineFrom + spaceOffset + 1;
393
+ }
394
+ function getListPrefixEndFromText(remainder, markerEnd) {
395
+ const task = remainder.match(/^(\[[^\]]\]\s+)/u)?.[0] ?? "";
396
+ return markerEnd + task.length;
397
+ }
398
+ function findPlainIndentAnchor(view, line, indentColumns, usesUnorderedMarkerSlot) {
399
+ const tree = ensureSyntaxTree(view.state, line.to, 25) ?? syntaxTree(view.state);
400
+ const node = tree.resolve(line.from, 1);
401
+ for (let current = node; current; current = current.parent) {
402
+ if (current.name !== "ListItem") {
403
+ continue;
404
+ }
405
+ const list = current.parent;
406
+ if (!list || (list.name !== "BulletList" && list.name !== "OrderedList")) {
407
+ continue;
408
+ }
409
+ const listMark = current.getChild("ListMark");
410
+ if (!listMark) {
411
+ return null;
412
+ }
413
+ const anchorLine = view.state.doc.lineAt(listMark.from);
414
+ if (anchorLine.from === line.from) {
415
+ return null;
416
+ }
417
+ const markerEnd = getMarkerEnd(anchorLine.text, anchorLine.from, listMark.from, listMark.to);
418
+ const prefixEnd = getListPrefixEndFromText(view.state.sliceDoc(markerEnd, anchorLine.to), markerEnd);
419
+ const fallbackPaddingColumns = toMarkdownColumns(view.state.sliceDoc(anchorLine.from, prefixEnd));
420
+ if (!shouldAnchorPlainIndentToListItem(indentColumns, fallbackPaddingColumns)) {
421
+ return null;
422
+ }
423
+ if (list.name === "BulletList" && usesUnorderedMarkerSlot) {
424
+ const markerColumns = toMarkdownColumns(view.state.sliceDoc(listMark.from, markerEnd));
425
+ return {
426
+ fallbackPaddingAdjustment: unorderedMarkerAdjustment(markerColumns),
427
+ fallbackPaddingColumns,
428
+ guideOffset: "var(--hmd-unordered-list-marker-guide-offset, 0px)",
429
+ lineFrom: anchorLine.from,
430
+ };
431
+ }
432
+ return { fallbackPaddingColumns, lineFrom: anchorLine.from };
433
+ }
434
+ return null;
435
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=indent.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indent.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/indent.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,169 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { EditorView } from "@codemirror/view";
3
+ import { createMarkdownCodeMirrorExtensions } from "../../markdown";
4
+ import { getIndentLineLayout, getLineIndentInfo, indentGuideDecorations, normalizeIndentText, selectionTouchesIndent, shouldRenderStyledUnorderedMarker, shouldAnchorPlainIndentToListItem, splitIndentSegments, toMarkdownColumns, } from "./indent";
5
+ describe("indent helpers", () => {
6
+ it("derives Lapis-style indentation metadata", () => {
7
+ expect(toMarkdownColumns("\t ")).toBe(6);
8
+ expect(normalizeIndentText("\t ")).toBe(" ");
9
+ expect(splitIndentSegments(" ")).toEqual([
10
+ { text: " ", guide: true },
11
+ { text: " ", guide: false },
12
+ ]);
13
+ expect(getLineIndentInfo(" - nested")).toEqual({
14
+ columns: 4,
15
+ depth: 2,
16
+ kind: "ul",
17
+ text: " ",
18
+ });
19
+ expect(getLineIndentInfo(" continuation")).toEqual({
20
+ columns: 2,
21
+ depth: 1,
22
+ kind: "plain",
23
+ text: " ",
24
+ });
25
+ expect(selectionTouchesIndent(2, 2, 0, 4)).toBe(true);
26
+ expect(selectionTouchesIndent(5, 5, 0, 4)).toBe(false);
27
+ expect(shouldRenderStyledUnorderedMarker(true, 12, 10)).toBe(true);
28
+ expect(shouldRenderStyledUnorderedMarker(false, 12, 10)).toBe(false);
29
+ expect(shouldRenderStyledUnorderedMarker(true, 10, 10)).toBe(false);
30
+ expect(shouldRenderStyledUnorderedMarker(true, 11, 10)).toBe(false);
31
+ expect(shouldAnchorPlainIndentToListItem(2, 2)).toBe(true);
32
+ expect(shouldAnchorPlainIndentToListItem(8, 3)).toBe(false);
33
+ });
34
+ it("styles inactive dash and asterisk markers only in live preview", async () => {
35
+ const parent = document.createElement("div");
36
+ document.body.append(parent);
37
+ const view = new EditorView({
38
+ doc: ["# List markers", "", "- Dash item", "* Asterisk item"].join("\n"),
39
+ extensions: [
40
+ createMarkdownCodeMirrorExtensions(),
41
+ indentGuideDecorations({ livePreview: true }),
42
+ ],
43
+ parent,
44
+ });
45
+ await new Promise((resolve) => requestAnimationFrame(() => resolve(null)));
46
+ const markerFor = (snippet) => [...parent.querySelectorAll(".cm-line")]
47
+ .find((line) => (line.textContent || "").includes(snippet))
48
+ ?.querySelector(".cm-formatting-list-ul");
49
+ expect(markerFor("Dash item")?.textContent).toBe("- ");
50
+ expect(markerFor("Dash item")?.classList).toContain("cm-formatting-list-bullet");
51
+ expect(markerFor("Asterisk item")?.textContent).toBe("* ");
52
+ expect(markerFor("Asterisk item")?.classList).toContain("cm-formatting-list-bullet");
53
+ view.dispatch({ selection: { anchor: view.state.doc.line(3).from } });
54
+ expect(markerFor("Dash item")?.classList).not.toContain("cm-formatting-list-bullet");
55
+ expect(markerFor("Asterisk item")?.classList).toContain("cm-formatting-list-bullet");
56
+ view.destroy();
57
+ parent.remove();
58
+ });
59
+ it("derives authored prefixes for top-level, quoted, and plain lines", () => {
60
+ expect(getIndentLineLayout("- wrapped item")).toMatchObject({
61
+ fallbackColumns: 2,
62
+ indentText: "",
63
+ kind: "ul",
64
+ listKind: "ul",
65
+ markerFrom: 0,
66
+ markerTo: 2,
67
+ });
68
+ expect(getIndentLineLayout("> 1. quoted item")).toMatchObject({
69
+ fallbackColumns: 5,
70
+ indentText: "",
71
+ kind: "quote-list",
72
+ listKind: "ol",
73
+ quoteFrom: 0,
74
+ quoteTo: 2,
75
+ });
76
+ expect(getIndentLineLayout("> quoted paragraph")).toMatchObject({
77
+ fallbackColumns: 2,
78
+ indentText: "",
79
+ kind: "quote",
80
+ quoteFrom: 0,
81
+ quoteTo: 2,
82
+ });
83
+ expect(getIndentLineLayout(" > indented quote")).toMatchObject({
84
+ fallbackColumns: 6,
85
+ indentText: " ",
86
+ kind: "quote",
87
+ quoteFrom: 4,
88
+ quoteTo: 6,
89
+ });
90
+ expect(getIndentLineLayout(" continuation")).toMatchObject({
91
+ fallbackColumns: 4,
92
+ indentText: " ",
93
+ kind: "plain",
94
+ });
95
+ });
96
+ it("does not apply hanging indent inside fenced code blocks", async () => {
97
+ const parent = document.createElement("div");
98
+ document.body.append(parent);
99
+ const view = new EditorView({
100
+ doc: [
101
+ "~~~mermaid",
102
+ " Source --> LivePreview",
103
+ " LivePreview --> Preview",
104
+ "~~~",
105
+ " outside continuation",
106
+ ].join("\n"),
107
+ extensions: indentGuideDecorations({ livePreview: false }),
108
+ parent,
109
+ });
110
+ await new Promise((resolve) => requestAnimationFrame(() => resolve(null)));
111
+ const fenceBody = [...parent.querySelectorAll(".cm-line")].filter((line) => (line.textContent || "").includes("Source --> LivePreview"));
112
+ expect(fenceBody.length).toBe(1);
113
+ expect(fenceBody[0]?.classList.contains("indented-wrapped-line")).toBe(false);
114
+ expect(fenceBody[0]?.querySelector(".cm-hmd-list-indent")).toBeNull();
115
+ const outside = [...parent.querySelectorAll(".cm-line")].find((line) => (line.textContent || "").includes("outside continuation"));
116
+ expect(outside?.classList.contains("indented-wrapped-line")).toBe(true);
117
+ view.destroy();
118
+ parent.remove();
119
+ });
120
+ it("anchors list continuations through syntax-tree ownership", async () => {
121
+ const parent = document.createElement("div");
122
+ document.body.append(parent);
123
+ const view = new EditorView({
124
+ doc: [
125
+ "- Bullet item",
126
+ " This single-space continuation",
127
+ " This two-space continuation",
128
+ "",
129
+ "2. Multiple paragraphs:",
130
+ " First ordered continuation",
131
+ "",
132
+ " Second ordered continuation",
133
+ "",
134
+ "4. Preformatted content:",
135
+ "",
136
+ " Eight-space preformatted content",
137
+ ].join("\n"),
138
+ extensions: [
139
+ createMarkdownCodeMirrorExtensions(),
140
+ indentGuideDecorations({ livePreview: false }),
141
+ ],
142
+ parent,
143
+ });
144
+ await new Promise((resolve) => requestAnimationFrame(() => resolve(null)));
145
+ const lineContaining = (snippet) => [...parent.querySelectorAll(".cm-line")].find((line) => (line.textContent || "").includes(snippet));
146
+ const bullet = lineContaining("Bullet item");
147
+ const ordered = lineContaining("Multiple paragraphs");
148
+ const single = lineContaining("single-space continuation");
149
+ const two = lineContaining("two-space continuation");
150
+ const first = lineContaining("First ordered continuation");
151
+ const second = lineContaining("Second ordered continuation");
152
+ const preformatted = lineContaining("Eight-space preformatted content");
153
+ expect(bullet?.dataset["indentAnchorLineFrom"]).toBeUndefined();
154
+ expect(bullet?.classList.contains("cm-formatting-list-ul")).toBe(false);
155
+ expect(bullet?.querySelector(".cm-formatting-list-ul")).not.toBeNull();
156
+ expect(single?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(1).from}`);
157
+ expect(two?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(1).from}`);
158
+ expect(two?.getAttribute("style")).toContain("--hmd-indent-widget-prefix-fallback: var(--list-indent)");
159
+ expect(two?.getAttribute("style")).toContain("--hmd-indent-padding-fallback: 2ch");
160
+ expect(first?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(5).from}`);
161
+ expect(second?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(5).from}`);
162
+ expect(ordered?.classList.contains("cm-formatting-list-ol")).toBe(false);
163
+ expect(preformatted?.dataset["indentAnchorLineFrom"]).toBeUndefined();
164
+ expect(preformatted?.querySelectorAll(".cm-indent-guide")).toHaveLength(2);
165
+ expect(preformatted?.getAttribute("style")).toContain("--hmd-indent-widget-prefix-fallback: calc(var(--list-indent) + var(--list-indent))");
166
+ view.destroy();
167
+ parent.remove();
168
+ });
169
+ });
@@ -0,0 +1,7 @@
1
+ import type { RangeBoundary } from "./ranges";
2
+ export declare function findInlineCodeRanges(text: string): RangeBoundary[];
3
+ export declare function countRun(text: string, start: number, character: string): number;
4
+ export declare function isPositionInsideRanges(position: number, ranges: RangeBoundary[]): boolean;
5
+ export declare function isEscaped(text: string, index: number): boolean;
6
+ export declare function isWhitespace(character: string): boolean;
7
+ //# sourceMappingURL=inline-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-code.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/inline-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAwBlE;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,CAMR;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,EAAE,GACtB,OAAO,CAET;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ9D;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEvD"}
@@ -0,0 +1,43 @@
1
+ export function findInlineCodeRanges(text) {
2
+ const ranges = [];
3
+ let index = 0;
4
+ while (index < text.length) {
5
+ if (text[index] !== "`" || isEscaped(text, index)) {
6
+ index += 1;
7
+ continue;
8
+ }
9
+ const tickCount = countRun(text, index, "`");
10
+ const closingIndex = text.indexOf("`".repeat(tickCount), index + tickCount);
11
+ if (closingIndex === -1) {
12
+ break;
13
+ }
14
+ ranges.push({
15
+ from: index,
16
+ to: closingIndex + tickCount,
17
+ });
18
+ index = closingIndex + tickCount;
19
+ }
20
+ return ranges;
21
+ }
22
+ export function countRun(text, start, character) {
23
+ let count = 0;
24
+ while (text[start + count] === character) {
25
+ count += 1;
26
+ }
27
+ return count;
28
+ }
29
+ export function isPositionInsideRanges(position, ranges) {
30
+ return ranges.some((range) => position >= range.from && position < range.to);
31
+ }
32
+ export function isEscaped(text, index) {
33
+ let backslashes = 0;
34
+ let cursor = index - 1;
35
+ while (cursor >= 0 && text[cursor] === "\\") {
36
+ backslashes += 1;
37
+ cursor -= 1;
38
+ }
39
+ return backslashes % 2 === 1;
40
+ }
41
+ export function isWhitespace(character) {
42
+ return character.length > 0 && /\s/u.test(character);
43
+ }
@@ -0,0 +1,6 @@
1
+ import type { RangeBoundary } from "./ranges";
2
+ export type InlineMathRange = RangeBoundary & {
3
+ source: string;
4
+ };
5
+ export declare function findInlineMathRanges(text: string): InlineMathRange[];
6
+ //# sourceMappingURL=inline-math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-math.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/inline-math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQ9C,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,EAAE,CAoDpE"}