@designcrowd/library.brand-page 6.1.13-ast-opacity → 6.1.13

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 (71) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-B8j4uryC.js → CreatedOnBrandCrowd-de-de-Fgb3311h.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BsI2J4TR.js → CreatedOnBrandCrowd-en-us-B5STCD_n.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CYxTGgvK.js → CreatedOnBrandCrowd-es-es-DdgIbk4D.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-V6_P_kVa.js → CreatedOnBrandCrowd-fr-ca-DI51kQX5.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-V6_P_kVa.js → CreatedOnBrandCrowd-fr-fr-DI51kQX5.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DSbvq-jt.js → CreatedOnBrandCrowd-pt-br-BSnb2rTr.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DSbvq-jt.js → CreatedOnBrandCrowd-pt-pt-BSnb2rTr.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-6LMPXiBe.js → CreatedOnDcom-de-de-CSZ70DSJ.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-LJWKUu3G.js → CreatedOnDcom-en-us-ndmcsQ7u.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BcJkodUE.js → CreatedOnDcom-es-es-CaxTn1I3.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-DDBXmhmV.js → CreatedOnDcom-fr-ca-D2G_gRcn.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-D0jyOtYU.js → CreatedOnDcom-fr-fr-DEWTbL0q.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DzwvL7Me.js → CreatedOnDcom-pt-br-JrWcosfu.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-B-6e1n0b.js → CreatedOnDcom-pt-pt-C81R_qUX.js} +1 -1
  15. package/lib/src/brand-page/models/index.d.ts +1 -4
  16. package/lib/src/brand-page/models/index.js +1 -4
  17. package/lib/src/brand-page/utils/view-model.util.js +2 -18
  18. package/lib/src/brand-page/view-models.d.ts +1 -2
  19. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +0 -18
  20. package/lib/src/{bundled-translations-B2q5GWTQ.js → bundled-translations-BiFAlQdC.js} +1 -1
  21. package/lib/src/{bundled-translations.de-DE-FhH2H_rd.js → bundled-translations.de-DE-DuRWnOP-.js} +5 -5
  22. package/lib/src/{bundled-translations.es-ES-_ZExxMi7.js → bundled-translations.es-ES-CokHdZtW.js} +5 -5
  23. package/lib/src/{bundled-translations.fr-CA-Tg-ODIiC.js → bundled-translations.fr-CA-CJcMmubA.js} +1 -1
  24. package/lib/src/{bundled-translations.fr-FR-C0sU51Mz.js → bundled-translations.fr-FR-DYPup8fJ.js} +1 -1
  25. package/lib/src/{bundled-translations.pt-BR-MYFIhA4u.js → bundled-translations.pt-BR-GSsp1kuV.js} +9 -9
  26. package/lib/src/{bundled-translations.pt-PT-DeUBSzCB.js → bundled-translations.pt-PT-DbkY8UQ3.js} +9 -9
  27. package/lib/src/bundles/bundled-translations.de-DE.json +0 -1
  28. package/lib/src/bundles/bundled-translations.es-ES.json +0 -1
  29. package/lib/src/bundles/bundled-translations.fr-CA.json +0 -1
  30. package/lib/src/bundles/bundled-translations.fr-FR.json +0 -1
  31. package/lib/src/bundles/bundled-translations.json +0 -1
  32. package/lib/src/bundles/bundled-translations.pt-BR.json +0 -1
  33. package/lib/src/bundles/bundled-translations.pt-PT.json +0 -1
  34. package/lib/src/css/library.brand-page-brandCrowd.min.css +1 -1
  35. package/lib/src/css/library.brand-page-brandPage.min.css +1 -1
  36. package/lib/src/css/library.brand-page-designCom.min.css +1 -1
  37. package/lib/src/css/library.brand-page-preview.min.css +1 -1
  38. package/lib/src/index.mjs +1 -1
  39. package/lib/src/{lib-Dpv7KURd.js → lib-BmaHdOpJ.js} +8420 -8470
  40. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +0 -2
  41. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -5
  42. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +0 -25
  43. package/lib/src/utils/minify-brand-page-metadata.d.ts +0 -1
  44. package/lib/src/utils/minify-brand-page-metadata.js +3 -13
  45. package/package.json +1 -1
  46. package/src/brand-page/models/index.ts +2 -9
  47. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +6 -18
  48. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +2 -6
  49. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +4 -12
  50. package/src/brand-page/utils/view-model.util.test.ts +1 -145
  51. package/src/brand-page/utils/view-model.util.ts +2 -27
  52. package/src/brand-page/view-models.ts +0 -2
  53. package/src/bundles/bundled-translations.de-DE.json +0 -1
  54. package/src/bundles/bundled-translations.es-ES.json +0 -1
  55. package/src/bundles/bundled-translations.fr-CA.json +0 -1
  56. package/src/bundles/bundled-translations.fr-FR.json +0 -1
  57. package/src/bundles/bundled-translations.json +0 -1
  58. package/src/bundles/bundled-translations.pt-BR.json +0 -1
  59. package/src/bundles/bundled-translations.pt-PT.json +0 -1
  60. package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +0 -18
  61. package/src/shared/page-settings/components/page-settings/i18n/page-settings.de-DE.json +0 -1
  62. package/src/shared/page-settings/components/page-settings/i18n/page-settings.es-ES.json +0 -1
  63. package/src/shared/page-settings/components/page-settings/i18n/page-settings.fr-CA.json +0 -1
  64. package/src/shared/page-settings/components/page-settings/i18n/page-settings.fr-FR.json +0 -1
  65. package/src/shared/page-settings/components/page-settings/i18n/page-settings.json +0 -1
  66. package/src/shared/page-settings/components/page-settings/i18n/page-settings.pt-BR.json +0 -1
  67. package/src/shared/page-settings/components/page-settings/i18n/page-settings.pt-PT.json +0 -1
  68. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +0 -33
  69. package/src/utils/minify-brand-page-metadata.test.ts +1 -70
  70. package/src/utils/minify-brand-page-metadata.ts +4 -19
  71. package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.test.ts +0 -111
