@designcrowd/library.brand-page 5.18.5 → 5.18.6

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 (142) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-ciKpCAd9.js → CreatedOnBrandCrowd-de-de-DlYq1LAT.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-CZbTS1AZ.js → CreatedOnBrandCrowd-en-us-BssRIQqn.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-C8MExng5.js → CreatedOnBrandCrowd-es-es-BGF9pptH.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-CO0L9NK2.js → CreatedOnBrandCrowd-fr-ca-Caupqu2Z.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-CO0L9NK2.js → CreatedOnBrandCrowd-fr-fr-Caupqu2Z.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-zVDvBF2H.js → CreatedOnBrandCrowd-pt-br-s9q4uJ4u.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-zVDvBF2H.js → CreatedOnBrandCrowd-pt-pt-s9q4uJ4u.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-WrUSQdjf.js → CreatedOnDcom-de-de-UnYnZbA7.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-BqC9YtkL.js → CreatedOnDcom-en-us-rDv6H12L.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BzH32Oya.js → CreatedOnDcom-es-es-DKPLaT6o.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-D7TYfCW0.js → CreatedOnDcom-fr-ca-DAv34bG7.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-DVlyfBtb.js → CreatedOnDcom-fr-fr-DsOHnS8q.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CSRB91ey.js → CreatedOnDcom-pt-br-DpjDBCLj.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-9KMj5gpc.js → CreatedOnDcom-pt-pt-rFG0unf1.js} +1 -1
  15. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +2 -7
  16. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -7
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +0 -8
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +2 -7
  19. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -1
  20. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +2 -87
  21. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -5
  22. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +2 -7
  23. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -3
  24. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.js +0 -11
  25. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +2 -7
  26. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +2 -7
  27. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +2 -7
  28. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +2 -7
  29. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +0 -9
  30. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +1 -20
  31. package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +0 -20
  32. package/lib/src/brand-page-maker/composables/useEventTracker.js +0 -17
  33. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +2 -41
  34. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +5 -307
  35. package/lib/src/brand-page-maker/stores/logo-store/logo-store.d.ts +0 -1
  36. package/lib/src/brand-page-maker/stores/user/user-store.js +0 -1
  37. package/lib/src/bundled-translations-B5Fkt3qd.js +175 -0
  38. package/lib/src/bundled-translations.de-DE-DpdVePM9.js +175 -0
  39. package/lib/src/bundled-translations.es-ES-BsIcrzZF.js +175 -0
  40. package/lib/src/bundled-translations.fr-CA-G1XCp2Qh.js +175 -0
  41. package/lib/src/bundled-translations.fr-FR-BdwLXOnB.js +175 -0
  42. package/lib/src/bundled-translations.pt-BR-Bvn5ePe7.js +175 -0
  43. package/lib/src/bundled-translations.pt-PT-CDtkb2k1.js +175 -0
  44. package/lib/src/bundles/bundled-translations.de-DE.json +1 -3
  45. package/lib/src/bundles/bundled-translations.es-ES.json +1 -3
  46. package/lib/src/bundles/bundled-translations.fr-CA.json +1 -3
  47. package/lib/src/bundles/bundled-translations.fr-FR.json +1 -3
  48. package/lib/src/bundles/bundled-translations.json +1 -3
  49. package/lib/src/bundles/bundled-translations.pt-BR.json +1 -3
  50. package/lib/src/bundles/bundled-translations.pt-PT.json +1 -3
  51. package/lib/src/constants/ui.d.ts +0 -1
  52. package/lib/src/css/library.brand-page-brandCrowd.min.css +15 -20
  53. package/lib/src/css/library.brand-page-brandPage.min.css +16 -20
  54. package/lib/src/css/library.brand-page-designCom.min.css +15 -20
  55. package/lib/src/css/library.brand-page-preview.min.css +15 -20
  56. package/lib/src/index.mjs +1 -1
  57. package/lib/src/{lib-BXbo_N88.js → lib-ngdDRkSL.js} +27318 -27915
  58. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -87
  59. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +0 -5
  60. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +0 -1
  61. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -23
  62. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +0 -16
  63. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +2 -7
  64. package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.d.ts +0 -3
  65. package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.js +2 -19
  66. package/lib/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.js +8 -18
  67. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +0 -64
  68. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +0 -6
  69. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +0 -19
  70. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +0 -11
  71. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +2 -10
  72. package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +1 -5
  73. package/lib/src/shared/logo-settings/store/editable-logo-store.js +0 -31
  74. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -24
  75. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -10
  76. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +2 -23
  77. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +0 -16
  78. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -23
  79. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +0 -16
  80. package/package.json +1 -1
  81. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +0 -9
  82. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +3 -2
  83. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -1
  84. package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -5
  85. package/src/brand-page-maker/components/cookie-collection/CookieSettings.vue +17 -18
  86. package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.ts +0 -13
  87. package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.vue +3 -26
  88. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.de-DE.json +4 -6
  89. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.es-ES.json +4 -6
  90. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.fr-CA.json +4 -6
  91. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.fr-FR.json +4 -6
  92. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.json +1 -3
  93. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.pt-BR.json +4 -6
  94. package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.pt-PT.json +4 -6
  95. package/src/brand-page-maker/components/save-contact/SaveContact.vue +19 -12
  96. package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +0 -10
  97. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +1 -24
  98. package/src/brand-page-maker/composables/useEventTracker.ts +0 -29
  99. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +0 -334
  100. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +4 -371
  101. package/src/brand-page-maker/stores/logo-store/logo-store.ts +0 -5
  102. package/src/brand-page-maker/stores/user/user-store.ts +0 -1
  103. package/src/bundles/bundled-translations.de-DE.json +1 -3
  104. package/src/bundles/bundled-translations.es-ES.json +1 -3
  105. package/src/bundles/bundled-translations.fr-CA.json +1 -3
  106. package/src/bundles/bundled-translations.fr-FR.json +1 -3
  107. package/src/bundles/bundled-translations.json +1 -3
  108. package/src/bundles/bundled-translations.pt-BR.json +1 -3
  109. package/src/bundles/bundled-translations.pt-PT.json +1 -3
  110. package/src/constants/ui.ts +0 -1
  111. package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +0 -5
  112. package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +0 -1
  113. package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.ts +2 -19
  114. package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -1
  115. package/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.ts +10 -26
  116. package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +48 -63
  117. package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +0 -4
  118. package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +0 -7
  119. package/src/shared/content-settings/components/text-field/TextField.vue +0 -1
  120. package/src/shared/content-settings/components/text-image-field/TextImageField.vue +4 -33
  121. package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +0 -11
  122. package/src/shared/logo-settings/store/editable-logo-store.ts +1 -42
  123. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +0 -17
  124. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +0 -25
  125. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +0 -83
  126. package/lib/src/brand-page-maker/stores/history/history-store.js +0 -495
  127. package/lib/src/bundled-translations-D1q3rSEz.js +0 -175
  128. package/lib/src/bundled-translations.de-DE-BxqLLwbh.js +0 -175
  129. package/lib/src/bundled-translations.es-ES-uh249NlJ.js +0 -175
  130. package/lib/src/bundled-translations.fr-CA-BEQmv2fX.js +0 -175
  131. package/lib/src/bundled-translations.fr-FR-BnNuCojH.js +0 -175
  132. package/lib/src/bundled-translations.pt-BR-CJUOxVlq.js +0 -175
  133. package/lib/src/bundled-translations.pt-PT-Ds9cMEqK.js +0 -175
  134. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
  135. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
  136. package/src/brand-page-maker/components/quick-link-bar/RedoButton.vue +0 -66
  137. package/src/brand-page-maker/components/quick-link-bar/UndoButton.vue +0 -66
  138. package/src/brand-page-maker/components/quick-link-bar/undo-redo-buttons.test.ts +0 -116
  139. package/src/brand-page-maker/composables/useUndoRedoFlag.ts +0 -30
  140. package/src/brand-page-maker/stores/history/history-store.test.ts +0 -1120
  141. package/src/brand-page-maker/stores/history/history-store.ts +0 -660
  142. package/src/metadata-builder/builders/reorder-pages-builder.ts +0 -80
