@tiptap/core 2.5.0-beta.2 → 2.5.0-beta.3

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 (179) hide show
  1. package/dist/index.cjs +4534 -4538
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +4534 -4536
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.umd.js +4534 -4538
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/packages/core/src/CommandManager.d.ts +20 -20
  8. package/dist/packages/core/src/Editor.d.ts +161 -161
  9. package/dist/packages/core/src/EventEmitter.d.ts +11 -11
  10. package/dist/packages/core/src/Extension.d.ts +343 -342
  11. package/dist/packages/core/src/ExtensionManager.d.ts +55 -55
  12. package/dist/packages/core/src/InputRule.d.ts +42 -42
  13. package/dist/packages/core/src/Mark.d.ts +451 -450
  14. package/dist/packages/core/src/Node.d.ts +611 -609
  15. package/dist/packages/core/src/NodePos.d.ts +44 -44
  16. package/dist/packages/core/src/NodeView.d.ts +31 -31
  17. package/dist/packages/core/src/PasteRule.d.ts +50 -50
  18. package/dist/packages/core/src/Tracker.d.ts +11 -11
  19. package/dist/packages/core/src/commands/blur.d.ts +13 -13
  20. package/dist/packages/core/src/commands/clearContent.d.ts +14 -14
  21. package/dist/packages/core/src/commands/clearNodes.d.ts +13 -13
  22. package/dist/packages/core/src/commands/command.d.ts +18 -18
  23. package/dist/packages/core/src/commands/createParagraphNear.d.ts +13 -13
  24. package/dist/packages/core/src/commands/cut.d.ts +20 -20
  25. package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +13 -13
  26. package/dist/packages/core/src/commands/deleteNode.d.ts +15 -15
  27. package/dist/packages/core/src/commands/deleteRange.d.ts +14 -14
  28. package/dist/packages/core/src/commands/deleteSelection.d.ts +13 -13
  29. package/dist/packages/core/src/commands/enter.d.ts +13 -13
  30. package/dist/packages/core/src/commands/exitCode.d.ts +13 -13
  31. package/dist/packages/core/src/commands/extendMarkRange.d.ts +25 -25
  32. package/dist/packages/core/src/commands/first.d.ts +14 -14
  33. package/dist/packages/core/src/commands/focus.d.ts +27 -27
  34. package/dist/packages/core/src/commands/forEach.d.ts +14 -14
  35. package/dist/packages/core/src/commands/index.d.ts +55 -55
  36. package/dist/packages/core/src/commands/insertContent.d.ts +34 -34
  37. package/dist/packages/core/src/commands/insertContentAt.d.ts +47 -47
  38. package/dist/packages/core/src/commands/join.d.ts +41 -41
  39. package/dist/packages/core/src/commands/joinItemBackward.d.ts +13 -13
  40. package/dist/packages/core/src/commands/joinItemForward.d.ts +13 -13
  41. package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +12 -12
  42. package/dist/packages/core/src/commands/joinTextblockForward.d.ts +12 -12
  43. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +14 -14
  44. package/dist/packages/core/src/commands/lift.d.ts +17 -17
  45. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +13 -13
  46. package/dist/packages/core/src/commands/liftListItem.d.ts +15 -15
  47. package/dist/packages/core/src/commands/newlineInCode.d.ts +13 -13
  48. package/dist/packages/core/src/commands/resetAttributes.d.ts +16 -16
  49. package/dist/packages/core/src/commands/scrollIntoView.d.ts +13 -13
  50. package/dist/packages/core/src/commands/selectAll.d.ts +13 -13
  51. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +13 -13
  52. package/dist/packages/core/src/commands/selectNodeForward.d.ts +13 -13
  53. package/dist/packages/core/src/commands/selectParentNode.d.ts +13 -13
  54. package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +13 -13
  55. package/dist/packages/core/src/commands/selectTextblockStart.d.ts +13 -13
  56. package/dist/packages/core/src/commands/setContent.d.ts +40 -40
  57. package/dist/packages/core/src/commands/setMark.d.ts +15 -15
  58. package/dist/packages/core/src/commands/setMeta.d.ts +15 -15
  59. package/dist/packages/core/src/commands/setNode.d.ts +16 -16
  60. package/dist/packages/core/src/commands/setNodeSelection.d.ts +14 -14
  61. package/dist/packages/core/src/commands/setTextSelection.d.ts +14 -14
  62. package/dist/packages/core/src/commands/sinkListItem.d.ts +15 -15
  63. package/dist/packages/core/src/commands/splitBlock.d.ts +17 -17
  64. package/dist/packages/core/src/commands/splitListItem.d.ts +15 -15
  65. package/dist/packages/core/src/commands/toggleList.d.ts +18 -18
  66. package/dist/packages/core/src/commands/toggleMark.d.ts +30 -30
  67. package/dist/packages/core/src/commands/toggleNode.d.ts +17 -17
  68. package/dist/packages/core/src/commands/toggleWrap.d.ts +16 -16
  69. package/dist/packages/core/src/commands/undoInputRule.d.ts +13 -13
  70. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +13 -13
  71. package/dist/packages/core/src/commands/unsetMark.d.ts +25 -25
  72. package/dist/packages/core/src/commands/updateAttributes.d.ts +24 -24
  73. package/dist/packages/core/src/commands/wrapIn.d.ts +16 -16
  74. package/dist/packages/core/src/commands/wrapInList.d.ts +16 -16
  75. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +5 -5
  76. package/dist/packages/core/src/extensions/commands.d.ts +3 -3
  77. package/dist/packages/core/src/extensions/editable.d.ts +2 -2
  78. package/dist/packages/core/src/extensions/focusEvents.d.ts +2 -2
  79. package/dist/packages/core/src/extensions/index.d.ts +6 -6
  80. package/dist/packages/core/src/extensions/keymap.d.ts +2 -2
  81. package/dist/packages/core/src/extensions/tabindex.d.ts +2 -2
  82. package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +10 -10
  83. package/dist/packages/core/src/helpers/createChainableState.d.ts +10 -10
  84. package/dist/packages/core/src/helpers/createDocument.d.ts +12 -12
  85. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +15 -15
  86. package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +7 -7
  87. package/dist/packages/core/src/helpers/findChildren.d.ts +9 -9
  88. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +10 -10
  89. package/dist/packages/core/src/helpers/findParentNode.d.ts +16 -16
  90. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +17 -17
  91. package/dist/packages/core/src/helpers/generateHTML.d.ts +8 -8
  92. package/dist/packages/core/src/helpers/generateJSON.d.ts +8 -8
  93. package/dist/packages/core/src/helpers/generateText.d.ts +12 -12
  94. package/dist/packages/core/src/helpers/getAttributes.d.ts +9 -9
  95. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +6 -6
  96. package/dist/packages/core/src/helpers/getChangedRanges.d.ts +11 -11
  97. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +8 -8
  98. package/dist/packages/core/src/helpers/getExtensionField.d.ts +9 -9
  99. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +2 -2
  100. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +3 -3
  101. package/dist/packages/core/src/helpers/getMarkRange.d.ts +3 -3
  102. package/dist/packages/core/src/helpers/getMarkType.d.ts +2 -2
  103. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +3 -3
  104. package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +11 -11
  105. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +3 -3
  106. package/dist/packages/core/src/helpers/getNodeType.d.ts +2 -2
  107. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +3 -3
  108. package/dist/packages/core/src/helpers/getSchema.d.ts +4 -4
  109. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +10 -10
  110. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +8 -8
  111. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +8 -8
  112. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +9 -9
  113. package/dist/packages/core/src/helpers/getText.d.ts +15 -15
  114. package/dist/packages/core/src/helpers/getTextBetween.d.ts +14 -14
  115. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +8 -8
  116. package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +8 -8
  117. package/dist/packages/core/src/helpers/index.d.ts +50 -50
  118. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +9 -9
  119. package/dist/packages/core/src/helpers/isActive.d.ts +2 -2
  120. package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +2 -2
  121. package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +2 -2
  122. package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +2 -2
  123. package/dist/packages/core/src/helpers/isList.d.ts +2 -2
  124. package/dist/packages/core/src/helpers/isMarkActive.d.ts +3 -3
  125. package/dist/packages/core/src/helpers/isNodeActive.d.ts +3 -3
  126. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +2 -2
  127. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +2 -2
  128. package/dist/packages/core/src/helpers/isTextSelection.d.ts +2 -2
  129. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +2 -2
  130. package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +4 -4
  131. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +2 -2
  132. package/dist/packages/core/src/helpers/splitExtensions.d.ts +9 -9
  133. package/dist/packages/core/src/index.d.ts +24 -24
  134. package/dist/packages/core/src/inputRules/index.d.ts +5 -5
  135. package/dist/packages/core/src/inputRules/markInputRule.d.ts +13 -13
  136. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +23 -23
  137. package/dist/packages/core/src/inputRules/textInputRule.d.ts +10 -10
  138. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +15 -15
  139. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +28 -28
  140. package/dist/packages/core/src/pasteRules/index.d.ts +3 -3
  141. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +13 -13
  142. package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +13 -13
  143. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +10 -10
  144. package/dist/packages/core/src/style.d.ts +1 -1
  145. package/dist/packages/core/src/types.d.ts +250 -244
  146. package/dist/packages/core/src/utilities/callOrReturn.d.ts +9 -9
  147. package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -1
  148. package/dist/packages/core/src/utilities/deleteProps.d.ts +6 -6
  149. package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -1
  150. package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +1 -1
  151. package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -1
  152. package/dist/packages/core/src/utilities/fromString.d.ts +1 -1
  153. package/dist/packages/core/src/utilities/index.d.ts +20 -20
  154. package/dist/packages/core/src/utilities/isAndroid.d.ts +1 -1
  155. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -1
  156. package/dist/packages/core/src/utilities/isFunction.d.ts +1 -1
  157. package/dist/packages/core/src/utilities/isMacOS.d.ts +1 -1
  158. package/dist/packages/core/src/utilities/isNumber.d.ts +1 -1
  159. package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -1
  160. package/dist/packages/core/src/utilities/isRegExp.d.ts +1 -1
  161. package/dist/packages/core/src/utilities/isString.d.ts +1 -1
  162. package/dist/packages/core/src/utilities/isiOS.d.ts +1 -1
  163. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -1
  164. package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -1
  165. package/dist/packages/core/src/utilities/minMax.d.ts +1 -1
  166. package/dist/packages/core/src/utilities/objectIncludes.d.ts +8 -8
  167. package/dist/packages/core/src/utilities/removeDuplicates.d.ts +8 -8
  168. package/package.json +2 -2
  169. package/src/Extension.ts +3 -1
  170. package/src/ExtensionManager.ts +1 -1
  171. package/src/Mark.ts +3 -1
  172. package/src/Node.ts +4 -1
  173. package/src/commands/insertContentAt.ts +1 -1
  174. package/src/helpers/getAttributesFromExtensions.ts +2 -3
  175. package/src/helpers/getSchemaByResolvedExtensions.ts +4 -2
  176. package/src/helpers/injectExtensionAttributesToParseRule.ts +4 -4
  177. package/src/helpers/isNodeEmpty.ts +6 -3
  178. package/src/types.ts +6 -0
  179. package/src/utilities/mergeDeep.ts +3 -7
