reactjs-tiptap-editor 1.0.25 → 1.0.26

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 (289) hide show
  1. package/lib/{ActionMenuButton-8cTG45Ft.js → ActionMenuButton-B4KDkZ0z.js} +1 -1
  2. package/lib/{ActionMenuButton-CXeFhner.cjs → ActionMenuButton-C3Cfeza9.cjs} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +25 -25
  5. package/lib/Blockquote.cjs +5 -5
  6. package/lib/Blockquote.js +1490 -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.cjs +1 -1
  12. package/lib/Callout.js +222 -8
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +2 -2
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +56 -39
  17. package/lib/CodeBlock.cjs +1 -1
  18. package/lib/CodeBlock.js +8 -4
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +2 -2
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +3 -3
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +2 -2
  25. package/lib/{Drawer-TJY4NuHx.cjs → Drawer-D7E9kTca.cjs} +1 -1
  26. package/lib/{Drawer-C-EO1uoK.js → Drawer-DA0FLHs9.js} +20 -20
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +4 -4
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +1644 -148
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +10 -10
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +2 -2
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +2 -2
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +5 -5
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +5 -5
  41. package/lib/FormatPainter.cjs +1 -0
  42. package/lib/FormatPainter.js +133 -0
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +10 -6
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +3 -3
  47. package/lib/History.cjs +7 -1
  48. package/lib/History.js +519 -478
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +2 -2
  51. package/lib/{Iframe-CGb6-2LD.js → Iframe-DZ3r3QzK.js} +7 -7
  52. package/lib/{Iframe-5zx43DL4.cjs → Iframe-OMVd0xa_.cjs} +1 -1
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +3 -3
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +6 -6
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +35 -35
  59. package/lib/ImportWord.cjs +1 -1
  60. package/lib/ImportWord.js +15 -15
  61. package/lib/{Indent-DuwV8s1t.cjs → Indent-QgCoonRk.cjs} +1 -1
  62. package/lib/{Indent-CdMYsDNS.js → Indent-kI4G-clX.js} +2 -2
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +2 -2
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +2 -2
  67. package/lib/{Katex-CCP_ZQz2.js → Katex-BPbXjcZQ.js} +6 -7
  68. package/lib/Katex-CUofhjB5.cjs +4 -0
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +3 -3
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +4 -4
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-B1m-TVMu.js → LinkEditBlock-BYWwH2_x.js} +59 -32
  76. package/lib/{LinkEditBlock-DQ8-iufJ.cjs → LinkEditBlock-Z7RRurvx.cjs} +2 -2
  77. package/lib/MarkdownPaste.cjs +1 -1
  78. package/lib/MarkdownPaste.js +1 -1
  79. package/lib/Mention.cjs +1 -1
  80. package/lib/Mention.js +9 -5
  81. package/lib/Mermaid.cjs +2 -2
  82. package/lib/Mermaid.js +61 -62
  83. package/lib/MoreMark.cjs +1 -1
  84. package/lib/MoreMark.js +5 -5
  85. package/lib/OrderedList.cjs +1 -1
  86. package/lib/OrderedList.js +2 -2
  87. package/lib/SearchAndReplace.cjs +1 -1
  88. package/lib/SearchAndReplace.js +14 -14
  89. package/lib/SlashCommand.cjs +1 -1
  90. package/lib/SlashCommand.js +7 -7
  91. package/lib/{SlashCommandNodeView-Dt6n1SP9.js → SlashCommandNodeView-C0l3Fb_3.js} +10 -10
  92. package/lib/{SlashCommandNodeView-DNixmQGa.cjs → SlashCommandNodeView-DPPmYEjC.cjs} +1 -1
  93. package/lib/Strike.cjs +1 -1
  94. package/lib/Strike.js +2 -2
  95. package/lib/{Table-C5JxBXef.cjs → Table-D5G3rfwb.cjs} +5 -5
  96. package/lib/{Table-DdEgaUwa.js → Table-DwseaFSD.js} +115 -97
  97. package/lib/Table.cjs +1 -1
  98. package/lib/Table.js +1 -1
  99. package/lib/TaskList.cjs +1 -1
  100. package/lib/TaskList.js +2 -2
  101. package/lib/TextAlign.cjs +1 -1
  102. package/lib/TextAlign.js +11 -11
  103. package/lib/TextDirection.cjs +1 -1
  104. package/lib/TextDirection.js +3 -3
  105. package/lib/TextUnderline.cjs +1 -1
  106. package/lib/TextUnderline.js +2 -2
  107. package/lib/{Twitter-Dnz9qyW0.js → Twitter-DP26Lkn8.js} +195 -195
  108. package/lib/Twitter-q4ZGZL0i.cjs +1 -0
  109. package/lib/Twitter.cjs +1 -1
  110. package/lib/Twitter.js +3 -3
  111. package/lib/Video.cjs +1 -1
  112. package/lib/Video.js +5 -5
  113. package/lib/bubble.cjs +6 -6
  114. package/lib/bubble.js +2783 -2137
  115. package/lib/{clsx-D6gYQn3o.cjs → clsx-DRbkQ4T7.cjs} +1 -1
  116. package/lib/{clsx-0OU6n9va.js → clsx-_bq4MQQ7.js} +14 -4
  117. package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -1
  118. package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -1
  119. package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -1
  120. package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -1
  121. package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -1
  122. package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -1
  123. package/lib/components/Bubble/RichTextBubbleKatex.d.ts +2 -1
  124. package/lib/components/Bubble/RichTextBubbleLink.d.ts +1 -1
  125. package/lib/components/Bubble/RichTextBubbleMedia.d.ts +3 -3
  126. package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +2 -1
  127. package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -1
  128. package/lib/components/Bubble/RichTextBubbleTable.d.ts +1 -1
  129. package/lib/components/Bubble/RichTextBubbleText.d.ts +1 -1
  130. package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -1
  131. package/lib/components/ColorPicker.d.ts +1 -1
  132. package/lib/components/ReactBus.d.ts +1 -1
  133. package/lib/components/RichTextProvider.d.ts +1 -1
  134. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -1
  135. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -1
  136. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +2 -1
  137. package/lib/components/icons/Activity.d.ts +2 -1
  138. package/lib/components/icons/Animas.d.ts +2 -1
  139. package/lib/components/icons/AspectRatio.d.ts +1 -1
  140. package/lib/components/icons/Blockquote.d.ts +1 -1
  141. package/lib/components/icons/CodeView.d.ts +1 -1
  142. package/lib/components/icons/ColumnAddLeft.d.ts +1 -1
  143. package/lib/components/icons/ColumnAddRight.d.ts +1 -1
  144. package/lib/components/icons/DeleteColumn.d.ts +1 -1
  145. package/lib/components/icons/DeleteRow.d.ts +1 -1
  146. package/lib/components/icons/Direction.d.ts +1 -1
  147. package/lib/components/icons/Excalidraw.d.ts +1 -1
  148. package/lib/components/icons/ExportPdf.d.ts +1 -1
  149. package/lib/components/icons/ExportWord.d.ts +2 -1
  150. package/lib/components/icons/FileWordOutline.d.ts +1 -1
  151. package/lib/components/icons/Flag.d.ts +2 -1
  152. package/lib/components/icons/Food.d.ts +2 -1
  153. package/lib/components/icons/GIfIcon.d.ts +1 -1
  154. package/lib/components/icons/Html.d.ts +1 -1
  155. package/lib/components/icons/Icon.d.ts +1 -1
  156. package/lib/components/icons/IconColorFill.d.ts +1 -1
  157. package/lib/components/icons/IconHighlightFill.d.ts +1 -1
  158. package/lib/components/icons/ImportWord.d.ts +2 -1
  159. package/lib/components/icons/LeftToRight.d.ts +1 -1
  160. package/lib/components/icons/LineHeight.d.ts +1 -1
  161. package/lib/components/icons/MenuDown.d.ts +1 -1
  162. package/lib/components/icons/Mermaid.d.ts +1 -1
  163. package/lib/components/icons/NoFill.d.ts +1 -1
  164. package/lib/components/icons/Object.d.ts +2 -1
  165. package/lib/components/icons/RightToLeft.d.ts +1 -1
  166. package/lib/components/icons/SizeL.d.ts +1 -1
  167. package/lib/components/icons/SizeM.d.ts +1 -1
  168. package/lib/components/icons/SizeS.d.ts +1 -1
  169. package/lib/components/icons/Symbol.d.ts +2 -1
  170. package/lib/components/icons/Travel.d.ts +2 -1
  171. package/lib/components/icons/Twitter.d.ts +1 -1
  172. package/lib/components/ui/dialog.d.ts +2 -2
  173. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  174. package/lib/components/ui/emoji-picker.d.ts +4 -4
  175. package/lib/components/ui/toaster.d.ts +1 -1
  176. package/lib/{dropdown-menu-ROihzXsP.js → dropdown-menu-BKSX4gvT.js} +1 -1
  177. package/lib/{dropdown-menu-yQ-sQ1k4.cjs → dropdown-menu-CURWpB9o.cjs} +1 -1
  178. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -1
  179. package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -1
  180. package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -1
  181. package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -1
  182. package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -1
  183. package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -1
  184. package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -1
  185. package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -1
  186. package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -1
  187. package/lib/extensions/Code/components/RichTextCode.d.ts +1 -1
  188. package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +2 -1
  189. package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -1
  190. package/lib/extensions/Color/components/RichTextColor.d.ts +1 -1
  191. package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -1
  192. package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -1
  193. package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +27 -27
  194. package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -1
  195. package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +2 -1
  196. package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -1
  197. package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +2 -1
  198. package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -1
  199. package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -1
  200. package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -1
  201. package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -1
  202. package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +1 -1
  203. package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +1 -1
  204. package/lib/extensions/FormatPainter/FormatPainter.d.ts +17 -0
  205. package/lib/extensions/FormatPainter/components/RichTextFormatPainter.d.ts +1 -0
  206. package/lib/extensions/FormatPainter/index.d.ts +1 -0
  207. package/lib/extensions/Heading/components/RichTextHeading.d.ts +1 -1
  208. package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +2 -1
  209. package/lib/extensions/History/components/RichTextHistory.d.ts +3 -2
  210. package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -1
  211. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +1 -1
  212. package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -1
  213. package/lib/extensions/Image/components/ImageCropper.d.ts +2 -1
  214. package/lib/extensions/Image/components/ImageView.d.ts +2 -1
  215. package/lib/extensions/Image/components/RichTextImage.d.ts +1 -1
  216. package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -1
  217. package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +2 -1
  218. package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -1
  219. package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -1
  220. package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -1
  221. package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -1
  222. package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -1
  223. package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -1
  224. package/lib/extensions/Link/components/LinkEditBlock.d.ts +1 -1
  225. package/lib/extensions/Link/components/LinkViewBlock.d.ts +2 -1
  226. package/lib/extensions/Link/components/RichTextLink.d.ts +1 -1
  227. package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +2 -1
  228. package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -1
  229. package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +1 -1
  230. package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -1
  231. package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -1
  232. package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +1 -1
  233. package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -1
  234. package/lib/extensions/Table/components/CreateTablePopover.d.ts +2 -1
  235. package/lib/extensions/Table/components/RichTextTable.d.ts +2 -1
  236. package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -1
  237. package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +1 -1
  238. package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +1 -1
  239. package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -1
  240. package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +1 -1
  241. package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +1 -1
  242. package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -1
  243. package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -1
  244. package/lib/index-BGfIcDCQ.cjs +26 -0
  245. package/lib/index-BaR0Brts.js +1115 -0
  246. package/lib/index-BgNKVyMW.cjs +2 -0
  247. package/lib/index-BpLw6ebr.cjs +1 -0
  248. package/lib/{index-X6WZUM9O.js → index-C52cuQ_Y.js} +1503 -1352
  249. package/lib/index-CDw4Eszh.cjs +12 -0
  250. package/lib/{index-CUvjYuRp.cjs → index-CHVV5iY-.cjs} +1 -1
  251. package/lib/{index-zw-Kd38i.js → index-CJMI7Fjf.js} +1 -1
  252. package/lib/{index-D-Ouz0vF.js → index-DQy9iBzV.js} +1 -1
  253. package/lib/index-Dbm_Mans.js +1756 -0
  254. package/lib/{index-oj858lQO.js → index-DtyAGMbq.js} +208 -208
  255. package/lib/{index-BblvcbTH.js → index-Dx-Dh7KS.js} +1464 -1348
  256. package/lib/{index-BAb_UADw.cjs → index-SEMQrdk2.cjs} +1 -1
  257. package/lib/index-aujjnfSJ.cjs +1 -0
  258. package/lib/index.cjs +1 -1
  259. package/lib/index.js +12 -12
  260. package/lib/{jsx-runtime-CT7Pcg-t.js → jsx-runtime-DE8oVoME.js} +3 -1
  261. package/lib/locale-bundle.cjs +1 -1
  262. package/lib/locale-bundle.js +1 -1
  263. package/lib/locales/index.d.ts +1 -1
  264. package/lib/{popover-BfWFqCIs.js → popover-BB-ZDnqk.js} +1 -1
  265. package/lib/{popover-BPzkMuyi.cjs → popover-CrywEkBR.cjs} +1 -1
  266. package/lib/{renderNodeView-D--fDFov.cjs → renderNodeView-5h3-p80E.cjs} +1 -1
  267. package/lib/{renderNodeView-CfWJK4rG.js → renderNodeView-DoKZ4GYy.js} +2 -2
  268. package/lib/{separator-DpaS43Gt.cjs → separator-BGO9AZp4.cjs} +1 -1
  269. package/lib/{separator-CBPrZizK.js → separator-DuuOJRQd.js} +21 -21
  270. package/lib/store/EditorEditableReactive.d.ts +1 -1
  271. package/lib/store/ThemeColorReactive.d.ts +1 -1
  272. package/lib/style.css +1 -1
  273. package/lib/types.d.ts +2 -2
  274. package/lib/{updatePosition-DGPtRfWN.cjs → updatePosition-B1oRJE1x.cjs} +1 -1
  275. package/lib/{updatePosition-BwzAsiY0.js → updatePosition-CFTYKYNJ.js} +2 -2
  276. package/package.json +79 -66
  277. package/lib/Callout-DWOMZPiP.cjs +0 -1
  278. package/lib/Callout-ZlPQrMEt.js +0 -340
  279. package/lib/Katex-D9FP7EUE.cjs +0 -4
  280. package/lib/Twitter--tfifMt1.cjs +0 -1
  281. package/lib/index-BF3EVCB1.cjs +0 -2
  282. package/lib/index-Bcj8cyOO.cjs +0 -24
  283. package/lib/index-CGjT-a9h.js +0 -1377
  284. package/lib/index-CPTpXLfX.cjs +0 -11
  285. package/lib/index-CWw4s87s.cjs +0 -1
  286. package/lib/index-Cal5SPfB.js +0 -779
  287. package/lib/index-Gi752TMk.cjs +0 -1
  288. package/lib/textarea-Bl64keav.js +0 -20
  289. package/lib/textarea-wvARZKyA.cjs +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { Slot as n } from "@radix-ui/react-slot";
