@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
|
@@ -15,12 +15,20 @@ import {
|
|
|
15
15
|
import type { StyleTextFontFamilyOption } from '../../../style-settings/models';
|
|
16
16
|
import type { ButtonGroupOption } from '@brand-page-maker/models/button-group.model';
|
|
17
17
|
import { useUiStyleSettingsStore } from '../../../style-settings/store';
|
|
18
|
+
import { useUiContentSettingsStore } from '../../store';
|
|
18
19
|
import type {
|
|
20
|
+
CanonicalTextStyleType,
|
|
19
21
|
LogoTheme,
|
|
20
22
|
TextStyleDeclaration,
|
|
21
23
|
TextStyleType,
|
|
22
24
|
} from '@brand-page';
|
|
23
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
resolveTextStyle,
|
|
27
|
+
TEXT_STYLE_CASCADE_PROPS,
|
|
28
|
+
normalizeTextStyleAgainstRole,
|
|
29
|
+
omitTypography,
|
|
30
|
+
} from '@brand-page/utils/text-style.util';
|
|
31
|
+
import { composeTextDecoration } from '@shared/text-role-typography.util';
|
|
24
32
|
import {
|
|
25
33
|
FONT_FAMILY_CONFIGS,
|
|
26
34
|
MIN_TEXT_SIZE_PX,
|
|
@@ -29,12 +37,16 @@ import {
|
|
|
29
37
|
MAX_LETTER_SPACING_PERCENT,
|
|
30
38
|
MIN_LINE_HEIGHT,
|
|
31
39
|
MAX_LINE_HEIGHT,
|
|
32
|
-
|
|
40
|
+
CANONICAL_TEXT_STYLE_TYPES,
|
|
33
41
|
TEXT_STYLE_TYPES_DISPLAY_NAME_MAP,
|
|
34
42
|
} from '@brand-page';
|
|
35
43
|
|
|
36
44
|
const TEXT_SIZE_CHANGE_DEBOUNCE_WAIT_IN_MS = 5;
|
|
37
45
|
|
|
46
|
+
// BP-5969: cap the collapsed-card live preview so large roles (e.g. H1) fit the
|
|
47
|
+
// header row. The subtitle still reports the real edited size uncapped.
|
|
48
|
+
const TEXT_STYLE_PREVIEW_MAX_SIZE_PX = 28;
|
|
49
|
+
|
|
38
50
|
export default defineComponent({
|
|
39
51
|
props: {
|
|
40
52
|
id: {
|
|
@@ -107,6 +119,23 @@ export default defineComponent({
|
|
|
107
119
|
required: false,
|
|
108
120
|
default: false,
|
|
109
121
|
},
|
|
122
|
+
// BP-5969: opt in to rendering the collapsed-card header in the role's own
|
|
123
|
+
// live typography (name at its font/size/weight + a `Family • Sizepx`
|
|
124
|
+
// subtitle). Only the global Style tab enables this; block-level fields
|
|
125
|
+
// (nav/footer/content) keep the plain bold label.
|
|
126
|
+
showTypographyPreview: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
required: false,
|
|
129
|
+
default: false,
|
|
130
|
+
},
|
|
131
|
+
// BP-5969 (ADR-0020): a role defines typography only — colour is contrast-derived per
|
|
132
|
+
// surface, not a role property. The role editor (global Style tab) hides the colour picker;
|
|
133
|
+
// element-level fields keep it (an element may still carry an explicit colour override).
|
|
134
|
+
showColor: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
required: false,
|
|
137
|
+
default: true,
|
|
138
|
+
},
|
|
110
139
|
// Container-aware default colour from the parent field wrapper: text on a filled
|
|
111
140
|
// block must contrast that fill, so the swatch shows the same colour the renderer
|
|
112
141
|
// paints. Both sides derive it from one helper (`container-text-color.util.ts`).
|
|
@@ -118,6 +147,7 @@ export default defineComponent({
|
|
|
118
147
|
},
|
|
119
148
|
setup() {
|
|
120
149
|
const styleSettingsStore = useUiStyleSettingsStore();
|
|
150
|
+
const contentSettingsStore = useUiContentSettingsStore();
|
|
121
151
|
|
|
122
152
|
const textStyleTypeDropdownRef = `text-style-dropdown-${uuidV4()}`;
|
|
123
153
|
|
|
@@ -129,6 +159,7 @@ export default defineComponent({
|
|
|
129
159
|
() => styleSettingsStore.textStyles.textStyleOptions,
|
|
130
160
|
),
|
|
131
161
|
styleSettingsStore,
|
|
162
|
+
contentSettingsStore,
|
|
132
163
|
textStyleTypeDropdownRef,
|
|
133
164
|
[textStyleTypeDropdownRef]: ref(null),
|
|
134
165
|
};
|
|
@@ -137,26 +168,24 @@ export default defineComponent({
|
|
|
137
168
|
data: () => {
|
|
138
169
|
return {
|
|
139
170
|
isCollapsed: true,
|
|
171
|
+
// BP-5969: the "style modified" popup next to the role dropdown (apply/reset overrides).
|
|
172
|
+
isStyleModifiedPopupOpen: false,
|
|
140
173
|
MIN_TEXT_SIZE_PX,
|
|
141
174
|
MAX_TEXT_SIZE_PX,
|
|
142
175
|
MIN_LETTER_SPACING_PERCENT,
|
|
143
176
|
MAX_LETTER_SPACING_PERCENT,
|
|
144
177
|
MIN_LINE_HEIGHT,
|
|
145
178
|
MAX_LINE_HEIGHT,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
TEXT_STYLE_TYPES_DISPLAY_NAME_MAP()[key].slice(1),
|
|
157
|
-
isSelected: false,
|
|
158
|
-
})),
|
|
159
|
-
] as ButtonGroupOption[],
|
|
179
|
+
// BP-5969 (ADR-0019): every text block is always linked to exactly one canonical
|
|
180
|
+
// role — there is no "none"/detached option. Legacy roles stay resolvable for
|
|
181
|
+
// un-migrated content but are never pickable (migration-22 reconnects them).
|
|
182
|
+
textStyleTypeOptions: CANONICAL_TEXT_STYLE_TYPES.map((key) => ({
|
|
183
|
+
value: key,
|
|
184
|
+
label:
|
|
185
|
+
TEXT_STYLE_TYPES_DISPLAY_NAME_MAP()[key][0].toUpperCase() +
|
|
186
|
+
TEXT_STYLE_TYPES_DISPLAY_NAME_MAP()[key].slice(1),
|
|
187
|
+
isSelected: false,
|
|
188
|
+
})) as ButtonGroupOption[],
|
|
160
189
|
debounceOnTextSizeChange: undefined as
|
|
161
190
|
| ((textSize: string) => void)
|
|
162
191
|
| undefined,
|
|
@@ -210,24 +239,28 @@ export default defineComponent({
|
|
|
210
239
|
return theValue;
|
|
211
240
|
}
|
|
212
241
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
color: resolveTextColor(
|
|
242
|
+
// Typography must follow the RENDERER's per-property cascade (ADR-0019): each prop
|
|
243
|
+
// resolves element-first over the role, so the panel shows the same size/family/weight
|
|
244
|
+
// the canvas paints — a per-block override stays visible in the sliders instead of
|
|
245
|
+
// snapping back to the role. `resolveTextStyle` is the shared resolver (colour included,
|
|
246
|
+
// element-first via `resolveTextColor` with the container-aware middle rung); mirroring it
|
|
247
|
+
// here is what keeps the panel and canvas from drifting, and it protects the handlers below
|
|
248
|
+
// that spread `selectedTextStyle`. The role style is spread first to keep its non-cascade
|
|
249
|
+
// props (e.g. backgroundColor); alignment stays role-first and applyAutoScale is re-layered.
|
|
250
|
+
return Object.assign(
|
|
251
|
+
{},
|
|
252
|
+
selectedTextStyleOption.style,
|
|
253
|
+
resolveTextStyle(
|
|
226
254
|
theValue,
|
|
227
255
|
selectedTextStyleOption.style,
|
|
228
256
|
this.containerDefaultColor,
|
|
229
257
|
),
|
|
230
|
-
|
|
258
|
+
{
|
|
259
|
+
applyAutoScale: theValue.applyAutoScale,
|
|
260
|
+
textAlign:
|
|
261
|
+
selectedTextStyleOption.style.textAlign || theValue.textAlign,
|
|
262
|
+
},
|
|
263
|
+
);
|
|
231
264
|
},
|
|
232
265
|
textCSSStyleOptions(): ButtonGroupOption[] {
|
|
233
266
|
if (!this.selectedTextStyle.textStyleType) {
|
|
@@ -317,40 +350,103 @@ export default defineComponent({
|
|
|
317
350
|
this.debounceOnLineHeightChange(val);
|
|
318
351
|
},
|
|
319
352
|
},
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
);
|
|
353
|
+
// The plain role name: the dropdown title (its asterisk is the dropdown's own) and the
|
|
354
|
+
// "Apply changes to all '<role>'" popup label.
|
|
355
|
+
selectedRoleLabel(): string {
|
|
356
|
+
const selected = this.textStyleTypeOptions.find((x) => x.isSelected);
|
|
324
357
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
358
|
+
return (selected as ButtonGroupOption | undefined)?.label ?? '';
|
|
359
|
+
},
|
|
360
|
+
selectedRoleType(): CanonicalTextStyleType | undefined {
|
|
361
|
+
return this.textStyleTypeOptions.find((x) => x.isSelected)?.value as
|
|
362
|
+
| CanonicalTextStyleType
|
|
363
|
+
| undefined;
|
|
364
|
+
},
|
|
365
|
+
// A block has a typography override when it carries any cascade prop of its own. The
|
|
366
|
+
// store normalizes role-equal props away on write, so a present prop is a real override.
|
|
367
|
+
hasTypographyOverride(): boolean {
|
|
368
|
+
if (!this.showTextStyleTypeOptions) return false;
|
|
328
369
|
|
|
329
|
-
|
|
370
|
+
const value = this.value as unknown as TextStyleDeclaration;
|
|
371
|
+
|
|
372
|
+
if (!value?.textStyleType) return false;
|
|
373
|
+
|
|
374
|
+
return TEXT_STYLE_CASCADE_PROPS.some(
|
|
375
|
+
(prop) => (value as Record<string, unknown>)[prop] != null,
|
|
376
|
+
);
|
|
377
|
+
},
|
|
378
|
+
// BP-5969: the collapsed card header renders the role name in its OWN
|
|
379
|
+
// typography. We derive the inline style from the same resolved style the
|
|
380
|
+
// controls edit (`selectedTextStyle`), so the preview repaints live as the
|
|
381
|
+
// sliders/pickers move. Size is capped so a large role (e.g. H1 at 60px)
|
|
382
|
+
// still fits the header row rather than overflowing the card.
|
|
383
|
+
//
|
|
384
|
+
// Family/weight/style/decoration are applied so the preview shows the role's
|
|
385
|
+
// font AND its B/I/U/S styling. The family is quoted (multi-word names like
|
|
386
|
+
// "PT Serif" must be a single CSS token) and given a generic fallback.
|
|
387
|
+
textStylePreviewStyle(): Record<string, string> {
|
|
388
|
+
const style = this.selectedTextStyle as TextStyleDeclaration;
|
|
389
|
+
const sizePx = Math.min(
|
|
390
|
+
Number(textSizeValueConvertor.convert(style)) ||
|
|
391
|
+
TEXT_STYLE_PREVIEW_MAX_SIZE_PX,
|
|
392
|
+
TEXT_STYLE_PREVIEW_MAX_SIZE_PX,
|
|
393
|
+
);
|
|
394
|
+
// Strip any quotes the value already carries, then re-quote once.
|
|
395
|
+
const family = (style.fontFamily || '').replace(/^['"]|['"]$/g, '');
|
|
396
|
+
|
|
397
|
+
return {
|
|
398
|
+
fontFamily: family ? `"${family}", sans-serif` : 'inherit',
|
|
399
|
+
fontSize: `${sizePx}px`,
|
|
400
|
+
fontWeight: style.fontWeight || 'normal',
|
|
401
|
+
fontStyle: style.fontStyle || 'normal',
|
|
402
|
+
letterSpacing: style.letterSpacing || 'normal',
|
|
403
|
+
// lineHeight is intentionally omitted: the preview is a single truncated
|
|
404
|
+
// line, so the role's line-height only adds vertical padding that
|
|
405
|
+
// misaligns the header row. Let it inherit the panel's default instead.
|
|
406
|
+
textDecoration: style.textDecoration || 'none',
|
|
407
|
+
};
|
|
408
|
+
},
|
|
409
|
+
// BP-5969: the `Family • Sizepx` line shown under the role name when
|
|
410
|
+
// collapsed. Size is the true edited size (uncapped, unlike the preview).
|
|
411
|
+
textStylePreviewSubtitle(): string {
|
|
412
|
+
const style = this.selectedTextStyle as TextStyleDeclaration;
|
|
413
|
+
const family = style.fontFamily || '';
|
|
414
|
+
const sizePx = textSizeValueConvertor.convert(style);
|
|
415
|
+
const parts = [family, sizePx ? `${sizePx}px` : ''].filter(Boolean);
|
|
416
|
+
|
|
417
|
+
return parts.join(' • ');
|
|
330
418
|
},
|
|
331
419
|
},
|
|
332
420
|
methods: {
|
|
333
421
|
emitChange(style: BrandPageCssStyle, textStyleType?: TextStyleType) {
|
|
422
|
+
// BP-5969 (ADR-0020): linking a role is a TYPOGRAPHY action and no longer touches
|
|
423
|
+
// colour — a role carries none, and colour is a separate axis, so switching roles
|
|
424
|
+
// keeps the element's own colour + background (a full clean slate is the explicit
|
|
425
|
+
// "reset to global" action). A whole-box edit likewise keeps the current link (it no
|
|
426
|
+
// longer detaches).
|
|
334
427
|
if (!this.showTextStyleTypeOptions) {
|
|
335
428
|
textStyleType = undefined;
|
|
429
|
+
} else if (textStyleType === undefined) {
|
|
430
|
+
textStyleType = (this.value as unknown as TextStyleDeclaration)
|
|
431
|
+
?.textStyleType;
|
|
336
432
|
}
|
|
337
433
|
|
|
338
434
|
const { backgroundColor, ...filteredStyle } = style;
|
|
339
435
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
436
|
+
// Normalise here, not only downstream: content-settings-store does this for its own
|
|
437
|
+
// fields, but nav, header-button and footer text write straight to their own stores,
|
|
438
|
+
// which keep what they're given without checking it against the role. Without this, one
|
|
439
|
+
// B/I/U/S click bakes fontStyle/textDecoration in as a permanent override
|
|
440
|
+
// (`text-css-style-options.convertor` always writes all four props), and a later role
|
|
441
|
+
// edit can never repaint it back.
|
|
442
|
+
const value: TextStyleDeclaration = normalizeTextStyleAgainstRole(
|
|
443
|
+
{
|
|
444
|
+
...(backgroundColor === undefined ? filteredStyle : style),
|
|
445
|
+
textAlign: style.textAlign!, //text align should never be empty (setting a textalign here causes text alignment changes when changing global text styles)
|
|
446
|
+
textStyleType,
|
|
447
|
+
},
|
|
448
|
+
this.textStyleOptions,
|
|
449
|
+
);
|
|
354
450
|
|
|
355
451
|
this.$emit('update:modelValue', { id: this.id, name: this.name, value });
|
|
356
452
|
|
|
@@ -363,9 +459,21 @@ export default defineComponent({
|
|
|
363
459
|
toggleCollapsed() {
|
|
364
460
|
this.isCollapsed = !this.isCollapsed;
|
|
365
461
|
},
|
|
462
|
+
// BP-5969: a whole-box edit layers a SPARSE override on the element's own style (not
|
|
463
|
+
// the resolved role), so the role's colour/typography is never baked in as an
|
|
464
|
+
// override. Store normalization then drops any prop equal to the role. For an unlinked
|
|
465
|
+
// field (e.g. the role-definition editor, `showTextStyleTypeOptions` false) there is no
|
|
466
|
+
// role class, so the full resolved style is the base.
|
|
467
|
+
overrideBaseStyle(): TextStyleDeclaration {
|
|
468
|
+
const value = this.value as unknown as TextStyleDeclaration;
|
|
469
|
+
|
|
470
|
+
return this.showTextStyleTypeOptions && value?.textStyleType
|
|
471
|
+
? { ...value }
|
|
472
|
+
: (this.selectedTextStyle as TextStyleDeclaration);
|
|
473
|
+
},
|
|
366
474
|
onSelectFont(font: StyleTextFontFamilyOption) {
|
|
367
475
|
const newValue = {
|
|
368
|
-
...this.
|
|
476
|
+
...this.overrideBaseStyle(),
|
|
369
477
|
fontFamily: FONT_FAMILY_CONFIGS[font.key].name,
|
|
370
478
|
};
|
|
371
479
|
|
|
@@ -379,7 +487,7 @@ export default defineComponent({
|
|
|
379
487
|
}));
|
|
380
488
|
|
|
381
489
|
const newValue: TextStyleDeclaration = {
|
|
382
|
-
...this.
|
|
490
|
+
...this.overrideBaseStyle(),
|
|
383
491
|
...textCSSStyleOptionsConvertor.convertBack({ options }),
|
|
384
492
|
};
|
|
385
493
|
|
|
@@ -401,14 +509,17 @@ export default defineComponent({
|
|
|
401
509
|
option.isSelected = option.value === e.value;
|
|
402
510
|
});
|
|
403
511
|
|
|
512
|
+
// Picking a role gives that role's look, as the RTE picker does: overrides kept from the
|
|
513
|
+
// previous role would otherwise win the per-property cascade. Colour is not typography,
|
|
514
|
+
// so it stays (global-text-style.md).
|
|
404
515
|
this.emitChange(
|
|
405
|
-
this.value as unknown as TextStyleDeclaration,
|
|
516
|
+
omitTypography(this.value as unknown as TextStyleDeclaration),
|
|
406
517
|
e.value as TextStyleType,
|
|
407
518
|
);
|
|
408
519
|
},
|
|
409
520
|
onSelectAlignment(e) {
|
|
410
521
|
const newValue: TextStyleDeclaration = {
|
|
411
|
-
...this.
|
|
522
|
+
...this.overrideBaseStyle(),
|
|
412
523
|
...textAlignmentOptionsConvertor.convertBack({
|
|
413
524
|
options: [{ ...e, isSelected: true }],
|
|
414
525
|
}),
|
|
@@ -421,18 +532,14 @@ export default defineComponent({
|
|
|
421
532
|
|
|
422
533
|
// A colour edit on a linked element keeps the link and layers a sticky colour
|
|
423
534
|
// override rather than detaching. The renderer resolves colour element-first
|
|
424
|
-
// (resolveTextColor), so it wins over the
|
|
425
|
-
//
|
|
426
|
-
// auto-scale, colour) with no baked-in typography; re-selecting the style from
|
|
427
|
-
// the dropdown resets it back to the style's colour.
|
|
535
|
+
// (resolveTextColor), so it wins over the role's colour while typography stays
|
|
536
|
+
// driven by the role class. Preserve the element's existing (typography) overrides.
|
|
428
537
|
if (this.showTextStyleTypeOptions && current.textStyleType) {
|
|
429
538
|
this.$emit('update:modelValue', {
|
|
430
539
|
id: this.id,
|
|
431
540
|
name: this.name,
|
|
432
541
|
value: {
|
|
433
|
-
|
|
434
|
-
textAlign: current.textAlign,
|
|
435
|
-
applyAutoScale: current.applyAutoScale,
|
|
542
|
+
...current,
|
|
436
543
|
...colorConvertor.convertBack(color.value),
|
|
437
544
|
} as TextStyleDeclaration,
|
|
438
545
|
});
|
|
@@ -447,7 +554,7 @@ export default defineComponent({
|
|
|
447
554
|
},
|
|
448
555
|
onSelectBackgroundColor(color) {
|
|
449
556
|
const newValue: TextStyleDeclaration = {
|
|
450
|
-
...this.
|
|
557
|
+
...this.overrideBaseStyle(),
|
|
451
558
|
...backgroundColorConvertor.convertBack(color.value),
|
|
452
559
|
};
|
|
453
560
|
|
|
@@ -455,7 +562,7 @@ export default defineComponent({
|
|
|
455
562
|
},
|
|
456
563
|
onTextSizeChange(textSize: string) {
|
|
457
564
|
const newValue = {
|
|
458
|
-
...this.
|
|
565
|
+
...this.overrideBaseStyle(),
|
|
459
566
|
...textSizeValueConvertor.convertBack(textSize),
|
|
460
567
|
};
|
|
461
568
|
|
|
@@ -463,7 +570,7 @@ export default defineComponent({
|
|
|
463
570
|
},
|
|
464
571
|
onLetterSpacingChange(spacing: string) {
|
|
465
572
|
const newValue = {
|
|
466
|
-
...this.
|
|
573
|
+
...this.overrideBaseStyle(),
|
|
467
574
|
...letterSpacingValueConvertor.convertBack(spacing),
|
|
468
575
|
};
|
|
469
576
|
|
|
@@ -471,12 +578,85 @@ export default defineComponent({
|
|
|
471
578
|
},
|
|
472
579
|
onLineHeightChange(lineHeight: string) {
|
|
473
580
|
const newValue = {
|
|
474
|
-
...this.
|
|
581
|
+
...this.overrideBaseStyle(),
|
|
475
582
|
...lineHeightValueConvertor.convertBack(lineHeight),
|
|
476
583
|
};
|
|
477
584
|
|
|
478
585
|
this.emitChange(newValue);
|
|
479
586
|
},
|
|
587
|
+
// Clear the typography overrides so the block follows its role. Colour and background stay:
|
|
588
|
+
// a role carries no colour to fall back to (ADR 0020).
|
|
589
|
+
resetToGlobal() {
|
|
590
|
+
this.$emit('update:modelValue', {
|
|
591
|
+
id: this.id,
|
|
592
|
+
name: this.name,
|
|
593
|
+
value: omitTypography(
|
|
594
|
+
this.value as unknown as TextStyleDeclaration,
|
|
595
|
+
) as TextStyleDeclaration,
|
|
596
|
+
});
|
|
597
|
+
},
|
|
598
|
+
// BP-5969 (A5): promote this block's typography overrides into the role definition, so
|
|
599
|
+
// every block linked to the role adopts them. Then reset this block to fully-linked and
|
|
600
|
+
// re-normalize its siblings (their now-role-equal overrides drop away).
|
|
601
|
+
saveToGlobal() {
|
|
602
|
+
const value = this.value as unknown as TextStyleDeclaration;
|
|
603
|
+
const type = value.textStyleType;
|
|
604
|
+
|
|
605
|
+
if (!type) return;
|
|
606
|
+
|
|
607
|
+
const role = this.textStyleOptions[type]?.style;
|
|
608
|
+
|
|
609
|
+
if (!role) return;
|
|
610
|
+
|
|
611
|
+
const overrides: Record<string, unknown> = {};
|
|
612
|
+
|
|
613
|
+
TEXT_STYLE_CASCADE_PROPS.forEach((prop) => {
|
|
614
|
+
const propValue = (value as Record<string, unknown>)[prop];
|
|
615
|
+
|
|
616
|
+
if (propValue != null) {
|
|
617
|
+
overrides[prop] =
|
|
618
|
+
prop === 'textDecoration'
|
|
619
|
+
? composeTextDecoration(role.textDecoration, propValue as string)
|
|
620
|
+
: propValue;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
const previousRole = { ...role } as unknown as Record<string, unknown>;
|
|
625
|
+
|
|
626
|
+
this.styleSettingsStore.setTextStyleOption({
|
|
627
|
+
type,
|
|
628
|
+
style: { ...role, ...overrides } as TextStyleDeclaration,
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
this.resetToGlobal();
|
|
632
|
+
this.contentSettingsStore.renormalizeTextStylesForRole(
|
|
633
|
+
type,
|
|
634
|
+
previousRole,
|
|
635
|
+
);
|
|
636
|
+
},
|
|
637
|
+
// The role dropdown pairs with a "style modified" toggle that opens this popup
|
|
638
|
+
// (apply to all / reset to default), mirroring the RTE toolbar affordance.
|
|
639
|
+
toggleStyleModifiedPopup() {
|
|
640
|
+
this.isStyleModifiedPopupOpen = !this.isStyleModifiedPopupOpen;
|
|
641
|
+
},
|
|
642
|
+
onClickOutsideStyleModified(event: Event) {
|
|
643
|
+
// v-click-outside also fires on window blur (its iframe detection), where the
|
|
644
|
+
// target is `window` and has no `closest` — treat a non-element target as outside.
|
|
645
|
+
const { target } = event;
|
|
646
|
+
const outside =
|
|
647
|
+
!(target instanceof Element) ||
|
|
648
|
+
!target.closest('.text-style-field__modified-popup');
|
|
649
|
+
|
|
650
|
+
if (outside) this.isStyleModifiedPopupOpen = false;
|
|
651
|
+
},
|
|
652
|
+
onApplyStyleToRole() {
|
|
653
|
+
this.saveToGlobal();
|
|
654
|
+
this.isStyleModifiedPopupOpen = false;
|
|
655
|
+
},
|
|
656
|
+
onResetStyleToRole() {
|
|
657
|
+
this.resetToGlobal();
|
|
658
|
+
this.isStyleModifiedPopupOpen = false;
|
|
659
|
+
},
|
|
480
660
|
generateFontFamilySelectorKey() {
|
|
481
661
|
return `fontFamilySelector-${this.id}-${Date.now()}`;
|
|
482
662
|
},
|
|
@@ -486,9 +666,7 @@ export default defineComponent({
|
|
|
486
666
|
const value = this.value as unknown as TextStyleDeclaration;
|
|
487
667
|
|
|
488
668
|
this.textStyleTypeOptions.forEach((option) => {
|
|
489
|
-
//
|
|
490
|
-
// option's value is `undefined`, so that form would SELECT it whenever no
|
|
491
|
-
// style is set, but the convention (see emitChange) is all-flags-false.
|
|
669
|
+
// A value with no role selects nothing (see emitChange): every option stays unselected.
|
|
492
670
|
option.isSelected =
|
|
493
671
|
Boolean(value?.textStyleType) && option.value === value.textStyleType;
|
|
494
672
|
});
|
|
@@ -12,10 +12,26 @@
|
|
|
12
12
|
>
|
|
13
13
|
<a
|
|
14
14
|
v-if="!isTextContent"
|
|
15
|
-
|
|
15
|
+
data-test-text-style-field-toggle
|
|
16
|
+
class="tw-flex tw-gap-2 tw-cursor-pointer tw-justify-between tw-items-center"
|
|
16
17
|
@click="toggleCollapsed()"
|
|
17
18
|
>
|
|
19
|
+
<!-- BP-5969: the global Style tab renders the role name in its OWN
|
|
20
|
+
typography with a `Family • Sizepx` subtitle so each card previews the
|
|
21
|
+
role live. Other consumers keep the plain bold label. -->
|
|
22
|
+
<div v-if="showTypographyPreview" class="tw-min-w-0">
|
|
23
|
+
<div
|
|
24
|
+
class="tw-text-secondary-800 tw-truncate"
|
|
25
|
+
:style="textStylePreviewStyle"
|
|
26
|
+
>
|
|
27
|
+
{{ label }}
|
|
28
|
+
</div>
|
|
29
|
+
<div class="tw-text-grayscale-600 tw-text-xs tw-mt-1 tw-truncate">
|
|
30
|
+
{{ textStylePreviewSubtitle }}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
18
33
|
<div
|
|
34
|
+
v-else
|
|
19
35
|
class="tw-font-bold tw-text-secondary-800"
|
|
20
36
|
:class="{
|
|
21
37
|
'tw-text-sm': titleTextSize === 'sm',
|
|
@@ -40,24 +56,74 @@
|
|
|
40
56
|
>
|
|
41
57
|
{{ textStyleFieldTr(`textStyle`) }}
|
|
42
58
|
</p>
|
|
43
|
-
|
|
59
|
+
<!-- The role selector pairs with the "style modified" toggle on one row: the
|
|
60
|
+
toggle only appears when this block overrides its role typography, and opens
|
|
61
|
+
the apply/reset popup — mirroring the RTE toolbar's affordance. -->
|
|
62
|
+
<div
|
|
44
63
|
v-if="showTextStyleTypeOptions"
|
|
45
|
-
|
|
46
|
-
class="tw-mb-4 tw-z-10"
|
|
47
|
-
:title="textStyleTypeDropdownTitle"
|
|
48
|
-
element-classes="!tw-rounded-lg !tw-h-auto !tw-py-3 tw-text-secondary-500"
|
|
49
|
-
menu-element-classes="tw-left-0"
|
|
50
|
-
icon-size="xs"
|
|
51
|
-
:force-down-position="true"
|
|
64
|
+
class="tw-flex tw-gap-2 tw-items-stretch tw-mb-4"
|
|
52
65
|
>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
<TextStyleRoleDropdown
|
|
67
|
+
:ref="textStyleTypeDropdownRef"
|
|
68
|
+
class="tw-flex-1 tw-min-w-0 tw-z-10"
|
|
69
|
+
data-test-text-style-type-dropdown
|
|
70
|
+
element-classes="!tw-rounded-lg !tw-h-auto !tw-py-3 tw-text-secondary-500"
|
|
71
|
+
menu-element-classes="tw-left-0"
|
|
72
|
+
:selected="selectedRoleType"
|
|
73
|
+
:has-override="hasTypographyOverride"
|
|
74
|
+
@select="onSelectTextStyleType({ value: $event })"
|
|
75
|
+
/>
|
|
76
|
+
<!-- BP-5969: shown only when this block overrides its role's typography.
|
|
77
|
+
`v-click-outside` closes the popup; the directive is imported locally (it
|
|
78
|
+
is not registered globally). // extract if a third consumer appears -->
|
|
79
|
+
<div
|
|
80
|
+
v-if="hasTypographyOverride"
|
|
81
|
+
v-click-outside="onClickOutsideStyleModified"
|
|
82
|
+
class="text-style-field__modified-anchor"
|
|
57
83
|
>
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
84
|
+
<Button
|
|
85
|
+
class="text-style-field__modified-toggle"
|
|
86
|
+
:class="{
|
|
87
|
+
'text-style-field__modified-toggle--active':
|
|
88
|
+
isStyleModifiedPopupOpen,
|
|
89
|
+
}"
|
|
90
|
+
data-test-style-modified-toggle
|
|
91
|
+
icon="roller-brush"
|
|
92
|
+
icon-size="sm"
|
|
93
|
+
justify="center"
|
|
94
|
+
@click="toggleStyleModifiedPopup()"
|
|
95
|
+
/>
|
|
96
|
+
<div
|
|
97
|
+
v-if="isStyleModifiedPopupOpen"
|
|
98
|
+
class="text-style-field__modified-popup"
|
|
99
|
+
data-test-style-modified-popup
|
|
100
|
+
>
|
|
101
|
+
<p class="tw-text-xs tw-text-grayscale-600 tw-mb-1">
|
|
102
|
+
{{ textStyleFieldTr(`styleModifiedHeader`) }}
|
|
103
|
+
</p>
|
|
104
|
+
<a
|
|
105
|
+
class="tw-flex tw-items-center tw-gap-2 tw-cursor-pointer tw-text-sm tw-text-grayscale-700 tw-py-1"
|
|
106
|
+
data-test-save-to-global
|
|
107
|
+
@click="onApplyStyleToRole()"
|
|
108
|
+
>
|
|
109
|
+
<Icon name="refresh" size="sm" />
|
|
110
|
+
<span>{{
|
|
111
|
+
textStyleFieldTr(`applyChangesToAll`, {
|
|
112
|
+
role: selectedRoleLabel,
|
|
113
|
+
})
|
|
114
|
+
}}</span>
|
|
115
|
+
</a>
|
|
116
|
+
<a
|
|
117
|
+
class="tw-flex tw-items-center tw-gap-2 tw-cursor-pointer tw-text-sm tw-text-grayscale-700 tw-py-1"
|
|
118
|
+
data-test-reset-to-global
|
|
119
|
+
@click="onResetStyleToRole()"
|
|
120
|
+
>
|
|
121
|
+
<Icon name="undo" size="sm" />
|
|
122
|
+
<span>{{ textStyleFieldTr(`resetToDefault`) }}</span>
|
|
123
|
+
</a>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
61
127
|
<p
|
|
62
128
|
class="tw-font-sans tw-font-bold tw-text-secondary-800 tw-text-sm tw-mb-2"
|
|
63
129
|
>
|
|
@@ -127,6 +193,7 @@
|
|
|
127
193
|
right-aligned). `linked-style-type` + `inherited-color` let the readout report the
|
|
128
194
|
"Inherits · <Style>" state that most linked text fields sit in. -->
|
|
129
195
|
<ColorField
|
|
196
|
+
v-if="showColor"
|
|
130
197
|
:id="`${id}-color`"
|
|
131
198
|
:name="name"
|
|
132
199
|
:label="textStyleFieldTr(`color`)"
|
|
@@ -157,25 +224,26 @@
|
|
|
157
224
|
<script>
|
|
158
225
|
import FontPicker from '@shared/font-family-selector/FontPicker.vue';
|
|
159
226
|
import TextStyleFieldMixin from './TextStyleField.mixin.ts';
|
|
160
|
-
import {
|
|
161
|
-
ButtonGroup,
|
|
162
|
-
Icon,
|
|
163
|
-
Slider,
|
|
164
|
-
Dropdown,
|
|
165
|
-
DropdownItem,
|
|
166
|
-
} from '@designcrowd/fe-shared-lib';
|
|
227
|
+
import { Button, ButtonGroup, Icon, Slider } from '@designcrowd/fe-shared-lib';
|
|
167
228
|
import ColorField from '../color-field/ColorField.vue';
|
|
229
|
+
import TextStyleRoleDropdown from '../text-style-role-dropdown/TextStyleRoleDropdown.vue';
|
|
168
230
|
import { textStyleFieldTr } from '@src/composables/useTranslate';
|
|
231
|
+
// v-click-outside resolves to this local binding — the directive is NOT registered
|
|
232
|
+
// globally, so every component that uses it must import it (see RichTextEditor.vue).
|
|
233
|
+
import { directive as vClickOutside } from 'click-outside-vue3';
|
|
169
234
|
|
|
170
235
|
export default {
|
|
171
236
|
components: {
|
|
172
|
-
|
|
173
|
-
DropdownItem,
|
|
237
|
+
Button,
|
|
174
238
|
FontPicker,
|
|
175
239
|
ButtonGroup,
|
|
176
240
|
ColorField,
|
|
177
241
|
Icon,
|
|
178
242
|
Slider,
|
|
243
|
+
TextStyleRoleDropdown,
|
|
244
|
+
},
|
|
245
|
+
directives: {
|
|
246
|
+
clickOutside: vClickOutside,
|
|
179
247
|
},
|
|
180
248
|
mixins: [TextStyleFieldMixin],
|
|
181
249
|
setup(props, context) {
|
|
@@ -186,3 +254,23 @@ export default {
|
|
|
186
254
|
},
|
|
187
255
|
};
|
|
188
256
|
</script>
|
|
257
|
+
|
|
258
|
+
<style scoped>
|
|
259
|
+
/* The toggle's own positioning context so the popup hangs relative to it. */
|
|
260
|
+
.text-style-field__modified-anchor {
|
|
261
|
+
@apply tw-relative tw-flex tw-shrink-0;
|
|
262
|
+
}
|
|
263
|
+
.text-style-field__modified-toggle {
|
|
264
|
+
@apply tw-flex tw-h-full tw-w-11 tw-items-center tw-justify-center tw-rounded-lg tw-border tw-border-solid tw-border-grayscale-400 tw-bg-white tw-text-secondary-500 tw-cursor-pointer;
|
|
265
|
+
}
|
|
266
|
+
.text-style-field__modified-toggle--active {
|
|
267
|
+
@apply tw-bg-grayscale-200;
|
|
268
|
+
}
|
|
269
|
+
/* Hangs just below the toggle, aligned to the panel's right edge. */
|
|
270
|
+
.text-style-field__modified-popup {
|
|
271
|
+
@apply tw-absolute tw-right-0 tw-z-20 tw-flex tw-flex-col tw-gap-1 tw-rounded-lg tw-border tw-border-solid tw-border-grayscale-400 tw-bg-white tw-p-4;
|
|
272
|
+
top: calc(100% + 6px);
|
|
273
|
+
width: 260px;
|
|
274
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
|
|
275
|
+
}
|
|
276
|
+
</style>
|