0.1.07 文件树拖拽与多思维导图

This commit is contained in:
liaibo
2026-01-08 06:28:14 +08:00
parent 9de2d69c55
commit 9af8b9e489
30 changed files with 817 additions and 410 deletions
+5 -5
View File
@@ -1,5 +1,4 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { SupabaseClient } from "@supabase/supabase-js";
import type { DocumentRecord, DocumentNode } from "@/lib/documents";
import type { SidebarSectionId, TrashRecord } from "@/components/sidebar/types";
import type { Database } from "@/types/supabase";
@@ -36,7 +35,8 @@ export async function fetchSidebarDataset(
throw new Error(`获取工作空间文档列表失败:${error.message}`);
}
const documents: DocumentRecord[] = (documentRows ?? []).map((row) => ({
const documentRowsAny = (documentRows ?? []) as any[];
const documents: DocumentRecord[] = documentRowsAny.map((row) => ({
access_scope: (row.access_scope ?? "private") as DocumentRecord["access_scope"],
id: row.id,
workspace_id: row.workspace_id,
@@ -61,7 +61,8 @@ export async function fetchSidebarDataset(
throw new Error(`获取垃圾桶内容失败:${trashError.message}`);
}
const trashedDocuments: TrashRecord[] = (trashRows ?? []).map((row) => ({
const trashRowsAny = (trashRows ?? []) as any[];
const trashedDocuments: TrashRecord[] = trashRowsAny.map((row) => ({
id: row.id,
title: row.title,
parent_id: row.parent_id,
@@ -69,8 +70,7 @@ export async function fetchSidebarDataset(
access_scope: (row.access_scope ?? "private") as DocumentRecord["access_scope"],
}));
const mindmapDocs =
documentRows?.filter((row) => row.mindmap_data != null).map((row) => row.id) ?? [];
const mindmapDocs = documentRowsAny.filter((row) => row.mindmap_data != null).map((row) => row.id);
const { data: assetRows, error: assetError } = await client
.from("media_assets")