mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00: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:
@@ -1,4 +1,4 @@
|
||||
import type { ShapeElementModel } from '@blocksuite/affine-model';
|
||||
import { ShapeElementModel } from '@blocksuite/affine-model';
|
||||
import { GfxElementModelView } from '@blocksuite/std/gfx';
|
||||
|
||||
import { mountShapeTextEditor } from './text/edgeless-shape-text-editor';
|
||||
@@ -16,7 +16,11 @@ export class ShapeElementView extends GfxElementModelView<ShapeElementModel> {
|
||||
this.on('dblclick', () => {
|
||||
const edgeless = this.std.view.getBlock(this.std.store.root!.id);
|
||||
|
||||
if (edgeless && !this.model.isLocked()) {
|
||||
if (
|
||||
edgeless &&
|
||||
!this.model.isLocked() &&
|
||||
this.model instanceof ShapeElementModel
|
||||
) {
|
||||
mountShapeTextEditor(this.model, edgeless);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user