neweditor 1.0.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/README.md +301 -0
- package/dist/components/BubbleItem.vue.d.ts +32 -0
- package/dist/components/Editor.vue.d.ts +53 -0
- package/dist/components/EditorBubbleMenu.vue.d.ts +14 -0
- package/dist/components/EditorHeader.vue.d.ts +13 -0
- package/dist/components/block/BlockActionButton.vue.d.ts +24 -0
- package/dist/components/block/BlockActionInput.vue.d.ts +13 -0
- package/dist/components/block/BlockActionSeparator.vue.d.ts +2 -0
- package/dist/components/block/BlockCard.vue.d.ts +27 -0
- package/dist/components/block/index.d.ts +4 -0
- package/dist/components/common/ColorPickerDropdown.vue.d.ts +27 -0
- package/dist/components/icon/MdiDeleteForeverOutline.vue.d.ts +2 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/toolbar/ToolbarItem.vue.d.ts +19 -0
- package/dist/components/toolbar/ToolbarSubItem.vue.d.ts +16 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbox/ToolboxItem.vue.d.ts +17 -0
- package/dist/components/toolbox/index.d.ts +1 -0
- package/dist/dev/App.vue.d.ts +2 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/extensions/audio/AudioView.vue.d.ts +5 -0
- package/dist/extensions/audio/BubbleItemAudioLink.vue.d.ts +18 -0
- package/dist/extensions/audio/index.d.ts +14 -0
- package/dist/extensions/blockquote/index.d.ts +4 -0
- package/dist/extensions/bold/index.d.ts +3 -0
- package/dist/extensions/bullet-list/index.d.ts +3 -0
- package/dist/extensions/clear-format/index.d.ts +4 -0
- package/dist/extensions/code/index.d.ts +4 -0
- package/dist/extensions/code-block/CodeBlockSelect.vue.d.ts +24 -0
- package/dist/extensions/code-block/CodeBlockViewRenderer.vue.d.ts +3 -0
- package/dist/extensions/code-block/code-block.d.ts +68 -0
- package/dist/extensions/code-block/index.d.ts +2 -0
- package/dist/extensions/code-block/lowlight-plugin.d.ts +2 -0
- package/dist/extensions/color/ColorBubbleItem.vue.d.ts +18 -0
- package/dist/extensions/color/ColorToolbarItem.vue.d.ts +19 -0
- package/dist/extensions/color/index.d.ts +4 -0
- package/dist/extensions/columns/column.d.ts +3 -0
- package/dist/extensions/columns/columns.d.ts +23 -0
- package/dist/extensions/columns/index.d.ts +2 -0
- package/dist/extensions/commands-menu/CommandsView.vue.d.ts +27 -0
- package/dist/extensions/commands-menu/commands.d.ts +3 -0
- package/dist/extensions/commands-menu/index.d.ts +1 -0
- package/dist/extensions/details/index.d.ts +6 -0
- package/dist/extensions/draggable/index.d.ts +13 -0
- package/dist/extensions/font-size/index.d.ts +5 -0
- package/dist/extensions/format-brush/index.d.ts +15 -0
- package/dist/extensions/format-brush/util.d.ts +27 -0
- package/dist/extensions/fullscreen/index.d.ts +6 -0
- package/dist/extensions/gap-cursor/gap-cursor-selection.d.ts +44 -0
- package/dist/extensions/gap-cursor/index.d.ts +41 -0
- package/dist/extensions/heading/index.d.ts +4 -0
- package/dist/extensions/highlight/HighlightBubbleItem.vue.d.ts +18 -0
- package/dist/extensions/highlight/HighlightToolbarItem.vue.d.ts +19 -0
- package/dist/extensions/highlight/index.d.ts +4 -0
- package/dist/extensions/history/index.d.ts +3 -0
- package/dist/extensions/iframe/BubbleItemIframeLink.vue.d.ts +18 -0
- package/dist/extensions/iframe/BubbleItemIframeSize.vue.d.ts +6 -0
- package/dist/extensions/iframe/IframeView.vue.d.ts +5 -0
- package/dist/extensions/iframe/index.d.ts +14 -0
- package/dist/extensions/image/BubbleItemImageAlt.vue.d.ts +18 -0
- package/dist/extensions/image/BubbleItemImageHref.vue.d.ts +18 -0
- package/dist/extensions/image/BubbleItemImageLink.vue.d.ts +18 -0
- package/dist/extensions/image/BubbleItemImageSize.vue.d.ts +18 -0
- package/dist/extensions/image/ImageView.vue.d.ts +6 -0
- package/dist/extensions/image/index.d.ts +6 -0
- package/dist/extensions/indent/index.d.ts +24 -0
- package/dist/extensions/index.d.ts +55 -0
- package/dist/extensions/italic/index.d.ts +3 -0
- package/dist/extensions/link/LinkBubbleButton.vue.d.ts +18 -0
- package/dist/extensions/link/index.d.ts +4 -0
- package/dist/extensions/list-keymap/index.d.ts +7 -0
- package/dist/extensions/node-selected/index.d.ts +6 -0
- package/dist/extensions/ordered-list/index.d.ts +3 -0
- package/dist/extensions/paragraph/index.d.ts +6 -0
- package/dist/extensions/range-selection/index.d.ts +22 -0
- package/dist/extensions/range-selection/range-selection.d.ts +64 -0
- package/dist/extensions/search-and-replace/SearchAndReplace.vue.d.ts +36 -0
- package/dist/extensions/search-and-replace/SearchAndReplacePlugin.d.ts +109 -0
- package/dist/extensions/search-and-replace/index.d.ts +34 -0
- package/dist/extensions/sidebar-toggle/index.d.ts +25 -0
- package/dist/extensions/strike/index.d.ts +3 -0
- package/dist/extensions/subscript/index.d.ts +3 -0
- package/dist/extensions/superscript/index.d.ts +3 -0
- package/dist/extensions/table/index.d.ts +6 -0
- package/dist/extensions/table/table-cell.d.ts +6 -0
- package/dist/extensions/table/table-header.d.ts +6 -0
- package/dist/extensions/table/table-row.d.ts +2 -0
- package/dist/extensions/table/util.d.ts +44 -0
- package/dist/extensions/task-list/index.d.ts +3 -0
- package/dist/extensions/text/index.d.ts +5 -0
- package/dist/extensions/text-align/index.d.ts +4 -0
- package/dist/extensions/text-style/index.d.ts +2 -0
- package/dist/extensions/trailing-node/index.d.ts +9 -0
- package/dist/extensions/underline/index.d.ts +3 -0
- package/dist/extensions/video/BubbleItemVideoLink.vue.d.ts +18 -0
- package/dist/extensions/video/BubbleItemVideoSize.vue.d.ts +18 -0
- package/dist/extensions/video/VideoView.vue.d.ts +5 -0
- package/dist/extensions/video/index.d.ts +14 -0
- package/dist/index.d.ts +9 -0
- package/dist/locales/index.d.ts +7 -0
- package/dist/rich-text-editor.es.js +56411 -0
- package/dist/style.css +10 -0
- package/dist/tiptap/core/index.d.ts +1 -0
- package/dist/tiptap/index.d.ts +6 -0
- package/dist/tiptap/pm/index.d.ts +19 -0
- package/dist/tiptap/vue-3/index.d.ts +1 -0
- package/dist/types/index.d.ts +139 -0
- package/dist/utils/anchor.d.ts +2 -0
- package/dist/utils/delete-node.d.ts +4 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/is-allowed-uri.d.ts +1 -0
- package/dist/utils/is-list-active.d.ts +12 -0
- package/dist/utils/is-node-empty.d.ts +4 -0
- package/package.json +115 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface Option {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
container?: any;
|
|
7
|
+
containerClass?: string;
|
|
8
|
+
options: Option[];
|
|
9
|
+
filterSort?: (options: Option[], query: string) => number;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = {
|
|
12
|
+
modelValue?: string;
|
|
13
|
+
} & __VLS_Props;
|
|
14
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (value: string) => any;
|
|
16
|
+
} & {
|
|
17
|
+
select: () => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
onSelect?: (() => any) | undefined;
|
|
20
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
22
|
+
inputRef: HTMLInputElement;
|
|
23
|
+
}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NodeViewProps } from '../../tiptap/vue-3';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<NodeViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { EditorState, PluginKey } from '../../tiptap/pm';
|
|
2
|
+
import { ExtensionOptions } from '../../types';
|
|
3
|
+
declare module '../../tiptap' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
codeIndent: {
|
|
6
|
+
codeIndent: () => ReturnType;
|
|
7
|
+
codeOutdent: () => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export interface Option {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CodeBlockOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Define whether the node should be exited on triple enter.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
exitOnTripleEnter: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Define whether the node should be exited on arrow down if there is no node after it.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
exitOnArrowDown: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Custom HTML attributes that should be added to the rendered HTML tag.
|
|
28
|
+
* @default {}
|
|
29
|
+
* @example { class: 'foo' }
|
|
30
|
+
*/
|
|
31
|
+
HTMLAttributes: Record<string, any>;
|
|
32
|
+
/**
|
|
33
|
+
* The default language for code block
|
|
34
|
+
* @default null
|
|
35
|
+
*/
|
|
36
|
+
defaultLanguage: string | null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The default theme for code block
|
|
39
|
+
* @default null
|
|
40
|
+
*/
|
|
41
|
+
defaultTheme: string | null | undefined;
|
|
42
|
+
}
|
|
43
|
+
export interface ExtensionCodeBlockOptions extends CodeBlockOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Used for language list
|
|
46
|
+
*
|
|
47
|
+
* @default []
|
|
48
|
+
*/
|
|
49
|
+
languages: Array<Option> | ((state: EditorState) => Array<{
|
|
50
|
+
label: string;
|
|
51
|
+
value: string;
|
|
52
|
+
}>);
|
|
53
|
+
/**
|
|
54
|
+
* Used for theme list
|
|
55
|
+
*
|
|
56
|
+
* @default []
|
|
57
|
+
*/
|
|
58
|
+
themes?: Array<{
|
|
59
|
+
label: string;
|
|
60
|
+
value: string;
|
|
61
|
+
}> | ((state: EditorState) => Array<{
|
|
62
|
+
label: string;
|
|
63
|
+
value: string;
|
|
64
|
+
}>);
|
|
65
|
+
}
|
|
66
|
+
export declare const CODE_BLOCK_BUBBLE_MENU_KEY: PluginKey<any>;
|
|
67
|
+
export declare const CodeBlockExtension: import('@tiptap/core').Node<ExtensionOptions & Partial<ExtensionCodeBlockOptions> & Partial<CodeBlockOptions>, any>;
|
|
68
|
+
export default CodeBlockExtension;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor?: Editor;
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
action?: () => void;
|
|
9
|
+
icon?: Component;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
title: string;
|
|
13
|
+
editor: Editor;
|
|
14
|
+
icon: Component;
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
action: () => void;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Node } from '../../tiptap';
|
|
2
|
+
import { PluginKey } from '../../tiptap/pm';
|
|
3
|
+
import { ExtensionOptions } from '../../types';
|
|
4
|
+
declare module '../../tiptap' {
|
|
5
|
+
interface Commands<ReturnType> {
|
|
6
|
+
columns: {
|
|
7
|
+
insertColumns: (attrs?: {
|
|
8
|
+
cols: number;
|
|
9
|
+
}) => ReturnType;
|
|
10
|
+
addColBefore: () => ReturnType;
|
|
11
|
+
addColAfter: () => ReturnType;
|
|
12
|
+
deleteCol: () => ReturnType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const COLUMNS_BUBBLE_MENU_KEY: PluginKey<any>;
|
|
17
|
+
export interface ColumnsOptions {
|
|
18
|
+
HTMLAttributes: {
|
|
19
|
+
class: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
declare const Columns: Node<ExtensionOptions & ColumnsOptions, any>;
|
|
23
|
+
export default Columns;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CommandMenuItemType } from '../../types';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
declare function onKeyDown({ event }: {
|
|
4
|
+
event: KeyboardEvent;
|
|
5
|
+
}): boolean;
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
+
items: {
|
|
8
|
+
type: PropType<CommandMenuItemType[]>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
command: {
|
|
12
|
+
type: PropType<(item: CommandMenuItemType) => void>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>, {
|
|
16
|
+
onKeyDown: typeof onKeyDown;
|
|
17
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
items: {
|
|
19
|
+
type: PropType<CommandMenuItemType[]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
command: {
|
|
23
|
+
type: PropType<(item: CommandMenuItemType) => void>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ExtensionCommands } from './commands';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginKey } from '../../tiptap';
|
|
2
|
+
import { ExtensionOptions } from '../../types';
|
|
3
|
+
import { DetailsOptions } from '@tiptap/extension-details';
|
|
4
|
+
export declare const DETAILS_BUBBLE_MENU_KEY: PluginKey<any>;
|
|
5
|
+
declare const Details: import('@tiptap/core').Node<ExtensionOptions & Partial<DetailsOptions>, any>;
|
|
6
|
+
export default Details;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EditorView, Node, ResolvedPos } from '../../tiptap/pm';
|
|
2
|
+
import { Extension } from '../../tiptap/vue-3';
|
|
3
|
+
export interface ActiveNode {
|
|
4
|
+
$pos: ResolvedPos;
|
|
5
|
+
node: Node;
|
|
6
|
+
el: HTMLElement;
|
|
7
|
+
offset: number;
|
|
8
|
+
domOffsetLeft: number;
|
|
9
|
+
domOffsetTop: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const selectAncestorNodeByDom: (dom: HTMLElement, view: EditorView) => ActiveNode | null;
|
|
12
|
+
declare const Draggable: Extension<any, any>;
|
|
13
|
+
export default Draggable;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Extension } from '../../tiptap';
|
|
2
|
+
declare module '../../tiptap' {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
formatBrush: {
|
|
5
|
+
copyFormatBrush: () => ReturnType;
|
|
6
|
+
pasteFormatBrush: () => ReturnType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export interface FormatBrushStore {
|
|
11
|
+
formatBrush: boolean;
|
|
12
|
+
formatBrushMarks: any[];
|
|
13
|
+
}
|
|
14
|
+
declare const formatBrush: Extension<any, FormatBrushStore>;
|
|
15
|
+
export default formatBrush;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EditorState, MarkRange, Transaction } from '../../tiptap';
|
|
2
|
+
/**
|
|
3
|
+
* get its marks through the first text node in the selector
|
|
4
|
+
*
|
|
5
|
+
* @param state editor state
|
|
6
|
+
* @returns the marks of the current first text node
|
|
7
|
+
*/
|
|
8
|
+
export declare const getMarksByFirstTextNode: (state: EditorState) => MarkRange[];
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* Set marks for the text in the currently selected content. This method will first remove all marks
|
|
12
|
+
* from the currently selected text, and then add marks again.
|
|
13
|
+
*
|
|
14
|
+
* For CellSelection, it is necessary to iterate through ranges and set marks for each range.
|
|
15
|
+
*
|
|
16
|
+
* @param state editor state
|
|
17
|
+
* @param marks the marks to be set
|
|
18
|
+
* @param transaction transaction
|
|
19
|
+
*
|
|
20
|
+
* @returns transaction
|
|
21
|
+
*
|
|
22
|
+
* */
|
|
23
|
+
export declare const setMarks: (state: EditorState, marks: MarkRange[], transaction?: Transaction) => Transaction;
|
|
24
|
+
export declare const setMarksByRange: (tr: Transaction, state: EditorState, range: {
|
|
25
|
+
from: number;
|
|
26
|
+
to: number;
|
|
27
|
+
}, marks: MarkRange[]) => void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PMNode } from '../../tiptap';
|
|
2
|
+
import { ResolvedPos, Selection, Slice, Mappable } from '../../tiptap/pm';
|
|
3
|
+
declare class GapCursorSelection extends Selection {
|
|
4
|
+
private start;
|
|
5
|
+
constructor($pos: ResolvedPos);
|
|
6
|
+
map(doc: PMNode, mapping: Mappable): Selection;
|
|
7
|
+
content(): Slice;
|
|
8
|
+
eq(other: Selection): boolean;
|
|
9
|
+
toJSON(): any;
|
|
10
|
+
get isStart(): boolean | null;
|
|
11
|
+
static fromJSON(doc: PMNode, json: any): GapCursorSelection;
|
|
12
|
+
getBookmark(): GapBookmark;
|
|
13
|
+
/**
|
|
14
|
+
* Validates if a GapCursor can be placed at the given position
|
|
15
|
+
*
|
|
16
|
+
* This function checks whether a GapCursor can be placed at the specified position in the document.
|
|
17
|
+
* It ensures that the position is not within a text block, and that the node at the position allows a GapCursor.
|
|
18
|
+
*
|
|
19
|
+
* @param {ResolvedPos} $pos - The resolved position in the document to validate.
|
|
20
|
+
* @returns {boolean} - Returns true if a GapCursor can be placed at the given position, false otherwise.
|
|
21
|
+
*/
|
|
22
|
+
static valid($pos: ResolvedPos): boolean;
|
|
23
|
+
static findGapCursorFrom($pos: ResolvedPos, dir: number, mustMove?: boolean): ResolvedPos | null;
|
|
24
|
+
}
|
|
25
|
+
declare class GapBookmark {
|
|
26
|
+
readonly pos: number;
|
|
27
|
+
constructor(pos: number);
|
|
28
|
+
map(mapping: Mappable): GapBookmark;
|
|
29
|
+
resolve(doc: PMNode): Selection | GapCursorSelection;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Checks if the position before the given resolved position is closed
|
|
33
|
+
*
|
|
34
|
+
* This function traverses up the document tree from the given resolved position and checks if the position
|
|
35
|
+
* immediately before it is closed. A position is considered closed if the previous node is closed or
|
|
36
|
+
* if the parent node is isolating.
|
|
37
|
+
*
|
|
38
|
+
* @param {ResolvedPos} $pos - The resolved position in the document to check.
|
|
39
|
+
* @returns {boolean} - Returns true if the position before the given position is closed, false otherwise.
|
|
40
|
+
*/
|
|
41
|
+
export declare function closedBefore($pos: ResolvedPos): boolean;
|
|
42
|
+
export declare function closedAfter($pos: ResolvedPos): boolean;
|
|
43
|
+
export declare function isNodeStart($pos: ResolvedPos): boolean | null;
|
|
44
|
+
export default GapCursorSelection;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Dispatch, EditorState, EditorView, ResolvedPos, Transaction } from '../../tiptap';
|
|
2
|
+
import { Extension, ParentConfig } from '../../tiptap/core';
|
|
3
|
+
import { Command } from '../../tiptap/pm';
|
|
4
|
+
declare module "@tiptap/core" {
|
|
5
|
+
interface NodeConfig<Options, Storage> {
|
|
6
|
+
allowGapCursor?: boolean | null | ((this: {
|
|
7
|
+
name: string;
|
|
8
|
+
options: Options;
|
|
9
|
+
storage: Storage;
|
|
10
|
+
parent: ParentConfig<NodeConfig<Options>>["allowGapCursor"];
|
|
11
|
+
}) => boolean | null);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Adds GapCursor to top-level nodes
|
|
16
|
+
*
|
|
17
|
+
* When the top-level nodes (nodes with a depth of 1 relative to the doc) have the {@link NodeConfig#allowGapCursor} attribute set to true,
|
|
18
|
+
* a GapCursor can be inserted before and after these nodes.
|
|
19
|
+
*
|
|
20
|
+
* This extension provides the ability to navigate between these nodes using the arrow keys.
|
|
21
|
+
*
|
|
22
|
+
* Note that some nodes and shortcuts may conflict with GapCursor due to their own behaviors, such as:
|
|
23
|
+
* - CodeBlock nodes
|
|
24
|
+
* - Backspace on an empty line
|
|
25
|
+
* - Tab key
|
|
26
|
+
*/
|
|
27
|
+
declare const GapCursor: Extension<any, any>;
|
|
28
|
+
export declare function handleBackspaceAtStart(pos: number, state: EditorState, dispatch: Dispatch): boolean;
|
|
29
|
+
export declare function handleInlineContent($beforePos: ResolvedPos, state: EditorState, dispatch: Dispatch): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Handles arrow key navigation for GapCursor
|
|
32
|
+
*
|
|
33
|
+
* This function determines the direction (vertical or horizontal) and
|
|
34
|
+
* the movement (positive or negative) based on the axis and direction parameters.
|
|
35
|
+
*
|
|
36
|
+
* @param {("vert" | "horiz")} axis - The axis of movement, either vertical ("vert") or horizontal ("horiz").
|
|
37
|
+
* @param {number} dir - The direction of movement, positive (1) or negative (-1).
|
|
38
|
+
*/
|
|
39
|
+
export declare function arrow(axis: "vert" | "horiz", dir: number): Command;
|
|
40
|
+
export declare const arrowGapCursor: (dir: number, dirStr: any, state: EditorState, view?: EditorView) => (tr: Transaction) => ResolvedPos | undefined;
|
|
41
|
+
export default GapCursor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor?: Editor;
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
action?: () => void;
|
|
9
|
+
icon?: Component;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
title: string;
|
|
13
|
+
editor: Editor;
|
|
14
|
+
icon: Component;
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
action: () => void;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLInputElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NodeViewProps } from '../../tiptap/vue-3';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<NodeViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
3
|
+
inputRef: HTMLInputElement;
|
|
4
|
+
}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Node, PluginKey } from '../../tiptap';
|
|
2
|
+
import { ExtensionOptions } from '../../types';
|
|
3
|
+
declare module '../../tiptap' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
iframe: {
|
|
6
|
+
setIframe: (options: {
|
|
7
|
+
src: string;
|
|
8
|
+
}) => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const IFRAME_BUBBLE_MENU_KEY: PluginKey<any>;
|
|
13
|
+
declare const Iframe: Node<ExtensionOptions, any>;
|
|
14
|
+
export default Iframe;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLInputElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLInputElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor } from '../../tiptap';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
isActive?: ({ editor }: {
|
|
6
|
+
editor: Editor;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
visible?: ({ editor }: {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
title?: string;
|
|
13
|
+
action?: ({ editor }: {
|
|
14
|
+
editor: Editor;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NodeViewProps } from '../../tiptap/vue-3';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<NodeViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
3
|
+
inputRef: HTMLInputElement;
|
|
4
|
+
resizeRef: HTMLDivElement;
|
|
5
|
+
}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginKey } from '../../tiptap';
|
|
2
|
+
import { ExtensionOptions } from '../../types';
|
|
3
|
+
import { ImageOptions } from '@tiptap/extension-image';
|
|
4
|
+
export declare const IMAGE_BUBBLE_MENU_KEY: PluginKey<any>;
|
|
5
|
+
declare const Image: import('@tiptap/core').Node<ExtensionOptions & Partial<ImageOptions>, any>;
|
|
6
|
+
export default Image;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Extension, KeyboardShortcutCommand } from '../../tiptap';
|
|
2
|
+
import { ExtensionOptions } from '../../types';
|
|
3
|
+
declare module '../../tiptap' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
indent: {
|
|
6
|
+
indent: () => ReturnType;
|
|
7
|
+
outdent: () => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
type IndentOptions = {
|
|
12
|
+
names: Array<string>;
|
|
13
|
+
indentRange: number;
|
|
14
|
+
minIndentLevel: number;
|
|
15
|
+
maxIndentLevel: number;
|
|
16
|
+
defaultIndentLevel: number;
|
|
17
|
+
HTMLAttributes: Record<string, any>;
|
|
18
|
+
firstLineIndent: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare const Indent: Extension<IndentOptions & ExtensionOptions, any>;
|
|
21
|
+
export declare const clamp: (val: number, min: number, max: number) => number;
|
|
22
|
+
export declare const getIndent: () => KeyboardShortcutCommand;
|
|
23
|
+
export declare const getOutdent: (outdentOnlyAtHead: boolean) => KeyboardShortcutCommand;
|
|
24
|
+
export default Indent;
|