reactjs-tiptap-editor-pro 0.2.29 → 0.2.31
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.
- package/package.json +5 -58
- package/src/components/ActionButton.tsx +103 -0
- package/src/components/ActionMenuButton.tsx +76 -0
- package/src/components/BubbleMenu.tsx +93 -0
- package/src/components/CharactorCount.tsx +50 -0
- package/src/components/ColorPicker.tsx +272 -0
- package/src/components/RichTextEditor.tsx +212 -0
- package/src/components/SizeSetter/SizeSetter.tsx +102 -0
- package/src/components/Toolbar.tsx +108 -0
- package/src/components/icons/Activity.tsx +19 -0
- package/src/components/icons/Animas.tsx +24 -0
- package/src/components/icons/AspectRatio.tsx +13 -0
- package/src/components/icons/Blockquote.tsx +17 -0
- package/src/components/icons/ColumnAddLeft.tsx +7 -0
- package/src/components/icons/ColumnAddRight.tsx +7 -0
- package/src/components/icons/DeleteColumn.tsx +26 -0
- package/src/components/icons/DeleteRow.tsx +26 -0
- package/src/components/icons/Direction.tsx +7 -0
- package/src/components/icons/Excalidraw.tsx +7 -0
- package/src/components/icons/ExportPdf.tsx +8 -0
- package/src/components/icons/ExportWord.tsx +24 -0
- package/src/components/icons/FileWordOutline.tsx +13 -0
- package/src/components/icons/Flag.tsx +19 -0
- package/src/components/icons/Food.tsx +20 -0
- package/src/components/icons/GIfIcon.tsx +10 -0
- package/src/components/icons/Icon.tsx +30 -0
- package/src/components/icons/ImportWord.tsx +23 -0
- package/src/components/icons/LeftToRight.tsx +7 -0
- package/src/components/icons/LineHeight.tsx +13 -0
- package/src/components/icons/MenuDown.tsx +24 -0
- package/src/components/icons/Mermaid.tsx +13 -0
- package/src/components/icons/NoFill.tsx +7 -0
- package/src/components/icons/Object.tsx +24 -0
- package/src/components/icons/RightToLeft.tsx +7 -0
- package/src/components/icons/SizeL.tsx +9 -0
- package/src/components/icons/SizeM.tsx +13 -0
- package/src/components/icons/SizeS.tsx +13 -0
- package/src/components/icons/Symbol.tsx +19 -0
- package/src/components/icons/Travel.tsx +24 -0
- package/src/components/icons/Twitter.tsx +7 -0
- package/src/components/icons/icons.ts +212 -0
- package/src/components/icons/index.ts +12 -0
- package/src/components/index.ts +9 -0
- package/src/components/menus/bubble.ts +395 -0
- package/src/components/menus/components/BubbleMenuContent.tsx +15 -0
- package/src/components/menus/components/BubbleMenuDrawer.tsx +128 -0
- package/src/components/menus/components/BubbleMenuExcalidraw.tsx +91 -0
- package/src/components/menus/components/BubbleMenuIframe.tsx +143 -0
- package/src/components/menus/components/BubbleMenuKatex.tsx +136 -0
- package/src/components/menus/components/BubbleMenuLink.tsx +99 -0
- package/src/components/menus/components/BubbleMenuMedia.tsx +235 -0
- package/src/components/menus/components/BubbleMenuMermaid.tsx +128 -0
- package/src/components/menus/components/BubbleMenuText.tsx +102 -0
- package/src/components/menus/components/BubbleMenuTwitter.tsx +91 -0
- package/src/components/menus/components/ColumnsBubbleMenu.tsx +59 -0
- package/src/components/menus/components/ContentMenu.tsx +396 -0
- package/src/components/menus/components/TableBubbleMenu.tsx +362 -0
- package/src/components/menus/index.ts +7 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/dialog.tsx +128 -0
- package/src/components/ui/dropdown-menu.tsx +203 -0
- package/src/components/ui/emoji-picker.tsx +166 -0
- package/src/components/ui/index.ts +14 -0
- package/src/components/ui/input.tsx +25 -0
- package/src/components/ui/label.tsx +26 -0
- package/src/components/ui/popover.tsx +31 -0
- package/src/components/ui/select.tsx +162 -0
- package/src/components/ui/separator.tsx +31 -0
- package/src/components/ui/switch.tsx +29 -0
- package/src/components/ui/tabs.tsx +55 -0
- package/src/components/ui/textarea.tsx +24 -0
- package/src/components/ui/toast.tsx +129 -0
- package/src/components/ui/toaster.tsx +44 -0
- package/src/components/ui/toggle.tsx +45 -0
- package/src/components/ui/tooltip.tsx +30 -0
- package/src/components/ui/use-toast.ts +197 -0
- package/src/constants/index.ts +223 -0
- package/src/constants/resetCSS.ts +139 -0
- package/src/extension-bundle.ts +2 -0
- package/src/extensions/Attachment/Attachment.ts +144 -0
- package/src/extensions/Attachment/components/NodeViewAttachment/FileIcon.tsx +69 -0
- package/src/extensions/Attachment/components/NodeViewAttachment/FileIconString.ts +28 -0
- package/src/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.tsx +155 -0
- package/src/extensions/Attachment/components/NodeViewAttachment/index.module.scss +23 -0
- package/src/extensions/Attachment/index.ts +1 -0
- package/src/extensions/BaseKit.ts +253 -0
- package/src/extensions/Blockquote/Blockquote.ts +31 -0
- package/src/extensions/Blockquote/index.ts +1 -0
- package/src/extensions/Bold/Bold.ts +26 -0
- package/src/extensions/Bold/index.ts +1 -0
- package/src/extensions/BulletList/BulletList.ts +28 -0
- package/src/extensions/BulletList/index.ts +1 -0
- package/src/extensions/Clear/Clear.ts +24 -0
- package/src/extensions/Clear/index.ts +1 -0
- package/src/extensions/Code/Code.ts +26 -0
- package/src/extensions/Code/index.ts +1 -0
- package/src/extensions/CodeBlock/CodeBlock.ts +54 -0
- package/src/extensions/CodeBlock/components/CodeBlockActiveButton.tsx +66 -0
- package/src/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.tsx +89 -0
- package/src/extensions/CodeBlock/components/NodeViewCodeBlock/index.module.scss +81 -0
- package/src/extensions/CodeBlock/highlighter.ts +132 -0
- package/src/extensions/CodeBlock/index.ts +1 -0
- package/src/extensions/CodeBlock/shiki-plugin.ts +213 -0
- package/src/extensions/Color/Color.ts +52 -0
- package/src/extensions/Color/components/ColorActionButton.tsx +104 -0
- package/src/extensions/Color/index.ts +1 -0
- package/src/extensions/Document/Document.ts +8 -0
- package/src/extensions/Document/index.ts +1 -0
- package/src/extensions/Drawer/Drawer.ts +177 -0
- package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.module.scss +85 -0
- package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.tsx +598 -0
- package/src/extensions/Drawer/components/ControlDrawer/icon.tsx +500 -0
- package/src/extensions/Drawer/components/DrawerActiveButton.tsx +239 -0
- package/src/extensions/Drawer/components/EditDrawerBlock.tsx +238 -0
- package/src/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.tsx +260 -0
- package/src/extensions/Drawer/index.ts +1 -0
- package/src/extensions/Emoji/Emoji.ts +146 -0
- package/src/extensions/Emoji/components/EmojiList/EmojiList.tsx +103 -0
- package/src/extensions/Emoji/components/EmojiList/emojis.ts +1858 -0
- package/src/extensions/Emoji/components/EmojiPicker/EmojiPicker.tsx +61 -0
- package/src/extensions/Emoji/index.ts +1 -0
- package/src/extensions/Excalidraw/Excalidraw.ts +123 -0
- package/src/extensions/Excalidraw/components/ExcalidrawActiveButton.tsx +138 -0
- package/src/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.tsx +178 -0
- package/src/extensions/Excalidraw/components/NodeViewExcalidraw/index.module.scss +43 -0
- package/src/extensions/Excalidraw/index.ts +1 -0
- package/src/extensions/ExportPdf/ExportPdf.ts +25 -0
- package/src/extensions/ExportPdf/index.ts +1 -0
- package/src/extensions/ExportWord/ExportWord.ts +87 -0
- package/src/extensions/ExportWord/index.ts +1 -0
- package/src/extensions/FontFamily/FontFamily.ts +64 -0
- package/src/extensions/FontFamily/components/FontFamilyButton.tsx +97 -0
- package/src/extensions/FontFamily/index.ts +1 -0
- package/src/extensions/FontSize/FontSize.ts +119 -0
- package/src/extensions/FontSize/components/FontSizeMenuButton.tsx +84 -0
- package/src/extensions/FontSize/index.ts +1 -0
- package/src/extensions/FormatPainter/FormatPainter.ts +121 -0
- package/src/extensions/FormatPainter/index.ts +1 -0
- package/src/extensions/Heading/Heading.ts +57 -0
- package/src/extensions/Heading/components/HeadingButton.tsx +96 -0
- package/src/extensions/Heading/index.ts +1 -0
- package/src/extensions/Highlight/Highlight.ts +36 -0
- package/src/extensions/Highlight/components/HighlightActionButton.tsx +108 -0
- package/src/extensions/Highlight/index.ts +1 -0
- package/src/extensions/History/History.ts +39 -0
- package/src/extensions/History/components/HistoryActionButton.tsx +74 -0
- package/src/extensions/History/index.ts +1 -0
- package/src/extensions/HorizontalRule/HorizontalRule.ts +42 -0
- package/src/extensions/HorizontalRule/index.ts +1 -0
- package/src/extensions/Iframe/Iframe.ts +140 -0
- package/src/extensions/Iframe/components/IframeNodeView.tsx +92 -0
- package/src/extensions/Iframe/components/index.module.scss +40 -0
- package/src/extensions/Iframe/embed.ts +487 -0
- package/src/extensions/Iframe/index.ts +1 -0
- package/src/extensions/Image/Image.ts +303 -0
- package/src/extensions/Image/components/ActionImageButton.tsx +186 -0
- package/src/extensions/Image/components/ImageCropper.tsx +198 -0
- package/src/extensions/Image/components/ImageView.tsx +271 -0
- package/src/extensions/Image/index.ts +1 -0
- package/src/extensions/Image/store.ts +15 -0
- package/src/extensions/ImageGif/ImageGif.ts +176 -0
- package/src/extensions/ImageGif/components/ImageGifActionButton.tsx +138 -0
- package/src/extensions/ImageGif/components/ImageGifView.tsx +260 -0
- package/src/extensions/ImageGif/index.ts +1 -0
- package/src/extensions/ImportWord/ImportWord.ts +52 -0
- package/src/extensions/ImportWord/components/ImportWordButton.tsx +151 -0
- package/src/extensions/ImportWord/index.ts +1 -0
- package/src/extensions/Indent/Indent.ts +110 -0
- package/src/extensions/Indent/index.ts +1 -0
- package/src/extensions/Italic/Italic.ts +29 -0
- package/src/extensions/Italic/index.ts +1 -0
- package/src/extensions/Katex/Katex.ts +109 -0
- package/src/extensions/Katex/components/KatexActiveButton.tsx +117 -0
- package/src/extensions/Katex/components/KatexWrapper.tsx +53 -0
- package/src/extensions/Katex/index.ts +1 -0
- package/src/extensions/LineHeight/LineHeight.ts +76 -0
- package/src/extensions/LineHeight/components/LineHeightDropdown.tsx +93 -0
- package/src/extensions/LineHeight/index.ts +1 -0
- package/src/extensions/Link/Link.ts +92 -0
- package/src/extensions/Link/components/LinkEditBlock.tsx +110 -0
- package/src/extensions/Link/components/LinkEditPopover.tsx +46 -0
- package/src/extensions/Link/components/LinkViewBlock.tsx +54 -0
- package/src/extensions/Link/index.ts +1 -0
- package/src/extensions/ListItem/ListItem.ts +1 -0
- package/src/extensions/ListItem/index.ts +1 -0
- package/src/extensions/Mention/Mention.ts +100 -0
- package/src/extensions/Mention/components/NodeViewMentionList/NodeViewMentionList.tsx +94 -0
- package/src/extensions/Mention/components/NodeViewMentionList/index.module.scss +38 -0
- package/src/extensions/Mention/index.ts +1 -0
- package/src/extensions/Mermaid/Mermaid.ts +177 -0
- package/src/extensions/Mermaid/components/EditMermaidBlock.tsx +155 -0
- package/src/extensions/Mermaid/components/MermaidActiveButton.tsx +151 -0
- package/src/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.tsx +260 -0
- package/src/extensions/Mermaid/index.ts +1 -0
- package/src/extensions/MoreMark/MoreMark.ts +102 -0
- package/src/extensions/MoreMark/components/ActionMoreButton.tsx +97 -0
- package/src/extensions/MoreMark/index.ts +1 -0
- package/src/extensions/MultiColumn/Column.ts +36 -0
- package/src/extensions/MultiColumn/MultiColumn.ts +111 -0
- package/src/extensions/MultiColumn/components/ColumnActionButton.ts +22 -0
- package/src/extensions/MultiColumn/index.ts +3 -0
- package/src/extensions/OrderedList/OrderedList.ts +28 -0
- package/src/extensions/OrderedList/index.ts +1 -0
- package/src/extensions/SearchAndReplace/SearchAndReplace.ts +395 -0
- package/src/extensions/SearchAndReplace/components/SearchAndReplaceButton.tsx +190 -0
- package/src/extensions/SearchAndReplace/index.ts +1 -0
- package/src/extensions/Selection/Selection.ts +32 -0
- package/src/extensions/Selection/index.ts +1 -0
- package/src/extensions/SlashCommand/SlashCommand.ts +255 -0
- package/src/extensions/SlashCommand/components/CommandsList.tsx +180 -0
- package/src/extensions/SlashCommand/groups.ts +183 -0
- package/src/extensions/SlashCommand/index.ts +1 -0
- package/src/extensions/SlashCommand/types.ts +24 -0
- package/src/extensions/Strike/Strike.ts +26 -0
- package/src/extensions/Strike/index.ts +1 -0
- package/src/extensions/Subscript/Subscript.ts +88 -0
- package/src/extensions/Subscript/index.ts +1 -0
- package/src/extensions/Table/Cell.ts +131 -0
- package/src/extensions/Table/Header.ts +93 -0
- package/src/extensions/Table/Row.ts +8 -0
- package/src/extensions/Table/Table.ts +60 -0
- package/src/extensions/Table/cell-background.ts +112 -0
- package/src/extensions/Table/components/CreateTablePopover.tsx +132 -0
- package/src/extensions/Table/components/TableActionButton.tsx +42 -0
- package/src/extensions/Table/index.ts +6 -0
- package/src/extensions/Table/utils.ts +352 -0
- package/src/extensions/TableOfContent/TableOfContent.ts +124 -0
- package/src/extensions/TableOfContent/components/NodeViewTableOfContent.tsx +116 -0
- package/src/extensions/TableOfContent/components/TableOfContentActionButton.tsx +27 -0
- package/src/extensions/TableOfContent/components/index.module.scss +40 -0
- package/src/extensions/TableOfContent/index.ts +1 -0
- package/src/extensions/TaskList/TaskList.ts +46 -0
- package/src/extensions/TaskList/index.ts +1 -0
- package/src/extensions/TextAlign/TextAlign.ts +68 -0
- package/src/extensions/TextAlign/components/TextAlignMenuButton.tsx +103 -0
- package/src/extensions/TextAlign/index.ts +1 -0
- package/src/extensions/TextBubble/TextBubble.ts +22 -0
- package/src/extensions/TextBubble/components/TextDropdown.tsx +146 -0
- package/src/extensions/TextBubble/index.ts +1 -0
- package/src/extensions/TextDirection/TextDirection.ts +97 -0
- package/src/extensions/TextDirection/components/TextDirectionButton.tsx +103 -0
- package/src/extensions/TextDirection/index.ts +1 -0
- package/src/extensions/TrailingNode/TrailingNode.ts +71 -0
- package/src/extensions/TrailingNode/index.ts +1 -0
- package/src/extensions/Twitter/Twitter.ts +161 -0
- package/src/extensions/Twitter/components/FormEditLinkTwitter.tsx +68 -0
- package/src/extensions/Twitter/components/NodeViewTweet.tsx +30 -0
- package/src/extensions/Twitter/components/TwitterActiveButton.tsx +41 -0
- package/src/extensions/Twitter/index.ts +1 -0
- package/src/extensions/UnderLine/Underline.ts +30 -0
- package/src/extensions/UnderLine/index.ts +1 -0
- package/src/extensions/Video/Video.ts +204 -0
- package/src/extensions/Video/components/ActiveVideoButton.tsx +191 -0
- package/src/extensions/Video/index.ts +1 -0
- package/src/extensions/Video/store.ts +15 -0
- package/src/extensions/index.ts +122 -0
- package/src/hooks/useActive.tsx +24 -0
- package/src/hooks/useAttributes.tsx +45 -0
- package/src/hooks/useCopy.tsx +20 -0
- package/src/hooks/useEditorState.tsx +23 -0
- package/src/hooks/useExtension.tsx +29 -0
- package/src/index.ts +8 -0
- package/src/lib/utils.ts +7 -0
- package/src/locale-bundle.ts +3 -0
- package/src/locales/en.ts +173 -0
- package/src/locales/hu.ts +173 -0
- package/src/locales/index.tsx +163 -0
- package/src/locales/pt-br.ts +173 -0
- package/src/locales/vi.ts +173 -0
- package/src/locales/zh-cn.ts +173 -0
- package/src/plugins/DragHandle/index.ts +375 -0
- package/src/plugins/DragHandle/range.ts +114 -0
- package/src/plugins/DragHandle/utils.ts +80 -0
- package/src/plugins/image-upload.ts +160 -0
- package/src/store/ProviderRichText.tsx +53 -0
- package/src/store/editableEditor.ts +15 -0
- package/src/store/fast-context.tsx +70 -0
- package/src/store/store.ts +35 -0
- package/src/styles/ProseMirror.scss +176 -0
- package/src/styles/columns.scss +23 -0
- package/src/styles/editor.scss +411 -0
- package/src/styles/global.scss +87 -0
- package/src/styles/index.scss +5 -0
- package/src/styles/mention.scss +6 -0
- package/src/theme/theme.ts +15 -0
- package/src/types.ts +271 -0
- package/src/utils/_event.ts +55 -0
- package/src/utils/color.ts +67 -0
- package/src/utils/columns.ts +142 -0
- package/src/utils/customEvents/customEvents.ts +18 -0
- package/src/utils/customEvents/events.constant.ts +11 -0
- package/src/utils/delete-node.ts +46 -0
- package/src/utils/dom-dataset.ts +121 -0
- package/src/utils/download.ts +17 -0
- package/src/utils/dynamicCSS.ts +192 -0
- package/src/utils/editor-container-size.ts +28 -0
- package/src/utils/file.ts +112 -0
- package/src/utils/getRenderContainer.ts +41 -0
- package/src/utils/indent.ts +99 -0
- package/src/utils/is-mobile.ts +57 -0
- package/src/utils/json.ts +18 -0
- package/src/utils/line-height.ts +109 -0
- package/src/utils/lru-cache.ts +145 -0
- package/src/utils/mitt.ts +114 -0
- package/src/utils/node.ts +92 -0
- package/src/utils/pdf.ts +72 -0
- package/src/utils/plateform.ts +49 -0
- package/src/utils/shortId.ts +5 -0
- package/src/utils/storage.ts +18 -0
- package/src/utils/utils.ts +71 -0
- package/src/vite-env.d.ts +3 -0
- package/lib/RichTextEditor-BwbqJLnA.cjs +0 -141
- package/lib/RichTextEditor-iGJ6-rbq.js +0 -8833
- package/lib/extension-bundle.cjs +0 -33
- package/lib/extension-bundle.d.cts +0 -947
- package/lib/extension-bundle.d.ts +0 -947
- package/lib/extension-bundle.js +0 -5755
- package/lib/index-DV-nXpU1.cjs +0 -1
- package/lib/index-M6H3FoBi.js +0 -1147
- package/lib/index.cjs +0 -1
- package/lib/index.d.cts +0 -513
- package/lib/index.d.ts +0 -513
- package/lib/index.js +0 -16
- package/lib/locale-bundle.cjs +0 -1
- package/lib/locale-bundle.d.cts +0 -1140
- package/lib/locale-bundle.d.ts +0 -1140
- package/lib/locale-bundle.js +0 -9
- package/lib/style.css +0 -1
- package/lib/tiptap-DkWHMWDt.js +0 -6061
- package/lib/tiptap-gBG-1T-V.cjs +0 -116
- package/lib/vendor-BJ0Yf78E.cjs +0 -8114
- package/lib/vendor-Cpa6z-M0.js +0 -67575
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/** Default lang */
|
|
2
|
+
export const DEFAULT_LANG_VALUE = 'en' as const;
|
|
3
|
+
|
|
4
|
+
/** Throttle time for editor input (milliseconds) */
|
|
5
|
+
export const EDITOR_UPDATE_THROTTLE_WAIT_TIME = 200 as const;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* watch throttling time must be less than the update time
|
|
9
|
+
* otherwise the cursor position will reach the end
|
|
10
|
+
*/
|
|
11
|
+
export const EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME = EDITOR_UPDATE_THROTTLE_WAIT_TIME - 80;
|
|
12
|
+
|
|
13
|
+
/** Minimum size for image adjustments */
|
|
14
|
+
export const IMAGE_MIN_SIZE = 20 as const;
|
|
15
|
+
/** Maximum size for image adjustments */
|
|
16
|
+
export const IMAGE_MAX_SIZE = 100_000 as const;
|
|
17
|
+
/** Throttle time during adjustments for images (milliseconds) */
|
|
18
|
+
export const IMAGE_THROTTLE_WAIT_TIME = 16 as const;
|
|
19
|
+
|
|
20
|
+
/** Default number of rows and columns for grids when creating a table */
|
|
21
|
+
export const TABLE_INIT_GRID_SIZE = 10 as const;
|
|
22
|
+
/** Maximum number of rows and columns for grids when creating a table */
|
|
23
|
+
export const TABLE_MAX_GRID_SIZE = 10 as const;
|
|
24
|
+
/** Minimum number of rows and columns for grids when creating a table */
|
|
25
|
+
export const TABLE_DEFAULT_SELECTED_GRID_SIZE = 2 as const;
|
|
26
|
+
|
|
27
|
+
export const DEFAULT_COLOR = '#262626';
|
|
28
|
+
/** Default color list for text color and text highlight */
|
|
29
|
+
export const COLORS_LIST = [
|
|
30
|
+
'#000000',
|
|
31
|
+
'#262626',
|
|
32
|
+
'#595959',
|
|
33
|
+
'#8C8C8C',
|
|
34
|
+
'#BFBFBF',
|
|
35
|
+
'#D9D9D9',
|
|
36
|
+
'#E9E9E9',
|
|
37
|
+
'#F5F5F5',
|
|
38
|
+
'#FAFAFA',
|
|
39
|
+
'#FFFFFF',
|
|
40
|
+
'#F5222D',
|
|
41
|
+
'#FA541C',
|
|
42
|
+
'#FA8C16',
|
|
43
|
+
'#FADB14',
|
|
44
|
+
'#52C41A',
|
|
45
|
+
'#13C2C2',
|
|
46
|
+
'#1890FF',
|
|
47
|
+
'#2F54EB',
|
|
48
|
+
'#722ED1',
|
|
49
|
+
'#EB2F96',
|
|
50
|
+
'#FFE8E6',
|
|
51
|
+
'#FFECE0',
|
|
52
|
+
'#FFEFD1',
|
|
53
|
+
'#FCFCCA',
|
|
54
|
+
'#E4F7D2',
|
|
55
|
+
'#D3F5F0',
|
|
56
|
+
'#D4EEFC',
|
|
57
|
+
'#DEE8FC',
|
|
58
|
+
'#EFE1FA',
|
|
59
|
+
'#FAE1EB',
|
|
60
|
+
'#FFA39E',
|
|
61
|
+
'#FFBB96',
|
|
62
|
+
'#FFD591',
|
|
63
|
+
'#FFFB8F',
|
|
64
|
+
'#B7EB8F',
|
|
65
|
+
'#87E8DE',
|
|
66
|
+
'#91D5FF',
|
|
67
|
+
'#ADC6FF',
|
|
68
|
+
'#D3ADF7',
|
|
69
|
+
'#FFADD2',
|
|
70
|
+
'#FF4D4F',
|
|
71
|
+
'#FF7A45',
|
|
72
|
+
'#FFA940',
|
|
73
|
+
'#FFEC3D',
|
|
74
|
+
'#73D13D',
|
|
75
|
+
'#36CFC9',
|
|
76
|
+
'#40A9FF',
|
|
77
|
+
'#597EF7',
|
|
78
|
+
'#9254DE',
|
|
79
|
+
'#F759AB',
|
|
80
|
+
'#CF1322',
|
|
81
|
+
'#D4380D',
|
|
82
|
+
'#D46B08',
|
|
83
|
+
'#D4B106',
|
|
84
|
+
'#389E0D',
|
|
85
|
+
'#08979C',
|
|
86
|
+
'#096DD9',
|
|
87
|
+
'#1D39C4',
|
|
88
|
+
'#531DAB',
|
|
89
|
+
'#C41D7F',
|
|
90
|
+
'#820014',
|
|
91
|
+
'#871400',
|
|
92
|
+
'#873800',
|
|
93
|
+
'#614700',
|
|
94
|
+
'#135200',
|
|
95
|
+
'#00474F',
|
|
96
|
+
'#003A8C',
|
|
97
|
+
'#061178',
|
|
98
|
+
'#22075E',
|
|
99
|
+
'#780650',
|
|
100
|
+
] as const;
|
|
101
|
+
|
|
102
|
+
/** Default font family list */
|
|
103
|
+
export const DEFAULT_FONT_FAMILY_LIST = [
|
|
104
|
+
'Inter',
|
|
105
|
+
'Comic Sans MS, Comic Sans',
|
|
106
|
+
'serif',
|
|
107
|
+
'cursive',
|
|
108
|
+
'Arial',
|
|
109
|
+
'Arial Black',
|
|
110
|
+
'Georgia',
|
|
111
|
+
'Impact',
|
|
112
|
+
'Tahoma',
|
|
113
|
+
'Times New Roman',
|
|
114
|
+
'Verdana',
|
|
115
|
+
'Courier New',
|
|
116
|
+
'Lucida Console',
|
|
117
|
+
'Monaco',
|
|
118
|
+
'monospace',
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
export const DEFAULT_LANGUAGE_CODE_BLOCK = [
|
|
122
|
+
'html',
|
|
123
|
+
'css',
|
|
124
|
+
'js',
|
|
125
|
+
'ts',
|
|
126
|
+
'bash',
|
|
127
|
+
];
|
|
128
|
+
|
|
129
|
+
export const MAP_LANGUAGE_CODE_LABELS = {
|
|
130
|
+
html: 'HTML',
|
|
131
|
+
css: 'CSS',
|
|
132
|
+
js: 'JavaScript',
|
|
133
|
+
ts: 'TypeScript',
|
|
134
|
+
bash: 'Bash',
|
|
135
|
+
} as any;
|
|
136
|
+
|
|
137
|
+
/** Default font size list */
|
|
138
|
+
export const DEFAULT_FONT_SIZE_LIST = [
|
|
139
|
+
'10px',
|
|
140
|
+
'11px',
|
|
141
|
+
'12px',
|
|
142
|
+
'14px',
|
|
143
|
+
'16px',
|
|
144
|
+
'18px',
|
|
145
|
+
'20px',
|
|
146
|
+
'22px',
|
|
147
|
+
'24px',
|
|
148
|
+
'26px',
|
|
149
|
+
'28px',
|
|
150
|
+
'36px',
|
|
151
|
+
'48px',
|
|
152
|
+
'72px',
|
|
153
|
+
] as const;
|
|
154
|
+
|
|
155
|
+
/** Default font size value */
|
|
156
|
+
export const DEFAULT_FONT_SIZE_VALUE = 'default';
|
|
157
|
+
|
|
158
|
+
/** Options for setting image size in the bubble menu */
|
|
159
|
+
export enum IMAGE_SIZE {
|
|
160
|
+
'size-small' = 200,
|
|
161
|
+
'size-medium' = 500,
|
|
162
|
+
'size-large' = '100%',
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Options for setting video size in the bubble menu */
|
|
166
|
+
export enum VIDEO_SIZE {
|
|
167
|
+
'size-small' = 480,
|
|
168
|
+
'size-medium' = 640,
|
|
169
|
+
'size-large' = '100%',
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Line Height List */
|
|
173
|
+
export const DEFAULT_LINE_HEIGHT_LIST = ['100%', '115%', '150%', '200%', '250%', '300%'];
|
|
174
|
+
export const LINE_HEIGHT_100 = 1.7;
|
|
175
|
+
export const DEFAULT_LINE_HEIGHT = '1';
|
|
176
|
+
|
|
177
|
+
/** display in menus */
|
|
178
|
+
export const NODE_TYPE_MENU: any = {
|
|
179
|
+
image: [
|
|
180
|
+
'divider',
|
|
181
|
+
'image-size-small',
|
|
182
|
+
'image-size-medium',
|
|
183
|
+
'image-size-large',
|
|
184
|
+
'divider',
|
|
185
|
+
'image-left',
|
|
186
|
+
'image-center',
|
|
187
|
+
'image-right',
|
|
188
|
+
'divider',
|
|
189
|
+
'image-aspect-ratio',
|
|
190
|
+
'remove',
|
|
191
|
+
],
|
|
192
|
+
text: [
|
|
193
|
+
'divider',
|
|
194
|
+
'text-bubble',
|
|
195
|
+
'divider',
|
|
196
|
+
'bold',
|
|
197
|
+
'italic',
|
|
198
|
+
'underline',
|
|
199
|
+
'strike',
|
|
200
|
+
'code',
|
|
201
|
+
'link',
|
|
202
|
+
'divider',
|
|
203
|
+
'color',
|
|
204
|
+
'highlight',
|
|
205
|
+
'textAlign',
|
|
206
|
+
],
|
|
207
|
+
video: ['video-size-small', 'video-size-medium', 'video-size-large', 'divider', 'remove'],
|
|
208
|
+
table: ['removeTable'],
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/** display in bubble text menu */
|
|
212
|
+
export const BUBBLE_TEXT_LIST = [
|
|
213
|
+
'bold',
|
|
214
|
+
'italic',
|
|
215
|
+
'underline',
|
|
216
|
+
'strike',
|
|
217
|
+
'code',
|
|
218
|
+
'link',
|
|
219
|
+
'divider',
|
|
220
|
+
'color',
|
|
221
|
+
'highlight',
|
|
222
|
+
'textAlign',
|
|
223
|
+
];
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export const RESET_CSS = `
|
|
2
|
+
.reactjs-tiptap-editor,
|
|
3
|
+
.dialog-content {
|
|
4
|
+
button,
|
|
5
|
+
input:where([type=button]),
|
|
6
|
+
input:where([type=reset]),
|
|
7
|
+
input:where([type=submit]) {
|
|
8
|
+
-webkit-appearance: button;
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
background-image: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
input,
|
|
14
|
+
optgroup,
|
|
15
|
+
select,
|
|
16
|
+
textarea {
|
|
17
|
+
font-family: inherit;
|
|
18
|
+
font-feature-settings: inherit;
|
|
19
|
+
font-variation-settings: inherit;
|
|
20
|
+
font-size: 100%;
|
|
21
|
+
font-weight: inherit;
|
|
22
|
+
line-height: inherit;
|
|
23
|
+
letter-spacing: inherit;
|
|
24
|
+
color: inherit;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
button {
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
font-feature-settings: inherit;
|
|
30
|
+
font-variation-settings: inherit;
|
|
31
|
+
font-size: 100%;
|
|
32
|
+
font-weight: inherit;
|
|
33
|
+
line-height: inherit;
|
|
34
|
+
letter-spacing: inherit;
|
|
35
|
+
color: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
*,
|
|
39
|
+
::before,
|
|
40
|
+
::after {
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
border-width: 0;
|
|
43
|
+
border-style: solid;
|
|
44
|
+
border-color: hsl(var(--border));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
background-color: hsl(var(--background));
|
|
48
|
+
color: hsl(var(--foreground));
|
|
49
|
+
|
|
50
|
+
hr {
|
|
51
|
+
height: 0;
|
|
52
|
+
color: inherit;
|
|
53
|
+
border-top-width: 1px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
a {
|
|
57
|
+
color: inherit;
|
|
58
|
+
text-decoration: inherit;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
b,
|
|
62
|
+
strong {
|
|
63
|
+
font-weight: bolder;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
code,
|
|
67
|
+
kbd,
|
|
68
|
+
samp,
|
|
69
|
+
pre {
|
|
70
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
|
|
71
|
+
font-feature-settings: normal;
|
|
72
|
+
font-variation-settings: normal;
|
|
73
|
+
font-size: 1em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
table {
|
|
77
|
+
text-indent: 0;
|
|
78
|
+
border-color: inherit;
|
|
79
|
+
border-collapse: collapse;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
input, textarea {
|
|
83
|
+
border-width: 1px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
textarea {
|
|
87
|
+
resize: vertical;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
input::placeholder,
|
|
91
|
+
textarea::placeholder {
|
|
92
|
+
opacity: 1;
|
|
93
|
+
color: #9ca3af;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
button, input, textarea {
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
color: inherit;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
img,
|
|
102
|
+
svg,
|
|
103
|
+
video,
|
|
104
|
+
canvas,
|
|
105
|
+
audio,
|
|
106
|
+
iframe,
|
|
107
|
+
embed,
|
|
108
|
+
object {
|
|
109
|
+
display: block;
|
|
110
|
+
vertical-align: middle;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
img,
|
|
114
|
+
video {
|
|
115
|
+
max-width: 100%;
|
|
116
|
+
height: auto;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
div[data-radix-popper-content-wrapper],
|
|
121
|
+
div[data-tippy-root] {
|
|
122
|
+
*,
|
|
123
|
+
::before,
|
|
124
|
+
::after {
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
border-width: 0;
|
|
127
|
+
border-style: solid;
|
|
128
|
+
border-color: hsl(var(--border));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
background-color: hsl(var(--background));
|
|
132
|
+
color: hsl(var(--foreground));
|
|
133
|
+
|
|
134
|
+
button, input, textarea {
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
color: inherit;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
3
|
+
import { ReactNodeViewRenderer } from '@tiptap/react';
|
|
4
|
+
|
|
5
|
+
import { ActionButton } from 'reactjs-tiptap-editor-pro/components';
|
|
6
|
+
import { getFileTypeIcon } from 'reactjs-tiptap-editor-pro/extensions/Attachment/components/NodeViewAttachment/FileIcon';
|
|
7
|
+
import { NodeViewAttachment } from 'reactjs-tiptap-editor-pro/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment';
|
|
8
|
+
import type { GeneralOptions } from 'reactjs-tiptap-editor-pro/types';
|
|
9
|
+
import { getDatasetAttribute } from 'reactjs-tiptap-editor-pro/utils/dom-dataset';
|
|
10
|
+
import { normalizeFileSize } from 'reactjs-tiptap-editor-pro/utils/file';
|
|
11
|
+
|
|
12
|
+
declare module '@tiptap/core' {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
14
|
+
attachment: {
|
|
15
|
+
setAttachment: (attrs?: unknown) => ReturnType
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AttachmentOptions extends GeneralOptions<AttachmentOptions> {
|
|
21
|
+
/** Function for uploading files */
|
|
22
|
+
upload?: (file: File) => Promise<string>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Attachment = Node.create<AttachmentOptions>({
|
|
26
|
+
name: 'attachment',
|
|
27
|
+
content: '',
|
|
28
|
+
marks: '',
|
|
29
|
+
group: 'block',
|
|
30
|
+
selectable: true,
|
|
31
|
+
atom: true,
|
|
32
|
+
draggable: true,
|
|
33
|
+
|
|
34
|
+
addOptions() {
|
|
35
|
+
return {
|
|
36
|
+
...this.parent?.(),
|
|
37
|
+
HTMLAttributes: {
|
|
38
|
+
class: 'attachment',
|
|
39
|
+
},
|
|
40
|
+
button: ({ editor, t }: any) => ({
|
|
41
|
+
component: ActionButton,
|
|
42
|
+
componentProps: {
|
|
43
|
+
action: () => editor.chain().focus().setAttachment().run(),
|
|
44
|
+
isActive: () => false,
|
|
45
|
+
disabled: false,
|
|
46
|
+
icon: 'Attachment',
|
|
47
|
+
tooltip: t('editor.attachment.tooltip'),
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
parseHTML() {
|
|
54
|
+
return [{ tag: 'div[class=attachment]' }];
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
renderHTML({ HTMLAttributes }) {
|
|
58
|
+
// Destructure and provide fallback defaults
|
|
59
|
+
const {
|
|
60
|
+
url = '',
|
|
61
|
+
fileName = '',
|
|
62
|
+
fileSize = '',
|
|
63
|
+
fileType = '',
|
|
64
|
+
fileExt = '',
|
|
65
|
+
} = HTMLAttributes || {};
|
|
66
|
+
|
|
67
|
+
// Validate attributes and merge safely
|
|
68
|
+
const mergedAttributes = mergeAttributes(
|
|
69
|
+
// @ts-expect-error
|
|
70
|
+
this.options.HTMLAttributes || {},
|
|
71
|
+
HTMLAttributes || {},
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
// Return the structured array
|
|
75
|
+
return [
|
|
76
|
+
'div',
|
|
77
|
+
mergedAttributes,
|
|
78
|
+
url
|
|
79
|
+
? [
|
|
80
|
+
'a',
|
|
81
|
+
{ href: url || '#' },
|
|
82
|
+
[
|
|
83
|
+
'span',
|
|
84
|
+
{ class: 'attachment__icon' },
|
|
85
|
+
getFileTypeIcon(fileType, true),
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
'span',
|
|
89
|
+
{ class: 'attachment__text' },
|
|
90
|
+
`${fileName}.${fileExt} (${normalizeFileSize(fileSize)})`,
|
|
91
|
+
],
|
|
92
|
+
]
|
|
93
|
+
: ['div', { class: 'attachment__placeholder' }],
|
|
94
|
+
];
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
addAttributes() {
|
|
98
|
+
return {
|
|
99
|
+
fileName: {
|
|
100
|
+
default: null,
|
|
101
|
+
parseHTML: getDatasetAttribute('filename'),
|
|
102
|
+
},
|
|
103
|
+
fileSize: {
|
|
104
|
+
default: null,
|
|
105
|
+
parseHTML: getDatasetAttribute('filesize'),
|
|
106
|
+
},
|
|
107
|
+
fileType: {
|
|
108
|
+
default: null,
|
|
109
|
+
parseHTML: getDatasetAttribute('filetype'),
|
|
110
|
+
},
|
|
111
|
+
fileExt: {
|
|
112
|
+
default: null,
|
|
113
|
+
parseHTML: getDatasetAttribute('fileext'),
|
|
114
|
+
},
|
|
115
|
+
url: {
|
|
116
|
+
default: null,
|
|
117
|
+
parseHTML: getDatasetAttribute('url'),
|
|
118
|
+
},
|
|
119
|
+
hasTrigger: {
|
|
120
|
+
default: false,
|
|
121
|
+
parseHTML: element => getDatasetAttribute('hastrigger')(element) === 'true',
|
|
122
|
+
},
|
|
123
|
+
error: {
|
|
124
|
+
default: null,
|
|
125
|
+
parseHTML: getDatasetAttribute('error'),
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
addCommands() {
|
|
131
|
+
return {
|
|
132
|
+
setAttachment:
|
|
133
|
+
(attrs = {}) =>
|
|
134
|
+
({ chain }) => {
|
|
135
|
+
// @ts-expect-error
|
|
136
|
+
return chain().insertContent({ type: this.name, attrs }).run();
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
addNodeView() {
|
|
142
|
+
return ReactNodeViewRenderer(NodeViewAttachment);
|
|
143
|
+
},
|
|
144
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { LucideAudioLines, LucideFile, LucideImage, LucideSheet, LucideTableProperties, LucideVideo } from 'lucide-react';
|
|
2
|
+
// import ReactDOMServer from 'react-dom/server';
|
|
3
|
+
|
|
4
|
+
import { ExportPdf } from 'reactjs-tiptap-editor-pro/components/icons/ExportPdf';
|
|
5
|
+
import ExportWord from 'reactjs-tiptap-editor-pro/components/icons/ExportWord';
|
|
6
|
+
import { FileIconString } from 'reactjs-tiptap-editor-pro/extensions/Attachment/components/NodeViewAttachment/FileIconString';
|
|
7
|
+
import { normalizeFileType } from 'reactjs-tiptap-editor-pro/utils/file';
|
|
8
|
+
|
|
9
|
+
function iconToProseMirror(typeIcon: any) {
|
|
10
|
+
// Render SVG as a static string
|
|
11
|
+
const svgString = FileIconString[typeIcon];
|
|
12
|
+
|
|
13
|
+
// Parse the string into ProseMirror-compatible structure
|
|
14
|
+
const parser = new DOMParser();
|
|
15
|
+
const svgDocument = parser.parseFromString(svgString, 'image/svg+xml');
|
|
16
|
+
const svgElement = svgDocument.documentElement;
|
|
17
|
+
|
|
18
|
+
const iconToReturn = [
|
|
19
|
+
'svg',
|
|
20
|
+
{
|
|
21
|
+
...Array.from(svgElement.attributes).reduce((acc: any, attr: any) => {
|
|
22
|
+
acc[attr.name] = attr.value;
|
|
23
|
+
return acc;
|
|
24
|
+
}, {}),
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
Array.from(svgElement.childNodes).forEach((child: any) => {
|
|
29
|
+
if (child.nodeType === 1) {
|
|
30
|
+
// Element node
|
|
31
|
+
const childElement = [
|
|
32
|
+
child.tagName.toLowerCase(),
|
|
33
|
+
Array.from(child.attributes).reduce((acc: any, attr: any) => {
|
|
34
|
+
acc[attr.name] = attr.value;
|
|
35
|
+
return acc;
|
|
36
|
+
}, {}),
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
if (child.textContent) {
|
|
40
|
+
childElement.push(child.textContent);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
iconToReturn.push(childElement);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return iconToReturn;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// React components for rendering directly in JSX
|
|
51
|
+
const icons = {
|
|
52
|
+
audio: <LucideAudioLines />,
|
|
53
|
+
video: <LucideVideo />,
|
|
54
|
+
file: <LucideFile />,
|
|
55
|
+
image: <LucideImage />,
|
|
56
|
+
pdf: <ExportPdf />,
|
|
57
|
+
word: <ExportWord />,
|
|
58
|
+
excel: <LucideSheet />,
|
|
59
|
+
ppt: <LucideTableProperties />,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export function getFileTypeIcon(fileType: string, forProseMirror = false) {
|
|
63
|
+
const type = normalizeFileType(fileType);
|
|
64
|
+
|
|
65
|
+
const icon = icons[type] || <></>;
|
|
66
|
+
|
|
67
|
+
// Return ProseMirror-compatible structure or React component
|
|
68
|
+
return forProseMirror ? iconToProseMirror(type) : icon;
|
|
69
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const FileIconString = {
|
|
2
|
+
audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
|
|
3
|
+
video: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',
|
|
4
|
+
file: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',
|
|
5
|
+
image: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
|
|
6
|
+
pdf: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
|
|
7
|
+
<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>
|
|
8
|
+
<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>
|
|
9
|
+
</svg>`,
|
|
10
|
+
word: `<svg
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
width="1em"
|
|
13
|
+
height="1em"
|
|
14
|
+
className="icon"
|
|
15
|
+
viewBox="0 0 1024 1024"
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
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"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
fill="currentColor"
|
|
23
|
+
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"
|
|
24
|
+
/>
|
|
25
|
+
</svg>`,
|
|
26
|
+
excel: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',
|
|
27
|
+
ppt: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
|
|
28
|
+
} as any;
|