@salla.sa/twilight-components 3.0.30 → 3.0.31
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-CigI49vP.js → Helper-BhBYMWEC.js} +1 -1
- package/dist/cjs/coupons-request-CF_Z3OPL.js +57 -0
- package/dist/cjs/{filepond-BiMGitQY.js → filepond-U_cpW5LY.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-Ck74ON7P.js → filepond-plugin-file-poster-j3A0G9wx.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-CVhF1tOl.js → filepond-plugin-file-validate-size-p1uylMZh.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-Dl1QbcFU.js → filepond-plugin-file-validate-type-Dw8lGbpV.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-fNw4v5VI.js → filepond-plugin-image-edit-dT6Tl8ni.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-K26RIxgg.js → filepond-plugin-image-exif-orientation-_4wurzkP.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DUPpLMnJ.js → filepond-plugin-image-preview-DxF89SF4.js} +1 -1
- package/dist/cjs/{index-BC6gcbLd.js → index-DHGhTYkj.js} +6 -6
- package/dist/cjs/{intlTelInput-PXq8m_uI.js → intlTelInput-DKoKXEG1.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 +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +12 -50
- 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 +1 -1
- package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
- 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 +1 -1
- 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-mobile-update-modal.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 +9 -2
- 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 +2 -2
- 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 +2 -2
- 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-BtI42wjx.js → vanilla-picker-Cr_cWLy_.js} +1 -1
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +10 -4
- package/dist/collection/components/salla-next-order-coupon/salla-next-order-coupon.css +3 -0
- package/dist/collection/components/salla-next-order-coupon/salla-next-order-coupon.js +7 -0
- package/dist/collection/shared/coupons-request.js +5 -0
- package/dist/components/coupons-request.js +54 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-cart-coupons.js +10 -48
- package/dist/components/salla-next-order-coupon.js +8 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{Helper-Xo2bQXZz.js → Helper-Cs3rNokA.js} +1 -1
- package/dist/esm/coupons-request-Cx3AzTeQ.js +54 -0
- package/dist/esm/{filepond-CnC-Gw5u.js → filepond-BZyp1-48.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-Tq5buhXU.js → filepond-plugin-file-poster-CoMNDYop.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Fvp89fAI.js → filepond-plugin-file-validate-size-debOeTrR.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-0J-wZKP5.js → filepond-plugin-file-validate-type-dSGCeVlZ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BGdpmDUz.js → filepond-plugin-image-edit-CsBgEE7e.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-gP2ZIc0I.js → filepond-plugin-image-exif-orientation-OC83qIAb.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DEn_x6Op.js → filepond-plugin-image-preview-Cmp7AK_B.js} +1 -1
- package/dist/esm/{index-BXSGktmF.js → index-lS_doykN.js} +6 -6
- package/dist/esm/{intlTelInput-D7f8BwQF.js → intlTelInput-BrPGHjwa.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 +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +11 -49
- 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 +1 -1
- package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
- 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 +1 -1
- 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-mobile-update-modal.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 +9 -2
- 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 +2 -2
- 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 +2 -2
- 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-Dwx-r_Pm.js → vanilla-picker-BIJ7ohOS.js} +1 -1
- package/dist/twilight/{p-e080de31.entry.js → p-000146e8.entry.js} +1 -1
- package/dist/twilight/{p-6905f49b.entry.js → p-01b91d24.entry.js} +1 -1
- package/dist/twilight/{p-9ef88bed.entry.js → p-026e0af4.entry.js} +1 -1
- package/dist/twilight/{p-23a82841.entry.js → p-052cb03f.entry.js} +1 -1
- package/dist/twilight/{p-8a74ba4a.entry.js → p-05df663b.entry.js} +1 -1
- package/dist/twilight/{p-a2dd20a2.entry.js → p-064a9bec.entry.js} +1 -1
- package/dist/twilight/{p-d3865329.entry.js → p-07f5a27d.entry.js} +1 -1
- package/dist/twilight/p-088cef29.entry.js +4 -0
- package/dist/twilight/{p-708b76ba.entry.js → p-0933a118.entry.js} +1 -1
- package/dist/twilight/{p-bd7d60a4.entry.js → p-0c32297c.entry.js} +1 -1
- package/dist/twilight/{p-deca2029.entry.js → p-0fd67b7d.entry.js} +1 -1
- package/dist/twilight/{p-13c2fb33.entry.js → p-1434b948.entry.js} +1 -1
- package/dist/twilight/{p-c97764b4.entry.js → p-16d7cc24.entry.js} +1 -1
- package/dist/twilight/{p-be1ab62d.entry.js → p-18396456.entry.js} +1 -1
- package/dist/twilight/{p-a63881bf.entry.js → p-187b5e74.entry.js} +1 -1
- package/dist/twilight/{p-ca065012.entry.js → p-18f125a3.entry.js} +1 -1
- package/dist/twilight/{p-a29b3ad6.entry.js → p-2168a1b7.entry.js} +1 -1
- package/dist/twilight/{p-a1b41729.entry.js → p-2283318c.entry.js} +1 -1
- package/dist/twilight/{p-a7fa4a38.entry.js → p-24892bb6.entry.js} +1 -1
- package/dist/twilight/{p-cfdf4aa0.entry.js → p-2b04fdb5.entry.js} +1 -1
- package/dist/twilight/p-2e45388e.entry.js +4 -0
- package/dist/twilight/{p-51fa9d4b.entry.js → p-2ff50fed.entry.js} +1 -1
- package/dist/twilight/{p-4db163a5.entry.js → p-309fdf0f.entry.js} +1 -1
- package/dist/twilight/{p-eb407211.entry.js → p-333acffb.entry.js} +1 -1
- package/dist/twilight/{p-1c973898.entry.js → p-381d28e0.entry.js} +1 -1
- package/dist/twilight/{p-50c14a2f.entry.js → p-3a777816.entry.js} +1 -1
- package/dist/twilight/{p-47a90994.entry.js → p-3caa9c5b.entry.js} +1 -1
- package/dist/twilight/{p-aeb7635f.entry.js → p-3d725a11.entry.js} +1 -1
- package/dist/twilight/{p-0f97e754.entry.js → p-3e59be9a.entry.js} +1 -1
- package/dist/twilight/{p-49336e4b.entry.js → p-4003f28e.entry.js} +1 -1
- package/dist/twilight/{p-fa94864c.entry.js → p-440f3f56.entry.js} +1 -1
- package/dist/twilight/{p-557ab2fd.entry.js → p-445ffaa3.entry.js} +1 -1
- package/dist/twilight/{p-d95b2d33.entry.js → p-466e81c2.entry.js} +1 -1
- package/dist/twilight/{p-adf98025.entry.js → p-4b482fa1.entry.js} +1 -1
- package/dist/twilight/{p-d2cf3929.entry.js → p-4c82eafa.entry.js} +1 -1
- package/dist/twilight/p-4da393db.entry.js +4 -0
- package/dist/twilight/{p-fd9b2c38.entry.js → p-4e8f6ded.entry.js} +1 -1
- package/dist/twilight/{p-4e22341d.entry.js → p-4f8f2feb.entry.js} +1 -1
- package/dist/twilight/{p-8c89eb67.entry.js → p-50b6c22c.entry.js} +1 -1
- package/dist/twilight/{p-e3dd1bd6.entry.js → p-5205d63e.entry.js} +1 -1
- package/dist/twilight/{p-4966b0e8.entry.js → p-581a8b45.entry.js} +1 -1
- package/dist/twilight/{p-74c07d23.entry.js → p-5a21d194.entry.js} +1 -1
- package/dist/twilight/{p-2610f6a3.entry.js → p-5d6c3392.entry.js} +1 -1
- package/dist/twilight/{p-b638254e.entry.js → p-5ef1833b.entry.js} +1 -1
- package/dist/twilight/{p-d4b86e14.entry.js → p-5fc02026.entry.js} +1 -1
- package/dist/twilight/{p-9bda3abb.entry.js → p-6094c30b.entry.js} +1 -1
- package/dist/twilight/p-62a169d1.entry.js +4 -0
- package/dist/twilight/{p-17763ef6.entry.js → p-62ac3794.entry.js} +1 -1
- package/dist/twilight/{p-32f4944b.entry.js → p-63218518.entry.js} +1 -1
- package/dist/twilight/{p-459ae423.entry.js → p-6509aa03.entry.js} +1 -1
- package/dist/twilight/{p-3c9c7b93.entry.js → p-6523dc46.entry.js} +1 -1
- package/dist/twilight/{p-f3ebe745.entry.js → p-72613749.entry.js} +1 -1
- package/dist/twilight/{p-5c4dc8c2.entry.js → p-7a3509dc.entry.js} +1 -1
- package/dist/twilight/{p-267851e6.entry.js → p-7a4e4cf8.entry.js} +1 -1
- package/dist/twilight/{p-2304639e.entry.js → p-7b32d8ed.entry.js} +1 -1
- package/dist/twilight/{p-14c163a9.entry.js → p-7d0e6388.entry.js} +1 -1
- package/dist/twilight/{p-fb9a843b.entry.js → p-7db55bbd.entry.js} +1 -1
- package/dist/twilight/{p-9979137b.entry.js → p-836dd695.entry.js} +1 -1
- package/dist/twilight/{p-c3704c29.entry.js → p-85688b20.entry.js} +1 -1
- package/dist/twilight/{p-BpnQsIO1.js → p-88X5ZOpy.js} +1 -1
- package/dist/twilight/{p-f7da9b5a.entry.js → p-8a3f0f6f.entry.js} +1 -1
- package/dist/twilight/{p-b37da44e.entry.js → p-8e5fd8c4.entry.js} +1 -1
- package/dist/twilight/{p-db5139a3.entry.js → p-8e6f8658.entry.js} +1 -1
- package/dist/twilight/{p-46a2c78f.entry.js → p-97e75d89.entry.js} +1 -1
- package/dist/twilight/{p-28bc42d1.entry.js → p-9fd500d9.entry.js} +1 -1
- package/dist/twilight/{p-DjKYLHWC.js → p-BKX_fK3V.js} +1 -1
- package/dist/twilight/{p-0rlOrj5t.js → p-BUrckDHu.js} +1 -1
- package/dist/twilight/{p-CFVeu87-.js → p-Bv52S6nw.js} +2 -2
- package/dist/twilight/{p-qWzMt6Cu.js → p-C0pl0Rh-.js} +1 -1
- package/dist/twilight/{p-Bd5XukuC.js → p-Cn0tfZpG.js} +1 -1
- package/dist/twilight/p-Cx3AzTeQ.js +4 -0
- package/dist/twilight/{p-DdOkxzC4.js → p-DGsIK1oA.js} +1 -1
- package/dist/twilight/{p-CgL66erE.js → p-DH2EP3yv.js} +1 -1
- package/dist/twilight/{p-C-sZpMJx.js → p-QCX-Ccdr.js} +1 -1
- package/dist/twilight/{p-bda3eb32.entry.js → p-a030085d.entry.js} +1 -1
- package/dist/twilight/{p-3fd0fe12.entry.js → p-a45cdc04.entry.js} +1 -1
- package/dist/twilight/{p-223c2dc0.entry.js → p-a9a31035.entry.js} +1 -1
- package/dist/twilight/{p-9ae7c9de.entry.js → p-ae52b008.entry.js} +1 -1
- package/dist/twilight/{p-2bb3157d.entry.js → p-b2179de6.entry.js} +1 -1
- package/dist/twilight/{p-6f203973.entry.js → p-b28486a1.entry.js} +1 -1
- package/dist/twilight/{p-22f0669b.entry.js → p-b69076be.entry.js} +1 -1
- package/dist/twilight/{p-9d157683.entry.js → p-b775654f.entry.js} +1 -1
- package/dist/twilight/{p-710e2dd0.entry.js → p-b882fe2c.entry.js} +1 -1
- package/dist/twilight/{p-5d9e112e.entry.js → p-bb29e1c4.entry.js} +1 -1
- package/dist/twilight/{p-8b8bf23b.entry.js → p-c2eebe72.entry.js} +1 -1
- package/dist/twilight/{p-90417d6e.entry.js → p-c689281b.entry.js} +1 -1
- package/dist/twilight/{p-0686190e.entry.js → p-c923c4bc.entry.js} +1 -1
- package/dist/twilight/{p-44bc082c.entry.js → p-cd2e721e.entry.js} +1 -1
- package/dist/twilight/{p-C_MosVdY.js → p-cncDkB0J.js} +1 -1
- package/dist/twilight/{p-3032896e.entry.js → p-d1c0e94a.entry.js} +1 -1
- package/dist/twilight/{p-fd7c9983.entry.js → p-d1d123be.entry.js} +1 -1
- package/dist/twilight/{p-3d9cb623.entry.js → p-d2ac109e.entry.js} +1 -1
- package/dist/twilight/{p-5a030d37.entry.js → p-d2f4fd0d.entry.js} +1 -1
- package/dist/twilight/{p-2b7c3785.entry.js → p-d32817cf.entry.js} +1 -1
- package/dist/twilight/{p-130ab6b5.entry.js → p-d545dd56.entry.js} +1 -1
- package/dist/twilight/{p-d7a2b55c.entry.js → p-d58a0330.entry.js} +1 -1
- package/dist/twilight/{p-8dfb9637.entry.js → p-db787ac0.entry.js} +1 -1
- package/dist/twilight/{p-5df145be.entry.js → p-e2cbd2d8.entry.js} +1 -1
- package/dist/twilight/{p-d4a3cf3e.entry.js → p-e34bb476.entry.js} +1 -1
- package/dist/twilight/{p-48873da8.entry.js → p-e3557122.entry.js} +1 -1
- package/dist/twilight/{p-0ce60a63.entry.js → p-e48a3ff8.entry.js} +1 -1
- package/dist/twilight/{p-cb9e72a0.entry.js → p-e56447db.entry.js} +1 -1
- package/dist/twilight/{p-1a64c3d0.entry.js → p-e5e53ee6.entry.js} +1 -1
- package/dist/twilight/{p-361aeb38.entry.js → p-e645b7a0.entry.js} +1 -1
- package/dist/twilight/{p-dca2fdae.entry.js → p-e651fb2b.entry.js} +1 -1
- package/dist/twilight/{p-207e7fdf.entry.js → p-e6a445ea.entry.js} +1 -1
- package/dist/twilight/{p-4ac770ba.entry.js → p-ea7e9494.entry.js} +1 -1
- package/dist/twilight/{p-e40876ba.entry.js → p-eb4d96bc.entry.js} +1 -1
- package/dist/twilight/{p-1ab12ccb.entry.js → p-eebec3ae.entry.js} +1 -1
- package/dist/twilight/{p-72af03a1.entry.js → p-ef728985.entry.js} +1 -1
- package/dist/twilight/{p-8eeed35f.entry.js → p-f15fea94.entry.js} +1 -1
- package/dist/twilight/{p-356e8a56.entry.js → p-f792da44.entry.js} +1 -1
- package/dist/twilight/{p-324b7ff8.entry.js → p-f99e493c.entry.js} +1 -1
- package/dist/twilight/{p-f39f2210.entry.js → p-fe174351.entry.js} +1 -1
- package/dist/twilight/{p-BXSGktmF.js → p-lS_doykN.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/shared/coupons-request.d.ts +5 -0
- package/package.json +5 -5
- package/dist/twilight/p-11edbe40.entry.js +0 -4
- package/dist/twilight/p-74e9cd11.entry.js +0 -4
- package/dist/twilight/p-98944116.entry.js +0 -4
- package/dist/twilight/p-c969af19.entry.js +0 -4
|
@@ -2,54 +2,10 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
|
+
import { i as isCouponsGateClosed, g as getCouponsRequest } from './coupons-request.js';
|
|
5
6
|
import { d as defineCustomElement$3 } from './salla-button2.js';
|
|
6
7
|
import { d as defineCustomElement$2 } from './salla-slider2.js';
|
|
7
8
|
|
|
8
|
-
/**
|
|
9
|
-
* One shared GET /coupons per page view (CHKM-594).
|
|
10
|
-
*
|
|
11
|
-
* Every `salla-cart-coupons` instance (a re-created drawer, a second mount) used to hit the
|
|
12
|
-
* endpoint on its own. They now share one in-flight/settled promise, keyed by everything the
|
|
13
|
-
* response varies on, so a currency / language / scope change automatically misses the cache.
|
|
14
|
-
*/
|
|
15
|
-
const requests = new Map();
|
|
16
|
-
// Same source the request layer uses to send the scope (lib/request.js): config first, then storage.
|
|
17
|
-
const requestKey = () => {
|
|
18
|
-
const scope = salla.config.get('store.scope', salla.storage.get('scope'));
|
|
19
|
-
return [
|
|
20
|
-
...['store.id', 'user.currency_code', 'user.language_code'].map(key => String(salla.config.get(key, ''))),
|
|
21
|
-
String(scope?.id ?? ''),
|
|
22
|
-
].join('|');
|
|
23
|
-
};
|
|
24
|
-
/** Drop every cached request, so the next load refetches. */
|
|
25
|
-
const resetCouponsRequest = () => {
|
|
26
|
-
requests.clear();
|
|
27
|
-
};
|
|
28
|
-
// A coupon added or removed changes what the endpoint returns (and what is still applicable).
|
|
29
|
-
// off-then-on keeps the subscription single however often (or after whatever reset) this runs.
|
|
30
|
-
const invalidateOnCouponChange = () => {
|
|
31
|
-
['cart::coupon.added', 'cart::coupon.deleted'].forEach(eventName => {
|
|
32
|
-
salla.event.off(eventName, resetCouponsRequest);
|
|
33
|
-
salla.event.on(eventName, resetCouponsRequest);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const getCouponsRequest = () => {
|
|
37
|
-
invalidateOnCouponChange();
|
|
38
|
-
const key = requestKey();
|
|
39
|
-
let request = requests.get(key);
|
|
40
|
-
if (!request) {
|
|
41
|
-
request = salla.api.request('coupons');
|
|
42
|
-
requests.set(key, request);
|
|
43
|
-
const failed = request;
|
|
44
|
-
// A failed request must never stick: let the next caller retry.
|
|
45
|
-
failed.catch(() => {
|
|
46
|
-
if (requests.get(key) === failed)
|
|
47
|
-
requests.delete(key);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return request;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
9
|
const sallaCartCouponsCss = "/*!twlt*/@charset \"UTF-8\";.s-cart-coupons-card--applied{cursor:default}.s-cart-coupons-card--applied:hover{transform:none}.s-cart-coupons-card--applied .s-cart-coupons-top-section,.s-cart-coupons-card--applied .s-cart-coupons-bottom-section,.s-cart-coupons-card--applied .s-cart-coupons-divider{border-color:#d1d5db;border-color:color-mix(in srgb, var(--color-primary, #004d5a) 40%, transparent)}.s-cart-coupons-card--applied .s-cart-coupons-bottom-section{background:rgba(0, 0, 0, 0.04);background:color-mix(in srgb, var(--color-primary, #004d5a) 8%, transparent)}.s-cart-coupons-card--applied::before,.s-cart-coupons-card--applied::after{border-color:#d1d5db;border-color:color-mix(in srgb, var(--color-primary, #004d5a) 40%, transparent)}.s-cart-coupons-card--applied .s-cart-coupons-action{display:inline-flex;align-items:center;gap:10px}.s-cart-coupons-card--applied .s-cart-coupons-action{font-size:10px;font-weight:600;color:#4b5563}.s-cart-coupons-card-applied-label{color:#4b5563;color:var(--color-primary-dark, var(--color-primary, #4b5563))}.s-cart-coupons-card--applied .s-cart-coupons-action{min-width:0;max-width:100%}.s-cart-coupons-card-applied-label,.s-cart-coupons-card-remove{overflow:hidden;text-overflow:ellipsis}.s-cart-coupons-card--applied .s-cart-coupons-action,.s-cart-coupons-card--applied .s-cart-coupons-card-remove{pointer-events:auto}.s-cart-coupons-card-remove{flex:none;font-size:inherit;font-weight:inherit;color:#6b7280;background:transparent;border:0;padding:0;cursor:pointer;transition:color 0.15s ease}.s-cart-coupons-card-remove:hover{color:var(--color-danger, #ef4444)}.s-cart-coupons-card-remove:disabled{opacity:0.5;cursor:not-allowed}.s-cart-coupons-card--minimal .s-cart-coupons-bottom-section{justify-content:flex-end}.visible{visibility:visible}.fixed{position:fixed}.shrink{flex-shrink:1}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.form-input{height:2.5rem;width:100%;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.form-input:focus{border-color:var(--color-primary);--tw-ring-color:transparent}.form-input:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.form-input:focus:is(.dark *){border-color:var(--color-primary)}@media (min-width: 640px){.form-input{font-size:0.875rem;line-height:1.25rem}}.s-cart-coupons-wrapper{display:block;width:100%;padding-top:1.25rem;padding-bottom:1.25rem}.s-cart-coupons-input-section{margin-bottom:0.625rem}.s-cart-coupons-coupon-label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-coupon-input-container{position:relative;display:flex;align-items:stretch}.s-cart-coupons-coupon-input-container .form-input{height:auto;flex:1 1 0%}.s-cart-coupons-coupon-input-container .form-input:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;border-right-width:0px}.s-cart-coupons-coupon-input-container .form-input:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;border-left-width:0px}.s-cart-coupons-coupon-input-container .form-input:focus{position:relative;z-index:10}.s-cart-coupons-coupon-button:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px;border-bottom-left-radius:0px}.s-cart-coupons-coupon-button:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px;border-bottom-right-radius:0px}.s-cart-coupons-coupon-button-remove:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-remove:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-right-radius:0.5rem !important;border-bottom-right-radius:0.5rem !important;border-top-left-radius:0px !important;border-bottom-left-radius:0px !important}.s-cart-coupons-coupon-button-apply:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-left-radius:0.5rem !important;border-bottom-left-radius:0.5rem !important;border-top-right-radius:0px !important;border-bottom-right-radius:0px !important}.s-cart-coupons-coupon-error{margin-top:0.5rem;display:block;font-size:10px;line-height:1rem;--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-cart-coupons-slider{width:100%;overflow:hidden;padding-left:0.375rem;padding-right:0.375rem}.s-cart-coupons-card{position:relative;cursor:pointer;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-coupons-card:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:hover{--tw-translate-y:-0.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-cart-coupons-disabled{cursor:not-allowed;opacity:0.5}.s-cart-coupons-disabled:hover{transform:none;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-cart-coupons-top-section{display:flex;height:60px;flex-direction:row;align-items:center;justify-content:space-between;border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;border-width:1px;border-bottom-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-top:1rem;padding-bottom:1rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-discount-values{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-discount-values .s-cart-coupons-main-amount{display:flex;align-items:center;gap:0.25rem;white-space:nowrap;font-size:1.25rem;line-height:1.75rem;font-weight:900;line-height:1;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.s-cart-coupons-discount-values .s-cart-coupons-secondary-info{margin:0px;font-size:10px;line-height:1rem}.s-cart-coupons-code{font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-coupons-divider{position:relative;z-index:10;margin:0px;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-cart-coupons-bottom-section{display:flex;min-height:44px;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-right-radius:0.75rem;border-bottom-left-radius:0.75rem;border-width:1px;border-top-width:0px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.75rem;padding-right:0.75rem}.s-cart-coupons-terms{display:flex;flex-direction:column;align-items:flex-start}.s-cart-coupons-terms .s-cart-coupons-expiry{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-minimum{margin:0px;font-size:10px;line-height:16px;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-cart-coupons-terms .s-cart-coupons-expiry.s-cart-coupons-expiry-warning{font-weight:500;--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-cart-coupons-action{cursor:pointer;white-space:nowrap;border-width:0px;background-color:transparent;padding:0px;font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-cart-coupons-action:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-cart-coupons-slide-one-fourth{width:calc(75% - 10px);min-width:200px !important;padding-left:5px !important;padding-right:5px !important;padding-top:2px !important}@media (min-width: 1024px){.s-cart-coupons-slide-one-fourth{width:calc(40% - 10px) !important}}.s-cart-coupons-card:before{pointer-events:none;position:absolute;right:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):before{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-card:after{pointer-events:none;position:absolute;left:-10px;top:60px;z-index:20;height:1.25rem;width:1.25rem;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-cart-coupons-card:is(.dark *):after{--tw-bg-opacity:1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.s-cart-coupons-coupon-input-container .form-input.s-coupon-input-error{--tw-shadow:0 0 0 3px rgba(239,68,68,0.1) !important;--tw-shadow-colored:0 0 0 3px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}";
|
|
54
10
|
|
|
55
11
|
const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupons extends HTMLElement {
|
|
@@ -271,6 +227,12 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
271
227
|
}
|
|
272
228
|
}
|
|
273
229
|
async loadCouponsData() {
|
|
230
|
+
// Store says there are no visible checkout coupons: skip the request, render the empty state.
|
|
231
|
+
if (isCouponsGateClosed('checkout')) {
|
|
232
|
+
this.availableCoupons = [];
|
|
233
|
+
this.buildMergedCoupons();
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
274
236
|
try {
|
|
275
237
|
// Load coupons from API (shared across instances, see coupons-request.ts)
|
|
276
238
|
const response = await getCouponsRequest();
|
|
@@ -710,7 +672,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
710
672
|
}
|
|
711
673
|
render() {
|
|
712
674
|
const couponRow = this.couponRow();
|
|
713
|
-
return (h(Host, { key: '
|
|
675
|
+
return (h(Host, { key: '65d9d53eef293e5c4b7f3d9750b8b218a3698bf5' }, h("div", { key: '1261dc4731e77d7415e045ab6ea0f254fdbabe92', class: "s-cart-coupons-wrapper" }, h("div", { key: '678db34ff2af83e2ffa5dea281cd44552e8d2bc5', class: "s-cart-coupons-input-section" }, h("label", { key: '3734098d4cb7af7d960a808abd3fbca08dba557d', htmlFor: "coupon-input", class: "s-cart-coupons-coupon-label" }, salla.lang.get('pages.cart.have_coupon')), h("div", { key: '23b258aee73df768cc80e5fea198e87370e93723', class: "s-cart-coupons-coupon-input-container" }, this.multiCoupon ? [
|
|
714
676
|
// Multi-coupon: input stays active to append more codes; applied coupons render
|
|
715
677
|
// as removable chips below.
|
|
716
678
|
h("input", { type: "text", id: "coupon-input", name: "coupon", class: `form-input ${this.couponError ? 's-coupon-input-error' : ''}`, placeholder: salla.lang.get('pages.cart.coupon_placeholder'), value: this.couponInputValue, disabled: this.isApplying, onInput: this.onInput, onKeyUp: this.onKeyUp, "aria-label": salla.lang.get('pages.cart.apply_coupon'), key: "coupon-input" }),
|
|
@@ -721,7 +683,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
721
683
|
// a new code can only be entered after removing. Reuses the existing master classes.
|
|
722
684
|
h("input", { type: "text", id: "coupon-input", name: "coupon", class: `form-input ${this.couponError ? 's-coupon-input-error' : ''}`, placeholder: salla.lang.get('pages.cart.coupon_placeholder'), value: this.couponInputValue, disabled: !!this.currentCoupon || this.isApplying, onInput: this.onInput, onKeyUp: this.onKeyUp, "aria-label": salla.lang.get('pages.cart.apply_coupon'), key: "coupon-input" }),
|
|
723
685
|
h("salla-button", { ref: el => this.couponButtonRef = el, class: `s-cart-coupons-coupon-button ${this.currentCoupon ? 's-cart-coupons-coupon-button-remove' : 's-cart-coupons-coupon-button-apply'}`, color: this.currentCoupon ? 'danger' : 'primary', loading: this.isApplying, "loader-position": "center", onClick: () => this.handleCouponButtonClick(), key: "apply-button" }, this.currentCoupon ? (h("i", { class: "sicon-cancel" })) : (h("span", null, salla.lang.get('pages.cart.save_coupon')))),
|
|
724
|
-
]), this.couponError && (h("span", { key: '
|
|
686
|
+
]), this.couponError && (h("span", { key: '66d2247111df65565d9c3c7ff00dbb8b725759f2', class: "s-cart-coupons-coupon-error" }, this.couponError))), couponRow.length > 0 && (h("salla-slider", { type: "carousel", showControls: false, class: "s-cart-coupons-slider",
|
|
725
687
|
/* salla-slider hands its slot children to Swiper, which MOVES them out of the
|
|
726
688
|
`slot="items"` div into its own .swiper-wrapper. Stencil then patches against a
|
|
727
689
|
tree that no longer exists where it expects, so a slide added to a list that
|
|
@@ -730,7 +692,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
730
692
|
against dynamic custom components inside it. Keying on the exact code list
|
|
731
693
|
makes Stencil discard and remount the slider whenever the set changes, so
|
|
732
694
|
Swiper re-initialises over the full, correct set of slides. */
|
|
733
|
-
key: couponRow.map(entry => entry.code).join('|') }, h("div", { key: '
|
|
695
|
+
key: couponRow.map(entry => entry.code).join('|') }, h("div", { key: '5e0e500109b2257785e37c459f363ea93c192371', slot: "items" }, couponRow.map(entry => this.renderCouponCard(entry))))))));
|
|
734
696
|
}
|
|
735
697
|
get host() { return this; }
|
|
736
698
|
static get style() { return sallaCartCouponsCss; }
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
5
|
import { C as CopyIcon } from './pages.js';
|
|
6
|
+
import { i as isCouponsGateClosed } from './coupons-request.js';
|
|
6
7
|
import { d as defineCustomElement$2 } from './salla-skeleton2.js';
|
|
7
8
|
|
|
8
|
-
const sallaNextOrderCouponCss = "/*!twlt*/:host{display:block}.fixed{position:fixed}.block{display:block}.s-next-order-coupon-wrapper{display:flex;flex-direction:column;gap:0.25rem;overflow:hidden;border-radius:0.75rem;background-color:color-mix(in srgb,var(--color-primary) 8%,var(--color-surface,#fff));padding-left:0.125rem;padding-right:0.125rem;padding-bottom:0.125rem;padding-top:0.25rem}.s-next-order-coupon-heading{padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;font-weight:700;line-height:1.25rem;color:var(--color-text-primary,#333)}.s-next-order-coupon-list{display:flex;flex-wrap:wrap;align-items:stretch;gap:0.125rem}.s-next-order-coupon-card{display:flex;min-width:14rem;flex:1 1 0%;align-items:flex-start;justify-content:space-between;gap:0.25rem;border-radius:0.75rem;background-color:var(--color-surface,#fff);padding:0.75rem}.s-next-order-coupon-details{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem;font-size:0.75rem;line-height:1rem}.s-next-order-coupon-title{display:flex;align-items:flex-start;gap:0.25rem;font-weight:700;color:var(--color-text-primary,#333)}.s-next-order-coupon-desc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary,#666)}.s-next-order-coupon-meta{display:flex;flex-wrap:wrap;column-gap:0.5rem;font-size:0.75rem;line-height:1rem;color:var(--color-text-secondary,#666)}.s-next-order-coupon-code{display:inline-flex;flex-shrink:0;cursor:pointer;align-items:center;gap:0.25rem;border-width:0px;background-color:transparent;padding:0px;font-size:0.75rem;font-weight:700;line-height:1rem;color:var(--color-text-primary,#333)}.s-next-order-coupon-code svg{height:0.875rem;width:0.875rem;fill:currentColor}@keyframes pulse{50%{opacity:.5}}.s-next-order-coupon-skeleton{animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}.s-thank-you-page-wrapper .s-next-order-coupon-heading{font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-next-order-coupon-details,.s-thank-you-page-wrapper .s-next-order-coupon-code{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-next-order-coupon-code svg{height:1.25rem;width:1.25rem}.s-thank-you-page-wrapper .s-next-order-coupon-card{min-width:0px;flex-direction:column;gap:0.5rem;padding:0.75rem}@media (min-width: 640px){.s-thank-you-page-wrapper .s-next-order-coupon-card{flex-direction:row;padding:1.25rem}}.s-thank-you-page-wrapper .s-next-order-coupon-details{width:100%;gap:0.5rem}.s-thank-you-page-wrapper .s-next-order-coupon-list{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.125rem}.s-thank-you-page-wrapper .s-next-order-coupon-card:only-child{grid-column:span 2 / span 2}.s-thank-you-page-wrapper .s-next-order-coupon-desc{white-space:normal;overflow-wrap:break-word}.s-thank-you-page-wrapper .s-next-order-coupon-code{max-width:100%;flex-wrap:wrap;text-align:start}.s-thank-you-page-wrapper .s-next-order-coupon-code>span{min-width:0px;word-break:break-all}";
|
|
9
|
+
const sallaNextOrderCouponCss = "/*!twlt*/:host{display:block}.visible{visibility:visible}.fixed{position:fixed}.block{display:block}.s-next-order-coupon-wrapper{display:flex;flex-direction:column;gap:0.25rem;overflow:hidden;border-radius:0.75rem;background-color:color-mix(in srgb,var(--color-primary) 8%,var(--color-surface,#fff));padding-left:0.125rem;padding-right:0.125rem;padding-bottom:0.125rem;padding-top:0.25rem}.s-next-order-coupon-heading{padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;font-weight:700;line-height:1.25rem;color:var(--color-text-primary,#333)}.s-next-order-coupon-list{display:flex;flex-wrap:wrap;align-items:stretch;gap:0.125rem}.s-next-order-coupon-card{display:flex;min-width:14rem;flex:1 1 0%;align-items:flex-start;justify-content:space-between;gap:0.25rem;border-radius:0.75rem;background-color:var(--color-surface,#fff);padding:0.75rem}.s-next-order-coupon-details{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem;font-size:0.75rem;line-height:1rem}.s-next-order-coupon-title{display:flex;align-items:flex-start;gap:0.25rem;font-weight:700;color:var(--color-text-primary,#333)}.s-next-order-coupon-desc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-secondary,#666)}.s-next-order-coupon-meta{display:flex;flex-wrap:wrap;column-gap:0.5rem;font-size:0.75rem;line-height:1rem;color:var(--color-text-secondary,#666)}.s-next-order-coupon-code{display:inline-flex;flex-shrink:0;cursor:pointer;align-items:center;gap:0.25rem;border-width:0px;background-color:transparent;padding:0px;font-size:0.75rem;font-weight:700;line-height:1rem;color:var(--color-text-primary,#333)}.s-next-order-coupon-code svg{height:0.875rem;width:0.875rem;fill:currentColor}@keyframes pulse{50%{opacity:.5}}.s-next-order-coupon-skeleton{animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}.s-thank-you-page-wrapper .s-next-order-coupon-heading{font-size:1rem;line-height:1.5rem}.s-thank-you-page-wrapper .s-next-order-coupon-details,.s-thank-you-page-wrapper .s-next-order-coupon-code{font-size:0.875rem;line-height:1.25rem}.s-thank-you-page-wrapper .s-next-order-coupon-code svg{height:1.25rem;width:1.25rem}.s-thank-you-page-wrapper .s-next-order-coupon-card{min-width:0px;flex-direction:column;gap:0.5rem;padding:0.75rem}@media (min-width: 640px){.s-thank-you-page-wrapper .s-next-order-coupon-card{flex-direction:row;padding:1.25rem}}.s-thank-you-page-wrapper .s-next-order-coupon-details{width:100%;gap:0.5rem}.s-thank-you-page-wrapper .s-next-order-coupon-list{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.125rem}.s-thank-you-page-wrapper .s-next-order-coupon-card:only-child{grid-column:span 2 / span 2}.s-thank-you-page-wrapper .s-next-order-coupon-desc{white-space:normal;overflow-wrap:break-word}.s-thank-you-page-wrapper .s-next-order-coupon-code{max-width:100%;flex-wrap:wrap;text-align:start}.s-thank-you-page-wrapper .s-next-order-coupon-code>span{min-width:0px;word-break:break-all}";
|
|
9
10
|
|
|
10
11
|
const SallaNextOrderCoupon$1 = /*@__PURE__*/ proxyCustomElement(class SallaNextOrderCoupon extends HTMLElement {
|
|
11
12
|
constructor() {
|
|
@@ -51,6 +52,12 @@ const SallaNextOrderCoupon$1 = /*@__PURE__*/ proxyCustomElement(class SallaNextO
|
|
|
51
52
|
this.isLoading = false;
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
55
|
+
// Store says there are no visible thank-you coupons: skip the request.
|
|
56
|
+
if (isCouponsGateClosed('thankyou')) {
|
|
57
|
+
this.coupons = [];
|
|
58
|
+
this.isLoading = false;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
54
61
|
try {
|
|
55
62
|
const response = await salla.api.request('coupons', { params: { type: 'thankyou' } });
|
|
56
63
|
const raw = response?.data;
|
package/dist/docs.json
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* One shared GET /coupons per page view (CHKM-594).
|
|
6
|
+
*
|
|
7
|
+
* Every `salla-cart-coupons` instance (a re-created drawer, a second mount) used to hit the
|
|
8
|
+
* endpoint on its own. They now share one in-flight/settled promise, keyed by everything the
|
|
9
|
+
* response varies on, so a currency / language / scope change automatically misses the cache.
|
|
10
|
+
*/
|
|
11
|
+
const requests = new Map();
|
|
12
|
+
// Same source the request layer uses to send the scope (lib/request.js): config first, then storage.
|
|
13
|
+
const requestKey = () => {
|
|
14
|
+
const scope = salla.config.get('store.scope', salla.storage.get('scope'));
|
|
15
|
+
return [
|
|
16
|
+
...['store.id', 'user.currency_code', 'user.language_code'].map(key => String(salla.config.get(key, ''))),
|
|
17
|
+
String(scope?.id ?? ''),
|
|
18
|
+
].join('|');
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* True only when the store says it has no visible coupons of this kind (CHKM-644).
|
|
22
|
+
* Strictly `=== false`: a missing key (older Store, preview host) or any other value fetches as before.
|
|
23
|
+
*/
|
|
24
|
+
const isCouponsGateClosed = (kind) => salla.config.get(`store.settings.cart.has_${kind}_coupons`) === false;
|
|
25
|
+
/** Drop every cached request, so the next load refetches. */
|
|
26
|
+
const resetCouponsRequest = () => {
|
|
27
|
+
requests.clear();
|
|
28
|
+
};
|
|
29
|
+
// A coupon added or removed changes what the endpoint returns (and what is still applicable).
|
|
30
|
+
// off-then-on keeps the subscription single however often (or after whatever reset) this runs.
|
|
31
|
+
const invalidateOnCouponChange = () => {
|
|
32
|
+
['cart::coupon.added', 'cart::coupon.deleted'].forEach(eventName => {
|
|
33
|
+
salla.event.off(eventName, resetCouponsRequest);
|
|
34
|
+
salla.event.on(eventName, resetCouponsRequest);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const getCouponsRequest = () => {
|
|
38
|
+
invalidateOnCouponChange();
|
|
39
|
+
const key = requestKey();
|
|
40
|
+
let request = requests.get(key);
|
|
41
|
+
if (!request) {
|
|
42
|
+
request = salla.api.request('coupons');
|
|
43
|
+
requests.set(key, request);
|
|
44
|
+
const failed = request;
|
|
45
|
+
// A failed request must never stick: let the next caller retry.
|
|
46
|
+
failed.catch(() => {
|
|
47
|
+
if (requests.get(key) === failed)
|
|
48
|
+
requests.delete(key);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return request;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { getCouponsRequest as g, isCouponsGateClosed as i };
|