@designcrowd/library.brand-page 6.0.2 → 6.0.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 (22) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-Zptj2O2O.js → CreatedOnBrandCrowd-de-de-BctSP4tp.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-Bxmo2Ps9.js → CreatedOnBrandCrowd-en-us-BeNytcxt.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-uytkzFdZ.js → CreatedOnBrandCrowd-es-es-hY12f5TN.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-26tDXsvZ.js → CreatedOnBrandCrowd-fr-ca-C4SCU39P.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-26tDXsvZ.js → CreatedOnBrandCrowd-fr-fr-C4SCU39P.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DuNRkCU5.js → CreatedOnBrandCrowd-pt-br-C5J5kWiD.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DuNRkCU5.js → CreatedOnBrandCrowd-pt-pt-C5J5kWiD.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-D_aekURi.js → CreatedOnDcom-de-de-DXCeZZLg.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-CD3RyS8m.js → CreatedOnDcom-en-us-GeBTaofv.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BXCP18xT.js → CreatedOnDcom-es-es-BiPmv1q-.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BN04YN4o.js → CreatedOnDcom-fr-ca-Cns_iX4-.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-B8-sowys.js → CreatedOnDcom-fr-fr-CC-f_hUR.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-C0MTfZ_l.js → CreatedOnDcom-pt-br-DnhSuPKo.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-BamTt9zq.js → CreatedOnDcom-pt-pt-BCgbUsqY.js} +1 -1
  15. package/lib/src/brand-page-maker/constants/config-settings-constant.js +2 -2
  16. package/lib/src/index.mjs +1 -1
  17. package/lib/src/{lib-dQieWjFg.js → lib-Cw6L6CfQ.js} +4 -4
  18. package/package.json +1 -1
  19. package/src/brand-page-maker/constants/config-settings-constant.ts +2 -2
  20. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
  21. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
  22. 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-dQieWjFg.js";
2
+ import { _ as t } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as t } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as t } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as t } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as t } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as t } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as t } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as e } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as e } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as e } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as e } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as e } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as M } from "./lib-Cw6L6CfQ.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-dQieWjFg.js";
2
+ import { _ as M } from "./lib-Cw6L6CfQ.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -53,14 +53,14 @@ const PADDING_CONTROL_FIELDS = (groupId) => ({
53
53
  type: 'slider',
54
54
  title: contentSettingsTr(`topPaddingTitle`),
55
55
  minLength: 0,
56
- maxLength: 100,
56
+ maxLength: 200,
57
57
  groupId,
58
58
  },
59
59
  bottomPadding: {
60
60
  type: 'slider',
61
61
  title: contentSettingsTr(`bottomPaddingTitle`),
62
62
  minLength: 0,
63
- maxLength: 100,
63
+ maxLength: 200,
64
64
  groupId,
65
65
  },
