@remarkablejames/editor 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/lib/ActionMenuButton-B0EHT9CC.js +35 -0
  4. package/lib/ActionMenuButton-J1el_e6Z.cjs +1 -0
  5. package/lib/Attachment.cjs +19 -0
  6. package/lib/Attachment.js +273 -0
  7. package/lib/Blockquote.cjs +5 -0
  8. package/lib/Blockquote.js +107 -0
  9. package/lib/Bold.cjs +1 -0
  10. package/lib/Bold.js +123 -0
  11. package/lib/BulletList.cjs +1 -0
  12. package/lib/BulletList.js +53 -0
  13. package/lib/Callout.cjs +1 -0
  14. package/lib/Callout.js +225 -0
  15. package/lib/Clear.cjs +1 -0
  16. package/lib/Clear.js +49 -0
  17. package/lib/Code.cjs +1 -0
  18. package/lib/Code.js +100 -0
  19. package/lib/CodeBlock.cjs +44 -0
  20. package/lib/CodeBlock.js +4065 -0
  21. package/lib/CodeView.cjs +1 -0
  22. package/lib/CodeView.js +81 -0
  23. package/lib/Color.cjs +1 -0
  24. package/lib/Color.js +134 -0
  25. package/lib/Column.cjs +1 -0
  26. package/lib/Column.js +230 -0
  27. package/lib/Drawer-BCWVN-4l.js +1125 -0
  28. package/lib/Drawer-BTouEroZ.cjs +2 -0
  29. package/lib/Drawer.cjs +1 -0
  30. package/lib/Drawer.js +7 -0
  31. package/lib/Emoji.cjs +1 -0
  32. package/lib/Emoji.js +19888 -0
  33. package/lib/Excalidraw.cjs +1 -0
  34. package/lib/Excalidraw.js +276 -0
  35. package/lib/ExportPdf.cjs +39 -0
  36. package/lib/ExportPdf.js +142 -0
  37. package/lib/ExportWord.cjs +1 -0
  38. package/lib/ExportWord.js +107 -0
  39. package/lib/FontFamily.cjs +1 -0
  40. package/lib/FontFamily.js +84 -0
  41. package/lib/FontSize.cjs +1 -0
  42. package/lib/FontSize.js +106 -0
  43. package/lib/Heading.cjs +1 -0
  44. package/lib/Heading.js +167 -0
  45. package/lib/Highlight.cjs +1 -0
  46. package/lib/Highlight.js +203 -0
  47. package/lib/History.cjs +1 -0
  48. package/lib/History.js +990 -0
  49. package/lib/HorizontalRule.cjs +1 -0
  50. package/lib/HorizontalRule.js +118 -0
  51. package/lib/Iframe-BdgiWGml.js +416 -0
  52. package/lib/Iframe-BfBLILDA.cjs +1 -0
  53. package/lib/Iframe.cjs +1 -0
  54. package/lib/Iframe.js +7 -0
  55. package/lib/Image.cjs +1 -0
  56. package/lib/Image.js +6 -0
  57. package/lib/ImageGif.cjs +1 -0
  58. package/lib/ImageGif.js +400 -0
  59. package/lib/ImportWord.cjs +1 -0
  60. package/lib/ImportWord.js +145 -0
  61. package/lib/Indent-BpMcZKok.js +148 -0
  62. package/lib/Indent-Dvqz_WEn.cjs +1 -0
  63. package/lib/Indent.cjs +1 -0
  64. package/lib/Indent.js +6 -0
  65. package/lib/Italic.cjs +1 -0
  66. package/lib/Italic.js +123 -0
  67. package/lib/Katex-B8_uprkO.js +2753 -0
  68. package/lib/Katex-BQyeCeQ0.cjs +4 -0
  69. package/lib/Katex.cjs +1 -0
  70. package/lib/Katex.js +6 -0
  71. package/lib/LineHeight.cjs +1 -0
  72. package/lib/LineHeight.js +89 -0
  73. package/lib/Link.cjs +1 -0
  74. package/lib/Link.js +6 -0
  75. package/lib/LinkEditBlock-BX0fXXpF.js +1185 -0
  76. package/lib/LinkEditBlock-CIshn_8F.cjs +5 -0
  77. package/lib/Mention.cjs +1 -0
  78. package/lib/Mention.js +265 -0
  79. package/lib/Mermaid-0GiGVxn0.cjs +2 -0
  80. package/lib/Mermaid-D8bbIgAl.js +381 -0
  81. package/lib/Mermaid.cjs +1 -0
  82. package/lib/Mermaid.js +7 -0
  83. package/lib/MoreMark.cjs +1 -0
  84. package/lib/MoreMark.js +157 -0
  85. package/lib/OrderedList.cjs +1 -0
  86. package/lib/OrderedList.js +52 -0
  87. package/lib/SearchAndReplace.cjs +1 -0
  88. package/lib/SearchAndReplace.js +305 -0
  89. package/lib/SlashCommand.cjs +1 -0
  90. package/lib/SlashCommand.js +90 -0
  91. package/lib/SlashCommandNodeView-BcmtKbEE.js +249 -0
  92. package/lib/SlashCommandNodeView-rDJ7OjRd.cjs +1 -0
  93. package/lib/Strike.cjs +1 -0
  94. package/lib/Strike.js +112 -0
  95. package/lib/Table-BEhNBeuA.cjs +5 -0
  96. package/lib/Table-DbxuP5xh.js +1939 -0
  97. package/lib/Table.cjs +1 -0
  98. package/lib/Table.js +5 -0
  99. package/lib/TaskList.cjs +1 -0
  100. package/lib/TaskList.js +63 -0
  101. package/lib/TextAlign.cjs +1 -0
  102. package/lib/TextAlign.js +165 -0
  103. package/lib/TextDirection.cjs +1 -0
  104. package/lib/TextDirection.js +110 -0
  105. package/lib/TextUnderline.cjs +1 -0
  106. package/lib/TextUnderline.js +115 -0
  107. package/lib/Twitter-9I6BLNmg.js +1666 -0
  108. package/lib/Twitter-BuEBgpi9.cjs +1 -0
  109. package/lib/Twitter.cjs +1 -0
  110. package/lib/Twitter.js +6 -0
  111. package/lib/Video.cjs +1 -0
  112. package/lib/Video.js +7 -0
  113. package/lib/bubble.cjs +3 -0
  114. package/lib/bubble.d.ts +1 -0
  115. package/lib/bubble.js +9533 -0
  116. package/lib/clsx-CDyrfCnw.js +7391 -0
  117. package/lib/clsx-CXbNJWDD.cjs +54 -0
  118. package/lib/components/ActionButton.d.ts +23 -0
  119. package/lib/components/ActionMenuButton.d.ts +28 -0
  120. package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
  121. package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -0
  122. package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -0
  123. package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -0
  124. package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -0
  125. package/lib/components/Bubble/RichTextBubbleKatex.d.ts +1 -0
  126. package/lib/components/Bubble/RichTextBubbleLink.d.ts +6 -0
  127. package/lib/components/Bubble/RichTextBubbleMedia.d.ts +4 -0
  128. package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +1 -0
  129. package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -0
  130. package/lib/components/Bubble/RichTextBubbleTable.d.ts +5 -0
  131. package/lib/components/Bubble/RichTextBubbleText.d.ts +5 -0
  132. package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -0
  133. package/lib/components/Bubble/formatBubble.d.ts +55 -0
  134. package/lib/components/Bubble/index.d.ts +13 -0
  135. package/lib/components/ColorPicker.d.ts +11 -0
  136. package/lib/components/ReactBus.d.ts +11 -0
  137. package/lib/components/RichTextProvider.d.ts +8 -0
  138. package/lib/components/SizeSetter/SizeSetter.d.ts +13 -0
  139. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
  140. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
  141. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
  142. package/lib/components/icons/Activity.d.ts +2 -0
  143. package/lib/components/icons/Animas.d.ts +2 -0
  144. package/lib/components/icons/AspectRatio.d.ts +2 -0
  145. package/lib/components/icons/Blockquote.d.ts +2 -0
  146. package/lib/components/icons/CodeView.d.ts +1 -0
  147. package/lib/components/icons/ColumnAddLeft.d.ts +1 -0
  148. package/lib/components/icons/ColumnAddRight.d.ts +1 -0
  149. package/lib/components/icons/DeleteColumn.d.ts +2 -0
  150. package/lib/components/icons/DeleteRow.d.ts +2 -0
  151. package/lib/components/icons/Direction.d.ts +1 -0
  152. package/lib/components/icons/Excalidraw.d.ts +1 -0
  153. package/lib/components/icons/ExportPdf.d.ts +1 -0
  154. package/lib/components/icons/ExportWord.d.ts +2 -0
  155. package/lib/components/icons/FileWordOutline.d.ts +2 -0
  156. package/lib/components/icons/Flag.d.ts +2 -0
  157. package/lib/components/icons/Food.d.ts +2 -0
  158. package/lib/components/icons/GIfIcon.d.ts +1 -0
  159. package/lib/components/icons/Html.d.ts +1 -0
  160. package/lib/components/icons/Icon.d.ts +8 -0
  161. package/lib/components/icons/IconColorFill.d.ts +5 -0
  162. package/lib/components/icons/IconHighlightFill.d.ts +3 -0
  163. package/lib/components/icons/ImportWord.d.ts +2 -0
  164. package/lib/components/icons/LeftToRight.d.ts +1 -0
  165. package/lib/components/icons/LineHeight.d.ts +2 -0
  166. package/lib/components/icons/MenuDown.d.ts +2 -0
  167. package/lib/components/icons/Mermaid.d.ts +1 -0
  168. package/lib/components/icons/NoFill.d.ts +1 -0
  169. package/lib/components/icons/Object.d.ts +2 -0
  170. package/lib/components/icons/RightToLeft.d.ts +1 -0
  171. package/lib/components/icons/SizeL.d.ts +2 -0
  172. package/lib/components/icons/SizeM.d.ts +2 -0
  173. package/lib/components/icons/SizeS.d.ts +2 -0
  174. package/lib/components/icons/Symbol.d.ts +2 -0
  175. package/lib/components/icons/Travel.d.ts +2 -0
  176. package/lib/components/icons/Twitter.d.ts +1 -0
  177. package/lib/components/icons/icons.d.ts +1 -0
  178. package/lib/components/icons/index.d.ts +12 -0
  179. package/lib/components/index.d.ts +6 -0
  180. package/lib/components/ui/button.d.ts +11 -0
  181. package/lib/components/ui/checkbox.d.ts +4 -0
  182. package/lib/components/ui/dialog.d.ts +19 -0
  183. package/lib/components/ui/dropdown-menu.d.ts +27 -0
  184. package/lib/components/ui/emoji-picker.d.ts +7 -0
  185. package/lib/components/ui/index.d.ts +15 -0
  186. package/lib/components/ui/input.d.ts +5 -0
  187. package/lib/components/ui/label.d.ts +5 -0
  188. package/lib/components/ui/popover.d.ts +6 -0
  189. package/lib/components/ui/select.d.ts +13 -0
  190. package/lib/components/ui/separator.d.ts +4 -0
  191. package/lib/components/ui/switch.d.ts +4 -0
  192. package/lib/components/ui/tabs.d.ts +7 -0
  193. package/lib/components/ui/textarea.d.ts +5 -0
  194. package/lib/components/ui/toast.d.ts +15 -0
  195. package/lib/components/ui/toaster.d.ts +1 -0
  196. package/lib/components/ui/toggle.d.ts +12 -0
  197. package/lib/components/ui/tooltip.d.ts +7 -0
  198. package/lib/components/ui/use-toast.d.ts +44 -0
  199. package/lib/constants/index.d.ts +47 -0
  200. package/lib/constants/resetCSS.d.ts +1 -0
  201. package/lib/delete-node-CosiBes5.cjs +1 -0
  202. package/lib/delete-node-eQHsyyhR.js +24 -0
  203. package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
  204. package/lib/dom-dataset-CIEeltF6.js +47 -0
  205. package/lib/dropdown-menu-Bs69ZBbO.js +143 -0
  206. package/lib/dropdown-menu-DjWlG2-J.cjs +1 -0
  207. package/lib/extensions/Attachment/Attachment.d.ts +15 -0
  208. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -0
  209. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIconString.d.ts +1 -0
  210. package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -0
  211. package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -0
  212. package/lib/extensions/Attachment/index.d.ts +1 -0
  213. package/lib/extensions/Blockquote/Blockquote.d.ts +6 -0
  214. package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -0
  215. package/lib/extensions/Blockquote/index.d.ts +1 -0
  216. package/lib/extensions/Bold/Bold.d.ts +6 -0
  217. package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -0
  218. package/lib/extensions/Bold/index.d.ts +1 -0
  219. package/lib/extensions/BulletList/BulletList.d.ts +6 -0
  220. package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -0
  221. package/lib/extensions/BulletList/index.d.ts +1 -0
  222. package/lib/extensions/Callout/Callout.d.ts +18 -0
  223. package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
  224. package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
  225. package/lib/extensions/Callout/index.d.ts +1 -0
  226. package/lib/extensions/Clear/Clear.d.ts +6 -0
  227. package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -0
  228. package/lib/extensions/Clear/index.d.ts +1 -0
  229. package/lib/extensions/Code/Code.d.ts +6 -0
  230. package/lib/extensions/Code/components/RichTextCode.d.ts +1 -0
  231. package/lib/extensions/Code/index.d.ts +1 -0
  232. package/lib/extensions/CodeBlock/CodeBlock.d.ts +21 -0
  233. package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +1 -0
  234. package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +1 -0
  235. package/lib/extensions/CodeBlock/index.d.ts +1 -0
  236. package/lib/extensions/CodeView/CodeView.d.ts +17 -0
  237. package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -0
  238. package/lib/extensions/CodeView/index.d.ts +1 -0
  239. package/lib/extensions/Color/Color.d.ts +22 -0
  240. package/lib/extensions/Color/components/RichTextColor.d.ts +1 -0
  241. package/lib/extensions/Color/index.d.ts +1 -0
  242. package/lib/extensions/Column/Column.d.ts +17 -0
  243. package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -0
  244. package/lib/extensions/Column/index.d.ts +1 -0
  245. package/lib/extensions/Drawer/Drawer.d.ts +15 -0
  246. package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -0
  247. package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +28 -0
  248. package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -0
  249. package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +1 -0
  250. package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -0
  251. package/lib/extensions/Drawer/index.d.ts +1 -0
  252. package/lib/extensions/Emoji/Emoji.d.ts +5 -0
  253. package/lib/extensions/Emoji/components/EmojiList/EmojiNodeView.d.ts +11 -0
  254. package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +1 -0
  255. package/lib/extensions/Emoji/index.d.ts +1 -0
  256. package/lib/extensions/Excalidraw/Excalidraw.d.ts +17 -0
  257. package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -0
  258. package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -0
  259. package/lib/extensions/Excalidraw/index.d.ts +1 -0
  260. package/lib/extensions/ExportPdf/ExportPdf.d.ts +21 -0
  261. package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -0
  262. package/lib/extensions/ExportPdf/index.d.ts +1 -0
  263. package/lib/extensions/ExportWord/ExportWord.d.ts +13 -0
  264. package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -0
  265. package/lib/extensions/ExportWord/index.d.ts +1 -0
  266. package/lib/extensions/FontFamily/FontFamily.d.ts +10 -0
  267. package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +15 -0
  268. package/lib/extensions/FontFamily/index.d.ts +1 -0
  269. package/lib/extensions/FontSize/FontSize.d.ts +32 -0
  270. package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +12 -0
  271. package/lib/extensions/FontSize/index.d.ts +1 -0
  272. package/lib/extensions/Heading/Heading.d.ts +6 -0
  273. package/lib/extensions/Heading/components/RichTextHeading.d.ts +15 -0
  274. package/lib/extensions/Heading/index.d.ts +1 -0
  275. package/lib/extensions/Highlight/Highlight.d.ts +18 -0
  276. package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +1 -0
  277. package/lib/extensions/Highlight/index.d.ts +1 -0
  278. package/lib/extensions/History/History.d.ts +6 -0
  279. package/lib/extensions/History/components/RichTextHistory.d.ts +2 -0
  280. package/lib/extensions/History/index.d.ts +1 -0
  281. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +6 -0
  282. package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -0
  283. package/lib/extensions/HorizontalRule/index.d.ts +1 -0
  284. package/lib/extensions/Iframe/Iframe.d.ts +16 -0
  285. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +2 -0
  286. package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -0
  287. package/lib/extensions/Iframe/index.d.ts +1 -0
  288. package/lib/extensions/Iframe/utils.d.ts +9 -0
  289. package/lib/extensions/Image/Image.d.ts +64 -0
  290. package/lib/extensions/Image/components/ImageCropper.d.ts +1 -0
  291. package/lib/extensions/Image/components/ImageView.d.ts +2 -0
  292. package/lib/extensions/Image/components/RichTextImage.d.ts +1 -0
  293. package/lib/extensions/Image/index.d.ts +1 -0
  294. package/lib/extensions/ImageGif/ImageGif.d.ts +39 -0
  295. package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -0
  296. package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +1 -0
  297. package/lib/extensions/ImageGif/components/services.d.ts +458 -0
  298. package/lib/extensions/ImageGif/index.d.ts +1 -0
  299. package/lib/extensions/ImportWord/ImportWord.d.ts +18 -0
  300. package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -0
  301. package/lib/extensions/ImportWord/index.d.ts +1 -0
  302. package/lib/extensions/Indent/Indent.d.ts +23 -0
  303. package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -0
  304. package/lib/extensions/Indent/index.d.ts +1 -0
  305. package/lib/extensions/Italic/Italic.d.ts +6 -0
  306. package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -0
  307. package/lib/extensions/Italic/index.d.ts +1 -0
  308. package/lib/extensions/Katex/Katex.d.ts +17 -0
  309. package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -0
  310. package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -0
  311. package/lib/extensions/Katex/index.d.ts +1 -0
  312. package/lib/extensions/LineHeight/LineHeight.d.ts +7 -0
  313. package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -0
  314. package/lib/extensions/LineHeight/index.d.ts +1 -0
  315. package/lib/extensions/Link/Link.d.ts +6 -0
  316. package/lib/extensions/Link/components/LinkEditBlock.d.ts +9 -0
  317. package/lib/extensions/Link/components/LinkViewBlock.d.ts +8 -0
  318. package/lib/extensions/Link/components/RichTextLink.d.ts +1 -0
  319. package/lib/extensions/Link/index.d.ts +1 -0
  320. package/lib/extensions/Mention/Mention.d.ts +3 -0
  321. package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +16 -0
  322. package/lib/extensions/Mention/index.d.ts +1 -0
  323. package/lib/extensions/Mermaid/Mermaid.d.ts +27 -0
  324. package/lib/extensions/Mermaid/components/EditMermaidBlock.d.ts +9 -0
  325. package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +9 -0
  326. package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -0
  327. package/lib/extensions/Mermaid/index.d.ts +1 -0
  328. package/lib/extensions/MoreMark/MoreMark.d.ts +20 -0
  329. package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +14 -0
  330. package/lib/extensions/MoreMark/index.d.ts +1 -0
  331. package/lib/extensions/OrderedList/OrderedList.d.ts +6 -0
  332. package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -0
  333. package/lib/extensions/OrderedList/index.d.ts +1 -0
  334. package/lib/extensions/SearchAndReplace/SearchAndReplace.d.ts +36 -0
  335. package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -0
  336. package/lib/extensions/SearchAndReplace/index.d.ts +1 -0
  337. package/lib/extensions/SlashCommand/SlashCommand.d.ts +4 -0
  338. package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +6 -0
  339. package/lib/extensions/SlashCommand/components/SlashCommandNodeView.d.ts +3 -0
  340. package/lib/extensions/SlashCommand/index.d.ts +1 -0
  341. package/lib/extensions/SlashCommand/renderCommandListDefault.d.ts +7 -0
  342. package/lib/extensions/SlashCommand/types.d.ts +20 -0
  343. package/lib/extensions/Strike/Strike.d.ts +6 -0
  344. package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -0
  345. package/lib/extensions/Strike/index.d.ts +1 -0
  346. package/lib/extensions/Table/Table.d.ts +21 -0
  347. package/lib/extensions/Table/TableCellBackground.d.ts +14 -0
  348. package/lib/extensions/Table/components/CreateTablePopover.d.ts +7 -0
  349. package/lib/extensions/Table/components/RichTextTable.d.ts +1 -0
  350. package/lib/extensions/Table/index.d.ts +1 -0
  351. package/lib/extensions/TaskList/TaskList.d.ts +11 -0
  352. package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -0
  353. package/lib/extensions/TaskList/index.d.ts +1 -0
  354. package/lib/extensions/TextAlign/TextAlign.d.ts +17 -0
  355. package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +14 -0
  356. package/lib/extensions/TextAlign/index.d.ts +1 -0
  357. package/lib/extensions/TextDirection/TextDirection.d.ts +5 -0
  358. package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +15 -0
  359. package/lib/extensions/TextDirection/index.d.ts +1 -0
  360. package/lib/extensions/TextUnderline/TextUnderline.d.ts +6 -0
  361. package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -0
  362. package/lib/extensions/TextUnderline/index.d.ts +1 -0
  363. package/lib/extensions/Twitter/Twitter.d.ts +46 -0
  364. package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +6 -0
  365. package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +8 -0
  366. package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -0
  367. package/lib/extensions/Twitter/index.d.ts +1 -0
  368. package/lib/extensions/Video/Video.d.ts +66 -0
  369. package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -0
  370. package/lib/extensions/Video/index.d.ts +1 -0
  371. package/lib/hooks/useActive.d.ts +21 -0
  372. package/lib/hooks/useAttributes.d.ts +2 -0
  373. package/lib/hooks/useButtonProps.d.ts +1 -0
  374. package/lib/hooks/useCopy.d.ts +5 -0
  375. package/lib/hooks/useExtension.d.ts +1 -0
  376. package/lib/hooks/useLocalStorage.d.ts +13 -0
  377. package/lib/index-4Q5IhypJ.js +1349 -0
  378. package/lib/index-BCzvbrf5.cjs +12 -0
  379. package/lib/index-BG0kQamI.js +285 -0
  380. package/lib/index-C-tDsIKJ.js +1631 -0
  381. package/lib/index-C1WCZhyA.js +237 -0
  382. package/lib/index-CjhjjJsN.cjs +1 -0
  383. package/lib/index-Cs6cp0Y6.cjs +1 -0
  384. package/lib/index-CsSfYR30.js +1351 -0
  385. package/lib/index-D9oM__YW.cjs +1 -0
  386. package/lib/index-DjDf4BK8.js +707 -0
  387. package/lib/index-NsYff_Ni.cjs +1 -0
  388. package/lib/index-bVGIXhRg.cjs +1 -0
  389. package/lib/index-lj3VWExo.js +4883 -0
  390. package/lib/index-neeeY2o7.cjs +4 -0
  391. package/lib/index.cjs +115 -0
  392. package/lib/index.d.ts +2 -0
  393. package/lib/index.js +338 -0
  394. package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
  395. package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
  396. package/lib/lib/utils.d.ts +2 -0
  397. package/lib/locale-bundle.cjs +1 -0
  398. package/lib/locale-bundle.d.ts +1 -0
  399. package/lib/locale-bundle.js +11 -0
  400. package/lib/locales/en.d.ts +196 -0
  401. package/lib/locales/fi.d.ts +196 -0
  402. package/lib/locales/hu.d.ts +196 -0
  403. package/lib/locales/index.d.ts +1198 -0
  404. package/lib/locales/pt-br.d.ts +196 -0
  405. package/lib/locales/vi.d.ts +196 -0
  406. package/lib/locales/zh-cn.d.ts +196 -0
  407. package/lib/plugins/image-upload.d.ts +13 -0
  408. package/lib/popover-CPr9bHYn.js +24 -0
  409. package/lib/popover-D-hUKDYu.cjs +1 -0
  410. package/lib/renderNodeView-BJSrgyGj.js +28 -0
  411. package/lib/renderNodeView-DfLmGrgA.cjs +1 -0
  412. package/lib/select-C2KF4RNg.cjs +1 -0
  413. package/lib/select-CuE_HaQJ.js +120 -0
  414. package/lib/separator-CHzYNMVt.js +293 -0
  415. package/lib/separator-_gvUNba_.cjs +1 -0
  416. package/lib/store/EditorEditableReactive.d.ts +1 -0
  417. package/lib/store/ThemeColorReactive.d.ts +1 -0
  418. package/lib/store/commandList.d.ts +2 -0
  419. package/lib/store/editor.d.ts +21 -0
  420. package/lib/store/store.d.ts +3 -0
  421. package/lib/style.css +1 -0
  422. package/lib/textarea-DZj6EY-N.cjs +1 -0
  423. package/lib/textarea-gEoNp9CA.js +20 -0
  424. package/lib/theme/theme.d.ts +369 -0
  425. package/lib/theme.cjs +1 -0
  426. package/lib/theme.js +395 -0
  427. package/lib/types.d.ts +230 -0
  428. package/lib/updatePosition-Cjuj2E26.cjs +1 -0
  429. package/lib/updatePosition-e90ZrFWW.js +16 -0
  430. package/lib/utils/base64.d.ts +2 -0
  431. package/lib/utils/checkIsVideoUrl.d.ts +1 -0
  432. package/lib/utils/color.d.ts +7 -0
  433. package/lib/utils/columns.d.ts +14 -0
  434. package/lib/utils/customEvents/events.constant.d.ts +6 -0
  435. package/lib/utils/delete-node.d.ts +2 -0
  436. package/lib/utils/dom-dataset.d.ts +28 -0
  437. package/lib/utils/download.d.ts +1 -0
  438. package/lib/utils/dynamicCSS.d.ts +25 -0
  439. package/lib/utils/editor-container-size.d.ts +4 -0
  440. package/lib/utils/file.d.ts +30 -0
  441. package/lib/utils/getRenderContainer.d.ts +3 -0
  442. package/lib/utils/indent.d.ts +14 -0
  443. package/lib/utils/is-mobile.d.ts +19 -0
  444. package/lib/utils/json.d.ts +2 -0
  445. package/lib/utils/lru-cache.d.ts +31 -0
  446. package/lib/utils/mitt.d.ts +24 -0
  447. package/lib/utils/node.d.ts +15 -0
  448. package/lib/utils/pdf.d.ts +3 -0
  449. package/lib/utils/plateform.d.ts +11 -0
  450. package/lib/utils/renderNodeView.d.ts +6 -0
  451. package/lib/utils/shortId.d.ts +1 -0
  452. package/lib/utils/storage.d.ts +2 -0
  453. package/lib/utils/updatePosition.d.ts +1 -0
  454. package/lib/utils/utils.d.ts +20 -0
  455. package/lib/utils/validateFile.d.ts +16 -0
  456. package/package.json +845 -0
