feat: seperate createDoc and createStore (#11182)

This commit is contained in:
Saul-Mirone
2025-03-26 11:03:47 +00:00
parent d6093e1d66
commit 0a8d8e0a6b
70 changed files with 337 additions and 312 deletions

View File

@@ -36,15 +36,16 @@ describe('editor host', () => {
const collection = new TestWorkspace(createTestOptions());
collection.meta.initialize();
const doc = collection.createDoc({ id: 'home', extensions });
const doc = collection.createDoc('home');
const store = doc.getStore({ extensions });
doc.load();
const rootId = doc.addBlock('test:page');
const noteId = doc.addBlock('test:note', {}, rootId);
const headingId = doc.addBlock('test:heading', { type: 'h1' }, noteId);
const headingBlock = doc.getBlock(headingId)!;
const rootId = store.addBlock('test:page');
const noteId = store.addBlock('test:note', {}, rootId);
const headingId = store.addBlock('test:heading', { type: 'h1' }, noteId);
const headingBlock = store.getBlock(headingId)!;
const editorContainer = new TestEditorContainer();
editorContainer.doc = doc;
editorContainer.doc = store;
editorContainer.specs = testSpecs;
document.body.append(editorContainer);