@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
@@ -0,0 +1,434 @@
1
+ import { isLegacyTextStyleType, isCanonicalTextStyleType, CANONICAL_TEXT_STYLE_TYPES, } from '../models/styles.model';
2
+ import { CONTENT_TEXT_STYLE_PROPERTY_KEYS, DEFAULT_FONT_FAMILY_KEY, FONT_FAMILY_CONFIGS, FONT_SIZE_BODY, FONT_SIZE_HEADINGS, LINE_HEIGHT_BODY, LINE_HEIGHT_HEADINGS, TEXT_ROLE_STYLE_DEFAULTS, } from '../constants';
3
+ import { normalizeTextStyleAgainstRole } from './text-style.util';
4
+ import { isButtonContent } from './model.util';
5
+ import { isBlankColorValue } from './color-palette.util';
6
+ import { liftRteFieldOntoRole } from './rte-role-lift.util';
7
+ // Re-exported for migrations that already import the guard from here (a released migration's
8
+ // imports must not move) — render components import it from `styles.model.ts` directly.
9
+ export { isCanonicalTextStyleType };
10
+ const parseEm = (value) => {
11
+ if (!value)
12
+ return undefined;
13
+ const match = /([\d.]+)\s*em/.exec(value);
14
+ return match ? parseFloat(match[1]) : undefined;
15
+ };
16
+ // Exported so migration-22 job A2 votes onto the same tiers, rather than a second list of them.
17
+ export const HEADING_TIERS = CANONICAL_TEXT_STYLE_TYPES.filter((t) => t.startsWith('heading'));
18
+ export const PARAGRAPH_TIERS = CANONICAL_TEXT_STYLE_TYPES.filter((t) => t.startsWith('paragraph'));
19
+ export const FAMILY_TIERS = {
20
+ headings: HEADING_TIERS,
21
+ paragraphs: PARAGRAPH_TIERS,
22
+ button: ['button'],
23
+ };
24
+ // Above this em size a detached block reads as a heading, below it as body text.
25
+ const HEADING_SIZE_THRESHOLD_EM = 1.125;
26
+ export const nearestBySize = (size, tiers) => tiers.reduce((best, tier) => {
27
+ const diff = Math.abs((parseEm(TEXT_ROLE_STYLE_DEFAULTS[tier].fontSize) ?? 1) - size);
28
+ const bestDiff = Math.abs((parseEm(TEXT_ROLE_STYLE_DEFAULTS[best].fontSize) ?? 1) - size);
29
+ return diff < bestDiff ? tier : best;
30
+ }, tiers[0]);
31
+ export const computeLegacyTargets = (options) => {
32
+ const nearestHeading = (role, exclude) => {
33
+ const size = parseEm(options?.[role]?.style.fontSize);
34
+ if (size === undefined)
35
+ return undefined;
36
+ const tiers = exclude
37
+ ? HEADING_TIERS.filter((t) => t !== exclude)
38
+ : HEADING_TIERS;
39
+ return nearestBySize(size, tiers);
40
+ };
41
+ const titles = nearestHeading('titles') ?? 'heading1';
42
+ // Fallback must still respect the exclusion — a bare `?? 'heading4'` could collide with `titles`
43
+ // (its default mapping), and the colour seed relies on the two tiers being distinct.
44
+ const headings = nearestHeading('headings', titles) ??
45
+ HEADING_TIERS.find((t) => t !== titles) ??
46
+ 'heading4';
47
+ return { titles, headings, paragraphs: 'paragraph1', buttons: 'button' };
48
+ };
49
+ /**
50
+ * The role nearest a field's own font size: heading tiers for display-sized text, paragraph tiers
51
+ * for body, `paragraph1` when there is no size. A `paragraphs`-family field stays on a paragraph
52
+ * tier however big it is, so a site-wide heading edit never repaints it. `button` is never a best
53
+ * fit — a button field reaches it through its starting role or the retired `buttons` successor.
54
+ */
55
+ export const bestFitRole = (style, family) => {
56
+ const size = parseEm(style.fontSize);
57
+ if (size === undefined)
58
+ return 'paragraph1';
59
+ // Not bounded the other way: a small `headings`-family title still takes a paragraph tier, as
60
+ // migration-22's frozen output expects.
61
+ return size >= HEADING_SIZE_THRESHOLD_EM && family !== 'paragraphs'
62
+ ? nearestBySize(size, HEADING_TIERS)
63
+ : nearestBySize(size, PARAGRAPH_TIERS);
64
+ };
65
+ // A field on no role rendered its UNSET typography from inheritance — normal weight and style, no
66
+ // decoration, browser-default line-height/spacing — never from a role. The role class paints all
67
+ // of these, so each unset one is pinned to its effective value; the new role gives identity, not
68
+ // appearance. Family/size are left alone: they inherit from the page as before.
69
+ export const DETACHED_UNSET_EFFECTIVE = {
70
+ fontWeight: 'normal',
71
+ fontStyle: 'normal',
72
+ textDecoration: 'none',
73
+ lineHeight: 'normal',
74
+ letterSpacing: 'normal',
75
+ };
76
+ const LEGACY_TYPOGRAPHY_PROPS = [
77
+ 'fontFamily',
78
+ 'fontSize',
79
+ 'fontWeight',
80
+ 'fontStyle',
81
+ 'textDecoration',
82
+ 'lineHeight',
83
+ 'letterSpacing',
84
+ ];
85
+ const isUnset = (value) => value === undefined || value === null || value === '';
86
+ // The page root sets no font size, so an unsized field drew `1em` of its parent — which is what
87
+ // `1em` still means once the role class is in play.
88
+ const INHERITED_FONT_SIZE = '1em';
89
+ // Before the per-property cascade, a field on a role drew that role's typography and none of its
90
+ // own (`getTextStyleByContentTextStyleProperty` on origin/develop): each prop is replaced with the
91
+ // old role's value, else what the page gave it. Pure — returns a new object, the seven typography
92
+ // props only — so `drawnFontFamily` (R16) can read just the font this way, without mutating a
93
+ // field that migration-22 job A2 only counts, never rewrites.
94
+ const pinDrawnLook = (style, oldRoleStyle, inheritedFontFamily) => {
95
+ const pinned = { ...style };
96
+ const old = oldRoleStyle;
97
+ const inherited = {
98
+ ...DETACHED_UNSET_EFFECTIVE,
99
+ fontSize: INHERITED_FONT_SIZE,
100
+ fontFamily: inheritedFontFamily,
101
+ };
102
+ for (const prop of LEGACY_TYPOGRAPHY_PROPS) {
103
+ const value = isUnset(old[prop]) ? inherited[prop] : old[prop];
104
+ if (value === undefined)
105
+ delete pinned[prop];
106
+ else
107
+ pinned[prop] = value;
108
+ }
109
+ return pinned;
110
+ };
111
+ // Applied to RTE style objects too: migration-22 job C reads them as the block override it bakes
112
+ // onto bare runs (the renderer ignores RTE style-object typography — no double-em).
113
+ export const materialiseLegacyTypography = (style, oldRoleStyle, inheritedFontFamily) => {
114
+ const pinned = pinDrawnLook(style, oldRoleStyle, inheritedFontFamily);
115
+ const props = style;
116
+ for (const prop of LEGACY_TYPOGRAPHY_PROPS) {
117
+ if (prop in pinned)
118
+ props[prop] = pinned[prop];
119
+ else
120
+ delete props[prop];
121
+ }
122
+ };
123
+ const typographyOf = (style) => {
124
+ const props = (style ?? {});
125
+ return Object.fromEntries(LEGACY_TYPOGRAPHY_PROPS.map((prop) => [prop, props[prop]]));
126
+ };
127
+ const pinUnset = (style, values) => {
128
+ const props = style;
129
+ for (const [prop, value] of Object.entries(values ?? {})) {
130
+ if (isUnset(props[prop]) && value !== undefined)
131
+ props[prop] = value;
132
+ }
133
+ };
134
+ // Production's renderer drew an unset label line height as `LINE_HEIGHT_HEADINGS`, over the role
135
+ // (Brief 3 R3 deletes that default outright; this is the look to keep on upgrade).
136
+ const BUTTON_VIEW_MODEL_DEFAULTS = { lineHeight: LINE_HEIGHT_HEADINGS };
137
+ const BUTTON_VIEW_MODEL_SECTIONS = new Set([
138
+ 'banner-section',
139
+ 'booking-section',
140
+ 'images-section',
141
+ ]);
142
+ // Production's renderer drew these defaults for an unset profile size and line height (R3
143
+ // deletes them outright; this is the look to keep on upgrade).
144
+ const PROFILE_VIEW_MODEL_DEFAULTS = {
145
+ titleStyle: { fontSize: FONT_SIZE_BODY, lineHeight: LINE_HEIGHT_BODY },
146
+ descriptionStyle: { fontSize: FONT_SIZE_BODY, lineHeight: LINE_HEIGHT_BODY },
147
+ nameStyle: { fontSize: FONT_SIZE_HEADINGS, lineHeight: LINE_HEIGHT_HEADINGS },
148
+ };
149
+ export const BUTTON_ELEMENT_RECONNECT = {
150
+ startingRole: 'button',
151
+ family: 'button',
152
+ renderedDefaults: BUTTON_VIEW_MODEL_DEFAULTS,
153
+ };
154
+ // The kind of text each field holds, mirroring the pipeline's field → font slot map
155
+ // (font_generation.py `_DEFAULT_FIELD_TO_SLOT`: h1–h4 are headings, body and caption paragraphs).
156
+ // A field outside the map has no family, so only its size picks its tier. That includes a text
157
+ // section's `textStyle` and `textItems`: real sites set heading-sized text blocks, and moving them
158
+ // off heading tiers would change migration-22's frozen output.
159
+ const KEY_FAMILIES = {
160
+ titleStyle: 'headings',
161
+ headingStyle: 'headings',
162
+ nameStyle: 'headings',
163
+ descriptionStyle: 'paragraphs',
164
+ paragraphStyle: 'paragraphs',
165
+ successMessageStyle: 'paragraphs',
166
+ testimonialStyle: 'paragraphs',
167
+ positionStyle: 'paragraphs',
168
+ };
169
+ /**
170
+ * The reconnect spec for one content style field. Every button element starts on Button text and
171
+ * keeps what makes it different as overrides (James Joung, 2026-09-28): a section's
172
+ * `buttonTextStyle` and a link button's `titleStyle`.
173
+ */
174
+ export const contentFieldReconnectSpec = (contentType, key) => {
175
+ if (key === 'buttonTextStyle') {
176
+ return {
177
+ startingRole: 'button',
178
+ family: 'button',
179
+ renderedDefaults: BUTTON_VIEW_MODEL_SECTIONS.has(contentType ?? '')
180
+ ? BUTTON_VIEW_MODEL_DEFAULTS
181
+ : undefined,
182
+ };
183
+ }
184
+ if (key === 'titleStyle' && isButtonContent({ type: contentType }))
185
+ return BUTTON_ELEMENT_RECONNECT;
186
+ const family = KEY_FAMILIES[key];
187
+ if (contentType === 'profile')
188
+ return { family, renderedDefaults: PROFILE_VIEW_MODEL_DEFAULTS[key] };
189
+ return { family };
190
+ };
191
+ /**
192
+ * The font a field's own value shows, read the same way as the reconnect's look pin
193
+ * (`pinDrawnLook`), before its role's cascade would replace it (R16, migration-22 job A2, which
194
+ * only counts this — never mutates the field). A legacy role's font wins over the field's own, as
195
+ * production drew it; with no old role (undefined, `'none'`, an unknown string, or a retired role
196
+ * missing from the site's options) the field's own font wins, else the site's. A canonical role —
197
+ * which A2's input never holds — draws its own font, else the role's, else the site's.
198
+ */
199
+ export const drawnFontFamily = (style, options, siteFont) => {
200
+ const props = (style ?? {});
201
+ const type = props.textStyleType;
202
+ const ownFont = props.fontFamily;
203
+ if (isCanonicalTextStyleType(type)) {
204
+ const roleFont = options?.[type]?.style?.fontFamily;
205
+ return ownFont || roleFont || siteFont;
206
+ }
207
+ const retired = isLegacyTextStyleType(type)
208
+ ? type
209
+ : undefined;
210
+ const oldRoleStyle = retired ? options?.[retired]?.style : undefined;
211
+ if (!oldRoleStyle)
212
+ return ownFont || siteFont;
213
+ const pinned = pinDrawnLook(props, oldRoleStyle, siteFont);
214
+ return pinned.fontFamily ?? siteFont;
215
+ };
216
+ /**
217
+ * Reconnect one style to a canonical role, keeping its look. A canonical role is returned as is.
218
+ * Otherwise the role is `startingRole ?? (retired ? its successor : nearest by size)`, the look is
219
+ * pinned, and values equal to the new role are dropped, so only a real difference remains as an
220
+ * override. The look is the retired role's typography where that role replaced the field's own
221
+ * (`drawnBeforeCascade`); else the field's own values, then a renderer's defaults, then the old
222
+ * role's or the inherited values.
223
+ */
224
+ export const reconnectTextStyle = (style, targets, options, spec = {}) => {
225
+ const type = style.textStyleType;
226
+ if (isCanonicalTextStyleType(type))
227
+ return style;
228
+ const reconnected = { ...style };
229
+ const retired = isLegacyTextStyleType(type)
230
+ ? type
231
+ : undefined;
232
+ // From the stored size, before any pin: a field with no size of its own goes to Paragraph 1.
233
+ const role = spec.startingRole ??
234
+ (retired ? targets[retired] : bestFitRole(reconnected, spec.family));
235
+ const oldRoleStyle = retired ? options?.[retired]?.style : undefined;
236
+ if (oldRoleStyle && spec.drawnBeforeCascade) {
237
+ materialiseLegacyTypography(reconnected, oldRoleStyle, spec.inheritedFontFamily);
238
+ }
239
+ else {
240
+ pinUnset(reconnected, spec.renderedDefaults);
241
+ pinUnset(reconnected, typographyOf(oldRoleStyle));
242
+ pinUnset(reconnected, DETACHED_UNSET_EFFECTIVE);
243
+ if (!oldRoleStyle) {
244
+ pinUnset(reconnected, {
245
+ fontSize: INHERITED_FONT_SIZE,
246
+ fontFamily: spec.inheritedFontFamily,
247
+ });
248
+ }
249
+ }
250
+ reconnected.textStyleType = role;
251
+ const normalized = normalizeTextStyleAgainstRole(reconnected, options);
252
+ const kept = normalized;
253
+ // Where a renderer default beats the role, a value equal to the role still differs from what an
254
+ // unset prop would draw, so it stays.
255
+ for (const [prop, drawnDefault] of Object.entries(spec.renderedDefaults ?? {})) {
256
+ const value = reconnected[prop];
257
+ if (!isUnset(value) && value !== drawnDefault)
258
+ kept[prop] = value;
259
+ }
260
+ // A neutral (normal / none) the new role leaves unset draws the same unpinned, and unpinned a
261
+ // later role edit still reaches the field; keep it only where the role defines that prop.
262
+ const roleStyle = options?.[role]?.style;
263
+ for (const [prop, neutral] of Object.entries(DETACHED_UNSET_EFFECTIVE)) {
264
+ if (kept[prop] === neutral &&
265
+ isUnset(roleStyle?.[prop]) &&
266
+ !(prop in (spec.renderedDefaults ?? {}))) {
267
+ delete kept[prop];
268
+ }
269
+ }
270
+ return normalized;
271
+ };
272
+ // A role's colour, read defensively: the typed property is retired.
273
+ const roleColourOf = (options, role) => options[role]?.style?.color;
274
+ // A linked nav link draws `element || #000000` (`getTextStyleByContentTextStyle`). One with no colour
275
+ // of its own drew its legacy role's colour, or on no role inherited its parent's: for a tab the
276
+ // header's colour, else the page base coat (the paragraphs colour); for the hamburger menu, which
277
+ // renders beside the header under the page root (`Page.vue`), the base coat. That colour is kept
278
+ // before the link. Role colours are only still present during migration-22; later, only the
279
+ // header's colour is left to inherit.
280
+ const keepNavLinkColour = (style, options, headerColour) => {
281
+ if (!style || typeof style !== 'object')
282
+ return;
283
+ const props = style;
284
+ const type = props.textStyleType;
285
+ if (!isBlankColorValue(props.color))
286
+ return;
287
+ if (isCanonicalTextStyleType(type))
288
+ return;
289
+ const colour = isLegacyTextStyleType(type)
290
+ ? roleColourOf(options, type)
291
+ : headerColour || roleColourOf(options, 'paragraphs');
292
+ if (!isBlankColorValue(colour))
293
+ props.color = colour;
294
+ };
295
+ // `isTiptapDocument`, which lives maker-side.
296
+ const isTiptapDoc = (value) => typeof value === 'object' &&
297
+ value !== null &&
298
+ value.type === 'doc';
299
+ // The sections whose success message now draws from its own `successMessageStyle`: the payment
300
+ // block (`Payment.vue`) and the shop checkout (`PaymentModal.vue`).
301
+ const SUCCESS_MESSAGE_TYPES = new Set([
302
+ 'support-me',
303
+ 'request-payment',
304
+ 'shop-section',
305
+ ]);
306
+ // Before BP-5969 neither renderer drew `successMessageStyle`, so one on no canonical role (the
307
+ // old maker editor's `{ textAlign }`) is treated as absent (James Joung, 2026-09-28).
308
+ const seedsSuccessMessageStyle = (fields) => SUCCESS_MESSAGE_TYPES.has(fields.type) &&
309
+ !isCanonicalTextStyleType(fields.successMessageStyle?.textStyleType);
310
+ // What the shop checkout drew its message with: the drawn (pre-reconnect) description's colour,
311
+ // less the container rung the shop lacks. On no role it drew `inherit`, which fe-shared-lib's `Modal`
312
+ // passes to the page root's Paragraphs colour (`Page.mixin` `rootElementStyles`), seeded onto
313
+ // Paragraph 1. Role colours are only still present during migration-22.
314
+ const shopSuccessMessageColour = (drawnDescription, options) => drawnDescription?.color ||
315
+ roleColourOf(options, drawnDescription?.textStyleType) ||
316
+ roleColourOf(options, 'paragraphs');
317
+ /**
318
+ * Give a success message the look it drew, on a role of its own (James Joung, 2026-09-28). The
319
+ * payment block drew it with its description's style, so it gets a copy of the reconnected
320
+ * description. With no description, and in the shop checkout (which took only the description's
321
+ * colour), it drew the page defaults, so it starts on Paragraph 2 keeping them, and the shop keeps
322
+ * that colour. A rich-text message drew only its runs and the page (`TextWrapper` gives rich text no
323
+ * typography from its style object), so on migration-22's input it keeps the page defaults on the
324
+ * description's role, lifted onto its runs: the render fill reads a neutral block value as "follow
325
+ * the role".
326
+ */
327
+ const seedSuccessMessageStyle = (fields, drawnDescription, options, reconnectAt, walk) => {
328
+ const description = fields.descriptionStyle;
329
+ const isShop = fields.type === 'shop-section';
330
+ const drewPageDefaults = !!walk.drawnBeforeCascade && isTiptapDoc(fields.successMessage);
331
+ if (!isShop &&
332
+ !drewPageDefaults &&
333
+ description &&
334
+ typeof description === 'object') {
335
+ fields.successMessageStyle = { ...description };
336
+ return;
337
+ }
338
+ const colour = isShop
339
+ ? shopSuccessMessageColour(drawnDescription, options)
340
+ : description?.color;
341
+ const descriptionRole = description?.textStyleType;
342
+ fields.successMessageStyle = isBlankColorValue(colour)
343
+ ? {}
344
+ : { color: colour };
345
+ reconnectAt(fields, 'successMessageStyle', {
346
+ startingRole: !isShop && isCanonicalTextStyleType(descriptionRole)
347
+ ? descriptionRole
348
+ : 'paragraph2',
349
+ });
350
+ if (drewPageDefaults) {
351
+ liftRteFieldOntoRole(fields.successMessage, fields.successMessageStyle, options);
352
+ }
353
+ };
354
+ // The font the v21 page root drew: the retired site text font, else the default. Only migration-22
355
+ // reads it (jobs A2 and B), before its last job deletes the field (`0036-retire-text-font-family.md`).
356
+ export const siteTextFontName = (brandPageModel) => {
357
+ const textStyles = brandPageModel.styles?.textStyles;
358
+ const textFontFamily = (textStyles?.['textFontFamily'] ||
359
+ DEFAULT_FONT_FAMILY_KEY);
360
+ return FONT_FAMILY_CONFIGS[textFontFamily]?.name;
361
+ };
362
+ /**
363
+ * Reconnect every persisted text field outside the ten, in place: content style keys (each with
364
+ * `contentFieldReconnectSpec`) and `textItems[].textStyle`, then per viewport the footer copyright,
365
+ * the nav tabs (starting role `paragraph1`), the hamburger menu (`button`) and the header button
366
+ * (`button`), then the Save Contact button (`button`). An unset family keeps the site text font.
367
+ * A payment or shop success message with no role of its own gets the look it drew
368
+ * (`seedSuccessMessageStyle`). Otherwise a no-op on canonical data.
369
+ */
370
+ export const reconnectTextStyleRoles = (brandPageModel, targets, options, walk = {}) => {
371
+ const inheritedFontFamily = siteTextFontName(brandPageModel);
372
+ const reconnectAt = (holder, key, spec = {}) => {
373
+ const style = holder?.[key];
374
+ if (!holder || !style || typeof style !== 'object')
375
+ return;
376
+ const renderedDefaults = walk.renderedDefaultsForContent?.(holder, key);
377
+ holder[key] = reconnectTextStyle(style, targets, options, {
378
+ ...spec,
379
+ drawnBeforeCascade: walk.drawnBeforeCascade,
380
+ renderedDefaults: {
381
+ ...spec.renderedDefaults,
382
+ ...renderedDefaults,
383
+ },
384
+ inheritedFontFamily,
385
+ });
386
+ };
387
+ const styleKeys = Object.keys(CONTENT_TEXT_STYLE_PROPERTY_KEYS);
388
+ for (const page of brandPageModel.pages ?? []) {
389
+ for (const content of page.contents ?? []) {
390
+ const fields = content;
391
+ const seedsSuccessMessage = seedsSuccessMessageStyle(fields);
392
+ // The reconnect replaces the style object, so this stays the description as it was drawn.
393
+ const drawnDescription = fields.descriptionStyle;
394
+ if (seedsSuccessMessage)
395
+ delete fields.successMessageStyle;
396
+ for (const key of styleKeys) {
397
+ reconnectAt(fields, key, contentFieldReconnectSpec(fields.type, key));
398
+ }
399
+ if (seedsSuccessMessage) {
400
+ seedSuccessMessageStyle(fields, drawnDescription, options, reconnectAt, walk);
401
+ }
402
+ const textItems = fields.textItems;
403
+ if (Array.isArray(textItems)) {
404
+ for (const item of textItems) {
405
+ if (item && typeof item === 'object') {
406
+ reconnectAt(item, 'textStyle');
407
+ }
408
+ }
409
+ }
410
+ }
411
+ }
412
+ for (const footer of [
413
+ brandPageModel.pageFooterDesktop,
414
+ brandPageModel.pageFooterMobile,
415
+ ]) {
416
+ reconnectAt(footer, 'copyrightStyle');
417
+ }
418
+ for (const header of [
419
+ brandPageModel.pageHeaderDesktop,
420
+ brandPageModel.pageHeaderMobile,
421
+ ]) {
422
+ const navigation = header?.navigation;
423
+ const headerColour = header?.style
424
+ ?.color;
425
+ keepNavLinkColour(navigation?.defaultButtonStyle, options, headerColour);
426
+ keepNavLinkColour(navigation?.hamburgerMenuStyle?.defaultButtonStyle, options, undefined);
427
+ reconnectAt(navigation, 'defaultButtonStyle', {
428
+ startingRole: 'paragraph1',
429
+ });
430
+ reconnectAt(navigation?.hamburgerMenuStyle, 'defaultButtonStyle', { startingRole: 'button' });
431
+ reconnectAt(header?.headerButton, 'buttonTextStyle', BUTTON_ELEMENT_RECONNECT);
432
+ }
433
+ reconnectAt(brandPageModel.saveContactSettings, 'buttonTextStyle', { startingRole: 'button' });
434
+ };
@@ -1,35 +1,65 @@
1
1
  /**
2
2
  * The element ↔ global-text-style resolution rules, in ONE place.
3
3
  *
4
- * Deliberately a leaf module with no imports so both the renderer
5
- * (`view-model.util.ts`) and the maker's Text Style panel can consume it. They
6
- * resolved colour independently and drifted, so the sidebar contradicted the canvas —
7
- * import from here rather than restating the chain.
4
+ * A near-leaf module: its only dependency is the role model (`styles.model`, a lower-level
5
+ * module with no back-edge to here, so no cycle). Both the renderer (`view-model.util.ts`) and
6
+ * the maker's Text Style panel consume it — they resolved colour independently and drifted, so
7
+ * the sidebar contradicted the canvas — import from here rather than restating the chain.
8
+ *
9
+ * MIGRATION-22 SNAPSHOT DEPENDENCY: `normalizeTextStyleAgainstRole` is called by its reconnect
10
+ * path. Do not change normalisation semantics after migration-22 releases without first pinning
11
+ * that migration's implementation.
8
12
  */
