@designcrowd/library.brand-page 5.16.47-use-carousel-1 → 5.16.47
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-z9zB-onz.js → CreatedOnBrandCrowd-de-de-DebKPLDX.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-Crt4vtmG.js → CreatedOnBrandCrowd-en-us-BpPgKLto.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-B8oq4Klb.js → CreatedOnBrandCrowd-es-es-cPAZBjUO.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BsqCoVg-.js → CreatedOnBrandCrowd-fr-ca-BYaPug2f.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BsqCoVg-.js → CreatedOnBrandCrowd-fr-fr-BYaPug2f.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-qZTskre4.js → CreatedOnBrandCrowd-pt-br-BMJ1UJ-b.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-qZTskre4.js → CreatedOnBrandCrowd-pt-pt-BMJ1UJ-b.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-KicJNTO9.js → CreatedOnDcom-de-de-B280zfGM.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-DVirUOxu.js → CreatedOnDcom-en-us-CcH8WRUU.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CF4tvGHK.js → CreatedOnDcom-es-es-BjVBQo_F.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DfBMTjcu.js → CreatedOnDcom-fr-ca-T6WZ2I2E.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-CrujTMml.js → CreatedOnDcom-fr-fr-Bdwxqa13.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-N5-92ouv.js → CreatedOnDcom-pt-br-DwM59Qaw.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt--nJFkE6-.js → CreatedOnDcom-pt-pt-Cg34AcLr.js} +1 -1
- package/lib/src/brand-page/__fixtures__/brand-page-sample-data.js +0 -6
- package/lib/src/brand-page/components/button/Button.mixin.js +9 -9
- package/lib/src/brand-page/components/image-gallery/ImageGallery.stories.js +0 -3
- package/lib/src/brand-page/components/images-section/ImagesSection.stories.js +0 -3
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.d.ts +12 -14
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.js +23 -19
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +9 -13
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +9 -15
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.d.ts +1 -9
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.js +1 -9
- package/lib/src/brand-page/components/payment/__fixtures__/request-payment.d.ts +0 -1
- package/lib/src/brand-page/components/payment/__fixtures__/support-me.d.ts +0 -1
- package/lib/src/brand-page/components/profile/Profile.stories.js +0 -1
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +1 -2
- package/lib/src/brand-page/models/index.d.ts +3 -3
- package/lib/src/brand-page/utils/migration/migration-06.js +2 -2
- package/lib/src/brand-page/utils/migration/migration-12.js +0 -4
- package/lib/src/brand-page/utils/migration.util.js +0 -6
- package/lib/src/brand-page/utils/model.util.d.ts +1 -2
- package/lib/src/brand-page/utils/model.util.js +0 -3
- package/lib/src/brand-page/utils/view-model.util.js +11 -72
- package/lib/src/brand-page/view-models.d.ts +0 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1 -1
- package/lib/src/brand-page-maker/components/preview/Preview.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +0 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +0 -3
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +0 -15
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +1 -3
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +2 -2
- package/lib/src/brand-page-maker/models/content-settings.js +2 -2
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +4 -2
- package/lib/src/brand-page-maker/utils/content.util.d.ts +4 -0
- package/lib/src/brand-page-maker/utils/content.util.js +34 -0
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +1 -4
- package/lib/src/brand-page-maker/validators/section-button.validator.js +1 -2
- package/lib/src/css/library.brand-page-brandCrowd.min.css +83 -139
- package/lib/src/css/library.brand-page-brandPage.min.css +83 -139
- package/lib/src/css/library.brand-page-designCom.min.css +83 -139
- package/lib/src/css/library.brand-page-preview.min.css +83 -139
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-DK3zrqgw.js → lib-BJ3mN_oo.js} +19901 -20612
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.js +0 -2
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -2
- package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.d.ts +149 -0
- package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.js +103 -0
- package/lib/src/shared/content-settings/components/radio-field/RadioField.mixin.js +0 -2
- package/package.json +4 -4
- package/src/brand-page/__fixtures__/brand-page-sample-data.ts +0 -6
- package/src/brand-page/components/about-section/AboutSection.vue.test.ts +0 -3
- package/src/brand-page/components/button/Button.mixin.ts +16 -15
- package/src/brand-page/components/image/Image.test.ts +0 -3
- package/src/brand-page/components/image-gallery/ImageGallery.stories.ts +0 -3
- package/src/brand-page/components/image-gallery/ImageGallery.test.ts +0 -3
- package/src/brand-page/components/images-section/ImagesSection.stories.ts +0 -3
- package/src/brand-page/components/navigation/Navigation.vue +9 -7
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.ts +37 -24
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.vue +5 -4
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +22 -17
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +4 -4
- package/src/brand-page/components/page/Page.vue +3 -9
- package/src/brand-page/components/page-header/PageHeader.mixin.ts +2 -12
- package/src/brand-page/components/page-header/PageHeader.vue +0 -1
- package/src/brand-page/components/profile/Profile.stories.ts +0 -1
- package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +0 -3
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +17 -1
- package/src/brand-page/models/brand-page-context.model.ts +2 -3
- package/src/brand-page/models/index.ts +3 -3
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +4 -4
- package/src/brand-page/utils/migration/migration-06.ts +7 -3
- package/src/brand-page/utils/migration/migration-12.ts +0 -5
- package/src/brand-page/utils/migration.util.ts +0 -6
- package/src/brand-page/utils/model.util.ts +0 -7
- package/src/brand-page/utils/view-model.util.ts +34 -118
- package/src/brand-page/view-models.ts +0 -3
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1 -1
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.vue +0 -2
- package/src/brand-page-maker/components/preview/Preview.mixin.ts +0 -1
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +31 -45
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +0 -1
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +0 -18
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +1 -5
- package/src/brand-page-maker/constants/config-settings-constant.ts +2 -2
- package/src/brand-page-maker/models/content-settings.ts +2 -2
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +4 -1
- package/src/brand-page-maker/utils/content.util.ts +68 -1
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +1 -5
- package/src/brand-page-maker/validators/section-button.validator.ts +1 -4
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.ts +0 -2
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -2
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.ts +115 -0
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +40 -103
- package/src/shared/content-settings/components/radio-field/RadioField.mixin.ts +0 -2
- package/lib/src/brand-page/utils/migration/migration-13.d.ts +0 -2
- package/lib/src/brand-page/utils/migration/migration-13.js +0 -74
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +0 -499
- package/src/brand-page/utils/migration/migration-13.test.ts +0 -735
- package/src/brand-page/utils/migration/migration-13.ts +0 -125
- package/src/shared/page-navigation/PageSelectorDropdown.vue +0 -155
|
@@ -98,9 +98,6 @@ export const context = {
|
|
|
98
98
|
},
|
|
99
99
|
isCapturingPreview: false,
|
|
100
100
|
recaptchaSiteKey: undefined,
|
|
101
|
-
nav: {
|
|
102
|
-
navItems: [],
|
|
103
|
-
},
|
|
104
101
|
};
|
|
105
102
|
export const BScontext = {
|
|
106
103
|
isTemplate: false,
|
|
@@ -124,9 +121,6 @@ export const BScontext = {
|
|
|
124
121
|
},
|
|
125
122
|
isCapturingPreview: false,
|
|
126
123
|
recaptchaSiteKey: undefined,
|
|
127
|
-
nav: {
|
|
128
|
-
navItems: [],
|
|
129
|
-
},
|
|
130
124
|
};
|
|
131
125
|
export const logoTheme = {
|
|
132
126
|
logoTextColor: {
|
|
@@ -155,16 +155,16 @@ export default defineComponent({
|
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
routes() {
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// );
|
|
164
|
-
console.log('asdadas', this.context.nav.navItems.find((x) => x.pageId === this.viewModel.page));
|
|
158
|
+
const pageSlug = this.context.pages?.find((p) => p.slug === this.viewModel.pageSlug ||
|
|
159
|
+
p.slug === this.viewModel.page)?.slug ||
|
|
160
|
+
this.context.pages?.[0]?.slug ||
|
|
161
|
+
'';
|
|
162
|
+
const routeParams = getRouteParamsByPage(!!this.context.customDomain, this.context.brandPageSlug, pageSlug);
|
|
165
163
|
return {
|
|
166
|
-
name:
|
|
167
|
-
|
|
164
|
+
name: !!this.context.customDomain
|
|
165
|
+
? BP_SLUG_ROUTE_NAME
|
|
166
|
+
: BP_PAGE_SLUG_ROUTE_NAME,
|
|
167
|
+
routeParams,
|
|
168
168
|
};
|
|
169
169
|
},
|
|
170
170
|
},
|
package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { BrandPageContext, NavigationDesktop, NavigationMobile } from '../../../models';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PageViewModel } from '../../../view-models';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
5
|
navId: {
|
|
6
6
|
type: StringConstructor;
|
|
7
7
|
required: true;
|
|
8
8
|
};
|
|
9
|
+
pages: {
|
|
10
|
+
type: PropType<PageViewModel[]>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
9
13
|
context: {
|
|
10
14
|
type: PropType<BrandPageContext>;
|
|
11
15
|
required: true;
|
|
@@ -18,10 +22,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
22
|
type: StringConstructor;
|
|
19
23
|
required: true;
|
|
20
24
|
};
|
|
21
|
-
pageNavigation: {
|
|
22
|
-
type: PropType<NavViewModel>;
|
|
23
|
-
required: true;
|
|
24
|
-
};
|
|
25
25
|
}>, {}, {
|
|
26
26
|
hasInteracted: boolean;
|
|
27
27
|
disablePrev: boolean;
|
|
@@ -42,11 +42,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
42
42
|
scrollbar: boolean;
|
|
43
43
|
threshold: number;
|
|
44
44
|
};
|
|
45
|
-
}, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
pageSlug?: string;
|
|
49
|
-
}): boolean;
|
|
45
|
+
}, {
|
|
46
|
+
slides(): any[];
|
|
47
|
+
}, {
|
|
50
48
|
handleClickedOnce(): void;
|
|
51
49
|
update(): void;
|
|
52
50
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -54,6 +52,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
54
52
|
type: StringConstructor;
|
|
55
53
|
required: true;
|
|
56
54
|
};
|
|
55
|
+
pages: {
|
|
56
|
+
type: PropType<PageViewModel[]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
57
59
|
context: {
|
|
58
60
|
type: PropType<BrandPageContext>;
|
|
59
61
|
required: true;
|
|
@@ -66,9 +68,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
66
68
|
type: StringConstructor;
|
|
67
69
|
required: true;
|
|
68
70
|
};
|
|
69
|
-
pageNavigation: {
|
|
70
|
-
type: PropType<NavViewModel>;
|
|
71
|
-
required: true;
|
|
72
|
-
};
|
|
73
71
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
74
72
|
export default _default;
|
package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
|
+
import { getRouteNameByPageIndex, getRouteParamsByPage, } from '../../../utils/route.util';
|
|
2
3
|
import debounce from 'lodash.debounce';
|
|
3
4
|
export default defineComponent({
|
|
4
5
|
props: {
|
|
@@ -6,6 +7,10 @@ export default defineComponent({
|
|
|
6
7
|
type: String,
|
|
7
8
|
required: true,
|
|
8
9
|
},
|
|
10
|
+
pages: {
|
|
11
|
+
type: Array,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
9
14
|
context: {
|
|
10
15
|
type: Object,
|
|
11
16
|
required: true,
|
|
@@ -18,10 +23,6 @@ export default defineComponent({
|
|
|
18
23
|
type: String,
|
|
19
24
|
required: true,
|
|
20
25
|
},
|
|
21
|
-
pageNavigation: {
|
|
22
|
-
type: Object,
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
26
|
},
|
|
26
27
|
data() {
|
|
27
28
|
return {
|
|
@@ -30,10 +31,7 @@ export default defineComponent({
|
|
|
30
31
|
disableNext: false,
|
|
31
32
|
loading: true,
|
|
32
33
|
swiperOptions: {
|
|
33
|
-
|
|
34
|
-
initialSlide: this.pageNavigation.navItems.findIndex((nav) => this.context.customDomain
|
|
35
|
-
? nav.routeParams.slug === this.context.currentPageSlug
|
|
36
|
-
: nav.routeParams?.pageSlug === this.context.currentPageSlug),
|
|
34
|
+
initialSlide: this.pages.findIndex((p) => p.slug === this.context.currentPageSlug),
|
|
37
35
|
loop: false,
|
|
38
36
|
slidesPerGroup: 1,
|
|
39
37
|
slidesPerView: 'auto',
|
|
@@ -49,6 +47,20 @@ export default defineComponent({
|
|
|
49
47
|
},
|
|
50
48
|
};
|
|
51
49
|
},
|
|
50
|
+
computed: {
|
|
51
|
+
slides() {
|
|
52
|
+
return this.pages.map((p, i) => {
|
|
53
|
+
const routeName = getRouteNameByPageIndex(!!this.context.customDomain, i);
|
|
54
|
+
const routeParams = getRouteParamsByPage(!!this.context.customDomain, this.slug, p.slug);
|
|
55
|
+
return {
|
|
56
|
+
...p,
|
|
57
|
+
index: i,
|
|
58
|
+
routeName,
|
|
59
|
+
routeParams,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
},
|
|
52
64
|
mounted() {
|
|
53
65
|
this.loading = false;
|
|
54
66
|
this.update();
|
|
@@ -63,7 +75,7 @@ export default defineComponent({
|
|
|
63
75
|
hasInteracted() {
|
|
64
76
|
this.update();
|
|
65
77
|
},
|
|
66
|
-
|
|
78
|
+
pages() {
|
|
67
79
|
this.update();
|
|
68
80
|
},
|
|
69
81
|
},
|
|
@@ -74,13 +86,6 @@ export default defineComponent({
|
|
|
74
86
|
}
|
|
75
87
|
},
|
|
76
88
|
methods: {
|
|
77
|
-
// TODO(jyao): Repeated in NavigationSideMenu - This will be changed in future when we start using sub-pages
|
|
78
|
-
isCurrentPage(routeParams) {
|
|
79
|
-
const slug = this.context.customDomain
|
|
80
|
-
? routeParams.slug
|
|
81
|
-
: routeParams?.pageSlug;
|
|
82
|
-
return slug === this.context.currentPageSlug;
|
|
83
|
-
},
|
|
84
89
|
handleClickedOnce() {
|
|
85
90
|
this.hasInteracted = true;
|
|
86
91
|
},
|
|
@@ -94,9 +99,8 @@ export default defineComponent({
|
|
|
94
99
|
// workaround: once the navigation has been interacted with, enable prev
|
|
95
100
|
this.disablePrev =
|
|
96
101
|
!this.hasInteracted &&
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
: nav.routeParams?.pageSlug === this.context.currentPageSlug) === 0;
|
|
102
|
+
this.pages.findIndex((p) => p.slug === this.context.currentPageSlug) ===
|
|
103
|
+
0;
|
|
100
104
|
// workaround: if there is no need to show pagination, never show it
|
|
101
105
|
if (sliderWidth < containerWidth) {
|
|
102
106
|
this.disablePrev = true;
|
package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { BrandPageContext, NavigationDesktop, NavigationMobile } from '../../../models';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PageViewModel } from '../../../view-models';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
5
|
context: {
|
|
6
6
|
type: PropType<BrandPageContext>;
|
|
7
7
|
required: true;
|
|
8
8
|
};
|
|
9
|
+
pages: {
|
|
10
|
+
type: PropType<PageViewModel[]>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
9
13
|
isSideMenuOpen: {
|
|
10
14
|
type: BooleanConstructor;
|
|
11
15
|
required: true;
|
|
@@ -18,26 +22,22 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
22
|
type: PropType<NavigationDesktop | NavigationMobile>;
|
|
19
23
|
required: true;
|
|
20
24
|
};
|
|
21
|
-
pageNavigation: {
|
|
22
|
-
type: PropType<NavViewModel>;
|
|
23
|
-
required: true;
|
|
24
|
-
};
|
|
25
25
|
}>, {}, {}, {
|
|
26
26
|
closeButtonStyle(): BrandPageCssStyle;
|
|
27
27
|
defaultButtonStyle(): BrandPageCssStyle;
|
|
28
28
|
selectedButtonStyle(): BrandPageCssStyle;
|
|
29
29
|
routes(): any[];
|
|
30
30
|
}, {
|
|
31
|
-
isCurrentPage(routeParams: {
|
|
32
|
-
slug?: string;
|
|
33
|
-
pageSlug?: string;
|
|
34
|
-
}): boolean;
|
|
35
31
|
closeSideMenu(): void;
|
|
36
32
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
33
|
context: {
|
|
38
34
|
type: PropType<BrandPageContext>;
|
|
39
35
|
required: true;
|
|
40
36
|
};
|
|
37
|
+
pages: {
|
|
38
|
+
type: PropType<PageViewModel[]>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
41
|
isSideMenuOpen: {
|
|
42
42
|
type: BooleanConstructor;
|
|
43
43
|
required: true;
|
|
@@ -50,9 +50,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
50
50
|
type: PropType<NavigationDesktop | NavigationMobile>;
|
|
51
51
|
required: true;
|
|
52
52
|
};
|
|
53
|
-
pageNavigation: {
|
|
54
|
-
type: PropType<NavViewModel>;
|
|
55
|
-
required: true;
|
|
56
|
-
};
|
|
57
53
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
58
54
|
export default _default;
|
package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
|
+
import { getRouteNameByPageIndex, getRouteParamsByPage, } from '../../../utils/route.util';
|
|
2
3
|
export default defineComponent({
|
|
3
4
|
props: {
|
|
4
5
|
context: {
|
|
5
6
|
type: Object,
|
|
6
7
|
required: true,
|
|
7
8
|
},
|
|
9
|
+
pages: {
|
|
10
|
+
type: Array,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
8
13
|
isSideMenuOpen: {
|
|
9
14
|
type: Boolean,
|
|
10
15
|
required: true,
|
|
@@ -17,10 +22,6 @@ export default defineComponent({
|
|
|
17
22
|
type: Object,
|
|
18
23
|
required: true,
|
|
19
24
|
},
|
|
20
|
-
pageNavigation: {
|
|
21
|
-
type: Object,
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
25
|
},
|
|
25
26
|
computed: {
|
|
26
27
|
closeButtonStyle() {
|
|
@@ -33,21 +34,14 @@ export default defineComponent({
|
|
|
33
34
|
return this.styles.hamburgerMenuStyle.selectedButtonStyle;
|
|
34
35
|
},
|
|
35
36
|
routes() {
|
|
36
|
-
return this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
37
|
+
return this.pages.map((p, i) => {
|
|
38
|
+
const routeName = getRouteNameByPageIndex(!!this.context.customDomain, i);
|
|
39
|
+
const routeParams = getRouteParamsByPage(!!this.context.customDomain, this.slug, p.slug);
|
|
40
|
+
return { routeName, routeParams };
|
|
41
41
|
});
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
methods: {
|
|
45
|
-
isCurrentPage(routeParams) {
|
|
46
|
-
const slug = this.context.customDomain
|
|
47
|
-
? routeParams.slug
|
|
48
|
-
: routeParams?.pageSlug;
|
|
49
|
-
return slug === this.context.currentPageSlug;
|
|
50
|
-
},
|
|
51
45
|
closeSideMenu() {
|
|
52
46
|
this.$emit('close-side-menu');
|
|
53
47
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { BrandPageContext } from '../../models';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PageHeaderViewModel } from '../../view-models';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
5
|
navId: {
|
|
6
6
|
type: StringConstructor;
|
|
@@ -19,10 +19,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
19
19
|
required: false;
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
|
-
pageNavigation: {
|
|
23
|
-
type: PropType<NavViewModel>;
|
|
24
|
-
required: true;
|
|
25
|
-
};
|
|
26
22
|
}>, {}, {
|
|
27
23
|
LOGO_SLIDER_DESKTOP_MAX: number;
|
|
28
24
|
}, {
|
|
@@ -48,10 +44,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
48
44
|
required: false;
|
|
49
45
|
default: boolean;
|
|
50
46
|
};
|
|
51
|
-
pageNavigation: {
|
|
52
|
-
type: PropType<NavViewModel>;
|
|
53
|
-
required: true;
|
|
54
|
-
};
|
|
55
47
|
}>> & Readonly<{
|
|
56
48
|
"onHeader-container-click"?: ((...args: any[]) => any) | undefined;
|
|
57
49
|
}>, {
|
|
@@ -19,10 +19,6 @@ export default defineComponent({
|
|
|
19
19
|
required: false,
|
|
20
20
|
default: false,
|
|
21
21
|
},
|
|
22
|
-
pageNavigation: {
|
|
23
|
-
type: Object,
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
22
|
},
|
|
27
23
|
data: function () {
|
|
28
24
|
return {
|
|
@@ -38,11 +34,7 @@ export default defineComponent({
|
|
|
38
34
|
};
|
|
39
35
|
},
|
|
40
36
|
showNav() {
|
|
41
|
-
|
|
42
|
-
return (this.viewModel.pages.length > 1 ||
|
|
43
|
-
this.pageNavigation.navItems.length > 1 ||
|
|
44
|
-
(this.pageNavigation.navItems.length === 1 &&
|
|
45
|
-
this.pageNavigation.navItems[0].nestedNavItems.length > 0));
|
|
37
|
+
return this.viewModel.pages.length > 1;
|
|
46
38
|
},
|
|
47
39
|
},
|
|
48
40
|
emits: ['header-container-click'],
|
|
@@ -10,7 +10,6 @@ export declare const context: {
|
|
|
10
10
|
brandPageSlug: string;
|
|
11
11
|
brandPageToken?: string | undefined;
|
|
12
12
|
pages?: import("../../../view-models").PageViewModel[] | undefined;
|
|
13
|
-
nav: import("../../../view-models").NavViewModel;
|
|
14
13
|
currentPageSlug?: string | undefined;
|
|
15
14
|
runtimeEnvironment: string;
|
|
16
15
|
recaptchaSiteKey: string | undefined;
|
|
@@ -10,7 +10,6 @@ export declare const context: {
|
|
|
10
10
|
brandPageSlug: string;
|
|
11
11
|
brandPageToken?: string | undefined;
|
|
12
12
|
pages?: import("../../../view-models").PageViewModel[] | undefined;
|
|
13
|
-
nav: import("../../../view-models").NavViewModel;
|
|
14
13
|
currentPageSlug?: string | undefined;
|
|
15
14
|
runtimeEnvironment: string;
|
|
16
15
|
recaptchaSiteKey: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PageViewModel } from '../view-models';
|
|
2
2
|
export declare const VIEWPORTS: {
|
|
3
3
|
readonly desktop: "desktop";
|
|
4
4
|
readonly mobile: "mobile";
|
|
@@ -56,7 +56,6 @@ export interface BrandPageContext {
|
|
|
56
56
|
brandPageSlug: string;
|
|
57
57
|
brandPageToken?: string;
|
|
58
58
|
pages?: PageViewModel[];
|
|
59
|
-
nav: NavViewModel;
|
|
60
59
|
currentPageSlug?: string;
|
|
61
60
|
runtimeEnvironment: string;
|
|
62
61
|
stripePublishableKey: string | undefined;
|
|
@@ -269,7 +269,7 @@ export interface BannerSectionContent extends Content {
|
|
|
269
269
|
colorReplacements: ColorReplacement[];
|
|
270
270
|
mediaType?: string;
|
|
271
271
|
size?: string;
|
|
272
|
-
|
|
272
|
+
pageSlug: string;
|
|
273
273
|
buttonLinkType: ButtonLinkType;
|
|
274
274
|
buttonTextStyle: TextStyleDeclaration;
|
|
275
275
|
overlayColor: BrandPageCssStyle;
|
|
@@ -287,7 +287,7 @@ export interface TextMediaItem extends ImageItem {
|
|
|
287
287
|
paragraph: string;
|
|
288
288
|
itemsId: number;
|
|
289
289
|
buttonText?: string | false;
|
|
290
|
-
|
|
290
|
+
pageSlug?: string;
|
|
291
291
|
buttonLinkType?: ButtonLinkType;
|
|
292
292
|
url?: string;
|
|
293
293
|
email?: string;
|
|
@@ -426,7 +426,7 @@ export interface BookingSectionContent extends Content {
|
|
|
426
426
|
titleStyle: TextStyleDeclaration;
|
|
427
427
|
descriptionStyle: TextStyleDeclaration;
|
|
428
428
|
backgroundStyle: BrandPageCssStyle;
|
|
429
|
-
|
|
429
|
+
pageSlug: string;
|
|
430
430
|
buttonLinkType: ButtonLinkType;
|
|
431
431
|
buttonTextStyle: TextStyleDeclaration;
|
|
432
432
|
}
|
|
@@ -38,8 +38,8 @@ export const migration06 = (migrationResult) => {
|
|
|
38
38
|
if (mediaItem.tel === undefined) {
|
|
39
39
|
mediaItem.tel = '';
|
|
40
40
|
}
|
|
41
|
-
if (mediaItem
|
|
42
|
-
mediaItem
|
|
41
|
+
if (mediaItem.pageSlug === undefined) {
|
|
42
|
+
mediaItem.pageSlug = '';
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -2,10 +2,6 @@ import { v4 as uuid } from 'uuid';
|
|
|
2
2
|
import { NavModel } from '../../models';
|
|
3
3
|
export const migration12 = async (migrationResult) => {
|
|
4
4
|
const { brandPageModel } = migrationResult;
|
|
5
|
-
// Skip if nav already exists
|
|
6
|
-
if (brandPageModel.nav?.routes?.length) {
|
|
7
|
-
return migrationResult;
|
|
8
|
-
}
|
|
9
5
|
const pages = brandPageModel.pages;
|
|
10
6
|
// Add uuid to each page as id
|
|
11
7
|
pages.forEach((page) => {
|
|
@@ -14,7 +14,6 @@ import { migration09 } from './migration/migration-09';
|
|
|
14
14
|
import { migration10 } from './migration/migration-10';
|
|
15
15
|
import { migration11 } from './migration/migration-11';
|
|
16
16
|
import { migration12 } from './migration/migration-12';
|
|
17
|
-
import { migration13 } from './migration/migration-13';
|
|
18
17
|
const MIGRATION_TABLE = [
|
|
19
18
|
{
|
|
20
19
|
version: 1,
|
|
@@ -92,11 +91,6 @@ const MIGRATION_TABLE = [
|
|
|
92
91
|
migrateFn: migration12,
|
|
93
92
|
description: 'Migrating nav model to support sub nav feature',
|
|
94
93
|
},
|
|
95
|
-
{
|
|
96
|
-
version: 13,
|
|
97
|
-
migrateFn: migration13,
|
|
98
|
-
description: 'Migrating old page navigation refererences to use page ids',
|
|
99
|
-
},
|
|
100
94
|
];
|
|
101
95
|
export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
|
|
102
96
|
export const migrateBrandPageModel = async (brandPageModel, options) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Content, type AboutSectionContent, type BannerSectionContent, type BrandPageModel, type ButtonWithModalContent, type ImagesSectionContent, type LogoContent, type MailingListContent, type ProfileContent, type ShapesSectionContent, type SocialLinksContent, type SupportMeContent, type TestimonialSectionContent, type TextContent, type RequestPaymentContent, type ContactFormContent, type LogoImageModel, type ShopContent, type ImageContent, type ImageGalleryContent
|
|
1
|
+
import { type Content, type AboutSectionContent, type BannerSectionContent, type BrandPageModel, type ButtonWithModalContent, type ImagesSectionContent, type LogoContent, type MailingListContent, type ProfileContent, type ShapesSectionContent, type SocialLinksContent, type SupportMeContent, type TestimonialSectionContent, type TextContent, type RequestPaymentContent, type ContactFormContent, type LogoImageModel, type ShopContent, type ImageContent, type ImageGalleryContent } from '../models';
|
|
2
2
|
export declare const isLogoContent: (content?: Content) => content is LogoContent;
|
|
3
3
|
export declare const applyLogoImageToBrandPageModelLogoContents: (model: BrandPageModel, logoImage: LogoImageModel) => BrandPageModel;
|
|
4
4
|
export declare const isTextContent: (content?: Content) => content is TextContent;
|
|
@@ -7,7 +7,6 @@ export declare const isMailingListContent: (content?: Content) => content is Mai
|
|
|
7
7
|
export declare const isSupportMeContent: (content?: Content) => content is SupportMeContent;
|
|
8
8
|
export declare const isButtonContent: (content?: Content) => content is ButtonWithModalContent;
|
|
9
9
|
export declare const isBannerContent: (content?: Content) => content is BannerSectionContent;
|
|
10
|
-
export declare const isBookingContent: (content?: Content) => content is BookingSectionContent;
|
|
11
10
|
export declare const isAboutContent: (content?: Content) => content is AboutSectionContent;
|
|
12
11
|
export declare const isTestimonialContent: (content?: Content) => content is TestimonialSectionContent;
|
|
13
12
|
export declare const isShapesContent: (content?: Content) => content is ShapesSectionContent;
|
|
@@ -40,9 +40,6 @@ export const isButtonContent = (content) => {
|
|
|
40
40
|
export const isBannerContent = (content) => {
|
|
41
41
|
return content?.type === 'banner-section';
|
|
42
42
|
};
|
|
43
|
-
export const isBookingContent = (content) => {
|
|
44
|
-
return content?.type === 'booking-section';
|
|
45
|
-
};
|
|
46
43
|
export const isAboutContent = (content) => {
|
|
47
44
|
return content?.type === 'about-section';
|
|
48
45
|
};
|