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

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 (154) hide show
  1. package/dist/packages/core/src/CommandManager.d.ts +1 -1
  2. package/dist/packages/core/src/Editor.d.ts +3 -3
  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 +2 -2
  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/findParentNodeClosestToPos.d.ts +1 -1
  24. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +1 -1
  25. package/dist/packages/core/src/helpers/getExtensionField.d.ts +1 -1
  26. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +1 -1
  27. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +1 -1
  28. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +1 -1
  29. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +1 -1
  30. package/dist/packages/core/src/helpers/getText.d.ts +1 -1
  31. package/dist/packages/core/src/helpers/getTextBetween.d.ts +1 -1
  32. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +2 -0
  33. package/dist/packages/core/src/helpers/index.d.ts +33 -0
  34. package/dist/packages/core/src/helpers/isMarkActive.d.ts +1 -1
  35. package/dist/packages/core/src/helpers/isNodeActive.d.ts +1 -1
  36. package/dist/packages/core/src/helpers/splitExtensions.d.ts +2 -2
  37. package/dist/packages/core/src/index.d.ts +9 -48
  38. package/dist/packages/core/src/inputRules/index.d.ts +5 -0
  39. package/dist/packages/core/src/inputRules/markInputRule.d.ts +1 -1
  40. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +1 -1
  41. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +1 -1
  42. package/dist/packages/core/src/pasteRules/index.d.ts +2 -0
  43. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +1 -1
  44. package/dist/packages/core/src/types.d.ts +6 -5
  45. package/dist/packages/core/src/utilities/index.d.ts +3 -0
  46. package/dist/tiptap-core.cjs.js +3477 -3706
  47. package/dist/tiptap-core.cjs.js.map +1 -1
  48. package/dist/tiptap-core.esm.js +3467 -3697
  49. package/dist/tiptap-core.esm.js.map +1 -1
  50. package/dist/tiptap-core.umd.js +3466 -3695
  51. package/dist/tiptap-core.umd.js.map +1 -1
  52. package/package.json +2 -2
  53. package/src/CommandManager.ts +4 -3
  54. package/src/Editor.ts +14 -13
  55. package/src/Extension.ts +10 -9
  56. package/src/ExtensionManager.ts +11 -10
  57. package/src/InputRule.ts +9 -12
  58. package/src/Mark.ts +11 -10
  59. package/src/Node.ts +11 -10
  60. package/src/NodeView.ts +4 -3
  61. package/src/PasteRule.ts +7 -6
  62. package/src/commands/clearNodes.ts +1 -0
  63. package/src/commands/createParagraphNear.ts +1 -0
  64. package/src/commands/deleteNode.ts +1 -0
  65. package/src/commands/deleteRange.ts +1 -1
  66. package/src/commands/deleteSelection.ts +1 -0
  67. package/src/commands/exitCode.ts +1 -0
  68. package/src/commands/extendMarkRange.ts +4 -3
  69. package/src/commands/focus.ts +3 -3
  70. package/src/commands/index.ts +50 -0
  71. package/src/commands/insertContent.ts +2 -1
  72. package/src/commands/insertContentAt.ts +2 -1
  73. package/src/commands/joinBackward.ts +1 -0
  74. package/src/commands/joinForward.ts +1 -0
  75. package/src/commands/lift.ts +3 -2
  76. package/src/commands/liftEmptyBlock.ts +1 -0
  77. package/src/commands/liftListItem.ts +3 -2
  78. package/src/commands/newlineInCode.ts +1 -0
  79. package/src/commands/resetAttributes.ts +4 -3
  80. package/src/commands/selectNodeBackward.ts +1 -0
  81. package/src/commands/selectNodeForward.ts +1 -0
  82. package/src/commands/selectParentNode.ts +1 -0
  83. package/src/commands/selectTextblockEnd.ts +1 -0
  84. package/src/commands/selectTextblockStart.ts +1 -0
  85. package/src/commands/setContent.ts +3 -2
  86. package/src/commands/setMark.ts +3 -2
  87. package/src/commands/setNode.ts +3 -2
  88. package/src/commands/setNodeSelection.ts +3 -2
  89. package/src/commands/setTextSelection.ts +2 -1
  90. package/src/commands/sinkListItem.ts +3 -2
  91. package/src/commands/splitBlock.ts +3 -2
  92. package/src/commands/splitListItem.ts +5 -4
  93. package/src/commands/toggleList.ts +3 -2
  94. package/src/commands/toggleMark.ts +2 -1
  95. package/src/commands/toggleNode.ts +3 -2
  96. package/src/commands/toggleWrap.ts +3 -2
  97. package/src/commands/unsetMark.ts +3 -2
  98. package/src/commands/updateAttributes.ts +3 -2
  99. package/src/commands/wrapIn.ts +2 -1
  100. package/src/commands/wrapInList.ts +3 -2
  101. package/src/extensions/clipboardTextSerializer.ts +1 -0
  102. package/src/extensions/commands.ts +3 -150
  103. package/src/extensions/editable.ts +1 -0
  104. package/src/extensions/focusEvents.ts +1 -0
  105. package/src/extensions/keymap.ts +3 -2
  106. package/src/extensions/tabindex.ts +1 -0
  107. package/src/helpers/createDocument.ts +2 -1
  108. package/src/helpers/createNodeFromContent.ts +4 -3
  109. package/src/helpers/findChildren.ts +2 -1
  110. package/src/helpers/findChildrenInRange.ts +2 -1
  111. package/src/helpers/findParentNode.ts +2 -1
  112. package/src/helpers/findParentNodeClosestToPos.ts +2 -1
  113. package/src/helpers/generateHTML.ts +3 -2
  114. package/src/helpers/generateJSON.ts +3 -2
  115. package/src/helpers/generateText.ts +3 -2
  116. package/src/helpers/getAttributes.ts +3 -2
  117. package/src/helpers/getAttributesFromExtensions.ts +18 -11
  118. package/src/helpers/getChangedRanges.ts +2 -1
  119. package/src/helpers/getDebugJSON.ts +1 -0
  120. package/src/helpers/getExtensionField.ts +1 -1
  121. package/src/helpers/getHTMLFromFragment.ts +1 -1
  122. package/src/helpers/getMarkAttributes.ts +2 -1
  123. package/src/helpers/getMarkRange.ts +2 -1
  124. package/src/helpers/getMarksBetween.ts +1 -0
  125. package/src/helpers/getNodeAttributes.ts +2 -1
  126. package/src/helpers/getRenderedAttributes.ts +2 -1
  127. package/src/helpers/getSchema.ts +2 -1
  128. package/src/helpers/getSchemaByResolvedExtensions.ts +7 -6
  129. package/src/helpers/getText.ts +2 -1
  130. package/src/helpers/getTextBetween.ts +3 -2
  131. package/src/helpers/getTextContentFromNodes.ts +17 -0
  132. package/src/helpers/getTextSerializersFromSchema.ts +1 -0
  133. package/src/helpers/index.ts +33 -0
  134. package/src/helpers/injectExtensionAttributesToParseRule.ts +1 -0
  135. package/src/helpers/isActive.ts +3 -2
  136. package/src/helpers/isList.ts +3 -3
  137. package/src/helpers/isMarkActive.ts +3 -2
  138. package/src/helpers/isNodeActive.ts +3 -2
  139. package/src/helpers/isNodeSelection.ts +1 -0
  140. package/src/helpers/isTextSelection.ts +1 -0
  141. package/src/helpers/posToDOMRect.ts +1 -0
  142. package/src/helpers/resolveFocusPosition.ts +1 -0
  143. package/src/helpers/selectionToInsertionEnd.ts +1 -1
  144. package/src/helpers/splitExtensions.ts +2 -2
  145. package/src/index.ts +9 -52
  146. package/src/inputRules/index.ts +5 -0
  147. package/src/inputRules/markInputRule.ts +3 -2
  148. package/src/inputRules/nodeInputRule.ts +1 -0
  149. package/src/inputRules/textblockTypeInputRule.ts +2 -1
  150. package/src/inputRules/wrappingInputRule.ts +3 -2
  151. package/src/pasteRules/index.ts +2 -0
  152. package/src/pasteRules/markPasteRule.ts +3 -2
  153. package/src/types.ts +11 -9
  154. package/src/utilities/index.ts +3 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/core",
