Fix/enforce-type-imports-so-that-bundler-ignores-types (#6132)

* fix: enforce type imports so that the bundler ignores types

* chore: add changeset

* fix: export types with export type keyword
This commit is contained in:
Arnau Gómez Farell 2025-03-03 15:15:30 +01:00 committed by GitHub
parent ff8a24a5e0
commit 89bd9c7d29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
259 changed files with 661 additions and 497 deletions

View File

@ -0,0 +1,63 @@
---
'tiptap-2-migrate-imports': patch
'tiptap-demos': patch
'@tiptap/core': patch
'@tiptap/extension-blockquote': patch
'@tiptap/extension-bold': patch
'@tiptap/extension-bubble-menu': patch
'@tiptap/extension-bullet-list': patch
'@tiptap/extension-character-count': patch
'@tiptap/extension-code': patch
'@tiptap/extension-code-block': patch
'@tiptap/extension-code-block-lowlight': patch
'@tiptap/extension-collaboration': patch
'@tiptap/extension-collaboration-cursor': patch
'@tiptap/extension-color': patch
'@tiptap/extension-document': patch
'@tiptap/extension-dropcursor': patch
'@tiptap/extension-floating-menu': patch
'@tiptap/extension-focus': patch
'@tiptap/extension-font-family': patch
'@tiptap/extension-gapcursor': patch
'@tiptap/extension-hard-break': patch
'@tiptap/extension-heading': patch
'@tiptap/extension-highlight': patch
'@tiptap/extension-history': patch
'@tiptap/extension-horizontal-rule': patch
'@tiptap/extension-image': patch
'@tiptap/extension-italic': patch
'@tiptap/extension-link': patch
'@tiptap/extension-list': patch
'@tiptap/extension-list-item': patch
'@tiptap/extension-list-keymap': patch
'@tiptap/extension-mention': patch
'@tiptap/extension-ordered-list': patch
'@tiptap/extension-paragraph': patch
'@tiptap/extension-placeholder': patch
'@tiptap/extension-strike': patch
'@tiptap/extension-subscript': patch
'@tiptap/extension-superscript': patch
'@tiptap/extension-table': patch
'@tiptap/extension-table-cell': patch
'@tiptap/extension-table-header': patch
'@tiptap/extension-table-row': patch
'@tiptap/extension-task-item': patch
'@tiptap/extension-task-list': patch
'@tiptap/extension-text': patch
'@tiptap/extension-text-align': patch
'@tiptap/extension-text-style': patch
'@tiptap/extension-typography': patch
'@tiptap/extension-underline': patch
'@tiptap/extension-youtube': patch
'@tiptap/extensions': patch
'@tiptap/html': patch
'@tiptap/pm': patch
'@tiptap/react': patch
'@tiptap/starter-kit': patch
'@tiptap/static-renderer': patch
'@tiptap/suggestion': patch
'@tiptap/vue-2': patch
'@tiptap/vue-3': patch
---
Enforce type imports so that the bundler ignores TypeScript type imports when generating the index.js file of the dist directory

View File

@ -90,6 +90,7 @@ module.exports = {
'@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off', '@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
'simple-import-sort/imports': 'error', 'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error', 'simple-import-sort/exports': 'error',
}, },

View File

@ -1,4 +1,5 @@
import { Editor, useEditorState } from '@tiptap/react' import type { Editor } from '@tiptap/react'
import { useEditorState } from '@tiptap/react'
import { FloatingMenu } from '@tiptap/react/menus' import { FloatingMenu } from '@tiptap/react/menus'
import React, { useRef } from 'react' import React, { useRef } from 'react'

View File

@ -1,4 +1,4 @@
import { Editor } from '@tiptap/core' import type { Editor } from '@tiptap/core'
import { useEditorState } from '@tiptap/react' import { useEditorState } from '@tiptap/react'
import React, { useEffect, useRef, useState } from 'react' import React, { useEffect, useRef, useState } from 'react'

View File

@ -1,5 +1,6 @@
import { Selection } from '@tiptap/pm/state' import { Selection } from '@tiptap/pm/state'
import { Editor, useEditorState } from '@tiptap/react' import type { Editor } from '@tiptap/react'
import { useEditorState } from '@tiptap/react'
import { BubbleMenu } from '@tiptap/react/menus' import { BubbleMenu } from '@tiptap/react/menus'
import React, { useRef } from 'react' import React, { useRef } from 'react'

View File

