mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
chore(editor): rename std.doc to std.store (#9596)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user