reactjs-tiptap-editor-pro 0.2.31 → 0.2.33

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 (331) hide show
  1. package/lib/ColorPicker-MEAh4MhG.js +28181 -0
  2. package/lib/ColorPicker-ZncOwjAP.cjs +142 -0
  3. package/lib/extension-bundle.cjs +133 -0
  4. package/lib/extension-bundle.d.cts +947 -0
  5. package/lib/extension-bundle.d.ts +947 -0
  6. package/lib/extension-bundle.js +23921 -0
  7. package/lib/index.cjs +140 -0
  8. package/lib/index.d.cts +513 -0
  9. package/lib/index.d.ts +513 -0
  10. package/lib/index.js +3700 -0
  11. package/lib/locale-bundle-DiqW5jwb.cjs +1 -0
  12. package/lib/locale-bundle-DxCAtRDI.js +1487 -0
  13. package/lib/locale-bundle.cjs +1 -0
  14. package/lib/locale-bundle.d.cts +1140 -0
  15. package/lib/locale-bundle.d.ts +1140 -0
  16. package/lib/locale-bundle.js +9 -0
  17. package/lib/lucide-react-BFZtMawV.js +30462 -0
  18. package/lib/lucide-react-CMPhLW1m.cjs +7851 -0
  19. package/lib/style.css +1 -0
  20. package/package.json +58 -5
  21. package/src/components/ActionButton.tsx +0 -103
  22. package/src/components/ActionMenuButton.tsx +0 -76
  23. package/src/components/BubbleMenu.tsx +0 -93
  24. package/src/components/CharactorCount.tsx +0 -50
  25. package/src/components/ColorPicker.tsx +0 -272
  26. package/src/components/RichTextEditor.tsx +0 -212
  27. package/src/components/SizeSetter/SizeSetter.tsx +0 -102
  28. package/src/components/Toolbar.tsx +0 -108
  29. package/src/components/icons/Activity.tsx +0 -19
  30. package/src/components/icons/Animas.tsx +0 -24
  31. package/src/components/icons/AspectRatio.tsx +0 -13
  32. package/src/components/icons/Blockquote.tsx +0 -17
  33. package/src/components/icons/ColumnAddLeft.tsx +0 -7
  34. package/src/components/icons/ColumnAddRight.tsx +0 -7
  35. package/src/components/icons/DeleteColumn.tsx +0 -26
  36. package/src/components/icons/DeleteRow.tsx +0 -26
  37. package/src/components/icons/Direction.tsx +0 -7
  38. package/src/components/icons/Excalidraw.tsx +0 -7
  39. package/src/components/icons/ExportPdf.tsx +0 -8
  40. package/src/components/icons/ExportWord.tsx +0 -24
  41. package/src/components/icons/FileWordOutline.tsx +0 -13
  42. package/src/components/icons/Flag.tsx +0 -19
  43. package/src/components/icons/Food.tsx +0 -20
  44. package/src/components/icons/GIfIcon.tsx +0 -10
  45. package/src/components/icons/Icon.tsx +0 -30
  46. package/src/components/icons/ImportWord.tsx +0 -23
  47. package/src/components/icons/LeftToRight.tsx +0 -7
  48. package/src/components/icons/LineHeight.tsx +0 -13
  49. package/src/components/icons/MenuDown.tsx +0 -24
  50. package/src/components/icons/Mermaid.tsx +0 -13
  51. package/src/components/icons/NoFill.tsx +0 -7
  52. package/src/components/icons/Object.tsx +0 -24
  53. package/src/components/icons/RightToLeft.tsx +0 -7
  54. package/src/components/icons/SizeL.tsx +0 -9
  55. package/src/components/icons/SizeM.tsx +0 -13
  56. package/src/components/icons/SizeS.tsx +0 -13
  57. package/src/components/icons/Symbol.tsx +0 -19
  58. package/src/components/icons/Travel.tsx +0 -24
  59. package/src/components/icons/Twitter.tsx +0 -7
  60. package/src/components/icons/icons.ts +0 -212
  61. package/src/components/icons/index.ts +0 -12
  62. package/src/components/index.ts +0 -9
  63. package/src/components/menus/bubble.ts +0 -395
  64. package/src/components/menus/components/BubbleMenuContent.tsx +0 -15
  65. package/src/components/menus/components/BubbleMenuDrawer.tsx +0 -128
  66. package/src/components/menus/components/BubbleMenuExcalidraw.tsx +0 -91
  67. package/src/components/menus/components/BubbleMenuIframe.tsx +0 -143
  68. package/src/components/menus/components/BubbleMenuKatex.tsx +0 -136
  69. package/src/components/menus/components/BubbleMenuLink.tsx +0 -99
  70. package/src/components/menus/components/BubbleMenuMedia.tsx +0 -235
  71. package/src/components/menus/components/BubbleMenuMermaid.tsx +0 -128
  72. package/src/components/menus/components/BubbleMenuText.tsx +0 -102
  73. package/src/components/menus/components/BubbleMenuTwitter.tsx +0 -91
  74. package/src/components/menus/components/ColumnsBubbleMenu.tsx +0 -59
  75. package/src/components/menus/components/ContentMenu.tsx +0 -396
  76. package/src/components/menus/components/TableBubbleMenu.tsx +0 -362
  77. package/src/components/menus/index.ts +0 -7
  78. package/src/components/ui/button.tsx +0 -56
  79. package/src/components/ui/checkbox.tsx +0 -30
  80. package/src/components/ui/dialog.tsx +0 -128
  81. package/src/components/ui/dropdown-menu.tsx +0 -203
  82. package/src/components/ui/emoji-picker.tsx +0 -166
  83. package/src/components/ui/index.ts +0 -14
  84. package/src/components/ui/input.tsx +0 -25
  85. package/src/components/ui/label.tsx +0 -26
  86. package/src/components/ui/popover.tsx +0 -31
  87. package/src/components/ui/select.tsx +0 -162
  88. package/src/components/ui/separator.tsx +0 -31
  89. package/src/components/ui/switch.tsx +0 -29
  90. package/src/components/ui/tabs.tsx +0 -55
  91. package/src/components/ui/textarea.tsx +0 -24
  92. package/src/components/ui/toast.tsx +0 -129
  93. package/src/components/ui/toaster.tsx +0 -44
  94. package/src/components/ui/toggle.tsx +0 -45
  95. package/src/components/ui/tooltip.tsx +0 -30
  96. package/src/components/ui/use-toast.ts +0 -197
  97. package/src/constants/index.ts +0 -223
  98. package/src/constants/resetCSS.ts +0 -139
  99. package/src/extension-bundle.ts +0 -2
  100. package/src/extensions/Attachment/Attachment.ts +0 -144
  101. package/src/extensions/Attachment/components/NodeViewAttachment/FileIcon.tsx +0 -69
  102. package/src/extensions/Attachment/components/NodeViewAttachment/FileIconString.ts +0 -28
  103. package/src/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.tsx +0 -155
  104. package/src/extensions/Attachment/components/NodeViewAttachment/index.module.scss +0 -23
  105. package/src/extensions/Attachment/index.ts +0 -1
  106. package/src/extensions/BaseKit.ts +0 -253
  107. package/src/extensions/Blockquote/Blockquote.ts +0 -31
  108. package/src/extensions/Blockquote/index.ts +0 -1
  109. package/src/extensions/Bold/Bold.ts +0 -26
  110. package/src/extensions/Bold/index.ts +0 -1
  111. package/src/extensions/BulletList/BulletList.ts +0 -28
  112. package/src/extensions/BulletList/index.ts +0 -1
  113. package/src/extensions/Clear/Clear.ts +0 -24
  114. package/src/extensions/Clear/index.ts +0 -1
  115. package/src/extensions/Code/Code.ts +0 -26
  116. package/src/extensions/Code/index.ts +0 -1
  117. package/src/extensions/CodeBlock/CodeBlock.ts +0 -54
  118. package/src/extensions/CodeBlock/components/CodeBlockActiveButton.tsx +0 -66
  119. package/src/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.tsx +0 -89
  120. package/src/extensions/CodeBlock/components/NodeViewCodeBlock/index.module.scss +0 -81
  121. package/src/extensions/CodeBlock/highlighter.ts +0 -132
  122. package/src/extensions/CodeBlock/index.ts +0 -1
  123. package/src/extensions/CodeBlock/shiki-plugin.ts +0 -213
  124. package/src/extensions/Color/Color.ts +0 -52
  125. package/src/extensions/Color/components/ColorActionButton.tsx +0 -104
  126. package/src/extensions/Color/index.ts +0 -1
  127. package/src/extensions/Document/Document.ts +0 -8
  128. package/src/extensions/Document/index.ts +0 -1
  129. package/src/extensions/Drawer/Drawer.ts +0 -177
  130. package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.module.scss +0 -85
  131. package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.tsx +0 -598
  132. package/src/extensions/Drawer/components/ControlDrawer/icon.tsx +0 -500
  133. package/src/extensions/Drawer/components/DrawerActiveButton.tsx +0 -239
  134. package/src/extensions/Drawer/components/EditDrawerBlock.tsx +0 -238
  135. package/src/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.tsx +0 -260
  136. package/src/extensions/Drawer/index.ts +0 -1
  137. package/src/extensions/Emoji/Emoji.ts +0 -146
  138. package/src/extensions/Emoji/components/EmojiList/EmojiList.tsx +0 -103
  139. package/src/extensions/Emoji/components/EmojiList/emojis.ts +0 -1858
  140. package/src/extensions/Emoji/components/EmojiPicker/EmojiPicker.tsx +0 -61
  141. package/src/extensions/Emoji/index.ts +0 -1
  142. package/src/extensions/Excalidraw/Excalidraw.ts +0 -123
  143. package/src/extensions/Excalidraw/components/ExcalidrawActiveButton.tsx +0 -138
  144. package/src/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.tsx +0 -178
  145. package/src/extensions/Excalidraw/components/NodeViewExcalidraw/index.module.scss +0 -43
  146. package/src/extensions/Excalidraw/index.ts +0 -1
  147. package/src/extensions/ExportPdf/ExportPdf.ts +0 -25
  148. package/src/extensions/ExportPdf/index.ts +0 -1
  149. package/src/extensions/ExportWord/ExportWord.ts +0 -87
  150. package/src/extensions/ExportWord/index.ts +0 -1
  151. package/src/extensions/FontFamily/FontFamily.ts +0 -64
  152. package/src/extensions/FontFamily/components/FontFamilyButton.tsx +0 -97
  153. package/src/extensions/FontFamily/index.ts +0 -1
  154. package/src/extensions/FontSize/FontSize.ts +0 -119
  155. package/src/extensions/FontSize/components/FontSizeMenuButton.tsx +0 -84
  156. package/src/extensions/FontSize/index.ts +0 -1
  157. package/src/extensions/FormatPainter/FormatPainter.ts +0 -121
  158. package/src/extensions/FormatPainter/index.ts +0 -1
  159. package/src/extensions/Heading/Heading.ts +0 -57
  160. package/src/extensions/Heading/components/HeadingButton.tsx +0 -96
  161. package/src/extensions/Heading/index.ts +0 -1
  162. package/src/extensions/Highlight/Highlight.ts +0 -36
  163. package/src/extensions/Highlight/components/HighlightActionButton.tsx +0 -108
  164. package/src/extensions/Highlight/index.ts +0 -1
  165. package/src/extensions/History/History.ts +0 -39
  166. package/src/extensions/History/components/HistoryActionButton.tsx +0 -74
  167. package/src/extensions/History/index.ts +0 -1
  168. package/src/extensions/HorizontalRule/HorizontalRule.ts +0 -42
  169. package/src/extensions/HorizontalRule/index.ts +0 -1
  170. package/src/extensions/Iframe/Iframe.ts +0 -140
  171. package/src/extensions/Iframe/components/IframeNodeView.tsx +0 -92
  172. package/src/extensions/Iframe/components/index.module.scss +0 -40
  173. package/src/extensions/Iframe/embed.ts +0 -487
  174. package/src/extensions/Iframe/index.ts +0 -1
  175. package/src/extensions/Image/Image.ts +0 -303
  176. package/src/extensions/Image/components/ActionImageButton.tsx +0 -186
  177. package/src/extensions/Image/components/ImageCropper.tsx +0 -198
  178. package/src/extensions/Image/components/ImageView.tsx +0 -271
  179. package/src/extensions/Image/index.ts +0 -1
  180. package/src/extensions/Image/store.ts +0 -15
  181. package/src/extensions/ImageGif/ImageGif.ts +0 -176
  182. package/src/extensions/ImageGif/components/ImageGifActionButton.tsx +0 -138
  183. package/src/extensions/ImageGif/components/ImageGifView.tsx +0 -260
  184. package/src/extensions/ImageGif/index.ts +0 -1
  185. package/src/extensions/ImportWord/ImportWord.ts +0 -52
  186. package/src/extensions/ImportWord/components/ImportWordButton.tsx +0 -151
  187. package/src/extensions/ImportWord/index.ts +0 -1
  188. package/src/extensions/Indent/Indent.ts +0 -110
  189. package/src/extensions/Indent/index.ts +0 -1
  190. package/src/extensions/Italic/Italic.ts +0 -29
  191. package/src/extensions/Italic/index.ts +0 -1
  192. package/src/extensions/Katex/Katex.ts +0 -109
  193. package/src/extensions/Katex/components/KatexActiveButton.tsx +0 -117
  194. package/src/extensions/Katex/components/KatexWrapper.tsx +0 -53
  195. package/src/extensions/Katex/index.ts +0 -1
  196. package/src/extensions/LineHeight/LineHeight.ts +0 -76
  197. package/src/extensions/LineHeight/components/LineHeightDropdown.tsx +0 -93
  198. package/src/extensions/LineHeight/index.ts +0 -1
  199. package/src/extensions/Link/Link.ts +0 -92
  200. package/src/extensions/Link/components/LinkEditBlock.tsx +0 -110
  201. package/src/extensions/Link/components/LinkEditPopover.tsx +0 -46
  202. package/src/extensions/Link/components/LinkViewBlock.tsx +0 -54
  203. package/src/extensions/Link/index.ts +0 -1
  204. package/src/extensions/ListItem/ListItem.ts +0 -1
  205. package/src/extensions/ListItem/index.ts +0 -1
  206. package/src/extensions/Mention/Mention.ts +0 -100
  207. package/src/extensions/Mention/components/NodeViewMentionList/NodeViewMentionList.tsx +0 -94
  208. package/src/extensions/Mention/components/NodeViewMentionList/index.module.scss +0 -38
  209. package/src/extensions/Mention/index.ts +0 -1
  210. package/src/extensions/Mermaid/Mermaid.ts +0 -177
  211. package/src/extensions/Mermaid/components/EditMermaidBlock.tsx +0 -155
  212. package/src/extensions/Mermaid/components/MermaidActiveButton.tsx +0 -151
  213. package/src/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.tsx +0 -260
  214. package/src/extensions/Mermaid/index.ts +0 -1
  215. package/src/extensions/MoreMark/MoreMark.ts +0 -102
  216. package/src/extensions/MoreMark/components/ActionMoreButton.tsx +0 -97
  217. package/src/extensions/MoreMark/index.ts +0 -1
  218. package/src/extensions/MultiColumn/Column.ts +0 -36
  219. package/src/extensions/MultiColumn/MultiColumn.ts +0 -111
  220. package/src/extensions/MultiColumn/components/ColumnActionButton.ts +0 -22
  221. package/src/extensions/MultiColumn/index.ts +0 -3
  222. package/src/extensions/OrderedList/OrderedList.ts +0 -28
  223. package/src/extensions/OrderedList/index.ts +0 -1
  224. package/src/extensions/SearchAndReplace/SearchAndReplace.ts +0 -395
  225. package/src/extensions/SearchAndReplace/components/SearchAndReplaceButton.tsx +0 -190
  226. package/src/extensions/SearchAndReplace/index.ts +0 -1
  227. package/src/extensions/Selection/Selection.ts +0 -32
  228. package/src/extensions/Selection/index.ts +0 -1
  229. package/src/extensions/SlashCommand/SlashCommand.ts +0 -255
  230. package/src/extensions/SlashCommand/components/CommandsList.tsx +0 -180
  231. package/src/extensions/SlashCommand/groups.ts +0 -183
  232. package/src/extensions/SlashCommand/index.ts +0 -1
  233. package/src/extensions/SlashCommand/types.ts +0 -24
  234. package/src/extensions/Strike/Strike.ts +0 -26
  235. package/src/extensions/Strike/index.ts +0 -1
  236. package/src/extensions/Subscript/Subscript.ts +0 -88
  237. package/src/extensions/Subscript/index.ts +0 -1
  238. package/src/extensions/Table/Cell.ts +0 -131
  239. package/src/extensions/Table/Header.ts +0 -93
  240. package/src/extensions/Table/Row.ts +0 -8
  241. package/src/extensions/Table/Table.ts +0 -60
  242. package/src/extensions/Table/cell-background.ts +0 -112
  243. package/src/extensions/Table/components/CreateTablePopover.tsx +0 -132
  244. package/src/extensions/Table/components/TableActionButton.tsx +0 -42
  245. package/src/extensions/Table/index.ts +0 -6
  246. package/src/extensions/Table/utils.ts +0 -352
  247. package/src/extensions/TableOfContent/TableOfContent.ts +0 -124
  248. package/src/extensions/TableOfContent/components/NodeViewTableOfContent.tsx +0 -116
  249. package/src/extensions/TableOfContent/components/TableOfContentActionButton.tsx +0 -27
  250. package/src/extensions/TableOfContent/components/index.module.scss +0 -40
  251. package/src/extensions/TableOfContent/index.ts +0 -1
  252. package/src/extensions/TaskList/TaskList.ts +0 -46
  253. package/src/extensions/TaskList/index.ts +0 -1
  254. package/src/extensions/TextAlign/TextAlign.ts +0 -68
  255. package/src/extensions/TextAlign/components/TextAlignMenuButton.tsx +0 -103
  256. package/src/extensions/TextAlign/index.ts +0 -1
  257. package/src/extensions/TextBubble/TextBubble.ts +0 -22
  258. package/src/extensions/TextBubble/components/TextDropdown.tsx +0 -146
  259. package/src/extensions/TextBubble/index.ts +0 -1
  260. package/src/extensions/TextDirection/TextDirection.ts +0 -97
  261. package/src/extensions/TextDirection/components/TextDirectionButton.tsx +0 -103
  262. package/src/extensions/TextDirection/index.ts +0 -1
  263. package/src/extensions/TrailingNode/TrailingNode.ts +0 -71
  264. package/src/extensions/TrailingNode/index.ts +0 -1
  265. package/src/extensions/Twitter/Twitter.ts +0 -161
  266. package/src/extensions/Twitter/components/FormEditLinkTwitter.tsx +0 -68
  267. package/src/extensions/Twitter/components/NodeViewTweet.tsx +0 -30
  268. package/src/extensions/Twitter/components/TwitterActiveButton.tsx +0 -41
  269. package/src/extensions/Twitter/index.ts +0 -1
  270. package/src/extensions/UnderLine/Underline.ts +0 -30
  271. package/src/extensions/UnderLine/index.ts +0 -1
  272. package/src/extensions/Video/Video.ts +0 -204
  273. package/src/extensions/Video/components/ActiveVideoButton.tsx +0 -191
  274. package/src/extensions/Video/index.ts +0 -1
  275. package/src/extensions/Video/store.ts +0 -15
  276. package/src/extensions/index.ts +0 -122
  277. package/src/hooks/useActive.tsx +0 -24
  278. package/src/hooks/useAttributes.tsx +0 -45
  279. package/src/hooks/useCopy.tsx +0 -20
  280. package/src/hooks/useEditorState.tsx +0 -23
  281. package/src/hooks/useExtension.tsx +0 -29
  282. package/src/index.ts +0 -8
  283. package/src/lib/utils.ts +0 -7
  284. package/src/locale-bundle.ts +0 -3
  285. package/src/locales/en.ts +0 -173
  286. package/src/locales/hu.ts +0 -173
  287. package/src/locales/index.tsx +0 -163
  288. package/src/locales/pt-br.ts +0 -173
  289. package/src/locales/vi.ts +0 -173
  290. package/src/locales/zh-cn.ts +0 -173
  291. package/src/plugins/DragHandle/index.ts +0 -375
  292. package/src/plugins/DragHandle/range.ts +0 -114
  293. package/src/plugins/DragHandle/utils.ts +0 -80
  294. package/src/plugins/image-upload.ts +0 -160
  295. package/src/store/ProviderRichText.tsx +0 -53
  296. package/src/store/editableEditor.ts +0 -15
  297. package/src/store/fast-context.tsx +0 -70
  298. package/src/store/store.ts +0 -35
  299. package/src/styles/ProseMirror.scss +0 -176
  300. package/src/styles/columns.scss +0 -23
  301. package/src/styles/editor.scss +0 -411
  302. package/src/styles/global.scss +0 -87
  303. package/src/styles/index.scss +0 -5
  304. package/src/styles/mention.scss +0 -6
  305. package/src/theme/theme.ts +0 -15
  306. package/src/types.ts +0 -271
  307. package/src/utils/_event.ts +0 -55
  308. package/src/utils/color.ts +0 -67
  309. package/src/utils/columns.ts +0 -142
  310. package/src/utils/customEvents/customEvents.ts +0 -18
  311. package/src/utils/customEvents/events.constant.ts +0 -11
  312. package/src/utils/delete-node.ts +0 -46
  313. package/src/utils/dom-dataset.ts +0 -121
  314. package/src/utils/download.ts +0 -17
  315. package/src/utils/dynamicCSS.ts +0 -192
  316. package/src/utils/editor-container-size.ts +0 -28
  317. package/src/utils/file.ts +0 -112
  318. package/src/utils/getRenderContainer.ts +0 -41
  319. package/src/utils/indent.ts +0 -99
  320. package/src/utils/is-mobile.ts +0 -57
  321. package/src/utils/json.ts +0 -18
  322. package/src/utils/line-height.ts +0 -109
  323. package/src/utils/lru-cache.ts +0 -145
  324. package/src/utils/mitt.ts +0 -114
  325. package/src/utils/node.ts +0 -92
  326. package/src/utils/pdf.ts +0 -72
  327. package/src/utils/plateform.ts +0 -49
  328. package/src/utils/shortId.ts +0 -5
  329. package/src/utils/storage.ts +0 -18
  330. package/src/utils/utils.ts +0 -71
  331. package/src/vite-env.d.ts +0 -3
