@designcrowd/library.brand-page 6.1.6 → 6.1.7

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 (55) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-COw1kYDh.js → CreatedOnBrandCrowd-de-de-Dh3Paq4X.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-JRm1p0it.js → CreatedOnBrandCrowd-en-us-DLWYV4xe.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-D-G9uI6b.js → CreatedOnBrandCrowd-es-es-CcjzRbm_.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DQCScohj.js → CreatedOnBrandCrowd-fr-ca-UuUNeB_L.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-DQCScohj.js → CreatedOnBrandCrowd-fr-fr-UuUNeB_L.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-4RazAfO7.js → CreatedOnBrandCrowd-pt-br-ZVYZ5AnV.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-4RazAfO7.js → CreatedOnBrandCrowd-pt-pt-ZVYZ5AnV.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-DqvLTbhq.js → CreatedOnDcom-de-de-BPVyqOPL.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-DG1X0ero.js → CreatedOnDcom-en-us-BUSRV01e.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BxHAIikP.js → CreatedOnDcom-es-es-BuABJnvQ.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BGXoViAC.js → CreatedOnDcom-fr-ca-sjHceLRY.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-CsvmeK2T.js → CreatedOnDcom-fr-fr-D_qGXL3E.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DvWm7MjO.js → CreatedOnDcom-pt-br-D3Sb_YEi.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-Bhz2YEVP.js → CreatedOnDcom-pt-pt-BI47Hv58.js} +1 -1
  15. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +0 -1
  16. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +1 -4
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +9 -6
  18. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +7 -9
  19. package/lib/src/brand-page-maker/constants/sidebar-constant.d.ts +1 -0
  20. package/lib/src/brand-page-maker/constants/sidebar-constant.js +10 -1
  21. package/lib/src/css/library.brand-page-brandCrowd.min.css +27 -27
  22. package/lib/src/css/library.brand-page-brandPage.min.css +27 -27
  23. package/lib/src/css/library.brand-page-designCom.min.css +27 -27
  24. package/lib/src/css/library.brand-page-preview.min.css +27 -27
  25. package/lib/src/index.mjs +1 -1
  26. package/lib/src/{lib-Bg2K2ze6.js → lib-BBX3eBci.js} +13006 -13027
  27. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +10 -177
  28. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +8 -15
  29. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
  30. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +0 -1
  31. package/lib/src/shared/content-settings/store/content-settings-store.js +0 -1
  32. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -12
  33. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.js +9 -24
  34. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +1 -1
  35. package/lib/src/shared/side-bar/components/SideBar.mixin.js +6 -6
  36. package/lib/src/shared/side-bar/store/side-bar-store.js +15 -2
  37. package/package.json +1 -1
  38. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +1 -4
  39. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +9 -10
  40. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +2 -0
  41. package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +8 -12
  42. package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.pages-tab.test.ts +78 -0
  43. package/src/brand-page-maker/constants/sidebar-constant.ts +10 -1
  44. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +9 -4
  45. package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +7 -19
  46. package/src/shared/content-settings/components/content-settings/ContentSettings.pages-tab.test.ts +20 -0
  47. package/src/shared/content-settings/components/content-settings/ContentSettings.vue +1 -8
  48. package/src/shared/content-settings/store/content-settings-store.ts +0 -1
  49. package/src/shared/page-settings/components/page-settings/PageSettings.image-replace.test.ts +100 -0
  50. package/src/shared/page-settings/components/page-settings/PageSettings.mixin.ts +14 -31
  51. package/src/shared/page-settings/components/page-settings/PageSettings.vue +11 -7
  52. package/src/shared/side-bar/components/SideBar.landing-tab.test.ts +67 -0
  53. package/src/shared/side-bar/components/SideBar.mixin.ts +6 -6
  54. package/src/shared/side-bar/store/side-bar-store.test.ts +124 -0
  55. package/src/shared/side-bar/store/side-bar-store.ts +17 -2
