@designcrowd/library.brand-page 6.1.10-hotfix-1 → 6.1.10
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/lib/src/{CreatedOnBrandCrowd-de-de-5aRw6rTj.js → CreatedOnBrandCrowd-de-de-nsMF2NQ9.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DNnU_ci9.js → CreatedOnBrandCrowd-en-us-BQI_UCR7.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BeoYtuRU.js → CreatedOnBrandCrowd-es-es-DgNOoSPn.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DR_A2XJ3.js → CreatedOnBrandCrowd-fr-ca-JFRaxjvx.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DR_A2XJ3.js → CreatedOnBrandCrowd-fr-fr-JFRaxjvx.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CuGktvdo.js → CreatedOnBrandCrowd-pt-br-DP6_-90i.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CuGktvdo.js → CreatedOnBrandCrowd-pt-pt-DP6_-90i.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-KwlBmF8F.js → CreatedOnDcom-de-de-07F2wjkk.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-DDDGvxGT.js → CreatedOnDcom-en-us-DaV9sa6e.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-Cc34QONM.js → CreatedOnDcom-es-es-73uOymvv.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BjKjj4Gm.js → CreatedOnDcom-fr-ca-Ci9Ome30.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DwYIN1Ys.js → CreatedOnDcom-fr-fr-DLHuMHfE.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BQBYLT3g.js → CreatedOnDcom-pt-br-Fbt7tY-E.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-CglluuDm.js → CreatedOnDcom-pt-pt-V2jTB6of.js} +1 -1
- package/lib/src/brand-page/models/index.d.ts +1 -1
- package/lib/src/brand-page/models/index.js +6 -6
- package/lib/src/brand-page/utils/container-text-color.util.d.ts +4 -7
- package/lib/src/brand-page/utils/container-text-color.util.js +6 -11
- package/lib/src/brand-page/utils/migration/migration-21.js +0 -62
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-Cq_uqhSn.js → lib-D2a1EmRb.js} +11705 -11724
- package/package.json +1 -1
- package/src/brand-page/models/footer-icon-color.test.ts +102 -38
- package/src/brand-page/models/index.ts +9 -6
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +6 -6
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +6 -2
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +12 -4
- package/src/brand-page/utils/container-text-color.util.test.ts +0 -16
- package/src/brand-page/utils/container-text-color.util.ts +6 -15
- package/src/brand-page/utils/migration/migration-21.test.ts +0 -169
- package/src/brand-page/utils/migration/migration-21.ts +0 -75
|
@@ -556,7 +556,7 @@ export declare abstract class AbstractPageFooterStyles {
|
|
|
556
556
|
viewport: ViewportsType;
|
|
557
557
|
logoImageHeight: string | undefined;
|
|
558
558
|
logoImageWidth: string | undefined;
|
|
559
|
-
protected constructor(options?: AbstractPageFooterStylesType,
|
|
559
|
+
protected constructor(options?: AbstractPageFooterStylesType, theme?: Theme);
|
|
560
560
|
}
|
|
561
561
|
export type MediaTypes = 'getty-video' | 'user-upload-video' | 'image';
|
|
562
562
|
export declare abstract class AbstractMedia {
|
|
@@ -313,7 +313,7 @@ export class AbstractPageFooterStyles {
|
|
|
313
313
|
viewport;
|
|
314
314
|
logoImageHeight;
|
|
315
315
|
logoImageWidth;
|
|
316
|
-
constructor(options = {},
|
|
316
|
+
constructor(options = {}, theme) {
|
|
317
317
|
if (typeof options.viewport === 'undefined') {
|
|
318
318
|
throw new Error('"viewport" is required');
|
|
319
319
|
}
|
|
@@ -378,11 +378,11 @@ export class AbstractPageFooterStyles {
|
|
|
378
378
|
imageLink: '',
|
|
379
379
|
},
|
|
380
380
|
];
|
|
381
|
-
//
|
|
382
|
-
//
|
|
383
|
-
//
|
|
384
|
-
//
|
|
385
|
-
this.iconStyle =
|
|
381
|
+
// Seed the social-icon colour from the theme's PRIMARY (logo text) colour: the
|
|
382
|
+
// footer background is transparent, so icons sit on the page background — the
|
|
383
|
+
// logo-background colour — and need the contrasting one to stay legible.
|
|
384
|
+
// Object.assign so an explicit persisted colour still wins.
|
|
385
|
+
this.iconStyle = Object.assign(theme?.primaryColor ? { fill: theme.primaryColor } : {}, options.iconStyle || {});
|
|
386
386
|
this.textFontFamily = options.textFontFamily;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
@@ -57,13 +57,10 @@ export declare const containerTextColorDefaults: (content: Content, styles: Page
|
|
|
57
57
|
* than silently recolouring published sites to the linked global — the exact trap ADR 0014
|
|
58
58
|
* names, here applied to the migration bake (ADR 0015).
|
|
59
59
|
*
|
|
60
|
-
* Two frame families:
|
|
61
|
-
* - **text / profile** — framed when the content has its own
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* `'transparent'` (the maker's default background) too — only an alpha-`00` hex was
|
|
65
|
-
* unframed — so its empty-mark RTE inherited the button colour. This bake must reproduce
|
|
66
|
-
* that, or every default text/profile section silently recolours to the root paint.
|
|
60
|
+
* Two frame families, mirroring the renderer:
|
|
61
|
+
* - **text / profile** — framed when the content has its own SOLID background (gate mirrors
|
|
62
|
+
* the view-model's container gate: a `background`/`backgroundColor` present and not an
|
|
63
|
+
* alpha-`00` hex).
|
|
67
64
|
* - **the container-bound blocks** (mailing-list, request-payment, support-me, non-brandSite
|
|
68
65
|
* contact-form) — always framed; `containerSurfaceForContent` is the existing oracle for
|
|
69
66
|
* "does this block paint a frame" (and encodes the brandSite contact-form carve-out), and
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BRAND_PAGE_TYPES } from '../models';
|
|
2
|
-
import { backgroundColorFromStyle, isTransparentColour
|
|
2
|
+
import { backgroundColorFromStyle, isTransparentColour } from './color.util';
|
|
3
3
|
import { resolveColorReference, bestContrastBrandRole, toColorVarReference, roleValueOrDefault, } from './color-palette.util';
|
|
4
4
|
/**
|
|
5
5
|
* The text-style fields that sit on the block's filled surface. `buttonTextStyle` is
|
|
@@ -167,13 +167,10 @@ const OWN_BACKGROUND_FRAME_TYPES = new Set([
|
|
|
167
167
|
* than silently recolouring published sites to the linked global — the exact trap ADR 0014
|
|
168
168
|
* names, here applied to the migration bake (ADR 0015).
|
|
169
169
|
*
|
|
170
|
-
* Two frame families:
|
|
171
|
-
* - **text / profile** — framed when the content has its own
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* `'transparent'` (the maker's default background) too — only an alpha-`00` hex was
|
|
175
|
-
* unframed — so its empty-mark RTE inherited the button colour. This bake must reproduce
|
|
176
|
-
* that, or every default text/profile section silently recolours to the root paint.
|
|
170
|
+
* Two frame families, mirroring the renderer:
|
|
171
|
+
* - **text / profile** — framed when the content has its own SOLID background (gate mirrors
|
|
172
|
+
* the view-model's container gate: a `background`/`backgroundColor` present and not an
|
|
173
|
+
* alpha-`00` hex).
|
|
177
174
|
* - **the container-bound blocks** (mailing-list, request-payment, support-me, non-brandSite
|
|
178
175
|
* contact-form) — always framed; `containerSurfaceForContent` is the existing oracle for
|
|
179
176
|
* "does this block paint a frame" (and encodes the brandSite contact-form carve-out), and
|
|
@@ -192,9 +189,7 @@ export const rteFrameFallbackColour = (content, styles, brandPageType) => {
|
|
|
192
189
|
if (OWN_BACKGROUND_FRAME_TYPES.has(content.type)) {
|
|
193
190
|
const background = content.backgroundColor;
|
|
194
191
|
const reference = background?.background || background?.backgroundColor;
|
|
195
|
-
|
|
196
|
-
// `'transparent'` (only an alpha-00 hex was unframed), so the bake must too — see docblock.
|
|
197
|
-
return reference && !isHexTransparent(reference)
|
|
192
|
+
return reference && !isTransparentColour(reference)
|
|
198
193
|
? buttonTextColour
|
|
199
194
|
: undefined;
|
|
200
195
|
}
|
|
@@ -356,63 +356,6 @@ export const moveRootTextColourIntoGlobalStyles = (brandPageModel) => {
|
|
|
356
356
|
// Copy and delete stay together so the source is never dropped unconverted.
|
|
357
357
|
delete textStyles['style'];
|
|
358
358
|
};
|
|
359
|
-
/* -------------------------------------------------------------------------- *
|
|
360
|
-
* Step FINAL−: bake the social-icon fills the palette walk leaves unset
|
|
361
|
-
* -------------------------------------------------------------------------- */
|
|
362
|
-
/**
|
|
363
|
-
* The footer social icons carry no `fill` in their SVGs, so an unset footer icon painted
|
|
364
|
-
* the SVG default (black). Baked as a LITERAL, not a palette ref — a fixed fallback for
|
|
365
|
-
* that previously-implicit default, so it does not mint a palette custom or follow palette
|
|
366
|
-
* edits. Painted after pass B, so referencify never sees it.
|
|
367
|
-
*/
|
|
368
|
-
const FOOTER_ICON_FALLBACK_COLOUR = '#000000';
|
|
369
|
-
/**
|
|
370
|
-
* Bake the two social-icon fills that neither the palette walk nor a resolver sets, so
|
|
371
|
-
* each persists an explicit colour instead of a render-time seed that changed under V2:
|
|
372
|
-
*
|
|
373
|
-
* - **social-links content** (`iconFillStyles.fill`) → the site's ROOT text colour, the
|
|
374
|
-
* colour the icon followed before the palette split (`styles.textStyles.style.color`).
|
|
375
|
-
* Read here — already referencified by pass B — BEFORE
|
|
376
|
-
* `moveRootTextColourIntoGlobalStyles` retires it, which is why this runs at Step FINAL−.
|
|
377
|
-
* - **footer** (`pageFooter{Desktop,Mobile}.iconStyle.fill`) → a literal black
|
|
378
|
-
* (`FOOTER_ICON_FALLBACK_COLOUR`).
|
|
379
|
-
*
|
|
380
|
-
* Blank-only: an explicit persisted colour is never touched (`Object`-spread with the fill
|
|
381
|
-
* appended only when absent). A re-run finds every fill set, so it is a no-op.
|
|
382
|
-
*/
|
|
383
|
-
const bakeIconColours = (brandPageModel) => {
|
|
384
|
-
const rootTextColour = legacyRootTextColour(brandPageModel);
|
|
385
|
-
if (!isBlankColorValue(rootTextColour)) {
|
|
386
|
-
for (const page of brandPageModel.pages ?? []) {
|
|
387
|
-
for (const content of page.contents ?? []) {
|
|
388
|
-
if (content.type !== 'social-links') {
|
|
389
|
-
continue;
|
|
390
|
-
}
|
|
391
|
-
const fields = content;
|
|
392
|
-
const iconFillStyles = (fields.iconFillStyles ?? {});
|
|
393
|
-
if (isBlankColorValue(iconFillStyles.fill)) {
|
|
394
|
-
fields.iconFillStyles = { ...iconFillStyles, fill: rootTextColour };
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
for (const footer of [
|
|
400
|
-
brandPageModel.pageFooterDesktop,
|
|
401
|
-
brandPageModel.pageFooterMobile,
|
|
402
|
-
]) {
|
|
403
|
-
if (!footer) {
|
|
404
|
-
continue;
|
|
405
|
-
}
|
|
406
|
-
const footerRecord = footer;
|
|
407
|
-
const iconStyle = (footerRecord.iconStyle ?? {});
|
|
408
|
-
if (isBlankColorValue(iconStyle.fill)) {
|
|
409
|
-
footerRecord.iconStyle = {
|
|
410
|
-
...iconStyle,
|
|
411
|
-
fill: FOOTER_ICON_FALLBACK_COLOUR,
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
359
|
/* -------------------------------------------------------------------------- *
|
|
417
360
|
* Step 0.1: retire styles.logoStyles.backgroundStyle onto the logo content
|
|
418
361
|
* -------------------------------------------------------------------------- */
|
|
@@ -764,11 +707,6 @@ export const migration21 = async (migrationResult, _options) => {
|
|
|
764
707
|
const referencify = makeReferencifyTransform(builder, paletteRoleByCanonical);
|
|
765
708
|
parts.forEach((part) => walkModelColors(part, referencify, true));
|
|
766
709
|
brandPageModel.styles.colors = builder.toColorItems();
|
|
767
|
-
// ---- Step FINAL−: bake icon fills before the root colour is retired ----
|
|
768
|
-
// Social-links icons take the now-referencified root text colour they followed before
|
|
769
|
-
// the palette split; footer icons take a literal black fallback. Reads the root ref, so
|
|
770
|
-
// it MUST precede its retirement below.
|
|
771
|
-
bakeIconColours(brandPageModel);
|
|
772
710
|
// ---- Step FINAL: retire the root text colour (order matters — see docblock) ----
|
|
773
711
|
moveRootTextColourIntoGlobalStyles(brandPageModel);
|
|
774
712
|
// ---- Step FINAL+1: bake the resolved colour into inherit-only RTE runs ----
|
package/lib/src/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, a as I, b as S, c as N, d as e, e as A, f as O, B as t, g as C, h as D, i as G, j as P, k as R, l as o, m as L, n as M, o as r, p as n, q as i, r as l, s as b, t as c, u as F, v as g, w as B, x as Y, y as U, z as d, C as u, D as H, E as p, F as y, G as m, H as K, I as k, J as V, K as v, L as X, M as h, N as f, O as x, P as W, Q as z, R as w, S as J, T as Z, U as j, V as q, W as Q, X as $, Y as aa, Z as Ea, $ as _a, a0 as Ta, a1 as sa, a2 as Ia, a3 as Sa, a4 as Na, a5 as ea, a6 as Aa, a7 as Oa, a8 as ta, a9 as Ca, aa as Da, ab as Ga, ac as Pa, ad as Ra, ae as oa, af as La, ag as Ma, ah as ra, ai as na, aj as ia, ak as la, al as ba, am as ca, an as Fa, ao as ga, ap as Ba, aq as Ya, ar as Ua, as as da, at as ua, au as Ha, av as pa, aw as ya, ax as ma, ay as Ka, az as ka, aA as Va, aB as va, aC as Xa, aD as ha, aE as fa, aF as xa, aG as Wa, aH as za, aI as wa, aJ as Ja, aK as Za, aL as ja, aM as qa, aN as Qa, aO as $a, aP as aE, aQ as EE, aR as _E, aS as TE, aT as sE, aU as IE, aV as SE, aW as NE, aX as eE, aY as AE, aZ as OE, a_ as tE, a$ as CE, b0 as DE, b1 as GE, b2 as PE, b3 as RE, b4 as oE, b5 as LE, b6 as ME, b7 as rE, b8 as nE, b9 as iE, ba as lE, bb as bE, bc as cE, bd as FE, be as gE, bf as BE, bg as YE, bh as UE, bi as dE, bj as uE, bk as HE, bl as pE, bm as yE, bn as mE, bo as KE, bp as kE, bq as VE, br as vE, bs as XE, bt as hE, bu as fE, bv as xE, bw as WE, bx as zE, by as wE, bz as JE, bA as ZE, bB as jE, bC as qE, bD as QE, bE as $E, bF as a_, bG as E_, bH as __, bI as T_, bJ as s_, bK as I_, bL as S_, bM as N_, bN as e_, bO as A_, bP as O_, bQ as t_, bR as C_, bS as D_, bT as G_, bU as P_, bV as R_, bW as o_, bX as L_, bY as M_, bZ as r_, b_ as n_, b$ as i_, c0 as l_, c1 as b_, c2 as c_, c3 as F_, c4 as g_, c5 as B_, c6 as Y_, c7 as U_, c8 as d_, c9 as u_, ca as H_, cb as p_, cc as y_, cd as m_, ce as K_, cf as k_, cg as V_, ch as v_, ci as X_, cj as h_, ck as f_, cl as x_, cm as W_, cn as z_, co as w_, cp as J_, cq as Z_, cr as j_, cs as q_, ct as Q_, cu as $_, cv as aT, cw as ET, cx as _T, cy as TT, cz as sT, cA as IT, cB as ST, cC as NT, cD as eT } from "./lib-
|
|
1
|
+
import { A as s, a as I, b as S, c as N, d as e, e as A, f as O, B as t, g as C, h as D, i as G, j as P, k as R, l as o, m as L, n as M, o as r, p as n, q as i, r as l, s as b, t as c, u as F, v as g, w as B, x as Y, y as U, z as d, C as u, D as H, E as p, F as y, G as m, H as K, I as k, J as V, K as v, L as X, M as h, N as f, O as x, P as W, Q as z, R as w, S as J, T as Z, U as j, V as q, W as Q, X as $, Y as aa, Z as Ea, $ as _a, a0 as Ta, a1 as sa, a2 as Ia, a3 as Sa, a4 as Na, a5 as ea, a6 as Aa, a7 as Oa, a8 as ta, a9 as Ca, aa as Da, ab as Ga, ac as Pa, ad as Ra, ae as oa, af as La, ag as Ma, ah as ra, ai as na, aj as ia, ak as la, al as ba, am as ca, an as Fa, ao as ga, ap as Ba, aq as Ya, ar as Ua, as as da, at as ua, au as Ha, av as pa, aw as ya, ax as ma, ay as Ka, az as ka, aA as Va, aB as va, aC as Xa, aD as ha, aE as fa, aF as xa, aG as Wa, aH as za, aI as wa, aJ as Ja, aK as Za, aL as ja, aM as qa, aN as Qa, aO as $a, aP as aE, aQ as EE, aR as _E, aS as TE, aT as sE, aU as IE, aV as SE, aW as NE, aX as eE, aY as AE, aZ as OE, a_ as tE, a$ as CE, b0 as DE, b1 as GE, b2 as PE, b3 as RE, b4 as oE, b5 as LE, b6 as ME, b7 as rE, b8 as nE, b9 as iE, ba as lE, bb as bE, bc as cE, bd as FE, be as gE, bf as BE, bg as YE, bh as UE, bi as dE, bj as uE, bk as HE, bl as pE, bm as yE, bn as mE, bo as KE, bp as kE, bq as VE, br as vE, bs as XE, bt as hE, bu as fE, bv as xE, bw as WE, bx as zE, by as wE, bz as JE, bA as ZE, bB as jE, bC as qE, bD as QE, bE as $E, bF as a_, bG as E_, bH as __, bI as T_, bJ as s_, bK as I_, bL as S_, bM as N_, bN as e_, bO as A_, bP as O_, bQ as t_, bR as C_, bS as D_, bT as G_, bU as P_, bV as R_, bW as o_, bX as L_, bY as M_, bZ as r_, b_ as n_, b$ as i_, c0 as l_, c1 as b_, c2 as c_, c3 as F_, c4 as g_, c5 as B_, c6 as Y_, c7 as U_, c8 as d_, c9 as u_, ca as H_, cb as p_, cc as y_, cd as m_, ce as K_, cf as k_, cg as V_, ch as v_, ci as X_, cj as h_, ck as f_, cl as x_, cm as W_, cn as z_, co as w_, cp as J_, cq as Z_, cr as j_, cs as q_, ct as Q_, cu as $_, cv as aT, cw as ET, cx as _T, cy as TT, cz as sT, cA as IT, cB as ST, cC as NT, cD as eT } from "./lib-D2a1EmRb.js";
|
|
2
2
|
import { U as OT, u as tT } from "./useEventTracker-Dmc2jFdN.js";
|
|
3
3
|
import "vue";
|
|
4
4
|
import "vue-cropperjs";
|