@tiptap/extension-task-item 2.6.2 → 3.0.0-next.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.
Files changed (171) hide show
  1. package/dist/index.cjs +182 -164
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/{packages/extension-task-item/src/task-item.d.ts → index.d.cts} +9 -6
  4. package/dist/index.d.ts +41 -0
  5. package/dist/index.js +160 -160
  6. package/dist/index.js.map +1 -1
  7. package/package.json +8 -10
  8. package/dist/index.umd.js +0 -174
  9. package/dist/index.umd.js.map +0 -1
  10. package/dist/packages/core/src/CommandManager.d.ts +0 -20
  11. package/dist/packages/core/src/Editor.d.ts +0 -163
  12. package/dist/packages/core/src/EventEmitter.d.ts +0 -11
  13. package/dist/packages/core/src/Extension.d.ts +0 -344
  14. package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
  15. package/dist/packages/core/src/InputRule.d.ts +0 -42
  16. package/dist/packages/core/src/Mark.d.ts +0 -452
  17. package/dist/packages/core/src/Node.d.ts +0 -612
  18. package/dist/packages/core/src/NodePos.d.ts +0 -44
  19. package/dist/packages/core/src/NodeView.d.ts +0 -31
  20. package/dist/packages/core/src/PasteRule.d.ts +0 -50
  21. package/dist/packages/core/src/Tracker.d.ts +0 -11
  22. package/dist/packages/core/src/commands/blur.d.ts +0 -13
  23. package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
  24. package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
  25. package/dist/packages/core/src/commands/command.d.ts +0 -18
  26. package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
  27. package/dist/packages/core/src/commands/cut.d.ts +0 -20
  28. package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
  29. package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
  30. package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
  31. package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
  32. package/dist/packages/core/src/commands/enter.d.ts +0 -13
  33. package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
  34. package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
  35. package/dist/packages/core/src/commands/first.d.ts +0 -14
  36. package/dist/packages/core/src/commands/focus.d.ts +0 -27
  37. package/dist/packages/core/src/commands/forEach.d.ts +0 -14
  38. package/dist/packages/core/src/commands/index.d.ts +0 -55
  39. package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
  40. package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
  41. package/dist/packages/core/src/commands/join.d.ts +0 -41
  42. package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
  43. package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
  44. package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
  45. package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
  46. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
  47. package/dist/packages/core/src/commands/lift.d.ts +0 -17
  48. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
  49. package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
  50. package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
  51. package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
  52. package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
  53. package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
  54. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
  55. package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
  56. package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
  57. package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
  58. package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
  59. package/dist/packages/core/src/commands/setContent.d.ts +0 -40
  60. package/dist/packages/core/src/commands/setMark.d.ts +0 -15
  61. package/dist/packages/core/src/commands/setMeta.d.ts +0 -16
  62. package/dist/packages/core/src/commands/setNode.d.ts +0 -16
  63. package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
  64. package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
  65. package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
  66. package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
  67. package/dist/packages/core/src/commands/splitListItem.d.ts +0 -16
  68. package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
  69. package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
  70. package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
  71. package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
  72. package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
  73. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
  74. package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
  75. package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
  76. package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
  77. package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
  78. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
  79. package/dist/packages/core/src/extensions/commands.d.ts +0 -3
  80. package/dist/packages/core/src/extensions/editable.d.ts +0 -2
  81. package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
  82. package/dist/packages/core/src/extensions/index.d.ts +0 -6
  83. package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
  84. package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
  85. package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
  86. package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
  87. package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
  88. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
  89. package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
  90. package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
  91. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
  92. package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
  93. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
  94. package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
  95. package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
  96. package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
  97. package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
  98. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
  99. package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
  100. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
  101. package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
  102. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
  103. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
  104. package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
  105. package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
  106. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
  107. package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
  108. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
  109. package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
  110. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
  111. package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
  112. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
  113. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
  114. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
  115. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
  116. package/dist/packages/core/src/helpers/getText.d.ts +0 -15
  117. package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
  118. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
  119. package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
  120. package/dist/packages/core/src/helpers/index.d.ts +0 -50
  121. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
  122. package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
  123. package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
  124. package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
  125. package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
  126. package/dist/packages/core/src/helpers/isList.d.ts +0 -2
  127. package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
  128. package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
  129. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -14
  130. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
  131. package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
  132. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
  133. package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
  134. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
  135. package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
  136. package/dist/packages/core/src/index.d.ts +0 -24
  137. package/dist/packages/core/src/inputRules/index.d.ts +0 -5
  138. package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
  139. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
  140. package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
  141. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
  142. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
  143. package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
  144. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
  145. package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -14
  146. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
  147. package/dist/packages/core/src/style.d.ts +0 -1
  148. package/dist/packages/core/src/types.d.ts +0 -253
  149. package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
  150. package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
  151. package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
  152. package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
  153. package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
  154. package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
  155. package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
  156. package/dist/packages/core/src/utilities/index.d.ts +0 -20
  157. package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
  158. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
  159. package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
  160. package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
  161. package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
  162. package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
  163. package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
  164. package/dist/packages/core/src/utilities/isString.d.ts +0 -1
  165. package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
  166. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
  167. package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
  168. package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
  169. package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
  170. package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
  171. package/dist/packages/extension-task-item/src/index.d.ts +0 -3
