@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
@@ -129,7 +129,7 @@ import {
129
129
  colorReplacementProfileVisibilityTypeAssessor,
130
130
  colorReplacementIconVisibilityTypeAssessor,
131
131
  imagesSectionCardStyleVisibilityAssessor,
132
- contactCardDisplayTypeVisibilityAssessor,
132
+ contactCardColorVisibilityAssessor,
133
133
  imageUrlVisibilityAssessor,
134
134
  displayTypeVisibilityAssessor,
135
135
  logoFieldVisibilityAssessor,
@@ -139,6 +139,7 @@ import {
139
139
  personalisationOverrideVisibility,
140
140
  } from '../assessors';
141
141
  import {
142
+ contactFormCardColorDefaultGetter,
142
143
  logoBackgroundColorDefaultGetter,
143
144
  paymentFillColorFieldDefaultGetter,
144
145
  paymentTextAndBorderColorFieldDefaultGetter,
@@ -716,6 +717,10 @@ const testimonialReplaceImageSettings =
716
717
  mediaType: MEDIA_TYPES.image,
717
718
  });
718
719
 
720
+ const disableTransparentOffBrandSite = (
721
+ brandPageType: BrandPageType,
722
+ ): boolean => brandPageType !== BRAND_PAGE_TYPES.brandSite;
723
+
719
724
  export const LOGO_SETTINGS_CONFIG = (): ContentSettingsConfig<
720
725
  Omit<
721
726
  LogoContent,
@@ -1824,6 +1829,17 @@ export const MAILING_LIST_CONTENT_SETTINGS_CONFIG =
1824
1829
  titleStyle: DEFAULT_TITLE_STYLE_SETTINGS_FILED_WITH_TITLE(),
1825
1830
  buttonTextStyle: DEFAULT_BUTTON_TEXT_STYLE_FIELD(),
1826
1831
  ...PADDING_CONTROL_FIELDS(SETTINGS_STYLE_FIELD_GROUP_IDS.style),
1832
+ backgroundStyle: {
1833
+ type: 'color',
1834
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
1835
+ defaultValue: {},
1836
+ isInline: true,
1837
+ showToggle: false,
1838
+ title: contentSettingsTr(`backgroundColorTitle`),
1839
+ disableTransparent: true,
1840
+ valueConvertor: backgroundColorConvertor,
1841
+ defaultGetter: paymentFillColorFieldDefaultGetter,
1842
+ },
1827
1843
  },
1828
1844
  isEnabled: true,
1829
1845
  isLocked: false,
@@ -2009,6 +2025,17 @@ export const REQUEST_PAYMENT_CONTENT_SETTINGS_CONFIG =
2009
2025
  label: contentSettingsTr(`buttonTextStyleLabel`),
2010
2026
  },
2011
2027
  ...PADDING_CONTROL_FIELDS(REQUEST_PAYMENT_GROUPS.style),
2028
+ backgroundStyle: {
2029
+ type: 'color',
2030
+ groupId: REQUEST_PAYMENT_GROUPS.style,
2031
+ defaultValue: {},
2032
+ isInline: true,
2033
+ showToggle: false,
2034
+ title: contentSettingsTr(`backgroundColorTitle`),
2035
+ disableTransparent: true,
2036
+ valueConvertor: backgroundColorConvertor,
2037
+ defaultGetter: paymentFillColorFieldDefaultGetter,
2038
+ },
2012
2039
  },
2013
2040
  isEnabled: (features) => features.canAddRequestPaymentContents,
2014
2041
  isLocked: false,
@@ -2077,6 +2104,17 @@ export const SUPPORT_ME_CONTENT_SETTINGS_CONFIG =
2077
2104
  },
2078
2105
  buttonTextStyle: DEFAULT_BUTTON_TEXT_STYLE_FIELD(),
2079
2106
  ...PADDING_CONTROL_FIELDS(SETTINGS_STYLE_FIELD_GROUP_IDS.style),
