@designcrowd/library.brand-page 5.16.46 → 5.16.47-ast-fix-ai

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 (72) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-uiIr5kLt.js → CreatedOnBrandCrowd-de-de-DQnxSq9A.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-ZxmDyB2L.js → CreatedOnBrandCrowd-en-us-43F2UnHe.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-Dy0prqYb.js → CreatedOnBrandCrowd-es-es-DW1Kbbym.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-ptYivmhP.js → CreatedOnBrandCrowd-fr-ca-DpRHXw-1.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-ptYivmhP.js → CreatedOnBrandCrowd-fr-fr-DpRHXw-1.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-CJ2KmyN9.js → CreatedOnBrandCrowd-pt-br-CfD26nfp.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-CJ2KmyN9.js → CreatedOnBrandCrowd-pt-pt-CfD26nfp.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-BOKzyd7W.js → CreatedOnDcom-de-de-eVxceN_d.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-DUn1EGFC.js → CreatedOnDcom-en-us-CfFzixTM.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-CWmC3YRV.js → CreatedOnDcom-es-es-CSWR2SlN.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-_UTCwQgn.js → CreatedOnDcom-fr-ca-DUwe4G8i.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-DYUvSYKz.js → CreatedOnDcom-fr-fr-qx_WdTOY.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-o2kCzJWH.js → CreatedOnDcom-pt-br-Dplb7Q_I.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-JLuH_BY3.js → CreatedOnDcom-pt-pt-DxR8BYYd.js} +1 -1
  15. package/lib/src/brand-page/components/page/Page.stories.js +3 -0
  16. package/lib/src/brand-page/models/index.d.ts +18 -0
  17. package/lib/src/brand-page/models/index.js +12 -0
  18. package/lib/src/brand-page/utils/migration/migration-12.d.ts +2 -0
  19. package/lib/src/brand-page/utils/migration/migration-12.js +30 -0
  20. package/lib/src/brand-page/utils/migration.util.js +6 -0
  21. package/lib/src/brand-page/utils/route.util.d.ts +1 -1
  22. package/lib/src/brand-page/utils/view-model.util.d.ts +5 -2
  23. package/lib/src/brand-page/utils/view-model.util.js +26 -0
  24. package/lib/src/brand-page/view-models.d.ts +28 -0
  25. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -1
  26. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
  27. package/lib/src/brand-page-maker/components/preview/Preview.stories.js +4 -0
  28. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +17 -2
  29. package/lib/src/index.mjs +110 -109
  30. package/lib/src/{lib-CBpRmget.js → lib-NoqvEZWV.js} +14386 -14148
  31. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -1
  32. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
  33. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
  34. package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.d.ts +1 -1
  35. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -1
  36. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
  37. package/lib/src/shared/page-navigation/store/page-navigation-store.d.ts +18 -0
  38. package/lib/src/shared/page-navigation/store/page-navigation-store.js +118 -0
  39. package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +15 -1
  40. package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.js +15 -1
  41. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +15 -1
  42. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.js +31 -0
  43. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -1
  44. package/lib/src/shared/page-settings/models.d.ts +1 -0
  45. package/lib/src/shared/page-settings/store/page-settings-store.d.ts +1 -1
  46. package/lib/src/shared/page-settings/store/page-settings-store.js +3 -1
  47. package/lib/src/shared/template-settings/store/template-settings-store.js +17 -2
  48. package/package.json +1 -1
  49. package/src/brand-page/components/page/Page.stories.ts +3 -0
  50. package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +1 -0
  51. package/src/brand-page/models/index.ts +30 -0
  52. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +57 -3
  53. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +4 -0
  54. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +8 -0
  55. package/src/brand-page/utils/logo.util.test.ts +5 -0
  56. package/src/brand-page/utils/migration/migration-12.ts +43 -0
  57. package/src/brand-page/utils/migration.util.test.ts +15 -0
  58. package/src/brand-page/utils/migration.util.ts +6 -0
  59. package/src/brand-page/utils/route.util.ts +1 -1
  60. package/src/brand-page/utils/view-model.util.ts +81 -0
  61. package/src/brand-page/view-models.ts +33 -0
  62. package/src/brand-page-maker/components/preview/Preview.stories.ts +4 -0
  63. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +2 -2
  64. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +22 -1
  65. package/src/shared/logo-settings/store/logo-settings-store.test.ts +2 -0
  66. package/src/shared/page-navigation/store/page-navigation-store.ts +168 -0
  67. package/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.ts +18 -1
  68. package/src/shared/page-settings/components/page-settings/PageSettings.mixin.ts +55 -0
  69. package/src/shared/page-settings/models.ts +1 -0
  70. package/src/shared/page-settings/store/page-settings-store.test.ts +1 -0
  71. package/src/shared/page-settings/store/page-settings-store.ts +6 -2
  72. package/src/shared/template-settings/store/template-settings-store.ts +22 -2
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CBpRmget.js";
2
+ import { _ as t } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CBpRmget.js";
2
+ import { _ as t } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CBpRmget.js";
2
+ import { _ as t } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CBpRmget.js";
2
+ import { _ as t } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CBpRmget.js";
2
+ import { _ as t } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CBpRmget.js";
2
+ import { _ as t } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CBpRmget.js";
2
+ import { _ as t } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CBpRmget.js";
2
+ import { _ as e } from "./lib-NoqvEZWV.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CBpRmget.js";
2
+ import { _ as e } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CBpRmget.js";
2
+ import { _ as e } from "./lib-NoqvEZWV.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CBpRmget.js";
2
+ import { _ as e } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-CBpRmget.js";
2
+ import { _ as e } from "./lib-NoqvEZWV.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-CBpRmget.js";
2
+ import { _ as M } from "./lib-NoqvEZWV.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-CBpRmget.js";
2
+ import { _ as M } from "./lib-NoqvEZWV.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -32,6 +32,9 @@ const viewModel = {
32
32
  isSavingEnabled: true,
