vdc-editor 0.0.1
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/README.md +177 -0
- package/lib/index.d.ts +3 -0
- package/lib/src/components/ActionButton.vue.d.ts +90 -0
- package/lib/src/components/ActionDropdownButton.vue.d.ts +67 -0
- package/lib/src/components/ActionDropdownButtonSplit.vue.d.ts +71 -0
- package/lib/src/components/ActionMenuButton.vue.d.ts +62 -0
- package/lib/src/components/ColorPicker.vue.d.ts +51 -0
- package/lib/src/components/CoreEditor.vue.d.ts +162 -0
- package/lib/src/components/SelectContextMenu.vue.d.ts +28 -0
- package/lib/src/components/SuperTextView.vue.d.ts +2 -0
- package/lib/src/components/Toolbar.vue.d.ts +31 -0
- package/lib/src/components/icons/Icon.vue.d.ts +20 -0
- package/lib/src/components/icons/icons.d.ts +106 -0
- package/lib/src/components/icons/index.d.ts +4 -0
- package/lib/src/components/icons/setupIcon.d.ts +1 -0
- package/lib/src/components/menus/BasicBubble.d.ts +59 -0
- package/lib/src/components/menus/ColumnsBubbleMenu.vue.d.ts +31 -0
- package/lib/src/components/menus/LinkBubbleMenu.vue.d.ts +31 -0
- package/lib/src/components/menus/TableBubbleMenu.vue.d.ts +24 -0
- package/lib/src/components/ui/accordion/index.d.ts +4 -0
- package/lib/src/components/ui/alert/index.d.ts +9 -0
- package/lib/src/components/ui/badge/Badge.vue.d.ts +29 -0
- package/lib/src/components/ui/badge/index.d.ts +7 -0
- package/lib/src/components/ui/button/Button.vue.d.ts +43 -0
- package/lib/src/components/ui/button/index.d.ts +8 -0
- package/lib/src/components/ui/checkbox/Checkbox.vue.d.ts +31 -0
- package/lib/src/components/ui/checkbox/index.d.ts +1 -0
- package/lib/src/components/ui/context-menu/ContextMenu.vue.d.ts +26 -0
- package/lib/src/components/ui/context-menu/ContextMenuCheckboxItem.vue.d.ts +33 -0
- package/lib/src/components/ui/context-menu/ContextMenuContent.vue.d.ts +39 -0
- package/lib/src/components/ui/context-menu/ContextMenuGroup.vue.d.ts +22 -0
- package/lib/src/components/ui/context-menu/ContextMenuItem.vue.d.ts +33 -0
- package/lib/src/components/ui/context-menu/ContextMenuLabel.vue.d.ts +29 -0
- package/lib/src/components/ui/context-menu/ContextMenuRadioGroup.vue.d.ts +26 -0
- package/lib/src/components/ui/context-menu/ContextMenuRadioItem.vue.d.ts +31 -0
- package/lib/src/components/ui/context-menu/ContextMenuSeparator.vue.d.ts +18 -0
- package/lib/src/components/ui/context-menu/ContextMenuShortcut.vue.d.ts +26 -0
- package/lib/src/components/ui/context-menu/ContextMenuSub.vue.d.ts +26 -0
- package/lib/src/components/ui/context-menu/ContextMenuSubContent.vue.d.ts +43 -0
- package/lib/src/components/ui/context-menu/ContextMenuSubTrigger.vue.d.ts +29 -0
- package/lib/src/components/ui/context-menu/ContextMenuTrigger.vue.d.ts +22 -0
- package/lib/src/components/ui/context-menu/index.d.ts +14 -0
- package/lib/src/components/ui/dialog/Dialog.vue.d.ts +26 -0
- package/lib/src/components/ui/dialog/DialogClose.vue.d.ts +22 -0
- package/lib/src/components/ui/dialog/DialogContent.vue.d.ts +41 -0
- package/lib/src/components/ui/dialog/DialogDescription.vue.d.ts +27 -0
- package/lib/src/components/ui/dialog/DialogFooter.vue.d.ts +26 -0
- package/lib/src/components/ui/dialog/DialogHeader.vue.d.ts +26 -0
- package/lib/src/components/ui/dialog/DialogScrollContent.vue.d.ts +41 -0
- package/lib/src/components/ui/dialog/DialogTitle.vue.d.ts +27 -0
- package/lib/src/components/ui/dialog/DialogTrigger.vue.d.ts +22 -0
- package/lib/src/components/ui/dialog/index.d.ts +9 -0
- package/lib/src/components/ui/drawer/index.d.ts +8 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +26 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +33 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +53 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +22 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +29 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +29 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +26 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +31 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +18 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +26 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +26 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +43 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +27 -0
- package/lib/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +22 -0
- package/lib/src/components/ui/dropdown-menu/index.d.ts +15 -0
- package/lib/src/components/ui/input/Input.vue.d.ts +25 -0
- package/lib/src/components/ui/input/index.d.ts +1 -0
- package/lib/src/components/ui/label/Label.vue.d.ts +27 -0
- package/lib/src/components/ui/label/index.d.ts +1 -0
- package/lib/src/components/ui/menubar/index.d.ts +15 -0
- package/lib/src/components/ui/popover/Popover.vue.d.ts +26 -0
- package/lib/src/components/ui/popover/PopoverContent.vue.d.ts +58 -0
- package/lib/src/components/ui/popover/PopoverTrigger.vue.d.ts +22 -0
- package/lib/src/components/ui/popover/index.d.ts +4 -0
- package/lib/src/components/ui/resizable/ResizableHandle.vue.d.ts +24 -0
- package/lib/src/components/ui/resizable/ResizablePanelGroup.vue.d.ts +31 -0
- package/lib/src/components/ui/resizable/index.d.ts +3 -0
- package/lib/src/components/ui/scroll-area/ScrollArea.vue.d.ts +27 -0
- package/lib/src/components/ui/scroll-area/ScrollBar.vue.d.ts +32 -0
- package/lib/src/components/ui/scroll-area/index.d.ts +2 -0
- package/lib/src/components/ui/select/Select.vue.d.ts +28 -0
- package/lib/src/components/ui/select/SelectContent.vue.d.ts +49 -0
- package/lib/src/components/ui/select/SelectGroup.vue.d.ts +27 -0
- package/lib/src/components/ui/select/SelectItem.vue.d.ts +27 -0
- package/lib/src/components/ui/select/SelectItemText.vue.d.ts +22 -0
- package/lib/src/components/ui/select/SelectLabel.vue.d.ts +27 -0
- package/lib/src/components/ui/select/SelectScrollDownButton.vue.d.ts +27 -0
- package/lib/src/components/ui/select/SelectScrollUpButton.vue.d.ts +27 -0
- package/lib/src/components/ui/select/SelectSeparator.vue.d.ts +18 -0
- package/lib/src/components/ui/select/SelectTrigger.vue.d.ts +27 -0
- package/lib/src/components/ui/select/SelectValue.vue.d.ts +22 -0
- package/lib/src/components/ui/select/index.d.ts +11 -0
- package/lib/src/components/ui/separator/Separator.vue.d.ts +18 -0
- package/lib/src/components/ui/separator/index.d.ts +1 -0
- package/lib/src/components/ui/sheet/index.d.ts +14 -0
- package/lib/src/components/ui/slider/index.d.ts +1 -0
- package/lib/src/components/ui/switch/index.d.ts +1 -0
- package/lib/src/components/ui/tabs/Tabs.vue.d.ts +26 -0
- package/lib/src/components/ui/tabs/TabsContent.vue.d.ts +27 -0
- package/lib/src/components/ui/tabs/TabsList.vue.d.ts +27 -0
- package/lib/src/components/ui/tabs/TabsTrigger.vue.d.ts +27 -0
- package/lib/src/components/ui/tabs/index.d.ts +4 -0
- package/lib/src/components/ui/textarea/Textarea.vue.d.ts +25 -0
- package/lib/src/components/ui/textarea/index.d.ts +1 -0
- package/lib/src/components/ui/toast/index.d.ts +22 -0
- package/lib/src/components/ui/toast/use-toast.d.ts +349 -0
- package/lib/src/components/ui/toggle/Toggle.vue.d.ts +56 -0
- package/lib/src/components/ui/toggle/index.d.ts +8 -0
- package/lib/src/components/ui/toggle-group/index.d.ts +2 -0
- package/lib/src/components/ui/tooltip/Tooltip.vue.d.ts +26 -0
- package/lib/src/components/ui/tooltip/TooltipContent.vue.d.ts +47 -0
- package/lib/src/components/ui/tooltip/TooltipProvider.vue.d.ts +22 -0
- package/lib/src/components/ui/tooltip/TooltipTrigger.vue.d.ts +22 -0
- package/lib/src/components/ui/tooltip/index.d.ts +4 -0
- package/lib/src/constants/index.d.ts +55 -0
- package/lib/src/extensions/Ai/AI.d.ts +16 -0
- package/lib/src/extensions/Ai/components/AIButton.vue.d.ts +74 -0
- package/lib/src/extensions/Ai/index.d.ts +1 -0
- package/lib/src/extensions/AttributesSetup/AttributesSetup.d.ts +3 -0
- package/lib/src/extensions/AttributesSetup/index.d.ts +1 -0
- package/lib/src/extensions/BaseKit.d.ts +118 -0
- package/lib/src/extensions/Blockquote/Blockquote.d.ts +6 -0
- package/lib/src/extensions/Blockquote/index.d.ts +1 -0
- package/lib/src/extensions/Bold/Bold.d.ts +6 -0
- package/lib/src/extensions/Bold/index.d.ts +1 -0
- package/lib/src/extensions/BulletList/BulletList.d.ts +6 -0
- package/lib/src/extensions/BulletList/components/BulletListMenuButton.vue.d.ts +35 -0
- package/lib/src/extensions/BulletList/index.d.ts +1 -0
- package/lib/src/extensions/Clear/Clear.d.ts +6 -0
- package/lib/src/extensions/Clear/index.d.ts +1 -0
- package/lib/src/extensions/Code/Code.d.ts +6 -0
- package/lib/src/extensions/Code/index.d.ts +1 -0
- package/lib/src/extensions/CodeBlock/CodeBlock.d.ts +6 -0
- package/lib/src/extensions/CodeBlock/components/CodeBlockView.vue.d.ts +68 -0
- package/lib/src/extensions/CodeBlock/index.d.ts +1 -0
- package/lib/src/extensions/Color/Color.d.ts +6 -0
- package/lib/src/extensions/Color/components/ColorActionButton.vue.d.ts +48 -0
- package/lib/src/extensions/Color/index.d.ts +1 -0
- package/lib/src/extensions/Document/Document.d.ts +2 -0
- package/lib/src/extensions/Document/index.d.ts +1 -0
- package/lib/src/extensions/FindAndReplace/FindAndReplace.d.ts +58 -0
- package/lib/src/extensions/FindAndReplace/index.d.ts +1 -0
- package/lib/src/extensions/FontFamily/FontFamily.d.ts +25 -0
- package/lib/src/extensions/FontFamily/components/FontFamilyMenuButton.vue.d.ts +65 -0
- package/lib/src/extensions/FontFamily/index.d.ts +1 -0
- package/lib/src/extensions/FontSize/FontSize.d.ts +32 -0
- package/lib/src/extensions/FontSize/components/FontSizeMenuButton.vue.d.ts +64 -0
- package/lib/src/extensions/FontSize/index.d.ts +1 -0
- package/lib/src/extensions/FormatPainter/FormatPainter.d.ts +24 -0
- package/lib/src/extensions/FormatPainter/index.d.ts +1 -0
- package/lib/src/extensions/Fullscreen/Fullscreen.d.ts +6 -0
- package/lib/src/extensions/Fullscreen/index.d.ts +1 -0
- package/lib/src/extensions/Heading/Heading.d.ts +6 -0
- package/lib/src/extensions/Heading/components/HeadingButton.vue.d.ts +65 -0
- package/lib/src/extensions/Heading/index.d.ts +1 -0
- package/lib/src/extensions/Highlight/Highlight.d.ts +6 -0
- package/lib/src/extensions/Highlight/components/HighlightActionButton.vue.d.ts +49 -0
- package/lib/src/extensions/Highlight/index.d.ts +1 -0
- package/lib/src/extensions/History/History.d.ts +6 -0
- package/lib/src/extensions/History/index.d.ts +1 -0
- package/lib/src/extensions/HorizontalRule/HorizontalRule.d.ts +6 -0
- package/lib/src/extensions/HorizontalRule/index.d.ts +1 -0
- package/lib/src/extensions/IDAttr/IDPlugin.d.ts +4 -0
- package/lib/src/extensions/IDAttr/index.d.ts +1 -0
- package/lib/src/extensions/Iframe/Iframe.d.ts +24 -0
- package/lib/src/extensions/Iframe/embed.d.ts +113 -0
- package/lib/src/extensions/Iframe/index.d.ts +1 -0
- package/lib/src/extensions/Image/Image.d.ts +29 -0
- package/lib/src/extensions/Image/components/ImageView.vue.d.ts +68 -0
- package/lib/src/extensions/Image/index.d.ts +1 -0
- package/lib/src/extensions/ImageUpload/ImageUpload.d.ts +16 -0
- package/lib/src/extensions/ImageUpload/components/ImageUploader.vue.d.ts +68 -0
- package/lib/src/extensions/ImageUpload/index.d.ts +1 -0
- package/lib/src/extensions/ImportWord/ImportWord.d.ts +28 -0
- package/lib/src/extensions/ImportWord/index.d.ts +1 -0
- package/lib/src/extensions/ImportWord/utils.d.ts +2 -0
- package/lib/src/extensions/Indent/Indent.d.ts +23 -0
- package/lib/src/extensions/Indent/index.d.ts +1 -0
- package/lib/src/extensions/Italic/Italic.d.ts +6 -0
- package/lib/src/extensions/Italic/index.d.ts +1 -0
- package/lib/src/extensions/LineHeight/LineHeight.d.ts +17 -0
- package/lib/src/extensions/LineHeight/components/LineHeightDropdown.vue.d.ts +48 -0
- package/lib/src/extensions/LineHeight/index.d.ts +1 -0
- package/lib/src/extensions/Link/Link.d.ts +6 -0
- package/lib/src/extensions/Link/components/LinkEditBlock.vue.d.ts +30 -0
- package/lib/src/extensions/Link/components/LinkEditPopover.vue.d.ts +56 -0
- package/lib/src/extensions/Link/components/LinkViewBlock.vue.d.ts +37 -0
- package/lib/src/extensions/Link/index.d.ts +1 -0
- package/lib/src/extensions/ListItem/ListItem.d.ts +3 -0
- package/lib/src/extensions/ListItem/index.d.ts +1 -0
- package/lib/src/extensions/MoreMark/MoreMark.d.ts +20 -0
- package/lib/src/extensions/MoreMark/components/ActionMoreButton.vue.d.ts +65 -0
- package/lib/src/extensions/MoreMark/index.d.ts +1 -0
- package/lib/src/extensions/MultiColumn/Column.d.ts +4 -0
- package/lib/src/extensions/MultiColumn/Columns.d.ts +22 -0
- package/lib/src/extensions/MultiColumn/index.d.ts +2 -0
- package/lib/src/extensions/OrderedList/OrderedList.d.ts +6 -0
- package/lib/src/extensions/OrderedList/components/OrderedListMenuButton.vue.d.ts +44 -0
- package/lib/src/extensions/OrderedList/index.d.ts +1 -0
- package/lib/src/extensions/Page/computed.d.ts +122 -0
- package/lib/src/extensions/Page/core.d.ts +79 -0
- package/lib/src/extensions/Page/index.d.ts +23 -0
- package/lib/src/extensions/Page/node-view.vue.d.ts +68 -0
- package/lib/src/extensions/Page/page-plugin.d.ts +7 -0
- package/lib/src/extensions/Page/split-block.d.ts +3 -0
- package/lib/src/extensions/Page/split-list-item.d.ts +7 -0
- package/lib/src/extensions/Page/types.d.ts +40 -0
- package/lib/src/extensions/Page/utils.d.ts +48 -0
- package/lib/src/extensions/Preview/Preview.d.ts +13 -0
- package/lib/src/extensions/Preview/index.d.ts +1 -0
- package/lib/src/extensions/Printer/Printer.d.ts +6 -0
- package/lib/src/extensions/Printer/index.d.ts +1 -0
- package/lib/src/extensions/Selection/Selection.d.ts +4 -0
- package/lib/src/extensions/Selection/index.d.ts +1 -0
- package/lib/src/extensions/SlashCommand/CommandsList.vue.d.ts +35 -0
- package/lib/src/extensions/SlashCommand/SlashCommand.d.ts +4 -0
- package/lib/src/extensions/SlashCommand/groups.d.ts +4 -0
- package/lib/src/extensions/SlashCommand/index.d.ts +1 -0
- package/lib/src/extensions/SlashCommand/types.d.ts +26 -0
- package/lib/src/extensions/SpellChecker/hunspell-proofreader.d.ts +16 -0
- package/lib/src/extensions/SpellChecker/i-proofreader-interface.d.ts +10 -0
- package/lib/src/extensions/SpellChecker/index.d.ts +6 -0
- package/lib/src/extensions/SpellChecker/sapling-proofreader.d.ts +13 -0
- package/lib/src/extensions/SpellChecker/spellchecker-extension.d.ts +27 -0
- package/lib/src/extensions/SpellChecker/spellchecker.d.ts +44 -0
- package/lib/src/extensions/Strike/Strike.d.ts +6 -0
- package/lib/src/extensions/Strike/index.d.ts +1 -0
- package/lib/src/extensions/Subscript/Subscript.d.ts +23 -0
- package/lib/src/extensions/Subscript/index.d.ts +1 -0
- package/lib/src/extensions/SuperText/SuperText.d.ts +11 -0
- package/lib/src/extensions/SuperText/components/SuperText.vue.d.ts +68 -0
- package/lib/src/extensions/SuperText/index.d.ts +1 -0
- package/lib/src/extensions/Table/cell-background.d.ts +19 -0
- package/lib/src/extensions/Table/components/CreateTablePopover.vue.d.ts +32 -0
- package/lib/src/extensions/Table/components/TableActionButton.vue.d.ts +53 -0
- package/lib/src/extensions/Table/index.d.ts +7 -0
- package/lib/src/extensions/Table/table.d.ts +24 -0
- package/lib/src/extensions/TaskList/TaskList.d.ts +12 -0
- package/lib/src/extensions/TaskList/index.d.ts +1 -0
- package/lib/src/extensions/TextAlign/TextAlign.d.ts +18 -0
- package/lib/src/extensions/TextAlign/components/TextAlignMenuButton.vue.d.ts +65 -0
- package/lib/src/extensions/TextAlign/index.d.ts +1 -0
- package/lib/src/extensions/TextBubble/TextBubble.d.ts +7 -0
- package/lib/src/extensions/TextBubble/components/TextDropdown.vue.d.ts +49 -0
- package/lib/src/extensions/TextBubble/index.d.ts +1 -0
- package/lib/src/extensions/TrailingNode/TrailingNode.d.ts +12 -0
- package/lib/src/extensions/TrailingNode/index.d.ts +1 -0
- package/lib/src/extensions/UnderLine/Underline.d.ts +6 -0
- package/lib/src/extensions/UnderLine/index.d.ts +1 -0
- package/lib/src/extensions/Video/Video.d.ts +55 -0
- package/lib/src/extensions/Video/index.d.ts +1 -0
- package/lib/src/extensions/VideoUpload/VideoUpload.d.ts +14 -0
- package/lib/src/extensions/VideoUpload/components/VideoUploader.vue.d.ts +68 -0
- package/lib/src/extensions/VideoUpload/index.d.ts +1 -0
- package/lib/src/extensions/index.d.ts +74 -0
- package/lib/src/hooks/index.d.ts +6 -0
- package/lib/src/hooks/useCheckSpellStore.d.ts +9 -0
- package/lib/src/hooks/useConfigTiptap.d.ts +8 -0
- package/lib/src/hooks/useContext.d.ts +21 -0
- package/lib/src/hooks/useHotkeys.d.ts +4 -0
- package/lib/src/hooks/useNodePosition.d.ts +7 -0
- package/lib/src/hooks/useStore.d.ts +160 -0
- package/lib/src/hooks/useSuperTextStore.d.ts +20 -0
- package/lib/src/i18n.d.ts +337 -0
- package/lib/src/index.d.ts +12 -0
- package/lib/src/plugins/image-upload.d.ts +12 -0
- package/lib/src/type.d.ts +145 -0
- package/lib/src/utils/content.d.ts +4 -0
- package/lib/src/utils/getRenderContainer.d.ts +4 -0
- package/lib/src/utils/indent.d.ts +15 -0
- package/lib/src/utils/is-mobile.d.ts +19 -0
- package/lib/src/utils/line-height.d.ts +7 -0
- package/lib/src/utils/loadFonts.d.ts +1 -0
- package/lib/src/utils/mitt.d.ts +24 -0
- package/lib/src/utils/node-names.d.ts +31 -0
- package/lib/src/utils/plateform.d.ts +11 -0
- package/lib/src/utils/utils.d.ts +18 -0
- package/lib/src/utils.d.ts +3 -0
- package/lib/style.css +1 -0
- package/lib/vdc-editor.mjs +61980 -0
- package/lib/vdc-editor.umd.js +197 -0
- package/lib/vite.config.d.ts +2 -0
- package/package.json +174 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ItalicOptions as TiptapItalicOptions } from '@tiptap/extension-italic';
|
|
2
|
+
import { GeneralOptions } from '../../type';
|
|
3
|
+
|
|
4
|
+
export interface ItalicOptions extends TiptapItalicOptions, GeneralOptions<ItalicOptions> {
|
|
5
|
+
}
|
|
6
|
+
export declare const Italic: import('@tiptap/core').Mark<ItalicOptions, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Italic';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { GeneralOptions } from '../../type';
|
|
3
|
+
|
|
4
|
+
export interface LineHeightOptions extends GeneralOptions<LineHeightOptions> {
|
|
5
|
+
types: string[];
|
|
6
|
+
lineHeights: string[];
|
|
7
|
+
defaultHeight: string;
|
|
8
|
+
}
|
|
9
|
+
declare module '@tiptap/core' {
|
|
10
|
+
interface Commands<ReturnType> {
|
|
11
|
+
lineHeight: {
|
|
12
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
13
|
+
unsetLineHeight: () => ReturnType;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export declare const LineHeight: Extension<LineHeightOptions, any>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import { ButtonViewReturnComponentProps } from '../../../type';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
icon?: any;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
action?: ButtonViewReturnComponentProps['action'];
|
|
10
|
+
isActive?: ButtonViewReturnComponentProps['isActive'];
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
13
|
+
icon: undefined;
|
|
14
|
+
tooltip: undefined;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
action: undefined;
|
|
17
|
+
isActive: undefined;
|
|
18
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
19
|
+
icon: undefined;
|
|
20
|
+
tooltip: undefined;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
action: undefined;
|
|
23
|
+
isActive: undefined;
|
|
24
|
+
}>>> & Readonly<{}>, {
|
|
25
|
+
icon: any;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
tooltip: string;
|
|
28
|
+
action: (value?: any) => void;
|
|
29
|
+
isActive: () => boolean;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithDefaults<P, D> = {
|
|
42
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
43
|
+
default: D[K];
|
|
44
|
+
}> : P[K];
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Prettify<T> = {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LineHeight';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LinkOptions as TiptapLinkOptions } from '@tiptap/extension-link';
|
|
2
|
+
import { GeneralOptions } from '../../type';
|
|
3
|
+
|
|
4
|
+
export interface LinkOptions extends TiptapLinkOptions, GeneralOptions<LinkOptions> {
|
|
5
|
+
}
|
|
6
|
+
export declare const Link: import('@tiptap/core').Mark<LinkOptions, any>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
onSetLink: (...args: any[]) => void;
|
|
8
|
+
onClickOutside: (...args: any[]) => void;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {}>>> & Readonly<{
|
|
10
|
+
onOnSetLink?: ((...args: any[]) => any) | undefined;
|
|
11
|
+
onOnClickOutside?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type __VLS_WithDefaults<P, D> = {
|
|
24
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
25
|
+
default: D[K];
|
|
26
|
+
}> : P[K];
|
|
27
|
+
};
|
|
28
|
+
type __VLS_Prettify<T> = {
|
|
29
|
+
[K in keyof T]: T[K];
|
|
30
|
+
} & {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import { ButtonViewReturnComponentProps } from '../../../type';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
icon?: any;
|
|
7
|
+
title?: string;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
shortcutKeys?: string[];
|
|
11
|
+
isActive?: ButtonViewReturnComponentProps['isActive'];
|
|
12
|
+
action?: ButtonViewReturnComponentProps['action'];
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
15
|
+
icon: undefined;
|
|
16
|
+
title: undefined;
|
|
17
|
+
tooltip: undefined;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
shortcutKeys: undefined;
|
|
20
|
+
action: undefined;
|
|
21
|
+
isActive: undefined;
|
|
22
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
23
|
+
icon: undefined;
|
|
24
|
+
title: undefined;
|
|
25
|
+
tooltip: undefined;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
shortcutKeys: undefined;
|
|
28
|
+
action: undefined;
|
|
29
|
+
isActive: undefined;
|
|
30
|
+
}>>> & Readonly<{}>, {
|
|
31
|
+
icon: any;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
title: string;
|
|
34
|
+
tooltip: string;
|
|
35
|
+
shortcutKeys: string[];
|
|
36
|
+
action: (value?: any) => void;
|
|
37
|
+
isActive: () => boolean;
|
|
38
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
export default _default;
|
|
40
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
41
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
42
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
43
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
44
|
+
} : {
|
|
45
|
+
type: import('vue').PropType<T[K]>;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type __VLS_WithDefaults<P, D> = {
|
|
50
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
51
|
+
default: D[K];
|
|
52
|
+
}> : P[K];
|
|
53
|
+
};
|
|
54
|
+
type __VLS_Prettify<T> = {
|
|
55
|
+
[K in keyof T]: T[K];
|
|
56
|
+
} & {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
link?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
8
|
+
link: undefined;
|
|
9
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
clear: (...args: any[]) => void;
|
|
11
|
+
edit: (...args: any[]) => void;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
13
|
+
link: undefined;
|
|
14
|
+
}>>> & Readonly<{
|
|
15
|
+
onClear?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
onEdit?: ((...args: any[]) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
link: string;
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithDefaults<P, D> = {
|
|
31
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
32
|
+
default: D[K];
|
|
33
|
+
}> : P[K];
|
|
34
|
+
};
|
|
35
|
+
type __VLS_Prettify<T> = {
|
|
36
|
+
[K in keyof T]: T[K];
|
|
37
|
+
} & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Link';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListItem';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { SubscriptExtensionOptions as TiptapSubscriptOptions } from '@tiptap/extension-subscript';
|
|
3
|
+
import { SuperscriptExtensionOptions as TiptapSuperscriptOptions } from '@tiptap/extension-superscript';
|
|
4
|
+
import { GeneralOptions } from '../../type';
|
|
5
|
+
|
|
6
|
+
export interface MoreMarkOptions extends GeneralOptions<MoreMarkOptions> {
|
|
7
|
+
/**
|
|
8
|
+
* // 下标
|
|
9
|
+
*
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
subscript: Partial<TiptapSubscriptOptions> | false;
|
|
13
|
+
/**
|
|
14
|
+
* // 上标
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
superscript: Partial<TiptapSuperscriptOptions> | false;
|
|
19
|
+
}
|
|
20
|
+
export declare const MoreMark: Extension<MoreMarkOptions, any>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { StyleValue } from 'vue';
|
|
2
|
+
import { icons } from '../../../components/icons';
|
|
3
|
+
import { Editor } from '@tiptap/vue-3';
|
|
4
|
+
import { ButtonViewReturnComponentProps } from '../../../type';
|
|
5
|
+
|
|
6
|
+
export interface Item {
|
|
7
|
+
title: string;
|
|
8
|
+
icon?: keyof typeof icons;
|
|
9
|
+
isActive: NonNullable<ButtonViewReturnComponentProps['isActive']>;
|
|
10
|
+
action?: ButtonViewReturnComponentProps['action'];
|
|
11
|
+
style?: StyleValue;
|
|
12
|
+
shortcutKeys?: string[];
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
divider?: boolean;
|
|
15
|
+
default?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface Props {
|
|
18
|
+
editor: Editor;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
color?: string;
|
|
21
|
+
maxHeight?: string | number;
|
|
22
|
+
icon?: any;
|
|
23
|
+
tooltip?: string;
|
|
24
|
+
items?: Item[];
|
|
25
|
+
}
|
|
26
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
color: undefined;
|
|
29
|
+
maxHeight: undefined;
|
|
30
|
+
icon: undefined;
|
|
31
|
+
tooltip: string;
|
|
32
|
+
items: () => never[];
|
|
33
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
color: undefined;
|
|
36
|
+
maxHeight: undefined;
|
|
37
|
+
icon: undefined;
|
|
38
|
+
tooltip: string;
|
|
39
|
+
items: () => never[];
|
|
40
|
+
}>>> & Readonly<{}>, {
|
|
41
|
+
icon: any;
|
|
42
|
+
color: string;
|
|
43
|
+
disabled: boolean;
|
|
44
|
+
tooltip: string;
|
|
45
|
+
maxHeight: string | number;
|
|
46
|
+
items: Item[];
|
|
47
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
50
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
51
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
52
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
53
|
+
} : {
|
|
54
|
+
type: import('vue').PropType<T[K]>;
|
|
55
|
+
required: true;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
type __VLS_WithDefaults<P, D> = {
|
|
59
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
60
|
+
default: D[K];
|
|
61
|
+
}> : P[K];
|
|
62
|
+
};
|
|
63
|
+
type __VLS_Prettify<T> = {
|
|
64
|
+
[K in keyof T]: T[K];
|
|
65
|
+
} & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MoreMark';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { GeneralOptions } from '../../type';
|
|
3
|
+
|
|
4
|
+
export declare enum ColumnLayout {
|
|
5
|
+
SidebarLeft = "sidebar-left",
|
|
6
|
+
SidebarRight = "sidebar-right",
|
|
7
|
+
TwoColumn = "two-column"
|
|
8
|
+
}
|
|
9
|
+
declare module '@tiptap/core' {
|
|
10
|
+
interface Commands<ReturnType> {
|
|
11
|
+
columns: {
|
|
12
|
+
setColumns: () => ReturnType;
|
|
13
|
+
setLayout: (layout: ColumnLayout) => ReturnType;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export interface ColumnsOptions extends GeneralOptions<ColumnsOptions> {
|
|
18
|
+
columnOptions: any;
|
|
19
|
+
layout: ColumnLayout;
|
|
20
|
+
}
|
|
21
|
+
export declare const Columns: Node<ColumnsOptions, any>;
|
|
22
|
+
export default Columns;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OrderedListOptions as TiptapOrderedListOptions } from '@tiptap/extension-ordered-list';
|
|
2
|
+
import { GeneralOptions } from '../../type';
|
|
3
|
+
|
|
4
|
+
export interface OrderedListOptions extends TiptapOrderedListOptions, GeneralOptions<OrderedListOptions> {
|
|
5
|
+
}
|
|
6
|
+
export declare const OrderedList: import('@tiptap/core').Node<OrderedListOptions, any>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import { ButtonViewReturnComponentProps } from '../../../type';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
shortcutKeys?: string[];
|
|
9
|
+
isActive?: ButtonViewReturnComponentProps['isActive'];
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
tooltip: string;
|
|
14
|
+
shortcutKeys: undefined;
|
|
15
|
+
isActive: undefined;
|
|
16
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
tooltip: string;
|
|
19
|
+
shortcutKeys: undefined;
|
|
20
|
+
isActive: undefined;
|
|
21
|
+
}>>> & Readonly<{}>, {
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
tooltip: string;
|
|
24
|
+
shortcutKeys: string[];
|
|
25
|
+
isActive: () => boolean;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
29
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
30
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
31
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
32
|
+
} : {
|
|
33
|
+
type: import('vue').PropType<T[K]>;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
type __VLS_WithDefaults<P, D> = {
|
|
38
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
39
|
+
default: D[K];
|
|
40
|
+
}> : P[K];
|
|
41
|
+
};
|
|
42
|
+
type __VLS_Prettify<T> = {
|
|
43
|
+
[K in keyof T]: T[K];
|
|
44
|
+
} & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './OrderedList';
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { Node, Schema } from '@tiptap/pm/model';
|
|
3
|
+
import { EditorState, Transaction } from '@tiptap/pm/state';
|
|
4
|
+
import { ComputedFn, NodesComputed, PageState, SplitInfo, SplitParams } from './types';
|
|
5
|
+
|
|
6
|
+
export declare const sameListCalculation: ComputedFn;
|
|
7
|
+
export declare const sameItemCalculation: ComputedFn;
|
|
8
|
+
export declare const defaultNodesComputed: NodesComputed;
|
|
9
|
+
/**
|
|
10
|
+
* 分页上下文类
|
|
11
|
+
*/
|
|
12
|
+
export declare class SplitContext {
|
|
13
|
+
#private;
|
|
14
|
+
attributes: Record<string, any>;
|
|
15
|
+
schema: Schema;
|
|
16
|
+
/**
|
|
17
|
+
* 获取文档
|
|
18
|
+
* @returns 文档
|
|
19
|
+
*/
|
|
20
|
+
getDoc(): Node;
|
|
21
|
+
/**
|
|
22
|
+
* 构造函数
|
|
23
|
+
* @param doc 文档
|
|
24
|
+
* @param height 分页高度
|
|
25
|
+
* @param paragraphDefaultHeight p标签的默认高度
|
|
26
|
+
*/
|
|
27
|
+
constructor(schema: Schema, doc: Node, height: number, paragraphDefaultHeight: number);
|
|
28
|
+
getHeight(): number;
|
|
29
|
+
/**
|
|
30
|
+
* 获取默认高度
|
|
31
|
+
* @returns 默认高度
|
|
32
|
+
*/
|
|
33
|
+
getDefaultHeight(): number;
|
|
34
|
+
/**
|
|
35
|
+
* 判断是否溢出
|
|
36
|
+
* @param height 增加的高度
|
|
37
|
+
* @returns 是否溢出
|
|
38
|
+
*/
|
|
39
|
+
isOverflow(height: number): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 增加高度
|
|
42
|
+
* @param height 增加的高度
|
|
43
|
+
*/
|
|
44
|
+
addHeight(height: number): void;
|
|
45
|
+
/**
|
|
46
|
+
* 设置切割点
|
|
47
|
+
* @param pos 切割点位置
|
|
48
|
+
* @param depth 切割点深度
|
|
49
|
+
*/
|
|
50
|
+
setBoundary(pos: number, depth: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* 获取切割点
|
|
53
|
+
* @returns 切割点
|
|
54
|
+
*/
|
|
55
|
+
pageBoundary(): SplitInfo | null;
|
|
56
|
+
/**
|
|
57
|
+
* 解析切割点
|
|
58
|
+
* @param pos 切割点位置
|
|
59
|
+
* @returns 解析结果
|
|
60
|
+
*/
|
|
61
|
+
splitResolve(pos: number): any;
|
|
62
|
+
/**
|
|
63
|
+
* 获取最后一页
|
|
64
|
+
* @returns 最后一页
|
|
65
|
+
*/
|
|
66
|
+
lastPage(): Node | null;
|
|
67
|
+
}
|
|
68
|
+
export declare class PageComputedContext {
|
|
69
|
+
nodesComputed: NodesComputed;
|
|
70
|
+
state: EditorState;
|
|
71
|
+
tr: Transaction;
|
|
72
|
+
pageState: PageState;
|
|
73
|
+
editor: Editor;
|
|
74
|
+
restDomIds: string[];
|
|
75
|
+
forcePageId: string | null;
|
|
76
|
+
startIndex: number;
|
|
77
|
+
constructor(editor: Editor, nodesComputed: NodesComputed, pageState: PageState, state: EditorState);
|
|
78
|
+
run(): Transaction | null;
|
|
79
|
+
prepare(): void;
|
|
80
|
+
computed(): Transaction;
|
|
81
|
+
/**
|
|
82
|
+
* 文档开始加载的时候进行初始化分页
|
|
83
|
+
*/
|
|
84
|
+
initComputed(): Transaction;
|
|
85
|
+
/**
|
|
86
|
+
* @description 递归分割page
|
|
87
|
+
*/
|
|
88
|
+
splitDocument(): void;
|
|
89
|
+
/**
|
|
90
|
+
* 重第count页开始合并page
|
|
91
|
+
* @param count
|
|
92
|
+
*/
|
|
93
|
+
mergeDefaultDocument(count: number): void;
|
|
94
|
+
/**
|
|
95
|
+
* @method mergeDocument
|
|
96
|
+
* @description 合并剩余文档 将剩余文档进行分页
|
|
97
|
+
* 深度判断:如果剩余页的 第一个子标签是 扩展类型(是主类型的拆分类型) 进行合并的时候 深度为2
|
|
98
|
+
* 如果第一个标签不是扩展类型 则深度为1
|
|
99
|
+
*/
|
|
100
|
+
mergeDocument(): void;
|
|
101
|
+
forceSplit(): Transaction;
|
|
102
|
+
/**
|
|
103
|
+
* @description 分页主要逻辑 修改系统tr split方法 添加默认 extend判断 默认id重新生成
|
|
104
|
+
* @author Cassie
|
|
105
|
+
* @method splitPage 分割页面
|
|
106
|
+
* @param pos
|
|
107
|
+
* @param depth
|
|
108
|
+
* @param typesAfter
|
|
109
|
+
* @param schema
|
|
110
|
+
*/
|
|
111
|
+
lift({ pos, depth, typesAfter, schema, force }: SplitParams): void;
|
|
112
|
+
/**
|
|
113
|
+
* desc 检查并修正分页造成的段落分行问题
|
|
114
|
+
*/
|
|
115
|
+
checkNodeAndFix(): Transaction;
|
|
116
|
+
/**
|
|
117
|
+
* @description 获取需要分页的点 然后返回
|
|
118
|
+
* @author Cassie
|
|
119
|
+
* @method getNodeHeight 获取节点高度
|
|
120
|
+
*/
|
|
121
|
+
getNodeHeight(): SplitInfo | null;
|
|
122
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/core';
|
|
2
|
+
import { Node, Schema } from '@tiptap/pm/model';
|
|
3
|
+
import { SplitContext } from './computed';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 根据schema doc生成html
|
|
7
|
+
* @param doc
|
|
8
|
+
* @param schema
|
|
9
|
+
* @param options
|
|
10
|
+
*/
|
|
11
|
+
export declare function getHTMLFromFragment(doc: Node, schema: Schema, options?: {
|
|
12
|
+
document?: Document;
|
|
13
|
+
}): string;
|
|
14
|
+
export declare function generateHTML(doc: JSONContent, schema: Schema): string;
|
|
15
|
+
/**
|
|
16
|
+
* 计算最后一行是否填满
|
|
17
|
+
* @param cnode
|
|
18
|
+
*/
|
|
19
|
+
export declare function getFlag(cnode: Node, schema: Schema): boolean | null;
|
|
20
|
+
export declare function getBreakPos(cnode: Node, dom: HTMLElement, splitContex: SplitContext): number | null;
|
|
21
|
+
/**
|
|
22
|
+
* 工具类
|
|
23
|
+
* @param node
|
|
24
|
+
*/
|
|
25
|
+
export declare function getJsonFromDoc(node: Node): {
|
|
26
|
+
type: string;
|
|
27
|
+
content: any[];
|
|
28
|
+
};
|
|
29
|
+
export declare class UnitConversion {
|
|
30
|
+
arrDPI: any[];
|
|
31
|
+
constructor();
|
|
32
|
+
/**
|
|
33
|
+
* @description px to mm
|
|
34
|
+
* @param value px值
|
|
35
|
+
*/
|
|
36
|
+
pxConversionMm(value: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* @description mm to px
|
|
39
|
+
* @param value px值
|
|
40
|
+
*/
|
|
41
|
+
mmConversionPx(value: number): number;
|
|
42
|
+
cmConversionPx(value: number): number;
|
|
43
|
+
}
|
|
44
|
+
export declare function getPageOption(restore?: boolean): any;
|
|
45
|
+
export declare function computedHeight(html: string, id: string, cache?: boolean): any;
|
|
46
|
+
export declare function computedWidth(html: string, cache?: boolean): any;
|
|
47
|
+
export declare function getDefault(): any;
|
|
48
|
+
export declare function getDomHeight(dom: HTMLElement): {
|
|
49
|
+
margin: number;
|
|
50
|
+
height: number;
|
|
51
|
+
};
|
|
52
|
+
export declare function getAbsentHtmlH(node: Node, schema: Schema): any;
|
|
53
|
+
export declare function removeAbsentHtmlH(): void;
|
|
54
|
+
export declare function removeComputedHtml(): void;
|
|
55
|
+
/**
|
|
56
|
+
* 构建计算html需要的辅助iframe 和打印html
|
|
57
|
+
* @param options
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildComputedHtml(): void;
|
|
60
|
+
export declare function changeComputedHtml(): void;
|
|
61
|
+
export declare function getId(): string;
|
|
62
|
+
export declare const findParentDomRefOfType: (nodeType: any, domAtPos: any) => (selection: any) => any;
|
|
63
|
+
export declare const equalNodeType: (nodeType: any, node: any) => boolean;
|
|
64
|
+
export declare const findParentDomRef: (predicate: any, domAtPos: any) => (selection: any) => any;
|
|
65
|
+
export declare const findDomRefAtPos: (position: any, domAtPos: any) => any;
|
|
66
|
+
export declare const findParentNode: (predicate: any) => ({ $from }: {
|
|
67
|
+
$from: any;
|
|
68
|
+
}) => {
|
|
69
|
+
pos: any;
|
|
70
|
+
start: any;
|
|
71
|
+
depth: any;
|
|
72
|
+
node: any;
|
|
73
|
+
} | undefined;
|
|
74
|
+
export declare const findParentNodeClosestToPos: ($pos: any, predicate: any) => {
|
|
75
|
+
pos: any;
|
|
76
|
+
start: any;
|
|
77
|
+
depth: any;
|
|
78
|
+
node: any;
|
|
79
|
+
} | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { ExtensionAttribute } from '@tiptap/vue-3';
|
|
3
|
+
import { PageOptions } from './types';
|
|
4
|
+
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
setPageBreak: {
|
|
8
|
+
/**
|
|
9
|
+
* Splits one list item into two list items.
|
|
10
|
+
*/
|
|
11
|
+
setPageBreak: () => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
autoPaging: {
|
|
14
|
+
/**
|
|
15
|
+
* Splits one list item into two list items.
|
|
16
|
+
*/
|
|
17
|
+
autoPaging: (status: boolean | undefined) => ReturnType;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare const _default: Node<PageOptions, any>;
|
|
22
|
+
export default _default;
|
|
23
|
+
export declare function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
|