@tiptap/core 2.0.0-beta.213 → 2.0.0-beta.215

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 (159) hide show
  1. package/dist/index.cjs +3931 -3960
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.js +3857 -3962
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.umd.js +4280 -0
  6. package/dist/index.umd.js.map +1 -0
  7. package/dist/packages/core/src/CommandManager.d.ts +20 -0
  8. package/dist/packages/core/src/Editor.d.ts +147 -0
  9. package/dist/packages/core/src/EventEmitter.d.ts +11 -0
  10. package/dist/packages/core/src/Extension.d.ts +227 -0
  11. package/dist/packages/core/src/ExtensionManager.d.ts +18 -0
  12. package/dist/packages/core/src/InputRule.d.ts +42 -0
  13. package/dist/packages/core/src/Mark.d.ts +327 -0
  14. package/dist/packages/core/src/Node.d.ts +397 -0
  15. package/dist/packages/core/src/NodeView.d.ts +27 -0
  16. package/dist/packages/core/src/PasteRule.d.ts +42 -0
  17. package/dist/packages/core/src/Tracker.d.ts +11 -0
  18. package/dist/packages/core/src/commands/blur.d.ts +12 -0
  19. package/dist/packages/core/src/commands/clearContent.d.ts +12 -0
  20. package/dist/packages/core/src/commands/clearNodes.d.ts +12 -0
  21. package/dist/packages/core/src/commands/command.d.ts +12 -0
  22. package/dist/packages/core/src/commands/createParagraphNear.d.ts +12 -0
  23. package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +12 -0
  24. package/dist/packages/core/src/commands/deleteNode.d.ts +13 -0
  25. package/dist/packages/core/src/commands/deleteRange.d.ts +12 -0
  26. package/dist/packages/core/src/commands/deleteSelection.d.ts +12 -0
  27. package/dist/packages/core/src/commands/enter.d.ts +12 -0
  28. package/dist/packages/core/src/commands/exitCode.d.ts +12 -0
  29. package/dist/packages/core/src/commands/extendMarkRange.d.ts +13 -0
  30. package/dist/packages/core/src/commands/first.d.ts +12 -0
  31. package/dist/packages/core/src/commands/focus.d.ts +14 -0
  32. package/dist/packages/core/src/commands/forEach.d.ts +14 -0
  33. package/dist/packages/core/src/commands/index.d.ts +50 -0
  34. package/dist/packages/core/src/commands/insertContent.d.ts +16 -0
  35. package/dist/packages/core/src/commands/insertContentAt.d.ts +16 -0
  36. package/dist/packages/core/src/commands/join.d.ts +33 -0
  37. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +12 -0
  38. package/dist/packages/core/src/commands/lift.d.ts +13 -0
  39. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +12 -0
  40. package/dist/packages/core/src/commands/liftListItem.d.ts +13 -0
  41. package/dist/packages/core/src/commands/newlineInCode.d.ts +12 -0
  42. package/dist/packages/core/src/commands/resetAttributes.d.ts +13 -0
  43. package/dist/packages/core/src/commands/scrollIntoView.d.ts +12 -0
  44. package/dist/packages/core/src/commands/selectAll.d.ts +12 -0
  45. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +12 -0
  46. package/dist/packages/core/src/commands/selectNodeForward.d.ts +12 -0
  47. package/dist/packages/core/src/commands/selectParentNode.d.ts +12 -0
  48. package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +12 -0
  49. package/dist/packages/core/src/commands/selectTextblockStart.d.ts +12 -0
  50. package/dist/packages/core/src/commands/setContent.d.ts +13 -0
  51. package/dist/packages/core/src/commands/setMark.d.ts +13 -0
  52. package/dist/packages/core/src/commands/setMeta.d.ts +12 -0
  53. package/dist/packages/core/src/commands/setNode.d.ts +13 -0
  54. package/dist/packages/core/src/commands/setNodeSelection.d.ts +12 -0
  55. package/dist/packages/core/src/commands/setTextSelection.d.ts +12 -0
  56. package/dist/packages/core/src/commands/sinkListItem.d.ts +13 -0
  57. package/dist/packages/core/src/commands/splitBlock.d.ts +14 -0
  58. package/dist/packages/core/src/commands/splitListItem.d.ts +13 -0
  59. package/dist/packages/core/src/commands/toggleList.d.ts +13 -0
  60. package/dist/packages/core/src/commands/toggleMark.d.ts +18 -0
  61. package/dist/packages/core/src/commands/toggleNode.d.ts +13 -0
  62. package/dist/packages/core/src/commands/toggleWrap.d.ts +13 -0
  63. package/dist/packages/core/src/commands/undoInputRule.d.ts +12 -0
  64. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +12 -0
  65. package/dist/packages/core/src/commands/unsetMark.d.ts +18 -0
  66. package/dist/packages/core/src/commands/updateAttributes.d.ts +13 -0
  67. package/dist/packages/core/src/commands/wrapIn.d.ts +13 -0
  68. package/dist/packages/core/src/commands/wrapInList.d.ts +13 -0
  69. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +2 -0
  70. package/dist/packages/core/src/extensions/commands.d.ts +3 -0
  71. package/dist/packages/core/src/extensions/editable.d.ts +2 -0
  72. package/dist/packages/core/src/extensions/focusEvents.d.ts +2 -0
  73. package/dist/packages/core/src/extensions/index.d.ts +6 -0
  74. package/dist/packages/core/src/extensions/keymap.d.ts +2 -0
  75. package/dist/packages/core/src/extensions/tabindex.d.ts +2 -0
  76. package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +7 -0
  77. package/dist/packages/core/src/helpers/createChainableState.d.ts +5 -0
  78. package/dist/packages/core/src/helpers/createDocument.d.ts +3 -0
  79. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +7 -0
  80. package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +2 -0
  81. package/dist/packages/core/src/helpers/findChildren.d.ts +3 -0
  82. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +6 -0
  83. package/dist/packages/core/src/helpers/findParentNode.d.ts +8 -0
  84. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +8 -0
  85. package/dist/packages/core/src/helpers/generateHTML.d.ts +2 -0
  86. package/dist/packages/core/src/helpers/generateJSON.d.ts +2 -0
  87. package/dist/packages/core/src/helpers/generateText.d.ts +5 -0
  88. package/dist/packages/core/src/helpers/getAttributes.d.ts +3 -0
  89. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +6 -0
  90. package/dist/packages/core/src/helpers/getChangedRanges.d.ts +11 -0
  91. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +8 -0
  92. package/dist/packages/core/src/helpers/getExtensionField.d.ts +2 -0
  93. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +2 -0
  94. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +3 -0
  95. package/dist/packages/core/src/helpers/getMarkRange.d.ts +3 -0
  96. package/dist/packages/core/src/helpers/getMarkType.d.ts +2 -0
  97. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +3 -0
  98. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +3 -0
  99. package/dist/packages/core/src/helpers/getNodeType.d.ts +2 -0
  100. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +3 -0
  101. package/dist/packages/core/src/helpers/getSchema.d.ts +3 -0
  102. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +3 -0
  103. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +2 -0
  104. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +2 -0
  105. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +2 -0
  106. package/dist/packages/core/src/helpers/getText.d.ts +6 -0
  107. package/dist/packages/core/src/helpers/getTextBetween.d.ts +6 -0
  108. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +2 -0
  109. package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +3 -0
  110. package/dist/packages/core/src/helpers/index.d.ts +33 -0
  111. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +9 -0
  112. package/dist/packages/core/src/helpers/isActive.d.ts +2 -0
  113. package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +2 -0
  114. package/dist/packages/core/src/helpers/isList.d.ts +2 -0
  115. package/dist/packages/core/src/helpers/isMarkActive.d.ts +3 -0
  116. package/dist/packages/core/src/helpers/isNodeActive.d.ts +3 -0
  117. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +2 -0
  118. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +2 -0
  119. package/dist/packages/core/src/helpers/isTextSelection.d.ts +2 -0
  120. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +2 -0
  121. package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +4 -0
  122. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +2 -0
  123. package/dist/packages/core/src/helpers/splitExtensions.d.ts +9 -0
  124. package/dist/packages/core/src/index.d.ts +23 -0
  125. package/dist/packages/core/src/inputRules/index.d.ts +5 -0
  126. package/dist/packages/core/src/inputRules/markInputRule.d.ts +12 -0
  127. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +12 -0
  128. package/dist/packages/core/src/inputRules/textInputRule.d.ts +9 -0
  129. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +14 -0
  130. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +23 -0
  131. package/dist/packages/core/src/pasteRules/index.d.ts +3 -0
  132. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +12 -0
  133. package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +12 -0
  134. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +9 -0
  135. package/dist/packages/core/src/style.d.ts +1 -0
  136. package/dist/packages/core/src/types.d.ts +214 -0
  137. package/dist/packages/core/src/utilities/callOrReturn.d.ts +9 -0
  138. package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -0
  139. package/dist/packages/core/src/utilities/deleteProps.d.ts +6 -0
  140. package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -0
  141. package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +1 -0
  142. package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -0
  143. package/dist/packages/core/src/utilities/fromString.d.ts +1 -0
  144. package/dist/packages/core/src/utilities/index.d.ts +20 -0
  145. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -0
  146. package/dist/packages/core/src/utilities/isFunction.d.ts +1 -0
  147. package/dist/packages/core/src/utilities/isMacOS.d.ts +1 -0
  148. package/dist/packages/core/src/utilities/isNumber.d.ts +1 -0
  149. package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -0
  150. package/dist/packages/core/src/utilities/isRegExp.d.ts +1 -0
  151. package/dist/packages/core/src/utilities/isString.d.ts +1 -0
  152. package/dist/packages/core/src/utilities/isiOS.d.ts +1 -0
  153. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -0
  154. package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -0
  155. package/dist/packages/core/src/utilities/minMax.d.ts +1 -0
  156. package/dist/packages/core/src/utilities/objectIncludes.d.ts +8 -0
  157. package/dist/packages/core/src/utilities/removeDuplicates.d.ts +8 -0
  158. package/package.json +7 -16
  159. package/dist/index.d.ts +0 -2330
