reactjs-tiptap-editor 1.0.25 → 1.0.28

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 (296) hide show
  1. package/lib/{ActionMenuButton-8cTG45Ft.js → ActionMenuButton-BhiGvRJ7.js} +1 -1
  2. package/lib/{ActionMenuButton-CXeFhner.cjs → ActionMenuButton-qUxkZlQg.cjs} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +14 -14
  5. package/lib/Blockquote.cjs +5 -5
  6. package/lib/Blockquote.js +1497 -53
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +3 -3
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -2
  11. package/lib/{Callout-ZlPQrMEt.js → Callout-B9uXfbP3.js} +20 -20
  12. package/lib/{Callout-DWOMZPiP.cjs → Callout-C_TXsss3.cjs} +1 -1
  13. package/lib/Callout.cjs +1 -1
  14. package/lib/Callout.js +4 -4
  15. package/lib/Clear.cjs +1 -1
  16. package/lib/Clear.js +2 -2
  17. package/lib/Code.cjs +1 -1
  18. package/lib/Code.js +56 -39
  19. package/lib/CodeBlock.cjs +1 -1
  20. package/lib/CodeBlock.js +8 -4
  21. package/lib/CodeView.cjs +1 -1
  22. package/lib/CodeView.js +2 -2
  23. package/lib/Color.cjs +1 -1
  24. package/lib/Color.js +3 -3
  25. package/lib/Column.cjs +1 -1
  26. package/lib/Column.js +2 -2
  27. package/lib/{Drawer-TJY4NuHx.cjs → Drawer-D3B4lQJF.cjs} +1 -1
  28. package/lib/{Drawer-C-EO1uoK.js → Drawer-h401Yy6Y.js} +4 -4
  29. package/lib/Drawer.cjs +1 -1
  30. package/lib/Drawer.js +4 -4
  31. package/lib/Emoji.cjs +1 -1
  32. package/lib/Emoji.js +1797 -268
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +10 -10
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +2 -2
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +2 -2
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +5 -5
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +5 -5
  43. package/lib/FormatPainter.cjs +1 -0
  44. package/lib/FormatPainter.js +133 -0
  45. package/lib/Heading.cjs +1 -1
  46. package/lib/Heading.js +15 -11
  47. package/lib/Highlight.cjs +1 -1
  48. package/lib/Highlight.js +3 -3
  49. package/lib/History.cjs +7 -1
  50. package/lib/History.js +663 -569
  51. package/lib/HorizontalRule.cjs +1 -1
  52. package/lib/HorizontalRule.js +2 -2
  53. package/lib/{Iframe-CGb6-2LD.js → Iframe-Dhn40BXx.js} +7 -7
  54. package/lib/{Iframe-5zx43DL4.cjs → Iframe-bvGuzYwC.cjs} +1 -1
  55. package/lib/Iframe.cjs +1 -1
  56. package/lib/Iframe.js +3 -3
  57. package/lib/Image.cjs +1 -1
  58. package/lib/Image.js +9 -6
  59. package/lib/ImageGif.cjs +1 -1
  60. package/lib/ImageGif.js +33 -33
  61. package/lib/ImportWord.cjs +1 -1
  62. package/lib/ImportWord.js +5 -5
  63. package/lib/{Indent-CdMYsDNS.js → Indent-BK9DvCL7.js} +2 -2
  64. package/lib/{Indent-DuwV8s1t.cjs → Indent-IOByomps.cjs} +1 -1
  65. package/lib/Indent.cjs +1 -1
  66. package/lib/Indent.js +2 -2
  67. package/lib/Italic.cjs +1 -1
  68. package/lib/Italic.js +2 -2
  69. package/lib/{Katex-CCP_ZQz2.js → Katex-C_Ah9G9w.js} +5 -5
  70. package/lib/{Katex-D9FP7EUE.cjs → Katex-oLGrtLTf.cjs} +1 -1
  71. package/lib/Katex.cjs +1 -1
  72. package/lib/Katex.js +3 -3
  73. package/lib/LineHeight.cjs +1 -1
  74. package/lib/LineHeight.js +4 -4
  75. package/lib/Link.cjs +1 -1
  76. package/lib/Link.js +2 -2
  77. package/lib/{LinkEditBlock-DQ8-iufJ.cjs → LinkEditBlock-BojxdGTm.cjs} +2 -2
  78. package/lib/{LinkEditBlock-B1m-TVMu.js → LinkEditBlock-DRdKXffy.js} +88 -57
  79. package/lib/MarkdownPaste.cjs +1 -1
  80. package/lib/MarkdownPaste.js +1 -1
  81. package/lib/Mention.cjs +1 -1
  82. package/lib/Mention.js +9 -5
  83. package/lib/Mermaid.cjs +1 -1
  84. package/lib/Mermaid.js +14 -14
  85. package/lib/MoreMark.cjs +1 -1
  86. package/lib/MoreMark.js +3 -3
  87. package/lib/OrderedList.cjs +1 -1
  88. package/lib/OrderedList.js +2 -2
  89. package/lib/SearchAndReplace.cjs +1 -1
  90. package/lib/SearchAndReplace.js +10 -10
  91. package/lib/SlashCommand.cjs +1 -1
  92. package/lib/SlashCommand.js +7 -7
  93. package/lib/{SlashCommandNodeView-DNixmQGa.cjs → SlashCommandNodeView-Dai-O3aD.cjs} +1 -1
  94. package/lib/{SlashCommandNodeView-Dt6n1SP9.js → SlashCommandNodeView-qwW9cuYt.js} +10 -10
  95. package/lib/Strike.cjs +1 -1
  96. package/lib/Strike.js +2 -2
  97. package/lib/{Table-DdEgaUwa.js → Table-BKM8SvVj.js} +115 -97
  98. package/lib/{Table-C5JxBXef.cjs → Table-CWI7tKme.cjs} +5 -5
  99. package/lib/Table.cjs +1 -1
  100. package/lib/Table.js +1 -1
  101. package/lib/TaskList.cjs +1 -1
  102. package/lib/TaskList.js +2 -2
  103. package/lib/TextAlign.cjs +1 -1
  104. package/lib/TextAlign.js +11 -11
  105. package/lib/TextDirection.cjs +1 -1
  106. package/lib/TextDirection.js +3 -3
  107. package/lib/TextUnderline.cjs +1 -1
  108. package/lib/TextUnderline.js +2 -2
  109. package/lib/Twitter-BfsPzA8_.cjs +1 -0
  110. package/lib/{Twitter-Dnz9qyW0.js → Twitter-CofLQ-zj.js} +191 -191
  111. package/lib/Twitter.cjs +1 -1
  112. package/lib/Twitter.js +3 -3
  113. package/lib/Video.cjs +1 -1
  114. package/lib/Video.js +3 -3
  115. package/lib/bubble.cjs +6 -6
  116. package/lib/bubble.js +2504 -2152
  117. package/lib/{clsx-D6gYQn3o.cjs → clsx-DJURdKPs.cjs} +2 -2
  118. package/lib/{clsx-0OU6n9va.js → clsx-b_2OwHLk.js} +28 -18
  119. package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -1
  120. package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -1
  121. package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -1
  122. package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -1
  123. package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -1
  124. package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -1
  125. package/lib/components/Bubble/RichTextBubbleKatex.d.ts +2 -1
  126. package/lib/components/Bubble/RichTextBubbleLink.d.ts +1 -1
  127. package/lib/components/Bubble/RichTextBubbleMedia.d.ts +3 -3
  128. package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +2 -1
  129. package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -1
  130. package/lib/components/Bubble/RichTextBubbleTable.d.ts +1 -1
  131. package/lib/components/Bubble/RichTextBubbleText.d.ts +1 -1
  132. package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -1
  133. package/lib/components/ColorPicker.d.ts +1 -1
  134. package/lib/components/ReactBus.d.ts +1 -1
  135. package/lib/components/RichTextProvider.d.ts +1 -1
  136. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -1
  137. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -1
  138. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +2 -1
  139. package/lib/components/icons/Activity.d.ts +2 -1
  140. package/lib/components/icons/Animas.d.ts +2 -1
  141. package/lib/components/icons/AspectRatio.d.ts +1 -1
  142. package/lib/components/icons/Blockquote.d.ts +1 -1
  143. package/lib/components/icons/CodeView.d.ts +1 -1
  144. package/lib/components/icons/ColumnAddLeft.d.ts +1 -1
  145. package/lib/components/icons/ColumnAddRight.d.ts +1 -1
  146. package/lib/components/icons/DeleteColumn.d.ts +1 -1
  147. package/lib/components/icons/DeleteRow.d.ts +1 -1
  148. package/lib/components/icons/Direction.d.ts +1 -1
  149. package/lib/components/icons/Excalidraw.d.ts +1 -1
  150. package/lib/components/icons/ExportPdf.d.ts +1 -1
  151. package/lib/components/icons/ExportWord.d.ts +2 -1
  152. package/lib/components/icons/FileWordOutline.d.ts +1 -1
  153. package/lib/components/icons/Flag.d.ts +2 -1
  154. package/lib/components/icons/Food.d.ts +2 -1
  155. package/lib/components/icons/GIfIcon.d.ts +1 -1
  156. package/lib/components/icons/Html.d.ts +1 -1
  157. package/lib/components/icons/Icon.d.ts +1 -1
  158. package/lib/components/icons/IconColorFill.d.ts +1 -1
  159. package/lib/components/icons/IconHighlightFill.d.ts +1 -1
  160. package/lib/components/icons/ImportWord.d.ts +2 -1
  161. package/lib/components/icons/LeftToRight.d.ts +1 -1
  162. package/lib/components/icons/LineHeight.d.ts +1 -1
  163. package/lib/components/icons/MenuDown.d.ts +1 -1
  164. package/lib/components/icons/Mermaid.d.ts +1 -1
  165. package/lib/components/icons/NoFill.d.ts +1 -1
  166. package/lib/components/icons/Object.d.ts +2 -1
  167. package/lib/components/icons/RightToLeft.d.ts +1 -1
  168. package/lib/components/icons/SizeL.d.ts +1 -1
  169. package/lib/components/icons/SizeM.d.ts +1 -1
  170. package/lib/components/icons/SizeS.d.ts +1 -1
  171. package/lib/components/icons/Symbol.d.ts +2 -1
  172. package/lib/components/icons/Travel.d.ts +2 -1
  173. package/lib/components/icons/Twitter.d.ts +1 -1
  174. package/lib/components/ui/dialog.d.ts +2 -2
  175. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  176. package/lib/components/ui/emoji-picker.d.ts +4 -4
  177. package/lib/components/ui/toaster.d.ts +1 -1
  178. package/lib/{dropdown-menu-yQ-sQ1k4.cjs → dropdown-menu-CEMxzgnU.cjs} +1 -1
  179. package/lib/{dropdown-menu-ROihzXsP.js → dropdown-menu-CKAKsyqu.js} +1 -1
  180. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -1
  181. package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -1
  182. package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -1
  183. package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -1
  184. package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -1
  185. package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -1
  186. package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -1
  187. package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -1
  188. package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -1
  189. package/lib/extensions/Code/components/RichTextCode.d.ts +1 -1
  190. package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +2 -1
  191. package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -1
  192. package/lib/extensions/Color/components/RichTextColor.d.ts +1 -1
  193. package/lib/extensions/Column/Column.d.ts +10 -2
  194. package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -1
  195. package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -1
  196. package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +27 -27
  197. package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -1
  198. package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +2 -1
  199. package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -1
  200. package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +2 -1
  201. package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -1
  202. package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -1
  203. package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -1
  204. package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -1
  205. package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +1 -1
  206. package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +1 -1
  207. package/lib/extensions/FormatPainter/FormatPainter.d.ts +17 -0
  208. package/lib/extensions/FormatPainter/components/RichTextFormatPainter.d.ts +1 -0
  209. package/lib/extensions/FormatPainter/index.d.ts +1 -0
  210. package/lib/extensions/Heading/components/RichTextHeading.d.ts +1 -1
  211. package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +2 -1
  212. package/lib/extensions/History/components/RichTextHistory.d.ts +3 -2
  213. package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -1
  214. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +1 -1
  215. package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -1
  216. package/lib/extensions/Image/Image.d.ts +13 -1
  217. package/lib/extensions/Image/components/ImageCropper.d.ts +2 -1
  218. package/lib/extensions/Image/components/ImageView.d.ts +2 -1
  219. package/lib/extensions/Image/components/RichTextImage.d.ts +1 -1
  220. package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -1
  221. package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +2 -1
  222. package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -1
  223. package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -1
  224. package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -1
  225. package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -1
  226. package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -1
  227. package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -1
  228. package/lib/extensions/Link/components/LinkEditBlock.d.ts +1 -1
  229. package/lib/extensions/Link/components/LinkViewBlock.d.ts +2 -1
  230. package/lib/extensions/Link/components/RichTextLink.d.ts +1 -1
  231. package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +2 -1
  232. package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -1
  233. package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +1 -1
  234. package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -1
  235. package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -1
  236. package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +1 -1
  237. package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -1
  238. package/lib/extensions/Table/components/CreateTablePopover.d.ts +2 -1
  239. package/lib/extensions/Table/components/RichTextTable.d.ts +2 -1
  240. package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -1
  241. package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +1 -1
  242. package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +1 -1
  243. package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -1
  244. package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +1 -1
  245. package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +1 -1
  246. package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -1
  247. package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -1
  248. package/lib/index-BJQ1G8B1.js +311 -0
  249. package/lib/index-BO82_0q8.cjs +1 -0
  250. package/lib/{index-D-Ouz0vF.js → index-Bn_WPziX.js} +1 -1
  251. package/lib/index-CwbGrQFa.cjs +1 -0
  252. package/lib/{index-oj858lQO.js → index-DKruDABV.js} +209 -209
  253. package/lib/{index-BAb_UADw.cjs → index-DN-IR-K0.cjs} +1 -1
  254. package/lib/{index-X6WZUM9O.js → index-DRcwHivm.js} +1702 -1486
  255. package/lib/index-DUeBQoIA.cjs +1 -0
  256. package/lib/index-DeoYYWEA.js +1756 -0
  257. package/lib/{index-CUvjYuRp.cjs → index-Dgs2thVL.cjs} +1 -1
  258. package/lib/index-DjB2kNdz.js +1120 -0
  259. package/lib/{index-zw-Kd38i.js → index-DuWMq-Qs.js} +1 -1
  260. package/lib/index-EoGU7W4e.cjs +26 -0
  261. package/lib/index-MDz4NZcT.cjs +12 -0
  262. package/lib/{index-BblvcbTH.js → index-n4kM0Ll-.js} +1527 -1406
  263. package/lib/index-qZURFC5Q.cjs +2 -0
  264. package/lib/index.cjs +1 -1
  265. package/lib/index.js +2 -2
  266. package/lib/{jsx-runtime-CT7Pcg-t.js → jsx-runtime-DE8oVoME.js} +3 -1
  267. package/lib/locale-bundle.cjs +1 -1
  268. package/lib/locale-bundle.js +1 -1
  269. package/lib/locales/index.d.ts +1 -1
  270. package/lib/{popover-BfWFqCIs.js → popover-Beieacfy.js} +1 -1
  271. package/lib/{popover-BPzkMuyi.cjs → popover-Bl1kxRJX.cjs} +1 -1
  272. package/lib/{renderNodeView-D--fDFov.cjs → renderNodeView-BIgT6Ghg.cjs} +1 -1
  273. package/lib/{renderNodeView-CfWJK4rG.js → renderNodeView-Bi58v3DZ.js} +2 -2
  274. package/lib/{separator-DpaS43Gt.cjs → separator-DMLtkcoo.cjs} +1 -1
  275. package/lib/{separator-CBPrZizK.js → separator-DfvK668q.js} +11 -11
  276. package/lib/store/EditorEditableReactive.d.ts +1 -1
  277. package/lib/store/ThemeColorReactive.d.ts +1 -1
  278. package/lib/style.css +1 -1
  279. package/lib/{textarea-wvARZKyA.cjs → textarea-DV9Fw3y1.cjs} +1 -1
  280. package/lib/{textarea-Bl64keav.js → textarea-GXaWJbm9.js} +1 -1
  281. package/lib/theme.cjs +1 -1
  282. package/lib/theme.js +1 -1
  283. package/lib/types.d.ts +2 -2
  284. package/lib/{updatePosition-BwzAsiY0.js → updatePosition-DY1jI7qb.js} +2 -2
  285. package/lib/{updatePosition-DGPtRfWN.cjs → updatePosition-D_D-TbEu.cjs} +1 -1
  286. package/package.json +86 -72
  287. package/lib/Twitter--tfifMt1.cjs +0 -1
  288. package/lib/index-BF3EVCB1.cjs +0 -2
  289. package/lib/index-BG0kQamI.js +0 -285
  290. package/lib/index-Bcj8cyOO.cjs +0 -24
  291. package/lib/index-CGjT-a9h.js +0 -1377
  292. package/lib/index-CPTpXLfX.cjs +0 -11
  293. package/lib/index-CWw4s87s.cjs +0 -1
  294. package/lib/index-Cal5SPfB.js +0 -779
  295. package/lib/index-Gi752TMk.cjs +0 -1
  296. package/lib/index-NsYff_Ni.cjs +0 -1
