@designcrowd/library.brand-page 6.2.3 → 6.2.4-ast-faq-1

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 (206) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-Cn0M-eZ1.js → CreatedOnBrandCrowd-de-de-DZKdhDPm.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DRLMSDZr.js → CreatedOnBrandCrowd-en-us-BwRkzbWs.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BglTu73U.js → CreatedOnBrandCrowd-es-es-D5c5FXPv.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-Bj6YZ_el.js → CreatedOnBrandCrowd-fr-ca-CbeeC4am.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-Bj6YZ_el.js → CreatedOnBrandCrowd-fr-fr-CbeeC4am.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DEoOmQ1F.js → CreatedOnBrandCrowd-pt-br-Ar-FCaji.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DEoOmQ1F.js → CreatedOnBrandCrowd-pt-pt-Ar-FCaji.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-BZ7gTt4Z.js → CreatedOnDcom-de-de-CASR2x4B.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-CD6Km5sH.js → CreatedOnDcom-en-us-CzbgCbGq.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-CNpZHvEl.js → CreatedOnDcom-es-es-Bo-jkBIJ.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-URS-ydJ1.js → CreatedOnDcom-fr-ca-DjLS3NVf.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-D2AVeA3H.js → CreatedOnDcom-fr-fr-EuVNSQHo.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-C32frnFs.js → CreatedOnDcom-pt-br-DoaEvDmC.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-TDYGjRXS.js → CreatedOnDcom-pt-pt-D-nbucbq.js} +1 -1
  15. package/lib/src/brand-page/constants/misc.constants.d.ts +8 -0
  16. package/lib/src/brand-page/constants/misc.constants.js +7 -0
  17. package/lib/src/brand-page/constants/styles.constants.d.ts +2 -0
  18. package/lib/src/brand-page/constants/styles.constants.js +2 -0
  19. package/lib/src/brand-page/models/brand-page-context.model.d.ts +5 -0
  20. package/lib/src/brand-page/models/brand-page-context.model.js +8 -1
  21. package/lib/src/brand-page/models/content.model.d.ts +1 -0
  22. package/lib/src/brand-page/models/content.model.js +1 -0
  23. package/lib/src/brand-page/models/index.d.ts +22 -0
  24. package/lib/src/brand-page/utils/content-callback-util.d.ts +2 -1
  25. package/lib/src/brand-page/utils/content-callback-util.js +3 -0
  26. package/lib/src/brand-page/utils/view-model.util.d.ts +2 -0
  27. package/lib/src/brand-page/utils/view-model.util.js +23 -0
  28. package/lib/src/brand-page/view-models.d.ts +9 -2
  29. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +31 -0
  30. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +31 -0
  31. package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +7 -0
  32. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +21 -0
  33. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +22 -1
  34. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +21 -0
  35. package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +21 -0
  36. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +21 -0
  37. package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +21 -0
  38. package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.d.ts +10 -0
  39. package/lib/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.js +11 -0
  40. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +14 -4
  41. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +13 -0
  42. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +78 -50
  43. package/lib/src/brand-page-maker/constants/config-settings-constant.d.ts +2 -1
  44. package/lib/src/brand-page-maker/constants/config-settings-constant.js +100 -3
  45. package/lib/src/brand-page-maker/convertors/faq-display-style.convertor.d.ts +3 -0
  46. package/lib/src/brand-page-maker/convertors/faq-display-style.convertor.js +47 -0
  47. package/lib/src/brand-page-maker/models/content-settings-configs.d.ts +1 -0
  48. package/lib/src/brand-page-maker/models/content-settings-configs.js +1 -0
  49. package/lib/src/brand-page-maker/models/content-settings.d.ts +4 -1
  50. package/lib/src/brand-page-maker/models/content-settings.js +47 -1
  51. package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.d.ts +9 -2
  52. package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.js +20 -0
  53. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +21 -0
  54. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +1 -0
  55. package/lib/src/brand-page-maker/utils/apply-color-strategy.js +45 -17
  56. package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +6 -0
  57. package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +24 -1
  58. package/lib/src/brand-page-maker/validators/field.validator.js +2 -0
  59. package/lib/src/bundled-translations-BlnNpIYu.js +179 -0
  60. package/lib/src/bundles/bundled-translations.json +20 -2
  61. package/lib/src/clients/ai-assistant-client.d.ts +1 -0
  62. package/lib/src/clients/ai-assistant-client.js +1 -0
  63. package/lib/src/composables/useTranslate.d.ts +1 -1
  64. package/lib/src/composables/useTranslate.js +1 -1
  65. package/lib/src/css/library.brand-page-brandCrowd.min.css +154 -47
  66. package/lib/src/css/library.brand-page-brandPage.min.css +154 -47
  67. package/lib/src/css/library.brand-page-designCom.min.css +154 -47
  68. package/lib/src/css/library.brand-page-preview.min.css +154 -47
  69. package/lib/src/index.mjs +224 -222
  70. package/lib/src/{lib-Dm9AuOJL.js → lib-BS9Le912.js} +30727 -29779
  71. package/lib/src/metadata-builder/builders/global-font-propagation.d.ts +41 -0
  72. package/lib/src/metadata-builder/builders/global-font-propagation.js +146 -0
  73. package/lib/src/metadata-builder/builders/global-styles-builder.js +29 -1
  74. package/lib/src/metadata-builder/builders/header-builder.js +8 -0
  75. package/lib/src/metadata-builder/builders/section-builders/index.d.ts +1 -0
  76. package/lib/src/metadata-builder/builders/section-builders/index.js +1 -0
  77. package/lib/src/metadata-builder/builders/section-builders/support-me-builder.d.ts +8 -0
  78. package/lib/src/metadata-builder/builders/section-builders/support-me-builder.js +25 -0
  79. package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +5 -2
  80. package/lib/src/metadata-builder/builders/section-field-maps.js +15 -0
  81. package/lib/src/metadata-builder/builders/section-field-utils.d.ts +6 -1
  82. package/lib/src/metadata-builder/builders/section-field-utils.js +48 -12
  83. package/lib/src/metadata-builder/builders/section-rules/support-me.rules.d.ts +2 -0
  84. package/lib/src/metadata-builder/builders/section-rules/support-me.rules.js +17 -0
  85. package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +9 -0
  86. package/lib/src/metadata-builder/helpers/rte.helpers.js +60 -1
  87. package/lib/src/metadata-builder/metadata-executor.js +3 -1
  88. package/lib/src/metadata-builder/models.d.ts +2 -0
  89. package/lib/src/metadata-builder/models.js +2 -0
  90. package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +1 -0
  91. package/lib/src/metadata-builder/parsers/ai-toolcall-parser.js +4 -0
  92. package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +14 -2
  93. package/lib/src/shared/color-strategies/color-strategies.js +4 -0
  94. package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +12 -0
  95. package/lib/src/shared/color-strategies/rte-field-pairs.js +10 -0
  96. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
  97. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +10 -0
  98. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +11 -1
  99. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +10 -0
  100. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +10 -0
  101. package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
  102. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +10 -0
  103. package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.d.ts +14 -1
  104. package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.js +11 -1
  105. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +21 -0
  106. package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
  107. package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
  108. package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +13 -1
  109. package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.js +5 -0
  110. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
  111. package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
  112. package/lib/src/shared/content-settings/models.d.ts +6 -0
  113. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +14 -1
  114. package/lib/src/shared/content-settings/store/content-settings-store.js +24 -2
  115. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +21 -0
  116. package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
  117. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +31 -0
  118. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +31 -0
  119. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +28 -0
  120. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +21 -0
  121. package/lib/src/shared/style-settings/button-style-preset.d.ts +12 -0
  122. package/lib/src/shared/style-settings/button-style-preset.js +39 -0
  123. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +21 -0
  124. package/lib/src/shared/style-settings/store/style-settings-store.js +6 -32
  125. package/lib/src/utils/minify-brand-page-metadata.d.ts +9 -0
  126. package/lib/src/utils/minify-brand-page-metadata.js +23 -1
  127. package/package.json +2 -13
  128. package/src/brand-page/components/faq-section/FaqSection.test.ts +354 -0
  129. package/src/brand-page/components/faq-section/FaqSection.vue +335 -0
  130. package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +1 -0
  131. package/src/brand-page/components/page/PageComponent.vue +2 -0
  132. package/src/brand-page/constants/misc.constants.ts +12 -0
  133. package/src/brand-page/constants/styles.constants.ts +2 -0
  134. package/src/brand-page/models/brand-page-context.model.ts +14 -1
  135. package/src/brand-page/models/content.model.ts +1 -0
  136. package/src/brand-page/models/index.ts +24 -0
  137. package/src/brand-page/utils/content-callback-util.ts +5 -0
  138. package/src/brand-page/utils/view-model.util.test.ts +112 -0
  139. package/src/brand-page/utils/view-model.util.ts +48 -0
  140. package/src/brand-page/view-models.ts +12 -1
  141. package/src/brand-page-maker/components/ai-website-builder/AiWebsiteBuilder.vue +1 -1
  142. package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.test.ts +165 -0
  143. package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +17 -49
  144. package/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.test.ts +82 -0
  145. package/src/brand-page-maker/composables/ai-chat/ai-builder-experiment.ts +19 -0
  146. package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +18 -4
  147. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +103 -49
  148. package/src/brand-page-maker/constants/config-settings-constant.ts +104 -1
  149. package/src/brand-page-maker/constants/faq-section-config.test.ts +59 -0
  150. package/src/brand-page-maker/convertors/faq-display-style.convertor.ts +59 -0
  151. package/src/brand-page-maker/convertors/i18n/converter.json +4 -1
  152. package/src/brand-page-maker/models/content-settings-configs.ts +1 -0
  153. package/src/brand-page-maker/models/content-settings.ts +59 -0
  154. package/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.ts +30 -0
  155. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +2 -0
  156. package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +3820 -300
  157. package/src/brand-page-maker/utils/apply-color-strategy.test.ts +123 -2
  158. package/src/brand-page-maker/utils/apply-color-strategy.ts +73 -19
  159. package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +110 -0
  160. package/src/brand-page-maker/utils/rich-text-editor.util.ts +66 -0
  161. package/src/brand-page-maker/validators/field.validator.ts +2 -0
  162. package/src/bundles/bundled-translations.json +20 -2
  163. package/src/clients/ai-assistant-client.ts +1 -0
  164. package/src/composables/useTranslate.ts +2 -1
  165. package/src/metadata-builder/builders/global-font-propagation.test.ts +401 -0
  166. package/src/metadata-builder/builders/global-font-propagation.ts +238 -0
  167. package/src/metadata-builder/builders/global-styles-builder.test.ts +107 -0
  168. package/src/metadata-builder/builders/global-styles-builder.ts +38 -1
  169. package/src/metadata-builder/builders/header-builder.test.ts +45 -0
  170. package/src/metadata-builder/builders/header-builder.ts +20 -0
  171. package/src/metadata-builder/builders/item-id-utils.test.ts +24 -0
  172. package/src/metadata-builder/builders/section-builders/index.ts +1 -0
  173. package/src/metadata-builder/builders/section-builders/support-me-builder.test.ts +177 -0
  174. package/src/metadata-builder/builders/section-builders/support-me-builder.ts +43 -0
  175. package/src/metadata-builder/builders/section-builders/text-section-builder.ts +5 -2
  176. package/src/metadata-builder/builders/section-field-maps.ts +18 -0
  177. package/src/metadata-builder/builders/section-field-utils.test.ts +83 -0
  178. package/src/metadata-builder/builders/section-field-utils.ts +69 -18
  179. package/src/metadata-builder/builders/section-rules/support-me.rules.ts +39 -0
  180. package/src/metadata-builder/helpers/rte.helpers.ts +82 -1
  181. package/src/metadata-builder/metadata-executor.ts +3 -0
  182. package/src/metadata-builder/models.ts +2 -0
  183. package/src/metadata-builder/parsers/ai-toolcall-parser.ts +4 -0
  184. package/src/metadata-builder/parsers/section-tool-arguments.ts +16 -2
  185. package/src/shared/color-strategies/color-strategies.ts +4 -0
  186. package/src/shared/color-strategies/rte-field-pairs.ts +23 -0
  187. package/src/shared/content-settings/components/color-field/ColorField.test.ts +29 -0
  188. package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +17 -1
  189. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +2 -0
  190. package/src/shared/content-settings/components/faq-items-field/FaqItemsField.test.ts +272 -0
  191. package/src/shared/content-settings/components/faq-items-field/FaqItemsField.vue +282 -0
  192. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.vue +1 -0
  193. package/src/shared/content-settings/components/items-field/ItemsField.mixin.ts +11 -1
  194. package/src/shared/content-settings/components/items-field/ItemsField.test.ts +92 -0
  195. package/src/shared/content-settings/components/items-field/ItemsField.vue +8 -2
  196. package/src/shared/content-settings/components/textarea-field/TextareaField.mixin.ts +6 -0
  197. package/src/shared/content-settings/components/textarea-field/TextareaField.vue +1 -0
  198. package/src/shared/content-settings/models.ts +7 -0
  199. package/src/shared/content-settings/store/content-settings-store.test.ts +49 -0
  200. package/src/shared/content-settings/store/content-settings-store.ts +37 -3
  201. package/src/shared/style-settings/button-style-preset.test.ts +67 -0
  202. package/src/shared/style-settings/button-style-preset.ts +56 -0
  203. package/src/shared/style-settings/store/style-settings-store.ts +9 -38
  204. package/src/utils/minify-brand-page-metadata.test.ts +201 -1
  205. package/src/utils/minify-brand-page-metadata.ts +31 -1
  206. package/lib/src/bundled-translations-BYUfWBT3.js +0 -179
