@designcrowd/library.brand-page 6.2.11-builder-v2-1 → 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 (579) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-Dg2pOwbr.js → CreatedOnBrandCrowd-de-de-BtVKllNQ.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BILs_hsB.js → CreatedOnBrandCrowd-en-us-CX5V0v8u.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-VpxQ0N5F.js → CreatedOnBrandCrowd-es-es-CbA02PCL.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-CFHWRHzi.js → CreatedOnBrandCrowd-fr-ca-BQAKruBF.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-CFHWRHzi.js → CreatedOnBrandCrowd-fr-fr-BQAKruBF.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-CZfs45s9.js → CreatedOnBrandCrowd-pt-br-Yk_yzB3s.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-CZfs45s9.js → CreatedOnBrandCrowd-pt-pt-Yk_yzB3s.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-DYMQ6sIF.js → CreatedOnDcom-de-de-DJZQbPSD.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-Dj5sdPid.js → CreatedOnDcom-en-us-BJvNAa4l.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-Cx9yNTro.js → CreatedOnDcom-es-es-CUwB1FRY.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-Bzr0SjGq.js → CreatedOnDcom-fr-ca-CK54U4oh.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-BgqKY35F.js → CreatedOnDcom-fr-fr-DuUNBGrM.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CXK6qfvL.js → CreatedOnDcom-pt-br-BfODpFNV.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-B8SggNTQ.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/brand-page-context.model.d.ts +2 -0
  39. package/lib/src/brand-page/models/brand-page-context.model.js +7 -0
  40. package/lib/src/brand-page/models/index.d.ts +23 -24
  41. package/lib/src/brand-page/models/index.js +20 -7
  42. package/lib/src/brand-page/models/navigation-styles.model.d.ts +1 -1
  43. package/lib/src/brand-page/models/navigation-styles.model.js +17 -8
  44. package/lib/src/brand-page/models/payment.model.d.ts +11 -6
  45. package/lib/src/brand-page/models/styles.model.d.ts +53 -7
  46. package/lib/src/brand-page/models/styles.model.js +115 -27
  47. package/lib/src/brand-page/utils/color-palette.util.d.ts +43 -23
  48. package/lib/src/brand-page/utils/color-palette.util.js +65 -27
  49. package/lib/src/brand-page/utils/color.util.d.ts +13 -9
  50. package/lib/src/brand-page/utils/color.util.js +56 -15
  51. package/lib/src/brand-page/utils/container-text-color.util.d.ts +46 -13
  52. package/lib/src/brand-page/utils/container-text-color.util.js +321 -41
  53. package/lib/src/brand-page/utils/index.d.ts +1 -0
  54. package/lib/src/brand-page/utils/index.js +1 -0
  55. package/lib/src/brand-page/utils/migration/migration-20.js +6 -2
  56. package/lib/src/brand-page/utils/migration/migration-21.js +34 -6
  57. package/lib/src/brand-page/utils/migration/migration-22.d.ts +99 -0
  58. package/lib/src/brand-page/utils/migration/migration-22.js +909 -0
  59. package/lib/src/brand-page/utils/migration.util.js +17 -0
  60. package/lib/src/brand-page/utils/model.util.d.ts +4 -0
  61. package/lib/src/brand-page/utils/model.util.js +4 -0
  62. package/lib/src/brand-page/utils/personalisation.util.js +9 -1
  63. package/lib/src/brand-page/utils/rte-role-lift.util.d.ts +72 -0
  64. package/lib/src/brand-page/utils/rte-role-lift.util.js +275 -0
  65. package/lib/src/brand-page/utils/style.util.d.ts +5 -1
  66. package/lib/src/brand-page/utils/style.util.js +34 -11
  67. package/lib/src/brand-page/utils/text-role-css.util.d.ts +19 -0
  68. package/lib/src/brand-page/utils/text-role-css.util.js +186 -0
  69. package/lib/src/brand-page/utils/text-role-reconnect.util.d.ts +90 -0
  70. package/lib/src/brand-page/utils/text-role-reconnect.util.js +434 -0
  71. package/lib/src/brand-page/utils/text-style.util.d.ts +53 -23
  72. package/lib/src/brand-page/utils/text-style.util.js +122 -22
  73. package/lib/src/brand-page/utils/view-model.util.d.ts +9 -1
  74. package/lib/src/brand-page/utils/view-model.util.js +124 -111
  75. package/lib/src/brand-page/view-models.d.ts +1 -0
  76. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +4 -1
  77. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +34 -2
  78. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +4 -4
  79. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +4 -1
  80. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -10
  81. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.js +0 -1
  82. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +44 -138
  83. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -28
  84. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +4 -1
  85. package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +1 -1
  86. package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +7 -0
  87. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +21 -0
  88. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +25 -1
  89. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +25 -1
  90. package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +21 -0
  91. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +4 -1
  92. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +25 -1
  93. package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +21 -0
  94. package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.d.ts +10 -0
  95. package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.js +11 -0
  96. package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
  97. package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
  98. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +14 -0
  99. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.d.ts +16 -0
  100. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.js +61 -0
  101. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.d.ts +11 -0
  102. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.js +236 -0
  103. package/lib/src/brand-page-maker/composables/rich-text-editor/font.d.ts +2 -1
  104. package/lib/src/brand-page-maker/composables/rich-text-editor/font.js +25 -6
  105. package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.d.ts +17 -4
  106. package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.js +204 -17
  107. package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +1 -1
  108. package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +29 -31
  109. package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.d.ts +20 -0
  110. package/lib/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.js +60 -0
  111. package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.d.ts +2 -1
  112. package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.js +22 -6
  113. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +10 -4
  114. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +319 -275
  115. package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -5
  116. package/lib/src/brand-page-maker/convertors/text-css-style-options.convertor.js +6 -2
  117. package/lib/src/brand-page-maker/convertors/text-size-value.convertor.d.ts +1 -1
  118. package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
  119. package/lib/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.js +7 -14
  120. package/lib/src/brand-page-maker/default-getters/text-color.default-getter.js +6 -13
  121. package/lib/src/brand-page-maker/models/content-settings.d.ts +8 -0
  122. package/lib/src/brand-page-maker/models/content-settings.js +112 -81
  123. package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.d.ts +2 -2
  124. package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.js +5 -2
  125. package/lib/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.js +4 -3
  126. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1257 -117
  127. package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.d.ts +9 -2
  128. package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.js +20 -0
  129. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +21 -0
  130. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +6 -1
  131. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +17 -9
  132. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +59 -5
  133. package/lib/src/brand-page-maker/stores/history/history-store.js +22 -2
  134. package/lib/src/brand-page-maker/utils/apply-color-strategy.js +26 -8
  135. package/lib/src/brand-page-maker/utils/index.d.ts +2 -1
  136. package/lib/src/brand-page-maker/utils/index.js +2 -1
  137. package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +117 -15
  138. package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +435 -281
  139. package/lib/src/brand-page-maker/utils/rte-authoring.util.d.ts +4 -0
  140. package/lib/src/brand-page-maker/utils/rte-authoring.util.js +101 -0
  141. package/lib/src/brand-page-maker/utils/rte-clipboard.util.d.ts +126 -0
  142. package/lib/src/brand-page-maker/utils/rte-clipboard.util.js +307 -0
  143. package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +13 -3
  144. package/lib/src/{bundled-translations-zfiA5Tsw.js → bundled-translations-yGrvPE5i.js} +17 -17
  145. package/lib/src/{bundled-translations.de-DE-ChsdSyAP.js → bundled-translations.de-DE-L4Znf8Hs.js} +17 -17
  146. package/lib/src/{bundled-translations.es-ES-DflsWQK0.js → bundled-translations.es-ES-D6iticrK.js} +15 -15
  147. package/lib/src/{bundled-translations.fr-CA-fpDRuZ52.js → bundled-translations.fr-CA-BgAVE-9k.js} +25 -25
  148. package/lib/src/{bundled-translations.fr-FR-Bub73Zt-.js → bundled-translations.fr-FR-B8GbyqxQ.js} +17 -17
  149. package/lib/src/{bundled-translations.pt-BR-BlnWE9TB.js → bundled-translations.pt-BR-DjPU3Db7.js} +25 -25
  150. package/lib/src/{bundled-translations.pt-PT-DmzXlnaS.js → bundled-translations.pt-PT-BaepaDpr.js} +23 -23
  151. package/lib/src/bundles/bundled-translations.de-DE.json +21 -2
  152. package/lib/src/bundles/bundled-translations.es-ES.json +21 -2
  153. package/lib/src/bundles/bundled-translations.fr-CA.json +21 -2
  154. package/lib/src/bundles/bundled-translations.fr-FR.json +21 -2
  155. package/lib/src/bundles/bundled-translations.json +21 -2
  156. package/lib/src/bundles/bundled-translations.pt-BR.json +21 -2
  157. package/lib/src/bundles/bundled-translations.pt-PT.json +21 -2
  158. package/lib/src/clients/ai-assistant-client.d.ts +7 -1
  159. package/lib/src/clients/ai-assistant-client.js +7 -15
  160. package/lib/src/composables/useTranslate.d.ts +1 -1
  161. package/lib/src/composables/useTranslate.js +1 -1
  162. package/lib/src/css/library.brand-page-brandCrowd.min.css +284 -188
  163. package/lib/src/css/library.brand-page-brandPage.min.css +284 -188
  164. package/lib/src/css/library.brand-page-designCom.min.css +284 -188
  165. package/lib/src/css/library.brand-page-preview.min.css +284 -188
  166. package/lib/src/index.d.ts +2 -1
  167. package/lib/src/index.mjs +195 -191
  168. package/lib/src/{lib-7gtW85nE.js → lib-kGRlD3_P.js} +39082 -36131
  169. package/lib/src/lib.js +2 -1
  170. package/lib/src/metadata-builder/builders/footer-builder.js +4 -5
  171. package/lib/src/metadata-builder/builders/global-role-propagation.d.ts +58 -0
  172. package/lib/src/metadata-builder/builders/global-role-propagation.js +246 -0
  173. package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +1 -0
  174. package/lib/src/metadata-builder/builders/global-styles-builder.js +116 -45
  175. package/lib/src/metadata-builder/builders/header-builder.js +13 -4
  176. package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +3 -3
  177. package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +3 -3
  178. package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +3 -3
  179. package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +4 -4
  180. package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +3 -3
  181. package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +2 -2
  182. package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +2 -2
  183. package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +4 -4
  184. package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +3 -3
  185. package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +8 -2
  186. package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +2 -2
  187. package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +60 -29
  188. package/lib/src/metadata-builder/builders/section-field-maps.js +1 -0
  189. package/lib/src/metadata-builder/builders/section-field-utils.d.ts +48 -19
  190. package/lib/src/metadata-builder/builders/section-field-utils.js +128 -52
  191. package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +4 -2
  192. package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +28 -12
  193. package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +5 -1
  194. package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +1 -1
  195. package/lib/src/metadata-builder/helpers/rte.helpers.js +97 -40
  196. package/lib/src/metadata-builder/metadata-executor.js +23 -1
  197. package/lib/src/metadata-builder/models.d.ts +2 -0
  198. package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +18 -19
  199. package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +18 -1
  200. package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +1 -1
  201. package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +0 -1
  202. package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +5 -8
  203. package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +7 -16
  204. package/lib/src/metadata-builder/sanitizers/section-args-validator.js +95 -22
  205. package/lib/src/shared/color-palette/section-color-matches.js +9 -25
  206. package/lib/src/shared/color-strategies/color-strategies.d.ts +15 -0
  207. package/lib/src/shared/color-strategies/color-strategies.js +31 -0
  208. package/lib/src/shared/color-strategies/rte-color.d.ts +8 -0
  209. package/lib/src/shared/color-strategies/rte-color.js +16 -0
  210. package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +23 -0
  211. package/lib/src/shared/color-strategies/rte-field-pairs.js +28 -0
  212. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +9 -135
  213. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -27
  214. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +12 -2
  215. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +7 -0
  216. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +75 -6
  217. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +18 -7
  218. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +6 -1
  219. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -7
  220. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +22 -0
  221. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +8 -4
  222. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1255 -26
  223. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +203 -59
  224. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +6 -0
  225. package/lib/src/shared/content-settings/store/content-settings-store.js +105 -8
  226. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +26 -1
  227. package/lib/src/shared/navigation-style-settings/store/index.d.ts +7 -3
  228. package/lib/src/shared/navigation-style-settings/store/index.js +40 -15
  229. package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -0
  230. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +38 -5
  231. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +91 -13
  232. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +10 -2
  233. package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -1
  234. package/lib/src/shared/page-settings/store/page-settings-store.js +17 -0
  235. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +32 -1
  236. package/lib/src/shared/rte-extensions/AutoLink.d.ts +17 -0
  237. package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.js +67 -51
  238. package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.js +4 -1
  239. package/lib/src/shared/rte-extensions/TextEffects.d.ts +28 -0
  240. package/lib/src/shared/rte-extensions/TextEffects.js +96 -0
  241. package/lib/src/shared/rte-extensions/ViewDomParser.d.ts +2 -0
  242. package/lib/src/shared/rte-extensions/ViewDomParser.js +21 -0
  243. package/lib/src/shared/rte-extensions.util.d.ts +25 -0
  244. package/lib/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.js → shared/rte-extensions.util.js} +62 -7
  245. package/lib/src/shared/rte-link.util.d.ts +1 -0
  246. package/lib/src/shared/rte-link.util.js +1 -0
  247. package/lib/src/shared/rte-render.util.d.ts +112 -0
  248. package/lib/src/shared/rte-render.util.js +255 -0
  249. package/lib/src/shared/rte-shape.util.d.ts +6 -0
  250. package/lib/src/shared/rte-shape.util.js +18 -0
  251. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +23 -1
  252. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
  253. package/lib/src/shared/side-bar/store/side-bar-store.d.ts +2 -0
  254. package/lib/src/shared/side-bar/store/side-bar-store.js +9 -0
  255. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +176 -15
  256. package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +7 -1
  257. package/lib/src/shared/style-settings/store/style-settings-store.d.ts +1 -9
  258. package/lib/src/shared/style-settings/store/style-settings-store.js +3 -33
  259. package/lib/src/shared/style-settings/text-style-size-order.d.ts +2 -0
  260. package/lib/src/shared/style-settings/text-style-size-order.js +13 -0
  261. package/lib/src/shared/text-role-typography.util.d.ts +64 -0
  262. package/lib/src/shared/text-role-typography.util.js +183 -0
  263. package/lib/src/utils/minify-brand-page-metadata.d.ts +16 -1
  264. package/lib/src/utils/minify-brand-page-metadata.js +31 -9
  265. package/package.json +1 -1
  266. package/src/brand-page/__fixtures__/migration-22-v21/edited-brandsite-sections.v21.json +982 -0
  267. package/src/brand-page/__fixtures__/migration-22-v21/new-brandcontact-every-section.v21.json +1231 -0
  268. package/src/brand-page/__fixtures__/migration-22-v21/new-brandpage-every-section.v21.json +1231 -0
  269. package/src/brand-page/__fixtures__/migration-22-v21/new-brandsite-every-section.v21.json +1243 -0
  270. package/src/brand-page/__fixtures__/migration-22-v21/real-brandcontact.v21.json +755 -0
  271. package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-general-link.v21.json +527 -0
  272. package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-links.v21.json +755 -0
  273. package/src/brand-page/__fixtures__/migration-22-v21/real-brandpage-social-links.v21.json +514 -0
  274. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-about.v21.json +459 -0
  275. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-footer.v21.json +469 -0
  276. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-header-banner.v21.json +481 -0
  277. package/src/brand-page/__fixtures__/migration-22-v21/real-brandsite-sections.v21.json +800 -0
  278. package/src/brand-page/__fixtures__/production-text-style-resolver.fixture.ts +52 -0
  279. package/src/brand-page/components/about-section/AboutSection.vue.test.ts +0 -10
  280. package/src/brand-page/components/contact-form/ContactForm.mixin.test.ts +127 -0
  281. package/src/brand-page/components/contact-form/ContactForm.mixin.ts +31 -14
  282. package/src/brand-page/components/contact-form/ContactForm.vue +26 -12
  283. package/src/brand-page/components/contact-form/ContactForm.vue.test.ts +60 -0
  284. package/src/brand-page/components/mailing-list/MailingList.mixin.test.ts +92 -0
  285. package/src/brand-page/components/mailing-list/MailingList.mixin.ts +28 -3
  286. package/src/brand-page/components/mailing-list/MailingList.vue +9 -4
  287. package/src/brand-page/components/mailing-list/MailingList.vue.test.ts +63 -0
  288. package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.mixin.ts +51 -1
  289. package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.test.ts +114 -0
  290. package/src/brand-page/components/navigation/button-carousel/ButtonCarouselNavigation.vue +8 -2
  291. package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.test.ts +182 -0
  292. package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +58 -12
  293. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +40 -3
  294. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +15 -7
  295. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +133 -3
  296. package/src/brand-page/components/page/Page.mixin.ts +41 -34
  297. package/src/brand-page/components/page/Page.vue +17 -6
  298. package/src/brand-page/components/page/Page.vue.test.ts +91 -1
  299. package/src/brand-page/components/page-footer/PageFooter.mixin.ts +32 -2
  300. package/src/brand-page/components/page-footer/PageFooter.test.ts +79 -0
  301. package/src/brand-page/components/page-footer/PageFooter.vue +12 -4
  302. package/src/brand-page/components/payment/Payment.mixin.ts +34 -2
  303. package/src/brand-page/components/payment/Payment.test.ts +188 -0
  304. package/src/brand-page/components/payment/Payment.vue +12 -5
  305. package/src/brand-page/components/payment/RequestPaymentStripe.vue +1 -0
  306. package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +49 -2
  307. package/src/brand-page/components/payment/support-me/SupportMe.test.ts +100 -0
  308. package/src/brand-page/components/payment/support-me/SupportMe.vue +7 -1
  309. package/src/brand-page/components/payment/support-me/SupportMe.vue.test.ts +66 -0
  310. package/src/brand-page/components/save-contact/SaveContactWidget.test.ts +100 -0
  311. package/src/brand-page/components/save-contact/SaveContactWidget.vue +6 -3
  312. package/src/brand-page/components/shop/PaymentModal.vue +2 -6
  313. package/src/brand-page/components/shop/PaymentShippingAddress.vue +6 -0
  314. package/src/brand-page/components/shop/Shop.vue +15 -2
  315. package/src/brand-page/components/shop/Shop.vue.test.ts +74 -2
  316. package/src/brand-page/components/social-links/SocialLinks.stories.ts +0 -3
  317. package/src/brand-page/components/social-links/SocialLinks.vue.test.ts +0 -3
  318. package/src/brand-page/components/testimonial-section/__fixtures__/data.ts +0 -3
  319. package/src/brand-page/components/text/Text.stories.ts +0 -17
  320. package/src/brand-page/components/text-wrapper/TextWrapper.parity.test.ts +136 -0
  321. package/src/brand-page/components/text-wrapper/TextWrapper.test.ts +358 -0
  322. package/src/brand-page/components/text-wrapper/TextWrapper.vue +82 -22
  323. package/src/brand-page/constants/font.constants.ts +37 -0
  324. package/src/brand-page/models/brand-page-context.model.ts +13 -0
  325. package/src/brand-page/models/footer-icon-color.test.ts +22 -0
  326. package/src/brand-page/models/index.ts +50 -28
  327. package/src/brand-page/models/navigation-styles.model.test.ts +77 -1
  328. package/src/brand-page/models/navigation-styles.model.ts +26 -9
  329. package/src/brand-page/models/payment.model.ts +15 -6
  330. package/src/brand-page/models/styles.model.test.ts +104 -0
  331. package/src/brand-page/models/styles.model.ts +181 -47
  332. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +619 -115
  333. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +150 -9
  334. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +300 -18
  335. package/src/brand-page/utils/color-palette.util.test.ts +126 -1
  336. package/src/brand-page/utils/color-palette.util.ts +92 -26
  337. package/src/brand-page/utils/color.util.test.ts +62 -29
  338. package/src/brand-page/utils/color.util.ts +77 -14
  339. package/src/brand-page/utils/container-text-color.util.test.ts +672 -26
  340. package/src/brand-page/utils/container-text-color.util.ts +472 -46
  341. package/src/brand-page/utils/index.ts +1 -0
  342. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/edited-brandsite-sections.v22.json +1191 -0
  343. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandcontact-every-section.v22.json +2026 -0
  344. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandpage-every-section.v22.json +2017 -0
  345. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/new-brandsite-every-section.v22.json +2031 -0
  346. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandcontact.v22.json +1145 -0
  347. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-general-link.v22.json +645 -0
  348. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-links.v22.json +1136 -0
  349. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandpage-social-links.v22.json +662 -0
  350. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-about.v22.json +638 -0
  351. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-footer.v22.json +610 -0
  352. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-header-banner.v22.json +660 -0
  353. package/src/brand-page/utils/migration/__snapshots__/migration-22-output/real-brandsite-sections.v22.json +1132 -0
  354. package/src/brand-page/utils/migration/migration-01.ts +293 -237
  355. package/src/brand-page/utils/migration/migration-02.ts +8 -1
  356. package/src/brand-page/utils/migration/migration-20.ts +6 -3
  357. package/src/brand-page/utils/migration/migration-20_5.test.ts +5 -2
  358. package/src/brand-page/utils/migration/migration-21.test.ts +34 -0
  359. package/src/brand-page/utils/migration/migration-21.ts +46 -10
  360. package/src/brand-page/utils/migration/migration-22.fixed-input.test.ts +43 -0
  361. package/src/brand-page/utils/migration/migration-22.test.ts +4103 -0
  362. package/src/brand-page/utils/migration/migration-22.text-font-family.test.ts +72 -0
  363. package/src/brand-page/utils/migration/migration-22.ts +1336 -0
  364. package/src/brand-page/utils/migration.util.test.ts +146 -32
  365. package/src/brand-page/utils/migration.util.ts +18 -0
  366. package/src/brand-page/utils/model.util.ts +4 -0
  367. package/src/brand-page/utils/personalisation.util.test.ts +148 -3
  368. package/src/brand-page/utils/personalisation.util.ts +9 -1
  369. package/src/brand-page/utils/rte-role-lift.util.ts +409 -0
  370. package/src/brand-page/utils/style.util.test.ts +35 -2
  371. package/src/brand-page/utils/style.util.ts +45 -11
  372. package/src/brand-page/utils/text-role-css.util.test.ts +525 -0
  373. package/src/brand-page/utils/text-role-css.util.ts +321 -0
  374. package/src/brand-page/utils/text-role-reconnect.util.test.ts +604 -0
  375. package/src/brand-page/utils/text-role-reconnect.util.ts +727 -0
  376. package/src/brand-page/utils/text-style.util.test.ts +305 -0
  377. package/src/brand-page/utils/text-style.util.ts +198 -24
  378. package/src/brand-page/utils/view-model.page-data.test.ts +232 -0
  379. package/src/brand-page/utils/view-model.util.test.ts +954 -133
  380. package/src/brand-page/utils/view-model.util.ts +187 -139
  381. package/src/brand-page/view-models.ts +4 -0
  382. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.blank-site.test.ts +57 -0
  383. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +9 -5
  384. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -10
  385. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/content-settings-items.fixture.ts +0 -1
  386. package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -44
  387. package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +253 -200
  388. package/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.test.ts +82 -0
  389. package/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.ts +19 -0
  390. package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +2 -0
  391. package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +19 -0
  392. package/src/brand-page-maker/composables/rich-text-editor/block-typography.test.ts +519 -0
  393. package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +1 -1
  394. package/src/brand-page-maker/composables/rich-text-editor/extensions/MaxLength.test.ts +26 -1
  395. package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.test.ts +110 -0
  396. package/src/brand-page-maker/composables/rich-text-editor/extensions/RoleTypographyFill.ts +99 -0
  397. package/src/brand-page-maker/composables/rich-text-editor/extensions/RteClipboard.ts +397 -0
  398. package/src/brand-page-maker/composables/rich-text-editor/extensions/ViewDomParser.test.ts +139 -0
  399. package/src/brand-page-maker/composables/rich-text-editor/font.ts +36 -5
  400. package/src/brand-page-maker/composables/rich-text-editor/formatting.test.ts +375 -1
  401. package/src/brand-page-maker/composables/rich-text-editor/formatting.ts +301 -17
  402. package/src/brand-page-maker/composables/rich-text-editor/hyperlink.test.ts +82 -1
  403. package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +28 -34
  404. package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.test.ts +80 -0
  405. package/src/brand-page-maker/composables/rich-text-editor/keepMarksOnEmpty.ts +75 -0
  406. package/src/brand-page-maker/composables/rich-text-editor/spacing.ts +31 -6
  407. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.test.ts +2485 -0
  408. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +435 -337
  409. package/src/brand-page-maker/constants/config-settings-constant.ts +0 -6
  410. package/src/brand-page-maker/convertors/text-css-style-options.convertor.test.ts +43 -0
  411. package/src/brand-page-maker/convertors/text-css-style-options.convertor.ts +6 -2
  412. package/src/brand-page-maker/convertors/text-size-value.convertor.test.ts +24 -0
  413. package/src/brand-page-maker/convertors/text-size-value.convertor.ts +17 -13
  414. package/src/brand-page-maker/default-getters/payment-text-and-border-color.default-getter.ts +7 -22
  415. package/src/brand-page-maker/default-getters/text-color.default-getter.ts +5 -21
  416. package/src/brand-page-maker/models/content-settings.test.ts +708 -0
  417. package/src/brand-page-maker/models/content-settings.ts +133 -82
  418. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.test.ts +63 -1
  419. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store-utils.ts +16 -3
  420. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.test.ts +34 -0
  421. package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.ts +4 -2
  422. package/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.ts +30 -0
  423. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +185 -1
  424. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +22 -34
  425. package/src/brand-page-maker/stores/history/history-store.ts +35 -2
  426. package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +528 -0
  427. package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +12 -0
  428. package/src/brand-page-maker/utils/apply-color-strategy.golden.test.ts +2 -0
  429. package/src/brand-page-maker/utils/apply-color-strategy.test.ts +181 -3
  430. package/src/brand-page-maker/utils/apply-color-strategy.ts +36 -4
  431. package/src/brand-page-maker/utils/index.ts +2 -1
  432. package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +447 -410
  433. package/src/brand-page-maker/utils/rich-text-editor.util.ts +610 -506
  434. package/src/brand-page-maker/utils/rte-authoring.util.test.ts +244 -0
  435. package/src/brand-page-maker/utils/rte-authoring.util.ts +175 -0
  436. package/src/brand-page-maker/utils/rte-clipboard.util.test.ts +558 -0
  437. package/src/brand-page-maker/utils/rte-clipboard.util.ts +473 -0
  438. package/src/brand-page-maker/utils/rte-features.test.ts +99 -3
  439. package/src/brand-page-maker/utils/rte-render-parity.test.ts +1 -1
  440. package/src/brand-page-maker/utils/rte-render.util.test.ts +230 -0
  441. package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +1 -1
  442. package/src/brand-page-maker/utils/rte-sanitize.util.ts +14 -3
  443. package/src/brand-page-maker/utils/rte-schema-version.test.ts +102 -0
  444. package/src/bundles/bundled-translations.de-DE.json +21 -2
  445. package/src/bundles/bundled-translations.es-ES.json +21 -2
  446. package/src/bundles/bundled-translations.fr-CA.json +21 -2
  447. package/src/bundles/bundled-translations.fr-FR.json +21 -2
  448. package/src/bundles/bundled-translations.json +21 -2
  449. package/src/bundles/bundled-translations.pt-BR.json +21 -2
  450. package/src/bundles/bundled-translations.pt-PT.json +21 -2
  451. package/src/clients/ai-assistant-client.ts +13 -18
  452. package/src/composables/useTranslate.ts +2 -1
  453. package/src/lib.ts +2 -2
  454. package/src/metadata-builder/builders/footer-builder.test.ts +70 -45
  455. package/src/metadata-builder/builders/footer-builder.ts +4 -8
  456. package/src/metadata-builder/builders/global-role-propagation.test.ts +907 -0
  457. package/src/metadata-builder/builders/global-role-propagation.ts +430 -0
  458. package/src/metadata-builder/builders/global-styles-builder.test.ts +1020 -0
  459. package/src/metadata-builder/builders/global-styles-builder.ts +194 -48
  460. package/src/metadata-builder/builders/header-builder.test.ts +112 -40
  461. package/src/metadata-builder/builders/header-builder.ts +18 -8
  462. package/src/metadata-builder/builders/section-builders/about-section-builder.ts +5 -3
  463. package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +5 -3
  464. package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +5 -3
  465. package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +7 -4
  466. package/src/metadata-builder/builders/section-builders/images-section-builder.ts +5 -3
  467. package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +3 -2
  468. package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +3 -2
  469. package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +7 -7
  470. package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +5 -3
  471. package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +2 -2
  472. package/src/metadata-builder/builders/section-builders/social-links-builder.ts +21 -10
  473. package/src/metadata-builder/builders/section-builders/support-me-builder.test.ts +10 -0
  474. package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +3 -2
  475. package/src/metadata-builder/builders/section-builders/text-section-builder.ts +111 -61
  476. package/src/metadata-builder/builders/section-field-maps.ts +1 -0
  477. package/src/metadata-builder/builders/section-field-utils.test.ts +545 -2
  478. package/src/metadata-builder/builders/section-field-utils.ts +202 -69
  479. package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +38 -13
  480. package/src/metadata-builder/builders/section-rules/social-links.rules.ts +5 -0
  481. package/src/metadata-builder/helpers/rte.helpers.test.ts +101 -0
  482. package/src/metadata-builder/helpers/rte.helpers.ts +129 -43
  483. package/src/metadata-builder/metadata-executor.test.ts +167 -0
  484. package/src/metadata-builder/metadata-executor.ts +34 -1
  485. package/src/metadata-builder/models.ts +2 -0
  486. package/src/metadata-builder/parsers/ai-toolcall-parser.ts +23 -7
  487. package/src/metadata-builder/parsers/section-tool-arguments.ts +21 -1
  488. package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +215 -0
  489. package/src/metadata-builder/sanitizers/rte-schema-check.ts +1 -1
  490. package/src/metadata-builder/sanitizers/sanitizer-rules.ts +4 -8
  491. package/src/metadata-builder/sanitizers/section-args-validator.ts +136 -53
  492. package/src/shared/color-palette/section-color-matches.test.ts +15 -11
  493. package/src/shared/color-palette/section-color-matches.ts +9 -28
  494. package/src/shared/color-strategies/color-strategies.ts +35 -0
  495. package/src/shared/color-strategies/rte-color.test.ts +1 -1
  496. package/src/shared/color-strategies/rte-color.ts +19 -0
  497. package/src/shared/color-strategies/rte-field-pairs.test.ts +26 -5
  498. package/src/shared/color-strategies/rte-field-pairs.ts +33 -0
  499. package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.test.ts +43 -66
  500. package/src/shared/content-settings/components/color-matches-panel/ColorMatchesPanel.vue +7 -1
  501. package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -48
  502. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +33 -7
  503. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.test.ts +128 -1
  504. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -6
  505. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.test.ts +56 -3
  506. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +11 -4
  507. package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.test.ts +335 -25
  508. package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +248 -70
  509. package/src/shared/content-settings/components/text-style-field/TextStyleField.vue +113 -25
  510. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.de-DE.json +17 -10
  511. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.es-ES.json +17 -10
  512. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-CA.json +17 -10
  513. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.fr-FR.json +17 -10
  514. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.json +8 -1
  515. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-BR.json +17 -10
  516. package/src/shared/content-settings/components/text-style-field/i18n/text-style-field.pt-PT.json +17 -10
  517. package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.test.ts +141 -0
  518. package/src/shared/content-settings/components/text-style-role-dropdown/TextStyleRoleDropdown.vue +136 -0
  519. package/src/shared/content-settings/store/content-settings-store.test.ts +491 -6
  520. package/src/shared/content-settings/store/content-settings-store.ts +159 -17
  521. package/src/shared/navigation-style-settings/store/index.test.ts +295 -0
  522. package/src/shared/navigation-style-settings/store/index.ts +65 -15
  523. package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +44 -4
  524. package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +13 -4
  525. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.navigation.test.ts +89 -0
  526. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.text-style.test.ts +91 -0
  527. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +14 -2
  528. package/src/shared/page-settings/store/page-settings-store.text-style.test.ts +84 -0
  529. package/src/shared/page-settings/store/page-settings-store.ts +30 -1
  530. package/src/shared/rte-extensions/AutoLink.test.ts +98 -0
  531. package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/AutoLink.ts +87 -58
  532. package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.ts +4 -1
  533. package/src/shared/rte-extensions/TextEffects.ts +151 -0
  534. package/src/shared/rte-extensions/ViewDomParser.ts +27 -0
  535. package/src/{brand-page-maker/composables/rich-text-editor/getRteExtensions.ts → shared/rte-extensions.util.ts} +66 -9
  536. package/src/shared/rte-link.util.ts +2 -0
  537. package/src/shared/rte-render.util.ts +385 -0
  538. package/src/shared/rte-shape.util.ts +29 -0
  539. package/src/shared/side-bar/store/side-bar-store.test.ts +27 -1
  540. package/src/shared/side-bar/store/side-bar-store.ts +11 -0
  541. package/src/shared/style-settings/components/StyleSettings.mixin.ts +7 -3
  542. package/src/shared/style-settings/components/StyleSettings.test.ts +116 -0
  543. package/src/shared/style-settings/components/StyleSettings.vue +74 -25
  544. package/src/shared/style-settings/components/i18n/style-settings.de-DE.json +32 -20
  545. package/src/shared/style-settings/components/i18n/style-settings.es-ES.json +32 -20
  546. package/src/shared/style-settings/components/i18n/style-settings.fr-CA.json +32 -20
  547. package/src/shared/style-settings/components/i18n/style-settings.fr-FR.json +32 -20
  548. package/src/shared/style-settings/components/i18n/style-settings.json +13 -3
  549. package/src/shared/style-settings/components/i18n/style-settings.pt-BR.json +32 -20
  550. package/src/shared/style-settings/components/i18n/style-settings.pt-PT.json +32 -20
  551. package/src/shared/style-settings/components/text-style-options-settings-with-state/TextStyleOptionsSettingsWithState.vue +14 -34
  552. package/src/shared/style-settings/store/style-settings-store.ts +3 -49
  553. package/src/shared/style-settings/text-style-size-order.test.ts +76 -0
  554. package/src/shared/style-settings/text-style-size-order.ts +28 -0
  555. package/src/shared/text-role-typography.util.ts +277 -0
  556. package/src/utils/minify-brand-page-metadata.test.ts +102 -7
  557. package/src/utils/minify-brand-page-metadata.ts +62 -8
  558. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/AutoLink.d.ts +0 -2
  559. package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
  560. package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -63
  561. package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -106
  562. package/lib/src/brand-page-maker/utils/rte-shape.d.ts +0 -18
  563. package/lib/src/brand-page-maker/utils/rte-shape.js +0 -21
  564. package/lib/src/metadata-builder/builders/global-font-propagation.d.ts +0 -41
  565. package/lib/src/metadata-builder/builders/global-font-propagation.js +0 -146
  566. package/src/brand-page/models/brand-page-context.model.test.ts +0 -38
  567. package/src/brand-page-maker/utils/rte-render.util.ts +0 -179
  568. package/src/brand-page-maker/utils/rte-shape.ts +0 -29
  569. package/src/clients/ai-assistant-client.test.ts +0 -135
  570. package/src/metadata-builder/builders/global-font-propagation.test.ts +0 -401
  571. package/src/metadata-builder/builders/global-font-propagation.ts +0 -238
  572. package/src/shared/style-settings/components/StyleSettingsSection.vue +0 -8
  573. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.d.ts +0 -0
  574. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.js +0 -0
  575. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.d.ts +0 -0
  576. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.js +0 -0
  577. /package/lib/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/MaxLength.d.ts +0 -0
  578. /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/FontFamily.ts +0 -0
  579. /package/src/{brand-page-maker/composables/rich-text-editor/extensions → shared/rte-extensions}/LetterSpacing.ts +0 -0
