@designcrowd/library.brand-page 5.15.0 → 5.15.1-ast-color-bug-2

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 (59) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-Bop58JAz.js → CreatedOnBrandCrowd-de-de-BJtqigGc.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-O8sbmj3A.js → CreatedOnBrandCrowd-en-us-Bf2l6EmF.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CLn5XGc8.js → CreatedOnBrandCrowd-es-es-DQV1HIw0.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-yLvGIfNb.js → CreatedOnBrandCrowd-fr-ca-BcPalOzh.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-yLvGIfNb.js → CreatedOnBrandCrowd-fr-fr-BcPalOzh.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DMJax69k.js → CreatedOnBrandCrowd-pt-br-DXijfvU2.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DMJax69k.js → CreatedOnBrandCrowd-pt-pt-DXijfvU2.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-Ci686MJL.js → CreatedOnDcom-de-de-BcK9HQRi.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-By85sLPy.js → CreatedOnDcom-en-us-DYNyMBLE.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-DRNUhp4A.js → CreatedOnDcom-es-es-sdMRkT2Y.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-Dwc09vOC.js → CreatedOnDcom-fr-ca-CpzL-K7Y.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-Czuhsm2r.js → CreatedOnDcom-fr-fr-3oHhugb4.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CohnrD7I.js → CreatedOnDcom-pt-br-jq-BUUcA.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-BKQ0Lgnn.js → CreatedOnDcom-pt-pt-CfYr1YWT.js} +1 -1
  15. package/lib/src/brand-page/models/index.d.ts +1 -0
  16. package/lib/src/brand-page/models/index.js +14 -1
  17. package/lib/src/brand-page/utils/migration/migration-08.d.ts +2 -0
  18. package/lib/src/brand-page/utils/migration/migration-08.js +10 -0
  19. package/lib/src/brand-page/utils/migration.util.js +7 -1
  20. package/lib/src/brand-page/utils/style.util.d.ts +8 -0
  21. package/lib/src/brand-page/utils/style.util.js +26 -0
  22. package/lib/src/brand-page/utils/view-model.util.js +20 -20
  23. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +7 -0
  24. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +32 -2
  25. package/lib/src/css/library.brand-page-brandCrowd.min.css +14 -14
  26. package/lib/src/css/library.brand-page-brandPage.min.css +14 -14
  27. package/lib/src/css/library.brand-page-designCom.min.css +14 -14
  28. package/lib/src/css/library.brand-page-preview.min.css +14 -14
  29. package/lib/src/index.mjs +1 -1
  30. package/lib/src/{lib-B1U5OmA7.js → lib-bMfVGXV3.js} +21545 -21594
  31. package/lib/src/shared/color-picker/components/ColorPicker.mixin.d.ts +7 -3
  32. package/lib/src/shared/color-picker/components/ColorPicker.mixin.js +128 -37
  33. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +7 -0
  34. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +14 -0
  35. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +7 -0
  36. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +7 -0
  37. package/lib/src/shared/style-settings/store/style-settings-store.d.ts +8 -0
  38. package/lib/src/shared/style-settings/store/style-settings-store.js +25 -2
  39. package/package.json +1 -1
  40. package/src/brand-page/models/index.ts +18 -1
  41. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +6 -3
  42. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +1 -0
  43. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +2 -0
  44. package/src/brand-page/utils/migration/migration-08.ts +14 -0
  45. package/src/brand-page/utils/migration.util.ts +8 -1
  46. package/src/brand-page/utils/style.util.ts +30 -0
  47. package/src/brand-page/utils/view-model.util.ts +20 -20
  48. package/src/brand-page-maker/components/color-palette/BpColorPalette.vue +123 -17
  49. package/src/brand-page-maker/components/color-palette/BpColorPicker.vue +9 -13
  50. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +47 -3
  51. package/src/shared/color-picker/components/ColorPicker.mixin.ts +160 -45
  52. package/src/shared/content-settings/components/color-field/ColorField.vue +299 -14
  53. package/src/shared/style-settings/store/style-settings-store.ts +29 -2
  54. package/lib/src/brand-page-maker/components/color-palette/BpColorPalette.mixin.d.ts +0 -103
  55. package/lib/src/brand-page-maker/components/color-palette/BpColorPalette.mixin.js +0 -116
  56. package/lib/src/shared/content-settings/components/color-field/ColorField.mixin.d.ts +0 -402
  57. package/lib/src/shared/content-settings/components/color-field/ColorField.mixin.js +0 -234
  58. package/src/brand-page-maker/components/color-palette/BpColorPalette.mixin.ts +0 -133
  59. package/src/shared/content-settings/components/color-field/ColorField.mixin.ts +0 -273
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B1U5OmA7.js";
2
+ import { _ as t } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B1U5OmA7.js";
2
+ import { _ as t } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B1U5OmA7.js";
2
+ import { _ as t } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B1U5OmA7.js";
2
+ import { _ as t } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B1U5OmA7.js";
2
+ import { _ as t } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B1U5OmA7.js";
2
+ import { _ as t } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B1U5OmA7.js";
2
+ import { _ as t } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-B1U5OmA7.js";
2
+ import { _ as e } from "./lib-bMfVGXV3.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-B1U5OmA7.js";
2
+ import { _ as e } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-B1U5OmA7.js";
2
+ import { _ as e } from "./lib-bMfVGXV3.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-B1U5OmA7.js";
2
+ import { _ as e } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-B1U5OmA7.js";
2
+ import { _ as e } from "./lib-bMfVGXV3.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-B1U5OmA7.js";
2
+ import { _ as M } from "./lib-bMfVGXV3.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-B1U5OmA7.js";
2
+ import { _ as M } from "./lib-bMfVGXV3.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -51,6 +51,7 @@ export declare class PageStyles {
51
51
  logoStyles: LogoStyles;
