@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
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { BrandPageContext } from '@brand-page';
|
|
2
|
-
// Leaf import, not the `@brand-page/utils` barrel: the barrel cycles through the
|
|
3
|
-
// settings-component graph this module is reached from.
|
|
4
|
-
import { resolveTextColor } from '@brand-page/utils/text-style.util';
|
|
5
2
|
import { collectRteTextColors } from '@shared/color-strategies/rte-color';
|
|
6
3
|
import { showsTextBackgroundColor } from '@shared/content-settings/text-background-color.util';
|
|
7
4
|
import { pairedRteTextField } from '@shared/color-strategies/rte-field-pairs';
|
|
8
5
|
// From the leaf, not `rich-text-editor.util` — that module drags dompurify and the
|
|
9
6
|
// render helpers in at runtime, which this pure collector must not.
|
|
10
|
-
import { isRteHtmlString } from '@
|
|
7
|
+
import { isRteHtmlString } from '@shared/rte-shape.util';
|
|
11
8
|
import {
|
|
12
9
|
resolveColorMatchState,
|
|
13
10
|
resolveShapeMatchState,
|
|
@@ -279,23 +276,12 @@ export const collectSectionColorMatches = (
|
|
|
279
276
|
label: string,
|
|
280
277
|
): SectionColorMatch | undefined => {
|
|
281
278
|
const linkedStyleType = style.textStyleType as string | undefined;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
style as { color?: string },
|
|
289
|
-
inheritedColor ? { color: inheritedColor } : undefined,
|
|
290
|
-
);
|
|
291
|
-
// The third level, which `resolveTextColor` does not model because the
|
|
292
|
-
// renderer gets it free from root CSS inheritance.
|
|
293
|
-
const value = cascaded || defaultTextColor;
|
|
294
|
-
const state = resolveColorMatchState({
|
|
295
|
-
value,
|
|
296
|
-
linkedStyleType,
|
|
297
|
-
inheritedColor,
|
|
298
|
-
});
|
|
279
|
+
// ADR-0020: a role carries no colour, so a field with no colour of its own renders
|
|
280
|
+
// the page base coat (defaultTextColor), never a role colour. Element-first, else
|
|
281
|
+
// the base coat — there is no longer a `global-style` rung.
|
|
282
|
+
const ownColour = style.color as string | undefined;
|
|
283
|
+
const value = ownColour || defaultTextColor;
|
|
284
|
+
const state = resolveColorMatchState({ value, linkedStyleType });
|
|
299
285
|
|
|
300
286
|
if (!state) {
|
|
301
287
|
return undefined;
|
|
@@ -306,13 +292,8 @@ export const collectSectionColorMatches = (
|
|
|
306
292
|
label,
|
|
307
293
|
source: 'field',
|
|
308
294
|
group: 'element',
|
|
309
|
-
origin:
|
|
310
|
-
|
|
311
|
-
: inheritedColor
|
|
312
|
-
? 'global-style'
|
|
313
|
-
: 'site-default',
|
|
314
|
-
// Named on the site-default level too: "lands on the site default *through*
|
|
315
|
-
// Titles" is what tells the admin where to fix it.
|
|
295
|
+
origin: ownColour ? 'element' : 'site-default',
|
|
296
|
+
// Names the link so a site-default readout can say which role's text it is.
|
|
316
297
|
originStyleType: linkedStyleType,
|
|
317
298
|
entries: [toEntry(value, state, resolveColor)],
|
|
318
299
|
};
|
|
@@ -274,6 +274,41 @@ export const FIELD_SLOT_MAP: Record<string, ColorSlot> = {
|
|
|
274
274
|
testimonialStyle: 'onSurface',
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
+
/**
|
|
278
|
+
* Style fields a strategy writes although no settings config declares them, per section type,
|
|
279
|
+
* each with the config field it `follows` and the `textField` it colours: written only when the
|
|
280
|
+
* followed field is assignable, so it shares its visibility gate, and its slot still comes from
|
|
281
|
+
* `FIELD_SLOT_MAP`. A rich-text `textField` is recoloured with it, as a pair is.
|
|
282
|
+
*
|
|
283
|
+
* The payment and shop success message is edited through its `successMessage` text field, so
|
|
284
|
+
* the config walk never reaches its style. It follows the description it is seeded from
|
|
285
|
+
* (`text-role-reconnect.util.ts`). The contact form's is not listed. Not in
|
|
286
|
+
* `RTE_SECTION_FIELD_PAIRS`: released migration-21 reads that table.
|
|
287
|
+
*/
|
|
288
|
+
export const STYLE_FIELDS_OUTSIDE_CONFIG: Record<
|
|
289
|
+
string,
|
|
290
|
+
Record<string, { follows: string; textField: string }>
|
|
291
|
+
> = {
|
|
292
|
+
'request-payment': {
|
|
293
|
+
successMessageStyle: {
|
|
294
|
+
follows: 'descriptionStyle',
|
|
295
|
+
textField: 'successMessage',
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
'support-me': {
|
|
299
|
+
successMessageStyle: {
|
|
300
|
+
follows: 'descriptionStyle',
|
|
301
|
+
textField: 'successMessage',
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
'shop-section': {
|
|
305
|
+
successMessageStyle: {
|
|
306
|
+
follows: 'descriptionStyle',
|
|
307
|
+
textField: 'successMessage',
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
|
|
277
312
|
/**
|
|
278
313
|
* Resolve a field's slot: its default placement, promoted to the raised layer when this
|
|
279
314
|
* section puts it there AND that layer is actually being painted.
|
|
@@ -18,6 +18,9 @@ import { DEFAULT_LINK_COLOR } from '@src/constants/rich-text-editor.constants';
|
|
|
18
18
|
*
|
|
19
19
|
* **Overwrites deliberate literal colours** — a hand-picked `#FF0000` becomes the slot
|
|
20
20
|
* colour. Consistent with the macro's replace-not-merge semantics, and one undo reverts it.
|
|
21
|
+
*
|
|
22
|
+
* MIGRATION-22 SNAPSHOT DEPENDENCY: its colour bake uses `collectRteTextColors` and
|
|
23
|
+
* `fillUncolouredRteText`. Pin the v22 implementation before changing either after release.
|
|
21
24
|
*/
|
|
22
25
|
|
|
23
26
|
/**
|
|
@@ -39,6 +42,22 @@ const HIGHLIGHT_MARK = 'highlight';
|
|
|
39
42
|
const isUnmarkedWhitespace = (node: JSONContent): boolean =>
|
|
40
43
|
!node.marks?.length && typeof node.text === 'string' && !node.text.trim();
|
|
41
44
|
|
|
45
|
+
/**
|
|
46
|
+
* True when the doc has at least one run `setRteTextColor` will actually colour:
|
|
47
|
+
* `docHasTextRun` (rte-authoring.util.ts) counts any text node, unmarked whitespace included, so
|
|
48
|
+
* a doc whose only run IS unmarked whitespace passes that check, `setRteTextColor` walks it and
|
|
49
|
+
* returns a (structurally unchanged) doc, and a caller that then deletes the style colour on any
|
|
50
|
+
* truthy return loses the colour with nowhere left to hold it.
|
|
51
|
+
*/
|
|
52
|
+
export const docHasColourableRun = (doc: JSONContent): boolean => {
|
|
53
|
+
const walk = (node: JSONContent): boolean =>
|
|
54
|
+
node.type === 'text'
|
|
55
|
+
? !isUnmarkedWhitespace(node)
|
|
56
|
+
: (node.content ?? []).some(walk);
|
|
57
|
+
|
|
58
|
+
return walk(doc);
|
|
59
|
+
};
|
|
60
|
+
|
|
42
61
|
/**
|
|
43
62
|
* A hyperlink run. Exempt from the strategy colour on both sides: the setter forces
|
|
44
63
|
* `DEFAULT_LINK_COLOR` instead (links are always the same blue, per `AutoLink`), and the
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { describe, test, expect } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
RTE_SECTION_FIELD_PAIRS,
|
|
4
|
+
PLAIN_TEXT_PAIR_SECTIONS,
|
|
5
|
+
pairedRteTextField,
|
|
6
|
+
} from './rte-field-pairs';
|
|
3
7
|
import { RTE_ALLOWED_SECTION_TYPES } from '@brand-page-maker/utils/rich-text-editor.util';
|
|
4
8
|
|
|
5
9
|
describe('pairedRteTextField', () => {
|
|
@@ -31,14 +35,31 @@ describe('pairedRteTextField', () => {
|
|
|
31
35
|
});
|
|
32
36
|
|
|
33
37
|
describe('the moved map still backs its original consumer', () => {
|
|
34
|
-
// Guards the move out of rich-text-editor.util.ts: RTE_ALLOWED_SECTION_TYPES is
|
|
35
|
-
//
|
|
36
|
-
|
|
38
|
+
// Guards the move out of rich-text-editor.util.ts: RTE_ALLOWED_SECTION_TYPES is the pairs
|
|
39
|
+
// map's keys MINUS the plain-by-design sections, plus the 'text' special case. The plain
|
|
40
|
+
// sections sit in the map only for the colour-strategy pairing lookup — mounting an editor
|
|
41
|
+
// on them would convert their plain title/description to a doc and strand the style colour.
|
|
42
|
+
test('RTE_ALLOWED_SECTION_TYPES = map keys (minus plain-text sections) + text', () => {
|
|
37
43
|
expect([...RTE_ALLOWED_SECTION_TYPES].sort()).toEqual(
|
|
38
|
-
[
|
|
44
|
+
[
|
|
45
|
+
...Object.keys(RTE_SECTION_FIELD_PAIRS).filter(
|
|
46
|
+
(type) => !PLAIN_TEXT_PAIR_SECTIONS.has(type),
|
|
47
|
+
),
|
|
48
|
+
'text',
|
|
49
|
+
].sort(),
|
|
39
50
|
);
|
|
40
51
|
});
|
|
41
52
|
|
|
53
|
+
test('PLAIN_TEXT_PAIR_SECTIONS is empty — every paired section is RTE-editable (BP-5969)', () => {
|
|
54
|
+
// shop/request-payment/support-me were restored to RTE (they were RTE on develop); the seam is
|
|
55
|
+
// kept but currently holds nothing, and any type added to it must drop out of the editor gate.
|
|
56
|
+
expect(PLAIN_TEXT_PAIR_SECTIONS.size).toBe(0);
|
|
57
|
+
|
|
58
|
+
for (const type of ['shop-section', 'request-payment', 'support-me']) {
|
|
59
|
+
expect(RTE_ALLOWED_SECTION_TYPES).toContain(type);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
42
63
|
test('every pair names both halves', () => {
|
|
43
64
|
Object.values(RTE_SECTION_FIELD_PAIRS)
|
|
44
65
|
.flat()
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* lookup, so keeping it out of `rich-text-editor.util.ts` (which pulls `dompurify`
|
|
6
6
|
* at runtime) lets both read one source of truth without the strategy path dragging
|
|
7
7
|
* in the editor toolchain.
|
|
8
|
+
*
|
|
9
|
+
* MIGRATION-22 SNAPSHOT DEPENDENCY: this list controls that migration's RTE conversion and colour
|
|
10
|
+
* walk. Preserve its v22 interpretation in the migration before changing this list after release.
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
export interface RTEFieldPair {
|
|
@@ -94,3 +97,33 @@ export const pairedRteTextField = (
|
|
|
94
97
|
(pair) => pair.styleField === styleField,
|
|
95
98
|
)?.textField;
|
|
96
99
|
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Sections whose title/description are plain `string` (rendered by `TextWrapper`'s plain path from
|
|
103
|
+
* `style.color`, never an RTE mark) rather than RTE-managed docs. A section listed here is excluded
|
|
104
|
+
* from the RTE style-field set below, the migration's plain→doc conversion, the maker's add-time doc
|
|
105
|
+
* authoring, AND the editor gate (`RTE_ALLOWED_SECTION_TYPES`) — the single classification for
|
|
106
|
+
* "this field is plain, not RTE".
|
|
107
|
+
*
|
|
108
|
+
* **Currently empty.** shop/request-payment/support-me were RTE-editable on `develop` (title stored
|
|
109
|
+
* as `string`, editor mounted via the pairs map, the runtime mapper converting on the fly); BP-5969
|
|
110
|
+
* briefly classified them plain, which regressed that. They are RTE again — authored as docs at the
|
|
111
|
+
* factory and converted for existing sites by migration-22 — so this set is empty. Kept as the seam:
|
|
112
|
+
* to make a future section's title/description plain, add its type here and every consumer honours it.
|
|
113
|
+
*/
|
|
114
|
+
export const PLAIN_TEXT_PAIR_SECTIONS = new Set<string>([]);
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The genuinely-RTE style fields for a content type: the pairs map (minus the plain-by-design
|
|
118
|
+
* sections) plus the `text` section's own `textStyle`. Single source of truth shared by the
|
|
119
|
+
* migration (conversion + colour decouple) and the maker's content authoring.
|
|
120
|
+
*/
|
|
121
|
+
export const rteStyleFieldsFor = (type: string): string[] => {
|
|
122
|
+
if (PLAIN_TEXT_PAIR_SECTIONS.has(type)) return [];
|
|
123
|
+
|
|
124
|
+
const fields = (RTE_SECTION_FIELD_PAIRS[type] ?? []).map(
|
|
125
|
+
(pair) => pair.styleField,
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
return type === 'text' ? [...fields, 'textStyle'] : fields;
|
|
129
|
+
};
|
package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.test.ts
CHANGED
|
@@ -503,28 +503,15 @@ describe('ColorMatchesPanel — RTE rows', () => {
|
|
|
503
503
|
);
|
|
504
504
|
});
|
|
505
505
|
|
|
506
|
-
test('an ALL-uncoloured document
|
|
507
|
-
//
|
|
508
|
-
//
|
|
509
|
-
// default"
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
// Phase 3: the panel's "site default" level is now the paragraphs style.
|
|
513
|
-
styleStore.textStyles = {
|
|
514
|
-
...styleStore.textStyles,
|
|
515
|
-
textStyleOptions: {
|
|
516
|
-
...styleStore.textStyles.textStyleOptions,
|
|
517
|
-
paragraphs: {
|
|
518
|
-
type: 'paragraphs',
|
|
519
|
-
style: { color: 'var(--palette-0)' },
|
|
520
|
-
},
|
|
521
|
-
},
|
|
522
|
-
} as any;
|
|
523
|
-
|
|
506
|
+
test('an ALL-uncoloured document reports no colour, never "rest at site default"', () => {
|
|
507
|
+
// Post-ADR-0020 there is no site-wide default text colour, so an all-uncoloured
|
|
508
|
+
// document has no colour anywhere in the cascade: the row reads "No colour set"
|
|
509
|
+
// (not a fabricated site-default palette colour), and there is no "rest" to fall
|
|
510
|
+
// through. Reported from the UI as "Site default · … · rest at site default".
|
|
524
511
|
const wrapper = mountPanel(config, { title: doc(para(run('plain'))) });
|
|
525
512
|
const row = rows(wrapper)[0];
|
|
526
513
|
|
|
527
|
-
expect(row.text()).toContain('
|
|
514
|
+
expect(row.text()).toContain('No colour set');
|
|
528
515
|
expect(row.find('[data-test="color-match-detail"]').exists()).toBe(false);
|
|
529
516
|
expect(row.find('[data-test="color-match-origin"]').text()).toBe(
|
|
530
517
|
'inherits global',
|
|
@@ -532,13 +519,15 @@ describe('ColorMatchesPanel — RTE rows', () => {
|
|
|
532
519
|
expect(wrapper.text()).not.toContain('rest at site default');
|
|
533
520
|
});
|
|
534
521
|
|
|
535
|
-
test('a document with no colour marks
|
|
522
|
+
test('a document with no colour marks reads as inheriting the global default, bare', () => {
|
|
523
|
+
// Post-ADR-0020 there is no site-wide default text colour to name — an uncoloured
|
|
524
|
+
// RTE document simply inherits the (browser) default, reported bare as "inherits
|
|
525
|
+
// global": no style, and no static alarm.
|
|
536
526
|
const wrapper = mountPanel(config, { title: doc(para(run('plain'))) });
|
|
537
527
|
|
|
538
528
|
expect(rows(wrapper)[0].attributes('data-test-origin')).toBe(
|
|
539
529
|
'site-default',
|
|
540
530
|
);
|
|
541
|
-
// Bare — no style is named because the global style never colours RTE runs.
|
|
542
531
|
expect(wrapper.text()).toContain('inherits global');
|
|
543
532
|
expect(wrapper.text()).not.toContain('Static');
|
|
544
533
|
});
|
|
@@ -584,19 +573,12 @@ describe('ColorMatchesPanel — where a text colour comes from', () => {
|
|
|
584
573
|
useUiColorPaletteStore().setColors(seed());
|
|
585
574
|
});
|
|
586
575
|
|
|
587
|
-
const withGlobalStyles = (
|
|
588
|
-
textStyleOptions: Record<string, unknown>,
|
|
589
|
-
defaultColor?: string,
|
|
590
|
-
) => {
|
|
576
|
+
const withGlobalStyles = (textStyleOptions: Record<string, unknown>) => {
|
|
591
577
|
const styleStore = useUiStyleSettingsStore();
|
|
592
578
|
|
|
593
579
|
styleStore.textStyles = {
|
|
594
580
|
...styleStore.textStyles,
|
|
595
|
-
textStyleOptions: {
|
|
596
|
-
// Phase 3: `paragraphs` carries the panel's "site default" level.
|
|
597
|
-
paragraphs: { type: 'paragraphs', style: { color: defaultColor } },
|
|
598
|
-
...textStyleOptions,
|
|
599
|
-
},
|
|
581
|
+
textStyleOptions: { ...textStyleOptions },
|
|
600
582
|
} as any;
|
|
601
583
|
};
|
|
602
584
|
|
|
@@ -614,9 +596,10 @@ describe('ColorMatchesPanel — where a text colour comes from', () => {
|
|
|
614
596
|
expect(row.find('[data-test="color-match-origin"]').exists()).toBe(false);
|
|
615
597
|
});
|
|
616
598
|
|
|
617
|
-
test('a colour
|
|
618
|
-
//
|
|
619
|
-
//
|
|
599
|
+
test('a role colour is ignored — a link-only field renders a neutral "Inherits", never the role colour (ADR-0020)', () => {
|
|
600
|
+
// Even though `titles` carries a colour, a role no longer contributes one, so a
|
|
601
|
+
// link-only field reports neither the role's colour nor a brand tone — it reads as
|
|
602
|
+
// inheriting the (now colourless) role, exactly as the per-field indicator does.
|
|
620
603
|
withGlobalStyles({ titles: { style: { color: 'var(--palette-0)' } } });
|
|
621
604
|
|
|
622
605
|
const wrapper = mountPanel(config, {
|
|
@@ -624,20 +607,22 @@ describe('ColorMatchesPanel — where a text colour comes from', () => {
|
|
|
624
607
|
});
|
|
625
608
|
const row = rows(wrapper)[0];
|
|
626
609
|
|
|
627
|
-
expect(row.attributes('data-test-origin')).toBe('
|
|
628
|
-
expect(row.
|
|
629
|
-
expect(row.
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
//
|
|
634
|
-
expect(
|
|
635
|
-
'From titles · Color matched · Logo Text',
|
|
636
|
-
);
|
|
610
|
+
expect(row.attributes('data-test-origin')).toBe('site-default');
|
|
611
|
+
expect(row.attributes('data-test-state')).toBe('inherits');
|
|
612
|
+
expect(row.text()).toContain('Inherits');
|
|
613
|
+
// The role's colour must not surface as a brand-toned match.
|
|
614
|
+
expect(row.find(`.${COLOR_MATCH_TONE_CLASS.brand}`).exists()).toBe(false);
|
|
615
|
+
// The inherits state names the linked style in its own value detail, so there is
|
|
616
|
+
// no separate origin line repeating it.
|
|
617
|
+
expect(row.find('[data-test="color-match-origin"]').exists()).toBe(false);
|
|
637
618
|
});
|
|
638
619
|
|
|
639
|
-
test('
|
|
640
|
-
|
|
620
|
+
test('a link-only field names the style it inherits from, in the value and the hover title', () => {
|
|
621
|
+
// Post-ADR-0020 there is no colour to "fall through" to, but the linked style is
|
|
622
|
+
// still worth surfacing: the value reads "Inherits · titles" and the verbose hover
|
|
623
|
+
// title carries the full chain. The style name lives in the value detail, so the
|
|
624
|
+
// inherits row shows no separate origin line.
|
|
625
|
+
withGlobalStyles({ titles: { style: {} } });
|
|
641
626
|
|
|
642
627
|
const wrapper = mountPanel(config, {
|
|
643
628
|
titleStyle: { textStyleType: 'titles' },
|
|
@@ -645,33 +630,25 @@ describe('ColorMatchesPanel — where a text colour comes from', () => {
|
|
|
645
630
|
const row = rows(wrapper)[0];
|
|
646
631
|
|
|
647
632
|
expect(row.attributes('data-test-origin')).toBe('site-default');
|
|
648
|
-
expect(row.
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
expect(origin.text()).toBe('inherits global titles');
|
|
654
|
-
expect(origin.classes()).toContain('tw-block');
|
|
655
|
-
expect(row.find('[data-test="color-match-detail"]').exists()).toBe(false);
|
|
633
|
+
expect(row.attributes('data-test-state')).toBe('inherits');
|
|
634
|
+
expect(row.text()).toContain('Inherits');
|
|
635
|
+
expect(row.find('[data-test="color-match-detail"]').text()).toBe('titles');
|
|
636
|
+
expect(row.find('[data-test="color-match-origin"]').exists()).toBe(false);
|
|
656
637
|
expect(valueCell(row).attributes('title')).toBe(
|
|
657
|
-
'Site default (via titles) ·
|
|
638
|
+
'Site default (via titles) · Inherits · titles',
|
|
658
639
|
);
|
|
659
640
|
});
|
|
660
641
|
|
|
661
|
-
test('an unlinked field with no colour
|
|
662
|
-
|
|
663
|
-
|
|
642
|
+
test('an unlinked field with no colour has nothing to report — no row', () => {
|
|
643
|
+
// Post-ADR-0020 an uncoloured field has no colour anywhere (no role colour, no
|
|
644
|
+
// page base coat) and, unlinked, no style to name either — so the panel reports it
|
|
645
|
+
// exactly as its per-field indicator does: nothing. The section carries no other
|
|
646
|
+
// colour, so the whole panel stays silent.
|
|
664
647
|
const wrapper = mountPanel(config, { titleStyle: {} });
|
|
665
|
-
const row = rows(wrapper)[0];
|
|
666
648
|
|
|
667
|
-
expect(
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
// colour, so there is no "<Style>" to append — the bare "inherits global".
|
|
671
|
-
expect(row.find('[data-test="color-match-origin"]').text()).toBe(
|
|
672
|
-
'inherits global',
|
|
673
|
-
);
|
|
674
|
-
expect(row.find('[data-test="color-match-detail"]').exists()).toBe(false);
|
|
649
|
+
expect(
|
|
650
|
+
wrapper.find('[data-component="color-matches-panel"]').exists(),
|
|
651
|
+
).toBe(false);
|
|
675
652
|
});
|
|
676
653
|
});
|
|
677
654
|
|
|
@@ -212,10 +212,16 @@ const styleSettingsStore = useUiStyleSettingsStore();
|
|
|
212
212
|
const userStore = useBrandPageMakerUserStore();
|
|
213
213
|
|
|
214
214
|
const matches = computed<SectionColorMatch[]>(() =>
|
|
215
|
+
// No `defaultTextColor`: post-ADR-0020 there is no site-wide default text colour
|
|
216
|
+
// (the page base coat was removed, and a role carries no colour), so an uncoloured
|
|
217
|
+
// field renders at the browser default, not a managed colour. Feeding one in would
|
|
218
|
+
// invent a "site default" the per-field `ColorMatchIndicator` has no notion of and
|
|
219
|
+
// report an uncoloured field as an off-palette static — the divergence this panel
|
|
220
|
+
// must never have. An uncoloured field is reported exactly as the indicator does:
|
|
221
|
+
// `inherits` when linked, nothing when unlinked.
|
|
215
222
|
collectSectionColorMatches(props.config, props.content, {
|
|
216
223
|
context: props.context,
|
|
217
224
|
textStyleOptions: styleSettingsStore.textStyles?.textStyleOptions,
|
|
218
|
-
defaultTextColor: styleSettingsStore.defaultTextColor,
|
|
219
225
|
canUseRichTextEditor: userStore.features.canUseRichTextEditor,
|
|
220
226
|
resolveColor: paletteStore.resolveColor,
|
|
221
227
|
}),
|
|
@@ -9,25 +9,14 @@ import { useUiSideBarStore } from '../../../side-bar/store';
|
|
|
9
9
|
import { SIDE_BAR_TAB_NAMES } from '@brand-page-maker/constants';
|
|
10
10
|
import { useUiContentSettingsStore } from '../../store';
|
|
11
11
|
import { CONTENT_SETTINGS_MODES } from '../../store';
|
|
12
|
-
import {
|
|
13
|
-
useBrandPageMakerUserStore,
|
|
14
|
-
useBrandPageContainerStore,
|
|
15
|
-
} from '@brand-page-maker/stores';
|
|
12
|
+
import { useBrandPageContainerStore } from '@brand-page-maker/stores';
|
|
16
13
|
import { SIDE_BAR_CONTENT_ID } from '../../constants';
|
|
17
14
|
import type { ComponentPublicInstance } from '@vue/runtime-core';
|
|
18
15
|
import {
|
|
19
16
|
SELECT_LOCATIONS,
|
|
20
17
|
useEventTracker,
|
|
21
18
|
} from '@brand-page-maker/composables/useEventTracker';
|
|
22
|
-
import { useExternalRichTextEditor } from '@brand-page-maker/composables/rich-text-editor/useRichTextEditor';
|
|
23
|
-
import {
|
|
24
|
-
switchAllContentToRTE,
|
|
25
|
-
transformToRTE,
|
|
26
|
-
RTE_ALLOWED_SECTION_TYPES,
|
|
27
|
-
} from '@brand-page-maker/utils';
|
|
28
|
-
import { useUiStyleSettingsStore } from '../../../style-settings/store';
|
|
29
19
|
import { usePageNavigationStore } from '../../../../shared/page-navigation/store/page-navigation-store';
|
|
30
|
-
import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
|
|
31
20
|
|
|
32
21
|
interface CategoryTab {
|
|
33
22
|
category: string;
|
|
@@ -40,13 +29,9 @@ export default defineComponent({
|
|
|
40
29
|
const contentSettingsStore = useUiContentSettingsStore();
|
|
41
30
|
const pageSettingsStore = useUiPageSettingsStore();
|
|
42
31
|
const pageNavigationStore = usePageNavigationStore();
|
|
43
|
-
const styleSettingsStore = useUiStyleSettingsStore();
|
|
44
32
|
const sideBarStore = useUiSideBarStore();
|
|
45
|
-
const userStore = useBrandPageMakerUserStore();
|
|
46
33
|
const containerStore = useBrandPageContainerStore();
|
|
47
34
|
const eventTracker = useEventTracker();
|
|
48
|
-
const historyStore = useHistoryStore();
|
|
49
|
-
const { externalEditor } = useExternalRichTextEditor();
|
|
50
35
|
|
|
51
36
|
return {
|
|
52
37
|
mode: computed(() => contentSettingsStore.mode),
|
|
@@ -56,17 +41,11 @@ export default defineComponent({
|
|
|
56
41
|
() => contentSettingsStore.selectedItemId,
|
|
57
42
|
),
|
|
58
43
|
isAdminMaker: computed(() => containerStore.isAdminMaker),
|
|
59
|
-
canUseRichTextEditor: computed(
|
|
60
|
-
() => userStore.features.canUseRichTextEditor,
|
|
61
|
-
),
|
|
62
44
|
contentSettingsStore,
|
|
63
45
|
pageNavigationStore,
|
|
64
46
|
pageSettingsStore,
|
|
65
47
|
sideBarStore,
|
|
66
|
-
styleSettingsStore,
|
|
67
48
|
eventTracker,
|
|
68
|
-
historyStore,
|
|
69
|
-
externalEditor,
|
|
70
49
|
};
|
|
71
50
|
},
|
|
72
51
|
data() {
|
|
@@ -79,17 +58,6 @@ export default defineComponent({
|
|
|
79
58
|
] as CategoryTab[],
|
|
80
59
|
};
|
|
81
60
|
},
|
|
82
|
-
mounted() {
|
|
83
|
-
if (this.canUseRichTextEditor) {
|
|
84
|
-
// RTE rewrap on tab mount — fold into current head.
|
|
85
|
-
this.historyStore.mergeNextMutation();
|
|
86
|
-
switchAllContentToRTE(
|
|
87
|
-
this.pageSettingsStore,
|
|
88
|
-
this.externalEditor,
|
|
89
|
-
this.styleSettingsStore,
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
61
|
computed: {
|
|
94
62
|
showPageControls(): boolean {
|
|
95
63
|
return true;
|
|
@@ -132,18 +100,6 @@ export default defineComponent({
|
|
|
132
100
|
return;
|
|
133
101
|
}
|
|
134
102
|
|
|
135
|
-
if (
|
|
136
|
-
RTE_ALLOWED_SECTION_TYPES.includes(option.type) &&
|
|
137
|
-
this.canUseRichTextEditor
|
|
138
|
-
) {
|
|
139
|
-
transformToRTE(
|
|
140
|
-
this.pageSettingsStore,
|
|
141
|
-
this.externalEditor,
|
|
142
|
-
this.styleSettingsStore,
|
|
143
|
-
newItem.settings.content as Content,
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
103
|
// Send MixPanel add event
|
|
148
104
|
this.eventTracker.sendAddContentEvent(
|
|
149
105
|
option.type,
|
|
@@ -292,7 +248,4 @@ export default defineComponent({
|
|
|
292
248
|
this.scrollToSelectedItem(itemId);
|
|
293
249
|
},
|
|
294
250
|
},
|
|
295
|
-
beforeUnmount() {
|
|
296
|
-
this.externalEditor.destroy();
|
|
297
|
-
},
|
|
298
251
|
});
|
|
@@ -2,7 +2,10 @@ import { defineComponent, computed } from 'vue';
|
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { ContentItem, Field, UpdateItemValuePayload } from '../../models';
|
|
4
4
|
import { VIEWPORTS, type Content, type LogoContent } from '@brand-page';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
containerTextColorDefaults,
|
|
7
|
+
buttonLabelColorDefault,
|
|
8
|
+
} from '@brand-page/utils/container-text-color.util';
|
|
6
9
|
import { UI_EVENT_SOURCES } from '../../../models';
|
|
7
10
|
import { useUiContentSettingsStore } from '../../store';
|
|
8
11
|
import { useUiSideBarStore } from '../../../side-bar/store';
|
|
@@ -140,6 +143,10 @@ export default defineComponent({
|
|
|
140
143
|
* aren't container-bound text. Fed to the Text Style panel so its swatch matches
|
|
141
144
|
* what the renderer paints — both derive it from the SAME helper (see
|
|
142
145
|
* `container-text-color.util.ts`), so the sidebar and canvas cannot drift.
|
|
146
|
+
*
|
|
147
|
+
* A standalone button's label carries no element colour (it inherits the button's
|
|
148
|
+
* on-fill colour at render); `buttonLabelColorDefault` supplies that same colour so
|
|
149
|
+
* the swatch shows it instead of reading blank.
|
|
143
150
|
*/
|
|
144
151
|
containerDefaultColor(): string | undefined {
|
|
145
152
|
const defaults = containerTextColorDefaults(
|
|
@@ -148,7 +155,14 @@ export default defineComponent({
|
|
|
148
155
|
this.brandPageType,
|
|
149
156
|
) as Record<string, string | undefined>;
|
|
150
157
|
|
|
151
|
-
return
|
|
158
|
+
return (
|
|
159
|
+
defaults[this.fieldName] ??
|
|
160
|
+
buttonLabelColorDefault(
|
|
161
|
+
this.content,
|
|
162
|
+
this.brandPageData.styles,
|
|
163
|
+
this.fieldName,
|
|
164
|
+
)
|
|
165
|
+
);
|
|
152
166
|
},
|
|
153
167
|
isInline(): boolean {
|
|
154
168
|
return this.field.isInline || false;
|
|
@@ -261,8 +275,13 @@ export default defineComponent({
|
|
|
261
275
|
// the store's new one, so remount it (same lever as onUseGeneratedText) to
|
|
262
276
|
// re-seed from the just-written value. Keyed off the history store's resync
|
|
263
277
|
// signal, bumped by the applier only when it writes an RTE document.
|
|
264
|
-
'historyStore.rteResyncToken'() {
|
|
265
|
-
|
|
278
|
+
'historyStore.rteResyncToken'(_token: number, previous: number) {
|
|
279
|
+
const isExcepted = this.historyStore.isRteResyncExcepted(
|
|
280
|
+
{ id: this.id, name: this.fieldName },
|
|
281
|
+
previous,
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
if (this.showRichTextEditor && !isExcepted) {
|
|
266
285
|
this.richTextEditorKey = this.richTextEditorKey + 1;
|
|
267
286
|
}
|
|
268
287
|
},
|
|
@@ -292,9 +311,16 @@ export default defineComponent({
|
|
|
292
311
|
this.contentSettingsStore.updateItemValue(payload);
|
|
293
312
|
}
|
|
294
313
|
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
|
|
314
|
+
// Re-bake the section's contrast colour after a change that can leave text uncoloured:
|
|
315
|
+
// switching a text style clears its colour, and ADDING a new `textItems` entry creates one
|
|
316
|
+
// with no colour (TextItemsField.addOption). `applyTextContrast` colours only the uncoloured
|
|
317
|
+
// fields/items, so this is a no-op for the rest. Without it a new brand-site text item falls
|
|
318
|
+
// back to the base default instead of the page-contrast colour.
|
|
319
|
+
if (
|
|
320
|
+
(this.field.type === ITEM_FIELD_TYPES['text-style'] ||
|
|
321
|
+
this.field.type === ITEM_FIELD_TYPES['text-items']) &&
|
|
322
|
+
payload.id
|
|
323
|
+
) {
|
|
298
324
|
this.contentSettingsStore.applyCardContrastToItem({ id: payload.id });
|
|
299
325
|
}
|
|
300
326
|
|