@designcrowd/library.brand-page 6.2.11 → 6.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-DDcraD5S.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DtOeaisf.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BZpmJPew.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CqRwC4e7.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CqRwC4e7.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DId9Dfjh.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DId9Dfjh.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BTDfmOcm.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CeAu9Ayx.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-WCv0K41H.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BlfevQDY.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-Cvt7MHPZ.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DipZuylv.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BCw4lcKN.js → CreatedOnDcom-pt-pt-Cf6u2GCg.js} +1 -1
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.d.ts +16 -0
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.js +35 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +3 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +19 -13
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +3 -1
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +17 -2
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.d.ts +11 -3
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.js +35 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +8 -2
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +27 -3
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/page/Page.mixin.js +33 -27
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.d.ts +7 -2
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.js +21 -1
- package/lib/src/brand-page/components/payment/Payment.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/payment/Payment.mixin.js +22 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +6 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +32 -1
- package/lib/src/brand-page/components/social-links/SocialLinks.stories.js +0 -3
- package/lib/src/brand-page/components/testimonial-section/__fixtures__/data.js +0 -3
- package/lib/src/brand-page/components/text/Text.stories.js +0 -17
- package/lib/src/brand-page/constants/font.constants.d.ts +62 -0
- package/lib/src/brand-page/constants/font.constants.js +35 -0
- package/lib/src/brand-page/models/index.d.ts +23 -24
- package/lib/src/brand-page/models/index.js +20 -7
- package/lib/src/brand-page/models/navigation-styles.model.d.ts +1 -1
- package/lib/src/brand-page/models/navigation-styles.model.js +17 -8
- package/lib/src/brand-page/models/payment.model.d.ts +11 -6
- package/lib/src/brand-page/models/styles.model.d.ts +53 -7
- package/lib/src/brand-page/models/styles.model.js +115 -27
- package/lib/src/brand-page/utils/color-palette.util.d.ts +43 -23
- package/lib/src/brand-page/utils/color-palette.util.js +65 -27
- package/lib/src/brand-page/utils/color.util.d.ts +13 -9
- package/lib/src/brand-page/utils/color.util.js +56 -15
- package/lib/src/brand-page/utils/container-text-color.util.d.ts +46 -13
- package/lib/src/brand-page/utils/container-text-color.util.js +321 -41
- package/lib/src/brand-page/utils/index.d.ts +1 -0
- package/lib/src/brand-page/utils/index.js +1 -0
- package/lib/src/brand-page/utils/migration/migration-20.js +6 -2
- package/lib/src/brand-page/utils/migration/migration-21.js +34 -6
- package/lib/src/brand-page/utils/migration/migration-22.d.ts +99 -0
- package/lib/src/brand-page/utils/migration/migration-22.js +909 -0
- package/lib/src/brand-page/utils/migration.util.js +17 -0
- package/lib/src/brand-page/utils/model.util.d.ts +4 -0
- package/lib/src/brand-page/utils/model.util.js +4 -0
- package/lib/src/brand-page/utils/personalisation.util.js +9 -1
- package/lib/src/brand-page/utils/rte-role-lift.util.d.ts +72 -0
- package/lib/src/brand-page/utils/rte-role-lift.util.js +275 -0
- package/lib/src/brand-page/utils/style.util.d.ts +5 -1
- package/lib/src/brand-page/utils/style.util.js +34 -11
- package/lib/src/brand-page/utils/text-role-css.util.d.ts +19 -0
- package/lib/src/brand-page/utils/text-role-css.util.js +186 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.d.ts +90 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.js +434 -0
- package/lib/src/brand-page/utils/text-style.util.d.ts +53 -23
- package/lib/src/brand-page/utils/text-style.util.js +122 -22
- package/lib/src/brand-page/utils/view-model.util.d.ts +9 -1
- package/lib/src/brand-page/utils/view-model.util.js +124 -111
- package/lib/src/brand-page/view-models.d.ts +1 -0
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +13 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +4 -4
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -10
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.js +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +23 -138
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -28
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +5 -2
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +1 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.d.ts +16 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.js +61 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.d.ts +11 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.js +236 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.js +25 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.d.ts +17 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.js +204 -17
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +29 -31
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.d.ts +20 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.js +60 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.js +22 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +10 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +319 -275
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -5
- package/lib/src/brand-page-maker/convertors/text-css-style-options.convertor.js +6 -2
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.d.ts +1 -1
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
- package/lib/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.js +7 -14
- package/lib/src/brand-page-maker/default-getters/text-color.default-getter.js +6 -13
- package/lib/src/brand-page-maker/models/content-settings.d.ts +8 -0
- package/lib/src/brand-page-maker/models/content-settings.js +112 -81
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.d.ts +2 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.js +5 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.js +4 -3
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1257 -117
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +6 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +17 -9
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +59 -5
- package/lib/src/brand-page-maker/stores/history/history-store.js +22 -2
- package/lib/src/brand-page-maker/utils/apply-color-strategy.js +26 -8
- package/lib/src/brand-page-maker/utils/index.d.ts +2 -1
- package/lib/src/brand-page-maker/utils/index.js +2 -1
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +117 -15
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +435 -281
- package/lib/src/brand-page-maker/utils/rte-authoring.util.d.ts +4 -0
- package/lib/src/brand-page-maker/utils/rte-authoring.util.js +101 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.d.ts +126 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.js +307 -0
- package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +13 -3
- package/lib/src/{bundled-translations-zfiA5Tsw.js → bundled-translations-yGrvPE5i.js} +17 -17
- package/lib/src/{bundled-translations.de-DE-ChsdSyAP.js → bundled-translations.de-DE-L4Znf8Hs.js} +17 -17
- package/lib/src/{bundled-translations.es-ES-DflsWQK0.js → bundled-translations.es-ES-D6iticrK.js} +15 -15
- package/lib/src/{bundled-translations.fr-CA-fpDRuZ52.js → bundled-translations.fr-CA-BgAVE-9k.js} +25 -25
- package/lib/src/{bundled-translations.fr-FR-Bub73Zt-.js → bundled-translations.fr-FR-B8GbyqxQ.js} +17 -17
- package/lib/src/{bundled-translations.pt-BR-BlnWE9TB.js → bundled-translations.pt-BR-DjPU3Db7.js} +25 -25
- package/lib/src/{bundled-translations.pt-PT-DmzXlnaS.js → bundled-translations.pt-PT-BaepaDpr.js} +23 -23
- package/lib/src/bundles/bundled-translations.de-DE.json +21 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/lib/src/bundles/bundled-translations.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/lib/src/clients/ai-assistant-client.d.ts +1 -0
- package/lib/src/composables/useTranslate.d.ts +1 -1
- package/lib/src/composables/useTranslate.js +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +303 -207
- package/lib/src/css/library.brand-page-brandPage.min.css +303 -207
- package/lib/src/css/library.brand-page-designCom.min.css +303 -207
- package/lib/src/css/library.brand-page-preview.min.css +303 -207
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.mjs +195 -191
- package/lib/src/{lib-1AqtEmvQ.js → lib-kGRlD3_P.js} +36855 -33893
- package/lib/src/lib.js +2 -1
- package/lib/src/metadata-builder/builders/footer-builder.js +4 -5
- package/lib/src/metadata-builder/builders/global-role-propagation.d.ts +58 -0
- package/lib/src/metadata-builder/builders/global-role-propagation.js +246 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +1 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.js +116 -45
- package/lib/src/metadata-builder/builders/header-builder.js +13 -4
- package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +8 -2
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +60 -29
- package/lib/src/metadata-builder/builders/section-field-maps.js +1 -0
- package/lib/src/metadata-builder/builders/section-field-utils.d.ts +48 -19
- package/lib/src/metadata-builder/builders/section-field-utils.js +128 -52
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +4 -2
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +28 -12
- package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +5 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +1 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.js +97 -40
- package/lib/src/metadata-builder/metadata-executor.js +23 -1
- package/lib/src/metadata-builder/models.d.ts +2 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +18 -19
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +18 -1
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +1 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +0 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +5 -8
- package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +7 -16
- package/lib/src/metadata-builder/sanitizers/section-args-validator.js +95 -22
- package/lib/src/shared/color-palette/section-color-matches.js +9 -25
- package/lib/src/shared/color-strategies/color-strategies.d.ts +15 -0
- package/lib/src/shared/color-strategies/color-strategies.js +31 -0
- package/lib/src/shared/color-strategies/rte-color.d.ts +8 -0
- package/lib/src/shared/color-strategies/rte-color.js +16 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +23 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.js +28 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +9 -135
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -27
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +12 -2
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +7 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +75 -6
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +18 -7
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +6 -1
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -7
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +8 -4
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1255 -26
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +203 -59
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +6 -0
- package/lib/src/shared/content-settings/store/content-settings-store.js +105 -8
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +5 -1
- package/lib/src/shared/navigation-style-settings/store/index.d.ts +7 -3
- package/lib/src/shared/navigation-style-settings/store/index.js +40 -15
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +17 -5
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +70 -13
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +10 -2
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -1
- package/lib/src/shared/page-settings/store/page-settings-store.js +17 -0
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +4 -1
- package/lib/src/shared/rte-extensions/AutoLink.d.ts +17 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.js +67 -51
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.js +4 -1
- package/lib/src/shared/rte-extensions/TextEffects.d.ts +28 -0
- package/lib/src/shared/rte-extensions/TextEffects.js +96 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.d.ts +2 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.js +21 -0
- package/lib/src/shared/rte-extensions.util.d.ts +25 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.js → shared/rte-extensions.util.js} +62 -7
- package/lib/src/shared/rte-link.util.d.ts +1 -0
- package/lib/src/shared/rte-link.util.js +1 -0
- package/lib/src/shared/rte-render.util.d.ts +112 -0
- package/lib/src/shared/rte-render.util.js +255 -0
- package/lib/src/shared/rte-shape.util.d.ts +6 -0
- package/lib/src/shared/rte-shape.util.js +18 -0
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +2 -1
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
- package/lib/src/shared/side-bar/store/side-bar-store.d.ts +2 -0
- package/lib/src/shared/side-bar/store/side-bar-store.js +9 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +155 -15
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +7 -1
- package/lib/src/shared/style-settings/store/style-settings-store.d.ts +1 -9
- package/lib/src/shared/style-settings/store/style-settings-store.js +3 -33
- package/lib/src/shared/style-settings/text-style-size-order.d.ts +2 -0
- package/lib/src/shared/style-settings/text-style-size-order.js +13 -0
- package/lib/src/shared/text-role-typography.util.d.ts +64 -0
- package/lib/src/shared/text-role-typography.util.js +183 -0
- package/lib/src/utils/minify-brand-page-metadata.d.ts +16 -1
- package/lib/src/utils/minify-brand-page-metadata.js +31 -9
- package/package.json +1 -1
- package/src/brand-page/__fixtures__/migration-22-v21/edited-brandsite-sections.v21.json +982 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandcontact-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandpage-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandsite-every-section.v21.json +1243 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandcontact.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-general-link.v21.json +527 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-links.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-social-links.v21.json +514 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-about.v21.json +459 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-footer.v21.json +469 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-header-banner.v21.json +481 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-sections.v21.json +800 -0
- package/src/brand-page/__fixtures__/production-text-style-resolver.fixture.ts +52 -0
- package/src/brand-page/components/about-section/AboutSection.vue.test.ts +0 -10
- package/src/brand-page/components/contact-form/ContactForm.mixin.test.ts +127 -0
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +31 -14
- package/src/brand-page/components/contact-form/ContactForm.vue +26 -12
- package/src/brand-page/components/contact-form/ContactForm.vue.test.ts +60 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.test.ts +92 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +28 -3
- package/src/brand-page/components/mailing-list/MailingList.vue +9 -4
- package/src/brand-page/components/mailing-list/MailingList.vue.test.ts +63 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.ts +51 -1
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.test.ts +114 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.vue +8 -2
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.test.ts +182 -0
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +59 -12
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +40 -3
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +15 -7
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +133 -3
- package/src/brand-page/components/page/Page.mixin.ts +41 -34
- package/src/brand-page/components/page/Page.vue +17 -6
- package/src/brand-page/components/page/Page.vue.test.ts +91 -1
- package/src/brand-page/components/page-footer/PageFooter.mixin.ts +32 -2
- package/src/brand-page/components/page-footer/PageFooter.test.ts +79 -0
- package/src/brand-page/components/page-footer/PageFooter.vue +12 -4
- package/src/brand-page/components/payment/Payment.mixin.ts +34 -2
- package/src/brand-page/components/payment/Payment.test.ts +188 -0
- package/src/brand-page/components/payment/Payment.vue +12 -5
- package/src/brand-page/components/payment/RequestPaymentStripe.vue +1 -0
- package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +49 -2
- package/src/brand-page/components/payment/support-me/SupportMe.test.ts +100 -0
- package/src/brand-page/components/payment/support-me/SupportMe.vue +7 -1
- package/src/brand-page/components/payment/support-me/SupportMe.vue.test.ts +66 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.test.ts +100 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.vue +6 -3
- package/src/brand-page/components/shop/PaymentModal.vue +2 -6
- package/src/brand-page/components/shop/PaymentShippingAddress.vue +6 -0
- package/src/brand-page/components/shop/Shop.vue +15 -2
- package/src/brand-page/components/shop/Shop.vue.test.ts +74 -2
- package/src/brand-page/components/social-links/SocialLinks.stories.ts +0 -3
- package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +0 -3
- package/src/brand-page/components/testimonial-section/__fixtures__/data.ts +0 -3
- package/src/brand-page/components/text/Text.stories.ts +0 -17
- package/src/brand-page/components/text-wrapper/TextWrapper.parity.test.ts +136 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.test.ts +358 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +82 -22
- package/src/brand-page/constants/font.constants.ts +37 -0
- package/src/brand-page/models/footer-icon-color.test.ts +22 -0
- package/src/brand-page/models/index.ts +50 -28
- package/src/brand-page/models/navigation-styles.model.test.ts +77 -1
- package/src/brand-page/models/navigation-styles.model.ts +26 -9
- package/src/brand-page/models/payment.model.ts +15 -6
- package/src/brand-page/models/styles.model.test.ts +104 -0
- package/src/brand-page/models/styles.model.ts +181 -47
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +619 -115
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +150 -9
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +300 -18
- package/src/brand-page/utils/color-palette.util.test.ts +126 -1
- package/src/brand-page/utils/color-palette.util.ts +92 -26
- package/src/brand-page/utils/color.util.test.ts +62 -29
- package/src/brand-page/utils/color.util.ts +77 -14
- package/src/brand-page/utils/container-text-color.util.test.ts +672 -26
- package/src/brand-page/utils/container-text-color.util.ts +472 -46
- package/src/brand-page/utils/index.ts +1 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/edited-brandsite-sections.v22.json +1191 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandcontact-every-section.v22.json +2026 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandpage-every-section.v22.json +2017 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandsite-every-section.v22.json +2031 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandcontact.v22.json +1145 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-general-link.v22.json +645 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-links.v22.json +1136 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-social-links.v22.json +662 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-about.v22.json +638 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-footer.v22.json +610 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-header-banner.v22.json +660 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-sections.v22.json +1132 -0
- package/src/brand-page/utils/migration/migration-01.ts +293 -237
- package/src/brand-page/utils/migration/migration-02.ts +8 -1
- package/src/brand-page/utils/migration/migration-20.ts +6 -3
- package/src/brand-page/utils/migration/migration-20_5.test.ts +5 -2
- package/src/brand-page/utils/migration/migration-21.test.ts +34 -0
- package/src/brand-page/utils/migration/migration-21.ts +46 -10
- package/src/brand-page/utils/migration/migration-22.fixed-input.test.ts +43 -0
- package/src/brand-page/utils/migration/migration-22.test.ts +4103 -0
- package/src/brand-page/utils/migration/migration-22.text-font-family.test.ts +72 -0
- package/src/brand-page/utils/migration/migration-22.ts +1336 -0
- package/src/brand-page/utils/migration.util.test.ts +146 -32
- package/src/brand-page/utils/migration.util.ts +18 -0
- package/src/brand-page/utils/model.util.ts +4 -0
- package/src/brand-page/utils/personalisation.util.test.ts +148 -3
- package/src/brand-page/utils/personalisation.util.ts +9 -1
- package/src/brand-page/utils/rte-role-lift.util.ts +409 -0
- package/src/brand-page/utils/style.util.test.ts +35 -2
- package/src/brand-page/utils/style.util.ts +45 -11
- package/src/brand-page/utils/text-role-css.util.test.ts +525 -0
- package/src/brand-page/utils/text-role-css.util.ts +321 -0
- package/src/brand-page/utils/text-role-reconnect.util.test.ts +604 -0
- package/src/brand-page/utils/text-role-reconnect.util.ts +727 -0
- package/src/brand-page/utils/text-style.util.test.ts +305 -0
- package/src/brand-page/utils/text-style.util.ts +198 -24
- package/src/brand-page/utils/view-model.page-data.test.ts +232 -0
- package/src/brand-page/utils/view-model.util.test.ts +954 -133
- package/src/brand-page/utils/view-model.util.ts +187 -139
- package/src/brand-page/view-models.ts +4 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.blank-site.test.ts +57 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +9 -5
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -10
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.ts +0 -1
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -44
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +253 -200
- package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +1 -0
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +1 -0
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +1 -0
- package/src/brand-page-maker/composables/rich-text-editor/block-typography.test.ts +519 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/MaxLength.test.ts +26 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.test.ts +110 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.ts +99 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.ts +397 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/ViewDomParser.test.ts +139 -0
- package/src/brand-page-maker/composables/rich-text-editor/font.ts +36 -5
- package/src/brand-page-maker/composables/rich-text-editor/formatting.test.ts +375 -1
- package/src/brand-page-maker/composables/rich-text-editor/formatting.ts +301 -17
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.test.ts +82 -1
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +28 -34
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.test.ts +80 -0
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.ts +75 -0
- package/src/brand-page-maker/composables/rich-text-editor/spacing.ts +31 -6
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.test.ts +2485 -0
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +435 -337
- package/src/brand-page-maker/constants/config-settings-constant.ts +0 -6
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.test.ts +43 -0
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.ts +6 -2
- package/src/brand-page-maker/convertors/text-size-value.convertor.test.ts +24 -0
- package/src/brand-page-maker/convertors/text-size-value.convertor.ts +17 -13
- package/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.ts +7 -22
- package/src/brand-page-maker/default-getters/text-color.default-getter.ts +5 -21
- package/src/brand-page-maker/models/content-settings.test.ts +708 -0
- package/src/brand-page-maker/models/content-settings.ts +133 -82
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.test.ts +63 -1
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.ts +16 -3
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.test.ts +34 -0
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.ts +4 -2
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +185 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +22 -34
- package/src/brand-page-maker/stores/history/history-store.ts +35 -2
- package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +528 -0
- package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +12 -0
- package/src/brand-page-maker/utils/apply-color-strategy.golden.test.ts +2 -0
- package/src/brand-page-maker/utils/apply-color-strategy.test.ts +181 -3
- package/src/brand-page-maker/utils/apply-color-strategy.ts +36 -4
- package/src/brand-page-maker/utils/index.ts +2 -1
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +447 -410
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +610 -506
- package/src/brand-page-maker/utils/rte-authoring.util.test.ts +244 -0
- package/src/brand-page-maker/utils/rte-authoring.util.ts +175 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.test.ts +558 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.ts +473 -0
- package/src/brand-page-maker/utils/rte-features.test.ts +99 -3
- package/src/brand-page-maker/utils/rte-render-parity.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-render.util.test.ts +230 -0
- package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-sanitize.util.ts +14 -3
- package/src/brand-page-maker/utils/rte-schema-version.test.ts +102 -0
- package/src/bundles/bundled-translations.de-DE.json +21 -2
- package/src/bundles/bundled-translations.es-ES.json +21 -2
- package/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/src/bundles/bundled-translations.json +21 -2
- package/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/src/clients/ai-assistant-client.ts +1 -0
- package/src/composables/useTranslate.ts +2 -1
- package/src/lib.ts +2 -2
- package/src/metadata-builder/builders/footer-builder.test.ts +70 -45
- package/src/metadata-builder/builders/footer-builder.ts +4 -8
- package/src/metadata-builder/builders/global-role-propagation.test.ts +907 -0
- package/src/metadata-builder/builders/global-role-propagation.ts +430 -0
- package/src/metadata-builder/builders/global-styles-builder.test.ts +1020 -0
- package/src/metadata-builder/builders/global-styles-builder.ts +194 -48
- package/src/metadata-builder/builders/header-builder.test.ts +112 -40
- package/src/metadata-builder/builders/header-builder.ts +18 -8
- package/src/metadata-builder/builders/section-builders/about-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +7 -4
- package/src/metadata-builder/builders/section-builders/images-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +7 -7
- package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +2 -2
- package/src/metadata-builder/builders/section-builders/social-links-builder.ts +21 -10
- package/src/metadata-builder/builders/section-builders/support-me-builder.test.ts +10 -0
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +111 -61
- package/src/metadata-builder/builders/section-field-maps.ts +1 -0
- package/src/metadata-builder/builders/section-field-utils.test.ts +545 -2
- package/src/metadata-builder/builders/section-field-utils.ts +202 -69
- package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +38 -13
- package/src/metadata-builder/builders/section-rules/social-links.rules.ts +5 -0
- package/src/metadata-builder/helpers/rte.helpers.test.ts +101 -0
- package/src/metadata-builder/helpers/rte.helpers.ts +129 -43
- package/src/metadata-builder/metadata-executor.test.ts +167 -0
- package/src/metadata-builder/metadata-executor.ts +34 -1
- package/src/metadata-builder/models.ts +2 -0
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +23 -7
- package/src/metadata-builder/parsers/section-tool-arguments.ts +21 -1
- package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +215 -0
- package/src/metadata-builder/sanitizers/rte-schema-check.ts +1 -1
- package/src/metadata-builder/sanitizers/sanitizer-rules.ts +4 -8
- package/src/metadata-builder/sanitizers/section-args-validator.ts +136 -53
- package/src/shared/color-palette/section-color-matches.test.ts +15 -11
- package/src/shared/color-palette/section-color-matches.ts +9 -28
- package/src/shared/color-strategies/color-strategies.ts +35 -0
- package/src/shared/color-strategies/rte-color.test.ts +1 -1
- package/src/shared/color-strategies/rte-color.ts +19 -0
- package/src/shared/color-strategies/rte-field-pairs.test.ts +26 -5
- package/src/shared/color-strategies/rte-field-pairs.ts +33 -0
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.test.ts +43 -66
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.vue +7 -1
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -48
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +33 -7
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.test.ts +128 -1
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -0
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSlider.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSliderField.vue +1 -0
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +1 -0
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.test.ts +56 -3
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +11 -4
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.test.ts +335 -25
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +248 -70
- package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +113 -25
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.de-DE.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.es-ES.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-CA.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-FR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.json +8 -1
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-BR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-PT.json +17 -10
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.test.ts +141 -0
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.vue +136 -0
- package/src/shared/content-settings/store/content-settings-store.test.ts +491 -6
- package/src/shared/content-settings/store/content-settings-store.ts +159 -17
- package/src/shared/logo-settings/components/EditLogoSettings.vue +1 -0
- package/src/shared/logo-settings/components/LogoVariations.vue +1 -0
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +1 -0
- package/src/shared/navigation-style-settings/store/index.test.ts +295 -0
- package/src/shared/navigation-style-settings/store/index.ts +65 -15
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +2 -0
- package/src/shared/page-settings/components/page-settings/PageElement.vue +1 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +44 -4
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +13 -4
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.navigation.test.ts +89 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.text-style.test.ts +91 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +14 -2
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.vue +2 -0
- package/src/shared/page-settings/store/page-settings-store.text-style.test.ts +84 -0
- package/src/shared/page-settings/store/page-settings-store.ts +30 -1
- package/src/shared/rte-extensions/AutoLink.test.ts +98 -0
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.ts +87 -58
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.ts +4 -1
- package/src/shared/rte-extensions/TextEffects.ts +151 -0
- package/src/shared/rte-extensions/ViewDomParser.ts +27 -0
- package/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.ts → shared/rte-extensions.util.ts} +66 -9
- package/src/shared/rte-link.util.ts +2 -0
- package/src/shared/rte-render.util.ts +385 -0
- package/src/shared/rte-shape.util.ts +29 -0
- package/src/shared/side-bar/store/side-bar-store.test.ts +27 -1
- package/src/shared/side-bar/store/side-bar-store.ts +11 -0
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +7 -3
- package/src/shared/style-settings/components/StyleSettings.test.ts +116 -0
- package/src/shared/style-settings/components/StyleSettings.vue +75 -25
- package/src/shared/style-settings/components/i18n/style-settings.de-DE.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.es-ES.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-CA.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-FR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.json +13 -3
- package/src/shared/style-settings/components/i18n/style-settings.pt-BR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.pt-PT.json +32 -20
- package/src/shared/style-settings/components/text-style-options-settings-with-state/TextStyleOptionsSettingsWithState.vue +14 -34
- package/src/shared/style-settings/store/style-settings-store.ts +3 -49
- package/src/shared/style-settings/text-style-size-order.test.ts +76 -0
- package/src/shared/style-settings/text-style-size-order.ts +28 -0
- package/src/shared/template-settings/components/TemplatesSettings.vue +4 -0
- package/src/shared/text-role-typography.util.ts +277 -0
- package/src/utils/minify-brand-page-metadata.test.ts +102 -7
- package/src/utils/minify-brand-page-metadata.ts +62 -8
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/AutoLink.d.ts +0 -2
- package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
- package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -63
- package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -106
- package/lib/src/brand-page-maker/utils/rte-shape.d.ts +0 -18
- package/lib/src/brand-page-maker/utils/rte-shape.js +0 -21
- package/lib/src/metadata-builder/builders/global-font-propagation.d.ts +0 -41
- package/lib/src/metadata-builder/builders/global-font-propagation.js +0 -146
- package/src/brand-page-maker/utils/rte-render.util.ts +0 -179
- package/src/brand-page-maker/utils/rte-shape.ts +0 -29
- package/src/metadata-builder/builders/global-font-propagation.test.ts +0 -401
- package/src/metadata-builder/builders/global-font-propagation.ts +0 -238
- package/src/shared/style-settings/components/StyleSettingsSection.vue +0 -8
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.d.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.ts +0 -0
|
@@ -45,11 +45,6 @@ import { useUiPageSettingsStore } from '../../page-settings/store';
|
|
|
45
45
|
import { PAGE_SECTIONS } from '../../page-settings/models';
|
|
46
46
|
import { availableButtonStyleConfigs } from '@brand-page-maker/models';
|
|
47
47
|
import { buttonStylePresetCss } from '../button-style-preset';
|
|
48
|
-
import {
|
|
49
|
-
TRIGGER_TYPE,
|
|
50
|
-
UPGRADE_CTA_LOCATIONS,
|
|
51
|
-
useEventTracker,
|
|
52
|
-
} from '@brand-page-maker/composables/useEventTracker';
|
|
53
48
|
|
|
54
49
|
export interface StyleSettingsState {
|
|
55
50
|
availableButtonStyleConfigs: ButtonStyleConfig[];
|
|
@@ -187,17 +182,8 @@ export const useUiStyleSettingsStore = defineStore('uiStyleSettings', {
|
|
|
187
182
|
});
|
|
188
183
|
},
|
|
189
184
|
|
|
190
|
-
_setTextFontFamily(payload: { fontFamily: FontFamilyKey }) {
|
|
191
|
-
this.$patch((state) => {
|
|
192
|
-
state.textStyles.textFontFamily = payload.fontFamily;
|
|
193
|
-
});
|
|
194
|
-
},
|
|
195
|
-
|
|
196
185
|
_setTextStyles(payload: Partial<TextStyles>): void {
|
|
197
186
|
this.$patch((state) => {
|
|
198
|
-
state.textStyles.textFontFamily =
|
|
199
|
-
payload.textFontFamily || state.textStyles.textFontFamily;
|
|
200
|
-
|
|
201
187
|
state.textStyles.textStyleOptions =
|
|
202
188
|
payload.textStyleOptions || state.textStyles.textStyleOptions;
|
|
203
189
|
});
|
|
@@ -354,33 +340,6 @@ export const useUiStyleSettingsStore = defineStore('uiStyleSettings', {
|
|
|
354
340
|
|
|
355
341
|
onStyleChanged();
|
|
356
342
|
},
|
|
357
|
-
|
|
358
|
-
async setTextFontFamily(payload: { fontFamily: FontFamilyKey }) {
|
|
359
|
-
const uiStore = useUiStore();
|
|
360
|
-
const eventTracker = useEventTracker();
|
|
361
|
-
|
|
362
|
-
const fontFamilyConfig = this.availableTextFontFamilyOptions.find(
|
|
363
|
-
(x) => x.key === payload.fontFamily,
|
|
364
|
-
);
|
|
365
|
-
|
|
366
|
-
if (!fontFamilyConfig) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (fontFamilyConfig.isLocked) {
|
|
371
|
-
eventTracker.setUpsellBridgeState({
|
|
372
|
-
cta_location: UPGRADE_CTA_LOCATIONS.ADD_CONTENT,
|
|
373
|
-
trigger_type: TRIGGER_TYPE.AUTOMATIC,
|
|
374
|
-
content_type: 'font',
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
await uiStore.showUpgradeModalAndSaveAsync();
|
|
378
|
-
|
|
379
|
-
return;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
await this._setTextFontFamily(payload);
|
|
383
|
-
},
|
|
384
343
|
},
|
|
385
344
|
getters: {
|
|
386
345
|
availableTextFontFamilyOptions(): StyleTextFontFamilyOption[] {
|
|
@@ -420,19 +379,14 @@ export const useUiStyleSettingsStore = defineStore('uiStyleSettings', {
|
|
|
420
379
|
return getColorFromCSSShadow(this.buttonStyles.style.boxShadow);
|
|
421
380
|
},
|
|
422
381
|
|
|
423
|
-
//
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
},
|
|
382
|
+
// BP-5969 (ADR-0020): the `defaultTextColor` getter is gone — there is no site-wide
|
|
383
|
+
// default text colour any more (no base coat, roles carry none). Its only consumer,
|
|
384
|
+
// the Color Matches panel, no longer feeds one in.
|
|
427
385
|
|
|
428
386
|
selectedButtonStyleConfig(): ButtonStyleConfig | undefined {
|
|
429
387
|
return this.availableButtonStyleConfigs.find(
|
|
430
388
|
(s) => s.id === this.buttonStyles.selectedButtonStyleId,
|
|
431
389
|
);
|
|
432
390
|
},
|
|
433
|
-
|
|
434
|
-
selectedTextFontFamily(): FontFamilyKey {
|
|
435
|
-
return this.textStyles.textFontFamily;
|
|
436
|
-
},
|
|
437
391
|
},
|
|
438
392
|
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
TextStyles,
|
|
4
|
+
type CanonicalTextStyleType,
|
|
5
|
+
type TextStyleOptions,
|
|
6
|
+
} from '@brand-page';
|
|
7
|
+
import { hasTextStyleSizeOrderIssue } from './text-style-size-order';
|
|
8
|
+
|
|
9
|
+
const withSizes = (
|
|
10
|
+
sizes: Partial<Record<CanonicalTextStyleType, string>>,
|
|
11
|
+
): TextStyleOptions => {
|
|
12
|
+
const options = new TextStyles().textStyleOptions;
|
|
13
|
+
|
|
14
|
+
for (const [type, fontSize] of Object.entries(sizes)) {
|
|
15
|
+
options[type as CanonicalTextStyleType].style.fontSize = fontSize;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return options;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
describe('hasTextStyleSizeOrderIssue', () => {
|
|
22
|
+
test('the default role sizes are in order', () => {
|
|
23
|
+
expect(hasTextStyleSizeOrderIssue(withSizes({}))).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('a heading larger than the heading above it is an issue', () => {
|
|
27
|
+
// Heading 3 at 90px, above Heading 2's default 84px.
|
|
28
|
+
expect(hasTextStyleSizeOrderIssue(withSizes({ heading3: '5.625em' }))).toBe(
|
|
29
|
+
true,
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('the last heading larger than the one above it is an issue', () => {
|
|
34
|
+
// Heading 6 at 24px, above Heading 5's default 23px.
|
|
35
|
+
expect(hasTextStyleSizeOrderIssue(withSizes({ heading6: '1.5em' }))).toBe(
|
|
36
|
+
true,
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('a paragraph larger than the paragraph above it is an issue', () => {
|
|
41
|
+
// Paragraph 2 at 64px, above Paragraph 1's default 22px.
|
|
42
|
+
expect(hasTextStyleSizeOrderIssue(withSizes({ paragraph2: '4em' }))).toBe(
|
|
43
|
+
true,
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('equal sizes are not an issue', () => {
|
|
48
|
+
// Heading 5 at 35px, the same as Heading 4's default.
|
|
49
|
+
expect(
|
|
50
|
+
hasTextStyleSizeOrderIssue(withSizes({ heading5: '2.1875em' })),
|
|
51
|
+
).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('sizes that show as the same px are not an issue', () => {
|
|
55
|
+
// 5.2em is 83.2px and shows as 84px, the same as Heading 3 at 5.25em.
|
|
56
|
+
expect(
|
|
57
|
+
hasTextStyleSizeOrderIssue(
|
|
58
|
+
withSizes({ heading2: '5.2em', heading3: '5.25em' }),
|
|
59
|
+
),
|
|
60
|
+
).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('a paragraph is never compared with a heading', () => {
|
|
64
|
+
// Paragraph 1 at 64px, far above Heading 6's default 16px.
|
|
65
|
+
expect(hasTextStyleSizeOrderIssue(withSizes({ paragraph1: '4em' }))).toBe(
|
|
66
|
+
false,
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('Button text is never compared', () => {
|
|
71
|
+
// Button text at 128px, the slider's maximum.
|
|
72
|
+
expect(hasTextStyleSizeOrderIssue(withSizes({ button: '8em' }))).toBe(
|
|
73
|
+
false,
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CanonicalTextStyleType, TextStyleOptions } from '@brand-page';
|
|
2
|
+
import { textSizeValueConvertor } from '@brand-page-maker/convertors';
|
|
3
|
+
|
|
4
|
+
// A role is only compared with the one above it in its own group. Button text has no
|
|
5
|
+
// group: it has nothing above or below it.
|
|
6
|
+
const SIZE_ORDER_GROUPS: readonly (readonly CanonicalTextStyleType[])[] = [
|
|
7
|
+
['heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6'],
|
|
8
|
+
['paragraph1', 'paragraph2', 'paragraph3'],
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// The px the role card shows, so two sizes that read the same never count as out of order.
|
|
12
|
+
const roleSizePx = (
|
|
13
|
+
options: TextStyleOptions,
|
|
14
|
+
type: CanonicalTextStyleType,
|
|
15
|
+
): number => Number(textSizeValueConvertor.convert(options[type]?.style));
|
|
16
|
+
|
|
17
|
+
// Equal sizes are allowed: a group can tell two roles apart by weight alone.
|
|
18
|
+
export const hasTextStyleSizeOrderIssue = (
|
|
19
|
+
options: TextStyleOptions,
|
|
20
|
+
): boolean =>
|
|
21
|
+
SIZE_ORDER_GROUPS.some((types) =>
|
|
22
|
+
types
|
|
23
|
+
.slice(1)
|
|
24
|
+
.some(
|
|
25
|
+
(type, index) =>
|
|
26
|
+
roleSizePx(options, type) > roleSizePx(options, types[index]),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
v-for="template in templates"
|
|
33
33
|
:key="`template-${template.id}`"
|
|
34
34
|
:data-id="template.id"
|
|
35
|
+
data-test-tag="template-card"
|
|
35
36
|
>
|
|
36
37
|
<slot
|
|
37
38
|
name="template-preview"
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
:label="templateSettingsTr(`loadMoreTemplatesButtonText`)"
|
|
53
54
|
variant="outline"
|
|
54
55
|
size="small-wide"
|
|
56
|
+
data-attribute="data-test-load-more-templates"
|
|
55
57
|
:classes="{
|
|
56
58
|
'tw-opacity-50 tw-pointer-events-none': !isLoadMoreBtnEnabled,
|
|
57
59
|
}"
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
v-for="template in templates"
|
|
101
103
|
:key="`template-${template.id}`"
|
|
102
104
|
:data-id="template.id"
|
|
105
|
+
data-test-tag="template-card"
|
|
103
106
|
>
|
|
104
107
|
<slot
|
|
105
108
|
name="template-preview"
|
|
@@ -120,6 +123,7 @@
|
|
|
120
123
|
:label="templateSettingsTr(`loadMoreTemplatesButtonText`)"
|
|
121
124
|
variant="outline"
|
|
122
125
|
size="small-wide"
|
|
126
|
+
data-attribute="data-test-load-more-templates"
|
|
123
127
|
:classes="{
|
|
124
128
|
'tw-opacity-50 tw-pointer-events-none': !isLoadMoreBtnEnabled,
|
|
125
129
|
}"
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIGRATION-22 SNAPSHOT DEPENDENCY: its normalisation and RTE lift use `composeTextDecoration`,
|
|
3
|
+
* `NEUTRAL_TYPOGRAPHY_VALUE`, `TEXT_STYLE_CASCADE_PROPS` and `roleVarRef`. After migration-22
|
|
4
|
+
* releases, pin their v22 behaviour in the migration before changing them.
|
|
5
|
+
*/
|
|
6
|
+
export const ROLE_VAR_ATTRS = [
|
|
7
|
+
{
|
|
8
|
+
markAttr: 'fontFamily',
|
|
9
|
+
cssProp: 'font-family',
|
|
10
|
+
varName: '--role-font-family',
|
|
11
|
+
},
|
|
12
|
+
{ markAttr: 'fontSize', cssProp: 'font-size', varName: '--role-font-size' },
|
|
13
|
+
{
|
|
14
|
+
markAttr: 'lineHeight',
|
|
15
|
+
cssProp: 'line-height',
|
|
16
|
+
varName: '--role-line-height',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
markAttr: 'letterSpacing',
|
|
20
|
+
cssProp: 'letter-spacing',
|
|
21
|
+
varName: '--role-letter-spacing',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
markAttr: 'fontWeight',
|
|
25
|
+
cssProp: 'font-weight',
|
|
26
|
+
varName: '--role-font-weight',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
markAttr: 'fontStyle',
|
|
30
|
+
cssProp: 'font-style',
|
|
31
|
+
varName: '--role-font-style',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
markAttr: 'textDecoration',
|
|
35
|
+
cssProp: 'text-decoration',
|
|
36
|
+
varName: '--role-text-decoration',
|
|
37
|
+
},
|
|
38
|
+
] as const;
|
|
39
|
+
|
|
40
|
+
export type RoleVarMarkAttr = (typeof ROLE_VAR_ATTRS)[number]['markAttr'];
|
|
41
|
+
|
|
42
|
+
export const TEXT_STYLE_CASCADE_PROPS = [
|
|
43
|
+
'fontFamily',
|
|
44
|
+
'fontSize',
|
|
45
|
+
'fontWeight',
|
|
46
|
+
'fontStyle',
|
|
47
|
+
'letterSpacing',
|
|
48
|
+
'lineHeight',
|
|
49
|
+
'textDecoration',
|
|
50
|
+
] as const;
|
|
51
|
+
|
|
52
|
+
export type CascadeTypographyProp = (typeof TEXT_STYLE_CASCADE_PROPS)[number];
|
|
53
|
+
|
|
54
|
+
/** A copy of a style without typography; colour, alignment and other metadata stay. */
|
|
55
|
+
export const omitTypography = <T extends object>(
|
|
56
|
+
style: T,
|
|
57
|
+
): Omit<T, CascadeTypographyProp> => {
|
|
58
|
+
const rest = { ...style } as Record<string, unknown>;
|
|
59
|
+
|
|
60
|
+
for (const prop of TEXT_STYLE_CASCADE_PROPS) delete rest[prop];
|
|
61
|
+
|
|
62
|
+
return rest as Omit<T, CascadeTypographyProp>;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* `omitTypography` as a patch, for the stores that deep-merge a write: an unset value replaces the
|
|
67
|
+
* block's own and their role normalisation then drops the key.
|
|
68
|
+
*/
|
|
69
|
+
export const CLEARED_TYPOGRAPHY = Object.freeze(
|
|
70
|
+
Object.fromEntries(TEXT_STYLE_CASCADE_PROPS.map((prop) => [prop, undefined])),
|
|
71
|
+
) as Readonly<Record<CascadeTypographyProp, undefined>>;
|
|
72
|
+
|
|
73
|
+
/** Only the typography a style sets itself. */
|
|
74
|
+
export const pickTypography = (
|
|
75
|
+
style: Partial<Record<CascadeTypographyProp, string>>,
|
|
76
|
+
): Partial<Record<CascadeTypographyProp, string>> => {
|
|
77
|
+
const typography: Partial<Record<CascadeTypographyProp, string>> = {};
|
|
78
|
+
|
|
79
|
+
for (const prop of TEXT_STYLE_CASCADE_PROPS) {
|
|
80
|
+
if (style[prop] !== undefined) typography[prop] = style[prop];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return typography;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const textRoleClassName = (type: string): string =>
|
|
87
|
+
`bp-text-role-${type}`;
|
|
88
|
+
|
|
89
|
+
const ROLE_VAR_BY_ATTR = new Map<string, (typeof ROLE_VAR_ATTRS)[number]>(
|
|
90
|
+
ROLE_VAR_ATTRS.map((attr) => [attr.markAttr, attr]),
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export const roleVarRef = (markAttr: string): string | undefined => {
|
|
94
|
+
const attr = ROLE_VAR_BY_ATTR.get(markAttr);
|
|
95
|
+
|
|
96
|
+
return attr ? `var(${attr.varName})` : undefined;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const NEUTRAL_TYPOGRAPHY_VALUE: Partial<
|
|
100
|
+
Record<RoleVarMarkAttr, string>
|
|
101
|
+
> = {
|
|
102
|
+
fontWeight: 'normal',
|
|
103
|
+
fontStyle: 'normal',
|
|
104
|
+
textDecoration: 'none',
|
|
105
|
+
letterSpacing: 'normal',
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const TEXT_DECORATION_FLAGS = [
|
|
109
|
+
'underline',
|
|
110
|
+
'line-through',
|
|
111
|
+
'overline',
|
|
112
|
+
] as const;
|
|
113
|
+
const RTE_TEXT_DECORATION_CLASS_PREFIX = 'bp-rte-text-decoration-';
|
|
114
|
+
|
|
115
|
+
const canonicalTextDecoration = (
|
|
116
|
+
value: string | undefined,
|
|
117
|
+
): string | undefined => {
|
|
118
|
+
if (!value) return undefined;
|
|
119
|
+
|
|
120
|
+
const flags = value.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
121
|
+
|
|
122
|
+
if (flags.length === 1 && flags[0] === 'none') return 'none';
|
|
123
|
+
|
|
124
|
+
if (
|
|
125
|
+
flags.length === 0 ||
|
|
126
|
+
flags.includes('none') ||
|
|
127
|
+
flags.some(
|
|
128
|
+
(flag) => !(TEXT_DECORATION_FLAGS as readonly string[]).includes(flag),
|
|
129
|
+
)
|
|
130
|
+
) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
TEXT_DECORATION_FLAGS.filter((flag) => flags.includes(flag)).join(' ') ||
|
|
136
|
+
undefined
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
type TextDecorationState = {
|
|
141
|
+
clearsRole: boolean;
|
|
142
|
+
value: string;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const textDecorationState = (
|
|
146
|
+
value: string | undefined,
|
|
147
|
+
): TextDecorationState | undefined => {
|
|
148
|
+
const trimmed = value?.trim().toLowerCase();
|
|
149
|
+
|
|
150
|
+
if (!trimmed) return undefined;
|
|
151
|
+
|
|
152
|
+
if (trimmed === 'none') return { clearsRole: true, value: 'none' };
|
|
153
|
+
|
|
154
|
+
if (trimmed.startsWith('none ')) {
|
|
155
|
+
const resetValue = canonicalTextDecoration(trimmed.slice('none '.length));
|
|
156
|
+
|
|
157
|
+
return resetValue && resetValue !== 'none'
|
|
158
|
+
? { clearsRole: true, value: resetValue }
|
|
159
|
+
: undefined;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const normalValue = canonicalTextDecoration(trimmed);
|
|
163
|
+
|
|
164
|
+
return normalValue ? { clearsRole: false, value: normalValue } : undefined;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Whether a local decoration explicitly clears its role's lines before adding its own. The reset
|
|
169
|
+
* marker qualifies the run's own lines, so with no literal (absent, or the role ref) it means nothing.
|
|
170
|
+
*/
|
|
171
|
+
export const textDecorationClearsRole = (
|
|
172
|
+
value: string | undefined,
|
|
173
|
+
resetMarker = false,
|
|
174
|
+
): boolean => {
|
|
175
|
+
const state = textDecorationState(value);
|
|
176
|
+
|
|
177
|
+
return state !== undefined && (resetMarker || state.clearsRole);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* A run's own decoration in the form every compare reads: a reset run's lines become `none <lines>`
|
|
182
|
+
* ("clear the role, then draw these"). A read form only — writes store the marker instead.
|
|
183
|
+
*/
|
|
184
|
+
export const localTextDecoration = (
|
|
185
|
+
value: string | undefined,
|
|
186
|
+
resetMarker = false,
|
|
187
|
+
): string | undefined => {
|
|
188
|
+
const state = textDecorationState(value);
|
|
189
|
+
|
|
190
|
+
return state && resetMarker && !state.clearsRole
|
|
191
|
+
? `none ${state.value}`
|
|
192
|
+
: value;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const textDecorationFlags = (value: string | undefined): Set<string> => {
|
|
196
|
+
const state = textDecorationState(value);
|
|
197
|
+
|
|
198
|
+
return new Set(state?.value === 'none' ? [] : state?.value.split(' '));
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export const textDecorationValue = (flags: Iterable<string>): string => {
|
|
202
|
+
const selected = new Set(flags);
|
|
203
|
+
const value = TEXT_DECORATION_FLAGS.filter((flag) => selected.has(flag)).join(
|
|
204
|
+
' ',
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
return value || 'none';
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export const composeTextDecoration = (
|
|
211
|
+
roleValue: string | undefined,
|
|
212
|
+
localValue: string | undefined,
|
|
213
|
+
clearsRole = false,
|
|
214
|
+
): string | undefined => {
|
|
215
|
+
const local =
|
|
216
|
+
localValue === 'var(--role-text-decoration)'
|
|
217
|
+
? undefined
|
|
218
|
+
: textDecorationState(localValue);
|
|
219
|
+
|
|
220
|
+
if (local && (clearsRole || local.clearsRole)) return local.value;
|
|
221
|
+
|
|
222
|
+
const role = canonicalTextDecoration(roleValue);
|
|
223
|
+
const flags = new Set<string>();
|
|
224
|
+
|
|
225
|
+
if (role && role !== 'none')
|
|
226
|
+
role.split(' ').forEach((flag) => flags.add(flag));
|
|
227
|
+
|
|
228
|
+
if (local?.value && local.value !== 'none') {
|
|
229
|
+
local.value.split(' ').forEach((flag) => flags.add(flag));
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const composed = TEXT_DECORATION_FLAGS.filter((flag) => flags.has(flag)).join(
|
|
233
|
+
' ',
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
return composed || (role || local ? 'none' : undefined);
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const rteTextDecorationClassName = (
|
|
240
|
+
value: string | undefined,
|
|
241
|
+
clearsRole = false,
|
|
242
|
+
): string | undefined => {
|
|
243
|
+
if (value === 'var(--role-text-decoration)')
|
|
244
|
+
return `${RTE_TEXT_DECORATION_CLASS_PREFIX}inherit`;
|
|
245
|
+
|
|
246
|
+
const state = textDecorationState(value);
|
|
247
|
+
|
|
248
|
+
return state
|
|
249
|
+
? `${RTE_TEXT_DECORATION_CLASS_PREFIX}${
|
|
250
|
+
(clearsRole || state.clearsRole) && state.value !== 'none'
|
|
251
|
+
? 'reset-'
|
|
252
|
+
: ''
|
|
253
|
+
}${state.value
|
|
254
|
+
.replaceAll('line-through', 'linethrough')
|
|
255
|
+
.replaceAll(' ', '-')}`
|
|
256
|
+
: undefined;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export const runTypographyFillValue = (
|
|
260
|
+
attr: RoleVarMarkAttr,
|
|
261
|
+
roleStyle: Partial<Record<RoleVarMarkAttr, string>> | undefined,
|
|
262
|
+
styleObj: Partial<Record<RoleVarMarkAttr, string>> | undefined,
|
|
263
|
+
): string | undefined => {
|
|
264
|
+
const roleValue = roleStyle?.[attr];
|
|
265
|
+
const blockValue = styleObj?.[attr];
|
|
266
|
+
const neutral = NEUTRAL_TYPOGRAPHY_VALUE[attr];
|
|
267
|
+
const hasRole = roleValue != null && roleValue !== '';
|
|
268
|
+
const hasBlock = blockValue != null && blockValue !== '';
|
|
269
|
+
|
|
270
|
+
if (roleStyle == null) return hasBlock ? blockValue : undefined;
|
|
271
|
+
|
|
272
|
+
const effectiveRole = hasRole ? roleValue : neutral;
|
|
273
|
+
|
|
274
|
+
if (hasBlock && blockValue !== effectiveRole) return blockValue;
|
|
275
|
+
|
|
276
|
+
return hasRole || neutral != null ? roleVarRef(attr) : undefined;
|
|
277
|
+
};
|
|
@@ -151,7 +151,10 @@ describe('minifyBrandPageMetadata — palette resolution', () => {
|
|
|
151
151
|
brandPageType: 'default',
|
|
152
152
|
styles: {
|
|
153
153
|
colors,
|
|
154
|
-
|
|
154
|
+
// BP-5969 (R22): `textStyles.style` — the retired site-wide default text colour — is
|
|
155
|
+
// dropped from the outbound payload entirely (not merely palette-resolved), so it is NOT
|
|
156
|
+
// a fixture for this describe block any more; `backgroundStyles`/`buttonStyles` (live,
|
|
157
|
+
// non-retired style objects) carry the palette-resolution coverage instead.
|
|
155
158
|
backgroundStyles: {
|
|
156
159
|
style: { background: 'var(--palette-custom-abc)' },
|
|
157
160
|
},
|
|
@@ -176,7 +179,6 @@ describe('minifyBrandPageMetadata — palette resolution', () => {
|
|
|
176
179
|
test('resolves role refs, custom refs and a box-shadow ref to their values', () => {
|
|
177
180
|
const styles = minifyBrandPageMetadata(model()).styles as any;
|
|
178
181
|
|
|
179
|
-
expect(styles.textStyles.style.color).toBe('#d1a151');
|
|
180
182
|
expect(styles.backgroundStyles.style.background).toBe('#7b3f9c');
|
|
181
183
|
expect(styles.buttonStyles.style.backgroundColor).toBe('#330a0a');
|
|
182
184
|
expect(styles.buttonStyles.style.boxShadow).toBe('0 2px 4px #d1a151');
|
|
@@ -192,21 +194,21 @@ describe('minifyBrandPageMetadata — palette resolution', () => {
|
|
|
192
194
|
test('an unresolvable id is left untouched, never emptied', () => {
|
|
193
195
|
// An empty string would read as "no colour" and could be written back as one.
|
|
194
196
|
const styles = minifyBrandPageMetadata(
|
|
195
|
-
model({
|
|
197
|
+
model({
|
|
198
|
+
backgroundStyles: { style: { background: 'var(--palette-9)' } },
|
|
199
|
+
}),
|
|
196
200
|
).styles as any;
|
|
197
201
|
|
|
198
|
-
expect(styles.
|
|
202
|
+
expect(styles.backgroundStyles.style.background).toBe('var(--palette-9)');
|
|
199
203
|
});
|
|
200
204
|
|
|
201
205
|
test('literals and `transparent` pass through unchanged', () => {
|
|
202
206
|
const styles = minifyBrandPageMetadata(
|
|
203
207
|
model({
|
|
204
|
-
textStyles: { style: { color: '#123456' } },
|
|
205
208
|
backgroundStyles: { style: { background: 'transparent' } },
|
|
206
209
|
}),
|
|
207
210
|
).styles as any;
|
|
208
211
|
|
|
209
|
-
expect(styles.textStyles.style.color).toBe('#123456');
|
|
210
212
|
expect(styles.backgroundStyles.style.background).toBe('transparent');
|
|
211
213
|
});
|
|
212
214
|
|
|
@@ -220,7 +222,6 @@ describe('minifyBrandPageMetadata — palette resolution', () => {
|
|
|
220
222
|
|
|
221
223
|
minifyBrandPageMetadata(sut);
|
|
222
224
|
|
|
223
|
-
expect((sut.styles as any).textStyles.style.color).toBe('var(--palette-0)');
|
|
224
225
|
expect((sut.styles as any).buttonStyles.style.boxShadow).toBe(
|
|
225
226
|
'0 2px 4px var(--palette-0)',
|
|
226
227
|
);
|
|
@@ -228,6 +229,41 @@ describe('minifyBrandPageMetadata — palette resolution', () => {
|
|
|
228
229
|
});
|
|
229
230
|
});
|
|
230
231
|
|
|
232
|
+
// The deployed pipeline still reads legacy keys and the root colour for contrast repair. Keep them
|
|
233
|
+
// in the minified compatibility payload until service.ai-pipelines #664 is deployed.
|
|
234
|
+
describe('minifyBrandPageMetadata — textStyles keeps pipeline compatibility', () => {
|
|
235
|
+
test('includes all 14 roles and the root colour without mutating the source model', () => {
|
|
236
|
+
const model = new BrandPageModel({ ...BRAND_SITE, pages: [] });
|
|
237
|
+
const textStyles = model.styles.textStyles as unknown as Record<
|
|
238
|
+
string,
|
|
239
|
+
unknown
|
|
240
|
+
>;
|
|
241
|
+
|
|
242
|
+
// Simulate a migrated-but-not-yet-stripped site: the legacy `style` colour still on the
|
|
243
|
+
// instance (`TextStyles`' constructor carries it through for `migration-21` to consume).
|
|
244
|
+
textStyles.style = { color: '#123456' };
|
|
245
|
+
|
|
246
|
+
const minified = minifyBrandPageMetadata(model);
|
|
247
|
+
const outStyles = minified.styles.textStyles.textStyleOptions as Record<
|
|
248
|
+
string,
|
|
249
|
+
unknown
|
|
250
|
+
>;
|
|
251
|
+
|
|
252
|
+
expect(Object.keys(outStyles)).toHaveLength(14);
|
|
253
|
+
expect(outStyles.titles).toBeDefined();
|
|
254
|
+
expect(outStyles.paragraphs).toBeDefined();
|
|
255
|
+
expect(
|
|
256
|
+
(minified.styles.textStyles as unknown as Record<string, unknown>).style,
|
|
257
|
+
).toEqual({ color: '#123456' });
|
|
258
|
+
|
|
259
|
+
// The source model is untouched — migration still has every legacy option and the colour.
|
|
260
|
+
expect(Object.keys(model.styles.textStyles.textStyleOptions)).toHaveLength(
|
|
261
|
+
14,
|
|
262
|
+
);
|
|
263
|
+
expect(textStyles.style).toEqual({ color: '#123456' });
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
231
267
|
/**
|
|
232
268
|
* BP-6081: the AI reads colours as values and floors text against the band it
|
|
233
269
|
* sits on. The footer shipped with no colours at all and a text section's band
|
|
@@ -334,3 +370,62 @@ describe('minifyBrandPageMetadata — bands the AI must see (BP-6081)', () => {
|
|
|
334
370
|
});
|
|
335
371
|
});
|
|
336
372
|
});
|
|
373
|
+
|
|
374
|
+
// The nav keeps only its overrides once it links a role, so a font equal to its role's isn't
|
|
375
|
+
// stored; the AI still has to see the font the nav draws.
|
|
376
|
+
describe('minifyBrandPageMetadata — nav font resolves against its role', () => {
|
|
377
|
+
test('a nav on Paragraph 1 with no font of its own reports Paragraph 1’s font', () => {
|
|
378
|
+
const model = new BrandPageModel({ ...BRAND_SITE, pages: [] });
|
|
379
|
+
|
|
380
|
+
model.styles.textStyles.textStyleOptions.paragraph1.style.fontFamily =
|
|
381
|
+
'Oswald';
|
|
382
|
+
model.pageHeaderDesktop.navigation.defaultButtonStyle = {
|
|
383
|
+
textStyleType: 'paragraph1',
|
|
384
|
+
fontSize: '1em',
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
const minified = minifyBrandPageMetadata(model);
|
|
388
|
+
|
|
389
|
+
expect(
|
|
390
|
+
minified.pageHeaderDesktop?.navigation?.defaultButtonStyle?.fontFamily,
|
|
391
|
+
).toBe('Oswald');
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
test('a nav whose role has no font either reports the page root’s Lato, not a stale site font', () => {
|
|
395
|
+
const model = new BrandPageModel({ ...BRAND_SITE, pages: [] });
|
|
396
|
+
|
|
397
|
+
(model.styles.textStyles as unknown as Record<string, unknown>)[
|
|
398
|
+
'textFontFamily'
|
|
399
|
+
] = 'oswald';
|
|
400
|
+
delete (
|
|
401
|
+
model.styles.textStyles.textStyleOptions.paragraph1.style as {
|
|
402
|
+
fontFamily?: string;
|
|
403
|
+
}
|
|
404
|
+
).fontFamily;
|
|
405
|
+
model.pageHeaderDesktop.navigation.defaultButtonStyle = {
|
|
406
|
+
textStyleType: 'paragraph1',
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
const minified = minifyBrandPageMetadata(model);
|
|
410
|
+
|
|
411
|
+
expect(
|
|
412
|
+
minified.pageHeaderDesktop?.navigation?.defaultButtonStyle?.fontFamily,
|
|
413
|
+
).toBe('Lato');
|
|
414
|
+
expect(minified.styles.textStyles).not.toHaveProperty('textFontFamily');
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
test('a nav font of its own is reported as is', () => {
|
|
418
|
+
const model = new BrandPageModel({ ...BRAND_SITE, pages: [] });
|
|
419
|
+
|
|
420
|
+
model.pageHeaderDesktop.navigation.defaultButtonStyle = {
|
|
421
|
+
textStyleType: 'paragraph1',
|
|
422
|
+
fontFamily: 'Georgia',
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const minified = minifyBrandPageMetadata(model);
|
|
426
|
+
|
|
427
|
+
expect(
|
|
428
|
+
minified.pageHeaderDesktop?.navigation?.defaultButtonStyle?.fontFamily,
|
|
429
|
+
).toBe('Georgia');
|
|
430
|
+
});
|
|
431
|
+
});
|