mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
refactor(editor): extract widgets (#12304)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced two new widgets: Edgeless Dragging Area and Note Slicer, now available for use. - Added extension support for these widgets, enabling enhanced interaction and integration within the application. - **Chores** - Updated package configurations and workspace settings to include the new widgets and their dependencies. - Added project references and configuration files to support modular development and build processes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
import {
|
||||
NOTE_SLICER_WIDGET,
|
||||
NoteSlicer,
|
||||
} from './edgeless/components/note-slicer/index.js';
|
||||
import {
|
||||
EDGELESS_DRAGGING_AREA_WIDGET,
|
||||
EdgelessDraggingAreaRectWidget,
|
||||
} from './edgeless/components/rects/edgeless-dragging-area-rect.js';
|
||||
import {
|
||||
EdgelessRootBlockComponent,
|
||||
EdgelessRootPreviewBlockComponent,
|
||||
@@ -16,7 +8,6 @@ import {
|
||||
export function effects() {
|
||||
// Register components by category
|
||||
registerRootComponents();
|
||||
registerMiscComponents();
|
||||
}
|
||||
|
||||
function registerRootComponents() {
|
||||
@@ -29,23 +20,9 @@ function registerRootComponents() {
|
||||
);
|
||||
}
|
||||
|
||||
function registerMiscComponents() {
|
||||
// Note and template components
|
||||
customElements.define(NOTE_SLICER_WIDGET, NoteSlicer);
|
||||
|
||||
// Dragging area components
|
||||
customElements.define(
|
||||
EDGELESS_DRAGGING_AREA_WIDGET,
|
||||
EdgelessDraggingAreaRectWidget
|
||||
);
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'affine-edgeless-root': EdgelessRootBlockComponent;
|
||||
'affine-edgeless-root-preview': EdgelessRootPreviewBlockComponent;
|
||||
'note-slicer': NoteSlicer;
|
||||
'edgeless-dragging-area-rect': EdgelessDraggingAreaRectWidget;
|
||||
'affine-page-root': PageRootBlockComponent;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user