@designcrowd/library.brand-page 5.17.25-undo-16 → 5.17.25-undo-18

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-DoZrycKx.js → CreatedOnBrandCrowd-de-de-CBDi9mm7.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DmxNkDLu.js → CreatedOnBrandCrowd-en-us-DmYTrPGS.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-H-sFjCV8.js → CreatedOnBrandCrowd-es-es-CTS46dMT.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-B5DkiLEB.js → CreatedOnBrandCrowd-fr-ca-CR5a9MI7.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-B5DkiLEB.js → CreatedOnBrandCrowd-fr-fr-CR5a9MI7.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-ChETDqmY.js → CreatedOnBrandCrowd-pt-br-rYxhXB9n.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-ChETDqmY.js → CreatedOnBrandCrowd-pt-pt-rYxhXB9n.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CTkJ8L32.js → CreatedOnDcom-de-de-D7ux7LvX.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-CysCo5GG.js → CreatedOnDcom-en-us-CgxnIdbw.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-MMQzRb1p.js → CreatedOnDcom-es-es-CrmM6DV3.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-DuYHuEkT.js → CreatedOnDcom-fr-ca-C7THZHWN.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-DaxFqnuU.js → CreatedOnDcom-fr-fr-BfngdllS.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-BsGlw26o.js → CreatedOnDcom-pt-br-Chk85LOQ.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-_-XMVOfR.js → CreatedOnDcom-pt-pt-D-OsPtCB.js} +1 -1
  15. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -0
  16. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +9 -8
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -0
  18. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +8 -7
  19. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -0
  20. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +2 -1
  21. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -0
  22. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -0
  23. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -0
  24. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +6 -20
  25. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +1 -0
  26. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +14 -0
  27. package/lib/src/brand-page-maker/stores/history/history-store.js +61 -16
  28. package/lib/src/index.mjs +1 -1
  29. package/lib/src/{lib-BgiRnWCM.js → lib-BquHX4Ed.js} +3027 -2998
  30. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
  31. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +9 -8
  32. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +9 -8
  33. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +7 -7
  34. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +8 -7
  35. package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
  36. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +7 -7
  37. package/lib/src/shared/content-settings/components/radio-field/RadioField.mixin.d.ts +1 -1
  38. package/lib/src/shared/content-settings/components/slider-field/SliderField.mixin.d.ts +1 -1
  39. package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
  40. package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
  41. package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
  42. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
  43. package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
  44. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -0
  45. package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
  46. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +8 -7
  47. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +8 -7
  48. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -0
  49. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +1 -1
  50. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -0
  51. package/package.json +1 -1
  52. package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +6 -22
  53. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +16 -0
  54. package/src/brand-page-maker/stores/history/history-store.test.ts +94 -0
  55. package/src/brand-page-maker/stores/history/history-store.ts +73 -15
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BgiRnWCM.js";
2
+ import { _ as t } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BgiRnWCM.js";
2
+ import { _ as t } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BgiRnWCM.js";
2
+ import { _ as t } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BgiRnWCM.js";
2
+ import { _ as t } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BgiRnWCM.js";
2
+ import { _ as t } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BgiRnWCM.js";
2
+ import { _ as t } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BgiRnWCM.js";
2
+ import { _ as t } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-BgiRnWCM.js";
2
+ import { _ as e } from "./lib-BquHX4Ed.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-BgiRnWCM.js";
2
+ import { _ as e } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-BgiRnWCM.js";
2
+ import { _ as e } from "./lib-BquHX4Ed.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-BgiRnWCM.js";
2
+ import { _ as e } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-BgiRnWCM.js";
2
+ import { _ as e } from "./lib-BquHX4Ed.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-BgiRnWCM.js";
2
+ import { _ as M } from "./lib-BquHX4Ed.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-BgiRnWCM.js";
2
+ import { _ as M } from "./lib-BquHX4Ed.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -103,6 +103,7 @@ declare const _default: import("vue").DefineComponent<{}, {
103
103
  description?: string | undefined;
104
104
  isPublished?: boolean | undefined;
105
105
  noDescription?: boolean | undefined;
106
+ resetHistory?: boolean | undefined;
106
107
  }): Promise<void>;
107
108
  hideChangeTemplateConfirmModal(): void;
108
109
  onBackgroundChanged(): void;
@@ -58,7 +58,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
58
58
  selectedTabName: import("vue").ComputedRef<string>;