2107
+ backgroundStyle: {
2108
+ type: 'color',
2109
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
2110
+ defaultValue: {},
2111
+ isInline: true,
2112
+ showToggle: false,
2113
+ title: contentSettingsTr(`backgroundColorTitle`),
2114
+ disableTransparent: true,
2115
+ valueConvertor: backgroundColorConvertor,
2116
+ defaultGetter: paymentFillColorFieldDefaultGetter,
2117
+ },
2080
2118
  },
2081
2119
  isEnabled: (features) => features.canAddRequestPaymentContents,
2082
2120
  isLocked: false,
@@ -2222,7 +2260,8 @@ export const CONTACT_FORM_SETTINGS_CONFIG =
2222
2260
  disableTransparent: true,
2223
2261
  title: contentSettingsTr(`cardColorTitle`),
2224
2262
  valueConvertor: backgroundColorConvertor,
2225
- visibilityAssessor: contactCardDisplayTypeVisibilityAssessor,
2263
+ visibilityAssessor: contactCardColorVisibilityAssessor,
2264
+ defaultGetter: contactFormCardColorDefaultGetter,
2226
2265
  },
2227
2266
  backgroundStyle: {
2228
2267
  type: 'color',
@@ -2231,7 +2270,9 @@ export const CONTACT_FORM_SETTINGS_CONFIG =
2231
2270
  isInline: true,
2232
2271
  showToggle: false,
2233
2272
  title: contentSettingsTr(`backgroundColorTitle`),
2273
+ disableTransparent: disableTransparentOffBrandSite,
2234
2274
  valueConvertor: backgroundColorConvertor,
2275
+ visibilityAssessor: brandSiteTypeVisibilityAssessor,
2235
2276
  },
2236
2277
  },
2237
2278
  isEnabled: true,
@@ -0,0 +1,23 @@
1
+ import { RGBAtoHex } from '@utils/helpers';
2
+ import { BRAND_PAGE_TYPES } from '@brand-page';
3
+ import type { DefaultGetter } from '../models';
4
+
5
+ /**
6
+ * Contact-form "Card color" default (BP-5800). On brand-page/brand-contact the
7
+ * collapsible container takes the button fill, so default the Card color picker to
8
+ * it. On brand-site the Card color applies to the card in card layouts and keeps its
9
+ * own seeded default — so no default here.
10
+ */
11
+ export const contactFormCardColorDefaultGetter: DefaultGetter<
12
+ BrandPageCssStyle
13
+ > = (brandPage): BrandPageCssStyle => {
14
+ if (brandPage.brandPageType === BRAND_PAGE_TYPES.brandSite) {
15
+ return {};
16
+ }
17
+
18
+ return {
19
+ backgroundColor: RGBAtoHex(
20
+ brandPage.styles.buttonStyles.style.backgroundColor,
21
+ ),
22
+ };
23
+ };
@@ -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';
@@ -379,7 +379,11 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
379
379
  iconName: 'button-brushstroke',
380
380
  iconViewBox: '0 0 60 20',
381
381
  options: ['buttonFillColor', 'buttonIconColor'],
382
- brandPageType: [BRAND_PAGE_TYPES.default, BRAND_PAGE_TYPES.brandContact],
382
+ brandPageType: [
383
+ BRAND_PAGE_TYPES.default,
384
+ BRAND_PAGE_TYPES.brandContact,
385
+ BRAND_PAGE_TYPES.brandSite,
386
+ ],
383
387
  },
384
388
  {
385
389
  id: 'BUTTON_STYLE_20',
@@ -396,7 +400,11 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
396
400
  iconName: 'button-arrow',
397
401
  iconViewBox: '0 0 60 20',
398
402
  options: ['buttonFillColor', 'buttonIconColor'],
399
- brandPageType: [BRAND_PAGE_TYPES.default, BRAND_PAGE_TYPES.brandContact],
403
+ brandPageType: [
404
+ BRAND_PAGE_TYPES.default,
405
+ BRAND_PAGE_TYPES.brandContact,
406
+ BRAND_PAGE_TYPES.brandSite,
407
+ ],
400
408
  },
