@designcrowd/library.brand-page 6.0.6-tracker-1 → 6.0.6-undo-3

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 (93) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-DD0OBnij.js → CreatedOnBrandCrowd-de-de-x7BcD7Sj.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DysrpsmM.js → CreatedOnBrandCrowd-en-us-CG-ThD_q.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-B6twGr9h.js → CreatedOnBrandCrowd-es-es-aab4_Re2.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-yxl0ih_4.js → CreatedOnBrandCrowd-fr-ca-Drl8X5uh.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-yxl0ih_4.js → CreatedOnBrandCrowd-fr-fr-Drl8X5uh.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-BtXDrIcx.js → CreatedOnBrandCrowd-pt-br-8Ib7T70i.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-BtXDrIcx.js → CreatedOnBrandCrowd-pt-pt-8Ib7T70i.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-ho_ROy1L.js → CreatedOnDcom-de-de-FJtydzc5.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-C91p9kls.js → CreatedOnDcom-en-us-BMiXru6P.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-B3FYmObE.js → CreatedOnDcom-es-es-B8Srdnku.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-D40m7fPx.js → CreatedOnDcom-fr-ca-tcXGiBNt.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-Cd57oYyc.js → CreatedOnDcom-fr-fr-nE1cuUEU.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-Du57mWxG.js → CreatedOnDcom-pt-br-DxCCXCg8.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-fYoPZWwr.js → CreatedOnDcom-pt-pt-Csabip9G.js} +1 -1
  15. package/lib/src/brand-page/utils/logo.util.d.ts +14 -0
  16. package/lib/src/brand-page/utils/logo.util.js +19 -0
  17. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -1
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -2
  19. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +1 -1
  20. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
  21. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +3 -3
  22. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -1
  23. package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +1 -1
  24. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +2 -2
  25. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
  26. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
  27. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -1
  28. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +25 -4
  29. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +6 -7
  30. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +7 -12
  31. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +1 -1
  32. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +12 -7
  33. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +7 -1
  34. package/lib/src/brand-page-maker/stores/history/history-store.js +11 -1
  35. package/lib/src/index.mjs +83 -84
  36. package/lib/src/{lib-lMNy66QO.js → lib-C_UlYMJy.js} +32835 -32458
  37. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +13 -0
  38. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +49 -0
  39. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +5 -0
  40. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.js +29 -0
  41. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +3 -3
  42. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -2
  43. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +1 -1
  44. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +2 -2
  45. package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +5 -0
  46. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +1 -1
  47. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +0 -67
  48. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +4 -6
  49. package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +5 -0
  50. package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +5 -0
  51. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.d.ts +2 -0
  52. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +19 -0
  53. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1 -0
  54. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +18 -7
  55. package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +5 -0
  56. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +5 -0
  57. package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +5 -0
  58. package/lib/src/shared/content-settings/models.d.ts +11 -0
  59. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +1 -1
  60. package/lib/src/shared/content-settings/store/content-settings-store.js +15 -1
  61. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
  62. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -2
  63. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -2
  64. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
  65. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -1
  66. package/package.json +1 -16
  67. package/src/brand-page/utils/logo.util.test.ts +54 -1
  68. package/src/brand-page/utils/logo.util.ts +23 -0
  69. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +1 -1
  70. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +26 -5
  71. package/src/brand-page-maker/composables/useUndoRedoFlag.ts +7 -13
  72. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +53 -0
  73. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +13 -16
  74. package/src/brand-page-maker/stores/history/history-store.test.ts +51 -0
  75. package/src/brand-page-maker/stores/history/history-store.ts +19 -0
  76. package/src/metadata-builder/builders/reorder-pages-builder.ts +80 -0
  77. package/src/shared/content-settings/components/GenericTextInput.mixin.test.ts +119 -0
  78. package/src/shared/content-settings/components/GenericTextInput.mixin.ts +34 -0
  79. package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +10 -5
  80. package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +4 -7
  81. package/src/shared/content-settings/components/text-field/TextField.vue +2 -1
  82. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.test.ts +149 -0
  83. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +26 -0
  84. package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +19 -11
  85. package/src/shared/content-settings/components/textarea-field/TextareaField.vue +2 -1
  86. package/src/shared/content-settings/models.ts +11 -0
  87. package/src/shared/content-settings/store/content-settings-store.test.ts +110 -0
  88. package/src/shared/content-settings/store/content-settings-store.ts +17 -0
  89. package/lib/src/tracker.d.ts +0 -2
  90. package/lib/src/tracker.js +0 -12
  91. package/lib/src/tracker.mjs +0 -12
  92. package/lib/src/useEventTracker-DmQ6AkNn.js +0 -356
  93. package/src/tracker.ts +0 -28
