mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-07 18:13:43 +00:00
style: no import infra submodule (#6278)
This commit is contained in:
@@ -3,14 +3,6 @@
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"exports": {
|
||||
"./blocksuite": "./src/blocksuite/index.ts",
|
||||
"./command": "./src/command/index.ts",
|
||||
"./atom": "./src/atom/index.ts",
|
||||
"./app-config-storage": "./src/app-config-storage.ts",
|
||||
"./di": "./src/di/index.ts",
|
||||
"./livedata": "./src/livedata/index.ts",
|
||||
"./storage": "./src/storage/index.ts",
|
||||
"./lifecycle": "./src/lifecycle/index.ts",
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Doc as BlockSuiteDoc } from '@blocksuite/store';
|
||||
import type { ServiceProvider } from '@toeverything/infra/di';
|
||||
import type { ServiceProvider } from '@toeverything/infra';
|
||||
|
||||
import type { PageMode, PageRecord } from './record';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ImportIcon, PlusIcon } from '@blocksuite/icons';
|
||||
import { registerAffineCommand } from '@toeverything/infra/command';
|
||||
import { registerAffineCommand } from '@toeverything/infra';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
import { openCreateWorkspaceModalAtom } from '../atoms';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ContactWithUsIcon, NewIcon } from '@blocksuite/icons';
|
||||
import { registerAffineCommand } from '@toeverything/infra/command';
|
||||
import { registerAffineCommand } from '@toeverything/infra';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
import { openSettingModalAtom } from '../atoms';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { SidebarIcon } from '@blocksuite/icons';
|
||||
import { registerAffineCommand } from '@toeverything/infra/command';
|
||||
import { registerAffineCommand } from '@toeverything/infra';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
import { appSidebarOpenAtom } from '../components/app-sidebar';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { WorkspaceSubPath } from '@affine/core/shared';
|
||||
import type { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowRightBigIcon } from '@blocksuite/icons';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import { registerAffineCommand } from '@toeverything/infra/command';
|
||||
import { registerAffineCommand } from '@toeverything/infra';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
import { openSettingModalAtom, openWorkspaceListModalAtom } from '../atoms';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { SettingsIcon } from '@blocksuite/icons';
|
||||
import type { AffineEditorContainer } from '@blocksuite/presets';
|
||||
import { appSettingAtom } from '@toeverything/infra/atom';
|
||||
import { appSettingAtom } from '@toeverything/infra';
|
||||
import {
|
||||
PreconditionStrategy,
|
||||
registerAffineCommand,
|
||||
} from '@toeverything/infra/command';
|
||||
} from '@toeverything/infra';
|
||||
import { type createStore } from 'jotai';
|
||||
import type { useTheme } from 'next-themes';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { updateReadyAtom } from '@affine/core/hooks/use-app-updater';
|
||||
import { apis } from '@affine/electron-api';
|
||||
import type { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ResetIcon } from '@blocksuite/icons';
|
||||
import { registerAffineCommand } from '@toeverything/infra/command';
|
||||
import { registerAffineCommand } from '@toeverything/infra';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
export function registerAffineUpdatesCommands({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrentStore } from '@toeverything/infra/atom';
|
||||
import { getCurrentStore } from '@toeverything/infra';
|
||||
import { Provider } from 'jotai/react';
|
||||
import type { FC } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { WorkspaceListService } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useEffect } from 'react';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { Suspense, useEffect } from 'react';
|
||||
|
||||
import { useCurrentLoginStatus } from '../../../hooks/affine/use-current-login-status';
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { _addLocalWorkspace } from '@affine/workspace-impl';
|
||||
import { WorkspaceManager } from '@toeverything/infra';
|
||||
import { buildShowcaseWorkspace, initEmptyPage } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import type { KeyboardEvent } from 'react';
|
||||
import { useLayoutEffect } from 'react';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { type DocCollection } from '@blocksuite/store';
|
||||
import * as Collapsible from '@radix-ui/react-collapsible';
|
||||
import type { DialogContentProps } from '@radix-ui/react-dialog';
|
||||
import { Doc, type PageMode, Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { atom, useAtom, useSetAtom } from 'jotai';
|
||||
import {
|
||||
Fragment,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { WorkspacePropertiesAdapter } from '@affine/core/modules/workspace';
|
||||
import type { PageInfoCustomPropertyMeta } from '@affine/core/modules/workspace/properties/schema';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { PagePropertiesMetaManager } from './page-properties-manager';
|
||||
|
||||
@@ -11,7 +11,7 @@ import { WorkspaceLegacyProperties } from '@affine/core/modules/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { DeleteIcon, MoreHorizontalIcon, TagsIcon } from '@blocksuite/icons';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
type HTMLAttributes,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Menu, MenuItem, MenuTrigger } from '@affine/component/ui/menu';
|
||||
import { dateFormatOptions, type DateFormats } from '@toeverything/infra/atom';
|
||||
import { dateFormatOptions, type DateFormats } from '@toeverything/infra';
|
||||
import dayjs from 'dayjs';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type AppSetting,
|
||||
fontStyleOptions,
|
||||
windowFrameStyleOptions,
|
||||
} from '@toeverything/infra/atom';
|
||||
} from '@toeverything/infra';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ import {
|
||||
WorkspaceManager,
|
||||
type WorkspaceMetadata,
|
||||
} from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import { useAtom } from 'jotai/react';
|
||||
import { type ReactElement, Suspense, useCallback, useMemo } from 'react';
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowRightSmallIcon } from '@blocksuite/icons';
|
||||
import { Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { UNTITLED_WORKSPACE_NAME } from '@affine/env/constant';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { type Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useState } from 'react';
|
||||
|
||||
|
||||
@@ -7,10 +7,7 @@ import type { PageInfoCustomPropertyMeta } from '@affine/core/modules/workspace/
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { DeleteIcon, FilterIcon, MoreHorizontalIcon } from '@blocksuite/icons';
|
||||
import type {
|
||||
Workspace,
|
||||
WorkspaceMetadata,
|
||||
} from '@toeverything/infra/workspace';
|
||||
import type { Workspace, WorkspaceMetadata } from '@toeverything/infra';
|
||||
import {
|
||||
createContext,
|
||||
Fragment,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { LinkIcon } from '@blocksuite/icons';
|
||||
import { Doc, useLiveData } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
|
||||
import { useExportPage } from '../../../../hooks/affine/use-export-page';
|
||||
import * as styles from './index.css';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Skeleton } from '@affine/component';
|
||||
import { ResizePanel } from '@affine/component/resize-panel';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useServiceOptional } from '@toeverything/infra/di';
|
||||
import { useServiceOptional } from '@toeverything/infra';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { debounce } from 'lodash-es';
|
||||
import type { PropsWithChildren, ReactElement } from 'react';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { toast } from '@affine/core/utils';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
export interface FavoriteButtonProps {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
useLiveData,
|
||||
useService,
|
||||
} from '@toeverything/infra';
|
||||
import { fontStyleOptions } from '@toeverything/infra/atom';
|
||||
import { fontStyleOptions } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { memo, Suspense, useCallback, useMemo } from 'react';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
|
||||
import { usePageHelper } from '../../blocksuite/block-suite-page-list/utils';
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
FilterIcon,
|
||||
SplitViewIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import {
|
||||
type PropsWithChildren,
|
||||
type ReactElement,
|
||||
|
||||
@@ -26,8 +26,8 @@ import {
|
||||
AffineCommandRegistry,
|
||||
type CommandCategory,
|
||||
PreconditionStrategy,
|
||||
} from '@toeverything/infra/command';
|
||||
import { useService, useServiceOptional } from '@toeverything/infra/di';
|
||||
} from '@toeverything/infra';
|
||||
import { useService, useServiceOptional } from '@toeverything/infra';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CommandCategory } from '@toeverything/infra/command';
|
||||
import type { CommandCategory } from '@toeverything/infra';
|
||||
import { commandScore } from 'cmdk';
|
||||
import { groupBy } from 'lodash-es';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useDocEngineStatus } from '@affine/core/hooks/affine/use-doc-engine-sta
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import type { CommandCategory } from '@toeverything/infra/command';
|
||||
import type { CommandCategory } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import { Command } from 'cmdk';
|
||||
import { useAtom } from 'jotai';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CommandCategory } from '@toeverything/infra/command';
|
||||
import type { CommandCategory } from '@toeverything/infra';
|
||||
|
||||
export interface CommandContext {
|
||||
pageMode: 'page' | 'edgeless' | undefined;
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-me
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { DeleteIcon, ResetIcon } from '@blocksuite/icons';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { useAppSettingHelper } from '../../../hooks/affine/use-app-setting-helper';
|
||||
|
||||
@@ -14,7 +14,7 @@ import type { DocCollection, DocMeta } from '@blocksuite/store';
|
||||
import { useDroppable } from '@dnd-kit/core';
|
||||
import * as Collapsible from '@radix-ui/react-collapsible';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { useAllPageListConfig } from '../../../../hooks/affine/use-all-page-list-config';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Workbench } from '@affine/core/modules/workbench';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { MoreHorizontalIcon } from '@blocksuite/icons';
|
||||
import type { DocCollection } from '@blocksuite/store';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { useBlockSuiteMetaHelper } from '../../../../hooks/affine/use-block-suite-meta-helper';
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Unreachable } from '@affine/env/constant';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { Logo1Icon } from '@blocksuite/icons';
|
||||
import { WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { Suspense, useCallback, useEffect } from 'react';
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DragEndEvent } from '@dnd-kit/core';
|
||||
import { WorkspaceManager, type WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
UnsyncIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { debounce } from 'lodash-es';
|
||||
import {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
|
||||
import { useWorkspaceStatus } from '@affine/core/hooks/use-workspace-status';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useState } from 'react';
|
||||
|
||||
import { WorkspaceSubPath } from '../../shared';
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'fake-indexeddb/auto';
|
||||
import { WorkspacePropertiesAdapter } from '@affine/core/modules/workspace';
|
||||
import { render } from '@testing-library/react';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { ServiceProviderContext, useService } from '@toeverything/infra/di';
|
||||
import { ServiceProviderContext, useService } from '@toeverything/infra';
|
||||
import { createStore, Provider } from 'jotai';
|
||||
import { Suspense } from 'react';
|
||||
import { describe, expect, test, vi } from 'vitest';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useBlockSuiteDocMeta } from '@affine/core/hooks/use-block-suite-page-me
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { usePageHelper } from '../../components/blocksuite/block-suite-page-list/utils';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type AppSetting, appSettingAtom } from '@toeverything/infra/atom';
|
||||
import { type AppSetting, appSettingAtom } from '@toeverything/infra';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import { Doc, useLiveData, Workspace } from '@toeverything/infra';
|
||||
import {
|
||||
PreconditionStrategy,
|
||||
registerAffineCommand,
|
||||
} from '@toeverything/infra/command';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
} from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { DragEndEvent, UniqueIdentifier } from '@dnd-kit/core';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { useBlockSuiteMetaHelper } from './use-block-suite-meta-helper';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useDebouncedState } from 'foxact/use-debounced-state';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
type AppConfigSchema,
|
||||
AppConfigStorage,
|
||||
defaultAppConfig,
|
||||
} from '@toeverything/infra/app-config-storage';
|
||||
} from '@toeverything/infra';
|
||||
import { type Dispatch, useEffect, useState } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { apis, events, type UpdateMeta } from '@affine/electron-api';
|
||||
import { isBrowser } from '@affine/env/constant';
|
||||
import { appSettingAtom } from '@toeverything/infra/atom';
|
||||
import { appSettingAtom } from '@toeverything/infra';
|
||||
import { atom, useAtom, useAtomValue } from 'jotai';
|
||||
import { atomWithObservable, atomWithStorage } from 'jotai/utils';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useStore } from 'jotai';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WorkspaceManager, type WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { useWorkspaceBlobObjectUrl } from './use-workspace-blob';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { WorkspaceMetadata } from '@toeverything/infra';
|
||||
import { type Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
useSensors,
|
||||
} from '@dnd-kit/core';
|
||||
import { PageRecordList, useLiveData, Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
|
||||
import type { PropsWithChildren, ReactNode } from 'react';
|
||||
import { lazy, Suspense, useCallback, useEffect, useState } from 'react';
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
DeletedCollection,
|
||||
} from '@affine/env/filter';
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { LiveData } from '@toeverything/infra/livedata';
|
||||
import { LiveData } from '@toeverything/infra';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Array as YArray } from 'yjs';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
useLiveData,
|
||||
Workspace,
|
||||
} from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||
import clsx from 'clsx';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { IconButton, Tooltip } from '@affine/component';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { ArrowLeftSmallIcon, ArrowRightSmallIcon } from '@blocksuite/icons';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
|
||||
import { useGeneralShortcuts } from '../../../hooks/affine/use-shortcuts';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
PreconditionStrategy,
|
||||
registerAffineCommand,
|
||||
} from '@toeverything/infra/command';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
} from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { Navigator } from '../entities/navigator';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LiveData } from '@toeverything/infra/livedata';
|
||||
import type { GlobalState } from '@toeverything/infra/storage';
|
||||
import type { GlobalState } from '@toeverything/infra';
|
||||
import { LiveData } from '@toeverything/infra';
|
||||
|
||||
import type { RightSidebarView } from './right-sidebar-view';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ResizePanel } from '@affine/component/resize-panel';
|
||||
import { appSidebarOpenAtom } from '@affine/core/components/app-sidebar';
|
||||
import { appSettingAtom } from '@toeverything/infra/atom';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { appSettingAtom } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { type Location } from 'history';
|
||||
import { useEffect } from 'react';
|
||||
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
||||
|
||||
@@ -2,7 +2,7 @@ import { IconButton } from '@affine/component';
|
||||
import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls';
|
||||
import { RightSidebarIcon } from '@blocksuite/icons';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { Suspense, useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
SoloViewIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { useSortable } from '@dnd-kit/sortable';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||
import type { SetStateAction } from 'jotai';
|
||||
import {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
horizontalListSortingStrategy,
|
||||
SortableContext,
|
||||
} from '@dnd-kit/sortable';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
type HTMLAttributes,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import type { View } from '../entities/view';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { lazy as reactLazy, useEffect, useMemo } from 'react';
|
||||
import {
|
||||
createMemoryRouter,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import type { To } from 'history';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { LiveData } from '@toeverything/infra/livedata';
|
||||
import { LiveData } from '@toeverything/infra';
|
||||
|
||||
/**
|
||||
* service to manage current workspace
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Tag } from '@affine/env/filter';
|
||||
import type { DocsPropertiesMeta } from '@blocksuite/store';
|
||||
import { LiveData } from '@toeverything/infra/livedata';
|
||||
import type { Workspace } from '@toeverything/infra/workspace';
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { LiveData } from '@toeverything/infra';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ import {
|
||||
ViewLayersIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useWorkspace } from '@affine/core/hooks/use-workspace';
|
||||
import type { Workspace } from '@toeverything/infra';
|
||||
import { WorkspaceListService, WorkspaceManager } from '@toeverything/infra';
|
||||
import { ServiceProviderContext, useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { ServiceProviderContext, useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { type ReactElement, Suspense, useEffect, useMemo } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { assertExists } from '@blocksuite/global/utils';
|
||||
import { DeleteIcon } from '@blocksuite/icons';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { ViewBodyIsland, ViewHeaderIsland } from '../../modules/workbench';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { events } from '@affine/electron-api';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { WorkspaceManager } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useLiveData } from '@toeverything/infra/livedata';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData } from '@toeverything/infra';
|
||||
import { useAtom } from 'jotai';
|
||||
import {
|
||||
lazy,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LiveData, useLiveData } from '@toeverything/infra/livedata';
|
||||
import { LiveData, useLiveData } from '@toeverything/infra';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ import createEmotionCache from '@affine/core/utils/create-emotion-cache';
|
||||
import { configureWebServices } from '@affine/core/web';
|
||||
import { createI18n, setUpLanguage } from '@affine/i18n';
|
||||
import { CacheProvider } from '@emotion/react';
|
||||
import { getCurrentStore } from '@toeverything/infra/atom';
|
||||
import { ServiceCollection } from '@toeverything/infra/di';
|
||||
import { getCurrentStore } from '@toeverything/infra';
|
||||
import { ServiceCollection } from '@toeverything/infra';
|
||||
import mixpanel from 'mixpanel-browser';
|
||||
import type { PropsWithChildren, ReactElement } from 'react';
|
||||
import { lazy, Suspense } from 'react';
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
SqliteConnection,
|
||||
ValidationResult,
|
||||
} from '@affine/native';
|
||||
import { WorkspaceVersion } from '@toeverything/infra/blocksuite';
|
||||
import { WorkspaceVersion } from '@toeverything/infra';
|
||||
|
||||
import { applyGuidCompatibilityFix, migrateToLatest } from '../db/migration';
|
||||
import { logger } from '../logger';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
migrateGuidCompatibility,
|
||||
migrateToSubdoc,
|
||||
WorkspaceVersion,
|
||||
} from '@toeverything/infra/blocksuite';
|
||||
} from '@toeverything/infra';
|
||||
import fs from 'fs-extra';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import { ValidationResult } from '@affine/native';
|
||||
import { WorkspaceVersion } from '@toeverything/infra/blocksuite';
|
||||
import { WorkspaceVersion } from '@toeverything/infra';
|
||||
import fs from 'fs-extra';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
import {
|
||||
AppConfigStorage,
|
||||
defaultAppConfig,
|
||||
} from '@toeverything/infra/app-config-storage';
|
||||
import { AppConfigStorage, defaultAppConfig } from '@toeverything/infra';
|
||||
import { app } from 'electron';
|
||||
|
||||
const FILENAME = 'config.json';
|
||||
|
||||
@@ -16,8 +16,8 @@ import createEmotionCache from '@affine/core/utils/create-emotion-cache';
|
||||
import { configureWebServices } from '@affine/core/web';
|
||||
import { createI18n, setUpLanguage } from '@affine/i18n';
|
||||
import { CacheProvider } from '@emotion/react';
|
||||
import { getCurrentStore } from '@toeverything/infra/atom';
|
||||
import { ServiceCollection } from '@toeverything/infra/di';
|
||||
import { getCurrentStore } from '@toeverything/infra';
|
||||
import { ServiceCollection } from '@toeverything/infra';
|
||||
import mixpanel from 'mixpanel-browser';
|
||||
import type { PropsWithChildren, ReactElement } from 'react';
|
||||
import { lazy, Suspense } from 'react';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import type { WorkspaceFactory } from '@toeverything/infra';
|
||||
import type { ServiceCollection } from '@toeverything/infra';
|
||||
import {
|
||||
AwarenessContext,
|
||||
AwarenessProvider,
|
||||
@@ -8,7 +9,6 @@ import {
|
||||
WorkspaceIdContext,
|
||||
WorkspaceScope,
|
||||
} from '@toeverything/infra';
|
||||
import type { ServiceCollection } from '@toeverything/infra/di';
|
||||
|
||||
import { LocalWorkspaceFactory } from '../local';
|
||||
import { IndexedDBBlobStorage } from '../local/blob-indexeddb';
|
||||
|
||||
@@ -7,14 +7,14 @@ import { useDarkMode } from 'storybook-dark-mode';
|
||||
import { AffineContext } from '@affine/component/context';
|
||||
import useSWR from 'swr';
|
||||
import type { Decorator } from '@storybook/react';
|
||||
import { _setCurrentStore } from '@toeverything/infra/atom';
|
||||
import { _setCurrentStore } from '@toeverything/infra';
|
||||
import { setupGlobal, type Environment } from '@affine/env/global';
|
||||
|
||||
import type { Preview } from '@storybook/react';
|
||||
import { useLayoutEffect, useRef } from 'react';
|
||||
import { setup } from '@affine/core/bootstrap/setup';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { ServiceCollection } from '@toeverything/infra/di';
|
||||
import { ServiceCollection } from '@toeverything/infra';
|
||||
import {
|
||||
WorkspaceManager,
|
||||
configureInfraServices,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { expect } from '@storybook/jest';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
import { Workspace } from '@toeverything/infra';
|
||||
import { initEmptyPage } from '@toeverything/infra';
|
||||
import { useService } from '@toeverything/infra/di';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
"@affine-test/kit/*": ["./tests/kit/*"],
|
||||
"@affine-test/fixtures/*": ["./tests/fixtures/*"],
|
||||
"@toeverything/y-indexeddb": ["./packages/common/y-indexeddb/src"],
|
||||
"@toeverything/infra/*": ["./packages/common/infra/src/*"],
|
||||
"@toeverything/infra": ["./packages/common/infra/src"],
|
||||
"@affine/native": ["./packages/frontend/native/index.d.ts"],
|
||||
"@affine/native/*": ["./packages/frontend/native/*"],
|
||||
"@affine/storage": ["./packages/backend/storage/index.d.ts"],
|
||||
@@ -119,9 +119,6 @@
|
||||
{
|
||||
"path": "./packages/common/infra"
|
||||
},
|
||||
{
|
||||
"path": "./packages/common/infra"
|
||||
},
|
||||
{
|
||||
"path": "./packages/common/y-indexeddb"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user