@@ -55,10 +55,6 @@ export declare const EVENTS: {
55
55
  WEBSITE_MAKER_DIGITAL_BUSINESS_CARDS_HIDE_POPUP: string;
56
56
  WEBSITE_MAKER_GETTY_VIDEO: string;
57
57
  WEBSITE_MAKER_SHIPPING_TOGGLE: string;
58
- WEBSITE_MAKER_UNDO: string;
59
- WEBSITE_MAKER_REDO: string;
60
- WEBSITE_MAKER_HISTORY_CAPPED: string;
61
- WEBSITE_MAKER_HISTORY_OVERSIZED: string;
62
58
  };
63
59
  export declare const SELECT_LOCATIONS: {
64
60
  MAKER_PREVIEW: string;
@@ -111,22 +107,6 @@ export declare const PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS: {
111
107
  };
112
108
  declare const useEventTracker: () => {
113
109
  sendShippingToggleEvent: (isEnabled: boolean) => void;
114
- sendUndoEvent: (props: {
115
- entries_count: number;
116
- actor: string | undefined;
117
- }) => void;
118
- sendRedoEvent: (props: {
119
- entries_count: number;
120
- actor: string | undefined;
121
- }) => void;
122
- sendHistoryCappedEvent: (props: {
123
- entries_count: number;
124
- size_bytes: number;
125
- }) => void;
126
- sendHistoryOversizedEvent: (props: {
127
- attempted_bytes: number;
128
- source: string;
129
- }) => void;
130
110
  sendSaveContactEvent: () => void;
131
111
  sendStartForFreeEvent: () => void;
132
112
  sendFooterLinkClickEvent: (linkType: 'watermark_logo' | 'create_your_website') => void;
@@ -36,10 +36,6 @@ export const EVENTS = {
36
36
  WEBSITE_MAKER_DIGITAL_BUSINESS_CARDS_HIDE_POPUP: 'website_maker_digital_business_cards_hide_popup',
37
37
  WEBSITE_MAKER_GETTY_VIDEO: 'website_maker_getty_video',
38
38
  WEBSITE_MAKER_SHIPPING_TOGGLE: 'website_maker_shipping_toggle',
39
- WEBSITE_MAKER_UNDO: 'website_maker_undo',
40
- WEBSITE_MAKER_REDO: 'website_maker_redo',
41
- WEBSITE_MAKER_HISTORY_CAPPED: 'website_maker_history_capped',
42
- WEBSITE_MAKER_HISTORY_OVERSIZED: 'website_maker_history_oversized',
43
39
  };
44
40
  export const SELECT_LOCATIONS = {
45
41
  MAKER_PREVIEW: 'maker_preview',
@@ -325,19 +321,6 @@ const useEventTracker = () => {
325
321
  is_enabled: isEnabled,
326
322
  });
327
323
  },
328
- // Undo / Redo (BP-5506)
329
- sendUndoEvent: (props) => {
330
- _publishEvent(EVENTS.WEBSITE_MAKER_UNDO, props);
331
- },
332
- sendRedoEvent: (props) => {
333
- _publishEvent(EVENTS.WEBSITE_MAKER_REDO, props);
334
- },
335
- sendHistoryCappedEvent: (props) => {
336
- _publishEvent(EVENTS.WEBSITE_MAKER_HISTORY_CAPPED, props);
337
- },
338
- sendHistoryOversizedEvent: (props) => {
339
- _publishEvent(EVENTS.WEBSITE_MAKER_HISTORY_OVERSIZED, props);
340
- },
341
324
  };
