@youcan/celeste 0.6.70 → 0.6.71

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 (323) hide show
  1. package/dist/celeste.css +3 -4
  2. package/dist/cjs/alert.js +32 -32
  3. package/dist/cjs/badge.js +12 -12
  4. package/dist/cjs/button.js +6 -6
  5. package/dist/cjs/checkbox-card.js +33 -33
  6. package/dist/cjs/checkbox-label.js +31 -31
  7. package/dist/cjs/chunks/alpha-slider.js +12 -12
  8. package/dist/cjs/chunks/checkbox.js +7 -7
  9. package/dist/cjs/chunks/collapsible-content.js +6 -6
  10. package/dist/cjs/chunks/collapsible-trigger.js +5 -5
  11. package/dist/cjs/chunks/collapsible.js +6 -6
  12. package/dist/cjs/chunks/combobox-anchor.js +8 -8
  13. package/dist/cjs/chunks/content-divider.vue_vue_type_style_index_0_lang.js +15 -15
  14. package/dist/cjs/chunks/counter-input.js +13 -13
  15. package/dist/cjs/chunks/dropdown-menu-sub.js +6 -6
  16. package/dist/cjs/chunks/index.js +2292 -2289
  17. package/dist/cjs/chunks/index2.js +14 -14
  18. package/dist/cjs/chunks/index3.js +28 -28
  19. package/dist/cjs/chunks/index4.js +125 -96
  20. package/dist/cjs/chunks/index5.js +4720 -4015
  21. package/dist/cjs/chunks/modal-close.js +5 -5
  22. package/dist/cjs/chunks/modal-trigger.js +5 -5
  23. package/dist/cjs/chunks/modal.js +6 -6
  24. package/dist/cjs/chunks/pagination-first.js +9 -9
  25. package/dist/cjs/chunks/pagination-item.js +6 -6
  26. package/dist/cjs/chunks/pagination-last.js +9 -9
  27. package/dist/cjs/chunks/pagination-next.js +9 -9
  28. package/dist/cjs/chunks/pagination-previous.js +9 -9
  29. package/dist/cjs/chunks/popover.js +6 -6
  30. package/dist/cjs/chunks/radio-group-item.js +7 -7
  31. package/dist/cjs/chunks/radio-group.js +8 -8
  32. package/dist/cjs/chunks/rich-editor.vue_vue_type_style_index_0_scoped_dbc85b1a_lang.js +742 -45
  33. package/dist/cjs/chunks/scroll-area.js +11 -11
  34. package/dist/cjs/chunks/select-group.js +5 -5
  35. package/dist/cjs/chunks/select.js +7 -7
  36. package/dist/cjs/chunks/sheet-trigger.js +5 -5
  37. package/dist/cjs/chunks/sheet.js +6 -6
  38. package/dist/cjs/chunks/sidebar-content.js +5 -5
  39. package/dist/cjs/chunks/sidebar-element.js +6 -6
  40. package/dist/cjs/chunks/sidebar-footer.js +5 -5
  41. package/dist/cjs/chunks/sidebar-group-label.js +6 -6
  42. package/dist/cjs/chunks/sidebar-group.js +5 -5
  43. package/dist/cjs/chunks/sidebar-header.js +5 -5
  44. package/dist/cjs/chunks/sidebar-menu-action.js +6 -6
  45. package/dist/cjs/chunks/sidebar-menu-badge.js +4 -4
  46. package/dist/cjs/chunks/sidebar-menu-button.js +7 -7
  47. package/dist/cjs/chunks/sidebar-menu-item.js +5 -5
  48. package/dist/cjs/chunks/sidebar-menu-sub-button.js +6 -6
  49. package/dist/cjs/chunks/sidebar-menu-sub-item.js +5 -5
  50. package/dist/cjs/chunks/sidebar-menu-sub.js +5 -5
  51. package/dist/cjs/chunks/sidebar-menu.js +5 -5
  52. package/dist/cjs/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +9 -9
  53. package/dist/cjs/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +4 -4
  54. package/dist/cjs/chunks/sidebar.js +21 -21
  55. package/dist/cjs/chunks/slider.js +11 -11
  56. package/dist/cjs/chunks/sonner.js +214 -146
  57. package/dist/cjs/chunks/switch.js +7 -7
  58. package/dist/cjs/chunks/tinycolor.js +2 -2
  59. package/dist/cjs/chunks/tooltip-provider.js +5 -5
  60. package/dist/cjs/chunks/tooltip-root.js +7 -7
  61. package/dist/cjs/chunks/tooltip-trigger.js +6 -6
  62. package/dist/cjs/chunks/tooltip.js +12 -12
  63. package/dist/cjs/color-area.js +16 -16
  64. package/dist/cjs/color-picker.js +102 -102
  65. package/dist/cjs/color-swatch.js +11 -11
  66. package/dist/cjs/combobox-empty.js +7 -7
  67. package/dist/cjs/combobox-group.js +11 -11
  68. package/dist/cjs/combobox-input.js +12 -12
  69. package/dist/cjs/combobox-item.js +24 -24
  70. package/dist/cjs/combobox-list.js +12 -12
  71. package/dist/cjs/combobox-root.js +7 -6
  72. package/dist/cjs/combobox-separator.js +7 -7
  73. package/dist/cjs/combobox-trigger.js +8 -8
  74. package/dist/cjs/combobox.js +54 -53
  75. package/dist/cjs/command-group.js +10 -10
  76. package/dist/cjs/command-input.js +8 -8
  77. package/dist/cjs/command-item.js +7 -7
  78. package/dist/cjs/command-list.js +8 -8
  79. package/dist/cjs/command-root.js +8 -7
  80. package/dist/cjs/command-separator.js +7 -7
  81. package/dist/cjs/compact-button.js +7 -7
  82. package/dist/cjs/config.js +2 -2
  83. package/dist/cjs/digit-input-group.js +7 -7
  84. package/dist/cjs/digit-input-slot.js +5 -5
  85. package/dist/cjs/digit-input.js +7 -7
  86. package/dist/cjs/dropdown-menu-content.js +9 -9
  87. package/dist/cjs/dropdown-menu-group.js +5 -5
  88. package/dist/cjs/dropdown-menu-item.js +14 -14
  89. package/dist/cjs/dropdown-menu-label.js +7 -7
  90. package/dist/cjs/dropdown-menu-separator.js +4 -4
  91. package/dist/cjs/dropdown-menu-sub-content.js +9 -9
  92. package/dist/cjs/dropdown-menu-sub-trigger.js +12 -12
  93. package/dist/cjs/dropdown-menu-trigger.js +6 -6
  94. package/dist/cjs/dropdown-menu.js +7 -7
  95. package/dist/cjs/extra-settings.js +21 -21
  96. package/dist/cjs/fancy-button.js +6 -6
  97. package/dist/cjs/file-upload-area.js +22 -22
  98. package/dist/cjs/hint-text.js +8 -8
  99. package/dist/cjs/hue-slider.js +15 -15
  100. package/dist/cjs/index.js +2 -2
  101. package/dist/cjs/label.js +13 -13
  102. package/dist/cjs/link-bubble.js +40 -40
  103. package/dist/cjs/link-button.js +6 -6
  104. package/dist/cjs/modal-body.js +5 -5
  105. package/dist/cjs/modal-content.js +12 -12
  106. package/dist/cjs/modal-footer.js +5 -5
  107. package/dist/cjs/modal-header.js +22 -22
  108. package/dist/cjs/pagination-content.js +6 -6
  109. package/dist/cjs/pagination-ellipsis.js +8 -8
  110. package/dist/cjs/pagination.js +14 -14
  111. package/dist/cjs/popover-content.js +30 -30
  112. package/dist/cjs/popover-trigger.js +5 -5
  113. package/dist/cjs/progress-bar.js +19 -19
  114. package/dist/cjs/progress-circle.js +20 -20
  115. package/dist/cjs/radio-group-card.js +33 -33
  116. package/dist/cjs/radio-group-label.js +31 -31
  117. package/dist/cjs/rich-editor.js +76 -76
  118. package/dist/cjs/scroll-bar.js +7 -7
  119. package/dist/cjs/segmented-control-item.js +6 -8
  120. package/dist/cjs/segmented-control.js +8 -8
  121. package/dist/cjs/select-content.js +11 -11
  122. package/dist/cjs/select-icon.js +5 -5
  123. package/dist/cjs/select-item.js +11 -11
  124. package/dist/cjs/select-label.js +6 -6
  125. package/dist/cjs/select-separator.js +4 -4
  126. package/dist/cjs/select-trigger.js +9 -9
  127. package/dist/cjs/select-value.js +6 -6
  128. package/dist/cjs/sheet-close.js +6 -6
  129. package/dist/cjs/sheet-content.js +14 -14
  130. package/dist/cjs/sheet-description.js +7 -7
  131. package/dist/cjs/sheet-footer.js +6 -6
  132. package/dist/cjs/sheet-header.js +5 -5
  133. package/dist/cjs/sheet-title.js +7 -7
  134. package/dist/cjs/sidebar-group-content.js +5 -5
  135. package/dist/cjs/sidebar-trigger.js +7 -7
  136. package/dist/cjs/social-button.js +8 -8
  137. package/dist/cjs/sonner-alert.js +8 -8
  138. package/dist/cjs/status-badge.js +8 -8
  139. package/dist/cjs/tab-menu-content.js +7 -7
  140. package/dist/cjs/tab-menu-item.js +11 -11
  141. package/dist/cjs/tab-menu-list.js +6 -6
  142. package/dist/cjs/tab-menu.js +6 -6
  143. package/dist/cjs/table-body.js +5 -5
  144. package/dist/cjs/table-caption.js +5 -5
  145. package/dist/cjs/table-cell.js +5 -5
  146. package/dist/cjs/table-empty.js +9 -9
  147. package/dist/cjs/table-footer.js +5 -5
  148. package/dist/cjs/table-head.js +5 -5
  149. package/dist/cjs/table-header.js +5 -5
  150. package/dist/cjs/table-row.js +8 -8
  151. package/dist/cjs/table.js +6 -6
  152. package/dist/cjs/tag.js +10 -10
  153. package/dist/cjs/text-input-affix.js +5 -5
  154. package/dist/cjs/text-input-button.js +6 -6
  155. package/dist/cjs/text-input.js +31 -31
  156. package/dist/cjs/textarea.js +9 -9
  157. package/dist/cjs/tooltip-content.js +20 -20
  158. package/dist/cjs/use-color-model.js +2 -2
  159. package/dist/cjs/use-delegated-props.js +2 -2
  160. package/dist/cjs/use-sidebar.js +1 -1
  161. package/dist/cjs/use-user-select.js +4 -4
  162. package/dist/components/color-picker/alpha-slider.d.ts +1 -1
  163. package/dist/components/color-picker/color-area.d.ts +1 -1
  164. package/dist/components/color-picker/hue-slider.d.ts +1 -1
  165. package/dist/components/file-upload/file-upload-area.d.ts +4 -2
  166. package/dist/components/rich-editor/link-bubble.d.ts +3 -1
  167. package/dist/es/alert.js +1 -1
  168. package/dist/es/badge.js +1 -1
  169. package/dist/es/button.js +2 -2
  170. package/dist/es/checkbox-card.js +3 -3
  171. package/dist/es/checkbox-label.js +3 -3
  172. package/dist/es/chunks/alpha-slider.js +1 -1
  173. package/dist/es/chunks/checkbox.js +5 -5
  174. package/dist/es/chunks/collapsible-content.js +3 -3
  175. package/dist/es/chunks/collapsible-trigger.js +3 -3
  176. package/dist/es/chunks/collapsible.js +4 -4
  177. package/dist/es/chunks/combobox-anchor.js +4 -4
  178. package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +3 -3
  179. package/dist/es/chunks/counter-input.js +7 -7
  180. package/dist/es/chunks/dropdown-menu-sub.js +4 -4
  181. package/dist/es/chunks/index.js +1156 -1153
  182. package/dist/es/chunks/index2.js +3 -3
  183. package/dist/es/chunks/index3.js +2 -2
  184. package/dist/es/chunks/index4.js +119 -90
  185. package/dist/es/chunks/index5.js +4733 -4028
  186. package/dist/es/chunks/modal-close.js +3 -3
  187. package/dist/es/chunks/modal-trigger.js +3 -3
  188. package/dist/es/chunks/modal.js +4 -4
  189. package/dist/es/chunks/pagination-first.js +4 -4
  190. package/dist/es/chunks/pagination-item.js +3 -3
  191. package/dist/es/chunks/pagination-last.js +4 -4
  192. package/dist/es/chunks/pagination-next.js +4 -4
  193. package/dist/es/chunks/pagination-previous.js +4 -4
  194. package/dist/es/chunks/popover.js +4 -4
  195. package/dist/es/chunks/radio-group-item.js +5 -5
  196. package/dist/es/chunks/radio-group.js +4 -4
  197. package/dist/es/chunks/rich-editor.vue_vue_type_style_index_0_scoped_dbc85b1a_lang.js +743 -46
  198. package/dist/es/chunks/scroll-area.js +5 -5
  199. package/dist/es/chunks/select-group.js +3 -3
  200. package/dist/es/chunks/select.js +4 -4
  201. package/dist/es/chunks/sheet-trigger.js +3 -3
  202. package/dist/es/chunks/sheet.js +4 -4
  203. package/dist/es/chunks/sidebar-content.js +1 -1
  204. package/dist/es/chunks/sidebar-element.js +2 -2
  205. package/dist/es/chunks/sidebar-footer.js +1 -1
  206. package/dist/es/chunks/sidebar-group-label.js +2 -2
  207. package/dist/es/chunks/sidebar-group.js +1 -1
  208. package/dist/es/chunks/sidebar-header.js +1 -1
  209. package/dist/es/chunks/sidebar-menu-action.js +2 -2
  210. package/dist/es/chunks/sidebar-menu-badge.js +1 -1
  211. package/dist/es/chunks/sidebar-menu-button.js +2 -2
  212. package/dist/es/chunks/sidebar-menu-item.js +1 -1
  213. package/dist/es/chunks/sidebar-menu-sub-button.js +2 -2
  214. package/dist/es/chunks/sidebar-menu-sub-item.js +1 -1
  215. package/dist/es/chunks/sidebar-menu-sub.js +1 -1
  216. package/dist/es/chunks/sidebar-menu.js +1 -1
  217. package/dist/es/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +3 -3
  218. package/dist/es/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +1 -1
  219. package/dist/es/chunks/sidebar.js +1 -1
  220. package/dist/es/chunks/slider.js +7 -7
  221. package/dist/es/chunks/sonner.js +97 -29
  222. package/dist/es/chunks/switch.js +5 -5
  223. package/dist/es/chunks/tinycolor.js +2 -2
  224. package/dist/es/chunks/tooltip-provider.js +3 -3
  225. package/dist/es/chunks/tooltip-root.js +4 -4
  226. package/dist/es/chunks/tooltip-trigger.js +4 -4
  227. package/dist/es/chunks/tooltip.js +3 -3
  228. package/dist/es/color-area.js +2 -2
  229. package/dist/es/color-picker.js +5 -5
  230. package/dist/es/color-swatch.js +1 -1
  231. package/dist/es/combobox-empty.js +3 -3
  232. package/dist/es/combobox-group.js +4 -4
  233. package/dist/es/combobox-input.js +3 -3
  234. package/dist/es/combobox-item.js +4 -4
  235. package/dist/es/combobox-list.js +6 -6
  236. package/dist/es/combobox-root.js +5 -4
  237. package/dist/es/combobox-separator.js +3 -3
  238. package/dist/es/combobox-trigger.js +4 -4
  239. package/dist/es/combobox.js +4 -3
  240. package/dist/es/command-group.js +4 -4
  241. package/dist/es/command-input.js +4 -4
  242. package/dist/es/command-item.js +4 -4
  243. package/dist/es/command-list.js +4 -4
  244. package/dist/es/command-root.js +5 -4
  245. package/dist/es/command-separator.js +3 -3
  246. package/dist/es/compact-button.js +2 -2
  247. package/dist/es/digit-input-group.js +3 -3
  248. package/dist/es/digit-input-slot.js +4 -4
  249. package/dist/es/digit-input.js +4 -4
  250. package/dist/es/dropdown-menu-content.js +5 -5
  251. package/dist/es/dropdown-menu-group.js +3 -3
  252. package/dist/es/dropdown-menu-item.js +4 -4
  253. package/dist/es/dropdown-menu-label.js +4 -4
  254. package/dist/es/dropdown-menu-separator.js +3 -3
  255. package/dist/es/dropdown-menu-sub-content.js +5 -5
  256. package/dist/es/dropdown-menu-sub-trigger.js +4 -4
  257. package/dist/es/dropdown-menu-trigger.js +4 -4
  258. package/dist/es/dropdown-menu.js +4 -4
  259. package/dist/es/extra-settings.js +1 -1
  260. package/dist/es/fancy-button.js +2 -2
  261. package/dist/es/file-upload-area.js +1 -1
  262. package/dist/es/hint-text.js +1 -1
  263. package/dist/es/hue-slider.js +3 -3
  264. package/dist/es/index.js +3 -3
  265. package/dist/es/label.js +3 -3
  266. package/dist/es/link-bubble.js +1 -1
  267. package/dist/es/link-button.js +2 -2
  268. package/dist/es/modal-body.js +1 -1
  269. package/dist/es/modal-content.js +6 -6
  270. package/dist/es/modal-footer.js +1 -1
  271. package/dist/es/modal-header.js +5 -5
  272. package/dist/es/pagination-content.js +3 -3
  273. package/dist/es/pagination-ellipsis.js +3 -3
  274. package/dist/es/pagination.js +4 -4
  275. package/dist/es/popover-content.js +7 -7
  276. package/dist/es/popover-trigger.js +3 -3
  277. package/dist/es/progress-bar.js +4 -4
  278. package/dist/es/progress-circle.js +4 -4
  279. package/dist/es/radio-group-card.js +3 -3
  280. package/dist/es/radio-group-label.js +3 -3
  281. package/dist/es/rich-editor.js +4 -4
  282. package/dist/es/scroll-bar.js +4 -4
  283. package/dist/es/segmented-control-item.js +3 -5
  284. package/dist/es/segmented-control.js +4 -4
  285. package/dist/es/select-content.js +6 -6
  286. package/dist/es/select-icon.js +1 -1
  287. package/dist/es/select-item.js +5 -5
  288. package/dist/es/select-label.js +3 -3
  289. package/dist/es/select-separator.js +3 -3
  290. package/dist/es/select-trigger.js +4 -4
  291. package/dist/es/select-value.js +3 -3
  292. package/dist/es/sheet-close.js +3 -3
  293. package/dist/es/sheet-content.js +7 -7
  294. package/dist/es/sheet-description.js +3 -3
  295. package/dist/es/sheet-footer.js +1 -1
  296. package/dist/es/sheet-header.js +1 -1
  297. package/dist/es/sheet-title.js +3 -3
  298. package/dist/es/sidebar-group-content.js +1 -1
  299. package/dist/es/sidebar-trigger.js +1 -1
  300. package/dist/es/social-button.js +2 -2
  301. package/dist/es/sonner-alert.js +1 -1
  302. package/dist/es/status-badge.js +1 -1
  303. package/dist/es/tab-menu-content.js +3 -3
  304. package/dist/es/tab-menu-item.js +4 -4
  305. package/dist/es/tab-menu-list.js +3 -3
  306. package/dist/es/tab-menu.js +4 -4
  307. package/dist/es/table-body.js +1 -1
  308. package/dist/es/table-caption.js +1 -1
  309. package/dist/es/table-cell.js +1 -1
  310. package/dist/es/table-empty.js +1 -1
  311. package/dist/es/table-footer.js +1 -1
  312. package/dist/es/table-head.js +1 -1
  313. package/dist/es/table-header.js +1 -1
  314. package/dist/es/table-row.js +1 -1
  315. package/dist/es/table.js +1 -1
  316. package/dist/es/tag.js +2 -2
  317. package/dist/es/text-input-affix.js +1 -1
  318. package/dist/es/text-input-button.js +1 -1
  319. package/dist/es/text-input.js +2 -2
  320. package/dist/es/textarea.js +1 -1
  321. package/dist/es/tooltip-content.js +6 -6
  322. package/dist/es/use-sidebar.js +2 -2
  323. package/package.json +38 -38
