@designcrowd/library.brand-page 6.2.11 → 6.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-DDcraD5S.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DtOeaisf.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BZpmJPew.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CqRwC4e7.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CqRwC4e7.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DId9Dfjh.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DId9Dfjh.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BTDfmOcm.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CeAu9Ayx.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-WCv0K41H.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BlfevQDY.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-Cvt7MHPZ.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DipZuylv.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BCw4lcKN.js → CreatedOnDcom-pt-pt-Cf6u2GCg.js} +1 -1
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.d.ts +16 -0
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.js +35 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +3 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +19 -13
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +3 -1
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +17 -2
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.d.ts +11 -3
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.js +35 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +8 -2
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +27 -3
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/page/Page.mixin.js +33 -27
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.d.ts +7 -2
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.js +21 -1
- package/lib/src/brand-page/components/payment/Payment.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/payment/Payment.mixin.js +22 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +6 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +32 -1
- package/lib/src/brand-page/components/social-links/SocialLinks.stories.js +0 -3
- package/lib/src/brand-page/components/testimonial-section/__fixtures__/data.js +0 -3
- package/lib/src/brand-page/components/text/Text.stories.js +0 -17
- package/lib/src/brand-page/constants/font.constants.d.ts +62 -0
- package/lib/src/brand-page/constants/font.constants.js +35 -0
- package/lib/src/brand-page/models/index.d.ts +23 -24
- package/lib/src/brand-page/models/index.js +20 -7
- package/lib/src/brand-page/models/navigation-styles.model.d.ts +1 -1
- package/lib/src/brand-page/models/navigation-styles.model.js +17 -8
- package/lib/src/brand-page/models/payment.model.d.ts +11 -6
- package/lib/src/brand-page/models/styles.model.d.ts +53 -7
- package/lib/src/brand-page/models/styles.model.js +115 -27
- package/lib/src/brand-page/utils/color-palette.util.d.ts +43 -23
- package/lib/src/brand-page/utils/color-palette.util.js +65 -27
- package/lib/src/brand-page/utils/color.util.d.ts +13 -9
- package/lib/src/brand-page/utils/color.util.js +56 -15
- package/lib/src/brand-page/utils/container-text-color.util.d.ts +46 -13
- package/lib/src/brand-page/utils/container-text-color.util.js +321 -41
- package/lib/src/brand-page/utils/index.d.ts +1 -0
- package/lib/src/brand-page/utils/index.js +1 -0
- package/lib/src/brand-page/utils/migration/migration-20.js +6 -2
- package/lib/src/brand-page/utils/migration/migration-21.js +34 -6
- package/lib/src/brand-page/utils/migration/migration-22.d.ts +99 -0
- package/lib/src/brand-page/utils/migration/migration-22.js +909 -0
- package/lib/src/brand-page/utils/migration.util.js +17 -0
- package/lib/src/brand-page/utils/model.util.d.ts +4 -0
- package/lib/src/brand-page/utils/model.util.js +4 -0
- package/lib/src/brand-page/utils/personalisation.util.js +9 -1
- package/lib/src/brand-page/utils/rte-role-lift.util.d.ts +72 -0
- package/lib/src/brand-page/utils/rte-role-lift.util.js +275 -0
- package/lib/src/brand-page/utils/style.util.d.ts +5 -1
- package/lib/src/brand-page/utils/style.util.js +34 -11
- package/lib/src/brand-page/utils/text-role-css.util.d.ts +19 -0
- package/lib/src/brand-page/utils/text-role-css.util.js +186 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.d.ts +90 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.js +434 -0
- package/lib/src/brand-page/utils/text-style.util.d.ts +53 -23
- package/lib/src/brand-page/utils/text-style.util.js +122 -22
- package/lib/src/brand-page/utils/view-model.util.d.ts +9 -1
- package/lib/src/brand-page/utils/view-model.util.js +124 -111
- package/lib/src/brand-page/view-models.d.ts +1 -0
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +13 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +4 -4
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -10
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.js +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +23 -138
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -28
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +5 -2
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +1 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.d.ts +16 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.js +61 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.d.ts +11 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.js +236 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.js +25 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.d.ts +17 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.js +204 -17
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +29 -31
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.d.ts +20 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.js +60 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.js +22 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +10 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +319 -275
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -5
- package/lib/src/brand-page-maker/convertors/text-css-style-options.convertor.js +6 -2
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.d.ts +1 -1
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
- package/lib/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.js +7 -14
- package/lib/src/brand-page-maker/default-getters/text-color.default-getter.js +6 -13
- package/lib/src/brand-page-maker/models/content-settings.d.ts +8 -0
- package/lib/src/brand-page-maker/models/content-settings.js +112 -81
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.d.ts +2 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.js +5 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.js +4 -3
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1257 -117
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +6 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +17 -9
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +59 -5
- package/lib/src/brand-page-maker/stores/history/history-store.js +22 -2
- package/lib/src/brand-page-maker/utils/apply-color-strategy.js +26 -8
- package/lib/src/brand-page-maker/utils/index.d.ts +2 -1
- package/lib/src/brand-page-maker/utils/index.js +2 -1
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +117 -15
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +435 -281
- package/lib/src/brand-page-maker/utils/rte-authoring.util.d.ts +4 -0
- package/lib/src/brand-page-maker/utils/rte-authoring.util.js +101 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.d.ts +126 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.js +307 -0
- package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +13 -3
- package/lib/src/{bundled-translations-zfiA5Tsw.js → bundled-translations-yGrvPE5i.js} +17 -17
- package/lib/src/{bundled-translations.de-DE-ChsdSyAP.js → bundled-translations.de-DE-L4Znf8Hs.js} +17 -17
- package/lib/src/{bundled-translations.es-ES-DflsWQK0.js → bundled-translations.es-ES-D6iticrK.js} +15 -15
- package/lib/src/{bundled-translations.fr-CA-fpDRuZ52.js → bundled-translations.fr-CA-BgAVE-9k.js} +25 -25
- package/lib/src/{bundled-translations.fr-FR-Bub73Zt-.js → bundled-translations.fr-FR-B8GbyqxQ.js} +17 -17
- package/lib/src/{bundled-translations.pt-BR-BlnWE9TB.js → bundled-translations.pt-BR-DjPU3Db7.js} +25 -25
- package/lib/src/{bundled-translations.pt-PT-DmzXlnaS.js → bundled-translations.pt-PT-BaepaDpr.js} +23 -23
- package/lib/src/bundles/bundled-translations.de-DE.json +21 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/lib/src/bundles/bundled-translations.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/lib/src/clients/ai-assistant-client.d.ts +1 -0
- package/lib/src/composables/useTranslate.d.ts +1 -1
- package/lib/src/composables/useTranslate.js +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +303 -207
- package/lib/src/css/library.brand-page-brandPage.min.css +303 -207
- package/lib/src/css/library.brand-page-designCom.min.css +303 -207
- package/lib/src/css/library.brand-page-preview.min.css +303 -207
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.mjs +195 -191
- package/lib/src/{lib-1AqtEmvQ.js → lib-kGRlD3_P.js} +36855 -33893
- package/lib/src/lib.js +2 -1
- package/lib/src/metadata-builder/builders/footer-builder.js +4 -5
- package/lib/src/metadata-builder/builders/global-role-propagation.d.ts +58 -0
- package/lib/src/metadata-builder/builders/global-role-propagation.js +246 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +1 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.js +116 -45
- package/lib/src/metadata-builder/builders/header-builder.js +13 -4
- package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +8 -2
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +60 -29
- package/lib/src/metadata-builder/builders/section-field-maps.js +1 -0
- package/lib/src/metadata-builder/builders/section-field-utils.d.ts +48 -19
- package/lib/src/metadata-builder/builders/section-field-utils.js +128 -52
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +4 -2
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +28 -12
- package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +5 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +1 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.js +97 -40
- package/lib/src/metadata-builder/metadata-executor.js +23 -1
- package/lib/src/metadata-builder/models.d.ts +2 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +18 -19
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +18 -1
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +1 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +0 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +5 -8
- package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +7 -16
- package/lib/src/metadata-builder/sanitizers/section-args-validator.js +95 -22
- package/lib/src/shared/color-palette/section-color-matches.js +9 -25
- package/lib/src/shared/color-strategies/color-strategies.d.ts +15 -0
- package/lib/src/shared/color-strategies/color-strategies.js +31 -0
- package/lib/src/shared/color-strategies/rte-color.d.ts +8 -0
- package/lib/src/shared/color-strategies/rte-color.js +16 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +23 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.js +28 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +9 -135
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -27
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +12 -2
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +7 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +75 -6
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +18 -7
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +6 -1
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -7
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +8 -4
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1255 -26
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +203 -59
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +6 -0
- package/lib/src/shared/content-settings/store/content-settings-store.js +105 -8
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +5 -1
- package/lib/src/shared/navigation-style-settings/store/index.d.ts +7 -3
- package/lib/src/shared/navigation-style-settings/store/index.js +40 -15
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +17 -5
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +70 -13
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +10 -2
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -1
- package/lib/src/shared/page-settings/store/page-settings-store.js +17 -0
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +4 -1
- package/lib/src/shared/rte-extensions/AutoLink.d.ts +17 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.js +67 -51
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.js +4 -1
- package/lib/src/shared/rte-extensions/TextEffects.d.ts +28 -0
- package/lib/src/shared/rte-extensions/TextEffects.js +96 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.d.ts +2 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.js +21 -0
- package/lib/src/shared/rte-extensions.util.d.ts +25 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.js → shared/rte-extensions.util.js} +62 -7
- package/lib/src/shared/rte-link.util.d.ts +1 -0
- package/lib/src/shared/rte-link.util.js +1 -0
- package/lib/src/shared/rte-render.util.d.ts +112 -0
- package/lib/src/shared/rte-render.util.js +255 -0
- package/lib/src/shared/rte-shape.util.d.ts +6 -0
- package/lib/src/shared/rte-shape.util.js +18 -0
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +2 -1
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
- package/lib/src/shared/side-bar/store/side-bar-store.d.ts +2 -0
- package/lib/src/shared/side-bar/store/side-bar-store.js +9 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +155 -15
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +7 -1
- package/lib/src/shared/style-settings/store/style-settings-store.d.ts +1 -9
- package/lib/src/shared/style-settings/store/style-settings-store.js +3 -33
- package/lib/src/shared/style-settings/text-style-size-order.d.ts +2 -0
- package/lib/src/shared/style-settings/text-style-size-order.js +13 -0
- package/lib/src/shared/text-role-typography.util.d.ts +64 -0
- package/lib/src/shared/text-role-typography.util.js +183 -0
- package/lib/src/utils/minify-brand-page-metadata.d.ts +16 -1
- package/lib/src/utils/minify-brand-page-metadata.js +31 -9
- package/package.json +1 -1
- package/src/brand-page/__fixtures__/migration-22-v21/edited-brandsite-sections.v21.json +982 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandcontact-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandpage-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandsite-every-section.v21.json +1243 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandcontact.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-general-link.v21.json +527 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-links.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-social-links.v21.json +514 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-about.v21.json +459 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-footer.v21.json +469 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-header-banner.v21.json +481 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-sections.v21.json +800 -0
- package/src/brand-page/__fixtures__/production-text-style-resolver.fixture.ts +52 -0
- package/src/brand-page/components/about-section/AboutSection.vue.test.ts +0 -10
- package/src/brand-page/components/contact-form/ContactForm.mixin.test.ts +127 -0
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +31 -14
- package/src/brand-page/components/contact-form/ContactForm.vue +26 -12
- package/src/brand-page/components/contact-form/ContactForm.vue.test.ts +60 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.test.ts +92 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +28 -3
- package/src/brand-page/components/mailing-list/MailingList.vue +9 -4
- package/src/brand-page/components/mailing-list/MailingList.vue.test.ts +63 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.ts +51 -1
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.test.ts +114 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.vue +8 -2
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.test.ts +182 -0
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +59 -12
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +40 -3
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +15 -7
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +133 -3
- package/src/brand-page/components/page/Page.mixin.ts +41 -34
- package/src/brand-page/components/page/Page.vue +17 -6
- package/src/brand-page/components/page/Page.vue.test.ts +91 -1
- package/src/brand-page/components/page-footer/PageFooter.mixin.ts +32 -2
- package/src/brand-page/components/page-footer/PageFooter.test.ts +79 -0
- package/src/brand-page/components/page-footer/PageFooter.vue +12 -4
- package/src/brand-page/components/payment/Payment.mixin.ts +34 -2
- package/src/brand-page/components/payment/Payment.test.ts +188 -0
- package/src/brand-page/components/payment/Payment.vue +12 -5
- package/src/brand-page/components/payment/RequestPaymentStripe.vue +1 -0
- package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +49 -2
- package/src/brand-page/components/payment/support-me/SupportMe.test.ts +100 -0
- package/src/brand-page/components/payment/support-me/SupportMe.vue +7 -1
- package/src/brand-page/components/payment/support-me/SupportMe.vue.test.ts +66 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.test.ts +100 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.vue +6 -3
- package/src/brand-page/components/shop/PaymentModal.vue +2 -6
- package/src/brand-page/components/shop/PaymentShippingAddress.vue +6 -0
- package/src/brand-page/components/shop/Shop.vue +15 -2
- package/src/brand-page/components/shop/Shop.vue.test.ts +74 -2
- package/src/brand-page/components/social-links/SocialLinks.stories.ts +0 -3
- package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +0 -3
- package/src/brand-page/components/testimonial-section/__fixtures__/data.ts +0 -3
- package/src/brand-page/components/text/Text.stories.ts +0 -17
- package/src/brand-page/components/text-wrapper/TextWrapper.parity.test.ts +136 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.test.ts +358 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +82 -22
- package/src/brand-page/constants/font.constants.ts +37 -0
- package/src/brand-page/models/footer-icon-color.test.ts +22 -0
- package/src/brand-page/models/index.ts +50 -28
- package/src/brand-page/models/navigation-styles.model.test.ts +77 -1
- package/src/brand-page/models/navigation-styles.model.ts +26 -9
- package/src/brand-page/models/payment.model.ts +15 -6
- package/src/brand-page/models/styles.model.test.ts +104 -0
- package/src/brand-page/models/styles.model.ts +181 -47
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +619 -115
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +150 -9
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +300 -18
- package/src/brand-page/utils/color-palette.util.test.ts +126 -1
- package/src/brand-page/utils/color-palette.util.ts +92 -26
- package/src/brand-page/utils/color.util.test.ts +62 -29
- package/src/brand-page/utils/color.util.ts +77 -14
- package/src/brand-page/utils/container-text-color.util.test.ts +672 -26
- package/src/brand-page/utils/container-text-color.util.ts +472 -46
- package/src/brand-page/utils/index.ts +1 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/edited-brandsite-sections.v22.json +1191 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandcontact-every-section.v22.json +2026 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandpage-every-section.v22.json +2017 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandsite-every-section.v22.json +2031 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandcontact.v22.json +1145 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-general-link.v22.json +645 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-links.v22.json +1136 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-social-links.v22.json +662 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-about.v22.json +638 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-footer.v22.json +610 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-header-banner.v22.json +660 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-sections.v22.json +1132 -0
- package/src/brand-page/utils/migration/migration-01.ts +293 -237
- package/src/brand-page/utils/migration/migration-02.ts +8 -1
- package/src/brand-page/utils/migration/migration-20.ts +6 -3
- package/src/brand-page/utils/migration/migration-20_5.test.ts +5 -2
- package/src/brand-page/utils/migration/migration-21.test.ts +34 -0
- package/src/brand-page/utils/migration/migration-21.ts +46 -10
- package/src/brand-page/utils/migration/migration-22.fixed-input.test.ts +43 -0
- package/src/brand-page/utils/migration/migration-22.test.ts +4103 -0
- package/src/brand-page/utils/migration/migration-22.text-font-family.test.ts +72 -0
- package/src/brand-page/utils/migration/migration-22.ts +1336 -0
- package/src/brand-page/utils/migration.util.test.ts +146 -32
- package/src/brand-page/utils/migration.util.ts +18 -0
- package/src/brand-page/utils/model.util.ts +4 -0
- package/src/brand-page/utils/personalisation.util.test.ts +148 -3
- package/src/brand-page/utils/personalisation.util.ts +9 -1
- package/src/brand-page/utils/rte-role-lift.util.ts +409 -0
- package/src/brand-page/utils/style.util.test.ts +35 -2
- package/src/brand-page/utils/style.util.ts +45 -11
- package/src/brand-page/utils/text-role-css.util.test.ts +525 -0
- package/src/brand-page/utils/text-role-css.util.ts +321 -0
- package/src/brand-page/utils/text-role-reconnect.util.test.ts +604 -0
- package/src/brand-page/utils/text-role-reconnect.util.ts +727 -0
- package/src/brand-page/utils/text-style.util.test.ts +305 -0
- package/src/brand-page/utils/text-style.util.ts +198 -24
- package/src/brand-page/utils/view-model.page-data.test.ts +232 -0
- package/src/brand-page/utils/view-model.util.test.ts +954 -133
- package/src/brand-page/utils/view-model.util.ts +187 -139
- package/src/brand-page/view-models.ts +4 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.blank-site.test.ts +57 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +9 -5
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -10
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.ts +0 -1
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -44
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +253 -200
- package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +1 -0
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +1 -0
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +1 -0
- package/src/brand-page-maker/composables/rich-text-editor/block-typography.test.ts +519 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/MaxLength.test.ts +26 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.test.ts +110 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.ts +99 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.ts +397 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/ViewDomParser.test.ts +139 -0
- package/src/brand-page-maker/composables/rich-text-editor/font.ts +36 -5
- package/src/brand-page-maker/composables/rich-text-editor/formatting.test.ts +375 -1
- package/src/brand-page-maker/composables/rich-text-editor/formatting.ts +301 -17
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.test.ts +82 -1
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +28 -34
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.test.ts +80 -0
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.ts +75 -0
- package/src/brand-page-maker/composables/rich-text-editor/spacing.ts +31 -6
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.test.ts +2485 -0
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +435 -337
- package/src/brand-page-maker/constants/config-settings-constant.ts +0 -6
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.test.ts +43 -0
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.ts +6 -2
- package/src/brand-page-maker/convertors/text-size-value.convertor.test.ts +24 -0
- package/src/brand-page-maker/convertors/text-size-value.convertor.ts +17 -13
- package/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.ts +7 -22
- package/src/brand-page-maker/default-getters/text-color.default-getter.ts +5 -21
- package/src/brand-page-maker/models/content-settings.test.ts +708 -0
- package/src/brand-page-maker/models/content-settings.ts +133 -82
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.test.ts +63 -1
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.ts +16 -3
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.test.ts +34 -0
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.ts +4 -2
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +185 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +22 -34
- package/src/brand-page-maker/stores/history/history-store.ts +35 -2
- package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +528 -0
- package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +12 -0
- package/src/brand-page-maker/utils/apply-color-strategy.golden.test.ts +2 -0
- package/src/brand-page-maker/utils/apply-color-strategy.test.ts +181 -3
- package/src/brand-page-maker/utils/apply-color-strategy.ts +36 -4
- package/src/brand-page-maker/utils/index.ts +2 -1
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +447 -410
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +610 -506
- package/src/brand-page-maker/utils/rte-authoring.util.test.ts +244 -0
- package/src/brand-page-maker/utils/rte-authoring.util.ts +175 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.test.ts +558 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.ts +473 -0
- package/src/brand-page-maker/utils/rte-features.test.ts +99 -3
- package/src/brand-page-maker/utils/rte-render-parity.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-render.util.test.ts +230 -0
- package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-sanitize.util.ts +14 -3
- package/src/brand-page-maker/utils/rte-schema-version.test.ts +102 -0
- package/src/bundles/bundled-translations.de-DE.json +21 -2
- package/src/bundles/bundled-translations.es-ES.json +21 -2
- package/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/src/bundles/bundled-translations.json +21 -2
- package/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/src/clients/ai-assistant-client.ts +1 -0
- package/src/composables/useTranslate.ts +2 -1
- package/src/lib.ts +2 -2
- package/src/metadata-builder/builders/footer-builder.test.ts +70 -45
- package/src/metadata-builder/builders/footer-builder.ts +4 -8
- package/src/metadata-builder/builders/global-role-propagation.test.ts +907 -0
- package/src/metadata-builder/builders/global-role-propagation.ts +430 -0
- package/src/metadata-builder/builders/global-styles-builder.test.ts +1020 -0
- package/src/metadata-builder/builders/global-styles-builder.ts +194 -48
- package/src/metadata-builder/builders/header-builder.test.ts +112 -40
- package/src/metadata-builder/builders/header-builder.ts +18 -8
- package/src/metadata-builder/builders/section-builders/about-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +7 -4
- package/src/metadata-builder/builders/section-builders/images-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +7 -7
- package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +2 -2
- package/src/metadata-builder/builders/section-builders/social-links-builder.ts +21 -10
- package/src/metadata-builder/builders/section-builders/support-me-builder.test.ts +10 -0
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +111 -61
- package/src/metadata-builder/builders/section-field-maps.ts +1 -0
- package/src/metadata-builder/builders/section-field-utils.test.ts +545 -2
- package/src/metadata-builder/builders/section-field-utils.ts +202 -69
- package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +38 -13
- package/src/metadata-builder/builders/section-rules/social-links.rules.ts +5 -0
- package/src/metadata-builder/helpers/rte.helpers.test.ts +101 -0
- package/src/metadata-builder/helpers/rte.helpers.ts +129 -43
- package/src/metadata-builder/metadata-executor.test.ts +167 -0
- package/src/metadata-builder/metadata-executor.ts +34 -1
- package/src/metadata-builder/models.ts +2 -0
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +23 -7
- package/src/metadata-builder/parsers/section-tool-arguments.ts +21 -1
- package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +215 -0
- package/src/metadata-builder/sanitizers/rte-schema-check.ts +1 -1
- package/src/metadata-builder/sanitizers/sanitizer-rules.ts +4 -8
- package/src/metadata-builder/sanitizers/section-args-validator.ts +136 -53
- package/src/shared/color-palette/section-color-matches.test.ts +15 -11
- package/src/shared/color-palette/section-color-matches.ts +9 -28
- package/src/shared/color-strategies/color-strategies.ts +35 -0
- package/src/shared/color-strategies/rte-color.test.ts +1 -1
- package/src/shared/color-strategies/rte-color.ts +19 -0
- package/src/shared/color-strategies/rte-field-pairs.test.ts +26 -5
- package/src/shared/color-strategies/rte-field-pairs.ts +33 -0
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.test.ts +43 -66
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.vue +7 -1
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -48
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +33 -7
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.test.ts +128 -1
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -0
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSlider.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSliderField.vue +1 -0
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +1 -0
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.test.ts +56 -3
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +11 -4
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.test.ts +335 -25
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +248 -70
- package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +113 -25
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.de-DE.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.es-ES.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-CA.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-FR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.json +8 -1
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-BR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-PT.json +17 -10
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.test.ts +141 -0
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.vue +136 -0
- package/src/shared/content-settings/store/content-settings-store.test.ts +491 -6
- package/src/shared/content-settings/store/content-settings-store.ts +159 -17
- package/src/shared/logo-settings/components/EditLogoSettings.vue +1 -0
- package/src/shared/logo-settings/components/LogoVariations.vue +1 -0
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +1 -0
- package/src/shared/navigation-style-settings/store/index.test.ts +295 -0
- package/src/shared/navigation-style-settings/store/index.ts +65 -15
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +2 -0
- package/src/shared/page-settings/components/page-settings/PageElement.vue +1 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +44 -4
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +13 -4
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.navigation.test.ts +89 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.text-style.test.ts +91 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +14 -2
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.vue +2 -0
- package/src/shared/page-settings/store/page-settings-store.text-style.test.ts +84 -0
- package/src/shared/page-settings/store/page-settings-store.ts +30 -1
- package/src/shared/rte-extensions/AutoLink.test.ts +98 -0
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.ts +87 -58
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.ts +4 -1
- package/src/shared/rte-extensions/TextEffects.ts +151 -0
- package/src/shared/rte-extensions/ViewDomParser.ts +27 -0
- package/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.ts → shared/rte-extensions.util.ts} +66 -9
- package/src/shared/rte-link.util.ts +2 -0
- package/src/shared/rte-render.util.ts +385 -0
- package/src/shared/rte-shape.util.ts +29 -0
- package/src/shared/side-bar/store/side-bar-store.test.ts +27 -1
- package/src/shared/side-bar/store/side-bar-store.ts +11 -0
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +7 -3
- package/src/shared/style-settings/components/StyleSettings.test.ts +116 -0
- package/src/shared/style-settings/components/StyleSettings.vue +75 -25
- package/src/shared/style-settings/components/i18n/style-settings.de-DE.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.es-ES.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-CA.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-FR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.json +13 -3
- package/src/shared/style-settings/components/i18n/style-settings.pt-BR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.pt-PT.json +32 -20
- package/src/shared/style-settings/components/text-style-options-settings-with-state/TextStyleOptionsSettingsWithState.vue +14 -34
- package/src/shared/style-settings/store/style-settings-store.ts +3 -49
- package/src/shared/style-settings/text-style-size-order.test.ts +76 -0
- package/src/shared/style-settings/text-style-size-order.ts +28 -0
- package/src/shared/template-settings/components/TemplatesSettings.vue +4 -0
- package/src/shared/text-role-typography.util.ts +277 -0
- package/src/utils/minify-brand-page-metadata.test.ts +102 -7
- package/src/utils/minify-brand-page-metadata.ts +62 -8
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/AutoLink.d.ts +0 -2
- package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
- package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -63
- package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -106
- package/lib/src/brand-page-maker/utils/rte-shape.d.ts +0 -18
- package/lib/src/brand-page-maker/utils/rte-shape.js +0 -21
- package/lib/src/metadata-builder/builders/global-font-propagation.d.ts +0 -41
- package/lib/src/metadata-builder/builders/global-font-propagation.js +0 -146
- package/src/brand-page-maker/utils/rte-render.util.ts +0 -179
- package/src/brand-page-maker/utils/rte-shape.ts +0 -29
- package/src/metadata-builder/builders/global-font-propagation.test.ts +0 -401
- package/src/metadata-builder/builders/global-font-propagation.ts +0 -238
- package/src/shared/style-settings/components/StyleSettingsSection.vue +0 -8
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.d.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.ts +0 -0
|
@@ -0,0 +1,907 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import type { BrandPageModel, Content } from '../../brand-page/models';
|
|
3
|
+
import type { UpdateGlobalStylesArguments } from '../parsers/ai-toolcall-parser';
|
|
4
|
+
import { BUILDER_TYPES } from '../models';
|
|
5
|
+
import { GlobalStylesBuilder } from './global-styles-builder';
|
|
6
|
+
import {
|
|
7
|
+
collectChangedRoleProps,
|
|
8
|
+
propagateRolePropsToContents,
|
|
9
|
+
relinkRoleChangedMarks,
|
|
10
|
+
type ChangedRoleProps,
|
|
11
|
+
} from './global-role-propagation';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* BP-5969 R12/R16 — a site-wide role change relinks every literal of the changed property to its
|
|
15
|
+
* `var(--role-…)` ref, accent words included, across page contents, the header and the footer;
|
|
16
|
+
* `keepRuns` is the one named exception. Reworked from BP-5780's global-font-propagation.test.ts,
|
|
17
|
+
* whose category-based (titles/headings/paragraphs/buttons) fixtures no longer apply — resolution
|
|
18
|
+
* is now solely by each field's own `textStyleType` (the 10 canonical roles).
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const roleMark = (attrs: Record<string, unknown>) => ({
|
|
22
|
+
type: 'textStyle',
|
|
23
|
+
attrs,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const rteDoc = (runs: { text: string; marks?: unknown[] }[]) => ({
|
|
27
|
+
type: 'doc',
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'paragraph',
|
|
31
|
+
content: runs.map((r) => ({
|
|
32
|
+
type: 'text',
|
|
33
|
+
text: r.text,
|
|
34
|
+
...(r.marks ? { marks: r.marks } : {}),
|
|
35
|
+
})),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// First run's textStyle mark attrs, for terse assertions.
|
|
41
|
+
const firstMarkAttrs = (
|
|
42
|
+
doc: unknown,
|
|
43
|
+
runIndex = 0,
|
|
44
|
+
): Record<string, unknown> | undefined =>
|
|
45
|
+
(
|
|
46
|
+
(
|
|
47
|
+
doc as {
|
|
48
|
+
content: {
|
|
49
|
+
content: {
|
|
50
|
+
marks?: { type: string; attrs?: Record<string, unknown> }[];
|
|
51
|
+
}[];
|
|
52
|
+
}[];
|
|
53
|
+
}
|
|
54
|
+
).content[0].content[runIndex]?.marks ?? []
|
|
55
|
+
).find((m) => m.type === 'textStyle')?.attrs;
|
|
56
|
+
|
|
57
|
+
const makeModel = (
|
|
58
|
+
contents: Partial<Content>[],
|
|
59
|
+
extra: Partial<BrandPageModel> = {},
|
|
60
|
+
): BrandPageModel =>
|
|
61
|
+
({
|
|
62
|
+
styles: { textStyles: { textStyleOptions: {} } },
|
|
63
|
+
pages: [{ id: 'p1', contents }],
|
|
64
|
+
...extra,
|
|
65
|
+
}) as unknown as BrandPageModel;
|
|
66
|
+
|
|
67
|
+
describe('collectChangedRoleProps', () => {
|
|
68
|
+
it('extracts the 4 baked properties per changed canonical role', () => {
|
|
69
|
+
const changed = collectChangedRoleProps({
|
|
70
|
+
heading3: { style: { fontFamily: 'Oswald', fontSize: '3em' } },
|
|
71
|
+
paragraph1: { style: { color: '#ff0000' } }, // colour is not propagated (out of scope)
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
expect(changed).toEqual({
|
|
75
|
+
heading3: { fontFamily: 'Oswald', fontSize: '3em' },
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('returns empty for no textStyleOptions, or none of the 4 properties set', () => {
|
|
80
|
+
expect(collectChangedRoleProps(undefined)).toEqual({});
|
|
81
|
+
expect(
|
|
82
|
+
collectChangedRoleProps({ heading3: { style: { color: '#000' } } }),
|
|
83
|
+
).toEqual({});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('does not treat a full-patch value equal to the stored role as changed', () => {
|
|
87
|
+
const changed = collectChangedRoleProps(
|
|
88
|
+
{
|
|
89
|
+
heading3: {
|
|
90
|
+
style: { fontFamily: 'Lato', fontSize: '3em', lineHeight: '1.5' },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
heading3: {
|
|
95
|
+
style: { fontFamily: 'Lato', fontSize: '3em', lineHeight: '1.4' },
|
|
96
|
+
},
|
|
97
|
+
} as any,
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
expect(changed).toEqual({ heading3: { lineHeight: '1.5' } });
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('normalizes whitespace and neutral empty values before comparing', () => {
|
|
104
|
+
expect(
|
|
105
|
+
collectChangedRoleProps(
|
|
106
|
+
{ heading3: { style: { fontFamily: ' Lato ' } } },
|
|
107
|
+
{ heading3: { style: { fontFamily: 'Lato' } } } as any,
|
|
108
|
+
),
|
|
109
|
+
).toEqual({});
|
|
110
|
+
|
|
111
|
+
expect(
|
|
112
|
+
collectChangedRoleProps({ heading3: { style: { letterSpacing: '' } } }, {
|
|
113
|
+
heading3: { style: { letterSpacing: 'normal' } },
|
|
114
|
+
} as any),
|
|
115
|
+
).toEqual({});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('treats the same value written differently as unchanged', () => {
|
|
119
|
+
expect(
|
|
120
|
+
collectChangedRoleProps(
|
|
121
|
+
{
|
|
122
|
+
heading3: {
|
|
123
|
+
style: {
|
|
124
|
+
fontFamily: '"Exo 2"',
|
|
125
|
+
fontSize: '3.0em',
|
|
126
|
+
lineHeight: '1.50',
|
|
127
|
+
letterSpacing: '.1EM',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
heading3: {
|
|
133
|
+
style: {
|
|
134
|
+
fontFamily: 'Exo 2',
|
|
135
|
+
fontSize: '3em',
|
|
136
|
+
lineHeight: '1.5',
|
|
137
|
+
letterSpacing: '0.1em',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
} as any,
|
|
141
|
+
),
|
|
142
|
+
).toEqual({});
|
|
143
|
+
|
|
144
|
+
expect(
|
|
145
|
+
collectChangedRoleProps({ heading3: { style: { fontSize: '3.5em' } } }, {
|
|
146
|
+
heading3: { style: { fontSize: '3em' } },
|
|
147
|
+
} as any),
|
|
148
|
+
).toEqual({ heading3: { fontSize: '3.5em' } });
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
describe('propagateRolePropsToContents', () => {
|
|
153
|
+
it('relinks literals: a family literal becomes the ref; an existing ref is untouched; a different role is left alone', () => {
|
|
154
|
+
const titleA = rteDoc([
|
|
155
|
+
{ text: 'Title A', marks: [roleMark({ fontFamily: 'Georgia' })] },
|
|
156
|
+
]);
|
|
157
|
+
const titleB = rteDoc([
|
|
158
|
+
{
|
|
159
|
+
text: 'Title B',
|
|
160
|
+
marks: [roleMark({ fontFamily: 'var(--role-font-family)' })],
|
|
161
|
+
},
|
|
162
|
+
]);
|
|
163
|
+
const contentA = {
|
|
164
|
+
id: 'c1',
|
|
165
|
+
type: 'banner-section',
|
|
166
|
+
title: titleA,
|
|
167
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
168
|
+
} as unknown as Content;
|
|
169
|
+
const contentB = {
|
|
170
|
+
id: 'c2',
|
|
171
|
+
type: 'banner-section',
|
|
172
|
+
title: titleB,
|
|
173
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
174
|
+
} as unknown as Content;
|
|
175
|
+
const contentPara = {
|
|
176
|
+
id: 'c3',
|
|
177
|
+
type: 'about-section',
|
|
178
|
+
description: rteDoc([
|
|
179
|
+
{ text: 'Body copy', marks: [roleMark({ fontFamily: 'Georgia' })] },
|
|
180
|
+
]),
|
|
181
|
+
descriptionStyle: { textStyleType: 'paragraph1' },
|
|
182
|
+
} as unknown as Content;
|
|
183
|
+
const model = makeModel([contentA, contentB, contentPara]);
|
|
184
|
+
|
|
185
|
+
propagateRolePropsToContents(model, { heading3: { fontFamily: 'Oswald' } });
|
|
186
|
+
|
|
187
|
+
const [a, b, p] = model.pages[0].contents as unknown as Record<
|
|
188
|
+
string,
|
|
189
|
+
unknown
|
|
190
|
+
>[];
|
|
191
|
+
|
|
192
|
+
expect(firstMarkAttrs(a.title)?.fontFamily).toBe('var(--role-font-family)');
|
|
193
|
+
expect(firstMarkAttrs(b.title)?.fontFamily).toBe('var(--role-font-family)');
|
|
194
|
+
expect(firstMarkAttrs(p.description)?.fontFamily).toBe('Georgia');
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('any property: a fontSize change relinks RTE literals and drops a non-RTE style override', () => {
|
|
198
|
+
const title = rteDoc([
|
|
199
|
+
{ text: 'Big Heading', marks: [roleMark({ fontSize: '3em' })] },
|
|
200
|
+
]);
|
|
201
|
+
const rteContent = {
|
|
202
|
+
id: 'c1',
|
|
203
|
+
type: 'banner-section',
|
|
204
|
+
title,
|
|
205
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
206
|
+
} as unknown as Content;
|
|
207
|
+
const plainContent = {
|
|
208
|
+
id: 'c2',
|
|
209
|
+
type: 'testimonial-section',
|
|
210
|
+
name: 'Jane Doe',
|
|
211
|
+
nameStyle: { textStyleType: 'heading3', fontSize: '3em' },
|
|
212
|
+
} as unknown as Content;
|
|
213
|
+
const model = makeModel([rteContent, plainContent]);
|
|
214
|
+
|
|
215
|
+
propagateRolePropsToContents(model, { heading3: { fontSize: '4em' } });
|
|
216
|
+
|
|
217
|
+
const [rte, plain] = model.pages[0].contents as unknown as Record<
|
|
218
|
+
string,
|
|
219
|
+
unknown
|
|
220
|
+
>[];
|
|
221
|
+
|
|
222
|
+
expect(firstMarkAttrs(rte.title)?.fontSize).toBe('var(--role-font-size)');
|
|
223
|
+
expect(
|
|
224
|
+
(plain.nameStyle as Record<string, unknown>).fontSize,
|
|
225
|
+
).toBeUndefined();
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('accent rewritten: an accent word carrying a deliberately different literal family also relinks', () => {
|
|
229
|
+
const title = rteDoc([
|
|
230
|
+
{ text: 'Welcome to ', marks: [roleMark({ fontFamily: 'Oswald' })] },
|
|
231
|
+
{ text: 'Bloom', marks: [roleMark({ fontFamily: 'Pacifico' })] },
|
|
232
|
+
]);
|
|
233
|
+
const content = {
|
|
234
|
+
id: 'c1',
|
|
235
|
+
type: 'banner-section',
|
|
236
|
+
title,
|
|
237
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
238
|
+
} as unknown as Content;
|
|
239
|
+
const model = makeModel([content]);
|
|
240
|
+
|
|
241
|
+
propagateRolePropsToContents(model, { heading3: { fontFamily: 'Oswald' } });
|
|
242
|
+
|
|
243
|
+
const runs = (
|
|
244
|
+
model.pages[0].contents[0] as unknown as Record<string, unknown>
|
|
245
|
+
).title;
|
|
246
|
+
|
|
247
|
+
expect(firstMarkAttrs(runs, 0)?.fontFamily).toBe('var(--role-font-family)');
|
|
248
|
+
expect(firstMarkAttrs(runs, 1)?.fontFamily).toBe('var(--role-font-family)');
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it('keepRuns: a named run keeps its literal; every other run of the changed role/property still relinks', () => {
|
|
252
|
+
const title = rteDoc([
|
|
253
|
+
{ text: 'The best ', marks: [roleMark({ fontFamily: 'Georgia' })] },
|
|
254
|
+
{ text: 'Taste', marks: [roleMark({ fontFamily: 'Pacifico' })] },
|
|
255
|
+
{ text: ' in town', marks: [roleMark({ fontFamily: 'Georgia' })] },
|
|
256
|
+
]);
|
|
257
|
+
const content = {
|
|
258
|
+
id: 'c1',
|
|
259
|
+
type: 'banner-section',
|
|
260
|
+
title,
|
|
261
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
262
|
+
} as unknown as Content;
|
|
263
|
+
const model = makeModel([content]);
|
|
264
|
+
|
|
265
|
+
propagateRolePropsToContents(
|
|
266
|
+
model,
|
|
267
|
+
{ heading3: { fontFamily: 'Oswald' } },
|
|
268
|
+
['Taste'],
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
const runs = (
|
|
272
|
+
model.pages[0].contents[0] as unknown as Record<string, unknown>
|
|
273
|
+
).title;
|
|
274
|
+
|
|
275
|
+
expect(firstMarkAttrs(runs, 0)?.fontFamily).toBe('var(--role-font-family)');
|
|
276
|
+
expect(firstMarkAttrs(runs, 1)?.fontFamily).toBe('Pacifico');
|
|
277
|
+
expect(firstMarkAttrs(runs, 2)?.fontFamily).toBe('var(--role-font-family)');
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it('header footer: a paragraph1 family change relinks desktop/mobile nav and footer copyright', () => {
|
|
281
|
+
const pageHeaderDesktop = {
|
|
282
|
+
navigation: {
|
|
283
|
+
defaultButtonStyle: {
|
|
284
|
+
textStyleType: 'paragraph1',
|
|
285
|
+
fontFamily: 'Georgia',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
const pageHeaderMobile = {
|
|
290
|
+
navigation: {
|
|
291
|
+
defaultButtonStyle: {
|
|
292
|
+
textStyleType: 'paragraph1',
|
|
293
|
+
fontFamily: 'Georgia',
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
const pageFooterDesktop = {
|
|
298
|
+
copyrightText: 'All rights reserved',
|
|
299
|
+
copyrightStyle: { textStyleType: 'paragraph1', fontFamily: 'Georgia' },
|
|
300
|
+
};
|
|
301
|
+
const pageFooterMobile = {
|
|
302
|
+
copyrightText: 'All rights reserved',
|
|
303
|
+
copyrightStyle: { textStyleType: 'paragraph1', fontFamily: 'Georgia' },
|
|
304
|
+
};
|
|
305
|
+
const model = makeModel([], {
|
|
306
|
+
pageHeaderDesktop,
|
|
307
|
+
pageHeaderMobile,
|
|
308
|
+
pageFooterDesktop,
|
|
309
|
+
pageFooterMobile,
|
|
310
|
+
} as unknown as Partial<BrandPageModel>);
|
|
311
|
+
|
|
312
|
+
propagateRolePropsToContents(model, {
|
|
313
|
+
paragraph1: { fontFamily: 'Inter' },
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
const buttonStyle = (header: unknown): Record<string, unknown> =>
|
|
317
|
+
(
|
|
318
|
+
header as {
|
|
319
|
+
navigation: { defaultButtonStyle: Record<string, unknown> };
|
|
320
|
+
}
|
|
321
|
+
).navigation.defaultButtonStyle;
|
|
322
|
+
const copyrightStyle = (footer: unknown): Record<string, unknown> =>
|
|
323
|
+
(footer as { copyrightStyle: Record<string, unknown> }).copyrightStyle;
|
|
324
|
+
|
|
325
|
+
expect(buttonStyle(model.pageHeaderDesktop).fontFamily).toBeUndefined();
|
|
326
|
+
expect(buttonStyle(model.pageHeaderMobile).fontFamily).toBeUndefined();
|
|
327
|
+
expect(copyrightStyle(model.pageFooterDesktop).fontFamily).toBeUndefined();
|
|
328
|
+
expect(copyrightStyle(model.pageFooterMobile).fontFamily).toBeUndefined();
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it('hamburger selected link follows its default sibling: a button role change drops the family override on both (T12.6)', () => {
|
|
332
|
+
// The selected style carries NO role of its own (the plan's fixture, B4): no maker path sets
|
|
333
|
+
// one, no migration adds one, so stored data looks exactly like this — the sibling-drop in
|
|
334
|
+
// walkRecord is what has to reach it, not a `textStyleType` match of its own.
|
|
335
|
+
const pageHeaderDesktop = {
|
|
336
|
+
navigation: {
|
|
337
|
+
hamburgerMenuStyle: {
|
|
338
|
+
defaultButtonStyle: { textStyleType: 'button', fontFamily: 'Oswald' },
|
|
339
|
+
selectedButtonStyle: { fontFamily: 'Oswald' },
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
const model = makeModel([], {
|
|
344
|
+
pageHeaderDesktop,
|
|
345
|
+
} as unknown as Partial<BrandPageModel>);
|
|
346
|
+
|
|
347
|
+
propagateRolePropsToContents(model, { button: { fontFamily: 'Inter' } });
|
|
348
|
+
|
|
349
|
+
const menu = (
|
|
350
|
+
model.pageHeaderDesktop as unknown as {
|
|
351
|
+
navigation: { hamburgerMenuStyle: Record<string, unknown> };
|
|
352
|
+
}
|
|
353
|
+
).navigation.hamburgerMenuStyle as Record<string, Record<string, unknown>>;
|
|
354
|
+
|
|
355
|
+
expect(menu.defaultButtonStyle.fontFamily).toBeUndefined();
|
|
356
|
+
expect(menu.selectedButtonStyle.fontFamily).toBeUndefined();
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
it('walks item arrays', () => {
|
|
360
|
+
const content = {
|
|
361
|
+
id: 'c1',
|
|
362
|
+
type: 'testimonial-section',
|
|
363
|
+
items: [
|
|
364
|
+
{
|
|
365
|
+
testimonial: rteDoc([
|
|
366
|
+
{
|
|
367
|
+
text: 'Great service',
|
|
368
|
+
marks: [roleMark({ fontFamily: 'Georgia' })],
|
|
369
|
+
},
|
|
370
|
+
]),
|
|
371
|
+
testimonialStyle: { textStyleType: 'paragraph2' },
|
|
372
|
+
},
|
|
373
|
+
],
|
|
374
|
+
} as unknown as Content;
|
|
375
|
+
const model = makeModel([content]);
|
|
376
|
+
|
|
377
|
+
propagateRolePropsToContents(model, {
|
|
378
|
+
paragraph2: { fontFamily: 'Inter' },
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
const item = (
|
|
382
|
+
model.pages[0].contents[0] as unknown as Record<string, unknown>
|
|
383
|
+
).items as Record<string, unknown>[];
|
|
384
|
+
|
|
385
|
+
expect(firstMarkAttrs(item[0].testimonial)?.fontFamily).toBe(
|
|
386
|
+
'var(--role-font-family)',
|
|
387
|
+
);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it('legacy HTML string fields still relink via the injected editor rewrite', () => {
|
|
391
|
+
const html = '<p><span style="font-family: Georgia">Bloom</span></p>';
|
|
392
|
+
const content = {
|
|
393
|
+
id: 'c1',
|
|
394
|
+
type: 'about-section',
|
|
395
|
+
title: html,
|
|
396
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
397
|
+
} as unknown as Content;
|
|
398
|
+
const model = makeModel([content]);
|
|
399
|
+
const calls: [
|
|
400
|
+
string,
|
|
401
|
+
Record<string, unknown>,
|
|
402
|
+
readonly string[] | undefined,
|
|
403
|
+
][] = [];
|
|
404
|
+
|
|
405
|
+
propagateRolePropsToContents(
|
|
406
|
+
model,
|
|
407
|
+
{ heading3: { fontFamily: 'Oswald' } },
|
|
408
|
+
undefined,
|
|
409
|
+
(text, refs, keepRuns) => {
|
|
410
|
+
calls.push([text, refs, keepRuns]);
|
|
411
|
+
|
|
412
|
+
return `${text}::relinked`;
|
|
413
|
+
},
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
expect(calls).toEqual([
|
|
417
|
+
[html, { fontFamily: 'var(--role-font-family)' }, undefined],
|
|
418
|
+
]);
|
|
419
|
+
expect(
|
|
420
|
+
(model.pages[0].contents[0] as unknown as Record<string, unknown>).title,
|
|
421
|
+
).toBe(`${html}::relinked`);
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
it('passes a kept word inside a legacy HTML field to the HTML rewriter', () => {
|
|
425
|
+
const html = '<p>Keep this <span>Taste</span> but restyle the rest</p>';
|
|
426
|
+
const content = {
|
|
427
|
+
id: 'c1',
|
|
428
|
+
type: 'about-section',
|
|
429
|
+
title: html,
|
|
430
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
431
|
+
} as unknown as Content;
|
|
432
|
+
const model = makeModel([content]);
|
|
433
|
+
const calls: { keepRuns?: readonly string[] }[] = [];
|
|
434
|
+
|
|
435
|
+
propagateRolePropsToContents(
|
|
436
|
+
model,
|
|
437
|
+
{ heading3: { fontFamily: 'Oswald' } },
|
|
438
|
+
['Taste'],
|
|
439
|
+
(_text, _refs, keepRuns) => {
|
|
440
|
+
calls.push({ keepRuns });
|
|
441
|
+
|
|
442
|
+
return html;
|
|
443
|
+
},
|
|
444
|
+
);
|
|
445
|
+
|
|
446
|
+
expect(calls).toEqual([{ keepRuns: ['Taste'] }]);
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
it('does nothing when no role/property changed', () => {
|
|
450
|
+
const content = {
|
|
451
|
+
id: 'c1',
|
|
452
|
+
type: 'banner-section',
|
|
453
|
+
title: rteDoc([
|
|
454
|
+
{ text: 'X', marks: [roleMark({ fontFamily: 'Georgia' })] },
|
|
455
|
+
]),
|
|
456
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
457
|
+
} as unknown as Content;
|
|
458
|
+
const model = makeModel([content]);
|
|
459
|
+
const before = JSON.stringify(model);
|
|
460
|
+
|
|
461
|
+
propagateRolePropsToContents(model, {} as ChangedRoleProps);
|
|
462
|
+
|
|
463
|
+
expect(JSON.stringify(model)).toBe(before);
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
// A representative style-options fixture: every canonical + legacy role present, needed by
|
|
468
|
+
// GlobalStylesBuilder.buildAsync's merge guard (`if (!existing) continue`).
|
|
469
|
+
const fullRoleOptionsFixture = (): Record<
|
|
470
|
+
string,
|
|
471
|
+
{ style: Record<string, unknown>; isModified: boolean }
|
|
472
|
+
> =>
|
|
473
|
+
Object.fromEntries(
|
|
474
|
+
[
|
|
475
|
+
'heading1',
|
|
476
|
+
'heading2',
|
|
477
|
+
'heading3',
|
|
478
|
+
'heading4',
|
|
479
|
+
'heading5',
|
|
480
|
+
'heading6',
|
|
481
|
+
'paragraph1',
|
|
482
|
+
'paragraph2',
|
|
483
|
+
'paragraph3',
|
|
484
|
+
'button',
|
|
485
|
+
'titles',
|
|
486
|
+
'headings',
|
|
487
|
+
'paragraphs',
|
|
488
|
+
'buttons',
|
|
489
|
+
].map((role) => [
|
|
490
|
+
role,
|
|
491
|
+
{ style: { fontFamily: 'Lato' }, isModified: false },
|
|
492
|
+
]),
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
describe('GlobalStylesBuilder — role propagation wiring (retired successor, T12.5)', () => {
|
|
496
|
+
it('keeps an accent override when a colour-only call re-sends its role font size unchanged', async () => {
|
|
497
|
+
const model = {
|
|
498
|
+
styles: {
|
|
499
|
+
textStyles: {
|
|
500
|
+
textStyleOptions: {
|
|
501
|
+
heading3: { style: { fontSize: '3em' }, isModified: false },
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
buttonStyles: { style: {} },
|
|
505
|
+
backgroundStyles: { style: {} },
|
|
506
|
+
},
|
|
507
|
+
pages: [
|
|
508
|
+
{
|
|
509
|
+
id: 'p1',
|
|
510
|
+
contents: [
|
|
511
|
+
{
|
|
512
|
+
id: 'c1',
|
|
513
|
+
type: 'banner-section',
|
|
514
|
+
title: rteDoc([
|
|
515
|
+
{ text: 'Accent', marks: [roleMark({ fontSize: '4em' })] },
|
|
516
|
+
]),
|
|
517
|
+
titleStyle: { textStyleType: 'heading3' },
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
},
|
|
521
|
+
],
|
|
522
|
+
} as unknown as BrandPageModel;
|
|
523
|
+
|
|
524
|
+
const builder = new GlobalStylesBuilder({
|
|
525
|
+
id: 'g1',
|
|
526
|
+
type: BUILDER_TYPES.UPDATE_GLOBAL_STYLES,
|
|
527
|
+
payload: {
|
|
528
|
+
buttonStyles: { style: { backgroundColor: '#222222' } },
|
|
529
|
+
textStyles: {
|
|
530
|
+
textStyleOptions: { heading3: { style: { fontSize: '3em' } } },
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
const { model: result } = await builder.buildAsync(model);
|
|
536
|
+
const content = result.pages[0].contents[0] as unknown as Record<
|
|
537
|
+
string,
|
|
538
|
+
unknown
|
|
539
|
+
>;
|
|
540
|
+
|
|
541
|
+
expect(firstMarkAttrs(content.title)?.fontSize).toBe('4em');
|
|
542
|
+
expect(result.styles.buttonStyles.style.backgroundColor).toBe('#222222');
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
it('a retired "headings" family change propagates to every heading2–heading6-linked field', async () => {
|
|
546
|
+
const content2 = {
|
|
547
|
+
id: 'c2',
|
|
548
|
+
type: 'banner-section',
|
|
549
|
+
title: rteDoc([
|
|
550
|
+
{ text: 'H2', marks: [roleMark({ fontFamily: 'Georgia' })] },
|
|
551
|
+
]),
|
|
552
|
+
titleStyle: { textStyleType: 'heading2' },
|
|
553
|
+
} as unknown as Content;
|
|
554
|
+
const content5 = {
|
|
555
|
+
id: 'c5',
|
|
556
|
+
type: 'banner-section',
|
|
557
|
+
title: rteDoc([
|
|
558
|
+
{ text: 'H5', marks: [roleMark({ fontFamily: 'Georgia' })] },
|
|
559
|
+
]),
|
|
560
|
+
titleStyle: { textStyleType: 'heading5' },
|
|
561
|
+
} as unknown as Content;
|
|
562
|
+
const model = {
|
|
563
|
+
styles: {
|
|
564
|
+
textStyles: { textStyleOptions: fullRoleOptionsFixture() },
|
|
565
|
+
buttonStyles: { style: {} },
|
|
566
|
+
backgroundStyles: { style: {} },
|
|
567
|
+
},
|
|
568
|
+
pages: [{ id: 'p1', contents: [content2, content5] }],
|
|
569
|
+
} as unknown as BrandPageModel;
|
|
570
|
+
|
|
571
|
+
const builder = new GlobalStylesBuilder({
|
|
572
|
+
id: 'g1',
|
|
573
|
+
type: BUILDER_TYPES.UPDATE_GLOBAL_STYLES,
|
|
574
|
+
payload: {
|
|
575
|
+
textStyles: {
|
|
576
|
+
textStyleOptions: { headings: { style: { fontFamily: 'Oswald' } } },
|
|
577
|
+
},
|
|
578
|
+
} as UpdateGlobalStylesArguments,
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
const { model: result } = await builder.buildAsync(model);
|
|
582
|
+
const [c2, c5] = result.pages[0].contents as unknown as Record<
|
|
583
|
+
string,
|
|
584
|
+
unknown
|
|
585
|
+
>[];
|
|
586
|
+
|
|
587
|
+
expect(firstMarkAttrs(c2.title)?.fontFamily).toBe(
|
|
588
|
+
'var(--role-font-family)',
|
|
589
|
+
);
|
|
590
|
+
expect(firstMarkAttrs(c5.title)?.fontFamily).toBe(
|
|
591
|
+
'var(--role-font-family)',
|
|
592
|
+
);
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
type TestRun = {
|
|
597
|
+
text: string;
|
|
598
|
+
marks?: { type: string; attrs?: Record<string, unknown> }[];
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
const runsOf = (doc: unknown): TestRun[] =>
|
|
602
|
+
(doc as { content: { content: TestRun[] }[] }).content[0].content;
|
|
603
|
+
|
|
604
|
+
const markTypes = (run: TestRun): string[] =>
|
|
605
|
+
(run.marks ?? []).map((mark) => mark.type);
|
|
606
|
+
|
|
607
|
+
const textStyleOf = (run: TestRun): Record<string, unknown> | undefined =>
|
|
608
|
+
run.marks?.find((mark) => mark.type === 'textStyle')?.attrs;
|
|
609
|
+
|
|
610
|
+
const LINK = { type: 'link', attrs: { href: 'https://example.com' } };
|
|
611
|
+
|
|
612
|
+
describe('emphasis propagation — weight, style and decoration (BP-5969)', () => {
|
|
613
|
+
it('collects weight, style and decoration', () => {
|
|
614
|
+
expect(
|
|
615
|
+
collectChangedRoleProps({
|
|
616
|
+
heading2: {
|
|
617
|
+
style: {
|
|
618
|
+
fontWeight: 'bold',
|
|
619
|
+
fontStyle: 'italic',
|
|
620
|
+
textDecoration: 'underline',
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
}),
|
|
624
|
+
).toEqual({
|
|
625
|
+
heading2: {
|
|
626
|
+
fontWeight: 'bold',
|
|
627
|
+
fontStyle: 'italic',
|
|
628
|
+
textDecoration: 'underline',
|
|
629
|
+
},
|
|
630
|
+
});
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
it('an emphasis value equal to the stored role still counts; an unchanged fontSize in the same call does not', () => {
|
|
634
|
+
expect(
|
|
635
|
+
collectChangedRoleProps(
|
|
636
|
+
{
|
|
637
|
+
heading1: {
|
|
638
|
+
style: { fontWeight: 'bold', fontStyle: 'normal', fontSize: '3em' },
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
heading1: {
|
|
643
|
+
style: { fontWeight: 'bold', fontStyle: 'normal', fontSize: '3em' },
|
|
644
|
+
},
|
|
645
|
+
} as any,
|
|
646
|
+
),
|
|
647
|
+
).toEqual({ heading1: { fontWeight: 'bold', fontStyle: 'normal' } });
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
it('a null or empty emphasis value counts as its neutral value', () => {
|
|
651
|
+
expect(
|
|
652
|
+
collectChangedRoleProps(
|
|
653
|
+
{
|
|
654
|
+
paragraph1: {
|
|
655
|
+
style: {
|
|
656
|
+
fontWeight: null,
|
|
657
|
+
fontStyle: '',
|
|
658
|
+
textDecoration: null,
|
|
659
|
+
} as any,
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
paragraph1: {
|
|
664
|
+
style: {
|
|
665
|
+
fontWeight: 'normal',
|
|
666
|
+
fontStyle: 'normal',
|
|
667
|
+
textDecoration: 'none',
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
} as any,
|
|
671
|
+
),
|
|
672
|
+
).toEqual({
|
|
673
|
+
paragraph1: {
|
|
674
|
+
fontWeight: 'normal',
|
|
675
|
+
fontStyle: 'normal',
|
|
676
|
+
textDecoration: 'none',
|
|
677
|
+
},
|
|
678
|
+
});
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
it('weight: a pinned normal literal becomes the ref and a bold mark is dropped', () => {
|
|
682
|
+
const doc = rteDoc([
|
|
683
|
+
{ text: 'Pinned ', marks: [roleMark({ fontWeight: 'normal' })] },
|
|
684
|
+
{ text: 'Legacy', marks: [{ type: 'bold' }] },
|
|
685
|
+
]);
|
|
686
|
+
|
|
687
|
+
const [pinned, legacy] = runsOf(
|
|
688
|
+
relinkRoleChangedMarks(doc as any, ['fontWeight'], undefined),
|
|
689
|
+
);
|
|
690
|
+
|
|
691
|
+
expect(textStyleOf(pinned)?.fontWeight).toBe('var(--role-font-weight)');
|
|
692
|
+
expect(markTypes(legacy)).toEqual([]);
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
it('style: italic marks go; colour, highlight and link marks stay', () => {
|
|
696
|
+
const doc = rteDoc([
|
|
697
|
+
{
|
|
698
|
+
text: 'Accent',
|
|
699
|
+
marks: [
|
|
700
|
+
roleMark({ fontStyle: 'normal', color: '#ff0000' }),
|
|
701
|
+
{ type: 'italic' },
|
|
702
|
+
{ type: 'highlight', attrs: { color: '#ffff00' } },
|
|
703
|
+
LINK,
|
|
704
|
+
],
|
|
705
|
+
},
|
|
706
|
+
]);
|
|
707
|
+
|
|
708
|
+
const [run] = runsOf(
|
|
709
|
+
relinkRoleChangedMarks(doc as any, ['fontStyle'], undefined),
|
|
710
|
+
);
|
|
711
|
+
|
|
712
|
+
expect(textStyleOf(run)).toEqual({
|
|
713
|
+
fontStyle: 'var(--role-font-style)',
|
|
714
|
+
color: '#ff0000',
|
|
715
|
+
});
|
|
716
|
+
expect(markTypes(run)).toEqual(['textStyle', 'highlight', 'link']);
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
it('decoration: underline, strike and the reset marker go; a link keeps its underline', () => {
|
|
720
|
+
const doc = rteDoc([
|
|
721
|
+
{
|
|
722
|
+
text: 'Plain ',
|
|
723
|
+
marks: [
|
|
724
|
+
roleMark({ textDecoration: 'underline', textDecorationReset: true }),
|
|
725
|
+
{ type: 'underline' },
|
|
726
|
+
{ type: 'strike' },
|
|
727
|
+
],
|
|
728
|
+
},
|
|
729
|
+
{ text: 'marked link', marks: [LINK, { type: 'underline' }] },
|
|
730
|
+
{
|
|
731
|
+
text: 'migrated link',
|
|
732
|
+
marks: [roleMark({ textDecoration: 'underline' }), LINK],
|
|
733
|
+
},
|
|
734
|
+
]);
|
|
735
|
+
|
|
736
|
+
const [plain, markedLink, migratedLink] = runsOf(
|
|
737
|
+
relinkRoleChangedMarks(doc as any, ['textDecoration'], undefined),
|
|
738
|
+
);
|
|
739
|
+
|
|
740
|
+
expect(textStyleOf(plain)).toEqual({
|
|
741
|
+
textDecoration: 'var(--role-text-decoration)',
|
|
742
|
+
});
|
|
743
|
+
expect(markTypes(plain)).toEqual(['textStyle']);
|
|
744
|
+
expect(markTypes(markedLink)).toEqual(['link', 'underline']);
|
|
745
|
+
expect(textStyleOf(migratedLink)?.textDecoration).toBe(
|
|
746
|
+
'var(--role-text-decoration)',
|
|
747
|
+
);
|
|
748
|
+
expect(markTypes(migratedLink)).toContain('underline');
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
it('keepRuns: a named run keeps every literal and mark', () => {
|
|
752
|
+
const kept = {
|
|
753
|
+
text: 'Taste',
|
|
754
|
+
marks: [roleMark({ fontWeight: '700' }), { type: 'bold' }],
|
|
755
|
+
};
|
|
756
|
+
const doc = rteDoc([
|
|
757
|
+
kept,
|
|
758
|
+
{ text: ' rest', marks: [roleMark({ fontWeight: '700' })] },
|
|
759
|
+
]);
|
|
760
|
+
|
|
761
|
+
const [keptRun, rest] = runsOf(
|
|
762
|
+
relinkRoleChangedMarks(doc as any, ['fontWeight'], ['Taste']),
|
|
763
|
+
);
|
|
764
|
+
|
|
765
|
+
expect(keptRun).toEqual({ type: 'text', ...kept });
|
|
766
|
+
expect(textStyleOf(rest)?.fontWeight).toBe('var(--role-font-weight)');
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
it('a family-only change leaves bold, italic, underline and strike alone', () => {
|
|
770
|
+
const doc = rteDoc([
|
|
771
|
+
{
|
|
772
|
+
text: 'Styled',
|
|
773
|
+
marks: [
|
|
774
|
+
roleMark({ fontFamily: 'Georgia', textDecoration: 'underline' }),
|
|
775
|
+
{ type: 'bold' },
|
|
776
|
+
{ type: 'italic' },
|
|
777
|
+
{ type: 'underline' },
|
|
778
|
+
{ type: 'strike' },
|
|
779
|
+
],
|
|
780
|
+
},
|
|
781
|
+
]);
|
|
782
|
+
|
|
783
|
+
const [run] = runsOf(
|
|
784
|
+
relinkRoleChangedMarks(doc as any, ['fontFamily'], undefined),
|
|
785
|
+
);
|
|
786
|
+
|
|
787
|
+
expect(textStyleOf(run)).toEqual({
|
|
788
|
+
fontFamily: 'var(--role-font-family)',
|
|
789
|
+
textDecoration: 'underline',
|
|
790
|
+
});
|
|
791
|
+
expect(markTypes(run)).toEqual([
|
|
792
|
+
'textStyle',
|
|
793
|
+
'bold',
|
|
794
|
+
'italic',
|
|
795
|
+
'underline',
|
|
796
|
+
'strike',
|
|
797
|
+
]);
|
|
798
|
+
});
|
|
799
|
+
|
|
800
|
+
it('plain fields drop their emphasis literal: button label, nav default + selected, footer copyright', () => {
|
|
801
|
+
const content = {
|
|
802
|
+
id: 'c1',
|
|
803
|
+
type: 'mailing-list',
|
|
804
|
+
buttonText: 'Subscribe',
|
|
805
|
+
buttonTextStyle: { textStyleType: 'button', fontWeight: 'bold' },
|
|
806
|
+
} as unknown as Content;
|
|
807
|
+
const pageHeaderDesktop = {
|
|
808
|
+
navigation: {
|
|
809
|
+
defaultButtonStyle: {
|
|
810
|
+
textStyleType: 'paragraph1',
|
|
811
|
+
fontStyle: 'italic',
|
|
812
|
+
},
|
|
813
|
+
selectedButtonStyle: { fontStyle: 'italic', color: '#111111' },
|
|
814
|
+
},
|
|
815
|
+
};
|
|
816
|
+
const pageFooterDesktop = {
|
|
817
|
+
copyrightText: 'All rights reserved',
|
|
818
|
+
copyrightStyle: {
|
|
819
|
+
textStyleType: 'paragraph1',
|
|
820
|
+
textDecoration: 'underline',
|
|
821
|
+
},
|
|
822
|
+
};
|
|
823
|
+
const model = makeModel([content], {
|
|
824
|
+
pageHeaderDesktop,
|
|
825
|
+
pageFooterDesktop,
|
|
826
|
+
} as unknown as Partial<BrandPageModel>);
|
|
827
|
+
|
|
828
|
+
propagateRolePropsToContents(model, {
|
|
829
|
+
button: { fontWeight: 'normal' },
|
|
830
|
+
paragraph1: { fontStyle: 'normal', textDecoration: 'none' },
|
|
831
|
+
});
|
|
832
|
+
|
|
833
|
+
const button = (
|
|
834
|
+
model.pages[0].contents[0] as unknown as Record<
|
|
835
|
+
string,
|
|
836
|
+
Record<string, unknown>
|
|
837
|
+
>
|
|
838
|
+
).buttonTextStyle;
|
|
839
|
+
const navigation = (
|
|
840
|
+
model.pageHeaderDesktop as unknown as {
|
|
841
|
+
navigation: Record<string, Record<string, unknown>>;
|
|
842
|
+
}
|
|
843
|
+
).navigation;
|
|
844
|
+
const copyright = (
|
|
845
|
+
model.pageFooterDesktop as unknown as {
|
|
846
|
+
copyrightStyle: Record<string, unknown>;
|
|
847
|
+
}
|
|
848
|
+
).copyrightStyle;
|
|
849
|
+
|
|
850
|
+
expect(button).toEqual({ textStyleType: 'button' });
|
|
851
|
+
expect(navigation.defaultButtonStyle.fontStyle).toBeUndefined();
|
|
852
|
+
expect(navigation.selectedButtonStyle).toEqual({ color: '#111111' });
|
|
853
|
+
expect(copyright).toEqual({ textStyleType: 'paragraph1' });
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
it('GlobalStylesBuilder: heading1 bold when heading1 is already bold relinks migration-pinned normal runs and the titleStyle', async () => {
|
|
857
|
+
const model = {
|
|
858
|
+
styles: {
|
|
859
|
+
textStyles: {
|
|
860
|
+
textStyleOptions: {
|
|
861
|
+
heading1: { style: { fontWeight: 'bold' }, isModified: false },
|
|
862
|
+
},
|
|
863
|
+
},
|
|
864
|
+
buttonStyles: { style: {} },
|
|
865
|
+
backgroundStyles: { style: {} },
|
|
866
|
+
},
|
|
867
|
+
pages: [
|
|
868
|
+
{
|
|
869
|
+
id: 'p1',
|
|
870
|
+
contents: [
|
|
871
|
+
{
|
|
872
|
+
id: 'c1',
|
|
873
|
+
type: 'banner-section',
|
|
874
|
+
title: rteDoc([
|
|
875
|
+
{
|
|
876
|
+
text: 'Grand Opening',
|
|
877
|
+
marks: [roleMark({ fontWeight: 'normal' })],
|
|
878
|
+
},
|
|
879
|
+
]),
|
|
880
|
+
titleStyle: { textStyleType: 'heading1', fontWeight: 'normal' },
|
|
881
|
+
},
|
|
882
|
+
],
|
|
883
|
+
},
|
|
884
|
+
],
|
|
885
|
+
} as unknown as BrandPageModel;
|
|
886
|
+
|
|
887
|
+
const { model: result, errors } = await new GlobalStylesBuilder({
|
|
888
|
+
id: 'g1',
|
|
889
|
+
type: BUILDER_TYPES.UPDATE_GLOBAL_STYLES,
|
|
890
|
+
payload: {
|
|
891
|
+
textStyles: {
|
|
892
|
+
textStyleOptions: { heading1: { style: { fontWeight: 'bold' } } },
|
|
893
|
+
},
|
|
894
|
+
},
|
|
895
|
+
}).buildAsync(model);
|
|
896
|
+
const content = result.pages[0].contents[0] as unknown as Record<
|
|
897
|
+
string,
|
|
898
|
+
unknown
|
|
899
|
+
>;
|
|
900
|
+
|
|
901
|
+
expect(errors ?? []).toEqual([]);
|
|
902
|
+
expect(firstMarkAttrs(content.title)?.fontWeight).toBe(
|
|
903
|
+
'var(--role-font-weight)',
|
|
904
|
+
);
|
|
905
|
+
expect(content.titleStyle).toEqual({ textStyleType: 'heading1' });
|
|
906
|
+
});
|
|
907
|
+
});
|