@designcrowd/library.brand-page 5.17.28 → 5.18.0

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 (380) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-CJZpKPNH.js → CreatedOnBrandCrowd-de-de-xmkupPus.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DkIa7iEb.js → CreatedOnBrandCrowd-en-us-Ck7EdTtb.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CE2p6XHz.js → CreatedOnBrandCrowd-es-es-BC8sJuDH.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-BBjOZS3M.js → CreatedOnBrandCrowd-fr-ca-CN-UBe1q.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-BBjOZS3M.js → CreatedOnBrandCrowd-fr-fr-CN-UBe1q.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-Dayzl4BZ.js → CreatedOnBrandCrowd-pt-br-CajQyNkx.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-Dayzl4BZ.js → CreatedOnBrandCrowd-pt-pt-CajQyNkx.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CFzDqfCb.js → CreatedOnDcom-de-de-BRCNMmDq.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-C2jIPBDY.js → CreatedOnDcom-en-us-BzQDtZhc.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-qejpzqho.js → CreatedOnDcom-es-es-D-qAM4Cd.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-DMO9Ld7K.js → CreatedOnDcom-fr-ca-CZ1irFOc.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-BFWN9qTP.js → CreatedOnDcom-fr-fr-Gb5BCF0N.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CneD3ghF.js → CreatedOnDcom-pt-br-CAQV0q6o.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-Cg1B7s0o.js → CreatedOnDcom-pt-pt-D6tQdQFh.js} +1 -1
  15. package/lib/src/brand-page/components/image-gallery/ImageGalleryModal.mixin.js +2 -2
  16. package/lib/src/brand-page/models/brand-page-context.model.d.ts +0 -2
  17. package/lib/src/brand-page/models/brand-page-context.model.js +1 -11
  18. package/lib/src/brand-page/models/index.d.ts +1 -0
  19. package/lib/src/brand-page/models/index.js +1 -0
  20. package/lib/src/brand-page/utils/color.util.js +23 -3
  21. package/lib/src/brand-page/utils/raygun.util.d.ts +5 -1
  22. package/lib/src/brand-page/utils/raygun.util.js +7 -2
  23. package/lib/src/brand-page/utils/svg-color.util.js +1 -2
  24. package/lib/src/brand-page/utils/view-model.util.js +1 -1
  25. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -31
  26. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -2
  27. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +2 -31
  28. package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +0 -14
  29. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -28
  30. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +0 -28
  31. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +0 -28
  32. package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +0 -28
  33. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +0 -28
  34. package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +0 -28
  35. package/lib/src/brand-page-maker/composables/ai-chat/aiErrorCopy.d.ts +35 -0
  36. package/lib/src/brand-page-maker/composables/ai-chat/aiErrorCopy.js +108 -0
  37. package/lib/src/brand-page-maker/composables/ai-chat/{useAiChat.d.ts → types.d.ts} +5 -13
  38. package/lib/src/brand-page-maker/composables/ai-chat/types.js +1 -0
  39. package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +19 -0
  40. package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
  41. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.d.ts +1 -1
  42. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +488 -82
  43. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +5 -5
  44. package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +6 -16
  45. package/lib/src/brand-page-maker/composables/useEventTracker.js +19 -21
  46. package/lib/src/brand-page-maker/constants/sidebar-constant.d.ts +0 -1
  47. package/lib/src/brand-page-maker/constants/sidebar-constant.js +7 -15
  48. package/lib/src/brand-page-maker/convertors/image-aspect-ratio.convertor.js +2 -2
  49. package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
  50. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +30660 -0
  51. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.js +34 -0
  52. package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.d.ts +1 -1
  53. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +0 -28
  54. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +42 -2
  55. package/lib/src/brand-page-maker/stores/index.d.ts +1 -1
  56. package/lib/src/brand-page-maker/stores/index.js +1 -1
  57. package/lib/src/brand-page-maker/stores/user/user-store.js +0 -1
  58. package/lib/src/bundled-translations-CnareLWC.js +175 -0
  59. package/lib/src/bundled-translations.de-DE-2Ys7epLO.js +175 -0
  60. package/lib/src/bundled-translations.es-ES-Cjp-G8rT.js +175 -0
  61. package/lib/src/bundled-translations.fr-CA-CsaW4Oae.js +175 -0
  62. package/lib/src/bundled-translations.fr-FR-DIT2dd8J.js +175 -0
  63. package/lib/src/bundled-translations.pt-BR-BamoBpDW.js +175 -0
  64. package/lib/src/bundled-translations.pt-PT-C9A4hY_e.js +175 -0
  65. package/lib/src/bundles/bundled-translations.de-DE.json +1 -20
  66. package/lib/src/bundles/bundled-translations.es-ES.json +1 -20
  67. package/lib/src/bundles/bundled-translations.fr-CA.json +1 -20
  68. package/lib/src/bundles/bundled-translations.fr-FR.json +1 -20
  69. package/lib/src/bundles/bundled-translations.json +1 -20
  70. package/lib/src/bundles/bundled-translations.pt-BR.json +1 -20
  71. package/lib/src/bundles/bundled-translations.pt-PT.json +1 -20
  72. package/lib/src/clients/ai-assistant-client.d.ts +30 -29
  73. package/lib/src/clients/ai-assistant-client.js +16 -16
  74. package/lib/src/clients/design-template-client.d.ts +0 -2
  75. package/lib/src/clients/design-template-client.js +0 -38
  76. package/lib/src/clients/websocket-gateway-client.d.ts +9 -1
  77. package/lib/src/composables/useTranslate.d.ts +2 -1
  78. package/lib/src/composables/useTranslate.js +2 -1
  79. package/lib/src/constants/ui.d.ts +0 -1
  80. package/lib/src/css/library.brand-page-brandCrowd.min.css +225 -134
  81. package/lib/src/css/library.brand-page-brandPage.min.css +227 -121
  82. package/lib/src/css/library.brand-page-designCom.min.css +225 -134
  83. package/lib/src/css/library.brand-page-preview.min.css +225 -118
  84. package/lib/src/index.d.ts +1 -1
  85. package/lib/src/index.mjs +1 -1
  86. package/lib/src/{lib-33w_DBny.js → lib-CSRUPpSo.js} +30887 -29395
  87. package/lib/src/metadata-builder/ai-metadata-executor.d.ts +21 -0
  88. package/lib/src/metadata-builder/ai-metadata-executor.js +56 -3
  89. package/lib/src/metadata-builder/builders/add-page-builder.d.ts +2 -4
  90. package/lib/src/metadata-builder/builders/add-page-builder.js +5 -8
  91. package/lib/src/metadata-builder/builders/footer-builder.d.ts +11 -0
  92. package/lib/src/metadata-builder/builders/footer-builder.js +151 -0
  93. package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +15 -0
  94. package/lib/src/metadata-builder/builders/global-styles-builder.js +129 -0
  95. package/lib/src/metadata-builder/builders/header-builder.d.ts +11 -0
  96. package/lib/src/metadata-builder/builders/header-builder.js +167 -0
  97. package/lib/src/metadata-builder/builders/rename-page-builder.d.ts +12 -0
  98. package/lib/src/metadata-builder/builders/rename-page-builder.js +49 -0
  99. package/lib/src/metadata-builder/builders/section-builders/about-section-builder.d.ts +2 -0
  100. package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +44 -4
  101. package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.d.ts +2 -0
  102. package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +70 -6
  103. package/lib/src/metadata-builder/builders/section-builders/base-section-builder.d.ts +36 -4
  104. package/lib/src/metadata-builder/builders/section-builders/base-section-builder.js +102 -12
  105. package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.d.ts +8 -0
  106. package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +50 -0
  107. package/lib/src/metadata-builder/builders/section-builders/button-section-builder.d.ts +2 -0
  108. package/lib/src/metadata-builder/builders/section-builders/button-section-builder.js +5 -1
  109. package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.d.ts +2 -0
  110. package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +47 -3
  111. package/lib/src/metadata-builder/builders/section-builders/delete-section-builder.d.ts +2 -1
  112. package/lib/src/metadata-builder/builders/section-builders/delete-section-builder.js +5 -2
  113. package/lib/src/metadata-builder/builders/section-builders/divider-section-builder.d.ts +2 -0
  114. package/lib/src/metadata-builder/builders/section-builders/divider-section-builder.js +11 -1
  115. package/lib/src/metadata-builder/builders/section-builders/image-gallery-builder.d.ts +2 -0
  116. package/lib/src/metadata-builder/builders/section-builders/image-gallery-builder.js +52 -13
  117. package/lib/src/metadata-builder/builders/section-builders/images-section-builder.d.ts +2 -0
  118. package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +47 -17
  119. package/lib/src/metadata-builder/builders/section-builders/index.d.ts +1 -0
  120. package/lib/src/metadata-builder/builders/section-builders/index.js +1 -0
  121. package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.d.ts +2 -0
  122. package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +20 -2
  123. package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.d.ts +2 -0
  124. package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +20 -2
  125. package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.d.ts +2 -0
  126. package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +36 -2
  127. package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.d.ts +2 -0
  128. package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +70 -27
  129. package/lib/src/metadata-builder/builders/section-builders/social-links-builder.d.ts +2 -0
  130. package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +7 -2
  131. package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.d.ts +2 -0
  132. package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +91 -26
  133. package/lib/src/metadata-builder/builders/section-builders/text-section-builder.d.ts +2 -0
  134. package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +69 -31
  135. package/lib/src/metadata-builder/builders/section-content-factory.d.ts +2 -2
  136. package/lib/src/metadata-builder/builders/section-content-factory.js +8 -2
  137. package/lib/src/metadata-builder/builders/section-field-maps.js +30 -2
  138. package/lib/src/metadata-builder/builders/section-field-utils.d.ts +46 -7
  139. package/lib/src/metadata-builder/builders/section-field-utils.js +86 -62
  140. package/lib/src/metadata-builder/builders/section-rules/about-section.rules.d.ts +2 -0
  141. package/lib/src/metadata-builder/builders/section-rules/about-section.rules.js +20 -0
  142. package/lib/src/metadata-builder/builders/section-rules/add-page.rules.d.ts +7 -0
  143. package/lib/src/metadata-builder/builders/section-rules/add-page.rules.js +8 -0
  144. package/lib/src/metadata-builder/builders/section-rules/banner-section.rules.d.ts +2 -0
  145. package/lib/src/metadata-builder/builders/section-rules/banner-section.rules.js +27 -0
  146. package/lib/src/metadata-builder/builders/section-rules/booking-section.rules.d.ts +2 -0
  147. package/lib/src/metadata-builder/builders/section-rules/booking-section.rules.js +16 -0
  148. package/lib/src/metadata-builder/builders/section-rules/button-section.rules.d.ts +2 -0
  149. package/lib/src/metadata-builder/builders/section-rules/button-section.rules.js +13 -0
  150. package/lib/src/metadata-builder/builders/section-rules/contact-form.rules.d.ts +2 -0
  151. package/lib/src/metadata-builder/builders/section-rules/contact-form.rules.js +16 -0
  152. package/lib/src/metadata-builder/builders/section-rules/divider-section.rules.d.ts +2 -0
  153. package/lib/src/metadata-builder/builders/section-rules/divider-section.rules.js +7 -0
  154. package/lib/src/metadata-builder/builders/section-rules/footer.rules.d.ts +4 -0
  155. package/lib/src/metadata-builder/builders/section-rules/footer.rules.js +5 -0
  156. package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +6 -0
  157. package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +26 -0
  158. package/lib/src/metadata-builder/builders/section-rules/header.rules.d.ts +4 -0
  159. package/lib/src/metadata-builder/builders/section-rules/header.rules.js +41 -0
  160. package/lib/src/metadata-builder/builders/section-rules/image-gallery.rules.d.ts +2 -0
  161. package/lib/src/metadata-builder/builders/section-rules/image-gallery.rules.js +10 -0
  162. package/lib/src/metadata-builder/builders/section-rules/images-section.rules.d.ts +2 -0
  163. package/lib/src/metadata-builder/builders/section-rules/images-section.rules.js +31 -0
  164. package/lib/src/metadata-builder/builders/section-rules/mailing-list.rules.d.ts +2 -0
  165. package/lib/src/metadata-builder/builders/section-rules/mailing-list.rules.js +11 -0
  166. package/lib/src/metadata-builder/builders/section-rules/profile.rules.d.ts +2 -0
  167. package/lib/src/metadata-builder/builders/section-rules/profile.rules.js +14 -0
  168. package/lib/src/metadata-builder/builders/section-rules/rename-page.rules.d.ts +7 -0
  169. package/lib/src/metadata-builder/builders/section-rules/rename-page.rules.js +8 -0
  170. package/lib/src/metadata-builder/builders/section-rules/shapes-section.rules.d.ts +2 -0
  171. package/lib/src/metadata-builder/builders/section-rules/shapes-section.rules.js +27 -0
  172. package/lib/src/metadata-builder/builders/section-rules/social-links.rules.d.ts +2 -0
  173. package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +9 -0
  174. package/lib/src/metadata-builder/builders/section-rules/testimonial-section.rules.d.ts +7 -0
  175. package/lib/src/metadata-builder/builders/section-rules/testimonial-section.rules.js +26 -0
  176. package/lib/src/metadata-builder/builders/section-rules/text-section.rules.d.ts +2 -0
  177. package/lib/src/metadata-builder/builders/section-rules/text-section.rules.js +14 -0
  178. package/lib/src/metadata-builder/builders/shape-color-utils.d.ts +26 -0
  179. package/lib/src/metadata-builder/builders/shape-color-utils.js +52 -0
  180. package/lib/src/metadata-builder/builders/undo-builder.d.ts +48 -0
  181. package/lib/src/metadata-builder/builders/undo-builder.js +58 -0
  182. package/lib/src/metadata-builder/builders/update-content-text-style-builder.js +5 -1
  183. package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +15 -4
  184. package/lib/src/metadata-builder/helpers/rte.helpers.js +24 -10
  185. package/lib/src/metadata-builder/metadata-executor.d.ts +2 -1
  186. package/lib/src/metadata-builder/metadata-executor.js +32 -5
  187. package/lib/src/metadata-builder/models.d.ts +26 -1
  188. package/lib/src/metadata-builder/models.js +14 -1
  189. package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +144 -0
  190. package/lib/src/metadata-builder/parsers/ai-toolcall-parser.js +17 -0
  191. package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +113 -24
  192. package/lib/src/metadata-builder/parsers/section-tool-arguments.js +5 -1
  193. package/lib/src/metadata-builder/sanitizers/rte-schema-check.d.ts +22 -0
  194. package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +84 -0
  195. package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +47 -0
  196. package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +60 -0
  197. package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +41 -0
  198. package/lib/src/metadata-builder/sanitizers/section-args-validator.js +274 -0
  199. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -1
  200. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +2 -16
  201. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +0 -1
  202. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -1
  203. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +2 -3
  204. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +0 -4
  205. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +6 -8
  206. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +0 -28
  207. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +2 -1
  208. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +0 -28
  209. package/lib/src/shared/navigation-style-settings/store/index.js +1 -0
  210. package/lib/src/shared/page-navigation/store/page-navigation-store.js +1 -20
  211. package/lib/src/shared/page-navigation/utils/nav-order-utils.d.ts +3 -0
  212. package/lib/src/shared/page-navigation/utils/nav-order-utils.js +20 -0
  213. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -30
  214. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -28
  215. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +2 -43
  216. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +0 -30
  217. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +2 -3
  218. package/lib/src/shared/side-bar/store/side-bar-store.d.ts +0 -12
  219. package/lib/src/shared/side-bar/store/side-bar-store.js +0 -7
  220. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -29
  221. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +2 -1
  222. package/lib/src/utils/build-asset-manifest.d.ts +26 -0
  223. package/lib/src/utils/build-asset-manifest.js +114 -0
  224. package/lib/src/utils/minify-brand-page-metadata.d.ts +49 -1
  225. package/lib/src/utils/minify-brand-page-metadata.js +216 -129
  226. package/package.json +1 -1
  227. package/src/brand-page/components/banner-section/BannerSection.vue +1 -1
  228. package/src/brand-page/components/contact-form/ContactForm.vue +29 -26
  229. package/src/brand-page/components/image-gallery/ImageGalleryModal.mixin.ts +6 -2
  230. package/src/brand-page/components/text-media-section/TextMediaSection.vue +1 -5
  231. package/src/brand-page/models/brand-page-context.model.ts +1 -25
  232. package/src/brand-page/models/index.ts +1 -0
  233. package/src/brand-page/utils/color.util.test.ts +48 -0
  234. package/src/brand-page/utils/color.util.ts +29 -4
  235. package/src/brand-page/utils/raygun.util.ts +11 -2
  236. package/src/brand-page/utils/svg-color.util.ts +1 -3
  237. package/src/brand-page/utils/view-model.util.ts +1 -4
  238. package/src/brand-page-maker/components/ai-text-edit/AiChatbox.vue +2 -2
  239. package/src/brand-page-maker/components/ai-text-edit/AiProgressFeed.vue +162 -0
  240. package/src/brand-page-maker/components/ai-text-edit/TextBubble.vue +57 -5
  241. package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.de-DE.json +0 -20
  242. package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.es-ES.json +0 -20
  243. package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.fr-CA.json +0 -20
  244. package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.fr-FR.json +0 -20
  245. package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.json +0 -20
  246. package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.pt-BR.json +0 -20
  247. package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.pt-PT.json +0 -20
  248. package/src/brand-page-maker/components/ai-website-builder/AiWebsiteBuilder.vue +1 -2
  249. package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.de-DE.json +3 -0
  250. package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.es-ES.json +3 -0
  251. package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.fr-CA.json +3 -0
  252. package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.fr-FR.json +3 -0
  253. package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.json +3 -0
  254. package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.pt-BR.json +3 -0
  255. package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.pt-PT.json +3 -0
  256. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +3 -28
  257. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -2
  258. package/src/brand-page-maker/composables/ai-chat/aiErrorCopy.test.ts +229 -0
  259. package/src/brand-page-maker/composables/ai-chat/aiErrorCopy.ts +164 -0
  260. package/src/brand-page-maker/composables/ai-chat/types.ts +49 -0
  261. package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +20 -0
  262. package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +651 -94
  263. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +9 -9
  264. package/src/brand-page-maker/composables/useEventTracker.ts +31 -25
  265. package/src/brand-page-maker/constants/sidebar-constant.ts +7 -15
  266. package/src/brand-page-maker/convertors/image-aspect-ratio.convertor.ts +2 -2
  267. package/src/brand-page-maker/convertors/text-size-value.convertor.ts +3 -3
  268. package/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.ts +54 -0
  269. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +76 -0
  270. package/src/brand-page-maker/stores/index.ts +1 -1
  271. package/src/brand-page-maker/stores/user/user-store.ts +0 -1
  272. package/src/bundles/bundled-translations.de-DE.json +1 -20
  273. package/src/bundles/bundled-translations.es-ES.json +1 -20
  274. package/src/bundles/bundled-translations.fr-CA.json +1 -20
  275. package/src/bundles/bundled-translations.fr-FR.json +1 -20
  276. package/src/bundles/bundled-translations.json +1 -20
  277. package/src/bundles/bundled-translations.pt-BR.json +1 -20
  278. package/src/bundles/bundled-translations.pt-PT.json +1 -20
  279. package/src/clients/ai-assistant-client.ts +59 -46
  280. package/src/clients/design-template-client.ts +0 -66
  281. package/src/clients/websocket-gateway-client.ts +17 -1
  282. package/src/composables/useTranslate.ts +3 -0
  283. package/src/constants/ui.ts +0 -1
  284. package/src/lib.ts +1 -0
  285. package/src/metadata-builder/ai-metadata-executor.ts +94 -1
  286. package/src/metadata-builder/builders/add-page-builder.ts +9 -13
  287. package/src/metadata-builder/builders/footer-builder.test.ts +76 -0
  288. package/src/metadata-builder/builders/footer-builder.ts +226 -0
  289. package/src/metadata-builder/builders/global-styles-builder.ts +187 -0
  290. package/src/metadata-builder/builders/header-builder.test.ts +106 -0
  291. package/src/metadata-builder/builders/header-builder.ts +254 -0
  292. package/src/metadata-builder/builders/rename-page-builder.ts +79 -0
  293. package/src/metadata-builder/builders/section-builders/about-section-builder.ts +73 -5
  294. package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +112 -7
  295. package/src/metadata-builder/builders/section-builders/base-section-builder.ts +149 -11
  296. package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +87 -0
  297. package/src/metadata-builder/builders/section-builders/button-section-builder.ts +6 -1
  298. package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +74 -4
  299. package/src/metadata-builder/builders/section-builders/delete-section-builder.ts +15 -1
  300. package/src/metadata-builder/builders/section-builders/divider-section-builder.ts +13 -1
  301. package/src/metadata-builder/builders/section-builders/image-gallery-builder.ts +91 -31
  302. package/src/metadata-builder/builders/section-builders/images-section-builder.ts +102 -48
  303. package/src/metadata-builder/builders/section-builders/index.ts +1 -0
  304. package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +38 -2
  305. package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +38 -2
  306. package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +55 -3
  307. package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +170 -77
  308. package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +119 -0
  309. package/src/metadata-builder/builders/section-builders/social-links-builder.ts +13 -2
  310. package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +178 -57
  311. package/src/metadata-builder/builders/section-builders/text-section-builder.ts +130 -30
  312. package/src/metadata-builder/builders/section-content-factory.ts +15 -2
  313. package/src/metadata-builder/builders/section-field-maps.ts +34 -1
  314. package/src/metadata-builder/builders/section-field-utils.ts +131 -72
  315. package/src/metadata-builder/builders/section-rules/about-section.rules.ts +38 -0
  316. package/src/metadata-builder/builders/section-rules/add-page.rules.ts +17 -0
  317. package/src/metadata-builder/builders/section-rules/banner-section.rules.ts +49 -0
  318. package/src/metadata-builder/builders/section-rules/booking-section.rules.ts +34 -0
  319. package/src/metadata-builder/builders/section-rules/button-section.rules.ts +22 -0
  320. package/src/metadata-builder/builders/section-rules/contact-form.rules.ts +30 -0
  321. package/src/metadata-builder/builders/section-rules/divider-section.rules.ts +17 -0
  322. package/src/metadata-builder/builders/section-rules/footer.rules.ts +21 -0
  323. package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +44 -0
  324. package/src/metadata-builder/builders/section-rules/header.rules.ts +75 -0
  325. package/src/metadata-builder/builders/section-rules/image-gallery.rules.ts +22 -0
  326. package/src/metadata-builder/builders/section-rules/images-section.rules.ts +55 -0
  327. package/src/metadata-builder/builders/section-rules/mailing-list.rules.ts +21 -0
  328. package/src/metadata-builder/builders/section-rules/profile.rules.ts +27 -0
  329. package/src/metadata-builder/builders/section-rules/rename-page.rules.ts +17 -0
  330. package/src/metadata-builder/builders/section-rules/shapes-section.rules.ts +51 -0
  331. package/src/metadata-builder/builders/section-rules/social-links.rules.ts +27 -0
  332. package/src/metadata-builder/builders/section-rules/testimonial-section.rules.ts +48 -0
  333. package/src/metadata-builder/builders/section-rules/text-section.rules.ts +28 -0
  334. package/src/metadata-builder/builders/shape-color-utils.test.ts +115 -0
  335. package/src/metadata-builder/builders/shape-color-utils.ts +75 -0
  336. package/src/metadata-builder/builders/undo-builder.ts +105 -0
  337. package/src/metadata-builder/builders/update-content-text-style-builder.ts +4 -1
  338. package/src/metadata-builder/helpers/rte.helpers.ts +27 -13
  339. package/src/metadata-builder/metadata-executor.ts +42 -2
  340. package/src/metadata-builder/models.ts +39 -1
  341. package/src/metadata-builder/parsers/ai-toolcall-parser.ts +152 -0
  342. package/src/metadata-builder/parsers/section-tool-arguments.ts +138 -24
  343. package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +659 -0
  344. package/src/metadata-builder/sanitizers/rte-schema-check.ts +99 -0
  345. package/src/metadata-builder/sanitizers/sanitizer-rules.ts +97 -0
  346. package/src/metadata-builder/sanitizers/section-args-validator.ts +445 -0
  347. package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +10 -16
  348. package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +0 -1
  349. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +6 -10
  350. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +1 -23
  351. package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +0 -15
  352. package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +0 -15
  353. package/src/shared/navigation-style-settings/store/index.ts +5 -0
  354. package/src/shared/page-navigation/store/page-navigation-store.ts +4 -31
  355. package/src/shared/page-navigation/utils/nav-order-utils.ts +32 -0
  356. package/src/shared/side-bar/components/SideBar.vue +14 -1
  357. package/src/shared/side-bar/store/side-bar-store.ts +0 -20
  358. package/src/utils/build-asset-manifest.ts +153 -0
  359. package/src/utils/minify-brand-page-metadata.ts +362 -130
  360. package/lib/src/brand-page-maker/composables/ai-chat/useAiChat.js +0 -368
  361. package/lib/src/brand-page-maker/composables/ai-chat/useAiTextEditPrompts.d.ts +0 -18
  362. package/lib/src/brand-page-maker/composables/ai-chat/useAiTextEditPrompts.js +0 -144
  363. package/lib/src/brand-page-maker/stores/ai-thread/ai-thread-store.d.ts +0 -155
  364. package/lib/src/brand-page-maker/stores/ai-thread/ai-thread-store.js +0 -25
  365. package/lib/src/brand-page-maker/utils/mixpanel.util.d.ts +0 -1
  366. package/lib/src/brand-page-maker/utils/mixpanel.util.js +0 -29
  367. package/lib/src/bundled-translations-CNK7l6_v.js +0 -173
  368. package/lib/src/bundled-translations.de-DE-BLE4_y0H.js +0 -173
  369. package/lib/src/bundled-translations.es-ES-thO9osbg.js +0 -173
  370. package/lib/src/bundled-translations.fr-CA-BZkhiNgU.js +0 -173
  371. package/lib/src/bundled-translations.fr-FR-bhDLPKgZ.js +0 -173
  372. package/lib/src/bundled-translations.pt-BR-CI9a5Bq1.js +0 -173
  373. package/lib/src/bundled-translations.pt-PT-DBoErBaq.js +0 -173
  374. package/src/brand-page-maker/components/ai-text-edit/AiTextEdit.vue +0 -154
  375. package/src/brand-page-maker/composables/ai-chat/useAiChat.ts +0 -562
  376. package/src/brand-page-maker/composables/ai-chat/useAiTextEditPrompts.ts +0 -196
  377. package/src/brand-page-maker/stores/ai-thread/ai-thread-store.ts +0 -31
  378. package/src/brand-page-maker/utils/mixpanel.util.ts +0 -42
  379. package/src/shared/content-settings/components/generate-ai-button/GenerateAiButton.vue +0 -114
  380. package/src/shared/content-settings/components/generate-ai-modal/GenerateAiModal.vue +0 -761
