refactor(editor): rename store api (#9518)

This commit is contained in:
Saul-Mirone
2025-01-04 12:51:56 +00:00
parent 650e4fb6b2
commit c773982ced
83 changed files with 293 additions and 290 deletions
@@ -55,7 +55,7 @@ export class SurfaceRefNotePortal extends WithDisposable(ShadowlessElement) {
const doc = this.model.doc;
this._disposables.add(() => {
doc.blockCollection.clearQuery(query, true);
doc.doc.clearQuery(query, true);
});
}
@@ -114,7 +114,7 @@ export class SurfaceRefNotePortal extends WithDisposable(ShadowlessElement) {
console.error('Query is not set before rendering note preview');
return nothing;
}
const doc = this.model.doc.blockCollection.getDoc({
const doc = this.model.doc.doc.getBlocks({
query: this.query,
readonly: true,
});
@@ -336,8 +336,8 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
];
}
const doc = [...this.std.collection.docs.values()]
.map(doc => doc.getDoc())
const doc = [...this.std.workspace.docs.values()]
.map(doc => doc.getBlocks())
.find(
doc =>
doc.getBlock(this.model.reference) ||
@@ -370,7 +370,7 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
this._referencedModel =
referencedModel && referencedModel.xywh ? referencedModel : null;
this._previewDoc = this.doc.collection.getDoc(docId, {
this._previewDoc = this.doc.workspace.getDoc(docId, {
readonly: true,
});
this._referenceXYWH = this._referencedModel?.xywh ?? null;