mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 05:47:09 +08:00
chore: bump blocksuite (#5138)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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));
|
||||
}),
|
||||
];
|
||||
|
||||
@@ -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));
|
||||
}),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user