@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
|
@@ -12,13 +12,16 @@
|
|
|
12
12
|
<!-- With a button, the nav list scrolls instead of the panel so the button stays put. -->
|
|
13
13
|
<div
|
|
14
14
|
class="c-sidebar"
|
|
15
|
-
:class="
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
:class="[
|
|
16
|
+
navRoleClass,
|
|
17
|
+
{
|
|
18
|
+
'c-sidebar--open': isSideMenuOpen,
|
|
19
|
+
'c-sidebar--closed': !isSideMenuOpen,
|
|
20
|
+
'tw-overflow-auto': isSideMenuOpen && !showHeaderButton,
|
|
21
|
+
'c-sidebar--has-cta': showHeaderButton,
|
|
22
|
+
},
|
|
23
|
+
]"
|
|
24
|
+
:style="sidebarStyle"
|
|
22
25
|
>
|
|
23
26
|
<div class="c-sidebar-header tw-w-full tw-flex tw-justify-end">
|
|
24
27
|
<button
|
|
@@ -120,6 +123,11 @@ export default {
|
|
|
120
123
|
Button,
|
|
121
124
|
},
|
|
122
125
|
mixins: [NavigationSideMenuMixin],
|
|
126
|
+
setup() {
|
|
127
|
+
return {
|
|
128
|
+
...NavigationSideMenuMixin.setup(),
|
|
129
|
+
};
|
|
130
|
+
},
|
|
123
131
|
};
|
|
124
132
|
</script>
|
|
125
133
|
<style scoped>
|
package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { computed } from 'vue';
|
|
2
3
|
import { createRouter, createMemoryHistory } from 'vue-router';
|
|
3
4
|
import { createPinia, setActivePinia } from 'pinia';
|
|
4
5
|
import NavigationSideMenu from './NavigationSideMenu.vue';
|
|
@@ -6,6 +7,7 @@ import {
|
|
|
6
7
|
BRAND_PAGE_TYPES,
|
|
7
8
|
BUTTON_LINK_TYPE,
|
|
8
9
|
MEDIA_SIZES,
|
|
10
|
+
NavigationMobile,
|
|
9
11
|
PageHeaderMobile,
|
|
10
12
|
PageStyles,
|
|
11
13
|
type BrandPageContext,
|
|
@@ -13,6 +15,9 @@ import {
|
|
|
13
15
|
} from '@brand-page/models';
|
|
14
16
|
import type { NavItemViewModel } from '@brand-page/view-models';
|
|
15
17
|
import { mapToPageHeaderViewModel } from '@brand-page/utils';
|
|
18
|
+
import { HEADER_DISPLAY } from '@brand-page/constants';
|
|
19
|
+
import { TEXT_ROLE_OPTIONS_KEY } from '@brand-page/utils/text-role-css.util';
|
|
20
|
+
import TextWrapper from '../../text-wrapper/TextWrapper.vue';
|
|
16
21
|
|
|
17
22
|
const CTA = '[data-test-header-cta-button]';
|
|
18
23
|
const SLUG = 'my-brand';
|
|
@@ -68,6 +73,8 @@ const aHeaderButton = (): HeaderButton => ({
|
|
|
68
73
|
const mountSideMenu = async (options: {
|
|
69
74
|
headerButton?: HeaderButton;
|
|
70
75
|
isPreview?: boolean;
|
|
76
|
+
hamburgerDefaultButtonStyle?: Record<string, unknown>;
|
|
77
|
+
roleOptions?: Record<string, unknown>;
|
|
71
78
|
}) => {
|
|
72
79
|
const router = createRouter({
|
|
73
80
|
history: createMemoryHistory(),
|
|
@@ -83,9 +90,25 @@ const mountSideMenu = async (options: {
|
|
|
83
90
|
router.push(`/${SLUG}`);
|
|
84
91
|
await router.isReady();
|
|
85
92
|
|
|
93
|
+
const styles = new PageStyles();
|
|
94
|
+
|
|
86
95
|
const headerViewModel = mapToPageHeaderViewModel(
|
|
87
|
-
new PageHeaderMobile({
|
|
88
|
-
|
|
96
|
+
new PageHeaderMobile({
|
|
97
|
+
headerButton: options.headerButton,
|
|
98
|
+
// `PageHeaderMobile` only keeps a passed-in `navigation` when `displayStyle` is also
|
|
99
|
+
// given — otherwise its constructor overwrites it with a fresh default.
|
|
100
|
+
...(options.hamburgerDefaultButtonStyle
|
|
101
|
+
? {
|
|
102
|
+
displayStyle: HEADER_DISPLAY.MOBILE_TAB_1,
|
|
103
|
+
navigation: new NavigationMobile({
|
|
104
|
+
hamburgerMenuStyle: {
|
|
105
|
+
defaultButtonStyle: options.hamburgerDefaultButtonStyle,
|
|
106
|
+
},
|
|
107
|
+
}),
|
|
108
|
+
}
|
|
109
|
+
: {}),
|
|
110
|
+
}),
|
|
111
|
+
styles,
|
|
89
112
|
[],
|
|
90
113
|
);
|
|
91
114
|
|
|
@@ -103,7 +126,16 @@ const mountSideMenu = async (options: {
|
|
|
103
126
|
styles: headerViewModel.navigation,
|
|
104
127
|
headerButtonViewModel: headerViewModel.headerButtonViewModel,
|
|
105
128
|
},
|
|
106
|
-
global: {
|
|
129
|
+
global: {
|
|
130
|
+
plugins: [router],
|
|
131
|
+
...(options.roleOptions
|
|
132
|
+
? {
|
|
133
|
+
provide: {
|
|
134
|
+
[TEXT_ROLE_OPTIONS_KEY]: computed(() => options.roleOptions),
|
|
135
|
+
},
|
|
136
|
+
}
|
|
137
|
+
: {}),
|
|
138
|
+
},
|
|
107
139
|
});
|
|
108
140
|
};
|
|
109
141
|
|
|
@@ -179,3 +211,101 @@ describe('NavigationSideMenu - header call-to-action button (BP-5852)', () => {
|
|
|
179
211
|
expect(wrapper.emitted('close-side-menu')).toBeUndefined();
|
|
180
212
|
});
|
|
181
213
|
});
|
|
214
|
+
|
|
215
|
+
const PARAGRAPH1_ROLE = { fontFamily: 'Anton', fontSize: '1em' };
|
|
216
|
+
const BUTTON_ROLE = {
|
|
217
|
+
fontFamily: 'Oswald',
|
|
218
|
+
fontSize: '1.25em',
|
|
219
|
+
fontWeight: 'bold',
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
describe('NavigationSideMenu — hamburger typography references its role (BP-5969 R4)', () => {
|
|
223
|
+
beforeEach(() => {
|
|
224
|
+
setActivePinia(createPinia());
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
test('the panel keeps the hamburger role class without applying its font size', async () => {
|
|
228
|
+
const wrapper = await mountSideMenu({
|
|
229
|
+
hamburgerDefaultButtonStyle: { textStyleType: 'button' },
|
|
230
|
+
roleOptions: {
|
|
231
|
+
button: { style: BUTTON_ROLE },
|
|
232
|
+
paragraph1: { style: PARAGRAPH1_ROLE },
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
expect(wrapper.get('.c-sidebar').classes()).toContain(
|
|
237
|
+
'bp-text-role-button',
|
|
238
|
+
);
|
|
239
|
+
expect(wrapper.get('.c-sidebar').attributes('style')).not.toContain(
|
|
240
|
+
'font-size',
|
|
241
|
+
);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
test('a nav item references the role for every role-defined property', async () => {
|
|
245
|
+
const wrapper = await mountSideMenu({
|
|
246
|
+
hamburgerDefaultButtonStyle: { textStyleType: 'button' },
|
|
247
|
+
roleOptions: { button: { style: BUTTON_ROLE } },
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const link = wrapper.get('.c-nav-list a');
|
|
251
|
+
|
|
252
|
+
expect(link.attributes('style')).toContain(
|
|
253
|
+
'font-family: var(--role-font-family)',
|
|
254
|
+
);
|
|
255
|
+
expect(link.attributes('style')).toContain(
|
|
256
|
+
'font-weight: var(--role-font-weight)',
|
|
257
|
+
);
|
|
258
|
+
expect(link.attributes('style')).toContain(
|
|
259
|
+
'font-size: var(--role-font-size)',
|
|
260
|
+
);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
test('the CTA label applies its Button text size without inheriting one from the panel', async () => {
|
|
264
|
+
const wrapper = await mountSideMenu({
|
|
265
|
+
headerButton: {
|
|
266
|
+
...aHeaderButton(),
|
|
267
|
+
buttonTextStyle: { textStyleType: 'button' },
|
|
268
|
+
},
|
|
269
|
+
hamburgerDefaultButtonStyle: { textStyleType: 'button' },
|
|
270
|
+
roleOptions: { button: { style: BUTTON_ROLE } },
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
const sidebar = wrapper.get('.c-sidebar');
|
|
274
|
+
const label = wrapper
|
|
275
|
+
.get('[data-component="navigation-side-menu-cta"]')
|
|
276
|
+
.getComponent(TextWrapper);
|
|
277
|
+
|
|
278
|
+
expect(sidebar.attributes('style')).not.toContain('font-size');
|
|
279
|
+
expect(label.get('p').attributes('style')).toContain(
|
|
280
|
+
'font-size: var(--role-font-size)',
|
|
281
|
+
);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
test('the close button still bakes fontSize/lineHeight as initial', async () => {
|
|
285
|
+
const wrapper = await mountSideMenu({
|
|
286
|
+
hamburgerDefaultButtonStyle: { textStyleType: 'button' },
|
|
287
|
+
roleOptions: { button: { style: BUTTON_ROLE } },
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
const closeButton = wrapper.get('.c-sidebar-header button');
|
|
291
|
+
|
|
292
|
+
expect(closeButton.attributes('style')).toContain('font-size: initial');
|
|
293
|
+
expect(closeButton.attributes('style')).toContain('line-height: initial');
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
test('the panel wrapper style still drops size, line height and letter-spacing', async () => {
|
|
297
|
+
const wrapper = await mountSideMenu({
|
|
298
|
+
hamburgerDefaultButtonStyle: {
|
|
299
|
+
textStyleType: 'button',
|
|
300
|
+
fontSize: '1.25em',
|
|
301
|
+
},
|
|
302
|
+
roleOptions: { button: { style: BUTTON_ROLE } },
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
const wrapperRow = wrapper.get('.c-nav-list > div');
|
|
306
|
+
|
|
307
|
+
expect(wrapperRow.attributes('style')).not.toContain('font-size');
|
|
308
|
+
expect(wrapperRow.attributes('style')).not.toContain('line-height');
|
|
309
|
+
expect(wrapperRow.attributes('style')).not.toContain('letter-spacing');
|
|
310
|
+
});
|
|
311
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import { defineComponent } from 'vue';
|
|
2
|
+
import { computed, defineComponent } from 'vue';
|
|
3
3
|
import type {
|
|
4
4
|
BrandPageViewModel,
|
|
5
5
|
ButtonViewModel,
|
|
@@ -20,8 +20,11 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
getSlugFromContext,
|
|
22
22
|
getPageHeadingText,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
buildPaletteRootCssText,
|
|
24
|
+
buildPaletteScopedCssText,
|
|
25
|
+
buildTextRoleRootCssText,
|
|
26
|
+
buildTextRoleScopedCssText,
|
|
27
|
+
TEXT_ROLE_OPTIONS_KEY,
|
|
25
28
|
PAGE_SCOPE_ID_ATTRIBUTE,
|
|
26
29
|
resolveColorReference,
|
|
27
30
|
} from '@brand-page/utils';
|
|
@@ -103,6 +106,17 @@ export default defineComponent({
|
|
|
103
106
|
}),
|
|
104
107
|
};
|
|
105
108
|
},
|
|
109
|
+
// BP-5969: expose the live role options to every descendant TextWrapper so it can
|
|
110
|
+
// inline only its overrides and leave the role typography to the CSS class. A computed
|
|
111
|
+
// keeps it reactive (a role edit repaints), and `this` is the instance in Options-API
|
|
112
|
+
// provide(). Descendants that render outside a Page get `undefined` and bake inline.
|
|
113
|
+
provide() {
|
|
114
|
+
return {
|
|
115
|
+
[TEXT_ROLE_OPTIONS_KEY as symbol]: computed(
|
|
116
|
+
() => this.viewModel?.styles?.textStyles?.textStyleOptions,
|
|
117
|
+
),
|
|
118
|
+
};
|
|
119
|
+
},
|
|
106
120
|
data() {
|
|
107
121
|
return {
|
|
108
122
|
isSideMenuOpen: false,
|
|
@@ -115,18 +129,24 @@ export default defineComponent({
|
|
|
115
129
|
return this.viewModel?.brandPageToken || null;
|
|
116
130
|
},
|
|
117
131
|
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
// standalone emits `:root` (SSR'd, and it must reach teleported content);
|
|
122
|
-
// template cards emit a per-instance scoped block because a grid holds many
|
|
123
|
-
// palettes in one document and they all share the fixed `--palette-N` names.
|
|
124
|
-
paletteStyleHtml(): string {
|
|
132
|
+
// Page.vue owns the native style node; this computed supplies CSS text only so hydration
|
|
133
|
+
// updates its contents without replacing the SSR-emitted element.
|
|
134
|
+
paletteCss(): string {
|
|
125
135
|
const colors = this.viewModel?.styles?.colors ?? [];
|
|
126
136
|
|
|
127
137
|
return this.context?.isTemplate
|
|
128
|
-
?
|
|
129
|
-
:
|
|
138
|
+
? buildPaletteScopedCssText(colors, this.pageScopeId)
|
|
139
|
+
: buildPaletteRootCssText(colors);
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
textRoleCss(): string {
|
|
143
|
+
const options = this.viewModel?.styles?.textStyles?.textStyleOptions;
|
|
144
|
+
|
|
145
|
+
if (!options) return '';
|
|
146
|
+
|
|
147
|
+
return this.context?.isTemplate
|
|
148
|
+
? buildTextRoleScopedCssText(options, this.pageScopeId)
|
|
149
|
+
: buildTextRoleRootCssText(options);
|
|
130
150
|
},
|
|
131
151
|
|
|
132
152
|
// Spread onto EVERY top-level node of Page's fragment (template mode only).
|
|
@@ -208,28 +228,15 @@ export default defineComponent({
|
|
|
208
228
|
};
|
|
209
229
|
}
|
|
210
230
|
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const textFontFamilyKey =
|
|
222
|
-
this.viewModel.styles?.textStyles.textFontFamily ||
|
|
223
|
-
DEFAULT_FONT_FAMILY_KEY;
|
|
224
|
-
|
|
225
|
-
const textFontFamilyConfig = FONT_FAMILY_CONFIGS[textFontFamilyKey];
|
|
226
|
-
|
|
227
|
-
if (textFontFamilyConfig) {
|
|
228
|
-
styles.fontFamily = [
|
|
229
|
-
`"${textFontFamilyConfig.name}"`,
|
|
230
|
-
...FALLBACK_FONT_FAMILIES,
|
|
231
|
-
].join(', ');
|
|
232
|
-
}
|
|
231
|
+
// BP-5969 (ADR-0020): no page base coat. A role defines typography only, so `:root`
|
|
232
|
+
// no longer paints a text colour — every text element carries its own contrast-derived
|
|
233
|
+
// colour (baked at birth, or by migration-22 for existing sites). Form controls and SVG
|
|
234
|
+
// `currentColor` fills fall back to the browser default.
|
|
235
|
+
// Text with no font of its own is Lato on every site (`0036-retire-text-font-family.md`).
|
|
236
|
+
styles.fontFamily = [
|
|
237
|
+
`"${FONT_FAMILY_CONFIGS[DEFAULT_FONT_FAMILY_KEY].name}"`,
|
|
238
|
+
...FALLBACK_FONT_FAMILIES,
|
|
239
|
+
].join(', ');
|
|
233
240
|
|
|
234
241
|
return styles;
|
|
235
242
|
},
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!--
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
v-if="
|
|
2
|
+
<!-- Native style nodes are emitted by SSR before page content and are retained while Vue
|
|
3
|
+
hydrates. `innerHTML` preserves CSS syntax rather than SSR-escaping it. -->
|
|
4
|
+
<component
|
|
5
|
+
:is="'style'"
|
|
6
|
+
v-if="paletteCss"
|
|
7
7
|
data-component="page-palette-style"
|
|
8
|
-
|
|
8
|
+
:data-palette-root="context.isTemplate ? undefined : ''"
|
|
9
|
+
:data-palette-scoped="context.isTemplate ? '' : undefined"
|
|
10
|
+
v-bind="{ innerHTML: paletteCss }"
|
|
11
|
+
/>
|
|
12
|
+
<component
|
|
13
|
+
:is="'style'"
|
|
14
|
+
v-if="textRoleCss"
|
|
15
|
+
data-component="page-text-role-style"
|
|
16
|
+
:data-text-roles="context.isTemplate ? undefined : ''"
|
|
17
|
+
:data-text-roles-scoped="context.isTemplate ? '' : undefined"
|
|
18
|
+
v-bind="{ innerHTML: textRoleCss }"
|
|
9
19
|
/>
|
|
10
20
|
<div
|
|
11
21
|
v-if="!viewModel.styles?.backgroundStylesViewModel?.mediaViewModel"
|
|
@@ -272,6 +282,7 @@
|
|
|
272
282
|
:context="context"
|
|
273
283
|
:button-styles="viewModel.styles?.buttonStyles"
|
|
274
284
|
:text-styles="viewModel.styles?.textStyles"
|
|
285
|
+
:button-text-style="viewModel.saveContactSettings?.buttonTextStyle"
|
|
275
286
|
:is-premium="isPremiumSubscription"
|
|
276
287
|
:show-popup-branding="shouldShowPopupBranding"
|
|
277
288
|
@editor-click="onSaveContactWidgetClick"
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { vi } from 'vitest';
|
|
2
2
|
import { shallowMount } from '@vue/test-utils';
|
|
3
|
+
import { createSSRApp } from 'vue';
|
|
4
|
+
import { renderToString } from '@vue/server-renderer';
|
|
3
5
|
import { createPinia, setActivePinia } from 'pinia';
|
|
4
6
|
import Page from './Page.vue';
|
|
5
7
|
import {
|
|
6
8
|
BRAND_PAGE_TYPES,
|
|
7
9
|
MEDIA_SIZES,
|
|
10
|
+
TextStyles,
|
|
8
11
|
VIEWPORTS,
|
|
9
12
|
type BrandPageContext,
|
|
10
13
|
} from '@brand-page/models';
|
|
@@ -51,7 +54,7 @@ const createViewModel = (
|
|
|
51
54
|
({
|
|
52
55
|
showBrandCrowdLogo: false,
|
|
53
56
|
styles: {
|
|
54
|
-
textStyles: { style: {}
|
|
57
|
+
textStyles: { style: {} },
|
|
55
58
|
backgroundStylesViewModel: {},
|
|
56
59
|
},
|
|
57
60
|
pages,
|
|
@@ -177,6 +180,16 @@ describe('Page palette emission (BP-5886)', () => {
|
|
|
177
180
|
[createNavItem()],
|
|
178
181
|
);
|
|
179
182
|
|
|
183
|
+
const withTextRoles = (viewModel: BrandPageViewModel): BrandPageViewModel => {
|
|
184
|
+
(viewModel.styles as any).textStyles = {
|
|
185
|
+
textStyleOptions: JSON.parse(
|
|
186
|
+
JSON.stringify(TextStyles.GetDefaultTextStyle().textStyleOptions),
|
|
187
|
+
),
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
return viewModel;
|
|
191
|
+
};
|
|
192
|
+
|
|
180
193
|
// One neutral wrapper name for both modes — the mode markers live on the
|
|
181
194
|
// <style> tag itself (data-palette-root vs data-palette-scoped).
|
|
182
195
|
const paletteBlock = (context: BrandPageContext, viewModel = withColors()) =>
|
|
@@ -283,6 +296,52 @@ describe('Page palette emission (BP-5886)', () => {
|
|
|
283
296
|
false,
|
|
284
297
|
);
|
|
285
298
|
});
|
|
299
|
+
|
|
300
|
+
test('keeps palette and role CSS in native style nodes while their text updates', async () => {
|
|
301
|
+
const viewModel = withTextRoles(withColors());
|
|
302
|
+
const wrapper = mountPage(viewModel, createContext());
|
|
303
|
+
const paletteNode = wrapper.get(
|
|
304
|
+
'[data-component="page-palette-style"]',
|
|
305
|
+
).element;
|
|
306
|
+
const roleNode = wrapper.get(
|
|
307
|
+
'[data-component="page-text-role-style"]',
|
|
308
|
+
).element;
|
|
309
|
+
const next = JSON.parse(JSON.stringify(viewModel));
|
|
310
|
+
|
|
311
|
+
next.styles.colors[0].value = '#123456';
|
|
312
|
+
next.styles.textStyles.textStyleOptions.heading1.style.fontFamily =
|
|
313
|
+
'Montserrat';
|
|
314
|
+
await wrapper.setProps({ viewModel: next });
|
|
315
|
+
|
|
316
|
+
expect(paletteNode.tagName).toBe('STYLE');
|
|
317
|
+
expect(roleNode.tagName).toBe('STYLE');
|
|
318
|
+
expect(wrapper.get('[data-component="page-palette-style"]').element).toBe(
|
|
319
|
+
paletteNode,
|
|
320
|
+
);
|
|
321
|
+
expect(wrapper.get('[data-component="page-text-role-style"]').element).toBe(
|
|
322
|
+
roleNode,
|
|
323
|
+
);
|
|
324
|
+
expect(paletteNode.textContent).toContain('--palette-0: #123456;');
|
|
325
|
+
expect(roleNode.textContent).toContain('--role-font-family: Montserrat;');
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
test('SSR emits quoted role font CSS without HTML escaping', async () => {
|
|
329
|
+
const viewModel = withTextRoles(createViewModel([], [createNavItem()]));
|
|
330
|
+
|
|
331
|
+
viewModel.styles.textStyles.textStyleOptions.heading1.style.fontFamily =
|
|
332
|
+
'Exo 2';
|
|
333
|
+
|
|
334
|
+
const html = await renderToString(
|
|
335
|
+
createSSRApp(Page, {
|
|
336
|
+
viewModel,
|
|
337
|
+
context: createContext({ isTemplate: true }),
|
|
338
|
+
viewport: VIEWPORTS.desktop,
|
|
339
|
+
}),
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
expect(html).toContain('--role-font-family: "Exo 2";');
|
|
343
|
+
expect(html).not.toContain('"Exo 2"');
|
|
344
|
+
});
|
|
286
345
|
});
|
|
287
346
|
|
|
288
347
|
/**
|
|
@@ -357,3 +416,34 @@ describe('Page background shape colour resolution (BP-5886)', () => {
|
|
|
357
416
|
]);
|
|
358
417
|
});
|
|
359
418
|
});
|
|
419
|
+
|
|
420
|
+
describe('Page root font (0036-retire-text-font-family.md)', () => {
|
|
421
|
+
beforeEach(() => {
|
|
422
|
+
setActivePinia(createPinia());
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
const LATO_ROOT_FONT = '"Lato", Helvetica, sans-serif';
|
|
426
|
+
|
|
427
|
+
const rootFontFamily = (viewModel: BrandPageViewModel): string | undefined =>
|
|
428
|
+
(
|
|
429
|
+
mountPage(viewModel, createContext()).vm as unknown as {
|
|
430
|
+
rootElementStyles: { fontFamily?: string };
|
|
431
|
+
}
|
|
432
|
+
).rootElementStyles.fontFamily;
|
|
433
|
+
|
|
434
|
+
test('text with no font of its own renders in Lato', () => {
|
|
435
|
+
expect(rootFontFamily(createViewModel([], [createNavItem()]))).toBe(
|
|
436
|
+
LATO_ROOT_FONT,
|
|
437
|
+
);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
test('a stale stored site text font does not change the root font', () => {
|
|
441
|
+
const viewModel = createViewModel([], [createNavItem()]);
|
|
442
|
+
|
|
443
|
+
(viewModel.styles.textStyles as unknown as Record<string, unknown>)[
|
|
444
|
+
'textFontFamily'
|
|
445
|
+
] = 'quattrocentoSans';
|
|
446
|
+
|
|
447
|
+
expect(rootFontFamily(viewModel)).toBe(LATO_ROOT_FONT);
|
|
448
|
+
});
|
|
449
|
+
});
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
1
|
+
import { defineComponent, inject } from 'vue';
|
|
2
2
|
import type { PageFooterViewModel } from '@brand-page/view-models';
|
|
3
3
|
import type { PropType } from 'vue';
|
|
4
|
-
import type { BrandPageContext } from '@brand-page/models';
|
|
4
|
+
import type { BrandPageContext, TextStyleOptions } from '@brand-page/models';
|
|
5
5
|
import { getRenderText } from '@brand-page/utils';
|
|
6
6
|
import { FOOTER_DISPLAY } from '../../constants';
|
|
7
|
+
import {
|
|
8
|
+
TEXT_ROLE_OPTIONS_KEY,
|
|
9
|
+
roleTypographyStyle,
|
|
10
|
+
roleClassFor,
|
|
11
|
+
roleStyleFor,
|
|
12
|
+
} from '../../utils/text-role-css.util';
|
|
7
13
|
|
|
8
14
|
export default defineComponent({
|
|
9
15
|
props: {
|
|
@@ -26,6 +32,15 @@ export default defineComponent({
|
|
|
26
32
|
},
|
|
27
33
|
},
|
|
28
34
|
emits: ['on-logo-click', 'footer-container-click'],
|
|
35
|
+
// A mixin's own `setup()` is never run by Vue's `mixins:` merge — `PageFooter.vue` invokes
|
|
36
|
+
// this one itself and spreads its return into its own `setup()`.
|
|
37
|
+
setup() {
|
|
38
|
+
const roleOptions = inject(TEXT_ROLE_OPTIONS_KEY, undefined);
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
roleOptions,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
29
44
|
computed: {
|
|
30
45
|
containerStyle(): BrandPageCssStyle {
|
|
31
46
|
return this.viewModel.backgroundStyle;
|
|
@@ -46,6 +61,21 @@ export default defineComponent({
|
|
|
46
61
|
|
|
47
62
|
return getRenderText(this.viewModel.copyrightText);
|
|
48
63
|
},
|
|
64
|
+
copyrightRoleType(): string | undefined {
|
|
65
|
+
return this.viewModel.copyrightStyle?.textStyleType;
|
|
66
|
+
},
|
|
67
|
+
copyrightRoleClass(): string | undefined {
|
|
68
|
+
return roleClassFor(this.copyrightRoleType);
|
|
69
|
+
},
|
|
70
|
+
copyrightStyle(): BrandPageCssStyle {
|
|
71
|
+
const own = this.viewModel.copyrightStyle;
|
|
72
|
+
const roleStyle = roleStyleFor(
|
|
73
|
+
this.copyrightRoleType,
|
|
74
|
+
this.roleOptions as TextStyleOptions | undefined,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return { ...own, ...roleTypographyStyle(own, roleStyle) };
|
|
78
|
+
},
|
|
49
79
|
},
|
|
50
80
|
methods: {
|
|
51
81
|
onFooterContainerClick() {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
import PageFooter from './PageFooter.vue';
|
|
5
|
+
import { PageFooterDesktop, PageStyles } from '@brand-page/models';
|
|
6
|
+
import type { BrandPageContext } from '@brand-page/models';
|
|
7
|
+
import { mapToPageFooterViewModel } from '@brand-page/utils';
|
|
8
|
+
import { TEXT_ROLE_OPTIONS_KEY } from '@brand-page/utils/text-role-css.util';
|
|
9
|
+
|
|
10
|
+
const PARAGRAPH1_ROLE = { fontFamily: 'Anton', fontSize: '1em' };
|
|
11
|
+
|
|
12
|
+
const mountFooter = (options: {
|
|
13
|
+
copyrightStyle?: Record<string, unknown>;
|
|
14
|
+
withRole?: boolean;
|
|
15
|
+
}) => {
|
|
16
|
+
const pageFooter = new PageFooterDesktop({
|
|
17
|
+
copyrightText: '© Acme',
|
|
18
|
+
copyrightStyle: options.copyrightStyle ?? { textStyleType: 'paragraph1' },
|
|
19
|
+
} as never);
|
|
20
|
+
|
|
21
|
+
const viewModel = mapToPageFooterViewModel(pageFooter, new PageStyles());
|
|
22
|
+
|
|
23
|
+
return mount(PageFooter, {
|
|
24
|
+
props: {
|
|
25
|
+
viewModel,
|
|
26
|
+
context: {} as BrandPageContext,
|
|
27
|
+
showBrandCrowdLogo: false,
|
|
28
|
+
},
|
|
29
|
+
global: {
|
|
30
|
+
stubs: { Logo: true, SocialLinksItems: true, BrandPageFooter: true },
|
|
31
|
+
provide:
|
|
32
|
+
options.withRole === false
|
|
33
|
+
? {}
|
|
34
|
+
: {
|
|
35
|
+
[TEXT_ROLE_OPTIONS_KEY]: computed(() => ({
|
|
36
|
+
paragraph1: { style: PARAGRAPH1_ROLE },
|
|
37
|
+
})),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const copyrightEl = (wrapper: ReturnType<typeof mountFooter>) =>
|
|
44
|
+
wrapper.get('.tw-break-all');
|
|
45
|
+
|
|
46
|
+
describe('PageFooter — the footer copyright references its role (BP-5969 R4)', () => {
|
|
47
|
+
test('the copyright carries the role class', () => {
|
|
48
|
+
const wrapper = mountFooter({});
|
|
49
|
+
|
|
50
|
+
expect(copyrightEl(wrapper).classes()).toContain('bp-text-role-paragraph1');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('the copyright references the role for every role-defined property', () => {
|
|
54
|
+
const wrapper = mountFooter({});
|
|
55
|
+
|
|
56
|
+
const style = copyrightEl(wrapper).attributes('style');
|
|
57
|
+
|
|
58
|
+
expect(style).toContain('font-family: var(--role-font-family)');
|
|
59
|
+
expect(style).toContain('font-size: var(--role-font-size)');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('an own override on the copyright is a literal, not a ref', () => {
|
|
63
|
+
const wrapper = mountFooter({
|
|
64
|
+
copyrightStyle: { textStyleType: 'paragraph1', fontFamily: 'Oswald' },
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
expect(copyrightEl(wrapper).attributes('style')).toContain(
|
|
68
|
+
'font-family: Oswald',
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('with no role in scope, the copyright bakes its own values literally', () => {
|
|
73
|
+
const wrapper = mountFooter({ withRole: false });
|
|
74
|
+
|
|
75
|
+
expect(copyrightEl(wrapper).attributes('style')).not.toContain(
|
|
76
|
+
'var(--role-',
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -29,11 +29,14 @@
|
|
|
29
29
|
|
|
30
30
|
<!-- start copyright -->
|
|
31
31
|
<div
|
|
32
|
-
:style="
|
|
32
|
+
:style="copyrightStyle"
|
|
33
33
|
class="tw-break-all"
|
|
34
|
-
:class="
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
:class="[
|
|
35
|
+
copyrightRoleClass,
|
|
36
|
+
{
|
|
37
|
+
'tw-pt-4': !viewModel.logo.isVisible && !isDisplayStyleJustified,
|
|
38
|
+
},
|
|
39
|
+
]"
|
|
37
40
|
v-html="renderText"
|
|
38
41
|
/>
|
|
39
42
|
<!-- end copyright -->
|
|
@@ -67,6 +70,11 @@ import BrandPageFooter from '../brand-page-footer/BrandPageFooter.vue';
|
|
|
67
70
|
export default {
|
|
68
71
|
components: { BrandPageFooter, SocialLinksItems, Logo },
|
|
69
72
|
mixins: [PageFooterMixin],
|
|
73
|
+
setup() {
|
|
74
|
+
return {
|
|
75
|
+
...PageFooterMixin.setup(),
|
|
76
|
+
};
|
|
77
|
+
},
|
|
70
78
|
};
|
|
71
79
|
</script>
|
|
72
80
|
<style scoped>
|