mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-21 12:02:15 +08:00
feat(editor): improve api for store, and add docs (#10941)
This commit is contained in:
@@ -129,7 +129,7 @@ export class EdgelessCRUDExtension extends Extension {
|
||||
return;
|
||||
}
|
||||
|
||||
const block = this.std.store.getBlockById(id);
|
||||
const block = this.std.store.getModelById(id);
|
||||
if (block) {
|
||||
const key = getLastPropsKey(block.flavour, {
|
||||
...block.yBlock.toJSON(),
|
||||
@@ -145,7 +145,7 @@ export class EdgelessCRUDExtension extends Extension {
|
||||
if (!surface) {
|
||||
return null;
|
||||
}
|
||||
const el = surface.getElementById(id) ?? this.std.store.getBlockById(id);
|
||||
const el = surface.getElementById(id) ?? this.std.store.getModelById(id);
|
||||
return el as GfxModel | null;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -602,7 +602,7 @@ function getNotesInFrameBound(
|
||||
): NoteBlockModel[] {
|
||||
const bound = Bound.deserialize(frame.xywh);
|
||||
|
||||
return (doc.getBlockByFlavour('affine:note') as NoteBlockModel[]).filter(
|
||||
return (doc.getModelsByFlavour('affine:note') as NoteBlockModel[]).filter(
|
||||
ele => {
|
||||
const xywh = Bound.deserialize(ele.xywh);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user