@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,1125 @@
1
+ import { h as oe, $ as X, m as le, k as ne } from "./clsx-CDyrfCnw.js";
2
+ import { z as Y, w as ie, c as g, h as se, u as ae, d as ce, D as he, m as de, A as ue, n as ge, o as me, p as pe, B as we, Y as ve, H as fe } from "./index-lj3VWExo.js";
3
+ import { jsx as e, jsxs as y, Fragment as j } from "react/jsx-runtime";
4
+ import { useState as H, useMemo as G, useCallback as q, useEffect as $, useRef as K } from "react";
5
+ import { I as Q, i as J, j as Ce } from "./index-4Q5IhypJ.js";
6
+ import { Color4 as m, Editor as Te, makeDropdownToolbar as be } from "easydrawer";
7
+ const W = {
8
+ TOP_LEFT: "tl",
9
+ TOP_RIGHT: "tr",
10
+ BOTTOM_LEFT: "bl",
11
+ BOTTOM_RIGHT: "br"
12
+ };
13
+ function xe({ editor: t, node: r, updateAttributes: o, getPos: n, selected: v }) {
14
+ const [b, M] = H({
15
+ width: Q,
16
+ height: Q
17
+ }), [d, a] = H({
18
+ width: 0,
19
+ height: 0
20
+ }), [S] = H([
21
+ W.TOP_LEFT,
22
+ W.TOP_RIGHT,
23
+ W.BOTTOM_LEFT,
24
+ W.BOTTOM_RIGHT
25
+ ]), [x, B] = H(!1), [c, h] = H({
26
+ x: 0,
27
+ y: 0,
28
+ w: 0,
29
+ h: 0,
30
+ dir: ""
31
+ }), { align: T } = r == null ? void 0 : r.attrs, C = G(() => {
32
+ const { src: u, alt: N, width: L, height: z } = r == null ? void 0 : r.attrs, _ = X(L) ? `${L}px` : L, f = X(z) ? `${z}px` : z;
33
+ return {
34
+ src: u || void 0,
35
+ alt: N || void 0,
36
+ style: {
37
+ width: _ || void 0,
38
+ height: f || void 0
39
+ }
40
+ };
41
+ }, [r == null ? void 0 : r.attrs]), i = G(() => {
42
+ const {
43
+ style: { width: u }
44
+ } = C;
45
+ return { width: u === "100%" ? u : void 0 };
46
+ }, [C]);
47
+ function O(u) {
48
+ a({
49
+ width: u.target.width,
50
+ height: u.target.height
51
+ });
52
+ }
53
+ const P = q(() => {
54
+ t.commands.setNodeSelection(n());
55
+ }, []), D = q(
56
+ Y(() => {
57
+ const { width: u } = getComputedStyle(t.view.dom);
58
+ M((N) => ({
59
+ ...N,
60
+ width: Number.parseInt(u, 10)
61
+ }));
62
+ }, J),
63
+ [t]
64
+ );
65
+ function V(u, N) {
66
+ u.preventDefault(), u.stopPropagation();
67
+ const L = d.width, z = d.height, _ = L / z;
68
+ let f = Number(r.attrs.width), A = Number(r.attrs.height);
69
+ const E = b.width;
70
+ f && !A ? (f = f > E ? E : f, A = Math.round(f / _)) : A && !f ? (f = Math.round(A * _), f = f > E ? E : f) : !f && !A ? (f = L > E ? E : L, A = Math.round(f / _)) : f = f > E ? E : f, B(!0), h({
71
+ x: u.clientX,
72
+ y: u.clientY,
73
+ w: f,
74
+ h: A,
75
+ dir: N
76
+ });
77
+ }
78
+ const p = q(
79
+ Y((u) => {
80
+ if (u.preventDefault(), u.stopPropagation(), !x)
81
+ return;
82
+ const { x: N, w: L, dir: z } = c, _ = (u.clientX - N) * (/l/.test(z) ? -1 : 1), { width: f, height: A } = r == null ? void 0 : r.attrs, E = f / A, Z = ie(L + _, Ce, b.width), re = Math.round(Z / E);
83
+ o({
84
+ width: Z,
85
+ height: re
86
+ });
87
+ }, J),
88
+ [x, c, b, o, r == null ? void 0 : r.attrs]
89
+ ), s = q(
90
+ (u) => {
91
+ u.preventDefault(), u.stopPropagation(), x && (h({
92
+ x: 0,
93
+ y: 0,
94
+ w: 0,
95
+ h: 0,
96
+ dir: ""
97
+ }), B(!1), P());
98
+ },
99
+ [x, P]
100
+ ), w = q(() => {
101
+ document == null || document.addEventListener("mousemove", p, !0), document == null || document.addEventListener("mouseup", s, !0);
102
+ }, [p, s]), k = q(() => {
103
+ document == null || document.removeEventListener("mousemove", p, !0), document == null || document.removeEventListener("mouseup", s, !0);
104
+ }, [p, s]);
105
+ $(() => (x ? w() : k(), () => {
106
+ k();
107
+ }), [x, w, k]);
108
+ const R = G(() => new ResizeObserver(() => D()), [D]);
109
+ return $(() => (R.observe(t.view.dom), () => {
110
+ R.disconnect();
111
+ }), [t.view.dom, R]), /* @__PURE__ */ e(
112
+ oe,
113
+ {
114
+ className: "image-view",
115
+ style: { ...i, width: "100%", textAlign: T },
116
+ children: /* @__PURE__ */ y(
117
+ "div",
118
+ {
119
+ "data-drag-handle": !0,
120
+ draggable: "true",
121
+ style: { ...i, background: "#fff" },
122
+ className: `image-view__body ${v ? "image-view__body--focused" : ""} ${x ? "image-view__body--resizing" : ""}`,
123
+ children: [
124
+ /* @__PURE__ */ e(
125
+ "img",
126
+ {
127
+ alt: C.alt,
128
+ className: "image-view__body__image block",
129
+ height: "auto",
130
+ onClick: P,
131
+ onLoad: O,
132
+ src: C.src,
133
+ style: C.style
134
+ }
135
+ ),
136
+ t.view.editable && (v || x) && /* @__PURE__ */ e("div", { className: "image-resizer", children: S == null ? void 0 : S.map((u) => /* @__PURE__ */ e(
137
+ "span",
138
+ {
139
+ className: `image-resizer__handler image-resizer__handler--${u}`,
140
+ onMouseDown: (N) => V(N, u)
141
+ },
142
+ `image-dir-${u}`
143
+ )) })
144
+ ]
145
+ }
146
+ )
147
+ }
148
+ );
149
+ }
150
+ const F = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", ye = (t) => {
151
+ t = t.replace(/\r\n/g, `
152
+ `);
153
+ let r = 0, o = "";
154
+ for (; r < t.length; r++) {
155
+ const n = t.charCodeAt(r);
156
+ n < 128 ? o += String.fromCharCode(n) : n > 127 && n < 2048 ? (o += String.fromCharCode(n >> 6 | 192), o += String.fromCharCode(63 & n | 128)) : (o += String.fromCharCode(n >> 12 | 224), o += String.fromCharCode(n >> 6 & 63 | 128), o += String.fromCharCode(63 & n | 128));
157
+ }
158
+ return o;
159
+ }, Me = (t) => {
160
+ let r, o, n, v, b, M, d, a = 0, S = "";
161
+ for (t = ye(t); a < t.length; ) r = t.charCodeAt(a++), o = t.charCodeAt(a++), n = t.charCodeAt(a++), v = r >> 2, b = (3 & r) << 4 | o >> 4, M = (15 & o) << 2 | n >> 6, d = 63 & n, isNaN(o) ? M = d = 64 : isNaN(n) && (d = 64), S = S + F.charAt(v) + F.charAt(b) + F.charAt(M) + F.charAt(d);
162
+ return S;
163
+ }, Se = (t) => typeof t == "string" ? "string" : typeof SVGElement < "u" && t instanceof SVGElement ? "element" : void 0, te = (t) => "data:image/svg+xml;base64," + Me(t), He = (t) => te(new XMLSerializer().serializeToString(t)), Ee = (t) => {
164
+ switch (Se(t)) {
165
+ case "string":
166
+ return te(t);
167
+ case "element":
168
+ return He(t);
169
+ default:
170
+ return t;
171
+ }
172
+ };
173
+ function Ne(t) {
174
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
175
+ "path",
176
+ {
177
+ color: "currentColor",
178
+ d: "M2 9.2v3.6M12.8 2H9.2M7.5 20H9M20 7.5V9M2.133 4.699c.155-.727.415-1.274.854-1.712c.426-.426.954-.684 1.652-.84m15.228 2.552c-.155-.727-.415-1.274-.854-1.712c-.417-.417-.932-.673-1.608-.83M4.64 19.853c-.698-.156-1.226-.414-1.652-.84c-.43-.43-.69-.965-.845-1.673m11.638 3.626c-1.812.125-3.607-8.326-2.374-9.559s9.684.561 9.559 2.373c-.087 1.187-2.095 1.656-2.037 2.711c.018.309.408.59 1.188 1.154c.543.39 1.096.77 1.629 1.175a.66.66 0 0 1 .234.687a3.35 3.35 0 0 1-2.472 2.473a.66.66 0 0 1-.688-.235c-.404-.533-.784-1.086-1.175-1.628c-.563-.78-.844-1.17-1.153-1.188c-1.055-.059-1.524 1.95-2.71 2.037",
179
+ fill: "none",
180
+ stroke: "currentColor",
181
+ strokeLinecap: "round",
182
+ strokeLinejoin: "round",
183
+ strokeWidth: "1.5"
184
+ }
185
+ ) });
186
+ }
187
+ function Le(t) {
188
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
189
+ "path",
190
+ {
191
+ d: "M20.06 18a4 4 0 0 1-.2-.89c-.67.7-1.48 1.05-2.41 1.05c-.83 0-1.52-.24-2.05-.71c-.53-.45-.8-1.06-.8-1.79c0-.88.33-1.56 1-2.05s1.61-.73 2.83-.73h1.4v-.64q0-.735-.45-1.17c-.3-.29-.75-.43-1.33-.43c-.52 0-.95.12-1.3.36c-.35.25-.52.54-.52.89h-1.46c0-.43.15-.84.45-1.24c.28-.4.71-.71 1.22-.94c.51-.21 1.06-.35 1.69-.35c.98 0 1.74.24 2.29.73s.84 1.16.86 2.02V16c0 .8.1 1.42.3 1.88V18zm-2.4-1.12c.45 0 .88-.11 1.29-.32c.4-.21.7-.49.88-.83v-1.57H18.7c-1.77 0-2.66.47-2.66 1.41c0 .43.15.73.46.96c.3.23.68.35 1.16.35m-12.2-3.17h4.07L7.5 8.29zM6.64 6h1.72l4.71 12h-1.93l-.97-2.57H4.82L3.86 18H1.93z",
192
+ fill: "currentColor"
193
+ }
194
+ ) });
195
+ }
196
+ function Ae(t) {
197
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
198
+ "path",
199
+ {
200
+ d: "M3 21v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z",
201
+ fill: "currentColor"
202
+ }
203
+ ) });
204
+ }
205
+ function ke(t) {
206
+ return /* @__PURE__ */ e(
207
+ "svg",
208
+ {
209
+ height: "1em",
210
+ viewBox: "0 0 256 256",
211
+ width: "1em",
212
+ xmlns: "http://www.w3.org/2000/svg",
213
+ ...t,
214
+ children: /* @__PURE__ */ e(
215
+ "path",
216
+ {
217
+ d: "M253.66 106.34a8 8 0 0 0-11.32 0L192 156.69L107.31 72l50.35-50.34a8 8 0 1 0-11.32-11.32L96 60.69a16 16 0 0 0-2.82 18.81L72 100.69a16 16 0 0 0 0 22.62l4.69 4.69l-58.35 58.34a8 8 0 0 0 3.13 13.25l72 24A7.9 7.9 0 0 0 96 224a8 8 0 0 0 5.66-2.34L136 187.31l4.69 4.69a16 16 0 0 0 22.62 0l21.19-21.18a16 16 0 0 0 18.81-2.82l50.35-50.34a8 8 0 0 0 0-11.32M93.84 206.85l-55-18.35L88 139.31L124.69 176ZM152 180.69L83.31 112L104 91.31L172.69 160Z",
218
+ fill: "currentColor"
219
+ }
220
+ )
221
+ }
222
+ );
223
+ }
224
+ function ze(t) {
225
+ return /* @__PURE__ */ y("svg", { height: "1em", viewBox: "0 0 16 16", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
226
+ /* @__PURE__ */ e(
227
+ "path",
228
+ {
229
+ d: "m2.648 9.937l7.29-7.288a2.21 2.21 0 0 1 3.124 0l2.29 2.288a2.21 2.21 0 0 1 0 3.126L10.413 13H12.5a.5.5 0 0 1 0 1H4.501a2.2 2.2 0 0 1-1.563-.647l.707-.707c.227.226.535.354.856.354h4.005a1.2 1.2 0 0 0 .848-.354l1.292-1.293l-4-4l-3.29 3.291a1.21 1.21 0 0 0 0 1.712l.29.29l-.708.707l-.29-.29a2.21 2.21 0 0 1 0-3.126M8 6h6.89a1.2 1.2 0 0 0-.246-.356L14 5H9zm2-2h3l-.645-.644a1.21 1.21 0 0 0-1.71 0zm4.89 3H7.708l1 1H14l.644-.644A1.2 1.2 0 0 0 14.891 7zM9.708 9l1.646 1.646L13 9z",
230
+ fill: "currentColor"
231
+ }
232
+ ),
233
+ /* @__PURE__ */ e(
234
+ "path",
235
+ {
236
+ d: "M14 11.5a.5.5 0 1 1-1 0a.5.5 0 0 1 1 0m1.5-.5a.5.5 0 1 0 0-1a.5.5 0 0 0 0 1m-1 2a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z",
237
+ fill: "currentColor"
238
+ }
239
+ )
240
+ ] });
241
+ }
242
+ function _e(t) {
243
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e("path", { d: "M3 3h18v18H3zm2 2v14h14V5z", fill: "currentColor" }) });
244
+ }
245
+ function Be(t) {
246
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e("path", { d: "M2 20V4h20v16zm2-2h16V6H4zm0 0V6z", fill: "currentColor" }) });
247
+ }
248
+ function Pe(t) {
249
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
250
+ "path",
251
+ {
252
+ d: "M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8",
253
+ fill: "currentColor"
254
+ }
255
+ ) });
256
+ }
257
+ function qe(t) {
258
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
259
+ "path",
260
+ {
261
+ d: "M10.363 3.591L2.257 17.125a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636-2.87L13.637 3.59a1.914 1.914 0 0 0-3.274 0z",
262
+ fill: "none",
263
+ stroke: "currentColor",
264
+ strokeLinecap: "round",
265
+ strokeLinejoin: "round",
266
+ strokeWidth: "2"
267
+ }
268
+ ) });
269
+ }
270
+ function Re(t) {
271
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
272
+ "path",
273
+ {
274
+ d: "m6.8 21l-5.2-9l5.2-9h10.4l5.2 9l-5.2 9zm1.15-2h8.1l4.025-7l-4.025-7h-8.1L3.9 12zM12 12",
275
+ fill: "currentColor"
276
+ }
277
+ ) });
278
+ }
279
+ function Ie(t) {
280
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ y("g", { fill: "none", fillRule: "evenodd", children: [
281
+ /* @__PURE__ */ e("path", { d: "m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z" }),
282
+ /* @__PURE__ */ e(
283
+ "path",
284
+ {
285
+ d: "M10.586 2.807a2 2 0 0 1 2.828 0l7.778 7.779a2 2 0 0 1 0 2.828l-7.778 7.778a2 2 0 0 1-2.828 0l-7.778-7.778a2 2 0 0 1 0-2.828zM12 4.222L4.222 12L12 19.778L19.778 12z",
286
+ fill: "currentColor"
287
+ }
288
+ )
289
+ ] }) });
290
+ }
291
+ function De(t) {
292
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e("path", { d: "M16.01 11H4v2h12.01v3L20 12l-3.99-4z", fill: "currentColor" }) });
293
+ }
294
+ function We(t) {
295
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
296
+ "path",
297
+ {
298
+ clipRule: "evenodd",
299
+ d: "M7.53 3.47a.75.75 0 0 1 0 1.06L5.81 6.25H15a5.75 5.75 0 0 1 0 11.5H8a.75.75 0 0 1 0-1.5h7a4.25 4.25 0 0 0 0-8.5H5.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 0 1 1.06 0",
300
+ fill: "currentColor",
301
+ fillRule: "evenodd"
302
+ }
303
+ ) });
304
+ }
305
+ function Fe(t) {
306
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
307
+ "path",
308
+ {
309
+ clipRule: "evenodd",
310
+ d: "M16.47 3.47a.75.75 0 0 1 1.06 0l3 3a.75.75 0 0 1 0 1.06l-3 3a.75.75 0 1 1-1.06-1.06l1.72-1.72H9a4.25 4.25 0 0 0 0 8.5h7a.75.75 0 0 1 0 1.5H9a5.75 5.75 0 0 1 0-11.5h9.19l-1.72-1.72a.75.75 0 0 1 0-1.06",
311
+ fill: "currentColor",
312
+ fillRule: "evenodd"
313
+ }
314
+ ) });
315
+ }
316
+ function Oe(t) {
317
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
318
+ "path",
319
+ {
320
+ d: "M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zm2-4h2V8H9zm4 0h2V8h-2z",
321
+ fill: "currentColor"
322
+ }
323
+ ) });
324
+ }
325
+ function Ve(t) {
326
+ return /* @__PURE__ */ e(
327
+ "svg",
328
+ {
329
+ height: "1em",
330
+ viewBox: "0 0 256 256",
331
+ width: "1em",
332
+ xmlns: "http://www.w3.org/2000/svg",
333
+ ...t,
334
+ children: /* @__PURE__ */ e(
335
+ "path",
336
+ {
337
+ d: "M211.81 83.79a28 28 0 0 1-33.12 4.83l-90.07 90.07a28 28 0 1 1-44.43-6.48a28 28 0 0 1 33.12-4.83l90.07-90.07a28 28 0 1 1 44.43 6.48",
338
+ fill: "currentColor"
339
+ }
340
+ )
341
+ }
342
+ );
343
+ }
344
+ function Ge(t) {
345
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
346
+ "path",
347
+ {
348
+ d: "M12 20.325q-.35 0-.712-.125t-.638-.4l-1.725-1.575q-2.65-2.425-4.788-4.812T2 8.15Q2 5.8 3.575 4.225T7.5 2.65q1.325 0 2.5.562t2 1.538q.825-.975 2-1.537t2.5-.563q2.35 0 3.925 1.575T22 8.15q0 2.875-2.125 5.275T15.05 18.25l-1.7 1.55q-.275.275-.637.4t-.713.125M11.05 6.75q-.725-1.025-1.55-1.563t-2-.537q-1.5 0-2.5 1t-1 2.5q0 1.3.925 2.763t2.213 2.837t2.65 2.575T12 18.3q.85-.775 2.213-1.975t2.65-2.575t2.212-2.837T20 8.15q0-1.5-1-2.5t-2.5-1q-1.175 0-2 .538T12.95 6.75q-.175.25-.425.375T12 7.25t-.525-.125t-.425-.375m.95 4.725",
349
+ fill: "currentColor"
350
+ }
351
+ ) });
352
+ }
353
+ function $e(t) {
354
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
355
+ "path",
356
+ {
357
+ d: "m7.625 6.4l2.8-3.625q.3-.4.713-.587T12 2t.863.188t.712.587l2.8 3.625l4.25 1.425q.65.2 1.025.738t.375 1.187q0 .3-.088.6t-.287.575l-2.75 3.9l.1 4.1q.025.875-.575 1.475t-1.4.6q-.05 0-.55-.075L12 19.675l-4.475 1.25q-.125.05-.275.063T6.975 21q-.8 0-1.4-.6T5 18.925l.1-4.125l-2.725-3.875q-.2-.275-.288-.575T2 9.75q0-.625.363-1.162t1.012-.763zM8.85 8.125L4 9.725L7.1 14.2L7 18.975l5-1.375l5 1.4l-.1-4.8L20 9.775l-4.85-1.65L12 4zM12 11.5",
358
+ fill: "currentColor"
359
+ }
360
+ ) });
361
+ }
362
+ function Ue(t) {
363
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
364
+ "path",
365
+ {
366
+ d: "M12.01 6c2.61 0 4.89 1.86 5.4 4.43l.3 1.5l1.52.11c1.56.11 2.78 1.41 2.78 2.96c0 1.65-1.35 3-3 3h-13c-2.21 0-4-1.79-4-4c0-2.05 1.53-3.76 3.56-3.97l1.07-.11l.5-.95A5.46 5.46 0 0 1 12.01 6m0-2C9.12 4 6.6 5.64 5.35 8.04C2.35 8.36.01 10.91.01 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.64-4.96C18.68 6.59 15.65 4 12.01 4",
367
+ fill: "currentColor"
368
+ }
369
+ ) });
370
+ }
371
+ function je(t) {
372
+ return /* @__PURE__ */ e("svg", { height: "1em", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", ...t, children: /* @__PURE__ */ e(
373
+ "path",
374
+ {
375
+ d: "M5.586 6.45A2 2 0 0 1 7.509 5h11.84a2 2 0 0 1 1.923 2.55l-2.858 10A2 2 0 0 1 16.491 19H4.651a2 2 0 0 1-1.923-2.55z",
376
+ fill: "none",
377
+ stroke: "currentColor",
378
+ strokeWidth: "2"
379
+ }
380
+ ) });
381
+ }
382
+ const Ze = "_wrapper_pva9d_1", Xe = "_tool_pva9d_17", Ye = "_active_pva9d_37", Ke = "_pen_pva9d_41", Qe = "_line_pva9d_48", Je = "_options_pva9d_56", et = "_colorWrap_pva9d_66", tt = "_color_pva9d_66", rt = "_colorActive_pva9d_83", l = {
383
+ wrapper: Ze,
384
+ tool: Xe,
385
+ active: Ye,
386
+ pen: Ke,
387
+ line: Qe,
388
+ options: Je,
389
+ colorWrap: et,
390
+ color: tt,
391
+ colorActive: rt
392
+ }, ot = [
393
+ m.blackHighlight,
394
+ m.ofRGBA(166 / 255, 81 / 255, 167 / 255, 0.3),
395
+ m.ofRGBA(247 / 255, 78 / 255, 158 / 255, 0.3),
396
+ m.ofRGBA(166 / 255, 83 / 255, 88 / 255, 0.3),
397
+ m.ofRGBA(246 / 255, 130 / 255, 28 / 255, 0.3),
398
+ m.ofRGBA(166 / 255, 198 / 255, 0, 0.3),
399
+ m.ofRGBA(98 / 255, 186 / 255, 70 / 255, 0.3)
400
+ ], ee = [
401
+ m.black,
402
+ m.fromHex("#007AFF"),
403
+ m.fromHex("#A651A7"),
404
+ m.fromHex("#F74E9E"),
405
+ m.fromHex("#FF5358"),
406
+ m.fromHex("#F6821C"),
407
+ m.fromHex("#FFC600"),
408
+ m.fromHex("#62BA46"),
409
+ m.fromHex("#E6BFE8"),
410
+ m.fromHex("#FEA3D2"),
411
+ m.fromHex("#FFA0A3"),
412
+ m.fromHex("#FBC276"),
413
+ m.fromHex("#FFFB85"),
414
+ m.fromHex("#AADC99")
415
+ ];
416
+ function lt({ onChange: t }) {
417
+ const [r, o] = H(m.blackHighlight);
418
+ return /* @__PURE__ */ e("div", { className: l.colorWrap, children: ot.map((n, v) => /* @__PURE__ */ e(
419
+ "button",
420
+ {
421
+ style: { backgroundColor: n.toHexString() },
422
+ className: g(l.color, {
423
+ [l.colorActive]: r.toHexString() === n.toHexString()
424
+ }),
425
+ onClick: () => {
426
+ o(n), t(n);
427
+ }
428
+ },
429
+ v
430
+ )) });
431
+ }
432
+ function U({ onChange: t }) {
433
+ const [r, o] = H(m.black);
434
+ return /* @__PURE__ */ y(j, { children: [
435
+ /* @__PURE__ */ e("div", { className: l.colorWrap, children: ee.slice(0, 7).map((n, v) => /* @__PURE__ */ e(
436
+ "button",
437
+ {
438
+ style: { backgroundColor: n.toHexString() },
439
+ className: g(l.color, {
440
+ [l.colorActive]: r.toHexString() === n.toHexString()
441
+ }),
442
+ onClick: () => {
443
+ o(n), t(n);
444
+ }
445
+ },
446
+ v
447
+ )) }),
448
+ /* @__PURE__ */ e("div", { className: l.colorWrap, children: ee.slice(7).map((n, v) => /* @__PURE__ */ e(
449
+ "button",
450
+ {
451
+ style: { backgroundColor: n.toHexString() },
452
+ className: g(l.color, {
453
+ [l.colorActive]: r.toHexString() === n.toHexString()
454
+ }),
455
+ onClick: () => {
456
+ o(n), t(n);
457
+ }
458
+ },
459
+ v
460
+ )) })
461
+ ] });
462
+ }
463
+ function nt({ setColorPen: t, setThicknessPen: r }) {
464
+ const [o, n] = H(2);
465
+ return /* @__PURE__ */ y("div", { className: l.options, children: [
466
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { onChange: (v) => t(v) }) }),
467
+ /* @__PURE__ */ e("div", { className: l.line }),
468
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
469
+ "input",
470
+ {
471
+ max: 10,
472
+ min: 1,
473
+ step: 0.1,
474
+ type: "range",
475
+ value: o,
476
+ onChange: (v) => {
477
+ r(Number.parseFloat(v.target.value)), n(Number.parseFloat(v.target.value));
478
+ }
479
+ }
480
+ ) })
481
+ ] });
482
+ }
483
+ function it({ setColorHighlight: t }) {
484
+ return /* @__PURE__ */ e("div", { className: l.options, children: /* @__PURE__ */ e(lt, { onChange: (r) => t(r) }) });
485
+ }
486
+ function st({ changeColorShape: t, changeBorderColorShape: r, onThicknessChange: o }) {
487
+ return /* @__PURE__ */ y("div", { className: l.options, children: [
488
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { onChange: (n) => t(n) }) }),
489
+ /* @__PURE__ */ e("div", { className: l.line }),
490
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { onChange: (n) => r(n) }) }),
491
+ /* @__PURE__ */ e("div", { className: l.line }),
492
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
493
+ "input",
494
+ {
495
+ defaultValue: 0,
496
+ max: 20,
497
+ min: 0,
498
+ step: 1,
499
+ type: "range",
500
+ onChange: (n) => {
501
+ o(Number.parseFloat(n.target.value));
502
+ }
503
+ }
504
+ ) })
505
+ ] });
506
+ }
507
+ function at(t) {
508
+ const {
509
+ setColorPen: r,
510
+ refEditor: o,
511
+ setThicknessPen: n,
512
+ setColorHighlight: v,
513
+ changeBorderColorShape: b,
514
+ onUndo: M,
515
+ changeColorShape: d,
516
+ changeShape: a,
517
+ onThicknessChange: S,
518
+ onRedo: x,
519
+ onClear: B
520
+ } = t, [c, h] = H(null), [T, C] = H(
521
+ 0
522
+ /* square */
523
+ );
524
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ y("div", { className: l.wrapper, children: [
525
+ /* @__PURE__ */ y("div", { className: l.pen, children: [
526
+ /* @__PURE__ */ e(
527
+ "button",
528
+ {
529
+ className: g(l.tool, {
530
+ [l.active]: c === "select"
531
+ }),
532
+ onClick: () => {
533
+ const i = o.current.toolController.getPrimaryTools();
534
+ if (c === "select") {
535
+ h(null), i[0].setEnabled(!1);
536
+ return;
537
+ }
538
+ h("select"), i[0].setEnabled(!0);
539
+ },
540
+ children: /* @__PURE__ */ e(Ne, {})
541
+ }
542
+ ),
543
+ /* @__PURE__ */ e("div", { className: l.line }),
544
+ /* @__PURE__ */ e(
545
+ "button",
546
+ {
547
+ className: g(l.tool, {
548
+ [l.active]: c === "text"
549
+ }),
550
+ onClick: () => {
551
+ const i = o.current.toolController.getPrimaryTools();
552
+ if (o.current.toolController.setToolEnabled(i[1]), c === "text") {
553
+ i[1].setEnabled(!1), h(null);
554
+ return;
555
+ }
556
+ h("text"), i[1].setEnabled(!0);
557
+ },
558
+ children: /* @__PURE__ */ e(Le, {})
559
+ }
560
+ ),
561
+ /* @__PURE__ */ e("div", { className: l.line }),
562
+ /* @__PURE__ */ e(
563
+ "button",
564
+ {
565
+ className: g(l.tool, {
566
+ [l.active]: c === "pencil"
567
+ }),
568
+ onClick: () => {
569
+ const i = o.current.toolController.getPrimaryTools();
570
+ if (c === "pencil") {
571
+ h(null), i[2].setEnabled(!1);
572
+ return;
573
+ }
574
+ h("pencil"), i[2].setEnabled(!0);
575
+ },
576
+ children: /* @__PURE__ */ e(Ae, {})
577
+ }
578
+ ),
579
+ /* @__PURE__ */ e(
580
+ "button",
581
+ {
582
+ className: g(l.tool, {
583
+ [l.active]: c === "highlighter"
584
+ }),
585
+ onClick: () => {
586
+ const i = o.current.toolController.getPrimaryTools();
587
+ if (c === "highlighter") {
588
+ h(null), i[3].setEnabled(!1);
589
+ return;
590
+ }
591
+ h("highlighter"), i[3].setEnabled(!0);
592
+ },
593
+ children: /* @__PURE__ */ e(ke, {})
594
+ }
595
+ ),
596
+ /* @__PURE__ */ e("div", { className: l.line }),
597
+ /* @__PURE__ */ e(
598
+ "button",
599
+ {
600
+ className: g(l.tool, {
601
+ [l.active]: c === "eraser"
602
+ }),
603
+ onClick: () => {
604
+ const i = o.current.toolController.getPrimaryTools();
605
+ if (c === "eraser") {
606
+ h(null), i[4].setEnabled(!1);
607
+ return;
608
+ }
609
+ h("eraser"), i[4].setEnabled(!0);
610
+ },
611
+ children: /* @__PURE__ */ e(ze, {})
612
+ }
613
+ ),
614
+ /* @__PURE__ */ e("div", { className: l.line }),
615
+ /* @__PURE__ */ e(
616
+ "button",
617
+ {
618
+ className: g(l.tool, {
619
+ [l.active]: c === "shapes" && T === 0
620
+ /* square */
621
+ }),
622
+ onClick: () => {
623
+ const i = o.current.toolController.getPrimaryTools();
624
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
625
+ 0
626
+ /* square */
627
+ ), C(
628
+ 0
629
+ /* square */
630
+ );
631
+ },
632
+ children: /* @__PURE__ */ e(_e, {})
633
+ }
634
+ ),
635
+ /* @__PURE__ */ e(
636
+ "button",
637
+ {
638
+ className: g(l.tool, {
639
+ [l.active]: c === "shapes" && T === 1
640
+ /* rectangle */
641
+ }),
642
+ onClick: () => {
643
+ const i = o.current.toolController.getPrimaryTools();
644
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
645
+ 1
646
+ /* rectangle */
647
+ ), C(
648
+ 1
649
+ /* rectangle */
650
+ );
651
+ },
652
+ children: /* @__PURE__ */ e(Be, {})
653
+ }
654
+ ),
655
+ /* @__PURE__ */ e(
656
+ "button",
657
+ {
658
+ className: g(l.tool, {
659
+ [l.active]: c === "shapes" && T === 2
660
+ /* circle */
661
+ }),
662
+ onClick: () => {
663
+ const i = o.current.toolController.getPrimaryTools();
664
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
665
+ 2
666
+ /* circle */
667
+ ), C(
668
+ 2
669
+ /* circle */
670
+ );
671
+ },
672
+ children: /* @__PURE__ */ e(Pe, {})
673
+ }
674
+ ),
675
+ /* @__PURE__ */ e(
676
+ "button",
677
+ {
678
+ className: g(l.tool, {
679
+ [l.active]: c === "shapes" && T === 3
680
+ /* triangle */
681
+ }),
682
+ onClick: () => {
683
+ const i = o.current.toolController.getPrimaryTools();
684
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
685
+ 3
686
+ /* triangle */
687
+ ), C(
688
+ 3
689
+ /* triangle */
690
+ );
691
+ },
692
+ children: /* @__PURE__ */ e(qe, {})
693
+ }
694
+ ),
695
+ /* @__PURE__ */ e(
696
+ "button",
697
+ {
698
+ className: g(l.tool, {
699
+ [l.active]: c === "shapes" && T === 4
700
+ /* hexagonal */
701
+ }),
702
+ onClick: () => {
703
+ const i = o.current.toolController.getPrimaryTools();
704
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
705
+ 4
706
+ /* hexagonal */
707
+ ), C(
708
+ 4
709
+ /* hexagonal */
710
+ );
711
+ },
712
+ children: /* @__PURE__ */ e(Re, {})
713
+ }
714
+ ),
715
+ /* @__PURE__ */ e(
716
+ "button",
717
+ {
718
+ className: g(l.tool, {
719
+ [l.active]: c === "shapes" && T === 5
720
+ /* diamond */
721
+ }),
722
+ onClick: () => {
723
+ const i = o.current.toolController.getPrimaryTools();
724
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
725
+ 5
726
+ /* diamond */
727
+ ), C(
728
+ 5
729
+ /* diamond */
730
+ );
731
+ },
732
+ children: /* @__PURE__ */ e(Ie, {})
733
+ }
734
+ ),
735
+ /* @__PURE__ */ e(
736
+ "button",
737
+ {
738
+ className: g(l.tool, {
739
+ [l.active]: c === "shapes" && T === 6
740
+ /* arrow */
741
+ }),
742
+ onClick: () => {
743
+ const i = o.current.toolController.getPrimaryTools();
744
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
745
+ 6
746
+ /* arrow */
747
+ ), C(
748
+ 6
749
+ /* arrow */
750
+ );
751
+ },
752
+ children: /* @__PURE__ */ e(De, {})
753
+ }
754
+ ),
755
+ /* @__PURE__ */ e(
756
+ "button",
757
+ {
758
+ className: g(l.tool, {
759
+ [l.active]: c === "shapes" && T === 7
760
+ /* line */
761
+ }),
762
+ onClick: () => {
763
+ const i = o.current.toolController.getPrimaryTools();
764
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
765
+ 7
766
+ /* line */
767
+ ), C(
768
+ 7
769
+ /* line */
770
+ );
771
+ },
772
+ children: /* @__PURE__ */ e(Ve, {})
773
+ }
774
+ ),
775
+ /* @__PURE__ */ e(
776
+ "button",
777
+ {
778
+ className: g(l.tool, {
779
+ [l.active]: c === "shapes" && T === 8
780
+ /* heart */
781
+ }),
782
+ onClick: () => {
783
+ const i = o.current.toolController.getPrimaryTools();
784
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
785
+ 8
786
+ /* heart */
787
+ ), C(
788
+ 8
789
+ /* heart */
790
+ );
791
+ },
792
+ children: /* @__PURE__ */ e(Ge, {})
793
+ }
794
+ ),
795
+ /* @__PURE__ */ e(
796
+ "button",
797
+ {
798
+ className: g(l.tool, {
799
+ [l.active]: c === "shapes" && T === 9
800
+ /* star */
801
+ }),
802
+ onClick: () => {
803
+ const i = o.current.toolController.getPrimaryTools();
804
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
805
+ 9
806
+ /* star */
807
+ ), C(
808
+ 9
809
+ /* star */
810
+ );
811
+ },
812
+ children: /* @__PURE__ */ e($e, {})
813
+ }
814
+ ),
815
+ /* @__PURE__ */ e(
816
+ "button",
817
+ {
818
+ className: g(l.tool, {
819
+ [l.active]: c === "shapes" && T === 10
820
+ /* cloud */
821
+ }),
822
+ onClick: () => {
823
+ const i = o.current.toolController.getPrimaryTools();
824
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
825
+ 10
826
+ /* cloud */
827
+ ), C(
828
+ 10
829
+ /* cloud */
830
+ );
831
+ },
832
+ children: /* @__PURE__ */ e(Ue, {})
833
+ }
834
+ ),
835
+ /* @__PURE__ */ e(
836
+ "button",
837
+ {
838
+ className: g(l.tool, {
839
+ [l.active]: c === "shapes" && T === 11
840
+ /* parallelogram */
841
+ }),
842
+ onClick: () => {
843
+ const i = o.current.toolController.getPrimaryTools();
844
+ o.current.toolController.setToolEnabled(i[5]), h("shapes"), i[5].setEnabled(!0), a(
845
+ 11
846
+ /* parallelogram */
847
+ ), C(
848
+ 11
849
+ /* parallelogram */
850
+ );
851
+ },
852
+ children: /* @__PURE__ */ e(je, {})
853
+ }
854
+ ),
855
+ /* @__PURE__ */ e("div", { className: l.line }),
856
+ /* @__PURE__ */ e("button", { className: g(l.tool), onClick: M, children: /* @__PURE__ */ e(We, {}) }),
857
+ /* @__PURE__ */ e("button", { className: g(l.tool), onClick: x, children: /* @__PURE__ */ e(Fe, {}) }),
858
+ /* @__PURE__ */ e("button", { className: g(l.tool), onClick: B, children: /* @__PURE__ */ e(Oe, {}) })
859
+ ] }),
860
+ /* @__PURE__ */ y("div", { className: l.optionsWrap, children: [
861
+ c === "pencil" && /* @__PURE__ */ e(nt, { setColorPen: r, setThicknessPen: n }),
862
+ c === "highlighter" && /* @__PURE__ */ e(it, { setColorHighlight: v }),
863
+ c === "shapes" && /* @__PURE__ */ e(
864
+ st,
865
+ {
866
+ changeBorderColorShape: b,
867
+ changeColorShape: d,
868
+ changeShape: a,
869
+ onThicknessChange: S
870
+ }
871
+ )
872
+ ] })
873
+ ] }) });
874
+ }
875
+ function ct(t = 8) {
876
+ return Math.random().toString(36).substring(2, t + 2);
877
+ }
878
+ let I = !1;
879
+ function vt() {
880
+ const t = se(), r = ae(ht.name), { isActive: o = void 0, upload: n } = (r == null ? void 0 : r.componentProps) ?? {}, { editorDisabled: v } = ce(o), [b, M] = H(!1), d = K(null), a = K(null), S = () => {
881
+ (async () => {
882
+ const s = document.querySelector("#easydrawer");
883
+ s && (d.current = new Te(s, {
884
+ wheelEventsEnabled: !1,
885
+ disableZoom: !0
886
+ }), a.current = be(d.current), a.current.addDefaultToolWidgets());
887
+ })();
888
+ };
889
+ $(() => {
890
+ b && setTimeout(() => {
891
+ S();
892
+ }, 200);
893
+ }, [b]);
894
+ const x = async () => {
895
+ if (d.current) {
896
+ const p = d.current.toSVG(), s = p.outerHTML, w = `drawer-${ct()}.svg`;
897
+ let k = Ee(p.outerHTML);
898
+ if (n) {
899
+ const R = ve(k, w);
900
+ k = await n(R);
901
+ }
902
+ t == null || t.chain().focus().setDrawer(
903
+ {
904
+ type: "drawer",
905
+ src: k,
906
+ alt: encodeURIComponent(s),
907
+ width: 426,
908
+ height: 212
909
+ },
910
+ !!s
911
+ ).run();
912
+ }
913
+ M(!1);
914
+ }, B = (p) => {
915
+ const s = d.current.toolController.getPrimaryTools()[2], w = a.current.getWidgetById("pen-1");
916
+ s && w && (s.setColor(p), w.serializeState());
917
+ }, c = (p) => {
918
+ const s = d.current.toolController.getPrimaryTools()[2], w = a.current.getWidgetById("pen-1");
919
+ s && w && (s.setThickness(p), w.serializeState());
920
+ }, h = (p) => {
921
+ const s = d.current.toolController.getPrimaryTools()[3], w = a.current.getWidgetById("pen-2");
922
+ s && w && (s.setColor(p), w.serializeState());
923
+ }, T = (p) => {
924
+ const s = a.current.getWidgetById("shape");
925
+ s && s.setShapeType(p);
926
+ }, C = (p) => {
927
+ const s = d.current.toolController.getPrimaryTools()[5], w = a.current.getWidgetById("shape");
928
+ s && w && (s.setColor(p), w.serializeState());
929
+ }, i = (p) => {
930
+ const s = d.current.toolController.getPrimaryTools()[5], w = a.current.getWidgetById("shape");
931
+ s && w && (s.setThickness(p), w.serializeState());
932
+ }, O = (p) => {
933
+ const s = d.current.toolController.getPrimaryTools()[5], w = a.current.getWidgetById("shape");
934
+ s && w && (s.setBorderColor(p), w.serializeState());
935
+ }, P = () => {
936
+ if (I) {
937
+ for (; d.current.history.redoStackSize > 0; )
938
+ d.current.history.redo();
939
+ I = !1;
940
+ return;
941
+ }
942
+ d.current.history.undo();
943
+ }, D = () => {
944
+ I || d.current.history.redo();
945
+ }, V = () => {
946
+ if (!I) {
947
+ for (; d.current.history.undoStackSize > 0; )
948
+ P();
949
+ I = !0;
950
+ }
951
+ };
952
+ return r ? /* @__PURE__ */ y(he, { onOpenChange: M, open: b, children: [
953
+ /* @__PURE__ */ e(de, { asChild: !0, children: /* @__PURE__ */ e(
954
+ ue,
955
+ {
956
+ disabled: v,
957
+ action: () => {
958
+ v || M(!0);
959
+ },
960
+ icon: "PencilRuler",
961
+ tooltip: "Drawer"
962
+ }
963
+ ) }),
964
+ /* @__PURE__ */ y(ge, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
965
+ /* @__PURE__ */ e(me, { children: "Drawer" }),
966
+ /* @__PURE__ */ y(
967
+ "div",
968
+ {
969
+ style: {
970
+ height: "600px",
971
+ width: "100%",
972
+ borderWidth: 1,
973
+ background: "white",
974
+ position: "relative"
975
+ },
976
+ children: [
977
+ /* @__PURE__ */ e("div", { className: "richtext-size-full", id: "easydrawer" }),
978
+ /* @__PURE__ */ e(
979
+ at,
980
+ {
981
+ changeBorderColorShape: O,
982
+ changeColorShape: C,
983
+ changeShape: T,
984
+ onClear: V,
985
+ onRedo: D,
986
+ onThicknessChange: i,
987
+ onUndo: P,
988
+ refEditor: d,
989
+ setColorHighlight: h,
990
+ setColorPen: B,
991
+ setThicknessPen: c
992
+ }
993
+ )
994
+ ]
995
+ }
996
+ ),
997
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(we, { onClick: x, type: "button", children: "Save changes" }) })
998
+ ] })
999
+ ] }) : /* @__PURE__ */ e(j, {});
1000
+ }
1001
+ const ht = /* @__PURE__ */ fe.extend({
1002
+ name: "richTextDrawer",
1003
+ //@ts-expect-error
1004
+ addOptions() {
1005
+ var t;
1006
+ return {
1007
+ ...(t = this.parent) == null ? void 0 : t.call(this),
1008
+ inline: !1,
1009
+ content: "",
1010
+ marks: "",
1011
+ group: "block",
1012
+ draggable: !1,
1013
+ selectable: !0,
1014
+ atom: !0,
1015
+ HTMLAttributes: {
1016
+ class: "drawer"
1017
+ },
1018
+ button: ({ t: r, extension: o }) => {
1019
+ var n;
1020
+ return {
1021
+ componentProps: {
1022
+ action: () => !0,
1023
+ isActive: () => !1,
1024
+ disabled: !1,
1025
+ icon: "PencilRuler",
1026
+ tooltip: r("editor.drawer.tooltip"),
1027
+ upload: (n = o == null ? void 0 : o.options) == null ? void 0 : n.upload
1028
+ }
1029
+ };
1030
+ }
1031
+ };
1032
+ },
1033
+ addAttributes() {
1034
+ var t;
1035
+ return {
1036
+ ...(t = this.parent) == null ? void 0 : t.call(this),
1037
+ width: {
1038
+ default: null,
1039
+ parseHTML: (r) => {
1040
+ const o = r.querySelector("img"), n = o == null ? void 0 : o.getAttribute("width");
1041
+ return n ? Number.parseInt(n, 10) : 320;
1042
+ },
1043
+ renderHTML: (r) => ({
1044
+ width: r.width
1045
+ })
1046
+ },
1047
+ height: {
1048
+ default: null,
1049
+ parseHTML: (r) => {
1050
+ const o = r.querySelector("img"), n = o == null ? void 0 : o.getAttribute("height");
1051
+ return n ? Number.parseInt(n, 10) : 212;
1052
+ },
1053
+ renderHTML: (r) => ({
1054
+ height: r.height
1055
+ })
1056
+ },
1057
+ align: {
1058
+ default: "center",
1059
+ parseHTML: (r) => r.getAttribute("align"),
1060
+ renderHTML: (r) => ({
1061
+ align: r.align
1062
+ })
1063
+ }
1064
+ };
1065
+ },
1066
+ addNodeView() {
1067
+ return ne(xe);
1068
+ },
1069
+ // @ts-ignore
1070
+ addCommands() {
1071
+ return {
1072
+ setDrawer: (t, r) => ({ commands: o, editor: n }) => r ? o.insertContent({
1073
+ type: this.name,
1074
+ attrs: t
1075
+ }) : o.insertContentAt(n.state.selection.anchor, {
1076
+ type: this.name,
1077
+ attrs: t
1078
+ }),
1079
+ setAlignImageDrawer: (t) => ({ commands: r }) => r.updateAttributes(this.name, { align: t })
1080
+ };
1081
+ },
1082
+ renderHTML({ HTMLAttributes: t }) {
1083
+ const { align: r } = t;
1084
+ return [
1085
+ "div",
1086
+ // Parent element
1087
+ {
1088
+ style: r ? `text-align: ${r};` : "",
1089
+ class: "imageDrawer"
1090
+ },
1091
+ [
1092
+ "img",
1093
+ le(
1094
+ // @ts-ignore
1095
+ this.options.HTMLAttributes,
1096
+ t
1097
+ )
1098
+ ]
1099
+ ];
1100
+ },
1101
+ parseHTML() {
1102
+ return [
1103
+ {
1104
+ tag: "div[class=imageDrawer]",
1105
+ getAttrs: (t) => {
1106
+ const r = t.querySelector("img"), o = r == null ? void 0 : r.getAttribute("width"), n = r == null ? void 0 : r.getAttribute("height");
1107
+ return {
1108
+ src: r == null ? void 0 : r.getAttribute("src"),
1109
+ alt: r == null ? void 0 : r.getAttribute("alt"),
1110
+ width: o ? Number.parseInt(o, 10) : null,
1111
+ height: n ? Number.parseInt(n, 10) : null,
1112
+ align: (r == null ? void 0 : r.getAttribute("align")) || t.style.textAlign || null
1113
+ };
1114
+ }
1115
+ }
1116
+ ];
1117
+ }
1118
+ });
1119
+ export {
1120
+ at as C,
1121
+ ht as D,
1122
+ vt as R,
1123
+ Ee as i,
1124
+ ct as s
1125
+ };