Files
AFFiNE-Mirror/packages/common/reader
EYHN 04f3d88e2c feat(nbstore): add more data to indexer (#12815)
<!-- 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>
2025-06-13 18:30:57 +08:00
..

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);