@designcrowd/library.brand-page 5.17.25-undo-3 → 5.17.25-undo-4

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 (22) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-xR_8611Z.js → CreatedOnBrandCrowd-de-de-Bfno64hd.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-CrKMPM86.js → CreatedOnBrandCrowd-en-us-D_vCn5Pl.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-C7lJoCwP.js → CreatedOnBrandCrowd-es-es-Dbsv2mXS.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-B2P1kNsi.js → CreatedOnBrandCrowd-fr-ca-C7cjAdAT.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-B2P1kNsi.js → CreatedOnBrandCrowd-fr-fr-C7cjAdAT.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-Cg9ulkXK.js → CreatedOnBrandCrowd-pt-br-qkmkw32p.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-Cg9ulkXK.js → CreatedOnBrandCrowd-pt-pt-qkmkw32p.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-RKjXZKTE.js → CreatedOnDcom-de-de-CQUNS-WQ.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-Bma4WSgm.js → CreatedOnDcom-en-us-DSTor88S.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-CAqF8RQd.js → CreatedOnDcom-es-es-B_gzXzCR.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BZzsaA-O.js → CreatedOnDcom-fr-ca-DskYXGaJ.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-lB4hUGDb.js → CreatedOnDcom-fr-fr-B3A-09VT.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-dD3iqhZb.js → CreatedOnDcom-pt-br-EhBegIrb.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-80E4SvnQ.js → CreatedOnDcom-pt-pt-BkWfCkfb.js} +1 -1
  15. package/lib/src/brand-page-maker/stores/history/history-store.js +87 -2
  16. package/lib/src/brand-page-maker/stores/user/user-store.js +1 -1
  17. package/lib/src/index.mjs +1 -1
  18. package/lib/src/{lib-BBctNsms.js → lib-qbF5b3zi.js} +3682 -3650
  19. package/package.json +1 -1
  20. package/src/brand-page-maker/stores/history/history-store.test.ts +136 -0
  21. package/src/brand-page-maker/stores/history/history-store.ts +101 -1
  22. package/src/brand-page-maker/stores/user/user-store.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BBctNsms.js";
2
+ import { _ as t } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as t } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as t } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as t } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as t } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as t } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as t } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as e } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as e } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as e } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as e } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as e } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as M } from "./lib-qbF5b3zi.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-BBctNsms.js";
2
+ import { _ as M } from "./lib-qbF5b3zi.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -80,6 +80,80 @@ export const useHistoryStore = defineStore('history', () => {
80
80
  return null;
81
81
  }
82
82
  }