66
66
  });
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as T, a as E, 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 t, j as G, k as D, l as P, m as R, n as L, o, p as M, q as r, r as n, s as b, t as l, u as F, v as i, w as c, x as g, y as B, 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 m, K as k, L as V, M as X, N as v, O as h, P as f, Q as W, R as x, S as z, T as w, U as Z, V as j, W as q, X as J, Y as Q, Z as $, $ as aa, a0 as _a, a1 as Ta, a2 as Ea, 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 ta, ac as Ga, ad as Da, ae as Pa, af as Ra, ag as La, ah as oa, ai as Ma, aj as ra, ak as na, al as ba, am as la, an as Fa, ao as ia, ap as ca, aq as ga, ar as Ba, 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 ma, aB as ka, aC as Va, aD as Xa, aE as va, aF as ha, aG as fa, aH as Wa, aI as xa, aJ as za, aK as wa, aL as Za, aM as ja, aN as qa, aO as Ja, aP as Qa, aQ as $a, aR as a_, aS as __, aT as T_, aU as E_, 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 t_, b2 as G_, b3 as D_, b4 as P_, b5 as R_, b6 as L_, b7 as o_, b8 as M_, b9 as r_, ba as n_, bb as b_, bc as l_, bd as F_, be as i_, bf as c_, bg as g_, bh as B_, 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 m_, br as k_, bs as V_, bt as X_, bu as v_, bv as h_, bw as f_, bx as W_, by as x_, bz as z_, bA as w_, bB as Z_, bC as j_, bD as q_, bE as J_, bF as Q_, bG as $_, bH as aT, bI as _T, bJ as TT, bK as ET, bL as sT, bM as IT, bN as ST, bO as NT, bP as eT, bQ as AT, bR as OT, bS as CT, bT as tT, bU as GT, bV as DT, bW as PT, bX as RT, bY as LT, bZ as oT, b_ as MT, b$ as rT, c0 as nT, c1 as bT, c2 as lT, c3 as FT, c4 as iT, c5 as cT, c6 as gT, c7 as BT, c8 as YT, c9 as UT, ca as dT, cb as uT, cc as HT, cd as pT, ce as yT, cf as KT, cg as mT, ch as kT, ci as VT, cj as XT, ck as vT, cl as hT, cm as fT, cn as WT, co as xT, cp as zT, cq as wT, cr as ZT, cs as jT, ct as qT, cu as JT } from "./lib-dQieWjFg.js";
1
+ import { A as T, a as E, 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 t, j as G, k as D, l as P, m as R, n as L, o, p as M, q as r, r as n, s as b, t as l, u as F, v as i, w as c, x as g, y as B, 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 m, K as k, L as V, M as X, N as v, O as h, P as f, Q as W, R as x, S as z, T as w, U as Z, V as j, W as q, X as J, Y as Q, Z as $, $ as aa, a0 as _a, a1 as Ta, a2 as Ea, 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 ta, ac as Ga, ad as Da, ae as Pa, af as Ra, ag as La, ah as oa, ai as Ma, aj as ra, ak as na, al as ba, am as la, an as Fa, ao as ia, ap as ca, aq as ga, ar as Ba, 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 ma, aB as ka, aC as Va, aD as Xa, aE as va, aF as ha, aG as fa, aH as Wa, aI as xa, aJ as za, aK as wa, aL as Za, aM as ja, aN as qa, aO as Ja, aP as Qa, aQ as $a, aR as a_, aS as __, aT as T_, aU as E_, 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 t_, b2 as G_, b3 as D_, b4 as P_, b5 as R_, b6 as L_, b7 as o_, b8 as M_, b9 as r_, ba as n_, bb as b_, bc as l_, bd as F_, be as i_, bf as c_, bg as g_, bh as B_, 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 m_, br as k_, bs as V_, bt as X_, bu as v_, bv as h_, bw as f_, bx as W_, by as x_, bz as z_, bA as w_, bB as Z_, bC as j_, bD as q_, bE as J_, bF as Q_, bG as $_, bH as aT, bI as _T, bJ as TT, bK as ET, bL as sT, bM as IT, bN as ST, bO as NT, bP as eT, bQ as AT, bR as OT, bS as CT, bT as tT, bU as GT, bV as DT, bW as PT, bX as RT, bY as LT, bZ as oT, b_ as MT, b$ as rT, c0 as nT, c1 as bT, c2 as lT, c3 as FT, c4 as iT, c5 as cT, c6 as gT, c7 as BT, c8 as YT, c9 as UT, ca as dT, cb as uT, cc as HT, cd as pT, ce as yT, cf as KT, cg as mT, ch as kT, ci as VT, cj as XT, ck as vT, cl as hT, cm as fT, cn as WT, co as xT, cp as zT, cq as wT, cr as ZT, cs as jT, ct as qT, cu as JT } from "./lib-Cw6L6CfQ.js";
2
2
  import { createPinia as $T, setActivePinia as aE } from "pinia";
