Merge branch 'feat/filesystem_and_search' of github.com:toeverything/AFFiNE into feat/filesystem_and_search

This commit is contained in:
DiamondThree
2022-12-20 11:42:54 +08:00
4 changed files with 1170 additions and 3460 deletions
@@ -1,10 +1,10 @@
import { createContext, useContext } from 'react';
import { AccessTokenMessage } from '@pathfinder/data-services';
import type { Workspace } from '@pathfinder/data-services';
import { AccessTokenMessage } from '@pathfinder/data-services';
import type {
Workspace as StoreWorkspace,
Page as StorePage,
PageMeta,
Workspace as StoreWorkspace,
} from '@blocksuite/store';
import type { EditorContainer } from '@blocksuite/editor';
@@ -57,6 +57,5 @@ export const AppState = createContext<AppStateContext>({
});
export const useAppState = () => {
const state = useContext(AppState);
return state;
return useContext(AppState);
};
@@ -1,13 +1,12 @@
import { useEffect } from 'react';
import type { Page } from '@blocksuite/store';
import {
Workspace,
createWebsocketDocProvider,
IndexedDBDocProvider,
Workspace,
} from '@blocksuite/store';
import '@blocksuite/blocks';
import '@blocksuite/blocks/style';
import type { Page } from '@blocksuite/store';
import { BlockSchema, createEditor } from '@blocksuite/editor';
import type { AppStateContext } from './context';
@@ -66,8 +65,7 @@ const DynamicBlocksuite = ({
useEffect(() => {
const createEditorHandler: CreateEditorHandler = (page: Page) => {
const editor = createEditor(page);
return editor;
return createEditor(page);
};
setCreateEditorHandler(createEditorHandler);
@@ -10,7 +10,7 @@ export const useLoadWorkspace = () => {
useEffect(() => {
loadWorkspace?.(workspaceId);
}, [workspaceId]);
}, [loadWorkspace, workspaceId]);
return currentWorkspaceId === workspaceId ? currentWorkspace : null;
};
@@ -24,7 +24,7 @@ export const useLoadPage = () => {
useEffect(() => {
loadPage(pageId);
}, [workspace, pageId]);
}, [workspace, pageId, loadPage]);
return currentPage?.pageId === pageId ? currentPage : null;
};
+1162 -3449
View File
File diff suppressed because it is too large Load Diff