mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 04:36:13 +08:00
4c84e6bac7
Closes: BS-3368 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new link tool extension, enabling enhanced link-related functionality within the edgeless workspace. - Added a new view extension for link tools, improving integration and usability in edgeless mode. - **Chores** - Added a new package for link tool functionality with appropriate dependencies and exports. - Registered new custom elements for edgeless toolbars and link tools to support modular UI components. - Updated project configurations and workspace dependencies to include the new link tool module. - **Refactor** - Removed unused quick tool exports and toolbar component registrations to streamline the edgeless extension codebase. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
72 lines
2.2 KiB
TypeScript
72 lines
2.2 KiB
TypeScript
import { EdgelessAutoCompletePanel } from './edgeless/components/auto-complete/auto-complete-panel.js';
|
|
import { EdgelessAutoComplete } from './edgeless/components/auto-complete/edgeless-auto-complete.js';
|
|
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 {
|
|
EDGELESS_SELECTED_RECT_WIDGET,
|
|
EdgelessSelectedRectWidget,
|
|
} from './edgeless/components/rects/edgeless-selected-rect.js';
|
|
import {
|
|
EdgelessRootBlockComponent,
|
|
EdgelessRootPreviewBlockComponent,
|
|
PageRootBlockComponent,
|
|
PreviewRootBlockComponent,
|
|
} from './index.js';
|
|
|
|
export function effects() {
|
|
// Register components by category
|
|
registerRootComponents();
|
|
registerMiscComponents();
|
|
}
|
|
|
|
function registerRootComponents() {
|
|
customElements.define('affine-page-root', PageRootBlockComponent);
|
|
customElements.define('affine-preview-root', PreviewRootBlockComponent);
|
|
customElements.define('affine-edgeless-root', EdgelessRootBlockComponent);
|
|
customElements.define(
|
|
'affine-edgeless-root-preview',
|
|
EdgelessRootPreviewBlockComponent
|
|
);
|
|
}
|
|
|
|
function registerMiscComponents() {
|
|
// Auto-complete components
|
|
customElements.define(
|
|
'edgeless-auto-complete-panel',
|
|
EdgelessAutoCompletePanel
|
|
);
|
|
customElements.define('edgeless-auto-complete', EdgelessAutoComplete);
|
|
|
|
// Note and template components
|
|
customElements.define(NOTE_SLICER_WIDGET, NoteSlicer);
|
|
|
|
// Dragging area components
|
|
customElements.define(
|
|
EDGELESS_DRAGGING_AREA_WIDGET,
|
|
EdgelessDraggingAreaRectWidget
|
|
);
|
|
customElements.define(
|
|
EDGELESS_SELECTED_RECT_WIDGET,
|
|
EdgelessSelectedRectWidget
|
|
);
|
|
}
|
|
|
|
declare global {
|
|
interface HTMLElementTagNameMap {
|
|
'affine-edgeless-root': EdgelessRootBlockComponent;
|
|
'affine-edgeless-root-preview': EdgelessRootPreviewBlockComponent;
|
|
'edgeless-auto-complete-panel': EdgelessAutoCompletePanel;
|
|
'edgeless-auto-complete': EdgelessAutoComplete;
|
|
'note-slicer': NoteSlicer;
|
|
'edgeless-dragging-area-rect': EdgelessDraggingAreaRectWidget;
|
|
'edgeless-selected-rect': EdgelessSelectedRectWidget;
|
|
'affine-page-root': PageRootBlockComponent;
|
|
}
|
|
}
|