@salla.sa/twilight-components 2.14.592 → 2.14.594
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/{apple-pay-order-options-B036Wu4O.js → apple-pay-order-options-CA8IYRTb.js} +1 -0
- package/dist/cjs/{filepond-YeXzkn77.js → filepond-DtGoIKEP.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BEU99tEc.js → filepond-plugin-file-poster-DMejMF1-.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-BSsf6VIk.js → filepond-plugin-file-validate-size-J_fE6OBS.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BkxQQF1Y.js → filepond-plugin-file-validate-type-BpewyAzF.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-h9C4LxoR.js → filepond-plugin-image-edit-DPNUTWCK.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-nDfSwZEM.js → filepond-plugin-image-exif-orientation-CZ6YRu70.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-C-FDU_4k.js → filepond-plugin-image-preview-CgV-oWXK.js} +1 -1
- package/dist/cjs/{index-DI5yx1uj.js → index-BziKkkwT.js} +21 -7
- package/dist/cjs/{intlTelInput-AgidDx18.js → intlTelInput-BLuZALMt.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 +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +116 -4
- 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 +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
- 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 +286 -20
- 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 +1 -1
- 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 +1 -1
- package/dist/cjs/salla-filters.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 +2 -2
- package/dist/cjs/salla-hook.cjs.entry.js +1 -1
- 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 +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 +1 -1
- 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-options-modal.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 +1 -1
- 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 +1 -1
- package/dist/cjs/salla-products-slider.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 +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 +1 -1
- 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-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 +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-DLfPr_3c.js → vanilla-picker-36O-wrIX.js} +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.css +58 -36
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +116 -1
- package/dist/collection/components/salla-bullet-delivery/location-distance-warning.js +28 -0
- package/dist/collection/components/salla-bullet-delivery/location-icon.svg +26 -0
- package/dist/collection/components/salla-bullet-delivery/location-permission-notice.js +103 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +136 -0
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +133 -19
- package/dist/collection/components/salla-order-options-modal/apple-pay-order-options.js +1 -1
- package/dist/collection/global/app.js +2 -0
- package/dist/collection/global/app.spec.ts +33 -0
- package/dist/collection/global/app.ts +2 -0
- package/dist/collection/global/chunk-errors.js +14 -0
- package/dist/collection/global/chunk-errors.spec.ts +47 -0
- package/dist/collection/global/chunk-errors.ts +13 -0
- package/dist/components/apple-pay-order-options.js +1 -1
- package/dist/components/index.js +15 -2
- package/dist/components/salla-add-product-button2.js +116 -2
- package/dist/components/salla-bullet-delivery.js +288 -20
- package/dist/components/salla-gifting.js +1 -1
- package/dist/components/salla-quick-buy2.js +1 -1
- package/dist/docs.json +29 -13
- package/dist/esm/{apple-pay-order-options-s0kn7yr8.js → apple-pay-order-options-BS2iQKah.js} +1 -1
- package/dist/esm/{filepond-C3uLKJlo.js → filepond-DZJO0NDO.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BNO8nuwN.js → filepond-plugin-file-poster-BGjhc2cd.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CMMYF-rL.js → filepond-plugin-file-validate-size-s9w1K7Bl.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DSYhKJ7B.js → filepond-plugin-file-validate-type-OfI6GFgP.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-lJgRMQAo.js → filepond-plugin-image-edit-Cfselyr4.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-B0tYK1GE.js → filepond-plugin-image-exif-orientation-ConUo4eP.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-kWmnxhXu.js → filepond-plugin-image-preview-BJ4T10Ty.js} +1 -1
- package/dist/esm/{index-Bk24FlDL.js → index-Bxge4xib.js} +21 -7
- package/dist/esm/{intlTelInput-nODQyuq0.js → intlTelInput-B-IoM3ox.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 +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +116 -4
- 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 +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-attachment-view_9.entry.js +10 -10
- 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 +286 -20
- 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 +1 -1
- 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 +1 -1
- package/dist/esm/salla-filters.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 +2 -2
- package/dist/esm/salla-hook.entry.js +1 -1
- 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 +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 +1 -1
- 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-options-modal.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 +1 -1
- 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 +1 -1
- package/dist/esm/salla-products-slider.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 +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 +1 -1
- 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-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 +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-B1bTUgHP.js → vanilla-picker-D1RSTlum.js} +1 -1
- package/dist/twilight/global/app.spec.ts +33 -0
- package/dist/twilight/global/app.ts +2 -0
- package/dist/twilight/global/chunk-errors.spec.ts +47 -0
- package/dist/twilight/global/chunk-errors.ts +13 -0
- package/dist/twilight/{p-68411931.entry.js → p-00cb1c25.entry.js} +1 -1
- package/dist/twilight/{p-be729ca2.entry.js → p-0835d9ab.entry.js} +1 -1
- package/dist/twilight/{p-5435dbcd.entry.js → p-09e56514.entry.js} +1 -1
- package/dist/twilight/{p-b6dc3e12.entry.js → p-0bbd0d06.entry.js} +1 -1
- package/dist/twilight/{p-2191d792.entry.js → p-0d464350.entry.js} +1 -1
- package/dist/twilight/{p-e7127704.entry.js → p-0e1a454b.entry.js} +1 -1
- package/dist/twilight/{p-0dc90c55.entry.js → p-106ea7ed.entry.js} +1 -1
- package/dist/twilight/{p-b1b096d7.entry.js → p-125482ce.entry.js} +1 -1
- package/dist/twilight/{p-9048520b.entry.js → p-15824030.entry.js} +1 -1
- package/dist/twilight/{p-612b6d87.entry.js → p-1769ead6.entry.js} +1 -1
- package/dist/twilight/{p-7b4a8237.entry.js → p-1b56374e.entry.js} +1 -1
- package/dist/twilight/{p-658de43b.entry.js → p-1d551b52.entry.js} +1 -1
- package/dist/twilight/{p-f5c9e513.entry.js → p-21d1a687.entry.js} +1 -1
- package/dist/twilight/{p-bb152b39.entry.js → p-22f21c95.entry.js} +1 -1
- package/dist/twilight/{p-4f76e9e2.entry.js → p-2510973e.entry.js} +1 -1
- package/dist/twilight/{p-6760ec19.entry.js → p-2c2f0608.entry.js} +1 -1
- package/dist/twilight/{p-7ff0c546.entry.js → p-2c8b8935.entry.js} +1 -1
- package/dist/twilight/{p-06643011.entry.js → p-2e5bace8.entry.js} +1 -1
- package/dist/twilight/{p-5f6a5a4b.entry.js → p-2ef59b30.entry.js} +1 -1
- package/dist/twilight/{p-f4f7ed38.entry.js → p-30b7383a.entry.js} +1 -1
- package/dist/twilight/{p-ce6c709b.entry.js → p-30f24d97.entry.js} +1 -1
- package/dist/twilight/{p-e2aa0e72.entry.js → p-3162901e.entry.js} +1 -1
- package/dist/twilight/{p-45035389.entry.js → p-34454493.entry.js} +1 -1
- package/dist/twilight/{p-f8f9c563.entry.js → p-35bc566f.entry.js} +1 -1
- package/dist/twilight/{p-b1b345d6.entry.js → p-35c0ca9a.entry.js} +1 -1
- package/dist/twilight/{p-c313bd11.entry.js → p-3e02b792.entry.js} +1 -1
- package/dist/twilight/{p-c3a2696b.entry.js → p-42162de9.entry.js} +1 -1
- package/dist/twilight/{p-c1d18b73.entry.js → p-4362756f.entry.js} +1 -1
- package/dist/twilight/{p-2fc68bfd.entry.js → p-4457a289.entry.js} +1 -1
- package/dist/twilight/{p-d9ccdd8f.entry.js → p-4543b3b3.entry.js} +1 -1
- package/dist/twilight/{p-3bf37615.entry.js → p-4cedf139.entry.js} +1 -1
- package/dist/twilight/{p-75f32b91.entry.js → p-51243641.entry.js} +1 -1
- package/dist/twilight/{p-f263bba9.entry.js → p-51e8c2b2.entry.js} +1 -1
- package/dist/twilight/{p-a0f1b867.entry.js → p-52012794.entry.js} +1 -1
- package/dist/twilight/{p-3e6f2bf8.entry.js → p-530b513d.entry.js} +1 -1
- package/dist/twilight/{p-e7ca6d06.entry.js → p-57097563.entry.js} +1 -1
- package/dist/twilight/{p-b95a6e20.entry.js → p-572a1f84.entry.js} +1 -1
- package/dist/twilight/{p-872d6d68.entry.js → p-59256d82.entry.js} +1 -1
- package/dist/twilight/{p-9e6f4ec4.entry.js → p-5b3a04cd.entry.js} +1 -1
- package/dist/twilight/p-614b7b61.entry.js +4 -0
- package/dist/twilight/{p-a057f532.entry.js → p-64c76ad9.entry.js} +1 -1
- package/dist/twilight/{p-dfd212d5.entry.js → p-66131771.entry.js} +1 -1
- package/dist/twilight/{p-6673a16f.entry.js → p-6b90f160.entry.js} +1 -1
- package/dist/twilight/{p-b5e774db.entry.js → p-6bfcdb38.entry.js} +1 -1
- package/dist/twilight/{p-c1d815c9.entry.js → p-6d3d5a0b.entry.js} +1 -1
- package/dist/twilight/{p-377642ea.entry.js → p-6e42d70f.entry.js} +1 -1
- package/dist/twilight/{p-6a76acd8.entry.js → p-6e57ff9f.entry.js} +1 -1
- package/dist/twilight/{p-91a1baf1.entry.js → p-751ff32d.entry.js} +1 -1
- package/dist/twilight/{p-42e02411.entry.js → p-78963d5d.entry.js} +1 -1
- package/dist/twilight/{p-a75680ae.entry.js → p-790ea507.entry.js} +1 -1
- package/dist/twilight/{p-eaae379c.entry.js → p-79bb0c41.entry.js} +1 -1
- package/dist/twilight/{p-1b1bebf6.entry.js → p-7ed0db2e.entry.js} +1 -1
- package/dist/twilight/{p-c9ebe466.entry.js → p-84308a79.entry.js} +1 -1
- package/dist/twilight/{p-43ca88d0.entry.js → p-8c229520.entry.js} +1 -1
- package/dist/twilight/{p-e58b7ef9.entry.js → p-94970458.entry.js} +1 -1
- package/dist/twilight/{p-ad52dcf7.entry.js → p-94e85b3c.entry.js} +1 -1
- package/dist/twilight/{p-f7ee4910.entry.js → p-988f6193.entry.js} +1 -1
- package/dist/twilight/{p-540029a5.entry.js → p-9f0459ec.entry.js} +1 -1
- package/dist/twilight/{p-BnmP7F4y.js → p-B5twlAuI.js} +1 -1
- package/dist/twilight/p-BS2iQKah.js +4 -0
- package/dist/twilight/{p-Ct18qgaq.js → p-BXAODWDa.js} +1 -1
- package/dist/twilight/{p-DvlAEiaH.js → p-BkWctmFE.js} +1 -1
- package/dist/twilight/{p-Bk24FlDL.js → p-Bxge4xib.js} +2 -2
- package/dist/twilight/{p-BvUmZYa9.js → p-CINox5XU.js} +1 -1
- package/dist/twilight/{p-B-LS1xDz.js → p-CWLJmpv-.js} +1 -1
- package/dist/twilight/{p-CHqh7vb6.js → p-DKEu8h4M.js} +1 -1
- package/dist/twilight/{p-CXo-IH2o.js → p-DnoH14HK.js} +1 -1
- package/dist/twilight/{p-CcGfWKIx.js → p-EiLe0Yi_.js} +1 -1
- package/dist/twilight/{p-DBjpz_eG.js → p-W-AkIawg.js} +1 -1
- package/dist/twilight/{p-b37ae926.entry.js → p-a37bc663.entry.js} +1 -1
- package/dist/twilight/{p-ced74b88.entry.js → p-a3a69984.entry.js} +1 -1
- package/dist/twilight/{p-42150f97.entry.js → p-a912d6a3.entry.js} +1 -1
- package/dist/twilight/{p-ed6ea140.entry.js → p-aa96807e.entry.js} +1 -1
- package/dist/twilight/{p-5fc75260.entry.js → p-aafa69d6.entry.js} +1 -1
- package/dist/twilight/{p-08256e67.entry.js → p-abfbba72.entry.js} +1 -1
- package/dist/twilight/{p-cd432c49.entry.js → p-b1dc78db.entry.js} +1 -1
- package/dist/twilight/{p-79676f24.entry.js → p-b2322278.entry.js} +1 -1
- package/dist/twilight/{p-21b3877b.entry.js → p-b3213fee.entry.js} +1 -1
- package/dist/twilight/{p-dc51993c.entry.js → p-b6918b2b.entry.js} +1 -1
- package/dist/twilight/{p-1d05ff72.entry.js → p-b8661b67.entry.js} +1 -1
- package/dist/twilight/{p-83ccddd5.entry.js → p-be3f6dbe.entry.js} +1 -1
- package/dist/twilight/{p-7038e1af.entry.js → p-bff2400f.entry.js} +1 -1
- package/dist/twilight/{p-b2c41e36.entry.js → p-c0274022.entry.js} +1 -1
- package/dist/twilight/{p-03dffb99.entry.js → p-c16b9f4a.entry.js} +1 -1
- package/dist/twilight/{p-38418821.entry.js → p-c476eaab.entry.js} +1 -1
- package/dist/twilight/{p-f9f0a5ee.entry.js → p-c4bf8d24.entry.js} +1 -1
- package/dist/twilight/p-c903b6bb.entry.js +4 -0
- package/dist/twilight/{p-0e122915.entry.js → p-d1e4e15e.entry.js} +1 -1
- package/dist/twilight/{p-523f9816.entry.js → p-d2e929bd.entry.js} +1 -1
- package/dist/twilight/{p-43c5ec34.entry.js → p-d38b5aaa.entry.js} +1 -1
- package/dist/twilight/{p-22135b7c.entry.js → p-d6d7c6a1.entry.js} +1 -1
- package/dist/twilight/{p-7750be26.entry.js → p-d9188e76.entry.js} +1 -1
- package/dist/twilight/{p-320d6b04.entry.js → p-db53740d.entry.js} +1 -1
- package/dist/twilight/{p-21802082.entry.js → p-df313b00.entry.js} +1 -1
- package/dist/twilight/{p-46721e68.entry.js → p-df407f01.entry.js} +1 -1
- package/dist/twilight/{p-4fd73440.entry.js → p-e19a980b.entry.js} +1 -1
- package/dist/twilight/{p-813a40cc.entry.js → p-e1b0dafc.entry.js} +1 -1
- package/dist/twilight/{p-d73307c7.entry.js → p-e7e52491.entry.js} +1 -1
- package/dist/twilight/{p-f74ccae4.entry.js → p-ebbb25fc.entry.js} +1 -1
- package/dist/twilight/{p-becb6580.entry.js → p-f046edd3.entry.js} +1 -1
- package/dist/twilight/{p-250262a9.entry.js → p-f22ec479.entry.js} +1 -1
- package/dist/twilight/{p-fbee9e50.entry.js → p-f4c94e30.entry.js} +1 -1
- package/dist/twilight/{p-02202feb.entry.js → p-fae38591.entry.js} +1 -1
- package/dist/twilight/{p-d601977e.entry.js → p-fb119c27.entry.js} +1 -1
- package/dist/twilight/{p-cc74d38b.entry.js → p-fd615606.entry.js} +1 -1
- package/dist/twilight/{p-b009d316.entry.js → p-fd6fc043.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +16 -0
- package/dist/types/components/salla-bullet-delivery/location-distance-warning.d.ts +12 -0
- package/dist/types/components/salla-bullet-delivery/location-permission-notice.d.ts +39 -0
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +31 -0
- package/dist/types/components/salla-order-options-modal/apple-pay-order-options.d.ts +2 -0
- package/dist/types/global/chunk-errors.d.ts +2 -0
- package/package.json +5 -5
- package/dist/twilight/p-07174244.entry.js +0 -4
- package/dist/twilight/p-f3ffe84f.entry.js +0 -4
- package/dist/twilight/p-s0kn7yr8.js +0 -4
|
@@ -7,36 +7,88 @@ salla-add-product-button[width=wide] {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
/* Buy-now redirect button: copy of salla-mini-checkout-widget's button CSS, same theme vars. */
|
|
11
|
+
.s-add-product-button-buy-now {
|
|
12
|
+
display: block;
|
|
13
|
+
font-family: 'PingARLT';
|
|
14
|
+
font-weight: normal;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.s-add-product-button-buy-now .s-fast-checkout-button {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
height: var(--salla-fast-checkout-button-height, 2.5rem);
|
|
22
|
+
width: var(--salla-fast-checkout-button-width, 100%);
|
|
23
|
+
border-radius: var(--salla-fast-checkout-button-border-radius, 0.375rem);
|
|
24
|
+
font-size: 0.875rem;
|
|
25
|
+
font-weight: bold;
|
|
26
|
+
text-transform: uppercase;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
transition: all 0.3s ease-in-out;
|
|
29
|
+
border: none;
|
|
30
|
+
font-family: 'PingARLT';
|
|
31
|
+
gap: 5px;
|
|
32
|
+
direction: ltr;
|
|
33
|
+
border-width: 1px;
|
|
34
|
+
border-color: var(--color-primary);
|
|
35
|
+
background-color: var(--color-primary);
|
|
36
|
+
color: var(--color-primary-reverse);
|
|
37
|
+
/* The widget's button sits in shadow DOM, out of the theme's preflight reset; keep the browser defaults it gets. */
|
|
38
|
+
padding: 1px 6px;
|
|
39
|
+
line-height: normal;
|
|
40
|
+
letter-spacing: normal;
|
|
41
|
+
/* The theme's Tailwind `.outline` utility (outline-style: solid) hits the `outline` class; the widget is shielded by shadow DOM. */
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.s-add-product-button-buy-now .s-fast-checkout-button:focus-visible {
|
|
46
|
+
outline: auto;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.s-add-product-button-buy-now .s-fast-checkout-button:hover {
|
|
50
|
+
background-color: var(--color-primary);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.s-add-product-button-buy-now .s-fast-checkout-button.outline {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
border: 1px solid var(--color-primary);
|
|
56
|
+
color: var(--color-primary);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.s-add-product-button-buy-now .s-fast-checkout-button.rtl {
|
|
60
|
+
flex-direction: row-reverse;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.s-add-product-button-buy-now .s-fast-checkout-button:disabled {
|
|
64
|
+
cursor: progress;
|
|
65
|
+
opacity: 0.7;
|
|
66
|
+
}
|
|
67
|
+
|
|
10
68
|
.sticky {
|
|
11
69
|
position: sticky;
|
|
12
70
|
}
|
|
13
71
|
|
|
14
|
-
|
|
15
72
|
.hidden {
|
|
16
73
|
display: none;
|
|
17
74
|
}
|
|
18
75
|
|
|
19
|
-
|
|
20
76
|
.w-full {
|
|
21
77
|
width: 100%;
|
|
22
78
|
}
|
|
23
79
|
|
|
24
|
-
|
|
25
80
|
.outline {
|
|
26
81
|
outline-style: solid;
|
|
27
82
|
}
|
|
28
83
|
|
|
29
|
-
|
|
30
84
|
.filter {
|
|
31
85
|
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);
|
|
32
86
|
}
|
|
33
87
|
|
|
34
|
-
|
|
35
88
|
.s-hidden {
|
|
36
89
|
display: none;
|
|
37
90
|
}
|
|
38
91
|
|
|
39
|
-
|
|
40
92
|
.btn {
|
|
41
93
|
display: inline-flex;
|
|
42
94
|
flex: 1 1 0%;
|
|
@@ -56,17 +108,14 @@ salla-add-product-button[width=wide] {
|
|
|
56
108
|
transition-duration: 300ms;
|
|
57
109
|
}
|
|
58
110
|
|
|
59
|
-
|
|
60
111
|
.btn:hover {
|
|
61
112
|
opacity: 0.8;
|
|
62
113
|
}
|
|
63
114
|
|
|
64
|
-
|
|
65
115
|
.s-hidden {
|
|
66
116
|
display: none;
|
|
67
117
|
}
|
|
68
118
|
|
|
69
|
-
|
|
70
119
|
.s-add-product-button-sr-only {
|
|
71
120
|
position: absolute;
|
|
72
121
|
width: 1px;
|
|
@@ -79,12 +128,10 @@ salla-add-product-button[width=wide] {
|
|
|
79
128
|
border-width: 0;
|
|
80
129
|
}
|
|
81
130
|
|
|
82
|
-
|
|
83
131
|
.s-add-product-button-with-quick-buy {
|
|
84
132
|
display: flex;
|
|
85
133
|
}
|
|
86
134
|
|
|
87
|
-
|
|
88
135
|
@media (min-width: 640px) {
|
|
89
136
|
|
|
90
137
|
.s-add-product-button-with-quick-buy {
|
|
@@ -92,19 +139,16 @@ salla-add-product-button[width=wide] {
|
|
|
92
139
|
}
|
|
93
140
|
}
|
|
94
141
|
|
|
95
|
-
|
|
96
142
|
.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-sticky-bar) {
|
|
97
143
|
flex-direction: column !important;
|
|
98
144
|
}
|
|
99
145
|
|
|
100
|
-
|
|
101
146
|
.s-add-product-button-main {
|
|
102
147
|
display: flex;
|
|
103
148
|
width: 66.666667%;
|
|
104
149
|
column-gap: 0.375rem;
|
|
105
150
|
}
|
|
106
151
|
|
|
107
|
-
|
|
108
152
|
@media (min-width: 640px) {
|
|
109
153
|
|
|
110
154
|
.s-add-product-button-main {
|
|
@@ -113,12 +157,10 @@ salla-add-product-button[width=wide] {
|
|
|
113
157
|
}
|
|
114
158
|
}
|
|
115
159
|
|
|
116
|
-
|
|
117
160
|
.s-add-product-button-with-sticky-bar salla-quick-buy {
|
|
118
161
|
width: 33.333333%;
|
|
119
162
|
}
|
|
120
163
|
|
|
121
|
-
|
|
122
164
|
@media (min-width: 640px) {
|
|
123
165
|
|
|
124
166
|
.s-add-product-button-with-sticky-bar salla-quick-buy {
|
|
@@ -126,33 +168,27 @@ salla-add-product-button[width=wide] {
|
|
|
126
168
|
}
|
|
127
169
|
}
|
|
128
170
|
|
|
129
|
-
|
|
130
171
|
.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-sticky-bar) .s-add-product-button-main {
|
|
131
172
|
width: 100%;
|
|
132
173
|
}
|
|
133
174
|
|
|
134
|
-
|
|
135
175
|
.s-add-product-button-with-quick-buy:not(.s-add-product-button-with-apple-pay) .s-add-product-button-main {
|
|
136
176
|
width: 100%;
|
|
137
177
|
}
|
|
138
178
|
|
|
139
|
-
|
|
140
179
|
.s-add-product-button-main:not(.w-full) > salla-button {
|
|
141
180
|
width: 50% !important;
|
|
142
181
|
}
|
|
143
182
|
|
|
144
|
-
|
|
145
183
|
.s-add-product-button-main .s-add-product-button-mini-checkout {
|
|
146
184
|
--salla-fast-checkout-button-border-radius: .75rem;
|
|
147
185
|
width: 50%;
|
|
148
186
|
}
|
|
149
187
|
|
|
150
|
-
|
|
151
188
|
.s-add-product-button-with-sticky-bar {
|
|
152
189
|
width: 100% !important;
|
|
153
190
|
}
|
|
154
191
|
|
|
155
|
-
|
|
156
192
|
@media (min-width: 640px) {
|
|
157
193
|
|
|
158
194
|
.s-add-product-button-with-sticky-bar {
|
|
@@ -160,12 +196,10 @@ salla-add-product-button[width=wide] {
|
|
|
160
196
|
}
|
|
161
197
|
}
|
|
162
198
|
|
|
163
|
-
|
|
164
199
|
.s-add-product-button-with-apple-pay {
|
|
165
200
|
column-gap: 0.375rem;
|
|
166
201
|
}
|
|
167
202
|
|
|
168
|
-
|
|
169
203
|
@media (min-width: 640px) {
|
|
170
204
|
|
|
171
205
|
.s-add-product-button-with-apple-pay {
|
|
@@ -173,17 +207,14 @@ salla-add-product-button[width=wide] {
|
|
|
173
207
|
}
|
|
174
208
|
}
|
|
175
209
|
|
|
176
|
-
|
|
177
210
|
.s-add-product-button-with-apple-pay:not(.s-add-product-button-with-sticky-bar) salla-quick-buy apple-pay-button {
|
|
178
211
|
margin-top: 0.625rem;
|
|
179
212
|
}
|
|
180
213
|
|
|
181
|
-
|
|
182
214
|
.s-add-product-button-with-sticky-bar salla-quick-buy .s-quick-buy-button .s-button-text span {
|
|
183
215
|
display: none;
|
|
184
216
|
}
|
|
185
217
|
|
|
186
|
-
|
|
187
218
|
@media (min-width: 768px) {
|
|
188
219
|
|
|
189
220
|
.s-add-product-button-with-sticky-bar salla-quick-buy .s-quick-buy-button .s-button-text span {
|
|
@@ -191,7 +222,6 @@ salla-add-product-button[width=wide] {
|
|
|
191
222
|
}
|
|
192
223
|
}
|
|
193
224
|
|
|
194
|
-
|
|
195
225
|
.s-add-product-button-mini-checkout-content {
|
|
196
226
|
display: flex;
|
|
197
227
|
flex-shrink: 0;
|
|
@@ -200,7 +230,6 @@ salla-add-product-button[width=wide] {
|
|
|
200
230
|
font-size: .8rem;
|
|
201
231
|
}
|
|
202
232
|
|
|
203
|
-
|
|
204
233
|
@media (min-width: 640px) {
|
|
205
234
|
|
|
206
235
|
.s-add-product-button-mini-checkout-content {
|
|
@@ -209,12 +238,10 @@ salla-add-product-button[width=wide] {
|
|
|
209
238
|
}
|
|
210
239
|
}
|
|
211
240
|
|
|
212
|
-
|
|
213
241
|
.s-add-product-button-mini-checkout-content:where([dir="rtl"], [dir="rtl"] *) {
|
|
214
242
|
flex-direction: row-reverse;
|
|
215
243
|
}
|
|
216
244
|
|
|
217
|
-
|
|
218
245
|
.s-add-product-button-mini-checkout-content svg {
|
|
219
246
|
margin-right: 0.375rem;
|
|
220
247
|
height: 1rem;
|
|
@@ -222,19 +249,16 @@ salla-add-product-button[width=wide] {
|
|
|
222
249
|
fill: currentColor;
|
|
223
250
|
}
|
|
224
251
|
|
|
225
|
-
|
|
226
252
|
.s-add-product-button-mini-checkout-content svg:where([dir="rtl"], [dir="rtl"] *) {
|
|
227
253
|
margin-right: 0px;
|
|
228
254
|
margin-left: 0.375rem;
|
|
229
255
|
}
|
|
230
256
|
|
|
231
|
-
|
|
232
257
|
.s-add-product-button-busy {
|
|
233
258
|
pointer-events: none;
|
|
234
259
|
position: relative;
|
|
235
260
|
}
|
|
236
261
|
|
|
237
|
-
|
|
238
262
|
.s-add-product-button-busy::after {
|
|
239
263
|
position: absolute;
|
|
240
264
|
top: 50%;
|
|
@@ -248,7 +272,6 @@ salla-add-product-button[width=wide] {
|
|
|
248
272
|
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));
|
|
249
273
|
}
|
|
250
274
|
|
|
251
|
-
|
|
252
275
|
@keyframes spin {
|
|
253
276
|
|
|
254
277
|
to {
|
|
@@ -257,7 +280,6 @@ salla-add-product-button[width=wide] {
|
|
|
257
280
|
}
|
|
258
281
|
}
|
|
259
282
|
|
|
260
|
-
|
|
261
283
|
.s-add-product-button-busy::after {
|
|
262
284
|
animation: spin 1s linear infinite;
|
|
263
285
|
border-radius: 9999px;
|
|
@@ -9,9 +9,16 @@ import Helper from "../../Helpers/Helper";
|
|
|
9
9
|
import { canCompleteApplePay, isApplePayHostedRedirect } from "@salla.sa/applepay/src/apple-pay-support";
|
|
10
10
|
import { OrderOptionsGate } from "../salla-order-options-modal/order-options-gate";
|
|
11
11
|
import { FastCheckoutGate } from "../salla-bullet-delivery/fast-checkout-gate";
|
|
12
|
+
import { appendOrderOptionsToPayload, ensureOrderOptionsModal } from "../salla-order-options-modal/apple-pay-order-options";
|
|
13
|
+
import { injectFreeProductsIntoPayload } from "../salla-order-options-modal/free-product-payload";
|
|
12
14
|
export class SallaAddProductButton {
|
|
13
15
|
constructor() {
|
|
14
16
|
this.hostAttributes = {};
|
|
17
|
+
this.buyNowBusy = false;
|
|
18
|
+
/** Latest buy-now click; an older click still waiting on Bullet Delivery drops out. */
|
|
19
|
+
this.buyNowToken = 0;
|
|
20
|
+
this.buyNowLastClick = 0;
|
|
21
|
+
this.buyNowLivePrice = 0;
|
|
15
22
|
/**
|
|
16
23
|
* Has Pre Order
|
|
17
24
|
*/
|
|
@@ -26,6 +33,7 @@ export class SallaAddProductButton {
|
|
|
26
33
|
this.productType = 'product';
|
|
27
34
|
this.selectedOptions = [];
|
|
28
35
|
this.buyNowText = salla.lang.get('pages.products.buy_now');
|
|
36
|
+
this.buyNowLoading = false;
|
|
29
37
|
/** Use matchMedia instead of window.innerWidth to avoid forced reflow (Lighthouse/PageSpeed) */
|
|
30
38
|
this.isDesktopViewport = typeof window !== 'undefined' ? window.matchMedia('(min-width: 768px)').matches : true;
|
|
31
39
|
this.viewportMediaQuery = null;
|
|
@@ -33,6 +41,9 @@ export class SallaAddProductButton {
|
|
|
33
41
|
this.orderOptionsGateAttached = false;
|
|
34
42
|
/** Guards one-time attachment of the fast-checkout Bullet Delivery gate (logic lives in FastCheckoutGate). */
|
|
35
43
|
this.fastCheckoutGateAttached = false;
|
|
44
|
+
this.onBuyNowPriceUpdated = (response) => {
|
|
45
|
+
this.buyNowLivePrice = Number(response?.data?.price) || this.buyNowLivePrice;
|
|
46
|
+
};
|
|
36
47
|
this.onViewportChange = (e) => {
|
|
37
48
|
this.isDesktopViewport = e.matches;
|
|
38
49
|
this.btn?.setText((e.matches && !!this.passedLabel) ? this.passedLabel : this.getLabel());
|
|
@@ -160,6 +171,105 @@ export class SallaAddProductButton {
|
|
|
160
171
|
type: this.supportStickyBar && !this.isDesktopViewport ? 'plain' : this.productType == 'donating' ? 'donate' : 'buy'
|
|
161
172
|
};
|
|
162
173
|
}
|
|
174
|
+
// Store setting: quick-buy skips the mini-checkout popup and goes straight to the checkout page.
|
|
175
|
+
get redirectsToCheckout() {
|
|
176
|
+
return salla.config.get('store.settings.buy_now.redirect_to_checkout') === true;
|
|
177
|
+
}
|
|
178
|
+
/** The fast-checkout slot renders and the store redirects, so the buy-now button is on the page. */
|
|
179
|
+
get showsBuyNowButton() {
|
|
180
|
+
return this.showQuickBuy
|
|
181
|
+
&& !!document.getElementById('fast-checkout-js')
|
|
182
|
+
&& !['financial_support', 'donating'].includes(this.productType)
|
|
183
|
+
&& this.redirectsToCheckout;
|
|
184
|
+
}
|
|
185
|
+
buyNowButton() {
|
|
186
|
+
return h("div", { class: "s-add-product-button-mini-checkout s-mini-checkout hide-scroll s-add-product-button-buy-now" }, h("button", { type: "button", class: `s-fast-checkout-button outline ${salla.lang.locale == 'ar' ? 'rtl' : 'ltr'}`, disabled: this.buyNowLoading, onClick: () => this.buyNowRedirect() }, h("div", { class: "s-add-product-button-mini-checkout-content" }, h("span", { innerHTML: WalletIcon }), this.buyNowText)));
|
|
187
|
+
}
|
|
188
|
+
async buyNowRedirect() {
|
|
189
|
+
// A double-click would reach Bullet Delivery twice, which stalls its guest gate.
|
|
190
|
+
const now = Date.now();
|
|
191
|
+
if (this.buyNowBusy || now - this.buyNowLastClick < 500) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this.buyNowLastClick = now;
|
|
195
|
+
const token = ++this.buyNowToken;
|
|
196
|
+
const optionsEl = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
197
|
+
if (optionsEl?.validateAndScroll && !(await optionsEl.validateAndScroll())) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
// Bullet Delivery's address gate, as the widget runs it; stays pending if the shopper backs out.
|
|
201
|
+
await salla.cart.event.beforeStartFastCheckout();
|
|
202
|
+
if (token !== this.buyNowToken || this.buyNowBusy) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.buyNowBusy = true;
|
|
206
|
+
let leaving = false;
|
|
207
|
+
try {
|
|
208
|
+
this.buyNowLoading = true;
|
|
209
|
+
const form = document.querySelector('form.product-form');
|
|
210
|
+
const data = form ? new FormData(form) : new FormData();
|
|
211
|
+
data.set('id', String(this.productId));
|
|
212
|
+
data.set('source', 'buy_now');
|
|
213
|
+
if (!(await this.collectOrderOptions(data))) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const resp = await salla.api.request('checkout/mini', data, 'post');
|
|
217
|
+
if (resp.data?.url) {
|
|
218
|
+
leaving = this.openCheckout(resp.data.url);
|
|
219
|
+
}
|
|
220
|
+
else if (resp.data?.to === 'login') {
|
|
221
|
+
salla.event.dispatch('login::open');
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
this.failed.emit(error);
|
|
226
|
+
}
|
|
227
|
+
finally {
|
|
228
|
+
if (!leaving) {
|
|
229
|
+
this.buyNowBusy = false;
|
|
230
|
+
this.buyNowLoading = false;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/** Order options and free offer products, as the widget collects them; false when the modal is dismissed. */
|
|
235
|
+
async collectOrderOptions(data) {
|
|
236
|
+
let resp;
|
|
237
|
+
try {
|
|
238
|
+
resp = await salla.api.withoutNotifier(() => salla.product.api.getOrderOptions([{ id: this.productId, quantity: Number(data.get('quantity')) || 1 }]));
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
salla?.logger?.warn?.('order-options: fetch failed', error);
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
const orderOptions = resp?.data?.order_options || [];
|
|
245
|
+
const freeProducts = (Array.isArray(resp?.data?.advance_free_product) ? resp.data.advance_free_product : [])
|
|
246
|
+
.filter((entry) => Array.isArray(entry?.options) && entry.options.length);
|
|
247
|
+
if (!orderOptions.length && !freeProducts.length) {
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
try {
|
|
251
|
+
const result = await ensureOrderOptionsModal().open({
|
|
252
|
+
orderOptions,
|
|
253
|
+
freeProducts,
|
|
254
|
+
basePrice: this.buyNowLivePrice || Number(resp?.data?.products?.[0]?.price?.amount) || 0,
|
|
255
|
+
});
|
|
256
|
+
appendOrderOptionsToPayload(data, result?.orderOptions || []);
|
|
257
|
+
injectFreeProductsIntoPayload(data, result?.freeProducts || []);
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/** Native SPA webviews own the checkout screen; returns true when this page navigates away. */
|
|
265
|
+
openCheckout(url) {
|
|
266
|
+
if (salla.mobile?.isSpaWebview?.() && salla.mobile.openCheckout) {
|
|
267
|
+
salla.mobile.openCheckout(url);
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
window.location.href = url;
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
163
273
|
miniCheckoutWidget() {
|
|
164
274
|
let storeId = salla.config.get('store.id');
|
|
165
275
|
if (!storeId) {
|
|
@@ -212,11 +322,14 @@ export class SallaAddProductButton {
|
|
|
212
322
|
} }, h("div", { class: {
|
|
213
323
|
's-add-product-button-main': this.showQuickBuy,
|
|
214
324
|
'w-full': !document.getElementById('fast-checkout-js') || ['financial_support', 'donating'].includes(this.productType) // This is a temporary fix until all themes fully support the fast checkout -- To be removed later
|
|
215
|
-
} }, h("salla-button", { color: this.productStatus === 'sale' ? 'primary' : 'light', type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale', "aria-label": this.isIconOnlyLabel ? this.addToCartLabel : undefined, ...this.getBtnAttributes(), "loader-position": "center" }, h("slot", null)), this.showQuickBuy && !!document.getElementById('fast-checkout-js') && !['financial_support', 'donating'].includes(this.productType) ? this.miniCheckoutWidget() : ''), this.showQuickBuy && this.isApplePayActive ? h("salla-quick-buy", { ...this.getQuickBuyBtnAttributes() }) : '');
|
|
325
|
+
} }, h("salla-button", { color: this.productStatus === 'sale' ? 'primary' : 'light', type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale', "aria-label": this.isIconOnlyLabel ? this.addToCartLabel : undefined, ...this.getBtnAttributes(), "loader-position": "center" }, h("slot", null)), this.showQuickBuy && !!document.getElementById('fast-checkout-js') && !['financial_support', 'donating'].includes(this.productType) ? (this.redirectsToCheckout ? this.buyNowButton() : this.miniCheckoutWidget()) : ''), this.showQuickBuy && this.isApplePayActive ? h("salla-quick-buy", { ...this.getQuickBuyBtnAttributes() }) : '');
|
|
216
326
|
}
|
|
217
327
|
async componentDidLoad() {
|
|
218
328
|
// Register this component for hooks system, already on it logic to run componentDidLoad trigger
|
|
219
329
|
await Salla.hooks.registerComponent('salla-add-product-button', this);
|
|
330
|
+
if (this.showsBuyNowButton) {
|
|
331
|
+
salla.product?.event?.onPriceUpdated?.(this.onBuyNowPriceUpdated);
|
|
332
|
+
}
|
|
220
333
|
if (!this.notifyOptionsAvailability) {
|
|
221
334
|
return;
|
|
222
335
|
}
|
|
@@ -265,6 +378,7 @@ export class SallaAddProductButton {
|
|
|
265
378
|
}
|
|
266
379
|
disconnectedCallback() {
|
|
267
380
|
this.viewportMediaQuery?.removeEventListener('change', this.onViewportChange);
|
|
381
|
+
salla.product?.event?.offPriceUpdated?.(this.onBuyNowPriceUpdated);
|
|
268
382
|
}
|
|
269
383
|
static get is() { return "salla-add-product-button"; }
|
|
270
384
|
static get originalStyleUrls() {
|
|
@@ -501,6 +615,7 @@ export class SallaAddProductButton {
|
|
|
501
615
|
"showQuickBuy": {},
|
|
502
616
|
"isApplePayActive": {},
|
|
503
617
|
"buyNowText": {},
|
|
618
|
+
"buyNowLoading": {},
|
|
504
619
|
"isDesktopViewport": {}
|
|
505
620
|
};
|
|
506
621
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
import LocationIcon from "./location-icon.svg";
|
|
6
|
+
const EARTH_RADIUS_KM = 6371;
|
|
7
|
+
const WARNING_KEY = 'pages.checkout.location_distance_warning';
|
|
8
|
+
const WARNING_FALLBACK = 'تبعد عن موقعك {distance} كم، وقد تكون اخترت عنوان توصيل غير صحيح.';
|
|
9
|
+
const toRadians = (degrees) => degrees * (Math.PI / 180);
|
|
10
|
+
/** Haversine distance between two coordinates in kilometres. */
|
|
11
|
+
export function calculateLocationDistanceKm(from, to) {
|
|
12
|
+
const latitudeDelta = toRadians(to.lat - from.lat);
|
|
13
|
+
const longitudeDelta = toRadians(to.lng - from.lng);
|
|
14
|
+
const fromLatitude = toRadians(from.lat);
|
|
15
|
+
const toLatitude = toRadians(to.lat);
|
|
16
|
+
const haversine = Math.sin(latitudeDelta / 2) ** 2 +
|
|
17
|
+
Math.cos(fromLatitude) *
|
|
18
|
+
Math.cos(toLatitude) *
|
|
19
|
+
Math.sin(longitudeDelta / 2) ** 2;
|
|
20
|
+
return EARTH_RADIUS_KM * 2 * Math.atan2(Math.sqrt(haversine), Math.sqrt(1 - haversine));
|
|
21
|
+
}
|
|
22
|
+
export const LocationDistanceWarning = ({ distanceKm, isRTL = false, }) => {
|
|
23
|
+
const distance = distanceKm.toFixed(1);
|
|
24
|
+
const message = Salla.lang
|
|
25
|
+
.getWithDefault(WARNING_KEY, WARNING_FALLBACK)
|
|
26
|
+
?.replace('{distance}', distance);
|
|
27
|
+
return (h("div", { class: "s-bullet-delivery-location-distance-warning", role: "alert" }, h("span", { class: "s-bullet-delivery-location-distance-warning-icon", innerHTML: LocationIcon, "aria-hidden": "true" }), h("span", { class: "s-bullet-delivery-location-distance-warning-text", style: { textAlign: isRTL ? 'right' : 'left' }, "data-testid": "salla-bullet-delivery-location-distance-warning-text" }, message)));
|
|
28
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 172 172" width="172" height="172">
|
|
2
|
+
<!-- White rounded background -->
|
|
3
|
+
<rect width="172" height="172" rx="64" fill="#FFFFFF"/>
|
|
4
|
+
|
|
5
|
+
<!-- Location / navigation icon -->
|
|
6
|
+
<path
|
|
7
|
+
d="M113.5 52.5
|
|
8
|
+
C108.5 52.5 101.5 54.5 93.5 57
|
|
9
|
+
L57.5 68.5
|
|
10
|
+
C53.5 69.8 51.8 72.2 53 75
|
|
11
|
+
C53.8 77 55.5 78.2 58 79
|
|
12
|
+
L79.5 86.5
|
|
13
|
+
C81.8 87.3 83.2 88.8 84 91.2
|
|
14
|
+
L90.5 113
|
|
15
|
+
C91.7 117 94 119.2 97 119.2
|
|
16
|
+
C100.8 119.2 103 116.5 104.2 112.8
|
|
17
|
+
L119 70.5
|
|
18
|
+
C121 64.5 121.8 58.5 119.2 55.2
|
|
19
|
+
C117.8 53.3 116 52.5 113.5 52.5 Z"
|
|
20
|
+
fill="#FFFFFF"
|
|
21
|
+
stroke="#000000"
|
|
22
|
+
stroke-width="5.5"
|
|
23
|
+
stroke-linecap="round"
|
|
24
|
+
stroke-linejoin="round"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
import LocationIcon from "./location-icon.svg";
|
|
6
|
+
const GEOLOCATION_TIMEOUT = 10000;
|
|
7
|
+
/** GeolocationPositionError.PERMISSION_DENIED — inlined; the class is absent in some test envs. */
|
|
8
|
+
const PERMISSION_DENIED = 1;
|
|
9
|
+
/** Action the Salla app listens for to open its own location-permission settings screen. */
|
|
10
|
+
const NATIVE_LOCATION_SETTINGS_ACTION = 'location.settings.open';
|
|
11
|
+
const NOTICE_KEY = 'pages.checkout.allow_location_permission';
|
|
12
|
+
const NOTICE_FALLBACK = 'اسمح بمشاركة موقعك لتحديد عنوانك تلقائيًا وبشكل أدق.';
|
|
13
|
+
/** Whether the notice should be rendered — only for a state we know is missing the permission. */
|
|
14
|
+
export const isLocationPermissionMissing = (state) => state === 'prompt' || state === 'denied';
|
|
15
|
+
/** `PermissionStatus` for geolocation, or null when the browser can't report it. */
|
|
16
|
+
async function queryLocationPermission() {
|
|
17
|
+
try {
|
|
18
|
+
if (!navigator?.permissions?.query || !navigator.geolocation)
|
|
19
|
+
return null;
|
|
20
|
+
return await navigator.permissions.query({ name: 'geolocation' });
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// Browsers that don't know the 'geolocation' descriptor throw instead of resolving.
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export async function getLocationPermissionState() {
|
|
28
|
+
const status = await queryLocationPermission();
|
|
29
|
+
return status?.state ?? 'unknown';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Reads the permission state and keeps reporting it while it changes, so the notice disappears the
|
|
33
|
+
* moment the customer grants access elsewhere (browser bar, OS settings) without a manual refresh.
|
|
34
|
+
*
|
|
35
|
+
* @returns an unsubscribe function — call it on disconnect.
|
|
36
|
+
*/
|
|
37
|
+
export function watchLocationPermission(onChange) {
|
|
38
|
+
let stopped = false;
|
|
39
|
+
let status = null;
|
|
40
|
+
const handleChange = () => {
|
|
41
|
+
if (!stopped && status)
|
|
42
|
+
onChange(status.state);
|
|
43
|
+
};
|
|
44
|
+
queryLocationPermission().then(result => {
|
|
45
|
+
if (stopped)
|
|
46
|
+
return;
|
|
47
|
+
status = result;
|
|
48
|
+
if (!status) {
|
|
49
|
+
onChange('unknown');
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
onChange(status.state);
|
|
53
|
+
status.addEventListener?.('change', handleChange);
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
stopped = true;
|
|
57
|
+
status?.removeEventListener?.('change', handleChange);
|
|
58
|
+
status = null;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Hands the request to the Salla app inside a native webview; it opens its permission settings. */
|
|
62
|
+
function openNativeLocationSettings() {
|
|
63
|
+
const mobile = typeof Salla !== 'undefined' ? Salla.mobile : null;
|
|
64
|
+
if (!mobile?.isSpaWebview?.())
|
|
65
|
+
return false;
|
|
66
|
+
mobile.action?.(NATIVE_LOCATION_SETTINGS_ACTION);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Acts on a tap of the notice: native apps deep-link into their settings, the web always calls
|
|
71
|
+
* `getCurrentPosition` so the browser can re-show its permission dialog when the state is still
|
|
72
|
+
* `prompt`. If the site is permanently blocked, browsers stay silent and fail with
|
|
73
|
+
* `PERMISSION_DENIED`.
|
|
74
|
+
*/
|
|
75
|
+
export async function requestLocationPermission() {
|
|
76
|
+
const current = await getLocationPermissionState();
|
|
77
|
+
if (openNativeLocationSettings()) {
|
|
78
|
+
return { state: current, handledByApp: true };
|
|
79
|
+
}
|
|
80
|
+
if (!navigator?.geolocation) {
|
|
81
|
+
return { state: 'denied', handledByApp: false };
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const { coords } = await new Promise((resolve, reject) => navigator.geolocation.getCurrentPosition(resolve, reject, {
|
|
85
|
+
enableHighAccuracy: true,
|
|
86
|
+
timeout: GEOLOCATION_TIMEOUT,
|
|
87
|
+
maximumAge: 0,
|
|
88
|
+
}));
|
|
89
|
+
return {
|
|
90
|
+
state: 'granted',
|
|
91
|
+
handledByApp: false,
|
|
92
|
+
position: { lat: coords.latitude, lng: coords.longitude },
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
// PERMISSION_DENIED means the browser will not (or did not) grant access — including the
|
|
97
|
+
// permanently-blocked case where no dialog appears. Timeouts / unavailable positions are not
|
|
98
|
+
// a refusal, so the previous state is kept.
|
|
99
|
+
const denied = error?.code === PERMISSION_DENIED;
|
|
100
|
+
return { state: denied ? 'denied' : current, handledByApp: false };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export const LocationPermissionNotice = ({ isRTL = false, onActivate, }) => (h("div", { class: "s-bullet-delivery-location-permission" }, h("button", { type: "button", class: "s-bullet-delivery-location-permission-btn", onClick: onActivate }, h("span", { class: "s-bullet-delivery-location-permission-icon", innerHTML: LocationIcon, "aria-hidden": "true" }), h("span", { class: "s-bullet-delivery-location-permission-text", style: { textAlign: isRTL ? 'right' : 'left' }, "data-testid": "salla-bullet-delivery-location-permission-text" }, Salla.lang.getWithDefault(NOTICE_KEY, NOTICE_FALLBACK)), h("i", { class: `s-bullet-delivery-location-permission-arrow ${isRTL ? 'sicon-keyboard_arrow_left' : 'sicon-keyboard_arrow_right'}`, "aria-hidden": "true" }))));
|