@designcrowd/library.brand-page 6.2.11-builder-v2-1 → 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-Dg2pOwbr.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-BILs_hsB.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-VpxQ0N5F.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CFHWRHzi.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CFHWRHzi.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CZfs45s9.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CZfs45s9.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DYMQ6sIF.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Dj5sdPid.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-Cx9yNTro.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Bzr0SjGq.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BgqKY35F.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-CXK6qfvL.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-B8SggNTQ.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/brand-page-context.model.d.ts +2 -0
- package/lib/src/brand-page/models/brand-page-context.model.js +7 -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 +34 -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 +44 -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/preview/Preview.mixin.d.ts +7 -0
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +21 -0
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +25 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +25 -1
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +21 -0
- 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 +25 -1
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +21 -0
- package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.d.ts +10 -0
- package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.js +11 -0
- 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 +14 -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/ai-thread/ai-website-builder-thread-store.d.ts +9 -2
- package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.js +20 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +21 -0
- 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 +7 -1
- package/lib/src/clients/ai-assistant-client.js +7 -15
- 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 +284 -188
- package/lib/src/css/library.brand-page-brandPage.min.css +284 -188
- package/lib/src/css/library.brand-page-designCom.min.css +284 -188
- package/lib/src/css/library.brand-page-preview.min.css +284 -188
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.mjs +195 -191
- package/lib/src/{lib-7gtW85nE.js → lib-kGRlD3_P.js} +39082 -36131
- 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 +22 -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 +26 -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/new-page-modal/NewPageModal.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +38 -5
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +91 -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 +32 -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 +23 -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 +176 -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 +58 -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/brand-page-context.model.ts +13 -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/composables/ai-chat/ai-builder-experiment.test.ts +82 -0
- package/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.ts +19 -0
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +19 -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/ai-thread/ai-website-builder-thread-store.ts +30 -0
- 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 +13 -18
- 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/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
- 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/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/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/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 +74 -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/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/models/brand-page-context.model.test.ts +0 -38
- 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/clients/ai-assistant-client.test.ts +0 -135
- 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,7 +1,10 @@
|
|
|
1
1
|
import { DEFAULT_FONT_FAMILY_KEY, DEFAULT_FONT_STYLE, DEFAULT_TEXT_ALIGN, DEFAULT_TEXT_DECORATION, FONT_FAMILY_CONFIGS, FONT_SIZE_BODY, FONT_WEIGHT_NORMAL, STYLE_THEME_KEYS, defaultHamburgerNavigation, NAVIGATION_DISPLAY, } from '../constants';
|
|
2
2
|
import { VIEWPORTS } from './index';
|
|
3
|
-
import {
|
|
3
|
+
import { CANONICAL_TEXT_STYLE_TYPES, } from './styles.model';
|
|
4
4
|
import cloneDeep from 'lodash.clonedeep';
|
|
5
|
+
// A typography default sits under the saved style, and a style's own value beats its role, so
|
|
6
|
+
// only text on none of the ten roles may get one. Released migrations read the unlinked output.
|
|
7
|
+
const isRoleLinked = (style) => CANONICAL_TEXT_STYLE_TYPES.includes(style?.textStyleType);
|
|
5
8
|
export class NavigationMenuStyles {
|
|
6
9
|
defaultButtonStyle;
|
|
7
10
|
selectedButtonStyle;
|
|
@@ -75,11 +78,15 @@ class NavigationStyles {
|
|
|
75
78
|
borderRightWidth: '0px',
|
|
76
79
|
borderTopWidth: '0px',
|
|
77
80
|
color: theme?.primaryColor,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
...(isRoleLinked(option?.defaultButtonStyle)
|
|
82
|
+
? {}
|
|
83
|
+
: {
|
|
84
|
+
fontSize: FONT_SIZE_BODY,
|
|
85
|
+
fontFamily: FONT_FAMILY_CONFIGS[DEFAULT_FONT_FAMILY_KEY].name,
|
|
86
|
+
textDecoration: DEFAULT_TEXT_DECORATION,
|
|
87
|
+
fontWeight: FONT_WEIGHT_NORMAL,
|
|
88
|
+
fontStyle: DEFAULT_FONT_STYLE,
|
|
89
|
+
}),
|
|
83
90
|
textAlign: DEFAULT_TEXT_ALIGN,
|
|
84
91
|
}, option?.defaultButtonStyle || {});
|
|
85
92
|
this.selectedButtonStyle = Object.assign({}, {
|
|
@@ -95,12 +102,14 @@ class NavigationStyles {
|
|
|
95
102
|
this.iconStyle = Object.assign({}, option?.iconStyle || {});
|
|
96
103
|
this.subNavBackgroundColor = option?.subNavBackgroundColor;
|
|
97
104
|
this.isLogoVisible = option?.isLogoVisible || true;
|
|
105
|
+
const { fontFamily: _hamburgerFontFamily, ...linkedHamburgerDefaults } = defaultHamburgerNavigation.defaultButtonStyle;
|
|
98
106
|
this.hamburgerMenuStyle = new NavigationMenuStyles(option?.hamburgerMenuStyle || {}, {
|
|
99
107
|
defaultButtonStyle: {
|
|
100
|
-
...
|
|
108
|
+
...(isRoleLinked(option?.hamburgerMenuStyle?.defaultButtonStyle)
|
|
109
|
+
? linkedHamburgerDefaults
|
|
110
|
+
: defaultHamburgerNavigation.defaultButtonStyle),
|
|
101
111
|
backgroundColor: theme?.secondaryColor,
|
|
102
112
|
color: theme?.primaryColor,
|
|
103
|
-
textStyleType: option ? undefined : TEXT_STYLE_TYPES.buttons,
|
|
104
113
|
textAlign: option?.defaultButtonStyle?.textAlign || 'left',
|
|
105
114
|
},
|
|
106
115
|
selectedButtonStyle: {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Content } from './content.model';
|
|
2
2
|
import type { ProductModel } from './shop.model';
|
|
3
3
|
import type { TextStyleDeclaration } from './styles.model';
|
|
4
|
+
import type { JSONContent } from '@tiptap/vue-3';
|
|
5
|
+
type RteText = string | JSONContent;
|
|
4
6
|
export declare const STRIPE_ADDRESS_LIMITS: {
|
|
5
7
|
readonly name: {
|
|
6
8
|
readonly min: 1;
|
|
@@ -118,11 +120,11 @@ export interface RequestPaymentConfig extends PaymentConfig {
|
|
|
118
120
|
}
|
|
119
121
|
export interface RequestPaymentContent extends Content {
|
|
120
122
|
type: 'request-payment';
|
|
121
|
-
description:
|
|
123
|
+
description: RteText;
|
|
122
124
|
displayStyle: string;
|
|
123
125
|
requestPaymentConfig: RequestPaymentConfig;
|
|
124
126
|
successMessage: string;
|
|
125
|
-
title:
|
|
127
|
+
title: RteText;
|
|
126
128
|
fillColor: BrandPageCssStyle;
|
|
127
129
|
defaultBorderColor: BrandPageCssStyle;
|
|
128
130
|
selectedBorderColor: BrandPageCssStyle;
|
|
@@ -132,6 +134,7 @@ export interface RequestPaymentContent extends Content {
|
|
|
132
134
|
textColor?: BrandPageCssStyle;
|
|
133
135
|
titleStyle?: TextStyleDeclaration;
|
|
134
136
|
descriptionStyle?: TextStyleDeclaration;
|
|
137
|
+
successMessageStyle?: TextStyleDeclaration;
|
|
135
138
|
itemTextStyle: TextStyleDeclaration;
|
|
136
139
|
buttonTextStyle?: TextStyleDeclaration;
|
|
137
140
|
backgroundStyle?: BrandPageCssStyle;
|
|
@@ -144,17 +147,18 @@ export interface ShopContentConfig extends PaymentConfig {
|
|
|
144
147
|
}
|
|
145
148
|
export interface ShopContent extends Content {
|
|
146
149
|
type: 'shop-section';
|
|
147
|
-
description:
|
|
150
|
+
description: RteText;
|
|
148
151
|
successMessage: string;
|
|
149
152
|
products: ProductModel[];
|
|
150
153
|
displayStyle: string;
|
|
151
154
|
aspectRatio: string;
|
|
152
|
-
title:
|
|
155
|
+
title: RteText;
|
|
153
156
|
fillColor: BrandPageCssStyle;
|
|
154
157
|
defaultBorderColor: BrandPageCssStyle;
|
|
155
158
|
textColor?: BrandPageCssStyle;
|
|
156
159
|
titleStyle?: TextStyleDeclaration;
|
|
157
160
|
descriptionStyle?: TextStyleDeclaration;
|
|
161
|
+
successMessageStyle?: TextStyleDeclaration;
|
|
158
162
|
itemTextStyle: TextStyleDeclaration;
|
|
159
163
|
buttonTextStyle?: TextStyleDeclaration;
|
|
160
164
|
backgroundStyle: BrandPageCssStyle;
|
|
@@ -165,14 +169,15 @@ export interface SupportMeConfig extends PaymentConfig {
|
|
|
165
169
|
}
|
|
166
170
|
export interface SupportMeContent extends Content {
|
|
167
171
|
type: 'support-me';
|
|
168
|
-
title:
|
|
169
|
-
description:
|
|
172
|
+
title: RteText;
|
|
173
|
+
description: RteText;
|
|
170
174
|
displayStyle: string;
|
|
171
175
|
successMessage: string;
|
|
172
176
|
supportMeConfig: SupportMeConfig;
|
|
173
177
|
titleStyle: TextStyleDeclaration;
|
|
174
178
|
headingStyle: TextStyleDeclaration;
|
|
175
179
|
descriptionStyle: TextStyleDeclaration;
|
|
180
|
+
successMessageStyle?: TextStyleDeclaration;
|
|
176
181
|
buttonTextStyle: TextStyleDeclaration;
|
|
177
182
|
itemTextStyle: TextStyleDeclaration;
|
|
178
183
|
backgroundStyle?: BrandPageCssStyle;
|
|
@@ -1,25 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The 10 canonical global text roles (BP-5969) plus the 4 legacy roles.
|
|
3
|
+
*
|
|
4
|
+
* Legacy keys (`titles`/`headings`/`paragraphs`/`buttons`) are retained ONLY so
|
|
5
|
+
* pre-migration content keeps resolving until migration-22 converts it; they are
|
|
6
|
+
* hidden from the panel/picker (see `CANONICAL_TEXT_STYLE_TYPES`) and no new code
|
|
7
|
+
* should write them. See `0019-retire-rte-object-style-sync.md` and `global-text-style.md`.
|
|
8
|
+
*/
|
|
2
9
|
export declare const TEXT_STYLE_TYPES: {
|
|
10
|
+
readonly heading1: "heading1";
|
|
11
|
+
readonly heading2: "heading2";
|
|
12
|
+
readonly heading3: "heading3";
|
|
13
|
+
readonly heading4: "heading4";
|
|
14
|
+
readonly heading5: "heading5";
|
|
15
|
+
readonly heading6: "heading6";
|
|
16
|
+
readonly paragraph1: "paragraph1";
|
|
17
|
+
readonly paragraph2: "paragraph2";
|
|
18
|
+
readonly paragraph3: "paragraph3";
|
|
19
|
+
readonly button: "button";
|
|
3
20
|
readonly titles: "titles";
|
|
4
21
|
readonly headings: "headings";
|
|
5
22
|
readonly paragraphs: "paragraphs";
|
|
6
23
|
readonly buttons: "buttons";
|
|
7
24
|
};
|
|
8
25
|
export type TextStyleType = keyof typeof TEXT_STYLE_TYPES;
|
|
26
|
+
/** The 10 roles shown in the panel/picker, in display order. */
|
|
27
|
+
export declare const CANONICAL_TEXT_STYLE_TYPES: readonly ["heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "paragraph1", "paragraph2", "paragraph3", "button"];
|
|
28
|
+
export type CanonicalTextStyleType = (typeof CANONICAL_TEXT_STYLE_TYPES)[number];
|
|
29
|
+
/** Legacy roles, retained for resolution of un-migrated content only. */
|
|
30
|
+
export declare const LEGACY_TEXT_STYLE_TYPES: readonly ["titles", "headings", "paragraphs", "buttons"];
|
|
31
|
+
export type LegacyTextStyleType = (typeof LEGACY_TEXT_STYLE_TYPES)[number];
|
|
32
|
+
export declare const isLegacyTextStyleType: (type: string | undefined) => type is LegacyTextStyleType;
|
|
33
|
+
export declare const isCanonicalTextStyleType: (type: unknown) => type is CanonicalTextStyleType;
|
|
9
34
|
export declare const TEXT_STYLE_TYPES_DISPLAY_NAME_MAP: () => {
|
|
35
|
+
heading1: any;
|
|
36
|
+
heading2: any;
|
|
37
|
+
heading3: any;
|
|
38
|
+
heading4: any;
|
|
39
|
+
heading5: any;
|
|
40
|
+
heading6: any;
|
|
41
|
+
paragraph1: any;
|
|
42
|
+
paragraph2: any;
|
|
43
|
+
paragraph3: any;
|
|
44
|
+
button: any;
|
|
10
45
|
titles: any;
|
|
11
46
|
headings: any;
|
|
12
47
|
paragraphs: any;
|
|
13
48
|
buttons: any;
|
|
14
|
-
none: any;
|
|
15
49
|
};
|
|
16
50
|
export type TextStyleDeclaration = BrandPageCssStyle & {
|
|
17
51
|
textStyleType?: TextStyleType;
|
|
18
52
|
applyAutoScale?: boolean;
|
|
19
53
|
};
|
|
20
54
|
export type TextStyleDeclarationWithoutTextAlign = Omit<TextStyleDeclaration, 'textAlign'>;
|
|
55
|
+
/**
|
|
56
|
+
* BP-5969 (ADR-0020): an RTE-paired section field's style, with **colour decoupled**. Colour
|
|
57
|
+
* is the ONE thing removed from the style object — it lives in the RTE mark now (baked
|
|
58
|
+
* contrast at birth / by migration-22), so this type has no `color` and nothing can read a
|
|
59
|
+
* stale one off an RTE field. Everything else stays: typography here is a genuine per-block
|
|
60
|
+
* OVERRIDE (a title set to a non-role font/size) that the renderer resolves against the role
|
|
61
|
+
* (`roleTypographyStyle`, `fillRteRunTypography`), and dropping it would lose that override
|
|
62
|
+
* through migration — so only `color` goes. Non-RTE per-item styles keep the full
|
|
63
|
+
* `TextStyleDeclaration`.
|
|
64
|
+
*/
|
|
65
|
+
export type RteTextRole = Omit<TextStyleDeclaration, 'color'>;
|
|
21
66
|
export interface GlobalTextStyleDeclaration {
|
|
22
|
-
color: string | undefined;
|
|
23
67
|
fontFamily: string | undefined;
|
|
24
68
|
fontSize: string | undefined;
|
|
25
69
|
fontStyle: string | undefined;
|
|
@@ -39,15 +83,17 @@ export declare class TextStyleOption {
|
|
|
39
83
|
}
|
|
40
84
|
export type TextStyleOptions = Record<TextStyleType, TextStyleOption>;
|
|
41
85
|
/**
|
|
42
|
-
* `style` (the retired site-wide default text colour)
|
|
43
|
-
* so nothing outside migrations can reach
|
|
44
|
-
* JSON, so the constructor carries
|
|
86
|
+
* `style` (the retired site-wide default text colour) and `textFontFamily` (the retired site
|
|
87
|
+
* text font) are untyped on `TextStyles`, so nothing outside migrations can reach them — but
|
|
88
|
+
* they still arrive in pre-gate JSON, so the constructor carries them through for `migration-21`
|
|
89
|
+
* and `migration-22` to consume. Never default `textFontFamily`: the maker store's `$patch` never
|
|
90
|
+
* deletes a key, so a default would be saved back (`0036-retire-text-font-family.md`).
|
|
45
91
|
*/
|
|
46
92
|
export type LegacyTextStylesInput = Partial<TextStyles> & {
|
|
47
93
|
style?: BrandPageCssStyle;
|
|
94
|
+
textFontFamily?: unknown;
|
|
48
95
|
};
|
|
49
96
|
export declare class TextStyles {
|
|
50
|
-
textFontFamily: FontFamilyKey;
|
|
51
97
|
textStyleOptions: TextStyleOptions;
|
|
52
98
|
static GetDefaultTextStyle(): TextStyles;
|
|
53
99
|
constructor(option?: LegacyTextStylesInput);
|
|
@@ -1,20 +1,76 @@
|
|
|
1
|
-
import { FONT_SIZE_HEADINGS, FONT_SIZE_TITLE, LINE_HEIGHT_HEADINGS, LINE_HEIGHT_TITLE, FONT_SIZE_BODY, LINE_HEIGHT_BODY, DISPLAY_TEXT_TITLE, DISPLAY_TEXT_HEADINGS, DISPLAY_TEXT_BODY, STYLE_THEME_KEYS, FONT_FAMILY_CONFIGS, DEFAULT_FONT_FAMILY_KEY, DISPlAY_TEXT_BUTTONS, } from '../constants';
|
|
2
|
-
import {
|
|
1
|
+
import { FONT_SIZE_HEADINGS, FONT_SIZE_TITLE, LINE_HEIGHT_HEADINGS, LINE_HEIGHT_TITLE, FONT_SIZE_BODY, LINE_HEIGHT_BODY, DISPLAY_TEXT_TITLE, DISPLAY_TEXT_HEADINGS, DISPLAY_TEXT_BODY, STYLE_THEME_KEYS, FONT_FAMILY_CONFIGS, DEFAULT_FONT_FAMILY_KEY, DISPlAY_TEXT_BUTTONS, DISPLAY_TEXT_HEADING_1, DISPLAY_TEXT_HEADING_2, DISPLAY_TEXT_HEADING_3, DISPLAY_TEXT_HEADING_4, DISPLAY_TEXT_HEADING_5, DISPLAY_TEXT_HEADING_6, DISPLAY_TEXT_PARAGRAPH_1, DISPLAY_TEXT_PARAGRAPH_2, DISPLAY_TEXT_PARAGRAPH_3, DISPLAY_TEXT_BUTTON, TEXT_ROLE_STYLE_DEFAULTS, } from '../constants';
|
|
2
|
+
import { styleSettingsTr } from '@src/composables/useTranslate';
|
|
3
|
+
/**
|
|
4
|
+
* The 10 canonical global text roles (BP-5969) plus the 4 legacy roles.
|
|
5
|
+
*
|
|
6
|
+
* Legacy keys (`titles`/`headings`/`paragraphs`/`buttons`) are retained ONLY so
|
|
7
|
+
* pre-migration content keeps resolving until migration-22 converts it; they are
|
|
8
|
+
* hidden from the panel/picker (see `CANONICAL_TEXT_STYLE_TYPES`) and no new code
|
|
9
|
+
* should write them. See `0019-retire-rte-object-style-sync.md` and `global-text-style.md`.
|
|
10
|
+
*/
|
|
3
11
|
export const TEXT_STYLE_TYPES = {
|
|
12
|
+
heading1: 'heading1',
|
|
13
|
+
heading2: 'heading2',
|
|
14
|
+
heading3: 'heading3',
|
|
15
|
+
heading4: 'heading4',
|
|
16
|
+
heading5: 'heading5',
|
|
17
|
+
heading6: 'heading6',
|
|
18
|
+
paragraph1: 'paragraph1',
|
|
19
|
+
paragraph2: 'paragraph2',
|
|
20
|
+
paragraph3: 'paragraph3',
|
|
21
|
+
button: 'button',
|
|
22
|
+
// --- legacy (resolution-only, hidden, do not write) ---
|
|
4
23
|
titles: 'titles',
|
|
5
24
|
headings: 'headings',
|
|
6
25
|
paragraphs: 'paragraphs',
|
|
7
26
|
buttons: 'buttons',
|
|
8
27
|
};
|
|
28
|
+
/** The 10 roles shown in the panel/picker, in display order. */
|
|
29
|
+
export const CANONICAL_TEXT_STYLE_TYPES = [
|
|
30
|
+
'heading1',
|
|
31
|
+
'heading2',
|
|
32
|
+
'heading3',
|
|
33
|
+
'heading4',
|
|
34
|
+
'heading5',
|
|
35
|
+
'heading6',
|
|
36
|
+
'paragraph1',
|
|
37
|
+
'paragraph2',
|
|
38
|
+
'paragraph3',
|
|
39
|
+
'button',
|
|
40
|
+
];
|
|
41
|
+
/** Legacy roles, retained for resolution of un-migrated content only. */
|
|
42
|
+
export const LEGACY_TEXT_STYLE_TYPES = [
|
|
43
|
+
'titles',
|
|
44
|
+
'headings',
|
|
45
|
+
'paragraphs',
|
|
46
|
+
'buttons',
|
|
47
|
+
];
|
|
48
|
+
export const isLegacyTextStyleType = (type) => LEGACY_TEXT_STYLE_TYPES.includes(type ?? '');
|
|
49
|
+
// Models-level so both the render path (`text-role-css.util.ts`) and the migration path
|
|
50
|
+
// (`text-role-reconnect.util.ts`, which re-exports this) share one guard, rather than a render
|
|
51
|
+
// component reaching into the migration-side file for it.
|
|
52
|
+
export const isCanonicalTextStyleType = (type) => CANONICAL_TEXT_STYLE_TYPES.includes(type);
|
|
53
|
+
const ALL_TEXT_STYLE_TYPES = [
|
|
54
|
+
...CANONICAL_TEXT_STYLE_TYPES,
|
|
55
|
+
...LEGACY_TEXT_STYLE_TYPES,
|
|
56
|
+
];
|
|
9
57
|
export const TEXT_STYLE_TYPES_DISPLAY_NAME_MAP = () => ({
|
|
58
|
+
heading1: styleSettingsTr('heading1'),
|
|
59
|
+
heading2: styleSettingsTr('heading2'),
|
|
60
|
+
heading3: styleSettingsTr('heading3'),
|
|
61
|
+
heading4: styleSettingsTr('heading4'),
|
|
62
|
+
heading5: styleSettingsTr('heading5'),
|
|
63
|
+
heading6: styleSettingsTr('heading6'),
|
|
64
|
+
paragraph1: styleSettingsTr('paragraph1'),
|
|
65
|
+
paragraph2: styleSettingsTr('paragraph2'),
|
|
66
|
+
paragraph3: styleSettingsTr('paragraph3'),
|
|
67
|
+
button: styleSettingsTr('button'),
|
|
10
68
|
titles: styleSettingsTr('titles'),
|
|
11
69
|
headings: styleSettingsTr('headings'),
|
|
12
70
|
paragraphs: styleSettingsTr('paragraphs'),
|
|
13
71
|
buttons: styleSettingsTr('buttons'),
|
|
14
|
-
none: commonTr('none'),
|
|
15
72
|
});
|
|
16
73
|
export const emptyGlobalTextStyleDeclaration = Object.freeze({
|
|
17
|
-
color: undefined,
|
|
18
74
|
fontFamily: undefined,
|
|
19
75
|
fontSize: undefined,
|
|
20
76
|
fontStyle: undefined,
|
|
@@ -36,9 +92,10 @@ export class TextStyleOption {
|
|
|
36
92
|
this.isModified = options.isModified || false;
|
|
37
93
|
}
|
|
38
94
|
}
|
|
39
|
-
// No `color`
|
|
40
|
-
// from ancient metadata, so a colour minted here would pre-empt
|
|
41
|
-
// copy of the model's own root colour.
|
|
95
|
+
// No `color` on defaults, on purpose: these run pre-gate and back-fill options
|
|
96
|
+
// missing from ancient metadata, so a colour minted here would pre-empt
|
|
97
|
+
// migration-21's copy of the model's own root colour. (BP-5969: the same holds
|
|
98
|
+
// for the 10 new roles — colour comes from the root cascade / migration.)
|
|
42
99
|
const createDefaultTitlesTextStyleOption = () => new TextStyleOption(TEXT_STYLE_TYPES.titles, DISPLAY_TEXT_TITLE, {
|
|
43
100
|
style: {
|
|
44
101
|
...emptyGlobalTextStyleDeclaration,
|
|
@@ -71,37 +128,68 @@ const createDefaultButtonTextStyleOption = () => new TextStyleOption(TEXT_STYLE_
|
|
|
71
128
|
fontFamily: FONT_FAMILY_CONFIGS[DEFAULT_FONT_FAMILY_KEY].name,
|
|
72
129
|
},
|
|
73
130
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
131
|
+
const CANONICAL_DISPLAY_NAMES = {
|
|
132
|
+
heading1: DISPLAY_TEXT_HEADING_1,
|
|
133
|
+
heading2: DISPLAY_TEXT_HEADING_2,
|
|
134
|
+
heading3: DISPLAY_TEXT_HEADING_3,
|
|
135
|
+
heading4: DISPLAY_TEXT_HEADING_4,
|
|
136
|
+
heading5: DISPLAY_TEXT_HEADING_5,
|
|
137
|
+
heading6: DISPLAY_TEXT_HEADING_6,
|
|
138
|
+
paragraph1: DISPLAY_TEXT_PARAGRAPH_1,
|
|
139
|
+
paragraph2: DISPLAY_TEXT_PARAGRAPH_2,
|
|
140
|
+
paragraph3: DISPLAY_TEXT_PARAGRAPH_3,
|
|
141
|
+
button: DISPLAY_TEXT_BUTTON,
|
|
142
|
+
};
|
|
143
|
+
const createCanonicalTextStyleOption = (type) => {
|
|
144
|
+
const defaults = TEXT_ROLE_STYLE_DEFAULTS[type];
|
|
145
|
+
return new TextStyleOption(type, CANONICAL_DISPLAY_NAMES[type], {
|
|
146
|
+
style: {
|
|
147
|
+
...emptyGlobalTextStyleDeclaration,
|
|
148
|
+
fontSize: defaults.fontSize,
|
|
149
|
+
fontWeight: defaults.fontWeight,
|
|
150
|
+
lineHeight: defaults.lineHeight,
|
|
151
|
+
fontFamily: FONT_FAMILY_CONFIGS[DEFAULT_FONT_FAMILY_KEY].name,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
const LEGACY_FACTORIES = {
|
|
156
|
+
titles: createDefaultTitlesTextStyleOption,
|
|
157
|
+
headings: createDefaultHeadingsTextStyleOption,
|
|
158
|
+
paragraphs: createDefaultParagraphTextStyleOption,
|
|
159
|
+
buttons: createDefaultButtonTextStyleOption,
|
|
160
|
+
};
|
|
161
|
+
const createDefaultTextStyleOption = (type) => isLegacyTextStyleType(type)
|
|
162
|
+
? LEGACY_FACTORIES[type]()
|
|
163
|
+
: createCanonicalTextStyleOption(type);
|
|
164
|
+
const createDefaultTextStyleOptions = () => Object.fromEntries(ALL_TEXT_STYLE_TYPES.map((type) => [
|
|
165
|
+
type,
|
|
166
|
+
createDefaultTextStyleOption(type),
|
|
167
|
+
]));
|
|
80
168
|
export class TextStyles {
|
|
81
|
-
textFontFamily;
|
|
82
169
|
textStyleOptions;
|
|
83
170
|
static GetDefaultTextStyle() {
|
|
84
171
|
return new TextStyles({
|
|
85
172
|
style: { color: STYLE_THEME_KEYS.LogoTextColor },
|
|
86
|
-
textFontFamily: DEFAULT_FONT_FAMILY_KEY,
|
|
87
173
|
});
|
|
88
174
|
}
|
|
89
175
|
constructor(option = {}) {
|
|
90
176
|
if (option.style !== undefined) {
|
|
91
177
|
this['style'] = option.style;
|
|
92
178
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
179
|
+
if (option.textFontFamily !== undefined) {
|
|
180
|
+
this['textFontFamily'] =
|
|
181
|
+
option.textFontFamily;
|
|
182
|
+
}
|
|
183
|
+
const loaded = option.textStyleOptions;
|
|
184
|
+
// Data-driven build over all 14 roles: use the persisted option where present,
|
|
185
|
+
// else the role's default. Existing sites (4 legacy roles only) thus keep their
|
|
186
|
+
// stored definitions and gain the 10 new tiers at their defaults; new sites get
|
|
187
|
+
// every role's default. Titles are re-derived from i18n (`styleSettingsTr`).
|
|
188
|
+
this.textStyleOptions = loaded
|
|
189
|
+
? Object.fromEntries(ALL_TEXT_STYLE_TYPES.map((type) => [
|
|
190
|
+
type,
|
|
191
|
+
new TextStyleOption(type, styleSettingsTr(type), loaded[type] || createDefaultTextStyleOption(type)),
|
|
192
|
+
]))
|
|
105
193
|
: createDefaultTextStyleOptions();
|
|
106
194
|
}
|
|
107
195
|
}
|
|
@@ -206,37 +206,57 @@ export interface NeutralPalette {
|
|
|
206
206
|
*/
|
|
207
207
|
export declare const generateNeutralPalette: (primary?: string, secondary?: string) => NeutralPalette;
|
|
208
208
|
/**
|
|
209
|
-
* The contrast a
|
|
210
|
-
* the
|
|
209
|
+
* The minimum contrast a BRAND text colour must clear against the surface it sits on for the
|
|
210
|
+
* birth-time bake to use it; below this the bake falls back (to the other brand role, then a
|
|
211
|
+
* neutral for the page). One colour covers *all* copy on a surface, so no threshold guarantees
|
|
212
|
+
* every size — this is a floor for large brand copy.
|
|
211
213
|
*
|
|
212
|
-
* **WCAG AA
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
214
|
+
* **2:1 — deliberately BELOW WCAG AA large-text (3:1).** The brand's own logo-text colour is the
|
|
215
|
+
* site identity and should lead its headings even when it's a bright mid-tone that lands ~2.3:1
|
|
216
|
+
* on white (a large bold heading still reads there — the BP-5969 call, ADR-0020). 2:1 keeps that
|
|
217
|
+
* while still rejecting the genuinely invisible end (~1:1, e.g. a near-white role on white). A
|
|
218
|
+
* brand-identity-over-strict-contrast trade; raising it back toward 3 is a one-line change.
|
|
217
219
|
*
|
|
218
|
-
*
|
|
219
|
-
* > resolver (BP-5886, ADR 0017). `bestContrastBrandRole`'s remaining callers use the
|
|
220
|
-
* > default `minRatio` of 0. Retire alongside the other theme-pair leftovers.
|
|
220
|
+
* Live consumer: `viableBrandRole` (`container-text-color.util.ts`), the contrast bake's floor.
|
|
221
221
|
*/
|
|
222
|
-
export declare const STRATEGY_COPY_MIN_CONTRAST =
|
|
222
|
+
export declare const STRATEGY_COPY_MIN_CONTRAST = 2;
|
|
223
223
|
/**
|
|
224
|
-
* The
|
|
225
|
-
*
|
|
226
|
-
*
|
|
224
|
+
* The palette role from `candidateIds` whose colour reads best against `against` — WCAG 2.1
|
|
225
|
+
* contrast ratio. `undefined` when `against` is not a solid, no candidate holds a usable solid
|
|
226
|
+
* colour, or none clears `minRatio`. Candidates are ranked in the order given, so an exact tie
|
|
227
|
+
* resolves to the earlier id.
|
|
227
228
|
*
|
|
228
|
-
* The ratio, rather than a lightness comparison, answers the degenerate palettes with no
|
|
229
|
-
*
|
|
230
|
-
*
|
|
229
|
+
* The ratio, rather than a lightness comparison, answers the degenerate palettes with no second
|
|
230
|
+
* rule: two dark candidates against the dark neutral yield the less dark one. Alpha is ignored
|
|
231
|
+
* (`chroma.contrast` composites nothing).
|
|
231
232
|
*
|
|
232
|
-
* **`minRatio` is the legibility floor, and without it this ranks without judging** — it
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
* **`minRatio` is the legibility floor, and without it this ranks without judging** — it returns
|
|
234
|
+
* the *best available* role even when unreadable. `undefined` then routes the caller to its own
|
|
235
|
+
* fallback.
|
|
236
|
+
*/
|
|
237
|
+
export declare const bestContrastRole: (against: string, colors: ColorItem[] | undefined, candidateIds: string[], minRatio?: number) => string | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* The BRAND role (`palette-0` / `palette-1`) that reads best against `against`; primary wins
|
|
240
|
+
* ties. The neutrals are excluded on purpose — a section title on a coloured surface takes a
|
|
241
|
+
* brand accent. See `bestContrastRole` for the ranking and the `minRatio` floor (without it, an
|
|
242
|
+
* `undefined` return routes the caller to its neutral fallback, which is right because the
|
|
243
|
+
* neutrals are brand-hue tinted, so the hue survives).
|
|
238
244
|
*/
|
|
239
245
|
export declare const bestContrastBrandRole: (against: string, colors?: ColorItem[], minRatio?: number) => string | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* The NEUTRAL role (`palette-2` light / `palette-3` dark) that reads best against `against` — the
|
|
248
|
+
* readable, brand-hue-tinted text colour for copy on a plain surface (the page background),
|
|
249
|
+
* replacing the retired base coat. Light role wins ties.
|
|
250
|
+
*/
|
|
251
|
+
export declare const bestContrastNeutralRole: (against: string, colors?: ColorItem[]) => string | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* The FIRST role in `orderedIds` whose colour clears `minRatio` against `against` — a PRIORITY
|
|
254
|
+
* pick, not a best-contrast pick: an earlier id wins even when a later one contrasts more. Honours
|
|
255
|
+
* a brand hierarchy (e.g. logo-text before logo-background) while still guaranteeing legibility via
|
|
256
|
+
* the floor. `undefined` when `against` is not a solid or no listed role clears `minRatio`, so the
|
|
257
|
+
* caller can route on to its own fallback.
|
|
258
|
+
*/
|
|
259
|
+
export declare const firstViableContrastRole: (against: string, colors: ColorItem[] | undefined, orderedIds: string[], minRatio: number) => string | undefined;
|
|
240
260
|
export declare const DEFAULT_PRIMARY = "#2b6cff";
|
|
241
261
|
export declare const DEFAULT_SECONDARY = "#0a2540";
|
|
242
262
|
/** The four default palette-role entries (used when nothing can be derived). */
|
|
@@ -8,6 +8,9 @@ import { isColorLinearGradient } from '@src/utils/helpers';
|
|
|
8
8
|
* colour value, mint a deterministic palette id for it, and translate between an id
|
|
9
9
|
* and its `var(--id)` reference. Side-effect and framework free so migration, maker
|
|
10
10
|
* and renderer can all share them.
|
|
11
|
+
*
|
|
12
|
+
* MIGRATION-22 SNAPSHOT DEPENDENCY: its colour bake uses `isBlankColorValue`. Pin the v22
|
|
13
|
+
* interpretation before changing that helper after the migration releases.
|
|
11
14
|
*/
|
|
12
15
|
const CUSTOM_ID_PREFIX = 'palette-custom-';
|
|
13
16
|
/**
|
|
@@ -500,37 +503,35 @@ export const generateNeutralPalette = (primary, secondary) => ({
|
|
|
500
503
|
dark: utilityNeutral(secondary),
|
|
501
504
|
});
|
|
502
505
|
/**
|
|
503
|
-
* The contrast a
|
|
504
|
-
* the
|
|
506
|
+
* The minimum contrast a BRAND text colour must clear against the surface it sits on for the
|
|
507
|
+
* birth-time bake to use it; below this the bake falls back (to the other brand role, then a
|
|
508
|
+
* neutral for the page). One colour covers *all* copy on a surface, so no threshold guarantees
|
|
509
|
+
* every size — this is a floor for large brand copy.
|
|
505
510
|
*
|
|
506
|
-
* **WCAG AA
|
|
507
|
-
*
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
+
* **2:1 — deliberately BELOW WCAG AA large-text (3:1).** The brand's own logo-text colour is the
|
|
512
|
+
* site identity and should lead its headings even when it's a bright mid-tone that lands ~2.3:1
|
|
513
|
+
* on white (a large bold heading still reads there — the BP-5969 call, ADR-0020). 2:1 keeps that
|
|
514
|
+
* while still rejecting the genuinely invisible end (~1:1, e.g. a near-white role on white). A
|
|
515
|
+
* brand-identity-over-strict-contrast trade; raising it back toward 3 is a one-line change.
|
|
511
516
|
*
|
|
512
|
-
*
|
|
513
|
-
* > resolver (BP-5886, ADR 0017). `bestContrastBrandRole`'s remaining callers use the
|
|
514
|
-
* > default `minRatio` of 0. Retire alongside the other theme-pair leftovers.
|
|
517
|
+
* Live consumer: `viableBrandRole` (`container-text-color.util.ts`), the contrast bake's floor.
|
|
515
518
|
*/
|
|
516
|
-
export const STRATEGY_COPY_MIN_CONTRAST =
|
|
519
|
+
export const STRATEGY_COPY_MIN_CONTRAST = 2;
|
|
517
520
|
/**
|
|
518
|
-
* The
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
+
* The palette role from `candidateIds` whose colour reads best against `against` — WCAG 2.1
|
|
522
|
+
* contrast ratio. `undefined` when `against` is not a solid, no candidate holds a usable solid
|
|
523
|
+
* colour, or none clears `minRatio`. Candidates are ranked in the order given, so an exact tie
|
|
524
|
+
* resolves to the earlier id.
|
|
521
525
|
*
|
|
522
|
-
* The ratio, rather than a lightness comparison, answers the degenerate palettes with no
|
|
523
|
-
*
|
|
524
|
-
*
|
|
526
|
+
* The ratio, rather than a lightness comparison, answers the degenerate palettes with no second
|
|
527
|
+
* rule: two dark candidates against the dark neutral yield the less dark one. Alpha is ignored
|
|
528
|
+
* (`chroma.contrast` composites nothing).
|
|
525
529
|
*
|
|
526
|
-
* **`minRatio` is the legibility floor, and without it this ranks without judging** — it
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
* be a literal and stop following palette edits.
|
|
532
|
-
*/
|
|
533
|
-
export const bestContrastBrandRole = (against, colors = [], minRatio = 0) => {
|
|
530
|
+
* **`minRatio` is the legibility floor, and without it this ranks without judging** — it returns
|
|
531
|
+
* the *best available* role even when unreadable. `undefined` then routes the caller to its own
|
|
532
|
+
* fallback.
|
|
533
|
+
*/
|
|
534
|
+
export const bestContrastRole = (against, colors = [], candidateIds, minRatio = 0) => {
|
|
534
535
|
// `canonicalSolidHex` rather than `chroma.valid`: a gradient, an unresolved `var()`
|
|
535
536
|
// and `transparent` (which chroma WOULD accept, as black) are all excluded.
|
|
536
537
|
const baseHex = canonicalSolidHex(against);
|
|
@@ -538,8 +539,7 @@ export const bestContrastBrandRole = (against, colors = [], minRatio = 0) => {
|
|
|
538
539
|
return undefined;
|
|
539
540
|
}
|
|
540
541
|
const byId = new Map(colors.map((c) => [c.id, c.value]));
|
|
541
|
-
|
|
542
|
-
const candidates = [PALETTE_COLOR_IDS.primary, PALETTE_COLOR_IDS.secondary]
|
|
542
|
+
const candidates = candidateIds
|
|
543
543
|
.map((id) => ({
|
|
544
544
|
id,
|
|
545
545
|
hex: canonicalSolidHex(byId.get(id) ?? ''),
|
|
@@ -551,6 +551,44 @@ export const bestContrastBrandRole = (against, colors = [], minRatio = 0) => {
|
|
|
551
551
|
}, undefined);
|
|
552
552
|
return best && best.ratio >= minRatio ? best.id : undefined;
|
|
553
553
|
};
|
|
554
|
+
/**
|
|
555
|
+
* The BRAND role (`palette-0` / `palette-1`) that reads best against `against`; primary wins
|
|
556
|
+
* ties. The neutrals are excluded on purpose — a section title on a coloured surface takes a
|
|
557
|
+
* brand accent. See `bestContrastRole` for the ranking and the `minRatio` floor (without it, an
|
|
558
|
+
* `undefined` return routes the caller to its neutral fallback, which is right because the
|
|
559
|
+
* neutrals are brand-hue tinted, so the hue survives).
|
|
560
|
+
*/
|
|
561
|
+
export const bestContrastBrandRole = (against, colors = [], minRatio = 0) => bestContrastRole(against, colors, [PALETTE_COLOR_IDS.primary, PALETTE_COLOR_IDS.secondary], minRatio);
|
|
562
|
+
/**
|
|
563
|
+
* The NEUTRAL role (`palette-2` light / `palette-3` dark) that reads best against `against` — the
|
|
564
|
+
* readable, brand-hue-tinted text colour for copy on a plain surface (the page background),
|
|
565
|
+
* replacing the retired base coat. Light role wins ties.
|
|
566
|
+
*/
|
|
567
|
+
export const bestContrastNeutralRole = (against, colors = []) => bestContrastRole(against, colors, [
|
|
568
|
+
PALETTE_COLOR_IDS.neutralLight,
|
|
569
|
+
PALETTE_COLOR_IDS.neutralDark,
|
|
570
|
+
]);
|
|
571
|
+
/**
|
|
572
|
+
* The FIRST role in `orderedIds` whose colour clears `minRatio` against `against` — a PRIORITY
|
|
573
|
+
* pick, not a best-contrast pick: an earlier id wins even when a later one contrasts more. Honours
|
|
574
|
+
* a brand hierarchy (e.g. logo-text before logo-background) while still guaranteeing legibility via
|
|
575
|
+
* the floor. `undefined` when `against` is not a solid or no listed role clears `minRatio`, so the
|
|
576
|
+
* caller can route on to its own fallback.
|
|
577
|
+
*/
|
|
578
|
+
export const firstViableContrastRole = (against, colors = [], orderedIds, minRatio) => {
|
|
579
|
+
const baseHex = canonicalSolidHex(against);
|
|
580
|
+
if (!baseHex) {
|
|
581
|
+
return undefined;
|
|
582
|
+
}
|
|
583
|
+
const byId = new Map(colors.map((c) => [c.id, c.value]));
|
|
584
|
+
for (const id of orderedIds) {
|
|
585
|
+
const hex = canonicalSolidHex(byId.get(id) ?? '');
|
|
586
|
+
if (hex && chroma.contrast(baseHex, hex) >= minRatio) {
|
|
587
|
+
return id;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return undefined;
|
|
591
|
+
};
|
|
554
592
|
// The fallback palette. The neutrals are generated from the two blues (one code path) so
|
|
555
593
|
// it stays self-consistent with real logos.
|
|
556
594
|
export const DEFAULT_PRIMARY = '#2b6cff';
|
|
@@ -46,15 +46,19 @@ export declare const mutedTextForBackground: (bgColor: string | undefined, { tar
|
|
|
46
46
|
}) => string | undefined;
|
|
47
47
|
export declare const backgroundColorFromStyle: (style: BrandPageCssStyle | undefined) => string | undefined;
|
|
48
48
|
/**
|
|
49
|
-
* The nav "theme" for a display-type switch
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `
|
|
49
|
+
* The nav "theme" for a header nav display-type switch. Nav themes off the LOGO, independently
|
|
50
|
+
* of the page's button styling (ADR-0022): `primaryColor` — the dominant nav colour used for
|
|
51
|
+
* default text, border and the selected button's fill — is the first brand role that stays
|
|
52
|
+
* legible (>= `STRATEGY_COPY_MIN_CONTRAST`) on the header background: logo text colour
|
|
53
|
+
* (`palette-0`), else logo background colour (`palette-1`), else a generated neutral.
|
|
54
|
+
* `secondaryColor` — the selected button's label — is the brand role that best contrasts
|
|
55
|
+
* `primaryColor` (`bestContrastBrandRole`), so the label reads on the filled pill
|
|
56
|
+
* ("encapsulated contrast").
|
|
53
57
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
+
* Brand picks are returned as palette `var(--id)` references so the nav keeps tracking palette
|
|
59
|
+
* edits; only the neutral fallback is a literal. `headerBackgroundColor` is the preferred surface
|
|
60
|
+
* the nav sits on. When it does not paint, `pageBackgroundColor` is the surface visible behind the
|
|
61
|
+
* header; white is the final fallback when neither resolves to a solid colour.
|
|
58
62
|
*/
|
|
59
|
-
export declare const getNavThemeByTextStyle: (
|
|
63
|
+
export declare const getNavThemeByTextStyle: (headerBackgroundColor: string | undefined, colors?: ColorItem[], pageBackgroundColor?: string) => Theme;
|
|
60
64
|
export declare const getNewColorBasedOnTargetColorTheme: (originalColor: string, targetColor: string) => ColorInstance | undefined;
|