refactor(core): move infra modules to core (#9207)

This commit is contained in:
EYHN
2024-12-23 04:53:59 +00:00
parent 2ea79d25ad
commit 129f94ee78
337 changed files with 908 additions and 1367 deletions

View File

@@ -5,10 +5,10 @@ import {
PreconditionStrategy,
} from '@affine/core/commands';
import type { DocMode } from '@blocksuite/affine/blocks';
import type { GlobalContextService } from '@toeverything/infra';
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';

View File

@@ -1,4 +1,3 @@
import type { DocRecord, DocsService } from '@toeverything/infra';
import {
effect,
Entity,
@@ -9,6 +8,7 @@ import {
import { truncate } from 'lodash-es';
import { EMPTY, map, mergeMap, of, switchMap } from 'rxjs';
import type { DocRecord, DocsService } from '../../doc';
import type { DocDisplayMetaService } from '../../doc-display-meta';
import type { DocsSearchService } from '../../docs-search';
import type { QuickSearchSession } from '../providers/quick-search-provider';

View File

@@ -1,9 +1,9 @@
import { LinkIcon } from '@blocksuite/icons/rc';
import type { WorkspaceService } from '@toeverything/infra';
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';

View File

@@ -1,12 +1,13 @@
import type { ReferenceParams } from '@blocksuite/affine/blocks';
import { BlockLinkIcon, EdgelessIcon, PageIcon } from '@blocksuite/icons/rc';
import type { DocsService, WorkspaceService } from '@toeverything/infra';
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';

View File

@@ -1,19 +1,19 @@
import {
DocsService,
type Framework,
GlobalContextService,
WorkspaceLocalState,
WorkspaceScope,
WorkspaceService,
} from '@toeverything/infra';
import { type Framework } from '@toeverything/infra';
import { CollectionService } from '../collection';
import { WorkspaceDialogService } from '../dialogs';
import { DocDisplayMetaService } from '../doc-display-meta/services/doc-display-meta';
import { DocsService } from '../doc';
import { DocDisplayMetaService } from '../doc-display-meta';
import { DocsSearchService } from '../docs-search';
import { GlobalContextService } from '../global-context';
import { JournalService } from '../journal';
import { TagService } from '../tag';
import { WorkbenchService } from '../workbench';
import {
WorkspaceLocalState,
WorkspaceScope,
WorkspaceService,
} from '../workspace';
import { QuickSearch } from './entities/quick-search';
import { CollectionsQuickSearchSession } from './impls/collections';
import { CommandsQuickSearchSession } from './impls/commands';

View File

@@ -1,8 +1,9 @@
import { track } from '@affine/track';
import { Text } from '@blocksuite/affine/store';
import type { DocProps, DocsService } from '@toeverything/infra';
import type { DocProps } from '@toeverything/infra';
import { Service } from '@toeverything/infra';
import type { DocsService } from '../../doc';
import { EditorSettingService } from '../../editor-setting';
import type { WorkbenchService } from '../../workbench';
import { CollectionsQuickSearchSession } from '../impls/collections';

View File

@@ -1,10 +1,8 @@
import type {
DocRecord,
DocsService,
WorkspaceLocalState,
} from '@toeverything/infra';
import { Service } from '@toeverything/infra';
import type { DocRecord, DocsService } from '../../doc';
import type { WorkspaceLocalState } from '../../workspace';
const RECENT_PAGES_LIMIT = 3; // adjust this?
const RECENT_PAGES_KEY = 'recent-pages';