33
33
  hideBranding: false,
34
34
  },
35
+ nav: {
36
+ navItems: [],
37
+ },
35
38
  };
36
39
  const defaultSampleArgs = {
37
40
  viewModel,
@@ -434,9 +434,26 @@ export declare class PageModel {
434
434
  title: string;
435
435
  slug: string;
436
436
  contents: Content[];
437
+ id: string;
437
438
  isHidden?: boolean;
438
439
  constructor(options: Partial<Omit<PageModel, 'contents'>> & Partial<Pick<PageModel, 'contents'>>);
439
440
  }
441
+ export interface NavRoute {
442
+ id: string;
443
+ pageId: string;
444
+ pageSlug: string;
445
+ isHidden: boolean;
446
+ displayName: string;
447
+ }
448
+ export interface NavOrder {
449
+ routeId: string;
450
+ subRoutes: NavOrder[];
451
+ }
452
+ export declare class NavModel {
453
+ orders: NavOrder[];
454
+ routes: NavRoute[];
455
+ constructor(options?: Partial<NavModel>);
456
+ }
440
457
  type AbstractPageHeaderStylesType = Partial<AbstractPageHeaderStyles>;
441
458
  export declare abstract class AbstractPageHeaderStyles {
442
459
  displayStyle: HeaderDisplayStyle;
@@ -538,6 +555,7 @@ export declare class BrandPageModel {
538
555
  pageFooterMobile: PageFooterMobile;
539
556
  pageFooterDesktop: PageFooterDesktop;
540
557
  pages: PageModel[];
558
+ nav: NavModel;
541
559
  isModifiedAfterTemplateApplied?: boolean;
542
560
  brandPageType?: BrandPageType;
543
561
  faviconUrl?: string;
@@ -168,12 +168,22 @@ export class PageModel {
168
168
  title;
169
169
  slug;
170
170
  contents;
171
+ id;
171
172
  isHidden;
172
173
  constructor(options) {
173
174
  this.title = options.title ?? '';
174
175
  this.slug = options.slug ?? '';
175
176
  this.contents = options.contents || [];
176
177
  this.isHidden = options.isHidden ?? false;
178
+ this.id = options.id || '';
179
+ }
180
+ }
181
+ export class NavModel {
182
+ orders;
183
+ routes;
184
+ constructor(options = {}) {
185
+ this.orders = options.orders || [];
186
+ this.routes = options.routes || [];
177
187
  }
178
188
  }
179
189
  export class AbstractPageHeaderStyles {
@@ -403,6 +413,7 @@ export class BrandPageModel {
403
413
  // @ts-expect-error should be initialised in constructor
404
414
  pageFooterDesktop;
405
415
  pages;
416
+ nav;
406
417
  isModifiedAfterTemplateApplied;
407
418
  brandPageType;
408
419
  faviconUrl;
@@ -476,5 +487,6 @@ export class BrandPageModel {
476
487
  this.cookieOptions = options.cookieOptions;
477
488
  this.saveContactSettings = options.saveContactSettings;
478
489
  this.paymentConfig = options.paymentConfig;
490
+ this.nav = new NavModel(options.nav);
479
491
  }
480
492
  }
@@ -0,0 +1,2 @@
1
+ import type { MigrationData } from '../migration.util';
2
+ export declare const migration12: (migrationResult: MigrationData) => Promise<MigrationData>;
@@ -0,0 +1,30 @@
1
+ import { v4 as uuid } from 'uuid';
2
+ import { NavModel } from '../../models';
3
+ export const migration12 = async (migrationResult) => {
4
+ const { brandPageModel } = migrationResult;
5
+ const pages = brandPageModel.pages;
6
+ // Add uuid to each page as id
7
+ pages.forEach((page) => {
8
+ if (!page.id) {
9
+ page.id = uuid();
10
+ }
11
+ });
12
+ const routes = [];
13
+ const orders = [];
14
+ pages.forEach((page) => {
15
+ const routeId = uuid();
16
+ routes.push({
17
+ id: routeId,
18
+ pageId: page.id,
19
+ pageSlug: page.slug,
20
+ isHidden: page.isHidden ?? false,
21
+ displayName: page.title,
22
+ });
23
+ orders.push({
24
+ routeId,
25
+ subRoutes: [],
26
+ });
27
+ });
28
+ brandPageModel.nav = new NavModel({ routes, orders });
29
+ return migrationResult;
30
+ };
@@ -13,6 +13,7 @@ import { migration08 } from './migration/migration-08';
13
13
  import { migration09 } from './migration/migration-09';
14
14
  import { migration10 } from './migration/migration-10';
15
15
  import { migration11 } from './migration/migration-11';
16
+ import { migration12 } from './migration/migration-12';
16
17
  const MIGRATION_TABLE = [
17
18
  {
18
19
  version: 1,
@@ -85,6 +86,11 @@ const MIGRATION_TABLE = [
85
86
  migrateFn: migration11,
86
87
  description: 'Remove backgroundColorEnabled flag from page headers',
87
88
  },
89
+ {
90
+ version: 12,
91
+ migrateFn: migration12,
92
+ description: 'Migrating nav model to support sub nav feature',
93
+ },
88
94
  ];
89
95
  export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
90
96
  export const migrateBrandPageModel = async (brandPageModel, options) => {
@@ -5,4 +5,4 @@ export declare const getRouteParamsByPage: (isCustomDomain: boolean, brandPageSl
5
5
  slug: string;
6
6
  pageSlug: string;
7
7
  };
8
- export declare const getRouteNameByPageIndex: (isCustomDomain: boolean, pageIndex: number) => string;
8
+ export declare const getRouteNameByPageIndex: (isCustomDomain: boolean, pageIndex?: number) => string;
@@ -1,5 +1,5 @@
1
- import type { ImageContent, ProfileContent, TextContent, PageStyles, Content, BrandPageModel, ImageGalleryContent, GalleryStyles, BannerSectionContent, ImagesSectionContent, BrandPageType, PageHeaderDesktop, PageFooterDesktop, PageFooterMobile, PageHeaderMobile, LogoImageModel, LogoTemplateImageModel, BookingSectionContent } from '../models';
2
- import type { ImageViewModel, LogoViewModel, ProfileViewModel, TextViewModel, ContentViewModel, BrandPageViewModel, ImageGalleryViewModel, PageViewModel, BannerSectionViewModel, PageHeaderViewModel, PageFooterViewModel, TextImageSectionViewModel, BookingSectionViewModel, PageStylesViewModel } from '../view-models';
1
+ import type { ImageContent, ProfileContent, TextContent, PageStyles, Content, BrandPageModel, ImageGalleryContent, GalleryStyles, BannerSectionContent, ImagesSectionContent, BrandPageType, PageHeaderDesktop, PageFooterDesktop, PageFooterMobile, PageHeaderMobile, LogoImageModel, LogoTemplateImageModel, BookingSectionContent, NavModel } from '../models';
2
+ import type { ImageViewModel, LogoViewModel, ProfileViewModel, TextViewModel, ContentViewModel, BrandPageViewModel, ImageGalleryViewModel, PageViewModel, BannerSectionViewModel, PageHeaderViewModel, PageFooterViewModel, TextImageSectionViewModel, BookingSectionViewModel, PageStylesViewModel, NavViewModel } from '../view-models';
3
3
  export declare const applyViewModelTextStyles: <T extends ContentViewModel>(content: T, styles: PageStyles) => T;
4
4
  export declare const mapToImageViewModel: (content: ImageContent) => ImageViewModel;
5
5
  export declare const mapToImageGalleryViewModel: (content: ImageGalleryContent, globalStyles: GalleryStyles) => ImageGalleryViewModel;
@@ -8,12 +8,15 @@ export declare const mapToTextViewModel: (content: TextContent, styles: PageStyl
8
8
  export declare const mapToBannerSectionViewModel: (content: BannerSectionContent, styles: PageStyles, options: ViewModelMappingOptions) => BannerSectionViewModel;
9
9
  export declare const mapToImagesSectionViewModel: (content: ImagesSectionContent, styles: PageStyles, brandPageType: BrandPageType) => TextImageSectionViewModel;
10
10
  export declare const mapToBookingSectionViewModel: (content: BookingSectionContent, styles: PageStyles) => BookingSectionViewModel;
11
+ export declare const mapToNavViewModel: (nav: NavModel, brandPageSlug?: string, isCustomDomain?: boolean) => NavViewModel;
11
12
  export declare const mapToPageStyleViewModel: (pageStyles: PageStyles, options: ViewModelMappingOptions) => PageStylesViewModel;
12
13
  export declare const mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[], useOldLogoRenderSize?: boolean) => PageHeaderViewModel;
13
14
  export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles, useOldLogoRenderSize?: boolean) => PageFooterViewModel;
14
15
  export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType, options: ViewModelMappingOptions) => (content: Content) => ContentViewModel | undefined;
15
16
  interface ViewModelMappingOptions {
16
17
  useOldLogoRenderSize?: boolean;
18
+ isCustomDomain?: boolean;
19
+ brandPageSlug?: string;
17
20
  getVideoUrls?: (token: string) => {
18
21
  videoUrl: string;
19
22
  previewImageUrl: string;
@@ -10,9 +10,11 @@ import { generateGoogleFontUrl } from './font-loader.util';
10
10
  import { isValidSvgUrl } from './image.util';
11
11
  import { isLogoContent } from './model.util';
12
12
  import { getBoxShadowValue } from './button.util';
13
+ import { getRouteNameByPageIndex, getRouteParamsByPage } from './route.util';
13
14
  const BUTTON_BORDER_RADIUS = '9999px';
14
15
  const CONTENT_BORDER_RADIUS = '48px';
15
16
  const PROFILE_PADDING_TOP = '1rem';
17
+ const MAX_SUB_NAV_DEPTH = 1;
16
18
  const applyContentBorderRadius = (styles) => {
17
19
  return {
18
20
  ...styles,
@@ -604,6 +606,27 @@ export const mapToBookingSectionViewModel = (content, styles) => {
604
606
  isFullWidth: true,
605
607
  }, styles);
606
608
  };
609
+ // Recursively build the nav item view model for each page/sub page in the nav
610
+ const buildNavItemViewModel = (order, routes, parentPath, isFirstPage, brandPageSlug, isCustomDomain, depth = 0) => {
611
+ const route = routes.find((r) => r.id === order.routeId);
612
+ const pageSlug = route?.pageSlug ?? '';
613
+ const relativePath = parentPath ? `${parentPath}/${pageSlug}` : pageSlug;
614
+ return {
615
+ displayName: route?.displayName ?? '',
616
+ routeName: getRouteNameByPageIndex(Boolean(isCustomDomain), isFirstPage ? 0 : 9999),
617
+ routeParams: getRouteParamsByPage(Boolean(isCustomDomain), brandPageSlug ?? '', pageSlug),
618
+ relativePath,
619
+ isHidden: route?.isHidden ?? false,
620
+ nestedNavItems: depth >= MAX_SUB_NAV_DEPTH
621
+ ? []
622
+ : order.subRoutes.map((subRoute) => buildNavItemViewModel(subRoute, routes, relativePath, false, brandPageSlug, isCustomDomain, depth + 1)),
623
+ };
624
+ };
625
+ export const mapToNavViewModel = (nav, brandPageSlug, isCustomDomain) => {
626
+ return {
627
+ navItems: nav.orders.map((order, idx) => buildNavItemViewModel(order, nav.routes, '', idx === 0, brandPageSlug, isCustomDomain)),
628
+ };
629
+ };
607
630
  export const mapToPageStyleViewModel = (pageStyles, options) => {
608
631
  return {
609
632
  backgroundStylesViewModel: mapBackgroundStylesToViewModel(pageStyles.backgroundStyles, options),
@@ -781,14 +804,17 @@ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, s
781
804
  return {
782
805
  title: p.title,
783
806
  slug: p.slug,
807
+ id: p.id,
784
808
  contents,
785
809
  isHidden: Boolean(p?.isHidden),
786
810
  };
787
811
  });
812
+ const nav = mapToNavViewModel(model.nav, options.brandPageSlug, options.isCustomDomain);
788
813
  return {
789
814
  brandPageToken,
790
815
  pages,
791
816
  showBrandCrowdLogo,
817
+ nav,
792
818
  styles: mapToPageStyleViewModel(model.styles, options),
793
819
  headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages, options.useOldLogoRenderSize),
794
820
  headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages, options.useOldLogoRenderSize),
@@ -7,6 +7,7 @@ export interface ContentViewModel {
7
7
  role: ContentType;
8
8
  }
9
9
  export interface PageViewModel {
10
+ id: string;
10
11
  title: string;
11
12
  slug: string;
12
13
  contents: ContentViewModel[];
@@ -149,11 +150,38 @@ export interface PageStylesViewModel {
149
150
  textStyles: TextStyles;
150
151
  galleryStyles: GalleryStyles;
151
152
  }
153
+ export interface NavRouteViewModel {
154
+ id: string;
155
+ pageId: string;
156
+ route: string;
157
+ }
158
+ export interface NavOrderViewModel {
159
+ routeId: string;
160
+ isHidden: boolean;
161
+ fullPath: string;
162
+ subRoutes: NavOrderViewModel[];
163
+ }
164
+ export interface NavItemRouteParams {
165
+ slug: string;
166
+ pageSlug?: string;
167
+ }
168
+ export interface NavItemViewModel {
169
+ displayName: string;
170
+ routeName: string;
171
+ routeParams: NavItemRouteParams;
172
+ isHidden: boolean;
173
+ relativePath: string;
174
+ nestedNavItems: NavItemViewModel[];
175
+ }
176
+ export interface NavViewModel {
177
+ navItems: NavItemViewModel[];
178
+ }
152
179
  export interface BrandPageViewModel {
153
180
  brandPageToken?: string;
154
181
  showBrandCrowdLogo: boolean;
155
182
  styles: PageStylesViewModel;
156
183
  pages: PageViewModel[];
184
+ nav: NavViewModel;
157
185
  brandPageType: BrandPageType;
158
186
  headerViewModelDesktop: PageHeaderViewModel;
159
187
  headerViewModelMobile: PageHeaderViewModel;
@@ -980,7 +980,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
980
980
  }): void;
981
981
  addNewPage(payload: {
982
982
  title: string;
983
- }): void;
983
+ }): import("../../../shared/page-settings/models").ContentPage;
984
984
  setSelectedSectionName({ sectionName, }: {
985
985
  sectionName?: "footer" | "header" | "pages" | undefined;
986
986
  }): void;
@@ -992,7 +992,7 @@ declare const _default: import("vue").DefineComponent<{}, {
992
992
  }): void;
993
993
  addNewPage(payload: {
994
994
  title: string;
995
- }): void;
995
+ }): import("../../../shared/page-settings/models").ContentPage;
996
996
  setSelectedSectionName({ sectionName, }: {
997
997
  sectionName?: "footer" | "header" | "pages" | undefined;
998
998
  }): void;