@@ -1,5 +1,5 @@
1
- import { SOCIAL_LINKS_ICON_DISPLAY_STYLES, BRAND_PAGE_TYPES, DIVIDER_STYLES, MEDIA_TYPES, BUTTON_LINK_TYPE, FONT_SIZE_BODY, LINE_HEIGHT_BODY, MIN_TEXT_SIZE_PX, MAX_TEXT_SIZE_PX, TEXT_COLUMNS, DEFAULT_SHAPE_SIZE, PAYMENT_OPTION_DISPLAY_TYPES, PAYMENT_OPTION_IMAGE_TYPES, GettyVideoMedia, } from '@brand-page';
2
- import { createInitialButtonContent, createInitialImageContent, createInitialProfileContent, createInitialTextContent, createInitialVideoContent, createInitialLogoContent, createInitialMapContent, createInitialImageGalleryContent, createInitialGeneralLinkContent, createInitialMailingListContent, createInitialRequestPaymentContent, createInitialSupportMeContent, createInitialContactFormContent, CONTENT_SETTINGS_DISPLAY_MODES, createInitialBannerSectionContent, createInitialSocialLinksContent, createInitialImagesSectionContent, createInitialTestimonialSectionContent, createInitialAboutSectionContent, createInitialDividerSectionContent, createInitialShapesSectionContent, VARIANT_DISPLAY_MODES, createInitialShopContent, createInitialBookingSectionContent, } from '../models';
1
+ import { FAQ_DISPLAY_STYLES, SOCIAL_LINKS_ICON_DISPLAY_STYLES, BRAND_PAGE_TYPES, DIVIDER_STYLES, MEDIA_TYPES, BUTTON_LINK_TYPE, FONT_SIZE_BODY, LINE_HEIGHT_BODY, MIN_TEXT_SIZE_PX, MAX_TEXT_SIZE_PX, TEXT_COLUMNS, DEFAULT_SHAPE_SIZE, PAYMENT_OPTION_DISPLAY_TYPES, PAYMENT_OPTION_IMAGE_TYPES, GettyVideoMedia, } from '@brand-page';
2
+ import { createInitialButtonContent, createInitialImageContent, createInitialProfileContent, createInitialTextContent, createInitialVideoContent, createInitialLogoContent, createInitialMapContent, createInitialImageGalleryContent, createInitialGeneralLinkContent, createInitialMailingListContent, createInitialRequestPaymentContent, createInitialSupportMeContent, createInitialContactFormContent, CONTENT_SETTINGS_DISPLAY_MODES, createInitialBannerSectionContent, createInitialSocialLinksContent, createInitialImagesSectionContent, createInitialTestimonialSectionContent, createInitialAboutSectionContent, createInitialDividerSectionContent, createInitialShapesSectionContent, VARIANT_DISPLAY_MODES, createInitialShopContent, createInitialBookingSectionContent, createInitialFaqSectionContent, } from '../models';
3
3
  import * as uuid from 'uuid';
