@designcrowd/library.brand-page 6.0.0-undo-redo-1 → 6.0.0

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 (31) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-Cbi1PSNS.js → CreatedOnBrandCrowd-de-de-BhimVEpD.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-B2ZTei1t.js → CreatedOnBrandCrowd-en-us-CcBSmedR.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-DGz8UfQQ.js → CreatedOnBrandCrowd-es-es-Bywf3OqP.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-C4rUBQUM.js → CreatedOnBrandCrowd-fr-ca-CWpYmK2m.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-C4rUBQUM.js → CreatedOnBrandCrowd-fr-fr-CWpYmK2m.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-Cw7sVI1F.js → CreatedOnBrandCrowd-pt-br-DHM9G51s.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-Cw7sVI1F.js → CreatedOnBrandCrowd-pt-pt-DHM9G51s.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-DPSPgKj7.js → CreatedOnDcom-de-de-BnUSIarY.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-AXXhwSXg.js → CreatedOnDcom-en-us-DzU8X52o.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-DY8bmxi_.js → CreatedOnDcom-es-es-rpp-c_OZ.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-D3QxYtYl.js → CreatedOnDcom-fr-ca-MJ7nCJTH.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-KIt7qTPd.js → CreatedOnDcom-fr-fr-B3USPvBZ.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-Bv4bHhuR.js → CreatedOnDcom-pt-br-DJv7sfEZ.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-NNO1huza.js → CreatedOnDcom-pt-pt-DAPP7A-E.js} +1 -1
  15. package/lib/src/brand-page/utils/logo.util.d.ts +0 -14
  16. package/lib/src/brand-page/utils/logo.util.js +0 -19
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +1 -1
  18. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +7 -6
  19. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +12 -7
  20. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +6 -2
  21. package/lib/src/index.mjs +1 -1
  22. package/lib/src/{lib-IDusUqYG.js → lib-Cfx4mNMR.js} +12442 -12439
  23. package/package.json +2 -2
  24. package/src/brand-page/utils/logo.util.test.ts +1 -54
  25. package/src/brand-page/utils/logo.util.ts +0 -23
  26. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +1 -1
  27. package/src/brand-page-maker/composables/useUndoRedoFlag.ts +13 -7
  28. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +16 -2
  29. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
  30. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
  31. package/src/metadata-builder/builders/reorder-pages-builder.ts +0 -80
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-IDusUqYG.js";
2
+ import { _ as t } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as t } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as t } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as t } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as t } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as t } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as t } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as e } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as e } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as e } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as e } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as e } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as M } from "./lib-Cfx4mNMR.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-IDusUqYG.js";
2
+ import { _ as M } from "./lib-Cfx4mNMR.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -30,20 +30,6 @@ export declare const calculateOptimizedLogoDimensions: (logoData: {
30
30
  width: string;
31
31
  height: string;
32
32
  };
