@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
|
@@ -53,6 +53,75 @@
|
|
|
53
53
|
text-transform: uppercase;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
.s-bullet-delivery-location-permission-btn {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 10px;
|
|
60
|
+
width: 100%;
|
|
61
|
+
padding: 12px;
|
|
62
|
+
border: none;
|
|
63
|
+
border-radius: 8px;
|
|
64
|
+
background: #fdf2f2;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
text-align: start;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* The asset is a 172x172 white badge with its own colors baked in, so it only needs sizing. */
|
|
70
|
+
.s-bullet-delivery-location-permission-icon {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
width: 34px;
|
|
74
|
+
height: 34px;
|
|
75
|
+
}
|
|
76
|
+
.s-bullet-delivery-location-permission-icon svg {
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.s-bullet-delivery-location-permission-text {
|
|
82
|
+
flex: 1;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
line-height: 18px;
|
|
86
|
+
color: #444;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.s-bullet-delivery-location-permission-arrow {
|
|
90
|
+
flex-shrink: 0;
|
|
91
|
+
font-size: 16px;
|
|
92
|
+
color: #666;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.s-bullet-delivery-location-distance-warning {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: 10px;
|
|
99
|
+
width: 100%;
|
|
100
|
+
padding: 12px;
|
|
101
|
+
border-radius: 8px;
|
|
102
|
+
background: #fff8e1;
|
|
103
|
+
animation: s-bullet-delivery-fade-in 200ms ease;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.s-bullet-delivery-location-distance-warning-icon {
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
flex-shrink: 0;
|
|
109
|
+
width: 34px;
|
|
110
|
+
height: 34px;
|
|
111
|
+
}
|
|
112
|
+
.s-bullet-delivery-location-distance-warning-icon svg {
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100%;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.s-bullet-delivery-location-distance-warning-text {
|
|
118
|
+
flex: 1;
|
|
119
|
+
min-width: 0;
|
|
120
|
+
font-size: 12px;
|
|
121
|
+
line-height: 18px;
|
|
122
|
+
color: #444;
|
|
123
|
+
}
|
|
124
|
+
|
|
56
125
|
.s-bullet-delivery-map-container {
|
|
57
126
|
width: 100%;
|
|
58
127
|
height: 320px;
|
|
@@ -1339,3 +1408,70 @@
|
|
|
1339
1408
|
flex-shrink: 0;
|
|
1340
1409
|
align-self: center;
|
|
1341
1410
|
}
|
|
1411
|
+
.s-bullet-delivery-location-permission-btn{
|
|
1412
|
+
display: flex;
|
|
1413
|
+
width: 100%;
|
|
1414
|
+
cursor: pointer;
|
|
1415
|
+
align-items: center;
|
|
1416
|
+
gap: 0.625rem;
|
|
1417
|
+
border-radius: 0.5rem;
|
|
1418
|
+
border-width: 0px;
|
|
1419
|
+
padding: 0.75rem;
|
|
1420
|
+
text-align: start;
|
|
1421
|
+
background: #fdf2f2;
|
|
1422
|
+
}
|
|
1423
|
+
.s-bullet-delivery-location-permission-icon{
|
|
1424
|
+
display: inline-flex;
|
|
1425
|
+
height: 34px;
|
|
1426
|
+
width: 34px;
|
|
1427
|
+
flex-shrink: 0;
|
|
1428
|
+
}
|
|
1429
|
+
.s-bullet-delivery-location-permission-icon svg{
|
|
1430
|
+
height: 100%;
|
|
1431
|
+
width: 100%;
|
|
1432
|
+
}
|
|
1433
|
+
.s-bullet-delivery-location-permission-text{
|
|
1434
|
+
min-width: 0px;
|
|
1435
|
+
flex: 1 1 0%;
|
|
1436
|
+
font-size: 0.75rem;
|
|
1437
|
+
line-height: 1rem;
|
|
1438
|
+
line-height: 18px;
|
|
1439
|
+
--tw-text-opacity: 1;
|
|
1440
|
+
color: rgb(68 68 68 / var(--tw-text-opacity, 1));
|
|
1441
|
+
}
|
|
1442
|
+
.s-bullet-delivery-location-permission-arrow{
|
|
1443
|
+
flex-shrink: 0;
|
|
1444
|
+
font-size: 1rem;
|
|
1445
|
+
line-height: 1.5rem;
|
|
1446
|
+
--tw-text-opacity: 1;
|
|
1447
|
+
color: rgb(102 102 102 / var(--tw-text-opacity, 1));
|
|
1448
|
+
}
|
|
1449
|
+
.s-bullet-delivery-location-distance-warning{
|
|
1450
|
+
display: flex;
|
|
1451
|
+
width: 100%;
|
|
1452
|
+
animation: s-bullet-delivery-fade-in 200ms ease;
|
|
1453
|
+
align-items: center;
|
|
1454
|
+
gap: 0.625rem;
|
|
1455
|
+
border-radius: 0.5rem;
|
|
1456
|
+
padding: 0.75rem;
|
|
1457
|
+
background: #fff8e1;
|
|
1458
|
+
}
|
|
1459
|
+
.s-bullet-delivery-location-distance-warning-icon{
|
|
1460
|
+
display: inline-flex;
|
|
1461
|
+
height: 34px;
|
|
1462
|
+
width: 34px;
|
|
1463
|
+
flex-shrink: 0;
|
|
1464
|
+
}
|
|
1465
|
+
.s-bullet-delivery-location-distance-warning-icon svg{
|
|
1466
|
+
height: 100%;
|
|
1467
|
+
width: 100%;
|
|
1468
|
+
}
|
|
1469
|
+
.s-bullet-delivery-location-distance-warning-text{
|
|
1470
|
+
min-width: 0px;
|
|
1471
|
+
flex: 1 1 0%;
|
|
1472
|
+
font-size: 0.75rem;
|
|
1473
|
+
line-height: 1rem;
|
|
1474
|
+
line-height: 18px;
|
|
1475
|
+
--tw-text-opacity: 1;
|
|
1476
|
+
color: rgb(68 68 68 / var(--tw-text-opacity, 1));
|
|
1477
|
+
}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h, Host, } from "@stencil/core";
|
|
5
5
|
import { bulletDeliveryAPI, clearApiCache, isSaudiArabia } from "./api-service";
|
|
6
|
-
import { filterBranches, findNearestBranch, getGeolocationErrorMessage, getIntentBranchId, getIntentCityId, getIntentCountryCode, getIntentCountryId, getIntentDistrictId, getIntentLatitude, getIntentLongitude, getIntentRegionId, getIntentSubtitle, hasSessionAddressIntent,
|
|
6
|
+
import { filterBranches, findNearestBranch, getGeolocationErrorMessage, getIntentBranchId, getIntentCityId, getIntentCountryCode, getIntentCountryId, getIntentDistrictId, getIntentLatitude, getIntentLongitude, getIntentRegionId, getIntentSubtitle, hasSessionAddressIntent, isBranchSelectable, isMapOriginIntent, requireRegionAndDistrictForSA, } from "./helpers";
|
|
7
|
+
/* Location permission notice */
|
|
8
|
+
import { isLocationPermissionMissing, LocationPermissionNotice, requestLocationPermission, watchLocationPermission, } from "./location-permission-notice";
|
|
9
|
+
import { calculateLocationDistanceKm, LocationDistanceWarning, } from "./location-distance-warning";
|
|
7
10
|
const BRANCH_SEARCH_DEBOUNCE_MS = 1000;
|
|
8
11
|
const GEOLOCATION_TIMEOUT = 10000;
|
|
9
12
|
/** Final fallback center used only if `user.default_geo_location` is absent (Riyadh — matches checkout map-page). */
|
|
@@ -127,6 +130,14 @@ export class SallaBulletDelivery {
|
|
|
127
130
|
/** True while reverse-geocoding a map-click/geolocation pick (no place from the map component itself). */
|
|
128
131
|
this.reverseGeocoding = false;
|
|
129
132
|
this.confirming = false;
|
|
133
|
+
/** Location-sharing permission, watched so the map-view notice follows it live (SHPD-10429). */
|
|
134
|
+
this.locationPermission = 'unknown';
|
|
135
|
+
this.stopWatchingLocationPermission = null;
|
|
136
|
+
/** False until the Permissions API watch reports at least once — gates auto-locate so we don't
|
|
137
|
+
* consume the browser prompt before we know whether the notice should own it. */
|
|
138
|
+
this.locationPermissionResolved = false;
|
|
139
|
+
/** Customer's live position, kept separate from the selected delivery pin. */
|
|
140
|
+
this.liveLocation = null;
|
|
130
141
|
this.newAddressForm = {
|
|
131
142
|
...SallaBulletDelivery.INITIAL_ADDRESS_FORM,
|
|
132
143
|
};
|
|
@@ -236,23 +247,46 @@ export class SallaBulletDelivery {
|
|
|
236
247
|
this.gmapRef.resize();
|
|
237
248
|
}
|
|
238
249
|
this.updateLocationBias();
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
this.locateOnMap();
|
|
251
|
+
if (this.locationPermission === 'granted' && !this.liveLocation) {
|
|
252
|
+
void this.handleLocationPermissionChanged('granted');
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
/** Tap on the location-permission notice: prompt (or deep-link into the app's settings). */
|
|
256
|
+
this.handleLocationPermissionRequest = async () => {
|
|
257
|
+
const outcome = await requestLocationPermission();
|
|
258
|
+
if (outcome.handledByApp)
|
|
259
|
+
return; // native app owns the screen from here
|
|
260
|
+
await this.handleLocationPermissionChanged(outcome.state, outcome.position);
|
|
261
|
+
if (outcome.state === 'granted')
|
|
262
|
+
this.locateOnMap(true);
|
|
263
|
+
};
|
|
264
|
+
this.handleLocationPermissionChanged = async (state, knownPosition) => {
|
|
265
|
+
this.locationPermission = state;
|
|
266
|
+
if (state !== 'granted') {
|
|
267
|
+
this.liveLocation = null;
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (knownPosition) {
|
|
271
|
+
this.liveLocation = knownPosition;
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
// Only the map view reads liveLocation — skip the GPS fix until it opens (handleMapReady catches up).
|
|
275
|
+
if (!navigator.geolocation || !this.mapReady)
|
|
276
|
+
return;
|
|
277
|
+
try {
|
|
278
|
+
const position = await new Promise((resolve, reject) => navigator.geolocation.getCurrentPosition(resolve, reject, {
|
|
279
|
+
enableHighAccuracy: true,
|
|
280
|
+
timeout: GEOLOCATION_TIMEOUT,
|
|
281
|
+
maximumAge: 0,
|
|
282
|
+
}));
|
|
283
|
+
this.liveLocation = {
|
|
284
|
+
lat: position.coords.latitude,
|
|
285
|
+
lng: position.coords.longitude,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
log('Live location capture failed', error);
|
|
256
290
|
}
|
|
257
291
|
};
|
|
258
292
|
// ─── End Map methods ───
|
|
@@ -1354,6 +1388,45 @@ export class SallaBulletDelivery {
|
|
|
1354
1388
|
: this.mapInitialCenter;
|
|
1355
1389
|
this.gmapRef.autocompleteLocationBias = { center, radius: 500000 };
|
|
1356
1390
|
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Auto-locate the customer so the map never opens "empty" — matches checkout map-page
|
|
1393
|
+
* (getCurrentLocation(true) pans to the resolved position). Skipped when a location is already
|
|
1394
|
+
* set (e.g. returning from the confirm step). Falls back silently to mapInitialCenter if denied.
|
|
1395
|
+
*
|
|
1396
|
+
* When location permission is still missing (`prompt` / `denied`), we deliberately do NOT call
|
|
1397
|
+
* into geolocation here — that would consume the browser's one-shot permission dialog before the
|
|
1398
|
+
* notice tap can re-trigger it (SHPD-10429). Auto-locate runs once permission is granted
|
|
1399
|
+
* (via the watch or a successful notice tap), or when the Permissions API is unavailable
|
|
1400
|
+
* (`unknown`) because that surface never shows the notice.
|
|
1401
|
+
*
|
|
1402
|
+
* @param force re-locates even after the one-per-flow auto attempt — used once the customer
|
|
1403
|
+
* grants the permission from the notice, so the map catches up without a manual refresh.
|
|
1404
|
+
*/
|
|
1405
|
+
locateOnMap(force = false) {
|
|
1406
|
+
if (!this.gmapRef)
|
|
1407
|
+
return;
|
|
1408
|
+
if (!force) {
|
|
1409
|
+
if (this.autoGeolocationTriggered || this.hasMapLocation())
|
|
1410
|
+
return;
|
|
1411
|
+
// Wait until we know the permission state, then leave prompt/denied for the notice tap.
|
|
1412
|
+
if (!this.locationPermissionResolved || isLocationPermissionMissing(this.locationPermission)) {
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
const getCurrentLocation = this.gmapRef.getCurrentLocation;
|
|
1417
|
+
if (typeof getCurrentLocation !== 'function')
|
|
1418
|
+
return;
|
|
1419
|
+
this.autoGeolocationTriggered = true;
|
|
1420
|
+
try {
|
|
1421
|
+
const result = getCurrentLocation.call(this.gmapRef, true);
|
|
1422
|
+
if (result && typeof result.catch === 'function') {
|
|
1423
|
+
result.catch((err) => log('Auto geolocation failed', err));
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
catch (err) {
|
|
1427
|
+
log('Auto geolocation threw', err);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1357
1430
|
hasMapLocation() {
|
|
1358
1431
|
return this.mapLocationData?.lat != null && this.mapLocationData?.lng != null;
|
|
1359
1432
|
}
|
|
@@ -2338,10 +2411,34 @@ export class SallaBulletDelivery {
|
|
|
2338
2411
|
const address = this.mapLocationData?.formattedAddress ?? '';
|
|
2339
2412
|
return (h("div", { class: "s-bullet-delivery-address-confirm" }, h("div", { class: "s-bullet-delivery-address-confirm-card" }, h("span", { class: "s-bullet-delivery-address-map-icon", innerHTML: MiniMap, "aria-hidden": "true" }), h("div", { class: "s-bullet-delivery-address-confirm-details" }, h("span", { class: "s-bullet-delivery-address-confirm-label" }, Salla.lang.get('pages.checkout.selected_address')), h("p", { class: "s-bullet-delivery-address-confirm-text" }, address))), h("div", { class: "s-bullet-delivery-address-confirm-description" }, h("label", { class: "s-bullet-delivery-address-confirm-description-label" }, Salla.lang.get('pages.checkout.address_description'), h("span", { class: "s-bullet-delivery-address-confirm-description-optional" }, Salla.lang.get('common.elements.optional'))), h("input", { type: "text", class: "s-bullet-delivery-address-confirm-description-input form-input", placeholder: Salla.lang.get('pages.checkout.address_description_placeholder'), value: this.addressDescription, onInput: (e) => { this.addressDescription = e.target.value; } }))));
|
|
2340
2413
|
}
|
|
2414
|
+
/** Notice prompting the customer to allow location sharing; only while it isn't granted. */
|
|
2415
|
+
renderLocationPermissionNotice() {
|
|
2416
|
+
if (!isLocationPermissionMissing(this.locationPermission))
|
|
2417
|
+
return null;
|
|
2418
|
+
return (h(LocationPermissionNotice, { isRTL: this.isRTL, onActivate: this.handleLocationPermissionRequest }));
|
|
2419
|
+
}
|
|
2420
|
+
renderLocationDistanceWarning() {
|
|
2421
|
+
const selectedLocation = this.mapLocationData;
|
|
2422
|
+
if (this.locationPermission !== 'granted' ||
|
|
2423
|
+
!this.liveLocation ||
|
|
2424
|
+
selectedLocation?.lat == null ||
|
|
2425
|
+
selectedLocation?.lng == null) {
|
|
2426
|
+
return null;
|
|
2427
|
+
}
|
|
2428
|
+
const distanceKm = calculateLocationDistanceKm(this.liveLocation, {
|
|
2429
|
+
lat: selectedLocation.lat,
|
|
2430
|
+
lng: selectedLocation.lng,
|
|
2431
|
+
});
|
|
2432
|
+
if (distanceKm <= 0.5)
|
|
2433
|
+
return null;
|
|
2434
|
+
return h(LocationDistanceWarning, { distanceKm: distanceKm, isRTL: this.isRTL });
|
|
2435
|
+
}
|
|
2341
2436
|
renderGuestDeliveryForm() {
|
|
2342
2437
|
if (this.isMapModeAvailable) {
|
|
2343
2438
|
return [
|
|
2344
2439
|
this.renderMapSection(),
|
|
2440
|
+
this.renderLocationPermissionNotice(),
|
|
2441
|
+
this.renderLocationDistanceWarning(),
|
|
2345
2442
|
this.hasMapLocation() ? this.renderAddressConfirmation() : null,
|
|
2346
2443
|
];
|
|
2347
2444
|
}
|
|
@@ -2602,6 +2699,17 @@ export class SallaBulletDelivery {
|
|
|
2602
2699
|
this.closeHandler = this.close.bind(this);
|
|
2603
2700
|
Salla.event.on("salla::bullet-delivery.modal.close.requested", this.closeHandler);
|
|
2604
2701
|
this.isRTL = Salla.config.get("theme.is_rtl");
|
|
2702
|
+
// Reading the permission never prompts, so it's safe to watch from here — the map view then
|
|
2703
|
+
// renders the notice (or not) on its first paint instead of a frame later.
|
|
2704
|
+
this.stopWatchingLocationPermission = watchLocationPermission(state => {
|
|
2705
|
+
this.locationPermissionResolved = true;
|
|
2706
|
+
void this.handleLocationPermissionChanged(state).then(() => {
|
|
2707
|
+
// Permission often resolves after the map is ready — catch up for granted / unknown
|
|
2708
|
+
// so we still auto-pan without having consumed the prompt for prompt/denied.
|
|
2709
|
+
if (this.mapReady && !isLocationPermissionMissing(state))
|
|
2710
|
+
this.locateOnMap();
|
|
2711
|
+
});
|
|
2712
|
+
});
|
|
2605
2713
|
this.authLoggedInHandler = async () => {
|
|
2606
2714
|
if (this.cartSubmitConfirmationPending) {
|
|
2607
2715
|
await this.handlePendingSubmitAfterLogin();
|
|
@@ -2646,7 +2754,7 @@ export class SallaBulletDelivery {
|
|
|
2646
2754
|
return null; // no-op when disabled
|
|
2647
2755
|
return (h(Host, { class: "s-bullet-delivery" }, h("salla-modal", { ref: modal => {
|
|
2648
2756
|
this.modal = modal;
|
|
2649
|
-
}, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm" }, h("div", { class: "s-bullet-delivery-inner" }, h("div", { class: "s-bullet-delivery-header" }, h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
|
|
2757
|
+
}, isClosable: !this.isRequired && !this.shouldForceNonClosable(), class: "s-bullet-delivery-modal", width: "sm", "data-testid": "salla-bullet-delivery-modal" }, h("div", { class: "s-bullet-delivery-inner" }, h("div", { class: "s-bullet-delivery-header" }, h("h2", { class: "s-bullet-delivery-title" }, this.activeTab === 'address'
|
|
2650
2758
|
? Salla.lang.get('blocks.home.add_address_for_order_delivery')
|
|
2651
2759
|
: Salla.lang.get('blocks.home.choose_branch_for_order_pickup')), h("p", { class: "s-bullet-delivery-subtitle" }, this.activeTab === 'address'
|
|
2652
2760
|
? Salla.lang.get('blocks.home.products_available_for_delivery_shown_while_shopping')
|
|
@@ -2726,6 +2834,10 @@ export class SallaBulletDelivery {
|
|
|
2726
2834
|
}
|
|
2727
2835
|
disconnectedCallback() {
|
|
2728
2836
|
this.componentReady = false;
|
|
2837
|
+
if (this.stopWatchingLocationPermission) {
|
|
2838
|
+
this.stopWatchingLocationPermission();
|
|
2839
|
+
this.stopWatchingLocationPermission = null;
|
|
2840
|
+
}
|
|
2729
2841
|
Salla.event.off("salla::bullet-delivery.modal.open.requested", this.bulletDeliveryOpenHandler);
|
|
2730
2842
|
if (this.closeHandler) {
|
|
2731
2843
|
Salla.event.off("salla::bullet-delivery.modal.close.requested", this.closeHandler);
|
|
@@ -2833,6 +2945,8 @@ export class SallaBulletDelivery {
|
|
|
2833
2945
|
"addressDescription": {},
|
|
2834
2946
|
"reverseGeocoding": {},
|
|
2835
2947
|
"confirming": {},
|
|
2948
|
+
"locationPermission": {},
|
|
2949
|
+
"liveLocation": {},
|
|
2836
2950
|
"newAddressForm": {}
|
|
2837
2951
|
};
|
|
2838
2952
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the ApplePaySession and drives it via callbacks.
|
|
8
8
|
*/
|
|
9
9
|
/** Get-or-create the singleton order-options modal on <body>. */
|
|
10
|
-
function ensureOrderOptionsModal() {
|
|
10
|
+
export function ensureOrderOptionsModal() {
|
|
11
11
|
let modal = document.querySelector('salla-order-options-modal');
|
|
12
12
|
if (!modal) {
|
|
13
13
|
modal = document.createElement('salla-order-options-modal');
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import "@salla.sa/twilight";
|
|
5
5
|
import LazyLoad from "vanilla-lazyload";
|
|
6
6
|
import { BASE_CSS } from "./base-css";
|
|
7
|
+
import { reportChunkErrors } from "./chunk-errors";
|
|
7
8
|
// Marks twilight chunk styles so the global script can spot them at runtime.
|
|
8
9
|
const TWILIGHT_STYLE_MARKER = '/*!twlt*/';
|
|
9
10
|
// Before the theme's first stylesheet, so theme rules win equal-specificity collisions.
|
|
@@ -62,6 +63,7 @@ function pinTwilightStyles() {
|
|
|
62
63
|
}).observe(document.head, { childList: true });
|
|
63
64
|
}
|
|
64
65
|
export default function () {
|
|
66
|
+
reportChunkErrors();
|
|
65
67
|
injectBaseStyles();
|
|
66
68
|
pinTwilightStyles();
|
|
67
69
|
// Only initialize it one time for the entire application
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// The spec environment already provides the salla global; booting the real SDK here needs a full store.
|
|
2
|
+
jest.mock('@salla.sa/twilight', () => ({}));
|
|
3
|
+
jest.mock('vanilla-lazyload', () => jest.fn().mockImplementation(() => ({ update: jest.fn() })));
|
|
4
|
+
|
|
5
|
+
import { consoleError } from '@stencil/core/internal/testing';
|
|
6
|
+
import app from './app';
|
|
7
|
+
|
|
8
|
+
describe('global app script', () => {
|
|
9
|
+
const originalInfiniteScroll = (salla as any).infiniteScroll;
|
|
10
|
+
const originalSalla = window.Salla;
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
(salla as any).infiniteScroll = { event: { onAppend: jest.fn() } };
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
(salla as any).infiniteScroll = originalInfiniteScroll;
|
|
18
|
+
window.Salla = originalSalla;
|
|
19
|
+
jest.restoreAllMocks();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('forwards component errors Stencil reports to the error monitor after boot', () => {
|
|
23
|
+
const captureChunkError = jest.fn();
|
|
24
|
+
window.Salla = { errorMonitor: { captureChunkError } } as any;
|
|
25
|
+
jest.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
26
|
+
const error = new TypeError('Failed to fetch dynamically imported module: https://cdn/p-1.entry.js');
|
|
27
|
+
|
|
28
|
+
app();
|
|
29
|
+
consoleError(error);
|
|
30
|
+
|
|
31
|
+
expect(captureChunkError).toHaveBeenCalledWith(error, undefined);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '@salla.sa/twilight'
|
|
2
2
|
import LazyLoad from "vanilla-lazyload";
|
|
3
3
|
import { BASE_CSS } from './base-css';
|
|
4
|
+
import { reportChunkErrors } from './chunk-errors';
|
|
4
5
|
|
|
5
6
|
// Marks twilight chunk styles so the global script can spot them at runtime.
|
|
6
7
|
const TWILIGHT_STYLE_MARKER = '/*!twlt*/';
|
|
@@ -60,6 +61,7 @@ function pinTwilightStyles() {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
export default function () {
|
|
64
|
+
reportChunkErrors();
|
|
63
65
|
injectBaseStyles();
|
|
64
66
|
pinTwilightStyles();
|
|
65
67
|
// Only initialize it one time for the entire application
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { setErrorHandler } from "@stencil/core";
|
|
5
|
+
// Stencil swallows a failed chunk import() and only throws `Constructor for "<tag>#…" was not found`
|
|
6
|
+
// later; forward the original error so the frontend-error log shows why the chunk failed.
|
|
7
|
+
// console.error keeps Stencil's default output, which this handler replaces.
|
|
8
|
+
export function forwardComponentError(error, element) {
|
|
9
|
+
console.error(error, element);
|
|
10
|
+
window.Salla?.errorMonitor?.captureChunkError(error, element);
|
|
11
|
+
}
|
|
12
|
+
export function reportChunkErrors() {
|
|
13
|
+
setErrorHandler(forwardComponentError);
|
|
14
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// consoleError is the platform hook Stencil's lazy loader reports a failed chunk import() through.
|
|
2
|
+
import { consoleError } from '@stencil/core/internal/testing';
|
|
3
|
+
import { forwardComponentError, reportChunkErrors } from './chunk-errors';
|
|
4
|
+
|
|
5
|
+
describe('chunk-errors', () => {
|
|
6
|
+
const originalSalla = window.Salla;
|
|
7
|
+
let captureChunkError: jest.Mock;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
captureChunkError = jest.fn();
|
|
11
|
+
window.Salla = { errorMonitor: { captureChunkError } };
|
|
12
|
+
jest.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
window.Salla = originalSalla;
|
|
17
|
+
jest.restoreAllMocks();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('routes errors Stencil reports to the error monitor once registered', () => {
|
|
21
|
+
const error = new TypeError('Failed to fetch dynamically imported module: https://cdn/p-1.entry.js');
|
|
22
|
+
const element = document.createElement('salla-button');
|
|
23
|
+
|
|
24
|
+
reportChunkErrors();
|
|
25
|
+
consoleError(error, element);
|
|
26
|
+
|
|
27
|
+
expect(captureChunkError).toHaveBeenCalledWith(error, element);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('hands the swallowed import() error and its element to the error monitor', () => {
|
|
31
|
+
const error = new TypeError('Failed to fetch dynamically imported module: https://cdn/p-1.entry.js');
|
|
32
|
+
const element = document.createElement('salla-button');
|
|
33
|
+
|
|
34
|
+
forwardComponentError(error, element);
|
|
35
|
+
|
|
36
|
+
expect(captureChunkError).toHaveBeenCalledWith(error, element);
|
|
37
|
+
expect(console.error).toHaveBeenCalledWith(error, element);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('keeps logging to the console when the Salla SDK is not loaded', () => {
|
|
41
|
+
window.Salla = undefined;
|
|
42
|
+
const error = new Error('boom');
|
|
43
|
+
|
|
44
|
+
expect(() => forwardComponentError(error)).not.toThrow();
|
|
45
|
+
expect(console.error).toHaveBeenCalledWith(error, undefined);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { setErrorHandler } from '@stencil/core';
|
|
2
|
+
|
|
3
|
+
// Stencil swallows a failed chunk import() and only throws `Constructor for "<tag>#…" was not found`
|
|
4
|
+
// later; forward the original error so the frontend-error log shows why the chunk failed.
|
|
5
|
+
// console.error keeps Stencil's default output, which this handler replaces.
|
|
6
|
+
export function forwardComponentError(error: unknown, element?: Element) {
|
|
7
|
+
console.error(error, element);
|
|
8
|
+
window.Salla?.errorMonitor?.captureChunkError(error, element);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function reportChunkErrors() {
|
|
12
|
+
setErrorHandler(forwardComponentError);
|
|
13
|
+
}
|
|
@@ -92,4 +92,4 @@ async function resolveApplePayOrderOptions(opts) {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
export {
|
|
95
|
+
export { appendOrderOptionsToPayload as a, reportProductOptionsValiditySync as b, ensureOrderOptionsModal as e, resolveApplePayOrderOptions as r };
|