342
325
  };
343
326
  export { useEventTracker };
@@ -177,55 +177,16 @@ export declare const useBrandPageMakerStore: import("pinia").StoreDefinition<"br
177
177
  hideChangeTemplateConfirmModal(): void;
178
178
  onBackgroundChanged(): void;
179
179
  onChangeTemplateConfirmModalCancel(): void;
180
- onChangeTemplateConfirmModalConfirm(): Promise<void>;
180
+ onChangeTemplateConfirmModalConfirm(): void;
181
181
  onContentChanged(): void;
182
182
  onStyleChanged(): void;
183
- onTemplateSelected(payload: OnTemplateSelectedPayload): Promise<void>;
183
+ onTemplateSelected(payload: OnTemplateSelectedPayload): void;
184
184
  setSelectedTabName(payload: any): void;
185
185
  showNextNotificationMessage(): Promise<void>;
186
186
  updateContent<TContent extends Content, P extends {
187
187
  id: string;
188
188
  content: TContent;
189
189
  }>(payload: P): Promise<void>;
190
- /**
191
- * Restore every store that the `brandPageData` getter reads from, so undo
192
- * and redo bring back the EXACT document state captured at snapshot time.
193
- *
194
- * `initialiseStoresByBrandPageModelAsync` is too narrow for undo/redo — it
195
- * only rehydrates pages, sections, and nav structure, which is enough for
196
- * the AI-apply path but leaves navigation styles, backgrounds, button/text/
197
- * logo/gallery styles, shop config, and several own-store fields unchanged.
198
- * This action mirrors the full hydration surface of `applySelectedTemplate`
199
- * (minus the template-specific logo/personalisation logic) so a restore is
200
- * a complete round-trip of what `brandPageData` returns.
201
- *
202
- * Called ONLY by history-store during undo/redo. The history store sets
203
- * `isApplyingSnapshot=true` across this call to prevent the deep-watcher
204
- * on `brandPageData` from re-capturing the restored state.
205
- */
206
- /**
207
- * Force-commit a `template_switch` entry to the history store, if the
208
- * history store has a baseline (which only happens when the undo/redo
209
- * feature flag is on — see `BrandPageMaker.mixin.ts`).
210
- */
211
- _captureTemplateSwitchIfEnabled(): void;
212
- applyHistorySnapshot(snapshot: BrandPageModel, activePageId?: string, logoEditsStr?: string): Promise<void>;
213
- _syncLogoSettingsFromSnapshot(snapshot: BrandPageModel, logoEditsStr?: string): Promise<void>;
214
- /**
215
- * Restore the active page after a history apply. The id passed in is
216
- * already validated against the restored nav by the history store; if
217
- * it's undefined (no entry walking back had a viable page), fall back
218
- * to the first/default route so the URL, `routeStore.currentRoute.params`,
219
- * `pageNavigation.activePageId`, and the page-tab highlight all line up.
220
- *
221
- * `setCurrentActivePage` is called explicitly in addition to
222
- * `navigateToPageByPageId` because `navigateToPageByPageId` is a no-op
223
- * when the router instance is undefined (e.g. SSR / unit tests), but the
224
- * Pinia state must still be updated so the sidebar's `currentPage`
225
- * getter returns the right page.
226
- */
227
- _navigateToActivePage(activePageId?: string): void;
228
- _fallbackSidebarIfSelectedContentMissing(snapshot: BrandPageModel): void;
229
190
  export(): BrandPageModel;