@@ -0,0 +1,381 @@
1
+ import { h as V, N as U, k as F, m as P } from "./clsx-CDyrfCnw.js";
2
+ import { jsxs as f, jsx as t } from "react/jsx-runtime";
3
+ import { useState as s, useRef as E, useCallback as A, useEffect as C } from "react";
4
+ import { D as k, m as H, A as R, n as O, o as $, p as j, B as _, h as q, u as W, d as G } from "./index-lj3VWExo.js";
5
+ import { T as z } from "./textarea-gEoNp9CA.js";
6
+ const J = ({
7
+ editor: e,
8
+ node: a,
9
+ updateAttributes: d
10
+ }) => {
11
+ var i, n;
12
+ const l = ((i = a == null ? void 0 : a.attrs) == null ? void 0 : i.code) ?? b, h = ((n = a == null ? void 0 : a.attrs) == null ? void 0 : n.align) ?? "center", [r, y] = s(l), [v, x] = s(""), [M, m] = s(""), [u, g] = s(!1), [o, I] = s(null), [p, D] = s(!0), L = E(
13
+ `mermaid-edit-${Math.random().toString(36).slice(2, 9)}`
14
+ ), N = A(
15
+ (c) => {
16
+ g(c), c && y(l);
17
+ },
18
+ [l]
19
+ );
20
+ C(() => {
21
+ import("mermaid").then((c) => {
22
+ const w = c.default;
23
+ w.initialize({
24
+ startOnLoad: !1,
25
+ darkMode: !1,
26
+ fontSize: 12,
27
+ theme: "base"
28
+ }), I(w);
29
+ }).finally(() => D(!1));
30
+ }, []), C(() => {
31
+ if (!o || !u) return;
32
+ (async () => {
33
+ const w = r.trim();
34
+ if (!w) {
35
+ x(""), m("");
36
+ return;
37
+ }
38
+ try {
39
+ const T = `${L.current}-${Date.now()}`, { svg: B } = await o.render(T, w);
40
+ x(B), m("");
41
+ } catch (T) {
42
+ x(""), m((T == null ? void 0 : T.message) ?? "Invalid Mermaid syntax");
43
+ }
44
+ })();
45
+ }, [r, o, u]);
46
+ const S = A(() => {
47
+ r.trim() && (d ? d({ code: r }) : e == null || e.chain().focus().setMermaid({ code: r, align: h }).run(), g(!1));
48
+ }, [e, r, h, d]);
49
+ return /* @__PURE__ */ f(k, { onOpenChange: N, open: u, children: [
50
+ /* @__PURE__ */ t(H, { asChild: !0, children: /* @__PURE__ */ t(
51
+ R,
52
+ {
53
+ action: () => g(!0),
54
+ icon: "Pencil",
55
+ tooltip: "Edit Mermaid"
56
+ }
57
+ ) }),
58
+ /* @__PURE__ */ f(O, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
59
+ /* @__PURE__ */ t($, { children: "Edit Mermaid Diagram" }),
60
+ /* @__PURE__ */ t("div", { style: { height: "100%", border: "1px solid hsl(var(--border))" }, children: p ? /* @__PURE__ */ t("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400", children: "Loading Mermaid…" }) : /* @__PURE__ */ f("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
61
+ /* @__PURE__ */ t(
62
+ z,
63
+ {
64
+ autoFocus: !0,
65
+ className: "richtext-flex-1 richtext-font-mono richtext-text-sm",
66
+ onChange: (c) => y(c.target.value),
67
+ placeholder: b,
68
+ required: !0,
69
+ rows: 18,
70
+ value: r,
71
+ style: { color: "hsl(var(--foreground))" }
72
+ }
73
+ ),
74
+ /* @__PURE__ */ t(
75
+ "div",
76
+ {
77
+ className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",
78
+ style: {
79
+ minHeight: 400,
80
+ border: "1px solid hsl(var(--border))",
81
+ background: "#fff"
82
+ },
83
+ children: M ? /* @__PURE__ */ f("p", { className: "richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500", children: [
84
+ "⚠ ",
85
+ M
86
+ ] }) : v ? (
87
+ // oxlint-disable-next-line react/no-danger
88
+ /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: v } })
89
+ ) : /* @__PURE__ */ t("p", { className: "richtext-text-sm richtext-text-gray-400", children: "Start typing to preview…" })
90
+ }
91
+ )
92
+ ] }) }),
93
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
94
+ _,
95
+ {
96
+ disabled: p || !o || !r.trim(),
97
+ onClick: S,
98
+ type: "button",
99
+ children: "Save changes"
100
+ }
101
+ ) })
102
+ ] })
103
+ ] });
104
+ };
105
+ function K({
106
+ editor: e,
107
+ node: a,
108
+ updateAttributes: d,
109
+ selected: l,
110
+ extension: h
111
+ }) {
112
+ const [r, y] = s(
113
+ () => (e == null ? void 0 : e.isEditable) ?? !1
114
+ );
115
+ C(() => {
116
+ const i = () => y((e == null ? void 0 : e.isEditable) ?? !1);
117
+ return i(), e == null || e.on("editableUpdate", i), e == null || e.on("update", i), () => {
118
+ e == null || e.off("editableUpdate", i), e == null || e.off("update", i);
119
+ };
120
+ }, [e]);
121
+ const { code: v, align: x, width: M } = a.attrs, m = E(null), [u, g] = s(""), [o, I] = s(""), [p, D] = s(null), L = E(
122
+ `mermaid-view-${Math.random().toString(36).slice(2, 9)}`
123
+ );
124
+ C(() => {
125
+ import("mermaid").then((i) => {
126
+ const n = i.default;
127
+ n.initialize({
128
+ startOnLoad: !1,
129
+ darkMode: !1,
130
+ fontSize: 12,
131
+ theme: "base"
132
+ }), D(n);
133
+ });
134
+ }, []);
135
+ const N = A(
136
+ async (i) => {
137
+ if (!(!p || !(i != null && i.trim())))
138
+ try {
139
+ const n = `${L.current}-${Date.now()}`, { svg: c } = await p.render(n, i);
140
+ g(c), I("");
141
+ } catch (n) {
142
+ g(""), I((n == null ? void 0 : n.message) ?? "Invalid Mermaid syntax");
143
+ }
144
+ },
145
+ [p]
146
+ );
147
+ return C(() => {
148
+ N(v);
149
+ }, [v, N]), /* @__PURE__ */ t(
150
+ V,
151
+ {
152
+ className: "mermaid-node-view richtext-relative richtext-my-4",
153
+ style: {
154
+ textAlign: x ?? "center",
155
+ width: M ?? "100%"
156
+ },
157
+ children: /* @__PURE__ */ f(
158
+ "div",
159
+ {
160
+ "data-drag-handle": !0,
161
+ draggable: r ? "true" : "false",
162
+ ref: m,
163
+ className: [
164
+ "richtext-relative richtext-inline-block richtext-rounded-lg richtext-border richtext-bg-white richtext-p-4 richtext-transition-all",
165
+ r ? l ? "richtext-border-gray-300" : "richtext-border-transparent" : "richtext-pointer-events-none richtext-select-none richtext-border-transparent"
166
+ ].join(" "),
167
+ style: { maxWidth: "100%" },
168
+ children: [
169
+ o ? /* @__PURE__ */ t("div", { className: "richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-red-50 richtext-p-4 richtext-text-sm richtext-text-red-500", children: /* @__PURE__ */ f("span", { children: [
170
+ "⚠ ",
171
+ o
172
+ ] }) }) : u ? /* @__PURE__ */ t(
173
+ "div",
174
+ {
175
+ className: "mermaid-svg-container",
176
+ dangerouslySetInnerHTML: { __html: u }
177
+ }
178
+ ) : /* @__PURE__ */ t("div", { className: "richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-gray-50 richtext-text-sm richtext-text-gray-400", children: "Rendering…" }),
179
+ r && /* @__PURE__ */ t("div", { className: "richtext-absolute richtext-right-2 richtext-top-2 richtext-opacity-0 richtext-transition-opacity [.mermaid-node-view:hover_&]:richtext-opacity-100", children: /* @__PURE__ */ t(
180
+ J,
181
+ {
182
+ editor: e,
183
+ node: a,
184
+ updateAttributes: d,
185
+ extension: h
186
+ }
187
+ ) })
188
+ ]
189
+ }
190
+ )
191
+ }
192
+ );
193
+ }
194
+ function re() {
195
+ const e = q(), a = W(Q.name), { tooltipOptions: d = {}, isActive: l = void 0 } = (a == null ? void 0 : a.componentProps) ?? {}, { editorDisabled: h } = G(l), [r, y] = s(b), [v, x] = s(""), [M, m] = s(""), [u, g] = s(!1), [o, I] = s(null), [p, D] = s(!0), L = E(
196
+ `mermaid-toolbar-${Math.random().toString(36).slice(2, 9)}`
197
+ );
198
+ C(() => {
199
+ import("mermaid").then((i) => {
200
+ const n = i.default;
201
+ n.initialize({
202
+ startOnLoad: !1,
203
+ darkMode: !1,
204
+ fontSize: 12,
205
+ theme: "base"
206
+ }), I(n);
207
+ }).finally(() => D(!1));
208
+ }, []), C(() => {
209
+ if (!o || !u) return;
210
+ (async () => {
211
+ const n = r.trim();
212
+ if (!n) {
213
+ x(""), m("");
214
+ return;
215
+ }
216
+ try {
217
+ const c = `${L.current}-${Date.now()}`, { svg: w } = await o.render(c, n);
218
+ x(w), m("");
219
+ } catch (c) {
220
+ x(""), m((c == null ? void 0 : c.message) ?? "Invalid Mermaid syntax");
221
+ }
222
+ })();
223
+ }, [r, o, u]);
224
+ const N = A((i) => {
225
+ g(i), i && (y(b), x(""), m(""));
226
+ }, []), S = A(() => {
227
+ r.trim() && (e == null || e.chain().focus().setMermaid({ code: r, align: "center", width: "100%" }).run(), g(!1));
228
+ }, [e, r]);
229
+ return /* @__PURE__ */ f(k, { onOpenChange: N, open: u, children: [
230
+ /* @__PURE__ */ t(H, { asChild: !0, children: /* @__PURE__ */ t(
231
+ R,
232
+ {
233
+ disabled: h,
234
+ icon: "Mermaid",
235
+ tooltip: "Mermaid",
236
+ tooltipOptions: d,
237
+ action: () => {
238
+ h || g(!0);
239
+ }
240
+ }
241
+ ) }),
242
+ /* @__PURE__ */ f(O, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
243
+ /* @__PURE__ */ t($, { children: "Insert Mermaid Diagram" }),
244
+ /* @__PURE__ */ t("div", { style: { height: "100%", border: "1px solid hsl(var(--border))" }, children: p ? /* @__PURE__ */ t("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400", children: "Loading Mermaid…" }) : /* @__PURE__ */ f("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
245
+ /* @__PURE__ */ t(
246
+ z,
247
+ {
248
+ autoFocus: !0,
249
+ className: "richtext-flex-1 richtext-font-mono richtext-text-sm",
250
+ onChange: (i) => y(i.target.value),
251
+ placeholder: b,
252
+ required: !0,
253
+ rows: 18,
254
+ value: r,
255
+ style: { color: "hsl(var(--foreground))" }
256
+ }
257
+ ),
258
+ /* @__PURE__ */ t(
259
+ "div",
260
+ {
261
+ className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",
262
+ style: {
263
+ minHeight: 400,
264
+ border: "1px solid hsl(var(--border))",
265
+ background: "#fff"
266
+ },
267
+ children: M ? /* @__PURE__ */ f("p", { className: "richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500", children: [
268
+ "⚠ ",
269
+ M
270
+ ] }) : v ? (
271
+ // oxlint-disable-next-line react/no-danger
272
+ /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: v } })
273
+ ) : /* @__PURE__ */ t("p", { className: "richtext-text-sm richtext-text-gray-400", children: "Start typing to preview…" })
274
+ }
275
+ )
276
+ ] }) }),
277
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
278
+ _,
279
+ {
280
+ disabled: p || !o || !r.trim(),
281
+ onClick: S,
282
+ type: "button",
283
+ children: "Insert diagram"
284
+ }
285
+ ) })
286
+ ] })
287
+ ] });
288
+ }
289
+ const b = `graph TB
290
+ A --> B`, Q = /* @__PURE__ */ U.create({
291
+ name: "mermaid",
292
+ group: "block",
293
+ selectable: !0,
294
+ atom: !0,
295
+ draggable: !0,
296
+ inline: !1,
297
+ addOptions() {
298
+ return {
299
+ divider: !1,
300
+ spacer: !1,
301
+ HTMLAttributes: {
302
+ class: "mermaid-node"
303
+ },
304
+ button: ({ editor: e, t: a, extension: d }) => ({
305
+ componentProps: {
306
+ action: () => !0,
307
+ isActive: () => e.isActive("mermaid"),
308
+ disabled: !1,
309
+ editor: e,
310
+ icon: "Mermaid",
311
+ tooltip: a("editor.mermaid.tooltip")
312
+ }
313
+ })
314
+ };
315
+ },
316
+ addAttributes() {
317
+ return {
318
+ code: {
319
+ default: b,
320
+ parseHTML: (e) => e.getAttribute("data-code") ? decodeURIComponent(e.getAttribute("data-code")) : b,
321
+ renderHTML: (e) => ({
322
+ "data-code": encodeURIComponent(e.code ?? "")
323
+ })
324
+ },
325
+ align: {
326
+ default: "center",
327
+ parseHTML: (e) => e.getAttribute("data-align") ?? "center",
328
+ renderHTML: (e) => ({
329
+ "data-align": e.align
330
+ })
331
+ },
332
+ width: {
333
+ default: "100%",
334
+ parseHTML: (e) => e.getAttribute("data-width") ?? "100%",
335
+ renderHTML: (e) => ({
336
+ "data-width": e.width
337
+ })
338
+ }
339
+ };
340
+ },
341
+ parseHTML() {
342
+ return [
343
+ {
344
+ tag: "div[class=mermaid-node]"
345
+ }
346
+ ];
347
+ },
348
+ renderHTML({ HTMLAttributes: e, node: a }) {
349
+ const { align: d } = a.attrs, l = d ? `text-align: ${d};` : "";
350
+ return [
351
+ "div",
352
+ P({ class: "mermaid-node" }, e, { style: l })
353
+ ];
354
+ },
355
+ addCommands() {
356
+ return {
357
+ setMermaid: (e) => ({ tr: a, commands: d }) => {
358
+ var l, h, r;
359
+ return e = {
360
+ code: b,
361
+ align: "center",
362
+ width: "100%",
363
+ ...e
364
+ }, ((r = (h = (l = a.selection) == null ? void 0 : l.node) == null ? void 0 : h.type) == null ? void 0 : r.name) === this.name ? d.updateAttributes(this.name, e) : d.insertContent({
365
+ type: this.name,
366
+ attrs: e
367
+ });
368
+ },
369
+ setMermaidAlign: (e) => ({ commands: a }) => a.updateAttributes(this.name, { align: e })
370
+ };
371
+ },
372
+ addNodeView() {
373
+ return F(K);
374
+ }
375
+ });
376
+ export {
377
+ b as D,
378
+ J as E,
379
+ Q as M,
380
+ re as R
381
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./Mermaid-0GiGVxn0.cjs");exports.DEFAULT_MERMAID_CODE=e.DEFAULT_MERMAID_CODE;exports.Mermaid=e.Mermaid;exports.RichTextMermaid=e.RichTextMermaid;
package/lib/Mermaid.js ADDED
@@ -0,0 +1,7 @@
1
+ import "./clsx-CDyrfCnw.js";
2
+ import { D as e, M as i, R as m } from "./Mermaid-D8bbIgAl.js";
3
+ export {
4
+ e as DEFAULT_MERMAID_CODE,
5
+ i as Mermaid,
6
+ m as RichTextMermaid
7
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),e=require("react/jsx-runtime"),M=require("react"),c=require("./index-D9oM__YW.cjs");require("./theme.cjs");const l=require("./dropdown-menu-DjWlG2-J.cjs");var x=u.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),f=u.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});function S(){const t=c.useButtonProps(m.name),{icon:s=void 0,tooltip:n=void 0,items:i=[],isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:a,dataState:o}=c.useActive(d),h=M.useMemo(()=>(o==null?void 0:o.title)||"",[o]);return t?e.jsxs(l.DropdownMenu,{children:[e.jsx(l.DropdownMenuTrigger,{asChild:!0,disabled:a,children:e.jsx(c.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:a,icon:s,tooltip:n,children:e.jsx(c.MenuDown,{className:"richtext-size-3 richtext-text-gray-500"})})}),e.jsx(l.DropdownMenuContent,{className:"w-full",children:i==null?void 0:i.map((r,p)=>e.jsxs(l.DropdownMenuCheckboxItem,{checked:h===r.title,className:"richtext-flex richtext-items-center richtext-gap-3",onClick:r.action,children:[e.jsx(c.IconComponent,{name:r==null?void 0:r.icon}),e.jsx("span",{className:"richtext-ml-1",children:r.title}),!!(r!=null&&r.shortcutKeys)&&e.jsx("span",{className:"richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",children:c.getShortcutKeys(r.shortcutKeys)})]},`more-mark-${p}`))})]}):e.jsx(e.Fragment,{})}const m=u.Extension.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:s,extension:n,t:i}){var p,g;const d=n.options.subscript,a=n.options.superscript,o={action:()=>s.commands.toggleSubscript(),isActive:()=>s.isActive("subscript")||!1,disabled:!s.can().toggleSubscript(),icon:"Subscript",title:i("editor.subscript.tooltip"),shortcutKeys:((p=n.options.shortcutKeys)==null?void 0:p[0])??["mod","."]},h={action:()=>s.commands.toggleSuperscript(),isActive:()=>s.isActive("superscript")||!1,disabled:!s.can().toggleSuperscript(),icon:"Superscript",title:i("editor.superscript.tooltip"),shortcutKeys:((g=n.options.shortcutKeys)==null?void 0:g[1])??["mod",","]},r=[];return d!==!1&&r.push(o),a!==!1&&r.push(h),{componentProps:{icon:"Type",tooltip:i("editor.moremark"),disabled:!s.isEditable,items:r,isActive:()=>r==null?void 0:r.find(b=>b.isActive())}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(x.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(f.configure(this.options.superscript)),t}});exports.MoreMark=m;exports.RichTextMoreMark=S;
@@ -0,0 +1,157 @@
1
+ import { M as h, m, E as b } from "./clsx-CDyrfCnw.js";
2
+ import { jsx as e, Fragment as M, jsxs as d } from "react/jsx-runtime";
3
+ import { useMemo as f } from "react";
4
+ import { u as x, e as A, A as S, M as k, I as v, g as y } from "./index-lj3VWExo.js";
5
+ import "./theme.js";
6
+ import { D as T, a as K, b as w, c as C } from "./dropdown-menu-Bs69ZBbO.js";
7
+ var H = h.create({
8
+ name: "subscript",
9
+ addOptions() {
10
+ return {
11
+ HTMLAttributes: {}
12
+ };
13
+ },
14
+ parseHTML() {
15
+ return [
16
+ {
17
+ tag: "sub"
18
+ },
19
+ {
20
+ style: "vertical-align",
21
+ getAttrs(t) {
22
+ return t !== "sub" ? !1 : null;
23
+ }
24
+ }
25
+ ];
26
+ },
27
+ renderHTML({ HTMLAttributes: t }) {
28
+ return ["sub", m(this.options.HTMLAttributes, t), 0];
29
+ },
30
+ addCommands() {
31
+ return {
32
+ setSubscript: () => ({ commands: t }) => t.setMark(this.name),
33
+ toggleSubscript: () => ({ commands: t }) => t.toggleMark(this.name),
34
+ unsetSubscript: () => ({ commands: t }) => t.unsetMark(this.name)
35
+ };
36
+ },
37
+ addKeyboardShortcuts() {
38
+ return {
39
+ "Mod-,": () => this.editor.commands.toggleSubscript()
40
+ };
41
+ }
42
+ }), L = h.create({
43
+ name: "superscript",
44
+ addOptions() {
45
+ return {
46
+ HTMLAttributes: {}
47
+ };
48
+ },
49
+ parseHTML() {
50
+ return [
51
+ {
52
+ tag: "sup"
53
+ },
54
+ {
55
+ style: "vertical-align",
56
+ getAttrs(t) {
57
+ return t !== "super" ? !1 : null;
58
+ }
59
+ }
60
+ ];
61
+ },
62
+ renderHTML({ HTMLAttributes: t }) {
63
+ return ["sup", m(this.options.HTMLAttributes, t), 0];
64
+ },
65
+ addCommands() {
66
+ return {
67
+ setSuperscript: () => ({ commands: t }) => t.setMark(this.name),
68
+ toggleSuperscript: () => ({ commands: t }) => t.toggleMark(this.name),
69
+ unsetSuperscript: () => ({ commands: t }) => t.unsetMark(this.name)
70
+ };
71
+ },
72
+ addKeyboardShortcuts() {
73
+ return {
74
+ "Mod-.": () => this.editor.commands.toggleSuperscript()
75
+ };
76
+ }
77
+ });
78
+ function z() {
79
+ const t = x(D.name), {
80
+ icon: s = void 0,
81
+ tooltip: n = void 0,
82
+ items: i = [],
83
+ isActive: a = void 0
84
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { disabled: c, dataState: o } = A(a), p = f(() => (o == null ? void 0 : o.title) || "", [o]);
85
+ return t ? /* @__PURE__ */ d(T, { children: [
86
+ /* @__PURE__ */ e(K, { asChild: !0, disabled: c, children: /* @__PURE__ */ e(
87
+ S,
88
+ {
89
+ customClass: "!richtext-w-12 richtext-h-12",
90
+ disabled: c,
91
+ icon: s,
92
+ tooltip: n,
93
+ children: /* @__PURE__ */ e(k, { className: "richtext-size-3 richtext-text-gray-500" })
94
+ }
95
+ ) }),
96
+ /* @__PURE__ */ e(w, { className: "w-full", children: i == null ? void 0 : i.map((r, u) => /* @__PURE__ */ d(
97
+ C,
98
+ {
99
+ checked: p === r.title,
100
+ className: "richtext-flex richtext-items-center richtext-gap-3",
101
+ onClick: r.action,
102
+ children: [
103
+ /* @__PURE__ */ e(v, { name: r == null ? void 0 : r.icon }),
104
+ /* @__PURE__ */ e("span", { className: "richtext-ml-1", children: r.title }),
105
+ !!(r != null && r.shortcutKeys) && /* @__PURE__ */ e("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: y(r.shortcutKeys) })
106
+ ]
107
+ },
108
+ `more-mark-${u}`
109
+ )) })
110
+ ] }) : /* @__PURE__ */ e(M, {});
111
+ }
112
+ const D = /* @__PURE__ */ b.create({
113
+ name: "moreMark",
114
+ //@ts-expect-error
115
+ addOptions() {
116
+ var t;
117
+ return {
118
+ ...(t = this.parent) == null ? void 0 : t.call(this),
119
+ button({ editor: s, extension: n, t: i }) {
120
+ var u, l;
121
+ const a = n.options.subscript, c = n.options.superscript, o = {
122
+ action: () => s.commands.toggleSubscript(),
123
+ isActive: () => s.isActive("subscript") || !1,
124
+ disabled: !s.can().toggleSubscript(),
125
+ icon: "Subscript",
126
+ title: i("editor.subscript.tooltip"),
127
+ shortcutKeys: ((u = n.options.shortcutKeys) == null ? void 0 : u[0]) ?? ["mod", "."]
128
+ }, p = {
129
+ action: () => s.commands.toggleSuperscript(),
130
+ isActive: () => s.isActive("superscript") || !1,
131
+ disabled: !s.can().toggleSuperscript(),
132
+ icon: "Superscript",
133
+ title: i("editor.superscript.tooltip"),
134
+ shortcutKeys: ((l = n.options.shortcutKeys) == null ? void 0 : l[1]) ?? ["mod", ","]
135
+ }, r = [];
136
+ return a !== !1 && r.push(o), c !== !1 && r.push(p), {
137
+ // component: ActionMoreButton,
138
+ componentProps: {
139
+ icon: "Type",
140
+ tooltip: i("editor.moremark"),
141
+ disabled: !s.isEditable,
142
+ items: r,
143
+ isActive: () => r == null ? void 0 : r.find((g) => g.isActive())
144
+ }
145
+ };
146
+ }
147
+ };
148
+ },
149
+ addExtensions() {
150
+ const t = [];
151
+ return this.options.subscript !== !1 && t.push(H.configure(this.options.subscript)), this.options.superscript !== !1 && t.push(L.configure(this.options.superscript)), t;
152
+ }
153
+ });
154
+ export {
155
+ D as MoreMark,
156
+ z as RichTextMoreMark
157
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),r=require("react/jsx-runtime"),s=require("./index-D9oM__YW.cjs");require("react");require("./theme.cjs");function O(){const t=s.useButtonProps(c.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:u={},action:n=void 0,isActive:a=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:d,update:l}=s.useToggleActive(a),m=()=>{d||n&&(n(),l())};return t?r.jsx(s.ActionButton,{action:m,dataState:p,disabled:d,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:u}):r.jsx(r.Fragment,{})}const c=v.OrderedList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleOrderedList(),isActive:()=>e.isActive("orderedList"),disabled:!1,icon:"ListOrdered",shortcutKeys:o.options.shortcutKeys??["mod","shift","7"],tooltip:i("editor.orderedlist.tooltip")}})}}});exports.OrderedList=c;exports.RichTextOrderedList=O;
@@ -0,0 +1,52 @@
1
+ import { O as u } from "./index-DjDf4BK8.js";
2
+ import { jsx as n, Fragment as l } from "react/jsx-runtime";
3
+ import { u as f, d as v, A as O } from "./index-lj3VWExo.js";
4
+ import "react";
5
+ import "./theme.js";
6
+ function K() {
7
+ const t = f(A.name), {
8
+ icon: o = void 0,
9
+ tooltip: i = void 0,
10
+ shortcutKeys: e = void 0,
11
+ tooltipOptions: d = {},
12
+ action: s = void 0,
13
+ isActive: c = void 0
14
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: a, disabled: r, update: p } = v(c), m = () => {
15
+ r || s && (s(), p());
16
+ };
17
+ return t ? /* @__PURE__ */ n(
18
+ O,
19
+ {
20
+ action: m,
21
+ dataState: a,
22
+ disabled: r,
23
+ icon: o,
24
+ shortcutKeys: e,
25
+ tooltip: i,
26
+ tooltipOptions: d
27
+ }
28
+ ) : /* @__PURE__ */ n(l, {});
29
+ }
30
+ const A = /* @__PURE__ */ u.extend({
31
+ //@ts-expect-error
32
+ addOptions() {
33
+ var t;
34
+ return {
35
+ ...(t = this.parent) == null ? void 0 : t.call(this),
36
+ button: ({ editor: o, t: i, extension: e }) => ({
37
+ componentProps: {
38
+ action: () => o.commands.toggleOrderedList(),
39
+ isActive: () => o.isActive("orderedList"),
40
+ disabled: !1,
41
+ icon: "ListOrdered",
42
+ shortcutKeys: e.options.shortcutKeys ?? ["mod", "shift", "7"],
43
+ tooltip: i("editor.orderedlist.tooltip")
44
+ }
45
+ })
46
+ };
47
+ }
48
+ });
49
+ export {
50
+ A as OrderedList,
51
+ K as RichTextOrderedList
52
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./clsx-CXbNJWDD.cjs"),D=require("@tiptap/pm/state"),b=require("@tiptap/pm/view"),a=require("react/jsx-runtime"),g=require("react"),h=require("./index-D9oM__YW.cjs");require("./theme.cjs");const J=require("./index-bVGIXhRg.cjs"),q=require("./popover-D-hUKDYu.cjs");function Q(){const{t}=J.useLocale(),e=h.useEditorInstance(),s=h.useButtonProps(F.name),{icon:n=void 0,tooltip:u=void 0,shortcutKeys:o=void 0,tooltipOptions:c={},action:x=void 0,isActive:m=void 0}=(s==null?void 0:s.componentProps)??{},{disabled:i}=h.useActive(m),[R,f]=g.useState(!1),[p,T]=g.useState(""),[C,N]=g.useState(""),[j,M]=g.useState(!1),[V,B]=g.useState(""),w=()=>{var r,l,v,d;B(`${((l=(r=e==null?void 0:e.storage)==null?void 0:r.searchAndReplace)==null?void 0:l.resultIndex)+1}/${(d=(v=e==null?void 0:e.storage)==null?void 0:v.searchAndReplace)==null?void 0:d.results.length}`)};g.useEffect(()=>{e&&w()},[e]);const K=()=>{i||x&&x()},P=(r=!1)=>{var l,v,d,S,A,L,y,$;e&&(r&&((v=(l=e==null?void 0:e.commands)==null?void 0:l.resetIndex)==null||v.call(l)),(S=(d=e==null?void 0:e.commands)==null?void 0:d.setSearchTerm)==null||S.call(d,p),(L=(A=e==null?void 0:e.commands)==null?void 0:A.setReplaceTerm)==null||L.call(A,C),($=(y=e==null?void 0:e.commands)==null?void 0:y.setCaseSensitive)==null||$.call(y,j),w())},k=()=>{var S,A;if(!e)return;const{results:r,resultIndex:l}=e.storage.searchAndReplace,v=r[l];if(!v)return;(A=(S=e==null?void 0:e.commands)==null?void 0:S.setTextSelection)==null||A.call(S,v);const{node:d}=e.view.domAtPos(e.state.selection.anchor);d instanceof HTMLElement&&d.scrollIntoView({behavior:"smooth",block:"center"}),w()};g.useEffect(()=>{p.trim()||E(),p.trim()&&P(!0)},[p]),g.useEffect(()=>{C.trim()&&P()},[C]),g.useEffect(()=>{P(!0)},[j]);const W=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.replace)==null||l.call(r),k()},H=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.nextSearchResult)==null||l.call(r),k()},U=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.previousSearchResult)==null||l.call(r),k()},E=()=>{var r,l;T(""),N(""),(l=(r=e==null?void 0:e.commands)==null?void 0:r.resetIndex)==null||l.call(r),w()},z=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.replaceAll)==null||l.call(r),B("0/0")};return s?a.jsxs(q.Popover,{onOpenChange:f,open:R,children:[a.jsx(q.PopoverTrigger,{asChild:!0,disabled:i,children:a.jsx(h.ActionButton,{action:K,disabled:i,icon:n,shortcutKeys:o,tooltip:u,tooltipOptions:c})}),a.jsxs(q.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[a.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[a.jsx(h.Label,{children:t("editor.search.dialog.text")}),a.jsx("span",{className:"richtext-font-semibold",children:V})]}),a.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[a.jsx(h.Input,{autoFocus:!0,className:"richtext-w-full",onChange:r=>T(r.target.value),placeholder:"Text",required:!0,type:"text",value:p}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:U,children:a.jsx(h.IconComponent,{name:"ChevronUp"})}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:H,children:a.jsx(h.IconComponent,{name:"ChevronDown"})}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:E,children:"Clear"})]}),a.jsx(h.Label,{className:"richtext-mb-[6px]",children:t("editor.replace.dialog.text")}),a.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:a.jsx(h.Input,{className:"richtext-w-80",onChange:r=>N(r.target.value),placeholder:"Text",required:!0,type:"text",value:C})})}),a.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-1",children:[a.jsx(h.Checkbox,{checked:j,onCheckedChange:r=>{M(r),e.commands.setCaseSensitive(r)}}),a.jsx(h.Label,{children:t("editor.replace.caseSensitive")})]}),a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[a.jsx(h.Button,{className:"richtext-flex-1",onClick:W,children:t("editor.replace.dialog.text")}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:z,children:t("editor.replaceAll.dialog.text")})]})]})]}):a.jsx(a.Fragment,{})}const I=(t,e)=>e(t.tr);function X(t,e,s){return RegExp(e?t.replace(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`):t,s?"gu":"gui")}function Y(t,e,s,n){const u=[],o=[];let c=[],x=0;if(!e)return{decorationsToReturn:b.DecorationSet.empty,results:[]};t==null||t.descendants((m,i)=>{m.isText?c[x]?c[x]={text:c[x].text+m.text,pos:c[x].pos}:c[x]={text:`${m.text}`,pos:i}:x+=1}),c=c.filter(Boolean);for(const m of c){const{text:i,pos:R}=m,f=Array.from(i.matchAll(e)).filter(([p])=>p.trim());for(const p of f){if(p[0]==="")break;p.index!==void 0&&o.push({from:R+p.index,to:R+p.index+p[0].length})}}for(const[m,i]of o.entries()){const R=m===n?`${s} ${s}-current`:s,f=b.Decoration.inline(i.from,i.to,{class:R});u.push(f)}return{decorationsToReturn:b.DecorationSet.create(t,u),results:o}}function O(t,e,{state:s,dispatch:n}){if(!e[0])return;const{from:o,to:c}=e[0];n&&n(s.tr.insertText(t,o,c))}function Z(t,e,s,n){const u=e+1;if(!n[u])return null;const{from:o,to:c}=n[e],x=c-o-t.length+s,{from:m,to:i}=n[u];return n[u]={to:i-x,from:m-x},[x,n]}function _(t,e,{tr:s,dispatch:n}){let u=0,o=e.slice();if(o.length!==0){for(let c=0;c<o.length;c+=1){const{from:x,to:m}=o[c];s.insertText(t,x,m);const i=Z(t,c,u,o);i&&(u=i[0],o=i[1])}n(s)}}const F=G.Extension.create({name:"searchAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchTerm:"",replaceTerm:"",results:[],searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!0,onChange:()=>{},button:({editor:e,t:s})=>({componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:s("editor.searchAndReplace.tooltip"),isActive:()=>!0,editor:e}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.searchTerm=t,I(s,n),!1),setReplaceTerm:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.replaceTerm=t,I(s,n),!1),setCaseSensitive:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.caseSensitive=t,I(s,n),!1),resetIndex:()=>({editor:t,state:e,dispatch:s})=>(t.storage.searchAndReplace.resultIndex=0,I(e,s),!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:s}=t.storage.searchAndReplace,n=s+1;return e[n]?t.storage.searchAndReplace.resultIndex=n:t.storage.searchAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:s}=t.storage.searchAndReplace,n=s-1;return e[n]?t.storage.searchAndReplace.resultIndex=n:t.storage.searchAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:s})=>{const{replaceTerm:n,results:u,resultIndex:o}=t.storage.searchAndReplace,c=u[o];return c?(O(n,[c],{state:e,dispatch:s}),t.storage.searchAndReplace.results.splice(o,1)):(O(n,u,{state:e,dispatch:s}),t.storage.searchAndReplace.results.shift()),I(e,s),!1},replaceAll:()=>({editor:t,tr:e,state:s,dispatch:n})=>{const{replaceTerm:u,results:o}=t.storage.searchAndReplace;return _(u,o,{tr:e,dispatch:n}),t.storage.searchAndReplace.resultIndex=0,t.storage.searchAndReplace.results=[],I(s,n),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:s}=this.options,n=c=>t.storage.searchAndReplace.lastSearchTerm=c,u=c=>t.storage.searchAndReplace.lastCaseSensitive=c,o=c=>t.storage.searchAndReplace.lastResultIndex=c;return[new D.Plugin({key:new D.PluginKey(`richtextCustomPlugin${this.name}`),state:{init:()=>b.DecorationSet.empty,apply({doc:c,docChanged:x},m){const{searchTerm:i,lastSearchTerm:R,caseSensitive:f,lastCaseSensitive:p,resultIndex:T,lastResultIndex:C}=t.storage.searchAndReplace;if(!x&&R===i&&p===f&&C===T)return m;if(n(i),u(f),o(T),!i)return t.storage.searchAndReplace.results=[],b.DecorationSet.empty;const{decorationsToReturn:N,results:j}=Y(c,X(i,s,f),e,T);return t.storage.searchAndReplace.results=j,N}},props:{decorations(c){return this.getState(c)}}})]}});exports.RichTextSearchAndReplace=Q;exports.SearchAndReplace=F;