@designcrowd/library.brand-page 6.2.15 → 6.2.16-publish-11

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.
Files changed (30) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-CYdJJjNJ.js → CreatedOnBrandCrowd-de-de-B_-PPZBi.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BSGwyIBg.js → CreatedOnBrandCrowd-en-us-BO1Kj3iA.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-C0cogd_P.js → CreatedOnBrandCrowd-es-es-BoDJWRn2.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DR4TbHdK.js → CreatedOnBrandCrowd-fr-ca-DUJZmdAy.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-DR4TbHdK.js → CreatedOnBrandCrowd-fr-fr-DUJZmdAy.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-D3QLE-Rk.js → CreatedOnBrandCrowd-pt-br-pIlAG13E.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-D3QLE-Rk.js → CreatedOnBrandCrowd-pt-pt-pIlAG13E.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CwRHSP3M.js → CreatedOnDcom-de-de-BNJtDtvi.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-BEn36py1.js → CreatedOnDcom-en-us-uL6WU_1S.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-CQt-H117.js → CreatedOnDcom-es-es-DGZQISoF.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-Cc1tyCJh.js → CreatedOnDcom-fr-ca-CvYWKqNh.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-52ucQbtE.js → CreatedOnDcom-fr-fr-CpohVgCR.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-BPMJmtaC.js → CreatedOnDcom-pt-br-CaKS-48n.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-D9RqaBx4.js → CreatedOnDcom-pt-pt-D4g-iecQ.js} +1 -1
  15. package/lib/src/brand-page/utils/migration/migration-22.d.ts +10 -4
  16. package/lib/src/brand-page/utils/migration/migration-22.js +59 -5
  17. package/lib/src/index.mjs +1 -1
  18. package/lib/src/{lib-roR8wIA2.js → lib-DwDFHSzX.js} +8862 -8818
  19. package/package.json +1 -1
  20. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +1 -0
  21. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/edited-brandsite-sections.v22.json +6 -3
  22. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandcontact-every-section.v22.json +26 -13
  23. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandpage-every-section.v22.json +24 -12
  24. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandsite-every-section.v22.json +24 -12
  25. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandcontact.v22.json +8 -4
  26. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-general-link.v22.json +6 -3
  27. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-links.v22.json +6 -3
  28. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-header-banner.v22.json +2 -1
  29. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-sections.v22.json +6 -3
  30. package/src/brand-page/utils/migration/migration-22.ts +103 -4
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-roR8wIA2.js";
2
+ import { _ as t } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-roR8wIA2.js";
2
+ import { _ as t } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-roR8wIA2.js";
2
+ import { _ as t } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-roR8wIA2.js";
2
+ import { _ as t } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-roR8wIA2.js";
2
+ import { _ as t } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-roR8wIA2.js";
2
+ import { _ as t } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-roR8wIA2.js";
2
+ import { _ as t } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-roR8wIA2.js";
2
+ import { _ as e } from "./lib-DwDFHSzX.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-roR8wIA2.js";
2
+ import { _ as e } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-roR8wIA2.js";
2
+ import { _ as e } from "./lib-DwDFHSzX.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-roR8wIA2.js";
2
+ import { _ as e } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-roR8wIA2.js";
2
+ import { _ as e } from "./lib-DwDFHSzX.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-roR8wIA2.js";
2
+ import { _ as M } from "./lib-DwDFHSzX.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-roR8wIA2.js";
2
+ import { _ as M } from "./lib-DwDFHSzX.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -81,16 +81,22 @@ export declare const seedRoleColours: (options: TextStyleOptions, targets: Legac
81
81
  export declare const seedRoleFonts: (brandPageModel: BrandPageModel, options: TextStyleOptions) => void;
82
82
  export declare const reconnectContentRoles: (brandPageModel: BrandPageModel, targets: LegacyTargetMap, options: TextStyleOptions) => void;
83
83
  type NoRoleTextStyles = WeakMap<object, Set<string>>;
