@designcrowd/library.brand-page 6.0.21 → 6.0.23-ast-remove

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 (92) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-C52IyXZu.js → CreatedOnBrandCrowd-de-de-C2IaS_Mb.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DhTy_dEV.js → CreatedOnBrandCrowd-en-us-AtykytDu.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BJelIAQ4.js → CreatedOnBrandCrowd-es-es-CBzMnp_n.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DwJohy0T.js → CreatedOnBrandCrowd-fr-ca-Cz7WzWc3.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-DwJohy0T.js → CreatedOnBrandCrowd-fr-fr-Cz7WzWc3.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-CMzKbxdG.js → CreatedOnBrandCrowd-pt-br-DE3vjPyC.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-CMzKbxdG.js → CreatedOnBrandCrowd-pt-pt-DE3vjPyC.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-DAy1GHrw.js → CreatedOnDcom-de-de-DlcGgBF6.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-CgBDAkJN.js → CreatedOnDcom-en-us-D5jdeN_E.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-Ds9d5rem.js → CreatedOnDcom-es-es-BBB7ZE8B.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-CZL0BQ-u.js → CreatedOnDcom-fr-ca-odHmWYoP.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-BVYh5Wvo.js → CreatedOnDcom-fr-fr-DKr11T_P.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-1hsWNXfq.js → CreatedOnDcom-pt-br-s8blQRF7.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-DvM0N-3M.js → CreatedOnDcom-pt-pt-Dga4RM96.js} +1 -1
  15. package/lib/src/brand-page/components/collapsible/Collapsible.mixin.d.ts +11 -0
  16. package/lib/src/brand-page/components/collapsible/Collapsible.mixin.js +13 -1
  17. package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +1 -0
  18. package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +12 -3
  19. package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +5 -0
  20. package/lib/src/brand-page/components/payment/Payment.mixin.js +5 -0
  21. package/lib/src/brand-page/models/index.d.ts +1 -1
  22. package/lib/src/brand-page/models/index.js +0 -3
  23. package/lib/src/brand-page/models/payment.model.d.ts +2 -0
  24. package/lib/src/brand-page/utils/button.util.d.ts +5 -0
  25. package/lib/src/brand-page/utils/button.util.js +13 -0
  26. package/lib/src/brand-page/utils/migration/migration-19.d.ts +2 -0
  27. package/lib/src/brand-page/utils/migration/migration-19.js +41 -0
  28. package/lib/src/brand-page/utils/migration.util.js +11 -0
  29. package/lib/src/brand-page/utils/view-model.util.js +1 -0
  30. package/lib/src/brand-page-maker/assessors/contact-form-visibility.assessor.d.ts +1 -0
  31. package/lib/src/brand-page-maker/assessors/contact-form-visibility.assessor.js +16 -7
  32. package/lib/src/brand-page-maker/constants/config-settings-constant.js +40 -3
  33. package/lib/src/brand-page-maker/default-getters/contact-form-card-color.default-getter.d.ts +8 -0
  34. package/lib/src/brand-page-maker/default-getters/contact-form-card-color.default-getter.js +16 -0
  35. package/lib/src/brand-page-maker/default-getters/index.d.ts +1 -0
  36. package/lib/src/brand-page-maker/default-getters/index.js +1 -0
  37. package/lib/src/brand-page-maker/models/button-styles-config.js +15 -3
  38. package/lib/src/brand-page-maker/models/content-settings-configs.d.ts +2 -1
  39. package/lib/src/brand-page-maker/models/content-settings.js +15 -3
  40. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +0 -6
  41. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +0 -2
  42. package/lib/src/css/library.brand-page-brandCrowd.min.css +96 -68
  43. package/lib/src/css/library.brand-page-brandPage.min.css +96 -68
  44. package/lib/src/css/library.brand-page-designCom.min.css +96 -68
  45. package/lib/src/css/library.brand-page-preview.min.css +96 -68
  46. package/lib/src/index.mjs +1 -1
  47. package/lib/src/{lib-CK2FPBv5.js → lib-aLiBOhnh.js} +18776 -18430
  48. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +5 -0
  49. package/lib/src/shared/content-settings/models.d.ts +1 -0
  50. package/lib/src/shared/content-settings/store/content-settings-store.js +3 -0
  51. package/lib/src/shared/template-settings/store/template-settings-store.js +4 -4
  52. package/package.json +2 -2
  53. package/src/brand-page/components/button/ButtonStyleWrapper.vue +112 -44
  54. package/src/brand-page/components/button/ButtonStyleWrapper.vue.test.ts +167 -0
  55. package/src/brand-page/components/collapsible/Collapsible.mixin.ts +14 -1
  56. package/src/brand-page/components/contact-form/ContactForm.mixin.test.ts +18 -0
  57. package/src/brand-page/components/contact-form/ContactForm.mixin.ts +15 -3
  58. package/src/brand-page/components/contact-form/ContactForm.vue +97 -36
  59. package/src/brand-page/components/mailing-list/MailingList.mixin.ts +6 -0
  60. package/src/brand-page/components/mailing-list/MailingList.vue +18 -10
  61. package/src/brand-page/components/payment/Payment.mixin.ts +6 -0
  62. package/src/brand-page/components/payment/Payment.vue +43 -24
  63. package/src/brand-page/components/payment/RequestPaymentStripe.vue +26 -22
  64. package/src/brand-page/components/shop/PaymentModal.vue +3 -3
  65. package/src/brand-page/components/shop/Shop.vue +17 -8
  66. package/src/brand-page/components/shop/Shop.vue.test.ts +209 -0
  67. package/src/brand-page/models/index.ts +1 -4
  68. package/src/brand-page/models/payment.model.ts +2 -0
  69. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -6
  70. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +0 -1
  71. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +0 -2
  72. package/src/brand-page/utils/button.util.ts +17 -0
  73. package/src/brand-page/utils/migration/migration-19.test.ts +172 -0
  74. package/src/brand-page/utils/migration/migration-19.ts +65 -0
  75. package/src/brand-page/utils/migration.util.ts +12 -0
  76. package/src/brand-page/utils/view-model.util.ts +1 -0
  77. package/src/brand-page-maker/assessors/contact-form-visibility.assessor.ts +34 -26
  78. package/src/brand-page-maker/constants/config-settings-constant.ts +43 -2
  79. package/src/brand-page-maker/default-getters/contact-form-card-color.default-getter.ts +23 -0
  80. package/src/brand-page-maker/default-getters/index.ts +1 -0
  81. package/src/brand-page-maker/models/button-styles-config.ts +15 -3
  82. package/src/brand-page-maker/models/content-settings-configs.ts +4 -1
  83. package/src/brand-page-maker/models/content-settings.ts +16 -3
  84. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +0 -2
  85. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +6 -0
  86. package/src/shared/content-settings/models.ts +3 -0
  87. package/src/shared/content-settings/store/content-settings-store.ts +3 -0
  88. package/src/shared/style-settings/components/StyleSettings.vue +1 -0
  89. package/src/shared/template-settings/store/template-settings-store.ts +6 -4
  90. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
  91. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
  92. package/src/metadata-builder/builders/reorder-pages-builder.ts +0 -80
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CK2FPBv5.js";
2
+ import { _ as t } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as t } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as t } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as t } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as t } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as t } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as t } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as e } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as e } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as e } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as e } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as e } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as M } from "./lib-aLiBOhnh.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-CK2FPBv5.js";
2
+ import { _ as M } from "./lib-aLiBOhnh.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -25,6 +25,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
25
25
  required: false;
