mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +08:00
refactor: moving connector label to connector view (#11738)
### Changed Moved connector label moving logic from `default-tool` to connector view. #### Other infrastructure changes: - Gfx element view now can handles drag events - Added `context.preventDefault()` support to bypass built-in interactions in extension - Handle the pointer events in element view will bypass the built-in interactions automatically > The built-in interactions include element dragging, click selection, drag-to-scale operations, etc.
This commit is contained in:
+6
-3
@@ -6,14 +6,17 @@ import {
|
||||
FeatureFlagService,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import type { PointerEventState } from '@blocksuite/std';
|
||||
import { InteractivityExtension } from '@blocksuite/std/gfx';
|
||||
import {
|
||||
type GfxInteractivityContext,
|
||||
InteractivityExtension,
|
||||
} from '@blocksuite/std/gfx';
|
||||
|
||||
export class DblClickAddEdgelessText extends InteractivityExtension {
|
||||
static override key = 'dbl-click-add-edgeless-text';
|
||||
|
||||
override mounted() {
|
||||
this.event.on('dblclick', (e: PointerEventState) => {
|
||||
this.event.on('dblclick', (ctx: GfxInteractivityContext) => {
|
||||
const { event: e } = ctx;
|
||||
const textFlag = this.std.store
|
||||
.get(FeatureFlagService)
|
||||
.getFlag('enable_edgeless_text');
|
||||
|
||||
Reference in New Issue
Block a user