mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 02:13:00 +08:00
refactor(editor): orgnize exports (#10709)
This commit is contained in:
@@ -10,7 +10,7 @@ import { WorkspaceService } from '@affine/core/modules/workspace';
|
||||
import { inferOpenMode } from '@affine/core/utils';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import track from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import {
|
||||
ArrowDownSmallIcon,
|
||||
EdgelessIcon,
|
||||
|
||||
@@ -2,13 +2,13 @@ import { I18n, i18nTime } from '@affine/i18n';
|
||||
import track from '@affine/track';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
type AffineInlineEditor,
|
||||
type DocMode,
|
||||
type LinkedMenuGroup,
|
||||
type LinkedMenuItem,
|
||||
type LinkedWidgetConfig,
|
||||
LinkedWidgetUtils,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
} from '@blocksuite/affine/blocks/root';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import type { AffineInlineEditor } from '@blocksuite/affine/rich-text';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { Text } from '@blocksuite/affine/store';
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
|
||||
import type { WorkspaceMetadata } from '../workspace';
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ import {
|
||||
} from '@affine/component';
|
||||
import type { AffineDNDData } from '@affine/core/types/dnd';
|
||||
import { BlockStdScope } from '@blocksuite/affine/block-std';
|
||||
import { type DragBlockPayload } from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
DNDAPIExtension,
|
||||
DndApiExtensionIdentifier,
|
||||
} from '@blocksuite/affine/shared/services';
|
||||
import { type SliceSnapshot } from '@blocksuite/affine/store';
|
||||
import type { SliceSnapshot } from '@blocksuite/affine/store';
|
||||
import type { DragBlockPayload } from '@blocksuite/affine/widgets/drag-handle';
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
import type { DocsService } from '../../doc';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
DatabaseBlockDataSource,
|
||||
type DatabaseBlockModel,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { DatabaseBlockDataSource } from '@blocksuite/affine/blocks/database';
|
||||
import type { DatabaseBlockModel } from '@blocksuite/affine/model';
|
||||
import { LiveData, Service } from '@toeverything/infra';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import { combineLatest, distinctUntilChanged, map, Observable } from 'rxjs';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DatabaseBlockDataSource } from '@blocksuite/affine/blocks';
|
||||
import type { DatabaseBlockDataSource } from '@blocksuite/affine/blocks/database';
|
||||
import type { LiveData } from '@toeverything/infra';
|
||||
|
||||
import type { Doc } from '../doc';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { BlockStdScope } from '@blocksuite/affine/block-std';
|
||||
import { PageEditorBlockSpecs } from '@blocksuite/affine/blocks';
|
||||
import { PageEditorBlockSpecs } from '@blocksuite/affine/extensions';
|
||||
import type { Store } from '@blocksuite/affine/store';
|
||||
import { useMemo } from 'react';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { BlockStdScope } from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
DefaultInlineManagerExtension,
|
||||
RichText,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
} from '@blocksuite/affine/rich-text';
|
||||
import type { Store } from '@blocksuite/affine/store';
|
||||
import { TextIcon } from '@blocksuite/icons/rc';
|
||||
import { type LiveData, useLiveData } from '@toeverything/infra';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
affineLabelToDatabaseTagColor,
|
||||
databaseTagColorToV2,
|
||||
} from '@affine/core/modules/tag/entities/utils';
|
||||
import type { DatabaseBlockDataSource } from '@blocksuite/affine/blocks';
|
||||
import type { DatabaseBlockDataSource } from '@blocksuite/affine/blocks/database';
|
||||
import type { SelectTag } from '@blocksuite/data-view';
|
||||
import { MultiSelectIcon, SingleSelectIcon } from '@blocksuite/icons/rc';
|
||||
import { LiveData, useLiveData, useService } from '@toeverything/infra';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
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 type { DatabaseBlockDataSource } from '@blocksuite/affine/blocks/database';
|
||||
import { DatabaseTableViewIcon, PageIcon } from '@blocksuite/icons/rc';
|
||||
import { LiveData, useLiveData, useService } from '@toeverything/infra';
|
||||
import { Fragment, useMemo } from 'react';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { I18n } from '@affine/i18n';
|
||||
import type {
|
||||
LinkedMenuGroup,
|
||||
LinkedMenuItem,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
} from '@blocksuite/affine/blocks/root';
|
||||
import { createSignalFromObservable } from '@blocksuite/affine/shared/utils';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { computed } from '@preact/signals-core';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMode, RootBlockModel } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode, RootBlockModel } from '@blocksuite/affine/model';
|
||||
import { Entity } from '@toeverything/infra';
|
||||
|
||||
import type { DocProperties } from '../../db';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import { map } from 'rxjs';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { Unreachable } from '@affine/env/constant';
|
||||
import { type DocMode, replaceIdMiddleware } from '@blocksuite/affine/blocks';
|
||||
import type { DeltaInsert } from '@blocksuite/affine/inline';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { replaceIdMiddleware } from '@blocksuite/affine/shared/adapters';
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine/shared/types';
|
||||
import { Slice, Text, Transformer } from '@blocksuite/affine/store';
|
||||
import { LiveData, ObjectPool, Service } from '@toeverything/infra';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import {
|
||||
Store,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { toURLSearchParams } from '@affine/core/modules/navigation';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/blocks';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/model';
|
||||
import { fromPromise, OnEvent, Service } from '@toeverything/infra';
|
||||
import { isEmpty, omit } from 'lodash-es';
|
||||
import { map, type Observable, switchMap } from 'rxjs';
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import type {
|
||||
AttachmentBlockModel,
|
||||
BookmarkBlockModel,
|
||||
EmbedBlockModel,
|
||||
ImageBlockModel,
|
||||
TableBlockModel,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
defaultBlockMarkdownAdapterMatchers,
|
||||
InlineDeltaToMarkdownAdapterExtensions,
|
||||
MarkdownAdapter,
|
||||
MarkdownInlineToDeltaAdapterExtensions,
|
||||
TableModelFlavour,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { defaultBlockMarkdownAdapterMatchers } from '@blocksuite/affine/adapters';
|
||||
import { Container } from '@blocksuite/affine/global/di';
|
||||
import {
|
||||
type AttachmentBlockModel,
|
||||
type BookmarkBlockModel,
|
||||
type EmbedBlockModel,
|
||||
type ImageBlockModel,
|
||||
type TableBlockModel,
|
||||
TableModelFlavour,
|
||||
} from '@blocksuite/affine/model';
|
||||
import {
|
||||
InlineDeltaToMarkdownAdapterExtensions,
|
||||
MarkdownInlineToDeltaAdapterExtensions,
|
||||
} from '@blocksuite/affine/rich-text';
|
||||
import { MarkdownAdapter } from '@blocksuite/affine/shared/adapters';
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine/shared/types';
|
||||
import {
|
||||
createYProxy,
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import type { AffineEditorContainer } from '@affine/core/blocksuite/block-suite-editor';
|
||||
import type { DefaultOpenProperty } from '@affine/core/components/doc-properties';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/affine/block-std/gfx';
|
||||
import type {
|
||||
DocMode,
|
||||
DocTitle,
|
||||
ReferenceParams,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { DocTitle } from '@blocksuite/affine/fragments/doc-title';
|
||||
import type { DocMode, ReferenceParams } from '@blocksuite/affine/model';
|
||||
import { HighlightSelection } from '@blocksuite/affine/shared/selection';
|
||||
import { FeatureFlagService as BSFeatureFlagService } from '@blocksuite/affine/shared/services';
|
||||
import type { InlineEditor } from '@blocksuite/inline';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { Entity, LiveData, MemoryMemento } from '@toeverything/infra';
|
||||
|
||||
export class GlobalContext extends Entity {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MarkdownTransformer } from '@blocksuite/affine/blocks';
|
||||
import { MarkdownTransformer } from '@blocksuite/affine/blocks/root';
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
import { DocsService } from '../../doc';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type DocMode, ZipTransformer } from '@blocksuite/affine/blocks';
|
||||
import { ZipTransformer } from '@blocksuite/affine/blocks/root';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
import { DocsService } from '../../doc';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { channelToScheme } from '@affine/core/utils';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/blocks';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/model';
|
||||
import { isNil, pick, pickBy } from 'lodash-es';
|
||||
import type { ParsedQuery, ParseOptions } from 'query-string';
|
||||
import queryString from 'query-string';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/blocks';
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/model';
|
||||
import { Entity, LiveData, ObjectPool } from '@toeverything/infra';
|
||||
import { catchError, from, map, of, startWith, switchMap } from 'rxjs';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/blocks';
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/model';
|
||||
|
||||
export async function downloadBlobToBuffer(model: AttachmentBlockModel) {
|
||||
const sourceId = model.sourceId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/blocks';
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/model';
|
||||
import { ObjectPool, Service } from '@toeverything/infra';
|
||||
|
||||
import { PDF } from '../entities/pdf';
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { BlockComponent, EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type { SurfaceRefBlockComponent } from '@blocksuite/affine/blocks/surface-ref';
|
||||
import type {
|
||||
AttachmentBlockModel,
|
||||
DocMode,
|
||||
EmbedLinkedDocModel,
|
||||
EmbedSyncedDocModel,
|
||||
ImageBlockModel,
|
||||
SurfaceRefBlockComponent,
|
||||
SurfaceRefBlockModel,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { AffineReference } from '@blocksuite/affine/blocks';
|
||||
} from '@blocksuite/affine/model';
|
||||
import { AffineReference } from '@blocksuite/affine/rich-text';
|
||||
import type { Block, BlockModel } from '@blocksuite/affine/store';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/blocks';
|
||||
import type { AttachmentBlockModel } from '@blocksuite/affine/model';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { AttachmentViewer } from '../../../../components/attachment-viewer';
|
||||
|
||||
@@ -9,12 +9,12 @@ import { EditorService } from '@affine/core/modules/editor';
|
||||
import { GuardService } from '@affine/core/modules/permissions';
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/affine/block-std/gfx';
|
||||
import { RefNodeSlotsProvider } from '@blocksuite/affine/blocks';
|
||||
import { Bound } from '@blocksuite/affine/global/gfx';
|
||||
import {
|
||||
type Disposable,
|
||||
DisposableGroup,
|
||||
} from '@blocksuite/affine/global/slot';
|
||||
import { RefNodeSlotsProvider } from '@blocksuite/affine/rich-text';
|
||||
import {
|
||||
FrameworkScope,
|
||||
useLiveData,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Divider, Loading, toast } from '@affine/component';
|
||||
import { Button, IconButton } from '@affine/component/ui/button';
|
||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { ImageBlockModel } from '@blocksuite/affine/blocks';
|
||||
import type { ImageBlockModel } from '@blocksuite/affine/model';
|
||||
import type { BlockModel, Workspace } from '@blocksuite/affine/store';
|
||||
import {
|
||||
ArrowLeftSmallIcon,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { IconButton } from '@affine/component';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import track from '@affine/track';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import {
|
||||
CloseIcon,
|
||||
ExpandFullIcon,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DefaultOpenProperty } from '@affine/core/components/doc-properties';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
type CommandCategory,
|
||||
PreconditionStrategy,
|
||||
} from '@affine/core/commands';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import Fuse from 'fuse.js';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { NewXxxEdgelessIcon, NewXxxPageIcon } from '@blocksuite/icons/rc';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ReferenceParams } from '@blocksuite/affine/blocks';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/model';
|
||||
import { BlockLinkIcon, EdgelessIcon, PageIcon } from '@blocksuite/icons/rc';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import { omit, truncate } from 'lodash-es';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from '@affine/core/components/hooks/affine/use-share-url';
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import type { DocMode } from '@blocksuite/affine/model';
|
||||
import { BlockIcon, EdgelessIcon, PageIcon } from '@blocksuite/icons/rc';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import clsx from 'clsx';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { toURLSearchParams } from '@affine/core/modules/navigation/utils';
|
||||
import { Unreachable } from '@affine/env/constant';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/blocks';
|
||||
import type { ReferenceParams } from '@blocksuite/affine/model';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import { type To } from 'history';
|
||||
import { omit } from 'lodash-es';
|
||||
|
||||
Reference in New Issue
Block a user