@@ -1,12 +1,6 @@
1
- import { M as Mark, m as mergeAttributes, f as markPasteRule, c as Plugin, P as PluginKey, h as combineTransactionSteps, j as getChangedRanges, l as findChildrenInRange, n as getMarksBetween, o as getAttributes, E as Extension, q as dropPoint, S as Selection, k as keydownHandler, N as NodeSelection, F as Fragment, b as Slice, T as TextSelection, D as DecorationSet, r as Decoration, s as Mapping, t as callOrReturn, u as getExtensionField, v as isNodeEmpty, w as isNodeSelection, x as Node3, y as wrappingInputRule, z as markInputRule, A as textblockTypeInputRule, B as canInsertNode, C as nodeInputRule, G as getNodeType, H as getNodeAtPosition, I as isNodeActive, J as isAtStartOfNode, K as isAtEndOfNode } from "./index5.js";
2
- const encodedTlds = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
1
+ import { M as Mark, m as markPasteRule, e as mergeAttributes, c as Plugin, P as PluginKey, f as combineTransactionSteps, h as getChangedRanges, j as findChildrenInRange, l as getMarksBetween, n as getAttributes, o as Extension, q as dropPoint, k as keydownHandler, F as Fragment, b as Slice, T as TextSelection, N as NodeSelection, D as DecorationSet, r as Decoration, S as Selection, s as Mapping, t as callOrReturn, u as getExtensionField, v as isNodeEmpty, w as isNodeSelection, x as Node3, y as wrappingInputRule, z as markInputRule, A as textblockTypeInputRule, B as nodeInputRule, C as canInsertNode, G as renderNestedMarkdownContent, H as parseIndentedBlocks, I as isNodeActive, J as isAtStartOfNode, K as isAtEndOfNode, L as getNodeType, O as getNodeAtPosition } from "./index5.js";
2
+ const encodedTlds = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
3
3
  const encodedUtlds = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2";