3
3
  export {
4
4
  T as ABOUT_SECTION_SETTINGS_CONFIG,
@@ -68327,10 +68327,10 @@ const Hx = () => nh || (nh = new KU1()), Vc = (e, t) => YU1(e).then(
68327
68327
  D2(() => n.context.isDesignCom, async () => {
68328
68328
  const M = s9().toLowerCase(), S = n.context.isDesignCom ? "Dcom" : "BrandCrowd";
68329
68329
  try {
68330
- const { default: _ } = await Bx(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-Zptj2O2O.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-Bxmo2Ps9.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-uytkzFdZ.js"), "./watermark/CreatedOnBrandCrowd-fr-ca.vue": () => import("./CreatedOnBrandCrowd-fr-ca-26tDXsvZ.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-26tDXsvZ.js"), "./watermark/CreatedOnBrandCrowd-pt-br.vue": () => import("./CreatedOnBrandCrowd-pt-br-DuNRkCU5.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-DuNRkCU5.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-D_aekURi.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-CD3RyS8m.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-BXCP18xT.js"), "./watermark/CreatedOnDcom-fr-ca.vue": () => import("./CreatedOnDcom-fr-ca-BN04YN4o.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-B8-sowys.js"), "./watermark/CreatedOnDcom-pt-br.vue": () => import("./CreatedOnDcom-pt-br-C0MTfZ_l.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-BamTt9zq.js") }), `./watermark/CreatedOn${S}-${M}.vue`, 3);
68330
+ const { default: _ } = await Bx(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-BctSP4tp.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BeNytcxt.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-hY12f5TN.js"), "./watermark/CreatedOnBrandCrowd-fr-ca.vue": () => import("./CreatedOnBrandCrowd-fr-ca-C4SCU39P.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-C4SCU39P.js"), "./watermark/CreatedOnBrandCrowd-pt-br.vue": () => import("./CreatedOnBrandCrowd-pt-br-C5J5kWiD.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-C5J5kWiD.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-DXCeZZLg.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-GeBTaofv.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-BiPmv1q-.js"), "./watermark/CreatedOnDcom-fr-ca.vue": () => import("./CreatedOnDcom-fr-ca-Cns_iX4-.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-CC-f_hUR.js"), "./watermark/CreatedOnDcom-pt-br.vue": () => import("./CreatedOnDcom-pt-br-DnhSuPKo.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-BCgbUsqY.js") }), `./watermark/CreatedOn${S}-${M}.vue`, 3);
68331
68331
  i.value = _;
68332
68332
  } catch {
68333
- const { default: V } = await Bx(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-Bxmo2Ps9.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-CD3RyS8m.js") }), `./watermark/CreatedOn${S}-en-us.vue`, 3);
68333
+ const { default: V } = await Bx(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BeNytcxt.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-GeBTaofv.js") }), `./watermark/CreatedOn${S}-en-us.vue`, 3);
68334
68334
  i.value = V;
68335
68335
  }
68336
68336
  }, {
@@ -82827,14 +82827,14 @@ const ni = s3("snapshot", {
82827
82827
  type: "slider",
82828
82828
  title: O("topPaddingTitle"),
82829
82829
  minLength: 0,
82830
- maxLength: 100,
82830
+ maxLength: 200,
82831
82831
  groupId: e
82832
82832
  },
82833
82833
  bottomPadding: {
82834
82834
  type: "slider",
82835
82835
  title: O("bottomPaddingTitle"),
82836
82836
  minLength: 0,
82837
- maxLength: 100,
82837
+ maxLength: 200,
82838
82838
  groupId: e
82839
82839
  }
82840
82840
  }), mD = () => ({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "6.0.2",
4
+ "version": "6.0.3",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -217,14 +217,14 @@ const PADDING_CONTROL_FIELDS = (
217
217
  type: 'slider',
218
218
  title: contentSettingsTr(`topPaddingTitle`),
219
219
  minLength: 0,
220
- maxLength: 100,
220
+ maxLength: 200,
221
221
  groupId,
222
222
  },
223
223
  bottomPadding: {
224
224
  type: 'slider',
225
225
  title: contentSettingsTr(`bottomPaddingTitle`),
226
226
  minLength: 0,
227
- maxLength: 100,
227
+ maxLength: 200,
228
228
  groupId,
229
229
  },
230
230
  });
@@ -1,13 +0,0 @@
1
- import type { BrandPageModel } from '../../brand-page/models';
2
- import { BaseMetadataBuilder, type BuilderResult, type MetadataBuilderRequest } from '../models';
3
- import type { Logger } from '../logger';
4
- export interface ReorderPagesPayload {
5
- pageOrder: string[];
6
- }
7
- export declare class ReorderPagesBuilder extends BaseMetadataBuilder<ReorderPagesPayload> {
8
- constructor(request: MetadataBuilderRequest<ReorderPagesPayload>, logger?: Logger);
9
- validateAsync(): Promise<{
10
- errors: string[];
11
- }>;
12
- buildAsync(model: BrandPageModel): Promise<BuilderResult>;
13
- }
@@ -1,49 +0,0 @@
1
- import { BaseMetadataBuilder, } from '../models';
2
- export class ReorderPagesBuilder extends BaseMetadataBuilder {
3
- constructor(request, logger) {
4
- super(request, logger);
5
- }
6
- async validateAsync() {
7
- const errors = [];
8
- const payload = this.request.payload;
9
- if (!payload?.pageOrder?.length) {
10
- errors.push('page_order is required for reorder_pages');
11
- }
12
- return { errors };
13
- }
14
- async buildAsync(model) {
15
- this.log('Build called');
16
- const validation = await this.validateAsync();
17
- if (validation.errors.length) {
18
- return { request: this.request, model, errors: validation.errors };
19
- }
20
- const { pageOrder } = this.request.payload;
21
- // Build pageId → routeId lookup from nav.routes
22
- const pageIdToRouteId = new Map();
23
- for (const route of model.nav.routes) {
24
- pageIdToRouteId.set(route.pageId, route.id);
25
- }
26
- // Build new nav.orders from the flat page_order (array of pageIds)
27
- const newOrders = [];
28
- const seenRouteIds = new Set();
29
- for (const pageId of pageOrder) {
30
- const routeId = pageIdToRouteId.get(pageId);
31
- if (!routeId)
32
- continue;
33
- newOrders.push({ routeId, subRoutes: [] });
34
- seenRouteIds.add(routeId);
35
- }
36
- // Safety: append any routes not mentioned (don't lose pages)
37
- for (const route of model.nav.routes) {
38
- const routeId = pageIdToRouteId.get(route.pageId);
39
- if (routeId && !seenRouteIds.has(routeId)) {
40
- newOrders.push({ routeId, subRoutes: [] });
41
- }
42
- }
43
- model.nav.orders = newOrders;
44
- this.log({
45
- message: `Reordered pages: ${pageOrder.join(', ')}`,
46
- });
47
- return { request: this.request, model };
48
- }
49
- }
@@ -1,80 +0,0 @@
1
- import type { BrandPageModel, NavOrder } from '../../brand-page/models';
2
- import {
3
- BaseMetadataBuilder,
4
- type BuilderResult,
5
- type MetadataBuilderRequest,
6
- } from '../models';
7
- import type { Logger } from '../logger';
8
-
9
- export interface ReorderPagesPayload {
10
- pageOrder: string[];
11
- }
12
-
13
- export class ReorderPagesBuilder extends BaseMetadataBuilder<ReorderPagesPayload> {
14
- constructor(
15
- request: MetadataBuilderRequest<ReorderPagesPayload>,
16
- logger?: Logger,
17
- ) {
18
- super(request, logger);
19
- }
20
-
21
- async validateAsync(): Promise<{ errors: string[] }> {
22
- const errors: string[] = [];
23
- const payload = this.request.payload;
24
-
25
- if (!payload?.pageOrder?.length) {
26
- errors.push('page_order is required for reorder_pages');
27
- }
28
-
29
- return { errors };
30
- }
31
-
32
- async buildAsync(model: BrandPageModel): Promise<BuilderResult> {
33
- this.log('Build called');
34
-
35
- const validation = await this.validateAsync();
36
-
37
- if (validation.errors.length) {
38
- return { request: this.request, model, errors: validation.errors };
39
- }
40
-
41
- const { pageOrder } = this.request.payload!;
42
-
43
- // Build pageId → routeId lookup from nav.routes
44
- const pageIdToRouteId = new Map<string, string>();
45
-
46
- for (const route of model.nav.routes) {
47
- pageIdToRouteId.set(route.pageId, route.id);
48
- }
49
-
50
- // Build new nav.orders from the flat page_order (array of pageIds)
51
- const newOrders: NavOrder[] = [];
52
- const seenRouteIds = new Set<string>();
53
-
54
- for (const pageId of pageOrder) {
55
- const routeId = pageIdToRouteId.get(pageId);
56
-
57
- if (!routeId) continue;
58
-
59
- newOrders.push({ routeId, subRoutes: [] });
60
- seenRouteIds.add(routeId);
61
- }
62
-
63
- // Safety: append any routes not mentioned (don't lose pages)
64
- for (const route of model.nav.routes) {
65
- const routeId = pageIdToRouteId.get(route.pageId);
66
-
67
- if (routeId && !seenRouteIds.has(routeId)) {
68
- newOrders.push({ routeId, subRoutes: [] });
69
- }
70
- }
71
-
72
- model.nav.orders = newOrders;
73
-
74
- this.log({
75
- message: `Reordered pages: ${pageOrder.join(', ')}`,
76
- });
77
-
78
- return { request: this.request, model };
79
- }
80
- }