@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,4 +1,5 @@
|
|
|
1
1
|
import { reactive } from 'vue';
|
|
2
|
+
import { collectRteTextColors } from '@shared/color-strategies/rte-color';
|
|
2
3
|
import { assertUnreachable } from '../../helpers/ts.helper';
|
|
3
4
|
import type {
|
|
4
5
|
ImageContent,
|
|
@@ -28,6 +29,7 @@ import type {
|
|
|
28
29
|
ShapesSectionContent,
|
|
29
30
|
TextStyleOptions,
|
|
30
31
|
TextStyleDeclaration,
|
|
32
|
+
TextStyles,
|
|
31
33
|
PageHeaderDesktop,
|
|
32
34
|
PageFooterDesktop,
|
|
33
35
|
PageFooterMobile,
|
|
@@ -47,8 +49,16 @@ import type {
|
|
|
47
49
|
HeaderButton,
|
|
48
50
|
ButtonLinkType,
|
|
49
51
|
ContentType,
|
|
52
|
+
RteTextRole,
|
|
53
|
+
} from '../models';
|
|
54
|
+
import {
|
|
55
|
+
ButtonStyles,
|
|
56
|
+
TEXT_STYLE_TYPES,
|
|
57
|
+
VIEWPORTS,
|
|
58
|
+
isLegacyTextStyleType,
|
|
59
|
+
isCanonicalTextStyleType,
|
|
60
|
+
type CanonicalTextStyleType,
|
|
50
61
|
} from '../models';
|
|
51
|
-
import { ButtonStyles, TEXT_STYLE_TYPES, VIEWPORTS } from '../models';
|
|
52
62
|
import {
|
|
53
63
|
NavigationMobile,
|
|
54
64
|
NavigationDesktop,
|
|
@@ -100,22 +110,17 @@ import { resolveColorReference } from './color-palette.util';
|
|
|
100
110
|
import {
|
|
101
111
|
containerTextColorDefaults,
|
|
102
112
|
containerSurfaceForContent,
|
|
113
|
+
titleSurfaceContrastFill,
|
|
103
114
|
} from './container-text-color.util';
|
|
104
115
|
import type { ContentTextStylePropertyKey } from '../constants';
|
|
105
116
|
import {
|
|
106
117
|
CONTENT_TEXT_STYLE_PROPERTY_KEYS,
|
|
107
118
|
FALLBACK_DEFAULT_LINK_COLOR,
|
|
108
|
-
FONT_SIZE_BODY,
|
|
109
|
-
LINE_HEIGHT_BODY,
|
|
110
119
|
DEFAULT_LOGO_HEIGHT,
|
|
111
120
|
DEFAULT_LOGO_WIDTH,
|
|
112
121
|
ALIGN_LEFT_ALIGNED,
|
|
113
122
|
ALIGN_RIGHT_ALIGNED,
|
|
114
123
|
MAX_IMAGES_SECTION_ALIGNMENT_ITEMS_LENGTH,
|
|
115
|
-
FONT_FAMILY_CONFIGS,
|
|
116
|
-
isGoogleType,
|
|
117
|
-
LINE_HEIGHT_HEADINGS,
|
|
118
|
-
FONT_SIZE_HEADINGS,
|
|
119
124
|
DEFAULT_TEXT_ALIGN,
|
|
120
125
|
IMAGE_RESOLUTION_PRESETS,
|
|
121
126
|
BIG_IMAGE,
|
|
@@ -127,10 +132,14 @@ import {
|
|
|
127
132
|
ALIGN_RIGHT_FULL_IMAGE,
|
|
128
133
|
} from '../constants';
|
|
129
134
|
import uniq from 'lodash/uniq';
|
|
130
|
-
import { generateGoogleFontUrl } from './font-loader.util';
|
|
131
135
|
import { isValidSvgUrl } from './image.util';
|
|
132
136
|
import { isLogoContent } from './model.util';
|
|
133
|
-
import { resolveTextColor } from './text-style.util';
|
|
137
|
+
import { resolveTextColor, pickTypography } from './text-style.util';
|
|
138
|
+
import {
|
|
139
|
+
contentFieldReconnectSpec,
|
|
140
|
+
computeLegacyTargets,
|
|
141
|
+
bestFitRole,
|
|
142
|
+
} from './text-role-reconnect.util';
|
|
134
143
|
import { getBoxShadowValue, sectionFrameStyle } from './button.util';
|
|
135
144
|
import {
|
|
136
145
|
findNavItemByPageId,
|
|
@@ -138,10 +147,8 @@ import {
|
|
|
138
147
|
getRouteParamsByPage,
|
|
139
148
|
} from './route.util';
|
|
140
149
|
import { hasRTEContent, isTiptapDocument } from '../../brand-page-maker/utils';
|
|
141
|
-
import {
|
|
142
|
-
|
|
143
|
-
isHrefPageId,
|
|
144
|
-
} from '../../brand-page-maker/composables/rich-text-editor/hyperlink';
|
|
150
|
+
import { getPageIdFromHref } from '../../brand-page-maker/composables/rich-text-editor/hyperlink';
|
|
151
|
+
import { isHrefPageId } from '@shared/rte-link.util';
|
|
145
152
|
|
|
146
153
|
const BUTTON_BORDER_RADIUS = '9999px';
|
|
147
154
|
const CONTENT_BORDER_RADIUS = '48px';
|
|
@@ -168,52 +175,82 @@ const applyDefaultViewModelTextStyle = (textStyle: TextStyleDeclaration) => {
|
|
|
168
175
|
|
|
169
176
|
const getTextStyleByContentTextStyle = (
|
|
170
177
|
contentTextStyle: TextStyleDeclaration | undefined,
|
|
171
|
-
textStyleOptions: TextStyleOptions,
|
|
178
|
+
textStyleOptions: Partial<TextStyleOptions> | undefined,
|
|
179
|
+
startingRole: CanonicalTextStyleType,
|
|
172
180
|
): Partial<TextStyleDeclaration> | undefined => {
|
|
173
181
|
if (!contentTextStyle) {
|
|
174
182
|
return undefined;
|
|
175
183
|
}
|
|
176
184
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return contentTextStyle;
|
|
185
|
+
// Page data keeps only what the field itself sets; the painter references the role for the
|
|
186
|
+
// rest (`roleTypographyStyle`). Links keep a concrete colour last resort — they must never
|
|
187
|
+
// inherit.
|
|
188
|
+
return Object.assign({}, pickTypography(contentTextStyle), {
|
|
189
|
+
color: resolveTextColor(contentTextStyle) || FALLBACK_DEFAULT_LINK_COLOR,
|
|
190
|
+
textStyleType: fallbackTextRole(
|
|
191
|
+
undefined,
|
|
192
|
+
// Both call sites always pass a startingRole, which fallbackTextRole returns before it
|
|
193
|
+
// ever consults key — so no key value reaches contentFieldReconnectSpec here.
|
|
194
|
+
'',
|
|
195
|
+
contentTextStyle,
|
|
196
|
+
textStyleOptions,
|
|
197
|
+
startingRole,
|
|
198
|
+
),
|
|
199
|
+
});
|
|
195
200
|
};
|
|
196
201
|
|
|
197
202
|
const getCopyrightTextStyle = (
|
|
198
203
|
contentTextStyle: TextStyleDeclaration,
|
|
199
|
-
textStyleOptions: TextStyleOptions,
|
|
200
|
-
): TextStyleDeclaration =>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
204
|
+
textStyleOptions: Partial<TextStyleOptions> | undefined,
|
|
205
|
+
): TextStyleDeclaration =>
|
|
206
|
+
applyDefaultViewModelTextStyle(
|
|
207
|
+
Object.assign({}, pickTypography(contentTextStyle), {
|
|
208
|
+
color: resolveTextColor(contentTextStyle),
|
|
209
|
+
applyAutoScale: contentTextStyle.applyAutoScale,
|
|
210
|
+
textAlign: contentTextStyle.textAlign || DEFAULT_TEXT_ALIGN,
|
|
211
|
+
textStyleType: fallbackTextRole(
|
|
212
|
+
undefined,
|
|
213
|
+
'copyrightStyle',
|
|
214
|
+
contentTextStyle,
|
|
215
|
+
textStyleOptions,
|
|
216
|
+
),
|
|
217
|
+
}),
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* BP-5969 (R3) — the role a field draws through once it has no built-in default to fall back
|
|
222
|
+
* on: its own role when that's one of the ten; else an explicit `startingRole`, when the caller
|
|
223
|
+
* already knows it (S3: nav tabs and the hamburger reshape their key/content-type past what
|
|
224
|
+
* `contentFieldReconnectSpec` recognises, and `mapToButtonViewModel`'s callers reuse the
|
|
225
|
+
* SECTION's content type, not a button one — passing the role the upgrade actually assigns
|
|
226
|
+
* removes the dependency on either matching); else the field's starting role
|
|
227
|
+
* (`contentFieldReconnectSpec`, e.g. every button label is on Button text); else a retired
|
|
228
|
+
* role's successor (`computeLegacyTargets`); else the role nearest its own size, or Paragraph 1
|
|
229
|
+
* (`bestFitRole`). The same rule the upgrade and the AI boundary use (ADR 0021) — a field never
|
|
230
|
+
* reaches the page with no role, so a painter always has one to reference.
|
|
231
|
+
*/
|
|
232
|
+
const fallbackTextRole = (
|
|
233
|
+
contentType: string | undefined,
|
|
234
|
+
key: string,
|
|
235
|
+
ownStyle: TextStyleDeclaration | RteTextRole,
|
|
236
|
+
textStyleOptions: Partial<TextStyleOptions> | undefined,
|
|
237
|
+
startingRole?: CanonicalTextStyleType,
|
|
238
|
+
): CanonicalTextStyleType => {
|
|
239
|
+
const type = ownStyle?.textStyleType;
|
|
240
|
+
|
|
241
|
+
if (isCanonicalTextStyleType(type)) return type;
|
|
242
|
+
|
|
243
|
+
if (startingRole) return startingRole;
|
|
244
|
+
|
|
245
|
+
const spec = contentFieldReconnectSpec(contentType, key);
|
|
246
|
+
|
|
247
|
+
if (spec.startingRole) return spec.startingRole;
|
|
248
|
+
|
|
249
|
+
if (isLegacyTextStyleType(type)) {
|
|
250
|
+
return computeLegacyTargets(textStyleOptions)[type];
|
|
214
251
|
}
|
|
215
252
|
|
|
216
|
-
return
|
|
253
|
+
return bestFitRole(ownStyle, spec.family);
|
|
217
254
|
};
|
|
218
255
|
|
|
219
256
|
const getTextStyleByContentTextStyleProperty = (
|
|
@@ -224,26 +261,24 @@ const getTextStyleByContentTextStyleProperty = (
|
|
|
224
261
|
): TextStyleDeclaration => {
|
|
225
262
|
const contentTextStyle = content[contentPropKey] as TextStyleDeclaration;
|
|
226
263
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
)
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return applyDefaultViewModelTextStyle(contentTextStyle);
|
|
264
|
+
// BP-5969 (R1): page data keeps only what the field sets itself. Typography no longer
|
|
265
|
+
// merges the role's values in — the painter references the role for the rest
|
|
266
|
+
// (`roleTypographyStyle`/`fillRteRunTypography`). Colour keeps its own cascade (element,
|
|
267
|
+
// else the container default). Every field draws through a canonical role, real or a
|
|
268
|
+
// fallback (R3), so `textStyleType` is never legacy or missing in page data.
|
|
269
|
+
return applyDefaultViewModelTextStyle(
|
|
270
|
+
Object.assign({}, pickTypography(contentTextStyle), {
|
|
271
|
+
color: resolveTextColor(contentTextStyle, containerDefault),
|
|
272
|
+
applyAutoScale: contentTextStyle.applyAutoScale,
|
|
273
|
+
textAlign: contentTextStyle.textAlign || DEFAULT_TEXT_ALIGN,
|
|
274
|
+
textStyleType: fallbackTextRole(
|
|
275
|
+
content.type,
|
|
276
|
+
contentPropKey,
|
|
277
|
+
contentTextStyle,
|
|
278
|
+
textStyleOptions,
|
|
279
|
+
),
|
|
280
|
+
}),
|
|
281
|
+
);
|
|
247
282
|
};
|
|
248
283
|
|
|
249
284
|
export const applyViewModelTextStyles = <T extends ContentViewModel>(
|
|
@@ -274,20 +309,25 @@ const applyViewModelTextItemTextStyles = (
|
|
|
274
309
|
styles: PageStyles,
|
|
275
310
|
): TextItem[] => {
|
|
276
311
|
return textItems.map((item) => {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
312
|
+
// S6 — an item with no textStyle at all (no `?.` on the old code's own reads) threw in
|
|
313
|
+
// pickTypography/bestFitRole; falling back to `{}` gives every read below the same optional
|
|
314
|
+
// chaining an own textStyle already has.
|
|
315
|
+
const ownStyle = item.textStyle ?? {};
|
|
316
|
+
|
|
317
|
+
// BP-5969 (ADR-0020, R1): the item's style object is a slim role link (`RteTextRole`) that
|
|
318
|
+
// keeps only its own typography — the role is a reference the RTE run resolves at render
|
|
319
|
+
// (`fillRteRunTypography`). Colour rides the RTE mark, alignment the doc node.
|
|
320
|
+
const itemTextStyle: RteTextRole = {
|
|
321
|
+
...pickTypography(ownStyle),
|
|
322
|
+
applyAutoScale: ownStyle.applyAutoScale,
|
|
323
|
+
textAlign: ownStyle.textAlign || DEFAULT_TEXT_ALIGN,
|
|
324
|
+
textStyleType: fallbackTextRole(
|
|
325
|
+
undefined,
|
|
326
|
+
'textItems',
|
|
327
|
+
ownStyle,
|
|
328
|
+
styles.textStyles?.textStyleOptions,
|
|
329
|
+
),
|
|
330
|
+
};
|
|
291
331
|
|
|
292
332
|
return {
|
|
293
333
|
...item,
|
|
@@ -429,7 +469,12 @@ const mapToButtonViewModel = (
|
|
|
429
469
|
selectedButtonStyleId: styles.buttonStyles.selectedButtonStyleId,
|
|
430
470
|
};
|
|
431
471
|
|
|
432
|
-
// Extract only text-related properties from titleStyle, excluding button styling properties
|
|
472
|
+
// Extract only text-related properties from titleStyle, excluding button styling properties.
|
|
473
|
+
// No built-in line-height default (R3): an unset label follows its role, real or a fallback.
|
|
474
|
+
// Every `mapToButtonViewModel` label starts on Button text (S3): some callers (the banner/
|
|
475
|
+
// booking/images section CTA) reuse the SECTION's own content type here, which
|
|
476
|
+
// `contentFieldReconnectSpec` doesn't recognise as button content, so an explicit
|
|
477
|
+
// `startingRole` is passed rather than relying on that match.
|
|
433
478
|
const textOnlyProperties = {
|
|
434
479
|
color: options.titleStyle?.color,
|
|
435
480
|
fontFamily: options.titleStyle?.fontFamily,
|
|
@@ -437,8 +482,14 @@ const mapToButtonViewModel = (
|
|
|
437
482
|
fontWeight: options.titleStyle?.fontWeight,
|
|
438
483
|
textAlign: options.titleStyle?.textAlign,
|
|
439
484
|
letterSpacing: options.titleStyle?.letterSpacing,
|
|
440
|
-
lineHeight: options.titleStyle?.lineHeight
|
|
441
|
-
textStyleType:
|
|
485
|
+
lineHeight: options.titleStyle?.lineHeight,
|
|
486
|
+
textStyleType: fallbackTextRole(
|
|
487
|
+
content.type,
|
|
488
|
+
'titleStyle',
|
|
489
|
+
options.titleStyle ?? {},
|
|
490
|
+
styles.textStyles?.textStyleOptions,
|
|
491
|
+
'button',
|
|
492
|
+
),
|
|
442
493
|
applyAutoScale: options.titleStyle?.applyAutoScale,
|
|
443
494
|
textDecoration: options.titleStyle?.textDecoration,
|
|
444
495
|
fontStyle: options.titleStyle?.fontStyle,
|
|
@@ -487,23 +538,13 @@ export const mapToProfileViewModel = (
|
|
|
487
538
|
|
|
488
539
|
containerStyle = applyContentBorderRadius(containerStyle);
|
|
489
540
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
lineHeight: content.titleStyle?.lineHeight || LINE_HEIGHT_BODY,
|
|
494
|
-
};
|
|
495
|
-
|
|
541
|
+
// R3: no built-in size or line height. An unset field draws through its role — real, or a
|
|
542
|
+
// fallback nearest its own size (`fallbackTextRole`, dispatched generically below).
|
|
543
|
+
const titleStyle: TextStyleDeclaration = { ...content.titleStyle };
|
|
496
544
|
const descriptionStyle: TextStyleDeclaration = {
|
|
497
545
|
...content.descriptionStyle,
|
|
498
|
-
fontSize: content.descriptionStyle?.fontSize || FONT_SIZE_BODY,
|
|
499
|
-
lineHeight: content.descriptionStyle?.lineHeight || LINE_HEIGHT_BODY,
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
const nameStyle: TextStyleDeclaration = {
|
|
503
|
-
...content.nameStyle,
|
|
504
|
-
fontSize: content.nameStyle?.fontSize || FONT_SIZE_HEADINGS,
|
|
505
|
-
lineHeight: content.nameStyle?.lineHeight || LINE_HEIGHT_HEADINGS,
|
|
506
546
|
};
|
|
547
|
+
const nameStyle: TextStyleDeclaration = { ...content.nameStyle };
|
|
507
548
|
|
|
508
549
|
return applyViewModelTextStyles(
|
|
509
550
|
{
|
|
@@ -538,12 +579,9 @@ export const mapToTextViewModel = (
|
|
|
538
579
|
|
|
539
580
|
containerStyle = applyContentBorderRadius(containerStyle);
|
|
540
581
|
|
|
541
|
-
|
|
582
|
+
// Migration-22 folds legacy textSize/alignment/colour into textStyle. Rendering only reads the
|
|
583
|
+
// canonical field, so a post-migration page has no runtime legacy-style fallback.
|
|
542
584
|
const contentTextStyle: TextStyleDeclaration = {
|
|
543
|
-
lineHeight: LINE_HEIGHT_BODY,
|
|
544
|
-
...content.textSize,
|
|
545
|
-
...content.textAlignment,
|
|
546
|
-
...content.textColor,
|
|
547
585
|
...content.textStyle,
|
|
548
586
|
};
|
|
549
587
|
|
|
@@ -616,11 +654,8 @@ export const mapToMailingListViewModel = (
|
|
|
616
654
|
selectedButtonStyleId: styles.buttonStyles.selectedButtonStyleId,
|
|
617
655
|
};
|
|
618
656
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
fontWeight: 'bold',
|
|
622
|
-
...content.titleStyle,
|
|
623
|
-
};
|
|
657
|
+
// R3: no built-in size or bold. An unset title draws through its role, real or a fallback.
|
|
658
|
+
const titleStyle: TextStyleDeclaration = { ...content.titleStyle };
|
|
624
659
|
|
|
625
660
|
const viewModel: MailingListViewModel = applyViewModelTextStyles(
|
|
626
661
|
{
|
|
@@ -639,7 +674,8 @@ export const mapToMailingListViewModel = (
|
|
|
639
674
|
// to the same surface the title uses (the block's own fill, else the button fill).
|
|
640
675
|
viewModel.disclosureColor = disclosureColorFor(
|
|
641
676
|
containerSurfaceForContent(content, styles) ?? viewModel.styles?.style,
|
|
642
|
-
|
|
677
|
+
// BP-5969 (ADR-0020): the RTE title's colour lives in its mark, not the style object.
|
|
678
|
+
collectRteTextColors(content.title)?.colors[0],
|
|
643
679
|
styles.colors,
|
|
644
680
|
);
|
|
645
681
|
|
|
@@ -650,10 +686,8 @@ const mapToSupportMeViewModel = (
|
|
|
650
686
|
content: SupportMeContent,
|
|
651
687
|
styles: PageStyles,
|
|
652
688
|
): SupportMeViewModel => {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
...content.titleStyle,
|
|
656
|
-
};
|
|
689
|
+
// R3: no built-in bold. An unset title draws through its role, real or a fallback.
|
|
690
|
+
const titleStyle: TextStyleDeclaration = { ...content.titleStyle };
|
|
657
691
|
|
|
658
692
|
return applyViewModelTextStyles(
|
|
659
693
|
{
|
|
@@ -773,7 +807,8 @@ export const mapToContactFormViewModel = (
|
|
|
773
807
|
|
|
774
808
|
viewModel.disclosureColor = disclosureColorFor(
|
|
775
809
|
contactFormDisclosureSurface(viewModel, brandPageType),
|
|
776
|
-
|
|
810
|
+
// BP-5969 (ADR-0020): the RTE title's colour lives in its mark, not the style object.
|
|
811
|
+
collectRteTextColors(content.title)?.colors[0],
|
|
777
812
|
styles.colors,
|
|
778
813
|
);
|
|
779
814
|
|
|
@@ -986,6 +1021,7 @@ const mapToShapesSectionViewModel = (
|
|
|
986
1021
|
const mapToShopViewModel = (
|
|
987
1022
|
content: ShopContent,
|
|
988
1023
|
styles: PageStyles,
|
|
1024
|
+
brandPageType?: BrandPageType,
|
|
989
1025
|
): ShopViewModel => {
|
|
990
1026
|
const buttonStyles = new ButtonStyles({
|
|
991
1027
|
selectedButtonStyleId: styles.buttonStyles.selectedButtonStyleId,
|
|
@@ -1011,6 +1047,12 @@ const mapToShopViewModel = (
|
|
|
1011
1047
|
},
|
|
1012
1048
|
isFullWidth: true,
|
|
1013
1049
|
isShippingEnabled: content.shopPaymentConfig?.isShippingEnabled ?? false,
|
|
1050
|
+
// No page base coat to inherit (ADR-0020): the "no products" label is a fixed
|
|
1051
|
+
// string, not a text field, so it takes the title's own colour when the title has
|
|
1052
|
+
// one, else the same contrast colour the title itself would fall back to.
|
|
1053
|
+
noProductsColor:
|
|
1054
|
+
collectRteTextColors(content.title)?.colors[0] ??
|
|
1055
|
+
titleSurfaceContrastFill(content, styles, brandPageType),
|
|
1014
1056
|
},
|
|
1015
1057
|
styles,
|
|
1016
1058
|
);
|
|
@@ -1048,14 +1090,9 @@ const mapToSocialLinksViewModel = (
|
|
|
1048
1090
|
...content,
|
|
1049
1091
|
role: content.type,
|
|
1050
1092
|
type: 'social-links',
|
|
1051
|
-
//
|
|
1052
|
-
//
|
|
1053
|
-
// entry, so no resolver touches it and nothing else supplies the icon colour.
|
|
1093
|
+
// No `color` pre-seed (see the testimonial mapper). The icon fill is stored — baked at
|
|
1094
|
+
// birth and by migration-22 — so it takes no seed either.
|
|
1054
1095
|
titleStyle: { ...content.titleStyle },
|
|
1055
|
-
iconFillStyles: {
|
|
1056
|
-
fill: styles.textStyles?.textStyleOptions?.paragraphs?.style?.color,
|
|
1057
|
-
...content.iconFillStyles,
|
|
1058
|
-
},
|
|
1059
1096
|
isFullWidth: brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
1060
1097
|
},
|
|
1061
1098
|
styles,
|
|
@@ -1210,7 +1247,7 @@ const mapToHeaderButtonViewModel = (
|
|
|
1210
1247
|
}
|
|
1211
1248
|
|
|
1212
1249
|
const titleStyle: TextStyleDeclaration = headerButton.buttonTextStyle ?? {
|
|
1213
|
-
textStyleType: TEXT_STYLE_TYPES.
|
|
1250
|
+
textStyleType: TEXT_STYLE_TYPES.button,
|
|
1214
1251
|
};
|
|
1215
1252
|
|
|
1216
1253
|
const viewModel = mapToButtonViewModel(
|
|
@@ -1257,6 +1294,23 @@ const mapToHeaderButtonViewModel = (
|
|
|
1257
1294
|
};
|
|
1258
1295
|
};
|
|
1259
1296
|
|
|
1297
|
+
/**
|
|
1298
|
+
* The Save Contact label's typography: only its own field, plus its role. Save Contact only ever
|
|
1299
|
+
* draws through Button text (S8) — whatever role the stored field names, canonical or retired,
|
|
1300
|
+
* is normalised to it, so a stray role never reaches this label. `TextWrapper` then references
|
|
1301
|
+
* the role for the rest, the same as any other role-linked text.
|
|
1302
|
+
*/
|
|
1303
|
+
export const resolveSaveContactTitleStyle = (
|
|
1304
|
+
buttonTextStyle: TextStyleDeclaration | undefined,
|
|
1305
|
+
// Unused: the label is always Button text (S8), so no role lookup is needed here — kept so
|
|
1306
|
+
// SaveContactWidget.vue's existing call site (`props.textStyles`) doesn't need to change.
|
|
1307
|
+
textStyles: TextStyles | undefined,
|
|
1308
|
+
): TextStyleDeclaration =>
|
|
1309
|
+
Object.assign({}, pickTypography(buttonTextStyle ?? {}), {
|
|
1310
|
+
color: resolveTextColor(buttonTextStyle),
|
|
1311
|
+
textStyleType: 'button' as const,
|
|
1312
|
+
}) as TextStyleDeclaration;
|
|
1313
|
+
|
|
1260
1314
|
export const mapToPageHeaderViewModel = (
|
|
1261
1315
|
pageHeader: PageHeaderDesktop | PageHeaderMobile,
|
|
1262
1316
|
pageStyles: PageStyles,
|
|
@@ -1284,6 +1338,7 @@ export const mapToPageHeaderViewModel = (
|
|
|
1284
1338
|
const navDefaultButtonTextStyle = getTextStyleByContentTextStyle(
|
|
1285
1339
|
pageHeader.navigation.defaultButtonStyle,
|
|
1286
1340
|
pageStyles.textStyles.textStyleOptions,
|
|
1341
|
+
'paragraph1',
|
|
1287
1342
|
);
|
|
1288
1343
|
|
|
1289
1344
|
const navDefaultButtonStyle = Object.assign(
|
|
@@ -1304,6 +1359,7 @@ export const mapToPageHeaderViewModel = (
|
|
|
1304
1359
|
const hamburgerButtonTextStyle = getTextStyleByContentTextStyle(
|
|
1305
1360
|
pageHeader.navigation.hamburgerMenuStyle.defaultButtonStyle,
|
|
1306
1361
|
pageStyles.textStyles.textStyleOptions,
|
|
1362
|
+
'button',
|
|
1307
1363
|
);
|
|
1308
1364
|
|
|
1309
1365
|
const hamburgerButtonStyle = Object.assign(
|
|
@@ -1425,7 +1481,6 @@ export const mapToPageFooterViewModel = (
|
|
|
1425
1481
|
iconStyle: { ...pageFooter.iconStyle },
|
|
1426
1482
|
logo: mapToLogoViewModel(logoContent, logoStyles, useOldLogoRenderSize),
|
|
1427
1483
|
socialLinks: pageFooter.socialLinks,
|
|
1428
|
-
textFontFamily: pageFooter.textFontFamily,
|
|
1429
1484
|
};
|
|
1430
1485
|
};
|
|
1431
1486
|
|
|
@@ -1476,7 +1531,11 @@ export const mapToViewModel =
|
|
|
1476
1531
|
styles,
|
|
1477
1532
|
);
|
|
1478
1533
|
case 'shop-section':
|
|
1479
|
-
return mapToShopViewModel(
|
|
1534
|
+
return mapToShopViewModel(
|
|
1535
|
+
content as ShopContent,
|
|
1536
|
+
styles,
|
|
1537
|
+
brandPageType,
|
|
1538
|
+
);
|
|
1480
1539
|
|
|
1481
1540
|
case 'profile':
|
|
1482
1541
|
return mapToProfileViewModel(content as ProfileContent, styles);
|
|
@@ -1686,6 +1745,7 @@ export const getBrandPageViewModelFromBrandPageModel = (
|
|
|
1686
1745
|
? {
|
|
1687
1746
|
isSavingEnabled: model.saveContactSettings.isSavingEnabled ?? true,
|
|
1688
1747
|
hideBranding: model.saveContactSettings.hideBranding ?? false,
|
|
1748
|
+
buttonTextStyle: model.saveContactSettings.buttonTextStyle,
|
|
1689
1749
|
}
|
|
1690
1750
|
: { isSavingEnabled: true, hideBranding: false },
|
|
1691
1751
|
};
|
|
@@ -1908,6 +1968,7 @@ export const applyLogoTemplateImageToBrandPageViewModel = (
|
|
|
1908
1968
|
|
|
1909
1969
|
export interface CriticalResourceURLs {
|
|
1910
1970
|
images: string[];
|
|
1971
|
+
/** Always empty: the renderer layout preloads every font (`0036-retire-text-font-family.md`). */
|
|
1911
1972
|
fonts: string[];
|
|
1912
1973
|
shapes: string[];
|
|
1913
1974
|
}
|
|
@@ -1919,21 +1980,9 @@ export const getCriticalResourceURLs = (
|
|
|
1919
1980
|
viewModel: BrandPageViewModel,
|
|
1920
1981
|
): CriticalResourceURLs => {
|
|
1921
1982
|
let images: CriticalResourceURLs['images'] = [];
|
|
1922
|
-
let fonts: CriticalResourceURLs['fonts'] = [];
|
|
1923
1983
|
let shapes: CriticalResourceURLs['shapes'] = [];
|
|
1924
1984
|
|
|
1925
1985
|
try {
|
|
1926
|
-
// fonts
|
|
1927
|
-
const fontFamily = viewModel.styles?.textStyles?.textFontFamily;
|
|
1928
|
-
|
|
1929
|
-
if (typeof fontFamily !== 'undefined' && fontFamily.length) {
|
|
1930
|
-
const fontConfig = FONT_FAMILY_CONFIGS[fontFamily];
|
|
1931
|
-
|
|
1932
|
-
if (isGoogleType(fontConfig)) {
|
|
1933
|
-
fonts.push(generateGoogleFontUrl([fontConfig]));
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
1986
|
// shapes
|
|
1938
1987
|
const bgShapeFullBg =
|
|
1939
1988
|
viewModel.styles?.backgroundStylesViewModel.backgroundImageUrl;
|
|
@@ -1953,7 +2002,6 @@ export const getCriticalResourceURLs = (
|
|
|
1953
2002
|
// });
|
|
1954
2003
|
// }
|
|
1955
2004
|
|
|
1956
|
-
fonts = uniq(fonts);
|
|
1957
2005
|
images = uniq(images);
|
|
1958
2006
|
shapes = uniq(shapes);
|
|
1959
2007
|
} catch (err) {
|
|
@@ -1962,7 +2010,7 @@ export const getCriticalResourceURLs = (
|
|
|
1962
2010
|
|
|
1963
2011
|
return {
|
|
1964
2012
|
images,
|
|
1965
|
-
fonts,
|
|
2013
|
+
fonts: [],
|
|
1966
2014
|
shapes,
|
|
1967
2015
|
};
|
|
1968
2016
|
};
|
|
@@ -161,6 +161,10 @@ export interface ShopViewModel
|
|
|
161
161
|
buttonStyles: ButtonStyles;
|
|
162
162
|
isFullWidth: boolean;
|
|
163
163
|
isShippingEnabled: boolean;
|
|
164
|
+
// The "no products" fixed label's colour (ADR-0020: no page base coat to inherit) — the
|
|
165
|
+
// title's own colour, else the title's contrast colour. Always computed, whether or not
|
|
166
|
+
// there are products; Shop.vue itself gates the label's render on `products.length`.
|
|
167
|
+
noProductsColor?: string;
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
export interface ContactFormViewModel
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, test, expect, vi } from 'vitest';
|
|
2
|
+
import BrandPageMakerMixin from './BrandPageMaker.mixin';
|
|
3
|
+
import { BRAND_PAGE_TYPES } from '@brand-page';
|
|
4
|
+
import type { InitialisePayload } from '@brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
|
|
5
|
+
|
|
6
|
+
// Only the payload `created` hands the store is under test, so the store stops the hook there.
|
|
7
|
+
const mixin = BrandPageMakerMixin as unknown as {
|
|
8
|
+
created(this: unknown): Promise<void>;
|
|
9
|
+
methods: { getBrandPageFromFallback: (viewModel: unknown) => unknown };
|
|
10
|
+
};
|
|
11
|
+
const STOP = new Error('stop after initialise');
|
|
12
|
+
|
|
13
|
+
const initialisePayload = async (
|
|
14
|
+
viewModel: Record<string, unknown>,
|
|
15
|
+
): Promise<InitialisePayload> => {
|
|
16
|
+
let payload: InitialisePayload | undefined;
|
|
17
|
+
|
|
18
|
+
const context = {
|
|
19
|
+
viewModel: {
|
|
20
|
+
logoDraftDesignAttributes: { logoTheme: {} },
|
|
21
|
+
brandPageType: BRAND_PAGE_TYPES.brandSite,
|
|
22
|
+
...viewModel,
|
|
23
|
+
},
|
|
24
|
+
containerStore: { baseFabricRenderUrl: 'https://localhost:6006/' },
|
|
25
|
+
brandPageMakerStore: {
|
|
26
|
+
initialise: vi.fn(async (value: InitialisePayload) => {
|
|
27
|
+
payload = value;
|
|
28
|
+
throw STOP;
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
getBrandPageFromFallback: mixin.methods.getBrandPageFromFallback,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
await expect(mixin.created.call(context)).rejects.toBe(STOP);
|
|
35
|
+
|
|
36
|
+
return payload!;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
describe('BrandPageMaker created — blank site', () => {
|
|
40
|
+
test('with no saved data it builds a blank site and says so', async () => {
|
|
41
|
+
const payload = await initialisePayload({});
|
|
42
|
+
|
|
43
|
+
expect(payload.isBlankSite).toBe(true);
|
|
44
|
+
expect(payload.brandPage).toMatchObject({
|
|
45
|
+
brandPageType: BRAND_PAGE_TYPES.brandSite,
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('saved data is not a blank site', async () => {
|
|
50
|
+
const payload = await initialisePayload({
|
|
51
|
+
brandPageData: JSON.stringify({ pages: [] }),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
expect(payload.isBlankSite).toBe(false);
|
|
55
|
+
expect(payload.brandPage).toEqual({ pages: [] });
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -199,7 +199,7 @@ export default defineComponent({
|
|
|
199
199
|
console.error('logo theme is missing');
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
let brandPage: BrandPageData;
|
|
202
|
+
let brandPage: BrandPageData | undefined;
|
|
203
203
|
|
|
204
204
|
if (this.viewModel?.brandPageMetadataS3Url) {
|
|
205
205
|
const assetClient = new AssetLibraryClient({
|
|
@@ -218,6 +218,8 @@ export default defineComponent({
|
|
|
218
218
|
brandPage = this.getBrandPageFromFallback(this.viewModel);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
const isBlankSite = !brandPage;
|
|
222
|
+
|
|
221
223
|
const shopConfigData = this.viewModel?.shopConfigData?.trim()
|
|
222
224
|
? (JSON.parse(this.viewModel.shopConfigData) as ShopConfigData)
|
|
223
225
|
: null;
|
|
@@ -231,7 +233,9 @@ export default defineComponent({
|
|
|
231
233
|
});
|
|
232
234
|
|
|
233
235
|
await this.brandPageMakerStore.initialise({
|
|
234
|
-
brandPage
|
|
236
|
+
brandPage:
|
|
237
|
+
brandPage ?? createInitialBrandPage(this.viewModel.brandPageType),
|
|
238
|
+
isBlankSite,
|
|
235
239
|
logoDraftDesignAttributes: this.viewModel.logoDraftDesignAttributes,
|
|
236
240
|
unsplashApplicationName: this.viewModel.unsplashApplicationName,
|
|
237
241
|
templateCategories: this.viewModel.templateCategories,
|
|
@@ -355,15 +359,15 @@ export default defineComponent({
|
|
|
355
359
|
}, 800);
|
|
356
360
|
},
|
|
357
361
|
methods: {
|
|
358
|
-
getBrandPageFromFallback(viewModel): BrandPageData {
|
|
362
|
+
getBrandPageFromFallback(viewModel): BrandPageData | undefined {
|
|
359
363
|
if (
|
|
360
364
|
viewModel?.brandPageData &&
|
|
361
365
|
typeof viewModel.brandPageData === 'string'
|
|
362
366
|
) {
|
|
363
367
|
return JSON.parse(viewModel.brandPageData!) as BrandPageData;
|
|
364
|
-
} else {
|
|
365
|
-
return createInitialBrandPage(viewModel.brandPageType);
|
|
366
368
|
}
|
|
369
|
+
|
|
370
|
+
return undefined;
|
|
367
371
|
},
|
|
368
372
|
|
|
369
373
|
async handleCaptureSnapshot() {
|