@designcrowd/library.brand-page 5.17.25-undo-4 → 5.17.25-undo-6
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-Bfno64hd.js → CreatedOnBrandCrowd-de-de-Tz4la--g.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-D_vCn5Pl.js → CreatedOnBrandCrowd-en-us-BwX6VQ7n.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-Dbsv2mXS.js → CreatedOnBrandCrowd-es-es-D-X5dqmk.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-C7cjAdAT.js → CreatedOnBrandCrowd-fr-ca-C26oV3hg.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-C7cjAdAT.js → CreatedOnBrandCrowd-fr-fr-C26oV3hg.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-qkmkw32p.js → CreatedOnBrandCrowd-pt-br-wuMDIU99.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-qkmkw32p.js → CreatedOnBrandCrowd-pt-pt-wuMDIU99.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CQUNS-WQ.js → CreatedOnDcom-de-de-NV--j2Ly.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-DSTor88S.js → CreatedOnDcom-en-us-CoQldVno.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-B_gzXzCR.js → CreatedOnDcom-es-es-BDYtM7OQ.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DskYXGaJ.js → CreatedOnDcom-fr-ca-DqeHK60l.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-B3A-09VT.js → CreatedOnDcom-fr-fr-CBEBKPx2.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-EhBegIrb.js → CreatedOnDcom-pt-br-U4l3IbG5.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BkWfCkfb.js → CreatedOnDcom-pt-pt-zx47Q7Gm.js} +1 -1
- package/lib/src/brand-page-maker/stores/history/history-store.js +32 -1
- package/lib/src/brand-page-maker/stores/user/user-store.js +1 -1
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-qbF5b3zi.js → lib-LWqKxGvV.js} +3957 -3937
- package/package.json +1 -1
- package/src/brand-page-maker/stores/history/history-store.test.ts +105 -0
- package/src/brand-page-maker/stores/history/history-store.ts +37 -1
- package/src/brand-page-maker/stores/user/user-store.ts +1 -1
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +57 -35
|
@@ -100,9 +100,32 @@ export const useHistoryStore = defineStore('history', () => {
|
|
|
100
100
|
// Empty paragraph forms TipTap emits when an editor mounts on an empty
|
|
101
101
|
// string. Treated as equivalent to `""` for dedup.
|
|
102
102
|
const EMPTY_RTE_HTML = /^<p(\s[^>]*)?>(<br\s*\/?>)?<\/p>$/;
|
|
103
|
+
// TipTap's default-hydration shape: a single <p> (with optional align
|
|
104
|
+
// attr) containing the original plain text, optionally wrapped in
|
|
105
|
+
// default-styled <span> (font-family / font-size / color) and/or
|
|
106
|
+
// <mark> (highlight) tags. The inner capture intentionally rejects any
|
|
107
|
+
// string that itself contains `<` or `>` so that real formatting tags
|
|
108
|
+
// — `<strong>`, `<em>`, `<a>`, nested spans with non-default styles —
|
|
109
|
+
// are preserved as a real diff rather than collapsed.
|
|
110
|
+
const RTE_DEFAULT_HYDRATION = /^<p(\s[^>]*)?>(<span(\s[^>]*)?>)?(<mark(\s[^>]*)?>)?([^<>]*)(<\/mark>)?(<\/span>)?<\/p>$/;
|
|
103
111
|
function isEmptyRteHtml(value) {
|
|
104
112
|
return typeof value === 'string' && EMPTY_RTE_HTML.test(value);
|
|
105
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* If `value` is TipTap's default-hydration wrapper around a plain text
|
|
116
|
+
* (no inline formatting tags), return the bare inner text. Otherwise
|
|
117
|
+
* return the original string. This collapses the BP-5506 phantom where
|
|
118
|
+
* opening a content sidebar mounts every RTE editor at once and writes
|
|
119
|
+
* back wrapped HTML with no user-visible delta.
|
|
120
|
+
*/
|
|
121
|
+
function canonicalizeRteString(value) {
|
|
122
|
+
if (EMPTY_RTE_HTML.test(value))
|
|
123
|
+
return '';
|
|
124
|
+
const match = value.match(RTE_DEFAULT_HYDRATION);
|
|
125
|
+
if (!match)
|
|
126
|
+
return value;
|
|
127
|
+
return match[6] ?? '';
|
|
128
|
+
}
|
|
106
129
|
function normalizeNode(node) {
|
|
107
130
|
if (Array.isArray(node))
|
|
108
131
|
return node.map(normalizeNode);
|
|
@@ -110,12 +133,20 @@ export const useHistoryStore = defineStore('history', () => {
|
|
|
110
133
|
return node;
|
|
111
134
|
const out = {};
|
|
112
135
|
for (const key of Object.keys(node)) {
|
|
113
|
-
|
|
136
|
+
let v = node[key];
|
|
114
137
|
// Strip the template-modified flag — it's meta-state that flips on
|
|
115
138
|
// first edit gesture (e.g. clicking into a panel) and does not
|
|
116
139
|
// represent a user-visible change.
|
|
117
140
|
if (key === 'isModifiedAfterTemplateApplied')
|
|
118
141
|
continue;
|
|
142
|
+
// Collapse RTE default-hydration wrappers down to the plain text
|
|
143
|
+
// they wrap. Plain "X" and `<p style="..."><span ...><mark ...>X
|
|
144
|
+
// </mark></span></p>` share the same canonical "X" so a sidebar
|
|
145
|
+
// open that mounts every editor at once doesn't generate phantom
|
|
146
|
+
// undo steps.
|
|
147
|
+
if (typeof v === 'string') {
|
|
148
|
+
v = canonicalizeRteString(v);
|
|
149
|
+
}
|
|
119
150
|
// Empty TipTap paragraphs collapse to "" — and an empty string is
|
|
120
151
|
// equivalent to the key being absent (JSON.stringify drops `undefined`),
|
|
121
152
|
// so skip the key entirely. Otherwise the normalizer would emit
|
|
@@ -20,7 +20,7 @@ export const useBrandPageMakerUserStore = defineStore('brandPageMakerUser', {
|
|
|
20
20
|
canUseAITextGenerator: false,
|
|
21
21
|
canUseGoogleAdsense: false,
|
|
22
22
|
googleAdsenseEnabled: false,
|
|
23
|
-
canUseUndoRedo:
|
|
23
|
+
canUseUndoRedo: true,
|
|
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-
|
|
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-LWqKxGvV.js";
|
|
2
2
|
import { createPinia as wE, setActivePinia as ZE } from "pinia";
|
|
3
3
|
export {
|
|
4
4
|
E as ABOUT_SECTION_SETTINGS_CONFIG,
|