mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat: bump blocksuite (#6541)
## Features - https://github.com/toeverything/BlockSuite/pull/6737 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/6735 @pengx17 - https://github.com/toeverything/BlockSuite/pull/6740 @regischen ## Bugfix - https://github.com/toeverything/BlockSuite/pull/6744 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/6742 @doouding ## Refactor ## Misc - https://github.com/toeverything/BlockSuite/pull/6741 @fundon
This commit is contained in:
@@ -42,7 +42,7 @@ export function useDocMetaHelper(docCollection: DocCollection) {
|
||||
setDocReadonly: (docId: string, readonly: boolean) => {
|
||||
const page = docCollection.getDoc(docId);
|
||||
assertExists(page);
|
||||
page.awarenessStore.setReadonly(page, readonly);
|
||||
page.awarenessStore.setReadonly(page.blockCollection, readonly);
|
||||
},
|
||||
setDocMeta: (docId: string, docMeta: Partial<DocMeta>) => {
|
||||
docCollection.meta.setDocMeta(docId, docMeta);
|
||||
|
||||
@@ -63,14 +63,16 @@ export const useJournalHelper = (docCollection: DocCollection) => {
|
||||
const getJournalsByDate = useCallback(
|
||||
(maybeDate: MaybeDate) => {
|
||||
const day = dayjs(maybeDate);
|
||||
return Array.from(docCollection.docs.values()).filter(page => {
|
||||
const pageId = page.id;
|
||||
if (!isPageJournal(pageId)) return false;
|
||||
if (page.meta?.trash) return false;
|
||||
const journalDate = adapter.getJournalPageDateString(page.id);
|
||||
if (!journalDate) return false;
|
||||
return day.isSame(journalDate, 'day');
|
||||
});
|
||||
return Array.from(docCollection.docs.values())
|
||||
.map(blockCollection => blockCollection.getDoc())
|
||||
.filter(page => {
|
||||
const pageId = page.id;
|
||||
if (!isPageJournal(pageId)) return false;
|
||||
if (page.meta?.trash) return false;
|
||||
const journalDate = adapter.getJournalPageDateString(page.id);
|
||||
if (!journalDate) return false;
|
||||
return day.isSame(journalDate, 'day');
|
||||
});
|
||||
},
|
||||
[adapter, isPageJournal, docCollection.docs]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user