diff --git a/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx b/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx index 93f2461e54b81..4ef6119caf1fd 100644 --- a/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx +++ b/packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx @@ -1,8 +1,5 @@ -import { - GlobalContextService, - useLiveData, - useServices, -} from '@toeverything/infra'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { useLiveData, useServices } from '@toeverything/infra'; import { useEffect } from 'react'; import { useLocation, useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/components/affine/ai-onboarding/index.tsx b/packages/frontend/core/src/components/affine/ai-onboarding/index.tsx index 5c94350c877fe..4ef7b91d20f6e 100644 --- a/packages/frontend/core/src/components/affine/ai-onboarding/index.tsx +++ b/packages/frontend/core/src/components/affine/ai-onboarding/index.tsx @@ -1,4 +1,5 @@ -import { FeatureFlagService, useService } from '@toeverything/infra'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; +import { useService } from '@toeverything/infra'; import { Suspense, useCallback, useEffect, useState } from 'react'; import { AIOnboardingEdgeless } from './edgeless.dialog'; diff --git a/packages/frontend/core/src/components/affine/awareness/index.tsx b/packages/frontend/core/src/components/affine/awareness/index.tsx index 63bce634b436e..b1531e24894f4 100644 --- a/packages/frontend/core/src/components/affine/awareness/index.tsx +++ b/packages/frontend/core/src/components/affine/awareness/index.tsx @@ -1,4 +1,5 @@ -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { WorkspaceService } from '@affine/core/modules/workspace'; +import { useLiveData, useService } from '@toeverything/infra'; import { useEffect } from 'react'; import { AuthService } from '../../../modules/cloud'; diff --git a/packages/frontend/core/src/components/affine/empty/collections.tsx b/packages/frontend/core/src/components/affine/empty/collections.tsx index 8ae47d7a93e23..efd5c8927f897 100644 --- a/packages/frontend/core/src/components/affine/empty/collections.tsx +++ b/packages/frontend/core/src/components/affine/empty/collections.tsx @@ -1,9 +1,10 @@ import { usePromptModal } from '@affine/component'; import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper'; import { CollectionService } from '@affine/core/modules/collection'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { ViewLayersIcon } from '@blocksuite/icons/rc'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { nanoid } from 'nanoid'; import { useCallback } from 'react'; diff --git a/packages/frontend/core/src/components/affine/empty/docs.tsx b/packages/frontend/core/src/components/affine/empty/docs.tsx index 878020993f60f..fe09a9f210b8c 100644 --- a/packages/frontend/core/src/components/affine/empty/docs.tsx +++ b/packages/frontend/core/src/components/affine/empty/docs.tsx @@ -1,8 +1,9 @@ import { TagService } from '@affine/core/modules/tag'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { isNewTabTrigger } from '@affine/core/utils'; import { useI18n } from '@affine/i18n'; import { AllDocsIcon } from '@blocksuite/icons/rc'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { type MouseEvent, useCallback } from 'react'; import { usePageHelper } from '../../blocksuite/block-suite-page-list/utils'; diff --git a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx index 902a6b8c89816..e66774cebe888 100644 --- a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx +++ b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx @@ -7,6 +7,7 @@ import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { EditorService } from '@affine/core/modules/editor'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; import { WorkspaceQuotaService } from '@affine/core/modules/quota'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { i18nTime, Trans, useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import type { DocMode } from '@blocksuite/affine/blocks'; @@ -17,7 +18,7 @@ import type { import { CloseIcon, ToggleCollapseIcon } from '@blocksuite/icons/rc'; import * as Collapsible from '@radix-ui/react-collapsible'; import type { DialogContentProps } from '@radix-ui/react-dialog'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { atom, useAtom } from 'jotai'; import type { PropsWithChildren } from 'react'; import { diff --git a/packages/frontend/core/src/components/affine/quota-reached-modal/cloud-quota-modal.tsx b/packages/frontend/core/src/components/affine/quota-reached-modal/cloud-quota-modal.tsx index aa8a649c4e68c..5b572868aec98 100644 --- a/packages/frontend/core/src/components/affine/quota-reached-modal/cloud-quota-modal.tsx +++ b/packages/frontend/core/src/components/affine/quota-reached-modal/cloud-quota-modal.tsx @@ -4,9 +4,10 @@ import { UserQuotaService } from '@affine/core/modules/cloud'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; import { WorkspaceQuotaService } from '@affine/core/modules/quota'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { type I18nString, useI18n } from '@affine/i18n'; import { track } from '@affine/track'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import bytes from 'bytes'; import { useAtom } from 'jotai'; import { useCallback, useEffect, useMemo } from 'react'; @@ -70,7 +71,7 @@ export const CloudQuotaModal = () => { if (!workspaceQuota) { return; } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + currentWorkspace.engine.blob.singleBlobSizeLimit = bytes.parse( workspaceQuota.blobLimit.toString() )!; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/bi-directional-link-panel.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/bi-directional-link-panel.tsx index f38a17eef4de1..a202186d86be2 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/bi-directional-link-panel.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/bi-directional-link-panel.tsx @@ -4,26 +4,28 @@ import { useLitPortalFactory, } from '@affine/component'; import { TextRenderer } from '@affine/core/blocksuite/presets'; +import { DocService } from '@affine/core/modules/doc'; import { type Backlink, DocLinksService, type Link, } from '@affine/core/modules/doc-link'; import { toURLSearchParams } from '@affine/core/modules/navigation'; +import { GlobalSessionStateService } from '@affine/core/modules/storage'; import { WorkbenchLink } from '@affine/core/modules/workbench'; +import { + getAFFiNEWorkspaceSchema, + WorkspaceService, +} from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import type { JobMiddleware } from '@blocksuite/affine/store'; import { ToggleExpandIcon } from '@blocksuite/icons/rc'; import * as Collapsible from '@radix-ui/react-collapsible'; import { - DocService, - getAFFiNEWorkspaceSchema, - GlobalSessionStateService, LiveData, useFramework, useLiveData, useServices, - WorkspaceService, } from '@toeverything/infra'; import React, { Fragment, diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/lit-adaper.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/lit-adaper.tsx index f566687231769..d6ab8e67889b4 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/lit-adaper.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/lit-adaper.tsx @@ -3,6 +3,8 @@ import { useConfirmModal, useLitPortalFactory, } from '@affine/component'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; +import { DocService, DocsService } from '@affine/core/modules/doc'; import type { DatabaseRow, DatabaseValueCell, @@ -12,6 +14,7 @@ import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { JournalService } from '@affine/core/modules/journal'; import { toURLSearchParams } from '@affine/core/modules/navigation'; import { PeekViewService } from '@affine/core/modules/peek-view/services/peek-view'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import track from '@affine/track'; import type { DocMode } from '@blocksuite/affine/blocks'; import { @@ -21,14 +24,10 @@ import { } from '@blocksuite/affine/presets'; import type { Doc } from '@blocksuite/affine/store'; import { - type DocCustomPropertyInfo, - DocService, - DocsService, useFramework, useLiveData, useService, useServices, - WorkspaceService, } from '@toeverything/infra'; import React, { forwardRef, diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/root-block.ts b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/root-block.ts index d4e1bb7f002df..c2cd8cb89110e 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/root-block.ts +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/root-block.ts @@ -2,8 +2,10 @@ import { AIEdgelessRootBlockSpec, AIPageRootBlockSpec, } from '@affine/core/blocksuite/presets/ai'; +import { DocService, DocsService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { AppThemeService } from '@affine/core/modules/theme'; import { mixpanel } from '@affine/track'; import { @@ -39,12 +41,7 @@ import { } from '@blocksuite/affine-shared/utils'; import type { Container } from '@blocksuite/global/di'; import { LinkedPageIcon, PageIcon } from '@blocksuite/icons/lit'; -import { - DocService, - DocsService, - FeatureFlagService, - type FrameworkProvider, -} from '@toeverything/infra'; +import { type FrameworkProvider } from '@toeverything/infra'; import type { TemplateResult } from 'lit'; import type { Observable } from 'rxjs'; import { combineLatest, map } from 'rxjs'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx index 2d69923dc366c..c83f3a7ec1c28 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/spec-patchers.tsx @@ -8,6 +8,7 @@ import { type useConfirmModal, } from '@affine/component'; import { WorkspaceServerService } from '@affine/core/modules/cloud'; +import { DocService, DocsService } from '@affine/core/modules/doc'; import type { EditorService } from '@affine/core/modules/editor'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { resolveLinkToDoc } from '@affine/core/modules/navigation'; @@ -22,6 +23,7 @@ import { import { ExternalLinksQuickSearchSession } from '@affine/core/modules/quicksearch/impls/external-links'; import { JournalsQuickSearchSession } from '@affine/core/modules/quicksearch/impls/journals'; import { WorkbenchService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { isNewTabTrigger } from '@affine/core/utils'; import { DebugLogger } from '@affine/debug'; import { track } from '@affine/track'; @@ -62,10 +64,7 @@ import type { ReferenceParams } from '@blocksuite/affine-model'; import { AIChatBlockSchema, type DocProps, - type DocService, - DocsService, type FrameworkProvider, - WorkspaceService, } from '@toeverything/infra'; import { type TemplateResult } from 'lit'; import { customElement } from 'lit/decorators.js'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/edgeless.ts b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/edgeless.ts index a1c13dda0af36..3133d5b1863f2 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/edgeless.ts +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/edgeless.ts @@ -1,3 +1,4 @@ +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { builtInTemplates as builtInEdgelessTemplates } from '@affine/templates/edgeless'; import { builtInTemplates as builtInStickersTemplates } from '@affine/templates/stickers'; import type { ExtensionType } from '@blocksuite/affine/block-std'; @@ -10,10 +11,7 @@ import { EdgelessTextBlockSpec, FrameBlockSpec, } from '@blocksuite/affine/blocks'; -import { - FeatureFlagService, - type FrameworkProvider, -} from '@toeverything/infra'; +import { type FrameworkProvider } from '@toeverything/infra'; import { AIBlockSpecs, DefaultBlockSpecs } from './common'; import { createEdgelessRootBlockSpec } from './custom/root-block'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/history-tips-modal/index.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/history-tips-modal/index.tsx index 3cdc1ad3f85f6..32960dfd2d3c8 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/history-tips-modal/index.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/history-tips-modal/index.tsx @@ -1,7 +1,8 @@ import { OverlayModal } from '@affine/component'; import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback } from 'react'; import TopSvg from './top-svg'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-header/title/index.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-header/title/index.tsx index b9921bc514e4c..f9de0447ab761 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-header/title/index.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-header/title/index.tsx @@ -1,13 +1,10 @@ import type { InlineEditProps } from '@affine/component'; import { InlineEdit } from '@affine/component'; import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; +import { DocsService } from '@affine/core/modules/doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { track } from '@affine/track'; -import { - DocsService, - useLiveData, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import clsx from 'clsx'; import type { HTMLAttributes } from 'react'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-page-list/utils.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-page-list/utils.tsx index 45ad23dba9ac4..3ce6b6a3583aa 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-page-list/utils.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-page-list/utils.tsx @@ -1,10 +1,11 @@ import { toast } from '@affine/component'; import { AppSidebarService } from '@affine/core/modules/app-sidebar'; +import { DocsService } from '@affine/core/modules/doc'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { WorkbenchService } from '@affine/core/modules/workbench'; import { type DocMode } from '@blocksuite/affine/blocks'; import type { DocCollection } from '@blocksuite/affine/store'; -import { type DocProps, DocsService, useServices } from '@toeverything/infra'; +import { type DocProps, useServices } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; export const usePageHelper = (docCollection: DocCollection) => { diff --git a/packages/frontend/core/src/components/doc-properties/manager/index.tsx b/packages/frontend/core/src/components/doc-properties/manager/index.tsx index c9fe1ae62f06a..0d2a9d31049a4 100644 --- a/packages/frontend/core/src/components/doc-properties/manager/index.tsx +++ b/packages/frontend/core/src/components/doc-properties/manager/index.tsx @@ -6,16 +6,13 @@ import { useDraggable, useDropTarget, } from '@affine/component'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; +import { DocsService } from '@affine/core/modules/doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { useI18n } from '@affine/i18n'; import { MoreHorizontalIcon } from '@blocksuite/icons/rc'; -import { - type DocCustomPropertyInfo, - DocsService, - useLiveData, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import clsx from 'clsx'; import { type HTMLProps, useCallback, useState } from 'react'; diff --git a/packages/frontend/core/src/components/doc-properties/menu/create-doc-property.tsx b/packages/frontend/core/src/components/doc-properties/menu/create-doc-property.tsx index fdc0a6c707cf3..036970ddc938f 100644 --- a/packages/frontend/core/src/components/doc-properties/menu/create-doc-property.tsx +++ b/packages/frontend/core/src/components/doc-properties/menu/create-doc-property.tsx @@ -1,12 +1,9 @@ import { MenuItem, MenuSeparator } from '@affine/component'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; +import { DocsService } from '@affine/core/modules/doc'; import { generateUniqueNameInSequence } from '@affine/core/utils/unique-name'; import { useI18n } from '@affine/i18n'; -import { - type DocCustomPropertyInfo, - DocsService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { diff --git a/packages/frontend/core/src/components/doc-properties/menu/edit-doc-property.tsx b/packages/frontend/core/src/components/doc-properties/menu/edit-doc-property.tsx index 74650a7670791..37eed0a6ac52c 100644 --- a/packages/frontend/core/src/components/doc-properties/menu/edit-doc-property.tsx +++ b/packages/frontend/core/src/components/doc-properties/menu/edit-doc-property.tsx @@ -4,9 +4,10 @@ import { MenuSeparator, useConfirmModal, } from '@affine/component'; +import { DocsService } from '@affine/core/modules/doc'; import { Trans, useI18n } from '@affine/i18n'; import { DeleteIcon, InvisibleIcon, ViewIcon } from '@blocksuite/icons/rc'; -import { DocsService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { type KeyboardEventHandler, type MouseEvent, diff --git a/packages/frontend/core/src/components/doc-properties/sidebar/index.tsx b/packages/frontend/core/src/components/doc-properties/sidebar/index.tsx index 8927f8cdd4406..7ffc7a0f0f42f 100644 --- a/packages/frontend/core/src/components/doc-properties/sidebar/index.tsx +++ b/packages/frontend/core/src/components/doc-properties/sidebar/index.tsx @@ -1,4 +1,5 @@ import { Divider, IconButton, Tooltip } from '@affine/component'; +import { DocsService } from '@affine/core/modules/doc'; import { generateUniqueNameInSequence } from '@affine/core/utils/unique-name'; import { useI18n } from '@affine/i18n'; import track from '@affine/track'; @@ -7,7 +8,7 @@ import { Content as CollapsibleContent, Root as CollapsibleRoot, } from '@radix-ui/react-collapsible'; -import { DocsService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import { DocPropertyManager } from '../manager'; diff --git a/packages/frontend/core/src/components/doc-properties/table.tsx b/packages/frontend/core/src/components/doc-properties/table.tsx index 81dc3eb6b56ad..da7180dbc4434 100644 --- a/packages/frontend/core/src/components/doc-properties/table.tsx +++ b/packages/frontend/core/src/components/doc-properties/table.tsx @@ -8,22 +8,21 @@ import { useDraggable, useDropTarget, } from '@affine/component'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; +import { DocService, DocsService } from '@affine/core/modules/doc'; import { DocDatabaseBacklinkInfo } from '@affine/core/modules/doc-info'; import type { DatabaseRow, DatabaseValueCell, } from '@affine/core/modules/doc-info/types'; import { WorkbenchService } from '@affine/core/modules/workbench'; -import { ViewService } from '@affine/core/modules/workbench/services/view'; +import { ViewService } from '@affine/core/modules/workbench'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import { PlusIcon, PropertyIcon, ToggleExpandIcon } from '@blocksuite/icons/rc'; import * as Collapsible from '@radix-ui/react-collapsible'; import { - type DocCustomPropertyInfo, - DocService, - DocsService, useLiveData, useService, useServiceOptional, diff --git a/packages/frontend/core/src/components/doc-properties/tags-inline-editor.tsx b/packages/frontend/core/src/components/doc-properties/tags-inline-editor.tsx index e496df67393ad..8475f9535e722 100644 --- a/packages/frontend/core/src/components/doc-properties/tags-inline-editor.tsx +++ b/packages/frontend/core/src/components/doc-properties/tags-inline-editor.tsx @@ -1,12 +1,8 @@ import { TagService, useDeleteTagConfirmModal } from '@affine/core/modules/tag'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { TagsIcon } from '@blocksuite/icons/rc'; -import { - LiveData, - useLiveData, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { LiveData, useLiveData, useService } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import { useAsyncCallback } from '../hooks/affine-async-hooks'; diff --git a/packages/frontend/core/src/components/doc-properties/types/created-updated-by.tsx b/packages/frontend/core/src/components/doc-properties/types/created-updated-by.tsx index 89e8f49a4a1cc..aed8192107d74 100644 --- a/packages/frontend/core/src/components/doc-properties/types/created-updated-by.tsx +++ b/packages/frontend/core/src/components/doc-properties/types/created-updated-by.tsx @@ -1,7 +1,8 @@ import { Avatar, PropertyValue } from '@affine/component'; import { CloudDocMetaService } from '@affine/core/modules/cloud/services/cloud-doc-meta'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useEffect, useMemo } from 'react'; import { userWrapper } from './created-updated-by.css'; diff --git a/packages/frontend/core/src/components/doc-properties/types/date.tsx b/packages/frontend/core/src/components/doc-properties/types/date.tsx index 21cd34e1ac2f8..52ad9a2a41fc9 100644 --- a/packages/frontend/core/src/components/doc-properties/types/date.tsx +++ b/packages/frontend/core/src/components/doc-properties/types/date.tsx @@ -1,6 +1,7 @@ import { DatePicker, Menu, PropertyValue, Tooltip } from '@affine/component'; +import { DocService } from '@affine/core/modules/doc'; import { i18nTime, useI18n } from '@affine/i18n'; -import { DocService, useLiveData, useServices } from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import * as styles from './date.css'; import type { PropertyValueProps } from './types'; diff --git a/packages/frontend/core/src/components/doc-properties/types/doc-primary-mode.tsx b/packages/frontend/core/src/components/doc-properties/types/doc-primary-mode.tsx index c64f0110d5ef7..d1f8b8546a716 100644 --- a/packages/frontend/core/src/components/doc-properties/types/doc-primary-mode.tsx +++ b/packages/frontend/core/src/components/doc-properties/types/doc-primary-mode.tsx @@ -4,9 +4,10 @@ import { RadioGroup, type RadioItem, } from '@affine/component'; +import { DocService } from '@affine/core/modules/doc'; import { useI18n } from '@affine/i18n'; import type { DocMode } from '@blocksuite/affine/blocks'; -import { DocService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import * as styles from './doc-primary-mode.css'; diff --git a/packages/frontend/core/src/components/doc-properties/types/edgeless-theme.tsx b/packages/frontend/core/src/components/doc-properties/types/edgeless-theme.tsx index 91c27061796f4..b27bb1ebe8409 100644 --- a/packages/frontend/core/src/components/doc-properties/types/edgeless-theme.tsx +++ b/packages/frontend/core/src/components/doc-properties/types/edgeless-theme.tsx @@ -1,6 +1,7 @@ import { PropertyValue, RadioGroup, type RadioItem } from '@affine/component'; +import { DocService } from '@affine/core/modules/doc'; import { useI18n } from '@affine/i18n'; -import { DocService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import * as styles from './edgeless-theme.css'; diff --git a/packages/frontend/core/src/components/doc-properties/types/page-width.tsx b/packages/frontend/core/src/components/doc-properties/types/page-width.tsx index 4e7b0fcdf5c9c..d9d344a863c17 100644 --- a/packages/frontend/core/src/components/doc-properties/types/page-width.tsx +++ b/packages/frontend/core/src/components/doc-properties/types/page-width.tsx @@ -1,7 +1,8 @@ import { PropertyValue, RadioGroup, type RadioItem } from '@affine/component'; +import { DocService } from '@affine/core/modules/doc'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { useI18n } from '@affine/i18n'; -import { DocService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import { container } from './page-width.css'; diff --git a/packages/frontend/core/src/components/doc-properties/types/tags.tsx b/packages/frontend/core/src/components/doc-properties/types/tags.tsx index 11339f5171cea..456403a8ba05a 100644 --- a/packages/frontend/core/src/components/doc-properties/types/tags.tsx +++ b/packages/frontend/core/src/components/doc-properties/types/tags.tsx @@ -1,7 +1,8 @@ import { PropertyValue } from '@affine/component'; +import { DocService } from '@affine/core/modules/doc'; import { TagService } from '@affine/core/modules/tag'; import { useI18n } from '@affine/i18n'; -import { DocService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { TagsInlineEditor } from '../tags-inline-editor'; import * as styles from './tags.css'; diff --git a/packages/frontend/core/src/components/hooks/affine/use-all-page-list-config.tsx b/packages/frontend/core/src/components/hooks/affine/use-all-page-list-config.tsx index 77490a5966857..b924280694072 100644 --- a/packages/frontend/core/src/components/hooks/affine/use-all-page-list-config.tsx +++ b/packages/frontend/core/src/components/hooks/affine/use-all-page-list-config.tsx @@ -3,10 +3,11 @@ import { useBlockSuiteDocMeta } from '@affine/core/components/hooks/use-block-su import { FavoriteTag } from '@affine/core/components/page-list/components/favorite-tag'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; import { ShareDocsListService } from '@affine/core/modules/share-doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { PublicPageMode } from '@affine/graphql'; import { useI18n } from '@affine/i18n'; import type { DocCollection, DocMeta } from '@blocksuite/affine/store'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { type ReactNode, useCallback, useEffect, useMemo } from 'react'; export type AllPageListConfig = { diff --git a/packages/frontend/core/src/components/hooks/affine/use-block-suite-meta-helper.ts b/packages/frontend/core/src/components/hooks/affine/use-block-suite-meta-helper.ts index 6efe884a6fc4e..e9bbaab56e367 100644 --- a/packages/frontend/core/src/components/hooks/affine/use-block-suite-meta-helper.ts +++ b/packages/frontend/core/src/components/hooks/affine/use-block-suite-meta-helper.ts @@ -1,8 +1,10 @@ import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; import { useDocMetaHelper } from '@affine/core/components/hooks/use-block-suite-page-meta'; import { useDocCollectionHelper } from '@affine/core/components/hooks/use-block-suite-workspace-helper'; +import { DocsService } from '@affine/core/modules/doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { DocMode } from '@blocksuite/affine/blocks'; -import { DocsService, useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { applyUpdate, encodeStateAsUpdate } from 'yjs'; diff --git a/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx b/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx index 5d765f3d30a05..d6167fd7373fb 100644 --- a/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx +++ b/packages/frontend/core/src/components/hooks/affine/use-enable-cloud.tsx @@ -1,13 +1,9 @@ import { notify, useConfirmModal } from '@affine/component'; import { AuthService, ServersService } from '@affine/core/modules/cloud'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; +import { Workspace, WorkspacesService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import type { Workspace } from '@toeverything/infra'; -import { - useLiveData, - useService, - WorkspacesService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { useNavigateHelper } from '../use-navigate-helper'; diff --git a/packages/frontend/core/src/components/hooks/affine/use-register-blocksuite-editor-commands.tsx b/packages/frontend/core/src/components/hooks/affine/use-register-blocksuite-editor-commands.tsx index b5cfd0bd3f052..b422bb0650701 100644 --- a/packages/frontend/core/src/components/hooks/affine/use-register-blocksuite-editor-commands.tsx +++ b/packages/frontend/core/src/components/hooks/affine/use-register-blocksuite-editor-commands.tsx @@ -4,10 +4,12 @@ import { registerAffineCommand, } from '@affine/core/commands'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; +import { DocService } from '@affine/core/modules/doc'; import type { Editor } from '@affine/core/modules/editor'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; import { OpenInAppService } from '@affine/core/modules/open-in-app'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import { @@ -17,11 +19,9 @@ import { PageIcon, } from '@blocksuite/icons/rc'; import { - DocService, useLiveData, useService, useServiceOptional, - WorkspaceService, } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { useCallback, useEffect } from 'react'; diff --git a/packages/frontend/core/src/components/hooks/affine/use-register-copy-link-commands.tsx b/packages/frontend/core/src/components/hooks/affine/use-register-copy-link-commands.tsx index 7184aa4cfc7ec..02f45ec8a0f52 100644 --- a/packages/frontend/core/src/components/hooks/affine/use-register-copy-link-commands.tsx +++ b/packages/frontend/core/src/components/hooks/affine/use-register-copy-link-commands.tsx @@ -4,8 +4,8 @@ import { } from '@affine/core/commands'; import { useSharingUrl } from '@affine/core/components/hooks/affine/use-share-url'; import { useIsActiveView } from '@affine/core/modules/workbench'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import { track } from '@affine/track'; -import { type WorkspaceMetadata } from '@toeverything/infra'; import { useEffect } from 'react'; export function useRegisterCopyLinkCommands({ diff --git a/packages/frontend/core/src/components/hooks/affine/use-sign-out.ts b/packages/frontend/core/src/components/hooks/affine/use-sign-out.ts index d9127fa960f65..66b61311f1649 100644 --- a/packages/frontend/core/src/components/hooks/affine/use-sign-out.ts +++ b/packages/frontend/core/src/components/hooks/affine/use-sign-out.ts @@ -4,13 +4,10 @@ import { useConfirmModal, } from '@affine/component'; import { AuthService, ServerService } from '@affine/core/modules/cloud'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { WorkspacesService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { - GlobalContextService, - useLiveData, - useService, - WorkspacesService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { useNavigateHelper } from '../use-navigate-helper'; diff --git a/packages/frontend/core/src/components/hooks/use-block-suite-page-meta.ts b/packages/frontend/core/src/components/hooks/use-block-suite-page-meta.ts index 467765cd86f38..9821a15a5d631 100644 --- a/packages/frontend/core/src/components/hooks/use-block-suite-page-meta.ts +++ b/packages/frontend/core/src/components/hooks/use-block-suite-page-meta.ts @@ -1,5 +1,7 @@ +import { DocsService } from '@affine/core/modules/doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { DocCollection, DocMeta } from '@blocksuite/affine/store'; -import { DocsService, useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import { useAsyncCallback } from './affine-async-hooks'; diff --git a/packages/frontend/core/src/components/hooks/use-journal.ts b/packages/frontend/core/src/components/hooks/use-journal.ts index 7c679865dbb55..241f953075e18 100644 --- a/packages/frontend/core/src/components/hooks/use-journal.ts +++ b/packages/frontend/core/src/components/hooks/use-journal.ts @@ -1,3 +1,4 @@ +import { DocsService } from '@affine/core/modules/doc'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { JOURNAL_DATE_FORMAT, @@ -6,7 +7,7 @@ import { } from '@affine/core/modules/journal'; import { i18nTime } from '@affine/i18n'; import { track } from '@affine/track'; -import { DocsService, useService, useServices } from '@toeverything/infra'; +import { useService, useServices } from '@toeverything/infra'; import dayjs from 'dayjs'; import { useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/components/hooks/use-register-workspace-commands.ts b/packages/frontend/core/src/components/hooks/use-register-workspace-commands.ts index f3030e98b88c3..160e930a2a743 100644 --- a/packages/frontend/core/src/components/hooks/use-register-workspace-commands.ts +++ b/packages/frontend/core/src/components/hooks/use-register-workspace-commands.ts @@ -3,13 +3,10 @@ import { DesktopApiService } from '@affine/core/modules/desktop-api'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; import { I18nService } from '@affine/core/modules/i18n'; import { UrlService } from '@affine/core/modules/url'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import type { AffineEditorContainer } from '@blocksuite/affine/presets'; -import { - useService, - useServiceOptional, - WorkspaceService, -} from '@toeverything/infra'; +import { useService, useServiceOptional } from '@toeverything/infra'; import { useStore } from 'jotai'; import { useTheme } from 'next-themes'; import { useEffect } from 'react'; diff --git a/packages/frontend/core/src/components/hooks/use-workspace-info.ts b/packages/frontend/core/src/components/hooks/use-workspace-info.ts index 05bfcf1876acc..aad7957d7d78b 100644 --- a/packages/frontend/core/src/components/hooks/use-workspace-info.ts +++ b/packages/frontend/core/src/components/hooks/use-workspace-info.ts @@ -1,9 +1,8 @@ -import type { WorkspaceMetadata } from '@toeverything/infra'; import { - useLiveData, - useService, + type WorkspaceMetadata, WorkspacesService, -} from '@toeverything/infra'; +} from '@affine/core/modules/workspace'; +import { useLiveData, useService } from '@toeverything/infra'; import { useEffect } from 'react'; export function useWorkspaceInfo(meta?: WorkspaceMetadata) { diff --git a/packages/frontend/core/src/components/hooks/use-workspace.ts b/packages/frontend/core/src/components/hooks/use-workspace.ts index 0a69933303245..b6de5246dfc0c 100644 --- a/packages/frontend/core/src/components/hooks/use-workspace.ts +++ b/packages/frontend/core/src/components/hooks/use-workspace.ts @@ -1,5 +1,9 @@ -import type { Workspace, WorkspaceMetadata } from '@toeverything/infra'; -import { useService, WorkspacesService } from '@toeverything/infra'; +import { + Workspace, + type WorkspaceMetadata, + WorkspacesService, +} from '@affine/core/modules/workspace'; +import { useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; /** diff --git a/packages/frontend/core/src/components/over-capacity/index.tsx b/packages/frontend/core/src/components/over-capacity/index.tsx index 8df383bafb010..09c96a8e1281d 100644 --- a/packages/frontend/core/src/components/over-capacity/index.tsx +++ b/packages/frontend/core/src/components/over-capacity/index.tsx @@ -1,8 +1,9 @@ import { notify } from '@affine/component'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { debounce } from 'lodash-es'; import { useCallback, useEffect } from 'react'; diff --git a/packages/frontend/core/src/components/page-detail-editor.tsx b/packages/frontend/core/src/components/page-detail-editor.tsx index fec5deff4a401..892ef819ba511 100644 --- a/packages/frontend/core/src/components/page-detail-editor.tsx +++ b/packages/frontend/core/src/components/page-detail-editor.tsx @@ -1,12 +1,13 @@ import './page-detail-editor.css'; import type { AffineEditorContainer } from '@blocksuite/affine/presets'; -import { DocService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import clsx from 'clsx'; import type { CSSProperties } from 'react'; import { useMemo } from 'react'; +import { DocService } from '../modules/doc'; import { EditorService } from '../modules/editor'; import { EditorSettingService, @@ -16,7 +17,7 @@ import { BlockSuiteEditor as Editor } from './blocksuite/block-suite-editor'; import * as styles from './page-detail-editor.css'; declare global { - // eslint-disable-next-line no-var + var currentEditor: AffineEditorContainer | undefined; } diff --git a/packages/frontend/core/src/components/page-list/collections/virtualized-collection-list.tsx b/packages/frontend/core/src/components/page-list/collections/virtualized-collection-list.tsx index 52372ddbb46c8..54709ebc8ac99 100644 --- a/packages/frontend/core/src/components/page-list/collections/virtualized-collection-list.tsx +++ b/packages/frontend/core/src/components/page-list/collections/virtualized-collection-list.tsx @@ -1,7 +1,8 @@ import { useDeleteCollectionInfo } from '@affine/core/components/hooks/affine/use-delete-collection-info'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { Collection, DeleteCollectionInfo } from '@affine/env/filter'; import { Trans } from '@affine/i18n'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback, useMemo, useRef, useState } from 'react'; import { CollectionService } from '../../../modules/collection'; diff --git a/packages/frontend/core/src/components/page-list/docs/page-list-header.tsx b/packages/frontend/core/src/components/page-list/docs/page-list-header.tsx index 375b4fe94547d..3da0ad6b052d2 100644 --- a/packages/frontend/core/src/components/page-list/docs/page-list-header.tsx +++ b/packages/frontend/core/src/components/page-list/docs/page-list-header.tsx @@ -8,9 +8,11 @@ import { } from '@affine/component'; import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; +import type { DocRecord } from '@affine/core/modules/doc'; import type { Tag } from '@affine/core/modules/tag'; import { TagService } from '@affine/core/modules/tag'; import { WorkbenchService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { isNewTabTrigger } from '@affine/core/utils'; import type { Collection } from '@affine/env/filter'; import { useI18n } from '@affine/i18n'; @@ -21,13 +23,7 @@ import { SearchIcon, ViewLayersIcon, } from '@blocksuite/icons/rc'; -import type { DocRecord } from '@toeverything/infra'; -import { - useLiveData, - useService, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import clsx from 'clsx'; import { useCallback, useMemo, useState } from 'react'; import { Link } from 'react-router-dom'; diff --git a/packages/frontend/core/src/components/page-list/docs/select-page.tsx b/packages/frontend/core/src/components/page-list/docs/select-page.tsx index a80db7652af55..eac410f3e596c 100644 --- a/packages/frontend/core/src/components/page-list/docs/select-page.tsx +++ b/packages/frontend/core/src/components/page-list/docs/select-page.tsx @@ -2,15 +2,12 @@ import { IconButton, Menu, toast } from '@affine/component'; import { useBlockSuiteDocMeta } from '@affine/core/components/hooks/use-block-suite-page-meta'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; import { ShareDocsListService } from '@affine/core/modules/share-doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { PublicPageMode } from '@affine/graphql'; import { Trans, useI18n } from '@affine/i18n'; import type { DocMeta } from '@blocksuite/affine/store'; import { FilterIcon } from '@blocksuite/icons/rc'; -import { - useLiveData, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import { type ReactNode, useCallback, useEffect, useState } from 'react'; import { AffineShapeIcon, FavoriteTag } from '..'; diff --git a/packages/frontend/core/src/components/page-list/docs/virtualized-page-list.tsx b/packages/frontend/core/src/components/page-list/docs/virtualized-page-list.tsx index 0d0fb67a835a3..32aa9164fe9b8 100644 --- a/packages/frontend/core/src/components/page-list/docs/virtualized-page-list.tsx +++ b/packages/frontend/core/src/components/page-list/docs/virtualized-page-list.tsx @@ -1,11 +1,13 @@ import { toast, useConfirmModal } from '@affine/component'; import { useBlockSuiteDocMeta } from '@affine/core/components/hooks/use-block-suite-page-meta'; import { CollectionService } from '@affine/core/modules/collection'; +import { DocsService } from '@affine/core/modules/doc'; import type { Tag } from '@affine/core/modules/tag'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { Collection, Filter } from '@affine/env/filter'; import { Trans, useI18n } from '@affine/i18n'; import type { DocMeta } from '@blocksuite/affine/store'; -import { DocsService, useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback, useMemo, useRef, useState } from 'react'; import { ListFloatingToolbar } from '../components/list-floating-toolbar'; diff --git a/packages/frontend/core/src/components/page-list/operation-cell.tsx b/packages/frontend/core/src/components/page-list/operation-cell.tsx index 225bcf0adaf8f..1f84d797f6d0a 100644 --- a/packages/frontend/core/src/components/page-list/operation-cell.tsx +++ b/packages/frontend/core/src/components/page-list/operation-cell.tsx @@ -9,11 +9,14 @@ import { import { useBlockSuiteMetaHelper } from '@affine/core/components/hooks/affine/use-block-suite-meta-helper'; import { useCatchEventCallback } from '@affine/core/components/hooks/use-catch-event-hook'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; +import { DocsService } from '@affine/core/modules/doc'; import { CompatibleFavoriteItemsAdapter, FavoriteService, } from '@affine/core/modules/favorite'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { WorkbenchService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { Collection, DeleteCollectionInfo } from '@affine/env/filter'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; @@ -32,14 +35,7 @@ import { ResetIcon, SplitViewIcon, } from '@blocksuite/icons/rc'; -import { - DocsService, - FeatureFlagService, - useLiveData, - useService, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import type { MouseEvent } from 'react'; import { useCallback, useState } from 'react'; diff --git a/packages/frontend/core/src/components/page-list/tags/virtualized-tag-list.tsx b/packages/frontend/core/src/components/page-list/tags/virtualized-tag-list.tsx index cc7d485089e9a..74c2d1292fa20 100644 --- a/packages/frontend/core/src/components/page-list/tags/virtualized-tag-list.tsx +++ b/packages/frontend/core/src/components/page-list/tags/virtualized-tag-list.tsx @@ -1,6 +1,7 @@ import type { Tag } from '@affine/core/modules/tag'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { Trans } from '@affine/i18n'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback, useMemo, useRef, useState } from 'react'; import { ListFloatingToolbar } from '../components/list-floating-toolbar'; diff --git a/packages/frontend/core/src/components/page-list/use-all-doc-display-properties.ts b/packages/frontend/core/src/components/page-list/use-all-doc-display-properties.ts index 60496c143c832..cbd25e55e42ef 100644 --- a/packages/frontend/core/src/components/page-list/use-all-doc-display-properties.ts +++ b/packages/frontend/core/src/components/page-list/use-all-doc-display-properties.ts @@ -1,4 +1,5 @@ -import { useService, WorkspaceService } from '@toeverything/infra'; +import { WorkspaceService } from '@affine/core/modules/workspace'; +import { useService } from '@toeverything/infra'; import { useAtom } from 'jotai'; import { atomWithStorage } from 'jotai/utils'; import { useCallback } from 'react'; diff --git a/packages/frontend/core/src/components/page-list/virtualized-trash-list.tsx b/packages/frontend/core/src/components/page-list/virtualized-trash-list.tsx index 8dbbffd04a81a..61983aee561d3 100644 --- a/packages/frontend/core/src/components/page-list/virtualized-trash-list.tsx +++ b/packages/frontend/core/src/components/page-list/virtualized-trash-list.tsx @@ -1,9 +1,10 @@ import { toast, useConfirmModal } from '@affine/component'; import { useBlockSuiteMetaHelper } from '@affine/core/components/hooks/affine/use-block-suite-meta-helper'; import { useBlockSuiteDocMeta } from '@affine/core/components/hooks/use-block-suite-page-meta'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { Trans, useI18n } from '@affine/i18n'; import type { DocMeta } from '@blocksuite/affine/store'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback, useMemo, useRef, useState } from 'react'; import { ListFloatingToolbar } from './components/list-floating-toolbar'; diff --git a/packages/frontend/core/src/components/providers/workspace-side-effects.tsx b/packages/frontend/core/src/components/providers/workspace-side-effects.tsx index 29b43380e34ab..66394eaac0d99 100644 --- a/packages/frontend/core/src/components/providers/workspace-side-effects.tsx +++ b/packages/frontend/core/src/components/providers/workspace-side-effects.tsx @@ -14,22 +14,22 @@ import { GraphQLService, } from '@affine/core/modules/cloud'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; +import { DocsService } from '@affine/core/modules/doc'; import { EditorSettingService } from '@affine/core/modules/editor-setting'; import { useRegisterNavigationCommands } from '@affine/core/modules/navigation/view/use-register-navigation-commands'; import { QuickSearchContainer } from '@affine/core/modules/quicksearch'; import { WorkbenchService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import track from '@affine/track'; import { type DocMode, ZipTransformer } from '@blocksuite/affine/blocks'; import { - DocsService, effect, fromPromise, onStart, throwIfAborted, useService, useServices, - WorkspaceService, } from '@toeverything/infra'; import { useSetAtom } from 'jotai'; import { useEffect } from 'react'; diff --git a/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx b/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx index 03af2df089efb..5423bd0cd8515 100644 --- a/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx +++ b/packages/frontend/core/src/components/pure/trash-page-footer/index.tsx @@ -1,8 +1,10 @@ import { Button } from '@affine/component/ui/button'; import { ConfirmModal } from '@affine/component/ui/modal'; +import { DocService } from '@affine/core/modules/doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { DeleteIcon, ResetIcon } from '@blocksuite/icons/rc'; -import { DocService, useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import { useAppSettingHelper } from '../../../components/hooks/affine/use-app-setting-helper'; diff --git a/packages/frontend/core/src/components/root-app-sidebar/index.tsx b/packages/frontend/core/src/components/root-app-sidebar/index.tsx index 6f003c918a46d..b984b973cfb4e 100644 --- a/packages/frontend/core/src/components/root-app-sidebar/index.tsx +++ b/packages/frontend/core/src/components/root-app-sidebar/index.tsx @@ -22,6 +22,7 @@ import { } from '@affine/core/modules/explorer'; import { ExplorerTags } from '@affine/core/modules/explorer/views/sections/tags'; import { CMDKQuickSearchService } from '@affine/core/modules/quicksearch/services/cmdk'; +import type { Workspace } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import type { Doc } from '@blocksuite/affine/store'; @@ -32,7 +33,6 @@ import { JournalIcon, SettingsIcon, } from '@blocksuite/icons/rc'; -import type { Workspace } from '@toeverything/infra'; import { useLiveData, useService, useServices } from '@toeverything/infra'; import type { ReactElement } from 'react'; import { memo, useCallback } from 'react'; diff --git a/packages/frontend/core/src/components/root-app-sidebar/trash-button.tsx b/packages/frontend/core/src/components/root-app-sidebar/trash-button.tsx index 862379b4be21d..466348814f5d4 100644 --- a/packages/frontend/core/src/components/root-app-sidebar/trash-button.tsx +++ b/packages/frontend/core/src/components/root-app-sidebar/trash-button.tsx @@ -4,14 +4,11 @@ import { useDropTarget, } from '@affine/component'; import { MenuLinkItem } from '@affine/core/modules/app-sidebar/views'; +import { DocsService } from '@affine/core/modules/doc'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { useI18n } from '@affine/i18n'; -import { - DocsService, - GlobalContextService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; export const TrashButton = () => { const t = useI18n(); diff --git a/packages/frontend/core/src/components/sign-in/sign-in.tsx b/packages/frontend/core/src/components/sign-in/sign-in.tsx index 60d06e3f0d5b5..57d13924aa1cb 100644 --- a/packages/frontend/core/src/components/sign-in/sign-in.tsx +++ b/packages/frontend/core/src/components/sign-in/sign-in.tsx @@ -3,14 +3,11 @@ import { AuthInput, ModalHeader } from '@affine/component/auth-components'; import { OAuth } from '@affine/core/components/affine/auth/oauth'; import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; import { AuthService, ServerService } from '@affine/core/modules/cloud'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { ServerDeploymentType } from '@affine/graphql'; import { Trans, useI18n } from '@affine/i18n'; import { ArrowRightBigIcon, PublishIcon } from '@blocksuite/icons/rc'; -import { - FeatureFlagService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import { type Dispatch, diff --git a/packages/frontend/core/src/components/top-tip.tsx b/packages/frontend/core/src/components/top-tip.tsx index 0e703a3d1b6f4..98b1dbec8744f 100644 --- a/packages/frontend/core/src/components/top-tip.tsx +++ b/packages/frontend/core/src/components/top-tip.tsx @@ -1,11 +1,12 @@ import { BrowserWarning, LocalDemoTips } from '@affine/component/affine-banner'; import { Trans, useI18n } from '@affine/i18n'; -import { useLiveData, useService, type Workspace } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import { useEnableCloud } from '../components/hooks/affine/use-enable-cloud'; import { AuthService } from '../modules/cloud'; import { GlobalDialogService } from '../modules/dialogs'; +import type { Workspace } from '../modules/workspace'; const minimumChromeVersion = 106; diff --git a/packages/frontend/core/src/components/workspace-selector/index.tsx b/packages/frontend/core/src/components/workspace-selector/index.tsx index 0aa3e0bd69a3d..1f77cc8795721 100644 --- a/packages/frontend/core/src/components/workspace-selector/index.tsx +++ b/packages/frontend/core/src/components/workspace-selector/index.tsx @@ -1,13 +1,12 @@ import { Menu, type MenuProps } from '@affine/component'; import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper'; -import { track } from '@affine/track'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import { - GlobalContextService, - useLiveData, - useServices, type WorkspaceMetadata, WorkspacesService, -} from '@toeverything/infra'; +} from '@affine/core/modules/workspace'; +import { track } from '@affine/track'; +import { useLiveData, useServices } from '@toeverything/infra'; import { useCallback, useEffect, useState } from 'react'; import { UserWithWorkspaceList } from './user-with-workspace-list'; diff --git a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-server/index.tsx b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-server/index.tsx index e10bbf907cf32..0753b9154267a 100644 --- a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-server/index.tsx +++ b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-server/index.tsx @@ -1,11 +1,8 @@ import { MenuItem } from '@affine/component/ui/menu'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { useI18n } from '@affine/i18n'; import { PlusIcon } from '@blocksuite/icons/rc'; -import { - FeatureFlagService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import * as styles from './index.css'; diff --git a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-workspace/index.tsx b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-workspace/index.tsx index 1ec5b58dcff3c..564fd9a0b9f11 100644 --- a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-workspace/index.tsx +++ b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/add-workspace/index.tsx @@ -1,11 +1,8 @@ import { MenuItem } from '@affine/component/ui/menu'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { useI18n } from '@affine/i18n'; import { ImportIcon, PlusIcon } from '@blocksuite/icons/rc'; -import { - FeatureFlagService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import * as styles from './index.css'; diff --git a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/index.tsx b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/index.tsx index b5b7e1780f6d9..22accb5c84a7b 100644 --- a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/index.tsx +++ b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/index.tsx @@ -2,16 +2,15 @@ import { Divider } from '@affine/component/ui/divider'; import { MenuItem } from '@affine/component/ui/menu'; import { AuthService } from '@affine/core/modules/cloud'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; -import { useI18n } from '@affine/i18n'; -import { track } from '@affine/track'; -import { Logo1Icon } from '@blocksuite/icons/rc'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { - FeatureFlagService, - useLiveData, - useService, type WorkspaceMetadata, WorkspacesService, -} from '@toeverything/infra'; +} from '@affine/core/modules/workspace'; +import { useI18n } from '@affine/i18n'; +import { track } from '@affine/track'; +import { Logo1Icon } from '@blocksuite/icons/rc'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback } from 'react'; import { AddServer } from './add-server'; diff --git a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/workspace-list/index.tsx b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/workspace-list/index.tsx index 1257c7e7fc122..e39cd5acceac9 100644 --- a/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/workspace-list/index.tsx +++ b/packages/frontend/core/src/components/workspace-selector/user-with-workspace-list/workspace-list/index.tsx @@ -11,6 +11,12 @@ import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-he import type { Server } from '@affine/core/modules/cloud'; import { AuthService, ServersService } from '@affine/core/modules/cloud'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { + type WorkspaceMetadata, + WorkspaceService, + WorkspacesService, +} from '@affine/core/modules/workspace'; import { ServerDeploymentType } from '@affine/graphql'; import { useI18n } from '@affine/i18n'; import { @@ -20,15 +26,11 @@ import { PlusIcon, TeamWorkspaceIcon, } from '@blocksuite/icons/rc'; -import type { WorkspaceMetadata } from '@toeverything/infra'; import { FrameworkScope, - GlobalContextService, useLiveData, useService, useServiceOptional, - WorkspaceService, - WorkspacesService, } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/components/workspace-selector/workspace-card/pure-workspace-card.tsx b/packages/frontend/core/src/components/workspace-selector/workspace-card/pure-workspace-card.tsx index 6e70d429893df..10a682485d7c7 100644 --- a/packages/frontend/core/src/components/workspace-selector/workspace-card/pure-workspace-card.tsx +++ b/packages/frontend/core/src/components/workspace-selector/workspace-card/pure-workspace-card.tsx @@ -1,13 +1,13 @@ import { Skeleton } from '@affine/component'; -import { WorkspaceAvatar } from '@affine/component/workspace-avatar'; import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { DoneIcon } from '@blocksuite/icons/rc'; -import { type WorkspaceMetadata } from '@toeverything/infra'; import clsx from 'clsx'; import type { HTMLAttributes } from 'react'; import { forwardRef } from 'react'; +import { WorkspaceAvatar } from '../../workspace-avatar'; import * as styles from './styles.css'; export const PureWorkspaceCard = forwardRef< diff --git a/packages/frontend/core/src/desktop/components/ai-island/container.tsx b/packages/frontend/core/src/desktop/components/ai-island/container.tsx index d9edf6035c86d..0f9ddafe0c253 100644 --- a/packages/frontend/core/src/desktop/components/ai-island/container.tsx +++ b/packages/frontend/core/src/desktop/components/ai-island/container.tsx @@ -1,9 +1,6 @@ -import { - DocsService, - GlobalContextService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { DocsService } from '@affine/core/modules/doc'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { useLiveData, useService } from '@toeverything/infra'; import clsx from 'clsx'; import type { PropsWithChildren, ReactElement } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/collection-editor/rules-mode.tsx b/packages/frontend/core/src/desktop/dialogs/collection-editor/rules-mode.tsx index 8f1b894ece342..db46d69e4e78c 100644 --- a/packages/frontend/core/src/desktop/dialogs/collection-editor/rules-mode.tsx +++ b/packages/frontend/core/src/desktop/dialogs/collection-editor/rules-mode.tsx @@ -8,6 +8,7 @@ import { type ListItem, ListScrollContainer, } from '@affine/core/components/page-list'; +import { DocsService } from '@affine/core/modules/doc'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; import type { Collection } from '@affine/env/filter'; import { Trans, useI18n } from '@affine/i18n'; @@ -18,7 +19,7 @@ import { PageIcon, ToggleCollapseIcon, } from '@blocksuite/icons/rc'; -import { DocsService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import clsx from 'clsx'; import type { ReactNode } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/create-workspace/index.tsx b/packages/frontend/core/src/desktop/dialogs/create-workspace/index.tsx index b1f5b451f9e3a..17b08cebc1aea 100644 --- a/packages/frontend/core/src/desktop/dialogs/create-workspace/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/create-workspace/index.tsx @@ -8,14 +8,11 @@ import { type GLOBAL_DIALOG_SCHEMA, GlobalDialogService, } from '@affine/core/modules/dialogs'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; +import { WorkspacesService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; -import { - FeatureFlagService, - useLiveData, - useService, - WorkspacesService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import { buildShowcaseWorkspace } from '../../../utils/first-app-data'; diff --git a/packages/frontend/core/src/desktop/dialogs/doc-info/index.tsx b/packages/frontend/core/src/desktop/dialogs/doc-info/index.tsx index 04231c7abc6ba..11bb2c5f5dd06 100644 --- a/packages/frontend/core/src/desktop/dialogs/doc-info/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/doc-info/index.tsx @@ -2,8 +2,8 @@ import { Modal, Scrollable } from '@affine/component'; import { BlocksuiteHeaderTitle } from '@affine/core/components/blocksuite/block-suite-header/title'; import type { DialogComponentProps } from '@affine/core/modules/dialogs'; import type { WORKSPACE_DIALOG_SCHEMA } from '@affine/core/modules/dialogs/constant'; -import type { Doc } from '@toeverything/infra'; -import { DocsService, FrameworkScope, useService } from '@toeverything/infra'; +import { Doc, DocsService } from '@affine/core/modules/doc'; +import { FrameworkScope, useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; import { InfoTable } from './info-modal'; diff --git a/packages/frontend/core/src/desktop/dialogs/doc-info/info-modal.tsx b/packages/frontend/core/src/desktop/dialogs/doc-info/info-modal.tsx index 2edaa3f217355..e968c0cd80086 100644 --- a/packages/frontend/core/src/desktop/dialogs/doc-info/info-modal.tsx +++ b/packages/frontend/core/src/desktop/dialogs/doc-info/info-modal.tsx @@ -7,6 +7,8 @@ import { } from '@affine/component'; import { CreatePropertyMenuItems } from '@affine/core/components/doc-properties/menu/create-doc-property'; import { DocPropertyRow } from '@affine/core/components/doc-properties/table'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; +import { DocsService } from '@affine/core/modules/doc'; import { DocDatabaseBacklinkInfo } from '@affine/core/modules/doc-info'; import type { DatabaseRow, @@ -16,13 +18,7 @@ import { DocsSearchService } from '@affine/core/modules/docs-search'; import { useI18n } from '@affine/i18n'; import track from '@affine/track'; import { PlusIcon } from '@blocksuite/icons/rc'; -import { - type DocCustomPropertyInfo, - DocsService, - LiveData, - useLiveData, - useServices, -} from '@toeverything/infra'; +import { LiveData, useLiveData, useServices } from '@toeverything/infra'; import { useCallback, useMemo, useState } from 'react'; import * as styles from './info-modal.css'; diff --git a/packages/frontend/core/src/desktop/dialogs/doc-info/time-row.tsx b/packages/frontend/core/src/desktop/dialogs/doc-info/time-row.tsx index 11d62fd06dc7e..bfcced52138b5 100644 --- a/packages/frontend/core/src/desktop/dialogs/doc-info/time-row.tsx +++ b/packages/frontend/core/src/desktop/dialogs/doc-info/time-row.tsx @@ -1,12 +1,9 @@ import { PropertyName, PropertyRoot, PropertyValue } from '@affine/component'; +import { DocsService } from '@affine/core/modules/doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { i18nTime, useI18n } from '@affine/i18n'; import { DateTimeIcon, HistoryIcon } from '@blocksuite/icons/rc'; -import { - DocsService, - useLiveData, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import clsx from 'clsx'; import type { ConfigType } from 'dayjs'; import { useDebouncedValue } from 'foxact/use-debounced-value'; diff --git a/packages/frontend/core/src/desktop/dialogs/enable-cloud/index.tsx b/packages/frontend/core/src/desktop/dialogs/enable-cloud/index.tsx index 29d099e287b5c..244eaab4172ba 100644 --- a/packages/frontend/core/src/desktop/dialogs/enable-cloud/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/enable-cloud/index.tsx @@ -12,14 +12,10 @@ import { type GLOBAL_DIALOG_SCHEMA, GlobalDialogService, } from '@affine/core/modules/dialogs'; +import { WorkspacesService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { CloudWorkspaceIcon } from '@blocksuite/icons/rc'; -import { - FrameworkScope, - useLiveData, - useService, - WorkspacesService, -} from '@toeverything/infra'; +import { FrameworkScope, useLiveData, useService } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import * as styles from './dialog.css'; diff --git a/packages/frontend/core/src/desktop/dialogs/import-template/index.tsx b/packages/frontend/core/src/desktop/dialogs/import-template/index.tsx index 79fe01d3133a5..388ac6c6acaf7 100644 --- a/packages/frontend/core/src/desktop/dialogs/import-template/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/import-template/index.tsx @@ -12,15 +12,14 @@ import { ImportTemplateService, TemplateDownloaderService, } from '@affine/core/modules/import-template'; -import { useI18n } from '@affine/i18n'; -import type { DocMode } from '@blocksuite/affine/blocks'; -import { AllDocsIcon } from '@blocksuite/icons/rc'; import { - useLiveData, - useService, type WorkspaceMetadata, WorkspacesService, -} from '@toeverything/infra'; +} from '@affine/core/modules/workspace'; +import { useI18n } from '@affine/i18n'; +import type { DocMode } from '@blocksuite/affine/blocks'; +import { AllDocsIcon } from '@blocksuite/icons/rc'; +import { useLiveData, useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import { useCallback, useEffect, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/import-workspace/index.tsx b/packages/frontend/core/src/desktop/dialogs/import-workspace/index.tsx index dafb9b90617f0..80e227835e718 100644 --- a/packages/frontend/core/src/desktop/dialogs/import-workspace/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/import-workspace/index.tsx @@ -3,11 +3,12 @@ import { type DialogComponentProps, type GLOBAL_DIALOG_SCHEMA, } from '@affine/core/modules/dialogs'; +import { WorkspacesService } from '@affine/core/modules/workspace'; import { _addLocalWorkspace } from '@affine/core/modules/workspace-engine'; import { DebugLogger } from '@affine/debug'; import { apis } from '@affine/electron-api'; import { useI18n } from '@affine/i18n'; -import { useService, WorkspacesService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useLayoutEffect } from 'react'; const logger = new DebugLogger('ImportWorkspaceDialog'); diff --git a/packages/frontend/core/src/desktop/dialogs/import/index.tsx b/packages/frontend/core/src/desktop/dialogs/import/index.tsx index 4b1adf89f1d69..2c3532a9bf160 100644 --- a/packages/frontend/core/src/desktop/dialogs/import/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/import/index.tsx @@ -5,6 +5,7 @@ import type { WORKSPACE_DIALOG_SCHEMA, } from '@affine/core/modules/dialogs'; import { UrlService } from '@affine/core/modules/url'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { DebugLogger } from '@affine/debug'; import { useI18n } from '@affine/i18n'; import track from '@affine/track'; @@ -24,7 +25,7 @@ import { PageIcon, ZipIcon, } from '@blocksuite/icons/rc'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import { cssVarV2 } from '@toeverything/theme/v2'; import { diff --git a/packages/frontend/core/src/desktop/dialogs/selectors/collection.tsx b/packages/frontend/core/src/desktop/dialogs/selectors/collection.tsx index 39a3c26c9316b..a73b1c6bf58cc 100644 --- a/packages/frontend/core/src/desktop/dialogs/selectors/collection.tsx +++ b/packages/frontend/core/src/desktop/dialogs/selectors/collection.tsx @@ -13,8 +13,9 @@ import { CollectionService } from '@affine/core/modules/collection'; import type { DialogComponentProps } from '@affine/core/modules/dialogs'; import type { WORKSPACE_DIALOG_SCHEMA } from '@affine/core/modules/dialogs/constant'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import { useCallback, useMemo, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/selectors/tag.tsx b/packages/frontend/core/src/desktop/dialogs/selectors/tag.tsx index 574eb76604789..d48bbaa2ebd78 100644 --- a/packages/frontend/core/src/desktop/dialogs/selectors/tag.tsx +++ b/packages/frontend/core/src/desktop/dialogs/selectors/tag.tsx @@ -15,8 +15,9 @@ import type { } from '@affine/core/modules/dialogs'; import { FavoriteService } from '@affine/core/modules/favorite'; import { TagService } from '@affine/core/modules/tag'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import { useCallback, useMemo, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/appearance/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/appearance/index.tsx index d95ec0454968e..a91a46221c50b 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/appearance/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/appearance/index.tsx @@ -6,12 +6,9 @@ import { SettingWrapper, } from '@affine/component/setting-components'; import { LanguageMenu } from '@affine/core/components/affine/language-menu'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { useI18n } from '@affine/i18n'; -import { - FeatureFlagService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useTheme } from 'next-themes'; import { useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/experimental-features/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/experimental-features/index.tsx index 59c8148160ca2..072c7c11386af 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/experimental-features/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/experimental-features/index.tsx @@ -1,6 +1,11 @@ import { Button, Checkbox, Loading, Switch, Tooltip } from '@affine/component'; import { SettingHeader } from '@affine/component/setting-components'; import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; +import { + AFFINE_FLAGS, + FeatureFlagService, + type Flag, +} from '@affine/core/modules/feature-flag'; import { useI18n } from '@affine/i18n'; import { ArrowRightSmallIcon, @@ -8,13 +13,7 @@ import { EmailIcon, GithubIcon, } from '@blocksuite/icons/rc'; -import { - AFFINE_FLAGS, - FeatureFlagService, - type Flag, - useLiveData, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import { useAtom } from 'jotai'; import { atomWithStorage } from 'jotai/utils'; import { Suspense, useCallback, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/index.tsx index af936f3c14a24..d1638e9c4ecca 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/index.tsx @@ -8,13 +8,10 @@ import type { GLOBAL_DIALOG_SCHEMA, } from '@affine/core/modules/dialogs'; import type { SettingTab } from '@affine/core/modules/dialogs/constant'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import { Trans } from '@affine/i18n'; import { ContactWithUsIcon } from '@blocksuite/icons/rc'; -import { - useLiveData, - useService, - type WorkspaceMetadata, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { debounce } from 'lodash-es'; import { Suspense, diff --git a/packages/frontend/core/src/desktop/dialogs/setting/setting-sidebar/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/setting-sidebar/index.tsx index c2369d5f9ee90..9137283f8b776 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/setting-sidebar/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/setting-sidebar/index.tsx @@ -12,18 +12,16 @@ import { AuthService } from '@affine/core/modules/cloud'; import { UserFeatureService } from '@affine/core/modules/cloud/services/user-feature'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; import type { SettingTab } from '@affine/core/modules/dialogs/constant'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { + type WorkspaceMetadata, + WorkspacesService, +} from '@affine/core/modules/workspace'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import { Logo1Icon } from '@blocksuite/icons/rc'; -import type { WorkspaceMetadata } from '@toeverything/infra'; -import { - GlobalContextService, - useLiveData, - useService, - useServices, - WorkspacesService, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import clsx from 'clsx'; import { type MouseEvent, diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/billing/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/billing/index.tsx index b67ec2f146bbf..ace01bd9d561f 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/billing/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/billing/index.tsx @@ -17,6 +17,7 @@ import { } from '@affine/core/modules/cloud'; import { WorkspaceQuotaService } from '@affine/core/modules/quota'; import { UrlService } from '@affine/core/modules/url'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import { createCustomerPortalMutation, type InvoicesQuery, @@ -26,12 +27,7 @@ import { UserFriendlyError, } from '@affine/graphql'; import { useI18n } from '@affine/i18n'; -import { - FrameworkScope, - useLiveData, - useService, - type WorkspaceMetadata, -} from '@toeverything/infra'; +import { FrameworkScope, useLiveData, useService } from '@toeverything/infra'; import { cssVar } from '@toeverything/theme'; import { useCallback, useEffect, useMemo, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx index 68bea254399b6..58d4a809eaf39 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/delete/index.tsx @@ -2,9 +2,9 @@ import { Input } from '@affine/component'; import type { ConfirmModalProps } from '@affine/component/ui/modal'; import { ConfirmModal } from '@affine/component/ui/modal'; import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { Trans, useI18n } from '@affine/i18n'; -import type { WorkspaceMetadata } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import * as styles from './style.css'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx index b0cbd633c5d8e..38bcccdf4253b 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/delete-leave-workspace/index.tsx @@ -2,16 +2,15 @@ import { notify } from '@affine/component'; import { SettingRow } from '@affine/component/setting-components'; import { ConfirmModal } from '@affine/component/ui/modal'; import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; -import { useI18n } from '@affine/i18n'; -import { ArrowRightSmallIcon } from '@blocksuite/icons/rc'; import { - GlobalContextService, - useLiveData, - useServices, WorkspaceService, WorkspacesService, -} from '@toeverything/infra'; +} from '@affine/core/modules/workspace'; +import { useI18n } from '@affine/i18n'; +import { ArrowRightSmallIcon } from '@blocksuite/icons/rc'; +import { useLiveData, useServices } from '@toeverything/infra'; import { useCallback, useEffect, useState } from 'react'; import { diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx index 69ca382628b41..fa329a1be823b 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/enable-cloud.tsx @@ -1,14 +1,10 @@ import { SettingRow } from '@affine/component/setting-components'; import { Button } from '@affine/component/ui/button'; import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud'; +import { Workspace, WorkspaceService } from '@affine/core/modules/workspace'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { useI18n } from '@affine/i18n'; -import { - useLiveData, - useService, - type Workspace, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback } from 'react'; export interface PublishPanelProps { diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/export.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/export.tsx index 4c730246e14f7..03170ff60046e 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/export.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/export.tsx @@ -5,14 +5,13 @@ import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hoo import { useSystemOnline } from '@affine/core/components/hooks/use-system-online'; import { DesktopApiService } from '@affine/core/modules/desktop-api'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; +import type { + Workspace, + WorkspaceMetadata, +} from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import track from '@affine/track'; -import { - useLiveData, - useService, - type Workspace, - type WorkspaceMetadata, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useState } from 'react'; interface ExportPanelProps { diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/member-list.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/member-list.tsx index 6a801c27840e9..3ca49f255b8a9 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/member-list.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/member-list.tsx @@ -6,6 +6,7 @@ import { WorkspaceMembersService, WorkspacePermissionService, } from '@affine/core/modules/permissions'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { Permission, UserFriendlyError, @@ -17,7 +18,6 @@ import { useEnsureLiveData, useLiveData, useService, - WorkspaceService, } from '@toeverything/infra'; import clsx from 'clsx'; import { clamp } from 'lodash-es'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/profile.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/profile.tsx index 85470a315c42b..71077b6d039fc 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/profile.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/profile.tsx @@ -4,11 +4,12 @@ import { WorkspaceAvatar } from '@affine/component/workspace-avatar'; import { useCatchEventCallback } from '@affine/core/components/hooks/use-catch-event-hook'; import { Upload } from '@affine/core/components/pure/file-upload'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { validateAndReduceImage } from '@affine/core/utils/reduce-image'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { useI18n } from '@affine/i18n'; import { CameraIcon } from '@blocksuite/icons/rc'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import type { KeyboardEvent } from 'react'; import { useCallback, useEffect, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/sharing.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/sharing.tsx index b2a4d014cd072..a4e773684f98a 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/sharing.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/sharing.tsx @@ -6,8 +6,9 @@ import { import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; import { WorkspaceShareSettingService } from '@affine/core/modules/share-setting'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; export const SharingPanel = () => { const workspace = useService(WorkspaceService).workspace; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/types.ts b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/types.ts index e16ef68a5d40d..6604851b7d13a 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/types.ts +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/types.ts @@ -1,4 +1,4 @@ -import type { WorkspaceMetadata } from '@toeverything/infra'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import type { SettingState } from '../../types'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/properties/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/properties/index.tsx index ae2123de61374..55a3fd360d9c2 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/properties/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/properties/index.tsx @@ -3,13 +3,11 @@ import { SettingHeader } from '@affine/component/setting-components'; import { DocPropertyManager } from '@affine/core/components/doc-properties/manager'; import { CreatePropertyMenuItems } from '@affine/core/components/doc-properties/menu/create-doc-property'; import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import { Trans, useI18n } from '@affine/i18n'; import track from '@affine/track'; -import { - type DocCustomPropertyInfo, - FrameworkScope, - type WorkspaceMetadata, -} from '@toeverything/infra'; +import { FrameworkScope } from '@toeverything/infra'; import { useCallback } from 'react'; import { useWorkspace } from '../../../../../components/hooks/use-workspace'; diff --git a/packages/frontend/core/src/desktop/pages/index/index.tsx b/packages/frontend/core/src/desktop/pages/index/index.tsx index 819323a40fc0e..187c180eb5665 100644 --- a/packages/frontend/core/src/desktop/pages/index/index.tsx +++ b/packages/frontend/core/src/desktop/pages/index/index.tsx @@ -1,4 +1,5 @@ import { DesktopApiService } from '@affine/core/modules/desktop-api'; +import { WorkspacesService } from '@affine/core/modules/workspace'; import { buildShowcaseWorkspace, createFirstAppData, @@ -7,7 +8,6 @@ import { useLiveData, useService, useServiceOptional, - WorkspacesService, } from '@toeverything/infra'; import { type ReactNode, diff --git a/packages/frontend/core/src/desktop/pages/root/index.tsx b/packages/frontend/core/src/desktop/pages/root/index.tsx index 9c22d23248ce4..0b7aff417d611 100644 --- a/packages/frontend/core/src/desktop/pages/root/index.tsx +++ b/packages/frontend/core/src/desktop/pages/root/index.tsx @@ -1,10 +1,7 @@ import { NotificationCenter } from '@affine/component'; import { DefaultServerService } from '@affine/core/modules/cloud'; -import { - FrameworkScope, - GlobalContextService, - useService, -} from '@toeverything/infra'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { FrameworkScope, useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; import { Outlet } from 'react-router-dom'; diff --git a/packages/frontend/core/src/desktop/pages/upgrade-to-team/index.tsx b/packages/frontend/core/src/desktop/pages/upgrade-to-team/index.tsx index cd404980ee0cb..35c694c938bda 100644 --- a/packages/frontend/core/src/desktop/pages/upgrade-to-team/index.tsx +++ b/packages/frontend/core/src/desktop/pages/upgrade-to-team/index.tsx @@ -13,17 +13,16 @@ import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hoo import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info'; import { PureWorkspaceCard } from '@affine/core/components/workspace-selector/workspace-card'; import { AuthService } from '@affine/core/modules/cloud'; +import { + type WorkspaceMetadata, + WorkspacesService, +} from '@affine/core/modules/workspace'; import { buildShowcaseWorkspace } from '@affine/core/utils/first-app-data'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { SubscriptionPlan, SubscriptionRecurring } from '@affine/graphql'; import { type I18nString, Trans, useI18n } from '@affine/i18n'; import { DoneIcon, NewPageIcon } from '@blocksuite/icons/rc'; -import { - useLiveData, - useService, - type WorkspaceMetadata, - WorkspacesService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useMemo, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page.tsx b/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page.tsx index 0c6c032a0bc7a..db690a12617c5 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page.tsx @@ -4,13 +4,11 @@ import { useFilteredPageMetas, VirtualizedPageList, } from '@affine/core/components/page-list'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { Filter } from '@affine/env/filter'; import { useI18n } from '@affine/i18n'; -import { - GlobalContextService, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; import { diff --git a/packages/frontend/core/src/desktop/pages/workspace/collection/index.tsx b/packages/frontend/core/src/desktop/pages/workspace/collection/index.tsx index 61cf826f63127..11eb3b852d205 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/collection/index.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/collection/index.tsx @@ -3,16 +3,12 @@ import { EmptyCollectionDetail } from '@affine/core/components/affine/empty/coll import { VirtualizedPageList } from '@affine/core/components/page-list'; import { CollectionService } from '@affine/core/modules/collection'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { Collection } from '@affine/env/filter'; import { useI18n } from '@affine/i18n'; import { ViewLayersIcon } from '@blocksuite/icons/rc'; -import { - GlobalContextService, - useLiveData, - useService, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import { useCallback, useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-header.tsx b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-header.tsx index bbe446b366c24..233f04eb50c35 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-header.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-header.tsx @@ -20,11 +20,12 @@ import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { EditorService } from '@affine/core/modules/editor'; import { JournalService } from '@affine/core/modules/journal'; import { ViewIcon, ViewTitle } from '@affine/core/modules/workbench'; +import type { Workspace } from '@affine/core/modules/workspace'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import type { Doc } from '@blocksuite/affine/store'; -import { useLiveData, useService, type Workspace } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { forwardRef, useCallback, useEffect, useRef, useState } from 'react'; import * as styles from './detail-page-header.css'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-wrapper.tsx b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-wrapper.tsx index 640b4db16bd27..880f6cae4d398 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-wrapper.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page-wrapper.tsx @@ -1,14 +1,9 @@ +import { Doc, DocsService } from '@affine/core/modules/doc'; import type { Editor } from '@affine/core/modules/editor'; import { EditorsService } from '@affine/core/modules/editor'; import { ViewService } from '@affine/core/modules/workbench/services/view'; -import type { Doc } from '@toeverything/infra'; -import { - DocsService, - FrameworkScope, - useLiveData, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { WorkspaceService } from '@affine/core/modules/workspace'; +import { FrameworkScope, useLiveData, useService } from '@toeverything/infra'; import { type PropsWithChildren, type ReactNode, diff --git a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx index 3b2dd82e6366a..716ee695a5b81 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/detail-page/detail-page.tsx @@ -7,9 +7,13 @@ import { EditorOutlineViewer } from '@affine/core/components/blocksuite/outline- import { DocPropertySidebar } from '@affine/core/components/doc-properties/sidebar'; import { useAppSettingHelper } from '@affine/core/components/hooks/affine/use-app-setting-helper'; import { useDocMetaHelper } from '@affine/core/components/hooks/use-block-suite-page-meta'; +import { DocService } from '@affine/core/modules/doc'; import { EditorService } from '@affine/core/modules/editor'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import { RecentDocsService } from '@affine/core/modules/quicksearch'; -import { ViewService } from '@affine/core/modules/workbench/services/view'; +import { ViewService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { RefNodeSlotsProvider } from '@blocksuite/affine/blocks'; import { DisposableGroup } from '@blocksuite/affine/global/utils'; import { type AffineEditorContainer } from '@blocksuite/affine/presets'; @@ -21,14 +25,10 @@ import { TodayIcon, } from '@blocksuite/icons/rc'; import { - DocService, - FeatureFlagService, FrameworkScope, - GlobalContextService, useLiveData, useService, useServices, - WorkspaceService, } from '@toeverything/infra'; import clsx from 'clsx'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/detail-page/tabs/journal.tsx b/packages/frontend/core/src/desktop/pages/workspace/detail-page/tabs/journal.tsx index b21460eaac6b2..f1059cbfb727b 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/detail-page/tabs/journal.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/detail-page/tabs/journal.tsx @@ -10,18 +10,13 @@ import { } from '@affine/component'; import { useJournalRouteHelper } from '@affine/core/components/hooks/use-journal'; import { MoveToTrash } from '@affine/core/components/page-list'; +import { DocRecord, DocService, DocsService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { JournalService } from '@affine/core/modules/journal'; import { WorkbenchLink } from '@affine/core/modules/workbench'; import { useI18n } from '@affine/i18n'; import { CalendarXmarkIcon, EditIcon } from '@blocksuite/icons/rc'; -import type { DocRecord } from '@toeverything/infra'; -import { - DocService, - DocsService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { assignInlineVars } from '@vanilla-extract/dynamic'; import clsx from 'clsx'; import dayjs from 'dayjs'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/index.tsx b/packages/frontend/core/src/desktop/pages/workspace/index.tsx index 4d3d46c222203..a8d22ce810fd7 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/index.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/index.tsx @@ -6,15 +6,18 @@ import { WorkspaceServerService, } from '@affine/core/modules/cloud'; import { DndService } from '@affine/core/modules/dnd/services'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { + type Workspace, + type WorkspaceMetadata, + WorkspacesService, +} from '@affine/core/modules/workspace'; import { ZipTransformer } from '@blocksuite/affine/blocks'; -import type { Workspace, WorkspaceMetadata } from '@toeverything/infra'; import { FrameworkScope, - GlobalContextService, useLiveData, useService, useServices, - WorkspacesService, } from '@toeverything/infra'; import type { PropsWithChildren, ReactElement } from 'react'; import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; @@ -31,11 +34,11 @@ declare global { /** * @internal debug only */ - // eslint-disable-next-line no-var + var currentWorkspace: Workspace | undefined; - // eslint-disable-next-line no-var + var exportWorkspaceSnapshot: (docs?: string[]) => Promise; - // eslint-disable-next-line no-var + var importWorkspaceSnapshot: () => Promise; interface WindowEventMap { 'affine:workspace:change': CustomEvent<{ id: string }>; diff --git a/packages/frontend/core/src/desktop/pages/workspace/layouts/workspace-layout.tsx b/packages/frontend/core/src/desktop/pages/workspace/layouts/workspace-layout.tsx index 38b5ee51b5a2e..f287d6671fbb4 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/layouts/workspace-layout.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/layouts/workspace-layout.tsx @@ -12,12 +12,8 @@ import { WorkspaceDialogs } from '@affine/core/desktop/dialogs'; import { PeekViewManagerModal } from '@affine/core/modules/peek-view'; import { QuotaCheck } from '@affine/core/modules/quota'; import { WorkbenchService } from '@affine/core/modules/workbench'; -import { - LiveData, - useLiveData, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { WorkspaceService } from '@affine/core/modules/workspace'; +import { LiveData, useLiveData, useService } from '@toeverything/infra'; import type { PropsWithChildren } from 'react'; export const WorkspaceLayout = function WorkspaceLayout({ diff --git a/packages/frontend/core/src/desktop/pages/workspace/share/share-page.tsx b/packages/frontend/core/src/desktop/pages/workspace/share/share-page.tsx index 8d4219960a702..f29ac8639314e 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/share/share-page.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/share/share-page.tsx @@ -10,6 +10,7 @@ import { FetchService, GraphQLService, } from '@affine/core/modules/cloud'; +import { type Doc, DocsService } from '@affine/core/modules/doc'; import { type Editor, type EditorSelector, @@ -19,6 +20,7 @@ import { import { PeekViewManagerModal } from '@affine/core/modules/peek-view'; import { ShareReaderService } from '@affine/core/modules/share-doc'; import { ViewIcon, ViewTitle } from '@affine/core/modules/workbench'; +import { Workspace, WorkspacesService } from '@affine/core/modules/workspace'; import { CloudBlobStorage } from '@affine/core/modules/workspace-engine'; import { useI18n } from '@affine/i18n'; import { @@ -29,16 +31,13 @@ import { import type { AffineEditorContainer } from '@blocksuite/affine/presets'; import { DisposableGroup } from '@blocksuite/global/utils'; import { Logo1Icon } from '@blocksuite/icons/rc'; -import type { Doc, Workspace } from '@toeverything/infra'; import { - DocsService, EmptyBlobStorage, FrameworkScope, ReadonlyDocStorage, useLiveData, useService, useServices, - WorkspacesService, } from '@toeverything/infra'; import clsx from 'clsx'; import { diff --git a/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx b/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx index 5736e69661a7d..cf7d355d65fd0 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx @@ -3,6 +3,7 @@ import { TagPageListHeader, VirtualizedPageList, } from '@affine/core/components/page-list'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import { TagService } from '@affine/core/modules/tag'; import { useIsActiveView, @@ -11,12 +12,8 @@ import { ViewIcon, ViewTitle, } from '@affine/core/modules/workbench'; -import { - GlobalContextService, - useLiveData, - useService, - WorkspaceService, -} from '@toeverything/infra'; +import { WorkspaceService } from '@affine/core/modules/workspace'; +import { useLiveData, useService } from '@toeverything/infra'; import { useEffect, useMemo } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/mobile/components/app-tabs/create.tsx b/packages/frontend/core/src/mobile/components/app-tabs/create.tsx index 94681eb6c0d0b..1c638b6202992 100644 --- a/packages/frontend/core/src/mobile/components/app-tabs/create.tsx +++ b/packages/frontend/core/src/mobile/components/app-tabs/create.tsx @@ -1,8 +1,9 @@ import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils'; import { WorkbenchService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import track from '@affine/track'; import { EditIcon } from '@blocksuite/icons/rc'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useCallback } from 'react'; import type { AppTabCustomFCProps } from './data'; diff --git a/packages/frontend/core/src/mobile/components/app-tabs/tab-item.tsx b/packages/frontend/core/src/mobile/components/app-tabs/tab-item.tsx index f5194ddd2a848..c4297062bc1c3 100644 --- a/packages/frontend/core/src/mobile/components/app-tabs/tab-item.tsx +++ b/packages/frontend/core/src/mobile/components/app-tabs/tab-item.tsx @@ -1,9 +1,5 @@ -import { - GlobalCacheService, - LiveData, - useLiveData, - useService, -} from '@toeverything/infra'; +import { GlobalCacheService } from '@affine/core/modules/storage'; +import { LiveData, useLiveData, useService } from '@toeverything/infra'; import { type PropsWithChildren, useCallback, useMemo } from 'react'; import { tabItem } from './styles.css'; diff --git a/packages/frontend/core/src/mobile/components/explorer/nodes/doc/index.tsx b/packages/frontend/core/src/mobile/components/explorer/nodes/doc/index.tsx index e3a86ba0bed9d..0a957c83101f8 100644 --- a/packages/frontend/core/src/mobile/components/explorer/nodes/doc/index.tsx +++ b/packages/frontend/core/src/mobile/components/explorer/nodes/doc/index.tsx @@ -1,13 +1,13 @@ import { Loading } from '@affine/component'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; +import { DocsService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { DocsSearchService } from '@affine/core/modules/docs-search'; import type { NodeOperation } from '@affine/core/modules/explorer'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import { useI18n } from '@affine/i18n'; import { - DocsService, - FeatureFlagService, - GlobalContextService, LiveData, useLiveData, useService, diff --git a/packages/frontend/core/src/mobile/components/explorer/nodes/doc/operations.tsx b/packages/frontend/core/src/mobile/components/explorer/nodes/doc/operations.tsx index a2fcf793a0e66..3f8f38150ea92 100644 --- a/packages/frontend/core/src/mobile/components/explorer/nodes/doc/operations.tsx +++ b/packages/frontend/core/src/mobile/components/explorer/nodes/doc/operations.tsx @@ -10,9 +10,12 @@ import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-pa import { useBlockSuiteMetaHelper } from '@affine/core/components/hooks/affine/use-block-suite-meta-helper'; import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; import { IsFavoriteIcon } from '@affine/core/components/pure/icons'; +import { DocsService } from '@affine/core/modules/doc'; import type { NodeOperation } from '@affine/core/modules/explorer'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { WorkbenchService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { preventDefault } from '@affine/core/utils'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; @@ -25,14 +28,7 @@ import { PlusIcon, SplitViewIcon, } from '@blocksuite/icons/rc'; -import { - DocsService, - FeatureFlagService, - useLiveData, - useService, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import { DocFrameScope, DocInfoSheet } from '../../../doc-info'; diff --git a/packages/frontend/core/src/mobile/components/explorer/nodes/tag/index.tsx b/packages/frontend/core/src/mobile/components/explorer/nodes/tag/index.tsx index 271ab27625535..404b0dae0e10d 100644 --- a/packages/frontend/core/src/mobile/components/explorer/nodes/tag/index.tsx +++ b/packages/frontend/core/src/mobile/components/explorer/nodes/tag/index.tsx @@ -1,12 +1,9 @@ import type { NodeOperation } from '@affine/core/modules/explorer'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import type { Tag } from '@affine/core/modules/tag'; import { TagService } from '@affine/core/modules/tag'; import { useI18n } from '@affine/i18n'; -import { - GlobalContextService, - useLiveData, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import clsx from 'clsx'; import { useCallback, useMemo, useState } from 'react'; diff --git a/packages/frontend/core/src/mobile/components/explorer/sections/favorites/index.tsx b/packages/frontend/core/src/mobile/components/explorer/sections/favorites/index.tsx index 4343501ca3f90..1c0aebb47bd80 100644 --- a/packages/frontend/core/src/mobile/components/explorer/sections/favorites/index.tsx +++ b/packages/frontend/core/src/mobile/components/explorer/sections/favorites/index.tsx @@ -5,12 +5,9 @@ import { } from '@affine/core/modules/explorer'; import type { FavoriteSupportTypeUnion } from '@affine/core/modules/favorite'; import { FavoriteService } from '@affine/core/modules/favorite'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { - useLiveData, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import { useCallback } from 'react'; import { AddItemPlaceholder } from '../../layouts/add-item-placeholder'; diff --git a/packages/frontend/core/src/mobile/components/workspace-selector/current-card.tsx b/packages/frontend/core/src/mobile/components/workspace-selector/current-card.tsx index 515af7de59276..5a153219fabe5 100644 --- a/packages/frontend/core/src/mobile/components/workspace-selector/current-card.tsx +++ b/packages/frontend/core/src/mobile/components/workspace-selector/current-card.tsx @@ -1,9 +1,10 @@ import { Avatar } from '@affine/component'; -import { WorkspaceAvatar } from '@affine/component/workspace-avatar'; import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info'; +import { WorkspaceAvatar } from '@affine/core/components/workspace-avatar'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { ArrowDownSmallIcon } from '@blocksuite/icons/rc'; -import { useServiceOptional, WorkspaceService } from '@toeverything/infra'; +import { useServiceOptional } from '@toeverything/infra'; import clsx from 'clsx'; import { forwardRef, type HTMLAttributes } from 'react'; diff --git a/packages/frontend/core/src/mobile/components/workspace-selector/index.tsx b/packages/frontend/core/src/mobile/components/workspace-selector/index.tsx index 6b6213c6eae6f..8a52ae63c11a7 100644 --- a/packages/frontend/core/src/mobile/components/workspace-selector/index.tsx +++ b/packages/frontend/core/src/mobile/components/workspace-selector/index.tsx @@ -1,6 +1,7 @@ import { MobileMenu } from '@affine/component'; +import { WorkspacesService } from '@affine/core/modules/workspace'; import { track } from '@affine/track'; -import { useServiceOptional, WorkspacesService } from '@toeverything/infra'; +import { useServiceOptional } from '@toeverything/infra'; import { forwardRef, type HTMLAttributes, diff --git a/packages/frontend/core/src/mobile/modules/search/index.ts b/packages/frontend/core/src/mobile/modules/search/index.ts index b4984f20b8dd3..5c6e1ddebabbe 100644 --- a/packages/frontend/core/src/mobile/modules/search/index.ts +++ b/packages/frontend/core/src/mobile/modules/search/index.ts @@ -1,4 +1,5 @@ -import { type Framework, WorkspaceScope } from '@toeverything/infra'; +import { WorkspaceScope } from '@affine/core/modules/workspace'; +import { type Framework } from '@toeverything/infra'; import { MobileSearchService } from './service/search'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/collection/detail.tsx b/packages/frontend/core/src/mobile/pages/workspace/collection/detail.tsx index 814954ee3ca59..1259f94c944a5 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/collection/detail.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/collection/detail.tsx @@ -1,12 +1,9 @@ import { notify, useThemeColorV2 } from '@affine/component'; import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper'; import { CollectionService } from '@affine/core/modules/collection'; -import { - GlobalContextService, - useLiveData, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { GlobalContextService } from '@affine/core/modules/global-context'; +import { WorkspaceService } from '@affine/core/modules/workspace'; +import { useLiveData, useServices } from '@toeverything/infra'; import { useCallback, useEffect } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/detail/journal-conflict-block.tsx b/packages/frontend/core/src/mobile/pages/workspace/detail/journal-conflict-block.tsx index ec007e73421ab..631ae27972193 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/detail/journal-conflict-block.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/detail/journal-conflict-block.tsx @@ -1,11 +1,11 @@ import { IconButton, Menu } from '@affine/component'; +import { DocRecord, DocsService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { JournalService } from '@affine/core/modules/journal'; import { WorkbenchLink } from '@affine/core/modules/workbench'; import { useI18n } from '@affine/i18n'; import { EditIcon, TodayIcon } from '@blocksuite/icons/rc'; -import type { DocRecord } from '@toeverything/infra'; -import { DocsService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useMemo } from 'react'; import * as styles from './journal-conflict-block.css'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-today-activity.tsx b/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-today-activity.tsx index a4942a144b6e4..7ffad30918b60 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-today-activity.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-today-activity.tsx @@ -1,17 +1,16 @@ import { MenuItem, MenuSeparator, MobileMenuSub } from '@affine/component'; import { sortPagesByDate } from '@affine/core/desktop/pages/workspace/detail-page/tabs/journal'; +import { + type DocRecord, + DocService, + DocsService, +} from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { JournalService } from '@affine/core/modules/journal'; import { WorkbenchLink } from '@affine/core/modules/workbench'; import { useI18n } from '@affine/i18n'; import { HistoryIcon } from '@blocksuite/icons/rc'; -import type { DocRecord } from '@toeverything/infra'; -import { - DocService, - DocsService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import dayjs from 'dayjs'; import { type ReactNode, useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/detail/mobile-detail-page.tsx b/packages/frontend/core/src/mobile/pages/workspace/detail/mobile-detail-page.tsx index 055e5aace7c6f..342233b3b87c6 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/detail/mobile-detail-page.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/detail/mobile-detail-page.tsx @@ -10,11 +10,15 @@ import { PageDetailEditor } from '@affine/core/components/page-detail-editor'; import { DetailPageWrapper } from '@affine/core/desktop/pages/workspace/detail-page/detail-page-wrapper'; import { PageHeader } from '@affine/core/mobile/components'; import { useGlobalEvent } from '@affine/core/mobile/hooks/use-global-events'; +import { DocService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { EditorService } from '@affine/core/modules/editor'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import { JournalService } from '@affine/core/modules/journal'; import { WorkbenchService } from '@affine/core/modules/workbench'; import { ViewService } from '@affine/core/modules/workbench/services/view'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { i18nTime } from '@affine/i18n'; import { BookmarkBlockService, @@ -28,14 +32,10 @@ import { import { DisposableGroup } from '@blocksuite/affine/global/utils'; import { type AffineEditorContainer } from '@blocksuite/affine/presets'; import { - DocService, - FeatureFlagService, FrameworkScope, - GlobalContextService, useLiveData, useService, useServices, - WorkspaceService, } from '@toeverything/infra'; import { cssVarV2 } from '@toeverything/theme/v2'; import clsx from 'clsx'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-more-button.tsx b/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-more-button.tsx index 56510085d9d00..32b538516981f 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-more-button.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-more-button.tsx @@ -9,6 +9,7 @@ import { useFavorite } from '@affine/core/components/blocksuite/block-suite-head import { IsFavoriteIcon } from '@affine/core/components/pure/icons'; import { EditorOutlinePanel } from '@affine/core/desktop/pages/workspace/detail-page/tabs/outline'; import { DocInfoSheet } from '@affine/core/mobile/components'; +import { DocService } from '@affine/core/modules/doc'; import { EditorService } from '@affine/core/modules/editor'; import { ViewService } from '@affine/core/modules/workbench/services/view'; import { preventDefault } from '@affine/core/utils'; @@ -21,7 +22,7 @@ import { PageIcon, TocIcon, } from '@blocksuite/icons/rc'; -import { DocService, useLiveData, useService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useCallback, useEffect, useState } from 'react'; import { JournalConflictsMenuItem } from './menu/journal-conflicts'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-share-button.tsx b/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-share-button.tsx index c1d83a980f052..dbd7daf545724 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-share-button.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/detail/page-header-share-button.tsx @@ -1,8 +1,10 @@ import { IconButton, MobileMenu } from '@affine/component'; import { SharePage } from '@affine/core/components/affine/share-page-modal/share-menu/share-page'; import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud'; +import { DocService } from '@affine/core/modules/doc'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { ShareiOsIcon } from '@blocksuite/icons/rc'; -import { DocService, useServices, WorkspaceService } from '@toeverything/infra'; +import { useServices } from '@toeverything/infra'; import * as styles from './page-header-share-button.css'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/index.tsx b/packages/frontend/core/src/mobile/pages/workspace/index.tsx index e172ce9ecb416..62036df3f5901 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/index.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/index.tsx @@ -2,11 +2,8 @@ import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error import { AffineErrorComponent } from '@affine/core/components/affine/affine-error-boundary/affine-error-fallback'; import { PageNotFound } from '@affine/core/desktop/pages/404'; import { workbenchRoutes } from '@affine/core/mobile/workbench-router'; -import { - useLiveData, - useServices, - WorkspacesService, -} from '@toeverything/infra'; +import { WorkspacesService } from '@affine/core/modules/workspace'; +import { useLiveData, useServices } from '@toeverything/infra'; import { lazy as reactLazy, Suspense, diff --git a/packages/frontend/core/src/mobile/pages/workspace/tag/detail.tsx b/packages/frontend/core/src/mobile/pages/workspace/tag/detail.tsx index 25e7ffb79bc9d..f7a323b7dcf17 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/tag/detail.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/tag/detail.tsx @@ -1,11 +1,8 @@ import { useThemeColorV2 } from '@affine/component'; import { PageNotFound } from '@affine/core/desktop/pages/404'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import { TagService } from '@affine/core/modules/tag'; -import { - GlobalContextService, - useLiveData, - useService, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useEffect } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/packages/frontend/core/src/mobile/views/all-docs/doc/list.tsx b/packages/frontend/core/src/mobile/views/all-docs/doc/list.tsx index f8e37cdccbd7e..1dc26fd298531 100644 --- a/packages/frontend/core/src/mobile/views/all-docs/doc/list.tsx +++ b/packages/frontend/core/src/mobile/views/all-docs/doc/list.tsx @@ -6,11 +6,12 @@ import { useFilteredPageMetas, } from '@affine/core/components/page-list'; import type { Tag } from '@affine/core/modules/tag'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { Collection, Filter } from '@affine/env/filter'; import type { DocMeta } from '@blocksuite/affine/store'; import { ToggleExpandIcon } from '@blocksuite/icons/rc'; import * as Collapsible from '@radix-ui/react-collapsible'; -import { useLiveData, useService, WorkspaceService } from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { useMemo } from 'react'; import * as styles from './list.css'; diff --git a/packages/frontend/core/src/mobile/views/recent-docs/index.tsx b/packages/frontend/core/src/mobile/views/recent-docs/index.tsx index 3d4f0e60f08d4..64d56e191ef07 100644 --- a/packages/frontend/core/src/mobile/views/recent-docs/index.tsx +++ b/packages/frontend/core/src/mobile/views/recent-docs/index.tsx @@ -1,5 +1,6 @@ import { useBlockSuiteDocMeta } from '@affine/core/components/hooks/use-block-suite-page-meta'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { WorkspaceService } from '@affine/core/modules/workspace'; +import { useService } from '@toeverything/infra'; import { useMemo } from 'react'; import { DocCard } from '../../components/doc-card'; diff --git a/packages/frontend/core/src/modules/app-sidebar/impls/storage.ts b/packages/frontend/core/src/modules/app-sidebar/impls/storage.ts index 9261e692ff5f5..163b0056bb5bd 100644 --- a/packages/frontend/core/src/modules/app-sidebar/impls/storage.ts +++ b/packages/frontend/core/src/modules/app-sidebar/impls/storage.ts @@ -1,9 +1,6 @@ -import { - type GlobalState, - type Memento, - wrapMemento, -} from '@toeverything/infra'; +import { type Memento, wrapMemento } from '@toeverything/infra'; +import type { GlobalState } from '../../storage'; import type { AppSidebarState } from '../providers/storage'; export class AppSidebarStateImpl implements AppSidebarState { diff --git a/packages/frontend/core/src/modules/app-sidebar/services/app-sidebar.ts b/packages/frontend/core/src/modules/app-sidebar/services/app-sidebar.ts index dafb93a619445..cb0f400e5b998 100644 --- a/packages/frontend/core/src/modules/app-sidebar/services/app-sidebar.ts +++ b/packages/frontend/core/src/modules/app-sidebar/services/app-sidebar.ts @@ -1,5 +1,6 @@ -import { GlobalState, Service } from '@toeverything/infra'; +import { Service } from '@toeverything/infra'; +import { GlobalState } from '../../storage'; import { AppSidebar } from '../entities/app-sidebar'; export class AppSidebarService extends Service { diff --git a/packages/frontend/core/src/modules/app-sidebar/views/add-page-button/index.tsx b/packages/frontend/core/src/modules/app-sidebar/views/add-page-button/index.tsx index 725bd23a87b24..f9f21d680505d 100644 --- a/packages/frontend/core/src/modules/app-sidebar/views/add-page-button/index.tsx +++ b/packages/frontend/core/src/modules/app-sidebar/views/add-page-button/index.tsx @@ -1,10 +1,11 @@ import { IconButton } from '@affine/component'; import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { isNewTabTrigger } from '@affine/core/utils'; import { useI18n } from '@affine/i18n'; import track from '@affine/track'; import { PlusIcon } from '@blocksuite/icons/rc'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import clsx from 'clsx'; import type React from 'react'; import { type MouseEvent, useCallback } from 'react'; diff --git a/packages/frontend/core/src/modules/app-sidebar/views/index.tsx b/packages/frontend/core/src/modules/app-sidebar/views/index.tsx index fad22d1074b28..b7be519dd6cf4 100644 --- a/packages/frontend/core/src/modules/app-sidebar/views/index.tsx +++ b/packages/frontend/core/src/modules/app-sidebar/views/index.tsx @@ -8,13 +8,13 @@ import { useLiveData, useService, useServiceOptional, - WorkspaceService, } from '@toeverything/infra'; import clsx from 'clsx'; import { debounce } from 'lodash-es'; import type { PropsWithChildren, ReactElement } from 'react'; import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import { WorkspaceService } from '../../workspace'; import { AppSidebarService } from '../services/app-sidebar'; import * as styles from './fallback.css'; import { @@ -285,7 +285,7 @@ const RandomBars = ({ count, header }: { count: number; header?: boolean }) => { /> ) : null} {Array.from({ length: count }).map((_, index) => ( - // eslint-disable-next-line react/no-array-index-key + ))} diff --git a/packages/frontend/core/src/modules/at-menu-config/index.ts b/packages/frontend/core/src/modules/at-menu-config/index.ts index 32a89961b5ded..eca4fe7d3d4a2 100644 --- a/packages/frontend/core/src/modules/at-menu-config/index.ts +++ b/packages/frontend/core/src/modules/at-menu-config/index.ts @@ -1,16 +1,13 @@ -import { - DocsService, - type Framework, - WorkspaceScope, - WorkspaceService, -} from '@toeverything/infra'; +import { type Framework } from '@toeverything/infra'; import { WorkspaceDialogService } from '../dialogs'; +import { DocsService } from '../doc'; import { DocDisplayMetaService } from '../doc-display-meta'; import { DocsSearchService } from '../docs-search'; import { EditorSettingService } from '../editor-setting'; import { JournalService } from '../journal'; import { RecentDocsService } from '../quicksearch'; +import { WorkspaceScope, WorkspaceService } from '../workspace'; import { AtMenuConfigService } from './services'; export function configAtMenuConfigModule(framework: Framework) { diff --git a/packages/frontend/core/src/modules/cloud/entities/cloud-doc-meta.ts b/packages/frontend/core/src/modules/cloud/entities/cloud-doc-meta.ts index 94e30a0f82534..3be12ff3ec04e 100644 --- a/packages/frontend/core/src/modules/cloud/entities/cloud-doc-meta.ts +++ b/packages/frontend/core/src/modules/cloud/entities/cloud-doc-meta.ts @@ -1,5 +1,4 @@ import type { GetWorkspacePageMetaByIdQuery } from '@affine/graphql'; -import type { DocService, GlobalCache } from '@toeverything/infra'; import { backoffRetry, catchErrorInto, @@ -13,6 +12,8 @@ import { } from '@toeverything/infra'; import { EMPTY, mergeMap } from 'rxjs'; +import type { DocService } from '../../doc'; +import type { GlobalCache } from '../../storage'; import { isBackendError, isNetworkError } from '../error'; import type { CloudDocMetaStore } from '../stores/cloud-doc-meta'; diff --git a/packages/frontend/core/src/modules/cloud/entities/workspace-invoices.ts b/packages/frontend/core/src/modules/cloud/entities/workspace-invoices.ts index ab85f682457b4..ef2b1eaac8237 100644 --- a/packages/frontend/core/src/modules/cloud/entities/workspace-invoices.ts +++ b/packages/frontend/core/src/modules/cloud/entities/workspace-invoices.ts @@ -1,5 +1,4 @@ import type { InvoicesQuery } from '@affine/graphql'; -import type { WorkspaceService } from '@toeverything/infra'; import { backoffRetry, catchErrorInto, @@ -13,6 +12,7 @@ import { } from '@toeverything/infra'; import { EMPTY, map, mergeMap } from 'rxjs'; +import type { WorkspaceService } from '../../workspace'; import { isBackendError, isNetworkError } from '../error'; import type { WorkspaceServerService } from '../services/workspace-server'; import { InvoicesStore } from '../stores/invoices'; diff --git a/packages/frontend/core/src/modules/cloud/services/auth.ts b/packages/frontend/core/src/modules/cloud/services/auth.ts index 7013127308ae1..9812bbbacad44 100644 --- a/packages/frontend/core/src/modules/cloud/services/auth.ts +++ b/packages/frontend/core/src/modules/cloud/services/auth.ts @@ -1,9 +1,10 @@ import { AIProvider } from '@affine/core/blocksuite/presets/ai'; import type { OAuthProviderType } from '@affine/graphql'; import { track } from '@affine/track'; -import { ApplicationFocused, OnEvent, Service } from '@toeverything/infra'; +import { OnEvent, Service } from '@toeverything/infra'; import { distinctUntilChanged, map, skip } from 'rxjs'; +import { ApplicationFocused } from '../../lifecycle'; import type { UrlService } from '../../url'; import { type AuthAccountInfo, AuthSession } from '../entities/session'; import { BackendError } from '../error'; diff --git a/packages/frontend/core/src/modules/desktop-api/service/desktop-api.ts b/packages/frontend/core/src/modules/desktop-api/service/desktop-api.ts index e44a6e1ad59e6..9f2beb7783193 100644 --- a/packages/frontend/core/src/modules/desktop-api/service/desktop-api.ts +++ b/packages/frontend/core/src/modules/desktop-api/service/desktop-api.ts @@ -5,7 +5,7 @@ import { reactRouterV6BrowserTracingIntegration, setTags, } from '@sentry/react'; -import { ApplicationStarted, OnEvent, Service } from '@toeverything/infra'; +import { OnEvent, Service } from '@toeverything/infra'; import { debounce } from 'lodash-es'; import { useEffect } from 'react'; import { @@ -16,6 +16,7 @@ import { } from 'react-router-dom'; import { AuthService, DefaultServerService, ServersService } from '../../cloud'; +import { ApplicationStarted } from '../../lifecycle'; import type { DesktopApi } from '../entities/electron-api'; @OnEvent(ApplicationStarted, e => e.setupStartListener) diff --git a/packages/frontend/core/src/modules/doc-display-meta/services/doc-display-meta.ts b/packages/frontend/core/src/modules/doc-display-meta/services/doc-display-meta.ts index 351ca6ec0b1d6..257218723e484 100644 --- a/packages/frontend/core/src/modules/doc-display-meta/services/doc-display-meta.ts +++ b/packages/frontend/core/src/modules/doc-display-meta/services/doc-display-meta.ts @@ -26,7 +26,7 @@ import { LiveData, Service } from '@toeverything/infra'; import type { Dayjs } from 'dayjs'; import dayjs from 'dayjs'; -import type { DocsService } from '../../doc'; +import type { DocRecord, DocsService } from '../../doc'; import type { FeatureFlagService } from '../../feature-flag'; import type { I18nService } from '../../i18n'; import type { JournalService } from '../../journal'; diff --git a/packages/frontend/core/src/modules/doc-link/entities/doc-links.ts b/packages/frontend/core/src/modules/doc-link/entities/doc-links.ts index 0f76dbb1dbddb..e6a57db4ae505 100644 --- a/packages/frontend/core/src/modules/doc-link/entities/doc-links.ts +++ b/packages/frontend/core/src/modules/doc-link/entities/doc-links.ts @@ -1,6 +1,6 @@ -import type { DocService } from '@toeverything/infra'; import { Entity, LiveData } from '@toeverything/infra'; +import type { DocService } from '../../doc'; import type { DocsSearchService } from '../../docs-search'; export interface Link { diff --git a/packages/frontend/core/src/modules/editor-setting/impls/global-state.ts b/packages/frontend/core/src/modules/editor-setting/impls/global-state.ts index 346aca144a93b..3ffcd79afc3dc 100644 --- a/packages/frontend/core/src/modules/editor-setting/impls/global-state.ts +++ b/packages/frontend/core/src/modules/editor-setting/impls/global-state.ts @@ -1,7 +1,7 @@ -import type { GlobalState } from '@toeverything/infra'; import { Service } from '@toeverything/infra'; import { map, type Observable } from 'rxjs'; +import type { GlobalState } from '../../storage'; import type { EditorSettingProvider } from '../provider/editor-setting-provider'; const storageKey = 'editor-setting'; diff --git a/packages/frontend/core/src/modules/editor-setting/impls/user-db.ts b/packages/frontend/core/src/modules/editor-setting/impls/user-db.ts index 5d132230d73f8..15dfbe2284ba8 100644 --- a/packages/frontend/core/src/modules/editor-setting/impls/user-db.ts +++ b/packages/frontend/core/src/modules/editor-setting/impls/user-db.ts @@ -1,8 +1,8 @@ -import type { GlobalState } from '@toeverything/infra'; import { Service } from '@toeverything/infra'; import { map, type Observable, switchMap } from 'rxjs'; import type { ServersService } from '../../cloud'; +import type { GlobalState } from '../../storage'; import { UserDBService } from '../../userspace'; import type { EditorSettingProvider } from '../provider/editor-setting-provider'; diff --git a/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts b/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts index b13b42f00c1ba..93a1d339bf5c1 100644 --- a/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts +++ b/packages/frontend/core/src/modules/editor-setting/services/editor-setting.ts @@ -1,11 +1,7 @@ -import type { Workspace } from '@toeverything/infra'; -import { - DocsService, - OnEvent, - Service, - WorkspaceInitialized, -} from '@toeverything/infra'; +import { OnEvent, Service } from '@toeverything/infra'; +import { DocsService } from '../../doc'; +import { Workspace, WorkspaceInitialized } from '../../workspace'; import { EditorSetting, type EditorSettingExt, diff --git a/packages/frontend/core/src/modules/explorer/entities/explore-section.ts b/packages/frontend/core/src/modules/explorer/entities/explore-section.ts index 2c4e281c384a3..3bfba344db357 100644 --- a/packages/frontend/core/src/modules/explorer/entities/explore-section.ts +++ b/packages/frontend/core/src/modules/explorer/entities/explore-section.ts @@ -1,7 +1,7 @@ -import type { GlobalCache } from '@toeverything/infra'; import { Entity, LiveData } from '@toeverything/infra'; import { map } from 'rxjs'; +import type { GlobalCache } from '../../storage'; import type { CollapsibleSectionName } from '../types'; const DEFAULT_COLLAPSABLE_STATE: Record = { diff --git a/packages/frontend/core/src/modules/explorer/views/nodes/doc/index.tsx b/packages/frontend/core/src/modules/explorer/views/nodes/doc/index.tsx index 526f5c5dc007e..a5ee5ebf24d8d 100644 --- a/packages/frontend/core/src/modules/explorer/views/nodes/doc/index.tsx +++ b/packages/frontend/core/src/modules/explorer/views/nodes/doc/index.tsx @@ -7,15 +7,15 @@ import { } from '@affine/component'; import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; +import { DocsService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { DocsSearchService } from '@affine/core/modules/docs-search'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import { - DocsService, - FeatureFlagService, - GlobalContextService, LiveData, useLiveData, useService, diff --git a/packages/frontend/core/src/modules/explorer/views/nodes/folder/index.tsx b/packages/frontend/core/src/modules/explorer/views/nodes/folder/index.tsx index e49fb08a51f39..3d154d6acc4df 100644 --- a/packages/frontend/core/src/modules/explorer/views/nodes/folder/index.tsx +++ b/packages/frontend/core/src/modules/explorer/views/nodes/folder/index.tsx @@ -12,10 +12,12 @@ import { import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { type FolderNode, OrganizeService, } from '@affine/core/modules/organize'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { Unreachable } from '@affine/env/constant'; import { useI18n } from '@affine/i18n'; @@ -29,12 +31,7 @@ import { RemoveFolderIcon, TagsIcon, } from '@blocksuite/icons/rc'; -import { - FeatureFlagService, - useLiveData, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import { difference } from 'lodash-es'; import { useCallback, useMemo, useState } from 'react'; diff --git a/packages/frontend/core/src/modules/explorer/views/nodes/tag/index.tsx b/packages/frontend/core/src/modules/explorer/views/nodes/tag/index.tsx index 0a17b2edabb58..3487310cdca52 100644 --- a/packages/frontend/core/src/modules/explorer/views/nodes/tag/index.tsx +++ b/packages/frontend/core/src/modules/explorer/views/nodes/tag/index.tsx @@ -3,16 +3,13 @@ import { type DropTargetOptions, toast, } from '@affine/component'; +import { GlobalContextService } from '@affine/core/modules/global-context'; import type { Tag } from '@affine/core/modules/tag'; import { TagService } from '@affine/core/modules/tag'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; -import { - GlobalContextService, - useLiveData, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import clsx from 'clsx'; import { useCallback, useMemo, useState } from 'react'; diff --git a/packages/frontend/core/src/modules/explorer/views/sections/favorites/index.tsx b/packages/frontend/core/src/modules/explorer/views/sections/favorites/index.tsx index 165b273258a59..57923bdf5ddfe 100644 --- a/packages/frontend/core/src/modules/explorer/views/sections/favorites/index.tsx +++ b/packages/frontend/core/src/modules/explorer/views/sections/favorites/index.tsx @@ -13,16 +13,13 @@ import { FavoriteService, isFavoriteSupportType, } from '@affine/core/modules/favorite'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import type { AffineDNDData } from '@affine/core/types/dnd'; import { isNewTabTrigger } from '@affine/core/utils'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import { PlusIcon } from '@blocksuite/icons/rc'; -import { - useLiveData, - useServices, - WorkspaceService, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import { type MouseEventHandler, useCallback } from 'react'; import { ExplorerService } from '../../../services/explorer'; diff --git a/packages/frontend/core/src/modules/global-context/entities/global-context.ts b/packages/frontend/core/src/modules/global-context/entities/global-context.ts index 3d442d3e174af..dc3bf2b9fda8e 100644 --- a/packages/frontend/core/src/modules/global-context/entities/global-context.ts +++ b/packages/frontend/core/src/modules/global-context/entities/global-context.ts @@ -1,8 +1,6 @@ import type { DocMode } from '@blocksuite/affine/blocks'; - -import { Entity } from '@toeverything/infra'; +import { Entity, MemoryMemento } from '@toeverything/infra'; import { LiveData } from '@toeverything/infra'; -import { MemoryMemento } from '../../../storage'; export class GlobalContext extends Entity { memento = new MemoryMemento(); diff --git a/packages/frontend/core/src/modules/import-template/index.ts b/packages/frontend/core/src/modules/import-template/index.ts index a0d4c8e42d9c6..b8c86069cd96b 100644 --- a/packages/frontend/core/src/modules/import-template/index.ts +++ b/packages/frontend/core/src/modules/import-template/index.ts @@ -1,6 +1,7 @@ -import { type Framework, WorkspacesService } from '@toeverything/infra'; +import { type Framework } from '@toeverything/infra'; import { FetchService } from '../cloud'; +import { WorkspacesService } from '../workspace'; import { ImportTemplateDialog } from './entities/dialog'; import { TemplateDownloader } from './entities/downloader'; import { TemplateDownloaderService } from './services/downloader';