84
+ type ButtonLabelRole = {
85
+ holder: Record<string, unknown>;
86
+ key: string;
87
+ role: string | undefined;
88
+ };
84
89
  /**
85
90
  * D — freeze each text element's currently-resolved colour so removing the base coat (F)
86
91
  * and the role colour (E) changes no pixels. migration-21 already baked element→frame→role
87
92
  * colour into RTE runs, so the only uncoloured runs reaching here inherit the base coat;
88
93
  * non-RTE fields (21 left them alone) resolve element→container-default→role→base coat.
89
- * `buttonTextStyle` and a link button's `titleStyle` are excluded — the button label takes its
90
- * colour from `buttonStyles`, never the base coat. A social-links section's unset icon fill is
91
- * frozen here too.
94
+ * A button label (`buttonTextStyle`, a link button's `titleStyle`, the header button, Save
95
+ * Contact) never takes the base coat: it bakes the colour of the role it drew before B
96
+ * (`captureButtonLabelRoles`), else `buttonStyles.style.color`. A social-links section's unset
97
+ * icon fill is frozen here too.
92
98
  */
93
- export declare const bakeElementColours: (brandPageModel: BrandPageModel, options: TextStyleOptions, noRoleTextStyles?: NoRoleTextStyles) => void;
99
+ export declare const bakeElementColours: (brandPageModel: BrandPageModel, options: TextStyleOptions, noRoleTextStyles?: NoRoleTextStyles, buttonLabelRoles?: ButtonLabelRole[]) => void;
94
100
  /** E — clear the retired role colour from every role definition (run after D reads it). */
95
101
  export declare const clearRoleColours: (options: TextStyleOptions) => void;
96
102
  export declare const stripRteStyleColours: (brandPageModel: BrandPageModel) => void;
@@ -494,6 +494,42 @@ const captureNoRoleTextStyles = (brandPageModel) => {
494
494
  }
495
495
  return locations;
496
496
  };
497
+ /**
498
+ * A button label drew its own colour, else its role's colour, else inherited
499
+ * `buttonStyles.style.color` — never the base coat or a container default. B moves every label to
500
+ * Button text whatever role it was on, so record the role each colourless label drew before B;
501
+ * D bakes that colour onto the label (E hasn't cleared it yet).
502
+ */
503
+ const captureButtonLabelRoles = (brandPageModel) => {
504
+ const labels = [];
505
+ const record = (holder, key, style) => {
506
+ if (style && isBlankColorValue(style.color)) {
507
+ labels.push({ holder, key, role: style.textStyleType });
508
+ }
509
+ };
510
+ for (const page of brandPageModel.pages ?? []) {
511
+ for (const content of page.contents ?? []) {
512
+ const fields = content;
513
+ for (const key of Object.keys(CONTENT_TEXT_STYLE_PROPERTY_KEYS)) {
514
+ if (key === 'buttonTextStyle' || isButtonLabelField(content, key)) {
515
+ record(fields, key, fields[key]);
516
+ }
517
+ }
518
+ }
519
+ }
520
+ for (const header of [
521
+ brandPageModel.pageHeaderDesktop,
522
+ brandPageModel.pageHeaderMobile,
523
+ ]) {
524
+ const headerButton = header?.headerButton;
525
+ if (headerButton) {
526
+ record(headerButton, 'buttonTextStyle', headerButton.buttonTextStyle ?? {
527
+ textStyleType: TEXT_STYLE_TYPES.buttons,
528
+ });
529
+ }
530
+ }
531
+ return labels;
532
+ };
497
533
  /**
498
534
  * An RTE-eligible field that is a plain string, not a Tiptap doc. On an old site nothing
499
535
  * converts plain text → doc (migration-20 only converts HTML), so such a field renders via
@@ -515,11 +551,12 @@ const roleColour = (options, textStyleType) => textStyleType
515
551
  * and the role colour (E) changes no pixels. migration-21 already baked element→frame→role
516
552
  * colour into RTE runs, so the only uncoloured runs reaching here inherit the base coat;
517
553
  * non-RTE fields (21 left them alone) resolve element→container-default→role→base coat.
518
- * `buttonTextStyle` and a link button's `titleStyle` are excluded — the button label takes its
519
- * colour from `buttonStyles`, never the base coat. A social-links section's unset icon fill is
520
- * frozen here too.
554
+ * A button label (`buttonTextStyle`, a link button's `titleStyle`, the header button, Save
555
+ * Contact) never takes the base coat: it bakes the colour of the role it drew before B
556
+ * (`captureButtonLabelRoles`), else `buttonStyles.style.color`. A social-links section's unset
557
+ * icon fill is frozen here too.
521
558
  */
