@ohhwells/bridge 0.1.176 → 0.1.178

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
@@ -1009,6 +1009,11 @@ function findImages(deps, section) {
1009
1009
  if (url && style.objectFit === "cover") out.push({ el, url, urlLayer: -1 });
1010
1010
  continue;
1011
1011
  }
1012
+ if (el.tagName === "VIDEO") {
1013
+ const url = el.poster;
1014
+ if (url && style.objectFit === "cover") out.push({ el, url, urlLayer: -1 });
1015
+ continue;
1016
+ }
1012
1017
  const layers = bgLayers(style);
1013
1018
  const urlLayer = layers.findIndex((l) => urlOf(l) !== null);
1014
1019
  if (urlLayer >= 0) out.push({ el, url: urlOf(layers[urlLayer]), urlLayer });
@@ -1321,7 +1326,10 @@ function fixButtonInk(deps, section, painted) {
1321
1326
  }
1322
1327
  try {
1323
1328
  const own = button;
1324
- if (picked === "any" || button.hasAttribute("data-ohw-btn-variant") || own.style?.color) continue;
1329
+ if (picked === "any" || button.hasAttribute("data-ohw-btn-variant") || own.style?.color) {
1330
+ iconsFollowLabel(button, icons, chips);
1331
+ continue;
1332
+ }
1325
1333
  const fresh = (el) => {
1326
1334
  const behind = el?.parentElement ? painted.get(el.parentElement) : void 0;
1327
1335
  return el && behind && painted.has(el) ? paintOver(deps.style(el), behind).color : void 0;
@@ -1337,12 +1345,21 @@ function fixButtonInk(deps, section, painted) {
1337
1345
  icon.setAttribute(TONE_FIX_ATTR, toneOfColor(behind));
1338
1346
  }
1339
1347
  }
1348
+ iconsFollowLabel(button, icons, chips);
1340
1349
  } finally {
1341
1350
  void deps.style(button).color;
1342
1351
  for (const el of targets) el.removeAttribute(MEASURING_ATTR);
1343
1352
  }
1344
1353
  }
1345
1354
  }
1355
+ function iconsFollowLabel(button, icons, chips) {
1356
+ const label = Array.from(button.querySelectorAll(`[${TONE_FIX_ATTR}]`)).find((el) => !el.closest("svg") && !chips.includes(el));
1357
+ const ink = label?.getAttribute(TONE_FIX_ATTR);
1358
+ if (!ink) return;
1359
+ for (const icon of icons) {
1360
+ if (icon.parentElement === button && !icon.hasAttribute(TONE_FIX_ATTR)) icon.setAttribute(TONE_FIX_ATTR, ink);
1361
+ }
1362
+ }
1346
1363
  var INK_FIX_CSS = `[${MEASURING_ATTR}] { transition: none !important; }
1347
1364
  [${TONE_FIX_ATTR}="dark"] { color: var(--ohw-brand-light, var(--color-light, #FFFFFF)) !important; }
1348
1365
  [${TONE_FIX_ATTR}="light"] { color: var(--ohw-brand-dark, var(--color-dark, #0C0A09)) !important; }
@@ -1569,13 +1586,14 @@ var WATCHED_ATTRS = [
1569
1586
  "class",
1570
1587
  "src",
1571
1588
  "srcset",
1589
+ "poster",
1572
1590
  "data-ohw-style-bg",
1573
1591
  "data-ohw-style-bgcolor",
1574
1592
  "data-ohw-style-cardbg",
1575
1593
  // The editor's Default / Hover toggle forces :hover rules through this attribute.
1576
1594
  "data-ohw-active-state"
1577
1595
  ];
1578
- var VISIBILITY_TRANSITIONS = /* @__PURE__ */ new Set(["opacity", "visibility"]);
1596
+ var RESCAN_TRANSITIONS = /* @__PURE__ */ new Set(["opacity", "visibility", "background-color", "background"]);
1579
1597
  function outermostSection(node) {
1580
1598
  let el = node instanceof Element ? node : node?.parentElement ?? null;
1581
1599
  let top = null;
@@ -1640,7 +1658,7 @@ function mountBackgroundTone(doc = document) {
1640
1658
  });
1641
1659
  const onResize = () => schedule();
1642
1660
  const onTransitionEnd = (event) => {
1643
- if (!VISIBILITY_TRANSITIONS.has(event.propertyName)) return;
1661
+ if (!RESCAN_TRANSITIONS.has(event.propertyName)) return;
1644
1662
  const section = outermostSection(event.target);
1645
1663
  if (section) schedule(section);
1646
1664
  };
@@ -19359,7 +19377,7 @@ function apiBase() {
19359
19377
  function bridgeVersion() {
19360
19378
  try {
19361
19379
  if (true) {
19362
- return "0.1.176";
19380
+ return "0.1.178";
19363
19381
  }
19364
19382
  } catch {
19365
19383
  }
@@ -19373,7 +19391,7 @@ function stampBridgeVersionOnDocument() {
19373
19391
  return;
19374
19392
  }
19375
19393
  try {
19376
- const v = true ? "0.1.176" : "";
19394
+ const v = true ? "0.1.178" : "";
19377
19395
  if (v) {
19378
19396
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
19379
19397
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -34709,7 +34727,7 @@ function OhhwellsBridge() {
34709
34727
  postToParent2({
34710
34728
  type: "ow:ready",
34711
34729
  version: "1",
34712
- bridgeVersion: "0.1.176",
34730
+ bridgeVersion: "0.1.178",
34713
34731
  path: pathname,
34714
34732
  nodes: collectEditableNodes(editContentRef.current),
34715
34733
  sections