83
+ /**
84
+ * Normalize a snapshot for the dedup byte-compare. Strips/canonicalizes
85
+ * fields that get mutated by sidebar-open reactive cascades but aren't
86
+ * user-visible edits — without this, opening a content panel produces an
87
+ * undo step that "does nothing" when replayed.
88
+ *
89
+ * Known phantom sources (BP-5506):
90
+ * - TipTap RTE writing back its empty-paragraph default on first mount
91
+ * (e.g. `""` → `<p style="text-align: center;"></p>`).
92
+ * - Lazy hydration of `textStyle` fields (`fontSize`, `letterSpacing`)
93
+ * when a content settings panel computes resolved values from
94
+ * `textStyleType` and writes them onto the model.
95
+ * - `isModifiedAfterTemplateApplied` flipping on first edit gesture.
96
+ *
97
+ * Used ONLY for dedup comparison. Stored snapshots remain unchanged so
98
+ * `applyHistorySnapshot` always sees the real state.
99
+ */
100
+ // Empty paragraph forms TipTap emits when an editor mounts on an empty
101
+ // string. Treated as equivalent to `""` for dedup.
102
+ const EMPTY_RTE_HTML = /^<p(\s[^>]*)?>(<br\s*\/?>)?<\/p>$/;
103
+ function isEmptyRteHtml(value) {
104
+ return typeof value === 'string' && EMPTY_RTE_HTML.test(value);
105
+ }
106
+ function normalizeNode(node) {
107
+ if (Array.isArray(node))
108
+ return node.map(normalizeNode);
109
+ if (node === null || typeof node !== 'object')
110
+ return node;
111
+ const out = {};
112
+ for (const key of Object.keys(node)) {
113
+ const v = node[key];
114
+ // Strip the template-modified flag — it's meta-state that flips on
115
+ // first edit gesture (e.g. clicking into a panel) and does not
116
+ // represent a user-visible change.
117
+ if (key === 'isModifiedAfterTemplateApplied')
118
+ continue;
119
+ // Empty TipTap paragraphs collapse to "" — and an empty string is
120
+ // equivalent to the key being absent (JSON.stringify drops `undefined`),
121
+ // so skip the key entirely. Otherwise the normalizer would emit
122
+ // `"description": ""` here while the baseline snapshot — captured when
123
+ // `description` was `undefined` — has no `description` key at all,
124
+ // and the two normalized strings would differ.
125
+ if (isEmptyRteHtml(v) || v === '')
126
+ continue;
127
+ // textStyle / descriptionStyle / titleStyle / *Style objects:
128
+ // strip lazily-hydrated fields that get filled in when the settings
129
+ // panel computes resolved values from `textStyleType`.
130
+ if (v !== null &&
131
+ typeof v === 'object' &&
132
+ !Array.isArray(v) &&
133
+ /Style$/.test(key)) {
134
+ const styleObj = v;
135
+ const cleanedStyle = {};
136
+ for (const sk of Object.keys(styleObj)) {
137
+ if (sk === 'fontSize' || sk === 'letterSpacing')
138
+ continue;
139
+ cleanedStyle[sk] = normalizeNode(styleObj[sk]);
140
+ }
141
+ out[key] = cleanedStyle;
142
+ continue;
143
+ }
144
+ out[key] = normalizeNode(v);
145
+ }
146
+ return out;
147
+ }
148
+ function normalizeSnapshotForDedup(snapshotStr) {
149
+ try {
150
+ const parsed = JSON.parse(snapshotStr);
151
+ return JSON.stringify(normalizeNode(parsed));
152
+ }
153
+ catch {
154
+ return snapshotStr;
155
+ }
156
+ }
83
157
  /**
84
158
  * Commit a new entry into the stack at the current pointer position.
85
159
  *
@@ -106,8 +180,19 @@ export const useHistoryStore = defineStore('history', () => {
106
180
  */
107
181
  function commitEntry(args) {
108
182
  const current = entries.value[currentIndex.value];
109
- if (current && current.snapshot === args.snapshot)
110
- return 'noop';
183
+ if (current) {
184
+ if (current.snapshot === args.snapshot)
185
+ return 'noop';
186
+ // Phantom-edit dedup: normalize both snapshots to ignore
187
+ // sidebar-open reactive cascades (RTE empty-paragraph init, lazy
188
+ // textStyle hydration, isModifiedAfterTemplateApplied flips). If
189
+ // they're equal after normalization, this capture has no
190
+ // user-visible diff vs. the entry at the pointer.
191
+ if (normalizeSnapshotForDedup(current.snapshot) ===
192
+ normalizeSnapshotForDedup(args.snapshot)) {
193
+ return 'noop';
194
+ }
195
+ }
111
196
  if (args.snapshot.length > MAX_ENTRY_BYTES) {
112
197
  eventTracker.sendHistoryOversizedEvent({
113
198
  attempted_bytes: args.snapshot.length,
@@ -20,7 +20,7 @@ export const useBrandPageMakerUserStore = defineStore('brandPageMakerUser', {
20
20
  canUseAITextGenerator: false,
21
21
  canUseGoogleAdsense: false,
22
22
  googleAdsenseEnabled: false,
23
- canUseUndoRedo: true,
23
+ canUseUndoRedo: false,
24
24
  },
25
25
  emailAddress: '',
26
26
  hasPremiumSubscription: false,
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-BBctNsms.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-qbF5b3zi.js";
2
2
  import { createPinia as wE, setActivePinia as ZE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,