@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
package/lib/src/lib.js
CHANGED
|
@@ -33,7 +33,8 @@ export * as brandPageUtils from './brand-page/utils';
|
|
|
33
33
|
export { getOptimalLogoSize, calculateOptimizedLogoDimensions, applyLogoImageBase64UrlToBrandPageTemplateModel, recalculateLogoContentDimensions, recalculateHeaderLogoSizes, } from './brand-page/utils/logo.util';
|
|
34
34
|
export { sanitizeRTEHtml } from './brand-page-maker/utils';
|
|
35
35
|
// BP-5787: RTE JSON storage boundary helpers (render/normalise/sanitise/extract).
|
|
36
|
-
export { renderRteToHtml, toRteJson, isTiptapDocument,
|
|
36
|
+
export { renderRteToHtml, toRteJson, isTiptapDocument, getRteJsonPlainText, } from './shared/rte-render.util';
|
|
37
|
+
export { sanitizeRteJson } from './brand-page-maker/utils';
|
|
37
38
|
export { getPageSlugFromPageTitle } from './brand-page-maker/utils/slug.util';
|
|
38
39
|
// AI-pipeline preview (longclaw per-turn snapshots): web-renderer's
|
|
39
40
|
// /preview/ai-pipeline render page + manifest server route apply the agent's
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {} from '../../brand-page/models';
|
|
2
2
|
import { BaseMetadataBuilder, } from '../models';
|
|
3
3
|
import { FOOTER_CHECKS } from './section-rules/footer.rules';
|
|
4
|
-
import {
|
|
4
|
+
import { applyAiStyle, normalizeStyleValue } from './section-field-utils';
|
|
5
5
|
import { generateItemId, removeItemsByIds, repositionItemByAnchor, } from './item-id-utils';
|
|
6
6
|
const normaliseSocialUrl = (url) => {
|
|
7
7
|
for (const prefix of ['mailto:', 'tel:']) {
|
|
@@ -82,9 +82,8 @@ const applyGlobalFooterChanges = (footer, args, textStyleOptions) => {
|
|
|
82
82
|
footer.copyrightText = args.copyright_text;
|
|
83
83
|
// copyright_text_style is the same text-style object sections use (typography
|
|
84
84
|
// + colour). Normalise each value the way section styles are normalised
|
|
85
|
-
// (letterSpacing int→em, lineHeight snap, null→''), then
|
|
86
|
-
//
|
|
87
|
-
// and clears textStyleType once — see resolveGlobalPresetIntoStyle (BP-5420).
|
|
85
|
+
// (letterSpacing int→em, lineHeight snap, null→''), then apply it the way a
|
|
86
|
+
// section style is: the copyright keeps its role and stores what differs.
|
|
88
87
|
if (args.copyright_text_style) {
|
|
89
88
|
const updates = {};
|
|
90
89
|
for (const [key, value] of Object.entries(args.copyright_text_style)) {
|
|
@@ -93,7 +92,7 @@ const applyGlobalFooterChanges = (footer, args, textStyleOptions) => {
|
|
|
93
92
|
updates[key] = normalized;
|
|
94
93
|
}
|
|
95
94
|
if (Object.keys(updates).length > 0)
|
|
96
|
-
footer.copyrightStyle =
|
|
95
|
+
footer.copyrightStyle = applyAiStyle(footer.copyrightStyle, updates, textStyleOptions);
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
const applyViewportFooterChanges = (footer, overrides) => {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { JSONContent } from '@tiptap/vue-3';
|
|
2
|
+
import type { BrandPageModel } from '../../brand-page/models';
|
|
3
|
+
import type { CanonicalTextStyleType, TextStyleOptions } from '../../brand-page/models/styles.model';
|
|
4
|
+
import type { TextStyleOptionStyle } from '../parsers/ai-toolcall-parser';
|
|
5
|
+
/**
|
|
6
|
+
* Propagation of an AI site-wide text-role change into existing content (R12).
|
|
7
|
+
*
|
|
8
|
+
* `tool_update_global_styles` changes a role's own definition — but a run whose
|
|
9
|
+
* typography was baked as a literal (an inline RTE mark, or a detached `*Style`
|
|
10
|
+
* override) does not follow that change: the literal wins over the role's CSS
|
|
11
|
+
* class at render (ADR-0019). This module walks every page's contents, the
|
|
12
|
+
* header and the footer and relinks every literal of a CHANGED role+property to
|
|
13
|
+
* the role's `var(--role-…)` reference, so the change reaches content the pipeline
|
|
14
|
+
* never re-sends. Unlike the maker's own "apply changes to all" (which only
|
|
15
|
+
* relinks a literal that already EQUALS the role — genuine overrides are left
|
|
16
|
+
* alone, ADR-0021), an AI site-wide ask relinks EVERY literal, accent words
|
|
17
|
+
* included; the one exception is a run or plain field the user named in
|
|
18
|
+
* `textStyles.keepRuns` (R16).
|
|
19
|
+
*
|
|
20
|
+
* All 7 role typography properties relink. Family, size, line height and letter
|
|
21
|
+
* spacing relink only when the sent value differs from the stored role: the
|
|
22
|
+
* pipeline re-sends them unchanged, and relinking then would erase accents.
|
|
23
|
+
* Weight, style and decoration relink on ANY sent value: the pipeline sends them
|
|
24
|
+
* only when the user asked, and migration-22 pinned literals (`fontWeight:
|
|
25
|
+
* 'normal'` under a bold heading role) that an equal value must still reach.
|
|
26
|
+
* They also drop the legacy `<strong>`/`<em>`/`<u>`/`<s>` marks that would win
|
|
27
|
+
* over the ref; a link keeps its underline.
|
|
28
|
+
*
|
|
29
|
+
* Both migrated Tiptap JSON and legacy HTML strings are handled because older sites can still
|
|
30
|
+
* carry the latter; leaving either shape unchanged would make role edits surface-dependent.
|
|
31
|
+
*
|
|
32
|
+
* A field's role comes from its own `textStyleType` — never guessed from the
|
|
33
|
+
* field name. Every field the metadata-builder touches carries a canonical role
|
|
34
|
+
* post-migration (the legacy→canonical gate is a hard one, `legacy-migrations.md`),
|
|
35
|
+
* so no detached/legacy fallback is needed here.
|
|
36
|
+
*/
|
|
37
|
+
/** The 7 role typography properties (ROLE_VAR_ATTRS) a site-wide change relinks. */
|
|
38
|
+
export declare const ROLE_PROPAGATION_ATTRS: readonly ["fontFamily", "fontSize", "lineHeight", "letterSpacing", "fontWeight", "fontStyle", "textDecoration"];
|
|
39
|
+
export type RolePropagationAttr = (typeof ROLE_PROPAGATION_ATTRS)[number];
|
|
40
|
+
export declare const ROLE_VAR_REF: Readonly<Record<RolePropagationAttr, string>>;
|
|
41
|
+
export type ChangedRoleProps = Partial<Record<CanonicalTextStyleType, Partial<Record<RolePropagationAttr, string>>>>;
|
|
42
|
+
/**
|
|
43
|
+
* Extract the changed canonical roles + properties from a RESOLVED (canonical-only)
|
|
44
|
+
* `textStyleOptions` merge — the caller (`GlobalStylesBuilder`) has already redirected any
|
|
45
|
+
* retired key onto its successor role(s) (R7) before calling this.
|
|
46
|
+
*/
|
|
47
|
+
export declare const collectChangedRoleProps: (textStyleOptions: Partial<Record<CanonicalTextStyleType, {
|
|
48
|
+
style?: TextStyleOptionStyle;
|
|
49
|
+
}>> | undefined, existingOptions?: TextStyleOptions) => ChangedRoleProps;
|
|
50
|
+
/**
|
|
51
|
+
* Force every literal of a changed attr on every run to its role ref, accent words included, and
|
|
52
|
+
* drop the legacy marks that compete with it. A ref already in place is left alone ("refs stay");
|
|
53
|
+
* a run named in `keepRuns` is untouched.
|
|
54
|
+
*/
|
|
55
|
+
export declare const relinkRoleChangedMarks: (doc: JSONContent, changedAttrs: readonly RolePropagationAttr[], keepRuns: readonly string[] | undefined) => JSONContent;
|
|
56
|
+
/** Rewrites a legacy RTE HTML string's marks to the given role refs. Injectable for tests. */
|
|
57
|
+
export type ApplyRoleRefsToRTE = (html: string, refs: Partial<Record<RolePropagationAttr, string>>, keepRuns?: readonly string[]) => string;
|
|
58
|
+
export declare const propagateRolePropsToContents: (model: BrandPageModel, changed: ChangedRoleProps, keepRuns?: readonly string[], applyRefs?: ApplyRoleRefsToRTE) => void;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { CANONICAL_TEXT_STYLE_TYPES } from '../../brand-page/models/styles.model';
|
|
2
|
+
import { NEUTRAL_TYPOGRAPHY_VALUE, roleVarRef, textDecorationFlags, } from '@shared/text-role-typography.util';
|
|
3
|
+
import { hasRTEContent, getPlainTextFromRTE, withoutTypographyMarks, } from '../../brand-page-maker/utils';
|
|
4
|
+
import { useExternalRichTextEditor } from '../../brand-page-maker/composables/rich-text-editor/useRichTextEditor';
|
|
5
|
+
import { applyStyleToRTEText } from '../helpers/rte.helpers';
|
|
6
|
+
import { isTiptapDocument } from '../parsers/section-tool-arguments';
|
|
7
|
+
/**
|
|
8
|
+
* Propagation of an AI site-wide text-role change into existing content (R12).
|
|
9
|
+
*
|
|
10
|
+
* `tool_update_global_styles` changes a role's own definition — but a run whose
|
|
11
|
+
* typography was baked as a literal (an inline RTE mark, or a detached `*Style`
|
|
12
|
+
* override) does not follow that change: the literal wins over the role's CSS
|
|
13
|
+
* class at render (ADR-0019). This module walks every page's contents, the
|
|
14
|
+
* header and the footer and relinks every literal of a CHANGED role+property to
|
|
15
|
+
* the role's `var(--role-…)` reference, so the change reaches content the pipeline
|
|
16
|
+
* never re-sends. Unlike the maker's own "apply changes to all" (which only
|
|
17
|
+
* relinks a literal that already EQUALS the role — genuine overrides are left
|
|
18
|
+
* alone, ADR-0021), an AI site-wide ask relinks EVERY literal, accent words
|
|
19
|
+
* included; the one exception is a run or plain field the user named in
|
|
20
|
+
* `textStyles.keepRuns` (R16).
|
|
21
|
+
*
|
|
22
|
+
* All 7 role typography properties relink. Family, size, line height and letter
|
|
23
|
+
* spacing relink only when the sent value differs from the stored role: the
|
|
24
|
+
* pipeline re-sends them unchanged, and relinking then would erase accents.
|
|
25
|
+
* Weight, style and decoration relink on ANY sent value: the pipeline sends them
|
|
26
|
+
* only when the user asked, and migration-22 pinned literals (`fontWeight:
|
|
27
|
+
* 'normal'` under a bold heading role) that an equal value must still reach.
|
|
28
|
+
* They also drop the legacy `<strong>`/`<em>`/`<u>`/`<s>` marks that would win
|
|
29
|
+
* over the ref; a link keeps its underline.
|
|
30
|
+
*
|
|
31
|
+
* Both migrated Tiptap JSON and legacy HTML strings are handled because older sites can still
|
|
32
|
+
* carry the latter; leaving either shape unchanged would make role edits surface-dependent.
|
|
33
|
+
*
|
|
34
|
+
* A field's role comes from its own `textStyleType` — never guessed from the
|
|
35
|
+
* field name. Every field the metadata-builder touches carries a canonical role
|
|
36
|
+
* post-migration (the legacy→canonical gate is a hard one, `legacy-migrations.md`),
|
|
37
|
+
* so no detached/legacy fallback is needed here.
|
|
38
|
+
*/
|
|
39
|
+
/** The 7 role typography properties (ROLE_VAR_ATTRS) a site-wide change relinks. */
|
|
40
|
+
export const ROLE_PROPAGATION_ATTRS = [
|
|
41
|
+
'fontFamily',
|
|
42
|
+
'fontSize',
|
|
43
|
+
'lineHeight',
|
|
44
|
+
'letterSpacing',
|
|
45
|
+
'fontWeight',
|
|
46
|
+
'fontStyle',
|
|
47
|
+
'textDecoration',
|
|
48
|
+
];
|
|
49
|
+
export const ROLE_VAR_REF = Object.fromEntries(ROLE_PROPAGATION_ATTRS.map((attr) => [attr, roleVarRef(attr)]));
|
|
50
|
+
// Relink on any sent value, even one equal to the stored role (see the header).
|
|
51
|
+
const EMPHASIS_ATTRS = new Set([
|
|
52
|
+
'fontWeight',
|
|
53
|
+
'fontStyle',
|
|
54
|
+
'textDecoration',
|
|
55
|
+
]);
|
|
56
|
+
const isPlainObject = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
57
|
+
const isCanonicalRole = (v) => typeof v === 'string' &&
|
|
58
|
+
CANONICAL_TEXT_STYLE_TYPES.includes(v);
|
|
59
|
+
const isKeptText = (text, keepRuns) => {
|
|
60
|
+
if (!keepRuns?.length)
|
|
61
|
+
return false;
|
|
62
|
+
const trimmed = text.trim().toLowerCase();
|
|
63
|
+
return keepRuns.some((run) => run.trim().toLowerCase() === trimmed);
|
|
64
|
+
};
|
|
65
|
+
const normalizedRoleValue = (value, attr) => {
|
|
66
|
+
if (typeof value === 'string' && value.trim())
|
|
67
|
+
return value.trim();
|
|
68
|
+
return Object.prototype.hasOwnProperty.call(NEUTRAL_TYPOGRAPHY_VALUE, attr)
|
|
69
|
+
? NEUTRAL_TYPOGRAPHY_VALUE[attr]
|
|
70
|
+
: undefined;
|
|
71
|
+
};
|
|
72
|
+
// One value can be written several ways ('3.0em' / '3em', a quoted family). Comparing the
|
|
73
|
+
// written form would read an unchanged value as a change and relink every word that overrides it.
|
|
74
|
+
const comparableValue = (attr, value) => {
|
|
75
|
+
if (attr === 'fontFamily')
|
|
76
|
+
return value.replace(/['"]/g, '').trim();
|
|
77
|
+
const numeric = /^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(value);
|
|
78
|
+
return numeric
|
|
79
|
+
? `${Number(numeric[1])}${numeric[2].toLowerCase()}`
|
|
80
|
+
: value.toLowerCase();
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Extract the changed canonical roles + properties from a RESOLVED (canonical-only)
|
|
84
|
+
* `textStyleOptions` merge — the caller (`GlobalStylesBuilder`) has already redirected any
|
|
85
|
+
* retired key onto its successor role(s) (R7) before calling this.
|
|
86
|
+
*/
|
|
87
|
+
export const collectChangedRoleProps = (textStyleOptions, existingOptions = {}) => {
|
|
88
|
+
const changed = {};
|
|
89
|
+
if (!textStyleOptions)
|
|
90
|
+
return changed;
|
|
91
|
+
for (const role of CANONICAL_TEXT_STYLE_TYPES) {
|
|
92
|
+
const style = textStyleOptions[role]?.style;
|
|
93
|
+
if (!style)
|
|
94
|
+
continue;
|
|
95
|
+
const props = {};
|
|
96
|
+
const existing = existingOptions[role]?.style;
|
|
97
|
+
for (const attr of ROLE_PROPAGATION_ATTRS) {
|
|
98
|
+
const value = style[attr];
|
|
99
|
+
const replacement = typeof value === 'string' && value.trim()
|
|
100
|
+
? value.trim()
|
|
101
|
+
: (value === null || value === '') &&
|
|
102
|
+
Object.prototype.hasOwnProperty.call(NEUTRAL_TYPOGRAPHY_VALUE, attr)
|
|
103
|
+
? NEUTRAL_TYPOGRAPHY_VALUE[attr]
|
|
104
|
+
: undefined;
|
|
105
|
+
if (replacement === undefined)
|
|
106
|
+
continue;
|
|
107
|
+
if (EMPHASIS_ATTRS.has(attr)) {
|
|
108
|
+
props[attr] = replacement;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const stored = normalizedRoleValue(existing?.[attr], attr);
|
|
112
|
+
if (stored === undefined ||
|
|
113
|
+
comparableValue(attr, replacement) !== comparableValue(attr, stored)) {
|
|
114
|
+
props[attr] = replacement;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (Object.keys(props).length)
|
|
118
|
+
changed[role] = props;
|
|
119
|
+
}
|
|
120
|
+
return changed;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Force every literal of a changed attr on every run to its role ref, accent words included, and
|
|
124
|
+
* drop the legacy marks that compete with it. A ref already in place is left alone ("refs stay");
|
|
125
|
+
* a run named in `keepRuns` is untouched.
|
|
126
|
+
*/
|
|
127
|
+
export const relinkRoleChangedMarks = (doc, changedAttrs, keepRuns) => {
|
|
128
|
+
const clone = JSON.parse(JSON.stringify(doc));
|
|
129
|
+
const decorationChanged = changedAttrs.includes('textDecoration');
|
|
130
|
+
const visit = (node) => {
|
|
131
|
+
if (node.type === 'text' && node.text && !isKeptText(node.text, keepRuns)) {
|
|
132
|
+
const mark = node.marks?.find((m) => m.type === 'textStyle');
|
|
133
|
+
const isLink = !!node.marks?.some((m) => m.type === 'link');
|
|
134
|
+
// Migration-22 folded a link's `<u>` into this literal; relinking it must keep the link's look.
|
|
135
|
+
const keepsLinkUnderline = isLink &&
|
|
136
|
+
decorationChanged &&
|
|
137
|
+
textDecorationFlags(mark?.attrs?.textDecoration).has('underline');
|
|
138
|
+
changedAttrs.forEach((attr) => {
|
|
139
|
+
const value = mark?.attrs?.[attr];
|
|
140
|
+
if (typeof value === 'string' &&
|
|
141
|
+
value &&
|
|
142
|
+
value !== ROLE_VAR_REF[attr]) {
|
|
143
|
+
mark.attrs[attr] = ROLE_VAR_REF[attr];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
if (decorationChanged)
|
|
147
|
+
delete mark?.attrs?.textDecorationReset;
|
|
148
|
+
if (node.marks) {
|
|
149
|
+
node.marks = withoutTypographyMarks(node.marks, changedAttrs, isLink);
|
|
150
|
+
if (keepsLinkUnderline &&
|
|
151
|
+
!node.marks.some((m) => m.type === 'underline')) {
|
|
152
|
+
node.marks.push({ type: 'underline' });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
node.content?.forEach(visit);
|
|
157
|
+
};
|
|
158
|
+
visit(clone);
|
|
159
|
+
return clone;
|
|
160
|
+
};
|
|
161
|
+
const dropStyleOverrides = (style, changedAttrs) => {
|
|
162
|
+
changedAttrs.forEach((attr) => {
|
|
163
|
+
if (attr in style)
|
|
164
|
+
delete style[attr];
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
const refsFor = (changedAttrs) => Object.fromEntries(changedAttrs.map((attr) => [attr, ROLE_VAR_REF[attr]]));
|
|
168
|
+
const walkRecord = (record, changed, keepRuns, applyRefs) => {
|
|
169
|
+
for (const [key, value] of Object.entries(record)) {
|
|
170
|
+
let handled = false;
|
|
171
|
+
if (key.endsWith('Style') && isPlainObject(value)) {
|
|
172
|
+
const role = value.textStyleType;
|
|
173
|
+
if (isCanonicalRole(role) && changed[role]) {
|
|
174
|
+
handled = true;
|
|
175
|
+
const changedAttrs = Object.keys(changed[role]);
|
|
176
|
+
if (key === 'defaultButtonStyle' &&
|
|
177
|
+
isPlainObject(record.selectedButtonStyle)) {
|
|
178
|
+
dropStyleOverrides(record.selectedButtonStyle, changedAttrs);
|
|
179
|
+
}
|
|
180
|
+
const fieldBase = key.slice(0, -'Style'.length);
|
|
181
|
+
const textKey = fieldBase in record
|
|
182
|
+
? fieldBase
|
|
183
|
+
: `${fieldBase}Text` in record
|
|
184
|
+
? `${fieldBase}Text`
|
|
185
|
+
: undefined;
|
|
186
|
+
const textValue = textKey ? record[textKey] : undefined;
|
|
187
|
+
if (isTiptapDocument(textValue)) {
|
|
188
|
+
record[textKey] = relinkRoleChangedMarks(textValue, changedAttrs, keepRuns);
|
|
189
|
+
dropStyleOverrides(value, changedAttrs);
|
|
190
|
+
}
|
|
191
|
+
else if (typeof textValue === 'string' && hasRTEContent(textValue)) {
|
|
192
|
+
if (!isKeptText(getPlainTextFromRTE(textValue), keepRuns)) {
|
|
193
|
+
record[textKey] = applyRefs(textValue, refsFor(changedAttrs), keepRuns);
|
|
194
|
+
dropStyleOverrides(value, changedAttrs);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
const plainText = typeof textValue === 'string' ? textValue : undefined;
|
|
199
|
+
if (plainText === undefined || !isKeptText(plainText, keepRuns)) {
|
|
200
|
+
dropStyleOverrides(value, changedAttrs);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (handled)
|
|
206
|
+
continue;
|
|
207
|
+
if (Array.isArray(value)) {
|
|
208
|
+
value.forEach((item) => isPlainObject(item) && walkRecord(item, changed, keepRuns, applyRefs));
|
|
209
|
+
}
|
|
210
|
+
else if (isPlainObject(value)) {
|
|
211
|
+
walkRecord(value, changed, keepRuns, applyRefs);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
export const propagateRolePropsToContents = (model, changed, keepRuns, applyRefs) => {
|
|
216
|
+
if (!Object.keys(changed).length)
|
|
217
|
+
return;
|
|
218
|
+
let editor;
|
|
219
|
+
const apply = applyRefs ??
|
|
220
|
+
((text, refs) => {
|
|
221
|
+
editor = editor ?? useExternalRichTextEditor().externalEditor;
|
|
222
|
+
return applyStyleToRTEText(editor, text, refs, keepRuns);
|
|
223
|
+
});
|
|
224
|
+
try {
|
|
225
|
+
for (const page of model.pages) {
|
|
226
|
+
for (const content of page.contents) {
|
|
227
|
+
walkRecord(content, changed, keepRuns, apply);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (model.pageHeaderDesktop) {
|
|
231
|
+
walkRecord(model.pageHeaderDesktop, changed, keepRuns, apply);
|
|
232
|
+
}
|
|
233
|
+
if (model.pageHeaderMobile) {
|
|
234
|
+
walkRecord(model.pageHeaderMobile, changed, keepRuns, apply);
|
|
235
|
+
}
|
|
236
|
+
if (model.pageFooterDesktop) {
|
|
237
|
+
walkRecord(model.pageFooterDesktop, changed, keepRuns, apply);
|
|
238
|
+
}
|
|
239
|
+
if (model.pageFooterMobile) {
|
|
240
|
+
walkRecord(model.pageFooterMobile, changed, keepRuns, apply);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
finally {
|
|
244
|
+
editor?.destroy();
|
|
245
|
+
}
|
|
246
|
+
};
|
|
@@ -9,6 +9,7 @@ export declare class GlobalStylesBuilder extends BaseMetadataBuilder<UpdateGloba
|
|
|
9
9
|
}>;
|
|
10
10
|
buildAsync(model: BrandPageModel): Promise<BuilderResult>;
|
|
11
11
|
private applyTextStyles;
|
|
12
|
+
private applyTextStylesWarnings;
|
|
12
13
|
private applyButtonStyles;
|
|
13
14
|
private applyBackgroundStyles;
|
|
14
15
|
private mergeStyleOptionStyle;
|
|
@@ -1,8 +1,68 @@
|
|
|
1
1
|
import {} from '../../brand-page/models';
|
|
2
2
|
import { BaseMetadataBuilder, } from '../models';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { CANONICAL_TEXT_STYLE_TYPES, LEGACY_TEXT_STYLE_TYPES, } from '../../brand-page/models/styles.model';
|
|
4
|
+
import { computeLegacyTargets, HEADING_TIERS, PARAGRAPH_TIERS, } from '../../brand-page/utils/text-role-reconnect.util';
|
|
5
|
+
import { TEXT_STYLE_CASCADE_PROPS, } from '../../brand-page/utils/text-style.util';
|
|
6
|
+
import { NEUTRAL_TYPOGRAPHY_VALUE } from '@shared/text-role-typography.util';
|
|
7
|
+
import { GLOBAL_STYLE_CHECKS, normalizeGlobalTextStyleOption, } from './section-rules/global-styles.rules';
|
|
8
|
+
import { collectChangedRoleProps, propagateRolePropsToContents, } from './global-role-propagation';
|
|
5
9
|
import { buttonStylePresetCss } from '../../shared/style-settings/button-style-preset';
|
|
10
|
+
const retiredKeyFamilyTiers = (key) => {
|
|
11
|
+
switch (key) {
|
|
12
|
+
case 'headings':
|
|
13
|
+
return HEADING_TIERS.filter((tier) => tier !== 'heading1');
|
|
14
|
+
case 'paragraphs':
|
|
15
|
+
return PARAGRAPH_TIERS;
|
|
16
|
+
case 'titles':
|
|
17
|
+
case 'buttons':
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const retiredKeySingleTarget = (key, existingOptions) => computeLegacyTargets(existingOptions)[key];
|
|
22
|
+
const resolveCanonicalTextStyleOptions = (textStyleOptions, existingOptions) => {
|
|
23
|
+
const resolved = {};
|
|
24
|
+
if (!textStyleOptions)
|
|
25
|
+
return resolved;
|
|
26
|
+
const mergeInto = (role, optionArgs) => {
|
|
27
|
+
resolved[role] = {
|
|
28
|
+
style: {
|
|
29
|
+
...resolved[role]?.style,
|
|
30
|
+
...(optionArgs.style
|
|
31
|
+
? normalizeGlobalTextStyleOption(optionArgs.style)
|
|
32
|
+
: undefined),
|
|
33
|
+
},
|
|
34
|
+
isModified: optionArgs.isModified ?? resolved[role]?.isModified,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
for (const role of CANONICAL_TEXT_STYLE_TYPES) {
|
|
38
|
+
const optionArgs = textStyleOptions[role];
|
|
39
|
+
if (optionArgs)
|
|
40
|
+
mergeInto(role, optionArgs);
|
|
41
|
+
}
|
|
42
|
+
for (const key of LEGACY_TEXT_STYLE_TYPES) {
|
|
43
|
+
const optionArgs = textStyleOptions[key];
|
|
44
|
+
if (!optionArgs)
|
|
45
|
+
continue;
|
|
46
|
+
const singleTarget = retiredKeySingleTarget(key, existingOptions);
|
|
47
|
+
const familyTiers = retiredKeyFamilyTiers(key);
|
|
48
|
+
const style = (optionArgs.style ?? {});
|
|
49
|
+
const { fontFamily, ...rest } = style;
|
|
50
|
+
const hasRest = Object.keys(rest).length > 0;
|
|
51
|
+
if (hasRest || !familyTiers.length || optionArgs.isModified !== undefined) {
|
|
52
|
+
mergeInto(singleTarget, {
|
|
53
|
+
style: (familyTiers.length ? rest : style),
|
|
54
|
+
isModified: optionArgs.isModified,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (fontFamily !== undefined && familyTiers.length) {
|
|
58
|
+
familyTiers.forEach((role) => mergeInto(role, {
|
|
59
|
+
style: { fontFamily },
|
|
60
|
+
isModified: optionArgs.isModified,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return resolved;
|
|
65
|
+
};
|
|
6
66
|
export class GlobalStylesBuilder extends BaseMetadataBuilder {
|
|
7
67
|
constructor(request, logger) {
|
|
8
68
|
super(request, logger);
|
|
@@ -17,32 +77,36 @@ export class GlobalStylesBuilder extends BaseMetadataBuilder {
|
|
|
17
77
|
return { errors };
|
|
18
78
|
}
|
|
19
79
|
catch (error) {
|
|
80
|
+
// Fail closed: a throwing check must block the call, not pass it as clean with every
|
|
81
|
+
// check skipped.
|
|
20
82
|
this.log({
|
|
21
|
-
message: 'Global styles validation failed unexpectedly —
|
|
83
|
+
message: 'Global styles validation failed unexpectedly — rejecting the call',
|
|
22
84
|
error,
|
|
23
85
|
});
|
|
24
|
-
return { errors: [] };
|
|
86
|
+
return { errors: ['Global styles validation failed unexpectedly'] };
|
|
25
87
|
}
|
|
26
88
|
}
|
|
27
89
|
async buildAsync(model) {
|
|
28
90
|
this.log('Build called');
|
|
91
|
+
const validation = await this.validateAsync();
|
|
92
|
+
if (validation.errors.length) {
|
|
93
|
+
return { request: this.request, model, errors: validation.errors };
|
|
94
|
+
}
|
|
29
95
|
const args = this.request.payload ?? {};
|
|
96
|
+
let builderWarnings;
|
|
30
97
|
if (args.backgroundStyles) {
|
|
31
98
|
this.applyBackgroundStyles(model, args.backgroundStyles);
|
|
32
99
|
}
|
|
33
100
|
if (args.textStyles) {
|
|
34
|
-
this.applyTextStyles(model, args.textStyles);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// the old family. Propagate so the change is actually visible (BP-5780).
|
|
38
|
-
const changedFamilies = collectChangedFontFamilies(args.textStyles);
|
|
39
|
-
if (Object.keys(changedFamilies).length) {
|
|
101
|
+
const { changedRoleProps, warnings } = this.applyTextStyles(model, args.textStyles);
|
|
102
|
+
builderWarnings = warnings.length ? warnings : undefined;
|
|
103
|
+
if (Object.keys(changedRoleProps).length) {
|
|
40
104
|
try {
|
|
41
|
-
|
|
105
|
+
propagateRolePropsToContents(model, changedRoleProps, args.textStyles.keepRuns);
|
|
42
106
|
}
|
|
43
107
|
catch (error) {
|
|
44
108
|
this.log({
|
|
45
|
-
message: 'Global
|
|
109
|
+
message: 'Global role propagation to existing contents failed — presets still updated',
|
|
46
110
|
error,
|
|
47
111
|
});
|
|
48
112
|
}
|
|
@@ -51,49 +115,50 @@ export class GlobalStylesBuilder extends BaseMetadataBuilder {
|
|
|
51
115
|
if (args.buttonStyles) {
|
|
52
116
|
this.applyButtonStyles(model, args.buttonStyles);
|
|
53
117
|
}
|
|
54
|
-
return { request: this.request, model };
|
|
118
|
+
return { request: this.request, model, warnings: builderWarnings };
|
|
55
119
|
}
|
|
56
120
|
applyTextStyles(model, textStyles) {
|
|
57
121
|
const ts = model.styles.textStyles;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (optionArgs.style) {
|
|
74
|
-
this.mergeStyleOptionStyle(existing.style, optionArgs.style);
|
|
75
|
-
// Mark as modified when style properties change
|
|
76
|
-
existing.isModified = true;
|
|
77
|
-
}
|
|
78
|
-
if (optionArgs.isModified !== undefined) {
|
|
79
|
-
existing.isModified = optionArgs.isModified;
|
|
80
|
-
}
|
|
122
|
+
const resolved = resolveCanonicalTextStyleOptions(textStyles.textStyleOptions, ts.textStyleOptions);
|
|
123
|
+
const changedRoleProps = collectChangedRoleProps(resolved, ts.textStyleOptions);
|
|
124
|
+
for (const role of CANONICAL_TEXT_STYLE_TYPES) {
|
|
125
|
+
const optionArgs = resolved[role];
|
|
126
|
+
if (!optionArgs)
|
|
127
|
+
continue;
|
|
128
|
+
const existing = ts.textStyleOptions[role];
|
|
129
|
+
if (!existing)
|
|
130
|
+
continue;
|
|
131
|
+
if (optionArgs.style) {
|
|
132
|
+
this.mergeStyleOptionStyle(existing.style, optionArgs.style);
|
|
133
|
+
existing.isModified = true;
|
|
134
|
+
}
|
|
135
|
+
if (optionArgs.isModified !== undefined) {
|
|
136
|
+
existing.isModified = optionArgs.isModified;
|
|
81
137
|
}
|
|
82
138
|
}
|
|
139
|
+
return {
|
|
140
|
+
changedRoleProps,
|
|
141
|
+
warnings: this.applyTextStylesWarnings(textStyles),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
applyTextStylesWarnings(textStyles) {
|
|
145
|
+
const droppedRoles = Object.entries(textStyles.textStyleOptions ?? {})
|
|
146
|
+
.filter(([, option]) => option?.style?.color)
|
|
147
|
+
.map(([role]) => role);
|
|
148
|
+
return droppedRoles.length
|
|
149
|
+
? [
|
|
150
|
+
`Ignored role color for ${droppedRoles.join(', ')}; apply colour to the affected sections instead.`,
|
|
151
|
+
]
|
|
152
|
+
: [];
|
|
83
153
|
}
|
|
84
154
|
applyButtonStyles(model, buttonStyles) {
|
|
85
155
|
const bs = model.styles.buttonStyles;
|
|
86
|
-
// Deep-merge style (color, borderColor, backgroundColor)
|
|
87
156
|
if (buttonStyles.style) {
|
|
88
157
|
bs.style = { ...bs.style, ...buttonStyles.style };
|
|
89
158
|
}
|
|
90
|
-
// Deep-merge iconStyle (fill)
|
|
91
159
|
if (buttonStyles.iconStyle) {
|
|
92
160
|
bs.iconStyle = { ...bs.iconStyle, ...buttonStyles.iconStyle };
|
|
93
161
|
}
|
|
94
|
-
// Merge selectedButtonStyleId and apply that preset's shape and shadow the way the
|
|
95
|
-
// editor's picker does: the site renders buttons from `style`, so the id alone is
|
|
96
|
-
// invisible (BP-6082). The preset owns the shape keys; colours from `style` stay.
|
|
97
162
|
if (buttonStyles.selectedButtonStyleId !== undefined) {
|
|
98
163
|
bs.selectedButtonStyleId = buttonStyles.selectedButtonStyleId;
|
|
99
164
|
const presetCss = buttonStylePresetCss(buttonStyles.selectedButtonStyleId, bs.style);
|
|
@@ -135,21 +200,27 @@ export class GlobalStylesBuilder extends BaseMetadataBuilder {
|
|
|
135
200
|
bs.backgroundShapes = [];
|
|
136
201
|
}
|
|
137
202
|
else if (bs.backgroundShapes?.length) {
|
|
138
|
-
//
|
|
139
|
-
// Update ALL shapes so every positional instance switches to the new shape type.
|
|
203
|
+
// Retype only the shapes a site already has: a site with none never gains one.
|
|
140
204
|
bs.backgroundShapes = bs.backgroundShapes.map((shape) => ({
|
|
141
205
|
...shape,
|
|
142
206
|
name: backgroundStyles.backgroundShapeUrl,
|
|
143
207
|
}));
|
|
144
208
|
}
|
|
145
|
-
// If backgroundShapes is empty/absent: intentional no-op
|
|
146
209
|
}
|
|
147
210
|
}
|
|
148
211
|
mergeStyleOptionStyle(existing, incoming) {
|
|
149
212
|
for (const [key, value] of Object.entries(incoming)) {
|
|
150
|
-
if (
|
|
213
|
+
if (!TEXT_STYLE_CASCADE_PROPS.includes(key)) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
151
217
|
existing[key] = value;
|
|
152
218
|
}
|
|
219
|
+
else if ((value === null || value === '') &&
|
|
220
|
+
Object.prototype.hasOwnProperty.call(NEUTRAL_TYPOGRAPHY_VALUE, key)) {
|
|
221
|
+
existing[key] =
|
|
222
|
+
NEUTRAL_TYPOGRAPHY_VALUE[key];
|
|
223
|
+
}
|
|
153
224
|
}
|
|
154
225
|
}
|
|
155
226
|
}
|
|
@@ -2,7 +2,8 @@ import {} from '../../brand-page/models';
|
|
|
2
2
|
import { BaseMetadataBuilder, } from '../models';
|
|
3
3
|
import { getPageSlugFromPageTitle } from '../../brand-page-maker/utils/slug.util';
|
|
4
4
|
import { HEADER_CHECKS } from './section-rules/header.rules';
|
|
5
|
-
import {
|
|
5
|
+
import { applyAiStyle } from './section-field-utils';
|
|
6
|
+
import { omitTypography, pickTypography, } from '../../brand-page/utils/text-style.util';
|
|
6
7
|
const applyViewportHeaderChanges = (header, overrides, textStyleOptions) => {
|
|
7
8
|
if (overrides.display_style !== undefined) {
|
|
8
9
|
header.displayStyle = overrides.display_style;
|
|
@@ -32,15 +33,23 @@ const applyViewportHeaderChanges = (header, overrides, textStyleOptions) => {
|
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
if (overrides.link_text_font !== undefined && header.navigation) {
|
|
35
|
-
header.navigation.defaultButtonStyle =
|
|
36
|
+
header.navigation.defaultButtonStyle = applyAiStyle(header.navigation.defaultButtonStyle, { fontFamily: overrides.link_text_font }, textStyleOptions, { startingRole: 'paragraph1' });
|
|
36
37
|
}
|
|
37
38
|
// The hamburger overlay renders the same nav links from its own styles, so the
|
|
38
39
|
// menu font has to reach them too or the overlay keeps the old family (BP-6079).
|
|
39
40
|
if (overrides.link_text_font !== undefined &&
|
|
40
41
|
header.navigation?.hamburgerMenuStyle) {
|
|
41
42
|
const menu = header.navigation.hamburgerMenuStyle;
|
|
42
|
-
menu.defaultButtonStyle =
|
|
43
|
-
|
|
43
|
+
menu.defaultButtonStyle = applyAiStyle(menu.defaultButtonStyle, { fontFamily: overrides.link_text_font }, textStyleOptions, { startingRole: 'button' });
|
|
44
|
+
// The selected style mirrors the default's RESULTING sparse typography rather than being
|
|
45
|
+
// independently reconnected: it carries no role of its own (no maker path
|
|
46
|
+
// sets one, no migration adds one), so reconnecting it on its own path could resolve a
|
|
47
|
+
// different override shape than its sibling for the same ask. `global-role-propagation.ts`
|
|
48
|
+
// mirrors a later site-wide change onto it the same way (the default/selected sibling drop).
|
|
49
|
+
menu.selectedButtonStyle = {
|
|
50
|
+
...omitTypography(menu.selectedButtonStyle ?? {}),
|
|
51
|
+
...pickTypography(menu.defaultButtonStyle),
|
|
52
|
+
};
|
|
44
53
|
}
|
|
45
54
|
if (overrides.link_bg_color !== undefined && header.navigation) {
|
|
46
55
|
header.navigation.defaultButtonStyle = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isTiptapDocument, } from '../../parsers/section-tool-arguments';
|
|
2
|
-
import { applyScalarFields, applyStyleFields,
|
|
2
|
+
import { applyScalarFields, applyStyleFields, applyAiStyle, } from '../section-field-utils';
|
|
3
3
|
import { applyColorThemeToReplacements, resolveShapeColorReplacementsAsync, } from '../shape-color-utils';
|
|
4
4
|
import { BaseSectionBuilder } from './base-section-builder';
|
|
5
5
|
import { validateAboutSection } from '../section-rules/about-section.rules';
|
|
@@ -24,7 +24,7 @@ export class AboutSectionBuilder extends BaseSectionBuilder {
|
|
|
24
24
|
if (aboutArgs.title !== undefined) {
|
|
25
25
|
if (isTiptapDocument(aboutArgs.title)) {
|
|
26
26
|
resolved.content.title = aboutArgs.title;
|
|
27
|
-
resolved.content.titleStyle =
|
|
27
|
+
resolved.content.titleStyle = applyAiStyle(resolved.content.titleStyle, {}, textStyleOptions);
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
resolved.content.title = aboutArgs.title;
|
|
@@ -33,7 +33,7 @@ export class AboutSectionBuilder extends BaseSectionBuilder {
|
|
|
33
33
|
if (aboutArgs.paragraph !== undefined) {
|
|
34
34
|
if (isTiptapDocument(aboutArgs.paragraph)) {
|
|
35
35
|
resolved.content.paragraph = aboutArgs.paragraph;
|
|
36
|
-
resolved.content.paragraphStyle =
|
|
36
|
+
resolved.content.paragraphStyle = applyAiStyle(resolved.content.paragraphStyle, {}, textStyleOptions);
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
39
|
resolved.content.paragraph = aboutArgs.paragraph;
|