@ -1,5 +1,6 @@
import { Editor } from '@tiptap/core' import type { Editor } from '@tiptap/core'
import React, { useCallback, useEffect, useRef } from 'react' import type React from 'react'
import { useCallback, useEffect, useRef } from 'react'
/** /**
* Handle arrow navigation within a menu bar container, and allow to escape to the editor * Handle arrow navigation within a menu bar container, and allow to escape to the editor

View File

@ -1,7 +1,8 @@
import './styles.scss' import './styles.scss'
import { TextStyleKit } from '@tiptap/extension-text-style' import { TextStyleKit } from '@tiptap/extension-text-style'
import { Editor, EditorContent, useEditor, useEditorState } from '@tiptap/react' import type { Editor } from '@tiptap/react'
import { EditorContent, useEditor, useEditorState } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit' import StarterKit from '@tiptap/starter-kit'
import React from 'react' import React from 'react'

View File

@ -1,4 +1,4 @@
import { Node } from '@tiptap/pm/model' import type { Node } from '@tiptap/pm/model'
import { Decoration, DecorationSet } from '@tiptap/pm/view' import { Decoration, DecorationSet } from '@tiptap/pm/view'
export default function (doc: Node): DecorationSet { export default function (doc: Node): DecorationSet {

View File

@ -1,4 +1,4 @@
import { Node } from '@tiptap/pm/model' import type { Node } from '@tiptap/pm/model'
import { Decoration, DecorationSet } from '@tiptap/pm/view' import { Decoration, DecorationSet } from '@tiptap/pm/view'
export default function (doc: Node): DecorationSet { export default function (doc: Node): DecorationSet {

View File

@ -1,6 +1,7 @@
import './styles.scss' import './styles.scss'
import { EditorProvider, JSONContent, useCurrentEditor, useEditorState } from '@tiptap/react' import type { JSONContent } from '@tiptap/react'
import { EditorProvider, useCurrentEditor, useEditorState } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit' import StarterKit from '@tiptap/starter-kit'
import { renderToHTMLString, renderToMarkdown, renderToReactElement } from '@tiptap/static-renderer' import { renderToHTMLString, renderToMarkdown, renderToReactElement } from '@tiptap/static-renderer'
import React, { useState } from 'react' import React, { useState } from 'react'

View File

@ -1,8 +1,8 @@
import { Plugin, PluginKey } from '@tiptap/pm/state' import { Plugin, PluginKey } from '@tiptap/pm/state'
import { DecorationSet } from '@tiptap/pm/view' import { DecorationSet } from '@tiptap/pm/view'
import * as Y from 'yjs' import type * as Y from 'yjs'
import { AnnotationItem } from './AnnotationItem.js' import type { AnnotationItem } from './AnnotationItem.js'
import { AnnotationState } from './AnnotationState.js' import { AnnotationState } from './AnnotationState.js'
export const AnnotationPluginKey = new PluginKey('annotation') export const AnnotationPluginKey = new PluginKey('annotation')

View File

@ -1,15 +1,15 @@
import { EditorState, Transaction } from '@tiptap/pm/state' import type { EditorState, Transaction } from '@tiptap/pm/state'
import { Decoration, DecorationSet } from '@tiptap/pm/view' import { Decoration, DecorationSet } from '@tiptap/pm/view'
import { import {
absolutePositionToRelativePosition, absolutePositionToRelativePosition,
relativePositionToAbsolutePosition, relativePositionToAbsolutePosition,
ySyncPluginKey, ySyncPluginKey,
} from '@tiptap/y-tiptap' } from '@tiptap/y-tiptap'
import * as Y from 'yjs' import type * as Y from 'yjs'
import { AnnotationItem } from './AnnotationItem.js' import { AnnotationItem } from './AnnotationItem.js'
import { AnnotationPluginKey } from './AnnotationPlugin.js' import { AnnotationPluginKey } from './AnnotationPlugin.js'
import { AddAnnotationAction, DeleteAnnotationAction, UpdateAnnotationAction } from './collaboration-annotation.js' import type { AddAnnotationAction, DeleteAnnotationAction, UpdateAnnotationAction } from './collaboration-annotation.js'
export interface AnnotationStateOptions { export interface AnnotationStateOptions {
HTMLAttributes: { HTMLAttributes: {

View File

@ -1,5 +1,5 @@
import { Extension } from '@tiptap/core' import { Extension } from '@tiptap/core'
import * as Y from 'yjs' import type * as Y from 'yjs'
import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin.js' import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin.js'

View File

@ -1,9 +1,10 @@
import { Extension } from '@tiptap/core' import { Extension } from '@tiptap/core'
import { Node as ProsemirrorNode } from '@tiptap/pm/model' import type { Node as ProsemirrorNode } from '@tiptap/pm/model'
import { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state' import { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state'
import { Decoration, DecorationSet } from '@tiptap/pm/view' import { Decoration, DecorationSet } from '@tiptap/pm/view'
import LinterPlugin, { Result as Issue } from './LinterPlugin.js' import type { Result as Issue } from './LinterPlugin.js'
import type LinterPlugin from './LinterPlugin.js'
interface IconDivElement extends HTMLDivElement { interface IconDivElement extends HTMLDivElement {
issue?: Issue issue?: Issue

View File

@ -1,4 +1,4 @@
import { Node as ProsemirrorNode } from '@tiptap/pm/model' import type { Node as ProsemirrorNode } from '@tiptap/pm/model'
export interface Result { export interface Result {
message: string message: string

View File

@ -1,6 +1,7 @@
import { EditorView } from '@tiptap/pm/view' import type { EditorView } from '@tiptap/pm/view'
import LinterPlugin, { Result as Issue } from '../LinterPlugin.js' import type { Result as Issue } from '../LinterPlugin.js'
import LinterPlugin from '../LinterPlugin.js'
export class HeadingLevel extends LinterPlugin { export class HeadingLevel extends LinterPlugin {
fixHeader(level: number) { fixHeader(level: number) {

View File

@ -1,6 +1,7 @@
import { EditorView } from '@tiptap/pm/view' import type { EditorView } from '@tiptap/pm/view'
import LinterPlugin, { Result as Issue } from '../LinterPlugin.js' import type { Result as Issue } from '../LinterPlugin.js'
import LinterPlugin from '../LinterPlugin.js'
export class Punctuation extends LinterPlugin { export class Punctuation extends LinterPlugin {
public regex = / ([,.!?:]) ?/g public regex = / ([,.!?:]) ?/g

View File

@ -1,4 +1,5 @@
import { MarkViewContent, MarkViewRendererProps } from '@tiptap/react' import type { MarkViewRendererProps } from '@tiptap/react'
import { MarkViewContent } from '@tiptap/react'
import React from 'react' import React from 'react'
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars

View File

@ -1,4 +1,5 @@
import { NodeViewProps, NodeViewWrapper } from '@tiptap/react' import type { NodeViewProps } from '@tiptap/react'
import { NodeViewWrapper } from '@tiptap/react'
import React from 'react' import React from 'react'
export default (props: NodeViewProps) => { export default (props: NodeViewProps) => {

View File

@ -1,4 +1,5 @@
import { NodeViewProps, NodeViewWrapper } from '@tiptap/react' import type { NodeViewProps } from '@tiptap/react'
import { NodeViewWrapper } from '@tiptap/react'
import React, { useContext } from 'react' import React, { useContext } from 'react'
import { Context } from './Context.js' import { Context } from './Context.js'

View File

@ -1,6 +1,6 @@
import React, { useState } from 'react' import React, { useState } from 'react'
import { TNote } from './types.js' import type { TNote } from './types.js'
export default ({ note }: { note: TNote }) => { export default ({ note }: { note: TNote }) => {
const [modelValue, setModelValue] = useState(note.content) const [modelValue, setModelValue] = useState(note.content)

View File

@ -3,7 +3,7 @@ import './styles.scss'
import React from 'react' import React from 'react'
import Note from './Note.jsx' import Note from './Note.jsx'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ {

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
import { TNote } from './types.js' import type { TNote } from './types.js'
const props = defineProps<{ note: TNote }>() const props = defineProps<{ note: TNote }>()

View File

@ -2,7 +2,7 @@
import './styles.scss' import './styles.scss'
import Note from './Note.vue' import Note from './Note.vue'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ id: 'note-1', content: 'Some random note text' }, { id: 'note-1', content: 'Some random note text' },

View File

@ -2,7 +2,7 @@ import { EditorContent, useEditor } from '@tiptap/react'
import { StarterKit } from '@tiptap/starter-kit' import { StarterKit } from '@tiptap/starter-kit'
import React, { useState } from 'react' import React, { useState } from 'react'
import { TNote } from './types.js' import type { TNote } from './types.js'
export default ({ note }: { note: TNote }) => { export default ({ note }: { note: TNote }) => {
const [modelValue, setModelValue] = useState(note.content) const [modelValue, setModelValue] = useState(note.content)

View File

@ -3,7 +3,7 @@ import './styles.scss'
import React from 'react' import React from 'react'
import Note from './Note.jsx' import Note from './Note.jsx'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ {

View File

@ -2,7 +2,7 @@
import './styles.scss' import './styles.scss'
import Note from './Note.vue' import Note from './Note.vue'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ id: 'note-1', content: 'Some random note text' }, { id: 'note-1', content: 'Some random note text' },

View File

@ -1,15 +1,16 @@
import './styles.css' import './styles.css'
import { InitialConfigType, LexicalComposer } from '@lexical/react/LexicalComposer' import type { InitialConfigType } from '@lexical/react/LexicalComposer'
import { LexicalComposer } from '@lexical/react/LexicalComposer'
import { ContentEditable } from '@lexical/react/LexicalContentEditable' import { ContentEditable } from '@lexical/react/LexicalContentEditable'
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary' import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin' import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin'
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin' import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin'
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin' import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
import { EditorState } from 'lexical/LexicalEditorState' import type { EditorState } from 'lexical/LexicalEditorState'
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { TNote } from './types.js' import type { TNote } from './types.js'
export default ({ note }: { note: TNote }) => { export default ({ note }: { note: TNote }) => {
const editorStateRef = useRef<EditorState>() const editorStateRef = useRef<EditorState>()

View File

@ -3,7 +3,7 @@ import './styles.css'
import React from 'react' import React from 'react'
import Note from './Note.jsx' import Note from './Note.jsx'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ {

View File

@ -4,7 +4,7 @@ import { StarterKit } from '@tiptap/starter-kit'
import React from 'react' import React from 'react'
import * as Y from 'yjs' import * as Y from 'yjs'
import { TNote } from './types.js' import type { TNote } from './types.js'
export default ({ note }: { note: TNote }) => { export default ({ note }: { note: TNote }) => {
const doc = new Y.Doc() const doc = new Y.Doc()

View File

@ -3,7 +3,7 @@ import './styles.scss'
import React from 'react' import React from 'react'
import Note from './Note.jsx' import Note from './Note.jsx'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ {

View File

@ -2,7 +2,7 @@
import './styles.scss' import './styles.scss'
import Note from './Note.vue' import Note from './Note.vue'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ id: 'note-1', defaultContent: 'Some random note text' }, { id: 'note-1', defaultContent: 'Some random note text' },

View File

@ -2,14 +2,15 @@ import './styles.css'
import { TiptapCollabProvider } from '@hocuspocus/provider' import { TiptapCollabProvider } from '@hocuspocus/provider'
import { CollaborationPlugin } from '@lexical/react/LexicalCollaborationPlugin' import { CollaborationPlugin } from '@lexical/react/LexicalCollaborationPlugin'
import { InitialConfigType, LexicalComposer } from '@lexical/react/LexicalComposer' import type { InitialConfigType } from '@lexical/react/LexicalComposer'
import { LexicalComposer } from '@lexical/react/LexicalComposer'
import { ContentEditable } from '@lexical/react/LexicalContentEditable' import { ContentEditable } from '@lexical/react/LexicalContentEditable'
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary' import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin' import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
import React from 'react' import React from 'react'
import * as Y from 'yjs' import * as Y from 'yjs'
import { TNote } from './types.js' import type { TNote } from './types.js'
export default ({ note }: { note: TNote }) => { export default ({ note }: { note: TNote }) => {
const initialConfig: InitialConfigType = { const initialConfig: InitialConfigType = {

View File

@ -3,7 +3,7 @@ import './styles.css'
import React from 'react' import React from 'react'
import Note from './Note.jsx' import Note from './Note.jsx'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ {

View File

@ -5,7 +5,7 @@ import { StarterKit } from '@tiptap/starter-kit'
import React, { useEffect } from 'react' import React, { useEffect } from 'react'
import * as Y from 'yjs' import * as Y from 'yjs'
import { TNote } from './types.js' import type { TNote } from './types.js'
export default ({ note }: { note: TNote }) => { export default ({ note }: { note: TNote }) => {
const doc = new Y.Doc() const doc = new Y.Doc()

View File

@ -3,7 +3,7 @@ import './styles.scss'
import React from 'react' import React from 'react'
import Note from './Note.jsx' import Note from './Note.jsx'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [ const notes: TNote[] = [
{ {

View File

@ -2,7 +2,7 @@
import './styles.scss' import './styles.scss'
import Note from './Note.vue' import Note from './Note.vue'
import { TNote } from './types.js' import type { TNote } from './types.js'
const notes: TNote[] = [{ id: 'note-1' }, { id: 'note-2' }] const notes: TNote[] = [{ id: 'note-1' }, { id: 'note-2' }]
</script> </script>

View File

@ -1,8 +1,8 @@
import { EditorState, Transaction } from '@tiptap/pm/state' import type { EditorState, Transaction } from '@tiptap/pm/state'
import { Editor } from './Editor.js' import type { Editor } from './Editor.js'
import { createChainableState } from './helpers/createChainableState.js' import { createChainableState } from './helpers/createChainableState.js'
import { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types.js' import type { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types.js'
export class CommandManager { export class CommandManager {
editor: Editor editor: Editor

View File

@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-empty-object-type */ /* eslint-disable @typescript-eslint/no-empty-object-type */
import { MarkType, Node as ProseMirrorNode, NodeType, Schema } from '@tiptap/pm/model' import type { MarkType, Node as ProseMirrorNode, NodeType, Schema } from '@tiptap/pm/model'
import { EditorState, Plugin, PluginKey, Transaction } from '@tiptap/pm/state' import type { Plugin, PluginKey, Transaction } from '@tiptap/pm/state'
import { EditorState } from '@tiptap/pm/state'
import { EditorView } from '@tiptap/pm/view' import { EditorView } from '@tiptap/pm/view'
import { CommandManager } from './CommandManager.js' import { CommandManager } from './CommandManager.js'
@ -28,7 +29,7 @@ import { resolveFocusPosition } from './helpers/resolveFocusPosition.js'
import type { Storage } from './index.js' import type { Storage } from './index.js'
import { NodePos } from './NodePos.js' import { NodePos } from './NodePos.js'
import { style } from './style.js' import { style } from './style.js'
import { import type {
CanCommands, CanCommands,
ChainedCommands, ChainedCommands,
DocumentType, DocumentType,

View File

@ -2,12 +2,13 @@ import type { Plugin } from '@tiptap/pm/state'
import type { Editor } from './Editor.js' import type { Editor } from './Editor.js'
import { getExtensionField } from './helpers/getExtensionField.js' import { getExtensionField } from './helpers/getExtensionField.js'
import { ExtensionConfig, MarkConfig, NodeConfig } from './index.js' import type { ExtensionConfig, MarkConfig, NodeConfig } from './index.js'
import type { InputRule } from './InputRule.js' import type { InputRule } from './InputRule.js'
import type { Mark } from './Mark.js' import type { Mark } from './Mark.js'
import type { Node } from './Node.js' import type { Node } from './Node.js'
import type { PasteRule } from './PasteRule.js' import type { PasteRule } from './PasteRule.js'
import type { import type {
AnyConfig,
EditorEvents, EditorEvents,
Extensions, Extensions,
GlobalAttributes, GlobalAttributes,
@ -15,7 +16,6 @@ import type {
ParentConfig, ParentConfig,
RawCommands, RawCommands,
} from './types.js' } from './types.js'
import { AnyConfig } from './types.js'
import { callOrReturn } from './utilities/callOrReturn.js' import { callOrReturn } from './utilities/callOrReturn.js'
import { mergeDeep } from './utilities/mergeDeep.js' import { mergeDeep } from './utilities/mergeDeep.js'

View File

@ -1,7 +1,7 @@
import { keymap } from '@tiptap/pm/keymap' import { keymap } from '@tiptap/pm/keymap'
import { Schema } from '@tiptap/pm/model' import type { Schema } from '@tiptap/pm/model'
import { Plugin } from '@tiptap/pm/state' import type { Plugin } from '@tiptap/pm/state'
import { MarkViewConstructor, NodeViewConstructor } from '@tiptap/pm/view' import type { MarkViewConstructor, NodeViewConstructor } from '@tiptap/pm/view'
import type { Editor } from './Editor.js' import type { Editor } from './Editor.js'
import { import {
@ -18,10 +18,12 @@ import {
splitExtensions, splitExtensions,
} from './helpers/index.js' } from './helpers/index.js'
import { type MarkConfig, type NodeConfig, type Storage, getMarkType } from './index.js' import { type MarkConfig, type NodeConfig, type Storage, getMarkType } from './index.js'
import { InputRule, inputRulesPlugin } from './InputRule.js' import type { InputRule } from './InputRule.js'
import { inputRulesPlugin } from './InputRule.js'
import { Mark } from './Mark.js' import { Mark } from './Mark.js'
import { PasteRule, pasteRulesPlugin } from './PasteRule.js' import type { PasteRule } from './PasteRule.js'
import { AnyConfig, Extensions, RawCommands } from './types.js' import { pasteRulesPlugin } from './PasteRule.js'
import type { AnyConfig, Extensions, RawCommands } from './types.js'
import { callOrReturn } from './utilities/callOrReturn.js' import { callOrReturn } from './utilities/callOrReturn.js'
export class ExtensionManager { export class ExtensionManager {

View File

@ -1,12 +1,14 @@
import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model' import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
import { EditorState, Plugin, TextSelection } from '@tiptap/pm/state' import { Fragment } from '@tiptap/pm/model'
import type { EditorState, TextSelection } from '@tiptap/pm/state'
import { Plugin } from '@tiptap/pm/state'
import { CommandManager } from './CommandManager.js' import { CommandManager } from './CommandManager.js'
import { Editor } from './Editor.js' import type { Editor } from './Editor.js'
import { createChainableState } from './helpers/createChainableState.js' import { createChainableState } from './helpers/createChainableState.js'
import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.js' import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.js'
import { getTextContentFromNodes } from './helpers/getTextContentFromNodes.js' import { getTextContentFromNodes } from './helpers/getTextContentFromNodes.js'
import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types.js' import type { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types.js'
import { isRegExp } from './utilities/isRegExp.js' import { isRegExp } from './utilities/isRegExp.js'
export type InputRuleMatch = { export type InputRuleMatch = {

View File

@ -1,7 +1,7 @@
import { ViewMutationRecord } from '@tiptap/pm/view' import type { ViewMutationRecord } from '@tiptap/pm/view'
import { Editor } from './Editor.js' import type { Editor } from './Editor.js'
import { MarkViewProps, MarkViewRendererOptions } from './types.js' import type { MarkViewProps, MarkViewRendererOptions } from './types.js'
import { isAndroid, isiOS } from './utilities/index.js' import { isAndroid, isiOS } from './utilities/index.js'
export class MarkView<Component, Options extends MarkViewRendererOptions = MarkViewRendererOptions> { export class MarkView<Component, Options extends MarkViewRendererOptions = MarkViewRendererOptions> {

View File

@ -1,7 +1,7 @@
import { Fragment, Node, ResolvedPos } from '@tiptap/pm/model' import type { Fragment, Node, ResolvedPos } from '@tiptap/pm/model'
import { Editor } from './Editor.js' import type { Editor } from './Editor.js'
import { Content, Range } from './types.js' import type { Content, Range } from './types.js'
export class NodePos { export class NodePos {
private resolvedPos: ResolvedPos private resolvedPos: ResolvedPos

View File

@ -1,8 +1,8 @@
import { NodeSelection } from '@tiptap/pm/state' import { NodeSelection } from '@tiptap/pm/state'
import { NodeView as ProseMirrorNodeView, ViewMutationRecord } from '@tiptap/pm/view' import type { NodeView as ProseMirrorNodeView, ViewMutationRecord } from '@tiptap/pm/view'
import { Editor as CoreEditor } from './Editor.js' import type { Editor as CoreEditor } from './Editor.js'
import { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types.js' import type { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types.js'
import { isAndroid } from './utilities/isAndroid.js' import { isAndroid } from './utilities/isAndroid.js'
import { isiOS } from './utilities/isiOS.js' import { isiOS } from './utilities/isiOS.js'

View File

@ -1,11 +1,13 @@
import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model' import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
import { EditorState, Plugin } from '@tiptap/pm/state' import { Fragment } from '@tiptap/pm/model'
import type { EditorState } from '@tiptap/pm/state'
import { Plugin } from '@tiptap/pm/state'
import { CommandManager } from './CommandManager.js' import { CommandManager } from './CommandManager.js'
import { Editor } from './Editor.js' import type { Editor } from './Editor.js'
import { createChainableState } from './helpers/createChainableState.js' import { createChainableState } from './helpers/createChainableState.js'
import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.js' import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.js'
import { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types.js' import type { CanCommands, ChainedCommands, ExtendedRegExpMatchArray, Range, SingleCommands } from './types.js'
import { isNumber } from './utilities/isNumber.js' import { isNumber } from './utilities/isNumber.js'
import { isRegExp } from './utilities/isRegExp.js' import { isRegExp } from './utilities/isRegExp.js'

View File

@ -1,4 +1,4 @@
import { Transaction } from '@tiptap/pm/state' import type { Transaction } from '@tiptap/pm/state'
export interface TrackerResult { export interface TrackerResult {
position: number position: number

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { liftTarget } from '@tiptap/pm/transform' import { liftTarget } from '@tiptap/pm/transform'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { Command, RawCommands } from '../types.js' import type { Command, RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { createParagraphNear as originalCreateParagraphNear } from '@tiptap/pm/commands' import { createParagraphNear as originalCreateParagraphNear } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { TextSelection } from '@tiptap/pm/state' import { TextSelection } from '@tiptap/pm/state'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,7 +1,7 @@
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { Range, RawCommands } from '../types.js' import type { Range, RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { deleteSelection as originalDeleteSelection } from '@tiptap/pm/commands' import { deleteSelection as originalDeleteSelection } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { exitCode as originalExitCode } from '@tiptap/pm/commands' import { exitCode as originalExitCode } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,9 +1,9 @@
import { MarkType } from '@tiptap/pm/model' import type { MarkType } from '@tiptap/pm/model'
import { TextSelection } from '@tiptap/pm/state' import { TextSelection } from '@tiptap/pm/state'
import { getMarkRange } from '../helpers/getMarkRange.js' import { getMarkRange } from '../helpers/getMarkRange.js'
import { getMarkType } from '../helpers/getMarkType.js' import { getMarkType } from '../helpers/getMarkType.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { Command, CommandProps, RawCommands } from '../types.js' import type { Command, CommandProps, RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { isTextSelection } from '../helpers/isTextSelection.js' import { isTextSelection } from '../helpers/isTextSelection.js'
import { resolveFocusPosition } from '../helpers/resolveFocusPosition.js' import { resolveFocusPosition } from '../helpers/resolveFocusPosition.js'
import { FocusPosition, RawCommands } from '../types.js' import type { FocusPosition, RawCommands } from '../types.js'
import { isAndroid } from '../utilities/isAndroid.js' import { isAndroid } from '../utilities/isAndroid.js'
import { isiOS } from '../utilities/isiOS.js' import { isiOS } from '../utilities/isiOS.js'

View File

@ -1,4 +1,4 @@
import { CommandProps, RawCommands } from '../types.js' import type { CommandProps, RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model' import type { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model'
import { Content, RawCommands } from '../types.js' import type { Content, RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,8 +1,9 @@
import { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model' import type { Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model'
import { Fragment } from '@tiptap/pm/model'
import { createNodeFromContent } from '../helpers/createNodeFromContent.js' import { createNodeFromContent } from '../helpers/createNodeFromContent.js'
import { selectionToInsertionEnd } from '../helpers/selectionToInsertionEnd.js' import { selectionToInsertionEnd } from '../helpers/selectionToInsertionEnd.js'
import { Content, Range, RawCommands } from '../types.js' import type { Content, Range, RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -5,7 +5,7 @@ import {
joinUp as originalJoinUp, joinUp as originalJoinUp,
} from '@tiptap/pm/commands' } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { joinPoint } from '@tiptap/pm/transform' import { joinPoint } from '@tiptap/pm/transform'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { joinPoint } from '@tiptap/pm/transform' import { joinPoint } from '@tiptap/pm/transform'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { joinTextblockBackward as originalCommand } from '@tiptap/pm/commands' import { joinTextblockBackward as originalCommand } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { joinTextblockForward as originalCommand } from '@tiptap/pm/commands' import { joinTextblockForward as originalCommand } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
import { isiOS } from '../utilities/isiOS.js' import { isiOS } from '../utilities/isiOS.js'
import { isMacOS } from '../utilities/isMacOS.js' import { isMacOS } from '../utilities/isMacOS.js'

View File

@ -1,9 +1,9 @@
import { lift as originalLift } from '@tiptap/pm/commands' import { lift as originalLift } from '@tiptap/pm/commands'
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { isNodeActive } from '../helpers/isNodeActive.js' import { isNodeActive } from '../helpers/isNodeActive.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { liftEmptyBlock as originalLiftEmptyBlock } from '@tiptap/pm/commands' import { liftEmptyBlock as originalLiftEmptyBlock } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,8 +1,8 @@
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { liftListItem as originalLiftListItem } from '@tiptap/pm/schema-list' import { liftListItem as originalLiftListItem } from '@tiptap/pm/schema-list'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { newlineInCode as originalNewlineInCode } from '@tiptap/pm/commands' import { newlineInCode as originalNewlineInCode } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,9 +1,9 @@
import { MarkType, NodeType } from '@tiptap/pm/model' import type { MarkType, NodeType } from '@tiptap/pm/model'
import { getMarkType } from '../helpers/getMarkType.js' import { getMarkType } from '../helpers/getMarkType.js'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js' import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
import { deleteProps } from '../utilities/deleteProps.js' import { deleteProps } from '../utilities/deleteProps.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { AllSelection } from '@tiptap/pm/state' import { AllSelection } from '@tiptap/pm/state'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { selectNodeBackward as originalSelectNodeBackward } from '@tiptap/pm/commands' import { selectNodeBackward as originalSelectNodeBackward } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { selectNodeForward as originalSelectNodeForward } from '@tiptap/pm/commands' import { selectNodeForward as originalSelectNodeForward } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { selectParentNode as originalSelectParentNode } from '@tiptap/pm/commands' import { selectParentNode as originalSelectParentNode } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -2,7 +2,7 @@
// TODO: add types to @types/prosemirror-commands // TODO: add types to @types/prosemirror-commands
import { selectTextblockEnd as originalSelectTextblockEnd } from '@tiptap/pm/commands' import { selectTextblockEnd as originalSelectTextblockEnd } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -2,7 +2,7 @@
// TODO: add types to @types/prosemirror-commands // TODO: add types to @types/prosemirror-commands
import { selectTextblockStart as originalSelectTextblockStart } from '@tiptap/pm/commands' import { selectTextblockStart as originalSelectTextblockStart } from '@tiptap/pm/commands'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,7 +1,7 @@
import { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model' import type { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model'
import { createDocument } from '../helpers/createDocument.js' import { createDocument } from '../helpers/createDocument.js'
import { Content, RawCommands } from '../types.js' import type { Content, RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,10 +1,10 @@
import { MarkType, ResolvedPos } from '@tiptap/pm/model' import type { MarkType, ResolvedPos } from '@tiptap/pm/model'
import { EditorState, Transaction } from '@tiptap/pm/state' import type { EditorState, Transaction } from '@tiptap/pm/state'
import { getMarkAttributes } from '../helpers/getMarkAttributes.js' import { getMarkAttributes } from '../helpers/getMarkAttributes.js'
import { getMarkType } from '../helpers/getMarkType.js' import { getMarkType } from '../helpers/getMarkType.js'
import { isTextSelection } from '../helpers/index.js' import { isTextSelection } from '../helpers/index.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import type { Plugin, PluginKey } from '@tiptap/pm/state' import type { Plugin, PluginKey } from '@tiptap/pm/state'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,8 +1,8 @@
import { setBlockType } from '@tiptap/pm/commands' import { setBlockType } from '@tiptap/pm/commands'
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,6 +1,6 @@
import { NodeSelection } from '@tiptap/pm/state' import { NodeSelection } from '@tiptap/pm/state'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
import { minMax } from '../utilities/minMax.js' import { minMax } from '../utilities/minMax.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {

View File

@ -1,6 +1,6 @@
import { TextSelection } from '@tiptap/pm/state' import { TextSelection } from '@tiptap/pm/state'
import { Range, RawCommands } from '../types.js' import type { Range, RawCommands } from '../types.js'
import { minMax } from '../utilities/minMax.js' import { minMax } from '../utilities/minMax.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {

View File

@ -1,8 +1,8 @@
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { sinkListItem as originalSinkListItem } from '@tiptap/pm/schema-list' import { sinkListItem as originalSinkListItem } from '@tiptap/pm/schema-list'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,9 +1,10 @@
import { EditorState, NodeSelection, TextSelection } from '@tiptap/pm/state' import type { EditorState } from '@tiptap/pm/state'
import { NodeSelection, TextSelection } from '@tiptap/pm/state'
import { canSplit } from '@tiptap/pm/transform' import { canSplit } from '@tiptap/pm/transform'
import { defaultBlockAt } from '../helpers/defaultBlockAt.js' import { defaultBlockAt } from '../helpers/defaultBlockAt.js'
import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js' import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
function ensureMarks(state: EditorState, splittableMarks?: string[]) { function ensureMarks(state: EditorState, splittableMarks?: string[]) {
const marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks()) const marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks())

View File

@ -1,10 +1,11 @@
import { Fragment, Node as ProseMirrorNode, NodeType, Slice } from '@tiptap/pm/model' import type { Node as ProseMirrorNode, NodeType } from '@tiptap/pm/model'
import { Fragment, Slice } from '@tiptap/pm/model'
import { TextSelection } from '@tiptap/pm/state' import { TextSelection } from '@tiptap/pm/state'
import { canSplit } from '@tiptap/pm/transform' import { canSplit } from '@tiptap/pm/transform'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js' import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,11 +1,11 @@
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { Transaction } from '@tiptap/pm/state' import type { Transaction } from '@tiptap/pm/state'
import { canJoin } from '@tiptap/pm/transform' import { canJoin } from '@tiptap/pm/transform'
import { findParentNode } from '../helpers/findParentNode.js' import { findParentNode } from '../helpers/findParentNode.js'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { isList } from '../helpers/isList.js' import { isList } from '../helpers/isList.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
const joinListBackwards = (tr: Transaction, listType: NodeType): boolean => { const joinListBackwards = (tr: Transaction, listType: NodeType): boolean => {
const list = findParentNode(node => node.type === listType)(tr.selection) const list = findParentNode(node => node.type === listType)(tr.selection)

View File

@ -1,8 +1,8 @@
import { MarkType } from '@tiptap/pm/model' import type { MarkType } from '@tiptap/pm/model'
import { getMarkType } from '../helpers/getMarkType.js' import { getMarkType } from '../helpers/getMarkType.js'
import { isMarkActive } from '../helpers/isMarkActive.js' import { isMarkActive } from '../helpers/isMarkActive.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,8 +1,8 @@
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { isNodeActive } from '../helpers/isNodeActive.js' import { isNodeActive } from '../helpers/isNodeActive.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,8 +1,8 @@
import { NodeType } from '@tiptap/pm/model' import type { NodeType } from '@tiptap/pm/model'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { isNodeActive } from '../helpers/isNodeActive.js' import { isNodeActive } from '../helpers/isNodeActive.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,4 +1,4 @@
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,8 +1,8 @@
import { MarkType } from '@tiptap/pm/model' import type { MarkType } from '@tiptap/pm/model'
import { getMarkRange } from '../helpers/getMarkRange.js' import { getMarkRange } from '../helpers/getMarkRange.js'
import { getMarkType } from '../helpers/getMarkType.js' import { getMarkType } from '../helpers/getMarkType.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

View File

@ -1,10 +1,10 @@
import { Mark, MarkType, Node, NodeType } from '@tiptap/pm/model' import type { Mark, MarkType, Node, NodeType } from '@tiptap/pm/model'
import { SelectionRange } from '@tiptap/pm/state' import type { SelectionRange } from '@tiptap/pm/state'
import { getMarkType } from '../helpers/getMarkType.js' import { getMarkType } from '../helpers/getMarkType.js'
import { getNodeType } from '../helpers/getNodeType.js' import { getNodeType } from '../helpers/getNodeType.js'
import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js' import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js'
import { RawCommands } from '../types.js' import type { RawCommands } from '../types.js'
declare module '@tiptap/core' { declare module '@tiptap/core' {
interface Commands<ReturnType> { interface Commands<ReturnType> {

Some files were not shown because too many files have changed in this diff Show More