3
3
  import r from "react";
4
- import { i as d, T as m, a as f, B as s, b as u, g } from "./index-X6WZUM9O.js";
4
+ import { i as d, T as m, a as f, B as s, b as u, g } from "./index-C52cuQ_Y.js";
5
5
  import "./theme.js";
6
6
  const C = r.forwardRef(
7
7
  ({ asChild: x = !1, tooltip: i, ...t }, l) => {
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-Gi752TMk.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-aujjnfSJ.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-Bcj8cyOO.cjs"),u=require("./clsx-D6gYQn3o.cjs"),s=require("./index-Gi752TMk.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),S=require("./index-CWw4s87s.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),B={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-BGfIcDCQ.cjs"),u=require("./clsx-DRbkQ4T7.cjs"),s=require("./index-aujjnfSJ.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),S=require("./index-BpLw6ebr.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),B={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
2
2
  <path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
3
3
  <path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
4
4
  </svg>`,word:`<svg
package/lib/Attachment.js CHANGED
@@ -1,11 +1,11 @@
1
- import { N as j, m as P } from "./index-BblvcbTH.js";
2
- import { N as x, c as y, a as D } from "./clsx-0OU6n9va.js";
3
- import { P as R, Q as $, U as I, F as O, V as W, W as Z, X as N, A as T, u as K, d as Q } from "./index-X6WZUM9O.js";
1
+ import { N as S, m as D } from "./index-Dx-Dh7KS.js";
2
+ import { N as x, c as y, a as P } from "./clsx-_bq4MQQ7.js";
3
+ import { Y as $, Z as R, _ as I, j as Z, $ as O, a0 as W, a1 as N, A as T, u as K, d as Y } from "./index-C52cuQ_Y.js";
4
4
  import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
5
- import { useRef as U, useState as X, useCallback as k, useEffect as q } from "react";
5
+ import { useRef as q, useState as G, useCallback as k, useEffect as J } from "react";
6
6
  import "./theme.js";
7
- import { LucideTableProperties as G, LucideSheet as J, LucideImage as Y, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
8
- import { u as ie } from "./index-oj858lQO.js";
7
+ import { LucideTableProperties as Q, LucideSheet as U, LucideImage as X, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
8
+ import { u as ie } from "./index-DtyAGMbq.js";
9
9
  import { g as c } from "./dom-dataset-CIEeltF6.js";
10
10
  const oe = {
11
11
  audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
@@ -56,14 +56,14 @@ const ae = {
56
56
  audio: /* @__PURE__ */ e(re, {}),
57
57
  video: /* @__PURE__ */ e(te, {}),
58
58
  file: /* @__PURE__ */ e(ee, {}),
59
- image: /* @__PURE__ */ e(Y, {}),
59
+ image: /* @__PURE__ */ e(X, {}),
60
60
  pdf: /* @__PURE__ */ e(I, {}),
61
- word: /* @__PURE__ */ e($, {}),
62
- excel: /* @__PURE__ */ e(J, {}),
63
- ppt: /* @__PURE__ */ e(G, {})
61
+ word: /* @__PURE__ */ e(R, {}),
62
+ excel: /* @__PURE__ */ e(U, {}),
63
+ ppt: /* @__PURE__ */ e(Q, {})
64
64
  };
65
65
  function b(t, o = !1) {
66
- const r = R(t), l = ae[r] || /* @__PURE__ */ e(L, {});
66
+ const r = $(t), l = ae[r] || /* @__PURE__ */ e(L, {});
67
67
  return o ? ne(r) : l;
68
68
  }
69
69
  const se = "_wrap_15oj2_2", M = {
@@ -71,22 +71,22 @@ const se = "_wrap_15oj2_2", M = {
71
71
  };
72
72
  function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
73
73
  var A;
74
- const n = U(null), i = O(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [F, v] = X(!1), { t: w } = ie(), V = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
74
+ const n = q(null), i = Z(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [F, v] = G(!1), { t: w } = ie(), V = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
75
75
  !i || u || n.current.click();
76
- }, [u, i]), B = k(
76
+ }, [u, i]), _ = k(
77
77
  async (C) => {
78
78
  const p = C.target.files && C.target.files[0];
79
79
  if (!p) return;
80
- const _ = {
81
- fileName: Z(p.name),
80
+ const B = {
81
+ fileName: W(p.name),
82
82
  fileSize: p.size,
83
83
  fileType: p.type,
84
- fileExt: W(p.name)
84
+ fileExt: O(p.name)
85
85
  };
86
86
  v(!0);
87
87
  try {
88
88
  const g = await V(p);
89
- r({ ..._, url: g }), v(!1);
89
+ r({ ...B, url: g }), v(!1);
90
90
  } catch (g) {
91
91
  r({
92
92
  error: `File upload fail: ${g && g.message}`
@@ -95,13 +95,13 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
95
95
  },
96
96
  [v, r]
97
97
  );
98
- q(() => {
98
+ J(() => {
99
99
  !u && !a && (m(), r({ hasTrigger: !0 }));
100
100
  }, [u, a, m, r]);
101
- const S = k(() => l(), [t]);
101
+ const j = k(() => l(), [t]);
102
102
  return i && !u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), children: [
103
103
  /* @__PURE__ */ e("p", { onClick: m, style: { cursor: "pointer" }, children: F ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") }) }),
104
- /* @__PURE__ */ e("input", { hidden: !0, onChange: B, ref: n, type: "file" })
104
+ /* @__PURE__ */ e("input", { hidden: !0, onChange: _, ref: n, type: "file" })
105
105
  ] }) }) : u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: [
106
106
  /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
107
107
  /* @__PURE__ */ e("span", { children: b(E) }),
@@ -116,7 +116,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
116
116
  ")"
117
117
  ] })
118
118
  ] }),
119
- /* @__PURE__ */ e(T, { action: S, icon: "Trash2", tooltip: w("editor.delete") })
119
+ /* @__PURE__ */ e(T, { action: j, icon: "Trash2", tooltip: w("editor.delete") })
120
120
  ] }) }) : H !== "null" ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: /* @__PURE__ */ e("p", { children: H }) }) }) : /* @__PURE__ */ e(L, {});
