chore: remove frame overlay dependency from default-tool (#11762)

This commit is contained in:
doouding committed 2025-04-22 08:18:25 +00:00
1 parent e0e84d302d
commit 1d58792631
2 files changed
+19 -29

No files matched your search

@@ -1,8 +1,5 @@
import { OverlayIdentifier } from '@blocksuite/affine-block-surface';
import {
type FrameBlockModel,
MindmapElementModel,
} from '@blocksuite/affine-model';
import { FrameBlockModel, MindmapElementModel } from '@blocksuite/affine-model';
import {
type DragExtensionInitializeContext,
getTopElements,
@@ -78,5 +75,22 @@ export class FrameHighlightManager extends InteractivityExtension {
},
};
});
this.event.on('pointermove', context => {
const [x, y] = this.gfx.viewport.toModelCoord(
context.event.x,
context.event.y
);
const target = this.gfx.getElementByPoint(x, y);
if (
target instanceof FrameBlockModel &&
target.externalBound?.isPointInBound([x, y])
) {
this.frameHighlightOverlay.highlight(target);
} else {
this.frameHighlightOverlay.clear();
}
});
}
}