@@ -1,50 +0,0 @@
1
- import { EditorState, Plugin } from '@tiptap/pm/state';
2
- import { Editor } from './Editor.js';
3
- import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types.js';
4
- export type PasteRuleMatch = {
5
- index: number;
6
- text: string;
7
- replaceWith?: string;
8
- match?: RegExpMatchArray;
9
- data?: Record<string, any>;
10
- };
11
- export type PasteRuleFinder = RegExp | ((text: string, event?: ClipboardEvent | null) => PasteRuleMatch[] | null | undefined);
12
- /**
13
- * Paste rules are used to react to pasted content.
14
- * @see https://tiptap.dev/guide/custom-extensions/#paste-rules
15
- */
16
- export declare class PasteRule {
17
- find: PasteRuleFinder;
18
- handler: (props: {
19
- state: EditorState;
20
- range: Range;
21
- match: ExtendedRegExpMatchArray;
22
- commands: SingleCommands;
23
- chain: () => ChainedCommands;
24
- can: () => CanCommands;
25
- pasteEvent: ClipboardEvent | null;
26
- dropEvent: DragEvent | null;
27
- }) => void | null;
28
- constructor(config: {
29
- find: PasteRuleFinder;
30
- handler: (props: {
31
- can: () => CanCommands;
32
- chain: () => ChainedCommands;
33
- commands: SingleCommands;
34
- dropEvent: DragEvent | null;
35
- match: ExtendedRegExpMatchArray;
36
- pasteEvent: ClipboardEvent | null;
37
- range: Range;
38
- state: EditorState;
39
- }) => void | null;
40
- });
41
- }
42
- /**
43
- * Create an paste rules plugin. When enabled, it will cause pasted
44
- * text that matches any of the given rules to trigger the rule’s
45
- * action.
46
- */
47
- export declare function pasteRulesPlugin(props: {
48
- editor: Editor;
49
- rules: PasteRule[];
50
- }): Plugin[];
@@ -1,11 +0,0 @@
1
- import { Transaction } from '@tiptap/pm/state';
2
- export interface TrackerResult {
3
- position: number;
4
- deleted: boolean;
5
- }
6
- export declare class Tracker {
7
- transaction: Transaction;
8
- currentStep: number;
9
- constructor(transaction: Transaction);
10
- map(position: number): TrackerResult;
11
- }
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- blur: {
5
- /**
6
- * Removes focus from the editor.
7
- * @example editor.commands.blur()
8
- */
9
- blur: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const blur: RawCommands['blur'];
@@ -1,14 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- clearContent: {
5
- /**
6
- * Clear the whole document.
7
- * @param emitUpdate Whether to emit an update event.
8
- * @example editor.commands.clearContent()
9
- */
10
- clearContent: (emitUpdate?: boolean) => ReturnType;
11
- };
12
- }
13
- }
14
- export declare const clearContent: RawCommands['clearContent'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- clearNodes: {
5
- /**
6
- * Normalize nodes to a simple paragraph.
7
- * @example editor.commands.clearNodes()
8
- */
9
- clearNodes: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const clearNodes: RawCommands['clearNodes'];
@@ -1,18 +0,0 @@
1
- import { Command, RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- command: {
5
- /**
6
- * Define a command inline.
7
- * @param fn The command function.
8
- * @example
9
- * editor.commands.command(({ tr, state }) => {
10
- * ...
11
- * return true
12
- * })
13
- */
14
- command: (fn: (props: Parameters<Command>[0]) => boolean) => ReturnType;
15
- };
16
- }
17
- }
18
- export declare const command: RawCommands['command'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- createParagraphNear: {
5
- /**
6
- * Create a paragraph nearby.
7
- * @example editor.commands.createParagraphNear()
8
- */
9
- createParagraphNear: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const createParagraphNear: RawCommands['createParagraphNear'];
@@ -1,20 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- cut: {
5
- /**
6
- * Cuts content from a range and inserts it at a given position.
7
- * @param range The range to cut.
8
- * @param range.from The start position of the range.
9
- * @param range.to The end position of the range.
10
- * @param targetPos The position to insert the content at.
11
- * @example editor.commands.cut({ from: 1, to: 3 }, 5)
12
- */
13
- cut: ({ from, to }: {
14
- from: number;
15
- to: number;
16
- }, targetPos: number) => ReturnType;
17
- };
18
- }
19
- }
20
- export declare const cut: RawCommands['cut'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- deleteCurrentNode: {
5
- /**
6
- * Delete the node that currently has the selection anchor.
7
- * @example editor.commands.deleteCurrentNode()
8
- */
9
- deleteCurrentNode: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const deleteCurrentNode: RawCommands['deleteCurrentNode'];
@@ -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
- deleteNode: {
6
- /**
7
- * Delete a node with a given type or name.
8
- * @param typeOrName The type or name of the node.
9
- * @example editor.commands.deleteNode('paragraph')
10
- */
11
- deleteNode: (typeOrName: string | NodeType) => ReturnType;
12
- };
13
- }
14
- }
15
- export declare const deleteNode: RawCommands['deleteNode'];
@@ -1,14 +0,0 @@
1
- import { Range, RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- deleteRange: {
5
- /**
6
- * Delete a given range.
7
- * @param range The range to delete.
8
- * @example editor.commands.deleteRange({ from: 1, to: 3 })
9
- */
10
- deleteRange: (range: Range) => ReturnType;
11
- };
12
- }
13
- }
14
- export declare const deleteRange: RawCommands['deleteRange'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- deleteSelection: {
5
- /**
6
- * Delete the selection, if there is one.
7
- * @example editor.commands.deleteSelection()
8
- */
9
- deleteSelection: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const deleteSelection: RawCommands['deleteSelection'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- enter: {
5
- /**
6
- * Trigger enter.
7
- * @example editor.commands.enter()
8
- */
9
- enter: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const enter: RawCommands['enter'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- exitCode: {
5
- /**
6
- * Exit from a code block.
7
- * @example editor.commands.exitCode()
8
- */
9
- exitCode: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const exitCode: RawCommands['exitCode'];
@@ -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
- extendMarkRange: {
6
- /**
7
- * Extends the text selection to the current mark by type or name.
8
- * @param typeOrName The type or name of the mark.
9
- * @param attributes The attributes of the mark.
10
- * @example editor.commands.extendMarkRange('bold')
11
- * @example editor.commands.extendMarkRange('mention', { userId: "1" })
12
- */
13
- extendMarkRange: (
14
- /**
15
- * The type or name of the mark.
16
- */
17
- typeOrName: string | MarkType,
18
- /**
19
- * The attributes of the mark.
20
- */
21
- attributes?: Record<string, any>) => ReturnType;
22
- };
23
- }
24
- }
25
- export declare const extendMarkRange: RawCommands['extendMarkRange'];
@@ -1,14 +0,0 @@
1
- import { Command, CommandProps, RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- first: {
5
- /**
6
- * Runs one command after the other and stops at the first which returns true.
7
- * @param commands The commands to run.
8
- * @example editor.commands.first([command1, command2])
9
- */
10
- first: (commands: Command[] | ((props: CommandProps) => Command[])) => ReturnType;
11
- };
12
- }
13
- }
14
- export declare const first: RawCommands['first'];
@@ -1,27 +0,0 @@
1
- import { FocusPosition, RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- focus: {
5
- /**
6
- * Focus the editor at the given position.
7
- * @param position The position to focus at.
8
- * @param options.scrollIntoView Scroll the focused position into view after focusing
9
- * @example editor.commands.focus()
10
- * @example editor.commands.focus(32, { scrollIntoView: false })
11
- */
12
- focus: (
13
- /**
14
- * The position to focus at.
15
- */
16
- position?: FocusPosition,
17
- /**
18
- * Optional options
19
- * @default { scrollIntoView: true }
20
- */
21
- options?: {
22
- scrollIntoView?: boolean;
23
- }) => ReturnType;
24
- };
25
- }
26
- }
27
- export declare const focus: RawCommands['focus'];
@@ -1,14 +0,0 @@
1
- import { CommandProps, RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- forEach: {
5
- /**
6
- * Loop through an array of items.
7
- */
8
- forEach: <T>(items: T[], fn: (item: T, props: CommandProps & {
9
- index: number;
10
- }) => boolean) => ReturnType;
11
- };
12
- }
13
- }
14
- export declare const forEach: RawCommands['forEach'];
@@ -1,55 +0,0 @@
1
- export * from './blur.js';
2
- export * from './clearContent.js';
3
- export * from './clearNodes.js';
4
- export * from './command.js';
5
- export * from './createParagraphNear.js';
6
- export * from './cut.js';
7
- export * from './deleteCurrentNode.js';
8
- export * from './deleteNode.js';
9
- export * from './deleteRange.js';
10
- export * from './deleteSelection.js';
11
- export * from './enter.js';
12
- export * from './exitCode.js';
13
- export * from './extendMarkRange.js';
14
- export * from './first.js';
15
- export * from './focus.js';
16
- export * from './forEach.js';
17
- export * from './insertContent.js';
18
- export * from './insertContentAt.js';
19
- export * from './join.js';
20
- export * from './joinItemBackward.js';
21
- export * from './joinItemForward.js';
22
- export * from './joinTextblockBackward.js';
23
- export * from './joinTextblockForward.js';
24
- export * from './keyboardShortcut.js';
25
- export * from './lift.js';
26
- export * from './liftEmptyBlock.js';
27
- export * from './liftListItem.js';
28
- export * from './newlineInCode.js';
29
- export * from './resetAttributes.js';
30
- export * from './scrollIntoView.js';
31
- export * from './selectAll.js';
32
- export * from './selectNodeBackward.js';
33
- export * from './selectNodeForward.js';
34
- export * from './selectParentNode.js';
35
- export * from './selectTextblockEnd.js';
36
- export * from './selectTextblockStart.js';
37
- export * from './setContent.js';
38
- export * from './setMark.js';
39
- export * from './setMeta.js';
40
- export * from './setNode.js';
41
- export * from './setNodeSelection.js';
42
- export * from './setTextSelection.js';
43
- export * from './sinkListItem.js';
44
- export * from './splitBlock.js';
45
- export * from './splitListItem.js';
46
- export * from './toggleList.js';
47
- export * from './toggleMark.js';
48
- export * from './toggleNode.js';
49
- export * from './toggleWrap.js';
50
- export * from './undoInputRule.js';
51
- export * from './unsetAllMarks.js';
52
- export * from './unsetMark.js';
53
- export * from './updateAttributes.js';
54
- export * from './wrapIn.js';
55
- export * from './wrapInList.js';
@@ -1,34 +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
- insertContent: {
6
- /**
7
- * Insert a node or string of HTML at the current position.
8
- * @example editor.commands.insertContent('<h1>Example</h1>')
9
- * @example editor.commands.insertContent('<h1>Example</h1>', { updateSelection: false })
10
- */
11
- insertContent: (
12
- /**
13
- * The ProseMirror content to insert.
14
- */
15
- value: Content,
16
- /**
17
- * Optional options
18
- */
19
- options?: {
20
- /**
21
- * Options for parsing the content.
22
- */
23
- parseOptions?: ParseOptions;
24
- /**
25
- * Whether to update the selection after inserting the content.
26
- */
27
- updateSelection?: boolean;
28
- applyInputRules?: boolean;
29
- applyPasteRules?: boolean;
30
- }) => ReturnType;
31
- };
32
- }
33
- }
34
- export declare const insertContent: RawCommands['insertContent'];
@@ -1,47 +0,0 @@
1
- import { ParseOptions } from '@tiptap/pm/model';
2
- import { Content, Range, RawCommands } from '../types.js';
3
- declare module '@tiptap/core' {
4
- interface Commands<ReturnType> {
5
- insertContentAt: {
6
- /**
7
- * Insert a node or string of HTML at a specific position.
8
- * @example editor.commands.insertContentAt(0, '<h1>Example</h1>')
9
- */
10
- insertContentAt: (
11
- /**
12
- * The position to insert the content at.
13
- */
14
- position: number | Range,
15
- /**
16
- * The ProseMirror content to insert.
17
- */
18
- value: Content,
19
- /**
20
- * Optional options
21
- */
22
- options?: {
23
- /**
24
- * Options for parsing the content.
25
- */
26
- parseOptions?: ParseOptions;
27
- /**
28
- * Whether to update the selection after inserting the content.
29
- */
30
- updateSelection?: boolean;
31
- /**
32
- * Whether to apply input rules after inserting the content.
33
- */
34
- applyInputRules?: boolean;
35
- /**
36
- * Whether to apply paste rules after inserting the content.
37
- */
38
- applyPasteRules?: boolean;
39
- /**
40
- * Whether to throw an error if the content is invalid.
41
- */
42
- errorOnInvalidContent?: boolean;
43
- }) => ReturnType;
44
- };
45
- }
46
- }
47
- export declare const insertContentAt: RawCommands['insertContentAt'];
@@ -1,41 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- joinUp: {
5
- /**
6
- * Join the selected block or, if there is a text selection, the closest ancestor block of the selection that can be joined, with the sibling above it.
7
- * @example editor.commands.joinUp()
8
- */
9
- joinUp: () => ReturnType;
10
- };
11
- joinDown: {
12
- /**
13
- * Join the selected block, or the closest ancestor of the selection that can be joined, with the sibling after it.
14
- * @example editor.commands.joinDown()
15
- */
16
- joinDown: () => ReturnType;
17
- };
18
- joinBackward: {
19
- /**
20
- * If the selection is empty and at the start of a textblock, try to reduce the distance between that block and the one before it—if there's a block directly before it that can be joined, join them.
21
- * If not, try to move the selected block closer to the next one in the document structure by lifting it out of its
22
- * parent or moving it into a parent of the previous block. Will use the view for accurate (bidi-aware) start-of-textblock detection if given.
23
- * @example editor.commands.joinBackward()
24
- */
25
- joinBackward: () => ReturnType;
26
- };
27
- joinForward: {
28
- /**
29
- * If the selection is empty and the cursor is at the end of a textblock, try to reduce or remove the boundary between that block and the one after it,
30
- * either by joining them or by moving the other block closer to this one in the tree structure.
31
- * Will use the view for accurate start-of-textblock detection if given.
32
- * @example editor.commands.joinForward()
33
- */
34
- joinForward: () => ReturnType;
35
- };
36
- }
37
- }
38
- export declare const joinUp: RawCommands['joinUp'];
39
- export declare const joinDown: RawCommands['joinDown'];
40
- export declare const joinBackward: RawCommands['joinBackward'];
41
- export declare const joinForward: RawCommands['joinForward'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- joinItemBackward: {
5
- /**
6
- * Join two items backward.
7
- * @example editor.commands.joinItemBackward()
8
- */
9
- joinItemBackward: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const joinItemBackward: RawCommands['joinItemBackward'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- joinItemForward: {
5
- /**
6
- * Join two items Forwards.
7
- * @example editor.commands.joinItemForward()
8
- */
9
- joinItemForward: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const joinItemForward: RawCommands['joinItemForward'];
@@ -1,12 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- joinTextblockBackward: {
5
- /**
6
- * A more limited form of joinBackward that only tries to join the current textblock to the one before it, if the cursor is at the start of a textblock.
7
- */
8
- joinTextblockBackward: () => ReturnType;
9
- };
10
- }
11
- }
12
- export declare const joinTextblockBackward: RawCommands['joinTextblockBackward'];
@@ -1,12 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- joinTextblockForward: {
5
- /**
6
- * A more limited form of joinForward that only tries to join the current textblock to the one after it, if the cursor is at the end of a textblock.
7
- */
8
- joinTextblockForward: () => ReturnType;
9
- };
10
- }
11
- }
12
- export declare const joinTextblockForward: RawCommands['joinTextblockForward'];
@@ -1,14 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- keyboardShortcut: {
5
- /**
6
- * Trigger a keyboard shortcut.
7
- * @param name The name of the keyboard shortcut.
8
- * @example editor.commands.keyboardShortcut('Mod-b')
9
- */
10
- keyboardShortcut: (name: string) => ReturnType;
11
- };
12
- }
13
- }
14
- export declare const keyboardShortcut: RawCommands['keyboardShortcut'];
@@ -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
- lift: {
6
- /**
7
- * Removes an existing wrap if possible lifting the node out of it
8
- * @param typeOrName The type or name of the node.
9
- * @param attributes The attributes of the node.
10
- * @example editor.commands.lift('paragraph')
11
- * @example editor.commands.lift('heading', { level: 1 })
12
- */
13
- lift: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
14
- };
15
- }
16
- }
17
- export declare const lift: RawCommands['lift'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- liftEmptyBlock: {
5
- /**
6
- * If the cursor is in an empty textblock that can be lifted, lift the block.
7
- * @example editor.commands.liftEmptyBlock()
8
- */
9
- liftEmptyBlock: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const liftEmptyBlock: RawCommands['liftEmptyBlock'];
@@ -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
- liftListItem: {
6
- /**
7
- * Create a command to lift the list item around the selection up into a wrapping list.
8
- * @param typeOrName The type or name of the node.
9
- * @example editor.commands.liftListItem('listItem')
10
- */
11
- liftListItem: (typeOrName: string | NodeType) => ReturnType;
12
- };
13
- }
14
- }
15
- export declare const liftListItem: RawCommands['liftListItem'];
@@ -1,13 +0,0 @@
1
- import { RawCommands } from '../types.js';
2
- declare module '@tiptap/core' {
3
- interface Commands<ReturnType> {
4
- newlineInCode: {
5
- /**
6
- * Add a newline character in code.
7
- * @example editor.commands.newlineInCode()
8
- */
9
- newlineInCode: () => ReturnType;
10
- };
11
- }
12
- }
13
- export declare const newlineInCode: RawCommands['newlineInCode'];