@ohhwells/bridge 0.1.151-next.408 → 0.1.152-next.409
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 +25 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7286,6 +7286,21 @@ function applyCustomCodeToHead(content) {
|
|
|
7286
7286
|
if (beforeNodes.length > 0) document.head.append(...beforeNodes);
|
|
7287
7287
|
}
|
|
7288
7288
|
|
|
7289
|
+
// src/lib/selectNavContainer.ts
|
|
7290
|
+
function isOnScreen(el) {
|
|
7291
|
+
const rect = el.getBoundingClientRect();
|
|
7292
|
+
if (rect.width <= 0 || rect.height <= 0) return false;
|
|
7293
|
+
if (el.offsetParent !== null) return true;
|
|
7294
|
+
return getComputedStyle(el).position === "fixed";
|
|
7295
|
+
}
|
|
7296
|
+
function findSelectableNavContainer(doc = document) {
|
|
7297
|
+
const visible = Array.from(doc.querySelectorAll("[data-ohw-nav-container]")).filter(isOnScreen);
|
|
7298
|
+
if (visible.length === 0) return null;
|
|
7299
|
+
return visible.reduce(
|
|
7300
|
+
(best, el) => el.getBoundingClientRect().top < best.getBoundingClientRect().top ? el : best
|
|
7301
|
+
);
|
|
7302
|
+
}
|
|
7303
|
+
|
|
7289
7304
|
// src/ui/ai-tree/aiSectionsManager.tsx
|
|
7290
7305
|
var import_react_dom = require("react-dom");
|
|
7291
7306
|
var import_client = require("react-dom/client");
|
|
@@ -17074,7 +17089,7 @@ function apiBase() {
|
|
|
17074
17089
|
function bridgeVersion() {
|
|
17075
17090
|
try {
|
|
17076
17091
|
if (true) {
|
|
17077
|
-
return "0.1.
|
|
17092
|
+
return "0.1.152-next.409";
|
|
17078
17093
|
}
|
|
17079
17094
|
} catch {
|
|
17080
17095
|
}
|
|
@@ -17088,7 +17103,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
17088
17103
|
return;
|
|
17089
17104
|
}
|
|
17090
17105
|
try {
|
|
17091
|
-
const v = true ? "0.1.
|
|
17106
|
+
const v = true ? "0.1.152-next.409" : "";
|
|
17092
17107
|
if (v) {
|
|
17093
17108
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
17094
17109
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -30936,6 +30951,12 @@ function OhhwellsBridge() {
|
|
|
30936
30951
|
clearIconSelectionRef.current();
|
|
30937
30952
|
};
|
|
30938
30953
|
window.addEventListener("message", handleDeactivate);
|
|
30954
|
+
const handleSelectNav = (e) => {
|
|
30955
|
+
if (e.data?.type !== "ow:select-nav") return;
|
|
30956
|
+
const navContainer = findSelectableNavContainer();
|
|
30957
|
+
if (navContainer) selectFrameRef.current(navContainer);
|
|
30958
|
+
};
|
|
30959
|
+
window.addEventListener("message", handleSelectNav);
|
|
30939
30960
|
const handleToastAction = (e) => {
|
|
30940
30961
|
if (e.data?.type !== "ow:toast-action") return;
|
|
30941
30962
|
const actionId = typeof e.data.actionId === "string" ? e.data.actionId : null;
|
|
@@ -31752,6 +31773,7 @@ function OhhwellsBridge() {
|
|
|
31752
31773
|
window.removeEventListener("message", handleDeleteSection);
|
|
31753
31774
|
window.removeEventListener("message", handleDuplicateSection);
|
|
31754
31775
|
window.removeEventListener("message", handleDeactivate);
|
|
31776
|
+
window.removeEventListener("message", handleSelectNav);
|
|
31755
31777
|
window.removeEventListener("message", handleToastAction);
|
|
31756
31778
|
window.removeEventListener("message", handleFormCount);
|
|
31757
31779
|
window.removeEventListener("message", handleUiEscape);
|
|
@@ -32049,7 +32071,7 @@ function OhhwellsBridge() {
|
|
|
32049
32071
|
postToParent2({
|
|
32050
32072
|
type: "ow:ready",
|
|
32051
32073
|
version: "1",
|
|
32052
|
-
bridgeVersion: "0.1.
|
|
32074
|
+
bridgeVersion: "0.1.152-next.409",
|
|
32053
32075
|
path: pathname,
|
|
32054
32076
|
nodes: collectEditableNodes(editContentRef.current),
|
|
32055
32077
|
sections
|