reactjs-tiptap-editor-pro 0.2.28 → 0.2.30

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 (333) hide show
  1. package/package.json +4 -60
  2. package/src/components/ActionButton.tsx +103 -0
  3. package/src/components/ActionMenuButton.tsx +76 -0
  4. package/src/components/BubbleMenu.tsx +93 -0
  5. package/src/components/CharactorCount.tsx +50 -0
  6. package/src/components/ColorPicker.tsx +272 -0
  7. package/src/components/RichTextEditor.tsx +212 -0
  8. package/src/components/SizeSetter/SizeSetter.tsx +102 -0
  9. package/src/components/Toolbar.tsx +108 -0
  10. package/src/components/icons/Activity.tsx +19 -0
  11. package/src/components/icons/Animas.tsx +24 -0
  12. package/src/components/icons/AspectRatio.tsx +13 -0
  13. package/src/components/icons/Blockquote.tsx +17 -0
  14. package/src/components/icons/ColumnAddLeft.tsx +7 -0
  15. package/src/components/icons/ColumnAddRight.tsx +7 -0
  16. package/src/components/icons/DeleteColumn.tsx +26 -0
  17. package/src/components/icons/DeleteRow.tsx +26 -0
  18. package/src/components/icons/Direction.tsx +7 -0
  19. package/src/components/icons/Excalidraw.tsx +7 -0
  20. package/src/components/icons/ExportPdf.tsx +8 -0
  21. package/src/components/icons/ExportWord.tsx +24 -0
  22. package/src/components/icons/FileWordOutline.tsx +13 -0
  23. package/src/components/icons/Flag.tsx +19 -0
  24. package/src/components/icons/Food.tsx +20 -0
  25. package/src/components/icons/GIfIcon.tsx +10 -0
  26. package/src/components/icons/Icon.tsx +30 -0
  27. package/src/components/icons/ImportWord.tsx +23 -0
  28. package/src/components/icons/LeftToRight.tsx +7 -0
  29. package/src/components/icons/LineHeight.tsx +13 -0
  30. package/src/components/icons/MenuDown.tsx +24 -0
  31. package/src/components/icons/Mermaid.tsx +13 -0
  32. package/src/components/icons/NoFill.tsx +7 -0
  33. package/src/components/icons/Object.tsx +24 -0
  34. package/src/components/icons/RightToLeft.tsx +7 -0
  35. package/src/components/icons/SizeL.tsx +9 -0
  36. package/src/components/icons/SizeM.tsx +13 -0
  37. package/src/components/icons/SizeS.tsx +13 -0
  38. package/src/components/icons/Symbol.tsx +19 -0
  39. package/src/components/icons/Travel.tsx +24 -0
  40. package/src/components/icons/Twitter.tsx +7 -0
  41. package/src/components/icons/icons.ts +212 -0
  42. package/src/components/icons/index.ts +12 -0
  43. package/src/components/index.ts +9 -0
  44. package/src/components/menus/bubble.ts +395 -0
  45. package/src/components/menus/components/BubbleMenuContent.tsx +15 -0
  46. package/src/components/menus/components/BubbleMenuDrawer.tsx +128 -0
  47. package/src/components/menus/components/BubbleMenuExcalidraw.tsx +91 -0
  48. package/src/components/menus/components/BubbleMenuIframe.tsx +143 -0
  49. package/src/components/menus/components/BubbleMenuKatex.tsx +136 -0
  50. package/src/components/menus/components/BubbleMenuLink.tsx +99 -0
  51. package/src/components/menus/components/BubbleMenuMedia.tsx +235 -0
  52. package/src/components/menus/components/BubbleMenuMermaid.tsx +128 -0
  53. package/src/components/menus/components/BubbleMenuText.tsx +102 -0
  54. package/src/components/menus/components/BubbleMenuTwitter.tsx +91 -0
  55. package/src/components/menus/components/ColumnsBubbleMenu.tsx +59 -0
  56. package/src/components/menus/components/ContentMenu.tsx +396 -0
  57. package/src/components/menus/components/TableBubbleMenu.tsx +362 -0
  58. package/src/components/menus/index.ts +7 -0
  59. package/src/components/ui/button.tsx +56 -0
  60. package/src/components/ui/checkbox.tsx +30 -0
  61. package/src/components/ui/dialog.tsx +128 -0
  62. package/src/components/ui/dropdown-menu.tsx +203 -0
  63. package/src/components/ui/emoji-picker.tsx +166 -0
  64. package/src/components/ui/index.ts +14 -0
  65. package/src/components/ui/input.tsx +25 -0
  66. package/src/components/ui/label.tsx +26 -0
  67. package/src/components/ui/popover.tsx +31 -0
  68. package/src/components/ui/select.tsx +162 -0
  69. package/src/components/ui/separator.tsx +31 -0
  70. package/src/components/ui/switch.tsx +29 -0
  71. package/src/components/ui/tabs.tsx +55 -0
  72. package/src/components/ui/textarea.tsx +24 -0
  73. package/src/components/ui/toast.tsx +129 -0
  74. package/src/components/ui/toaster.tsx +44 -0
  75. package/src/components/ui/toggle.tsx +45 -0
  76. package/src/components/ui/tooltip.tsx +30 -0
  77. package/src/components/ui/use-toast.ts +197 -0
  78. package/src/constants/index.ts +223 -0
  79. package/src/constants/resetCSS.ts +139 -0
  80. package/src/extension-bundle.ts +2 -0
  81. package/src/extensions/Attachment/Attachment.ts +144 -0
  82. package/src/extensions/Attachment/components/NodeViewAttachment/FileIcon.tsx +69 -0
  83. package/src/extensions/Attachment/components/NodeViewAttachment/FileIconString.ts +28 -0
  84. package/src/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.tsx +155 -0
  85. package/src/extensions/Attachment/components/NodeViewAttachment/index.module.scss +23 -0
  86. package/src/extensions/Attachment/index.ts +1 -0
  87. package/src/extensions/BaseKit.ts +253 -0
  88. package/src/extensions/Blockquote/Blockquote.ts +31 -0
  89. package/src/extensions/Blockquote/index.ts +1 -0
  90. package/src/extensions/Bold/Bold.ts +26 -0
  91. package/src/extensions/Bold/index.ts +1 -0
  92. package/src/extensions/BulletList/BulletList.ts +28 -0
  93. package/src/extensions/BulletList/index.ts +1 -0
  94. package/src/extensions/Clear/Clear.ts +24 -0
  95. package/src/extensions/Clear/index.ts +1 -0
  96. package/src/extensions/Code/Code.ts +26 -0
  97. package/src/extensions/Code/index.ts +1 -0
  98. package/src/extensions/CodeBlock/CodeBlock.ts +54 -0
  99. package/src/extensions/CodeBlock/components/CodeBlockActiveButton.tsx +66 -0
  100. package/src/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.tsx +89 -0
  101. package/src/extensions/CodeBlock/components/NodeViewCodeBlock/index.module.scss +81 -0
  102. package/src/extensions/CodeBlock/highlighter.ts +132 -0
  103. package/src/extensions/CodeBlock/index.ts +1 -0
  104. package/src/extensions/CodeBlock/shiki-plugin.ts +213 -0
  105. package/src/extensions/Color/Color.ts +52 -0
  106. package/src/extensions/Color/components/ColorActionButton.tsx +104 -0
  107. package/src/extensions/Color/index.ts +1 -0
  108. package/src/extensions/Document/Document.ts +8 -0
  109. package/src/extensions/Document/index.ts +1 -0
  110. package/src/extensions/Drawer/Drawer.ts +177 -0
  111. package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.module.scss +85 -0
  112. package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.tsx +598 -0
  113. package/src/extensions/Drawer/components/ControlDrawer/icon.tsx +500 -0
  114. package/src/extensions/Drawer/components/DrawerActiveButton.tsx +239 -0
  115. package/src/extensions/Drawer/components/EditDrawerBlock.tsx +238 -0
  116. package/src/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.tsx +260 -0
  117. package/src/extensions/Drawer/index.ts +1 -0
  118. package/src/extensions/Emoji/Emoji.ts +146 -0
  119. package/src/extensions/Emoji/components/EmojiList/EmojiList.tsx +103 -0
  120. package/src/extensions/Emoji/components/EmojiList/emojis.ts +1858 -0
  121. package/src/extensions/Emoji/components/EmojiPicker/EmojiPicker.tsx +61 -0
  122. package/src/extensions/Emoji/index.ts +1 -0
  123. package/src/extensions/Excalidraw/Excalidraw.ts +123 -0
  124. package/src/extensions/Excalidraw/components/ExcalidrawActiveButton.tsx +138 -0
  125. package/src/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.tsx +178 -0
  126. package/src/extensions/Excalidraw/components/NodeViewExcalidraw/index.module.scss +43 -0
  127. package/src/extensions/Excalidraw/index.ts +1 -0
  128. package/src/extensions/ExportPdf/ExportPdf.ts +25 -0
  129. package/src/extensions/ExportPdf/index.ts +1 -0
  130. package/src/extensions/ExportWord/ExportWord.ts +87 -0
  131. package/src/extensions/ExportWord/index.ts +1 -0
  132. package/src/extensions/FontFamily/FontFamily.ts +64 -0
  133. package/src/extensions/FontFamily/components/FontFamilyButton.tsx +97 -0
  134. package/src/extensions/FontFamily/index.ts +1 -0
  135. package/src/extensions/FontSize/FontSize.ts +119 -0
  136. package/src/extensions/FontSize/components/FontSizeMenuButton.tsx +84 -0
  137. package/src/extensions/FontSize/index.ts +1 -0
  138. package/src/extensions/FormatPainter/FormatPainter.ts +121 -0
  139. package/src/extensions/FormatPainter/index.ts +1 -0
  140. package/src/extensions/Heading/Heading.ts +57 -0
  141. package/src/extensions/Heading/components/HeadingButton.tsx +96 -0
  142. package/src/extensions/Heading/index.ts +1 -0
  143. package/src/extensions/Highlight/Highlight.ts +36 -0
  144. package/src/extensions/Highlight/components/HighlightActionButton.tsx +108 -0
  145. package/src/extensions/Highlight/index.ts +1 -0
  146. package/src/extensions/History/History.ts +39 -0
  147. package/src/extensions/History/components/HistoryActionButton.tsx +74 -0
  148. package/src/extensions/History/index.ts +1 -0
  149. package/src/extensions/HorizontalRule/HorizontalRule.ts +42 -0
  150. package/src/extensions/HorizontalRule/index.ts +1 -0
  151. package/src/extensions/Iframe/Iframe.ts +140 -0
  152. package/src/extensions/Iframe/components/IframeNodeView.tsx +92 -0
  153. package/src/extensions/Iframe/components/index.module.scss +40 -0
  154. package/src/extensions/Iframe/embed.ts +487 -0
  155. package/src/extensions/Iframe/index.ts +1 -0
  156. package/src/extensions/Image/Image.ts +303 -0
  157. package/src/extensions/Image/components/ActionImageButton.tsx +186 -0
  158. package/src/extensions/Image/components/ImageCropper.tsx +198 -0
  159. package/src/extensions/Image/components/ImageView.tsx +271 -0
  160. package/src/extensions/Image/index.ts +1 -0
  161. package/src/extensions/Image/store.ts +15 -0
  162. package/src/extensions/ImageGif/ImageGif.ts +176 -0
  163. package/src/extensions/ImageGif/components/ImageGifActionButton.tsx +138 -0
  164. package/src/extensions/ImageGif/components/ImageGifView.tsx +260 -0
  165. package/src/extensions/ImageGif/index.ts +1 -0
  166. package/src/extensions/ImportWord/ImportWord.ts +52 -0
  167. package/src/extensions/ImportWord/components/ImportWordButton.tsx +151 -0
  168. package/src/extensions/ImportWord/index.ts +1 -0
  169. package/src/extensions/Indent/Indent.ts +110 -0
  170. package/src/extensions/Indent/index.ts +1 -0
  171. package/src/extensions/Italic/Italic.ts +29 -0
  172. package/src/extensions/Italic/index.ts +1 -0
  173. package/src/extensions/Katex/Katex.ts +109 -0
  174. package/src/extensions/Katex/components/KatexActiveButton.tsx +117 -0
  175. package/src/extensions/Katex/components/KatexWrapper.tsx +53 -0
  176. package/src/extensions/Katex/index.ts +1 -0
  177. package/src/extensions/LineHeight/LineHeight.ts +76 -0
  178. package/src/extensions/LineHeight/components/LineHeightDropdown.tsx +93 -0
  179. package/src/extensions/LineHeight/index.ts +1 -0
  180. package/src/extensions/Link/Link.ts +92 -0
  181. package/src/extensions/Link/components/LinkEditBlock.tsx +110 -0
  182. package/src/extensions/Link/components/LinkEditPopover.tsx +46 -0
  183. package/src/extensions/Link/components/LinkViewBlock.tsx +54 -0
  184. package/src/extensions/Link/index.ts +1 -0
  185. package/src/extensions/ListItem/ListItem.ts +1 -0
  186. package/src/extensions/ListItem/index.ts +1 -0
  187. package/src/extensions/Mention/Mention.ts +100 -0
  188. package/src/extensions/Mention/components/NodeViewMentionList/NodeViewMentionList.tsx +94 -0
  189. package/src/extensions/Mention/components/NodeViewMentionList/index.module.scss +38 -0
  190. package/src/extensions/Mention/index.ts +1 -0
  191. package/src/extensions/Mermaid/Mermaid.ts +177 -0
  192. package/src/extensions/Mermaid/components/EditMermaidBlock.tsx +155 -0
  193. package/src/extensions/Mermaid/components/MermaidActiveButton.tsx +151 -0
  194. package/src/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.tsx +260 -0
  195. package/src/extensions/Mermaid/index.ts +1 -0
  196. package/src/extensions/MoreMark/MoreMark.ts +102 -0
  197. package/src/extensions/MoreMark/components/ActionMoreButton.tsx +97 -0
  198. package/src/extensions/MoreMark/index.ts +1 -0
  199. package/src/extensions/MultiColumn/Column.ts +36 -0
  200. package/src/extensions/MultiColumn/MultiColumn.ts +111 -0
  201. package/src/extensions/MultiColumn/components/ColumnActionButton.ts +22 -0
  202. package/src/extensions/MultiColumn/index.ts +3 -0
  203. package/src/extensions/OrderedList/OrderedList.ts +28 -0
  204. package/src/extensions/OrderedList/index.ts +1 -0
  205. package/src/extensions/SearchAndReplace/SearchAndReplace.ts +395 -0
  206. package/src/extensions/SearchAndReplace/components/SearchAndReplaceButton.tsx +190 -0
  207. package/src/extensions/SearchAndReplace/index.ts +1 -0
  208. package/src/extensions/Selection/Selection.ts +32 -0
  209. package/src/extensions/Selection/index.ts +1 -0
  210. package/src/extensions/SlashCommand/SlashCommand.ts +255 -0
  211. package/src/extensions/SlashCommand/components/CommandsList.tsx +180 -0
  212. package/src/extensions/SlashCommand/groups.ts +183 -0
  213. package/src/extensions/SlashCommand/index.ts +1 -0
  214. package/src/extensions/SlashCommand/types.ts +24 -0
  215. package/src/extensions/Strike/Strike.ts +26 -0
  216. package/src/extensions/Strike/index.ts +1 -0
  217. package/src/extensions/Subscript/Subscript.ts +88 -0
  218. package/src/extensions/Subscript/index.ts +1 -0
  219. package/src/extensions/Table/Cell.ts +131 -0
  220. package/src/extensions/Table/Header.ts +93 -0
  221. package/src/extensions/Table/Row.ts +8 -0
  222. package/src/extensions/Table/Table.ts +60 -0
  223. package/src/extensions/Table/cell-background.ts +112 -0
  224. package/src/extensions/Table/components/CreateTablePopover.tsx +132 -0
  225. package/src/extensions/Table/components/TableActionButton.tsx +42 -0
  226. package/src/extensions/Table/index.ts +6 -0
  227. package/src/extensions/Table/utils.ts +352 -0
  228. package/src/extensions/TableOfContent/TableOfContent.ts +124 -0
  229. package/src/extensions/TableOfContent/components/NodeViewTableOfContent.tsx +116 -0
  230. package/src/extensions/TableOfContent/components/TableOfContentActionButton.tsx +27 -0
  231. package/src/extensions/TableOfContent/components/index.module.scss +40 -0
  232. package/src/extensions/TableOfContent/index.ts +1 -0
  233. package/src/extensions/TaskList/TaskList.ts +46 -0
  234. package/src/extensions/TaskList/index.ts +1 -0
  235. package/src/extensions/TextAlign/TextAlign.ts +68 -0
  236. package/src/extensions/TextAlign/components/TextAlignMenuButton.tsx +103 -0
  237. package/src/extensions/TextAlign/index.ts +1 -0
  238. package/src/extensions/TextBubble/TextBubble.ts +22 -0
  239. package/src/extensions/TextBubble/components/TextDropdown.tsx +146 -0
  240. package/src/extensions/TextBubble/index.ts +1 -0
  241. package/src/extensions/TextDirection/TextDirection.ts +97 -0
  242. package/src/extensions/TextDirection/components/TextDirectionButton.tsx +103 -0
  243. package/src/extensions/TextDirection/index.ts +1 -0
  244. package/src/extensions/TrailingNode/TrailingNode.ts +71 -0
  245. package/src/extensions/TrailingNode/index.ts +1 -0
  246. package/src/extensions/Twitter/Twitter.ts +161 -0
  247. package/src/extensions/Twitter/components/FormEditLinkTwitter.tsx +68 -0
  248. package/src/extensions/Twitter/components/NodeViewTweet.tsx +30 -0
  249. package/src/extensions/Twitter/components/TwitterActiveButton.tsx +41 -0
  250. package/src/extensions/Twitter/index.ts +1 -0
  251. package/src/extensions/UnderLine/Underline.ts +30 -0
  252. package/src/extensions/UnderLine/index.ts +1 -0
  253. package/src/extensions/Video/Video.ts +204 -0
  254. package/src/extensions/Video/components/ActiveVideoButton.tsx +191 -0
  255. package/src/extensions/Video/index.ts +1 -0
  256. package/src/extensions/Video/store.ts +15 -0
  257. package/src/extensions/index.ts +122 -0
  258. package/src/hooks/useActive.tsx +24 -0
  259. package/src/hooks/useAttributes.tsx +45 -0
  260. package/src/hooks/useCopy.tsx +20 -0
  261. package/src/hooks/useEditorState.tsx +23 -0
  262. package/src/hooks/useExtension.tsx +29 -0
  263. package/src/index.ts +8 -0
  264. package/src/lib/utils.ts +7 -0
  265. package/src/locale-bundle.ts +3 -0
  266. package/src/locales/en.ts +173 -0
  267. package/src/locales/hu.ts +173 -0
  268. package/src/locales/index.tsx +163 -0
  269. package/src/locales/pt-br.ts +173 -0
  270. package/src/locales/vi.ts +173 -0
  271. package/src/locales/zh-cn.ts +173 -0
  272. package/src/plugins/DragHandle/index.ts +375 -0
  273. package/src/plugins/DragHandle/range.ts +114 -0
  274. package/src/plugins/DragHandle/utils.ts +80 -0
  275. package/src/plugins/image-upload.ts +160 -0
  276. package/src/store/ProviderRichText.tsx +53 -0
  277. package/src/store/editableEditor.ts +15 -0
  278. package/src/store/fast-context.tsx +70 -0
  279. package/src/store/store.ts +35 -0
  280. package/src/styles/ProseMirror.scss +176 -0
  281. package/src/styles/columns.scss +23 -0
  282. package/src/styles/editor.scss +411 -0
  283. package/src/styles/global.scss +87 -0
  284. package/src/styles/index.scss +5 -0
  285. package/src/styles/mention.scss +6 -0
  286. package/src/theme/theme.ts +15 -0
  287. package/src/types.ts +271 -0
  288. package/src/utils/_event.ts +55 -0
  289. package/src/utils/color.ts +67 -0
  290. package/src/utils/columns.ts +142 -0
  291. package/src/utils/customEvents/customEvents.ts +18 -0
  292. package/src/utils/customEvents/events.constant.ts +11 -0
  293. package/src/utils/delete-node.ts +46 -0
  294. package/src/utils/dom-dataset.ts +121 -0
  295. package/src/utils/download.ts +17 -0
  296. package/src/utils/dynamicCSS.ts +192 -0
  297. package/src/utils/editor-container-size.ts +28 -0
  298. package/src/utils/file.ts +112 -0
  299. package/src/utils/getRenderContainer.ts +41 -0
  300. package/src/utils/indent.ts +99 -0
  301. package/src/utils/is-mobile.ts +57 -0
  302. package/src/utils/json.ts +18 -0
  303. package/src/utils/line-height.ts +109 -0
  304. package/src/utils/lru-cache.ts +145 -0
  305. package/src/utils/mitt.ts +114 -0
  306. package/src/utils/node.ts +92 -0
  307. package/src/utils/pdf.ts +72 -0
  308. package/src/utils/plateform.ts +49 -0
  309. package/src/utils/shortId.ts +5 -0
  310. package/src/utils/storage.ts +18 -0
  311. package/src/utils/utils.ts +71 -0
  312. package/src/vite-env.d.ts +3 -0
  313. package/lib/RichTextEditor-BC85Dn21.js +0 -8826
  314. package/lib/RichTextEditor-Cxm0yJdr.cjs +0 -141
  315. package/lib/extension-bundle.cjs +0 -33
  316. package/lib/extension-bundle.d.cts +0 -947
  317. package/lib/extension-bundle.d.ts +0 -947
  318. package/lib/extension-bundle.js +0 -5755
  319. package/lib/index-DV-nXpU1.cjs +0 -1
  320. package/lib/index-M6H3FoBi.js +0 -1147
  321. package/lib/index.cjs +0 -1
  322. package/lib/index.d.cts +0 -511
  323. package/lib/index.d.ts +0 -511
  324. package/lib/index.js +0 -16
  325. package/lib/locale-bundle.cjs +0 -1
  326. package/lib/locale-bundle.d.cts +0 -1140
  327. package/lib/locale-bundle.d.ts +0 -1140
  328. package/lib/locale-bundle.js +0 -9
  329. package/lib/style.css +0 -1
  330. package/lib/tiptap-DkWHMWDt.js +0 -6061
  331. package/lib/tiptap-gBG-1T-V.cjs +0 -116
  332. package/lib/vendor-BJ0Yf78E.cjs +0 -8114
  333. package/lib/vendor-Cpa6z-M0.js +0 -67575