@@ -0,0 +1,1120 @@
1
+ import { N as v, w as b, m as T, r as F, E as R, a as tt, p as P, i as C, b as et, c as nt, d as st, e as V } from "./index-n4kM0Ll-.js";
2
+ import { Fragment as rt } from "@tiptap/pm/model";
3
+ import { Plugin as it } from "@tiptap/pm/state";
4
+ var at = Object.defineProperty, ot = (t, e) => {
5
+ for (var n in e)
6
+ at(t, n, { get: e[n], enumerable: !0 });
7
+ }, ct = "listItem", H = "textStyle", B = /^\s*([-+*])\s$/, ut = v.create({
8
+ name: "bulletList",
9
+ addOptions() {
10
+ return {
11
+ itemTypeName: "listItem",
12
+ HTMLAttributes: {},
13
+ keepMarks: !1,
14
+ keepAttributes: !1
15
+ };
16
+ },
17
+ group: "block list",
18
+ content() {
19
+ return `${this.options.itemTypeName}+`;
20
+ },
21
+ parseHTML() {
22
+ return [{ tag: "ul" }];
23
+ },
24
+ renderHTML({ HTMLAttributes: t }) {
25
+ return ["ul", T(this.options.HTMLAttributes, t), 0];
26
+ },
27
+ markdownTokenName: "list",
28
+ parseMarkdown: (t, e) => t.type !== "list" || t.ordered ? [] : {
29
+ type: "bulletList",
30
+ content: t.items ? e.parseChildren(t.items) : []
31
+ },
32
+ renderMarkdown: (t, e) => t.content ? e.renderChildren(t.content, `
33
+ `) : "",
34
+ markdownOptions: {
35
+ indentsContent: !0
36
+ },
37
+ addCommands() {
38
+ return {
39
+ toggleBulletList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ct, this.editor.getAttributes(H)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
40
+ };
41
+ },
42
+ addKeyboardShortcuts() {
43
+ return {
44
+ "Mod-Shift-8": () => this.editor.commands.toggleBulletList()
45
+ };
46
+ },
47
+ addInputRules() {
48
+ let t = b({
49
+ find: B,
50
+ type: this.type
51
+ });
52
+ return (this.options.keepMarks || this.options.keepAttributes) && (t = b({
53
+ find: B,
54
+ type: this.type,
55
+ keepMarks: this.options.keepMarks,
56
+ keepAttributes: this.options.keepAttributes,
57
+ getAttributes: () => this.editor.getAttributes(H),
58
+ editor: this.editor
59
+ })), [t];
60
+ }
61
+ }), lt = (t, e, n) => {
62
+ const { selection: s } = t;
63
+ if (!s.empty)
64
+ return null;
65
+ const { $from: r } = s;
66
+ if (!r.parent.isTextblock || r.parentOffset !== r.parent.content.size)
67
+ return null;
68
+ let i = -1;
69
+ for (let d = r.depth; d > 0; d -= 1)
70
+ if (r.node(d).type.name === e) {
71
+ i = d;
72
+ break;
73
+ }
74
+ if (i < 0)
75
+ return null;
76
+ const o = r.node(i), a = r.index(i);
77
+ if (a + 1 >= o.childCount)
78
+ return null;
79
+ const u = o.child(a + 1);
80
+ if (!n.includes(u.type.name))
81
+ return null;
82
+ const h = t.schema.nodes[e];
83
+ let p = !1;
84
+ if (u.forEach((d) => {
85
+ d.type === h && d.childCount > 1 && (p = !0);
86
+ }), !p)
87
+ return null;
88
+ const c = t.doc.resolve(r.after()).nodeAfter;
89
+ if (!c || !n.includes(c.type.name))
90
+ return null;
91
+ const l = [];
92
+ return c.forEach((d) => {
93
+ l.push(d);
94
+ }), l.length === 0 ? null : {
95
+ listItemDepth: i,
96
+ nestedList: c,
97
+ nestedListPos: r.after(),
98
+ insertPos: r.after(i),
99
+ items: l
100
+ };
101
+ }, dt = (t, e, n, s) => {
102
+ const r = lt(t, n, s);
103
+ if (!r)
104
+ return !1;
105
+ const { selection: i } = t, { nestedList: o, nestedListPos: a, insertPos: u, items: h } = r, p = t.tr;
106
+ p.delete(a, a + o.nodeSize);
107
+ const c = p.mapping.map(u);
108
+ return p.insert(c, rt.from(h)), p.setSelection(i.map(p.doc, p.mapping)), e && e(p), !0;
109
+ }, pt = (t, e, n) => dt(t.state, t.view.dispatch, e, n), X = (t, e) => R.create({
110
+ name: `${t}BranchingDeleteKeymap`,
111
+ priority: 101,
112
+ addKeyboardShortcuts() {
113
+ const n = () => pt(this.editor, t, e);
114
+ return {
115
+ Delete: n,
116
+ "Mod-Delete": n
117
+ };
118
+ }
119
+ }), U = [
120
+ [1e3, "m"],
121
+ [900, "cm"],
122
+ [500, "d"],
123
+ [400, "cd"],
124
+ [100, "c"],
125
+ [90, "xc"],
126
+ [50, "l"],
127
+ [40, "xl"],
128
+ [10, "x"],
129
+ [9, "ix"],
130
+ [5, "v"],
131
+ [4, "iv"],
132
+ [1, "i"]
133
+ ], I = "abcdefghijklmnopqrstuvwxyz", ht = "[a-zA-Z]{1,2}", $ = String.raw`\d+|[ivxlcdmIVXLCDM]+|${ht}`;
134
+ function x(t) {
135
+ let e = t, n = "";
136
+ for (const [s, r] of U)
137
+ for (; e >= s; )
138
+ n += r, e -= s;
139
+ return n;
140
+ }
141
+ function S(t) {
142
+ return x(t).toUpperCase();
143
+ }
144
+ function W(t) {
145
+ const e = t.toLowerCase();
146
+ let n = 0, s = 0;
147
+ for (; n < e.length; ) {
148
+ let r = !1;
149
+ for (const [i, o] of U)
150
+ if (e.startsWith(o, n)) {
151
+ s += i, n += o.length, r = !0;
152
+ break;
153
+ }
154
+ if (!r)
155
+ return 0;
156
+ }
157
+ return s;
158
+ }
159
+ function ft(t) {
160
+ if (!/^[ivxlcdmIVXLCDM]+$/.test(t))
161
+ return !1;
162
+ const e = W(t);
163
+ return e <= 0 ? !1 : (t === t.toLowerCase() ? x(e) : S(e)) === t;
164
+ }
165
+ function mt(t) {
166
+ const e = t.toLowerCase();
167
+ if (e.length === 1)
168
+ return e.charCodeAt(0) - 97 + 1;
169
+ if (e.length === 2) {
170
+ const n = e.charCodeAt(0) - 97, s = e.charCodeAt(1) - 97;
171
+ return (n + 1) * 26 + s + 1;
172
+ }
173
+ return 0;
174
+ }
175
+ function A(t) {
176
+ if (t <= 26)
177
+ return I[t - 1];
178
+ const e = Math.floor((t - 1) / 26) - 1, n = (t - 1) % 26;
179
+ return e < 0 ? I[n] : I[e] + I[n];
180
+ }
181
+ function M(t) {
182
+ if (!(!t || /^\d+$/.test(t))) {
183
+ if (ft(t))
184
+ return t === t.toLowerCase() ? "i" : "I";
185
+ if (/^[a-z]{1,2}$/.test(t))
186
+ return "a";
187
+ if (/^[A-Z]{1,2}$/.test(t))
188
+ return "A";
189
+ }
190
+ }
191
+ function D(t) {
192
+ if (/^\d+$/.test(t))
193
+ return parseInt(t, 10);
194
+ const e = M(t);
195
+ if (e === "i" || e === "I")
196
+ return W(t);
197
+ if (e === "a" || e === "A") {
198
+ const s = mt(t);
199
+ return s > 0 ? s : 1;
200
+ }
201
+ const n = parseInt(t, 10);
202
+ return Number.isNaN(n) ? 1 : n;
203
+ }
204
+ function Lt(t, e) {
205
+ if (t === "numeric")
206
+ return String(e);
207
+ switch (t) {
208
+ case "a":
209
+ return A(e);
210
+ case "A":
211
+ return A(e).toUpperCase();
212
+ case "i":
213
+ return x(e);
214
+ case "I":
215
+ return S(e);
216
+ default:
217
+ return String(e);
218
+ }
219
+ }
220
+ function kt(t) {
221
+ var e;
222
+ if (t.length === 0)
223
+ return !1;
224
+ const n = (e = M(t[0])) != null ? e : "numeric", s = D(t[0]);
225
+ if (s < 1)
226
+ return !1;
227
+ for (let r = 0; r < t.length; r++) {
228
+ const i = Lt(n, s + r);
229
+ if (t[r] !== i)
230
+ return !1;
231
+ }
232
+ return !0;
233
+ }
234
+ function yt(t) {
235
+ return {
236
+ type: M(t),
237
+ start: D(t)
238
+ };
239
+ }
240
+ function gt(t) {
241
+ const { type: e, start: n } = yt(t), s = {};
242
+ return e && (s.type = e), n !== 1 && (s.start = n), s;
243
+ }
244
+ function bt(t, e, n = ". ") {
245
+ const s = e + 1;
246
+ if (!t || t === "1")
247
+ return `${s}${n}`;
248
+ switch (t) {
249
+ case "a":
250
+ return `${A(s)}${n}`;
251
+ case "A":
252
+ return `${A(s).toUpperCase()}${n}`;
253
+ case "i":
254
+ return `${x(s)}${n}`;
255
+ case "I":
256
+ return `${S(s)}${n}`;
257
+ default:
258
+ return `${s}${n}`;
259
+ }
260
+ }
261
+ function vt(t) {
262
+ var e, n;
263
+ const s = (e = t.tokens) == null ? void 0 : e[0];
264
+ return !!(t.text && ((n = t.tokens) == null ? void 0 : n.length) === 1 && (s == null ? void 0 : s.type) === "list" && s.ordered && s.raw === t.text);
265
+ }
266
+ function Tt(t, e) {
267
+ return e.tokenizeInline ? e.parseInline(e.tokenizeInline(t)) : e.parseInline([
268
+ {
269
+ type: "text",
270
+ raw: t,
271
+ text: t
272
+ }
273
+ ]);
274
+ }
275
+ var It = v.create({
276
+ name: "listItem",
277
+ addOptions() {
278
+ return {
279
+ HTMLAttributes: {},
280
+ bulletListTypeName: "bulletList",
281
+ orderedListTypeName: "orderedList"
282
+ };
283
+ },
284
+ content: "paragraph block*",
285
+ defining: !0,
286
+ parseHTML() {
287
+ return [
288
+ {
289
+ tag: "li"
290
+ }
291
+ ];
292
+ },
293
+ renderHTML({ HTMLAttributes: t }) {
294
+ return ["li", T(this.options.HTMLAttributes, t), 0];
295
+ },
296
+ markdownTokenName: "list_item",
297
+ parseMarkdown: (t, e) => {
298
+ var n;
299
+ if (t.type !== "list_item")
300
+ return [];
301
+ const s = (n = e.parseBlockChildren) != null ? n : e.parseChildren;
302
+ let r = [];
303
+ if (t.tokens && t.tokens.length > 0) {
304
+ if (vt(t))
305
+ return {
306
+ type: "listItem",
307
+ content: [
308
+ {
309
+ type: "paragraph",
310
+ content: Tt(t.text || "", e)
311
+ }
312
+ ]
313
+ };
314
+ if (t.tokens.some((o) => o.type === "paragraph"))
315
+ r = s(t.tokens);
316
+ else {
317
+ const o = t.tokens[0];
318
+ if (o && o.type === "text" && o.tokens && o.tokens.length > 0) {
319
+ if (r = [
320
+ {
321
+ type: "paragraph",
322
+ content: e.parseInline(o.tokens)
323
+ }
324
+ ], t.tokens.length > 1) {
325
+ const u = t.tokens.slice(1), h = s(u);
326
+ r.push(...h);
327
+ }
328
+ } else
329
+ r = s(t.tokens);
330
+ }
331
+ }
332
+ return r.length === 0 && (r = [
333
+ {
334
+ type: "paragraph",
335
+ content: []
336
+ }
337
+ ]), {
338
+ type: "listItem",
339
+ content: r
340
+ };
341
+ },
342
+ renderMarkdown: (t, e, n) => F(
343
+ t,
344
+ e,
345
+ (s) => {
346
+ var r, i, o, a;
347
+ if (s.parentType === "bulletList")
348
+ return "- ";
349
+ if (s.parentType === "orderedList") {
350
+ const u = ((i = (r = s.meta) == null ? void 0 : r.parentAttrs) == null ? void 0 : i.start) || 1, h = (a = (o = s.meta) == null ? void 0 : o.parentAttrs) == null ? void 0 : a.type, p = u - 1 + (s.index || 0);
351
+ return bt(h, p, ". ");
352
+ }
353
+ return "- ";
354
+ },
355
+ n
356
+ ),
357
+ addExtensions() {
358
+ return [
359
+ X(this.name, [
360
+ this.options.bulletListTypeName,
361
+ this.options.orderedListTypeName
362
+ ])
363
+ ];
364
+ },
365
+ addKeyboardShortcuts() {
366
+ return {
367
+ Enter: () => this.editor.commands.splitListItem(this.name),
368
+ Tab: () => this.editor.commands.sinkListItem(this.name),
369
+ "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
370
+ };
371
+ }
372
+ }), At = {};
373
+ ot(At, {
374
+ findListItemPos: () => w,
375
+ getNextListDepth: () => O,
376
+ handleBackspace: () => E,
377
+ handleDelete: () => N,
378
+ hasListBefore: () => G,
379
+ hasListItemAfter: () => xt,
380
+ hasListItemBefore: () => Mt,
381
+ listItemHasSubList: () => wt,
382
+ nextListIsDeeper: () => q,
383
+ nextListIsHigher: () => Z
384
+ });
385
+ var w = (t, e) => {
386
+ const { $from: n } = e.selection, s = V(t, e.schema);
387
+ let r = null, i = n.depth, o = n.pos, a = null;
388
+ for (; i > 0 && a === null; )
389
+ r = n.node(i), r.type === s ? a = i : (i -= 1, o -= 1);
390
+ return a === null ? null : { $pos: e.doc.resolve(o), depth: a };
391
+ }, O = (t, e) => {
392
+ const n = w(t, e);
393
+ if (!n)
394
+ return !1;
395
+ const [, s] = st(e, t, n.$pos.pos + 4);
396
+ return s;
397
+ }, G = (t, e, n) => {
398
+ const { $anchor: s } = t.selection, r = Math.max(0, s.pos - 2), i = t.doc.resolve(r).node();
399
+ return !(!i || !n.includes(i.type.name));
400
+ }, E = (t, e, n) => {
401
+ if (t.commands.undoInputRule())
402
+ return !0;
403
+ if (t.state.selection.from !== t.state.selection.to)
404
+ return !1;
405
+ if (!C(t.state, e) && G(t.state, e, n)) {
406
+ const { $anchor: s } = t.state.selection, r = t.state.doc.resolve(s.before() - 1), i = [];
407
+ r.node().descendants((u, h) => {
408
+ u.type.name === e && i.push({ node: u, pos: h });
409
+ });
410
+ const o = i.at(-1);
411
+ if (!o)
412
+ return !1;
413
+ const a = t.state.doc.resolve(r.start() + o.pos + 1);
414
+ return t.chain().cut({ from: s.start() - 1, to: s.end() + 1 }, a.end()).joinForward().run();
415
+ }
416
+ return !C(t.state, e) || !et(t.state) ? !1 : t.chain().liftListItem(e).run();
417
+ }, q = (t, e) => {
418
+ const n = O(t, e), s = w(t, e);
419
+ return !s || !n ? !1 : n > s.depth;
420
+ }, Z = (t, e) => {
421
+ const n = O(t, e), s = w(t, e);
422
+ return !s || !n ? !1 : n < s.depth;
423
+ }, N = (t, e) => {
424
+ if (!C(t.state, e) || !nt(t.state, e))
425
+ return !1;
426
+ const { selection: n } = t.state, { $from: s, $to: r } = n;
427
+ return !n.empty && s.sameParent(r) ? !1 : q(e, t.state) ? t.chain().focus(t.state.selection.from + 4).lift(e).joinBackward().run() : Z(e, t.state) ? t.chain().joinForward().joinBackward().run() : t.commands.joinItemForward();
428
+ }, xt = (t, e) => {
429
+ var n;
430
+ const { $anchor: s } = e.selection, r = e.doc.resolve(s.pos - s.parentOffset - 2);
431
+ return !(r.index() === r.parent.childCount - 1 || ((n = r.nodeAfter) == null ? void 0 : n.type.name) !== t);
432
+ }, Mt = (t, e) => {
433
+ var n;
434
+ const { $anchor: s } = e.selection, r = e.doc.resolve(s.pos - 2);
435
+ return !(r.index() === 0 || ((n = r.nodeBefore) == null ? void 0 : n.type.name) !== t);
436
+ }, wt = (t, e, n) => {
437
+ if (!n)
438
+ return !1;
439
+ const s = V(t, e.schema);
440
+ let r = !1;
441
+ return n.descendants((i) => {
442
+ i.type === s && (r = !0);
443
+ }), r;
444
+ }, Ct = R.create({
445
+ name: "listKeymap",
446
+ addOptions() {
447
+ return {
448
+ listTypes: [
449
+ {
450
+ itemName: "listItem",
451
+ wrapperNames: ["bulletList", "orderedList"]
452
+ },
453
+ {
454
+ itemName: "taskItem",
455
+ wrapperNames: ["taskList"]
456
+ }
457
+ ]
458
+ };
459
+ },
460
+ addKeyboardShortcuts() {
461
+ return {
462
+ Delete: ({ editor: t }) => {
463
+ let e = !1;
464
+ return this.options.listTypes.forEach(({ itemName: n }) => {
465
+ t.state.schema.nodes[n] !== void 0 && N(t, n) && (e = !0);
466
+ }), e;
467
+ },
468
+ "Mod-Delete": ({ editor: t }) => {
469
+ let e = !1;
470
+ return this.options.listTypes.forEach(({ itemName: n }) => {
471
+ t.state.schema.nodes[n] !== void 0 && N(t, n) && (e = !0);
472
+ }), e;
473
+ },
474
+ Backspace: ({ editor: t }) => {
475
+ let e = !1;
476
+ return this.options.listTypes.forEach(({ itemName: n, wrapperNames: s }) => {
477
+ t.state.schema.nodes[n] !== void 0 && E(t, n, s) && (e = !0);
478
+ }), e;
479
+ },
480
+ "Mod-Backspace": ({ editor: t }) => {
481
+ let e = !1;
482
+ return this.options.listTypes.forEach(({ itemName: n, wrapperNames: s }) => {
483
+ t.state.schema.nodes[n] !== void 0 && E(t, n, s) && (e = !0);
484
+ }), e;
485
+ }
486
+ };
487
+ }
488
+ }), _ = new RegExp(
489
+ `^(\\s*)(${$})([.)])\\s+(.*)$`
490
+ ), Et = new RegExp(
491
+ `^(\\s*)(${$})([.)])\\s+`
492
+ ), Nt = /^\s/, g = {
493
+ heading: /^#{1,6}(?:\s|$)/,
494
+ bulletItem: /^[-+*]\s+/,
495
+ codeFence: /^(?:```|~~~)/,
496
+ thematicBreak: /^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/
497
+ };
498
+ function _t(t) {
499
+ return _.test(t.trimStart());
500
+ }
501
+ function Rt(t) {
502
+ const e = t.trimStart();
503
+ return g.bulletItem.test(e) || _t(e) || g.heading.test(e) || // dash breaks are excluded: "---" directly below paragraph text is a
504
+ // setext heading underline, not a thematic break
505
+ g.thematicBreak.test(e) && !e.startsWith("-") || // oxlint-disable-next-line prefer-string-starts-ends-with
506
+ /^>\s?/.test(e) || g.codeFence.test(e);
507
+ }
508
+ function $t(t) {
509
+ return Object.values(g).some((e) => e.test(t));
510
+ }
511
+ function St(t) {
512
+ const e = [], n = [];
513
+ let s = !1;
514
+ return t.forEach((r) => {
515
+ if (s) {
516
+ n.push(r);
517
+ return;
518
+ }
519
+ if (r.trim() === "") {
520
+ s = !0, n.push(r);
521
+ return;
522
+ }
523
+ if (e.length > 0 && Rt(r)) {
524
+ s = !0, n.push(r);
525
+ return;
526
+ }
527
+ e.push(r);
528
+ }), {
529
+ paragraphLines: e,
530
+ blockLines: n
531
+ };
532
+ }
533
+ function Dt(t) {
534
+ const e = [];
535
+ let n = 0, s = 0;
536
+ for (; n < t.length; ) {
537
+ const r = t[n], i = r.match(_);
538
+ if (!i)
539
+ break;
540
+ const [, o, a, u, h] = i, p = o.length, c = parseInt(a, 10), l = isNaN(c) ? M(a) : void 0, d = isNaN(c) ? D(a) : c, L = [h];
541
+ let f = n + 1;
542
+ const m = [r];
543
+ let y = !1;
544
+ for (; f < t.length; ) {
545
+ const k = t[f];
546
+ if (k.match(_))
547
+ break;
548
+ if (k.trim() === "")
549
+ m.push(k), L.push(""), y = !0, f += 1;
550
+ else if (k.match(Nt)) {
551
+ const Y = k.length - k.trimStart().length, Q = p + a.length + 1;
552
+ m.push(k), L.push(k.slice(Math.min(Y, Q))), f += 1;
553
+ } else {
554
+ if (y || $t(k))
555
+ break;
556
+ m.push(k), L.push(k), f += 1;
557
+ }
558
+ }
559
+ e.push({
560
+ indent: p,
561
+ number: d,
562
+ type: l,
563
+ content: L.join(`
564
+ `).trim(),
565
+ contentLines: L,
566
+ raw: m.join(`
567
+ `)
568
+ }), s = f, n = f;
569
+ }
570
+ return [e, s];
571
+ }
572
+ var Ot = new RegExp(
573
+ `^(${$})([.)])\\s+(.+)$`
574
+ );
575
+ function Pt(t) {
576
+ const e = t.split(`
577
+ `).filter((i) => i.trim().length > 0);
578
+ if (e.length === 0)
579
+ return null;
580
+ const n = [];
581
+ for (const i of e) {
582
+ const o = i.trim().match(Ot);
583
+ if (!o)
584
+ return null;
585
+ n.push({
586
+ marker: o[1],
587
+ content: o[3]
588
+ });
589
+ }
590
+ const s = n.map((i) => i.marker);
591
+ return kt(s) ? {
592
+ type: "orderedList",
593
+ attrs: gt(n[0].marker),
594
+ content: n.map((i) => ({
595
+ type: "listItem",
596
+ content: [
597
+ {
598
+ type: "paragraph",
599
+ content: [{ type: "text", text: i.content }]
600
+ }
601
+ ]
602
+ }))
603
+ } : null;
604
+ }
605
+ function J(t, e, n) {
606
+ const s = [];
607
+ let r = 0;
608
+ for (; r < t.length; ) {
609
+ const i = t[r];
610
+ if (i.indent === e) {
611
+ const { paragraphLines: o, blockLines: a } = St(i.contentLines), u = o.join(`
612
+ `).trim(), h = [];
613
+ u && h.push({
614
+ type: "paragraph",
615
+ raw: u,
616
+ tokens: n.inlineTokens(u)
617
+ });
618
+ const p = a.join(`
619
+ `).trim();
620
+ if (p) {
621
+ const d = n.blockTokens(p);
622
+ h.push(...d);
623
+ }
624
+ let c = r + 1;
625
+ const l = [];
626
+ for (; c < t.length && t[c].indent > e; )
627
+ l.push(t[c]), c += 1;
628
+ if (l.length > 0) {
629
+ const d = Math.min(...l.map((f) => f.indent)), L = J(l, d, n);
630
+ h.push({
631
+ type: "list",
632
+ ordered: !0,
633
+ start: l[0].number,
634
+ typeMarker: l[0].type,
635
+ items: L,
636
+ raw: l.map((f) => f.raw).join(`
637
+ `)
638
+ });
639
+ }
640
+ s.push({
641
+ type: "list_item",
642
+ raw: i.raw,
643
+ tokens: h
644
+ }), r = c;
645
+ } else
646
+ r += 1;
647
+ }
648
+ return s;
649
+ }
650
+ function Ht(t, e) {
651
+ return t.map((n) => {
652
+ if (n.type !== "list_item")
653
+ return e.parseChildren([n])[0];
654
+ const s = [];
655
+ return n.tokens && n.tokens.length > 0 && n.tokens.forEach((r) => {
656
+ if (r.type === "paragraph" || r.type === "list" || r.type === "blockquote" || r.type === "code")
657
+ s.push(...e.parseChildren([r]));
658
+ else if (r.type === "text" && r.tokens) {
659
+ const i = e.parseChildren([r]);
660
+ s.push({
661
+ type: "paragraph",
662
+ content: i
663
+ });
664
+ } else {
665
+ const i = e.parseChildren([r]);
666
+ i.length > 0 && s.push(...i);
667
+ }
668
+ }), {
669
+ type: "listItem",
670
+ content: s
671
+ };
672
+ });
673
+ }
674
+ var Bt = "listItem", j = "textStyle", K = /^(\d+)\.\s$/;
675
+ function z(t) {
676
+ const e = t.match(/list-style-type\s*:\s*([^;]+)/i);
677
+ if (!e)
678
+ return null;
679
+ switch (e[1].trim().toLowerCase()) {
680
+ case "upper-roman":
681
+ return "I";
682
+ case "lower-roman":
683
+ return "i";
684
+ case "upper-alpha":
685
+ case "upper-latin":
686
+ return "A";
687
+ case "lower-alpha":
688
+ case "lower-latin":
689
+ return "a";
690
+ default:
691
+ return null;
692
+ }
693
+ }
694
+ var jt = v.create({
695
+ name: "orderedList",
696
+ addOptions() {
697
+ return {
698
+ itemTypeName: "listItem",
699
+ HTMLAttributes: {},
700
+ keepMarks: !1,
701
+ keepAttributes: !1
702
+ };
703
+ },
704
+ group: "block list",
705
+ content() {
706
+ return `${this.options.itemTypeName}+`;
707
+ },
708
+ addAttributes() {
709
+ return {
710
+ start: {
711
+ default: 1,
712
+ parseHTML: (t) => t.hasAttribute("start") ? parseInt(t.getAttribute("start") || "", 10) : 1
713
+ },
714
+ type: {
715
+ default: null,
716
+ parseHTML: (t) => {
717
+ const e = t.getAttribute("type");
718
+ if (e)
719
+ return e;
720
+ const n = t.getAttribute("style");
721
+ if (n) {
722
+ const r = z(n);
723
+ if (r)
724
+ return r;
725
+ }
726
+ const s = t.querySelector("li");
727
+ if (s) {
728
+ const r = s.getAttribute("style");
729
+ if (r) {
730
+ const i = z(r);
731
+ if (i)
732
+ return i;
733
+ }
734
+ }
735
+ return null;
736
+ }
737
+ }
738
+ };
739
+ },
740
+ parseHTML() {
741
+ return [
742
+ {
743
+ tag: "ol"
744
+ }
745
+ ];
746
+ },
747
+ renderHTML({ HTMLAttributes: t }) {
748
+ const { start: e, type: n, ...s } = t, r = T(this.options.HTMLAttributes, s);
749
+ return e !== 1 && (r.start = e), n && n !== "1" && (r.type = n), ["ol", r, 0];
750
+ },
751
+ markdownTokenName: "list",
752
+ parseMarkdown: (t, e) => {
753
+ if (t.type !== "list" || !t.ordered)
754
+ return [];
755
+ const n = t.start || 1, s = t.typeMarker, r = t.items ? Ht(t.items, e) : [], i = {};
756
+ return n !== 1 && (i.start = n), s && (i.type = s), Object.keys(i).length > 0 ? {
757
+ type: "orderedList",
758
+ attrs: i,
759
+ content: r
760
+ } : {
761
+ type: "orderedList",
762
+ content: r
763
+ };
764
+ },
765
+ renderMarkdown: (t, e) => t.content ? e.renderChildren(t.content, `
766
+ `) : "",
767
+ markdownTokenizer: {
768
+ name: "orderedList",
769
+ level: "block",
770
+ start: (t) => {
771
+ const e = t.match(Et), n = e == null ? void 0 : e.index;
772
+ return n !== void 0 ? n : -1;
773
+ },
774
+ tokenize: (t, e, n) => {
775
+ var s, r;
776
+ const i = t.split(`
777
+ `), [o, a] = Dt(i);
778
+ if (o.length === 0)
779
+ return;
780
+ const u = J(o, o[0].indent, n);
781
+ if (u.length === 0)
782
+ return;
783
+ const h = ((s = o[0]) == null ? void 0 : s.number) || 1, p = (r = o[0]) == null ? void 0 : r.type;
784
+ return {
785
+ type: "list",
786
+ ordered: !0,
787
+ start: h,
788
+ typeMarker: p,
789
+ items: u,
790
+ raw: i.slice(0, a).join(`
791
+ `)
792
+ };
793
+ }
794
+ },
795
+ markdownOptions: {
796
+ indentsContent: !0
797
+ },
798
+ addCommands() {
799
+ return {
800
+ toggleOrderedList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Bt, this.editor.getAttributes(j)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
801
+ };
802
+ },
803
+ addKeyboardShortcuts() {
804
+ return {
805
+ "Mod-Shift-7": () => this.editor.commands.toggleOrderedList()
806
+ };
807
+ },
808
+ addProseMirrorPlugins() {
809
+ return [
810
+ new it({
811
+ props: {
812
+ handlePaste: (t, e) => {
813
+ var n, s;
814
+ const r = (n = e.clipboardData) == null ? void 0 : n.getData("text/html");
815
+ if (r != null && r.trim())
816
+ return !1;
817
+ const i = (s = e.clipboardData) == null ? void 0 : s.getData("text/plain");
818
+ if (!i)
819
+ return !1;
820
+ const o = Pt(i);
821
+ if (!o)
822
+ return !1;
823
+ try {
824
+ const a = t.state.schema.nodeFromJSON(o), u = t.state.tr.replaceSelectionWith(a);
825
+ return t.dispatch(u), !0;
826
+ } catch {
827
+ return !1;
828
+ }
829
+ }
830
+ }
831
+ })
832
+ ];
833
+ },
834
+ addInputRules() {
835
+ const t = (n, s) => (!s.attrs.type || s.attrs.type === "1") && s.childCount + s.attrs.start === +n[1];
836
+ let e = b({
837
+ find: K,
838
+ type: this.type,
839
+ getAttributes: (n) => ({ start: +n[1] }),
840
+ joinPredicate: t
841
+ });
842
+ return (this.options.keepMarks || this.options.keepAttributes) && (e = b({
843
+ find: K,
844
+ type: this.type,
845
+ keepMarks: this.options.keepMarks,
846
+ keepAttributes: this.options.keepAttributes,
847
+ getAttributes: (n) => ({ start: +n[1], ...this.editor.getAttributes(j) }),
848
+ joinPredicate: t,
849
+ editor: this.editor
850
+ })), [e];
851
+ }
852
+ }), Kt = /^\s*(\[([( |x])?\])\s$/, zt = v.create({
853
+ name: "taskItem",
854
+ addOptions() {
855
+ return {
856
+ nested: !1,
857
+ HTMLAttributes: {},
858
+ taskListTypeName: "taskList",
859
+ a11y: void 0
860
+ };
861
+ },
862
+ content() {
863
+ return this.options.nested ? "paragraph block*" : "paragraph+";
864
+ },
865
+ defining: !0,
866
+ addAttributes() {
867
+ return {
868
+ checked: {
869
+ default: !1,
870
+ keepOnSplit: !1,
871
+ parseHTML: (t) => {
872
+ const e = t.getAttribute("data-checked");
873
+ return e === "" || e === "true";
874
+ },
875
+ renderHTML: (t) => ({
876
+ "data-checked": t.checked
877
+ })
878
+ }
879
+ };
880
+ },
881
+ parseHTML() {
882
+ return [
883
+ {
884
+ tag: `li[data-type="${this.name}"]`,
885
+ priority: 51
886
+ }
887
+ ];
888
+ },
889
+ renderHTML({ node: t, HTMLAttributes: e }) {
890
+ return [
891
+ "li",
892
+ T(this.options.HTMLAttributes, e, {
893
+ "data-type": this.name
894
+ }),
895
+ [
896
+ "label",
897
+ [
898
+ "input",
899
+ {
900
+ type: "checkbox",
901
+ checked: t.attrs.checked ? "checked" : null
902
+ }
903
+ ],
904
+ ["span"]
905
+ ],
906
+ ["div", 0]
907
+ ];
908
+ },
909
+ parseMarkdown: (t, e) => {
910
+ const n = [];
911
+ if (t.tokens && t.tokens.length > 0 ? n.push(e.createNode("paragraph", {}, e.parseInline(t.tokens))) : t.text ? n.push(e.createNode("paragraph", {}, [e.createNode("text", { text: t.text })])) : n.push(e.createNode("paragraph", {}, [])), t.nestedTokens && t.nestedTokens.length > 0) {
912
+ const s = e.parseChildren(t.nestedTokens);
913
+ n.push(...s);
914
+ }
915
+ return e.createNode("taskItem", { checked: t.checked || !1 }, n);
916
+ },
917
+ renderMarkdown: (t, e) => {
918
+ var n;
919
+ const r = `- [${(n = t.attrs) != null && n.checked ? "x" : " "}] `;
920
+ return F(t, e, r);
921
+ },
922
+ addExtensions() {
923
+ return this.options.nested ? [X(this.name, [this.options.taskListTypeName])] : [];
924
+ },
925
+ addKeyboardShortcuts() {
926
+ const t = {
927
+ Enter: () => this.editor.commands.splitListItem(this.name),
928
+ "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
929
+ };
930
+ return this.options.nested ? {
931
+ ...t,
932
+ Tab: () => this.editor.commands.sinkListItem(this.name)
933
+ } : t;
934
+ },
935
+ addNodeView() {
936
+ return ({ node: t, HTMLAttributes: e, getPos: n, editor: s }) => {
937
+ const r = document.createElement("li"), i = document.createElement("label"), o = document.createElement("span"), a = document.createElement("input"), u = document.createElement("div"), h = (c) => {
938
+ var l, d;
939
+ a.ariaLabel = ((d = (l = this.options.a11y) == null ? void 0 : l.checkboxLabel) == null ? void 0 : d.call(l, c, a.checked)) || `Task item checkbox for ${c.textContent || "empty task item"}`;
940
+ };
941
+ h(t), i.contentEditable = "false", a.type = "checkbox", a.addEventListener("mousedown", (c) => c.preventDefault()), a.addEventListener("change", (c) => {
942
+ if (!s.isEditable && !this.options.onReadOnlyChecked) {
943
+ a.checked = !a.checked;
944
+ return;
945
+ }
946
+ const { checked: l } = c.target;
947
+ s.isEditable && typeof n == "function" && s.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: d }) => {
948
+ const L = n();
949
+ if (typeof L != "number")
950
+ return !1;
951
+ const f = d.doc.nodeAt(L);
952
+ return d.setNodeMarkup(L, void 0, {
953
+ ...f == null ? void 0 : f.attrs,
954
+ checked: l
955
+ }), !0;
956
+ }).run(), !s.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, l) || (a.checked = !a.checked));
957
+ }), Object.entries(this.options.HTMLAttributes).forEach(([c, l]) => {
958
+ r.setAttribute(c, l);
959
+ }), r.dataset.checked = t.attrs.checked, a.checked = t.attrs.checked, i.append(a, o), r.append(i, u), Object.entries(e).forEach(([c, l]) => {
960
+ r.setAttribute(c, l);
961
+ });
962
+ let p = new Set(Object.keys(e));
963
+ return {
964
+ dom: r,
965
+ contentDOM: u,
966
+ update: (c) => {
967
+ if (c.type !== this.type)
968
+ return !1;
969
+ r.dataset.checked = c.attrs.checked, a.checked = c.attrs.checked, h(c);
970
+ const l = s.extensionManager.attributes, d = tt(c, l), L = new Set(Object.keys(d)), f = this.options.HTMLAttributes;
971
+ return p.forEach((m) => {
972
+ L.has(m) || (m in f ? r.setAttribute(m, f[m]) : r.removeAttribute(m));
973
+ }), Object.entries(d).forEach(([m, y]) => {
974
+ y == null ? m in f ? r.setAttribute(m, f[m]) : r.removeAttribute(m) : r.setAttribute(m, y);
975
+ }), p = L, !0;
976
+ }
977
+ };
978
+ };
979
+ },
980
+ addInputRules() {
981
+ return [
982
+ b({
983
+ find: Kt,
984
+ type: this.type,
985
+ getAttributes: (t) => ({
986
+ checked: t[t.length - 1] === "x"
987
+ })
988
+ })
989
+ ];
990
+ }
991
+ }), Ft = v.create({
992
+ name: "taskList",
993
+ addOptions() {
994
+ return {
995
+ itemTypeName: "taskItem",
996
+ HTMLAttributes: {}
997
+ };
998
+ },
999
+ group: "block list",
1000
+ content() {
1001
+ return `${this.options.itemTypeName}+`;
1002
+ },
1003
+ parseHTML() {
1004
+ return [
1005
+ {
1006
+ tag: `ul[data-type="${this.name}"]`,
1007
+ priority: 51
1008
+ }
1009
+ ];
1010
+ },
1011
+ renderHTML({ HTMLAttributes: t }) {
1012
+ return [
1013
+ "ul",
1014
+ T(this.options.HTMLAttributes, t, { "data-type": this.name }),
1015
+ 0
1016
+ ];
1017
+ },
1018
+ parseMarkdown: (t, e) => e.createNode("taskList", {}, e.parseChildren(t.items || [])),
1019
+ renderMarkdown: (t, e) => t.content ? e.renderChildren(t.content, `
1020
+ `) : "",
1021
+ markdownTokenizer: {
1022
+ name: "taskList",
1023
+ level: "block",
1024
+ start(t) {
1025
+ var e;
1026
+ const n = (e = t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)) == null ? void 0 : e.index;
1027
+ return n !== void 0 ? n : -1;
1028
+ },
1029
+ tokenize(t, e, n) {
1030
+ const s = (i) => {
1031
+ const o = P(
1032
+ i,
1033
+ {
1034
+ itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
1035
+ extractItemData: (a) => ({
1036
+ indentLevel: a[1].length,
1037
+ mainContent: a[4],
1038
+ checked: a[3].toLowerCase() === "x"
1039
+ }),
1040
+ createToken: (a, u) => ({
1041
+ type: "taskItem",
1042
+ raw: "",
1043
+ mainContent: a.mainContent,
1044
+ indentLevel: a.indentLevel,
1045
+ checked: a.checked,
1046
+ text: a.mainContent,
1047
+ tokens: n.inlineTokens(a.mainContent),
1048
+ nestedTokens: u
1049
+ }),
1050
+ // Allow recursive nesting
1051
+ customNestedParser: s
1052
+ },
1053
+ n
1054
+ );
1055
+ return o ? [
1056
+ {
1057
+ type: "taskList",
1058
+ raw: o.raw,
1059
+ items: o.items
1060
+ }
1061
+ ] : n.blockTokens(i);
1062
+ }, r = P(
1063
+ t,
1064
+ {
1065
+ itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
1066
+ extractItemData: (i) => ({
1067
+ indentLevel: i[1].length,
1068
+ mainContent: i[4],
1069
+ checked: i[3].toLowerCase() === "x"
1070
+ }),
1071
+ createToken: (i, o) => ({
1072
+ type: "taskItem",
1073
+ raw: "",
1074
+ mainContent: i.mainContent,
1075
+ indentLevel: i.indentLevel,
1076
+ checked: i.checked,
1077
+ text: i.mainContent,
1078
+ tokens: n.inlineTokens(i.mainContent),
1079
+ nestedTokens: o
1080
+ }),
1081
+ // Use the recursive parser for nested content
1082
+ customNestedParser: s
1083
+ },
1084
+ n
1085
+ );
1086
+ if (r)
1087
+ return {
1088
+ type: "taskList",
1089
+ raw: r.raw,
1090
+ items: r.items
1091
+ };
1092
+ }
1093
+ },
1094
+ markdownOptions: {
1095
+ indentsContent: !0
1096
+ },
1097
+ addCommands() {
1098
+ return {
1099
+ toggleTaskList: () => ({ commands: t }) => t.toggleList(this.name, this.options.itemTypeName)
1100
+ };
1101
+ },
1102
+ addKeyboardShortcuts() {
1103
+ return {
1104
+ "Mod-Shift-9": () => this.editor.commands.toggleTaskList()
1105
+ };
1106
+ }
1107
+ });
1108
+ R.create({
1109
+ name: "listKit",
1110
+ addExtensions() {
1111
+ const t = [];
1112
+ return this.options.bulletList !== !1 && t.push(ut.configure(this.options.bulletList)), this.options.listItem !== !1 && t.push(It.configure(this.options.listItem)), this.options.listKeymap !== !1 && t.push(Ct.configure(this.options.listKeymap)), this.options.orderedList !== !1 && t.push(jt.configure(this.options.orderedList)), this.options.taskItem !== !1 && t.push(zt.configure(this.options.taskItem)), this.options.taskList !== !1 && t.push(Ft.configure(this.options.taskList)), t;
1113
+ }
1114
+ });
1115
+ export {
1116
+ ut as B,
1117
+ jt as O,
1118
+ Ft as T,
1119
+ zt as a
1120
+ };