@ohhwells/bridge 0.1.167-next.444 → 0.1.168-next.447

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
@@ -17796,7 +17796,7 @@ function apiBase() {
17796
17796
  function bridgeVersion() {
17797
17797
  try {
17798
17798
  if (true) {
17799
- return "0.1.167-next.444";
17799
+ return "0.1.168-next.447";
17800
17800
  }
17801
17801
  } catch {
17802
17802
  }
@@ -17810,7 +17810,7 @@ function stampBridgeVersionOnDocument() {
17810
17810
  return;
17811
17811
  }
17812
17812
  try {
17813
- const v = true ? "0.1.167-next.444" : "";
17813
+ const v = true ? "0.1.168-next.447" : "";
17814
17814
  if (v) {
17815
17815
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
17816
17816
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -18792,6 +18792,12 @@ function highlightChangedElements(keys, item, sectionId) {
18792
18792
  clearTimer = setTimeout(clearChangeHighlight, HIGHLIGHT_MS);
18793
18793
  return targets.length;
18794
18794
  }
18795
+ function highlightedRect() {
18796
+ const first = document.querySelector(`[${MARK_ATTR}]`);
18797
+ if (!first) return null;
18798
+ const rect = first.getBoundingClientRect();
18799
+ return { top: rect.top + window.scrollY, bottom: rect.bottom + window.scrollY };
18800
+ }
18795
18801
  function installAiChangeHighlight() {
18796
18802
  const onMessage = (e) => {
18797
18803
  const data = e.data;
@@ -18801,7 +18807,8 @@ function installAiChangeHighlight() {
18801
18807
  const item = raw && typeof raw.sectionId === "string" && typeof raw.group === "string" && typeof raw.index === "number" ? { sectionId: raw.sectionId, group: raw.group, index: raw.index } : void 0;
18802
18808
  const sectionId = typeof data.sectionId === "string" ? data.sectionId : void 0;
18803
18809
  const found = highlightChangedElements(keys, item, sectionId);
18804
- window.parent?.postMessage({ type: "ow:ai-highlight-done", found }, "*");
18810
+ const rect = data.reveal === true && found > 0 ? highlightedRect() : null;
18811
+ window.parent?.postMessage({ type: "ow:ai-highlight-done", found, ...rect ? { rect } : {} }, "*");
18805
18812
  };
18806
18813
  window.addEventListener("message", onMessage);
18807
18814
  return () => window.removeEventListener("message", onMessage);
@@ -33017,7 +33024,7 @@ function OhhwellsBridge() {
33017
33024
  postToParent2({
33018
33025
  type: "ow:ready",
33019
33026
  version: "1",
33020
- bridgeVersion: "0.1.167-next.444",
33027
+ bridgeVersion: "0.1.168-next.447",
33021
33028
  path: pathname,
33022
33029
  nodes: collectEditableNodes(editContentRef.current),
33023
33030
  sections