@ohhwells/bridge 0.1.153 → 0.1.155

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 CHANGED
@@ -7271,6 +7271,21 @@ function applyCustomCodeToHead(content) {
7271
7271
  if (beforeNodes.length > 0) document.head.append(...beforeNodes);
7272
7272
  }
7273
7273
 
7274
+ // src/lib/selectNavContainer.ts
7275
+ function isOnScreen(el) {
7276
+ const rect = el.getBoundingClientRect();
7277
+ if (rect.width <= 0 || rect.height <= 0) return false;
7278
+ if (el.offsetParent !== null) return true;
7279
+ return getComputedStyle(el).position === "fixed";
7280
+ }
7281
+ function findSelectableNavContainer(doc = document) {
7282
+ const visible = Array.from(doc.querySelectorAll("[data-ohw-nav-container]")).filter(isOnScreen);
7283
+ if (visible.length === 0) return null;
7284
+ return visible.reduce(
7285
+ (best, el) => el.getBoundingClientRect().top < best.getBoundingClientRect().top ? el : best
7286
+ );
7287
+ }
7288
+
7274
7289
  // src/ui/ai-tree/aiSectionsManager.tsx
7275
7290
  var import_react_dom = require("react-dom");
7276
7291
  var import_client = require("react-dom/client");
@@ -17029,7 +17044,7 @@ function apiBase() {
17029
17044
  function bridgeVersion() {
17030
17045
  try {
17031
17046
  if (true) {
17032
- return "0.1.153";
17047
+ return "0.1.155";
17033
17048
  }
17034
17049
  } catch {
17035
17050
  }
@@ -17043,7 +17058,7 @@ function stampBridgeVersionOnDocument() {
17043
17058
  return;
17044
17059
  }
17045
17060
  try {
17046
- const v = true ? "0.1.153" : "";
17061
+ const v = true ? "0.1.155" : "";
17047
17062
  if (v) {
17048
17063
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
17049
17064
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -17052,10 +17067,19 @@ function stampBridgeVersionOnDocument() {
17052
17067
  }
17053
17068
  }
17054
17069
  var RECOVERABLE_PAGE_ERROR = /Minified React error #(?:418|419|421|422|423|425)\b|Hydration failed because the initial UI does not match|Text content does not match server-rendered HTML|There was an error while hydrating|did not match\. Server:/i;
17070
+ function isVercelPreviewHost() {
17071
+ if (typeof location === "undefined") {
17072
+ return false;
17073
+ }
17074
+ return location.hostname.toLowerCase().endsWith(".vercel.ohhwells.site");
17075
+ }
17055
17076
  function reportOutageBeacon(args) {
17056
17077
  if (typeof window === "undefined" || !args.subdomain) {
17057
17078
  return;
17058
17079
  }
17080
+ if (isVercelPreviewHost()) {
17081
+ return;
17082
+ }
17059
17083
  if (args.reason === "page_error" && args.detail && RECOVERABLE_PAGE_ERROR.test(args.detail)) {
17060
17084
  return;
17061
17085
  }
@@ -30849,6 +30873,12 @@ function OhhwellsBridge() {
30849
30873
  clearIconSelectionRef.current();
30850
30874
  };
30851
30875
  window.addEventListener("message", handleDeactivate);
30876
+ const handleSelectNav = (e) => {
30877
+ if (e.data?.type !== "ow:select-nav") return;
30878
+ const navContainer = findSelectableNavContainer();
30879
+ if (navContainer) selectFrameRef.current(navContainer);
30880
+ };
30881
+ window.addEventListener("message", handleSelectNav);
30852
30882
  const handleToastAction = (e) => {
30853
30883
  if (e.data?.type !== "ow:toast-action") return;
30854
30884
  const actionId = typeof e.data.actionId === "string" ? e.data.actionId : null;
@@ -31665,6 +31695,7 @@ function OhhwellsBridge() {
31665
31695
  window.removeEventListener("message", handleDeleteSection);
31666
31696
  window.removeEventListener("message", handleDuplicateSection);
31667
31697
  window.removeEventListener("message", handleDeactivate);
31698
+ window.removeEventListener("message", handleSelectNav);
31668
31699
  document.documentElement.removeAttribute("data-ohw-panel-dragging");
31669
31700
  window.removeEventListener("message", handleToastAction);
31670
31701
  window.removeEventListener("message", handleFormCount);
@@ -31962,7 +31993,7 @@ function OhhwellsBridge() {
31962
31993
  postToParent2({
31963
31994
  type: "ow:ready",
31964
31995
  version: "1",
31965
- bridgeVersion: "0.1.153",
31996
+ bridgeVersion: "0.1.155",
31966
31997
  path: pathname,
31967
31998
  nodes: collectEditableNodes(editContentRef.current),
31968
31999
  sections