mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 17:43:49 +08:00
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:
parent
ff8a24a5e0
commit
89bd9c7d29
63
.changeset/cuddly-impalas-heal.md
Normal file
63
.changeset/cuddly-impalas-heal.md
Normal 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
|
@ -90,6 +90,7 @@ module.exports = {
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/ban-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/exports': 'error',
|
||||
},
|
||||
|
@ -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 React, { useRef } from 'react'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Editor } from '@tiptap/core'
|
||||
import type { Editor } from '@tiptap/core'
|
||||
import { useEditorState } from '@tiptap/react'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
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 React, { useRef } from 'react'
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Editor } from '@tiptap/core'
|
||||
import React, { useCallback, useEffect, useRef } from 'react'
|
||||
import type { Editor } from '@tiptap/core'
|
||||
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
|
||||
|
@ -1,7 +1,8 @@
|
||||
import './styles.scss'
|
||||
|
||||
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 React from 'react'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Node } from '@tiptap/pm/model'
|
||||
import type { Node } from '@tiptap/pm/model'
|
||||
import { Decoration, DecorationSet } from '@tiptap/pm/view'
|
||||
|
||||
export default function (doc: Node): DecorationSet {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Node } from '@tiptap/pm/model'
|
||||
import type { Node } from '@tiptap/pm/model'
|
||||
import { Decoration, DecorationSet } from '@tiptap/pm/view'
|
||||
|
||||
export default function (doc: Node): DecorationSet {
|
||||
|
@ -1,6 +1,7 @@
|
||||
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 { renderToHTMLString, renderToMarkdown, renderToReactElement } from '@tiptap/static-renderer'
|
||||
import React, { useState } from 'react'
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Plugin, PluginKey } from '@tiptap/pm/state'
|
||||
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'
|
||||
|
||||
export const AnnotationPluginKey = new PluginKey('annotation')
|
||||
|
@ -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 {
|
||||
absolutePositionToRelativePosition,
|
||||
relativePositionToAbsolutePosition,
|
||||
ySyncPluginKey,
|
||||
} from '@tiptap/y-tiptap'
|
||||
import * as Y from 'yjs'
|
||||
import type * as Y from 'yjs'
|
||||
|
||||
import { AnnotationItem } from './AnnotationItem.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 {
|
||||
HTMLAttributes: {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Extension } from '@tiptap/core'
|
||||
import * as Y from 'yjs'
|
||||
import type * as Y from 'yjs'
|
||||
|
||||
import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin.js'
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
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 { 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 {
|
||||
issue?: Issue
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Node as ProsemirrorNode } from '@tiptap/pm/model'
|
||||
import type { Node as ProsemirrorNode } from '@tiptap/pm/model'
|
||||
|
||||
export interface Result {
|
||||
message: string
|
||||
|
@ -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 {
|
||||
fixHeader(level: number) {
|
||||
|
@ -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 {
|
||||
public regex = / ([,.!?:]) ?/g
|
||||
|
@ -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'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
@ -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'
|
||||
|
||||
export default (props: NodeViewProps) => {
|
||||
|
@ -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 { Context } from './Context.js'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react'
|
||||
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
export default ({ note }: { note: TNote }) => {
|
||||
const [modelValue, setModelValue] = useState(note.content)
|
||||
|
@ -3,7 +3,7 @@ import './styles.scss'
|
||||
import React from 'react'
|
||||
|
||||
import Note from './Note.jsx'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const props = defineProps<{ note: TNote }>()
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
import './styles.scss'
|
||||
|
||||
import Note from './Note.vue'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{ id: 'note-1', content: 'Some random note text' },
|
||||
|
@ -2,7 +2,7 @@ import { EditorContent, useEditor } from '@tiptap/react'
|
||||
import { StarterKit } from '@tiptap/starter-kit'
|
||||
import React, { useState } from 'react'
|
||||
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
export default ({ note }: { note: TNote }) => {
|
||||
const [modelValue, setModelValue] = useState(note.content)
|
||||
|
@ -3,7 +3,7 @@ import './styles.scss'
|
||||
import React from 'react'
|
||||
|
||||
import Note from './Note.jsx'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
import './styles.scss'
|
||||
|
||||
import Note from './Note.vue'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{ id: 'note-1', content: 'Some random note text' },
|
||||
|
@ -1,15 +1,16 @@
|
||||
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 LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'
|
||||
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin'
|
||||
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin'
|
||||
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
|
||||
import { EditorState } from 'lexical/LexicalEditorState'
|
||||
import type { EditorState } from 'lexical/LexicalEditorState'
|
||||
import React, { useRef } from 'react'
|
||||
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
export default ({ note }: { note: TNote }) => {
|
||||
const editorStateRef = useRef<EditorState>()
|
||||
|
@ -3,7 +3,7 @@ import './styles.css'
|
||||
import React from 'react'
|
||||
|
||||
import Note from './Note.jsx'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ import { StarterKit } from '@tiptap/starter-kit'
|
||||
import React from 'react'
|
||||
import * as Y from 'yjs'
|
||||
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
export default ({ note }: { note: TNote }) => {
|
||||
const doc = new Y.Doc()
|
||||
|
@ -3,7 +3,7 @@ import './styles.scss'
|
||||
import React from 'react'
|
||||
|
||||
import Note from './Note.jsx'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
import './styles.scss'
|
||||
|
||||
import Note from './Note.vue'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{ id: 'note-1', defaultContent: 'Some random note text' },
|
||||
|
@ -2,14 +2,15 @@ import './styles.css'
|
||||
|
||||
import { TiptapCollabProvider } from '@hocuspocus/provider'
|
||||
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 LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'
|
||||
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
|
||||
import React from 'react'
|
||||
import * as Y from 'yjs'
|
||||
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
export default ({ note }: { note: TNote }) => {
|
||||
const initialConfig: InitialConfigType = {
|
||||
|
@ -3,7 +3,7 @@ import './styles.css'
|
||||
import React from 'react'
|
||||
|
||||
import Note from './Note.jsx'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ import { StarterKit } from '@tiptap/starter-kit'
|
||||
import React, { useEffect } from 'react'
|
||||
import * as Y from 'yjs'
|
||||
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
export default ({ note }: { note: TNote }) => {
|
||||
const doc = new Y.Doc()
|
||||
|
@ -3,7 +3,7 @@ import './styles.scss'
|
||||
import React from 'react'
|
||||
|
||||
import Note from './Note.jsx'
|
||||
import { TNote } from './types.js'
|
||||
import type { TNote } from './types.js'
|
||||
|
||||
const notes: TNote[] = [
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
import './styles.scss'
|
||||
|
||||
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' }]
|
||||
</script>
|
||||
|
@ -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 { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types.js'
|
||||
import type { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types.js'
|
||||
|
||||
export class CommandManager {
|
||||
editor: Editor
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
||||
import { MarkType, Node as ProseMirrorNode, NodeType, Schema } from '@tiptap/pm/model'
|
||||
import { EditorState, Plugin, PluginKey, Transaction } from '@tiptap/pm/state'
|
||||
import type { MarkType, Node as ProseMirrorNode, NodeType, Schema } from '@tiptap/pm/model'
|
||||
import type { Plugin, PluginKey, Transaction } from '@tiptap/pm/state'
|
||||
import { EditorState } from '@tiptap/pm/state'
|
||||
import { EditorView } from '@tiptap/pm/view'
|
||||
|
||||
import { CommandManager } from './CommandManager.js'
|
||||
@ -28,7 +29,7 @@ import { resolveFocusPosition } from './helpers/resolveFocusPosition.js'
|
||||
import type { Storage } from './index.js'
|
||||
import { NodePos } from './NodePos.js'
|
||||
import { style } from './style.js'
|
||||
import {
|
||||
import type {
|
||||
CanCommands,
|
||||
ChainedCommands,
|
||||
DocumentType,
|
||||
|
@ -2,12 +2,13 @@ import type { Plugin } from '@tiptap/pm/state'
|
||||
|
||||
import type { Editor } from './Editor.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 { Mark } from './Mark.js'
|
||||
import type { Node } from './Node.js'
|
||||
import type { PasteRule } from './PasteRule.js'
|
||||
import type {
|
||||
AnyConfig,
|
||||
EditorEvents,
|
||||
Extensions,
|
||||
GlobalAttributes,
|
||||
@ -15,7 +16,6 @@ import type {
|
||||
ParentConfig,
|
||||
RawCommands,
|
||||
} from './types.js'
|
||||
import { AnyConfig } from './types.js'
|
||||
import { callOrReturn } from './utilities/callOrReturn.js'
|
||||
import { mergeDeep } from './utilities/mergeDeep.js'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { keymap } from '@tiptap/pm/keymap'
|
||||
import { Schema } from '@tiptap/pm/model'
|
||||
import { Plugin } from '@tiptap/pm/state'
|
||||
import { MarkViewConstructor, NodeViewConstructor } from '@tiptap/pm/view'
|
||||
import type { Schema } from '@tiptap/pm/model'
|
||||
import type { Plugin } from '@tiptap/pm/state'
|
||||
import type { MarkViewConstructor, NodeViewConstructor } from '@tiptap/pm/view'
|
||||
|
||||
import type { Editor } from './Editor.js'
|
||||
import {
|
||||
@ -18,10 +18,12 @@ import {
|
||||
splitExtensions,
|
||||
} from './helpers/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 { PasteRule, pasteRulesPlugin } from './PasteRule.js'
|
||||
import { AnyConfig, Extensions, RawCommands } from './types.js'
|
||||
import type { PasteRule } from './PasteRule.js'
|
||||
import { pasteRulesPlugin } from './PasteRule.js'
|
||||
import type { AnyConfig, Extensions, RawCommands } from './types.js'
|
||||
import { callOrReturn } from './utilities/callOrReturn.js'
|
||||
|
||||
export class ExtensionManager {
|
||||
|
@ -1,12 +1,14 @@
|
||||
import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model'
|
||||
import { EditorState, Plugin, TextSelection } from '@tiptap/pm/state'
|
||||
import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
|
||||
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 { Editor } from './Editor.js'
|
||||
import type { Editor } from './Editor.js'
|
||||
import { createChainableState } from './helpers/createChainableState.js'
|
||||
import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.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'
|
||||
|
||||
export type InputRuleMatch = {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ViewMutationRecord } from '@tiptap/pm/view'
|
||||
import type { ViewMutationRecord } from '@tiptap/pm/view'
|
||||
|
||||
import { Editor } from './Editor.js'
|
||||
import { MarkViewProps, MarkViewRendererOptions } from './types.js'
|
||||
import type { Editor } from './Editor.js'
|
||||
import type { MarkViewProps, MarkViewRendererOptions } from './types.js'
|
||||
import { isAndroid, isiOS } from './utilities/index.js'
|
||||
|
||||
export class MarkView<Component, Options extends MarkViewRendererOptions = MarkViewRendererOptions> {
|
||||
|
@ -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 { Content, Range } from './types.js'
|
||||
import type { Editor } from './Editor.js'
|
||||
import type { Content, Range } from './types.js'
|
||||
|
||||
export class NodePos {
|
||||
private resolvedPos: ResolvedPos
|
||||
|
@ -1,8 +1,8 @@
|
||||
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 { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types.js'
|
||||
import type { Editor as CoreEditor } from './Editor.js'
|
||||
import type { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } from './types.js'
|
||||
import { isAndroid } from './utilities/isAndroid.js'
|
||||
import { isiOS } from './utilities/isiOS.js'
|
||||
|
||||
|
@ -1,11 +1,13 @@
|
||||
import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model'
|
||||
import { EditorState, Plugin } from '@tiptap/pm/state'
|
||||
import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
|
||||
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 { Editor } from './Editor.js'
|
||||
import type { Editor } from './Editor.js'
|
||||
import { createChainableState } from './helpers/createChainableState.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 { isRegExp } from './utilities/isRegExp.js'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Transaction } from '@tiptap/pm/state'
|
||||
import type { Transaction } from '@tiptap/pm/state'
|
||||
|
||||
export interface TrackerResult {
|
||||
position: number
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { liftTarget } from '@tiptap/pm/transform'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Command, RawCommands } from '../types.js'
|
||||
import type { Command, RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createParagraphNear as originalCreateParagraphNear } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { TextSelection } from '@tiptap/pm/state'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { NodeType } from '@tiptap/pm/model'
|
||||
import type { NodeType } from '@tiptap/pm/model'
|
||||
|
||||
import { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Range, RawCommands } from '../types.js'
|
||||
import type { Range, RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { deleteSelection as originalDeleteSelection } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { exitCode as originalExitCode } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { MarkType } from '@tiptap/pm/model'
|
||||
import type { MarkType } from '@tiptap/pm/model'
|
||||
import { TextSelection } from '@tiptap/pm/state'
|
||||
|
||||
import { getMarkRange } from '../helpers/getMarkRange.js'
|
||||
import { getMarkType } from '../helpers/getMarkType.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Command, CommandProps, RawCommands } from '../types.js'
|
||||
import type { Command, CommandProps, RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { isTextSelection } from '../helpers/isTextSelection.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 { isiOS } from '../utilities/isiOS.js'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { CommandProps, RawCommands } from '../types.js'
|
||||
import type { CommandProps, RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -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' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -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 { selectionToInsertionEnd } from '../helpers/selectionToInsertionEnd.js'
|
||||
import { Content, Range, RawCommands } from '../types.js'
|
||||
import type { Content, Range, RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
joinUp as originalJoinUp,
|
||||
} from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { joinPoint } from '@tiptap/pm/transform'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { joinPoint } from '@tiptap/pm/transform'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { joinTextblockBackward as originalCommand } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { joinTextblockForward as originalCommand } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
import { isiOS } from '../utilities/isiOS.js'
|
||||
import { isMacOS } from '../utilities/isMacOS.js'
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
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 { isNodeActive } from '../helpers/isNodeActive.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { liftEmptyBlock as originalLiftEmptyBlock } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -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 { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { newlineInCode as originalNewlineInCode } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -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 { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
import { deleteProps } from '../utilities/deleteProps.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { AllSelection } from '@tiptap/pm/state'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { selectNodeBackward as originalSelectNodeBackward } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { selectNodeForward as originalSelectNodeForward } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { selectParentNode as originalSelectParentNode } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// TODO: add types to @types/prosemirror-commands
|
||||
import { selectTextblockEnd as originalSelectTextblockEnd } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// TODO: add types to @types/prosemirror-commands
|
||||
import { selectTextblockStart as originalSelectTextblockStart } from '@tiptap/pm/commands'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -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 { Content, RawCommands } from '../types.js'
|
||||
import type { Content, RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { MarkType, ResolvedPos } from '@tiptap/pm/model'
|
||||
import { EditorState, Transaction } from '@tiptap/pm/state'
|
||||
import type { MarkType, ResolvedPos } from '@tiptap/pm/model'
|
||||
import type { EditorState, Transaction } from '@tiptap/pm/state'
|
||||
|
||||
import { getMarkAttributes } from '../helpers/getMarkAttributes.js'
|
||||
import { getMarkType } from '../helpers/getMarkType.js'
|
||||
import { isTextSelection } from '../helpers/index.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { Plugin, PluginKey } from '@tiptap/pm/state'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,8 +1,8 @@
|
||||
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 { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { NodeSelection } from '@tiptap/pm/state'
|
||||
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
import { minMax } from '../utilities/minMax.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
|
@ -1,6 +1,6 @@
|
||||
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'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
|
@ -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 { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -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 { defaultBlockAt } from '../helpers/defaultBlockAt.js'
|
||||
import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
function ensureMarks(state: EditorState, splittableMarks?: string[]) {
|
||||
const marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks())
|
||||
|
@ -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 { canSplit } from '@tiptap/pm/transform'
|
||||
|
||||
import { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { getSplittedAttributes } from '../helpers/getSplittedAttributes.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { NodeType } from '@tiptap/pm/model'
|
||||
import { Transaction } from '@tiptap/pm/state'
|
||||
import type { NodeType } from '@tiptap/pm/model'
|
||||
import type { Transaction } from '@tiptap/pm/state'
|
||||
import { canJoin } from '@tiptap/pm/transform'
|
||||
|
||||
import { findParentNode } from '../helpers/findParentNode.js'
|
||||
import { getNodeType } from '../helpers/getNodeType.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 list = findParentNode(node => node.type === listType)(tr.selection)
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { MarkType } from '@tiptap/pm/model'
|
||||
import type { MarkType } from '@tiptap/pm/model'
|
||||
|
||||
import { getMarkType } from '../helpers/getMarkType.js'
|
||||
import { isMarkActive } from '../helpers/isMarkActive.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { NodeType } from '@tiptap/pm/model'
|
||||
import type { NodeType } from '@tiptap/pm/model'
|
||||
|
||||
import { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { isNodeActive } from '../helpers/isNodeActive.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { NodeType } from '@tiptap/pm/model'
|
||||
import type { NodeType } from '@tiptap/pm/model'
|
||||
|
||||
import { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { isNodeActive } from '../helpers/isNodeActive.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { MarkType } from '@tiptap/pm/model'
|
||||
import type { MarkType } from '@tiptap/pm/model'
|
||||
|
||||
import { getMarkRange } from '../helpers/getMarkRange.js'
|
||||
import { getMarkType } from '../helpers/getMarkType.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Mark, MarkType, Node, NodeType } from '@tiptap/pm/model'
|
||||
import { SelectionRange } from '@tiptap/pm/state'
|
||||
import type { Mark, MarkType, Node, NodeType } from '@tiptap/pm/model'
|
||||
import type { SelectionRange } from '@tiptap/pm/state'
|
||||
|
||||
import { getMarkType } from '../helpers/getMarkType.js'
|
||||
import { getNodeType } from '../helpers/getNodeType.js'
|
||||
import { getSchemaTypeNameByName } from '../helpers/getSchemaTypeNameByName.js'
|
||||
import { RawCommands } from '../types.js'
|
||||
import type { RawCommands } from '../types.js'
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Commands<ReturnType> {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user