@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 +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.js
CHANGED
|
@@ -840,6 +840,11 @@ function findImages(deps, section) {
|
|
|
840
840
|
if (url && style.objectFit === "cover") out.push({ el, url, urlLayer: -1 });
|
|
841
841
|
continue;
|
|
842
842
|
}
|
|
843
|
+
if (el.tagName === "VIDEO") {
|
|
844
|
+
const url = el.poster;
|
|
845
|
+
if (url && style.objectFit === "cover") out.push({ el, url, urlLayer: -1 });
|
|
846
|
+
continue;
|
|
847
|
+
}
|
|
843
848
|
const layers = bgLayers(style);
|
|
844
849
|
const urlLayer = layers.findIndex((l) => urlOf(l) !== null);
|
|
845
850
|
if (urlLayer >= 0) out.push({ el, url: urlOf(layers[urlLayer]), urlLayer });
|
|
@@ -1152,7 +1157,10 @@ function fixButtonInk(deps, section, painted) {
|
|
|
1152
1157
|
}
|
|
1153
1158
|
try {
|
|
1154
1159
|
const own = button;
|
|
1155
|
-
if (picked === "any" || button.hasAttribute("data-ohw-btn-variant") || own.style?.color)
|
|
1160
|
+
if (picked === "any" || button.hasAttribute("data-ohw-btn-variant") || own.style?.color) {
|
|
1161
|
+
iconsFollowLabel(button, icons, chips);
|
|
1162
|
+
continue;
|
|
1163
|
+
}
|
|
1156
1164
|
const fresh = (el) => {
|
|
1157
1165
|
const behind = el?.parentElement ? painted.get(el.parentElement) : void 0;
|
|
1158
1166
|
return el && behind && painted.has(el) ? paintOver(deps.style(el), behind).color : void 0;
|
|
@@ -1168,12 +1176,21 @@ function fixButtonInk(deps, section, painted) {
|
|
|
1168
1176
|
icon.setAttribute(TONE_FIX_ATTR, toneOfColor(behind));
|
|
1169
1177
|
}
|
|
1170
1178
|
}
|
|
1179
|
+
iconsFollowLabel(button, icons, chips);
|
|
1171
1180
|
} finally {
|
|
1172
1181
|
void deps.style(button).color;
|
|
1173
1182
|
for (const el of targets) el.removeAttribute(MEASURING_ATTR);
|
|
1174
1183
|
}
|
|
1175
1184
|
}
|
|
1176
1185
|
}
|
|
1186
|
+
function iconsFollowLabel(button, icons, chips) {
|
|
1187
|
+
const label = Array.from(button.querySelectorAll(`[${TONE_FIX_ATTR}]`)).find((el) => !el.closest("svg") && !chips.includes(el));
|
|
1188
|
+
const ink = label?.getAttribute(TONE_FIX_ATTR);
|
|
1189
|
+
if (!ink) return;
|
|
1190
|
+
for (const icon of icons) {
|
|
1191
|
+
if (icon.parentElement === button && !icon.hasAttribute(TONE_FIX_ATTR)) icon.setAttribute(TONE_FIX_ATTR, ink);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1177
1194
|
var INK_FIX_CSS = `[${MEASURING_ATTR}] { transition: none !important; }
|
|
1178
1195
|
[${TONE_FIX_ATTR}="dark"] { color: var(--ohw-brand-light, var(--color-light, #FFFFFF)) !important; }
|
|
1179
1196
|
[${TONE_FIX_ATTR}="light"] { color: var(--ohw-brand-dark, var(--color-dark, #0C0A09)) !important; }
|
|
@@ -1400,13 +1417,14 @@ var WATCHED_ATTRS = [
|
|
|
1400
1417
|
"class",
|
|
1401
1418
|
"src",
|
|
1402
1419
|
"srcset",
|
|
1420
|
+
"poster",
|
|
1403
1421
|
"data-ohw-style-bg",
|
|
1404
1422
|
"data-ohw-style-bgcolor",
|
|
1405
1423
|
"data-ohw-style-cardbg",
|
|
1406
1424
|
// The editor's Default / Hover toggle forces :hover rules through this attribute.
|
|
1407
1425
|
"data-ohw-active-state"
|
|
1408
1426
|
];
|
|
1409
|
-
var
|
|
1427
|
+
var RESCAN_TRANSITIONS = /* @__PURE__ */ new Set(["opacity", "visibility", "background-color", "background"]);
|
|
1410
1428
|
function outermostSection(node) {
|
|
1411
1429
|
let el = node instanceof Element ? node : node?.parentElement ?? null;
|
|
1412
1430
|
let top = null;
|
|
@@ -1471,7 +1489,7 @@ function mountBackgroundTone(doc = document) {
|
|
|
1471
1489
|
});
|
|
1472
1490
|
const onResize = () => schedule();
|
|
1473
1491
|
const onTransitionEnd = (event) => {
|
|
1474
|
-
if (!
|
|
1492
|
+
if (!RESCAN_TRANSITIONS.has(event.propertyName)) return;
|
|
1475
1493
|
const section = outermostSection(event.target);
|
|
1476
1494
|
if (section) schedule(section);
|
|
1477
1495
|
};
|
|
@@ -19190,7 +19208,7 @@ function apiBase() {
|
|
|
19190
19208
|
function bridgeVersion() {
|
|
19191
19209
|
try {
|
|
19192
19210
|
if (true) {
|
|
19193
|
-
return "0.1.
|
|
19211
|
+
return "0.1.178";
|
|
19194
19212
|
}
|
|
19195
19213
|
} catch {
|
|
19196
19214
|
}
|
|
@@ -19204,7 +19222,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
19204
19222
|
return;
|
|
19205
19223
|
}
|
|
19206
19224
|
try {
|
|
19207
|
-
const v = true ? "0.1.
|
|
19225
|
+
const v = true ? "0.1.178" : "";
|
|
19208
19226
|
if (v) {
|
|
19209
19227
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
19210
19228
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -34546,7 +34564,7 @@ function OhhwellsBridge() {
|
|
|
34546
34564
|
postToParent2({
|
|
34547
34565
|
type: "ow:ready",
|
|
34548
34566
|
version: "1",
|
|
34549
|
-
bridgeVersion: "0.1.
|
|
34567
|
+
bridgeVersion: "0.1.178",
|
|
34550
34568
|
path: pathname,
|
|
34551
34569
|
nodes: collectEditableNodes(editContentRef.current),
|
|
34552
34570
|
sections
|