chore(editor): rename std.doc to std.store (#9596)

This commit is contained in:
Saul-Mirone
2025-01-09 04:16:28 +00:00
parent 58ce86533e
commit d21ef47ae8
89 changed files with 359 additions and 348 deletions

View File

@@ -28,7 +28,7 @@ export const autoArrangeElementsCommand: Command<never, never, {}> = (
ctx,
next
) => {
const { updateBlock } = ctx.std.doc;
const { updateBlock } = ctx.std.store;
const gfx = ctx.std.get(GfxControllerIdentifier);
const elements = gfx.selection.selectedElements;
@@ -46,7 +46,7 @@ export const autoResizeElementsCommand: Command<never, never, {}> = (
ctx,
next
) => {
const { updateBlock } = ctx.std.doc;
const { updateBlock } = ctx.std.store;
const gfx = ctx.std.get(GfxControllerIdentifier);
const elements = gfx.selection.selectedElements;

View File

@@ -75,7 +75,7 @@ export class EdgelessCRUDExtension extends Extension {
index: gfx.layer.generateIndex(),
};
return this.std.doc.addBlock(
return this.std.store.addBlock(
flavour as never,
nProps,
parentId,
@@ -123,14 +123,14 @@ export class EdgelessCRUDExtension extends Extension {
return;
}
const block = this.std.doc.getBlockById(id);
const block = this.std.store.getBlockById(id);
if (block) {
const key = getLastPropsKey(
block.flavour as BlockSuite.EdgelessModelKeys,
{ ...block.yBlock.toJSON(), ...props }
);
key && this.std.get(EditPropsStore).recordLastProps(key, props);
this.std.doc.updateBlock(block, props);
this.std.store.updateBlock(block, props);
}
};
@@ -141,7 +141,7 @@ export class EdgelessCRUDExtension extends Extension {
}
const el =
surface.getElementById(id) ??
(this.std.doc.getBlockById(
(this.std.store.getBlockById(
id
) as BlockSuite.EdgelessBlockModelType | null);
return el;

View File

@@ -93,7 +93,7 @@ export function addNote(
});
const gfx = std.get(GfxControllerIdentifier);
const doc = std.doc;
const doc = std.store;
const blockId = doc.addBlock(
options.childFlavour as BlockSuite.Flavour,