230
191
  setBrandPageType({ brandPageType }: {
231
192
  brandPageType: BrandPageType;
@@ -2,7 +2,6 @@ import { EMPTY_LOGO_IMAGE_MODEL, SENSITIVE_CONTENT_TYPES, TEXT_STYLE_TYPES, VIEW
2
2
  import { BackgroundStyles, BRAND_PAGE_TYPES, BrandPageModel, CONTENT_TYPES, NavigationDesktop, NavigationMobile, NavModel, } from '@brand-page';
3
3
  import { useBrandPageMakerUserStore } from '../user';
4
4
  import { defineStore } from 'pinia';
5
- import { toRaw } from 'vue';
6
5
  import { useUiStore } from '../ui';
7
6
  import { useUiLogoSettingsStore, useUiEditableLogoStore, } from '@shared/logo-settings/store';
8
7
  import { useUiStyleSettingsStore } from '@shared/style-settings/store';
@@ -12,7 +11,7 @@ import { useShopConfigStore } from '@shared/ecommerce-settings/store/shop-settin
12
11
  import { usePageNavigationStore } from '@shared/page-navigation/store/page-navigation-store';
13
12
  import { applyLogoThemeToBrandPageModel, migrateBrandPageModel, applyUserPersonalisationToBrandPageModelAsync, getBrandPageViewModelFromBrandPageModel, isLogoContent, parseLogoThemeToCssStyles, logoUtil, GetLatestModelVersion, } from '@brand-page/utils';
14
13
  import { navigateToPageByPageId } from '../../routing';
15
- import { BRANDPAGE_DEFAULT_ERROR_MESSAGE_DESCRIPTION, BRANDPAGE_DEFAULT_SAVE_MESSAGE_DESCRIPTION, MAKER_MOBILE_BREAKPOINT, MESSAGE_VISIBLE_DURATION, SIDE_BAR_TAB_NAMES, } from '@brand-page-maker/constants';
14
+ import { BRANDPAGE_DEFAULT_ERROR_MESSAGE_DESCRIPTION, BRANDPAGE_DEFAULT_SAVE_MESSAGE_DESCRIPTION, MAKER_MOBILE_BREAKPOINT, MESSAGE_VISIBLE_DURATION, } from '@brand-page-maker/constants';
16
15
  import { useUiSideBarStore } from '@shared/side-bar/store';
17
16
  import { delayInMS } from '../../../utils/ui-util';
18
17
  import { useUiContentSettingsStore } from '@shared/content-settings/store';
@@ -34,7 +33,6 @@ import { useConsent } from '@brand-page/composables/consent.composable';
34
33
  import { commonTr, errorTr } from '@src/composables/useTranslate';
35
34
  import { UPGRADE_CTA_LOCATIONS } from '../../composables/useEventTracker';
36
35
  import { useVideoStore } from '../video';
37
- import { useHistoryStore } from '../history/history-store';
38
36
  import { findValuesByKey } from '../../../helpers/ts.helper';
39
37
  import { useLogoStore } from '../logo-store';
40
38
  const brandPageTypeTemplateTypeMap = {
@@ -389,15 +387,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
389
387
  description: payload.noDescription ? '' : description,
390
388
  },
391
389
  });
392
- // Any successful save re-baselines the undo stack so a user can't
393
- // undo back past the persisted state. This covers Save Progress /
394
- // Publish AND settings-only saves (updateBrandPage,
395
- // updateSensitiveContent, admin saveTemplate) — settings-tab
396
- // actions persist the metadata, so allowing undo to roll them
397
- // back would let the local stack drift from what's saved.
398
- // reset() no-ops in non-undo-redo sessions (no baseline = nothing
399
- // to clear).
400
- useHistoryStore().reset();
401
390
  },