121
121
  }
122
122
  function xe() {
@@ -127,7 +127,7 @@ function xe() {
127
127
  tooltipOptions: s = {},
128
128
  action: n = void 0,
129
129
  isActive: i = void 0
130
- } = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } = Q(i), h = () => {
130
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } = Y(i), h = () => {
131
131
  a || n && (n(), d());
132
132
  };
133
133
  return t ? /* @__PURE__ */ e(
@@ -142,7 +142,7 @@ function xe() {
142
142
  }
143
143
  ) : /* @__PURE__ */ e(L, {});
144
144
  }
145
- const ce = /* @__PURE__ */ j.create({
145
+ const ce = /* @__PURE__ */ S.create({
146
146
  name: "attachment",
147
147
  content: "",
148
148
  marks: "",
@@ -183,7 +183,7 @@ const ce = /* @__PURE__ */ j.create({
183
183
  } = t || {};
184
184
  return [
185
185
  "div",
186
- P(
186
+ D(
187
187
  // @ts-expect-error
188
188
  this.options.HTMLAttributes || {},
189
189
  t || {}
@@ -238,7 +238,7 @@ const ce = /* @__PURE__ */ j.create({
238
238
  };
239
239
  },
240
240
  addNodeView() {
241
- return D(le);
241
+ return P(le);
242
242
  }
243
243
  });
244
244
  export {
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-Bcj8cyOO.cjs"),h=require("./jsx-runtime-C_NLcKys.cjs"),d=require("react/jsx-runtime"),p=require("./index-Gi752TMk.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,b=a.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return h.h("blockquote",{...a.mergeAttributes(this.options.HTMLAttributes,t),children:h.h("slot",{})})},parseMarkdown:(t,e)=>{var o;const n=(o=e.parseBlockChildren)!=null?o:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach((r,i)=>{var s,u;const l=((u=(s=e.renderChild)==null?void 0:s.call(e,r,i))!=null?u:e.renderChildren([r])).split(`
2
- `).map(q=>q.trim()===""?o:`${o} ${q}`);n.push(l.join(`
3
- `))}),n.join(`
4
- ${o}
5
- `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[a.wrappingInputRule({find:m,type:this.type})]}});function v(){const t=p.useButtonProps(g.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:n=void 0,tooltipOptions:r={},action:i=void 0,isActive:s=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:u,disabled:c,update:k}=p.useToggleActive(s),l=()=>{c||i&&(i(),k())};return t?d.jsx(p.ActionButton,{action:l,dataState:u,disabled:c,icon:e,shortcutKeys:n,tooltip:o,tooltipOptions:r}):d.jsx(d.Fragment,{})}const g=b.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:o,extension:n})=>({componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote"),disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:n.options.shortcutKeys??["shift","mod","B"],tooltip:o("editor.blockquote.tooltip")}})}}});exports.Blockquote=g;exports.RichTextBlockquote=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-BGfIcDCQ.cjs"),tt=require("./jsx-runtime-C_NLcKys.cjs"),$=require("react/jsx-runtime"),K=require("./index-aujjnfSJ.cjs");require("react");require("./theme.cjs");function at(n,t,e){for(let r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;let i=n.child(r),s=t.child(r);if(i==s){e+=i.nodeSize;continue}if(!i.sameMarkup(s))return e;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)e++;return e}if(i.content.size||s.content.size){let o=at(i.content,s.content,e+1);if(o!=null)return o}e+=i.nodeSize}}function lt(n,t,e,r){for(let i=n.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:e,b:r};let o=n.child(--i),a=t.child(--s),l=o.nodeSize;if(o==a){e-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:e,b:r};if(o.isText&&o.text!=a.text){let u=0,h=Math.min(o.text.length,a.text.length);for(;u<h&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,e--,r--;return{a:e,b:r}}if(o.content.size||a.content.size){let u=lt(o.content,a.content,e-1,r-1);if(u)return u}e-=l,r-=l}}var g=class m{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,e,r,i=0,s){for(let o=0,a=0;a<e;o++){let l=this.content[o],u=a+l.nodeSize;if(u>t&&r(l,i+a,s||null,o)!==!1&&l.content.size){let h=a+1;l.nodesBetween(Math.max(0,t-h),Math.min(l.content.size,e-h),r,i+h)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,r,i){let s="",o=!0;return this.nodesBetween(t,e,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,e-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(r)&&(i[i.length-1]=e.withText(e.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new m(i,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let r=[],i=0;if(e>t)for(let s=0,o=0;o<e;s++){let a=this.content[s],l=o+a.nodeSize;l>t&&((o<t||l>e)&&(a.isText?a=a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a=a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),r.push(a),i+=a.nodeSize),o=l}return new m(r,i)}cutByIndex(t,e){return t==e?m.empty:t==0&&e==this.content.length?this:new m(this.content.slice(t,e))}replaceChild(t,e){let r=this.content[t];if(r==e)return this;let i=this.content.slice(),s=this.size+e.nodeSize-r.nodeSize;return i[t]=e,new m(i,s)}addToStart(t){return new m([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new m(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,r=0;e<this.content.length;e++){let i=this.content[e];t(i,r,e),r+=i.nodeSize}}findDiffStart(t,e=0){return at(this,t,e)}findDiffEnd(t,e=this.size,r=t.size){return lt(this,t,e,r)}findIndex(t){if(t==0)return B(0,t);if(t==this.size)return B(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,r=0;;e++){let i=this.child(e),s=r+i.nodeSize;if(s>=t)return s==t?B(e+1,s):B(e,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return m.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return m.fromArray(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return m.empty;let e,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(e||(e=t.slice(0,i)),e[e.length-1]=s.withText(e[e.length-1].text+s.text)):e&&e.push(s)}return new m(e||t,r)}static from(t){if(!t)return m.empty;if(t instanceof m)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new m([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};g.empty=new g([],0);var W={index:0,offset:0};function B(n,t){return W.index=n,W.offset=t,W}var Ot=class extends Error{},c=class y{constructor(t,e,r){this.content=t,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let r=ht(this.content,t+this.openStart,e,this.openStart+1,this.openEnd+1);return r&&new y(r,this.openStart,this.openEnd)}removeBetween(t,e){return new y(ut(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return y.empty;let r=e.openStart||0,i=e.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new y(g.fromJSON(t,e.content),r,i)}static maxOpen(t,e=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)i++;return new y(t,r,i)}};c.empty=new c(g.empty,0,0);function ut(n,t,e){let{index:r,offset:i}=n.findIndex(t),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(e);if(i==t||s.isText){if(a!=e&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(ut(s.content,t-i-1,e-i-1)))}function ht(n,t,e,r,i,s){let{index:o,offset:a}=n.findIndex(t),l=n.maybeChild(o);if(a==t||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,e)?null:n.cut(0,t).append(e).append(n.cut(t));let u=ht(l.content,t-a-1,e,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return u&&n.replaceChild(o,l.copy(u))}var ct=65535,ft=Math.pow(2,16);function Tt(n,t){return n+t*ft}function et(n){return n&ct}function Et(n){return(n-(n&ct))/ft}var pt=1,mt=2,q=4,dt=8,rt=class{constructor(n,t,e){this.pos=n,this.delInfo=t,this.recover=e}get deleted(){return(this.delInfo&dt)>0}get deletedBefore(){return(this.delInfo&(pt|q))>0}get deletedAfter(){return(this.delInfo&(mt|q))>0}get deletedAcross(){return(this.delInfo&q)>0}},k=class x{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&x.empty)return x.empty}recover(t){let e=0,r=et(t);if(!this.inverted)for(let i=0;i<r;i++)e+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+e+Et(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[a+s],h=this.ranges[a+o],S=l+u;if(t<=S){let j=u?t==l?-1:t==S?1:e:e,T=l+i+(j<0?0:h);if(r)return T;let v=t==(e<0?l:S)?null:Tt(a/3,t-l),_=t==l?mt:t==S?pt:q;return(e<0?t!=l:t!=S)&&(_|=dt),new rt(T,_,v)}i+=h-u}return r?t+i:new rt(t+i,0,null)}touches(t,e){let r=0,i=et(e),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[a+s],h=l+u;if(t<=h&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+e],h=this.ranges[i+r];t(a,a+u,l,l+h),s+=h-u}}invert(){return new x(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?x.empty:new x(t<0?[0,-t,0]:[0,0,t])}};k.empty=new k([]);var V=Object.create(null),p=class{getMap(){return k.empty}merge(n){return null}static fromJSON(n,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let e=V[t.stepType];if(!e)throw new RangeError(`No step type ${t.stepType} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in V)throw new RangeError("Duplicate use of step JSON ID "+n);return V[n]=t,t.prototype.jsonID=n,t}},d=class E{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new E(t,null)}static fail(t){return new E(null,t)}static fromReplace(t,e,r,i){try{return E.ok(t.replace(e,r,i))}catch(s){if(s instanceof Ot)return E.fail(s.message);throw s}}};function Y(n,t,e){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Y(s.content,t,s))),s.isInline&&(s=t(s,e,i)),r.push(s)}return g.fromArray(r)}var St=class I extends p{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new c(Y(e.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),e.openStart,e.openEnd);return d.fromReplace(t,this.from,this.to,s)}invert(){return new gt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new I(e.pos,r.pos,this.mark)}merge(t){return t instanceof I&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new I(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new I(e.from,e.to,t.markFromJSON(e.mark))}};p.jsonID("addMark",St);var gt=class A extends p{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=new c(Y(e.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),e.openStart,e.openEnd);return d.fromReplace(t,this.from,this.to,r)}invert(){return new St(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new A(e.pos,r.pos,this.mark)}merge(t){return t instanceof A&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new A(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new A(e.from,e.to,t.markFromJSON(e.mark))}};p.jsonID("removeMark",gt);var wt=class z extends p{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return d.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(let i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new z(this.pos,e.marks[i]);return new z(this.pos,this.mark)}}return new kt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new z(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new z(e.pos,t.markFromJSON(e.mark))}};p.jsonID("addNodeMark",wt);var kt=class Q extends p{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return d.fromReplace(t,this.pos,this.pos+1,new c(g.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new wt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Q(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Q(e.pos,t.markFromJSON(e.mark))}};p.jsonID("removeNodeMark",kt);var Z=class w extends p{constructor(t,e,r,i=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=i}apply(t){return this.structure&&U(t,this.from,this.to)?d.fail("Structure replace would overwrite content"):d.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new k([this.from,this.to-this.from,this.slice.size])}invert(t){return new w(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.to,-1),r=this.from==this.to&&w.MAP_BIAS<0?e:t.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new w(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure)}merge(t){if(!(t instanceof w)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?c.empty:new c(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new w(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?c.empty:new c(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new w(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new w(e.from,e.to,c.fromJSON(t,e.slice),!!e.structure)}};Z.MAP_BIAS=1;p.jsonID("replace",Z);var vt=class D extends p{constructor(t,e,r,i,s,o,a=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(t){if(this.structure&&(U(t,this.from,this.gapFrom)||U(t,this.gapTo,this.to)))return d.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return d.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?d.fromReplace(t,this.from,this.to,r):d.fail("Content does not fit in gap")}getMap(){return new k([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new D(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||s>r.pos?null:new D(e.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new D(e.from,e.to,e.gapFrom,e.gapTo,c.fromJSON(t,e.slice),e.insert,!!e.structure)}};p.jsonID("replaceAround",vt);function U(n,t,e){let r=n.resolve(t),i=e-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}var It=class L extends p{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(t){let e=t.nodeAt(this.pos);if(!e)return d.fail("No node at attribute step's position");let r=Object.create(null);for(let s in e.attrs)r[s]=e.attrs[s];r[this.attr]=this.value;let i=e.type.create(r,null,e.marks);return d.fromReplace(t,this.pos,this.pos+1,new c(g.from(i),0,e.isLeaf?0:1))}getMap(){return k.empty}invert(t){return new L(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new L(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new L(e.pos,e.attr,e.value)}};p.jsonID("attr",It);var At=class X extends p{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let i in t.attrs)e[i]=t.attrs[i];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return d.ok(r)}getMap(){return k.empty}invert(t){return new X(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new X(e.attr,e.value)}};p.jsonID("docAttr",At);var C=class extends Error{};C=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e};C.prototype=Object.create(Error.prototype);C.prototype.constructor=C;C.prototype.name="TransformError";var G=Object.create(null),f=class{constructor(n,t,e){this.$anchor=n,this.$head=t,this.ranges=e||[new zt(n.min(t),n.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let n=this.ranges;for(let t=0;t<n.length;t++)if(n[t].$from.pos!=n[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(n,t=c.empty){let e=t.content.lastChild,r=null;for(let o=0;o<t.openEnd;o++)r=e,e=e.lastChild;let i=n.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:a,$to:l}=s[o],u=n.mapping.slice(i);n.replaceRange(u.map(a.pos),u.map(l.pos),o?c.empty:t),o==0&&st(n,i,(e?e.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(n,t){let e=n.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],a=n.mapping.slice(e),l=a.map(s.pos),u=a.map(o.pos);i?n.deleteRange(l,u):(n.replaceRangeWith(l,u,t),st(n,e,t.isInline?-1:1))}}static findFrom(n,t,e=!1){let r=n.parent.inlineContent?new R(n):N(n.node(0),n.parent,n.pos,n.index(),t,e);if(r)return r;for(let i=n.depth-1;i>=0;i--){let s=t<0?N(n.node(0),n.node(i),n.before(i+1),n.index(i),t,e):N(n.node(0),n.node(i),n.after(i+1),n.index(i)+1,t,e);if(s)return s}return null}static near(n,t=1){return this.findFrom(n,t)||this.findFrom(n,-t)||new b(n.node(0))}static atStart(n){return N(n,n,0,0,1)||new b(n)}static atEnd(n){return N(n,n,n.content.size,n.childCount,-1)||new b(n)}static fromJSON(n,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let e=G[t.type];if(!e)throw new RangeError(`No selection type ${t.type} defined`);return e.fromJSON(n,t)}static jsonID(n,t){if(n in G)throw new RangeError("Duplicate use of selection JSON ID "+n);return G[n]=t,t.prototype.jsonID=n,t}getBookmark(){return R.between(this.$anchor,this.$head).getBookmark()}};f.prototype.visible=!0;var zt=class{constructor(n,t){this.$from=n,this.$to=t}},nt=!1;function it(n){!nt&&!n.parent.inlineContent&&(nt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var R=class J extends f{constructor(t,e=t){it(t),it(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return f.near(r);let i=t.resolve(e.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(t,e=c.empty){if(super.replace(t,e),e==c.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof J&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new yt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new J(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){let i=t.resolve(e);return new this(i,r==e?i:t.resolve(r))}static between(t,e,r){let i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){let s=f.findFrom(e,r,!0)||f.findFrom(e,-r,!0);if(s)e=s.$head;else return f.near(e,r)}return t.parent.inlineContent||(i==0?t=e:(t=(f.findFrom(t,-r,!0)||f.findFrom(t,r,!0)).$anchor,t.pos<e.pos!=i<0&&(t=e))),new J(t,e)}};f.jsonID("text",R);var yt=class xt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new xt(t.map(this.anchor),t.map(this.head))}resolve(t){return R.between(t.resolve(this.anchor),t.resolve(this.head))}},O=class M extends f{constructor(t){let e=t.nodeAfter,r=t.node(0).resolve(t.pos+e.nodeSize);super(t,r),this.node=e}map(t,e){let{deleted:r,pos:i}=e.mapResult(this.anchor),s=t.resolve(i);return r?f.near(s):new M(s)}content(){return new c(g.from(this.node),0,0)}eq(t){return t instanceof M&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Jt(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new M(t.resolve(e.anchor))}static create(t,e){return new M(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}};O.prototype.visible=!1;f.jsonID("node",O);var Jt=class Nt{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:r}=t.mapResult(this.anchor);return e?new yt(r,r):new Nt(r)}resolve(t){let e=t.resolve(this.anchor),r=e.nodeAfter;return r&&O.isSelectable(r)?new O(e):f.near(e)}},b=class P extends f{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=c.empty){if(e==c.empty){t.delete(0,t.doc.content.size);let r=f.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new P(t)}map(t){return new P(t)}eq(t){return t instanceof P}getBookmark(){return Mt}};f.jsonID("all",b);var Mt={map(){return this},resolve(n){return new b(n)}};function N(n,t,e,r,i,s=!1){if(t.inlineContent)return R.create(n,e);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let a=t.child(o);if(a.isAtom){if(!s&&O.isSelectable(a))return O.create(n,e-(i<0?a.nodeSize:0))}else{let l=N(n,a,e+i,i<0?a.childCount:0,i,s);if(l)return l}e+=a.nodeSize*i}return null}function st(n,t,e){let r=n.steps.length-1;if(r<t)return;let i=n.steps[r];if(!(i instanceof Z||i instanceof vt))return;let s=n.mapping.maps[r],o;s.forEach((a,l,u,h)=>{o==null&&(o=h)}),n.setSelection(f.near(n.doc.resolve(o),e))}function ot(n,t){return!t||!n?n:n.bind(t)}var F=class{constructor(n,t,e){this.name=n,this.init=ot(t.init,e),this.apply=ot(t.apply,e)}};new F("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new F("selection",{init(n,t){return n.selection||f.atStart(t.doc)},apply(n){return n.selection}}),new F("storedMarks",{init(n){return n.storedMarks||null},apply(n,t,e,r){return r.selection.$cursor?n.storedMarks:null}}),new F("scrollToSelection",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}});var bt=(n,t)=>{var e;const{state:r,view:i}=n,{selection:s}=r;if(!s.empty)return!1;const{$from:o}=s;if(o.parentOffset!==0)return!1;const a=o.depth-1,l=o.node(a),u=o.index(a);if(u===0)return!1;if(l.type===t)return n.commands.lift(t.name);const h=l.child(u-1);if(h.type!==t||!((e=h.lastChild)!=null&&e.isTextblock))return!1;const S=o.before(),T=S-1-1,{tr:v}=r;return v.delete(S,o.after()).insert(T,o.parent.content),v.setSelection(R.create(v.doc,T)),i.dispatch(v.scrollIntoView()),!0},Ct=/^\s*>\s$/,Bt=H.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return tt.h("blockquote",{...H.mergeAttributes(this.options.HTMLAttributes,n),children:tt.h("slot",{})})},parseMarkdown:(n,t)=>{var e;const r=(e=t.parseBlockChildren)!=null?e:t.parseChildren;return t.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,t)=>{if(!n.content)return"";const e=">",r=[];return n.content.forEach((i,s)=>{var o,a;const h=((a=(o=t.renderChild)==null?void 0:o.call(t,i,s))!=null?a:t.renderChildren([i])).split(`
2
+ `).map(S=>S.trim()===""?e:`${e} ${S}`);r.push(h.join(`
3
+ `))}),r.join(`
4
+ ${e}
5
+ `)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>bt(this.editor,this.type)}},addInputRules(){return[H.wrappingInputRule({find:Ct,type:this.type})]}});function Ft(){const n=K.useButtonProps(Rt.name),{icon:t=void 0,tooltip:e=void 0,shortcutKeys:r=void 0,tooltipOptions:i={},action:s=void 0,isActive:o=void 0}=(n==null?void 0:n.componentProps)??{},{dataState:a,disabled:l,update:u}=K.useToggleActive(o),h=()=>{l||s&&(s(),u())};return n?$.jsx(K.ActionButton,{action:h,dataState:a,disabled:l,icon:t,shortcutKeys:r,tooltip:e,tooltipOptions:i}):$.jsx($.Fragment,{})}const Rt=Bt.extend({addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:t,t:e,extension:r})=>({componentProps:{action:()=>t.commands.toggleBlockquote(),isActive:()=>t.isActive("blockquote"),disabled:!t.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:r.options.shortcutKeys??["shift","mod","B"],tooltip:e("editor.blockquote.tooltip")}})}}});exports.Blockquote=Rt;exports.RichTextBlockquote=Ft;