@salla.sa/twilight-components 2.14.467 → 2.14.469
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/{filepond-Li5IcLEr.js → filepond-CG7dNZgq.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CXgEvsrj.js → filepond-plugin-file-poster-B1zrjwgr.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DISjKBXN.js → filepond-plugin-file-validate-size-BqZtoWbe.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BeDqb2RU.js → filepond-plugin-file-validate-type-BGmGKK9L.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CTKgasCY.js → filepond-plugin-image-edit-CYeh6qmG.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BqvyVbfM.js → filepond-plugin-image-exif-orientation-BEVpo-ZQ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DfX-wD-s.js → filepond-plugin-image-preview-C7MMEZFE.js} +1 -1
- package/dist/cjs/{functions-DXNacMtu.js → functions-CnBVKKGk.js} +1 -1
- package/dist/cjs/{index-2n84VIdz.js → index-BNOCK3IN.js} +1 -1
- package/dist/cjs/{index-JuURs8Nc.js → index-inmL4H71.js} +9 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mail-Bgvt2hc9.js → mail-C9D8MHae.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 +29 -84
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +91 -7
- 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-cashback-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- 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-gifting.cjs.entry.js +85 -31
- 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 +32 -2
- package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +4 -4
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- 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.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.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.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-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-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_2.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 +259 -64
- package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.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-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +252 -32
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +329 -0
- package/dist/cjs/{tracked-promise-BdbqBT_O.js → tracked-promise-DvLhM2Sx.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-Cj5ogibZ.js → vanilla-picker-DtuN6WGq.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +90 -6
- package/dist/collection/components/salla-gifting/salla-gifting.css +18 -0
- package/dist/collection/components/salla-gifting/salla-gifting.js +91 -31
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +31 -1
- package/dist/collection/components/salla-product-options/salla-product-options.css +0 -3
- package/dist/collection/components/salla-product-options/salla-product-options.js +28 -84
- package/dist/collection/components/salla-products-list/salla-products-list.css +76 -0
- package/dist/collection/components/salla-products-list/salla-products-list.js +387 -65
- package/dist/collection/components/salla-social-share/salla-social-share.css +161 -0
- package/dist/collection/components/salla-social-share/salla-social-share.js +316 -50
- package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
- package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.css +65 -0
- package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +432 -0
- package/dist/components/index.js +5 -5
- package/dist/components/salla-bullet-delivery.js +90 -6
- package/dist/components/salla-gifting.js +86 -30
- package/dist/components/salla-login-modal2.js +31 -1
- package/dist/components/salla-product-options2.js +28 -84
- package/dist/components/salla-products-list2.js +266 -64
- package/dist/components/salla-social-share.js +1 -189
- package/dist/components/salla-social-share2.js +420 -0
- package/dist/components/salla-tab-content2.js +1 -1
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +1 -1
- package/dist/components/salla-tel-input2.js +1 -1
- package/dist/components/salla-tooltip2.js +1 -1
- package/dist/components/salla-user-settings.js +1 -1
- package/dist/components/salla-wishlist-actions.d.ts +11 -0
- package/dist/components/salla-wishlist-actions.js +375 -0
- package/dist/esm/{filepond-Cpf2HNH9.js → filepond-D4dDq1wa.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CVurRtjC.js → filepond-plugin-file-poster-CcnsMPSH.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Dw2xFbfx.js → filepond-plugin-file-validate-size-qgEgRYkk.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-D6seJVa2.js → filepond-plugin-file-validate-type-BuFGnco8.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CBikW78V.js → filepond-plugin-image-edit-kS2Sie2d.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-5yNhe9TO.js → filepond-plugin-image-exif-orientation-Bjoh_of2.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-PlAAXB7f.js → filepond-plugin-image-preview-b_VEHHGf.js} +1 -1
- package/dist/esm/{functions-Egzz8fEM.js → functions-ISZQDw0y.js} +1 -1
- package/dist/esm/{index-Do4FV1UZ.js → index-CqC4wD_f.js} +1 -1
- package/dist/esm/{index-a4x9urdK.js → index-Cqh-ta1v.js} +9 -5
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mail-DLNIOD9t.js → mail-DzAIgzdz.js} +2 -2
- 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 +29 -84
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-alert_2.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +11 -11
- package/dist/esm/salla-bullet-delivery_2.entry.js +91 -7
- 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-cashback-banner.entry.js +1 -1
- package/dist/esm/salla-comment-form_8.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +3 -3
- 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-gifting.entry.js +85 -31
- 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 +32 -2
- package/dist/esm/salla-loyalty-banner.entry.js +2 -2
- package/dist/esm/salla-loyalty-hero_2.entry.js +4 -4
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map.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.entry.js +1 -1
- package/dist/esm/salla-notifications.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-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-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_2.entry.js +1 -1
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +259 -64
- package/dist/esm/salla-progress-bar.entry.js +1 -1
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal.entry.js +3 -3
- package/dist/esm/salla-reward-action_4.entry.js +3 -3
- package/dist/esm/salla-scopes.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-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +252 -32
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tab-content_3.entry.js +4 -4
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +2 -2
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +2 -2
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +327 -0
- package/dist/esm/{tracked-promise-BX5clCDX.js → tracked-promise-CH_UyK-l.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DB0pDHa7.js → vanilla-picker-PE31tu9y.js} +1 -1
- package/dist/twilight/{p-afcb0117.entry.js → p-054c9462.entry.js} +1 -1
- package/dist/twilight/{p-78020271.entry.js → p-06372aeb.entry.js} +1 -1
- package/dist/twilight/p-06c06719.entry.js +4 -0
- package/dist/twilight/{p-16bcc5ab.entry.js → p-0c7efc0b.entry.js} +1 -1
- package/dist/twilight/{p-53cbb271.entry.js → p-0cca1b63.entry.js} +1 -1
- package/dist/twilight/{p-ad19661d.entry.js → p-1415eb5e.entry.js} +1 -1
- package/dist/twilight/{p-a53d5944.entry.js → p-14a3277b.entry.js} +1 -1
- package/dist/twilight/{p-92b02f3c.entry.js → p-15b3f969.entry.js} +1 -1
- package/dist/twilight/{p-241bd42e.entry.js → p-16b64bb5.entry.js} +1 -1
- package/dist/twilight/{p-37457147.entry.js → p-16c64a38.entry.js} +1 -1
- package/dist/twilight/{p-f5135cb5.entry.js → p-17920aa7.entry.js} +1 -1
- package/dist/twilight/{p-ec5ae058.entry.js → p-196fad8d.entry.js} +1 -1
- package/dist/twilight/{p-5803c158.entry.js → p-19fe2b27.entry.js} +1 -1
- package/dist/twilight/{p-316135f8.entry.js → p-1c0f9fd9.entry.js} +1 -1
- package/dist/twilight/{p-1130d4b7.entry.js → p-1db8b515.entry.js} +1 -1
- package/dist/twilight/{p-d0340e11.entry.js → p-219b14c4.entry.js} +1 -1
- package/dist/twilight/{p-127ee640.entry.js → p-227d11a0.entry.js} +1 -1
- package/dist/twilight/p-293a6d6b.entry.js +4 -0
- package/dist/twilight/{p-0c748664.entry.js → p-2ba603bc.entry.js} +1 -1
- package/dist/twilight/p-2dbb3b49.entry.js +4 -0
- package/dist/twilight/{p-5b365561.entry.js → p-31bd852c.entry.js} +1 -1
- package/dist/twilight/{p-92f3ea44.entry.js → p-32a7cb85.entry.js} +1 -1
- package/dist/twilight/{p-1a37b959.entry.js → p-32d5d279.entry.js} +1 -1
- package/dist/twilight/{p-91363b7e.entry.js → p-36884c05.entry.js} +1 -1
- package/dist/twilight/{p-13a033fa.entry.js → p-38a791cb.entry.js} +1 -1
- package/dist/twilight/{p-0b169d4e.entry.js → p-3b198162.entry.js} +1 -1
- package/dist/twilight/{p-735fafef.entry.js → p-3d517178.entry.js} +1 -1
- package/dist/twilight/{p-d9d4ea5b.entry.js → p-3e5a57cc.entry.js} +1 -1
- package/dist/twilight/{p-fa1cc092.entry.js → p-40eb9556.entry.js} +6 -6
- package/dist/twilight/{p-1ce817c2.entry.js → p-49181c4a.entry.js} +1 -1
- package/dist/twilight/p-4a81a708.entry.js +4 -0
- package/dist/twilight/{p-35ac1fc9.entry.js → p-4b20872a.entry.js} +1 -1
- package/dist/twilight/{p-e27363dd.entry.js → p-4c370853.entry.js} +1 -1
- package/dist/twilight/{p-e1205d19.entry.js → p-4ee20a54.entry.js} +1 -1
- package/dist/twilight/{p-b0bf7a5b.entry.js → p-51c30ec2.entry.js} +1 -1
- package/dist/twilight/{p-2bcfb4f3.entry.js → p-5334222c.entry.js} +1 -1
- package/dist/twilight/{p-c0380d40.entry.js → p-559bdcca.entry.js} +1 -1
- package/dist/twilight/{p-03d13b9f.entry.js → p-5701244a.entry.js} +1 -1
- package/dist/twilight/{p-0da78d4e.entry.js → p-5d364fc2.entry.js} +1 -1
- package/dist/twilight/{p-DiWHgCMH.js → p-5fxCpxw5.js} +1 -1
- package/dist/twilight/{p-08b2c781.entry.js → p-61ad2660.entry.js} +1 -1
- package/dist/twilight/p-6590acee.entry.js +4 -0
- package/dist/twilight/{p-b8ab7da8.entry.js → p-681f8874.entry.js} +1 -1
- package/dist/twilight/{p-d17596ff.entry.js → p-6b6f9822.entry.js} +1 -1
- package/dist/twilight/{p-4d393389.entry.js → p-6d23fd92.entry.js} +1 -1
- package/dist/twilight/p-6e723d46.entry.js +4 -0
- package/dist/twilight/{p-d33203b7.entry.js → p-71f2ba66.entry.js} +1 -1
- package/dist/twilight/{p-c8fd03c0.entry.js → p-732bd9fb.entry.js} +1 -1
- package/dist/twilight/{p-42a0b54a.entry.js → p-73d9e4c8.entry.js} +1 -1
- package/dist/twilight/{p-e90d18b2.entry.js → p-74e0d0c2.entry.js} +1 -1
- package/dist/twilight/{p-52fe97c8.entry.js → p-77d2312a.entry.js} +1 -1
- package/dist/twilight/{p-635347c9.entry.js → p-78ff445c.entry.js} +1 -1
- package/dist/twilight/{p-74a61155.entry.js → p-798fb3c7.entry.js} +1 -1
- package/dist/twilight/{p-e726123e.entry.js → p-79c20964.entry.js} +1 -1
- package/dist/twilight/{p-C4aFleDM.js → p-7FtjQghq.js} +1 -1
- package/dist/twilight/{p-0405f5e8.entry.js → p-7afe6e1a.entry.js} +1 -1
- package/dist/twilight/{p-b80adb19.entry.js → p-7e185acf.entry.js} +1 -1
- package/dist/twilight/{p-f684d7bf.entry.js → p-8b538bd7.entry.js} +1 -1
- package/dist/twilight/{p-bfbf8121.entry.js → p-8bcc3b86.entry.js} +1 -1
- package/dist/twilight/{p-a068fff4.entry.js → p-8db52fe9.entry.js} +1 -1
- package/dist/twilight/{p-89f11893.entry.js → p-93ec294d.entry.js} +1 -1
- package/dist/twilight/p-9785f314.entry.js +4 -0
- package/dist/twilight/{p-ff270706.entry.js → p-9a3f27e9.entry.js} +1 -1
- package/dist/twilight/{p-DSBkBAFI.js → p-B0uENqSF.js} +1 -1
- package/dist/twilight/{p-B7KW0zhB.js → p-C3kw3FEZ.js} +1 -1
- package/dist/twilight/{p-BVqg7xd9.js → p-CUfwD9kr.js} +1 -1
- package/dist/twilight/{p-a4x9urdK.js → p-Cqh-ta1v.js} +2 -2
- package/dist/twilight/{p-fCaOxwGH.js → p-DZ18vMT2.js} +1 -1
- package/dist/twilight/{p-EPfEwqOC.js → p-DyQ5MH6F.js} +1 -1
- package/dist/twilight/{p-DLNIOD9t.js → p-DzAIgzdz.js} +1 -1
- package/dist/twilight/{p-pOgjUtf9.js → p-J_27I63T.js} +1 -1
- package/dist/twilight/{p-10e0936d.entry.js → p-a85d80b5.entry.js} +1 -1
- package/dist/twilight/{p-6d47892b.entry.js → p-a918b812.entry.js} +1 -1
- package/dist/twilight/{p-ba1199ba.entry.js → p-aec0a2df.entry.js} +1 -1
- package/dist/twilight/{p-9b639078.entry.js → p-b16d8b19.entry.js} +1 -1
- package/dist/twilight/{p-ee605cef.entry.js → p-b295c1f1.entry.js} +1 -1
- package/dist/twilight/{p-0957f323.entry.js → p-b6c0aa79.entry.js} +1 -1
- package/dist/twilight/{p-0bdf58a4.entry.js → p-b7727021.entry.js} +1 -1
- package/dist/twilight/{p-e8a82952.entry.js → p-badf4c9d.entry.js} +1 -1
- package/dist/twilight/{p-fe506679.entry.js → p-c6be8afd.entry.js} +1 -1
- package/dist/twilight/{p-ec073354.entry.js → p-ccd8c960.entry.js} +1 -1
- package/dist/twilight/{p-3fbd88d0.entry.js → p-ce0410d5.entry.js} +1 -1
- package/dist/twilight/{p-ef8fb222.entry.js → p-cee7a8ad.entry.js} +1 -1
- package/dist/twilight/{p-f6bb956c.entry.js → p-d0c8435f.entry.js} +1 -1
- package/dist/twilight/{p-59f815bc.entry.js → p-d23eeb0c.entry.js} +1 -1
- package/dist/twilight/{p-f170aff7.entry.js → p-d63f2cbd.entry.js} +1 -1
- package/dist/twilight/{p-6d87b134.entry.js → p-d6b6a8ad.entry.js} +1 -1
- package/dist/twilight/{p-b0ed6a9f.entry.js → p-d823cbcd.entry.js} +1 -1
- package/dist/twilight/{p-9df5c9a7.entry.js → p-d8f22e4b.entry.js} +1 -1
- package/dist/twilight/{p-CsMnvJkR.js → p-dKdk2xpB.js} +1 -1
- package/dist/twilight/p-dbdbb882.entry.js +4 -0
- package/dist/twilight/{p-d905fbca.entry.js → p-dc8555bf.entry.js} +1 -1
- package/dist/twilight/{p-fbfacb11.entry.js → p-dca3b67e.entry.js} +1 -1
- package/dist/twilight/{p-056400a1.entry.js → p-e0671ff1.entry.js} +1 -1
- package/dist/twilight/{p-59f7f014.entry.js → p-e06e37c1.entry.js} +1 -1
- package/dist/twilight/{p-c60c302f.entry.js → p-e265d626.entry.js} +1 -1
- package/dist/twilight/{p-61b1fd3b.entry.js → p-f0e96875.entry.js} +1 -1
- package/dist/twilight/p-f64168cc.entry.js +4 -0
- package/dist/twilight/{p-0b1970c2.entry.js → p-f67639df.entry.js} +1 -1
- package/dist/twilight/{p-fa039238.entry.js → p-fd180bd3.entry.js} +1 -1
- package/dist/twilight/{p-D9ni3BuG.js → p-m2p-QAbu.js} +1 -1
- package/dist/twilight/{p-CkA6UKAD.js → p-yyvPGK6r.js} +2 -2
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +16 -0
- package/dist/types/components/salla-gifting/gift-schema.d.ts +4 -0
- package/dist/types/components/salla-gifting/salla-gifting.d.ts +5 -1
- package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +2 -0
- package/dist/types/components/salla-product-options/salla-product-options.d.ts +0 -11
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +60 -6
- package/dist/types/components/salla-social-share/salla-social-share.d.ts +39 -2
- package/dist/types/components/salla-wishlist-actions/salla-wishlist-actions.d.ts +93 -0
- package/dist/types/components.d.ts +172 -18
- package/package.json +5 -5
- package/dist/twilight/p-234fdf72.entry.js +0 -4
- package/dist/twilight/p-7a1cfd65.entry.js +0 -4
- package/dist/twilight/p-865c602e.entry.js +0 -4
- package/dist/twilight/p-9dc0fec4.entry.js +0 -4
- package/dist/twilight/p-e485d0b8.entry.js +0 -4
- package/dist/twilight/p-f5072671.entry.js +0 -4
- package/dist/twilight/p-fb7904e6.entry.js +0 -4
- package/dist/twilight/p-fdde8399.entry.js +0 -4
|
@@ -4810,6 +4810,8 @@ const sallaBulletDeliveryCss = "@supports (interpolate-size: allow-keywords) and
|
|
|
4810
4810
|
|
|
4811
4811
|
const BRANCH_SEARCH_DEBOUNCE_MS = 1000;
|
|
4812
4812
|
const GEOLOCATION_TIMEOUT = 10000;
|
|
4813
|
+
/** Final fallback center used only if `user.default_geo_location` is absent (Riyadh — matches checkout map-page). */
|
|
4814
|
+
const DEFAULT_MAP_CENTER = { lat: 24.7756042, lng: 46.7360729 };
|
|
4813
4815
|
const DEBUG_KEY = 'salla-bullet-delivery-debug';
|
|
4814
4816
|
const OVERRIDE_IP_KEY = 'salla-bullet-delivery-override-ip';
|
|
4815
4817
|
function log(message, data) {
|
|
@@ -4862,6 +4864,8 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
4862
4864
|
/** True after saved addresses have been loaded (lazy: only when address tab is shown). */
|
|
4863
4865
|
this.savedAddressesLoaded = false;
|
|
4864
4866
|
this.gmapRef = null;
|
|
4867
|
+
/** Guards against re-prompting for geolocation each time the map (re)initializes within one flow. */
|
|
4868
|
+
this.autoGeolocationTriggered = false;
|
|
4865
4869
|
// Core state
|
|
4866
4870
|
this.activeTab = "address";
|
|
4867
4871
|
this.isLoggedIn = false;
|
|
@@ -5003,6 +5007,8 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5003
5007
|
shortAddress: detail.place?.placeId ?? detail.place?.place_id ?? undefined,
|
|
5004
5008
|
formattedAddress: detail.place?.formattedAddress ?? detail.place?.formatted_address ?? undefined,
|
|
5005
5009
|
};
|
|
5010
|
+
// Bias autocomplete results toward the currently selected location.
|
|
5011
|
+
this.updateLocationBias();
|
|
5006
5012
|
setTimeout(() => {
|
|
5007
5013
|
const marker = this.gmapRef?.locationMarker;
|
|
5008
5014
|
if (marker)
|
|
@@ -5014,6 +5020,25 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5014
5020
|
if (this.gmapRef && typeof this.gmapRef.resize === 'function') {
|
|
5015
5021
|
this.gmapRef.resize();
|
|
5016
5022
|
}
|
|
5023
|
+
this.updateLocationBias();
|
|
5024
|
+
// Auto-locate the customer so the map never opens "empty" — matches checkout map-page
|
|
5025
|
+
// (getCurrentLocation(true) pans to the resolved position). Skip if a location is already set
|
|
5026
|
+
// (e.g. returning from the confirm step). Falls back silently to mapInitialCenter if denied.
|
|
5027
|
+
if (!this.autoGeolocationTriggered && !this.hasMapLocation() && this.gmapRef) {
|
|
5028
|
+
const getCurrentLocation = this.gmapRef.getCurrentLocation;
|
|
5029
|
+
if (typeof getCurrentLocation === 'function') {
|
|
5030
|
+
this.autoGeolocationTriggered = true;
|
|
5031
|
+
try {
|
|
5032
|
+
const result = getCurrentLocation.call(this.gmapRef, true);
|
|
5033
|
+
if (result && typeof result.catch === 'function') {
|
|
5034
|
+
result.catch((err) => log('Auto geolocation failed', err));
|
|
5035
|
+
}
|
|
5036
|
+
}
|
|
5037
|
+
catch (err) {
|
|
5038
|
+
log('Auto geolocation threw', err);
|
|
5039
|
+
}
|
|
5040
|
+
}
|
|
5041
|
+
}
|
|
5017
5042
|
};
|
|
5018
5043
|
/**
|
|
5019
5044
|
* Submit add-address form: create address via API then switch back to list.
|
|
@@ -5137,6 +5162,9 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5137
5162
|
get isRequired() {
|
|
5138
5163
|
return !!Salla.config.get("store.settings.bullet_delivery.settings.is_required");
|
|
5139
5164
|
}
|
|
5165
|
+
get isSupportsDelivery() {
|
|
5166
|
+
return !!Salla.config.get("store.settings.bullet_delivery.supports_delivery");
|
|
5167
|
+
}
|
|
5140
5168
|
get isMobileApp() {
|
|
5141
5169
|
return Salla.config.isMobileApp();
|
|
5142
5170
|
}
|
|
@@ -5245,6 +5273,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5245
5273
|
}
|
|
5246
5274
|
resetState() {
|
|
5247
5275
|
this.viewMode = "main";
|
|
5276
|
+
this.autoGeolocationTriggered = false;
|
|
5248
5277
|
this.selectedCountry = null;
|
|
5249
5278
|
this.selectedRegion = null;
|
|
5250
5279
|
this.selectedCity = null;
|
|
@@ -5322,12 +5351,27 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5322
5351
|
// only when it represents a valid session-style address.
|
|
5323
5352
|
return hasSessionAddressIntent(intent);
|
|
5324
5353
|
}
|
|
5354
|
+
/**
|
|
5355
|
+
* Whether the store still supports the delivery method captured in a stored
|
|
5356
|
+
* intent. Shared by the cart pill and the cart-submit gate so an unsupported
|
|
5357
|
+
* method (e.g. a remembered delivery address in a now pickup-only store) is
|
|
5358
|
+
* never treated as a valid/complete selection.
|
|
5359
|
+
*/
|
|
5360
|
+
isIntentMethodSupported(intent) {
|
|
5361
|
+
if (intent.type === "branch")
|
|
5362
|
+
return this.supportsPickup;
|
|
5363
|
+
if (intent.type === "address")
|
|
5364
|
+
return this.isSupportsDelivery;
|
|
5365
|
+
return false;
|
|
5366
|
+
}
|
|
5325
5367
|
hasCompleteIntentForLoggedInUser() {
|
|
5326
5368
|
if (this.isGuestUser())
|
|
5327
5369
|
return false;
|
|
5328
5370
|
const intent = this.getStoredIntent();
|
|
5329
5371
|
if (!intent)
|
|
5330
5372
|
return false;
|
|
5373
|
+
if (!this.isIntentMethodSupported(intent))
|
|
5374
|
+
return false;
|
|
5331
5375
|
if (intent.type === "address")
|
|
5332
5376
|
return !!intent.address_id;
|
|
5333
5377
|
if (intent.type === "branch")
|
|
@@ -5905,6 +5949,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5905
5949
|
async handleAddNewAddress() {
|
|
5906
5950
|
this.viewMode = "add-address";
|
|
5907
5951
|
this.mapLocationData = null;
|
|
5952
|
+
this.autoGeolocationTriggered = false;
|
|
5908
5953
|
this.fetchAddressToken();
|
|
5909
5954
|
const intent = this.getStoredIntent();
|
|
5910
5955
|
const sessionCountryId = getIntentCountryId(intent);
|
|
@@ -5927,6 +5972,7 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5927
5972
|
this.mapLocationData = null;
|
|
5928
5973
|
this.mapStep = 'map';
|
|
5929
5974
|
this.addressDescription = '';
|
|
5975
|
+
this.autoGeolocationTriggered = false;
|
|
5930
5976
|
}
|
|
5931
5977
|
// ─── Map methods ───
|
|
5932
5978
|
async fetchAddressToken() {
|
|
@@ -5951,6 +5997,15 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5951
5997
|
this.loadingToken = false;
|
|
5952
5998
|
}
|
|
5953
5999
|
}
|
|
6000
|
+
/** Bias autocomplete toward the current selection (or the initial center) — mirrors checkout's map-page. */
|
|
6001
|
+
updateLocationBias() {
|
|
6002
|
+
if (!this.gmapRef)
|
|
6003
|
+
return;
|
|
6004
|
+
const center = this.hasMapLocation()
|
|
6005
|
+
? { lat: this.mapLocationData.lat, lng: this.mapLocationData.lng }
|
|
6006
|
+
: this.mapInitialCenter;
|
|
6007
|
+
this.gmapRef.autocompleteLocationBias = { center, radius: 500000 };
|
|
6008
|
+
}
|
|
5954
6009
|
hasMapLocation() {
|
|
5955
6010
|
return this.mapLocationData?.lat != null && this.mapLocationData?.lng != null;
|
|
5956
6011
|
}
|
|
@@ -5961,6 +6016,27 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
5961
6016
|
get isMapModeAvailable() {
|
|
5962
6017
|
return this.isMapSettingEnabled && !!salla.config.get('store.settings.keys.maps') && !!this.addressToken;
|
|
5963
6018
|
}
|
|
6019
|
+
/** Center shown before geolocation resolves — the customer's IP-based default (falls back to Riyadh). */
|
|
6020
|
+
get mapInitialCenter() {
|
|
6021
|
+
const geo = salla.config.get('user.default_geo_location');
|
|
6022
|
+
// Coerce defensively: config may arrive as strings, blank/whitespace, NaN, or out-of-range
|
|
6023
|
+
// values. Reject blanks before coercion (Number('') === 0) and validate lat/lng ranges so we
|
|
6024
|
+
// never feed (0,0) or an invalid point to the map; otherwise fall back to the default center.
|
|
6025
|
+
const lat = this.toCoordinate(geo?.lat);
|
|
6026
|
+
const lng = this.toCoordinate(geo?.lng);
|
|
6027
|
+
const isValid = lat != null && lng != null &&
|
|
6028
|
+
lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180;
|
|
6029
|
+
return isValid ? { lat, lng } : DEFAULT_MAP_CENTER;
|
|
6030
|
+
}
|
|
6031
|
+
/** Parse a config coordinate to a finite number, treating blank/whitespace strings as missing. */
|
|
6032
|
+
toCoordinate(value) {
|
|
6033
|
+
if (typeof value === 'string' && value.trim() === '')
|
|
6034
|
+
return null;
|
|
6035
|
+
if (value == null)
|
|
6036
|
+
return null;
|
|
6037
|
+
const num = Number(value);
|
|
6038
|
+
return Number.isFinite(num) ? num : null;
|
|
6039
|
+
}
|
|
5964
6040
|
// ─── End Map methods ───
|
|
5965
6041
|
/**
|
|
5966
6042
|
* Build address/location payload from guest-form state (same fields as add-address).
|
|
@@ -6531,10 +6607,10 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6531
6607
|
getCartViewConfig(intent) {
|
|
6532
6608
|
if (!intent || !Salla.url.is_page("cart"))
|
|
6533
6609
|
return null;
|
|
6610
|
+
if (!this.isIntentMethodSupported(intent))
|
|
6611
|
+
return null;
|
|
6534
6612
|
const isBranch = intent.type === "branch";
|
|
6535
6613
|
const isAddress = intent.type === "address";
|
|
6536
|
-
if ((isBranch && !this.supportsPickup) || (!isBranch && !isAddress))
|
|
6537
|
-
return null;
|
|
6538
6614
|
return {
|
|
6539
6615
|
title: isBranch
|
|
6540
6616
|
? Salla.lang.get("pages.checkout.pickup_option")
|
|
@@ -6584,13 +6660,15 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6584
6660
|
return wrapper;
|
|
6585
6661
|
}
|
|
6586
6662
|
renderTabs() {
|
|
6587
|
-
// Show tabs only when pickup is supported; otherwise delivery-only view with no tabs
|
|
6663
|
+
// Show tabs only when pickup is supported; otherwise delivery-only view with no tabs.
|
|
6664
|
+
// The pickup tab is gated by this same `supportsPickup` check, while the delivery
|
|
6665
|
+
// tab is shown only when bullet delivery supports delivery (`isSupportsDelivery`).
|
|
6588
6666
|
if (!this.supportsPickup)
|
|
6589
6667
|
return null;
|
|
6590
|
-
return (h$4("div", { class: "s-bullet-delivery-tabs" }, h$4("button", { type: "button", class: {
|
|
6668
|
+
return (h$4("div", { class: "s-bullet-delivery-tabs" }, this.isSupportsDelivery && (h$4("button", { type: "button", class: {
|
|
6591
6669
|
"s-bullet-delivery-tab": true,
|
|
6592
6670
|
"s-bullet-delivery-tab--active": this.activeTab === "address",
|
|
6593
|
-
}, onClick: () => this.handleTabChange("address") }, h$4("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Location, "aria-hidden": "true" }), h$4("span", null, Salla.lang.get("mobile_app.strings.delivery"))), h$4("button", { type: "button", class: {
|
|
6671
|
+
}, onClick: () => this.handleTabChange("address") }, h$4("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Location, "aria-hidden": "true" }), h$4("span", null, Salla.lang.get("mobile_app.strings.delivery")))), h$4("button", { type: "button", class: {
|
|
6594
6672
|
"s-bullet-delivery-tab": true,
|
|
6595
6673
|
"s-bullet-delivery-tab--active": this.activeTab === "branch",
|
|
6596
6674
|
}, onClick: () => this.handleTabChange("branch") }, h$4("span", { class: "s-bullet-delivery-tab-icon", innerHTML: Store, "aria-hidden": "true" }), h$4("span", null, Salla.lang.get("mobile_app.strings.pickup")))));
|
|
@@ -6743,7 +6821,13 @@ const SallaBulletDelivery$1 = /*@__PURE__*/ proxyCustomElement(class SallaBullet
|
|
|
6743
6821
|
}
|
|
6744
6822
|
renderMapSection() {
|
|
6745
6823
|
const isSA = isSaudiArabia(this.selectedCountry?.code ?? '');
|
|
6746
|
-
|
|
6824
|
+
const loc = this.mapLocationData;
|
|
6825
|
+
const hasLoc = loc?.lat != null && loc?.lng != null;
|
|
6826
|
+
// Resolve the center once (the getter reads salla.config) and reuse it for the marker so the
|
|
6827
|
+
// map never opens "empty": before a selection the marker sits on the IP/Riyadh default and is
|
|
6828
|
+
// dragged/replaced once auto-geolocation or the user picks a real position.
|
|
6829
|
+
const center = hasLoc ? { lat: loc.lat, lng: loc.lng } : this.mapInitialCenter;
|
|
6830
|
+
return (h$4("div", { class: "s-bullet-delivery-map-container" }, h$4("gmap-map", { ref: (el) => (this.gmapRef = el), center: center, zoom: 16, "min-zoom": 4, "max-zoom": 21, "map-id": "DEMO_MAP_ID", "enable-autocomplete": true, "enable-geolocation": true, "show-location-marker": true, "location-marker-position": hasLoc ? { lat: loc.lat, lng: loc.lng, accuracy: 50 } : { ...center, accuracy: 50 }, language: Salla.lang.getLocale?.() ?? document.documentElement.lang ?? 'ar', "geolocation-button-label": Salla.lang.get('pages.checkout.current_location'), "autocomplete-placeholder": Salla.lang.get('pages.checkout.search_for_address'), "autocomplete-hint": isSA ? Salla.lang.get('pages.checkout.short_address_format_validation') : undefined, "autocomplete-country": this.selectedCountry?.code?.toLowerCase(), "autocomplete-resolve": false, "autocomplete-auth-token": this.addressToken, "location-marker-background": "#4285F4", "location-marker-border-color": "#1967D2", "location-marker-glyph-color": "#FFFFFF", "location-marker-scale": 1.3, "onGmap-location-changed": this.handleMapLocationChanged, "onGmap-ready": this.handleMapReady })));
|
|
6747
6831
|
}
|
|
6748
6832
|
renderAddressConfirmation() {
|
|
6749
6833
|
const address = this.mapLocationData?.formattedAddress ?? '';
|
|
@@ -31,14 +31,14 @@ var Alert = `<!-- Generated by IcoMoon.io -->
|
|
|
31
31
|
</svg>
|
|
32
32
|
`;
|
|
33
33
|
|
|
34
|
-
const sallaGiftingCss = ".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}";
|
|
34
|
+
const sallaGiftingCss = ".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}.s-gifting-modal .s-searchable-dropdown-trigger{border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger:hover:not(.s-searchable-dropdown-trigger--disabled){border-color:#d1d5db}.s-gifting-modal .s-searchable-dropdown-trigger--open,.s-gifting-modal .s-searchable-dropdown-trigger:focus{border-color:var(--color-primary, #00897b);box-shadow:0 0 0 1px var(--color-primary, #00897b)}.s-gifting-modal .s-searchable-dropdown-trigger-placeholder{color:#000}.s-gifting-modal .s-gifting-image-section{margin-bottom:1.5rem}.s-gifting-modal .s-gifting-slider{margin-bottom:0.5rem}.s-gifting-modal .s-gifting-image{display:block}.s-gifting-modal .s-gifting-image img{display:block;width:auto;height:100px;object-fit:contain}.s-gifting-modal .s-gifting-image-section+.anime-item .s-gifting-text-title{margin-top:1rem}";
|
|
35
35
|
|
|
36
36
|
const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting extends HTMLElement {
|
|
37
37
|
constructor() {
|
|
38
38
|
super();
|
|
39
39
|
this.__registerHost();
|
|
40
40
|
this.defaultEvent = "gifting:open";
|
|
41
|
-
this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.
|
|
41
|
+
this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_for_your_gift');
|
|
42
42
|
this.currentStep = 1;
|
|
43
43
|
this.showCalendar = false;
|
|
44
44
|
this.showGiftText = false;
|
|
@@ -74,6 +74,7 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
74
74
|
this.timeZone = null;
|
|
75
75
|
this.receiverCountryCode = salla.config.get('store.scope.countries')?.[0] || salla.config.get('store.store_country') || 'SA';
|
|
76
76
|
this.hostId = `salla-gifting-${Math.random().toString(36).slice(2, 10)}`;
|
|
77
|
+
this.disableClass = this.gift?.show_image_upload ? '' : 'pointer-events-none';
|
|
77
78
|
/**
|
|
78
79
|
* The form selector to be used to get the form data
|
|
79
80
|
*/
|
|
@@ -130,6 +131,7 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
130
131
|
this.sectionBtnText = salla.lang.get('blocks.buy_as_gift.send_as_a_gift');
|
|
131
132
|
this.giftDetails = salla.lang.get('blocks.buy_as_gift.gift_details');
|
|
132
133
|
this.selectGiftMessage = salla.lang.get('blocks.buy_as_gift.select_gift_message');
|
|
134
|
+
this.giftText = salla.lang.get('blocks.buy_as_gift.gift_text');
|
|
133
135
|
this.giftCustomText = salla.lang.get('blocks.buy_as_gift.gift_custom_text');
|
|
134
136
|
this.textId = salla.lang.get('blocks.buy_as_gift.text_id');
|
|
135
137
|
this.incorrectGiftText = salla.lang.get('blocks.buy_as_gift.incorrect_gift_text');
|
|
@@ -199,13 +201,46 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
199
201
|
salla.event.dispatch('login::open', { withoutReload: true });
|
|
200
202
|
return;
|
|
201
203
|
}
|
|
204
|
+
this.currentStep = 1;
|
|
205
|
+
this.parentClass = 'is-current-step-1';
|
|
206
|
+
this.step2Animated = false;
|
|
207
|
+
this.selectedText = undefined;
|
|
208
|
+
this.selectedGiftTextOption = undefined;
|
|
209
|
+
this.uploadedImage = undefined;
|
|
210
|
+
this.selectedImage = undefined;
|
|
202
211
|
await this.modal.open();
|
|
203
212
|
// Determine the appropriate method to call based on the `physicalProducts` flag
|
|
204
213
|
const giftDetailsMethod = this.productId ? () => salla.product.getGiftProductDetails(this.productId) : () => salla.cart.getGiftCartDetails();
|
|
205
214
|
return await salla.api.withoutNotifier(giftDetailsMethod)
|
|
206
215
|
.then((response) => {
|
|
207
216
|
this.gift = response.data;
|
|
217
|
+
// Backward-compat: older BE responses omit these visibility flags. Treat a
|
|
218
|
+
// missing flag as enabled so the image/text steps still render until the BE
|
|
219
|
+
// that returns them is deployed. Use `??` so an explicit `false` is preserved.
|
|
220
|
+
this.gift.show_texts = this.gift.show_texts ?? true;
|
|
221
|
+
this.gift.show_images = this.gift.show_images ?? true;
|
|
222
|
+
this.gift.show_custom_text = this.gift.show_custom_text ?? true;
|
|
223
|
+
this.gift.show_image_upload = this.gift.show_image_upload ?? true;
|
|
208
224
|
this.senderName = this.gift.sender_name;
|
|
225
|
+
this.disableClass = this.gift?.show_image_upload ? '' : 'pointer-events-none';
|
|
226
|
+
if (!this.gift.show_texts) {
|
|
227
|
+
this.selectedGiftTextOption = undefined;
|
|
228
|
+
this.selectedText = undefined;
|
|
229
|
+
}
|
|
230
|
+
if (!this.gift.show_images) {
|
|
231
|
+
this.selectedImage = undefined;
|
|
232
|
+
this.uploadedImage = undefined;
|
|
233
|
+
}
|
|
234
|
+
if (this.skipStep1()) {
|
|
235
|
+
this.currentStep = 2;
|
|
236
|
+
this.parentClass = 'is-current-step-2';
|
|
237
|
+
this.step2Animated = true;
|
|
238
|
+
}
|
|
239
|
+
else if (!this.gift.show_images) {
|
|
240
|
+
// the slider lays out asynchronously,
|
|
241
|
+
// so an early measurement would pin it too short and overlap the button.
|
|
242
|
+
this.setWrapperHeight(1, 250, 5);
|
|
243
|
+
}
|
|
209
244
|
})
|
|
210
245
|
.catch(e => {
|
|
211
246
|
this.hasError = true;
|
|
@@ -213,6 +248,9 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
213
248
|
})
|
|
214
249
|
.finally(() => this.modal.stopLoading());
|
|
215
250
|
}
|
|
251
|
+
skipStep1() {
|
|
252
|
+
return !!this.gift && !this.gift.show_images && !this.gift.show_texts;
|
|
253
|
+
}
|
|
216
254
|
/**
|
|
217
255
|
*
|
|
218
256
|
* Hide / close the gifting modal window
|
|
@@ -249,39 +287,35 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
249
287
|
this.textSelect?.classList.remove('s-form-has-error');
|
|
250
288
|
let dataID = event.target.children[event.target.selectedIndex].getAttribute('data-id');
|
|
251
289
|
let customID = dataID == "custom";
|
|
290
|
+
// Only the custom-text textarea changes the layout; resize the wrapper just
|
|
291
|
+
// when it actually appears/disappears so picking or clearing a normal option
|
|
292
|
+
// doesn't jump the modal height.
|
|
293
|
+
const customVisibilityChanged = this.showGiftText !== customID;
|
|
252
294
|
this.showGiftText = customID;
|
|
253
295
|
if (dataID) {
|
|
254
296
|
this.selectedGiftTextOption = dataID;
|
|
255
297
|
customID ? this.selectedText = undefined : this.selectedText = event.target.value;
|
|
256
|
-
this.setWrapperHeight(1, 150, 5);
|
|
257
298
|
}
|
|
258
299
|
else {
|
|
259
300
|
// empty textarea value
|
|
260
301
|
this.textArea.value = '';
|
|
261
302
|
this.selectedText = undefined;
|
|
262
303
|
this.selectedGiftTextOption = undefined;
|
|
263
|
-
|
|
304
|
+
}
|
|
305
|
+
if (customVisibilityChanged) {
|
|
306
|
+
this.setWrapperHeight(1, 150, 5);
|
|
264
307
|
}
|
|
265
308
|
}
|
|
266
309
|
/**
|
|
267
310
|
*
|
|
268
311
|
* Go to the step 2
|
|
269
312
|
*/
|
|
270
|
-
async goToStep2() {
|
|
271
|
-
if (!this.
|
|
272
|
-
this.textSelect.classList.add('s-form-has-error');
|
|
273
|
-
this.customTextArea.classList.remove('s-form-has-error');
|
|
313
|
+
async goToStep2(withValidation = true) {
|
|
314
|
+
if (!this.step1Elems)
|
|
274
315
|
return;
|
|
275
|
-
|
|
276
|
-
else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
|
|
277
|
-
this.textSelect.classList.remove('s-form-has-error');
|
|
278
|
-
this.customTextArea.classList.add('s-form-has-error');
|
|
316
|
+
if (withValidation && !this.validateStep1()) {
|
|
279
317
|
return;
|
|
280
318
|
}
|
|
281
|
-
else {
|
|
282
|
-
this.textSelect.classList.remove('s-form-has-error');
|
|
283
|
-
this.customTextArea.classList.remove('s-form-has-error');
|
|
284
|
-
}
|
|
285
319
|
this.setWrapperHeight(2, 600, 0);
|
|
286
320
|
let stepNextAnime = new anime.timeline();
|
|
287
321
|
stepNextAnime.add({
|
|
@@ -314,6 +348,23 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
314
348
|
this.currentStep = 2;
|
|
315
349
|
this.parentClass = `is-current-step-${this.currentStep}`;
|
|
316
350
|
}
|
|
351
|
+
validateStep1() {
|
|
352
|
+
if (!this.gift?.show_texts)
|
|
353
|
+
return true;
|
|
354
|
+
if (!this.selectedGiftTextOption) {
|
|
355
|
+
this.textSelect?.classList.add('s-form-has-error');
|
|
356
|
+
this.customTextArea?.classList.remove('s-form-has-error');
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
|
|
360
|
+
this.textSelect?.classList.remove('s-form-has-error');
|
|
361
|
+
this.customTextArea?.classList.add('s-form-has-error');
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
this.textSelect?.classList.remove('s-form-has-error');
|
|
365
|
+
this.customTextArea?.classList.remove('s-form-has-error');
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
317
368
|
/**
|
|
318
369
|
*
|
|
319
370
|
* Go to the step 1
|
|
@@ -356,7 +407,7 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
356
407
|
this.parentClass = `is-current-step-${this.currentStep}`;
|
|
357
408
|
}
|
|
358
409
|
getFilepondPlaceholder() {
|
|
359
|
-
return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload ? this.selectImageOrUpload :
|
|
410
|
+
return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload && this.gift.show_image_upload ? this.selectImageOrUpload : this.selectImageForYourGift}</p></div>`;
|
|
360
411
|
}
|
|
361
412
|
setPreview(image) {
|
|
362
413
|
this.uploader?.classList.add('has-bg');
|
|
@@ -366,7 +417,7 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
366
417
|
bg.style.backgroundImage = "url('" + image.url + "')";
|
|
367
418
|
this.uploader?.querySelector('.filepond--root')?.appendChild(bg);
|
|
368
419
|
this.uploadedImage = image.url;
|
|
369
|
-
if (!!this.gift && this.gift.gift_images
|
|
420
|
+
if (!!this.gift && this.gift.gift_images?.length) {
|
|
370
421
|
this.setWrapperHeight(1, 150, 0);
|
|
371
422
|
}
|
|
372
423
|
}
|
|
@@ -379,7 +430,7 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
379
430
|
}
|
|
380
431
|
handleTextAreaChange(event) {
|
|
381
432
|
this.selectedText = event.target.value;
|
|
382
|
-
this.customTextArea
|
|
433
|
+
this.customTextArea?.classList.remove('s-form-has-error');
|
|
383
434
|
}
|
|
384
435
|
clearError(key) {
|
|
385
436
|
if (this.errors?.[key]) {
|
|
@@ -530,13 +581,13 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
530
581
|
}
|
|
531
582
|
handleUploadImage(img) {
|
|
532
583
|
this.uploadedImage = img;
|
|
533
|
-
if (!!this.gift && this.gift.gift_images
|
|
584
|
+
if (!!this.gift && this.gift.gift_images?.length) {
|
|
534
585
|
this.setWrapperHeight(1, 150, 0);
|
|
535
586
|
}
|
|
536
587
|
}
|
|
537
588
|
handleRemoveImage() {
|
|
538
589
|
this.uploadedImage = '';
|
|
539
|
-
if (!!this.gift && this.gift.gift_images
|
|
590
|
+
if (!!this.gift && this.gift.gift_images?.length) {
|
|
540
591
|
this.setWrapperHeight(1, 150, 0);
|
|
541
592
|
}
|
|
542
593
|
}
|
|
@@ -670,16 +721,19 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
670
721
|
}
|
|
671
722
|
render() {
|
|
672
723
|
return [
|
|
673
|
-
h("div", { key: '
|
|
724
|
+
h("div", { key: 'fdb6b68a052a9fa0a0d527edb25e3d7783cc47e9' }, h("salla-list-tile", { key: '3cfb7f37df96e924af7f977fd17f4161e40f83fe', class: this.generateClass() }, h("div", { key: '291a27d70bc43d6edac5c5838d93eaa6a51fb84a', slot: "title" }, this.vertical ? h("span", { innerHTML: SIGiftSharing }) : '', h("h3", { key: 'c49f119d84a279338c4478872883ba7356e118ce' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: '2ccfb84620132477c0845ffc0bbc257c350cdeb9', slot: "subtitle" }, h("div", { key: '2840a426b505f7fe7ac5c285ab9b74ca4f99ab55' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: 'e3560b1bc8a6c062417f3e2b7a91b5b20b4e1880', slot: "action" }, h("salla-button", { key: '5d96fb354f2845955344d782e693fe27a0fa2652', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: '384ab549dc1942a600cc37c4df26008a8a05e9ab', name: "widget-btn-content" }, h("div", { key: '80d83cd6296f2e93ebbc0eada8737d65c76e4ce0', class: "s-gifting-widget-action-content" }, h("span", { key: '69f6686f6fe23bdab891ab12b295cf918ba0a8fb', innerHTML: SIGiftSharing }), " \u00A0", h("span", { key: '495c9e9b10dcb69a1335d0345d42a8323b52abef' }, this.sectionBtnText)))))), h("salla-modal", { key: '303a208c394aa2c91f2273b3909208c29266b490', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: '985a4d292ea01cb7ff48b443afe854de6f293abf', slot: "loading" }, h("div", { key: 'ba2b61f3bebf33d04d7132a00d3334a35042646a', class: "s-gifting-skeleton" }, h("div", { key: '4c8d2a5f128407423fd0c3070907d7781fb92283', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: '8585263f0bcb523a5b537c3b13f9c2a0a3a898d0', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: 'dbd2c3efbe5c91563275c09efd832709b6ed6748', class: "s-gifting-modal-title" }, h("div", { key: '4885e29c71001b530be33a4cf585fd77cf434dfd', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: '6c248a65bcc92c51555f0dd8f6d10c6f9d4a2b9a', height: '15px', width: '150px' })))), h("div", { key: '07de64586572cea82b2561344b5922ad4f7cb2c1', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '9a9e45772c6f5ce30a19ebcb53405032dfc25862', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'd1165987504fb2e5a7d013118b6ca5db2bf1523c', height: '230px' }), h("salla-skeleton", { key: '33cc657831541bcf6916c54c8dffca3b9933ccbb', height: '10px', width: '150px' }), h("salla-skeleton", { key: '46ff78b7725c57c955c73e9a71b9bf1c7340a354', height: '30px' }), h("salla-skeleton", { key: '520bd0a02c0bf4ef6109f014856dfad71d779aca', height: '40px' })))), h("slot", { key: '5519fd6df4f911b042f68f6825a563ce92f16733', name: "header" }), !!this.hasError ?
|
|
674
725
|
h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
|
|
675
726
|
:
|
|
676
727
|
[
|
|
677
|
-
h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: SIGiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
|
|
678
|
-
h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el }, h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el },
|
|
679
|
-
h("
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
728
|
+
h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: SIGiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, !this.skipStep1() && h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
|
|
729
|
+
h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el }, !this.skipStep1() && h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el }, this.gift && this.gift.show_images &&
|
|
730
|
+
h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), this.gift && this.gift.show_images &&
|
|
731
|
+
h("div", { class: "s-gifting-image-section" }, h("div", { class: `s-gifting-modal-uploader anime-item ${this.disableClass}`, ref: el => this.uploader = el }, h("span", { class: "s-gifting-remove-preview pointer-events-auto", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && this.gift && h("salla-file-upload", { "instant-upload": true, name: "image_url", url: salla.url.api(salla.product.api.getUrl('giftImage')), onUploaded: event => this.handleUploadImage(event.detail), labelIdle: this.getFilepondPlaceholder(), onRemoved: () => this.handleRemoveImage() })), h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && !!this.gift.gift_images && this.gift.gift_images.length > 0 ?
|
|
732
|
+
h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, this.gift && this.gift.gift_images ?
|
|
733
|
+
this.gift?.gift_images.map((item) => h("a", { class: "s-gifting-clickable s-gifting-image", onClick: () => this.setPreview(item) }, h("img", { src: item.url, alt: `${item.id}` }))) : ''))
|
|
734
|
+
: "")), this.gift && this.gift.show_texts ?
|
|
735
|
+
h("div", { class: "anime-item" }, h("div", { class: "s-gifting-modal-uploader-title s-gifting-text-title" }, this.giftText), h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
|
|
736
|
+
this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', this.gift && this.gift.show_custom_text ? h("option", { "data-id": "custom" }, this.giftCustomText) : null)), h("div", { class: this.showGiftText && this.gift && this.gift.show_custom_text ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))) : null, h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2(!!this.gift?.show_texts) }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", style: this.skipStep1() ? { opacity: '1', transform: 'translateX(0)', position: 'relative' } : undefined, ref: el => this.step2Elems = el }, h("div", { class: this.step2ItemClass(this.errors?.['sender_name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
|
|
683
737
|
h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
|
|
684
738
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.mobile'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
|
|
685
739
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.isPhysical() &&
|
|
@@ -689,8 +743,8 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
689
743
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.region']) : ''), this.isPhysical() &&
|
|
690
744
|
h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label", htmlFor: `${this.hostId}-city` }, this.receiverCityFieldLabel), h("salla-searchable-dropdown", { placeholder: this.selectCity, items: this.displayedCities, selectedItem: this.selectedCity, loading: this.loadingCities, searching: this.searchingCities, disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId), required: true, inputId: `${this.hostId}-city`, searchQuery: this.citySearchQuery, clientSearch: !this.enableCityAjaxSearch, dropUp: true, keepParentScroll: true, onItemSelected: (e) => this.handleCitySelected(e.detail), onSearchInput: (e) => this.handleCitySearch(e.detail), onDropdownClosed: () => this.handleCityDropdownClosed() }), this.errors && this.errors['receiver.city_id'] ?
|
|
691
745
|
h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), this.isPhysical() &&
|
|
692
|
-
h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.isPhysical() && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, h("a", { href: "#!", innerHTML: IconArrowLeft, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
|
|
693
|
-
], h("slot", { key: '
|
|
746
|
+
h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.isPhysical() && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, !this.skipStep1() && h("a", { href: "#!", innerHTML: IconArrowLeft, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
|
|
747
|
+
], h("slot", { key: '9413ec459b3b5dc137a90979990022b7ec1c6453', name: "footer" })))
|
|
694
748
|
];
|
|
695
749
|
}
|
|
696
750
|
static get style() { return sallaGiftingCss; }
|
|
@@ -709,6 +763,7 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
709
763
|
"selectImageForYourGift": [32],
|
|
710
764
|
"selectImageOrUpload": [32],
|
|
711
765
|
"selectGiftMessage": [32],
|
|
766
|
+
"giftText": [32],
|
|
712
767
|
"giftCustomText": [32],
|
|
713
768
|
"textId": [32],
|
|
714
769
|
"incorrectGiftText": [32],
|
|
@@ -769,6 +824,7 @@ const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting exten
|
|
|
769
824
|
"receiverCountryCode": [32],
|
|
770
825
|
"receiverEmail": [32],
|
|
771
826
|
"hostId": [32],
|
|
827
|
+
"disableClass": [32],
|
|
772
828
|
"receiverCity": [32],
|
|
773
829
|
"open": [64],
|
|
774
830
|
"close": [64],
|
|
@@ -63,7 +63,8 @@ const SallaLoginModal = /*@__PURE__*/ proxyCustomElement(class SallaLoginModal e
|
|
|
63
63
|
}
|
|
64
64
|
componentDidLoad() {
|
|
65
65
|
window.addEventListener('message', (event) => {
|
|
66
|
-
|
|
66
|
+
// Trust only our login iframe/passkey popup at the accounts origin.
|
|
67
|
+
if (!this.isTrustedMessage(event) || event.data?.source != "login") {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
70
|
if (!this.inline && !this.canRenderIframe) {
|
|
@@ -140,6 +141,8 @@ const SallaLoginModal = /*@__PURE__*/ proxyCustomElement(class SallaLoginModal e
|
|
|
140
141
|
return window.location.reload();
|
|
141
142
|
}
|
|
142
143
|
if (action === 'open_page') {
|
|
144
|
+
if (!this.isSafeUrl(value?.url))
|
|
145
|
+
return;
|
|
143
146
|
return window.location.href = value.url;
|
|
144
147
|
}
|
|
145
148
|
if (action === 'open_passkey_page') {
|
|
@@ -252,6 +255,33 @@ const SallaLoginModal = /*@__PURE__*/ proxyCustomElement(class SallaLoginModal e
|
|
|
252
255
|
}
|
|
253
256
|
withCartReset && Salla.cart.reset();
|
|
254
257
|
}
|
|
258
|
+
// Accept postMessage only from our own login iframe/passkey popup at the accounts origin.
|
|
259
|
+
isTrustedMessage(event) {
|
|
260
|
+
const fromIframe = !!this.iframe && event.source === this.iframe.contentWindow;
|
|
261
|
+
const fromPasskey = !!this.createPassKey && event.source === this.createPassKey;
|
|
262
|
+
if (!fromIframe && !fromPasskey)
|
|
263
|
+
return false;
|
|
264
|
+
let origin;
|
|
265
|
+
try {
|
|
266
|
+
origin = new URL(salla.config.get('login.url', 'https://accounts.salla.com')).origin;
|
|
267
|
+
}
|
|
268
|
+
catch (e) {
|
|
269
|
+
origin = 'https://accounts.salla.com';
|
|
270
|
+
}
|
|
271
|
+
return event.origin === origin;
|
|
272
|
+
}
|
|
273
|
+
// Reject javascript:/data: and other non-http(s) navigation targets.
|
|
274
|
+
isSafeUrl(url) {
|
|
275
|
+
if (typeof url !== 'string' || !url)
|
|
276
|
+
return false;
|
|
277
|
+
try {
|
|
278
|
+
const { protocol } = new URL(url, location.href);
|
|
279
|
+
return protocol === 'https:' || protocol === 'http:';
|
|
280
|
+
}
|
|
281
|
+
catch (e) {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
255
285
|
sendMessageToIframe(message) {
|
|
256
286
|
if (!this.iframe)
|
|
257
287
|
return;
|