feat(editor): improve api for store, and add docs (#10941)

This commit is contained in:
Saul-Mirone committed 2025-03-17 16:30:59 +00:00
1 parent b0aa2c90fd
commit 3de7d85eea
47 files changed
+1212 -210

No files matched your search

@@ -67,7 +67,7 @@ export async function getNoteRect(page: Page, noteId: string) {
const xywh: string | null = await page.evaluate(
([noteId]) => {
const doc = window.collection.getDoc('doc:home');
const block = doc?.getBlockById(noteId);
const block = doc?.getModelById(noteId);
if (block?.flavour === 'affine:note') {
return (block as NoteBlockModel).xywh;
} else {
@@ -85,7 +85,7 @@ export async function getNoteProps(page: Page, noteId: string) {
const props = await page.evaluate(
([id]) => {
const doc = window.collection.getDoc('doc:home');
const block = doc?.getBlockById(id);
const block = doc?.getModelById(id);
if (block?.flavour === 'affine:note') {
return (block as NoteBlockModel).keys.reduce(
(pre, key) => {