@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.js CHANGED
@@ -336,7 +336,9 @@ var NODE_WROTE_ATTR = "data-ohw-style-node";
336
336
  var NODE_PROPS = ["color", "font-family", "font-size", "background"];
337
337
  function saveInline(el, prop) {
338
338
  const attr = `data-ohw-style-prev-${prop}`;
339
- if (!el.hasAttribute(attr)) el.setAttribute(attr, el.style.getPropertyValue(prop));
339
+ if (el.hasAttribute(attr)) return;
340
+ const value = el.style.getPropertyValue(prop) || (prop === "background" ? el.style.getPropertyValue("background-color") : "");
341
+ el.setAttribute(attr, value);
340
342
  }
341
343
  function restoreInline(el, prop) {
342
344
  const attr = `data-ohw-style-prev-${prop}`;
@@ -387,7 +389,8 @@ function applyStylesToDom(store) {
387
389
  const sections = document.querySelectorAll(
388
390
  `[data-ohw-section="${CSS.escape(sectionId)}"]`
389
391
  );
390
- for (const section of Array.from(sections)) {
392
+ for (const marker of Array.from(sections)) {
393
+ const section = marker.querySelector(":scope > [data-ai-section]") ?? marker;
391
394
  for (const [prop, attr] of Object.entries(SECTION_ATTRS)) {
392
395
  const value = override[prop];
393
396
  if (value === void 0) continue;
@@ -21024,7 +21027,7 @@ function OhhwellsBridge() {
21024
21027
  postToParent2({
21025
21028
  type: "ow:ready",
21026
21029
  version: "1",
21027
- bridgeVersion: "0.1.81",
21030
+ bridgeVersion: "0.1.82",
21028
21031
  path: pathname,
21029
21032
  nodes: collectEditableNodes(editContentRef.current),
21030
21033
  sections