@designcrowd/library.brand-page 6.2.11 → 6.2.12
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-DDcraD5S.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DtOeaisf.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BZpmJPew.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CqRwC4e7.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CqRwC4e7.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DId9Dfjh.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DId9Dfjh.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BTDfmOcm.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CeAu9Ayx.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-WCv0K41H.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BlfevQDY.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-Cvt7MHPZ.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DipZuylv.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BCw4lcKN.js → CreatedOnDcom-pt-pt-Cf6u2GCg.js} +1 -1
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.d.ts +16 -0
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.js +35 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +3 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +19 -13
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +3 -1
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +17 -2
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.d.ts +11 -3
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.js +35 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +8 -2
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +27 -3
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/page/Page.mixin.js +33 -27
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.d.ts +7 -2
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.js +21 -1
- package/lib/src/brand-page/components/payment/Payment.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/payment/Payment.mixin.js +22 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +6 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +32 -1
- package/lib/src/brand-page/components/social-links/SocialLinks.stories.js +0 -3
- package/lib/src/brand-page/components/testimonial-section/__fixtures__/data.js +0 -3
- package/lib/src/brand-page/components/text/Text.stories.js +0 -17
- package/lib/src/brand-page/constants/font.constants.d.ts +62 -0
- package/lib/src/brand-page/constants/font.constants.js +35 -0
- package/lib/src/brand-page/models/index.d.ts +23 -24
- package/lib/src/brand-page/models/index.js +20 -7
- package/lib/src/brand-page/models/navigation-styles.model.d.ts +1 -1
- package/lib/src/brand-page/models/navigation-styles.model.js +17 -8
- package/lib/src/brand-page/models/payment.model.d.ts +11 -6
- package/lib/src/brand-page/models/styles.model.d.ts +53 -7
- package/lib/src/brand-page/models/styles.model.js +115 -27
- package/lib/src/brand-page/utils/color-palette.util.d.ts +43 -23
- package/lib/src/brand-page/utils/color-palette.util.js +65 -27
- package/lib/src/brand-page/utils/color.util.d.ts +13 -9
- package/lib/src/brand-page/utils/color.util.js +56 -15
- package/lib/src/brand-page/utils/container-text-color.util.d.ts +46 -13
- package/lib/src/brand-page/utils/container-text-color.util.js +321 -41
- package/lib/src/brand-page/utils/index.d.ts +1 -0
- package/lib/src/brand-page/utils/index.js +1 -0
- package/lib/src/brand-page/utils/migration/migration-20.js +6 -2
- package/lib/src/brand-page/utils/migration/migration-21.js +34 -6
- package/lib/src/brand-page/utils/migration/migration-22.d.ts +99 -0
- package/lib/src/brand-page/utils/migration/migration-22.js +909 -0
- package/lib/src/brand-page/utils/migration.util.js +17 -0
- package/lib/src/brand-page/utils/model.util.d.ts +4 -0
- package/lib/src/brand-page/utils/model.util.js +4 -0
- package/lib/src/brand-page/utils/personalisation.util.js +9 -1
- package/lib/src/brand-page/utils/rte-role-lift.util.d.ts +72 -0
- package/lib/src/brand-page/utils/rte-role-lift.util.js +275 -0
- package/lib/src/brand-page/utils/style.util.d.ts +5 -1
- package/lib/src/brand-page/utils/style.util.js +34 -11
- package/lib/src/brand-page/utils/text-role-css.util.d.ts +19 -0
- package/lib/src/brand-page/utils/text-role-css.util.js +186 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.d.ts +90 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.js +434 -0
- package/lib/src/brand-page/utils/text-style.util.d.ts +53 -23
- package/lib/src/brand-page/utils/text-style.util.js +122 -22
- package/lib/src/brand-page/utils/view-model.util.d.ts +9 -1
- package/lib/src/brand-page/utils/view-model.util.js +124 -111
- package/lib/src/brand-page/view-models.d.ts +1 -0
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +13 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +4 -4
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -10
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.js +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +23 -138
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -28
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +5 -2
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +1 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.d.ts +16 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.js +61 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.d.ts +11 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.js +236 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.js +25 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.d.ts +17 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.js +204 -17
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +29 -31
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.d.ts +20 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.js +60 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.js +22 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +10 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +319 -275
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -5
- package/lib/src/brand-page-maker/convertors/text-css-style-options.convertor.js +6 -2
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.d.ts +1 -1
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
- package/lib/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.js +7 -14
- package/lib/src/brand-page-maker/default-getters/text-color.default-getter.js +6 -13
- package/lib/src/brand-page-maker/models/content-settings.d.ts +8 -0
- package/lib/src/brand-page-maker/models/content-settings.js +112 -81
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.d.ts +2 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.js +5 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.js +4 -3
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1257 -117
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +6 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +17 -9
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +59 -5
- package/lib/src/brand-page-maker/stores/history/history-store.js +22 -2
- package/lib/src/brand-page-maker/utils/apply-color-strategy.js +26 -8
- package/lib/src/brand-page-maker/utils/index.d.ts +2 -1
- package/lib/src/brand-page-maker/utils/index.js +2 -1
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +117 -15
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +435 -281
- package/lib/src/brand-page-maker/utils/rte-authoring.util.d.ts +4 -0
- package/lib/src/brand-page-maker/utils/rte-authoring.util.js +101 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.d.ts +126 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.js +307 -0
- package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +13 -3
- package/lib/src/{bundled-translations-zfiA5Tsw.js → bundled-translations-yGrvPE5i.js} +17 -17
- package/lib/src/{bundled-translations.de-DE-ChsdSyAP.js → bundled-translations.de-DE-L4Znf8Hs.js} +17 -17
- package/lib/src/{bundled-translations.es-ES-DflsWQK0.js → bundled-translations.es-ES-D6iticrK.js} +15 -15
- package/lib/src/{bundled-translations.fr-CA-fpDRuZ52.js → bundled-translations.fr-CA-BgAVE-9k.js} +25 -25
- package/lib/src/{bundled-translations.fr-FR-Bub73Zt-.js → bundled-translations.fr-FR-B8GbyqxQ.js} +17 -17
- package/lib/src/{bundled-translations.pt-BR-BlnWE9TB.js → bundled-translations.pt-BR-DjPU3Db7.js} +25 -25
- package/lib/src/{bundled-translations.pt-PT-DmzXlnaS.js → bundled-translations.pt-PT-BaepaDpr.js} +23 -23
- package/lib/src/bundles/bundled-translations.de-DE.json +21 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/lib/src/bundles/bundled-translations.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/lib/src/clients/ai-assistant-client.d.ts +1 -0
- package/lib/src/composables/useTranslate.d.ts +1 -1
- package/lib/src/composables/useTranslate.js +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +303 -207
- package/lib/src/css/library.brand-page-brandPage.min.css +303 -207
- package/lib/src/css/library.brand-page-designCom.min.css +303 -207
- package/lib/src/css/library.brand-page-preview.min.css +303 -207
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.mjs +195 -191
- package/lib/src/{lib-1AqtEmvQ.js → lib-kGRlD3_P.js} +36855 -33893
- package/lib/src/lib.js +2 -1
- package/lib/src/metadata-builder/builders/footer-builder.js +4 -5
- package/lib/src/metadata-builder/builders/global-role-propagation.d.ts +58 -0
- package/lib/src/metadata-builder/builders/global-role-propagation.js +246 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +1 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.js +116 -45
- package/lib/src/metadata-builder/builders/header-builder.js +13 -4
- package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +8 -2
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +60 -29
- package/lib/src/metadata-builder/builders/section-field-maps.js +1 -0
- package/lib/src/metadata-builder/builders/section-field-utils.d.ts +48 -19
- package/lib/src/metadata-builder/builders/section-field-utils.js +128 -52
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +4 -2
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +28 -12
- package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +5 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +1 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.js +97 -40
- package/lib/src/metadata-builder/metadata-executor.js +23 -1
- package/lib/src/metadata-builder/models.d.ts +2 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +18 -19
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +18 -1
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +1 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +0 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +5 -8
- package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +7 -16
- package/lib/src/metadata-builder/sanitizers/section-args-validator.js +95 -22
- package/lib/src/shared/color-palette/section-color-matches.js +9 -25
- package/lib/src/shared/color-strategies/color-strategies.d.ts +15 -0
- package/lib/src/shared/color-strategies/color-strategies.js +31 -0
- package/lib/src/shared/color-strategies/rte-color.d.ts +8 -0
- package/lib/src/shared/color-strategies/rte-color.js +16 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +23 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.js +28 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +9 -135
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -27
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +12 -2
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +7 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +75 -6
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +18 -7
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +6 -1
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -7
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +8 -4
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1255 -26
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +203 -59
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +6 -0
- package/lib/src/shared/content-settings/store/content-settings-store.js +105 -8
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +5 -1
- package/lib/src/shared/navigation-style-settings/store/index.d.ts +7 -3
- package/lib/src/shared/navigation-style-settings/store/index.js +40 -15
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +17 -5
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +70 -13
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +10 -2
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -1
- package/lib/src/shared/page-settings/store/page-settings-store.js +17 -0
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +4 -1
- package/lib/src/shared/rte-extensions/AutoLink.d.ts +17 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.js +67 -51
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.js +4 -1
- package/lib/src/shared/rte-extensions/TextEffects.d.ts +28 -0
- package/lib/src/shared/rte-extensions/TextEffects.js +96 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.d.ts +2 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.js +21 -0
- package/lib/src/shared/rte-extensions.util.d.ts +25 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.js → shared/rte-extensions.util.js} +62 -7
- package/lib/src/shared/rte-link.util.d.ts +1 -0
- package/lib/src/shared/rte-link.util.js +1 -0
- package/lib/src/shared/rte-render.util.d.ts +112 -0
- package/lib/src/shared/rte-render.util.js +255 -0
- package/lib/src/shared/rte-shape.util.d.ts +6 -0
- package/lib/src/shared/rte-shape.util.js +18 -0
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +2 -1
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
- package/lib/src/shared/side-bar/store/side-bar-store.d.ts +2 -0
- package/lib/src/shared/side-bar/store/side-bar-store.js +9 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +155 -15
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +7 -1
- package/lib/src/shared/style-settings/store/style-settings-store.d.ts +1 -9
- package/lib/src/shared/style-settings/store/style-settings-store.js +3 -33
- package/lib/src/shared/style-settings/text-style-size-order.d.ts +2 -0
- package/lib/src/shared/style-settings/text-style-size-order.js +13 -0
- package/lib/src/shared/text-role-typography.util.d.ts +64 -0
- package/lib/src/shared/text-role-typography.util.js +183 -0
- package/lib/src/utils/minify-brand-page-metadata.d.ts +16 -1
- package/lib/src/utils/minify-brand-page-metadata.js +31 -9
- package/package.json +1 -1
- package/src/brand-page/__fixtures__/migration-22-v21/edited-brandsite-sections.v21.json +982 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandcontact-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandpage-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandsite-every-section.v21.json +1243 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandcontact.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-general-link.v21.json +527 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-links.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-social-links.v21.json +514 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-about.v21.json +459 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-footer.v21.json +469 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-header-banner.v21.json +481 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-sections.v21.json +800 -0
- package/src/brand-page/__fixtures__/production-text-style-resolver.fixture.ts +52 -0
- package/src/brand-page/components/about-section/AboutSection.vue.test.ts +0 -10
- package/src/brand-page/components/contact-form/ContactForm.mixin.test.ts +127 -0
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +31 -14
- package/src/brand-page/components/contact-form/ContactForm.vue +26 -12
- package/src/brand-page/components/contact-form/ContactForm.vue.test.ts +60 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.test.ts +92 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +28 -3
- package/src/brand-page/components/mailing-list/MailingList.vue +9 -4
- package/src/brand-page/components/mailing-list/MailingList.vue.test.ts +63 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.ts +51 -1
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.test.ts +114 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.vue +8 -2
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.test.ts +182 -0
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +59 -12
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +40 -3
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +15 -7
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +133 -3
- package/src/brand-page/components/page/Page.mixin.ts +41 -34
- package/src/brand-page/components/page/Page.vue +17 -6
- package/src/brand-page/components/page/Page.vue.test.ts +91 -1
- package/src/brand-page/components/page-footer/PageFooter.mixin.ts +32 -2
- package/src/brand-page/components/page-footer/PageFooter.test.ts +79 -0
- package/src/brand-page/components/page-footer/PageFooter.vue +12 -4
- package/src/brand-page/components/payment/Payment.mixin.ts +34 -2
- package/src/brand-page/components/payment/Payment.test.ts +188 -0
- package/src/brand-page/components/payment/Payment.vue +12 -5
- package/src/brand-page/components/payment/RequestPaymentStripe.vue +1 -0
- package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +49 -2
- package/src/brand-page/components/payment/support-me/SupportMe.test.ts +100 -0
- package/src/brand-page/components/payment/support-me/SupportMe.vue +7 -1
- package/src/brand-page/components/payment/support-me/SupportMe.vue.test.ts +66 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.test.ts +100 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.vue +6 -3
- package/src/brand-page/components/shop/PaymentModal.vue +2 -6
- package/src/brand-page/components/shop/PaymentShippingAddress.vue +6 -0
- package/src/brand-page/components/shop/Shop.vue +15 -2
- package/src/brand-page/components/shop/Shop.vue.test.ts +74 -2
- package/src/brand-page/components/social-links/SocialLinks.stories.ts +0 -3
- package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +0 -3
- package/src/brand-page/components/testimonial-section/__fixtures__/data.ts +0 -3
- package/src/brand-page/components/text/Text.stories.ts +0 -17
- package/src/brand-page/components/text-wrapper/TextWrapper.parity.test.ts +136 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.test.ts +358 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +82 -22
- package/src/brand-page/constants/font.constants.ts +37 -0
- package/src/brand-page/models/footer-icon-color.test.ts +22 -0
- package/src/brand-page/models/index.ts +50 -28
- package/src/brand-page/models/navigation-styles.model.test.ts +77 -1
- package/src/brand-page/models/navigation-styles.model.ts +26 -9
- package/src/brand-page/models/payment.model.ts +15 -6
- package/src/brand-page/models/styles.model.test.ts +104 -0
- package/src/brand-page/models/styles.model.ts +181 -47
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +619 -115
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +150 -9
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +300 -18
- package/src/brand-page/utils/color-palette.util.test.ts +126 -1
- package/src/brand-page/utils/color-palette.util.ts +92 -26
- package/src/brand-page/utils/color.util.test.ts +62 -29
- package/src/brand-page/utils/color.util.ts +77 -14
- package/src/brand-page/utils/container-text-color.util.test.ts +672 -26
- package/src/brand-page/utils/container-text-color.util.ts +472 -46
- package/src/brand-page/utils/index.ts +1 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/edited-brandsite-sections.v22.json +1191 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandcontact-every-section.v22.json +2026 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandpage-every-section.v22.json +2017 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandsite-every-section.v22.json +2031 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandcontact.v22.json +1145 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-general-link.v22.json +645 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-links.v22.json +1136 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-social-links.v22.json +662 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-about.v22.json +638 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-footer.v22.json +610 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-header-banner.v22.json +660 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-sections.v22.json +1132 -0
- package/src/brand-page/utils/migration/migration-01.ts +293 -237
- package/src/brand-page/utils/migration/migration-02.ts +8 -1
- package/src/brand-page/utils/migration/migration-20.ts +6 -3
- package/src/brand-page/utils/migration/migration-20_5.test.ts +5 -2
- package/src/brand-page/utils/migration/migration-21.test.ts +34 -0
- package/src/brand-page/utils/migration/migration-21.ts +46 -10
- package/src/brand-page/utils/migration/migration-22.fixed-input.test.ts +43 -0
- package/src/brand-page/utils/migration/migration-22.test.ts +4103 -0
- package/src/brand-page/utils/migration/migration-22.text-font-family.test.ts +72 -0
- package/src/brand-page/utils/migration/migration-22.ts +1336 -0
- package/src/brand-page/utils/migration.util.test.ts +146 -32
- package/src/brand-page/utils/migration.util.ts +18 -0
- package/src/brand-page/utils/model.util.ts +4 -0
- package/src/brand-page/utils/personalisation.util.test.ts +148 -3
- package/src/brand-page/utils/personalisation.util.ts +9 -1
- package/src/brand-page/utils/rte-role-lift.util.ts +409 -0
- package/src/brand-page/utils/style.util.test.ts +35 -2
- package/src/brand-page/utils/style.util.ts +45 -11
- package/src/brand-page/utils/text-role-css.util.test.ts +525 -0
- package/src/brand-page/utils/text-role-css.util.ts +321 -0
- package/src/brand-page/utils/text-role-reconnect.util.test.ts +604 -0
- package/src/brand-page/utils/text-role-reconnect.util.ts +727 -0
- package/src/brand-page/utils/text-style.util.test.ts +305 -0
- package/src/brand-page/utils/text-style.util.ts +198 -24
- package/src/brand-page/utils/view-model.page-data.test.ts +232 -0
- package/src/brand-page/utils/view-model.util.test.ts +954 -133
- package/src/brand-page/utils/view-model.util.ts +187 -139
- package/src/brand-page/view-models.ts +4 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.blank-site.test.ts +57 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +9 -5
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -10
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.ts +0 -1
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -44
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +253 -200
- package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +1 -0
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +1 -0
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +1 -0
- package/src/brand-page-maker/composables/rich-text-editor/block-typography.test.ts +519 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/MaxLength.test.ts +26 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.test.ts +110 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.ts +99 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.ts +397 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/ViewDomParser.test.ts +139 -0
- package/src/brand-page-maker/composables/rich-text-editor/font.ts +36 -5
- package/src/brand-page-maker/composables/rich-text-editor/formatting.test.ts +375 -1
- package/src/brand-page-maker/composables/rich-text-editor/formatting.ts +301 -17
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.test.ts +82 -1
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +28 -34
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.test.ts +80 -0
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.ts +75 -0
- package/src/brand-page-maker/composables/rich-text-editor/spacing.ts +31 -6
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.test.ts +2485 -0
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +435 -337
- package/src/brand-page-maker/constants/config-settings-constant.ts +0 -6
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.test.ts +43 -0
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.ts +6 -2
- package/src/brand-page-maker/convertors/text-size-value.convertor.test.ts +24 -0
- package/src/brand-page-maker/convertors/text-size-value.convertor.ts +17 -13
- package/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.ts +7 -22
- package/src/brand-page-maker/default-getters/text-color.default-getter.ts +5 -21
- package/src/brand-page-maker/models/content-settings.test.ts +708 -0
- package/src/brand-page-maker/models/content-settings.ts +133 -82
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.test.ts +63 -1
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.ts +16 -3
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.test.ts +34 -0
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.ts +4 -2
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +185 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +22 -34
- package/src/brand-page-maker/stores/history/history-store.ts +35 -2
- package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +528 -0
- package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +12 -0
- package/src/brand-page-maker/utils/apply-color-strategy.golden.test.ts +2 -0
- package/src/brand-page-maker/utils/apply-color-strategy.test.ts +181 -3
- package/src/brand-page-maker/utils/apply-color-strategy.ts +36 -4
- package/src/brand-page-maker/utils/index.ts +2 -1
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +447 -410
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +610 -506
- package/src/brand-page-maker/utils/rte-authoring.util.test.ts +244 -0
- package/src/brand-page-maker/utils/rte-authoring.util.ts +175 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.test.ts +558 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.ts +473 -0
- package/src/brand-page-maker/utils/rte-features.test.ts +99 -3
- package/src/brand-page-maker/utils/rte-render-parity.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-render.util.test.ts +230 -0
- package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-sanitize.util.ts +14 -3
- package/src/brand-page-maker/utils/rte-schema-version.test.ts +102 -0
- package/src/bundles/bundled-translations.de-DE.json +21 -2
- package/src/bundles/bundled-translations.es-ES.json +21 -2
- package/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/src/bundles/bundled-translations.json +21 -2
- package/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/src/clients/ai-assistant-client.ts +1 -0
- package/src/composables/useTranslate.ts +2 -1
- package/src/lib.ts +2 -2
- package/src/metadata-builder/builders/footer-builder.test.ts +70 -45
- package/src/metadata-builder/builders/footer-builder.ts +4 -8
- package/src/metadata-builder/builders/global-role-propagation.test.ts +907 -0
- package/src/metadata-builder/builders/global-role-propagation.ts +430 -0
- package/src/metadata-builder/builders/global-styles-builder.test.ts +1020 -0
- package/src/metadata-builder/builders/global-styles-builder.ts +194 -48
- package/src/metadata-builder/builders/header-builder.test.ts +112 -40
- package/src/metadata-builder/builders/header-builder.ts +18 -8
- package/src/metadata-builder/builders/section-builders/about-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +7 -4
- package/src/metadata-builder/builders/section-builders/images-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +7 -7
- package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +2 -2
- package/src/metadata-builder/builders/section-builders/social-links-builder.ts +21 -10
- package/src/metadata-builder/builders/section-builders/support-me-builder.test.ts +10 -0
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +111 -61
- package/src/metadata-builder/builders/section-field-maps.ts +1 -0
- package/src/metadata-builder/builders/section-field-utils.test.ts +545 -2
- package/src/metadata-builder/builders/section-field-utils.ts +202 -69
- package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +38 -13
- package/src/metadata-builder/builders/section-rules/social-links.rules.ts +5 -0
- package/src/metadata-builder/helpers/rte.helpers.test.ts +101 -0
- package/src/metadata-builder/helpers/rte.helpers.ts +129 -43
- package/src/metadata-builder/metadata-executor.test.ts +167 -0
- package/src/metadata-builder/metadata-executor.ts +34 -1
- package/src/metadata-builder/models.ts +2 -0
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +23 -7
- package/src/metadata-builder/parsers/section-tool-arguments.ts +21 -1
- package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +215 -0
- package/src/metadata-builder/sanitizers/rte-schema-check.ts +1 -1
- package/src/metadata-builder/sanitizers/sanitizer-rules.ts +4 -8
- package/src/metadata-builder/sanitizers/section-args-validator.ts +136 -53
- package/src/shared/color-palette/section-color-matches.test.ts +15 -11
- package/src/shared/color-palette/section-color-matches.ts +9 -28
- package/src/shared/color-strategies/color-strategies.ts +35 -0
- package/src/shared/color-strategies/rte-color.test.ts +1 -1
- package/src/shared/color-strategies/rte-color.ts +19 -0
- package/src/shared/color-strategies/rte-field-pairs.test.ts +26 -5
- package/src/shared/color-strategies/rte-field-pairs.ts +33 -0
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.test.ts +43 -66
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.vue +7 -1
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -48
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +33 -7
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.test.ts +128 -1
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -0
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSlider.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSliderField.vue +1 -0
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +1 -0
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.test.ts +56 -3
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +11 -4
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.test.ts +335 -25
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +248 -70
- package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +113 -25
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.de-DE.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.es-ES.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-CA.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-FR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.json +8 -1
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-BR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-PT.json +17 -10
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.test.ts +141 -0
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.vue +136 -0
- package/src/shared/content-settings/store/content-settings-store.test.ts +491 -6
- package/src/shared/content-settings/store/content-settings-store.ts +159 -17
- package/src/shared/logo-settings/components/EditLogoSettings.vue +1 -0
- package/src/shared/logo-settings/components/LogoVariations.vue +1 -0
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +1 -0
- package/src/shared/navigation-style-settings/store/index.test.ts +295 -0
- package/src/shared/navigation-style-settings/store/index.ts +65 -15
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +2 -0
- package/src/shared/page-settings/components/page-settings/PageElement.vue +1 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +44 -4
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +13 -4
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.navigation.test.ts +89 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.text-style.test.ts +91 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +14 -2
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.vue +2 -0
- package/src/shared/page-settings/store/page-settings-store.text-style.test.ts +84 -0
- package/src/shared/page-settings/store/page-settings-store.ts +30 -1
- package/src/shared/rte-extensions/AutoLink.test.ts +98 -0
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.ts +87 -58
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.ts +4 -1
- package/src/shared/rte-extensions/TextEffects.ts +151 -0
- package/src/shared/rte-extensions/ViewDomParser.ts +27 -0
- package/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.ts → shared/rte-extensions.util.ts} +66 -9
- package/src/shared/rte-link.util.ts +2 -0
- package/src/shared/rte-render.util.ts +385 -0
- package/src/shared/rte-shape.util.ts +29 -0
- package/src/shared/side-bar/store/side-bar-store.test.ts +27 -1
- package/src/shared/side-bar/store/side-bar-store.ts +11 -0
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +7 -3
- package/src/shared/style-settings/components/StyleSettings.test.ts +116 -0
- package/src/shared/style-settings/components/StyleSettings.vue +75 -25
- package/src/shared/style-settings/components/i18n/style-settings.de-DE.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.es-ES.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-CA.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-FR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.json +13 -3
- package/src/shared/style-settings/components/i18n/style-settings.pt-BR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.pt-PT.json +32 -20
- package/src/shared/style-settings/components/text-style-options-settings-with-state/TextStyleOptionsSettingsWithState.vue +14 -34
- package/src/shared/style-settings/store/style-settings-store.ts +3 -49
- package/src/shared/style-settings/text-style-size-order.test.ts +76 -0
- package/src/shared/style-settings/text-style-size-order.ts +28 -0
- package/src/shared/template-settings/components/TemplatesSettings.vue +4 -0
- package/src/shared/text-role-typography.util.ts +277 -0
- package/src/utils/minify-brand-page-metadata.test.ts +102 -7
- package/src/utils/minify-brand-page-metadata.ts +62 -8
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/AutoLink.d.ts +0 -2
- package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
- package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -63
- package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -106
- package/lib/src/brand-page-maker/utils/rte-shape.d.ts +0 -18
- package/lib/src/brand-page-maker/utils/rte-shape.js +0 -21
- package/lib/src/metadata-builder/builders/global-font-propagation.d.ts +0 -41
- package/lib/src/metadata-builder/builders/global-font-propagation.js +0 -146
- package/src/brand-page-maker/utils/rte-render.util.ts +0 -179
- package/src/brand-page-maker/utils/rte-shape.ts +0 -29
- package/src/metadata-builder/builders/global-font-propagation.test.ts +0 -401
- package/src/metadata-builder/builders/global-font-propagation.ts +0 -238
- package/src/shared/style-settings/components/StyleSettingsSection.vue +0 -8
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.d.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.ts +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { TextStyleDeclaration, TextStyleOptions } from '../models';
|
|
2
|
+
import type { TextStyleType } from '../models/styles.model';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A frozen copy of how production (`origin/develop` before BP-5969, `view-model.util.ts`) resolved
|
|
6
|
+
* a text field's typography: the "before" for tests that keep a migrated field's look. Never point
|
|
7
|
+
* it at the current renderer; it is what published sites drew.
|
|
8
|
+
*
|
|
9
|
+
* A field on a role the site defines drew ONLY that role's typography
|
|
10
|
+
* (`getTextStyleByContentTextStyleProperty`): its own values, and the mapper defaults applied before
|
|
11
|
+
* it (`mapToButtonViewModel`'s label line height, `mapToProfileViewModel`'s sizes), never showed.
|
|
12
|
+
* A field on no role, or on a role the site lacks, drew its own values over those defaults.
|
|
13
|
+
* Colour is not modelled.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// `mapToButtonViewModel`: an unset label line height.
|
|
17
|
+
export const PRODUCTION_BUTTON_DEFAULTS: Record<string, string> = {
|
|
18
|
+
lineHeight: '1.4',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// `mapToProfileViewModel`: an unset size and line height, per field.
|
|
22
|
+
export const PRODUCTION_PROFILE_DEFAULTS: Record<
|
|
23
|
+
string,
|
|
24
|
+
Record<string, string>
|
|
25
|
+
> = {
|
|
26
|
+
titleStyle: { fontSize: '1em', lineHeight: '1.5' },
|
|
27
|
+
descriptionStyle: { fontSize: '1em', lineHeight: '1.5' },
|
|
28
|
+
nameStyle: { fontSize: '1.5em', lineHeight: '1.4' },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// `mapToHeaderButtonViewModel`: the style an absent header button style drew.
|
|
32
|
+
export const PRODUCTION_HEADER_BUTTON_STYLE = {
|
|
33
|
+
textStyleType: 'buttons',
|
|
34
|
+
} as TextStyleDeclaration;
|
|
35
|
+
|
|
36
|
+
export const productionTypography = (
|
|
37
|
+
style: TextStyleDeclaration | undefined,
|
|
38
|
+
options: TextStyleOptions,
|
|
39
|
+
mapperDefaults: Record<string, string> = {},
|
|
40
|
+
): Record<string, unknown> => {
|
|
41
|
+
const mapped: Record<string, unknown> = { ...style };
|
|
42
|
+
|
|
43
|
+
for (const [prop, value] of Object.entries(mapperDefaults)) {
|
|
44
|
+
mapped[prop] ||= value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const option = style?.textStyleType
|
|
48
|
+
? options[style.textStyleType as TextStyleType]
|
|
49
|
+
: undefined;
|
|
50
|
+
|
|
51
|
+
return option ? { ...option.style } : mapped;
|
|
52
|
+
};
|
|
@@ -55,20 +55,10 @@ const createTestAboutViewModel = (): AboutSectionViewModel => ({
|
|
|
55
55
|
paragraph: '',
|
|
56
56
|
colorReplacements: [],
|
|
57
57
|
titleStyle: {
|
|
58
|
-
fontSize: '2.25rem',
|
|
59
|
-
lineHeight: '2.5rem',
|
|
60
|
-
fontFamily: 'Lato',
|
|
61
58
|
textAlign: 'center',
|
|
62
|
-
overflowWrap: 'anywhere',
|
|
63
|
-
wordBreak: 'normal',
|
|
64
59
|
},
|
|
65
60
|
paragraphStyle: {
|
|
66
|
-
fontSize: '1rem',
|
|
67
|
-
lineHeight: '1.5rem',
|
|
68
|
-
fontFamily: 'Lato',
|
|
69
61
|
textAlign: 'center',
|
|
70
|
-
overflowWrap: 'anywhere',
|
|
71
|
-
wordBreak: 'normal',
|
|
72
62
|
},
|
|
73
63
|
backgroundStyle: {},
|
|
74
64
|
role: 'about-section',
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import ContactFormMixin from './ContactForm.mixin';
|
|
3
|
+
|
|
4
|
+
const computedFor = (
|
|
5
|
+
name:
|
|
6
|
+
| 'submitButtonStyle'
|
|
7
|
+
| 'submitButtonTextStyle'
|
|
8
|
+
| 'submitButtonRoleType'
|
|
9
|
+
| 'submitButtonRoleClass',
|
|
10
|
+
thisArg: Record<string, unknown>,
|
|
11
|
+
): Record<string, unknown> =>
|
|
12
|
+
(
|
|
13
|
+
ContactFormMixin.computed![name] as unknown as (
|
|
14
|
+
this: unknown,
|
|
15
|
+
) => Record<string, unknown>
|
|
16
|
+
).call(thisArg);
|
|
17
|
+
|
|
18
|
+
// The submit label on Button: the size must be applied once, on the label. On both the
|
|
19
|
+
// <button> and the label, the em sizes multiply (Heading 1's 6.875em × 6.875em ≈ 750px).
|
|
20
|
+
describe('ContactForm submit button', () => {
|
|
21
|
+
const buttonRole = {
|
|
22
|
+
fontFamily: 'Lato',
|
|
23
|
+
fontSize: '1em',
|
|
24
|
+
fontWeight: 'normal',
|
|
25
|
+
lineHeight: '1.2',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const viewModel = {
|
|
29
|
+
buttonStyles: {
|
|
30
|
+
style: {
|
|
31
|
+
color: 'var(--palette-1)',
|
|
32
|
+
backgroundColor: 'var(--palette-0)',
|
|
33
|
+
borderColor: 'var(--palette-1)',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
buttonTextStyle: {
|
|
37
|
+
textStyleType: 'button',
|
|
38
|
+
fontFamily: 'Lato',
|
|
39
|
+
fontSize: '6.875em',
|
|
40
|
+
fontWeight: 'normal',
|
|
41
|
+
lineHeight: '1.2',
|
|
42
|
+
letterSpacing: '0px',
|
|
43
|
+
textAlign: 'center',
|
|
44
|
+
applyAutoScale: true,
|
|
45
|
+
overflowWrap: 'anywhere',
|
|
46
|
+
wordBreak: 'normal',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const roleOptions = { button: { style: buttonRole } };
|
|
51
|
+
|
|
52
|
+
test('the button carries a role reference for every role-defined property except size', () => {
|
|
53
|
+
expect(
|
|
54
|
+
computedFor('submitButtonStyle', { viewModel, roleOptions }),
|
|
55
|
+
).toEqual({
|
|
56
|
+
...viewModel.buttonStyles.style,
|
|
57
|
+
fontFamily: 'var(--role-font-family)',
|
|
58
|
+
fontWeight: 'var(--role-font-weight)',
|
|
59
|
+
lineHeight: 'var(--role-line-height)',
|
|
60
|
+
// the role doesn't set letter-spacing, and the block's own '0px' isn't the CSS-neutral
|
|
61
|
+
// ('normal') either — a genuine own value, so it stays a literal.
|
|
62
|
+
letterSpacing: '0px',
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('the box carries the role class', () => {
|
|
67
|
+
expect(
|
|
68
|
+
computedFor('submitButtonRoleClass', { viewModel, roleOptions }),
|
|
69
|
+
).toBe('bp-text-role-button');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('the label carries the whole text style, role included, so it renders through its role', () => {
|
|
73
|
+
expect(computedFor('submitButtonTextStyle', { viewModel })).toEqual(
|
|
74
|
+
viewModel.buttonTextStyle,
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('an own text colour still colours the button', () => {
|
|
79
|
+
const style = computedFor('submitButtonStyle', {
|
|
80
|
+
viewModel: {
|
|
81
|
+
...viewModel,
|
|
82
|
+
buttonTextStyle: { ...viewModel.buttonTextStyle, color: '#123456' },
|
|
83
|
+
},
|
|
84
|
+
roleOptions,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
expect(style.color).toBe('#123456');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test('a stored off value stays a literal against a role that sets the opposite', () => {
|
|
91
|
+
const style = computedFor('submitButtonStyle', {
|
|
92
|
+
viewModel: {
|
|
93
|
+
...viewModel,
|
|
94
|
+
buttonTextStyle: { ...viewModel.buttonTextStyle, fontWeight: 'bold' },
|
|
95
|
+
},
|
|
96
|
+
roleOptions: {
|
|
97
|
+
button: { style: { ...buttonRole, fontWeight: 'normal' } },
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
expect(style.fontWeight).toBe('bold');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
test('with no role in scope, the box bakes the button text style literally, minus size', () => {
|
|
105
|
+
const style = computedFor('submitButtonStyle', {
|
|
106
|
+
viewModel,
|
|
107
|
+
roleOptions: undefined,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// Only the 7 role-var typography properties come from `roleTypographyStyle` — alignment and
|
|
111
|
+
// the autoscale/wrap flags are the label's concern (`submitButtonTextStyle`, unchanged) and
|
|
112
|
+
// were always redundant on the box (it already carries `tw-text-center`).
|
|
113
|
+
expect(style).toEqual({
|
|
114
|
+
...viewModel.buttonStyles.style,
|
|
115
|
+
fontFamily: 'Lato',
|
|
116
|
+
fontWeight: 'normal',
|
|
117
|
+
lineHeight: '1.2',
|
|
118
|
+
letterSpacing: '0px',
|
|
119
|
+
});
|
|
120
|
+
expect(
|
|
121
|
+
computedFor('submitButtonRoleClass', {
|
|
122
|
+
viewModel,
|
|
123
|
+
roleOptions: undefined,
|
|
124
|
+
}),
|
|
125
|
+
).toBe('bp-text-role-button');
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
1
|
+
import { defineComponent, inject } from 'vue';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { ContactFormViewModel } from '@brand-page/view-models';
|
|
4
4
|
import type {
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
FormFieldType,
|
|
8
8
|
} from '@brand-page/models';
|
|
9
9
|
import { FORM_FIELD_TYPES } from '@brand-page/models';
|
|
10
|
+
import type { TextStyleOptions } from '@brand-page/models';
|
|
10
11
|
import {
|
|
11
12
|
getEmailValidationError,
|
|
12
13
|
getMessageValidationError,
|
|
@@ -33,6 +34,12 @@ import {
|
|
|
33
34
|
} from '@brand-page/utils';
|
|
34
35
|
import { hasRTEContent, type RichTextValue } from '@brand-page-maker/utils';
|
|
35
36
|
import { useReCaptcha } from '../../composables/recaptcha.composable';
|
|
37
|
+
import {
|
|
38
|
+
TEXT_ROLE_OPTIONS_KEY,
|
|
39
|
+
roleTypographyStyle,
|
|
40
|
+
roleClassFor,
|
|
41
|
+
roleStyleFor,
|
|
42
|
+
} from '@brand-page/utils/text-role-css.util';
|
|
36
43
|
|
|
37
44
|
export interface FieldValue {
|
|
38
45
|
value: string;
|
|
@@ -66,9 +73,13 @@ export default defineComponent({
|
|
|
66
73
|
},
|
|
67
74
|
setup() {
|
|
68
75
|
const recaptcha = useReCaptcha();
|
|
76
|
+
// BP-5969: the live role options, provided by `Page`. Absent (rendered outside Page) →
|
|
77
|
+
// the button box bakes the button text style's own values, as before this change.
|
|
78
|
+
const roleOptions = inject(TEXT_ROLE_OPTIONS_KEY, undefined);
|
|
69
79
|
|
|
70
80
|
return {
|
|
71
81
|
recaptcha,
|
|
82
|
+
roleOptions,
|
|
72
83
|
};
|
|
73
84
|
},
|
|
74
85
|
data: () => ({
|
|
@@ -87,26 +98,32 @@ export default defineComponent({
|
|
|
87
98
|
);
|
|
88
99
|
},
|
|
89
100
|
|
|
101
|
+
submitButtonRoleClass(): string | undefined {
|
|
102
|
+
return roleClassFor(this.viewModel.buttonTextStyle?.textStyleType);
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
// The size goes on the label alone: an em size on both the button and the label
|
|
106
|
+
// multiplies (Heading 1's 6.875em twice is ~750px). The rest stays, since the button's
|
|
107
|
+
// font sets the line box the label sits in.
|
|
90
108
|
submitButtonStyle(): BrandPageCssStyle {
|
|
91
109
|
const buttonStyle = { ...this.viewModel.buttonStyles?.style };
|
|
92
|
-
const
|
|
110
|
+
const roleStyle = roleStyleFor(
|
|
111
|
+
this.viewModel.buttonTextStyle?.textStyleType,
|
|
112
|
+
this.roleOptions as TextStyleOptions | undefined,
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
return {
|
|
93
116
|
...buttonStyle,
|
|
94
|
-
...this.viewModel.buttonTextStyle,
|
|
95
|
-
|
|
117
|
+
...roleTypographyStyle(this.viewModel.buttonTextStyle, roleStyle, {
|
|
118
|
+
omit: ['fontSize'],
|
|
119
|
+
}),
|
|
120
|
+
color: this.viewModel.buttonTextStyle?.color || buttonStyle.color,
|
|
96
121
|
};
|
|
97
|
-
|
|
98
|
-
return buttonTextStyle;
|
|
99
122
|
},
|
|
100
123
|
|
|
101
124
|
submitButtonTextStyle(): BrandPageCssStyle {
|
|
102
|
-
const buttonTextStyle =
|
|
103
|
-
|
|
104
|
-
fontSize: this.viewModel.buttonTextStyle.fontSize,
|
|
105
|
-
letterSpacing: this.viewModel.buttonTextStyle.letterSpacing,
|
|
106
|
-
lineHeight: this.viewModel.buttonTextStyle.lineHeight,
|
|
107
|
-
wordBreak: this.viewModel.buttonTextStyle.wordBreak,
|
|
108
|
-
overflowWrap: this.viewModel.buttonTextStyle.overflowWrap,
|
|
109
|
-
};
|
|
125
|
+
const { backgroundColor: _backgroundColor, ...buttonTextStyle } =
|
|
126
|
+
this.viewModel.buttonTextStyle;
|
|
110
127
|
|
|
111
128
|
return buttonTextStyle;
|
|
112
129
|
},
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
<TextInput
|
|
56
56
|
v-if="value.field.type !== 'text-area'"
|
|
57
57
|
v-model="value.value"
|
|
58
|
+
element-classes="tw-font-sans"
|
|
58
59
|
:placeholder="`${value.field.name}${
|
|
59
60
|
value.field.required ? '*' : ''
|
|
60
61
|
}`"
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
<button
|
|
96
97
|
class="tw-block tw-border-0 tw-mt-4 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-full hover:tw-cursor-pointer"
|
|
97
98
|
:style="submitButtonStyle"
|
|
99
|
+
:class="submitButtonRoleClass"
|
|
98
100
|
>
|
|
99
101
|
<TextWrapper
|
|
100
102
|
:text-style="submitButtonTextStyle"
|
|
@@ -169,6 +171,7 @@
|
|
|
169
171
|
<TextInput
|
|
170
172
|
v-if="value.field.type !== 'text-area'"
|
|
171
173
|
v-model="value.value"
|
|
174
|
+
element-classes="tw-font-sans"
|
|
172
175
|
:placeholder="`${value.field.name}${
|
|
173
176
|
value.field.required ? '*' : ''
|
|
174
177
|
}`"
|
|
@@ -212,10 +215,13 @@
|
|
|
212
215
|
<button
|
|
213
216
|
class="tw-block tw-border-0 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-fit hover:tw-cursor-pointer tw-px-8 tw-py-3 c-button-full"
|
|
214
217
|
:style="submitButtonStyle"
|
|
215
|
-
:class="
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
:class="[
|
|
219
|
+
submitButtonRoleClass,
|
|
220
|
+
{
|
|
221
|
+
'tw-w-full': isMobileDevice,
|
|
222
|
+
'tw-min-w-[120px]': isDecorativeSubmitStyle,
|
|
223
|
+
},
|
|
224
|
+
]"
|
|
219
225
|
>
|
|
220
226
|
<TextWrapper
|
|
221
227
|
:text-style="submitButtonTextStyle"
|
|
@@ -297,6 +303,7 @@
|
|
|
297
303
|
<TextInput
|
|
298
304
|
v-if="value.field.type !== 'text-area'"
|
|
299
305
|
v-model="value.value"
|
|
306
|
+
element-classes="tw-font-sans"
|
|
300
307
|
:placeholder="`${value.field.name}${
|
|
301
308
|
value.field.required ? '*' : ''
|
|
302
309
|
}`"
|
|
@@ -340,10 +347,13 @@
|
|
|
340
347
|
<button
|
|
341
348
|
class="tw-block tw-border-0 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-fit hover:tw-cursor-pointer tw-px-8 tw-py-3 c-button-full"
|
|
342
349
|
:style="submitButtonStyle"
|
|
343
|
-
:class="
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
350
|
+
:class="[
|
|
351
|
+
submitButtonRoleClass,
|
|
352
|
+
{
|
|
353
|
+
'tw-w-full': isMobileDevice,
|
|
354
|
+
'tw-min-w-[120px]': isDecorativeSubmitStyle,
|
|
355
|
+
},
|
|
356
|
+
]"
|
|
347
357
|
>
|
|
348
358
|
<TextWrapper
|
|
349
359
|
:text-style="submitButtonTextStyle"
|
|
@@ -441,6 +451,7 @@
|
|
|
441
451
|
<TextInput
|
|
442
452
|
v-if="value.field.type !== 'text-area'"
|
|
443
453
|
v-model="value.value"
|
|
454
|
+
element-classes="tw-font-sans"
|
|
444
455
|
:placeholder="`${value.field.name}${
|
|
445
456
|
value.field.required ? '*' : ''
|
|
446
457
|
}`"
|
|
@@ -488,10 +499,13 @@
|
|
|
488
499
|
<button
|
|
489
500
|
class="tw-block tw-border-0 tw-py-2 tw-select-none tw-text-base tw-text-center tw-w-fit hover:tw-cursor-pointer tw-px-8 tw-py-3 c-button-full"
|
|
490
501
|
:style="submitButtonStyle"
|
|
491
|
-
:class="
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
502
|
+
:class="[
|
|
503
|
+
submitButtonRoleClass,
|
|
504
|
+
{
|
|
505
|
+
'tw-w-full': isMobileDevice,
|
|
506
|
+
'tw-min-w-[120px]': isDecorativeSubmitStyle,
|
|
507
|
+
},
|
|
508
|
+
]"
|
|
495
509
|
>
|
|
496
510
|
<TextWrapper
|
|
497
511
|
:text-style="submitButtonTextStyle"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import ContactForm from './ContactForm.vue';
|
|
5
|
+
import { TEXT_ROLE_OPTIONS_KEY } from '@brand-page/utils/text-role-css.util';
|
|
6
|
+
|
|
7
|
+
// B1 — ContactForm.mixin.test.ts calls the mixin's computed directly (`.call(thisArg)`), which
|
|
8
|
+
// never runs ContactForm.vue's own `setup()` (the manual `...ContactFormMixin.setup()` spread a
|
|
9
|
+
// mixin's own setup needs — Vue's `mixins:` merge never runs it). A real mount proves the
|
|
10
|
+
// injection actually wires up, not just the computed's logic in isolation. Kept in its own file
|
|
11
|
+
// for readability, not because combining a bare mixin import with a real mount crashes —
|
|
12
|
+
// Payment.test.ts does both in one file without issue.
|
|
13
|
+
describe('ContactForm submit button — role wiring (real mount, BP-5969 B1)', () => {
|
|
14
|
+
const buttonRole = {
|
|
15
|
+
fontFamily: 'Lato',
|
|
16
|
+
fontSize: '1em',
|
|
17
|
+
fontWeight: 'normal',
|
|
18
|
+
lineHeight: '1.2',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const viewModel = {
|
|
22
|
+
fields: [],
|
|
23
|
+
buttonStyles: {
|
|
24
|
+
style: { backgroundColor: 'var(--palette-0)', borderStyle: 'solid' },
|
|
25
|
+
},
|
|
26
|
+
buttonText: 'Send',
|
|
27
|
+
buttonTextStyle: {
|
|
28
|
+
textStyleType: 'button',
|
|
29
|
+
fontFamily: 'Lato',
|
|
30
|
+
fontSize: '1em',
|
|
31
|
+
fontWeight: 'normal',
|
|
32
|
+
lineHeight: '1.2',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const mountContactForm = () =>
|
|
37
|
+
mount(ContactForm, {
|
|
38
|
+
props: {
|
|
39
|
+
context: { isBrandSite: false } as any,
|
|
40
|
+
viewModel,
|
|
41
|
+
isPreview: false,
|
|
42
|
+
} as any,
|
|
43
|
+
global: {
|
|
44
|
+
provide: {
|
|
45
|
+
[TEXT_ROLE_OPTIONS_KEY]: computed(() => ({
|
|
46
|
+
button: { style: buttonRole },
|
|
47
|
+
})),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('the submit button carries the role class and a role reference, mounted through Vue', () => {
|
|
53
|
+
const button = mountContactForm().get('button');
|
|
54
|
+
|
|
55
|
+
expect(button.classes()).toContain('bp-text-role-button');
|
|
56
|
+
expect(button.attributes('style')).toContain(
|
|
57
|
+
'font-family: var(--role-font-family)',
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import MailingListMixin from './MailingList.mixin';
|
|
3
|
+
|
|
4
|
+
const computedFor = (
|
|
5
|
+
name: 'buttonStyle' | 'buttonRoleClass',
|
|
6
|
+
thisArg: Record<string, unknown>,
|
|
7
|
+
): Record<string, unknown> =>
|
|
8
|
+
(
|
|
9
|
+
MailingListMixin.computed![name] as unknown as (
|
|
10
|
+
this: unknown,
|
|
11
|
+
) => Record<string, unknown>
|
|
12
|
+
).call(thisArg);
|
|
13
|
+
|
|
14
|
+
// The subscribe button holds its own plain text (no TextWrapper) — so unlike the contact-form
|
|
15
|
+
// and payment boxes, it must carry EVERY role-defined property, size included.
|
|
16
|
+
describe('MailingList subscribe button', () => {
|
|
17
|
+
const buttonRole = {
|
|
18
|
+
fontFamily: 'Lato',
|
|
19
|
+
fontSize: '1em',
|
|
20
|
+
fontWeight: 'normal',
|
|
21
|
+
lineHeight: '1.2',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const viewModel = {
|
|
25
|
+
styles: {
|
|
26
|
+
style: { backgroundColor: 'var(--palette-0)', borderStyle: 'solid' },
|
|
27
|
+
},
|
|
28
|
+
buttonTextStyle: {
|
|
29
|
+
textStyleType: 'button',
|
|
30
|
+
fontFamily: 'Lato',
|
|
31
|
+
fontSize: '1em',
|
|
32
|
+
fontWeight: 'normal',
|
|
33
|
+
lineHeight: '1.2',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const roleOptions = { button: { style: buttonRole } };
|
|
38
|
+
|
|
39
|
+
it('carries a role reference for every role-defined property, including size', () => {
|
|
40
|
+
expect(computedFor('buttonStyle', { viewModel, roleOptions })).toEqual({
|
|
41
|
+
backgroundColor: 'var(--palette-0)',
|
|
42
|
+
borderStyle: 'solid',
|
|
43
|
+
fontFamily: 'var(--role-font-family)',
|
|
44
|
+
fontSize: 'var(--role-font-size)',
|
|
45
|
+
fontWeight: 'var(--role-font-weight)',
|
|
46
|
+
lineHeight: 'var(--role-line-height)',
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('carries the role class', () => {
|
|
51
|
+
expect(computedFor('buttonRoleClass', { viewModel, roleOptions })).toBe(
|
|
52
|
+
'bp-text-role-button',
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('an own colour still wins', () => {
|
|
57
|
+
const style = computedFor('buttonStyle', {
|
|
58
|
+
viewModel: {
|
|
59
|
+
...viewModel,
|
|
60
|
+
buttonTextStyle: { ...viewModel.buttonTextStyle, color: '#123456' },
|
|
61
|
+
},
|
|
62
|
+
roleOptions,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
expect(style.color).toBe('#123456');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('an own size stays a literal against the role', () => {
|
|
69
|
+
const style = computedFor('buttonStyle', {
|
|
70
|
+
viewModel: {
|
|
71
|
+
...viewModel,
|
|
72
|
+
buttonTextStyle: { ...viewModel.buttonTextStyle, fontSize: '1.25em' },
|
|
73
|
+
},
|
|
74
|
+
roleOptions,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
expect(style.fontSize).toBe('1.25em');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('with no role in scope, bakes the button text style literally', () => {
|
|
81
|
+
expect(
|
|
82
|
+
computedFor('buttonStyle', { viewModel, roleOptions: undefined }),
|
|
83
|
+
).toEqual({
|
|
84
|
+
backgroundColor: 'var(--palette-0)',
|
|
85
|
+
borderStyle: 'solid',
|
|
86
|
+
fontFamily: 'Lato',
|
|
87
|
+
fontSize: '1em',
|
|
88
|
+
fontWeight: 'normal',
|
|
89
|
+
lineHeight: '1.2',
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
1
|
+
import { defineComponent, inject } from 'vue';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { MailingListViewModel } from '@brand-page/view-models';
|
|
4
4
|
import brandPageClient from '../../clients/brand-page.client';
|
|
@@ -8,13 +8,19 @@ import {
|
|
|
8
8
|
isPreviewMode,
|
|
9
9
|
} from '@brand-page/utils';
|
|
10
10
|
import { sectionFrameStyle } from '@brand-page/utils/button.util';
|
|
11
|
-
import type { BrandPageContext } from '@brand-page/models';
|
|
11
|
+
import type { BrandPageContext, TextStyleOptions } from '@brand-page/models';
|
|
12
12
|
import {
|
|
13
13
|
contentSettingsTr,
|
|
14
14
|
mailingListTr,
|
|
15
15
|
} from '@src/composables/useTranslate';
|
|
16
16
|
import { useReCaptcha } from '../../composables/recaptcha.composable';
|
|
17
17
|
import { RECAPTCHA_ACTION_MAILING_LIST } from '../../constants';
|
|
18
|
+
import {
|
|
19
|
+
TEXT_ROLE_OPTIONS_KEY,
|
|
20
|
+
roleTypographyStyle,
|
|
21
|
+
roleClassFor,
|
|
22
|
+
roleStyleFor,
|
|
23
|
+
} from '@brand-page/utils/text-role-css.util';
|
|
18
24
|
|
|
19
25
|
const MAX_NAME_LENGTH = 200;
|
|
20
26
|
|
|
@@ -40,10 +46,14 @@ export default defineComponent({
|
|
|
40
46
|
},
|
|
41
47
|
setup() {
|
|
42
48
|
const recaptcha = useReCaptcha();
|
|
49
|
+
// BP-5969: the live role options, provided by `Page`. Absent (rendered outside Page) →
|
|
50
|
+
// the button bakes the button text style's own values, as before this change.
|
|
51
|
+
const roleOptions = inject(TEXT_ROLE_OPTIONS_KEY, undefined);
|
|
43
52
|
|
|
44
53
|
return {
|
|
45
54
|
mailingListTr,
|
|
46
55
|
recaptcha,
|
|
56
|
+
roleOptions,
|
|
47
57
|
};
|
|
48
58
|
},
|
|
49
59
|
data() {
|
|
@@ -94,6 +104,12 @@ export default defineComponent({
|
|
|
94
104
|
return Boolean(this.submitError);
|
|
95
105
|
},
|
|
96
106
|
|
|
107
|
+
buttonRoleClass(): string | undefined {
|
|
108
|
+
return roleClassFor(this.viewModel.buttonTextStyle?.textStyleType);
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
// The button holds its own plain text, not a `TextWrapper` — so unlike the contact-form and
|
|
112
|
+
// payment boxes, its typography is applied here in full, size included.
|
|
97
113
|
buttonStyle(): BrandPageCssStyle {
|
|
98
114
|
const buttonStyle = { ...this.viewModel.styles?.style };
|
|
99
115
|
|
|
@@ -104,7 +120,16 @@ export default defineComponent({
|
|
|
104
120
|
buttonStyle.backgroundColor = buttonStyle.backgroundColor;
|
|
105
121
|
}
|
|
106
122
|
|
|
107
|
-
|
|
123
|
+
const roleStyle = roleStyleFor(
|
|
124
|
+
this.viewModel.buttonTextStyle?.textStyleType,
|
|
125
|
+
this.roleOptions as TextStyleOptions | undefined,
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
...buttonStyle,
|
|
130
|
+
...roleTypographyStyle(this.viewModel.buttonTextStyle, roleStyle),
|
|
131
|
+
color: this.viewModel.buttonTextStyle?.color ?? buttonStyle.color,
|
|
132
|
+
};
|
|
108
133
|
},
|
|
109
134
|
|
|
110
135
|
buttonText(): string {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
<TextInput
|
|
23
23
|
v-if="isNameRequired"
|
|
24
24
|
v-model="name"
|
|
25
|
+
element-classes="tw-font-sans"
|
|
25
26
|
:placeholder="mailingListTr('namePlaceholder')"
|
|
26
27
|
:label="mailingListTr('nameLabel')"
|
|
27
28
|
:show-label-screen-reader-only="true"
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
</p>
|
|
36
37
|
<TextInput
|
|
37
38
|
v-model="email"
|
|
39
|
+
element-classes="tw-font-sans"
|
|
38
40
|
:placeholder="mailingListTr('emailPlaceholder')"
|
|
39
41
|
:label="mailingListTr('emailLabel')"
|
|
40
42
|
:show-label-screen-reader-only="true"
|
|
@@ -55,10 +57,13 @@
|
|
|
55
57
|
:style="buttonStyle"
|
|
56
58
|
:disabled="isFormDisabled"
|
|
57
59
|
class="tw-w-full tw-py-4 tw-mt-4 tw-block tw-text-center tw-text-base tw-border-0"
|
|
58
|
-
:class="
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
:class="[
|
|
61
|
+
buttonRoleClass,
|
|
62
|
+
{
|
|
63
|
+
'tw-cursor-pointer hover:tw-underline': !isFormDisabled,
|
|
64
|
+
'tw-cursor-wait': isSubmitting,
|
|
65
|
+
},
|
|
66
|
+
]"
|
|
62
67
|
>
|
|
63
68
|
{{ buttonText }}
|
|
64
69
|
</button>
|