refactor: setup files (#8201)

This commit is contained in:
forehalo
2024-09-13 07:27:07 +00:00
parent 3c7cf658c5
commit c76b4d70b0
47 changed files with 155 additions and 139 deletions
@@ -6,7 +6,7 @@ import { listHistoryQuery, recoverDocMutation } from '@affine/graphql';
import { i18nTime } from '@affine/i18n';
import { assertEquals } from '@blocksuite/global/utils';
import { DocCollection } from '@blocksuite/store';
import { globalBlockSuiteSchema } from '@toeverything/infra';
import { getAFFiNEWorkspaceSchema } from '@toeverything/infra';
import { useEffect, useMemo } from 'react';
import useSWRImmutable from 'swr/immutable';
import {
@@ -108,7 +108,7 @@ const getOrCreateShellWorkspace = (workspaceId: string) => {
blobSources: {
main: blobStorage,
},
schema: globalBlockSuiteSchema,
schema: getAFFiNEWorkspaceSchema(),
});
docCollectionMap.set(workspaceId, docCollection);
docCollection.doc.emit('sync', [true, docCollection.doc]);
@@ -4,8 +4,7 @@ import {
useJournalInfoHelper,
useJournalRouteHelper,
} from '@affine/core/hooks/use-journal';
import type { DocCollection } from '@affine/core/shared';
import type { Doc } from '@blocksuite/store';
import type { Doc, DocCollection } from '@blocksuite/store';
import dayjs from 'dayjs';
import { useEffect, useRef, useState } from 'react';
@@ -1,7 +1,7 @@
import { Button } from '@affine/component';
import { useJournalRouteHelper } from '@affine/core/hooks/use-journal';
import type { DocCollection } from '@affine/core/shared';
import { useI18n } from '@affine/i18n';
import type { DocCollection } from '@blocksuite/store';
import { useCallback } from 'react';
export interface JournalTodayButtonProps {
@@ -1,11 +1,10 @@
import { toast } from '@affine/component';
import { WorkbenchService } from '@affine/core/modules/workbench';
import type { DocMode } from '@blocksuite/blocks';
import type { DocCollection } from '@blocksuite/store';
import { DocsService, useServices } from '@toeverything/infra';
import { useCallback, useMemo } from 'react';
import type { DocCollection } from '../../../shared';
export const usePageHelper = (docCollection: DocCollection) => {
const { docsService, workbenchService } = useServices({
DocsService,
@@ -2,8 +2,8 @@ import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
import { track } from '@affine/core/mixpanel';
import { useI18n } from '@affine/i18n';
import { ImportIcon } from '@blocksuite/icons/rc';
import type { DocCollection } from '@blocksuite/store';
import type { DocCollection } from '../../shared';
import { MenuItem } from '../app-sidebar';
import { usePageHelper } from '../blocksuite/block-suite-page-list/utils';
@@ -4,10 +4,10 @@ import {
useJournalRouteHelper,
} from '@affine/core/hooks/use-journal';
import { WorkbenchService } from '@affine/core/modules/workbench';
import type { DocCollection } from '@affine/core/shared';
import { isNewTabTrigger } from '@affine/core/utils';
import { useI18n } from '@affine/i18n';
import { TodayIcon, TomorrowIcon, YesterdayIcon } from '@blocksuite/icons/rc';
import type { DocCollection } from '@blocksuite/store';
import { useLiveData, useService } from '@toeverything/infra';
import { type MouseEvent } from 'react';