@@ -0,0 +1,60 @@
1
+ /**
2
+ * sanitizer-rules.ts
3
+ *
4
+ * Shared style/logo/page constraint rules and the SectionRules interface.
5
+ * Per-section rules live colocated with each builder (e.g. banner-section.rules.ts).
6
+ */
7
+ import { MIN_TEXT_SIZE_PX, MAX_TEXT_SIZE_PX, MIN_LINE_HEIGHT, MAX_LINE_HEIGHT, MIN_LETTER_SPACING_PERCENT, MAX_LETTER_SPACING_PERCENT, FONT_FAMILY_CONFIGS, FONT_FAMILY_KEYS, } from '../../brand-page/constants/font.constants';
8
+ import { MAX_PAGE_TITLE_LENGTH, MAX_SUBPAGE_TITLE_LENGTH, } from '../../shared/page-settings/utils';
9
+ import { LOGO_SLIDER_DESKTOP_MIN, LOGO_SLIDER_DESKTOP_MAX, LOGO_SLIDER_MOBILE_MIN, LOGO_SLIDER_MOBILE_MAX, } from '../../brand-page/constants/styles.constants';
10
+ import { pxToEm } from '../../brand-page-maker/utils/text.util';
11
+ // ─── 1. Style property rules ──────────────────────────────────────────────────
12
+ // Applies to any TextStyleArguments object (section styles, global styles,
13
+ // header/footer viewport overrides).
14
+ //
15
+ // fontFamilyNames / fontFamilyKeys use Set (not readonly arrays) because both
16
+ // are derived dynamically from FONT_FAMILY_CONFIGS at runtime — as const
17
+ // literal narrowing is not possible. Consumers call .has(value).
18
+ export const STYLE_RULES = {
19
+ // fontSize bounds are in px (natural unit for clamping).
20
+ // Flow: parse input unit → convert to px → clamp → pxToEm(clampedPx)
21
+ fontUnit: {
22
+ allowedUnits: ['em'],
23
+ },
24
+ fontSize: {
25
+ minEm: pxToEm(String(MIN_TEXT_SIZE_PX)),
26
+ maxEm: pxToEm(String(MAX_TEXT_SIZE_PX)),
27
+ },
28
+ lineHeight: {
29
+ min: MIN_LINE_HEIGHT,
30
+ max: MAX_LINE_HEIGHT,
31
+ },
32
+ letterSpacing: {
33
+ min: MIN_LETTER_SPACING_PERCENT,
34
+ max: MAX_LETTER_SPACING_PERCENT,
35
+ },
36
+ // Two separate sets because the format differs by context:
37
+ // TextStyleArguments.fontFamily → display name (e.g. 'Playfair Display')
38
+ // UpdateGlobalStylesArguments.textFontFamily → camelCase key (e.g. 'playfairDisplay')
39
+ fontFamilyNames: new Set(Object.values(FONT_FAMILY_CONFIGS).map((c) =>
40
+ // Some font names are stored with surrounding single-quotes (e.g. "'Exo 2'").
41
+ // Strip them so the Set matches the bare names the AI sends.
42
+ c.name.replace(/^'(.*)'$/, '$1'))),
43
+ fontFamilyKeys: new Set(Object.keys(FONT_FAMILY_KEYS)),
44
+ };
45
+ // ─── 2. Logo size rules ───────────────────────────────────────────────────────
46
+ // Applies to logo_image_height / logo_image_width in UpdateHeaderArguments and
47
+ // UpdateFooterArguments viewport overrides. Values are in rem units.
48
+ export const LOGO_SIZE_RULES = {
49
+ unit: 'rem',
50
+ desktop: { min: LOGO_SLIDER_DESKTOP_MIN, max: LOGO_SLIDER_DESKTOP_MAX },
51
+ mobile: { min: LOGO_SLIDER_MOBILE_MIN, max: LOGO_SLIDER_MOBILE_MAX },
52
+ };
53
+ // ─── 3. Page rules ────────────────────────────────────────────────────────────
54
+ // Applies to add_page (page_name), rename_page (page_name), and update_header
55
+ // (nav_routes[].display_name).
56
+ export const PAGE_RULES = {
57
+ pageName: MAX_PAGE_TITLE_LENGTH,
58
+ subPageName: MAX_SUBPAGE_TITLE_LENGTH,
59
+ navDisplayName: MAX_PAGE_TITLE_LENGTH,
60
+ };
@@ -0,0 +1,41 @@
1
+ import { type ItemCapRule } from './sanitizer-rules';
2
+ /**
3
+ * Validates CSS string-format style attrs (fontSize em, fontFamily name,
4
+ * lineHeight unitless, letterSpacing em) against STYLE_RULES bounds.
5
+ * Used for both RTE textStyle mark attrs and GlobalStyles textStyleOptions.
6
+ * Returns the first error string, or null if all attrs are valid / absent.
7
+ */
8
+ export declare function validateStringStyleAttrs(path: string, attrs: {
9
+ fontSize?: string | null;
10
+ fontFamily?: string | null;
11
+ lineHeight?: string | null;
12
+ letterSpacing?: string | null;
13
+ }): string | null;
14
+ export interface ValidationContext {
15
+ brandPageType?: string;
16
+ mode?: 'create' | 'update';
17
+ }
18
+ /**
19
+ * A pure validation check: record + context → one error string or null.
20
+ * All checks operate on Record<string, unknown> — no concrete section type casting.
21
+ */
22
+ export type SectionCheck = (record: Record<string, unknown>, ctx: ValidationContext) => string | null;
23
+ export declare const textCheck: (field: string, max: number) => SectionCheck;
24
+ export declare const styleCheck: (field: string) => SectionCheck;
25
+ export declare const rteStyleCheck: (field: string) => SectionCheck;
26
+ export declare const itemTextCheck: (arrayField: string, itemField: string, max: number) => SectionCheck;
27
+ export declare const itemStyleCheck: (arrayField: string, itemField: string) => SectionCheck;
28
+ export declare const itemRteStyleCheck: (arrayField: string, itemField: string) => SectionCheck;
29
+ export declare const enumCheck: (field: string, allowed: readonly string[], label?: string) => SectionCheck;
30
+ export declare const itemCapCheck: (cap: ItemCapRule, label?: string) => SectionCheck;
31
+ /**
32
+ * Runs an array of SectionChecks against the given args and context.
33
+ * Returns all non-null error strings.
34
+ */
35
+ export declare function runChecks(checks: SectionCheck[], args: Record<string, unknown>, ctx: ValidationContext): string[];
36
+ /**
37
+ * Validates a logo size value against LOGO_SIZE_RULES for the given viewport.
38
+ * The value must use "rem" units and fall within the viewport-specific bounds.
39
+ * Returns an error string, or null if valid / absent.
40
+ */
41
+ export declare function validateLogoSize(fieldLabel: string, value: string | undefined | null, viewport: 'desktop' | 'mobile'): string | null;
@@ -0,0 +1,274 @@
1
+ import { isTiptapDocument, } from '../parsers/section-tool-arguments';
2
+ import { LOGO_SIZE_RULES, STYLE_RULES, } from './sanitizer-rules';
3
+ // ─── Helpers ──────────────────────────────────────────────────────────────────
4
+ function extractPlainText(value) {
5
+ if (typeof value === 'string')
6
+ return value;
7
+ return value.content
8
+ .flatMap((block) => block.content ?? [])
9
+ .filter((node) => node.type === 'text')
10
+ .map((node) => node.text)
11
+ .join('');
12
+ }
13
+ const { fontUnit, fontSize, lineHeight, letterSpacing, fontFamilyNames } = STYLE_RULES;
14
+ const STYLE_PROPERTY_CHECKS = [
15
+ (fieldLabel, style) => {
16
+ if (style.fontSize == null)
17
+ return null;
18
+ const raw = style.fontSize.trim().toLowerCase();
19
+ const unit = fontUnit.allowedUnits[0];
20
+ const match = raw.match(new RegExp(`^(\\d+(?:\\.\\d+)?)${unit}$`));
21
+ if (!match) {
22
+ return `"${fieldLabel}.fontSize" must use "${unit}" units (got "${style.fontSize}")`;
23
+ }
24
+ const val = parseFloat(match[1]);
25
+ const min = parseFloat(fontSize.minEm);
26
+ const max = parseFloat(fontSize.maxEm);
27
+ return isNaN(val) || val < min || val > max
28
+ ? `"${fieldLabel}.fontSize" "${style.fontSize}" is out of bounds (${fontSize.minEm}–${fontSize.maxEm})`
29
+ : null;
30
+ },
31
+ (fieldLabel, style) => {
32
+ if (style.lineHeight == null)
33
+ return null;
34
+ const { min, max } = lineHeight;
35
+ const val = parseFloat(String(style.lineHeight));
36
+ return isNaN(val) || val < min || val > max
37
+ ? `"${fieldLabel}.lineHeight" ${style.lineHeight} is out of bounds (${min}–${max})`
38
+ : null;
39
+ },
40
+ (fieldLabel, style) => {
41
+ if (style.letterSpacing == null)
42
+ return null;
43
+ const { min, max } = letterSpacing;
44
+ const val = parseFloat(String(style.letterSpacing));
45
+ return isNaN(val) || val < min || val > max
46
+ ? `"${fieldLabel}.letterSpacing" ${style.letterSpacing} is out of bounds (${min}–${max})`
47
+ : null;
48
+ },
49
+ (fieldLabel, style) => {
50
+ if (style.fontFamily == null)
51
+ return null;
52
+ return !fontFamilyNames.has(style.fontFamily)
53
+ ? `"${fieldLabel}.fontFamily" "${style.fontFamily}" is not a recognized font family`
54
+ : null;
55
+ },
56
+ ];
57
+ function validateStyleArgs(fieldLabel, style) {
58
+ return STYLE_PROPERTY_CHECKS.flatMap((check) => {
59
+ const err = check(fieldLabel, style);
60
+ return err ? [err] : [];
61
+ });
62
+ }
63
+ const RTE_MARK_PROPERTY_CHECKS = [
64
+ (path, attrs) => {
65
+ if (attrs.fontSize == null)
66
+ return null;
67
+ const raw = attrs.fontSize.trim().toLowerCase();
68
+ const unit = fontUnit.allowedUnits[0];
69
+ const match = raw.match(new RegExp(`^(\\d+(?:\\.\\d+)?)${unit}$`));
70
+ if (!match) {
71
+ return `"${path}.fontSize" must use "em" units (got "${attrs.fontSize}")`;
72
+ }
73
+ const val = parseFloat(match[1]);
74
+ const min = parseFloat(fontSize.minEm);
75
+ const max = parseFloat(fontSize.maxEm);
76
+ return isNaN(val) || val < min || val > max
77
+ ? `"${path}.fontSize" "${attrs.fontSize}" is out of bounds (${fontSize.minEm}–${fontSize.maxEm})`
78
+ : null;
79
+ },
80
+ (path, attrs) => {
81
+ if (attrs.fontFamily == null)
82
+ return null;
83
+ return !fontFamilyNames.has(attrs.fontFamily)
84
+ ? `"${path}.fontFamily" "${attrs.fontFamily}" is not a recognized font family`
85
+ : null;
86
+ },
87
+ (path, attrs) => {
88
+ if (attrs.lineHeight == null)
89
+ return null;
90
+ const val = parseFloat(attrs.lineHeight);
91
+ const isUnitless = !isNaN(val) && attrs.lineHeight.trim() === String(val);
92
+ if (!isUnitless) {
93
+ return `"${path}.lineHeight" must be a unitless number (got "${attrs.lineHeight}")`;
94
+ }
95
+ return val < lineHeight.min || val > lineHeight.max
96
+ ? `"${path}.lineHeight" ${val} is out of bounds (${lineHeight.min}–${lineHeight.max})`
97
+ : null;
98
+ },
99
+ (path, attrs) => {
100
+ if (attrs.letterSpacing == null)
101
+ return null;
102
+ const raw = attrs.letterSpacing.trim().toLowerCase();
103
+ // "0" is valid CSS without units — treat as 0em.
104
+ if (raw === '0')
105
+ return null;
106
+ const match = raw.match(/^(\d+(?:\.\d+)?)em$/);
107
+ if (!match) {
108
+ return `"${path}.letterSpacing" must use "em" units (got "${attrs.letterSpacing}")`;
109
+ }
110
+ const val = parseFloat(match[1]);
111
+ const minEm = letterSpacing.min / 100;
112
+ const maxEm = letterSpacing.max / 100;
113
+ return val < minEm || val > maxEm
114
+ ? `"${path}.letterSpacing" ${attrs.letterSpacing} is out of bounds (${minEm}em–${maxEm}em)`
115
+ : null;
116
+ },
117
+ ];
118
+ /**
119
+ * Validates CSS string-format style attrs (fontSize em, fontFamily name,
120
+ * lineHeight unitless, letterSpacing em) against STYLE_RULES bounds.
121
+ * Used for both RTE textStyle mark attrs and GlobalStyles textStyleOptions.
122
+ * Returns the first error string, or null if all attrs are valid / absent.
123
+ */
124
+ export function validateStringStyleAttrs(path, attrs) {
125
+ for (const check of RTE_MARK_PROPERTY_CHECKS) {
126
+ const err = check(path, attrs);
127
+ if (err)
128
+ return err;
129
+ }
130
+ return null;
131
+ }
132
+ function validateRteMarkStyle(path, attrs) {
133
+ return validateStringStyleAttrs(path, attrs);
134
+ }
135
+ function validateRteDocument(fieldLabel, doc) {
136
+ for (const block of doc.content) {
137
+ for (const node of block.content ?? []) {
138
+ if (node.type !== 'text')
139
+ continue;
140
+ for (const mark of node.marks ?? []) {
141
+ if (mark.type !== 'textStyle' || !mark.attrs)
142
+ continue;
143
+ const err = validateRteMarkStyle(fieldLabel, mark.attrs);
144
+ if (err)
145
+ return err;
146
+ }
147
+ }
148
+ }
149
+ return null;
150
+ }
151
+ // ─── Check factories ──────────────────────────────────────────────────────────
152
+ export const textCheck = (field, max) => (record) => {
153
+ const value = record[field];
154
+ if (value == null)
155
+ return null;
156
+ const text = isTiptapDocument(value)
157
+ ? extractPlainText(value)
158
+ : String(value);
159
+ return text.length > max
160
+ ? `"${field}" exceeds the maximum length of ${max} characters (got ${text.length})`
161
+ : null;
162
+ };
163
+ export const styleCheck = (field) => (record) => {
164
+ const value = record[field];
165
+ if (value == null || typeof value !== 'object')
166
+ return null;
167
+ const errs = validateStyleArgs(field, value);
168
+ return errs[0] ?? null;
169
+ };
170
+ export const rteStyleCheck = (field) => (record) => {
171
+ const value = record[field];
172
+ if (!isTiptapDocument(value))
173
+ return null;
174
+ return validateRteDocument(field, value);
175
+ };
176
+ export const itemTextCheck = (arrayField, itemField, max) => (record) => {
177
+ const items = record[arrayField];
178
+ if (!Array.isArray(items))
179
+ return null;
180
+ for (let i = 0; i < items.length; i++) {
181
+ const value = items[i][itemField];
182
+ if (value == null)
183
+ continue;
184
+ const text = isTiptapDocument(value)
185
+ ? extractPlainText(value)
186
+ : String(value);
187
+ if (text.length > max) {
188
+ return `"${arrayField}[${i}].${itemField}" exceeds the maximum length of ${max} characters (got ${text.length})`;
189
+ }
190
+ }
191
+ return null;
192
+ };
193
+ export const itemStyleCheck = (arrayField, itemField) => (record) => {
194
+ const items = record[arrayField];
195
+ if (!Array.isArray(items))
196
+ return null;
197
+ for (let i = 0; i < items.length; i++) {
198
+ const value = items[i][itemField];
199
+ if (value == null || typeof value !== 'object')
200
+ continue;
201
+ const errs = validateStyleArgs(`${arrayField}[${i}].${itemField}`, value);
202
+ if (errs[0])
203
+ return errs[0];
204
+ }
205
+ return null;
206
+ };
207
+ export const itemRteStyleCheck = (arrayField, itemField) => (record) => {
208
+ const items = record[arrayField];
209
+ if (!Array.isArray(items))
210
+ return null;
211
+ for (let i = 0; i < items.length; i++) {
212
+ const value = items[i][itemField];
213
+ if (!isTiptapDocument(value))
214
+ continue;
215
+ const err = validateRteDocument(`${arrayField}[${i}].${itemField}`, value);
216
+ if (err)
217
+ return err;
218
+ }
219
+ return null;
220
+ };
221
+ export const enumCheck = (field, allowed, label) => (record) => {
222
+ const value = record[field];
223
+ if (value == null)
224
+ return null;
225
+ return !allowed.includes(value)
226
+ ? `"${field}" value "${value}" is not valid${label ? ` for "${label}"` : ''}. Valid values: ${allowed.join(', ')}`
227
+ : null;
228
+ };
229
+ export const itemCapCheck = (cap, label) => (record, ctx) => {
230
+ if (ctx.brandPageType == null)
231
+ return null;
232
+ const shouldCheck = ctx.mode === 'create' ||
233
+ (ctx.mode === 'update' &&
234
+ record['_replace_items']);
235
+ if (!shouldCheck)
236
+ return null;
237
+ const items = record[cap.arrayField];
238
+ const limit = ctx.brandPageType === 'brandSite' ? cap.brandSite : cap.brandPage;
239
+ return Array.isArray(items) && items.length > limit
240
+ ? `"${cap.arrayField}" has ${items.length} items but "${label ?? 'section'}" supports a maximum of ${limit}`
241
+ : null;
242
+ };
243
+ /**
244
+ * Runs an array of SectionChecks against the given args and context.
245
+ * Returns all non-null error strings.
246
+ */
247
+ export function runChecks(checks, args, ctx) {
248
+ return checks.flatMap((check) => {
249
+ const err = check(args, ctx);
250
+ return err ? [err] : [];
251
+ });
252
+ }
253
+ // ─── Logo size regex (compiled once at module init) ───────────────────────────
254
+ const LOGO_SIZE_REGEX = new RegExp(`^(\\d+(?:\\.\\d+)?)${LOGO_SIZE_RULES.unit}$`);
255
+ // ─── Shared field validators ──────────────────────────────────────────────────
256
+ /**
257
+ * Validates a logo size value against LOGO_SIZE_RULES for the given viewport.
258
+ * The value must use "rem" units and fall within the viewport-specific bounds.
259
+ * Returns an error string, or null if valid / absent.
260
+ */
261
+ export function validateLogoSize(fieldLabel, value, viewport) {
262
+ if (value == null)
263
+ return null;
264
+ const match = value.trim().toLowerCase().match(LOGO_SIZE_REGEX);
265
+ if (!match) {
266
+ return `"${fieldLabel}" must use "${LOGO_SIZE_RULES.unit}" units (got "${value}")`;
267
+ }
268
+ const num = parseFloat(match[1]);
269
+ const { min, max } = LOGO_SIZE_RULES[viewport];
270
+ if (num < min || num > max) {
271
+ return `"${fieldLabel}" ${value} is out of bounds (${min}rem–${max}rem)`;
272
+ }
273
+ return null;
274
+ }
@@ -815,10 +815,11 @@ declare const _default: import("vue").DefineComponent<{}, {
815
815
  sendTemplateSelectEvent: (templateId: string) => void;
816
816
  sendTemplateCategorySelectEvent: (category: string) => void;
817
817
  sendSidebarCategoryClickedEvent: (tabName: string) => void;
818
+ sendAddContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
819
+ sendRemoveContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
818
820
  sendAddContentContinuationEvent: (continuation: string) => void;
819
821
  sendUpsellOfferEvent: (upsellType: string) => void;
820
822
  sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
821
- sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
822
823
  sendAiSendPromptEvent: (ctaLocation: string) => void;
823
824
  sendAiStopGenerationEvent: (ctaLocation: string) => void;
824
825
  };
