@tiptap/core 2.0.0-beta.98 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.cjs +4360 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{tiptap-core.esm.js → index.js} +2349 -1447
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +4358 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/packages/core/src/CommandManager.d.ts +14 -7
- package/dist/packages/core/src/Editor.d.ts +25 -11
- package/dist/packages/core/src/EventEmitter.d.ts +8 -4
- package/dist/packages/core/src/Extension.d.ts +63 -29
- package/dist/packages/core/src/ExtensionManager.d.ts +3 -4
- package/dist/packages/core/src/InputRule.d.ts +42 -0
- package/dist/packages/core/src/Mark.d.ts +94 -36
- package/dist/packages/core/src/Node.d.ts +104 -45
- package/dist/packages/core/src/NodeView.d.ts +8 -8
- package/dist/packages/core/src/PasteRule.d.ts +42 -0
- package/dist/packages/core/src/Tracker.d.ts +1 -1
- package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +12 -0
- package/dist/packages/core/src/commands/deleteNode.d.ts +1 -1
- package/dist/packages/core/src/commands/deleteRange.d.ts +1 -1
- package/dist/packages/core/src/commands/extendMarkRange.d.ts +1 -1
- package/dist/packages/core/src/commands/focus.d.ts +4 -2
- package/dist/packages/core/src/commands/index.d.ts +50 -0
- package/dist/packages/core/src/commands/insertContent.d.ts +6 -3
- package/dist/packages/core/src/commands/insertContentAt.d.ts +6 -3
- package/dist/packages/core/src/commands/join.d.ts +33 -0
- package/dist/packages/core/src/commands/lift.d.ts +1 -1
- package/dist/packages/core/src/commands/liftListItem.d.ts +1 -1
- package/dist/packages/core/src/commands/resetAttributes.d.ts +1 -1
- package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +12 -0
- package/dist/packages/core/src/commands/selectTextblockStart.d.ts +12 -0
- package/dist/packages/core/src/commands/setContent.d.ts +2 -2
- package/dist/packages/core/src/commands/setMark.d.ts +1 -1
- package/dist/packages/core/src/commands/setNode.d.ts +1 -1
- package/dist/packages/core/src/commands/setTextSelection.d.ts +1 -1
- package/dist/packages/core/src/commands/sinkListItem.d.ts +1 -1
- package/dist/packages/core/src/commands/splitListItem.d.ts +1 -1
- package/dist/packages/core/src/commands/toggleList.d.ts +2 -2
- package/dist/packages/core/src/commands/toggleMark.d.ts +7 -2
- package/dist/packages/core/src/commands/toggleNode.d.ts +1 -1
- package/dist/packages/core/src/commands/toggleWrap.d.ts +1 -1
- package/dist/packages/core/src/commands/unsetMark.d.ts +7 -2
- package/dist/packages/core/src/commands/updateAttributes.d.ts +1 -1
- package/dist/packages/core/src/commands/wrapIn.d.ts +1 -1
- package/dist/packages/core/src/commands/wrapInList.d.ts +1 -1
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +1 -1
- package/dist/packages/core/src/extensions/commands.d.ts +2 -97
- package/dist/packages/core/src/extensions/editable.d.ts +1 -1
- package/dist/packages/core/src/extensions/focusEvents.d.ts +1 -1
- package/dist/packages/core/src/extensions/index.d.ts +1 -0
- package/dist/packages/core/src/extensions/keymap.d.ts +1 -1
- package/dist/packages/core/src/extensions/tabindex.d.ts +2 -0
- package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +7 -0
- package/dist/packages/core/src/helpers/createChainableState.d.ts +5 -0
- package/dist/packages/core/src/helpers/createDocument.d.ts +2 -2
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +2 -2
- package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +2 -0
- package/dist/packages/core/src/helpers/findChildren.d.ts +3 -3
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +3 -3
- package/dist/packages/core/src/helpers/findParentNode.d.ts +3 -4
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +3 -3
- package/dist/packages/core/src/helpers/generateHTML.d.ts +1 -1
- package/dist/packages/core/src/helpers/generateJSON.d.ts +1 -1
- package/dist/packages/core/src/helpers/generateText.d.ts +5 -0
- package/dist/packages/core/src/helpers/getAttributes.d.ts +3 -3
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +2 -2
- package/dist/packages/core/src/helpers/getChangedRanges.d.ts +11 -0
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +2 -5
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +2 -2
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +2 -2
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +3 -3
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +2 -2
- package/dist/packages/core/src/helpers/getMarkType.d.ts +2 -2
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +2 -2
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +3 -3
- package/dist/packages/core/src/helpers/getNodeType.d.ts +2 -2
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +2 -2
- package/dist/packages/core/src/helpers/getSchema.d.ts +2 -2
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +2 -2
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +2 -2
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +2 -2
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +1 -1
- 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/getTextContentFromNodes.d.ts +2 -0
- package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +3 -0
- package/dist/packages/core/src/helpers/index.d.ts +47 -0
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +2 -2
- package/dist/packages/core/src/helpers/isActive.d.ts +2 -2
- package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +2 -0
- package/dist/packages/core/src/helpers/isList.d.ts +1 -1
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +3 -3
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +3 -3
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +2 -2
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +2 -2
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +2 -2
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +2 -2
- package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +4 -0
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +2 -2
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +6 -6
- package/dist/packages/core/src/index.d.ts +12 -34
- package/dist/packages/core/src/inputRules/index.d.ts +5 -0
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +12 -3
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +12 -3
- 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 +27 -0
- package/dist/packages/core/src/pasteRules/index.d.ts +3 -0
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +12 -3
- package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +12 -0
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +9 -0
- package/dist/packages/core/src/style.d.ts +1 -2
- package/dist/packages/core/src/types.d.ts +70 -40
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +1 -1
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -1
- package/dist/packages/core/src/utilities/deleteProps.d.ts +1 -1
- package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -1
- package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +1 -0
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -0
- package/dist/packages/core/src/utilities/fromString.d.ts +1 -1
- package/dist/packages/core/src/utilities/index.d.ts +20 -0
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -1
- package/dist/packages/core/src/utilities/isFunction.d.ts +1 -0
- package/dist/packages/core/src/utilities/isMacOS.d.ts +1 -0
- package/dist/packages/core/src/utilities/isNumber.d.ts +1 -0
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -1
- 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 -1
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -1
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -1
- package/dist/packages/core/src/utilities/minMax.d.ts +1 -1
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +3 -1
- package/dist/packages/core/src/utilities/removeDuplicates.d.ts +8 -0
- package/package.json +25 -24
- package/src/CommandManager.ts +73 -83
- package/src/Editor.ts +101 -53
- package/src/EventEmitter.ts +14 -4
- package/src/Extension.ts +244 -138
- package/src/ExtensionManager.ts +153 -152
- package/src/InputRule.ts +260 -0
- package/src/Mark.ts +365 -204
- package/src/Node.ts +406 -253
- package/src/NodeView.ts +59 -38
- package/src/PasteRule.ts +240 -0
- package/src/Tracker.ts +4 -8
- package/src/commands/blur.ts +4 -0
- package/src/commands/clearNodes.ts +15 -9
- package/src/commands/createParagraphNear.ts +3 -2
- package/src/commands/deleteCurrentNode.ts +41 -0
- package/src/commands/deleteNode.ts +3 -2
- package/src/commands/deleteRange.ts +1 -1
- package/src/commands/deleteSelection.ts +3 -2
- package/src/commands/exitCode.ts +3 -2
- package/src/commands/extendMarkRange.ts +9 -5
- package/src/commands/focus.ts +31 -42
- package/src/commands/index.ts +50 -0
- package/src/commands/insertContent.ts +15 -4
- package/src/commands/insertContentAt.ts +71 -14
- package/src/commands/join.ts +53 -0
- package/src/commands/keyboardShortcut.ts +3 -3
- package/src/commands/lift.ts +6 -5
- package/src/commands/liftEmptyBlock.ts +2 -1
- package/src/commands/liftListItem.ts +5 -4
- package/src/commands/newlineInCode.ts +3 -2
- package/src/commands/resetAttributes.ts +16 -10
- package/src/commands/selectAll.ts +5 -3
- package/src/commands/selectNodeBackward.ts +3 -2
- package/src/commands/selectNodeForward.ts +3 -2
- package/src/commands/selectParentNode.ts +3 -2
- package/src/commands/selectTextblockEnd.ts +20 -0
- package/src/commands/selectTextblockStart.ts +20 -0
- package/src/commands/setContent.ts +6 -9
- package/src/commands/setMark.ts +66 -13
- package/src/commands/setNode.ts +30 -6
- package/src/commands/setNodeSelection.ts +6 -7
- package/src/commands/setTextSelection.ts +8 -9
- package/src/commands/sinkListItem.ts +5 -4
- package/src/commands/splitBlock.ts +23 -38
- package/src/commands/splitListItem.ts +30 -27
- package/src/commands/toggleList.ts +108 -19
- package/src/commands/toggleMark.ts +17 -6
- package/src/commands/toggleNode.ts +9 -4
- package/src/commands/toggleWrap.ts +8 -8
- package/src/commands/undoInputRule.ts +31 -2
- package/src/commands/unsetAllMarks.ts +4 -8
- package/src/commands/unsetMark.ts +34 -21
- package/src/commands/updateAttributes.ts +18 -12
- package/src/commands/wrapIn.ts +5 -10
- package/src/commands/wrapInList.ts +5 -4
- package/src/extensions/clipboardTextSerializer.ts +15 -36
- package/src/extensions/commands.ts +3 -144
- package/src/extensions/editable.ts +2 -1
- package/src/extensions/focusEvents.ts +4 -6
- package/src/extensions/index.ts +1 -0
- package/src/extensions/keymap.ts +111 -13
- package/src/extensions/tabindex.ts +18 -0
- package/src/helpers/combineTransactionSteps.ts +21 -0
- package/src/helpers/createChainableState.ts +38 -0
- package/src/helpers/createDocument.ts +4 -3
- package/src/helpers/createNodeFromContent.ts +10 -15
- package/src/helpers/defaultBlockAt.ts +13 -0
- package/src/helpers/findChildren.ts +4 -3
- package/src/helpers/findChildrenInRange.ts +8 -3
- package/src/helpers/findParentNode.ts +4 -3
- package/src/helpers/findParentNodeClosestToPos.ts +13 -7
- package/src/helpers/generateHTML.ts +6 -5
- package/src/helpers/generateJSON.ts +6 -7
- package/src/helpers/generateText.ts +27 -0
- package/src/helpers/getAttributes.ts +8 -9
- package/src/helpers/getAttributesFromExtensions.ts +25 -12
- package/src/helpers/getChangedRanges.ts +83 -0
- package/src/helpers/getDebugJSON.ts +42 -38
- package/src/helpers/getExtensionField.ts +3 -3
- package/src/helpers/getHTMLFromFragment.ts +5 -6
- package/src/helpers/getMarkAttributes.ts +18 -10
- package/src/helpers/getMarkRange.ts +13 -8
- package/src/helpers/getMarkType.ts +5 -3
- package/src/helpers/getMarksBetween.ts +34 -10
- package/src/helpers/getNodeAttributes.ts +14 -12
- package/src/helpers/getNodeType.ts +5 -3
- package/src/helpers/getRenderedAttributes.ts +8 -6
- package/src/helpers/getSchema.ts +5 -4
- package/src/helpers/getSchemaByResolvedExtensions.ts +165 -111
- package/src/helpers/getSchemaTypeByName.ts +3 -11
- package/src/helpers/getSchemaTypeNameByName.ts +2 -2
- package/src/helpers/getSplittedAttributes.ts +1 -1
- package/src/helpers/getText.ts +19 -0
- package/src/helpers/getTextBetween.ts +46 -0
- package/src/helpers/getTextContentFromNodes.ts +26 -0
- package/src/helpers/getTextSerializersFromSchema.ts +11 -0
- package/src/helpers/index.ts +47 -0
- package/src/helpers/injectExtensionAttributesToParseRule.ts +22 -23
- package/src/helpers/isActive.ts +10 -5
- package/src/helpers/isExtensionRulesEnabled.ts +15 -0
- package/src/helpers/isList.ts +6 -5
- package/src/helpers/isMarkActive.ts +32 -35
- package/src/helpers/isNodeActive.ts +27 -37
- package/src/helpers/isNodeEmpty.ts +2 -2
- package/src/helpers/isNodeSelection.ts +3 -4
- package/src/helpers/isTextSelection.ts +3 -4
- package/src/helpers/posToDOMRect.ts +10 -4
- package/src/helpers/resolveFocusPosition.ts +42 -0
- package/src/helpers/selectionToInsertionEnd.ts +3 -3
- package/src/helpers/splitExtensions.ts +3 -3
- package/src/index.ts +12 -37
- package/src/inputRules/index.ts +5 -0
- package/src/inputRules/markInputRule.ts +59 -40
- package/src/inputRules/nodeInputRule.ts +45 -12
- package/src/inputRules/textInputRule.ts +35 -0
- package/src/inputRules/textblockTypeInputRule.ts +37 -0
- package/src/inputRules/wrappingInputRule.ts +84 -0
- package/src/pasteRules/index.ts +3 -0
- package/src/pasteRules/markPasteRule.ts +49 -56
- package/src/pasteRules/nodePasteRule.ts +37 -0
- package/src/pasteRules/textPasteRule.ts +35 -0
- package/src/style.ts +12 -3
- package/src/types.ts +140 -106
- package/src/utilities/callOrReturn.ts +3 -2
- package/src/utilities/createStyleTag.ts +8 -4
- package/src/utilities/deleteProps.ts +1 -1
- package/src/utilities/elementFromString.ts +1 -1
- package/src/utilities/escapeForRegEx.ts +4 -0
- package/src/utilities/findDuplicates.ts +5 -0
- package/src/utilities/fromString.ts +2 -2
- package/src/utilities/index.ts +20 -0
- package/src/utilities/isEmptyObject.ts +2 -2
- package/src/utilities/isFunction.ts +3 -0
- package/src/utilities/isMacOS.ts +5 -0
- package/src/utilities/isNumber.ts +3 -0
- package/src/utilities/isPlainObject.ts +8 -5
- package/src/utilities/isRegExp.ts +3 -0
- package/src/utilities/isString.ts +3 -0
- package/src/utilities/isiOS.ts +1 -1
- package/src/utilities/mergeAttributes.ts +2 -1
- package/src/utilities/mergeDeep.ts +2 -2
- package/src/utilities/minMax.ts +1 -1
- package/src/utilities/objectIncludes.ts +18 -4
- package/src/utilities/removeDuplicates.ts +15 -0
- package/CHANGELOG.md +0 -1182
- package/LICENSE.md +0 -21
- package/dist/packages/core/src/commands/joinBackward.d.ts +0 -12
- package/dist/packages/core/src/commands/joinForward.d.ts +0 -12
- package/dist/packages/core/src/utilities/isClass.d.ts +0 -1
- package/dist/packages/core/src/utilities/isObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/removeElement.d.ts +0 -1
- package/dist/tiptap-core.cjs.js +0 -3408
- package/dist/tiptap-core.cjs.js.map +0 -1
- package/dist/tiptap-core.esm.js.map +0 -1
- package/dist/tiptap-core.umd.js +0 -3405
- package/dist/tiptap-core.umd.js.map +0 -1
- package/src/commands/joinBackward.ts +0 -17
- package/src/commands/joinForward.ts +0 -17
- package/src/utilities/isClass.ts +0 -7
- package/src/utilities/isObject.ts +0 -10
- package/src/utilities/removeElement.ts +0 -5
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { DOMOutputSpec,
|
|
2
|
-
import { Plugin, Transaction } from '
|
|
3
|
-
import { InputRule } from 'prosemirror-inputrules';
|
|
4
|
-
import { Extensions, Attributes, NodeViewRenderer, GlobalAttributes, RawCommands, ParentConfig, KeyboardShortcutCommand } from './types';
|
|
1
|
+
import { DOMOutputSpec, Node as ProseMirrorNode, NodeSpec, NodeType } from '@tiptap/pm/model';
|
|
2
|
+
import { Plugin, Transaction } from '@tiptap/pm/state';
|
|
5
3
|
import { NodeConfig } from '.';
|
|
6
4
|
import { Editor } from './Editor';
|
|
5
|
+
import { InputRule } from './InputRule';
|
|
6
|
+
import { PasteRule } from './PasteRule';
|
|
7
|
+
import { Attributes, Extensions, GlobalAttributes, KeyboardShortcutCommand, NodeViewRenderer, ParentConfig, RawCommands } from './types';
|
|
7
8
|
declare module '@tiptap/core' {
|
|
8
|
-
interface NodeConfig<Options = any> {
|
|
9
|
+
interface NodeConfig<Options = any, Storage = any> {
|
|
9
10
|
[key: string]: any;
|
|
10
11
|
/**
|
|
11
12
|
* Name
|
|
@@ -19,13 +20,29 @@ declare module '@tiptap/core' {
|
|
|
19
20
|
* Default options
|
|
20
21
|
*/
|
|
21
22
|
defaultOptions?: Options;
|
|
23
|
+
/**
|
|
24
|
+
* Default Options
|
|
25
|
+
*/
|
|
26
|
+
addOptions?: (this: {
|
|
27
|
+
name: string;
|
|
28
|
+
parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addOptions'], undefined>;
|
|
29
|
+
}) => Options;
|
|
30
|
+
/**
|
|
31
|
+
* Default Storage
|
|
32
|
+
*/
|
|
33
|
+
addStorage?: (this: {
|
|
34
|
+
name: string;
|
|
35
|
+
options: Options;
|
|
36
|
+
parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addStorage'], undefined>;
|
|
37
|
+
}) => Storage;
|
|
22
38
|
/**
|
|
23
39
|
* Global attributes
|
|
24
40
|
*/
|
|
25
41
|
addGlobalAttributes?: (this: {
|
|
26
42
|
name: string;
|
|
27
43
|
options: Options;
|
|
28
|
-
|
|
44
|
+
storage: Storage;
|
|
45
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addGlobalAttributes'];
|
|
29
46
|
}) => GlobalAttributes | {};
|
|
30
47
|
/**
|
|
31
48
|
* Raw
|
|
@@ -33,9 +50,10 @@ declare module '@tiptap/core' {
|
|
|
33
50
|
addCommands?: (this: {
|
|
34
51
|
name: string;
|
|
35
52
|
options: Options;
|
|
53
|
+
storage: Storage;
|
|
36
54
|
editor: Editor;
|
|
37
55
|
type: NodeType;
|
|
38
|
-
parent: ParentConfig<NodeConfig<Options>>['addCommands'];
|
|
56
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addCommands'];
|
|
39
57
|
}) => Partial<RawCommands>;
|
|
40
58
|
/**
|
|
41
59
|
* Keyboard shortcuts
|
|
@@ -43,9 +61,10 @@ declare module '@tiptap/core' {
|
|
|
43
61
|
addKeyboardShortcuts?: (this: {
|
|
44
62
|
name: string;
|
|
45
63
|
options: Options;
|
|
64
|
+
storage: Storage;
|
|
46
65
|
editor: Editor;
|
|
47
66
|
type: NodeType;
|
|
48
|
-
parent: ParentConfig<NodeConfig<Options>>['addKeyboardShortcuts'];
|
|
67
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addKeyboardShortcuts'];
|
|
49
68
|
}) => {
|
|
50
69
|
[key: string]: KeyboardShortcutCommand;
|
|
51
70
|
};
|
|
@@ -55,9 +74,10 @@ declare module '@tiptap/core' {
|
|
|
55
74
|
addInputRules?: (this: {
|
|
56
75
|
name: string;
|
|
57
76
|
options: Options;
|
|
77
|
+
storage: Storage;
|
|
58
78
|
editor: Editor;
|
|
59
79
|
type: NodeType;
|
|
60
|
-
parent: ParentConfig<NodeConfig<Options>>['addInputRules'];
|
|
80
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addInputRules'];
|
|
61
81
|
}) => InputRule[];
|
|
62
82
|
/**
|
|
63
83
|
* Paste rules
|
|
@@ -65,19 +85,21 @@ declare module '@tiptap/core' {
|
|
|
65
85
|
addPasteRules?: (this: {
|
|
66
86
|
name: string;
|
|
67
87
|
options: Options;
|
|
88
|
+
storage: Storage;
|
|
68
89
|
editor: Editor;
|
|
69
90
|
type: NodeType;
|
|
70
|
-
parent: ParentConfig<NodeConfig<Options>>['addPasteRules'];
|
|
71
|
-
}) =>
|
|
91
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addPasteRules'];
|
|
92
|
+
}) => PasteRule[];
|
|
72
93
|
/**
|
|
73
94
|
* ProseMirror plugins
|
|
74
95
|
*/
|
|
75
96
|
addProseMirrorPlugins?: (this: {
|
|
76
97
|
name: string;
|
|
77
98
|
options: Options;
|
|
99
|
+
storage: Storage;
|
|
78
100
|
editor: Editor;
|
|
79
101
|
type: NodeType;
|
|
80
|
-
parent: ParentConfig<NodeConfig<Options>>['addProseMirrorPlugins'];
|
|
102
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addProseMirrorPlugins'];
|
|
81
103
|
}) => Plugin[];
|
|
82
104
|
/**
|
|
83
105
|
* Extensions
|
|
@@ -85,7 +107,8 @@ declare module '@tiptap/core' {
|
|
|
85
107
|
addExtensions?: (this: {
|
|
86
108
|
name: string;
|
|
87
109
|
options: Options;
|
|
88
|
-
|
|
110
|
+
storage: Storage;
|
|
111
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addExtensions'];
|
|
89
112
|
}) => Extensions;
|
|
90
113
|
/**
|
|
91
114
|
* Extend Node Schema
|
|
@@ -93,7 +116,8 @@ declare module '@tiptap/core' {
|
|
|
93
116
|
extendNodeSchema?: ((this: {
|
|
94
117
|
name: string;
|
|
95
118
|
options: Options;
|
|
96
|
-
|
|
119
|
+
storage: Storage;
|
|
120
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['extendNodeSchema'];
|
|
97
121
|
}, extension: Node) => Record<string, any>) | null;
|
|
98
122
|
/**
|
|
99
123
|
* Extend Mark Schema
|
|
@@ -101,7 +125,8 @@ declare module '@tiptap/core' {
|
|
|
101
125
|
extendMarkSchema?: ((this: {
|
|
102
126
|
name: string;
|
|
103
127
|
options: Options;
|
|
104
|
-
|
|
128
|
+
storage: Storage;
|
|
129
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['extendMarkSchema'];
|
|
105
130
|
}, extension: Node) => Record<string, any>) | null;
|
|
106
131
|
/**
|
|
107
132
|
* The editor is not ready yet.
|
|
@@ -109,9 +134,10 @@ declare module '@tiptap/core' {
|
|
|
109
134
|
onBeforeCreate?: ((this: {
|
|
110
135
|
name: string;
|
|
111
136
|
options: Options;
|
|
137
|
+
storage: Storage;
|
|
112
138
|
editor: Editor;
|
|
113
139
|
type: NodeType;
|
|
114
|
-
parent: ParentConfig<NodeConfig<Options>>['onBeforeCreate'];
|
|
140
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onBeforeCreate'];
|
|
115
141
|
}) => void) | null;
|
|
116
142
|
/**
|
|
117
143
|
* The editor is ready.
|
|
@@ -119,9 +145,10 @@ declare module '@tiptap/core' {
|
|
|
119
145
|
onCreate?: ((this: {
|
|
120
146
|
name: string;
|
|
121
147
|
options: Options;
|
|
148
|
+
storage: Storage;
|
|
122
149
|
editor: Editor;
|
|
123
150
|
type: NodeType;
|
|
124
|
-
parent: ParentConfig<NodeConfig<Options>>['onCreate'];
|
|
151
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onCreate'];
|
|
125
152
|
}) => void) | null;
|
|
126
153
|
/**
|
|
127
154
|
* The content has changed.
|
|
@@ -129,9 +156,10 @@ declare module '@tiptap/core' {
|
|
|
129
156
|
onUpdate?: ((this: {
|
|
130
157
|
name: string;
|
|
131
158
|
options: Options;
|
|
159
|
+
storage: Storage;
|
|
132
160
|
editor: Editor;
|
|
133
161
|
type: NodeType;
|
|
134
|
-
parent: ParentConfig<NodeConfig<Options>>['onUpdate'];
|
|
162
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onUpdate'];
|
|
135
163
|
}) => void) | null;
|
|
136
164
|
/**
|
|
137
165
|
* The selection has changed.
|
|
@@ -139,9 +167,10 @@ declare module '@tiptap/core' {
|
|
|
139
167
|
onSelectionUpdate?: ((this: {
|
|
140
168
|
name: string;
|
|
141
169
|
options: Options;
|
|
170
|
+
storage: Storage;
|
|
142
171
|
editor: Editor;
|
|
143
172
|
type: NodeType;
|
|
144
|
-
parent: ParentConfig<NodeConfig<Options>>['onSelectionUpdate'];
|
|
173
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onSelectionUpdate'];
|
|
145
174
|
}) => void) | null;
|
|
146
175
|
/**
|
|
147
176
|
* The editor state has changed.
|
|
@@ -149,9 +178,10 @@ declare module '@tiptap/core' {
|
|
|
149
178
|
onTransaction?: ((this: {
|
|
150
179
|
name: string;
|
|
151
180
|
options: Options;
|
|
181
|
+
storage: Storage;
|
|
152
182
|
editor: Editor;
|
|
153
183
|
type: NodeType;
|
|
154
|
-
parent: ParentConfig<NodeConfig<Options>>['onTransaction'];
|
|
184
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onTransaction'];
|
|
155
185
|
}, props: {
|
|
156
186
|
transaction: Transaction;
|
|
157
187
|
}) => void) | null;
|
|
@@ -161,9 +191,10 @@ declare module '@tiptap/core' {
|
|
|
161
191
|
onFocus?: ((this: {
|
|
162
192
|
name: string;
|
|
163
193
|
options: Options;
|
|
194
|
+
storage: Storage;
|
|
164
195
|
editor: Editor;
|
|
165
196
|
type: NodeType;
|
|
166
|
-
parent: ParentConfig<NodeConfig<Options>>['onFocus'];
|
|
197
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onFocus'];
|
|
167
198
|
}, props: {
|
|
168
199
|
event: FocusEvent;
|
|
169
200
|
}) => void) | null;
|
|
@@ -173,9 +204,10 @@ declare module '@tiptap/core' {
|
|
|
173
204
|
onBlur?: ((this: {
|
|
174
205
|
name: string;
|
|
175
206
|
options: Options;
|
|
207
|
+
storage: Storage;
|
|
176
208
|
editor: Editor;
|
|
177
209
|
type: NodeType;
|
|
178
|
-
parent: ParentConfig<NodeConfig<Options>>['onBlur'];
|
|
210
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onBlur'];
|
|
179
211
|
}, props: {
|
|
180
212
|
event: FocusEvent;
|
|
181
213
|
}) => void) | null;
|
|
@@ -185,9 +217,10 @@ declare module '@tiptap/core' {
|
|
|
185
217
|
onDestroy?: ((this: {
|
|
186
218
|
name: string;
|
|
187
219
|
options: Options;
|
|
220
|
+
storage: Storage;
|
|
188
221
|
editor: Editor;
|
|
189
222
|
type: NodeType;
|
|
190
|
-
parent: ParentConfig<NodeConfig<Options>>['onDestroy'];
|
|
223
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['onDestroy'];
|
|
191
224
|
}) => void) | null;
|
|
192
225
|
/**
|
|
193
226
|
* Node View
|
|
@@ -195,9 +228,10 @@ declare module '@tiptap/core' {
|
|
|
195
228
|
addNodeView?: ((this: {
|
|
196
229
|
name: string;
|
|
197
230
|
options: Options;
|
|
231
|
+
storage: Storage;
|
|
198
232
|
editor: Editor;
|
|
199
233
|
type: NodeType;
|
|
200
|
-
parent: ParentConfig<NodeConfig<Options>>['addNodeView'];
|
|
234
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addNodeView'];
|
|
201
235
|
}) => NodeViewRenderer) | null;
|
|
202
236
|
/**
|
|
203
237
|
* TopNode
|
|
@@ -209,7 +243,8 @@ declare module '@tiptap/core' {
|
|
|
209
243
|
content?: NodeSpec['content'] | ((this: {
|
|
210
244
|
name: string;
|
|
211
245
|
options: Options;
|
|
212
|
-
|
|
246
|
+
storage: Storage;
|
|
247
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['content'];
|
|
213
248
|
}) => NodeSpec['content']);
|
|
214
249
|
/**
|
|
215
250
|
* Marks
|
|
@@ -217,7 +252,8 @@ declare module '@tiptap/core' {
|
|
|
217
252
|
marks?: NodeSpec['marks'] | ((this: {
|
|
218
253
|
name: string;
|
|
219
254
|
options: Options;
|
|
220
|
-
|
|
255
|
+
storage: Storage;
|
|
256
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['marks'];
|
|
221
257
|
}) => NodeSpec['marks']);
|
|
222
258
|
/**
|
|
223
259
|
* Group
|
|
@@ -225,7 +261,8 @@ declare module '@tiptap/core' {
|
|
|
225
261
|
group?: NodeSpec['group'] | ((this: {
|
|
226
262
|
name: string;
|
|
227
263
|
options: Options;
|
|
228
|
-
|
|
264
|
+
storage: Storage;
|
|
265
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['group'];
|
|
229
266
|
}) => NodeSpec['group']);
|
|
230
267
|
/**
|
|
231
268
|
* Inline
|
|
@@ -233,7 +270,8 @@ declare module '@tiptap/core' {
|
|
|
233
270
|
inline?: NodeSpec['inline'] | ((this: {
|
|
234
271
|
name: string;
|
|
235
272
|
options: Options;
|
|
236
|
-
|
|
273
|
+
storage: Storage;
|
|
274
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['inline'];
|
|
237
275
|
}) => NodeSpec['inline']);
|
|
238
276
|
/**
|
|
239
277
|
* Atom
|
|
@@ -241,7 +279,8 @@ declare module '@tiptap/core' {
|
|
|
241
279
|
atom?: NodeSpec['atom'] | ((this: {
|
|
242
280
|
name: string;
|
|
243
281
|
options: Options;
|
|
244
|
-
|
|
282
|
+
storage: Storage;
|
|
283
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['atom'];
|
|
245
284
|
}) => NodeSpec['atom']);
|
|
246
285
|
/**
|
|
247
286
|
* Selectable
|
|
@@ -249,7 +288,8 @@ declare module '@tiptap/core' {
|
|
|
249
288
|
selectable?: NodeSpec['selectable'] | ((this: {
|
|
250
289
|
name: string;
|
|
251
290
|
options: Options;
|
|
252
|
-
|
|
291
|
+
storage: Storage;
|
|
292
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['selectable'];
|
|
253
293
|
}) => NodeSpec['selectable']);
|
|
254
294
|
/**
|
|
255
295
|
* Draggable
|
|
@@ -257,7 +297,8 @@ declare module '@tiptap/core' {
|
|
|
257
297
|
draggable?: NodeSpec['draggable'] | ((this: {
|
|
258
298
|
name: string;
|
|
259
299
|
options: Options;
|
|
260
|
-
|
|
300
|
+
storage: Storage;
|
|
301
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['draggable'];
|
|
261
302
|
}) => NodeSpec['draggable']);
|
|
262
303
|
/**
|
|
263
304
|
* Code
|
|
@@ -265,15 +306,26 @@ declare module '@tiptap/core' {
|
|
|
265
306
|
code?: NodeSpec['code'] | ((this: {
|
|
266
307
|
name: string;
|
|
267
308
|
options: Options;
|
|
268
|
-
|
|
309
|
+
storage: Storage;
|
|
310
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['code'];
|
|
269
311
|
}) => NodeSpec['code']);
|
|
312
|
+
/**
|
|
313
|
+
* Whitespace
|
|
314
|
+
*/
|
|
315
|
+
whitespace?: NodeSpec['whitespace'] | ((this: {
|
|
316
|
+
name: string;
|
|
317
|
+
options: Options;
|
|
318
|
+
storage: Storage;
|
|
319
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['whitespace'];
|
|
320
|
+
}) => NodeSpec['whitespace']);
|
|
270
321
|
/**
|
|
271
322
|
* Defining
|
|
272
323
|
*/
|
|
273
324
|
defining?: NodeSpec['defining'] | ((this: {
|
|
274
325
|
name: string;
|
|
275
326
|
options: Options;
|
|
276
|
-
|
|
327
|
+
storage: Storage;
|
|
328
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['defining'];
|
|
277
329
|
}) => NodeSpec['defining']);
|
|
278
330
|
/**
|
|
279
331
|
* Isolating
|
|
@@ -281,7 +333,8 @@ declare module '@tiptap/core' {
|
|
|
281
333
|
isolating?: NodeSpec['isolating'] | ((this: {
|
|
282
334
|
name: string;
|
|
283
335
|
options: Options;
|
|
284
|
-
|
|
336
|
+
storage: Storage;
|
|
337
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['isolating'];
|
|
285
338
|
}) => NodeSpec['isolating']);
|
|
286
339
|
/**
|
|
287
340
|
* Parse HTML
|
|
@@ -289,7 +342,8 @@ declare module '@tiptap/core' {
|
|
|
289
342
|
parseHTML?: (this: {
|
|
290
343
|
name: string;
|
|
291
344
|
options: Options;
|
|
292
|
-
|
|
345
|
+
storage: Storage;
|
|
346
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['parseHTML'];
|
|
293
347
|
}) => NodeSpec['parseDOM'];
|
|
294
348
|
/**
|
|
295
349
|
* Render HTML
|
|
@@ -297,7 +351,8 @@ declare module '@tiptap/core' {
|
|
|
297
351
|
renderHTML?: ((this: {
|
|
298
352
|
name: string;
|
|
299
353
|
options: Options;
|
|
300
|
-
|
|
354
|
+
storage: Storage;
|
|
355
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['renderHTML'];
|
|
301
356
|
}, props: {
|
|
302
357
|
node: ProseMirrorNode;
|
|
303
358
|
HTMLAttributes: Record<string, any>;
|
|
@@ -308,11 +363,13 @@ declare module '@tiptap/core' {
|
|
|
308
363
|
renderText?: ((this: {
|
|
309
364
|
name: string;
|
|
310
365
|
options: Options;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
parent: ParentConfig<NodeConfig<Options>>['renderText'];
|
|
366
|
+
storage: Storage;
|
|
367
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['renderText'];
|
|
314
368
|
}, props: {
|
|
315
369
|
node: ProseMirrorNode;
|
|
370
|
+
pos: number;
|
|
371
|
+
parent: ProseMirrorNode;
|
|
372
|
+
index: number;
|
|
316
373
|
}) => string) | null;
|
|
317
374
|
/**
|
|
318
375
|
* Add Attributes
|
|
@@ -320,19 +377,21 @@ declare module '@tiptap/core' {
|
|
|
320
377
|
addAttributes?: (this: {
|
|
321
378
|
name: string;
|
|
322
379
|
options: Options;
|
|
323
|
-
|
|
380
|
+
storage: Storage;
|
|
381
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
|
|
324
382
|
}) => Attributes | {};
|
|
325
383
|
}
|
|
326
384
|
}
|
|
327
|
-
export declare class Node<Options = any> {
|
|
385
|
+
export declare class Node<Options = any, Storage = any> {
|
|
328
386
|
type: string;
|
|
329
387
|
name: string;
|
|
330
388
|
parent: Node | null;
|
|
331
389
|
child: Node | null;
|
|
332
390
|
options: Options;
|
|
391
|
+
storage: Storage;
|
|
333
392
|
config: NodeConfig;
|
|
334
|
-
constructor(config?: Partial<NodeConfig<Options>>);
|
|
335
|
-
static create<O>(config?: Partial<NodeConfig<O>>): Node<O>;
|
|
336
|
-
configure(options?: Partial<Options>): Node<Options>;
|
|
337
|
-
extend<ExtendedOptions = Options>(extendedConfig?: Partial<NodeConfig<ExtendedOptions>>): Node<ExtendedOptions>;
|
|
393
|
+
constructor(config?: Partial<NodeConfig<Options, Storage>>);
|
|
394
|
+
static create<O = any, S = any>(config?: Partial<NodeConfig<O, S>>): Node<O, S>;
|
|
395
|
+
configure(options?: Partial<Options>): Node<Options, Storage>;
|
|
396
|
+
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<NodeConfig<ExtendedOptions, ExtendedStorage>>): Node<ExtendedOptions, ExtendedStorage>;
|
|
338
397
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import { NodeView as ProseMirrorNodeView } from '@tiptap/pm/view';
|
|
3
3
|
import { Editor as CoreEditor } from './Editor';
|
|
4
4
|
import { Node } from './Node';
|
|
5
|
-
import {
|
|
6
|
-
export declare class NodeView<Component,
|
|
5
|
+
import { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types';
|
|
6
|
+
export declare class NodeView<Component, NodeEditor extends CoreEditor = CoreEditor, Options extends NodeViewRendererOptions = NodeViewRendererOptions> implements ProseMirrorNodeView {
|
|
7
7
|
component: Component;
|
|
8
|
-
editor:
|
|
8
|
+
editor: NodeEditor;
|
|
9
9
|
options: Options;
|
|
10
10
|
extension: Node;
|
|
11
11
|
node: ProseMirrorNode;
|
|
12
|
-
decorations:
|
|
12
|
+
decorations: DecorationWithType[];
|
|
13
13
|
getPos: any;
|
|
14
14
|
isDragging: boolean;
|
|
15
15
|
constructor(component: Component, props: NodeViewRendererProps, options?: Partial<Options>);
|
|
16
16
|
mount(): void;
|
|
17
|
-
get dom():
|
|
18
|
-
get contentDOM():
|
|
17
|
+
get dom(): HTMLElement;
|
|
18
|
+
get contentDOM(): HTMLElement | null;
|
|
19
19
|
onDragStart(event: DragEvent): void;
|
|
20
20
|
stopEvent(event: Event): boolean;
|
|
21
21
|
ignoreMutation(mutation: MutationRecord | {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { EditorState, Plugin } from '@tiptap/pm/state';
|
|
2
|
+
import { Editor } from './Editor';
|
|
3
|
+
import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types';
|
|
4
|
+
export declare type PasteRuleMatch = {
|
|
5
|
+
index: number;
|
|
6
|
+
text: string;
|
|
7
|
+
replaceWith?: string;
|
|
8
|
+
match?: RegExpMatchArray;
|
|
9
|
+
data?: Record<string, any>;
|
|
10
|
+
};
|
|
11
|
+
export declare type PasteRuleFinder = RegExp | ((text: string) => PasteRuleMatch[] | null | undefined);
|
|
12
|
+
export declare class PasteRule {
|
|
13
|
+
find: PasteRuleFinder;
|
|
14
|
+
handler: (props: {
|
|
15
|
+
state: EditorState;
|
|
16
|
+
range: Range;
|
|
17
|
+
match: ExtendedRegExpMatchArray;
|
|
18
|
+
commands: SingleCommands;
|
|
19
|
+
chain: () => ChainedCommands;
|
|
20
|
+
can: () => CanCommands;
|
|
21
|
+
}) => void | null;
|
|
22
|
+
constructor(config: {
|
|
23
|
+
find: PasteRuleFinder;
|
|
24
|
+
handler: (props: {
|
|
25
|
+
state: EditorState;
|
|
26
|
+
range: Range;
|
|
27
|
+
match: ExtendedRegExpMatchArray;
|
|
28
|
+
commands: SingleCommands;
|
|
29
|
+
chain: () => ChainedCommands;
|
|
30
|
+
can: () => CanCommands;
|
|
31
|
+
}) => void | null;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create an paste rules plugin. When enabled, it will cause pasted
|
|
36
|
+
* text that matches any of the given rules to trigger the rule’s
|
|
37
|
+
* action.
|
|
38
|
+
*/
|
|
39
|
+
export declare function pasteRulesPlugin(props: {
|
|
40
|
+
editor: Editor;
|
|
41
|
+
rules: PasteRule[];
|
|
42
|
+
}): Plugin[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RawCommands } from '../types';
|
|
2
|
+
declare module '@tiptap/core' {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
deleteCurrentNode: {
|
|
5
|
+
/**
|
|
6
|
+
* Delete the node that currently has the selection anchor.
|
|
7
|
+
*/
|
|
8
|
+
deleteCurrentNode: () => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const deleteCurrentNode: RawCommands['deleteCurrentNode'];
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FocusPosition, RawCommands } from '../types';
|
|
2
2
|
declare module '@tiptap/core' {
|
|
3
3
|
interface Commands<ReturnType> {
|
|
4
4
|
focus: {
|
|
5
5
|
/**
|
|
6
6
|
* Focus the editor at the given position.
|
|
7
7
|
*/
|
|
8
|
-
focus: (position?: FocusPosition
|
|
8
|
+
focus: (position?: FocusPosition, options?: {
|
|
9
|
+
scrollIntoView?: boolean;
|
|
10
|
+
}) => ReturnType;
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export * from './blur';
|
|
2
|
+
export * from './clearContent';
|
|
3
|
+
export * from './clearNodes';
|
|
4
|
+
export * from './command';
|
|
5
|
+
export * from './createParagraphNear';
|
|
6
|
+
export * from './deleteCurrentNode';
|
|
7
|
+
export * from './deleteNode';
|
|
8
|
+
export * from './deleteRange';
|
|
9
|
+
export * from './deleteSelection';
|
|
10
|
+
export * from './enter';
|
|
11
|
+
export * from './exitCode';
|
|
12
|
+
export * from './extendMarkRange';
|
|
13
|
+
export * from './first';
|
|
14
|
+
export * from './focus';
|
|
15
|
+
export * from './forEach';
|
|
16
|
+
export * from './insertContent';
|
|
17
|
+
export * from './insertContentAt';
|
|
18
|
+
export * from './join';
|
|
19
|
+
export * from './keyboardShortcut';
|
|
20
|
+
export * from './lift';
|
|
21
|
+
export * from './liftEmptyBlock';
|
|
22
|
+
export * from './liftListItem';
|
|
23
|
+
export * from './newlineInCode';
|
|
24
|
+
export * from './resetAttributes';
|
|
25
|
+
export * from './scrollIntoView';
|
|
26
|
+
export * from './selectAll';
|
|
27
|
+
export * from './selectNodeBackward';
|
|
28
|
+
export * from './selectNodeForward';
|
|
29
|
+
export * from './selectParentNode';
|
|
30
|
+
export * from './selectTextblockEnd';
|
|
31
|
+
export * from './selectTextblockStart';
|
|
32
|
+
export * from './setContent';
|
|
33
|
+
export * from './setMark';
|
|
34
|
+
export * from './setMeta';
|
|
35
|
+
export * from './setNode';
|
|
36
|
+
export * from './setNodeSelection';
|
|
37
|
+
export * from './setTextSelection';
|
|
38
|
+
export * from './sinkListItem';
|
|
39
|
+
export * from './splitBlock';
|
|
40
|
+
export * from './splitListItem';
|
|
41
|
+
export * from './toggleList';
|
|
42
|
+
export * from './toggleMark';
|
|
43
|
+
export * from './toggleNode';
|
|
44
|
+
export * from './toggleWrap';
|
|
45
|
+
export * from './undoInputRule';
|
|
46
|
+
export * from './unsetAllMarks';
|
|
47
|
+
export * from './unsetMark';
|
|
48
|
+
export * from './updateAttributes';
|
|
49
|
+
export * from './wrapIn';
|
|
50
|
+
export * from './wrapInList';
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ParseOptions } from '@tiptap/pm/model';
|
|
2
|
+
import { Content, RawCommands } from '../types';
|
|
3
3
|
declare module '@tiptap/core' {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
insertContent: {
|
|
6
6
|
/**
|
|
7
7
|
* Insert a node or string of HTML at the current position.
|
|
8
8
|
*/
|
|
9
|
-
insertContent: (value: Content, options?:
|
|
9
|
+
insertContent: (value: Content, options?: {
|
|
10
|
+
parseOptions?: ParseOptions;
|
|
11
|
+
updateSelection?: boolean;
|
|
12
|
+
}) => ReturnType;
|
|
10
13
|
};
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ParseOptions } from '@tiptap/pm/model';
|
|
2
|
+
import { Content, Range, RawCommands } from '../types';
|
|
3
3
|
declare module '@tiptap/core' {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
insertContentAt: {
|
|
6
6
|
/**
|
|
7
7
|
* Insert a node or string of HTML at a specific position.
|
|
8
8
|
*/
|
|
9
|
-
insertContentAt: (position: number | Range, value: Content, options?:
|
|
9
|
+
insertContentAt: (position: number | Range, value: Content, options?: {
|
|
10
|
+
parseOptions?: ParseOptions;
|
|
11
|
+
updateSelection?: boolean;
|
|
12
|
+
}) => ReturnType;
|
|
10
13
|
};
|
|
11
14
|
}
|
|
12
15
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RawCommands } from '../types';
|
|
2
|
+
declare module '@tiptap/core' {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
joinUp: {
|
|
5
|
+
/**
|
|
6
|
+
* Join two nodes Up.
|
|
7
|
+
*/
|
|
8
|
+
joinUp: () => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
joinDown: {
|
|
11
|
+
/**
|
|
12
|
+
* Join two nodes Down.
|
|
13
|
+
*/
|
|
14
|
+
joinDown: () => ReturnType;
|
|
15
|
+
};
|
|
16
|
+
joinBackward: {
|
|
17
|
+
/**
|
|
18
|
+
* Join two nodes Backwards.
|
|
19
|
+
*/
|
|
20
|
+
joinBackward: () => ReturnType;
|
|
21
|
+
};
|
|
22
|
+
joinForward: {
|
|
23
|
+
/**
|
|
24
|
+
* Join two nodes Forwards.
|
|
25
|
+
*/
|
|
26
|
+
joinForward: () => ReturnType;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare const joinUp: RawCommands['joinUp'];
|
|
31
|
+
export declare const joinDown: RawCommands['joinDown'];
|
|
32
|
+
export declare const joinBackward: RawCommands['joinBackward'];
|
|
33
|
+
export declare const joinForward: RawCommands['joinForward'];
|