@@ -0,0 +1,124 @@
1
+ import { describe, test, expect, beforeEach } from 'vitest';
2
+ import { createPinia, setActivePinia } from 'pinia';
3
+ import { useUiSideBarStore } from './side-bar-store';
4
+ import {
5
+ PAGE_SETTINGS_SECTIONS,
6
+ useUiPageSettingsStore,
7
+ } from '../../page-settings/store';
8
+ import {
9
+ CONTENT_SETTINGS_MODES,
10
+ useUiContentSettingsStore,
11
+ } from '../../content-settings/store';
12
+ import { SIDE_BAR_TAB_NAMES } from '@src/brand-page-maker/constants/sidebar-constant';
13
+
14
+ // Selecting the Pages tab lands the panel at the top (the "pages" section), so a
15
+ // plain tab click always opens on the pages list. Content must no longer touch
16
+ // the page section — Manage Pages left the Content tab in BP-5855.
17
+ describe('side-bar store — Pages tab section coupling', () => {
18
+ beforeEach(() => {
19
+ setActivePinia(createPinia());
20
+ });
21
+
22
+ test('selecting the Pages tab resets the page section to "pages"', () => {
23
+ const sideBarStore = useUiSideBarStore();
24
+ const pageSettingsStore = useUiPageSettingsStore();
25
+
26
+ pageSettingsStore.setSelectedSectionName({
27
+ sectionName: PAGE_SETTINGS_SECTIONS.header,
28
+ });
29
+
30
+ sideBarStore.setSelectedTabName({
31
+ tabName: SIDE_BAR_TAB_NAMES.PAGE_SETTINGS,
32
+ });
33
+
34
+ expect(pageSettingsStore.selectedSectionName).toBe(
35
+ PAGE_SETTINGS_SECTIONS.pages,
36
+ );
37
+ });
38
+
39
+ test('selecting the Content tab leaves the page section untouched', () => {
40
+ const sideBarStore = useUiSideBarStore();
41
+ const pageSettingsStore = useUiPageSettingsStore();
42
+
43
+ pageSettingsStore.setSelectedSectionName({
44
+ sectionName: PAGE_SETTINGS_SECTIONS.header,
45
+ });
46
+
47
+ sideBarStore.setSelectedTabName({
48
+ tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
49
+ });
50
+
51
+ expect(pageSettingsStore.selectedSectionName).toBe(
52
+ PAGE_SETTINGS_SECTIONS.header,
53
+ );
54
+ });
55
+ });
56
+
57
+ // Only one tab's component is ever mounted (BrandPageMaker.vue
58
+ // `<component :is="selectedTabName">`), so a mode left on the shared
59
+ // content-settings store by the tab being left has nowhere to render once the
60
+ // switch happens. Covers both directions of the leak: a header/footer preview
61
+ // deep-link landing on a stuck picker (BrandPageMakerPage.mixin.ts switches tabs
62
+ // without resetting mode), and Pages -> Content carrying the picker over.
63
+ describe('side-bar store — tab switches clear a leftover content-settings mode', () => {
64
+ beforeEach(() => {
65
+ setActivePinia(createPinia());
66
+ });
67
+
68
+ test('switching to the Pages tab clears a leftover images mode', () => {
69
+ const sideBarStore = useUiSideBarStore();
70
+ const contentSettingsStore = useUiContentSettingsStore();
71
+
72
+ contentSettingsStore.pushMode({ mode: CONTENT_SETTINGS_MODES.images });
73
+ expect(contentSettingsStore.mode).toBe(CONTENT_SETTINGS_MODES.images);
74
+
75
+ sideBarStore.setSelectedTabName({
76
+ tabName: SIDE_BAR_TAB_NAMES.PAGE_SETTINGS,
77
+ });
78
+
79
+ expect(contentSettingsStore.mode).toBe(CONTENT_SETTINGS_MODES.edit);
80
+ });
81
+
82
+ test('switching to the Content tab clears a leftover images mode from the Pages tab', () => {
83
+ const sideBarStore = useUiSideBarStore();
84
+ const contentSettingsStore = useUiContentSettingsStore();
85
+
86
+ sideBarStore.setSelectedTabName({
87
+ tabName: SIDE_BAR_TAB_NAMES.PAGE_SETTINGS,
88
+ });
89
+ contentSettingsStore.pushMode({ mode: CONTENT_SETTINGS_MODES.images });
90
+
91
+ sideBarStore.setSelectedTabName({
92
+ tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
93
+ });
94
+
95
+ expect(contentSettingsStore.mode).toBe(CONTENT_SETTINGS_MODES.edit);
96
+ });
97
+
98
+ // Regression guard: SideBarTabButton fires setSelectedTabName unconditionally
99
+ // on every click, including re-clicking the tab you're already on. That must
100
+ // NOT reset an in-progress, same-tab mode — e.g. a focused content item on the
101
+ // Content tab — or clicking the active tab again would silently collapse it.
102
+ // (Caught by brandpage-maker-store.test.ts's
103
+ // "applyHistorySnapshot resets sidebar..." test, which sets up this exact
104
+ // precondition.)
105
+ test('re-selecting the tab already selected does not reset an in-progress mode', () => {
106
+ const sideBarStore = useUiSideBarStore();
107
+ const contentSettingsStore = useUiContentSettingsStore();
108
+
109
+ sideBarStore.setSelectedTabName({
110
+ tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
111
+ });
112
+ contentSettingsStore.pushMode({
113
+ mode: CONTENT_SETTINGS_MODES.focusedContentItem,
114
+ });
115
+
116
+ sideBarStore.setSelectedTabName({
117
+ tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
118
+ });
119
+
120
+ expect(contentSettingsStore.mode).toBe(
121
+ CONTENT_SETTINGS_MODES.focusedContentItem,
122
+ );
123
+ });
124
+ });
@@ -9,6 +9,7 @@ import {
9
9
  PAGE_SETTINGS_SECTIONS,
10
10
  useUiPageSettingsStore,
11
11
  } from '../../page-settings/store';
