mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
refactor(editor): move extension to store (#9552)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
BlockStdScope,
|
||||
type EditorHost,
|
||||
type ExtensionType,
|
||||
ShadowlessElement,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import type {
|
||||
@@ -21,6 +20,7 @@ import { Container, type ServiceProvider } from '@blocksuite/affine/global/di';
|
||||
import { WithDisposable } from '@blocksuite/affine/global/utils';
|
||||
import {
|
||||
type Blocks,
|
||||
type ExtensionType,
|
||||
type JobMiddleware,
|
||||
type Query,
|
||||
type Schema,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
BlockViewIdentifier,
|
||||
type ExtensionType,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import { BlockViewIdentifier } from '@blocksuite/affine/block-std';
|
||||
import { PageEditorBlockSpecs } from '@blocksuite/affine/blocks';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
export const CustomPageEditorBlockSpecs: ExtensionType[] = [
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
BlockServiceWatcher,
|
||||
type ExtensionType,
|
||||
WidgetViewMapIdentifier,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
@@ -23,6 +22,7 @@ import {
|
||||
ParagraphBlockSpec,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { assertInstanceOf } from '@blocksuite/affine/global/utils';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import { literal, unsafeStatic } from 'lit/static-html.js';
|
||||
|
||||
import { buildAIPanelConfig } from './ai-panel';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
BlockViewExtension,
|
||||
type ExtensionType,
|
||||
FlavourExtension,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
@@ -10,7 +9,7 @@ import {
|
||||
SurfaceBlockSchema,
|
||||
ThemeService,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { BlockSchema } from '@blocksuite/affine/store';
|
||||
import type { BlockSchema, ExtensionType } from '@blocksuite/affine/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
import type { z } from 'zod';
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
BlockViewExtension,
|
||||
type ExtensionType,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import { BlockViewExtension } from '@blocksuite/affine/block-std';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
export const AIChatBlockSpec: ExtensionType[] = [
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
AIParagraphBlockSpec,
|
||||
} from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/presets/blocks/ai-chat-block';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import {
|
||||
AdapterFactoryExtensions,
|
||||
AttachmentBlockSpec,
|
||||
@@ -23,6 +22,7 @@ import {
|
||||
RefNodeSlotsExtension,
|
||||
RichTextExtensions,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
|
||||
const CommonBlockSpecs: ExtensionType[] = [
|
||||
RefNodeSlotsExtension,
|
||||
|
||||
@@ -11,7 +11,6 @@ import { AppThemeService } from '@affine/core/modules/theme';
|
||||
import { mixpanel } from '@affine/track';
|
||||
import {
|
||||
ConfigExtension,
|
||||
type ExtensionType,
|
||||
LifeCycleWatcher,
|
||||
StdIdentifier,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
@@ -33,6 +32,7 @@ import {
|
||||
TelemetryProvider,
|
||||
ThemeExtensionIdentifier,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import {
|
||||
createSignalFromObservable,
|
||||
referenceToNode,
|
||||
|
||||
@@ -32,7 +32,6 @@ import {
|
||||
BlockServiceWatcher,
|
||||
BlockViewIdentifier,
|
||||
ConfigIdentifier,
|
||||
type ExtensionType,
|
||||
type WidgetComponent,
|
||||
} from '@blocksuite/affine/block-std';
|
||||
import type {
|
||||
@@ -60,7 +59,11 @@ import {
|
||||
ReferenceNodeConfigExtension,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { Bound } from '@blocksuite/affine/global/utils';
|
||||
import { type BlockSnapshot, Text } from '@blocksuite/affine/store';
|
||||
import {
|
||||
type BlockSnapshot,
|
||||
type ExtensionType,
|
||||
Text,
|
||||
} from '@blocksuite/affine/store';
|
||||
import type { ReferenceParams } from '@blocksuite/affine-model';
|
||||
import { type FrameworkProvider } from '@toeverything/infra';
|
||||
import { type TemplateResult } from 'lit';
|
||||
|
||||
@@ -2,13 +2,13 @@ import { AIEdgelessRootBlockSpec } from '@affine/core/blocksuite/presets/ai';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import { builtInTemplates as builtInEdgelessTemplates } from '@affine/templates/edgeless';
|
||||
import { builtInTemplates as builtInStickersTemplates } from '@affine/templates/stickers';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import type { TemplateManager } from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
EdgelessRootBlockSpec,
|
||||
EdgelessTemplatePanel,
|
||||
SpecProvider,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import { type FrameworkProvider } from '@toeverything/infra';
|
||||
|
||||
import { enableAffineExtension, enableAIExtension } from './custom/root-block';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { AIPageRootBlockSpec } from '@affine/core/blocksuite/presets/ai';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import { PageRootBlockSpec, SpecProvider } from '@blocksuite/affine/blocks';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
import { type FrameworkProvider } from '@toeverything/infra';
|
||||
|
||||
import { enableAffineExtension, enableAIExtension } from './custom/root-block';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AIChatBlockSpec } from '@affine/core/blocksuite/presets/blocks/ai-chat-block';
|
||||
import type { ExtensionType } from '@blocksuite/affine/block-std';
|
||||
import { SpecProvider } from '@blocksuite/affine/blocks';
|
||||
import type { ExtensionType } from '@blocksuite/affine/store';
|
||||
|
||||
import { getFontConfigExtension } from './font-extension';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user