@@ -1,15 +1,15 @@
1
- import { Fragment, Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model';
2
- import { Content } from '../types.js';
3
- export declare 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
+ 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 +1,7 @@
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
+ 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 +1,9 @@
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
+ 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 +1,10 @@
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
+ 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 +1,16 @@
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;
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;
@@ -1,17 +1,17 @@
1
- import { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model';
2
- import { Predicate } from '../types.js';
3
- /**
4
- * Finds the closest parent node to a resolved position that matches a predicate.
5
- * @param $pos The resolved position to search from
6
- * @param predicate The predicate to match
7
- * @returns The closest parent node to the resolved position that matches the predicate
8
- * @example ```js
9
- * findParentNodeClosestToPos($from, node => node.type.name === 'paragraph')
10
- * ```
11
- */
12
- export declare function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): {
13
- pos: number;
14
- start: number;
15
- depth: number;
16
- node: ProseMirrorNode;
17
- } | undefined;
1
+ import { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model';
2
+ import { Predicate } from '../types.js';
3
+ /**
4
+ * Finds the closest parent node to a resolved position that matches a predicate.
5
+ * @param $pos The resolved position to search from
6
+ * @param predicate The predicate to match
7
+ * @returns The closest parent node to the resolved position that matches the predicate
8
+ * @example ```js
9
+ * findParentNodeClosestToPos($from, node => node.type.name === 'paragraph')
10
+ * ```
11
+ */
12
+ export declare function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): {
13
+ pos: number;
14
+ start: number;
15
+ depth: number;
16
+ node: ProseMirrorNode;
17
+ } | undefined;
@@ -1,8 +1,8 @@
1
- import { Extensions, JSONContent } from '../types.js';
2
- /**
3
- * Generate HTML from a JSONContent
4
- * @param doc The JSONContent to generate HTML from
5
- * @param extensions The extensions to use for the schema
6
- * @returns The generated HTML
7
- */
8
- export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
1
+ import { Extensions, JSONContent } from '../types.js';
2
+ /**
3
+ * Generate HTML from a JSONContent
4
+ * @param doc The JSONContent to generate HTML from
5
+ * @param extensions The extensions to use for the schema
6
+ * @returns The generated HTML
7
+ */
8
+ export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
@@ -1,8 +1,8 @@
1
- import { Extensions } from '../types.js';
2
- /**
3
- * Generate JSONContent from HTML
4
- * @param html The HTML to generate JSONContent from
5
- * @param extensions The extensions to use for the schema
6
- * @returns The generated JSONContent
7
- */
8
- export declare function generateJSON(html: string, extensions: Extensions): Record<string, any>;
1
+ import { Extensions } from '../types.js';
2
+ /**
3
+ * Generate JSONContent from HTML
4
+ * @param html The HTML to generate JSONContent from
5
+ * @param extensions The extensions to use for the schema
6
+ * @returns The generated JSONContent
7
+ */
8
+ export declare function generateJSON(html: string, extensions: Extensions): Record<string, any>;
@@ -1,12 +1,12 @@
1
- import { Extensions, JSONContent, TextSerializer } from '../types.js';
2
- /**
3
- * Generate raw text from a JSONContent
4
- * @param doc The JSONContent to generate text from
5
- * @param extensions The extensions to use for the schema
6
- * @param options Options for the text generation f.e. blockSeparator or textSerializers
7
- * @returns The generated text
8
- */
9
- export declare function generateText(doc: JSONContent, extensions: Extensions, options?: {
10
- blockSeparator?: string;
11
- textSerializers?: Record<string, TextSerializer>;
12
- }): string;
1
+ import { Extensions, JSONContent, TextSerializer } from '../types.js';
2
+ /**
3
+ * Generate raw text from a JSONContent
4
+ * @param doc The JSONContent to generate text from
5
+ * @param extensions The extensions to use for the schema
6
+ * @param options Options for the text generation f.e. blockSeparator or textSerializers
7
+ * @returns The generated text
8
+ */
9
+ export declare function generateText(doc: JSONContent, extensions: Extensions, options?: {
10
+ blockSeparator?: string;
11
+ textSerializers?: Record<string, TextSerializer>;
12
+ }): string;
@@ -1,9 +1,9 @@
1
- import { MarkType, NodeType } from '@tiptap/pm/model';
2
- import { EditorState } from '@tiptap/pm/state';
3
- /**
4
- * Get node or mark attributes by type or name on the current editor state
5
- * @param state The current editor state
6
- * @param typeOrName The node or mark type or name
7
- * @returns The attributes of the node or mark or an empty object
8
- */
9
- export declare function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
1
+ import { MarkType, NodeType } from '@tiptap/pm/model';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ /**
4
+ * Get node or mark attributes by type or name on the current editor state
5
+ * @param state The current editor state
6
+ * @param typeOrName The node or mark type or name
7
+ * @returns The attributes of the node or mark or an empty object
8
+ */
9
+ export declare function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
@@ -1,6 +1,6 @@
1
- import { ExtensionAttribute, Extensions } from '../types.js';
2
- /**
3
- * Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`.
4
- * @param extensions List of extensions
5
- */
6
- export declare function getAttributesFromExtensions(extensions: Extensions): ExtensionAttribute[];
1
+ import { ExtensionAttribute, Extensions } from '../types.js';
2
+ /**
3
+ * Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`.
4
+ * @param extensions List of extensions
5
+ */
6
+ export declare function getAttributesFromExtensions(extensions: Extensions): ExtensionAttribute[];
@@ -1,11 +1,11 @@
1
- import { Transform } from '@tiptap/pm/transform';
2
- import { Range } from '../types.js';
3
- export declare type ChangedRange = {
4
- oldRange: Range;
5
- newRange: Range;
6
- };
7
- /**
8
- * Returns a list of changed ranges
9
- * based on the first and last state of all steps.
10
- */
11
- export declare function getChangedRanges(transform: Transform): ChangedRange[];
1
+ import { Transform } from '@tiptap/pm/transform';
2
+ import { Range } from '../types.js';
3
+ export type ChangedRange = {
4
+ oldRange: Range;
5
+ newRange: Range;
6
+ };
7
+ /**
8
+ * Returns a list of changed ranges
9
+ * based on the first and last state of all steps.
10
+ */
11
+ export declare function getChangedRanges(transform: Transform): ChangedRange[];
@@ -1,8 +1,8 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
- import { JSONContent } from '../types.js';
3
- interface DebugJSONContent extends JSONContent {
4
- from: number;
5
- to: number;
6
- }
7
- export declare function getDebugJSON(node: ProseMirrorNode, startOffset?: number): DebugJSONContent;
8
- export {};
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { JSONContent } from '../types.js';
3
+ interface DebugJSONContent extends JSONContent {
4
+ from: number;
5
+ to: number;
6
+ }
7
+ export declare function getDebugJSON(node: ProseMirrorNode, startOffset?: number): DebugJSONContent;
8
+ export {};
@@ -1,9 +1,9 @@
1
- import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types.js';
2
- /**
3
- * Returns a field from an extension
4
- * @param extension The Tiptap extension
5
- * @param field The field, for example `renderHTML` or `priority`
6
- * @param context The context object that should be passed as `this` into the function
7
- * @returns The field value
8
- */
9
- export declare function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
1
+ import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types.js';
2
+ /**
3
+ * Returns a field from an extension
4
+ * @param extension The Tiptap extension
5
+ * @param field The field, for example `renderHTML` or `priority`
6
+ * @param context The context object that should be passed as `this` into the function
7
+ * @returns The field value
8
+ */
9
+ export declare function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
@@ -1,2 +1,2 @@
1
- import { Fragment, Schema } from '@tiptap/pm/model';
2
- export declare function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
1
+ import { Fragment, Schema } from '@tiptap/pm/model';
2
+ export declare function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
@@ -1,3 +1,3 @@
1
- import { MarkType } from '@tiptap/pm/model';
2
- import { EditorState } from '@tiptap/pm/state';
3
- export declare function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): Record<string, any>;
1
+ import { MarkType } from '@tiptap/pm/model';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ export declare function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): Record<string, any>;
@@ -1,3 +1,3 @@
1
- import { MarkType, ResolvedPos } from '@tiptap/pm/model';
2
- import { Range } from '../types.js';
3
- export declare function getMarkRange($pos: ResolvedPos, type: MarkType, attributes?: Record<string, any>): Range | void;
1
+ import { MarkType, ResolvedPos } from '@tiptap/pm/model';
2
+ import { Range } from '../types.js';
3
+ export declare function getMarkRange($pos: ResolvedPos, type: MarkType, attributes?: Record<string, any>): Range | void;
@@ -1,2 +1,2 @@
1
- import { MarkType, Schema } from '@tiptap/pm/model';
2
- export declare function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType;
1
+ import { MarkType, Schema } from '@tiptap/pm/model';
2
+ export declare function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType;
@@ -1,3 +1,3 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
- import { MarkRange } from '../types.js';
3
- export declare function getMarksBetween(from: number, to: number, doc: ProseMirrorNode): MarkRange[];
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { MarkRange } from '../types.js';
3
+ export declare function getMarksBetween(from: number, to: number, doc: ProseMirrorNode): MarkRange[];
@@ -1,11 +1,11 @@
1
- import { Node, NodeType } from '@tiptap/pm/model';
2
- import { EditorState } from '@tiptap/pm/state';
3
- /**
4
- * Finds the first node of a given type or name in the current selection.
5
- * @param state The editor state.
6
- * @param typeOrName The node type or name.
7
- * @param pos The position to start searching from.
8
- * @param maxDepth The maximum depth to search.
9
- * @returns The node and the depth as an array.
10
- */
11
- export declare const getNodeAtPosition: (state: EditorState, typeOrName: string | NodeType, pos: number, maxDepth?: number) => [Node | null, number];
1
+ import { Node, NodeType } from '@tiptap/pm/model';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ /**
4
+ * Finds the first node of a given type or name in the current selection.
5
+ * @param state The editor state.
6
+ * @param typeOrName The node type or name.
7
+ * @param pos The position to start searching from.
8
+ * @param maxDepth The maximum depth to search.
9
+ * @returns The node and the depth as an array.
10
+ */
11
+ export declare const getNodeAtPosition: (state: EditorState, typeOrName: string | NodeType, pos: number, maxDepth?: number) => [Node | null, number];
@@ -1,3 +1,3 @@
1
- import { NodeType } from '@tiptap/pm/model';
2
- import { EditorState } from '@tiptap/pm/state';
3
- export declare function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): Record<string, any>;
1
+ import { NodeType } from '@tiptap/pm/model';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ export declare function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): Record<string, any>;
@@ -1,2 +1,2 @@
1
- import { NodeType, Schema } from '@tiptap/pm/model';
2
- export declare function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType;
1
+ import { NodeType, Schema } from '@tiptap/pm/model';
2
+ export declare function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType;
@@ -1,3 +1,3 @@
1
- import { Mark, Node } from '@tiptap/pm/model';
2
- import { ExtensionAttribute } from '../types.js';
3
- export declare function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
1
+ import { Mark, Node } from '@tiptap/pm/model';
2
+ import { ExtensionAttribute } from '../types.js';
3
+ export declare function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
@@ -1,4 +1,4 @@
1
- import { Schema } from '@tiptap/pm/model';
2
- import { Editor } from '../Editor.js';
3
- import { Extensions } from '../types.js';
4
- export declare function getSchema(extensions: Extensions, editor?: Editor): Schema;
1
+ import { Schema } from '@tiptap/pm/model';
2
+ import { Editor } from '../Editor.js';
3
+ import { Extensions } from '../types.js';
4
+ export declare function getSchema(extensions: Extensions, editor?: Editor): Schema;
@@ -1,10 +1,10 @@
1
- import { Schema } from '@tiptap/pm/model';
2
- import { Editor } from '../index.js';
3
- import { Extensions } from '../types.js';
4
- /**
5
- * Creates a new Prosemirror schema based on the given extensions.
6
- * @param extensions An array of Tiptap extensions
7
- * @param editor The editor instance
8
- * @returns A Prosemirror schema
9
- */
10
- export declare function getSchemaByResolvedExtensions(extensions: Extensions, editor?: Editor): Schema;
1
+ import { Schema } from '@tiptap/pm/model';
2
+ import { Editor } from '../index.js';
3
+ import { Extensions } from '../types.js';
4
+ /**
5
+ * Creates a new Prosemirror schema based on the given extensions.
6
+ * @param extensions An array of Tiptap extensions
7
+ * @param editor The editor instance
8
+ * @returns A Prosemirror schema
9
+ */
10
+ export declare function getSchemaByResolvedExtensions(extensions: Extensions, editor?: Editor): Schema;
@@ -1,8 +1,8 @@
1
- import { MarkType, NodeType, Schema } from '@tiptap/pm/model';
2
- /**
3
- * Tries to get a node or mark type by its name.
4
- * @param name The name of the node or mark type
5
- * @param schema The Prosemiror schema to search in
6
- * @returns The node or mark type, or null if it doesn't exist
7
- */
8
- export declare function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
1
+ import { MarkType, NodeType, Schema } from '@tiptap/pm/model';
2
+ /**
3
+ * Tries to get a node or mark type by its name.
4
+ * @param name The name of the node or mark type
5
+ * @param schema The Prosemiror schema to search in
6
+ * @returns The node or mark type, or null if it doesn't exist
7
+ */
8
+ export declare function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
@@ -1,8 +1,8 @@
1
- import { Schema } from '@tiptap/pm/model';
2
- /**
3
- * Get the type of a schema item by its name.
4
- * @param name The name of the schema item
5
- * @param schema The Prosemiror schema to search in
6
- * @returns The type of the schema item (`node` or `mark`), or null if it doesn't exist
7
- */
8
- export declare function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
1
+ import { Schema } from '@tiptap/pm/model';
2
+ /**
3
+ * Get the type of a schema item by its name.
4
+ * @param name The name of the schema item
5
+ * @param schema The Prosemiror schema to search in
6
+ * @returns The type of the schema item (`node` or `mark`), or null if it doesn't exist
7
+ */
8
+ export declare function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
@@ -1,9 +1,9 @@
1
- import { ExtensionAttribute } from '../types.js';
2
- /**
3
- * Return attributes of an extension that should be splitted by keepOnSplit flag
4
- * @param extensionAttributes Array of extension attributes
5
- * @param typeName The type of the extension
6
- * @param attributes The attributes of the extension
7
- * @returns The splitted attributes
8
- */
9
- export declare function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
1
+ import { ExtensionAttribute } from '../types.js';
2
+ /**
3
+ * Return attributes of an extension that should be splitted by keepOnSplit flag
4
+ * @param extensionAttributes Array of extension attributes
5
+ * @param typeName The type of the extension
6
+ * @param attributes The attributes of the extension
7
+ * @returns The splitted attributes
8
+ */
9
+ export declare function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
@@ -1,15 +1,15 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
- import { TextSerializer } from '../types.js';
3
- /**
4
- * Gets the text of a Prosemirror node
5
- * @param node The Prosemirror node
6
- * @param options Options for the text serializer & block separator
7
- * @returns The text of the node
8
- * @example ```js
9
- * const text = getText(node, { blockSeparator: '\n' })
10
- * ```
11
- */
12
- export declare function getText(node: ProseMirrorNode, options?: {
13
- blockSeparator?: string;
14
- textSerializers?: Record<string, TextSerializer>;
15
- }): string;
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { TextSerializer } from '../types.js';
3
+ /**
4
+ * Gets the text of a Prosemirror node
5
+ * @param node The Prosemirror node
6
+ * @param options Options for the text serializer & block separator
7
+ * @returns The text of the node
8
+ * @example ```js
9
+ * const text = getText(node, { blockSeparator: '\n' })
10
+ * ```
11
+ */
12
+ export declare function getText(node: ProseMirrorNode, options?: {
13
+ blockSeparator?: string;
14
+ textSerializers?: Record<string, TextSerializer>;
15
+ }): string;
@@ -1,14 +1,14 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
- import { Range, TextSerializer } from '../types.js';
3
- /**
4
- * Gets the text between two positions in a Prosemirror node
5
- * and serializes it using the given text serializers and block separator (see getText)
6
- * @param startNode The Prosemirror node to start from
7
- * @param range The range of the text to get
8
- * @param options Options for the text serializer & block separator
9
- * @returns The text between the two positions
10
- */
11
- export declare function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
12
- blockSeparator?: string;
13
- textSerializers?: Record<string, TextSerializer>;
14
- }): string;
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { Range, TextSerializer } from '../types.js';
3
+ /**
4
+ * Gets the text between two positions in a Prosemirror node
5
+ * and serializes it using the given text serializers and block separator (see getText)
6
+ * @param startNode The Prosemirror node to start from
7
+ * @param range The range of the text to get
8
+ * @param options Options for the text serializer & block separator
9
+ * @returns The text between the two positions
10
+ */
11
+ export declare function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
12
+ blockSeparator?: string;
13
+ textSerializers?: Record<string, TextSerializer>;
14
+ }): string;
@@ -1,8 +1,8 @@
1
- import { ResolvedPos } from '@tiptap/pm/model';
2
- /**
3
- * Returns the text content of a resolved prosemirror position
4
- * @param $from The resolved position to get the text content from
5
- * @param maxMatch The maximum number of characters to match
6
- * @returns The text content
7
- */
8
- export declare const getTextContentFromNodes: ($from: ResolvedPos, maxMatch?: number) => string;
1
+ import { ResolvedPos } from '@tiptap/pm/model';
2
+ /**
3
+ * Returns the text content of a resolved prosemirror position
4
+ * @param $from The resolved position to get the text content from
5
+ * @param maxMatch The maximum number of characters to match
6
+ * @returns The text content
7
+ */
8
+ export declare const getTextContentFromNodes: ($from: ResolvedPos, maxMatch?: number) => string;
@@ -1,8 +1,8 @@
1
- import { Schema } from '@tiptap/pm/model';
2
- import { TextSerializer } from '../types.js';
3
- /**
4
- * Find text serializers `toText` in a Prosemirror schema
5
- * @param schema The Prosemirror schema to search in
6
- * @returns A record of text serializers by node name
7
- */
8
- export declare function getTextSerializersFromSchema(schema: Schema): Record<string, TextSerializer>;
1
+ import { Schema } from '@tiptap/pm/model';
2
+ import { TextSerializer } from '../types.js';
3
+ /**
4
+ * Find text serializers `toText` in a Prosemirror schema
5
+ * @param schema The Prosemirror schema to search in
6
+ * @returns A record of text serializers by node name
7
+ */
8
+ export declare function getTextSerializersFromSchema(schema: Schema): Record<string, TextSerializer>;