@ohhwells/bridge 0.1.174-next.464 → 0.1.174-next.468

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
@@ -90,6 +90,7 @@ __export(index_exports, {
90
90
  applyLogoVersionsFromContent: () => applyLogoVersionsFromContent,
91
91
  applyStickySearchParams: () => applyStickySearchParams,
92
92
  blockPathFromEditKey: () => blockPathFromEditKey,
93
+ brandColorVars: () => brandColorVars,
93
94
  buildDefaultFooterTree: () => buildDefaultFooterTree,
94
95
  buildTarget: () => buildTarget,
95
96
  canRemoveAiBlock: () => canRemoveAiBlock,
@@ -1320,7 +1321,10 @@ function fixButtonInk(deps, section, painted) {
1320
1321
  }
1321
1322
  try {
1322
1323
  const own = button;
1323
- if (picked === "any" || button.hasAttribute("data-ohw-btn-variant") || own.style?.color) continue;
1324
+ if (picked === "any" || button.hasAttribute("data-ohw-btn-variant") || own.style?.color) {
1325
+ iconsFollowLabel(button, icons, chips);
1326
+ continue;
1327
+ }
1324
1328
  const fresh = (el) => {
1325
1329
  const behind = el?.parentElement ? painted.get(el.parentElement) : void 0;
1326
1330
  return el && behind && painted.has(el) ? paintOver(deps.style(el), behind).color : void 0;
@@ -1336,12 +1340,21 @@ function fixButtonInk(deps, section, painted) {
1336
1340
  icon.setAttribute(TONE_FIX_ATTR, toneOfColor(behind));
1337
1341
  }
1338
1342
  }
1343
+ iconsFollowLabel(button, icons, chips);
1339
1344
  } finally {
1340
1345
  void deps.style(button).color;
1341
1346
  for (const el of targets) el.removeAttribute(MEASURING_ATTR);
1342
1347
  }
1343
1348
  }
1344
1349
  }
1350
+ function iconsFollowLabel(button, icons, chips) {
1351
+ const label = Array.from(button.querySelectorAll(`[${TONE_FIX_ATTR}]`)).find((el) => !el.closest("svg") && !chips.includes(el));
1352
+ const ink = label?.getAttribute(TONE_FIX_ATTR);
1353
+ if (!ink) return;
1354
+ for (const icon of icons) {
1355
+ if (icon.parentElement === button && !icon.hasAttribute(TONE_FIX_ATTR)) icon.setAttribute(TONE_FIX_ATTR, ink);
1356
+ }
1357
+ }
1345
1358
  var INK_FIX_CSS = `[${MEASURING_ATTR}] { transition: none !important; }
1346
1359
  [${TONE_FIX_ATTR}="dark"] { color: var(--ohw-brand-light, var(--color-light, #FFFFFF)) !important; }
1347
1360
  [${TONE_FIX_ATTR}="light"] { color: var(--ohw-brand-dark, var(--color-dark, #0C0A09)) !important; }
@@ -8596,8 +8609,10 @@ var LEGACY_BRAND_VAR_NAMES = [
8596
8609
  "border",
8597
8610
  "on-primary",
8598
8611
  "on-primary-muted",
8599
- "on-primary-faint"
8600
- ].map((role) => `--brand-${role}`);
8612
+ "on-primary-faint",
8613
+ "on-accent",
8614
+ "on-accent-muted"
8615
+ ].map((role) => `--brand-${role}`).concat(["--on-primary", "--on-accent"]);
8601
8616
  var FONT_VARS = {
8602
8617
  heading: ["--font-heading", "--font-display", "--brand-font-heading"],
8603
8618
  body: ["--font-body", "--brand-font-body"]
@@ -8724,6 +8739,7 @@ function brandColorVars(palette) {
8724
8739
  const border = mix(light, 85, dark);
8725
8740
  const muted = mix(dark, 62, light);
8726
8741
  const onPrimary = onPrimaryInk(primary, light, dark);
8742
+ const onAccent = onPrimaryInk(accent, light, dark);
8727
8743
  return {
8728
8744
  [`${BRAND_VAR_PREFIX}primary`]: primary,
8729
8745
  [`${BRAND_VAR_PREFIX}accent`]: accent,
@@ -8745,7 +8761,13 @@ function brandColorVars(palette) {
8745
8761
  // Muted and faint are template literals (cream at 75% / 55%) the kit has to follow too.
8746
8762
  "--brand-on-primary": onPrimary,
8747
8763
  "--brand-on-primary-muted": `color-mix(in srgb, ${onPrimary} 75%, transparent)`,
8748
- "--brand-on-primary-faint": `color-mix(in srgb, ${onPrimary} 55%, transparent)`
8764
+ "--brand-on-primary-faint": `color-mix(in srgb, ${onPrimary} 55%, transparent)`,
8765
+ // Same rule for anything painted Accent (drserene, salon, tutor surfaces). Templates bake
8766
+ // these in from their build-time palette, so an Accent changed in the editor kept the old ink.
8767
+ "--brand-on-accent": onAccent,
8768
+ "--brand-on-accent-muted": `color-mix(in srgb, ${onAccent} 75%, transparent)`,
8769
+ "--on-primary": onPrimary,
8770
+ "--on-accent": onAccent
8749
8771
  };
8750
8772
  }
8751
8773
  function onPrimaryInk(primary, light, dark) {
@@ -19423,7 +19445,7 @@ function apiBase() {
19423
19445
  function bridgeVersion() {
19424
19446
  try {
19425
19447
  if (true) {
19426
- return "0.1.174-next.464";
19448
+ return "0.1.174-next.468";
19427
19449
  }
19428
19450
  } catch {
19429
19451
  }
@@ -19437,7 +19459,7 @@ function stampBridgeVersionOnDocument() {
19437
19459
  return;
19438
19460
  }
19439
19461
  try {
19440
- const v = true ? "0.1.174-next.464" : "";
19462
+ const v = true ? "0.1.174-next.468" : "";
19441
19463
  if (v) {
19442
19464
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
19443
19465
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -34822,7 +34844,7 @@ function OhhwellsBridge() {
34822
34844
  postToParent2({
34823
34845
  type: "ow:ready",
34824
34846
  version: "1",
34825
- bridgeVersion: "0.1.174-next.464",
34847
+ bridgeVersion: "0.1.174-next.468",
34826
34848
  path: pathname,
34827
34849
  nodes: collectEditableNodes(editContentRef.current),
34828
34850
  sections
@@ -36236,6 +36258,7 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
36236
36258
  applyLogoVersionsFromContent,
36237
36259
  applyStickySearchParams,
36238
36260
  blockPathFromEditKey,
36261
+ brandColorVars,
36239
36262
  buildDefaultFooterTree,
36240
36263
  buildTarget,
36241
36264
  canRemoveAiBlock,