59
59
  isAdmin: import("vue").ComputedRef<boolean>;
60
60
  contentErrorCount: import("vue").ComputedRef<number>;
61
- mode: import("vue").ComputedRef<"images" | "add" | "pages" | "edit" | "focusedContentItem">;
61
+ mode: import("vue").ComputedRef<"images" | "pages" | "add" | "edit" | "focusedContentItem">;
62
62
  brandPageMakerStore: import("pinia").Store<"brandPageMaker", import("@brand-page-maker/stores").BrandPageMakerState, {
63
63
  contentErrorCount(): number;
64
64
  brandPageBaseUrl(): string;
@@ -148,6 +148,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
148
148
  description?: string | undefined;
149
149
  isPublished?: boolean | undefined;
150
150
  noDescription?: boolean | undefined;
151
+ resetHistory?: boolean | undefined;
151
152
  }): Promise<void>;
152
153
  hideChangeTemplateConfirmModal(): void;
153
154
  onBackgroundChanged(): void;
@@ -549,7 +550,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
549
550
  }[];
550
551
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
551
552
  modeStack: {
552
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
553
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
553
554
  selectedItemId?: string | undefined;
554
555
  selectedItemFieldName?: string | undefined;
555
556
  selectedItemIndex?: number | undefined;
@@ -598,7 +599,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
598
599
  }[];
599
600
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
600
601
  modeStack: {
601
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
602
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
602
603
  selectedItemId?: string | undefined;
603
604
  selectedItemFieldName?: string | undefined;
604
605
  selectedItemIndex?: number | undefined;
@@ -647,7 +648,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
647
648
  }[];
648
649
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
649
650
  modeStack: {
650
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
651
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
651
652
  selectedItemId?: string | undefined;
652
653
  selectedItemFieldName?: string | undefined;
653
654
  selectedItemIndex?: number | undefined;
@@ -696,7 +697,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
696
697
  }[];
697
698
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
698
699
  modeStack: {
699
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
700
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
700
701
  selectedItemId?: string | undefined;
701
702
  selectedItemFieldName?: string | undefined;
702
703
  selectedItemIndex?: number | undefined;
@@ -745,7 +746,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
745
746
  }[];
746
747
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
747
748
  modeStack: {
748
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
749
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
749
750
  selectedItemId?: string | undefined;
750
751
  selectedItemFieldName?: string | undefined;
751
752
  selectedItemIndex?: number | undefined;
@@ -794,7 +795,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
794
795
  }[];
795
796
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
796
797
  modeStack: {
797
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
798
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
798
799
  selectedItemId?: string | undefined;
799
800
  selectedItemFieldName?: string | undefined;
800
801
  selectedItemIndex?: number | undefined;
@@ -806,7 +807,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
806
807
  selectedItemIndex: number | null;
807
808
  activeCategoryTab: string;
808
809
  } & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, groupId: string) => import("@shared/content-settings/models").ContentSettingsItemGroupState;
809
- mode(): "images" | "add" | "pages" | "edit" | "focusedContentItem";
810
+ mode(): "images" | "pages" | "add" | "edit" | "focusedContentItem";
810
811
  selectedItem(): import("@shared/content-settings/models").ContentItem<any> | undefined;
811
812
  selectedItemTemplate(): import("@brand-page-maker/models").ContentSettingsConfig<any, {}> | undefined;
812
813
  }, {
@@ -92,6 +92,7 @@ declare const _default: import("vue").DefineComponent<{}, {
92
92
  description?: string | undefined;
93
93
  isPublished?: boolean | undefined;
94
94
  noDescription?: boolean | undefined;
95
+ resetHistory?: boolean | undefined;
95
96
  }): Promise<void>;
96
97
  hideChangeTemplateConfirmModal(): void;
97
98
  onBackgroundChanged(): void;
@@ -108,7 +108,7 @@ declare const _default: import("vue").DefineComponent<{}, {
108
108
  }[];
