refactor(editor): rename store api (#9518)
This commit is contained in:
@@ -37,7 +37,7 @@ const snapshotTest = async (snapshotUrl: string, elementsCount: number) => {
|
||||
throw e;
|
||||
});
|
||||
const [newDoc] = await transformer.importDocs(
|
||||
window.editor.doc.collection,
|
||||
window.editor.doc.workspace,
|
||||
snapshotFile
|
||||
);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ async function createEditor(collection: TestWorkspace, mode: DocMode = 'page') {
|
||||
const app = document.createElement('div');
|
||||
const blockCollection = collection.docs.values().next().value;
|
||||
assertExists(blockCollection, 'Need to create a doc first');
|
||||
const doc = blockCollection.getDoc();
|
||||
const doc = blockCollection.getBlocks();
|
||||
const editor = new AffineEditorContainer();
|
||||
editor.doc = doc;
|
||||
editor.mode = mode;
|
||||
|
||||
@@ -44,7 +44,7 @@ export class CommentManager {
|
||||
}
|
||||
|
||||
const { quote, range } = parseResult;
|
||||
const id = this.host.doc.collection.idGenerator();
|
||||
const id = this.host.doc.workspace.idGenerator();
|
||||
const comment: Comment = {
|
||||
id,
|
||||
date: Date.now(),
|
||||
|
||||
@@ -84,7 +84,7 @@ export class DocTitle extends WithDisposable(ShadowlessElement) {
|
||||
};
|
||||
|
||||
private readonly _updateTitleInMeta = () => {
|
||||
this.doc.collection.meta.setDocMeta(this.doc.id, {
|
||||
this.doc.workspace.meta.setDocMeta(this.doc.id, {
|
||||
title: this._rootModel.title.toString(),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -170,7 +170,7 @@ export class OutlineBlockPreview extends SignalWatcher(
|
||||
if (delta.attributes?.reference) {
|
||||
// If linked doc, render linked doc icon and the doc title.
|
||||
const refAttribute = delta.attributes.reference;
|
||||
const refMeta = block.doc.collection.meta.docMetas.find(
|
||||
const refMeta = block.doc.workspace.meta.docMetas.find(
|
||||
doc => doc.id === refAttribute.pageId
|
||||
);
|
||||
const unavailable = !refMeta;
|
||||
|
||||
Reference in New Issue
Block a user