@tiptap/react 2.0.0-beta.8 → 2.0.0-beta.83
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 +1 -1
- package/README.md +2 -2
- package/dist/packages/core/src/CommandManager.d.ts +20 -0
- package/dist/packages/core/src/Editor.d.ts +140 -0
- package/dist/packages/core/src/EventEmitter.d.ts +11 -0
- package/dist/packages/core/src/Extension.d.ts +194 -0
- package/dist/packages/core/src/ExtensionManager.d.ts +18 -0
- package/dist/packages/core/src/InputRule.d.ts +42 -0
- package/dist/packages/core/src/Mark.d.ts +278 -0
- package/dist/packages/core/src/Node.d.ts +340 -0
- package/dist/packages/core/src/NodeView.d.ts +27 -0
- package/dist/packages/core/src/PasteRule.d.ts +42 -0
- package/dist/packages/core/src/Tracker.d.ts +11 -0
- package/dist/packages/core/src/commands/blur.d.ts +12 -0
- package/dist/packages/core/src/commands/clearContent.d.ts +12 -0
- package/dist/packages/core/src/commands/clearNodes.d.ts +12 -0
- package/dist/packages/core/src/commands/command.d.ts +12 -0
- package/dist/packages/core/src/commands/createParagraphNear.d.ts +12 -0
- package/dist/packages/core/src/commands/deleteNode.d.ts +13 -0
- package/dist/packages/core/src/commands/deleteRange.d.ts +12 -0
- package/dist/packages/core/src/commands/deleteSelection.d.ts +12 -0
- package/dist/packages/core/src/commands/enter.d.ts +12 -0
- package/dist/packages/core/src/commands/exitCode.d.ts +12 -0
- package/dist/packages/core/src/commands/extendMarkRange.d.ts +13 -0
- package/dist/packages/core/src/commands/first.d.ts +12 -0
- package/dist/packages/core/src/commands/focus.d.ts +12 -0
- package/dist/packages/core/src/commands/forEach.d.ts +14 -0
- package/dist/packages/core/src/commands/insertContent.d.ts +16 -0
- package/dist/packages/core/src/commands/insertContentAt.d.ts +16 -0
- package/dist/packages/core/src/commands/joinBackward.d.ts +12 -0
- package/dist/packages/core/src/commands/joinForward.d.ts +12 -0
- package/dist/packages/core/src/commands/keyboardShortcut.d.ts +12 -0
- package/dist/packages/core/src/commands/lift.d.ts +13 -0
- package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +12 -0
- package/dist/packages/core/src/commands/liftListItem.d.ts +13 -0
- package/dist/packages/core/src/commands/newlineInCode.d.ts +12 -0
- package/dist/packages/core/src/commands/resetAttributes.d.ts +13 -0
- package/dist/packages/core/src/commands/scrollIntoView.d.ts +12 -0
- package/dist/packages/core/src/commands/selectAll.d.ts +12 -0
- package/dist/packages/core/src/commands/selectNodeBackward.d.ts +12 -0
- package/dist/packages/core/src/commands/selectNodeForward.d.ts +12 -0
- package/dist/packages/core/src/commands/selectParentNode.d.ts +12 -0
- package/dist/packages/core/src/commands/setContent.d.ts +13 -0
- package/dist/packages/core/src/commands/setMark.d.ts +13 -0
- package/dist/packages/core/src/commands/setMeta.d.ts +12 -0
- package/dist/packages/core/src/commands/setNode.d.ts +13 -0
- package/dist/packages/core/src/commands/setNodeSelection.d.ts +12 -0
- package/dist/packages/core/src/commands/setTextSelection.d.ts +12 -0
- package/dist/packages/core/src/commands/sinkListItem.d.ts +13 -0
- package/dist/packages/core/src/commands/splitBlock.d.ts +14 -0
- package/dist/packages/core/src/commands/splitListItem.d.ts +13 -0
- package/dist/packages/core/src/commands/toggleList.d.ts +13 -0
- package/dist/packages/core/src/commands/toggleMark.d.ts +18 -0
- package/dist/packages/core/src/commands/toggleNode.d.ts +13 -0
- package/dist/packages/core/src/commands/toggleWrap.d.ts +13 -0
- package/dist/packages/core/src/commands/undoInputRule.d.ts +12 -0
- package/dist/packages/core/src/commands/unsetAllMarks.d.ts +12 -0
- package/dist/packages/core/src/commands/unsetMark.d.ts +18 -0
- package/dist/packages/core/src/commands/updateAttributes.d.ts +13 -0
- package/dist/packages/core/src/commands/wrapIn.d.ts +13 -0
- package/dist/packages/core/src/commands/wrapInList.d.ts +13 -0
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +2 -0
- package/dist/packages/core/src/extensions/commands.d.ts +98 -0
- package/dist/packages/core/src/extensions/editable.d.ts +2 -0
- package/dist/packages/core/src/extensions/focusEvents.d.ts +2 -0
- package/dist/packages/core/src/extensions/index.d.ts +6 -0
- package/dist/packages/core/src/extensions/keymap.d.ts +2 -0
- package/dist/packages/core/src/extensions/tabindex.d.ts +2 -0
- package/dist/packages/core/src/helpers/createChainableState.d.ts +5 -0
- package/dist/packages/core/src/helpers/createDocument.d.ts +3 -0
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +7 -0
- package/dist/packages/core/src/helpers/findChildren.d.ts +3 -0
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +6 -0
- package/dist/packages/core/src/helpers/findParentNode.d.ts +9 -0
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +8 -0
- package/dist/packages/core/src/helpers/generateHTML.d.ts +2 -0
- package/dist/packages/core/src/helpers/generateJSON.d.ts +2 -0
- package/dist/packages/core/src/helpers/generateText.d.ts +5 -0
- package/dist/packages/core/src/helpers/getAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +6 -0
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +8 -0
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +2 -0
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +2 -0
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +3 -0
- package/dist/packages/core/src/helpers/getMarkType.d.ts +2 -0
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +3 -0
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getNodeType.d.ts +2 -0
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getSchema.d.ts +3 -0
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +3 -0
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +2 -0
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +2 -0
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +2 -0
- package/dist/packages/core/src/helpers/getText.d.ts +6 -0
- package/dist/packages/core/src/helpers/getTextBetween.d.ts +6 -0
- package/dist/packages/core/src/helpers/getTextSeralizersFromSchema.d.ts +3 -0
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +9 -0
- package/dist/packages/core/src/helpers/isActive.d.ts +2 -0
- package/dist/packages/core/src/helpers/isList.d.ts +2 -0
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +3 -0
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +3 -0
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +2 -0
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +2 -0
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +2 -0
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +2 -0
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +2 -0
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +9 -0
- package/dist/packages/core/src/index.d.ts +57 -0
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +12 -0
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +12 -0
- package/dist/packages/core/src/inputRules/textInputRule.d.ts +9 -0
- package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +14 -0
- package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +23 -0
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +12 -0
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +9 -0
- package/dist/packages/core/src/style.d.ts +2 -0
- package/dist/packages/core/src/types.d.ts +207 -0
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +9 -0
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -0
- package/dist/packages/core/src/utilities/deleteProps.d.ts +6 -0
- package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -0
- package/dist/packages/core/src/utilities/fromString.d.ts +1 -0
- package/dist/packages/core/src/utilities/isClass.d.ts +1 -0
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -0
- package/dist/packages/core/src/utilities/isFunction.d.ts +1 -0
- package/dist/packages/core/src/utilities/isObject.d.ts +1 -0
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -0
- package/dist/packages/core/src/utilities/isRegExp.d.ts +1 -0
- package/dist/packages/core/src/utilities/isString.d.ts +1 -0
- package/dist/packages/core/src/utilities/isiOS.d.ts +1 -0
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -0
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -0
- package/dist/packages/core/src/utilities/minMax.d.ts +1 -0
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +8 -0
- package/dist/packages/core/src/utilities/removeElement.d.ts +1 -0
- package/dist/packages/extension-blockquote/src/blockquote.d.ts +24 -0
- package/dist/packages/extension-blockquote/src/index.d.ts +3 -0
- package/dist/packages/extension-bold/src/bold.d.ts +27 -0
- package/dist/packages/extension-bold/src/index.d.ts +3 -0
- package/dist/packages/extension-bubble-menu/src/bubble-menu-plugin.d.ts +43 -0
- package/dist/packages/extension-bubble-menu/src/bubble-menu.d.ts +6 -0
- package/dist/packages/extension-bubble-menu/src/index.d.ts +4 -0
- package/dist/packages/extension-bullet-list/src/bullet-list.d.ts +16 -0
- package/dist/packages/extension-bullet-list/src/index.d.ts +3 -0
- package/dist/packages/extension-character-count/src/character-count.d.ts +7 -0
- package/dist/packages/extension-character-count/src/index.d.ts +3 -0
- package/dist/packages/extension-code/src/code.d.ts +25 -0
- package/dist/packages/extension-code/src/index.d.ts +3 -0
- package/dist/packages/extension-code-block/src/code-block.d.ts +26 -0
- package/dist/packages/extension-code-block/src/index.d.ts +3 -0
- package/dist/packages/extension-code-block-lowlight/src/code-block-lowlight.d.ts +5 -0
- package/dist/packages/extension-code-block-lowlight/src/index.d.ts +3 -0
- package/dist/packages/extension-code-block-lowlight/src/lowlight-plugin.d.ts +5 -0
- package/dist/packages/extension-collaboration/src/collaboration.d.ts +30 -0
- package/dist/packages/extension-collaboration/src/helpers/isChangeOrigin.d.ts +2 -0
- package/dist/packages/extension-collaboration/src/index.d.ts +4 -0
- package/dist/packages/extension-collaboration-cursor/src/collaboration-cursor.d.ts +21 -0
- package/dist/packages/extension-collaboration-cursor/src/index.d.ts +3 -0
- package/dist/packages/extension-color/src/color.d.ts +21 -0
- package/dist/packages/extension-color/src/index.d.ts +3 -0
- package/dist/packages/extension-document/src/document.d.ts +2 -0
- package/dist/packages/extension-document/src/index.d.ts +3 -0
- package/dist/packages/extension-dropcursor/src/dropcursor.d.ts +7 -0
- package/dist/packages/extension-dropcursor/src/index.d.ts +3 -0
- package/dist/packages/extension-floating-menu/src/floating-menu-plugin.d.ts +40 -0
- package/dist/packages/extension-floating-menu/src/floating-menu.d.ts +6 -0
- package/dist/packages/extension-floating-menu/src/index.d.ts +4 -0
- package/dist/packages/extension-focus/src/focus.d.ts +6 -0
- package/dist/packages/extension-focus/src/index.d.ts +3 -0
- package/dist/packages/extension-font-family/src/font-family.d.ts +21 -0
- package/dist/packages/extension-font-family/src/index.d.ts +3 -0
- package/dist/packages/extension-gapcursor/src/gapcursor.d.ts +14 -0
- package/dist/packages/extension-gapcursor/src/index.d.ts +3 -0
- package/dist/packages/extension-hard-break/src/hard-break.d.ts +16 -0
- package/dist/packages/extension-hard-break/src/index.d.ts +3 -0
- package/dist/packages/extension-heading/src/heading.d.ts +26 -0
- package/dist/packages/extension-heading/src/index.d.ts +3 -0
- package/dist/packages/extension-highlight/src/highlight.d.ts +30 -0
- package/dist/packages/extension-highlight/src/index.d.ts +3 -0
- package/dist/packages/extension-history/src/history.d.ts +20 -0
- package/dist/packages/extension-history/src/index.d.ts +3 -0
- package/dist/packages/extension-horizontal-rule/src/horizontal-rule.d.ts +15 -0
- package/dist/packages/extension-horizontal-rule/src/index.d.ts +3 -0
- package/dist/packages/extension-image/src/image.d.ts +21 -0
- package/dist/packages/extension-image/src/index.d.ts +3 -0
- package/dist/packages/extension-italic/src/index.d.ts +3 -0
- package/dist/packages/extension-italic/src/italic.d.ts +27 -0
- package/dist/packages/extension-link/src/index.d.ts +3 -0
- package/dist/packages/extension-link/src/link.d.ts +40 -0
- package/dist/packages/extension-list-item/src/index.d.ts +3 -0
- package/dist/packages/extension-list-item/src/list-item.d.ts +5 -0
- package/dist/packages/extension-mention/src/index.d.ts +3 -0
- package/dist/packages/extension-mention/src/mention.d.ts +14 -0
- package/dist/packages/extension-ordered-list/src/index.d.ts +3 -0
- package/dist/packages/extension-ordered-list/src/ordered-list.d.ts +16 -0
- package/dist/packages/extension-paragraph/src/index.d.ts +3 -0
- package/dist/packages/extension-paragraph/src/paragraph.d.ts +15 -0
- package/dist/packages/extension-placeholder/src/index.d.ts +3 -0
- package/dist/packages/extension-placeholder/src/placeholder.d.ts +15 -0
- package/dist/packages/extension-strike/src/index.d.ts +3 -0
- package/dist/packages/extension-strike/src/strike.d.ts +25 -0
- package/dist/packages/extension-subscript/src/index.d.ts +3 -0
- package/dist/packages/extension-subscript/src/subscript.d.ts +23 -0
- package/dist/packages/extension-superscript/src/index.d.ts +3 -0
- package/dist/packages/extension-superscript/src/superscript.d.ts +23 -0
- package/dist/packages/extension-table/src/TableView.d.ts +17 -0
- package/dist/packages/extension-table/src/index.d.ts +4 -0
- package/dist/packages/extension-table/src/table.d.ts +54 -0
- package/dist/packages/extension-table/src/utilities/createCell.d.ts +2 -0
- package/dist/packages/extension-table/src/utilities/createTable.d.ts +2 -0
- package/dist/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.d.ts +2 -0
- package/dist/packages/extension-table/src/utilities/getTableNodeTypes.d.ts +4 -0
- package/dist/packages/extension-table/src/utilities/isCellSelection.d.ts +2 -0
- package/dist/packages/extension-table-cell/src/index.d.ts +3 -0
- package/dist/packages/extension-table-cell/src/table-cell.d.ts +5 -0
- package/dist/packages/extension-table-header/src/index.d.ts +3 -0
- package/dist/packages/extension-table-header/src/table-header.d.ts +5 -0
- package/dist/packages/extension-table-row/src/index.d.ts +3 -0
- package/dist/packages/extension-table-row/src/table-row.d.ts +5 -0
- package/dist/packages/extension-task-item/src/index.d.ts +3 -0
- package/dist/packages/extension-task-item/src/task-item.d.ts +7 -0
- package/dist/packages/extension-task-list/src/index.d.ts +3 -0
- package/dist/packages/extension-task-list/src/task-list.d.ts +15 -0
- package/dist/packages/extension-text/src/index.d.ts +3 -0
- package/dist/packages/extension-text/src/text.d.ts +2 -0
- package/dist/packages/extension-text-align/src/index.d.ts +3 -0
- package/dist/packages/extension-text-align/src/text-align.d.ts +21 -0
- package/dist/packages/extension-text-style/src/index.d.ts +3 -0
- package/dist/packages/extension-text-style/src/text-style.d.ts +15 -0
- package/dist/packages/extension-typography/src/index.d.ts +3 -0
- package/dist/packages/extension-typography/src/typography.d.ts +23 -0
- package/dist/packages/extension-underline/src/index.d.ts +3 -0
- package/dist/packages/extension-underline/src/underline.d.ts +23 -0
- package/dist/packages/html/src/generateHTML.d.ts +2 -0
- package/dist/packages/html/src/generateJSON.d.ts +2 -0
- package/dist/packages/html/src/getHTMLFromFragment.d.ts +2 -0
- package/dist/packages/html/src/index.d.ts +2 -0
- package/dist/packages/react/src/BubbleMenu.d.ts +3 -1
- package/dist/packages/react/src/EditorContent.d.ts +2 -2
- package/dist/packages/react/src/FloatingMenu.d.ts +8 -0
- package/dist/packages/react/src/NodeViewContent.d.ts +2 -2
- package/dist/packages/react/src/NodeViewWrapper.d.ts +2 -2
- package/dist/packages/react/src/ReactNodeViewRenderer.d.ts +9 -5
- package/dist/packages/react/src/ReactRenderer.d.ts +15 -10
- package/dist/packages/react/src/index.d.ts +1 -0
- package/dist/packages/react/src/useEditor.d.ts +2 -1
- package/dist/packages/react/src/useReactNodeView.d.ts +1 -1
- package/dist/packages/starter-kit/src/index.d.ts +3 -0
- package/dist/packages/starter-kit/src/starter-kit.d.ts +37 -0
- package/dist/packages/suggestion/src/findSuggestionMatch.d.ts +15 -0
- package/dist/packages/suggestion/src/index.d.ts +4 -0
- package/dist/packages/suggestion/src/suggestion.d.ts +46 -0
- package/dist/tests/cypress/integration/core/can.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/editorProps.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/extendExtensions.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/extendMarkRange.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/extensionOptions.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/fromString.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/generateHTML.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/generateJSON.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/isActive.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/isClass.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/mergeAttributes.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/mergeDeep.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/core/pluginOrder.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/extensions/bold.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/extensions/codeBlockLowlight.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/html/generateHTML.spec.d.ts +1 -0
- package/dist/tests/cypress/integration/html/generateJSON.spec.d.ts +1 -0
- package/dist/tiptap-react.cjs.js +118 -51
- package/dist/tiptap-react.cjs.js.map +1 -1
- package/dist/tiptap-react.esm.js +111 -43
- package/dist/tiptap-react.esm.js.map +1 -1
- package/dist/tiptap-react.umd.js +122 -56
- package/dist/tiptap-react.umd.js.map +1 -1
- package/package.json +17 -9
- package/src/BubbleMenu.tsx +23 -7
- package/src/EditorContent.tsx +8 -7
- package/src/FloatingMenu.tsx +46 -0
- package/src/NodeViewContent.tsx +9 -6
- package/src/NodeViewWrapper.tsx +11 -9
- package/src/ReactNodeViewRenderer.tsx +67 -27
- package/src/ReactRenderer.tsx +26 -14
- package/src/index.ts +1 -0
- package/src/useEditor.ts +3 -3
- package/src/useReactNodeView.ts +1 -2
- package/CHANGELOG.md +0 -72
- package/dist/tiptap-react.bundle.umd.min.js +0 -54
- package/dist/tiptap-react.bundle.umd.min.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
4
|
+
import { Instance, Props } from 'tippy.js';
|
|
5
|
+
export interface FloatingMenuPluginProps {
|
|
6
|
+
pluginKey: PluginKey | string;
|
|
7
|
+
editor: Editor;
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
tippyOptions?: Partial<Props>;
|
|
10
|
+
shouldShow?: ((props: {
|
|
11
|
+
editor: Editor;
|
|
12
|
+
view: EditorView;
|
|
13
|
+
state: EditorState;
|
|
14
|
+
oldState?: EditorState;
|
|
15
|
+
}) => boolean) | null;
|
|
16
|
+
}
|
|
17
|
+
export declare type FloatingMenuViewProps = FloatingMenuPluginProps & {
|
|
18
|
+
view: EditorView;
|
|
19
|
+
};
|
|
20
|
+
export declare class FloatingMenuView {
|
|
21
|
+
editor: Editor;
|
|
22
|
+
element: HTMLElement;
|
|
23
|
+
view: EditorView;
|
|
24
|
+
preventHide: boolean;
|
|
25
|
+
tippy: Instance | undefined;
|
|
26
|
+
tippyOptions?: Partial<Props>;
|
|
27
|
+
shouldShow: Exclude<FloatingMenuPluginProps['shouldShow'], null>;
|
|
28
|
+
constructor({ editor, element, view, tippyOptions, shouldShow, }: FloatingMenuViewProps);
|
|
29
|
+
mousedownHandler: () => void;
|
|
30
|
+
focusHandler: () => void;
|
|
31
|
+
blurHandler: ({ event }: {
|
|
32
|
+
event: FocusEvent;
|
|
33
|
+
}) => void;
|
|
34
|
+
createTooltip(): void;
|
|
35
|
+
update(view: EditorView, oldState?: EditorState): void;
|
|
36
|
+
show(): void;
|
|
37
|
+
hide(): void;
|
|
38
|
+
destroy(): void;
|
|
39
|
+
}
|
|
40
|
+
export declare const FloatingMenuPlugin: (options: FloatingMenuPluginProps) => Plugin<any, any>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { FloatingMenuPluginProps } from './floating-menu-plugin';
|
|
3
|
+
export declare type FloatingMenuOptions = Omit<FloatingMenuPluginProps, 'editor' | 'element'> & {
|
|
4
|
+
element: HTMLElement | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const FloatingMenu: Extension<FloatingMenuOptions>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import '@tiptap/extension-text-style';
|
|
3
|
+
declare type FontFamilyOptions = {
|
|
4
|
+
types: string[];
|
|
5
|
+
};
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
fontFamily: {
|
|
9
|
+
/**
|
|
10
|
+
* Set the font family
|
|
11
|
+
*/
|
|
12
|
+
setFontFamily: (fontFamily: string) => ReturnType;
|
|
13
|
+
/**
|
|
14
|
+
* Unset the font family
|
|
15
|
+
*/
|
|
16
|
+
unsetFontFamily: () => ReturnType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const FontFamily: Extension<FontFamilyOptions>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Extension, ParentConfig } from '@tiptap/core';
|
|
2
|
+
declare module '@tiptap/core' {
|
|
3
|
+
interface NodeConfig<Options> {
|
|
4
|
+
/**
|
|
5
|
+
* Allow gap cursor
|
|
6
|
+
*/
|
|
7
|
+
allowGapCursor?: boolean | null | ((this: {
|
|
8
|
+
name: string;
|
|
9
|
+
options: Options;
|
|
10
|
+
parent: ParentConfig<NodeConfig<Options>>['allowGapCursor'];
|
|
11
|
+
}) => boolean | null);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare const Gapcursor: Extension<unknown>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface HardBreakOptions {
|
|
3
|
+
keepMarks: boolean;
|
|
4
|
+
HTMLAttributes: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
hardBreak: {
|
|
9
|
+
/**
|
|
10
|
+
* Add a hard break
|
|
11
|
+
*/
|
|
12
|
+
setHardBreak: () => ReturnType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const HardBreak: Node<HardBreakOptions>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
declare type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
export interface HeadingOptions {
|
|
4
|
+
levels: Level[];
|
|
5
|
+
HTMLAttributes: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
declare module '@tiptap/core' {
|
|
8
|
+
interface Commands<ReturnType> {
|
|
9
|
+
heading: {
|
|
10
|
+
/**
|
|
11
|
+
* Set a heading node
|
|
12
|
+
*/
|
|
13
|
+
setHeading: (attributes: {
|
|
14
|
+
level: Level;
|
|
15
|
+
}) => ReturnType;
|
|
16
|
+
/**
|
|
17
|
+
* Toggle a heading node
|
|
18
|
+
*/
|
|
19
|
+
toggleHeading: (attributes: {
|
|
20
|
+
level: Level;
|
|
21
|
+
}) => ReturnType;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export declare const Heading: Node<HeadingOptions>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
export interface HighlightOptions {
|
|
3
|
+
multicolor: boolean;
|
|
4
|
+
HTMLAttributes: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
highlight: {
|
|
9
|
+
/**
|
|
10
|
+
* Set a highlight mark
|
|
11
|
+
*/
|
|
12
|
+
setHighlight: (attributes?: {
|
|
13
|
+
color: string;
|
|
14
|
+
}) => ReturnType;
|
|
15
|
+
/**
|
|
16
|
+
* Toggle a highlight mark
|
|
17
|
+
*/
|
|
18
|
+
toggleHighlight: (attributes?: {
|
|
19
|
+
color: string;
|
|
20
|
+
}) => ReturnType;
|
|
21
|
+
/**
|
|
22
|
+
* Unset a highlight mark
|
|
23
|
+
*/
|
|
24
|
+
unsetHighlight: () => ReturnType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export declare const inputRegex: RegExp;
|
|
29
|
+
export declare const pasteRegex: RegExp;
|
|
30
|
+
export declare const Highlight: Mark<HighlightOptions>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
export interface HistoryOptions {
|
|
3
|
+
depth: number;
|
|
4
|
+
newGroupDelay: number;
|
|
5
|
+
}
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
history: {
|
|
9
|
+
/**
|
|
10
|
+
* Undo recent changes
|
|
11
|
+
*/
|
|
12
|
+
undo: () => ReturnType;
|
|
13
|
+
/**
|
|
14
|
+
* Reapply reverted changes
|
|
15
|
+
*/
|
|
16
|
+
redo: () => ReturnType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const History: Extension<HistoryOptions>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface HorizontalRuleOptions {
|
|
3
|
+
HTMLAttributes: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
horizontalRule: {
|
|
8
|
+
/**
|
|
9
|
+
* Add a horizontal rule
|
|
10
|
+
*/
|
|
11
|
+
setHorizontalRule: () => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const HorizontalRule: Node<HorizontalRuleOptions>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface ImageOptions {
|
|
3
|
+
inline: boolean;
|
|
4
|
+
HTMLAttributes: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
declare module '@tiptap/core' {
|
|
7
|
+
interface Commands<ReturnType> {
|
|
8
|
+
image: {
|
|
9
|
+
/**
|
|
10
|
+
* Add an image
|
|
11
|
+
*/
|
|
12
|
+
setImage: (options: {
|
|
13
|
+
src: string;
|
|
14
|
+
alt?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
}) => ReturnType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare const inputRegex: RegExp;
|
|
21
|
+
export declare const Image: Node<ImageOptions>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
export interface ItalicOptions {
|
|
3
|
+
HTMLAttributes: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
italic: {
|
|
8
|
+
/**
|
|
9
|
+
* Set an italic mark
|
|
10
|
+
*/
|
|
11
|
+
setItalic: () => ReturnType;
|
|
12
|
+
/**
|
|
13
|
+
* Toggle an italic mark
|
|
14
|
+
*/
|
|
15
|
+
toggleItalic: () => ReturnType;
|
|
16
|
+
/**
|
|
17
|
+
* Unset an italic mark
|
|
18
|
+
*/
|
|
19
|
+
unsetItalic: () => ReturnType;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare const starInputRegex: RegExp;
|
|
24
|
+
export declare const starPasteRegex: RegExp;
|
|
25
|
+
export declare const underscoreInputRegex: RegExp;
|
|
26
|
+
export declare const underscorePasteRegex: RegExp;
|
|
27
|
+
export declare const Italic: Mark<ItalicOptions>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
export interface LinkOptions {
|
|
3
|
+
/**
|
|
4
|
+
* If enabled, links will be opened on click.
|
|
5
|
+
*/
|
|
6
|
+
openOnClick: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Adds a link to the current selection if the pasted content only contains an url.
|
|
9
|
+
*/
|
|
10
|
+
linkOnPaste: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* A list of HTML attributes to be rendered.
|
|
13
|
+
*/
|
|
14
|
+
HTMLAttributes: Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
declare module '@tiptap/core' {
|
|
17
|
+
interface Commands<ReturnType> {
|
|
18
|
+
link: {
|
|
19
|
+
/**
|
|
20
|
+
* Set a link mark
|
|
21
|
+
*/
|
|
22
|
+
setLink: (attributes: {
|
|
23
|
+
href: string;
|
|
24
|
+
target?: string;
|
|
25
|
+
}) => ReturnType;
|
|
26
|
+
/**
|
|
27
|
+
* Toggle a link mark
|
|
28
|
+
*/
|
|
29
|
+
toggleLink: (attributes: {
|
|
30
|
+
href: string;
|
|
31
|
+
target?: string;
|
|
32
|
+
}) => ReturnType;
|
|
33
|
+
/**
|
|
34
|
+
* Unset a link mark
|
|
35
|
+
*/
|
|
36
|
+
unsetLink: () => ReturnType;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export declare const Link: Mark<LinkOptions>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
import { PluginKey } from 'prosemirror-state';
|
|
4
|
+
import { SuggestionOptions } from '@tiptap/suggestion';
|
|
5
|
+
export declare type MentionOptions = {
|
|
6
|
+
HTMLAttributes: Record<string, any>;
|
|
7
|
+
renderLabel: (props: {
|
|
8
|
+
options: MentionOptions;
|
|
9
|
+
node: ProseMirrorNode;
|
|
10
|
+
}) => string;
|
|
11
|
+
suggestion: Omit<SuggestionOptions, 'editor'>;
|
|
12
|
+
};
|
|
13
|
+
export declare const MentionPluginKey: PluginKey<any, any>;
|
|
14
|
+
export declare const Mention: Node<MentionOptions>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface OrderedListOptions {
|
|
3
|
+
HTMLAttributes: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
orderedList: {
|
|
8
|
+
/**
|
|
9
|
+
* Toggle an ordered list
|
|
10
|
+
*/
|
|
11
|
+
toggleOrderedList: () => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const inputRegex: RegExp;
|
|
16
|
+
export declare const OrderedList: Node<OrderedListOptions>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface ParagraphOptions {
|
|
3
|
+
HTMLAttributes: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
paragraph: {
|
|
8
|
+
/**
|
|
9
|
+
* Toggle a paragraph
|
|
10
|
+
*/
|
|
11
|
+
setParagraph: () => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const Paragraph: Node<ParagraphOptions>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Editor, Extension } from '@tiptap/core';
|
|
2
|
+
import { Node as ProsemirrorNode } from 'prosemirror-model';
|
|
3
|
+
export interface PlaceholderOptions {
|
|
4
|
+
emptyEditorClass: string;
|
|
5
|
+
emptyNodeClass: string;
|
|
6
|
+
placeholder: ((PlaceholderProps: {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
node: ProsemirrorNode;
|
|
9
|
+
pos: number;
|
|
10
|
+
}) => string) | string;
|
|
11
|
+
showOnlyWhenEditable: boolean;
|
|
12
|
+
showOnlyCurrent: boolean;
|
|
13
|
+
includeChildren: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const Placeholder: Extension<PlaceholderOptions>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
export interface StrikeOptions {
|
|
3
|
+
HTMLAttributes: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
strike: {
|
|
8
|
+
/**
|
|
9
|
+
* Set a strike mark
|
|
10
|
+
*/
|
|
11
|
+
setStrike: () => ReturnType;
|
|
12
|
+
/**
|
|
13
|
+
* Toggle a strike mark
|
|
14
|
+
*/
|
|
15
|
+
toggleStrike: () => ReturnType;
|
|
16
|
+
/**
|
|
17
|
+
* Unset a strike mark
|
|
18
|
+
*/
|
|
19
|
+
unsetStrike: () => ReturnType;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare const inputRegex: RegExp;
|
|
24
|
+
export declare const pasteRegex: RegExp;
|
|
25
|
+
export declare const Strike: Mark<StrikeOptions>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
export interface SubscriptExtensionOptions {
|
|
3
|
+
HTMLAttributes: Object;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
subscript: {
|
|
8
|
+
/**
|
|
9
|
+
* Set a subscript mark
|
|
10
|
+
*/
|
|
11
|
+
setSubscript: () => ReturnType;
|
|
12
|
+
/**
|
|
13
|
+
* Toggle a subscript mark
|
|
14
|
+
*/
|
|
15
|
+
toggleSubscript: () => ReturnType;
|
|
16
|
+
/**
|
|
17
|
+
* Unset a subscript mark
|
|
18
|
+
*/
|
|
19
|
+
unsetSubscript: () => ReturnType;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare const Subscript: Mark<SubscriptExtensionOptions>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
export interface SuperscriptExtensionOptions {
|
|
3
|
+
HTMLAttributes: Object;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
superscript: {
|
|
8
|
+
/**
|
|
9
|
+
* Set a superscript mark
|
|
10
|
+
*/
|
|
11
|
+
setSuperscript: () => ReturnType;
|
|
12
|
+
/**
|
|
13
|
+
* Toggle a superscript mark
|
|
14
|
+
*/
|
|
15
|
+
toggleSuperscript: () => ReturnType;
|
|
16
|
+
/**
|
|
17
|
+
* Unset a superscript mark
|
|
18
|
+
*/
|
|
19
|
+
unsetSuperscript: () => ReturnType;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare const Superscript: Mark<SuperscriptExtensionOptions>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NodeView } from 'prosemirror-view';
|
|
2
|
+
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
export declare function updateColumns(node: ProseMirrorNode, colgroup: Element, table: Element, cellMinWidth: number, overrideCol?: number, overrideValue?: any): void;
|
|
4
|
+
export declare class TableView implements NodeView {
|
|
5
|
+
node: ProseMirrorNode;
|
|
6
|
+
cellMinWidth: number;
|
|
7
|
+
dom: Element;
|
|
8
|
+
table: Element;
|
|
9
|
+
colgroup: Element;
|
|
10
|
+
contentDOM: Element;
|
|
11
|
+
constructor(node: ProseMirrorNode, cellMinWidth: number);
|
|
12
|
+
update(node: ProseMirrorNode): boolean;
|
|
13
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
14
|
+
type: 'selection';
|
|
15
|
+
target: Element;
|
|
16
|
+
}): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Node, ParentConfig } from '@tiptap/core';
|
|
2
|
+
import { NodeView } from 'prosemirror-view';
|
|
3
|
+
export interface TableOptions {
|
|
4
|
+
HTMLAttributes: Record<string, any>;
|
|
5
|
+
resizable: boolean;
|
|
6
|
+
handleWidth: number;
|
|
7
|
+
cellMinWidth: number;
|
|
8
|
+
View: NodeView;
|
|
9
|
+
lastColumnResizable: boolean;
|
|
10
|
+
allowTableNodeSelection: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare module '@tiptap/core' {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
14
|
+
table: {
|
|
15
|
+
insertTable: (options?: {
|
|
16
|
+
rows?: number;
|
|
17
|
+
cols?: number;
|
|
18
|
+
withHeaderRow?: boolean;
|
|
19
|
+
}) => ReturnType;
|
|
20
|
+
addColumnBefore: () => ReturnType;
|
|
21
|
+
addColumnAfter: () => ReturnType;
|
|
22
|
+
deleteColumn: () => ReturnType;
|
|
23
|
+
addRowBefore: () => ReturnType;
|
|
24
|
+
addRowAfter: () => ReturnType;
|
|
25
|
+
deleteRow: () => ReturnType;
|
|
26
|
+
deleteTable: () => ReturnType;
|
|
27
|
+
mergeCells: () => ReturnType;
|
|
28
|
+
splitCell: () => ReturnType;
|
|
29
|
+
toggleHeaderColumn: () => ReturnType;
|
|
30
|
+
toggleHeaderRow: () => ReturnType;
|
|
31
|
+
toggleHeaderCell: () => ReturnType;
|
|
32
|
+
mergeOrSplit: () => ReturnType;
|
|
33
|
+
setCellAttribute: (name: string, value: any) => ReturnType;
|
|
34
|
+
goToNextCell: () => ReturnType;
|
|
35
|
+
goToPreviousCell: () => ReturnType;
|
|
36
|
+
fixTables: () => ReturnType;
|
|
37
|
+
setCellSelection: (position: {
|
|
38
|
+
anchorCell: number;
|
|
39
|
+
headCell?: number;
|
|
40
|
+
}) => ReturnType;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
interface NodeConfig<Options> {
|
|
44
|
+
/**
|
|
45
|
+
* Table Role
|
|
46
|
+
*/
|
|
47
|
+
tableRole?: string | ((this: {
|
|
48
|
+
name: string;
|
|
49
|
+
options: Options;
|
|
50
|
+
parent: ParentConfig<NodeConfig<Options>>['tableRole'];
|
|
51
|
+
}) => string);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export declare const Table: Node<TableOptions>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Schema, Fragment, Node as ProsemirrorNode } from 'prosemirror-model';
|
|
2
|
+
export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode;
|