editor: minor refactors

This commit is contained in:
Abdullah Atta
2026-01-16 11:17:49 +05:00
parent c44f9f685d
commit 1025c4ec6e
2 changed files with 7 additions and 8 deletions

View File

@@ -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
[]

View File

@@ -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
);
}