diff --git a/apps/client/src/features/editor/components/callout/callout-menu.tsx b/apps/client/src/features/editor/components/callout/callout-menu.tsx index bdc71993..cdfc3216 100644 --- a/apps/client/src/features/editor/components/callout/callout-menu.tsx +++ b/apps/client/src/features/editor/components/callout/callout-menu.tsx @@ -1,7 +1,7 @@ import { BubbleMenu as BaseBubbleMenu } from "@tiptap/react/menus"; import { findParentNode, posToDOMRect, useEditorState } from "@tiptap/react"; import React, { useCallback } from "react"; -import { Node as PMNode } from "prosemirror-model"; +import { Node as PMNode } from "@tiptap/pm/model"; import { EditorMenuProps, ShouldShowProps, diff --git a/apps/client/src/features/editor/components/columns/columns-menu.tsx b/apps/client/src/features/editor/components/columns/columns-menu.tsx index b0c94c90..0ee99508 100644 --- a/apps/client/src/features/editor/components/columns/columns-menu.tsx +++ b/apps/client/src/features/editor/components/columns/columns-menu.tsx @@ -1,7 +1,7 @@ import { BubbleMenu as BaseBubbleMenu } from "@tiptap/react/menus"; import { findParentNode, posToDOMRect, useEditorState } from "@tiptap/react"; import React, { useCallback, useRef, useState } from "react"; -import { DOMSerializer, Node as PMNode } from "prosemirror-model"; +import { DOMSerializer, Node as PMNode } from "@tiptap/pm/model"; import { EditorMenuProps, ShouldShowProps, @@ -56,8 +56,7 @@ const threeColumnPresets: LayoutPreset[] = [ label: "Left wide", icon: IconLayoutSidebarRight, }, - { layout: "three_right_wide", label: "Right wide", icon: IconLayoutSidebar - }, + { layout: "three_right_wide", label: "Right wide", icon: IconLayoutSidebar }, ]; function getPresetsForCount(count: number): LayoutPreset[] { @@ -243,14 +242,11 @@ export function ColumnsMenu({ editor }: EditorMenuProps) { }, [editor]); const handleDelete = useCallback(() => { - const { state } = editor; const parent = findParentNode( (node: PMNode) => node.type.name === "columns", - )(state.selection); + )(editor.state.selection); if (!parent) return; - const { tr } = state; - tr.delete(parent.pos, parent.pos + parent.node.nodeSize); - editor.view.dispatch(tr); + editor.chain().focus().setNodeSelection(parent.pos).deleteSelection().run(); }, [editor]); const columnCount = editorState?.columnCount || 2; @@ -328,7 +324,11 @@ export function ColumnsMenu({ editor }: EditorMenuProps) {
- + ; diff --git a/packages/editor-ext/src/lib/columns/columns.ts b/packages/editor-ext/src/lib/columns/columns.ts index 9b5c93d1..9e37d5a6 100644 --- a/packages/editor-ext/src/lib/columns/columns.ts +++ b/packages/editor-ext/src/lib/columns/columns.ts @@ -1,7 +1,7 @@ import { Node, mergeAttributes, findParentNode } from "@tiptap/core"; -import { Fragment, Node as PMNode } from "prosemirror-model"; -import { Plugin, PluginKey, TextSelection } from "prosemirror-state"; -import { Decoration, DecorationSet } from "prosemirror-view"; +import { Fragment, Node as PMNode } from "@tiptap/pm/model"; +import { Plugin, PluginKey, TextSelection } from "@tiptap/pm/state"; +import { Decoration, DecorationSet } from "@tiptap/pm/view"; export type ColumnsLayout = | "two_equal" diff --git a/packages/editor-ext/src/lib/heading/heading.ts b/packages/editor-ext/src/lib/heading/heading.ts index 26f6f0d4..c9e3703f 100644 --- a/packages/editor-ext/src/lib/heading/heading.ts +++ b/packages/editor-ext/src/lib/heading/heading.ts @@ -2,8 +2,8 @@ import TiptapHeading, { HeadingOptions as TiptapHeadingOptions, } from "@tiptap/extension-heading"; import { mergeAttributes } from "@tiptap/react"; -import { Decoration, DecorationSet } from "prosemirror-view"; -import { Plugin } from "prosemirror-state"; +import { Decoration, DecorationSet } from "@tiptap/pm/view"; +import { Plugin } from "@tiptap/pm/state"; import { copyToClipboard } from "../utils"; const copyIcon = ``;