@@ -93,14 +93,7 @@ export default defineComponent({
93
93
  transformToRTE(this.pageSettingsStore, this.externalEditor, this.styleSettingsStore, newItem.settings.content);
94
94
  }
95
95
  // Send MixPanel add event
96
- this.eventTracker.sendWebsiteEvent({
97
- eventName: EVENTS.WEBSITE_MAKER_ADD_CONTENT,
98
- eventProps: {
99
- content_category: option.category,
100
- content_type: option.type,
101
- select_location: SELECT_LOCATIONS.SIDEBAR,
102
- },
103
- });
96
+ this.eventTracker.sendAddContentEvent(option.type, SELECT_LOCATIONS.SIDEBAR, option.category);
104
97
  if (option.displayMode === 'focused') {
105
98
  this.contentSettingsStore.pushMode({
106
99
  mode: CONTENT_SETTINGS_MODES.focusedContentItem,
@@ -149,14 +142,7 @@ export default defineComponent({
149
142
  onDeleteItem(payload, type) {
150
143
  this.contentSettingsStore.deleteItem(payload);
151
144
  // Send MixPanel remove event
152
- this.eventTracker.sendWebsiteEvent({
153
- eventName: EVENTS.WEBSITE_MAKER_REMOVE_CONTENT,
154
- eventProps: {
155
- content_category: this.contentSettingsStore.getContentCategory(type),
156
- content_type: type,
157
- select_location: SELECT_LOCATIONS.SIDEBAR,
158
- },
159
- });
145
+ this.eventTracker.sendRemoveContentEvent(type, SELECT_LOCATIONS.SIDEBAR, this.contentSettingsStore.getContentCategory(type));
160
146
  },
161
147
  onManagePageButtonClick() {
162
148
  this.contentSettingsStore.pushMode({
@@ -26,7 +26,6 @@ export const Sample = () => {
26
26
  canUseGettyVideos: true,
27
27
  canUseGoogleAdsense: false,
28
28
  googleAdsenseEnabled: false,
29
- canUseAITextGenerator: true,
30
29
  };
31
30
  const pinia = setupStoryPinia();
32
31
  const contentSettingsStore = useUiContentSettingsStore();
@@ -763,10 +763,11 @@ declare const _default: import("vue").DefineComponent<{}, {
763
763
  sendTemplateSelectEvent: (templateId: string) => void;
764
764
  sendTemplateCategorySelectEvent: (category: string) => void;
765
765
  sendSidebarCategoryClickedEvent: (tabName: string) => void;
766
+ sendAddContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
767
+ sendRemoveContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
766
768
  sendAddContentContinuationEvent: (continuation: string) => void;
767
769
  sendUpsellOfferEvent: (upsellType: string) => void;
768
770
  sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
769
- sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
770
771
  sendAiSendPromptEvent: (ctaLocation: string) => void;
771
772
  sendAiStopGenerationEvent: (ctaLocation: string) => void;
772
773
  };
@@ -471,8 +471,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
471
471
  setSelectedSettingsSection(payload: {
472
472
  sectionName?: string | undefined;
473
473
  }): void;
474
- setAiTextEditContext(payload: import("../../../side-bar/store").AiTextEditContext): void;
475
- clearAiTextEditContext(): void;
476
474
  }>;
477
475
  eventTracker: {
478
476
  sendShippingToggleEvent: (isEnabled: boolean) => void;
@@ -507,10 +505,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
507
505
  sendTemplateSelectEvent: (templateId: string) => void;
508
506
  sendTemplateCategorySelectEvent: (category: string) => void;
509
507
  sendSidebarCategoryClickedEvent: (tabName: string) => void;
508
+ sendAddContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
509
+ sendRemoveContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
510
510
  sendAddContentContinuationEvent: (continuation: string) => void;
511
511
  sendUpsellOfferEvent: (upsellType: string) => void;
512
512
  sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
513
- sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
514
513
  sendAiSendPromptEvent: (ctaLocation: string) => void;
515
514
  sendAiStopGenerationEvent: (ctaLocation: string) => void;
516
515
  };
@@ -698,8 +698,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
698
698
  setSelectedSettingsSection(payload: {
699
699
  sectionName?: string | undefined;
700
700
  }): void;
701
- setAiTextEditContext(payload: import("../../../side-bar/store").AiTextEditContext): void;
702
- clearAiTextEditContext(): void;
703
701
  }>;
704
702
  pageSettingsStore: import("pinia").Store<"uiPageSettings", import("../../../page-settings/store").PageSettingsState, {
705
703
  getFirstOrDefaultPage(): import("../../../page-settings/models").ContentPage;
@@ -822,9 +820,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
822
820
  showTextBg(): boolean;
823
821
  showToggle(): boolean | undefined;
824
822
  disableTransparent(): boolean;
825
- showGenerateText(): boolean;
826
823
  plainTextValue(): string;
827
- ctaLocation(): string;
828
824
  }, {
829
825
  onFieldChanged(payload: UpdateItemValuePayload<unknown>): void;
830
826
  onFieldChangeLogo(): void;
@@ -12,7 +12,12 @@ import { commonTr } from '@src/composables/useTranslate';
12
12
  import { getPlainTextFromRTE, replaceTextInRTE, RTE_ALLOWED_SECTION_TYPES, isRTEManagedStyleField, } from '@brand-page-maker/utils';
13
13
  import { isDefaultContentText } from '@shared/content-settings/utils';
14
14
  import { useUiLogoSettingsStore } from '../../../logo-settings/store';
15
- import { getCtaLocationFromFieldType } from '@brand-page-maker/utils/mixpanel.util';
15
+ const RTE_DISALLOWED_STYLE_FIELD_NAMES = [
16
+ 'descriptionStyle',
17
+ 'titleStyle',
18
+ 'textStyle',
19
+ 'paragraphStyle',
20
+ ];
16
21
  const AI_ALLOWED_SECTION_TYPES = [
17
22
  'banner-section',
18
23
  'text',
@@ -181,19 +186,12 @@ export default defineComponent({
181
186
  disableTransparent() {
182
187
  return this.field.disableTransparent || false;
183
188
  },
184
- showGenerateText() {
185
- return (AI_ALLOWED_SECTION_TYPES.includes(this.type) &&
186
- AI_ALLOWED_FIELD_NAMES.includes(this.fieldName));
187
- },
188
189
  plainTextValue() {
189
190
  const plainText = getPlainTextFromRTE(this.value);
190
191
  if (isDefaultContentText(plainText))
191
192
  return '';
192
193
  return plainText;
193
194
  },
194
- ctaLocation() {
195
- return getCtaLocationFromFieldType(this.field.name, this.type);
196
- },
197
195
  },
198
196
  watch: {
199
197
  fieldType() {
@@ -89,20 +89,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
89
89
  isVariation: boolean;
90
90
  isExcluded: boolean;
91
91
  } | undefined;
92
- bp_4572_ai_text_generation_post_purchase?: {
93
- key: string;
94
- value: string;
95
- isControl: boolean;
96
- isVariation: boolean;
97
- isExcluded: boolean;
98
- } | undefined;
99
- bp_4964_ai_text_generation_improvement?: {
100
- key: string;
101
- value: string;
102
- isControl: boolean;
103
- isVariation: boolean;
104
- isExcluded: boolean;
105
- } | undefined;
106
92
  bp_5245_ai_website_assistant?: {
107
93
  key: string;
108
94
  value: string;
@@ -181,20 +167,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
181
167
  isVariation: boolean;
182
168
  isExcluded: boolean;
183
169
  } | undefined;
184
- bp_4572_ai_text_generation_post_purchase?: {
185
- key: string;
186
- value: string;
187
- isControl: boolean;
188
- isVariation: boolean;
189
- isExcluded: boolean;
190
- } | undefined;
191
- bp_4964_ai_text_generation_improvement?: {
192
- key: string;
193
- value: string;
194
- isControl: boolean;
195
- isVariation: boolean;
196
- isExcluded: boolean;
197
- } | undefined;
198
170
  bp_5245_ai_website_assistant?: {
199
171
  key: string;
200
172
  value: string;
@@ -278,10 +278,11 @@ declare const _default: import("vue").DefineComponent<{}, {
278
278
  sendTemplateSelectEvent: (templateId: string) => void;
279
279
  sendTemplateCategorySelectEvent: (category: string) => void;
280
280
  sendSidebarCategoryClickedEvent: (tabName: string) => void;
281
+ sendAddContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
282
+ sendRemoveContentEvent: (contentType: string, selectLocation?: string | undefined, contentCategory?: string | undefined, triggerType?: string) => void;
281
283
  sendAddContentContinuationEvent: (continuation: string) => void;
282
284
  sendUpsellOfferEvent: (upsellType: string) => void;
283
285
  sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
284
- sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
285
286
  sendAiSendPromptEvent: (ctaLocation: string) => void;
286
287
  sendAiStopGenerationEvent: (ctaLocation: string) => void;
287
288
  };
@@ -376,20 +376,6 @@ declare const _default: import("vue").DefineComponent<{}, {
376
376
  isVariation: boolean;
377
377
  isExcluded: boolean;
378
378
  } | undefined;
379
- bp_4572_ai_text_generation_post_purchase?: {
380
- key: string;
381
- value: string;
382
- isControl: boolean;
383
- isVariation: boolean;
384
- isExcluded: boolean;
385
- } | undefined;
386
- bp_4964_ai_text_generation_improvement?: {
387
- key: string;
388
- value: string;
389
- isControl: boolean;
390
- isVariation: boolean;
391
- isExcluded: boolean;
392
- } | undefined;
393
379
  bp_5245_ai_website_assistant?: {
394
380
  key: string;
395
381
  value: string;
@@ -468,20 +454,6 @@ declare const _default: import("vue").DefineComponent<{}, {
468
454
  isVariation: boolean;
469
455
  isExcluded: boolean;
470
456
  } | undefined;
471
- bp_4572_ai_text_generation_post_purchase?: {
472
- key: string;
473
- value: string;
474
- isControl: boolean;
475
- isVariation: boolean;
476
- isExcluded: boolean;
477
- } | undefined;
478
- bp_4964_ai_text_generation_improvement?: {
479
- key: string;
480
- value: string;
481
- isControl: boolean;
482
- isVariation: boolean;
483
- isExcluded: boolean;
484
- } | undefined;
485
457
  bp_5245_ai_website_assistant?: {
486
458
  key: string;
487
459
  value: string;
@@ -57,6 +57,7 @@ export const useUiNavigationStyleSettingsStore = defineStore('uiNavigationStyleS
57
57
  return;
58
58
  }
59
59
  this.navigation[section][viewport].defaultButtonStyle = Object.assign({}, this.navigation[section][viewport].defaultButtonStyle, style);
60
+ console.log('This is the updated default button style: ', this.navigation[section][viewport].defaultButtonStyle);
60
61
  },
61
62
  _setSelectedButtonStyle({ displayType, section, style, viewport, }) {
62
63
  if (displayType !== NAVIGATION_DISPLAY.TAB_1 &&
@@ -3,26 +3,7 @@ import { NavModel } from '@brand-page';
3
3
  import { getPageSlugFromPageTitle } from '@brand-page-maker/utils/slug.util';
4
4
  import { navigateToPageByPageId } from '../../../brand-page-maker/routing';
5
5
  import { useUiPageSettingsStore } from '@src/shared/page-settings/store';
6
- const findParentOrderByRouteId = (orders, routeId) => {
7
- for (const order of orders) {
8
- if (order.routeId === routeId) {
9
- return order;
10
- }
11
- const found = findParentOrderByRouteId(order.subRoutes, routeId);
12
- if (found) {
13
- return found;
14
- }
15
- }
16
- return undefined;
17
- };
18
- const removeOrderByRouteId = (orders, routeId) => {
19
- return orders
20
- .filter((order) => order.routeId !== routeId)
21
- .map((order) => ({
22
- ...order,
23
- subRoutes: removeOrderByRouteId(order.subRoutes, routeId), // Recursively filter out the route
24
- }));
25
- };
6
+ import { findParentOrderByRouteId, removeOrderByRouteId, } from '../utils/nav-order-utils';
26
7
  const findParentRouteIdForRouteId = (orders, targetRouteId, parentRouteId) => {
27
8
  for (const order of orders) {
28
9
  if (order.routeId === targetRouteId) {
@@ -0,0 +1,3 @@
1
+ import type { NavOrder } from '@brand-page';
2
+ export declare const findParentOrderByRouteId: (orders: NavOrder[], routeId: string) => NavOrder | undefined;
3
+ export declare const removeOrderByRouteId: (orders: NavOrder[], routeId: string) => NavOrder[];