@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.
Files changed (576) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-DDcraD5S.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DtOeaisf.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BZpmJPew.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-CqRwC4e7.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-CqRwC4e7.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DId9Dfjh.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DId9Dfjh.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-BTDfmOcm.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-CeAu9Ayx.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-WCv0K41H.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BlfevQDY.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-Cvt7MHPZ.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DipZuylv.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-BCw4lcKN.js → CreatedOnDcom-pt-pt-Cf6u2GCg.js} +1 -1
  15. package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.d.ts +16 -0
  16. package/lib/src/brand-page/__fixtures__/production-text-style-resolver.fixture.js +35 -0
  17. package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +3 -0
  18. package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +19 -13
  19. package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +3 -1
  20. package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +17 -2
  21. package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.d.ts +11 -3
  22. package/lib/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.js +35 -1
  23. package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +8 -2
  24. package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +27 -3
  25. package/lib/src/brand-page/components/page/Page.mixin.d.ts +5 -2
  26. package/lib/src/brand-page/components/page/Page.mixin.js +33 -27
  27. package/lib/src/brand-page/components/page-footer/PageFooter.mixin.d.ts +7 -2
  28. package/lib/src/brand-page/components/page-footer/PageFooter.mixin.js +21 -1
  29. package/lib/src/brand-page/components/payment/Payment.mixin.d.ts +5 -2
  30. package/lib/src/brand-page/components/payment/Payment.mixin.js +22 -2
  31. package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +6 -2
  32. package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +32 -1
  33. package/lib/src/brand-page/components/social-links/SocialLinks.stories.js +0 -3
  34. package/lib/src/brand-page/components/testimonial-section/__fixtures__/data.js +0 -3
  35. package/lib/src/brand-page/components/text/Text.stories.js +0 -17
  36. package/lib/src/brand-page/constants/font.constants.d.ts +62 -0
  37. package/lib/src/brand-page/constants/font.constants.js +35 -0
  38. package/lib/src/brand-page/models/index.d.ts +23 -24
  39. package/lib/src/brand-page/models/index.js +20 -7
  40. package/lib/src/brand-page/models/navigation-styles.model.d.ts +1 -1
  41. package/lib/src/brand-page/models/navigation-styles.model.js +17 -8
  42. package/lib/src/brand-page/models/payment.model.d.ts +11 -6
  43. package/lib/src/brand-page/models/styles.model.d.ts +53 -7
  44. package/lib/src/brand-page/models/styles.model.js +115 -27
  45. package/lib/src/brand-page/utils/color-palette.util.d.ts +43 -23
  46. package/lib/src/brand-page/utils/color-palette.util.js +65 -27
  47. package/lib/src/brand-page/utils/color.util.d.ts +13 -9
  48. package/lib/src/brand-page/utils/color.util.js +56 -15
  49. package/lib/src/brand-page/utils/container-text-color.util.d.ts +46 -13
  50. package/lib/src/brand-page/utils/container-text-color.util.js +321 -41
  51. package/lib/src/brand-page/utils/index.d.ts +1 -0
  52. package/lib/src/brand-page/utils/index.js +1 -0
  53. package/lib/src/brand-page/utils/migration/migration-20.js +6 -2
  54. package/lib/src/brand-page/utils/migration/migration-21.js +34 -6
  55. package/lib/src/brand-page/utils/migration/migration-22.d.ts +99 -0
  56. package/lib/src/brand-page/utils/migration/migration-22.js +909 -0
  57. package/lib/src/brand-page/utils/migration.util.js +17 -0
  58. package/lib/src/brand-page/utils/model.util.d.ts +4 -0
  59. package/lib/src/brand-page/utils/model.util.js +4 -0
  60. package/lib/src/brand-page/utils/personalisation.util.js +9 -1
  61. package/lib/src/brand-page/utils/rte-role-lift.util.d.ts +72 -0
  62. package/lib/src/brand-page/utils/rte-role-lift.util.js +275 -0
  63. package/lib/src/brand-page/utils/style.util.d.ts +5 -1
  64. package/lib/src/brand-page/utils/style.util.js +34 -11
  65. package/lib/src/brand-page/utils/text-role-css.util.d.ts +19 -0
  66. package/lib/src/brand-page/utils/text-role-css.util.js +186 -0
  67. package/lib/src/brand-page/utils/text-role-reconnect.util.d.ts +90 -0
  68. package/lib/src/brand-page/utils/text-role-reconnect.util.js +434 -0
  69. package/lib/src/brand-page/utils/text-style.util.d.ts +53 -23
  70. package/lib/src/brand-page/utils/text-style.util.js +122 -22
  71. package/lib/src/brand-page/utils/view-model.util.d.ts +9 -1
  72. package/lib/src/brand-page/utils/view-model.util.js +124 -111
  73. package/lib/src/brand-page/view-models.d.ts +1 -0
  74. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +4 -1
  75. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +13 -2
  76. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +4 -4
  77. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +4 -1
  78. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -10
  79. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.js +0 -1
  80. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +23 -138
  81. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -28
  82. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +4 -1
  83. package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +1 -1
  84. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +5 -2
  85. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +4 -1
  86. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +4 -1
  87. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +4 -1
  88. package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
  89. package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
  90. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +1 -0
  91. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.d.ts +16 -0
  92. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.js +61 -0
  93. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.d.ts +11 -0
  94. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.js +236 -0
  95. package/lib/src/brand-page-maker/composables/rich-text-editor/font.d.ts +2 -1
  96. package/lib/src/brand-page-maker/composables/rich-text-editor/font.js +25 -6
  97. package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.d.ts +17 -4
  98. package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.js +204 -17
  99. package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +1 -1
  100. package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +29 -31
  101. package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.d.ts +20 -0
  102. package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.js +60 -0
  103. package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.d.ts +2 -1
  104. package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.js +22 -6
  105. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +10 -4
  106. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +319 -275
  107. package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -5
  108. package/lib/src/brand-page-maker/convertors/text-css-style-options.convertor.js +6 -2
  109. package/lib/src/brand-page-maker/convertors/text-size-value.convertor.d.ts +1 -1
  110. package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
  111. package/lib/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.js +7 -14
  112. package/lib/src/brand-page-maker/default-getters/text-color.default-getter.js +6 -13
  113. package/lib/src/brand-page-maker/models/content-settings.d.ts +8 -0
  114. package/lib/src/brand-page-maker/models/content-settings.js +112 -81
  115. package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.d.ts +2 -2
  116. package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.js +5 -2
  117. package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.js +4 -3
  118. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1257 -117
  119. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +6 -1
  120. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +17 -9
  121. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +59 -5
  122. package/lib/src/brand-page-maker/stores/history/history-store.js +22 -2
  123. package/lib/src/brand-page-maker/utils/apply-color-strategy.js +26 -8
  124. package/lib/src/brand-page-maker/utils/index.d.ts +2 -1
  125. package/lib/src/brand-page-maker/utils/index.js +2 -1
  126. package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +117 -15
  127. package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +435 -281
  128. package/lib/src/brand-page-maker/utils/rte-authoring.util.d.ts +4 -0
  129. package/lib/src/brand-page-maker/utils/rte-authoring.util.js +101 -0
  130. package/lib/src/brand-page-maker/utils/rte-clipboard.util.d.ts +126 -0
  131. package/lib/src/brand-page-maker/utils/rte-clipboard.util.js +307 -0
  132. package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +13 -3
  133. package/lib/src/{bundled-translations-zfiA5Tsw.js → bundled-translations-yGrvPE5i.js} +17 -17
  134. package/lib/src/{bundled-translations.de-DE-ChsdSyAP.js → bundled-translations.de-DE-L4Znf8Hs.js} +17 -17
  135. package/lib/src/{bundled-translations.es-ES-DflsWQK0.js → bundled-translations.es-ES-D6iticrK.js} +15 -15
  136. package/lib/src/{bundled-translations.fr-CA-fpDRuZ52.js → bundled-translations.fr-CA-BgAVE-9k.js} +25 -25
  137. package/lib/src/{bundled-translations.fr-FR-Bub73Zt-.js → bundled-translations.fr-FR-B8GbyqxQ.js} +17 -17
  138. package/lib/src/{bundled-translations.pt-BR-BlnWE9TB.js → bundled-translations.pt-BR-DjPU3Db7.js} +25 -25
  139. package/lib/src/{bundled-translations.pt-PT-DmzXlnaS.js → bundled-translations.pt-PT-BaepaDpr.js} +23 -23
  140. package/lib/src/bundles/bundled-translations.de-DE.json +21 -2
  141. package/lib/src/bundles/bundled-translations.es-ES.json +21 -2
  142. package/lib/src/bundles/bundled-translations.fr-CA.json +21 -2
  143. package/lib/src/bundles/bundled-translations.fr-FR.json +21 -2
  144. package/lib/src/bundles/bundled-translations.json +21 -2
  145. package/lib/src/bundles/bundled-translations.pt-BR.json +21 -2
  146. package/lib/src/bundles/bundled-translations.pt-PT.json +21 -2
  147. package/lib/src/clients/ai-assistant-client.d.ts +1 -0
  148. package/lib/src/composables/useTranslate.d.ts +1 -1
  149. package/lib/src/composables/useTranslate.js +1 -1
  150. package/lib/src/css/library.brand-page-brandCrowd.min.css +303 -207
  151. package/lib/src/css/library.brand-page-brandPage.min.css +303 -207
  152. package/lib/src/css/library.brand-page-designCom.min.css +303 -207
  153. package/lib/src/css/library.brand-page-preview.min.css +303 -207
  154. package/lib/src/index.d.ts +2 -1
  155. package/lib/src/index.mjs +195 -191
  156. package/lib/src/{lib-1AqtEmvQ.js → lib-kGRlD3_P.js} +36855 -33893
  157. package/lib/src/lib.js +2 -1
  158. package/lib/src/metadata-builder/builders/footer-builder.js +4 -5
  159. package/lib/src/metadata-builder/builders/global-role-propagation.d.ts +58 -0
  160. package/lib/src/metadata-builder/builders/global-role-propagation.js +246 -0
  161. package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +1 -0
  162. package/lib/src/metadata-builder/builders/global-styles-builder.js +116 -45
  163. package/lib/src/metadata-builder/builders/header-builder.js +13 -4
  164. package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +3 -3
  165. package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +3 -3
  166. package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +3 -3
  167. package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +4 -4
  168. package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +3 -3
  169. package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +2 -2
  170. package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +2 -2
  171. package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +4 -4
  172. package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +3 -3
  173. package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +8 -2
  174. package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +2 -2
  175. package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +60 -29
  176. package/lib/src/metadata-builder/builders/section-field-maps.js +1 -0
  177. package/lib/src/metadata-builder/builders/section-field-utils.d.ts +48 -19
  178. package/lib/src/metadata-builder/builders/section-field-utils.js +128 -52
  179. package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +4 -2
  180. package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +28 -12
  181. package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +5 -1
  182. package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +1 -1
  183. package/lib/src/metadata-builder/helpers/rte.helpers.js +97 -40
  184. package/lib/src/metadata-builder/metadata-executor.js +23 -1
  185. package/lib/src/metadata-builder/models.d.ts +2 -0
  186. package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +18 -19
  187. package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +18 -1
  188. package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +1 -1
  189. package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +0 -1
  190. package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +5 -8
  191. package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +7 -16
  192. package/lib/src/metadata-builder/sanitizers/section-args-validator.js +95 -22
  193. package/lib/src/shared/color-palette/section-color-matches.js +9 -25
  194. package/lib/src/shared/color-strategies/color-strategies.d.ts +15 -0
  195. package/lib/src/shared/color-strategies/color-strategies.js +31 -0
  196. package/lib/src/shared/color-strategies/rte-color.d.ts +8 -0
  197. package/lib/src/shared/color-strategies/rte-color.js +16 -0
  198. package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +23 -0
  199. package/lib/src/shared/color-strategies/rte-field-pairs.js +28 -0
  200. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +9 -135
  201. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -27
  202. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +12 -2
  203. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +7 -0
  204. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +75 -6
  205. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +18 -7
  206. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +6 -1
  207. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -7
  208. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -0
  209. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +8 -4
  210. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1255 -26
  211. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +203 -59
  212. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +6 -0
  213. package/lib/src/shared/content-settings/store/content-settings-store.js +105 -8
  214. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +5 -1
  215. package/lib/src/shared/navigation-style-settings/store/index.d.ts +7 -3
  216. package/lib/src/shared/navigation-style-settings/store/index.js +40 -15
  217. package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
  218. package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -0
  219. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +17 -5
  220. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +70 -13
  221. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +10 -2
  222. package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -1
  223. package/lib/src/shared/page-settings/store/page-settings-store.js +17 -0
  224. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +4 -1
  225. package/lib/src/shared/rte-extensions/AutoLink.d.ts +17 -0
  226. package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.js +67 -51
  227. package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.js +4 -1
  228. package/lib/src/shared/rte-extensions/TextEffects.d.ts +28 -0
  229. package/lib/src/shared/rte-extensions/TextEffects.js +96 -0
  230. package/lib/src/shared/rte-extensions/ViewDomParser.d.ts +2 -0
  231. package/lib/src/shared/rte-extensions/ViewDomParser.js +21 -0
  232. package/lib/src/shared/rte-extensions.util.d.ts +25 -0
  233. package/lib/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.js → shared/rte-extensions.util.js} +62 -7
  234. package/lib/src/shared/rte-link.util.d.ts +1 -0
  235. package/lib/src/shared/rte-link.util.js +1 -0
  236. package/lib/src/shared/rte-render.util.d.ts +112 -0
  237. package/lib/src/shared/rte-render.util.js +255 -0
  238. package/lib/src/shared/rte-shape.util.d.ts +6 -0
  239. package/lib/src/shared/rte-shape.util.js +18 -0
  240. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +2 -1
  241. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
  242. package/lib/src/shared/side-bar/store/side-bar-store.d.ts +2 -0
  243. package/lib/src/shared/side-bar/store/side-bar-store.js +9 -0
  244. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +155 -15
  245. package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +7 -1
  246. package/lib/src/shared/style-settings/store/style-settings-store.d.ts +1 -9
  247. package/lib/src/shared/style-settings/store/style-settings-store.js +3 -33
  248. package/lib/src/shared/style-settings/text-style-size-order.d.ts +2 -0
  249. package/lib/src/shared/style-settings/text-style-size-order.js +13 -0
  250. package/lib/src/shared/text-role-typography.util.d.ts +64 -0
  251. package/lib/src/shared/text-role-typography.util.js +183 -0
  252. package/lib/src/utils/minify-brand-page-metadata.d.ts +16 -1
  253. package/lib/src/utils/minify-brand-page-metadata.js +31 -9
  254. package/package.json +1 -1
  255. package/src/brand-page/__fixtures__/migration-22-v21/edited-brandsite-sections.v21.json +982 -0
  256. package/src/brand-page/__fixtures__/migration-22-v21/new-brandcontact-every-section.v21.json +1231 -0
  257. package/src/brand-page/__fixtures__/migration-22-v21/new-brandpage-every-section.v21.json +1231 -0
  258. package/src/brand-page/__fixtures__/migration-22-v21/new-brandsite-every-section.v21.json +1243 -0
  259. package/src/brand-page/__fixtures__/migration-22-v21/real-brandcontact.v21.json +755 -0
  260. package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-general-link.v21.json +527 -0
  261. package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-links.v21.json +755 -0
  262. package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-social-links.v21.json +514 -0
  263. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-about.v21.json +459 -0
  264. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-footer.v21.json +469 -0
  265. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-header-banner.v21.json +481 -0
  266. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-sections.v21.json +800 -0
  267. package/src/brand-page/__fixtures__/production-text-style-resolver.fixture.ts +52 -0
  268. package/src/brand-page/components/about-section/AboutSection.vue.test.ts +0 -10
  269. package/src/brand-page/components/contact-form/ContactForm.mixin.test.ts +127 -0
  270. package/src/brand-page/components/contact-form/ContactForm.mixin.ts +31 -14
  271. package/src/brand-page/components/contact-form/ContactForm.vue +26 -12
  272. package/src/brand-page/components/contact-form/ContactForm.vue.test.ts +60 -0
  273. package/src/brand-page/components/mailing-list/MailingList.mixin.test.ts +92 -0
  274. package/src/brand-page/components/mailing-list/MailingList.mixin.ts +28 -3
  275. package/src/brand-page/components/mailing-list/MailingList.vue +9 -4
  276. package/src/brand-page/components/mailing-list/MailingList.vue.test.ts +63 -0
  277. package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.ts +51 -1
  278. package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.test.ts +114 -0
  279. package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.vue +8 -2
  280. package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.test.ts +182 -0
  281. package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +59 -12
  282. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +40 -3
  283. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +15 -7
  284. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +133 -3
  285. package/src/brand-page/components/page/Page.mixin.ts +41 -34
  286. package/src/brand-page/components/page/Page.vue +17 -6
  287. package/src/brand-page/components/page/Page.vue.test.ts +91 -1
  288. package/src/brand-page/components/page-footer/PageFooter.mixin.ts +32 -2
  289. package/src/brand-page/components/page-footer/PageFooter.test.ts +79 -0
  290. package/src/brand-page/components/page-footer/PageFooter.vue +12 -4
  291. package/src/brand-page/components/payment/Payment.mixin.ts +34 -2
  292. package/src/brand-page/components/payment/Payment.test.ts +188 -0
  293. package/src/brand-page/components/payment/Payment.vue +12 -5
  294. package/src/brand-page/components/payment/RequestPaymentStripe.vue +1 -0
  295. package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +49 -2
  296. package/src/brand-page/components/payment/support-me/SupportMe.test.ts +100 -0
  297. package/src/brand-page/components/payment/support-me/SupportMe.vue +7 -1
  298. package/src/brand-page/components/payment/support-me/SupportMe.vue.test.ts +66 -0
  299. package/src/brand-page/components/save-contact/SaveContactWidget.test.ts +100 -0
  300. package/src/brand-page/components/save-contact/SaveContactWidget.vue +6 -3
  301. package/src/brand-page/components/shop/PaymentModal.vue +2 -6
  302. package/src/brand-page/components/shop/PaymentShippingAddress.vue +6 -0
  303. package/src/brand-page/components/shop/Shop.vue +15 -2
  304. package/src/brand-page/components/shop/Shop.vue.test.ts +74 -2
  305. package/src/brand-page/components/social-links/SocialLinks.stories.ts +0 -3
  306. package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +0 -3
  307. package/src/brand-page/components/testimonial-section/__fixtures__/data.ts +0 -3
  308. package/src/brand-page/components/text/Text.stories.ts +0 -17
  309. package/src/brand-page/components/text-wrapper/TextWrapper.parity.test.ts +136 -0
  310. package/src/brand-page/components/text-wrapper/TextWrapper.test.ts +358 -0
  311. package/src/brand-page/components/text-wrapper/TextWrapper.vue +82 -22
  312. package/src/brand-page/constants/font.constants.ts +37 -0
  313. package/src/brand-page/models/footer-icon-color.test.ts +22 -0
  314. package/src/brand-page/models/index.ts +50 -28
  315. package/src/brand-page/models/navigation-styles.model.test.ts +77 -1
  316. package/src/brand-page/models/navigation-styles.model.ts +26 -9
  317. package/src/brand-page/models/payment.model.ts +15 -6
  318. package/src/brand-page/models/styles.model.test.ts +104 -0
  319. package/src/brand-page/models/styles.model.ts +181 -47
  320. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +619 -115
  321. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +150 -9
  322. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +300 -18
  323. package/src/brand-page/utils/color-palette.util.test.ts +126 -1
  324. package/src/brand-page/utils/color-palette.util.ts +92 -26
  325. package/src/brand-page/utils/color.util.test.ts +62 -29
  326. package/src/brand-page/utils/color.util.ts +77 -14
  327. package/src/brand-page/utils/container-text-color.util.test.ts +672 -26
  328. package/src/brand-page/utils/container-text-color.util.ts +472 -46
  329. package/src/brand-page/utils/index.ts +1 -0
  330. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/edited-brandsite-sections.v22.json +1191 -0
  331. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandcontact-every-section.v22.json +2026 -0
  332. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandpage-every-section.v22.json +2017 -0
  333. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandsite-every-section.v22.json +2031 -0
  334. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandcontact.v22.json +1145 -0
  335. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-general-link.v22.json +645 -0
  336. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-links.v22.json +1136 -0
  337. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-social-links.v22.json +662 -0
  338. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-about.v22.json +638 -0
  339. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-footer.v22.json +610 -0
  340. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-header-banner.v22.json +660 -0
  341. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-sections.v22.json +1132 -0
  342. package/src/brand-page/utils/migration/migration-01.ts +293 -237
  343. package/src/brand-page/utils/migration/migration-02.ts +8 -1
  344. package/src/brand-page/utils/migration/migration-20.ts +6 -3
  345. package/src/brand-page/utils/migration/migration-20_5.test.ts +5 -2
  346. package/src/brand-page/utils/migration/migration-21.test.ts +34 -0
  347. package/src/brand-page/utils/migration/migration-21.ts +46 -10
  348. package/src/brand-page/utils/migration/migration-22.fixed-input.test.ts +43 -0
  349. package/src/brand-page/utils/migration/migration-22.test.ts +4103 -0
  350. package/src/brand-page/utils/migration/migration-22.text-font-family.test.ts +72 -0
  351. package/src/brand-page/utils/migration/migration-22.ts +1336 -0
  352. package/src/brand-page/utils/migration.util.test.ts +146 -32
  353. package/src/brand-page/utils/migration.util.ts +18 -0
  354. package/src/brand-page/utils/model.util.ts +4 -0
  355. package/src/brand-page/utils/personalisation.util.test.ts +148 -3
  356. package/src/brand-page/utils/personalisation.util.ts +9 -1
  357. package/src/brand-page/utils/rte-role-lift.util.ts +409 -0
  358. package/src/brand-page/utils/style.util.test.ts +35 -2
  359. package/src/brand-page/utils/style.util.ts +45 -11
  360. package/src/brand-page/utils/text-role-css.util.test.ts +525 -0
  361. package/src/brand-page/utils/text-role-css.util.ts +321 -0
  362. package/src/brand-page/utils/text-role-reconnect.util.test.ts +604 -0
  363. package/src/brand-page/utils/text-role-reconnect.util.ts +727 -0
  364. package/src/brand-page/utils/text-style.util.test.ts +305 -0
  365. package/src/brand-page/utils/text-style.util.ts +198 -24
  366. package/src/brand-page/utils/view-model.page-data.test.ts +232 -0
  367. package/src/brand-page/utils/view-model.util.test.ts +954 -133
  368. package/src/brand-page/utils/view-model.util.ts +187 -139
  369. package/src/brand-page/view-models.ts +4 -0
  370. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.blank-site.test.ts +57 -0
  371. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +9 -5
  372. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -10
  373. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.ts +0 -1
  374. package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -44
  375. package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +253 -200
  376. package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +1 -0
  377. package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +1 -0
  378. package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
  379. package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +1 -0
  380. package/src/brand-page-maker/composables/rich-text-editor/block-typography.test.ts +519 -0
  381. package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +1 -1
  382. package/src/brand-page-maker/composables/rich-text-editor/extensions/MaxLength.test.ts +26 -1
  383. package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.test.ts +110 -0
  384. package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.ts +99 -0
  385. package/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.ts +397 -0
  386. package/src/brand-page-maker/composables/rich-text-editor/extensions/ViewDomParser.test.ts +139 -0
  387. package/src/brand-page-maker/composables/rich-text-editor/font.ts +36 -5
  388. package/src/brand-page-maker/composables/rich-text-editor/formatting.test.ts +375 -1
  389. package/src/brand-page-maker/composables/rich-text-editor/formatting.ts +301 -17
  390. package/src/brand-page-maker/composables/rich-text-editor/hyperlink.test.ts +82 -1
  391. package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +28 -34
  392. package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.test.ts +80 -0
  393. package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.ts +75 -0
  394. package/src/brand-page-maker/composables/rich-text-editor/spacing.ts +31 -6
  395. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.test.ts +2485 -0
  396. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +435 -337
  397. package/src/brand-page-maker/constants/config-settings-constant.ts +0 -6
  398. package/src/brand-page-maker/convertors/text-css-style-options.convertor.test.ts +43 -0
  399. package/src/brand-page-maker/convertors/text-css-style-options.convertor.ts +6 -2
  400. package/src/brand-page-maker/convertors/text-size-value.convertor.test.ts +24 -0
  401. package/src/brand-page-maker/convertors/text-size-value.convertor.ts +17 -13
  402. package/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.ts +7 -22
  403. package/src/brand-page-maker/default-getters/text-color.default-getter.ts +5 -21
  404. package/src/brand-page-maker/models/content-settings.test.ts +708 -0
  405. package/src/brand-page-maker/models/content-settings.ts +133 -82
  406. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.test.ts +63 -1
  407. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.ts +16 -3
  408. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.test.ts +34 -0
  409. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.ts +4 -2
  410. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +185 -1
  411. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +22 -34
  412. package/src/brand-page-maker/stores/history/history-store.ts +35 -2
  413. package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +528 -0
  414. package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +12 -0
  415. package/src/brand-page-maker/utils/apply-color-strategy.golden.test.ts +2 -0
  416. package/src/brand-page-maker/utils/apply-color-strategy.test.ts +181 -3
  417. package/src/brand-page-maker/utils/apply-color-strategy.ts +36 -4
  418. package/src/brand-page-maker/utils/index.ts +2 -1
  419. package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +447 -410
  420. package/src/brand-page-maker/utils/rich-text-editor.util.ts +610 -506
  421. package/src/brand-page-maker/utils/rte-authoring.util.test.ts +244 -0
  422. package/src/brand-page-maker/utils/rte-authoring.util.ts +175 -0
  423. package/src/brand-page-maker/utils/rte-clipboard.util.test.ts +558 -0
  424. package/src/brand-page-maker/utils/rte-clipboard.util.ts +473 -0
  425. package/src/brand-page-maker/utils/rte-features.test.ts +99 -3
  426. package/src/brand-page-maker/utils/rte-render-parity.test.ts +1 -1
  427. package/src/brand-page-maker/utils/rte-render.util.test.ts +230 -0
  428. package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +1 -1
  429. package/src/brand-page-maker/utils/rte-sanitize.util.ts +14 -3
  430. package/src/brand-page-maker/utils/rte-schema-version.test.ts +102 -0
  431. package/src/bundles/bundled-translations.de-DE.json +21 -2
  432. package/src/bundles/bundled-translations.es-ES.json +21 -2
  433. package/src/bundles/bundled-translations.fr-CA.json +21 -2
  434. package/src/bundles/bundled-translations.fr-FR.json +21 -2
  435. package/src/bundles/bundled-translations.json +21 -2
  436. package/src/bundles/bundled-translations.pt-BR.json +21 -2
  437. package/src/bundles/bundled-translations.pt-PT.json +21 -2
  438. package/src/clients/ai-assistant-client.ts +1 -0
  439. package/src/composables/useTranslate.ts +2 -1
  440. package/src/lib.ts +2 -2
  441. package/src/metadata-builder/builders/footer-builder.test.ts +70 -45
  442. package/src/metadata-builder/builders/footer-builder.ts +4 -8
  443. package/src/metadata-builder/builders/global-role-propagation.test.ts +907 -0
  444. package/src/metadata-builder/builders/global-role-propagation.ts +430 -0
  445. package/src/metadata-builder/builders/global-styles-builder.test.ts +1020 -0
  446. package/src/metadata-builder/builders/global-styles-builder.ts +194 -48
  447. package/src/metadata-builder/builders/header-builder.test.ts +112 -40
  448. package/src/metadata-builder/builders/header-builder.ts +18 -8
  449. package/src/metadata-builder/builders/section-builders/about-section-builder.ts +5 -3
  450. package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +5 -3
  451. package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +5 -3
  452. package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +7 -4
  453. package/src/metadata-builder/builders/section-builders/images-section-builder.ts +5 -3
  454. package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +3 -2
  455. package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +3 -2
  456. package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +7 -7
  457. package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +5 -3
  458. package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +2 -2
  459. package/src/metadata-builder/builders/section-builders/social-links-builder.ts +21 -10
  460. package/src/metadata-builder/builders/section-builders/support-me-builder.test.ts +10 -0
  461. package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +3 -2
  462. package/src/metadata-builder/builders/section-builders/text-section-builder.ts +111 -61
  463. package/src/metadata-builder/builders/section-field-maps.ts +1 -0
  464. package/src/metadata-builder/builders/section-field-utils.test.ts +545 -2
  465. package/src/metadata-builder/builders/section-field-utils.ts +202 -69
  466. package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +38 -13
  467. package/src/metadata-builder/builders/section-rules/social-links.rules.ts +5 -0
  468. package/src/metadata-builder/helpers/rte.helpers.test.ts +101 -0
  469. package/src/metadata-builder/helpers/rte.helpers.ts +129 -43
  470. package/src/metadata-builder/metadata-executor.test.ts +167 -0
  471. package/src/metadata-builder/metadata-executor.ts +34 -1
  472. package/src/metadata-builder/models.ts +2 -0
  473. package/src/metadata-builder/parsers/ai-toolcall-parser.ts +23 -7
  474. package/src/metadata-builder/parsers/section-tool-arguments.ts +21 -1
  475. package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +215 -0
  476. package/src/metadata-builder/sanitizers/rte-schema-check.ts +1 -1
  477. package/src/metadata-builder/sanitizers/sanitizer-rules.ts +4 -8
  478. package/src/metadata-builder/sanitizers/section-args-validator.ts +136 -53
  479. package/src/shared/color-palette/section-color-matches.test.ts +15 -11
  480. package/src/shared/color-palette/section-color-matches.ts +9 -28
  481. package/src/shared/color-strategies/color-strategies.ts +35 -0
  482. package/src/shared/color-strategies/rte-color.test.ts +1 -1
  483. package/src/shared/color-strategies/rte-color.ts +19 -0
  484. package/src/shared/color-strategies/rte-field-pairs.test.ts +26 -5
  485. package/src/shared/color-strategies/rte-field-pairs.ts +33 -0
  486. package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.test.ts +43 -66
  487. package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.vue +7 -1
  488. package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -48
  489. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +33 -7
  490. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.test.ts +128 -1
  491. package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -0
  492. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
  493. package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +3 -0
  494. package/src/shared/content-settings/components/logo-size-field/LogoSizeSlider.vue +3 -0
  495. package/src/shared/content-settings/components/logo-size-field/LogoSizeSliderField.vue +1 -0
  496. package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +1 -0
  497. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.test.ts +56 -3
  498. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +11 -4
  499. package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.test.ts +335 -25
  500. package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +248 -70
  501. package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +113 -25
  502. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.de-DE.json +17 -10
  503. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.es-ES.json +17 -10
  504. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-CA.json +17 -10
  505. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-FR.json +17 -10
  506. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.json +8 -1
  507. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-BR.json +17 -10
  508. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-PT.json +17 -10
  509. package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.test.ts +141 -0
  510. package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.vue +136 -0
  511. package/src/shared/content-settings/store/content-settings-store.test.ts +491 -6
  512. package/src/shared/content-settings/store/content-settings-store.ts +159 -17
  513. package/src/shared/logo-settings/components/EditLogoSettings.vue +1 -0
  514. package/src/shared/logo-settings/components/LogoVariations.vue +1 -0
  515. package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +1 -0
  516. package/src/shared/navigation-style-settings/store/index.test.ts +295 -0
  517. package/src/shared/navigation-style-settings/store/index.ts +65 -15
  518. package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +2 -0
  519. package/src/shared/page-settings/components/page-settings/PageElement.vue +1 -0
  520. package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +44 -4
  521. package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +13 -4
  522. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.navigation.test.ts +89 -0
  523. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.text-style.test.ts +91 -0
  524. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +14 -2
  525. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.vue +2 -0
  526. package/src/shared/page-settings/store/page-settings-store.text-style.test.ts +84 -0
  527. package/src/shared/page-settings/store/page-settings-store.ts +30 -1
  528. package/src/shared/rte-extensions/AutoLink.test.ts +98 -0
  529. package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.ts +87 -58
  530. package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.ts +4 -1
  531. package/src/shared/rte-extensions/TextEffects.ts +151 -0
  532. package/src/shared/rte-extensions/ViewDomParser.ts +27 -0
  533. package/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.ts → shared/rte-extensions.util.ts} +66 -9
  534. package/src/shared/rte-link.util.ts +2 -0
  535. package/src/shared/rte-render.util.ts +385 -0
  536. package/src/shared/rte-shape.util.ts +29 -0
  537. package/src/shared/side-bar/store/side-bar-store.test.ts +27 -1
  538. package/src/shared/side-bar/store/side-bar-store.ts +11 -0
  539. package/src/shared/style-settings/components/StyleSettings.mixin.ts +7 -3
  540. package/src/shared/style-settings/components/StyleSettings.test.ts +116 -0
  541. package/src/shared/style-settings/components/StyleSettings.vue +75 -25
  542. package/src/shared/style-settings/components/i18n/style-settings.de-DE.json +32 -20
  543. package/src/shared/style-settings/components/i18n/style-settings.es-ES.json +32 -20
  544. package/src/shared/style-settings/components/i18n/style-settings.fr-CA.json +32 -20
  545. package/src/shared/style-settings/components/i18n/style-settings.fr-FR.json +32 -20
  546. package/src/shared/style-settings/components/i18n/style-settings.json +13 -3
  547. package/src/shared/style-settings/components/i18n/style-settings.pt-BR.json +32 -20
  548. package/src/shared/style-settings/components/i18n/style-settings.pt-PT.json +32 -20
  549. package/src/shared/style-settings/components/text-style-options-settings-with-state/TextStyleOptionsSettingsWithState.vue +14 -34
  550. package/src/shared/style-settings/store/style-settings-store.ts +3 -49
  551. package/src/shared/style-settings/text-style-size-order.test.ts +76 -0
  552. package/src/shared/style-settings/text-style-size-order.ts +28 -0
  553. package/src/shared/template-settings/components/TemplatesSettings.vue +4 -0
  554. package/src/shared/text-role-typography.util.ts +277 -0
  555. package/src/utils/minify-brand-page-metadata.test.ts +102 -7
  556. package/src/utils/minify-brand-page-metadata.ts +62 -8
  557. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/AutoLink.d.ts +0 -2
  558. package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
  559. package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -63
  560. package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -106
  561. package/lib/src/brand-page-maker/utils/rte-shape.d.ts +0 -18
  562. package/lib/src/brand-page-maker/utils/rte-shape.js +0 -21
  563. package/lib/src/metadata-builder/builders/global-font-propagation.d.ts +0 -41
  564. package/lib/src/metadata-builder/builders/global-font-propagation.js +0 -146
  565. package/src/brand-page-maker/utils/rte-render.util.ts +0 -179
  566. package/src/brand-page-maker/utils/rte-shape.ts +0 -29
  567. package/src/metadata-builder/builders/global-font-propagation.test.ts +0 -401
  568. package/src/metadata-builder/builders/global-font-propagation.ts +0 -238
  569. package/src/shared/style-settings/components/StyleSettingsSection.vue +0 -8
  570. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.d.ts +0 -0
  571. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.js +0 -0
  572. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.d.ts +0 -0
  573. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.js +0 -0
  574. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.d.ts +0 -0
  575. /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.ts +0 -0
  576. /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 { resolveTextColor } from '@brand-page/utils/text-style.util';
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
- TEXT_STYLE_TYPES,
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
- textStyleTypeOptions: [
147
- {
148
- value: undefined,
149
- label: TEXT_STYLE_TYPES_DISPLAY_NAME_MAP().none,
150
- isSelected: false,
151
- },
152
- ...Object.keys(TEXT_STYLE_TYPES).map((key) => ({
153
- value: key,
154
- label:
155
- TEXT_STYLE_TYPES_DISPLAY_NAME_MAP()[key][0].toUpperCase() +
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
- return Object.assign({}, selectedTextStyleOption.style, {
214
- applyAutoScale: theValue.applyAutoScale,
215
- textAlign:
216
- selectedTextStyleOption.style.textAlign || theValue.textAlign,
217
- // `color` must follow the RENDERER's cascade (element first, then the global
218
- // style) or the panel shows one colour while the canvas paints another. It
219
- // also protects the handlers below, which all spread `selectedTextStyle`:
220
- // without it, editing e.g. font size replaces the element's colour with the
221
- // global one. Shared with the renderer via `resolveTextColor` — don't restate
222
- // the chain here, a second copy is how the two drifted apart. The
223
- // container-aware default is the resolver's middle rung (below the element
224
- // colour, above the global style), fed from the same helper the renderer uses.
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
- textStyleTypeDropdownTitle() {
321
- const selectedTextStyleTypeOption = this.textStyleTypeOptions.find(
322
- (x) => x.isSelected,
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
- if (selectedTextStyleTypeOption) {
326
- return (selectedTextStyleTypeOption as any).label;
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
- return TEXT_STYLE_TYPES_DISPLAY_NAME_MAP().none;
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
- const value: TextStyleDeclaration = {
341
- ...(backgroundColor === undefined ? filteredStyle : style),
342
- textAlign: style.textAlign!, //text align should never be empty (setting a textalign here causes text alignment changes when changing global text styles)
343
- textStyleType,
344
- };
345
-
346
- // Linking to a global style drops the element's own colour override: the
347
- // renderer resolves colour element-first (see resolveTextColor), so a colour
348
- // parked before the link would keep winning. Colours are the only element-first
349
- // properties, so nothing else needs clearing.
350
- if (textStyleType) {
351
- value.color = undefined;
352
- value.backgroundColor = undefined;
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.selectedTextStyle,
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.selectedTextStyle,
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.selectedTextStyle,
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 style's colour while typography stays
425
- // synced to the style. Written as a clean linked style (type, alignment,
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
- textStyleType: current.textStyleType,
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.selectedTextStyle,
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.selectedTextStyle,
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.selectedTextStyle,
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.selectedTextStyle,
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
- // Do NOT simplify to `option.value === value?.textStyleType`: the "none"
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
- class="tw-flex tw-gap-2 tw-cursor-pointer tw-justify-between"
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
- <Dropdown
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
- :ref="textStyleTypeDropdownRef"
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
- <DropdownItem
54
- v-for="option in textStyleTypeOptions"
55
- :key="option.value"
56
- @click="onSelectTextStyleType(option)"
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
- <span>{{ option.label }}</span>
59
- </DropdownItem>
60
- </Dropdown>
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
- Dropdown,
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>