4
4
  import { colorConvertor, backgroundColorConvertor, borderColorConvertor, displayStyleConvertor, galleryTypeConvertor, imageAspectRatioConvertor, textAlignmentOptionsConvertor, videoContentStateConvertor, fillColorConvertor, bannerAlignDisplayStyleConvertor, aboutDisplayStyleConvertor, dividerStyleConvertor, shapeSizeOptionsConvertor, buttonLinkStyleConvertor, textSizeValueConvertor, textColumnStyleConvertor, contactLayoutStyleConvertor, paymentLinkDisplayStyleConvertor, shopDisplayConvertor, shopAspectRatioConvertor, } from '../convertors';
5
5
  import { ALIGN_CENTERED, DISPLAY_STYLE_COLLAPSED, DISPLAY_STYLE_PREVIEW, } from '@brand-page';
@@ -8,6 +8,7 @@ import { contactFormCardColorDefaultGetter, paymentFillColorFieldDefaultGetter,
8
8
  import { socialLinksIconDisplayStyleConvertor } from '../convertors/social-links-icon-display-style.convertor';
9
9
  import { getTextMediaOptionsConverterByMediaType } from '../convertors/text-image-display-style.convertor';
10
10
  import { testimonialDisplayStyleConvertor } from '../convertors/testimonial-display-style-convertor';
11
+ import { faqDisplayStyleConvertor } from '../convertors/faq-display-style.convertor';
11
12
  import { pageValidator, urlValidator } from '../validators';
12
13
  import { imagesSectionAspectRatioVisibilityAssessor } from '../assessors/images-section-aspect-ratio-visibility.assessor';
13
14
  import { bannerLinkTypeVisibilityAssessor, bannerSectionPageVisibilityAssessor, bannerSectionUrlVisibilityAssessor, bannerDisplayTypeVisibilityAssessor, bannerOverlayOptionsVisibilityAssessor, } from '../assessors/banner-section-description-visibility.assessor';
@@ -15,7 +16,7 @@ import { imagesSectionTextStyleVisibilityAssessor } from '../assessors/images-se
15
16
  import { bannerPlaceholderFieldTypeAssessor, bannerSectionFieldTypeAssessor, bannerSectionRoleTypeAssessor, } from '../assessors/banner-section-field.assessor';
16
17
  import { isValidSvgUrl } from '@brand-page/utils';
17
18
  import { brandPageOrbrandContactTypeVisibilityAssessor, brandSiteTypeVisibilityAssessor, } from '../assessors/brand-page-type-visibility.assessor';
18
- import { contentSettingsTr } from '@src/composables/useTranslate';
19
+ import { commonTr, contentSettingsTr } from '@src/composables/useTranslate';
19
20
  const MediaFieldNames = {
20
21
  aspectRatio: 'aspectRatio',
21
22
  iconUrl: 'iconUrl',
@@ -2807,6 +2808,101 @@ export const BOOKING_SECTION_SETTINGS_CONFIG = () => ({
2807
2808
  isEnabled: true,
2808
2809
  isLocked: false,
2809
2810
  });
2811
+ const FAQ_FIELD_GROUP_IDS = {
2812
+ settings: 'settings',
2813
+ items: 'items',
2814
+ style: 'style',
2815
+ };
2816
+ export const FAQ_SECTION_SETTINGS_CONFIG = () => ({
2817
+ type: 'faq-section',
2818
+ category: 'general',
2819
+ createInitialContent: createInitialFaqSectionContent,
2820
+ displayMode: CONTENT_SETTINGS_DISPLAY_MODES.focused,
2821
+ defaultIconName: 'question-circle-filled',
2822
+ displayName: contentSettingsTr(`faqSectionDisplayName`),
2823
+ fieldGroups: [
2824
+ {
2825
+ id: FAQ_FIELD_GROUP_IDS.settings,
2826
+ displayName: contentSettingsTr(`settingsDisplayName`),
2827
+ isCollapsed: false,
2828
+ },
2829
+ {
2830
+ id: FAQ_FIELD_GROUP_IDS.items,
2831
+ displayName: contentSettingsTr(`faqItemsDisplayName`),
2832
+ isCollapsed: false,
2833
+ },
2834
+ {
2835
+ id: FAQ_FIELD_GROUP_IDS.style,
2836
+ displayName: contentSettingsTr(`styleDisplayName`),
2837
+ isCollapsed: true,
2838
+ },
2839
+ ],
2840
+ fields: {
2841
+ titleStyle: DEFAULT_TITLE_STYLE_SETTINGS_FILED_WITH_TITLE(),
2842
+ descriptionStyle: DEFAULT_DESCRIPTION_STYLE_FILED(),
2843
+ title: {
2844
+ type: 'text',
2845
+ placeholder: contentSettingsTr(`titlePlaceholder`),
2846
+ title: contentSettingsTr(`titleTitle`),
2847
+ groupId: FAQ_FIELD_GROUP_IDS.settings,
2848
+ maxLength: 200,
2849
+ },
2850
+ description: {
2851
+ type: 'textarea',
2852
+ placeholder: contentSettingsTr(`descriptionPlaceholder`),
2853
+ title: contentSettingsTr(`descriptionTitle`),
2854
+ groupId: FAQ_FIELD_GROUP_IDS.settings,
2855
+ maxLength: 1000,
2856
+ },
2857
+ // FaqItemsField owns the question/answer inputs and the FAQ_MAX_ITEMS cap.
2858
+ items: {
2859
+ type: 'faq-items',
2860
+ defaultValue: [],
2861
+ groupId: FAQ_FIELD_GROUP_IDS.items,
2862
+ },
2863
+ displayStyle: {
2864
+ type: 'radio',
2865
+ role: 'multi',
2866
+ defaultValue: FAQ_DISPLAY_STYLES.centered,
2867
+ title: contentSettingsTr(`displayStyleTitle`),
2868
+ optionsConvertor: faqDisplayStyleConvertor,
2869
+ groupId: FAQ_FIELD_GROUP_IDS.style,
2870
+ variant: 'icon',
2871
+ },
2872
+ ...PADDING_CONTROL_FIELDS(FAQ_FIELD_GROUP_IDS.style),
2873
+ iconColor: {
2874
+ type: 'color',
2875
+ groupId: FAQ_FIELD_GROUP_IDS.style,
2876
+ defaultValue: {},
2877
+ isInline: true,
2878
+ showToggle: false,
2879
+ disableTransparent: true,
2880
+ title: commonTr(`iconColor`),
2881
+ valueConvertor: colorConvertor,
2882
+ },
2883
+ // Transparent allowed on purpose (it hides the line), unlike the Divider section's field.
2884
+ dividerColor: {
2885
+ type: 'color',
2886
+ groupId: FAQ_FIELD_GROUP_IDS.style,
2887
+ defaultValue: {},
2888
+ isInline: true,
2889
+ showToggle: false,
2890
+ title: contentSettingsTr(`dividerColorTitle`),
2891
+ valueConvertor: backgroundColorConvertor,
2892
+ },
2893
+ backgroundStyle: {
2894
+ type: 'color',
2895
+ groupId: FAQ_FIELD_GROUP_IDS.style,
2896
+ defaultValue: {},
2897
+ isInline: true,
2898
+ showToggle: false,
2899
+ title: contentSettingsTr(`backgroundColorTitle`),
2900
+ valueConvertor: backgroundColorConvertor,
2901
+ },
2902
+ },
2903
+ isEnabled: true,
2904
+ isLocked: false,
2905
+ });
2810
2906
  export const CONTENT_SETTINGS_CONFIGS = () => ({
2811
2907
  logo: LOGO_SETTINGS_CONFIG(),
2812
2908
  'general-link': GENERAL_LINK_CONTENT_SETTINGS_CONFIG(),
@@ -2840,4 +2936,5 @@ export const CONTENT_SETTINGS_CONFIGS = () => ({
2840
2936
  'shapes-section': SHAPES_SECTION_SETTINGS_CONFIG(),
2841
2937
  'shop-section': SHOP_SECTION_SETTINGS_CONFIG(),
2842
2938
  'booking-section': BOOKING_SECTION_SETTINGS_CONFIG(),
2939
+ 'faq-section': FAQ_SECTION_SETTINGS_CONFIG(),
2843
2940
  });
@@ -0,0 +1,3 @@
1
+ import type { ButtonGroupConfig, ValueConvertor } from '../models';
2
+ import type { FaqSectionContent } from '@brand-page/models';
3
+ export declare const faqDisplayStyleConvertor: ValueConvertor<string | null, ButtonGroupConfig, Partial<FaqSectionContent>>;
@@ -0,0 +1,47 @@
1
+ import { FAQ_DISPLAY_STYLES } from '@brand-page/constants';
2
+ import { converterTr } from '@src/composables/useTranslate';
3
+ const ICON_VIEW_BOX = '0 0 96 56';
4
+ export const faqDisplayStyleConvertor = {
5
+ convertBackToMultipleValues: true,
6
+ convert(value) {
7
+ return {
8
+ options: [
9
+ {
10
+ title: converterTr(`faqCenteredAccordion`),
11
+ value: FAQ_DISPLAY_STYLES.centered,
12
+ isSelected: value === FAQ_DISPLAY_STYLES.centered,
13
+ iconName: 'display-style-faq-1',
14
+ iconViewBox: ICON_VIEW_BOX,
15
+ dataAttribute: 'data-test-btn-faq-centered',
16
+ },
17
+ {
18
+ title: converterTr(`faqSplitAccordion`),
19
+ value: FAQ_DISPLAY_STYLES.split,
20
+ isSelected: value === FAQ_DISPLAY_STYLES.split,
21
+ iconName: 'display-style-faq-2',
22
+ iconViewBox: ICON_VIEW_BOX,
23
+ dataAttribute: 'data-test-btn-faq-split',
24
+ },
25
+ {
26
+ title: converterTr(`faqGrid`),
27
+ value: FAQ_DISPLAY_STYLES.grid,
28
+ isSelected: value === FAQ_DISPLAY_STYLES.grid,
29
+ iconName: 'display-style-faq-3',
30
+ iconViewBox: ICON_VIEW_BOX,
31
+ dataAttribute: 'data-test-btn-faq-grid',
32
+ },
33
+ ],
34
+ };
35
+ },
36
+ // The heading sits left beside the accordion in split, centred above it otherwise.
37
+ convertBack(config) {
38
+ const displayStyle = config.options.find((v) => v.isSelected)?.value ??
39
+ FAQ_DISPLAY_STYLES.centered;
40
+ const textAlign = displayStyle === FAQ_DISPLAY_STYLES.split ? 'left' : 'center';
41
+ return {
42
+ displayStyle,
43
+ titleStyle: { textAlign },
44
+ descriptionStyle: { textAlign },
45
+ };
46
+ },
47
+ };
@@ -52,6 +52,7 @@ export declare const ITEM_FIELD_TYPES: {
52
52
  readonly 'color-replacements': "color-replacements";
53
53
  readonly 'testimonial-items': "testimonial-items";
54
54
  readonly 'text-items': "text-items";
55
+ readonly 'faq-items': "faq-items";
55
56
  readonly 'page-dropdown': "page-dropdown";
56
57
  readonly 'personalisation-override': "personalisation-override";
57
58
  };
@@ -55,6 +55,7 @@ export const ITEM_FIELD_TYPES = {
55
55
  'color-replacements': 'color-replacements',
56
56
  'testimonial-items': 'testimonial-items',
57
57
  'text-items': 'text-items',
58
+ 'faq-items': 'faq-items',
58
59
  'page-dropdown': 'page-dropdown',
59
60
  'personalisation-override': 'personalisation-override',
60
61
  };
@@ -1,5 +1,5 @@
1
1
  import { BrandPageModel } from '@brand-page';
2
- import type { ButtonContent, ContentType, ImageContent, ProfileContent, TextContent, VideoContent, LogoContent, LogoTheme, MapContent, ImageGalleryContent, GeneralLinkContent, MailingListContent, RequestPaymentContent, ContactFormContent, BannerSectionContent, SocialLinksContent, ImagesSectionContent, TestimonialSectionContent, AboutSectionContent, DividerSectionContent, ShapesSectionContent, BrandPageType, SupportMeContent, ShopContent, BookingSectionContent } from '@brand-page';
2
+ import type { ButtonContent, ContentType, ImageContent, ProfileContent, TextContent, VideoContent, LogoContent, LogoTheme, MapContent, ImageGalleryContent, GeneralLinkContent, MailingListContent, RequestPaymentContent, ContactFormContent, BannerSectionContent, SocialLinksContent, ImagesSectionContent, TestimonialSectionContent, AboutSectionContent, DividerSectionContent, ShapesSectionContent, BrandPageType, SupportMeContent, ShopContent, BookingSectionContent, TextStyleDeclaration, FaqSectionContent } from '@brand-page';
3
3
  import type { CreateInitialContentFunction } from './content-settings-configs';
4
4
  import type { CreateInitialContentOptions } from '@shared/content-settings/models';
5
5
  export declare const createInitialButtonContent: (type: ContentType, iconUrl: string, options?: CreateInitialContentOptions) => () => ButtonContent;
@@ -18,6 +18,9 @@ export declare const createInitialSupportMeContent: (options?: CreateInitialCont
18
18
  export declare const createInitialContactFormContent: CreateInitialContentFunction<ContactFormContent>;
19
19
  export declare const createInitialBannerSectionContent: CreateInitialContentFunction<BannerSectionContent>;
20
20
  export declare const createInitialBookingSectionContent: CreateInitialContentFunction<BookingSectionContent>;
21
+ export declare const createInitialFaqQuestionStyle: (applyAutoScale?: boolean) => TextStyleDeclaration;
22
+ export declare const createInitialFaqAnswerStyle: (applyAutoScale?: boolean) => TextStyleDeclaration;
23
+ export declare const createInitialFaqSectionContent: CreateInitialContentFunction<FaqSectionContent>;
21
24
  export declare const createInitialImagesSectionContent: CreateInitialContentFunction<ImagesSectionContent>;
22
25
  export declare const createInitialTestimonialSectionContent: CreateInitialContentFunction<TestimonialSectionContent>;
23
26
  export declare const createInitialAboutSectionContent: CreateInitialContentFunction<AboutSectionContent>;
@@ -1,4 +1,4 @@
1
- import { BrandPageModel, PageStyles, FORM_FIELD_IDS, PAYMENT_OPTION_DISPLAY_TYPES, PAYMENT_OPTION_IMAGE_TYPES, SOCIAL_LINKS_ICON_DISPLAY_STYLES, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, MEDIA_TYPES, BUTTON_LINK_TYPE, DISPLAY_STYLE_PREVIEW, SUPPORT_ME_CUSTOM_PRODUCT_NAME, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, FONT_SIZE_BODY, LINE_HEIGHT_BODY, TEXT_STYLE_TYPES, TEXT_COLUMNS, DEFAULT_LOGO_BACKGROUND_COLOR_RGB, DEFAULT_LOGO_TEXT_COLOR_RGB, EMPTY_LOGO_IMAGE_MODEL, BRAND_PAGE_TYPES, SENSITIVE_CONTENT_TYPES, CONTACT_FORM_LAYOUT_DEFAULT_PADDING, TESTIMONIAL_DEFAULT_PADDING, } from '@brand-page';
1
+ import { BrandPageModel, PageStyles, FORM_FIELD_IDS, PAYMENT_OPTION_DISPLAY_TYPES, PAYMENT_OPTION_IMAGE_TYPES, SOCIAL_LINKS_ICON_DISPLAY_STYLES, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, MEDIA_TYPES, BUTTON_LINK_TYPE, DISPLAY_STYLE_PREVIEW, SUPPORT_ME_CUSTOM_PRODUCT_NAME, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, FONT_SIZE_BODY, LINE_HEIGHT_BODY, TEXT_STYLE_TYPES, TEXT_COLUMNS, DEFAULT_LOGO_BACKGROUND_COLOR_RGB, DEFAULT_LOGO_TEXT_COLOR_RGB, EMPTY_LOGO_IMAGE_MODEL, BRAND_PAGE_TYPES, SENSITIVE_CONTENT_TYPES, CONTACT_FORM_LAYOUT_DEFAULT_PADDING, TESTIMONIAL_DEFAULT_PADDING, FAQ_DISPLAY_STYLES, } from '@brand-page';
2
2
  import * as uuid from 'uuid';
3
3
  import { getColorShades, DEFAULT_CARD_SURFACE_REFERENCE, } from '@brand-page/utils';
4
4
  import { contentSettingsTr } from '@src/composables/useTranslate';
@@ -556,6 +556,52 @@ export const createInitialBookingSectionContent = (options) => {
556
556
  },
557
557
  };
558
558
  };
559
+ // Questions follow the Headings role, answers the Paragraphs role.
560
+ export const createInitialFaqQuestionStyle = (applyAutoScale = false) => ({
561
+ applyAutoScale,
562
+ textStyleType: TEXT_STYLE_TYPES.headings,
563
+ textAlign: 'left',
564
+ });
565
+ export const createInitialFaqAnswerStyle = (applyAutoScale = false) => ({
566
+ applyAutoScale,
567
+ textStyleType: TEXT_STYLE_TYPES.paragraphs,
568
+ textAlign: 'left',
569
+ });
570
+ export const createInitialFaqSectionContent = (options) => {
571
+ const applyAutoScale = options?.brandPageType === BRAND_PAGE_TYPES.brandSite;
572
+ return {
573
+ id: uuid.v4(),
574
+ type: 'faq-section',
575
+ title: contentSettingsTr(`defaultFaqTitle`),
576
+ description: contentSettingsTr(`defaultFaqDescription`),
577
+ displayStyle: FAQ_DISPLAY_STYLES.centered,
578
+ topPadding: 32,
579
+ bottomPadding: 32,
580
+ // One sample item; the design's four are only there to show a longer list.
581
+ items: [
582
+ {
583
+ id: uuid.v4(),
584
+ question: contentSettingsTr(`defaultFaqQuestion`),
585
+ questionStyle: createInitialFaqQuestionStyle(applyAutoScale),
586
+ answer: contentSettingsTr(`defaultFaqAnswer`),
587
+ answerStyle: createInitialFaqAnswerStyle(applyAutoScale),
588
+ },
589
+ ],
590
+ titleStyle: {
591
+ applyAutoScale,
592
+ textStyleType: TEXT_STYLE_TYPES.titles,
593
+ textAlign: 'center',
594
+ },
595
+ descriptionStyle: {
596
+ applyAutoScale,
597
+ textStyleType: TEXT_STYLE_TYPES.paragraphs,
598
+ textAlign: 'center',
599
+ },
600
+ backgroundStyle: {},
601
+ iconColor: { color: '#555555' },
602
+ dividerColor: { backgroundColor: '#dcdcdc' },
603
+ };
604
+ };
559
605
  export const createInitialImagesSectionContent = (options) => {
560
606
  return {
561
607
  id: uuid.v4(),
@@ -1,3 +1,4 @@
1
+ import { type AiAssistantAgentType } from '../../../clients/ai-assistant-client';
1
2
  export declare const useAiWebsiteBuilderThreadStore: import("pinia").StoreDefinition<"aiWebsiteBuilderThread", Pick<{
2
3
  threadId: import("vue").Ref<string | null, string | null>;
3
4
  runId: import("vue").Ref<string | null, string | null>;
@@ -8,9 +9,11 @@ export declare const useAiWebsiteBuilderThreadStore: import("pinia").StoreDefini
8
9
  buildSectionsCompleted: import("vue").Ref<number, number>;
9
10
  promptText: import("vue").Ref<string, string>;
10
11
  stopGeneration: import("vue").Ref<(() => void) | null, (() => void) | null>;
12
+ agentType: import("vue").Ref<AiAssistantAgentType, AiAssistantAgentType>;
13
+ setAgentType: (type: AiAssistantAgentType) => void;
11
14
  resetToken: import("vue").Ref<number, number>;
12
15
  reset: () => void;
13
- }, "threadId" | "runId" | "messages" | "isProcessing" | "buildId" | "isBuildInProgress" | "buildSectionsCompleted" | "promptText" | "stopGeneration" | "resetToken">, Pick<{
16
+ }, "threadId" | "runId" | "messages" | "isProcessing" | "buildId" | "isBuildInProgress" | "buildSectionsCompleted" | "promptText" | "stopGeneration" | "agentType" | "resetToken">, Pick<{
14
17
  threadId: import("vue").Ref<string | null, string | null>;
15
18
  runId: import("vue").Ref<string | null, string | null>;
16
19
  messages: import("vue").Ref<any[], any[]>;
@@ -20,6 +23,8 @@ export declare const useAiWebsiteBuilderThreadStore: import("pinia").StoreDefini
20
23
  buildSectionsCompleted: import("vue").Ref<number, number>;
21
24
  promptText: import("vue").Ref<string, string>;
22
25
  stopGeneration: import("vue").Ref<(() => void) | null, (() => void) | null>;
26
+ agentType: import("vue").Ref<AiAssistantAgentType, AiAssistantAgentType>;
27
+ setAgentType: (type: AiAssistantAgentType) => void;
23
28
  resetToken: import("vue").Ref<number, number>;
24
29
  reset: () => void;
25
30
  }, never>, Pick<{
@@ -32,6 +37,8 @@ export declare const useAiWebsiteBuilderThreadStore: import("pinia").StoreDefini
32
37
  buildSectionsCompleted: import("vue").Ref<number, number>;
33
38
  promptText: import("vue").Ref<string, string>;
34
39
  stopGeneration: import("vue").Ref<(() => void) | null, (() => void) | null>;
40
+ agentType: import("vue").Ref<AiAssistantAgentType, AiAssistantAgentType>;
41
+ setAgentType: (type: AiAssistantAgentType) => void;
35
42
  resetToken: import("vue").Ref<number, number>;
36
43
  reset: () => void;
37
- }, "reset">>;
44
+ }, "reset" | "setAgentType">>;
@@ -1,5 +1,6 @@
1
1
  import { defineStore } from 'pinia';
2
2
  import { ref } from 'vue';
3
+ import { AI_ASSISTANT_AGENT_TYPES, } from '../../../clients/ai-assistant-client';
3
4
  export const useAiWebsiteBuilderThreadStore = defineStore('aiWebsiteBuilderThread', () => {
4
5
  const threadId = ref(null);
5
6
  const runId = ref(null);
@@ -10,6 +11,11 @@ export const useAiWebsiteBuilderThreadStore = defineStore('aiWebsiteBuilderThrea
10
11
  const buildSectionsCompleted = ref(0);
11
12
  const promptText = ref('');
12
13
  const stopGeneration = ref(null);
14
+ // Which builder this thread talks to. V1 (control) is the default, what production
15
+ // runs today; the chat composable sets V2 for the variation-1 arm when a thread
16
+ // starts (aiBuilderAgentTypeForArm). Every send site reads it, because tool results
17
+ // must reach the agent that owns the thread (AI QA 2026-07-05 T19).
18
+ const agentType = ref(AI_ASSISTANT_AGENT_TYPES.WEBSITE_BUILDER);
13
19
  // Bumped on every reset so consumers (useAiWebsiteBuilderChat) can react
14
20
  // without watching `messages`, which would loop with its own deep watch.
15
21
  const resetToken = ref(0);
@@ -28,6 +34,18 @@ export const useAiWebsiteBuilderThreadStore = defineStore('aiWebsiteBuilderThrea
28
34
  stopGeneration.value = null;
29
35
  resetToken.value += 1;
30
36
  };
37
+ const setAgentType = (type) => {
38
+ if (agentType.value === type) {
39
+ return;
40
+ }
41
+ const hadThread = threadId.value !== null;
42
+ agentType.value = type;
43
+ // V1 and V2 threads are not interchangeable, so a thread already running on
44
+ // the other agent is dropped. Before the first prompt there is nothing to drop.
45
+ if (hadThread) {
46
+ reset();
47
+ }
48
+ };
31
49
  return {
32
50
  threadId,
33
51
  runId,
@@ -38,6 +56,8 @@ export const useAiWebsiteBuilderThreadStore = defineStore('aiWebsiteBuilderThrea
38
56
  buildSectionsCompleted,
39
57
  promptText,
40
58
  stopGeneration,
59
+ agentType,
60
+ setAgentType,
41
61
  resetToken,
42
62
  reset,
43
63
  };
@@ -158,6 +158,13 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
158
158
  isVariation: boolean;
159
159
  isExcluded: boolean;
160
160
  } | undefined;
161
+ bp_6136_v2_ai_builder?: {
162
+ key: string;
163
+ value: string;
164
+ isControl: boolean;
165
+ isVariation: boolean;
166
+ isExcluded: boolean;
167
+ } | undefined;
161
168
  };
162
169
  isSubsequentPublish: boolean;
163
170
  isContextualUpgradeModalVisible: boolean;
@@ -233,6 +240,13 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
233
240
  isVariation: boolean;
234
241
  isExcluded: boolean;
235
242
  } | undefined;
243
+ bp_6136_v2_ai_builder?: {
244
+ key: string;
245
+ value: string;
246
+ isControl: boolean;
247
+ isVariation: boolean;
248
+ isExcluded: boolean;
249
+ } | undefined;
236
250
  };
237
251
  isSubsequentPublish: boolean;
238
252
  isContextualUpgradeModalVisible: boolean;
@@ -308,6 +322,13 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
308
322
  isVariation: boolean;
309
323
  isExcluded: boolean;
310
324
  } | undefined;
325
+ bp_6136_v2_ai_builder?: {
326
+ key: string;
327
+ value: string;
328
+ isControl: boolean;
329
+ isVariation: boolean;
330
+ isExcluded: boolean;
331
+ } | undefined;
311
332
  };
312
333
  isSubsequentPublish: boolean;
313
334
  isContextualUpgradeModalVisible: boolean;
@@ -1477,6 +1477,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
1477
1477
  setVideoUrlsWithToken: videoStore.setVideoUrlsWithToken,
1478
1478
  isCustomDomain: false,
1479
1479
  brandPageSlug: brandPageContainerStore.brandPageSlug,
1480
+ activeItemIdByContentId: useUiContentSettingsStore().activeItemIdByContentId,
1480
1481
  });