52
52
  textStyles: TextStyles;
53
53
  galleryStyles: GalleryStyles;
54
+ newColors: string[];
54
55
  constructor(option?: Partial<Omit<PageStyles, 'logoStyles' | 'buttonStyles' | 'backgroundStyles' | 'textStyles'>> & {
55
56
  logoStyles?: Partial<LogoStyles>;
56
57
  buttonStyles?: Partial<ButtonStyles>;
@@ -80,6 +80,7 @@ export class PageStyles {
80
80
  logoStyles;
81
81
  textStyles;
82
82
  galleryStyles;
83
+ newColors;
83
84
  constructor(option = {}) {
84
85
  this.backgroundStyles = new BackgroundStyles(option.backgroundStyles || {
85
86
  backgroundImageUrl: '',
@@ -104,6 +105,7 @@ export class PageStyles {
104
105
  ? new TextStyles(option.textStyles)
105
106
  : TextStyles.GetDefaultTextStyle();
106
107
  this.galleryStyles = new GalleryStyles(option.galleryStyles);
108
+ this.newColors = option.newColors || [];
107
109
  }
108
110
  }
109
111
  export const ASPECT_RATIOS = {
@@ -395,7 +397,18 @@ export class BrandPageModel {
395
397
  paymentConfig;
396
398
  constructor(options) {
397
399
  this.v = options.v || 0;
398
- this.styles = new PageStyles(options.styles);
400
+ // Migration: Ensure newColors exists for backward compatibility
401
+ if (options.styles && !options.styles.hasOwnProperty('newColors')) {
402
+ options.styles.newColors = [];
403
+ }
404
+ // Extract newColors directly from options if it exists at the top level
405
+ const newColors = options.styles?.newColors || options.newColors || [];
406
+ // Ensure newColors is passed to PageStyles constructor
407
+ const stylesWithNewColors = {
408
+ ...options.styles,
409
+ newColors: newColors,
410
+ };
411
+ this.styles = new PageStyles(stylesWithNewColors);
399
412
  const theme = {
400
413
  primaryColor: this.styles.textStyles.style.color || '',
401
414
  secondaryColor: this.styles.backgroundStyles.style.background || '',
@@ -0,0 +1,2 @@
1
+ import { type BrandPageModel } from '../..';
2
+ export declare const migration08: (brandPageModel: BrandPageModel) => BrandPageModel;
@@ -0,0 +1,10 @@
1
+ import {} from '../..';
2
+ export const migration08 = (brandPageModel) => {
3
+ // Migration for newColors property in PageStyles
4
+ // Ensure newColors exists for backward compatibility with existing brand pages
5
+ if (brandPageModel.styles &&
6
+ !brandPageModel.styles.hasOwnProperty('newColors')) {
7
+ brandPageModel.styles.newColors = [];
8
+ }
9
+ return brandPageModel;
10
+ };
@@ -6,10 +6,11 @@ import { migration02 } from './migration/migration-02';
6
6
  import { migration03 } from './migration/migration-03';
7
7
  import { migration04 } from './migration/migration-04';
8
8
  import { migration05 } from './migration/migration-05';
9
- import { migration06 } from './migration/migration-06';
10
9
  import { migration05_1 } from './migration/migration-05_1';
11
10
  import { migration05_2 } from './migration/migration-05_2';
11
+ import { migration06 } from './migration/migration-06';
12
12
  import { migration07 } from './migration/migration-07';
13
+ import { migration08 } from './migration/migration-08';
13
14
  const MIGRATION_TABLE = [
14
15
  {
15
16
  version: 1,
@@ -62,6 +63,11 @@ const MIGRATION_TABLE = [
62
63
  migrateFn: migration07,
63
64
  description: 'Migrating logo render sizes for logo content, header and footer sections',
64
65
  },
66
+ {
67
+ version: 8,
68
+ migrateFn: migration08,
69
+ description: 'Adding newColors property for color picker persistence',
70
+ },
65
71
  ];
66
72
  export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
67
73
  export const migrateBrandPageModel = async (brandPageModel, options) => {
@@ -1,6 +1,14 @@
1
1
  import type { BrandPageModel, LogoTheme, ThemeColor, FabricLogoTheme, ButtonStyles, PageModel } from '../models';
2
2
  import { NavigationDesktop, NavigationMobile } from '../models';
3
3
  import { PageStyles, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop } from '../models';
4
+ /**
5
+ * Simple utility to convert any color format to hex for consistent comparison
6
+ */
7
+ export declare const normalizeColorToHex: (color: string) => string;
8
+ /**
9
+ * Simple utility to check if two colors match (handles different formats)
10
+ */
11
+ export declare const colorsMatch: (color1: string, color2: string) => boolean;
4
12
  /**
5
13
  * @function getColorValueForCorrectCssProperty
6
14
  * @param k: string
@@ -3,8 +3,34 @@ import { PageStyles, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, Page
3
3
  import { STYLE_THEME_KEYS } from '../constants';
4
4
  import { arrayToLinearGradient, linearGradientToArray, isColorLinearGradient, RGBAtoHex, } from '../../utils/helpers';
5
5
  import { addTransparentAlphaChannelToHex, calculateLuminanceRatio, getNewColorBasedOnTargetColorTheme, } from './color.util';
6
+ import { isRgbColor } from '../../utils/helpers';
6
7
  import chroma from 'chroma-js';
7
8
  import { hasRTEContent } from '../../brand-page-maker/utils';
9
+ /**
10
+ * Simple utility to convert any color format to hex for consistent comparison
11
+ */
12
+ export const normalizeColorToHex = (color) => {
13
+ if (!color)
14
+ return color;
15
+ const cleanColor = color.replace(/ /g, '');
16
+ try {
17
+ return isRgbColor(cleanColor) ? RGBAtoHex(cleanColor) : cleanColor;
18
+ }
19
+ catch (e) {
20
+ console.warn('Failed to convert color to hex:', color);
21
+ return cleanColor;
22
+ }
23
+ };
24
+ /**
25
+ * Simple utility to check if two colors match (handles different formats)
26
+ */
27
+ export const colorsMatch = (color1, color2) => {
28
+ if (!color1 || !color2)
29
+ return false;
30
+ const normalized1 = normalizeColorToHex(color1);
31
+ const normalized2 = normalizeColorToHex(color2);
32
+ return normalized1 === normalized2;
33
+ };
8
34
  const MIN_LUM_RATIO = 0.3;
9
35
  const parseFabricColorToCssStyle = (fabricColor) => {
10
36
  if (fabricColor && typeof fabricColor === 'object') {
@@ -77,7 +77,7 @@ export const applyViewModelTextStyles = (content, styles) => {
77
77
  Object.keys(CONTENT_TEXT_STYLE_PROPERTY_KEYS)
78
78
  .filter((propKey) => propKey in content)
79
79
  .forEach((propKey) => {
80
- content[propKey] = getTextStyleByContentTextStyleProperty(content, propKey, styles.textStyles.textStyleOptions);
80
+ content[propKey] = getTextStyleByContentTextStyleProperty(content, propKey, styles.textStyles?.textStyleOptions);
81
81
  });
82
82
  return content;
83
83
  };
@@ -85,9 +85,9 @@ const applyViewModelTextItemTextStyles = (textItems, styles) => {
85
85
  return textItems.map((item) => {
86
86
  let itemTextStyle = item.textStyle;
87
87
  if (item.textStyle?.textStyleType) {
88
- const textStyleOption = styles.textStyles.textStyleOptions[item.textStyle.textStyleType];
88
+ const textStyleOption = styles.textStyles?.textStyleOptions?.[item.textStyle.textStyleType];
89
89
  itemTextStyle = {
90
- ...textStyleOption.style,
90
+ ...textStyleOption?.style,
91
91
  applyAutoScale: itemTextStyle.applyAutoScale,
92
92
  textAlign: itemTextStyle.textAlign || DEFAULT_TEXT_ALIGN,
93
93
  textStyleType: itemTextStyle.textStyleType || undefined,
@@ -204,17 +204,17 @@ const mapToButtonViewModel = (content, styles, options) => {
204
204
  };
205
205
  // Extract only text-related properties from titleStyle, excluding button styling properties
206
206
  const textOnlyProperties = {
207
- color: options.titleStyle.color,
208
- fontFamily: options.titleStyle.fontFamily,
209
- fontSize: options.titleStyle.fontSize,
210
- fontWeight: options.titleStyle.fontWeight,
211
- textAlign: options.titleStyle.textAlign,
212
- letterSpacing: options.titleStyle.letterSpacing,
213
- lineHeight: options.titleStyle.lineHeight || LINE_HEIGHT_HEADINGS,
214
- textStyleType: options.titleStyle.textStyleType,
215
- applyAutoScale: options.titleStyle.applyAutoScale,
216
- textDecoration: options.titleStyle.textDecoration,
217
- fontStyle: options.titleStyle.fontStyle,
207
+ color: options.titleStyle?.color,
208
+ fontFamily: options.titleStyle?.fontFamily,
209
+ fontSize: options.titleStyle?.fontSize,
210
+ fontWeight: options.titleStyle?.fontWeight,
211
+ textAlign: options.titleStyle?.textAlign,
212
+ letterSpacing: options.titleStyle?.letterSpacing,
213
+ lineHeight: options.titleStyle?.lineHeight || LINE_HEIGHT_HEADINGS,
214
+ textStyleType: options.titleStyle?.textStyleType,
215
+ applyAutoScale: options.titleStyle?.applyAutoScale,
216
+ textDecoration: options.titleStyle?.textDecoration,
217
+ fontStyle: options.titleStyle?.fontStyle,
218
218
  };
219
219
  /* For text content text style backward compatibility */
220
220
  const titleStyle = {
@@ -248,18 +248,18 @@ export const mapToProfileViewModel = (content, styles) => {
248
248
  containerStyle = applyContentBorderRadius(containerStyle);
249
249
  const titleStyle = {
250
250
  ...content.titleStyle,
251
- fontSize: content.titleStyle.fontSize || FONT_SIZE_BODY,
252
- lineHeight: content.titleStyle.lineHeight || LINE_HEIGHT_BODY,
251
+ fontSize: content.titleStyle?.fontSize || FONT_SIZE_BODY,
252
+ lineHeight: content.titleStyle?.lineHeight || LINE_HEIGHT_BODY,
253
253
  };
254
254
  const descriptionStyle = {
255
255
  ...content.descriptionStyle,
256
- fontSize: content.descriptionStyle.fontSize || FONT_SIZE_BODY,
257
- lineHeight: content.descriptionStyle.lineHeight || LINE_HEIGHT_BODY,
256
+ fontSize: content.descriptionStyle?.fontSize || FONT_SIZE_BODY,
257
+ lineHeight: content.descriptionStyle?.lineHeight || LINE_HEIGHT_BODY,
258
258
  };
259
259
  const nameStyle = {
260
260
  ...content.nameStyle,
261
- fontSize: content.nameStyle.fontSize || FONT_SIZE_HEADINGS,
262
- lineHeight: content.nameStyle.lineHeight || LINE_HEIGHT_HEADINGS,
261
+ fontSize: content.nameStyle?.fontSize || FONT_SIZE_HEADINGS,
262
+ lineHeight: content.nameStyle?.lineHeight || LINE_HEIGHT_HEADINGS,
263
263
  };
264
264
  return applyViewModelTextStyles({
265
265
  ...content,
@@ -1065,6 +1065,13 @@ declare const _default: import("vue").DefineComponent<{}, {
1065
1065
  fontFamily: "lato" | "roboto" | "notoSans" | "openSans" | "arvo" | "bebasNeue" | "ptSerif" | "oswald" | "inter" | "montserrat" | "raleway" | "anton" | "antonSc" | "quicksand" | "pacifico" | "bioRhyme" | "playfairDisplay" | "mulish" | "telex" | "pridi" | "hindMadurai" | "kanit" | "libreBaskerville" | "amiko" | "neuton" | "tenorSans" | "jacquesFrancois" | "varela" | "quattrocentoSans" | "workSans" | "titilliumWeb" | "amaticSc" | "poiretOne" | "shantellSans" | "dancingScript" | "tangerine" | "cinzel" | "jost" | "exo2" | "ebGaramond" | "ubuntu" | "cabin" | "josefinSans" | "lobsterTwo" | "sacramento" | "nunito" | "aboreto" | "aleo" | "abhayaLibre" | "caladea" | "rokkitt" | "rubik" | "frankRuhlLibre" | "spectral" | "abrilFatface" | "courgette" | "kiteOne" | "amarante" | "satisfy" | "lilitaOne" | "lobster" | "titanOne" | "cookie" | "bungee" | "poppins" | "staatliches" | "patuaOne" | "calistoga" | "suezOne" | "caprasimo" | "rubikMonoOne" | "silkscreen" | "alfaSlabOne" | "orelegaOne" | "audiowide" | "redRose" | "kalnia" | "imbue" | "climateCrisis" | "gluten" | "madimiOne" | "anta" | "trykker" | "moul" | "bevan" | "wendyOne" | "lexendDeca" | "vinaSans" | "chango" | "changaOne" | "protestGuerrilla" | "londrinaShadow" | "candal" | "borel" | "rockNRollOne" | "bungeeInline" | "rampartOne" | "manrope" | "yuseiMagic" | "patrickHandSC" | "farsan" | "handlee" | "lemonada" | "arsenal" | "bakbakOne" | "belleza" | "blackHanSans" | "bowlbyOne" | "brunoAceSC" | "castoroTitling" | "contrailOne" | "delaGothicOne" | "dotGothic16" | "fahkwang" | "francoisOne" | "gloock" | "graduate" | "jersey10" | "kavoon" | "kronaOne" | "notable" | "pavanam" | "phudu" | "poetsenOne" | "pollerOne" | "questrial" | "racingSansOne" | "rammettoOne" | "rubikGlitch" | "shrikhand" | "spicyRice" | "syncopate" | "urbanist" | "yesevaOne" | "zenDots";
1066
1066
  }): Promise<void>;
1067
1067
  toggleLogoBackground(): Promise<any>;
1068
+ addNewColor({ color }: {
1069
+ color: string;
1070
+ }): void;
1071
+ setNewColors({ newColors }: {
1072
+ newColors: string[];
1073
+ }): void;
1074
+ removeDuplicateNewColors(): void;
1068
1075
  }>;
1069
1076
  }, {
1070
1077
  isDraggingContent: boolean;
@@ -234,13 +234,14 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
234
234
  reset: true,
235
235
  brandPageType: this.brandPageType,
236
236
  });
237
- const { buttonStyles, logoStyles, textStyles, galleryStyles } = brandPageModel.styles;
237
+ const { buttonStyles, logoStyles, textStyles, galleryStyles, newColors } = brandPageModel.styles;
238
238
  styleSettingsStore.setState({
239
239
  newState: {
240
240
  buttonStyles,
241
241
  logoStyles,
242
242
  textStyles,
243
243
  galleryStyles,
244
+ newColors: newColors || [], // Use saved newColors or empty array if not available
244
245
  },
245
246
  });
246
247
  this.initialisePages({
@@ -264,6 +265,9 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
264
265
  styleSettingsStore.setButtonStyles(brandPageModel.styles.buttonStyles);
265
266
  styleSettingsStore.setTextStyles(brandPageModel.styles.textStyles);
266
267
  styleSettingsStore.setGalleryStyles(brandPageModel.styles.galleryStyles);
268
+ styleSettingsStore.setNewColors({
269
+ newColors: brandPageModel.styles.newColors || [],
270
+ });
267
271
  if (!userStore.isAdmin) {
268
272
  containerStore.setDesignTemplateToken({
269
273
  designTemplateToken: this.selectedTemplateId,
@@ -429,17 +433,38 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
429
433
  : undefined;
430
434
  if (!this.isUserDraft && userPersonalisation) {
431
435
  const { model } = await applyUserPersonalisationToBrandPageModelAsync(userPersonalisation, new BrandPageModel(brandPageModel));
436
+ // Preserve newColors before overwriting styles
437
+ const originalNewColors = brandPageModel.styles.newColors;
432
438
  brandPageModel.styles = model.styles;
433
439
  brandPageModel.pages = model.pages;
440
+ // Restore newColors if they were lost in the transformation
441
+ if (originalNewColors &&
442
+ (!brandPageModel.styles.newColors ||
443
+ (Array.isArray(brandPageModel.styles.newColors) &&
444
+ brandPageModel.styles.newColors.length === 0))) {
445
+ brandPageModel.styles.newColors = originalNewColors;
446
+ }
434
447
  }
435
448
  if (!userStore.isAdmin) {
436
449
  const { model } = applyLogoThemeToBrandPageModel(logoTheme, new BrandPageModel(brandPageModel));
450
+ // Preserve newColors before overwriting styles
451
+ const originalNewColors = brandPageModel.styles.newColors;
437
452
  brandPageModel.styles = model.styles;
438
453
  brandPageModel.pageHeaderMobile = model.pageHeaderMobile;
439
454
  brandPageModel.pageHeaderDesktop = model.pageHeaderDesktop;
440
455
  brandPageModel.pageFooterMobile = model.pageFooterMobile;
441
456
  brandPageModel.pageFooterDesktop = model.pageFooterDesktop;
442
457
  brandPageModel.pages = model.pages;
458
+ // Restore newColors if they were lost in the transformation
459
+ if (originalNewColors &&
460
+ (!brandPageModel.styles.newColors ||
461
+ (Array.isArray(brandPageModel.styles.newColors) &&
462
+ brandPageModel.styles.newColors.length === 0) ||
463
+ (typeof brandPageModel.styles.newColors === 'object' &&
464
+ !Array.isArray(brandPageModel.styles.newColors) &&
465
+ Object.keys(brandPageModel.styles.newColors).length === 0))) {
466
+ brandPageModel.styles.newColors = originalNewColors;
467
+ }
443
468
  }
444
469
  styleSettingsStore.initialise({
445
470
  reset: false,
@@ -549,13 +574,14 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
549
574
  },
550
575
  };
551
576
  backgroundSettingsStore.setState(backgroundSetStatePayload);
552
- const { buttonStyles, logoStyles, textStyles, galleryStyles } = brandPageModel.styles;
577
+ const { buttonStyles, logoStyles, textStyles, galleryStyles, newColors, } = brandPageModel.styles;
553
578
  styleSettingsStore.setState({
554
579
  newState: {
555
580
  buttonStyles,
556
581
  logoStyles,
557
582
  textStyles,
558
583
  galleryStyles,
584
+ newColors: Array.isArray(newColors) ? newColors : [],
559
585
  },
560
586
  });
561
587
  navigationStyleSettingsStore.setState({
@@ -764,6 +790,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
764
790
  const buttonStyles = styleSettingsStore.buttonStyles;
765
791
  const textStyles = styleSettingsStore.textStyles;
766
792
  const galleryStyles = styleSettingsStore.galleryStyles;
793
+ const newColors = styleSettingsStore.newColors;
767
794
  const navigation = navigationStyleSettingsStore.navigation;
768
795
  return {
769
796
  v: GetLatestModelVersion(),
@@ -774,6 +801,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
774
801
  backgroundStyles,
775
802
  textStyles,
776
803
  galleryStyles,
804
+ newColors,
777
805
  },
778
806
  pageHeaderDesktop: Object.assign({}, pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.desktop], { navigation: navigation[PAGE_SECTIONS.header][VIEWPORTS.desktop] }),
779
807
  pageHeaderMobile: Object.assign({}, pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.mobile], { navigation: navigation[PAGE_SECTIONS.header][VIEWPORTS.mobile] }),
@@ -819,6 +847,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
819
847
  const buttonStyles = styleSettingsStore.buttonStyles;
820
848
  const textStyles = styleSettingsStore.textStyles;
821
849
  const galleryStyles = styleSettingsStore.galleryStyles;
850
+ const newColors = styleSettingsStore.newColors;
822
851
  const navigation = navigationStyleSettingsStore.navigation;
823
852
  return {
824
853
  v: GetLatestModelVersion(),
@@ -828,6 +857,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
828
857
  backgroundStyles,
829
858
  textStyles,
830
859
  galleryStyles,
860
+ newColors,
831
861
  },
832
862
  pageHeaderMobile: Object.assign({}, pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.mobile], {
833
863
  navigation: navigation[PAGE_SECTIONS.header][VIEWPORTS.mobile],
@@ -7430,44 +7430,44 @@ body {
7430
7430
  box-shadow: none;
7431
7431
  }
7432
7432
 
7433
- .c-color-grid-sm[data-v-f27a7e48] {
7433
+ .c-color-grid-sm[data-v-a3fd80ec] {
7434
7434
  grid-template-columns: repeat(8, minmax(0, 2rem));
7435
7435
  }
7436
- .c-color-grid-md[data-v-f27a7e48] {
7436
+ .c-color-grid-md[data-v-a3fd80ec] {
7437
7437
  grid-template-columns: repeat(6, minmax(0, 3rem));
7438
7438
  }
7439
- .c-color[data-v-f27a7e48] {
7439
+ .c-color[data-v-a3fd80ec] {
7440
7440
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7441
7441
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7442
7442
  }
7443
- .c-color[data-v-f27a7e48]:hover {
7443
+ .c-color[data-v-a3fd80ec]:hover {
7444
7444
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7445
7445
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7446
7446
  -webkit-transform: scale(1.025);
7447
7447
  transform: scale(1.025);
7448
7448
  }
7449
7449
 
7450
- .c-color[data-v-1dd06ab9] {
7450
+ .c-color[data-v-324fbd15] {
7451
7451
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7452
7452
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7453
7453
  }
7454
- .c-color[data-v-1dd06ab9]:hover {
7454
+ .c-color[data-v-324fbd15]:hover {
7455
7455
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7456
7456
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7457
7457
  -webkit-transform: scale(1.025);
7458
7458
  transform: scale(1.025);
7459
7459
  }
7460
- .c-color[data-v-1dd06ab9] {
7460
+ .c-color[data-v-324fbd15] {
7461
7461
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7462
7462
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7463
7463
  }
7464
- .c-color[data-v-1dd06ab9]:hover {
7464
+ .c-color[data-v-324fbd15]:hover {
7465
7465
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7466
7466
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7467
7467
  -webkit-transform: scale(1.025);
7468
7468
  transform: scale(1.025);
7469
7469
  }
7470
- .maker-color-palette__popup[data-v-1dd06ab9] {
7470
+ .maker-color-palette__popup[data-v-324fbd15] {
7471
7471
  position: absolute;
7472
7472
  padding: 0.625rem;
7473
7473
  background: white;
@@ -7481,13 +7481,13 @@ body {
7481
7481
  height: fit-content;
7482
7482
  max-width: 100%;
7483
7483
  }
7484
- .maker-color-palette__widget-body[data-v-1dd06ab9] {
7484
+ .maker-color-palette__widget-body[data-v-324fbd15] {
7485
7485
  height: 100%;
7486
7486
  overflow-x: hidden;
7487
7487
  overflow-y: auto;
7488
7488
  padding: 0.625rem;
7489
7489
  }
7490
- .picker-button[data-v-1dd06ab9] {
7490
+ .picker-button[data-v-324fbd15] {
7491
7491
  width: 100%;
7492
7492
  border: 1px solid #878787;
7493
7493
  text-transform: uppercase;
@@ -7496,14 +7496,14 @@ body {
7496
7496
  cursor: pointer;
7497
7497
  }
7498
7498
  @media print, screen and (min-width: 40em) {
7499
- .maker-color-palette__popup[data-v-1dd06ab9] {
7499
+ .maker-color-palette__popup[data-v-324fbd15] {
7500
7500
  bottom: initial;
7501
7501
  height: auto;
7502
7502
  top: 1.25rem;
7503
7503
  width: calc(100% - 36px);
7504
7504
  }
7505
7505
  }
7506
- .maker-text-color__icon[data-v-1dd06ab9] {
7506
+ .maker-text-color__icon[data-v-324fbd15] {
7507
7507
  display: -webkit-box;
7508
7508
  display: -ms-flexbox;
7509
7509
  display: flex;
@@ -7517,7 +7517,7 @@ body {
7517
7517
  height: 32px;
7518
7518
  margin-top: 15px;
7519
7519
  }
7520
- .maker-text-color__icon .active[data-v-1dd06ab9] {
7520
+ .maker-text-color__icon .active[data-v-324fbd15] {
7521
7521
  font-weight: bold;
7522
7522
  background: #e3e3e3;
7523
7523
  }
@@ -7758,44 +7758,44 @@ body {
7758
7758
  box-shadow: none;
7759
7759
  }
7760
7760
 
7761
- .c-color-grid-sm[data-v-f27a7e48] {
7761
+ .c-color-grid-sm[data-v-a3fd80ec] {
7762
7762
  grid-template-columns: repeat(8, minmax(0, 2rem));
7763
7763
  }
7764
- .c-color-grid-md[data-v-f27a7e48] {
7764
+ .c-color-grid-md[data-v-a3fd80ec] {
7765
7765
  grid-template-columns: repeat(6, minmax(0, 3rem));
7766
7766
  }
7767
- .c-color[data-v-f27a7e48] {
7767
+ .c-color[data-v-a3fd80ec] {
7768
7768
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7769
7769
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7770
7770
  }
7771
- .c-color[data-v-f27a7e48]:hover {
7771
+ .c-color[data-v-a3fd80ec]:hover {
7772
7772
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7773
7773
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7774
7774
  -webkit-transform: scale(1.025);
7775
7775
  transform: scale(1.025);
7776
7776
  }
7777
7777
 
7778
- .c-color[data-v-1dd06ab9] {
7778
+ .c-color[data-v-324fbd15] {
7779
7779
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7780
7780
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7781
7781
  }
7782
- .c-color[data-v-1dd06ab9]:hover {
7782
+ .c-color[data-v-324fbd15]:hover {
7783
7783
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7784
7784
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7785
7785
  -webkit-transform: scale(1.025);
7786
7786
  transform: scale(1.025);
7787
7787
  }
7788
- .c-color[data-v-1dd06ab9] {
7788
+ .c-color[data-v-324fbd15] {
7789
7789
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7790
7790
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
7791
7791
  }
7792
- .c-color[data-v-1dd06ab9]:hover {
7792
+ .c-color[data-v-324fbd15]:hover {
7793
7793
  -webkit-box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7794
7794
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
7795
7795
  -webkit-transform: scale(1.025);
7796
7796
  transform: scale(1.025);
7797
7797
  }
7798
- .maker-color-palette__popup[data-v-1dd06ab9] {
7798
+ .maker-color-palette__popup[data-v-324fbd15] {
7799
7799
  position: absolute;
7800
7800
  padding: 0.625rem;
7801
7801
  background: white;
@@ -7809,13 +7809,13 @@ body {
7809
7809
  height: fit-content;
7810
7810
  max-width: 100%;
7811
7811
  }
7812
- .maker-color-palette__widget-body[data-v-1dd06ab9] {
7812
+ .maker-color-palette__widget-body[data-v-324fbd15] {
7813
7813
  height: 100%;
7814
7814
  overflow-x: hidden;
7815
7815
  overflow-y: auto;
7816
7816
  padding: 0.625rem;
7817
7817
  }
7818
- .picker-button[data-v-1dd06ab9] {
7818
+ .picker-button[data-v-324fbd15] {
7819
7819
  width: 100%;
7820
7820
  border: 1px solid #878787;
7821
7821
  text-transform: uppercase;
@@ -7824,14 +7824,14 @@ body {
7824
7824
  cursor: pointer;
7825
7825
  }
7826
7826
  @media print, screen and (min-width: 40em) {
7827
- .maker-color-palette__popup[data-v-1dd06ab9] {
7827
+ .maker-color-palette__popup[data-v-324fbd15] {
7828
7828
  bottom: initial;
7829
7829
  height: auto;
7830
7830
  top: 1.25rem;
7831
7831
  width: calc(100% - 36px);
7832
7832
  }
7833
7833
  }
7834
- .maker-text-color__icon[data-v-1dd06ab9] {
7834
+ .maker-text-color__icon[data-v-324fbd15] {
7835
7835
  display: -webkit-box;
7836
7836
  display: -ms-flexbox;
7837
7837
  display: flex;
@@ -7845,7 +7845,7 @@ body {
7845
7845
  height: 32px;
7846
7846
  margin-top: 15px;
7847
7847
  }
7848
- .maker-text-color__icon .active[data-v-1dd06ab9] {
7848
+ .maker-text-color__icon .active[data-v-324fbd15] {
7849
7849
  font-weight: bold;
7850
7850
  background: #e3e3e3;
7851
7851
  }