chore: bump blocksuite (#5138)

This commit is contained in:
Flrande
2023-12-04 12:02:35 +00:00
parent 7878ce5c2c
commit a2784c352f
26 changed files with 460 additions and 393 deletions

View File

@@ -19,12 +19,12 @@
"devDependencies": {
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@blocksuite/block-std": "0.0.0-20231124123613-7c06e95d-nightly",
"@blocksuite/blocks": "0.0.0-20231124123613-7c06e95d-nightly",
"@blocksuite/editor": "0.0.0-20231124123613-7c06e95d-nightly",
"@blocksuite/global": "0.0.0-20231124123613-7c06e95d-nightly",
"@blocksuite/lit": "0.0.0-20231124123613-7c06e95d-nightly",
"@blocksuite/store": "0.0.0-20231124123613-7c06e95d-nightly",
"@blocksuite/block-std": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/blocks": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/editor": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/global": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/lit": "0.0.0-20231130092516-0f858b95-nightly",
"@blocksuite/store": "0.0.0-20231130092516-0f858b95-nightly",
"@testing-library/react": "^14.0.0",
"@types/image-blob-reduce": "^4.1.3",
"@types/lodash.debounce": "^4.0.7",

View File

@@ -60,7 +60,7 @@ export function useBlockSuitePagePreview(page: Page | null): Atom<string> {
page.slots.ready.on(() => {
set(getPagePreviewText(page));
}),
page.slots.yUpdated.on(() => {
page.slots.blockUpdated.on(() => {
set(getPagePreviewText(page));
}),
];

View File

@@ -5,12 +5,9 @@ import { useBlockSuiteWorkspacePage } from './use-block-suite-workspace-page';
const weakMap = new WeakMap<Page, Atom<string[]>>();
function getPageReferences(page: Page): string[] {
// todo: is there a way to use page indexer to get all references?
return ['affine:paragraph', 'affine:list', 'affine:database']
.flatMap(f => page.getBlockByFlavour(f))
.flatMap(b => b.text?.toDelta())
.map(v => v?.attributes?.reference?.pageId)
.filter(Boolean);
return Object.values(
page.workspace.indexer.backlink.linkIndexMap[page.id] ?? {}
).flatMap(linkNodes => linkNodes.map(linkNode => linkNode.pageId));
}
const getPageReferencesAtom = (page: Page | null) => {
@@ -25,7 +22,7 @@ const getPageReferencesAtom = (page: Page | null) => {
page.slots.ready.on(() => {
set(getPageReferences(page));
}),
page.slots.yUpdated.on(() => {
page.workspace.indexer.backlink.slots.indexUpdated.on(() => {
set(getPageReferences(page));
}),
];