mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
feat(editor): improve api for store, and add docs (#10941)
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user