1481
1482
  },
1482
1483
  gettyVideoIds() {
@@ -2,7 +2,8 @@ import { BRAND_PAGE_TYPES } from '@brand-page';
2
2
  import { FIELD_SLOT_MAP, raisedLayerFor, strategyRoleRefForField, } from '@shared/color-strategies/color-strategies';
3
3
  import { isTransparentDisabled, } from '@shared/content-settings/disable-transparent.util';
4
4
  import { setRteTextColor } from '@shared/color-strategies/rte-color';
5
- import { pairedRteTextField } from '@shared/color-strategies/rte-field-pairs';
5
+ import { isTiptapDocument } from '@brand-page-maker/utils/rte-shape';
6
+ import { pairedRteTextField, RTE_ITEM_FIELD_PAIRS, } from '@shared/color-strategies/rte-field-pairs';
6
7
  /**
7
8
  * Field types a strategy can assign. `color` fields hold nothing but a colour and are
8
9
  * REPLACED via their `valueConvertor`; `text-style` fields hold typography *and* a
@@ -62,6 +63,17 @@ const sectionLayers = (assignable, content, context) => {
62
63
  surfaceFields.every(([, field]) => !isTransparentDisabled(field.disableTransparent, context?.brandPageType ?? BRAND_PAGE_TYPES.default)),
63
64
  };
64
65
  };
66
+ /**
67
+ * The strategy's text treatment for one text-style field: `color` set, text background
68
+ * cleared (matching the highlight strip in `setRteTextColor` — the toolbar writes both).
69
+ * The key is deleted rather than set undefined so `'backgroundColor' in style` checks
70
+ * downstream stay honest.
71
+ */
72
+ const withStrategyTextStyle = (current, ref) => {
73
+ const nextStyle = { ...(current ?? {}), color: ref };
74
+ delete nextStyle.backgroundColor;
75
+ return nextStyle;
76
+ };
65
77
  /**
66
78
  * Build the per-field colour writes a strategy stamps onto a section. Pure — reads the
67
79
  * section config + current content and returns a `{ fieldName: value }` partial. Each
@@ -97,16 +109,7 @@ export const buildColorStrategyValues = (config, content, strategyId, context, a
97
109
  }
98
110
  if (field.type === 'text-style') {
99
111
  const current = contentRecord[name];
100
- const nextStyle = {
101
- ...(current ?? {}),
102
- color: ref,
103
- };
104
- // A strategy owns the text treatment, so it clears the text background colour
105
- // too — matching the highlight strip in `setRteTextColor` (the toolbar writes
106
- // both). Delete the key rather than set it undefined so `'backgroundColor' in
107
- // style` checks downstream stay honest.
108
- delete nextStyle.backgroundColor;
109
- values[name] = nextStyle;
112
+ values[name] = withStrategyTextStyle(current, ref);
110
113
  // Also stamp the colour into the paired RTE document, if this field drives one.
111
114
  // `setRteTextColor` returns undefined for a plain string or legacy HTML RTE, so
112
115
  // that doubles as the "nothing to do" test — no separate type guard here.
@@ -133,6 +136,28 @@ export const buildColorStrategyValues = (config, content, strategyId, context, a
133
136
  }
134
137
  values[name] = field.valueConvertor.convertBack(ref);
135
138
  });
139
+ // Item-level RTE fields (each FAQ question) carry their own style and document, so
140
+ // the section's field loop above never sees them. Same two halves, per item, written
141
+ // back as one new list.
142
+ const itemPairs = typeof contentRecord.type === 'string'
143
+ ? (RTE_ITEM_FIELD_PAIRS[contentRecord.type] ?? [])
144
+ : [];
145
+ itemPairs.forEach((pair) => {
146
+ const ref = strategyRoleRefForField(strategyId, pair.styleField, content, context, layers, anchors);
147
+ const items = (values[pair.itemsField] ??
148
+ contentRecord[pair.itemsField]);
149
+ if (!ref || !Array.isArray(items)) {
150
+ return;
151
+ }
152
+ values[pair.itemsField] = items.map((item) => {
153
+ const nextDoc = setRteTextColor(item[pair.textField], ref);
154
+ return {
155
+ ...item,
156
+ [pair.styleField]: withStrategyTextStyle(item[pair.styleField], ref),
157
+ ...(nextDoc ? { [pair.textField]: nextDoc } : {}),
158
+ };
159
+ });
160
+ });
136
161
  return values;
137
162
  };
138
163
  /**
@@ -147,12 +172,15 @@ export const applyColorStrategyToItem = (store, { id, config, content, strategyI
147
172
  Object.entries(values).forEach(([name, value]) => {
148
173
  store.updateItemValue({ id, name, value });
149
174
  });
150
- // A recoloured RTE field is emitted as a whole Tiptap document; the paired
151
- // style-object writes are plain objects. Only the former needs the live editor
152
- // to re-seed, so signal it just when a doc was among the writes.
153
- const replacedRteDoc = Object.values(values).some((value) => typeof value === 'object' &&
154
- value !== null &&
155
- value.type === 'doc');
175
+ // A recoloured RTE field is emitted as a whole Tiptap document (at the top level,
176
+ // or inside a rewritten item list); the paired style-object writes are plain
177
+ // objects. Only the former needs the live editor to re-seed, so signal it just
178
+ // when a doc was among the writes.
179
+ const replacedRteDoc = Object.values(values).some((value) => isTiptapDocument(value) ||
180
+ (Array.isArray(value) &&
181
+ value.some((item) => typeof item === 'object' &&
182
+ item !== null &&
183
+ Object.values(item).some(isTiptapDocument))));
156
184
  if (replacedRteDoc) {
157
185
  markRteResync?.();
158
186
  }
@@ -36,6 +36,12 @@ export declare const getPlainTextFromRTE: (content: unknown) => string;
36
36
  */
37
37
  export declare const getRteTextLength: (value: RichTextValue | null | undefined) => number;
38
38
  export declare const replaceTextInRTE: (existingHtml: string, newText: string) => string;
39
+ /**
40
+ * Convert a new list item's plain text to RTE, as adding its section would. Goes through
41
+ * `transformRTEField` (element-first colour), so an item that copied a sibling's
42
+ * strategy-coloured style bakes that colour rather than the linked global one.
43
+ */
44
+ export declare const switchRteItemFieldsToRTE: (sectionType: string, item: Record<string, unknown>, externalEditor: Editor, uiStyleSettingsStore?: StyleSettingsState) => void;
39
45
  export declare const transformToRTE: (uiPageSettingStore: PageSettingsState, externalEditor: Editor, uiStyleSettingsStore?: StyleSettingsState, newContent?: Content, type?: TextStyleType, newStyle?: TextStyleDeclaration) => void;
40
46
  export declare const switchAllContentToRTE: (uiPageSettingStore: PageSettingsState, externalEditor: Editor, uiStyleSettingsStore?: StyleSettingsState) => void;
41
47
  export declare const getUpdatedHTMLFromEditor: (externalEditor: Editor, contentText: RichTextValue, newContentStyle: TextStyleDeclaration) => string | import("@tiptap/core").DocumentType<Record<string, any> | undefined, import("@tiptap/core").NodeType<string, Record<string, any> | undefined, any, (import("@tiptap/core").NodeType<any, any, any, any> | import("@tiptap/core").TextType<import("@tiptap/core").MarkType<any, any>>)[]>[]>;
@@ -5,7 +5,7 @@ import { getRenderText } from '@brand-page/utils';
5
5
  import createDomPurify, {} from 'dompurify';
6
6
  import Color from 'color';
7
7
  import { isHrefPageId } from '../composables/rich-text-editor/hyperlink';
8
- import { RTE_SECTION_FIELD_PAIRS, } from '@shared/color-strategies/rte-field-pairs';
8
+ import { RTE_ITEM_FIELD_PAIRS, RTE_SECTION_FIELD_PAIRS, } from '@shared/color-strategies/rte-field-pairs';
9
9
  // Re-exported below so every existing caller keeps importing them from here; they
10
10
  // live in a leaf module because this one pulls dompurify at runtime.
11
11
  import { isTiptapDocument, isRteHtmlString } from './rte-shape';
@@ -372,6 +372,24 @@ const switchRTEField = (content, pair, externalEditor, uiStyleSettingsStore) =>
372
372
  fields[pair.textField] = getUpdatedHTMLFromEditor(externalEditor, fields[pair.textField], style);
373
373
  }
