@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.js CHANGED
@@ -7176,6 +7176,21 @@ function applyCustomCodeToHead(content) {
7176
7176
  if (beforeNodes.length > 0) document.head.append(...beforeNodes);
7177
7177
  }
7178
7178
 
7179
+ // src/lib/selectNavContainer.ts
7180
+ function isOnScreen(el) {
7181
+ const rect = el.getBoundingClientRect();
7182
+ if (rect.width <= 0 || rect.height <= 0) return false;
7183
+ if (el.offsetParent !== null) return true;
7184
+ return getComputedStyle(el).position === "fixed";
7185
+ }
7186
+ function findSelectableNavContainer(doc = document) {
7187
+ const visible = Array.from(doc.querySelectorAll("[data-ohw-nav-container]")).filter(isOnScreen);
7188
+ if (visible.length === 0) return null;
7189
+ return visible.reduce(
7190
+ (best, el) => el.getBoundingClientRect().top < best.getBoundingClientRect().top ? el : best
7191
+ );
7192
+ }
7193
+
7179
7194
  // src/ui/ai-tree/aiSectionsManager.tsx
7180
7195
  import { flushSync } from "react-dom";
7181
7196
  import { createRoot } from "react-dom/client";
@@ -16964,7 +16979,7 @@ function apiBase() {
16964
16979
  function bridgeVersion() {
16965
16980
  try {
16966
16981
  if (true) {
16967
- return "0.1.151-next.408";
16982
+ return "0.1.152-next.409";
16968
16983
  }
16969
16984
  } catch {
16970
16985
  }
@@ -16978,7 +16993,7 @@ function stampBridgeVersionOnDocument() {
16978
16993
  return;
16979
16994
  }
16980
16995
  try {
16981
- const v = true ? "0.1.151-next.408" : "";
16996
+ const v = true ? "0.1.152-next.409" : "";
16982
16997
  if (v) {
16983
16998
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
16984
16999
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -30848,6 +30863,12 @@ function OhhwellsBridge() {
30848
30863
  clearIconSelectionRef.current();
30849
30864
  };
30850
30865
  window.addEventListener("message", handleDeactivate);
30866
+ const handleSelectNav = (e) => {
30867
+ if (e.data?.type !== "ow:select-nav") return;
30868
+ const navContainer = findSelectableNavContainer();
30869
+ if (navContainer) selectFrameRef.current(navContainer);
30870
+ };
30871
+ window.addEventListener("message", handleSelectNav);
30851
30872
  const handleToastAction = (e) => {
30852
30873
  if (e.data?.type !== "ow:toast-action") return;
30853
30874
  const actionId = typeof e.data.actionId === "string" ? e.data.actionId : null;
@@ -31664,6 +31685,7 @@ function OhhwellsBridge() {
31664
31685
  window.removeEventListener("message", handleDeleteSection);
31665
31686
  window.removeEventListener("message", handleDuplicateSection);
31666
31687
  window.removeEventListener("message", handleDeactivate);
31688
+ window.removeEventListener("message", handleSelectNav);
31667
31689
  window.removeEventListener("message", handleToastAction);
31668
31690
  window.removeEventListener("message", handleFormCount);
31669
31691
  window.removeEventListener("message", handleUiEscape);
@@ -31961,7 +31983,7 @@ function OhhwellsBridge() {
31961
31983
  postToParent2({
31962
31984
  type: "ow:ready",
31963
31985
  version: "1",
31964
- bridgeVersion: "0.1.151-next.408",
31986
+ bridgeVersion: "0.1.152-next.409",
31965
31987
  path: pathname,
31966
31988
  nodes: collectEditableNodes(editContentRef.current),
31967
31989
  sections