@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.cjs +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -599,9 +599,9 @@ function applyStylesToDom(store) {
|
|
|
599
599
|
);
|
|
600
600
|
if (!store) return;
|
|
601
601
|
for (const [sectionId, override] of Object.entries(store.sections)) {
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
);
|
|
602
|
+
const escaped = CSS.escape(sectionId);
|
|
603
|
+
const byInstance = document.querySelectorAll(`[data-ohw-instance="${escaped}"]`);
|
|
604
|
+
const sections = byInstance.length ? byInstance : document.querySelectorAll(`[data-ohw-section="${escaped}"]`);
|
|
605
605
|
for (const marker of Array.from(sections)) {
|
|
606
606
|
const section = marker.querySelector(":scope > [data-ai-section]") ?? marker;
|
|
607
607
|
for (const [prop, attr] of Object.entries(SECTION_ATTRS)) {
|
|
@@ -679,8 +679,9 @@ function parseSectionsFromRoot(root) {
|
|
|
679
679
|
const seen = /* @__PURE__ */ new Set();
|
|
680
680
|
const sections = [];
|
|
681
681
|
for (const el of root.querySelectorAll("[data-ohw-section]")) {
|
|
682
|
-
const id = el.getAttribute("data-ohw-section")
|
|
683
|
-
|
|
682
|
+
const id = el.getAttribute("data-ohw-instance") || el.getAttribute("data-ohw-section") || "";
|
|
683
|
+
const type = el.getAttribute("data-ohw-section") ?? "";
|
|
684
|
+
if (!id || seen.has(id) || LINK_PICKER_EXCLUDED_IDS.has(type)) continue;
|
|
684
685
|
if (el.parentElement?.closest("[data-ohw-section]")) continue;
|
|
685
686
|
if (el.hasAttribute("data-ohw-ai-template-hidden") || el.hasAttribute("data-ohw-ai-removed") || el.hasAttribute("data-ohw-ai-replaced-by"))
|
|
686
687
|
continue;
|
|
@@ -22043,7 +22044,7 @@ function OhhwellsBridge() {
|
|
|
22043
22044
|
postToParent2({
|
|
22044
22045
|
type: "ow:ready",
|
|
22045
22046
|
version: "1",
|
|
22046
|
-
bridgeVersion: "0.1.
|
|
22047
|
+
bridgeVersion: "0.1.97",
|
|
22047
22048
|
path: pathname,
|
|
22048
22049
|
nodes: collectEditableNodes(editContentRef.current),
|
|
22049
22050
|
sections
|