@tiptap/vue-3 3.0.0 → 3.0.2
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.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +577 -455
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +228 -0
- package/dist/index.d.ts +228 -0
- package/dist/index.js +541 -443
- package/dist/index.js.map +1 -1
- package/dist/menus/index.cjs +693 -0
- package/dist/menus/index.cjs.map +1 -0
- package/dist/menus/index.d.cts +279 -0
- package/dist/menus/index.d.ts +279 -0
- package/dist/menus/index.js +685 -0
- package/dist/menus/index.js.map +1 -0
- package/package.json +28 -17
- package/src/Editor.ts +23 -17
- package/src/EditorContent.ts +14 -44
- package/src/VueMarkViewRenderer.ts +130 -0
- package/src/VueNodeViewRenderer.ts +99 -36
- package/src/VueRenderer.ts +27 -18
- package/src/index.ts +1 -2
- package/src/menus/BubbleMenu.ts +78 -0
- package/src/menus/FloatingMenu.ts +68 -0
- package/src/menus/index.ts +2 -0
- package/src/useEditor.ts +7 -1
- package/dist/index.umd.js +0 -495
- package/dist/index.umd.js.map +0 -1
- package/dist/packages/core/src/CommandManager.d.ts +0 -20
- package/dist/packages/core/src/Editor.d.ts +0 -161
- package/dist/packages/core/src/EventEmitter.d.ts +0 -11
- package/dist/packages/core/src/Extension.d.ts +0 -343
- package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
- package/dist/packages/core/src/InputRule.d.ts +0 -42
- package/dist/packages/core/src/Mark.d.ts +0 -451
- package/dist/packages/core/src/Node.d.ts +0 -611
- package/dist/packages/core/src/NodePos.d.ts +0 -44
- package/dist/packages/core/src/NodeView.d.ts +0 -31
- package/dist/packages/core/src/PasteRule.d.ts +0 -50
- package/dist/packages/core/src/Tracker.d.ts +0 -11
- package/dist/packages/core/src/commands/blur.d.ts +0 -13
- package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
- package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
- package/dist/packages/core/src/commands/command.d.ts +0 -18
- package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
- package/dist/packages/core/src/commands/cut.d.ts +0 -20
- package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
- package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
- package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
- package/dist/packages/core/src/commands/enter.d.ts +0 -13
- package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
- package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
- package/dist/packages/core/src/commands/first.d.ts +0 -14
- package/dist/packages/core/src/commands/focus.d.ts +0 -27
- package/dist/packages/core/src/commands/forEach.d.ts +0 -14
- package/dist/packages/core/src/commands/index.d.ts +0 -55
- package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
- package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
- package/dist/packages/core/src/commands/join.d.ts +0 -41
- package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
- package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
- package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
- package/dist/packages/core/src/commands/lift.d.ts +0 -17
- package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
- package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
- package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
- package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
- package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
- package/dist/packages/core/src/commands/setContent.d.ts +0 -40
- package/dist/packages/core/src/commands/setMark.d.ts +0 -15
- package/dist/packages/core/src/commands/setMeta.d.ts +0 -15
- package/dist/packages/core/src/commands/setNode.d.ts +0 -16
- package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
- package/dist/packages/core/src/commands/splitListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
- package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
- package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
- package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
- package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
- package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
- package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
- package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
- package/dist/packages/core/src/extensions/commands.d.ts +0 -3
- package/dist/packages/core/src/extensions/editable.d.ts +0 -2
- package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
- package/dist/packages/core/src/extensions/index.d.ts +0 -6
- package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
- package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
- package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
- package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
- package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
- package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
- package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
- package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
- package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
- package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
- package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getText.d.ts +0 -15
- package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
- package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
- package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
- package/dist/packages/core/src/helpers/index.d.ts +0 -50
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
- package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
- package/dist/packages/core/src/helpers/isList.d.ts +0 -2
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -2
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
- package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
- package/dist/packages/core/src/index.d.ts +0 -24
- package/dist/packages/core/src/inputRules/index.d.ts +0 -5
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
- package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
- package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
- package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
- package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
- package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -13
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
- package/dist/packages/core/src/style.d.ts +0 -1
- package/dist/packages/core/src/types.d.ts +0 -255
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
- package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
- package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
- package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/index.d.ts +0 -20
- package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
- package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
- package/dist/packages/core/src/utilities/isString.d.ts +0 -1
- package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
- package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
- package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
- package/dist/packages/extension-bubble-menu/src/bubble-menu-plugin.d.ts +0 -76
- package/dist/packages/extension-bubble-menu/src/bubble-menu.d.ts +0 -15
- package/dist/packages/extension-bubble-menu/src/index.d.ts +0 -4
- package/dist/packages/extension-floating-menu/src/floating-menu-plugin.d.ts +0 -66
- package/dist/packages/extension-floating-menu/src/floating-menu.d.ts +0 -15
- package/dist/packages/extension-floating-menu/src/index.d.ts +0 -4
- package/dist/packages/vue-3/src/BubbleMenu.d.ts +0 -59
- package/dist/packages/vue-3/src/Editor.d.ts +0 -23
- package/dist/packages/vue-3/src/EditorContent.d.ts +0 -17
- package/dist/packages/vue-3/src/FloatingMenu.d.ts +0 -48
- package/dist/packages/vue-3/src/NodeViewContent.d.ts +0 -13
- package/dist/packages/vue-3/src/NodeViewWrapper.d.ts +0 -13
- package/dist/packages/vue-3/src/VueNodeViewRenderer.d.ts +0 -48
- package/dist/packages/vue-3/src/VueRenderer.d.ts +0 -36
- package/dist/packages/vue-3/src/index.d.ts +0 -10
- package/dist/packages/vue-3/src/useEditor.d.ts +0 -3
- package/src/BubbleMenu.ts +0 -71
- package/src/FloatingMenu.ts +0 -66
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';
|
|
2
|
-
import { PropType } from 'vue';
|
|
3
|
-
export declare const FloatingMenu: import("vue").DefineComponent<{
|
|
4
|
-
pluginKey: {
|
|
5
|
-
type: null;
|
|
6
|
-
default: string;
|
|
7
|
-
};
|
|
8
|
-
editor: {
|
|
9
|
-
type: PropType<FloatingMenuPluginProps["editor"]>;
|
|
10
|
-
required: true;
|
|
11
|
-
};
|
|
12
|
-
tippyOptions: {
|
|
13
|
-
type: PropType<FloatingMenuPluginProps["tippyOptions"]>;
|
|
14
|
-
default: () => {};
|
|
15
|
-
};
|
|
16
|
-
shouldShow: {
|
|
17
|
-
type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
|
|
18
|
-
default: null;
|
|
19
|
-
};
|
|
20
|
-
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
-
pluginKey: {
|
|
24
|
-
type: null;
|
|
25
|
-
default: string;
|
|
26
|
-
};
|
|
27
|
-
editor: {
|
|
28
|
-
type: PropType<FloatingMenuPluginProps["editor"]>;
|
|
29
|
-
required: true;
|
|
30
|
-
};
|
|
31
|
-
tippyOptions: {
|
|
32
|
-
type: PropType<FloatingMenuPluginProps["tippyOptions"]>;
|
|
33
|
-
default: () => {};
|
|
34
|
-
};
|
|
35
|
-
shouldShow: {
|
|
36
|
-
type: PropType<Exclude<Required<FloatingMenuPluginProps>["shouldShow"], null>>;
|
|
37
|
-
default: null;
|
|
38
|
-
};
|
|
39
|
-
}>>, {
|
|
40
|
-
tippyOptions: Partial<import("tippy.js").Props> | undefined;
|
|
41
|
-
shouldShow: (props: {
|
|
42
|
-
editor: import("@tiptap/core").Editor;
|
|
43
|
-
view: import("prosemirror-view").EditorView;
|
|
44
|
-
state: import("prosemirror-state").EditorState;
|
|
45
|
-
oldState?: import("prosemirror-state").EditorState;
|
|
46
|
-
}) => boolean;
|
|
47
|
-
pluginKey: any;
|
|
48
|
-
}, {}>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const NodeViewContent: import("vue").DefineComponent<{
|
|
2
|
-
as: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
default: string;
|
|
5
|
-
};
|
|
6
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
as: {
|
|
8
|
-
type: StringConstructor;
|
|
9
|
-
default: string;
|
|
10
|
-
};
|
|
11
|
-
}>>, {
|
|
12
|
-
as: string;
|
|
13
|
-
}, {}>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const NodeViewWrapper: import("vue").DefineComponent<{
|
|
2
|
-
as: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
default: string;
|
|
5
|
-
};
|
|
6
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
as: {
|
|
8
|
-
type: StringConstructor;
|
|
9
|
-
default: string;
|
|
10
|
-
};
|
|
11
|
-
}>>, {
|
|
12
|
-
as: string;
|
|
13
|
-
}, {}>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { NodeViewProps, NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
|
|
2
|
-
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
-
import { Decoration } from '@tiptap/pm/view';
|
|
4
|
-
import { Component, PropType } from 'vue';
|
|
5
|
-
export declare const nodeViewProps: {
|
|
6
|
-
editor: {
|
|
7
|
-
type: PropType<NodeViewProps["editor"]>;
|
|
8
|
-
required: true;
|
|
9
|
-
};
|
|
10
|
-
node: {
|
|
11
|
-
type: PropType<NodeViewProps["node"]>;
|
|
12
|
-
required: true;
|
|
13
|
-
};
|
|
14
|
-
decorations: {
|
|
15
|
-
type: PropType<NodeViewProps["decorations"]>;
|
|
16
|
-
required: true;
|
|
17
|
-
};
|
|
18
|
-
selected: {
|
|
19
|
-
type: PropType<NodeViewProps["selected"]>;
|
|
20
|
-
required: true;
|
|
21
|
-
};
|
|
22
|
-
extension: {
|
|
23
|
-
type: PropType<NodeViewProps["extension"]>;
|
|
24
|
-
required: true;
|
|
25
|
-
};
|
|
26
|
-
getPos: {
|
|
27
|
-
type: PropType<NodeViewProps["getPos"]>;
|
|
28
|
-
required: true;
|
|
29
|
-
};
|
|
30
|
-
updateAttributes: {
|
|
31
|
-
type: PropType<NodeViewProps["updateAttributes"]>;
|
|
32
|
-
required: true;
|
|
33
|
-
};
|
|
34
|
-
deleteNode: {
|
|
35
|
-
type: PropType<NodeViewProps["deleteNode"]>;
|
|
36
|
-
required: true;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
40
|
-
update: ((props: {
|
|
41
|
-
oldNode: ProseMirrorNode;
|
|
42
|
-
oldDecorations: Decoration[];
|
|
43
|
-
newNode: ProseMirrorNode;
|
|
44
|
-
newDecorations: Decoration[];
|
|
45
|
-
updateProps: () => void;
|
|
46
|
-
}) => boolean) | null;
|
|
47
|
-
}
|
|
48
|
-
export declare function VueNodeViewRenderer(component: Component, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
import { Component, h } from 'vue';
|
|
3
|
-
import { Editor as ExtendedEditor } from './Editor.js';
|
|
4
|
-
export interface VueRendererOptions {
|
|
5
|
-
editor: Editor;
|
|
6
|
-
props?: Record<string, any>;
|
|
7
|
-
}
|
|
8
|
-
type ExtendedVNode = ReturnType<typeof h> | null;
|
|
9
|
-
interface RenderedComponent {
|
|
10
|
-
vNode: ExtendedVNode;
|
|
11
|
-
destroy: () => void;
|
|
12
|
-
el: Element | null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* This class is used to render Vue components inside the editor.
|
|
16
|
-
*/
|
|
17
|
-
export declare class VueRenderer {
|
|
18
|
-
id: string;
|
|
19
|
-
renderedComponent: RenderedComponent;
|
|
20
|
-
editor: ExtendedEditor;
|
|
21
|
-
component: Component;
|
|
22
|
-
el: Element | null;
|
|
23
|
-
props: Record<string, any>;
|
|
24
|
-
constructor(component: Component, { props, editor }: VueRendererOptions);
|
|
25
|
-
get element(): Element | null;
|
|
26
|
-
renderComponent(): {
|
|
27
|
-
vNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}>;
|
|
30
|
-
destroy: () => void;
|
|
31
|
-
el: Element | null;
|
|
32
|
-
};
|
|
33
|
-
updateProps(props?: Record<string, any>): void;
|
|
34
|
-
destroy(): void;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './BubbleMenu.js';
|
|
2
|
-
export { Editor } from './Editor.js';
|
|
3
|
-
export * from './EditorContent.js';
|
|
4
|
-
export * from './FloatingMenu.js';
|
|
5
|
-
export * from './NodeViewContent.js';
|
|
6
|
-
export * from './NodeViewWrapper.js';
|
|
7
|
-
export * from './useEditor.js';
|
|
8
|
-
export * from './VueNodeViewRenderer.js';
|
|
9
|
-
export * from './VueRenderer.js';
|
|
10
|
-
export * from '@tiptap/core';
|
package/src/BubbleMenu.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
h,
|
|
5
|
-
onBeforeUnmount,
|
|
6
|
-
onMounted,
|
|
7
|
-
PropType,
|
|
8
|
-
ref,
|
|
9
|
-
} from 'vue'
|
|
10
|
-
|
|
11
|
-
export const BubbleMenu = defineComponent({
|
|
12
|
-
name: 'BubbleMenu',
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
pluginKey: {
|
|
16
|
-
type: [String, Object] as PropType<BubbleMenuPluginProps['pluginKey']>,
|
|
17
|
-
default: 'bubbleMenu',
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
editor: {
|
|
21
|
-
type: Object as PropType<BubbleMenuPluginProps['editor']>,
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
updateDelay: {
|
|
26
|
-
type: Number as PropType<BubbleMenuPluginProps['updateDelay']>,
|
|
27
|
-
default: undefined,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
tippyOptions: {
|
|
31
|
-
type: Object as PropType<BubbleMenuPluginProps['tippyOptions']>,
|
|
32
|
-
default: () => ({}),
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
shouldShow: {
|
|
36
|
-
type: Function as PropType<Exclude<Required<BubbleMenuPluginProps>['shouldShow'], null>>,
|
|
37
|
-
default: null,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
setup(props, { slots }) {
|
|
42
|
-
const root = ref<HTMLElement | null>(null)
|
|
43
|
-
|
|
44
|
-
onMounted(() => {
|
|
45
|
-
const {
|
|
46
|
-
updateDelay,
|
|
47
|
-
editor,
|
|
48
|
-
pluginKey,
|
|
49
|
-
shouldShow,
|
|
50
|
-
tippyOptions,
|
|
51
|
-
} = props
|
|
52
|
-
|
|
53
|
-
editor.registerPlugin(BubbleMenuPlugin({
|
|
54
|
-
updateDelay,
|
|
55
|
-
editor,
|
|
56
|
-
element: root.value as HTMLElement,
|
|
57
|
-
pluginKey,
|
|
58
|
-
shouldShow,
|
|
59
|
-
tippyOptions,
|
|
60
|
-
}))
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
onBeforeUnmount(() => {
|
|
64
|
-
const { pluginKey, editor } = props
|
|
65
|
-
|
|
66
|
-
editor.unregisterPlugin(pluginKey)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
return () => h('div', { ref: root }, slots.default?.())
|
|
70
|
-
},
|
|
71
|
-
})
|
package/src/FloatingMenu.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
h,
|
|
5
|
-
onBeforeUnmount,
|
|
6
|
-
onMounted,
|
|
7
|
-
PropType,
|
|
8
|
-
ref,
|
|
9
|
-
} from 'vue'
|
|
10
|
-
|
|
11
|
-
export const FloatingMenu = defineComponent({
|
|
12
|
-
name: 'FloatingMenu',
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
pluginKey: {
|
|
16
|
-
// TODO: TypeScript breaks :(
|
|
17
|
-
// type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
|
|
18
|
-
type: null,
|
|
19
|
-
default: 'floatingMenu',
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
editor: {
|
|
23
|
-
type: Object as PropType<FloatingMenuPluginProps['editor']>,
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
tippyOptions: {
|
|
28
|
-
type: Object as PropType<FloatingMenuPluginProps['tippyOptions']>,
|
|
29
|
-
default: () => ({}),
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
shouldShow: {
|
|
33
|
-
type: Function as PropType<Exclude<Required<FloatingMenuPluginProps>['shouldShow'], null>>,
|
|
34
|
-
default: null,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
setup(props, { slots }) {
|
|
39
|
-
const root = ref<HTMLElement | null>(null)
|
|
40
|
-
|
|
41
|
-
onMounted(() => {
|
|
42
|
-
const {
|
|
43
|
-
pluginKey,
|
|
44
|
-
editor,
|
|
45
|
-
tippyOptions,
|
|
46
|
-
shouldShow,
|
|
47
|
-
} = props
|
|
48
|
-
|
|
49
|
-
editor.registerPlugin(FloatingMenuPlugin({
|
|
50
|
-
pluginKey,
|
|
51
|
-
editor,
|
|
52
|
-
element: root.value as HTMLElement,
|
|
53
|
-
tippyOptions,
|
|
54
|
-
shouldShow,
|
|
55
|
-
}))
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
onBeforeUnmount(() => {
|
|
59
|
-
const { pluginKey, editor } = props
|
|
60
|
-
|
|
61
|
-
editor.unregisterPlugin(pluginKey)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
return () => h('div', { ref: root }, slots.default?.())
|
|
65
|
-
},
|
|
66
|
-
})
|