@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,4 +1,4 @@
1
- import { defineComponent, ref, watch } from 'vue';
1
+ import { defineComponent, ref } from 'vue';
2
2
  import type { PropType } from 'vue';
3
3
  import type { FormField } from '@brand-page';
4
4
  import { formFieldsTr } from '@src/composables/useTranslate';
@@ -49,34 +49,18 @@ export default defineComponent({
49
49
  },
50
50
  ];
51
51
 
52
- const valueWithState = ref(
53
- props.value.map((field) => ({
54
- field,
55
- isCollapsed: true,
56
- isTypeDropdownOpen: false,
57
- })),
58
- );
59
-
60
- // Re-sync when the store-bound value changes externally (e.g. undo/redo
61
- // via history-store). Preserve per-row UI flags (isCollapsed,
62
- // isTypeDropdownOpen) by index so an undo doesn't snap rows back to
63
- // collapsed state.
64
- watch(
65
- () => props.value,
66
- (newVal) => {
67
- valueWithState.value = newVal.map((field, index) => ({
68
- field,
69
- isCollapsed: valueWithState.value[index]?.isCollapsed ?? true,
70
- isTypeDropdownOpen:
71
- valueWithState.value[index]?.isTypeDropdownOpen ?? false,
72
- }));
73
- },
74
- );
75
-
76
52
  return {
77
53
  formFieldsTr,
78
54
  typeList,
79
- valueWithState,
55
+ valueWithState: ref(
56
+ props.value.map((field) => {
57
+ return {
58
+ field: field,
59
+ isCollapsed: true,
60
+ isTypeDropdownOpen: false,
61
+ };
62
+ }),
63
+ ),
80
64
  };
81
65
  },