@@ -0,0 +1,13 @@
1
+ import type { BrandPageModel } from '../../brand-page/models';
2
+ import { BaseMetadataBuilder, type BuilderResult, type MetadataBuilderRequest } from '../models';
3
+ import type { Logger } from '../logger';
4
+ export interface ReorderPagesPayload {
5
+ pageOrder: string[];
6
+ }
7
+ export declare class ReorderPagesBuilder extends BaseMetadataBuilder<ReorderPagesPayload> {
8
+ constructor(request: MetadataBuilderRequest<ReorderPagesPayload>, logger?: Logger);
9
+ validateAsync(): Promise<{
10
+ errors: string[];
11
+ }>;
12
+ buildAsync(model: BrandPageModel): Promise<BuilderResult>;
13
+ }
@@ -0,0 +1,49 @@
1
+ import { BaseMetadataBuilder, } from '../models';
2
+ export class ReorderPagesBuilder extends BaseMetadataBuilder {
3
+ constructor(request, logger) {
4
+ super(request, logger);
5
+ }
6
+ async validateAsync() {
7
+ const errors = [];
8
+ const payload = this.request.payload;
9
+ if (!payload?.pageOrder?.length) {
10
+ errors.push('page_order is required for reorder_pages');
11
+ }
12
+ return { errors };
13
+ }
14
+ async buildAsync(model) {
15
+ this.log('Build called');
16
+ const validation = await this.validateAsync();
17
+ if (validation.errors.length) {
18
+ return { request: this.request, model, errors: validation.errors };
19
+ }
20
+ const { pageOrder } = this.request.payload;
21
+ // Build pageId → routeId lookup from nav.routes
22
+ const pageIdToRouteId = new Map();
23
+ for (const route of model.nav.routes) {
24
+ pageIdToRouteId.set(route.pageId, route.id);
25
+ }
26
+ // Build new nav.orders from the flat page_order (array of pageIds)
27
+ const newOrders = [];
28
+ const seenRouteIds = new Set();
29
+ for (const pageId of pageOrder) {
30
+ const routeId = pageIdToRouteId.get(pageId);
31
+ if (!routeId)
32
+ continue;
33
+ newOrders.push({ routeId, subRoutes: [] });
34
+ seenRouteIds.add(routeId);
35
+ }
36
+ // Safety: append any routes not mentioned (don't lose pages)
37
+ for (const route of model.nav.routes) {
38
+ const routeId = pageIdToRouteId.get(route.pageId);
39
+ if (routeId && !seenRouteIds.has(routeId)) {
40
+ newOrders.push({ routeId, subRoutes: [] });
41
+ }
42
+ }
43
+ model.nav.orders = newOrders;
44
+ this.log({
45
+ message: `Reordered pages: ${pageOrder.join(', ')}`,
46
+ });
47
+ return { request: this.request, model };
48
+ }
49
+ }
@@ -84,6 +84,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
84
84
  isDirty: boolean;
85
85
  emitChangeDebounce: DebounceHandle | undefined;
86
86
  lengthError: boolean;