33
- /**
34
- * Resolves the "current" logo image from a brand-page MODEL (the raw,
35
- * deserialized shape — not the live stores, whose contents are wrapped in
36
- * `settings.content`).
37
- *
38
- * Brand-site keeps its logo in the page header; brand-page and brand-contact
39
- * keep it as a logo CONTENT block on the home page — the same `isBrandSite ?
40
- * header : content` split the logo-settings store getters/setter use. This is
41
- * the single source of truth for model-level logo reads: initial load and
42
- * history-restore both call it so the two paths can't drift. They previously
43
- * hard-coded `=== brandPage`, which silently excluded brand-contact and read a
44
- * stale header logo on undo.
45
- */
46
- export declare const getLogoImageFromModel: (model: BrandPageModel) => LogoImageModel | undefined;
47
33
  export declare const recalculateLogoContentDimensions: (pageData: any, editableLogoVariations: {
48
34
  variationId: number;
49
35
  width: number;
@@ -225,25 +225,6 @@ export const calculateOptimizedLogoDimensions = (logoData, currentWidth, current
225
225
  }
226
226
  return { width: currentWidth, height: currentHeight };
227
227
  };
228
- /**
229
- * Resolves the "current" logo image from a brand-page MODEL (the raw,
230
- * deserialized shape — not the live stores, whose contents are wrapped in
231
- * `settings.content`).
232
- *
233
- * Brand-site keeps its logo in the page header; brand-page and brand-contact
234
- * keep it as a logo CONTENT block on the home page — the same `isBrandSite ?
235
- * header : content` split the logo-settings store getters/setter use. This is
236
- * the single source of truth for model-level logo reads: initial load and
237
- * history-restore both call it so the two paths can't drift. They previously
238
- * hard-coded `=== brandPage`, which silently excluded brand-contact and read a
239
- * stale header logo on undo.
240
- */
241
- export const getLogoImageFromModel = (model) => {
242
- if (model.brandPageType === BRAND_PAGE_TYPES.brandSite) {
243
- return model.pageHeaderDesktop?.logoImage;
244
- }
245
- return model.pages?.[0]?.contents?.find(isLogoContent)?.logoImage;
246
- };
247
228
  export const recalculateLogoContentDimensions = async (pageData, editableLogoVariations, logoImage, isPrePurchase) => {
248
229
  try {
249
230
  let logoData;
@@ -196,7 +196,7 @@ export default defineComponent({
196
196
  this.brandPageMakerStore.setIsBrandPageLoaded(true);
197
197
  // Capture baseline for undo/redo when the feature is active for this
198
198
  // session — see useUndoRedoFlag.ts for the gate (LaunchDarkly flag +
199
- // non-admin maker; all three brands).
199
+ // brand-site + non-admin maker).
200
200
  if (useUndoRedoFlag().value) {
201
201
  useHistoryStore().captureBaseline();
202
202
  }
@@ -1,15 +1,16 @@
1
1
  import { type ComputedRef } from 'vue';
2
2
  /**
3
- * Returns whether undo/redo is active for the current maker session. Both
4
- * conditions must hold:
3
+ * Returns whether undo/redo is active for the current maker session. All
4
+ * three conditions must hold:
5
5
  *
6
6
  * 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
7
7
  * the consumer (BrandCrowd.Net / web-renderer) via the
8
8
  * `WebsiteDesignUserFeatures.CanUseUndoRedo` boolean on the ViewModel —
9
- * same precedent as RichTextEditor / GettyVideos / AITextGenerator. The
10
- * one flag governs all three brands (brand-site, brand-page,
11
- * brand-contact) — there is no per-brand gating.
12
- * 2. The session is NOT in admin-maker mode (`userStore.isAdmin`). The
9
+ * same precedent as RichTextEditor / GettyVideos / AITextGenerator.
10
+ * 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
11
+ * only; brand-page (single-page profile) and brand-contact (vCard) are
12
+ * out of scope.
13
+ * 3. The session is NOT in admin-maker mode (`userStore.isAdmin`). The
13
14
  * admin maker uses the same components but a different editing flow
14
15
  * (template authoring) where undo/redo is out of scope.
15
16
  */
@@ -1,20 +1,25 @@
1
1
  import { computed } from 'vue';
2
2
  import { useBrandPageMakerUserStore } from '@brand-page-maker/stores/user';
3
+ import { useBrandPageMakerStore } from '@brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
3
4
  /**
4
- * Returns whether undo/redo is active for the current maker session. Both
5
- * conditions must hold:
5
+ * Returns whether undo/redo is active for the current maker session. All
6
+ * three conditions must hold:
6
7
  *
7
8
  * 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
8
9
  * the consumer (BrandCrowd.Net / web-renderer) via the
9
10
  * `WebsiteDesignUserFeatures.CanUseUndoRedo` boolean on the ViewModel —
10
- * same precedent as RichTextEditor / GettyVideos / AITextGenerator. The
11
- * one flag governs all three brands (brand-site, brand-page,
12
- * brand-contact) — there is no per-brand gating.
13
- * 2. The session is NOT in admin-maker mode (`userStore.isAdmin`). The
11
+ * same precedent as RichTextEditor / GettyVideos / AITextGenerator.
12
+ * 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
13
+ * only; brand-page (single-page profile) and brand-contact (vCard) are
14
+ * out of scope.
15
+ * 3. The session is NOT in admin-maker mode (`userStore.isAdmin`). The
14
16
  * admin maker uses the same components but a different editing flow
15
17
  * (template authoring) where undo/redo is out of scope.
16
18
  */
17
19
  export function useUndoRedoFlag() {
18
20
  const userStore = useBrandPageMakerUserStore();
19
- return computed(() => userStore.features.canUseUndoRedo && !userStore.isAdmin);
21
+ const brandPageMakerStore = useBrandPageMakerStore();
22
+ return computed(() => userStore.features.canUseUndoRedo &&
23
+ brandPageMakerStore.isBrandSite &&
24
+ !userStore.isAdmin);
20
25
  }
@@ -622,7 +622,9 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
622
622
  console.error('brandpage-maker-store: failed to restore logoEdits', error);
623
623
  }
624
624
  }
625
- const logoImage = logoUtil.getLogoImageFromModel(snapshot);
625
+ const logoImage = snapshot.brandPageType === BRAND_PAGE_TYPES.default
626
+ ? snapshot.pages?.[0]?.contents?.find((c) => c.type === 'logo')?.logoImage
627
+ : snapshot.pageHeaderDesktop?.logoImage;
626
628
  if (!logoImage)
627
629
  return;
628
630
  logoSettingsStore.setState({
@@ -846,7 +848,9 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
846
848
  this.setBrandPageType({
847
849
  brandPageType: _brandPageType,
848
850
  });
849
- let logoImage = logoUtil.getLogoImageFromModel(brandPageModel);
851
+ let logoImage = brandPageModel.brandPageType === BRAND_PAGE_TYPES.default
852
+ ? brandPageModel.pages?.[0].contents.find((c) => c.type === 'logo')?.logoImage
853
+ : brandPageModel.pageHeaderDesktop?.logoImage;
850
854
  if (!logoImage?.logoDraftToken) {
851
855
  logoImage = logoUtil.safeGetLogoImageFromLogoImageUrl(logoVariationImageUrls[0]);
852
856
  }
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 t, k as D, l as P, m as R, n as L, o as M, p as o, q as r, r as n, s as b, t as F, u as l, v as i, 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 v, O as h, 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 ta, ad as Da, ae as Pa, af as Ra, ag as La, ah as Ma, ai as oa, aj as ra, ak as na, al as ba, am as Fa, an as la, ao as ia, 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 va, aF as ha, 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 t_, b3 as D_, b4 as P_, b5 as R_, b6 as L_, b7 as M_, b8 as o_, b9 as r_, ba as n_, bb as b_, bc as F_, bd as l_, be as i_, 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 v_, bv as h_, 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 tE, bV as DE, bW as PE, bX as RE, bY as LE, bZ as ME, b_ as oE, b$ as rE, c0 as nE, c1 as bE, c2 as FE, c3 as lE, c4 as iE, 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 vE, cl as hE, cm as WE, cn as fE, co as xE, cp as zE, cq as wE, cr as ZE } from "./lib-IDusUqYG.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 t, k as D, l as P, m as R, n as L, o as M, p as o, q as r, r as n, s as b, t as F, u as l, v as i, 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 v, O as h, 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 ta, ad as Da, ae as Pa, af as Ra, ag as La, ah as Ma, ai as oa, aj as ra, ak as na, al as ba, am as Fa, an as la, ao as ia, 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 va, aF as ha, 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 t_, b3 as D_, b4 as P_, b5 as R_, b6 as L_, b7 as M_, b8 as o_, b9 as r_, ba as n_, bb as b_, bc as F_, bd as l_, be as i_, 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 v_, bv as h_, 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 tE, bV as DE, bW as PE, bX as RE, bY as LE, bZ as ME, b_ as oE, b$ as rE, c0 as nE, c1 as bE, c2 as FE, c3 as lE, c4 as iE, 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 vE, cl as hE, cm as WE, cn as fE, co as xE, cp as zE, cq as wE, cr as ZE } from "./lib-Cfx4mNMR.js";
2
2
  import { createPinia as qE, setActivePinia as QE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,