@designcrowd/library.brand-page 5.19.1-error-html2canvas-3 → 5.19.1-id-based-items-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.
- package/lib/src/{CreatedOnBrandCrowd-de-de-BPP1Wtpt.js → CreatedOnBrandCrowd-de-de-0PcGqy0N.js} +3 -3
- package/lib/src/{CreatedOnBrandCrowd-en-us-BlfpQiIg.js → CreatedOnBrandCrowd-en-us-DB8wcFMI.js} +3 -3
- package/lib/src/{CreatedOnBrandCrowd-es-es-Tldy_pIo.js → CreatedOnBrandCrowd-es-es-DVWQ243C.js} +3 -3
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CHmb3VQE.js → CreatedOnBrandCrowd-fr-ca-D-M_L0Du.js} +3 -3
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CHmb3VQE.js → CreatedOnBrandCrowd-fr-fr-D-M_L0Du.js} +3 -3
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-XbU3eK3Z.js → CreatedOnBrandCrowd-pt-br-CNpzknxU.js} +3 -3
- package/lib/src/{CreatedOnBrandCrowd-pt-br-XbU3eK3Z.js → CreatedOnBrandCrowd-pt-pt-CNpzknxU.js} +3 -3
- package/lib/src/{CreatedOnDcom-de-de-BVMFbVbI.js → CreatedOnDcom-de-de-DMJoD5wE.js} +3 -3
- package/lib/src/{CreatedOnDcom-en-us--kaKb1kI.js → CreatedOnDcom-en-us-B-F3Pmjv.js} +3 -3
- package/lib/src/{CreatedOnDcom-es-es-XXVLpF2I.js → CreatedOnDcom-es-es-DmLk-cA2.js} +3 -3
- package/lib/src/{CreatedOnDcom-fr-ca-D-7vtMZ5.js → CreatedOnDcom-fr-ca-ntnsCzvA.js} +3 -3
- package/lib/src/{CreatedOnDcom-fr-fr-CM9oQk77.js → CreatedOnDcom-fr-fr-DFcO0gHL.js} +3 -3
- package/lib/src/{CreatedOnDcom-pt-br-VVgu3BEa.js → CreatedOnDcom-pt-br-CtuJoVXW.js} +3 -3
- package/lib/src/{CreatedOnDcom-pt-pt-CWhA8Vla.js → CreatedOnDcom-pt-pt-B7shZVVn.js} +3 -3
- package/lib/src/brand-page/clients/brand-page.client.d.ts +9 -9
- package/lib/src/brand-page/components/image-gallery/masonry/MasonryGallery.mixin.d.ts +2 -1
- package/lib/src/brand-page/components/navigation/hamburger/HamburgerNavigation.mixin.d.ts +2 -4
- package/lib/src/brand-page/components/navigation/hamburger/HamburgerNavigation.mixin.js +0 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +2 -4
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +4 -5
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +1 -1
- package/lib/src/brand-page/components/page/PageComponent.mixin.d.ts +1 -1
- package/lib/src/brand-page/components/payment/Payment.mixin.d.ts +3 -3
- package/lib/src/brand-page/components/payment/__fixtures__/request-payment.d.ts +13 -13
- package/lib/src/brand-page/components/payment/__fixtures__/support-me.d.ts +13 -13
- package/lib/src/brand-page/constants/sections/footer-display.constants.js +1 -1
- package/lib/src/brand-page/models/index.d.ts +13 -2
- package/lib/src/brand-page/models/index.js +0 -3
- package/lib/src/brand-page/models/payment.model.d.ts +1 -1
- package/lib/src/brand-page/utils/personalisation.util.js +14 -72
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +19 -21
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +10 -16
- package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +3 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +170 -181
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +0 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +0 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +12 -12
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.stories.js +2 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-payment.js +7 -0
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +149 -148
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +21 -21
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.js +1 -1
- package/lib/src/brand-page-maker/components/color-picker/components/ColorModeSelect.mixin.d.ts +2 -4
- package/lib/src/brand-page-maker/components/color-picker/components/ColorModeSelect.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/color-picker/components/GradientColorSlider.mixin.d.ts +2 -4
- package/lib/src/brand-page-maker/components/color-picker/components/GradientColorSlider.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/color-picker/components/GradientColorSliderHandler.mixin.d.ts +2 -5
- package/lib/src/brand-page-maker/components/color-picker/components/GradientColorSliderHandler.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/color-picker/components/GradientTypeSelector.mixin.d.ts +2 -4
- package/lib/src/brand-page-maker/components/color-picker/components/GradientTypeSelector.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/device/Device.mixin.d.ts +2 -4
- package/lib/src/brand-page-maker/components/device/Device.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +2 -4
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +3 -3
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +11 -11
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +25 -27
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +27 -27
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.js +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +12 -17
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +12 -12
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +32 -30
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +5 -16
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +11 -11
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +6 -6
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +2 -2
- package/lib/src/brand-page-maker/constants/config-settings-constant.d.ts +6 -6
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -1
- package/lib/src/brand-page-maker/convertors/text-image-display-style.convertor.d.ts +1 -1
- package/lib/src/brand-page-maker/convertors/text-image-display-style.convertor.js +1 -1
- package/lib/src/brand-page-maker/models/content-settings.d.ts +1 -1
- package/lib/src/brand-page-maker/models/navigation-style-configs.js +1 -1
- package/lib/src/brand-page-maker/routing/brand-page-maker-router.d.ts +2 -1
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +378 -366
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +4 -5
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +5 -8
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +1 -3
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +3 -7
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +15 -15
- package/lib/src/brand-page-maker/stores/ui/ui-store.d.ts +0 -6
- package/lib/src/brand-page-maker/stores/ui/ui-store.js +0 -8
- package/lib/src/brand-page-maker/utils/content-settings.util.js +1 -1
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +1 -1
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +4 -4
- package/lib/src/clients/brand-page-client.d.ts +15 -16
- package/lib/src/clients/design-template-client.d.ts +0 -3
- package/lib/src/clients/media-client.d.ts +2 -2
- package/lib/src/clients/models.d.ts +0 -2
- package/lib/src/composables/useSnapshot.js +18 -18
- package/lib/src/css/library.brand-page-brandCrowd.min.css +324 -342
- package/lib/src/css/library.brand-page-brandPage.min.css +324 -620
- package/lib/src/css/library.brand-page-designCom.min.css +324 -342
- package/lib/src/css/library.brand-page-preview.min.css +324 -598
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.mjs +15 -16
- package/lib/src/{lib-yEV1yYI5.js → lib-BQmJBVbS.js} +33221 -36445
- package/lib/src/lib.js +1 -1
- package/lib/src/metadata-builder/builders/footer-builder.js +62 -105
- package/lib/src/metadata-builder/builders/item-id-utils.d.ts +41 -0
- package/lib/src/metadata-builder/builders/item-id-utils.js +68 -0
- package/lib/src/metadata-builder/builders/section-builders/image-gallery-builder.js +57 -68
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +58 -93
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +66 -99
- package/lib/src/metadata-builder/builders/section-builders/social-links-builder.js +57 -17
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +51 -85
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +49 -74
- package/lib/src/metadata-builder/builders/section-field-utils.d.ts +0 -7
- package/lib/src/metadata-builder/builders/section-field-utils.js +1 -1
- package/lib/src/metadata-builder/builders/shape-color-utils.js +1 -1
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +16 -7
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +66 -48
- package/lib/src/plugins/google-maps-plugin/google-maps-plugin.d.ts +1 -1
- package/lib/src/plugins/google-maps-plugin/google-maps-plugin.js +8 -8
- package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +13 -13
- package/lib/src/shared/background-settings/store/background-settings-store.d.ts +3 -3
- package/lib/src/shared/color-picker/components/ColorPicker.mixin.d.ts +2 -4
- package/lib/src/shared/color-picker/components/ColorPicker.mixin.js +2 -2
- package/lib/src/shared/color-picker/components/ColorPickerSwatch.mixin.d.ts +2 -4
- package/lib/src/shared/color-picker/components/ColorPickerSwatch.mixin.js +0 -1
- package/lib/src/shared/confirm-modal/ConfirmModal.mixin.d.ts +2 -5
- package/lib/src/shared/confirm-modal/ConfirmModal.mixin.js +0 -1
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +129 -131
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +1 -2
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +110 -111
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +81 -84
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.js +0 -5
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +109 -117
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +14 -1
- package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +70 -72
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +3 -4
- package/lib/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.d.ts +4 -4
- package/lib/src/shared/content-settings/components/icon-library/IconLibrary.mixin.d.ts +1 -3
- package/lib/src/shared/content-settings/components/icon-library/IconLibrary.mixin.js +0 -1
- package/lib/src/shared/content-settings/components/images-field/ImagesField.mixin.d.ts +2 -2
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.d.ts +3 -4
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.js +1 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +40 -40
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigOptionField.mixin.d.ts +6 -5
- package/lib/src/shared/content-settings/components/shape-field/ShapeField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/slider-field/SliderField.mixin.d.ts +2 -2
- package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.mixin.d.ts +2 -1
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.d.ts +2 -1
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +1 -1
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +28 -28
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/toggle-field/ToggleField.mixin.d.ts +2 -2
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +39 -39
- package/lib/src/shared/content-settings/utils.js +1 -0
- package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.d.ts +4 -6
- package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.js +0 -1
- package/lib/src/shared/image-gallery-style-settings/ImageGalleryStyleSettings.mixin.d.ts +2 -4
- package/lib/src/shared/image-gallery-style-settings/ImageGalleryStyleSettings.mixin.js +0 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +21 -29
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +1 -1
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +51 -50
- package/lib/src/shared/logo-settings/components/LogoSettingsHeader.mixin.d.ts +4 -6
- package/lib/src/shared/logo-settings/components/LogoSettingsHeader.mixin.js +0 -1
- package/lib/src/shared/logo-settings/store/editable-logo-store.js +1 -1
- package/lib/src/shared/logo-settings/store/logo-settings-store.d.ts +1 -1
- package/lib/src/shared/logo-versions/LogoVersions.mixin.d.ts +5 -13
- package/lib/src/shared/logo-versions/LogoVersions.mixin.js +0 -1
- package/lib/src/shared/models.d.ts +0 -2
- package/lib/src/shared/my-designs/MyDesigns.mixin.d.ts +6 -14
- package/lib/src/shared/my-designs/MyDesigns.mixin.js +0 -1
- package/lib/src/shared/my-uploads/MyMedia.mixin.d.ts +5 -14
- package/lib/src/shared/my-uploads/MyMedia.mixin.js +0 -1
- package/lib/src/shared/my-uploads/MyUploads.mixin.d.ts +5 -14
- package/lib/src/shared/my-uploads/MyUploads.mixin.js +0 -1
- package/lib/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.d.ts +3 -5
- package/lib/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.js +0 -1
- package/lib/src/shared/navigation-style-settings/store/index.d.ts +2 -2
- package/lib/src/shared/page-navigation/store/page-navigation-store.d.ts +2 -2
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +28 -27
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.js +2 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +179 -188
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +177 -181
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +1 -1
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +9 -9
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +39 -39
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.js +1 -0
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +18 -18
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +6 -6
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +60 -66
- package/lib/src/shared/style-settings/store/style-settings-store.d.ts +1 -1
- package/lib/src/shared/style-settings/store/style-settings-store.js +1 -1
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +450 -20
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.js +2 -2
- package/lib/src/shared/template-settings/models.d.ts +0 -1
- package/lib/src/shared/template-settings/store/template-settings-store.d.ts +0 -4
- package/lib/src/shared/template-settings/store/template-settings-store.js +11 -79
- package/lib/src/shared/unsplash-library/UnsplashLibrary.mixin.d.ts +4 -9
- package/package.json +57 -61
- package/src/brand-page/components/about-section/AboutSection.vue.test.ts +5 -7
- package/src/brand-page/components/brand-page-footer/BrandPageFooter.vue +1 -1
- package/src/brand-page/components/image/Image.mixin.ts +1 -1
- package/src/brand-page/components/image/Image.test.ts +1 -1
- package/src/brand-page/components/image-gallery/masonry/MasonryGallery.mixin.ts +2 -1
- package/src/brand-page/components/images-section/ImagesSection.vue +1 -0
- package/src/brand-page/components/logo/LogoRender.vue +188 -188
- package/src/brand-page/components/navigation/hamburger/HamburgerNavigation.mixin.ts +0 -1
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +6 -15
- package/src/brand-page/components/page-footer/PageFooter.vue +0 -1
- package/src/brand-page/components/page-header/HeaderLayout.vue +6 -12
- package/src/brand-page/components/page-header/PageHeader.vue +0 -1
- package/src/brand-page/components/shapes-section/ShapesSection.vue +1 -1
- package/src/brand-page/components/shop/CartModal.vue +3 -1
- package/src/brand-page/components/shop/FeaturedDisplay.vue +2 -2
- package/src/brand-page/components/shop/PaymentModal.vue +5 -1
- package/src/brand-page/components/shop/ProductDetailModal.vue +1 -1
- package/src/brand-page/components/shop/Shop.vue +1 -1
- package/src/brand-page/components/shop/TextDisplay.vue +1 -1
- package/src/brand-page/components/shop/ThumbnailDisplay.vue +2 -2
- package/src/brand-page/components/testimonial-section/TestimonialSection.vue +3 -3
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +1 -3
- package/src/brand-page/constants/sections/footer-display.constants.ts +1 -1
- package/src/brand-page/models/index.ts +12 -4
- package/src/brand-page/models/payment.model.ts +1 -2
- package/src/brand-page/models/shop.model.ts +2 -0
- package/src/brand-page/models/user-personalisation.model.ts +2 -1
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +0 -3
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +0 -1
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +0 -2
- package/src/brand-page/utils/migration/migration-01_1.ts +1 -1
- package/src/brand-page/utils/migration/migration-02.ts +1 -0
- package/src/brand-page/utils/migration/migration-03.ts +1 -0
- package/src/brand-page/utils/migration/migration-04.ts +1 -0
- package/src/brand-page/utils/migration/migration-05.ts +5 -1
- package/src/brand-page/utils/migration/migration-05_2.ts +1 -1
- package/src/brand-page/utils/migration/migration-08.test.ts +1 -1
- package/src/brand-page/utils/personalisation.util.test.ts +0 -35
- package/src/brand-page/utils/personalisation.util.ts +23 -119
- package/src/brand-page/view-models.ts +56 -38
- package/src/brand-page-maker/assessors/banner-section-description-visibility.assessor.ts +6 -6
- package/src/brand-page-maker/assessors/color-replacement-icon-visibility.assessor.ts +2 -2
- package/src/brand-page-maker/assessors/color-replacement-profile-visibility.assessor.ts +2 -2
- package/src/brand-page-maker/assessors/color-replacement-visibility.assessor.ts +2 -2
- package/src/brand-page-maker/assessors/contact-form-visibility.assessor.ts +14 -14
- package/src/brand-page-maker/components/action-bar/ActionBar.mixin.ts +0 -1
- package/src/brand-page-maker/components/ai-text-edit/TextBubble.vue +0 -1
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +1 -5
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +0 -1
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.stories.ts +5 -2
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +5 -0
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-payment.ts +8 -0
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-site-template.examples.ts +2 -0
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.vue +0 -1
- package/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.ts +1 -1
- package/src/brand-page-maker/components/color-palette/BpColorPalette.vue +2 -1
- package/src/brand-page-maker/components/color-picker/components/ColorModeSelect.mixin.ts +0 -1
- package/src/brand-page-maker/components/color-picker/components/GradientColorSlider.mixin.ts +0 -1
- package/src/brand-page-maker/components/color-picker/components/GradientColorSliderHandler.mixin.ts +0 -1
- package/src/brand-page-maker/components/color-picker/components/GradientTypeSelector.mixin.ts +0 -1
- package/src/brand-page-maker/components/device/Device.mixin.ts +0 -1
- package/src/brand-page-maker/components/navigation/Navigation.mixin.ts +0 -1
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +1 -3
- package/src/brand-page-maker/components/sensitive-content/SensitiveContent.vue +4 -1
- package/src/brand-page-maker/components/seo-settings/DeleteDomainModal.vue +1 -1
- package/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.ts +0 -1
- package/src/brand-page-maker/components/seo-settings/SeoPageSettings.vue +1 -1
- package/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.ts +1 -0
- package/src/brand-page-maker/components/seo-settings/UrlSettings.vue +1 -0
- package/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.vue +5 -1
- package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +1 -1
- package/src/brand-page-maker/components/shop/ReplaceImageSettingsForShop.vue +1 -1
- package/src/brand-page-maker/components/social-share/SocialShare.vue +1 -1
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +8 -22
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +10 -5
- package/src/brand-page-maker/components/video-play/VideoPlayButton.vue +1 -1
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +6 -6
- package/src/brand-page-maker/constants/config-settings-constant.ts +3 -3
- package/src/brand-page-maker/convertors/text-image-display-style.convertor.ts +1 -1
- package/src/brand-page-maker/models/button-styles-config.ts +2 -4
- package/src/brand-page-maker/models/content-settings-configs.ts +2 -4
- package/src/brand-page-maker/models/navigation-style-configs.ts +6 -5
- package/src/brand-page-maker/stores/admin-logo-settings/admin-logo-settings-store.ts +1 -0
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +5 -8
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +3 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +4 -12
- package/src/brand-page-maker/stores/ui/ui-store.ts +0 -16
- package/src/brand-page-maker/utils/content-settings.util.ts +1 -1
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +4 -4
- package/src/clients/design-template-client.ts +0 -3
- package/src/clients/models.ts +0 -2
- package/src/composables/useSnapshot.ts +22 -19
- package/src/lib.ts +0 -1
- package/src/metadata-builder/builders/footer-builder.test.ts +229 -130
- package/src/metadata-builder/builders/footer-builder.ts +90 -155
- package/src/metadata-builder/builders/item-id-utils.test.ts +118 -0
- package/src/metadata-builder/builders/item-id-utils.ts +85 -0
- package/src/metadata-builder/builders/section-builders/image-gallery-builder.ts +62 -88
- package/src/metadata-builder/builders/section-builders/images-section-builder.ts +66 -129
- package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +105 -160
- package/src/metadata-builder/builders/section-builders/social-links-builder.ts +65 -20
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +83 -146
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +70 -122
- package/src/metadata-builder/builders/section-field-utils.ts +1 -1
- package/src/metadata-builder/builders/shape-color-utils.ts +2 -2
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +16 -7
- package/src/metadata-builder/parsers/section-tool-arguments.ts +66 -48
- package/src/plugins/google-maps-plugin/google-maps-plugin.ts +8 -8
- package/src/shared/background-settings/components/BackgroundSettings.vue +1 -1
- package/src/shared/background-settings/components/background-color/BackgroundColorSettings.vue +1 -1
- package/src/shared/color-picker/components/ColorPicker.mixin.ts +7 -2
- package/src/shared/color-picker/components/ColorPickerSwatch.mixin.ts +0 -1
- package/src/shared/common/NumberInput.vue +0 -1
- package/src/shared/common/SideBarSettingsHeader.vue +2 -2
- package/src/shared/confirm-modal/ConfirmModal.mixin.ts +0 -1
- package/src/shared/content-settings/components/booking-url-field/BookingUrlField.vue +0 -1
- package/src/shared/content-settings/components/button-configuration-field/ButtonConfigurationField.vue +0 -1
- package/src/shared/content-settings/components/color-field/ColorField.vue +10 -3
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +1 -1
- package/src/shared/content-settings/components/content-settings/ContentSettingsLockedButton.vue +0 -1
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.ts +0 -5
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +14 -1
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +6 -4
- package/src/shared/content-settings/components/icon-library/IconLibrary.mixin.ts +0 -1
- package/src/shared/content-settings/components/items-field/ItemsField.mixin.ts +1 -1
- package/src/shared/content-settings/components/logo-selection-field/LogoSelectionField.vue +1 -1
- package/src/shared/content-settings/components/logo-size-field/LogoSizeSliderField.vue +1 -1
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +1 -1
- package/src/shared/content-settings/components/personalisation-role-field/PersonalisationRoleField.vue +4 -4
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +8 -2
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +1 -1
- package/src/shared/content-settings/models.ts +2 -3
- package/src/shared/content-settings/utils.ts +1 -0
- package/src/shared/dropzone-image-uploader/components/DropzoneImageUploader.vue +0 -1
- package/src/shared/ecommerce-settings/store/cart-store.test.ts +1 -1
- package/src/shared/font-family-selector/FontFamilySelector.mixin.ts +0 -1
- package/src/shared/image-gallery-style-settings/ImageGalleryStyleSettings.mixin.ts +0 -1
- package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +1 -1
- package/src/shared/logo-settings/components/LogoSettings.mixin.ts +1 -0
- package/src/shared/logo-settings/components/LogoSettingsHeader.mixin.ts +0 -1
- package/src/shared/logo-settings/components/LogoStyleSettingsWithState.vue +2 -2
- package/src/shared/logo-settings/components/LogoTemplateSearch.vue +1 -1
- package/src/shared/logo-settings/store/editable-logo-store.ts +1 -1
- package/src/shared/logo-settings/store/logo-settings-store.test.ts +4 -4
- package/src/shared/logo-versions/LogoVersions.mixin.ts +0 -1
- package/src/shared/models.ts +0 -6
- package/src/shared/my-designs/MyDesigns.mixin.ts +0 -1
- package/src/shared/my-uploads/MyMedia.mixin.ts +0 -1
- package/src/shared/my-uploads/MyMediaSelectionItem.vue +1 -2
- package/src/shared/my-uploads/MyUploads.mixin.ts +0 -1
- package/src/shared/my-uploads/models.ts +2 -1
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.ts +0 -1
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +1 -1
- package/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.ts +3 -0
- package/src/shared/page-settings/components/page-settings/NestedDraggable.vue +1 -1
- package/src/shared/page-settings/components/page-settings/PageSettings.vue +2 -1
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.vue +1 -1
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +1 -1
- package/src/shared/page-settings/store/page-settings-store.test.ts +8 -4
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.ts +1 -0
- package/src/shared/shape-library/ShapeLibrary.vue +2 -2
- package/src/shared/style-settings/store/style-settings-store.ts +1 -1
- package/src/shared/template-settings/components/TemplatesSettings.mixin.ts +2 -2
- package/src/shared/template-settings/models.ts +0 -1
- package/src/shared/template-settings/store/template-settings-store.ts +18 -105
- package/src/shared/unsplash-library/UnsplashLibrary.vue +6 -2
- package/src/shared/video-library/VideoLibrary.vue +1 -1
- package/lib/src/brand-page/components/banner-section/BannerSection.mixin.d.ts +0 -103
- package/lib/src/brand-page/components/banner-section/BannerSection.mixin.js +0 -178
- package/src/brand-page/components/banner-section/BannerSection.mixin.ts +0 -210
- package/src/brand-page-maker/components/template-preview/TemplatePreviewAiBadge.vue +0 -12
|
@@ -10,22 +10,17 @@ import {
|
|
|
10
10
|
import type {
|
|
11
11
|
UpdateFooterArguments,
|
|
12
12
|
ViewportFooterOverrides,
|
|
13
|
-
FooterSocialLinkItem,
|
|
14
13
|
} from '../parsers/ai-toolcall-parser';
|
|
15
14
|
import type { Logger } from '../logger';
|
|
16
|
-
import type {
|
|
17
|
-
TextStyleDeclaration,
|
|
18
|
-
TextStyleOptions,
|
|
19
|
-
} from '../../brand-page/models/styles.model';
|
|
15
|
+
import type { TextStyleOptions } from '../../brand-page/models/styles.model';
|
|
20
16
|
import { FOOTER_CHECKS } from './section-rules/footer.rules';
|
|
17
|
+
import { applyDetachedStyleOverride } from './section-field-utils';
|
|
21
18
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
AbstractPageFooterStyles['socialLinks']
|
|
28
|
-
>[number];
|
|
19
|
+
ensureItemIds,
|
|
20
|
+
generateItemId,
|
|
21
|
+
removeItemsByIds,
|
|
22
|
+
repositionItemByAnchor,
|
|
23
|
+
} from './item-id-utils';
|
|
29
24
|
|
|
30
25
|
const normaliseSocialUrl = (url: string): string => {
|
|
31
26
|
for (const prefix of ['mailto:', 'tel:']) {
|
|
@@ -35,113 +30,6 @@ const normaliseSocialUrl = (url: string): string => {
|
|
|
35
30
|
return url;
|
|
36
31
|
};
|
|
37
32
|
|
|
38
|
-
const makeSocialLink = (
|
|
39
|
-
icon: string | undefined,
|
|
40
|
-
url: string | undefined,
|
|
41
|
-
): FooterSocialLink =>
|
|
42
|
-
({
|
|
43
|
-
imageUrl: icon || '',
|
|
44
|
-
url: normaliseSocialUrl(url || ''),
|
|
45
|
-
imageTitle: '',
|
|
46
|
-
width: 0,
|
|
47
|
-
height: 0,
|
|
48
|
-
imageLink: '',
|
|
49
|
-
}) as FooterSocialLink;
|
|
50
|
-
|
|
51
|
-
const hasSocialLinkMutation = (args: UpdateFooterArguments): boolean =>
|
|
52
|
-
args._replace_social_links === true ||
|
|
53
|
-
(args._remove_social_link_indices?.length ?? 0) > 0 ||
|
|
54
|
-
(args._reorder_social_links?.length ?? 0) > 0 ||
|
|
55
|
-
(args.social_links?.length ?? 0) > 0;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Social links are a GLOBAL footer concern — one logical list that both
|
|
59
|
-
* viewports render identically. Derive the new list ONCE from the current one
|
|
60
|
-
* WITHOUT mutating the input, so the caller can assign an independent copy to
|
|
61
|
-
* each viewport.
|
|
62
|
-
*
|
|
63
|
-
* Why this can't mutate per-viewport in place: footers migrated from the legacy
|
|
64
|
-
* single `footerStyles` model (migration-01) share ONE `socialLinks` array
|
|
65
|
-
* reference across pageFooterDesktop and pageFooterMobile, and `cloneDeep`
|
|
66
|
-
* preserves that shared reference. Running an in-place `splice` once per
|
|
67
|
-
* viewport therefore applies it TWICE to the same array — e.g. one requested
|
|
68
|
-
* removal index drops two links. Compute-once + assign-fresh is correct for
|
|
69
|
-
* both shared (legacy) and independent (new-model) footers.
|
|
70
|
-
*/
|
|
71
|
-
const computeSocialLinks = (
|
|
72
|
-
current: FooterSocialLink[] | undefined,
|
|
73
|
-
args: UpdateFooterArguments,
|
|
74
|
-
): FooterSocialLink[] => {
|
|
75
|
-
// _replace_social_links: replace entire list (empty/absent social_links = clear all).
|
|
76
|
-
// A replacement supersedes every other social link mutation.
|
|
77
|
-
if (args._replace_social_links) {
|
|
78
|
-
return (args.social_links ?? []).map((l) =>
|
|
79
|
-
makeSocialLink(l.social_link_icon, l.url),
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const links: FooterSocialLink[] = [...(current ?? [])];
|
|
84
|
-
|
|
85
|
-
// item_index-based updates for existing links — replace the item reference
|
|
86
|
-
// (never mutate the original object, which may be shared across viewports).
|
|
87
|
-
for (const link of args.social_links ?? []) {
|
|
88
|
-
if (link.item_index === undefined) continue;
|
|
89
|
-
|
|
90
|
-
const existing = links[link.item_index];
|
|
91
|
-
|
|
92
|
-
if (!existing) continue;
|
|
93
|
-
|
|
94
|
-
links[link.item_index] = {
|
|
95
|
-
...existing,
|
|
96
|
-
...(link.social_link_icon !== undefined
|
|
97
|
-
? { imageUrl: link.social_link_icon }
|
|
98
|
-
: {}),
|
|
99
|
-
...(link.url !== undefined ? { url: normaliseSocialUrl(link.url) } : {}),
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Remove by index (descending order to preserve indices during splice).
|
|
104
|
-
if (args._remove_social_link_indices?.length) {
|
|
105
|
-
const sorted = [...args._remove_social_link_indices].sort((a, b) => b - a);
|
|
106
|
-
|
|
107
|
-
for (const idx of sorted) {
|
|
108
|
-
if (idx >= 0 && idx < links.length) links.splice(idx, 1);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Insert new links (descending insert_at order to preserve positions).
|
|
113
|
-
const insertLinks = (args.social_links ?? []).filter(
|
|
114
|
-
(l): l is FooterSocialLinkItem & { insert_at: number } =>
|
|
115
|
-
l.insert_at !== undefined && l.item_index === undefined,
|
|
116
|
-
);
|
|
117
|
-
const sortedInserts = [...insertLinks].sort(
|
|
118
|
-
(a, b) => b.insert_at - a.insert_at,
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
for (const link of sortedInserts) {
|
|
122
|
-
const pos = Math.max(0, Math.min(link.insert_at, links.length));
|
|
123
|
-
|
|
124
|
-
links.splice(pos, 0, makeSocialLink(link.social_link_icon, link.url));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Reorder (requires ALL indices — partial reorder is not supported).
|
|
128
|
-
if (args._reorder_social_links?.length) {
|
|
129
|
-
const newOrder = args._reorder_social_links;
|
|
130
|
-
const unique = new Set(newOrder);
|
|
131
|
-
|
|
132
|
-
if (
|
|
133
|
-
unique.size === newOrder.length &&
|
|
134
|
-
newOrder.every((idx) => idx >= 0 && idx < links.length)
|
|
135
|
-
) {
|
|
136
|
-
const reordered = newOrder.map((idx) => links[idx]);
|
|
137
|
-
|
|
138
|
-
if (reordered.length === links.length) return reordered;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return links;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
33
|
const applyGlobalFooterChanges = (
|
|
146
34
|
footer: AbstractPageFooterStyles,
|
|
147
35
|
args: UpdateFooterArguments,
|
|
@@ -150,27 +38,85 @@ const applyGlobalFooterChanges = (
|
|
|
150
38
|
if (args.copyright_text !== undefined)
|
|
151
39
|
footer.copyrightText = args.copyright_text;
|
|
152
40
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const updates: Partial<TextStyleDeclaration> = {};
|
|
41
|
+
if (args.copyright_text_font_family !== undefined)
|
|
42
|
+
footer.copyrightStyle = applyDetachedStyleOverride(
|
|
43
|
+
footer.copyrightStyle,
|
|
44
|
+
{ fontFamily: args.copyright_text_font_family },
|
|
45
|
+
textStyleOptions,
|
|
46
|
+
);
|
|
160
47
|
|
|
161
|
-
|
|
162
|
-
const normalized = normalizeStyleValue(key, value);
|
|
48
|
+
const links = args.social_links;
|
|
163
49
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
50
|
+
// _replace_social_links: replace entire list (empty/absent social_links = clear all).
|
|
51
|
+
// When replacing, all other social link mutations (remove, insert, reorder) are skipped —
|
|
52
|
+
// they are superseded by the replacement and running them would cause duplicates.
|
|
53
|
+
if (args._replace_social_links) {
|
|
54
|
+
footer.socialLinks = (links ?? []).map((l) => ({
|
|
55
|
+
id: generateItemId(),
|
|
56
|
+
imageUrl: l.social_link_icon || '',
|
|
57
|
+
url: normaliseSocialUrl(l.url || ''),
|
|
58
|
+
imageTitle: '',
|
|
59
|
+
width: 0,
|
|
60
|
+
height: 0,
|
|
61
|
+
imageLink: '',
|
|
62
|
+
}));
|
|
63
|
+
} else {
|
|
64
|
+
// Targeted mutations — only run when NOT replacing the entire list.
|
|
65
|
+
// BP-5603: id-based contract (item_id / move_before_item_id / _remove_social_link_ids).
|
|
66
|
+
// Backfill ids on legacy links so they become referenceable after this call.
|
|
67
|
+
ensureItemIds(footer.socialLinks);
|
|
68
|
+
|
|
69
|
+
// Remove by id (order-independent — no index shifting needed).
|
|
70
|
+
footer.socialLinks = removeItemsByIds(
|
|
71
|
+
footer.socialLinks,
|
|
72
|
+
args._remove_social_link_ids,
|
|
73
|
+
);
|
|
167
74
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
75
|
+
// Update existing links (item_id present) or insert new links (no item_id).
|
|
76
|
+
if (links?.length) {
|
|
77
|
+
footer.socialLinks = footer.socialLinks ?? [];
|
|
78
|
+
|
|
79
|
+
for (const link of links) {
|
|
80
|
+
if (link.item_id) {
|
|
81
|
+
// Update existing link in place; reposition if move_before_item_id set.
|
|
82
|
+
const existing = footer.socialLinks.find(
|
|
83
|
+
(l) => l.id === link.item_id,
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// Unknown id — skip rather than guess at a position.
|
|
87
|
+
if (!existing) continue;
|
|
88
|
+
|
|
89
|
+
if (link.social_link_icon !== undefined)
|
|
90
|
+
existing.imageUrl = link.social_link_icon;
|
|
91
|
+
|
|
92
|
+
if (link.url !== undefined)
|
|
93
|
+
existing.url = normaliseSocialUrl(link.url);
|
|
94
|
+
|
|
95
|
+
repositionItemByAnchor(
|
|
96
|
+
footer.socialLinks,
|
|
97
|
+
existing,
|
|
98
|
+
link.move_before_item_id,
|
|
99
|
+
);
|
|
100
|
+
} else {
|
|
101
|
+
// New link — assign a stable id and position via move_before_item_id.
|
|
102
|
+
const newLink = {
|
|
103
|
+
id: generateItemId(),
|
|
104
|
+
imageUrl: link.social_link_icon || '',
|
|
105
|
+
url: normaliseSocialUrl(link.url || ''),
|
|
106
|
+
imageTitle: '',
|
|
107
|
+
width: 0,
|
|
108
|
+
height: 0,
|
|
109
|
+
imageLink: '' as string | false,
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
repositionItemByAnchor(
|
|
113
|
+
footer.socialLinks,
|
|
114
|
+
newLink,
|
|
115
|
+
link.move_before_item_id,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
174
120
|
}
|
|
175
121
|
};
|
|
176
122
|
|
|
@@ -195,6 +141,12 @@ const applyViewportFooterChanges = (
|
|
|
195
141
|
fill: overrides.icon_color,
|
|
196
142
|
};
|
|
197
143
|
|
|
144
|
+
if (overrides.copyright_text_color !== undefined)
|
|
145
|
+
footer.copyrightStyle = {
|
|
146
|
+
...footer.copyrightStyle,
|
|
147
|
+
color: overrides.copyright_text_color,
|
|
148
|
+
};
|
|
149
|
+
|
|
198
150
|
if (overrides.is_logo_visible !== undefined)
|
|
199
151
|
footer.isLogoVisible = overrides.is_logo_visible;
|
|
200
152
|
|
|
@@ -246,30 +198,13 @@ export class FooterBuilder extends BaseMetadataBuilder<UpdateFooterArguments> {
|
|
|
246
198
|
const args = this.request.payload ?? {};
|
|
247
199
|
const textStyleOptions = model.styles?.textStyles?.textStyleOptions;
|
|
248
200
|
|
|
249
|
-
// Global
|
|
250
|
-
// viewports. These are idempotent assignments, safe to run per-viewport.
|
|
201
|
+
// Global fields (copyright_text, social links) always apply to both viewports.
|
|
251
202
|
if (model.pageFooterDesktop)
|
|
252
203
|
applyGlobalFooterChanges(model.pageFooterDesktop, args, textStyleOptions);
|
|
253
204
|
|
|
254
205
|
if (model.pageFooterMobile)
|
|
255
206
|
applyGlobalFooterChanges(model.pageFooterMobile, args, textStyleOptions);
|
|
256
207
|
|
|
257
|
-
// Social links are a single global list. Derive the new list ONCE, then
|
|
258
|
-
// assign an INDEPENDENT copy to each viewport — never mutate a (possibly
|
|
259
|
-
// shared) viewport array in place. See computeSocialLinks.
|
|
260
|
-
if (hasSocialLinkMutation(args)) {
|
|
261
|
-
const current =
|
|
262
|
-
model.pageFooterDesktop?.socialLinks ??
|
|
263
|
-
model.pageFooterMobile?.socialLinks;
|
|
264
|
-
const updated = computeSocialLinks(current, args);
|
|
265
|
-
|
|
266
|
-
if (model.pageFooterDesktop)
|
|
267
|
-
model.pageFooterDesktop.socialLinks = updated.map((l) => ({ ...l }));
|
|
268
|
-
|
|
269
|
-
if (model.pageFooterMobile)
|
|
270
|
-
model.pageFooterMobile.socialLinks = updated.map((l) => ({ ...l }));
|
|
271
|
-
}
|
|
272
|
-
|
|
273
208
|
// Viewport-specific styling via explicit sub-objects.
|
|
274
209
|
if (args.desktop && model.pageFooterDesktop)
|
|
275
210
|
applyViewportFooterChanges(model.pageFooterDesktop, args.desktop);
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
END_ITEM_ANCHOR,
|
|
4
|
+
ensureItemIds,
|
|
5
|
+
generateItemId,
|
|
6
|
+
removeItemsByIds,
|
|
7
|
+
repositionItemByAnchor,
|
|
8
|
+
} from './item-id-utils';
|
|
9
|
+
|
|
10
|
+
type Item = { id?: string; label: string };
|
|
11
|
+
|
|
12
|
+
const items = (...labels: string[]): Item[] =>
|
|
13
|
+
labels.map((label) => ({ id: label, label }));
|
|
14
|
+
|
|
15
|
+
const labels = (list: Item[]): string[] => list.map((i) => i.label);
|
|
16
|
+
|
|
17
|
+
describe('generateItemId', () => {
|
|
18
|
+
it('returns unique uuid-shaped ids', () => {
|
|
19
|
+
const a = generateItemId();
|
|
20
|
+
const b = generateItemId();
|
|
21
|
+
|
|
22
|
+
expect(a).not.toBe(b);
|
|
23
|
+
expect(a).toMatch(
|
|
24
|
+
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('ensureItemIds', () => {
|
|
30
|
+
it('backfills only the items missing an id, preserving existing ones', () => {
|
|
31
|
+
const list: Item[] = [
|
|
32
|
+
{ id: 'keep', label: 'a' },
|
|
33
|
+
{ label: 'b' },
|
|
34
|
+
{ id: '', label: 'c' },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
ensureItemIds(list);
|
|
38
|
+
|
|
39
|
+
expect(list[0].id).toBe('keep');
|
|
40
|
+
expect(list[1].id).toBeTruthy();
|
|
41
|
+
expect(list[2].id).toBeTruthy();
|
|
42
|
+
expect(new Set(list.map((i) => i.id)).size).toBe(3);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('is a no-op for undefined', () => {
|
|
46
|
+
expect(() => ensureItemIds(undefined)).not.toThrow();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('removeItemsByIds', () => {
|
|
51
|
+
it('removes by id regardless of order (no index shifting)', () => {
|
|
52
|
+
const result = removeItemsByIds(items('a', 'b', 'c', 'd'), ['c', 'a']);
|
|
53
|
+
|
|
54
|
+
expect(labels(result)).toEqual(['b', 'd']);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('returns the list unchanged when no ids given', () => {
|
|
58
|
+
const list = items('a', 'b');
|
|
59
|
+
|
|
60
|
+
expect(removeItemsByIds(list, undefined)).toBe(list);
|
|
61
|
+
expect(removeItemsByIds(list, [])).toBe(list);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('returns [] for undefined items', () => {
|
|
65
|
+
expect(removeItemsByIds(undefined, ['x'])).toEqual([]);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe('repositionItemByAnchor', () => {
|
|
70
|
+
it('appends a new item when no anchor is given', () => {
|
|
71
|
+
const list = items('a', 'b');
|
|
72
|
+
|
|
73
|
+
repositionItemByAnchor(list, { id: 'new', label: 'new' }, undefined);
|
|
74
|
+
|
|
75
|
+
expect(labels(list)).toEqual(['a', 'b', 'new']);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('leaves an existing item in place when no anchor is given', () => {
|
|
79
|
+
const list = items('a', 'b', 'c');
|
|
80
|
+
|
|
81
|
+
repositionItemByAnchor(list, list[1], undefined);
|
|
82
|
+
|
|
83
|
+
expect(labels(list)).toEqual(['a', 'b', 'c']);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('inserts a new item before the anchor id', () => {
|
|
87
|
+
const list = items('a', 'b', 'c');
|
|
88
|
+
|
|
89
|
+
repositionItemByAnchor(list, { id: 'new', label: 'new' }, 'b');
|
|
90
|
+
|
|
91
|
+
expect(labels(list)).toEqual(['a', 'new', 'b', 'c']);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('moves an existing item before the anchor id', () => {
|
|
95
|
+
const list = items('a', 'b', 'c', 'd');
|
|
96
|
+
|
|
97
|
+
// move 'd' before 'b'
|
|
98
|
+
repositionItemByAnchor(list, list[3], 'b');
|
|
99
|
+
|
|
100
|
+
expect(labels(list)).toEqual(['a', 'd', 'b', 'c']);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('moves an existing item to the end with the __end__ sentinel', () => {
|
|
104
|
+
const list = items('a', 'b', 'c');
|
|
105
|
+
|
|
106
|
+
repositionItemByAnchor(list, list[0], END_ITEM_ANCHOR);
|
|
107
|
+
|
|
108
|
+
expect(labels(list)).toEqual(['b', 'c', 'a']);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('falls through to the end when the anchor id is not found', () => {
|
|
112
|
+
const list = items('a', 'b');
|
|
113
|
+
|
|
114
|
+
repositionItemByAnchor(list, { id: 'new', label: 'new' }, 'missing');
|
|
115
|
+
|
|
116
|
+
expect(labels(list)).toEqual(['a', 'b', 'new']);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sentinel anchor meaning "the end of the list", mirroring the section-level
|
|
5
|
+
* `move_before_content_id: "__end__"` convention used in base-section-builder.
|
|
6
|
+
*/
|
|
7
|
+
export const END_ITEM_ANCHOR = '__end__';
|
|
8
|
+
|
|
9
|
+
/** Generate a stable item id. Mirrors section-level `uuid.v4()` id generation. */
|
|
10
|
+
export const generateItemId = (): string => uuidv4();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Backfill ids onto any items missing one. Per BP-5603 this runs in the
|
|
14
|
+
* metadata builder when a section is processed, so the persisted metadata
|
|
15
|
+
* returned to the client gains stable ids that subsequent AI tool calls can
|
|
16
|
+
* reference. Mutates in place.
|
|
17
|
+
*/
|
|
18
|
+
export const ensureItemIds = <T extends { id?: string }>(
|
|
19
|
+
items: T[] | undefined,
|
|
20
|
+
): void => {
|
|
21
|
+
if (!items) return;
|
|
22
|
+
|
|
23
|
+
for (const item of items) {
|
|
24
|
+
if (!item.id) item.id = generateItemId();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Remove items whose id appears in `ids`. Order-independent (no descending
|
|
30
|
+
* index sort needed) — the whole point of the id-based migration. Items
|
|
31
|
+
* without an id are never removed by id.
|
|
32
|
+
*/
|
|
33
|
+
export const removeItemsByIds = <T extends { id?: string }>(
|
|
34
|
+
items: T[] | undefined,
|
|
35
|
+
ids: string[] | undefined,
|
|
36
|
+
): T[] => {
|
|
37
|
+
if (!items?.length) return items ?? [];
|
|
38
|
+
|
|
39
|
+
if (!ids?.length) return items;
|
|
40
|
+
|
|
41
|
+
const toRemove = new Set(ids);
|
|
42
|
+
|
|
43
|
+
return items.filter((item) => !item.id || !toRemove.has(item.id));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Position `item` within `items` relative to an anchor id — the item-level
|
|
48
|
+
* mirror of base-section-builder's `moveContent`:
|
|
49
|
+
*
|
|
50
|
+
* - `moveBeforeItemId === undefined` → leave an existing item where it is;
|
|
51
|
+
* append a new (not-yet-present) item to the end.
|
|
52
|
+
* - `moveBeforeItemId === "__end__"` → move/insert at the very end.
|
|
53
|
+
* - anchor id found → insert immediately before it.
|
|
54
|
+
* - anchor id not found → fall through to the end (same
|
|
55
|
+
* forgiving behaviour as `moveContent`).
|
|
56
|
+
*
|
|
57
|
+
* Mutates `items` in place. `item` may be an existing element of `items`
|
|
58
|
+
* (a move) or a brand-new object (an insert).
|
|
59
|
+
*/
|
|
60
|
+
export const repositionItemByAnchor = <T extends { id?: string }>(
|
|
61
|
+
items: T[],
|
|
62
|
+
item: T,
|
|
63
|
+
moveBeforeItemId: string | undefined,
|
|
64
|
+
): void => {
|
|
65
|
+
const currentIndex = items.indexOf(item);
|
|
66
|
+
|
|
67
|
+
if (moveBeforeItemId === undefined) {
|
|
68
|
+
if (currentIndex === -1) items.push(item);
|
|
69
|
+
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (currentIndex !== -1) items.splice(currentIndex, 1);
|
|
74
|
+
|
|
75
|
+
const anchorIndex =
|
|
76
|
+
moveBeforeItemId === END_ITEM_ANCHOR
|
|
77
|
+
? -1
|
|
78
|
+
: items.findIndex((i) => i.id === moveBeforeItemId);
|
|
79
|
+
|
|
80
|
+
if (anchorIndex !== -1) {
|
|
81
|
+
items.splice(anchorIndex, 0, item);
|
|
82
|
+
} else {
|
|
83
|
+
items.push(item);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
@@ -10,6 +10,12 @@ import type { BuilderResult } from '../../models';
|
|
|
10
10
|
import { applyScalarFields, isValidUrl } from '../section-field-utils';
|
|
11
11
|
import { BaseSectionBuilder } from './base-section-builder';
|
|
12
12
|
import { validateImageGallery } from '../section-rules/image-gallery.rules';
|
|
13
|
+
import {
|
|
14
|
+
ensureItemIds,
|
|
15
|
+
generateItemId,
|
|
16
|
+
removeItemsByIds,
|
|
17
|
+
repositionItemByAnchor,
|
|
18
|
+
} from '../item-id-utils';
|
|
13
19
|
|
|
14
20
|
const applyGalleryType = (
|
|
15
21
|
content: ImageGalleryContent,
|
|
@@ -21,11 +27,17 @@ const applyGalleryType = (
|
|
|
21
27
|
};
|
|
22
28
|
};
|
|
23
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Full rebuild: discard existing images and map the payload directly.
|
|
32
|
+
* Used on create and when `_replace_items` is set. Each item gets a fresh id
|
|
33
|
+
* (or keeps the caller-supplied `item_id` when provided).
|
|
34
|
+
*/
|
|
24
35
|
const applyGalleryImages = (
|
|
25
36
|
content: ImageGalleryContent,
|
|
26
37
|
images: ImageGalleryItem[],
|
|
27
38
|
): void => {
|
|
28
39
|
content.images = images.map((img) => ({
|
|
40
|
+
id: img.item_id || generateItemId(),
|
|
29
41
|
imageUrl: isValidUrl(img.image_url) ? img.image_url! : '',
|
|
30
42
|
imageTitle: img.caption || '',
|
|
31
43
|
width: 0,
|
|
@@ -35,84 +47,53 @@ const applyGalleryImages = (
|
|
|
35
47
|
}));
|
|
36
48
|
};
|
|
37
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Id-based merge (BP-5603), mirroring testimonial-section-builder one level
|
|
52
|
+
* deeper into `content.images`:
|
|
53
|
+
* - `item_id` matches existing item → update in place; reposition if
|
|
54
|
+
* `move_before_item_id` is set.
|
|
55
|
+
* - no `item_id` → add new item, positioned by
|
|
56
|
+
* `move_before_item_id`.
|
|
57
|
+
* - `removeIds` → delete by id (order-independent).
|
|
58
|
+
*
|
|
59
|
+
* Existing items are id-backfilled first so legacy galleries become
|
|
60
|
+
* referenceable as soon as the metadata builder touches them.
|
|
61
|
+
*/
|
|
38
62
|
const mergeGalleryImages = (
|
|
39
63
|
content: ImageGalleryContent,
|
|
40
64
|
images: ImageGalleryItem[],
|
|
41
|
-
|
|
65
|
+
removeIds: string[] | undefined,
|
|
42
66
|
): void => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const updatedImages = itemsToMerge.map((img, index) => {
|
|
46
|
-
const existing = content.images?.[index];
|
|
47
|
-
const imageUrl = isValidUrl(img.image_url)
|
|
48
|
-
? img.image_url!
|
|
49
|
-
: (existing?.imageUrl ?? '');
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
...(existing || {}),
|
|
53
|
-
imageUrl,
|
|
54
|
-
imageTitle: img.caption ?? existing?.imageTitle ?? '',
|
|
55
|
-
width: existing?.width ?? 0,
|
|
56
|
-
height: existing?.height ?? 0,
|
|
57
|
-
mediaType: existing?.mediaType ?? 'image',
|
|
58
|
-
imageLink: existing?.imageLink ?? '',
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
!replaceAll &&
|
|
64
|
-
content.images &&
|
|
65
|
-
content.images.length > itemsToMerge.length
|
|
66
|
-
) {
|
|
67
|
-
const extras = content.images.slice(itemsToMerge.length).map((img) => ({
|
|
68
|
-
imageUrl: img.imageUrl ?? '',
|
|
69
|
-
imageTitle: img.imageTitle ?? '',
|
|
70
|
-
width: img.width ?? 0,
|
|
71
|
-
height: img.height ?? 0,
|
|
72
|
-
mediaType: img.mediaType ?? ('image' as const),
|
|
73
|
-
imageLink: img.imageLink ?? '',
|
|
74
|
-
}));
|
|
75
|
-
|
|
76
|
-
updatedImages.push(...extras);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
content.images = updatedImages;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const insertGalleryImages = (
|
|
83
|
-
content: ImageGalleryContent,
|
|
84
|
-
images: ImageGalleryItem[],
|
|
85
|
-
): void => {
|
|
86
|
-
const inserts = images.filter((img) => img.insert_at !== undefined);
|
|
87
|
-
|
|
88
|
-
if (!inserts.length) return;
|
|
89
|
-
|
|
90
|
-
const sorted = [...inserts].sort(
|
|
91
|
-
(a, b) => (b.insert_at ?? 0) - (a.insert_at ?? 0),
|
|
92
|
-
);
|
|
67
|
+
ensureItemIds(content.images);
|
|
68
|
+
content.images = removeItemsByIds(content.images, removeIds);
|
|
93
69
|
|
|
94
|
-
for (const img of
|
|
95
|
-
if (
|
|
70
|
+
for (const img of images) {
|
|
71
|
+
if (img.item_id) {
|
|
72
|
+
const existing = content.images.find((i) => i.id === img.item_id);
|
|
96
73
|
|
|
97
|
-
|
|
98
|
-
continue;
|
|
74
|
+
// Unknown id — skip rather than guess at a position.
|
|
75
|
+
if (!existing) continue;
|
|
99
76
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
0,
|
|
104
|
-
Math.min(img.insert_at ?? 0, content.images.length),
|
|
105
|
-
);
|
|
77
|
+
if (img.image_url !== undefined) {
|
|
78
|
+
existing.imageUrl = isValidUrl(img.image_url) ? img.image_url! : '';
|
|
79
|
+
}
|
|
106
80
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
81
|
+
if (img.caption !== undefined) existing.imageTitle = img.caption;
|
|
82
|
+
|
|
83
|
+
repositionItemByAnchor(content.images, existing, img.move_before_item_id);
|
|
84
|
+
} else {
|
|
85
|
+
const newItem = {
|
|
86
|
+
id: generateItemId(),
|
|
87
|
+
imageUrl: isValidUrl(img.image_url) ? img.image_url! : '',
|
|
88
|
+
imageTitle: img.caption ?? '',
|
|
89
|
+
width: 0,
|
|
90
|
+
height: 0,
|
|
91
|
+
mediaType: 'image' as const,
|
|
92
|
+
imageLink: '',
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
repositionItemByAnchor(content.images, newItem, img.move_before_item_id);
|
|
96
|
+
}
|
|
116
97
|
}
|
|
117
98
|
};
|
|
118
99
|
|
|
@@ -144,26 +125,19 @@ export class ImageGalleryBuilder extends BaseSectionBuilder<ImageGalleryContent>
|
|
|
144
125
|
applyGalleryType(content, args.gallery_type);
|
|
145
126
|
}
|
|
146
127
|
|
|
147
|
-
if (args.images && Array.isArray(args.images)) {
|
|
148
|
-
|
|
128
|
+
if (args._replace_items && args.images && Array.isArray(args.images)) {
|
|
129
|
+
// Full replacement: discard existing images and rebuild from the payload.
|
|
130
|
+
applyGalleryImages(content, args.images);
|
|
131
|
+
} else if (this.mode === 'create') {
|
|
132
|
+
if (args.images && Array.isArray(args.images)) {
|
|
149
133
|
applyGalleryImages(content, args.images);
|
|
150
|
-
} else {
|
|
151
|
-
mergeGalleryImages(content, args.images, !!args._replace_items);
|
|
152
134
|
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (idx >= 0 && idx < content.images.length) {
|
|
160
|
-
content.images.splice(idx, 1);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (args.images && Array.isArray(args.images) && this.mode === 'update') {
|
|
166
|
-
insertGalleryImages(content, args.images);
|
|
135
|
+
} else if (
|
|
136
|
+
(args.images && Array.isArray(args.images)) ||
|
|
137
|
+
args._remove_item_ids?.length
|
|
138
|
+
) {
|
|
139
|
+
// Update: id-based add / edit / move / remove in a single pass.
|
|
140
|
+
mergeGalleryImages(content, args.images ?? [], args._remove_item_ids);
|
|
167
141
|
}
|
|
168
142
|
|
|
169
143
|
return { request: this.request, model };
|