@ohhwells/bridge 0.1.82 → 0.1.83
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 +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -409,7 +409,9 @@ var NODE_WROTE_ATTR = "data-ohw-style-node";
|
|
|
409
409
|
var NODE_PROPS = ["color", "font-family", "font-size", "background"];
|
|
410
410
|
function saveInline(el, prop) {
|
|
411
411
|
const attr = `data-ohw-style-prev-${prop}`;
|
|
412
|
-
if (
|
|
412
|
+
if (el.hasAttribute(attr)) return;
|
|
413
|
+
const value = el.style.getPropertyValue(prop) || (prop === "background" ? el.style.getPropertyValue("background-color") : "");
|
|
414
|
+
el.setAttribute(attr, value);
|
|
413
415
|
}
|
|
414
416
|
function restoreInline(el, prop) {
|
|
415
417
|
const attr = `data-ohw-style-prev-${prop}`;
|
|
@@ -460,7 +462,8 @@ function applyStylesToDom(store) {
|
|
|
460
462
|
const sections = document.querySelectorAll(
|
|
461
463
|
`[data-ohw-section="${CSS.escape(sectionId)}"]`
|
|
462
464
|
);
|
|
463
|
-
for (const
|
|
465
|
+
for (const marker of Array.from(sections)) {
|
|
466
|
+
const section = marker.querySelector(":scope > [data-ai-section]") ?? marker;
|
|
464
467
|
for (const [prop, attr] of Object.entries(SECTION_ATTRS)) {
|
|
465
468
|
const value = override[prop];
|
|
466
469
|
if (value === void 0) continue;
|
|
@@ -21091,7 +21094,7 @@ function OhhwellsBridge() {
|
|
|
21091
21094
|
postToParent2({
|
|
21092
21095
|
type: "ow:ready",
|
|
21093
21096
|
version: "1",
|
|
21094
|
-
bridgeVersion: "0.1.
|
|
21097
|
+
bridgeVersion: "0.1.82",
|
|
21095
21098
|
path: pathname,
|
|
21096
21099
|
nodes: collectEditableNodes(editContentRef.current),
|
|
21097
21100
|
sections
|