From 1025c4ec6e69e1b9b43ffa19fa07c988df6f8ac8 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Fri, 16 Jan 2026 11:17:49 +0500 Subject: [PATCH] editor: minor refactors --- packages/editor/src/toolbar/tools/table.tsx | 4 ++-- packages/editor/src/utils/prosemirror.ts | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/editor/src/toolbar/tools/table.tsx b/packages/editor/src/toolbar/tools/table.tsx index e9088e35f..6c09aad11 100644 --- a/packages/editor/src/toolbar/tools/table.tsx +++ b/packages/editor/src/toolbar/tools/table.tsx @@ -175,8 +175,8 @@ export function TableProperties(props: ToolProps) { splitCells(editor), cellProperties(editor), { type: "separator", key: "tableSeperator" }, - deleteTable(editor), - exportToCSV(editor) + exportToCSV(editor), + deleteTable(editor) ], // eslint-disable-next-line react-hooks/exhaustive-deps [] diff --git a/packages/editor/src/utils/prosemirror.ts b/packages/editor/src/utils/prosemirror.ts index a10801f21..5eb2af7b9 100644 --- a/packages/editor/src/utils/prosemirror.ts +++ b/packages/editor/src/utils/prosemirror.ts @@ -34,8 +34,7 @@ import { Slice, DOMParser, Schema, - Fragment, - Node + Fragment } from "prosemirror-model"; import { EditorState, Selection, Transaction } from "prosemirror-state"; import TextStyle from "@tiptap/extension-text-style"; @@ -420,10 +419,10 @@ export function ensureLeadingParagraph(node: Node, schema: Schema): Fragment { * @public */ export function changedDescendants( - old: Node, - cur: Node, + old: ProsemirrorNode, + cur: ProsemirrorNode, offset: number, - f: (newNode: Node, pos: number, oldNode?: Node) => void + f: (newNode: ProsemirrorNode, pos: number, oldNode?: ProsemirrorNode) => void ): void { const oldSize = old.childCount, curSize = cur.childCount; @@ -443,7 +442,7 @@ export function changedDescendants( child.nodesBetween( 0, child.content.size, - f as (node: Node, pos: number) => void, + f as (node: ProsemirrorNode, pos: number) => void, offset + 1 ); }