3
3
  "description": "headless rich text editor",
4
- "version": "2.0.0-beta.176",
4
+ "version": "2.0.0-beta.179",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -45,5 +45,5 @@
45
45
  "directory": "packages/core"
46
46
  },
47
47
  "sideEffects": false,
48
- "gitHead": "1789af864fe36086df487cf8cd3e578b10de1564"
48
+ "gitHead": "591c0807a2ab5c34b4b7fe12c12511fe4f493ebd"
49
49
  }
@@ -1,12 +1,13 @@
1
1
  import { EditorState, Transaction } from 'prosemirror-state'
2
+
2
3
  import { Editor } from './Editor'
3
4
  import { createChainableState } from './helpers/createChainableState'
4
5
  import {
5
- SingleCommands,
6
- ChainedCommands,
7
- CanCommands,
8
6
  AnyCommands,
7
+ CanCommands,
8
+ ChainedCommands,
9
9
  CommandProps,
10
+ SingleCommands,
10
11
  } from './types'
11
12
 
12
13
  export class CommandManager {
package/src/Editor.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { MarkType, NodeType, Schema } from 'prosemirror-model'
1
2
  import {
2
3
  EditorState,
3
4
  Plugin,
@@ -5,31 +6,31 @@ import {
5
6
  Transaction,
6
7
  } from 'prosemirror-state'
7
8
  import { EditorView } from 'prosemirror-view'
8
- import { Schema, MarkType, NodeType } from 'prosemirror-model'
9
- import { getAttributes } from './helpers/getAttributes'
10
- import { isActive } from './helpers/isActive'
9
+
10
+ import { CommandManager } from './CommandManager'
11
+ import { EventEmitter } from './EventEmitter'
12
+ import { ExtensionManager } from './ExtensionManager'
13
+ import * as extensions from './extensions'
11
14
  import { createDocument } from './helpers/createDocument'
15
+ import { getAttributes } from './helpers/getAttributes'
12
16
  import { getHTMLFromFragment } from './helpers/getHTMLFromFragment'
13
17
  import { getText } from './helpers/getText'
18
+ import { getTextSerializersFromSchema } from './helpers/getTextSerializersFromSchema'
19
+ import { isActive } from './helpers/isActive'
14
20
  import { isNodeEmpty } from './helpers/isNodeEmpty'
15
21
  import { resolveFocusPosition } from './helpers/resolveFocusPosition'
16
- import { getTextSerializersFromSchema } from './helpers/getTextSerializersFromSchema'
17
- import { createStyleTag } from './utilities/createStyleTag'
18
- import { isFunction } from './utilities/isFunction'
19
- import { CommandManager } from './CommandManager'
20
- import { ExtensionManager } from './ExtensionManager'
21
- import { EventEmitter } from './EventEmitter'
22
+ import { style } from './style'
22
23
  import {
23
- EditorOptions,
24
24
  CanCommands,
25
25
  ChainedCommands,
26
+ EditorEvents,
27
+ EditorOptions,
26
28
  JSONContent,
27
29
  SingleCommands,
28
30
  TextSerializer,
29
- EditorEvents,
30
31
  } from './types'
31
- import * as extensions from './extensions'
32
- import { style } from './style'
32
+ import { createStyleTag } from './utilities/createStyleTag'
33
+ import { isFunction } from './utilities/isFunction'
33
34
 
34
35
  export { extensions }
35
36
 
package/src/Extension.ts CHANGED
@@ -1,21 +1,22 @@
1
1
  import { Plugin, Transaction } from 'prosemirror-state'
2
- import { InputRule } from './InputRule'
3
- import { PasteRule } from './PasteRule'
2
+
3
+ import { ExtensionConfig } from '.'
4
4
  import { Editor } from './Editor'
5
- import { Node } from './Node'
6
- import { Mark } from './Mark'
7
- import { mergeDeep } from './utilities/mergeDeep'
8
- import { callOrReturn } from './utilities/callOrReturn'
9
5
  import { getExtensionField } from './helpers/getExtensionField'
6
+ import { InputRule } from './InputRule'
7
+ import { Mark } from './Mark'
8
+ import { Node } from './Node'
9
+ import { PasteRule } from './PasteRule'
10
10
  import {
11
11
  AnyConfig,
12
12
  Extensions,
13
13
  GlobalAttributes,
14
- RawCommands,
15
- ParentConfig,
16
14
  KeyboardShortcutCommand,
15
+ ParentConfig,
16
+ RawCommands,
17
17
  } from './types'
18
- import { ExtensionConfig } from '.'
18
+ import { callOrReturn } from './utilities/callOrReturn'
19
+ import { mergeDeep } from './utilities/mergeDeep'
19
20
 
20
21
  declare module '@tiptap/core' {
21
22
  interface ExtensionConfig<Options = any, Storage = any> {
@@ -1,22 +1,23 @@
1
1
  import { keymap } from 'prosemirror-keymap'
2
- import { Schema, Node as ProsemirrorNode } from 'prosemirror-model'
3
- import { inputRulesPlugin } from './InputRule'
4
- import { pasteRulesPlugin } from './PasteRule'
5
- import { EditorView, Decoration } from 'prosemirror-view'
2
+ import { Node as ProsemirrorNode, Schema } from 'prosemirror-model'
6
3
  import { Plugin } from 'prosemirror-state'
4
+ import { Decoration, EditorView } from 'prosemirror-view'
5
+
6
+ import { NodeConfig } from '.'
7
7
  import { Editor } from './Editor'
8
- import { Extensions, RawCommands, AnyConfig } from './types'
8
+ import { getAttributesFromExtensions } from './helpers/getAttributesFromExtensions'
9
9
  import { getExtensionField } from './helpers/getExtensionField'
10
- import { getSchemaByResolvedExtensions } from './helpers/getSchemaByResolvedExtensions'
11
- import { getSchemaTypeByName } from './helpers/getSchemaTypeByName'
12
10
  import { getNodeType } from './helpers/getNodeType'
13
- import { splitExtensions } from './helpers/splitExtensions'
14
- import { getAttributesFromExtensions } from './helpers/getAttributesFromExtensions'
15
11
  import { getRenderedAttributes } from './helpers/getRenderedAttributes'
12
+ import { getSchemaByResolvedExtensions } from './helpers/getSchemaByResolvedExtensions'
13
+ import { getSchemaTypeByName } from './helpers/getSchemaTypeByName'
16
14
  import { isExtensionRulesEnabled } from './helpers/isExtensionRulesEnabled'
15
+ import { splitExtensions } from './helpers/splitExtensions'
16
+ import { inputRulesPlugin } from './InputRule'
17
+ import { pasteRulesPlugin } from './PasteRule'
18
+ import { AnyConfig, Extensions, RawCommands } from './types'
17
19
  import { callOrReturn } from './utilities/callOrReturn'
18
20
  import { findDuplicates } from './utilities/findDuplicates'
19
- import { NodeConfig } from '.'
20
21
 
21
22
  export class ExtensionManager {
22
23
 
package/src/InputRule.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import { EditorState, Plugin, TextSelection } from 'prosemirror-state'
2
- import { Editor } from './Editor'
2
+
3
3
  import { CommandManager } from './CommandManager'
4
+ import { Editor } from './Editor'
4
5
  import { createChainableState } from './helpers/createChainableState'
5
- import { isRegExp } from './utilities/isRegExp'
6
+ import { getTextContentFromNodes } from './helpers/getTextContentFromNodes'
6
7
  import {
7
- Range,
8
+ CanCommands,
9
+ ChainedCommands,
8
10
  ExtendedRegExpMatchArray,
11
+ Range,
9
12
  SingleCommands,
10
- ChainedCommands,
11
- CanCommands,
12
13
  } from './types'
14
+ import { isRegExp } from './utilities/isRegExp'
13
15
 
14
16
  export type InputRuleMatch = {
15
17
  index: number,
@@ -114,13 +116,8 @@ function run(config: {
114
116
  }
115
117
 
116
118
  let matched = false
117
- const maxMatch = 500
118
- const textBefore = $from.parent.textBetween(
119
- Math.max(0, $from.parentOffset - maxMatch),
120
- $from.parentOffset,
121
- undefined,
122
- ' ',
123
- ) + text
119
+
120
+ const textBefore = getTextContentFromNodes($from) + text
124
121
 
125
122
  rules.forEach(rule => {
126
123
  if (matched) {
package/src/Mark.ts CHANGED
@@ -1,27 +1,28 @@
1
1
  import {
2
2
  DOMOutputSpec,
3
- MarkSpec,
4
3
  Mark as ProseMirrorMark,
4
+ MarkSpec,
5
5
  MarkType,
6
6
  } from 'prosemirror-model'
7
7
  import { Plugin, Transaction } from 'prosemirror-state'
8
+
9
+ import { MarkConfig } from '.'
10
+ import { Editor } from './Editor'
11
+ import { getExtensionField } from './helpers/getExtensionField'
8
12
  import { InputRule } from './InputRule'
13
+ import { Node } from './Node'
9
14
  import { PasteRule } from './PasteRule'
10
- import { mergeDeep } from './utilities/mergeDeep'
11
- import { callOrReturn } from './utilities/callOrReturn'
12
- import { getExtensionField } from './helpers/getExtensionField'
13
15
  import {
14
16
  AnyConfig,
15
- Extensions,
16
17
  Attributes,
17
- RawCommands,
18
+ Extensions,
18
19
  GlobalAttributes,
19
- ParentConfig,
20
20
  KeyboardShortcutCommand,
21
+ ParentConfig,
22
+ RawCommands,
21
23
  } from './types'
22
- import { Node } from './Node'
23
- import { MarkConfig } from '.'
24
- import { Editor } from './Editor'
24
+ import { callOrReturn } from './utilities/callOrReturn'
25
+ import { mergeDeep } from './utilities/mergeDeep'
25
26
 
26
27
  declare module '@tiptap/core' {
27
28
  export interface MarkConfig<Options = any, Storage = any> {
package/src/Node.ts CHANGED
@@ -1,27 +1,28 @@
1
1
  import {
2
2
  DOMOutputSpec,
3
- NodeSpec,
4
3
  Node as ProseMirrorNode,
4
+ NodeSpec,
5
5
  NodeType,
6
6
  } from 'prosemirror-model'
7
7
  import { Plugin, Transaction } from 'prosemirror-state'
8
+
9
+ import { NodeConfig } from '.'
10
+ import { Editor } from './Editor'
11
+ import { getExtensionField } from './helpers/getExtensionField'
8
12
  import { InputRule } from './InputRule'
9
13
  import { PasteRule } from './PasteRule'
10
- import { mergeDeep } from './utilities/mergeDeep'
11
- import { callOrReturn } from './utilities/callOrReturn'
12
- import { getExtensionField } from './helpers/getExtensionField'
13
14
  import {
14
15
  AnyConfig,
15
- Extensions,
16
16
  Attributes,
17
- NodeViewRenderer,
17
+ Extensions,
18
18
  GlobalAttributes,
19
- RawCommands,
20
- ParentConfig,
21
19
  KeyboardShortcutCommand,
20
+ NodeViewRenderer,
21
+ ParentConfig,
22
+ RawCommands,
22
23
  } from './types'
23
- import { NodeConfig } from '.'
24
- import { Editor } from './Editor'
24
+ import { callOrReturn } from './utilities/callOrReturn'
25
+ import { mergeDeep } from './utilities/mergeDeep'
25
26
 
26
27
  declare module '@tiptap/core' {
27
28
  interface NodeConfig<Options = any, Storage = any> {
package/src/NodeView.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view'
2
- import { NodeSelection } from 'prosemirror-state'
3
1
  import { Node as ProseMirrorNode } from 'prosemirror-model'
2
+ import { NodeSelection } from 'prosemirror-state'
3
+ import { Decoration, NodeView as ProseMirrorNodeView } from 'prosemirror-view'
4
+
4
5
  import { Editor as CoreEditor } from './Editor'
5
6
  import { Node } from './Node'
7
+ import { NodeViewRendererOptions, NodeViewRendererProps } from './types'
6
8
  import { isiOS } from './utilities/isiOS'
7
- import { NodeViewRendererProps, NodeViewRendererOptions } from './types'
8
9
 
9
10
  export class NodeView<
10
11
  Component,
package/src/PasteRule.ts CHANGED
@@ -1,16 +1,17 @@
1
1
  import { EditorState, Plugin } from 'prosemirror-state'
2
- import { Editor } from './Editor'
2
+
3
3
  import { CommandManager } from './CommandManager'
4
+ import { Editor } from './Editor'
4
5
  import { createChainableState } from './helpers/createChainableState'
5
- import { isRegExp } from './utilities/isRegExp'
6
- import { isNumber } from './utilities/isNumber'
7
6
  import {
8
- Range,
7
+ CanCommands,
8
+ ChainedCommands,
9
9
  ExtendedRegExpMatchArray,
10
+ Range,
10
11
  SingleCommands,
11
- ChainedCommands,
12
- CanCommands,
13
12
  } from './types'
13
+ import { isNumber } from './utilities/isNumber'
14
+ import { isRegExp } from './utilities/isRegExp'
14
15
 
15
16
  export type PasteRuleMatch = {
16
17
  index: number,
@@ -1,4 +1,5 @@
1
1
  import { liftTarget } from 'prosemirror-transform'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,4 +1,5 @@
1
1
  import { createParagraphNear as originalCreateParagraphNear } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,4 +1,5 @@
1
1
  import { NodeType } from 'prosemirror-model'
2
+
2
3
  import { getNodeType } from '../helpers/getNodeType'
3
4
  import { RawCommands } from '../types'
4
5
 
@@ -1,4 +1,4 @@
1
- import { RawCommands, Range } from '../types'
1
+ import { Range, RawCommands } from '../types'
2
2
 
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
@@ -1,4 +1,5 @@
1
1
  import { deleteSelection as originalDeleteSelection } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,4 +1,5 @@
1
1
  import { exitCode as originalExitCode } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,8 +1,9 @@
1
- import { TextSelection } from 'prosemirror-state'
2
1
  import { MarkType } from 'prosemirror-model'
3
- import { RawCommands } from '../types'
4
- import { getMarkType } from '../helpers/getMarkType'
2
+ import { TextSelection } from 'prosemirror-state'
3
+
5
4
  import { getMarkRange } from '../helpers/getMarkRange'
5
+ import { getMarkType } from '../helpers/getMarkType'
6
+ import { RawCommands } from '../types'
6
7
 
7
8
  declare module '@tiptap/core' {
8
9
  interface Commands<ReturnType> {
@@ -1,7 +1,7 @@
1
- import { RawCommands, FocusPosition } from '../types'
2
1
  import { isTextSelection } from '../helpers/isTextSelection'
3
- import { isiOS } from '../utilities/isiOS'
4
2
  import { resolveFocusPosition } from '../helpers/resolveFocusPosition'
3
+ import { FocusPosition, RawCommands } from '../types'
4
+ import { isiOS } from '../utilities/isiOS'
5
5
 
6
6
  declare module '@tiptap/core' {
7
7
  interface Commands<ReturnType> {
@@ -19,7 +19,7 @@ declare module '@tiptap/core' {
19
19
  }
20
20
  }
21
21
 
22
- export const focus: RawCommands['focus'] = (position = null, options) => ({
22
+ export const focus: RawCommands['focus'] = (position = null, options = {}) => ({
23
23
  editor,
24
24
  view,
25
25
  tr,
@@ -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,6 @@
1
1
  import { ParseOptions } from 'prosemirror-model'
2
- import { RawCommands, Content } from '../types'
2
+
3
+ import { Content, RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
5
6
  interface Commands<ReturnType> {
@@ -1,10 +1,11 @@
1
1
  import { Fragment, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model'
2
+
2
3
  import { createNodeFromContent } from '../helpers/createNodeFromContent'
3
4
  import { selectionToInsertionEnd } from '../helpers/selectionToInsertionEnd'
4
5
  import {
5
- RawCommands,
6
6
  Content,
7
7
  Range,
8
+ RawCommands,
8
9
  } from '../types'
9
10
 
10
11
  declare module '@tiptap/core' {
@@ -1,4 +1,5 @@
1
1
  import { joinBackward as originalJoinBackward } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,4 +1,5 @@
1
1
  import { joinForward as originalJoinForward } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,8 +1,9 @@
1
1
  import { lift as originalLift } from 'prosemirror-commands'
2
2
  import { NodeType } from 'prosemirror-model'
3
- import { RawCommands } from '../types'
4
- import { isNodeActive } from '../helpers/isNodeActive'
3
+
5
4
  import { getNodeType } from '../helpers/getNodeType'
5
+ import { isNodeActive } from '../helpers/isNodeActive'
6
+ import { RawCommands } from '../types'
6
7
 
7
8
  declare module '@tiptap/core' {
8
9
  interface Commands<ReturnType> {
@@ -1,4 +1,5 @@
1
1
  import { liftEmptyBlock as originalLiftEmptyBlock } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,7 +1,8 @@
1
- import { liftListItem as originalLiftListItem } from 'prosemirror-schema-list'
2
1
  import { NodeType } from 'prosemirror-model'
3
- import { RawCommands } from '../types'
2
+ import { liftListItem as originalLiftListItem } from 'prosemirror-schema-list'
3
+
4
4
  import { getNodeType } from '../helpers/getNodeType'
5
+ import { RawCommands } from '../types'
5
6
 
6
7
  declare module '@tiptap/core' {
7
8
  interface Commands<ReturnType> {
@@ -1,4 +1,5 @@
1
1
  import { newlineInCode as originalNewlineInCode } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,9 +1,10 @@
1
- import { NodeType, MarkType } from 'prosemirror-model'
2
- import { getNodeType } from '../helpers/getNodeType'
1
+ import { MarkType, NodeType } from 'prosemirror-model'
2
+
3
3
  import { getMarkType } from '../helpers/getMarkType'
4
+ import { getNodeType } from '../helpers/getNodeType'
4
5
  import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName'
5
- import { deleteProps } from '../utilities/deleteProps'
6
6
  import { RawCommands } from '../types'
7
+ import { deleteProps } from '../utilities/deleteProps'
7
8
 
8
9
  declare module '@tiptap/core' {
9
10
  interface Commands<ReturnType> {
@@ -1,4 +1,5 @@
1
1
  import { selectNodeBackward as originalSelectNodeBackward } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,4 +1,5 @@
1
1
  import { selectNodeForward as originalSelectNodeForward } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,4 +1,5 @@
1
1
  import { selectParentNode as originalSelectParentNode } from 'prosemirror-commands'
2
+
2
3
  import { RawCommands } from '../types'
3
4
 
4
5
  declare module '@tiptap/core' {
@@ -1,6 +1,7 @@
1
1
  // @ts-ignore
2
2
  // TODO: add types to @types/prosemirror-commands
3
3
  import { selectTextblockEnd as originalSelectTextblockEnd } from 'prosemirror-commands'
4
+
4
5
  import { RawCommands } from '../types'
5
6
 
6
7
  declare module '@tiptap/core' {
@@ -1,6 +1,7 @@
1
1
  // @ts-ignore
2
2
  // TODO: add types to @types/prosemirror-commands
3
3
  import { selectTextblockStart as originalSelectTextblockStart } from 'prosemirror-commands'
4
+
4
5
  import { RawCommands } from '../types'
5
6
 
6
7
  declare module '@tiptap/core' {
@@ -1,7 +1,8 @@
1
- import { TextSelection } from 'prosemirror-state'
2
1
  import { ParseOptions } from 'prosemirror-model'
2
+ import { TextSelection } from 'prosemirror-state'
3
+
3
4
  import { createDocument } from '../helpers/createDocument'
4
- import { RawCommands, Content } from '../types'
5
+ import { Content, RawCommands } from '../types'
5
6
 
6
7
  declare module '@tiptap/core' {
7
8
  interface Commands<ReturnType> {
@@ -1,7 +1,8 @@
1
1
  import { MarkType } from 'prosemirror-model'
2
- import { RawCommands } from '../types'
3
- import { getMarkType } from '../helpers/getMarkType'
2
+
4
3
  import { getMarkAttributes } from '../helpers/getMarkAttributes'
4
+ import { getMarkType } from '../helpers/getMarkType'
5
+ import { RawCommands } from '../types'
5
6
 
6
7
  declare module '@tiptap/core' {
7
8
  interface Commands<ReturnType> {
@@ -1,7 +1,8 @@
1
- import { NodeType } from 'prosemirror-model'
2
1
  import { setBlockType } from 'prosemirror-commands'
3
- import { RawCommands } from '../types'
2
+ import { NodeType } from 'prosemirror-model'
3
+
4
4
  import { getNodeType } from '../helpers/getNodeType'
5
+ import { RawCommands } from '../types'
5
6
 
6
7
  declare module '@tiptap/core' {
7
8
  interface Commands<ReturnType> {
@@ -1,6 +1,7 @@
1
- import { Selection, NodeSelection } from 'prosemirror-state'
2
- import { minMax } from '../utilities/minMax'
1
+ import { NodeSelection, Selection } from 'prosemirror-state'
2
+
3
3
  import { RawCommands } from '../types'
4
+ import { minMax } from '../utilities/minMax'
4
5
 
5
6
  declare module '@tiptap/core' {
6
7
  interface Commands<ReturnType> {
@@ -1,6 +1,7 @@
1
1
  import { TextSelection } from 'prosemirror-state'
2
+
3
+ import { Range, RawCommands } from '../types'
2
4
  import { minMax } from '../utilities/minMax'
3
- import { RawCommands, Range } from '../types'
4
5
 
5
6
  declare module '@tiptap/core' {
6
7
  interface Commands<ReturnType> {
@@ -1,7 +1,8 @@
1
- import { sinkListItem as originalSinkListItem } from 'prosemirror-schema-list'
2
1
  import { NodeType } from 'prosemirror-model'
3
- import { RawCommands } from '../types'
2
+ import { sinkListItem as originalSinkListItem } from 'prosemirror-schema-list'
3
+
4
4
  import { getNodeType } from '../helpers/getNodeType'
5
+ import { RawCommands } from '../types'
5
6
 
6
7
  declare module '@tiptap/core' {
7
8
  interface Commands<ReturnType> {