374
374
  };
375
+ // Items are visited as their own "content": each item carries the style that drives its
376
+ // text, so the section-field helpers apply unchanged.
377
+ const forEachRteItem = (sectionType, content, visit) => {
378
+ for (const pair of RTE_ITEM_FIELD_PAIRS[sectionType] ?? []) {
379
+ const items = content[pair.itemsField];
380
+ if (Array.isArray(items)) {
381
+ items.forEach((item) => visit(item, pair));
382
+ }
383
+ }
384
+ };
385
+ /**
386
+ * Convert a new list item's plain text to RTE, as adding its section would. Goes through
387
+ * `transformRTEField` (element-first colour), so an item that copied a sibling's
388
+ * strategy-coloured style bakes that colour rather than the linked global one.
389
+ */
390
+ export const switchRteItemFieldsToRTE = (sectionType, item, externalEditor, uiStyleSettingsStore) => {
391
+ RTE_ITEM_FIELD_PAIRS[sectionType]?.forEach((pair) => transformRTEField(item, pair, externalEditor, uiStyleSettingsStore, item, undefined, undefined));
392
+ };
375
393
  export const transformToRTE = (uiPageSettingStore, externalEditor, uiStyleSettingsStore, newContent, type, newStyle) => {
376
394
  for (const page of uiPageSettingStore.pages) {
377
395
  for (const contentItem of page.contents) {
@@ -382,6 +400,10 @@ export const transformToRTE = (uiPageSettingStore, externalEditor, uiStyleSettin
382
400
  transformRTEField(content, pair, externalEditor, uiStyleSettingsStore, newContent, type, newStyle);
383
401
  }
384
402
  }
403
+ const isNewContent = !!newContent && newContent.id === contentItem.id;
404
+ forEachRteItem(contentItem.type, contentItem.settings.content, (item, pair) => transformRTEField(item, pair, externalEditor, uiStyleSettingsStore,
405
+ // An unlinked item of the section being added bakes its own style.
406
+ isNewContent ? item : undefined, type, newStyle));
385
407
  if (contentItem.type === 'text') {
386
408
  const textContent = contentItem.settings.content;
387
409
  if (textContent.textItems && textContent.textItems.length > 0) {
@@ -447,6 +469,7 @@ export const switchAllContentToRTE = (uiPageSettingStore, externalEditor, uiStyl
447
469
  switchRTEField(content, pair, externalEditor, uiStyleSettingsStore);
448
470
  }
449
471
  }
472
+ forEachRteItem(contentItem.type, contentItem.settings.content, (item, pair) => switchRTEField(item, pair, externalEditor, uiStyleSettingsStore));
450
473
  if (contentItem.type === 'text') {
451
474
  const textContent = contentItem.settings.content;
452
475
  if (textContent.textItems && textContent.textItems.length > 0) {
@@ -139,6 +139,7 @@ export const validatorDict = {
139
139
  'color-replacements': dummyValidator,
140
140
  'testimonial-items': dummyValidator,
141
141
  'text-items': dummyValidator,
142
+ 'faq-items': dummyValidator,
142
143
  'page-dropdown': dummyValidator,
143
144
  shape: dummyValidator,
144
145
  'logo-selection': dummyValidator,
@@ -181,6 +182,7 @@ export const adminValidatorsDict = {
181
182
  'color-replacements': dummyValidator,
182
183
  'testimonial-items': dummyValidator,
183
184
  'text-items': dummyValidator,
185
+ 'faq-items': dummyValidator,
184
186
  'page-dropdown': dummyValidator,
185
187
  shape: dummyValidator,
186
188
  'logo-selection': dummyValidator,