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.
- package/lib/ColorPicker-MEAh4MhG.js +28181 -0
- package/lib/ColorPicker-ZncOwjAP.cjs +142 -0
- package/lib/extension-bundle.cjs +133 -0
- package/lib/extension-bundle.d.cts +947 -0
- package/lib/extension-bundle.d.ts +947 -0
- package/lib/extension-bundle.js +23921 -0
- package/lib/index.cjs +140 -0
- package/lib/index.d.cts +513 -0
- package/lib/index.d.ts +513 -0
- package/lib/index.js +3700 -0
- package/lib/locale-bundle-DiqW5jwb.cjs +1 -0
- package/lib/locale-bundle-DxCAtRDI.js +1487 -0
- package/lib/locale-bundle.cjs +1 -0
- package/lib/locale-bundle.d.cts +1140 -0
- package/lib/locale-bundle.d.ts +1140 -0
- package/lib/locale-bundle.js +9 -0
- package/lib/lucide-react-BFZtMawV.js +30462 -0
- package/lib/lucide-react-CMPhLW1m.cjs +7851 -0
- package/lib/style.css +1 -0
- package/package.json +58 -5
- package/src/components/ActionButton.tsx +0 -103
- package/src/components/ActionMenuButton.tsx +0 -76
- package/src/components/BubbleMenu.tsx +0 -93
- package/src/components/CharactorCount.tsx +0 -50
- package/src/components/ColorPicker.tsx +0 -272
- package/src/components/RichTextEditor.tsx +0 -212
- package/src/components/SizeSetter/SizeSetter.tsx +0 -102
- package/src/components/Toolbar.tsx +0 -108
- package/src/components/icons/Activity.tsx +0 -19
- package/src/components/icons/Animas.tsx +0 -24
- package/src/components/icons/AspectRatio.tsx +0 -13
- package/src/components/icons/Blockquote.tsx +0 -17
- package/src/components/icons/ColumnAddLeft.tsx +0 -7
- package/src/components/icons/ColumnAddRight.tsx +0 -7
- package/src/components/icons/DeleteColumn.tsx +0 -26
- package/src/components/icons/DeleteRow.tsx +0 -26
- package/src/components/icons/Direction.tsx +0 -7
- package/src/components/icons/Excalidraw.tsx +0 -7
- package/src/components/icons/ExportPdf.tsx +0 -8
- package/src/components/icons/ExportWord.tsx +0 -24
- package/src/components/icons/FileWordOutline.tsx +0 -13
- package/src/components/icons/Flag.tsx +0 -19
- package/src/components/icons/Food.tsx +0 -20
- package/src/components/icons/GIfIcon.tsx +0 -10
- package/src/components/icons/Icon.tsx +0 -30
- package/src/components/icons/ImportWord.tsx +0 -23
- package/src/components/icons/LeftToRight.tsx +0 -7
- package/src/components/icons/LineHeight.tsx +0 -13
- package/src/components/icons/MenuDown.tsx +0 -24
- package/src/components/icons/Mermaid.tsx +0 -13
- package/src/components/icons/NoFill.tsx +0 -7
- package/src/components/icons/Object.tsx +0 -24
- package/src/components/icons/RightToLeft.tsx +0 -7
- package/src/components/icons/SizeL.tsx +0 -9
- package/src/components/icons/SizeM.tsx +0 -13
- package/src/components/icons/SizeS.tsx +0 -13
- package/src/components/icons/Symbol.tsx +0 -19
- package/src/components/icons/Travel.tsx +0 -24
- package/src/components/icons/Twitter.tsx +0 -7
- package/src/components/icons/icons.ts +0 -212
- package/src/components/icons/index.ts +0 -12
- package/src/components/index.ts +0 -9
- package/src/components/menus/bubble.ts +0 -395
- package/src/components/menus/components/BubbleMenuContent.tsx +0 -15
- package/src/components/menus/components/BubbleMenuDrawer.tsx +0 -128
- package/src/components/menus/components/BubbleMenuExcalidraw.tsx +0 -91
- package/src/components/menus/components/BubbleMenuIframe.tsx +0 -143
- package/src/components/menus/components/BubbleMenuKatex.tsx +0 -136
- package/src/components/menus/components/BubbleMenuLink.tsx +0 -99
- package/src/components/menus/components/BubbleMenuMedia.tsx +0 -235
- package/src/components/menus/components/BubbleMenuMermaid.tsx +0 -128
- package/src/components/menus/components/BubbleMenuText.tsx +0 -102
- package/src/components/menus/components/BubbleMenuTwitter.tsx +0 -91
- package/src/components/menus/components/ColumnsBubbleMenu.tsx +0 -59
- package/src/components/menus/components/ContentMenu.tsx +0 -396
- package/src/components/menus/components/TableBubbleMenu.tsx +0 -362
- package/src/components/menus/index.ts +0 -7
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/dialog.tsx +0 -128
- package/src/components/ui/dropdown-menu.tsx +0 -203
- package/src/components/ui/emoji-picker.tsx +0 -166
- package/src/components/ui/index.ts +0 -14
- package/src/components/ui/input.tsx +0 -25
- package/src/components/ui/label.tsx +0 -26
- package/src/components/ui/popover.tsx +0 -31
- package/src/components/ui/select.tsx +0 -162
- package/src/components/ui/separator.tsx +0 -31
- package/src/components/ui/switch.tsx +0 -29
- package/src/components/ui/tabs.tsx +0 -55
- package/src/components/ui/textarea.tsx +0 -24
- package/src/components/ui/toast.tsx +0 -129
- package/src/components/ui/toaster.tsx +0 -44
- package/src/components/ui/toggle.tsx +0 -45
- package/src/components/ui/tooltip.tsx +0 -30
- package/src/components/ui/use-toast.ts +0 -197
- package/src/constants/index.ts +0 -223
- package/src/constants/resetCSS.ts +0 -139
- package/src/extension-bundle.ts +0 -2
- package/src/extensions/Attachment/Attachment.ts +0 -144
- package/src/extensions/Attachment/components/NodeViewAttachment/FileIcon.tsx +0 -69
- package/src/extensions/Attachment/components/NodeViewAttachment/FileIconString.ts +0 -28
- package/src/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.tsx +0 -155
- package/src/extensions/Attachment/components/NodeViewAttachment/index.module.scss +0 -23
- package/src/extensions/Attachment/index.ts +0 -1
- package/src/extensions/BaseKit.ts +0 -253
- package/src/extensions/Blockquote/Blockquote.ts +0 -31
- package/src/extensions/Blockquote/index.ts +0 -1
- package/src/extensions/Bold/Bold.ts +0 -26
- package/src/extensions/Bold/index.ts +0 -1
- package/src/extensions/BulletList/BulletList.ts +0 -28
- package/src/extensions/BulletList/index.ts +0 -1
- package/src/extensions/Clear/Clear.ts +0 -24
- package/src/extensions/Clear/index.ts +0 -1
- package/src/extensions/Code/Code.ts +0 -26
- package/src/extensions/Code/index.ts +0 -1
- package/src/extensions/CodeBlock/CodeBlock.ts +0 -54
- package/src/extensions/CodeBlock/components/CodeBlockActiveButton.tsx +0 -66
- package/src/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.tsx +0 -89
- package/src/extensions/CodeBlock/components/NodeViewCodeBlock/index.module.scss +0 -81
- package/src/extensions/CodeBlock/highlighter.ts +0 -132
- package/src/extensions/CodeBlock/index.ts +0 -1
- package/src/extensions/CodeBlock/shiki-plugin.ts +0 -213
- package/src/extensions/Color/Color.ts +0 -52
- package/src/extensions/Color/components/ColorActionButton.tsx +0 -104
- package/src/extensions/Color/index.ts +0 -1
- package/src/extensions/Document/Document.ts +0 -8
- package/src/extensions/Document/index.ts +0 -1
- package/src/extensions/Drawer/Drawer.ts +0 -177
- package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.module.scss +0 -85
- package/src/extensions/Drawer/components/ControlDrawer/ControlDrawer.tsx +0 -598
- package/src/extensions/Drawer/components/ControlDrawer/icon.tsx +0 -500
- package/src/extensions/Drawer/components/DrawerActiveButton.tsx +0 -239
- package/src/extensions/Drawer/components/EditDrawerBlock.tsx +0 -238
- package/src/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.tsx +0 -260
- package/src/extensions/Drawer/index.ts +0 -1
- package/src/extensions/Emoji/Emoji.ts +0 -146
- package/src/extensions/Emoji/components/EmojiList/EmojiList.tsx +0 -103
- package/src/extensions/Emoji/components/EmojiList/emojis.ts +0 -1858
- package/src/extensions/Emoji/components/EmojiPicker/EmojiPicker.tsx +0 -61
- package/src/extensions/Emoji/index.ts +0 -1
- package/src/extensions/Excalidraw/Excalidraw.ts +0 -123
- package/src/extensions/Excalidraw/components/ExcalidrawActiveButton.tsx +0 -138
- package/src/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.tsx +0 -178
- package/src/extensions/Excalidraw/components/NodeViewExcalidraw/index.module.scss +0 -43
- package/src/extensions/Excalidraw/index.ts +0 -1
- package/src/extensions/ExportPdf/ExportPdf.ts +0 -25
- package/src/extensions/ExportPdf/index.ts +0 -1
- package/src/extensions/ExportWord/ExportWord.ts +0 -87
- package/src/extensions/ExportWord/index.ts +0 -1
- package/src/extensions/FontFamily/FontFamily.ts +0 -64
- package/src/extensions/FontFamily/components/FontFamilyButton.tsx +0 -97
- package/src/extensions/FontFamily/index.ts +0 -1
- package/src/extensions/FontSize/FontSize.ts +0 -119
- package/src/extensions/FontSize/components/FontSizeMenuButton.tsx +0 -84
- package/src/extensions/FontSize/index.ts +0 -1
- package/src/extensions/FormatPainter/FormatPainter.ts +0 -121
- package/src/extensions/FormatPainter/index.ts +0 -1
- package/src/extensions/Heading/Heading.ts +0 -57
- package/src/extensions/Heading/components/HeadingButton.tsx +0 -96
- package/src/extensions/Heading/index.ts +0 -1
- package/src/extensions/Highlight/Highlight.ts +0 -36
- package/src/extensions/Highlight/components/HighlightActionButton.tsx +0 -108
- package/src/extensions/Highlight/index.ts +0 -1
- package/src/extensions/History/History.ts +0 -39
- package/src/extensions/History/components/HistoryActionButton.tsx +0 -74
- package/src/extensions/History/index.ts +0 -1
- package/src/extensions/HorizontalRule/HorizontalRule.ts +0 -42
- package/src/extensions/HorizontalRule/index.ts +0 -1
- package/src/extensions/Iframe/Iframe.ts +0 -140
- package/src/extensions/Iframe/components/IframeNodeView.tsx +0 -92
- package/src/extensions/Iframe/components/index.module.scss +0 -40
- package/src/extensions/Iframe/embed.ts +0 -487
- package/src/extensions/Iframe/index.ts +0 -1
- package/src/extensions/Image/Image.ts +0 -303
- package/src/extensions/Image/components/ActionImageButton.tsx +0 -186
- package/src/extensions/Image/components/ImageCropper.tsx +0 -198
- package/src/extensions/Image/components/ImageView.tsx +0 -271
- package/src/extensions/Image/index.ts +0 -1
- package/src/extensions/Image/store.ts +0 -15
- package/src/extensions/ImageGif/ImageGif.ts +0 -176
- package/src/extensions/ImageGif/components/ImageGifActionButton.tsx +0 -138
- package/src/extensions/ImageGif/components/ImageGifView.tsx +0 -260
- package/src/extensions/ImageGif/index.ts +0 -1
- package/src/extensions/ImportWord/ImportWord.ts +0 -52
- package/src/extensions/ImportWord/components/ImportWordButton.tsx +0 -151
- package/src/extensions/ImportWord/index.ts +0 -1
- package/src/extensions/Indent/Indent.ts +0 -110
- package/src/extensions/Indent/index.ts +0 -1
- package/src/extensions/Italic/Italic.ts +0 -29
- package/src/extensions/Italic/index.ts +0 -1
- package/src/extensions/Katex/Katex.ts +0 -109
- package/src/extensions/Katex/components/KatexActiveButton.tsx +0 -117
- package/src/extensions/Katex/components/KatexWrapper.tsx +0 -53
- package/src/extensions/Katex/index.ts +0 -1
- package/src/extensions/LineHeight/LineHeight.ts +0 -76
- package/src/extensions/LineHeight/components/LineHeightDropdown.tsx +0 -93
- package/src/extensions/LineHeight/index.ts +0 -1
- package/src/extensions/Link/Link.ts +0 -92
- package/src/extensions/Link/components/LinkEditBlock.tsx +0 -110
- package/src/extensions/Link/components/LinkEditPopover.tsx +0 -46
- package/src/extensions/Link/components/LinkViewBlock.tsx +0 -54
- package/src/extensions/Link/index.ts +0 -1
- package/src/extensions/ListItem/ListItem.ts +0 -1
- package/src/extensions/ListItem/index.ts +0 -1
- package/src/extensions/Mention/Mention.ts +0 -100
- package/src/extensions/Mention/components/NodeViewMentionList/NodeViewMentionList.tsx +0 -94
- package/src/extensions/Mention/components/NodeViewMentionList/index.module.scss +0 -38
- package/src/extensions/Mention/index.ts +0 -1
- package/src/extensions/Mermaid/Mermaid.ts +0 -177
- package/src/extensions/Mermaid/components/EditMermaidBlock.tsx +0 -155
- package/src/extensions/Mermaid/components/MermaidActiveButton.tsx +0 -151
- package/src/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.tsx +0 -260
- package/src/extensions/Mermaid/index.ts +0 -1
- package/src/extensions/MoreMark/MoreMark.ts +0 -102
- package/src/extensions/MoreMark/components/ActionMoreButton.tsx +0 -97
- package/src/extensions/MoreMark/index.ts +0 -1
- package/src/extensions/MultiColumn/Column.ts +0 -36
- package/src/extensions/MultiColumn/MultiColumn.ts +0 -111
- package/src/extensions/MultiColumn/components/ColumnActionButton.ts +0 -22
- package/src/extensions/MultiColumn/index.ts +0 -3
- package/src/extensions/OrderedList/OrderedList.ts +0 -28
- package/src/extensions/OrderedList/index.ts +0 -1
- package/src/extensions/SearchAndReplace/SearchAndReplace.ts +0 -395
- package/src/extensions/SearchAndReplace/components/SearchAndReplaceButton.tsx +0 -190
- package/src/extensions/SearchAndReplace/index.ts +0 -1
- package/src/extensions/Selection/Selection.ts +0 -32
- package/src/extensions/Selection/index.ts +0 -1
- package/src/extensions/SlashCommand/SlashCommand.ts +0 -255
- package/src/extensions/SlashCommand/components/CommandsList.tsx +0 -180
- package/src/extensions/SlashCommand/groups.ts +0 -183
- package/src/extensions/SlashCommand/index.ts +0 -1
- package/src/extensions/SlashCommand/types.ts +0 -24
- package/src/extensions/Strike/Strike.ts +0 -26
- package/src/extensions/Strike/index.ts +0 -1
- package/src/extensions/Subscript/Subscript.ts +0 -88
- package/src/extensions/Subscript/index.ts +0 -1
- package/src/extensions/Table/Cell.ts +0 -131
- package/src/extensions/Table/Header.ts +0 -93
- package/src/extensions/Table/Row.ts +0 -8
- package/src/extensions/Table/Table.ts +0 -60
- package/src/extensions/Table/cell-background.ts +0 -112
- package/src/extensions/Table/components/CreateTablePopover.tsx +0 -132
- package/src/extensions/Table/components/TableActionButton.tsx +0 -42
- package/src/extensions/Table/index.ts +0 -6
- package/src/extensions/Table/utils.ts +0 -352
- package/src/extensions/TableOfContent/TableOfContent.ts +0 -124
- package/src/extensions/TableOfContent/components/NodeViewTableOfContent.tsx +0 -116
- package/src/extensions/TableOfContent/components/TableOfContentActionButton.tsx +0 -27
- package/src/extensions/TableOfContent/components/index.module.scss +0 -40
- package/src/extensions/TableOfContent/index.ts +0 -1
- package/src/extensions/TaskList/TaskList.ts +0 -46
- package/src/extensions/TaskList/index.ts +0 -1
- package/src/extensions/TextAlign/TextAlign.ts +0 -68
- package/src/extensions/TextAlign/components/TextAlignMenuButton.tsx +0 -103
- package/src/extensions/TextAlign/index.ts +0 -1
- package/src/extensions/TextBubble/TextBubble.ts +0 -22
- package/src/extensions/TextBubble/components/TextDropdown.tsx +0 -146
- package/src/extensions/TextBubble/index.ts +0 -1
- package/src/extensions/TextDirection/TextDirection.ts +0 -97
- package/src/extensions/TextDirection/components/TextDirectionButton.tsx +0 -103
- package/src/extensions/TextDirection/index.ts +0 -1
- package/src/extensions/TrailingNode/TrailingNode.ts +0 -71
- package/src/extensions/TrailingNode/index.ts +0 -1
- package/src/extensions/Twitter/Twitter.ts +0 -161
- package/src/extensions/Twitter/components/FormEditLinkTwitter.tsx +0 -68
- package/src/extensions/Twitter/components/NodeViewTweet.tsx +0 -30
- package/src/extensions/Twitter/components/TwitterActiveButton.tsx +0 -41
- package/src/extensions/Twitter/index.ts +0 -1
- package/src/extensions/UnderLine/Underline.ts +0 -30
- package/src/extensions/UnderLine/index.ts +0 -1
- package/src/extensions/Video/Video.ts +0 -204
- package/src/extensions/Video/components/ActiveVideoButton.tsx +0 -191
- package/src/extensions/Video/index.ts +0 -1
- package/src/extensions/Video/store.ts +0 -15
- package/src/extensions/index.ts +0 -122
- package/src/hooks/useActive.tsx +0 -24
- package/src/hooks/useAttributes.tsx +0 -45
- package/src/hooks/useCopy.tsx +0 -20
- package/src/hooks/useEditorState.tsx +0 -23
- package/src/hooks/useExtension.tsx +0 -29
- package/src/index.ts +0 -8
- package/src/lib/utils.ts +0 -7
- package/src/locale-bundle.ts +0 -3
- package/src/locales/en.ts +0 -173
- package/src/locales/hu.ts +0 -173
- package/src/locales/index.tsx +0 -163
- package/src/locales/pt-br.ts +0 -173
- package/src/locales/vi.ts +0 -173
- package/src/locales/zh-cn.ts +0 -173
- package/src/plugins/DragHandle/index.ts +0 -375
- package/src/plugins/DragHandle/range.ts +0 -114
- package/src/plugins/DragHandle/utils.ts +0 -80
- package/src/plugins/image-upload.ts +0 -160
- package/src/store/ProviderRichText.tsx +0 -53
- package/src/store/editableEditor.ts +0 -15
- package/src/store/fast-context.tsx +0 -70
- package/src/store/store.ts +0 -35
- package/src/styles/ProseMirror.scss +0 -176
- package/src/styles/columns.scss +0 -23
- package/src/styles/editor.scss +0 -411
- package/src/styles/global.scss +0 -87
- package/src/styles/index.scss +0 -5
- package/src/styles/mention.scss +0 -6
- package/src/theme/theme.ts +0 -15
- package/src/types.ts +0 -271
- package/src/utils/_event.ts +0 -55
- package/src/utils/color.ts +0 -67
- package/src/utils/columns.ts +0 -142
- package/src/utils/customEvents/customEvents.ts +0 -18
- package/src/utils/customEvents/events.constant.ts +0 -11
- package/src/utils/delete-node.ts +0 -46
- package/src/utils/dom-dataset.ts +0 -121
- package/src/utils/download.ts +0 -17
- package/src/utils/dynamicCSS.ts +0 -192
- package/src/utils/editor-container-size.ts +0 -28
- package/src/utils/file.ts +0 -112
- package/src/utils/getRenderContainer.ts +0 -41
- package/src/utils/indent.ts +0 -99
- package/src/utils/is-mobile.ts +0 -57
- package/src/utils/json.ts +0 -18
- package/src/utils/line-height.ts +0 -109
- package/src/utils/lru-cache.ts +0 -145
- package/src/utils/mitt.ts +0 -114
- package/src/utils/node.ts +0 -92
- package/src/utils/pdf.ts +0 -72
- package/src/utils/plateform.ts +0 -49
- package/src/utils/shortId.ts +0 -5
- package/src/utils/storage.ts +0 -18
- package/src/utils/utils.ts +0 -71
- package/src/vite-env.d.ts +0 -3
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { Editor } from '@tiptap/core';
|
|
4
|
-
import { isActive } from '@tiptap/core';
|
|
5
|
-
import { TextSelection } from '@tiptap/pm/state';
|
|
6
|
-
import { BubbleMenu } from '@tiptap/react';
|
|
7
|
-
import type { GetReferenceClientRect } from 'tippy.js';
|
|
8
|
-
import { sticky } from 'tippy.js';
|
|
9
|
-
|
|
10
|
-
import { ActionButton, type ActionButtonProps, getBubbleText, ItemA, Separator } from 'reactjs-tiptap-editor-pro/components';
|
|
11
|
-
import HighlightActionButton from 'reactjs-tiptap-editor-pro/extensions/Highlight/components/HighlightActionButton';
|
|
12
|
-
import {
|
|
13
|
-
isColumnGripSelected,
|
|
14
|
-
isRowGripSelected,
|
|
15
|
-
} from 'reactjs-tiptap-editor-pro/extensions/Table/utils';
|
|
16
|
-
import { useLocale } from 'reactjs-tiptap-editor-pro/locales';
|
|
17
|
-
import { type ShouldShowProps } from 'reactjs-tiptap-editor-pro/types';
|
|
18
|
-
|
|
19
|
-
import BubbleMenuContent from './BubbleMenuContent';
|
|
20
|
-
|
|
21
|
-
export interface TableBubbleMenuProps {
|
|
22
|
-
editor: Editor;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
actions?: ActionButtonProps[];
|
|
25
|
-
items?: string[]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function TableRowBubbleMenu ({ editor, disabled }: TableBubbleMenuProps) {
|
|
29
|
-
const { t } = useLocale();
|
|
30
|
-
const shouldShow = useCallback(
|
|
31
|
-
({ view, state, from }: ShouldShowProps) => {
|
|
32
|
-
if (!state || !from) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return isRowGripSelected({ editor, view, state, from });
|
|
37
|
-
},
|
|
38
|
-
[editor]
|
|
39
|
-
);
|
|
40
|
-
function onAddRowAbove() {
|
|
41
|
-
editor.chain().focus().addRowBefore().run();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function onAddRowBelow() {
|
|
45
|
-
editor.chain().focus().addRowAfter().run();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function onDeleteRow() {
|
|
49
|
-
editor.chain().focus().deleteRow().run();
|
|
50
|
-
}
|
|
51
|
-
if(disabled) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return (
|
|
55
|
-
<BubbleMenu
|
|
56
|
-
editor={editor}
|
|
57
|
-
pluginKey="tableRowMenu"
|
|
58
|
-
shouldShow={shouldShow}
|
|
59
|
-
updateDelay={0}
|
|
60
|
-
tippyOptions={{
|
|
61
|
-
placement: 'left',
|
|
62
|
-
offset: [0, 15],
|
|
63
|
-
popperOptions: {
|
|
64
|
-
modifiers: [{ name: 'flip', enabled: false }],
|
|
65
|
-
},
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
<BubbleMenuContent vertical>
|
|
69
|
-
<ActionButton
|
|
70
|
-
action={onAddRowAbove}
|
|
71
|
-
disabled={!editor?.can().addRowBefore?.()}
|
|
72
|
-
icon="BetweenVerticalEnd"
|
|
73
|
-
tooltip={t('editor.table.menu.insertRowAbove')}
|
|
74
|
-
tooltip-options={{
|
|
75
|
-
sideOffset: 15,
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
|
|
79
|
-
<ActionButton
|
|
80
|
-
action={onAddRowBelow}
|
|
81
|
-
disabled={!editor?.can()?.addRowAfter?.()}
|
|
82
|
-
icon="BetweenVerticalStart"
|
|
83
|
-
tooltip={t('editor.table.menu.insertRowBelow')}
|
|
84
|
-
tooltip-options={{
|
|
85
|
-
sideOffset: 15,
|
|
86
|
-
}}
|
|
87
|
-
/>
|
|
88
|
-
|
|
89
|
-
<ActionButton
|
|
90
|
-
action={onDeleteRow}
|
|
91
|
-
disabled={!editor?.can()?.deleteRow?.()}
|
|
92
|
-
icon="DeleteRow"
|
|
93
|
-
tooltip={t('editor.table.menu.deleteRow')}
|
|
94
|
-
tooltip-options={{
|
|
95
|
-
sideOffset: 15,
|
|
96
|
-
}}
|
|
97
|
-
/>
|
|
98
|
-
</BubbleMenuContent>
|
|
99
|
-
</BubbleMenu>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function TableColBubbleMenu({ editor, disabled }: TableBubbleMenuProps) {
|
|
104
|
-
const { t } = useLocale();
|
|
105
|
-
const shouldShow = useCallback(
|
|
106
|
-
({ view, state, from }: ShouldShowProps) => {
|
|
107
|
-
if (!state) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return isColumnGripSelected({ editor, view, state, from: from || 0 });
|
|
112
|
-
},
|
|
113
|
-
[editor]
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
function onAddColumnBefore() {
|
|
117
|
-
editor.chain().focus().addColumnBefore().run();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function onAddColumnAfter() {
|
|
121
|
-
editor.chain().focus().addColumnAfter().run();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function onDeleteColumn() {
|
|
125
|
-
editor.chain().focus().deleteColumn().run();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if(disabled) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return (
|
|
133
|
-
<BubbleMenu
|
|
134
|
-
editor={editor}
|
|
135
|
-
pluginKey="tableColumnMenu"
|
|
136
|
-
shouldShow={shouldShow}
|
|
137
|
-
updateDelay={0}
|
|
138
|
-
tippyOptions={{
|
|
139
|
-
offset: [0, 15],
|
|
140
|
-
popperOptions: {
|
|
141
|
-
modifiers: [{ name: 'flip', enabled: false }],
|
|
142
|
-
},
|
|
143
|
-
}}
|
|
144
|
-
>
|
|
145
|
-
<BubbleMenuContent>
|
|
146
|
-
<ActionButton
|
|
147
|
-
action={onAddColumnBefore}
|
|
148
|
-
disabled={!editor?.can()?.addColumnBefore?.()}
|
|
149
|
-
icon="BetweenHorizonalEnd"
|
|
150
|
-
tooltip={t('editor.table.menu.insertColumnBefore')}
|
|
151
|
-
tooltip-options={{
|
|
152
|
-
sideOffset: 15,
|
|
153
|
-
}}
|
|
154
|
-
/>
|
|
155
|
-
|
|
156
|
-
<ActionButton
|
|
157
|
-
action={onAddColumnAfter}
|
|
158
|
-
disabled={!editor?.can()?.addColumnAfter?.()}
|
|
159
|
-
icon="BetweenHorizonalStart"
|
|
160
|
-
tooltip={t('editor.table.menu.insertColumnAfter')}
|
|
161
|
-
tooltip-options={{
|
|
162
|
-
sideOffset: 15,
|
|
163
|
-
}}
|
|
164
|
-
/>
|
|
165
|
-
|
|
166
|
-
<ActionButton
|
|
167
|
-
action={onDeleteColumn}
|
|
168
|
-
disabled={!editor?.can().deleteColumn?.()}
|
|
169
|
-
icon="DeleteColumn"
|
|
170
|
-
tooltip={t('editor.table.menu.deleteColumn')}
|
|
171
|
-
tooltip-options={{
|
|
172
|
-
sideOffset: 15,
|
|
173
|
-
}}
|
|
174
|
-
/>
|
|
175
|
-
</BubbleMenuContent>
|
|
176
|
-
</BubbleMenu>
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function TableMainBubbleMenu({ editor, disabled, actions, ...props }: TableBubbleMenuProps) {
|
|
181
|
-
|
|
182
|
-
const shouldSelectionShow = ({ editor, view, state, from }: ShouldShowProps) => {
|
|
183
|
-
const { selection } = editor.view.state;
|
|
184
|
-
const { $from, to } = selection;
|
|
185
|
-
|
|
186
|
-
// check content select length is not empty
|
|
187
|
-
if ($from.pos === to) {
|
|
188
|
-
return false;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (!state || !from) {
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return (
|
|
196
|
-
selection instanceof TextSelection ||
|
|
197
|
-
isRowGripSelected({ editor, view, state, from }) ||
|
|
198
|
-
isColumnGripSelected({ editor, view, state, from })
|
|
199
|
-
);
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
const shouldActiveShow = ({ editor }: { editor: Editor }) => {
|
|
203
|
-
return isActive(editor.view.state, 'table');
|
|
204
|
-
};
|
|
205
|
-
const shouldShow = (showProps: ShouldShowProps) => {
|
|
206
|
-
return shouldActiveShow(showProps) && !shouldSelectionShow(showProps);
|
|
207
|
-
};
|
|
208
|
-
const { t, lang } = useLocale();
|
|
209
|
-
|
|
210
|
-
function onMergeCell() {
|
|
211
|
-
editor.chain().focus().mergeCells().run();
|
|
212
|
-
}
|
|
213
|
-
function onSplitCell() {
|
|
214
|
-
editor?.chain().focus().splitCell().run();
|
|
215
|
-
}
|
|
216
|
-
function onDeleteTable() {
|
|
217
|
-
editor.chain().focus().deleteTable().run();
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function onSetCellBackground(color: string) {
|
|
221
|
-
editor.chain().focus().setTableCellBackground(color).run();
|
|
222
|
-
}
|
|
223
|
-
const getReferenceClientRect: GetReferenceClientRect = () => {
|
|
224
|
-
const {
|
|
225
|
-
view,
|
|
226
|
-
state: {
|
|
227
|
-
selection: { from },
|
|
228
|
-
},
|
|
229
|
-
} = editor;
|
|
230
|
-
|
|
231
|
-
const node = view.domAtPos(from).node as HTMLElement;
|
|
232
|
-
if (!node) {
|
|
233
|
-
return new DOMRect(-1000, -1000, 0, 0);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const tableWrapper = node?.closest?.('.tableWrapper');
|
|
237
|
-
if (!tableWrapper) {
|
|
238
|
-
return new DOMRect(-1000, -1000, 0, 0);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const rect = tableWrapper.getBoundingClientRect();
|
|
242
|
-
|
|
243
|
-
return rect;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const items = useMemo(() => {
|
|
247
|
-
if (disabled || !editor) {
|
|
248
|
-
return [];
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
return getBubbleText(editor, t, props.items || []);
|
|
252
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
253
|
-
}, [disabled, editor, props.items, lang, t]);
|
|
254
|
-
|
|
255
|
-
if(disabled) {
|
|
256
|
-
return null;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return (
|
|
260
|
-
<BubbleMenu
|
|
261
|
-
editor={editor}
|
|
262
|
-
pluginKey="table"
|
|
263
|
-
shouldShow={shouldShow}
|
|
264
|
-
updateDelay={0}
|
|
265
|
-
tippyOptions={{
|
|
266
|
-
offset: [0, 15],
|
|
267
|
-
popperOptions: {
|
|
268
|
-
modifiers: [{ name: 'flip', enabled: false }],
|
|
269
|
-
},
|
|
270
|
-
maxWidth: 'auto',
|
|
271
|
-
getReferenceClientRect,
|
|
272
|
-
plugins: [sticky],
|
|
273
|
-
sticky: 'popper',
|
|
274
|
-
}}
|
|
275
|
-
>
|
|
276
|
-
<BubbleMenuContent>
|
|
277
|
-
{actions && (
|
|
278
|
-
<>
|
|
279
|
-
{actions.map((item, i) => (
|
|
280
|
-
<ActionButton key={i} {...item} />
|
|
281
|
-
))}
|
|
282
|
-
|
|
283
|
-
<Separator
|
|
284
|
-
className="!mx-1 !my-2 !h-[16px]"
|
|
285
|
-
orientation="vertical"
|
|
286
|
-
/>
|
|
287
|
-
</>
|
|
288
|
-
)}
|
|
289
|
-
|
|
290
|
-
{props.items && (
|
|
291
|
-
<>
|
|
292
|
-
{items.map((item, i) => (
|
|
293
|
-
<ItemA
|
|
294
|
-
key={i}
|
|
295
|
-
disabled={disabled}
|
|
296
|
-
editor={editor}
|
|
297
|
-
item={item} />
|
|
298
|
-
))}
|
|
299
|
-
|
|
300
|
-
<Separator
|
|
301
|
-
className="!mx-1 !my-2 !h-[16px]"
|
|
302
|
-
orientation="vertical"
|
|
303
|
-
/>
|
|
304
|
-
</>
|
|
305
|
-
)}
|
|
306
|
-
|
|
307
|
-
<ActionButton
|
|
308
|
-
action={onMergeCell}
|
|
309
|
-
disabled={!editor?.can()?.mergeCells?.()}
|
|
310
|
-
icon="TableCellsMerge"
|
|
311
|
-
tooltip={t('editor.table.menu.mergeCells')}
|
|
312
|
-
tooltip-options={{
|
|
313
|
-
sideOffset: 15,
|
|
314
|
-
}}
|
|
315
|
-
/>
|
|
316
|
-
|
|
317
|
-
<ActionButton
|
|
318
|
-
action={onSplitCell}
|
|
319
|
-
disabled={!editor?.can()?.splitCell?.()}
|
|
320
|
-
icon="TableCellsSplit"
|
|
321
|
-
tooltip={t('editor.table.menu.splitCells')}
|
|
322
|
-
tooltip-options={{
|
|
323
|
-
sideOffset: 15,
|
|
324
|
-
}}
|
|
325
|
-
/>
|
|
326
|
-
|
|
327
|
-
<Separator className="!mx-1 !my-2 !h-[16px]" orientation="vertical" />
|
|
328
|
-
|
|
329
|
-
<HighlightActionButton
|
|
330
|
-
action={onSetCellBackground}
|
|
331
|
-
editor={editor}
|
|
332
|
-
tooltip={t('editor.table.menu.setCellsBgColor')}
|
|
333
|
-
tooltipOptions={{
|
|
334
|
-
sideOffset: 15,
|
|
335
|
-
}}
|
|
336
|
-
/>
|
|
337
|
-
|
|
338
|
-
<ActionButton
|
|
339
|
-
action={onDeleteTable}
|
|
340
|
-
disabled={!editor?.can()?.deleteTable?.()}
|
|
341
|
-
icon="Trash2"
|
|
342
|
-
tooltip={t('editor.table.menu.deleteTable')}
|
|
343
|
-
tooltip-options={{
|
|
344
|
-
sideOffset: 15,
|
|
345
|
-
}}
|
|
346
|
-
/>
|
|
347
|
-
</BubbleMenuContent>
|
|
348
|
-
</BubbleMenu>
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
function TableBubbleMenu(props: TableBubbleMenuProps) {
|
|
353
|
-
return (
|
|
354
|
-
<>
|
|
355
|
-
<TableMainBubbleMenu {...props} />
|
|
356
|
-
<TableRowBubbleMenu {...props} />
|
|
357
|
-
<TableColBubbleMenu {...props} />
|
|
358
|
-
</>
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export { TableBubbleMenu };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './bubble';
|
|
2
|
-
export * from './components/ContentMenu';
|
|
3
|
-
export * from './components/BubbleMenuText';
|
|
4
|
-
export * from './components/TableBubbleMenu';
|
|
5
|
-
export * from './components/BubbleMenuLink';
|
|
6
|
-
export * from './components/BubbleMenuMedia';
|
|
7
|
-
export * from './components/ColumnsBubbleMenu';
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import { type VariantProps, cva } from 'class-variance-authority';
|
|
4
|
-
|
|
5
|
-
import { cn } from 'reactjs-tiptap-editor-pro/lib/utils';
|
|
6
|
-
|
|
7
|
-
const buttonVariants = cva(
|
|
8
|
-
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: '!bg-primary !text-primary-foreground hover:!bg-primary/90',
|
|
13
|
-
destructive:
|
|
14
|
-
'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
15
|
-
outline:
|
|
16
|
-
'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
17
|
-
secondary:
|
|
18
|
-
'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
19
|
-
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
20
|
-
link: 'text-primary underline-offset-4 hover:underline',
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
default: 'h-10 px-4 py-2',
|
|
24
|
-
sm: 'h-9 rounded-md px-3',
|
|
25
|
-
lg: 'h-11 rounded-md px-8',
|
|
26
|
-
icon: 'h-10 w-10',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: 'default',
|
|
31
|
-
size: 'default',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export interface ButtonProps
|
|
37
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
38
|
-
VariantProps<typeof buttonVariants> {
|
|
39
|
-
asChild?: boolean
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
43
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
44
|
-
const Comp = asChild ? Slot : 'button';
|
|
45
|
-
return (
|
|
46
|
-
<Comp
|
|
47
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
|
-
ref={ref}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
},
|
|
53
|
-
);
|
|
54
|
-
Button.displayName = 'Button';
|
|
55
|
-
|
|
56
|
-
export { Button, buttonVariants };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
-
import { Check } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from 'reactjs-tiptap-editor-pro/lib/utils';
|
|
8
|
-
|
|
9
|
-
const Checkbox = React.forwardRef<
|
|
10
|
-
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
11
|
-
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
12
|
-
>(({ className, ...props }, ref) => (
|
|
13
|
-
<CheckboxPrimitive.Root
|
|
14
|
-
ref={ref}
|
|
15
|
-
className={cn(
|
|
16
|
-
'!peer !h-4 !w-4 !p-0 !shrink-0 !rounded-sm !border !border-primary !ring-offset-background focus-visible:!outline-none focus-visible:!ring-2 focus-visible:!ring-ring focus-visible:!ring-offset-2 disabled:!cursor-not-allowed disabled:!opacity-50 data-[state=checked]:!bg-primary data-[state=checked]:!text-primary-foreground',
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
>
|
|
21
|
-
<CheckboxPrimitive.Indicator
|
|
22
|
-
className={cn('!flex !p-0 !items-center !justify-center !text-current')}
|
|
23
|
-
>
|
|
24
|
-
<Check className="!h-4 !w-4" />
|
|
25
|
-
</CheckboxPrimitive.Indicator>
|
|
26
|
-
</CheckboxPrimitive.Root>
|
|
27
|
-
));
|
|
28
|
-
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
29
|
-
|
|
30
|
-
export { Checkbox };
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
-
import { X } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from 'reactjs-tiptap-editor-pro/lib/utils';
|
|
8
|
-
|
|
9
|
-
const Dialog = DialogPrimitive.Root;
|
|
10
|
-
|
|
11
|
-
const DialogTrigger = DialogPrimitive.Trigger;
|
|
12
|
-
|
|
13
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
14
|
-
|
|
15
|
-
const DialogClose = DialogPrimitive.Close;
|
|
16
|
-
|
|
17
|
-
const DialogOverlay = React.forwardRef<
|
|
18
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
19
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
20
|
-
>(({ className, ...props }, ref) => (
|
|
21
|
-
<DialogPrimitive.Overlay
|
|
22
|
-
ref={ref}
|
|
23
|
-
className={cn(
|
|
24
|
-
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
25
|
-
className,
|
|
26
|
-
)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
));
|
|
30
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
31
|
-
|
|
32
|
-
const DialogContent = React.forwardRef<
|
|
33
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
34
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
35
|
-
>(({ className, children, ...props }, ref) => (
|
|
36
|
-
<DialogPortal>
|
|
37
|
-
<DialogOverlay />
|
|
38
|
-
<DialogPrimitive.Content
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn(
|
|
41
|
-
'dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
48
|
-
<X className="h-4 w-4" />
|
|
49
|
-
<span className="sr-only">
|
|
50
|
-
Close
|
|
51
|
-
</span>
|
|
52
|
-
</DialogPrimitive.Close>
|
|
53
|
-
</DialogPrimitive.Content>
|
|
54
|
-
</DialogPortal>
|
|
55
|
-
));
|
|
56
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
57
|
-
|
|
58
|
-
function DialogHeader({
|
|
59
|
-
className,
|
|
60
|
-
...props
|
|
61
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
62
|
-
return (
|
|
63
|
-
<div
|
|
64
|
-
className={cn(
|
|
65
|
-
'flex flex-col space-y-1.5 text-center sm:text-left',
|
|
66
|
-
className,
|
|
67
|
-
)}
|
|
68
|
-
{...props}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
DialogHeader.displayName = 'DialogHeader';
|
|
73
|
-
|
|
74
|
-
function DialogFooter({
|
|
75
|
-
className,
|
|
76
|
-
...props
|
|
77
|
-
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
78
|
-
return (
|
|
79
|
-
<div
|
|
80
|
-
className={cn(
|
|
81
|
-
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
|
|
82
|
-
className,
|
|
83
|
-
)}
|
|
84
|
-
{...props}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
DialogFooter.displayName = 'DialogFooter';
|
|
89
|
-
|
|
90
|
-
const DialogTitle = React.forwardRef<
|
|
91
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
92
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
93
|
-
>(({ className, ...props }, ref) => (
|
|
94
|
-
<DialogPrimitive.Title
|
|
95
|
-
ref={ref}
|
|
96
|
-
className={cn(
|
|
97
|
-
'text-lg font-semibold leading-none tracking-tight',
|
|
98
|
-
className,
|
|
99
|
-
)}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
));
|
|
103
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
104
|
-
|
|
105
|
-
const DialogDescription = React.forwardRef<
|
|
106
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
107
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
108
|
-
>(({ className, ...props }, ref) => (
|
|
109
|
-
<DialogPrimitive.Description
|
|
110
|
-
ref={ref}
|
|
111
|
-
className={cn('text-sm text-muted-foreground', className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
));
|
|
115
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
116
|
-
|
|
117
|
-
export {
|
|
118
|
-
Dialog,
|
|
119
|
-
DialogPortal,
|
|
120
|
-
DialogOverlay,
|
|
121
|
-
DialogClose,
|
|
122
|
-
DialogTrigger,
|
|
123
|
-
DialogContent,
|
|
124
|
-
DialogHeader,
|
|
125
|
-
DialogFooter,
|
|
126
|
-
DialogTitle,
|
|
127
|
-
DialogDescription,
|
|
128
|
-
};
|