@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
@@ -1,9 +1,7 @@
1
1
  {
2
- "quickLinkBar": {
3
- "myWebPageLabel": "Minha página web:",
4
- "copyButton": "Copiar",
5
- "copiedButton": "Copiado!",
6
- "undoLabel": "Desfazer",
7
- "redoLabel": "Refazer"
2
+ "quickLinkBar" : {
3
+ "myWebPageLabel" : "Minha página web:",
4
+ "copyButton" : "Copiar",
5
+ "copiedButton" : "Copiado!"
8
6
  }
9
7
  }
@@ -1,9 +1,7 @@
1
1
  {
2
- "quickLinkBar": {
3
- "myWebPageLabel": "A minha página Web:",
4
- "copyButton": "Copiar",
5
- "copiedButton": "Copiado!",
6
- "undoLabel": "Desfazer",
7
- "redoLabel": "Refazer"
2
+ "quickLinkBar" : {
3
+ "myWebPageLabel" : "A minha página Web:",
4
+ "copyButton" : "Copiar",
5
+ "copiedButton" : "Copiado!"
8
6
  }
9
7
  }
@@ -19,7 +19,7 @@
19
19
  </div>
20
20
  <Toggle
21
21
  id="save-contact-enabled"
22
- :model-value="isSavingEnabled"
22
+ :model-value="data.isToggled"
23
23
  color="primary"
24
24
  @update:model-value="onSavingEnabled()"
25
25
  />
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  <div class="tw-flex-none tw-mt-4">
29
29
  <div
30
- v-if="!isAdmin && !isPrePurchase && isSavingEnabled"
30
+ v-if="!isAdmin && !isPrePurchase && data.isToggled"
31
31
  class="tw-flex tw-items-center tw-justify-between tw-cursor-pointer tw-gap-1"
32
32
  @click="onHideBranding"
33
33
  >
@@ -62,7 +62,7 @@
62
62
  </div>
63
63
  <Toggle
64
64
  id="show-preview-cookie-banner"
65
- :model-value="hideBranding"
65
+ :model-value="data.hideBranding"
66
66
  color="primary"
67
67
  @update:model-value="onHideBranding()"
68
68
  />
@@ -78,7 +78,7 @@ import {
78
78
  useBrandPageContainerStore,
79
79
  } from '@brand-page-maker/stores';
80
80
  import { saveContactSettingsTr } from '@src/composables/useTranslate';
81
- import { computed } from 'vue';
81
+ import { computed, reactive } from 'vue';
82
82
  import {
83
83
  EVENTS,
84
84
  useEventTracker,
@@ -107,6 +107,11 @@ const showBrandCrowdLogo = computed(
107
107
  () => brandPageMakerStore.showBrandCrowdLogo,
108
108
  );
109
109
 
110
+ const data = reactive({
111
+ isToggled: isSavingEnabled.value,
112
+ hideBranding: hideBranding.value,
113
+ });
114
+
110
115
  const siteName = computed((): string => {
111
116
  return props.isDesignCom ? 'Design.com' : 'BrandCrowd';
112
117
  });
@@ -122,28 +127,30 @@ const hideBrandingTooltip = computed((): string => {
122
127
  });
123
128
 
124
129
  const onSavingEnabled = () => {
125
- const next = !isSavingEnabled.value;
126
-
127
- brandPageMakerStore.setSavingEnabled({ isSavingEnabled: next });
130
+ data.isToggled = !data.isToggled;
131
+ brandPageMakerStore.setSavingEnabled({
132
+ isSavingEnabled: data.isToggled,
133
+ });
128
134
  eventTracker.sendWebsiteEvent({
129
135
  eventName: EVENTS.WEBSITE_MAKER_DIGITAL_BUSINESS_CARDS_SAVE_CONTACT_TOGGLE,
130
136
  eventProps: {
131
137
  cta_location: UPGRADE_CTA_LOCATIONS.SAVE_CONTACT_SETTINGS,
132
- toggle_value: next ? 'enabled' : 'disabled',
138
+ toggle_value: data.isToggled ? 'enabled' : 'disabled',
133
139
  },
134
140
  });
135
141
  };
136
142
 
137
143
  const onHideBranding = async () => {
138
144
  if (!showBrandCrowdLogo.value) {
139
- const next = !hideBranding.value;
140
-
141
- brandPageMakerStore.setHideBranding({ hideBranding: next });
145
+ data.hideBranding = !data.hideBranding;
146
+ brandPageMakerStore.setHideBranding({
147
+ hideBranding: data.hideBranding,
148
+ });
142
149
  eventTracker.sendWebsiteEvent({
143
150
  eventName: EVENTS.WEBSITE_MAKER_DIGITAL_BUSINESS_CARDS_HIDE_POPUP,
144
151
  eventProps: {
145
152
  cta_location: UPGRADE_CTA_LOCATIONS.SAVE_CONTACT_SETTINGS,
146
- toggle_value: next ? 'enabled' : 'disabled',
153
+ toggle_value: data.hideBranding ? 'enabled' : 'disabled',
147
154
  },
148
155
  });
149
156
  } else {
@@ -29,8 +29,6 @@ import {
29
29
  useUiStore,
30
30
  } from '../../stores';
31
31
  import { useBrandPageMakerStore } from '../../stores';
32
- import { useHistoryStore } from '../../stores/history/history-store';
33
- import { useUndoRedoFlag } from '../useUndoRedoFlag';
34
32
  import { useBrandPageMakerUserStore } from '../../stores/user/user-store';
35
33
  import { useAiMetadataBuilder } from './useAiMetadataBuilder';
36
34
  import {
@@ -57,8 +55,6 @@ export function useAiWebsiteBuilderChat(): UseAiChatResult {
57
55
  const aiThreadStore = useAiWebsiteBuilderThreadStore();
58
56
  const snapshotStore = useSnapshotStore();
59
57
  const brandPageMakerStore = useBrandPageMakerStore();
60
- const historyStore = useHistoryStore();
61
- const undoRedoEnabled = useUndoRedoFlag();
62
58
  const containerStore = useBrandPageContainerStore();
63
59
  const userStore = useBrandPageMakerUserStore();
64
60
  const uiStore = useUiStore();
@@ -445,12 +441,6 @@ export function useAiWebsiteBuilderChat(): UseAiChatResult {
445
441
 
446
442
  await nextTick();
447
443
 
448
- // One history entry per AI prompt (US-E1). `captureAiChangeset` cancels
449
- // the auto-watcher's pending flush so the apply doesn't double-capture.
450
- if (undoRedoEnabled.value) {
451
- historyStore.captureAiChangeset();
452
- }
453
-
454
444
  // Re-capture snapshot so subsequent messages reflect the updated page
455
445
  await snapshotStore.refreshSnapshotAsync();
456
446
 
@@ -47,7 +47,6 @@ import {
47
47
  backgroundColorConvertor,
48
48
  } from '@brand-page-maker/convertors';
49
49
  import { useUiContentSettingsStore } from '@shared/content-settings/store';
50
- import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
51
50
  import { AllSelection } from 'prosemirror-state';
52
51
  import { MaxLength } from './extensions/MaxLength';
53
52
  import { AutoLink } from './extensions/AutoLink';
@@ -209,12 +208,6 @@ export const useRichTextEditor = (
209
208
  isHyperlinkPopupOpen: Ref<boolean>,
210
209
  selectedLinkTypeValue: Ref<HyperlinkType>,
211
210
  ): UseRichTextEditorReturn => {
212
- const historyStore = useHistoryStore();
213
-
214
- // TipTap rehydrates and writes back canonical HTML on mount — fold
215
- // that into the current head instead of pushing a phantom entry.
216
- historyStore.mergeNextMutation();
217
-
218
211
  const editor = new Editor({
219
212
  content: model.value ?? '',
220
213
  editable: !props.readOnly,
@@ -463,16 +456,7 @@ export const useRichTextEditor = (
463
456
  watch(
464
457
  () => model.value,
465
458
  (newValue) => {
466
- // Re-seed the editor when the model has been mutated from outside
467
- // (history undo/redo, template switch, reorder). `!editor.isFocused`
468
- // distinguishes "external mutation" from "user is typing in me" — the
469
- // latter would wipe the user's cursor if we called setContent.
470
- // `updateRichTextEditor.value` is retained as an explicit override for
471
- // callers (reorder) that need to force a re-seed while focused.
472
- const isExternalMutation =
473
- updateRichTextEditor.value || !editor.isFocused;
474
-
475
- if (isExternalMutation && editor.getHTML() !== newValue) {
459
+ if (updateRichTextEditor.value && editor.getHTML() !== newValue) {
476
460
  editor.commands.setContent(newValue, false);
477
461
  updateRichTextEditor.value = false;
478
462
  //text style type is not switching when reordering
@@ -503,13 +487,6 @@ export const useRichTextEditor = (
503
487
  });
504
488
 
505
489
  editor.on('selectionUpdate', () => {
506
- // Skip while a history snapshot is being applied — `setContent` fires
507
- // selectionUpdate before the editor has fully rehydrated, which causes
508
- // toolbar buttons (alignment, letter-spacing) to flash through bogus
509
- // active states before settling. The editor emits a final selectionUpdate
510
- // after apply completes, which lands the correct values (BP-5506).
511
- if (historyStore.isApplyingSnapshot) return;
512
-
513
490
  const textStyleAttributes = editor.getAttributes('textStyle');
514
491
  const highlightAttributes = editor.getAttributes('highlight');
515
492
  const focusedAlignment = editor.getAttributes(
@@ -70,10 +70,6 @@ export const EVENTS = {
70
70
  'website_maker_digital_business_cards_hide_popup',
71
71
  WEBSITE_MAKER_GETTY_VIDEO: 'website_maker_getty_video',
72
72
  WEBSITE_MAKER_SHIPPING_TOGGLE: 'website_maker_shipping_toggle',
73
- WEBSITE_MAKER_UNDO: 'website_maker_undo',
74
- WEBSITE_MAKER_REDO: 'website_maker_redo',
75
- WEBSITE_MAKER_HISTORY_CAPPED: 'website_maker_history_capped',
76
- WEBSITE_MAKER_HISTORY_OVERSIZED: 'website_maker_history_oversized',
77
73
  };
78
74
 
79
75
  export const SELECT_LOCATIONS = {
@@ -424,31 +420,6 @@ const useEventTracker = () => {
424
420
  is_enabled: isEnabled,
425
421
  });
426
422
  },
427
- // Undo / Redo (BP-5506)
428
- sendUndoEvent: (props: {
429
- entries_count: number;
430
- actor: string | undefined;
431
- }) => {
432
- _publishEvent(EVENTS.WEBSITE_MAKER_UNDO, props);
433
- },
434
- sendRedoEvent: (props: {
435
- entries_count: number;
436
- actor: string | undefined;
437
- }) => {
438
- _publishEvent(EVENTS.WEBSITE_MAKER_REDO, props);
439
- },
440
- sendHistoryCappedEvent: (props: {
441
- entries_count: number;
442
- size_bytes: number;
443
- }) => {
444
- _publishEvent(EVENTS.WEBSITE_MAKER_HISTORY_CAPPED, props);
445
- },
446
- sendHistoryOversizedEvent: (props: {
447
- attempted_bytes: number;
448
- source: string;
449
- }) => {
450
- _publishEvent(EVENTS.WEBSITE_MAKER_HISTORY_OVERSIZED, props);
451
- },
452
423
  };
453
424
  };
454
425
 
@@ -44,13 +44,6 @@ import { useUiBackgroundSettingsStore } from '@shared/background-settings/store'
44
44
  import { useBrandPageMakerUserStore } from '../user';
45
45
  import { useBrandPageContainerStore } from '../brandpage-container';
46
46
  import { useUiTemplateSettingsStore } from '@shared/template-settings/store';
47
- import {
48
- CONTENT_SETTINGS_MODES,
49
- useUiContentSettingsStore,
50
- } from '@shared/content-settings/store';
51
- import { useUiSideBarStore } from '@shared/side-bar/store';
52
- import { useUiEditableLogoStore } from '@shared/logo-settings/store/editable-logo-store';
53
- import { SIDE_BAR_TAB_NAMES } from '@brand-page-maker/constants';
54
47
  import { PAGE_SECTIONS } from '@shared/page-settings/models';
55
48
  import { FabricRenderClient } from '../../../clients/fabric-render-client';
56
49
  import { setLocaleAsync } from '@src/composables/useTranslate';
@@ -610,331 +603,4 @@ describe('brand page maker store module', () => {
610
603
  // Assert
611
604
  expect(setDesignTemplateTokenSpy).not.toHaveBeenCalled();
612
605
  });
613
-
614
- // BP-5506 regression: applyHistorySnapshot must replace nested navigation
615
- // style refs as a whole, not deep-merge them. The previous bug was that
616
- // object-form $patch would leave keys present in the live state but absent
617
- // from the snapshot in place — e.g. switching nav button styles then
618
- // undoing would leave the new style's borderColor / borderRadius applied.
619
- test('applyHistorySnapshot replaces navigation styles wholesale (no key bleed across undo)', async () => {
620
- // Arrange — initialise the maker so `applyHistorySnapshot` has a
621
- // populated set of dependent stores to write into.
622
- const makerStore = useBrandPageMakerStore();
623
- const navigationStyleSettingsStore = useUiNavigationStyleSettingsStore();
624
-
625
- await makerStore.initialise(INITIALISE_PAYLOAD);
626
-
627
- // Build snapshot A — the "older" state we'll undo back to. Keep the
628
- // navigation simple: only borderRadius is set on selectedButtonStyle.
629
- const snapshotA = {
630
- ...makerStore.brandPageData,
631
- pageHeaderDesktop: {
632
- ...makerStore.brandPageData.pageHeaderDesktop,
633
- navigation: {
634
- ...makerStore.brandPageData.pageHeaderDesktop?.navigation,
635
- selectedButtonStyle: {
636
- borderRadius: '0px',
637
- },
638
- },
639
- },
640
- } as BrandPageModel;
641
-
642
- // Build snapshot B — the "newer" state with extra keys that the
643
- // older snapshot does NOT have. If $patch deep-merged, these would
644
- // survive an undo back to A.
645
- const snapshotB = {
646
- ...snapshotA,
647
- pageHeaderDesktop: {
648
- ...snapshotA.pageHeaderDesktop,
649
- navigation: {
650
- ...snapshotA.pageHeaderDesktop?.navigation,
651
- selectedButtonStyle: {
652
- borderRadius: '12px',
653
- borderColor: 'rgb(255, 0, 0)',
654
- borderStyle: 'dashed',
655
- borderWidth: '4px',
656
- },
657
- },
658
- },
659
- } as BrandPageModel;
660
-
661
- // Act — apply newer first (simulates the user making the edit), then
662
- // older (simulates the undo). NavigationDesktop's constructor folds
663
- // its input over a defaults object, so we read the resulting state
664
- // and assert against the keys that came from snapshotB but NOT from
665
- // snapshotA.
666
- await makerStore.applyHistorySnapshot(snapshotB);
667
- await makerStore.applyHistorySnapshot(snapshotA);
668
-
669
- // Assert — after the undo, no keys from B should bleed through onto
670
- // A's selectedButtonStyle. Specifically the values that are unique to
671
- // B (red dashed border) must not be present.
672
- const restored =
673
- navigationStyleSettingsStore.navigation[PAGE_SECTIONS.header][
674
- VIEWPORTS.desktop
675
- ];
676
- const restoredSelected = restored.selectedButtonStyle;
677
-
678
- expect(restoredSelected.borderRadius).toBe('0px');
679
- // The B-only values must not survive the undo. NavigationStyles'
680
- // constructor seeds defaults for selectedButtonStyle, so we assert
681
- // the *exact* B-only values are gone rather than a strict superset.
682
- expect(restoredSelected.borderColor).not.toBe('rgb(255, 0, 0)');
683
- expect(restoredSelected.borderStyle).not.toBe('dashed');
684
- expect(restoredSelected.borderWidth).not.toBe('4px');
685
- });
686
-
687
- // BP-5506 regression: undoing a page-add must clear the URL/active-page
688
- // back to a page that exists in the restored snapshot. The page-tabs
689
- // carousel keys "selected" off the route URL; after `setNav` removes the
690
- // added route, no nav item matches the URL slug and the highlight
691
- // disappears. `applyHistorySnapshot` accepts an `activePageId` and writes
692
- // it through `pageNavigationStore.setCurrentActivePage` so the routeStore
693
- // and `currentPage` getter realign.
694
- test('applyHistorySnapshot updates pageNavigation.activePageId when given a valid id', async () => {
695
- const makerStore = useBrandPageMakerStore();
696
- const pageNavigationStore = usePageNavigationStore();
697
-
698
- await makerStore.initialise(INITIALISE_PAYLOAD);
699
-
700
- const restoredPageId = pageNavigationStore.routes[0]?.pageId;
701
-
702
- expect(restoredPageId).toBeDefined();
703
-
704
- pageNavigationStore.activePageId = '';
705
-
706
- await makerStore.applyHistorySnapshot(
707
- makerStore.brandPageData,
708
- restoredPageId,
709
- );
710
-
711
- expect(pageNavigationStore.activePageId).toBe(restoredPageId);
712
- });
713
-
714
- test('applyHistorySnapshot falls back to first/default route when no activePageId is provided', async () => {
715
- const makerStore = useBrandPageMakerStore();
716
- const pageNavigationStore = usePageNavigationStore();
717
-
718
- await makerStore.initialise(INITIALISE_PAYLOAD);
719
-
720
- const expectedFirstId =
721
- pageNavigationStore.getFirstOrDefaultRoute()?.pageId;
722
-
723
- expect(expectedFirstId).toBeDefined();
724
-
725
- pageNavigationStore.activePageId = 'stale-page-id-not-in-nav';
726
-
727
- await makerStore.applyHistorySnapshot(makerStore.brandPageData);
728
-
729
- expect(pageNavigationStore.activePageId).toBe(expectedFirstId);
730
- });
731
-
732
- // BP-5506 follow-up: undoing a non-page-structural edit (e.g. a title
733
- // change) must NOT push a new route. The router push fires
734
- // `router.afterEach`, and BrandPageMaker.mixin's afterEach hook resets
735
- // the content-settings modeStack — which would snap the sidebar back
736
- // to the default Content tab on every undo, even when the user was
737
- // deep-editing a content item. Same-page navigation MUST be skipped.
738
- test('applyHistorySnapshot does NOT touch modeStack when active page is unchanged', async () => {
739
- const makerStore = useBrandPageMakerStore();
740
- const pageNavigationStore = usePageNavigationStore();
741
- const contentSettingsStore = useUiContentSettingsStore();
742
-
743
- await makerStore.initialise(INITIALISE_PAYLOAD);
744
-
745
- const activePageId = pageNavigationStore.routes[0]?.pageId;
746
-
747
- expect(activePageId).toBeDefined();
748
-
749
- pageNavigationStore.activePageId = activePageId!;
750
-
751
- // User is deep-editing a content item — focused mode pushed onto the stack.
752
- const realItemId = contentSettingsStore.items[0]?.id;
753
-
754
- expect(realItemId).toBeDefined();
755
-
756
- contentSettingsStore.pushMode({
757
- mode: CONTENT_SETTINGS_MODES.focusedContentItem,
758
- selectedItemId: realItemId,
759
- });
760
- contentSettingsStore.selectedItemId = realItemId;
761
-
762
- expect(contentSettingsStore.mode).toBe(
763
- CONTENT_SETTINGS_MODES.focusedContentItem,
764
- );
765
-
766
- // Apply a snapshot whose activePageId equals the current page (i.e.
767
- // a non-structural edit that didn't change pages — title edit, color
768
- // change, etc.).
769
- await makerStore.applyHistorySnapshot(
770
- makerStore.brandPageData,
771
- activePageId,
772
- );
773
-
774
- // Mode stack is preserved — no router.afterEach was triggered.
775
- expect(contentSettingsStore.mode).toBe(
776
- CONTENT_SETTINGS_MODES.focusedContentItem,
777
- );
778
- expect(contentSettingsStore.selectedItemId).toBe(realItemId);
779
- });
780
-
781
- // BP-5506 regression: when undoing a content add, the selected item
782
- // disappears. The fallback must restore the Content tab's natural
783
- // landing state (mode = edit, selectedItemId = null), not just switch
784
- // tabs — otherwise `<FocusedContentItemSettings>` keeps rendering for
785
- // a missing item and paints a blank panel.
786
- test('applyHistorySnapshot resets sidebar to default Content tab when selected item is gone', async () => {
787
- const makerStore = useBrandPageMakerStore();
788
- const contentSettingsStore = useUiContentSettingsStore();
789
- const sideBarStore = useUiSideBarStore();
790
-
791
- await makerStore.initialise(INITIALISE_PAYLOAD);
792
-
793
- // Simulate the user opening a content item's focused settings.
794
- const orphanItemId = 'orphan-content-id-not-in-snapshot';
795
-
796
- contentSettingsStore.pushMode({
797
- mode: CONTENT_SETTINGS_MODES.focusedContentItem,
798
- selectedItemId: orphanItemId,
799
- });
800
- contentSettingsStore.selectedItemId = orphanItemId;
801
- sideBarStore.setSelectedTabName({
802
- tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
803
- });
804
-
805
- // Pre-condition: panel is showing the focused content item.
806
- expect(contentSettingsStore.mode).toBe(
807
- CONTENT_SETTINGS_MODES.focusedContentItem,
808
- );
809
- expect(contentSettingsStore.selectedItemId).toBe(orphanItemId);
810
-
811
- // Snapshot does NOT contain orphanItemId — simulates undo of an add.
812
- await makerStore.applyHistorySnapshot(makerStore.brandPageData);
813
-
814
- // Post-condition: same shape as a fresh Content tab click.
815
- expect(contentSettingsStore.mode).toBe(CONTENT_SETTINGS_MODES.edit);
816
- expect(contentSettingsStore.selectedItemId).toBeNull();
817
- expect(sideBarStore.selectedTabName).toBe(
818
- SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
819
- );
820
- });
821
-
822
- // BP-5506 follow-up: applyHistorySnapshot accepts a `logoEdits` JSON
823
- // string (sidecar to brandPageData; pre-purchase logo-tab form-field
824
- // state). On undo it must wholesale-replace `editableLogoStore.logoEdits`
825
- // so the form fields reflect the pre-edit state. Wholesale replacement
826
- // matters because a previous entry's textObjects/colors must NOT leak
827
- // through (e.g. switching template A→B then undoing must NOT keep B's
828
- // textObject ids in A's restored state).
829
- test('applyHistorySnapshot restores editableLogoStore.logoEdits from sidecar', async () => {
830
- const makerStore = useBrandPageMakerStore();
831
- const editableLogoStore = useUiEditableLogoStore();
832
-
833
- await makerStore.initialise(INITIALISE_PAYLOAD);
834
-
835
- // User has typed "AcmeCo" — current logoEdits state.
836
- editableLogoStore.logoEdits.textObjects = [
837
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
838
- {
839
- id: 't1',
840
- role: 'primary-text',
841
- text: 'AcmeCo',
842
- textEnabled: true,
843
- } as any,
844
- ];
845
-
846
- // The history entry the user is undoing TO captured "Acme".
847
- const sidecar = JSON.stringify({
848
- backgroundObject: { id: 'bg', type: 'rect', role: 'background' },
849
- logoObject: {
850
- id: 'lg',
851
- type: 'group',
852
- role: 'logo',
853
- logoColors: [],
854
- logoStrokeColors: [],
855
- },
856
- textObjects: [
857
- { id: 't1', role: 'primary-text', text: 'Acme', textEnabled: true },
858
- ],
859
- });
860
-
861
- await makerStore.applyHistorySnapshot(
862
- makerStore.brandPageData,
863
- undefined,
864
- sidecar,
865
- );
866
-
867
- expect(editableLogoStore.logoEdits.textObjects).toEqual([
868
- { id: 't1', role: 'primary-text', text: 'Acme', textEnabled: true },
869
- ]);
870
- });
871
-
872
- test('applyHistorySnapshot wholesale-replaces logoEdits (no leak from prior state)', async () => {
873
- const makerStore = useBrandPageMakerStore();
874
- const editableLogoStore = useUiEditableLogoStore();
875
-
876
- await makerStore.initialise(INITIALISE_PAYLOAD);
877
-
878
- // Current state has TWO textObjects (e.g. user is on template B with a
879
- // logo + tagline).
880
- editableLogoStore.logoEdits.textObjects = [
881
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
882
- {
883
- id: 'b-1',
884
- role: 'primary-text',
885
- text: 'Brand B',
886
- textEnabled: true,
887
- } as any,
888
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
889
- { id: 'b-2', role: 'tagline', text: 'tagline', textEnabled: true } as any,
890
- ];
891
-
892
- // Undo target captured template A — only ONE textObject with a
893
- // different id. After restore, b-1 / b-2 must be gone.
894
- const sidecar = JSON.stringify({
895
- backgroundObject: { id: 'bg', type: 'rect', role: 'background' },
896
- logoObject: {
897
- id: 'lg',
898
- type: 'group',
899
- role: 'logo',
900
- logoColors: [],
901
- logoStrokeColors: [],
902
- },
903
- textObjects: [
904
- { id: 'a-1', role: 'primary-text', text: 'Brand A', textEnabled: true },
905
- ],
906
- });
907
-
908
- await makerStore.applyHistorySnapshot(
909
- makerStore.brandPageData,
910
- undefined,
911
- sidecar,
912
- );
913
-
914
- expect(editableLogoStore.logoEdits.textObjects).toHaveLength(1);
915
- expect(editableLogoStore.logoEdits.textObjects[0].id).toBe('a-1');
916
- });
917
-
918
- test('applyHistorySnapshot leaves logoEdits untouched when sidecar is undefined', async () => {
919
- const makerStore = useBrandPageMakerStore();
920
- const editableLogoStore = useUiEditableLogoStore();
921
-
922
- await makerStore.initialise(INITIALISE_PAYLOAD);
923
-
924
- editableLogoStore.logoEdits.textObjects = [
925
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
926
- {
927
- id: 't1',
928
- role: 'primary-text',
929
- text: 'Acme',
930
- textEnabled: true,
931
- } as any,
932
- ];
933
-
934
- // No third arg — pre-existing entries from before this feature shipped.
935
- await makerStore.applyHistorySnapshot(makerStore.brandPageData);
936
-
937
- // Still 'Acme' — no restore attempted.
938
- expect(editableLogoStore.logoEdits.textObjects[0].text).toBe('Acme');
939
- });
940
606
  });