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

@@ -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 {

View File

@@ -1,5 +1,6 @@
import { type Framework, GlobalState } from '@toeverything/infra';
import { type Framework } from '@toeverything/infra';
import { GlobalState } from '../storage';
import { AppSidebar } from './entities/app-sidebar';
import { AppSidebarStateImpl } from './impls/storage';
import { AppSidebarState } from './providers/storage';

View File

@@ -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 {

View File

@@ -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';

View File

@@ -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
// oxlint-disable-next-line eslint-plugin-react(no-array-index-key)
<RandomBar key={index} />
))}
</div>