@salla.sa/twilight-components 2.14.597 → 2.14.599
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-Dk1cJoJp.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-C1ipzdpz.js → filepond-plugin-file-poster-Bg4PCTUm.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DbTJ1H8k.js → filepond-plugin-file-validate-size-DmqmRxXK.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-CDOD2WKz.js → filepond-plugin-file-validate-type-BKd2QnuC.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CP7JkpKx.js → filepond-plugin-image-edit-BIPbEbnk.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Bm5i6zMO.js → filepond-plugin-image-exif-orientation-eQvkwjqa.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-INllb63L.js → filepond-plugin-image-preview-Ba8K6ft0.js} +1 -1
- package/dist/cjs/{index-DIEWuq3M.js → index-Bm1Ew-5K.js} +7 -7
- package/dist/cjs/{intlTelInput-bnpl10H7.js → intlTelInput-MWwwr9Td.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 +3 -3
- 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-BpuzEJnJ.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-scopes/salla-scopes.css +14 -0
- package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
- 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-scopes.js +2 -2
- 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-3PnWp9w_.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-D3ie06bz.js → filepond-plugin-file-poster-DmoyhYlz.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-C_S_eFQe.js → filepond-plugin-file-validate-size-CFkn2RRt.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-BE7nqQRE.js → filepond-plugin-file-validate-type-pyAPn10a.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-C6jDcMnX.js → filepond-plugin-image-edit-B5Rfgqvi.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-nKXdF-ae.js → filepond-plugin-image-exif-orientation-DK15iBED.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Dzl44GI1.js → filepond-plugin-image-preview-BIW0XW_M.js} +1 -1
- package/dist/esm/{index-BmRQjBRH.js → index-CwwxD-7C.js} +7 -7
- package/dist/esm/{intlTelInput-dGrU4Iu9.js → intlTelInput-DYJOvh3V.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 +3 -3
- 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-BzVn0xEV.js} +1 -1
- package/dist/twilight/{p-aeafb519.entry.js → p-0253bf71.entry.js} +1 -1
- package/dist/twilight/{p-e2d1d888.entry.js → p-065f2937.entry.js} +1 -1
- package/dist/twilight/{p-e8d94147.entry.js → p-067ad44c.entry.js} +1 -1
- package/dist/twilight/{p-db9994c2.entry.js → p-07817ae8.entry.js} +1 -1
- package/dist/twilight/{p-1f2844db.entry.js → p-0889368b.entry.js} +1 -1
- package/dist/twilight/{p-41248f5f.entry.js → p-0b0c9ecb.entry.js} +1 -1
- package/dist/twilight/{p-4235b3c2.entry.js → p-0ba03206.entry.js} +1 -1
- package/dist/twilight/{p-dd4bcce0.entry.js → p-0bff8609.entry.js} +1 -1
- package/dist/twilight/{p-cca10a34.entry.js → p-10418cc0.entry.js} +1 -1
- package/dist/twilight/{p-f70fa2e9.entry.js → p-114e4228.entry.js} +1 -1
- package/dist/twilight/{p-3bf933f6.entry.js → p-14b1b664.entry.js} +1 -1
- package/dist/twilight/{p-d3be7885.entry.js → p-18e75544.entry.js} +1 -1
- package/dist/twilight/{p-68919916.entry.js → p-1b25ea2a.entry.js} +1 -1
- package/dist/twilight/{p-d307d40a.entry.js → p-1c191c15.entry.js} +1 -1
- package/dist/twilight/{p-12338d19.entry.js → p-1f561241.entry.js} +1 -1
- package/dist/twilight/{p-1908ab44.entry.js → p-1fd1c0a3.entry.js} +1 -1
- package/dist/twilight/{p-730101ff.entry.js → p-20f98a45.entry.js} +1 -1
- package/dist/twilight/{p-3d1842e4.entry.js → p-2213f6eb.entry.js} +1 -1
- package/dist/twilight/{p-7e724019.entry.js → p-25fb1508.entry.js} +1 -1
- package/dist/twilight/{p-f0180034.entry.js → p-261aff22.entry.js} +1 -1
- package/dist/twilight/p-27df0290.entry.js +4 -0
- package/dist/twilight/{p-d034a3ba.entry.js → p-2b5242cb.entry.js} +1 -1
- package/dist/twilight/{p-00e1f5fd.entry.js → p-2db00d46.entry.js} +1 -1
- package/dist/twilight/{p-1c8dde1a.entry.js → p-2f04343f.entry.js} +1 -1
- package/dist/twilight/{p-4b111d7a.entry.js → p-3243ab6e.entry.js} +1 -1
- package/dist/twilight/{p-8c10cb85.entry.js → p-3de0b3ae.entry.js} +1 -1
- package/dist/twilight/p-46c8b068.entry.js +4 -0
- package/dist/twilight/{p-7aa15258.entry.js → p-49bba37d.entry.js} +1 -1
- package/dist/twilight/{p-8e2488fe.entry.js → p-4ca3b245.entry.js} +1 -1
- package/dist/twilight/{p-ece1fecd.entry.js → p-4ebee06a.entry.js} +1 -1
- package/dist/twilight/{p-8b21158b.entry.js → p-509b04c7.entry.js} +1 -1
- package/dist/twilight/{p-4aa07eca.entry.js → p-55399fed.entry.js} +1 -1
- package/dist/twilight/{p-3745be6d.entry.js → p-56c77026.entry.js} +1 -1
- package/dist/twilight/{p-87cedb04.entry.js → p-62373e96.entry.js} +1 -1
- package/dist/twilight/{p-8248cecd.entry.js → p-62c985bc.entry.js} +1 -1
- package/dist/twilight/{p-15ab81d6.entry.js → p-62dc337d.entry.js} +1 -1
- package/dist/twilight/{p-fde4cf31.entry.js → p-651db82c.entry.js} +1 -1
- package/dist/twilight/{p-3f373f1e.entry.js → p-659e00b7.entry.js} +1 -1
- package/dist/twilight/{p-99463d58.entry.js → p-6b2f6957.entry.js} +1 -1
- package/dist/twilight/{p-182d7bab.entry.js → p-6d47b269.entry.js} +1 -1
- package/dist/twilight/p-6d61d93c.entry.js +4 -0
- package/dist/twilight/{p-7dfe99e6.entry.js → p-6e7433f2.entry.js} +1 -1
- package/dist/twilight/{p-e9319448.entry.js → p-6fa1498b.entry.js} +1 -1
- package/dist/twilight/{p-71cbf7a4.entry.js → p-7148dbad.entry.js} +1 -1
- package/dist/twilight/{p-ac7d45b6.entry.js → p-76ca3445.entry.js} +1 -1
- package/dist/twilight/p-79ce9e95.entry.js +4 -0
- package/dist/twilight/{p-ec1589cf.entry.js → p-7f653481.entry.js} +1 -1
- package/dist/twilight/{p-7c7648d7.entry.js → p-83e1c586.entry.js} +1 -1
- package/dist/twilight/{p-3f66f717.entry.js → p-84912a5a.entry.js} +1 -1
- package/dist/twilight/p-89bba634.entry.js +4 -0
- package/dist/twilight/{p-39a16468.entry.js → p-89fddf1e.entry.js} +1 -1
- package/dist/twilight/{p-d542e647.entry.js → p-8aa29666.entry.js} +1 -1
- package/dist/twilight/{p-ab1d320f.entry.js → p-8d99e9d1.entry.js} +1 -1
- package/dist/twilight/{p-5f35b46a.entry.js → p-8e91da09.entry.js} +1 -1
- package/dist/twilight/{p-c5d4f71c.entry.js → p-925ba8ce.entry.js} +1 -1
- package/dist/twilight/{p-51694dd2.entry.js → p-93d284c4.entry.js} +1 -1
- package/dist/twilight/{p-bfdde3db.entry.js → p-96154a67.entry.js} +1 -1
- package/dist/twilight/{p-C1XjCBHg.js → p-B8yyit_i.js} +1 -1
- package/dist/twilight/{p-CWismw4I.js → p-Bb9AkvT4.js} +1 -1
- package/dist/twilight/{p-C48Rktr4.js → p-CYeysHdt.js} +1 -1
- package/dist/twilight/{p-B4fbRnFh.js → p-CaabLwI1.js} +1 -1
- package/dist/twilight/{p-DnZfyhH5.js → p-CntnRJCa.js} +1 -1
- package/dist/twilight/{p-BmRQjBRH.js → p-CwwxD-7C.js} +2 -2
- package/dist/twilight/{p-DYEGhE1O.js → p-DFj0n9Nh.js} +1 -1
- package/dist/twilight/{p-OCGvfvVA.js → p-DHXSZjVo.js} +1 -1
- package/dist/twilight/{p-imI5he7m.js → p-DzBc32wK.js} +1 -1
- package/dist/twilight/{p-BIToxPOg.js → p-FcjN5vEx.js} +1 -1
- package/dist/twilight/{p-5617656f.entry.js → p-a6594c68.entry.js} +1 -1
- package/dist/twilight/{p-c22ea75b.entry.js → p-a743a10a.entry.js} +1 -1
- package/dist/twilight/{p-f348601d.entry.js → p-aaac2388.entry.js} +1 -1
- package/dist/twilight/p-ac8a7743.entry.js +4 -0
- package/dist/twilight/{p-33e769b3.entry.js → p-afd47a18.entry.js} +1 -1
- package/dist/twilight/{p-de3c5f91.entry.js → p-b2ff66ed.entry.js} +1 -1
- package/dist/twilight/{p-cc46f297.entry.js → p-b7c815f7.entry.js} +1 -1
- package/dist/twilight/{p-91326a74.entry.js → p-b7dfb1f1.entry.js} +1 -1
- package/dist/twilight/{p-b5829615.entry.js → p-bc5b70e9.entry.js} +1 -1
- package/dist/twilight/{p-fa600113.entry.js → p-bcbb4a03.entry.js} +1 -1
- package/dist/twilight/{p-96f9eb1f.entry.js → p-c282869e.entry.js} +1 -1
- package/dist/twilight/{p-3a996401.entry.js → p-c4f92bae.entry.js} +1 -1
- package/dist/twilight/{p-58dcc966.entry.js → p-c7a491ef.entry.js} +1 -1
- package/dist/twilight/{p-b5499627.entry.js → p-c84e619a.entry.js} +1 -1
- package/dist/twilight/{p-c3d33aee.entry.js → p-c892e962.entry.js} +1 -1
- package/dist/twilight/{p-2cf7eb3b.entry.js → p-c98d1097.entry.js} +1 -1
- package/dist/twilight/{p-737b93c2.entry.js → p-cce07c4c.entry.js} +1 -1
- package/dist/twilight/{p-60e1fb1a.entry.js → p-d01c4ba8.entry.js} +1 -1
- package/dist/twilight/{p-6b0d6b9b.entry.js → p-d6886b07.entry.js} +1 -1
- package/dist/twilight/{p-6854e982.entry.js → p-d8cf239a.entry.js} +1 -1
- package/dist/twilight/{p-b6c5435e.entry.js → p-db1e0bc6.entry.js} +1 -1
- package/dist/twilight/{p-cf1cc0d1.entry.js → p-dc090987.entry.js} +1 -1
- package/dist/twilight/{p-baaa3e72.entry.js → p-dda47e56.entry.js} +1 -1
- package/dist/twilight/{p-feb068a2.entry.js → p-e1fb95cb.entry.js} +1 -1
- package/dist/twilight/{p-2de666d8.entry.js → p-e248f0d0.entry.js} +1 -1
- package/dist/twilight/{p-3fdaf198.entry.js → p-e4ed760b.entry.js} +1 -1
- package/dist/twilight/{p-2de4c351.entry.js → p-ee2a5db7.entry.js} +1 -1
- package/dist/twilight/{p-a80acba3.entry.js → p-f1d5ebf4.entry.js} +1 -1
- package/dist/twilight/{p-9e196eb0.entry.js → p-f310c72e.entry.js} +1 -1
- package/dist/twilight/p-f345a77d.entry.js +4 -0
- package/dist/twilight/{p-1a8c7481.entry.js → p-f38d6c1b.entry.js} +1 -1
- package/dist/twilight/{p-55b5158c.entry.js → p-f4d52f9b.entry.js} +1 -1
- package/dist/twilight/{p-f76349b3.entry.js → p-f5026adf.entry.js} +1 -1
- package/dist/twilight/{p-61956814.entry.js → p-f51e9549.entry.js} +1 -1
- package/dist/twilight/{p-e6bc3cf4.entry.js → p-f5693509.entry.js} +1 -1
- package/dist/twilight/p-f580d024.entry.js +4 -0
- package/dist/twilight/{p-f5afeed8.entry.js → p-f8b428cb.entry.js} +1 -1
- package/dist/twilight/{p-9108e712.entry.js → p-fe7751a8.entry.js} +1 -1
- 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-scopes/interfaces.d.ts +1 -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-cdbb6758.entry.js +0 -4
- 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-Bm1Ew-5K.js');
|
|
7
7
|
|
|
8
8
|
const sallaWalletCss = "/*!twlt*/@charset \"UTF-8\";.s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:flex !important;align-items:center !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:flex;flex-direction:column;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:max-content;display:flex;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}.s-wallet-summary{display:flex;align-items:stretch;gap:16px;margin-bottom:28px}.s-wallet-balance-card{flex:0 0 34%;max-width:240px;background:#fff;border-radius:12px;padding:20px;box-sizing:border-box}.s-wallet-balance-mark{width:48px;height:48px;border-radius:9999px;background:var(--color-primary-reverse, #eaf7f0);color:var(--color-primary, #2e8b57);display:inline-flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:12px}.s-wallet-balance-figure{font-size:18px;font-weight:700;color:#1c1c1c}.s-wallet-balance-label{margin-top:2px;font-size:12px;color:#9aa0a6}.s-wallet-amount{display:inline-flex;align-items:center;gap:4px;font-weight:700;white-space:nowrap}.s-wallet-amount-credit{color:#00af6c}.s-wallet-amount-debit{color:#f55157}.s-wallet-transaction-type{display:flex;align-items:center;color:#4b5563}@media screen and (min-width: 768px){.s-wallet-balance-card{display:flex;flex-direction:column;justify-content:center}}@media screen and (max-width: 767px){.s-wallet-summary{gap:12px;margin-bottom:20px}.s-wallet-balance-card{flex:0 0 38%;padding:16px;text-align:center}.s-wallet-balance-mark{margin-bottom:8px}}.absolute{position:absolute}.relative{position:relative}.flex{display:flex}.table{display:table}.hidden{display:none}.items-center{align-items:center}.p-3{padding:0.75rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.625rem * var(--tw-space-y-reverse))}@media (min-width: 768px){.s-wallet-container>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}}.s-wallet-mobile-title{display:inline-block;width:8rem;font-weight:400;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-wallet-mobile-title{display:none}}.s-wallet-reference-id{display:none}@media (min-width: 768px){.s-wallet-reference-id{display:inline-block}}.s-wallet-buy-as-gift-icon{margin-left:0.25rem;margin-right:0.25rem;display:inline-block;color:var(--color-primary)}.s-wallet-copy-to-clipboard-button{display:flex;align-items:center}@media (min-width: 768px){.s-wallet-copy-to-clipboard-button{display:none}}.s-wallet-copy-to-clipboard-button salla-button{position:relative}.s-wallet-copy-to-clipboard-button-icon{pointer-events:none;font-size:0.75rem;line-height:1rem}.s-wallet-copy-to-clipboard-button-icon:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-left:0.25rem}.s-wallet-copy-to-clipboard-button-icon:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-right:0.25rem}@media (min-width: 768px){.s-wallet-status-container{margin-left:0px;margin-right:0px}}.s-wallet-status-container:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-left:auto}.s-wallet-status-container:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-right:auto}.s-wallet-status-container i{margin-top:0.25rem}.s-wallet-status-container i:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-right:0.25rem}.s-wallet-status-container i:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-left:0.25rem}.s-wallet-rated-text{--tw-text-opacity:1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.s-wallet-unrated-text{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-wallet-no-content{display:flex;height:100%;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-wallet-no-content .icon{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-wallet-no-content p{margin-bottom:1rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-wallet-table{min-width:100%;border-collapse:separate}@media (min-width: 768px){.s-wallet-table{margin-bottom:-0.75rem;--tw-border-spacing-y:1.25rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}}.s-wallet-table-head{margin-bottom:1.25rem;display:none;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}@media (min-width: 768px){.s-wallet-table-head{display:table-header-group}}.s-wallet-table-head-tr-th{padding-left:1.5rem;padding-right:1.5rem;text-align:start;font-size:0.875rem;line-height:1.25rem;font-weight:500;text-transform:uppercase;letter-spacing:0.05em}.s-wallet-table-head-tr-th:where([dir=\"ltr\"],[dir=\"ltr\"] *){text-align:left}.s-wallet-table-head-tr-th:last-child:where([dir=\"ltr\"],[dir=\"ltr\"] *){text-align:right}.s-wallet-table-head-tr-th:where([dir=\"rtl\"],[dir=\"rtl\"] *){text-align:right}.s-wallet-table-head-tr-th:last-child:where([dir=\"rtl\"],[dir=\"rtl\"] *){text-align:left}.s-wallet-table-tbody-tr{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;overflow:hidden;border-radius:var(--s-radius, 0.25rem);border-bottom-width:8px;border-top-width:8px;--tw-border-opacity:1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}@media (min-width: 768px){.s-wallet-table-tbody-tr{display:table-row;flex-direction:row;flex-wrap:nowrap;padding:0px}}.s-wallet-table-tbody-tr-td{width:100%;white-space:nowrap;font-size:0.875rem;line-height:1.25rem}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}@media (min-width: 768px){.s-wallet-table-tbody-tr-td{height:5rem;width:auto}.s-wallet-table-tbody-tr-td:last-child{text-align:end}.s-wallet-table-tbody-tr-td:first-child:where([dir=\"ltr\"],[dir=\"ltr\"] *){border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem}.s-wallet-table-tbody-tr-td:first-child:where([dir=\"rtl\"],[dir=\"rtl\"] *){border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem}}.s-wallet-table-tbody-tr-td:first-child{font-weight:700}.s-wallet-table-tbody-tr-td-content{position:relative;display:flex;align-items:center;justify-content:space-between;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-size:0.75rem;line-height:1rem}@media (min-width: 768px){.s-wallet-table-tbody-tr-td-content{padding-left:1.5rem;padding-right:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem}}.s-wallet-table-tbody-tr-td-content:where([dir=\"ltr\"],[dir=\"ltr\"] *){padding-right:0.5rem}.s-wallet-table-tbody-tr-td-content:where([dir=\"rtl\"],[dir=\"rtl\"] *){padding-left:0.5rem}.s-wallet-table-tbody-tr a{position:absolute;top:0px;bottom:0px;display:block;width:100%}.s-wallet-table-tbody-tr a:where([dir=\"ltr\"],[dir=\"ltr\"] *){left:0px}.s-wallet-table-tbody-tr a:where([dir=\"rtl\"],[dir=\"rtl\"] *){right:0px}@media (min-width: 768px){.md\\:mx-0{margin-left:0px;margin-right:0px}.md\\:inline-block{display:inline-block}.md\\:hidden{display:none}}.ltr\\:ml-auto:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-left:auto}.ltr\\:mr-4:where([dir=\"ltr\"],[dir=\"ltr\"] *){margin-right:1rem}.rtl\\:ml-4:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-left:1rem}.rtl\\:mr-auto:where([dir=\"rtl\"],[dir=\"rtl\"] *){margin-right:auto}";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-Bm1Ew-5K.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
|
|
@@ -173,6 +173,20 @@
|
|
|
173
173
|
.s-scopes-input:where([dir="rtl"], [dir="rtl"] *) {
|
|
174
174
|
margin-left: 0.75rem;
|
|
175
175
|
}
|
|
176
|
+
.s-scopes-icon {
|
|
177
|
+
display: inline-block;
|
|
178
|
+
height: 2rem;
|
|
179
|
+
width: 2rem;
|
|
180
|
+
border-radius: var(--s-radius, 0.25rem);
|
|
181
|
+
object-fit: contain;
|
|
182
|
+
vertical-align: middle;
|
|
183
|
+
}
|
|
184
|
+
.s-scopes-icon:where([dir="ltr"], [dir="ltr"] *) {
|
|
185
|
+
margin-right: 0.75rem;
|
|
186
|
+
}
|
|
187
|
+
.s-scopes-icon:where([dir="rtl"], [dir="rtl"] *) {
|
|
188
|
+
margin-left: 0.75rem;
|
|
189
|
+
}
|
|
176
190
|
.s-scopes-label {
|
|
177
191
|
display: flex;
|
|
178
192
|
flex-grow: 1;
|
|
@@ -157,7 +157,7 @@ export class SallaScopees {
|
|
|
157
157
|
return h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, h("span", { slot: "title" }, salla.lang.get("blocks.scope.branch_looking_for_not_found")), h("span", { slot: "description" }, salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")));
|
|
158
158
|
}
|
|
159
159
|
defaultContent() {
|
|
160
|
-
return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes?.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("input", { id: `${this.selection} + '_scope_' + ${scope.id}`, name: "lang", type: "radio", value: scope.id, onChange: (event) => this.handleScopeSelection(event), class: "s-scopes-input", checked: !!this.current_scope && this.current_scope.id == scope.id }), h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, h("span", null, scope.name))))), this.footerContent()];
|
|
160
|
+
return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes?.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("input", { id: `${this.selection} + '_scope_' + ${scope.id}`, name: "lang", type: "radio", value: scope.id, onChange: (event) => this.handleScopeSelection(event), class: "s-scopes-input", checked: !!this.current_scope && this.current_scope.id == scope.id }), h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, h("span", null, scope.icon && h("img", { src: scope.icon, alt: "", loading: "lazy", class: "s-scopes-icon" }), scope.name))))), this.footerContent()];
|
|
161
161
|
}
|
|
162
162
|
availabilityContent() {
|
|
163
163
|
return h("div", { class: "s-scopes-container" }, this.scopes?.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("h2", { class: { "s-scopes-label": true, "s-scopes-clickable": this.mode === ModeType.DEFAULT } }, h("span", null, scope.name)), h("h2", { style: { 'color': scope?.availability?.color }, class: `s-scopes-${scope?.availability?.key}` }, scope?.availability?.label))));
|
|
@@ -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 {
|