-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(editor): extract drag handle widget (#9415)
- Loading branch information
1 parent
b96a03b
commit cec4a4b
Showing
47 changed files
with
277 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
export * from './doc-display-meta-service.js'; | ||
export * from './doc-mode-service.js'; | ||
export * from './drag-handle-config.js'; | ||
export * from './edit-props-store.js'; | ||
export * from './editor-setting-service.js'; | ||
export * from './embed-option-service.js'; | ||
export * from './font-loader/index.js'; | ||
export * from './generate-url-service.js'; | ||
export * from './notification-service.js'; | ||
export * from './parse-url-service.js'; | ||
export * from './quick-search-service.js'; | ||
export * from './telemetry-service/index.js'; | ||
export * from './theme-service.js'; | ||
export * from './doc-display-meta-service'; | ||
export * from './doc-mode-service'; | ||
export * from './drag-handle-config'; | ||
export * from './edit-props-store'; | ||
export * from './editor-setting-service'; | ||
export * from './embed-option-service'; | ||
export * from './font-loader'; | ||
export * from './generate-url-service'; | ||
export * from './notification-service'; | ||
export * from './page-viewport-service'; | ||
export * from './parse-url-service'; | ||
export * from './quick-search-service'; | ||
export * from './telemetry-service'; | ||
export * from './theme-service'; |
15 changes: 15 additions & 0 deletions
15
blocksuite/affine/shared/src/services/page-viewport-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { ExtensionType } from '@blocksuite/block-std'; | ||
import { createIdentifier } from '@blocksuite/global/di'; | ||
import { Slot } from '@blocksuite/store'; | ||
|
||
import type { Viewport } from '../types'; | ||
|
||
export const PageViewportService = createIdentifier<Slot<Viewport>>( | ||
'PageViewportService' | ||
); | ||
|
||
export const PageViewportServiceExtension: ExtensionType = { | ||
setup: di => { | ||
di.addImpl(PageViewportService, () => new Slot<Viewport>()); | ||
}, | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
export * from './button-popper.js'; | ||
export * from './collapsed/index.js'; | ||
export * from './dnd/index.js'; | ||
export * from './dom/index.js'; | ||
export * from './edgeless.js'; | ||
export * from './event.js'; | ||
export * from './file/index.js'; | ||
export * from './insert.js'; | ||
export * from './is-abort-error.js'; | ||
export * from './math.js'; | ||
export * from './model/index.js'; | ||
export * from './print-to-pdf.js'; | ||
export * from './reference.js'; | ||
export * from './reordering.js'; | ||
export * from './signal.js'; | ||
export * from './spec/index.js'; | ||
export * from './string.js'; | ||
export * from './title.js'; | ||
export * from './url.js'; | ||
export * from './zod-schema.js'; | ||
export * from './auto-scroll'; | ||
export * from './button-popper'; | ||
export * from './collapsed'; | ||
export * from './dnd'; | ||
export * from './dom'; | ||
export * from './edgeless'; | ||
export * from './event'; | ||
export * from './file'; | ||
export * from './insert'; | ||
export * from './is-abort-error'; | ||
export * from './math'; | ||
export * from './model'; | ||
export * from './print-to-pdf'; | ||
export * from './reference'; | ||
export * from './reordering'; | ||
export * from './signal'; | ||
export * from './spec'; | ||
export * from './string'; | ||
export * from './title'; | ||
export * from './url'; | ||
export * from './zod-schema'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "@blocksuite/affine-widget-drag-handle", | ||
"description": "Drag handle for BlockSuite.", | ||
"type": "module", | ||
"scripts": { | ||
"build": "tsc", | ||
"test:unit": "nx vite:test --run --passWithNoTests", | ||
"test:unit:coverage": "nx vite:test --run --coverage", | ||
"test:e2e": "playwright test" | ||
}, | ||
"sideEffects": false, | ||
"keywords": [], | ||
"author": "toeverything", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@blocksuite/affine-block-list": "workspace:*", | ||
"@blocksuite/affine-block-note": "workspace:*", | ||
"@blocksuite/affine-block-paragraph": "workspace:*", | ||
"@blocksuite/affine-block-surface": "workspace:*", | ||
"@blocksuite/affine-components": "workspace:*", | ||
"@blocksuite/affine-model": "workspace:*", | ||
"@blocksuite/affine-shared": "workspace:*", | ||
"@blocksuite/block-std": "workspace:*", | ||
"@blocksuite/global": "workspace:*", | ||
"@blocksuite/icons": "^2.1.75", | ||
"@blocksuite/inline": "workspace:*", | ||
"@blocksuite/store": "workspace:*", | ||
"@floating-ui/dom": "^1.6.10", | ||
"@lit/context": "^1.1.2", | ||
"@preact/signals-core": "^1.8.0", | ||
"@toeverything/theme": "^1.1.1", | ||
"lit": "^3.2.0", | ||
"minimatch": "^10.0.1", | ||
"zod": "^3.23.8" | ||
}, | ||
"exports": { | ||
".": "./src/index.ts", | ||
"./effects": "./src/effects.ts" | ||
}, | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!src/__tests__", | ||
"!dist/__tests__" | ||
], | ||
"version": "0.19.0" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { DragPreview } from './components/drag-preview'; | ||
import { DropIndicator } from './components/drop-indicator'; | ||
import { AFFINE_DRAG_HANDLE_WIDGET } from './consts'; | ||
import { AffineDragHandleWidget } from './drag-handle'; | ||
|
||
export function effects() { | ||
customElements.define('affine-drag-preview', DragPreview); | ||
customElements.define('affine-drop-indicator', DropIndicator); | ||
customElements.define(AFFINE_DRAG_HANDLE_WIDGET, AffineDragHandleWidget); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type * as SurfaceEffects from '@blocksuite/affine-block-surface/effects'; | ||
|
||
declare type _GLOBAL_ = typeof SurfaceEffects; | ||
|
||
export * from './consts'; | ||
export * from './drag-handle'; | ||
export * from './utils'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
11 changes: 5 additions & 6 deletions
11
...gets/drag-handle/watchers/page-watcher.ts → ...-drag-handle/src/watchers/page-watcher.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.