@designcrowd/library.brand-page 5.14.4-flacky-nav-20 → 5.14.5
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-D6fmcmiG.js → CreatedOnBrandCrowd-de-de-tTFTa20I.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-0e6iElRh.js → CreatedOnBrandCrowd-en-us-CFjAtUB7.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DyVOGiYK.js → CreatedOnBrandCrowd-es-es-CCbPO5EX.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-D8wrO0EO.js → CreatedOnBrandCrowd-fr-fr-vj8agtZJ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DZCcVTVy.js → CreatedOnBrandCrowd-pt-pt-BBbKXb-v.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-IIkhu8ZZ.js → CreatedOnDcom-de-de-DSIsTnvI.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D_Quyqbp.js → CreatedOnDcom-en-us-BjGcn0TZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BfKHaFhp.js → CreatedOnDcom-es-es-VY1wFSD_.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BrNaR5yK.js → CreatedOnDcom-fr-fr-BKc4gdFc.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-DUac_-1A.js → CreatedOnDcom-pt-pt-Cxl_q80E.js} +1 -1
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +2 -3
- package/lib/src/brand-page/components/mailing-list/MailingList.stories.js +2 -2
- package/lib/src/brand-page/constants/logo.constants.d.ts +0 -1
- package/lib/src/brand-page/constants/logo.constants.js +0 -2
- package/lib/src/brand-page/constants/misc.constants.d.ts +0 -1
- package/lib/src/brand-page/constants/misc.constants.js +0 -1
- package/lib/src/brand-page/constants/styles.constants.d.ts +2 -2
- package/lib/src/brand-page/constants/styles.constants.js +2 -2
- package/lib/src/brand-page/utils/migration/migration-01.d.ts +2 -3
- package/lib/src/brand-page/utils/migration/migration-01.js +2 -3
- package/lib/src/brand-page/utils/migration/migration-01_1.d.ts +3 -4
- package/lib/src/brand-page/utils/migration/migration-01_1.js +2 -3
- package/lib/src/brand-page/utils/migration/migration-02.d.ts +3 -4
- package/lib/src/brand-page/utils/migration/migration-02.js +2 -3
- package/lib/src/brand-page/utils/migration/migration-03.d.ts +3 -4
- package/lib/src/brand-page/utils/migration/migration-03.js +2 -3
- package/lib/src/brand-page/utils/migration/migration-04.d.ts +3 -4
- package/lib/src/brand-page/utils/migration/migration-04.js +2 -3
- package/lib/src/brand-page/utils/migration/migration-05.d.ts +2 -6
- package/lib/src/brand-page/utils/migration/migration-05.js +2 -3
- package/lib/src/brand-page/utils/migration/migration-05_1.d.ts +3 -3
- package/lib/src/brand-page/utils/migration/migration-05_1.js +3 -3
- package/lib/src/brand-page/utils/migration/migration-05_2.d.ts +3 -3
- package/lib/src/brand-page/utils/migration/migration-05_2.js +2 -3
- package/lib/src/brand-page/utils/migration.util.d.ts +1 -6
- package/lib/src/brand-page/utils/migration.util.js +6 -16
- package/lib/src/brand-page/utils/view-model.util.d.ts +4 -6
- package/lib/src/brand-page/utils/view-model.util.js +13 -14
- package/lib/src/brand-page/view-models.d.ts +0 -1
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.d.ts +0 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +2 -48
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.d.ts +0 -1122
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -1058
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/google-analytics/GoogleAnalytics.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/models/content-settings.js +1 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +1 -2
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +2 -3
- package/lib/src/{bundled-translations-CZWbHUvK.js → bundled-translations-Cywcg_sz.js} +1 -1
- package/lib/src/{bundled-translations.de-DE-CJEfFSdX.js → bundled-translations.de-DE-BbDTbyhB.js} +1 -1
- package/lib/src/{bundled-translations.es-ES-ZPQF8MP5.js → bundled-translations.es-ES-Byj3a6gQ.js} +1 -1
- package/lib/src/{bundled-translations.fr-CA-CxW1dRgb.js → bundled-translations.fr-CA-CpMBjlzD.js} +1 -1
- package/lib/src/{bundled-translations.fr-FR-CEsuEZjm.js → bundled-translations.fr-FR-gGp2KrN5.js} +1 -1
- package/lib/src/{bundled-translations.pt-BR-CtxSb7a5.js → bundled-translations.pt-BR-CGG0pI4w.js} +9 -9
- package/lib/src/{bundled-translations.pt-PT-BBDakRsv.js → bundled-translations.pt-PT-n8EsEX5u.js} +1 -1
- package/lib/src/bundles/bundled-translations.de-DE.json +1 -0
- package/lib/src/bundles/bundled-translations.es-ES.json +1 -0
- package/lib/src/bundles/bundled-translations.fr-CA.json +1 -0
- package/lib/src/bundles/bundled-translations.fr-FR.json +1 -0
- package/lib/src/bundles/bundled-translations.json +1 -0
- package/lib/src/bundles/bundled-translations.pt-BR.json +1 -0
- package/lib/src/bundles/bundled-translations.pt-PT.json +1 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +6 -3
- package/lib/src/css/library.brand-page-brandPage.min.css +6 -3
- package/lib/src/css/library.brand-page-designCom.min.css +6 -3
- package/lib/src/css/library.brand-page-preview.min.css +6 -3
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-BRaFRV_F.js → lib-CZoxhX8G.js} +9241 -9375
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/store/page-settings-store.js +1 -1
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -1
- package/lib/src/shared/template-settings/store/template-settings-store.js +1 -2
- package/package.json +1 -1
- package/src/brand-page/components/logo/Logo.vue +1 -24
- package/src/brand-page/components/logo/LogoRender.vue +20 -56
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +7 -3
- package/src/brand-page/components/mailing-list/MailingList.stories.ts +2 -2
- package/src/brand-page/constants/logo.constants.ts +0 -3
- package/src/brand-page/constants/misc.constants.ts +0 -2
- package/src/brand-page/constants/styles.constants.ts +2 -2
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +1112 -1121
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +413 -416
- package/src/brand-page/utils/migration/logo/migration.util.logo.test.ts +3 -3
- package/src/brand-page/utils/migration/migration-01.ts +4 -7
- package/src/brand-page/utils/migration/migration-01_1.ts +3 -6
- package/src/brand-page/utils/migration/migration-02.ts +4 -7
- package/src/brand-page/utils/migration/migration-03.ts +4 -7
- package/src/brand-page/utils/migration/migration-04.ts +4 -7
- package/src/brand-page/utils/migration/migration-05.ts +3 -16
- package/src/brand-page/utils/migration/migration-05_1.ts +4 -6
- package/src/brand-page/utils/migration/migration-05_2.ts +3 -6
- package/src/brand-page/utils/migration.util.test.ts +157 -274
- package/src/brand-page/utils/migration.util.ts +9 -26
- package/src/brand-page/utils/migration2.util.test.ts +2 -7
- package/src/brand-page/utils/view-model.util.ts +7 -26
- package/src/brand-page/view-models.ts +0 -1
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +1 -52
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -1090
- package/src/brand-page-maker/models/content-settings.ts +1 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +1 -4
- package/src/bundles/bundled-translations.de-DE.json +1 -0
- package/src/bundles/bundled-translations.es-ES.json +1 -0
- package/src/bundles/bundled-translations.fr-CA.json +1 -0
- package/src/bundles/bundled-translations.fr-FR.json +1 -0
- package/src/bundles/bundled-translations.json +1 -0
- package/src/bundles/bundled-translations.pt-BR.json +1 -0
- package/src/bundles/bundled-translations.pt-PT.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +1 -0
- package/src/shared/page-settings/store/page-settings-store.ts +0 -1
- package/src/shared/template-settings/store/template-settings-store.ts +1 -2
- package/lib/src/brand-page/utils/migration/migration-06.d.ts +0 -4
- package/lib/src/brand-page/utils/migration/migration-06.js +0 -60
- package/src/brand-page/utils/migration/migration-06.test.ts +0 -384
- package/src/brand-page/utils/migration/migration-06.ts +0 -108
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
|
-
import { DEFAULT_MAILING_LIST_BUTTON_TEXT } from '../../constants';
|
|
3
2
|
import brandPageClient from '../../clients/brand-page.client';
|
|
4
3
|
import { getEmailValidationError } from '../../utils';
|
|
5
|
-
import { mailingListTr } from '../../../composables/useTranslate';
|
|
4
|
+
import { contentSettingsTr, mailingListTr, } from '../../../composables/useTranslate';
|
|
6
5
|
const MAX_NAME_LENGTH = 200;
|
|
7
6
|
export default defineComponent({
|
|
8
7
|
props: {
|
|
@@ -70,7 +69,7 @@ export default defineComponent({
|
|
|
70
69
|
return { ...buttonStyle, ...this.viewModel.buttonTextStyle };
|
|
71
70
|
},
|
|
72
71
|
buttonText() {
|
|
73
|
-
return this.viewModel?.buttonText ||
|
|
72
|
+
return (this.viewModel?.buttonText || contentSettingsTr('subscribePlaceholder'));
|
|
74
73
|
},
|
|
75
74
|
containerStyle() {
|
|
76
75
|
const buttonStyle = { ...this.viewModel.styles?.style };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import { faker } from '@faker-js/faker';
|
|
3
3
|
import { mockApiCalls } from '../../../brand-page-maker/components/brand-page-maker/mock-api-calls';
|
|
4
|
-
import {
|
|
4
|
+
import { DEFAULT_TEXT_ALIGN } from '../../constants';
|
|
5
5
|
import MailingList from './MailingList.vue';
|
|
6
6
|
import { context } from '../../__fixtures__/brand-page-sample-data';
|
|
7
7
|
export default {
|
|
@@ -13,7 +13,7 @@ const bpData = {
|
|
|
13
13
|
type: 'mailing-list',
|
|
14
14
|
acceptedFields: undefined,
|
|
15
15
|
promptText: 'You want some mails?',
|
|
16
|
-
buttonText:
|
|
16
|
+
buttonText: 'Subscribe',
|
|
17
17
|
titleStyle: {
|
|
18
18
|
textAlign: DEFAULT_TEXT_ALIGN,
|
|
19
19
|
},
|
|
@@ -2,7 +2,6 @@ export declare const DEFAULT_CURRENCY_SYMBOL = "$";
|
|
|
2
2
|
export declare const DEFAULT_CURRENCY_CODE = "USD";
|
|
3
3
|
export declare const DEFAULT_LOGO_TEXT_COLOR_RGB = "rgb(0,0,0)";
|
|
4
4
|
export declare const DEFAULT_LOGO_BACKGROUND_COLOR_RGB = "rgb(255,255,255)";
|
|
5
|
-
export declare const DEFAULT_MAILING_LIST_BUTTON_TEXT = "Subscribe";
|
|
6
5
|
export declare const DISPLAY_STYLE_PREVIEW = "preview";
|
|
7
6
|
export declare const DISPLAY_STYLE_COLLAPSED = "collapsed";
|
|
8
7
|
export declare const ALIGN_CENTERED = "centered";
|
|
@@ -3,7 +3,6 @@ export const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
|
3
3
|
export const DEFAULT_CURRENCY_CODE = 'USD';
|
|
4
4
|
export const DEFAULT_LOGO_TEXT_COLOR_RGB = 'rgb(0,0,0)';
|
|
5
5
|
export const DEFAULT_LOGO_BACKGROUND_COLOR_RGB = 'rgb(255,255,255)';
|
|
6
|
-
export const DEFAULT_MAILING_LIST_BUTTON_TEXT = 'Subscribe';
|
|
7
6
|
export const DISPLAY_STYLE_PREVIEW = 'preview';
|
|
8
7
|
export const DISPLAY_STYLE_COLLAPSED = 'collapsed';
|
|
9
8
|
export const ALIGN_CENTERED = 'centered';
|
|
@@ -16,9 +16,9 @@ export declare const defaultHamburgerNavigation: {
|
|
|
16
16
|
export declare const OLD_DEFAULT_LOGO_HEIGHT = "6rem";
|
|
17
17
|
export declare const DEFAULT_LOGO_HEIGHT = "9rem";
|
|
18
18
|
export declare const DEFAULT_LOGO_WIDTH = "9rem";
|
|
19
|
-
export declare const LOGO_SLIDER_DESKTOP_MIN =
|
|
19
|
+
export declare const LOGO_SLIDER_DESKTOP_MIN = 5;
|
|
20
20
|
export declare const LOGO_SLIDER_DESKTOP_MAX = 20;
|
|
21
|
-
export declare const LOGO_SLIDER_MOBILE_MIN =
|
|
21
|
+
export declare const LOGO_SLIDER_MOBILE_MIN = 4;
|
|
22
22
|
export declare const LOGO_SLIDER_MOBILE_MAX = 13;
|
|
23
23
|
export declare const CONTENT_TEXT_STYLE_PROPERTY_KEYS: {
|
|
24
24
|
readonly descriptionStyle: "descriptionStyle";
|
|
@@ -18,9 +18,9 @@ export const OLD_DEFAULT_LOGO_HEIGHT = '6rem';
|
|
|
18
18
|
export const DEFAULT_LOGO_HEIGHT = '9rem';
|
|
19
19
|
export const DEFAULT_LOGO_WIDTH = '9rem';
|
|
20
20
|
// Logo slider values are unit of rem
|
|
21
|
-
export const LOGO_SLIDER_DESKTOP_MIN =
|
|
21
|
+
export const LOGO_SLIDER_DESKTOP_MIN = 5;
|
|
22
22
|
export const LOGO_SLIDER_DESKTOP_MAX = 20;
|
|
23
|
-
export const LOGO_SLIDER_MOBILE_MIN =
|
|
23
|
+
export const LOGO_SLIDER_MOBILE_MIN = 4;
|
|
24
24
|
export const LOGO_SLIDER_MOBILE_MAX = 13;
|
|
25
25
|
export const CONTENT_TEXT_STYLE_PROPERTY_KEYS = {
|
|
26
26
|
descriptionStyle: 'descriptionStyle',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { BrandPageModel } from '../../';
|
|
2
|
-
import { type MigrationData } from '../../utils';
|
|
3
2
|
export declare const applyTextContentTextToTextItemsMigration: (brandPageModel: BrandPageModel) => void;
|
|
4
3
|
export declare const migrateProfileContentToHaveTextStyles: (brandPageModel: BrandPageModel) => void;
|
|
5
4
|
export declare const migrateMailingListContentToHaveTextStyles: (brandPageModel: BrandPageModel) => void;
|
|
@@ -18,6 +17,6 @@ export declare const migrateNewLogoLogic: (brandPageModel: BrandPageModel, isUse
|
|
|
18
17
|
export declare const migrateGlobalTextStylesToHaveMissingStyles: (brandPageModel: BrandPageModel) => void;
|
|
19
18
|
export declare const migrateConvertLineHeightOnNavigationStyles: (brandPageModel: BrandPageModel) => void;
|
|
20
19
|
export declare const migrateConvertLineHeightOnFooterStyles: (brandPageModel: BrandPageModel) => void;
|
|
21
|
-
export declare const migration01: (
|
|
20
|
+
export declare const migration01: (brandPageModel: BrandPageModel, options: {
|
|
22
21
|
isUserDraft: boolean;
|
|
23
|
-
}) =>
|
|
22
|
+
}) => BrandPageModel;
|
|
@@ -856,8 +856,7 @@ export const migrateConvertLineHeightOnFooterStyles = (brandPageModel) => {
|
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
858
|
};
|
|
859
|
-
export const migration01 =
|
|
860
|
-
const { brandPageModel } = migrationResult;
|
|
859
|
+
export const migration01 = (brandPageModel, options) => {
|
|
861
860
|
if (!brandPageModel.brandPageType) {
|
|
862
861
|
brandPageModel.brandPageType = BRAND_PAGE_TYPES.default;
|
|
863
862
|
}
|
|
@@ -889,5 +888,5 @@ export const migration01 = async (migrationResult, options) => {
|
|
|
889
888
|
migrateGlobalTextStylesToHaveMissingStyles(brandPageModel);
|
|
890
889
|
migrateConvertLineHeightOnNavigationStyles(brandPageModel);
|
|
891
890
|
migrateConvertLineHeightOnFooterStyles(brandPageModel);
|
|
892
|
-
return
|
|
891
|
+
return brandPageModel;
|
|
893
892
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { LogoImageModel } from '../..';
|
|
2
|
-
|
|
3
|
-
export declare const migration01_1: (migrationResult: MigrationData, options: {
|
|
1
|
+
import type { BrandPageModel, LogoImageModel } from '../..';
|
|
2
|
+
export declare const migration01_1: (brandPageModel: BrandPageModel, options: {
|
|
4
3
|
logoImage?: LogoImageModel;
|
|
5
|
-
}) =>
|
|
4
|
+
}) => BrandPageModel;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { migrateLogoImage } from './logo/logo.migration.util';
|
|
2
|
-
export const migration01_1 = (
|
|
3
|
-
const { brandPageModel } = migrationResult;
|
|
2
|
+
export const migration01_1 = (brandPageModel, options) => {
|
|
4
3
|
migrateLogoImage(brandPageModel, options.logoImage);
|
|
5
|
-
return
|
|
4
|
+
return brandPageModel;
|
|
6
5
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type LogoImageModel } from '../..';
|
|
2
|
-
import type { MigrationData } from '../migration.util';
|
|
1
|
+
import { type BrandPageModel, type LogoImageModel } from '../..';
|
|
3
2
|
export declare const convertLetterSpacingRemToEm: (fontSizeInEmOrRem: string | undefined, letterSpacingRemValue: string | undefined) => string | undefined;
|
|
4
|
-
export declare const migration02: (
|
|
3
|
+
export declare const migration02: (brandPageModel: BrandPageModel, options: {
|
|
5
4
|
logoImage?: LogoImageModel;
|
|
6
5
|
isUserDraft: boolean;
|
|
7
|
-
}) =>
|
|
6
|
+
}) => BrandPageModel;
|
|
@@ -31,8 +31,7 @@ const handleConversion = (style) => {
|
|
|
31
31
|
}
|
|
32
32
|
style.letterSpacing = convertLetterSpacingRemToEm(style.fontSize, style.letterSpacing);
|
|
33
33
|
};
|
|
34
|
-
export const migration02 =
|
|
35
|
-
const { brandPageModel } = migrationResult;
|
|
34
|
+
export const migration02 = (brandPageModel, options) => {
|
|
36
35
|
handleConversion(brandPageModel.pageHeaderDesktop?.navigation?.defaultButtonStyle);
|
|
37
36
|
handleConversion(brandPageModel.pageHeaderMobile?.navigation?.defaultButtonStyle);
|
|
38
37
|
handleConversion(brandPageModel.pageFooterDesktop?.copyrightStyle);
|
|
@@ -128,5 +127,5 @@ export const migration02 = async (migrationResult, options) => {
|
|
|
128
127
|
}
|
|
129
128
|
});
|
|
130
129
|
});
|
|
131
|
-
return
|
|
130
|
+
return brandPageModel;
|
|
132
131
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type LogoImageModel } from '../..';
|
|
2
|
-
|
|
3
|
-
export declare const migration03: (migrationResult: MigrationData, options: {
|
|
1
|
+
import { type BrandPageModel, type LogoImageModel } from '../..';
|
|
2
|
+
export declare const migration03: (brandPageModel: BrandPageModel, options: {
|
|
4
3
|
logoImage?: LogoImageModel;
|
|
5
4
|
isUserDraft: boolean;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => BrandPageModel;
|
|
@@ -28,8 +28,7 @@ const migrateApplyAutoScaleProperty = (brandPageType, textStyle) => {
|
|
|
28
28
|
textStyle.applyAutoScale =
|
|
29
29
|
brandPageType && brandPageType === BRAND_PAGE_TYPES.brandSite;
|
|
30
30
|
};
|
|
31
|
-
export const migration03 =
|
|
32
|
-
const { brandPageModel } = migrationResult;
|
|
31
|
+
export const migration03 = (brandPageModel, options) => {
|
|
33
32
|
handleRecursiveFontSizeMigration(brandPageModel.pageHeaderDesktop);
|
|
34
33
|
handleRecursiveFontSizeMigration(brandPageModel.pageHeaderMobile);
|
|
35
34
|
handleRecursiveFontSizeMigration(brandPageModel.pageFooterDesktop);
|
|
@@ -117,5 +116,5 @@ export const migration03 = async (migrationResult, options) => {
|
|
|
117
116
|
}
|
|
118
117
|
});
|
|
119
118
|
});
|
|
120
|
-
return
|
|
119
|
+
return brandPageModel;
|
|
121
120
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type LogoImageModel } from '../..';
|
|
2
|
-
|
|
3
|
-
export declare const migration04: (migrationResult: MigrationData, options: {
|
|
1
|
+
import { type BrandPageModel, type LogoImageModel } from '../..';
|
|
2
|
+
export declare const migration04: (brandPageModel: BrandPageModel, options: {
|
|
4
3
|
logoImage?: LogoImageModel;
|
|
5
4
|
isUserDraft: boolean;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => BrandPageModel;
|
|
@@ -86,8 +86,7 @@ const updateUserUploadedImageUrls = (content) => {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
export const migration04 =
|
|
90
|
-
const { brandPageModel } = migrationResult;
|
|
89
|
+
export const migration04 = (brandPageModel, options) => {
|
|
91
90
|
if (brandPageModel.faviconUrl &&
|
|
92
91
|
isUserUploadedImage(brandPageModel.faviconUrl)) {
|
|
93
92
|
brandPageModel.faviconUrl = removeUserImageExtension(brandPageModel.faviconUrl);
|
|
@@ -112,5 +111,5 @@ export const migration04 = async (migrationResult, options) => {
|
|
|
112
111
|
}
|
|
113
112
|
});
|
|
114
113
|
}
|
|
115
|
-
return
|
|
114
|
+
return brandPageModel;
|
|
116
115
|
};
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
export declare const migration05: (migrationResult: MigrationData, options: {
|
|
4
|
-
logoImage?: LogoImageModel;
|
|
5
|
-
isUserDraft: boolean;
|
|
6
|
-
}) => Promise<MigrationData>;
|
|
1
|
+
import { type BrandPageModel } from '../..';
|
|
2
|
+
export declare const migration05: (brandPageModel: BrandPageModel) => BrandPageModel;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {} from '../..';
|
|
2
2
|
import { isTextContent } from '../model.util';
|
|
3
|
-
export const migration05 =
|
|
4
|
-
const { brandPageModel } = migrationResult;
|
|
3
|
+
export const migration05 = (brandPageModel) => {
|
|
5
4
|
brandPageModel.pages.forEach((page) => {
|
|
6
5
|
page.contents.forEach((content) => {
|
|
7
6
|
if (isTextContent(content)) {
|
|
@@ -14,5 +13,5 @@ export const migration05 = async (migrationResult, options) => {
|
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
15
|
});
|
|
17
|
-
return
|
|
16
|
+
return brandPageModel;
|
|
18
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const migration05_1: (
|
|
1
|
+
import { type BrandPageModel } from '../..';
|
|
2
|
+
export declare const migration05_1: (brandPageModel: BrandPageModel, options: {
|
|
3
3
|
isUserDraft: boolean;
|
|
4
|
-
}) =>
|
|
4
|
+
}) => BrandPageModel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import {} from '../..';
|
|
2
|
+
export const migration05_1 = (brandPageModel, options) => {
|
|
3
3
|
if (!options.isUserDraft) {
|
|
4
4
|
brandPageModel.pageFooterDesktop?.socialLinks?.forEach((link) => {
|
|
5
5
|
if (link.imageUrl === 'twitter') {
|
|
@@ -14,5 +14,5 @@ export const migration05_1 = (migrationResult, options) => {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return brandPageModel;
|
|
18
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const migration05_2: (
|
|
1
|
+
import { type BrandPageModel } from '../..';
|
|
2
|
+
export declare const migration05_2: (brandPageModel: BrandPageModel, options: {
|
|
3
3
|
isUserDraft: boolean;
|
|
4
|
-
}) =>
|
|
4
|
+
}) => BrandPageModel;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {} from '../..';
|
|
2
|
-
export const migration05_2 = (
|
|
3
|
-
const { brandPageModel } = migrationResult;
|
|
2
|
+
export const migration05_2 = (brandPageModel, options) => {
|
|
4
3
|
brandPageModel.pages.forEach((page) => {
|
|
5
4
|
page.contents.forEach((content) => {
|
|
6
5
|
// Casting content type to string to avoid adding placeholder types in CONTENT_SETTINGS_CONFIGS
|
|
@@ -11,5 +10,5 @@ export const migration05_2 = (migrationResult, options) => {
|
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
12
|
});
|
|
14
|
-
return
|
|
13
|
+
return brandPageModel;
|
|
15
14
|
};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { type BrandPageModel, type LogoImageModel } from '../models';
|
|
2
|
-
export interface MigrationData {
|
|
3
|
-
brandPageModel: BrandPageModel;
|
|
4
|
-
useOldLogoRenderSize: boolean;
|
|
5
|
-
}
|
|
6
2
|
export declare const GetLatestModelVersion: () => number;
|
|
7
3
|
export declare const migrateBrandPageModel: (brandPageModel: BrandPageModel, options: {
|
|
8
4
|
logoImage?: LogoImageModel;
|
|
9
5
|
isUserDraft: boolean;
|
|
10
|
-
|
|
11
|
-
}) => Promise<MigrationData>;
|
|
6
|
+
}) => BrandPageModel;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LOGO_MIGRATION_VERSION } from '../constants';
|
|
2
1
|
import {} from '../models';
|
|
3
2
|
import { migration01 } from './migration/migration-01';
|
|
4
3
|
import { migration01_1 } from './migration/migration-01_1';
|
|
@@ -6,7 +5,6 @@ import { migration02 } from './migration/migration-02';
|
|
|
6
5
|
import { migration03 } from './migration/migration-03';
|
|
7
6
|
import { migration04 } from './migration/migration-04';
|
|
8
7
|
import { migration05 } from './migration/migration-05';
|
|
9
|
-
import { migration06 } from './migration/migration-06';
|
|
10
8
|
import { migration05_1 } from './migration/migration-05_1';
|
|
11
9
|
import { migration05_2 } from './migration/migration-05_2';
|
|
12
10
|
const MIGRATION_TABLE = [
|
|
@@ -51,27 +49,19 @@ const MIGRATION_TABLE = [
|
|
|
51
49
|
migrateFn: migration05_2,
|
|
52
50
|
description: 'Migrating twitter content to x content',
|
|
53
51
|
},
|
|
54
|
-
{
|
|
55
|
-
version: 6,
|
|
56
|
-
migrateFn: migration06,
|
|
57
|
-
},
|
|
58
52
|
];
|
|
59
53
|
export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
|
|
60
|
-
export const migrateBrandPageModel =
|
|
54
|
+
export const migrateBrandPageModel = (brandPageModel, options) => {
|
|
61
55
|
let modelVersion = brandPageModel.v;
|
|
62
|
-
let migrationResult = {
|
|
63
|
-
brandPageModel,
|
|
64
|
-
useOldLogoRenderSize: false,
|
|
65
|
-
};
|
|
66
56
|
if (!modelVersion) {
|
|
67
57
|
modelVersion = 0;
|
|
68
58
|
}
|
|
69
|
-
|
|
59
|
+
MIGRATION_TABLE.forEach((x) => {
|
|
70
60
|
if (x.runAlways || modelVersion < x.version) {
|
|
71
|
-
|
|
61
|
+
brandPageModel = x.migrateFn(brandPageModel, options);
|
|
72
62
|
}
|
|
73
|
-
}
|
|
63
|
+
});
|
|
74
64
|
// Set the model to latest version
|
|
75
|
-
|
|
76
|
-
return
|
|
65
|
+
brandPageModel.v = GetLatestModelVersion();
|
|
66
|
+
return brandPageModel;
|
|
77
67
|
};
|
|
@@ -8,12 +8,10 @@ export declare const mapToTextViewModel: (content: TextContent, styles: PageStyl
|
|
|
8
8
|
export declare const mapToBannerSectionViewModel: (content: BannerSectionContent, styles: PageStyles) => 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 mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[]
|
|
12
|
-
export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles
|
|
13
|
-
export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType
|
|
14
|
-
|
|
15
|
-
}) => (content: Content) => ContentViewModel | undefined;
|
|
16
|
-
export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean, useOldLogoRenderSize?: boolean) => BrandPageViewModel;
|
|
11
|
+
export declare const mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[]) => PageHeaderViewModel;
|
|
12
|
+
export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles) => PageFooterViewModel;
|
|
13
|
+
export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType) => (content: Content) => ContentViewModel | undefined;
|
|
14
|
+
export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean) => BrandPageViewModel;
|
|
17
15
|
export declare const isLogoViewModel: (viewModel: ContentViewModel) => viewModel is LogoViewModel;
|
|
18
16
|
/** for service.brand-page website preview by logo draft token */
|
|
19
17
|
export declare const applyLogoImageToBrandPageViewModel: (viewModel: BrandPageViewModel, logoImage: LogoImageModel) => BrandPageViewModel;
|
|
@@ -115,7 +115,7 @@ export const mapToImageGalleryViewModel = (content, globalStyles) => {
|
|
|
115
115
|
styles: galleryStyles?.galleryType ? galleryStyles : globalStyles,
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
-
const mapToLogoViewModel = (content, globalStyles,
|
|
118
|
+
const mapToLogoViewModel = (content, globalStyles, options) => {
|
|
119
119
|
let background;
|
|
120
120
|
if (content.backgroundStyle?.background &&
|
|
121
121
|
isHexTransparent(content.backgroundStyle.background)) {
|
|
@@ -158,7 +158,6 @@ const mapToLogoViewModel = (content, globalStyles, useOldLogoRenderSize, options
|
|
|
158
158
|
},
|
|
159
159
|
},
|
|
160
160
|
isVisible: content.isLogoVisible,
|
|
161
|
-
useOldLogoRenderSize,
|
|
162
161
|
});
|
|
163
162
|
};
|
|
164
163
|
const mapToVideoViewModel = (content, styles) => {
|
|
@@ -526,7 +525,7 @@ export const mapToBookingSectionViewModel = (content, styles) => {
|
|
|
526
525
|
isFullWidth: true,
|
|
527
526
|
}, styles);
|
|
528
527
|
};
|
|
529
|
-
export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages
|
|
528
|
+
export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages) => {
|
|
530
529
|
const viewport = pageHeader.viewport;
|
|
531
530
|
const logoContent = {
|
|
532
531
|
id: 'page-header-logo',
|
|
@@ -555,7 +554,7 @@ export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages, useOldLo
|
|
|
555
554
|
}), {});
|
|
556
555
|
return {
|
|
557
556
|
displayStyle: pageHeader.displayStyle,
|
|
558
|
-
logo: mapToLogoViewModel(logoContent, logoStyles
|
|
557
|
+
logo: mapToLogoViewModel(logoContent, logoStyles),
|
|
559
558
|
pages: pages.filter((p) => !p.isHidden),
|
|
560
559
|
navigation: viewport === VIEWPORTS.mobile
|
|
561
560
|
? new NavigationMobile({
|
|
@@ -575,7 +574,7 @@ export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages, useOldLo
|
|
|
575
574
|
backgroundColorEnabled: pageHeader.backgroundColorEnabled,
|
|
576
575
|
};
|
|
577
576
|
};
|
|
578
|
-
export const mapToPageFooterViewModel = (pageFooter, pageStyles
|
|
577
|
+
export const mapToPageFooterViewModel = (pageFooter, pageStyles) => {
|
|
579
578
|
const { logoImageBase64Url, logoImage, logoTemplateImage, logoImageHeight, logoImageWidth, isLogoVisible, } = pageFooter;
|
|
580
579
|
const logoContent = {
|
|
581
580
|
id: 'page-header-logo',
|
|
@@ -599,12 +598,12 @@ export const mapToPageFooterViewModel = (pageFooter, pageStyles, useOldLogoRende
|
|
|
599
598
|
copyrightStyle,
|
|
600
599
|
displayStyle: pageFooter.displayStyle,
|
|
601
600
|
iconStyle: Object.assign({ fill: pageStyles.textStyles?.style.color }, pageFooter.iconStyle),
|
|
602
|
-
logo: mapToLogoViewModel(logoContent, logoStyles
|
|
601
|
+
logo: mapToLogoViewModel(logoContent, logoStyles),
|
|
603
602
|
socialLinks: pageFooter.socialLinks,
|
|
604
603
|
textFontFamily: pageFooter.textFontFamily,
|
|
605
604
|
};
|
|
606
605
|
};
|
|
607
|
-
export const mapToViewModel = (styles, brandPageType
|
|
606
|
+
export const mapToViewModel = (styles, brandPageType) => (content) => {
|
|
608
607
|
switch (content.type) {
|
|
609
608
|
case 'image':
|
|
610
609
|
return mapToImageViewModel(content);
|
|
@@ -614,7 +613,7 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
|
|
|
614
613
|
if (brandPageType === BRAND_PAGE_TYPES.brandSite) {
|
|
615
614
|
return undefined;
|
|
616
615
|
}
|
|
617
|
-
return mapToLogoViewModel(content, styles.logoStyles,
|
|
616
|
+
return mapToLogoViewModel(content, styles.logoStyles, {
|
|
618
617
|
height: DEFAULT_LOGO_HEIGHT,
|
|
619
618
|
width: DEFAULT_LOGO_WIDTH,
|
|
620
619
|
});
|
|
@@ -671,10 +670,10 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
|
|
|
671
670
|
assertUnreachable();
|
|
672
671
|
}
|
|
673
672
|
};
|
|
674
|
-
export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true
|
|
673
|
+
export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true) => {
|
|
675
674
|
const pages = model.pages.map((p) => {
|
|
676
675
|
const contents = p.contents
|
|
677
|
-
.map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default
|
|
676
|
+
.map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default))
|
|
678
677
|
.filter((c) => c !== undefined);
|
|
679
678
|
return {
|
|
680
679
|
title: p.title,
|
|
@@ -688,10 +687,10 @@ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, s
|
|
|
688
687
|
pages,
|
|
689
688
|
showBrandCrowdLogo,
|
|
690
689
|
styles: model.styles,
|
|
691
|
-
headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages
|
|
692
|
-
headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages
|
|
693
|
-
footerViewModelDesktop: mapToPageFooterViewModel(model.pageFooterDesktop, model.styles
|
|
694
|
-
footerViewModelMobile: mapToPageFooterViewModel(model.pageFooterMobile, model.styles
|
|
690
|
+
headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages),
|
|
691
|
+
headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages),
|
|
692
|
+
footerViewModelDesktop: mapToPageFooterViewModel(model.pageFooterDesktop, model.styles),
|
|
693
|
+
footerViewModelMobile: mapToPageFooterViewModel(model.pageFooterMobile, model.styles),
|
|
695
694
|
brandPageType: model.brandPageType || BRAND_PAGE_TYPES.default,
|
|
696
695
|
faviconUrl: model.faviconUrl,
|
|
697
696
|
ogImageUrl: model.ogImageUrl,
|
|
@@ -32,7 +32,6 @@ export interface LogoViewModel extends ContentViewModel {
|
|
|
32
32
|
logoImageWidth: string | undefined;
|
|
33
33
|
/** @deprecated */
|
|
34
34
|
imageStyle?: LogoStyles['imageStyle'];
|
|
35
|
-
useOldLogoRenderSize?: boolean;
|
|
36
35
|
}
|
|
37
36
|
export interface ProfileViewModel extends ContentViewModel, Omit<ProfileContent, 'type'> {
|
|
38
37
|
containerStyle?: BrandPageCssStyle;
|
|
@@ -107,7 +107,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
107
107
|
setBrandPageType({ brandPageType }: {
|
|
108
108
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
109
109
|
}): void;
|
|
110
|
-
initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData,
|
|
110
|
+
initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, }: import("../../stores").InitialisePayload): Promise<void>;
|
|
111
111
|
initialisePages({ pages, sections, }: {
|
|
112
112
|
pages: import("../../../brand-page").PageModel[];
|
|
113
113
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -149,7 +149,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
149
149
|
setBrandPageType({ brandPageType }: {
|
|
150
150
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
151
151
|
}): void;
|
|
152
|
-
initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData,
|
|
152
|
+
initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, }: import("../../stores").InitialisePayload): Promise<void>;
|
|
153
153
|
initialisePages({ pages, sections, }: {
|
|
154
154
|
pages: import("../../../brand-page").PageModel[];
|
|
155
155
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -27,7 +27,6 @@ export declare const SampleBanner: {
|
|
|
27
27
|
export declare const SamplePersonalised: () => any;
|
|
28
28
|
export declare const SamplePublished: Story;
|
|
29
29
|
export declare const SamplePublishedWithCustomDomain: Story;
|
|
30
|
-
export declare const SamplePublishedBrandSiteWithLogo: Story;
|
|
31
30
|
export declare const SamplePublishedBrandSite: Story;
|
|
32
31
|
export declare const SampleProfile: {
|
|
33
32
|
(): any;
|