@designcrowd/library.brand-page 5.18.1-undo-32 → 5.18.1-undo-34
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.
- package/lib/src/{CreatedOnBrandCrowd-de-de-DUgkmx89.js → CreatedOnBrandCrowd-de-de-D-2WhY-F.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-C5dQGLuA.js → CreatedOnBrandCrowd-en-us-B7ldKpJK.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CjPcnNlq.js → CreatedOnBrandCrowd-es-es-BatQY8Tt.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-D2wnZOOE.js → CreatedOnBrandCrowd-fr-ca-CFivOJkN.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-D2wnZOOE.js → CreatedOnBrandCrowd-fr-fr-CFivOJkN.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-OQj-IBh_.js → CreatedOnBrandCrowd-pt-br-wHkXfYLP.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-OQj-IBh_.js → CreatedOnBrandCrowd-pt-pt-wHkXfYLP.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DLijuIaL.js → CreatedOnDcom-de-de--HwniV-Y.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D9M_heGE.js → CreatedOnDcom-en-us-Bqm5NnRX.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-PgWwbBLA.js → CreatedOnDcom-es-es-COGQIuEn.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BXiB-abj.js → CreatedOnDcom-fr-ca-eVDHO7MX.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BXhTmu7F.js → CreatedOnDcom-fr-fr-BhGKbdoG.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-3e6y567w.js → CreatedOnDcom-pt-br-5kDZKPZc.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-GojOtHmO.js → CreatedOnDcom-pt-pt-CnTcVxct.js} +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +2 -11
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +15 -47
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +7 -47
- package/lib/src/brand-page-maker/stores/history/history-store.js +98 -283
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-DVs3jUit.js → lib-B5jbN-ro.js} +31 -44
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -8
- package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +2 -8
- package/lib/src/shared/content-settings/components/radio-field/RadioField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
- package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +0 -18
- package/lib/src/shared/logo-settings/store/editable-logo-store.js +6 -24
- package/package.json +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +2 -11
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +15 -47
- package/src/brand-page-maker/stores/history/history-store.test.ts +32 -0
- package/src/brand-page-maker/stores/history/history-store.ts +107 -340
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -8
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +1 -4
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +2 -8
- package/src/shared/logo-settings/store/editable-logo-store.ts +9 -29
|
@@ -84,14 +84,7 @@ export default defineComponent({
|
|
|
84
84
|
},
|
|
85
85
|
mounted() {
|
|
86
86
|
if (this.canUseRichTextEditor) {
|
|
87
|
-
//
|
|
88
|
-
// and rewraps plain-text titles/paragraphs in TipTap HTML so they
|
|
89
|
-
// render through the inline RTE. That's a hydration write — it
|
|
90
|
-
// happens whenever the Content sidebar tab mounts (incl. when the
|
|
91
|
-
// user clicks the header in the canvas) and produces no
|
|
92
|
-
// user-visible change. Arm the merge flag so the watcher folds
|
|
93
|
-
// the resulting flush into the current head entry instead of
|
|
94
|
-
// pushing a phantom undo step.
|
|
87
|
+
// RTE rewrap on tab mount — fold into current head.
|
|
95
88
|
this.historyStore.mergeNextMutation();
|
|
96
89
|
switchAllContentToRTE(
|
|
97
90
|
this.pageSettingsStore,
|
|
@@ -111,10 +111,7 @@ onMounted(() => {
|
|
|
111
111
|
if (routeByPageId) {
|
|
112
112
|
selectedPage.value = routeByPageId.displayName;
|
|
113
113
|
} else {
|
|
114
|
-
// Stale page-id
|
|
115
|
-
// prior session). Clearing the value happens at mount time, not
|
|
116
|
-
// from a user click — arm the merge flag so the watcher folds it
|
|
117
|
-
// into the current head instead of pushing a phantom undo entry.
|
|
114
|
+
// Stale page-id clear at mount — fold into current head.
|
|
118
115
|
historyStore.mergeNextMutation();
|
|
119
116
|
emit('update:modelValue', {
|
|
120
117
|
id: props.id,
|
package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts
CHANGED
|
@@ -119,14 +119,8 @@ export default defineComponent({
|
|
|
119
119
|
value,
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
// below mutates `brandPageData[*].paymentConfig` from undefined to
|
|
125
|
-
// the live `shopConfigStore.paymentConfig` — no user authoring
|
|
126
|
-
// intent. Arm the merge flag so the watcher's flush folds this
|
|
127
|
-
// into the current head instead of pushing a phantom undo entry
|
|
128
|
-
// that would, when undone, surface the "Please enable a payment
|
|
129
|
-
// provider" warning.
|
|
122
|
+
// Lazy paymentConfig hydration — fold into current head instead
|
|
123
|
+
// of pushing a phantom entry.
|
|
130
124
|
this.historyStore.mergeNextMutation();
|
|
131
125
|
|
|
132
126
|
this.$emit('update:modelValue', payload);
|
|
@@ -116,11 +116,9 @@ export interface EditableLogoState {
|
|
|
116
116
|
logoTemplateMetadata: string;
|
|
117
117
|
isLogoDraftSaved: boolean;
|
|
118
118
|
isTextOnlyLogo: boolean;
|
|
119
|
-
// Per-draft-token snapshot of
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
// the snapshot's `logoDraftToken` instead of re-rendering through fabric-
|
|
123
|
-
// render or stuffing 4 base64 PNGs into every history entry.
|
|
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.
|
|
124
122
|
variationsByDraftToken: Record<string, EditableLogoVariation[]>;
|
|
125
123
|
}
|
|
126
124
|
|
|
@@ -415,31 +413,16 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
415
413
|
|
|
416
414
|
this.stampLogoBase64IntoBrandPageData(overrideLogoVariation);
|
|
417
415
|
|
|
418
|
-
//
|
|
419
|
-
// token so undo can restore it later without re-rendering. This is
|
|
420
|
-
// the only place in production that meaningfully populates
|
|
421
|
-
// `editableLogoVariations` (BYO upload + designed-logo setStateAsync
|
|
422
|
-
// both funnel here), so caching here keeps every distinct draft's
|
|
423
|
-
// grid available for the lifetime of the session.
|
|
416
|
+
// Cache per draft token so BYO undo can restore without re-rendering.
|
|
424
417
|
if (this.logoDraftToken) {
|
|
425
418
|
this.variationsByDraftToken[this.logoDraftToken] =
|
|
426
419
|
this.editableLogoVariations.map((v) => ({ ...v }));
|
|
427
420
|
}
|
|
428
421
|
},
|
|
429
422
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
* and every `LogoContent` block on every page. Used by the live edit
|
|
434
|
-
* path after a fabric-render POST AND by the undo/redo BYO branch
|
|
435
|
-
* after `restoreVariationsForDraftToken` has rehydrated the cache.
|
|
436
|
-
*
|
|
437
|
-
* The history store strips `logoImageBase64Url` from snapshots to
|
|
438
|
-
* keep them under the 25 MB per-entry cap, so something has to
|
|
439
|
-
* write the base64 back into `brandPageData` after restore — for
|
|
440
|
-
* designed logos it's the awaited fabric-render call; for BYO it's
|
|
441
|
-
* this method.
|
|
442
|
-
*/
|
|
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.
|
|
443
426
|
stampLogoBase64IntoBrandPageData(overrideLogoVariation?: number): void {
|
|
444
427
|
const pageSettingStore = useUiPageSettingsStore();
|
|
445
428
|
|
|
@@ -479,11 +462,8 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
479
462
|
});
|
|
480
463
|
},
|
|
481
464
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
* cache. Called by `_syncLogoSettingsFromSnapshot` during undo/redo.
|
|
485
|
-
* Returns true on cache hit.
|
|
486
|
-
*/
|
|
465
|
+
// Restore variations grid for a draft token from the per-token cache.
|
|
466
|
+
// Returns true on cache hit.
|
|
487
467
|
restoreVariationsForDraftToken(logoDraftToken: string): boolean {
|
|
488
468
|
const cached = this.variationsByDraftToken[logoDraftToken];
|
|
489
469
|
|