87
+ burstIsHydration: boolean | undefined;
88
+ pendingWriteIsHydration: boolean;
87
89
  }, {
88
90
  errorMessage(): string | undefined;
89
91
  isErrorVisible(): boolean;
@@ -96,6 +98,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
96
98
  }, {
97
99
  onFocus(): void;
98
100
  onBlur(): void;
101
+ onRteModelValue(newVal: string, meta?: {
102
+ isHydration?: boolean;
103
+ }): void;
99
104
  emitChange(): void;
100
105
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-toggle-state-change")[], "update:modelValue" | "on-toggle-state-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
101
106
  attrs: {
@@ -99,6 +99,13 @@ export default defineComponent({
99
99
  isDirty: false,
100
100
  emitChangeDebounce: undefined,
101
101
  lengthError: false,
102
+ // Whether every write in the current debounce burst was an RTE
103
+ // hydration write-back (see UpdateItemValuePayload.isHydrationWrite).
104
+ // undefined = no burst pending; any user write downgrades it to false.
105
+ burstIsHydration: undefined,
106
+ // One-shot channel from onRteModelValue into the `text` setter for
107
+ // the write currently being applied.
108
+ pendingWriteIsHydration: false,
102
109
  };
103
110
  },
104
111
  computed: {
@@ -128,6 +135,13 @@ export default defineComponent({
128
135
  return unescapeContentText(this.value);
129
136
  },
130
137
  set(newVal) {
138
+ // A burst is hydration only if EVERY write in it is hydration —
139
+ // one real keystroke downgrades the whole burst to a user edit
140
+ // (the canonicalisation then rides inside that legitimate entry).
141
+ const writeIsHydration = this.pendingWriteIsHydration;
142
+ this.pendingWriteIsHydration = false;
143
+ this.burstIsHydration =
144
+ this.burstIsHydration !== false && writeIsHydration;
131
145
  if (newVal === false) {
132
146
  this._value = false;
133
147
  }
@@ -162,11 +176,15 @@ export default defineComponent({
162
176
  this._oldValue = this._value || '';
163
177
  this._value = false;
164
178
  }
179
+ // Toggling is a user action — downgrade any pending hydration burst
180
+ // so this emit commits as a normal entry.
181
+ this.burstIsHydration = false;
165
182
  this.emitChange();
166
183
  },
167
184
  showRichTextEditor(newVal) {
168
185
  if (!newVal && this._value && typeof this._value === 'string') {
169
186
  this._value = encodeContentText(this._value);
187
+ this.burstIsHydration = false;
170
188
  this.emitChange();
171
189
  }
172
190
  },
@@ -186,11 +204,22 @@ export default defineComponent({
186
204
  onBlur() {
187
205
  this.isDirty = false;
188
206
  },
207
+ // RTE branch handler: receives the hydration meta the RichTextEditor
208
+ // attaches to its update:modelValue emits (a plain v-model binding
209
+ // would drop the second argument), records it for the `text` setter,
210
+ // then applies the write.
211
+ onRteModelValue(newVal, meta) {
212
+ this.pendingWriteIsHydration = meta?.isHydration === true;
213
+ this.text = newVal;
214
+ },
189
215
  emitChange() {
216
+ const isHydrationWrite = this.burstIsHydration === true;
217
+ this.burstIsHydration = undefined;
190
218
  this.$emit('update:modelValue', {
191
219
  id: this.id,
192
220
  name: this.name,
193
221
  value: this._value,
222
+ ...(isHydrationWrite ? { isHydrationWrite: true } : {}),
194
223
  });
195
224
  },
196
225
  },
@@ -147,7 +147,7 @@ declare const _default: import("vue").DefineComponent<{}, {
147
147
  content: TContent;
148
148
  }>(payload: P): Promise<void>;
149
149
  _captureTemplateSwitchIfEnabled(): void;
150
- applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string, logoEditsStr?: string): Promise<void>;
150
+ applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string, logoEditsStr?: string, selectedTemplateId?: string | false): Promise<void>;
151
151
  _syncLogoSettingsFromSnapshot(snapshot: import("@brand-page").BrandPageModel, logoEditsStr?: string): Promise<void>;
152
152
  _navigateToActivePage(activePageId?: string): void;
153
153
  _fallbackSidebarIfSelectedContentMissing(snapshot: import("@brand-page").BrandPageModel): void;
@@ -549,7 +549,7 @@ declare const _default: import("vue").DefineComponent<{}, {
549
549
  pushMode(item: import("../../store").ContentSettingsModeStackItem): void;
550
550
  resetMode(): void;
551
551
  updateItemValue(payload: import("../../models").UpdateItemValuePayload<unknown>): void;
552
- updateMultipleItemValues({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
552
+ updateMultipleItemValues({ id, name, value, isHydrationWrite, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
553
553
  updateTextStyleType({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
554
554
  updateTextStyles({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
555
555
  getTextStyles({ id, name }: {
@@ -924,7 +924,7 @@ declare const _default: import("vue").DefineComponent<{}, {
924
924
  reset: () => void;
925
925
  getCurrentSizeBytes: () => number;
926
926
  getCurrentEntryCount: () => number;
927
- }, "reset" | "undo" | "redo" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "mergeNextMutation" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;
927
+ }, "reset" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "mergeNextMutation" | "undo" | "redo" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;
928
928
  externalEditor: import("@tiptap/vue-3").Editor;
929
929
  }, {
930
930
  categoryTabs: CategoryTab[];
@@ -399,7 +399,7 @@ declare const _default: import("vue").DefineComponent<{}, {
399
399
  pushMode(item: import("../../store").ContentSettingsModeStackItem): void;
400
400
  resetMode(): void;
401
401
  updateItemValue(payload: import("../../models").UpdateItemValuePayload<unknown>): void;
402
- updateMultipleItemValues({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
402
+ updateMultipleItemValues({ id, name, value, isHydrationWrite, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
403
403
  updateTextStyleType({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
404
404
  updateTextStyles({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
405
405
  getTextStyles({ id, name }: {
@@ -676,7 +676,7 @@ declare const _default: import("vue").DefineComponent<{}, {
676
676
  content: TContent;
677
677
  }>(payload: P): Promise<void>;
678
678
  _captureTemplateSwitchIfEnabled(): void;
679
- applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string, logoEditsStr?: string): Promise<void>;
679
+ applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string, logoEditsStr?: string, selectedTemplateId?: string | false): Promise<void>;
680
680
  _syncLogoSettingsFromSnapshot(snapshot: import("@brand-page").BrandPageModel, logoEditsStr?: string): Promise<void>;
681
681
  _navigateToActivePage(activePageId?: string): void;
682
682
  _fallbackSidebarIfSelectedContentMissing(snapshot: import("@brand-page").BrandPageModel): void;
@@ -385,7 +385,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
385
385
  pushMode(item: import("../../store").ContentSettingsModeStackItem): void;
386
386
  resetMode(): void;
387
387
  updateItemValue(payload: UpdateItemValuePayload<unknown>): void;
388
- updateMultipleItemValues({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
388
+ updateMultipleItemValues({ id, name, value, isHydrationWrite, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
389
389
  updateTextStyleType({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
390
390
  updateTextStyles({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
391
391
  getTextStyles({ id, name }: {
@@ -427,7 +427,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
427
427
  pushMode(item: import("../../store").ContentSettingsModeStackItem): void;
428
428
  resetMode(): void;
429
429
  updateItemValue(payload: UpdateItemValuePayload<unknown>): void;
430
- updateMultipleItemValues({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
430
+ updateMultipleItemValues({ id, name, value, isHydrationWrite, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
431
431
  updateTextStyleType({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
432
432
  updateTextStyles({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
433
433
  getTextStyles({ id, name }: {
@@ -620,7 +620,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
620
620
  content: TContent;
621
621
  }>(payload: P): Promise<void>;
622
622
  _captureTemplateSwitchIfEnabled(): void;
623
- applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string, logoEditsStr?: string): Promise<void>;
623
+ applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string, logoEditsStr?: string, selectedTemplateId?: string | false): Promise<void>;
624
624
  _syncLogoSettingsFromSnapshot(snapshot: import("@brand-page").BrandPageModel, logoEditsStr?: string): Promise<void>;
625
625
  _navigateToActivePage(activePageId?: string): void;
626
626
  _fallbackSidebarIfSelectedContentMissing(snapshot: import("@brand-page").BrandPageModel): void;
@@ -81,6 +81,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
81
81
  isDirty: boolean;
82
82
  emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
83
83
  lengthError: boolean;
84
+ burstIsHydration: boolean | undefined;
85
+ pendingWriteIsHydration: boolean;
84
86
  }, {
85
87
  errorMessage(): string | undefined;
86
88
  isErrorVisible(): boolean;
@@ -93,6 +95,9 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
93
95
  }, {
94
96
  onFocus(): void;
95
97
  onBlur(): void;
98
+ onRteModelValue(newVal: string, meta?: {
99
+ isHydration?: boolean;
100
+ }): void;
96
101
  emitChange(): void;
97
102
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-toggle-state-change")[], "update:modelValue" | "on-toggle-state-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
98
103
  attrs: {
@@ -378,7 +378,7 @@ declare const _default: import("vue").DefineComponent<{}, {
378
378
  pushMode(item: import("../../store").ContentSettingsModeStackItem): void;
379
379
  resetMode(): void;
380
380
  updateItemValue(payload: UpdateItemValuePayload<unknown>): void;
381
- updateMultipleItemValues({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
381
+ updateMultipleItemValues({ id, name, value, isHydrationWrite, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
382
382
  updateTextStyleType({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
383
383
  updateTextStyles({ id, name, value, }: import("../../models").UpdateMultipleItemValuesPayload<any>): void;
384
384
  getTextStyles({ id, name }: {
@@ -483,73 +483,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
483
483
  collapseAllSections(): void;
484
484
  setPreviousSelectedDisplayStyle(viewport: string, displayStyle: string): void;
485
485
  }>;
486
- historyStore: import("pinia").Store<"history", Pick<{
487
- entries: import("vue").ShallowRef<import("@brand-page-maker/stores/history/history-store").HistoryEntry[], import("@brand-page-maker/stores/history/history-store").HistoryEntry[]>;
488
- currentIndex: import("vue").Ref<number, number>;
489
- isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
490
- snapshotAppliedToken: import("vue").Ref<number, number>;
491
- baselineCaptured: import("vue").Ref<boolean, boolean>;
492
- canUndo: import("vue").ComputedRef<boolean>;
493
- canRedo: import("vue").ComputedRef<boolean>;
494
- captureBaseline: () => void;
495
- capture: (args: {
496
- source: import("@brand-page-maker/stores/history/history-store").HistoryEntry["source"];
497
- actor: import("@brand-page-maker/stores/history/history-store").HistoryEntry["actor"];
498
- label?: string;
499
- }) => "committed" | "oversized" | "noop" | "skipped";
500
- captureTemplateSwitch: (label?: string) => "committed" | "oversized" | "noop" | "skipped";
501
- captureAiChangeset: (label?: string) => "committed" | "oversized" | "noop" | "skipped";
502
- mergeNextMutation: () => void;
503
- undo: () => Promise<void>;
504
- redo: () => Promise<void>;
505
- reset: () => void;
506
- getCurrentSizeBytes: () => number;
507
- getCurrentEntryCount: () => number;
508
- }, "entries" | "currentIndex" | "isApplyingSnapshot" | "snapshotAppliedToken" | "baselineCaptured">, Pick<{
509
- entries: import("vue").ShallowRef<import("@brand-page-maker/stores/history/history-store").HistoryEntry[], import("@brand-page-maker/stores/history/history-store").HistoryEntry[]>;
510
- currentIndex: import("vue").Ref<number, number>;
511
- isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
512
- snapshotAppliedToken: import("vue").Ref<number, number>;
513
- baselineCaptured: import("vue").Ref<boolean, boolean>;
514
- canUndo: import("vue").ComputedRef<boolean>;
515
- canRedo: import("vue").ComputedRef<boolean>;
516
- captureBaseline: () => void;
517
- capture: (args: {
518
- source: import("@brand-page-maker/stores/history/history-store").HistoryEntry["source"];
519
- actor: import("@brand-page-maker/stores/history/history-store").HistoryEntry["actor"];
520
- label?: string;
521
- }) => "committed" | "oversized" | "noop" | "skipped";
522
- captureTemplateSwitch: (label?: string) => "committed" | "oversized" | "noop" | "skipped";
523
- captureAiChangeset: (label?: string) => "committed" | "oversized" | "noop" | "skipped";
524
- mergeNextMutation: () => void;
525
- undo: () => Promise<void>;
526
- redo: () => Promise<void>;
527
- reset: () => void;
528
- getCurrentSizeBytes: () => number;
529
- getCurrentEntryCount: () => number;
530
- }, "canUndo" | "canRedo">, Pick<{
531
- entries: import("vue").ShallowRef<import("@brand-page-maker/stores/history/history-store").HistoryEntry[], import("@brand-page-maker/stores/history/history-store").HistoryEntry[]>;
532
- currentIndex: import("vue").Ref<number, number>;
533
- isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
534
- snapshotAppliedToken: import("vue").Ref<number, number>;
535
- baselineCaptured: import("vue").Ref<boolean, boolean>;
536
- canUndo: import("vue").ComputedRef<boolean>;
537
- canRedo: import("vue").ComputedRef<boolean>;
538
- captureBaseline: () => void;
539
- capture: (args: {
540
- source: import("@brand-page-maker/stores/history/history-store").HistoryEntry["source"];
541
- actor: import("@brand-page-maker/stores/history/history-store").HistoryEntry["actor"];
542
- label?: string;
543
- }) => "committed" | "oversized" | "noop" | "skipped";
544
- captureTemplateSwitch: (label?: string) => "committed" | "oversized" | "noop" | "skipped";
545
- captureAiChangeset: (label?: string) => "committed" | "oversized" | "noop" | "skipped";
546
- mergeNextMutation: () => void;
547
- undo: () => Promise<void>;
548
- redo: () => Promise<void>;
549
- reset: () => void;
550
- getCurrentSizeBytes: () => number;
551
- getCurrentEntryCount: () => number;
552
- }, "reset" | "undo" | "redo" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "mergeNextMutation" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;
553
486
  }, {
554
487
  selectedPaymentConfig: BrandPagePaymentConfig | undefined;
555
488
  isCurrencyUpdating: boolean;
@@ -4,7 +4,6 @@ import { useShopConfigStore } from '@shared/ecommerce-settings/store/shop-settin
4
4
  import { paymentConfigTr } from '@src/composables/useTranslate';
5
5
  import brandPageClient from '../../../../clients/brand-page-client';
6
6
  import { useUiPageSettingsStore } from '@shared/page-settings/store';
7
- import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
8
7
  export default defineComponent({
9
8
  props: {
10
9
  id: {
@@ -30,7 +29,6 @@ export default defineComponent({
30
29
  const uiPageSettingsStore = useUiPageSettingsStore();
31
30
  const eventManagerStore = useEventManagerStore();
32
31
  const shopConfigStore = useShopConfigStore();
33
- const historyStore = useHistoryStore();
34
32
  return {
35
33
  brandPageToken: computed(() => brandPageContainerStore.brandPageToken),
36
34
  isPaymentConfigSetupVisible: computed(() => !brandPageContainerStore.isPrePurchase),
@@ -38,7 +36,6 @@ export default defineComponent({
38
36
  eventManagerStore,
39
37
  shopConfigStore,
40
38
  uiPageSettingsStore,
41
- historyStore,
42
39
  };
43
40
  },
44
41
  emits: ['update:modelValue'],
@@ -97,14 +94,15 @@ export default defineComponent({
97
94
  ...this.value,
98
95
  paymentConfig: this.shopConfigStore.paymentConfig,
99
96
  };
97
+ // Lazy paymentConfig hydration — a hydration write, not a user edit.
98
+ // The flag makes the content-settings store fold it into the current
99
+ // undo head at write time (see UpdateItemValuePayload.isHydrationWrite).
100
100
  const payload = {
101
101
  id: this.id,
102
102
  name: this.name,
103
103
  value,
104
+ isHydrationWrite: true,
104
105
  };
105
- // Lazy paymentConfig hydration — fold into current head instead
106
- // of pushing a phantom entry.
107
- this.historyStore.mergeNextMutation();
108
106
  this.$emit('update:modelValue', payload);
109
107
  }
110
108
  },
@@ -81,6 +81,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
81
81
  isDirty: boolean;
82
82
  emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
83
83
  lengthError: boolean;
84
+ burstIsHydration: boolean | undefined;
85
+ pendingWriteIsHydration: boolean;
84
86
  }, {
85
87
  errorMessage(): string | undefined;
86
88
  isErrorVisible(): boolean;
@@ -93,6 +95,9 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
93
95
  }, {
94
96
  onFocus(): void;
95
97
  onBlur(): void;
98
+ onRteModelValue(newVal: string, meta?: {
99
+ isHydration?: boolean;
100
+ }): void;
96
101
  emitChange(): void;
97
102
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-toggle-state-change")[], "update:modelValue" | "on-toggle-state-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
98
103
  attrs: {
@@ -81,6 +81,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
81
81
  isDirty: boolean;
82
82
  emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
83
83
  lengthError: boolean;
84
+ burstIsHydration: boolean | undefined;
85
+ pendingWriteIsHydration: boolean;
84
86
  }, {
85
87
  errorMessage(): string | undefined;
86
88
  isErrorVisible(): boolean;
@@ -93,6 +95,9 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
93
95
  }, {
94
96
  onFocus(): void;
95
97
  onBlur(): void;
98
+ onRteModelValue(newVal: string, meta?: {
99
+ isHydration?: boolean;
100
+ }): void;
96
101
  emitChange(): void;
97
102
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-toggle-state-change")[], "update:modelValue" | "on-toggle-state-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
98
103
  attrs: {
@@ -53,6 +53,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
53
53
  textEmptyErrorMessage: any;
54
54
  textMaxLengthErrorMessage: any;
55
55
  isInternalWatchEnabled: boolean;
56
+ burstIsHydration: boolean | undefined;
56
57
  }, {}, {
57
58
  onDelete(index: number): void;
58
59
  onAddNewItem(): void;
@@ -64,6 +65,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
64
65
  id: string;
65
66
  name: string;
66
67
  value: string;
68
+ isHydrationWrite?: boolean;
67
69
  }, index: number): void;
68
70
  setTextStyleOption(payload: {
69
71
  id: string;
@@ -66,6 +66,11 @@ export default defineComponent({
66
66
  textEmptyErrorMessage: TEXT_EMPTY(),
67
67
  textMaxLengthErrorMessage: MAX_LENGTH_ERROR_MESSAGE(),
68
68
  isInternalWatchEnabled: true,
69
+ // Second burst layer on top of GenericTextInput's (this field re-wraps
70
+ // per-item TextareaField payloads into one textItems array payload
71
+ // behind its own debounce). Hydration only if EVERY write in the burst
72
+ // was hydration; any user action downgrades it. undefined = no burst.
73
+ burstIsHydration: undefined,
69
74
  }),
70
75
  async created() {
71
76
  this.options = cloneDeep(this.value);
@@ -77,6 +82,8 @@ export default defineComponent({
77
82
  methods: {
78
83
  onDelete(index) {
79
84
  this.options = this.options.filter((_o, i) => i !== index);
85
+ // Deleting is a user action — downgrade any pending hydration burst.
86
+ this.burstIsHydration = false;
80
87
  if (this.changeDebounce) {
81
88
  this.changeDebounce();
82
89
  }
@@ -86,6 +93,7 @@ export default defineComponent({
86
93
  this.addOption();
87
94
  },
88
95
  addOption() {
96
+ this.burstIsHydration = false;
89
97
  this.options.push({
90
98
  text: '',
91
99
  textStyle: {
@@ -107,14 +115,19 @@ export default defineComponent({
107
115
  return decodeHtmlEntities(text);
108
116
  },
109
117
  emitChange() {
118
+ const isHydrationWrite = this.burstIsHydration === true;
119
+ this.burstIsHydration = undefined;
110
120
  const payload = {
111
121
  id: this.id,
112
122
  name: this.name,
113
123
  value: this.options,
124
+ ...(isHydrationWrite ? { isHydrationWrite: true } : {}),
114
125
  };
115
126
  this.$emit('update:model-value', payload);
116
127
  },
117
128
  onItemsChange(items) {
129
+ // Reordering is a user action — downgrade any pending hydration burst.
130
+ this.burstIsHydration = false;
118
131
  const payload = {
119
132
  id: this.id,
120
133
  name: this.name,
@@ -128,11 +141,17 @@ export default defineComponent({
128
141
  this.$emit('update:model-value', payload);
129
142
  },
130
143
  onTextAreaTextChange(payload, index) {
144
+ // Carry the hydration flag from the per-item TextareaField burst into
145
+ // this field's own burst (AND rule — one user write downgrades it).
146
+ this.burstIsHydration =
147
+ this.burstIsHydration !== false && payload.isHydrationWrite === true;
131
148
  this.options[index].text = payload.value;
132
149
  this.isModified[index] = true;
133
150
  },
134
151
  setTextStyleOption(payload, index) {
135
152
  this.options[index].textStyle = payload.value;
153
+ // Style edits are user actions — downgrade any pending hydration burst.
154
+ this.burstIsHydration = false;
136
155
  this.emitChange();
137
156
  },
138
157
  onBlurOverride(value, index) {
@@ -383,6 +383,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
383
383
  onLetterSpacingChange(spacing: string): void;
384
384
  onLineHeightChange(lineHeight: string): void;
385
385
  generateFontFamilySelectorKey(): string;
386
+ syncTextStyleTypeSelection(): void;
386
387
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
387
388
  id: {
388
389
  type: StringConstructor;
@@ -124,13 +124,7 @@ export default defineComponent({
124
124
  this.debounceOnTextSizeChange = debounce(this.onTextSizeChange, TEXT_SIZE_CHANGE_DEBOUNCE_WAIT_IN_MS);
125
125
  this.debounceOnLetterSpacingChange = debounce(this.onLetterSpacingChange, TEXT_SIZE_CHANGE_DEBOUNCE_WAIT_IN_MS);
126
126
  this.debounceOnLineHeightChange = debounce(this.onLineHeightChange, TEXT_SIZE_CHANGE_DEBOUNCE_WAIT_IN_MS);
127
- const value = this.value;
128
- if (value.textStyleType) {
129
- const textStyleTypeOption = this.textStyleTypeOptions.find((x) => x.value === value.textStyleType);
130
- if (textStyleTypeOption) {
131
- textStyleTypeOption.isSelected = true;
132
- }
133
- }
127
+ this.syncTextStyleTypeSelection();
134
128
  },
135
129
  computed: {
136
130
  selectedTextStyle() {
@@ -320,9 +314,26 @@ export default defineComponent({
320
314
  generateFontFamilySelectorKey() {
321
315
  return `fontFamilySelector-${this.id}-${Date.now()}`;
322
316
  },
317
+ // Re-derive the text-style-type selection from the current `value`.
318
+ // Seeded in created() and re-run whenever `value` changes (e.g. undo/redo
319
+ // restores the model) so the dropdown title and `selectedTextStyle`
320
+ // reflect the model rather than a stale local flag. (BP-5811 / BP-5817)
321
+ syncTextStyleTypeSelection() {
322
+ const value = this.value;
323
+ this.textStyleTypeOptions.forEach((option) => {
324
+ // The leading Boolean(...) guard is deliberate — do NOT simplify to
325
+ // `option.value === value?.textStyleType`. The "none" option's value
326
+ // is `undefined`, so that form would SELECT it whenever no style is
327
+ // set, whereas the convention (see emitChange) is all-flags-false
328
+ // when there is no textStyleType.
329
+ option.isSelected =
330
+ Boolean(value?.textStyleType) && option.value === value.textStyleType;
331
+ });
332
+ },
323
333
  },
324
334
  watch: {
325
335
  value() {
336
+ this.syncTextStyleTypeSelection();
326
337
  this.$nextTick(() => {
327
338
  this.fontFamilySelectorKey = this.generateFontFamilySelectorKey();
328
339
  });
@@ -95,6 +95,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
95
95
  isDirty: boolean;
96
96
  emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
97
97
  lengthError: boolean;
98
+ burstIsHydration: boolean | undefined;
99
+ pendingWriteIsHydration: boolean;
98
100
  }, {
99
101
  errorMessage(): string | undefined;
100
102
  isErrorVisible(): boolean;
@@ -107,6 +109,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
107
109
  }, {
108
110
  onFocus(): void;
109
111
  onBlur(): void;
112
+ onRteModelValue(newVal: string, meta?: {
113
+ isHydration?: boolean;
114
+ }): void;
110
115
  emitChange(): void;
111
116
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-toggle-state-change")[], "update:modelValue" | "on-toggle-state-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
112
117
  attrs: {
@@ -88,6 +88,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
88
88
  isDirty: boolean;
89
89
  emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
90
90
  lengthError: boolean;
91
+ burstIsHydration: boolean | undefined;
92
+ pendingWriteIsHydration: boolean;
91
93
  }, {
92
94
  errorMessage(): string | undefined;
93
95
  isErrorVisible(): boolean;
@@ -100,6 +102,9 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
100
102
  }, {
101
103
  onFocus(): void;
102
104
  onBlur(): void;
105
+ onRteModelValue(newVal: string, meta?: {
106
+ isHydration?: boolean;
107
+ }): void;
103
108
  emitChange(): void;
104
109
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-toggle-state-change")[], "update:modelValue" | "on-toggle-state-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
105
110
  attrs: {
@@ -84,6 +84,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
84
84
  isDirty: boolean;
85
85
  emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
86
86
  lengthError: boolean;
87
+ burstIsHydration: boolean | undefined;
88
+ pendingWriteIsHydration: boolean;
87
89
  }, {
88
90
  errorMessage(): string | undefined;
89
91
  isErrorVisible(): boolean;
@@ -96,6 +98,9 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
96
98
  }, {
97
99
  onFocus(): void;
98
100
  onBlur(): void;
101
+ onRteModelValue(newVal: string, meta?: {
102
+ isHydration?: boolean;
103
+ }): void;
99
104
  emitChange(): void;
100
105
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "on-toggle-state-change")[], "update:modelValue" | "on-toggle-state-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
101
106
  attrs: {
@@ -88,12 +88,23 @@ export interface UpdateItemValuePayload<T> {
88
88
  name: string;
89
89
  value: T;
90
90
  multipleValues?: boolean;
91
+ /**
92
+ * Marks this write as a hydration write-back (e.g. the RTE rewriting the
93
+ * model into canonical HTML on mount) rather than a user edit. The
94
+ * content-settings store arms the undo history's merge flag synchronously
95
+ * before applying a flagged write, so it folds into the current history
96
+ * head instead of pushing a phantom entry (BP-5810). The flag travels
97
+ * with the value so it survives the debounced field → store hops.
98
+ */
99
+ isHydrationWrite?: boolean;
91
100
  }
92
101
  export interface UpdateMultipleItemValuesPayload<T extends object> {
93
102
  id: string;
94
103
  name: string;
95
104
  value: T;
96
105
  index?: number;
106
+ /** See UpdateItemValuePayload.isHydrationWrite. */
107
+ isHydrationWrite?: boolean;
97
108
  }
98
109
  export interface ValidateItemPayload {
99
110
  id: string;