@salla.sa/twilight-components 3.0.17 → 3.0.18
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/{Helper-DSYelC4c.js → Helper-D2VNt6eb.js} +1 -1
- package/dist/cjs/{filepond-l9D0Yv7b.js → filepond-DkCudLhG.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-8SrbLptI.js → filepond-plugin-file-poster-C-uxFWfW.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DGD6oJy0.js → filepond-plugin-file-validate-size-BikXTQW2.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BIvrhp3w.js → filepond-plugin-file-validate-type-Drs7PouU.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-4xKikdXG.js → filepond-plugin-image-edit-hxr0h9kt.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-C3BvwxQh.js → filepond-plugin-image-exif-orientation-CVZmWU_4.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CBq_GY0V.js → filepond-plugin-image-preview-CBjPKx-d.js} +1 -1
- package/dist/cjs/free-shipping-timer-6QBe5BNS.js +156 -0
- package/dist/cjs/{index-BAwxpXnB.js → index-CTYg2zC6.js} +2 -2
- package/dist/cjs/{intlTelInput-xw-HaAEN.js → intlTelInput-C9X0hKXV.js} +1 -1
- 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 +2 -2
- 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-applied-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +166 -16
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
- 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_9.cjs.entry.js +2 -2
- 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.cjs.entry.js +1 -1
- 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 +2 -2
- package/dist/cjs/salla-filters.cjs.entry.js +2 -2
- package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +95 -9
- package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +18 -5
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +13 -6
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +2 -2
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +6 -5
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
- package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +7 -4
- package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +2 -2
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
- package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-Cm_uNdps.js → vanilla-picker-BsLm8rHT.js} +1 -1
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +72 -16
- package/dist/collection/components/salla-bullet-delivery/selector-tracker.js +106 -0
- package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.css +18 -4
- package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.js +94 -11
- package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.css +6 -0
- package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.js +18 -2
- package/dist/collection/components/salla-gifting/salla-gifting.css +16 -1
- package/dist/collection/components/salla-gifting/salla-gifting.js +11 -4
- package/dist/collection/components/salla-products-list/salla-products-list.js +4 -3
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +5 -2
- package/dist/collection/shared/free-shipping-timer.js +130 -0
- package/dist/components/free-shipping-timer.js +150 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-bullet-delivery.js +165 -15
- package/dist/components/salla-free-shipping-banner.js +95 -8
- package/dist/components/salla-free-shipping-tag.js +17 -3
- package/dist/components/salla-gifting.js +12 -5
- package/dist/components/salla-products-list2.js +4 -3
- package/dist/components/salla-rating-modal-v22.js +5 -2
- package/dist/docs.json +25 -5
- package/dist/esm/{Helper-POCi7J93.js → Helper-C1T-oD4J.js} +1 -1
- package/dist/esm/{filepond-Ct76xW02.js → filepond-BoWJzHeN.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-C1OkzGRs.js → filepond-plugin-file-poster-B6MkMtuC.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-gdd-69cO.js → filepond-plugin-file-validate-size-Dds_462B.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BaZ2QTzl.js → filepond-plugin-file-validate-type-DrfGXNay.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CsoNvf0i.js → filepond-plugin-image-edit-CN7eGg-7.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-BHDSe3nH.js → filepond-plugin-image-exif-orientation-CyhxK_6R.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CD_S17z3.js → filepond-plugin-image-preview-DdKqAzT9.js} +1 -1
- package/dist/esm/free-shipping-timer-CnTwkF6y.js +150 -0
- package/dist/esm/{index-DmGAR42j.js → index-DgUQRYr2.js} +2 -2
- package/dist/esm/{intlTelInput-D76Q4XFx.js → intlTelInput-SwlavcFB.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 +2 -2
- 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-applied-filters.entry.js +2 -2
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +11 -11
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +166 -16
- package/dist/esm/salla-cart-coupons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
- 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_9.entry.js +2 -2
- 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.entry.js +1 -1
- 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 +2 -2
- package/dist/esm/salla-filters.entry.js +2 -2
- package/dist/esm/salla-free-shipping-banner.entry.js +94 -8
- package/dist/esm/salla-free-shipping-tag.entry.js +17 -4
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +13 -6
- package/dist/esm/salla-hook.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +2 -2
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-list-tile.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_3.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item_2.entry.js +2 -2
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/salla-order-edit-item.entry.js +1 -1
- package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
- package/dist/esm/salla-order-edit.entry.js +1 -1
- package/dist/esm/salla-order-items.entry.js +1 -1
- package/dist/esm/salla-order-options-modal.entry.js +1 -1
- package/dist/esm/salla-order-payment.entry.js +1 -1
- package/dist/esm/salla-order-rewards.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +2 -2
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +6 -5
- package/dist/esm/salla-products-slider.entry.js +2 -2
- package/dist/esm/salla-quick-order.entry.js +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +7 -4
- package/dist/esm/salla-rating-modal.entry.js +2 -2
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search-product-card.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +2 -2
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +1 -1
- package/dist/esm/salla-thank-you-header.entry.js +1 -1
- package/dist/esm/salla-thank-you-page.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/salla-wishlist-summary.entry.js +2 -2
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-BlIXJyvJ.js → vanilla-picker-Buy50D7t.js} +1 -1
- package/dist/twilight/{p-4702959a.entry.js → p-027cbda6.entry.js} +1 -1
- package/dist/twilight/{p-e89a1905.entry.js → p-0418c2df.entry.js} +1 -1
- package/dist/twilight/{p-6757344a.entry.js → p-071aa0e7.entry.js} +1 -1
- package/dist/twilight/{p-a53e2c74.entry.js → p-08a15c81.entry.js} +1 -1
- package/dist/twilight/{p-acd48ae7.entry.js → p-0ba159db.entry.js} +1 -1
- package/dist/twilight/{p-a17784e6.entry.js → p-0d795b58.entry.js} +1 -1
- package/dist/twilight/{p-e81c4521.entry.js → p-0f25fedd.entry.js} +1 -1
- package/dist/twilight/{p-26fec98c.entry.js → p-12a25415.entry.js} +1 -1
- package/dist/twilight/p-1960020c.entry.js +4 -0
- package/dist/twilight/{p-b38c38fe.entry.js → p-1af9db24.entry.js} +1 -1
- package/dist/twilight/{p-24423a8d.entry.js → p-23772523.entry.js} +1 -1
- package/dist/twilight/{p-1982520c.entry.js → p-254cff9a.entry.js} +1 -1
- package/dist/twilight/{p-0225f396.entry.js → p-259c995a.entry.js} +1 -1
- package/dist/twilight/{p-7df4ee74.entry.js → p-26d2b28a.entry.js} +1 -1
- package/dist/twilight/{p-7a985c8c.entry.js → p-34148827.entry.js} +1 -1
- package/dist/twilight/{p-a5d2ad5e.entry.js → p-361f6033.entry.js} +1 -1
- package/dist/twilight/{p-ae9c0abe.entry.js → p-37192614.entry.js} +1 -1
- package/dist/twilight/{p-66f6d722.entry.js → p-3a632c69.entry.js} +1 -1
- package/dist/twilight/{p-14752d03.entry.js → p-3d8b77f7.entry.js} +1 -1
- package/dist/twilight/{p-4839d408.entry.js → p-3f842f32.entry.js} +1 -1
- package/dist/twilight/{p-c3c99d9e.entry.js → p-419d6d71.entry.js} +1 -1
- package/dist/twilight/{p-fae2a8d0.entry.js → p-481f52b1.entry.js} +1 -1
- package/dist/twilight/{p-b819de23.entry.js → p-487b4411.entry.js} +1 -1
- package/dist/twilight/{p-d495cce0.entry.js → p-4891c565.entry.js} +1 -1
- package/dist/twilight/{p-83ccad19.entry.js → p-4a3fa153.entry.js} +1 -1
- package/dist/twilight/{p-4057b692.entry.js → p-4ab5ee99.entry.js} +1 -1
- package/dist/twilight/{p-e5545546.entry.js → p-4b70e6c4.entry.js} +1 -1
- package/dist/twilight/{p-5d4fadd2.entry.js → p-516e4edc.entry.js} +1 -1
- package/dist/twilight/{p-90d4129f.entry.js → p-53735934.entry.js} +1 -1
- package/dist/twilight/{p-d68625f7.entry.js → p-5694edf1.entry.js} +1 -1
- package/dist/twilight/{p-7750bace.entry.js → p-5bbf17dd.entry.js} +1 -1
- package/dist/twilight/{p-783c6346.entry.js → p-5e8d019e.entry.js} +1 -1
- package/dist/twilight/{p-fce39869.entry.js → p-5f6fee0e.entry.js} +1 -1
- package/dist/twilight/{p-f10b887a.entry.js → p-66ad7a30.entry.js} +1 -1
- package/dist/twilight/{p-5d775867.entry.js → p-6af8a7b6.entry.js} +1 -1
- package/dist/twilight/{p-b66df976.entry.js → p-6b5de500.entry.js} +1 -1
- package/dist/twilight/{p-120b4694.entry.js → p-6ba3808a.entry.js} +1 -1
- package/dist/twilight/{p-3d5e862c.entry.js → p-6c3084c9.entry.js} +1 -1
- package/dist/twilight/{p-dc3ff1f0.entry.js → p-6dccd40f.entry.js} +1 -1
- package/dist/twilight/{p-bfb70998.entry.js → p-6e52b649.entry.js} +1 -1
- package/dist/twilight/{p-62ba0971.entry.js → p-70dfb2b4.entry.js} +1 -1
- package/dist/twilight/{p-f8ff074f.entry.js → p-76584a5b.entry.js} +1 -1
- package/dist/twilight/{p-2e8f95d0.entry.js → p-78a56dc6.entry.js} +1 -1
- package/dist/twilight/{p-eb160c2e.entry.js → p-79822d99.entry.js} +1 -1
- package/dist/twilight/{p-8b43035f.entry.js → p-7b5f97e7.entry.js} +1 -1
- package/dist/twilight/{p-2a3e2404.entry.js → p-7f97335a.entry.js} +1 -1
- package/dist/twilight/{p-184ea04c.entry.js → p-7fd9dc36.entry.js} +1 -1
- package/dist/twilight/p-84b0e7a9.entry.js +4 -0
- package/dist/twilight/p-8766e236.entry.js +4 -0
- package/dist/twilight/{p-622bfb21.entry.js → p-8c1d14f0.entry.js} +1 -1
- package/dist/twilight/{p-20939237.entry.js → p-8c40278d.entry.js} +1 -1
- package/dist/twilight/{p-f9b9af72.entry.js → p-92fd20a0.entry.js} +1 -1
- package/dist/twilight/{p-33ff7967.entry.js → p-9cf1cfd4.entry.js} +1 -1
- package/dist/twilight/{p-7e854633.entry.js → p-9d15f22d.entry.js} +1 -1
- package/dist/twilight/{p-9eb92980.entry.js → p-9e042cce.entry.js} +1 -1
- package/dist/twilight/{p-cc2c52bb.entry.js → p-9e0a9a5a.entry.js} +1 -1
- package/dist/twilight/{p-f034968b.entry.js → p-9e65451e.entry.js} +1 -1
- package/dist/twilight/{p-iCJI7qYe.js → p-BK9YeXWp.js} +1 -1
- package/dist/twilight/{p-Dhq3oJAe.js → p-BxQMWsr9.js} +1 -1
- package/dist/twilight/{p-CAc7tX2K.js → p-CBLWEyM9.js} +1 -1
- package/dist/twilight/{p-BbZqYBfp.js → p-CCwsxMbZ.js} +1 -1
- package/dist/twilight/{p-Nyk6-1lq.js → p-Ca_SZn0u.js} +1 -1
- package/dist/twilight/{p-BwzmoZpm.js → p-CgNJWeaK.js} +1 -1
- package/dist/twilight/p-CnTwkF6y.js +4 -0
- package/dist/twilight/{p-B7rn1taO.js → p-DMvhNbgN.js} +1 -1
- package/dist/twilight/{p-DVWVl151.js → p-De1tLqQF.js} +1 -1
- package/dist/twilight/{p-DmGAR42j.js → p-DgUQRYr2.js} +1 -1
- package/dist/twilight/{p-De2wEjqS.js → p-NqQdbGu6.js} +1 -1
- package/dist/twilight/{p-Dza6OBFg.js → p-Y2ZIN9Ok.js} +1 -1
- package/dist/twilight/{p-6c7cae8a.entry.js → p-a44670a9.entry.js} +1 -1
- package/dist/twilight/{p-509ad773.entry.js → p-a5b732b3.entry.js} +1 -1
- package/dist/twilight/{p-2153c6fd.entry.js → p-a95b0dc1.entry.js} +1 -1
- package/dist/twilight/{p-37b68ef3.entry.js → p-aa35cf98.entry.js} +1 -1
- package/dist/twilight/{p-d6c5bf2a.entry.js → p-ac736b30.entry.js} +1 -1
- package/dist/twilight/{p-d2c1457e.entry.js → p-af49191f.entry.js} +1 -1
- package/dist/twilight/{p-8b39a9f7.entry.js → p-b0d2e31f.entry.js} +1 -1
- package/dist/twilight/{p-31260fae.entry.js → p-b1f808f5.entry.js} +1 -1
- package/dist/twilight/{p-60f4357f.entry.js → p-b3ada3d0.entry.js} +1 -1
- package/dist/twilight/{p-4a1aa85f.entry.js → p-b5a45f87.entry.js} +1 -1
- package/dist/twilight/p-b9d67694.entry.js +4 -0
- package/dist/twilight/{p-64d49f5d.entry.js → p-ba6dd59c.entry.js} +1 -1
- package/dist/twilight/p-bac25e34.entry.js +4 -0
- package/dist/twilight/{p-fed66bcb.entry.js → p-bb8b2c85.entry.js} +1 -1
- package/dist/twilight/{p-49195cb6.entry.js → p-be6f8551.entry.js} +1 -1
- package/dist/twilight/{p-84d725d4.entry.js → p-bed54154.entry.js} +1 -1
- package/dist/twilight/{p-2a8d6e7e.entry.js → p-bed68e52.entry.js} +1 -1
- package/dist/twilight/{p-d63ce284.entry.js → p-bfd5e263.entry.js} +1 -1
- package/dist/twilight/{p-cd866be6.entry.js → p-c4cf0b4d.entry.js} +1 -1
- package/dist/twilight/{p-fe413496.entry.js → p-cb48a5ef.entry.js} +1 -1
- package/dist/twilight/{p-74f206cf.entry.js → p-cdeb9bcc.entry.js} +1 -1
- package/dist/twilight/{p-8e8e40bc.entry.js → p-d0aeeb7f.entry.js} +1 -1
- package/dist/twilight/{p-8f0af317.entry.js → p-d0ff9a3e.entry.js} +1 -1
- package/dist/twilight/{p-e8090773.entry.js → p-d1093a59.entry.js} +1 -1
- package/dist/twilight/{p-86ca22d5.entry.js → p-d1121b3f.entry.js} +1 -1
- package/dist/twilight/{p-3a3d4cb7.entry.js → p-d1204965.entry.js} +1 -1
- package/dist/twilight/p-d346dabd.entry.js +4 -0
- package/dist/twilight/{p-0a794d6f.entry.js → p-d4fb9921.entry.js} +1 -1
- package/dist/twilight/{p-4c801f91.entry.js → p-d8955835.entry.js} +1 -1
- package/dist/twilight/{p-f4411a04.entry.js → p-d9a1bf08.entry.js} +1 -1
- package/dist/twilight/{p-0c6a024f.entry.js → p-da0df10b.entry.js} +1 -1
- package/dist/twilight/p-e24fbbb4.entry.js +4 -0
- package/dist/twilight/{p-07450aed.entry.js → p-e38a6793.entry.js} +1 -1
- package/dist/twilight/{p-0e1248c4.entry.js → p-e457e68f.entry.js} +1 -1
- package/dist/twilight/{p-cd7029fc.entry.js → p-e9b03e9c.entry.js} +1 -1
- package/dist/twilight/{p-b9695308.entry.js → p-eaf0c514.entry.js} +1 -1
- package/dist/twilight/{p-b87ea253.entry.js → p-ee479819.entry.js} +1 -1
- package/dist/twilight/p-ee65c489.entry.js +4 -0
- package/dist/twilight/{p-7d337f25.entry.js → p-eefced26.entry.js} +1 -1
- package/dist/twilight/{p-a0a57259.entry.js → p-f7a58656.entry.js} +1 -1
- package/dist/twilight/{p-bf29daf3.entry.js → p-f7ab5825.entry.js} +1 -1
- package/dist/twilight/{p-57b93850.entry.js → p-f9587127.entry.js} +1 -1
- package/dist/twilight/{p-89cff0c8.entry.js → p-f9e5ed10.entry.js} +1 -1
- package/dist/twilight/{p-e4d90663.entry.js → p-fcb1009f.entry.js} +1 -1
- package/dist/twilight/{p-4f794057.entry.js → p-fddf1997.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +9 -1
- package/dist/types/components/salla-bullet-delivery/selector-tracker.d.ts +30 -0
- package/dist/types/components/salla-free-shipping-banner/salla-free-shipping-banner.d.ts +19 -5
- package/dist/types/components/salla-free-shipping-tag/salla-free-shipping-tag.d.ts +6 -1
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +1 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +1 -0
- package/dist/types/components.d.ts +11 -25
- package/dist/types/shared/free-shipping-timer.d.ts +36 -0
- package/package.json +5 -5
- package/dist/cjs/free-shipping-DkIKD6ch.js +0 -31
- package/dist/components/free-shipping.js +0 -29
- package/dist/esm/free-shipping-Brg4wsgg.js +0 -29
- package/dist/twilight/p-12a8aed8.entry.js +0 -4
- package/dist/twilight/p-40083f25.entry.js +0 -4
- package/dist/twilight/p-4f443e36.entry.js +0 -4
- package/dist/twilight/p-5b81a3d9.entry.js +0 -4
- package/dist/twilight/p-93f26336.entry.js +0 -4
- package/dist/twilight/p-Brg4wsgg.js +0 -4
- package/dist/twilight/p-bab5d057.entry.js +0 -4
- package/dist/twilight/p-c7c868b4.entry.js +0 -4
- package/dist/twilight/p-d5a2ba68.entry.js +0 -4
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
const cache = new Map();
|
|
7
|
+
async function request(productId) {
|
|
8
|
+
const endpoint = 'products/eligible-for-free-shipping' + (productId ? `/${productId}` : '');
|
|
9
|
+
try {
|
|
10
|
+
// 403 (feature off or plan not supported) and 410 (product gone) mean "not eligible",
|
|
11
|
+
// not a failure worth a toast.
|
|
12
|
+
const response = await salla.api.withoutNotifier(() => salla.api.request(endpoint));
|
|
13
|
+
return response?.data?.eligible === true;
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Whether free shipping applies: to the store when no product is given (banner),
|
|
21
|
+
* or to the product (tag, product page banner). Same calls share one request.
|
|
22
|
+
*/
|
|
23
|
+
function isEligibleForFreeShipping(productId) {
|
|
24
|
+
const key = String(productId ?? '');
|
|
25
|
+
if (!cache.has(key)) {
|
|
26
|
+
cache.set(key, request(productId));
|
|
27
|
+
}
|
|
28
|
+
return cache.get(key);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const HOUR = 60 * 60 * 1000;
|
|
32
|
+
const DAY = 24 * HOUR;
|
|
33
|
+
const MAX_TIMEOUT = 2 ** 31 - 1;
|
|
34
|
+
// Used only when storage is not available (private mode, blocked site data).
|
|
35
|
+
let memoryStartedAt = null;
|
|
36
|
+
const DEFAULT_COUNTDOWN_HOURS = 45;
|
|
37
|
+
const DEFAULT_HIDDEN_DAYS = 7;
|
|
38
|
+
const positive = (value, fallback) => {
|
|
39
|
+
const number = Number(value);
|
|
40
|
+
return Number.isFinite(number) && number > 0 ? number : fallback;
|
|
41
|
+
};
|
|
42
|
+
/** The countdown and hidden period, from the store settings with 45 hours and 7 days as the fallback. */
|
|
43
|
+
function getTimerSettings() {
|
|
44
|
+
const settings = salla.config?.get?.('store.settings.free_shipping_banner');
|
|
45
|
+
return {
|
|
46
|
+
countdownMs: positive(settings?.countdown_hours, DEFAULT_COUNTDOWN_HOURS) * HOUR,
|
|
47
|
+
hiddenMs: positive(settings?.hidden_days, DEFAULT_HIDDEN_DAYS) * DAY,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** The timer exists only for visitors the backend allowed the banner for. */
|
|
51
|
+
function isTimerEnabled() {
|
|
52
|
+
return !!salla.config?.get?.('store.features')?.includes('free-shipping-banner');
|
|
53
|
+
}
|
|
54
|
+
const storageKey = () => `free-shipping-timer_${salla.config?.get?.('store.id')}`;
|
|
55
|
+
/** When the visitor first saw the banner, or null if they have not yet. */
|
|
56
|
+
function getStartedAt() {
|
|
57
|
+
try {
|
|
58
|
+
const stored = Number(salla.storage.get(storageKey()));
|
|
59
|
+
if (Number.isFinite(stored) && stored > 0) {
|
|
60
|
+
return stored;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
// fall through to the in-memory value
|
|
65
|
+
}
|
|
66
|
+
return memoryStartedAt;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Records the first time the visitor saw the banner. Does nothing when it is already recorded
|
|
70
|
+
* or when the feature is off.
|
|
71
|
+
*/
|
|
72
|
+
function startTimerIfNeeded(now = Date.now()) {
|
|
73
|
+
if (!isTimerEnabled()) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const existing = getStartedAt();
|
|
77
|
+
if (existing) {
|
|
78
|
+
return existing;
|
|
79
|
+
}
|
|
80
|
+
memoryStartedAt = now;
|
|
81
|
+
try {
|
|
82
|
+
salla.storage.set(storageKey(), now);
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
// keep the in-memory value
|
|
86
|
+
}
|
|
87
|
+
schedule();
|
|
88
|
+
notify();
|
|
89
|
+
return now;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Where the visitor is in the repeating cycle: `countdown` visible, then `hidden` hidden, again and again.
|
|
93
|
+
* Nothing but the first-seen time is stored, so changed settings apply on the next check.
|
|
94
|
+
*/
|
|
95
|
+
function computeTimerState(startedAt, now, countdownMs, hiddenMs) {
|
|
96
|
+
const elapsed = Math.max(0, now - startedAt);
|
|
97
|
+
const position = elapsed % (countdownMs + hiddenMs);
|
|
98
|
+
if (position < countdownMs) {
|
|
99
|
+
return { visible: true, remainingMs: countdownMs - position, nextChangeMs: countdownMs - position };
|
|
100
|
+
}
|
|
101
|
+
return { visible: false, remainingMs: 0, nextChangeMs: countdownMs + hiddenMs - position };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The state the banner and tags follow. `null` means there is nothing to follow: the feature is off
|
|
105
|
+
* or the visitor has not seen the banner yet.
|
|
106
|
+
*/
|
|
107
|
+
function getFreeShippingTimerState(now = Date.now()) {
|
|
108
|
+
if (!isTimerEnabled()) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const startedAt = getStartedAt();
|
|
112
|
+
if (!startedAt) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const { countdownMs, hiddenMs } = getTimerSettings();
|
|
116
|
+
return computeTimerState(startedAt, now, countdownMs, hiddenMs);
|
|
117
|
+
}
|
|
118
|
+
const listeners = new Set();
|
|
119
|
+
let timeout;
|
|
120
|
+
function notify() {
|
|
121
|
+
listeners.forEach((listener) => listener());
|
|
122
|
+
}
|
|
123
|
+
// One timeout for the whole page, set for the next visible/hidden change.
|
|
124
|
+
function schedule() {
|
|
125
|
+
clearTimeout(timeout);
|
|
126
|
+
timeout = undefined;
|
|
127
|
+
if (!listeners.size) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const state = getFreeShippingTimerState();
|
|
131
|
+
if (!state) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
timeout = setTimeout(() => {
|
|
135
|
+
notify();
|
|
136
|
+
schedule();
|
|
137
|
+
}, Math.min(state.nextChangeMs + 50, MAX_TIMEOUT));
|
|
138
|
+
}
|
|
139
|
+
/** Calls back whenever the banner and tags have to show or hide. Returns the unsubscribe function. */
|
|
140
|
+
function subscribeToFreeShippingTimer(listener) {
|
|
141
|
+
listeners.add(listener);
|
|
142
|
+
schedule();
|
|
143
|
+
return () => {
|
|
144
|
+
listeners.delete(listener);
|
|
145
|
+
if (!listeners.size) {
|
|
146
|
+
clearTimeout(timeout);
|
|
147
|
+
timeout = undefined;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
exports.getFreeShippingTimerState = getFreeShippingTimerState;
|
|
153
|
+
exports.isEligibleForFreeShipping = isEligibleForFreeShipping;
|
|
154
|
+
exports.isTimerEnabled = isTimerEnabled;
|
|
155
|
+
exports.startTimerIfNeeded = startTimerIfNeeded;
|
|
156
|
+
exports.subscribeToFreeShippingTimer = subscribeToFreeShippingTimer;
|