@salla.sa/twilight-components 2.14.499 → 2.14.501
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/dist/cjs/catalog-recommendations-Bzt0HRy8.js +94 -0
- package/dist/cjs/{filepond-D03qhsrx.js → filepond-YItpCyss.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BYNMDvVv.js → filepond-plugin-file-poster-BAPK8RK2.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-CzffjUzS.js → filepond-plugin-file-validate-size--RuyRQn1.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-LygxJING.js → filepond-plugin-file-validate-type-CBvJsWh4.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-Dz_UgE3p.js → filepond-plugin-image-edit-CIZ-WDGk.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C9S6CL_q.js → filepond-plugin-image-exif-orientation-RE8rudTp.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CoshLC_A.js → filepond-plugin-image-preview-C17RG4r1.js} +1 -1
- package/dist/cjs/{functions-BuqfSCqe.js → functions-BYc4IT8l.js} +1 -1
- package/dist/cjs/{index-BiuRQfha.js → index-CB_WYB8k.js} +1 -1
- package/dist/cjs/{index-pecK0haA.js → index-CuQpJRcD.js} +6 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +8 -20
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +269 -0
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +17 -17
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +210 -31
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +5 -5
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down_2.cjs.entry.js +4 -3
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +2 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +2 -2
- package/dist/cjs/salla-localization-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-exchange-product-card_5.cjs.entry.js +10 -10
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +9 -9
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +4 -4
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +2 -2
- package/dist/cjs/salla-map_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -6
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +2 -2
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +2 -2
- package/dist/cjs/salla-product-card_2.cjs.entry.js +6 -6
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +2 -2
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +6 -6
- package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
- package/dist/cjs/salla-social.cjs.entry.js +2 -2
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
- package/dist/cjs/{tracked-promise-D3H-BAQh.js → tracked-promise-XZchciB1.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-NZhSBHbI.js → vanilla-picker-DcFuBceg.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/salla-basket-gap/salla-basket-gap.css +3 -0
- package/dist/collection/components/salla-basket-gap/salla-basket-gap.js +306 -0
- package/dist/collection/components/salla-bought-together/salla-bought-together.js +5 -17
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.css +63 -0
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +211 -30
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +1 -1
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +1 -1
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +1 -1
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +1 -1
- package/dist/collection/components/salla-count-down/salla-count-down.js +3 -2
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +2 -2
- package/dist/collection/components/salla-filters/salla-filters.js +1 -1
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +2 -2
- package/dist/collection/components/salla-gifting/salla-gifting.js +2 -2
- package/dist/collection/components/salla-hook/salla-hook.js +1 -1
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
- package/dist/collection/components/salla-loading/salla-loading.js +1 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
- package/dist/collection/components/salla-loyalty-points-history/salla-loyalty-points-history.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-exchange-product-card.js +2 -2
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-hero.js +3 -3
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-point.js +4 -4
- package/dist/collection/components/salla-loyalty-program/salla-loyalty-reward.js +2 -2
- package/dist/collection/components/salla-loyalty-program/salla-reward-card.js +1 -1
- package/dist/collection/components/salla-loyalty-program/salla-reward-details.js +3 -3
- package/dist/collection/components/salla-loyalty-program/salla-reward-exchange.js +1 -1
- package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
- package/dist/collection/components/salla-map/salla-map.js +3 -3
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +1 -1
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
- package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
- package/dist/collection/components/salla-order-edit/salla-order-edit-product-card.js +1 -1
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +2 -2
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
- package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
- package/dist/collection/components/salla-product-card-embed/salla-product-card-embed.js +1 -1
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +1 -1
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +1 -1
- package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +1 -1
- package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
- package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
- package/dist/collection/components/salla-search/salla-search.js +5 -5
- package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
- package/dist/collection/components/salla-social/salla-social.js +1 -1
- package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
- package/dist/collection/shared/catalog-recommendations.js +89 -0
- package/dist/components/catalog-recommendations.js +91 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-basket-gap.d.ts +11 -0
- package/dist/components/salla-basket-gap.js +402 -0
- package/dist/components/salla-bought-together.js +5 -17
- package/dist/components/salla-cart-coupons.js +211 -30
- package/dist/components/salla-cart-summary.js +1 -1
- package/dist/components/salla-color-picker2.js +1 -1
- package/dist/components/salla-comment-form2.js +1 -1
- package/dist/components/salla-conditional-fields2.js +1 -1
- package/dist/components/salla-count-down2.js +3 -2
- package/dist/components/salla-datetime-picker2.js +1 -1
- package/dist/components/salla-file-upload2.js +2 -2
- package/dist/components/salla-filters-widget2.js +2 -2
- package/dist/components/salla-filters.js +1 -1
- package/dist/components/salla-gifting.js +2 -2
- package/dist/components/salla-hook.js +1 -1
- package/dist/components/salla-list-tile2.js +1 -1
- package/dist/components/salla-loading2.js +1 -1
- package/dist/components/salla-localization-modal.js +1 -1
- package/dist/components/salla-loyalty-exchange-product-card2.js +2 -2
- package/dist/components/salla-loyalty-hero2.js +3 -3
- package/dist/components/salla-loyalty-point2.js +4 -4
- package/dist/components/salla-loyalty-points-history.js +1 -1
- package/dist/components/salla-loyalty-prize-item.js +1 -1
- package/dist/components/salla-loyalty-reward.js +2 -2
- package/dist/components/salla-maintenance-alert.js +1 -1
- package/dist/components/salla-map2.js +3 -3
- package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
- package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
- package/dist/components/salla-multiple-bundle-product.js +1 -1
- package/dist/components/salla-notification-item2.js +1 -1
- package/dist/components/salla-offer-modal.js +1 -1
- package/dist/components/salla-order-details.js +1 -1
- package/dist/components/salla-order-edit-product-card.js +1 -1
- package/dist/components/salla-order-summary.js +1 -1
- package/dist/components/salla-payments.js +2 -2
- package/dist/components/salla-placeholder2.js +1 -1
- package/dist/components/salla-price-range2.js +2 -2
- package/dist/components/salla-product-availability2.js +1 -1
- package/dist/components/salla-product-card-embed.js +1 -1
- package/dist/components/salla-product-card2.js +5 -5
- package/dist/components/salla-product-size-guide.js +2 -2
- package/dist/components/salla-quantity-input2.js +1 -1
- package/dist/components/salla-quick-buy2.js +1 -1
- package/dist/components/salla-review-card2.js +1 -1
- package/dist/components/salla-review-factors-tags.js +1 -1
- package/dist/components/salla-reviews-page.js +1 -1
- package/dist/components/salla-reviews.js +1 -1
- package/dist/components/salla-reward-card2.js +1 -1
- package/dist/components/salla-reward-details2.js +3 -3
- package/dist/components/salla-reward-exchange2.js +1 -1
- package/dist/components/salla-search.js +5 -5
- package/dist/components/salla-searchable-dropdown2.js +4 -4
- package/dist/components/salla-skeleton2.js +1 -1
- package/dist/components/salla-social-share2.js +1 -1
- package/dist/components/salla-social.js +1 -1
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/components/salla-wishlist-actions.js +1 -1
- package/dist/esm/catalog-recommendations-9fzJJ_Ox.js +91 -0
- package/dist/esm/{filepond-CJFgTJm9.js → filepond-DQgEXp69.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-2z52H04r.js → filepond-plugin-file-poster-BE5-JUQb.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-DEKIzgzx.js → filepond-plugin-file-validate-size-CwWpBym0.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type--IuNAFuU.js → filepond-plugin-file-validate-type-CovRSsjJ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-DV4s4m_8.js → filepond-plugin-image-edit-DY-5oWCU.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BicBedUH.js → filepond-plugin-image-exif-orientation-DQROYLkj.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-68UNym7e.js → filepond-plugin-image-preview-CZCR-9d7.js} +1 -1
- package/dist/esm/{functions-sMyBqXp4.js → functions-DWD7tnLk.js} +1 -1
- package/dist/esm/{index-C_ccgsYC.js → index-DW5RMC3M.js} +6 -2
- package/dist/esm/{index-CZQUg3wR.js → index-VUPjm0uj.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +2 -2
- package/dist/esm/salla-add-product-button_5.entry.js +8 -20
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +267 -0
- package/dist/esm/salla-booking-field_7.entry.js +17 -17
- package/dist/esm/salla-bullet-delivery_2.entry.js +5 -5
- package/dist/esm/salla-cart-coupons.entry.js +210 -31
- package/dist/esm/salla-cart-item-offers_2.entry.js +2 -2
- package/dist/esm/salla-cart-summary-card.entry.js +1 -1
- package/dist/esm/salla-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-factors.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +5 -5
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down_2.entry.js +4 -3
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +2 -2
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +2 -2
- package/dist/esm/salla-localization-modal.entry.js +2 -2
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner.entry.js +2 -2
- package/dist/esm/salla-loyalty-exchange-product-card_5.entry.js +10 -10
- package/dist/esm/salla-loyalty-hero_2.entry.js +9 -9
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +2 -2
- package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +4 -4
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +2 -2
- package/dist/esm/salla-map_2.entry.js +4 -4
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +4 -4
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -6
- package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +2 -2
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +2 -2
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-cancel.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +2 -2
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +2 -2
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +2 -2
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-placeholder.entry.js +2 -2
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card-embed.entry.js +2 -2
- package/dist/esm/salla-product-card_2.entry.js +6 -6
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-review-factors-tags.entry.js +2 -2
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +6 -6
- package/dist/esm/salla-skeleton.entry.js +2 -2
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +2 -2
- package/dist/esm/salla-social.entry.js +2 -2
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +2 -2
- package/dist/esm/{tracked-promise-Gd3pavcY.js → tracked-promise-CZ98bqyM.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-UVrpERET.js → vanilla-picker-DKozn4lm.js} +1 -1
- package/dist/twilight/{p-a7140774.entry.js → p-015a4d45.entry.js} +1 -1
- package/dist/twilight/{p-63441a3a.entry.js → p-0708708b.entry.js} +1 -1
- package/dist/twilight/{p-a9b57fbb.entry.js → p-0aea93dd.entry.js} +1 -1
- package/dist/twilight/{p-cac7ce02.entry.js → p-0f2f8564.entry.js} +1 -1
- package/dist/twilight/{p-02b057fa.entry.js → p-12f14fe5.entry.js} +1 -1
- package/dist/twilight/{p-aeb6d92c.entry.js → p-1453e674.entry.js} +1 -1
- package/dist/twilight/{p-18b40b2c.entry.js → p-17edd677.entry.js} +1 -1
- package/dist/twilight/{p-4a233372.entry.js → p-18209070.entry.js} +1 -1
- package/dist/twilight/p-1decfdb8.entry.js +4 -0
- package/dist/twilight/p-210de87e.entry.js +4 -0
- package/dist/twilight/{p-ffddd8cc.entry.js → p-234752f4.entry.js} +1 -1
- package/dist/twilight/{p-ffe26a36.entry.js → p-24f1c04b.entry.js} +1 -1
- package/dist/twilight/{p-bba5e521.entry.js → p-254d24b3.entry.js} +1 -1
- package/dist/twilight/{p-76290b12.entry.js → p-29b848f7.entry.js} +1 -1
- package/dist/twilight/p-2abf736c.entry.js +4 -0
- package/dist/twilight/{p-b925e462.entry.js → p-2bc1991c.entry.js} +1 -1
- package/dist/twilight/{p-71a539e8.entry.js → p-2fe13b65.entry.js} +1 -1
- package/dist/twilight/{p-85a4c32c.entry.js → p-33710edf.entry.js} +1 -1
- package/dist/twilight/{p-4f2c15c6.entry.js → p-3f47b71b.entry.js} +1 -1
- package/dist/twilight/{p-608dc0ae.entry.js → p-41b9b2ef.entry.js} +1 -1
- package/dist/twilight/{p-ff24a697.entry.js → p-42fb6aaa.entry.js} +1 -1
- package/dist/twilight/{p-296482fa.entry.js → p-44403dab.entry.js} +1 -1
- package/dist/twilight/{p-09542930.entry.js → p-47dd7a56.entry.js} +1 -1
- package/dist/twilight/{p-f1e49f36.entry.js → p-485cd05f.entry.js} +1 -1
- package/dist/twilight/{p-6ef8bbba.entry.js → p-494f93d5.entry.js} +1 -1
- package/dist/twilight/{p-f4678181.entry.js → p-4aaba2ae.entry.js} +1 -1
- package/dist/twilight/{p-aa0d53c8.entry.js → p-4e60702f.entry.js} +1 -1
- package/dist/twilight/p-4ed58afc.entry.js +4 -0
- package/dist/twilight/{p-59b38e97.entry.js → p-4f1b17ce.entry.js} +1 -1
- package/dist/twilight/{p-d62ac6c8.entry.js → p-4ff3fcc2.entry.js} +1 -1
- package/dist/twilight/{p-a0bcc854.entry.js → p-52465888.entry.js} +1 -1
- package/dist/twilight/{p-efa1e206.entry.js → p-527c985e.entry.js} +1 -1
- package/dist/twilight/{p-44f7f2a2.entry.js → p-5803461f.entry.js} +1 -1
- package/dist/twilight/{p-25fffbe6.entry.js → p-5c81f957.entry.js} +1 -1
- package/dist/twilight/{p-d09bcc84.entry.js → p-5f363172.entry.js} +1 -1
- package/dist/twilight/p-60096faf.entry.js +4 -0
- package/dist/twilight/{p-3d141203.entry.js → p-629b0300.entry.js} +1 -1
- package/dist/twilight/{p-022e10ba.entry.js → p-64bddbd4.entry.js} +1 -1
- package/dist/twilight/p-66b8ffe5.entry.js +4 -0
- package/dist/twilight/{p-0b6ae26e.entry.js → p-686e0e20.entry.js} +1 -1
- package/dist/twilight/{p-75fe9e68.entry.js → p-693d1afd.entry.js} +1 -1
- package/dist/twilight/{p-72bf2467.entry.js → p-6c2bd4d3.entry.js} +1 -1
- package/dist/twilight/{p-50d50a69.entry.js → p-6ea59d29.entry.js} +1 -1
- package/dist/twilight/p-753c2036.entry.js +4 -0
- package/dist/twilight/{p-dd2831f5.entry.js → p-7d4ea0b4.entry.js} +1 -1
- package/dist/twilight/{p-0e9b8853.entry.js → p-7d778acb.entry.js} +1 -1
- package/dist/twilight/{p-44f68d4a.entry.js → p-7fa1bb43.entry.js} +1 -1
- package/dist/twilight/{p-0bf87990.entry.js → p-8091c1bb.entry.js} +1 -1
- package/dist/twilight/{p-3d7adaef.entry.js → p-85238859.entry.js} +1 -1
- package/dist/twilight/{p-55ebca48.entry.js → p-86b6bf59.entry.js} +1 -1
- package/dist/twilight/p-8a550a9b.entry.js +4 -0
- package/dist/twilight/{p-644ff503.entry.js → p-8bd21221.entry.js} +1 -1
- package/dist/twilight/p-8c0b1195.entry.js +4 -0
- package/dist/twilight/p-8fded8e8.entry.js +4 -0
- package/dist/twilight/{p-e7f7e8cb.entry.js → p-90039201.entry.js} +1 -1
- package/dist/twilight/{p-C0fioW0d.js → p-9Gnw86AG.js} +2 -2
- package/dist/twilight/{p-253dcced.entry.js → p-9adcfb8f.entry.js} +1 -1
- package/dist/twilight/{p-f671cd4e.entry.js → p-9b4a8482.entry.js} +1 -1
- package/dist/twilight/{p-c1a45217.entry.js → p-9bfb9e67.entry.js} +1 -1
- package/dist/twilight/{p-3d38f2d2.entry.js → p-9c7ed057.entry.js} +1 -1
- package/dist/twilight/{p-07fb47b0.entry.js → p-9ea31b28.entry.js} +1 -1
- package/dist/twilight/p-9fzJJ_Ox.js +4 -0
- package/dist/twilight/{p-BFxC_J0K.js → p-BEd1gsDo.js} +1 -1
- package/dist/twilight/{p-CQB4Iqwr.js → p-BOGl7WKm.js} +1 -1
- package/dist/twilight/{p-eb_g_RAR.js → p-BOsr_t6U.js} +1 -1
- package/dist/twilight/{p-D_u6j3vO.js → p-Bk7FtCRB.js} +1 -1
- package/dist/twilight/{p-gPMLoyk9.js → p-BmLFLdi9.js} +1 -1
- package/dist/twilight/{p-CKa-ux_j.js → p-CTz-tTY_.js} +1 -1
- package/dist/twilight/{p-CirvTQDu.js → p-D6IFHeYy.js} +1 -1
- package/dist/twilight/{p-CkVpJQZp.js → p-DKReyChR.js} +1 -1
- package/dist/twilight/{p-C_ccgsYC.js → p-DW5RMC3M.js} +1 -1
- package/dist/twilight/{p-DVIjdKki.js → p-Dha9oJHi.js} +1 -1
- package/dist/twilight/{p-D6FE69fV.js → p-MxH_-y8s.js} +1 -1
- package/dist/twilight/{p-0755a7eb.entry.js → p-a7da83e9.entry.js} +1 -1
- package/dist/twilight/{p-ff2aa9cf.entry.js → p-a9d1a6ab.entry.js} +1 -1
- package/dist/twilight/{p-fced2ec8.entry.js → p-abffebe7.entry.js} +1 -1
- package/dist/twilight/{p-8cb54383.entry.js → p-b9babfe5.entry.js} +1 -1
- package/dist/twilight/{p-591a9387.entry.js → p-bc890bf3.entry.js} +1 -1
- package/dist/twilight/{p-0a4110f4.entry.js → p-bc935da0.entry.js} +1 -1
- package/dist/twilight/{p-fc25b7fa.entry.js → p-bd2359a7.entry.js} +1 -1
- package/dist/twilight/{p-b0dc296d.entry.js → p-bd7ba620.entry.js} +1 -1
- package/dist/twilight/{p-0828cbfb.entry.js → p-bdfb4b2b.entry.js} +1 -1
- package/dist/twilight/{p-a5cbcc70.entry.js → p-be13f6cf.entry.js} +1 -1
- package/dist/twilight/{p-1678ff12.entry.js → p-c0373e93.entry.js} +1 -1
- package/dist/twilight/{p-89069e7e.entry.js → p-c2019c1f.entry.js} +1 -1
- package/dist/twilight/{p-7470e25f.entry.js → p-c66582de.entry.js} +1 -1
- package/dist/twilight/{p-eebe8378.entry.js → p-cb675f91.entry.js} +1 -1
- package/dist/twilight/{p-fd50a634.entry.js → p-cc0b8dec.entry.js} +1 -1
- package/dist/twilight/{p-db12f03d.entry.js → p-ce06372f.entry.js} +1 -1
- package/dist/twilight/{p-9cc8570a.entry.js → p-ceb44ad7.entry.js} +1 -1
- package/dist/twilight/{p-65f517fa.entry.js → p-cfe4f808.entry.js} +2 -2
- package/dist/twilight/{p-eaf4df85.entry.js → p-d047a409.entry.js} +1 -1
- package/dist/twilight/p-d63533f2.entry.js +4 -0
- package/dist/twilight/{p-80ad24c8.entry.js → p-d649f426.entry.js} +1 -1
- package/dist/twilight/{p-38662602.entry.js → p-d89e140a.entry.js} +1 -1
- package/dist/twilight/{p-c067cc58.entry.js → p-daaa9ef7.entry.js} +1 -1
- package/dist/twilight/{p-dc215a04.entry.js → p-dbc38d79.entry.js} +1 -1
- package/dist/twilight/{p-41a439ab.entry.js → p-dd7a835b.entry.js} +1 -1
- package/dist/twilight/{p-ae55de48.entry.js → p-ddbaca65.entry.js} +1 -1
- package/dist/twilight/{p-4ab125bd.entry.js → p-e47540e1.entry.js} +1 -1
- package/dist/twilight/{p-3d58194d.entry.js → p-e8ada41e.entry.js} +1 -1
- package/dist/twilight/{p-b0f81a93.entry.js → p-e9a35a7f.entry.js} +1 -1
- package/dist/twilight/{p-fe95f82d.entry.js → p-ef77963a.entry.js} +1 -1
- package/dist/twilight/{p-bc66d65f.entry.js → p-f2416b6d.entry.js} +1 -1
- package/dist/twilight/{p-fe909382.entry.js → p-f9c12172.entry.js} +1 -1
- package/dist/twilight/{p-3a99909c.entry.js → p-fbc91885.entry.js} +1 -1
- package/dist/twilight/p-ff5a82a3.entry.js +4 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-basket-gap/salla-basket-gap.d.ts +52 -0
- package/dist/types/components/salla-cart-coupons/salla-cart-coupons.d.ts +31 -3
- package/dist/types/components.d.ts +23 -0
- package/dist/types/shared/catalog-recommendations.d.ts +2 -0
- package/package.json +5 -5
- package/dist/collection/components/salla-conditional-offer/test/salla-conditional-offer.js +0 -12
- package/dist/twilight/p-376a4409.entry.js +0 -4
- package/dist/twilight/p-3abd511f.entry.js +0 -4
- package/dist/twilight/p-7bf1a8cd.entry.js +0 -4
- package/dist/twilight/p-82c60a4d.entry.js +0 -4
- package/dist/twilight/p-8e2ff581.entry.js +0 -4
- package/dist/twilight/p-8f99e8cf.entry.js +0 -4
- package/dist/twilight/p-997a77b4.entry.js +0 -4
- package/dist/twilight/p-9cbf064d.entry.js +0 -4
- package/dist/twilight/p-d2624bca.entry.js +0 -4
- package/dist/twilight/p-dbc5925e.entry.js +0 -4
- package/dist/twilight/p-fb8ba239.entry.js +0 -4
- package/dist/types/components/salla-conditional-offer/test/salla-conditional-offer.d.ts +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SallaBasketGap extends Components.SallaBasketGap, HTMLElement {}
|
|
4
|
+
export const SallaBasketGap: {
|
|
5
|
+
prototype: SallaBasketGap;
|
|
6
|
+
new (): SallaBasketGap;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { f as fetchCartBoughtTogether } from './catalog-recommendations.js';
|
|
6
|
+
import { d as defineCustomElement$j } from './salla-add-product-button2.js';
|
|
7
|
+
import { d as defineCustomElement$i } from './salla-booking-field2.js';
|
|
8
|
+
import { d as defineCustomElement$h } from './salla-button2.js';
|
|
9
|
+
import { d as defineCustomElement$g } from './salla-color-picker2.js';
|
|
10
|
+
import { d as defineCustomElement$f } from './salla-conditional-fields2.js';
|
|
11
|
+
import { d as defineCustomElement$e } from './salla-count-down2.js';
|
|
12
|
+
import { d as defineCustomElement$d } from './salla-datetime-picker2.js';
|
|
13
|
+
import { d as defineCustomElement$c } from './salla-file-upload2.js';
|
|
14
|
+
import { d as defineCustomElement$b } from './salla-loading2.js';
|
|
15
|
+
import { d as defineCustomElement$a } from './salla-map2.js';
|
|
16
|
+
import { d as defineCustomElement$9 } from './salla-modal2.js';
|
|
17
|
+
import { d as defineCustomElement$8 } from './salla-order-options-modal2.js';
|
|
18
|
+
import { d as defineCustomElement$7 } from './salla-product-availability2.js';
|
|
19
|
+
import { d as defineCustomElement$6 } from './salla-product-options2.js';
|
|
20
|
+
import { d as defineCustomElement$5 } from './salla-progress-bar2.js';
|
|
21
|
+
import { d as defineCustomElement$4 } from './salla-quick-buy2.js';
|
|
22
|
+
import { d as defineCustomElement$3 } from './salla-skeleton2.js';
|
|
23
|
+
import { d as defineCustomElement$2 } from './salla-tel-input2.js';
|
|
24
|
+
|
|
25
|
+
const sallaBasketGapCss = ":host{display:block}";
|
|
26
|
+
|
|
27
|
+
const SallaBasketGap$1 = /*@__PURE__*/ proxyCustomElement(class SallaBasketGap extends HTMLElement {
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.__registerHost();
|
|
31
|
+
/**
|
|
32
|
+
* Maximum number of recommendations to fetch.
|
|
33
|
+
*/
|
|
34
|
+
this.limit = 10;
|
|
35
|
+
this.products = [];
|
|
36
|
+
this.isLoading = true;
|
|
37
|
+
this.canRender = true;
|
|
38
|
+
this.title = '';
|
|
39
|
+
this.addToCartLabel = '';
|
|
40
|
+
this.weightLabel = '';
|
|
41
|
+
this.discountLabel = '';
|
|
42
|
+
this.placeholder = '';
|
|
43
|
+
this.fetchGeneration = 0;
|
|
44
|
+
this.isSyncingCart = false;
|
|
45
|
+
this.cartItemChangedHandler = (response) => {
|
|
46
|
+
const items = response?.data?.cart?.items ?? [];
|
|
47
|
+
const ids = items.map((i) => String(i.product_id)).filter(Boolean);
|
|
48
|
+
// Reflect a newly added product in the cart list without a full page refresh.
|
|
49
|
+
this.syncCartItemsDom(items);
|
|
50
|
+
this.fetchRecommendations(ids);
|
|
51
|
+
};
|
|
52
|
+
this.beforeAddItemHandler = (data) => {
|
|
53
|
+
const id = String(data?.id ?? '');
|
|
54
|
+
if (id && this.products.some((p) => String(p.id) === id) && salla.cart?.api) {
|
|
55
|
+
salla.cart.api.addToCartSource = 'basket_gap';
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this.addButtonSuccessHandler = (event) => {
|
|
59
|
+
const productId = event?.target?.getAttribute?.('product-id');
|
|
60
|
+
if (!productId)
|
|
61
|
+
return;
|
|
62
|
+
const product = this.products.find((p) => String(p.id) === String(productId));
|
|
63
|
+
if (!product)
|
|
64
|
+
return;
|
|
65
|
+
const items = event?.detail?.data?.items ?? [];
|
|
66
|
+
const cartItem = items.find((i) => String(i.product_id) === String(product.id)) ?? items.slice(-1)[0];
|
|
67
|
+
salla.event.emit('salla-basket-gap::product.added', [{
|
|
68
|
+
product,
|
|
69
|
+
position: this.products.indexOf(product) + 1,
|
|
70
|
+
cartItem,
|
|
71
|
+
cartId: event?.detail?.data?.id,
|
|
72
|
+
source: 'basket_gap',
|
|
73
|
+
}]);
|
|
74
|
+
};
|
|
75
|
+
salla.lang.onLoaded(() => {
|
|
76
|
+
this.title = salla.lang.get('pages.cart.basket_gap_title');
|
|
77
|
+
this.addToCartLabel = salla.lang.get('pages.cart.add_to_cart');
|
|
78
|
+
this.weightLabel = salla.lang.get('pages.products.weight');
|
|
79
|
+
this.discountLabel = salla.lang.get('pages.products.discount');
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
componentWillLoad() {
|
|
83
|
+
salla.onReady().then(() => {
|
|
84
|
+
if (!salla.config.get('store.settings.cart.basket_gap')) {
|
|
85
|
+
this.canRender = false;
|
|
86
|
+
this.isLoading = false;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.title = salla.lang.get('pages.cart.basket_gap_title');
|
|
90
|
+
this.addToCartLabel = salla.lang.get('pages.cart.add_to_cart');
|
|
91
|
+
this.weightLabel = salla.lang.get('pages.products.weight');
|
|
92
|
+
this.discountLabel = salla.lang.get('pages.products.discount');
|
|
93
|
+
this.placeholder = salla.url.asset(salla.config.get('theme.settings.placeholder'));
|
|
94
|
+
const cachedCart = salla.storage.get('cart');
|
|
95
|
+
const cachedIds = (cachedCart?.items ?? []).map((i) => String(i.product_id)).filter(Boolean);
|
|
96
|
+
if (cachedIds.length) {
|
|
97
|
+
return this.fetchRecommendations(cachedIds);
|
|
98
|
+
}
|
|
99
|
+
return salla.api.cart.details()
|
|
100
|
+
.then(({ data: { cart } }) => {
|
|
101
|
+
const objectIDs = (cart?.items ?? []).map((i) => String(i.product_id)).filter(Boolean);
|
|
102
|
+
return this.fetchRecommendations(objectIDs);
|
|
103
|
+
})
|
|
104
|
+
.catch(() => {
|
|
105
|
+
this.canRender = false;
|
|
106
|
+
this.isLoading = false;
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
componentDidLoad() {
|
|
111
|
+
this.positionUnderCartItems();
|
|
112
|
+
}
|
|
113
|
+
componentDidUpdate() {
|
|
114
|
+
document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));
|
|
115
|
+
this.positionUnderCartItems();
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Cart item rows on the storefront cart page (excluding the order-options block).
|
|
119
|
+
* Kept defensive: themes that don't use the `form[id^="item-"]` pattern return none.
|
|
120
|
+
*/
|
|
121
|
+
getCartItemForms(root = document) {
|
|
122
|
+
return Array.from(root.querySelectorAll('form[id^="item-"]'))
|
|
123
|
+
.filter((form) => !form.closest('.cart-options'));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The component is injected at the theme's `cart:items.end` hook, which may sit
|
|
127
|
+
* below the order options/offers. Move the host to render directly under the
|
|
128
|
+
* cart items. No-ops when the cart item pattern isn't present.
|
|
129
|
+
*/
|
|
130
|
+
positionUnderCartItems() {
|
|
131
|
+
const items = this.getCartItemForms();
|
|
132
|
+
const lastItem = items[items.length - 1];
|
|
133
|
+
if (lastItem && lastItem.nextElementSibling !== this.host) {
|
|
134
|
+
lastItem.after(this.host);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Reflect a newly added product in the cart list without a full page reload.
|
|
139
|
+
* The whole item list is replaced with the fresh server-rendered rows because
|
|
140
|
+
* Salla re-assigns cart line-item ids on add, so diffing by id would duplicate
|
|
141
|
+
* the existing rows. No-ops on themes without the cart item markup.
|
|
142
|
+
*/
|
|
143
|
+
syncCartItemsDom(cartItems) {
|
|
144
|
+
if (!cartItems?.length || this.isSyncingCart)
|
|
145
|
+
return;
|
|
146
|
+
const missing = cartItems.filter((item) => !document.getElementById('item-' + item.id));
|
|
147
|
+
if (!missing.length)
|
|
148
|
+
return;
|
|
149
|
+
this.isSyncingCart = true;
|
|
150
|
+
fetch(window.location.href, { headers: { 'X-Requested-With': 'XMLHttpRequest' }, credentials: 'same-origin' })
|
|
151
|
+
.then((res) => res.text())
|
|
152
|
+
.then((html) => {
|
|
153
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
154
|
+
const freshForms = this.getCartItemForms(doc);
|
|
155
|
+
const currentForms = this.getCartItemForms();
|
|
156
|
+
if (!freshForms.length || !currentForms.length)
|
|
157
|
+
return;
|
|
158
|
+
const firstCurrent = currentForms[0];
|
|
159
|
+
const parent = firstCurrent.parentElement;
|
|
160
|
+
if (!parent)
|
|
161
|
+
return;
|
|
162
|
+
// Insert the fresh rows in place of the current ones, then drop the old rows.
|
|
163
|
+
freshForms.forEach((form) => {
|
|
164
|
+
parent.insertBefore(document.importNode(form, true), firstCurrent);
|
|
165
|
+
});
|
|
166
|
+
currentForms.forEach((form) => form.remove());
|
|
167
|
+
document.lazyLoadInstance?.update?.();
|
|
168
|
+
this.positionUnderCartItems();
|
|
169
|
+
})
|
|
170
|
+
.catch(() => { })
|
|
171
|
+
.finally(() => { this.isSyncingCart = false; });
|
|
172
|
+
}
|
|
173
|
+
connectedCallback() {
|
|
174
|
+
salla.event.on('cart::item.added', this.cartItemChangedHandler);
|
|
175
|
+
salla.event.on('cart::item.deleted', this.cartItemChangedHandler);
|
|
176
|
+
// Tag adds originating from a basket-gap recommendation so the cart auto-track
|
|
177
|
+
// is suppressed in favour of our attributed `salla-basket-gap::product.added`.
|
|
178
|
+
salla.event.on('cart::before.add.item', this.beforeAddItemHandler);
|
|
179
|
+
this.host.addEventListener('success', this.addButtonSuccessHandler);
|
|
180
|
+
}
|
|
181
|
+
disconnectedCallback() {
|
|
182
|
+
salla.event.off('cart::item.added', this.cartItemChangedHandler);
|
|
183
|
+
salla.event.off('cart::item.deleted', this.cartItemChangedHandler);
|
|
184
|
+
salla.event.off('cart::before.add.item', this.beforeAddItemHandler);
|
|
185
|
+
this.host.removeEventListener('success', this.addButtonSuccessHandler);
|
|
186
|
+
}
|
|
187
|
+
// The recommendation API receives at most 5 cart product IDs, so it can return
|
|
188
|
+
// products that are already in the cart (those beyond the 5-item payload limit).
|
|
189
|
+
// We filter them out here to avoid showing items the customer already has.
|
|
190
|
+
// cartProductIds may be passed in directly from a live event payload; otherwise
|
|
191
|
+
// we fall back to storage (which can lag behind on the initial load path).
|
|
192
|
+
getCartProductIds(knownIds) {
|
|
193
|
+
if (knownIds?.length)
|
|
194
|
+
return new Set(knownIds);
|
|
195
|
+
const cart = salla.storage.get('cart');
|
|
196
|
+
return new Set((cart?.items ?? []).map((i) => String(i.product_id)).filter(Boolean));
|
|
197
|
+
}
|
|
198
|
+
fetchRecommendations(objectIDs) {
|
|
199
|
+
if (!objectIDs.length) {
|
|
200
|
+
this.canRender = false;
|
|
201
|
+
this.isLoading = false;
|
|
202
|
+
return Promise.resolve();
|
|
203
|
+
}
|
|
204
|
+
const generation = ++this.fetchGeneration;
|
|
205
|
+
return fetchCartBoughtTogether(objectIDs)
|
|
206
|
+
.then((ids) => {
|
|
207
|
+
if (generation !== this.fetchGeneration)
|
|
208
|
+
return;
|
|
209
|
+
// Pass objectIDs as the authoritative cart list so the filter is not
|
|
210
|
+
// affected by stale storage when called from a live cart event.
|
|
211
|
+
const cartIds = this.getCartProductIds(objectIDs);
|
|
212
|
+
const filteredIds = ids.filter(id => !cartIds.has(id));
|
|
213
|
+
if (!filteredIds.length) {
|
|
214
|
+
this.canRender = false;
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
return this.fetchProducts(filteredIds.slice(0, this.limit), generation);
|
|
218
|
+
})
|
|
219
|
+
.catch(() => {
|
|
220
|
+
if (generation !== this.fetchGeneration)
|
|
221
|
+
return;
|
|
222
|
+
this.canRender = false;
|
|
223
|
+
})
|
|
224
|
+
.finally(() => {
|
|
225
|
+
if (generation !== this.fetchGeneration)
|
|
226
|
+
return;
|
|
227
|
+
this.isLoading = false;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
fetchProducts(ids, generation) {
|
|
231
|
+
return salla.api.withoutNotifier(() => salla.product.api.fetch({
|
|
232
|
+
source: 'selected',
|
|
233
|
+
source_value: ids,
|
|
234
|
+
limit: this.limit,
|
|
235
|
+
})).then((response) => {
|
|
236
|
+
if (generation !== this.fetchGeneration)
|
|
237
|
+
return;
|
|
238
|
+
this.products = response?.data ?? [];
|
|
239
|
+
this.canRender = this.products.length > 0;
|
|
240
|
+
}).catch(() => {
|
|
241
|
+
if (generation !== this.fetchGeneration)
|
|
242
|
+
return;
|
|
243
|
+
this.canRender = false;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
getDiscountLabel(product) {
|
|
247
|
+
if (product.promotion_title)
|
|
248
|
+
return product.promotion_title;
|
|
249
|
+
if (product.is_on_sale && product.regular_price > 0 && product.sale_price > 0) {
|
|
250
|
+
const percent = Math.round((1 - product.sale_price / product.regular_price) * 100);
|
|
251
|
+
return percent > 0 ? `${this.discountLabel} ${percent}%` : null;
|
|
252
|
+
}
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
formatDate(timestamp) {
|
|
256
|
+
const d = new Date(timestamp * 1000);
|
|
257
|
+
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
|
258
|
+
const dd = String(d.getDate()).padStart(2, '0');
|
|
259
|
+
return `${d.getFullYear()}-${mm}-${dd}`;
|
|
260
|
+
}
|
|
261
|
+
getSkeletonView() {
|
|
262
|
+
return (h(Host, { class: "s-basket-gap-entry" }, h("div", { class: "s-basket-gap-skeleton" }, h("salla-skeleton", { height: "16px", width: "40%", style: { marginBottom: '16px' } }), Array(3).fill(null).map((_, i) => (h("div", { key: i, class: "s-basket-gap-skeleton-card" }, h("salla-skeleton", { height: "64px", width: "64px", style: { borderRadius: '8px', flexShrink: '0' } }), h("div", { class: "s-basket-gap-skeleton-info" }, h("salla-skeleton", { height: "14px", width: "50%" }), h("salla-skeleton", { height: "12px", width: "25%", style: { marginTop: '6px' } }), h("salla-skeleton", { height: "10px", width: "35%", style: { marginTop: '4px' } })), h("salla-skeleton", { height: "36px", width: "100px", style: { borderRadius: '6px', flexShrink: '0', marginInlineStart: 'auto' } })))))));
|
|
263
|
+
}
|
|
264
|
+
getProductCard(product) {
|
|
265
|
+
const discountLabel = this.getDiscountLabel(product);
|
|
266
|
+
return (h("div", { key: product.id, class: "s-basket-gap-card" }, h("a", { href: product.url, class: "s-basket-gap-card-image" }, h("img", { class: "lazy", src: this.placeholder, "data-src": product.image?.url, alt: product.image?.alt || product.name })), h("div", { class: "s-basket-gap-card-info" }, h("h3", { class: "s-basket-gap-card-name" }, h("a", { href: product.url }, product.name)), product.is_on_sale
|
|
267
|
+
? h("div", { class: "s-basket-gap-card-sale-price" }, h("span", { innerHTML: salla.money(product.sale_price) }), h("del", { innerHTML: salla.money(product.regular_price) }))
|
|
268
|
+
: h("span", { class: "s-basket-gap-card-price", innerHTML: salla.money(product.price) }), product.weight_label && (h("span", { class: "s-basket-gap-card-weight" }, this.weightLabel, " ", product.weight_label))), (product.promotion_title || product.discount_ends || product.is_on_sale) && (h("div", { class: "s-basket-gap-card-offer" }, h("i", { class: "sicon-gift" }), discountLabel && h("span", null, discountLabel), product.discount_ends && [
|
|
269
|
+
h("salla-count-down", { date: this.formatDate(product.discount_ends), "end-of-day": true, digits: "en" }),
|
|
270
|
+
h("i", { class: "sicon-alarm" }),
|
|
271
|
+
])), h("salla-add-product-button", { class: "s-basket-gap-card-btn", "product-id": product.id, "product-status": product.status, "product-type": product.type }, this.addToCartLabel)));
|
|
272
|
+
}
|
|
273
|
+
render() {
|
|
274
|
+
if (!this.canRender)
|
|
275
|
+
return null;
|
|
276
|
+
if (this.isLoading)
|
|
277
|
+
return this.getSkeletonView();
|
|
278
|
+
if (!this.products.length)
|
|
279
|
+
return null;
|
|
280
|
+
return (h(Host, { class: "s-basket-gap-entry" }, this.title && h("h2", { class: "s-basket-gap-title" }, this.title), h("div", { class: "s-basket-gap-list" }, this.products.map(product => this.getProductCard(product)))));
|
|
281
|
+
}
|
|
282
|
+
get host() { return this; }
|
|
283
|
+
static get style() { return sallaBasketGapCss; }
|
|
284
|
+
}, [0, "salla-basket-gap", {
|
|
285
|
+
"limit": [2],
|
|
286
|
+
"products": [32],
|
|
287
|
+
"isLoading": [32],
|
|
288
|
+
"canRender": [32],
|
|
289
|
+
"title": [32],
|
|
290
|
+
"addToCartLabel": [32],
|
|
291
|
+
"weightLabel": [32],
|
|
292
|
+
"discountLabel": [32]
|
|
293
|
+
}]);
|
|
294
|
+
function defineCustomElement$1() {
|
|
295
|
+
if (typeof customElements === "undefined") {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const components = ["salla-basket-gap", "salla-add-product-button", "salla-booking-field", "salla-button", "salla-color-picker", "salla-conditional-fields", "salla-count-down", "salla-datetime-picker", "salla-file-upload", "salla-loading", "salla-map", "salla-modal", "salla-order-options-modal", "salla-product-availability", "salla-product-options", "salla-progress-bar", "salla-quick-buy", "salla-skeleton", "salla-tel-input"];
|
|
299
|
+
components.forEach(tagName => { switch (tagName) {
|
|
300
|
+
case "salla-basket-gap":
|
|
301
|
+
if (!customElements.get(tagName)) {
|
|
302
|
+
customElements.define(tagName, SallaBasketGap$1);
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
305
|
+
case "salla-add-product-button":
|
|
306
|
+
if (!customElements.get(tagName)) {
|
|
307
|
+
defineCustomElement$j();
|
|
308
|
+
}
|
|
309
|
+
break;
|
|
310
|
+
case "salla-booking-field":
|
|
311
|
+
if (!customElements.get(tagName)) {
|
|
312
|
+
defineCustomElement$i();
|
|
313
|
+
}
|
|
314
|
+
break;
|
|
315
|
+
case "salla-button":
|
|
316
|
+
if (!customElements.get(tagName)) {
|
|
317
|
+
defineCustomElement$h();
|
|
318
|
+
}
|
|
319
|
+
break;
|
|
320
|
+
case "salla-color-picker":
|
|
321
|
+
if (!customElements.get(tagName)) {
|
|
322
|
+
defineCustomElement$g();
|
|
323
|
+
}
|
|
324
|
+
break;
|
|
325
|
+
case "salla-conditional-fields":
|
|
326
|
+
if (!customElements.get(tagName)) {
|
|
327
|
+
defineCustomElement$f();
|
|
328
|
+
}
|
|
329
|
+
break;
|
|
330
|
+
case "salla-count-down":
|
|
331
|
+
if (!customElements.get(tagName)) {
|
|
332
|
+
defineCustomElement$e();
|
|
333
|
+
}
|
|
334
|
+
break;
|
|
335
|
+
case "salla-datetime-picker":
|
|
336
|
+
if (!customElements.get(tagName)) {
|
|
337
|
+
defineCustomElement$d();
|
|
338
|
+
}
|
|
339
|
+
break;
|
|
340
|
+
case "salla-file-upload":
|
|
341
|
+
if (!customElements.get(tagName)) {
|
|
342
|
+
defineCustomElement$c();
|
|
343
|
+
}
|
|
344
|
+
break;
|
|
345
|
+
case "salla-loading":
|
|
346
|
+
if (!customElements.get(tagName)) {
|
|
347
|
+
defineCustomElement$b();
|
|
348
|
+
}
|
|
349
|
+
break;
|
|
350
|
+
case "salla-map":
|
|
351
|
+
if (!customElements.get(tagName)) {
|
|
352
|
+
defineCustomElement$a();
|
|
353
|
+
}
|
|
354
|
+
break;
|
|
355
|
+
case "salla-modal":
|
|
356
|
+
if (!customElements.get(tagName)) {
|
|
357
|
+
defineCustomElement$9();
|
|
358
|
+
}
|
|
359
|
+
break;
|
|
360
|
+
case "salla-order-options-modal":
|
|
361
|
+
if (!customElements.get(tagName)) {
|
|
362
|
+
defineCustomElement$8();
|
|
363
|
+
}
|
|
364
|
+
break;
|
|
365
|
+
case "salla-product-availability":
|
|
366
|
+
if (!customElements.get(tagName)) {
|
|
367
|
+
defineCustomElement$7();
|
|
368
|
+
}
|
|
369
|
+
break;
|
|
370
|
+
case "salla-product-options":
|
|
371
|
+
if (!customElements.get(tagName)) {
|
|
372
|
+
defineCustomElement$6();
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
case "salla-progress-bar":
|
|
376
|
+
if (!customElements.get(tagName)) {
|
|
377
|
+
defineCustomElement$5();
|
|
378
|
+
}
|
|
379
|
+
break;
|
|
380
|
+
case "salla-quick-buy":
|
|
381
|
+
if (!customElements.get(tagName)) {
|
|
382
|
+
defineCustomElement$4();
|
|
383
|
+
}
|
|
384
|
+
break;
|
|
385
|
+
case "salla-skeleton":
|
|
386
|
+
if (!customElements.get(tagName)) {
|
|
387
|
+
defineCustomElement$3();
|
|
388
|
+
}
|
|
389
|
+
break;
|
|
390
|
+
case "salla-tel-input":
|
|
391
|
+
if (!customElements.get(tagName)) {
|
|
392
|
+
defineCustomElement$2();
|
|
393
|
+
}
|
|
394
|
+
break;
|
|
395
|
+
} });
|
|
396
|
+
}
|
|
397
|
+
defineCustomElement$1();
|
|
398
|
+
|
|
399
|
+
const SallaBasketGap = SallaBasketGap$1;
|
|
400
|
+
const defineCustomElement = defineCustomElement$1;
|
|
401
|
+
|
|
402
|
+
export { SallaBasketGap, defineCustomElement };
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { a as fetchProductCustomersAlsoBought } from './catalog-recommendations.js';
|
|
5
6
|
import { d as defineCustomElement$3 } from './salla-button2.js';
|
|
6
7
|
import { d as defineCustomElement$2 } from './salla-skeleton2.js';
|
|
7
8
|
|
|
8
9
|
const sallaBoughtTogetherCss = ":host{display:block}.s-bought-together-checkbox:checked~.s-bought-together-checkmark{background-color:var(--color-primary, #2ECC71);border-color:var(--color-primary, #2ECC71)}.s-bought-together-checkbox:checked~.s-bought-together-checkmark::after{content:\"\";display:block;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);margin-top:-2px}";
|
|
9
10
|
|
|
10
|
-
// Read-only recommendations key confirmed safe for client-side use by the API team — no write access or sensitive scope.
|
|
11
|
-
const XSELL_API_KEY = 'VOL5WaZu2YROp0RplCZAr1RplhL9FFGQ';
|
|
12
11
|
const SallaBoughtTogether$1 = /*@__PURE__*/ proxyCustomElement(class SallaBoughtTogether extends HTMLElement {
|
|
13
12
|
constructor() {
|
|
14
13
|
super();
|
|
@@ -46,25 +45,14 @@ const SallaBoughtTogether$1 = /*@__PURE__*/ proxyCustomElement(class SallaBought
|
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
47
|
this.resolvedProductId = id;
|
|
49
|
-
return
|
|
50
|
-
requests: [{
|
|
51
|
-
indexName: 'products',
|
|
52
|
-
model: 'xsell-v1',
|
|
53
|
-
priceThreshold: 2,
|
|
54
|
-
objectID: String(id),
|
|
55
|
-
maxRecommendations: this.limit,
|
|
56
|
-
}]
|
|
57
|
-
}, 'post', { headers: { 'X-Algolia-Api-Key': XSELL_API_KEY, 'X-Query-Enrichment': 'false', 'X-source': 'store' } });
|
|
48
|
+
return fetchProductCustomersAlsoBought(String(id));
|
|
58
49
|
})
|
|
59
|
-
.then((
|
|
60
|
-
if (!
|
|
61
|
-
return;
|
|
62
|
-
const hits = response?.results?.[0]?.hits ?? [];
|
|
63
|
-
if (!hits.length) {
|
|
50
|
+
.then((recommendedIds) => {
|
|
51
|
+
if (!recommendedIds?.length) {
|
|
64
52
|
this.canRender = false;
|
|
65
53
|
return;
|
|
66
54
|
}
|
|
67
|
-
const ids = [String(this.resolvedProductId), ...
|
|
55
|
+
const ids = [String(this.resolvedProductId), ...recommendedIds.slice(0, this.limit)];
|
|
68
56
|
return salla.product.fetch({ source: 'selected', source_value: ids });
|
|
69
57
|
})
|
|
70
58
|
.then((response) => {
|