refactor(core): move block collection to affine and implement as doc (#9514)

This commit is contained in:
Saul-Mirone
2025-01-04 06:28:54 +00:00
parent 4cb186def2
commit dcf4993265
39 changed files with 595 additions and 192 deletions

View File

@@ -17,6 +17,7 @@ import {
type DraftModel,
type Query,
Slice,
Text,
} from '@blocksuite/store';
import { render, type TemplateResult } from 'lit';
@@ -407,7 +408,7 @@ export function createLinkedDocFromSlice(
const linkedDoc = doc.collection.createDoc({});
linkedDoc.load(() => {
const rootId = linkedDoc.addBlock('affine:page', {
title: new doc.Text(docTitle),
title: new Text(docTitle),
});
linkedDoc.addBlock('affine:surface', {}, rootId);
const noteId = linkedDoc.addBlock('affine:note', {}, rootId);