@ohhwells/bridge 0.1.153 → 0.1.154
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.js
CHANGED
|
@@ -7161,6 +7161,21 @@ function applyCustomCodeToHead(content) {
|
|
|
7161
7161
|
if (beforeNodes.length > 0) document.head.append(...beforeNodes);
|
|
7162
7162
|
}
|
|
7163
7163
|
|
|
7164
|
+
// src/lib/selectNavContainer.ts
|
|
7165
|
+
function isOnScreen(el) {
|
|
7166
|
+
const rect = el.getBoundingClientRect();
|
|
7167
|
+
if (rect.width <= 0 || rect.height <= 0) return false;
|
|
7168
|
+
if (el.offsetParent !== null) return true;
|
|
7169
|
+
return getComputedStyle(el).position === "fixed";
|
|
7170
|
+
}
|
|
7171
|
+
function findSelectableNavContainer(doc = document) {
|
|
7172
|
+
const visible = Array.from(doc.querySelectorAll("[data-ohw-nav-container]")).filter(isOnScreen);
|
|
7173
|
+
if (visible.length === 0) return null;
|
|
7174
|
+
return visible.reduce(
|
|
7175
|
+
(best, el) => el.getBoundingClientRect().top < best.getBoundingClientRect().top ? el : best
|
|
7176
|
+
);
|
|
7177
|
+
}
|
|
7178
|
+
|
|
7164
7179
|
// src/ui/ai-tree/aiSectionsManager.tsx
|
|
7165
7180
|
import { flushSync } from "react-dom";
|
|
7166
7181
|
import { createRoot } from "react-dom/client";
|
|
@@ -16919,7 +16934,7 @@ function apiBase() {
|
|
|
16919
16934
|
function bridgeVersion() {
|
|
16920
16935
|
try {
|
|
16921
16936
|
if (true) {
|
|
16922
|
-
return "0.1.
|
|
16937
|
+
return "0.1.154";
|
|
16923
16938
|
}
|
|
16924
16939
|
} catch {
|
|
16925
16940
|
}
|
|
@@ -16933,7 +16948,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
16933
16948
|
return;
|
|
16934
16949
|
}
|
|
16935
16950
|
try {
|
|
16936
|
-
const v = true ? "0.1.
|
|
16951
|
+
const v = true ? "0.1.154" : "";
|
|
16937
16952
|
if (v) {
|
|
16938
16953
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
16939
16954
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -30745,6 +30760,12 @@ function OhhwellsBridge() {
|
|
|
30745
30760
|
clearIconSelectionRef.current();
|
|
30746
30761
|
};
|
|
30747
30762
|
window.addEventListener("message", handleDeactivate);
|
|
30763
|
+
const handleSelectNav = (e) => {
|
|
30764
|
+
if (e.data?.type !== "ow:select-nav") return;
|
|
30765
|
+
const navContainer = findSelectableNavContainer();
|
|
30766
|
+
if (navContainer) selectFrameRef.current(navContainer);
|
|
30767
|
+
};
|
|
30768
|
+
window.addEventListener("message", handleSelectNav);
|
|
30748
30769
|
const handleToastAction = (e) => {
|
|
30749
30770
|
if (e.data?.type !== "ow:toast-action") return;
|
|
30750
30771
|
const actionId = typeof e.data.actionId === "string" ? e.data.actionId : null;
|
|
@@ -31561,6 +31582,7 @@ function OhhwellsBridge() {
|
|
|
31561
31582
|
window.removeEventListener("message", handleDeleteSection);
|
|
31562
31583
|
window.removeEventListener("message", handleDuplicateSection);
|
|
31563
31584
|
window.removeEventListener("message", handleDeactivate);
|
|
31585
|
+
window.removeEventListener("message", handleSelectNav);
|
|
31564
31586
|
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
31565
31587
|
window.removeEventListener("message", handleToastAction);
|
|
31566
31588
|
window.removeEventListener("message", handleFormCount);
|
|
@@ -31858,7 +31880,7 @@ function OhhwellsBridge() {
|
|
|
31858
31880
|
postToParent2({
|
|
31859
31881
|
type: "ow:ready",
|
|
31860
31882
|
version: "1",
|
|
31861
|
-
bridgeVersion: "0.1.
|
|
31883
|
+
bridgeVersion: "0.1.154",
|
|
31862
31884
|
path: pathname,
|
|
31863
31885
|
nodes: collectEditableNodes(editContentRef.current),
|
|
31864
31886
|
sections
|