@ohhwells/bridge 0.1.174-next.465 → 0.1.174-next.471
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 +24 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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)
|
|
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
|
|
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 (!
|
|
1661
|
+
if (!RESCAN_TRANSITIONS.has(event.propertyName)) return;
|
|
1644
1662
|
const section = outermostSection(event.target);
|
|
1645
1663
|
if (section) schedule(section);
|
|
1646
1664
|
};
|
|
@@ -19433,7 +19451,7 @@ function apiBase() {
|
|
|
19433
19451
|
function bridgeVersion() {
|
|
19434
19452
|
try {
|
|
19435
19453
|
if (true) {
|
|
19436
|
-
return "0.1.174-next.
|
|
19454
|
+
return "0.1.174-next.471";
|
|
19437
19455
|
}
|
|
19438
19456
|
} catch {
|
|
19439
19457
|
}
|
|
@@ -19447,7 +19465,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
19447
19465
|
return;
|
|
19448
19466
|
}
|
|
19449
19467
|
try {
|
|
19450
|
-
const v = true ? "0.1.174-next.
|
|
19468
|
+
const v = true ? "0.1.174-next.471" : "";
|
|
19451
19469
|
if (v) {
|
|
19452
19470
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
19453
19471
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -34832,7 +34850,7 @@ function OhhwellsBridge() {
|
|
|
34832
34850
|
postToParent2({
|
|
34833
34851
|
type: "ow:ready",
|
|
34834
34852
|
version: "1",
|
|
34835
|
-
bridgeVersion: "0.1.174-next.
|
|
34853
|
+
bridgeVersion: "0.1.174-next.471",
|
|
34836
34854
|
path: pathname,
|
|
34837
34855
|
nodes: collectEditableNodes(editContentRef.current),
|
|
34838
34856
|
sections
|