109
109
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
110
110
  modeStack: {
111
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
111
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
112
112
  selectedItemId?: string | undefined;
113
113
  selectedItemFieldName?: string | undefined;
114
114
  selectedItemIndex?: number | undefined;
@@ -157,7 +157,7 @@ declare const _default: import("vue").DefineComponent<{}, {
157
157
  }[];
158
158
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
159
159
  modeStack: {
160
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
160
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
161
161
  selectedItemId?: string | undefined;
162
162
  selectedItemFieldName?: string | undefined;
163
163
  selectedItemIndex?: number | undefined;
@@ -206,7 +206,7 @@ declare const _default: import("vue").DefineComponent<{}, {
206
206
  }[];
207
207
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
208
208
  modeStack: {
209
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
209
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
210
210
  selectedItemId?: string | undefined;
211
211
  selectedItemFieldName?: string | undefined;
212
212
  selectedItemIndex?: number | undefined;
@@ -255,7 +255,7 @@ declare const _default: import("vue").DefineComponent<{}, {
255
255
  }[];
256
256
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
257
257
  modeStack: {
258
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
258
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
259
259
  selectedItemId?: string | undefined;
260
260
  selectedItemFieldName?: string | undefined;
261
261
  selectedItemIndex?: number | undefined;
@@ -304,7 +304,7 @@ declare const _default: import("vue").DefineComponent<{}, {
304
304
  }[];
305
305
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
306
306
  modeStack: {
307
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
307
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
308
308
  selectedItemId?: string | undefined;
309
309
  selectedItemFieldName?: string | undefined;
310
310
  selectedItemIndex?: number | undefined;
@@ -353,7 +353,7 @@ declare const _default: import("vue").DefineComponent<{}, {
353
353
  }[];
354
354
  itemStates: Record<string, import("@shared/content-settings/models").ContentSettingsItemState>;
355
355
  modeStack: {
356
- mode: "images" | "add" | "pages" | "edit" | "focusedContentItem";
356
+ mode: "images" | "pages" | "add" | "edit" | "focusedContentItem";
357
357
  selectedItemId?: string | undefined;
358
358
  selectedItemFieldName?: string | undefined;
359
359
  selectedItemIndex?: number | undefined;
@@ -365,7 +365,7 @@ declare const _default: import("vue").DefineComponent<{}, {
365
365
  selectedItemIndex: number | null;
366
366
  activeCategoryTab: string;
367
367
  } & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, groupId: string) => import("@shared/content-settings/models").ContentSettingsItemGroupState;
368
- mode(): "images" | "add" | "pages" | "edit" | "focusedContentItem";
368
+ mode(): "images" | "pages" | "add" | "edit" | "focusedContentItem";
369
369
  selectedItem(): ContentItem<any> | undefined;
370
370
  selectedItemTemplate(): import("../../models").ContentSettingsConfig<any, {}> | undefined;
371
371
  }, {
@@ -598,6 +598,7 @@ declare const _default: import("vue").DefineComponent<{}, {
598
598
  description?: string | undefined;
599
599
  isPublished?: boolean | undefined;
600
600
  noDescription?: boolean | undefined;
601
+ resetHistory?: boolean | undefined;
601
602
  }): Promise<void>;
602
603
  hideChangeTemplateConfirmModal(): void;
603
604
  onBackgroundChanged(): void;
@@ -98,6 +98,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
98
98
  description?: string | undefined;
99
99
  isPublished?: boolean | undefined;
100
100
  noDescription?: boolean | undefined;
101
+ resetHistory?: boolean | undefined;
101
102
  }): Promise<void>;
102
103
  hideChangeTemplateConfirmModal(): void;
103
104
  onBackgroundChanged(): void;
@@ -404,6 +404,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
404
404
  description?: string | undefined;
405
405
  isPublished?: boolean | undefined;
406
406
  noDescription?: boolean | undefined;
407
+ resetHistory?: boolean | undefined;
407
408
  }): Promise<void>;
408
409
  hideChangeTemplateConfirmModal(): void;
409
410
  onBackgroundChanged(): void;
@@ -507,8 +508,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
507
508
  };
508
509
  }>> & Readonly<{}>, {
509
510
  pageTitle: string;
510
- designDraftToken: string;
511
511
  brandPageType: string;
512
+ designDraftToken: string;
512
513
  pageDescription: string;
513
514
  isMaker: boolean;
514
515
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -405,6 +405,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
405
405
  description?: string | undefined;
406
406
  isPublished?: boolean | undefined;
407
407
  noDescription?: boolean | undefined;
408
+ resetHistory?: boolean | undefined;
408
409
  }): Promise<void>;
409
410
  hideChangeTemplateConfirmModal(): void;
410
411
  onBackgroundChanged(): void;
@@ -108,6 +108,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
108
108
  description?: string | undefined;
