@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.
- package/lib/src/{CreatedOnBrandCrowd-de-de-CJZpKPNH.js → CreatedOnBrandCrowd-de-de-xmkupPus.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DkIa7iEb.js → CreatedOnBrandCrowd-en-us-Ck7EdTtb.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CE2p6XHz.js → CreatedOnBrandCrowd-es-es-BC8sJuDH.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BBjOZS3M.js → CreatedOnBrandCrowd-fr-ca-CN-UBe1q.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BBjOZS3M.js → CreatedOnBrandCrowd-fr-fr-CN-UBe1q.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-Dayzl4BZ.js → CreatedOnBrandCrowd-pt-br-CajQyNkx.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-Dayzl4BZ.js → CreatedOnBrandCrowd-pt-pt-CajQyNkx.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CFzDqfCb.js → CreatedOnDcom-de-de-BRCNMmDq.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-C2jIPBDY.js → CreatedOnDcom-en-us-BzQDtZhc.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-qejpzqho.js → CreatedOnDcom-es-es-D-qAM4Cd.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DMO9Ld7K.js → CreatedOnDcom-fr-ca-CZ1irFOc.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BFWN9qTP.js → CreatedOnDcom-fr-fr-Gb5BCF0N.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-CneD3ghF.js → CreatedOnDcom-pt-br-CAQV0q6o.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Cg1B7s0o.js → CreatedOnDcom-pt-pt-D6tQdQFh.js} +1 -1
- package/lib/src/brand-page/components/image-gallery/ImageGalleryModal.mixin.js +2 -2
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +0 -2
- package/lib/src/brand-page/models/brand-page-context.model.js +1 -11
- package/lib/src/brand-page/models/index.d.ts +1 -0
- package/lib/src/brand-page/models/index.js +1 -0
- package/lib/src/brand-page/utils/color.util.js +23 -3
- package/lib/src/brand-page/utils/raygun.util.d.ts +5 -1
- package/lib/src/brand-page/utils/raygun.util.js +7 -2
- package/lib/src/brand-page/utils/svg-color.util.js +1 -2
- package/lib/src/brand-page/utils/view-model.util.js +1 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -31
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -2
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +2 -31
- package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +0 -14
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -28
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +0 -28
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +0 -28
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +0 -28
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +0 -28
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +0 -28
- package/lib/src/brand-page-maker/composables/ai-chat/aiErrorCopy.d.ts +35 -0
- package/lib/src/brand-page-maker/composables/ai-chat/aiErrorCopy.js +108 -0
- package/lib/src/brand-page-maker/composables/ai-chat/{useAiChat.d.ts → types.d.ts} +5 -13
- package/lib/src/brand-page-maker/composables/ai-chat/types.js +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +19 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.js +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +488 -82
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +5 -5
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +6 -16
- package/lib/src/brand-page-maker/composables/useEventTracker.js +19 -21
- package/lib/src/brand-page-maker/constants/sidebar-constant.d.ts +0 -1
- package/lib/src/brand-page-maker/constants/sidebar-constant.js +7 -15
- package/lib/src/brand-page-maker/convertors/image-aspect-ratio.convertor.js +2 -2
- package/lib/src/brand-page-maker/convertors/text-size-value.convertor.js +3 -1
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +30660 -0
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.js +34 -0
- package/lib/src/brand-page-maker/stores/ai-thread/ai-website-builder-thread-store.d.ts +1 -1
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +0 -28
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +42 -2
- package/lib/src/brand-page-maker/stores/index.d.ts +1 -1
- package/lib/src/brand-page-maker/stores/index.js +1 -1
- package/lib/src/brand-page-maker/stores/user/user-store.js +0 -1
- package/lib/src/bundled-translations-CnareLWC.js +175 -0
- package/lib/src/bundled-translations.de-DE-2Ys7epLO.js +175 -0
- package/lib/src/bundled-translations.es-ES-Cjp-G8rT.js +175 -0
- package/lib/src/bundled-translations.fr-CA-CsaW4Oae.js +175 -0
- package/lib/src/bundled-translations.fr-FR-DIT2dd8J.js +175 -0
- package/lib/src/bundled-translations.pt-BR-BamoBpDW.js +175 -0
- package/lib/src/bundled-translations.pt-PT-C9A4hY_e.js +175 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +1 -20
- package/lib/src/bundles/bundled-translations.es-ES.json +1 -20
- package/lib/src/bundles/bundled-translations.fr-CA.json +1 -20
- package/lib/src/bundles/bundled-translations.fr-FR.json +1 -20
- package/lib/src/bundles/bundled-translations.json +1 -20
- package/lib/src/bundles/bundled-translations.pt-BR.json +1 -20
- package/lib/src/bundles/bundled-translations.pt-PT.json +1 -20
- package/lib/src/clients/ai-assistant-client.d.ts +30 -29
- package/lib/src/clients/ai-assistant-client.js +16 -16
- package/lib/src/clients/design-template-client.d.ts +0 -2
- package/lib/src/clients/design-template-client.js +0 -38
- package/lib/src/clients/websocket-gateway-client.d.ts +9 -1
- package/lib/src/composables/useTranslate.d.ts +2 -1
- package/lib/src/composables/useTranslate.js +2 -1
- package/lib/src/constants/ui.d.ts +0 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +225 -134
- package/lib/src/css/library.brand-page-brandPage.min.css +227 -121
- package/lib/src/css/library.brand-page-designCom.min.css +225 -134
- package/lib/src/css/library.brand-page-preview.min.css +225 -118
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-33w_DBny.js → lib-CSRUPpSo.js} +30887 -29395
- package/lib/src/metadata-builder/ai-metadata-executor.d.ts +21 -0
- package/lib/src/metadata-builder/ai-metadata-executor.js +56 -3
- package/lib/src/metadata-builder/builders/add-page-builder.d.ts +2 -4
- package/lib/src/metadata-builder/builders/add-page-builder.js +5 -8
- package/lib/src/metadata-builder/builders/footer-builder.d.ts +11 -0
- package/lib/src/metadata-builder/builders/footer-builder.js +151 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.d.ts +15 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.js +129 -0
- package/lib/src/metadata-builder/builders/header-builder.d.ts +11 -0
- package/lib/src/metadata-builder/builders/header-builder.js +167 -0
- package/lib/src/metadata-builder/builders/rename-page-builder.d.ts +12 -0
- package/lib/src/metadata-builder/builders/rename-page-builder.js +49 -0
- package/lib/src/metadata-builder/builders/section-builders/about-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +44 -4
- package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +70 -6
- package/lib/src/metadata-builder/builders/section-builders/base-section-builder.d.ts +36 -4
- package/lib/src/metadata-builder/builders/section-builders/base-section-builder.js +102 -12
- package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.d.ts +8 -0
- package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +50 -0
- package/lib/src/metadata-builder/builders/section-builders/button-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/button-section-builder.js +5 -1
- package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +47 -3
- package/lib/src/metadata-builder/builders/section-builders/delete-section-builder.d.ts +2 -1
- package/lib/src/metadata-builder/builders/section-builders/delete-section-builder.js +5 -2
- package/lib/src/metadata-builder/builders/section-builders/divider-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/divider-section-builder.js +11 -1
- package/lib/src/metadata-builder/builders/section-builders/image-gallery-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/image-gallery-builder.js +52 -13
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +47 -17
- package/lib/src/metadata-builder/builders/section-builders/index.d.ts +1 -0
- package/lib/src/metadata-builder/builders/section-builders/index.js +1 -0
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +20 -2
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +20 -2
- package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +36 -2
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +70 -27
- package/lib/src/metadata-builder/builders/section-builders/social-links-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +7 -2
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +91 -26
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +69 -31
- package/lib/src/metadata-builder/builders/section-content-factory.d.ts +2 -2
- package/lib/src/metadata-builder/builders/section-content-factory.js +8 -2
- package/lib/src/metadata-builder/builders/section-field-maps.js +30 -2
- package/lib/src/metadata-builder/builders/section-field-utils.d.ts +46 -7
- package/lib/src/metadata-builder/builders/section-field-utils.js +86 -62
- package/lib/src/metadata-builder/builders/section-rules/about-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/about-section.rules.js +20 -0
- package/lib/src/metadata-builder/builders/section-rules/add-page.rules.d.ts +7 -0
- package/lib/src/metadata-builder/builders/section-rules/add-page.rules.js +8 -0
- package/lib/src/metadata-builder/builders/section-rules/banner-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/banner-section.rules.js +27 -0
- package/lib/src/metadata-builder/builders/section-rules/booking-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/booking-section.rules.js +16 -0
- package/lib/src/metadata-builder/builders/section-rules/button-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/button-section.rules.js +13 -0
- package/lib/src/metadata-builder/builders/section-rules/contact-form.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/contact-form.rules.js +16 -0
- package/lib/src/metadata-builder/builders/section-rules/divider-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/divider-section.rules.js +7 -0
- package/lib/src/metadata-builder/builders/section-rules/footer.rules.d.ts +4 -0
- package/lib/src/metadata-builder/builders/section-rules/footer.rules.js +5 -0
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.d.ts +6 -0
- package/lib/src/metadata-builder/builders/section-rules/global-styles.rules.js +26 -0
- package/lib/src/metadata-builder/builders/section-rules/header.rules.d.ts +4 -0
- package/lib/src/metadata-builder/builders/section-rules/header.rules.js +41 -0
- package/lib/src/metadata-builder/builders/section-rules/image-gallery.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/image-gallery.rules.js +10 -0
- package/lib/src/metadata-builder/builders/section-rules/images-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/images-section.rules.js +31 -0
- package/lib/src/metadata-builder/builders/section-rules/mailing-list.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/mailing-list.rules.js +11 -0
- package/lib/src/metadata-builder/builders/section-rules/profile.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/profile.rules.js +14 -0
- package/lib/src/metadata-builder/builders/section-rules/rename-page.rules.d.ts +7 -0
- package/lib/src/metadata-builder/builders/section-rules/rename-page.rules.js +8 -0
- package/lib/src/metadata-builder/builders/section-rules/shapes-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/shapes-section.rules.js +27 -0
- package/lib/src/metadata-builder/builders/section-rules/social-links.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/social-links.rules.js +9 -0
- package/lib/src/metadata-builder/builders/section-rules/testimonial-section.rules.d.ts +7 -0
- package/lib/src/metadata-builder/builders/section-rules/testimonial-section.rules.js +26 -0
- package/lib/src/metadata-builder/builders/section-rules/text-section.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/text-section.rules.js +14 -0
- package/lib/src/metadata-builder/builders/shape-color-utils.d.ts +26 -0
- package/lib/src/metadata-builder/builders/shape-color-utils.js +52 -0
- package/lib/src/metadata-builder/builders/undo-builder.d.ts +48 -0
- package/lib/src/metadata-builder/builders/undo-builder.js +58 -0
- package/lib/src/metadata-builder/builders/update-content-text-style-builder.js +5 -1
- package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +15 -4
- package/lib/src/metadata-builder/helpers/rte.helpers.js +24 -10
- package/lib/src/metadata-builder/metadata-executor.d.ts +2 -1
- package/lib/src/metadata-builder/metadata-executor.js +32 -5
- package/lib/src/metadata-builder/models.d.ts +26 -1
- package/lib/src/metadata-builder/models.js +14 -1
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +144 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.js +17 -0
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +113 -24
- package/lib/src/metadata-builder/parsers/section-tool-arguments.js +5 -1
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.d.ts +22 -0
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +84 -0
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.d.ts +47 -0
- package/lib/src/metadata-builder/sanitizers/sanitizer-rules.js +60 -0
- package/lib/src/metadata-builder/sanitizers/section-args-validator.d.ts +41 -0
- package/lib/src/metadata-builder/sanitizers/section-args-validator.js +274 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -1
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +2 -16
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +0 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +2 -3
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +0 -4
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +6 -8
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +0 -28
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +2 -1
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +0 -28
- package/lib/src/shared/navigation-style-settings/store/index.js +1 -0
- package/lib/src/shared/page-navigation/store/page-navigation-store.js +1 -20
- package/lib/src/shared/page-navigation/utils/nav-order-utils.d.ts +3 -0
- package/lib/src/shared/page-navigation/utils/nav-order-utils.js +20 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -30
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -28
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +2 -43
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +0 -30
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +2 -3
- package/lib/src/shared/side-bar/store/side-bar-store.d.ts +0 -12
- package/lib/src/shared/side-bar/store/side-bar-store.js +0 -7
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -29
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +2 -1
- package/lib/src/utils/build-asset-manifest.d.ts +26 -0
- package/lib/src/utils/build-asset-manifest.js +114 -0
- package/lib/src/utils/minify-brand-page-metadata.d.ts +49 -1
- package/lib/src/utils/minify-brand-page-metadata.js +216 -129
- package/package.json +1 -1
- package/src/brand-page/components/banner-section/BannerSection.vue +1 -1
- package/src/brand-page/components/contact-form/ContactForm.vue +29 -26
- package/src/brand-page/components/image-gallery/ImageGalleryModal.mixin.ts +6 -2
- package/src/brand-page/components/text-media-section/TextMediaSection.vue +1 -5
- package/src/brand-page/models/brand-page-context.model.ts +1 -25
- package/src/brand-page/models/index.ts +1 -0
- package/src/brand-page/utils/color.util.test.ts +48 -0
- package/src/brand-page/utils/color.util.ts +29 -4
- package/src/brand-page/utils/raygun.util.ts +11 -2
- package/src/brand-page/utils/svg-color.util.ts +1 -3
- package/src/brand-page/utils/view-model.util.ts +1 -4
- package/src/brand-page-maker/components/ai-text-edit/AiChatbox.vue +2 -2
- package/src/brand-page-maker/components/ai-text-edit/AiProgressFeed.vue +162 -0
- package/src/brand-page-maker/components/ai-text-edit/TextBubble.vue +57 -5
- package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.de-DE.json +0 -20
- package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.es-ES.json +0 -20
- package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.fr-CA.json +0 -20
- package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.fr-FR.json +0 -20
- package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.json +0 -20
- package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.pt-BR.json +0 -20
- package/src/brand-page-maker/components/ai-text-edit/i18n/generate-ai.pt-PT.json +0 -20
- package/src/brand-page-maker/components/ai-website-builder/AiWebsiteBuilder.vue +1 -2
- package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.de-DE.json +3 -0
- package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.es-ES.json +3 -0
- package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.fr-CA.json +3 -0
- package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.fr-FR.json +3 -0
- package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.json +3 -0
- package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.pt-BR.json +3 -0
- package/src/brand-page-maker/components/ai-website-builder/i18n/ai-website-builder.pt-PT.json +3 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +3 -28
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -2
- package/src/brand-page-maker/composables/ai-chat/aiErrorCopy.test.ts +229 -0
- package/src/brand-page-maker/composables/ai-chat/aiErrorCopy.ts +164 -0
- package/src/brand-page-maker/composables/ai-chat/types.ts +49 -0
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +20 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +651 -94
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +9 -9
- package/src/brand-page-maker/composables/useEventTracker.ts +31 -25
- package/src/brand-page-maker/constants/sidebar-constant.ts +7 -15
- package/src/brand-page-maker/convertors/image-aspect-ratio.convertor.ts +2 -2
- package/src/brand-page-maker/convertors/text-size-value.convertor.ts +3 -3
- package/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.ts +54 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +76 -0
- package/src/brand-page-maker/stores/index.ts +1 -1
- package/src/brand-page-maker/stores/user/user-store.ts +0 -1
- package/src/bundles/bundled-translations.de-DE.json +1 -20
- package/src/bundles/bundled-translations.es-ES.json +1 -20
- package/src/bundles/bundled-translations.fr-CA.json +1 -20
- package/src/bundles/bundled-translations.fr-FR.json +1 -20
- package/src/bundles/bundled-translations.json +1 -20
- package/src/bundles/bundled-translations.pt-BR.json +1 -20
- package/src/bundles/bundled-translations.pt-PT.json +1 -20
- package/src/clients/ai-assistant-client.ts +59 -46
- package/src/clients/design-template-client.ts +0 -66
- package/src/clients/websocket-gateway-client.ts +17 -1
- package/src/composables/useTranslate.ts +3 -0
- package/src/constants/ui.ts +0 -1
- package/src/lib.ts +1 -0
- package/src/metadata-builder/ai-metadata-executor.ts +94 -1
- package/src/metadata-builder/builders/add-page-builder.ts +9 -13
- package/src/metadata-builder/builders/footer-builder.test.ts +76 -0
- package/src/metadata-builder/builders/footer-builder.ts +226 -0
- package/src/metadata-builder/builders/global-styles-builder.ts +187 -0
- package/src/metadata-builder/builders/header-builder.test.ts +106 -0
- package/src/metadata-builder/builders/header-builder.ts +254 -0
- package/src/metadata-builder/builders/rename-page-builder.ts +79 -0
- package/src/metadata-builder/builders/section-builders/about-section-builder.ts +73 -5
- package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +112 -7
- package/src/metadata-builder/builders/section-builders/base-section-builder.ts +149 -11
- package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +87 -0
- package/src/metadata-builder/builders/section-builders/button-section-builder.ts +6 -1
- package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +74 -4
- package/src/metadata-builder/builders/section-builders/delete-section-builder.ts +15 -1
- package/src/metadata-builder/builders/section-builders/divider-section-builder.ts +13 -1
- package/src/metadata-builder/builders/section-builders/image-gallery-builder.ts +91 -31
- package/src/metadata-builder/builders/section-builders/images-section-builder.ts +102 -48
- package/src/metadata-builder/builders/section-builders/index.ts +1 -0
- package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +38 -2
- package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +38 -2
- package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +55 -3
- package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +170 -77
- package/src/metadata-builder/builders/section-builders/social-links-builder.test.ts +119 -0
- package/src/metadata-builder/builders/section-builders/social-links-builder.ts +13 -2
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +178 -57
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +130 -30
- package/src/metadata-builder/builders/section-content-factory.ts +15 -2
- package/src/metadata-builder/builders/section-field-maps.ts +34 -1
- package/src/metadata-builder/builders/section-field-utils.ts +131 -72
- package/src/metadata-builder/builders/section-rules/about-section.rules.ts +38 -0
- package/src/metadata-builder/builders/section-rules/add-page.rules.ts +17 -0
- package/src/metadata-builder/builders/section-rules/banner-section.rules.ts +49 -0
- package/src/metadata-builder/builders/section-rules/booking-section.rules.ts +34 -0
- package/src/metadata-builder/builders/section-rules/button-section.rules.ts +22 -0
- package/src/metadata-builder/builders/section-rules/contact-form.rules.ts +30 -0
- package/src/metadata-builder/builders/section-rules/divider-section.rules.ts +17 -0
- package/src/metadata-builder/builders/section-rules/footer.rules.ts +21 -0
- package/src/metadata-builder/builders/section-rules/global-styles.rules.ts +44 -0
- package/src/metadata-builder/builders/section-rules/header.rules.ts +75 -0
- package/src/metadata-builder/builders/section-rules/image-gallery.rules.ts +22 -0
- package/src/metadata-builder/builders/section-rules/images-section.rules.ts +55 -0
- package/src/metadata-builder/builders/section-rules/mailing-list.rules.ts +21 -0
- package/src/metadata-builder/builders/section-rules/profile.rules.ts +27 -0
- package/src/metadata-builder/builders/section-rules/rename-page.rules.ts +17 -0
- package/src/metadata-builder/builders/section-rules/shapes-section.rules.ts +51 -0
- package/src/metadata-builder/builders/section-rules/social-links.rules.ts +27 -0
- package/src/metadata-builder/builders/section-rules/testimonial-section.rules.ts +48 -0
- package/src/metadata-builder/builders/section-rules/text-section.rules.ts +28 -0
- package/src/metadata-builder/builders/shape-color-utils.test.ts +115 -0
- package/src/metadata-builder/builders/shape-color-utils.ts +75 -0
- package/src/metadata-builder/builders/undo-builder.ts +105 -0
- package/src/metadata-builder/builders/update-content-text-style-builder.ts +4 -1
- package/src/metadata-builder/helpers/rte.helpers.ts +27 -13
- package/src/metadata-builder/metadata-executor.ts +42 -2
- package/src/metadata-builder/models.ts +39 -1
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +152 -0
- package/src/metadata-builder/parsers/section-tool-arguments.ts +138 -24
- package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +659 -0
- package/src/metadata-builder/sanitizers/rte-schema-check.ts +99 -0
- package/src/metadata-builder/sanitizers/sanitizer-rules.ts +97 -0
- package/src/metadata-builder/sanitizers/section-args-validator.ts +445 -0
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +10 -16
- package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +0 -1
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +6 -10
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +1 -23
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +0 -15
- package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +0 -15
- package/src/shared/navigation-style-settings/store/index.ts +5 -0
- package/src/shared/page-navigation/store/page-navigation-store.ts +4 -31
- package/src/shared/page-navigation/utils/nav-order-utils.ts +32 -0
- package/src/shared/side-bar/components/SideBar.vue +14 -1
- package/src/shared/side-bar/store/side-bar-store.ts +0 -20
- package/src/utils/build-asset-manifest.ts +153 -0
- package/src/utils/minify-brand-page-metadata.ts +362 -130
- package/lib/src/brand-page-maker/composables/ai-chat/useAiChat.js +0 -368
- package/lib/src/brand-page-maker/composables/ai-chat/useAiTextEditPrompts.d.ts +0 -18
- package/lib/src/brand-page-maker/composables/ai-chat/useAiTextEditPrompts.js +0 -144
- package/lib/src/brand-page-maker/stores/ai-thread/ai-thread-store.d.ts +0 -155
- package/lib/src/brand-page-maker/stores/ai-thread/ai-thread-store.js +0 -25
- package/lib/src/brand-page-maker/utils/mixpanel.util.d.ts +0 -1
- package/lib/src/brand-page-maker/utils/mixpanel.util.js +0 -29
- package/lib/src/bundled-translations-CNK7l6_v.js +0 -173
- package/lib/src/bundled-translations.de-DE-BLE4_y0H.js +0 -173
- package/lib/src/bundled-translations.es-ES-thO9osbg.js +0 -173
- package/lib/src/bundled-translations.fr-CA-BZkhiNgU.js +0 -173
- package/lib/src/bundled-translations.fr-FR-bhDLPKgZ.js +0 -173
- package/lib/src/bundled-translations.pt-BR-CI9a5Bq1.js +0 -173
- package/lib/src/bundled-translations.pt-PT-DBoErBaq.js +0 -173
- package/src/brand-page-maker/components/ai-text-edit/AiTextEdit.vue +0 -154
- package/src/brand-page-maker/composables/ai-chat/useAiChat.ts +0 -562
- package/src/brand-page-maker/composables/ai-chat/useAiTextEditPrompts.ts +0 -196
- package/src/brand-page-maker/stores/ai-thread/ai-thread-store.ts +0 -31
- package/src/brand-page-maker/utils/mixpanel.util.ts +0 -42
- package/src/shared/content-settings/components/generate-ai-button/GenerateAiButton.vue +0 -114
- package/src/shared/content-settings/components/generate-ai-modal/GenerateAiModal.vue +0 -761
|
@@ -218,7 +218,7 @@ export class UpdateContentTextStyleBuilder extends BaseMetadataBuilder<UpdateTex
|
|
|
218
218
|
const { newStyles } = this.request.payload!;
|
|
219
219
|
const errors: string[] = [];
|
|
220
220
|
|
|
221
|
-
// Validate lineHeight: must be between 0 and 2.5 inclusive
|
|
221
|
+
// Validate lineHeight: must be between 0 and 2.5 inclusive, snap to 0.1 step
|
|
222
222
|
if (newStyles.lineHeight !== undefined && newStyles.lineHeight !== null) {
|
|
223
223
|
const lineHeightValue = parseFloat(String(newStyles.lineHeight));
|
|
224
224
|
|
|
@@ -228,6 +228,9 @@ export class UpdateContentTextStyleBuilder extends BaseMetadataBuilder<UpdateTex
|
|
|
228
228
|
lineHeightValue > 2.5
|
|
229
229
|
) {
|
|
230
230
|
errors.push('Line height must be a value between 0 and 2.5 inclusive.');
|
|
231
|
+
} else {
|
|
232
|
+
// Snap to 0.1 increments to match the UI slider step
|
|
233
|
+
newStyles.lineHeight = String(Math.floor(lineHeightValue * 10) / 10);
|
|
231
234
|
}
|
|
232
235
|
}
|
|
233
236
|
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { TextStyleDeclaration } from '../../brand-page';
|
|
2
|
-
import { getRTEColor
|
|
2
|
+
import { getRTEColor } from '../../brand-page-maker/utils';
|
|
3
3
|
import { useExternalRichTextEditor } from '../../brand-page-maker/composables/rich-text-editor/useRichTextEditor';
|
|
4
4
|
import { getRenderText } from '../../brand-page/utils';
|
|
5
5
|
import { ESCAPED_NEWLINE_CHARACTER } from '../../constants/ui';
|
|
6
6
|
import type { Editor } from '@tiptap/vue-3';
|
|
7
|
+
import {
|
|
8
|
+
isTiptapDocument,
|
|
9
|
+
type TiptapDocument,
|
|
10
|
+
} from '../parsers/section-tool-arguments';
|
|
7
11
|
|
|
8
12
|
export const applyStyleToRTEText = (
|
|
9
13
|
externalEditor: Editor,
|
|
@@ -79,22 +83,32 @@ export const applyStyleToRTEText = (
|
|
|
79
83
|
};
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
86
|
+
* Converts a Tiptap JSON document (ProseMirror document model) to an HTML
|
|
87
|
+
* string using a headless Tiptap Editor instance.
|
|
88
|
+
*
|
|
89
|
+
* Returns the value unchanged if it is already a string.
|
|
90
|
+
* Returns an empty string for null/undefined.
|
|
91
|
+
*
|
|
92
|
+
* Note: Tiptap's `setContent` does NOT throw on malformed input — it
|
|
93
|
+
* silently drops content and returns `<p></p>`. To prevent saved copy
|
|
94
|
+
* being wiped (BP-5669), structural validity of any AI-emitted Tiptap
|
|
95
|
+
* doc is checked upstream by `rteSchemaCheck` in
|
|
96
|
+
* `section-args-validator.ts` using the editor's real ProseMirror
|
|
97
|
+
* schema. The validator surfaces a clear error into
|
|
98
|
+
* `BuilderResult.errors`, which the AI-chat retry loop reads via
|
|
99
|
+
* `tool_result.errorMessage` and uses to re-emit a corrected payload.
|
|
85
100
|
*/
|
|
86
|
-
export const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)
|
|
90
|
-
if (!text || typeof text !== 'string' || !hasRTEContent(text)) {
|
|
91
|
-
return text;
|
|
92
|
-
}
|
|
101
|
+
export const tiptapJsonToHtml = (value: unknown): string => {
|
|
102
|
+
if (typeof value === 'string') return value;
|
|
103
|
+
|
|
104
|
+
if (!isTiptapDocument(value)) return '';
|
|
93
105
|
|
|
94
106
|
const { externalEditor } = useExternalRichTextEditor();
|
|
95
|
-
|
|
107
|
+
|
|
108
|
+
externalEditor.commands.setContent(value as TiptapDocument);
|
|
109
|
+
const html = externalEditor.getHTML();
|
|
96
110
|
|
|
97
111
|
externalEditor.destroy();
|
|
98
112
|
|
|
99
|
-
return
|
|
113
|
+
return html;
|
|
100
114
|
};
|
|
@@ -12,6 +12,7 @@ import { UpdateContentTextBuilder } from './builders/update-content-text-builder
|
|
|
12
12
|
import { UpdateContentTextStyleBuilder } from './builders/update-content-text-style-builder';
|
|
13
13
|
import {
|
|
14
14
|
BannerSectionBuilder,
|
|
15
|
+
BookingSectionBuilder,
|
|
15
16
|
AboutSectionBuilder,
|
|
16
17
|
ContactFormBuilder,
|
|
17
18
|
DividerSectionBuilder,
|
|
@@ -29,11 +30,18 @@ import {
|
|
|
29
30
|
} from './builders/section-builders';
|
|
30
31
|
import { AddPageBuilder } from './builders/add-page-builder';
|
|
31
32
|
import { RemovePageBuilder } from './builders/remove-page-builder';
|
|
33
|
+
import { RenamePageBuilder } from './builders/rename-page-builder';
|
|
34
|
+
import { FooterBuilder } from './builders/footer-builder';
|
|
35
|
+
import { GlobalStylesBuilder } from './builders/global-styles-builder';
|
|
36
|
+
import { HeaderBuilder } from './builders/header-builder';
|
|
37
|
+
import { UndoBuilder } from './builders/undo-builder';
|
|
38
|
+
import type { EventTracker } from '../brand-page-maker/composables/useEventTracker';
|
|
32
39
|
import type { Logger } from './logger';
|
|
33
40
|
|
|
34
41
|
type BuilderConstructor = new (
|
|
35
42
|
request: MetadataBuilderRequest<any>,
|
|
36
43
|
logger?: Logger,
|
|
44
|
+
eventTracker?: EventTracker,
|
|
37
45
|
) => BaseMetadataBuilder;
|
|
38
46
|
|
|
39
47
|
// Lazy initialization to avoid circular dependency issues
|
|
@@ -43,6 +51,7 @@ const getBuilderRegistry = (): Record<BuilderType, BuilderConstructor> => ({
|
|
|
43
51
|
|
|
44
52
|
// Section builders (create)
|
|
45
53
|
[BUILDER_TYPES.CREATE_BANNER_SECTION]: BannerSectionBuilder,
|
|
54
|
+
[BUILDER_TYPES.CREATE_BOOKING_SECTION]: BookingSectionBuilder,
|
|
46
55
|
[BUILDER_TYPES.CREATE_ABOUT_SECTION]: AboutSectionBuilder,
|
|
47
56
|
[BUILDER_TYPES.CREATE_CONTACT_FORM]: ContactFormBuilder,
|
|
48
57
|
[BUILDER_TYPES.CREATE_DIVIDER_SECTION]: DividerSectionBuilder,
|
|
@@ -69,6 +78,7 @@ const getBuilderRegistry = (): Record<BuilderType, BuilderConstructor> => ({
|
|
|
69
78
|
|
|
70
79
|
// Section builders (update)
|
|
71
80
|
[BUILDER_TYPES.UPDATE_BANNER_SECTION]: BannerSectionBuilder,
|
|
81
|
+
[BUILDER_TYPES.UPDATE_BOOKING_SECTION]: BookingSectionBuilder,
|
|
72
82
|
[BUILDER_TYPES.UPDATE_ABOUT_SECTION]: AboutSectionBuilder,
|
|
73
83
|
[BUILDER_TYPES.UPDATE_CONTACT_FORM]: ContactFormBuilder,
|
|
74
84
|
[BUILDER_TYPES.UPDATE_DIVIDER_SECTION]: DividerSectionBuilder,
|
|
@@ -100,6 +110,19 @@ const getBuilderRegistry = (): Record<BuilderType, BuilderConstructor> => ({
|
|
|
100
110
|
// Page-level operations
|
|
101
111
|
[BUILDER_TYPES.ADD_PAGE]: AddPageBuilder,
|
|
102
112
|
[BUILDER_TYPES.REMOVE_PAGE]: RemovePageBuilder,
|
|
113
|
+
[BUILDER_TYPES.RENAME_PAGE]: RenamePageBuilder,
|
|
114
|
+
|
|
115
|
+
// Footer operations
|
|
116
|
+
[BUILDER_TYPES.UPDATE_FOOTER]: FooterBuilder,
|
|
117
|
+
|
|
118
|
+
// Global styles operations
|
|
119
|
+
[BUILDER_TYPES.UPDATE_GLOBAL_STYLES]: GlobalStylesBuilder,
|
|
120
|
+
|
|
121
|
+
// Header operations
|
|
122
|
+
[BUILDER_TYPES.UPDATE_HEADER]: HeaderBuilder,
|
|
123
|
+
|
|
124
|
+
// Website-level operations
|
|
125
|
+
[BUILDER_TYPES.UNDO_WEBSITE]: UndoBuilder,
|
|
103
126
|
});
|
|
104
127
|
|
|
105
128
|
let builderRegistry: Record<BuilderType, BuilderConstructor> | null = null;
|
|
@@ -107,6 +130,7 @@ let builderRegistry: Record<BuilderType, BuilderConstructor> | null = null;
|
|
|
107
130
|
const resolveBuilder = (
|
|
108
131
|
request: MetadataBuilderRequest,
|
|
109
132
|
logger?: Logger,
|
|
133
|
+
eventTracker?: EventTracker,
|
|
110
134
|
): BaseMetadataBuilder | null => {
|
|
111
135
|
if (!builderRegistry) {
|
|
112
136
|
builderRegistry = getBuilderRegistry();
|
|
@@ -120,7 +144,7 @@ const resolveBuilder = (
|
|
|
120
144
|
return null;
|
|
121
145
|
}
|
|
122
146
|
|
|
123
|
-
return new BuilderClass(request, logger);
|
|
147
|
+
return new BuilderClass(request, logger, eventTracker);
|
|
124
148
|
};
|
|
125
149
|
|
|
126
150
|
export class MetadataExecutor {
|
|
@@ -128,13 +152,14 @@ export class MetadataExecutor {
|
|
|
128
152
|
metadata: BrandPageModel,
|
|
129
153
|
requests: MetadataBuilderRequest[],
|
|
130
154
|
logger?: Logger,
|
|
155
|
+
eventTracker?: EventTracker,
|
|
131
156
|
): Promise<MetadataExecutorResult> {
|
|
132
157
|
let model = cloneDeep(metadata);
|
|
133
158
|
|
|
134
159
|
const results: BuilderResult[] = [];
|
|
135
160
|
|
|
136
161
|
for (const request of requests) {
|
|
137
|
-
const builder = resolveBuilder(request, logger);
|
|
162
|
+
const builder = resolveBuilder(request, logger, eventTracker);
|
|
138
163
|
|
|
139
164
|
if (!builder) {
|
|
140
165
|
results.push({
|
|
@@ -148,6 +173,21 @@ export class MetadataExecutor {
|
|
|
148
173
|
|
|
149
174
|
const result = await builder.buildAsync(model);
|
|
150
175
|
|
|
176
|
+
// Surface the section's resolved content id on the result. The AI-chat
|
|
177
|
+
// retry path uses this to fill its vacant-slot tracker so a previously
|
|
178
|
+
// failed CREATE can re-enter its planned position on the page. Done at
|
|
179
|
+
// the executor level so individual builders don't have to remember to
|
|
180
|
+
// populate the field on every code path.
|
|
181
|
+
const resolveContentId = (
|
|
182
|
+
builder as { getResolvedContentId?: () => string | undefined }
|
|
183
|
+
).getResolvedContentId?.bind(builder);
|
|
184
|
+
|
|
185
|
+
if (resolveContentId && !result.contentId) {
|
|
186
|
+
const cid = resolveContentId();
|
|
187
|
+
|
|
188
|
+
if (cid) result.contentId = cid;
|
|
189
|
+
}
|
|
190
|
+
|
|
151
191
|
results.push(result);
|
|
152
192
|
|
|
153
193
|
model = result.model;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type BrandPageModel } from '../brand-page/models';
|
|
2
|
+
import type { EventTracker } from '../brand-page-maker/composables/useEventTracker';
|
|
2
3
|
import type { Logger } from './logger';
|
|
3
4
|
|
|
4
5
|
export const BUILDER_TYPES = {
|
|
@@ -30,6 +31,7 @@ export const BUILDER_TYPES = {
|
|
|
30
31
|
CREATE_PINTEREST: 'create-pinterest',
|
|
31
32
|
CREATE_TWITCH: 'create-twitch',
|
|
32
33
|
CREATE_TIKTOK: 'create-tiktok',
|
|
34
|
+
CREATE_BOOKING_SECTION: 'create-booking-section',
|
|
33
35
|
|
|
34
36
|
// Per-section builder types (update)
|
|
35
37
|
UPDATE_BANNER_SECTION: 'update-banner-section',
|
|
@@ -56,6 +58,7 @@ export const BUILDER_TYPES = {
|
|
|
56
58
|
UPDATE_PINTEREST: 'update-pinterest',
|
|
57
59
|
UPDATE_TWITCH: 'update-twitch',
|
|
58
60
|
UPDATE_TIKTOK: 'update-tiktok',
|
|
61
|
+
UPDATE_BOOKING_SECTION: 'update-booking-section',
|
|
59
62
|
|
|
60
63
|
// Section-level operations
|
|
61
64
|
DELETE_SECTION: 'delete-section',
|
|
@@ -64,6 +67,19 @@ export const BUILDER_TYPES = {
|
|
|
64
67
|
// Page-level operations
|
|
65
68
|
ADD_PAGE: 'add-page',
|
|
66
69
|
REMOVE_PAGE: 'remove-page',
|
|
70
|
+
RENAME_PAGE: 'rename-page',
|
|
71
|
+
|
|
72
|
+
// Footer operations
|
|
73
|
+
UPDATE_FOOTER: 'update-footer',
|
|
74
|
+
|
|
75
|
+
// Global styles operations
|
|
76
|
+
UPDATE_GLOBAL_STYLES: 'update-global-styles',
|
|
77
|
+
|
|
78
|
+
// Header operations
|
|
79
|
+
UPDATE_HEADER: 'update-header',
|
|
80
|
+
|
|
81
|
+
// Website-level operations
|
|
82
|
+
UNDO_WEBSITE: 'undo-website',
|
|
67
83
|
} as const;
|
|
68
84
|
|
|
69
85
|
export type BuilderType = (typeof BUILDER_TYPES)[keyof typeof BUILDER_TYPES];
|
|
@@ -88,15 +104,37 @@ export interface BuilderResult {
|
|
|
88
104
|
request: MetadataBuilderRequest;
|
|
89
105
|
model: BrandPageModel;
|
|
90
106
|
errors?: string[];
|
|
107
|
+
/**
|
|
108
|
+
* Set by the UndoBuilder to signal that the caller should restore the
|
|
109
|
+
* website to the snapshot taken before the most recent change-producing
|
|
110
|
+
* prompt. The model returned alongside this flag is unchanged — the actual
|
|
111
|
+
* snapshot restore happens outside this library.
|
|
112
|
+
*/
|
|
113
|
+
undoRequested?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* The frontend-assigned content ID of the section this builder created or
|
|
116
|
+
* updated. Populated for section CREATE flows so callers can anchor
|
|
117
|
+
* downstream operations (notably the AI retry path's vacant-slot tracking)
|
|
118
|
+
* to the resolved content. Undefined on failure, on non-section builders
|
|
119
|
+
* (page-level ops, undo), and on builders that don't touch a single
|
|
120
|
+
* content (e.g. global-styles).
|
|
121
|
+
*/
|
|
122
|
+
contentId?: string;
|
|
91
123
|
}
|
|
92
124
|
|
|
93
125
|
export abstract class BaseMetadataBuilder<T = unknown> {
|
|
94
126
|
protected request: MetadataBuilderRequest<T>;
|
|
95
127
|
protected logger?: Logger;
|
|
128
|
+
protected eventTracker?: EventTracker;
|
|
96
129
|
|
|
97
|
-
constructor(
|
|
130
|
+
constructor(
|
|
131
|
+
request: MetadataBuilderRequest<T>,
|
|
132
|
+
logger?: Logger,
|
|
133
|
+
eventTracker?: EventTracker,
|
|
134
|
+
) {
|
|
98
135
|
this.request = request;
|
|
99
136
|
this.logger = logger;
|
|
137
|
+
this.eventTracker = eventTracker;
|
|
100
138
|
}
|
|
101
139
|
|
|
102
140
|
abstract validateAsync(): Promise<{
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { AiAssistantToolCall } from '../../clients/ai-assistant-client';
|
|
2
|
+
import type {
|
|
3
|
+
FooterDisplayStyle,
|
|
4
|
+
HeaderDisplayStyle,
|
|
5
|
+
NavigationDisplayType,
|
|
6
|
+
} from '../../brand-page/constants';
|
|
2
7
|
import type { SectionType } from './section-tool-arguments';
|
|
3
8
|
|
|
4
9
|
// Tool names — must match the function names generated by the AI pipeline.
|
|
@@ -37,6 +42,7 @@ export const AI_ASSISTANT_TOOL_NAMES = {
|
|
|
37
42
|
BUILD_SHAPES_SECTION: 'build_shapes-section_section',
|
|
38
43
|
BUILD_TESTIMONIAL_SECTION: 'build_testimonial-section_section',
|
|
39
44
|
BUILD_DIVIDER_SECTION: 'build_divider-section_section',
|
|
45
|
+
BUILD_BOOKING_SECTION: 'build_booking-section_section',
|
|
40
46
|
|
|
41
47
|
// Section-level operation tools
|
|
42
48
|
DELETE_SECTION: 'delete_section',
|
|
@@ -45,6 +51,23 @@ export const AI_ASSISTANT_TOOL_NAMES = {
|
|
|
45
51
|
// Page-level operation tools
|
|
46
52
|
ADD_PAGE: 'add_page',
|
|
47
53
|
REMOVE_PAGE: 'remove_page',
|
|
54
|
+
RENAME_PAGE: 'rename_page',
|
|
55
|
+
|
|
56
|
+
// Footer operation tools
|
|
57
|
+
UPDATE_FOOTER: 'update_footer',
|
|
58
|
+
|
|
59
|
+
// Global styles operation tools
|
|
60
|
+
UPDATE_GLOBAL_STYLES: 'tool_update_global_styles',
|
|
61
|
+
|
|
62
|
+
// Header operation tools
|
|
63
|
+
UPDATE_HEADER: 'update_header',
|
|
64
|
+
|
|
65
|
+
// Website-level operations
|
|
66
|
+
// `undo` restores the website to the snapshot taken before the most recent
|
|
67
|
+
// change-producing prompt. The actual snapshot restore is performed outside
|
|
68
|
+
// this library — the library only recognizes the tool call and signals the
|
|
69
|
+
// request via BuilderResult.undoRequested.
|
|
70
|
+
UNDO: 'undo',
|
|
48
71
|
} as const;
|
|
49
72
|
|
|
50
73
|
export type AiAssistantToolName =
|
|
@@ -135,6 +158,9 @@ export const SECTION_TOOL_MAP: Record<string, { sectionType: SectionType }> = {
|
|
|
135
158
|
[AI_ASSISTANT_TOOL_NAMES.BUILD_DIVIDER_SECTION]: {
|
|
136
159
|
sectionType: 'divider-section',
|
|
137
160
|
},
|
|
161
|
+
[AI_ASSISTANT_TOOL_NAMES.BUILD_BOOKING_SECTION]: {
|
|
162
|
+
sectionType: 'booking-section',
|
|
163
|
+
},
|
|
138
164
|
};
|
|
139
165
|
|
|
140
166
|
export interface DeleteSectionArguments {
|
|
@@ -156,6 +182,132 @@ export interface RemovePageArguments {
|
|
|
156
182
|
page_id: string;
|
|
157
183
|
}
|
|
158
184
|
|
|
185
|
+
export interface RenamePageArguments {
|
|
186
|
+
page_id: string;
|
|
187
|
+
page_name: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface ReorderPagesArguments {
|
|
191
|
+
page_order: string[];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Arguments for the `undo` tool call.
|
|
196
|
+
*
|
|
197
|
+
* Empty by design: the snapshot to restore is determined externally (it's the
|
|
198
|
+
* snapshot taken before the most recent change-producing prompt). The library
|
|
199
|
+
* does not own snapshot persistence.
|
|
200
|
+
*/
|
|
201
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
202
|
+
export interface UndoArguments {}
|
|
203
|
+
|
|
204
|
+
export interface FooterSocialLinkItem {
|
|
205
|
+
item_index?: number;
|
|
206
|
+
insert_at?: number;
|
|
207
|
+
social_link_icon?: string;
|
|
208
|
+
url?: string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Per-viewport field overrides for a single update_footer call with viewport='both'.
|
|
213
|
+
* Fields set here take precedence over the top-level value for that specific viewport.
|
|
214
|
+
*/
|
|
215
|
+
export interface ViewportFooterOverrides {
|
|
216
|
+
display_style?: FooterDisplayStyle;
|
|
217
|
+
background_color?: string | null;
|
|
218
|
+
copyright_text_color?: string;
|
|
219
|
+
icon_color?: string;
|
|
220
|
+
is_logo_visible?: boolean;
|
|
221
|
+
logo_image_height?: string;
|
|
222
|
+
logo_image_width?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface UpdateFooterArguments {
|
|
226
|
+
copyright_text?: string;
|
|
227
|
+
copyright_text_font_family?: string;
|
|
228
|
+
social_links?: FooterSocialLinkItem[];
|
|
229
|
+
_replace_social_links?: boolean;
|
|
230
|
+
_remove_social_link_indices?: number[];
|
|
231
|
+
_reorder_social_links?: number[];
|
|
232
|
+
/** Desktop-only styling (display_style, background_color, icon_color, is_logo_visible, logo sizes). */
|
|
233
|
+
desktop?: ViewportFooterOverrides;
|
|
234
|
+
/** Mobile-only styling (display_style, background_color, icon_color, is_logo_visible, logo sizes). */
|
|
235
|
+
mobile?: ViewportFooterOverrides;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface TextStyleOptionStyle {
|
|
239
|
+
fontFamily?: string;
|
|
240
|
+
fontSize?: string;
|
|
241
|
+
letterSpacing?: string;
|
|
242
|
+
lineHeight?: string;
|
|
243
|
+
fontWeight?: string;
|
|
244
|
+
fontStyle?: string;
|
|
245
|
+
textDecoration?: string;
|
|
246
|
+
color?: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface UpdateGlobalStylesArguments {
|
|
250
|
+
backgroundStyles?: {
|
|
251
|
+
style?: { background?: string };
|
|
252
|
+
/** Site background color in hex → sets style.background */
|
|
253
|
+
backgroundColor?: string;
|
|
254
|
+
/** Background shape/accent color in hex → sets backgroundShapeStyle.background */
|
|
255
|
+
shapeColor?: string;
|
|
256
|
+
/** Background image URL ('' clears the image) → sets backgroundImageUrl */
|
|
257
|
+
backgroundImageUrl?: string;
|
|
258
|
+
/** Background shape SVG URL ('' clears shapes) → updates backgroundShapes[0].name. No-op if backgroundShapes is empty. */
|
|
259
|
+
backgroundShapeUrl?: string;
|
|
260
|
+
};
|
|
261
|
+
textStyles?: {
|
|
262
|
+
style?: { color?: string };
|
|
263
|
+
textFontFamily?: string;
|
|
264
|
+
textStyleOptions?: {
|
|
265
|
+
titles?: { style?: TextStyleOptionStyle; isModified?: boolean };
|
|
266
|
+
headings?: { style?: TextStyleOptionStyle; isModified?: boolean };
|
|
267
|
+
paragraphs?: { style?: TextStyleOptionStyle; isModified?: boolean };
|
|
268
|
+
buttons?: { style?: TextStyleOptionStyle; isModified?: boolean };
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
buttonStyles?: {
|
|
272
|
+
style?: { color?: string; borderColor?: string; backgroundColor?: string };
|
|
273
|
+
iconStyle?: { fill?: string };
|
|
274
|
+
selectedButtonStyleId?: string;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface UpdateHeaderNavRoute {
|
|
279
|
+
route_index?: number;
|
|
280
|
+
display_name?: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface ViewportHeaderOverrides {
|
|
284
|
+
display_style?: HeaderDisplayStyle;
|
|
285
|
+
background_color?: string | null;
|
|
286
|
+
is_logo_visible?: boolean;
|
|
287
|
+
logo_image_height?: string;
|
|
288
|
+
logo_image_width?: string;
|
|
289
|
+
nav_display_type?: NavigationDisplayType;
|
|
290
|
+
link_text_color?: string;
|
|
291
|
+
link_text_font?: string;
|
|
292
|
+
link_bg_color?: string | null;
|
|
293
|
+
link_default_border_color?: string | null;
|
|
294
|
+
link_selected_color?: string;
|
|
295
|
+
link_selected_bg_color?: string | null;
|
|
296
|
+
link_selected_border_color?: string;
|
|
297
|
+
hamburger_icon_color?: string;
|
|
298
|
+
hamburger_icon_bg_color?: string | null;
|
|
299
|
+
overlay_default_text_color?: string | null;
|
|
300
|
+
overlay_default_bg_color?: string | null;
|
|
301
|
+
overlay_selected_text_color?: string | null;
|
|
302
|
+
overlay_selected_bg_color?: string | null;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface UpdateHeaderArguments {
|
|
306
|
+
nav_routes?: UpdateHeaderNavRoute[];
|
|
307
|
+
desktop?: ViewportHeaderOverrides;
|
|
308
|
+
mobile?: ViewportHeaderOverrides;
|
|
309
|
+
}
|
|
310
|
+
|
|
159
311
|
export const parseToolCalls = (
|
|
160
312
|
toolCalls: AiAssistantToolCall[],
|
|
161
313
|
): ParsedToolCall[] => {
|