mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 22:18:54 +08:00
chore(editor): move helper to playground (#9498)
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
import { AffineSchemas } from '@blocksuite/blocks/schemas';
|
||||
import { DocCollection, Schema } from '@blocksuite/store';
|
||||
|
||||
export function createEmptyDoc() {
|
||||
const schema = new Schema().register(AffineSchemas);
|
||||
const collection = new DocCollection({ schema });
|
||||
collection.meta.initialize();
|
||||
const doc = collection.createDoc();
|
||||
|
||||
return {
|
||||
doc,
|
||||
init() {
|
||||
doc.load();
|
||||
const rootId = doc.addBlock('affine:page', {});
|
||||
doc.addBlock('affine:surface', {}, rootId);
|
||||
const noteId = doc.addBlock('affine:note', {}, rootId);
|
||||
doc.addBlock('affine:paragraph', {}, noteId);
|
||||
return doc;
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import '@blocksuite/affine-block-surface/effects';
|
||||
|
||||
export * from './editors';
|
||||
export * from './fragments';
|
||||
export * from './helpers';
|
||||
|
||||
const env =
|
||||
typeof globalThis !== 'undefined'
|
||||
|
||||
Reference in New Issue
Block a user