@tiptap/core 2.0.0-beta.176 → 2.0.0-beta.180

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 (156) hide show
  1. package/dist/packages/core/src/CommandManager.d.ts +1 -1
  2. package/dist/packages/core/src/Editor.d.ts +4 -4
  3. package/dist/packages/core/src/Extension.d.ts +5 -5
  4. package/dist/packages/core/src/InputRule.d.ts +1 -1
  5. package/dist/packages/core/src/Mark.d.ts +5 -5
  6. package/dist/packages/core/src/Node.d.ts +4 -4
  7. package/dist/packages/core/src/NodeView.d.ts +4 -4
  8. package/dist/packages/core/src/PasteRule.d.ts +1 -1
  9. package/dist/packages/core/src/commands/deleteRange.d.ts +1 -1
  10. package/dist/packages/core/src/commands/focus.d.ts +1 -1
  11. package/dist/packages/core/src/commands/index.d.ts +50 -0
  12. package/dist/packages/core/src/commands/insertContent.d.ts +1 -1
  13. package/dist/packages/core/src/commands/insertContentAt.d.ts +1 -1
  14. package/dist/packages/core/src/commands/resetAttributes.d.ts +1 -1
  15. package/dist/packages/core/src/commands/setContent.d.ts +1 -1
  16. package/dist/packages/core/src/commands/setTextSelection.d.ts +1 -1
  17. package/dist/packages/core/src/commands/updateAttributes.d.ts +1 -1
  18. package/dist/packages/core/src/extensions/commands.d.ts +1 -100
  19. package/dist/packages/core/src/helpers/createDocument.d.ts +1 -1
  20. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +1 -1
  21. package/dist/packages/core/src/helpers/findChildren.d.ts +1 -1
  22. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +1 -1
  23. package/dist/packages/core/src/helpers/findParentNode.d.ts +1 -2
  24. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +1 -1
  25. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +1 -1
  26. package/dist/packages/core/src/helpers/getExtensionField.d.ts +1 -1
  27. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +1 -1
  28. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +1 -1
  29. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +1 -1
  30. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +1 -1
  31. package/dist/packages/core/src/helpers/getText.d.ts +1 -1
  32. package/dist/packages/core/src/helpers/getTextBetween.d.ts +1 -1
  33. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +2 -0
  34. package/dist/packages/core/src/helpers/index.d.ts +33 -0
  35. package/dist/packages/core/src/helpers/isMarkActive.d.ts +1 -1
  36. package/dist/packages/core/src/helpers/isNodeActive.d.ts +1 -1
  37. package/dist/packages/core/src/helpers/splitExtensions.d.ts +2 -2
  38. package/dist/packages/core/src/index.d.ts +9 -48
  39. package/dist/packages/core/src/inputRules/index.d.ts +5 -0
  40. package/dist/packages/core/src/inputRules/markInputRule.d.ts +1 -1
  41. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +1 -1
  42. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +1 -1
  43. package/dist/packages/core/src/pasteRules/index.d.ts +2 -0
  44. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +1 -1
  45. package/dist/packages/core/src/types.d.ts +6 -5
  46. package/dist/packages/core/src/utilities/index.d.ts +3 -0
  47. package/dist/tiptap-core.cjs.js +3471 -3703
  48. package/dist/tiptap-core.cjs.js.map +1 -1
  49. package/dist/tiptap-core.esm.js +3431 -3664
  50. package/dist/tiptap-core.esm.js.map +1 -1
  51. package/dist/tiptap-core.umd.js +3276 -3508
  52. package/dist/tiptap-core.umd.js.map +1 -1
  53. package/package.json +9 -16
  54. package/src/CommandManager.ts +4 -3
  55. package/src/Editor.ts +16 -15
  56. package/src/Extension.ts +10 -9
  57. package/src/ExtensionManager.ts +11 -10
  58. package/src/InputRule.ts +10 -13
  59. package/src/Mark.ts +11 -10
  60. package/src/Node.ts +11 -10
  61. package/src/NodeView.ts +7 -6
  62. package/src/PasteRule.ts +8 -7
  63. package/src/commands/clearNodes.ts +1 -0
  64. package/src/commands/createParagraphNear.ts +1 -0
  65. package/src/commands/deleteNode.ts +1 -0
  66. package/src/commands/deleteRange.ts +1 -1
  67. package/src/commands/deleteSelection.ts +1 -0
  68. package/src/commands/exitCode.ts +1 -0
  69. package/src/commands/extendMarkRange.ts +4 -3
  70. package/src/commands/focus.ts +3 -3
  71. package/src/commands/index.ts +50 -0
  72. package/src/commands/insertContent.ts +2 -1
  73. package/src/commands/insertContentAt.ts +2 -1
  74. package/src/commands/joinBackward.ts +1 -0
  75. package/src/commands/joinForward.ts +1 -0
  76. package/src/commands/lift.ts +3 -2
  77. package/src/commands/liftEmptyBlock.ts +1 -0
  78. package/src/commands/liftListItem.ts +3 -2
  79. package/src/commands/newlineInCode.ts +1 -0
  80. package/src/commands/resetAttributes.ts +4 -3
  81. package/src/commands/selectNodeBackward.ts +1 -0
  82. package/src/commands/selectNodeForward.ts +1 -0
  83. package/src/commands/selectParentNode.ts +1 -0
  84. package/src/commands/selectTextblockEnd.ts +1 -0
  85. package/src/commands/selectTextblockStart.ts +1 -0
  86. package/src/commands/setContent.ts +3 -2
  87. package/src/commands/setMark.ts +3 -2
  88. package/src/commands/setNode.ts +3 -2
  89. package/src/commands/setNodeSelection.ts +3 -2
  90. package/src/commands/setTextSelection.ts +2 -1
  91. package/src/commands/sinkListItem.ts +3 -2
  92. package/src/commands/splitBlock.ts +3 -2
  93. package/src/commands/splitListItem.ts +5 -4
  94. package/src/commands/toggleList.ts +3 -2
  95. package/src/commands/toggleMark.ts +2 -1
  96. package/src/commands/toggleNode.ts +3 -2
  97. package/src/commands/toggleWrap.ts +3 -2
  98. package/src/commands/unsetMark.ts +3 -2
  99. package/src/commands/updateAttributes.ts +3 -2
  100. package/src/commands/wrapIn.ts +2 -1
  101. package/src/commands/wrapInList.ts +3 -2
  102. package/src/extensions/clipboardTextSerializer.ts +1 -0
  103. package/src/extensions/commands.ts +3 -150
  104. package/src/extensions/editable.ts +1 -0
  105. package/src/extensions/focusEvents.ts +1 -0
  106. package/src/extensions/keymap.ts +3 -2
  107. package/src/extensions/tabindex.ts +2 -7
  108. package/src/helpers/createChainableState.ts +3 -2
  109. package/src/helpers/createDocument.ts +2 -1
  110. package/src/helpers/createNodeFromContent.ts +4 -3
  111. package/src/helpers/findChildren.ts +2 -1
  112. package/src/helpers/findChildrenInRange.ts +2 -1
  113. package/src/helpers/findParentNode.ts +2 -1
  114. package/src/helpers/findParentNodeClosestToPos.ts +2 -1
  115. package/src/helpers/generateHTML.ts +3 -2
  116. package/src/helpers/generateJSON.ts +3 -2
  117. package/src/helpers/generateText.ts +3 -2
  118. package/src/helpers/getAttributes.ts +3 -2
  119. package/src/helpers/getAttributesFromExtensions.ts +18 -11
  120. package/src/helpers/getChangedRanges.ts +2 -1
  121. package/src/helpers/getDebugJSON.ts +1 -0
  122. package/src/helpers/getExtensionField.ts +1 -1
  123. package/src/helpers/getHTMLFromFragment.ts +1 -1
  124. package/src/helpers/getMarkAttributes.ts +2 -1
  125. package/src/helpers/getMarkRange.ts +5 -4
  126. package/src/helpers/getMarksBetween.ts +1 -0
  127. package/src/helpers/getNodeAttributes.ts +2 -1
  128. package/src/helpers/getRenderedAttributes.ts +2 -1
  129. package/src/helpers/getSchema.ts +2 -1
  130. package/src/helpers/getSchemaByResolvedExtensions.ts +7 -6
  131. package/src/helpers/getText.ts +2 -1
  132. package/src/helpers/getTextBetween.ts +12 -9
  133. package/src/helpers/getTextContentFromNodes.ts +17 -0
  134. package/src/helpers/getTextSerializersFromSchema.ts +1 -0
  135. package/src/helpers/index.ts +33 -0
  136. package/src/helpers/injectExtensionAttributesToParseRule.ts +1 -0
  137. package/src/helpers/isActive.ts +3 -2
  138. package/src/helpers/isList.ts +3 -3
  139. package/src/helpers/isMarkActive.ts +3 -2
  140. package/src/helpers/isNodeActive.ts +3 -2
  141. package/src/helpers/isNodeSelection.ts +1 -0
  142. package/src/helpers/isTextSelection.ts +1 -0
  143. package/src/helpers/posToDOMRect.ts +1 -0
  144. package/src/helpers/resolveFocusPosition.ts +1 -0
  145. package/src/helpers/selectionToInsertionEnd.ts +1 -1
  146. package/src/helpers/splitExtensions.ts +2 -2
  147. package/src/index.ts +9 -52
  148. package/src/inputRules/index.ts +5 -0
  149. package/src/inputRules/markInputRule.ts +3 -2
  150. package/src/inputRules/nodeInputRule.ts +1 -0
  151. package/src/inputRules/textblockTypeInputRule.ts +2 -1
  152. package/src/inputRules/wrappingInputRule.ts +3 -2
  153. package/src/pasteRules/index.ts +2 -0
  154. package/src/pasteRules/markPasteRule.ts +3 -2
  155. package/src/types.ts +11 -9
  156. package/src/utilities/index.ts +3 -0
