@ohhwells/bridge 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3946,6 +3946,10 @@ function OhhwellsBridge() {
|
|
|
3946
3946
|
const activate = (0, import_react.useCallback)((el) => {
|
|
3947
3947
|
if (activeElRef.current === el) return;
|
|
3948
3948
|
deactivate();
|
|
3949
|
+
if (hoveredImageRef.current) {
|
|
3950
|
+
hoveredImageRef.current = null;
|
|
3951
|
+
postToParentRef.current({ type: "ow:image-unhover" });
|
|
3952
|
+
}
|
|
3949
3953
|
el.setAttribute("contenteditable", "true");
|
|
3950
3954
|
el.removeAttribute("data-ohw-hovered");
|
|
3951
3955
|
activeElRef.current = el;
|
|
@@ -4264,7 +4268,8 @@ function OhhwellsBridge() {
|
|
|
4264
4268
|
}
|
|
4265
4269
|
return smallest;
|
|
4266
4270
|
};
|
|
4267
|
-
const probeImageAt = (clientX, clientY, isDragOver = false, fromParentViewport = false
|
|
4271
|
+
const probeImageAt = (clientX, clientY, isDragOver = false, fromParentViewport = false) => {
|
|
4272
|
+
if (activeElRef.current) return;
|
|
4268
4273
|
const toggleEl = document.querySelector("[data-ohw-state-toggle]");
|
|
4269
4274
|
if (toggleEl) {
|
|
4270
4275
|
const { x, y } = toProbeCoords(clientX, clientY, fromParentViewport);
|
|
@@ -4292,7 +4297,6 @@ function OhhwellsBridge() {
|
|
|
4292
4297
|
}
|
|
4293
4298
|
const topEditable = topEl?.closest("[data-ohw-editable]");
|
|
4294
4299
|
if (topEditable && topEditable.dataset.ohwEditable !== "image" && topEditable.dataset.ohwEditable !== "bg-image") {
|
|
4295
|
-
if (topEditable.hasAttribute("contenteditable") && fromOverlay) return;
|
|
4296
4300
|
if (hoveredImageRef.current) {
|
|
4297
4301
|
hoveredImageRef.current = null;
|
|
4298
4302
|
resumeAnimTracks();
|
|
@@ -4364,9 +4368,9 @@ function OhhwellsBridge() {
|
|
|
4364
4368
|
};
|
|
4365
4369
|
const handlePointerSync = (e) => {
|
|
4366
4370
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
4367
|
-
const { clientX, clientY
|
|
4371
|
+
const { clientX, clientY } = e.data;
|
|
4368
4372
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
4369
|
-
probeImageAt(clientX, clientY
|
|
4373
|
+
probeImageAt(clientX, clientY);
|
|
4370
4374
|
probeHoverCardsAt(clientX, clientY);
|
|
4371
4375
|
};
|
|
4372
4376
|
const handleDragOver = (e) => {
|