@@ -25,6 +25,7 @@ import { migration19 } from './migration/migration-19';
25
25
  import { migration20 } from './migration/migration-20';
26
26
  import { migration20_5 } from './migration/migration-20_5';
27
27
  import { migration21 } from './migration/migration-21';
28
+ import { migration22 } from './migration/migration-22';
28
29
  const MIGRATION_TABLE = [
29
30
  {
30
31
  version: 1,
@@ -195,6 +196,22 @@ const MIGRATION_TABLE = [
195
196
  // callers have; see `fillBlankPaletteRoles`.
196
197
  description: 'BP-5886 Global Color V2: extract every colour into a central styles.colors palette (4 palette roles + palette-custom-<uuid>) and rewrite references to var(--id) — RTE, shapes, box-shadow, gradients included (lossless, once)',
197
198
  },
199
+ {
200
+ version: 22,
201
+ migrateFn: migration22,
202
+ // Version-gated (runs once, when modelVersion < 22): the BP-5969 single-source
203
+ // text-style migration (ADR-0019/0020/0021, §7a D1–D5). The 10 roles KEEP their §4
204
+ // default typography; each old role's COLOUR is seeded onto its target tier so the
205
+ // colour bake stays byte-identical (paragraph1 takes the base-coat colour). Every
206
+ // text field (content, nav, header button, Save Contact) outside the ten reconnects
207
+ // onto its nearest canonical tier, the values that differ from it kept as overrides
208
+ // so it renders unchanged, and the baked role-typography is stripped out of RTE
209
+ // marks (uniform-but-divergent values lifted into block overrides, genuine per-run
210
+ // marks kept). Ordered after v21 so RTE colours are already referencified. The
211
+ // version gate runs it once; on a hypothetical re-run every job is a no-op (see
212
+ // migration-22's header).
213
+ description: 'BP-5969 Global Text Style V2: expand 4 roles -> 10 (H1-6/P1-3/button); roles keep default typography, reconnect all content to its nearest tier with its size kept as a per-block override, seed role colour + strip baked RTE typography (appearance-preserving, once)',
214
+ },
198
215
  ];
199
216
  export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
200
217
  export const migrateBrandPageModel = async (brandPageModel, options) => {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * MIGRATION-22 SNAPSHOT DEPENDENCY: its reconnect and colour bake call `isButtonContent`. After
3
+ * migration-22 releases, pin its v22 behaviour in the migration before changing it.
4
+ */
1
5
  import { type Content, type AboutSectionContent, type BannerSectionContent, type BrandPageModel, type ButtonWithModalContent, type ImagesSectionContent, type LogoContent, type MailingListContent, type ProfileContent, type ShapesSectionContent, type SocialLinksContent, type SupportMeContent, type TestimonialSectionContent, type TextContent, type RequestPaymentContent, type ContactFormContent, type LogoImageModel, type ShopContent, type ImageContent, type ImageGalleryContent, type BookingSectionContent } from '../models';
2
6
  export declare const isLogoContent: (content?: Content) => content is LogoContent;
3
7
  export declare const applyLogoImageToBrandPageModelLogoContents: (model: BrandPageModel, logoImage: LogoImageModel) => BrandPageModel;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * MIGRATION-22 SNAPSHOT DEPENDENCY: its reconnect and colour bake call `isButtonContent`. After
3
+ * migration-22 releases, pin its v22 behaviour in the migration before changing it.
4
+ */
1
5
  import { CONTENT_TYPES, } from '../models';
2
6
  export const isLogoContent = (content) => {
3
7
  return content?.type === 'logo';
@@ -1,5 +1,8 @@
1
1
  import { escapeContentText } from '@brand-page/utils';
2
2
  import { DEFAULT_PERSONALISATION_MAPPING, PERSONALISATION_MAPPINGS, TEXT_MEDIA_CONTENT_TYPES, } from '@brand-page-maker/constants/personalisation.constant';
3
+ // Leaf import, not the `@brand-page-maker/utils` barrel: the barrel would drag the whole maker-utils
4
+ // graph into this brand-page module and risk a cycle (cf. the same guard in section-color-matches.ts).
5
+ import { reflowRteDoc, isTiptapDocument } from '@shared/rte-render.util';
3
6
  import { BRAND_PAGE_TYPES, ShapeAspectRatioCategory } from '../models';
4
7
  import { getColorReplacementsFromSvgString, getColorReplacementsFromSvgStringServer, } from './svg-color.util';
5
8
  const ASPECT_RATIO_LOWER_CUT_OFF = 0.5;
@@ -332,7 +335,12 @@ const applyPersonalisationToBrandPageContentsRecursiveAsync = async (personalisa
332
335
  const { personalisation: updatedPersonalisation, value: personalisationValue, valuesToUpdate: newValuesToUpdate, } = await getPersonalisationValueFromPropertyAsync(key, value, personalisationRole, content[`${key}Override`], newPersonalisation, mappingType);
333
336
  newPersonalisation = updatedPersonalisation;
334
337
  if (personalisationValue) {
335
- newContents[key] = personalisationValue;
338
+ // BP-5969: an RTE field is a Tiptap doc whose colour + typography live in its run marks.
339
+ // Writing the plain personalisation string raw would drop that style, so reflow the new
340
+ // text through the template doc's style skeleton instead; plain/URL fields write raw.
341
+ newContents[key] = isTiptapDocument(value)
342
+ ? reflowRteDoc(value, personalisationValue)
343
+ : personalisationValue;
336
344
  if (newValuesToUpdate) {
337
345
  for (const [k, v] of Object.entries(newValuesToUpdate)) {
338
346
  valuesToUpdate[k] = v;
@@ -0,0 +1,72 @@
1
+ import type { BrandPageModel, TextStyleDeclaration } from '../models';
2
+ import type { TextStyleOptions } from '../models/styles.model';
3
+ /**
4
+ * Migration-22's job C, shared with the success message seed (`text-role-reconnect.util.ts`): lift an RTE field's block typography onto its
5
+ * runs once it links a role. A linked run follows the role class unless its mark holds a literal,
6
+ * and the render fill treats a neutral block value (weight `normal`) as "follow the role" — so
7
+ * without this a reconnected field can change look (a non-bold title under a bold heading).
8
+ *
9
+ * MIGRATION-22 SNAPSHOT DEPENDENCY: this migration consumes the lift and font-vote behaviour. Before
10
+ * changing it after migration-22 releases, copy the v22 behaviour into that migration first.
11
+ */
12
+ declare const RTE_TYPOGRAPHY_ATTRS: readonly ["fontFamily", "fontSize", "letterSpacing", "lineHeight"];
13
+ /**
14
+ * R16 (migration-22 job A2): the distinct fonts a doc's non-empty runs show — a run's own literal
15
+ * `fontFamily` mark, else the block font (`blockFont`, from `drawnFontFamily`); a `var(--role-*)`
16
+ * ref counts as the block font too, since it carries no font of its own. A doc whose every run
17
+ * carries its own literal never adds `blockFont` to the set. Read-only, for the font count only.
18
+ */
19
+ export declare const textRunFontFamilies: (doc: unknown, blockFont: string) => Set<string>;
20
+ /**
21
+ * C (BP-5969 role-var model) — bake each RTE field's EFFECTIVE typography onto its run marks. The
22
+ * container role class now only DEFINES the vars and the element applies nothing, so the block's
23
+ * typography (previously applied on the element from `styleObj`) and the role must be carried by the
24
+ * runs themselves, or they'd fall to the body default. For each run and each attr the ROLE defines,
25
+ * the effective value = per-run mark override ?? block override (`styleObj`) ?? role, stored as:
26
+ * • a role ref (`var(--role-<attr>)`) when the effective value EQUALS the role (so it follows role edits), or
27
+ * • a literal when it's a genuine override (per-run, or a block-level override from `styleObj`).
28
+ * Already-referenced values and attrs the role doesn't define are left alone; colour is untouched.
29
+ * Mutates in place; a non-Tiptap value (legacy HTML string) is skipped. Load-time twin of the
30
+ * editor's per-run `roleVarOrLiteral` + fill.
31
+ */
32
+ export declare const stripLiftRteDoc: (doc: unknown, roleStyle: Partial<Record<(typeof RTE_TYPOGRAPHY_ATTRS)[number], string>>, styleObj?: Partial<Record<(typeof RTE_TYPOGRAPHY_ATTRS)[number], string>>) => void;
33
+ /**
34
+ * C2 (BP-5969 Phase B) — fold the legacy per-run boolean marks (bold/italic/underline/strike) into the
35
+ * run's `textStyle` attrs (fontWeight/fontStyle/textDecoration), so the whole typography set lives on
36
+ * ONE mark and follows role edits like the rest. Each formatting mark becomes the matching attr — a
37
+ * role ref when it equals the role (so a role weight/decoration edit repaints the run), else a literal
38
+ * override — and the semantic mark is removed. Runs with no formatting mark are left to the render fill
39
+ * (they follow the role). This is what lets role weight/style/decoration edits reach LEGACY content and
40
+ * makes the doc self-describing without semantic marks (a prerequisite for retiring the Bold/Underline/
41
+ * Strike extensions). Mutates in place; a non-Tiptap value is skipped. Runs after `stripLiftRteDoc`
42
+ * (they touch disjoint attrs — family/size/spacing vs weight/style/decoration).
43
+ */
44
+ export declare const foldSemanticFormattingMarks: (doc: unknown, roleStyle: Partial<Record<"fontWeight" | "fontStyle" | "textDecoration", string>>) => void;
45
+ /**
46
+ * C3 (BP-5969) — pin each RTE run's WEIGHT to the block's effective legacy weight, so migrated
47
+ * content that was NOT bold can't inherit a heading tier's `bold` default. `fontWeight` is the only
48
+ * role attr with a non-neutral default (headings are bold; style/decoration default to the neutral
49
+ * `normal`/`none`), so it is the only one that needs this — the render's var-fill treats a block-level
50
+ * `normal` as inert and would otherwise let the run follow the tier's bold.
51
+ *
52
+ * The old roles never set weight, so a legacy run's weight came from its per-run bold mark (already
53
+ * folded by `foldSemanticFormattingMarks`) or the block's own `fontWeight` — which job B resolved to
54
+ * `normal` when it was falsy. So for a run the fold left without a weight, bake that block weight as a
55
+ * LITERAL override whenever it differs from the tier (e.g. `normal` under a bold heading tier). When
56
+ * block and tier agree, no-op — the render's var-fill already follows the role. Runs after the fold so
57
+ * a folded bold mark (a genuine per-run weight) is never overwritten. Mutates in place.
58
+ */
59
+ export declare const pinLegacyRunWeight: (doc: unknown, roleWeight: string | undefined, blockWeight: string | undefined) => void;
60
+ export declare const liftRteFieldOntoRole: (doc: unknown, styleObj: TextStyleDeclaration | undefined, options: TextStyleOptions) => void;
61
+ type RteFieldVisitor = (doc: unknown, styleObj: TextStyleDeclaration | undefined, readStyle: () => TextStyleDeclaration | undefined) => void;
62
+ /**
63
+ * Every RTE field with its style object: section field-pairs, text `textItems`, and the text
64
+ * section's single block `text`.
65
+ */
66
+ export declare const forEachRteField: (brandPageModel: BrandPageModel, visit: RteFieldVisitor) => void;
67
+ /**
68
+ * C — run the strip/lift over every RTE field. Runs after reconnect so each field's
69
+ * `textStyleType` is canonical and its role definition is the remapped one.
70
+ */
71
+ export declare const stripLiftContentRte: (brandPageModel: BrandPageModel, options: TextStyleOptions) => void;
72
+ export {};
@@ -0,0 +1,275 @@
1
+ import { RTE_SECTION_FIELD_PAIRS } from '@shared/color-strategies/rte-field-pairs';
2
+ import { roleVarRef } from './text-role-css.util';
3
+ /**
4
+ * Migration-22's job C, shared with the success message seed (`text-role-reconnect.util.ts`): lift an RTE field's block typography onto its
5
+ * runs once it links a role. A linked run follows the role class unless its mark holds a literal,
6
+ * and the render fill treats a neutral block value (weight `normal`) as "follow the role" — so
7
+ * without this a reconnected field can change look (a non-bold title under a bold heading).
8
+ *
9
+ * MIGRATION-22 SNAPSHOT DEPENDENCY: this migration consumes the lift and font-vote behaviour. Before
10
+ * changing it after migration-22 releases, copy the v22 behaviour into that migration first.
11
+ */
12
+ // The role-typography the RTE baked into each run's `textStyle` mark
13
+ // (`getUpdatedHTMLFromEditor` sets exactly these four; colour is also a textStyle
14
+ // attr but is deliberately NOT touched — it stays in the mark).
15
+ const RTE_TYPOGRAPHY_ATTRS = [
16
+ 'fontFamily',
17
+ 'fontSize',
18
+ 'letterSpacing',
19
+ 'lineHeight',
20
+ ];
21
+ const collectTextNodes = (node, acc) => {
22
+ if (!node)
23
+ return;
24
+ if (node.type === 'text')
25
+ acc.push(node);
26
+ node.content?.forEach((child) => collectTextNodes(child, acc));
27
+ };
28
+ const textStyleMark = (node) => node.marks?.find((mark) => mark.type === 'textStyle');
29
+ /**
30
+ * R16 (migration-22 job A2): the distinct fonts a doc's non-empty runs show — a run's own literal
31
+ * `fontFamily` mark, else the block font (`blockFont`, from `drawnFontFamily`); a `var(--role-*)`
32
+ * ref counts as the block font too, since it carries no font of its own. A doc whose every run
33
+ * carries its own literal never adds `blockFont` to the set. Read-only, for the font count only.
34
+ */
35
+ export const textRunFontFamilies = (doc, blockFont) => {
36
+ const fonts = new Set();
37
+ if (!doc || typeof doc !== 'object' || doc.type !== 'doc')
38
+ return fonts;
39
+ const nodes = [];
40
+ collectTextNodes(doc, nodes);
41
+ for (const node of nodes) {
42
+ if (!node.text || node.text.trim() === '')
43
+ continue;
44
+ const literal = textStyleMark(node)?.attrs?.fontFamily;
45
+ // `''` is FontFamily.ts's "no font of its own" (a colour-only mark parsed from HTML carries
46
+ // it) — not a literal to vote, so it falls through to the block font like an absent mark.
47
+ const hasLiteral = typeof literal === 'string' &&
48
+ literal !== '' &&
49
+ !literal.startsWith('var(--role-');
50
+ fonts.add(hasLiteral ? literal : blockFont);
51
+ }
52
+ return fonts;
53
+ };
54
+ /**
55
+ * C (BP-5969 role-var model) — bake each RTE field's EFFECTIVE typography onto its run marks. The
56
+ * container role class now only DEFINES the vars and the element applies nothing, so the block's
57
+ * typography (previously applied on the element from `styleObj`) and the role must be carried by the
58
+ * runs themselves, or they'd fall to the body default. For each run and each attr the ROLE defines,
59
+ * the effective value = per-run mark override ?? block override (`styleObj`) ?? role, stored as:
60
+ * • a role ref (`var(--role-<attr>)`) when the effective value EQUALS the role (so it follows role edits), or
61
+ * • a literal when it's a genuine override (per-run, or a block-level override from `styleObj`).
62
+ * Already-referenced values and attrs the role doesn't define are left alone; colour is untouched.
63
+ * Mutates in place; a non-Tiptap value (legacy HTML string) is skipped. Load-time twin of the
64
+ * editor's per-run `roleVarOrLiteral` + fill.
65
+ */
66
+ export const stripLiftRteDoc = (doc, roleStyle, styleObj) => {
67
+ if (!doc || typeof doc !== 'object' || doc.type !== 'doc')
68
+ return;
69
+ const nodes = [];
70
+ collectTextNodes(doc, nodes);
71
+ if (!nodes.length)
72
+ return;
73
+ for (const node of nodes) {
74
+ let mark = textStyleMark(node);
75
+ for (const attr of RTE_TYPOGRAPHY_ATTRS) {
76
+ const roleValue = roleStyle?.[attr];
77
+ // The role doesn't define this attr → the run doesn't carry it (renders `normal`).
78
+ if (roleValue === undefined || roleValue === null)
79
+ continue;
80
+ const ref = roleVarRef(attr);
81
+ if (!ref)
82
+ continue;
83
+ // Ensure a textStyle mark exists to hold the value (a bare run needs one).
84
+ if (!mark) {
85
+ mark = { type: 'textStyle', attrs: {} };
86
+ (node.marks ??= []).push(mark);
87
+ }
88
+ if (!mark.attrs)
89
+ mark.attrs = {};
90
+ const value = mark.attrs[attr];
91
+ // already a role ref → keep it
92
+ if (typeof value === 'string' && value.startsWith('var(--role-'))
93
+ continue;
94
+ // per-run override present → re-link if it equals the role, else keep the literal
95
+ if (value !== undefined && value !== null) {
96
+ if (value === roleValue)
97
+ mark.attrs[attr] = ref;
98
+ continue;
99
+ }
100
+ // no per-run value → bake the block-level effective value: a block-level override
101
+ // (`styleObj` differs from the role) as a literal — it was applied on the element before and
102
+ // would be lost now — otherwise the role ref.
103
+ const blockValue = styleObj?.[attr];
104
+ mark.attrs[attr] =
105
+ blockValue !== undefined &&
106
+ blockValue !== null &&
107
+ blockValue !== roleValue
108
+ ? blockValue
109
+ : ref;
110
+ }
111
+ }
112
+ // drop textStyle marks left with no attributes (defensive; colour/refs usually remain)
113
+ for (const node of nodes) {
114
+ if (!node.marks)
115
+ continue;
116
+ node.marks = node.marks.filter((mark) => !(mark.type === 'textStyle' &&
117
+ (!mark.attrs || Object.keys(mark.attrs).length === 0)));
118
+ }
119
+ };
120
+ const SEMANTIC_MARK_TYPES = ['bold', 'italic', 'underline', 'strike'];
121
+ /**
122
+ * C2 (BP-5969 Phase B) — fold the legacy per-run boolean marks (bold/italic/underline/strike) into the
123
+ * run's `textStyle` attrs (fontWeight/fontStyle/textDecoration), so the whole typography set lives on
124
+ * ONE mark and follows role edits like the rest. Each formatting mark becomes the matching attr — a
125
+ * role ref when it equals the role (so a role weight/decoration edit repaints the run), else a literal
126
+ * override — and the semantic mark is removed. Runs with no formatting mark are left to the render fill
127
+ * (they follow the role). This is what lets role weight/style/decoration edits reach LEGACY content and
128
+ * makes the doc self-describing without semantic marks (a prerequisite for retiring the Bold/Underline/
129
+ * Strike extensions). Mutates in place; a non-Tiptap value is skipped. Runs after `stripLiftRteDoc`
130
+ * (they touch disjoint attrs — family/size/spacing vs weight/style/decoration).
131
+ */
132
+ export const foldSemanticFormattingMarks = (doc, roleStyle) => {
133
+ if (!doc || typeof doc !== 'object' || doc.type !== 'doc')
134
+ return;
135
+ const nodes = [];
136
+ collectTextNodes(doc, nodes);
137
+ if (!nodes.length)
138
+ return;
139
+ const varOrLiteral = (attr, value) => {
140
+ const ref = roleVarRef(attr);
141
+ // equal to the role → the role ref (follows role edits); else the literal per-run override
142
+ return ref && roleStyle?.[attr] === value ? ref : value;
143
+ };
144
+ for (const node of nodes) {
145
+ const marks = node.marks;
146
+ if (!marks?.length)
147
+ continue;
148
+ const has = (type) => marks.some((mark) => mark.type === type);
149
+ const bold = has('bold');
150
+ const italic = has('italic');
151
+ const underline = has('underline');
152
+ const strike = has('strike');
153
+ if (!bold && !italic && !underline && !strike)
154
+ continue;
155
+ let mark = textStyleMark(node);
156
+ if (!mark) {
157
+ mark = { type: 'textStyle', attrs: {} };
158
+ marks.push(mark);
159
+ }
160
+ if (!mark.attrs)
161
+ mark.attrs = {};
162
+ // A per-run boolean mark is an explicit override — write it unless a value is already present.
163
+ if (bold && mark.attrs.fontWeight == null) {
164
+ mark.attrs.fontWeight = varOrLiteral('fontWeight', 'bold');
165
+ }
166
+ if (italic && mark.attrs.fontStyle == null) {
167
+ mark.attrs.fontStyle = varOrLiteral('fontStyle', 'italic');
168
+ }
169
+ if ((underline || strike) && mark.attrs.textDecoration == null) {
170
+ const decoration = [
171
+ underline ? 'underline' : '',
172
+ strike ? 'line-through' : '',
173
+ ]
174
+ .filter(Boolean)
175
+ .join(' ');
176
+ mark.attrs.textDecoration = varOrLiteral('textDecoration', decoration);
177
+ }
178
+ node.marks = marks.filter((mark) => !SEMANTIC_MARK_TYPES.includes(mark.type));
179
+ }
180
+ };
181
+ /**
182
+ * C3 (BP-5969) — pin each RTE run's WEIGHT to the block's effective legacy weight, so migrated
183
+ * content that was NOT bold can't inherit a heading tier's `bold` default. `fontWeight` is the only
184
+ * role attr with a non-neutral default (headings are bold; style/decoration default to the neutral
185
+ * `normal`/`none`), so it is the only one that needs this — the render's var-fill treats a block-level
186
+ * `normal` as inert and would otherwise let the run follow the tier's bold.
187
+ *
188
+ * The old roles never set weight, so a legacy run's weight came from its per-run bold mark (already
189
+ * folded by `foldSemanticFormattingMarks`) or the block's own `fontWeight` — which job B resolved to
190
+ * `normal` when it was falsy. So for a run the fold left without a weight, bake that block weight as a
191
+ * LITERAL override whenever it differs from the tier (e.g. `normal` under a bold heading tier). When
192
+ * block and tier agree, no-op — the render's var-fill already follows the role. Runs after the fold so
193
+ * a folded bold mark (a genuine per-run weight) is never overwritten. Mutates in place.
194
+ */
195
+ export const pinLegacyRunWeight = (doc, roleWeight, blockWeight) => {
196
+ if (!doc || typeof doc !== 'object' || doc.type !== 'doc')
197
+ return;
198
+ // Only a genuine override needs a literal: an absent block weight is a non-legacy (canonical)
199
+ // block, and a block weight equal to the tier is already supplied by the role class — both follow
200
+ // the role via the render's var-fill.
201
+ if (blockWeight === undefined ||
202
+ blockWeight === null ||
203
+ blockWeight === '' ||
204
+ blockWeight === roleWeight) {
205
+ return;
206
+ }
207
+ const nodes = [];
208
+ collectTextNodes(doc, nodes);
209
+ for (const node of nodes) {
210
+ let mark = textStyleMark(node);
211
+ // A per-run weight (a folded bold mark, or an author's per-run edit) is authoritative.
212
+ const existing = mark?.attrs?.fontWeight;
213
+ if (existing !== undefined && existing !== null && existing !== '')
214
+ continue;
215
+ if (!mark) {
216
+ mark = { type: 'textStyle', attrs: {} };
217
+ (node.marks ??= []).push(mark);
218
+ }
219
+ if (!mark.attrs)
220
+ mark.attrs = {};
221
+ mark.attrs.fontWeight = blockWeight;
222
+ }
223
+ };
224
+ export const liftRteFieldOntoRole = (doc, styleObj, options) => {
225
+ const type = styleObj?.textStyleType;
226
+ if (!type)
227
+ return;
228
+ const roleStyle = options[type]?.style;
229
+ if (roleStyle) {
230
+ // Pass the block-level style so a block typography override (applied on the element before this
231
+ // change) is baked onto the runs, not lost now that the element applies nothing. Family/size/
232
+ // line-height/spacing are baked here; weight is handled by the fold + `pinLegacyRunWeight` below,
233
+ // style/decoration by the fold — they follow role edits via the cascade otherwise.
234
+ stripLiftRteDoc(doc, roleStyle, styleObj);
235
+ // Phase B: fold legacy bold/italic/underline/strike marks into the run's textStyle attrs, so
236
+ // weight/style/decoration follow role edits on legacy content too and no semantic marks remain.
237
+ foldSemanticFormattingMarks(doc, roleStyle);
238
+ // C3: pin a not-bold legacy block's weight so a bold heading tier can't bold its bare runs.
239
+ pinLegacyRunWeight(doc, roleStyle.fontWeight, styleObj?.fontWeight);
240
+ }
241
+ };
242
+ /**
243
+ * Every RTE field with its style object: section field-pairs, text `textItems`, and the text
244
+ * section's single block `text`.
245
+ */
246
+ export const forEachRteField = (brandPageModel, visit) => {
247
+ const visitAt = (holder, textKey, styleKey) => {
248
+ const readStyle = () => holder[styleKey];
249
+ visit(holder[textKey], readStyle(), readStyle);
250
+ };
251
+ for (const page of brandPageModel.pages ?? []) {
252
+ for (const content of page.contents ?? []) {
253
+ const fields = content;
254
+ const pairs = RTE_SECTION_FIELD_PAIRS[content.type] ?? [];
255
+ for (const pair of pairs)
256
+ visitAt(fields, pair.textField, pair.styleField);
257
+ if (content.type === 'text') {
258
+ const items = fields.textItems;
259
+ if (Array.isArray(items)) {
260
+ for (const item of items) {
261
+ if (item && typeof item === 'object') {
262
+ visitAt(item, 'text', 'textStyle');
263
+ }
264
+ }
265
+ }
266
+ visitAt(fields, 'text', 'textStyle');
267
+ }
268
+ }
269
+ }
270
+ };
271
+ /**
272
+ * C — run the strip/lift over every RTE field. Runs after reconnect so each field's
273
+ * `textStyleType` is canonical and its role definition is the remapped one.
274
+ */
275
+ export const stripLiftContentRte = (brandPageModel, options) => forEachRteField(brandPageModel, (doc, styleObj) => liftRteFieldOntoRole(doc, styleObj, options));
@@ -10,7 +10,9 @@ export declare const paletteToCssVarDeclarations: (colors: ColorItem[], options?
10
10
  * attribute rather than an `id` so a duplicate stays queryable instead of being invalid HTML.
11
11
  */
12
12
  export declare const PALETTE_ROOT_ATTRIBUTE = "data-palette-root";
13
- /** Full `<style>:root{…}</style>` block for `Page`'s `v-html` (standalone surfaces). */
13
+ /** CSS text for Page's stable native style element on standalone surfaces. */
14
+ export declare const buildPaletteRootCssText: (colors: ColorItem[]) => string;
15
+ /** Full `<style>:root{…}</style>` fragment retained for callers outside Page. */
14
16
  export declare const buildPaletteRootCss: (colors: ColorItem[]) => string;
15
17
  /**
16
18
  * Markers for the SCOPED emission (template cards). Unlike `data-palette-root` (≤1 per
@@ -27,6 +29,8 @@ export declare const PAGE_SCOPE_ID_ATTRIBUTE = "data-page-scope";
27
29
  * card's block targets its own nodes instead, shadowing the canvas `:root` for its subtree.
28
30
  * Role defaults are forced so no role name falls through to the canvas (see `paletteCssEntries`).
29
31
  */
32
+ export declare const buildPaletteScopedCssText: (colors: ColorItem[], scopeId: string) => string;
33
+ /** Full scoped `<style>` fragment retained for callers outside Page. */
30
34
  export declare const buildPaletteScopedCss: (colors: ColorItem[], scopeId: string) => string;
31
35
  /**
32
36
  * Simple utility to convert any color format to hex for consistent comparison
@@ -26,15 +26,24 @@ const paletteCssEntries = (colors = [], { forceRoleDefaults = false } = {}) => {
26
26
  // the literal text `undefined`.
27
27
  const entries = PALETTE_COLOR_ID_ORDER.flatMap((id) => {
28
28
  const value = roleValueOrDefault(id, byId.get(id));
29
- return value ? [[`--${id}`, value]] : [];
29
+ return value && isSafePaletteEntry(id, value)
30
+ ? [[`--${id}`, value]]
31
+ : [];
30
32
  });
31
33
  byId.forEach((value, id) => {
32
- if (!isPaletteRoleId(id) && !isBlankColorValue(value)) {
34
+ if (!isPaletteRoleId(id) &&
35
+ !isBlankColorValue(value) &&
36
+ isSafePaletteEntry(id, value)) {
33
37
  entries.push([`--${id}`, value]);
34
38
  }
35
39
  });
36
40
  return entries;
37
41
  };
42
+ // `/` admits the slash alpha form (`rgb(0 0 0 / 50%)`). Without `*` or `<` it can't open a CSS
43
+ // comment or close the style tag.
44
+ const isSafePaletteEntry = (id, value) => /^[a-zA-Z0-9_-]+$/.test(id) &&
45
+ typeof value === 'string' &&
46
+ /^[a-zA-Z0-9#(),.%\s/-]+$/.test(value);
38
47
  export const paletteToCssVarDeclarations = (colors, options = {}) => paletteCssEntries(colors, options)
39
48
  .map(([name, value]) => `${name}: ${value};`)
40
49
  .join('\n ');
@@ -44,14 +53,21 @@ export const paletteToCssVarDeclarations = (colors, options = {}) => paletteCssE
44
53
  * attribute rather than an `id` so a duplicate stays queryable instead of being invalid HTML.
45
54
  */
46
55
  export const PALETTE_ROOT_ATTRIBUTE = 'data-palette-root';
47
- /** Full `<style>:root{…}</style>` block for `Page`'s `v-html` (standalone surfaces). */
48
- export const buildPaletteRootCss = (colors) => {
56
+ /** CSS text for Page's stable native style element on standalone surfaces. */
57
+ export const buildPaletteRootCssText = (colors) => {
49
58
  const declarations = paletteToCssVarDeclarations(colors);
50
59
  return declarations
51
- ? `<style ${PALETTE_ROOT_ATTRIBUTE}>
52
- :root {
60
+ ? `:root {
53
61
  ${declarations}
54
- }
62
+ }`
63
+ : '';
64
+ };
65
+ /** Full `<style>:root{…}</style>` fragment retained for callers outside Page. */
66
+ export const buildPaletteRootCss = (colors) => {
67
+ const css = buildPaletteRootCssText(colors);
68
+ return css
69
+ ? `<style ${PALETTE_ROOT_ATTRIBUTE}>
70
+ ${css}
55
71
  </style>`
56
72
  : '';
57
73
  };
@@ -70,15 +86,22 @@ export const PAGE_SCOPE_ID_ATTRIBUTE = 'data-page-scope';
70
86
  * card's block targets its own nodes instead, shadowing the canvas `:root` for its subtree.
71
87
  * Role defaults are forced so no role name falls through to the canvas (see `paletteCssEntries`).
72
88
  */
73
- export const buildPaletteScopedCss = (colors, scopeId) => {
89
+ export const buildPaletteScopedCssText = (colors, scopeId) => {
74
90
  const declarations = paletteToCssVarDeclarations(colors, {
75
91
  forceRoleDefaults: true,
76
92
  });
77
93
  return declarations && scopeId
78
- ? `<style ${PALETTE_SCOPED_ATTRIBUTE}>
79
- [${PAGE_SCOPE_ID_ATTRIBUTE}="${scopeId}"] {
94
+ ? `[${PAGE_SCOPE_ID_ATTRIBUTE}="${scopeId}"] {
80
95
  ${declarations}
81
- }
96
+ }`
97
+ : '';
98
+ };
99
+ /** Full scoped `<style>` fragment retained for callers outside Page. */
100
+ export const buildPaletteScopedCss = (colors, scopeId) => {
101
+ const css = buildPaletteScopedCssText(colors, scopeId);
102
+ return css
103
+ ? `<style ${PALETTE_SCOPED_ATTRIBUTE}>
104
+ ${css}
82
105
  </style>`
83
106
  : '';
84
107
  };
@@ -0,0 +1,19 @@
1
+ import type { ComputedRef, InjectionKey } from 'vue';
2
+ import type { JSONContent } from '@tiptap/vue-3';
3
+ import { type GlobalTextStyleDeclaration, type TextStyleOptions } from '../models/styles.model';
4
+ import { type RoleVarMarkAttr } from '@shared/text-role-typography.util';
5
+ export { ROLE_VAR_ATTRS, roleVarRef, runTypographyFillValue, textRoleClassName, type RoleVarMarkAttr, } from '@shared/text-role-typography.util';
6
+ export declare const TEXT_ROLE_OPTIONS_KEY: InjectionKey<ComputedRef<TextStyleOptions | undefined>>;
7
+ export declare const TEXT_ROLE_STYLE_ATTRIBUTE = "data-text-roles";
8
+ export declare const TEXT_ROLE_SCOPED_ATTRIBUTE = "data-text-roles-scoped";
9
+ export declare const roleStyleFor: (type: string | undefined, options: TextStyleOptions | undefined) => GlobalTextStyleDeclaration | undefined;
10
+ export declare const roleClassFor: (type: string | undefined) => string | undefined;
11
+ export declare const cssFontFamilyValue: (value: string) => string;
12
+ export declare const roleTypographyStyle: (own: Partial<Record<RoleVarMarkAttr, string>> | undefined, roleStyle: Partial<Record<RoleVarMarkAttr, string>> | undefined, options?: {
13
+ omit?: RoleVarMarkAttr[];
14
+ }) => Partial<Record<RoleVarMarkAttr, string>>;
15
+ export declare const fillRteRunTypography: (doc: JSONContent, roleStyle: Partial<Record<RoleVarMarkAttr, string>> | undefined, styleObj: Partial<Record<RoleVarMarkAttr, string>> | undefined) => JSONContent;
16
+ export declare const buildTextRoleRootCssText: (textStyleOptions: TextStyleOptions) => string;
17
+ export declare const buildTextRoleRootCss: (textStyleOptions: TextStyleOptions) => string;
18
+ export declare const buildTextRoleScopedCssText: (textStyleOptions: TextStyleOptions, scopeId: string) => string;
19
+ export declare const buildTextRoleScopedCss: (textStyleOptions: TextStyleOptions, scopeId: string) => string;