@designcrowd/library.brand-page 5.8.7 → 5.8.9-kp-1
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/brand-page/components/media/Shape.mixin.js +3 -0
- package/lib/src/brand-page/constants/misc.constants.d.ts +0 -22
- package/lib/src/brand-page/constants/misc.constants.js +0 -22
- package/lib/src/brand-page/constants/sections/footer-display.constants.d.ts +1 -1
- package/lib/src/brand-page/constants/sections/footer-display.constants.js +4 -3
- package/lib/src/brand-page/models/index.d.ts +1 -0
- package/lib/src/brand-page/models/styles.model.js +5 -4
- package/lib/src/brand-page/models/user-personalisation.model.d.ts +21 -1
- package/lib/src/brand-page/models/user-personalisation.model.js +6 -1
- package/lib/src/brand-page/utils/color.util.d.ts +2 -0
- package/lib/src/brand-page/utils/color.util.js +13 -0
- package/lib/src/brand-page/utils/personalisation.util.d.ts +2 -0
- package/lib/src/brand-page/utils/personalisation.util.js +95 -3
- package/lib/src/brand-page/utils/style.util.d.ts +6 -2
- package/lib/src/brand-page/utils/style.util.js +43 -27
- package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +2 -23
- package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +2 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +24 -22
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +13 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.d.ts +48 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1580 -139
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +24 -22
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +2 -2
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.js +2 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.js +17 -14
- package/lib/src/brand-page-maker/constants/config-settings-constant.d.ts +38 -38
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +564 -555
- package/lib/src/brand-page-maker/convertors/align-display-style.convertor.js +3 -2
- package/lib/src/brand-page-maker/convertors/button-link-style.convertor.js +5 -4
- package/lib/src/brand-page-maker/convertors/display-style.convertor.js +3 -2
- package/lib/src/brand-page-maker/convertors/divider-style.convertor.js +4 -3
- package/lib/src/brand-page-maker/convertors/gallery-type.convertor.js +4 -3
- package/lib/src/brand-page-maker/convertors/image-aspect-ratio.convertor.js +4 -3
- package/lib/src/brand-page-maker/convertors/payment-display-type.convertor.js +4 -3
- package/lib/src/brand-page-maker/convertors/shape-size-options.convertor.js +4 -3
- package/lib/src/brand-page-maker/convertors/shop-aspect-ratio.convertor.js +3 -2
- package/lib/src/brand-page-maker/convertors/shop-display-type.convertor.js +4 -3
- package/lib/src/brand-page-maker/convertors/social-links-icon-display-style.convertor.js +4 -3
- package/lib/src/brand-page-maker/convertors/testimonial-display-style-convertor.js +4 -3
- package/lib/src/brand-page-maker/models/content-settings.js +21 -20
- package/lib/src/brand-page-maker/models/navigation-style-configs.d.ts +1 -1
- package/lib/src/brand-page-maker/models/navigation-style-configs.js +11 -10
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +2 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store-utils.js +1 -1
- package/lib/src/brand-page-maker/utils/content-settings.util.js +1 -1
- package/lib/src/bundled-translations-CIiqyFfN.js +541 -0
- package/lib/src/bundles/bundled-translations.json +498 -0
- package/lib/src/composables/useTranslate.d.ts +44 -0
- package/lib/src/composables/useTranslate.js +74 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +25 -25
- package/lib/src/css/library.brand-page-brandPage.min.css +25 -25
- package/lib/src/css/library.brand-page-designCom.min.css +25 -25
- package/lib/src/css/library.brand-page-preview.min.css +25 -25
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.mjs +25181 -22608
- package/lib/src/lib.js +1 -0
- package/lib/src/models/shapeModels.d.ts +1 -0
- package/lib/src/plugins/bundle-translations-plugin/bundle-translations-plugin.d.ts +4 -0
- package/lib/src/plugins/bundle-translations-plugin/bundle-translations-plugin.js +58 -0
- package/lib/src/shared/background-settings/components/background-color/BackgroundColorSettings.mixin.d.ts +2 -1
- package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +2 -1
- package/lib/src/shared/background-settings/models/background-settings-models.d.ts +0 -1
- package/lib/src/shared/background-settings/models/background-settings-models.js +0 -14
- package/lib/src/shared/background-settings/store/background-settings-store.d.ts +2 -1
- package/lib/src/shared/background-settings/store/background-settings-store.js +2 -1
- package/lib/src/shared/color-picker/components/ColorPicker.mixin.js +3 -2
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.js +2 -1
- package/lib/src/shared/content-settings/components/color-field/ColorField.mixin.d.ts +10 -27
- package/lib/src/shared/content-settings/components/color-field/ColorField.mixin.js +7 -5
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +24 -22
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +2 -2
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +25 -23
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.js +5 -3
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +23 -21
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +22 -20
- package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +21 -19
- package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +4 -1
- package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +7 -6
- package/lib/src/shared/content-settings/components/personalisation-role-field/PersonalisationRoleField.mixin.d.ts +21 -19
- package/lib/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.mixin.js +8 -5
- package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +21 -19
- package/lib/src/shared/content-settings/store/content-settings-store.js +9 -8
- package/lib/src/shared/content-settings/utils.js +1 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +8 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +16 -4
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/my-uploads/models.d.ts +1 -0
- package/lib/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.js +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +26 -24
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.js +8 -2
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +25 -23
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +17 -4
- package/lib/src/shared/shape-library/ShapeLibrary.mixin.d.ts +1 -1
- package/lib/src/shared/shape-library/ShapeLibrary.mixin.js +15 -3
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +3 -24
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +6 -5
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +231 -18
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.js +11 -7
- package/lib/src/shared/template-settings/store/template-settings-store.d.ts +8 -2
- package/lib/src/shared/template-settings/store/template-settings-store.js +23 -5
- package/package.json +3 -1
- package/src/brand-page/components/media/Shape.mixin.ts +4 -0
- package/src/brand-page/constants/misc.constants.ts +0 -22
- package/src/brand-page/constants/sections/footer-display.constants.ts +4 -3
- package/src/brand-page/models/i18n/index-translation.json +6 -0
- package/src/brand-page/models/index.ts +1 -0
- package/src/brand-page/models/styles.model.ts +6 -4
- package/src/brand-page/models/user-personalisation.model.ts +24 -1
- package/src/brand-page/utils/color.util.test.ts +47 -0
- package/src/brand-page/utils/color.util.ts +18 -0
- package/src/brand-page/utils/personalisation.util.ts +131 -3
- package/src/brand-page/utils/style.util.test.ts +1 -0
- package/src/brand-page/utils/style.util.ts +94 -27
- package/src/brand-page-maker/components/action-bar/ActionBar.vue +7 -3
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.vue +9 -3
- package/src/brand-page-maker/components/action-bar/i18n/action-bar-translation.json +7 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +1 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +13 -2
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1583 -139
- package/src/brand-page-maker/components/brandpage-settings/BrandPageSettings.vue +29 -18
- package/src/brand-page-maker/components/brandpage-settings/i18n/brand-page-settings-translation.json +13 -0
- package/src/brand-page-maker/components/color-palette/BpColorPicker.vue +7 -1
- package/src/brand-page-maker/components/color-palette/i18n/color-palette-translation.json +5 -0
- package/src/brand-page-maker/components/cookie-collection/CookieSettings.vue +41 -16
- package/src/brand-page-maker/components/cookie-collection/i18n/cookie-settings-translation.json +7 -0
- package/src/brand-page-maker/components/google-analytics/GoogleAnalytics.vue +17 -14
- package/src/brand-page-maker/components/google-analytics/i18n/google-analytics-translation.json +7 -0
- package/src/brand-page-maker/components/navigation/Navigation.mixin.ts +2 -1
- package/src/brand-page-maker/components/navigation/Navigation.vue +4 -0
- package/src/brand-page-maker/components/navigation/i18n/navigation-translation.json +7 -0
- package/src/brand-page-maker/components/sensitive-content/SensitiveContent.vue +10 -5
- package/src/brand-page-maker/components/sensitive-content/i18n/sensitive-settings-translation.json +5 -0
- package/src/brand-page-maker/components/seo-settings/SeoPageSettings.vue +18 -11
- package/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.ts +17 -14
- package/src/brand-page-maker/components/seo-settings/UrlSettings.vue +31 -27
- package/src/brand-page-maker/components/seo-settings/i18n/seo-settings-translation.json +34 -0
- package/src/brand-page-maker/components/social-share/SocialShare.vue +14 -9
- package/src/brand-page-maker/components/social-share/i18n/social-share-translation.json +9 -0
- package/src/brand-page-maker/constants/config-settings-constant.ts +825 -806
- package/src/brand-page-maker/convertors/align-display-style.convertor.ts +3 -2
- package/src/brand-page-maker/convertors/button-link-style.convertor.ts +5 -5
- package/src/brand-page-maker/convertors/display-style.convertor.ts +3 -2
- package/src/brand-page-maker/convertors/divider-style.convertor.ts +4 -3
- package/src/brand-page-maker/convertors/gallery-type.convertor.ts +4 -3
- package/src/brand-page-maker/convertors/i18n/converter-translation.json +26 -0
- package/src/brand-page-maker/convertors/image-aspect-ratio.convertor.ts +4 -3
- package/src/brand-page-maker/convertors/payment-display-type.convertor.ts +4 -3
- package/src/brand-page-maker/convertors/shape-size-options.convertor.ts +4 -3
- package/src/brand-page-maker/convertors/shop-aspect-ratio.convertor.ts +3 -2
- package/src/brand-page-maker/convertors/shop-display-type.convertor.ts +4 -3
- package/src/brand-page-maker/convertors/social-links-icon-display-style.convertor.ts +4 -3
- package/src/brand-page-maker/convertors/testimonial-display-style-convertor.ts +4 -3
- package/src/brand-page-maker/models/content-settings.ts +21 -21
- package/src/brand-page-maker/models/i18n/models-translation.json +12 -0
- package/src/brand-page-maker/models/navigation-style-configs.ts +12 -11
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +2 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store-utils.ts +1 -1
- package/src/brand-page-maker/utils/content-settings.util.ts +1 -1
- package/src/bundles/bundled-translations.json +498 -0
- package/src/composables/useTranslate.ts +129 -0
- package/src/lib.ts +1 -0
- package/src/models/shapeModels.ts +1 -0
- package/src/plugins/bundle-translations-plugin/bundle-translations-plugin.ts +83 -0
- package/src/shared/background-settings/components/BackgroundSettings.vue +188 -30
- package/src/shared/background-settings/components/i18n/background-settings-translation.json +12 -0
- package/src/shared/background-settings/models/background-settings-models.ts +0 -15
- package/src/shared/background-settings/store/background-settings-store.ts +3 -0
- package/src/shared/color-picker/components/ColorPicker.mixin.ts +3 -2
- package/src/shared/color-picker/components/i18n/color-picker-translation.json +7 -0
- package/src/shared/common/SideBarSettingsHeader.vue +17 -21
- package/src/shared/common/i18n/common-translation.json +48 -0
- package/src/shared/content-settings/components/GenericTextInput.mixin.ts +2 -1
- package/src/shared/content-settings/components/color-field/ColorField.mixin.ts +7 -5
- package/src/shared/content-settings/components/color-field/i18n/color-field-translation.json +7 -0
- package/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.vue +128 -38
- package/src/shared/content-settings/components/color-replacements-field/i18n/color-replacement-field-translation.json +5 -0
- package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +2 -2
- package/src/shared/content-settings/components/content-settings/ContentSettings.vue +10 -6
- package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.ts +5 -3
- package/src/shared/content-settings/components/content-settings/i18n/content-settings-translation.json +180 -0
- package/src/shared/content-settings/components/form-fields-field/FormFieldsField.vue +12 -2
- package/src/shared/content-settings/components/form-fields-field/i18n/form-fields-translation.json +6 -0
- package/src/shared/content-settings/components/i18n/generic-text-input-translation.json +5 -0
- package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +4 -1
- package/src/shared/content-settings/components/image-field/ImageField.vue +9 -2
- package/src/shared/content-settings/components/images-field/ImagesField.vue +17 -3
- package/src/shared/content-settings/components/images-field/i18n/images-field-translation.json +9 -0
- package/src/shared/content-settings/components/links-field/LinksField.vue +8 -2
- package/src/shared/content-settings/components/links-field/i18n/links-field-translation.json +6 -0
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +8 -5
- package/src/shared/content-settings/components/logo-selection-field/i18n/logo-selection-translation.json +6 -0
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +7 -6
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.vue +9 -4
- package/src/shared/content-settings/components/payment-config-field/i18n/payment-config-translation.json +19 -0
- package/src/shared/content-settings/components/payment-config-field/payment-link-display-style-field/PaymentImageStyleField.vue +7 -1
- package/src/shared/content-settings/components/payment-config-field/support-me-config-field/SupportMeConfigField.vue +16 -4
- package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.mixin.ts +9 -5
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting-translation.json +9 -0
- package/src/shared/content-settings/components/shape-field/ShapeField.vue +9 -3
- package/src/shared/content-settings/components/shape-field/i18n/shape-field-translation.json +7 -0
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +22 -8
- package/src/shared/content-settings/components/testimonial-items-field/i18n/testimonial-items-field-translation.json +12 -0
- package/src/shared/content-settings/components/text-field/TextField.vue +7 -1
- package/src/shared/content-settings/components/text-field/i18n/text-field-translation.json +5 -0
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +27 -11
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field-translation.json +16 -0
- package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +8 -2
- package/src/shared/content-settings/components/text-items-field/i18n/text-items-field-translation.json +6 -0
- package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +14 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field-translation.json +13 -0
- package/src/shared/content-settings/components/textarea-field/TextareaField.vue +7 -1
- package/src/shared/content-settings/components/textarea-field/i18n/text-area-field-translation.json +5 -0
- package/src/shared/content-settings/store/content-settings-store.ts +12 -7
- package/src/shared/content-settings/utils.ts +1 -1
- package/src/shared/ecommerce-settings/components/product-config-field/ProductConfigOption.vue +2 -1
- package/src/shared/ecommerce-settings/components/product-config-field/i18n/product-config-option-translation.json +5 -0
- package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +19 -4
- package/src/shared/logo-settings/components/EditLogoSettings.vue +14 -10
- package/src/shared/logo-settings/components/i18n/edit-logo-settings-translation.json +13 -0
- package/src/shared/my-uploads/MyMedia.vue +10 -8
- package/src/shared/my-uploads/MyUploads.vue +6 -2
- package/src/shared/my-uploads/i18n/my-uploads-translation.json +8 -0
- package/src/shared/my-uploads/models.ts +1 -0
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.ts +1 -1
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +9 -3
- package/src/shared/page-settings/components/page-settings/PageSettings.mixin.ts +9 -2
- package/src/shared/page-settings/components/page-settings/PageSettings.vue +11 -8
- package/src/shared/page-settings/components/page-settings/i18n/page-settings-translation.json +13 -0
- package/src/shared/page-settings/components/page-settings-section-styles/FooterDisplayStyle.vue +3 -2
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.vue +2 -1
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderNavigationType.vue +2 -1
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +18 -4
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.vue +15 -10
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section-translation.json +10 -0
- package/src/shared/shape-library/ShapeLibrary.mixin.ts +19 -3
- package/src/shared/shape-library/ShapeLibrary.vue +7 -3
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +6 -7
- package/src/shared/style-settings/components/StyleSettings.vue +13 -8
- package/src/shared/style-settings/components/i18n/style-settings-translation.json +17 -0
- package/src/shared/template-settings/components/TemplatesSettings.mixin.ts +15 -7
- package/src/shared/template-settings/components/TemplatesSettings.vue +13 -9
- package/src/shared/template-settings/components/i18n/template-settings-translation.json +10 -0
- package/src/shared/template-settings/store/template-settings-store.ts +32 -6
- package/src/shared/unsplash-library/UnsplashLibrary.vue +13 -8
- package/src/shared/unsplash-library/i18n/unsplash-library-translation.json +6 -0
- package/lib/src/brand-page-maker/components/cookie-collection/CookieSettings.mixin.d.ts +0 -139
- package/lib/src/brand-page-maker/components/cookie-collection/CookieSettings.mixin.js +0 -40
- package/lib/src/shared/background-settings/components/BackgroundSettings.mixin.d.ts +0 -226
- package/lib/src/shared/background-settings/components/BackgroundSettings.mixin.js +0 -115
- package/lib/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.mixin.d.ts +0 -112
- package/lib/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.mixin.js +0 -104
- package/src/brand-page-maker/components/cookie-collection/CookieSettings.mixin.ts +0 -43
- package/src/shared/background-settings/components/BackgroundSettings.mixin.ts +0 -165
- package/src/shared/content-settings/components/color-replacements-field/ColorReplacementsField.mixin.ts +0 -118
|
@@ -75,6 +75,9 @@ export default defineComponent({
|
|
|
75
75
|
},
|
|
76
76
|
methods: {
|
|
77
77
|
async rerender() {
|
|
78
|
+
if (!this.originalSvgData) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
78
81
|
this.svgData = applyColorReplacementsToSvgString(this.originalSvgData, this.colorReplacements);
|
|
79
82
|
this.svgData = this.svgData.replace('<svg ', `<svg ${this.svgAttributes} `);
|
|
80
83
|
},
|
|
@@ -41,28 +41,6 @@ export declare const HEADER_CSRF_TOKEN = "csrf-token";
|
|
|
41
41
|
export declare const STYLE_THEME_KEYS: Readonly<{
|
|
42
42
|
LogoTextColor: "logo-text-color";
|
|
43
43
|
LogoBackgroundColor: "logo-background-color";
|
|
44
|
-
LogoTextColor50: "logo-text-color-50";
|
|
45
|
-
LogoTextColor100: "logo-text-color-100";
|
|
46
|
-
LogoTextColor200: "logo-text-color-200";
|
|
47
|
-
LogoTextColor300: "logo-text-color-300";
|
|
48
|
-
LogoTextColor400: "logo-text-color-400";
|
|
49
|
-
LogoTextColor500: "logo-text-color-500";
|
|
50
|
-
LogoTextColor600: "logo-text-color-600";
|
|
51
|
-
LogoTextColor700: "logo-text-color-700";
|
|
52
|
-
LogoTextColor800: "logo-text-color-800";
|
|
53
|
-
LogoTextColor900: "logo-text-color-900";
|
|
54
|
-
LogoTextColor950: "logo-text-color-950";
|
|
55
|
-
LogoBackgroundColor50: "logo-background-color-50";
|
|
56
|
-
LogoBackgroundColor100: "logo-background-color-100";
|
|
57
|
-
LogoBackgroundColor200: "logo-background-color-200";
|
|
58
|
-
LogoBackgroundColor300: "logo-background-color-300";
|
|
59
|
-
LogoBackgroundColor400: "logo-background-color-400";
|
|
60
|
-
LogoBackgroundColor500: "logo-background-color-500";
|
|
61
|
-
LogoBackgroundColor600: "logo-background-color-600";
|
|
62
|
-
LogoBackgroundColor700: "logo-background-color-700";
|
|
63
|
-
LogoBackgroundColor800: "logo-background-color-800";
|
|
64
|
-
LogoBackgroundColor900: "logo-background-color-900";
|
|
65
|
-
LogoBackgroundColor950: "logo-background-color-950";
|
|
66
44
|
}>;
|
|
67
45
|
export declare const BoxShadowSpread = 0.5;
|
|
68
46
|
export declare const ButtonBoxShadowSize = "3px 3px 0px 0px";
|
|
@@ -50,28 +50,6 @@ export const HEADER_CSRF_TOKEN = 'csrf-token';
|
|
|
50
50
|
export const STYLE_THEME_KEYS = Object.freeze({
|
|
51
51
|
LogoTextColor: 'logo-text-color',
|
|
52
52
|
LogoBackgroundColor: 'logo-background-color',
|
|
53
|
-
LogoTextColor50: 'logo-text-color-50',
|
|
54
|
-
LogoTextColor100: 'logo-text-color-100',
|
|
55
|
-
LogoTextColor200: 'logo-text-color-200',
|
|
56
|
-
LogoTextColor300: 'logo-text-color-300',
|
|
57
|
-
LogoTextColor400: 'logo-text-color-400',
|
|
58
|
-
LogoTextColor500: 'logo-text-color-500',
|
|
59
|
-
LogoTextColor600: 'logo-text-color-600',
|
|
60
|
-
LogoTextColor700: 'logo-text-color-700',
|
|
61
|
-
LogoTextColor800: 'logo-text-color-800',
|
|
62
|
-
LogoTextColor900: 'logo-text-color-900',
|
|
63
|
-
LogoTextColor950: 'logo-text-color-950',
|
|
64
|
-
LogoBackgroundColor50: 'logo-background-color-50',
|
|
65
|
-
LogoBackgroundColor100: 'logo-background-color-100',
|
|
66
|
-
LogoBackgroundColor200: 'logo-background-color-200',
|
|
67
|
-
LogoBackgroundColor300: 'logo-background-color-300',
|
|
68
|
-
LogoBackgroundColor400: 'logo-background-color-400',
|
|
69
|
-
LogoBackgroundColor500: 'logo-background-color-500',
|
|
70
|
-
LogoBackgroundColor600: 'logo-background-color-600',
|
|
71
|
-
LogoBackgroundColor700: 'logo-background-color-700',
|
|
72
|
-
LogoBackgroundColor800: 'logo-background-color-800',
|
|
73
|
-
LogoBackgroundColor900: 'logo-background-color-900',
|
|
74
|
-
LogoBackgroundColor950: 'logo-background-color-950',
|
|
75
53
|
});
|
|
76
54
|
export const BoxShadowSpread = 0.5;
|
|
77
55
|
export const ButtonBoxShadowSize = '3px 3px 0px 0px';
|
|
@@ -11,5 +11,5 @@ export type FooterDisplayStyle = (typeof FOOTER_DISPLAY)[keyof typeof FOOTER_DIS
|
|
|
11
11
|
interface FooterDisplayStyleConfig {
|
|
12
12
|
option: ButtonGroupOption;
|
|
13
13
|
}
|
|
14
|
-
export declare const FOOTER_DISPLAY_STYLE_CONFIGS: FooterDisplayStyleConfig[];
|
|
14
|
+
export declare const FOOTER_DISPLAY_STYLE_CONFIGS: () => FooterDisplayStyleConfig[];
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ALIGN_CENTERED, ALIGN_JUSTIFIED } from '../misc.constants';
|
|
2
|
+
import { tr, commonTr } from '../../../composables/useTranslate';
|
|
2
3
|
export const FOOTER_DISPLAY = {
|
|
3
4
|
/** @deprecated */
|
|
4
5
|
ALIGN_CENTERED, // mapped to CENTERED
|
|
@@ -7,7 +8,7 @@ export const FOOTER_DISPLAY = {
|
|
|
7
8
|
CENTERED: 'centered-menu',
|
|
8
9
|
JUSTIFIED: 'justified-menu',
|
|
9
10
|
};
|
|
10
|
-
export const FOOTER_DISPLAY_STYLE_CONFIGS = [
|
|
11
|
+
export const FOOTER_DISPLAY_STYLE_CONFIGS = () => [
|
|
11
12
|
{
|
|
12
13
|
option: {
|
|
13
14
|
value: FOOTER_DISPLAY.CENTERED,
|
|
@@ -15,7 +16,7 @@ export const FOOTER_DISPLAY_STYLE_CONFIGS = [
|
|
|
15
16
|
iconViewBox: '0 0 169 57',
|
|
16
17
|
dataAttribute: FOOTER_DISPLAY.CENTERED,
|
|
17
18
|
isSelected: false,
|
|
18
|
-
title: '
|
|
19
|
+
title: commonTr('centered'),
|
|
19
20
|
},
|
|
20
21
|
},
|
|
21
22
|
{
|
|
@@ -25,7 +26,7 @@ export const FOOTER_DISPLAY_STYLE_CONFIGS = [
|
|
|
25
26
|
iconViewBox: '0 0 169 57',
|
|
26
27
|
dataAttribute: FOOTER_DISPLAY.JUSTIFIED,
|
|
27
28
|
isSelected: false,
|
|
28
|
-
title: '
|
|
29
|
+
title: commonTr('justified'),
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
];
|
|
@@ -277,6 +277,7 @@ export interface TextMediaItem extends ImageItem {
|
|
|
277
277
|
export interface TextShapeItem extends TextMediaItem {
|
|
278
278
|
colorReplacements: ColorReplacement[];
|
|
279
279
|
mediaType: 'shape';
|
|
280
|
+
aspectRatio?: number | null;
|
|
280
281
|
}
|
|
281
282
|
export interface ShapeItem extends ImageItem {
|
|
282
283
|
colorReplacements: ColorReplacement[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FONT_SIZE_HEADINGS, FONT_SIZE_TITLE, LINE_HEIGHT_HEADINGS, LINE_HEIGHT_TITLE, FONT_SIZE_BODY, LINE_HEIGHT_BODY, DISPLAY_TEXT_TITLE, DISPLAY_TEXT_HEADINGS, DISPLAY_TEXT_BODY, STYLE_THEME_KEYS, FONT_FAMILY_CONFIGS, DEFAULT_FONT_FAMILY_KEY, DISPlAY_TEXT_BUTTONS, } from '../constants';
|
|
2
|
+
import { styleSettingsTr } from '../../composables/useTranslate';
|
|
2
3
|
export const TEXT_STYLE_TYPES = {
|
|
3
4
|
titles: 'titles',
|
|
4
5
|
headings: 'headings',
|
|
@@ -81,13 +82,13 @@ export class TextStyles {
|
|
|
81
82
|
this.textFontFamily = option.textFontFamily || DEFAULT_FONT_FAMILY_KEY;
|
|
82
83
|
this.textStyleOptions = option.textStyleOptions
|
|
83
84
|
? {
|
|
84
|
-
[TEXT_STYLE_TYPES.titles]: new TextStyleOption(TEXT_STYLE_TYPES.titles,
|
|
85
|
+
[TEXT_STYLE_TYPES.titles]: new TextStyleOption(TEXT_STYLE_TYPES.titles, styleSettingsTr('titles'), option.textStyleOptions.titles ||
|
|
85
86
|
createDefaultTitlesTextStyleOption()),
|
|
86
|
-
[TEXT_STYLE_TYPES.headings]: new TextStyleOption(TEXT_STYLE_TYPES.headings,
|
|
87
|
+
[TEXT_STYLE_TYPES.headings]: new TextStyleOption(TEXT_STYLE_TYPES.headings, styleSettingsTr('headings'), option.textStyleOptions.headings ||
|
|
87
88
|
createDefaultHeadingsTextStyleOption()),
|
|
88
|
-
[TEXT_STYLE_TYPES.paragraphs]: new TextStyleOption(TEXT_STYLE_TYPES.paragraphs,
|
|
89
|
+
[TEXT_STYLE_TYPES.paragraphs]: new TextStyleOption(TEXT_STYLE_TYPES.paragraphs, styleSettingsTr('paragraphs'), option.textStyleOptions.paragraphs ||
|
|
89
90
|
createDefaultParagraphTextStyleOption()),
|
|
90
|
-
[TEXT_STYLE_TYPES.buttons]: new TextStyleOption(TEXT_STYLE_TYPES.buttons,
|
|
91
|
+
[TEXT_STYLE_TYPES.buttons]: new TextStyleOption(TEXT_STYLE_TYPES.buttons, styleSettingsTr('buttons'), option.textStyleOptions.buttons ||
|
|
91
92
|
createDefaultButtonTextStyleOption()),
|
|
92
93
|
}
|
|
93
94
|
: createDefaultTextStyleOptions();
|
|
@@ -23,7 +23,8 @@ export interface UserPersonalisationSection {
|
|
|
23
23
|
imageSearchTerms?: string[];
|
|
24
24
|
imageUrls?: ImageUrl[];
|
|
25
25
|
shapeSearchTerms?: string[];
|
|
26
|
-
|
|
26
|
+
mainShapesCollection: ShapeAspectRatioCollection;
|
|
27
|
+
shapes: Shape[];
|
|
27
28
|
items?: UserPersonalisationItem[];
|
|
28
29
|
}
|
|
29
30
|
export interface UserPersonalisationItem {
|
|
@@ -49,6 +50,25 @@ export interface Shape {
|
|
|
49
50
|
shapeCategoryId: number;
|
|
50
51
|
shapeCategory: any;
|
|
51
52
|
}
|
|
53
|
+
export interface ShapeEsModel {
|
|
54
|
+
token: string;
|
|
55
|
+
url: string;
|
|
56
|
+
categories: string[];
|
|
57
|
+
tags: string[];
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
keepColor: boolean;
|
|
60
|
+
enabledToAdmin: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface ShapeAspectRatioCollection {
|
|
63
|
+
tall: ShapeEsModel[];
|
|
64
|
+
square: ShapeEsModel[];
|
|
65
|
+
wide: ShapeEsModel[];
|
|
66
|
+
}
|
|
67
|
+
export declare enum ShapeAspectRatioCategory {
|
|
68
|
+
Tall = "tall",
|
|
69
|
+
Square = "square",
|
|
70
|
+
Wide = "wide"
|
|
71
|
+
}
|
|
52
72
|
export type ContentPersonalisationMapping<T extends Content> = {
|
|
53
73
|
[key in keyof UserPersonalisationSection]?: (keyof T)[];
|
|
54
74
|
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var ShapeAspectRatioCategory;
|
|
2
|
+
(function (ShapeAspectRatioCategory) {
|
|
3
|
+
ShapeAspectRatioCategory["Tall"] = "tall";
|
|
4
|
+
ShapeAspectRatioCategory["Square"] = "square";
|
|
5
|
+
ShapeAspectRatioCategory["Wide"] = "wide";
|
|
6
|
+
})(ShapeAspectRatioCategory || (ShapeAspectRatioCategory = {}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LogoTheme, Theme } from '../models';
|
|
2
|
+
import { type ColorInstance } from 'color';
|
|
2
3
|
export declare const luminance: (r: number, g: number, b: number) => number;
|
|
3
4
|
export declare const calculateLuminanceRatio: (color1: string, color2: string) => number;
|
|
4
5
|
export declare const isHexTransparent: (hex: string) => boolean;
|
|
@@ -7,3 +8,4 @@ export declare const addTransparentAlphaChannelToHex: (hex: string) => string;
|
|
|
7
8
|
export declare const addOpacityToHex: (hex: string, opacity: number) => string;
|
|
8
9
|
export declare const setRgbAlpha: (rgb: string, alpha: number) => string;
|
|
9
10
|
export declare const getThemeByTextStyleAndLogoTheme: (textStyle: BrandPageCssStyle, logoTheme: LogoTheme) => Theme;
|
|
11
|
+
export declare const getNewColorBasedOnTargetColorTheme: (originalColor: string, targetColor: string) => ColorInstance | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import isHexColor from 'validator/lib/isHexColor';
|
|
2
2
|
import { hexToRGBA, isColor } from '../../utils/helpers';
|
|
3
|
+
import Color, {} from 'color';
|
|
3
4
|
// function from https://stackoverflow.com/a/9733420/3695983
|
|
4
5
|
export const luminance = (r, g, b) => {
|
|
5
6
|
const a = [r, g, b].map(function (v) {
|
|
@@ -62,3 +63,15 @@ export const getThemeByTextStyleAndLogoTheme = (textStyle, logoTheme) => {
|
|
|
62
63
|
secondaryColor,
|
|
63
64
|
};
|
|
64
65
|
};
|
|
66
|
+
export const getNewColorBasedOnTargetColorTheme = (originalColor, targetColor) => {
|
|
67
|
+
try {
|
|
68
|
+
const originalColorGrayScaled = Color(originalColor).grayscale().hsl();
|
|
69
|
+
const targetHslColor = Color(targetColor)
|
|
70
|
+
.hsl()
|
|
71
|
+
.lightness(originalColorGrayScaled.lightness());
|
|
72
|
+
return targetHslColor.rgb();
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ShapeAspectRatioCategory } from '../models';
|
|
1
2
|
import type { BrandPageModel, PageModel, PageStyles, UserPersonalisation, UserPersonalisationWithIndices } from '../models';
|
|
3
|
+
export declare const filterPersonalisationByShapesAspectRatio: (personalisation: UserPersonalisationWithIndices, aspectRatio: ShapeAspectRatioCategory | null) => UserPersonalisationWithIndices;
|
|
2
4
|
export declare const applyUserPersonalisationToBrandPageContentsAsync: (userPersonalisation: UserPersonalisationWithIndices, pages: PageModel[]) => Promise<{
|
|
3
5
|
pages: PageModel[];
|
|
4
6
|
isModified: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DEFAULT_PERSONALISATION_MAPPING, PERSONALISATION_MAPPINGS, TEXT_MEDIA_CONTENT_TYPES, } from '../../brand-page-maker/constants/personalisation.constant';
|
|
2
|
-
import { BRAND_PAGE_TYPES } from '../models';
|
|
2
|
+
import { BRAND_PAGE_TYPES, ShapeAspectRatioCategory } from '../models';
|
|
3
3
|
import { getColorReplacementsFromSvgString, getColorReplacementsFromSvgStringServer, } from './svg-color.util';
|
|
4
|
+
const ASPECT_RATIO_LOWER_CUT_OFF = 0.5;
|
|
5
|
+
const ASPECT_RATIO_UPPER_CUT_OFF = 1.5;
|
|
4
6
|
const getPersonalisationMappingForContentType = (contentType) => {
|
|
5
7
|
const baseMapping = Object.assign({}, DEFAULT_PERSONALISATION_MAPPING);
|
|
6
8
|
const contentBasedMapping = PERSONALISATION_MAPPINGS[contentType];
|
|
@@ -49,7 +51,21 @@ const getPersonalisationValueAsync = async (section, property, value, brandPageT
|
|
|
49
51
|
break;
|
|
50
52
|
case 'imageSearchTerms':
|
|
51
53
|
case 'shapeSearchTerms':
|
|
52
|
-
if (section.
|
|
54
|
+
if (section.mainShapesCollection.tall.length > 0 ||
|
|
55
|
+
section.mainShapesCollection.square.length > 0 ||
|
|
56
|
+
section.mainShapesCollection.wide.length > 0) {
|
|
57
|
+
const aspectRatioCategory = section.mainShapesCollection.tall.length > 0
|
|
58
|
+
? ShapeAspectRatioCategory.Tall
|
|
59
|
+
: section.mainShapesCollection.square.length > 0
|
|
60
|
+
? ShapeAspectRatioCategory.Square
|
|
61
|
+
: ShapeAspectRatioCategory.Wide;
|
|
62
|
+
return {
|
|
63
|
+
value: propertyValue[section.shapeIndex %
|
|
64
|
+
section.mainShapesCollection[aspectRatioCategory].length],
|
|
65
|
+
section,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
else if (section.shapes) {
|
|
53
69
|
return {
|
|
54
70
|
value: propertyValue[section.shapeIndex % section.shapes.length],
|
|
55
71
|
section,
|
|
@@ -57,7 +73,33 @@ const getPersonalisationValueAsync = async (section, property, value, brandPageT
|
|
|
57
73
|
}
|
|
58
74
|
break;
|
|
59
75
|
case 'shapes':
|
|
60
|
-
|
|
76
|
+
console.log(section.mainShapesCollection, 'NEW PERSONALISATION');
|
|
77
|
+
if (section.mainShapesCollection.tall.length > 0 ||
|
|
78
|
+
section.mainShapesCollection.square.length > 0 ||
|
|
79
|
+
section.mainShapesCollection.wide.length > 0) {
|
|
80
|
+
const aspectRatioCategory = section.mainShapesCollection.tall.length > 0
|
|
81
|
+
? ShapeAspectRatioCategory.Tall
|
|
82
|
+
: section.mainShapesCollection.square.length > 0
|
|
83
|
+
? ShapeAspectRatioCategory.Square
|
|
84
|
+
: ShapeAspectRatioCategory.Wide;
|
|
85
|
+
const shapeUrl = propertyValue[section.shapeIndex %
|
|
86
|
+
section.mainShapesCollection[aspectRatioCategory].length].url;
|
|
87
|
+
const svgResponse = await (await fetch(shapeUrl)).text();
|
|
88
|
+
const colorReplacements = typeof DOMParser !== 'undefined'
|
|
89
|
+
? getColorReplacementsFromSvgString(svgResponse)
|
|
90
|
+
: getColorReplacementsFromSvgStringServer(svgResponse);
|
|
91
|
+
return {
|
|
92
|
+
value: shapeUrl,
|
|
93
|
+
section: {
|
|
94
|
+
...section,
|
|
95
|
+
shapeIndex: section.shapeIndex + 1,
|
|
96
|
+
},
|
|
97
|
+
valuesToUpdate: {
|
|
98
|
+
colorReplacements,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
else if (section.shapes) {
|
|
61
103
|
const shapeUrl = propertyValue[section.shapeIndex % section.shapes.length].url;
|
|
62
104
|
const svgResponse = await (await fetch(shapeUrl)).text();
|
|
63
105
|
const colorReplacements = typeof DOMParser !== 'undefined'
|
|
@@ -163,6 +205,14 @@ const applyPersonalisationToBrandPageContentsRecursiveAsync = async (personalisa
|
|
|
163
205
|
continue;
|
|
164
206
|
}
|
|
165
207
|
if (value) {
|
|
208
|
+
if (mappingType === 'text-media-items' &&
|
|
209
|
+
key === 'aspectRatio' &&
|
|
210
|
+
!isNaN(Number(value))) {
|
|
211
|
+
const aspectRatioIndex = Number(value);
|
|
212
|
+
const aspectRatio = getShapeAspectRatioCategory(aspectRatioIndex);
|
|
213
|
+
alert(aspectRatio);
|
|
214
|
+
newPersonalisation = filterPersonalisationByShapesAspectRatio(newPersonalisation, aspectRatio);
|
|
215
|
+
}
|
|
166
216
|
const { personalisation: updatedPersonalisation, value: personalisationValue, valuesToUpdate: newValuesToUpdate, } = await getPersonalisationValueFromPropertyAsync(key, value, personalisationRole, newPersonalisation, mappingType);
|
|
167
217
|
newPersonalisation = updatedPersonalisation;
|
|
168
218
|
if (personalisationValue) {
|
|
@@ -204,6 +254,48 @@ const applyPersonalisationToBrandPageContentsRecursiveAsync = async (personalisa
|
|
|
204
254
|
}
|
|
205
255
|
return { newContents, isApplied, newPersonalisation };
|
|
206
256
|
};
|
|
257
|
+
export const filterPersonalisationByShapesAspectRatio = (personalisation, aspectRatio) => {
|
|
258
|
+
if (!aspectRatio) {
|
|
259
|
+
return personalisation;
|
|
260
|
+
}
|
|
261
|
+
const result = {
|
|
262
|
+
type: personalisation.type,
|
|
263
|
+
};
|
|
264
|
+
for (const sectionKey in personalisation) {
|
|
265
|
+
if (sectionKey === 'type')
|
|
266
|
+
continue;
|
|
267
|
+
const section = personalisation[sectionKey];
|
|
268
|
+
result[sectionKey] = {
|
|
269
|
+
...section,
|
|
270
|
+
mainShapesCollection: {
|
|
271
|
+
tall: aspectRatio === 'tall'
|
|
272
|
+
? section.mainShapesCollection?.tall || []
|
|
273
|
+
: [],
|
|
274
|
+
square: aspectRatio === 'square'
|
|
275
|
+
? section.mainShapesCollection?.square || []
|
|
276
|
+
: [],
|
|
277
|
+
wide: aspectRatio === 'wide'
|
|
278
|
+
? section.mainShapesCollection?.wide || []
|
|
279
|
+
: [],
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
return result;
|
|
284
|
+
};
|
|
285
|
+
const getShapeAspectRatioCategory = (aspectRatio) => {
|
|
286
|
+
if (!aspectRatio) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
else if (aspectRatio < ASPECT_RATIO_LOWER_CUT_OFF) {
|
|
290
|
+
return ShapeAspectRatioCategory.Tall;
|
|
291
|
+
}
|
|
292
|
+
else if (aspectRatio > ASPECT_RATIO_UPPER_CUT_OFF) {
|
|
293
|
+
return ShapeAspectRatioCategory.Wide;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
return ShapeAspectRatioCategory.Square;
|
|
297
|
+
}
|
|
298
|
+
};
|
|
207
299
|
export const applyUserPersonalisationToBrandPageContentsAsync = async (userPersonalisation, pages) => {
|
|
208
300
|
let isModified = false;
|
|
209
301
|
let currentPersonalisation = userPersonalisation;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { BrandPageModel, LogoTheme, FabricLogoTheme, ButtonStyles, PageModel } from '../models';
|
|
2
2
|
import { NavigationDesktop, NavigationMobile } from '../models';
|
|
3
3
|
import { PageStyles, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop } from '../models';
|
|
4
|
-
export declare const colorMatchCssKeyValue: (cssKey: string, cssValue: string, logoTheme: LogoTheme
|
|
4
|
+
export declare const colorMatchCssKeyValue: (cssKey: string, cssValue: string, logoTheme: LogoTheme, applyColorWithMatchingLuminance?: {
|
|
5
|
+
originalColor: string;
|
|
6
|
+
}) => {
|
|
5
7
|
cssValue: string;
|
|
6
8
|
isModified: boolean;
|
|
7
9
|
};
|
|
8
10
|
type Style = Record<string, string | any>;
|
|
9
|
-
export declare const applyLogoThemeToBrandPageStyleRecursive: (logoTheme: LogoTheme, style: Style | Style[]
|
|
11
|
+
export declare const applyLogoThemeToBrandPageStyleRecursive: (logoTheme: LogoTheme, attribute: string, style: Style | Style[], options?: {
|
|
12
|
+
isMultiColorShape: boolean;
|
|
13
|
+
}) => {
|
|
10
14
|
newStyle: Style | Style[];
|
|
11
15
|
isApplied: boolean;
|
|
12
16
|
};
|
|
@@ -2,7 +2,7 @@ import { VIEWPORTS, NavigationDesktop, NavigationMobile } from '../models';
|
|
|
2
2
|
import { PageStyles, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, } from '../models';
|
|
3
3
|
import { STYLE_THEME_KEYS } from '../constants';
|
|
4
4
|
import { arrayToLinearGradient, linearGradientToArray, isColorLinearGradient, RGBAtoHex, } from '../../utils/helpers';
|
|
5
|
-
import { addTransparentAlphaChannelToHex, calculateLuminanceRatio, } from './color.util';
|
|
5
|
+
import { addTransparentAlphaChannelToHex, calculateLuminanceRatio, getNewColorBasedOnTargetColorTheme, } from './color.util';
|
|
6
6
|
import chroma from 'chroma-js';
|
|
7
7
|
const MIN_LUM_RATIO = 0.3;
|
|
8
8
|
const parseFabricColorToCssStyle = (fabricColor) => {
|
|
@@ -31,32 +31,43 @@ const getColorValueForCorrectCssProperty = (k, colorData) => {
|
|
|
31
31
|
? colorData.gradient
|
|
32
32
|
: colorData.rgb;
|
|
33
33
|
};
|
|
34
|
-
export const colorMatchCssKeyValue = (cssKey, cssValue, logoTheme) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
export const colorMatchCssKeyValue = (cssKey, cssValue, logoTheme, applyColorWithMatchingLuminance) => {
|
|
35
|
+
if (applyColorWithMatchingLuminance?.originalColor) {
|
|
36
|
+
const styleThemeMatch = Object.values(STYLE_THEME_KEYS).find((k) => cssValue === k);
|
|
37
|
+
if (styleThemeMatch) {
|
|
38
|
+
const theme = styleThemeMatch.startsWith(STYLE_THEME_KEYS.LogoTextColor)
|
|
39
|
+
? logoTheme.logoTextColor
|
|
40
|
+
: logoTheme.logoBackgroundColor;
|
|
41
|
+
let newColor = applyColorWithMatchingLuminance.originalColor;
|
|
42
|
+
try {
|
|
43
|
+
newColor = getNewColorBasedOnTargetColorTheme(applyColorWithMatchingLuminance.originalColor, theme.rgb).toString();
|
|
44
|
+
}
|
|
45
|
+
catch (e) { }
|
|
46
|
+
return { cssValue: newColor, isModified: true };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (cssValue.match(new RegExp(STYLE_THEME_KEYS.LogoTextColor, 'g'))) {
|
|
50
|
+
cssValue = getColorValueForCorrectCssProperty(cssKey, logoTheme.logoTextColor);
|
|
51
|
+
return { cssValue, isModified: true };
|
|
42
52
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const colorShadeKey = split[split.length - 1];
|
|
47
|
-
const colorKey = match.startsWith(STYLE_THEME_KEYS.LogoBackgroundColor)
|
|
48
|
-
? logoTheme.logoBackgroundColor
|
|
49
|
-
: logoTheme.logoTextColor;
|
|
50
|
-
return { cssValue: colorKey[colorShadeKey], isModified: true };
|
|
53
|
+
else if (cssValue.match(new RegExp(STYLE_THEME_KEYS.LogoBackgroundColor, 'g'))) {
|
|
54
|
+
cssValue = getColorValueForCorrectCssProperty(cssKey, logoTheme.logoBackgroundColor);
|
|
55
|
+
return { cssValue, isModified: true };
|
|
51
56
|
}
|
|
52
57
|
return { cssValue, isModified: false };
|
|
53
58
|
};
|
|
54
|
-
export const applyLogoThemeToBrandPageStyleRecursive = (logoTheme, style) => {
|
|
59
|
+
export const applyLogoThemeToBrandPageStyleRecursive = (logoTheme, attribute, style, options) => {
|
|
55
60
|
let isApplied = false;
|
|
56
61
|
let newStyle = {};
|
|
57
62
|
if (Array.isArray(style)) {
|
|
58
63
|
newStyle = style.map((s) => {
|
|
59
|
-
const
|
|
64
|
+
const isShapeColorReplacement = attribute === 'colorReplacements';
|
|
65
|
+
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, attribute, s, isShapeColorReplacement
|
|
66
|
+
? {
|
|
67
|
+
isMultiColorShape: style.filter((x) => x.originalColor.toLowerCase() !== '' &&
|
|
68
|
+
x.originalColor.toLowerCase() !== 'none').length > 1,
|
|
69
|
+
}
|
|
70
|
+
: undefined);
|
|
60
71
|
isApplied = isApplied || output.isApplied;
|
|
61
72
|
return output.newStyle;
|
|
62
73
|
});
|
|
@@ -64,12 +75,17 @@ export const applyLogoThemeToBrandPageStyleRecursive = (logoTheme, style) => {
|
|
|
64
75
|
else if (style && typeof style === 'object') {
|
|
65
76
|
for (const [key, value] of Object.entries(style)) {
|
|
66
77
|
if (typeof value === 'string') {
|
|
67
|
-
const
|
|
78
|
+
const applyColorWithMatchingLuminance = options?.isMultiColorShape && key === `replacementColor`
|
|
79
|
+
? {
|
|
80
|
+
originalColor: style[`originalColor`],
|
|
81
|
+
}
|
|
82
|
+
: undefined;
|
|
83
|
+
const output = colorMatchCssKeyValue(key, value, logoTheme, applyColorWithMatchingLuminance);
|
|
68
84
|
newStyle[key] = output.cssValue;
|
|
69
85
|
isApplied = isApplied || output.isModified;
|
|
70
86
|
}
|
|
71
87
|
else if (typeof value === 'object') {
|
|
72
|
-
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, value);
|
|
88
|
+
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, key, value);
|
|
73
89
|
newStyle[key] = output.newStyle;
|
|
74
90
|
isApplied = isApplied || output.isApplied;
|
|
75
91
|
// if (process.env.NODE_ENV !== 'production' && output.isApplied) {
|
|
@@ -115,7 +131,7 @@ export const applyLogoThemeToBrandPageNavigationStyles = (logoTheme, navigation)
|
|
|
115
131
|
newNavigation[key] = value;
|
|
116
132
|
}
|
|
117
133
|
else {
|
|
118
|
-
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, value);
|
|
134
|
+
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, key, value);
|
|
119
135
|
newNavigation[key] = output.newStyle;
|
|
120
136
|
isModified = isModified || output.isApplied;
|
|
121
137
|
}
|
|
@@ -139,7 +155,7 @@ export const applyLogoThemeToBrandPageHeaderStyles = (logoTheme, pageHeader) =>
|
|
|
139
155
|
newPageHeader[key] = value;
|
|
140
156
|
}
|
|
141
157
|
else {
|
|
142
|
-
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, value);
|
|
158
|
+
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, key, value);
|
|
143
159
|
newPageHeader[key] = output.newStyle;
|
|
144
160
|
isModified = isModified || output.isApplied;
|
|
145
161
|
}
|
|
@@ -162,7 +178,7 @@ export const applyLogoThemeToBrandPageFooterStyles = (logoTheme, pageFooter) =>
|
|
|
162
178
|
newPageFooter[key] = value;
|
|
163
179
|
}
|
|
164
180
|
else {
|
|
165
|
-
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, value);
|
|
181
|
+
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, key, value);
|
|
166
182
|
newPageFooter[key] = output.newStyle;
|
|
167
183
|
isModified = isModified || output.isApplied;
|
|
168
184
|
}
|
|
@@ -186,7 +202,7 @@ export const applyLogoThemeToContents = (logoTheme, pages) => {
|
|
|
186
202
|
.filter(([, v]) => typeof v === 'object')
|
|
187
203
|
.map(([k]) => k);
|
|
188
204
|
for (const styleKey of styleKeys) {
|
|
189
|
-
const { newStyle, isApplied } = applyLogoThemeToBrandPageStyleRecursive(logoTheme, content[styleKey]);
|
|
205
|
+
const { newStyle, isApplied } = applyLogoThemeToBrandPageStyleRecursive(logoTheme, styleKey, content[styleKey]);
|
|
190
206
|
newContent[styleKey] = newStyle;
|
|
191
207
|
isModified = isModified || isApplied;
|
|
192
208
|
}
|
|
@@ -202,13 +218,13 @@ export const applyLogoThemeToBrandPageStyles = (logoTheme, pageStyles) => {
|
|
|
202
218
|
for (const [key, value] of Object.entries(pageStyles)) {
|
|
203
219
|
if (Array.isArray(value)) {
|
|
204
220
|
for (let i = 0; i < value.length; i++) {
|
|
205
|
-
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, value[i]);
|
|
221
|
+
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, `pageStyles`, value[i]);
|
|
206
222
|
newStyle[key] = output.newStyle;
|
|
207
223
|
isModified = isModified || output.isApplied;
|
|
208
224
|
}
|
|
209
225
|
}
|
|
210
226
|
else {
|
|
211
|
-
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, value);
|
|
227
|
+
const output = applyLogoThemeToBrandPageStyleRecursive(logoTheme, key, value);
|
|
212
228
|
newStyle[key] = output.newStyle;
|
|
213
229
|
isModified = isModified || output.isApplied;
|
|
214
230
|
}
|
|
@@ -234,10 +234,11 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
234
234
|
setBackgroundImageUrl({ backgroundImageUrl, }: {
|
|
235
235
|
backgroundImageUrl: string;
|
|
236
236
|
}): void;
|
|
237
|
-
addBackgroundShape({ shapeUrl, width, height, }: {
|
|
237
|
+
addBackgroundShape({ shapeUrl, width, height, aspectRatio, }: {
|
|
238
238
|
shapeUrl: string;
|
|
239
239
|
width?: number | undefined;
|
|
240
240
|
height?: number | undefined;
|
|
241
|
+
aspectRatio?: number | undefined;
|
|
241
242
|
}): void;
|
|
242
243
|
deleteBackgroundShape({ shapeIndex }: {
|
|
243
244
|
shapeIndex: number;
|
|
@@ -257,28 +258,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
257
258
|
styleThemeKeys: Readonly<{
|
|
258
259
|
LogoTextColor: "logo-text-color";
|
|
259
260
|
LogoBackgroundColor: "logo-background-color";
|
|
260
|
-
LogoTextColor50: "logo-text-color-50";
|
|
261
|
-
LogoTextColor100: "logo-text-color-100";
|
|
262
|
-
LogoTextColor200: "logo-text-color-200";
|
|
263
|
-
LogoTextColor300: "logo-text-color-300";
|
|
264
|
-
LogoTextColor400: "logo-text-color-400";
|
|
265
|
-
LogoTextColor500: "logo-text-color-500";
|
|
266
|
-
LogoTextColor600: "logo-text-color-600";
|
|
267
|
-
LogoTextColor700: "logo-text-color-700";
|
|
268
|
-
LogoTextColor800: "logo-text-color-800";
|
|
269
|
-
LogoTextColor900: "logo-text-color-900";
|
|
270
|
-
LogoTextColor950: "logo-text-color-950";
|
|
271
|
-
LogoBackgroundColor50: "logo-background-color-50";
|
|
272
|
-
LogoBackgroundColor100: "logo-background-color-100";
|
|
273
|
-
LogoBackgroundColor200: "logo-background-color-200";
|
|
274
|
-
LogoBackgroundColor300: "logo-background-color-300";
|
|
275
|
-
LogoBackgroundColor400: "logo-background-color-400";
|
|
276
|
-
LogoBackgroundColor500: "logo-background-color-500";
|
|
277
|
-
LogoBackgroundColor600: "logo-background-color-600";
|
|
278
|
-
LogoBackgroundColor700: "logo-background-color-700";
|
|
279
|
-
LogoBackgroundColor800: "logo-background-color-800";
|
|
280
|
-
LogoBackgroundColor900: "logo-background-color-900";
|
|
281
|
-
LogoBackgroundColor950: "logo-background-color-950";
|
|
282
261
|
}>;
|
|
283
262
|
configOptions: {
|
|
284
263
|
readonly style: "style";
|
package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
2
2
|
templates: import("vue").ComputedRef<import("../../stores/admin-logo-settings").AdminPreviewLogoTemplateTemplate[]>;
|
|
3
3
|
items: import("vue").ComputedRef<{
|
|
4
4
|
id: string;
|
|
5
|
-
type: "email" | "phone" | "logo" | "general-link" | "profile" | "website" | "
|
|
5
|
+
type: "email" | "phone" | "image" | "logo" | "general-link" | "profile" | "website" | "video" | "text" | "facebook" | "twitter" | "instagram" | "youtube" | "linkedin" | "pinterest" | "twitch" | "tiktok" | "map" | "image-gallery" | "mailing-list" | "request-payment" | "support-me" | "contact-form" | "banner-section" | "about-section" | "divider-section" | "images-section" | "testimonial-section" | "social-links" | "shapes-section" | "shop-section";
|
|
6
6
|
settings: {
|
|
7
7
|
content: {
|
|
8
8
|
id: string;
|
|
9
|
-
type: "email" | "phone" | "logo" | "general-link" | "profile" | "website" | "
|
|
9
|
+
type: "email" | "phone" | "image" | "logo" | "general-link" | "profile" | "website" | "video" | "text" | "facebook" | "twitter" | "instagram" | "youtube" | "linkedin" | "pinterest" | "twitch" | "tiktok" | "map" | "image-gallery" | "mailing-list" | "request-payment" | "support-me" | "contact-form" | "banner-section" | "about-section" | "divider-section" | "images-section" | "testimonial-section" | "social-links" | "shapes-section" | "shop-section";
|
|
10
10
|
personalisationRole?: "email" | "phone" | "profile" | "website" | "about" | "information" | "media" | undefined;
|
|
11
11
|
};
|
|
12
12
|
fields: Record<string, import("../../../shared/content-settings/models").ContentItemFieldSettings>;
|