82
66
  methods: {
@@ -59,7 +59,7 @@
59
59
  </template>
60
60
  </ButtonGroup>
61
61
  <div
62
- v-if="selectedOption === 1 && !containerStore.isPrePurchase"
62
+ v-if="data.selectedOption === 1 && !containerStore.isPrePurchase"
63
63
  class="tw-mb-4"
64
64
  >
65
65
  <div class="tw-flex tw-items-center">
@@ -90,7 +90,7 @@
90
90
  </div>
91
91
  </div>
92
92
  <div
93
- v-if="selectedOption === 1 && containerStore.isPrePurchase"
93
+ v-if="data.selectedOption === 1 && containerStore.isPrePurchase"
94
94
  class="tw-mb-4"
95
95
  >
96
96
  <LogoVariations
@@ -99,7 +99,7 @@
99
99
  @logo-variation-selected="onEditableLogoVariationSelected"
100
100
  />
101
101
  </div>
102
- <div v-if="selectedOption === 2" class="tw-mb-4">
102
+ <div v-if="data.selectedOption === 2" class="tw-mb-4">
103
103
  <UploadLogoModal>
104
104
  <template #main="mainProp">
105
105
  <LogoField
@@ -188,100 +188,88 @@ const logoTabs: Tab[] = reactive([
188
188
  ]);
189
189
 
190
190
  const data = reactive({
191
- // Sticky override for the "Logo / Upload" choice when isLogoVisible is true.
192
- // Set when the user explicitly clicks Logo or Upload; cleared on undo/redo
193
- // so the snapshot's logoDraftAsset.isByo decides instead. `null` means
194
- // "derive from props".
195
- manualVisibleChoice: null as null | 1 | 2,
191
+ selectedOption: 1,
192
+ currentLogoIsByo: false,
196
193
  logoEditUrl: '',
197
194
  });
198
195
 
199
196
  const containerStore = useBrandPageContainerStore();
200
- const logoStore = useLogoStore();
201
- const editableLogoStore = useUiEditableLogoStore();
202
- const sideBarStore = useUiSideBarStore();
203
- const userStore = useBrandPageMakerUserStore();
204
-
205
- const currentLogoIsByo = computed(() => {
206
- const logoDraftAsset = logoStore.getLogoDraftAssetByToken(
207
- props.selectedLogoDraftToken,
208
- );
209
-
210
- return !!logoDraftAsset?.isByo;
211
- });
212
-
213
- // Highlighted button. Derived purely from props + the user's most recent
214
- // manual choice — never from event-handler-set local state. Undo/redo
215
- // restores `props` from the history snapshot, which clears the manual
216
- // override (see watcher below) so the highlight tracks whatever the
217
- // snapshot says: None when isLogoVisible is false, Upload when the
218
- // restored logo is BYO, Logo otherwise.
219
- const selectedOption = computed<0 | 1 | 2>(() => {
220
- if (!props.isLogoVisible) return 0;
221
-
222
- if (currentLogoIsByo.value) return 2;
223
-
224
- return data.manualVisibleChoice ?? 1;
225
- });
226
197
 
227
198
  const options = computed<ButtonGroupOption[]>(() => {
228
199
  const optionList = [
229
200
  {
230
201
  label: commonTr('none'),
231
202
  value: '0',
232
- isSelected: selectedOption.value === 0,
203
+ isSelected: data.selectedOption === 0,
233
204
  iconName: `ban`,
234
205
  iconSize: 'sm',
235
206
  },
236
207
  {
237
208
  label: commonTr('logo'),
238
209
  value: '1',
239
- isSelected: selectedOption.value === 1,
210
+ isSelected: data.selectedOption === 1,
240
211
  iconName: `bc-mast`,
241
212
  iconSize: 'sm',
242
213
  },
243
214
  {
244
215
  label: commonTr('upload'),
245
216
  value: '2',
246
- isSelected: selectedOption.value === 2,
217
+ isSelected: data.selectedOption === 2,
247
218
  iconName: `upload-arrow`,
248
219
  iconSize: 'sm',
249
220
  },
250
221
  ];
251
222
 
252
- if (currentLogoIsByo.value) {
223
+ if (data.currentLogoIsByo) {
253
224
  return optionList.filter((x) => x.value !== '1');
254
225
  }
255
226
 
256
227
  return optionList;
257
228
  });
258
229
 
230
+ const logoStore = useLogoStore();
231
+ const editableLogoStore = useUiEditableLogoStore();
232
+ const sideBarStore = useUiSideBarStore();
233
+ const userStore = useBrandPageMakerUserStore();
234
+
235
+ onMounted(() => updateState());
236
+
237
+ watch(
238
+ () => props.isLogoVisible,
239
+ () => updateState(),
240
+ );
241
+
242
+ watch(
243
+ () => props.selectedLogoDraftToken,
244
+ () => updateState(),
245
+ );
246
+
247
+ watch(
248
+ () => props.selectedLogo,
249
+ () => updateState(),
250
+ );
251
+
259
252
  const updateState = () => {
260
253
  const logoDraftAsset = logoStore.getLogoDraftAssetByToken(
261
254
  props.selectedLogoDraftToken,
262
255
  );
263
256
 
264
257
  data.logoEditUrl = logoDraftAsset?.logoEditUrl || '';
265
- };
266
258
 
267
- onMounted(() => updateState());
268
-
269
- // Only `selectedLogoDraftToken` clears the manual override — that's the
270
- // signal for an *external* data change (upload landed, or undo/redo
271
- // restored a different draft). `isLogoVisible` flips on the user's own
272
- // click and propagates back through props, so resetting on it would
273
- // clobber the choice the user just made (e.g. None → Upload would land
274
- // on Logo because the watcher fires before the computed re-reads).
275
- watch(
276
- () => props.selectedLogoDraftToken,
277
- () => {
278
- data.manualVisibleChoice = null;
279
- updateState();
280
- },
281
- );
259
+ if (!props.isLogoVisible) {
260
+ data.selectedOption = 0;
261
+ } else {
262
+ if (logoDraftAsset?.isByo) {
263
+ data.selectedOption = 2;
264
+ } else {
265
+ data.selectedOption = data.selectedOption || 1;
266
+ }
267
+ }
282
268
 
283
- watch(() => props.isLogoVisible, updateState);
284
- watch(() => props.selectedLogo, updateState);
269
+ if (logoDraftAsset?.isByo) {
270
+ data.currentLogoIsByo = true;
271
+ }
272
+ };
285
273
 
286
274
  const logoSettingStore = useUiLogoSettingsStore();
287
275
 
@@ -332,14 +320,9 @@ const onEditableLogoVariationSelected = (selectedLogoVariation: {
332
320
  };
333
321
 
334
322
  const onOptionSelected = (selected: ButtonGroupOption) => {
335
- const next = parseInt(selected.value);
323
+ data.selectedOption = parseInt(selected.value);
336
324
 
337
- // Capture the user's choice between Logo (1) and Upload (2) so the
338
- // highlight stays put while they interact with the visible options.
339
- // `null` for None — the visibility flip handles that.
340
- data.manualVisibleChoice = next === 1 || next === 2 ? next : null;
341
-
342
- emit('on-logo-visible-changed', next !== 0);
325
+ emit('on-logo-visible-changed', data.selectedOption !== 0);
343
326
  };
344
327
 
345
328
  const handleLogoVisibleToggle = () => {
@@ -380,6 +363,8 @@ const onLogoUpload = (response: CreateWebsiteByoUploadResult) => {
380
363
  if (response.logoDesignAttributes) {
381
364
  logoSettingStore.applyLogoDesignAttributes(response.logoDesignAttributes);
382
365
  }
366
+
367
+ data.currentLogoIsByo = true;
383
368
  };
384
369
 
385
370
  const onEditLogoButtonClicked = () => {
@@ -24,7 +24,6 @@ import { Button } from '@designcrowd/fe-shared-lib';
24
24
  import { ref, computed, onMounted } from 'vue';
25
25
  import { useUiPageSettingsStore } from '../../../page-settings/store';
26
26
  import { useBrandPageMakerUserStore } from '../../../../brand-page-maker/stores';
27
- import { useHistoryStore } from '../../../../brand-page-maker/stores/history/history-store';
28
27
  import { pageSettingTr } from '../../../../composables/useTranslate';
29
28
  import PageSelectorDropdown from '../../../page-navigation/PageSelectorDropdown.vue';
30
29
  import { usePageNavigationStore } from '../../../page-navigation/store/page-navigation-store';
@@ -51,7 +50,6 @@ const emit = defineEmits<{
51
50
  const pageNavigationStore = usePageNavigationStore();
52
51
  const pageSettingsStore = useUiPageSettingsStore();
53
52
  const userStore = useBrandPageMakerUserStore();
54
- const historyStore = useHistoryStore();
55
53
 
56
54
  const selectedPage = ref('');
57
55
 
@@ -111,8 +109,6 @@ onMounted(() => {
111
109
  if (routeByPageId) {
112
110
  selectedPage.value = routeByPageId.displayName;
113
111
  } else {
114
- // Stale page-id clear at mount — fold into current head.
115
- historyStore.mergeNextMutation();
116
112
  emit('update:modelValue', {
117
113
  id: props.id,
118
114
  name: props.name,
@@ -15,7 +15,6 @@ import { useShopConfigStore } from '@shared/ecommerce-settings/store/shop-settin
15
15
  import { paymentConfigTr } from '@src/composables/useTranslate';
16
16
  import brandPageClient from '../../../../clients/brand-page-client';
17
17
  import { useUiPageSettingsStore } from '@shared/page-settings/store';
18
- import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
19
18
 
20
19
  export default defineComponent({
21
20
  props: {
@@ -42,7 +41,6 @@ export default defineComponent({
42
41
  const uiPageSettingsStore = useUiPageSettingsStore();
43
42
  const eventManagerStore = useEventManagerStore();
44
43
  const shopConfigStore = useShopConfigStore();
45
- const historyStore = useHistoryStore();
46
44
 
47
45
  return {
48
46
  brandPageToken: computed(() => brandPageContainerStore.brandPageToken),
@@ -53,7 +51,6 @@ export default defineComponent({
53
51
  eventManagerStore,
54
52
  shopConfigStore,
55
53
  uiPageSettingsStore,
56
- historyStore,
57
54
  };
58
55
  },
59
56
  emits: ['update:modelValue'],
@@ -119,10 +116,6 @@ export default defineComponent({
119
116
  value,
120
117
  };
121
118
 
122
- // Lazy paymentConfig hydration — fold into current head instead
123
- // of pushing a phantom entry.
124
- this.historyStore.mergeNextMutation();
125
-
126
119
  this.$emit('update:modelValue', payload);
127
120
  }
128
121
  },
@@ -3,7 +3,6 @@
3
3
  <RichTextEditor
4
4
  v-if="showRichTextEditor"
5
5
  :id="`${id}-${name}`"
6
- ref="richTextEditorRef"
7
6
  v-model="text"
8
7
  :attrs="attrs"
9
8
  :label="label"
@@ -565,15 +565,10 @@ const onImageLinkToggleChange = (enabled: boolean, index: number): void => {
565
565
  emitChange();
566
566
  };
567
567
 
568
- // Flips true while we're rebuilding `options` from `props.value`. Suppresses
569
- // the deep options-watch's debounced emit so a sync from the store doesn't
570
- // echo back to the store. Reset by the deep watcher on the next tick.
571
- let isSyncingFromProps = false;
572
-
573
- const applyValueWithDefaults = (
574
- v: TextMediaItem[],
575
- ): (TextMediaItem | TextShapeItem)[] => {
576
- return cloneDeep(v).map((o) => ({
568
+ onMounted(() => {
569
+ options.value = cloneDeep(props.value);
570
+ mediaType.value = props.settings.replaceImageSettings.mediaType;
571
+ options.value = options.value.map((o) => ({
577
572
  ...o,
578
573
  mediaType: mediaType.value,
579
574
  imageLink: o.imageLink !== undefined ? o.imageLink : false,
@@ -583,39 +578,15 @@ const applyValueWithDefaults = (
583
578
  email: o.email || '',
584
579
  tel: o.tel || '',
585
580
  })) as (TextMediaItem | TextShapeItem)[];
586
- };
587
-
588
- onMounted(() => {
589
- mediaType.value = props.settings.replaceImageSettings.mediaType;
590
- isSyncingFromProps = true;
591
- options.value = applyValueWithDefaults(props.value);
592
581
 
593
582
  if (!changeDebounce.value) {
594
583
  changeDebounce.value = debounce(emitChange, DEBOUNCE_IN_MS);
595
584
  }
596
585
  });
597
586
 
598
- // Re-sync the local `options` mirror when the store-bound value changes
599
- // externally (e.g. undo/redo via history-store). Without this the sidebar
600
- // keeps showing the pre-undo state while the canvas reflects the reverted
601
- // store.
602
- watch(
603
- () => props.value,
604
- (newVal) => {
605
- isSyncingFromProps = true;
606
- options.value = applyValueWithDefaults(newVal);
607
- },
608
- );
609
-
610
587
  watch(
611
588
  options,
612
589
  () => {
613
- if (isSyncingFromProps) {
614
- isSyncingFromProps = false;
615
-
616
- return;
617
- }
618
-
619
590
  if (changeDebounce.value) {
620
591
  changeDebounce.value();
621
592
  }
@@ -83,17 +83,6 @@ export default defineComponent({
83
83
  return 'tw-font-bold tw-text-xs';
84
84
  },
85
85
  },
86
- watch: {
87
- // Keeps the design/upload tab in sync with `enableEditMode` whenever it
88
- // flips outside the user's tab clicks — undo/redo restoring a BYO upload
89
- // (mode → false) or a designed logo (mode → true). User clicks within
90
- // the same mode don't change `enableEditMode` and don't trigger this.
91
- showEditLogoSetting(enabled: boolean) {
92
- this.selectedTab = enabled
93
- ? this.tabsWithTranslations[0]
94
- : this.tabsWithTranslations[1];
95
- },
96
- },
97
86
  methods: {
98
87
  disableTextToggle(currentTextEnabled) {
99
88
  if (!this.isTextOnlyLogo || !currentTextEnabled) {
@@ -116,15 +116,11 @@ export interface EditableLogoState {
116
116
  logoTemplateMetadata: string;
117
117
  isLogoDraftSaved: boolean;
118
118
  isTextOnlyLogo: boolean;
119
- // Per-draft-token snapshot of editableLogoVariations; repopulated on
120
- // every render. Used by undo/redo to restore the BYO variations grid
121
- // without re-rendering.
122
- variationsByDraftToken: Record<string, EditableLogoVariation[]>;
123
119
  }
124
120
 
125
121
  export type SetStateAsyncPayload = Omit<
126
122
  EditableLogoState,
127
- 'enableEditMode' | 'editableLogoVariations' | 'variationsByDraftToken'
123
+ 'enableEditMode' | 'editableLogoVariations'
128
124
  >;
129
125
 
130
126
  export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
@@ -196,7 +192,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
196
192
  },
197
193
  makerFonts: [],
198
194
  isLogoDraftSaved: false,
199
- variationsByDraftToken: {},
200
195
  }),
201
196
  actions: {
202
197
  async setStateAsync(payload: {
@@ -411,19 +406,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
411
406
 
412
407
  await Promise.all(tasks);
413
408
 
414
- this.stampLogoBase64IntoBrandPageData(overrideLogoVariation);
415
-
416
- // Cache per draft token so BYO undo can restore without re-rendering.
417
- if (this.logoDraftToken) {
418
- this.variationsByDraftToken[this.logoDraftToken] =
419
- this.editableLogoVariations.map((v) => ({ ...v }));
420
- }
421
- },
422
-
423
- // Stamp editableLogoVariations[*].base64 across header/footer + every
424
- // LogoContent. Called by the live edit path post-render, and by
425
- // undo/redo to repopulate the stripped logoImageBase64Url fields.
426
- stampLogoBase64IntoBrandPageData(overrideLogoVariation?: number): void {
427
409
  const pageSettingStore = useUiPageSettingsStore();
428
410
 
429
411
  [PAGE_SECTIONS.header, PAGE_SECTIONS.footer].forEach((section) => {
@@ -462,18 +444,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
462
444
  });
463
445
  },
464
446
 
465
- // Restore variations grid for a draft token from the per-token cache.
466
- // Returns true on cache hit.
467
- restoreVariationsForDraftToken(logoDraftToken: string): boolean {
468
- const cached = this.variationsByDraftToken[logoDraftToken];
469
-
470
- if (!cached) return false;
471
-
472
- this.editableLogoVariations = cached.map((v) => ({ ...v }));
473
-
474
- return true;
475
- },
476
-
477
447
  async updateMetadataAsync(
478
448
  defaultPrimaryText?: string,
479
449
  resetLogoTemplateMetadata = false,
@@ -536,14 +506,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
536
506
 
537
507
  if (logoDraft) {
538
508
  logoDraft.metadata = metadata;
539
-
540
- // Refresh the template-asset stamp in case the active asset has
541
- // changed since this draft was first registered (e.g. successive
542
- // BYO uploads that share an existing draft token would otherwise
543
- // keep pointing at an older template).
544
- if (logoStore.logoTemplateAsset) {
545
- logoDraft.templateAsset = { ...logoStore.logoTemplateAsset };
546
- }
547
509
  } else {
548
510
  logoStore.addLogoDraftAsset({
549
511
  logoDraftAsset: {
@@ -551,9 +513,6 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
551
513
  metadata,
552
514
  tick: Date.now(),
553
515
  isByo: logoStore.logoTemplateAsset?.isByo || false,
554
- templateAsset: logoStore.logoTemplateAsset
555
- ? { ...logoStore.logoTemplateAsset }
556
- : undefined,
557
516
  },
558
517
  });
559
518
  }
@@ -1,17 +0,0 @@
1
- import { type ComputedRef } from 'vue';
2
- /**
3
- * Returns whether undo/redo is active for the current maker session. All
4
- * three conditions must hold:
5
- *
6
- * 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
7
- * the consumer (BrandCrowd.Net / web-renderer) via the
8
- * `WebsiteDesignUserFeatures.CanUseUndoRedo` boolean on the ViewModel —
9
- * same precedent as RichTextEditor / GettyVideos / AITextGenerator.
10
- * 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
11
- * only; brand-page (single-page profile) and brand-contact (vCard) are
12
- * out of scope.
13
- * 3. The session is NOT in admin-maker mode (`userStore.isAdmin`). The
14
- * admin maker uses the same components but a different editing flow
15
- * (template authoring) where undo/redo is out of scope.
16
- */
17
- export declare function useUndoRedoFlag(): ComputedRef<boolean>;
@@ -1,25 +0,0 @@
1
- import { computed } from 'vue';
2
- import { useBrandPageMakerUserStore } from '@brand-page-maker/stores/user';
3
- import { useBrandPageMakerStore } from '@brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
4
- /**
5
- * Returns whether undo/redo is active for the current maker session. All
6
- * three conditions must hold:
7
- *
8
- * 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
9
- * the consumer (BrandCrowd.Net / web-renderer) via the
10
- * `WebsiteDesignUserFeatures.CanUseUndoRedo` boolean on the ViewModel —
11
- * same precedent as RichTextEditor / GettyVideos / AITextGenerator.
12
- * 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
13
- * only; brand-page (single-page profile) and brand-contact (vCard) are
14
- * out of scope.
15
- * 3. The session is NOT in admin-maker mode (`userStore.isAdmin`). The
16
- * admin maker uses the same components but a different editing flow
17
- * (template authoring) where undo/redo is out of scope.
18
- */
19
- export function useUndoRedoFlag() {
20
- const userStore = useBrandPageMakerUserStore();
21
- const brandPageMakerStore = useBrandPageMakerStore();
22
- return computed(() => userStore.features.canUseUndoRedo &&
23
- brandPageMakerStore.isBrandSite &&
24
- !userStore.isAdmin);
25
- }
@@ -1,83 +0,0 @@
1
- /**
2
- * A single history entry. `snapshot` is JSON-stringified up-front so Pinia
3
- * treats it as opaque (no per-field reactivity) and `sizeBytes` is exact.
4
- * Sidecar state not in `brandPageData` rides along on this entry —
5
- * `activePageId` for page-tab restore, `logoEdits` for pre-purchase logo
6
- * form state.
7
- */
8
- export interface HistoryEntry {
9
- snapshot: string;
10
- timestamp: string;
11
- source: 'manual_edit' | 'template_switch' | 'ai_changeset' | 'rich_text';
12
- actor: 'user' | 'ai_builder';
13
- label?: string;
14
- sizeBytes: number;
15
- /** Active page id at capture time. Empty before first router push. */
16
- activePageId: string;
17
- /** JSON-stringified `editableLogoStore.logoEdits`. Undefined if logo tab never opened. */
18
- logoEdits?: string;
19
- }
20
- export declare const useHistoryStore: import("pinia").StoreDefinition<"history", Pick<{
21
- entries: import("vue").ShallowRef<HistoryEntry[], HistoryEntry[]>;
22
- currentIndex: import("vue").Ref<number, number>;
23
- isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
24
- baselineCaptured: import("vue").Ref<boolean, boolean>;
25
- canUndo: import("vue").ComputedRef<boolean>;
26
- canRedo: import("vue").ComputedRef<boolean>;
27
- captureBaseline: () => void;
28
- capture: (args: {
29
- source: HistoryEntry['source'];
30
- actor: HistoryEntry['actor'];
31
- label?: string;
32
- }) => 'committed' | 'oversized' | 'noop' | 'skipped';
33
- captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
34
- captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
35
- mergeNextMutation: () => void;
36
- undo: () => Promise<void>;
37
- redo: () => Promise<void>;
38
- reset: () => void;
39
- getCurrentSizeBytes: () => number;
40
- getCurrentEntryCount: () => number;
41
- }, "entries" | "currentIndex" | "isApplyingSnapshot" | "baselineCaptured">, Pick<{
42
- entries: import("vue").ShallowRef<HistoryEntry[], HistoryEntry[]>;
43
- currentIndex: import("vue").Ref<number, number>;
44
- isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
45
- baselineCaptured: import("vue").Ref<boolean, boolean>;
46
- canUndo: import("vue").ComputedRef<boolean>;
47
- canRedo: import("vue").ComputedRef<boolean>;
48
- captureBaseline: () => void;
49
- capture: (args: {
50
- source: HistoryEntry['source'];
51
- actor: HistoryEntry['actor'];
52
- label?: string;
53
- }) => 'committed' | 'oversized' | 'noop' | 'skipped';
54
- captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
55
- captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
56
- mergeNextMutation: () => void;
57
- undo: () => Promise<void>;
58
- redo: () => Promise<void>;
59
- reset: () => void;
60
- getCurrentSizeBytes: () => number;
61
- getCurrentEntryCount: () => number;
62
- }, "canUndo" | "canRedo">, Pick<{
63
- entries: import("vue").ShallowRef<HistoryEntry[], HistoryEntry[]>;
64
- currentIndex: import("vue").Ref<number, number>;
65
- isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
66
- baselineCaptured: import("vue").Ref<boolean, boolean>;
67
- canUndo: import("vue").ComputedRef<boolean>;
68
- canRedo: import("vue").ComputedRef<boolean>;
69
- captureBaseline: () => void;
70
- capture: (args: {
71
- source: HistoryEntry['source'];
72
- actor: HistoryEntry['actor'];
73
- label?: string;
74
- }) => 'committed' | 'oversized' | 'noop' | 'skipped';
75
- captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
76
- captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
77
- mergeNextMutation: () => void;
78
- undo: () => Promise<void>;
79
- redo: () => Promise<void>;
80
- reset: () => void;
81
- getCurrentSizeBytes: () => number;
82
- getCurrentEntryCount: () => number;
83
- }, "reset" | "undo" | "redo" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "mergeNextMutation" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;