@designcrowd/library.brand-page 6.2.11-builder-v2-1 → 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-Dg2pOwbr.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-BILs_hsB.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-VpxQ0N5F.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CFHWRHzi.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CFHWRHzi.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CZfs45s9.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CZfs45s9.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DYMQ6sIF.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Dj5sdPid.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-Cx9yNTro.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Bzr0SjGq.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BgqKY35F.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-CXK6qfvL.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-B8SggNTQ.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/brand-page-context.model.d.ts +2 -0
- package/lib/src/brand-page/models/brand-page-context.model.js +7 -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 +34 -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 +44 -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/preview/Preview.mixin.d.ts +7 -0
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +21 -0
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +25 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +25 -1
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +21 -0
- 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 +25 -1
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +21 -0
- package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.d.ts +10 -0
- package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.js +11 -0
- 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 +14 -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/ai-thread/ai-website-builder-thread-store.d.ts +9 -2
- package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.js +20 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +21 -0
- 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 +7 -1
- package/lib/src/clients/ai-assistant-client.js +7 -15
- 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 +284 -188
- package/lib/src/css/library.brand-page-brandPage.min.css +284 -188
- package/lib/src/css/library.brand-page-designCom.min.css +284 -188
- package/lib/src/css/library.brand-page-preview.min.css +284 -188
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.mjs +195 -191
- package/lib/src/{lib-7gtW85nE.js → lib-kGRlD3_P.js} +39082 -36131
- 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 +22 -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 +26 -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/new-page-modal/NewPageModal.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +38 -5
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +91 -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 +32 -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 +23 -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 +176 -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 +58 -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/brand-page-context.model.ts +13 -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/composables/ai-chat/ai-builder-experiment.test.ts +82 -0
- package/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.ts +19 -0
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +19 -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/ai-thread/ai-website-builder-thread-store.ts +30 -0
- 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 +13 -18
- 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/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
- 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/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/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/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 +74 -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/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/models/brand-page-context.model.test.ts +0 -38
- 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/clients/ai-assistant-client.test.ts +0 -135
- 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
|
@@ -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 brandPageClient from '../../clients/brand-page.client';
|
|
4
4
|
import {
|
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
CreateCartResult,
|
|
13
13
|
PaymentConfig,
|
|
14
14
|
PaymentOption,
|
|
15
|
+
TextStyleOptions,
|
|
15
16
|
} from '@brand-page/models';
|
|
16
17
|
import type {
|
|
17
18
|
RequestPaymentViewModel,
|
|
@@ -21,6 +22,12 @@ import raygunUtil from '@brand-page/utils/raygun.util';
|
|
|
21
22
|
import { isPreviewMode } from '@brand-page/utils';
|
|
22
23
|
import { sectionFrameStyle } from '@brand-page/utils/button.util';
|
|
23
24
|
import { paymentTr } from '@src/composables/useTranslate';
|
|
25
|
+
import {
|
|
26
|
+
TEXT_ROLE_OPTIONS_KEY,
|
|
27
|
+
roleTypographyStyle,
|
|
28
|
+
roleClassFor,
|
|
29
|
+
roleStyleFor,
|
|
30
|
+
} from '@brand-page/utils/text-role-css.util';
|
|
24
31
|
|
|
25
32
|
const DEFAULT_PAYMENT_SUCCESS_MESSAGE = paymentTr(
|
|
26
33
|
`defaultPaymentSuccessMessage`,
|
|
@@ -65,6 +72,15 @@ export default defineComponent({
|
|
|
65
72
|
required: true,
|
|
66
73
|
},
|
|
67
74
|
},
|
|
75
|
+
setup() {
|
|
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);
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
roleOptions,
|
|
82
|
+
};
|
|
83
|
+
},
|
|
68
84
|
data: () => ({
|
|
69
85
|
paymentState,
|
|
70
86
|
cart: undefined as CreateCartResult<unknown> | undefined | null,
|
|
@@ -77,6 +93,10 @@ export default defineComponent({
|
|
|
77
93
|
return this.viewModel.buttonStyles.style;
|
|
78
94
|
},
|
|
79
95
|
|
|
96
|
+
continueButtonRoleClass(): string | undefined {
|
|
97
|
+
return roleClassFor(this.viewModel.buttonTextStyle?.textStyleType);
|
|
98
|
+
},
|
|
99
|
+
|
|
80
100
|
currencySymbol(): string {
|
|
81
101
|
return this.paymentConfig.paymentConfig?.defaultCurrencySymbol || '';
|
|
82
102
|
},
|
|
@@ -143,7 +163,19 @@ export default defineComponent({
|
|
|
143
163
|
buttonStyle.backgroundColor = buttonStyle.backgroundColor;
|
|
144
164
|
}
|
|
145
165
|
|
|
146
|
-
|
|
166
|
+
// The label's TextWrapper applies the size; an em size here too would multiply.
|
|
167
|
+
const roleStyle = roleStyleFor(
|
|
168
|
+
this.viewModel.buttonTextStyle?.textStyleType,
|
|
169
|
+
this.roleOptions as TextStyleOptions | undefined,
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
...buttonStyle,
|
|
174
|
+
...roleTypographyStyle(this.viewModel.buttonTextStyle, roleStyle, {
|
|
175
|
+
omit: ['fontSize'],
|
|
176
|
+
}),
|
|
177
|
+
color: this.viewModel.buttonTextStyle?.color ?? buttonStyle.color,
|
|
178
|
+
};
|
|
147
179
|
},
|
|
148
180
|
|
|
149
181
|
paymentOptionButtonStyle(): BrandPageCssStyle {
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import Payment from './Payment.vue';
|
|
5
|
+
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
6
|
+
import PaymentMixin, { paymentState } from './Payment.mixin';
|
|
7
|
+
import { TEXT_ROLE_OPTIONS_KEY } from '@brand-page/utils/text-role-css.util';
|
|
8
|
+
|
|
9
|
+
// The Continue/Done label's TextWrapper applies the size; on the <button> too, an em size
|
|
10
|
+
// multiplies (Heading 1's 6.875em twice is ~750px).
|
|
11
|
+
describe('Payment — button text size applied once', () => {
|
|
12
|
+
const computedFor = (
|
|
13
|
+
name: 'continueButtonStyle' | 'continueButtonRoleClass',
|
|
14
|
+
thisArg: Record<string, unknown>,
|
|
15
|
+
): Record<string, unknown> =>
|
|
16
|
+
(
|
|
17
|
+
PaymentMixin.computed![name] as unknown as (
|
|
18
|
+
this: unknown,
|
|
19
|
+
) => Record<string, unknown>
|
|
20
|
+
).call(thisArg);
|
|
21
|
+
|
|
22
|
+
const buttonRole = {
|
|
23
|
+
fontFamily: 'Playwrite AT',
|
|
24
|
+
fontSize: '1em',
|
|
25
|
+
fontWeight: 'bold',
|
|
26
|
+
lineHeight: '1.2',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const viewModel = {
|
|
30
|
+
buttonStyles: {
|
|
31
|
+
style: { backgroundColor: 'var(--palette-0)', borderStyle: 'solid' },
|
|
32
|
+
},
|
|
33
|
+
buttonTextStyle: {
|
|
34
|
+
textStyleType: 'heading1',
|
|
35
|
+
fontFamily: 'Playwrite AT',
|
|
36
|
+
fontSize: '6.875em',
|
|
37
|
+
fontWeight: 'bold',
|
|
38
|
+
lineHeight: '1.2',
|
|
39
|
+
color: 'var(--palette-1)',
|
|
40
|
+
textAlign: 'center',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const roleOptions = { heading1: { style: buttonRole } };
|
|
45
|
+
|
|
46
|
+
it('the continue button carries a role reference for every role-defined property except size', () => {
|
|
47
|
+
expect(
|
|
48
|
+
computedFor('continueButtonStyle', { viewModel, roleOptions }),
|
|
49
|
+
).toEqual({
|
|
50
|
+
backgroundColor: 'var(--palette-0)',
|
|
51
|
+
borderStyle: 'solid',
|
|
52
|
+
fontFamily: 'var(--role-font-family)',
|
|
53
|
+
fontWeight: 'var(--role-font-weight)',
|
|
54
|
+
lineHeight: 'var(--role-line-height)',
|
|
55
|
+
color: 'var(--palette-1)',
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('the box carries the role class', () => {
|
|
60
|
+
expect(
|
|
61
|
+
computedFor('continueButtonRoleClass', { viewModel, roleOptions }),
|
|
62
|
+
).toBe('bp-text-role-heading1');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('a stored off value stays a literal against a role that sets the opposite', () => {
|
|
66
|
+
const style = computedFor('continueButtonStyle', {
|
|
67
|
+
viewModel: {
|
|
68
|
+
...viewModel,
|
|
69
|
+
buttonTextStyle: { ...viewModel.buttonTextStyle, fontWeight: 'normal' },
|
|
70
|
+
},
|
|
71
|
+
roleOptions,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
expect(style.fontWeight).toBe('normal');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('with no role in scope, the box bakes the button text style literally, minus size', () => {
|
|
78
|
+
const style = computedFor('continueButtonStyle', {
|
|
79
|
+
viewModel,
|
|
80
|
+
roleOptions: undefined,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
expect(style).toEqual({
|
|
84
|
+
backgroundColor: 'var(--palette-0)',
|
|
85
|
+
borderStyle: 'solid',
|
|
86
|
+
fontFamily: 'Playwrite AT',
|
|
87
|
+
fontWeight: 'bold',
|
|
88
|
+
lineHeight: '1.2',
|
|
89
|
+
color: 'var(--palette-1)',
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// B1 — the tests above call the mixin's computed directly (`.call(thisArg)`), which never runs
|
|
95
|
+
// Payment.vue's own `setup()` (the manual `...PaymentMixin.setup()` spread a mixin's own setup
|
|
96
|
+
// needs — Vue's `mixins:` merge never runs it). A real mount proves the injection actually wires
|
|
97
|
+
// up, not just the computed's logic in isolation.
|
|
98
|
+
describe('Payment — continue box role wiring (real mount, BP-5969 B1)', () => {
|
|
99
|
+
const buttonRole = {
|
|
100
|
+
fontFamily: 'Playwrite AT',
|
|
101
|
+
fontSize: '1em',
|
|
102
|
+
fontWeight: 'bold',
|
|
103
|
+
lineHeight: '1.2',
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const viewModel = {
|
|
107
|
+
buttonStyles: {
|
|
108
|
+
style: { backgroundColor: 'var(--palette-0)', borderStyle: 'solid' },
|
|
109
|
+
},
|
|
110
|
+
buttonTextStyle: {
|
|
111
|
+
textStyleType: 'heading1',
|
|
112
|
+
fontFamily: 'Playwrite AT',
|
|
113
|
+
fontSize: '6.875em',
|
|
114
|
+
fontWeight: 'bold',
|
|
115
|
+
lineHeight: '1.2',
|
|
116
|
+
color: 'var(--palette-1)',
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const mountPayment = () =>
|
|
121
|
+
mount(Payment, {
|
|
122
|
+
props: {
|
|
123
|
+
context: { isPreview: true },
|
|
124
|
+
viewModel,
|
|
125
|
+
paymentConfig: { paymentOptions: [] },
|
|
126
|
+
paymentRequestDetails: {
|
|
127
|
+
isRequestValid: false,
|
|
128
|
+
selectedPaymentOptionIds: [],
|
|
129
|
+
showProductName: false,
|
|
130
|
+
},
|
|
131
|
+
} as any,
|
|
132
|
+
global: {
|
|
133
|
+
provide: {
|
|
134
|
+
[TEXT_ROLE_OPTIONS_KEY]: computed(() => ({
|
|
135
|
+
heading1: { style: buttonRole },
|
|
136
|
+
})),
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('the continue button carries the role class and a role reference, mounted through Vue', () => {
|
|
142
|
+
const button = mountPayment().get('button');
|
|
143
|
+
|
|
144
|
+
expect(button.classes()).toContain('bp-text-role-heading1');
|
|
145
|
+
expect(button.attributes('style')).toContain(
|
|
146
|
+
'font-family: var(--role-font-family)',
|
|
147
|
+
);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// The success message is its own rich text, drawn with its own style, not the description's.
|
|
152
|
+
describe('Payment — success message', () => {
|
|
153
|
+
it('renders the success message with its own style', async () => {
|
|
154
|
+
const viewModel = {
|
|
155
|
+
type: 'support-me',
|
|
156
|
+
title: 'Support',
|
|
157
|
+
description: 'Pay me',
|
|
158
|
+
successMessage: 'Thanks!',
|
|
159
|
+
displayStyle: 'preview',
|
|
160
|
+
buttonStyles: { style: {} },
|
|
161
|
+
titleStyle: { textStyleType: 'heading5' },
|
|
162
|
+
descriptionStyle: { textStyleType: 'paragraph2', fontSize: '1.25em' },
|
|
163
|
+
successMessageStyle: { textStyleType: 'paragraph3' },
|
|
164
|
+
buttonTextStyle: { textStyleType: 'button' },
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const wrapper = shallowMount(Payment, {
|
|
168
|
+
props: {
|
|
169
|
+
context: { isPreview: true },
|
|
170
|
+
viewModel,
|
|
171
|
+
paymentConfig: { paymentOptions: [] },
|
|
172
|
+
paymentRequestDetails: {
|
|
173
|
+
isRequestValid: false,
|
|
174
|
+
selectedPaymentOptionIds: [],
|
|
175
|
+
showProductName: false,
|
|
176
|
+
},
|
|
177
|
+
} as any,
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
await wrapper.setData({ state: paymentState.Success });
|
|
181
|
+
|
|
182
|
+
const message = wrapper
|
|
183
|
+
.findAllComponents(TextWrapper)
|
|
184
|
+
.find((text) => text.props('text') === 'Thanks!');
|
|
185
|
+
|
|
186
|
+
expect(message?.props('textStyle')).toEqual(viewModel.successMessageStyle);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
@@ -61,10 +61,13 @@
|
|
|
61
61
|
class="tw-w-full tw-py-4 tw-mt-4 tw-block tw-text-center tw-text-base tw-border-0"
|
|
62
62
|
:style="continueButtonStyle"
|
|
63
63
|
:disabled="!isPaymentOptionSelectionContinueEnabled"
|
|
64
|
-
:class="
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
:class="[
|
|
65
|
+
continueButtonRoleClass,
|
|
66
|
+
{
|
|
67
|
+
'hover:tw-cursor-pointer':
|
|
68
|
+
isPaymentOptionSelectionContinueEnabled,
|
|
69
|
+
},
|
|
70
|
+
]"
|
|
68
71
|
@click="onPaymentOptionSelectionContinueClick"
|
|
69
72
|
>
|
|
70
73
|
<TextWrapper
|
|
@@ -94,7 +97,7 @@
|
|
|
94
97
|
|
|
95
98
|
<div v-if="!isCollapsed && state === paymentState.Success">
|
|
96
99
|
<TextWrapper
|
|
97
|
-
:text-style="viewModel.
|
|
100
|
+
:text-style="viewModel.successMessageStyle"
|
|
98
101
|
:text="successMessage"
|
|
99
102
|
element="p"
|
|
100
103
|
class="tw-text-center"
|
|
@@ -109,6 +112,7 @@
|
|
|
109
112
|
<button
|
|
110
113
|
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"
|
|
111
114
|
:style="continueButtonStyle"
|
|
115
|
+
:class="continueButtonRoleClass"
|
|
112
116
|
@click="onDoneButtonClick"
|
|
113
117
|
>
|
|
114
118
|
<TextWrapper
|
|
@@ -140,7 +144,10 @@ export default {
|
|
|
140
144
|
},
|
|
141
145
|
mixins: [PaymentMixin],
|
|
142
146
|
setup() {
|
|
147
|
+
// A mixin's own `setup()` is never run by Vue's `mixins:` merge, so `PaymentMixin`'s (which
|
|
148
|
+
// injects the live role options) is invoked here instead.
|
|
143
149
|
return {
|
|
150
|
+
...PaymentMixin.setup(),
|
|
144
151
|
commonTr,
|
|
145
152
|
paymentTr,
|
|
146
153
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
1
|
+
import { defineComponent, inject } from 'vue';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import { SUPPORT_ME_CUSTOM_PRODUCT_NAME } from '../../../constants';
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
BrandPageContext,
|
|
6
|
+
PaymentOption,
|
|
7
|
+
TextStyleOptions,
|
|
8
|
+
} from '../../../models';
|
|
5
9
|
import type { SupportMeViewModel } from '../../../view-models';
|
|
6
10
|
import type { PaymentRequestDetails } from '../Payment.mixin';
|
|
7
11
|
import {
|
|
@@ -13,6 +17,12 @@ import {
|
|
|
13
17
|
DEFAULT_CURRENCY_CODE,
|
|
14
18
|
} from '../../../constants';
|
|
15
19
|
import { paymentTr } from '@src/composables/useTranslate';
|
|
20
|
+
import {
|
|
21
|
+
TEXT_ROLE_OPTIONS_KEY,
|
|
22
|
+
roleTypographyStyle,
|
|
23
|
+
roleClassFor,
|
|
24
|
+
roleStyleFor,
|
|
25
|
+
} from '@brand-page/utils/text-role-css.util';
|
|
16
26
|
|
|
17
27
|
const MAX_CUSTOM_MESSAGE_CHARS = 500;
|
|
18
28
|
const MINIMUM_CUSTOM_AMOUNT = 0.1;
|
|
@@ -28,6 +38,15 @@ export default defineComponent({
|
|
|
28
38
|
required: true,
|
|
29
39
|
},
|
|
30
40
|
},
|
|
41
|
+
setup() {
|
|
42
|
+
// BP-5969: the live role options, provided by `Page`. Absent (rendered outside Page) →
|
|
43
|
+
// the message block bakes its heading style's own values, as before this change.
|
|
44
|
+
const roleOptions = inject(TEXT_ROLE_OPTIONS_KEY, undefined);
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
roleOptions,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
31
50
|
data() {
|
|
32
51
|
return {
|
|
33
52
|
customerMessage: undefined as string | undefined,
|
|
@@ -121,6 +140,34 @@ export default defineComponent({
|
|
|
121
140
|
return buttonStyle;
|
|
122
141
|
},
|
|
123
142
|
|
|
143
|
+
customerMessageBlockRoleClass(): string | undefined {
|
|
144
|
+
return roleClassFor(this.viewModel.headingStyle?.textStyleType);
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
// The nested TextWrapper owns the label's size. The container retains the other heading
|
|
148
|
+
// properties so the input follows its surrounding visual treatment without compounding ems.
|
|
149
|
+
customerMessageBlockStyle(): BrandPageCssStyle {
|
|
150
|
+
const roleStyle = roleStyleFor(
|
|
151
|
+
this.viewModel.headingStyle?.textStyleType,
|
|
152
|
+
this.roleOptions as TextStyleOptions | undefined,
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
...roleTypographyStyle(this.viewModel.headingStyle, roleStyle, {
|
|
157
|
+
omit: ['fontSize'],
|
|
158
|
+
}),
|
|
159
|
+
...(this.viewModel.headingStyle?.color
|
|
160
|
+
? { color: this.viewModel.headingStyle.color }
|
|
161
|
+
: {}),
|
|
162
|
+
// The old template bound the whole heading style inline (`:style="headingStyle"`),
|
|
163
|
+
// which let a left/right heading alignment beat the block's static `tw-text-center` —
|
|
164
|
+
// `roleTypographyStyle` doesn't carry alignment, so it's kept here explicitly (S7).
|
|
165
|
+
...(this.viewModel.headingStyle?.textAlign
|
|
166
|
+
? { textAlign: this.viewModel.headingStyle.textAlign }
|
|
167
|
+
: {}),
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
|
|
124
171
|
tippingLabel(): string {
|
|
125
172
|
return paymentTr(`selectAnAmount`, {
|
|
126
173
|
CURRENCY_CODE: this.currencyCodeDisplay,
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import SupportMeMixin from './SupportMe.mixin';
|
|
3
|
+
|
|
4
|
+
const computedFor = (
|
|
5
|
+
name: 'customerMessageBlockStyle' | 'customerMessageBlockRoleClass',
|
|
6
|
+
thisArg: Record<string, unknown>,
|
|
7
|
+
): Record<string, unknown> =>
|
|
8
|
+
(
|
|
9
|
+
SupportMeMixin.computed![name] as unknown as (
|
|
10
|
+
this: unknown,
|
|
11
|
+
) => Record<string, unknown>
|
|
12
|
+
).call(thisArg);
|
|
13
|
+
|
|
14
|
+
// The "Your message" block wraps a label (its own TextWrapper, on the same role) and a
|
|
15
|
+
// TextInput — not a TextWrapper itself, so it carries its typography directly, every property
|
|
16
|
+
// but size: the inner label already owns the role's size, so the block omits fontSize to avoid
|
|
17
|
+
// compounding (3b7015ad).
|
|
18
|
+
describe('SupportMe — customer message block', () => {
|
|
19
|
+
const headingRole = {
|
|
20
|
+
fontFamily: 'Lato',
|
|
21
|
+
fontSize: '1em',
|
|
22
|
+
fontWeight: 'bold',
|
|
23
|
+
lineHeight: '1.2',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const viewModel = {
|
|
27
|
+
headingStyle: {
|
|
28
|
+
textStyleType: 'heading5',
|
|
29
|
+
fontFamily: 'Lato',
|
|
30
|
+
fontSize: '1em',
|
|
31
|
+
fontWeight: 'bold',
|
|
32
|
+
lineHeight: '1.2',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const roleOptions = { heading5: { style: headingRole } };
|
|
37
|
+
|
|
38
|
+
it('carries a role reference for every role-defined property except size', () => {
|
|
39
|
+
expect(
|
|
40
|
+
computedFor('customerMessageBlockStyle', { viewModel, roleOptions }),
|
|
41
|
+
).toEqual({
|
|
42
|
+
fontFamily: 'var(--role-font-family)',
|
|
43
|
+
fontWeight: 'var(--role-font-weight)',
|
|
44
|
+
lineHeight: 'var(--role-line-height)',
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('carries the heading role class', () => {
|
|
49
|
+
expect(
|
|
50
|
+
computedFor('customerMessageBlockRoleClass', { viewModel, roleOptions }),
|
|
51
|
+
).toBe('bp-text-role-heading5');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('an own colour still wins', () => {
|
|
55
|
+
const style = computedFor('customerMessageBlockStyle', {
|
|
56
|
+
viewModel: {
|
|
57
|
+
headingStyle: { ...viewModel.headingStyle, color: '#123456' },
|
|
58
|
+
},
|
|
59
|
+
roleOptions,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
expect(style.color).toBe('#123456');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('with no role in scope, bakes the heading style literally except size', () => {
|
|
66
|
+
expect(
|
|
67
|
+
computedFor('customerMessageBlockStyle', {
|
|
68
|
+
viewModel,
|
|
69
|
+
roleOptions: undefined,
|
|
70
|
+
}),
|
|
71
|
+
).toEqual({
|
|
72
|
+
fontFamily: 'Lato',
|
|
73
|
+
fontWeight: 'bold',
|
|
74
|
+
lineHeight: '1.2',
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// S7 — the old template bound the whole heading style inline (`:style="headingStyle"`), so a
|
|
79
|
+
// left/right heading alignment beat the block's static `tw-text-center` class. Dropped when the
|
|
80
|
+
// block moved to `roleTypographyStyle` (which carries no alignment); restored explicitly.
|
|
81
|
+
it('keeps the heading role text alignment on the block', () => {
|
|
82
|
+
const style = computedFor('customerMessageBlockStyle', {
|
|
83
|
+
viewModel: {
|
|
84
|
+
headingStyle: { ...viewModel.headingStyle, textAlign: 'left' },
|
|
85
|
+
},
|
|
86
|
+
roleOptions,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
expect(style.textAlign).toBe('left');
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('with no alignment of its own, the block carries none (the static class centers it)', () => {
|
|
93
|
+
const style = computedFor('customerMessageBlockStyle', {
|
|
94
|
+
viewModel,
|
|
95
|
+
roleOptions,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
expect(style.textAlign).toBeUndefined();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
/>
|
|
65
65
|
<TextInput
|
|
66
66
|
v-model="customAmount"
|
|
67
|
+
element-classes="tw-font-sans"
|
|
67
68
|
type="number"
|
|
68
69
|
class="tw-mt-3 tw-mb-2"
|
|
69
70
|
:prefix-text="currencySymbol"
|
|
@@ -74,7 +75,8 @@
|
|
|
74
75
|
<div
|
|
75
76
|
v-if="isCustomerMessageFieldVisible"
|
|
76
77
|
class="tw-text-center tw-text-sm tw-mt-4"
|
|
77
|
-
:style="
|
|
78
|
+
:style="customerMessageBlockStyle"
|
|
79
|
+
:class="customerMessageBlockRoleClass"
|
|
78
80
|
>
|
|
79
81
|
<TextWrapper
|
|
80
82
|
:text-style="viewModel.headingStyle"
|
|
@@ -83,6 +85,7 @@
|
|
|
83
85
|
/>
|
|
84
86
|
<TextInput
|
|
85
87
|
v-model="customerMessage"
|
|
88
|
+
element-classes="tw-font-sans"
|
|
86
89
|
class="tw-mt-3 tw-mb-2"
|
|
87
90
|
:placeholder="paymentTr(`yourMessage`)"
|
|
88
91
|
:error="!isCustomerMessageValid"
|
|
@@ -107,7 +110,10 @@ export default {
|
|
|
107
110
|
},
|
|
108
111
|
mixins: [SupportMeMixin],
|
|
109
112
|
setup() {
|
|
113
|
+
// A mixin's own `setup()` is never run by Vue's `mixins:` merge, so `SupportMeMixin`'s
|
|
114
|
+
// (which injects the live role options) is invoked here instead.
|
|
110
115
|
return {
|
|
116
|
+
...SupportMeMixin.setup(),
|
|
111
117
|
paymentTr,
|
|
112
118
|
};
|
|
113
119
|
},
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import SupportMe from './SupportMe.vue';
|
|
5
|
+
import TextWrapper from '../../text-wrapper/TextWrapper.vue';
|
|
6
|
+
import { TEXT_ROLE_OPTIONS_KEY } from '@brand-page/utils/text-role-css.util';
|
|
7
|
+
|
|
8
|
+
// B1 — SupportMe.test.ts calls the mixin's computed directly (`.call(thisArg)`), which never
|
|
9
|
+
// runs SupportMe.vue's own `setup()` (the manual `...SupportMeMixin.setup()` spread a mixin's own
|
|
10
|
+
// setup needs — Vue's `mixins:` merge never runs it). A real mount proves the injection actually
|
|
11
|
+
// wires up, not just the computed's logic in isolation. Kept in its own file for readability, not
|
|
12
|
+
// because combining a bare mixin import with a real mount crashes — Payment.test.ts does both in
|
|
13
|
+
// one file without issue.
|
|
14
|
+
describe('SupportMe customer message block — role wiring (real mount, BP-5969 B1)', () => {
|
|
15
|
+
const headingRole = {
|
|
16
|
+
fontFamily: 'Lato',
|
|
17
|
+
fontSize: '1em',
|
|
18
|
+
fontWeight: 'bold',
|
|
19
|
+
lineHeight: '1.2',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const viewModel = {
|
|
23
|
+
headingStyle: {
|
|
24
|
+
textStyleType: 'heading5',
|
|
25
|
+
fontFamily: 'Lato',
|
|
26
|
+
fontSize: '1em',
|
|
27
|
+
fontWeight: 'bold',
|
|
28
|
+
lineHeight: '1.2',
|
|
29
|
+
},
|
|
30
|
+
buttonStyles: { style: {} },
|
|
31
|
+
buttonTextStyle: { textStyleType: 'button' },
|
|
32
|
+
supportMeConfig: {
|
|
33
|
+
paymentOptions: [],
|
|
34
|
+
isCustomerMessageEnabled: true,
|
|
35
|
+
paymentConfig: {},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const mountSupportMe = () =>
|
|
40
|
+
mount(SupportMe, {
|
|
41
|
+
props: {
|
|
42
|
+
context: { isPreview: true } as any,
|
|
43
|
+
viewModel,
|
|
44
|
+
} as any,
|
|
45
|
+
global: {
|
|
46
|
+
provide: {
|
|
47
|
+
[TEXT_ROLE_OPTIONS_KEY]: computed(() => ({
|
|
48
|
+
heading5: { style: headingRole },
|
|
49
|
+
})),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('the "Your message" label is the only element that applies the role size', () => {
|
|
55
|
+
const wrapper = mountSupportMe();
|
|
56
|
+
const block = wrapper.get(
|
|
57
|
+
'[data-component="support-me"] .tw-mt-4.tw-text-center.tw-text-sm',
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
expect(block.classes()).toContain('bp-text-role-heading5');
|
|
61
|
+
expect(block.attributes('style')).not.toContain('font-size');
|
|
62
|
+
expect(block.getComponent(TextWrapper).props('textStyle')).toEqual(
|
|
63
|
+
viewModel.headingStyle,
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
});
|