@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
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { migrateBrandPageModel } from './migration.util';
|
|
1
|
+
import { migrateBrandPageModel, GetLatestModelVersion } from './migration.util';
|
|
2
2
|
import { migrateNewLogoLogic } from './migration/migration-01';
|
|
3
3
|
import { migration17 } from './migration/migration-17';
|
|
4
|
+
import { migration22 } from './migration/migration-22';
|
|
5
|
+
import type * as Migration22Module from './migration/migration-22';
|
|
4
6
|
import {
|
|
5
7
|
BrandPageModel,
|
|
6
8
|
type BrandPageData,
|
|
@@ -18,6 +20,7 @@ import {
|
|
|
18
20
|
BRAND_PAGE_TYPES,
|
|
19
21
|
type LogoContent,
|
|
20
22
|
type ButtonWithModalContent,
|
|
23
|
+
type TextStyleDeclaration,
|
|
21
24
|
} from '../models';
|
|
22
25
|
import {
|
|
23
26
|
createInitialAboutSectionContent,
|
|
@@ -39,6 +42,13 @@ import {
|
|
|
39
42
|
TESTIMONIAL_DEFAULT_PADDING,
|
|
40
43
|
} from '../constants';
|
|
41
44
|
|
|
45
|
+
// Spies that call through, so the table's run order is observable without changing either migration.
|
|
46
|
+
vi.mock('./migration/migration-22', async (importOriginal) => {
|
|
47
|
+
const actual = await importOriginal<typeof Migration22Module>();
|
|
48
|
+
|
|
49
|
+
return { ...actual, migration22: vi.fn(actual.migration22) };
|
|
50
|
+
});
|
|
51
|
+
|
|
42
52
|
describe('migration.util', () => {
|
|
43
53
|
const getBsModel: () => BrandPageModel = () => {
|
|
44
54
|
return {
|
|
@@ -1023,8 +1033,12 @@ describe('migration.util', () => {
|
|
|
1023
1033
|
const content = model.brandPageModel.pages[0]
|
|
1024
1034
|
.contents[1] as ProfileContent;
|
|
1025
1035
|
|
|
1026
|
-
expect(content.titleStyle.fontFamily).toBe(
|
|
1027
|
-
|
|
1036
|
+
expect((content.titleStyle as TextStyleDeclaration).fontFamily).toBe(
|
|
1037
|
+
'Lato',
|
|
1038
|
+
);
|
|
1039
|
+
expect((content.titleStyle as TextStyleDeclaration).lineHeight).toBe(
|
|
1040
|
+
'1.5',
|
|
1041
|
+
);
|
|
1028
1042
|
});
|
|
1029
1043
|
});
|
|
1030
1044
|
});
|
|
@@ -1043,11 +1057,19 @@ describe('migration.util', () => {
|
|
|
1043
1057
|
expect(bannerContent.titleStyle.textAlign).toBe('center');
|
|
1044
1058
|
expect(bannerContent.descriptionStyle.textAlign).toBe('center');
|
|
1045
1059
|
expect(bannerContent.buttonTextStyle.textAlign).toBe('center');
|
|
1046
|
-
expect(
|
|
1047
|
-
|
|
1060
|
+
expect(
|
|
1061
|
+
(bannerContent.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1062
|
+
).toBe('Lato');
|
|
1063
|
+
expect(
|
|
1064
|
+
(bannerContent.descriptionStyle as TextStyleDeclaration).fontFamily,
|
|
1065
|
+
).toBe('Lato');
|
|
1048
1066
|
expect(bannerContent.buttonTextStyle.fontFamily).toBe('Lato');
|
|
1049
|
-
expect(
|
|
1050
|
-
|
|
1067
|
+
expect(
|
|
1068
|
+
(bannerContent.titleStyle as TextStyleDeclaration).lineHeight,
|
|
1069
|
+
).toBe(LINE_HEIGHT_TITLE);
|
|
1070
|
+
expect(
|
|
1071
|
+
(bannerContent.descriptionStyle as TextStyleDeclaration).lineHeight,
|
|
1072
|
+
).toBe(LINE_HEIGHT_BODY);
|
|
1051
1073
|
expect(bannerContent.buttonTextStyle.lineHeight).toBe(LINE_HEIGHT_BODY);
|
|
1052
1074
|
});
|
|
1053
1075
|
|
|
@@ -1153,8 +1175,12 @@ describe('migration.util', () => {
|
|
|
1153
1175
|
expect(bannerContent.titleStyle.textAlign).toBe('center');
|
|
1154
1176
|
expect(bannerContent.descriptionStyle.textAlign).toBe('center');
|
|
1155
1177
|
expect(bannerContent.buttonTextStyle.textAlign).toBe('center');
|
|
1156
|
-
expect(
|
|
1157
|
-
|
|
1178
|
+
expect(
|
|
1179
|
+
(bannerContent.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1180
|
+
).toBe('Lato');
|
|
1181
|
+
expect(
|
|
1182
|
+
(bannerContent.descriptionStyle as TextStyleDeclaration).fontFamily,
|
|
1183
|
+
).toBe('Lato');
|
|
1158
1184
|
expect(bannerContent.buttonTextStyle.fontFamily).toBe('Lato');
|
|
1159
1185
|
});
|
|
1160
1186
|
|
|
@@ -1171,8 +1197,12 @@ describe('migration.util', () => {
|
|
|
1171
1197
|
expect(bannerContent.titleStyle.textAlign).toBe('right');
|
|
1172
1198
|
expect(bannerContent.descriptionStyle.textAlign).toBe('left');
|
|
1173
1199
|
expect(bannerContent.buttonTextStyle.textAlign).toBe('right');
|
|
1174
|
-
expect(
|
|
1175
|
-
|
|
1200
|
+
expect(
|
|
1201
|
+
(bannerContent.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1202
|
+
).toBe('Lato');
|
|
1203
|
+
expect(
|
|
1204
|
+
(bannerContent.descriptionStyle as TextStyleDeclaration).fontFamily,
|
|
1205
|
+
).toBe('Lato');
|
|
1176
1206
|
expect(bannerContent.buttonTextStyle.fontFamily).toBe('Lato');
|
|
1177
1207
|
});
|
|
1178
1208
|
|
|
@@ -1186,8 +1216,12 @@ describe('migration.util', () => {
|
|
|
1186
1216
|
const bannerContent = model.brandPageModel.pages[0]
|
|
1187
1217
|
.contents[0] as BannerSectionContent;
|
|
1188
1218
|
|
|
1189
|
-
expect(
|
|
1190
|
-
|
|
1219
|
+
expect(
|
|
1220
|
+
(bannerContent.titleStyle as TextStyleDeclaration).lineHeight,
|
|
1221
|
+
).toBe(LINE_HEIGHT_TITLE);
|
|
1222
|
+
expect(
|
|
1223
|
+
(bannerContent.descriptionStyle as TextStyleDeclaration).lineHeight,
|
|
1224
|
+
).toBe(LINE_HEIGHT_BODY);
|
|
1191
1225
|
expect(bannerContent.buttonTextStyle.lineHeight).toBe(LINE_HEIGHT_BODY);
|
|
1192
1226
|
});
|
|
1193
1227
|
test('migrateBrandPageModel should not replace lineheight if theres existing', async () => {
|
|
@@ -1200,8 +1234,12 @@ describe('migration.util', () => {
|
|
|
1200
1234
|
const bannerContent = model.brandPageModel.pages[1]
|
|
1201
1235
|
.contents[1] as BannerSectionContent;
|
|
1202
1236
|
|
|
1203
|
-
expect(
|
|
1204
|
-
|
|
1237
|
+
expect(
|
|
1238
|
+
(bannerContent.titleStyle as TextStyleDeclaration).lineHeight,
|
|
1239
|
+
).toBe('1.6');
|
|
1240
|
+
expect(
|
|
1241
|
+
(bannerContent.descriptionStyle as TextStyleDeclaration).lineHeight,
|
|
1242
|
+
).toBe('1.2');
|
|
1205
1243
|
expect(bannerContent.buttonTextStyle.lineHeight).toBe('1.2');
|
|
1206
1244
|
});
|
|
1207
1245
|
});
|
|
@@ -1221,7 +1259,9 @@ describe('migration.util', () => {
|
|
|
1221
1259
|
expect(testimonialContent.testimonialStyle.textAlign).toBe('center');
|
|
1222
1260
|
expect(testimonialContent.nameStyle.textAlign).toBe('center');
|
|
1223
1261
|
expect(testimonialContent.positionStyle.textAlign).toBe('center');
|
|
1224
|
-
expect(
|
|
1262
|
+
expect(
|
|
1263
|
+
(testimonialContent.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1264
|
+
).toBe('Lato');
|
|
1225
1265
|
expect(testimonialContent.testimonialStyle.fontFamily).toBe('Lato');
|
|
1226
1266
|
expect(testimonialContent.nameStyle.fontFamily).toBe('Lato');
|
|
1227
1267
|
expect(testimonialContent.positionStyle.fontFamily).toBe('Lato');
|
|
@@ -1241,7 +1281,9 @@ describe('migration.util', () => {
|
|
|
1241
1281
|
expect(testimonialContent.testimonialStyle.textAlign).toBe('center');
|
|
1242
1282
|
expect(testimonialContent.nameStyle.textAlign).toBe('center');
|
|
1243
1283
|
expect(testimonialContent.positionStyle.textAlign).toBe('center');
|
|
1244
|
-
expect(
|
|
1284
|
+
expect(
|
|
1285
|
+
(testimonialContent.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1286
|
+
).toBe('Lato');
|
|
1245
1287
|
expect(testimonialContent.testimonialStyle.fontFamily).toBe('Lato');
|
|
1246
1288
|
expect(testimonialContent.nameStyle.fontFamily).toBe('Lato');
|
|
1247
1289
|
expect(testimonialContent.positionStyle.fontFamily).toBe('Lato');
|
|
@@ -1260,7 +1302,9 @@ describe('migration.util', () => {
|
|
|
1260
1302
|
expect(testimonialContent.testimonialStyle.textAlign).toBe('center');
|
|
1261
1303
|
expect(testimonialContent.nameStyle.textAlign).toBe('center');
|
|
1262
1304
|
expect(testimonialContent.positionStyle.textAlign).toBe('right');
|
|
1263
|
-
expect(
|
|
1305
|
+
expect(
|
|
1306
|
+
(testimonialContent.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1307
|
+
).toBe('Lato');
|
|
1264
1308
|
expect(testimonialContent.testimonialStyle.fontFamily).toBe('Lato');
|
|
1265
1309
|
expect(testimonialContent.nameStyle.fontFamily).toBe('Lato');
|
|
1266
1310
|
expect(testimonialContent.positionStyle.fontFamily).toBe('Lato');
|
|
@@ -1279,8 +1323,12 @@ describe('migration.util', () => {
|
|
|
1279
1323
|
|
|
1280
1324
|
expect(aboutContents.titleStyle.textAlign).toBe('center');
|
|
1281
1325
|
expect(aboutContents.paragraphStyle.textAlign).toBe('center');
|
|
1282
|
-
expect(
|
|
1283
|
-
|
|
1326
|
+
expect(
|
|
1327
|
+
(aboutContents.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1328
|
+
).toBe('Lato');
|
|
1329
|
+
expect(
|
|
1330
|
+
(aboutContents.paragraphStyle as TextStyleDeclaration).fontFamily,
|
|
1331
|
+
).toBe('Lato');
|
|
1284
1332
|
});
|
|
1285
1333
|
test('migrateBrandPageModel should return Newly Added About contents with text style to have textAlign and FontFamily', async () => {
|
|
1286
1334
|
// Act
|
|
@@ -1294,8 +1342,12 @@ describe('migration.util', () => {
|
|
|
1294
1342
|
|
|
1295
1343
|
expect(aboutContents.titleStyle.textAlign).toBe('center');
|
|
1296
1344
|
expect(aboutContents.paragraphStyle.textAlign).toBe('center');
|
|
1297
|
-
expect(
|
|
1298
|
-
|
|
1345
|
+
expect(
|
|
1346
|
+
(aboutContents.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1347
|
+
).toBe('Lato');
|
|
1348
|
+
expect(
|
|
1349
|
+
(aboutContents.paragraphStyle as TextStyleDeclaration).fontFamily,
|
|
1350
|
+
).toBe('Lato');
|
|
1299
1351
|
});
|
|
1300
1352
|
test('migrateBrandPageModel should return text Align and Font family with the correct alignment based on display style', async () => {
|
|
1301
1353
|
// Act
|
|
@@ -1309,8 +1361,12 @@ describe('migration.util', () => {
|
|
|
1309
1361
|
|
|
1310
1362
|
expect(aboutContents.titleStyle.textAlign).toBe('left');
|
|
1311
1363
|
expect(aboutContents.paragraphStyle.textAlign).toBe('left');
|
|
1312
|
-
expect(
|
|
1313
|
-
|
|
1364
|
+
expect(
|
|
1365
|
+
(aboutContents.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1366
|
+
).toBe('Lato');
|
|
1367
|
+
expect(
|
|
1368
|
+
(aboutContents.paragraphStyle as TextStyleDeclaration).fontFamily,
|
|
1369
|
+
).toBe('Lato');
|
|
1314
1370
|
});
|
|
1315
1371
|
test('migrateBrandPageModel should not change text alignment of existing contents', async () => {
|
|
1316
1372
|
// Act
|
|
@@ -1324,8 +1380,12 @@ describe('migration.util', () => {
|
|
|
1324
1380
|
|
|
1325
1381
|
expect(aboutContents.titleStyle.textAlign).toBe('left');
|
|
1326
1382
|
expect(aboutContents.paragraphStyle.textAlign).toBe('right');
|
|
1327
|
-
expect(
|
|
1328
|
-
|
|
1383
|
+
expect(
|
|
1384
|
+
(aboutContents.titleStyle as TextStyleDeclaration).fontFamily,
|
|
1385
|
+
).toBe('Lato');
|
|
1386
|
+
expect(
|
|
1387
|
+
(aboutContents.paragraphStyle as TextStyleDeclaration).fontFamily,
|
|
1388
|
+
).toBe('Lato');
|
|
1329
1389
|
});
|
|
1330
1390
|
});
|
|
1331
1391
|
|
|
@@ -1341,9 +1401,13 @@ describe('migration.util', () => {
|
|
|
1341
1401
|
expect(content.titleStyle.textAlign).toBe('center');
|
|
1342
1402
|
expect(content.nameStyle.textAlign).toBe('center');
|
|
1343
1403
|
expect(content.descriptionStyle.textAlign).toBe('center');
|
|
1344
|
-
expect(content.titleStyle.fontFamily).toBe(
|
|
1345
|
-
|
|
1346
|
-
|
|
1404
|
+
expect((content.titleStyle as TextStyleDeclaration).fontFamily).toBe(
|
|
1405
|
+
'Lato',
|
|
1406
|
+
);
|
|
1407
|
+
expect((content.nameStyle as TextStyleDeclaration).fontFamily).toBe('Lato');
|
|
1408
|
+
expect((content.descriptionStyle as TextStyleDeclaration).fontFamily).toBe(
|
|
1409
|
+
'Lato',
|
|
1410
|
+
);
|
|
1347
1411
|
});
|
|
1348
1412
|
|
|
1349
1413
|
test('migrateBrandPageModel should return mailing list contents with text style to have textAlign and FontFamily', async () => {
|
|
@@ -1358,7 +1422,9 @@ describe('migration.util', () => {
|
|
|
1358
1422
|
|
|
1359
1423
|
expect(content.titleStyle.textAlign).toBe('center');
|
|
1360
1424
|
expect(content.buttonTextStyle.textAlign).toBe('center');
|
|
1361
|
-
expect(content.titleStyle.fontFamily).toBe(
|
|
1425
|
+
expect((content.titleStyle as TextStyleDeclaration).fontFamily).toBe(
|
|
1426
|
+
'Lato',
|
|
1427
|
+
);
|
|
1362
1428
|
expect(content.buttonTextStyle.fontFamily).toBe('Lato');
|
|
1363
1429
|
});
|
|
1364
1430
|
|
|
@@ -1397,7 +1463,9 @@ describe('migration.util', () => {
|
|
|
1397
1463
|
expect(content.titleStyle.textAlign).toBe('center');
|
|
1398
1464
|
expect(content.headingStyle.textAlign).toBe('center');
|
|
1399
1465
|
expect(content.paragraphStyle.textAlign).toBe('center');
|
|
1400
|
-
expect(content.titleStyle.fontFamily).toBe(
|
|
1466
|
+
expect((content.titleStyle as TextStyleDeclaration).fontFamily).toBe(
|
|
1467
|
+
'Lato',
|
|
1468
|
+
);
|
|
1401
1469
|
expect(content.headingStyle.fontFamily).toBe('Lato');
|
|
1402
1470
|
expect(content.paragraphStyle.fontFamily).toBe('Lato');
|
|
1403
1471
|
});
|
|
@@ -1427,7 +1495,9 @@ describe('migration.util', () => {
|
|
|
1427
1495
|
.contents[9] as SocialLinksContent;
|
|
1428
1496
|
|
|
1429
1497
|
expect(content.titleStyle.textAlign).toBe('center');
|
|
1430
|
-
expect(content.titleStyle.fontFamily).toBe(
|
|
1498
|
+
expect((content.titleStyle as TextStyleDeclaration).fontFamily).toBe(
|
|
1499
|
+
'Lato',
|
|
1500
|
+
);
|
|
1431
1501
|
});
|
|
1432
1502
|
|
|
1433
1503
|
describe('Contact Form Content - Layout style testing', () => {
|
|
@@ -2410,4 +2480,48 @@ describe('migration.util', () => {
|
|
|
2410
2480
|
);
|
|
2411
2481
|
});
|
|
2412
2482
|
});
|
|
2483
|
+
|
|
2484
|
+
describe('migration 22 - Global Text Style V2', () => {
|
|
2485
|
+
const options = { isUserDraft: true, isServerRender: false };
|
|
2486
|
+
|
|
2487
|
+
beforeEach(() => {
|
|
2488
|
+
vi.mocked(migration22).mockClear();
|
|
2489
|
+
});
|
|
2490
|
+
|
|
2491
|
+
test('22 is the latest model version', () => {
|
|
2492
|
+
expect(GetLatestModelVersion()).toBe(22);
|
|
2493
|
+
});
|
|
2494
|
+
|
|
2495
|
+
test('migration 22 upgrades a v=21 model to v=22', async () => {
|
|
2496
|
+
const { brandPageModel } = await migrateBrandPageModel(
|
|
2497
|
+
{
|
|
2498
|
+
v: 21,
|
|
2499
|
+
pages: [{ contents: [] }],
|
|
2500
|
+
styles: {},
|
|
2501
|
+
} as unknown as BrandPageModel,
|
|
2502
|
+
options,
|
|
2503
|
+
);
|
|
2504
|
+
|
|
2505
|
+
expect(migration22).toHaveBeenCalledTimes(1);
|
|
2506
|
+
expect(brandPageModel.v).toBe(22);
|
|
2507
|
+
});
|
|
2508
|
+
|
|
2509
|
+
test('migration 22 does not rerun on a v=22 model', async () => {
|
|
2510
|
+
const { brandPageModel } = await migrateBrandPageModel(
|
|
2511
|
+
{
|
|
2512
|
+
v: 22,
|
|
2513
|
+
pages: [{ contents: [] }],
|
|
2514
|
+
styles: {},
|
|
2515
|
+
} as unknown as BrandPageModel,
|
|
2516
|
+
options,
|
|
2517
|
+
);
|
|
2518
|
+
|
|
2519
|
+
expect(migration22).not.toHaveBeenCalled();
|
|
2520
|
+
expect(brandPageModel.v).toBe(22);
|
|
2521
|
+
|
|
2522
|
+
await migrateBrandPageModel(brandPageModel, options);
|
|
2523
|
+
|
|
2524
|
+
expect(migration22).not.toHaveBeenCalled();
|
|
2525
|
+
});
|
|
2526
|
+
});
|
|
2413
2527
|
});
|
|
@@ -25,6 +25,7 @@ import { migration19 } from './migration/migration-19';
|
|
|
25
25
|
import { migration20 } from './migration/migration-20';
|
|
26
26
|
import { migration20_5 } from './migration/migration-20_5';
|
|
27
27
|
import { migration21 } from './migration/migration-21';
|
|
28
|
+
import { migration22 } from './migration/migration-22';
|
|
28
29
|
|
|
29
30
|
export interface MigrationData {
|
|
30
31
|
brandPageModel: BrandPageModel;
|
|
@@ -228,6 +229,23 @@ const MIGRATION_TABLE = [
|
|
|
228
229
|
description:
|
|
229
230
|
'BP-5886 Global Color V2: extract every colour into a central styles.colors palette (4 palette roles + palette-custom-<uuid>) and rewrite references to var(--id) — RTE, shapes, box-shadow, gradients included (lossless, once)',
|
|
230
231
|
},
|
|
232
|
+
{
|
|
233
|
+
version: 22,
|
|
234
|
+
migrateFn: migration22,
|
|
235
|
+
// Version-gated (runs once, when modelVersion < 22): the BP-5969 single-source
|
|
236
|
+
// text-style migration (ADR-0019/0020/0021, §7a D1–D5). The 10 roles KEEP their §4
|
|
237
|
+
// default typography; each old role's COLOUR is seeded onto its target tier so the
|
|
238
|
+
// colour bake stays byte-identical (paragraph1 takes the base-coat colour). Every
|
|
239
|
+
// text field (content, nav, header button, Save Contact) outside the ten reconnects
|
|
240
|
+
// onto its nearest canonical tier, the values that differ from it kept as overrides
|
|
241
|
+
// so it renders unchanged, and the baked role-typography is stripped out of RTE
|
|
242
|
+
// marks (uniform-but-divergent values lifted into block overrides, genuine per-run
|
|
243
|
+
// marks kept). Ordered after v21 so RTE colours are already referencified. The
|
|
244
|
+
// version gate runs it once; on a hypothetical re-run every job is a no-op (see
|
|
245
|
+
// migration-22's header).
|
|
246
|
+
description:
|
|
247
|
+
'BP-5969 Global Text Style V2: expand 4 roles -> 10 (H1-6/P1-3/button); roles keep default typography, reconnect all content to its nearest tier with its size kept as a per-block override, seed role colour + strip baked RTE typography (appearance-preserving, once)',
|
|
248
|
+
},
|
|
231
249
|
] as MigrationTableItem[];
|
|
232
250
|
|
|
233
251
|
export const GetLatestModelVersion = () =>
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
createInitialButtonContent,
|
|
31
31
|
} from '@brand-page-maker/models';
|
|
32
32
|
import { faker } from '@faker-js/faker';
|
|
33
|
+
import { isTiptapDocument } from '@brand-page-maker/utils';
|
|
33
34
|
|
|
34
35
|
describe('personalisation.util', async () => {
|
|
35
36
|
test('applyUserPersonalisationToBrandPageModelAsync should return not modified when input has no contents', async () => {
|
|
@@ -973,11 +974,13 @@ describe('personalisation.util', async () => {
|
|
|
973
974
|
fetchSpy.mockRestore();
|
|
974
975
|
});
|
|
975
976
|
|
|
976
|
-
test('applyUserPersonalisationToBrandPageModelAsync should
|
|
977
|
+
test('applyUserPersonalisationToBrandPageModelAsync should apply shape URL and color replacements', async () => {
|
|
977
978
|
// Arrange
|
|
979
|
+
const svgContent =
|
|
980
|
+
'<svg xmlns="http://www.w3.org/2000/svg"><rect fill="#ff0000"/></svg>';
|
|
978
981
|
const fetchSpy = vi
|
|
979
982
|
.spyOn(globalThis, 'fetch')
|
|
980
|
-
.
|
|
983
|
+
.mockResolvedValue(new Response(svgContent, { status: 200 }));
|
|
981
984
|
|
|
982
985
|
const expectedShapeUrl =
|
|
983
986
|
PERSONALISATION.mediaSection.mainShapesCollection!.tall[0].url;
|
|
@@ -1013,7 +1016,7 @@ describe('personalisation.util', async () => {
|
|
|
1013
1016
|
],
|
|
1014
1017
|
});
|
|
1015
1018
|
|
|
1016
|
-
// Act -
|
|
1019
|
+
// Act - fetch is fully local so this test does not depend on CDN/WAF access.
|
|
1017
1020
|
const result = await applyUserPersonalisationToBrandPageModelAsync(
|
|
1018
1021
|
PERSONALISATION,
|
|
1019
1022
|
model,
|
|
@@ -1030,6 +1033,69 @@ describe('personalisation.util', async () => {
|
|
|
1030
1033
|
fetchSpy.mockRestore();
|
|
1031
1034
|
});
|
|
1032
1035
|
|
|
1036
|
+
test('applyUserPersonalisationToBrandPageModelAsync should not throw when shape SVG fetch fails and should still apply shape URL', async () => {
|
|
1037
|
+
// Arrange
|
|
1038
|
+
const fetchSpy = vi
|
|
1039
|
+
.spyOn(globalThis, 'fetch')
|
|
1040
|
+
.mockRejectedValue(new Error('Network error'));
|
|
1041
|
+
const consoleErrorSpy = vi
|
|
1042
|
+
.spyOn(console, 'error')
|
|
1043
|
+
.mockImplementation(() => undefined);
|
|
1044
|
+
|
|
1045
|
+
const expectedShapeUrl =
|
|
1046
|
+
PERSONALISATION.mediaSection.mainShapesCollection!.tall[0].url;
|
|
1047
|
+
|
|
1048
|
+
const model = new BrandPageModel({
|
|
1049
|
+
brandPageType: BRAND_PAGE_TYPES.brandSite,
|
|
1050
|
+
pages: [
|
|
1051
|
+
{
|
|
1052
|
+
title: 'home',
|
|
1053
|
+
slug: 'home',
|
|
1054
|
+
contents: [
|
|
1055
|
+
{
|
|
1056
|
+
...createInitialShapesSectionContent(),
|
|
1057
|
+
personalisationRole: 'media',
|
|
1058
|
+
items: [
|
|
1059
|
+
{
|
|
1060
|
+
id: 'shapes-item-1',
|
|
1061
|
+
colorReplacements: [],
|
|
1062
|
+
height: -1,
|
|
1063
|
+
imageUrl: 'shape-1.svg',
|
|
1064
|
+
imageTitle: '',
|
|
1065
|
+
paragraph: '',
|
|
1066
|
+
title: '',
|
|
1067
|
+
width: -1,
|
|
1068
|
+
mediaType: 'shape',
|
|
1069
|
+
imageLink: '',
|
|
1070
|
+
itemsId: -1,
|
|
1071
|
+
},
|
|
1072
|
+
],
|
|
1073
|
+
} as ShapesSectionContent,
|
|
1074
|
+
],
|
|
1075
|
+
},
|
|
1076
|
+
],
|
|
1077
|
+
});
|
|
1078
|
+
|
|
1079
|
+
// Act
|
|
1080
|
+
const result = await applyUserPersonalisationToBrandPageModelAsync(
|
|
1081
|
+
PERSONALISATION,
|
|
1082
|
+
model,
|
|
1083
|
+
);
|
|
1084
|
+
|
|
1085
|
+
// Assert
|
|
1086
|
+
const content = result.model.pages[0].contents[0] as ShapesSectionContent;
|
|
1087
|
+
|
|
1088
|
+
expect(content.items[0].imageUrl).toBe(expectedShapeUrl);
|
|
1089
|
+
expect(content.items[0].colorReplacements).toEqual([]);
|
|
1090
|
+
expect(consoleErrorSpy).toHaveBeenCalledWith(
|
|
1091
|
+
expect.stringContaining('Failed to fetch or parse shape SVG'),
|
|
1092
|
+
expect.any(Error),
|
|
1093
|
+
);
|
|
1094
|
+
|
|
1095
|
+
fetchSpy.mockRestore();
|
|
1096
|
+
consoleErrorSpy.mockRestore();
|
|
1097
|
+
});
|
|
1098
|
+
|
|
1033
1099
|
test('applyUserPersonalisationToBrandPageModelAsync should use mainShapesCollection when shapes is an empty array', async () => {
|
|
1034
1100
|
// Arrange - personalisation with shapes: [] but populated mainShapesCollection
|
|
1035
1101
|
const svgContent =
|
|
@@ -1260,3 +1326,82 @@ describe('personalisation.util', async () => {
|
|
|
1260
1326
|
]);
|
|
1261
1327
|
});
|
|
1262
1328
|
});
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* BP-5969 — post-migration an RTE field is a Tiptap doc whose colour + typography live in the run
|
|
1332
|
+
* marks. The seed must inject the plain personalisation text WITHOUT dropping that style: the write
|
|
1333
|
+
* step reflows the new text through the template doc's style skeleton (`reflowRteDoc`).
|
|
1334
|
+
*/
|
|
1335
|
+
describe('personalisation.util — RTE doc fields keep the template style', () => {
|
|
1336
|
+
const templateDoc = () => ({
|
|
1337
|
+
type: 'doc',
|
|
1338
|
+
content: [
|
|
1339
|
+
{
|
|
1340
|
+
type: 'paragraph',
|
|
1341
|
+
attrs: { textAlign: 'center' },
|
|
1342
|
+
content: [
|
|
1343
|
+
{
|
|
1344
|
+
type: 'text',
|
|
1345
|
+
text: 'Placeholder heading',
|
|
1346
|
+
marks: [
|
|
1347
|
+
{ type: 'textStyle', attrs: { color: 'var(--palette-0)' } },
|
|
1348
|
+
],
|
|
1349
|
+
},
|
|
1350
|
+
],
|
|
1351
|
+
},
|
|
1352
|
+
],
|
|
1353
|
+
});
|
|
1354
|
+
|
|
1355
|
+
const modelWith = (textField: unknown, role: string | undefined) => {
|
|
1356
|
+
const textContent = {
|
|
1357
|
+
...createInitialTextContent({
|
|
1358
|
+
brandPageType: BRAND_PAGE_TYPES.brandSite,
|
|
1359
|
+
}),
|
|
1360
|
+
text: textField,
|
|
1361
|
+
personalisationRole: role,
|
|
1362
|
+
} as unknown as TextContent;
|
|
1363
|
+
|
|
1364
|
+
return new BrandPageModel({
|
|
1365
|
+
brandPageType: BRAND_PAGE_TYPES.brandSite,
|
|
1366
|
+
pages: [{ title: 'home', slug: 'home', contents: [textContent] }],
|
|
1367
|
+
});
|
|
1368
|
+
};
|
|
1369
|
+
|
|
1370
|
+
test('reflows the AI text into the template doc, keeping colour + alignment', async () => {
|
|
1371
|
+
const result = await applyUserPersonalisationToBrandPageModelAsync(
|
|
1372
|
+
PERSONALISATION,
|
|
1373
|
+
modelWith(templateDoc(), 'about'),
|
|
1374
|
+
);
|
|
1375
|
+
|
|
1376
|
+
const out = (result.model.pages[0].contents[0] as TextContent)
|
|
1377
|
+
.text as unknown as any;
|
|
1378
|
+
|
|
1379
|
+
expect(result.isModified).toBe(true);
|
|
1380
|
+
// still a doc — not flattened to a bare string
|
|
1381
|
+
expect(isTiptapDocument(out)).toBe(true);
|
|
1382
|
+
|
|
1383
|
+
const run = out.content[0].content[0];
|
|
1384
|
+
|
|
1385
|
+
// new copy injected …
|
|
1386
|
+
expect(run.text).toBe(PERSONALISATION.aboutSection.descriptionShort);
|
|
1387
|
+
// … and the template's embedded style preserved
|
|
1388
|
+
expect(run.marks.find((m: any) => m.type === 'textStyle').attrs.color).toBe(
|
|
1389
|
+
'var(--palette-0)',
|
|
1390
|
+
);
|
|
1391
|
+
expect(out.content[0].attrs.textAlign).toBe('center');
|
|
1392
|
+
});
|
|
1393
|
+
|
|
1394
|
+
test('leaves a doc field untouched when the block has no personalisation role', async () => {
|
|
1395
|
+
const original = templateDoc();
|
|
1396
|
+
|
|
1397
|
+
const result = await applyUserPersonalisationToBrandPageModelAsync(
|
|
1398
|
+
PERSONALISATION,
|
|
1399
|
+
modelWith(original, undefined),
|
|
1400
|
+
);
|
|
1401
|
+
|
|
1402
|
+
expect(result.isModified).toBe(false);
|
|
1403
|
+
expect((result.model.pages[0].contents[0] as TextContent).text).toEqual(
|
|
1404
|
+
original,
|
|
1405
|
+
);
|
|
1406
|
+
});
|
|
1407
|
+
});
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
PERSONALISATION_MAPPINGS,
|
|
5
5
|
TEXT_MEDIA_CONTENT_TYPES,
|
|
6
6
|
} from '@brand-page-maker/constants/personalisation.constant';
|
|
7
|
+
// Leaf import, not the `@brand-page-maker/utils` barrel: the barrel would drag the whole maker-utils
|
|
8
|
+
// graph into this brand-page module and risk a cycle (cf. the same guard in section-color-matches.ts).
|
|
9
|
+
import { reflowRteDoc, isTiptapDocument } from '@shared/rte-render.util';
|
|
7
10
|
import { BRAND_PAGE_TYPES, ShapeAspectRatioCategory } from '../models';
|
|
8
11
|
import type {
|
|
9
12
|
BrandPageModel,
|
|
@@ -581,7 +584,12 @@ const applyPersonalisationToBrandPageContentsRecursiveAsync = async (
|
|
|
581
584
|
newPersonalisation = updatedPersonalisation;
|
|
582
585
|
|
|
583
586
|
if (personalisationValue) {
|
|
584
|
-
|
|
587
|
+
// BP-5969: an RTE field is a Tiptap doc whose colour + typography live in its run marks.
|
|
588
|
+
// Writing the plain personalisation string raw would drop that style, so reflow the new
|
|
589
|
+
// text through the template doc's style skeleton instead; plain/URL fields write raw.
|
|
590
|
+
newContents[key] = isTiptapDocument(value)
|
|
591
|
+
? reflowRteDoc(value, personalisationValue)
|
|
592
|
+
: personalisationValue;
|
|
585
593
|
|
|
586
594
|
if (newValuesToUpdate) {
|
|
587
595
|
for (const [k, v] of Object.entries(newValuesToUpdate)) {
|