@ohhwells/bridge 0.1.38 → 0.1.39
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 +28 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6080,7 +6080,13 @@ function collectEditableNodes() {
|
|
|
6080
6080
|
nodes.push({ key: `${key}${VIDEO_AUTOPLAY_SUFFIX}`, type: "video-setting", text: String(video.autoplay) });
|
|
6081
6081
|
nodes.push({ key: `${key}${VIDEO_MUTED_SUFFIX}`, type: "video-setting", text: String(video.muted) });
|
|
6082
6082
|
});
|
|
6083
|
-
|
|
6083
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6084
|
+
return nodes.filter((node) => {
|
|
6085
|
+
if (!node.key) return true;
|
|
6086
|
+
if (seen.has(node.key)) return false;
|
|
6087
|
+
seen.add(node.key);
|
|
6088
|
+
return true;
|
|
6089
|
+
});
|
|
6084
6090
|
}
|
|
6085
6091
|
function isMediaEditable(el) {
|
|
6086
6092
|
const t = el.dataset.ohwEditable;
|
|
@@ -7217,7 +7223,6 @@ function OhhwellsBridge() {
|
|
|
7217
7223
|
[data-ohw-hovered]:not([contenteditable]):not([data-ohw-href-key]) {
|
|
7218
7224
|
outline: 2px dashed ${PRIMARY2} !important;
|
|
7219
7225
|
outline-offset: 4px;
|
|
7220
|
-
border-radius: 2px;
|
|
7221
7226
|
}
|
|
7222
7227
|
[data-ohw-href-key] [data-ohw-hovered],
|
|
7223
7228
|
[data-ohw-href-key][data-ohw-hovered],
|
|
@@ -7244,7 +7249,7 @@ function OhhwellsBridge() {
|
|
|
7244
7249
|
stateViews.textContent = `
|
|
7245
7250
|
[data-ohw-state-view]:not([data-ohw-state-view="default"]) { display: none; }
|
|
7246
7251
|
[data-ohw-state-view="default"] [data-ohw-editable] { pointer-events: auto !important; }
|
|
7247
|
-
[data-ohw-state-hovered] { outline: 2px dashed ${PRIMARY2} !important; outline-offset: 4px;
|
|
7252
|
+
[data-ohw-state-hovered] { outline: 2px dashed ${PRIMARY2} !important; outline-offset: 4px; }
|
|
7248
7253
|
[data-ohw-state-hovered]:has([data-ohw-hovered]) { outline: none !important; }
|
|
7249
7254
|
`;
|
|
7250
7255
|
document.head.appendChild(base);
|
|
@@ -7473,12 +7478,12 @@ function OhhwellsBridge() {
|
|
|
7473
7478
|
const stickyPad = 48;
|
|
7474
7479
|
const withinPad = x >= pr.left - stickyPad && x <= pr.left + pr.width + stickyPad && y >= pr.top - stickyPad && y <= pr.top + pr.height + stickyPad;
|
|
7475
7480
|
if (withinPad) {
|
|
7476
|
-
|
|
7481
|
+
if (smallest !== pinned && candidatePool.includes(smallest)) {
|
|
7477
7482
|
const sr = getVisibleRect(smallest);
|
|
7478
|
-
const
|
|
7479
|
-
|
|
7480
|
-
}
|
|
7481
|
-
|
|
7483
|
+
const overOther = x >= sr.left && x <= sr.left + sr.width && y >= sr.top && y <= sr.top + sr.height;
|
|
7484
|
+
if (overOther) return smallest;
|
|
7485
|
+
}
|
|
7486
|
+
return pinned;
|
|
7482
7487
|
}
|
|
7483
7488
|
}
|
|
7484
7489
|
return smallest;
|
|
@@ -7519,6 +7524,21 @@ function OhhwellsBridge() {
|
|
|
7519
7524
|
}
|
|
7520
7525
|
if (imgEl) {
|
|
7521
7526
|
const { x, y } = toProbeCoords(clientX, clientY, fromParentViewport);
|
|
7527
|
+
const overMediaChrome = Array.from(
|
|
7528
|
+
document.querySelectorAll("[data-ohw-media-chrome]")
|
|
7529
|
+
).some((el) => {
|
|
7530
|
+
const r2 = el.getBoundingClientRect();
|
|
7531
|
+
return x >= r2.left && x <= r2.right && y >= r2.top && y <= r2.bottom;
|
|
7532
|
+
});
|
|
7533
|
+
if (overMediaChrome) {
|
|
7534
|
+
if (hoveredImageRef.current) {
|
|
7535
|
+
hoveredImageRef.current = null;
|
|
7536
|
+
hoveredImageHasTextOverlapRef.current = false;
|
|
7537
|
+
resumeAnimTracks();
|
|
7538
|
+
clearImageHover();
|
|
7539
|
+
}
|
|
7540
|
+
return;
|
|
7541
|
+
}
|
|
7522
7542
|
const topEl = document.elementFromPoint(x, y);
|
|
7523
7543
|
if (topEl?.closest('[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
7524
7544
|
if (hoveredImageRef.current) {
|