109
109
  isPublished?: boolean | undefined;
110
110
  noDescription?: boolean | undefined;
111
+ resetHistory?: boolean | undefined;
111
112
  }): Promise<void>;
112
113
  hideChangeTemplateConfirmModal(): void;
113
114
  onBackgroundChanged(): void;
@@ -456,6 +456,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
456
456
  description?: string | undefined;
457
457
  isPublished?: boolean | undefined;
458
458
  noDescription?: boolean | undefined;
459
+ resetHistory?: boolean | undefined;
459
460
  }): Promise<void>;
460
461
  hideChangeTemplateConfirmModal(): void;
461
462
  onBackgroundChanged(): void;
@@ -1,7 +1,6 @@
1
1
  import { defineStore } from 'pinia';
2
2
  import brandPageClient, {} from '../../../clients/brand-page-client';
3
3
  import { useBrandPageMakerStore, useBrandPageMakerUserStore, useLocalisedRouteStore, useLogoStore, useUiStore, useVideoStore, } from '@brand-page-maker/stores';
4
- import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
5
4
  import { SIDE_BAR_TAB_NAMES } from '@brand-page-maker/constants';
6
5
  import { BRAND_PAGE_TYPES, SENSITIVE_CONTENT_TYPES, getAbTestResults, getValueType, } from '@brand-page';
7
6
  import { isLogoContent } from '@brand-page/utils';
@@ -625,25 +624,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
625
624
  this.setTriggerSaveSuccessMessage({
626
625
  triggerSaveSuccessMessage: true,
627
626
  });
628
- // PRD §3 Non-Goals: undo history resets on save/publish so the
629
- // saved state becomes the new clean baseline. Reset BEFORE
630
- // awaiting the notification toast — the post-save reactive
631
- // cascade (designDraftToken update + replaceState URL rewrite
632
- // → router afterEach → pageNavigation writes) starts firing
633
- // immediately and would otherwise be picked up by the watcher
634
- // as a fresh undoable entry, leaving the user able to undo
635
- // back across the save. Gate on `baselineCaptured` so
636
- // non-undo-redo sessions are no-ops (the baseline is only
637
- // captured when the feature flag is on — see
638
- // BrandPageMaker.mixin.ts). Both Save Progress and Publish
639
- // funnel here (publish via `saveAndPublishBrandPage` →
640
- // `saveBrandPage`). reset() re-baselines synchronously so the
641
- // post-save cascade folds into the new baseline's settle
642
- // window instead of producing extra entries.
643
- const historyStore = useHistoryStore();
644
- if (historyStore.baselineCaptured) {
645
- historyStore.reset();
646
- }
647
627
  if (brandPageMakerStore.contentErrorCount > 0) {
648
628
  await brandPageMakerStore.setSelectedTabName({
649
629
  tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
@@ -815,6 +795,12 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
815
795
  try {
816
796
  await brandPageMakerStore.enqueueSaveSuccessMessage({
817
797
  isPublished: this.isPublished,
798
+ // Top-level Save Progress / Publish flow → re-baseline undo
799
+ // history per PRD §3. Settings-only callers of
800
+ // enqueueSaveSuccessMessage (updateBrandPage,
801
+ // updateSensitiveContent, saveTemplate) don't set this flag
802
+ // and so leave the user's undo stack alone.
803
+ resetHistory: true,
818
804
  });
819
805
  }
820
806
  finally {
@@ -173,6 +173,7 @@ export declare const useBrandPageMakerStore: import("pinia").StoreDefinition<"br
173
173
  description?: string;
174
174
  isPublished?: boolean;
175
175
  noDescription?: boolean;
176
+ resetHistory?: boolean;
176
177
  }): Promise<void>;
177
178
  hideChangeTemplateConfirmModal(): void;
178
179
  onBackgroundChanged(): void;
@@ -387,6 +387,20 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
387
387
  description: payload.noDescription ? '' : description,
388
388
  },
389
389
  });
390
+ // PRD §3 Non-Goals: undo history resets on save/publish so the
391
+ // saved state becomes the new clean baseline. Scoped to top-level
392
+ // Save Progress / Publish presses via the explicit `resetHistory`
393
+ // opt-in — the prepurchase flow (BrandCrowd.Net's
394
+ // /brand-sites/prepurchase/upsert handler) and the post-purchase
395
+ // flow (containerStore.saveBrandPage) both pass it. Settings-only
396
+ // saves (updateBrandPage / updateSensitiveContent) and admin
397
+ // saveTemplate funnel through here too but DON'T set the flag,
398
+ // so their success toasts don't disturb the user's undo stack.
399
+ // reset() no-ops in non-undo-redo sessions (no baseline = nothing
400
+ // to clear).
401
+ if (payload.resetHistory) {
402
+ useHistoryStore().reset();
403
+ }
390
404
  },