@@ -1,212 +0,0 @@
1
- import {
2
- TextAlignCenterIcon,
3
- TextAlignJustifyIcon,
4
- TextAlignLeftIcon,
5
- TextAlignRightIcon,
6
- } from '@radix-ui/react-icons';
7
- import {
8
- BetweenHorizonalEnd,
9
- BetweenHorizonalStart,
10
- BetweenVerticalEnd,
11
- BetweenVerticalStart,
12
- Bold,
13
- BookMarked,
14
- ChevronDown,
15
- ChevronUp,
16
- ChevronsUpDown,
17
- Clipboard,
18
- Code,
19
- CodeXml,
20
- Columns2,
21
- Columns3,
22
- Columns4,
23
- Copy,
24
- CropIcon,
25
- Eraser,
26
- Eye,
27
- FlipHorizontal,
28
- FlipVertical,
29
- Frame,
30
- GripVertical,
31
- Heading1,
32
- Heading2,
33
- Heading3,
34
- Heading4,
35
- Heading5,
36
- Heading6,
37
- ImageUp,
38
- IndentDecrease,
39
- IndentIncrease,
40
- Italic,
41
- Link,
42
- List,
43
- ListOrdered,
44
- ListTodo,
45
- LoaderCircle,
46
- Maximize,
47
- Minimize,
48
- Minus,
49
- PaintRoller,
50
- PanelLeft,
51
- PanelRight,
52
- Paperclip,
53
- Pencil,
54
- Plus,
55
- Quote,
56
- Redo2,
57
- Replace,
58
- Settings,
59
- Sigma,
60
- SmilePlus,
61
- SmilePlusIcon,
62
- Sparkles,
63
- Strikethrough,
64
- Subscript,
65
- Superscript,
66
- Table,
67
- TableCellsMerge,
68
- TableCellsSplit,
69
- Trash,
70
- Trash2,
71
- Type,
72
- Underline,
73
- Undo2,
74
- Unlink,
75
- Video,
76
- ZoomIn,
77
- ZoomOut,
78
- PencilRuler
79
- } from 'lucide-react';
80
-
81
- import {
82
- AspectRatio,
83
- BlockquoteLeft,
84
- DeleteColumn,
85
- DeleteRow,
86
- FileWordOutline,
87
- FormatLineHeight,
88
- MenuDown,
89
- SizeL,
90
- SizeM,
91
- SizeS,
92
- } from 'reactjs-tiptap-editor-pro/components/icons';
93
- import { ColumnAddLeft } from 'reactjs-tiptap-editor-pro/components/icons/ColumnAddLeft';
94
- import { ColumnAddRight } from 'reactjs-tiptap-editor-pro/components/icons/ColumnAddRight';
95
- import { Direction } from 'reactjs-tiptap-editor-pro/components/icons/Direction';
96
- import { Excalidraw } from 'reactjs-tiptap-editor-pro/components/icons/Excalidraw';
97
- import { ExportPdf } from 'reactjs-tiptap-editor-pro/components/icons/ExportPdf';
98
- import ExportWord from 'reactjs-tiptap-editor-pro/components/icons/ExportWord';
99
- import { GifIcon } from 'reactjs-tiptap-editor-pro/components/icons/GIfIcon';
100
- import { LeftToRight } from 'reactjs-tiptap-editor-pro/components/icons/LeftToRight';
101
- import { Mermaid } from 'reactjs-tiptap-editor-pro/components/icons/Mermaid';
102
- import { RightToLeft } from 'reactjs-tiptap-editor-pro/components/icons/RightToLeft';
103
- import { Twitter } from 'reactjs-tiptap-editor-pro/components/icons/Twitter';
104
-
105
- import ImportWord from './ImportWord';
106
-
107
- export const icons = {
108
- Bold,
109
- LoaderCircle,
110
- Italic,
111
- Underline,
112
- Quote,
113
- TextQuote: BlockquoteLeft,
114
- Strikethrough,
115
- Minus,
116
- Eraser,
117
- PaintRoller,
118
- Redo2,
119
- Undo2,
120
- AlignCenter: TextAlignCenterIcon,
121
- AlignJustify: TextAlignJustifyIcon,
122
- AlignLeft: TextAlignLeftIcon,
123
- AlignRight: TextAlignRightIcon,
124
- ChevronDown,
125
- Subscript,
126
- Superscript,
127
- Code,
128
- Code2: CodeXml,
129
- Type,
130
- IndentIncrease,
131
- IndentDecrease,
132
- List,
133
- ListOrdered,
134
- ListTodo,
135
- Link,
136
- ImageUp,
137
- Video,
138
- Maximize,
139
- Minimize,
140
- Table,
141
- Sparkles,
142
- Pencil,
143
- Unlink,
144
- BetweenHorizonalEnd,
145
- BetweenHorizonalStart,
146
- BetweenVerticalStart,
147
- BetweenVerticalEnd,
148
- TableCellsMerge,
149
- TableCellsSplit,
150
- Trash2,
151
- Trash,
152
- Replace,
153
- ChevronsUpDown,
154
- LineHeight: FormatLineHeight,
155
- Word: FileWordOutline,
156
- Heading1,
157
- Heading2,
158
- Heading3,
159
- Heading4,
160
- Heading5,
161
- Heading6,
162
- Columns2,
163
- Columns3,
164
- Columns4,
165
- Plus,
166
- Grip: GripVertical,
167
- Copy,
168
- Clipboard,
169
- PanelLeft,
170
- PanelRight,
171
- Columns: Columns2,
172
- Iframe: Frame,
173
-
174
- MenuDown,
175
- SizeS,
176
- SizeM,
177
- SizeL,
178
- AspectRatio,
179
-
180
- Emoji: SmilePlus,
181
-
182
- DeleteColumn,
183
- DeleteRow,
184
- SearchAndReplace: Replace,
185
- EmojiIcon: SmilePlusIcon,
186
- KatexIcon: Sigma,
187
- ExportPdf,
188
- ExportWord,
189
- ImportWord,
190
- ColumnAddLeft,
191
- ColumnAddRight,
192
- BookMarked,
193
- Excalidraw,
194
- ZoomIn,
195
- ZoomOut,
196
- Settings,
197
- Eye,
198
-
199
- TextDirection: Direction,
200
- LeftToRight,
201
- RightToLeft,
202
-
203
- Attachment: Paperclip,
204
- GifIcon,
205
- ChevronUp,
206
- Crop: CropIcon,
207
- Mermaid,
208
- Twitter,
209
- FlipX: FlipVertical,
210
- FlipY: FlipHorizontal,
211
- PencilRuler
212
- } as any;
@@ -1,12 +0,0 @@
1
- export * from './AspectRatio';
2
- export * from './Blockquote';
3
- export * from './DeleteColumn';
4
- export * from './DeleteRow';
5
- export * from './FileWordOutline';
6
- export * from './Icon';
7
- export * from './LineHeight';
8
- export * from './MenuDown';
9
- export * from './SizeL';
10
- export * from './SizeM';
11
- export * from './SizeS';
12
- export * from './icons';
@@ -1,9 +0,0 @@
1
- export * from './ActionButton';
2
- export * from './ActionMenuButton';
3
- export * from './BubbleMenu';
4
- export * from './ColorPicker';
5
- export * from './RichTextEditor';
6
- export * from './Toolbar';
7
- export * from './icons';
8
- export * from './menus';
9
- export * from './ui';
@@ -1,395 +0,0 @@
1
- import { deleteSelection } from '@tiptap/pm/commands';
2
- import type { Editor } from '@tiptap/react';
3
-
4
- import { ActionButton } from 'reactjs-tiptap-editor-pro/components';
5
- import { BUBBLE_TEXT_LIST, IMAGE_SIZE, VIDEO_SIZE } from 'reactjs-tiptap-editor-pro/constants';
6
- import { localeActions } from 'reactjs-tiptap-editor-pro/locales';
7
- import type { ButtonViewParams, ButtonViewReturn, ExtensionNameKeys } from 'reactjs-tiptap-editor-pro/types';
8
-
9
- /** Represents the size types for bubble images or videos */
10
- type BubbleImageOrVideoSizeType = 'size-small' | 'size-medium' | 'size-large';
11
- type ImageAlignments = 'left' | 'center' | 'right';
12
-
13
- /** Represents the various types for bubble images */
14
- type BubbleImageType =
15
- | `image-${BubbleImageOrVideoSizeType}`
16
- | `video-${BubbleImageOrVideoSizeType}`
17
- | 'image'
18
- | 'image-aspect-ratio'
19
- | 'remove';
20
-
21
- /** Represents the types for bubble videos */
22
- type BubbleVideoType = 'video' | 'remove';
23
-
24
- /** Represents the overall types for bubbles */
25
- type BubbleAllType =
26
- | BubbleImageType
27
- | BubbleVideoType
28
- | ExtensionNameKeys
29
- | 'divider'
30
- | (string & {});
31
-
32
- /** Represents the key types for node types */
33
- export type NodeTypeKey = 'image' | 'text' | 'video';
34
-
35
- /** Represents the menu of bubble types for each node type */
36
- export type BubbleTypeMenu = Partial<Record<NodeTypeKey, BubbleMenuItem[]>>;
37
-
38
- /** Represents the menu of overall bubble types for each node type */
39
- export type NodeTypeMenu = Partial<Record<NodeTypeKey, BubbleAllType[]>>;
40
-
41
- /**
42
- * Represents the structure of a bubble menu item.
43
- */
44
- export interface BubbleMenuItem extends ButtonViewReturn {
45
- /** The type of the bubble item */
46
- type: BubbleAllType
47
- }
48
-
49
- /**
50
- * Represents a function to generate a bubble menu
51
- */
52
- /**
53
- * Generates a bubble menu based on the provided options.
54
- * @param {ButtonViewParams<T>} options - The options for generating the bubble menu.
55
- * @returns {BubbleTypeMenu} The generated bubble menu.
56
- */
57
- type BubbleView<T = any> = (options: ButtonViewParams<T>) => BubbleTypeMenu;
58
-
59
- /**
60
- * Represents the options for configuring bubbles.
61
- * @interface BubbleOptions
62
- * @template T
63
- */
64
- export interface BubbleOptions<T> {
65
- /** The menu of bubble types for each node type. */
66
- list: NodeTypeMenu
67
- /** The default list of bubble types. */
68
- defaultBubbleList: any
69
- /** The function to generate a bubble menu. */
70
- button: BubbleView<T>
71
- }
72
-
73
- function imageSizeMenus(editor: Editor): BubbleMenuItem[] {
74
- const types: BubbleImageOrVideoSizeType[] = ['size-small', 'size-medium', 'size-large'];
75
- const icons: NonNullable<ButtonViewReturn['componentProps']['icon']>[] = [
76
- 'SizeS',
77
- 'SizeM',
78
- 'SizeL',
79
- ];
80
-
81
- return types.map((size, i) => ({
82
- type: `image-${size}`,
83
- component: ActionButton,
84
- componentProps: {
85
- tooltip: localeActions.t(`editor.${size.replace('-', '.')}.tooltip` as any),
86
- icon: icons[i],
87
- action: () => editor.commands.updateImage({ width: IMAGE_SIZE[size] }),
88
- isActive: () => editor.isActive('image', { width: IMAGE_SIZE[size] }),
89
- },
90
- }));
91
- }
92
-
93
- function imageGifSizeMenus(editor: Editor): BubbleMenuItem[] {
94
- const types: BubbleImageOrVideoSizeType[] = ['size-small', 'size-medium', 'size-large'];
95
- const icons: NonNullable<ButtonViewReturn['componentProps']['icon']>[] = [
96
- 'SizeS',
97
- 'SizeM',
98
- 'SizeL',
99
- ];
100
-
101
- return types.map((size, i) => ({
102
- type: `image-${size}`,
103
- component: ActionButton,
104
- componentProps: {
105
- tooltip: localeActions.t(`editor.${size.replace('-', '.')}.tooltip` as any),
106
- icon: icons[i],
107
- action: () => editor.commands.updateImageGif({ width: IMAGE_SIZE[size] }),
108
- isActive: () => editor.isActive('image', { width: IMAGE_SIZE[size] }),
109
- },
110
- }));
111
- }
112
-
113
- function imageAlignMenus(editor: Editor): BubbleMenuItem[] {
114
- const types: ImageAlignments[] = ['left', 'center', 'right'];
115
- const iconMap: any = {
116
- left: 'AlignLeft',
117
- center: 'AlignCenter',
118
- right: 'AlignRight',
119
- };
120
- return types.map(k => ({
121
- type: `image-${k}`,
122
- component: ActionButton,
123
- componentProps: {
124
- tooltip: localeActions.t(`editor.textalign.${k}.tooltip`),
125
- icon: iconMap[k],
126
- action: () => editor.commands?.setAlignImage?.(k),
127
- isActive: () => editor.isActive({ align: k }) || false,
128
- disabled: false,
129
- },
130
- }));
131
- }
132
-
133
- function imageGifAlignMenus(editor: Editor): BubbleMenuItem[] {
134
- const types: ImageAlignments[] = ['left', 'center', 'right'];
135
- const iconMap: any = {
136
- left: 'AlignLeft',
137
- center: 'AlignCenter',
138
- right: 'AlignRight',
139
- };
140
- return types.map(k => ({
141
- type: `image-${k}`,
142
- component: ActionButton,
143
- componentProps: {
144
- tooltip: localeActions.t(`editor.textalign.${k}.tooltip`),
145
- icon: iconMap[k],
146
- action: () => editor.commands?.setAlignImageGif?.(k),
147
- isActive: () => editor.isActive({ align: k }) || false,
148
- disabled: false,
149
- },
150
- }));
151
- }
152
-
153
- function imageMermaidAlignMenus(editor: Editor): BubbleMenuItem[] {
154
- const types: ImageAlignments[] = ['left', 'center', 'right'];
155
- const iconMap: any = {
156
- left: 'AlignLeft',
157
- center: 'AlignCenter',
158
- right: 'AlignRight',
159
- };
160
- return types.map(k => ({
161
- type: `image-${k}`,
162
- component: ActionButton,
163
- componentProps: {
164
- tooltip: localeActions.t(`editor.textalign.${k}.tooltip`),
165
- icon: iconMap[k],
166
- action: () => editor.commands?.setAlignImageMermaid?.(k),
167
- isActive: () => editor.isActive({ align: k }) || false,
168
- disabled: false,
169
- },
170
- }));
171
- }
172
-
173
- function imageDrawerAlignMenus(editor: Editor): BubbleMenuItem[] {
174
- const types: ImageAlignments[] = ['left', 'center', 'right'];
175
- const iconMap: any = {
176
- left: 'AlignLeft',
177
- center: 'AlignCenter',
178
- right: 'AlignRight',
179
- };
180
- return types.map(k => ({
181
- type: `image-${k}`,
182
- component: ActionButton,
183
- componentProps: {
184
- tooltip: localeActions.t(`editor.textalign.${k}.tooltip`),
185
- icon: iconMap[k],
186
- action: () => editor.commands?.setAlignImageDrawer?.(k),
187
- isActive: () => editor.isActive({ align: k }) || false,
188
- disabled: false,
189
- },
190
- }));
191
- }
192
-
193
- function videoSizeMenus(editor: Editor): BubbleMenuItem[] {
194
- const types: BubbleImageOrVideoSizeType[] = ['size-small', 'size-medium', 'size-large'];
195
- const icons: NonNullable<ButtonViewReturn['componentProps']['icon']>[] = [
196
- 'SizeS',
197
- 'SizeM',
198
- 'SizeL',
199
- ];
200
-
201
- return types.map((size, i) => ({
202
- type: `video-${size}`,
203
- component: ActionButton,
204
- componentProps: {
205
- tooltip: localeActions.t(`editor.${size.replace('-', '.')}.tooltip` as any),
206
- icon: icons[i],
207
- action: () => editor.commands.updateVideo({ width: VIDEO_SIZE[size] }),
208
- isActive: () => editor.isActive('video', { width: VIDEO_SIZE[size] }),
209
- },
210
- }));
211
- }
212
- export function getBubbleImage(editor: Editor): BubbleMenuItem[] {
213
- return [
214
- {
215
- type: 'flipX',
216
- component: ActionButton,
217
- componentProps: {
218
- editor,
219
- tooltip: localeActions.t('editor.tooltip.flipX'),
220
- icon: 'FlipX',
221
- action: () => {
222
- const image = editor.getAttributes('image');
223
- const { flipX } = image as any;
224
- editor
225
- .chain()
226
- .focus(undefined, { scrollIntoView: false })
227
- .updateImage({
228
- flipX: !flipX,
229
- })
230
- .run();
231
- },
232
- },
233
- },
234
- {
235
- type: 'flipY',
236
- component: ActionButton,
237
- componentProps: {
238
- editor,
239
- tooltip: localeActions.t('editor.tooltip.flipY'),
240
- icon: 'FlipY',
241
- action: () => {
242
- const image = editor.getAttributes('image');
243
- const { flipY } = image as any;
244
- editor
245
- .chain()
246
- .focus(undefined, { scrollIntoView: false })
247
- .updateImage({
248
- flipY: !flipY,
249
- })
250
- .run();
251
- },
252
- },
253
- },
254
- ...imageSizeMenus(editor),
255
- ...imageAlignMenus(editor),
256
- {
257
- type: 'remove',
258
- component: ActionButton,
259
- componentProps: {
260
- editor,
261
- tooltip: localeActions.t('editor.remove'),
262
- icon: 'Trash2',
263
- action: () => {
264
- const { state, dispatch } = editor.view;
265
- deleteSelection(state, dispatch);
266
- },
267
- },
268
- },
269
- ];
270
- }
271
-
272
- export function getBubbleImageGif(editor: Editor): BubbleMenuItem[] {
273
- return [
274
- ...imageGifSizeMenus(editor),
275
- ...imageGifAlignMenus(editor),
276
- {
277
- type: 'remove',
278
- component: ActionButton,
279
- componentProps: {
280
- editor,
281
- tooltip: localeActions.t('editor.remove'),
282
- icon: 'Trash2',
283
- action: () => {
284
- const { state, dispatch } = editor.view;
285
- deleteSelection(state, dispatch);
286
- },
287
- },
288
- },
289
- ];
290
- }
291
-
292
- export function getBubbleMermaid(editor: Editor): BubbleMenuItem[] {
293
- return [
294
- ...imageMermaidAlignMenus(editor),
295
- {
296
- type: 'edit',
297
- component: ActionButton,
298
- componentProps: {
299
- editor,
300
- tooltip: localeActions.t('editor.edit'),
301
- icon: 'Pencil',
302
- action: () => {
303
- return true;
304
- },
305
- },
306
- },
307
- {
308
- type: 'remove',
309
- component: ActionButton,
310
- componentProps: {
311
- editor,
312
- tooltip: localeActions.t('editor.remove'),
313
- icon: 'Trash2',
314
- action: () => {
315
- const { state, dispatch } = editor.view;
316
- deleteSelection(state, dispatch);
317
- },
318
- },
319
- },
320
- ];
321
- }
322
-
323
- export function getBubbleDrawer(editor: Editor): BubbleMenuItem[] {
324
- return [
325
- ...imageDrawerAlignMenus(editor),
326
- {
327
- type: 'edit',
328
- component: ActionButton,
329
- componentProps: {
330
- editor,
331
- tooltip: localeActions.t('editor.edit'),
332
- icon: 'Pencil',
333
- action: () => {
334
- console.log('AAA');
335
-
336
- return true;
337
- },
338
- },
339
- },
340
- {
341
- type: 'remove',
342
- component: ActionButton,
343
- componentProps: {
344
- editor,
345
- tooltip: localeActions.t('editor.remove'),
346
- icon: 'Trash2',
347
- action: () => {
348
- const { state, dispatch } = editor.view;
349
- deleteSelection(state, dispatch);
350
- },
351
- },
352
- },
353
- ];
354
- }
355
-
356
- export function getBubbleVideo(editor: Editor): BubbleMenuItem[] {
357
- return [
358
- ...videoSizeMenus(editor),
359
- {
360
- type: 'remove',
361
- component: ActionButton,
362
- componentProps: {
363
- editor,
364
- tooltip: localeActions.t('editor.remove'),
365
- icon: 'Trash2',
366
- action: () => {
367
- const { state, dispatch } = editor.view;
368
- deleteSelection(state, dispatch);
369
- },
370
- },
371
- },
372
- ];
373
- }
374
-
375
- /**
376
- * Bubble menu text list
377
- */
378
- export function getBubbleText(editor: Editor, t: any, list: string[] = BUBBLE_TEXT_LIST) {
379
- return list.reduce((acc, type) => {
380
- if (type === 'divider' && acc.length > 0) {
381
- return [...acc, {
382
- type: 'divider',
383
- component: undefined,
384
- componentProps: {},
385
- }];
386
- }
387
-
388
- const ext = editor.extensionManager.extensions.find(ext => ext.name === type);
389
- if (ext) {
390
- return [...acc, ext.configure().options.button({ editor, t, extension: ext })];
391
- }
392
-
393
- return acc;
394
- }, [] as BubbleMenuItem[]);
395
- }
@@ -1,15 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
-
3
- function BubbleMenuContent ({ children, vertical }: PropsWithChildren<{ vertical?:boolean }>) {
4
- return (
5
- <div className="pointer-events-auto w-auto select-none rounded-sm !border border-neutral-200 bg-background px-3 py-2 shadow-sm transition-all dark:border-neutral-800">
6
- <div
7
- className={`relative flex h-[26px] flex-nowrap items-center justify-start gap-[4px] whitespace-nowrap ${vertical ? 'h-max flex-col' : ''}`}
8
- >
9
- {children}
10
- </div>
11
- </div>
12
- );
13
- }
14
-
15
- export default BubbleMenuContent;