401
409
  {
402
410
  id: 'BUTTON_STYLE_21',
@@ -413,6 +421,10 @@ export const availableButtonStyleConfigs: ButtonStyleConfig[] = [
413
421
  iconName: 'button-paper',
414
422
  iconViewBox: '0 0 60 20',
415
423
  options: ['buttonFillColor', 'buttonIconColor'],
416
- brandPageType: [BRAND_PAGE_TYPES.default, BRAND_PAGE_TYPES.brandContact],
424
+ brandPageType: [
425
+ BRAND_PAGE_TYPES.default,
426
+ BRAND_PAGE_TYPES.brandContact,
427
+ BRAND_PAGE_TYPES.brandSite,
428
+ ],
417
429
  },
418
430
  ];
@@ -137,7 +137,7 @@ export interface ContentSettingsField<TContent> {
137
137
  | ((brandPageType: BrandPageType) => VariantDisplayModes);
138
138
  replaceImageSettings?: ContentReplaceImageSettings<TContent>;
139
139
  showToggle?: boolean;
140
- disableTransparent?: boolean;
140
+ disableTransparent?: boolean | ((brandPageType: BrandPageType) => boolean);
141
141
  valueConvertor?: ValueConvertor<any, any>;
142
142
  canReplace?: boolean;
143
143
  placeholderAssessor?: PlaceholderTypeAssessor<TContent>;
@@ -179,6 +179,9 @@ export interface MultiFieldOption {
179
179
  export interface CreateInitialContentOptions {
180
180
  userState: UserState;
181
181
  brandPageType: BrandPageType;
182
+ // Current global button fill — copied into a new block's own container colour
183
+ // so it renders like the button fill but is detached from it (BP-5800).
184
+ buttonFillColor?: string;
182
185
  }
183
186
 
184
187
  export type CreateInitialContentFunction<TContent> = (
@@ -319,6 +319,9 @@ export const createInitialMailingListContent = (
319
319
  textStyleType: TEXT_STYLE_TYPES.buttons,
320
320
  textAlign: 'center',
321
321
  },
322
+ // Detach the container background from the button fill by copying the current
323
+ // fill as this block's own colour at creation (BP-5800; matches migration-19).
324
+ backgroundStyle: { backgroundColor: options?.buttonFillColor },
322
325
  };
323
326
  };
324
327
 
@@ -364,6 +367,9 @@ export const createInitialRequestPaymentContent = (
364
367
  textStyleType: TEXT_STYLE_TYPES.buttons,
365
368
  textAlign: 'center',
366
369
  },
370
+ // Detach the container background from the button fill by copying the current
371
+ // fill as this block's own colour at creation (BP-5800; matches migration-19).
372
+ backgroundStyle: { backgroundColor: options?.buttonFillColor },
367
373
  };
368
374
  };
369
375
 
@@ -461,6 +467,9 @@ export const createInitialSupportMeContent = (
461
467
  textStyleType: TEXT_STYLE_TYPES.buttons,
462
468
  textAlign: 'center',
463
469
  },
470
+ // Detach the container background from the button fill by copying the current
471
+ // fill as this block's own colour at creation (BP-5800; matches migration-19).
472
+ backgroundStyle: { backgroundColor: options?.buttonFillColor },
464
473
  };
465
474
  };
466
475
 
@@ -551,9 +560,13 @@ export const createInitialContactFormContent: CreateInitialContentFunction<
551
560
  successMessage: contentSettingsTr(`formSuccessMessage`),
552
561
  responseEmail: options?.userState.emailAddress || '',
553
562
  type: 'contact-form',
