chore: save current changes

This commit is contained in:
liaibo
2025-11-23 20:04:29 +08:00
parent 994dd4e67c
commit 5d0e4c4cb6
10 changed files with 695 additions and 191 deletions
@@ -14,6 +14,7 @@ import {
} from "@blocknote/react";
import { useRouter } from "next/navigation";
import type { CustomBlockSchema } from "../schema";
import { deleteOnlineTable } from "@/lib/online-table";
type InlineNode = { text?: unknown };
type TableMenuBlock = Parameters<
@@ -72,6 +73,16 @@ const CustomDragHandleMenu = ({ block, currentDocumentId }: CustomDragProps) =>
void removePageReference();
return;
}
if (block.type === "onlineTable") {
const tableId = block.props.tableId as string | undefined;
if (tableId) {
void deleteOnlineTable(tableId)
.catch((error) => console.error("删除在线表格失败", error));
if (typeof window !== "undefined") {
window.dispatchEvent(new CustomEvent("online-table-deleted", { detail: { tableId } }));
}
}
}
editor.removeBlocks([block.id]);
}, [block, editor, removePageReference]);