@salla.sa/twilight-components 2.14.508 → 2.14.510
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-C1mPvQ8T.js → filepond-COZHgu78.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-B-pZ8apM.js → filepond-plugin-file-poster-Bi4mWImr.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-CsE7s9Zn.js → filepond-plugin-file-validate-size-CtrIas22.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-pm3Q3QSJ.js → filepond-plugin-file-validate-type-Djj5o2ks.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DLXp4kE0.js → filepond-plugin-image-edit-CaVm_-Xi.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-hH92QKy-.js → filepond-plugin-image-exif-orientation-BD44-lrC.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-CVbeEopx.js → filepond-plugin-image-preview-BlHYB_rk.js} +1 -1
- package/dist/cjs/{functions-CRoHuI_r.js → functions-D7e0oMZu.js} +1 -1
- package/dist/cjs/{index-hhUDuquL.js → index-D6MQobeP.js} +6 -6
- package/dist/cjs/{index-Bz-aFSt9.js → index-KhpPkTL1.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_5.cjs.entry.js +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-apps-icons.cjs.entry.js +1 -1
- 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-booking-field_7.cjs.entry.js +10 -10
- package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +36 -16
- 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 +2 -2
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +12 -17
- 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_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +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 +1 -1
- package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-exchange-product-card_5.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-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-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card_2.cjs.entry.js +36 -6
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
- package/dist/cjs/salla-products-list.cjs.entry.js +26 -3
- 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 +28 -8
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.cjs.entry.js +1 -1
- package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/salla-slider.cjs.entry.js +1 -1
- package/dist/cjs/salla-social-share.cjs.entry.js +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-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
- package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/{tracked-promise--XbBsK1N.js → tracked-promise-Dmb45-BD.js} +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-D_g2rKwM.js → vanilla-picker-B_OQkkn3.js} +1 -1
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +36 -15
- package/dist/collection/components/salla-comments/salla-comments.css +2 -5
- package/dist/collection/components/salla-comments/salla-comments.js +6 -3
- package/dist/collection/components/salla-products-list/salla-products-list.js +25 -2
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +35 -5
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.css +7 -3
- package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +64 -9
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.css +15 -31
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -11
- package/dist/components/index.js +2 -2
- package/dist/components/salla-cart-coupons.js +36 -15
- package/dist/components/salla-comment-factors2.js +1 -1
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comments.js +29 -20
- package/dist/components/salla-products-list2.js +25 -2
- package/dist/components/salla-products-slider2.js +35 -5
- package/dist/components/salla-review-factors-tags.js +1 -141
- package/dist/components/salla-review-factors-tags2.js +173 -0
- package/dist/components/salla-reviews-summary2.js +13 -16
- package/dist/esm/{filepond-CA6zTz9c.js → filepond-B1eTr-KK.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-DOWZmTt9.js → filepond-plugin-file-poster-exJROlFk.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-CW4aTVdl.js → filepond-plugin-file-validate-size-CZY_F4BF.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DiGUQ5qM.js → filepond-plugin-file-validate-type-D8z0FHfz.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BOu5ykhi.js → filepond-plugin-image-edit-CACbacvT.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-C9OxiFhh.js → filepond-plugin-image-exif-orientation-DwS9XuCo.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-BCRRj5t-.js → filepond-plugin-image-preview-BYy-d2mY.js} +1 -1
- package/dist/esm/{functions-Cdhve8oP.js → functions-DEUWeLq4.js} +1 -1
- package/dist/esm/{index-DWPgHXOD.js → index-Bt0ajKaf.js} +6 -6
- package/dist/esm/{index-DMTmdoWu.js → index-FMb5OkaH.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +1 -1
- package/dist/esm/salla-add-product-button_5.entry.js +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-apps-icons.entry.js +1 -1
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-booking-field_7.entry.js +10 -10
- package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
- package/dist/esm/salla-cart-coupons.entry.js +36 -16
- 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 +2 -2
- package/dist/esm/salla-comment-form_8.entry.js +12 -17
- 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_2.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +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 +1 -1
- package/dist/esm/salla-loyalty-banner.entry.js +2 -2
- package/dist/esm/salla-loyalty-exchange-product-card_5.entry.js +3 -3
- package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
- package/dist/esm/salla-loyalty-panel.entry.js +3 -3
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty-reward.entry.js +2 -2
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_2.entry.js +1 -1
- package/dist/esm/salla-menu.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
- package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-next-order-coupon.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-branch.entry.js +1 -1
- package/dist/esm/salla-order-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-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-card_2.entry.js +36 -6
- package/dist/esm/salla-product-size-guide.entry.js +1 -1
- package/dist/esm/salla-products-list.entry.js +26 -3
- 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 +28 -8
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.entry.js +1 -1
- package/dist/esm/salla-skeleton.entry.js +1 -1
- package/dist/esm/salla-slider.entry.js +1 -1
- package/dist/esm/salla-social-share.entry.js +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-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-user-menu.entry.js +1 -1
- package/dist/esm/salla-user-profile.entry.js +1 -1
- package/dist/esm/salla-user-settings.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/{tracked-promise-BCGZPTbE.js → tracked-promise-T29mWxDS.js} +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-DFTSHsGD.js → vanilla-picker-Dpp89BQ6.js} +1 -1
- package/dist/twilight/{p-b6fd1b52.entry.js → p-055187ca.entry.js} +1 -1
- package/dist/twilight/{p-3e4915d1.entry.js → p-09ea780c.entry.js} +1 -1
- package/dist/twilight/{p-29bad38b.entry.js → p-0adbdc90.entry.js} +1 -1
- package/dist/twilight/{p-39249883.entry.js → p-1071ea00.entry.js} +1 -1
- package/dist/twilight/{p-01a74537.entry.js → p-139c80a0.entry.js} +1 -1
- package/dist/twilight/{p-c1b27d26.entry.js → p-1b0d555a.entry.js} +1 -1
- package/dist/twilight/{p-82d622c6.entry.js → p-1e225a23.entry.js} +1 -1
- package/dist/twilight/{p-5261d916.entry.js → p-1f3d6151.entry.js} +1 -1
- package/dist/twilight/{p-08c1f879.entry.js → p-22712655.entry.js} +1 -1
- package/dist/twilight/{p-8b646ef9.entry.js → p-22d6c097.entry.js} +1 -1
- package/dist/twilight/{p-409967bd.entry.js → p-23bfb6be.entry.js} +1 -1
- package/dist/twilight/{p-4810a1b1.entry.js → p-277d5788.entry.js} +1 -1
- package/dist/twilight/{p-6a8c68d3.entry.js → p-2a4b20fa.entry.js} +1 -1
- package/dist/twilight/{p-86f7baf1.entry.js → p-2e6b6fbb.entry.js} +1 -1
- package/dist/twilight/{p-2442ae2d.entry.js → p-2f7ddf17.entry.js} +1 -1
- package/dist/twilight/{p-6feca279.entry.js → p-300e6aef.entry.js} +1 -1
- package/dist/twilight/{p-2718fe0c.entry.js → p-301e3802.entry.js} +1 -1
- package/dist/twilight/{p-6dc098ce.entry.js → p-346af34c.entry.js} +1 -1
- package/dist/twilight/{p-f99acb35.entry.js → p-37e88d81.entry.js} +1 -1
- package/dist/twilight/{p-a138bee9.entry.js → p-41269041.entry.js} +1 -1
- package/dist/twilight/{p-f5327d06.entry.js → p-4136f4d5.entry.js} +1 -1
- package/dist/twilight/p-42fc42d6.entry.js +4 -0
- package/dist/twilight/{p-72e4cb1c.entry.js → p-4328bd24.entry.js} +1 -1
- package/dist/twilight/{p-123a3a37.entry.js → p-44c94e17.entry.js} +1 -1
- package/dist/twilight/{p-b094fd03.entry.js → p-457be53a.entry.js} +1 -1
- package/dist/twilight/{p-ea20010a.entry.js → p-49c926d2.entry.js} +1 -1
- package/dist/twilight/{p-a9a85cfe.entry.js → p-4e7b8137.entry.js} +1 -1
- package/dist/twilight/{p-d140a35a.entry.js → p-4eb47f77.entry.js} +1 -1
- package/dist/twilight/{p-8e9b1b2b.entry.js → p-4f61e580.entry.js} +1 -1
- package/dist/twilight/{p-f83489a2.entry.js → p-5255bb4a.entry.js} +1 -1
- package/dist/twilight/{p-17c02185.entry.js → p-549b56f5.entry.js} +1 -1
- package/dist/twilight/{p-541f7f57.entry.js → p-57919fb4.entry.js} +1 -1
- package/dist/twilight/{p-5cbea591.entry.js → p-5a62369e.entry.js} +1 -1
- package/dist/twilight/{p-70adb6de.entry.js → p-5b9c3427.entry.js} +1 -1
- package/dist/twilight/{p-3d973988.entry.js → p-5e02c7e7.entry.js} +1 -1
- package/dist/twilight/{p-1b858716.entry.js → p-5e1140fb.entry.js} +1 -1
- package/dist/twilight/{p-911d2800.entry.js → p-5e851bce.entry.js} +1 -1
- package/dist/twilight/{p-c8a60c05.entry.js → p-5f2f9351.entry.js} +1 -1
- package/dist/twilight/{p-cadedd90.entry.js → p-65ba2211.entry.js} +1 -1
- package/dist/twilight/{p-f35812bf.entry.js → p-67bd9271.entry.js} +1 -1
- package/dist/twilight/{p-f98dd619.entry.js → p-6dd674c3.entry.js} +1 -1
- package/dist/twilight/{p-f5d273a4.entry.js → p-6ed50846.entry.js} +1 -1
- package/dist/twilight/{p-ec75d885.entry.js → p-70a1619e.entry.js} +1 -1
- package/dist/twilight/{p-04a34073.entry.js → p-70a9d197.entry.js} +1 -1
- package/dist/twilight/{p-af7962e9.entry.js → p-75500766.entry.js} +1 -1
- package/dist/twilight/{p-ee54773e.entry.js → p-774fece9.entry.js} +1 -1
- package/dist/twilight/{p-88015898.entry.js → p-7992cf55.entry.js} +1 -1
- package/dist/twilight/{p-196e416c.entry.js → p-7d5855f2.entry.js} +1 -1
- package/dist/twilight/{p-e82fb471.entry.js → p-7d978fbc.entry.js} +1 -1
- package/dist/twilight/{p-66d7dc4b.entry.js → p-7dfe0786.entry.js} +1 -1
- package/dist/twilight/p-7ebd07e6.entry.js +4 -0
- package/dist/twilight/{p-33314f4c.entry.js → p-86ec92b8.entry.js} +1 -1
- package/dist/twilight/{p-de78fa6c.entry.js → p-8775397b.entry.js} +1 -1
- package/dist/twilight/p-8a0d3cc9.entry.js +4 -0
- package/dist/twilight/{p-ac7bd839.entry.js → p-8a80f76c.entry.js} +1 -1
- package/dist/twilight/{p-c069565d.entry.js → p-8db02f76.entry.js} +1 -1
- package/dist/twilight/{p-3cab158c.entry.js → p-90de004a.entry.js} +1 -1
- package/dist/twilight/{p-ccb12c91.entry.js → p-91804117.entry.js} +1 -1
- package/dist/twilight/{p-72b9eac4.entry.js → p-9310e773.entry.js} +1 -1
- package/dist/twilight/{p-a8ddd1bb.entry.js → p-95b32475.entry.js} +1 -1
- package/dist/twilight/{p-27ccf3c2.entry.js → p-97bb4320.entry.js} +1 -1
- package/dist/twilight/{p-48f7b6db.entry.js → p-98b482a2.entry.js} +1 -1
- package/dist/twilight/p-9c12fd69.entry.js +4 -0
- package/dist/twilight/{p-ae695102.entry.js → p-9c220b6d.entry.js} +1 -1
- package/dist/twilight/p-9cbf61c6.entry.js +4 -0
- package/dist/twilight/{p-B2IpqWj1.js → p-BBv-zo85.js} +2 -2
- package/dist/twilight/{p-Dd1m1dz2.js → p-BF-dDqac.js} +1 -1
- package/dist/twilight/{p-CtvAJfAB.js → p-BFxb7lGH.js} +1 -1
- package/dist/twilight/{p-CPEhvySG.js → p-BUfV-mlp.js} +1 -1
- package/dist/twilight/p-Bt0ajKaf.js +5 -0
- package/dist/twilight/{p-BcTcBNfQ.js → p-C1E96uk_.js} +1 -1
- package/dist/twilight/p-CUg7C93N.js +4 -0
- package/dist/twilight/{p-b7vjgdh1.js → p-CdRScS-B.js} +1 -1
- package/dist/twilight/{p-XUX4U548.js → p-CgGcK4mo.js} +1 -1
- package/dist/twilight/{p-3fOwWicU.js → p-DInaMMrI.js} +1 -1
- package/dist/twilight/{p-DuCwWaQ_.js → p-DSxQpYYV.js} +1 -1
- package/dist/twilight/{p-BPbju0nD.js → p-NoY5Pdvf.js} +1 -1
- package/dist/twilight/{p-7b2aed14.entry.js → p-a660aacc.entry.js} +1 -1
- package/dist/twilight/{p-6d284b59.entry.js → p-a7e8ac45.entry.js} +1 -1
- package/dist/twilight/{p-8e5d089a.entry.js → p-a8f28e45.entry.js} +1 -1
- package/dist/twilight/{p-8f5159fa.entry.js → p-aea5b09b.entry.js} +1 -1
- package/dist/twilight/{p-851d8872.entry.js → p-afd24c2b.entry.js} +1 -1
- package/dist/twilight/{p-9d021d6e.entry.js → p-b09fcdb4.entry.js} +1 -1
- package/dist/twilight/{p-793f5e44.entry.js → p-b197fad7.entry.js} +1 -1
- package/dist/twilight/{p-9fb43cf0.entry.js → p-b37ea19f.entry.js} +1 -1
- package/dist/twilight/{p-34396806.entry.js → p-b626976f.entry.js} +1 -1
- package/dist/twilight/{p-ee2fea82.entry.js → p-bd847c2e.entry.js} +1 -1
- package/dist/twilight/{p-2f131202.entry.js → p-c5d7a901.entry.js} +1 -1
- package/dist/twilight/{p-df2ac369.entry.js → p-cfc4cfaa.entry.js} +1 -1
- package/dist/twilight/{p-8308bef2.entry.js → p-d172feb2.entry.js} +1 -1
- package/dist/twilight/{p-80d9f3f2.entry.js → p-d18e08bd.entry.js} +1 -1
- package/dist/twilight/{p-2a2585f6.entry.js → p-d4b2ce41.entry.js} +1 -1
- package/dist/twilight/{p-72aaf959.entry.js → p-d60ce89d.entry.js} +1 -1
- package/dist/twilight/{p-74a27cf4.entry.js → p-dd87bf9c.entry.js} +1 -1
- package/dist/twilight/{p-20c2aebb.entry.js → p-e13fc06b.entry.js} +1 -1
- package/dist/twilight/{p-38656e34.entry.js → p-e232c59b.entry.js} +1 -1
- package/dist/twilight/{p-51e42995.entry.js → p-e2693453.entry.js} +1 -1
- package/dist/twilight/{p-bb05f144.entry.js → p-e3e9a105.entry.js} +1 -1
- package/dist/twilight/{p-26cc4a6c.entry.js → p-e57d1b21.entry.js} +1 -1
- package/dist/twilight/{p-5bce4517.entry.js → p-e8070f83.entry.js} +1 -1
- package/dist/twilight/{p-12d9c95b.entry.js → p-e8a86f16.entry.js} +1 -1
- package/dist/twilight/{p-d263e364.entry.js → p-ea0ca518.entry.js} +1 -1
- package/dist/twilight/{p-80207cbe.entry.js → p-f0d1222d.entry.js} +1 -1
- package/dist/twilight/{p-3039ea2d.entry.js → p-f61c0f39.entry.js} +1 -1
- package/dist/twilight/{p-caa2055b.entry.js → p-f6efad0a.entry.js} +1 -1
- package/dist/twilight/{p-eb3706da.entry.js → p-f7a0c179.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-cart-coupons/salla-cart-coupons.d.ts +5 -0
- package/dist/types/components/salla-comments/salla-comments.d.ts +1 -1
- package/dist/types/components/salla-products-list/salla-products-list.d.ts +13 -0
- package/dist/types/components/salla-products-slider/salla-products-slider.d.ts +13 -0
- package/dist/types/components/salla-review-factors-tags/salla-review-factors-tags.d.ts +8 -2
- package/dist/types/components/salla-reviews-summary/salla-reviews-summary.d.ts +0 -2
- package/dist/types/components.d.ts +12 -2
- package/package.json +5 -5
- package/dist/twilight/p-0b72c43b.entry.js +0 -4
- package/dist/twilight/p-0fd7d436.entry.js +0 -4
- package/dist/twilight/p-1d21e83d.entry.js +0 -4
- package/dist/twilight/p-3d7a7be6.entry.js +0 -4
- package/dist/twilight/p-4dde6f7b.entry.js +0 -4
- package/dist/twilight/p-DWPgHXOD.js +0 -5
- package/dist/twilight/p-zvJtEDoB.js +0 -4
|
@@ -13,6 +13,8 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
13
13
|
this.__registerHost();
|
|
14
14
|
this.availableCoupons = [];
|
|
15
15
|
this.cartTotal = 0;
|
|
16
|
+
/** False until a sub_total is read from storage or the server — guards isEligible. */
|
|
17
|
+
this.cartTotalReady = false;
|
|
16
18
|
this.currentCoupon = '';
|
|
17
19
|
this.couponInputValue = '';
|
|
18
20
|
this.couponError = '';
|
|
@@ -31,7 +33,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
31
33
|
this.cartUpdatedHandler = (cartData) => {
|
|
32
34
|
// cart::updated carries the server-side cart. The multi-coupon flag comes from store
|
|
33
35
|
// config (set once in componentWillLoad), so only refresh total + chips here.
|
|
34
|
-
this.
|
|
36
|
+
this.syncCartTotal(cartData);
|
|
35
37
|
// Re-sync applied coupon state from the payload — mirroring refreshFromServer's guard:
|
|
36
38
|
// - Multi-coupon: only a real `coupons` array re-seeds the chips, so a summary-only
|
|
37
39
|
// cart::updated can't shrink them (add/remove refreshes the chips from the server).
|
|
@@ -158,14 +160,12 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
158
160
|
}
|
|
159
161
|
}
|
|
160
162
|
async loadCartTotal() {
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
163
|
+
// seedFromStorage() already gave the first paint an instant (possibly stale) total, so a
|
|
164
|
+
// minimum-amount coupon never flashes "غير متوافق". We STILL reconcile against the server
|
|
165
|
+
// here — for single- and multi-coupon alike — so a stale cached sub_total (cart changed in
|
|
166
|
+
// another tab or a server-side flow) can't keep a coupon wrongly (in)compatible until the
|
|
167
|
+
// next cart event. cart-coupons only mounts on the cart page, so this is one request per
|
|
168
|
+
// cart view, not a hot-path cost.
|
|
169
169
|
await this.refreshFromServer();
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
@@ -188,6 +188,22 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
188
188
|
if (stored && typeof stored === 'object' && 'coupon' in stored) {
|
|
189
189
|
this.applyCart(stored);
|
|
190
190
|
}
|
|
191
|
+
this.seedTotalsFromSummaryStorage();
|
|
192
|
+
}
|
|
193
|
+
/** SDK caches summary fields separately from the cart object (see cart.js updated()). */
|
|
194
|
+
seedTotalsFromSummaryStorage() {
|
|
195
|
+
const summary = salla.storage.get('cart.summary');
|
|
196
|
+
if (summary && typeof summary === 'object' && summary.sub_total != null) {
|
|
197
|
+
this.cartTotal = Number(summary.sub_total);
|
|
198
|
+
this.cartTotalReady = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
syncCartTotal(cart) {
|
|
202
|
+
const subTotal = cart?.summary?.sub_total ?? cart?.sub_total ?? cart?.total;
|
|
203
|
+
if (subTotal != null) {
|
|
204
|
+
this.cartTotal = Number(subTotal);
|
|
205
|
+
this.cartTotalReady = true;
|
|
206
|
+
}
|
|
191
207
|
}
|
|
192
208
|
/**
|
|
193
209
|
* Fetch the cart fresh from the server (salla.cart.details -> CartPresenter::forApi) and
|
|
@@ -212,10 +228,11 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
212
228
|
if (stored) {
|
|
213
229
|
this.applyCart(stored);
|
|
214
230
|
}
|
|
231
|
+
this.seedTotalsFromSummaryStorage();
|
|
215
232
|
}
|
|
216
233
|
/** Apply an authoritative cart object: total + applied chips (flag comes from store config). */
|
|
217
234
|
applyCart(cart) {
|
|
218
|
-
this.
|
|
235
|
+
this.syncCartTotal(cart);
|
|
219
236
|
this.syncAppliedFromCart(cart);
|
|
220
237
|
}
|
|
221
238
|
/**
|
|
@@ -398,10 +415,13 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
398
415
|
}
|
|
399
416
|
}
|
|
400
417
|
isEligible(coupon) {
|
|
401
|
-
|
|
402
|
-
|
|
418
|
+
// Until the cart sub_total is known, cartTotal is still the default 0 — treat the coupon as
|
|
419
|
+
// eligible so it doesn't flash "غير متوافق" on first paint and flip to compatible after the
|
|
420
|
+
// total loads (SP-21434).
|
|
421
|
+
if (!this.cartTotalReady || !coupon.minimum_amount) {
|
|
422
|
+
return true;
|
|
403
423
|
}
|
|
404
|
-
return
|
|
424
|
+
return this.cartTotal >= parseFloat(coupon.minimum_amount.amount);
|
|
405
425
|
}
|
|
406
426
|
renderCouponCard(coupon) {
|
|
407
427
|
const isEligible = this.isEligible(coupon);
|
|
@@ -411,7 +431,7 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
411
431
|
: `${salla.lang.get('pages.cart.expires_after')} ${coupon.remaining_days} ${salla.lang.get('pages.cart.day')}`)), coupon.minimum_amount && parseFloat(coupon.minimum_amount.amount) > 0 && (h("div", { class: "s-cart-coupons-minimum" }, salla.lang.get('pages.cart.minimum'), " ", h("span", { innerHTML: salla.money(coupon.minimum_amount.amount, coupon.minimum_amount.currency) })))), h("div", { class: "s-cart-coupons-action" }, isEligible ? salla.lang.get('pages.cart.save_coupon') : salla.lang.get('pages.cart.coupon_not_compatible'))))));
|
|
412
432
|
}
|
|
413
433
|
render() {
|
|
414
|
-
return (h(Host, { key: '
|
|
434
|
+
return (h(Host, { key: 'e3bed8f1f2019db5e1c5ca4280696933913e3081' }, h("div", { key: '9c6a7c383394f9bd19107db9b8e76fd9129648e3', class: "s-cart-coupons-wrapper" }, h("div", { key: '1e7f74969e709062c36aa19ff4ec27bde0bb10df', class: "s-cart-coupons-input-section" }, h("label", { key: 'f3bc1f4ffa9c8a64bee8af273597d6f8ff1f8fd0', htmlFor: "coupon-input", class: "s-cart-coupons-coupon-label" }, salla.lang.get('pages.cart.have_coupon')), h("div", { key: '7abbdbd41cf6e65b6c08928bb10a68bfb2677d85', class: "s-cart-coupons-coupon-input-container" }, this.multiCoupon ? [
|
|
415
435
|
// Multi-coupon: input stays active to append more codes; applied coupons render
|
|
416
436
|
// as removable chips below.
|
|
417
437
|
h("input", { type: "text", id: "coupon-input", name: "coupon", class: `form-input ${this.couponError ? 's-coupon-input-error' : ''}`, placeholder: salla.lang.get('pages.cart.coupon_placeholder'), value: this.couponInputValue, disabled: this.isApplying, onInput: this.onInput, onKeyUp: this.onKeyUp, "aria-label": salla.lang.get('pages.cart.apply_coupon'), key: "coupon-input" }),
|
|
@@ -422,13 +442,14 @@ const SallaCartCoupons$1 = /*@__PURE__*/ proxyCustomElement(class SallaCartCoupo
|
|
|
422
442
|
// a new code can only be entered after removing. Reuses the existing master classes.
|
|
423
443
|
h("input", { type: "text", id: "coupon-input", name: "coupon", class: `form-input ${this.couponError ? 's-coupon-input-error' : ''}`, placeholder: salla.lang.get('pages.cart.coupon_placeholder'), value: this.couponInputValue, disabled: !!this.currentCoupon || this.isApplying, onInput: this.onInput, onKeyUp: this.onKeyUp, "aria-label": salla.lang.get('pages.cart.apply_coupon'), key: "coupon-input" }),
|
|
424
444
|
h("salla-button", { ref: el => this.couponButtonRef = el, class: `s-cart-coupons-coupon-button ${this.currentCoupon ? 's-cart-coupons-coupon-button-remove' : 's-cart-coupons-coupon-button-apply'}`, color: this.currentCoupon ? 'danger' : 'primary', loading: this.isApplying, "loader-position": "center", onClick: () => this.handleCouponButtonClick(), key: "apply-button" }, this.currentCoupon ? (h("i", { class: "sicon-cancel" })) : (h("span", null, salla.lang.get('pages.cart.save_coupon')))),
|
|
425
|
-
]), this.couponError && (h("span", { key: '
|
|
445
|
+
]), this.couponError && (h("span", { key: '6c259fbca7a2a3c2ece3d4c335707c833be5f8d6', class: "s-cart-coupons-coupon-error" }, this.couponError)), this.multiCoupon && this.appliedCoupons.length > 0 && (h("div", { key: '87335fd875279e97fc7a02c9f3519af51a953a7b', class: "s-cart-coupons-applied-list" }, this.appliedCoupons.map(code => (h("div", { class: "s-cart-coupons-applied-item", key: code }, h("span", { class: "s-cart-coupons-applied-code" }, code), h("button", { type: "button", class: "s-cart-coupons-applied-remove", "aria-label": `${salla.lang.get('pages.cart.delete')} ${code}`, disabled: this.isApplying, onClick: () => this.removeCoupon(code) }, h("i", { class: "sicon-cancel" })))))))), this.availableCoupons && this.availableCoupons.length > 0 && (h("salla-slider", { key: '86c665d3135fa8bc393c4b7ad9daca3ce87bed50', type: "carousel", showControls: false, class: "s-cart-coupons-slider" }, h("div", { key: '45ddccd7e0c5d38e9b98f42862a6d64f6040c942', slot: "items" }, this.availableCoupons.map(coupon => this.renderCouponCard(coupon))))))));
|
|
426
446
|
}
|
|
427
447
|
get host() { return this; }
|
|
428
448
|
static get style() { return sallaCartCouponsCss; }
|
|
429
449
|
}, [0, "salla-cart-coupons", {
|
|
430
450
|
"availableCoupons": [32],
|
|
431
451
|
"cartTotal": [32],
|
|
452
|
+
"cartTotalReady": [32],
|
|
432
453
|
"currentCoupon": [32],
|
|
433
454
|
"couponInputValue": [32],
|
|
434
455
|
"couponError": [32],
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
5
|
import { d as defineCustomElement$1 } from './salla-rating-stars2.js';
|
|
6
6
|
|
|
7
|
-
const sallaCommentsCss = ":host{display:block}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-
|
|
7
|
+
const sallaCommentsCss = ":host{display:block}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-rating-stars-wrapper{gap:0 !important}";
|
|
8
8
|
|
|
9
9
|
const SallaCommentFactors = /*@__PURE__*/ proxyCustomElement(class SallaCommentFactors extends HTMLElement {
|
|
10
10
|
constructor() {
|
|
@@ -25,7 +25,7 @@ var ThumbsUp = `<!-- Generated by IcoMoon.io -->
|
|
|
25
25
|
</svg>
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
|
-
const sallaCommentsCss = ":host{display:block}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-
|
|
28
|
+
const sallaCommentsCss = ":host{display:block}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-rating-stars-wrapper{gap:0 !important}";
|
|
29
29
|
|
|
30
30
|
const SallaCommentItem = /*@__PURE__*/ proxyCustomElement(class SallaCommentItem extends HTMLElement {
|
|
31
31
|
constructor() {
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
5
5
|
import { a as anime } from './anime.es.js';
|
|
6
6
|
import { H as Helper } from './Helper.js';
|
|
7
|
-
import { d as defineCustomElement$
|
|
8
|
-
import { d as defineCustomElement$
|
|
9
|
-
import { d as defineCustomElement$
|
|
10
|
-
import { d as defineCustomElement$
|
|
11
|
-
import { d as defineCustomElement$
|
|
12
|
-
import { d as defineCustomElement$
|
|
13
|
-
import { d as defineCustomElement$
|
|
14
|
-
import { d as defineCustomElement$
|
|
7
|
+
import { d as defineCustomElement$d } from './salla-button2.js';
|
|
8
|
+
import { d as defineCustomElement$c } from './salla-comment-factors2.js';
|
|
9
|
+
import { d as defineCustomElement$b } from './salla-comment-form2.js';
|
|
10
|
+
import { d as defineCustomElement$a } from './salla-comment-item2.js';
|
|
11
|
+
import { d as defineCustomElement$9 } from './salla-loading2.js';
|
|
12
|
+
import { d as defineCustomElement$8 } from './salla-modal2.js';
|
|
13
|
+
import { d as defineCustomElement$7 } from './salla-progress-bar2.js';
|
|
14
|
+
import { d as defineCustomElement$6 } from './salla-rating-stars2.js';
|
|
15
|
+
import { d as defineCustomElement$5 } from './salla-review-factors-tags2.js';
|
|
15
16
|
import { d as defineCustomElement$4 } from './salla-reviews-summary2.js';
|
|
16
17
|
import { d as defineCustomElement$3 } from './salla-slider2.js';
|
|
17
18
|
import { d as defineCustomElement$2 } from './salla-tooltip2.js';
|
|
@@ -30,7 +31,7 @@ var ChatBubbles = `<!-- Generated by IcoMoon.io -->
|
|
|
30
31
|
</svg>
|
|
31
32
|
`;
|
|
32
33
|
|
|
33
|
-
const sallaCommentsCss = ":host{display:block}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-
|
|
34
|
+
const sallaCommentsCss = ":host{display:block}.s-comments-item-review-factors-toggle{display:inline-flex;align-items:center;gap:0.35rem;padding:0;border:0;background:transparent;color:#0f6a7c;font-size:0.9rem;font-weight:500;cursor:pointer}.s-comments-item-review-factors-chevron{line-height:1;transform:rotate(180deg);transition:transform 0.2s ease}.s-comments-item-review-factors-chevron.is-open{transform:rotate(0deg)}.s-comments-item-review-factors{border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);border-radius:0.6rem;width:min(100%, 26rem);max-width:100%;margin:0 0 1rem;padding:0.85rem 1rem}@media (max-width: 767px){.s-comments-item-review-factors{width:100%;padding:0.75rem}}.s-comments-item-review-factor-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;direction:ltr;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-row{flex-direction:row;align-items:stretch;gap:0.35rem}}.s-comments-item-review-factor-row+.s-comments-item-review-factor-row{margin-top:0.5rem}.s-comments-item-review-factor-label,.s-comments-item-review-factor-name{color:#4b5563;font-size:0.9rem;line-height:1.45}.s-comments-item-review-factor-name{min-width:6.5rem;text-align:end;flex-shrink:0}@media (max-width: 767px){.s-comments-item-review-factor-name{min-width:5rem;text-align:end}}.s-comments-item-review-factor-label{display:inline-block;min-width:4.75rem}@media (max-width: 767px){.s-comments-item-review-factor-label{min-width:0;flex:1 1 auto}}.s-comments-item-review-factor-value{display:inline-flex;align-items:center;gap:0.35rem;min-width:0}@media (max-width: 767px){.s-comments-item-review-factor-value{width:100%;justify-content:space-between;gap:0.25rem}}.s-rating-stars-wrapper{gap:0 !important}";
|
|
34
35
|
|
|
35
36
|
const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments extends HTMLElement {
|
|
36
37
|
constructor() {
|
|
@@ -55,7 +56,7 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
55
56
|
this.customerId = null;
|
|
56
57
|
// Translations
|
|
57
58
|
this.noComments = salla.lang.get('blocks.comments.no_comments');
|
|
58
|
-
this.comment_title =
|
|
59
|
+
this.comment_title = '';
|
|
59
60
|
this.comment_name = salla.lang.get('blocks.comments.comment');
|
|
60
61
|
this.showRatingSummary = salla.config.get('store.settings.rating.show_rating_summary');
|
|
61
62
|
this.allowLikes = salla.config.get('store.settings.rating.allow_likes');
|
|
@@ -64,7 +65,10 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
64
65
|
this.showRatingSummary = salla.config.get('store.settings.rating.show_rating_summary');
|
|
65
66
|
});
|
|
66
67
|
salla.lang.onLoaded(() => {
|
|
67
|
-
|
|
68
|
+
salla.lang.addBulk({
|
|
69
|
+
"blocks.comments.overall_rating": { ar: "التقييم العام", en: "Overall rating" }
|
|
70
|
+
});
|
|
71
|
+
this.comment_title = salla.lang.get('blocks.comments.overall_rating');
|
|
68
72
|
this.comment_name = salla.lang.get('blocks.comments.comment');
|
|
69
73
|
this.noComments = salla.lang.get('pages.rating.no_ratings');
|
|
70
74
|
const setNestedAsync = (lang, key, value) => {
|
|
@@ -77,7 +81,7 @@ const SallaComments$1 = /*@__PURE__*/ proxyCustomElement(class SallaComments ext
|
|
|
77
81
|
await setNestedAsync('ar.trans', 'blocks.comments.most_helpful', 'الأكثر إفادة');
|
|
78
82
|
await setNestedAsync('en.trans', 'blocks.comments.most_helpful', 'Most helpful');
|
|
79
83
|
this.mostHelpfulLabel = salla.lang.get('blocks.comments.most_helpful');
|
|
80
|
-
this.comment_title = salla.lang.get('blocks.comments.
|
|
84
|
+
this.comment_title = salla.lang.get('blocks.comments.overall_rating');
|
|
81
85
|
this.comment_name = salla.lang.get('blocks.comments.comment');
|
|
82
86
|
this.noComments = salla.lang.get('pages.rating.no_ratings');
|
|
83
87
|
};
|
|
@@ -363,7 +367,7 @@ function defineCustomElement$1() {
|
|
|
363
367
|
if (typeof customElements === "undefined") {
|
|
364
368
|
return;
|
|
365
369
|
}
|
|
366
|
-
const components = ["salla-comments", "salla-button", "salla-comment-factors", "salla-comment-form", "salla-comment-item", "salla-loading", "salla-modal", "salla-progress-bar", "salla-rating-stars", "salla-reviews-summary", "salla-slider", "salla-tooltip"];
|
|
370
|
+
const components = ["salla-comments", "salla-button", "salla-comment-factors", "salla-comment-form", "salla-comment-item", "salla-loading", "salla-modal", "salla-progress-bar", "salla-rating-stars", "salla-review-factors-tags", "salla-reviews-summary", "salla-slider", "salla-tooltip"];
|
|
367
371
|
components.forEach(tagName => { switch (tagName) {
|
|
368
372
|
case "salla-comments":
|
|
369
373
|
if (!customElements.get(tagName)) {
|
|
@@ -372,40 +376,45 @@ function defineCustomElement$1() {
|
|
|
372
376
|
break;
|
|
373
377
|
case "salla-button":
|
|
374
378
|
if (!customElements.get(tagName)) {
|
|
375
|
-
defineCustomElement$
|
|
379
|
+
defineCustomElement$d();
|
|
376
380
|
}
|
|
377
381
|
break;
|
|
378
382
|
case "salla-comment-factors":
|
|
379
383
|
if (!customElements.get(tagName)) {
|
|
380
|
-
defineCustomElement$
|
|
384
|
+
defineCustomElement$c();
|
|
381
385
|
}
|
|
382
386
|
break;
|
|
383
387
|
case "salla-comment-form":
|
|
384
388
|
if (!customElements.get(tagName)) {
|
|
385
|
-
defineCustomElement$
|
|
389
|
+
defineCustomElement$b();
|
|
386
390
|
}
|
|
387
391
|
break;
|
|
388
392
|
case "salla-comment-item":
|
|
389
393
|
if (!customElements.get(tagName)) {
|
|
390
|
-
defineCustomElement$
|
|
394
|
+
defineCustomElement$a();
|
|
391
395
|
}
|
|
392
396
|
break;
|
|
393
397
|
case "salla-loading":
|
|
394
398
|
if (!customElements.get(tagName)) {
|
|
395
|
-
defineCustomElement$
|
|
399
|
+
defineCustomElement$9();
|
|
396
400
|
}
|
|
397
401
|
break;
|
|
398
402
|
case "salla-modal":
|
|
399
403
|
if (!customElements.get(tagName)) {
|
|
400
|
-
defineCustomElement$
|
|
404
|
+
defineCustomElement$8();
|
|
401
405
|
}
|
|
402
406
|
break;
|
|
403
407
|
case "salla-progress-bar":
|
|
404
408
|
if (!customElements.get(tagName)) {
|
|
405
|
-
defineCustomElement$
|
|
409
|
+
defineCustomElement$7();
|
|
406
410
|
}
|
|
407
411
|
break;
|
|
408
412
|
case "salla-rating-stars":
|
|
413
|
+
if (!customElements.get(tagName)) {
|
|
414
|
+
defineCustomElement$6();
|
|
415
|
+
}
|
|
416
|
+
break;
|
|
417
|
+
case "salla-review-factors-tags":
|
|
409
418
|
if (!customElements.get(tagName)) {
|
|
410
419
|
defineCustomElement$5();
|
|
411
420
|
}
|
|
@@ -1085,12 +1085,35 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
|
|
|
1085
1085
|
this.infiniteScroll.option({ scrollThreshold: false, loadOnScroll: false });
|
|
1086
1086
|
this.status.querySelector('.s-infinite-scroll-last').classList.remove('s-hidden');
|
|
1087
1087
|
}
|
|
1088
|
+
let items = await this.applyBeforeAppendItems(response.data);
|
|
1088
1089
|
const productCardsView = [];
|
|
1089
|
-
for (let i = 0; i <
|
|
1090
|
-
productCardsView.push(this.getItemHTML(
|
|
1090
|
+
for (let i = 0; i < items.length; i++) {
|
|
1091
|
+
productCardsView.push(this.getItemHTML(items[i]));
|
|
1091
1092
|
}
|
|
1092
1093
|
return productCardsView;
|
|
1093
1094
|
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Allows bundles to modify or replace products before they are appended.
|
|
1097
|
+
*
|
|
1098
|
+
* @example
|
|
1099
|
+
* salla.hooks.registerHook(
|
|
1100
|
+
* 'salla-products-list',
|
|
1101
|
+
* 'beforeAppendItems',
|
|
1102
|
+
* async (ctx) => {
|
|
1103
|
+
* ctx.items = ctx.items.filter((item) => item.is_available);
|
|
1104
|
+
* },
|
|
1105
|
+
* );
|
|
1106
|
+
*/
|
|
1107
|
+
async applyBeforeAppendItems(items) {
|
|
1108
|
+
const ctx = { component: this, items };
|
|
1109
|
+
try {
|
|
1110
|
+
await salla.hooks.call('salla-products-list', 'beforeAppendItems', ctx);
|
|
1111
|
+
return Array.isArray(ctx.items) ? ctx.items : items;
|
|
1112
|
+
}
|
|
1113
|
+
catch {
|
|
1114
|
+
return items;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1094
1117
|
get host() { return this; }
|
|
1095
1118
|
static get watchers() { return {
|
|
1096
1119
|
"selectable": ["onSelectableChanged"]
|
|
@@ -44,7 +44,7 @@ const SallaProductsSlider = /*@__PURE__*/ proxyCustomElement(class SallaProducts
|
|
|
44
44
|
}
|
|
45
45
|
componentWillLoad() {
|
|
46
46
|
return salla.onReady()
|
|
47
|
-
.then(() => {
|
|
47
|
+
.then(async () => {
|
|
48
48
|
//TODO:: check why `this.includes` not working!!
|
|
49
49
|
this.includes = Helper.parseJson(this.includes || this.host.getAttribute('includes'));
|
|
50
50
|
if (!Array.isArray(this.includes)) {
|
|
@@ -58,7 +58,7 @@ const SallaProductsSlider = /*@__PURE__*/ proxyCustomElement(class SallaProducts
|
|
|
58
58
|
}
|
|
59
59
|
this.hasCustomComponent = !!customElements.get(this.productCardComponent);
|
|
60
60
|
if (this.source === 'json') {
|
|
61
|
-
this.productsData = this.getSourceValue();
|
|
61
|
+
this.productsData = await this.applyBeforeAppendItems(this.getSourceValue());
|
|
62
62
|
this.isReady = true;
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
@@ -66,18 +66,25 @@ const SallaProductsSlider = /*@__PURE__*/ proxyCustomElement(class SallaProducts
|
|
|
66
66
|
this.isReady = false;
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
+
if (this.getSource() === 'related' &&
|
|
70
|
+
salla.config.get('store.settings.product.related_products_enabled') &&
|
|
71
|
+
salla.config.get('store.settings.product.product-recommendation-type') === 'random' &&
|
|
72
|
+
salla.config.get('store.features')?.includes('ai-driven-personalized-product')) {
|
|
73
|
+
this.sourceValue = await salla.recommendations.similarProducts(this.sourceValue, { limit: this.limit || 12 }).extractProductIds();
|
|
74
|
+
this.source = 'selected';
|
|
75
|
+
}
|
|
69
76
|
return salla.api.withoutNotifier(() => salla.product.api.fetch({
|
|
70
77
|
source: Helper.getApiSource(this.getSource()),
|
|
71
78
|
source_value: this.getSourceValue(),
|
|
72
79
|
limit: this.limit
|
|
73
80
|
}))
|
|
74
81
|
.then(response => Helper.injectExtraFieldsToResponse(response))
|
|
75
|
-
.then(response => {
|
|
76
|
-
this.productsData = response.data;
|
|
82
|
+
.then(async (response) => {
|
|
83
|
+
this.productsData = await this.applyBeforeAppendItems(response.data);
|
|
77
84
|
this.isReady = true;
|
|
78
85
|
response.source = this.getSource();
|
|
79
86
|
response.sourceValue = this.getSourceValue();
|
|
80
|
-
salla.event.emit('salla-products-slider::products.fetched',
|
|
87
|
+
salla.event.emit('salla-products-slider::products.fetched', this.productsData);
|
|
81
88
|
});
|
|
82
89
|
});
|
|
83
90
|
}
|
|
@@ -137,6 +144,29 @@ const SallaProductsSlider = /*@__PURE__*/ proxyCustomElement(class SallaProducts
|
|
|
137
144
|
getSourceValue() {
|
|
138
145
|
return Helper.getProductsSourceValue(this.source, this.sourceValue);
|
|
139
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Allows bundles to modify or replace products before they are rendered.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* salla.hooks.registerHook(
|
|
152
|
+
* 'salla-products-slider',
|
|
153
|
+
* 'beforeAppendItems',
|
|
154
|
+
* async (ctx) => {
|
|
155
|
+
* ctx.items = ctx.items.filter((item) => item.is_available);
|
|
156
|
+
* },
|
|
157
|
+
* );
|
|
158
|
+
*/
|
|
159
|
+
async applyBeforeAppendItems(items) {
|
|
160
|
+
const originalItems = Array.isArray(items) ? items : [];
|
|
161
|
+
const ctx = { component: this, items: originalItems };
|
|
162
|
+
try {
|
|
163
|
+
await salla.hooks.call('salla-products-slider', 'beforeAppendItems', ctx);
|
|
164
|
+
return Array.isArray(ctx.items) ? ctx.items : originalItems;
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return originalItems;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
140
170
|
render() {
|
|
141
171
|
if (!this.canRender()) {
|
|
142
172
|
return;
|
|
@@ -1,147 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { R as Rate } from './star2.js';
|
|
6
|
-
|
|
7
|
-
const CACHE_TTL = 5 * 60 * 1000;
|
|
8
|
-
const orderCache = new Map();
|
|
9
|
-
const inFlightRequests = new Map();
|
|
10
|
-
function normalizeList(value) {
|
|
11
|
-
if (!value) {
|
|
12
|
-
return [];
|
|
13
|
-
}
|
|
14
|
-
return Array.isArray(value) ? value : Object.values(value);
|
|
15
|
-
}
|
|
16
|
-
function getProductRatings(rating) {
|
|
17
|
-
if (!rating) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
return [
|
|
21
|
-
...normalizeList(rating.product),
|
|
22
|
-
...normalizeList(rating.products),
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
function extractFactors(source) {
|
|
26
|
-
if (!source) {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
for (const key of ['factor_reviews', 'review_factors', 'factors']) {
|
|
30
|
-
const value = source[key];
|
|
31
|
-
if (Array.isArray(value) && value.length) {
|
|
32
|
-
return value;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return [];
|
|
36
|
-
}
|
|
37
|
-
function findProductRating(productRatings, ratingId, productId, itemId) {
|
|
38
|
-
return productRatings.find((productRating) => {
|
|
39
|
-
if (ratingId && Number(productRating.id ?? productRating.feedback_id) === Number(ratingId)) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
if (itemId && Number(productRating.order_item_id) === Number(itemId)) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
if (productId && Number(productRating.product_id ?? productRating.product?.id) === Number(productId)) {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function resolveReviewFactors(order, ratingId, productId, itemId) {
|
|
52
|
-
const productRatings = getProductRatings(order?.rating);
|
|
53
|
-
const productRating = findProductRating(productRatings, ratingId, productId, itemId);
|
|
54
|
-
return extractFactors(productRating);
|
|
55
|
-
}
|
|
56
|
-
async function fetchOrder(orderId) {
|
|
57
|
-
if (!orderId) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
const cached = orderCache.get(orderId);
|
|
61
|
-
if (cached && Date.now() - cached.timestamp <= CACHE_TTL) {
|
|
62
|
-
return cached.data;
|
|
63
|
-
}
|
|
64
|
-
const pending = inFlightRequests.get(orderId);
|
|
65
|
-
if (pending) {
|
|
66
|
-
return pending;
|
|
67
|
-
}
|
|
68
|
-
const request = (async () => {
|
|
69
|
-
try {
|
|
70
|
-
const response = await salla.api.request(`orders/${orderId}`, '', 'get');
|
|
71
|
-
const data = response?.data ?? response;
|
|
72
|
-
orderCache.set(orderId, { data, timestamp: Date.now() });
|
|
73
|
-
return data;
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
orderCache.delete(orderId);
|
|
77
|
-
throw error;
|
|
78
|
-
}
|
|
79
|
-
finally {
|
|
80
|
-
inFlightRequests.delete(orderId);
|
|
81
|
-
}
|
|
82
|
-
})();
|
|
83
|
-
inFlightRequests.set(orderId, request);
|
|
84
|
-
return request;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const sallaReviewFactorsTagsCss = ":host{display:inline-flex}.s-review-factors-tags-factors{display:flex;flex-wrap:wrap;gap:0.5rem;justify-content:flex-start;margin-bottom:0.6rem}.s-review-factors-tags-factor-tag{display:inline-flex;align-items:center;gap:0.25rem;border-radius:999px;border:1px solid #e8e8e8;background:rgba(255, 255, 255, 0.3);color:#374151;font-size:0.85rem;line-height:1;padding:0.4rem 0.65rem}.s-review-factors-tags-factor-rating{font-weight:600;color:#0f6a7c}.s-review-factors-tags-factor-star{display:inline-flex;width:0.8rem;height:0.8rem;fill:#0f6a7c}.s-review-factors-tags-factor-star svg{width:100%;height:100%}";
|
|
88
|
-
|
|
89
|
-
const SallaReviewFactorsTags$1 = /*@__PURE__*/ proxyCustomElement(class SallaReviewFactorsTags extends HTMLElement {
|
|
90
|
-
constructor() {
|
|
91
|
-
super();
|
|
92
|
-
this.__registerHost();
|
|
93
|
-
this.factors = [];
|
|
94
|
-
}
|
|
95
|
-
async componentWillLoad() {
|
|
96
|
-
await salla.onReady();
|
|
97
|
-
await this.loadFactors();
|
|
98
|
-
}
|
|
99
|
-
async loadFactors() {
|
|
100
|
-
if (!this.orderId) {
|
|
101
|
-
this.factors = [];
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
const order = await fetchOrder(this.orderId);
|
|
106
|
-
this.factors = resolveReviewFactors(order, this.ratingId, this.productId, this.itemId);
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
console.error('[salla-review-factors-tags] failed to load order rating factors', error);
|
|
110
|
-
this.factors = [];
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
renderFactorTags() {
|
|
114
|
-
const factors = this.factors || [];
|
|
115
|
-
if (!factors.length) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
return (h("div", { class: "s-review-factors-tags-factors" }, factors.map(factor => (h("div", { class: "s-review-factors-tags-factor-tag" }, h("span", { class: "s-review-factors-tags-factor-name" }, factor.name), h("span", { class: "s-review-factors-tags-factor-star", innerHTML: Rate }), h("span", { class: "s-review-factors-tags-factor-rating" }, factor.rating || ''))))));
|
|
119
|
-
}
|
|
120
|
-
render() {
|
|
121
|
-
return (h(Host, { key: '63e1ae3d8b45cdd9c82ade65cf6b33be9941f9d1', class: "s-review-factors-tags-wrapper" }, this.renderFactorTags()));
|
|
122
|
-
}
|
|
123
|
-
static get style() { return sallaReviewFactorsTagsCss; }
|
|
124
|
-
}, [0, "salla-review-factors-tags", {
|
|
125
|
-
"orderId": [2, "order-id"],
|
|
126
|
-
"ratingId": [2, "rating-id"],
|
|
127
|
-
"productId": [2, "product-id"],
|
|
128
|
-
"itemId": [2, "item-id"],
|
|
129
|
-
"factors": [32]
|
|
130
|
-
}]);
|
|
131
|
-
function defineCustomElement$1() {
|
|
132
|
-
if (typeof customElements === "undefined") {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const components = ["salla-review-factors-tags"];
|
|
136
|
-
components.forEach(tagName => { switch (tagName) {
|
|
137
|
-
case "salla-review-factors-tags":
|
|
138
|
-
if (!customElements.get(tagName)) {
|
|
139
|
-
customElements.define(tagName, SallaReviewFactorsTags$1);
|
|
140
|
-
}
|
|
141
|
-
break;
|
|
142
|
-
} });
|
|
143
|
-
}
|
|
144
|
-
defineCustomElement$1();
|
|
4
|
+
import { S as SallaReviewFactorsTags$1, d as defineCustomElement$1 } from './salla-review-factors-tags2.js';
|
|
145
5
|
|
|
146
6
|
const SallaReviewFactorsTags = SallaReviewFactorsTags$1;
|
|
147
7
|
const defineCustomElement = defineCustomElement$1;
|