@@ -1,6 +1,6 @@
1
1
  import { EditorState, Transaction } from 'prosemirror-state';
2
2
  import { Editor } from './Editor';
3
- import { SingleCommands, ChainedCommands, CanCommands, AnyCommands, CommandProps } from './types';
3
+ import { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types';
4
4
  export declare class CommandManager {
5
5
  editor: Editor;
6
6
  rawCommands: AnyCommands;
@@ -1,10 +1,10 @@
1
+ import { MarkType, NodeType, Schema } from 'prosemirror-model';
1
2
  import { EditorState, Plugin, PluginKey, Transaction } from 'prosemirror-state';
2
3
  import { EditorView } from 'prosemirror-view';
3
- import { Schema, MarkType, NodeType } from 'prosemirror-model';
4
- import { ExtensionManager } from './ExtensionManager';
5
4
  import { EventEmitter } from './EventEmitter';
6
- import { EditorOptions, CanCommands, ChainedCommands, JSONContent, SingleCommands, TextSerializer, EditorEvents } from './types';
5
+ import { ExtensionManager } from './ExtensionManager';
7
6
  import * as extensions from './extensions';
7
+ import { CanCommands, ChainedCommands, EditorEvents, EditorOptions, JSONContent, SingleCommands, TextSerializer } from './types';
8
8
  export { extensions };
9
9
  export interface HTMLElement {
10
10
  editor?: Editor;
@@ -92,7 +92,7 @@ export declare class Editor extends EventEmitter<EditorEvents> {
92
92
  createNodeViews(): void;
93
93
  isCapturingTransaction: boolean;
94
94
  private capturedTransaction;
95
- captureTransaction(fn: Function): Transaction<any> | null;
95
+ captureTransaction(fn: Function): Transaction | null;
96
96
  /**
97
97
  * The callback over which to send transactions (state updates) produced by the view.
98
98
  *
@@ -1,11 +1,11 @@
1
1
  import { Plugin, Transaction } from 'prosemirror-state';
2
- import { InputRule } from './InputRule';
3
- import { PasteRule } from './PasteRule';
2
+ import { ExtensionConfig } from '.';
4
3
  import { Editor } from './Editor';
5
- import { Node } from './Node';
4
+ import { InputRule } from './InputRule';
6
5
  import { Mark } from './Mark';
7
- import { Extensions, GlobalAttributes, RawCommands, ParentConfig, KeyboardShortcutCommand } from './types';
8
- import { ExtensionConfig } from '.';
6
+ import { Node } from './Node';
7
+ import { PasteRule } from './PasteRule';
8
+ import { Extensions, GlobalAttributes, KeyboardShortcutCommand, ParentConfig, RawCommands } from './types';
9
9
  declare module '@tiptap/core' {
10
10
  interface ExtensionConfig<Options = any, Storage = any> {
11
11
  [key: string]: any;
@@ -1,6 +1,6 @@
1
1
  import { EditorState, Plugin } from 'prosemirror-state';
2
2
  import { Editor } from './Editor';
3
- import { Range, ExtendedRegExpMatchArray, SingleCommands, ChainedCommands, CanCommands } from './types';
3
+ import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types';
4
4
  export declare type InputRuleMatch = {
5
5
  index: number;
6
6
  text: string;
@@ -1,11 +1,11 @@
1
- import { DOMOutputSpec, MarkSpec, Mark as ProseMirrorMark, MarkType } from 'prosemirror-model';
1
+ import { DOMOutputSpec, Mark as ProseMirrorMark, MarkSpec, MarkType } from 'prosemirror-model';
2
2
  import { Plugin, Transaction } from 'prosemirror-state';
3
- import { InputRule } from './InputRule';
4
- import { PasteRule } from './PasteRule';
5
- import { Extensions, Attributes, RawCommands, GlobalAttributes, ParentConfig, KeyboardShortcutCommand } from './types';
6
- import { Node } from './Node';
7
3
  import { MarkConfig } from '.';
8
4
  import { Editor } from './Editor';
5
+ import { InputRule } from './InputRule';
6
+ import { Node } from './Node';
7
+ import { PasteRule } from './PasteRule';
8
+ import { Attributes, Extensions, GlobalAttributes, KeyboardShortcutCommand, ParentConfig, RawCommands } from './types';
9
9
  declare module '@tiptap/core' {
10
10
  interface MarkConfig<Options = any, Storage = any> {
11
11
  [key: string]: any;
@@ -1,10 +1,10 @@
1
- import { DOMOutputSpec, NodeSpec, Node as ProseMirrorNode, NodeType } from 'prosemirror-model';
1
+ import { DOMOutputSpec, Node as ProseMirrorNode, NodeSpec, NodeType } from 'prosemirror-model';
2
2
  import { Plugin, Transaction } from 'prosemirror-state';
3
- import { InputRule } from './InputRule';
4
- import { PasteRule } from './PasteRule';
5
- import { Extensions, Attributes, NodeViewRenderer, GlobalAttributes, RawCommands, ParentConfig, KeyboardShortcutCommand } from './types';
6
3
  import { NodeConfig } from '.';
7
4
  import { Editor } from './Editor';
5
+ import { InputRule } from './InputRule';
6
+ import { PasteRule } from './PasteRule';
7
+ import { Attributes, Extensions, GlobalAttributes, KeyboardShortcutCommand, NodeViewRenderer, ParentConfig, RawCommands } from './types';
8
8
  declare module '@tiptap/core' {
9
9
  interface NodeConfig<Options = any, Storage = any> {
10
10
  [key: string]: any;
@@ -1,8 +1,8 @@
1
- import { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view';
2
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view';
3
3
  import { Editor as CoreEditor } from './Editor';
4
4
  import { Node } from './Node';
5
- import { NodeViewRendererProps, NodeViewRendererOptions } from './types';
5
+ import { NodeViewRendererOptions, NodeViewRendererProps } from './types';
6
6
  export declare class NodeView<Component, Editor extends CoreEditor = CoreEditor, Options extends NodeViewRendererOptions = NodeViewRendererOptions> implements ProseMirrorNodeView {
7
7
  component: Component;
8
8
  editor: Editor;
@@ -14,8 +14,8 @@ export declare class NodeView<Component, Editor extends CoreEditor = CoreEditor,
14
14
  isDragging: boolean;
15
15
  constructor(component: Component, props: NodeViewRendererProps, options?: Partial<Options>);
16
16
  mount(): void;
17
- get dom(): Element | null;
18
- get contentDOM(): Element | null;
17
+ get dom(): HTMLElement;
18
+ get contentDOM(): HTMLElement | null;
19
19
  onDragStart(event: DragEvent): void;
20
20
  stopEvent(event: Event): boolean;
21
21
  ignoreMutation(mutation: MutationRecord | {
@@ -1,6 +1,6 @@
1
1
  import { EditorState, Plugin } from 'prosemirror-state';
2
2
  import { Editor } from './Editor';
3
- import { Range, ExtendedRegExpMatchArray, SingleCommands, ChainedCommands, CanCommands } from './types';
3
+ import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types';
4
4
  export declare type PasteRuleMatch = {
5
5
  index: number;
6
6
  text: string;
@@ -1,4 +1,4 @@
1
- import { RawCommands, Range } from '../types';
1
+ import { Range, RawCommands } from '../types';
2
2
  declare module '@tiptap/core' {
3
3
  interface Commands<ReturnType> {
4
4
  deleteRange: {
@@ -1,4 +1,4 @@
1
- import { RawCommands, FocusPosition } from '../types';
1
+ import { FocusPosition, RawCommands } from '../types';
2
2
  declare module '@tiptap/core' {
3
3
  interface Commands<ReturnType> {
4
4
  focus: {
@@ -0,0 +1,50 @@
1
+ export * from './blur';
2
+ export * from './clearContent';
3
+ export * from './clearNodes';
4
+ export * from './command';
5
+ export * from './createParagraphNear';
6
+ export * from './deleteNode';
7
+ export * from './deleteRange';
8
+ export * from './deleteSelection';
9
+ export * from './enter';
10
+ export * from './exitCode';
11
+ export * from './extendMarkRange';
12
+ export * from './first';
13
+ export * from './focus';
14
+ export * from './forEach';
15
+ export * from './insertContent';
16
+ export * from './insertContentAt';
17
+ export * from './joinBackward';
18
+ export * from './joinForward';
19
+ export * from './keyboardShortcut';
20
+ export * from './lift';
21
+ export * from './liftEmptyBlock';
22
+ export * from './liftListItem';
23
+ export * from './newlineInCode';
24
+ export * from './resetAttributes';
25
+ export * from './scrollIntoView';
26
+ export * from './selectAll';
27
+ export * from './selectNodeBackward';
28
+ export * from './selectNodeForward';
29
+ export * from './selectParentNode';
30
+ export * from './selectTextblockEnd';
31
+ export * from './selectTextblockStart';
32
+ export * from './setContent';
33
+ export * from './setMark';
34
+ export * from './setMeta';
35
+ export * from './setNode';
36
+ export * from './setNodeSelection';
37
+ export * from './setTextSelection';
38
+ export * from './sinkListItem';
39
+ export * from './splitBlock';
40
+ export * from './splitListItem';
41
+ export * from './toggleList';
42
+ export * from './toggleMark';
43
+ export * from './toggleNode';
44
+ export * from './toggleWrap';
45
+ export * from './undoInputRule';
46
+ export * from './unsetAllMarks';
47
+ export * from './unsetMark';
48
+ export * from './updateAttributes';
49
+ export * from './wrapIn';
50
+ export * from './wrapInList';
@@ -1,5 +1,5 @@
1
1
  import { ParseOptions } from 'prosemirror-model';
2
- import { RawCommands, Content } from '../types';
2
+ import { Content, RawCommands } from '../types';
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
5
5
  insertContent: {
@@ -1,5 +1,5 @@
1
1
  import { ParseOptions } from 'prosemirror-model';
2
- import { RawCommands, Content, Range } from '../types';
2
+ import { Content, Range, RawCommands } from '../types';
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
5
5
  insertContentAt: {
@@ -1,4 +1,4 @@
1
- import { NodeType, MarkType } from 'prosemirror-model';
1
+ import { MarkType, NodeType } from 'prosemirror-model';
2
2
  import { RawCommands } from '../types';
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
@@ -1,5 +1,5 @@
1
1
  import { ParseOptions } from 'prosemirror-model';
2
- import { RawCommands, Content } from '../types';
2
+ import { Content, RawCommands } from '../types';
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
5
5
  setContent: {
@@ -1,4 +1,4 @@
1
- import { RawCommands, Range } from '../types';
1
+ import { Range, RawCommands } from '../types';
2
2
  declare module '@tiptap/core' {
3
3
  interface Commands<ReturnType> {
4
4
  setTextSelection: {
@@ -1,4 +1,4 @@
1
- import { NodeType, MarkType } from 'prosemirror-model';
1
+ import { MarkType, NodeType } from 'prosemirror-model';
2
2
  import { RawCommands } from '../types';
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
@@ -1,102 +1,3 @@
1
1
  import { Extension } from '../Extension';
2
- import * as blur from '../commands/blur';
3
- import * as clearContent from '../commands/clearContent';
4
- import * as clearNodes from '../commands/clearNodes';
5
- import * as command from '../commands/command';
6
- import * as createParagraphNear from '../commands/createParagraphNear';
7
- import * as deleteNode from '../commands/deleteNode';
8
- import * as deleteRange from '../commands/deleteRange';
9
- import * as deleteSelection from '../commands/deleteSelection';
10
- import * as enter from '../commands/enter';
11
- import * as exitCode from '../commands/exitCode';
12
- import * as extendMarkRange from '../commands/extendMarkRange';
13
- import * as first from '../commands/first';
14
- import * as focus from '../commands/focus';
15
- import * as forEach from '../commands/forEach';
16
- import * as insertContent from '../commands/insertContent';
17
- import * as insertContentAt from '../commands/insertContentAt';
18
- import * as joinBackward from '../commands/joinBackward';
19
- import * as joinForward from '../commands/joinForward';
20
- import * as keyboardShortcut from '../commands/keyboardShortcut';
21
- import * as lift from '../commands/lift';
22
- import * as liftEmptyBlock from '../commands/liftEmptyBlock';
23
- import * as liftListItem from '../commands/liftListItem';
24
- import * as newlineInCode from '../commands/newlineInCode';
25
- import * as resetAttributes from '../commands/resetAttributes';
26
- import * as scrollIntoView from '../commands/scrollIntoView';
27
- import * as selectAll from '../commands/selectAll';
28
- import * as selectNodeBackward from '../commands/selectNodeBackward';
29
- import * as selectNodeForward from '../commands/selectNodeForward';
30
- import * as selectParentNode from '../commands/selectParentNode';
31
- import * as selectTextblockEnd from '../commands/selectTextblockEnd';
32
- import * as selectTextblockStart from '../commands/selectTextblockStart';
33
- import * as setContent from '../commands/setContent';
34
- import * as setMark from '../commands/setMark';
35
- import * as setMeta from '../commands/setMeta';
36
- import * as setNode from '../commands/setNode';
37
- import * as setNodeSelection from '../commands/setNodeSelection';
38
- import * as setTextSelection from '../commands/setTextSelection';
39
- import * as sinkListItem from '../commands/sinkListItem';
40
- import * as splitBlock from '../commands/splitBlock';
41
- import * as splitListItem from '../commands/splitListItem';
42
- import * as toggleList from '../commands/toggleList';
43
- import * as toggleMark from '../commands/toggleMark';
44
- import * as toggleNode from '../commands/toggleNode';
45
- import * as toggleWrap from '../commands/toggleWrap';
46
- import * as undoInputRule from '../commands/undoInputRule';
47
- import * as unsetAllMarks from '../commands/unsetAllMarks';
48
- import * as unsetMark from '../commands/unsetMark';
49
- import * as updateAttributes from '../commands/updateAttributes';
50
- import * as wrapIn from '../commands/wrapIn';
51
- import * as wrapInList from '../commands/wrapInList';
52
- export { blur };
53
- export { clearContent };
54
- export { clearNodes };
55
- export { command };
56
- export { createParagraphNear };
57
- export { deleteNode };
58
- export { deleteRange };
59
- export { deleteSelection };
60
- export { enter };
61
- export { exitCode };
62
- export { extendMarkRange };
63
- export { first };
64
- export { focus };
65
- export { forEach };
66
- export { insertContent };
67
- export { insertContentAt };
68
- export { joinBackward };
69
- export { joinForward };
70
- export { keyboardShortcut };
71
- export { lift };
72
- export { liftEmptyBlock };
73
- export { liftListItem };
74
- export { newlineInCode };
75
- export { resetAttributes };
76
- export { scrollIntoView };
77
- export { selectAll };
78
- export { selectNodeBackward };
79
- export { selectNodeForward };
80
- export { selectParentNode };
81
- export { selectTextblockEnd };
82
- export { selectTextblockStart };
83
- export { setContent };
84
- export { setMark };
85
- export { setMeta };
86
- export { setNode };
87
- export { setNodeSelection };
88
- export { setTextSelection };
89
- export { sinkListItem };
90
- export { splitBlock };
91
- export { splitListItem };
92
- export { toggleList };
93
- export { toggleMark };
94
- export { toggleNode };
95
- export { toggleWrap };
96
- export { undoInputRule };
97
- export { unsetAllMarks };
98
- export { unsetMark };
99
- export { updateAttributes };
100
- export { wrapIn };
101
- export { wrapInList };
2
+ export * from '../commands';
102
3
  export declare const Commands: Extension<any, any>;
@@ -1,3 +1,3 @@
1
- import { Schema, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model';
1
+ import { Node as ProseMirrorNode, ParseOptions, Schema } from 'prosemirror-model';
2
2
  import { Content } from '../types';
3
3
  export declare function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions): ProseMirrorNode;
@@ -1,4 +1,4 @@
1
- import { Schema, Node as ProseMirrorNode, Fragment, ParseOptions } from 'prosemirror-model';
1
+ import { Fragment, Node as ProseMirrorNode, ParseOptions, Schema } from 'prosemirror-model';
2
2
  import { Content } from '../types';
3
3
  export declare type CreateNodeFromContentOptions = {
4
4
  slice?: boolean;
@@ -1,3 +1,3 @@
1
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
- import { Predicate, NodeWithPos } from '../types';
2
+ import { NodeWithPos, Predicate } from '../types';
3
3
  export declare function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[];
@@ -1,5 +1,5 @@
1
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
- import { Predicate, Range, NodeWithPos } from '../types';
2
+ import { NodeWithPos, Predicate, Range } from '../types';
3
3
  /**
4
4
  * Same as `findChildren` but searches only within a `range`.
5
5
  */
@@ -1,9 +1,8 @@
1
- /// <reference types="prosemirror-model" />
2
1
  import { Selection } from 'prosemirror-state';
3
2
  import { Predicate } from '../types';
4
3
  export declare function findParentNode(predicate: Predicate): (selection: Selection) => {
5
4
  pos: number;
6
5
  start: number;
7
6
  depth: number;
8
- node: import("prosemirror-model").Node<any>;
7
+ node: import("prosemirror-model").Node;
9
8
  } | undefined;
@@ -1,4 +1,4 @@
1
- import { ResolvedPos, Node as ProseMirrorNode } from 'prosemirror-model';
1
+ import { Node as ProseMirrorNode, ResolvedPos } from 'prosemirror-model';
2
2
  import { Predicate } from '../types';
3
3
  export declare function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): ({
4
4
  pos: number;
@@ -1,4 +1,4 @@
1
- import { Extensions, ExtensionAttribute } from '../types';
1
+ import { ExtensionAttribute, Extensions } from '../types';
2
2
  /**
3
3
  * Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`.
4
4
  * @param extensions List of extensions
@@ -1,2 +1,2 @@
1
- import { AnyExtension, RemoveThis, MaybeThisParameterType } from '../types';
1
+ import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types';
2
2
  export declare function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
@@ -1,2 +1,2 @@
1
- import { Schema, Fragment } from 'prosemirror-model';
1
+ import { Fragment, Schema } from 'prosemirror-model';
2
2
  export declare function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
@@ -1,3 +1,3 @@
1
- import { EditorState } from 'prosemirror-state';
2
1
  import { MarkType } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
3
  export declare function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): Record<string, any>;
@@ -1,3 +1,3 @@
1
- import { EditorState } from 'prosemirror-state';
2
1
  import { NodeType } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
3
  export declare function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): Record<string, any>;
@@ -1,3 +1,3 @@
1
- import { Node, Mark } from 'prosemirror-model';
1
+ import { Mark, Node } from 'prosemirror-model';
2
2
  import { ExtensionAttribute } from '../types';
3
3
  export declare function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
@@ -1,5 +1,5 @@
1
- import { TextSerializer } from '../types';
2
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { TextSerializer } from '../types';
3
3
  export declare function getText(node: ProseMirrorNode, options?: {
4
4
  blockSeparator?: string;
5
5
  textSerializers?: Record<string, TextSerializer>;
@@ -1,5 +1,5 @@
1
- import { Range, TextSerializer } from '../types';
2
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { Range, TextSerializer } from '../types';
3
3
  export declare function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
4
4
  blockSeparator?: string;
5
5
  textSerializers?: Record<string, TextSerializer>;
@@ -0,0 +1,2 @@
1
+ import { ResolvedPos } from 'prosemirror-model';
2
+ export declare const getTextContentFromNodes: ($from: ResolvedPos, maxMatch?: number) => string;
@@ -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';
@@ -1,3 +1,3 @@
1
- import { EditorState } from 'prosemirror-state';
2
1
  import { MarkType } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
3
  export declare function isMarkActive(state: EditorState, typeOrName: MarkType | string | null, attributes?: Record<string, any>): boolean;
@@ -1,3 +1,3 @@
1
- import { EditorState } from 'prosemirror-state';
2
1
  import { NodeType } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
3
  export declare function isNodeActive(state: EditorState, typeOrName: NodeType | string | null, attributes?: Record<string, any>): boolean;
@@ -1,7 +1,7 @@
1
- import { Extensions } from '../types';
2
1
  import { Extension } from '../Extension';
3
- import { Node } from '../Node';
4
2
  import { Mark } from '../Mark';
3
+ import { Node } from '../Node';
4
+ import { Extensions } from '../types';
5
5
  export declare function splitExtensions(extensions: Extensions): {
6
6
  baseExtensions: Extension<any, any>[];
7
7
  nodeExtensions: Node<any, any>[];
@@ -1,57 +1,18 @@
1
- import * as extensions from './extensions';
2
- export { extensions };
1
+ export * from './CommandManager';
3
2
  export * from './Editor';
4
3
  export * from './Extension';
5
- export * from './Node';
4
+ export * as extensions from './extensions';
5
+ export * from './helpers';
6
+ export * from './InputRule';
7
+ export * from './inputRules';
6
8
  export * from './Mark';
9
+ export * from './Node';
7
10
  export * from './NodeView';
8
- export * from './Tracker';
9
- export * from './InputRule';
10
11
  export * from './PasteRule';
11
- export * from './CommandManager';
12
+ export * from './pasteRules';
13
+ export * from './Tracker';
12
14
  export * from './types';
13
- export * from './inputRules/nodeInputRule';
14
- export * from './inputRules/markInputRule';
15
- export * from './inputRules/textblockTypeInputRule';
16
- export * from './inputRules/textInputRule';
17
- export * from './inputRules/wrappingInputRule';
18
- export * from './pasteRules/markPasteRule';
19
- export * from './pasteRules/textPasteRule';
20
- export * from './utilities/callOrReturn';
21
- export * from './utilities/escapeForRegEx';
22
- export * from './utilities/mergeAttributes';
23
- export * from './helpers/combineTransactionSteps';
24
- export * from './helpers/defaultBlockAt';
25
- export * from './helpers/getExtensionField';
26
- export * from './helpers/findChildren';
27
- export * from './helpers/findChildrenInRange';
28
- export * from './helpers/findParentNode';
29
- export * from './helpers/findParentNodeClosestToPos';
30
- export * from './helpers/generateHTML';
31
- export * from './helpers/generateJSON';
32
- export * from './helpers/generateText';
33
- export * from './helpers/getChangedRanges';
34
- export * from './helpers/getSchema';
35
- export * from './helpers/getHTMLFromFragment';
36
- export * from './helpers/getDebugJSON';
37
- export * from './helpers/getAttributes';
38
- export * from './helpers/getMarkAttributes';
39
- export * from './helpers/getMarkRange';
40
- export * from './helpers/getMarkType';
41
- export * from './helpers/getMarksBetween';
42
- export * from './helpers/getNodeAttributes';
43
- export * from './helpers/getNodeType';
44
- export * from './helpers/getText';
45
- export * from './helpers/getTextBetween';
46
- export * from './helpers/getTextSerializersFromSchema';
47
- export * from './helpers/isActive';
48
- export * from './helpers/isList';
49
- export * from './helpers/isMarkActive';
50
- export * from './helpers/isNodeActive';
51
- export * from './helpers/isNodeEmpty';
52
- export * from './helpers/isNodeSelection';
53
- export * from './helpers/isTextSelection';
54
- export * from './helpers/posToDOMRect';
15
+ export * from './utilities';
55
16
  export interface Commands<ReturnType = any> {
56
17
  }
57
18
  export interface ExtensionConfig<Options = any, Storage = any> {
@@ -0,0 +1,5 @@
1
+ export * from './markInputRule';
2
+ export * from './nodeInputRule';
3
+ export * from './textblockTypeInputRule';
4
+ export * from './textInputRule';
5
+ export * from './wrappingInputRule';
@@ -1,5 +1,5 @@
1
- import { InputRule, InputRuleFinder } from '../InputRule';
2
1
  import { MarkType } from 'prosemirror-model';
2
+ import { InputRule, InputRuleFinder } from '../InputRule';
3
3
  import { ExtendedRegExpMatchArray } from '../types';
4
4
  /**
5
5
  * Build an input rule that adds a mark when the
@@ -1,5 +1,5 @@
1
- import { InputRule, InputRuleFinder } from '../InputRule';
2
1
  import { NodeType } from 'prosemirror-model';
2
+ import { InputRule, InputRuleFinder } from '../InputRule';
3
3
  import { ExtendedRegExpMatchArray } from '../types';
4
4
  /**
5
5
  * Build an input rule that changes the type of a textblock when the
@@ -1,5 +1,5 @@
1
+ import { Node as ProseMirrorNode, NodeType } from 'prosemirror-model';
1
2
  import { InputRule, InputRuleFinder } from '../InputRule';
2
- import { NodeType, Node as ProseMirrorNode } from 'prosemirror-model';
3
3
  import { ExtendedRegExpMatchArray } from '../types';
4
4
  /**
5
5
  * Build an input rule for automatically wrapping a textblock when a
@@ -0,0 +1,2 @@
1
+ export * from './markPasteRule';
2
+ export * from './textPasteRule';
@@ -1,5 +1,5 @@
1
- import { PasteRule, PasteRuleFinder } from '../PasteRule';
2
1
  import { MarkType } from 'prosemirror-model';
2
+ import { PasteRule, PasteRuleFinder } from '../PasteRule';
3
3
  import { ExtendedRegExpMatchArray } from '../types';
4
4
  /**
5
5
  * Build an paste rule that adds a mark when the