mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
d82d37b53d
Closes: BS-3364 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new "Page Dragging Area" widget, enabling enhanced block selection and drag area detection within the user interface. - Added utilities for more precise block selection based on rectangular selection areas. - **Improvements** - Integrated the new widget into the view extension system for consistent behavior across supported views. - Enhanced clipboard handling with comprehensive adapter configurations for various data types. - **Refactor** - Streamlined widget registration and block selection logic for improved maintainability and modularity. - Removed legacy widget exports and registrations to centralize widget management. - **Chores** - Updated workspace and TypeScript configurations to support the new widget module. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
25 lines
574 B
TypeScript
25 lines
574 B
TypeScript
import {
|
|
type ViewExtensionContext,
|
|
ViewExtensionProvider,
|
|
} from '@blocksuite/affine-ext-loader';
|
|
|
|
import { effects } from './effects';
|
|
import { pageDraggingAreaWidget } from './index';
|
|
|
|
export class PageDraggingAreaViewExtension extends ViewExtensionProvider {
|
|
override name = 'affine-page-dragging-area-widget';
|
|
|
|
override effect() {
|
|
super.effect();
|
|
effects();
|
|
}
|
|
|
|
override setup(context: ViewExtensionContext) {
|
|
super.setup(context);
|
|
if (this.isEdgeless(context.scope)) {
|
|
return;
|
|
}
|
|
context.register(pageDraggingAreaWidget);
|
|
}
|
|
}
|