@tiptap/extension-paragraph 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +62 -41
- package/dist/index.cjs.map +1 -1
- package/dist/{packages/extension-paragraph/src/paragraph.d.ts → index.d.cts} +5 -2
- package/dist/index.d.ts +28 -0
- package/dist/index.js +37 -38
- package/dist/index.js.map +1 -1
- package/package.json +11 -9
- package/src/paragraph.ts +8 -8
- package/dist/index.umd.js +0 -49
- 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-paragraph/src/index.d.ts +0 -3
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MarkType, NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
resetAttributes: {
|
|
6
|
-
/**
|
|
7
|
-
* Resets some node attributes to the default value.
|
|
8
|
-
* @param typeOrName The type or name of the node.
|
|
9
|
-
* @param attributes The attributes of the node to reset.
|
|
10
|
-
* @example editor.commands.resetAttributes('heading', 'level')
|
|
11
|
-
*/
|
|
12
|
-
resetAttributes: (typeOrName: string | NodeType | MarkType, attributes: string | string[]) => ReturnType;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare const resetAttributes: RawCommands['resetAttributes'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
scrollIntoView: {
|
|
5
|
-
/**
|
|
6
|
-
* Scroll the selection into view.
|
|
7
|
-
* @example editor.commands.scrollIntoView()
|
|
8
|
-
*/
|
|
9
|
-
scrollIntoView: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const scrollIntoView: RawCommands['scrollIntoView'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
selectAll: {
|
|
5
|
-
/**
|
|
6
|
-
* Select the whole document.
|
|
7
|
-
* @example editor.commands.selectAll()
|
|
8
|
-
*/
|
|
9
|
-
selectAll: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const selectAll: RawCommands['selectAll'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
selectNodeBackward: {
|
|
5
|
-
/**
|
|
6
|
-
* Select a node backward.
|
|
7
|
-
* @example editor.commands.selectNodeBackward()
|
|
8
|
-
*/
|
|
9
|
-
selectNodeBackward: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const selectNodeBackward: RawCommands['selectNodeBackward'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
selectNodeForward: {
|
|
5
|
-
/**
|
|
6
|
-
* Select a node forward.
|
|
7
|
-
* @example editor.commands.selectNodeForward()
|
|
8
|
-
*/
|
|
9
|
-
selectNodeForward: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const selectNodeForward: RawCommands['selectNodeForward'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
selectParentNode: {
|
|
5
|
-
/**
|
|
6
|
-
* Select the parent node.
|
|
7
|
-
* @example editor.commands.selectParentNode()
|
|
8
|
-
*/
|
|
9
|
-
selectParentNode: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const selectParentNode: RawCommands['selectParentNode'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
selectTextblockEnd: {
|
|
5
|
-
/**
|
|
6
|
-
* Moves the cursor to the end of current text block.
|
|
7
|
-
* @example editor.commands.selectTextblockEnd()
|
|
8
|
-
*/
|
|
9
|
-
selectTextblockEnd: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const selectTextblockEnd: RawCommands['selectTextblockEnd'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
selectTextblockStart: {
|
|
5
|
-
/**
|
|
6
|
-
* Moves the cursor to the start of current text block.
|
|
7
|
-
* @example editor.commands.selectTextblockStart()
|
|
8
|
-
*/
|
|
9
|
-
selectTextblockStart: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const selectTextblockStart: RawCommands['selectTextblockStart'];
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ParseOptions } from '@tiptap/pm/model';
|
|
2
|
-
import { Content, RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
setContent: {
|
|
6
|
-
/**
|
|
7
|
-
* Replace the whole document with new content.
|
|
8
|
-
* @param content The new content.
|
|
9
|
-
* @param emitUpdate Whether to emit an update event.
|
|
10
|
-
* @param parseOptions Options for parsing the content.
|
|
11
|
-
* @example editor.commands.setContent('<p>Example text</p>')
|
|
12
|
-
*/
|
|
13
|
-
setContent: (
|
|
14
|
-
/**
|
|
15
|
-
* The new content.
|
|
16
|
-
*/
|
|
17
|
-
content: Content,
|
|
18
|
-
/**
|
|
19
|
-
* Whether to emit an update event.
|
|
20
|
-
* @default false
|
|
21
|
-
*/
|
|
22
|
-
emitUpdate?: boolean,
|
|
23
|
-
/**
|
|
24
|
-
* Options for parsing the content.
|
|
25
|
-
* @default {}
|
|
26
|
-
*/
|
|
27
|
-
parseOptions?: ParseOptions,
|
|
28
|
-
/**
|
|
29
|
-
* Options for `setContent`.
|
|
30
|
-
*/
|
|
31
|
-
options?: {
|
|
32
|
-
/**
|
|
33
|
-
* Whether to throw an error if the content is invalid.
|
|
34
|
-
*/
|
|
35
|
-
errorOnInvalidContent?: boolean;
|
|
36
|
-
}) => ReturnType;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export declare const setContent: RawCommands['setContent'];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MarkType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
setMark: {
|
|
6
|
-
/**
|
|
7
|
-
* Add a mark with new attributes.
|
|
8
|
-
* @param typeOrName The mark type or name.
|
|
9
|
-
* @example editor.commands.setMark('bold', { level: 1 })
|
|
10
|
-
*/
|
|
11
|
-
setMark: (typeOrName: string | MarkType, attributes?: Record<string, any>) => ReturnType;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const setMark: RawCommands['setMark'];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
setMeta: {
|
|
5
|
-
/**
|
|
6
|
-
* Store a metadata property in the current transaction.
|
|
7
|
-
* @param key The key of the metadata property.
|
|
8
|
-
* @param value The value to store.
|
|
9
|
-
* @example editor.commands.setMeta('foo', 'bar')
|
|
10
|
-
*/
|
|
11
|
-
setMeta: (key: string, value: any) => ReturnType;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const setMeta: RawCommands['setMeta'];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
setNode: {
|
|
6
|
-
/**
|
|
7
|
-
* Replace a given range with a node.
|
|
8
|
-
* @param typeOrName The type or name of the node
|
|
9
|
-
* @param attributes The attributes of the node
|
|
10
|
-
* @example editor.commands.setNode('paragraph')
|
|
11
|
-
*/
|
|
12
|
-
setNode: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare const setNode: RawCommands['setNode'];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
setNodeSelection: {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a NodeSelection.
|
|
7
|
-
* @param position - Position of the node.
|
|
8
|
-
* @example editor.commands.setNodeSelection(10)
|
|
9
|
-
*/
|
|
10
|
-
setNodeSelection: (position: number) => ReturnType;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export declare const setNodeSelection: RawCommands['setNodeSelection'];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Range, RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
setTextSelection: {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a TextSelection.
|
|
7
|
-
* @param position The position of the selection.
|
|
8
|
-
* @example editor.commands.setTextSelection(10)
|
|
9
|
-
*/
|
|
10
|
-
setTextSelection: (position: number | Range) => ReturnType;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export declare const setTextSelection: RawCommands['setTextSelection'];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
sinkListItem: {
|
|
6
|
-
/**
|
|
7
|
-
* Sink the list item down into an inner list.
|
|
8
|
-
* @param typeOrName The type or name of the node.
|
|
9
|
-
* @example editor.commands.sinkListItem('listItem')
|
|
10
|
-
*/
|
|
11
|
-
sinkListItem: (typeOrName: string | NodeType) => ReturnType;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const sinkListItem: RawCommands['sinkListItem'];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
splitBlock: {
|
|
5
|
-
/**
|
|
6
|
-
* Forks a new node from an existing node.
|
|
7
|
-
* @param options.keepMarks Keep marks from the previous node.
|
|
8
|
-
* @example editor.commands.splitBlock()
|
|
9
|
-
* @example editor.commands.splitBlock({ keepMarks: true })
|
|
10
|
-
*/
|
|
11
|
-
splitBlock: (options?: {
|
|
12
|
-
keepMarks?: boolean;
|
|
13
|
-
}) => ReturnType;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export declare const splitBlock: RawCommands['splitBlock'];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
splitListItem: {
|
|
6
|
-
/**
|
|
7
|
-
* Splits one list item into two list items.
|
|
8
|
-
* @param typeOrName The type or name of the node.
|
|
9
|
-
* @example editor.commands.splitListItem('listItem')
|
|
10
|
-
*/
|
|
11
|
-
splitListItem: (typeOrName: string | NodeType) => ReturnType;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const splitListItem: RawCommands['splitListItem'];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
toggleList: {
|
|
6
|
-
/**
|
|
7
|
-
* Toggle between different list types.
|
|
8
|
-
* @param listTypeOrName The type or name of the list.
|
|
9
|
-
* @param itemTypeOrName The type or name of the list item.
|
|
10
|
-
* @param keepMarks Keep marks when toggling.
|
|
11
|
-
* @param attributes Attributes for the new list.
|
|
12
|
-
* @example editor.commands.toggleList('bulletList', 'listItem')
|
|
13
|
-
*/
|
|
14
|
-
toggleList: (listTypeOrName: string | NodeType, itemTypeOrName: string | NodeType, keepMarks?: boolean, attributes?: Record<string, any>) => ReturnType;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export declare const toggleList: RawCommands['toggleList'];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { MarkType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
toggleMark: {
|
|
6
|
-
/**
|
|
7
|
-
* Toggle a mark on and off.
|
|
8
|
-
* @param typeOrName The mark type or name.
|
|
9
|
-
* @param attributes The attributes of the mark.
|
|
10
|
-
* @param options.extendEmptyMarkRange Removes the mark even across the current selection. Defaults to `false`.
|
|
11
|
-
* @example editor.commands.toggleMark('bold')
|
|
12
|
-
*/
|
|
13
|
-
toggleMark: (
|
|
14
|
-
/**
|
|
15
|
-
* The mark type or name.
|
|
16
|
-
*/
|
|
17
|
-
typeOrName: string | MarkType,
|
|
18
|
-
/**
|
|
19
|
-
* The attributes of the mark.
|
|
20
|
-
*/
|
|
21
|
-
attributes?: Record<string, any>, options?: {
|
|
22
|
-
/**
|
|
23
|
-
* Removes the mark even across the current selection. Defaults to `false`.
|
|
24
|
-
*/
|
|
25
|
-
extendEmptyMarkRange?: boolean;
|
|
26
|
-
}) => ReturnType;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export declare const toggleMark: RawCommands['toggleMark'];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
toggleNode: {
|
|
6
|
-
/**
|
|
7
|
-
* Toggle a node with another node.
|
|
8
|
-
* @param typeOrName The type or name of the node.
|
|
9
|
-
* @param toggleTypeOrName The type or name of the node to toggle.
|
|
10
|
-
* @param attributes The attributes of the node.
|
|
11
|
-
* @example editor.commands.toggleNode('heading', 'paragraph')
|
|
12
|
-
*/
|
|
13
|
-
toggleNode: (typeOrName: string | NodeType, toggleTypeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export declare const toggleNode: RawCommands['toggleNode'];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
toggleWrap: {
|
|
6
|
-
/**
|
|
7
|
-
* Wraps nodes in another node, or removes an existing wrap.
|
|
8
|
-
* @param typeOrName The type or name of the node.
|
|
9
|
-
* @param attributes The attributes of the node.
|
|
10
|
-
* @example editor.commands.toggleWrap('blockquote')
|
|
11
|
-
*/
|
|
12
|
-
toggleWrap: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare const toggleWrap: RawCommands['toggleWrap'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
undoInputRule: {
|
|
5
|
-
/**
|
|
6
|
-
* Undo an input rule.
|
|
7
|
-
* @example editor.commands.undoInputRule()
|
|
8
|
-
*/
|
|
9
|
-
undoInputRule: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const undoInputRule: RawCommands['undoInputRule'];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RawCommands } from '../types.js';
|
|
2
|
-
declare module '@tiptap/core' {
|
|
3
|
-
interface Commands<ReturnType> {
|
|
4
|
-
unsetAllMarks: {
|
|
5
|
-
/**
|
|
6
|
-
* Remove all marks in the current selection.
|
|
7
|
-
* @example editor.commands.unsetAllMarks()
|
|
8
|
-
*/
|
|
9
|
-
unsetAllMarks: () => ReturnType;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const unsetAllMarks: RawCommands['unsetAllMarks'];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { MarkType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
unsetMark: {
|
|
6
|
-
/**
|
|
7
|
-
* Remove all marks in the current selection.
|
|
8
|
-
* @param typeOrName The mark type or name.
|
|
9
|
-
* @param options.extendEmptyMarkRange Removes the mark even across the current selection. Defaults to `false`.
|
|
10
|
-
* @example editor.commands.unsetMark('bold')
|
|
11
|
-
*/
|
|
12
|
-
unsetMark: (
|
|
13
|
-
/**
|
|
14
|
-
* The mark type or name.
|
|
15
|
-
*/
|
|
16
|
-
typeOrName: string | MarkType, options?: {
|
|
17
|
-
/**
|
|
18
|
-
* Removes the mark even across the current selection. Defaults to `false`.
|
|
19
|
-
*/
|
|
20
|
-
extendEmptyMarkRange?: boolean;
|
|
21
|
-
}) => ReturnType;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export declare const unsetMark: RawCommands['unsetMark'];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MarkType, NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
updateAttributes: {
|
|
6
|
-
/**
|
|
7
|
-
* Update attributes of a node or mark.
|
|
8
|
-
* @param typeOrName The type or name of the node or mark.
|
|
9
|
-
* @param attributes The attributes of the node or mark.
|
|
10
|
-
* @example editor.commands.updateAttributes('mention', { userId: "2" })
|
|
11
|
-
*/
|
|
12
|
-
updateAttributes: (
|
|
13
|
-
/**
|
|
14
|
-
* The type or name of the node or mark.
|
|
15
|
-
*/
|
|
16
|
-
typeOrName: string | NodeType | MarkType,
|
|
17
|
-
/**
|
|
18
|
-
* The attributes of the node or mark.
|
|
19
|
-
*/
|
|
20
|
-
attributes: Record<string, any>) => ReturnType;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export declare const updateAttributes: RawCommands['updateAttributes'];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
wrapIn: {
|
|
6
|
-
/**
|
|
7
|
-
* Wraps nodes in another node.
|
|
8
|
-
* @param typeOrName The type or name of the node.
|
|
9
|
-
* @param attributes The attributes of the node.
|
|
10
|
-
* @example editor.commands.wrapIn('blockquote')
|
|
11
|
-
*/
|
|
12
|
-
wrapIn: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare const wrapIn: RawCommands['wrapIn'];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { RawCommands } from '../types.js';
|
|
3
|
-
declare module '@tiptap/core' {
|
|
4
|
-
interface Commands<ReturnType> {
|
|
5
|
-
wrapInList: {
|
|
6
|
-
/**
|
|
7
|
-
* Wrap a node in a list.
|
|
8
|
-
* @param typeOrName The type or name of the node.
|
|
9
|
-
* @param attributes The attributes of the node.
|
|
10
|
-
* @example editor.commands.wrapInList('bulletList')
|
|
11
|
-
*/
|
|
12
|
-
wrapInList: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare const wrapInList: RawCommands['wrapInList'];
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ClipboardTextSerializer } from './clipboardTextSerializer.js';
|
|
2
|
-
export { Commands } from './commands.js';
|
|
3
|
-
export { Editable } from './editable.js';
|
|
4
|
-
export { FocusEvents } from './focusEvents.js';
|
|
5
|
-
export { Keymap } from './keymap.js';
|
|
6
|
-
export { Tabindex } from './tabindex.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
-
import { Transaction } from '@tiptap/pm/state';
|
|
3
|
-
import { Transform } from '@tiptap/pm/transform';
|
|
4
|
-
/**
|
|
5
|
-
* Returns a new `Transform` based on all steps of the passed transactions.
|
|
6
|
-
* @param oldDoc The Prosemirror node to start from
|
|
7
|
-
* @param transactions The transactions to combine
|
|
8
|
-
* @returns A new `Transform` with all steps of the passed transactions
|
|
9
|
-
*/
|
|
10
|
-
export declare function combineTransactionSteps(oldDoc: ProseMirrorNode, transactions: Transaction[]): Transform;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { EditorState, Transaction } from '@tiptap/pm/state';
|
|
2
|
-
/**
|
|
3
|
-
* Takes a Transaction & Editor State and turns it into a chainable state object
|
|
4
|
-
* @param config The transaction and state to create the chainable state from
|
|
5
|
-
* @returns A chainable Editor state object
|
|
6
|
-
*/
|
|
7
|
-
export declare function createChainableState(config: {
|
|
8
|
-
transaction: Transaction;
|
|
9
|
-
state: EditorState;
|
|
10
|
-
}): EditorState;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model';
|
|
2
|
-
import { Content } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Create a new Prosemirror document node from content.
|
|
5
|
-
* @param content The JSON or HTML content to create the document from
|
|
6
|
-
* @param schema The Prosemirror schema to use for the document
|
|
7
|
-
* @param parseOptions Options for the parser
|
|
8
|
-
* @returns The created Prosemirror document node
|
|
9
|
-
*/
|
|
10
|
-
export declare function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions, options?: {
|
|
11
|
-
errorOnInvalidContent?: boolean;
|
|
12
|
-
}): ProseMirrorNode;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Fragment, Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model';
|
|
2
|
-
import { Content } from '../types.js';
|
|
3
|
-
export type CreateNodeFromContentOptions = {
|
|
4
|
-
slice?: boolean;
|
|
5
|
-
parseOptions?: ParseOptions;
|
|
6
|
-
errorOnInvalidContent?: boolean;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Takes a JSON or HTML content and creates a Prosemirror node or fragment from it.
|
|
10
|
-
* @param content The JSON or HTML content to create the node from
|
|
11
|
-
* @param schema The Prosemirror schema to use for the node
|
|
12
|
-
* @param options Options for the parser
|
|
13
|
-
* @returns The created Prosemirror node or fragment
|
|
14
|
-
*/
|
|
15
|
-
export declare function createNodeFromContent(content: Content, schema: Schema, options?: CreateNodeFromContentOptions): ProseMirrorNode | Fragment;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ContentMatch, NodeType } from '@tiptap/pm/model';
|
|
2
|
-
/**
|
|
3
|
-
* Gets the default block type at a given match
|
|
4
|
-
* @param match The content match to get the default block type from
|
|
5
|
-
* @returns The default block type or null
|
|
6
|
-
*/
|
|
7
|
-
export declare function defaultBlockAt(match: ContentMatch): NodeType | null;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
-
import { NodeWithPos, Predicate } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Find children inside a Prosemirror node that match a predicate.
|
|
5
|
-
* @param node The Prosemirror node to search in
|
|
6
|
-
* @param predicate The predicate to match
|
|
7
|
-
* @returns An array of nodes with their positions
|
|
8
|
-
*/
|
|
9
|
-
export declare function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
-
import { NodeWithPos, Predicate, Range } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Same as `findChildren` but searches only within a `range`.
|
|
5
|
-
* @param node The Prosemirror node to search in
|
|
6
|
-
* @param range The range to search in
|
|
7
|
-
* @param predicate The predicate to match
|
|
8
|
-
* @returns An array of nodes with their positions
|
|
9
|
-
*/
|
|
10
|
-
export declare function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Selection } from '@tiptap/pm/state';
|
|
2
|
-
import { Predicate } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Finds the closest parent node to the current selection that matches a predicate.
|
|
5
|
-
* @param predicate The predicate to match
|
|
6
|
-
* @returns A command that finds the closest parent node to the current selection that matches the predicate
|
|
7
|
-
* @example ```js
|
|
8
|
-
* findParentNode(node => node.type.name === 'paragraph')
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export declare function findParentNode(predicate: Predicate): (selection: Selection) => {
|
|
12
|
-
pos: number;
|
|
13
|
-
start: number;
|
|
14
|
-
depth: number;
|
|
15
|
-
node: import("prosemirror-model").Node;
|
|
16
|
-
} | undefined;
|