@designcrowd/library.brand-page 5.17.25-undo-1 → 5.17.25-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 (25) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-D4ev-dOV.js → CreatedOnBrandCrowd-de-de-xR_8611Z.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-l6fBsu39.js → CreatedOnBrandCrowd-en-us-CrKMPM86.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-DLQIQ5M2.js → CreatedOnBrandCrowd-es-es-C7lJoCwP.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DupdjGz_.js → CreatedOnBrandCrowd-fr-ca-B2P1kNsi.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-DupdjGz_.js → CreatedOnBrandCrowd-fr-fr-B2P1kNsi.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DfQn7LrQ.js → CreatedOnBrandCrowd-pt-br-Cg9ulkXK.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DfQn7LrQ.js → CreatedOnBrandCrowd-pt-pt-Cg9ulkXK.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-ya4QeOad.js → CreatedOnDcom-de-de-RKjXZKTE.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-Di2D0lWP.js → CreatedOnDcom-en-us-Bma4WSgm.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-lXVX_P5c.js → CreatedOnDcom-es-es-CAqF8RQd.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-DczLEsh-.js → CreatedOnDcom-fr-ca-BZzsaA-O.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-DJpzYwiw.js → CreatedOnDcom-fr-fr-lB4hUGDb.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DbI1Kiaj.js → CreatedOnDcom-pt-br-dD3iqhZb.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-DbYfgRQW.js → CreatedOnDcom-pt-pt-80E4SvnQ.js} +1 -1
  15. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +11 -0
  16. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +9 -9
  17. package/lib/src/brand-page-maker/stores/history/history-store.js +17 -13
  18. package/lib/src/index.mjs +1 -1
  19. package/lib/src/{lib-DbbZWyn5.js → lib-BBctNsms.js} +1197 -1183
  20. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +11 -0
  21. package/package.json +1 -1
  22. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +14 -0
  23. package/src/brand-page-maker/stores/history/history-store.test.ts +64 -14
  24. package/src/brand-page-maker/stores/history/history-store.ts +22 -18
  25. package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +11 -0
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DbbZWyn5.js";
2
+ import { _ as t } from "./lib-BBctNsms.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DbbZWyn5.js";
2
+ import { _ as t } from "./lib-BBctNsms.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DbbZWyn5.js";
2
+ import { _ as t } from "./lib-BBctNsms.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DbbZWyn5.js";
2
+ import { _ as t } from "./lib-BBctNsms.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DbbZWyn5.js";
2
+ import { _ as t } from "./lib-BBctNsms.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DbbZWyn5.js";
2
+ import { _ as t } from "./lib-BBctNsms.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DbbZWyn5.js";
2
+ import { _ as t } from "./lib-BBctNsms.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DbbZWyn5.js";
2
+ import { _ as e } from "./lib-BBctNsms.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DbbZWyn5.js";
2
+ import { _ as e } from "./lib-BBctNsms.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DbbZWyn5.js";
2
+ import { _ as e } from "./lib-BBctNsms.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DbbZWyn5.js";
2
+ import { _ as e } from "./lib-BBctNsms.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DbbZWyn5.js";
2
+ import { _ as e } from "./lib-BBctNsms.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-DbbZWyn5.js";
2
+ import { _ as M } from "./lib-BBctNsms.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-DbbZWyn5.js";
2
+ import { _ as M } from "./lib-BBctNsms.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -575,6 +575,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
575
575
  },
