@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Canonical reference: service.ai-pipelines/src/agents/website/section_schemas.py
|
|
5
5
|
* Every field defined there has a corresponding TS field here.
|
|
6
6
|
*/
|
|
7
|
-
import type { ContentType } from '../../brand-page/models';
|
|
7
|
+
import type { ContentType, CanonicalTextStyleType } from '../../brand-page/models';
|
|
8
8
|
/** Content types not supported by the AI builder. */
|
|
9
9
|
type UnsupportedContentType = 'logo' | 'video' | 'map' | 'request-payment' | 'shop-section';
|
|
10
10
|
export type SectionType = Exclude<ContentType, UnsupportedContentType>;
|
|
@@ -17,6 +17,10 @@ export interface TiptapMark {
|
|
|
17
17
|
fontFamily?: string;
|
|
18
18
|
letterSpacing?: string;
|
|
19
19
|
lineHeight?: string;
|
|
20
|
+
fontWeight?: string;
|
|
21
|
+
fontStyle?: string;
|
|
22
|
+
textDecoration?: string;
|
|
23
|
+
textDecorationReset?: boolean;
|
|
20
24
|
};
|
|
21
25
|
}
|
|
22
26
|
export interface TiptapTextNode {
|
|
@@ -46,6 +50,15 @@ export type RichTextField = string | TiptapDocument;
|
|
|
46
50
|
/** Type guard: checks if a value is a TiptapDocument object. */
|
|
47
51
|
export declare const isTiptapDocument: (value: unknown) => value is TiptapDocument;
|
|
48
52
|
export interface TextStyleArguments {
|
|
53
|
+
/**
|
|
54
|
+
* BP-5969 — the canonical text role this element links to. The AI names a role (roles are the
|
|
55
|
+
* site's predefined styling); typography then follows the role and only a genuinely divergent
|
|
56
|
+
* property is sent below as a sparse override. Absent, a retired key, or `none` reconnects
|
|
57
|
+
* instead (`applyAiStyle`, `reconnectTextStyle`): the field's starting role, else the retired
|
|
58
|
+
* role's successor, else the role nearest its size — keeping the look as overrides, never fully
|
|
59
|
+
* detached from a role.
|
|
60
|
+
*/
|
|
61
|
+
textStyleType?: CanonicalTextStyleType | null;
|
|
49
62
|
fontSize?: string | null;
|
|
50
63
|
color?: string | null;
|
|
51
64
|
fontWeight?: string | null;
|
|
@@ -72,6 +85,8 @@ export interface TextStyleArguments {
|
|
|
72
85
|
* (`_button_text_style_field`) for the AI-side mirror.
|
|
73
86
|
*/
|
|
74
87
|
export interface ButtonTextStyleArguments {
|
|
88
|
+
/** BP-5969 — the canonical role a button label links to. See `TextStyleArguments.textStyleType`. */
|
|
89
|
+
textStyleType?: CanonicalTextStyleType | null;
|
|
75
90
|
color?: string | null;
|
|
76
91
|
fontSize?: string | null;
|
|
77
92
|
fontWeight?: string | null;
|
|
@@ -218,8 +233,10 @@ export interface SocialLink {
|
|
|
218
233
|
url?: string;
|
|
219
234
|
}
|
|
220
235
|
export interface SocialLinksSectionArguments {
|
|
236
|
+
title?: RichTextField;
|
|
221
237
|
links?: SocialLink[];
|
|
222
238
|
icon_style?: 'none' | 'square' | 'circle';
|
|
239
|
+
title_style?: TextStyleArguments;
|
|
223
240
|
/** Style for the social-icon SVG fill (filled from the palette by the slot router). */
|
|
224
241
|
icon_fill_style?: TextStyleArguments;
|
|
225
242
|
/** Style for the icon container background (used when icon_style is 'square' or 'circle'). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSchema } from '@tiptap/core';
|
|
2
|
-
import { getRteExtensions } from '
|
|
2
|
+
import { getRteExtensions } from '@shared/rte-extensions.util';
|
|
3
3
|
import { isTiptapDocument } from '../parsers/section-tool-arguments';
|
|
4
4
|
import { rteStyleCheck, textCheck, } from './section-args-validator';
|
|
5
5
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Shared style/logo/page constraint rules and the SectionRules interface.
|
|
5
5
|
* Per-section rules live colocated with each builder (e.g. banner-section.rules.ts).
|
|
6
6
|
*/
|
|
7
|
-
import { MIN_TEXT_SIZE_PX, MAX_TEXT_SIZE_PX, MIN_LINE_HEIGHT, MAX_LINE_HEIGHT, MIN_LETTER_SPACING_PERCENT, MAX_LETTER_SPACING_PERCENT, FONT_FAMILY_CONFIGS,
|
|
7
|
+
import { MIN_TEXT_SIZE_PX, MAX_TEXT_SIZE_PX, MIN_LINE_HEIGHT, MAX_LINE_HEIGHT, MIN_LETTER_SPACING_PERCENT, MAX_LETTER_SPACING_PERCENT, FONT_FAMILY_CONFIGS, } from '../../brand-page/constants/font.constants';
|
|
8
8
|
import { MAX_PAGE_TITLE_LENGTH, MAX_SUBPAGE_TITLE_LENGTH, } from '../../shared/page-settings/utils';
|
|
9
9
|
import { LOGO_SLIDER_DESKTOP_MIN, LOGO_SLIDER_DESKTOP_MAX, LOGO_SLIDER_MOBILE_MIN, LOGO_SLIDER_MOBILE_MAX, } from '../../brand-page/constants/styles.constants';
|
|
10
10
|
import { pxToEm } from '../../brand-page-maker/utils/text.util';
|
|
@@ -12,9 +12,9 @@ import { pxToEm } from '../../brand-page-maker/utils/text.util';
|
|
|
12
12
|
// Applies to any TextStyleArguments object (section styles, global styles,
|
|
13
13
|
// header/footer viewport overrides).
|
|
14
14
|
//
|
|
15
|
-
// fontFamilyNames
|
|
16
|
-
//
|
|
17
|
-
//
|
|
15
|
+
// fontFamilyNames uses a Set (not a readonly array) because it is derived
|
|
16
|
+
// dynamically from FONT_FAMILY_CONFIGS at runtime — as const literal narrowing
|
|
17
|
+
// is not possible. Consumers call .has(value).
|
|
18
18
|
export const STYLE_RULES = {
|
|
19
19
|
// fontSize bounds are in px (natural unit for clamping).
|
|
20
20
|
// Flow: parse input unit → convert to px → clamp → pxToEm(clampedPx)
|
|
@@ -33,14 +33,11 @@ export const STYLE_RULES = {
|
|
|
33
33
|
min: MIN_LETTER_SPACING_PERCENT,
|
|
34
34
|
max: MAX_LETTER_SPACING_PERCENT,
|
|
35
35
|
},
|
|
36
|
-
//
|
|
37
|
-
// TextStyleArguments.fontFamily → display name (e.g. 'Playfair Display')
|
|
38
|
-
// UpdateGlobalStylesArguments.textFontFamily → camelCase key (e.g. 'playfairDisplay')
|
|
36
|
+
// Every font the AI sends is a display name (e.g. 'Playfair Display').
|
|
39
37
|
fontFamilyNames: new Set(Object.values(FONT_FAMILY_CONFIGS).map((c) =>
|
|
40
38
|
// Some font names are stored with surrounding single-quotes (e.g. "'Exo 2'").
|
|
41
39
|
// Strip them so the Set matches the bare names the AI sends.
|
|
42
40
|
c.name.replace(/^'(.*)'$/, '$1'))),
|
|
43
|
-
fontFamilyKeys: new Set(Object.keys(FONT_FAMILY_KEYS)),
|
|
44
41
|
};
|
|
45
42
|
// ─── 2. Logo size rules ───────────────────────────────────────────────────────
|
|
46
43
|
// Applies to logo_image_height / logo_image_width in UpdateHeaderArguments and
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { type ItemCapRule } from './sanitizer-rules';
|
|
2
|
-
|
|
3
|
-
* Validates CSS string-format style attrs (fontSize em, fontFamily name,
|
|
4
|
-
* lineHeight unitless, letterSpacing em) against STYLE_RULES bounds.
|
|
5
|
-
* Used for both RTE textStyle mark attrs and GlobalStyles textStyleOptions.
|
|
6
|
-
* Returns the first error string, or null if all attrs are valid / absent.
|
|
7
|
-
*/
|
|
8
|
-
export declare function validateStringStyleAttrs(path: string, attrs: {
|
|
2
|
+
interface ValidatableStyleAttrs {
|
|
9
3
|
fontSize?: string | null;
|
|
10
4
|
fontFamily?: string | null;
|
|
11
5
|
lineHeight?: string | null;
|
|
12
6
|
letterSpacing?: string | null;
|
|
13
|
-
|
|
7
|
+
fontWeight?: string | null;
|
|
8
|
+
fontStyle?: string | null;
|
|
9
|
+
textDecoration?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function validateStringStyleAttrs(path: string, attrs: ValidatableStyleAttrs): string | null;
|
|
14
12
|
export interface ValidationContext {
|
|
15
13
|
brandPageType?: string;
|
|
16
14
|
mode?: 'create' | 'update';
|
|
17
15
|
}
|
|
18
|
-
/**
|
|
19
|
-
* A pure validation check: record + context → one error string or null.
|
|
20
|
-
* All checks operate on Record<string, unknown> — no concrete section type casting.
|
|
21
|
-
*/
|
|
22
16
|
export type SectionCheck = (record: Record<string, unknown>, ctx: ValidationContext) => string | null;
|
|
23
17
|
export declare const textCheck: (field: string, max: number) => SectionCheck;
|
|
24
18
|
export declare const styleCheck: (field: string) => SectionCheck;
|
|
@@ -28,10 +22,6 @@ export declare const itemStyleCheck: (arrayField: string, itemField: string) =>
|
|
|
28
22
|
export declare const itemRteStyleCheck: (arrayField: string, itemField: string) => SectionCheck;
|
|
29
23
|
export declare const enumCheck: (field: string, allowed: readonly string[], label?: string) => SectionCheck;
|
|
30
24
|
export declare const itemCapCheck: (cap: ItemCapRule, label?: string) => SectionCheck;
|
|
31
|
-
/**
|
|
32
|
-
* Runs an array of SectionChecks against the given args and context.
|
|
33
|
-
* Returns all non-null error strings.
|
|
34
|
-
*/
|
|
35
25
|
export declare function runChecks(checks: SectionCheck[], args: Record<string, unknown>, ctx: ValidationContext): string[];
|
|
36
26
|
/**
|
|
37
27
|
* Validates a logo size value against LOGO_SIZE_RULES for the given viewport.
|
|
@@ -39,3 +29,4 @@ export declare function runChecks(checks: SectionCheck[], args: Record<string, u
|
|
|
39
29
|
* Returns an error string, or null if valid / absent.
|
|
40
30
|
*/
|
|
41
31
|
export declare function validateLogoSize(fieldLabel: string, value: string | undefined | null, viewport: 'desktop' | 'mobile'): string | null;
|
|
32
|
+
export {};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { isTiptapDocument, } from '../parsers/section-tool-arguments';
|
|
2
2
|
import { LOGO_SIZE_RULES, STYLE_RULES, } from './sanitizer-rules';
|
|
3
|
-
//
|
|
3
|
+
// Kept local to avoid the validator/schema import cycle.
|
|
4
|
+
const ROLE_VAR_REF = {
|
|
5
|
+
fontFamily: 'var(--role-font-family)',
|
|
6
|
+
fontSize: 'var(--role-font-size)',
|
|
7
|
+
lineHeight: 'var(--role-line-height)',
|
|
8
|
+
letterSpacing: 'var(--role-letter-spacing)',
|
|
9
|
+
fontWeight: 'var(--role-font-weight)',
|
|
10
|
+
fontStyle: 'var(--role-font-style)',
|
|
11
|
+
textDecoration: 'var(--role-text-decoration)',
|
|
12
|
+
};
|
|
4
13
|
function extractPlainText(value) {
|
|
5
14
|
if (typeof value === 'string')
|
|
6
15
|
return value;
|
|
@@ -60,11 +69,48 @@ function validateStyleArgs(fieldLabel, style) {
|
|
|
60
69
|
return err ? [err] : [];
|
|
61
70
|
});
|
|
62
71
|
}
|
|
72
|
+
const isNoValue = (value) => value == null || value === '';
|
|
73
|
+
const FONT_WEIGHT_VALUES = new Set([
|
|
74
|
+
'normal',
|
|
75
|
+
'bold',
|
|
76
|
+
'bolder',
|
|
77
|
+
'lighter',
|
|
78
|
+
'100',
|
|
79
|
+
'200',
|
|
80
|
+
'300',
|
|
81
|
+
'400',
|
|
82
|
+
'500',
|
|
83
|
+
'600',
|
|
84
|
+
'700',
|
|
85
|
+
'800',
|
|
86
|
+
'900',
|
|
87
|
+
]);
|
|
88
|
+
const FONT_STYLE_VALUES = new Set(['normal', 'italic', 'oblique']);
|
|
89
|
+
const TEXT_DECORATION_KEYWORDS = new Set([
|
|
90
|
+
'underline',
|
|
91
|
+
'line-through',
|
|
92
|
+
'overline',
|
|
93
|
+
]);
|
|
94
|
+
const isValidTextDecoration = (value, allowRoleReset = false) => {
|
|
95
|
+
const flags = value.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
96
|
+
if (flags.length === 0)
|
|
97
|
+
return false;
|
|
98
|
+
if (flags[0] === 'none') {
|
|
99
|
+
return ((flags.length === 1 ||
|
|
100
|
+
(allowRoleReset &&
|
|
101
|
+
flags
|
|
102
|
+
.slice(1)
|
|
103
|
+
.every((flag) => TEXT_DECORATION_KEYWORDS.has(flag)))) &&
|
|
104
|
+
new Set(flags).size === flags.length);
|
|
105
|
+
}
|
|
106
|
+
return (flags.every((flag) => TEXT_DECORATION_KEYWORDS.has(flag)) &&
|
|
107
|
+
new Set(flags).size === flags.length);
|
|
108
|
+
};
|
|
63
109
|
const RTE_MARK_PROPERTY_CHECKS = [
|
|
64
110
|
(path, attrs) => {
|
|
65
|
-
if (attrs.fontSize
|
|
111
|
+
if (isNoValue(attrs.fontSize))
|
|
66
112
|
return null;
|
|
67
|
-
const raw = attrs.fontSize.trim().toLowerCase();
|
|
113
|
+
const raw = String(attrs.fontSize).trim().toLowerCase();
|
|
68
114
|
const unit = fontUnit.allowedUnits[0];
|
|
69
115
|
const match = raw.match(new RegExp(`^(\\d+(?:\\.\\d+)?)${unit}$`));
|
|
70
116
|
if (!match) {
|
|
@@ -78,17 +124,17 @@ const RTE_MARK_PROPERTY_CHECKS = [
|
|
|
78
124
|
: null;
|
|
79
125
|
},
|
|
80
126
|
(path, attrs) => {
|
|
81
|
-
if (attrs.fontFamily
|
|
127
|
+
if (isNoValue(attrs.fontFamily))
|
|
82
128
|
return null;
|
|
83
129
|
return !fontFamilyNames.has(attrs.fontFamily)
|
|
84
130
|
? `"${path}.fontFamily" "${attrs.fontFamily}" is not a recognized font family`
|
|
85
131
|
: null;
|
|
86
132
|
},
|
|
87
133
|
(path, attrs) => {
|
|
88
|
-
if (attrs.lineHeight
|
|
134
|
+
if (isNoValue(attrs.lineHeight))
|
|
89
135
|
return null;
|
|
90
136
|
const val = parseFloat(attrs.lineHeight);
|
|
91
|
-
const isUnitless = !isNaN(val) && attrs.lineHeight.trim() === String(val);
|
|
137
|
+
const isUnitless = !isNaN(val) && String(attrs.lineHeight).trim() === String(val);
|
|
92
138
|
if (!isUnitless) {
|
|
93
139
|
return `"${path}.lineHeight" must be a unitless number (got "${attrs.lineHeight}")`;
|
|
94
140
|
}
|
|
@@ -97,11 +143,10 @@ const RTE_MARK_PROPERTY_CHECKS = [
|
|
|
97
143
|
: null;
|
|
98
144
|
},
|
|
99
145
|
(path, attrs) => {
|
|
100
|
-
if (attrs.letterSpacing
|
|
146
|
+
if (isNoValue(attrs.letterSpacing))
|
|
101
147
|
return null;
|
|
102
|
-
const raw = attrs.letterSpacing.trim().toLowerCase();
|
|
103
|
-
|
|
104
|
-
if (raw === '0')
|
|
148
|
+
const raw = String(attrs.letterSpacing).trim().toLowerCase();
|
|
149
|
+
if (raw === '0' || raw === 'normal')
|
|
105
150
|
return null;
|
|
106
151
|
const match = raw.match(/^(\d+(?:\.\d+)?)em$/);
|
|
107
152
|
if (!match) {
|
|
@@ -114,13 +159,28 @@ const RTE_MARK_PROPERTY_CHECKS = [
|
|
|
114
159
|
? `"${path}.letterSpacing" ${attrs.letterSpacing} is out of bounds (${minEm}em–${maxEm}em)`
|
|
115
160
|
: null;
|
|
116
161
|
},
|
|
162
|
+
(path, attrs) => {
|
|
163
|
+
if (isNoValue(attrs.fontWeight))
|
|
164
|
+
return null;
|
|
165
|
+
return !FONT_WEIGHT_VALUES.has(String(attrs.fontWeight).trim().toLowerCase())
|
|
166
|
+
? `"${path}.fontWeight" "${attrs.fontWeight}" is not a recognized value`
|
|
167
|
+
: null;
|
|
168
|
+
},
|
|
169
|
+
(path, attrs) => {
|
|
170
|
+
if (isNoValue(attrs.fontStyle))
|
|
171
|
+
return null;
|
|
172
|
+
return !FONT_STYLE_VALUES.has(String(attrs.fontStyle).trim().toLowerCase())
|
|
173
|
+
? `"${path}.fontStyle" "${attrs.fontStyle}" is not a recognized value`
|
|
174
|
+
: null;
|
|
175
|
+
},
|
|
176
|
+
(path, attrs) => {
|
|
177
|
+
if (isNoValue(attrs.textDecoration))
|
|
178
|
+
return null;
|
|
179
|
+
return !isValidTextDecoration(String(attrs.textDecoration))
|
|
180
|
+
? `"${path}.textDecoration" "${attrs.textDecoration}" is not a recognized value`
|
|
181
|
+
: null;
|
|
182
|
+
},
|
|
117
183
|
];
|
|
118
|
-
/**
|
|
119
|
-
* Validates CSS string-format style attrs (fontSize em, fontFamily name,
|
|
120
|
-
* lineHeight unitless, letterSpacing em) against STYLE_RULES bounds.
|
|
121
|
-
* Used for both RTE textStyle mark attrs and GlobalStyles textStyleOptions.
|
|
122
|
-
* Returns the first error string, or null if all attrs are valid / absent.
|
|
123
|
-
*/
|
|
124
184
|
export function validateStringStyleAttrs(path, attrs) {
|
|
125
185
|
for (const check of RTE_MARK_PROPERTY_CHECKS) {
|
|
126
186
|
const err = check(path, attrs);
|
|
@@ -130,7 +190,25 @@ export function validateStringStyleAttrs(path, attrs) {
|
|
|
130
190
|
return null;
|
|
131
191
|
}
|
|
132
192
|
function validateRteMarkStyle(path, attrs) {
|
|
133
|
-
|
|
193
|
+
const literalOnly = {};
|
|
194
|
+
for (const [attr, value] of Object.entries(attrs)) {
|
|
195
|
+
if (attr === 'textDecorationReset') {
|
|
196
|
+
if (value !== true && value !== false && value != null) {
|
|
197
|
+
return `"${path}.textDecorationReset" must be a boolean`;
|
|
198
|
+
}
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
if (attr === 'textDecoration' &&
|
|
202
|
+
typeof value === 'string' &&
|
|
203
|
+
value.trim().startsWith('none ') &&
|
|
204
|
+
isValidTextDecoration(value, true)) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (value !== ROLE_VAR_REF[attr]) {
|
|
208
|
+
literalOnly[attr] = value;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return validateStringStyleAttrs(path, literalOnly);
|
|
134
212
|
}
|
|
135
213
|
function validateRteDocument(fieldLabel, doc) {
|
|
136
214
|
for (const block of doc.content) {
|
|
@@ -148,7 +226,6 @@ function validateRteDocument(fieldLabel, doc) {
|
|
|
148
226
|
}
|
|
149
227
|
return null;
|
|
150
228
|
}
|
|
151
|
-
// ─── Check factories ──────────────────────────────────────────────────────────
|
|
152
229
|
export const textCheck = (field, max) => (record) => {
|
|
153
230
|
const value = record[field];
|
|
154
231
|
if (value == null)
|
|
@@ -240,10 +317,6 @@ export const itemCapCheck = (cap, label) => (record, ctx) => {
|
|
|
240
317
|
? `"${cap.arrayField}" has ${items.length} items but "${label ?? 'section'}" supports a maximum of ${limit}`
|
|
241
318
|
: null;
|
|
242
319
|
};
|
|
243
|
-
/**
|
|
244
|
-
* Runs an array of SectionChecks against the given args and context.
|
|
245
|
-
* Returns all non-null error strings.
|
|
246
|
-
*/
|
|
247
320
|
export function runChecks(checks, args, ctx) {
|
|
248
321
|
return checks.flatMap((check) => {
|
|
249
322
|
const err = check(args, ctx);
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
// Leaf import, not the `@brand-page/utils` barrel: the barrel cycles through the
|
|
2
|
-
// settings-component graph this module is reached from.
|
|
3
|
-
import { resolveTextColor } from '@brand-page/utils/text-style.util';
|
|
4
1
|
import { collectRteTextColors } from '@shared/color-strategies/rte-color';
|
|
5
2
|
import { showsTextBackgroundColor } from '@shared/content-settings/text-background-color.util';
|
|
6
3
|
import { pairedRteTextField } from '@shared/color-strategies/rte-field-pairs';
|
|
7
4
|
// From the leaf, not `rich-text-editor.util` — that module drags dompurify and the
|
|
8
5
|
// render helpers in at runtime, which this pure collector must not.
|
|
9
|
-
import { isRteHtmlString } from '@
|
|
6
|
+
import { isRteHtmlString } from '@shared/rte-shape.util';
|
|
10
7
|
import { resolveColorMatchState, resolveShapeMatchState, } from './color-match-state';
|
|
11
8
|
/**
|
|
12
9
|
* The fields that paint a layer. Deliberately NOT derived from `FIELD_SLOT_MAP`,
|
|
@@ -121,20 +118,12 @@ export const collectSectionColorMatches = (config, content, { context, textStyle
|
|
|
121
118
|
};
|
|
122
119
|
const buildTextStyleMatch = (style, fieldName, label) => {
|
|
123
120
|
const linkedStyleType = style.textStyleType;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
// The third level, which `resolveTextColor` does not model because the
|
|
131
|
-
// renderer gets it free from root CSS inheritance.
|
|
132
|
-
const value = cascaded || defaultTextColor;
|
|
133
|
-
const state = resolveColorMatchState({
|
|
134
|
-
value,
|
|
135
|
-
linkedStyleType,
|
|
136
|
-
inheritedColor,
|
|
137
|
-
});
|
|
121
|
+
// ADR-0020: a role carries no colour, so a field with no colour of its own renders
|
|
122
|
+
// the page base coat (defaultTextColor), never a role colour. Element-first, else
|
|
123
|
+
// the base coat — there is no longer a `global-style` rung.
|
|
124
|
+
const ownColour = style.color;
|
|
125
|
+
const value = ownColour || defaultTextColor;
|
|
126
|
+
const state = resolveColorMatchState({ value, linkedStyleType });
|
|
138
127
|
if (!state) {
|
|
139
128
|
return undefined;
|
|
140
129
|
}
|
|
@@ -143,13 +132,8 @@ export const collectSectionColorMatches = (config, content, { context, textStyle
|
|
|
143
132
|
label,
|
|
144
133
|
source: 'field',
|
|
145
134
|
group: 'element',
|
|
146
|
-
origin:
|
|
147
|
-
|
|
148
|
-
: inheritedColor
|
|
149
|
-
? 'global-style'
|
|
150
|
-
: 'site-default',
|
|
151
|
-
// Named on the site-default level too: "lands on the site default *through*
|
|
152
|
-
// Titles" is what tells the admin where to fix it.
|
|
135
|
+
origin: ownColour ? 'element' : 'site-default',
|
|
136
|
+
// Names the link so a site-default readout can say which role's text it is.
|
|
153
137
|
originStyleType: linkedStyleType,
|
|
154
138
|
entries: [toEntry(value, state, resolveColor)],
|
|
155
139
|
};
|
|
@@ -106,6 +106,21 @@ export declare const raisedLayerFor: (content?: unknown) => RaisedLayer | undefi
|
|
|
106
106
|
* has no muted role, and adding one would revise the derivation, not this table.
|
|
107
107
|
*/
|
|
108
108
|
export declare const FIELD_SLOT_MAP: Record<string, ColorSlot>;
|
|
109
|
+
/**
|
|
110
|
+
* Style fields a strategy writes although no settings config declares them, per section type,
|
|
111
|
+
* each with the config field it `follows` and the `textField` it colours: written only when the
|
|
112
|
+
* followed field is assignable, so it shares its visibility gate, and its slot still comes from
|
|
113
|
+
* `FIELD_SLOT_MAP`. A rich-text `textField` is recoloured with it, as a pair is.
|
|
114
|
+
*
|
|
115
|
+
* The payment and shop success message is edited through its `successMessage` text field, so
|
|
116
|
+
* the config walk never reaches its style. It follows the description it is seeded from
|
|
117
|
+
* (`text-role-reconnect.util.ts`). The contact form's is not listed. Not in
|
|
118
|
+
* `RTE_SECTION_FIELD_PAIRS`: released migration-21 reads that table.
|
|
119
|
+
*/
|
|
120
|
+
export declare const STYLE_FIELDS_OUTSIDE_CONFIG: Record<string, Record<string, {
|
|
121
|
+
follows: string;
|
|
122
|
+
textField: string;
|
|
123
|
+
}>>;
|
|
109
124
|
/**
|
|
110
125
|
* Resolve a field's slot: its default placement, promoted to the raised layer when this
|
|
111
126
|
* section puts it there AND that layer is actually being painted.
|
|
@@ -222,6 +222,37 @@ export const FIELD_SLOT_MAP = {
|
|
|
222
222
|
positionStyle: 'onSurface',
|
|
223
223
|
testimonialStyle: 'onSurface',
|
|
224
224
|
};
|
|
225
|
+
/**
|
|
226
|
+
* Style fields a strategy writes although no settings config declares them, per section type,
|
|
227
|
+
* each with the config field it `follows` and the `textField` it colours: written only when the
|
|
228
|
+
* followed field is assignable, so it shares its visibility gate, and its slot still comes from
|
|
229
|
+
* `FIELD_SLOT_MAP`. A rich-text `textField` is recoloured with it, as a pair is.
|
|
230
|
+
*
|
|
231
|
+
* The payment and shop success message is edited through its `successMessage` text field, so
|
|
232
|
+
* the config walk never reaches its style. It follows the description it is seeded from
|
|
233
|
+
* (`text-role-reconnect.util.ts`). The contact form's is not listed. Not in
|
|
234
|
+
* `RTE_SECTION_FIELD_PAIRS`: released migration-21 reads that table.
|
|
235
|
+
*/
|
|
236
|
+
export const STYLE_FIELDS_OUTSIDE_CONFIG = {
|
|
237
|
+
'request-payment': {
|
|
238
|
+
successMessageStyle: {
|
|
239
|
+
follows: 'descriptionStyle',
|
|
240
|
+
textField: 'successMessage',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
'support-me': {
|
|
244
|
+
successMessageStyle: {
|
|
245
|
+
follows: 'descriptionStyle',
|
|
246
|
+
textField: 'successMessage',
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
'shop-section': {
|
|
250
|
+
successMessageStyle: {
|
|
251
|
+
follows: 'descriptionStyle',
|
|
252
|
+
textField: 'successMessage',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
};
|
|
225
256
|
/**
|
|
226
257
|
* Resolve a field's slot: its default placement, promoted to the raised layer when this
|
|
227
258
|
* section puts it there AND that layer is actually being painted.
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { JSONContent } from '@tiptap/vue-3';
|
|
2
|
+
/**
|
|
3
|
+
* True when the doc has at least one run `setRteTextColor` will actually colour:
|
|
4
|
+
* `docHasTextRun` (rte-authoring.util.ts) counts any text node, unmarked whitespace included, so
|
|
5
|
+
* a doc whose only run IS unmarked whitespace passes that check, `setRteTextColor` walks it and
|
|
6
|
+
* returns a (structurally unchanged) doc, and a caller that then deletes the style colour on any
|
|
7
|
+
* truthy return loses the colour with nowhere left to hold it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const docHasColourableRun: (doc: JSONContent) => boolean;
|
|
2
10
|
/**
|
|
3
11
|
* Set `color` on every text node in an RTE document, returning a NEW document.
|
|
4
12
|
*
|
|
@@ -16,6 +16,9 @@ import { DEFAULT_LINK_COLOR } from '@src/constants/rich-text-editor.constants';
|
|
|
16
16
|
*
|
|
17
17
|
* **Overwrites deliberate literal colours** — a hand-picked `#FF0000` becomes the slot
|
|
18
18
|
* colour. Consistent with the macro's replace-not-merge semantics, and one undo reverts it.
|
|
19
|
+
*
|
|
20
|
+
* MIGRATION-22 SNAPSHOT DEPENDENCY: its colour bake uses `collectRteTextColors` and
|
|
21
|
+
* `fillUncolouredRteText`. Pin the v22 implementation before changing either after release.
|
|
19
22
|
*/
|
|
20
23
|
/**
|
|
21
24
|
* The `highlight` mark — the text BACKGROUND colour — is STRIPPED. A strategy owns the
|
|
@@ -33,6 +36,19 @@ const HIGHLIGHT_MARK = 'highlight';
|
|
|
33
36
|
* visible line, so it still gets the colour.
|
|
34
37
|
*/
|
|
35
38
|
const isUnmarkedWhitespace = (node) => !node.marks?.length && typeof node.text === 'string' && !node.text.trim();
|
|
39
|
+
/**
|
|
40
|
+
* True when the doc has at least one run `setRteTextColor` will actually colour:
|
|
41
|
+
* `docHasTextRun` (rte-authoring.util.ts) counts any text node, unmarked whitespace included, so
|
|
42
|
+
* a doc whose only run IS unmarked whitespace passes that check, `setRteTextColor` walks it and
|
|
43
|
+
* returns a (structurally unchanged) doc, and a caller that then deletes the style colour on any
|
|
44
|
+
* truthy return loses the colour with nowhere left to hold it.
|
|
45
|
+
*/
|
|
46
|
+
export const docHasColourableRun = (doc) => {
|
|
47
|
+
const walk = (node) => node.type === 'text'
|
|
48
|
+
? !isUnmarkedWhitespace(node)
|
|
49
|
+
: (node.content ?? []).some(walk);
|
|
50
|
+
return walk(doc);
|
|
51
|
+
};
|
|
36
52
|
/**
|
|
37
53
|
* A hyperlink run. Exempt from the strategy colour on both sides: the setter forces
|
|
38
54
|
* `DEFAULT_LINK_COLOR` instead (links are always the same blue, per `AutoLink`), and the
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* lookup, so keeping it out of `rich-text-editor.util.ts` (which pulls `dompurify`
|
|
6
6
|
* at runtime) lets both read one source of truth without the strategy path dragging
|
|
7
7
|
* in the editor toolchain.
|
|
8
|
+
*
|
|
9
|
+
* MIGRATION-22 SNAPSHOT DEPENDENCY: this list controls that migration's RTE conversion and colour
|
|
10
|
+
* walk. Preserve its v22 interpretation in the migration before changing this list after release.
|
|
8
11
|
*/
|
|
9
12
|
export interface RTEFieldPair {
|
|
10
13
|
textField: string;
|
|
@@ -21,3 +24,23 @@ export declare const RTE_SECTION_FIELD_PAIRS: Record<string, RTEFieldPair[]>;
|
|
|
21
24
|
* brandSite caller would need the `textItems[]` walk instead.
|
|
22
25
|
*/
|
|
23
26
|
export declare const pairedRteTextField: (sectionType: string, styleField: string) => string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Sections whose title/description are plain `string` (rendered by `TextWrapper`'s plain path from
|
|
29
|
+
* `style.color`, never an RTE mark) rather than RTE-managed docs. A section listed here is excluded
|
|
30
|
+
* from the RTE style-field set below, the migration's plain→doc conversion, the maker's add-time doc
|
|
31
|
+
* authoring, AND the editor gate (`RTE_ALLOWED_SECTION_TYPES`) — the single classification for
|
|
32
|
+
* "this field is plain, not RTE".
|
|
33
|
+
*
|
|
34
|
+
* **Currently empty.** shop/request-payment/support-me were RTE-editable on `develop` (title stored
|
|
35
|
+
* as `string`, editor mounted via the pairs map, the runtime mapper converting on the fly); BP-5969
|
|
36
|
+
* briefly classified them plain, which regressed that. They are RTE again — authored as docs at the
|
|
37
|
+
* factory and converted for existing sites by migration-22 — so this set is empty. Kept as the seam:
|
|
38
|
+
* to make a future section's title/description plain, add its type here and every consumer honours it.
|
|
39
|
+
*/
|
|
40
|
+
export declare const PLAIN_TEXT_PAIR_SECTIONS: Set<string>;
|
|
41
|
+
/**
|
|
42
|
+
* The genuinely-RTE style fields for a content type: the pairs map (minus the plain-by-design
|
|
43
|
+
* sections) plus the `text` section's own `textStyle`. Single source of truth shared by the
|
|
44
|
+
* migration (conversion + colour decouple) and the maker's content authoring.
|
|
45
|
+
*/
|
|
46
|
+
export declare const rteStyleFieldsFor: (type: string) => string[];
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* lookup, so keeping it out of `rich-text-editor.util.ts` (which pulls `dompurify`
|
|
6
6
|
* at runtime) lets both read one source of truth without the strategy path dragging
|
|
7
7
|
* in the editor toolchain.
|
|
8
|
+
*
|
|
9
|
+
* MIGRATION-22 SNAPSHOT DEPENDENCY: this list controls that migration's RTE conversion and colour
|
|
10
|
+
* walk. Preserve its v22 interpretation in the migration before changing this list after release.
|
|
8
11
|
*/
|
|
9
12
|
export const RTE_SECTION_FIELD_PAIRS = {
|
|
10
13
|
'banner-section': [
|
|
@@ -80,3 +83,28 @@ export const pairedRteTextField = (sectionType, styleField) => {
|
|
|
80
83
|
}
|
|
81
84
|
return RTE_SECTION_FIELD_PAIRS[sectionType]?.find((pair) => pair.styleField === styleField)?.textField;
|
|
82
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Sections whose title/description are plain `string` (rendered by `TextWrapper`'s plain path from
|
|
88
|
+
* `style.color`, never an RTE mark) rather than RTE-managed docs. A section listed here is excluded
|
|
89
|
+
* from the RTE style-field set below, the migration's plain→doc conversion, the maker's add-time doc
|
|
90
|
+
* authoring, AND the editor gate (`RTE_ALLOWED_SECTION_TYPES`) — the single classification for
|
|
91
|
+
* "this field is plain, not RTE".
|
|
92
|
+
*
|
|
93
|
+
* **Currently empty.** shop/request-payment/support-me were RTE-editable on `develop` (title stored
|
|
94
|
+
* as `string`, editor mounted via the pairs map, the runtime mapper converting on the fly); BP-5969
|
|
95
|
+
* briefly classified them plain, which regressed that. They are RTE again — authored as docs at the
|
|
96
|
+
* factory and converted for existing sites by migration-22 — so this set is empty. Kept as the seam:
|
|
97
|
+
* to make a future section's title/description plain, add its type here and every consumer honours it.
|
|
98
|
+
*/
|
|
99
|
+
export const PLAIN_TEXT_PAIR_SECTIONS = new Set([]);
|
|
100
|
+
/**
|
|
101
|
+
* The genuinely-RTE style fields for a content type: the pairs map (minus the plain-by-design
|
|
102
|
+
* sections) plus the `text` section's own `textStyle`. Single source of truth shared by the
|
|
103
|
+
* migration (conversion + colour decouple) and the maker's content authoring.
|
|
104
|
+
*/
|
|
105
|
+
export const rteStyleFieldsFor = (type) => {
|
|
106
|
+
if (PLAIN_TEXT_PAIR_SECTIONS.has(type))
|
|
107
|
+
return [];
|
|
108
|
+
const fields = (RTE_SECTION_FIELD_PAIRS[type] ?? []).map((pair) => pair.styleField);
|
|
109
|
+
return type === 'text' ? [...fields, 'textStyle'] : fields;
|
|
110
|
+
};
|