13
+ import { type TextStyleOptions } from '../models/styles.model';
14
+ import { type CascadeTypographyProp } from '@shared/text-role-typography.util';
15
+ export { type CascadeTypographyProp, composeTextDecoration, NEUTRAL_TYPOGRAPHY_VALUE, rteTextDecorationClassName, TEXT_STYLE_CASCADE_PROPS, } from '@shared/text-role-typography.util';
16
+ export { omitTypography, pickTypography, } from '@shared/text-role-typography.util';
9
17
  interface ColouredStyle {
10
18
  color?: string;
11
19
  }
12
20
  /**
13
- * **`color` cascades; typography does not.** A global text style
14
- * (`textStyleOptions[type]`) is only a *default* for colour: the element's own
15
- * `color` wins. Every other property still comes from the global style wholesale —
16
- * that all-or-nothing behaviour is deliberately unchanged, so don't "fix" the
17
- * inconsistency by reverting this; the resolution is to make every property cascade.
18
- *
19
- * The **site-wide default** (`textStyleOptions.paragraphs.style.color`) is
20
- * deliberately NOT in this chain — it reaches the text by CSS inheritance from the
21
- * root element (`Page.mixin.ts` → `rootElementStyles`). So `undefined` here validly
22
- * means "inherit", and mappers must not pre-seed the site default into an element
23
- * style (it would read as an element override and beat the global text style).
21
+ * BP-5969 (ADR-0020): **a role no longer contributes colour** — a text role defines
22
+ * typography only. Colour resolves element-first, then an optional container middle
23
+ * rung; with neither set it falls to the page base coat by CSS inheritance from the
24
+ * root element (`Page.mixin.ts` → `rootElementStyles`), so `undefined` here validly
25
+ * means "inherit" and mappers must not pre-seed a default into an element style.
24
26
  *
25
27
  * Empty-string is treated as unset (`||`, not `??`) — a cleared colour field falls
26
- * back to the global style rather than painting an invalid value.
28
+ * through rather than painting an invalid value.
29
+ *
30
+ * `fallbackBeforeGlobal` is the container middle rung: a context-derived default that
31
+ * wins over the base coat but still yields to an explicit element colour. Only
32
+ * container-bound blocks supply it (text on the block's own filled surface must
33
+ * contrast that surface, not the page — see `container-text-color.util.ts`).
34
+ */
35
+ export declare const resolveTextColor: (elementStyle: ColouredStyle | undefined, fallbackBeforeGlobal?: string) => string | undefined;
36
+ /**
37
+ * BP-5969 (ADR-0019) — the WRITE-side mirror of `overrideTypographyStyle`: drop any typography
38
+ * override equal to the block's linked role, so the persisted style stays a sparse diff and a later
39
+ * role edit repaints the block via the page-scoped role CSS. Colour, alignment and `applyAutoScale`
40
+ * are untouched. No-op for a non-style value, a legacy/unlinked role (no role class to fall back
41
+ * on), or an absent role table — the value passes through unchanged.
42
+ *
43
+ * Pure: the caller supplies the role table, so the maker store and the AI metadata builder share
44
+ * one normalization authority instead of drifting.
45
+ */
46
+ export declare const normalizeTextStyleAgainstRole: <T>(value: T, textStyleOptions: TextStyleOptions | undefined) => T;
47
+ type TypographyStyle = Partial<Record<CascadeTypographyProp, string | undefined>> & ColouredStyle;
48
+ export declare const resolveTextStyle: <R extends TypographyStyle, E extends TypographyStyle>(elementStyle: E | undefined, roleStyle: R | undefined, fallbackBeforeGlobal?: string) => TypographyStyle;
49
+ /**
50
+ * BP-5969 (ADR-0019, Option B) — the render-time inverse of `resolveTextStyle`.
51
+ * The role's typography is supplied by a page-scoped CSS class (`text-role-css.util`),
52
+ * so a linked block must inline ONLY the props that DIFFER from its role — those beat
53
+ * the class by specificity; the rest fall through to the class, and editing the role
54
+ * repaints them for free. Colour is deliberately absent (it isn't in the class — it
55
+ * stays on its own cascade / on RTE marks).
56
+ *
57
+ * `roleStyle` undefined (no role in scope, or a non-canonical/unlinked block) returns
58
+ * every present typography prop — i.e. the caller bakes the full resolved style inline,
59
+ * exactly as before this change. That is the safe fallback: the render stays
60
+ * pixel-identical when the role isn't visible to the renderer.
27
61
  *
28
- * `fallbackBeforeGlobal` is an optional middle rung: a context-derived default that
29
- * wins over the global style but still yields to an explicit element colour. Only
30
- * container-bound blocks supply it (text sitting on the block's own filled surface
31
- * must contrast that surface, not the page — see `container-text-color.util.ts`).
32
- * Omitting it is byte-for-byte the original two-rung cascade.
62
+ * Empty-string / null are treated as unset (matching the `||` in the resolvers), and
63
+ * `'0'` (a valid letter-spacing) stays.
33
64
  */
34
- export declare const resolveTextColor: (elementStyle: ColouredStyle | undefined, globalStyle: ColouredStyle | undefined, fallbackBeforeGlobal?: string) => string | undefined;
35
- export {};
65
+ export declare const overrideTypographyStyle: (resolvedStyle: TypographyStyle | undefined, roleStyle: TypographyStyle | undefined) => Partial<Record<CascadeTypographyProp, string>>;