@@ -12,6 +12,7 @@ const pageStyles = new PageStyles();
12
12
  const pages = [
13
13
  {
14
14
  title: '',
15
+ id: '',
15
16
  slug: '',
16
17
  isHidden: false,
17
18
  contents: brandPageData
@@ -36,6 +37,9 @@ const viewModel = {
36
37
  isSavingEnabled: true,
37
38
  hideBranding: false,
38
39
  },
40
+ nav: {
41
+ navItems: [],
42
+ },
39
43
  };
40
44
  export const SampleDesktop = () => {
41
45
  const pinia = setupStoryPinia();
@@ -1,5 +1,5 @@
1
1
  import { EMPTY_LOGO_IMAGE_MODEL, SENSITIVE_CONTENT_TYPES, VIEWPORTS, } from '../../../brand-page';
2
- import { BackgroundStyles, BRAND_PAGE_TYPES, BrandPageModel, CONTENT_TYPES, NavigationDesktop, NavigationMobile, } from '../../../brand-page';
2
+ import { BackgroundStyles, BRAND_PAGE_TYPES, BrandPageModel, CONTENT_TYPES, NavigationDesktop, NavigationMobile, NavModel, } from '../../../brand-page';
3
3
  import { useBrandPageMakerUserStore } from '../user';
4
4
  import { defineStore } from 'pinia';
5
5
  import { useUiStore } from '../ui';
@@ -8,6 +8,7 @@ import { useUiStyleSettingsStore } from '../../../shared/style-settings/store';
8
8
  import { useUiNavigationStyleSettingsStore } from '../../../shared/navigation-style-settings/store';
9
9
  import { useUiBackgroundSettingsStore } from '../../../shared/background-settings/store';
10
10
  import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
11
+ import { usePageNavigationStore } from '../../../shared/page-navigation/store/page-navigation-store';
11
12
  import { applyLogoThemeToBrandPageModel, migrateBrandPageModel, applyUserPersonalisationToBrandPageModelAsync, getBrandPageViewModelFromBrandPageModel, isLogoContent, parseLogoThemeToCssStyles, logoUtil, GetLatestModelVersion, } from '../../../brand-page/utils';
12
13
  import { navigateToPageBySlug } from '../../routing';
13
14
  import { BRANDPAGE_DEFAULT_ERROR_MESSAGE_DESCRIPTION, BRANDPAGE_DEFAULT_SAVE_MESSAGE_DESCRIPTION, MAKER_MOBILE_BREAKPOINT, MESSAGE_VISIBLE_DURATION, } from '../../constants';
@@ -291,6 +292,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
291
292
  brandPageModel.pageFooterDesktop = model.pageFooterDesktop;
292
293
  brandPageModel.pageFooterMobile = model.pageFooterMobile;
293
294
  brandPageModel.pages = model.pages;
295
+ const pageNavigationStore = usePageNavigationStore();
296
+ pageNavigationStore.setNav({ nav: brandPageModel.nav });
294
297
  navigationStyleSettingsStore.initialise({ reset: true });
295
298
  styleSettingsStore.initialise({
296
299
  reset: true,
@@ -646,6 +649,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
646
649
  this.setCookiePreviewEnabled({
647
650
  isCookiePreviewEnabled: brandPageModel.cookieOptions?.isCookiePreviewEnabled,
648
651
  });
652
+ const pageNavigationStore = usePageNavigationStore();
653
+ pageNavigationStore.setNav({ nav: brandPageModel.nav });
649
654
  this.setSavingEnabled({
650
655
  isSavingEnabled: brandPageModel.saveContactSettings?.isSavingEnabled ?? true,
651
656
  });
@@ -814,6 +819,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
814
819
  const styleSettingsStore = useUiStyleSettingsStore();
815
820
  const navigationStyleSettingsStore = useUiNavigationStyleSettingsStore();
816
821
  const shopStore = useShopConfigStore();
822
+ const pageNavigationStore = usePageNavigationStore();
817
823
  const pages = pageSettingsStore.pages.map((p) => ({
818
824
  ...p,
819
825
  contents: p.contents
@@ -825,7 +831,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
825
831
  const buttonStyles = styleSettingsStore.buttonStyles;
826
832
  const textStyles = styleSettingsStore.textStyles;
827
833
  const galleryStyles = styleSettingsStore.galleryStyles;
828
- const navigation = navigationStyleSettingsStore.navigation;
834
+ const navigation = navigationStyleSettingsStore.navigation; // This is not referring to the sub nav structure
835
+ const pageNavStructure = pageNavigationStore.nav;
829
836
  return {
830
837
  v: GetLatestModelVersion(),
831
838
  pages,
@@ -851,6 +858,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
851
858
  cookieOptions: this.cookieOptions,
852
859
  saveContactSettings: this.saveContactSettings,
853
860
  paymentConfig: shopStore.paymentConfig,
861
+ nav: pageNavStructure,
854
862
  };
855
863
  },
856
864
  brandPageToken() {
@@ -926,6 +934,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
926
934
  const userStore = useBrandPageMakerUserStore();
927
935
  const uiStore = useUiStore();
928
936
  const videoStore = useVideoStore();
937
+ const brandPageContainerStore = useBrandPageContainerStore();
929
938
  if (userStore.isAdmin && uiStore.logoTheme) {
930
939
  const themedBrandPage = applyLogoThemeToBrandPageModel(uiStore.logoTheme, this.brandPageData).model;
931
940
  return getBrandPageViewModelFromBrandPageModel(themedBrandPage, this.brandPageToken, undefined, {
@@ -933,6 +942,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
933
942
  getVideoUrls: videoStore.getVideoUrlsForToken,
934
943
  getS3VideoUrls: videoStore.getOptimisedS3VideoUrlsForToken,
935
944
  setVideoUrlsWithToken: videoStore.setVideoUrlsWithToken,
945
+ isCustomDomain: brandPageContainerStore.isCustomDomainEnabled,
946
+ brandPageSlug: brandPageContainerStore.brandPageSlug,
936
947
  });
937
948
  }
938
949
  const showBrandCrowdLogo = userStore.features.showBrandCrowdLogo;
@@ -946,6 +957,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
946
957
  getVideoUrls: videoStore.getVideoUrlsForToken,
947
958
  getS3VideoUrls: videoStore.getOptimisedS3VideoUrlsForToken,
948
959
  setVideoUrlsWithToken: videoStore.setVideoUrlsWithToken,
960
+ isCustomDomain: brandPageContainerStore.isCustomDomainEnabled,
961
+ brandPageSlug: brandPageContainerStore.brandPageSlug,
949
962
  });
950
963
  }
951
964
  return getBrandPageViewModelFromBrandPageModel(this.brandPageData, this.brandPageToken, showBrandCrowdLogo, {
@@ -953,6 +966,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
953
966
  getVideoUrls: videoStore.getVideoUrlsForToken,
954
967
  getS3VideoUrls: videoStore.getOptimisedS3VideoUrlsForToken,
955
968
  setVideoUrlsWithToken: videoStore.setVideoUrlsWithToken,
969
+ isCustomDomain: brandPageContainerStore.isCustomDomainEnabled,
970
+ brandPageSlug: brandPageContainerStore.brandPageSlug,
956
971
  });
957
972
  },
958
973
  gettyVideoIds() {