@tiptap/core 3.0.0-next.5 → 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.
- package/dist/index.cjs +48 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -17
- package/dist/index.d.ts +32 -17
- package/dist/index.js +74 -39
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/CommandManager.ts +3 -3
- package/src/Editor.ts +30 -15
- package/src/Extendable.ts +10 -9
- package/src/Extension.ts +17 -1
- package/src/ExtensionManager.ts +8 -6
- package/src/InputRule.ts +6 -4
- package/src/Mark.ts +13 -1
- package/src/MarkView.ts +3 -3
- package/src/Node.ts +13 -1
- package/src/NodePos.ts +3 -3
- package/src/NodeView.ts +3 -3
- package/src/PasteRule.ts +6 -4
- package/src/Tracker.ts +1 -1
- package/src/commands/blur.ts +1 -1
- package/src/commands/clearContent.ts +1 -1
- package/src/commands/clearNodes.ts +1 -1
- package/src/commands/command.ts +1 -1
- package/src/commands/createParagraphNear.ts +1 -1
- package/src/commands/cut.ts +1 -1
- package/src/commands/deleteCurrentNode.ts +1 -1
- package/src/commands/deleteNode.ts +2 -2
- package/src/commands/deleteRange.ts +1 -1
- package/src/commands/deleteSelection.ts +1 -1
- package/src/commands/enter.ts +1 -1
- package/src/commands/exitCode.ts +1 -1
- package/src/commands/extendMarkRange.ts +2 -2
- package/src/commands/first.ts +1 -1
- package/src/commands/focus.ts +1 -1
- package/src/commands/forEach.ts +1 -1
- package/src/commands/insertContent.ts +2 -2
- package/src/commands/insertContentAt.ts +3 -2
- package/src/commands/join.ts +1 -1
- package/src/commands/joinItemBackward.ts +1 -1
- package/src/commands/joinItemForward.ts +1 -1
- package/src/commands/joinTextblockBackward.ts +1 -1
- package/src/commands/joinTextblockForward.ts +1 -1
- package/src/commands/keyboardShortcut.ts +1 -1
- package/src/commands/lift.ts +2 -2
- package/src/commands/liftEmptyBlock.ts +1 -1
- package/src/commands/liftListItem.ts +2 -2
- package/src/commands/newlineInCode.ts +1 -1
- package/src/commands/resetAttributes.ts +2 -2
- package/src/commands/scrollIntoView.ts +1 -1
- package/src/commands/selectAll.ts +1 -1
- package/src/commands/selectNodeBackward.ts +1 -1
- package/src/commands/selectNodeForward.ts +1 -1
- package/src/commands/selectParentNode.ts +1 -1
- package/src/commands/selectTextblockEnd.ts +1 -1
- package/src/commands/selectTextblockStart.ts +1 -1
- package/src/commands/setContent.ts +2 -2
- package/src/commands/setMark.ts +3 -3
- package/src/commands/setMeta.ts +1 -1
- package/src/commands/setNode.ts +2 -2
- package/src/commands/setNodeSelection.ts +1 -1
- package/src/commands/setTextSelection.ts +1 -1
- package/src/commands/sinkListItem.ts +2 -2
- package/src/commands/splitBlock.ts +3 -2
- package/src/commands/splitListItem.ts +3 -2
- package/src/commands/toggleList.ts +3 -3
- package/src/commands/toggleMark.ts +2 -2
- package/src/commands/toggleNode.ts +2 -2
- package/src/commands/toggleWrap.ts +2 -2
- package/src/commands/undoInputRule.ts +1 -1
- package/src/commands/unsetAllMarks.ts +1 -1
- package/src/commands/unsetMark.ts +2 -2
- package/src/commands/updateAttributes.ts +3 -3
- package/src/commands/wrapIn.ts +2 -2
- package/src/commands/wrapInList.ts +2 -2
- package/src/extensions/focusEvents.ts +3 -1
- package/src/extensions/index.ts +1 -1
- package/src/helpers/combineTransactionSteps.ts +2 -2
- package/src/helpers/createChainableState.ts +1 -1
- package/src/helpers/createDocument.ts +2 -2
- package/src/helpers/createNodeFromContent.ts +3 -2
- package/src/helpers/defaultBlockAt.ts +1 -1
- package/src/helpers/findChildren.ts +2 -2
- package/src/helpers/findChildrenInRange.ts +2 -2
- package/src/helpers/findParentNode.ts +2 -2
- package/src/helpers/findParentNodeClosestToPos.ts +2 -2
- package/src/helpers/flattenExtensions.ts +1 -1
- package/src/helpers/generateHTML.ts +1 -1
- package/src/helpers/generateJSON.ts +1 -1
- package/src/helpers/generateText.ts +1 -1
- package/src/helpers/getAttributes.ts +2 -2
- package/src/helpers/getAttributesFromExtensions.ts +1 -1
- package/src/helpers/getChangedRanges.ts +2 -2
- package/src/helpers/getDebugJSON.ts +2 -2
- package/src/helpers/getExtensionField.ts +4 -4
- package/src/helpers/getHTMLFromFragment.ts +2 -1
- package/src/helpers/getMarkAttributes.ts +2 -2
- package/src/helpers/getMarkRange.ts +2 -2
- package/src/helpers/getMarkType.ts +1 -1
- package/src/helpers/getMarksBetween.ts +2 -2
- package/src/helpers/getNodeAtPosition.ts +2 -2
- package/src/helpers/getNodeAttributes.ts +2 -2
- package/src/helpers/getNodeType.ts +1 -1
- package/src/helpers/getRenderedAttributes.ts +2 -2
- package/src/helpers/getSchema.ts +3 -3
- package/src/helpers/getSchemaByResolvedExtensions.ts +3 -2
- package/src/helpers/getSchemaTypeByName.ts +1 -1
- package/src/helpers/getSchemaTypeNameByName.ts +1 -1
- package/src/helpers/getSplittedAttributes.ts +1 -1
- package/src/helpers/getText.ts +2 -2
- package/src/helpers/getTextBetween.ts +2 -2
- package/src/helpers/getTextContentFromNodes.ts +1 -1
- package/src/helpers/getTextSerializersFromSchema.ts +2 -2
- package/src/helpers/injectExtensionAttributesToParseRule.ts +2 -2
- package/src/helpers/isActive.ts +1 -1
- package/src/helpers/isAtEndOfNode.ts +1 -1
- package/src/helpers/isAtStartOfNode.ts +1 -1
- package/src/helpers/isExtensionRulesEnabled.ts +1 -1
- package/src/helpers/isList.ts +1 -1
- package/src/helpers/isMarkActive.ts +3 -3
- package/src/helpers/isNodeActive.ts +3 -3
- package/src/helpers/isNodeEmpty.ts +1 -1
- package/src/helpers/posToDOMRect.ts +1 -1
- package/src/helpers/resolveExtensions.ts +1 -1
- package/src/helpers/resolveFocusPosition.ts +2 -2
- package/src/helpers/selectionToInsertionEnd.ts +2 -1
- package/src/helpers/sortExtensions.ts +1 -1
- package/src/helpers/splitExtensions.ts +4 -4
- package/src/inputRules/markInputRule.ts +4 -3
- package/src/inputRules/nodeInputRule.ts +4 -3
- package/src/inputRules/textInputRule.ts +2 -1
- package/src/inputRules/textblockTypeInputRule.ts +4 -3
- package/src/inputRules/wrappingInputRule.ts +5 -4
- package/src/pasteRules/markPasteRule.ts +4 -3
- package/src/pasteRules/nodePasteRule.ts +4 -3
- package/src/pasteRules/textPasteRule.ts +2 -1
- package/src/types.ts +10 -10
- 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' {
|
|
@@ -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> {
|
package/src/commands/setMark.ts
CHANGED
|
@@ -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> {
|
package/src/commands/setMeta.ts
CHANGED
package/src/commands/setNode.ts
CHANGED
|
@@ -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,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
|
|
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 {
|
|
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,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> {
|
package/src/commands/wrapIn.ts
CHANGED
|
@@ -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:
|
|
15
|
+
key: focusEventsPluginKey,
|
|
14
16
|
props: {
|
|
15
17
|
handleDOMEvents: {
|
|
16
18
|
focus: (view, event: Event) => {
|
package/src/extensions/index.ts
CHANGED
|
@@ -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,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 {
|
|
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,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,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 { 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 {
|
|
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,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,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,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(
|
package/src/helpers/getSchema.ts
CHANGED
|
@@ -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,
|
|
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'
|