@tiptap/core 3.0.0-next.6 → 3.0.0-next.7

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 (138) hide show
  1. package/dist/index.cjs +48 -13
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +32 -17
  4. package/dist/index.d.ts +32 -17
  5. package/dist/index.js +74 -39
  6. package/dist/index.js.map +1 -1
  7. package/package.json +2 -2
  8. package/src/CommandManager.ts +3 -3
  9. package/src/Editor.ts +30 -15
  10. package/src/Extendable.ts +10 -9
  11. package/src/Extension.ts +17 -1
  12. package/src/ExtensionManager.ts +8 -6
  13. package/src/InputRule.ts +6 -4
  14. package/src/Mark.ts +13 -1
  15. package/src/MarkView.ts +3 -3
  16. package/src/Node.ts +13 -1
  17. package/src/NodePos.ts +3 -3
  18. package/src/NodeView.ts +3 -3
  19. package/src/PasteRule.ts +6 -4
  20. package/src/Tracker.ts +1 -1
  21. package/src/commands/blur.ts +1 -1
  22. package/src/commands/clearContent.ts +1 -1
  23. package/src/commands/clearNodes.ts +1 -1
  24. package/src/commands/command.ts +1 -1
  25. package/src/commands/createParagraphNear.ts +1 -1
  26. package/src/commands/cut.ts +1 -1
  27. package/src/commands/deleteCurrentNode.ts +1 -1
  28. package/src/commands/deleteNode.ts +2 -2
  29. package/src/commands/deleteRange.ts +1 -1
  30. package/src/commands/deleteSelection.ts +1 -1
  31. package/src/commands/enter.ts +1 -1
  32. package/src/commands/exitCode.ts +1 -1
  33. package/src/commands/extendMarkRange.ts +2 -2
  34. package/src/commands/first.ts +1 -1
  35. package/src/commands/focus.ts +1 -1
  36. package/src/commands/forEach.ts +1 -1
  37. package/src/commands/insertContent.ts +2 -2
  38. package/src/commands/insertContentAt.ts +3 -2
  39. package/src/commands/join.ts +1 -1
  40. package/src/commands/joinItemBackward.ts +1 -1
  41. package/src/commands/joinItemForward.ts +1 -1
  42. package/src/commands/joinTextblockBackward.ts +1 -1
  43. package/src/commands/joinTextblockForward.ts +1 -1
  44. package/src/commands/keyboardShortcut.ts +1 -1
  45. package/src/commands/lift.ts +2 -2
  46. package/src/commands/liftEmptyBlock.ts +1 -1
  47. package/src/commands/liftListItem.ts +2 -2
  48. package/src/commands/newlineInCode.ts +1 -1
  49. package/src/commands/resetAttributes.ts +2 -2
  50. package/src/commands/scrollIntoView.ts +1 -1
  51. package/src/commands/selectAll.ts +1 -1
  52. package/src/commands/selectNodeBackward.ts +1 -1
  53. package/src/commands/selectNodeForward.ts +1 -1
  54. package/src/commands/selectParentNode.ts +1 -1
  55. package/src/commands/selectTextblockEnd.ts +1 -1
  56. package/src/commands/selectTextblockStart.ts +1 -1
  57. package/src/commands/setContent.ts +2 -2
  58. package/src/commands/setMark.ts +3 -3
  59. package/src/commands/setMeta.ts +1 -1
  60. package/src/commands/setNode.ts +2 -2
  61. package/src/commands/setNodeSelection.ts +1 -1
  62. package/src/commands/setTextSelection.ts +1 -1
  63. package/src/commands/sinkListItem.ts +2 -2
  64. package/src/commands/splitBlock.ts +3 -2
  65. package/src/commands/splitListItem.ts +3 -2
  66. package/src/commands/toggleList.ts +3 -3
  67. package/src/commands/toggleMark.ts +2 -2
  68. package/src/commands/toggleNode.ts +2 -2
  69. package/src/commands/toggleWrap.ts +2 -2
  70. package/src/commands/undoInputRule.ts +1 -1
  71. package/src/commands/unsetAllMarks.ts +1 -1
  72. package/src/commands/unsetMark.ts +2 -2
  73. package/src/commands/updateAttributes.ts +3 -3
  74. package/src/commands/wrapIn.ts +2 -2
  75. package/src/commands/wrapInList.ts +2 -2
  76. package/src/extensions/focusEvents.ts +3 -1
  77. package/src/extensions/index.ts +1 -1
  78. package/src/helpers/combineTransactionSteps.ts +2 -2
  79. package/src/helpers/createChainableState.ts +1 -1
  80. package/src/helpers/createDocument.ts +2 -2
  81. package/src/helpers/createNodeFromContent.ts +3 -2
  82. package/src/helpers/defaultBlockAt.ts +1 -1
  83. package/src/helpers/findChildren.ts +2 -2
  84. package/src/helpers/findChildrenInRange.ts +2 -2
  85. package/src/helpers/findParentNode.ts +2 -2
  86. package/src/helpers/findParentNodeClosestToPos.ts +2 -2
  87. package/src/helpers/flattenExtensions.ts +1 -1
  88. package/src/helpers/generateHTML.ts +1 -1
  89. package/src/helpers/generateJSON.ts +1 -1
  90. package/src/helpers/generateText.ts +1 -1
  91. package/src/helpers/getAttributes.ts +2 -2
  92. package/src/helpers/getAttributesFromExtensions.ts +1 -1
  93. package/src/helpers/getChangedRanges.ts +2 -2
  94. package/src/helpers/getDebugJSON.ts +2 -2
  95. package/src/helpers/getExtensionField.ts +4 -4
  96. package/src/helpers/getHTMLFromFragment.ts +2 -1
  97. package/src/helpers/getMarkAttributes.ts +2 -2
  98. package/src/helpers/getMarkRange.ts +2 -2
  99. package/src/helpers/getMarkType.ts +1 -1
  100. package/src/helpers/getMarksBetween.ts +2 -2
  101. package/src/helpers/getNodeAtPosition.ts +2 -2
  102. package/src/helpers/getNodeAttributes.ts +2 -2
  103. package/src/helpers/getNodeType.ts +1 -1
  104. package/src/helpers/getRenderedAttributes.ts +2 -2
  105. package/src/helpers/getSchema.ts +3 -3
  106. package/src/helpers/getSchemaByResolvedExtensions.ts +3 -2
  107. package/src/helpers/getSchemaTypeByName.ts +1 -1
  108. package/src/helpers/getSchemaTypeNameByName.ts +1 -1
  109. package/src/helpers/getSplittedAttributes.ts +1 -1
  110. package/src/helpers/getText.ts +2 -2
  111. package/src/helpers/getTextBetween.ts +2 -2
  112. package/src/helpers/getTextContentFromNodes.ts +1 -1
  113. package/src/helpers/getTextSerializersFromSchema.ts +2 -2
  114. package/src/helpers/injectExtensionAttributesToParseRule.ts +2 -2
  115. package/src/helpers/isActive.ts +1 -1
  116. package/src/helpers/isAtEndOfNode.ts +1 -1
  117. package/src/helpers/isAtStartOfNode.ts +1 -1
  118. package/src/helpers/isExtensionRulesEnabled.ts +1 -1
  119. package/src/helpers/isList.ts +1 -1
  120. package/src/helpers/isMarkActive.ts +3 -3
  121. package/src/helpers/isNodeActive.ts +3 -3
  122. package/src/helpers/isNodeEmpty.ts +1 -1
  123. package/src/helpers/posToDOMRect.ts +1 -1
  124. package/src/helpers/resolveExtensions.ts +1 -1
  125. package/src/helpers/resolveFocusPosition.ts +2 -2
  126. package/src/helpers/selectionToInsertionEnd.ts +2 -1
  127. package/src/helpers/sortExtensions.ts +1 -1
  128. package/src/helpers/splitExtensions.ts +4 -4
  129. package/src/inputRules/markInputRule.ts +4 -3
  130. package/src/inputRules/nodeInputRule.ts +4 -3
  131. package/src/inputRules/textInputRule.ts +2 -1
  132. package/src/inputRules/textblockTypeInputRule.ts +4 -3
  133. package/src/inputRules/wrappingInputRule.ts +5 -4
  134. package/src/pasteRules/markPasteRule.ts +4 -3
  135. package/src/pasteRules/nodePasteRule.ts +4 -3
  136. package/src/pasteRules/textPasteRule.ts +2 -1
  137. package/src/types.ts +10 -10
  138. package/src/utilities/callOrReturn.ts +1 -1