@@ -0,0 +1,5 @@
1
+ import { EditorState, Transaction } from '@tiptap/pm/state';
2
+ export declare function createChainableState(config: {
3
+ transaction: Transaction;
4
+ state: EditorState;
5
+ }): EditorState;
@@ -0,0 +1,3 @@
1
+ import { Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model';
2
+ import { Content } from '../types';
3
+ export declare function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions): ProseMirrorNode;
@@ -0,0 +1,7 @@
1
+ import { Fragment, Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model';
2
+ import { Content } from '../types';
3
+ export declare type CreateNodeFromContentOptions = {
4
+ slice?: boolean;
5
+ parseOptions?: ParseOptions;
6
+ };
7
+ export declare function createNodeFromContent(content: Content, schema: Schema, options?: CreateNodeFromContentOptions): ProseMirrorNode | Fragment;
@@ -0,0 +1,2 @@
1
+ import { ContentMatch, NodeType } from '@tiptap/pm/model';
2
+ export declare function defaultBlockAt(match: ContentMatch): NodeType | null;
@@ -0,0 +1,3 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { NodeWithPos, Predicate } from '../types';
3
+ export declare function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[];
@@ -0,0 +1,6 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { NodeWithPos, Predicate, Range } from '../types';
3
+ /**
4
+ * Same as `findChildren` but searches only within a `range`.
5
+ */
6
+ export declare function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[];
@@ -0,0 +1,8 @@
1
+ import { Selection } from '@tiptap/pm/state';
2
+ import { Predicate } from '../types';
3
+ export declare function findParentNode(predicate: Predicate): (selection: Selection) => {
4
+ pos: number;
5
+ start: number;
6
+ depth: number;
7
+ node: import("prosemirror-model").Node;
8
+ } | undefined;
@@ -0,0 +1,8 @@
1
+ import { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model';
2
+ import { Predicate } from '../types';
3
+ export declare function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): {
4
+ pos: number;
5
+ start: number;
6
+ depth: number;
7
+ node: ProseMirrorNode;
8
+ } | undefined;
@@ -0,0 +1,2 @@
1
+ import { Extensions, JSONContent } from '../types';
2
+ export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
@@ -0,0 +1,2 @@
1
+ import { Extensions } from '../types';
2
+ export declare function generateJSON(html: string, extensions: Extensions): Record<string, any>;
@@ -0,0 +1,5 @@
1
+ import { Extensions, JSONContent, TextSerializer } from '../types';
2
+ export declare function generateText(doc: JSONContent, extensions: Extensions, options?: {
3
+ blockSeparator?: string;
4
+ textSerializers?: Record<string, TextSerializer>;
5
+ }): string;
@@ -0,0 +1,3 @@
1
+ import { MarkType, NodeType } from '@tiptap/pm/model';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ export declare function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
@@ -0,0 +1,6 @@
1
+ import { ExtensionAttribute, Extensions } from '../types';
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[];
@@ -0,0 +1,11 @@
1
+ import { Transform } from '@tiptap/pm/transform';
2
+ import { Range } from '../types';
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[];
@@ -0,0 +1,8 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { JSONContent } from '../types';
3
+ interface DebugJSONContent extends JSONContent {
4
+ from: number;
5
+ to: number;
6
+ }
7
+ export declare function getDebugJSON(node: ProseMirrorNode, startOffset?: number): DebugJSONContent;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types';
2
+ export declare function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
@@ -0,0 +1,2 @@
1
+ import { Fragment, Schema } from '@tiptap/pm/model';
2
+ export declare function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
@@ -0,0 +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>;
@@ -0,0 +1,3 @@
1
+ import { MarkType, ResolvedPos } from '@tiptap/pm/model';
2
+ import { Range } from '../types';
3
+ export declare function getMarkRange($pos: ResolvedPos, type: MarkType, attributes?: Record<string, any>): Range | void;
@@ -0,0 +1,2 @@
1
+ import { MarkType, Schema } from '@tiptap/pm/model';
2
+ export declare function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType;
@@ -0,0 +1,3 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { MarkRange } from '../types';
3
+ export declare function getMarksBetween(from: number, to: number, doc: ProseMirrorNode): MarkRange[];
@@ -0,0 +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>;
@@ -0,0 +1,2 @@
1
+ import { NodeType, Schema } from '@tiptap/pm/model';
2
+ export declare function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType;
@@ -0,0 +1,3 @@
1
+ import { Mark, Node } from '@tiptap/pm/model';
2
+ import { ExtensionAttribute } from '../types';
3
+ export declare function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
@@ -0,0 +1,3 @@
1
+ import { Schema } from '@tiptap/pm/model';
2
+ import { Extensions } from '../types';
3
+ export declare function getSchema(extensions: Extensions): Schema;
@@ -0,0 +1,3 @@
1
+ import { Schema } from '@tiptap/pm/model';
2
+ import { Extensions } from '../types';
3
+ export declare function getSchemaByResolvedExtensions(extensions: Extensions): Schema;
@@ -0,0 +1,2 @@
1
+ import { MarkType, NodeType, Schema } from '@tiptap/pm/model';
2
+ export declare function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
@@ -0,0 +1,2 @@
1
+ import { Schema } from '@tiptap/pm/model';
2
+ export declare function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
@@ -0,0 +1,2 @@
1
+ import { ExtensionAttribute } from '../types';
2
+ export declare function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
@@ -0,0 +1,6 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { TextSerializer } from '../types';
3
+ export declare function getText(node: ProseMirrorNode, options?: {
4
+ blockSeparator?: string;
5
+ textSerializers?: Record<string, TextSerializer>;
6
+ }): string;
@@ -0,0 +1,6 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { Range, TextSerializer } from '../types';
3
+ export declare function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
4
+ blockSeparator?: string;
5
+ textSerializers?: Record<string, TextSerializer>;
6
+ }): string;
@@ -0,0 +1,2 @@
1
+ import { ResolvedPos } from '@tiptap/pm/model';
2
+ export declare const getTextContentFromNodes: ($from: ResolvedPos, maxMatch?: number) => string;
@@ -0,0 +1,3 @@
1
+ import { Schema } from '@tiptap/pm/model';
2
+ import { TextSerializer } from '../types';
3
+ export declare function getTextSerializersFromSchema(schema: Schema): Record<string, TextSerializer>;
@@ -0,0 +1,33 @@
1
+ export * from './combineTransactionSteps';
2
+ export * from './defaultBlockAt';
3
+ export * from './findChildren';
4
+ export * from './findChildrenInRange';
5
+ export * from './findParentNode';
6
+ export * from './findParentNodeClosestToPos';
7
+ export * from './generateHTML';
8
+ export * from './generateJSON';
9
+ export * from './generateText';
10
+ export * from './getAttributes';
11
+ export * from './getChangedRanges';
12
+ export * from './getDebugJSON';
13
+ export * from './getExtensionField';
14
+ export * from './getHTMLFromFragment';
15
+ export * from './getMarkAttributes';
16
+ export * from './getMarkRange';
17
+ export * from './getMarksBetween';
18
+ export * from './getMarkType';
19
+ export * from './getNodeAttributes';
20
+ export * from './getNodeType';
21
+ export * from './getSchema';
22
+ export * from './getText';
23
+ export * from './getTextBetween';
24
+ export * from './getTextContentFromNodes';
25
+ export * from './getTextSerializersFromSchema';
26
+ export * from './isActive';
27
+ export * from './isList';
28
+ export * from './isMarkActive';
29
+ export * from './isNodeActive';
30
+ export * from './isNodeEmpty';
31
+ export * from './isNodeSelection';
32
+ export * from './isTextSelection';
33
+ export * from './posToDOMRect';
@@ -0,0 +1,9 @@
1
+ import { ParseRule } from '@tiptap/pm/model';
2
+ import { ExtensionAttribute } from '../types';
3
+ /**
4
+ * This function merges extension attributes into parserule attributes (`attrs` or `getAttrs`).
5
+ * Cancels when `getAttrs` returned `false`.
6
+ * @param parseRule ProseMirror ParseRule
7
+ * @param extensionAttributes List of attributes to inject
8
+ */
9
+ export declare function injectExtensionAttributesToParseRule(parseRule: ParseRule, extensionAttributes: ExtensionAttribute[]): ParseRule;
@@ -0,0 +1,2 @@
1
+ import { EditorState } from '@tiptap/pm/state';
2
+ export declare function isActive(state: EditorState, name: string | null, attributes?: Record<string, any>): boolean;
@@ -0,0 +1,2 @@
1
+ import { AnyExtension, EnableRules } from '../types';
2
+ export declare function isExtensionRulesEnabled(extension: AnyExtension, enabled: EnableRules): boolean;
@@ -0,0 +1,2 @@
1
+ import { Extensions } from '../types';
2
+ export declare function isList(name: string, extensions: Extensions): boolean;
@@ -0,0 +1,3 @@
1
+ import { MarkType } from '@tiptap/pm/model';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ export declare function isMarkActive(state: EditorState, typeOrName: MarkType | string | null, attributes?: Record<string, any>): boolean;
@@ -0,0 +1,3 @@
1
+ import { NodeType } from '@tiptap/pm/model';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ export declare function isNodeActive(state: EditorState, typeOrName: NodeType | string | null, attributes?: Record<string, any>): boolean;
@@ -0,0 +1,2 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ export declare function isNodeEmpty(node: ProseMirrorNode): boolean;
@@ -0,0 +1,2 @@
1
+ import { NodeSelection } from '@tiptap/pm/state';
2
+ export declare function isNodeSelection(value: unknown): value is NodeSelection;
@@ -0,0 +1,2 @@
1
+ import { TextSelection } from '@tiptap/pm/state';
2
+ export declare function isTextSelection(value: unknown): value is TextSelection;
@@ -0,0 +1,2 @@
1
+ import { EditorView } from '@tiptap/pm/view';
2
+ export declare function posToDOMRect(view: EditorView, from: number, to: number): DOMRect;
@@ -0,0 +1,4 @@
1
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
2
+ import { Selection } from '@tiptap/pm/state';
3
+ import { FocusPosition } from '../types';
4
+ export declare function resolveFocusPosition(doc: ProseMirrorNode, position?: FocusPosition): Selection | null;
@@ -0,0 +1,2 @@
1
+ import { Transaction } from '@tiptap/pm/state';
2
+ export declare function selectionToInsertionEnd(tr: Transaction, startLen: number, bias: number): void;
@@ -0,0 +1,9 @@
1
+ import { Extension } from '../Extension';
2
+ import { Mark } from '../Mark';
3
+ import { Node } from '../Node';
4
+ import { Extensions } from '../types';
5
+ export declare function splitExtensions(extensions: Extensions): {
6
+ baseExtensions: Extension<any, any>[];
7
+ nodeExtensions: Node<any, any>[];
8
+ markExtensions: Mark<any, any>[];
9
+ };
@@ -0,0 +1,23 @@
1
+ export * from './CommandManager';
2
+ export * from './Editor';
3
+ export * from './Extension';
4
+ export * as extensions from './extensions';
5
+ export * from './helpers';
6
+ export * from './InputRule';
7
+ export * from './inputRules';
8
+ export * from './Mark';
9
+ export * from './Node';
10
+ export * from './NodeView';
11
+ export * from './PasteRule';
12
+ export * from './pasteRules';
13
+ export * from './Tracker';
14
+ export * from './types';
15
+ export * from './utilities';
16
+ export interface Commands<ReturnType = any> {
17
+ }
18
+ export interface ExtensionConfig<Options = any, Storage = any> {
19
+ }
20
+ export interface NodeConfig<Options = any, Storage = any> {
21
+ }
22
+ export interface MarkConfig<Options = any, Storage = any> {
23
+ }
@@ -0,0 +1,5 @@
1
+ export * from './markInputRule';
2
+ export * from './nodeInputRule';
3
+ export * from './textblockTypeInputRule';
4
+ export * from './textInputRule';
5
+ export * from './wrappingInputRule';
@@ -0,0 +1,12 @@
1
+ import { MarkType } from '@tiptap/pm/model';
2
+ import { InputRule, InputRuleFinder } from '../InputRule';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an input rule that adds a mark when the
6
+ * matched text is typed into it.
7
+ */
8
+ export declare function markInputRule(config: {
9
+ find: InputRuleFinder;
10
+ type: MarkType;
11
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
12
+ }): InputRule;
@@ -0,0 +1,12 @@
1
+ import { NodeType } from '@tiptap/pm/model';
2
+ import { InputRule, InputRuleFinder } from '../InputRule';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an input rule that adds a node when the
6
+ * matched text is typed into it.
7
+ */
8
+ export declare function nodeInputRule(config: {
9
+ find: InputRuleFinder;
10
+ type: NodeType;
11
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
12
+ }): InputRule;
@@ -0,0 +1,9 @@
1
+ import { InputRule, InputRuleFinder } from '../InputRule';
2
+ /**
3
+ * Build an input rule that replaces text when the
4
+ * matched text is typed into it.
5
+ */
6
+ export declare function textInputRule(config: {
7
+ find: InputRuleFinder;
8
+ replace: string;
9
+ }): InputRule;
@@ -0,0 +1,14 @@
1
+ import { NodeType } from '@tiptap/pm/model';
2
+ import { InputRule, InputRuleFinder } from '../InputRule';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an input rule that changes the type of a textblock when the
6
+ * matched text is typed into it. When using a regular expresion you’ll
7
+ * probably want the regexp to start with `^`, so that the pattern can
8
+ * only occur at the start of a textblock.
9
+ */
10
+ export declare function textblockTypeInputRule(config: {
11
+ find: InputRuleFinder;
12
+ type: NodeType;
13
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
14
+ }): InputRule;
@@ -0,0 +1,23 @@
1
+ import { Node as ProseMirrorNode, NodeType } from '@tiptap/pm/model';
2
+ import { InputRule, InputRuleFinder } from '../InputRule';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an input rule for automatically wrapping a textblock when a
6
+ * given string is typed. When using a regular expresion you’ll
7
+ * probably want the regexp to start with `^`, so that the pattern can
8
+ * only occur at the start of a textblock.
9
+ *
10
+ * `type` is the type of node to wrap in.
11
+ *
12
+ * By default, if there’s a node with the same type above the newly
13
+ * wrapped node, the rule will try to join those
14
+ * two nodes. You can pass a join predicate, which takes a regular
15
+ * expression match and the node before the wrapped node, and can
16
+ * return a boolean to indicate whether a join should happen.
17
+ */
18
+ export declare function wrappingInputRule(config: {
19
+ find: InputRuleFinder;
20
+ type: NodeType;
21
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
22
+ joinPredicate?: (match: ExtendedRegExpMatchArray, node: ProseMirrorNode) => boolean;
23
+ }): InputRule;
@@ -0,0 +1,3 @@
1
+ export * from './markPasteRule';
2
+ export * from './nodePasteRule';
3
+ export * from './textPasteRule';
@@ -0,0 +1,12 @@
1
+ import { MarkType } from '@tiptap/pm/model';
2
+ import { PasteRule, PasteRuleFinder } from '../PasteRule';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an paste rule that adds a mark when the
6
+ * matched text is pasted into it.
7
+ */
8
+ export declare function markPasteRule(config: {
9
+ find: PasteRuleFinder;
10
+ type: MarkType;
11
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
12
+ }): PasteRule;
@@ -0,0 +1,12 @@
1
+ import { NodeType } from '@tiptap/pm/model';
2
+ import { PasteRule } from '../PasteRule';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an paste rule that adds a node when the
6
+ * matched text is pasted into it.
7
+ */
8
+ export declare function nodePasteRule(config: {
9
+ find: RegExp;
10
+ type: NodeType;
11
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
12
+ }): PasteRule;
@@ -0,0 +1,9 @@
1
+ import { PasteRule, PasteRuleFinder } from '../PasteRule';
2
+ /**
3
+ * Build an paste rule that replaces text when the
4
+ * matched text is pasted into it.
5
+ */
6
+ export declare function textPasteRule(config: {
7
+ find: PasteRuleFinder;
8
+ replace: string;
9
+ }): PasteRule;
@@ -0,0 +1 @@
1
+ export declare const style = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}";