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

View File

@@ -138,7 +138,7 @@ export class Clipboard extends LifeCycleWatcher {
const payload = {
file: item,
assets: job.assetsManager,
workspaceId: doc.collection.id,
workspaceId: doc.workspace.id,
pageId: doc.id,
};
const result = await adapterInstance.toSlice(

View File

@@ -30,7 +30,7 @@ export abstract class BlockService extends Extension {
readonly specSlots = getSlots();
get collection() {
return this.std.collection;
return this.std.workspace;
}
get doc() {

View File

@@ -74,8 +74,8 @@ export class BlockStdScope {
return this.get(Clipboard);
}
get collection() {
return this.doc.collection;
get workspace() {
return this.doc.workspace;
}
get command() {
@@ -170,12 +170,12 @@ export class BlockStdScope {
getJob(middlewares: JobMiddleware[] = []) {
return new Job({
schema: this.collection.schema,
blobCRUD: this.collection.blobSync,
schema: this.workspace.schema,
blobCRUD: this.workspace.blobSync,
docCRUD: {
create: (id: string) => this.collection.createDoc({ id }),
get: (id: string) => this.collection.getDoc(id),
delete: (id: string) => this.collection.removeDoc(id),
create: (id: string) => this.workspace.createDoc({ id }),
get: (id: string) => this.workspace.getDoc(id),
delete: (id: string) => this.workspace.removeDoc(id),
},
middlewares,
});

View File

@@ -58,7 +58,7 @@ export class SelectionManager extends LifeCycleWatcher {
};
private get _store() {
return this.std.collection.awarenessStore;
return this.std.workspace.awarenessStore;
}
get id() {