refactor(core): move workspace implementation to affine (#9504)

This commit is contained in:
Saul-Mirone
2025-01-03 08:13:57 +00:00
parent 897c7d4284
commit cfd64f1fa5
18 changed files with 284 additions and 48 deletions

View File

@@ -1,16 +1,17 @@
import { WorkspaceImpl } from '@affine/core/modules/workspace/impl/workspace';
import { AffineSchemas } from '@blocksuite/affine/blocks';
import type { Doc, DocSnapshot } from '@blocksuite/affine/store';
import { DocCollection, Job, Schema } from '@blocksuite/affine/store';
import { Job, Schema } from '@blocksuite/affine/store';
const getCollection = (() => {
let collection: DocCollection | null = null;
let collection: WorkspaceImpl | null = null;
return async function () {
if (collection) {
return collection;
}
const schema = new Schema();
schema.register(AffineSchemas);
collection = new DocCollection({ schema });
collection = new WorkspaceImpl({ schema });
collection.meta.initialize();
return collection;
};