mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 00:07:01 +08:00
feat(editor): selection as store extension (#9605)
This commit is contained in:
@@ -27,6 +27,10 @@ import {
|
||||
RefNodeSlotsExtension,
|
||||
RichTextExtensions,
|
||||
} from '@blocksuite/affine-components/rich-text';
|
||||
import {
|
||||
HighlightSelectionExtension,
|
||||
ImageSelectionExtension,
|
||||
} from '@blocksuite/affine-shared/selection';
|
||||
import {
|
||||
DefaultOpenDocExtension,
|
||||
DocDisplayMetaService,
|
||||
@@ -34,6 +38,13 @@ import {
|
||||
FeatureFlagService,
|
||||
FontLoaderService,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
BlockSelectionExtension,
|
||||
CursorSelectionExtension,
|
||||
SurfaceSelectionExtension,
|
||||
TextSelectionExtension,
|
||||
} from '@blocksuite/block-std';
|
||||
import { DatabaseSelectionExtension } from '@blocksuite/data-view';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { AdapterFactoryExtensions } from '../_common/adapters/extension.js';
|
||||
@@ -77,4 +88,13 @@ export const EdgelessFirstPartyBlockSpecs: ExtensionType[] = [
|
||||
FontLoaderService,
|
||||
].flat();
|
||||
|
||||
export const StoreExtensions: ExtensionType[] = [FeatureFlagService];
|
||||
export const StoreExtensions: ExtensionType[] = [
|
||||
FeatureFlagService,
|
||||
BlockSelectionExtension,
|
||||
TextSelectionExtension,
|
||||
SurfaceSelectionExtension,
|
||||
CursorSelectionExtension,
|
||||
HighlightSelectionExtension,
|
||||
ImageSelectionExtension,
|
||||
DatabaseSelectionExtension,
|
||||
];
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
getPageRootByElement,
|
||||
stopPropagation,
|
||||
} from '@blocksuite/affine-shared/utils';
|
||||
import type { BaseSelection } from '@blocksuite/block-std';
|
||||
import { WidgetComponent } from '@blocksuite/block-std';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { BaseSelection } from '@blocksuite/store';
|
||||
import {
|
||||
autoPlacement,
|
||||
autoUpdate,
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
|
||||
import { matchFlavours } from '@blocksuite/affine-shared/utils';
|
||||
import {
|
||||
type BaseSelection,
|
||||
type BlockComponent,
|
||||
BlockSelection,
|
||||
CursorSelection,
|
||||
@@ -22,6 +21,7 @@ import {
|
||||
DisposableGroup,
|
||||
nextTick,
|
||||
} from '@blocksuite/global/utils';
|
||||
import type { BaseSelection } from '@blocksuite/store';
|
||||
import {
|
||||
autoUpdate,
|
||||
computePosition,
|
||||
|
||||
Reference in New Issue
Block a user