@@ -3,7 +3,6 @@
3
3
  "headerSettings": "Paramètres d'en-tête",
4
4
  "navigationSectionTitle": "Navigation",
5
5
  "headerSectionTitle": "En-tête",
6
- "backgroundOpacity": "Opacité de l'arrière-plan",
7
6
  "buttonSectionTitle": "Bouton",
8
7
  "footerSettings": "Paramètres de pied de page",
9
8
  "managePages": "Gérer les pages",
@@ -3,7 +3,6 @@
3
3
  "headerSettings": "Header Settings",
4
4
  "navigationSectionTitle": "Navigation",
5
5
  "headerSectionTitle": "Header",
6
- "backgroundOpacity": "Background opacity",
7
6
  "buttonSectionTitle": "Button",
8
7
  "footerSettings": "Footer Settings",
9
8
  "managePages": "Manage Pages",
@@ -3,7 +3,6 @@
3
3
  "headerSettings": "Configurações do cabeçalho",
4
4
  "navigationSectionTitle": "Navegação",
5
5
  "headerSectionTitle": "Cabeçalho",
6
- "backgroundOpacity": "Opacidade do plano de fundo",
7
6
  "buttonSectionTitle": "Botão",
8
7
  "footerSettings": "Definições de rodapé",
9
8
  "managePages": "Gerenciar páginas",
@@ -3,7 +3,6 @@
3
3
  "headerSettings": "Definições de cabeçalho",
4
4
  "navigationSectionTitle": "Navegação",
5
5
  "headerSectionTitle": "Cabeçalho",
6
- "backgroundOpacity": "Opacidade do fundo",
7
6
  "buttonSectionTitle": "Botão",
8
7
  "footerSettings": "Definições de rodapé",
9
8
  "managePages": "Gerir páginas",
@@ -24,7 +24,6 @@ import type {
24
24
  PageFooterMobile,
25
25
  LogoImageModel,
26
26
  LogoViewModel,
27
- BackgroundColorStyle,
28
27
  } from '@brand-page';