26
26
  default: undefined;
27
27
  };
28
+ backgroundStyle: {
29
+ type: PropType<BrandPageCssStyle>;
30
+ required: false;
31
+ default: undefined;
32
+ };
28
33
  context: {
29
34
  type: PropType<BrandPageContext>;
30
35
  required: true;
@@ -61,6 +66,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
61
66
  required: false;
62
67
  default: undefined;
63
68
  };
69
+ backgroundStyle: {
70
+ type: PropType<BrandPageCssStyle>;
71
+ required: false;
72
+ default: undefined;
73
+ };
64
74
  context: {
65
75
  type: PropType<BrandPageContext>;
66
76
  required: true;
@@ -68,6 +78,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
68
78
  }>> & Readonly<{}>, {
69
79
  titleStyle: BrandPageCssStyle;
70
80
  cardStyle: BrandPageCssStyle;
81
+ backgroundStyle: BrandPageCssStyle;
71
82
  buttonStyles: BrandPageCssStyle;
72
83
  canCollapse: boolean;
73
84
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -25,6 +25,11 @@ export default defineComponent({
25
25
  required: false,
26
26
  default: undefined,
27
27
  },
28
+ backgroundStyle: {
29
+ type: Object,
30
+ required: false,
31
+ default: undefined,
32
+ },
28
33
  context: {
29
34
  type: Object,
30
35
  required: true,
@@ -40,9 +45,16 @@ export default defineComponent({
40
45
  if (borderRadius === '9999px') {
41
46
  containerStyle.borderRadius = '26px';
42
47
  }
43
- if (this.cardStyle) {
48
+ // Guarded on backgroundColor so an empty {} never blanks the container
49
+ // (BP/BC contact-form card colour defaults to the button fill).
50
+ if (this.cardStyle?.backgroundColor) {
44
51
  containerStyle.backgroundColor = this.cardStyle.backgroundColor;
45
52
  }
53
+ // Own background colour decouples the container from the button fill (BP-5800).
54
+ // Guarded on backgroundColor so an empty {} never blanks the container.
55
+ if (this.backgroundStyle?.backgroundColor) {
56
+ containerStyle.backgroundColor = this.backgroundStyle.backgroundColor;
57
+ }
46
58
  return containerStyle;
47
59
  },
48
60
  arrowStyle() {
@@ -43,6 +43,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
43
43
  isSubmitting: boolean;
44
44
  submitError: string | undefined;
45
45
  }, {
46
+ isDecorativeSubmitStyle(): boolean;
46
47
  submitButtonStyle(): BrandPageCssStyle;
47
48
  submitButtonTextStyle(): BrandPageCssStyle;
48
49
  contentPaddingStyle(): {
@@ -1,6 +1,7 @@
1
1
  import { defineComponent } from 'vue';
2
2
  import { FORM_FIELD_TYPES } from '@brand-page/models';
3
3
  import { getEmailValidationError, getMessageValidationError, getNameValidationError, getPhoneValidationError, } from '@brand-page/utils';
4
+ import { isDecorativeButtonStyle } from '../../utils/button.util';
4
5
  import brandPageClient from '../../clients/brand-page.client';
5
6
  import { isEmail } from '../../../utils/validator.util';
6
7
  import { ALIGN_CARD_CENTER, ALIGN_CARD_CENTER_IMAGE, ALIGN_CENTERED, ALIGN_LEFT_FULL_IMAGE, ALIGN_RIGHT_FULL_IMAGE, DISPLAY_STYLE_COLLAPSED, RECAPTCHA_ACTION_CONTACT_FORM, TEXT_ONLY, } from '../../constants';
@@ -44,6 +45,12 @@ export default defineComponent({
44
45
  submitError: undefined,
45
46
  }),
46
47
  computed: {
48
+ // Decorative styles (brushstroke/arrow/paper) render a shape that needs width
49
+ // to read — at pure w-fit the arrow chevron collapses. Give the submit button a
50
+ // ~200px min-width so the decoration looks intentional without going full-width.
51
+ isDecorativeSubmitStyle() {
52
+ return isDecorativeButtonStyle(this.viewModel.buttonStyles?.selectedButtonStyleId);
53
+ },
47
54
  submitButtonStyle() {
48
55
  const buttonStyle = { ...this.viewModel.buttonStyles?.style };
49
56
  const buttonTextStyle = {
@@ -151,8 +158,8 @@ export default defineComponent({
151
158
  // differs by website type:
152
159
  // - brandSite: the card style (card + divided layouts) or the section
153
160
  // background (other layouts).
154
- // - brand.page / brand.contact: there's no section background, so the
155
- // coloured surface is the global button fill.
161
+ // - brand.page / brand.contact: the container is the collapsible, whose
162
+ // colour is the card colour (defaulting to the global button fill).
156
163
  // Falls back to the title colour when there's no solid colour to anchor to.
157
164
  const style = this.context.isBrandSite
158
165
  ? this.hasCard || this.isDividedContent
@@ -160,7 +167,9 @@ export default defineComponent({
160
167
  : this.hasBgColor
161
168
  ? this.viewModel.backgroundStyle
162
169
  : undefined
163
- : this.viewModel.buttonStyles?.style;
170
+ : this.viewModel.cardStyle?.backgroundColor
171
+ ? this.viewModel.cardStyle
172
+ : this.viewModel.buttonStyles?.style;
164
173
  return (mutedTextForBackground(backgroundColorFromStyle(style)) ??
165
174
  this.viewModel.titleStyle?.color);
166
175
  },
@@ -94,6 +94,11 @@ export default defineComponent({
94
94
  if (borderRadius === '9999px') {
95
95
  buttonStyle.borderRadius = '24px';
96
96
  }
97
+ // Own background colour decouples the container from the button fill (BP-5800).
98
+ if (this.viewModel.backgroundStyle?.backgroundColor) {
99
+ buttonStyle.backgroundColor =
100
+ this.viewModel.backgroundStyle.backgroundColor;
101
+ }
97
102
  return buttonStyle;
98
103
  },
99
104
  isFormDisabled() {
@@ -77,6 +77,11 @@ export default defineComponent({
77
77
  if (borderRadius === '9999px') {
78
78
  buttonStyle.borderRadius = '26px';
79
79
  }
80
+ // Own background colour decouples the container from the button fill (BP-5800).
81
+ if (this.viewModel.backgroundStyle?.backgroundColor) {
82
+ buttonStyle.backgroundColor =
83
+ this.viewModel.backgroundStyle.backgroundColor;
84
+ }
80
85
  return buttonStyle;
81
86
  },
82
87
  continueButtonStyle() {
@@ -195,6 +195,7 @@ export interface MailingListContent extends Content {
195
195
  buttonText: string;
196
196
  titleStyle: TextStyleDeclaration;
197
197
  buttonTextStyle: TextStyleDeclaration;
198
+ backgroundStyle?: BrandPageCssStyle;
198
199
  }
199
200
  export declare const FORM_FIELD_TYPES: {
200
201
  readonly text: "text";
@@ -560,7 +561,6 @@ export interface SaveContactOptions {
560
561
  }
561
562
  export declare class BrandPageModel {
562
563
  v: number;
563
- userPromptContentKey?: string;
564
564
  styles: PageStyles;
565
565
  /** @deprecated */
566
566
  headerStyles?: AbstractPageHeaderStyles;
@@ -404,9 +404,6 @@ export class PageFooterMobile extends AbstractPageFooterStyles {
404
404
  export class BrandPageModel {
405
405
  // Model version
406
406
  v;
407
- // AI personalisation key persisted with the draft so previews survive login/checkout-back/
408
- // refresh - content is retrieved by this token (user-agnostic), not regenerated (bp-5742).
409
- userPromptContentKey;
410
407
  styles;
411
408
  /** @deprecated */
412
409
  headerStyles;
@@ -134,6 +134,7 @@ export interface RequestPaymentContent extends Content {
134
134
  descriptionStyle?: TextStyleDeclaration;
135
135
  itemTextStyle: TextStyleDeclaration;
136
136
  buttonTextStyle?: TextStyleDeclaration;
137
+ backgroundStyle?: BrandPageCssStyle;
137
138
  }
138
139
  export interface ShopContentConfig extends PaymentConfig {
139
140
  paymentOptionDisplayType: PaymentOptionDisplayType;
@@ -174,6 +175,7 @@ export interface SupportMeContent extends Content {
174
175
  descriptionStyle: TextStyleDeclaration;
175
176
  buttonTextStyle: TextStyleDeclaration;
176
177
  itemTextStyle: TextStyleDeclaration;
178
+ backgroundStyle?: BrandPageCssStyle;
177
179
  }
178
180
  export interface CreateStripePaymentIntentResponse {
179
181
  paymentIntent: StripePaymentIntent;
@@ -5,3 +5,8 @@ import type { ButtonStyles } from '../models';
5
5
  * @returns The calculated box shadow CSS value
6
6
  */
7
7
  export declare const getBoxShadowValue: (buttonStyles: ButtonStyles) => string;
8
+ export declare const BUTTON_STYLE_BRUSHSTROKE = "BUTTON_STYLE_19";
9
+ export declare const BUTTON_STYLE_ARROW = "BUTTON_STYLE_20";
10
+ export declare const BUTTON_STYLE_PAPER = "BUTTON_STYLE_21";
11
+ export declare const DECORATIVE_BUTTON_STYLE_IDS: string[];
12
+ export declare const isDecorativeButtonStyle: (styleId?: string) => boolean;
@@ -27,3 +27,16 @@ export const getBoxShadowValue = (buttonStyles) => {
27
27
  }
28
28
  return boxShadowValue;
29
29
  };
30
+ // The "decorative" button styles — brushstroke / arrow / torn-paper — whose visual
31
+ // is drawn by ButtonStyleWrapper rather than plain CSS. Their banner-like SVG
32
+ // decoration needs the button to be reasonably wide to render legibly, so narrow
33
+ // (w-fit) hosts should widen when one of these is active (BP-5800).
34
+ export const BUTTON_STYLE_BRUSHSTROKE = 'BUTTON_STYLE_19';
35
+ export const BUTTON_STYLE_ARROW = 'BUTTON_STYLE_20';
36
+ export const BUTTON_STYLE_PAPER = 'BUTTON_STYLE_21';
37
+ export const DECORATIVE_BUTTON_STYLE_IDS = [
38
+ BUTTON_STYLE_BRUSHSTROKE,
39
+ BUTTON_STYLE_ARROW,
40
+ BUTTON_STYLE_PAPER,
41
+ ];
42
+ export const isDecorativeButtonStyle = (styleId) => !!styleId && DECORATIVE_BUTTON_STYLE_IDS.includes(styleId);
@@ -0,0 +1,2 @@
1
+ import type { MigrationData } from '../migration.util';
2
+ export declare const migration19: (migrationResult: MigrationData) => Promise<MigrationData>;
@@ -0,0 +1,41 @@
1
+ import { BRAND_PAGE_TYPES } from '../../models';
2
+ const CONTAINER_BACKGROUND_TYPES = new Set([
3
+ 'mailing-list',
4
+ 'request-payment',
5
+ 'support-me',
6
+ ]);
7
+ export const migration19 = async (migrationResult) => {
8
+ const { brandPageModel } = migrationResult;
9
+ const buttonFill = brandPageModel.styles?.buttonStyles?.style?.backgroundColor;
10
+ if (buttonFill === undefined) {
11
+ return migrationResult;
12
+ }
13
+ const isBrandSite = brandPageModel.brandPageType === BRAND_PAGE_TYPES.brandSite;
14
+ brandPageModel.pages.forEach((page) => {
15
+ page.contents.forEach((content) => {
16
+ // Container-backed blocks: seed their own backgroundStyle on every type.
17
+ if (CONTAINER_BACKGROUND_TYPES.has(content.type)) {
18
+ const block = content;
19
+ if (block.backgroundStyle?.backgroundColor === undefined) {
20
+ block.backgroundStyle = {
21
+ ...block.backgroundStyle,
22
+ backgroundColor: buttonFill,
23
+ };
24
+ }
25
+ return;
26
+ }
27
+ // Contact form: colour moves to cardStyle — skip on brand-site, which
28
+ // keeps its own layout/card behaviour.
29
+ if (content.type === 'contact-form' && !isBrandSite) {
30
+ const block = content;
31
+ if (block.cardStyle?.backgroundColor === undefined) {
32
+ block.cardStyle = {
33
+ ...block.cardStyle,
34
+ backgroundColor: buttonFill,
35
+ };
36
+ }
37
+ }
38
+ });
39
+ });
40
+ return migrationResult;
41
+ };
@@ -21,6 +21,7 @@ import { migration15 } from './migration/migration-15';
21
21
  import { migration16 } from './migration/migration-16';
22
22
  import { migration17 } from './migration/migration-17';
23
23
  import { migration18 } from './migration/migration-18';
24
+ import { migration19 } from './migration/migration-19';
24
25
  const MIGRATION_TABLE = [
25
26
  {
26
27
  version: 1,
@@ -138,6 +139,16 @@ const MIGRATION_TABLE = [
138
139
  migrateFn: migration18,
139
140
  description: 'BP-5603: backfill stable item ids on all nested items (gallery/section/testimonial/text items, section + footer social links) — the item id is now non-nullable',
140
141
  },
142
+ {
143
+ version: 19,
144
+ migrateFn: migration19,
145
+ // runAlways: re-apply on every load so already-published sites pick up the seed
146
+ // without a version bump. Idempotent — only seeds a colour when unset, so a user
147
+ // colour is never clobbered. Single pass over the model seeds both container types
148
+ // and the contact form.
149
+ runAlways: true,
150
+ description: 'BP-5800: seed the button fill colour as each block’s own container colour so it is independent of the site button (existing sites render unchanged) — backgroundStyle for mailing-list, request-payment and support-me (all types); cardStyle for the BP/BC contact form (skipped on brand-site)',
151
+ },
141
152
  ];
142
153
  export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
143
154
  export const migrateBrandPageModel = async (brandPageModel, options) => {
@@ -526,6 +526,7 @@ const mapToShapesSectionViewModel = (content, styles, brandPageType) => {
526
526
  };
527
527
  const mapToShopViewModel = (content, styles) => {
528
528
  const buttonStyles = new ButtonStyles({
529
+ selectedButtonStyleId: styles.buttonStyles.selectedButtonStyleId,
529
530
  style: {
530
531
  ...styles.buttonStyles.style,
531
532
  },
@@ -1,6 +1,7 @@
1
1
  import { type ContactFormContent } from '@brand-page';
2
2
  import type { VisibilityAssessor } from '../models';
3
3
  export declare const contactCardDisplayTypeVisibilityAssessor: VisibilityAssessor<ContactFormContent | undefined>;
4
+ export declare const contactCardColorVisibilityAssessor: VisibilityAssessor<ContactFormContent | undefined>;
4
5
  export declare const displayTypeVisibilityAssessor: VisibilityAssessor<ContactFormContent | undefined>;
5
6
  export declare const imageUrlVisibilityAssessor: VisibilityAssessor<ContactFormContent | undefined>;
6
7
  export declare const contactBackgroundDisplayTypeVisibilityAssessor: VisibilityAssessor<ContactFormContent | undefined>;
@@ -1,26 +1,35 @@
1
1
  import {} from '@brand-page';
2
2
  import { ALIGN_CARD_CENTER, ALIGN_CARD_CENTER_IMAGE, ALIGN_CENTERED, ALIGN_LEFT_FULL_IMAGE, ALIGN_RIGHT_FULL_IMAGE, TEXT_ONLY, } from '@brand-page/constants';
3
3
  export const contactCardDisplayTypeVisibilityAssessor = (content, context) => {
4
- return (Boolean(content?.layoutStyle &&
4
+ return Boolean(content?.layoutStyle &&
5
5
  [
6
6
  ALIGN_CARD_CENTER_IMAGE,
7
7
  ALIGN_CARD_CENTER,
8
8
  ALIGN_LEFT_FULL_IMAGE,
9
9
  ALIGN_RIGHT_FULL_IMAGE,
10
- ].includes(content?.layoutStyle)) && context.isBrandSite);
10
+ ].includes(content?.layoutStyle) &&
11
+ context?.isBrandSite);
12
+ };
13
+ // Card colour picker: on brand-page/brand-contact it's the collapsible container
14
+ // colour (shown for every layout); on brand-site it's the card in card layouts.
15
+ export const contactCardColorVisibilityAssessor = (content, context) => {
16
+ return (!context?.isBrandSite ||
17
+ contactCardDisplayTypeVisibilityAssessor(content, context));
11
18
  };
12
19
  export const displayTypeVisibilityAssessor = (content, context) => {
13
- return Boolean(content?.layoutStyle === '' || context.isBrandPage);
20
+ return Boolean(content?.layoutStyle === '' || context?.isBrandPage);
14
21
  };
15
22
  export const imageUrlVisibilityAssessor = (content, context) => {
16
- return (Boolean(content?.layoutStyle &&
23
+ return Boolean(content?.layoutStyle &&
17
24
  [
18
25
  ALIGN_CARD_CENTER_IMAGE,
19
26
  ALIGN_LEFT_FULL_IMAGE,
20
27
  ALIGN_RIGHT_FULL_IMAGE,
21
- ].includes(content?.layoutStyle)) && context.isBrandSite);
28
+ ].includes(content?.layoutStyle) &&
29
+ context?.isBrandSite);
22
30
  };
23
31
  export const contactBackgroundDisplayTypeVisibilityAssessor = (content, context) => {
24
- return (Boolean(content?.layoutStyle &&
25
- [ALIGN_CARD_CENTER, ALIGN_CENTERED, TEXT_ONLY].includes(content?.layoutStyle)) && context.isBrandSite);
32
+ return Boolean(content?.layoutStyle &&
33
+ [ALIGN_CARD_CENTER, ALIGN_CENTERED, TEXT_ONLY].includes(content?.layoutStyle) &&
34
+ context?.isBrandSite);
26
35
  };
@@ -3,8 +3,8 @@ import { createInitialButtonContent, createInitialImageContent, createInitialPro
3
3
  import * as uuid from 'uuid';
4
4
  import { colorConvertor, backgroundColorConvertor, borderColorConvertor, displayStyleConvertor, galleryTypeConvertor, imageAspectRatioConvertor, textAlignmentOptionsConvertor, videoContentStateConvertor, fillColorConvertor, bannerAlignDisplayStyleConvertor, aboutDisplayStyleConvertor, dividerStyleConvertor, shapeSizeOptionsConvertor, buttonLinkStyleConvertor, textSizeValueConvertor, textColumnStyleConvertor, contactLayoutStyleConvertor, paymentLinkDisplayStyleConvertor, shopDisplayConvertor, shopAspectRatioConvertor, } from '../convertors';
5
5
  import { ALIGN_CENTERED, DISPLAY_STYLE_COLLAPSED, DISPLAY_STYLE_PREVIEW, } from '@brand-page';
6
- import { imageFieldVisibilityAssessor, imageOptionVisibilityAssessor, imageGalleryFieldVisibilityAssessor, cardFillVisibilityAssessor, mediaSectionItemsFieldTypeAssessor, dividerToggleFieldVisibilityAssessor, shapeSectionItemsFieldTypeAssessor, colorReplacementVisibilityTypeAssessor, colorReplacementProfileVisibilityTypeAssessor, colorReplacementIconVisibilityTypeAssessor, imagesSectionCardStyleVisibilityAssessor, contactCardDisplayTypeVisibilityAssessor, imageUrlVisibilityAssessor, displayTypeVisibilityAssessor, logoFieldVisibilityAssessor, shapesSectionCardStyleVisibilityAssessor, shopImageOptionVisibilityAssessor, shopItemColorVisibility, personalisationOverrideVisibility, } from '../assessors';
7
- import { logoBackgroundColorDefaultGetter, paymentFillColorFieldDefaultGetter, paymentTextAndBorderColorFieldDefaultGetter, shopBorderColorFieldDefaultGetter, shopFillColorFieldDefaultGetter, textColorFieldDefaultGetter, } from '../default-getters';
6
+ import { imageFieldVisibilityAssessor, imageOptionVisibilityAssessor, imageGalleryFieldVisibilityAssessor, cardFillVisibilityAssessor, mediaSectionItemsFieldTypeAssessor, dividerToggleFieldVisibilityAssessor, shapeSectionItemsFieldTypeAssessor, colorReplacementVisibilityTypeAssessor, colorReplacementProfileVisibilityTypeAssessor, colorReplacementIconVisibilityTypeAssessor, imagesSectionCardStyleVisibilityAssessor, contactCardColorVisibilityAssessor, imageUrlVisibilityAssessor, displayTypeVisibilityAssessor, logoFieldVisibilityAssessor, shapesSectionCardStyleVisibilityAssessor, shopImageOptionVisibilityAssessor, shopItemColorVisibility, personalisationOverrideVisibility, } from '../assessors';
7
+ import { contactFormCardColorDefaultGetter, logoBackgroundColorDefaultGetter, paymentFillColorFieldDefaultGetter, paymentTextAndBorderColorFieldDefaultGetter, shopBorderColorFieldDefaultGetter, shopFillColorFieldDefaultGetter, textColorFieldDefaultGetter, } from '../default-getters';
8
8
  import { socialLinksIconDisplayStyleConvertor } from '../convertors/social-links-icon-display-style.convertor';
9
9
  import { getTextMediaOptionsConverterByMediaType } from '../convertors/text-image-display-style.convertor';
10
10
  import { testimonialDisplayStyleConvertor } from '../convertors/testimonial-display-style-convertor';
@@ -455,6 +455,7 @@ const testimonialReplaceImageSettings = () => ({
455
455
  desiredWidth: undefined,
456
456
  mediaType: MEDIA_TYPES.image,
457
457
  });
458
+ const disableTransparentOffBrandSite = (brandPageType) => brandPageType !== BRAND_PAGE_TYPES.brandSite;
458
459
  export const LOGO_SETTINGS_CONFIG = () => ({
459
460
  createInitialContent: createInitialLogoContent,
460
461
  type: 'logo',
@@ -1463,6 +1464,17 @@ export const MAILING_LIST_CONTENT_SETTINGS_CONFIG = () => ({
1463
1464
  titleStyle: DEFAULT_TITLE_STYLE_SETTINGS_FILED_WITH_TITLE(),
1464
1465
  buttonTextStyle: DEFAULT_BUTTON_TEXT_STYLE_FIELD(),
1465
1466
  ...PADDING_CONTROL_FIELDS(SETTINGS_STYLE_FIELD_GROUP_IDS.style),
1467
+ backgroundStyle: {
1468
+ type: 'color',
1469
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
1470
+ defaultValue: {},
1471
+ isInline: true,
1472
+ showToggle: false,
1473
+ title: contentSettingsTr(`backgroundColorTitle`),
1474
+ disableTransparent: true,
1475
+ valueConvertor: backgroundColorConvertor,
1476
+ defaultGetter: paymentFillColorFieldDefaultGetter,
1477
+ },
1466
1478
  },
1467
1479
  isEnabled: true,
1468
1480
  isLocked: false,
@@ -1634,6 +1646,17 @@ export const REQUEST_PAYMENT_CONTENT_SETTINGS_CONFIG = () => ({
1634
1646
  label: contentSettingsTr(`buttonTextStyleLabel`),
1635
1647
  },
1636
1648
  ...PADDING_CONTROL_FIELDS(REQUEST_PAYMENT_GROUPS.style),
1649
+ backgroundStyle: {
1650
+ type: 'color',
1651
+ groupId: REQUEST_PAYMENT_GROUPS.style,
1652
+ defaultValue: {},
1653
+ isInline: true,
1654
+ showToggle: false,
1655
+ title: contentSettingsTr(`backgroundColorTitle`),
1656
+ disableTransparent: true,
1657
+ valueConvertor: backgroundColorConvertor,
1658
+ defaultGetter: paymentFillColorFieldDefaultGetter,
1659
+ },
1637
1660
  },
1638
1661
  isEnabled: (features) => features.canAddRequestPaymentContents,
1639
1662
  isLocked: false,
@@ -1699,6 +1722,17 @@ export const SUPPORT_ME_CONTENT_SETTINGS_CONFIG = () => ({
1699
1722
  },
1700
1723
  buttonTextStyle: DEFAULT_BUTTON_TEXT_STYLE_FIELD(),
1701
1724
  ...PADDING_CONTROL_FIELDS(SETTINGS_STYLE_FIELD_GROUP_IDS.style),
1725
+ backgroundStyle: {
1726
+ type: 'color',
1727
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
1728
+ defaultValue: {},
1729
+ isInline: true,
1730
+ showToggle: false,
1731
+ title: contentSettingsTr(`backgroundColorTitle`),
1732
+ disableTransparent: true,
1733
+ valueConvertor: backgroundColorConvertor,
1734
+ defaultGetter: paymentFillColorFieldDefaultGetter,
1735
+ },
1702
1736
  },
1703
1737
  isEnabled: (features) => features.canAddRequestPaymentContents,
1704
1738
  isLocked: false,
@@ -1837,7 +1871,8 @@ export const CONTACT_FORM_SETTINGS_CONFIG = () => ({
1837
1871
  disableTransparent: true,
1838
1872
  title: contentSettingsTr(`cardColorTitle`),
1839
1873
  valueConvertor: backgroundColorConvertor,
1840
- visibilityAssessor: contactCardDisplayTypeVisibilityAssessor,
1874
+ visibilityAssessor: contactCardColorVisibilityAssessor,
1875
+ defaultGetter: contactFormCardColorDefaultGetter,
1841
1876
  },
1842
1877
  backgroundStyle: {
1843
1878
  type: 'color',
@@ -1846,7 +1881,9 @@ export const CONTACT_FORM_SETTINGS_CONFIG = () => ({
1846
1881
  isInline: true,
1847
1882
  showToggle: false,
1848
1883
  title: contentSettingsTr(`backgroundColorTitle`),
1884
+ disableTransparent: disableTransparentOffBrandSite,
1849
1885
  valueConvertor: backgroundColorConvertor,
1886
+ visibilityAssessor: brandSiteTypeVisibilityAssessor,
1850
1887
  },
1851
1888
  },
1852
1889
  isEnabled: true,
@@ -0,0 +1,8 @@
1
+ import type { DefaultGetter } from '../models';
2
+ /**
3
+ * Contact-form "Card color" default (BP-5800). On brand-page/brand-contact the
4
+ * collapsible container takes the button fill, so default the Card color picker to
5
+ * it. On brand-site the Card color applies to the card in card layouts and keeps its
6
+ * own seeded default — so no default here.
7
+ */
8
+ export declare const contactFormCardColorDefaultGetter: DefaultGetter<BrandPageCssStyle>;
@@ -0,0 +1,16 @@
1
+ import { RGBAtoHex } from '@utils/helpers';
2
+ import { BRAND_PAGE_TYPES } from '@brand-page';
3
+ /**
4
+ * Contact-form "Card color" default (BP-5800). On brand-page/brand-contact the
5
+ * collapsible container takes the button fill, so default the Card color picker to
6
+ * it. On brand-site the Card color applies to the card in card layouts and keeps its
7
+ * own seeded default — so no default here.
8
+ */
9
+ export const contactFormCardColorDefaultGetter = (brandPage) => {
10
+ if (brandPage.brandPageType === BRAND_PAGE_TYPES.brandSite) {
11
+ return {};
12
+ }
13
+ return {
14
+ backgroundColor: RGBAtoHex(brandPage.styles.buttonStyles.style.backgroundColor),
15
+ };
16
+ };
@@ -2,3 +2,4 @@ export * from './text-color.default-getter';
2
2
  export * from './payment-fill-color.default-getter';
3
3
  export * from './payment-text-and-border-color.default-getter';
4
4
  export * from './logo-background-fill.default-getter';
5
+ export * from './contact-form-card-color.default-getter';
@@ -2,3 +2,4 @@ export * from './text-color.default-getter';
2
2
  export * from './payment-fill-color.default-getter';
3
3
  export * from './payment-text-and-border-color.default-getter';
4
4
  export * from './logo-background-fill.default-getter';
5
+ export * from './contact-form-card-color.default-getter';
@@ -352,7 +352,11 @@ export const availableButtonStyleConfigs = [
352
352
  iconName: 'button-brushstroke',
353
353
  iconViewBox: '0 0 60 20',
354
354
  options: ['buttonFillColor', 'buttonIconColor'],
355
- brandPageType: [BRAND_PAGE_TYPES.default, BRAND_PAGE_TYPES.brandContact],
355
+ brandPageType: [
356
+ BRAND_PAGE_TYPES.default,
357
+ BRAND_PAGE_TYPES.brandContact,
358
+ BRAND_PAGE_TYPES.brandSite,
359
+ ],
356
360
  },
357
361
  {
358
362
  id: 'BUTTON_STYLE_20',
@@ -369,7 +373,11 @@ export const availableButtonStyleConfigs = [
369
373
  iconName: 'button-arrow',
370
374
  iconViewBox: '0 0 60 20',
371
375
  options: ['buttonFillColor', 'buttonIconColor'],
372
- brandPageType: [BRAND_PAGE_TYPES.default, BRAND_PAGE_TYPES.brandContact],
376
+ brandPageType: [
377
+ BRAND_PAGE_TYPES.default,
378
+ BRAND_PAGE_TYPES.brandContact,
379
+ BRAND_PAGE_TYPES.brandSite,
380
+ ],
373
381
  },
374
382
  {
375
383
  id: 'BUTTON_STYLE_21',
@@ -386,6 +394,10 @@ export const availableButtonStyleConfigs = [
386
394
  iconName: 'button-paper',
387
395
  iconViewBox: '0 0 60 20',
388
396
  options: ['buttonFillColor', 'buttonIconColor'],
389
- brandPageType: [BRAND_PAGE_TYPES.default, BRAND_PAGE_TYPES.brandContact],
397
+ brandPageType: [
398
+ BRAND_PAGE_TYPES.default,
399
+ BRAND_PAGE_TYPES.brandContact,
400
+ BRAND_PAGE_TYPES.brandSite,
401
+ ],
390
402
  },
391
403
  ];