576
576
  _syncLogoSettingsFromSnapshot(snapshot) {
577
577
  const logoSettingsStore = useUiLogoSettingsStore();
578
+ const editableLogoStore = useUiEditableLogoStore();
579
+ const logoStore = useLogoStore();
578
580
  const logoImage = snapshot.brandPageType === BRAND_PAGE_TYPES.default
579
581
  ? snapshot.pages?.[0]?.contents?.find((c) => c.type === 'logo')?.logoImage
580
582
  : snapshot.pageHeaderDesktop?.logoImage;
@@ -583,6 +585,15 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
583
585
  logoSettingsStore.setState({
584
586
  newState: { selectedLogoImage: logoImage },
585
587
  });
588
+ // Re-derive `enableEditMode` so the sidebar's design/upload tabs
589
+ // reflect the restored logo. BYO logos can't be edited in the design
590
+ // surface, so `enableEditMode` must flip false on undo back to a BYO
591
+ // upload and true on redo back to a designed logo. Logo drafts are
592
+ // append-only during a session, so a token in the snapshot always
593
+ // resolves here.
594
+ const draft = logoStore.getLogoDraftAssetByToken(logoImage.logoDraftToken);
595
+ if (draft)
596
+ editableLogoStore.setEnableEditMode(!draft.isByo);
586
597
  },
587
598
  _fallbackSidebarIfSelectedContentMissing(snapshot) {
588
599
  const contentSettingsStore = useUiContentSettingsStore();
@@ -35,9 +35,9 @@ export declare const useHistoryStore: import("pinia").StoreDefinition<"history",
35
35
  source: HistoryEntry['source'];
36
36
  actor: HistoryEntry['actor'];
37
37
  label?: string;
38
- }) => 'committed' | 'oversized' | 'skipped';
39
- captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'skipped';
40
- captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'skipped';
38
+ }) => 'committed' | 'oversized' | 'noop' | 'skipped';
39
+ captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
40
+ captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
41
41
  undo: () => Promise<void>;
42
42
  redo: () => Promise<void>;
43
43
  getCurrentSizeBytes: () => number;
@@ -54,9 +54,9 @@ export declare const useHistoryStore: import("pinia").StoreDefinition<"history",
54
54
  source: HistoryEntry['source'];
55
55
  actor: HistoryEntry['actor'];
56
56
  label?: string;
57
- }) => 'committed' | 'oversized' | 'skipped';
58
- captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'skipped';
59
- captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'skipped';
57
+ }) => 'committed' | 'oversized' | 'noop' | 'skipped';
58
+ captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
59
+ captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
60
60
  undo: () => Promise<void>;
61
61
  redo: () => Promise<void>;
62
62
  getCurrentSizeBytes: () => number;
@@ -73,9 +73,9 @@ export declare const useHistoryStore: import("pinia").StoreDefinition<"history",
73
73
  source: HistoryEntry['source'];
74
74
  actor: HistoryEntry['actor'];
75
75
  label?: string;
76
- }) => 'committed' | 'oversized' | 'skipped';
77
- captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'skipped';
78
- captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'skipped';
76
+ }) => 'committed' | 'oversized' | 'noop' | 'skipped';
77
+ captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
78
+ captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
79
79
  undo: () => Promise<void>;
80
80
  redo: () => Promise<void>;
81
81
  getCurrentSizeBytes: () => number;