4
- const assign = (target, properties) => {
5
- for (const key in properties) {
6
- target[key] = properties[key];
7
- }
8
- return target;
9
- };
10
4
  const numeric = "numeric";
11
5
  const ascii = "ascii";
12
6
  const alpha = "alpha";
@@ -196,7 +190,7 @@ State.prototype = {
196
190
  let nextState, templateState = state.go(input);
197
191
  if (templateState) {
198
192
  nextState = new State();
199
- assign(nextState.j, templateState.j);
193
+ Object.assign(nextState.j, templateState.j);
200
194
  nextState.jr.push.apply(nextState.jr, templateState.jr);
201
195
  nextState.jd = templateState.jd;
202
196
  nextState.t = templateState.t;
@@ -206,7 +200,7 @@ State.prototype = {
206
200
  if (t) {
207
201
  if (groups) {
208
202
  if (nextState.t && typeof nextState.t === "string") {
209
- const allFlags = assign(flagsForToken(nextState.t, groups), flags);
203
+ const allFlags = Object.assign(flagsForToken(nextState.t, groups), flags);
210
204
  addToGroups(t, allFlags, groups);
211
205
  } else if (flags) {
212
206
  addToGroups(t, flags, groups);
@@ -505,7 +499,7 @@ function init$2(customSchemes = []) {
505
499
  Start.jd = new State(SYM);
506
500
  return {
507
501
  start: Start,
508
- tokens: assign({
502
+ tokens: Object.assign({
509
503
  groups
510
504
  }, tk)
511
505
  };
@@ -625,9 +619,9 @@ const defaults = {
625
619
  render: null
626
620
  };
627
621
  function Options(opts, defaultRender = null) {
628
- let o = assign({}, defaults);
622
+ let o = Object.assign({}, defaults);
629
623
  if (opts) {
630
- o = assign(o, opts instanceof Options ? opts.o : opts);
624
+ o = Object.assign(o, opts instanceof Options ? opts.o : opts);
631
625
  }
632
626
  const ignoredTags = o.ignoreTags;
633
627
  const uppercaseIgnoredTags = [];
@@ -844,7 +838,7 @@ MultiToken.prototype = {
844
838
  attributes.rel = rel;
845
839
  }
846
840
  if (attrs) {
847
- assign(attributes, attrs);
841
+ Object.assign(attributes, attrs);
848
842
  }
849
843
  return {
850
844
  tagName,
@@ -1286,7 +1280,8 @@ function pasteHandler(options) {
1286
1280
  return new Plugin({
1287
1281
  key: new PluginKey("handlePasteLink"),
1288
1282
  props: {
1289
- handlePaste: (view, event, slice2) => {
1283
+ handlePaste: (view, _event, slice2) => {
1284
+ const { shouldAutoLink } = options;
1290
1285
  const { state } = view;
1291
1286
  const { selection } = state;
1292
1287
  const { empty } = selection;
@@ -1300,7 +1295,7 @@ function pasteHandler(options) {
1300
1295
  const link = find(textContent, { defaultProtocol: options.defaultProtocol }).find(
1301
1296
  (item) => item.isLink && item.value === textContent
1302
1297
  );
1303
- if (!textContent || !link) {
1298
+ if (!textContent || !link || shouldAutoLink !== void 0 && !shouldAutoLink(link.href)) {
1304
1299
  return false;
1305
1300
  }
1306
1301
  return options.editor.commands.setMark(options.type, {
@@ -1417,6 +1412,19 @@ var Link = Mark.create({
1417
1412
  }
1418
1413
  return ["a", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
1419
1414
  },
1415
+ markdownTokenName: "link",
1416
+ parseMarkdown: (token, helpers) => {
1417
+ return helpers.applyMark("link", helpers.parseInline(token.tokens || []), {
1418
+ href: token.href,
1419
+ title: token.title || null
1420
+ });
1421
+ },
1422
+ renderMarkdown: (node, h2) => {
1423
+ var _a;
1424
+ const href = ((_a = node.attrs) == null ? void 0 : _a.href) || "";
1425
+ const text = h2.renderChildren(node);
1426
+ return `[${text}](${href})`;
1427
+ },
1420
1428
  addCommands() {
1421
1429
  return {
1422
1430
  setLink: (attributes) => ({ chain }) => {
@@ -1461,15 +1469,18 @@ var Link = Mark.create({
1461
1469
  })
1462
1470
  );
1463
1471
  if (links.length) {
1464
- links.forEach(
1465
- (link) => foundLinks.push({
1472
+ links.forEach((link) => {
1473
+ if (!this.options.shouldAutoLink(link.value)) {
1474
+ return;
1475
+ }
1476
+ foundLinks.push({
1466
1477
  text: link.value,
1467
1478
  data: {
1468
1479
  href: link.href
1469
1480
  },
1470
1481
  index: link.start
1471
- })
1472
- );
1482
+ });
1483
+ });
1473
1484
  }
1474
1485
  }
1475
1486
  return foundLinks;
@@ -1515,7 +1526,8 @@ var Link = Mark.create({
1515
1526
  pasteHandler({
1516
1527
  editor: this.editor,
1517
1528
  defaultProtocol: this.options.defaultProtocol,
1518
- type: this.type
1529
+ type: this.type,
1530
+ shouldAutoLink: this.options.shouldAutoLink
1519
1531
  })
1520
1532
  );
1521
1533
  }
@@ -1560,10 +1572,10 @@ var TextAlign = Extension.create({
1560
1572
  if (!this.options.alignments.includes(alignment)) {
1561
1573
  return false;
1562
1574
  }
1563
- return this.options.types.map((type) => commands.updateAttributes(type, { textAlign: alignment })).every((response) => response);
1575
+ return this.options.types.map((type) => commands.updateAttributes(type, { textAlign: alignment })).some((response) => response);
1564
1576
  },
1565
1577
  unsetTextAlign: () => ({ commands }) => {
1566
- return this.options.types.map((type) => commands.resetAttributes(type, "textAlign")).every((response) => response);
1578
+ return this.options.types.map((type) => commands.resetAttributes(type, "textAlign")).some((response) => response);
1567
1579
  },
1568
1580
  toggleTextAlign: (alignment) => ({ editor, commands }) => {
1569
1581
  if (!this.options.alignments.includes(alignment)) {
@@ -1586,11 +1598,26 @@ var TextAlign = Extension.create({
1586
1598
  }
1587
1599
  });
1588
1600
  var index_default$1 = TextAlign;
1601
+ var MAX_FIND_CHILD_SPAN_DEPTH = 20;
1602
+ var findChildSpans = (element, depth = 0) => {
1603
+ const childSpans = [];
1604
+ if (!element.children.length || depth > MAX_FIND_CHILD_SPAN_DEPTH) {
1605
+ return childSpans;
1606
+ }
1607
+ Array.from(element.children).forEach((child) => {
1608
+ if (child.tagName === "SPAN") {
1609
+ childSpans.push(child);
1610
+ } else if (child.children.length) {
1611
+ childSpans.push(...findChildSpans(child, depth + 1));
1612
+ }
1613
+ });
1614
+ return childSpans;
1615
+ };
1589
1616
  var mergeNestedSpanStyles = (element) => {
1590
1617
  if (!element.children.length) {
1591
1618
  return;
1592
1619
  }
1593
- const childSpans = element.querySelectorAll("span");
1620
+ const childSpans = findChildSpans(element);
1594
1621
  if (!childSpans) {
1595
1622
  return;
1596
1623
  }
@@ -1667,6 +1694,20 @@ var BackgroundColor = Extension.create({
1667
1694
  default: null,
1668
1695
  parseHTML: (element) => {
1669
1696
  var _a;
1697
+ const styleAttr = element.getAttribute("style");
1698
+ if (styleAttr) {
1699
+ const decls = styleAttr.split(";").map((s) => s.trim()).filter(Boolean);
1700
+ for (let i = decls.length - 1; i >= 0; i -= 1) {
1701
+ const parts = decls[i].split(":");
1702
+ if (parts.length >= 2) {
1703
+ const prop = parts[0].trim().toLowerCase();
1704
+ const val = parts.slice(1).join(":").trim();
1705
+ if (prop === "background-color") {
1706
+ return val.replace(/['"]+/g, "");
1707
+ }
1708
+ }
1709
+ }
1710
+ }
1670
1711
  return (_a = element.style.backgroundColor) == null ? void 0 : _a.replace(/['"]+/g, "");
1671
1712
  },
1672
1713
  renderHTML: (attributes) => {
@@ -1709,6 +1750,20 @@ var Color = Extension.create({
1709
1750
  default: null,
1710
1751
  parseHTML: (element) => {
1711
1752
  var _a;
1753
+ const styleAttr = element.getAttribute("style");
1754
+ if (styleAttr) {
1755
+ const decls = styleAttr.split(";").map((s) => s.trim()).filter(Boolean);
1756
+ for (let i = decls.length - 1; i >= 0; i -= 1) {
1757
+ const parts = decls[i].split(":");
1758
+ if (parts.length >= 2) {
1759
+ const prop = parts[0].trim().toLowerCase();
1760
+ const val = parts.slice(1).join(":").trim();
1761
+ if (prop === "color") {
1762
+ return val.replace(/['"]+/g, "");
1763
+ }
1764
+ }
1765
+ }
1766
+ }
1712
1767
  return (_a = element.style.color) == null ? void 0 : _a.replace(/['"]+/g, "");
1713
1768
  },
1714
1769
  renderHTML: (attributes) => {
@@ -2274,13 +2329,13 @@ RopeSequence.from = function from(values) {
2274
2329
  }
2275
2330
  return values && values.length ? new Leaf(values) : RopeSequence.empty;
2276
2331
  };
2277
- var Leaf = /* @__PURE__ */ function(RopeSequence3) {
2332
+ var Leaf = /* @__PURE__ */ (function(RopeSequence3) {
2278
2333
  function Leaf2(values) {
2279
2334
  RopeSequence3.call(this);
2280
2335
  this.values = values;
2281
2336
  }
2282
- Leaf2.__proto__ = RopeSequence3;
2283
- Leaf2.prototype = Object.create(RopeSequence3.prototype);
2337
+ if (RopeSequence3) Leaf2.__proto__ = RopeSequence3;
2338
+ Leaf2.prototype = Object.create(RopeSequence3 && RopeSequence3.prototype);
2284
2339
  Leaf2.prototype.constructor = Leaf2;
2285
2340
  var prototypeAccessors = { length: { configurable: true }, depth: { configurable: true } };
2286
2341
  Leaf2.prototype.flatten = function flatten() {
@@ -2327,9 +2382,9 @@ var Leaf = /* @__PURE__ */ function(RopeSequence3) {
2327
2382
  };
2328
2383
  Object.defineProperties(Leaf2.prototype, prototypeAccessors);
2329
2384
  return Leaf2;
2330
- }(RopeSequence);
2385
+ })(RopeSequence);
2331
2386
  RopeSequence.empty = new Leaf([]);
2332
- var Append = /* @__PURE__ */ function(RopeSequence3) {
2387
+ var Append = /* @__PURE__ */ (function(RopeSequence3) {
2333
2388
  function Append2(left, right) {
2334
2389
  RopeSequence3.call(this);
2335
2390
  this.left = left;
@@ -2337,8 +2392,8 @@ var Append = /* @__PURE__ */ function(RopeSequence3) {
2337
2392
  this.length = left.length + right.length;
2338
2393
  this.depth = Math.max(left.depth, right.depth) + 1;
2339
2394
  }
2340
- Append2.__proto__ = RopeSequence3;
2341
- Append2.prototype = Object.create(RopeSequence3.prototype);
2395
+ if (RopeSequence3) Append2.__proto__ = RopeSequence3;
2396
+ Append2.prototype = Object.create(RopeSequence3 && RopeSequence3.prototype);
2342
2397
  Append2.prototype.constructor = Append2;
2343
2398
  Append2.prototype.flatten = function flatten() {
2344
2399
  return this.left.flatten().concat(this.right.flatten());
@@ -2396,7 +2451,7 @@ var Append = /* @__PURE__ */ function(RopeSequence3) {
2396
2451
  return new Append2(this, other);
2397
2452
  };
2398
2453
  return Append2;
2399
- }(RopeSequence);
2454
+ })(RopeSequence);
2400
2455
  const max_empty_items = 500;
2401
2456
  class Branch {
2402
2457
  constructor(items, eventCount) {
@@ -3018,13 +3073,15 @@ var TrailingNode = Extension.create({
3018
3073
  name: "trailingNode",
3019
3074
  addOptions() {
3020
3075
  return {
3021
- node: "paragraph",
3076
+ node: void 0,
3022
3077
  notAfter: []
3023
3078
  };
3024
3079
  },
3025
3080
  addProseMirrorPlugins() {
3081
+ var _a;
3026
3082
  const plugin = new PluginKey(this.name);
3027
- const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(this.options.node).includes(node.name));
3083
+ const defaultNode = ((_a = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : _a.name) || this.options.node || "paragraph";
3084
+ const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(defaultNode).includes(node.name));
3028
3085
  return [
3029
3086
  new Plugin({
3030
3087
  key: plugin,
@@ -3032,7 +3089,7 @@ var TrailingNode = Extension.create({
3032
3089
  const { doc, tr: tr2, schema } = state;
3033
3090
  const shouldInsertNodeAtEnd = plugin.getState(state);
3034
3091
  const endPosition = doc.content.size;
3035
- const type = schema.nodes[this.options.node];
3092
+ const type = schema.nodes[defaultNode];
3036
3093
  if (!shouldInsertNodeAtEnd) {
3037
3094
  return;
3038
3095
  }
@@ -3047,6 +3104,9 @@ var TrailingNode = Extension.create({
3047
3104
  if (!tr2.docChanged) {
3048
3105
  return value;
3049
3106
  }
3107
+ if (tr2.getMeta("__uniqueIDTransaction")) {
3108
+ return value;
3109
+ }
3050
3110
  const lastNode = tr2.doc.lastChild;
3051
3111
  return !nodeEqualsType({ node: lastNode, types: disabledNodes });
3052
3112
  }
@@ -3117,6 +3177,30 @@ var Blockquote = Node3.create({
3117
3177
  renderHTML({ HTMLAttributes }) {
3118
3178
  return /* @__PURE__ */ h("blockquote", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ h("slot", {}) });
3119
3179
  },
3180
+ parseMarkdown: (token, helpers) => {
3181
+ return helpers.createNode("blockquote", void 0, helpers.parseChildren(token.tokens || []));
3182
+ },
3183
+ renderMarkdown: (node, h2) => {
3184
+ if (!node.content) {
3185
+ return "";
3186
+ }
3187
+ const prefix = ">";
3188
+ const result = [];
3189
+ node.content.forEach((child) => {
3190
+ const childContent = h2.renderChildren([child]);
3191
+ const lines = childContent.split("\n");
3192
+ const linesWithPrefix = lines.map((line) => {
3193
+ if (line.trim() === "") {
3194
+ return prefix;
3195
+ }
3196
+ return `${prefix} ${line}`;
3197
+ });
3198
+ result.push(linesWithPrefix.join("\n"));
3199
+ });
3200
+ return result.join(`
3201
+ ${prefix}
3202
+ `);
3203
+ },
3120
3204
  addCommands() {
3121
3205
  return {
3122
3206
  setBlockquote: () => ({ commands }) => {
@@ -3177,6 +3261,13 @@ var Bold = Mark.create({
3177
3261
  renderHTML({ HTMLAttributes }) {
3178
3262
  return /* @__PURE__ */ h("strong", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ h("slot", {}) });
3179
3263
  },
3264
+ markdownTokenName: "strong",
3265
+ parseMarkdown: (token, helpers) => {
3266
+ return helpers.applyMark("bold", helpers.parseInline(token.tokens || []));
3267
+ },
3268
+ renderMarkdown: (node, h2) => {
3269
+ return `**${h2.renderChildren(node)}**`;
3270
+ },
3180
3271
  addCommands() {
3181
3272
  return {
3182
3273
  setBold: () => ({ commands }) => {
@@ -3221,7 +3312,7 @@ var Bold = Mark.create({
3221
3312
  ];
3222
3313
  }
3223
3314
  });
3224
- var inputRegex$2 = /(^|[^`])`([^`]+)`(?!`)/;
3315
+ var inputRegex$2 = /(^|[^`])`([^`]+)`(?!`)$/;
3225
3316
  var pasteRegex$1 = /(^|[^`])`([^`]+)`(?!`)/g;
3226
3317
  var Code = Mark.create({
3227
3318
  name: "code",
@@ -3239,6 +3330,16 @@ var Code = Mark.create({
3239
3330
  renderHTML({ HTMLAttributes }) {
3240
3331
  return ["code", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3241
3332
  },
3333
+ markdownTokenName: "codespan",
3334
+ parseMarkdown: (token, helpers) => {
3335
+ return helpers.applyMark("code", [{ type: "text", text: token.text || "" }]);
3336
+ },
3337
+ renderMarkdown: (node, h2) => {
3338
+ if (!node.content) {
3339
+ return "";
3340
+ }
3341
+ return `\`${h2.renderChildren(node.content)}\``;
3342
+ },
3242
3343
  addCommands() {
3243
3344
  return {
3244
3345
  setCode: () => ({ commands }) => {
@@ -3274,6 +3375,7 @@ var Code = Mark.create({
3274
3375
  ];
3275
3376
  }
3276
3377
  });
3378
+ var DEFAULT_TAB_SIZE = 4;
3277
3379
  var backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
3278
3380
  var tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
3279
3381
  var CodeBlock = Node3.create({
@@ -3284,6 +3386,8 @@ var CodeBlock = Node3.create({
3284
3386
  exitOnTripleEnter: true,
3285
3387
  exitOnArrowDown: true,
3286
3388
  defaultLanguage: null,
3389
+ enableTabIndentation: false,
3390
+ tabSize: DEFAULT_TAB_SIZE,
3287
3391
  HTMLAttributes: {}
3288
3392
  };
3289
3393
  },
@@ -3299,6 +3403,9 @@ var CodeBlock = Node3.create({
3299
3403
  parseHTML: (element) => {
3300
3404
  var _a;
3301
3405
  const { languageClassPrefix } = this.options;
3406
+ if (!languageClassPrefix) {
3407
+ return null;
3408
+ }
3302
3409
  const classNames = [...((_a = element.firstElementChild) == null ? void 0 : _a.classList) || []];
3303
3410
  const languages = classNames.filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, ""));
3304
3411
  const language = languages[0];
@@ -3332,6 +3439,32 @@ var CodeBlock = Node3.create({
3332
3439
  ]
3333
3440
  ];
3334
3441
  },
3442
+ markdownTokenName: "code",
3443
+ parseMarkdown: (token, helpers) => {
3444
+ var _a;
3445
+ if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
3446
+ return [];
3447
+ }
3448
+ return helpers.createNode(
3449
+ "codeBlock",
3450
+ { language: token.lang || null },
3451
+ token.text ? [helpers.createTextNode(token.text)] : []
3452
+ );
3453
+ },
3454
+ renderMarkdown: (node, h2) => {
3455
+ var _a;
3456
+ let output = "";
3457
+ const language = ((_a = node.attrs) == null ? void 0 : _a.language) || "";
3458
+ if (!node.content) {
3459
+ output = `\`\`\`${language}
3460
+
3461
+ \`\`\``;
3462
+ } else {
3463
+ const lines = [`\`\`\`${language}`, h2.renderChildren(node.content), "```"];
3464
+ output = lines.join("\n");
3465
+ }
3466
+ return output;
3467
+ },
3335
3468
  addCommands() {
3336
3469
  return {
3337
3470
  setCodeBlock: (attributes) => ({ commands }) => {
@@ -3357,6 +3490,95 @@ var CodeBlock = Node3.create({
3357
3490
  }
3358
3491
  return false;
3359
3492
  },
3493
+ // handle tab indentation
3494
+ Tab: ({ editor }) => {
3495
+ var _a;
3496
+ if (!this.options.enableTabIndentation) {
3497
+ return false;
3498
+ }
3499
+ const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
3500
+ const { state } = editor;
3501
+ const { selection } = state;
3502
+ const { $from, empty } = selection;
3503
+ if ($from.parent.type !== this.type) {
3504
+ return false;
3505
+ }
3506
+ const indent = " ".repeat(tabSize);
3507
+ if (empty) {
3508
+ return editor.commands.insertContent(indent);
3509
+ }
3510
+ return editor.commands.command(({ tr: tr2 }) => {
3511
+ const { from: from2, to } = selection;
3512
+ const text = state.doc.textBetween(from2, to, "\n", "\n");
3513
+ const lines = text.split("\n");
3514
+ const indentedText = lines.map((line) => indent + line).join("\n");
3515
+ tr2.replaceWith(from2, to, state.schema.text(indentedText));
3516
+ return true;
3517
+ });
3518
+ },
3519
+ // handle shift+tab reverse indentation
3520
+ "Shift-Tab": ({ editor }) => {
3521
+ var _a;
3522
+ if (!this.options.enableTabIndentation) {
3523
+ return false;
3524
+ }
3525
+ const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
3526
+ const { state } = editor;
3527
+ const { selection } = state;
3528
+ const { $from, empty } = selection;
3529
+ if ($from.parent.type !== this.type) {
3530
+ return false;
3531
+ }
3532
+ if (empty) {
3533
+ return editor.commands.command(({ tr: tr2 }) => {
3534
+ var _a2;
3535
+ const { pos } = $from;
3536
+ const codeBlockStart = $from.start();
3537
+ const codeBlockEnd = $from.end();
3538
+ const allText = state.doc.textBetween(codeBlockStart, codeBlockEnd, "\n", "\n");
3539
+ const lines = allText.split("\n");
3540
+ let currentLineIndex = 0;
3541
+ let charCount = 0;
3542
+ const relativeCursorPos = pos - codeBlockStart;
3543
+ for (let i = 0; i < lines.length; i += 1) {
3544
+ if (charCount + lines[i].length >= relativeCursorPos) {
3545
+ currentLineIndex = i;
3546
+ break;
3547
+ }
3548
+ charCount += lines[i].length + 1;
3549
+ }
3550
+ const currentLine = lines[currentLineIndex];
3551
+ const leadingSpaces = ((_a2 = currentLine.match(/^ */)) == null ? void 0 : _a2[0]) || "";
3552
+ const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
3553
+ if (spacesToRemove === 0) {
3554
+ return true;
3555
+ }
3556
+ let lineStartPos = codeBlockStart;
3557
+ for (let i = 0; i < currentLineIndex; i += 1) {
3558
+ lineStartPos += lines[i].length + 1;
3559
+ }
3560
+ tr2.delete(lineStartPos, lineStartPos + spacesToRemove);
3561
+ const cursorPosInLine = pos - lineStartPos;
3562
+ if (cursorPosInLine <= spacesToRemove) {
3563
+ tr2.setSelection(TextSelection.create(tr2.doc, lineStartPos));
3564
+ }
3565
+ return true;
3566
+ });
3567
+ }
3568
+ return editor.commands.command(({ tr: tr2 }) => {
3569
+ const { from: from2, to } = selection;
3570
+ const text = state.doc.textBetween(from2, to, "\n", "\n");
3571
+ const lines = text.split("\n");
3572
+ const reverseIndentText = lines.map((line) => {
3573
+ var _a2;
3574
+ const leadingSpaces = ((_a2 = line.match(/^ */)) == null ? void 0 : _a2[0]) || "";
3575
+ const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
3576
+ return line.slice(spacesToRemove);
3577
+ }).join("\n");
3578
+ tr2.replaceWith(from2, to, state.schema.text(reverseIndentText));
3579
+ return true;
3580
+ });
3581
+ },
3360
3582
  // exit node on triple enter
3361
3583
  Enter: ({ editor }) => {
3362
3584
  if (!this.options.exitOnTripleEnter) {
@@ -3465,10 +3687,17 @@ var CodeBlock = Node3.create({
3465
3687
  var Document = Node3.create({
3466
3688
  name: "doc",
3467
3689
  topNode: true,
3468
- content: "block+"
3690
+ content: "block+",
3691
+ renderMarkdown: (node, h2) => {
3692
+ if (!node.content) {
3693
+ return "";
3694
+ }
3695
+ return h2.renderChildren(node.content, "\n\n");
3696
+ }
3469
3697
  });
3470
3698
  var HardBreak = Node3.create({
3471
3699
  name: "hardBreak",
3700
+ markdownTokenName: "br",
3472
3701
  addOptions() {
3473
3702
  return {
3474
3703
  keepMarks: true,
@@ -3488,6 +3717,13 @@ var HardBreak = Node3.create({
3488
3717
  renderText() {
3489
3718
  return "\n";
3490
3719
  },
3720
+ renderMarkdown: () => `
3721
+ `,
3722
+ parseMarkdown: () => {
3723
+ return {
3724
+ type: "hardBreak"
3725
+ };
3726
+ },
3491
3727
  addCommands() {
3492
3728
  return {
3493
3729
  setHardBreak: () => ({ commands, chain, state, editor }) => {
@@ -3550,6 +3786,18 @@ var Heading = Node3.create({
3550
3786
  const level = hasLevel ? node.attrs.level : this.options.levels[0];
3551
3787
  return [`h${level}`, mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3552
3788
  },
3789
+ parseMarkdown: (token, helpers) => {
3790
+ return helpers.createNode("heading", { level: token.depth || 1 }, helpers.parseInline(token.tokens || []));
3791
+ },
3792
+ renderMarkdown: (node, h2) => {
3793
+ var _a;
3794
+ const level = ((_a = node.attrs) == null ? void 0 : _a.level) ? parseInt(node.attrs.level, 10) : 1;
3795
+ const headingChars = "#".repeat(level);
3796
+ if (!node.content) {
3797
+ return "";
3798
+ }
3799
+ return `${headingChars} ${h2.renderChildren(node.content)}`;
3800
+ },
3553
3801
  addCommands() {
3554
3802
  return {
3555
3803
  setHeading: (attributes) => ({ commands }) => {
@@ -3593,7 +3841,8 @@ var HorizontalRule = Node3.create({
3593
3841
  name: "horizontalRule",
3594
3842
  addOptions() {
3595
3843
  return {
3596
- HTMLAttributes: {}
3844
+ HTMLAttributes: {},
3845
+ nextNodeType: "paragraph"
3597
3846
  };
3598
3847
  },
3599
3848
  group: "block",
@@ -3603,6 +3852,13 @@ var HorizontalRule = Node3.create({
3603
3852
  renderHTML({ HTMLAttributes }) {
3604
3853
  return ["hr", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
3605
3854
  },
3855
+ markdownTokenName: "hr",
3856
+ parseMarkdown: (token, helpers) => {
3857
+ return helpers.createNode("horizontalRule");
3858
+ },
3859
+ renderMarkdown: () => {
3860
+ return "---";
3861
+ },
3606
3862
  addCommands() {
3607
3863
  return {
3608
3864
  setHorizontalRule: () => ({ chain, state }) => {
@@ -3619,8 +3875,7 @@ var HorizontalRule = Node3.create({
3619
3875
  } else {
3620
3876
  currentChain.insertContent({ type: this.name });
3621
3877
  }
3622
- return currentChain.command(({ tr: tr2, dispatch }) => {
3623
- var _a;
3878
+ return currentChain.command(({ state: chainState, tr: tr2, dispatch }) => {
3624
3879
  if (dispatch) {
3625
3880
  const { $to } = tr2.selection;
3626
3881
  const posAfter = $to.end();
@@ -3633,7 +3888,8 @@ var HorizontalRule = Node3.create({
3633
3888
  tr2.setSelection(TextSelection.create(tr2.doc, $to.pos));
3634
3889
  }
3635
3890
  } else {
3636
- const node = (_a = $to.parent.type.contentMatch.defaultType) == null ? void 0 : _a.create();
3891
+ const nodeType = chainState.schema.nodes[this.options.nextNodeType] || $to.parent.type.contentMatch.defaultType;
3892
+ const node = nodeType == null ? void 0 : nodeType.create();
3637
3893
  if (node) {
3638
3894
  tr2.insert(posAfter, node);
3639
3895
  tr2.setSelection(TextSelection.create(tr2.doc, posAfter + 1));
@@ -3700,6 +3956,13 @@ var Italic = Mark.create({
3700
3956
  }
3701
3957
  };
3702
3958
  },
3959
+ markdownTokenName: "em",
3960
+ parseMarkdown: (token, helpers) => {
3961
+ return helpers.applyMark("italic", helpers.parseInline(token.tokens || []));
3962
+ },
3963
+ renderMarkdown: (node, h2) => {
3964
+ return `*${h2.renderChildren(node)}*`;
3965
+ },
3703
3966
  addKeyboardShortcuts() {
3704
3967
  return {
3705
3968
  "Mod-i": () => this.editor.commands.toggleItalic(),
@@ -3759,6 +4022,25 @@ var BulletList = Node3.create({
3759
4022
  renderHTML({ HTMLAttributes }) {
3760
4023
  return ["ul", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3761
4024
  },
4025
+ markdownTokenName: "list",
4026
+ parseMarkdown: (token, helpers) => {
4027
+ if (token.type !== "list" || token.ordered) {
4028
+ return [];
4029
+ }
4030
+ return {
4031
+ type: "bulletList",
4032
+ content: token.items ? helpers.parseChildren(token.items) : []
4033
+ };
4034
+ },
4035
+ renderMarkdown: (node, h2) => {
4036
+ if (!node.content) {
4037
+ return "";
4038
+ }
4039
+ return h2.renderChildren(node.content, "\n");
4040
+ },
4041
+ markdownOptions: {
4042
+ indentsContent: true
4043
+ },
3762
4044
  addCommands() {
3763
4045
  return {
3764
4046
  toggleBulletList: () => ({ commands, chain }) => {
@@ -3815,6 +4097,65 @@ var ListItem = Node3.create({
3815
4097
  renderHTML({ HTMLAttributes }) {
3816
4098
  return ["li", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3817
4099
  },
4100
+ markdownTokenName: "list_item",
4101
+ parseMarkdown: (token, helpers) => {
4102
+ if (token.type !== "list_item") {
4103
+ return [];
4104
+ }
4105
+ let content = [];
4106
+ if (token.tokens && token.tokens.length > 0) {
4107
+ const hasParagraphTokens = token.tokens.some((t) => t.type === "paragraph");
4108
+ if (hasParagraphTokens) {
4109
+ content = helpers.parseChildren(token.tokens);
4110
+ } else {
4111
+ const firstToken = token.tokens[0];
4112
+ if (firstToken && firstToken.type === "text" && firstToken.tokens && firstToken.tokens.length > 0) {
4113
+ const inlineContent = helpers.parseInline(firstToken.tokens);
4114
+ content = [
4115
+ {
4116
+ type: "paragraph",
4117
+ content: inlineContent
4118
+ }
4119
+ ];
4120
+ if (token.tokens.length > 1) {
4121
+ const remainingTokens = token.tokens.slice(1);
4122
+ const additionalContent = helpers.parseChildren(remainingTokens);
4123
+ content.push(...additionalContent);
4124
+ }
4125
+ } else {
4126
+ content = helpers.parseChildren(token.tokens);
4127
+ }
4128
+ }
4129
+ }
4130
+ if (content.length === 0) {
4131
+ content = [
4132
+ {
4133
+ type: "paragraph",
4134
+ content: []
4135
+ }
4136
+ ];
4137
+ }
4138
+ return {
4139
+ type: "listItem",
4140
+ content
4141
+ };
4142
+ },
4143
+ renderMarkdown: (node, h2, ctx) => {
4144
+ return renderNestedMarkdownContent(
4145
+ node,
4146
+ h2,
4147
+ (context) => {
4148
+ if (context.parentType === "bulletList") {
4149
+ return "- ";
4150
+ }
4151
+ if (context.parentType === "orderedList") {
4152
+ return `${context.index + 1}. `;
4153
+ }
4154
+ return "- ";
4155
+ },
4156
+ ctx
4157
+ );
4158
+ },
3818
4159
  addKeyboardShortcuts() {
3819
4160
  return {
3820
4161
  Enter: () => this.editor.commands.splitListItem(this.name),
@@ -4063,6 +4404,134 @@ var ListKeymap = Extension.create({
4063
4404
  };
4064
4405
  }
4065
4406
  });
4407
+ var ORDERED_LIST_ITEM_REGEX = /^(\s*)(\d+)\.\s+(.*)$/;
4408
+ var INDENTED_LINE_REGEX = /^\s/;
4409
+ function collectOrderedListItems(lines) {
4410
+ const listItems = [];
4411
+ let currentLineIndex = 0;
4412
+ let consumed = 0;
4413
+ while (currentLineIndex < lines.length) {
4414
+ const line = lines[currentLineIndex];
4415
+ const match = line.match(ORDERED_LIST_ITEM_REGEX);
4416
+ if (!match) {
4417
+ break;
4418
+ }
4419
+ const [, indent, number, content] = match;
4420
+ const indentLevel = indent.length;
4421
+ let itemContent = content;
4422
+ let nextLineIndex = currentLineIndex + 1;
4423
+ const itemLines = [line];
4424
+ while (nextLineIndex < lines.length) {
4425
+ const nextLine = lines[nextLineIndex];
4426
+ const nextMatch = nextLine.match(ORDERED_LIST_ITEM_REGEX);
4427
+ if (nextMatch) {
4428
+ break;
4429
+ }
4430
+ if (nextLine.trim() === "") {
4431
+ itemLines.push(nextLine);
4432
+ itemContent += "\n";
4433
+ nextLineIndex += 1;
4434
+ } else if (nextLine.match(INDENTED_LINE_REGEX)) {
4435
+ itemLines.push(nextLine);
4436
+ itemContent += `
4437
+ ${nextLine.slice(indentLevel + 2)}`;
4438
+ nextLineIndex += 1;
4439
+ } else {
4440
+ break;
4441
+ }
4442
+ }
4443
+ listItems.push({
4444
+ indent: indentLevel,
4445
+ number: parseInt(number, 10),
4446
+ content: itemContent.trim(),
4447
+ raw: itemLines.join("\n")
4448
+ });
4449
+ consumed = nextLineIndex;
4450
+ currentLineIndex = nextLineIndex;
4451
+ }
4452
+ return [listItems, consumed];
4453
+ }
4454
+ function buildNestedStructure(items, baseIndent, lexer) {
4455
+ var _a;
4456
+ const result = [];
4457
+ let currentIndex = 0;
4458
+ while (currentIndex < items.length) {
4459
+ const item = items[currentIndex];
4460
+ if (item.indent === baseIndent) {
4461
+ const contentLines = item.content.split("\n");
4462
+ const mainText = ((_a = contentLines[0]) == null ? void 0 : _a.trim()) || "";
4463
+ const tokens = [];
4464
+ if (mainText) {
4465
+ tokens.push({
4466
+ type: "paragraph",
4467
+ raw: mainText,
4468
+ tokens: lexer.inlineTokens(mainText)
4469
+ });
4470
+ }
4471
+ const additionalContent = contentLines.slice(1).join("\n").trim();
4472
+ if (additionalContent) {
4473
+ const blockTokens = lexer.blockTokens(additionalContent);
4474
+ tokens.push(...blockTokens);
4475
+ }
4476
+ let lookAheadIndex = currentIndex + 1;
4477
+ const nestedItems = [];
4478
+ while (lookAheadIndex < items.length && items[lookAheadIndex].indent > baseIndent) {
4479
+ nestedItems.push(items[lookAheadIndex]);
4480
+ lookAheadIndex += 1;
4481
+ }
4482
+ if (nestedItems.length > 0) {
4483
+ const nextIndent = Math.min(...nestedItems.map((nestedItem) => nestedItem.indent));
4484
+ const nestedListItems = buildNestedStructure(nestedItems, nextIndent, lexer);
4485
+ tokens.push({
4486
+ type: "list",
4487
+ ordered: true,
4488
+ start: nestedItems[0].number,
4489
+ items: nestedListItems,
4490
+ raw: nestedItems.map((nestedItem) => nestedItem.raw).join("\n")
4491
+ });
4492
+ }
4493
+ result.push({
4494
+ type: "list_item",
4495
+ raw: item.raw,
4496
+ tokens
4497
+ });
4498
+ currentIndex = lookAheadIndex;
4499
+ } else {
4500
+ currentIndex += 1;
4501
+ }
4502
+ }
4503
+ return result;
4504
+ }
4505
+ function parseListItems(items, helpers) {
4506
+ return items.map((item) => {
4507
+ if (item.type !== "list_item") {
4508
+ return helpers.parseChildren([item])[0];
4509
+ }
4510
+ const content = [];
4511
+ if (item.tokens && item.tokens.length > 0) {
4512
+ item.tokens.forEach((itemToken) => {
4513
+ if (itemToken.type === "paragraph" || itemToken.type === "list" || itemToken.type === "blockquote" || itemToken.type === "code") {
4514
+ content.push(...helpers.parseChildren([itemToken]));
4515
+ } else if (itemToken.type === "text" && itemToken.tokens) {
4516
+ const inlineContent = helpers.parseChildren([itemToken]);
4517
+ content.push({
4518
+ type: "paragraph",
4519
+ content: inlineContent
4520
+ });
4521
+ } else {
4522
+ const parsed = helpers.parseChildren([itemToken]);
4523
+ if (parsed.length > 0) {
4524
+ content.push(...parsed);
4525
+ }
4526
+ }
4527
+ });
4528
+ }
4529
+ return {
4530
+ type: "listItem",
4531
+ content
4532
+ };
4533
+ });
4534
+ }
4066
4535
  var ListItemName2 = "listItem";
4067
4536
  var TextStyleName2 = "textStyle";
4068
4537
  var orderedListInputRegex = /^(\d+)\.\s$/;
@@ -4105,6 +4574,63 @@ var OrderedList = Node3.create({
4105
4574
  const { start, ...attributesWithoutStart } = HTMLAttributes;
4106
4575
  return start === 1 ? ["ol", mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4107
4576
  },
4577
+ markdownTokenName: "list",
4578
+ parseMarkdown: (token, helpers) => {
4579
+ if (token.type !== "list" || !token.ordered) {
4580
+ return [];
4581
+ }
4582
+ const startValue = token.start || 1;
4583
+ const content = token.items ? parseListItems(token.items, helpers) : [];
4584
+ if (startValue !== 1) {
4585
+ return {
4586
+ type: "orderedList",
4587
+ attrs: { start: startValue },
4588
+ content
4589
+ };
4590
+ }
4591
+ return {
4592
+ type: "orderedList",
4593
+ content
4594
+ };
4595
+ },
4596
+ renderMarkdown: (node, h2) => {
4597
+ if (!node.content) {
4598
+ return "";
4599
+ }
4600
+ return h2.renderChildren(node.content, "\n");
4601
+ },
4602
+ markdownTokenizer: {
4603
+ name: "orderedList",
4604
+ level: "block",
4605
+ start: (src) => {
4606
+ const match = src.match(/^(\s*)(\d+)\.\s+/);
4607
+ const index = match == null ? void 0 : match.index;
4608
+ return index !== void 0 ? index : -1;
4609
+ },
4610
+ tokenize: (src, _tokens, lexer) => {
4611
+ var _a;
4612
+ const lines = src.split("\n");
4613
+ const [listItems, consumed] = collectOrderedListItems(lines);
4614
+ if (listItems.length === 0) {
4615
+ return void 0;
4616
+ }
4617
+ const items = buildNestedStructure(listItems, 0, lexer);
4618
+ if (items.length === 0) {
4619
+ return void 0;
4620
+ }
4621
+ const startValue = ((_a = listItems[0]) == null ? void 0 : _a.number) || 1;
4622
+ return {
4623
+ type: "list",
4624
+ ordered: true,
4625
+ start: startValue,
4626
+ items,
4627
+ raw: lines.slice(0, consumed).join("\n")
4628
+ };
4629
+ }
4630
+ },
4631
+ markdownOptions: {
4632
+ indentsContent: true
4633
+ },
4108
4634
  addCommands() {
4109
4635
  return {
4110
4636
  toggleOrderedList: () => ({ commands, chain }) => {
@@ -4199,6 +4725,27 @@ var TaskItem = Node3.create({
4199
4725
  ["div", 0]
4200
4726
  ];
4201
4727
  },
4728
+ parseMarkdown: (token, h2) => {
4729
+ const content = [];
4730
+ if (token.tokens && token.tokens.length > 0) {
4731
+ content.push(h2.createNode("paragraph", {}, h2.parseInline(token.tokens)));
4732
+ } else if (token.text) {
4733
+ content.push(h2.createNode("paragraph", {}, [h2.createNode("text", { text: token.text })]));
4734
+ } else {
4735
+ content.push(h2.createNode("paragraph", {}, []));
4736
+ }
4737
+ if (token.nestedTokens && token.nestedTokens.length > 0) {
4738
+ const nestedContent = h2.parseChildren(token.nestedTokens);
4739
+ content.push(...nestedContent);
4740
+ }
4741
+ return h2.createNode("taskItem", { checked: token.checked || false }, content);
4742
+ },
4743
+ renderMarkdown: (node, h2) => {
4744
+ var _a;
4745
+ const checkedChar = ((_a = node.attrs) == null ? void 0 : _a.checked) ? "x" : " ";
4746
+ const prefix = `- [${checkedChar}] `;
4747
+ return renderNestedMarkdownContent(node, h2, prefix);
4748
+ },
4202
4749
  addKeyboardShortcuts() {
4203
4750
  const shortcuts = {
4204
4751
  Enter: () => this.editor.commands.splitListItem(this.name),
@@ -4219,11 +4766,11 @@ var TaskItem = Node3.create({
4219
4766
  const checkboxStyler = document.createElement("span");
4220
4767
  const checkbox = document.createElement("input");
4221
4768
  const content = document.createElement("div");
4222
- const updateA11Y = () => {
4769
+ const updateA11Y = (currentNode) => {
4223
4770
  var _a, _b;
4224
- checkbox.ariaLabel = ((_b = (_a = this.options.a11y) == null ? void 0 : _a.checkboxLabel) == null ? void 0 : _b.call(_a, node, checkbox.checked)) || `Task item checkbox for ${node.textContent || "empty task item"}`;
4771
+ checkbox.ariaLabel = ((_b = (_a = this.options.a11y) == null ? void 0 : _a.checkboxLabel) == null ? void 0 : _b.call(_a, currentNode, checkbox.checked)) || `Task item checkbox for ${currentNode.textContent || "empty task item"}`;
4225
4772
  };
4226
- updateA11Y();
4773
+ updateA11Y(node);
4227
4774
  checkboxWrapper.contentEditable = "false";
4228
4775
  checkbox.type = "checkbox";
4229
4776
  checkbox.addEventListener("mousedown", (event) => event.preventDefault());
@@ -4272,7 +4819,7 @@ var TaskItem = Node3.create({
4272
4819
  }
4273
4820
  listItem.dataset.checked = updatedNode.attrs.checked;
4274
4821
  checkbox.checked = updatedNode.attrs.checked;
4275
- updateA11Y();
4822
+ updateA11Y(updatedNode);
4276
4823
  return true;
4277
4824
  }
4278
4825
  };
@@ -4313,6 +4860,97 @@ var TaskList = Node3.create({
4313
4860
  renderHTML({ HTMLAttributes }) {
4314
4861
  return ["ul", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { "data-type": this.name }), 0];
4315
4862
  },
4863
+ parseMarkdown: (token, h2) => {
4864
+ return h2.createNode("taskList", {}, h2.parseChildren(token.items || []));
4865
+ },
4866
+ renderMarkdown: (node, h2) => {
4867
+ if (!node.content) {
4868
+ return "";
4869
+ }
4870
+ return h2.renderChildren(node.content, "\n");
4871
+ },
4872
+ markdownTokenizer: {
4873
+ name: "taskList",
4874
+ level: "block",
4875
+ start(src) {
4876
+ var _a;
4877
+ const index = (_a = src.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)) == null ? void 0 : _a.index;
4878
+ return index !== void 0 ? index : -1;
4879
+ },
4880
+ tokenize(src, tokens, lexer) {
4881
+ const parseTaskListContent = (content) => {
4882
+ const nestedResult = parseIndentedBlocks(
4883
+ content,
4884
+ {
4885
+ itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
4886
+ extractItemData: (match) => ({
4887
+ indentLevel: match[1].length,
4888
+ mainContent: match[4],
4889
+ checked: match[3].toLowerCase() === "x"
4890
+ }),
4891
+ createToken: (data, nestedTokens) => ({
4892
+ type: "taskItem",
4893
+ raw: "",
4894
+ mainContent: data.mainContent,
4895
+ indentLevel: data.indentLevel,
4896
+ checked: data.checked,
4897
+ text: data.mainContent,
4898
+ tokens: lexer.inlineTokens(data.mainContent),
4899
+ nestedTokens
4900
+ }),
4901
+ // Allow recursive nesting
4902
+ customNestedParser: parseTaskListContent
4903
+ },
4904
+ lexer
4905
+ );
4906
+ if (nestedResult) {
4907
+ return [
4908
+ {
4909
+ type: "taskList",
4910
+ raw: nestedResult.raw,
4911
+ items: nestedResult.items
4912
+ }
4913
+ ];
4914
+ }
4915
+ return lexer.blockTokens(content);
4916
+ };
4917
+ const result = parseIndentedBlocks(
4918
+ src,
4919
+ {
4920
+ itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
4921
+ extractItemData: (match) => ({
4922
+ indentLevel: match[1].length,
4923
+ mainContent: match[4],
4924
+ checked: match[3].toLowerCase() === "x"
4925
+ }),
4926
+ createToken: (data, nestedTokens) => ({
4927
+ type: "taskItem",
4928
+ raw: "",
4929
+ mainContent: data.mainContent,
4930
+ indentLevel: data.indentLevel,
4931
+ checked: data.checked,
4932
+ text: data.mainContent,
4933
+ tokens: lexer.inlineTokens(data.mainContent),
4934
+ nestedTokens
4935
+ }),
4936
+ // Use the recursive parser for nested content
4937
+ customNestedParser: parseTaskListContent
4938
+ },
4939
+ lexer
4940
+ );
4941
+ if (!result) {
4942
+ return void 0;
4943
+ }
4944
+ return {
4945
+ type: "taskList",
4946
+ raw: result.raw,
4947
+ items: result.items
4948
+ };
4949
+ }
4950
+ },
4951
+ markdownOptions: {
4952
+ indentsContent: true
4953
+ },
4316
4954
  addCommands() {
4317
4955
  return {
4318
4956
  toggleTaskList: () => ({ commands }) => {
@@ -4367,6 +5005,24 @@ var Paragraph = Node3.create({
4367
5005
  renderHTML({ HTMLAttributes }) {
4368
5006
  return ["p", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4369
5007
  },
5008
+ parseMarkdown: (token, helpers) => {
5009
+ const tokens = token.tokens || [];
5010
+ if (tokens.length === 1 && tokens[0].type === "image") {
5011
+ return helpers.parseChildren([tokens[0]]);
5012
+ }
5013
+ return helpers.createNode(
5014
+ "paragraph",
5015
+ void 0,
5016
+ // no attributes for paragraph
5017
+ helpers.parseInline(tokens)
5018
+ );
5019
+ },
5020
+ renderMarkdown: (node, h2) => {
5021
+ if (!node || !Array.isArray(node.content)) {
5022
+ return "";
5023
+ }
5024
+ return h2.renderChildren(node.content);
5025
+ },
4370
5026
  addCommands() {
4371
5027
  return {
4372
5028
  setParagraph: () => ({ commands }) => {
@@ -4410,6 +5066,13 @@ var Strike = Mark.create({
4410
5066
  renderHTML({ HTMLAttributes }) {
4411
5067
  return ["s", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4412
5068
  },
5069
+ markdownTokenName: "del",
5070
+ parseMarkdown: (token, helpers) => {
5071
+ return helpers.applyMark("strike", helpers.parseInline(token.tokens || []));
5072
+ },
5073
+ renderMarkdown: (node, h2) => {
5074
+ return `~~${h2.renderChildren(node)}~~`;
5075
+ },
4413
5076
  addCommands() {
4414
5077
  return {
4415
5078
  setStrike: () => ({ commands }) => {
@@ -4447,7 +5110,14 @@ var Strike = Mark.create({
4447
5110
  });
4448
5111
  var Text = Node3.create({
4449
5112
  name: "text",
4450
- group: "inline"
5113
+ group: "inline",
5114
+ parseMarkdown: (token) => {
5115
+ return {
5116
+ type: "text",
5117
+ text: token.text || ""
5118
+ };
5119
+ },
5120
+ renderMarkdown: (node) => node.text || ""
4451
5121
  });
4452
5122
  var Underline = Mark.create({
4453
5123
  name: "underline",
@@ -4471,6 +5141,33 @@ var Underline = Mark.create({
4471
5141
  renderHTML({ HTMLAttributes }) {
4472
5142
  return ["u", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4473
5143
  },
5144
+ parseMarkdown(token, helpers) {
5145
+ return helpers.applyMark(this.name || "underline", helpers.parseInline(token.tokens || []));
5146
+ },
5147
+ renderMarkdown(node, helpers) {
5148
+ return `++${helpers.renderChildren(node)}++`;
5149
+ },
5150
+ markdownTokenizer: {
5151
+ name: "underline",
5152
+ level: "inline",
5153
+ start(src) {
5154
+ return src.indexOf("++");
5155
+ },
5156
+ tokenize(src, _tokens, lexer) {
5157
+ const rule = /^(\+\+)([\s\S]+?)(\+\+)/;
5158
+ const match = rule.exec(src);
5159
+ if (!match) {
5160
+ return void 0;
5161
+ }
5162
+ const innerContent = match[2].trim();
5163
+ return {
5164
+ type: "underline",
5165
+ raw: match[0],
5166
+ text: innerContent,
5167
+ tokens: lexer.inlineTokens(innerContent)
5168
+ };
5169
+ }
5170
+ },
4474
5171
  addCommands() {
4475
5172
  return {
4476
5173
  setUnderline: () => ({ commands }) => {