@salla.sa/twilight-components 2.14.597 → 2.14.598
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-Dw1N5qBB.js → filepond-Yrcu23Ew.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C1ipzdpz.js → filepond-plugin-file-poster-DRez16xM.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DbTJ1H8k.js → filepond-plugin-file-validate-size-H6Ijvhk2.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CDOD2WKz.js → filepond-plugin-file-validate-type-ozbX9Tb-.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CP7JkpKx.js → filepond-plugin-image-edit-CynCgK8H.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Bm5i6zMO.js → filepond-plugin-image-exif-orientation-C18fCqoh.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-INllb63L.js → filepond-plugin-image-preview-FiRPNiZp.js} +1 -1
- package/dist/cjs/{index-DIEWuq3M.js → index-CpkvCUQ3.js} +7 -7
- package/dist/cjs/{intlTelInput-bnpl10H7.js → intlTelInput-dW1ObsSS.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- 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 +1 -1
- 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 +73 -13
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +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 +4 -2
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +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 +1 -1
- 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 +14 -3
- 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 +11 -4
- package/dist/cjs/salla-orders.cjs.entry.js +32 -2
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card.cjs.entry.js +3 -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 +2 -2
- package/dist/cjs/salla-user-menu.cjs.entry.js +33 -2
- 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 +1 -1
- package/dist/cjs/{vanilla-picker-BaSDLxjI.js → vanilla-picker-CSaDVE6R.js} +1 -1
- package/dist/collection/Helpers/money-text.js +37 -0
- package/dist/collection/components/salla-comments/salla-comment-item.js +3 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +63 -3
- package/dist/collection/components/salla-login-modal/salla-login-modal.css +3 -0
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +12 -1
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +10 -3
- package/dist/collection/components/salla-orders/salla-orders.js +4 -1
- package/dist/collection/components/salla-product-card/salla-product-card.js +2 -0
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.css +17 -12
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +32 -1
- package/dist/components/index.js +3 -3
- package/dist/components/salla-comment-item2.js +3 -1
- package/dist/components/salla-file-upload2.js +63 -3
- package/dist/components/salla-login-modal2.js +13 -2
- package/dist/components/salla-order-totals-card.js +10 -3
- package/dist/components/salla-orders.js +31 -1
- package/dist/components/salla-product-card2.js +2 -0
- package/dist/components/salla-trust-badges.js +1 -1
- package/dist/components/salla-user-menu.js +32 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{filepond-DfLkIBAw.js → filepond-Cqatu146.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-D3ie06bz.js → filepond-plugin-file-poster-DbVXhgv4.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-C_S_eFQe.js → filepond-plugin-file-validate-size-BpJPambh.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BE7nqQRE.js → filepond-plugin-file-validate-type-3Qrskyxw.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C6jDcMnX.js → filepond-plugin-image-edit-Cjy7cOV1.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-nKXdF-ae.js → filepond-plugin-image-exif-orientation-DYM12Yp-.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Dzl44GI1.js → filepond-plugin-image-preview-C9nMEHVX.js} +1 -1
- package/dist/esm/{index-BmRQjBRH.js → index-noRE1pbw.js} +7 -7
- package/dist/esm/{intlTelInput-dGrU4Iu9.js → intlTelInput-CiinYrbq.js} +1 -1
- package/dist/esm/loader.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 +1 -1
- 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 +73 -13
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +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 +4 -2
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +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 +1 -1
- 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 +14 -3
- 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 +11 -4
- package/dist/esm/salla-orders.entry.js +32 -2
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card.entry.js +3 -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 +2 -2
- package/dist/esm/salla-user-menu.entry.js +33 -2
- 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 +2 -2
- package/dist/esm/{vanilla-picker-DRghK0RD.js → vanilla-picker-BWBrgMJQ.js} +1 -1
- package/dist/twilight/{p-730101ff.entry.js → p-03e89cb1.entry.js} +1 -1
- package/dist/twilight/{p-fa600113.entry.js → p-07dc637e.entry.js} +1 -1
- package/dist/twilight/{p-9e196eb0.entry.js → p-0859fe23.entry.js} +1 -1
- package/dist/twilight/{p-fde4cf31.entry.js → p-0b54834f.entry.js} +1 -1
- package/dist/twilight/{p-e9319448.entry.js → p-0c9f5232.entry.js} +1 -1
- package/dist/twilight/{p-91326a74.entry.js → p-0ca1a782.entry.js} +1 -1
- package/dist/twilight/{p-cdbb6758.entry.js → p-0cb548be.entry.js} +1 -1
- package/dist/twilight/{p-87cedb04.entry.js → p-138d6214.entry.js} +1 -1
- package/dist/twilight/p-141218a3.entry.js +4 -0
- package/dist/twilight/{p-3d1842e4.entry.js → p-15b8fa7f.entry.js} +1 -1
- package/dist/twilight/{p-58dcc966.entry.js → p-15f5d424.entry.js} +1 -1
- package/dist/twilight/{p-d3be7885.entry.js → p-16072449.entry.js} +1 -1
- package/dist/twilight/{p-d307d40a.entry.js → p-16b2f58b.entry.js} +1 -1
- package/dist/twilight/{p-cf1cc0d1.entry.js → p-18aff2d5.entry.js} +1 -1
- package/dist/twilight/{p-61956814.entry.js → p-1930b915.entry.js} +1 -1
- package/dist/twilight/p-1cbbdcea.entry.js +4 -0
- package/dist/twilight/{p-51694dd2.entry.js → p-1fe92c36.entry.js} +1 -1
- package/dist/twilight/{p-c5d4f71c.entry.js → p-221e47a5.entry.js} +1 -1
- package/dist/twilight/{p-6854e982.entry.js → p-2636c473.entry.js} +1 -1
- package/dist/twilight/{p-8e2488fe.entry.js → p-27712ed1.entry.js} +1 -1
- package/dist/twilight/{p-68919916.entry.js → p-2eea4245.entry.js} +1 -1
- package/dist/twilight/{p-1c8dde1a.entry.js → p-3263103c.entry.js} +1 -1
- package/dist/twilight/{p-4235b3c2.entry.js → p-341a7ab8.entry.js} +1 -1
- package/dist/twilight/{p-4b111d7a.entry.js → p-3b4f66d3.entry.js} +1 -1
- package/dist/twilight/{p-3f373f1e.entry.js → p-3c45c49f.entry.js} +1 -1
- package/dist/twilight/{p-b5829615.entry.js → p-3f730d01.entry.js} +1 -1
- package/dist/twilight/{p-e8d94147.entry.js → p-40c8b553.entry.js} +1 -1
- package/dist/twilight/{p-cca10a34.entry.js → p-4333c630.entry.js} +1 -1
- package/dist/twilight/{p-c3d33aee.entry.js → p-454b32f0.entry.js} +1 -1
- package/dist/twilight/{p-feb068a2.entry.js → p-475d01e2.entry.js} +1 -1
- package/dist/twilight/{p-3745be6d.entry.js → p-4962d869.entry.js} +1 -1
- package/dist/twilight/{p-f348601d.entry.js → p-4ce97595.entry.js} +1 -1
- package/dist/twilight/{p-00e1f5fd.entry.js → p-4d1582f8.entry.js} +1 -1
- package/dist/twilight/{p-baaa3e72.entry.js → p-4d482ee4.entry.js} +1 -1
- package/dist/twilight/{p-d034a3ba.entry.js → p-5110433d.entry.js} +1 -1
- package/dist/twilight/{p-41248f5f.entry.js → p-517807b2.entry.js} +1 -1
- package/dist/twilight/{p-8248cecd.entry.js → p-52a7dbb7.entry.js} +1 -1
- package/dist/twilight/{p-15ab81d6.entry.js → p-5360d082.entry.js} +1 -1
- package/dist/twilight/{p-b5499627.entry.js → p-53bf1d54.entry.js} +1 -1
- package/dist/twilight/p-540a7588.entry.js +4 -0
- package/dist/twilight/{p-d542e647.entry.js → p-5a6c4fdf.entry.js} +1 -1
- package/dist/twilight/{p-bfdde3db.entry.js → p-5ac2e6ab.entry.js} +1 -1
- package/dist/twilight/{p-de3c5f91.entry.js → p-64158678.entry.js} +1 -1
- package/dist/twilight/{p-182d7bab.entry.js → p-67ecb74a.entry.js} +1 -1
- package/dist/twilight/{p-e2d1d888.entry.js → p-6e53afc6.entry.js} +1 -1
- package/dist/twilight/{p-ab1d320f.entry.js → p-6f66a0f2.entry.js} +1 -1
- package/dist/twilight/{p-99463d58.entry.js → p-721819ee.entry.js} +1 -1
- package/dist/twilight/{p-737b93c2.entry.js → p-76d11b5c.entry.js} +1 -1
- package/dist/twilight/{p-5f35b46a.entry.js → p-78b86647.entry.js} +1 -1
- package/dist/twilight/{p-6b0d6b9b.entry.js → p-7f0bdf0e.entry.js} +1 -1
- package/dist/twilight/{p-4aa07eca.entry.js → p-7f882abf.entry.js} +1 -1
- package/dist/twilight/{p-e6bc3cf4.entry.js → p-826ed1c6.entry.js} +1 -1
- package/dist/twilight/{p-3a996401.entry.js → p-82d59bf3.entry.js} +1 -1
- package/dist/twilight/{p-1908ab44.entry.js → p-856ed222.entry.js} +1 -1
- package/dist/twilight/{p-ec1589cf.entry.js → p-87b3c231.entry.js} +1 -1
- package/dist/twilight/{p-7dfe99e6.entry.js → p-87dcc9d8.entry.js} +1 -1
- package/dist/twilight/{p-ece1fecd.entry.js → p-8876efa6.entry.js} +1 -1
- package/dist/twilight/{p-3bf933f6.entry.js → p-88d64b87.entry.js} +1 -1
- package/dist/twilight/{p-71cbf7a4.entry.js → p-88f650da.entry.js} +1 -1
- package/dist/twilight/{p-f70fa2e9.entry.js → p-8e248aa7.entry.js} +1 -1
- package/dist/twilight/{p-2de4c351.entry.js → p-919dd049.entry.js} +1 -1
- package/dist/twilight/{p-60e1fb1a.entry.js → p-950634d1.entry.js} +1 -1
- package/dist/twilight/{p-cc46f297.entry.js → p-9ce917a6.entry.js} +1 -1
- package/dist/twilight/{p-a80acba3.entry.js → p-9e084610.entry.js} +1 -1
- package/dist/twilight/{p-55b5158c.entry.js → p-9ed52621.entry.js} +1 -1
- package/dist/twilight/{p-96f9eb1f.entry.js → p-9fcc7eeb.entry.js} +1 -1
- package/dist/twilight/{p-DnZfyhH5.js → p-B867dk1j.js} +1 -1
- package/dist/twilight/{p-DYEGhE1O.js → p-BT5AJCX9.js} +1 -1
- package/dist/twilight/{p-B4fbRnFh.js → p-CADeV7A-.js} +1 -1
- package/dist/twilight/{p-C1XjCBHg.js → p-CbJEogz0.js} +1 -1
- package/dist/twilight/{p-imI5he7m.js → p-CyV163V_.js} +1 -1
- package/dist/twilight/{p-C48Rktr4.js → p-D98H4WeK.js} +1 -1
- package/dist/twilight/p-DN2opqoB.js +9 -0
- package/dist/twilight/{p-OCGvfvVA.js → p-DWkNp24H.js} +1 -1
- package/dist/twilight/{p-CWismw4I.js → p-DomdkzLW.js} +1 -1
- package/dist/twilight/{p-f5afeed8.entry.js → p-a030da8e.entry.js} +1 -1
- package/dist/twilight/{p-2cf7eb3b.entry.js → p-a2de7999.entry.js} +1 -1
- package/dist/twilight/{p-9108e712.entry.js → p-a8408d51.entry.js} +1 -1
- package/dist/twilight/p-aabc57e3.entry.js +4 -0
- package/dist/twilight/p-b1a35349.entry.js +4 -0
- package/dist/twilight/{p-2de666d8.entry.js → p-ba76a96a.entry.js} +1 -1
- package/dist/twilight/{p-7c7648d7.entry.js → p-ba9ee435.entry.js} +1 -1
- package/dist/twilight/{p-7aa15258.entry.js → p-be7dcc25.entry.js} +1 -1
- package/dist/twilight/{p-7e724019.entry.js → p-c41c1eff.entry.js} +1 -1
- package/dist/twilight/{p-b6c5435e.entry.js → p-c589a326.entry.js} +1 -1
- package/dist/twilight/{p-aeafb519.entry.js → p-c5d4682b.entry.js} +1 -1
- package/dist/twilight/{p-dd4bcce0.entry.js → p-c631e2cd.entry.js} +1 -1
- package/dist/twilight/{p-f0180034.entry.js → p-c6af4f05.entry.js} +1 -1
- package/dist/twilight/{p-12338d19.entry.js → p-c8d269df.entry.js} +1 -1
- package/dist/twilight/{p-5617656f.entry.js → p-cab2f22a.entry.js} +1 -1
- package/dist/twilight/{p-db9994c2.entry.js → p-ce120ce6.entry.js} +1 -1
- package/dist/twilight/{p-f76349b3.entry.js → p-ce981b2f.entry.js} +1 -1
- package/dist/twilight/p-d09b6b8c.entry.js +4 -0
- package/dist/twilight/{p-3f66f717.entry.js → p-d13f5256.entry.js} +1 -1
- package/dist/twilight/{p-1a8c7481.entry.js → p-d306b947.entry.js} +1 -1
- package/dist/twilight/{p-33e769b3.entry.js → p-d986aa18.entry.js} +1 -1
- package/dist/twilight/{p-8c10cb85.entry.js → p-e4c88bee.entry.js} +1 -1
- package/dist/twilight/{p-c22ea75b.entry.js → p-e7fc0d63.entry.js} +1 -1
- package/dist/twilight/{p-39a16468.entry.js → p-eef846fa.entry.js} +1 -1
- package/dist/twilight/{p-ac7d45b6.entry.js → p-f03f893c.entry.js} +1 -1
- package/dist/twilight/{p-1f2844db.entry.js → p-f5f0246f.entry.js} +1 -1
- package/dist/twilight/{p-8b21158b.entry.js → p-f6f633fc.entry.js} +1 -1
- package/dist/twilight/{p-3fdaf198.entry.js → p-f9fbcb8d.entry.js} +1 -1
- package/dist/twilight/p-fc717703.entry.js +4 -0
- package/dist/twilight/{p-BmRQjBRH.js → p-noRE1pbw.js} +2 -2
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/Helpers/money-text.d.ts +13 -0
- package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +10 -0
- package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +3 -0
- package/dist/types/components/salla-order-totals-card/interfaces.d.ts +3 -3
- package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +2 -0
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +13 -0
- package/package.json +19 -19
- package/dist/twilight/p-1557d0ca.entry.js +0 -4
- package/dist/twilight/p-19592be3.entry.js +0 -4
- package/dist/twilight/p-1c8bf883.entry.js +0 -4
- package/dist/twilight/p-74ccf675.entry.js +0 -4
- package/dist/twilight/p-844ebeb6.entry.js +0 -4
- package/dist/twilight/p-BIToxPOg.js +0 -9
- package/dist/twilight/p-d37e6c2f.entry.js +0 -4
- package/dist/twilight/p-fe3645b0.entry.js +0 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CpkvCUQ3.js');
|
|
7
7
|
|
|
8
8
|
const sallaWishlistActionsCss = "/*!twlt*/:host{display:block}.s-wishlist-actions-menu{min-width:200px;inset-inline-end:0;inset-inline-start:auto;list-style:none;margin:0;padding:4px 0;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}.s-wishlist-actions-menu-item{display:block;width:100%;padding:10px 16px;text-align:start;font-size:0.875rem;color:#374151;background:transparent;cursor:pointer;white-space:nowrap}.s-wishlist-actions-menu-item:hover{background-color:#f3f4f6;color:var(--color-primary)}.s-wishlist-actions-panel{box-shadow:0 1px 3px rgba(0, 0, 0, 0.08)}.s-wishlist-actions-panel-select-all{user-select:none}.s-wishlist-actions-select-all:indeterminate,.s-wishlist-actions-select-all:indeterminate:hover,.s-wishlist-actions-select-all:indeterminate:focus{background-color:var(--color-primary);border-color:var(--color-primary)}.s-wishlist-actions-select-all:indeterminate::after{content:\"\";position:absolute;top:50%;left:50%;width:10px;height:2px;background:#fff;border:none;transform:translate(-50%, -50%)}.s-wishlist-actions-social-anchor{display:none}h1.s-wishlist-actions-page-title{text-align:start !important}.static{position:static}.absolute{position:absolute}.relative{position:relative}.z-20{z-index:20}.mb-3{margin-bottom:0.75rem}.mt-1{margin-top:0.25rem}.mt-3{margin-top:0.75rem}.flex{display:flex}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:0.5rem}.gap-3{gap:0.75rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:0.5rem}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-4{padding:1rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}";
|
|
9
9
|
|
package/dist/cjs/twilight.cjs.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
const escapeHtml = (value) => String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
5
|
+
/** Riyal icon swap, the same rule `salla.money()` applies when the store enables `use_sar_symbol`. */
|
|
6
|
+
const withSarIcon = (html) => salla?.config?.get?.('store.settings.use_sar_symbol') ? html.replace(/SAR|ر\.س\.?/g, '<i class=sicon-sar></i>') : html;
|
|
7
|
+
/**
|
|
8
|
+
* Money in a given currency as HTML, without ever borrowing another currency's symbol.
|
|
9
|
+
* `salla.money()` resolves currencies from the page config, which under Multimarket only holds the
|
|
10
|
+
* selected market's currencies, and silently falls back to them — so an order placed in SAR (or KWD)
|
|
11
|
+
* would show the current market's symbol. Known currencies keep `salla.money()`'s store formatting;
|
|
12
|
+
* unknown ones use the ISO symbol from `Intl`, separated by a non-breaking space.
|
|
13
|
+
*/
|
|
14
|
+
export function moneyHtml(amount, currency) {
|
|
15
|
+
// Only bypass salla.money when the page's currency list is known and lacks this code.
|
|
16
|
+
const currencies = salla?.config?.get?.('currencies');
|
|
17
|
+
if (!currency || !currencies || typeof currencies !== 'object' || currencies[currency]) {
|
|
18
|
+
return salla.money({ amount, currency });
|
|
19
|
+
}
|
|
20
|
+
let symbol = currency;
|
|
21
|
+
try {
|
|
22
|
+
symbol = new Intl.NumberFormat(salla?.lang?.locale || 'ar', { style: 'currency', currency, currencyDisplay: 'narrowSymbol' })
|
|
23
|
+
.formatToParts(0)
|
|
24
|
+
.find(part => part.type === 'currency')?.value || currency;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// unknown ISO code: show the code itself
|
|
28
|
+
}
|
|
29
|
+
return withSarIcon(`${escapeHtml(salla.helpers.number(amount))} ${escapeHtml(symbol)}`);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Server-formatted money text (twig `|money`) as safe HTML: escaped, then the riyal icon swap.
|
|
33
|
+
* Kept for payloads that still send formatted strings.
|
|
34
|
+
*/
|
|
35
|
+
export function moneyTextHtml(text) {
|
|
36
|
+
return withSarIcon(escapeHtml(text));
|
|
37
|
+
}
|
|
@@ -67,6 +67,8 @@ export class SallaCommentItem {
|
|
|
67
67
|
catch {
|
|
68
68
|
salla.log('Bad json for liked_comments');
|
|
69
69
|
}
|
|
70
|
+
// back from an SSO login redirect: finish the like the guest asked for
|
|
71
|
+
salla.auth?.api?.takeResume?.('comment.like', this.comment.id) && this.toggleLike();
|
|
70
72
|
}
|
|
71
73
|
getReplies() {
|
|
72
74
|
return Array.isArray(this.comment.replies) ? this.comment.replies : [this.comment.replies];
|
|
@@ -91,7 +93,7 @@ export class SallaCommentItem {
|
|
|
91
93
|
}
|
|
92
94
|
async toggleLike() {
|
|
93
95
|
if (salla.config.isGuest()) {
|
|
94
|
-
return salla.
|
|
96
|
+
return salla.api.auth.requireLoginThen(`comment::like.after-login.${this.comment.id}`, () => this.toggleLike(), { action: 'comment.like', payload: this.comment.id });
|
|
95
97
|
}
|
|
96
98
|
this.likedComments = JSON.parse(localStorage.getItem('liked_comments') || '[]');
|
|
97
99
|
const isLiked = this.likedComments.includes(this.comment.id);
|
|
@@ -7,6 +7,8 @@ import CancelIcon from "../../assets/svg/cancel.svg";
|
|
|
7
7
|
import PlayIcon from "../../assets/svg/play-circle.svg";
|
|
8
8
|
import { setTranslationDefault } from "../../Helpers/translate";
|
|
9
9
|
const VIDEO_METADATA_TIMEOUT_MS = 10000;
|
|
10
|
+
// store feature (`store.features`) that switches profile avatars to the `upload` endpoint + url-only `profile/update`
|
|
11
|
+
const AVATAR_UPLOAD_FEATURE = 'avatar-upload-endpoint';
|
|
10
12
|
export class SallaFileUpload {
|
|
11
13
|
/**
|
|
12
14
|
* Lazy load FilePond and all plugins
|
|
@@ -38,6 +40,12 @@ export class SallaFileUpload {
|
|
|
38
40
|
}
|
|
39
41
|
constructor() {
|
|
40
42
|
this.filePondLoaded = false;
|
|
43
|
+
/** true when the uploaded url must be saved on the profile as the avatar (avatar upload endpoint flag is on) */
|
|
44
|
+
this.savesAvatarOnUpload = false;
|
|
45
|
+
/** the profile image uses the default `profile/update` url (no custom `url` given) */
|
|
46
|
+
this.usesDefaultProfileUrl = false;
|
|
47
|
+
this.avatarSaveGeneration = 0; // bumped when the avatar is removed, so pending saves are dropped
|
|
48
|
+
this.avatarSaveQueue = Promise.resolve();
|
|
41
49
|
this.max_images_count = (count) => salla.lang.get('common.uploader.max_images_count', { count });
|
|
42
50
|
this.max_videos_count = (count) => salla.lang.get('common.uploader.max_videos_count', { count });
|
|
43
51
|
this.max_count_hint = (count) => salla.lang.get('common.uploader.max_count_hint', { count });
|
|
@@ -189,9 +197,12 @@ export class SallaFileUpload {
|
|
|
189
197
|
this.instantUpload = true;
|
|
190
198
|
}
|
|
191
199
|
if (!this.url && this.profileImage) {
|
|
200
|
+
// default: the file goes straight to `profile/update`. With the `avatar-upload-endpoint` store feature
|
|
201
|
+
// the url is switched to the `upload` endpoint once the store features are known (see componentDidLoad).
|
|
192
202
|
this.url = salla.url.api('profile/update');
|
|
193
203
|
this.instantUpload = true;
|
|
194
204
|
this.host.hasAttribute('name') || (this.name = 'avatar');
|
|
205
|
+
this.usesDefaultProfileUrl = true;
|
|
195
206
|
}
|
|
196
207
|
if (!this.name) {
|
|
197
208
|
this.name = 'file';
|
|
@@ -551,6 +562,19 @@ export class SallaFileUpload {
|
|
|
551
562
|
notifyUploadError(error, file) {
|
|
552
563
|
salla.notify?.error?.(this.getUploadErrorMessageForFile(error, file));
|
|
553
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* Save an already uploaded avatar url on the customer profile (text-only request).
|
|
567
|
+
*/
|
|
568
|
+
async saveProfileAvatar(url) {
|
|
569
|
+
try {
|
|
570
|
+
await salla.profile.update({ avatar: url });
|
|
571
|
+
return true;
|
|
572
|
+
}
|
|
573
|
+
catch (error) {
|
|
574
|
+
salla.notify?.error?.(error?.response?.data?.error?.message || salla.lang.get('common.errors.error_occurred'));
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
554
578
|
removeFailedFile(file) {
|
|
555
579
|
if (!this.filepond?.getFiles().some(pondFile => pondFile.id === file.id)) {
|
|
556
580
|
return;
|
|
@@ -891,16 +915,23 @@ export class SallaFileUpload {
|
|
|
891
915
|
this.revokeAllPreviewObjectUrls();
|
|
892
916
|
}
|
|
893
917
|
render() {
|
|
894
|
-
return (h(Host, { key: '
|
|
918
|
+
return (h(Host, { key: 'af7edd83879313df0a142890044c2bb02d5de73b', class: {
|
|
895
919
|
"s-file-upload": true,
|
|
896
920
|
"s-file-upload-profile-image": this.profileImage,
|
|
897
921
|
"s-file-upload-multiple": this.allowMultiple,
|
|
898
922
|
"s-file-upload-has-gallery": this.usesGalleryPreview(),
|
|
899
|
-
} }, h("input", { key: '
|
|
923
|
+
} }, h("input", { key: 'ea630bd56caac801e7f69f602d3553321cd81b17', type: "file", name: this.name, ref: ele => this.fileUploader = ele, required: this.required, class: "s-file-upload-wrapper s-file-upload-input", accept: this.accept }), this.allowMultiple && this.showMaxCountHint ? h("div", { class: "s-file-upload-hint s-hidden" }, this.max_count_hint(this.getTotalMaxFiles())) : '', h("input", { key: '884b42abe4b9cd832ab1d078af93c9cbe4164112', class: "s-hidden", name: 'hidden-' + this.name, required: this.required, value: this.getHiddenInputValue(), ref: input => this.hiddenInput = input }), this.renderPreviewGallery()));
|
|
900
924
|
}
|
|
901
925
|
async componentDidLoad() {
|
|
902
926
|
await Salla.onReady();
|
|
903
927
|
await Salla.lang.onLoaded();
|
|
928
|
+
if (this.usesDefaultProfileUrl && Salla.config.get('store.features', []).includes(AVATAR_UPLOAD_FEATURE)) {
|
|
929
|
+
// Avatars are uploaded to the store `upload` endpoint first (`files[]` + `type`, images only),
|
|
930
|
+
// then saved on the profile as a plain URL, so `profile/update` never receives a file part.
|
|
931
|
+
this.url = salla.url.api('upload');
|
|
932
|
+
this.host.hasAttribute('accept') || (this.accept = 'image/png, image/jpeg, image/jpg'); // upload only allows jpg/png
|
|
933
|
+
this.savesAvatarOnUpload = true;
|
|
934
|
+
}
|
|
904
935
|
if (this.profileImage && !this.value) {
|
|
905
936
|
this.value = Salla.config.get('user.avatar');
|
|
906
937
|
}
|
|
@@ -996,6 +1027,9 @@ export class SallaFileUpload {
|
|
|
996
1027
|
}
|
|
997
1028
|
},
|
|
998
1029
|
onremovefile: (_error, file) => {
|
|
1030
|
+
if (this.savesAvatarOnUpload) {
|
|
1031
|
+
this.avatarSaveGeneration++;
|
|
1032
|
+
}
|
|
999
1033
|
if (this.usesGalleryPreview()) {
|
|
1000
1034
|
if (file) {
|
|
1001
1035
|
this.emitRemovedFile(file);
|
|
@@ -1052,6 +1086,26 @@ export class SallaFileUpload {
|
|
|
1052
1086
|
catch {
|
|
1053
1087
|
return null;
|
|
1054
1088
|
}
|
|
1089
|
+
if (this.savesAvatarOnUpload) {
|
|
1090
|
+
// `upload` answers with a list of urls
|
|
1091
|
+
const item = Array.isArray(responseData) ? responseData[0] : responseData;
|
|
1092
|
+
const avatarUrl = typeof item === 'object' && item !== null ? item.filePath || item.url : item;
|
|
1093
|
+
if (!this.isValidUploadResult(avatarUrl))
|
|
1094
|
+
return null;
|
|
1095
|
+
const generation = this.avatarSaveGeneration;
|
|
1096
|
+
// saves run one after the other so an older upload can never overwrite a newer one
|
|
1097
|
+
this.avatarSaveQueue = this.avatarSaveQueue.then(async () => {
|
|
1098
|
+
if (generation !== this.avatarSaveGeneration)
|
|
1099
|
+
return; // removed while waiting in the queue
|
|
1100
|
+
const saved = await this.saveProfileAvatar(avatarUrl);
|
|
1101
|
+
// expose the value and emit `uploaded` only once the profile holds this avatar (unless it was removed meanwhile)
|
|
1102
|
+
if (saved && generation === this.avatarSaveGeneration) {
|
|
1103
|
+
this.value = { id: this.generateUploadFileId(), url: avatarUrl };
|
|
1104
|
+
this.uploadedHandler();
|
|
1105
|
+
}
|
|
1106
|
+
});
|
|
1107
|
+
return avatarUrl;
|
|
1108
|
+
}
|
|
1055
1109
|
if ((this.instantUpload || this.allowMultiple) && Array.isArray(responseData) && responseData.length > 0) {
|
|
1056
1110
|
const item = responseData[0];
|
|
1057
1111
|
const fileUrl = typeof item === 'object' && item !== null ? item.filePath || item.url : item;
|
|
@@ -1094,7 +1148,13 @@ export class SallaFileUpload {
|
|
|
1094
1148
|
}
|
|
1095
1149
|
},
|
|
1096
1150
|
ondata: formData => {
|
|
1097
|
-
if (this.
|
|
1151
|
+
if (this.savesAvatarOnUpload) {
|
|
1152
|
+
const avatarFormData = new FormData();
|
|
1153
|
+
formData.forEach((value) => avatarFormData.append('files[]', value));
|
|
1154
|
+
avatarFormData.append('type', 'avatar');
|
|
1155
|
+
formData = avatarFormData; // continue below so `payloadParams` / `formData` are still applied
|
|
1156
|
+
}
|
|
1157
|
+
else if (this.allowMultiple) {
|
|
1098
1158
|
const newFormData = new FormData();
|
|
1099
1159
|
// ? This line suppose to send all files in one request but its not working properly
|
|
1100
1160
|
// const filesArray = this.filepond.getFiles().map(file => file.file);
|
|
@@ -31,6 +31,7 @@ export class SallaLoginModal {
|
|
|
31
31
|
this.scrolling = 'no';
|
|
32
32
|
this.direction = document.dir;
|
|
33
33
|
this.canRenderIframe = false;
|
|
34
|
+
this.loginSucceeded = false;
|
|
34
35
|
salla.event.on('login::open', (data) => this.onLoginOpen(data));
|
|
35
36
|
salla.event.on('modal::close', (data) => {
|
|
36
37
|
if (this.iframe)
|
|
@@ -125,6 +126,7 @@ export class SallaLoginModal {
|
|
|
125
126
|
}
|
|
126
127
|
// temporary condition until we handle both cases separately
|
|
127
128
|
if (action == 'authenticated' || action == 'authenticated_web_auth') {
|
|
129
|
+
this.loginSucceeded = true;
|
|
128
130
|
!value?.withoutClose && this.close();
|
|
129
131
|
return salla.auth.api.handlAfterAuthenticatedResponse(value, this.supportWebAuth)
|
|
130
132
|
.then(() => !(value?.withoutReload || this.withoutReload) && setTimeout(() => window.location.reload(), 1000));
|
|
@@ -178,6 +180,14 @@ export class SallaLoginModal {
|
|
|
178
180
|
// Fire an event if withoutReload is true
|
|
179
181
|
return;
|
|
180
182
|
}
|
|
183
|
+
/** Tell the listeners waiting for a login (e.g. `requireLoginThen`) that the popup was closed without one. */
|
|
184
|
+
onVisibilityChanged(visible) {
|
|
185
|
+
if (visible) {
|
|
186
|
+
this.loginSucceeded = false;
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
!this.loginSucceeded && Salla.event.emit('salla-login::dismissed');
|
|
190
|
+
}
|
|
181
191
|
close() {
|
|
182
192
|
Salla.event.emit('salla-login::closing');
|
|
183
193
|
this.modal.close();
|
|
@@ -229,6 +239,7 @@ export class SallaLoginModal {
|
|
|
229
239
|
}
|
|
230
240
|
});
|
|
231
241
|
if (token) {
|
|
242
|
+
this.loginSucceeded = true;
|
|
232
243
|
this.modal.close();
|
|
233
244
|
Salla.auth.event.tokenFetched(token);
|
|
234
245
|
try {
|
|
@@ -343,7 +354,7 @@ export class SallaLoginModal {
|
|
|
343
354
|
if (this.inline) {
|
|
344
355
|
return this.getLoginDom();
|
|
345
356
|
}
|
|
346
|
-
return (h("salla-modal", { class: "s-login-modal", ref: modal => this.modal = modal, width: "xs" }, this.getLoginDom()));
|
|
357
|
+
return (h("salla-modal", { class: "s-login-modal", ref: modal => this.modal = modal, width: "xs", onModalVisibilityChanged: e => this.onVisibilityChanged(e.detail) }, this.getLoginDom()));
|
|
347
358
|
}
|
|
348
359
|
getLoginDom() {
|
|
349
360
|
if (!this.canRenderIframe) {
|
|
@@ -36,21 +36,28 @@ export class SallaOrderTotalsCard {
|
|
|
36
36
|
renderRefundRow(amount) {
|
|
37
37
|
return (h("div", { class: "s-order-totals-card-row" }, h("div", { class: "s-order-totals-card-row-inner" }, h("dt", { class: "s-order-totals-card-refund-label" }, h("span", { class: "s-order-totals-card-refund-icon" }, h("i", { class: "sicon-info" })), h("span", null, " ", salla.lang.get('pages.orders.refund_amount'))), h("dd", { class: "s-order-totals-card-refund-value" }, h("b", { innerHTML: salla.money(amount) })))));
|
|
38
38
|
}
|
|
39
|
+
/** Totals arrive either as a money object or a plain float, depending on the presenter. */
|
|
40
|
+
toAmount(value) {
|
|
41
|
+
return (typeof value === 'number' ? value : value?.amount) || 0;
|
|
42
|
+
}
|
|
39
43
|
render() {
|
|
40
44
|
if (!this.summary) {
|
|
41
45
|
return h(Host, { class: "s-order-totals-card-wrapper" });
|
|
42
46
|
}
|
|
43
47
|
const { summary } = this;
|
|
44
48
|
const hasOptions = Array.isArray(summary.options) ? summary.options.length > 0 : false;
|
|
49
|
+
const refundAmount = this.toAmount(summary.refund_amount);
|
|
50
|
+
// Independent of the refund: a partially refunded order can still owe a balance.
|
|
51
|
+
const isPartiallyPaid = summary.has_remaining_amount ?? this.toAmount(summary.remaining_amount) > 0;
|
|
45
52
|
return (h(Host, { class: "s-order-totals-card-wrapper" }, h("div", { class: "s-order-totals-card-panel" }, h("h2", { id: "summary-heading", class: "s-order-totals-card-heading" }, salla.lang.get('pages.orders.summary')), h("div", { class: "s-order-totals-card-flow" }, h("dl", { class: "s-order-totals-card-list" }, this.renderTotalRow(salla.lang.get('pages.cart.items_total'), summary.sub_total), hasOptions &&
|
|
46
53
|
this.renderTotalRow(salla.lang.get('pages.cart.order_options_total'), summary.options_total), summary.discounts && this.renderDiscountRow(), summary.cod_cost &&
|
|
47
54
|
this.renderTotalRow(salla.lang.get('pages.orders.cod_cost'), summary.cod_cost, ''), summary.shipping_cost &&
|
|
48
55
|
this.renderTotalRow(salla.lang.get('pages.orders.shipping_cost'), summary.shipping_cost, 's-order-totals-card-shipping'), summary.tax &&
|
|
49
|
-
this.renderTotalRow(`${salla.lang.get('pages.cart.tax')} ${summary.tax.percent}%`, summary.tax.amount, ''),
|
|
56
|
+
this.renderTotalRow(`${salla.lang.get('pages.cart.tax')} ${summary.tax.percent}%`, summary.tax.amount, ''), isPartiallyPaid && summary.paid_amount != null
|
|
50
57
|
? this.renderTotalRow(salla.lang.get('pages.orders.partially_paid'), summary.paid_amount, '')
|
|
51
|
-
: null,
|
|
58
|
+
: null, isPartiallyPaid
|
|
52
59
|
? this.renderTotalRow(salla.lang.get('pages.orders.remaining_amount'), summary.remaining_amount, '')
|
|
53
|
-
: null, h("div", { class: "s-order-totals-card-total" }, this.renderTotalRow(salla.lang.get('pages.orders.final_total'), summary.total, 's-order-totals-card-total-label', 's-order-totals-card-total-value', true)),
|
|
60
|
+
: null, h("div", { class: "s-order-totals-card-total" }, this.renderTotalRow(salla.lang.get('pages.orders.final_total'), summary.total, 's-order-totals-card-total-label', 's-order-totals-card-total-value', true)), refundAmount > 0 ? (h("div", { class: "s-order-totals-card-refund" }, this.renderRefundRow(summary.refund_amount))) : null)))));
|
|
54
61
|
}
|
|
55
62
|
static get is() { return "salla-order-totals-card"; }
|
|
56
63
|
static get originalStyleUrls() {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { h } from "@stencil/core";
|
|
5
5
|
import Helper from "../../Helpers/Helper";
|
|
6
|
+
import { moneyHtml } from "../../Helpers/money-text";
|
|
6
7
|
import { addMissingTranslations } from "../../Helpers/translate";
|
|
7
8
|
const FEEDBACK_STATUS_WAITING = 'waiting';
|
|
8
9
|
const TAB_QUERY_PARAM = 'tab';
|
|
@@ -370,7 +371,9 @@ export class SallaOrder {
|
|
|
370
371
|
span4.classList.add('s-orders-mobile-title');
|
|
371
372
|
span4.textContent = `${this.totalOrderText}:`;
|
|
372
373
|
const div4 = document.createElement('div');
|
|
373
|
-
|
|
374
|
+
// In the order's own currency: salla.money alone falls back to the selected market's currency
|
|
375
|
+
// when the page config does not list the order currency (Multimarket).
|
|
376
|
+
div4.innerHTML = moneyHtml(Number(order.total?.amount), order.total?.currency);
|
|
374
377
|
const anchor2 = document.createElement('a');
|
|
375
378
|
if (order.url)
|
|
376
379
|
anchor2.href = order.url;
|
|
@@ -33,6 +33,8 @@ export class SallaProductCard {
|
|
|
33
33
|
this.fitImageHeight = salla.config.get('store.settings.product.fit_type');
|
|
34
34
|
salla.wishlist.event.onAdded((_res, id) => this.toggleFavoriteIcon(true, id));
|
|
35
35
|
salla.wishlist.event.onRemoved((_res, id) => this.toggleFavoriteIcon(false, id));
|
|
36
|
+
// e.g. a guest signs into an account that already saved this product
|
|
37
|
+
salla.event.on('wishlist::storage.synced', () => this.productData && this.toggleFavoriteIcon(this.isInWishlist()));
|
|
36
38
|
this.placeholder = salla.url.asset(salla.config.get('theme.settings.placeholder'));
|
|
37
39
|
});
|
|
38
40
|
// Parse product data
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
/*!twlt*/.s-trust-badges-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!twlt*/.s-trust-badges-image {
|
|
2
|
+
width: 55px;
|
|
3
|
+
height: 55px;
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
}
|
|
6
|
+
.s-trust-badges-wrapper {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
4
9
|
}
|
|
5
10
|
.s-trust-badges-wrapper > :not([hidden]) ~ :not([hidden]) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
--tw-space-x-reverse: 0;
|
|
12
|
+
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
|
13
|
+
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
9
14
|
}
|
|
10
15
|
.s-trust-badges-wrapper:where([dir="rtl"], [dir="rtl"] *) > :not([hidden]) ~ :not([hidden]) {
|
|
11
|
-
|
|
16
|
+
--tw-space-x-reverse: 1;
|
|
12
17
|
}
|
|
13
18
|
.s-trust-badges-label {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
margin-bottom: 0.25rem;
|
|
20
|
+
font-size: 0.875rem;
|
|
21
|
+
line-height: 1.25rem;
|
|
17
22
|
}
|
|
18
23
|
.s-trust-badges-number {
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
font-size: 0.875rem;
|
|
25
|
+
line-height: 1.25rem;
|
|
21
26
|
}
|
|
@@ -222,7 +222,17 @@ export class SallaUserMenu {
|
|
|
222
222
|
window.addEventListener('click', this.onClickOutside);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Read consent at the moment of navigation: a link built earlier could be stale (consent accepted,
|
|
227
|
+
* withdrawn or removed on logout after the menu rendered). Only touches the profile link's href.
|
|
228
|
+
*/
|
|
229
|
+
prepareProfileLink(event, itemKey) {
|
|
230
|
+
if (itemKey === 'profile' && this.profileUrl && this.sallaAccountEnabled) {
|
|
231
|
+
event.currentTarget.href = this.withAnonymousId(this.profileUrl);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
225
234
|
menuItemClicked(event, itemKey) {
|
|
235
|
+
this.prepareProfileLink(event, itemKey);
|
|
226
236
|
if (itemKey !== 'logout') {
|
|
227
237
|
return;
|
|
228
238
|
}
|
|
@@ -261,7 +271,7 @@ export class SallaUserMenu {
|
|
|
261
271
|
return (h("li", { class: {
|
|
262
272
|
's-user-menu-dropdown-item': true,
|
|
263
273
|
's-user-menu-dropdown-item-logout': i + 1 === Object.entries(this.items).length,
|
|
264
|
-
} }, h("a", { ...this.getItemAnchorLinkAttrs(itemKey), class: "s-user-menu-dropdown-item-link", onClick: event => this.menuItemClicked(event, itemKey) }, h("i", { class: "s-user-menu-dropdown-item-prefix", innerHTML: itemValue }), h("span", { class: "s-user-menu-dropdown-item-title" }, this[itemKey]), itemKey === 'wallet' && !this.inline && (this.walletBalance || this.walletBalanceLoading) ? (h("span", { class: "s-user-menu-dropdown-item-balance", style: { display: 'inline-flex', alignItems: 'center', gap: '4px' } }, this.walletBalance ? h("span", { innerHTML: this.walletBalance }) : '', this.walletBalanceLoading ? h("salla-loading", { size: "14" }) : '')) : (''), !['٠', '0', undefined].includes(this.badges[itemKey]) ? (h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[itemKey])) : (''))));
|
|
274
|
+
} }, h("a", { ...this.getItemAnchorLinkAttrs(itemKey), class: "s-user-menu-dropdown-item-link", onClick: event => this.menuItemClicked(event, itemKey), onMouseDown: event => this.prepareProfileLink(event, itemKey), onFocus: event => this.prepareProfileLink(event, itemKey), onContextMenu: event => this.prepareProfileLink(event, itemKey) }, h("i", { class: "s-user-menu-dropdown-item-prefix", innerHTML: itemValue }), h("span", { class: "s-user-menu-dropdown-item-title" }, this[itemKey]), itemKey === 'wallet' && !this.inline && (this.walletBalance || this.walletBalanceLoading) ? (h("span", { class: "s-user-menu-dropdown-item-balance", style: { display: 'inline-flex', alignItems: 'center', gap: '4px' } }, this.walletBalance ? h("span", { innerHTML: this.walletBalance }) : '', this.walletBalanceLoading ? h("salla-loading", { size: "14" }) : '')) : (''), !['٠', '0', undefined].includes(this.badges[itemKey]) ? (h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[itemKey])) : (''))));
|
|
265
275
|
}
|
|
266
276
|
componentShouldUpdate() {
|
|
267
277
|
if (!this.opened) {
|
|
@@ -287,6 +297,27 @@ export class SallaUserMenu {
|
|
|
287
297
|
buildProfileUrl(token) {
|
|
288
298
|
return `${Salla.config.get('account.url', 'https://accounts.salla.com')}/${salla.config.get('user.language_code')}/user?store=${Salla.config.get('store.id')}&info=${encodeURIComponent(token)}`;
|
|
289
299
|
}
|
|
300
|
+
/** Appends the analytics anonymous id (`aid`) when the customer currently consents. */
|
|
301
|
+
withAnonymousId(url) {
|
|
302
|
+
const anonymousId = this.getAnalyticsAnonymousId();
|
|
303
|
+
return anonymousId ? `${url}&aid=${encodeURIComponent(anonymousId)}` : url;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Analytics anonymous id, handed to Salla Account so its events share the
|
|
307
|
+
* store visitor's identity. Only shared with the customer's consent, the same
|
|
308
|
+
* rule analytics applies to user ids.
|
|
309
|
+
*/
|
|
310
|
+
getAnalyticsAnonymousId() {
|
|
311
|
+
try {
|
|
312
|
+
if (Salla.storage.get('cookies-consent') !== 'accepted') {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
return Salla.analytics?.getAnonymousId?.() || null;
|
|
316
|
+
}
|
|
317
|
+
catch (e) {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
290
321
|
static get is() { return "salla-user-menu"; }
|
|
291
322
|
static get originalStyleUrls() {
|
|
292
323
|
return {
|