522
- export const bakeElementColours = (brandPageModel, options, noRoleTextStyles = new WeakMap()) => {
559
+ export const bakeElementColours = (brandPageModel, options, noRoleTextStyles = new WeakMap(), buttonLabelRoles = []) => {
523
560
  const baseCoat = roleColour(options, 'paragraph1');
524
561
  for (const page of brandPageModel.pages ?? []) {
525
562
  for (const content of page.contents ?? []) {
@@ -608,6 +645,22 @@ export const bakeElementColours = (brandPageModel, options, noRoleTextStyles = n
608
645
  }
609
646
  }
610
647
  }
648
+ const buttonStyleColour = brandPageModel.styles?.buttonStyles?.style?.color;
649
+ const bakeLabel = (style, roleColourValue) => {
650
+ const colour = !isBlankColorValue(roleColourValue)
651
+ ? roleColourValue
652
+ : buttonStyleColour;
653
+ if (style && isBlankColorValue(style.color) && !isBlankColorValue(colour)) {
654
+ style.color = colour;
655
+ }
656
+ };
657
+ for (const { holder, key, role } of buttonLabelRoles) {
658
+ bakeLabel(holder[key], roleColour(options, role));
659
+ }
660
+ // Save Contact drew the Buttons role's colour whatever its stored style held.
661
+ if (brandPageModel.brandPageType === BRAND_PAGE_TYPES.brandContact) {
662
+ bakeLabel(brandPageModel.saveContactSettings?.buttonTextStyle, roleColour(options, TEXT_STYLE_TYPES.buttons));
663
+ }
611
664
  // Footer copyright is non-RTE text that resolved through role → base coat, but lives
612
665
  // OUTSIDE `pages[].contents`, so freeze it here too — else it loses its colour when E
613
666
  // clears the role and F removes the base coat (the copyright-on-dark-footer regression).
@@ -902,10 +955,11 @@ export const migration22 = async (migrationResult, _options) => {
902
955
  seedRoleColours(options, targets); // A — seed each old role's colour onto its tier
903
956
  seedRoleFonts(brandPageModel, options); // A2 — count the site's fonts onto each role family
904
957
  const noRoleTextStyles = captureNoRoleTextStyles(brandPageModel);
958
+ const buttonLabelRoles = captureButtonLabelRoles(brandPageModel);
905
959
  reconnectContentRoles(brandPageModel, targets, options); // B — seed button styles, reconnect every text field
906
960
  stripLiftContentRte(brandPageModel, options); // C — RTE baked → override
907
961
  await convertPlainRteFields(brandPageModel, options); // B1 — plain text → Tiptap doc (after C)
908
- bakeElementColours(brandPageModel, options, noRoleTextStyles); // D — freeze resolved colour
962
+ bakeElementColours(brandPageModel, options, noRoleTextStyles, buttonLabelRoles); // D — freeze resolved colour
909
963
  clearRoleColours(options); // E — retire role colour
910
964
  stripRteStyleColours(brandPageModel); // G — colour-decouple RTE style objects
911
965
  }
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as s, a as S, b as I, c as N, d as e, e as A, f as O, g as t, B 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 c, r as i, s as l, t as b, u as F, v as g, w as B, x as Y, y as d, z as U, C as u, D as p, E as H, 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 x, O as f, 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 Ta, $ as Ea, a0 as _a, a1 as sa, a2 as Sa, a3 as Ia, 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 ca, ak as ia, al as la, am as ba, an as Fa, ao as ga, ap as Ba, aq as Ya, ar as da, as as Ua, at as ua, au as pa, av as Ha, 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 xa, aF as fa, 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 aT, aQ as TT, aR as ET, aS as _T, aT as sT, aU as ST, aV as IT, aW as NT, aX as eT, aY as AT, aZ as OT, a_ as tT, a$ as CT, b0 as DT, b1 as GT, b2 as PT, b3 as RT, b4 as oT, b5 as LT, b6 as MT, b7 as rT, b8 as nT, b9 as cT, ba as iT, bb as lT, bc as bT, bd as FT, be as gT, bf as BT, bg as YT, bh as dT, bi as UT, bj as uT, bk as pT, bl as HT, bm as yT, bn as mT, bo as KT, bp as kT, bq as VT, br as vT, bs as XT, bt as hT, bu as xT, bv as fT, bw as WT, bx as zT, by as wT, bz as JT, bA as ZT, bB as jT, bC as qT, bD as QT, bE as $T, bF as aE, bG as TE, bH as EE, bI as _E, bJ as sE, bK as SE, bL as IE, bM as NE, bN as eE, bO as AE, bP as OE, bQ as tE, bR as CE, bS as DE, bT as GE, bU as PE, bV as RE, bW as oE, bX as LE, bY as ME, bZ as rE, b_ as nE, b$ as cE, c0 as iE, c1 as lE, c2 as bE, c3 as FE, c4 as gE, c5 as BE, c6 as YE, c7 as dE, c8 as UE, c9 as uE, ca as pE, cb as HE, cc as yE, cd as mE, ce as KE, cf as kE, cg as VE, ch as vE, ci as XE, cj as hE, ck as xE, cl as fE, cm as WE, cn as zE, co as wE, cp as JE, cq as ZE, cr as jE, cs as qE, ct as QE, cu as $E, cv as a_, cw as T_, cx as E_, cy as __, cz as s_, cA as S_, cB as I_, cC as N_, cD as e_, cE as A_, cF as O_, cG as t_, cH as C_, cI as D_, cJ as G_ } from "./lib-roR8wIA2.js";
1
+ import { A as s, a as S, b as I, c as N, d as e, e as A, f as O, g as t, B 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 c, r as i, s as l, t as b, u as F, v as g, w as B, x as Y, y as d, z as U, C as u, D as p, E as H, 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 x, O as f, 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 Ta, $ as Ea, a0 as _a, a1 as sa, a2 as Sa, a3 as Ia, 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 ca, ak as ia, al as la, am as ba, an as Fa, ao as ga, ap as Ba, aq as Ya, ar as da, as as Ua, at as ua, au as pa, av as Ha, 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 xa, aF as fa, 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 aT, aQ as TT, aR as ET, aS as _T, aT as sT, aU as ST, aV as IT, aW as NT, aX as eT, aY as AT, aZ as OT, a_ as tT, a$ as CT, b0 as DT, b1 as GT, b2 as PT, b3 as RT, b4 as oT, b5 as LT, b6 as MT, b7 as rT, b8 as nT, b9 as cT, ba as iT, bb as lT, bc as bT, bd as FT, be as gT, bf as BT, bg as YT, bh as dT, bi as UT, bj as uT, bk as pT, bl as HT, bm as yT, bn as mT, bo as KT, bp as kT, bq as VT, br as vT, bs as XT, bt as hT, bu as xT, bv as fT, bw as WT, bx as zT, by as wT, bz as JT, bA as ZT, bB as jT, bC as qT, bD as QT, bE as $T, bF as aE, bG as TE, bH as EE, bI as _E, bJ as sE, bK as SE, bL as IE, bM as NE, bN as eE, bO as AE, bP as OE, bQ as tE, bR as CE, bS as DE, bT as GE, bU as PE, bV as RE, bW as oE, bX as LE, bY as ME, bZ as rE, b_ as nE, b$ as cE, c0 as iE, c1 as lE, c2 as bE, c3 as FE, c4 as gE, c5 as BE, c6 as YE, c7 as dE, c8 as UE, c9 as uE, ca as pE, cb as HE, cc as yE, cd as mE, ce as KE, cf as kE, cg as VE, ch as vE, ci as XE, cj as hE, ck as xE, cl as fE, cm as WE, cn as zE, co as wE, cp as JE, cq as ZE, cr as jE, cs as qE, ct as QE, cu as $E, cv as a_, cw as T_, cx as E_, cy as __, cz as s_, cA as S_, cB as I_, cC as N_, cD as e_, cE as A_, cF as O_, cG as t_, cH as C_, cI as D_, cJ as G_ } from "./lib-DwDFHSzX.js";
2
2
  import { U as R_, u as o_ } from "./useEventTracker-DwPTmzpa.js";
3
3
  import "vue";
4
4
  import "vue-cropperjs";