From 22f33bab7c2fead1d2d90dc0d1af946984ec38ea Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Wed, 25 Feb 2026 22:41:54 +0000 Subject: [PATCH] cleanups --- .../editor/components/callout/callout-menu.tsx | 2 +- .../editor/components/columns/columns-menu.tsx | 18 +++++++++--------- .../editor/components/drawio/drawio-menu.tsx | 2 +- .../components/excalidraw/excalidraw-menu.tsx | 2 +- .../editor/components/image/image-menu.tsx | 2 +- .../editor/components/video/video-menu.tsx | 2 +- packages/editor-ext/src/lib/columns/column.ts | 2 +- packages/editor-ext/src/lib/columns/columns.ts | 6 +++--- packages/editor-ext/src/lib/heading/heading.ts | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) 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) {
-