@youcan/celeste 0.6.69 → 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 (324) hide show
  1. package/dist/celeste.css +8 -7
  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 +9 -9
  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 +2 -2
  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
  324. package/src/components/sonner/sonner-alert.vue +3 -1
@@ -1,13 +1,7 @@
1
1
  "use strict";
2
2
  const index = require("./index5.js");
3
- const encodedTlds = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
3
+ const encodedTlds = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2";
4
4
  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";
5
- const assign = (target, properties) => {
6
- for (const key in properties) {
7
- target[key] = properties[key];
8
- }
9
- return target;
10
- };
11
5
  const numeric = "numeric";
12
6
  const ascii = "ascii";
13
7
  const alpha = "alpha";
@@ -197,7 +191,7 @@ State.prototype = {
197
191
  let nextState, templateState = state.go(input);
198
192
  if (templateState) {
199
193
  nextState = new State();
200
- assign(nextState.j, templateState.j);
194
+ Object.assign(nextState.j, templateState.j);
201
195
  nextState.jr.push.apply(nextState.jr, templateState.jr);
202
196
  nextState.jd = templateState.jd;
203
197
  nextState.t = templateState.t;
@@ -207,7 +201,7 @@ State.prototype = {
207
201
  if (t) {
208
202
  if (groups) {
209
203
  if (nextState.t && typeof nextState.t === "string") {
210
- const allFlags = assign(flagsForToken(nextState.t, groups), flags);
204
+ const allFlags = Object.assign(flagsForToken(nextState.t, groups), flags);
211
205
  addToGroups(t, allFlags, groups);
212
206
  } else if (flags) {
213
207
  addToGroups(t, flags, groups);
@@ -506,7 +500,7 @@ function init$2(customSchemes = []) {
506
500
  Start.jd = new State(SYM);
507
501
  return {
508
502
  start: Start,
509
- tokens: assign({
503
+ tokens: Object.assign({
510
504
  groups
511
505
  }, tk)
512
506
  };
@@ -626,9 +620,9 @@ const defaults = {
626
620
  render: null
627
621
  };
628
622
  function Options(opts, defaultRender = null) {
629
- let o = assign({}, defaults);
623
+ let o = Object.assign({}, defaults);
630
624
  if (opts) {
631
- o = assign(o, opts instanceof Options ? opts.o : opts);
625
+ o = Object.assign(o, opts instanceof Options ? opts.o : opts);
632
626
  }
633
627
  const ignoredTags = o.ignoreTags;
634
628
  const uppercaseIgnoredTags = [];
@@ -845,7 +839,7 @@ MultiToken.prototype = {
845
839
  attributes.rel = rel;
846
840
  }
847
841
  if (attrs) {
848
- assign(attributes, attrs);
842
+ Object.assign(attributes, attrs);
849
843
  }
850
844
  return {
851
845
  tagName,
@@ -1287,7 +1281,8 @@ function pasteHandler(options) {
1287
1281
  return new index.Plugin({
1288
1282
  key: new index.PluginKey("handlePasteLink"),
1289
1283
  props: {
1290
- handlePaste: (view, event, slice2) => {
1284
+ handlePaste: (view, _event, slice2) => {
1285
+ const { shouldAutoLink } = options;
1291
1286
  const { state } = view;
1292
1287
  const { selection } = state;
1293
1288
  const { empty } = selection;
@@ -1301,7 +1296,7 @@ function pasteHandler(options) {
1301
1296
  const link = find(textContent, { defaultProtocol: options.defaultProtocol }).find(
1302
1297
  (item) => item.isLink && item.value === textContent
1303
1298
  );
1304
- if (!textContent || !link) {
1299
+ if (!textContent || !link || shouldAutoLink !== void 0 && !shouldAutoLink(link.href)) {
1305
1300
  return false;
1306
1301
  }
1307
1302
  return options.editor.commands.setMark(options.type, {
@@ -1418,6 +1413,19 @@ var Link = index.Mark.create({
1418
1413
  }
1419
1414
  return ["a", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
1420
1415
  },
1416
+ markdownTokenName: "link",
1417
+ parseMarkdown: (token, helpers) => {
1418
+ return helpers.applyMark("link", helpers.parseInline(token.tokens || []), {
1419
+ href: token.href,
1420
+ title: token.title || null
1421
+ });
1422
+ },
1423
+ renderMarkdown: (node, h2) => {
1424
+ var _a;
1425
+ const href = ((_a = node.attrs) == null ? void 0 : _a.href) || "";
1426
+ const text = h2.renderChildren(node);
1427
+ return `[${text}](${href})`;
1428
+ },
1421
1429
  addCommands() {
1422
1430
  return {
1423
1431
  setLink: (attributes) => ({ chain }) => {
@@ -1462,15 +1470,18 @@ var Link = index.Mark.create({
1462
1470
  })
1463
1471
  );
1464
1472
  if (links.length) {
1465
- links.forEach(
1466
- (link) => foundLinks.push({
1473
+ links.forEach((link) => {
1474
+ if (!this.options.shouldAutoLink(link.value)) {
1475
+ return;
1476
+ }
1477
+ foundLinks.push({
1467
1478
  text: link.value,
1468
1479
  data: {
1469
1480
  href: link.href
1470
1481
  },
1471
1482
  index: link.start
1472
- })
1473
- );
1483
+ });
1484
+ });
1474
1485
  }
1475
1486
  }
1476
1487
  return foundLinks;
@@ -1516,7 +1527,8 @@ var Link = index.Mark.create({
1516
1527
  pasteHandler({
1517
1528
  editor: this.editor,
1518
1529
  defaultProtocol: this.options.defaultProtocol,
1519
- type: this.type
1530
+ type: this.type,
1531
+ shouldAutoLink: this.options.shouldAutoLink
1520
1532
  })
1521
1533
  );
1522
1534
  }
@@ -1561,10 +1573,10 @@ var TextAlign = index.Extension.create({
1561
1573
  if (!this.options.alignments.includes(alignment)) {
1562
1574
  return false;
1563
1575
  }
1564
- return this.options.types.map((type) => commands.updateAttributes(type, { textAlign: alignment })).every((response) => response);
1576
+ return this.options.types.map((type) => commands.updateAttributes(type, { textAlign: alignment })).some((response) => response);
1565
1577
  },
1566
1578
  unsetTextAlign: () => ({ commands }) => {
1567
- return this.options.types.map((type) => commands.resetAttributes(type, "textAlign")).every((response) => response);
1579
+ return this.options.types.map((type) => commands.resetAttributes(type, "textAlign")).some((response) => response);
1568
1580
  },
1569
1581
  toggleTextAlign: (alignment) => ({ editor, commands }) => {
1570
1582
  if (!this.options.alignments.includes(alignment)) {
@@ -1587,11 +1599,26 @@ var TextAlign = index.Extension.create({
1587
1599
  }
1588
1600
  });
1589
1601
  var index_default$1 = TextAlign;
1602
+ var MAX_FIND_CHILD_SPAN_DEPTH = 20;
1603
+ var findChildSpans = (element, depth = 0) => {
1604
+ const childSpans = [];
1605
+ if (!element.children.length || depth > MAX_FIND_CHILD_SPAN_DEPTH) {
1606
+ return childSpans;
1607
+ }
1608
+ Array.from(element.children).forEach((child) => {
1609
+ if (child.tagName === "SPAN") {
1610
+ childSpans.push(child);
1611
+ } else if (child.children.length) {
1612
+ childSpans.push(...findChildSpans(child, depth + 1));
1613
+ }
1614
+ });
1615
+ return childSpans;
1616
+ };
1590
1617
  var mergeNestedSpanStyles = (element) => {
1591
1618
  if (!element.children.length) {
1592
1619
  return;
1593
1620
  }
1594
- const childSpans = element.querySelectorAll("span");
1621
+ const childSpans = findChildSpans(element);
1595
1622
  if (!childSpans) {
1596
1623
  return;
1597
1624
  }
@@ -1668,6 +1695,20 @@ var BackgroundColor = index.Extension.create({
1668
1695
  default: null,
1669
1696
  parseHTML: (element) => {
1670
1697
  var _a;
1698
+ const styleAttr = element.getAttribute("style");
1699
+ if (styleAttr) {
1700
+ const decls = styleAttr.split(";").map((s) => s.trim()).filter(Boolean);
1701
+ for (let i = decls.length - 1; i >= 0; i -= 1) {
1702
+ const parts = decls[i].split(":");
1703
+ if (parts.length >= 2) {
1704
+ const prop = parts[0].trim().toLowerCase();
1705
+ const val = parts.slice(1).join(":").trim();
1706
+ if (prop === "background-color") {
1707
+ return val.replace(/['"]+/g, "");
1708
+ }
1709
+ }
1710
+ }
1711
+ }
1671
1712
  return (_a = element.style.backgroundColor) == null ? void 0 : _a.replace(/['"]+/g, "");
1672
1713
  },
1673
1714
  renderHTML: (attributes) => {
@@ -1710,6 +1751,20 @@ var Color = index.Extension.create({
1710
1751
  default: null,
1711
1752
  parseHTML: (element) => {
1712
1753
  var _a;
1754
+ const styleAttr = element.getAttribute("style");
1755
+ if (styleAttr) {
1756
+ const decls = styleAttr.split(";").map((s) => s.trim()).filter(Boolean);
1757
+ for (let i = decls.length - 1; i >= 0; i -= 1) {
1758
+ const parts = decls[i].split(":");
1759
+ if (parts.length >= 2) {
1760
+ const prop = parts[0].trim().toLowerCase();
1761
+ const val = parts.slice(1).join(":").trim();
1762
+ if (prop === "color") {
1763
+ return val.replace(/['"]+/g, "");
1764
+ }
1765
+ }
1766
+ }
1767
+ }
1713
1768
  return (_a = element.style.color) == null ? void 0 : _a.replace(/['"]+/g, "");
1714
1769
  },
1715
1770
  renderHTML: (attributes) => {
@@ -2275,13 +2330,13 @@ RopeSequence.from = function from(values) {
2275
2330
  }
2276
2331
  return values && values.length ? new Leaf(values) : RopeSequence.empty;
2277
2332
  };
2278
- var Leaf = /* @__PURE__ */ function(RopeSequence3) {
2333
+ var Leaf = /* @__PURE__ */ (function(RopeSequence3) {
2279
2334
  function Leaf2(values) {
2280
2335
  RopeSequence3.call(this);
2281
2336
  this.values = values;
2282
2337
  }
2283
- Leaf2.__proto__ = RopeSequence3;
2284
- Leaf2.prototype = Object.create(RopeSequence3.prototype);
2338
+ if (RopeSequence3) Leaf2.__proto__ = RopeSequence3;
2339
+ Leaf2.prototype = Object.create(RopeSequence3 && RopeSequence3.prototype);
2285
2340
  Leaf2.prototype.constructor = Leaf2;
2286
2341
  var prototypeAccessors = { length: { configurable: true }, depth: { configurable: true } };
2287
2342
  Leaf2.prototype.flatten = function flatten() {
@@ -2328,9 +2383,9 @@ var Leaf = /* @__PURE__ */ function(RopeSequence3) {
2328
2383
  };
2329
2384
  Object.defineProperties(Leaf2.prototype, prototypeAccessors);
2330
2385
  return Leaf2;
2331
- }(RopeSequence);
2386
+ })(RopeSequence);
2332
2387
  RopeSequence.empty = new Leaf([]);
2333
- var Append = /* @__PURE__ */ function(RopeSequence3) {
2388
+ var Append = /* @__PURE__ */ (function(RopeSequence3) {
2334
2389
  function Append2(left, right) {
2335
2390
  RopeSequence3.call(this);
2336
2391
  this.left = left;
@@ -2338,8 +2393,8 @@ var Append = /* @__PURE__ */ function(RopeSequence3) {
2338
2393
  this.length = left.length + right.length;
2339
2394
  this.depth = Math.max(left.depth, right.depth) + 1;
2340
2395
  }
2341
- Append2.__proto__ = RopeSequence3;
2342
- Append2.prototype = Object.create(RopeSequence3.prototype);
2396
+ if (RopeSequence3) Append2.__proto__ = RopeSequence3;
2397
+ Append2.prototype = Object.create(RopeSequence3 && RopeSequence3.prototype);
2343
2398
  Append2.prototype.constructor = Append2;
2344
2399
  Append2.prototype.flatten = function flatten() {
2345
2400
  return this.left.flatten().concat(this.right.flatten());
@@ -2397,7 +2452,7 @@ var Append = /* @__PURE__ */ function(RopeSequence3) {
2397
2452
  return new Append2(this, other);
2398
2453
  };
2399
2454
  return Append2;
2400
- }(RopeSequence);
2455
+ })(RopeSequence);
2401
2456
  const max_empty_items = 500;
2402
2457
  class Branch {
2403
2458
  constructor(items, eventCount) {
@@ -3019,13 +3074,15 @@ var TrailingNode = index.Extension.create({
3019
3074
  name: "trailingNode",
3020
3075
  addOptions() {
3021
3076
  return {
3022
- node: "paragraph",
3077
+ node: void 0,
3023
3078
  notAfter: []
3024
3079
  };
3025
3080
  },
3026
3081
  addProseMirrorPlugins() {
3082
+ var _a;
3027
3083
  const plugin = new index.PluginKey(this.name);
3028
- const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(this.options.node).includes(node.name));
3084
+ const defaultNode = ((_a = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : _a.name) || this.options.node || "paragraph";
3085
+ const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(defaultNode).includes(node.name));
3029
3086
  return [
3030
3087
  new index.Plugin({
3031
3088
  key: plugin,
@@ -3033,7 +3090,7 @@ var TrailingNode = index.Extension.create({
3033
3090
  const { doc, tr: tr2, schema } = state;
3034
3091
  const shouldInsertNodeAtEnd = plugin.getState(state);
3035
3092
  const endPosition = doc.content.size;
3036
- const type = schema.nodes[this.options.node];
3093
+ const type = schema.nodes[defaultNode];
3037
3094
  if (!shouldInsertNodeAtEnd) {
3038
3095
  return;
3039
3096
  }
@@ -3048,6 +3105,9 @@ var TrailingNode = index.Extension.create({
3048
3105
  if (!tr2.docChanged) {
3049
3106
  return value;
3050
3107
  }
3108
+ if (tr2.getMeta("__uniqueIDTransaction")) {
3109
+ return value;
3110
+ }
3051
3111
  const lastNode = tr2.doc.lastChild;
3052
3112
  return !nodeEqualsType({ node: lastNode, types: disabledNodes });
3053
3113
  }
@@ -3118,6 +3178,30 @@ var Blockquote = index.Node3.create({
3118
3178
  renderHTML({ HTMLAttributes }) {
3119
3179
  return /* @__PURE__ */ h("blockquote", { ...index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ h("slot", {}) });
3120
3180
  },
3181
+ parseMarkdown: (token, helpers) => {
3182
+ return helpers.createNode("blockquote", void 0, helpers.parseChildren(token.tokens || []));
3183
+ },
3184
+ renderMarkdown: (node, h2) => {
3185
+ if (!node.content) {
3186
+ return "";
3187
+ }
3188
+ const prefix = ">";
3189
+ const result = [];
3190
+ node.content.forEach((child) => {
3191
+ const childContent = h2.renderChildren([child]);
3192
+ const lines = childContent.split("\n");
3193
+ const linesWithPrefix = lines.map((line) => {
3194
+ if (line.trim() === "") {
3195
+ return prefix;
3196
+ }
3197
+ return `${prefix} ${line}`;
3198
+ });
3199
+ result.push(linesWithPrefix.join("\n"));
3200
+ });
3201
+ return result.join(`
3202
+ ${prefix}
3203
+ `);
3204
+ },
3121
3205
  addCommands() {
3122
3206
  return {
3123
3207
  setBlockquote: () => ({ commands }) => {
@@ -3178,6 +3262,13 @@ var Bold = index.Mark.create({
3178
3262
  renderHTML({ HTMLAttributes }) {
3179
3263
  return /* @__PURE__ */ h("strong", { ...index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ h("slot", {}) });
3180
3264
  },
3265
+ markdownTokenName: "strong",
3266
+ parseMarkdown: (token, helpers) => {
3267
+ return helpers.applyMark("bold", helpers.parseInline(token.tokens || []));
3268
+ },
3269
+ renderMarkdown: (node, h2) => {
3270
+ return `**${h2.renderChildren(node)}**`;
3271
+ },
3181
3272
  addCommands() {
3182
3273
  return {
3183
3274
  setBold: () => ({ commands }) => {
@@ -3222,7 +3313,7 @@ var Bold = index.Mark.create({
3222
3313
  ];
3223
3314
  }
3224
3315
  });
3225
- var inputRegex$2 = /(^|[^`])`([^`]+)`(?!`)/;
3316
+ var inputRegex$2 = /(^|[^`])`([^`]+)`(?!`)$/;
3226
3317
  var pasteRegex$1 = /(^|[^`])`([^`]+)`(?!`)/g;
3227
3318
  var Code = index.Mark.create({
3228
3319
  name: "code",
@@ -3240,6 +3331,16 @@ var Code = index.Mark.create({
3240
3331
  renderHTML({ HTMLAttributes }) {
3241
3332
  return ["code", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3242
3333
  },
3334
+ markdownTokenName: "codespan",
3335
+ parseMarkdown: (token, helpers) => {
3336
+ return helpers.applyMark("code", [{ type: "text", text: token.text || "" }]);
3337
+ },
3338
+ renderMarkdown: (node, h2) => {
3339
+ if (!node.content) {
3340
+ return "";
3341
+ }
3342
+ return `\`${h2.renderChildren(node.content)}\``;
3343
+ },
3243
3344
  addCommands() {
3244
3345
  return {
3245
3346
  setCode: () => ({ commands }) => {
@@ -3275,6 +3376,7 @@ var Code = index.Mark.create({
3275
3376
  ];
3276
3377
  }
3277
3378
  });
3379
+ var DEFAULT_TAB_SIZE = 4;
3278
3380
  var backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
3279
3381
  var tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
3280
3382
  var CodeBlock = index.Node3.create({
@@ -3285,6 +3387,8 @@ var CodeBlock = index.Node3.create({
3285
3387
  exitOnTripleEnter: true,
3286
3388
  exitOnArrowDown: true,
3287
3389
  defaultLanguage: null,
3390
+ enableTabIndentation: false,
3391
+ tabSize: DEFAULT_TAB_SIZE,
3288
3392
  HTMLAttributes: {}
3289
3393
  };
3290
3394
  },
@@ -3300,6 +3404,9 @@ var CodeBlock = index.Node3.create({
3300
3404
  parseHTML: (element) => {
3301
3405
  var _a;
3302
3406
  const { languageClassPrefix } = this.options;
3407
+ if (!languageClassPrefix) {
3408
+ return null;
3409
+ }
3303
3410
  const classNames = [...((_a = element.firstElementChild) == null ? void 0 : _a.classList) || []];
3304
3411
  const languages = classNames.filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, ""));
3305
3412
  const language = languages[0];
@@ -3333,6 +3440,32 @@ var CodeBlock = index.Node3.create({
3333
3440
  ]
3334
3441
  ];
3335
3442
  },
3443
+ markdownTokenName: "code",
3444
+ parseMarkdown: (token, helpers) => {
3445
+ var _a;
3446
+ if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
3447
+ return [];
3448
+ }
3449
+ return helpers.createNode(
3450
+ "codeBlock",
3451
+ { language: token.lang || null },
3452
+ token.text ? [helpers.createTextNode(token.text)] : []
3453
+ );
3454
+ },
3455
+ renderMarkdown: (node, h2) => {
3456
+ var _a;
3457
+ let output = "";
3458
+ const language = ((_a = node.attrs) == null ? void 0 : _a.language) || "";
3459
+ if (!node.content) {
3460
+ output = `\`\`\`${language}
3461
+
3462
+ \`\`\``;
3463
+ } else {
3464
+ const lines = [`\`\`\`${language}`, h2.renderChildren(node.content), "```"];
3465
+ output = lines.join("\n");
3466
+ }
3467
+ return output;
3468
+ },
3336
3469
  addCommands() {
3337
3470
  return {
3338
3471
  setCodeBlock: (attributes) => ({ commands }) => {
@@ -3358,6 +3491,95 @@ var CodeBlock = index.Node3.create({
3358
3491
  }
3359
3492
  return false;
3360
3493
  },
3494
+ // handle tab indentation
3495
+ Tab: ({ editor }) => {
3496
+ var _a;
3497
+ if (!this.options.enableTabIndentation) {
3498
+ return false;
3499
+ }
3500
+ const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
3501
+ const { state } = editor;
3502
+ const { selection } = state;
3503
+ const { $from, empty } = selection;
3504
+ if ($from.parent.type !== this.type) {
3505
+ return false;
3506
+ }
3507
+ const indent = " ".repeat(tabSize);
3508
+ if (empty) {
3509
+ return editor.commands.insertContent(indent);
3510
+ }
3511
+ return editor.commands.command(({ tr: tr2 }) => {
3512
+ const { from: from2, to } = selection;
3513
+ const text = state.doc.textBetween(from2, to, "\n", "\n");
3514
+ const lines = text.split("\n");
3515
+ const indentedText = lines.map((line) => indent + line).join("\n");
3516
+ tr2.replaceWith(from2, to, state.schema.text(indentedText));
3517
+ return true;
3518
+ });
3519
+ },
3520
+ // handle shift+tab reverse indentation
3521
+ "Shift-Tab": ({ editor }) => {
3522
+ var _a;
3523
+ if (!this.options.enableTabIndentation) {
3524
+ return false;
3525
+ }
3526
+ const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
3527
+ const { state } = editor;
3528
+ const { selection } = state;
3529
+ const { $from, empty } = selection;
3530
+ if ($from.parent.type !== this.type) {
3531
+ return false;
3532
+ }
3533
+ if (empty) {
3534
+ return editor.commands.command(({ tr: tr2 }) => {
3535
+ var _a2;
3536
+ const { pos } = $from;
3537
+ const codeBlockStart = $from.start();
3538
+ const codeBlockEnd = $from.end();
3539
+ const allText = state.doc.textBetween(codeBlockStart, codeBlockEnd, "\n", "\n");
3540
+ const lines = allText.split("\n");
3541
+ let currentLineIndex = 0;
3542
+ let charCount = 0;
3543
+ const relativeCursorPos = pos - codeBlockStart;
3544
+ for (let i = 0; i < lines.length; i += 1) {
3545
+ if (charCount + lines[i].length >= relativeCursorPos) {
3546
+ currentLineIndex = i;
3547
+ break;
3548
+ }
3549
+ charCount += lines[i].length + 1;
3550
+ }
3551
+ const currentLine = lines[currentLineIndex];
3552
+ const leadingSpaces = ((_a2 = currentLine.match(/^ */)) == null ? void 0 : _a2[0]) || "";
3553
+ const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
3554
+ if (spacesToRemove === 0) {
3555
+ return true;
3556
+ }
3557
+ let lineStartPos = codeBlockStart;
3558
+ for (let i = 0; i < currentLineIndex; i += 1) {
3559
+ lineStartPos += lines[i].length + 1;
3560
+ }
3561
+ tr2.delete(lineStartPos, lineStartPos + spacesToRemove);
3562
+ const cursorPosInLine = pos - lineStartPos;
3563
+ if (cursorPosInLine <= spacesToRemove) {
3564
+ tr2.setSelection(index.TextSelection.create(tr2.doc, lineStartPos));
3565
+ }
3566
+ return true;
3567
+ });
3568
+ }
3569
+ return editor.commands.command(({ tr: tr2 }) => {
3570
+ const { from: from2, to } = selection;
3571
+ const text = state.doc.textBetween(from2, to, "\n", "\n");
3572
+ const lines = text.split("\n");
3573
+ const reverseIndentText = lines.map((line) => {
3574
+ var _a2;
3575
+ const leadingSpaces = ((_a2 = line.match(/^ */)) == null ? void 0 : _a2[0]) || "";
3576
+ const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
3577
+ return line.slice(spacesToRemove);
3578
+ }).join("\n");
3579
+ tr2.replaceWith(from2, to, state.schema.text(reverseIndentText));
3580
+ return true;
3581
+ });
3582
+ },
3361
3583
  // exit node on triple enter
3362
3584
  Enter: ({ editor }) => {
3363
3585
  if (!this.options.exitOnTripleEnter) {
@@ -3466,10 +3688,17 @@ var CodeBlock = index.Node3.create({
3466
3688
  var Document = index.Node3.create({
3467
3689
  name: "doc",
3468
3690
  topNode: true,
3469
- content: "block+"
3691
+ content: "block+",
3692
+ renderMarkdown: (node, h2) => {
3693
+ if (!node.content) {
3694
+ return "";
3695
+ }
3696
+ return h2.renderChildren(node.content, "\n\n");
3697
+ }
3470
3698
  });
3471
3699
  var HardBreak = index.Node3.create({
3472
3700
  name: "hardBreak",
3701
+ markdownTokenName: "br",
3473
3702
  addOptions() {
3474
3703
  return {
3475
3704
  keepMarks: true,
@@ -3489,6 +3718,13 @@ var HardBreak = index.Node3.create({
3489
3718
  renderText() {
3490
3719
  return "\n";
3491
3720
  },
3721
+ renderMarkdown: () => `
3722
+ `,
3723
+ parseMarkdown: () => {
3724
+ return {
3725
+ type: "hardBreak"
3726
+ };
3727
+ },
3492
3728
  addCommands() {
3493
3729
  return {
3494
3730
  setHardBreak: () => ({ commands, chain, state, editor }) => {
@@ -3551,6 +3787,18 @@ var Heading = index.Node3.create({
3551
3787
  const level = hasLevel ? node.attrs.level : this.options.levels[0];
3552
3788
  return [`h${level}`, index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3553
3789
  },
3790
+ parseMarkdown: (token, helpers) => {
3791
+ return helpers.createNode("heading", { level: token.depth || 1 }, helpers.parseInline(token.tokens || []));
3792
+ },
3793
+ renderMarkdown: (node, h2) => {
3794
+ var _a;
3795
+ const level = ((_a = node.attrs) == null ? void 0 : _a.level) ? parseInt(node.attrs.level, 10) : 1;
3796
+ const headingChars = "#".repeat(level);
3797
+ if (!node.content) {
3798
+ return "";
3799
+ }
3800
+ return `${headingChars} ${h2.renderChildren(node.content)}`;
3801
+ },
3554
3802
  addCommands() {
3555
3803
  return {
3556
3804
  setHeading: (attributes) => ({ commands }) => {
@@ -3594,7 +3842,8 @@ var HorizontalRule = index.Node3.create({
3594
3842
  name: "horizontalRule",
3595
3843
  addOptions() {
3596
3844
  return {
3597
- HTMLAttributes: {}
3845
+ HTMLAttributes: {},
3846
+ nextNodeType: "paragraph"
3598
3847
  };
3599
3848
  },
3600
3849
  group: "block",
@@ -3604,6 +3853,13 @@ var HorizontalRule = index.Node3.create({
3604
3853
  renderHTML({ HTMLAttributes }) {
3605
3854
  return ["hr", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
3606
3855
  },
3856
+ markdownTokenName: "hr",
3857
+ parseMarkdown: (token, helpers) => {
3858
+ return helpers.createNode("horizontalRule");
3859
+ },
3860
+ renderMarkdown: () => {
3861
+ return "---";
3862
+ },
3607
3863
  addCommands() {
3608
3864
  return {
3609
3865
  setHorizontalRule: () => ({ chain, state }) => {
@@ -3620,8 +3876,7 @@ var HorizontalRule = index.Node3.create({
3620
3876
  } else {
3621
3877
  currentChain.insertContent({ type: this.name });
3622
3878
  }
3623
- return currentChain.command(({ tr: tr2, dispatch }) => {
3624
- var _a;
3879
+ return currentChain.command(({ state: chainState, tr: tr2, dispatch }) => {
3625
3880
  if (dispatch) {
3626
3881
  const { $to } = tr2.selection;
3627
3882
  const posAfter = $to.end();
@@ -3634,7 +3889,8 @@ var HorizontalRule = index.Node3.create({
3634
3889
  tr2.setSelection(index.TextSelection.create(tr2.doc, $to.pos));
3635
3890
  }
3636
3891
  } else {
3637
- const node = (_a = $to.parent.type.contentMatch.defaultType) == null ? void 0 : _a.create();
3892
+ const nodeType = chainState.schema.nodes[this.options.nextNodeType] || $to.parent.type.contentMatch.defaultType;
3893
+ const node = nodeType == null ? void 0 : nodeType.create();
3638
3894
  if (node) {
3639
3895
  tr2.insert(posAfter, node);
3640
3896
  tr2.setSelection(index.TextSelection.create(tr2.doc, posAfter + 1));
@@ -3701,6 +3957,13 @@ var Italic = index.Mark.create({
3701
3957
  }
3702
3958
  };
3703
3959
  },
3960
+ markdownTokenName: "em",
3961
+ parseMarkdown: (token, helpers) => {
3962
+ return helpers.applyMark("italic", helpers.parseInline(token.tokens || []));
3963
+ },
3964
+ renderMarkdown: (node, h2) => {
3965
+ return `*${h2.renderChildren(node)}*`;
3966
+ },
3704
3967
  addKeyboardShortcuts() {
3705
3968
  return {
3706
3969
  "Mod-i": () => this.editor.commands.toggleItalic(),
@@ -3760,6 +4023,25 @@ var BulletList = index.Node3.create({
3760
4023
  renderHTML({ HTMLAttributes }) {
3761
4024
  return ["ul", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3762
4025
  },
4026
+ markdownTokenName: "list",
4027
+ parseMarkdown: (token, helpers) => {
4028
+ if (token.type !== "list" || token.ordered) {
4029
+ return [];
4030
+ }
4031
+ return {
4032
+ type: "bulletList",
4033
+ content: token.items ? helpers.parseChildren(token.items) : []
4034
+ };
4035
+ },
4036
+ renderMarkdown: (node, h2) => {
4037
+ if (!node.content) {
4038
+ return "";
4039
+ }
4040
+ return h2.renderChildren(node.content, "\n");
4041
+ },
4042
+ markdownOptions: {
4043
+ indentsContent: true
4044
+ },
3763
4045
  addCommands() {
3764
4046
  return {
3765
4047
  toggleBulletList: () => ({ commands, chain }) => {
@@ -3816,6 +4098,65 @@ var ListItem = index.Node3.create({
3816
4098
  renderHTML({ HTMLAttributes }) {
3817
4099
  return ["li", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
3818
4100
  },
4101
+ markdownTokenName: "list_item",
4102
+ parseMarkdown: (token, helpers) => {
4103
+ if (token.type !== "list_item") {
4104
+ return [];
4105
+ }
4106
+ let content = [];
4107
+ if (token.tokens && token.tokens.length > 0) {
4108
+ const hasParagraphTokens = token.tokens.some((t) => t.type === "paragraph");
4109
+ if (hasParagraphTokens) {
4110
+ content = helpers.parseChildren(token.tokens);
4111
+ } else {
4112
+ const firstToken = token.tokens[0];
4113
+ if (firstToken && firstToken.type === "text" && firstToken.tokens && firstToken.tokens.length > 0) {
4114
+ const inlineContent = helpers.parseInline(firstToken.tokens);
4115
+ content = [
4116
+ {
4117
+ type: "paragraph",
4118
+ content: inlineContent
4119
+ }
4120
+ ];
4121
+ if (token.tokens.length > 1) {
4122
+ const remainingTokens = token.tokens.slice(1);
4123
+ const additionalContent = helpers.parseChildren(remainingTokens);
4124
+ content.push(...additionalContent);
4125
+ }
4126
+ } else {
4127
+ content = helpers.parseChildren(token.tokens);
4128
+ }
4129
+ }
4130
+ }
4131
+ if (content.length === 0) {
4132
+ content = [
4133
+ {
4134
+ type: "paragraph",
4135
+ content: []
4136
+ }
4137
+ ];
4138
+ }
4139
+ return {
4140
+ type: "listItem",
4141
+ content
4142
+ };
4143
+ },
4144
+ renderMarkdown: (node, h2, ctx) => {
4145
+ return index.renderNestedMarkdownContent(
4146
+ node,
4147
+ h2,
4148
+ (context) => {
4149
+ if (context.parentType === "bulletList") {
4150
+ return "- ";
4151
+ }
4152
+ if (context.parentType === "orderedList") {
4153
+ return `${context.index + 1}. `;
4154
+ }
4155
+ return "- ";
4156
+ },
4157
+ ctx
4158
+ );
4159
+ },
3819
4160
  addKeyboardShortcuts() {
3820
4161
  return {
3821
4162
  Enter: () => this.editor.commands.splitListItem(this.name),
@@ -4064,6 +4405,134 @@ var ListKeymap = index.Extension.create({
4064
4405
  };
4065
4406
  }
4066
4407
  });
4408
+ var ORDERED_LIST_ITEM_REGEX = /^(\s*)(\d+)\.\s+(.*)$/;
4409
+ var INDENTED_LINE_REGEX = /^\s/;
4410
+ function collectOrderedListItems(lines) {
4411
+ const listItems = [];
4412
+ let currentLineIndex = 0;
4413
+ let consumed = 0;
4414
+ while (currentLineIndex < lines.length) {
4415
+ const line = lines[currentLineIndex];
4416
+ const match = line.match(ORDERED_LIST_ITEM_REGEX);
4417
+ if (!match) {
4418
+ break;
4419
+ }
4420
+ const [, indent, number, content] = match;
4421
+ const indentLevel = indent.length;
4422
+ let itemContent = content;
4423
+ let nextLineIndex = currentLineIndex + 1;
4424
+ const itemLines = [line];
4425
+ while (nextLineIndex < lines.length) {
4426
+ const nextLine = lines[nextLineIndex];
4427
+ const nextMatch = nextLine.match(ORDERED_LIST_ITEM_REGEX);
4428
+ if (nextMatch) {
4429
+ break;
4430
+ }
4431
+ if (nextLine.trim() === "") {
4432
+ itemLines.push(nextLine);
4433
+ itemContent += "\n";
4434
+ nextLineIndex += 1;
4435
+ } else if (nextLine.match(INDENTED_LINE_REGEX)) {
4436
+ itemLines.push(nextLine);
4437
+ itemContent += `
4438
+ ${nextLine.slice(indentLevel + 2)}`;
4439
+ nextLineIndex += 1;
4440
+ } else {
4441
+ break;
4442
+ }
4443
+ }
4444
+ listItems.push({
4445
+ indent: indentLevel,
4446
+ number: parseInt(number, 10),
4447
+ content: itemContent.trim(),
4448
+ raw: itemLines.join("\n")
4449
+ });
4450
+ consumed = nextLineIndex;
4451
+ currentLineIndex = nextLineIndex;
4452
+ }
4453
+ return [listItems, consumed];
4454
+ }
4455
+ function buildNestedStructure(items, baseIndent, lexer) {
4456
+ var _a;
4457
+ const result = [];
4458
+ let currentIndex = 0;
4459
+ while (currentIndex < items.length) {
4460
+ const item = items[currentIndex];
4461
+ if (item.indent === baseIndent) {
4462
+ const contentLines = item.content.split("\n");
4463
+ const mainText = ((_a = contentLines[0]) == null ? void 0 : _a.trim()) || "";
4464
+ const tokens = [];
4465
+ if (mainText) {
4466
+ tokens.push({
4467
+ type: "paragraph",
4468
+ raw: mainText,
4469
+ tokens: lexer.inlineTokens(mainText)
4470
+ });
4471
+ }
4472
+ const additionalContent = contentLines.slice(1).join("\n").trim();
4473
+ if (additionalContent) {
4474
+ const blockTokens = lexer.blockTokens(additionalContent);
4475
+ tokens.push(...blockTokens);
4476
+ }
4477
+ let lookAheadIndex = currentIndex + 1;
4478
+ const nestedItems = [];
4479
+ while (lookAheadIndex < items.length && items[lookAheadIndex].indent > baseIndent) {
4480
+ nestedItems.push(items[lookAheadIndex]);
4481
+ lookAheadIndex += 1;
4482
+ }
4483
+ if (nestedItems.length > 0) {
4484
+ const nextIndent = Math.min(...nestedItems.map((nestedItem) => nestedItem.indent));
4485
+ const nestedListItems = buildNestedStructure(nestedItems, nextIndent, lexer);
4486
+ tokens.push({
4487
+ type: "list",
4488
+ ordered: true,
4489
+ start: nestedItems[0].number,
4490
+ items: nestedListItems,
4491
+ raw: nestedItems.map((nestedItem) => nestedItem.raw).join("\n")
4492
+ });
4493
+ }
4494
+ result.push({
4495
+ type: "list_item",
4496
+ raw: item.raw,
4497
+ tokens
4498
+ });
4499
+ currentIndex = lookAheadIndex;
4500
+ } else {
4501
+ currentIndex += 1;
4502
+ }
4503
+ }
4504
+ return result;
4505
+ }
4506
+ function parseListItems(items, helpers) {
4507
+ return items.map((item) => {
4508
+ if (item.type !== "list_item") {
4509
+ return helpers.parseChildren([item])[0];
4510
+ }
4511
+ const content = [];
4512
+ if (item.tokens && item.tokens.length > 0) {
4513
+ item.tokens.forEach((itemToken) => {
4514
+ if (itemToken.type === "paragraph" || itemToken.type === "list" || itemToken.type === "blockquote" || itemToken.type === "code") {
4515
+ content.push(...helpers.parseChildren([itemToken]));
4516
+ } else if (itemToken.type === "text" && itemToken.tokens) {
4517
+ const inlineContent = helpers.parseChildren([itemToken]);
4518
+ content.push({
4519
+ type: "paragraph",
4520
+ content: inlineContent
4521
+ });
4522
+ } else {
4523
+ const parsed = helpers.parseChildren([itemToken]);
4524
+ if (parsed.length > 0) {
4525
+ content.push(...parsed);
4526
+ }
4527
+ }
4528
+ });
4529
+ }
4530
+ return {
4531
+ type: "listItem",
4532
+ content
4533
+ };
4534
+ });
4535
+ }
4067
4536
  var ListItemName2 = "listItem";
4068
4537
  var TextStyleName2 = "textStyle";
4069
4538
  var orderedListInputRegex = /^(\d+)\.\s$/;
@@ -4106,6 +4575,63 @@ var OrderedList = index.Node3.create({
4106
4575
  const { start, ...attributesWithoutStart } = HTMLAttributes;
4107
4576
  return start === 1 ? ["ol", index.mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4108
4577
  },
4578
+ markdownTokenName: "list",
4579
+ parseMarkdown: (token, helpers) => {
4580
+ if (token.type !== "list" || !token.ordered) {
4581
+ return [];
4582
+ }
4583
+ const startValue = token.start || 1;
4584
+ const content = token.items ? parseListItems(token.items, helpers) : [];
4585
+ if (startValue !== 1) {
4586
+ return {
4587
+ type: "orderedList",
4588
+ attrs: { start: startValue },
4589
+ content
4590
+ };
4591
+ }
4592
+ return {
4593
+ type: "orderedList",
4594
+ content
4595
+ };
4596
+ },
4597
+ renderMarkdown: (node, h2) => {
4598
+ if (!node.content) {
4599
+ return "";
4600
+ }
4601
+ return h2.renderChildren(node.content, "\n");
4602
+ },
4603
+ markdownTokenizer: {
4604
+ name: "orderedList",
4605
+ level: "block",
4606
+ start: (src) => {
4607
+ const match = src.match(/^(\s*)(\d+)\.\s+/);
4608
+ const index2 = match == null ? void 0 : match.index;
4609
+ return index2 !== void 0 ? index2 : -1;
4610
+ },
4611
+ tokenize: (src, _tokens, lexer) => {
4612
+ var _a;
4613
+ const lines = src.split("\n");
4614
+ const [listItems, consumed] = collectOrderedListItems(lines);
4615
+ if (listItems.length === 0) {
4616
+ return void 0;
4617
+ }
4618
+ const items = buildNestedStructure(listItems, 0, lexer);
4619
+ if (items.length === 0) {
4620
+ return void 0;
4621
+ }
4622
+ const startValue = ((_a = listItems[0]) == null ? void 0 : _a.number) || 1;
4623
+ return {
4624
+ type: "list",
4625
+ ordered: true,
4626
+ start: startValue,
4627
+ items,
4628
+ raw: lines.slice(0, consumed).join("\n")
4629
+ };
4630
+ }
4631
+ },
4632
+ markdownOptions: {
4633
+ indentsContent: true
4634
+ },
4109
4635
  addCommands() {
4110
4636
  return {
4111
4637
  toggleOrderedList: () => ({ commands, chain }) => {
@@ -4200,6 +4726,27 @@ var TaskItem = index.Node3.create({
4200
4726
  ["div", 0]
4201
4727
  ];
4202
4728
  },
4729
+ parseMarkdown: (token, h2) => {
4730
+ const content = [];
4731
+ if (token.tokens && token.tokens.length > 0) {
4732
+ content.push(h2.createNode("paragraph", {}, h2.parseInline(token.tokens)));
4733
+ } else if (token.text) {
4734
+ content.push(h2.createNode("paragraph", {}, [h2.createNode("text", { text: token.text })]));
4735
+ } else {
4736
+ content.push(h2.createNode("paragraph", {}, []));
4737
+ }
4738
+ if (token.nestedTokens && token.nestedTokens.length > 0) {
4739
+ const nestedContent = h2.parseChildren(token.nestedTokens);
4740
+ content.push(...nestedContent);
4741
+ }
4742
+ return h2.createNode("taskItem", { checked: token.checked || false }, content);
4743
+ },
4744
+ renderMarkdown: (node, h2) => {
4745
+ var _a;
4746
+ const checkedChar = ((_a = node.attrs) == null ? void 0 : _a.checked) ? "x" : " ";
4747
+ const prefix = `- [${checkedChar}] `;
4748
+ return index.renderNestedMarkdownContent(node, h2, prefix);
4749
+ },
4203
4750
  addKeyboardShortcuts() {
4204
4751
  const shortcuts = {
4205
4752
  Enter: () => this.editor.commands.splitListItem(this.name),
@@ -4220,11 +4767,11 @@ var TaskItem = index.Node3.create({
4220
4767
  const checkboxStyler = document.createElement("span");
4221
4768
  const checkbox = document.createElement("input");
4222
4769
  const content = document.createElement("div");
4223
- const updateA11Y = () => {
4770
+ const updateA11Y = (currentNode) => {
4224
4771
  var _a, _b;
4225
- 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"}`;
4772
+ 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"}`;
4226
4773
  };
4227
- updateA11Y();
4774
+ updateA11Y(node);
4228
4775
  checkboxWrapper.contentEditable = "false";
4229
4776
  checkbox.type = "checkbox";
4230
4777
  checkbox.addEventListener("mousedown", (event) => event.preventDefault());
@@ -4273,7 +4820,7 @@ var TaskItem = index.Node3.create({
4273
4820
  }
4274
4821
  listItem.dataset.checked = updatedNode.attrs.checked;
4275
4822
  checkbox.checked = updatedNode.attrs.checked;
4276
- updateA11Y();
4823
+ updateA11Y(updatedNode);
4277
4824
  return true;
4278
4825
  }
4279
4826
  };
@@ -4314,6 +4861,97 @@ var TaskList = index.Node3.create({
4314
4861
  renderHTML({ HTMLAttributes }) {
4315
4862
  return ["ul", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { "data-type": this.name }), 0];
4316
4863
  },
4864
+ parseMarkdown: (token, h2) => {
4865
+ return h2.createNode("taskList", {}, h2.parseChildren(token.items || []));
4866
+ },
4867
+ renderMarkdown: (node, h2) => {
4868
+ if (!node.content) {
4869
+ return "";
4870
+ }
4871
+ return h2.renderChildren(node.content, "\n");
4872
+ },
4873
+ markdownTokenizer: {
4874
+ name: "taskList",
4875
+ level: "block",
4876
+ start(src) {
4877
+ var _a;
4878
+ const index2 = (_a = src.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)) == null ? void 0 : _a.index;
4879
+ return index2 !== void 0 ? index2 : -1;
4880
+ },
4881
+ tokenize(src, tokens, lexer) {
4882
+ const parseTaskListContent = (content) => {
4883
+ const nestedResult = index.parseIndentedBlocks(
4884
+ content,
4885
+ {
4886
+ itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
4887
+ extractItemData: (match) => ({
4888
+ indentLevel: match[1].length,
4889
+ mainContent: match[4],
4890
+ checked: match[3].toLowerCase() === "x"
4891
+ }),
4892
+ createToken: (data, nestedTokens) => ({
4893
+ type: "taskItem",
4894
+ raw: "",
4895
+ mainContent: data.mainContent,
4896
+ indentLevel: data.indentLevel,
4897
+ checked: data.checked,
4898
+ text: data.mainContent,
4899
+ tokens: lexer.inlineTokens(data.mainContent),
4900
+ nestedTokens
4901
+ }),
4902
+ // Allow recursive nesting
4903
+ customNestedParser: parseTaskListContent
4904
+ },
4905
+ lexer
4906
+ );
4907
+ if (nestedResult) {
4908
+ return [
4909
+ {
4910
+ type: "taskList",
4911
+ raw: nestedResult.raw,
4912
+ items: nestedResult.items
4913
+ }
4914
+ ];
4915
+ }
4916
+ return lexer.blockTokens(content);
4917
+ };
4918
+ const result = index.parseIndentedBlocks(
4919
+ src,
4920
+ {
4921
+ itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
4922
+ extractItemData: (match) => ({
4923
+ indentLevel: match[1].length,
4924
+ mainContent: match[4],
4925
+ checked: match[3].toLowerCase() === "x"
4926
+ }),
4927
+ createToken: (data, nestedTokens) => ({
4928
+ type: "taskItem",
4929
+ raw: "",
4930
+ mainContent: data.mainContent,
4931
+ indentLevel: data.indentLevel,
4932
+ checked: data.checked,
4933
+ text: data.mainContent,
4934
+ tokens: lexer.inlineTokens(data.mainContent),
4935
+ nestedTokens
4936
+ }),
4937
+ // Use the recursive parser for nested content
4938
+ customNestedParser: parseTaskListContent
4939
+ },
4940
+ lexer
4941
+ );
4942
+ if (!result) {
4943
+ return void 0;
4944
+ }
4945
+ return {
4946
+ type: "taskList",
4947
+ raw: result.raw,
4948
+ items: result.items
4949
+ };
4950
+ }
4951
+ },
4952
+ markdownOptions: {
4953
+ indentsContent: true
4954
+ },
4317
4955
  addCommands() {
4318
4956
  return {
4319
4957
  toggleTaskList: () => ({ commands }) => {
@@ -4368,6 +5006,24 @@ var Paragraph = index.Node3.create({
4368
5006
  renderHTML({ HTMLAttributes }) {
4369
5007
  return ["p", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4370
5008
  },
5009
+ parseMarkdown: (token, helpers) => {
5010
+ const tokens = token.tokens || [];
5011
+ if (tokens.length === 1 && tokens[0].type === "image") {
5012
+ return helpers.parseChildren([tokens[0]]);
5013
+ }
5014
+ return helpers.createNode(
5015
+ "paragraph",
5016
+ void 0,
5017
+ // no attributes for paragraph
5018
+ helpers.parseInline(tokens)
5019
+ );
5020
+ },
5021
+ renderMarkdown: (node, h2) => {
5022
+ if (!node || !Array.isArray(node.content)) {
5023
+ return "";
5024
+ }
5025
+ return h2.renderChildren(node.content);
5026
+ },
4371
5027
  addCommands() {
4372
5028
  return {
4373
5029
  setParagraph: () => ({ commands }) => {
@@ -4411,6 +5067,13 @@ var Strike = index.Mark.create({
4411
5067
  renderHTML({ HTMLAttributes }) {
4412
5068
  return ["s", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4413
5069
  },
5070
+ markdownTokenName: "del",
5071
+ parseMarkdown: (token, helpers) => {
5072
+ return helpers.applyMark("strike", helpers.parseInline(token.tokens || []));
5073
+ },
5074
+ renderMarkdown: (node, h2) => {
5075
+ return `~~${h2.renderChildren(node)}~~`;
5076
+ },
4414
5077
  addCommands() {
4415
5078
  return {
4416
5079
  setStrike: () => ({ commands }) => {
@@ -4448,7 +5111,14 @@ var Strike = index.Mark.create({
4448
5111
  });
4449
5112
  var Text = index.Node3.create({
4450
5113
  name: "text",
4451
- group: "inline"
5114
+ group: "inline",
5115
+ parseMarkdown: (token) => {
5116
+ return {
5117
+ type: "text",
5118
+ text: token.text || ""
5119
+ };
5120
+ },
5121
+ renderMarkdown: (node) => node.text || ""
4452
5122
  });
4453
5123
  var Underline = index.Mark.create({
4454
5124
  name: "underline",
@@ -4472,6 +5142,33 @@ var Underline = index.Mark.create({
4472
5142
  renderHTML({ HTMLAttributes }) {
4473
5143
  return ["u", index.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
4474
5144
  },
5145
+ parseMarkdown(token, helpers) {
5146
+ return helpers.applyMark(this.name || "underline", helpers.parseInline(token.tokens || []));
5147
+ },
5148
+ renderMarkdown(node, helpers) {
5149
+ return `++${helpers.renderChildren(node)}++`;
5150
+ },
5151
+ markdownTokenizer: {
5152
+ name: "underline",
5153
+ level: "inline",
5154
+ start(src) {
5155
+ return src.indexOf("++");
5156
+ },
5157
+ tokenize(src, _tokens, lexer) {
5158
+ const rule = /^(\+\+)([\s\S]+?)(\+\+)/;
5159
+ const match = rule.exec(src);
5160
+ if (!match) {
5161
+ return void 0;
5162
+ }
5163
+ const innerContent = match[2].trim();
5164
+ return {
5165
+ type: "underline",
5166
+ raw: match[0],
5167
+ text: innerContent,
5168
+ tokens: lexer.inlineTokens(innerContent)
5169
+ };
5170
+ }
5171
+ },
4475
5172
  addCommands() {
4476
5173
  return {
4477
5174
  setUnderline: () => ({ commands }) => {