@@ -0,0 +1,212 @@
1
+ import { forwardRef, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo } from 'react';
2
+
3
+ import type { AnyExtension, Editor as CoreEditor } from '@tiptap/core';
4
+ import type { UseEditorOptions } from '@tiptap/react';
5
+ import { EditorContent, useEditor } from '@tiptap/react';
6
+ import { differenceBy, throttle } from 'lodash-es';
7
+
8
+ import { BubbleMenu, Toolbar, TooltipProvider } from '@/components';
9
+ import CharactorCount from '@/components/CharactorCount';
10
+ import { Toaster } from '@/components/ui/toaster';
11
+ import { EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME } from '@/constants';
12
+ import { RESET_CSS } from '@/constants/resetCSS';
13
+ import { editableEditorActions } from '@/store/editableEditor';
14
+ import { ProviderRichText } from '@/store/ProviderRichText';
15
+ import { themeActions } from '@/theme/theme';
16
+ import type { BubbleMenuProps, ToolbarProps } from '@/types';
17
+ import { removeCSS, updateCSS } from '@/utils/dynamicCSS';
18
+ import { hasExtension } from '@/utils/utils';
19
+
20
+ import '../styles/index.scss';
21
+
22
+ /**
23
+ * Interface for RichTextEditor component props
24
+ */
25
+ export interface RichTextEditorProps {
26
+ /** Content of the editor */
27
+ content: string
28
+ /** Extensions for the editor */
29
+ extensions: AnyExtension[]
30
+
31
+ /** Output format */
32
+ output: 'html' | 'json' | 'text'
33
+ /** Model value */
34
+ modelValue?: string | object
35
+ /** Dark mode flag */
36
+ dark?: boolean
37
+ /** Dense mode flag */
38
+ dense?: boolean
39
+ /** Disabled flag */
40
+ disabled?: boolean
41
+ /** Label for the editor */
42
+ label?: string
43
+ /** Hide toolbar flag */
44
+ hideToolbar?: boolean
45
+ /** Disable bubble menu flag */
46
+ disableBubble?: boolean
47
+ /** Hide bubble menu flag */
48
+ hideBubble?: boolean
49
+ /** Remove default wrapper flag */
50
+ removeDefaultWrapper?: boolean
51
+ /** Maximum width */
52
+ maxWidth?: string | number
53
+ /** Minimum height */
54
+ minHeight?: string | number
55
+ /** Maximum height */
56
+ maxHeight?: string | number
57
+ /** Content class */
58
+ contentClass?: string | string[] | Record<string, any>
59
+ /** Content change callback */
60
+ onChangeContent?: (val: any) => void
61
+ /** Bubble menu props */
62
+ bubbleMenu?: BubbleMenuProps
63
+ /** Toolbar props */
64
+ toolbar?: ToolbarProps
65
+
66
+ /** Use editor options */
67
+ useEditorOptions?: UseEditorOptions
68
+
69
+ /** Use editor options */
70
+ resetCSS?: boolean
71
+ }
72
+
73
+ function RichTextEditor(props: RichTextEditorProps, ref: React.ForwardedRef<{ editor: CoreEditor | null }>) {
74
+ const { content, extensions, useEditorOptions = {} } = props;
75
+
76
+ const id = useId();
77
+
78
+ const sortExtensions = useMemo(() => {
79
+ const diff = differenceBy(extensions, extensions, 'name');
80
+ const exts = extensions.map((k: any) => {
81
+ const find = extensions.find((ext: any) => ext.name === k.name);
82
+ if (!find) {
83
+ return k;
84
+ }
85
+ return k.configure(find.options);
86
+ });
87
+ return [...exts, ...diff].map((k, i) => k.configure({ sort: i }));
88
+ }, [extensions]);
89
+
90
+ const onValueChange = throttle((editor) => {
91
+ const output = getOutput(editor, props.output as any);
92
+
93
+ props?.onChangeContent?.(output as any);
94
+ }, EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME);
95
+
96
+ const editor = useEditor({
97
+ extensions: sortExtensions,
98
+ content,
99
+ onUpdate: ({ editor }) => {
100
+ if (onValueChange)
101
+ onValueChange(editor);
102
+ },
103
+ ...useEditorOptions,
104
+ }) as any;
105
+
106
+ useImperativeHandle(ref, () => {
107
+ return {
108
+ editor,
109
+ };
110
+ });
111
+
112
+ useEffect(() => {
113
+ document.documentElement.classList.toggle('dark', props.dark);
114
+ themeActions.setTheme(id, props.dark ? 'dark' : 'light');
115
+ }, [props.dark]);
116
+
117
+ useEffect(() => {
118
+ editor?.setEditable(!props?.disabled);
119
+ editableEditorActions.setDisable(id, !props?.disabled);
120
+ }, [editor, props?.disabled]);
121
+
122
+ useEffect(() => {
123
+ if (props?.resetCSS !== false) {
124
+ updateCSS(RESET_CSS, 'react-tiptap-reset');
125
+ }
126
+
127
+ return () => {
128
+ removeCSS('react-tiptap-reset');
129
+ };
130
+ }, [props?.resetCSS]);
131
+
132
+ function getOutput(editor: CoreEditor, output: RichTextEditorProps['output']) {
133
+ if (props?.removeDefaultWrapper) {
134
+ if (output === 'html') {
135
+ return editor.isEmpty ? '' : editor.getHTML();
136
+ }
137
+ if (output === 'json') {
138
+ return editor.isEmpty ? {} : editor.getJSON();
139
+ }
140
+ if (output === 'text') {
141
+ return editor.isEmpty ? '' : editor.getText();
142
+ }
143
+ return '';
144
+ }
145
+
146
+ if (output === 'html') {
147
+ return editor.getHTML();
148
+ }
149
+ if (output === 'json') {
150
+ return editor.getJSON();
151
+ }
152
+ if (output === 'text') {
153
+ return editor.getText();
154
+ }
155
+ return '';
156
+ }
157
+
158
+ useLayoutEffect(() => {
159
+ if (editor) editor!.id = id;
160
+ }, [id, editor]);
161
+
162
+ useEffect(() => {
163
+ return () => {
164
+ editor?.destroy?.();
165
+ };
166
+ }, []);
167
+
168
+ const hasExtensionValue = hasExtension(editor, 'characterCount');
169
+
170
+ if (!editor) {
171
+ return <></>;
172
+ }
173
+
174
+ return (
175
+ <div className="reactjs-tiptap-editor">
176
+ <ProviderRichText
177
+ id={id}
178
+ >
179
+ <TooltipProvider delayDuration={0}
180
+ disableHoverableContent
181
+ >
182
+ <div className="overflow-hidden rounded-[0.5rem] bg-background">
183
+ <div className="flex max-h-full w-full flex-col">
184
+ {!props?.hideToolbar && <Toolbar disabled={!!props?.disabled}
185
+ editor={editor}
186
+ toolbar={props.toolbar}
187
+ />}
188
+
189
+ <EditorContent className={`relative ${props?.contentClass || ''}`}
190
+ editor={editor}
191
+
192
+ />
193
+
194
+ {hasExtensionValue && <CharactorCount editor={editor}
195
+ extensions={extensions}
196
+ />}
197
+
198
+ {!props?.hideBubble && <BubbleMenu bubbleMenu={props?.bubbleMenu}
199
+ disabled={props?.disabled}
200
+ editor={editor}
201
+ />}
202
+ </div>
203
+ </div>
204
+ </TooltipProvider>
205
+ </ProviderRichText>
206
+
207
+ <Toaster />
208
+ </div>
209
+ );
210
+ }
211
+
212
+ export default forwardRef(RichTextEditor);
@@ -0,0 +1,102 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { Button, Input, Label, Popover, PopoverContent, PopoverTrigger } from '@/components/ui';
3
+ import { useLocale } from '@/locales';
4
+
5
+ interface ISize {
6
+ width: number | string, height: number | string
7
+ }
8
+
9
+ interface IProps {
10
+ width: number | string
11
+ maxWidth?: number | string
12
+ height: number | string
13
+ onOk: (arg: ISize) => void
14
+ children: React.ReactNode
15
+ }
16
+
17
+ const containerStyle = { padding: '0 12px 12px' };
18
+
19
+ export const SizeSetter: React.FC<IProps> = ({ width, maxWidth, height, onOk, children }: any) => {
20
+ const { t } = useLocale();
21
+
22
+ const [form, setForm] = useState({
23
+ width: '',
24
+ height: '',
25
+ maxWidth: '',
26
+ });
27
+
28
+ useEffect(() => {
29
+ setForm({
30
+ width,
31
+ height,
32
+ maxWidth,
33
+ });
34
+ }, [height, maxWidth, width]);
35
+
36
+ function handleSubmit(event: any) {
37
+ event.preventDefault();
38
+ event.stopPropagation();
39
+ onOk(form);
40
+ }
41
+
42
+ return (
43
+ <Popover modal>
44
+ <PopoverTrigger asChild>
45
+ {children}
46
+ </PopoverTrigger>
47
+
48
+ <PopoverContent>
49
+ <div style={containerStyle}>
50
+ <form className="flex flex-col gap-2" onSubmit={handleSubmit}>
51
+ <Label className="mb-[6px]">
52
+ Width
53
+ </Label>
54
+
55
+ <div className="flex w-full max-w-sm items-center gap-1.5">
56
+ <div className="relative items-center w-full max-w-sm">
57
+ <Input
58
+ type="number"
59
+ value={form.width}
60
+ required
61
+ onChange={e => setForm({ ...form, width: e.target.value })}
62
+ />
63
+ </div>
64
+ </div>
65
+
66
+ <Label className="mb-[6px]">
67
+ Max Width
68
+ </Label>
69
+
70
+ <div className="flex w-full max-w-sm items-center gap-1.5">
71
+ <div className="relative items-center w-full max-w-sm">
72
+ <Input
73
+ type="number"
74
+ value={form.maxWidth}
75
+ required
76
+ onChange={e => setForm({ ...form, maxWidth: e.target.value })}
77
+ />
78
+ </div>
79
+ </div>
80
+ <Label className="mb-[6px]">
81
+ Height
82
+ </Label>
83
+ <div className="flex w-full max-w-sm items-center gap-1.5">
84
+ <div className="relative items-center w-full max-w-sm">
85
+ <Input
86
+ type="number"
87
+ value={form.height}
88
+ required
89
+ onChange={e => setForm({ ...form, height: e.target.value })}
90
+ />
91
+ </div>
92
+ </div>
93
+
94
+ <Button type="submit" className="self-end mt-2">
95
+ {t('editor.link.dialog.button.apply')}
96
+ </Button>
97
+ </form>
98
+ </div>
99
+ </PopoverContent>
100
+ </Popover>
101
+ );
102
+ };
@@ -0,0 +1,108 @@
1
+ import React, { useMemo } from 'react';
2
+ import type { Editor } from '@tiptap/core';
3
+ import type { ToolbarItemProps, ToolbarProps } from '@/types';
4
+
5
+ import { Separator } from '@/components';
6
+ import { useLocale } from '@/locales';
7
+ import { isFunction } from '@/utils/utils';
8
+
9
+ export interface ToolbarComponentProps {
10
+ editor: Editor
11
+ disabled?: boolean
12
+ toolbar?: ToolbarProps
13
+ }
14
+
15
+ function Toolbar({ editor, disabled, toolbar }: ToolbarComponentProps) {
16
+ const { t, lang } = useLocale();
17
+
18
+ const toolbarItems = useMemo(() => {
19
+ const extensions = [...editor.extensionManager.extensions];
20
+ const sortExtensions = extensions.sort((arr, acc) => {
21
+ const a = (arr.options).sort ?? -1;
22
+ const b = (acc.options).sort ?? -1;
23
+ return a - b;
24
+ });
25
+
26
+ let menus: ToolbarItemProps[] = [];
27
+
28
+ for (const extension of sortExtensions) {
29
+ const {
30
+ button,
31
+ divider = false,
32
+ spacer = false,
33
+ toolbar = true,
34
+ } = extension.options;
35
+ if (!button || !isFunction(button) || !toolbar) {
36
+ continue;
37
+ }
38
+
39
+ const _button: ToolbarItemProps['button'] | ToolbarItemProps['button'][] = button({
40
+ editor,
41
+ extension,
42
+ t,
43
+ });
44
+
45
+ if (Array.isArray(_button)) {
46
+ const menu: ToolbarItemProps[] = _button.map((k, i) => ({
47
+ button: k,
48
+ divider: i === _button.length - 1 ? divider : false,
49
+ spacer: i === 0 ? spacer : false,
50
+ type: extension.type,
51
+ name: extension.name,
52
+ }));
53
+ menus = [...menus, ...menu];
54
+ continue;
55
+ }
56
+
57
+ menus.push({
58
+ button: _button,
59
+ divider,
60
+ spacer,
61
+ type: extension.type,
62
+ name: extension.name,
63
+ });
64
+ }
65
+ return menus;
66
+ }, [editor, t, lang]);
67
+
68
+ const containerDom = (innerContent: React.ReactNode) => {
69
+ return (
70
+ <div
71
+ className="toolbar px-1 py-2 !border-b"
72
+ style={{
73
+ pointerEvents: disabled ? 'none' : 'auto',
74
+ opacity: disabled ? 0.5 : 1,
75
+ }}
76
+ >
77
+ <div className="relative flex flex-wrap h-auto gap-y-1 gap-x-1">
78
+ {innerContent}
79
+ </div>
80
+ </div>
81
+ );
82
+ };
83
+
84
+ const dom = toolbarItems.map((item: ToolbarItemProps, key) => {
85
+ const ButtonComponent = item.button.component;
86
+
87
+ return (
88
+ <div className="flex items-center" key={`toolbar-item-${key}`}>
89
+ {item?.spacer && <Separator orientation="vertical" className="!h-[16px] !mx-[10px]" />}
90
+
91
+ <ButtonComponent
92
+ {...item.button.componentProps}
93
+ disabled={disabled || item?.button?.componentProps?.disabled}
94
+ />
95
+
96
+ {item?.divider && <Separator orientation="vertical" className="!h-auto !mx-2" />}
97
+ </div>
98
+ );
99
+ });
100
+
101
+ if (toolbar && toolbar?.render) {
102
+ return toolbar.render({ editor, disabled: disabled || false }, toolbarItems, dom, containerDom);
103
+ }
104
+
105
+ return containerDom(dom);
106
+ }
107
+
108
+ export { Toolbar };
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+
3
+ function Activity() {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ viewBox="0 0 24 24"
8
+ width="1em"
9
+ height="1em"
10
+ >
11
+ <path
12
+ d="M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"
13
+ fill="currentColor"
14
+ />
15
+ </svg>
16
+ );
17
+ }
18
+
19
+ export default Activity;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+
3
+ function Animal() {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ viewBox="0 0 24 24"
8
+ width="1em"
9
+ height="1em"
10
+ >
11
+ <path
12
+ d="M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"
13
+ fill="currentColor"
14
+ />
15
+ <path
16
+ d="M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"
17
+ fill="currentColor"
18
+ />
19
+ </svg>
20
+
21
+ );
22
+ }
23
+
24
+ export default Animal;
@@ -0,0 +1,13 @@
1
+ import type { SVGProps } from 'react';
2
+
3
+ export function AspectRatio(props: SVGProps<SVGSVGElement>) {
4
+ return (
5
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" {...props}>
6
+ <path
7
+ fill="currentColor"
8
+ d="M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"
9
+ >
10
+ </path>
11
+ </svg>
12
+ );
13
+ }
@@ -0,0 +1,17 @@
1
+ import type { SVGProps } from 'react';
2
+
3
+ export function BlockquoteLeft(props: SVGProps<SVGSVGElement>) {
4
+ return (
5
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" {...props}>
6
+ <path
7
+ fill="none"
8
+ stroke="currentColor"
9
+ strokeLinecap="round"
10
+ strokeLinejoin="round"
11
+ strokeWidth="2"
12
+ d="M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"
13
+ >
14
+ </path>
15
+ </svg>
16
+ );
17
+ }
@@ -0,0 +1,7 @@
1
+ export function ColumnAddLeft() {
2
+ return (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path fill="none" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"></path>
5
+ </svg>
6
+ );
7
+ }
@@ -0,0 +1,7 @@
1
+ export function ColumnAddRight() {
2
+ return (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path fill="none" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"></path>
5
+ </svg>
6
+ );
7
+ }
@@ -0,0 +1,26 @@
1
+ function DeleteColumn() {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ xmlnsXlink="http://www.w3.org/1999/xlink"
6
+ aria-hidden="true"
7
+ role="img"
8
+ className="w-4 h-4"
9
+ width="1em"
10
+ height="1em"
11
+ viewBox="0 0 24 24"
12
+ >
13
+ <path
14
+ fill="none"
15
+ stroke="currentColor"
16
+ strokeLinecap="round"
17
+ strokeLinejoin="round"
18
+ strokeWidth="1.5"
19
+ d="M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6"
20
+ color="currentColor"
21
+ />
22
+ </svg>
23
+ );
24
+ }
25
+
26
+ export { DeleteColumn };
@@ -0,0 +1,26 @@
1
+ function DeleteRow() {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ xmlnsXlink="http://www.w3.org/1999/xlink"
6
+ aria-hidden="true"
7
+ role="img"
8
+ className="w-4 h-4"
9
+ width="1em"
10
+ height="1em"
11
+ viewBox="0 0 24 24"
12
+ >
13
+ <path
14
+ fill="none"
15
+ stroke="currentColor"
16
+ strokeLinecap="round"
17
+ strokeLinejoin="round"
18
+ strokeWidth="1.5"
19
+ d="M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6"
20
+ color="currentColor"
21
+ />
22
+ </svg>
23
+ );
24
+ }
25
+
26
+ export { DeleteRow };
@@ -0,0 +1,7 @@
1
+ export function Direction() {
2
+ return (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path fill="none" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"></path>
5
+ </svg>
6
+ );
7
+ }
@@ -0,0 +1,7 @@
1
+ export function Excalidraw() {
2
+ return (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
4
+ <path fill="currentColor" d="M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"></path>
5
+ </svg>
6
+ );
7
+ }
@@ -0,0 +1,8 @@
1
+ export function ExportPdf() {
2
+ return (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
4
+ <path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
5
+ <path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
6
+ </svg>
7
+ );
8
+ }
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+
3
+ function ExportWord() {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="1em"
8
+ height="1em"
9
+ className="icon"
10
+ viewBox="0 0 1024 1024"
11
+ >
12
+ <path
13
+ fill="currentColor"
14
+ d="M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"
15
+ />
16
+ <path
17
+ fill="currentColor"
18
+ d="m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"
19
+ />
20
+ </svg>
21
+ );
22
+ }
23
+
24
+ export default ExportWord;
@@ -0,0 +1,13 @@
1
+ import type { SVGProps } from 'react';
2
+
3
+ export function FileWordOutline(props: SVGProps<SVGSVGElement>) {
4
+ return (
5
+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" {...props}>
6
+ <path
7
+ fill="currentColor"
8
+ d="M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"
9
+ >
10
+ </path>
11
+ </svg>
12
+ );
13
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+
3
+ function Flag() {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ viewBox="0 0 24 24"
8
+ width="1em"
9
+ height="1em"
10
+ >
11
+ <path
12
+ d="M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"
13
+ fill="currentColor"
14
+ />
15
+ </svg>
16
+ );
17
+ }
18
+
19
+ export default Flag;