Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: minor refactors

Abdullah Atta1025c4ec6e69
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
);
}