@ohhwells/bridge 0.1.97 → 0.1.98

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
@@ -526,9 +526,9 @@ function applyStylesToDom(store) {
526
526
  );
527
527
  if (!store) return;
528
528
  for (const [sectionId, override] of Object.entries(store.sections)) {
529
- const sections = document.querySelectorAll(
530
- `[data-ohw-section="${CSS.escape(sectionId)}"]`
531
- );
529
+ const escaped = CSS.escape(sectionId);
530
+ const byInstance = document.querySelectorAll(`[data-ohw-instance="${escaped}"]`);
531
+ const sections = byInstance.length ? byInstance : document.querySelectorAll(`[data-ohw-section="${escaped}"]`);
532
532
  for (const marker of Array.from(sections)) {
533
533
  const section = marker.querySelector(":scope > [data-ai-section]") ?? marker;
534
534
  for (const [prop, attr] of Object.entries(SECTION_ATTRS)) {
@@ -606,8 +606,9 @@ function parseSectionsFromRoot(root) {
606
606
  const seen = /* @__PURE__ */ new Set();
607
607
  const sections = [];
608
608
  for (const el of root.querySelectorAll("[data-ohw-section]")) {
609
- const id = el.getAttribute("data-ohw-section") ?? "";
610
- if (!id || seen.has(id) || LINK_PICKER_EXCLUDED_IDS.has(id)) continue;
609
+ const id = el.getAttribute("data-ohw-instance") || el.getAttribute("data-ohw-section") || "";
610
+ const type = el.getAttribute("data-ohw-section") ?? "";
611
+ if (!id || seen.has(id) || LINK_PICKER_EXCLUDED_IDS.has(type)) continue;
611
612
  if (el.parentElement?.closest("[data-ohw-section]")) continue;
612
613
  if (el.hasAttribute("data-ohw-ai-template-hidden") || el.hasAttribute("data-ohw-ai-removed") || el.hasAttribute("data-ohw-ai-replaced-by"))
613
614
  continue;
@@ -21976,7 +21977,7 @@ function OhhwellsBridge() {
21976
21977
  postToParent2({
21977
21978
  type: "ow:ready",
21978
21979
  version: "1",
21979
- bridgeVersion: "0.1.96",
21980
+ bridgeVersion: "0.1.97",
21980
21981
  path: pathname,
21981
21982
  nodes: collectEditableNodes(editContentRef.current),
21982
21983
  sections