mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 22:07:09 +08:00
refactor(editor): move extension to store (#9552)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import { sha } from '@blocksuite/global/utils';
|
||||
import {
|
||||
@@ -6,6 +5,7 @@ import {
|
||||
BaseAdapter,
|
||||
type BlockSnapshot,
|
||||
type DocSnapshot,
|
||||
type ExtensionType,
|
||||
type FromBlockSnapshotPayload,
|
||||
type FromBlockSnapshotResult,
|
||||
type FromDocSnapshotPayload,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { BlockAdapterMatcher } from '../types/adapter.js';
|
||||
import type { HtmlAST } from '../types/hast.js';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import type { DeltaInsert } from '@blocksuite/inline';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { AffineTextAttributes } from '../../types/index.js';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DefaultTheme, NoteDisplayMode } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { ServiceProvider } from '@blocksuite/global/di';
|
||||
import {
|
||||
type AssetsManager,
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
type BlockSnapshot,
|
||||
BlockSnapshotSchema,
|
||||
type DocSnapshot,
|
||||
type ExtensionType,
|
||||
type FromBlockSnapshotPayload,
|
||||
type FromBlockSnapshotResult,
|
||||
type FromDocSnapshotPayload,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import { sha } from '@blocksuite/global/utils';
|
||||
import {
|
||||
@@ -6,6 +5,7 @@ import {
|
||||
BaseAdapter,
|
||||
type BlockSnapshot,
|
||||
type DocSnapshot,
|
||||
type ExtensionType,
|
||||
type FromBlockSnapshotPayload,
|
||||
type FromBlockSnapshotResult,
|
||||
type FromDocSnapshotPayload,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { BlockAdapterMatcher } from '../types/adapter.js';
|
||||
import type { MarkdownDeltaConverter } from './delta-converter.js';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import type { DeltaInsert } from '@blocksuite/inline/types';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import type { PhrasingContent } from 'mdast';
|
||||
|
||||
import type { AffineTextAttributes } from '../../types/index.js';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DefaultTheme, NoteDisplayMode } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { ServiceProvider } from '@blocksuite/global/di';
|
||||
import {
|
||||
type AssetsManager,
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
type BlockSnapshot,
|
||||
BlockSnapshotSchema,
|
||||
type DocSnapshot,
|
||||
type ExtensionType,
|
||||
type FromBlockSnapshotPayload,
|
||||
type FromBlockSnapshotResult,
|
||||
type FromDocSnapshotPayload,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { BlockAdapterMatcher } from '../types/adapter.js';
|
||||
import type { HtmlAST } from '../types/hast.js';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import { isEqual } from '@blocksuite/global/utils';
|
||||
import type { DeltaInsert } from '@blocksuite/inline';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { AffineTextAttributes } from '../../types/index.js';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DefaultTheme, NoteDisplayMode } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { ServiceProvider } from '@blocksuite/global/di';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import {
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
BaseAdapter,
|
||||
type BlockSnapshot,
|
||||
type DocSnapshot,
|
||||
type ExtensionType,
|
||||
type FromBlockSnapshotPayload,
|
||||
type FromBlockSnapshotResult,
|
||||
type FromDocSnapshotPayload,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DefaultTheme } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import type { DeltaInsert } from '@blocksuite/inline';
|
||||
import {
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
BaseAdapter,
|
||||
type BlockSnapshot,
|
||||
type DocSnapshot,
|
||||
type ExtensionType,
|
||||
type FromBlockSnapshotResult,
|
||||
type FromDocSnapshotResult,
|
||||
type FromSliceSnapshotResult,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { BlockAdapterMatcher, TextBuffer } from '../types/adapter.js';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import {
|
||||
createIdentifier,
|
||||
type ServiceIdentifier,
|
||||
} from '@blocksuite/global/di';
|
||||
import type { DeltaInsert } from '@blocksuite/inline';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { AffineTextAttributes } from '../../types/index.js';
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DefaultTheme, NoteDisplayMode } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { ServiceProvider } from '@blocksuite/global/di';
|
||||
import {
|
||||
type AssetsManager,
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
type BlockSnapshot,
|
||||
BlockSnapshotSchema,
|
||||
type DocSnapshot,
|
||||
type ExtensionType,
|
||||
type FromBlockSnapshotPayload,
|
||||
type FromBlockSnapshotResult,
|
||||
type FromDocSnapshotPayload,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { DocMode } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { Extension } from '@blocksuite/block-std';
|
||||
import type { Container } from '@blocksuite/global/di';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import { type Disposable, noop, Slot } from '@blocksuite/global/utils';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { Extension } from '@blocksuite/store';
|
||||
|
||||
const DEFAULT_MODE: DocMode = 'page';
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import {
|
||||
type BlockStdScope,
|
||||
Extension,
|
||||
StdIdentifier,
|
||||
} from '@blocksuite/block-std';
|
||||
import { type BlockStdScope, StdIdentifier } from '@blocksuite/block-std';
|
||||
import { type Container, createIdentifier } from '@blocksuite/global/di';
|
||||
import { Slice, type SliceSnapshot } from '@blocksuite/store';
|
||||
import { Extension, Slice, type SliceSnapshot } from '@blocksuite/store';
|
||||
|
||||
export const DndApiExtensionIdentifier = createIdentifier<DNDAPIExtension>(
|
||||
'AffineDndApiIdentifier'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import type { DeepPartial } from '@blocksuite/global/utils';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import type { Signal } from '@preact/signals-core';
|
||||
import { z } from 'zod';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { EmbedCardStyle } from '@blocksuite/affine-model';
|
||||
import { Extension } from '@blocksuite/block-std';
|
||||
import type { Container } from '@blocksuite/global/di';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import { Extension } from '@blocksuite/store';
|
||||
|
||||
export type EmbedOptions = {
|
||||
flavour: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { type ExtensionType, LifeCycleWatcher } from '@blocksuite/block-std';
|
||||
import { LifeCycleWatcher } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import { IS_FIREFOX } from '@blocksuite/global/env';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { FontConfig } from './config.js';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ReferenceParams } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
export interface GenerateDocUrlService {
|
||||
generateDocUrl: (docId: string, params?: ReferenceParams) => string | void;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
export interface NotificationService {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import { Slot } from '@blocksuite/global/utils';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { Viewport } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ReferenceParams } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
export interface ParseDocUrlService {
|
||||
parseDocUrl: (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ReferenceParams } from '@blocksuite/affine-model';
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
export interface QuickSearchService {
|
||||
openQuickSearch: () => Promise<QuickSearchResult>;
|
||||
|
||||
@@ -4,13 +4,9 @@ import {
|
||||
DefaultTheme,
|
||||
resolveColor,
|
||||
} from '@blocksuite/affine-model';
|
||||
import {
|
||||
type BlockStdScope,
|
||||
Extension,
|
||||
type ExtensionType,
|
||||
StdIdentifier,
|
||||
} from '@blocksuite/block-std';
|
||||
import { type BlockStdScope, StdIdentifier } from '@blocksuite/block-std';
|
||||
import { type Container, createIdentifier } from '@blocksuite/global/di';
|
||||
import { Extension, type ExtensionType } from '@blocksuite/store';
|
||||
import { type Signal, signal } from '@preact/signals-core';
|
||||
import {
|
||||
type AffineCssVariables,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
export class SpecBuilder {
|
||||
private _value: ExtensionType[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ExtensionType } from '@blocksuite/block-std';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { SpecBuilder } from './spec-builder.js';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user