@@ -84,20 +84,30 @@ export const useHistoryStore = defineStore('history', () => {
84
84
  * Commit a new entry into the stack at the current pointer position.
85
85
  *
86
86
  * Returns 'committed' when the entry lands in the stack, 'oversized' when
87
- * the entry exceeds `MAX_ENTRY_BYTES` and is skipped (FR-13c). Callers can
88
- * use the return to emit telemetry — analytics wiring lives in U5.
87
+ * the entry exceeds `MAX_ENTRY_BYTES` and is skipped (FR-13c), or 'noop'
88
+ * when the snapshot is byte-identical to the entry at the current pointer.
89
+ * Callers can use the return to emit telemetry — analytics wiring lives
90
+ * in U5.
89
91
  *
90
- * Enforces three invariants in order:
91
- * 1. FR-13c — if the new entry exceeds 5 MB, skip it entirely.
92
- * 2. FR-11 — truncate any redo tail.
93
- * 3. FR-12 — cap at 40 entries; drop oldest non-baseline on overflow.
94
- * 4. FR-13 — keep total memory under 100 MB; drop oldest non-baseline
92
+ * Enforces these invariants in order:
93
+ * 1. Drop no-op duplicates — if the new snapshot is identical to the
94
+ * entry at the current pointer, skip it. Color/text settle paths,
95
+ * template-switch confirms with no real diff, and AI applies that
96
+ * land identical state would otherwise create undo/redo steps that
97
+ * do nothing visible.
98
+ * 2. FR-13c — if the new entry exceeds 5 MB, skip it entirely.
99
+ * 3. FR-11 — truncate any redo tail.
100
+ * 4. FR-12 — cap at 40 entries; drop oldest non-baseline on overflow.
101
+ * 5. FR-13 — keep total memory under 100 MB; drop oldest non-baseline
95
102
  * repeatedly until we're under budget.
96
103
  *
97
104
  * Baseline (entry 0) is never evicted so "undo everything" always returns
98
105
  * to session start.
99
106
  */
100
107
  function commitEntry(args) {
108
+ const current = entries.value[currentIndex.value];
109
+ if (current && current.snapshot === args.snapshot)
110
+ return 'noop';
101
111
  if (args.snapshot.length > MAX_ENTRY_BYTES) {
102
112
  eventTracker.sendHistoryOversizedEvent({
103
113
  attempted_bytes: args.snapshot.length,
@@ -188,12 +198,6 @@ export const useHistoryStore = defineStore('history', () => {
188
198
  const snapshot = serializeCurrentBrandPageData();
189
199
  if (!snapshot)
190
200
  return;
191
- // Skip no-op captures so post-init reactivity (template load, layout
192
- // settling) doesn't create a duplicate baseline that makes undo
193
- // appear available with nothing to undo.
194
- const current = entries.value[currentIndex.value];
195
- if (current && current.snapshot === snapshot)
196
- return;
197
201
  // During the post-init settle window, fold any captured mutation back
198
202
  // into the baseline (entry 0). Async cascades like template
199
203
  // `loadPageNo`, the router's `afterEach`, and layout settling all
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as E, a as T, b as s, c as I, d as S, e as N, f as e, B as A, g as O, h as C, i as G, j as D, k as P, l as t, m as R, n as L, o as M, p as o, q as r, r as b, s as n, t as F, u as i, v as l, w as g, x as B, y as c, z as Y, C as U, D as d, E as u, F as H, G as p, H as y, I as K, J as k, K as m, L as V, M as X, N as h, O as v, P as W, Q as f, R as x, S as z, T as w, U as Z, V as j, W as Q, X as q, Y as J, Z as $, $ as aa, a0 as _a, a1 as Ea, a2 as Ta, a3 as sa, a4 as Ia, a5 as Sa, a6 as Na, a7 as ea, a8 as Aa, a9 as Oa, aa as Ca, ab as Ga, ac as Da, ad as Pa, ae as ta, af as Ra, ag as La, ah as Ma, ai as oa, aj as ra, ak as ba, al as na, am as Fa, an as ia, ao as la, ap as ga, aq as Ba, ar as ca, as as Ya, at as Ua, au as da, av as ua, aw as Ha, ax as pa, ay as ya, az as Ka, aA as ka, aB as ma, aC as Va, aD as Xa, aE as ha, aF as va, aG as Wa, aH as fa, aI as xa, aJ as za, aK as wa, aL as Za, aM as ja, aN as Qa, aO as qa, aP as Ja, aQ as $a, aR as a_, aS as __, aT as E_, aU as T_, aV as s_, aW as I_, aX as S_, aY as N_, aZ as e_, a_ as A_, a$ as O_, b0 as C_, b1 as G_, b2 as D_, b3 as P_, b4 as t_, b5 as R_, b6 as L_, b7 as M_, b8 as o_, b9 as r_, ba as b_, bb as n_, bc as F_, bd as i_, be as l_, bf as g_, bg as B_, bh as c_, bi as Y_, bj as U_, bk as d_, bl as u_, bm as H_, bn as p_, bo as y_, bp as K_, bq as k_, br as m_, bs as V_, bt as X_, bu as h_, bv as v_, bw as W_, bx as f_, by as x_, bz as z_, bA as w_, bB as Z_, bC as j_, bD as Q_, bE as q_, bF as J_, bG as $_, bH as aE, bI as _E, bJ as EE, bK as TE, bL as sE, bM as IE, bN as SE, bO as NE, bP as eE, bQ as AE, bR as OE, bS as CE, bT as GE, bU as DE, bV as PE, bW as tE, bX as RE, bY as LE, bZ as ME, b_ as oE, b$ as rE, c0 as bE, c1 as nE, c2 as FE, c3 as iE, c4 as lE, c5 as gE, c6 as BE, c7 as cE, c8 as YE, c9 as UE, ca as dE, cb as uE, cc as HE, cd as pE, ce as yE, cf as KE, cg as kE, ch as mE, ci as VE, cj as XE, ck as hE, cl as vE, cm as WE, cn as fE, co as xE } from "./lib-DbbZWyn5.js";
1
+ import { A as E, a as T, b as s, c as I, d as S, e as N, f as e, B as A, g as O, h as C, i as G, j as D, k as P, l as t, m as R, n as L, o as M, p as o, q as r, r as b, s as n, t as F, u as i, v as l, w as g, x as B, y as c, z as Y, C as U, D as d, E as u, F as H, G as p, H as y, I as K, J as k, K as m, L as V, M as X, N as h, O as v, P as W, Q as f, R as x, S as z, T as w, U as Z, V as j, W as Q, X as q, Y as J, Z as $, $ as aa, a0 as _a, a1 as Ea, a2 as Ta, a3 as sa, a4 as Ia, a5 as Sa, a6 as Na, a7 as ea, a8 as Aa, a9 as Oa, aa as Ca, ab as Ga, ac as Da, ad as Pa, ae as ta, af as Ra, ag as La, ah as Ma, ai as oa, aj as ra, ak as ba, al as na, am as Fa, an as ia, ao as la, ap as ga, aq as Ba, ar as ca, as as Ya, at as Ua, au as da, av as ua, aw as Ha, ax as pa, ay as ya, az as Ka, aA as ka, aB as ma, aC as Va, aD as Xa, aE as ha, aF as va, aG as Wa, aH as fa, aI as xa, aJ as za, aK as wa, aL as Za, aM as ja, aN as Qa, aO as qa, aP as Ja, aQ as $a, aR as a_, aS as __, aT as E_, aU as T_, aV as s_, aW as I_, aX as S_, aY as N_, aZ as e_, a_ as A_, a$ as O_, b0 as C_, b1 as G_, b2 as D_, b3 as P_, b4 as t_, b5 as R_, b6 as L_, b7 as M_, b8 as o_, b9 as r_, ba as b_, bb as n_, bc as F_, bd as i_, be as l_, bf as g_, bg as B_, bh as c_, bi as Y_, bj as U_, bk as d_, bl as u_, bm as H_, bn as p_, bo as y_, bp as K_, bq as k_, br as m_, bs as V_, bt as X_, bu as h_, bv as v_, bw as W_, bx as f_, by as x_, bz as z_, bA as w_, bB as Z_, bC as j_, bD as Q_, bE as q_, bF as J_, bG as $_, bH as aE, bI as _E, bJ as EE, bK as TE, bL as sE, bM as IE, bN as SE, bO as NE, bP as eE, bQ as AE, bR as OE, bS as CE, bT as GE, bU as DE, bV as PE, bW as tE, bX as RE, bY as LE, bZ as ME, b_ as oE, b$ as rE, c0 as bE, c1 as nE, c2 as FE, c3 as iE, c4 as lE, c5 as gE, c6 as BE, c7 as cE, c8 as YE, c9 as UE, ca as dE, cb as uE, cc as HE, cd as pE, ce as yE, cf as KE, cg as kE, ch as mE, ci as VE, cj as XE, ck as hE, cl as vE, cm as WE, cn as fE, co as xE } from "./lib-BBctNsms.js";
2
2
  import { createPinia as wE, setActivePinia as ZE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,