@@ -1,9 +1,9 @@
1
- import { MarkType, NodeType } from '@tiptap/pm/model'
1
+ import type { MarkType, NodeType } from '@tiptap/pm/model'
2
2
 
3
3
  import { getMarkType } from '../helpers/getMarkType.js'
4
4
  import { getNodeType } from '../helpers/getNodeType.js'
5
5
  import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js'
6
- import { RawCommands } from '../types.js'
6
+ import type { RawCommands } from '../types.js'
7
7
  import { deleteProps } from '../utilities/deleteProps.js'
8
8
 
9
9
  declare module '@tiptap/core' {
@@ -1,4 +1,4 @@
1
- import { RawCommands } from '../types.js'
1
+ import type { RawCommands } from '../types.js'
2
2
 
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
@@ -1,6 +1,6 @@
1
1
  import { AllSelection } from '@tiptap/pm/state'
2
2
 
3
- import { RawCommands } from '../types.js'
3
+ import type { RawCommands } from '../types.js'
4
4
 
5
5
  declare module '@tiptap/core' {
6
6
  interface Commands<ReturnType> {
@@ -1,6 +1,6 @@
1
1
  import { selectNodeBackward as originalSelectNodeBackward } from '@tiptap/pm/commands'
2
2
 
3
- import { RawCommands } from '../types.js'
3
+ import type { RawCommands } from '../types.js'
4
4
 
5
5
  declare module '@tiptap/core' {
6
6
  interface Commands<ReturnType> {
@@ -1,6 +1,6 @@
1
1
  import { selectNodeForward as originalSelectNodeForward } from '@tiptap/pm/commands'
2
2
 
3
- import { RawCommands } from '../types.js'
3
+ import type { RawCommands } from '../types.js'
4
4
 
5
5
  declare module '@tiptap/core' {
6
6
  interface Commands<ReturnType> {
@@ -1,6 +1,6 @@
1
1
  import { selectParentNode as originalSelectParentNode } from '@tiptap/pm/commands'
2
2
 
3
- import { RawCommands } from '../types.js'
3
+ import type { RawCommands } from '../types.js'
4
4
 
5
5
  declare module '@tiptap/core' {
6
6
  interface Commands<ReturnType> {
@@ -2,7 +2,7 @@
2
2
  // TODO: add types to @types/prosemirror-commands
3
3
  import { selectTextblockEnd as originalSelectTextblockEnd } from '@tiptap/pm/commands'
4
4
 
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -2,7 +2,7 @@
2
2
  // TODO: add types to @types/prosemirror-commands
3
3
  import { selectTextblockStart as originalSelectTextblockStart } from '@tiptap/pm/commands'
4
4
 
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,7 +1,7 @@
1
- import { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model'
1
+ import type { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model'
2
2
 
3
3
  import { createDocument } from '../helpers/createDocument.js'
4
- import { Content, RawCommands } from '../types.js'
4
+ import type { Content, RawCommands } from '../types.js'
5
5
 
6
6
  declare module '@tiptap/core' {
7
7
  interface Commands<ReturnType> {
@@ -1,10 +1,10 @@
1
- import { MarkType, ResolvedPos } from '@tiptap/pm/model'
2
- import { EditorState, Transaction } from '@tiptap/pm/state'
1
+ import type { MarkType, ResolvedPos } from '@tiptap/pm/model'
2
+ import type { EditorState, Transaction } from '@tiptap/pm/state'
3
3
 
4
4
  import { getMarkAttributes } from '../helpers/getMarkAttributes.js'
5
5
  import { getMarkType } from '../helpers/getMarkType.js'
6
6
  import { isTextSelection } from '../helpers/index.js'
7
- import { RawCommands } from '../types.js'
7
+ import type { RawCommands } from '../types.js'
8
8
 
9
9
  declare module '@tiptap/core' {
10
10
  interface Commands<ReturnType> {
@@ -1,6 +1,6 @@
1
1
  import type { Plugin, PluginKey } from '@tiptap/pm/state'
2
2
 
3
- import { RawCommands } from '../types.js'
3
+ import type { RawCommands } from '../types.js'
4
4
 
5
5
  declare module '@tiptap/core' {
6
6
  interface Commands<ReturnType> {
@@ -1,8 +1,8 @@
1
1
  import { setBlockType } from '@tiptap/pm/commands'
2
- import { NodeType } from '@tiptap/pm/model'
2
+ import type { NodeType } from '@tiptap/pm/model'
3
3
 
4
4
  import { getNodeType } from '../helpers/getNodeType.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,6 +1,6 @@
1
1
  import { NodeSelection } from '@tiptap/pm/state'
2
2
 
3
- import { RawCommands } from '../types.js'
3
+ import type { RawCommands } from '../types.js'
4
4
  import { minMax } from '../utilities/minMax.js'
5
5
 
6
6
  declare module '@tiptap/core' {
@@ -1,6 +1,6 @@
1
1
  import { TextSelection } from '@tiptap/pm/state'
2
2
 
3
- import { Range, RawCommands } from '../types.js'
3
+ import type { Range, RawCommands } from '../types.js'
4
4
  import { minMax } from '../utilities/minMax.js'
5
5
 
6
6
  declare module '@tiptap/core' {
@@ -1,8 +1,8 @@
1
- import { NodeType } from '@tiptap/pm/model'
1
+ import type { NodeType } from '@tiptap/pm/model'
2
2
  import { sinkListItem as originalSinkListItem } from '@tiptap/pm/schema-list'
3
3
 
4
4
  import { getNodeType } from '../helpers/getNodeType.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,9 +1,10 @@
1
- import { EditorState, NodeSelection, TextSelection } from '@tiptap/pm/state'
1
+ import type { EditorState } from '@tiptap/pm/state'
2
+ import { NodeSelection, TextSelection } from '@tiptap/pm/state'
2
3
  import { canSplit } from '@tiptap/pm/transform'
3
4
 
4
5
  import { defaultBlockAt } from '../helpers/defaultBlockAt.js'
5
6
  import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js'
6
- import { RawCommands } from '../types.js'
7
+ import type { RawCommands } from '../types.js'
7
8
 
8
9
  function ensureMarks(state: EditorState, splittableMarks?: string[]) {
9
10
  const marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks())
@@ -1,10 +1,11 @@
1
- import { Fragment, Node as ProseMirrorNode, NodeType, Slice } from '@tiptap/pm/model'
1
+ import type { Node as ProseMirrorNode, NodeType } from '@tiptap/pm/model'
2
+ import { Fragment, Slice } from '@tiptap/pm/model'
2
3
  import { TextSelection } from '@tiptap/pm/state'
3
4
  import { canSplit } from '@tiptap/pm/transform'
4
5
 
5
6
  import { getNodeType } from '../helpers/getNodeType.js'
6
7
  import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js'
7
- import { RawCommands } from '../types.js'
8
+ import type { RawCommands } from '../types.js'
8
9
 
9
10
  declare module '@tiptap/core' {
10
11
  interface Commands<ReturnType> {
@@ -1,11 +1,11 @@
1
- import { NodeType } from '@tiptap/pm/model'
2
- import { Transaction } from '@tiptap/pm/state'
1
+ import type { NodeType } from '@tiptap/pm/model'
2
+ import type { Transaction } from '@tiptap/pm/state'
3
3
  import { canJoin } from '@tiptap/pm/transform'
4
4
 
5
5
  import { findParentNode } from '../helpers/findParentNode.js'
6
6
  import { getNodeType } from '../helpers/getNodeType.js'
7
7
  import { isList } from '../helpers/isList.js'
8
- import { RawCommands } from '../types.js'
8
+ import type { RawCommands } from '../types.js'
9
9
 
10
10
  const joinListBackwards = (tr: Transaction, listType: NodeType): boolean => {
11
11
  const list = findParentNode(node => node.type === listType)(tr.selection)
@@ -1,8 +1,8 @@
1
- import { MarkType } from '@tiptap/pm/model'
1
+ import type { MarkType } from '@tiptap/pm/model'
2
2
 
3
3
  import { getMarkType } from '../helpers/getMarkType.js'
4
4
  import { isMarkActive } from '../helpers/isMarkActive.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,8 +1,8 @@
1
- import { NodeType } from '@tiptap/pm/model'
1
+ import type { NodeType } from '@tiptap/pm/model'
2
2
 
3
3
  import { getNodeType } from '../helpers/getNodeType.js'
4
4
  import { isNodeActive } from '../helpers/isNodeActive.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,8 +1,8 @@
1
- import { NodeType } from '@tiptap/pm/model'
1
+ import type { NodeType } from '@tiptap/pm/model'
2
2
 
3
3
  import { getNodeType } from '../helpers/getNodeType.js'
4
4
  import { isNodeActive } from '../helpers/isNodeActive.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,4 +1,4 @@
1
- import { RawCommands } from '../types.js'
1
+ import type { RawCommands } from '../types.js'
2
2
 
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
@@ -1,4 +1,4 @@
1
- import { RawCommands } from '../types.js'
1
+ import type { RawCommands } from '../types.js'
2
2
 
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
@@ -1,8 +1,8 @@
1
- import { MarkType } from '@tiptap/pm/model'
1
+ import type { MarkType } from '@tiptap/pm/model'
2
2
 
3
3
  import { getMarkRange } from '../helpers/getMarkRange.js'
4
4
  import { getMarkType } from '../helpers/getMarkType.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,10 +1,10 @@
1
- import { Mark, MarkType, Node, NodeType } from '@tiptap/pm/model'
2
- import { SelectionRange } from '@tiptap/pm/state'
1
+ import type { Mark, MarkType, Node, NodeType } from '@tiptap/pm/model'
2
+ import type { SelectionRange } from '@tiptap/pm/state'
3
3
 
4
4
  import { getMarkType } from '../helpers/getMarkType.js'
5
5
  import { getNodeType } from '../helpers/getNodeType.js'
6
6
  import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js'
7
- import { RawCommands } from '../types.js'
7
+ import type { RawCommands } from '../types.js'
8
8
 
9
9
  declare module '@tiptap/core' {
10
10
  interface Commands<ReturnType> {
@@ -1,8 +1,8 @@
1
1
  import { wrapIn as originalWrapIn } from '@tiptap/pm/commands'
2
- import { NodeType } from '@tiptap/pm/model'
2
+ import type { NodeType } from '@tiptap/pm/model'
3
3
 
4
4
  import { getNodeType } from '../helpers/getNodeType.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -1,8 +1,8 @@
1
- import { NodeType } from '@tiptap/pm/model'
1
+ import type { NodeType } from '@tiptap/pm/model'
2
2
  import { wrapInList as originalWrapInList } from '@tiptap/pm/schema-list'
3
3
 
4
4
  import { getNodeType } from '../helpers/getNodeType.js'
5
- import { RawCommands } from '../types.js'
5
+ import type { RawCommands } from '../types.js'
6
6
 
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands<ReturnType> {
@@ -2,6 +2,8 @@ import { Plugin, PluginKey } from '@tiptap/pm/state'
2
2
 
3
3
  import { Extension } from '../Extension.js'
4
4
 
5
+ export const focusEventsPluginKey = new PluginKey('focusEvents')
6
+
5
7
  export const FocusEvents = Extension.create({
6
8
  name: 'focusEvents',
7
9
 
@@ -10,7 +12,7 @@ export const FocusEvents = Extension.create({
10
12
 
11
13
  return [
12
14
  new Plugin({
13
- key: new PluginKey('focusEvents'),
15
+ key: focusEventsPluginKey,
14
16
  props: {
15
17
  handleDOMEvents: {
16
18
  focus: (view, event: Event) => {
@@ -3,7 +3,7 @@ export { Commands } from './commands.js'
3
3
  export { Delete } from './delete.js'
4
4
  export { Drop } from './drop.js'
5
5
  export { Editable } from './editable.js'
6
- export { FocusEvents } from './focusEvents.js'
6
+ export { FocusEvents, focusEventsPluginKey } from './focusEvents.js'
7
7
  export { Keymap } from './keymap.js'
8
8
  export { Paste } from './paste.js'
9
9
  export { Tabindex } from './tabindex.js'
@@ -1,5 +1,5 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model'
2
- import { Transaction } from '@tiptap/pm/state'
1
+ import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
2
+ import type { Transaction } from '@tiptap/pm/state'
3
3
  import { Transform } from '@tiptap/pm/transform'
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { EditorState, Transaction } from '@tiptap/pm/state'
1
+ import type { EditorState, Transaction } from '@tiptap/pm/state'
2
2
 
3
3
  /**
4
4
  * Takes a Transaction & Editor State and turns it into a chainable state object
@@ -1,6 +1,6 @@
1
- import { Fragment, Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model'
1
+ import type { Fragment, Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model'
2
2
 
3
- import { Content } from '../types.js'
3
+ import type { Content } from '../types.js'
4
4
  import { createNodeFromContent } from './createNodeFromContent.js'
5
5
 
6
6
  /**
@@ -1,6 +1,7 @@
1
- import { DOMParser, Fragment, Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model'
1
+ import type { ParseOptions } from '@tiptap/pm/model'
2
+ import { DOMParser, Fragment, Node as ProseMirrorNode, Schema } from '@tiptap/pm/model'
2
3
 
3
- import { Content } from '../types.js'
4
+ import type { Content } from '../types.js'
4
5
  import { elementFromString } from '../utilities/elementFromString.js'
5
6
 
6
7
  export type CreateNodeFromContentOptions = {
@@ -1,4 +1,4 @@
1
- import { ContentMatch, NodeType } from '@tiptap/pm/model'
1
+ import type { ContentMatch, NodeType } from '@tiptap/pm/model'
2
2
 
3
3
  /**
4
4
  * Gets the default block type at a given match
@@ -1,6 +1,6 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model'
1
+ import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
2
2
 
3
- import { NodeWithPos, Predicate } from '../types.js'
3
+ import type { NodeWithPos, Predicate } from '../types.js'
4
4
 
5
5
  /**
6
6
  * Find children inside a Prosemirror node that match a predicate.
@@ -1,6 +1,6 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model'
1
+ import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
2
2
 
3
- import { NodeWithPos, Predicate, Range } from '../types.js'
3
+ import type { NodeWithPos, Predicate, Range } from '../types.js'
4
4
 
5
5
  /**
6
6
  * Same as `findChildren` but searches only within a `range`.
@@ -1,6 +1,6 @@
1
- import { Selection } from '@tiptap/pm/state'
1
+ import type { Selection } from '@tiptap/pm/state'
2
2
 
3
- import { Predicate } from '../types.js'
3
+ import type { Predicate } from '../types.js'
4
4
  import { findParentNodeClosestToPos } from './findParentNodeClosestToPos.js'
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model'
1
+ import type { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model'
2
2
 
3
- import { Predicate } from '../types.js'
3
+ import type { Predicate } from '../types.js'
4
4
 
5
5
  /**
6
6
  * Finds the closest parent node to a resolved position that matches a predicate.
@@ -1,4 +1,4 @@
1
- import { AnyConfig, Extensions } from '../types.js'
1
+ import type { AnyConfig, Extensions } from '../types.js'
2
2
  import { getExtensionField } from './getExtensionField.js'
3
3
 
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { Node } from '@tiptap/pm/model'
2
2
 
3
- import { Extensions, JSONContent } from '../types.js'
3
+ import type { Extensions, JSONContent } from '../types.js'
4
4
  import { getHTMLFromFragment } from './getHTMLFromFragment.js'
5
5
  import { getSchema } from './getSchema.js'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { DOMParser } from '@tiptap/pm/model'
2
2
 
3
- import { Extensions } from '../types.js'
3
+ import type { Extensions } from '../types.js'
4
4
  import { elementFromString } from '../utilities/elementFromString.js'
5
5
  import { getSchema } from './getSchema.js'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { Node } from '@tiptap/pm/model'
2
2
 
3
- import { Extensions, JSONContent, TextSerializer } from '../types.js'
3
+ import type { Extensions, JSONContent, TextSerializer } from '../types.js'
4
4
  import { getSchema } from './getSchema.js'
5
5
  import { getText } from './getText.js'
6
6
  import { getTextSerializersFromSchema } from './getTextSerializersFromSchema.js'
@@ -1,5 +1,5 @@
1
- import { MarkType, NodeType } from '@tiptap/pm/model'
2
- import { EditorState } from '@tiptap/pm/state'
1
+ import type { MarkType, NodeType } from '@tiptap/pm/model'
2
+ import type { EditorState } from '@tiptap/pm/state'
3
3
 
4
4
  import { getMarkAttributes } from './getMarkAttributes.js'
5
5
  import { getNodeAttributes } from './getNodeAttributes.js'
@@ -1,5 +1,5 @@
1
1
  import type { MarkConfig, NodeConfig } from '../index.js'
2
- import { AnyConfig, Attribute, Attributes, ExtensionAttribute, Extensions } from '../types.js'
2
+ import type { AnyConfig, Attribute, Attributes, ExtensionAttribute, Extensions } from '../types.js'
3
3
  import { getExtensionField } from './getExtensionField.js'
4
4
  import { splitExtensions } from './splitExtensions.js'
5
5
 
@@ -1,6 +1,6 @@
1
- import { Step, Transform } from '@tiptap/pm/transform'
1
+ import type { Step, Transform } from '@tiptap/pm/transform'
2
2
 
3
- import { Range } from '../types.js'
3
+ import type { Range } from '../types.js'
4
4
  import { removeDuplicates } from '../utilities/removeDuplicates.js'
5
5
 
6
6
  export type ChangedRange = {
@@ -1,6 +1,6 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model'
1
+ import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
2
2
 
3
- import { JSONContent } from '../types.js'
3
+ import type { JSONContent } from '../types.js'
4
4
 
5
5
  interface DebugJSONContent extends JSONContent {
6
6
  from: number
@@ -1,7 +1,7 @@
1
- import { ExtensionConfig } from '../Extension.js'
2
- import { MarkConfig } from '../Mark.js'
3
- import { NodeConfig } from '../Node.js'
4
- import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types.js'
1
+ import type { ExtensionConfig } from '../Extension.js'
2
+ import type { MarkConfig } from '../Mark.js'
3
+ import type { NodeConfig } from '../Node.js'
4
+ import type { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types.js'
5
5
 
6
6
  /**
7
7
  * Returns a field from an extension
@@ -1,4 +1,5 @@
1
- import { DOMSerializer, Fragment, Schema } from '@tiptap/pm/model'
1
+ import type { Fragment, Schema } from '@tiptap/pm/model'
2
+ import { DOMSerializer } from '@tiptap/pm/model'
2
3
 
3
4
  export function getHTMLFromFragment(fragment: Fragment, schema: Schema): string {
4
5
  const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment)
@@ -1,5 +1,5 @@
1
- import { Mark, MarkType } from '@tiptap/pm/model'
2
- import { EditorState } from '@tiptap/pm/state'
1
+ import type { Mark, MarkType } from '@tiptap/pm/model'
2
+ import type { EditorState } from '@tiptap/pm/state'
3
3
 
4
4
  import { getMarkType } from './getMarkType.js'
5
5
 
@@ -1,6 +1,6 @@
1
- import { Mark as ProseMirrorMark, MarkType, ResolvedPos } from '@tiptap/pm/model'
1
+ import type { Mark as ProseMirrorMark, MarkType, ResolvedPos } from '@tiptap/pm/model'
2
2
 
3
- import { Range } from '../types.js'
3
+ import type { Range } from '../types.js'
4
4
  import { objectIncludes } from '../utilities/objectIncludes.js'
5
5
 
6
6
  function findMarkInSet(
@@ -1,4 +1,4 @@
1
- import { MarkType, Schema } from '@tiptap/pm/model'
1
+ import type { MarkType, Schema } from '@tiptap/pm/model'
2
2
 
3
3
  export function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType {
4
4
  if (typeof nameOrType === 'string') {
@@ -1,6 +1,6 @@
1
- import { Node as ProseMirrorNode } from '@tiptap/pm/model'
1
+ import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
2
2
 
3
- import { MarkRange } from '../types.js'
3
+ import type { MarkRange } from '../types.js'
4
4
  import { getMarkRange } from './getMarkRange.js'
5
5
 
6
6
  export function getMarksBetween(from: number, to: number, doc: ProseMirrorNode): MarkRange[] {
@@ -1,5 +1,5 @@
1
- import { Node, NodeType } from '@tiptap/pm/model'
2
- import { EditorState } from '@tiptap/pm/state'
1
+ import type { Node, NodeType } from '@tiptap/pm/model'
2
+ import type { EditorState } from '@tiptap/pm/state'
3
3
 
4
4
  /**
5
5
  * Finds the first node of a given type or name in the current selection.
@@ -1,5 +1,5 @@
1
- import { Node, NodeType } from '@tiptap/pm/model'
2
- import { EditorState } from '@tiptap/pm/state'
1
+ import type { Node, NodeType } from '@tiptap/pm/model'
2
+ import type { EditorState } from '@tiptap/pm/state'
3
3
 
4
4
  import { getNodeType } from './getNodeType.js'
5
5
 
@@ -1,4 +1,4 @@
1
- import { NodeType, Schema } from '@tiptap/pm/model'
1
+ import type { NodeType, Schema } from '@tiptap/pm/model'
2
2
 
3
3
  export function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType {
4
4
  if (typeof nameOrType === 'string') {
@@ -1,6 +1,6 @@
1
- import { Mark, Node } from '@tiptap/pm/model'
1
+ import type { Mark, Node } from '@tiptap/pm/model'
2
2
 
3
- import { ExtensionAttribute } from '../types.js'
3
+ import type { ExtensionAttribute } from '../types.js'
4
4
  import { mergeAttributes } from '../utilities/mergeAttributes.js'
5
5
 
6
6
  export function getRenderedAttributes(
@@ -1,7 +1,7 @@
1
- import { Schema } from '@tiptap/pm/model'
1
+ import type { Schema } from '@tiptap/pm/model'
2
2
 
3
- import { Editor } from '../Editor.js'
4
- import { Extensions } from '../types.js'
3
+ import type { Editor } from '../Editor.js'
4
+ import type { Extensions } from '../types.js'
5
5
  import { getSchemaByResolvedExtensions } from './getSchemaByResolvedExtensions.js'
6
6
  import { resolveExtensions } from './resolveExtensions.js'
7
7
 
@@ -1,7 +1,8 @@
1
- import { MarkSpec, NodeSpec, Schema, TagParseRule } from '@tiptap/pm/model'
1
+ import type { MarkSpec, NodeSpec, TagParseRule } from '@tiptap/pm/model'
2
+ import { Schema } from '@tiptap/pm/model'
2
3
 
3
4
  import type { Editor, MarkConfig, NodeConfig } from '../index.js'
4
- import { AnyConfig, Extensions } from '../types.js'
5
+ import type { AnyConfig, Extensions } from '../types.js'
5
6
  import { callOrReturn } from '../utilities/callOrReturn.js'
6
7
  import { isEmptyObject } from '../utilities/isEmptyObject.js'
7
8
  import { getAttributesFromExtensions } from './getAttributesFromExtensions.js'
@@ -1,4 +1,4 @@
1
- import { MarkType, NodeType, Schema } from '@tiptap/pm/model'
1
+ import type { MarkType, NodeType, Schema } from '@tiptap/pm/model'
2
2
 
3
3
  /**
4
4
  * Tries to get a node or mark type by its name.