391
405
  hideChangeTemplateConfirmModal() {
392
406
  this.setIsChangeTemplateConfirmModalVisible({
@@ -659,16 +659,22 @@ export const useHistoryStore = defineStore('history', () => {
659
659
  * drains while the watcher guard is still set, preventing the restore from
660
660
  * being re-captured as a spurious duplicate entry.
661
661
  *
662
- * `targetIndex` is where we are AFTER the pointer-move — the entry we are
663
- * about to apply. The `activePageId` we want to restore lives on that
664
- * entry. If the captured page no longer exists in the restored nav (e.g.
665
- * undoing the add of the page that was active when we captured), we walk
666
- * BACK through earlier entries to find the closest activePageId that does
667
- * exist. That gives "land on the page the user was on before the edit"
668
- * for free — the entry that captured the edit-target's parent state has
669
- * the parent page id already.
662
+ * Active-page resolution priority:
663
+ * 1. Diff against `cameFromIndex` — any page present in the target
664
+ * snapshot but absent from the source snapshot is being "restored"
665
+ * by this transition. Navigate there. Covers undo-of-delete (lands
666
+ * on the deleted page) and redo-of-add (lands on the newly-added
667
+ * page) — both of which the user expects to "follow" the change.
668
+ * Without this, undo of a page-delete would resolve via walk-back
669
+ * to whatever page the user was on at the previous baseline, not
670
+ * the page they just un-deleted.
671
+ * 2. Walk back from `targetIndex` to find the closest entry whose
672
+ * captured `activePageId` still exists in the restored snapshot.
673
+ * Covers undo-of-add (falls back to the page the user was on
674
+ * before they added the new one) and any non-page-structural
675
+ * edits.
670
676
  */
671
- async function applySnapshotString(snapshotStr, targetIndex) {
677
+ async function applySnapshotString(snapshotStr, targetIndex, cameFromIndex) {
672
678
  const brandPageMakerStore = useBrandPageMakerStore();
673
679
  let snapshot;
674
680
  try {
@@ -684,11 +690,39 @@ export const useHistoryStore = defineStore('history', () => {
684
690
  restoredPageIds.add(p.id);
685
691
  });
686
692
  let resolvedActivePageId;
687
- for (let i = targetIndex; i >= 0; i--) {
688
- const candidate = entries.value[i]?.activePageId;
689
- if (candidate && restoredPageIds.has(candidate)) {
690
- resolvedActivePageId = candidate;
691
- break;
693
+ // Step 1: diff against the source-of-transition. The first page in
694
+ // the target snapshot whose id is absent from the source is the page
695
+ // being restored/added by this apply.
696
+ const sourceEntry = entries.value[cameFromIndex];
697
+ if (sourceEntry) {
698
+ const sourcePageIds = new Set();
699
+ try {
700
+ const sourceSnap = JSON.parse(sourceEntry.snapshot);
701
+ sourceSnap.pages?.forEach((p) => {
702
+ if (p?.id)
703
+ sourcePageIds.add(p.id);
704
+ });
705
+ for (const p of snapshot.pages ?? []) {
706
+ if (p?.id && !sourcePageIds.has(p.id)) {
707
+ resolvedActivePageId = p.id;
708
+ break;
709
+ }
710
+ }
711
+ }
712
+ catch {
713
+ // Source snapshot unparseable — fall through to walk-back.
714
+ }
715
+ }
716
+ // Step 2: walk-back fallback. Used when no page-structural diff
717
+ // applies (style/content edits) or when the diff produced nothing
718
+ // viable.
719
+ if (!resolvedActivePageId) {
720
+ for (let i = targetIndex; i >= 0; i--) {
721
+ const candidate = entries.value[i]?.activePageId;
722
+ if (candidate && restoredPageIds.has(candidate)) {
723
+ resolvedActivePageId = candidate;
724
+ break;
725
+ }
692
726
  }
693
727
  }
694
728
  isApplyingSnapshot.value = true;
@@ -709,10 +743,11 @@ export const useHistoryStore = defineStore('history', () => {
709
743
  return;
710
744
  // Capture the actor of the entry we're leaving — that's the change being undone.
711
745
  const undoneActor = entries.value[currentIndex.value]?.actor;
746
+ const cameFromIndex = currentIndex.value;
712
747
  currentIndex.value -= 1;
713
748
  const target = entries.value[currentIndex.value];
714
749
  if (target) {
715
- await applySnapshotString(target.snapshot, currentIndex.value);
750
+ await applySnapshotString(target.snapshot, currentIndex.value, cameFromIndex);
716
751
  }
717
752
  eventTracker.sendUndoEvent({
718
753
  entries_count: entries.value.length,
@@ -726,10 +761,11 @@ export const useHistoryStore = defineStore('history', () => {
726
761
  const aiThreadStore = useAiWebsiteBuilderThreadStore();
727
762
  if (aiThreadStore.isProcessing)
728
763
  return;
764
+ const cameFromIndex = currentIndex.value;
729
765
  currentIndex.value += 1;
730
766
  const target = entries.value[currentIndex.value];
731
767
  if (target) {
732
- await applySnapshotString(target.snapshot, currentIndex.value);
768
+ await applySnapshotString(target.snapshot, currentIndex.value, cameFromIndex);
733
769
  }
734
770
  // Actor of the entry we're moving onto — that's the change being re-applied.
735
771
  eventTracker.sendRedoEvent({
@@ -746,12 +782,21 @@ export const useHistoryStore = defineStore('history', () => {
746
782
  * successful save (covers both Save Progress and Publish, since publish
747
783
  * routes through `saveBrandPage`).
748
784
  *
785
+ * No-ops when no baseline has ever been captured — the undo/redo feature
786
+ * is gated by `userStore.features.canUseUndoRedo` (see
787
+ * BrandPageMaker.mixin.ts), and only flagged sessions install the watcher
788
+ * + capture a baseline. Without this guard, calling reset() in an
789
+ * unflagged session would install the watcher and start eating memory
790
+ * for snapshots the user can never see.
791
+ *
749
792
  * Re-runs `captureBaseline` synchronously so the next mutation lands as
750
793
  * an actual undoable edit rather than disappearing into a fresh settle
751
794
  * window. The watcher stays installed; `installWatcher` early-returns
752
795
  * if `watcherInstalled` is already true.
753
796
  */
754
797
  function reset() {
798
+ if (!baselineCaptured.value)
799
+ return;
755
800
  cancelPendingAutoCapture();
756
801
  entries.value = [];
757
802
  currentIndex.value = -1;
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as E, a as T, b as s, c as I, d as S, e as N, f as e, B as A, g as O, h as C, i as G, j as D, k as P, l as t, m as R, n as L, o as M, p as o, q as r, r as b, s as n, t as F, u as i, v as l, w as g, x as B, y as c, z as Y, C as U, D as d, E as u, F as H, G as p, H as y, I as K, J as k, K as m, L as V, M as X, N as h, O as v, P as W, Q as f, R as x, S as z, T as w, U as Z, V as j, W as Q, X as q, Y as J, Z as $, $ as aa, a0 as _a, a1 as Ea, a2 as Ta, a3 as sa, a4 as Ia, a5 as Sa, a6 as Na, a7 as ea, a8 as Aa, a9 as Oa, aa as Ca, ab as Ga, ac as Da, ad as Pa, ae as ta, af as Ra, ag as La, ah as Ma, ai as oa, aj as ra, ak as ba, al as na, am as Fa, an as ia, ao as la, ap as ga, aq as Ba, ar as ca, as as Ya, at as Ua, au as da, av as ua, aw as Ha, ax as pa, ay as ya, az as Ka, aA as ka, aB as ma, aC as Va, aD as Xa, aE as ha, aF as va, aG as Wa, aH as fa, aI as xa, aJ as za, aK as wa, aL as Za, aM as ja, aN as Qa, aO as qa, aP as Ja, aQ as $a, aR as a_, aS as __, aT as E_, aU as T_, aV as s_, aW as I_, aX as S_, aY as N_, aZ as e_, a_ as A_, a$ as O_, b0 as C_, b1 as G_, b2 as D_, b3 as P_, b4 as t_, b5 as R_, b6 as L_, b7 as M_, b8 as o_, b9 as r_, ba as b_, bb as n_, bc as F_, bd as i_, be as l_, bf as g_, bg as B_, bh as c_, bi as Y_, bj as U_, bk as d_, bl as u_, bm as H_, bn as p_, bo as y_, bp as K_, bq as k_, br as m_, bs as V_, bt as X_, bu as h_, bv as v_, bw as W_, bx as f_, by as x_, bz as z_, bA as w_, bB as Z_, bC as j_, bD as Q_, bE as q_, bF as J_, bG as $_, bH as aE, bI as _E, bJ as EE, bK as TE, bL as sE, bM as IE, bN as SE, bO as NE, bP as eE, bQ as AE, bR as OE, bS as CE, bT as GE, bU as DE, bV as PE, bW as tE, bX as RE, bY as LE, bZ as ME, b_ as oE, b$ as rE, c0 as bE, c1 as nE, c2 as FE, c3 as iE, c4 as lE, c5 as gE, c6 as BE, c7 as cE, c8 as YE, c9 as UE, ca as dE, cb as uE, cc as HE, cd as pE, ce as yE, cf as KE, cg as kE, ch as mE, ci as VE, cj as XE, ck as hE, cl as vE, cm as WE, cn as fE, co as xE } from "./lib-BgiRnWCM.js";
1
+ import { A as E, a as T, b as s, c as I, d as S, e as N, f as e, B as A, g as O, h as C, i as G, j as D, k as P, l as t, m as R, n as L, o as M, p as o, q as r, r as b, s as n, t as F, u as i, v as l, w as g, x as B, y as c, z as Y, C as U, D as d, E as u, F as H, G as p, H as y, I as K, J as k, K as m, L as V, M as X, N as h, O as v, P as W, Q as f, R as x, S as z, T as w, U as Z, V as j, W as Q, X as q, Y as J, Z as $, $ as aa, a0 as _a, a1 as Ea, a2 as Ta, a3 as sa, a4 as Ia, a5 as Sa, a6 as Na, a7 as ea, a8 as Aa, a9 as Oa, aa as Ca, ab as Ga, ac as Da, ad as Pa, ae as ta, af as Ra, ag as La, ah as Ma, ai as oa, aj as ra, ak as ba, al as na, am as Fa, an as ia, ao as la, ap as ga, aq as Ba, ar as ca, as as Ya, at as Ua, au as da, av as ua, aw as Ha, ax as pa, ay as ya, az as Ka, aA as ka, aB as ma, aC as Va, aD as Xa, aE as ha, aF as va, aG as Wa, aH as fa, aI as xa, aJ as za, aK as wa, aL as Za, aM as ja, aN as Qa, aO as qa, aP as Ja, aQ as $a, aR as a_, aS as __, aT as E_, aU as T_, aV as s_, aW as I_, aX as S_, aY as N_, aZ as e_, a_ as A_, a$ as O_, b0 as C_, b1 as G_, b2 as D_, b3 as P_, b4 as t_, b5 as R_, b6 as L_, b7 as M_, b8 as o_, b9 as r_, ba as b_, bb as n_, bc as F_, bd as i_, be as l_, bf as g_, bg as B_, bh as c_, bi as Y_, bj as U_, bk as d_, bl as u_, bm as H_, bn as p_, bo as y_, bp as K_, bq as k_, br as m_, bs as V_, bt as X_, bu as h_, bv as v_, bw as W_, bx as f_, by as x_, bz as z_, bA as w_, bB as Z_, bC as j_, bD as Q_, bE as q_, bF as J_, bG as $_, bH as aE, bI as _E, bJ as EE, bK as TE, bL as sE, bM as IE, bN as SE, bO as NE, bP as eE, bQ as AE, bR as OE, bS as CE, bT as GE, bU as DE, bV as PE, bW as tE, bX as RE, bY as LE, bZ as ME, b_ as oE, b$ as rE, c0 as bE, c1 as nE, c2 as FE, c3 as iE, c4 as lE, c5 as gE, c6 as BE, c7 as cE, c8 as YE, c9 as UE, ca as dE, cb as uE, cc as HE, cd as pE, ce as yE, cf as KE, cg as kE, ch as mE, ci as VE, cj as XE, ck as hE, cl as vE, cm as WE, cn as fE, co as xE } from "./lib-BquHX4Ed.js";
2
2
  import { createPinia as wE, setActivePinia as ZE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,