29
28
  import {
30
29
  LOGO_SLIDER_DESKTOP_MAX,
@@ -40,7 +39,6 @@ import type {
40
39
  UpdateItemValuePayload,
41
40
  } from '../../../content-settings/models';
42
41
  import { UI_DEVICE_MODES, UI_EVENT_SOURCES } from '../../../models';
43
- import { isTransparentColour } from '@brand-page/utils/color.util';
44
42
 
45
43
  import type { PageSettingsStateSectionStyles } from '../../store';
46
44
  import { useUiPageSettingsStore } from '../../store';
@@ -218,19 +216,6 @@ export default defineComponent({
218
216
  return this.sections[this.sectionName][this.viewport]
219
217
  .backgroundColorEnabled;
220
218
  },
221
- backgroundOpacity(): number {
222
- // Real default: an un-constructed (JSON.parse'd) header never saw the constructor's default.
223
- return (
224
- this.sections[this.sectionName][this.viewport].backgroundStyle
225
- ?.backgroundOpacity ?? 100
226
- );
227
- },
228
- showBackgroundOpacity(): boolean {
229
- // isTransparentColour('') is false, so an unset color needs its own check.
230
- return (
231
- !!this.backgroundColor && !isTransparentColour(this.backgroundColor)
232
- );
233
- },
234
219
  copyrightPlaceholder(): string {
235
220
  return commonTr(`copyrightTextPlaceholder`);
236
221
  },
@@ -559,24 +544,6 @@ export default defineComponent({
559
544
  });
560
545
  },
561
546
 
562
- onBackgroundOpacityChange(value: number | string) {
563
- // Clamped here: the Slider's text field can emit an out-of-range value mid-typing.
564
- const clamped = Math.min(100, Math.max(0, Number(value) || 0));
565
-
566
- // A variable, not an inline literal — backgroundOpacity isn't on BrandPageCssStyle.
567
- const backgroundStyle: BackgroundColorStyle = {
568
- backgroundOpacity: clamped,
569
- };
570
-
571
- this.pageSettingsStore.setPageSettingsSectionValue({
572
- sectionName: this.sectionName,
573
- propName: 'backgroundStyle',
574
- value: backgroundStyle,
575
- merge: true,
576
- viewport: this.viewport,
577
- });
578
- },
579
-
580
547
  onBackgroundEnable(enabled: UpdateItemValuePayload<boolean>) {
581
548
  this.pageSettingsStore.setPageSettingsSectionValue({
582
549
  sectionName: this.sectionName,
@@ -1,76 +1,7 @@
1
1
  import { describe, test, expect } from 'vitest';
2
- import { BRAND_SITE } from '@brand-page-maker/components/brand-page-maker/__fixtures__';
3
- import { BrandPageModel, PageHeaderDesktop } from '@brand-page';
2
+ import type { BrandPageModel } from '../brand-page/models';
4
3
  import { minifyBrandPageMetadata } from './minify-brand-page-metadata';
5
4
 
6
- // Coverage for BP-5851: the AI website builder reads the minified metadata to
7
- // understand the current site, so backgroundOpacity must be visible there too
8
- // (read-only — see docs/plans for BP-5851) whenever the header isn't fully opaque.
9
- describe('minifyBrandPageMetadata — header backgroundOpacity (BP-5851)', () => {
10
- const buildModel = (pageHeaderDesktop: PageHeaderDesktop) =>
11
- new BrandPageModel({
12
- ...BRAND_SITE,
13
- pages: [],
14
- pageHeaderDesktop,
15
- });
16
-
17
- test('opacity below 100 is included in the minified header backgroundStyle', () => {
18
- const model = buildModel(
19
- new PageHeaderDesktop({
20
- backgroundStyle: { backgroundColor: '#112233', backgroundOpacity: 65 },
21
- }),
22
- );
23
-
24
- const minified = minifyBrandPageMetadata(model);
25
-
26
- expect(minified.pageHeaderDesktop?.backgroundStyle).toEqual({
27
- backgroundColor: '#112233',
28
- backgroundOpacity: 65,
29
- });
30
- });
31
-
32
- test('opacity 100 (default/fully opaque) is omitted to keep the payload small', () => {
33
- const model = buildModel(
34
- new PageHeaderDesktop({
35
- backgroundStyle: { backgroundColor: '#112233', backgroundOpacity: 100 },
36
- }),
37
- );
38
-
39
- const minified = minifyBrandPageMetadata(model);
40
-
41
- expect(minified.pageHeaderDesktop?.backgroundStyle).toEqual({
42
- backgroundColor: '#112233',
43
- });
44
- });
45
-
46
- test('un-constructed legacy header with backgroundOpacity absent omits it (defaults to opaque)', () => {
47
- // Forced after buildModel, since BrandPageModel's constructor would re-inject the default.
48
- const model = buildModel(
49
- new PageHeaderDesktop({
50
- backgroundStyle: { backgroundColor: '#112233' },
51
- }),
52
- );
53
-
54
- delete model.pageHeaderDesktop.backgroundStyle.backgroundOpacity;
55
-
56
- const minified = minifyBrandPageMetadata(model);
57
-
58
- expect(minified.pageHeaderDesktop?.backgroundStyle).toEqual({
59
- backgroundColor: '#112233',
60
- });
61
- });
62
-
63
- test('header with no backgroundColor has no minified backgroundStyle at all', () => {
64
- const model = buildModel(
65
- new PageHeaderDesktop({ backgroundStyle: { backgroundOpacity: 40 } }),
66
- );
67
-
68
- const minified = minifyBrandPageMetadata(model);
69
-
70
- expect(minified.pageHeaderDesktop?.backgroundStyle).toBeUndefined();
71
- });
72
- });
73
-
74
5
  /**
75
6
  * BP-5886 — the outbound half of the AI colour bridge (review blocker B8).
76
7
  *
@@ -43,7 +43,7 @@ type MinifiedHeader = {
43
43
  logoImageHeight?: string;
44
44
  logoImageWidth?: string;
45
45
  logoAssetKey?: string;
46
- backgroundStyle?: { backgroundColor?: string; backgroundOpacity?: number };
46
+ backgroundStyle?: { backgroundColor?: string };
47
47
  navigation?: {
48
48
  displayType?: string;
49
49
  defaultButtonStyle?: { color?: string; fontFamily?: string };
@@ -552,23 +552,6 @@ const minifyFooter = (
552
552
  };
553
553
  };
554
554
 
555
- // Fully opaque (100) is the default, so it's omitted to keep the AI payload small.
556
- const minifyHeaderBackgroundStyle = (
557
- backgroundStyle: AbstractPageHeaderStyles['backgroundStyle'] | undefined,
558
- ): MinifiedHeader['backgroundStyle'] => {
559
- const backgroundColor = backgroundStyle?.backgroundColor;
560
-
561
- if (!backgroundColor) return undefined;
562
-
563
- const backgroundOpacity = backgroundStyle.backgroundOpacity;
564
-
565
- return {
566
- backgroundColor,
567
- ...(backgroundOpacity !== undefined &&
568
- backgroundOpacity < 100 && { backgroundOpacity }),
569
- };
570
- };
571
-
572
555
  const minifyHeader = (
573
556
  header: AbstractPageHeaderStyles | undefined | null,
574
557
  logoAssetKey?: string,
@@ -583,7 +566,9 @@ const minifyHeader = (
583
566
  logoImageHeight: header.logoImageHeight || undefined,
584
567
  logoImageWidth: header.logoImageWidth || undefined,
585
568
  ...(logoAssetKey && { logoAssetKey }),
586
- backgroundStyle: minifyHeaderBackgroundStyle(header.backgroundStyle),
569
+ backgroundStyle: header.backgroundStyle?.backgroundColor
570
+ ? { backgroundColor: header.backgroundStyle.backgroundColor as string }
571
+ : undefined,
587
572
  navigation: nav
588
573
  ? {
589
574
  displayType: nav.displayType || undefined,
@@ -1,111 +0,0 @@
1
- import { describe, test, expect, beforeEach } from 'vitest';
2
- import { createPinia, setActivePinia } from 'pinia';
3
- import { shallowMount } from '@vue/test-utils';
4
- import HeaderSettingsPanel from './HeaderSettingsPanel.vue';
5
- import { useUiPageSettingsStore } from '../../store';
6
- import { PAGE_SECTIONS } from '../../models';
7
- import { VIEWPORTS } from '@brand-page';
8
-
9
- // Coverage for BP-5851: the header background opacity slider.
10
- describe('HeaderSettingsPanel — background opacity (BP-5851)', () => {
11
- let pageSettingsStore: ReturnType<typeof useUiPageSettingsStore>;
12
-
13
- beforeEach(() => {
14
- setActivePinia(createPinia());
15
- pageSettingsStore = useUiPageSettingsStore();
16
- });
17
-
18
- const mountPanel = () =>
19
- shallowMount(HeaderSettingsPanel, {
20
- props: {
21
- isAdminMaker: false,
22
- isBrandSite: true,
23
- logoTheme: {},
24
- sectionName: PAGE_SECTIONS.header,
25
- styleOptions: [],
26
- },
27
- });
28
-
29
- const header = (viewport: 'mobile' | 'desktop' = VIEWPORTS.mobile) =>
30
- pageSettingsStore.sections[PAGE_SECTIONS.header][viewport];
31
-
32
- test('defaults to opacity 100 and hides the slider when no background color is set', () => {
33
- const wrapper = mountPanel();
34
-
35
- expect(header().backgroundStyle.backgroundColor).toBeFalsy();
36
- expect((wrapper.vm as any).backgroundOpacity).toBe(100);
37
- expect((wrapper.vm as any).showBackgroundOpacity).toBe(false);
38
- });
39
-
40
- test('shows the slider once a non-transparent background color is set', async () => {
41
- const wrapper = mountPanel();
42
-
43
- header().backgroundStyle = { backgroundColor: '#336699' };
44
- await wrapper.vm.$nextTick();
45
-
46
- expect((wrapper.vm as any).showBackgroundOpacity).toBe(true);
47
- });
48
-
49
- test('an un-constructed header (backgroundStyle carrying no backgroundOpacity) reads as 100', async () => {
50
- const wrapper = mountPanel();
51
-
52
- header().backgroundStyle = { backgroundColor: '#336699' };
53
- await wrapper.vm.$nextTick();
54
-
55
- expect(header().backgroundStyle.backgroundOpacity).toBeUndefined();
56
- expect((wrapper.vm as any).backgroundOpacity).toBe(100);
57
- });
58
-
59
- test('hides the slider again when the color is switched to transparent', async () => {
60
- const wrapper = mountPanel();
61
-
62
- header().backgroundStyle = { backgroundColor: '#336699' };
63
- await wrapper.vm.$nextTick();
64
- expect((wrapper.vm as any).showBackgroundOpacity).toBe(true);
65
-
66
- header().backgroundStyle = { backgroundColor: 'transparent' };
67
- await wrapper.vm.$nextTick();
68
-
69
- expect((wrapper.vm as any).showBackgroundOpacity).toBe(false);
70
- });
71
-
72
- test('onBackgroundOpacityChange merges the value into backgroundStyle of the active viewport section', () => {
73
- const wrapper = mountPanel();
74
-
75
- header().backgroundStyle = {
76
- backgroundColor: '#336699',
77
- backgroundOpacity: 100,
78
- };
79
-
80
- (wrapper.vm as any).onBackgroundOpacityChange(45);
81
-
82
- expect(header().backgroundStyle.backgroundOpacity).toBe(45);
83
- // A merge, not a replace — the sibling backgroundColor must survive.
84
- expect(header().backgroundStyle.backgroundColor).toBe('#336699');
85
- // The other viewport is untouched — opacity is per-viewport, like backgroundColor.
86
- expect(header(VIEWPORTS.desktop).backgroundStyle.backgroundOpacity).toBe(
87
- 100,
88
- );
89
- });
90
-
91
- test('onBackgroundOpacityChange coerces a string value from the slider input', () => {
92
- const wrapper = mountPanel();
93
-
94
- (wrapper.vm as any).onBackgroundOpacityChange('60');
95
-
96
- expect(header().backgroundStyle.backgroundOpacity).toBe(60);
97
- });
98
-
99
- test('onBackgroundOpacityChange clamps an out-of-range value (mid-typing in the Slider text field)', () => {
100
- const wrapper = mountPanel();
101
-
102
- (wrapper.vm as any).onBackgroundOpacityChange('-5');
103
- expect(header().backgroundStyle.backgroundOpacity).toBe(0);
104
-
105
- (wrapper.vm as any).onBackgroundOpacityChange(500);
106
- expect(header().backgroundStyle.backgroundOpacity).toBe(100);
107
-
108
- (wrapper.vm as any).onBackgroundOpacityChange('not-a-number');
109
- expect(header().backgroundStyle.backgroundOpacity).toBe(0);
110
- });
111
- });