402
391
  hideChangeTemplateConfirmModal() {
403
392
  this.setIsChangeTemplateConfirmModalVisible({
@@ -411,11 +400,10 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
411
400
  this.setSelectedTemplateId({ templateId: false });
412
401
  this.hideChangeTemplateConfirmModal();
413
402
  },
414
- async onChangeTemplateConfirmModalConfirm() {
415
- await this.applySelectedTemplate();
403
+ onChangeTemplateConfirmModalConfirm() {
404
+ this.applySelectedTemplate();
416
405
  this.hideChangeTemplateConfirmModal();
417
406
  this.isModifiedAfterTemplateApplied = false;
418
- this._captureTemplateSwitchIfEnabled();
419
407
  },
420
408
  onContentChanged() {
421
409
  this.setIsModifiedAfterTemplateApplied();
@@ -423,7 +411,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
423
411
  onStyleChanged() {
424
412
  this.setIsModifiedAfterTemplateApplied();
425
413
  },
426
- async onTemplateSelected(payload) {
414
+ onTemplateSelected(payload) {
427
415
  this.setSelectedTemplateId({
428
416
  templateId: payload.templateId,
429
417
  });
@@ -433,8 +421,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
433
421
  });
434
422
  }
435
423
  else {
436
- await this.applySelectedTemplate();
437
- this._captureTemplateSwitchIfEnabled();
424
+ this.applySelectedTemplate();
438
425
  }
439
426
  },
440
427
  setSelectedTabName(payload) {
@@ -460,295 +447,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
460
447
  async updateContent(payload) {
461
448
  const uiContentSettingsStore = useUiContentSettingsStore();
462
449
  uiContentSettingsStore.updateContent(payload);
463
- // NOTE (Bolt 1, 2026-04-23): this action is not the actual edit path used
464
- // by the UI — sidebar inputs call uiContentSettingsStore.updateItemValue
465
- // directly. History capture is driven by a deep `watch(brandPageData, ...)`
466
- // installed in history-store once the baseline is captured, so we do not
467
- // need to instrument this action. Kept here as a pass-through because
468
- // removing it may affect other callers.
469
- },
470
- /**
471
- * Restore every store that the `brandPageData` getter reads from, so undo
472
- * and redo bring back the EXACT document state captured at snapshot time.
473
- *
474
- * `initialiseStoresByBrandPageModelAsync` is too narrow for undo/redo — it
475
- * only rehydrates pages, sections, and nav structure, which is enough for
476
- * the AI-apply path but leaves navigation styles, backgrounds, button/text/
477
- * logo/gallery styles, shop config, and several own-store fields unchanged.
478
- * This action mirrors the full hydration surface of `applySelectedTemplate`
479
- * (minus the template-specific logo/personalisation logic) so a restore is
480
- * a complete round-trip of what `brandPageData` returns.
481
- *
482
- * Called ONLY by history-store during undo/redo. The history store sets
483
- * `isApplyingSnapshot=true` across this call to prevent the deep-watcher
484
- * on `brandPageData` from re-capturing the restored state.
485
- */
486
- /**
487
- * Force-commit a `template_switch` entry to the history store, if the
488
- * history store has a baseline (which only happens when the undo/redo
489
- * feature flag is on — see `BrandPageMaker.mixin.ts`).
490
- */
491
- _captureTemplateSwitchIfEnabled() {
492
- const historyStore = useHistoryStore();
493
- if (!historyStore.baselineCaptured)
494
- return;
495
- historyStore.captureTemplateSwitch();
496
- },
497
- async applyHistorySnapshot(snapshot, activePageId, logoEditsStr) {
498
- const styleSettingsStore = useUiStyleSettingsStore();
499
- const navigationStyleSettingsStore = useUiNavigationStyleSettingsStore();
500
- const backgroundSettingsStore = useUiBackgroundSettingsStore();
501
- const pageNavigationStore = usePageNavigationStore();
502
- const shopStore = useShopConfigStore();
503
- // 1. Pages + header/footer sections (also covers content items).
504
- this.initialisePagesForCurrentPage({
505
- pages: snapshot.pages,
506
- sections: {
507
- [PAGE_SECTIONS.header]: {
508
- [VIEWPORTS.desktop]: snapshot.pageHeaderDesktop,
509
- [VIEWPORTS.mobile]: snapshot.pageHeaderMobile,
510
- },
511
- [PAGE_SECTIONS.footer]: {
512
- [VIEWPORTS.desktop]: snapshot.pageFooterDesktop,
513
- [VIEWPORTS.mobile]: snapshot.pageFooterMobile,
514
- },
515
- },
516
- });
517
- // 2. Page-level nav structure (routes, orders).
518
- pageNavigationStore.setNav({ nav: snapshot.nav });
519
- // 3. Navigation STYLES (header/footer nav colors, alignment, etc.) —
520
- // this is the bit that was being dropped before.
521
- // Use function-form $patch so each nested style object is replaced as a
522
- // whole reference. The object-form $patch (used by setState) deep-merges
523
- // and would leave keys present in the live state but absent from the
524
- // snapshot in place — e.g. switching button styles then undoing would
525
- // leave the new style's borderRadius/borderStyle/borderWidth applied.
526
- navigationStyleSettingsStore.$patch((state) => {
527
- state.navigation[PAGE_SECTIONS.header][VIEWPORTS.desktop] =
528
- new NavigationDesktop(snapshot.pageHeaderDesktop?.navigation);
529
- state.navigation[PAGE_SECTIONS.header][VIEWPORTS.mobile] =
530
- new NavigationMobile(snapshot.pageHeaderMobile?.navigation);
531
- });
532
- // 4. Global styles (logo, button, text, gallery). Same whole-reference
533
- // replacement reasoning as step 3.
534
- styleSettingsStore.$patch((state) => {
535
- state.buttonStyles = snapshot.styles.buttonStyles;
536
- state.logoStyles = snapshot.styles.logoStyles;
537
- state.textStyles = snapshot.styles.textStyles;
538
- state.galleryStyles = snapshot.styles.galleryStyles;
539
- });
540
- // 5. Background styles. Same whole-reference replacement reasoning as
541
- // step 3 — `setBackgroundStyles` calls per-field setters that
542
- // `Object.assign` partials onto the live `style` and
543
- // `backgroundShapeStyle` objects, so keys from the previous mode
544
- // (e.g. background image url, shape style props) would survive an
545
- // undo back to a state that doesn't have them.
546
- backgroundSettingsStore.$patch((state) => {
547
- state.backgroundStyles = snapshot.styles.backgroundStyles;
548
- });
549
- backgroundSettingsStore.onBackgroundChanged();
550
- // 6. Shop products are derived from shop-content blocks inside `pages`,
551
- // so they're already implicitly restored at step 1. Re-run the shop
552
- // store's derivation to keep `products` in sync with the snapshot
553
- // pages. paymentConfig is intentionally NOT restored — selecting it is
554
- // backend-confirmed (Stripe Connect / payment-provider linkage) per
555
- // project-guardrails.md, so it must persist across undo. We pass the
556
- // live paymentConfig back in to preserve it.
557
- shopStore.initialiseShopStore({
558
- paymentConfig: shopStore.paymentConfig,
559
- pages: snapshot.pages ?? [],
560
- });
561
- // 7. Own-store scalar fields surfaced by the brandPageData getter.
562
- if (snapshot.isModifiedAfterTemplateApplied !== undefined) {
563
- this.isModifiedAfterTemplateApplied =
564
- snapshot.isModifiedAfterTemplateApplied;
565
- }
566
- if (snapshot.brandPageType) {
567
- this.setBrandPageType({ brandPageType: snapshot.brandPageType });
568
- }
569
- this.faviconUrl = snapshot.faviconUrl;
570
- this.ogImageUrl = snapshot.ogImageUrl;
571
- this.measurementID = snapshot.measurementID;
572
- this.adsenseID = snapshot.adsenseID;
573
- this.ogTitle = snapshot.ogTitle;
574
- this.ogDescription = snapshot.ogDescription;
575
- this.cookieOptions = snapshot.cookieOptions;
576
- this.saveContactSettings = snapshot.saveContactSettings;
577
- // 8. Re-sync the logo-settings sidebar's `selectedLogoImage` from the
578
- // restored header logo. The preview rehydrates via the page contents,
579
- // but `uiLogoSettings` holds its own copy that drives the sidebar
580
- // "current logo" state — same pattern as `initialiseStoresByBrandPageModelAsync`.
581
- // Also restores the variations grid + template asset for the
582
- // snapshot's draft token (both are sidecars to `brandPageData` —
583
- // BYO upload mutates them out of band). When the captured entry
584
- // carries a `logoEdits` sidecar (pre-purchase logo-tab edits —
585
- // text, support text, logo colors, fonts), `editableLogoStore.logoEdits`
586
- // is restored from that string so the sidebar form fields and the
587
- // save-time fabric-render POST both pick up the pre-edit state.
588
- await this._syncLogoSettingsFromSnapshot(snapshot, logoEditsStr);
589
- // 9. If the sidebar is editing a content item that no longer exists in
590
- // the restored page, fall back to the Content tab so the user doesn't
591
- // stare at a blank settings panel.
592
- this._fallbackSidebarIfSelectedContentMissing(snapshot);
593
- // 10. Switch to the page the user was viewing when this entry was
594
- // captured (or the closest still-existing page if the captured
595
- // page was the one being undone-away). The history store does the
596
- // walk-back resolution and passes us a pageId that's guaranteed to
597
- // exist in the restored nav — or undefined if no entry walking
598
- // back has a viable id, in which case we fall through to the
599
- // first/default route. Without this, the page-tabs carousel keeps
600
- // highlighting whatever page slug is in the URL (which can no
601
- // longer match any nav item after a page-add undo) and the
602
- // sidebar's `currentPage` getter silently falls back to page 0.
603
- this._navigateToActivePage(activePageId);
604
- },
605
- async _syncLogoSettingsFromSnapshot(snapshot, logoEditsStr) {
606
- const logoSettingsStore = useUiLogoSettingsStore();
607
- const editableLogoStore = useUiEditableLogoStore();
608
- const logoStore = useLogoStore();
609
- const containerStore = useBrandPageContainerStore();
610
- // Pre-restore logo identity, used to short-circuit the
611
- // fabric-render call when only non-logo state changed.
612
- const prevLogoEditsStr = JSON.stringify(toRaw(editableLogoStore.logoEdits));
613
- const prevDraftToken = editableLogoStore.logoDraftToken;
614
- // Wholesale-replace via $patch so prior textObjects/colors don't
615
- // leak across template switches.
616
- if (logoEditsStr) {
617
- try {
618
- const parsed = JSON.parse(logoEditsStr);
619
- editableLogoStore.$patch({ logoEdits: parsed });
620
- }
621
- catch (error) {
622
- console.error('brandpage-maker-store: failed to restore logoEdits', error);
623
- }
624
- }
625
- const logoImage = snapshot.brandPageType === BRAND_PAGE_TYPES.default
626
- ? snapshot.pages?.[0]?.contents?.find((c) => c.type === 'logo')?.logoImage
627
- : snapshot.pageHeaderDesktop?.logoImage;
628
- if (!logoImage)
629
- return;
630
- logoSettingsStore.setState({
631
- newState: { selectedLogoImage: logoImage },
632
- });
633
- const draftToken = logoImage.logoDraftToken;
634
- if (!draftToken)
635
- return;
636
- // Re-derive enableEditMode + templateAsset from the draft registry
637
- // (append-only for the session) instead of stashing on every entry.
638
- const draft = logoStore.getLogoDraftAssetByToken(draftToken);
639
- if (draft) {
640
- editableLogoStore.setEnableEditMode(!draft.isByo);
641
- if (draft.templateAsset) {
642
- logoStore.setLogoTemplateAsset(draft.templateAsset);
643
- }
644
- }
645
- editableLogoStore.setLogoDraftToken(draftToken);
646
- // No logo change → cache is still correct; just stamp base64 back
647
- // (snapshot doesn't carry logoImageBase64Url).
648
- const logoUnchanged = prevDraftToken === draftToken &&
649
- (logoEditsStr === undefined || logoEditsStr === prevLogoEditsStr);
650
- if (logoUnchanged) {
651
- editableLogoStore.stampLogoBase64IntoBrandPageData();
652
- return;
653
- }
654
- const isByo = !!draft?.isByo;
655
- if (isByo) {
656
- // BYO mints a fresh draftToken per upload so the per-token
657
- // cache always matches; no re-render needed.
658
- if (editableLogoStore.restoreVariationsForDraftToken(draftToken)) {
659
- editableLogoStore.stampLogoBase64IntoBrandPageData();
660
- }
661
- return;
662
- }
663
- // Designed: draft token is reused across edits, so the cache
664
- // only holds the latest render. Re-issue fabric-render — same
665
- // call as the live edit path. Awaited so concurrent undos
666
- // serialize and the call sits inside the isApplyingSnapshot
667
- // window (watcher guard suppresses the writeback).
668
- if (containerStore.isPrePurchase &&
669
- logoEditsStr &&
670
- logoStore.logoTemplateAsset) {
671
- // Stamp the cached (pre-undo) base64 onto brandPageData first
672
- // so the canvas keeps showing the previous logo while the
673
- // re-render is in flight. Without this the logoImageBase64Url
674
- // fields are undefined (snapshot is stripped pre-purchase) and
675
- // the canvas flickers blank for ~500-1500ms.
676
- editableLogoStore.stampLogoBase64IntoBrandPageData();
677
- try {
678
- await editableLogoStore.updateEditableLogoImageUrlAsync();
679
- }
680
- catch (error) {
681
- console.error('brandpage-maker-store: failed to re-render logo on history apply', error);
682
- }
683
- }
684
- },
685
- /**
686
- * Restore the active page after a history apply. The id passed in is
687
- * already validated against the restored nav by the history store; if
688
- * it's undefined (no entry walking back had a viable page), fall back
689
- * to the first/default route so the URL, `routeStore.currentRoute.params`,
690
- * `pageNavigation.activePageId`, and the page-tab highlight all line up.
691
- *
692
- * `setCurrentActivePage` is called explicitly in addition to
693
- * `navigateToPageByPageId` because `navigateToPageByPageId` is a no-op
694
- * when the router instance is undefined (e.g. SSR / unit tests), but the
695
- * Pinia state must still be updated so the sidebar's `currentPage`
696
- * getter returns the right page.
697
- */
698
- _navigateToActivePage(activePageId) {
699
- const pageNavigationStore = usePageNavigationStore();
700
- let targetPageId = activePageId;
701
- if (!targetPageId) {
702
- const fallbackRoute = pageNavigationStore.routes.length
703
- ? pageNavigationStore.getFirstOrDefaultRoute()
704
- : undefined;
705
- targetPageId = fallbackRoute?.pageId;
706
- }
707
- if (!targetPageId)
708
- return;
709
- // Skip both the Pinia write and the router push when the target page
710
- // is already active. The router push fires `router.afterEach` even
711
- // for same-page navigation, and BrandPageMaker.mixin's afterEach hook
712
- // resets the content-settings modeStack — which would snap the
713
- // sidebar back to the default Content tab on every undo/redo,
714
- // regardless of whether the user was deep-editing a content item.
715
- if (pageNavigationStore.activePageId === targetPageId)
716
- return;
717
- pageNavigationStore.setCurrentActivePage({ pageId: targetPageId });
718
- navigateToPageByPageId(targetPageId);
719
- },
720
- _fallbackSidebarIfSelectedContentMissing(snapshot) {
721
- const contentSettingsStore = useUiContentSettingsStore();
722
- const sideBarStore = useUiSideBarStore();
723
- const selectedItemId = contentSettingsStore.selectedItemId;
724
- if (!selectedItemId)
725
- return;
726
- const existingContentIds = new Set();
727
- snapshot.pages?.forEach((page) => {
728
- page.contents?.forEach((content) => {
729
- if (content?.id)
730
- existingContentIds.add(content.id);
731
- });
732
- });
733
- if (existingContentIds.has(selectedItemId))
734
- return;
735
- // The previously-selected content was undone away. Restore the
736
- // Content tab's natural landing state — the same shape produced
737
- // when the user clicks the Content tab fresh — instead of leaving
738
- // the sidebar stuck rendering `<FocusedContentItemSettings>` for
739
- // a missing item, which paints a blank panel.
740
- //
741
- // `resetMode()` pops the modeStack back to the base `edit` entry
742
- // (the default landing mode); clearing `selectedItemId` releases
743
- // the pointer to the now-deleted item.
744
- sideBarStore.setSelectedTabName({
745
- tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
746
- });
747
- contentSettingsStore.resetMode();
748
- contentSettingsStore.selectedItemId = null;
749
- contentSettingsStore.selectedItemFieldName = null;
750
- contentSettingsStore.selectedItemIndex = null;
751
- contentSettingsStore.selectedItemValue = null;
752
450
  },
753
451
  export() {
754
452
  const data = this.brandPageData;
@@ -10,7 +10,6 @@ export interface LogoDraftAsset {
10
10
  tick: number;
11
11
  isByo: boolean;
12
12
  logoEditUrl?: string;
13
- templateAsset?: LogoTemplateAsset;
14
13
  }
15
14
  export interface LogoStoreState {
16
15
  logoTemplateAsset?: LogoTemplateAsset;
@@ -19,7 +19,6 @@ export const useBrandPageMakerUserStore = defineStore('brandPageMakerUser', {
19
19
  canUseGettyVideos: false,
20
20
  canUseGoogleAdsense: false,
21
21
  googleAdsenseEnabled: false,
22
- canUseUndoRedo: false,
23
22
  },
24
23
  emailAddress: '',
25
24
  hasPremiumSubscription: false,