diff --git a/packages/frontend/core/src/components/affine/page-history-modal/data.ts b/packages/frontend/core/src/components/affine/page-history-modal/data.ts index 588b1d591acbc..73f80f5ab73eb 100644 --- a/packages/frontend/core/src/components/affine/page-history-modal/data.ts +++ b/packages/frontend/core/src/components/affine/page-history-modal/data.ts @@ -1,13 +1,14 @@ import { useDocMetaHelper } from '@affine/core/components/hooks/use-block-suite-page-meta'; import { useDocCollectionPage } from '@affine/core/components/hooks/use-block-suite-workspace-page'; import { FetchService, GraphQLService } from '@affine/core/modules/cloud'; +import { getAFFiNEWorkspaceSchema } from '@affine/core/modules/workspace'; import { DebugLogger } from '@affine/debug'; import type { ListHistoryQuery } from '@affine/graphql'; import { listHistoryQuery, recoverDocMutation } from '@affine/graphql'; import { i18nTime } from '@affine/i18n'; import { assertEquals } from '@blocksuite/affine/global/utils'; import { DocCollection } from '@blocksuite/affine/store'; -import { getAFFiNEWorkspaceSchema, useService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useEffect, useMemo } from 'react'; import useSWRImmutable from 'swr/immutable'; import { @@ -236,7 +237,7 @@ export function revertUpdate( } else if (type === 'Array') { return snapshotDoc.getArray(key); } - // eslint-disable-next-line array-callback-return + throw new Error('Unknown type'); }) ); 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 5b572868aec98..7ff2d0a9f65f9 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 @@ -71,10 +71,9 @@ export const CloudQuotaModal = () => { if (!workspaceQuota) { return; } - - currentWorkspace.engine.blob.singleBlobSizeLimit = bytes.parse( - workspaceQuota.blobLimit.toString() - )!; + + currentWorkspace.engine.blob.singleBlobSizeLimit = + bytes.parse(workspaceQuota.blobLimit.toString()) ?? 0; const disposable = currentWorkspace.engine.blob.onAbortLargeBlob.on(() => { setOpen(true); diff --git a/packages/frontend/core/src/components/affine/quota-reached-modal/local-quota-modal.tsx b/packages/frontend/core/src/components/affine/quota-reached-modal/local-quota-modal.tsx index 7f547cdc5bfa5..9703c672fc124 100644 --- a/packages/frontend/core/src/components/affine/quota-reached-modal/local-quota-modal.tsx +++ b/packages/frontend/core/src/components/affine/quota-reached-modal/local-quota-modal.tsx @@ -1,7 +1,8 @@ import { ConfirmModal } from '@affine/component/ui/modal'; import { openQuotaModalAtom } from '@affine/core/components/atoms'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import { useAtom } from 'jotai'; import { useCallback, useEffect } from 'react'; diff --git a/packages/frontend/core/src/components/affine/reference-link/index.tsx b/packages/frontend/core/src/components/affine/reference-link/index.tsx index 76f1ca891df8a..4b6a7036fd488 100644 --- a/packages/frontend/core/src/components/affine/reference-link/index.tsx +++ b/packages/frontend/core/src/components/affine/reference-link/index.tsx @@ -1,3 +1,4 @@ +import { DocsService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { JournalService } from '@affine/core/modules/journal'; import { PeekViewService } from '@affine/core/modules/peek-view/services/peek-view'; @@ -6,12 +7,7 @@ import { WorkbenchLink } from '@affine/core/modules/workbench'; import { track } from '@affine/track'; import type { DocMode } from '@blocksuite/affine/blocks'; import type { DocCollection } from '@blocksuite/affine/store'; -import { - DocsService, - LiveData, - useLiveData, - useService, -} from '@toeverything/infra'; +import { LiveData, useLiveData, useService } from '@toeverything/infra'; import clsx from 'clsx'; import { nanoid } from 'nanoid'; import { diff --git a/packages/frontend/core/src/components/affine/share-page-modal/index.tsx b/packages/frontend/core/src/components/affine/share-page-modal/index.tsx index 5e794ddb5ab75..b4d5947245424 100644 --- a/packages/frontend/core/src/components/affine/share-page-modal/index.tsx +++ b/packages/frontend/core/src/components/affine/share-page-modal/index.tsx @@ -1,7 +1,7 @@ import { useEnableCloud } from '@affine/core/components/hooks/affine/use-enable-cloud'; +import type { Workspace } from '@affine/core/modules/workspace'; import { track } from '@affine/track'; import type { Doc } from '@blocksuite/affine/store'; -import { type Workspace } from '@toeverything/infra'; import { useCallback } from 'react'; import { ShareMenu } from './share-menu'; diff --git a/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-menu.tsx b/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-menu.tsx index 71e14603b3e7c..a9e0076f49b95 100644 --- a/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-menu.tsx +++ b/packages/frontend/core/src/components/affine/share-page-modal/share-menu/share-menu.tsx @@ -2,14 +2,11 @@ import { Tabs, Tooltip } from '@affine/component'; import { Button } from '@affine/component/ui/button'; import { Menu } from '@affine/component/ui/menu'; import { ShareInfoService } from '@affine/core/modules/share-doc'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import type { Doc } from '@blocksuite/affine/store'; import { LockIcon, PublishIcon } from '@blocksuite/icons/rc'; -import { - useLiveData, - useService, - type WorkspaceMetadata, -} from '@toeverything/infra'; +import { useLiveData, useService } from '@toeverything/infra'; import { forwardRef, type PropsWithChildren, type Ref, useEffect } from 'react'; import * as styles from './index.css'; 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 c83f3a7ec1c28..b97f863733eaf 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,7 +8,11 @@ import { type useConfirmModal, } from '@affine/component'; import { WorkspaceServerService } from '@affine/core/modules/cloud'; -import { DocService, DocsService } from '@affine/core/modules/doc'; +import { + type DocRecord, + 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'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/page.ts b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/page.ts index 102daeb76b04e..aee6a9f6c1ab7 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/page.ts +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/page.ts @@ -1,13 +1,11 @@ +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import type { ExtensionType } from '@blocksuite/affine/block-std'; import { NoteBlockSpec, PageSurfaceBlockSpec, PageSurfaceRefBlockSpec, } from '@blocksuite/affine/blocks'; -import { - FeatureFlagService, - type FrameworkProvider, -} from '@toeverything/infra'; +import { type FrameworkProvider } from '@toeverything/infra'; import { AIBlockSpecs, DefaultBlockSpecs } from './common'; import { createPageRootBlockSpec } from './custom/root-block'; diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/index.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/index.tsx index 08499929993a4..7df4bef2b0f14 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/index.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-header/menu/index.tsx @@ -19,6 +19,7 @@ import { EditorService } from '@affine/core/modules/editor'; import { OpenInAppService } from '@affine/core/modules/open-in-app/services'; import { WorkbenchService } from '@affine/core/modules/workbench'; import { ViewService } from '@affine/core/modules/workbench/services/view'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import type { Doc } from '@blocksuite/affine/store'; @@ -42,7 +43,6 @@ import { useLiveData, useService, useServiceOptional, - WorkspaceService, } from '@toeverything/infra'; import { useCallback, useState } from 'react'; diff --git a/packages/frontend/core/src/components/doc-properties/icons/doc-property-icon.tsx b/packages/frontend/core/src/components/doc-properties/icons/doc-property-icon.tsx index 52625becd28d5..94ecb0e5a0ddc 100644 --- a/packages/frontend/core/src/components/doc-properties/icons/doc-property-icon.tsx +++ b/packages/frontend/core/src/components/doc-properties/icons/doc-property-icon.tsx @@ -1,5 +1,5 @@ +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; import * as icons from '@blocksuite/icons/rc'; -import type { DocCustomPropertyInfo } from '@toeverything/infra'; import type { SVGProps } from 'react'; import { diff --git a/packages/frontend/core/src/components/doc-properties/icons/icons-selector.tsx b/packages/frontend/core/src/components/doc-properties/icons/icons-selector.tsx index d8c2416b728e5..ab37ad1e8ccb3 100644 --- a/packages/frontend/core/src/components/doc-properties/icons/icons-selector.tsx +++ b/packages/frontend/core/src/components/doc-properties/icons/icons-selector.tsx @@ -1,6 +1,6 @@ import { Menu, Scrollable } from '@affine/component'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; import { useI18n } from '@affine/i18n'; -import type { DocCustomPropertyInfo } from '@toeverything/infra'; import { chunk } from 'lodash-es'; import { type DocPropertyIconName, DocPropertyIconNames } from './constant'; diff --git a/packages/frontend/core/src/components/doc-properties/types/journal.tsx b/packages/frontend/core/src/components/doc-properties/types/journal.tsx index b32cdd6e4f925..0c3dbc89c9dea 100644 --- a/packages/frontend/core/src/components/doc-properties/types/journal.tsx +++ b/packages/frontend/core/src/components/doc-properties/types/journal.tsx @@ -1,11 +1,11 @@ import { Checkbox, DatePicker, Menu, PropertyValue } from '@affine/component'; import { MobileJournalConflictList } from '@affine/core/mobile/pages/workspace/detail/menu/journal-conflicts'; +import { DocService } from '@affine/core/modules/doc'; import { JournalService } from '@affine/core/modules/journal'; import { WorkbenchService } from '@affine/core/modules/workbench'; import { ViewService } from '@affine/core/modules/workbench/services/view'; import { i18nTime, useI18n } from '@affine/i18n'; import { - DocService, useLiveData, useService, useServiceOptional, diff --git a/packages/frontend/core/src/components/doc-properties/types/types.ts b/packages/frontend/core/src/components/doc-properties/types/types.ts index aaa1fc101eb38..b53dac916e445 100644 --- a/packages/frontend/core/src/components/doc-properties/types/types.ts +++ b/packages/frontend/core/src/components/doc-properties/types/types.ts @@ -1,4 +1,4 @@ -import type { DocCustomPropertyInfo } from '@toeverything/infra'; +import type { DocCustomPropertyInfo } from '@affine/core/modules/db'; export interface PropertyValueProps { propertyInfo?: DocCustomPropertyInfo; diff --git a/packages/frontend/core/src/components/page-detail-editor.tsx b/packages/frontend/core/src/components/page-detail-editor.tsx index 892ef819ba511..66ad14a4eb5f0 100644 --- a/packages/frontend/core/src/components/page-detail-editor.tsx +++ b/packages/frontend/core/src/components/page-detail-editor.tsx @@ -17,7 +17,6 @@ import { BlockSuiteEditor as Editor } from './blocksuite/block-suite-editor'; import * as styles from './page-detail-editor.css'; declare global { - var currentEditor: AffineEditorContainer | undefined; } diff --git a/packages/frontend/core/src/components/page-list/view/collection-operations.tsx b/packages/frontend/core/src/components/page-list/view/collection-operations.tsx index 6e67b3910bd83..4ff46438816ce 100644 --- a/packages/frontend/core/src/components/page-list/view/collection-operations.tsx +++ b/packages/frontend/core/src/components/page-list/view/collection-operations.tsx @@ -3,6 +3,7 @@ import { Menu, MenuItem, usePromptModal } from '@affine/component'; import { useDeleteCollectionInfo } from '@affine/core/components/hooks/affine/use-delete-collection-info'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; import { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/favorite'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { WorkbenchService } from '@affine/core/modules/workbench'; import type { Collection } from '@affine/env/filter'; import { useI18n } from '@affine/i18n'; @@ -14,12 +15,7 @@ import { PlusIcon, SplitViewIcon, } from '@blocksuite/icons/rc'; -import { - FeatureFlagService, - useLiveData, - useService, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import type { PropsWithChildren, ReactElement } from 'react'; import { useCallback, useMemo } from 'react'; diff --git a/packages/frontend/core/src/components/pure/help-island/index.tsx b/packages/frontend/core/src/components/pure/help-island/index.tsx index f10ae72b15388..a7e8011217fb8 100644 --- a/packages/frontend/core/src/components/pure/help-island/index.tsx +++ b/packages/frontend/core/src/components/pure/help-island/index.tsx @@ -1,15 +1,11 @@ import { Tooltip } from '@affine/component/ui/tooltip'; 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 { UrlService } from '@affine/core/modules/url'; import { useI18n } from '@affine/i18n'; import { CloseIcon, NewIcon } from '@blocksuite/icons/rc'; -import { - GlobalContextService, - useLiveData, - useService, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import { useCallback, useState } from 'react'; import { ContactIcon, HelpIcon, KeyboardIcon } from './icons'; diff --git a/packages/frontend/core/src/desktop/components/app-container/index.tsx b/packages/frontend/core/src/desktop/components/app-container/index.tsx index 249958723ce18..8160793dde938 100644 --- a/packages/frontend/core/src/desktop/components/app-container/index.tsx +++ b/packages/frontend/core/src/desktop/components/app-container/index.tsx @@ -8,11 +8,11 @@ import { } from '@affine/core/modules/app-sidebar/views'; import { AppTabsHeader } from '@affine/core/modules/app-tabs-header'; import { NavigationButtons } from '@affine/core/modules/navigation'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useLiveData, useService, useServiceOptional, - WorkspaceService, } from '@toeverything/infra'; import clsx from 'clsx'; import { 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 11bb2c5f5dd06..f888cfb264a16 100644 --- a/packages/frontend/core/src/desktop/dialogs/doc-info/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/doc-info/index.tsx @@ -2,7 +2,7 @@ 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 { Doc, DocsService } from '@affine/core/modules/doc'; +import { type Doc, DocsService } from '@affine/core/modules/doc'; import { FrameworkScope, useService } from '@toeverything/infra'; import { useEffect, useState } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/editor/general.tsx b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/editor/general.tsx index abc4fcd217e99..42f40b2c44062 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/editor/general.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/editor/general.tsx @@ -24,6 +24,7 @@ import { fontStyleOptions, } from '@affine/core/modules/editor-setting'; import { SpellCheckSettingService } from '@affine/core/modules/editor-setting/services/spell-check-setting'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { type FontData, SystemFontFamilyService, @@ -31,12 +32,7 @@ import { import { Trans, useI18n } from '@affine/i18n'; import type { DocMode } from '@blocksuite/affine/blocks'; import { DoneIcon, SearchIcon } from '@blocksuite/icons/rc'; -import { - FeatureFlagService, - useLiveData, - useService, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useService, useServices } from '@toeverything/infra'; import clsx from 'clsx'; import { forwardRef, diff --git a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsx index caa311f141fc9..310ab85ba428c 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsx @@ -1,5 +1,6 @@ import { UserFeatureService } from '@affine/core/modules/cloud/services/user-feature'; import type { SettingTab } from '@affine/core/modules/dialogs/constant'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { useI18n } from '@affine/i18n'; import { AppearanceIcon, @@ -8,11 +9,7 @@ import { KeyboardIcon, PenIcon, } from '@blocksuite/icons/rc'; -import { - FeatureFlagService, - useLiveData, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import type { ReactElement, SVGProps } from 'react'; import { useEffect } from 'react'; 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 9137283f8b776..c66430c97689e 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 @@ -4,10 +4,10 @@ import { } from '@affine/component/setting-components'; import { Avatar } from '@affine/component/ui/avatar'; import { Tooltip } from '@affine/component/ui/tooltip'; -import { WorkspaceAvatar } from '@affine/component/workspace-avatar'; import { UserPlanButton } from '@affine/core/components/affine/auth/user-plan-button'; import { useCatchEventCallback } from '@affine/core/components/hooks/use-catch-event-hook'; import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info'; +import { WorkspaceAvatar } from '@affine/core/components/workspace-avatar'; import { AuthService } from '@affine/core/modules/cloud'; import { UserFeatureService } from '@affine/core/modules/cloud/services/user-feature'; import { GlobalDialogService } from '@affine/core/modules/dialogs'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/types.ts b/packages/frontend/core/src/desktop/dialogs/setting/types.ts index 58a0a45415322..8d4e56076d77b 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/types.ts +++ b/packages/frontend/core/src/desktop/dialogs/setting/types.ts @@ -1,5 +1,5 @@ import type { SettingTab } from '@affine/core/modules/dialogs/constant'; -import type { WorkspaceMetadata } from '@toeverything/infra'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; export interface SettingState { activeTab: SettingTab; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/index.tsx index 79f5334d3eec6..1b89588a27ec8 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/index.tsx @@ -1,5 +1,5 @@ import type { SettingTab } from '@affine/core/modules/dialogs/constant'; -import type { WorkspaceMetadata } from '@toeverything/infra'; +import type { WorkspaceMetadata } from '@affine/core/modules/workspace'; import type { SettingState } from '../types'; import { WorkspaceSettingBilling } from './billing'; 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 fa329a1be823b..658ce5d6f9a4c 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,7 +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 { + type Workspace, + WorkspaceService, +} from '@affine/core/modules/workspace'; import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant'; import { useI18n } from '@affine/i18n'; import { useLiveData, useService } from '@toeverything/infra'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/labels.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/labels.tsx index 27c3517f5fd00..2eae0d924b0b5 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/labels.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/labels.tsx @@ -1,6 +1,7 @@ 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 { cssVarV2 } from '@toeverything/theme/v2'; import { useEffect, useMemo } from 'react'; diff --git a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/index.tsx index d41b06bf93710..f80f51366977a 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/new-workspace-setting-detail/members/index.tsx @@ -2,8 +2,9 @@ import { Button, Tooltip } from '@affine/component'; import { SettingRow } from '@affine/component/setting-components'; import { AffineErrorBoundary } from '@affine/core/components/affine/affine-error-boundary'; import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { useI18n } from '@affine/i18n'; -import { useService, WorkspaceService } from '@toeverything/infra'; +import { useService } from '@toeverything/infra'; import type { ReactElement } from 'react'; import type { SettingState } from '../../../types'; 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 71077b6d039fc..70268c9618cee 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 @@ -1,8 +1,8 @@ import { FlexWrapper, Input, notify, Wrapper } from '@affine/component'; import { Button } from '@affine/component/ui/button'; -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 { WorkspaceAvatar } from '@affine/core/components/workspace-avatar'; import { WorkspacePermissionService } from '@affine/core/modules/permissions'; import { WorkspaceService } from '@affine/core/modules/workspace'; import { validateAndReduceImage } from '@affine/core/utils/reduce-image'; diff --git a/packages/frontend/core/src/desktop/pages/root/custom-theme/index.tsx b/packages/frontend/core/src/desktop/pages/root/custom-theme/index.tsx index 9451ae7ff9a62..f3922872b66bd 100644 --- a/packages/frontend/core/src/desktop/pages/root/custom-theme/index.tsx +++ b/packages/frontend/core/src/desktop/pages/root/custom-theme/index.tsx @@ -1,9 +1,6 @@ +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; import { ThemeEditorService } from '@affine/core/modules/theme-editor'; -import { - FeatureFlagService, - useLiveData, - useServices, -} from '@toeverything/infra'; +import { useLiveData, useServices } from '@toeverything/infra'; import { useTheme } from 'next-themes'; import { useEffect } from 'react'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page-header.tsx b/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page-header.tsx index 8896f1ec401f0..9bccaad0f1762 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page-header.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/all-page/all-page-header.tsx @@ -8,11 +8,12 @@ import { Header } from '@affine/core/components/pure/header'; import { WorkspaceModeFilterTab } from '@affine/core/components/pure/workspace-mode-filter-tab'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; import { WorkbenchService } from '@affine/core/modules/workbench'; +import { WorkspaceService } from '@affine/core/modules/workspace'; import { isNewTabTrigger } from '@affine/core/utils'; import type { Filter } from '@affine/env/filter'; import { track } from '@affine/track'; import { PlusIcon } from '@blocksuite/icons/rc'; -import { useServices, WorkspaceService } from '@toeverything/infra'; +import { useServices } from '@toeverything/infra'; import clsx from 'clsx'; import { useCallback } from 'react'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/attachment/index.tsx b/packages/frontend/core/src/desktop/pages/workspace/attachment/index.tsx index 12c96448caddf..da04ac40ae86c 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/attachment/index.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/attachment/index.tsx @@ -1,5 +1,5 @@ import { Skeleton } from '@affine/component'; -import { Doc, DocsService } from '@affine/core/modules/doc'; +import { type Doc, DocsService } from '@affine/core/modules/doc'; import { type AttachmentBlockModel } from '@blocksuite/affine/blocks'; import { FrameworkScope, useLiveData, useService } from '@toeverything/infra'; import { type ReactElement, useLayoutEffect, useState } from 'react'; 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 880f6cae4d398..2468461c0122a 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,4 +1,4 @@ -import { Doc, DocsService } from '@affine/core/modules/doc'; +import { type 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'; 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 f1059cbfb727b..a278efca06a95 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,7 +10,11 @@ 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 { + 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'; diff --git a/packages/frontend/core/src/desktop/pages/workspace/index.tsx b/packages/frontend/core/src/desktop/pages/workspace/index.tsx index a8d22ce810fd7..7b7fde0fe33d3 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/index.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/index.tsx @@ -34,9 +34,9 @@ declare global { /** * @internal debug only */ - + var currentWorkspace: Workspace | undefined; - + var exportWorkspaceSnapshot: (docs?: string[]) => Promise; var importWorkspaceSnapshot: () => Promise; 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 f29ac8639314e..c53adc0873b68 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 @@ -20,7 +20,10 @@ 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 { + type Workspace, + WorkspacesService, +} from '@affine/core/modules/workspace'; import { CloudBlobStorage } from '@affine/core/modules/workspace-engine'; import { useI18n } from '@affine/i18n'; import { diff --git a/packages/frontend/core/src/mobile/components/explorer/nodes/collection/operations.tsx b/packages/frontend/core/src/mobile/components/explorer/nodes/collection/operations.tsx index 122c005579b96..468b0475b8d1f 100644 --- a/packages/frontend/core/src/mobile/components/explorer/nodes/collection/operations.tsx +++ b/packages/frontend/core/src/mobile/components/explorer/nodes/collection/operations.tsx @@ -11,7 +11,9 @@ import { IsFavoriteIcon } from '@affine/core/components/pure/icons'; import { CollectionService } from '@affine/core/modules/collection'; 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 { useI18n } from '@affine/i18n'; import { track } from '@affine/track'; import { @@ -25,8 +27,6 @@ import { useLiveData, useServices } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import { CollectionRenameSubMenu } from './dialog'; -import { WorkspaceService } from '@affine/core/modules/workspace'; -import { FeatureFlagService } from '@affine/core/modules/feature-flag'; export const useExplorerCollectionNodeOperations = ( collectionId: string, diff --git a/packages/frontend/core/src/mobile/components/explorer/nodes/folder/index.tsx b/packages/frontend/core/src/mobile/components/explorer/nodes/folder/index.tsx index 9fe9d48034bae..2e8a6b1aceb35 100644 --- a/packages/frontend/core/src/mobile/components/explorer/nodes/folder/index.tsx +++ b/packages/frontend/core/src/mobile/components/explorer/nodes/folder/index.tsx @@ -13,10 +13,12 @@ import type { NodeOperation, } from '@affine/core/modules/explorer'; 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 { useI18n } from '@affine/i18n'; import track from '@affine/track'; import { @@ -40,8 +42,6 @@ import { ExplorerDocNode } from '../doc'; import { ExplorerTagNode } from '../tag'; import { FolderCreateTip, FolderRenameSubMenu } from './dialog'; import { FavoriteFolderOperation } from './operations'; -import { WorkspaceService } from '@affine/core/modules/workspace'; -import { FeatureFlagService } from '@affine/core/modules/feature-flag'; export const ExplorerFolderNode = ({ nodeId, diff --git a/packages/frontend/core/src/mobile/components/explorer/nodes/tag/operations.tsx b/packages/frontend/core/src/mobile/components/explorer/nodes/tag/operations.tsx index 65010bc2a5aab..cc53c9d5353a6 100644 --- a/packages/frontend/core/src/mobile/components/explorer/nodes/tag/operations.tsx +++ b/packages/frontend/core/src/mobile/components/explorer/nodes/tag/operations.tsx @@ -8,10 +8,14 @@ import { import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils'; import { IsFavoriteIcon } from '@affine/core/components/pure/icons'; import { WorkspaceDialogService } from '@affine/core/modules/dialogs'; +import { DocsService } from '@affine/core/modules/doc'; import type { NodeOperation } from '@affine/core/modules/explorer'; import { FavoriteService } from '@affine/core/modules/favorite'; +import { FeatureFlagService } from '@affine/core/modules/feature-flag'; +import { GlobalCacheService } from '@affine/core/modules/storage'; import { TagService } from '@affine/core/modules/tag'; 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 { @@ -24,10 +28,6 @@ import { useLiveData, useService, useServices } from '@toeverything/infra'; import { useCallback, useMemo } from 'react'; import { TagRenameSubMenu } from './dialog'; -import { WorkspaceService } from '@affine/core/modules/workspace'; -import { DocsService } from '@affine/core/modules/doc'; -import { GlobalCacheService } from '@affine/core/modules/storage'; -import { FeatureFlagService } from '@affine/core/modules/feature-flag'; export const useExplorerTagNodeOperations = ( tagId: string, diff --git a/packages/frontend/core/src/mobile/dialogs/selectors/doc-selector.tsx b/packages/frontend/core/src/mobile/dialogs/selectors/doc-selector.tsx index f3460833eaab3..66996fd9754f8 100644 --- a/packages/frontend/core/src/mobile/dialogs/selectors/doc-selector.tsx +++ b/packages/frontend/core/src/mobile/dialogs/selectors/doc-selector.tsx @@ -3,6 +3,7 @@ import type { DialogComponentProps, WORKSPACE_DIALOG_SCHEMA, } from '@affine/core/modules/dialogs'; +import { DocsService } from '@affine/core/modules/doc'; import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta'; import { useI18n } from '@affine/i18n'; import { useLiveData, useService } from '@toeverything/infra'; @@ -10,7 +11,6 @@ import { cssVarV2 } from '@toeverything/theme/v2'; import { useMemo } from 'react'; import { GenericSelector } from './generic-selector'; -import { DocsService } from '@affine/core/modules/doc'; const DocIcon = ({ docId }: { docId: string }) => { const docDisplayMetaService = useService(DocDisplayMetaService); 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 631ae27972193..bac0632bc9b50 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,5 +1,5 @@ import { IconButton, Menu } from '@affine/component'; -import { DocRecord, DocsService } from '@affine/core/modules/doc'; +import { type 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'; diff --git a/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-conflicts.tsx b/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-conflicts.tsx index d9176dae5ecda..ec4d8b134aac8 100644 --- a/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-conflicts.tsx +++ b/packages/frontend/core/src/mobile/pages/workspace/detail/menu/journal-conflicts.tsx @@ -6,6 +6,11 @@ import { useConfirmModal, } from '@affine/component'; import { MoveToTrash } from '@affine/core/components/page-list'; +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'; @@ -15,11 +20,6 @@ import { useLiveData, useService } from '@toeverything/infra'; import { type MouseEvent, useCallback, useMemo } from 'react'; import * as styles from './journal-conflicts.css'; -import { - DocService, - DocsService, - type DocRecord, -} from '@affine/core/modules/doc'; export const ResolveConflictOperations = ({ docRecord, 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 b7be519dd6cf4..8747f457471d4 100644 --- a/packages/frontend/core/src/modules/app-sidebar/views/index.tsx +++ b/packages/frontend/core/src/modules/app-sidebar/views/index.tsx @@ -285,7 +285,6 @@ const RandomBars = ({ count, header }: { count: number; header?: boolean }) => { /> ) : null} {Array.from({ length: count }).map((_, index) => ( - ))} diff --git a/packages/frontend/core/src/modules/at-menu-config/services/index.ts b/packages/frontend/core/src/modules/at-menu-config/services/index.ts index 1daae73d27a4a..13456b5dfaa4d 100644 --- a/packages/frontend/core/src/modules/at-menu-config/services/index.ts +++ b/packages/frontend/core/src/modules/at-menu-config/services/index.ts @@ -24,12 +24,12 @@ import { html } from 'lit'; import { unsafeHTML } from 'lit/directives/unsafe-html.js'; import type { WorkspaceDialogService } from '../../dialogs'; +import type { DocsService } from '../../doc'; import type { DocDisplayMetaService } from '../../doc-display-meta'; import type { DocsSearchService } from '../../docs-search'; import type { EditorSettingService } from '../../editor-setting'; import { type JournalService, suggestJournalDate } from '../../journal'; import type { RecentDocsService } from '../../quicksearch'; -import type { DocsService } from '../../doc'; import type { WorkspaceService } from '../../workspace'; const MAX_DOCS = 3; diff --git a/packages/frontend/core/src/modules/cloud/entities/workspace-subscription.ts b/packages/frontend/core/src/modules/cloud/entities/workspace-subscription.ts index 7a7648cd35227..a97640b98b5e8 100644 --- a/packages/frontend/core/src/modules/cloud/entities/workspace-subscription.ts +++ b/packages/frontend/core/src/modules/cloud/entities/workspace-subscription.ts @@ -13,7 +13,7 @@ import { } from '@toeverything/infra'; import { EMPTY, mergeMap } from 'rxjs'; -import { WorkspaceService } from '../../workspace'; +import type { WorkspaceService } from '../../workspace'; import { isBackendError, isNetworkError } from '../error'; import type { WorkspaceServerService } from '../services/workspace-server'; import { SubscriptionStore } from '../stores/subscription'; diff --git a/packages/frontend/core/src/modules/cloud/services/websocket.ts b/packages/frontend/core/src/modules/cloud/services/websocket.ts index d0e7a8c0e5908..22db7ea20a1cf 100644 --- a/packages/frontend/core/src/modules/cloud/services/websocket.ts +++ b/packages/frontend/core/src/modules/cloud/services/websocket.ts @@ -1,11 +1,11 @@ import { OnEvent, Service } from '@toeverything/infra'; import { Manager } from 'socket.io-client'; +import { ApplicationStarted } from '../../lifecycle'; import { AccountChanged } from '../events/account-changed'; import type { WebSocketAuthProvider } from '../provider/websocket-auth'; import type { AuthService } from './auth'; import type { ServerService } from './server'; -import { ApplicationStarted } from '../../lifecycle'; @OnEvent(AccountChanged, e => e.update) @OnEvent(ApplicationStarted, e => e.update) diff --git a/packages/frontend/core/src/modules/cloud/stores/auth.ts b/packages/frontend/core/src/modules/cloud/stores/auth.ts index c1a2c78603e58..b909e3885c0fe 100644 --- a/packages/frontend/core/src/modules/cloud/stores/auth.ts +++ b/packages/frontend/core/src/modules/cloud/stores/auth.ts @@ -5,8 +5,7 @@ import { } from '@affine/graphql'; import { Store } from '@toeverything/infra'; -import { GlobalState } from '../../storage'; - +import type { GlobalState } from '../../storage'; import type { AuthSessionInfo } from '../entities/session'; import type { FetchService } from '../services/fetch'; import type { GraphQLService } from '../services/graphql'; diff --git a/packages/frontend/core/src/modules/cloud/stores/server-list.ts b/packages/frontend/core/src/modules/cloud/stores/server-list.ts index 0d5624a640712..cc393cc75828a 100644 --- a/packages/frontend/core/src/modules/cloud/stores/server-list.ts +++ b/packages/frontend/core/src/modules/cloud/stores/server-list.ts @@ -2,7 +2,6 @@ import { Store } from '@toeverything/infra'; import { map } from 'rxjs'; import { GlobalStateService } from '../../storage'; - import { BUILD_IN_SERVERS } from '../constant'; import type { ServerConfig, ServerMetadata } from '../types'; diff --git a/packages/frontend/core/src/modules/cloud/stores/subscription.ts b/packages/frontend/core/src/modules/cloud/stores/subscription.ts index edf8398ee2eb8..c2d5a1d844eb0 100644 --- a/packages/frontend/core/src/modules/cloud/stores/subscription.ts +++ b/packages/frontend/core/src/modules/cloud/stores/subscription.ts @@ -14,7 +14,7 @@ import { } from '@affine/graphql'; import { Store } from '@toeverything/infra'; -import { GlobalCache } from '../../storage'; +import type { GlobalCache } from '../../storage'; import type { UrlService } from '../../url'; import type { SubscriptionType } from '../entities/subscription'; import type { GraphQLService } from '../services/graphql'; diff --git a/packages/frontend/core/src/modules/db/index.ts b/packages/frontend/core/src/modules/db/index.ts index 99aa42a0f25be..7b62456b3b046 100644 --- a/packages/frontend/core/src/modules/db/index.ts +++ b/packages/frontend/core/src/modules/db/index.ts @@ -1,4 +1,5 @@ import type { Framework } from '@toeverything/infra'; + import { WorkspaceScope, WorkspaceService } from '../workspace'; import { WorkspaceDB } from './entities/db'; import { WorkspaceDBTable } from './entities/table'; diff --git a/packages/frontend/core/src/modules/doc-info/index.ts b/packages/frontend/core/src/modules/doc-info/index.ts index 9674b1e7fe70c..b57fe794746d5 100644 --- a/packages/frontend/core/src/modules/doc-info/index.ts +++ b/packages/frontend/core/src/modules/doc-info/index.ts @@ -1,9 +1,9 @@ import { type Framework } from '@toeverything/infra'; -import { DocsSearchService } from '../docs-search'; -import { DocDatabaseBacklinksService } from './services/doc-database-backlinks'; import { DocsService } from '../doc/services/docs'; +import { DocsSearchService } from '../docs-search'; import { WorkspaceScope } from '../workspace'; +import { DocDatabaseBacklinksService } from './services/doc-database-backlinks'; export { DocDatabaseBacklinkInfo } from './views/database-properties/doc-database-backlink-info'; diff --git a/packages/frontend/core/src/modules/doc-info/views/database-properties/doc-database-backlink-info.tsx b/packages/frontend/core/src/modules/doc-info/views/database-properties/doc-database-backlink-info.tsx index fb5ed66634058..8d2616cb320fa 100644 --- a/packages/frontend/core/src/modules/doc-info/views/database-properties/doc-database-backlink-info.tsx +++ b/packages/frontend/core/src/modules/doc-info/views/database-properties/doc-database-backlink-info.tsx @@ -5,6 +5,7 @@ import { PropertyName, } from '@affine/component'; import { AffinePageReference } from '@affine/core/components/affine/reference-link'; +import { DocService } from '@affine/core/modules/doc'; import { useI18n } from '@affine/i18n'; import type { DatabaseBlockDataSource } from '@blocksuite/affine/blocks'; import { DatabaseTableViewIcon, PageIcon } from '@blocksuite/icons/rc'; @@ -16,7 +17,6 @@ import { DocDatabaseBacklinksService } from '../../services/doc-database-backlin import type { DatabaseRow, DatabaseValueCell } from '../../types'; import { DatabaseRendererTypes } from './constant'; import * as styles from './doc-database-backlink-info.css'; -import { DocService } from '@affine/core/modules/doc'; type CellConfig = (typeof DatabaseRendererTypes)[keyof typeof DatabaseRendererTypes]; diff --git a/packages/frontend/core/src/modules/doc-link/index.ts b/packages/frontend/core/src/modules/doc-link/index.ts index dce88e4a10f8d..c29edc022c5be 100644 --- a/packages/frontend/core/src/modules/doc-link/index.ts +++ b/packages/frontend/core/src/modules/doc-link/index.ts @@ -1,12 +1,12 @@ import { type Framework } from '@toeverything/infra'; +import { DocScope } from '../doc/scopes/doc'; +import { DocService } from '../doc/services/doc'; import { DocsSearchService } from '../docs-search'; +import { WorkspaceScope } from '../workspace'; import { DocBacklinks } from './entities/doc-backlinks'; import { DocLinks } from './entities/doc-links'; import { DocLinksService } from './services/doc-links'; -import { DocScope } from '../doc/scopes/doc'; -import { DocService } from '../doc/services/doc'; -import { WorkspaceScope } from '../workspace'; export type { Backlink } from './entities/doc-backlinks'; export type { Link } from './entities/doc-links'; diff --git a/packages/frontend/core/src/modules/doc/entities/doc.ts b/packages/frontend/core/src/modules/doc/entities/doc.ts index b5840568f0a07..8c2e50a08c327 100644 --- a/packages/frontend/core/src/modules/doc/entities/doc.ts +++ b/packages/frontend/core/src/modules/doc/entities/doc.ts @@ -1,6 +1,6 @@ import type { DocMode, RootBlockModel } from '@blocksuite/affine/blocks'; - import { Entity } from '@toeverything/infra'; + import type { WorkspaceService } from '../../workspace'; import type { DocScope } from '../scopes/doc'; import type { DocsStore } from '../stores/docs'; diff --git a/packages/frontend/core/src/modules/doc/entities/property-list.ts b/packages/frontend/core/src/modules/doc/entities/property-list.ts index 5fdb8bdcc8e52..5b68c7872430a 100644 --- a/packages/frontend/core/src/modules/doc/entities/property-list.ts +++ b/packages/frontend/core/src/modules/doc/entities/property-list.ts @@ -3,6 +3,7 @@ import { generateFractionalIndexingKeyBetween, } from '@toeverything/infra'; import { LiveData } from '@toeverything/infra'; + import type { DocCustomPropertyInfo } from '../../db/schema/schema'; import type { DocPropertiesStore } from '../stores/doc-properties'; diff --git a/packages/frontend/core/src/modules/doc/entities/record-list.ts b/packages/frontend/core/src/modules/doc/entities/record-list.ts index 8640520069d78..1ca50c97a3083 100644 --- a/packages/frontend/core/src/modules/doc/entities/record-list.ts +++ b/packages/frontend/core/src/modules/doc/entities/record-list.ts @@ -1,8 +1,8 @@ import type { DocMode } from '@blocksuite/affine/blocks'; -import { map } from 'rxjs'; - import { Entity } from '@toeverything/infra'; import { LiveData } from '@toeverything/infra'; +import { map } from 'rxjs'; + import type { DocsStore } from '../stores/docs'; import { DocRecord } from './record'; diff --git a/packages/frontend/core/src/modules/doc/entities/record.ts b/packages/frontend/core/src/modules/doc/entities/record.ts index 40ebdca4f16ae..1491068959821 100644 --- a/packages/frontend/core/src/modules/doc/entities/record.ts +++ b/packages/frontend/core/src/modules/doc/entities/record.ts @@ -1,8 +1,8 @@ import type { DocMode } from '@blocksuite/affine/blocks'; import type { DocMeta } from '@blocksuite/affine/store'; - import { Entity } from '@toeverything/infra'; import { LiveData } from '@toeverything/infra'; + import type { DocProperties } from '../../db'; import type { DocPropertiesStore } from '../stores/doc-properties'; import type { DocsStore } from '../stores/docs'; diff --git a/packages/frontend/core/src/modules/doc/events/index.ts b/packages/frontend/core/src/modules/doc/events/index.ts index 2d1af12ae6b49..b6475175956b0 100644 --- a/packages/frontend/core/src/modules/doc/events/index.ts +++ b/packages/frontend/core/src/modules/doc/events/index.ts @@ -1,4 +1,5 @@ import { createEvent } from '@toeverything/infra'; + import type { DocRecord } from '../entities/record'; export const DocCreated = createEvent('DocCreated'); diff --git a/packages/frontend/core/src/modules/doc/scopes/doc.ts b/packages/frontend/core/src/modules/doc/scopes/doc.ts index 8081e32b39304..ba8db10caf317 100644 --- a/packages/frontend/core/src/modules/doc/scopes/doc.ts +++ b/packages/frontend/core/src/modules/doc/scopes/doc.ts @@ -1,6 +1,6 @@ import type { Doc as BlockSuiteDoc } from '@blocksuite/affine/store'; - import { Scope } from '@toeverything/infra'; + import type { DocRecord } from '../entities/record'; export class DocScope extends Scope<{ diff --git a/packages/frontend/core/src/modules/doc/services/doc.ts b/packages/frontend/core/src/modules/doc/services/doc.ts index f8390d2724c42..abdd10bc1c93c 100644 --- a/packages/frontend/core/src/modules/doc/services/doc.ts +++ b/packages/frontend/core/src/modules/doc/services/doc.ts @@ -1,4 +1,5 @@ import { Service } from '@toeverything/infra'; + import { Doc } from '../entities/doc'; export class DocService extends Service { diff --git a/packages/frontend/core/src/modules/doc/services/docs.ts b/packages/frontend/core/src/modules/doc/services/docs.ts index d7a64ac094c2f..37fbfd3a80e7d 100644 --- a/packages/frontend/core/src/modules/doc/services/docs.ts +++ b/packages/frontend/core/src/modules/doc/services/docs.ts @@ -4,10 +4,10 @@ import type { DocMode } from '@blocksuite/affine/blocks'; import type { DeltaInsert } from '@blocksuite/affine/inline'; import type { AffineTextAttributes } from '@blocksuite/affine-shared/types'; import { + type DocProps, initDocFromProps, ObjectPool, Service, - type DocProps, } from '@toeverything/infra'; import type { Doc } from '../entities/doc'; diff --git a/packages/frontend/core/src/modules/docs-search/index.ts b/packages/frontend/core/src/modules/docs-search/index.ts index 2a37c909cff35..1f9db66e185e9 100644 --- a/packages/frontend/core/src/modules/docs-search/index.ts +++ b/packages/frontend/core/src/modules/docs-search/index.ts @@ -2,13 +2,13 @@ export { DocsSearchService } from './services/docs-search'; import { type Framework } from '@toeverything/infra'; -import { DocsIndexer } from './entities/docs-indexer'; -import { DocsSearchService } from './services/docs-search'; import { + WorkspaceLocalState, WorkspaceScope, WorkspaceService, - WorkspaceLocalState, } from '../workspace'; +import { DocsIndexer } from './entities/docs-indexer'; +import { DocsSearchService } from './services/docs-search'; export function configureDocsSearchModule(framework: Framework) { framework diff --git a/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts b/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts index 2b5b252651047..b52efb2b7b7e1 100644 --- a/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts +++ b/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts @@ -27,6 +27,7 @@ import { Text as YText, } from 'yjs'; +import { getAFFiNEWorkspaceSchema } from '../../workspace'; import type { BlockIndexSchema, DocIndexSchema } from '../schema'; import type { WorkerIngoingMessage, @@ -34,7 +35,6 @@ import type { WorkerOutgoingMessage, WorkerOutput, } from './types'; -import { getAFFiNEWorkspaceSchema } from '../../workspace'; const blocksuiteSchema = getAFFiNEWorkspaceSchema(); diff --git a/packages/frontend/core/src/modules/editor-setting/__test__/editor-setting.spec.ts b/packages/frontend/core/src/modules/editor-setting/__test__/editor-setting.spec.ts index 812d16e56d375..81c432c9e1336 100644 --- a/packages/frontend/core/src/modules/editor-setting/__test__/editor-setting.spec.ts +++ b/packages/frontend/core/src/modules/editor-setting/__test__/editor-setting.spec.ts @@ -1,11 +1,11 @@ import { Framework, MemoryMemento } from '@toeverything/infra'; import { expect, test } from 'vitest'; +import { GlobalState } from '../../storage'; import { EditorSetting } from '../entities/editor-setting'; import { GlobalStateEditorSettingProvider } from '../impls/global-state'; import { EditorSettingProvider } from '../provider/editor-setting-provider'; import { EditorSettingService } from '../services/editor-setting'; -import { GlobalState } from '../../storage'; test('editor setting service', () => { const framework = new Framework(); diff --git a/packages/frontend/core/src/modules/explorer/index.ts b/packages/frontend/core/src/modules/explorer/index.ts index 55f44eba15407..3d1e72a8c0196 100644 --- a/packages/frontend/core/src/modules/explorer/index.ts +++ b/packages/frontend/core/src/modules/explorer/index.ts @@ -1,9 +1,9 @@ import { type Framework } from '@toeverything/infra'; -import { ExplorerSection } from './entities/explore-section'; -import { ExplorerService } from './services/explorer'; import { GlobalCache } from '../storage'; import { WorkspaceScope } from '../workspace'; +import { ExplorerSection } from './entities/explore-section'; +import { ExplorerService } from './services/explorer'; export { ExplorerService } from './services/explorer'; export type { CollapsibleSectionName } from './types'; export { CollapsibleSection } from './views/layouts/collapsible-section'; diff --git a/packages/frontend/core/src/modules/favorite/services/old/adapter.ts b/packages/frontend/core/src/modules/favorite/services/old/adapter.ts index e028c5c80cdaa..fd3881cf9d38f 100644 --- a/packages/frontend/core/src/modules/favorite/services/old/adapter.ts +++ b/packages/frontend/core/src/modules/favorite/services/old/adapter.ts @@ -1,5 +1,5 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ // the adapter is to bridge the workspace rootdoc & native js bindings +import type { WorkspaceService } from '@affine/core/modules/workspace'; import { createYProxy, type Y } from '@blocksuite/affine/store'; import { LiveData, Service } from '@toeverything/infra'; import { defaultsDeep } from 'lodash-es'; @@ -12,7 +12,6 @@ import { PageSystemPropertyId, type WorkspaceAffineProperties, } from './schema'; -import type { WorkspaceService } from '@affine/core/modules/workspace'; const AFFINE_PROPERTIES_ID = 'affine:workspace-properties'; diff --git a/packages/frontend/core/src/modules/feature-flag/entities/flags.ts b/packages/frontend/core/src/modules/feature-flag/entities/flags.ts index 986a4e9f20e6d..99ea12f220bfa 100644 --- a/packages/frontend/core/src/modules/feature-flag/entities/flags.ts +++ b/packages/frontend/core/src/modules/feature-flag/entities/flags.ts @@ -1,7 +1,7 @@ -import { NEVER } from 'rxjs'; - import { Entity } from '@toeverything/infra'; import { LiveData } from '@toeverything/infra'; +import { NEVER } from 'rxjs'; + import type { GlobalStateService } from '../../storage'; import { AFFINE_FLAGS } from '../constant'; import type { FlagInfo } from '../types'; diff --git a/packages/frontend/core/src/modules/feature-flag/index.ts b/packages/frontend/core/src/modules/feature-flag/index.ts index cb2f4d8ee98d9..39390ccea3c2b 100644 --- a/packages/frontend/core/src/modules/feature-flag/index.ts +++ b/packages/frontend/core/src/modules/feature-flag/index.ts @@ -1,4 +1,5 @@ import type { Framework } from '@toeverything/infra'; + import { GlobalStateService } from '../storage'; import { Flags } from './entities/flags'; import { FeatureFlagService } from './services/feature-flag'; diff --git a/packages/frontend/core/src/modules/feature-flag/services/feature-flag.ts b/packages/frontend/core/src/modules/feature-flag/services/feature-flag.ts index d8e6d287dc14f..cc0ee7a127d9f 100644 --- a/packages/frontend/core/src/modules/feature-flag/services/feature-flag.ts +++ b/packages/frontend/core/src/modules/feature-flag/services/feature-flag.ts @@ -1,6 +1,6 @@ +import { OnEvent, Service } from '@toeverything/infra'; import { distinctUntilChanged, skip } from 'rxjs'; -import { OnEvent, Service } from '@toeverything/infra'; import { ApplicationStarted } from '../../lifecycle'; import type { Workspace } from '../../workspace'; import { WorkspaceInitialized } from '../../workspace/events'; diff --git a/packages/frontend/core/src/modules/global-context/index.ts b/packages/frontend/core/src/modules/global-context/index.ts index 1356cf04d086d..481238ed39bfe 100644 --- a/packages/frontend/core/src/modules/global-context/index.ts +++ b/packages/frontend/core/src/modules/global-context/index.ts @@ -1,6 +1,7 @@ export { GlobalContextService } from './services/global-context'; import type { Framework } from '@toeverything/infra'; + import { GlobalContext } from './entities/global-context'; import { GlobalContextService } from './services/global-context'; diff --git a/packages/frontend/core/src/modules/global-context/services/global-context.ts b/packages/frontend/core/src/modules/global-context/services/global-context.ts index eb0a7a9498ae7..028272c2627a9 100644 --- a/packages/frontend/core/src/modules/global-context/services/global-context.ts +++ b/packages/frontend/core/src/modules/global-context/services/global-context.ts @@ -1,4 +1,5 @@ import { Service } from '@toeverything/infra'; + import { GlobalContext } from '../entities/global-context'; export class GlobalContextService extends Service { diff --git a/packages/frontend/core/src/modules/i18n/index.ts b/packages/frontend/core/src/modules/i18n/index.ts index 0b603b8b328ff..0d78e556b868d 100644 --- a/packages/frontend/core/src/modules/i18n/index.ts +++ b/packages/frontend/core/src/modules/i18n/index.ts @@ -1,9 +1,9 @@ import { type Framework } from '@toeverything/infra'; +import { GlobalCache } from '../storage'; import { I18nProvider } from './context'; import { I18n, type LanguageInfo } from './entities/i18n'; import { I18nService } from './services/i18n'; -import { GlobalCache } from '../storage'; export function configureI18nModule(framework: Framework) { framework.service(I18nService).entity(I18n, [GlobalCache]); diff --git a/packages/frontend/core/src/modules/journal/index.ts b/packages/frontend/core/src/modules/journal/index.ts index 86318dc36ff28..3f581038b80bc 100644 --- a/packages/frontend/core/src/modules/journal/index.ts +++ b/packages/frontend/core/src/modules/journal/index.ts @@ -1,11 +1,11 @@ import { type Framework } from '@toeverything/infra'; +import { DocScope, DocService, DocsService } from '../doc'; import { EditorSettingService } from '../editor-setting'; +import { WorkspaceScope } from '../workspace'; import { JournalService } from './services/journal'; import { JournalDocService } from './services/journal-doc'; import { JournalStore } from './store/journal'; -import { DocsService, DocScope, DocService } from '../doc'; -import { WorkspaceScope } from '../workspace'; export { JOURNAL_DATE_FORMAT, diff --git a/packages/frontend/core/src/modules/journal/services/journal.ts b/packages/frontend/core/src/modules/journal/services/journal.ts index 1b888d08fec5a..6796d668461a6 100644 --- a/packages/frontend/core/src/modules/journal/services/journal.ts +++ b/packages/frontend/core/src/modules/journal/services/journal.ts @@ -3,9 +3,9 @@ import type { DocProps } from '@toeverything/infra'; import { initDocFromProps, LiveData, Service } from '@toeverything/infra'; import dayjs from 'dayjs'; +import type { DocsService } from '../../doc'; import type { EditorSettingService } from '../../editor-setting'; import type { JournalStore } from '../store/journal'; -import type { DocsService } from '../../doc'; export type MaybeDate = Date | string | number; diff --git a/packages/frontend/core/src/modules/navigation/index.ts b/packages/frontend/core/src/modules/navigation/index.ts index 8aa8254d6f934..48e0f0a44338c 100644 --- a/packages/frontend/core/src/modules/navigation/index.ts +++ b/packages/frontend/core/src/modules/navigation/index.ts @@ -9,9 +9,9 @@ export { NavigationButtons } from './view/navigation-buttons'; import { type Framework } from '@toeverything/infra'; import { WorkbenchService } from '../workbench/services/workbench'; +import { WorkspaceScope } from '../workspace'; import { Navigator } from './entities/navigator'; import { NavigatorService } from './services/navigator'; -import { WorkspaceScope } from '../workspace'; export function configureNavigationModule(framework: Framework) { framework diff --git a/packages/frontend/core/src/modules/open-in-app/index.ts b/packages/frontend/core/src/modules/open-in-app/index.ts index 1bf330ed9d4b7..0de7f851ec052 100644 --- a/packages/frontend/core/src/modules/open-in-app/index.ts +++ b/packages/frontend/core/src/modules/open-in-app/index.ts @@ -1,8 +1,8 @@ import { type Framework } from '@toeverything/infra'; -import { OpenInAppService } from './services'; import { GlobalState } from '../storage'; import { WorkspacesService } from '../workspace'; +import { OpenInAppService } from './services'; export { OpenInAppService, OpenLinkMode } from './services'; export * from './utils'; diff --git a/packages/frontend/core/src/modules/open-in-app/services/index.ts b/packages/frontend/core/src/modules/open-in-app/services/index.ts index c63e4471b664d..0cf07fbb8c1d9 100644 --- a/packages/frontend/core/src/modules/open-in-app/services/index.ts +++ b/packages/frontend/core/src/modules/open-in-app/services/index.ts @@ -1,10 +1,10 @@ import { LiveData, OnEvent, Service } from '@toeverything/infra'; import { resolveLinkToDoc } from '../../navigation'; -import { WorkbenchLocationChanged } from '../../workbench/services/workbench'; -import { getLocalWorkspaceIds } from '../../workspace-engine/impls/local'; import type { GlobalState } from '../../storage'; +import { WorkbenchLocationChanged } from '../../workbench/services/workbench'; import type { WorkspacesService } from '../../workspace'; +import { getLocalWorkspaceIds } from '../../workspace-engine/impls/local'; const storageKey = 'open-link-mode'; diff --git a/packages/frontend/core/src/modules/organize/index.ts b/packages/frontend/core/src/modules/organize/index.ts index 317aafe123146..8cb8fe16a190f 100644 --- a/packages/frontend/core/src/modules/organize/index.ts +++ b/packages/frontend/core/src/modules/organize/index.ts @@ -1,11 +1,11 @@ import { type Framework } from '@toeverything/infra'; +import { WorkspaceDBService } from '../db'; +import { WorkspaceScope } from '../workspace'; import { FolderNode } from './entities/folder-node'; import { FolderTree } from './entities/folder-tree'; import { OrganizeService } from './services/organize'; import { FolderStore } from './stores/folder'; -import { WorkspaceDBService } from '../db'; -import { WorkspaceScope } from '../workspace'; export type { FolderNode } from './entities/folder-node'; export { OrganizeService } from './services/organize'; diff --git a/packages/frontend/core/src/modules/pdf/index.ts b/packages/frontend/core/src/modules/pdf/index.ts index fbf7f92b84441..5a6a4f5a15c86 100644 --- a/packages/frontend/core/src/modules/pdf/index.ts +++ b/packages/frontend/core/src/modules/pdf/index.ts @@ -1,9 +1,9 @@ import type { Framework } from '@toeverything/infra'; +import { WorkspaceScope } from '../workspace'; import { PDF } from './entities/pdf'; import { PDFPage } from './entities/pdf-page'; import { PDFService } from './services/pdf'; -import { WorkspaceScope } from '../workspace'; export function configurePDFModule(framework: Framework) { framework diff --git a/packages/frontend/core/src/modules/peek-view/index.ts b/packages/frontend/core/src/modules/peek-view/index.ts index bd1db94be4280..ad170c5961dac 100644 --- a/packages/frontend/core/src/modules/peek-view/index.ts +++ b/packages/frontend/core/src/modules/peek-view/index.ts @@ -1,9 +1,9 @@ import { type Framework } from '@toeverything/infra'; import { WorkbenchService } from '../workbench'; +import { WorkspaceScope } from '../workspace'; import { PeekViewEntity } from './entities/peek-view'; import { PeekViewService } from './services/peek-view'; -import { WorkspaceScope } from '../workspace'; export function configurePeekViewModule(framework: Framework) { framework diff --git a/packages/frontend/core/src/modules/permissions/entities/members.ts b/packages/frontend/core/src/modules/permissions/entities/members.ts index 7e82b4dd62ee1..4b810a74e92ac 100644 --- a/packages/frontend/core/src/modules/permissions/entities/members.ts +++ b/packages/frontend/core/src/modules/permissions/entities/members.ts @@ -12,8 +12,8 @@ import { import { EMPTY, map, mergeMap, switchMap } from 'rxjs'; import { isBackendError, isNetworkError } from '../../cloud'; -import type { WorkspaceMembersStore } from '../stores/members'; import type { WorkspaceService } from '../../workspace'; +import type { WorkspaceMembersStore } from '../stores/members'; export type Member = GetMembersByWorkspaceIdQuery['workspace']['members'][number]; diff --git a/packages/frontend/core/src/modules/permissions/entities/permission.ts b/packages/frontend/core/src/modules/permissions/entities/permission.ts index 934237bdd1147..e9e4eb761efba 100644 --- a/packages/frontend/core/src/modules/permissions/entities/permission.ts +++ b/packages/frontend/core/src/modules/permissions/entities/permission.ts @@ -16,8 +16,8 @@ import { import { EMPTY, exhaustMap, mergeMap } from 'rxjs'; import { isBackendError, isNetworkError } from '../../cloud'; -import type { WorkspacePermissionStore } from '../stores/permission'; import type { WorkspaceService } from '../../workspace'; +import type { WorkspacePermissionStore } from '../stores/permission'; const logger = new DebugLogger('affine:workspace-permission'); diff --git a/packages/frontend/core/src/modules/permissions/services/permission.ts b/packages/frontend/core/src/modules/permissions/services/permission.ts index 5121fedcb2c3c..73f89f421c776 100644 --- a/packages/frontend/core/src/modules/permissions/services/permission.ts +++ b/packages/frontend/core/src/modules/permissions/services/permission.ts @@ -1,8 +1,8 @@ import { Service } from '@toeverything/infra'; +import type { WorkspaceService, WorkspacesService } from '../../workspace'; import { WorkspacePermission } from '../entities/permission'; import type { WorkspacePermissionStore } from '../stores/permission'; -import type { WorkspaceService, WorkspacesService } from '../../workspace'; export class WorkspacePermissionService extends Service { permission = this.framework.createEntity(WorkspacePermission); diff --git a/packages/frontend/core/src/modules/quicksearch/impls/commands.ts b/packages/frontend/core/src/modules/quicksearch/impls/commands.ts index 2ba6a97663ad8..b6480284d33ee 100644 --- a/packages/frontend/core/src/modules/quicksearch/impls/commands.ts +++ b/packages/frontend/core/src/modules/quicksearch/impls/commands.ts @@ -8,11 +8,11 @@ import type { DocMode } from '@blocksuite/affine/blocks'; import { Entity, LiveData } from '@toeverything/infra'; import Fuse from 'fuse.js'; +import type { GlobalContextService } from '../../global-context'; import type { QuickSearchSession } from '../providers/quick-search-provider'; import type { QuickSearchGroup } from '../types/group'; import type { QuickSearchItem } from '../types/item'; import { highlighter } from '../utils/highlighter'; -import type { GlobalContextService } from '../../global-context'; const categories = { 'affine:recent': { diff --git a/packages/frontend/core/src/modules/quicksearch/impls/external-links.ts b/packages/frontend/core/src/modules/quicksearch/impls/external-links.ts index ef8d7c0039a03..56196aa3f6959 100644 --- a/packages/frontend/core/src/modules/quicksearch/impls/external-links.ts +++ b/packages/frontend/core/src/modules/quicksearch/impls/external-links.ts @@ -3,9 +3,9 @@ import { Entity, LiveData } from '@toeverything/infra'; import { resolveLinkToDoc } from '../../navigation'; import { isLink } from '../../navigation/utils'; +import type { WorkspaceService } from '../../workspace'; import type { QuickSearchSession } from '../providers/quick-search-provider'; import type { QuickSearchItem } from '../types/item'; -import type { WorkspaceService } from '../../workspace'; type ExternalLinkPayload = { url: string; diff --git a/packages/frontend/core/src/modules/quicksearch/impls/links.ts b/packages/frontend/core/src/modules/quicksearch/impls/links.ts index b2d9de387ea23..353163d8ad797 100644 --- a/packages/frontend/core/src/modules/quicksearch/impls/links.ts +++ b/packages/frontend/core/src/modules/quicksearch/impls/links.ts @@ -3,13 +3,13 @@ import { BlockLinkIcon, EdgelessIcon, PageIcon } from '@blocksuite/icons/rc'; import { Entity, LiveData } from '@toeverything/infra'; import { omit, truncate } from 'lodash-es'; +import type { DocsService } from '../../doc'; import type { DocDisplayMetaService } from '../../doc-display-meta'; import { resolveLinkToDoc } from '../../navigation'; import { isLink } from '../../navigation/utils'; +import type { WorkspaceService } from '../../workspace'; import type { QuickSearchSession } from '../providers/quick-search-provider'; import type { QuickSearchItem } from '../types/item'; -import type { DocsService } from '../../doc'; -import type { WorkspaceService } from '../../workspace'; type LinkPayload = { docId: string } & ReferenceParams; diff --git a/packages/frontend/core/src/modules/quota/entities/quota.ts b/packages/frontend/core/src/modules/quota/entities/quota.ts index 5c87c71e5fc07..1a55af3e31d96 100644 --- a/packages/frontend/core/src/modules/quota/entities/quota.ts +++ b/packages/frontend/core/src/modules/quota/entities/quota.ts @@ -16,8 +16,8 @@ import bytes from 'bytes'; import { EMPTY, map, mergeMap } from 'rxjs'; import { isBackendError, isNetworkError } from '../../cloud'; -import type { WorkspaceQuotaStore } from '../stores/quota'; import type { WorkspaceService } from '../../workspace'; +import type { WorkspaceQuotaStore } from '../stores/quota'; type QuotaType = WorkspaceQuotaQuery['workspace']['quota']; diff --git a/packages/frontend/core/src/modules/share-setting/entities/share-setting.ts b/packages/frontend/core/src/modules/share-setting/entities/share-setting.ts index 77519b5c59177..e837f676b7f79 100644 --- a/packages/frontend/core/src/modules/share-setting/entities/share-setting.ts +++ b/packages/frontend/core/src/modules/share-setting/entities/share-setting.ts @@ -13,8 +13,8 @@ import { import { EMPTY, exhaustMap, mergeMap } from 'rxjs'; import { isBackendError, isNetworkError } from '../../cloud'; -import type { WorkspaceShareSettingStore } from '../stores/share-setting'; import type { WorkspaceService } from '../../workspace'; +import type { WorkspaceShareSettingStore } from '../stores/share-setting'; type EnableAi = GetWorkspaceConfigQuery['workspace']['enableAi']; type EnableUrlPreview = diff --git a/packages/frontend/core/src/modules/share-setting/index.ts b/packages/frontend/core/src/modules/share-setting/index.ts index a121abb01aa04..7297c8db90d75 100644 --- a/packages/frontend/core/src/modules/share-setting/index.ts +++ b/packages/frontend/core/src/modules/share-setting/index.ts @@ -3,10 +3,10 @@ export { WorkspaceShareSettingService } from './services/share-setting'; import { type Framework } from '@toeverything/infra'; import { WorkspaceServerService } from '../cloud'; +import { WorkspaceScope, WorkspaceService } from '../workspace'; import { WorkspaceShareSetting } from './entities/share-setting'; import { WorkspaceShareSettingService } from './services/share-setting'; import { WorkspaceShareSettingStore } from './stores/share-setting'; -import { WorkspaceScope, WorkspaceService } from '../workspace'; export function configureShareSettingModule(framework: Framework) { framework diff --git a/packages/frontend/core/src/modules/storage/index.ts b/packages/frontend/core/src/modules/storage/index.ts index 7a91e467f4c4f..7387b70c8f202 100644 --- a/packages/frontend/core/src/modules/storage/index.ts +++ b/packages/frontend/core/src/modules/storage/index.ts @@ -18,16 +18,16 @@ import { LocalStorageGlobalState, SessionStorageGlobalSessionState, } from './impls/storage'; -import { - GlobalCacheService, - GlobalSessionStateService, - GlobalStateService, -} from './services/global'; import { GlobalCache, GlobalSessionState, GlobalState, } from './providers/global'; +import { + GlobalCacheService, + GlobalSessionStateService, + GlobalStateService, +} from './services/global'; export const configureGlobalStorageModule = (framework: Framework) => { framework.service(GlobalStateService, [GlobalState]); diff --git a/packages/frontend/core/src/modules/theme/index.ts b/packages/frontend/core/src/modules/theme/index.ts index 9d568e293828c..027454eb9f53c 100644 --- a/packages/frontend/core/src/modules/theme/index.ts +++ b/packages/frontend/core/src/modules/theme/index.ts @@ -3,10 +3,10 @@ export { AppThemeService } from './services/theme'; import { type Framework } from '@toeverything/infra'; import { EditorSettingService } from '../editor-setting'; +import { WorkspaceScope } from '../workspace'; import { AppTheme } from './entities/theme'; import { EdgelessThemeService } from './services/edgeless-theme'; import { AppThemeService } from './services/theme'; -import { WorkspaceScope } from '../workspace'; export function configureAppThemeModule(framework: Framework) { framework diff --git a/packages/frontend/core/src/modules/workspace/entities/list.ts b/packages/frontend/core/src/modules/workspace/entities/list.ts index d3a0a176b2cbe..95d21a7df8a9b 100644 --- a/packages/frontend/core/src/modules/workspace/entities/list.ts +++ b/packages/frontend/core/src/modules/workspace/entities/list.ts @@ -1,7 +1,7 @@ -import { combineLatest, map, of, switchMap } from 'rxjs'; - import { Entity } from '@toeverything/infra'; import { LiveData } from '@toeverything/infra'; +import { combineLatest, map, of, switchMap } from 'rxjs'; + import type { WorkspaceMetadata } from '../metadata'; import type { WorkspaceFlavoursService } from '../services/flavours'; diff --git a/packages/frontend/core/src/modules/workspace/entities/profile.ts b/packages/frontend/core/src/modules/workspace/entities/profile.ts index 3da5140d363a4..5871df95b476c 100644 --- a/packages/frontend/core/src/modules/workspace/entities/profile.ts +++ b/packages/frontend/core/src/modules/workspace/entities/profile.ts @@ -1,7 +1,4 @@ import { DebugLogger } from '@affine/debug'; -import { isEqual } from 'lodash-es'; -import { catchError, EMPTY, exhaustMap, mergeMap } from 'rxjs'; - import { Entity } from '@toeverything/infra'; import { effect, @@ -10,6 +7,9 @@ import { onComplete, onStart, } from '@toeverything/infra'; +import { isEqual } from 'lodash-es'; +import { catchError, EMPTY, exhaustMap, mergeMap } from 'rxjs'; + import type { WorkspaceMetadata } from '../metadata'; import type { WorkspaceFlavourProvider } from '../providers/flavour'; import type { WorkspaceFlavoursService } from '../services/flavours'; diff --git a/packages/frontend/core/src/modules/workspace/entities/workspace.ts b/packages/frontend/core/src/modules/workspace/entities/workspace.ts index 67e0f5fcec75a..dda010e059f00 100644 --- a/packages/frontend/core/src/modules/workspace/entities/workspace.ts +++ b/packages/frontend/core/src/modules/workspace/entities/workspace.ts @@ -1,10 +1,10 @@ import { DocCollection } from '@blocksuite/affine/store'; +import { Entity } from '@toeverything/infra'; +import { LiveData } from '@toeverything/infra'; import { nanoid } from 'nanoid'; import { Observable } from 'rxjs'; import type { Awareness } from 'y-protocols/awareness.js'; -import { Entity } from '@toeverything/infra'; -import { LiveData } from '@toeverything/infra'; import { WorkspaceDBService } from '../../db'; import { getAFFiNEWorkspaceSchema } from '../global-schema'; import type { WorkspaceScope } from '../scopes/workspace'; diff --git a/packages/frontend/core/src/modules/workspace/events/index.ts b/packages/frontend/core/src/modules/workspace/events/index.ts index 56caf690bb38d..4da388a729334 100644 --- a/packages/frontend/core/src/modules/workspace/events/index.ts +++ b/packages/frontend/core/src/modules/workspace/events/index.ts @@ -1,4 +1,5 @@ import { createEvent } from '@toeverything/infra'; + import type { WorkspaceEngine } from '../entities/engine'; import type { Workspace } from '../entities/workspace'; diff --git a/packages/frontend/core/src/modules/workspace/services/destroy.ts b/packages/frontend/core/src/modules/workspace/services/destroy.ts index 46a6fb2b25596..40e7d85e90b61 100644 --- a/packages/frontend/core/src/modules/workspace/services/destroy.ts +++ b/packages/frontend/core/src/modules/workspace/services/destroy.ts @@ -1,4 +1,5 @@ import { Service } from '@toeverything/infra'; + import type { WorkspaceMetadata } from '../metadata'; import type { WorkspaceFlavoursService } from './flavours'; diff --git a/packages/frontend/core/src/modules/workspace/services/engine.ts b/packages/frontend/core/src/modules/workspace/services/engine.ts index ee7e80efb6fee..10907d6e802db 100644 --- a/packages/frontend/core/src/modules/workspace/services/engine.ts +++ b/packages/frontend/core/src/modules/workspace/services/engine.ts @@ -1,4 +1,5 @@ import { Service } from '@toeverything/infra'; + import { WorkspaceEngine } from '../entities/engine'; import type { WorkspaceScope } from '../scopes/workspace'; diff --git a/packages/frontend/core/src/modules/workspace/services/list.ts b/packages/frontend/core/src/modules/workspace/services/list.ts index 4fa8c9c984753..53c86bce3438a 100644 --- a/packages/frontend/core/src/modules/workspace/services/list.ts +++ b/packages/frontend/core/src/modules/workspace/services/list.ts @@ -1,4 +1,5 @@ import { Service } from '@toeverything/infra'; + import { WorkspaceList } from '../entities/list'; export class WorkspaceListService extends Service { diff --git a/packages/frontend/core/src/modules/workspace/services/transform.ts b/packages/frontend/core/src/modules/workspace/services/transform.ts index 8954efd0d3b49..dc5ecad53e273 100644 --- a/packages/frontend/core/src/modules/workspace/services/transform.ts +++ b/packages/frontend/core/src/modules/workspace/services/transform.ts @@ -1,7 +1,7 @@ import { assertEquals } from '@blocksuite/affine/global/utils'; +import { Service } from '@toeverything/infra'; import { applyUpdate } from 'yjs'; -import { Service } from '@toeverything/infra'; import { transformWorkspaceDBLocalToCloud } from '../../db'; import type { Workspace } from '../entities/workspace'; import type { WorkspaceMetadata } from '../metadata'; diff --git a/packages/frontend/core/src/modules/workspace/services/workspace.ts b/packages/frontend/core/src/modules/workspace/services/workspace.ts index e0119685e901f..6266f9a82f1a1 100644 --- a/packages/frontend/core/src/modules/workspace/services/workspace.ts +++ b/packages/frontend/core/src/modules/workspace/services/workspace.ts @@ -1,4 +1,5 @@ import { Service } from '@toeverything/infra'; + import { Workspace } from '../entities/workspace'; export class WorkspaceService extends Service { diff --git a/packages/frontend/core/src/modules/workspace/stores/profile-cache.ts b/packages/frontend/core/src/modules/workspace/stores/profile-cache.ts index f1553251d2e2e..b6bf8d736a218 100644 --- a/packages/frontend/core/src/modules/workspace/stores/profile-cache.ts +++ b/packages/frontend/core/src/modules/workspace/stores/profile-cache.ts @@ -1,6 +1,6 @@ +import { Store } from '@toeverything/infra'; import { map } from 'rxjs'; -import { Store } from '@toeverything/infra'; import type { GlobalCache } from '../../storage'; import type { WorkspaceProfileInfo } from '../entities/profile';