554
- cardStyle: {
555
- backgroundColor: DEFAULT_LOGO_BACKGROUND_COLOR_RGB,
556
- },
563
+ // brand-site: card layouts default to the logo bg. brand-page/brand-contact:
564
+ // copy the current button fill as the container's own colour so it renders
565
+ // like the button fill but is detached from it (BP-5800; matches migration-19).
566
+ cardStyle:
567
+ options?.brandPageType === BRAND_PAGE_TYPES.brandSite
568
+ ? { backgroundColor: DEFAULT_LOGO_BACKGROUND_COLOR_RGB }
569
+ : { backgroundColor: options?.buttonFillColor },
557
570
  backgroundStyle: {},
558
571
  titleStyle: {
559
572
  applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
@@ -1819,7 +1819,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
1819
1819
  const navigationStyleSettingsStore = useUiNavigationStyleSettingsStore();
1820
1820
  const shopStore = useShopConfigStore();
1821
1821
  const pageNavigationStore = usePageNavigationStore();
1822
- const uiStore = useUiStore();
1823
1822
 
1824
1823
  const pages = pageSettingsStore.pages.map((p) => ({
1825
1824
  ...p,
@@ -1837,7 +1836,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
1837
1836
 
1838
1837
  return {
1839
1838
  v: GetLatestModelVersion(),
1840
- userPromptContentKey: uiStore.userPromptContentKey,
1841
1839
  pages,
1842
1840
  styles: {
1843
1841
  logoStyles,
@@ -212,6 +212,12 @@ export default defineComponent({
212
212
  return this.field.showToggle;
213
213
  },
214
214
  disableTransparent(): boolean {
215
+ // Supports a function of brandPageType (like variant/min/maxLength) so a
216
+ // field can disable transparent only on some website types.
217
+ if (typeof this.field.disableTransparent === 'function') {
218
+ return this.field.disableTransparent(this.brandPageType);
219
+ }
220
+
215
221
  return this.field.disableTransparent || false;
216
222
  },
217
223
  plainTextValue(): string {
@@ -102,6 +102,9 @@ export type FieldGroup = ContentSettingsFieldGroup & {
102
102
  export interface CreateInitialContentOptions {
103
103
  userState: UserState;
104
104
  brandPageType: BrandPageType;
105
+ // Current global button fill — copied into a new block's own container colour
106
+ // so it renders like the button fill but is detached from it (BP-5800).
107
+ buttonFillColor?: string;
105
108
  }
106
109
 
107
110
  export interface AddContentOption<TContent> {
@@ -37,6 +37,7 @@ import {
37
37
  useVideoStore,
38
38
  } from '@brand-page-maker/stores';
39
39
  import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
40
+ import { useUiStyleSettingsStore } from '@shared/style-settings/store';
40
41
  import { useUiSideBarStore } from '../../side-bar/store';
41
42
  import {
42
43
  createDefaultContentItemGroupState,
@@ -653,6 +654,7 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
653
654
  }): ContentItem<Content> | undefined {
654
655
  const userStore = useBrandPageMakerUserStore();
655
656
  const brandPageMakerStore = useBrandPageMakerStore();
657
+ const styleSettingsStore = useUiStyleSettingsStore();
656
658
 
657
659
  const option = this.addContentOptions.find((o) => o.type === type) as
658
660
  | ContentSettingsConfig<any>
@@ -667,6 +669,7 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
667
669
  const content = option.createInitialContent({
668
670
  userState: userStore.$state,
669
671
  brandPageType: brandPageMakerStore.brandPageType,
672
+ buttonFillColor: styleSettingsStore.buttonFillColor,
670
673
  });
671
674
  const settingsConfig = CONTENT_SETTINGS_CONFIGS()[content.type];
672
675
 
@@ -165,6 +165,7 @@
165
165
  <button
166
166
  v-for="(buttonStyleConfig, index) in availableButtonStyleConfigs"
167
167
  :key="index"
168
+ :data-test-button-style="buttonStyleConfig.id"
168
169
  class="c-button-style tw-cursor-pointer tw-border-0 tw-bg-white tw-px-3 tw-rounded tw-transition-all tw-duration-300 tw-transform hover:tw-bg-grayscale-200 tw-h-14"
169
170
  :class="{
170
171
  'c-button-style--selected !tw-shadow-[0_0_0_2px] !tw-shadow-info-500':
@@ -50,6 +50,7 @@ const POST_PURCHASE_PAGE_SECTION_BY_TAB: Record<string, string> = {
50
50
 
51
51
  const PRE_PURCHASE_PAGE_SECTION_BY_TAB: Record<string, string> = {
52
52
  [TEMPLATE_TABS.all]: 'MakerPrePurchaseSidebarTemplatesAllTab',
53
+ [TEMPLATE_TABS.AI]: 'MakerPrePurchaseSidebarTemplatesAiTab',
53
54
  [TEMPLATE_TABS.categories]: 'MakerPrePurchaseSidebarTemplatesCategoryTab',
54
55
  };
55
56
  const LOAD_PAGE_RETRY_DELAY = 250;
@@ -421,9 +422,7 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
421
422
  contentKey =
422
423
  uiStore.personalisationData[personalisationContentIndex]
423
424
  .contentKey;
424
- } else if (item.isPersonalisable) {
425
- // Pre-purchase has no personalisationData; personalise AI
426
- // template previews with the prompt content key (bp-5742).
425
+ } else if (item.isPersonalisable && !this.searchTerm) {
427
426
  contentKey = uiStore.userPromptContentKey;
428
427
  }
429
428
 
@@ -435,7 +434,8 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
435
434
  // in the userPrompt bucket (post- or pre-purchase). The preview must
436
435
  // then resolve via userPromptContentKey, not the regular bucket which
437
436
  // holds placeholders post-purchase (bp-5454).
438
- usesUserPromptContentKey: !!uiStore.userPromptContentKey,
437
+ usesUserPromptContentKey:
438
+ !!uiStore.userPromptContentKey && !this.searchTerm,
439
439
  previewImageUrl: item.previewImageUrl,
440
440
  } as TemplateSettingsTemplate;
441
441
  }
@@ -529,6 +529,8 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
529
529
  searchTerm: payload.searchTerm,
530
530
  });
531
531
 
532
+ this.aiTemplateKeywords = payload.searchTerm ?? '';
533
+
532
534
  this.onSearchTermChanged?.(payload.searchTerm);
533
535
 
534
536
  await this._setPageNo({ pageNo: 1 });
@@ -1,13 +0,0 @@
1
- import type { BrandPageModel } from '../../brand-page/models';
2
- import { BaseMetadataBuilder, type BuilderResult, type MetadataBuilderRequest } from '../models';
3
- import type { Logger } from '../logger';
4
- export interface ReorderPagesPayload {
5
- pageOrder: string[];
6
- }
7
- export declare class ReorderPagesBuilder extends BaseMetadataBuilder<ReorderPagesPayload> {
8
- constructor(request: MetadataBuilderRequest<ReorderPagesPayload>, logger?: Logger);
9
- validateAsync(): Promise<{
10
- errors: string[];
11
- }>;
12
- buildAsync(model: BrandPageModel): Promise<BuilderResult>;
13
- }
@@ -1,49 +0,0 @@
1
- import { BaseMetadataBuilder, } from '../models';
2
- export class ReorderPagesBuilder extends BaseMetadataBuilder {
3
- constructor(request, logger) {
4
- super(request, logger);
5
- }
6
- async validateAsync() {
7
- const errors = [];
8
- const payload = this.request.payload;
9
- if (!payload?.pageOrder?.length) {
10
- errors.push('page_order is required for reorder_pages');
11
- }
12
- return { errors };
13
- }
14
- async buildAsync(model) {
15
- this.log('Build called');
16
- const validation = await this.validateAsync();
17
- if (validation.errors.length) {
18
- return { request: this.request, model, errors: validation.errors };
19
- }
20
- const { pageOrder } = this.request.payload;
21
- // Build pageId → routeId lookup from nav.routes
22
- const pageIdToRouteId = new Map();
23
- for (const route of model.nav.routes) {
24
- pageIdToRouteId.set(route.pageId, route.id);
25
- }
26
- // Build new nav.orders from the flat page_order (array of pageIds)
27
- const newOrders = [];
28
- const seenRouteIds = new Set();
29
- for (const pageId of pageOrder) {
30
- const routeId = pageIdToRouteId.get(pageId);
31
- if (!routeId)
32
- continue;
33
- newOrders.push({ routeId, subRoutes: [] });
34
- seenRouteIds.add(routeId);
35
- }
36
- // Safety: append any routes not mentioned (don't lose pages)
37
- for (const route of model.nav.routes) {
38
- const routeId = pageIdToRouteId.get(route.pageId);
39
- if (routeId && !seenRouteIds.has(routeId)) {
40
- newOrders.push({ routeId, subRoutes: [] });
41
- }
42
- }
43
- model.nav.orders = newOrders;
44
- this.log({
45
- message: `Reordered pages: ${pageOrder.join(', ')}`,
46
- });
47
- return { request: this.request, model };
48
- }
49
- }
@@ -1,80 +0,0 @@
1
- import type { BrandPageModel, NavOrder } from '../../brand-page/models';
2
- import {
3
- BaseMetadataBuilder,
4
- type BuilderResult,
5
- type MetadataBuilderRequest,
6
- } from '../models';
7
- import type { Logger } from '../logger';
8
-
9
- export interface ReorderPagesPayload {
10
- pageOrder: string[];
11
- }
12
-
13
- export class ReorderPagesBuilder extends BaseMetadataBuilder<ReorderPagesPayload> {
14
- constructor(
15
- request: MetadataBuilderRequest<ReorderPagesPayload>,
16
- logger?: Logger,
17
- ) {
18
- super(request, logger);
19
- }
20
-
21
- async validateAsync(): Promise<{ errors: string[] }> {
22
- const errors: string[] = [];
23
- const payload = this.request.payload;
24
-
25
- if (!payload?.pageOrder?.length) {
26
- errors.push('page_order is required for reorder_pages');
27
- }
28
-
29
- return { errors };
30
- }
31
-
32
- async buildAsync(model: BrandPageModel): Promise<BuilderResult> {
33
- this.log('Build called');
34
-
35
- const validation = await this.validateAsync();
36
-
37
- if (validation.errors.length) {
38
- return { request: this.request, model, errors: validation.errors };
39
- }
40
-
41
- const { pageOrder } = this.request.payload!;
42
-
43
- // Build pageId → routeId lookup from nav.routes
44
- const pageIdToRouteId = new Map<string, string>();
45
-
46
- for (const route of model.nav.routes) {
47
- pageIdToRouteId.set(route.pageId, route.id);
48
- }
49
-
50
- // Build new nav.orders from the flat page_order (array of pageIds)
51
- const newOrders: NavOrder[] = [];
52
- const seenRouteIds = new Set<string>();
53
-
54
- for (const pageId of pageOrder) {
55
- const routeId = pageIdToRouteId.get(pageId);
56
-
57
- if (!routeId) continue;
58
-
59
- newOrders.push({ routeId, subRoutes: [] });
60
- seenRouteIds.add(routeId);
61
- }
62
-
63
- // Safety: append any routes not mentioned (don't lose pages)
64
- for (const route of model.nav.routes) {
65
- const routeId = pageIdToRouteId.get(route.pageId);
66
-
67
- if (routeId && !seenRouteIds.has(routeId)) {
68
- newOrders.push({ routeId, subRoutes: [] });
69
- }
70
- }
71
-
72
- model.nav.orders = newOrders;
73
-
74
- this.log({
75
- message: `Reordered pages: ${pageOrder.join(', ')}`,
76
- });
77
-
78
- return { request: this.request, model };
79
- }
80
- }