tiptap-notion-editor 0.5.0
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/LICENSE +21 -0
- package/README.md +172 -0
- package/lib/NotionEditor.d.ts +58 -0
- package/lib/components/Draggable/index.d.ts +5 -0
- package/lib/components/ToggleButton.d.ts +16 -0
- package/lib/components/TooltipWrapper.d.ts +9 -0
- package/lib/components/blocks/attachment.d.ts +2 -0
- package/lib/components/blocks/code.d.ts +2 -0
- package/lib/components/blocks/emoji.d.ts +2 -0
- package/lib/components/blocks/image.d.ts +2 -0
- package/lib/components/blocks/list.d.ts +4 -0
- package/lib/components/blocks/separator.d.ts +2 -0
- package/lib/components/blocks/table.d.ts +2 -0
- package/lib/components/blocks/tableOfContents.d.ts +2 -0
- package/lib/components/blocks/types.d.ts +26 -0
- package/lib/components/blocks/typography.d.ts +8 -0
- package/lib/components/bubble/BubbleMoreOption.d.ts +5 -0
- package/lib/components/bubble/ImageBubbleMenu.d.ts +7 -0
- package/lib/components/bubble/IndentButtons.d.ts +5 -0
- package/lib/components/bubble/MyBubbleMenu.d.ts +5 -0
- package/lib/components/bubble/PickLink.d.ts +6 -0
- package/lib/components/bubble/TextTurnInto.d.ts +5 -0
- package/lib/components/bubble/icon.d.ts +4 -0
- package/lib/components/color/ColorDropdown.d.ts +5 -0
- package/lib/components/color/ColorItem.d.ts +5 -0
- package/lib/components/color/ColorSubMenu.d.ts +7 -0
- package/lib/components/color/HighlightButton.d.ts +15 -0
- package/lib/components/color/TextButton.d.ts +9 -0
- package/lib/components/color/constant.d.ts +12 -0
- package/lib/components/color/icon.d.ts +2 -0
- package/lib/components/color/type.d.ts +9 -0
- package/lib/components/color/utils.d.ts +5 -0
- package/lib/components/extensions/Indent.d.ts +16 -0
- package/lib/components/extensions/emoji-picker/EmojiList.d.ts +8 -0
- package/lib/components/extensions/emoji-picker/EmojiPicker.d.ts +14 -0
- package/lib/components/extensions/emoji-picker/emoji-suggestion.d.ts +3 -0
- package/lib/components/extensions/file-handle.d.ts +19 -0
- package/lib/components/extensions/global-block-background.d.ts +2 -0
- package/lib/components/extensions/index.d.ts +51 -0
- package/lib/components/extensions/mention/MentionList.d.ts +11 -0
- package/lib/components/extensions/mention/mentionSuggestion.d.ts +11 -0
- package/lib/components/extensions/mention/types.d.ts +12 -0
- package/lib/components/extensions/slash-command/MenuListGroup.d.ts +9 -0
- package/lib/components/extensions/slash-command/SlashMenu.d.ts +11 -0
- package/lib/components/extensions/slash-command/items.d.ts +3 -0
- package/lib/components/extensions/slash-command/slash-command.d.ts +7 -0
- package/lib/components/extensions/slash-command/suggestion.d.ts +3 -0
- package/lib/components/icons.d.ts +5 -0
- package/lib/components/node/attachment/AttachmentNode.d.ts +38 -0
- package/lib/components/node/attachment/AttachmentNodeView.d.ts +3 -0
- package/lib/components/node/attachment/AttachmentUploadNode.d.ts +37 -0
- package/lib/components/node/attachment/AttachmentUploadNodeView.d.ts +3 -0
- package/lib/components/node/attachment/context.d.ts +16 -0
- package/lib/components/node/attachment/index.d.ts +3 -0
- package/lib/components/node/image/CustomImage.d.ts +1 -0
- package/lib/components/node/image/ImageNodeView.d.ts +5 -0
- package/lib/components/node/image-upload/drop-zone-content.d.ts +4 -0
- package/lib/components/node/image-upload/hooks.d.ts +7 -0
- package/lib/components/node/image-upload/image-drop-area.d.ts +15 -0
- package/lib/components/node/image-upload/image-preview.d.ts +13 -0
- package/lib/components/node/image-upload/image-upload-node-extension.d.ts +58 -0
- package/lib/components/node/image-upload/image-upload-node-view.d.ts +2 -0
- package/lib/components/node/image-upload/index.d.ts +1 -0
- package/lib/components/node/image-upload/types.d.ts +66 -0
- package/lib/components/node/table-node/AddRowButton.d.ts +5 -0
- package/lib/components/node/table-node/CustomTable.d.ts +1 -0
- package/lib/components/node/table-node/TableAddRowColumnHandle.d.ts +7 -0
- package/lib/components/node/table-node/TableHandle.d.ts +4 -0
- package/lib/components/node/table-node/TableMenuHandle.d.ts +7 -0
- package/lib/components/node/table-node/TableSelectionOverlay.d.ts +7 -0
- package/lib/components/node/table-node/plugins/add-row-plugin.d.ts +9 -0
- package/lib/components/node/table-node/plugins/plugin-keys.d.ts +6 -0
- package/lib/components/node/table-node/plugins/table-menu-handle-plugin.d.ts +33 -0
- package/lib/components/node/table-node/plugins/table-selection-overlay.d.ts +10 -0
- package/lib/components/node/table-node/popover/AlignmentContent.d.ts +4 -0
- package/lib/components/node/table-node/popover/CellMenuPopover.d.ts +4 -0
- package/lib/components/node/table-node/popover/Colors.d.ts +4 -0
- package/lib/components/node/table-node/popover/TableMenuItem.d.ts +11 -0
- package/lib/components/node/table-node/popover/TableMenuPopover.d.ts +9 -0
- package/lib/components/node/table-node/table-kit.d.ts +2 -0
- package/lib/components/node/table-node/utils/getActiveTableCellAlignment.d.ts +14 -0
- package/lib/components/node/table-node/utils/getTableColumnMeta.d.ts +15 -0
- package/lib/components/node/table-node/utils/getTableContext.d.ts +16 -0
- package/lib/components/node/table-node/utils/index.d.ts +17 -0
- package/lib/components/node/table-node/utils/table.d.ts +51 -0
- package/lib/components/node/toc-node/TableOfContentsNode.d.ts +13 -0
- package/lib/components/node/toc-node/TocNodeView.d.ts +9 -0
- package/lib/components/toc-sidebar/TocPopover.d.ts +6 -0
- package/lib/components/toc-sidebar/TocSidebar.d.ts +9 -0
- package/lib/components/toc-sidebar/TocSidebarContent.d.ts +6 -0
- package/lib/components/toc-sidebar/TocUIList.d.ts +8 -0
- package/lib/components/ui/button.d.ts +10 -0
- package/lib/components/ui/command.d.ts +18 -0
- package/lib/components/ui/dialog.d.ts +17 -0
- package/lib/components/ui/dropdown-menu.d.ts +29 -0
- package/lib/components/ui/input-group.d.ts +16 -0
- package/lib/components/ui/input.d.ts +3 -0
- package/lib/components/ui/popover.d.ts +10 -0
- package/lib/components/ui/scroll-area.d.ts +5 -0
- package/lib/components/ui/separator.d.ts +4 -0
- package/lib/components/ui/textarea.d.ts +3 -0
- package/lib/components/ui/tooltip.d.ts +7 -0
- package/lib/i18n/context.d.ts +15 -0
- package/lib/i18n/index.d.ts +2 -0
- package/lib/i18n/messages.d.ts +202 -0
- package/lib/index.cjs +9 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +5188 -0
- package/lib/index.js.map +1 -0
- package/lib/lib/aspect-ratio.d.ts +21 -0
- package/lib/lib/collect-file-urls.d.ts +10 -0
- package/lib/lib/tiptap-utils.d.ts +173 -0
- package/lib/lib/use-event.d.ts +1 -0
- package/lib/lib/utils.d.ts +25 -0
- package/lib/styles/colors.css +88 -0
- package/lib/styles/editor.css +268 -0
- package/lib/styles/image-upload.css +256 -0
- package/lib/styles/image.css +113 -0
- package/lib/styles/index.css +18 -0
- package/lib/styles/prosemirror.css +271 -0
- package/lib/styles/table.css +243 -0
- package/lib/styles/tokens.css +66 -0
- package/package.json +114 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Node cho mục lục nhúng trong nội dung.
|
|
4
|
+
*
|
|
5
|
+
* `@tiptap/extension-table-of-contents` chỉ là Extension: nó tính toán danh
|
|
6
|
+
* sách heading rồi để vào `editor.storage.tableOfContents`, chứ không đăng ký
|
|
7
|
+
* node nào. Muốn chèn được mục lục vào document thì phải có node riêng.
|
|
8
|
+
*
|
|
9
|
+
* Tên phải khác `tableOfContents` — đó là tên của chính Extension kia, trùng
|
|
10
|
+
* tên sẽ tranh nhau khi Tiptap dựng schema.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TableOfContentsNode: Node<any, any>;
|
|
13
|
+
export default TableOfContentsNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeViewProps } from '@tiptap/react';
|
|
2
|
+
/**
|
|
3
|
+
* Mục lục nhúng thẳng trong nội dung.
|
|
4
|
+
*
|
|
5
|
+
* Dữ liệu lấy từ storage của extension TableOfContents — cùng nguồn với thanh
|
|
6
|
+
* mục lục ở lề, nên hai chỗ không bao giờ lệch nhau.
|
|
7
|
+
*/
|
|
8
|
+
export declare function TocNodeView({ editor }: NodeViewProps): import("react").JSX.Element;
|
|
9
|
+
export default TocNodeView;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
interface PropsType {
|
|
4
|
+
editor: Editor | null;
|
|
5
|
+
variant?: "content" | "line";
|
|
6
|
+
scrollOver?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const TocSidebar: ({ editor, variant, scrollOver, }: PropsType) => React.JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TableOfContentDataItem } from '@tiptap/extension-table-of-contents';
|
|
2
|
+
declare const TocSidebarContent: ({ items, scrollOver, }: {
|
|
3
|
+
items: TableOfContentDataItem[];
|
|
4
|
+
scrollOver: boolean;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
|
+
export default TocSidebarContent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableOfContentDataItem } from '@tiptap/extension-table-of-contents';
|
|
3
|
+
interface TocUIListProps {
|
|
4
|
+
items: TableOfContentDataItem[];
|
|
5
|
+
scrollOver: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const TocUIList: React.FC<TocUIListProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import { Dialog } from './dialog';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
16
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
17
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: "default" | "destructive";
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
23
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
29
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
9
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
10
|
+
size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
12
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
|
|
13
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
14
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
15
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
|
16
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
|
|
6
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
7
|
+
declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
|
|
9
|
+
declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
10
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): React.JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Locale, Messages } from './messages';
|
|
3
|
+
/**
|
|
4
|
+
* Cung cấp từ điển cho các component bên trong editor.
|
|
5
|
+
*
|
|
6
|
+
* Phần extension không đi qua context được — chúng được dựng ngoài cây React —
|
|
7
|
+
* nên `extensions()` nhận `locale` riêng. Cả hai cùng đọc `getMessages` nên
|
|
8
|
+
* không có nguy cơ lệch nhau.
|
|
9
|
+
*/
|
|
10
|
+
export declare const I18nProvider: ({ locale, children, }: {
|
|
11
|
+
locale?: Locale;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}) => import("react").JSX.Element;
|
|
14
|
+
/** Từ điển đang dùng. Ngoài provider thì rơi về tiếng Việt. */
|
|
15
|
+
export declare const useMessages: () => Messages;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Từ điển chuỗi hiển thị của editor.
|
|
3
|
+
*
|
|
4
|
+
* Không dùng thư viện i18n nào: package chỉ có ~90 chuỗi tĩnh, không số nhiều,
|
|
5
|
+
* không nội suy phức tạp. Thêm một runtime i18n vào đây chỉ tổ bắt app chủ phải
|
|
6
|
+
* hoà giải hai hệ thống dịch.
|
|
7
|
+
*
|
|
8
|
+
* `vi` là nguồn chuẩn — kiểu `Messages` suy ra từ nó, nên thiếu một khoá ở `en`
|
|
9
|
+
* là lỗi biên dịch chứ không phải chuỗi rỗng lúc chạy.
|
|
10
|
+
*/
|
|
11
|
+
export declare const vi: {
|
|
12
|
+
common: {
|
|
13
|
+
close: string;
|
|
14
|
+
delete: string;
|
|
15
|
+
color: string;
|
|
16
|
+
recentlyUsed: string;
|
|
17
|
+
noResults: string;
|
|
18
|
+
moreOptions: string;
|
|
19
|
+
};
|
|
20
|
+
/** Nhãn căn chỉnh dùng chung cho chữ, ảnh và ô bảng. */
|
|
21
|
+
align: {
|
|
22
|
+
left: string;
|
|
23
|
+
center: string;
|
|
24
|
+
right: string;
|
|
25
|
+
justify: string;
|
|
26
|
+
top: string;
|
|
27
|
+
middle: string;
|
|
28
|
+
bottom: string;
|
|
29
|
+
};
|
|
30
|
+
/** Nhãn định dạng chữ trên bubble menu. */
|
|
31
|
+
marks: {
|
|
32
|
+
bold: string;
|
|
33
|
+
italic: string;
|
|
34
|
+
underline: string;
|
|
35
|
+
strike: string;
|
|
36
|
+
code: string;
|
|
37
|
+
link: string;
|
|
38
|
+
};
|
|
39
|
+
placeholder: {
|
|
40
|
+
emptyDocument: string;
|
|
41
|
+
heading: (level: number) => string;
|
|
42
|
+
};
|
|
43
|
+
slash: {
|
|
44
|
+
filterTag: string;
|
|
45
|
+
filterHint: string;
|
|
46
|
+
groups: {
|
|
47
|
+
style: string;
|
|
48
|
+
insert: string;
|
|
49
|
+
upload: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
blocks: {
|
|
53
|
+
text: {
|
|
54
|
+
title: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
heading1: {
|
|
58
|
+
title: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
heading2: {
|
|
62
|
+
title: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
heading3: {
|
|
66
|
+
title: string;
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
bulletList: {
|
|
70
|
+
title: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
orderedList: {
|
|
74
|
+
title: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
taskList: {
|
|
78
|
+
title: string;
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
blockquote: {
|
|
82
|
+
title: string;
|
|
83
|
+
description: string;
|
|
84
|
+
};
|
|
85
|
+
codeBlock: {
|
|
86
|
+
title: string;
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
89
|
+
hardBreak: {
|
|
90
|
+
title: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
clearLine: {
|
|
94
|
+
title: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
separator: {
|
|
98
|
+
title: string;
|
|
99
|
+
description: string;
|
|
100
|
+
};
|
|
101
|
+
emoji: {
|
|
102
|
+
title: string;
|
|
103
|
+
description: string;
|
|
104
|
+
};
|
|
105
|
+
mention: {
|
|
106
|
+
title: string;
|
|
107
|
+
description: string;
|
|
108
|
+
};
|
|
109
|
+
table: {
|
|
110
|
+
title: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
tableOfContents: {
|
|
114
|
+
title: string;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
image: {
|
|
118
|
+
title: string;
|
|
119
|
+
description: string;
|
|
120
|
+
};
|
|
121
|
+
attachment: {
|
|
122
|
+
title: string;
|
|
123
|
+
description: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
bubble: {
|
|
127
|
+
turnInto: string;
|
|
128
|
+
linkPlaceholder: string;
|
|
129
|
+
improve: string;
|
|
130
|
+
pasteLink: string;
|
|
131
|
+
textColor: string;
|
|
132
|
+
backgroundColor: string;
|
|
133
|
+
increaseIndent: string;
|
|
134
|
+
decreaseIndent: string;
|
|
135
|
+
};
|
|
136
|
+
drag: {
|
|
137
|
+
handleHint: string;
|
|
138
|
+
resetFormatting: string;
|
|
139
|
+
duplicate: string;
|
|
140
|
+
copyToClipboard: string;
|
|
141
|
+
copyAnchorLink: string;
|
|
142
|
+
askAi: string;
|
|
143
|
+
insertBlock: string;
|
|
144
|
+
};
|
|
145
|
+
table: {
|
|
146
|
+
alignment: string;
|
|
147
|
+
alignLeft: string;
|
|
148
|
+
alignCenter: string;
|
|
149
|
+
alignRight: string;
|
|
150
|
+
alignJustify: string;
|
|
151
|
+
alignTop: string;
|
|
152
|
+
alignMiddle: string;
|
|
153
|
+
alignBottom: string;
|
|
154
|
+
mergeCells: string;
|
|
155
|
+
splitCell: string;
|
|
156
|
+
insertRowBefore: string;
|
|
157
|
+
insertRowAfter: string;
|
|
158
|
+
insertColumnBefore: string;
|
|
159
|
+
insertColumnAfter: string;
|
|
160
|
+
deleteRow: string;
|
|
161
|
+
deleteColumn: string;
|
|
162
|
+
duplicateRow: string;
|
|
163
|
+
duplicateColumn: string;
|
|
164
|
+
clearRowContents: string;
|
|
165
|
+
clearColumnContents: string;
|
|
166
|
+
moveRowUp: string;
|
|
167
|
+
moveRowDown: string;
|
|
168
|
+
moveColumnLeft: string;
|
|
169
|
+
moveColumnRight: string;
|
|
170
|
+
deleteTable: string;
|
|
171
|
+
};
|
|
172
|
+
image: {
|
|
173
|
+
clickToUpload: string;
|
|
174
|
+
delete: string;
|
|
175
|
+
orDragAndDrop: string;
|
|
176
|
+
limitHint: (limit: number, maxSizeMb: number) => string;
|
|
177
|
+
clearAll: string;
|
|
178
|
+
caption: string;
|
|
179
|
+
download: string;
|
|
180
|
+
replace: string;
|
|
181
|
+
};
|
|
182
|
+
emojiPicker: {
|
|
183
|
+
empty: string;
|
|
184
|
+
loading: string;
|
|
185
|
+
};
|
|
186
|
+
attachment: {
|
|
187
|
+
clickToUpload: string;
|
|
188
|
+
uploading: string;
|
|
189
|
+
download: string;
|
|
190
|
+
};
|
|
191
|
+
toc: {
|
|
192
|
+
title: string;
|
|
193
|
+
empty: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
/** Hình dạng từ điển, suy ra từ bản tiếng Việt. */
|
|
197
|
+
export type Messages = typeof vi;
|
|
198
|
+
export declare const en: Messages;
|
|
199
|
+
export type Locale = "vi" | "en";
|
|
200
|
+
/** Tiếng Việt là mặc định. */
|
|
201
|
+
export declare const DEFAULT_LOCALE: Locale;
|
|
202
|
+
export declare const getMessages: (locale?: Locale) => Messages;
|