mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
feat(editor): slash menu and toolbar widget extensions (#12002)
Closes: BS-3226 Closes: BS-3227 Closes: BS-3228 Closes: BS-3229 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new view extensions for remote selection, scroll anchoring, slash menu, and toolbar widgets, enhancing customization and integration capabilities. - **Refactor** - Updated export paths and module structure for widget-related packages to improve modularity and accessibility. - Reorganized internal dependencies and removed redundant widget imports from core block packages. - Refactored edgeless-related widgets and components to use a standardized scope interface for improved context and state management. - Centralized graphics controller access and slot management through standardized context objects. - **Chores** - Added and updated dependencies to streamline extension loading and workspace management. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
type ViewExtensionContext,
|
||||
ViewExtensionProvider,
|
||||
} from '@blocksuite/affine-ext-loader';
|
||||
|
||||
import { effects } from './effects';
|
||||
import {
|
||||
docRemoteSelectionWidget,
|
||||
edgelessRemoteSelectionWidget,
|
||||
} from './index';
|
||||
|
||||
export class RemoteSelectionViewExtension extends ViewExtensionProvider {
|
||||
override name = 'affine-remote-selection-widget';
|
||||
|
||||
override effect() {
|
||||
super.effect();
|
||||
effects();
|
||||
}
|
||||
|
||||
override setup(context: ViewExtensionContext) {
|
||||
super.setup(context);
|
||||
context.register(docRemoteSelectionWidget);
|
||||
if (context.scope === 'edgeless') {
|
||||
context.register(edgelessRemoteSelectionWidget);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user