File tree Expand file tree Collapse file tree 13 files changed +103
-0
lines changed
Expand file tree Collapse file tree 13 files changed +103
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "name" : " @blocksuite/affine-widget-toolbar" ,
3+ "description" : " Affine toolbar widget." ,
4+ "type" : " module" ,
5+ "scripts" : {
6+ "build" : " tsc" ,
7+ "test:unit" : " nx vite:test --run --passWithNoTests" ,
8+ "test:unit:coverage" : " nx vite:test --run --coverage" ,
9+ "test:e2e" : " playwright test"
10+ },
11+ "sideEffects" : false ,
12+ "keywords" : [],
13+ "author" : " toeverything" ,
14+ "license" : " MIT" ,
15+ "dependencies" : {
16+ "@blocksuite/affine-model" : " workspace:*" ,
17+ "@blocksuite/affine-shared" : " workspace:*" ,
18+ "@blocksuite/block-std" : " workspace:*" ,
19+ "@blocksuite/global" : " workspace:*" ,
20+ "@preact/signals-core" : " ^1.8.0" ,
21+ "@toeverything/theme" : " ^1.1.3" ,
22+ "lit" : " ^3.2.0"
23+ },
24+ "exports" : {
25+ "." : " ./src/index.ts" ,
26+ "./effects" : " ./src/effects.ts"
27+ },
28+ "files" : [
29+ " src" ,
30+ " dist" ,
31+ " !src/__tests__" ,
32+ " !dist/__tests__"
33+ ],
34+ "version" : " 0.19.0"
35+ }
Original file line number Diff line number Diff line change 1+ import { AFFINE_TOOLBAR_WIDGET , AffineToolbarWidget } from './toolbar' ;
2+
3+ export function effects ( ) {
4+ customElements . define ( AFFINE_TOOLBAR_WIDGET , AffineToolbarWidget ) ;
5+ }
6+
7+ declare global {
8+ interface HTMLElementTagNameMap {
9+ [ AFFINE_TOOLBAR_WIDGET ] : AffineToolbarWidget ;
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ export * from './toolbar' ;
Original file line number Diff line number Diff line change 1+ import { WidgetComponent } from '@blocksuite/block-std' ;
2+
3+ export const AFFINE_TOOLBAR_WIDGET = 'affine-toolbar-widget' ;
4+
5+ export class AffineToolbarWidget extends WidgetComponent { }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ../../tsconfig.json" ,
3+ "compilerOptions" : {
4+ "rootDir" : " ./src/" ,
5+ "outDir" : " ./dist/" ,
6+ "noEmit" : false
7+ },
8+ "include" : [" ./src" ],
9+ "references" : [
10+ { "path" : " ../model" },
11+ { "path" : " ../shared" },
12+ { "path" : " ../../framework/block-std" },
13+ { "path" : " ../../framework/global" }
14+ ]
15+ }
Original file line number Diff line number Diff line change 3737 "@blocksuite/affine-widget-frame-title" : " workspace:*" ,
3838 "@blocksuite/affine-widget-remote-selection" : " workspace:*" ,
3939 "@blocksuite/affine-widget-scroll-anchoring" : " workspace:*" ,
40+ "@blocksuite/affine-widget-toolbar" : " workspace:*" ,
4041 "@blocksuite/block-std" : " workspace:*" ,
4142 "@blocksuite/data-view" : " workspace:*" ,
4243 "@blocksuite/global" : " workspace:*" ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import { effects as widgetDragHandleEffects } from '@blocksuite/affine-widget-dr
3434import { effects as widgetFrameTitleEffects } from '@blocksuite/affine-widget-frame-title/effects' ;
3535import { effects as widgetRemoteSelectionEffects } from '@blocksuite/affine-widget-remote-selection/effects' ;
3636import { effects as widgetScrollAnchoringEffects } from '@blocksuite/affine-widget-scroll-anchoring/effects' ;
37+ import { effects as widgetToolbarEffects } from '@blocksuite/affine-widget-toolbar/effects' ;
3738import type { BlockComponent } from '@blocksuite/block-std' ;
3839import { effects as stdEffects } from '@blocksuite/block-std/effects' ;
3940import { effects as dataViewEffects } from '@blocksuite/data-view/effects' ;
@@ -223,6 +224,7 @@ export function effects() {
223224 widgetEdgelessElementToolbarEffects ( ) ;
224225 widgetRemoteSelectionEffects ( ) ;
225226 widgetDragHandleEffects ( ) ;
227+ widgetToolbarEffects ( ) ;
226228 dataViewEffects ( ) ;
227229
228230 customElements . define ( 'affine-page-root' , PageRootBlockComponent ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313 AFFINE_EDGELESS_REMOTE_SELECTION_WIDGET ,
1414} from '@blocksuite/affine-widget-remote-selection' ;
1515import { AFFINE_SCROLL_ANCHORING_WIDGET } from '@blocksuite/affine-widget-scroll-anchoring' ;
16+ import { AFFINE_TOOLBAR_WIDGET } from '@blocksuite/affine-widget-toolbar' ;
1617import {
1718 BlockServiceWatcher ,
1819 BlockViewExtension ,
@@ -80,6 +81,7 @@ export const edgelessRootWidgetViewMap = {
8081 AFFINE_EDGELESS_AUTO_CONNECT_WIDGET
8182 ) } `,
8283 [ AFFINE_SCROLL_ANCHORING_WIDGET ] : literal `${ unsafeStatic ( AFFINE_SCROLL_ANCHORING_WIDGET ) } ` ,
84+ [ AFFINE_TOOLBAR_WIDGET ] : literal `${ unsafeStatic ( AFFINE_TOOLBAR_WIDGET ) } ` ,
8385 [ EDGELESS_DRAGGING_AREA_WIDGET ] : literal `${ unsafeStatic ( EDGELESS_DRAGGING_AREA_WIDGET ) } ` ,
8486 [ NOTE_SLICER_WIDGET ] : literal `${ unsafeStatic ( NOTE_SLICER_WIDGET ) } ` ,
8587 [ EDGELESS_NAVIGATOR_BLACK_BACKGROUND_WIDGET ] : literal `${ unsafeStatic ( EDGELESS_NAVIGATOR_BLACK_BACKGROUND_WIDGET ) } ` ,
Original file line number Diff line number Diff line change 99import { AFFINE_DRAG_HANDLE_WIDGET } from '@blocksuite/affine-widget-drag-handle' ;
1010import { AFFINE_DOC_REMOTE_SELECTION_WIDGET } from '@blocksuite/affine-widget-remote-selection' ;
1111import { AFFINE_SCROLL_ANCHORING_WIDGET } from '@blocksuite/affine-widget-scroll-anchoring' ;
12+ import { AFFINE_TOOLBAR_WIDGET } from '@blocksuite/affine-widget-toolbar' ;
1213import {
1314 BlockViewExtension ,
1415 CommandExtension ,
@@ -61,6 +62,7 @@ export const pageRootWidgetViewMap = {
6162 AFFINE_VIEWPORT_OVERLAY_WIDGET
6263 ) } `,
6364 [ AFFINE_SCROLL_ANCHORING_WIDGET ] : literal `${ unsafeStatic ( AFFINE_SCROLL_ANCHORING_WIDGET ) } ` ,
65+ [ AFFINE_TOOLBAR_WIDGET ] : literal `${ unsafeStatic ( AFFINE_TOOLBAR_WIDGET ) } ` ,
6466} ;
6567
6668const PageCommonExtension : ExtensionType [ ] = [
Original file line number Diff line number Diff line change 3030 { "path" : " ../affine/widget-frame-title" },
3131 { "path" : " ../affine/widget-remote-selection" },
3232 { "path" : " ../affine/widget-scroll-anchoring" },
33+ { "path" : " ../affine/widget-toolbar" },
3334 { "path" : " ../framework/block-std" },
3435 { "path" : " ../affine/data-view" },
3536 { "path" : " ../framework/global" },
You can’t perform that action at this time.
0 commit comments