@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
|
@@ -62982,19 +62982,9 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
62982
62982
|
);
|
|
62983
62983
|
await Promise.all(i), this.stampLogoBase64IntoBrandPageData(t), this.logoDraftToken && (this.variationsByDraftToken[this.logoDraftToken] = this.editableLogoVariations.map((o) => ({ ...o })));
|
|
62984
62984
|
},
|
|
62985
|
-
|
|
62986
|
-
|
|
62987
|
-
|
|
62988
|
-
* and every `LogoContent` block on every page. Used by the live edit
|
|
62989
|
-
* path after a fabric-render POST AND by the undo/redo BYO branch
|
|
62990
|
-
* after `restoreVariationsForDraftToken` has rehydrated the cache.
|
|
62991
|
-
*
|
|
62992
|
-
* The history store strips `logoImageBase64Url` from snapshots to
|
|
62993
|
-
* keep them under the 25 MB per-entry cap, so something has to
|
|
62994
|
-
* write the base64 back into `brandPageData` after restore — for
|
|
62995
|
-
* designed logos it's the awaited fabric-render call; for BYO it's
|
|
62996
|
-
* this method.
|
|
62997
|
-
*/
|
|
62985
|
+
// Stamp editableLogoVariations[*].base64 across header/footer + every
|
|
62986
|
+
// LogoContent. Called by the live edit path post-render, and by
|
|
62987
|
+
// undo/redo to repopulate the stripped logoImageBase64Url fields.
|
|
62998
62988
|
stampLogoBase64IntoBrandPageData(e) {
|
|
62999
62989
|
const t = Se();
|
|
63000
62990
|
[L2.header, L2.footer].forEach((n) => {
|
|
@@ -63014,11 +63004,8 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63014
63004
|
});
|
|
63015
63005
|
});
|
|
63016
63006
|
},
|
|
63017
|
-
|
|
63018
|
-
|
|
63019
|
-
* cache. Called by `_syncLogoSettingsFromSnapshot` during undo/redo.
|
|
63020
|
-
* Returns true on cache hit.
|
|
63021
|
-
*/
|
|
63007
|
+
// Restore variations grid for a draft token from the per-token cache.
|
|
63008
|
+
// Returns true on cache hit.
|
|
63022
63009
|
restoreVariationsForDraftToken(e) {
|
|
63023
63010
|
const t = this.variationsByDraftToken[e];
|
|
63024
63011
|
return t ? (this.editableLogoVariations = t.map((n) => ({ ...n })), !0) : !1;
|
|
@@ -63141,8 +63128,7 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63141
63128
|
const a = T(() => n.value > 0), l = T(
|
|
63142
63129
|
() => n.value >= 0 && n.value < t.value.length - 1
|
|
63143
63130
|
);
|
|
63144
|
-
|
|
63145
|
-
function c(n1) {
|
|
63131
|
+
function d(n1) {
|
|
63146
63132
|
try {
|
|
63147
63133
|
if (!w2().isPrePurchase) return;
|
|
63148
63134
|
} catch {
|
|
@@ -63155,21 +63141,20 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63155
63141
|
j && typeof j == "object" && "logoImageBase64Url" in j && (j.logoImageBase64Url = void 0);
|
|
63156
63142
|
}
|
|
63157
63143
|
}
|
|
63158
|
-
function
|
|
63159
|
-
if (!d) return null;
|
|
63144
|
+
function c() {
|
|
63160
63145
|
try {
|
|
63161
63146
|
const n1 = JSON.parse(
|
|
63162
|
-
JSON.stringify(yh(
|
|
63147
|
+
JSON.stringify(yh(C2().brandPageData))
|
|
63163
63148
|
);
|
|
63164
|
-
return
|
|
63149
|
+
return d(n1), JSON.stringify(n1);
|
|
63165
63150
|
} catch (n1) {
|
|
63166
63151
|
return console.error("history-store: failed to serialize snapshot", n1), null;
|
|
63167
63152
|
}
|
|
63168
63153
|
}
|
|
63169
|
-
function
|
|
63154
|
+
function u() {
|
|
63170
63155
|
return u3().activePageId ?? "";
|
|
63171
63156
|
}
|
|
63172
|
-
function
|
|
63157
|
+
function h() {
|
|
63173
63158
|
try {
|
|
63174
63159
|
const n1 = G4();
|
|
63175
63160
|
return JSON.stringify(yh(n1.logoEdits));
|
|
@@ -63178,7 +63163,8 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63178
63163
|
return;
|
|
63179
63164
|
}
|
|
63180
63165
|
}
|
|
63181
|
-
const
|
|
63166
|
+
const g = c1(!1);
|
|
63167
|
+
let m = !1;
|
|
63182
63168
|
function y(n1) {
|
|
63183
63169
|
const r1 = t.value[n.value];
|
|
63184
63170
|
if (r1 && r1.snapshot === n1.snapshot && r1.logoEdits === n1.logoEdits)
|
|
@@ -63216,13 +63202,12 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63216
63202
|
}
|
|
63217
63203
|
function M() {
|
|
63218
63204
|
if (s.value) return;
|
|
63219
|
-
d = C2();
|
|
63220
63205
|
const n1 = () => {
|
|
63221
63206
|
if (S(), i.value || !o.value) return;
|
|
63222
|
-
const j =
|
|
63207
|
+
const j = c();
|
|
63223
63208
|
if (!j) return;
|
|
63224
|
-
const q =
|
|
63225
|
-
if (m
|
|
63209
|
+
const q = u(), o1 = h(), W = n.value === 0 && Date.now() - r < u$1, _1 = m;
|
|
63210
|
+
if (m = !1, W) {
|
|
63226
63211
|
t.value = [
|
|
63227
63212
|
{
|
|
63228
63213
|
...t.value[0],
|
|
@@ -63255,8 +63240,8 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63255
63240
|
logoEdits: o1
|
|
63256
63241
|
});
|
|
63257
63242
|
};
|
|
63258
|
-
U2(() =>
|
|
63259
|
-
i.value || w === null && (w = setTimeout(n1, a$1), b = setTimeout(n1, l$1));
|
|
63243
|
+
U2(() => C2().brandPageData, () => {
|
|
63244
|
+
i.value || w === null && (g.value && (m = !0, g.value = !1), w = setTimeout(n1, a$1), b = setTimeout(n1, l$1));
|
|
63260
63245
|
}, {
|
|
63261
63246
|
deep: !0
|
|
63262
63247
|
}), s.value = !0;
|
|
@@ -63264,7 +63249,7 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63264
63249
|
function _() {
|
|
63265
63250
|
if (o.value) return;
|
|
63266
63251
|
M();
|
|
63267
|
-
const n1 =
|
|
63252
|
+
const n1 = c();
|
|
63268
63253
|
n1 && (t.value = [
|
|
63269
63254
|
{
|
|
63270
63255
|
snapshot: n1,
|
|
@@ -63273,18 +63258,18 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63273
63258
|
actor: "user",
|
|
63274
63259
|
label: "baseline",
|
|
63275
63260
|
sizeBytes: n1.length,
|
|
63276
|
-
activePageId:
|
|
63277
|
-
logoEdits:
|
|
63261
|
+
activePageId: u(),
|
|
63262
|
+
logoEdits: h()
|
|
63278
63263
|
}
|
|
63279
63264
|
], n.value = 0, o.value = !0, r = Date.now());
|
|
63280
63265
|
}
|
|
63281
63266
|
function V(n1) {
|
|
63282
63267
|
if (i.value || !o.value) return "skipped";
|
|
63283
|
-
const r1 =
|
|
63268
|
+
const r1 = c();
|
|
63284
63269
|
return r1 ? y({
|
|
63285
63270
|
snapshot: r1,
|
|
63286
|
-
activePageId:
|
|
63287
|
-
logoEdits:
|
|
63271
|
+
activePageId: u(),
|
|
63272
|
+
logoEdits: h(),
|
|
63288
63273
|
...n1
|
|
63289
63274
|
}) : "skipped";
|
|
63290
63275
|
}
|
|
@@ -63333,7 +63318,7 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63333
63318
|
}
|
|
63334
63319
|
}
|
|
63335
63320
|
const X1 = t.value[r1];
|
|
63336
|
-
i.value = !0,
|
|
63321
|
+
i.value = !0, g.value = !1, m = !1, S();
|
|
63337
63322
|
try {
|
|
63338
63323
|
await q.applyHistorySnapshot(
|
|
63339
63324
|
o1,
|
|
@@ -63374,10 +63359,12 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
63374
63359
|
});
|
|
63375
63360
|
}
|
|
63376
63361
|
function K() {
|
|
63377
|
-
o.value && (S(),
|
|
63362
|
+
o.value && (S(), g.value = !1, m = !1, t.value = [], n.value = -1, o.value = !1, r = 0, _());
|
|
63378
63363
|
}
|
|
63379
63364
|
function e1() {
|
|
63380
|
-
|
|
63365
|
+
g.value = !0, setTimeout(() => {
|
|
63366
|
+
g.value = !1;
|
|
63367
|
+
}, 0);
|
|
63381
63368
|
}
|
|
63382
63369
|
function Y() {
|
|
63383
63370
|
return t.value.reduce((n1, r1) => n1 + r1.sizeBytes, 0);
|
|
@@ -64372,10 +64359,10 @@ const fL = () => Zp || (Zp = new o$1()), Td = (e, t) => s$1(e).then(
|
|
|
64372
64359
|
U2(() => n.context.isDesignCom, async () => {
|
|
64373
64360
|
const M = _9().toLowerCase(), _ = n.context.isDesignCom ? "Dcom" : "BrandCrowd";
|
|
64374
64361
|
try {
|
|
64375
|
-
const { default: V } = await vL(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-
|
|
64362
|
+
const { default: V } = await vL(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-D-2WhY-F.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-B7ldKpJK.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-BatQY8Tt.js"), "./watermark/CreatedOnBrandCrowd-fr-ca.vue": () => import("./CreatedOnBrandCrowd-fr-ca-CFivOJkN.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-CFivOJkN.js"), "./watermark/CreatedOnBrandCrowd-pt-br.vue": () => import("./CreatedOnBrandCrowd-pt-br-wHkXfYLP.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-wHkXfYLP.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de--HwniV-Y.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-Bqm5NnRX.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-COGQIuEn.js"), "./watermark/CreatedOnDcom-fr-ca.vue": () => import("./CreatedOnDcom-fr-ca-eVDHO7MX.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-BhGKbdoG.js"), "./watermark/CreatedOnDcom-pt-br.vue": () => import("./CreatedOnDcom-pt-br-5kDZKPZc.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-CnTcVxct.js") }), `./watermark/CreatedOn${_}-${M}.vue`, 3);
|
|
64376
64363
|
i.value = V;
|
|
64377
64364
|
} catch {
|
|
64378
|
-
const { default: x } = await vL(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-
|
|
64365
|
+
const { default: x } = await vL(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-B7ldKpJK.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-Bqm5NnRX.js") }), `./watermark/CreatedOn${_}-en-us.vue`, 3);
|
|
64379
64366
|
i.value = x;
|
|
64380
64367
|
}
|
|
64381
64368
|
}, {
|
|
@@ -187,8 +187,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
187
187
|
minLength: number;
|
|
188
188
|
maxLength: number;
|
|
189
189
|
value: string | false | undefined;
|
|
190
|
-
isRequired: boolean;
|
|
191
190
|
attrs: Record<string, any>;
|
|
191
|
+
isRequired: boolean;
|
|
192
192
|
isToggled: boolean;
|
|
193
193
|
readOnly: boolean;
|
|
194
194
|
contentType: string;
|
package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js
CHANGED
|
@@ -55,14 +55,7 @@ export default defineComponent({
|
|
|
55
55
|
},
|
|
56
56
|
mounted() {
|
|
57
57
|
if (this.canUseRichTextEditor) {
|
|
58
|
-
//
|
|
59
|
-
// and rewraps plain-text titles/paragraphs in TipTap HTML so they
|
|
60
|
-
// render through the inline RTE. That's a hydration write — it
|
|
61
|
-
// happens whenever the Content sidebar tab mounts (incl. when the
|
|
62
|
-
// user clicks the header in the canvas) and produces no
|
|
63
|
-
// user-visible change. Arm the merge flag so the watcher folds
|
|
64
|
-
// the resulting flush into the current head entry instead of
|
|
65
|
-
// pushing a phantom undo step.
|
|
58
|
+
// RTE rewrap on tab mount — fold into current head.
|
|
66
59
|
this.historyStore.mergeNextMutation();
|
|
67
60
|
switchAllContentToRTE(this.pageSettingsStore, this.externalEditor, this.styleSettingsStore);
|
|
68
61
|
}
|
|
@@ -184,8 +184,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
184
184
|
minLength: number;
|
|
185
185
|
maxLength: number;
|
|
186
186
|
value: string | false | undefined;
|
|
187
|
-
isRequired: boolean;
|
|
188
187
|
attrs: Record<string, any>;
|
|
188
|
+
isRequired: boolean;
|
|
189
189
|
isToggled: boolean;
|
|
190
190
|
readOnly: boolean;
|
|
191
191
|
contentType: string;
|
package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js
CHANGED
|
@@ -102,14 +102,8 @@ export default defineComponent({
|
|
|
102
102
|
name: this.name,
|
|
103
103
|
value,
|
|
104
104
|
};
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
// below mutates `brandPageData[*].paymentConfig` from undefined to
|
|
108
|
-
// the live `shopConfigStore.paymentConfig` — no user authoring
|
|
109
|
-
// intent. Arm the merge flag so the watcher's flush folds this
|
|
110
|
-
// into the current head instead of pushing a phantom undo entry
|
|
111
|
-
// that would, when undone, surface the "Please enable a payment
|
|
112
|
-
// provider" warning.
|
|
105
|
+
// Lazy paymentConfig hydration — fold into current head instead
|
|
106
|
+
// of pushing a phantom entry.
|
|
113
107
|
this.historyStore.mergeNextMutation();
|
|
114
108
|
this.$emit('update:modelValue', payload);
|
|
115
109
|
}
|
|
@@ -110,9 +110,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
110
110
|
placeholder: string;
|
|
111
111
|
variant: string;
|
|
112
112
|
value: string | boolean | Record<string, any>;
|
|
113
|
-
isRequired: boolean;
|
|
114
113
|
multiple: boolean;
|
|
115
114
|
optionsConvertor: OptionsConvertor<unknown>;
|
|
115
|
+
isRequired: boolean;
|
|
116
116
|
}, {}, {
|
|
117
117
|
FieldSubHeader: import("vue").DefineComponent<{}, {}, any>;
|
|
118
118
|
Button: any;
|
|
@@ -184,8 +184,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
184
184
|
minLength: number;
|
|
185
185
|
maxLength: number;
|
|
186
186
|
value: string | false | undefined;
|
|
187
|
-
isRequired: boolean;
|
|
188
187
|
attrs: Record<string, any>;
|
|
188
|
+
isRequired: boolean;
|
|
189
189
|
isToggled: boolean;
|
|
190
190
|
readOnly: boolean;
|
|
191
191
|
contentType: string;
|
|
@@ -184,8 +184,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
184
184
|
minLength: number;
|
|
185
185
|
maxLength: number;
|
|
186
186
|
value: string | false | undefined;
|
|
187
|
-
isRequired: boolean;
|
|
188
187
|
attrs: Record<string, any>;
|
|
188
|
+
isRequired: boolean;
|
|
189
189
|
isToggled: boolean;
|
|
190
190
|
readOnly: boolean;
|
|
191
191
|
contentType: string;
|
|
@@ -198,8 +198,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
198
198
|
minLength: number;
|
|
199
199
|
maxLength: number;
|
|
200
200
|
value: string | false | undefined;
|
|
201
|
-
isRequired: boolean;
|
|
202
201
|
attrs: Record<string, any>;
|
|
202
|
+
isRequired: boolean;
|
|
203
203
|
isToggled: boolean;
|
|
204
204
|
readOnly: boolean;
|
|
205
205
|
contentType: string;
|
|
@@ -191,8 +191,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
|
|
|
191
191
|
minLength: number;
|
|
192
192
|
maxLength: number;
|
|
193
193
|
value: string | false | undefined;
|
|
194
|
-
isRequired: boolean;
|
|
195
194
|
attrs: Record<string, any>;
|
|
195
|
+
isRequired: boolean;
|
|
196
196
|
isToggled: boolean;
|
|
197
197
|
readOnly: boolean;
|
|
198
198
|
contentType: string;
|
package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts
CHANGED
|
@@ -187,8 +187,8 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
|
|
|
187
187
|
minLength: number;
|
|
188
188
|
maxLength: number;
|
|
189
189
|
value: string | false | undefined;
|
|
190
|
-
isRequired: boolean;
|
|
191
190
|
attrs: Record<string, any>;
|
|
191
|
+
isRequired: boolean;
|
|
192
192
|
isToggled: boolean;
|
|
193
193
|
readOnly: boolean;
|
|
194
194
|
contentType: string;
|
|
@@ -186,25 +186,7 @@ export declare const useUiEditableLogoStore: import("pinia").StoreDefinition<"ui
|
|
|
186
186
|
getEditableLogoVariationByVariationId(id: number): any;
|
|
187
187
|
getEditableLogoVariationByBase64(base64: string): any;
|
|
188
188
|
updateEditableLogoImageUrlAsync(defaultPrimaryText?: string, overrideLogoVariation?: number | undefined, layout?: string): Promise<void>;
|
|
189
|
-
/**
|
|
190
|
-
* Stamp `editableLogoVariations[*].base64` across every consumer in
|
|
191
|
-
* `brandPageData`: header/footer logo sections (desktop + mobile)
|
|
192
|
-
* and every `LogoContent` block on every page. Used by the live edit
|
|
193
|
-
* path after a fabric-render POST AND by the undo/redo BYO branch
|
|
194
|
-
* after `restoreVariationsForDraftToken` has rehydrated the cache.
|
|
195
|
-
*
|
|
196
|
-
* The history store strips `logoImageBase64Url` from snapshots to
|
|
197
|
-
* keep them under the 25 MB per-entry cap, so something has to
|
|
198
|
-
* write the base64 back into `brandPageData` after restore — for
|
|
199
|
-
* designed logos it's the awaited fabric-render call; for BYO it's
|
|
200
|
-
* this method.
|
|
201
|
-
*/
|
|
202
189
|
stampLogoBase64IntoBrandPageData(overrideLogoVariation?: number): void;
|
|
203
|
-
/**
|
|
204
|
-
* Restore the variations grid for `logoDraftToken` from the per-token
|
|
205
|
-
* cache. Called by `_syncLogoSettingsFromSnapshot` during undo/redo.
|
|
206
|
-
* Returns true on cache hit.
|
|
207
|
-
*/
|
|
208
190
|
restoreVariationsForDraftToken(logoDraftToken: string): boolean;
|
|
209
191
|
updateMetadataAsync(defaultPrimaryText?: string, resetLogoTemplateMetadata?: boolean, layout?: string): Promise<void>;
|
|
210
192
|
updateEditableLogoImageByVariationAsync(editableLogoVariation: EditableLogoVariation, defaultPrimaryText?: string, layout?: string): Promise<ModifyLogoDataResponse | null>;
|
|
@@ -219,30 +219,15 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
219
219
|
const tasks = this.editableLogoVariations.map((x) => this.updateEditableLogoImageByVariationAsync(x, defaultPrimaryText, layout));
|
|
220
220
|
await Promise.all(tasks);
|
|
221
221
|
this.stampLogoBase64IntoBrandPageData(overrideLogoVariation);
|
|
222
|
-
//
|
|
223
|
-
// token so undo can restore it later without re-rendering. This is
|
|
224
|
-
// the only place in production that meaningfully populates
|
|
225
|
-
// `editableLogoVariations` (BYO upload + designed-logo setStateAsync
|
|
226
|
-
// both funnel here), so caching here keeps every distinct draft's
|
|
227
|
-
// grid available for the lifetime of the session.
|
|
222
|
+
// Cache per draft token so BYO undo can restore without re-rendering.
|
|
228
223
|
if (this.logoDraftToken) {
|
|
229
224
|
this.variationsByDraftToken[this.logoDraftToken] =
|
|
230
225
|
this.editableLogoVariations.map((v) => ({ ...v }));
|
|
231
226
|
}
|
|
232
227
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
* and every `LogoContent` block on every page. Used by the live edit
|
|
237
|
-
* path after a fabric-render POST AND by the undo/redo BYO branch
|
|
238
|
-
* after `restoreVariationsForDraftToken` has rehydrated the cache.
|
|
239
|
-
*
|
|
240
|
-
* The history store strips `logoImageBase64Url` from snapshots to
|
|
241
|
-
* keep them under the 25 MB per-entry cap, so something has to
|
|
242
|
-
* write the base64 back into `brandPageData` after restore — for
|
|
243
|
-
* designed logos it's the awaited fabric-render call; for BYO it's
|
|
244
|
-
* this method.
|
|
245
|
-
*/
|
|
228
|
+
// Stamp editableLogoVariations[*].base64 across header/footer + every
|
|
229
|
+
// LogoContent. Called by the live edit path post-render, and by
|
|
230
|
+
// undo/redo to repopulate the stripped logoImageBase64Url fields.
|
|
246
231
|
stampLogoBase64IntoBrandPageData(overrideLogoVariation) {
|
|
247
232
|
const pageSettingStore = useUiPageSettingsStore();
|
|
248
233
|
[PAGE_SECTIONS.header, PAGE_SECTIONS.footer].forEach((section) => {
|
|
@@ -270,11 +255,8 @@ export const useUiEditableLogoStore = defineStore('uiEditableLogo', {
|
|
|
270
255
|
});
|
|
271
256
|
});
|
|
272
257
|
},
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
* cache. Called by `_syncLogoSettingsFromSnapshot` during undo/redo.
|
|
276
|
-
* Returns true on cache hit.
|
|
277
|
-
*/
|
|
258
|
+
// Restore variations grid for a draft token from the per-token cache.
|
|
259
|
+
// Returns true on cache hit.
|
|
278
260
|
restoreVariationsForDraftToken(logoDraftToken) {
|
|
279
261
|
const cached = this.variationsByDraftToken[logoDraftToken];
|
|
280
262
|
if (!cached)
|
package/package.json
CHANGED
|
@@ -211,17 +211,8 @@ export const useRichTextEditor = (
|
|
|
211
211
|
): UseRichTextEditorReturn => {
|
|
212
212
|
const historyStore = useHistoryStore();
|
|
213
213
|
|
|
214
|
-
// TipTap rehydrates
|
|
215
|
-
//
|
|
216
|
-
// user-visible text is unchanged (it normalises whitespace, wraps plain
|
|
217
|
-
// text in `<p>`, expands `%0A` to `<br>`, mirrors the resolved textStyle
|
|
218
|
-
// as inline `<strong>`/`<span style="...">`/`<mark>` tags, etc). Each of
|
|
219
|
-
// those rehydration writes mutates `brandPageData` and would otherwise
|
|
220
|
-
// surface as a phantom undo entry the first time the user opens a
|
|
221
|
-
// sidebar or clicks into a section. Arming the merge flag folds the
|
|
222
|
-
// resulting watcher flush into the current head instead of pushing.
|
|
223
|
-
// Idempotent — every editor on the page mounting at once collapses
|
|
224
|
-
// into the same merge.
|
|
214
|
+
// TipTap rehydrates and writes back canonical HTML on mount — fold
|
|
215
|
+
// that into the current head instead of pushing a phantom entry.
|
|
225
216
|
historyStore.mergeNextMutation();
|
|
226
217
|
|
|
227
218
|
const editor = new Editor({
|
|
@@ -924,23 +924,15 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
924
924
|
const logoStore = useLogoStore();
|
|
925
925
|
const containerStore = useBrandPageContainerStore();
|
|
926
926
|
|
|
927
|
-
//
|
|
928
|
-
//
|
|
929
|
-
// we're restoring has the same logoEdits + draft token as the live
|
|
930
|
-
// state — i.e. only non-logo state changed between the two entries.
|
|
927
|
+
// Pre-restore logo identity, used to short-circuit the
|
|
928
|
+
// fabric-render call when only non-logo state changed.
|
|
931
929
|
const prevLogoEditsStr = JSON.stringify(
|
|
932
930
|
toRaw(editableLogoStore.logoEdits),
|
|
933
931
|
);
|
|
934
932
|
const prevDraftToken = editableLogoStore.logoDraftToken;
|
|
935
933
|
|
|
936
|
-
//
|
|
937
|
-
//
|
|
938
|
-
// entry's textObjects/colors don't leak through (e.g. switching
|
|
939
|
-
// template A→B then undoing A's restored object set must NOT contain
|
|
940
|
-
// B's textObject ids). Failing parse is non-fatal; the logo tab will
|
|
941
|
-
// just keep showing whatever logoEdits state was already loaded —
|
|
942
|
-
// canvas + saved metadata still come from `brandPageData` + the
|
|
943
|
-
// save-time `updateMetadataAsync` round-trip.
|
|
934
|
+
// Wholesale-replace via $patch so prior textObjects/colors don't
|
|
935
|
+
// leak across template switches.
|
|
944
936
|
if (logoEditsStr) {
|
|
945
937
|
try {
|
|
946
938
|
const parsed = JSON.parse(logoEditsStr);
|
|
@@ -973,12 +965,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
973
965
|
|
|
974
966
|
if (!draftToken) return;
|
|
975
967
|
|
|
976
|
-
// Re-derive
|
|
977
|
-
//
|
|
978
|
-
// and BYO upload stamps `templateAsset` onto the registered draft when
|
|
979
|
-
// it lands — so the registered draft is enough to fully restore the
|
|
980
|
-
// sidebar's design/upload chooser without storing anything inside
|
|
981
|
-
// each history entry.
|
|
968
|
+
// Re-derive enableEditMode + templateAsset from the draft registry
|
|
969
|
+
// (append-only for the session) instead of stashing on every entry.
|
|
982
970
|
const draft = logoStore.getLogoDraftAssetByToken(draftToken);
|
|
983
971
|
|
|
984
972
|
if (draft) {
|
|
@@ -991,12 +979,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
991
979
|
|
|
992
980
|
editableLogoStore.setLogoDraftToken(draftToken);
|
|
993
981
|
|
|
994
|
-
//
|
|
995
|
-
//
|
|
996
|
-
// live, the cached `editableLogoVariations` is still the right
|
|
997
|
-
// render and we just need to stamp it back into `brandPageData`
|
|
998
|
-
// (history-store strips `logoImageBase64Url` from snapshots, so
|
|
999
|
-
// the page-level base64 fields are now empty).
|
|
982
|
+
// No logo change → cache is still correct; just stamp base64 back
|
|
983
|
+
// (snapshot doesn't carry logoImageBase64Url).
|
|
1000
984
|
const logoUnchanged =
|
|
1001
985
|
prevDraftToken === draftToken &&
|
|
1002
986
|
(logoEditsStr === undefined || logoEditsStr === prevLogoEditsStr);
|
|
@@ -1010,13 +994,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1010
994
|
const isByo = !!draft?.isByo;
|
|
1011
995
|
|
|
1012
996
|
if (isByo) {
|
|
1013
|
-
// BYO
|
|
1014
|
-
//
|
|
1015
|
-
// base64 the user saw at capture. No re-render — the uploaded
|
|
1016
|
-
// image bytes are the source of truth and there's nothing for
|
|
1017
|
-
// fabric-render to derive. After restoring the variations cache,
|
|
1018
|
-
// stamp the base64 back across header/footer/per-page logo
|
|
1019
|
-
// content; the snapshot itself doesn't carry `logoImageBase64Url`.
|
|
997
|
+
// BYO mints a fresh draftToken per upload so the per-token
|
|
998
|
+
// cache always matches; no re-render needed.
|
|
1020
999
|
if (editableLogoStore.restoreVariationsForDraftToken(draftToken)) {
|
|
1021
1000
|
editableLogoStore.stampLogoBase64IntoBrandPageData();
|
|
1022
1001
|
}
|
|
@@ -1024,22 +1003,11 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1024
1003
|
return;
|
|
1025
1004
|
}
|
|
1026
1005
|
|
|
1027
|
-
// Designed
|
|
1028
|
-
// the
|
|
1029
|
-
//
|
|
1030
|
-
//
|
|
1031
|
-
//
|
|
1032
|
-
// `logoEdits`, writes the returned base64 across every header/footer
|
|
1033
|
-
// + per-page logo content + `editableLogoVariations`.
|
|
1034
|
-
//
|
|
1035
|
-
// Awaited (not fire-and-forget): two undos in quick succession would
|
|
1036
|
-
// otherwise kick off two parallel render bursts whose `Promise.all`
|
|
1037
|
-
// tasks interleave, leaving each variation showing whichever request
|
|
1038
|
-
// happened to win the race rather than the variation that belongs
|
|
1039
|
-
// to the snapshot the user landed on. Awaiting also keeps the call
|
|
1040
|
-
// inside the `applyHistorySnapshot`/`isApplyingSnapshot` window, so
|
|
1041
|
-
// the post-render writeback is naturally suppressed by the existing
|
|
1042
|
-
// watcher guard — no `mergeNextMutation()` needed.
|
|
1006
|
+
// Designed: draft token is reused across edits, so the cache
|
|
1007
|
+
// only holds the latest render. Re-issue fabric-render — same
|
|
1008
|
+
// call as the live edit path. Awaited so concurrent undos
|
|
1009
|
+
// serialize and the call sits inside the isApplyingSnapshot
|
|
1010
|
+
// window (watcher guard suppresses the writeback).
|
|
1043
1011
|
if (
|
|
1044
1012
|
containerStore.isPrePurchase &&
|
|
1045
1013
|
logoEditsStr &&
|
|
@@ -357,6 +357,38 @@ describe('history-store (single stack + JSON-string snapshots)', () => {
|
|
|
357
357
|
expect(store.currentIndex).toBe(2);
|
|
358
358
|
});
|
|
359
359
|
|
|
360
|
+
it('drops a stale merge arm if no mutation follows in the same tick', async () => {
|
|
361
|
+
// Repro for the "first pre-purchase logo edit not captured" bug:
|
|
362
|
+
// a hydration site (e.g. ContentSettings.mounted on tab switch)
|
|
363
|
+
// armed the flag, but the user navigated away before the flagged
|
|
364
|
+
// write happened. A LATER unrelated mutation must NOT inherit
|
|
365
|
+
// the stale arm and merge — it must commit normally.
|
|
366
|
+
const store = useHistoryStore();
|
|
367
|
+
|
|
368
|
+
await store.captureBaseline();
|
|
369
|
+
await elapseSettleWindow();
|
|
370
|
+
|
|
371
|
+
// Land a real entry first.
|
|
372
|
+
liveData.v = 100;
|
|
373
|
+
await flushWatcher();
|
|
374
|
+
|
|
375
|
+
expect(store.entries.length).toBe(2);
|
|
376
|
+
|
|
377
|
+
// Hydration site arms the flag, but no mutation follows in the
|
|
378
|
+
// same tick — caller navigated away.
|
|
379
|
+
store.mergeNextMutation();
|
|
380
|
+
// Advance past the macrotask cleanup, no mutation in between.
|
|
381
|
+
await vi.advanceTimersByTimeAsync(10);
|
|
382
|
+
|
|
383
|
+
// Some time later, a real edit happens.
|
|
384
|
+
liveData.unrelated = 'edit';
|
|
385
|
+
await flushWatcher();
|
|
386
|
+
|
|
387
|
+
// Must push, not merge.
|
|
388
|
+
expect(store.entries.length).toBe(3);
|
|
389
|
+
expect(store.currentIndex).toBe(2);
|
|
390
|
+
});
|
|
391
|
+
|
|
360
392
|
it('clears any armed merge flag during snapshot apply (undo/redo)', async () => {
|
|
361
393
|
const store = useHistoryStore();
|
|
362
394
|
|