@designcrowd/library.brand-page 6.2.11 → 6.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-DDcraD5S.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DtOeaisf.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BZpmJPew.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CqRwC4e7.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CqRwC4e7.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DId9Dfjh.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DId9Dfjh.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BTDfmOcm.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CeAu9Ayx.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-WCv0K41H.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BlfevQDY.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-Cvt7MHPZ.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DipZuylv.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BCw4lcKN.js → CreatedOnDcom-pt-pt-Cf6u2GCg.js} +1 -1
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.d.ts +16 -0
- package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.js +35 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +3 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +19 -13
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +3 -1
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +17 -2
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.d.ts +11 -3
- package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.js +35 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +8 -2
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +27 -3
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/page/Page.mixin.js +33 -27
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.d.ts +7 -2
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.js +21 -1
- package/lib/src/brand-page/components/payment/Payment.mixin.d.ts +5 -2
- package/lib/src/brand-page/components/payment/Payment.mixin.js +22 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +6 -2
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +32 -1
- package/lib/src/brand-page/components/social-links/SocialLinks.stories.js +0 -3
- package/lib/src/brand-page/components/testimonial-section/__fixtures__/data.js +0 -3
- package/lib/src/brand-page/components/text/Text.stories.js +0 -17
- package/lib/src/brand-page/constants/font.constants.d.ts +62 -0
- package/lib/src/brand-page/constants/font.constants.js +35 -0
- package/lib/src/brand-page/models/index.d.ts +23 -24
- package/lib/src/brand-page/models/index.js +20 -7
- package/lib/src/brand-page/models/navigation-styles.model.d.ts +1 -1
- package/lib/src/brand-page/models/navigation-styles.model.js +17 -8
- package/lib/src/brand-page/models/payment.model.d.ts +11 -6
- package/lib/src/brand-page/models/styles.model.d.ts +53 -7
- package/lib/src/brand-page/models/styles.model.js +115 -27
- package/lib/src/brand-page/utils/color-palette.util.d.ts +43 -23
- package/lib/src/brand-page/utils/color-palette.util.js +65 -27
- package/lib/src/brand-page/utils/color.util.d.ts +13 -9
- package/lib/src/brand-page/utils/color.util.js +56 -15
- package/lib/src/brand-page/utils/container-text-color.util.d.ts +46 -13
- package/lib/src/brand-page/utils/container-text-color.util.js +321 -41
- package/lib/src/brand-page/utils/index.d.ts +1 -0
- package/lib/src/brand-page/utils/index.js +1 -0
- package/lib/src/brand-page/utils/migration/migration-20.js +6 -2
- package/lib/src/brand-page/utils/migration/migration-21.js +34 -6
- package/lib/src/brand-page/utils/migration/migration-22.d.ts +99 -0
- package/lib/src/brand-page/utils/migration/migration-22.js +909 -0
- package/lib/src/brand-page/utils/migration.util.js +17 -0
- package/lib/src/brand-page/utils/model.util.d.ts +4 -0
- package/lib/src/brand-page/utils/model.util.js +4 -0
- package/lib/src/brand-page/utils/personalisation.util.js +9 -1
- package/lib/src/brand-page/utils/rte-role-lift.util.d.ts +72 -0
- package/lib/src/brand-page/utils/rte-role-lift.util.js +275 -0
- package/lib/src/brand-page/utils/style.util.d.ts +5 -1
- package/lib/src/brand-page/utils/style.util.js +34 -11
- package/lib/src/brand-page/utils/text-role-css.util.d.ts +19 -0
- package/lib/src/brand-page/utils/text-role-css.util.js +186 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.d.ts +90 -0
- package/lib/src/brand-page/utils/text-role-reconnect.util.js +434 -0
- package/lib/src/brand-page/utils/text-style.util.d.ts +53 -23
- package/lib/src/brand-page/utils/text-style.util.js +122 -22
- package/lib/src/brand-page/utils/view-model.util.d.ts +9 -1
- package/lib/src/brand-page/utils/view-model.util.js +124 -111
- package/lib/src/brand-page/view-models.d.ts +1 -0
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +13 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +4 -4
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -10
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.js +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +23 -138
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -28
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +5 -2
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +4 -1
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +1 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.d.ts +16 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.js +61 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.d.ts +11 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.js +236 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.js +25 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.d.ts +17 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.js +204 -17
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +29 -31
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.d.ts +20 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.js +60 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.d.ts +2 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.js +22 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +10 -4
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +319 -275
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -5
- package/lib/src/brand-page-maker/convertors/text-css-style-options.convertor.js +6 -2
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.d.ts +1 -1
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
- package/lib/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.js +7 -14
- package/lib/src/brand-page-maker/default-getters/text-color.default-getter.js +6 -13
- package/lib/src/brand-page-maker/models/content-settings.d.ts +8 -0
- package/lib/src/brand-page-maker/models/content-settings.js +112 -81
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.d.ts +2 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.js +5 -2
- package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.js +4 -3
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1257 -117
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +6 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +17 -9
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +59 -5
- package/lib/src/brand-page-maker/stores/history/history-store.js +22 -2
- package/lib/src/brand-page-maker/utils/apply-color-strategy.js +26 -8
- package/lib/src/brand-page-maker/utils/index.d.ts +2 -1
- package/lib/src/brand-page-maker/utils/index.js +2 -1
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +117 -15
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +435 -281
- package/lib/src/brand-page-maker/utils/rte-authoring.util.d.ts +4 -0
- package/lib/src/brand-page-maker/utils/rte-authoring.util.js +101 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.d.ts +126 -0
- package/lib/src/brand-page-maker/utils/rte-clipboard.util.js +307 -0
- package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +13 -3
- package/lib/src/{bundled-translations-zfiA5Tsw.js → bundled-translations-yGrvPE5i.js} +17 -17
- package/lib/src/{bundled-translations.de-DE-ChsdSyAP.js → bundled-translations.de-DE-L4Znf8Hs.js} +17 -17
- package/lib/src/{bundled-translations.es-ES-DflsWQK0.js → bundled-translations.es-ES-D6iticrK.js} +15 -15
- package/lib/src/{bundled-translations.fr-CA-fpDRuZ52.js → bundled-translations.fr-CA-BgAVE-9k.js} +25 -25
- package/lib/src/{bundled-translations.fr-FR-Bub73Zt-.js → bundled-translations.fr-FR-B8GbyqxQ.js} +17 -17
- package/lib/src/{bundled-translations.pt-BR-BlnWE9TB.js → bundled-translations.pt-BR-DjPU3Db7.js} +25 -25
- package/lib/src/{bundled-translations.pt-PT-DmzXlnaS.js → bundled-translations.pt-PT-BaepaDpr.js} +23 -23
- package/lib/src/bundles/bundled-translations.de-DE.json +21 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/lib/src/bundles/bundled-translations.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/lib/src/clients/ai-assistant-client.d.ts +1 -0
- package/lib/src/composables/useTranslate.d.ts +1 -1
- package/lib/src/composables/useTranslate.js +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +303 -207
- package/lib/src/css/library.brand-page-brandPage.min.css +303 -207
- package/lib/src/css/library.brand-page-designCom.min.css +303 -207
- package/lib/src/css/library.brand-page-preview.min.css +303 -207
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.mjs +195 -191
- package/lib/src/{lib-1AqtEmvQ.js → lib-kGRlD3_P.js} +36855 -33893
- package/lib/src/lib.js +2 -1
- package/lib/src/metadata-builder/builders/footer-builder.js +4 -5
- package/lib/src/metadata-builder/builders/global-role-propagation.d.ts +58 -0
- package/lib/src/metadata-builder/builders/global-role-propagation.js +246 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +1 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.js +116 -45
- package/lib/src/metadata-builder/builders/header-builder.js +13 -4
- package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +4 -4
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +3 -3
- package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +8 -2
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +2 -2
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +60 -29
- package/lib/src/metadata-builder/builders/section-field-maps.js +1 -0
- package/lib/src/metadata-builder/builders/section-field-utils.d.ts +48 -19
- package/lib/src/metadata-builder/builders/section-field-utils.js +128 -52
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +4 -2
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +28 -12
- package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +5 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +1 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.js +97 -40
- package/lib/src/metadata-builder/metadata-executor.js +23 -1
- package/lib/src/metadata-builder/models.d.ts +2 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +18 -19
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +18 -1
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +1 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +0 -1
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +5 -8
- package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +7 -16
- package/lib/src/metadata-builder/sanitizers/section-args-validator.js +95 -22
- package/lib/src/shared/color-palette/section-color-matches.js +9 -25
- package/lib/src/shared/color-strategies/color-strategies.d.ts +15 -0
- package/lib/src/shared/color-strategies/color-strategies.js +31 -0
- package/lib/src/shared/color-strategies/rte-color.d.ts +8 -0
- package/lib/src/shared/color-strategies/rte-color.js +16 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +23 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.js +28 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +9 -135
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -27
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +12 -2
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +7 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +75 -6
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +18 -7
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +6 -1
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -7
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +8 -4
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1255 -26
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +203 -59
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +6 -0
- package/lib/src/shared/content-settings/store/content-settings-store.js +105 -8
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +5 -1
- package/lib/src/shared/navigation-style-settings/store/index.d.ts +7 -3
- package/lib/src/shared/navigation-style-settings/store/index.js +40 -15
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +17 -5
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +70 -13
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +10 -2
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -1
- package/lib/src/shared/page-settings/store/page-settings-store.js +17 -0
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +4 -1
- package/lib/src/shared/rte-extensions/AutoLink.d.ts +17 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.js +67 -51
- package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.js +4 -1
- package/lib/src/shared/rte-extensions/TextEffects.d.ts +28 -0
- package/lib/src/shared/rte-extensions/TextEffects.js +96 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.d.ts +2 -0
- package/lib/src/shared/rte-extensions/ViewDomParser.js +21 -0
- package/lib/src/shared/rte-extensions.util.d.ts +25 -0
- package/lib/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.js → shared/rte-extensions.util.js} +62 -7
- package/lib/src/shared/rte-link.util.d.ts +1 -0
- package/lib/src/shared/rte-link.util.js +1 -0
- package/lib/src/shared/rte-render.util.d.ts +112 -0
- package/lib/src/shared/rte-render.util.js +255 -0
- package/lib/src/shared/rte-shape.util.d.ts +6 -0
- package/lib/src/shared/rte-shape.util.js +18 -0
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +2 -1
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
- package/lib/src/shared/side-bar/store/side-bar-store.d.ts +2 -0
- package/lib/src/shared/side-bar/store/side-bar-store.js +9 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +155 -15
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +7 -1
- package/lib/src/shared/style-settings/store/style-settings-store.d.ts +1 -9
- package/lib/src/shared/style-settings/store/style-settings-store.js +3 -33
- package/lib/src/shared/style-settings/text-style-size-order.d.ts +2 -0
- package/lib/src/shared/style-settings/text-style-size-order.js +13 -0
- package/lib/src/shared/text-role-typography.util.d.ts +64 -0
- package/lib/src/shared/text-role-typography.util.js +183 -0
- package/lib/src/utils/minify-brand-page-metadata.d.ts +16 -1
- package/lib/src/utils/minify-brand-page-metadata.js +31 -9
- package/package.json +1 -1
- package/src/brand-page/__fixtures__/migration-22-v21/edited-brandsite-sections.v21.json +982 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandcontact-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandpage-every-section.v21.json +1231 -0
- package/src/brand-page/__fixtures__/migration-22-v21/new-brandsite-every-section.v21.json +1243 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandcontact.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-general-link.v21.json +527 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-links.v21.json +755 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-social-links.v21.json +514 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-about.v21.json +459 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-footer.v21.json +469 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-header-banner.v21.json +481 -0
- package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-sections.v21.json +800 -0
- package/src/brand-page/__fixtures__/production-text-style-resolver.fixture.ts +52 -0
- package/src/brand-page/components/about-section/AboutSection.vue.test.ts +0 -10
- package/src/brand-page/components/contact-form/ContactForm.mixin.test.ts +127 -0
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +31 -14
- package/src/brand-page/components/contact-form/ContactForm.vue +26 -12
- package/src/brand-page/components/contact-form/ContactForm.vue.test.ts +60 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.test.ts +92 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +28 -3
- package/src/brand-page/components/mailing-list/MailingList.vue +9 -4
- package/src/brand-page/components/mailing-list/MailingList.vue.test.ts +63 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.ts +51 -1
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.test.ts +114 -0
- package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.vue +8 -2
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.test.ts +182 -0
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +59 -12
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +40 -3
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +15 -7
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +133 -3
- package/src/brand-page/components/page/Page.mixin.ts +41 -34
- package/src/brand-page/components/page/Page.vue +17 -6
- package/src/brand-page/components/page/Page.vue.test.ts +91 -1
- package/src/brand-page/components/page-footer/PageFooter.mixin.ts +32 -2
- package/src/brand-page/components/page-footer/PageFooter.test.ts +79 -0
- package/src/brand-page/components/page-footer/PageFooter.vue +12 -4
- package/src/brand-page/components/payment/Payment.mixin.ts +34 -2
- package/src/brand-page/components/payment/Payment.test.ts +188 -0
- package/src/brand-page/components/payment/Payment.vue +12 -5
- package/src/brand-page/components/payment/RequestPaymentStripe.vue +1 -0
- package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +49 -2
- package/src/brand-page/components/payment/support-me/SupportMe.test.ts +100 -0
- package/src/brand-page/components/payment/support-me/SupportMe.vue +7 -1
- package/src/brand-page/components/payment/support-me/SupportMe.vue.test.ts +66 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.test.ts +100 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.vue +6 -3
- package/src/brand-page/components/shop/PaymentModal.vue +2 -6
- package/src/brand-page/components/shop/PaymentShippingAddress.vue +6 -0
- package/src/brand-page/components/shop/Shop.vue +15 -2
- package/src/brand-page/components/shop/Shop.vue.test.ts +74 -2
- package/src/brand-page/components/social-links/SocialLinks.stories.ts +0 -3
- package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +0 -3
- package/src/brand-page/components/testimonial-section/__fixtures__/data.ts +0 -3
- package/src/brand-page/components/text/Text.stories.ts +0 -17
- package/src/brand-page/components/text-wrapper/TextWrapper.parity.test.ts +136 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.test.ts +358 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +82 -22
- package/src/brand-page/constants/font.constants.ts +37 -0
- package/src/brand-page/models/footer-icon-color.test.ts +22 -0
- package/src/brand-page/models/index.ts +50 -28
- package/src/brand-page/models/navigation-styles.model.test.ts +77 -1
- package/src/brand-page/models/navigation-styles.model.ts +26 -9
- package/src/brand-page/models/payment.model.ts +15 -6
- package/src/brand-page/models/styles.model.test.ts +104 -0
- package/src/brand-page/models/styles.model.ts +181 -47
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +619 -115
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +150 -9
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +300 -18
- package/src/brand-page/utils/color-palette.util.test.ts +126 -1
- package/src/brand-page/utils/color-palette.util.ts +92 -26
- package/src/brand-page/utils/color.util.test.ts +62 -29
- package/src/brand-page/utils/color.util.ts +77 -14
- package/src/brand-page/utils/container-text-color.util.test.ts +672 -26
- package/src/brand-page/utils/container-text-color.util.ts +472 -46
- package/src/brand-page/utils/index.ts +1 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/edited-brandsite-sections.v22.json +1191 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandcontact-every-section.v22.json +2026 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandpage-every-section.v22.json +2017 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandsite-every-section.v22.json +2031 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandcontact.v22.json +1145 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-general-link.v22.json +645 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-links.v22.json +1136 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-social-links.v22.json +662 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-about.v22.json +638 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-footer.v22.json +610 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-header-banner.v22.json +660 -0
- package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-sections.v22.json +1132 -0
- package/src/brand-page/utils/migration/migration-01.ts +293 -237
- package/src/brand-page/utils/migration/migration-02.ts +8 -1
- package/src/brand-page/utils/migration/migration-20.ts +6 -3
- package/src/brand-page/utils/migration/migration-20_5.test.ts +5 -2
- package/src/brand-page/utils/migration/migration-21.test.ts +34 -0
- package/src/brand-page/utils/migration/migration-21.ts +46 -10
- package/src/brand-page/utils/migration/migration-22.fixed-input.test.ts +43 -0
- package/src/brand-page/utils/migration/migration-22.test.ts +4103 -0
- package/src/brand-page/utils/migration/migration-22.text-font-family.test.ts +72 -0
- package/src/brand-page/utils/migration/migration-22.ts +1336 -0
- package/src/brand-page/utils/migration.util.test.ts +146 -32
- package/src/brand-page/utils/migration.util.ts +18 -0
- package/src/brand-page/utils/model.util.ts +4 -0
- package/src/brand-page/utils/personalisation.util.test.ts +148 -3
- package/src/brand-page/utils/personalisation.util.ts +9 -1
- package/src/brand-page/utils/rte-role-lift.util.ts +409 -0
- package/src/brand-page/utils/style.util.test.ts +35 -2
- package/src/brand-page/utils/style.util.ts +45 -11
- package/src/brand-page/utils/text-role-css.util.test.ts +525 -0
- package/src/brand-page/utils/text-role-css.util.ts +321 -0
- package/src/brand-page/utils/text-role-reconnect.util.test.ts +604 -0
- package/src/brand-page/utils/text-role-reconnect.util.ts +727 -0
- package/src/brand-page/utils/text-style.util.test.ts +305 -0
- package/src/brand-page/utils/text-style.util.ts +198 -24
- package/src/brand-page/utils/view-model.page-data.test.ts +232 -0
- package/src/brand-page/utils/view-model.util.test.ts +954 -133
- package/src/brand-page/utils/view-model.util.ts +187 -139
- package/src/brand-page/view-models.ts +4 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.blank-site.test.ts +57 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +9 -5
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -10
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.ts +0 -1
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -44
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +253 -200
- package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +1 -0
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +1 -0
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +1 -0
- package/src/brand-page-maker/composables/rich-text-editor/block-typography.test.ts +519 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/MaxLength.test.ts +26 -1
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.test.ts +110 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.ts +99 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.ts +397 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/ViewDomParser.test.ts +139 -0
- package/src/brand-page-maker/composables/rich-text-editor/font.ts +36 -5
- package/src/brand-page-maker/composables/rich-text-editor/formatting.test.ts +375 -1
- package/src/brand-page-maker/composables/rich-text-editor/formatting.ts +301 -17
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.test.ts +82 -1
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +28 -34
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.test.ts +80 -0
- package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.ts +75 -0
- package/src/brand-page-maker/composables/rich-text-editor/spacing.ts +31 -6
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.test.ts +2485 -0
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +435 -337
- package/src/brand-page-maker/constants/config-settings-constant.ts +0 -6
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.test.ts +43 -0
- package/src/brand-page-maker/convertors/text-css-style-options.convertor.ts +6 -2
- package/src/brand-page-maker/convertors/text-size-value.convertor.test.ts +24 -0
- package/src/brand-page-maker/convertors/text-size-value.convertor.ts +17 -13
- package/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.ts +7 -22
- package/src/brand-page-maker/default-getters/text-color.default-getter.ts +5 -21
- package/src/brand-page-maker/models/content-settings.test.ts +708 -0
- package/src/brand-page-maker/models/content-settings.ts +133 -82
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.test.ts +63 -1
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.ts +16 -3
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.test.ts +34 -0
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.ts +4 -2
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +185 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +22 -34
- package/src/brand-page-maker/stores/history/history-store.ts +35 -2
- package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +528 -0
- package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +12 -0
- package/src/brand-page-maker/utils/apply-color-strategy.golden.test.ts +2 -0
- package/src/brand-page-maker/utils/apply-color-strategy.test.ts +181 -3
- package/src/brand-page-maker/utils/apply-color-strategy.ts +36 -4
- package/src/brand-page-maker/utils/index.ts +2 -1
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +447 -410
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +610 -506
- package/src/brand-page-maker/utils/rte-authoring.util.test.ts +244 -0
- package/src/brand-page-maker/utils/rte-authoring.util.ts +175 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.test.ts +558 -0
- package/src/brand-page-maker/utils/rte-clipboard.util.ts +473 -0
- package/src/brand-page-maker/utils/rte-features.test.ts +99 -3
- package/src/brand-page-maker/utils/rte-render-parity.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-render.util.test.ts +230 -0
- package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +1 -1
- package/src/brand-page-maker/utils/rte-sanitize.util.ts +14 -3
- package/src/brand-page-maker/utils/rte-schema-version.test.ts +102 -0
- package/src/bundles/bundled-translations.de-DE.json +21 -2
- package/src/bundles/bundled-translations.es-ES.json +21 -2
- package/src/bundles/bundled-translations.fr-CA.json +21 -2
- package/src/bundles/bundled-translations.fr-FR.json +21 -2
- package/src/bundles/bundled-translations.json +21 -2
- package/src/bundles/bundled-translations.pt-BR.json +21 -2
- package/src/bundles/bundled-translations.pt-PT.json +21 -2
- package/src/clients/ai-assistant-client.ts +1 -0
- package/src/composables/useTranslate.ts +2 -1
- package/src/lib.ts +2 -2
- package/src/metadata-builder/builders/footer-builder.test.ts +70 -45
- package/src/metadata-builder/builders/footer-builder.ts +4 -8
- package/src/metadata-builder/builders/global-role-propagation.test.ts +907 -0
- package/src/metadata-builder/builders/global-role-propagation.ts +430 -0
- package/src/metadata-builder/builders/global-styles-builder.test.ts +1020 -0
- package/src/metadata-builder/builders/global-styles-builder.ts +194 -48
- package/src/metadata-builder/builders/header-builder.test.ts +112 -40
- package/src/metadata-builder/builders/header-builder.ts +18 -8
- package/src/metadata-builder/builders/section-builders/about-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +7 -4
- package/src/metadata-builder/builders/section-builders/images-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +7 -7
- package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +5 -3
- package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +2 -2
- package/src/metadata-builder/builders/section-builders/social-links-builder.ts +21 -10
- package/src/metadata-builder/builders/section-builders/support-me-builder.test.ts +10 -0
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +111 -61
- package/src/metadata-builder/builders/section-field-maps.ts +1 -0
- package/src/metadata-builder/builders/section-field-utils.test.ts +545 -2
- package/src/metadata-builder/builders/section-field-utils.ts +202 -69
- package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +38 -13
- package/src/metadata-builder/builders/section-rules/social-links.rules.ts +5 -0
- package/src/metadata-builder/helpers/rte.helpers.test.ts +101 -0
- package/src/metadata-builder/helpers/rte.helpers.ts +129 -43
- package/src/metadata-builder/metadata-executor.test.ts +167 -0
- package/src/metadata-builder/metadata-executor.ts +34 -1
- package/src/metadata-builder/models.ts +2 -0
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +23 -7
- package/src/metadata-builder/parsers/section-tool-arguments.ts +21 -1
- package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +215 -0
- package/src/metadata-builder/sanitizers/rte-schema-check.ts +1 -1
- package/src/metadata-builder/sanitizers/sanitizer-rules.ts +4 -8
- package/src/metadata-builder/sanitizers/section-args-validator.ts +136 -53
- package/src/shared/color-palette/section-color-matches.test.ts +15 -11
- package/src/shared/color-palette/section-color-matches.ts +9 -28
- package/src/shared/color-strategies/color-strategies.ts +35 -0
- package/src/shared/color-strategies/rte-color.test.ts +1 -1
- package/src/shared/color-strategies/rte-color.ts +19 -0
- package/src/shared/color-strategies/rte-field-pairs.test.ts +26 -5
- package/src/shared/color-strategies/rte-field-pairs.ts +33 -0
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.test.ts +43 -66
- package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.vue +7 -1
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -48
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +33 -7
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.test.ts +128 -1
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -0
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSlider.vue +3 -0
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSliderField.vue +1 -0
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +1 -0
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.test.ts +56 -3
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +11 -4
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.test.ts +335 -25
- package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +248 -70
- package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +113 -25
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.de-DE.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.es-ES.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-CA.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-FR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.json +8 -1
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-BR.json +17 -10
- package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-PT.json +17 -10
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.test.ts +141 -0
- package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.vue +136 -0
- package/src/shared/content-settings/store/content-settings-store.test.ts +491 -6
- package/src/shared/content-settings/store/content-settings-store.ts +159 -17
- package/src/shared/logo-settings/components/EditLogoSettings.vue +1 -0
- package/src/shared/logo-settings/components/LogoVariations.vue +1 -0
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +1 -0
- package/src/shared/navigation-style-settings/store/index.test.ts +295 -0
- package/src/shared/navigation-style-settings/store/index.ts +65 -15
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +2 -0
- package/src/shared/page-settings/components/page-settings/PageElement.vue +1 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +44 -4
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +13 -4
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.navigation.test.ts +89 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.text-style.test.ts +91 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +14 -2
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.vue +2 -0
- package/src/shared/page-settings/store/page-settings-store.text-style.test.ts +84 -0
- package/src/shared/page-settings/store/page-settings-store.ts +30 -1
- package/src/shared/rte-extensions/AutoLink.test.ts +98 -0
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.ts +87 -58
- package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.ts +4 -1
- package/src/shared/rte-extensions/TextEffects.ts +151 -0
- package/src/shared/rte-extensions/ViewDomParser.ts +27 -0
- package/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.ts → shared/rte-extensions.util.ts} +66 -9
- package/src/shared/rte-link.util.ts +2 -0
- package/src/shared/rte-render.util.ts +385 -0
- package/src/shared/rte-shape.util.ts +29 -0
- package/src/shared/side-bar/store/side-bar-store.test.ts +27 -1
- package/src/shared/side-bar/store/side-bar-store.ts +11 -0
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +7 -3
- package/src/shared/style-settings/components/StyleSettings.test.ts +116 -0
- package/src/shared/style-settings/components/StyleSettings.vue +75 -25
- package/src/shared/style-settings/components/i18n/style-settings.de-DE.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.es-ES.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-CA.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.fr-FR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.json +13 -3
- package/src/shared/style-settings/components/i18n/style-settings.pt-BR.json +32 -20
- package/src/shared/style-settings/components/i18n/style-settings.pt-PT.json +32 -20
- package/src/shared/style-settings/components/text-style-options-settings-with-state/TextStyleOptionsSettingsWithState.vue +14 -34
- package/src/shared/style-settings/store/style-settings-store.ts +3 -49
- package/src/shared/style-settings/text-style-size-order.test.ts +76 -0
- package/src/shared/style-settings/text-style-size-order.ts +28 -0
- package/src/shared/template-settings/components/TemplatesSettings.vue +4 -0
- package/src/shared/text-role-typography.util.ts +277 -0
- package/src/utils/minify-brand-page-metadata.test.ts +102 -7
- package/src/utils/minify-brand-page-metadata.ts +62 -8
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/AutoLink.d.ts +0 -2
- package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
- package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -63
- package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -106
- package/lib/src/brand-page-maker/utils/rte-shape.d.ts +0 -18
- package/lib/src/brand-page-maker/utils/rte-shape.js +0 -21
- package/lib/src/metadata-builder/builders/global-font-propagation.d.ts +0 -41
- package/lib/src/metadata-builder/builders/global-font-propagation.js +0 -146
- package/src/brand-page-maker/utils/rte-render.util.ts +0 -179
- package/src/brand-page-maker/utils/rte-shape.ts +0 -29
- package/src/metadata-builder/builders/global-font-propagation.test.ts +0 -401
- package/src/metadata-builder/builders/global-font-propagation.ts +0 -238
- package/src/shared/style-settings/components/StyleSettingsSection.vue +0 -8
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.d.ts +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.js +0 -0
- /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.d.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.ts +0 -0
- /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.ts +0 -0
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
import { beforeAll, describe, it, expect } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
createInitialBannerSectionContent,
|
|
4
|
+
createInitialProfileContent,
|
|
5
|
+
createInitialTextContent,
|
|
6
|
+
createInitialMailingListContent,
|
|
7
|
+
createInitialContactFormContent,
|
|
8
|
+
createInitialBookingSectionContent,
|
|
9
|
+
createInitialImagesSectionContent,
|
|
10
|
+
createInitialTestimonialSectionContent,
|
|
11
|
+
createInitialAboutSectionContent,
|
|
12
|
+
createInitialSocialLinksContent,
|
|
13
|
+
createInitialShapesSectionContent,
|
|
14
|
+
createInitialShopContent,
|
|
15
|
+
createInitialRequestPaymentContent,
|
|
16
|
+
createInitialSupportMeContent,
|
|
17
|
+
createInitialBrandPage,
|
|
18
|
+
applyBlankSiteTextRoles,
|
|
19
|
+
} from './content-settings';
|
|
20
|
+
import { migrateBrandPageModel } from '@brand-page/utils/migration.util';
|
|
21
|
+
import {
|
|
22
|
+
pickTypography,
|
|
23
|
+
TEXT_STYLE_CASCADE_PROPS,
|
|
24
|
+
} from '@shared/text-role-typography.util';
|
|
25
|
+
import { applyTextContrast } from '@brand-page/utils/container-text-color.util';
|
|
26
|
+
import { authorContentRteFields } from '@brand-page-maker/utils/rte-authoring.util';
|
|
27
|
+
import * as contentFactories from './content-settings';
|
|
28
|
+
import { isTiptapDocument } from '@brand-page-maker/utils';
|
|
29
|
+
import { setLocaleAsync } from '@src/composables/useTranslate';
|
|
30
|
+
import {
|
|
31
|
+
BRAND_PAGE_TYPES,
|
|
32
|
+
CANONICAL_TEXT_STYLE_TYPES,
|
|
33
|
+
CONTENT_TEXT_STYLE_PROPERTY_KEYS,
|
|
34
|
+
PageStyles,
|
|
35
|
+
TEXT_STYLE_TYPES,
|
|
36
|
+
type BrandPageType,
|
|
37
|
+
type ContentType,
|
|
38
|
+
} from '@brand-page';
|
|
39
|
+
import { CONTENT_SETTINGS_CONFIGS } from '@brand-page-maker/constants';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* BP-5969 — RTE fields are authored as Tiptap docs at their SOURCE (the factory), never plain
|
|
43
|
+
* strings a later step converts. The factory emits STRUCTURE only; colour + role typography are
|
|
44
|
+
* baked by the init step (applyTextContrast + authorContentRteFields). Empty fields are empty docs,
|
|
45
|
+
* not strings — so no plain-string ever exists for an editor to convert.
|
|
46
|
+
*
|
|
47
|
+
* (The default copy comes from `contentSettingsTr`, which returns '' without loaded bundles, so
|
|
48
|
+
* these assert the doc SHAPE — `rteDoc`'s text handling is covered in rte-render.util.test.ts and
|
|
49
|
+
* the real copy is verified live.)
|
|
50
|
+
*/
|
|
51
|
+
const opts = {
|
|
52
|
+
userState: { emailAddress: 'test@example.com' },
|
|
53
|
+
brandPageType: 'brandSite',
|
|
54
|
+
} as any;
|
|
55
|
+
|
|
56
|
+
// A created content's text styles by field name, plus each text-items entry; shared by the
|
|
57
|
+
// canonical-role sweep and the starting-role pin below.
|
|
58
|
+
const stylesOf = (
|
|
59
|
+
content: Record<string, unknown>,
|
|
60
|
+
): [string, Record<string, string>][] => {
|
|
61
|
+
const styles = Object.keys(CONTENT_TEXT_STYLE_PROPERTY_KEYS)
|
|
62
|
+
.filter((key) => content[key])
|
|
63
|
+
.map((key): [string, Record<string, string>] => [
|
|
64
|
+
key,
|
|
65
|
+
content[key] as Record<string, string>,
|
|
66
|
+
]);
|
|
67
|
+
const itemStyles = Array.isArray(content.textItems)
|
|
68
|
+
? content.textItems.map(
|
|
69
|
+
(
|
|
70
|
+
item: { textStyle: Record<string, string> },
|
|
71
|
+
index,
|
|
72
|
+
): [string, Record<string, string>] => [
|
|
73
|
+
`textItems[${index}]`,
|
|
74
|
+
item.textStyle,
|
|
75
|
+
],
|
|
76
|
+
)
|
|
77
|
+
: [];
|
|
78
|
+
|
|
79
|
+
return [...styles, ...itemStyles];
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// The add-content panel's own steps after the factory (`addItemByType`): applyTextContrast bakes
|
|
83
|
+
// colour, authorContentRteFields bakes RTE typography marks. Shared by the own-typography sweep and
|
|
84
|
+
// the starting-role pin below.
|
|
85
|
+
const addContent = (
|
|
86
|
+
brandPageType: BrandPageType,
|
|
87
|
+
make: () => unknown,
|
|
88
|
+
): Record<string, unknown> => {
|
|
89
|
+
const content = make() as Record<string, unknown>;
|
|
90
|
+
const styles = new PageStyles();
|
|
91
|
+
|
|
92
|
+
applyTextContrast(content as never, styles, brandPageType);
|
|
93
|
+
authorContentRteFields(content as never, styles.textStyles.textStyleOptions);
|
|
94
|
+
|
|
95
|
+
return content;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// Every RTE factory and the RTE text fields it must emit as docs (shop/request-payment/support-me
|
|
99
|
+
// included — BP-5969 restored them to RTE).
|
|
100
|
+
const RTE_FACTORIES: [string, () => unknown, string[]][] = [
|
|
101
|
+
[
|
|
102
|
+
'banner-section',
|
|
103
|
+
() => createInitialBannerSectionContent(opts),
|
|
104
|
+
['title', 'description'],
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
'profile',
|
|
108
|
+
() => createInitialProfileContent(opts),
|
|
109
|
+
['name', 'title', 'description'],
|
|
110
|
+
],
|
|
111
|
+
['mailing-list', () => createInitialMailingListContent(opts), ['title']],
|
|
112
|
+
[
|
|
113
|
+
'contact-form',
|
|
114
|
+
() => createInitialContactFormContent(opts),
|
|
115
|
+
['title', 'description', 'successMessage'],
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
'booking-section',
|
|
119
|
+
() => createInitialBookingSectionContent(opts),
|
|
120
|
+
['title', 'description'],
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
'images-section',
|
|
124
|
+
() => createInitialImagesSectionContent(opts),
|
|
125
|
+
['title', 'description'],
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
'testimonial-section',
|
|
129
|
+
() => createInitialTestimonialSectionContent(opts),
|
|
130
|
+
['title'],
|
|
131
|
+
],
|
|
132
|
+
[
|
|
133
|
+
'about-section',
|
|
134
|
+
() => createInitialAboutSectionContent(opts),
|
|
135
|
+
['title', 'paragraph'],
|
|
136
|
+
],
|
|
137
|
+
['social-links', () => createInitialSocialLinksContent(opts), ['title']],
|
|
138
|
+
[
|
|
139
|
+
'shapes-section',
|
|
140
|
+
() => createInitialShapesSectionContent(opts),
|
|
141
|
+
['title', 'description'],
|
|
142
|
+
],
|
|
143
|
+
// BP-5969: shop/request-payment/support-me restored to RTE (they were RTE on develop).
|
|
144
|
+
[
|
|
145
|
+
'shop-section',
|
|
146
|
+
() => createInitialShopContent(opts),
|
|
147
|
+
['title', 'description'],
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
'request-payment',
|
|
151
|
+
() => createInitialRequestPaymentContent(opts),
|
|
152
|
+
['title', 'description'],
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
'support-me',
|
|
156
|
+
() => createInitialSupportMeContent(opts),
|
|
157
|
+
['title', 'description'],
|
|
158
|
+
],
|
|
159
|
+
];
|
|
160
|
+
|
|
161
|
+
describe('RTE factories — every RTE text field is authored as a doc', () => {
|
|
162
|
+
it.each(RTE_FACTORIES)(
|
|
163
|
+
'%s emits its RTE fields as Tiptap docs',
|
|
164
|
+
(_type, make, fields) => {
|
|
165
|
+
const content = make() as Record<string, unknown>;
|
|
166
|
+
|
|
167
|
+
for (const field of fields) {
|
|
168
|
+
expect(isTiptapDocument(content[field])).toBe(true);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
it('text section (brandPage) emits its `text` as a doc', () => {
|
|
174
|
+
const content = createInitialTextContent({
|
|
175
|
+
brandPageType: 'default',
|
|
176
|
+
} as any);
|
|
177
|
+
|
|
178
|
+
expect(isTiptapDocument(content.text)).toBe(true);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('text section (brandSite) emits every textItems[].text as a doc', () => {
|
|
182
|
+
const content = createInitialTextContent({
|
|
183
|
+
brandPageType: 'brandSite',
|
|
184
|
+
} as any);
|
|
185
|
+
|
|
186
|
+
expect(content.textItems?.length).toBeGreaterThan(0);
|
|
187
|
+
expect(content.textItems?.every((i) => isTiptapDocument(i.text))).toBe(
|
|
188
|
+
true,
|
|
189
|
+
);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
describe('createInitialBannerSectionContent — RTE source detail', () => {
|
|
194
|
+
const firstBlock = (doc: unknown) =>
|
|
195
|
+
(doc as { content?: { type?: string; content?: unknown[] }[] })
|
|
196
|
+
.content?.[0];
|
|
197
|
+
|
|
198
|
+
it('emits the empty description as an empty-paragraph doc (no text run)', () => {
|
|
199
|
+
const content = createInitialBannerSectionContent(opts);
|
|
200
|
+
const block = firstBlock(content.description);
|
|
201
|
+
|
|
202
|
+
expect(block?.type).toBe('paragraph');
|
|
203
|
+
expect(block?.content ?? []).toHaveLength(0);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('does not pre-bake colour/typography marks (the init layer does that)', () => {
|
|
207
|
+
const content = createInitialBannerSectionContent(opts);
|
|
208
|
+
const run = (
|
|
209
|
+
firstBlock(content.title) as
|
|
210
|
+
| { content?: { marks?: unknown[] }[] }
|
|
211
|
+
| undefined
|
|
212
|
+
)?.content?.[0];
|
|
213
|
+
|
|
214
|
+
expect(run?.marks ?? []).toHaveLength(0);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// Every text a factory creates is linked to one of the ten roles at birth, so nothing new needs the
|
|
219
|
+
// reconnect, and saves no typography of its own, so every role edit reaches it. The two button
|
|
220
|
+
// factories are curried by their content type, and capitalise their translated title, so they need
|
|
221
|
+
// the bundles loaded.
|
|
222
|
+
describe('content factories — every created text starts on a canonical role with no typography of its own', () => {
|
|
223
|
+
beforeAll(async () => {
|
|
224
|
+
await setLocaleAsync('en-US');
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const CURRIED_FACTORIES: Record<string, (options: typeof opts) => unknown> = {
|
|
228
|
+
createInitialButtonContent: (options) =>
|
|
229
|
+
contentFactories.createInitialButtonContent(
|
|
230
|
+
'website' as ContentType,
|
|
231
|
+
'',
|
|
232
|
+
options,
|
|
233
|
+
)(),
|
|
234
|
+
createInitialGeneralLinkContent: (options) =>
|
|
235
|
+
contentFactories.createInitialGeneralLinkContent(
|
|
236
|
+
'general-link' as ContentType,
|
|
237
|
+
'',
|
|
238
|
+
options,
|
|
239
|
+
)(),
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
const factories = Object.entries(contentFactories).filter(
|
|
243
|
+
([name, value]) =>
|
|
244
|
+
/^createInitial\w+Content$/.test(name) && typeof value === 'function',
|
|
245
|
+
) as [string, (options: typeof opts) => unknown][];
|
|
246
|
+
|
|
247
|
+
const cases = factories.flatMap(([name, factory]) =>
|
|
248
|
+
Object.values(BRAND_PAGE_TYPES).map(
|
|
249
|
+
(
|
|
250
|
+
brandPageType: BrandPageType,
|
|
251
|
+
): [string, BrandPageType, () => unknown] => [
|
|
252
|
+
name,
|
|
253
|
+
brandPageType,
|
|
254
|
+
() => (CURRIED_FACTORIES[name] ?? factory)({ ...opts, brandPageType }),
|
|
255
|
+
],
|
|
256
|
+
),
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
const rolesOf = (content: Record<string, unknown>): unknown[] =>
|
|
260
|
+
stylesOf(content).map(([, style]) => style.textStyleType);
|
|
261
|
+
|
|
262
|
+
type RteNode = {
|
|
263
|
+
marks?: { type: string; attrs?: Record<string, unknown> }[];
|
|
264
|
+
content?: RteNode[];
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// A run may reference its role (`var(--role-…)`); a literal value would be a value of its own.
|
|
268
|
+
const literalRunTypography = (node: RteNode, found: string[] = []) => {
|
|
269
|
+
for (const mark of node.marks ?? []) {
|
|
270
|
+
for (const prop of TEXT_STYLE_CASCADE_PROPS) {
|
|
271
|
+
const value = mark.attrs?.[prop];
|
|
272
|
+
|
|
273
|
+
if (value && !String(value).startsWith('var(')) {
|
|
274
|
+
found.push(`${prop}: ${value}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
node.content?.forEach((child) => literalRunTypography(child, found));
|
|
280
|
+
|
|
281
|
+
return found;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
const ownTypographyAfterAdding = (
|
|
285
|
+
brandPageType: BrandPageType,
|
|
286
|
+
make: () => unknown,
|
|
287
|
+
): string[] => {
|
|
288
|
+
const content = addContent(brandPageType, make);
|
|
289
|
+
|
|
290
|
+
const own = stylesOf(content).flatMap(([key, style]) =>
|
|
291
|
+
Object.entries(pickTypography(style)).map(
|
|
292
|
+
([prop, value]) => `${key}.${prop}: ${value}`,
|
|
293
|
+
),
|
|
294
|
+
);
|
|
295
|
+
const docs = [
|
|
296
|
+
...Object.entries(content),
|
|
297
|
+
...(Array.isArray(content.textItems)
|
|
298
|
+
? content.textItems.map(
|
|
299
|
+
(item: { text: unknown }, index): [string, unknown] => [
|
|
300
|
+
`textItems[${index}].text`,
|
|
301
|
+
item.text,
|
|
302
|
+
],
|
|
303
|
+
)
|
|
304
|
+
: []),
|
|
305
|
+
].filter(([, value]) => isTiptapDocument(value));
|
|
306
|
+
|
|
307
|
+
return [
|
|
308
|
+
...own,
|
|
309
|
+
...docs.flatMap(([key, doc]) =>
|
|
310
|
+
literalRunTypography(doc as RteNode).map((run) => `${key} run ${run}`),
|
|
311
|
+
),
|
|
312
|
+
];
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
it('sweeps every exported createInitial*Content factory', () => {
|
|
316
|
+
expect(factories.length).toBeGreaterThanOrEqual(22);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
it.each(cases)(
|
|
320
|
+
'%s (%s) starts on a canonical role',
|
|
321
|
+
(_name, _brandPageType, make) => {
|
|
322
|
+
const content = make() as Record<string, unknown>;
|
|
323
|
+
|
|
324
|
+
for (const role of rolesOf(content)) {
|
|
325
|
+
expect(CANONICAL_TEXT_STYLE_TYPES).toContain(role);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
);
|
|
329
|
+
|
|
330
|
+
it.each(cases)(
|
|
331
|
+
'%s (%s) saves no typography of its own once added',
|
|
332
|
+
(_name, brandPageType, make) => {
|
|
333
|
+
expect(ownTypographyAfterAdding(brandPageType, make)).toEqual([]);
|
|
334
|
+
},
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
it('a new brand.site text block saves no size on its first text item', () => {
|
|
338
|
+
expect(
|
|
339
|
+
ownTypographyAfterAdding(BRAND_PAGE_TYPES.brandSite, () =>
|
|
340
|
+
createInitialTextContent({
|
|
341
|
+
...opts,
|
|
342
|
+
brandPageType: BRAND_PAGE_TYPES.brandSite,
|
|
343
|
+
}),
|
|
344
|
+
),
|
|
345
|
+
).toEqual([]);
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
// The payment and shop checkout success messages are their own rich text, so each starts on
|
|
350
|
+
// Paragraph 2 with no overrides.
|
|
351
|
+
describe('payment factories — the success message has its own role', () => {
|
|
352
|
+
it.each(
|
|
353
|
+
[
|
|
354
|
+
['request-payment', createInitialRequestPaymentContent],
|
|
355
|
+
['support-me', createInitialSupportMeContent],
|
|
356
|
+
['shop-section', createInitialShopContent],
|
|
357
|
+
].flatMap(([type, factory]) =>
|
|
358
|
+
Object.values(BRAND_PAGE_TYPES).map(
|
|
359
|
+
(brandPageType): [string, BrandPageType, typeof factory] => [
|
|
360
|
+
type as string,
|
|
361
|
+
brandPageType,
|
|
362
|
+
factory,
|
|
363
|
+
],
|
|
364
|
+
),
|
|
365
|
+
),
|
|
366
|
+
)(
|
|
367
|
+
'%s (%s) success message starts on Paragraph 2',
|
|
368
|
+
(_type, brandPageType, factory) => {
|
|
369
|
+
const content = (factory as (options: typeof opts) => unknown)({
|
|
370
|
+
...opts,
|
|
371
|
+
brandPageType,
|
|
372
|
+
}) as Record<string, unknown>;
|
|
373
|
+
|
|
374
|
+
expect(content.successMessageStyle).toEqual({
|
|
375
|
+
textStyleType: 'paragraph2',
|
|
376
|
+
});
|
|
377
|
+
},
|
|
378
|
+
);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
// A blank site has no version, so every migration runs on it: migration-01 forces line heights and
|
|
382
|
+
// migration-22 keeps the retired look as the header and footer text's own values. The Save Contact
|
|
383
|
+
// label (brand.contact only) joins the same pass: migration-22 seeds it with typography of its own
|
|
384
|
+
// too. The maker then puts every one of those texts on its role with no typography of its own.
|
|
385
|
+
describe('applyBlankSiteTextRoles', () => {
|
|
386
|
+
beforeAll(async () => {
|
|
387
|
+
await setLocaleAsync('en-US');
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it.each([true, false])(
|
|
391
|
+
'the Save Contact label starts on Button text with nothing of its own (saving enabled: %s)',
|
|
392
|
+
async (isSavingEnabled) => {
|
|
393
|
+
// The blank model has no profile section, so the label isn't shown either way —
|
|
394
|
+
// `applyBlankSiteTextRoles` still runs on it, so a later profile add finds it already on its role.
|
|
395
|
+
const { brandPageModel } = await migrateBrandPageModel(
|
|
396
|
+
createInitialBrandPage(BRAND_PAGE_TYPES.brandContact),
|
|
397
|
+
{ isUserDraft: true, isServerRender: false },
|
|
398
|
+
);
|
|
399
|
+
|
|
400
|
+
brandPageModel.saveContactSettings!.isSavingEnabled = isSavingEnabled;
|
|
401
|
+
|
|
402
|
+
applyBlankSiteTextRoles(brandPageModel);
|
|
403
|
+
|
|
404
|
+
const buttonTextStyle =
|
|
405
|
+
brandPageModel.saveContactSettings!.buttonTextStyle!;
|
|
406
|
+
|
|
407
|
+
expect(buttonTextStyle.textStyleType).toBe('button');
|
|
408
|
+
expect(pickTypography(buttonTextStyle)).toEqual({});
|
|
409
|
+
},
|
|
410
|
+
);
|
|
411
|
+
|
|
412
|
+
// Every object outside `styles.textStyles` (the role definitions, which keep the four retired
|
|
413
|
+
// option slots) that carries a `textStyleType` or any typography of its own — walked across the
|
|
414
|
+
// whole model. A text added to the blank site later with no role and no row here fails this walk.
|
|
415
|
+
const stylesInModel = (
|
|
416
|
+
model: unknown,
|
|
417
|
+
): [string, Record<string, string>][] => {
|
|
418
|
+
const found: [string, Record<string, string>][] = [];
|
|
419
|
+
|
|
420
|
+
const walk = (node: unknown, path: string): void => {
|
|
421
|
+
if (!node || typeof node !== 'object') return;
|
|
422
|
+
|
|
423
|
+
if (Array.isArray(node)) {
|
|
424
|
+
node.forEach((item, index) => walk(item, `${path}[${index}]`));
|
|
425
|
+
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (path === 'styles.textStyles') return;
|
|
430
|
+
|
|
431
|
+
const record = node as Record<string, unknown>;
|
|
432
|
+
|
|
433
|
+
if (
|
|
434
|
+
'textStyleType' in record ||
|
|
435
|
+
TEXT_STYLE_CASCADE_PROPS.some((prop) => prop in record)
|
|
436
|
+
) {
|
|
437
|
+
found.push([path, record as Record<string, string>]);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
for (const [key, value] of Object.entries(record)) {
|
|
441
|
+
walk(value, path ? `${path}.${key}` : key);
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
walk(model, '');
|
|
446
|
+
|
|
447
|
+
return found;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
it.each(Object.values(BRAND_PAGE_TYPES))(
|
|
451
|
+
'every text on a migrated blank %s site is on a role with nothing of its own',
|
|
452
|
+
async (type) => {
|
|
453
|
+
const { brandPageModel } = await migrateBrandPageModel(
|
|
454
|
+
createInitialBrandPage(type),
|
|
455
|
+
{ isUserDraft: true, isServerRender: false },
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
applyBlankSiteTextRoles(brandPageModel);
|
|
459
|
+
|
|
460
|
+
const expectedRoles: Record<string, string> = {
|
|
461
|
+
'pageHeaderDesktop.navigation.defaultButtonStyle': 'paragraph1',
|
|
462
|
+
'pageHeaderMobile.navigation.defaultButtonStyle': 'paragraph1',
|
|
463
|
+
'pageHeaderDesktop.navigation.hamburgerMenuStyle.defaultButtonStyle':
|
|
464
|
+
'button',
|
|
465
|
+
'pageHeaderMobile.navigation.hamburgerMenuStyle.defaultButtonStyle':
|
|
466
|
+
'button',
|
|
467
|
+
'pageFooterDesktop.copyrightStyle': 'paragraph2',
|
|
468
|
+
'pageFooterMobile.copyrightStyle': 'paragraph2',
|
|
469
|
+
...(type === BRAND_PAGE_TYPES.brandContact
|
|
470
|
+
? { 'saveContactSettings.buttonTextStyle': 'button' }
|
|
471
|
+
: {}),
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
const found = stylesInModel(brandPageModel);
|
|
475
|
+
|
|
476
|
+
expect(found.map(([path]) => path).sort()).toEqual(
|
|
477
|
+
Object.keys(expectedRoles).sort(),
|
|
478
|
+
);
|
|
479
|
+
|
|
480
|
+
for (const [path, style] of found) {
|
|
481
|
+
expect(style.textStyleType).toBe(expectedRoles[path]);
|
|
482
|
+
expect(pickTypography(style)).toEqual({});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// The walk above checks only the role and that no cascade property survives; this pins the
|
|
486
|
+
// copyright's exact migrated shape, so a change to what it keeps (alignment, colour) is caught.
|
|
487
|
+
for (const footer of [
|
|
488
|
+
brandPageModel.pageFooterDesktop,
|
|
489
|
+
brandPageModel.pageFooterMobile,
|
|
490
|
+
]) {
|
|
491
|
+
expect(footer.copyrightStyle).toEqual({
|
|
492
|
+
textStyleType: 'paragraph2',
|
|
493
|
+
textAlign: 'center',
|
|
494
|
+
color: expect.any(String),
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
it('keeps colour, alignment and borders', () => {
|
|
501
|
+
const model = createInitialBrandPage(BRAND_PAGE_TYPES.brandContact);
|
|
502
|
+
const { navigation } = model.pageHeaderDesktop;
|
|
503
|
+
|
|
504
|
+
model.pageFooterDesktop.copyrightStyle = {
|
|
505
|
+
textStyleType: 'paragraph1',
|
|
506
|
+
fontSize: '1em',
|
|
507
|
+
letterSpacing: '0',
|
|
508
|
+
lineHeight: '1.3',
|
|
509
|
+
color: 'var(--palette-0)',
|
|
510
|
+
textAlign: 'left',
|
|
511
|
+
};
|
|
512
|
+
navigation.defaultButtonStyle = {
|
|
513
|
+
...navigation.defaultButtonStyle,
|
|
514
|
+
color: 'var(--palette-1)',
|
|
515
|
+
};
|
|
516
|
+
model.saveContactSettings = {
|
|
517
|
+
isSavingEnabled: true,
|
|
518
|
+
hideBranding: false,
|
|
519
|
+
buttonTextStyle: {
|
|
520
|
+
textStyleType: TEXT_STYLE_TYPES.buttons,
|
|
521
|
+
color: 'var(--palette-2)',
|
|
522
|
+
lineHeight: '1.5',
|
|
523
|
+
},
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
applyBlankSiteTextRoles(model);
|
|
527
|
+
|
|
528
|
+
expect(model.pageFooterDesktop.copyrightStyle).toEqual({
|
|
529
|
+
textStyleType: 'paragraph2',
|
|
530
|
+
color: 'var(--palette-0)',
|
|
531
|
+
textAlign: 'left',
|
|
532
|
+
});
|
|
533
|
+
expect(model.pageHeaderDesktop.navigation.defaultButtonStyle).toMatchObject(
|
|
534
|
+
{
|
|
535
|
+
color: 'var(--palette-1)',
|
|
536
|
+
borderBottomWidth: '0px',
|
|
537
|
+
textAlign: 'center',
|
|
538
|
+
},
|
|
539
|
+
);
|
|
540
|
+
expect(model.saveContactSettings.buttonTextStyle).toEqual({
|
|
541
|
+
textStyleType: 'button',
|
|
542
|
+
color: 'var(--palette-2)',
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
// brand.site: migration-22 seeds Save Contact only on brand.contact, so a blank site with none
|
|
546
|
+
// stays with none.
|
|
547
|
+
const noSaveContact = createInitialBrandPage(BRAND_PAGE_TYPES.brandSite);
|
|
548
|
+
|
|
549
|
+
applyBlankSiteTextRoles(noSaveContact);
|
|
550
|
+
|
|
551
|
+
expect(noSaveContact.saveContactSettings).toBeUndefined();
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
// R2 (D1 — decided: keep today's starting-role map, no field moves; James Joung, 2026-09-30). The
|
|
556
|
+
// map pins roles only; the own-typography sweep above covers typography. A deliberate move is a
|
|
557
|
+
// product decision: change this map on purpose, never to silence a red run.
|
|
558
|
+
describe('add content — every text starts on its pinned role', () => {
|
|
559
|
+
beforeAll(async () => {
|
|
560
|
+
await setLocaleAsync('en-US');
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
const STARTING_ROLES: Record<ContentType, Record<string, string>> = {
|
|
564
|
+
logo: {},
|
|
565
|
+
'general-link': { titleStyle: TEXT_STYLE_TYPES.button },
|
|
566
|
+
profile: {
|
|
567
|
+
nameStyle: TEXT_STYLE_TYPES.heading5,
|
|
568
|
+
titleStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
569
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
570
|
+
},
|
|
571
|
+
website: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
572
|
+
email: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
573
|
+
phone: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
574
|
+
text: { textStyle: TEXT_STYLE_TYPES.paragraph2 },
|
|
575
|
+
image: {},
|
|
576
|
+
'images-section': {
|
|
577
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
578
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
579
|
+
headingStyle: TEXT_STYLE_TYPES.heading5,
|
|
580
|
+
paragraphStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
581
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
582
|
+
},
|
|
583
|
+
'image-gallery': {},
|
|
584
|
+
video: {},
|
|
585
|
+
map: {},
|
|
586
|
+
'mailing-list': {
|
|
587
|
+
titleStyle: TEXT_STYLE_TYPES.heading5,
|
|
588
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
589
|
+
},
|
|
590
|
+
facebook: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
591
|
+
x: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
592
|
+
instagram: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
593
|
+
youtube: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
594
|
+
linkedin: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
595
|
+
pinterest: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
596
|
+
twitch: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
597
|
+
tiktok: { titleStyle: TEXT_STYLE_TYPES.button },
|
|
598
|
+
'support-me': {
|
|
599
|
+
titleStyle: TEXT_STYLE_TYPES.heading5,
|
|
600
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
601
|
+
headingStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
602
|
+
itemTextStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
603
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
604
|
+
successMessageStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
605
|
+
},
|
|
606
|
+
'request-payment': {
|
|
607
|
+
titleStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
608
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
609
|
+
itemTextStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
610
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
611
|
+
successMessageStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
612
|
+
},
|
|
613
|
+
'contact-form': {
|
|
614
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
615
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
616
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
617
|
+
successMessageStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
618
|
+
},
|
|
619
|
+
'banner-section': {
|
|
620
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
621
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
622
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
623
|
+
},
|
|
624
|
+
'testimonial-section': {
|
|
625
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
626
|
+
testimonialStyle: TEXT_STYLE_TYPES.heading5,
|
|
627
|
+
nameStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
628
|
+
positionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
629
|
+
},
|
|
630
|
+
'about-section': {
|
|
631
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
632
|
+
paragraphStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
633
|
+
},
|
|
634
|
+
'social-links': { titleStyle: TEXT_STYLE_TYPES.heading4 },
|
|
635
|
+
'divider-section': {},
|
|
636
|
+
'shapes-section': {
|
|
637
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
638
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
639
|
+
headingStyle: TEXT_STYLE_TYPES.heading5,
|
|
640
|
+
paragraphStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
641
|
+
},
|
|
642
|
+
'shop-section': {
|
|
643
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
644
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
645
|
+
itemTextStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
646
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
647
|
+
successMessageStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
648
|
+
},
|
|
649
|
+
'booking-section': {
|
|
650
|
+
titleStyle: TEXT_STYLE_TYPES.heading4,
|
|
651
|
+
descriptionStyle: TEXT_STYLE_TYPES.paragraph2,
|
|
652
|
+
buttonTextStyle: TEXT_STYLE_TYPES.button,
|
|
653
|
+
},
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
// Mirrors getEnabledContentSettingsConfigs's website-type filter (the feature-flag term left out,
|
|
657
|
+
// so the pin covers every website type regardless of flags).
|
|
658
|
+
const offeredOn = (
|
|
659
|
+
config: { brandPageType?: string | BrandPageType[] },
|
|
660
|
+
type: BrandPageType,
|
|
661
|
+
): boolean =>
|
|
662
|
+
config.brandPageType === undefined
|
|
663
|
+
? true
|
|
664
|
+
: Array.isArray(config.brandPageType)
|
|
665
|
+
? config.brandPageType.includes(type)
|
|
666
|
+
: config.brandPageType === type;
|
|
667
|
+
|
|
668
|
+
const configs = CONTENT_SETTINGS_CONFIGS();
|
|
669
|
+
|
|
670
|
+
const cases = Object.entries(configs).flatMap(([type, config]) =>
|
|
671
|
+
Object.values(BRAND_PAGE_TYPES)
|
|
672
|
+
.filter((brandPageType) => offeredOn(config, brandPageType))
|
|
673
|
+
.map((brandPageType): [ContentType, BrandPageType, typeof config] => [
|
|
674
|
+
type as ContentType,
|
|
675
|
+
brandPageType,
|
|
676
|
+
config,
|
|
677
|
+
]),
|
|
678
|
+
);
|
|
679
|
+
|
|
680
|
+
it.each(cases)(
|
|
681
|
+
'%s (%s) starts on its pinned role',
|
|
682
|
+
(type, brandPageType, config) => {
|
|
683
|
+
const content = addContent(brandPageType, () =>
|
|
684
|
+
config.createInitialContent({ ...opts, brandPageType }),
|
|
685
|
+
);
|
|
686
|
+
|
|
687
|
+
const found = Object.fromEntries(
|
|
688
|
+
stylesOf(content).map(([field, style]) => [field, style.textStyleType]),
|
|
689
|
+
);
|
|
690
|
+
// brand.site's text block starts with one item; page/contact's doesn't (`createInitialTextContent`).
|
|
691
|
+
const expected =
|
|
692
|
+
type === 'text' && brandPageType === BRAND_PAGE_TYPES.brandSite
|
|
693
|
+
? {
|
|
694
|
+
...STARTING_ROLES.text,
|
|
695
|
+
'textItems[0]': TEXT_STYLE_TYPES.paragraph2,
|
|
696
|
+
}
|
|
697
|
+
: STARTING_ROLES[type];
|
|
698
|
+
|
|
699
|
+
expect(found).toStrictEqual(expected);
|
|
700
|
+
},
|
|
701
|
+
);
|
|
702
|
+
|
|
703
|
+
it('pins every add-content type', () => {
|
|
704
|
+
expect(Object.keys(STARTING_ROLES).sort()).toEqual(
|
|
705
|
+
Object.keys(configs).sort(),
|
|
706
|
+
);
|
|
707
|
+
});
|
|
708
|
+
});
|