mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
refactor(editor): remove blocks package (#10708)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
createSignalFromObservable,
|
||||
type Signal,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
} from '@blocksuite/affine/shared/utils';
|
||||
import { LiveData, Service } from '@toeverything/infra';
|
||||
|
||||
import type { FeatureFlagService } from '../../feature-flag';
|
||||
|
||||
@@ -7,11 +7,11 @@ 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,
|
||||
type DragBlockPayload,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
} from '@blocksuite/affine/shared/services';
|
||||
import { type SliceSnapshot } from '@blocksuite/affine/store';
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
LinkedMenuGroup,
|
||||
LinkedMenuItem,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { createSignalFromObservable } from '@blocksuite/affine/blocks';
|
||||
import { createSignalFromObservable } from '@blocksuite/affine/shared/utils';
|
||||
import type { DocMeta } from '@blocksuite/affine/store';
|
||||
import { computed } from '@preact/signals-core';
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { Unreachable } from '@affine/env/constant';
|
||||
import {
|
||||
type AffineTextAttributes,
|
||||
type DocMode,
|
||||
replaceIdMiddleware,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { type DocMode, replaceIdMiddleware } from '@blocksuite/affine/blocks';
|
||||
import type { DeltaInsert } from '@blocksuite/affine/inline';
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine/shared/types';
|
||||
import { Slice, Text, Transformer } from '@blocksuite/affine/store';
|
||||
import { LiveData, ObjectPool, Service } from '@toeverything/infra';
|
||||
import { omitBy } from 'lodash-es';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type {
|
||||
AffineTextAttributes,
|
||||
AttachmentBlockModel,
|
||||
BookmarkBlockModel,
|
||||
EmbedBlockModel,
|
||||
@@ -14,6 +13,7 @@ import {
|
||||
TableModelFlavour,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { Container } from '@blocksuite/affine/global/di';
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine/shared/types';
|
||||
import {
|
||||
createYProxy,
|
||||
type DraftModel,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { DeepPartial } from '@blocksuite/affine/global/utils';
|
||||
import {
|
||||
createSignalFromObservable,
|
||||
type Signal,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { DeepPartial } from '@blocksuite/affine/global/utils';
|
||||
} from '@blocksuite/affine/shared/utils';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import { isObject, merge } from 'lodash-es';
|
||||
import type { Observable } from 'rxjs';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GeneralSettingSchema } from '@blocksuite/affine/blocks';
|
||||
import { GeneralSettingSchema } from '@blocksuite/affine/shared/services';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const BSEditorSettingSchema = GeneralSettingSchema;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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,
|
||||
type DocTitle,
|
||||
FeatureFlagService as BSFeatureFlagService,
|
||||
HighlightSelection,
|
||||
type ReferenceParams,
|
||||
import type {
|
||||
DocMode,
|
||||
DocTitle,
|
||||
ReferenceParams,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { HighlightSelection } from '@blocksuite/affine/shared/selection';
|
||||
import { FeatureFlagService as BSFeatureFlagService } from '@blocksuite/affine/shared/services';
|
||||
import type { InlineEditor } from '@blocksuite/inline';
|
||||
import { effect } from '@preact/signals-core';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BlockSuiteFlags } from '@blocksuite/affine/blocks';
|
||||
import type { BlockSuiteFlags } from '@blocksuite/affine/shared/services';
|
||||
|
||||
type FeedbackType = 'discord' | 'email' | 'github';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { AIChatBlockModel } from '@affine/core/blocksuite/ai/blocks/ai-chat
|
||||
import { enableFootnoteConfigExtension } from '@affine/core/blocksuite/extensions';
|
||||
import { AINetworkSearchService } from '@affine/core/modules/ai-button/services/network-search';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import { SpecProvider } from '@blocksuite/affine/blocks';
|
||||
import { SpecProvider } from '@blocksuite/affine/shared/utils';
|
||||
import { useFramework } from '@toeverything/infra';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AIChatBlockSchema } from '@affine/core/blocksuite/ai/blocks/ai-chat-block/model';
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
||||
import { AffineSchemas } from '@blocksuite/affine/schemas';
|
||||
import { Schema } from '@blocksuite/affine/store';
|
||||
|
||||
let _schema: Schema | null = null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SpecProvider } from '@blocksuite/affine/blocks';
|
||||
import { Slot } from '@blocksuite/affine/global/slot';
|
||||
import { SpecProvider } from '@blocksuite/affine/shared/utils';
|
||||
import {
|
||||
AwarenessStore,
|
||||
type Doc,
|
||||
|
||||
Reference in New Issue
Block a user