mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved display of image and attachment blocks by ensuring image captions are shown as content for images, while attachment names remain as content for attachments. <!-- end of auto-generated comment: release notes by coderabbit.ai --> #### PR Dependency Tree * **PR #12815** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) --------- Co-authored-by: fengmk2 <fengmk2@gmail.com>
Affine Blocksuite format YDoc reader
Usage
read rootYDoc
import { readAllDocsFromRootDoc } from '@affine/reader';
const docs = readAllDocsFromRootDoc(rootDoc);
console.log(Array.from(docsWithTrash.entries()));
// [
// 'doc-id-1', { title: 'test doc title' },
// // ...
// ]
read YDoc
import { readAllBlocksFromDoc } from '@affine/reader';
const blocks = readAllBlocksFromDoc(doc);