12
+ import { useUiContentSettingsStore } from '../../content-settings/store';
12
13
 
13
14
  export interface SideBarState {
14
15
  tabs: SideBarTab[];
@@ -20,7 +21,7 @@ export interface SideBarState {
20
21
  export const useUiSideBarStore = defineStore('uiSideBar', {
21
22
  state: (): SideBarState => ({
22
23
  tabs: DEFAULT_SIDE_BAR_TABS(),
23
- selectedTabName: DEFAULT_SIDE_BAR_TABS()[1].name,
24
+ selectedTabName: SIDE_BAR_TAB_NAMES.TEMPLATE_SETTINGS,
24
25
  isSwitchingTab: false,
25
26
  selectedSettingsSection: undefined,
26
27
  }),
@@ -41,9 +42,23 @@ export const useUiSideBarStore = defineStore('uiSideBar', {
41
42
  this.isSwitchingTab = true;
42
43
 
43
44
  try {
45
+ const isActualTabChange = this.selectedTabName !== payload.tabName;
46
+
44
47
  this.selectedTabName = payload.tabName;
45
48
 
46
- if (this.selectedTabName === SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS) {
49
+ // Only one tab's component is ever mounted at a time (BrandPageMaker.vue
50
+ // `<component :is="selectedTabName">`), so a mode left on the shared
51
+ // content-settings store by the tab we're leaving (e.g. an in-flight image
52
+ // replace) has nowhere to render once we've switched — clear it so every
53
+ // *actual* tab switch is a clean slate (BP-5855). Gated on a real change:
54
+ // re-selecting the tab you're already on (e.g. clicking the active sidebar
55
+ // tab again) must NOT reset an in-progress, same-tab mode such as a focused
56
+ // content item (SideBarTabButton fires this unconditionally on every click).
57
+ if (isActualTabChange) {
58
+ useUiContentSettingsStore().resetMode();
59
+ }
60
+
61
+ if (this.selectedTabName === SIDE_BAR_TAB_NAMES.PAGE_SETTINGS) {
47
62
  const pageSettingsStore = useUiPageSettingsStore();
48
63
 
49
64
  pageSettingsStore.setSelectedSectionName({