@salla.sa/twilight-components 2.14.546 → 2.14.548
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-CbpPZZga.js → filepond-CGA4aTUA.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-BmWPw2D9.js → filepond-plugin-file-poster-DyVz7vP9.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-De7XZguT.js → filepond-plugin-file-validate-size-CgzYDBcU.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BHdxCuXU.js → filepond-plugin-file-validate-type-Dx2CbMZ9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DJZbgt5_.js → filepond-plugin-image-edit-D3aTsFmD.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BtLJO8iG.js → filepond-plugin-image-exif-orientation-BW3usWts.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-BRUyTRh3.js → filepond-plugin-image-preview-Bb7_UNPY.js} +1 -1
- package/dist/cjs/{index-EoqYCrI-.js → index-BssNhL-x.js} +30 -26
- package/dist/cjs/{intlTelInput-CxKIlDCD.js → intlTelInput-B7QYiZ0d.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mail-C9D8MHae.js → mail-CO8cFZH7.js} +2 -2
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-accordion_6.cjs.entry.js +12 -5
- 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-attachment-view_9.cjs.entry.js +10 -10
- package/dist/cjs/salla-badge.cjs.entry.js +1 -1
- package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
- package/dist/cjs/salla-bullet-delivery_2.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_8.cjs.entry.js → salla-comment-form_9.cjs.entry.js} +264 -4
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +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_10.cjs.entry.js +3 -3
- 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_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_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_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-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 +3 -3
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +208 -103
- package/dist/cjs/salla-rating-modal.cjs.entry.js +23 -8
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
- package/dist/cjs/salla-search.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 +4 -4
- 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 +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/cjs/{vanilla-picker-ClshNzKX.js → vanilla-picker-H1di5S1s.js} +1 -1
- package/dist/collection/collection-manifest.json +14 -12
- package/dist/collection/components/salla-comments/interfaces.js +12 -0
- package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
- package/dist/collection/components/salla-comments/salla-comments.js +42 -5
- package/dist/collection/components/salla-modal/salla-modal.css +11 -0
- package/dist/collection/components/salla-modal/salla-modal.js +33 -6
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +253 -104
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +34 -21
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +69 -10
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +5 -0
- package/dist/collection/components/salla-verified-review/salla-verified-review.css +162 -0
- package/dist/collection/components/salla-verified-review/salla-verified-review.js +264 -0
- package/dist/components/index.js +18 -14
- package/dist/components/salla-comment-item2.js +1 -1
- package/dist/components/salla-comments.js +44 -1
- package/dist/components/salla-modal2.js +12 -4
- package/dist/components/salla-rating-modal-v22.js +208 -101
- package/dist/components/salla-rating-modal.js +1 -591
- package/dist/components/salla-rating-modal2.js +613 -0
- package/dist/components/salla-rating-stars2.js +1 -1
- package/dist/components/salla-verified-review.d.ts +11 -0
- package/dist/components/salla-verified-review.js +325 -0
- package/dist/esm/{filepond-CF5m44bJ.js → filepond-CXmbiROU.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CcB1Ah8E.js → filepond-plugin-file-poster-DrmkMK37.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BwVhV38u.js → filepond-plugin-file-validate-size-fRXLDtKY.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-GBCLCzPk.js → filepond-plugin-file-validate-type-9x4CtZKy.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-CrBe3Dh3.js → filepond-plugin-image-edit-BTjvSjn9.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-C2Cj5Jrc.js → filepond-plugin-image-exif-orientation-CnSOx2Lm.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-YVKQw3-Q.js → filepond-plugin-image-preview-Cy0Nd8Xr.js} +1 -1
- package/dist/esm/{index-FwRU05yW.js → index-B64o_70M.js} +30 -26
- package/dist/esm/{intlTelInput-B1_kbUW3.js → intlTelInput-FF2eKbuC.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mail-DzAIgzdz.js → mail-DmgxDvXL.js} +2 -2
- package/dist/esm/salla-accordion-body_2.entry.js +1 -1
- package/dist/esm/salla-accordion_6.entry.js +12 -5
- 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-attachment-view_9.entry.js +10 -10
- package/dist/esm/salla-badge.entry.js +1 -1
- package/dist/esm/salla-basket-gap.entry.js +1 -1
- package/dist/esm/salla-bullet-delivery_2.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_8.entry.js → salla-comment-form_9.entry.js} +264 -5
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +3 -3
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +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_10.entry.js +3 -3
- 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_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_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_2.entry.js +1 -1
- package/dist/esm/salla-order-shipments.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-placeholder.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-card-embed.entry.js +1 -1
- package/dist/esm/salla-product-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 +3 -3
- package/dist/esm/salla-rating-modal-v2.entry.js +208 -103
- package/dist/esm/salla-rating-modal.entry.js +23 -8
- package/dist/esm/salla-review-factors-tags.entry.js +1 -1
- package/dist/esm/salla-review-order-item.entry.js +1 -1
- package/dist/esm/salla-scopes.entry.js +1 -1
- package/dist/esm/salla-search.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 +4 -4
- 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 +3 -3
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/salla-wishlist-actions.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/esm/{vanilla-picker-oTEQUNmA.js → vanilla-picker-DMNociUd.js} +1 -1
- package/dist/twilight/{p-74bee051.entry.js → p-003648b5.entry.js} +1 -1
- package/dist/twilight/{p-52f4642b.entry.js → p-04cc5898.entry.js} +1 -1
- package/dist/twilight/{p-BcYofOgx.js → p-0MyCcOKI.js} +1 -1
- package/dist/twilight/{p-71ff2062.entry.js → p-0c7bdda5.entry.js} +1 -1
- package/dist/twilight/{p-b389fa5c.entry.js → p-0dfd760b.entry.js} +1 -1
- package/dist/twilight/{p-904ca909.entry.js → p-13978ff2.entry.js} +1 -1
- package/dist/twilight/{p-d11f2263.entry.js → p-1485dedd.entry.js} +1 -1
- package/dist/twilight/{p-c4be5709.entry.js → p-1628c63c.entry.js} +1 -1
- package/dist/twilight/{p-a7346ee5.entry.js → p-177e9071.entry.js} +1 -1
- package/dist/twilight/{p-e7819b7b.entry.js → p-19b03612.entry.js} +1 -1
- package/dist/twilight/{p-df48abfb.entry.js → p-1ad71324.entry.js} +1 -1
- package/dist/twilight/{p-2dd4ddc7.entry.js → p-1ce848ab.entry.js} +1 -1
- package/dist/twilight/{p-3250ee03.entry.js → p-1edbb249.entry.js} +1 -1
- package/dist/twilight/{p-ceceeaed.entry.js → p-233b9115.entry.js} +1 -1
- package/dist/twilight/{p-a3897cf4.entry.js → p-26c750c8.entry.js} +1 -1
- package/dist/twilight/p-2ddabee9.entry.js +4 -0
- package/dist/twilight/{p-b95b3bf0.entry.js → p-2f64c3b3.entry.js} +1 -1
- package/dist/twilight/{p-682f00d1.entry.js → p-309f771b.entry.js} +1 -1
- package/dist/twilight/{p-5df95bdb.entry.js → p-37b73a97.entry.js} +1 -1
- package/dist/twilight/{p-f55eb61c.entry.js → p-3b7cbf05.entry.js} +1 -1
- package/dist/twilight/{p-1286f679.entry.js → p-3eb853f9.entry.js} +1 -1
- package/dist/twilight/{p-5cfc9f8c.entry.js → p-3f460184.entry.js} +1 -1
- package/dist/twilight/{p-e71c064e.entry.js → p-40d4ccbb.entry.js} +1 -1
- package/dist/twilight/{p-34f38efd.entry.js → p-440687a4.entry.js} +1 -1
- package/dist/twilight/{p-d8313f41.entry.js → p-441ee14a.entry.js} +1 -1
- package/dist/twilight/{p-06335f34.entry.js → p-49c7dc56.entry.js} +1 -1
- package/dist/twilight/{p-e7a672b4.entry.js → p-522fb030.entry.js} +1 -1
- package/dist/twilight/{p-b9634ee2.entry.js → p-52607d64.entry.js} +1 -1
- package/dist/twilight/{p-49117243.entry.js → p-5273dbb2.entry.js} +1 -1
- package/dist/twilight/{p-981da139.entry.js → p-55cbacd7.entry.js} +1 -1
- package/dist/twilight/{p-b0730cef.entry.js → p-569ad58b.entry.js} +1 -1
- package/dist/twilight/{p-ad30742f.entry.js → p-56e553e4.entry.js} +1 -1
- package/dist/twilight/p-5ab11313.entry.js +4 -0
- package/dist/twilight/{p-c078fb93.entry.js → p-5c9e4502.entry.js} +1 -1
- package/dist/twilight/{p-13fc84ad.entry.js → p-5f860460.entry.js} +1 -1
- package/dist/twilight/{p-7fafe29c.entry.js → p-5f9b8ada.entry.js} +1 -1
- package/dist/twilight/{p-f7b8430f.entry.js → p-602e632c.entry.js} +1 -1
- package/dist/twilight/{p-d550f1f9.entry.js → p-63a2ee05.entry.js} +1 -1
- package/dist/twilight/{p-26ae2623.entry.js → p-63acbca7.entry.js} +1 -1
- package/dist/twilight/{p-158e1872.entry.js → p-63cebaef.entry.js} +1 -1
- package/dist/twilight/{p-51add824.entry.js → p-6451e759.entry.js} +1 -1
- package/dist/twilight/{p-767d37bb.entry.js → p-647832d9.entry.js} +1 -1
- package/dist/twilight/{p-d76abd6d.entry.js → p-660a552a.entry.js} +1 -1
- package/dist/twilight/{p-6081d494.entry.js → p-66ece3d6.entry.js} +1 -1
- package/dist/twilight/{p-92175855.entry.js → p-6cd863b9.entry.js} +1 -1
- package/dist/twilight/{p-ada73e68.entry.js → p-74a1a32f.entry.js} +1 -1
- package/dist/twilight/{p-1a7b7e21.entry.js → p-74c7cc02.entry.js} +1 -1
- package/dist/twilight/{p-53184934.entry.js → p-77fa0f9f.entry.js} +1 -1
- package/dist/twilight/{p-d295757a.entry.js → p-7c2a0a8b.entry.js} +1 -1
- package/dist/twilight/{p-662a5816.entry.js → p-7ce5c2cd.entry.js} +1 -1
- package/dist/twilight/{p-dfdf96be.entry.js → p-7eca6506.entry.js} +1 -1
- package/dist/twilight/{p-b7ae6c1c.entry.js → p-840dd411.entry.js} +1 -1
- package/dist/twilight/{p-eeb89f05.entry.js → p-87227eb2.entry.js} +1 -1
- package/dist/twilight/{p-79e3d1dd.entry.js → p-897b8824.entry.js} +1 -1
- package/dist/twilight/{p-bc98ccad.entry.js → p-8e293878.entry.js} +1 -1
- package/dist/twilight/{p-87ba263e.entry.js → p-8e631629.entry.js} +1 -1
- package/dist/twilight/{p-b98fb8ae.entry.js → p-923a35da.entry.js} +1 -1
- package/dist/twilight/{p-c3208f6d.entry.js → p-971b8ff5.entry.js} +1 -1
- package/dist/twilight/p-991fa4ad.entry.js +4 -0
- package/dist/twilight/{p-cac60dea.entry.js → p-9a617c41.entry.js} +1 -1
- package/dist/twilight/{p-298b9d8a.entry.js → p-9ae25175.entry.js} +1 -1
- package/dist/twilight/{p-682dc578.entry.js → p-9dbf3ff4.entry.js} +1 -1
- package/dist/twilight/p-B64o_70M.js +5 -0
- package/dist/twilight/{p-DyxHX342.js → p-BK166pHQ.js} +1 -1
- package/dist/twilight/{p-j-4Intu2.js → p-BcGXp0zm.js} +1 -1
- package/dist/twilight/{p-B9dZFOmF.js → p-Bh11vKua.js} +1 -1
- package/dist/twilight/{p-qzPm0si4.js → p-DBnECOny.js} +2 -2
- package/dist/twilight/{p-BxHJHdpj.js → p-DWqu98fW.js} +1 -1
- package/dist/twilight/{p-DzAIgzdz.js → p-DmgxDvXL.js} +1 -1
- package/dist/twilight/{p-CiKg2aqy.js → p-DrJZdc5M.js} +1 -1
- package/dist/twilight/{p-CCPvqpeZ.js → p-GwasjFLA.js} +1 -1
- package/dist/twilight/{p-BLBFg-He.js → p-UxfFm_QX.js} +1 -1
- package/dist/twilight/{p-df069a34.entry.js → p-a0e8ca67.entry.js} +1 -1
- package/dist/twilight/{p-176b9746.entry.js → p-a5199e7d.entry.js} +1 -1
- package/dist/twilight/{p-61953ae7.entry.js → p-a7fccb9c.entry.js} +1 -1
- package/dist/twilight/{p-ae8cbf4f.entry.js → p-a867beee.entry.js} +1 -1
- package/dist/twilight/{p-65be2237.entry.js → p-ace041b9.entry.js} +1 -1
- package/dist/twilight/{p-f6493289.entry.js → p-b0500232.entry.js} +1 -1
- package/dist/twilight/{p-3446e76a.entry.js → p-b0a87a8d.entry.js} +1 -1
- package/dist/twilight/{p-55aa8c39.entry.js → p-b16264a3.entry.js} +1 -1
- package/dist/twilight/{p-718a5f9b.entry.js → p-b17c6f84.entry.js} +1 -1
- package/dist/twilight/{p-75de4995.entry.js → p-b4d47e7c.entry.js} +1 -1
- package/dist/twilight/{p-f63aecb0.entry.js → p-b4f2f280.entry.js} +1 -1
- package/dist/twilight/{p-179625fd.entry.js → p-b4fda5f4.entry.js} +1 -1
- package/dist/twilight/{p-f15f6265.entry.js → p-b8cd26a7.entry.js} +1 -1
- package/dist/twilight/{p-736e9843.entry.js → p-ba32a9d2.entry.js} +1 -1
- package/dist/twilight/{p-61ae00d6.entry.js → p-be916b5f.entry.js} +1 -1
- package/dist/twilight/{p-e2df9129.entry.js → p-c26f1183.entry.js} +1 -1
- package/dist/twilight/{p-7df2c1d5.entry.js → p-c5d1b2e4.entry.js} +1 -1
- package/dist/twilight/{p-bcf3d118.entry.js → p-c8dae54b.entry.js} +1 -1
- package/dist/twilight/{p-0fc9be21.entry.js → p-c9b1ad01.entry.js} +1 -1
- package/dist/twilight/{p-72dba918.entry.js → p-cacf3c75.entry.js} +1 -1
- package/dist/twilight/{p-2862c6bb.entry.js → p-cb02e6db.entry.js} +1 -1
- package/dist/twilight/{p-a32bad0b.entry.js → p-d0847af9.entry.js} +1 -1
- package/dist/twilight/{p-01e01e63.entry.js → p-d7e4f0f8.entry.js} +1 -1
- package/dist/twilight/{p-c2980ef7.entry.js → p-db4dc7cc.entry.js} +1 -1
- package/dist/twilight/{p-a91c674c.entry.js → p-e0f3e985.entry.js} +1 -1
- package/dist/twilight/{p-2dfd3810.entry.js → p-e354292f.entry.js} +1 -1
- package/dist/twilight/{p-110bd105.entry.js → p-e4db462b.entry.js} +1 -1
- package/dist/twilight/{p-2f6ba6f1.entry.js → p-e826d3aa.entry.js} +1 -1
- package/dist/twilight/{p-cb737c93.entry.js → p-f12f8db3.entry.js} +1 -1
- package/dist/twilight/{p-e73bab6b.entry.js → p-f99550d8.entry.js} +1 -1
- package/dist/twilight/{p-46d047ac.entry.js → p-fa0467a7.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-comments/interfaces.d.ts +15 -0
- package/dist/types/components/salla-comments/salla-comments.d.ts +5 -2
- package/dist/types/components/salla-modal/salla-modal.d.ts +7 -2
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +20 -5
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +10 -2
- package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +51 -0
- package/dist/types/components.d.ts +59 -16
- package/package.json +5 -5
- package/dist/twilight/p-96826106.entry.js +0 -4
- package/dist/twilight/p-FwRU05yW.js +0 -5
- package/dist/twilight/p-cc8209fc.entry.js +0 -4
- package/dist/twilight/p-dcf9417c.entry.js +0 -4
|
@@ -11,6 +11,7 @@ import WhatsappIcon from "../../assets/svg/whatsapp2.svg";
|
|
|
11
11
|
import MailIcon from "../../assets/svg/mail.svg";
|
|
12
12
|
import { buildMediaUploadAccept } from "../salla-file-upload/upload-limits";
|
|
13
13
|
import { MAX_IMAGE_UPLOAD_LIMIT, MAX_PARALLEL_UPLOADS, MAX_VIDEO_DURATION, MAX_VIDEO_FILE_SIZE, MAX_VIDEO_UPLOAD_LIMIT, countMediaByType, createPreloadedMediaItem, getMediaUrlsByType, isVideoUrl, normalizeSubmittedMedia, parseMediaField, removeUploadedImage, splitMediaUrls, syncHiddenMediaInputs, } from "./rating-modal-media";
|
|
14
|
+
const MODAL_WIDTH = '600px';
|
|
14
15
|
export class SallaRatingModalV2 {
|
|
15
16
|
constructor() {
|
|
16
17
|
this.hasError = false;
|
|
@@ -50,7 +51,7 @@ export class SallaRatingModalV2 {
|
|
|
50
51
|
this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
|
|
51
52
|
this.contactUsLabel = salla.lang.get('blocks.footer.social');
|
|
52
53
|
this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
|
|
53
|
-
this.
|
|
54
|
+
this.rateTheFollowingLabel = salla.lang.get('pages.rating.rate_the_following_factors');
|
|
54
55
|
this.loyaltyPointsForImagesLabel = salla.lang.get('pages.rating.loyalty_points_for_images', {
|
|
55
56
|
points: ':points',
|
|
56
57
|
});
|
|
@@ -70,83 +71,12 @@ export class SallaRatingModalV2 {
|
|
|
70
71
|
this.MAX_VIDEO_DURATION = MAX_VIDEO_DURATION;
|
|
71
72
|
this.MAX_PARALLEL_UPLOADS = MAX_PARALLEL_UPLOADS;
|
|
72
73
|
this.scheduleWizardSetup = false;
|
|
73
|
-
salla.lang.onLoaded(() => {
|
|
74
|
-
this.contactUsLabel = salla.lang.get('blocks.footer.social');
|
|
75
|
-
const setNestedAsync = (lang, key, value) => {
|
|
76
|
-
return new Promise(resolve => {
|
|
77
|
-
salla.helpers.setNested(salla.lang.messages[lang], key, value);
|
|
78
|
-
resolve(true);
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
const setTranslations = async () => {
|
|
82
|
-
await setNestedAsync('ar.trans', 'common.uploader.drag_and_drop_files', 'اسحب الملفات وأفلتها هنا');
|
|
83
|
-
await setNestedAsync('en.trans', 'common.uploader.drag_and_drop_files', 'Drag and drop files here');
|
|
84
|
-
await setNestedAsync('ar.trans', 'common.uploader.allowed_images_types', ' .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة');
|
|
85
|
-
await setNestedAsync('en.trans', 'common.uploader.allowed_images_types', 'Images in jpg, jpeg, or png format are allowed.');
|
|
86
|
-
await setNestedAsync('ar.trans', 'pages.rating.add_images', 'اضافة صور');
|
|
87
|
-
await setNestedAsync('en.trans', 'pages.rating.add_images', 'Add Images');
|
|
88
|
-
await setNestedAsync('ar.trans', 'pages.rating.edit_images', 'تعديل الصور');
|
|
89
|
-
await setNestedAsync('en.trans', 'pages.rating.edit_images', 'Edit Images');
|
|
90
|
-
await setNestedAsync('ar.trans', 'pages.rating.edit_review', 'تعديل التقييم');
|
|
91
|
-
await setNestedAsync('en.trans', 'pages.rating.edit_review', 'Edit review');
|
|
92
|
-
await setNestedAsync('ar.trans', 'pages.rating.confirm_deletion', 'تأكيد حذف التقييم');
|
|
93
|
-
await setNestedAsync('en.trans', 'pages.rating.confirm_deletion', 'Confirm review deletion');
|
|
94
|
-
await setNestedAsync('ar.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'هل أنت متأكد من حذف تقييمك؟');
|
|
95
|
-
await setNestedAsync('en.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'Are you sure you want to delete your review?');
|
|
96
|
-
await setNestedAsync('ar.trans', 'pages.rating.review_updated_successfully', 'تم تعديل التقييم بنجاح');
|
|
97
|
-
await setNestedAsync('en.trans', 'pages.rating.review_updated_successfully', 'The review has been successfully updated.');
|
|
98
|
-
await setNestedAsync('ar.trans', 'pages.rating.review_deleted_successfully', 'تم حذف التقييم بنجاح');
|
|
99
|
-
await setNestedAsync('en.trans', 'pages.rating.review_deleted_successfully', 'The review has been successfully deleted.');
|
|
100
|
-
await setNestedAsync('ar.trans', 'pages.rating.images_count', 'الصور ( :current من أصل :total )');
|
|
101
|
-
await setNestedAsync('en.trans', 'pages.rating.images_count', 'Images ( :current of :total )');
|
|
102
|
-
await setNestedAsync('ar.trans', 'pages.rating.media_count', 'الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)');
|
|
103
|
-
await setNestedAsync('en.trans', 'pages.rating.media_count', 'Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)');
|
|
104
|
-
await setNestedAsync('ar.trans', 'common.uploader.allowed_videos_types', 'يُسمح بفيديوهات mp4 أو mov أو avi أو mkv');
|
|
105
|
-
await setNestedAsync('en.trans', 'common.uploader.allowed_videos_types', 'Videos in mp4, mov, avi, or mkv format are allowed.');
|
|
106
|
-
await setNestedAsync('ar.trans', 'pages.rating.videos_count', 'الفيديو ( :current من أصل :total )');
|
|
107
|
-
await setNestedAsync('en.trans', 'pages.rating.videos_count', 'Videos ( :current of :total )');
|
|
108
|
-
await setNestedAsync('ar.trans', 'common.uploader.allowed_media_types', 'يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv');
|
|
109
|
-
await setNestedAsync('en.trans', 'common.uploader.allowed_media_types', 'Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed.');
|
|
110
|
-
await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `أضف حتى ${MAX_IMAGE_UPLOAD_LIMIT} صور و ${MAX_VIDEO_UPLOAD_LIMIT} فيديوهات كحد أقصى`);
|
|
111
|
-
await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${MAX_IMAGE_UPLOAD_LIMIT} images and ${MAX_VIDEO_UPLOAD_LIMIT} videos maximum.`);
|
|
112
|
-
await setNestedAsync('ar.trans', 'common.uploader.max_images_count', 'أضف :count صور كحد أقصى');
|
|
113
|
-
await setNestedAsync('en.trans', 'common.uploader.max_images_count', 'Add up to :count images maximum.');
|
|
114
|
-
await setNestedAsync('ar.trans', 'common.uploader.max_videos_count', 'أضف :count فيديوهات كحد أقصى');
|
|
115
|
-
await setNestedAsync('en.trans', 'common.uploader.max_videos_count', 'Add up to :count videos maximum.');
|
|
116
|
-
await setNestedAsync('ar.trans', 'common.elements.confirm_delete', 'تأكيد الحذف');
|
|
117
|
-
await setNestedAsync('en.trans', 'common.elements.confirm_delete', 'Confirm deletion');
|
|
118
|
-
await setNestedAsync('ar.trans', 'pages.rating.rate_required_factors', 'يرجى تقييم جميع المعايير لإتمام مراجعتك.');
|
|
119
|
-
await setNestedAsync('en.trans', 'pages.rating.rate_required_factors', 'Please rate all required factors to complete your review.');
|
|
120
|
-
await setNestedAsync('ar.trans', 'pages.rating.overall_product_rating', 'التقييم العام للمنتج');
|
|
121
|
-
await setNestedAsync('en.trans', 'pages.rating.overall_product_rating', 'Overall product rating');
|
|
122
|
-
await setNestedAsync('ar.trans', 'pages.rating.loyalty_points_for_images', 'اكسب :points نقطة ولاء عند إضافة صور لتقييمك!');
|
|
123
|
-
await setNestedAsync('en.trans', 'pages.rating.loyalty_points_for_images', 'Earn :points loyalty points when adding photos to your review!');
|
|
124
|
-
this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
|
|
125
|
-
this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
|
|
126
|
-
this.threeImagesMax = this.getMaxUploadHintLabel();
|
|
127
|
-
this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
|
|
128
|
-
this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
|
|
129
|
-
this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
|
|
130
|
-
this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
|
|
131
|
-
this.cancelLabel = salla.lang.get('common.elements.cancel');
|
|
132
|
-
this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
|
|
133
|
-
this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
|
|
134
|
-
this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
|
|
135
|
-
this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
|
|
136
|
-
this.overallProductRatingLabel = salla.lang.get('pages.rating.overall_product_rating');
|
|
137
|
-
this.loyaltyPointsForImagesLabel = salla.lang.get('pages.rating.loyalty_points_for_images', {
|
|
138
|
-
points: ':points',
|
|
139
|
-
});
|
|
140
|
-
this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_body', { store, id, customer });
|
|
141
|
-
};
|
|
142
|
-
setTranslations();
|
|
143
|
-
});
|
|
144
74
|
}
|
|
145
75
|
/**
|
|
146
76
|
* Show the rating modal
|
|
147
77
|
*/
|
|
148
78
|
syncStoreSettings() {
|
|
149
|
-
if (
|
|
79
|
+
if (this.orderId === undefined) {
|
|
150
80
|
this.orderId = salla.config.get('page.id');
|
|
151
81
|
}
|
|
152
82
|
this.allowAttachImages = !!salla.config.get('store.settings.rating.allow_attach_images');
|
|
@@ -215,11 +145,15 @@ export class SallaRatingModalV2 {
|
|
|
215
145
|
this.setUploaderProcessing(productId, !!detail.uploading);
|
|
216
146
|
this.scheduleUploaderHeightRefresh();
|
|
217
147
|
}
|
|
148
|
+
/** An eligible review with no order behind it — product-only, no store/shipping steps. */
|
|
149
|
+
isUnverifiedReview() {
|
|
150
|
+
return this.orderId === null && !!this.productId;
|
|
151
|
+
}
|
|
218
152
|
/** Encrypted order id from page config / prop — used to fetch order details. */
|
|
219
153
|
getRatingOrderId() {
|
|
220
154
|
return this.orderId || salla.config.get('page.id');
|
|
221
155
|
}
|
|
222
|
-
/** Numeric order id from API response — used when submitting ratings. */
|
|
156
|
+
/** Numeric order id from API response — used when submitting ratings. Null when unverified. */
|
|
223
157
|
getSubmitOrderId() {
|
|
224
158
|
return this.orderId;
|
|
225
159
|
}
|
|
@@ -288,6 +222,9 @@ export class SallaRatingModalV2 {
|
|
|
288
222
|
return rating !== undefined && rating !== null && rating !== '' && Number(rating) > 0;
|
|
289
223
|
}
|
|
290
224
|
isTestimonialsEnabled(order = this.order) {
|
|
225
|
+
if (this.productId) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
291
228
|
if (order?.testimonials_enabled === false) {
|
|
292
229
|
return false;
|
|
293
230
|
}
|
|
@@ -306,6 +243,9 @@ export class SallaRatingModalV2 {
|
|
|
306
243
|
return this.getRateableProducts(order).length > 0;
|
|
307
244
|
}
|
|
308
245
|
isShippingEnabled(order = this.order) {
|
|
246
|
+
if (this.productId) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
309
249
|
if (order?.shipping_enabled === false) {
|
|
310
250
|
return false;
|
|
311
251
|
}
|
|
@@ -327,7 +267,8 @@ export class SallaRatingModalV2 {
|
|
|
327
267
|
return order.products.filter(item => item?.product?.id);
|
|
328
268
|
}
|
|
329
269
|
getRateableProducts(order = this.order) {
|
|
330
|
-
return this.getOrderProducts(order).filter(item => !this.hasRatingFeedback(item?.feedback)
|
|
270
|
+
return this.getOrderProducts(order).filter(item => !this.hasRatingFeedback(item?.feedback) &&
|
|
271
|
+
(!this.productId || String(item.product.id) === String(this.productId)));
|
|
331
272
|
}
|
|
332
273
|
getStepsCount(order = this.order) {
|
|
333
274
|
if (!order) {
|
|
@@ -350,6 +291,58 @@ export class SallaRatingModalV2 {
|
|
|
350
291
|
this.scheduleWizardSetup = true;
|
|
351
292
|
forceUpdate(this);
|
|
352
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Point the modal at a different order/product and invalidate any cached
|
|
296
|
+
* order so the next open() re-fetches instead of reusing stale data.
|
|
297
|
+
* Pass `orderId` as `null` for an eligible-but-unverified product review.
|
|
298
|
+
*/
|
|
299
|
+
async setOrder(orderId, productId) {
|
|
300
|
+
this.orderId = orderId;
|
|
301
|
+
this.productId = productId;
|
|
302
|
+
this.order = undefined;
|
|
303
|
+
this.hasError = false;
|
|
304
|
+
this.errorMessage = undefined;
|
|
305
|
+
this.showContactWidget = true;
|
|
306
|
+
}
|
|
307
|
+
/** Builds a single-product, order-less feedback target for unverified reviews. */
|
|
308
|
+
async loadUnverifiedProductOrder() {
|
|
309
|
+
const response = await salla.api
|
|
310
|
+
.withoutNotifier(() => salla.product.api.getDetails(this.productId))
|
|
311
|
+
.catch(() => null);
|
|
312
|
+
const product = response?.data;
|
|
313
|
+
this.order = {
|
|
314
|
+
products: [
|
|
315
|
+
{
|
|
316
|
+
feedback: undefined,
|
|
317
|
+
product: {
|
|
318
|
+
id: Number(this.productId),
|
|
319
|
+
name: product?.name || '',
|
|
320
|
+
thumbnail: product?.image?.url || salla.url.cdn('images/s-empty.png'),
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
products_enabled: true,
|
|
325
|
+
testimonials_enabled: false,
|
|
326
|
+
shipping_enabled: false,
|
|
327
|
+
thanks_message: '',
|
|
328
|
+
};
|
|
329
|
+
this.productReviewFactors = await this.fetchAllProductReviewFactors(this.order);
|
|
330
|
+
}
|
|
331
|
+
escapeHtml(str) {
|
|
332
|
+
return str
|
|
333
|
+
.replace(/&/g, '&')
|
|
334
|
+
.replace(/</g, '<')
|
|
335
|
+
.replace(/>/g, '>')
|
|
336
|
+
.replace(/"/g, '"')
|
|
337
|
+
.replace(/'/g, ''');
|
|
338
|
+
}
|
|
339
|
+
getModalTitle() {
|
|
340
|
+
if (this.isUnverifiedReview()) {
|
|
341
|
+
const productName = this.escapeHtml(this.getRateableProducts()[0]?.product?.name || '');
|
|
342
|
+
return `${salla.lang.get('pages.rating.rate')} ${productName}`.trim();
|
|
343
|
+
}
|
|
344
|
+
return `${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order?.id})</span>`;
|
|
345
|
+
}
|
|
353
346
|
async open() {
|
|
354
347
|
await salla.onReady();
|
|
355
348
|
this.syncStoreSettings();
|
|
@@ -361,14 +354,16 @@ export class SallaRatingModalV2 {
|
|
|
361
354
|
this.modal
|
|
362
355
|
?.open()
|
|
363
356
|
.then(() => this.order ||
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
357
|
+
(this.isUnverifiedReview()
|
|
358
|
+
? this.loadUnverifiedProductOrder()
|
|
359
|
+
: salla.api
|
|
360
|
+
.withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
|
|
361
|
+
.then(async (res) => {
|
|
362
|
+
this.order = res.data;
|
|
363
|
+
this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
|
|
364
|
+
})))
|
|
370
365
|
.then(() => this.readyUpLoyaltyPoints())
|
|
371
|
-
.then(() => this.modal?.setTitle(
|
|
366
|
+
.then(() => this.modal?.setTitle(this.getModalTitle()))
|
|
372
367
|
.then(() => {
|
|
373
368
|
// Initialize productImages for all products
|
|
374
369
|
const initialImages = {};
|
|
@@ -803,7 +798,9 @@ export class SallaRatingModalV2 {
|
|
|
803
798
|
Number(rating_product_with_image_points) + Number(rating_product_points);
|
|
804
799
|
}
|
|
805
800
|
loyaltyPointsNote() {
|
|
806
|
-
if (!this.loyaltyImageRatingPoints ||
|
|
801
|
+
if (!this.loyaltyImageRatingPoints ||
|
|
802
|
+
!this.loyaltyPointsForImagesLabel ||
|
|
803
|
+
this.isUnverifiedReview()) {
|
|
807
804
|
return null;
|
|
808
805
|
}
|
|
809
806
|
const svgIcon = (h("svg", { width: "17", height: "17", viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z", fill: "#008C56" })));
|
|
@@ -964,7 +961,7 @@ export class SallaRatingModalV2 {
|
|
|
964
961
|
this.userFilledFactorKeys[productId] = userFilled;
|
|
965
962
|
}
|
|
966
963
|
shouldAutofillFactors(mainRating) {
|
|
967
|
-
return mainRating
|
|
964
|
+
return mainRating >= 4;
|
|
968
965
|
}
|
|
969
966
|
autofillUnfilledFactors(productId, mainRating) {
|
|
970
967
|
const factors = this.productReviewFactors[productId] || [];
|
|
@@ -1087,7 +1084,7 @@ export class SallaRatingModalV2 {
|
|
|
1087
1084
|
}, {});
|
|
1088
1085
|
}
|
|
1089
1086
|
renderProductStep(item, index) {
|
|
1090
|
-
return (h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-
|
|
1087
|
+
return (h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details", ref: el => el && this.setupProductRatingAutofill(el, item.product.id) }, h("div", { class: "s-rating-modal-step-wrap" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-title" }, item.product.name), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_product_rate')), this.renderProductMainRating(item.product.id, 0, { fieldPrefix: '' })), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), h("input", { type: "hidden", name: "product_id", value: item.product.id }), h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
|
|
1091
1088
|
if (el)
|
|
1092
1089
|
this.contentRefs[index] = el;
|
|
1093
1090
|
} }, h("salla-file-upload", { name: "image", enableGallery: true, maxImagesCount: this.allowAttachImages ? this.MAX_IMAGE_UPLOAD_LIMIT : undefined, maxVideosCount: this.allowAttachVideos ? this.MAX_VIDEO_UPLOAD_LIMIT : undefined, maxVideoFileSize: this.allowAttachVideos ? this.MAX_VIDEO_FILE_SIZE : undefined, maxVideoDuration: this.allowAttachVideos ? this.MAX_VIDEO_DURATION : undefined, maxParallelUploads: this.MAX_PARALLEL_UPLOADS, imagePreviewHeight: 75, filePosterHeight: 75, "instant-upload": true, type: "feedback", payloadName: "files[]", id: `file-${item.product.id}`, title: item.product.name, allowMultiple: true, instantUpload: true, accept: this.getMediaUploadAccept(), url: salla.url.api('upload'), onUploaded: e => {
|
|
@@ -1123,17 +1120,21 @@ export class SallaRatingModalV2 {
|
|
|
1123
1120
|
this.hiddenVideoInputs[index] = el;
|
|
1124
1121
|
} })), this.renderUploadedImagesCount(item.product.id))))));
|
|
1125
1122
|
}
|
|
1123
|
+
renderProductMainRating(productId, index, options = {}) {
|
|
1124
|
+
const fieldPrefix = options.fieldPrefix ?? `products[${index}]`;
|
|
1125
|
+
const mainRatingName = fieldPrefix ? `${fieldPrefix}[rating]` : 'rating';
|
|
1126
|
+
const normalizedMainRating = Number(options.mainRating ??
|
|
1127
|
+
(this.editMode ? this.editMainRating : this.productMainRatings[productId]));
|
|
1128
|
+
const hasMainRating = !Number.isNaN(normalizedMainRating);
|
|
1129
|
+
return (h("div", { class: "s-rating-modal-stars-product s-rating-modal-product-rating-row-main" }, h("salla-rating-stars", { size: "large", name: mainRatingName, key: hasMainRating ? `main-rating-${normalizedMainRating}` : 'main-rating-empty', value: hasMainRating ? normalizedMainRating : undefined, editable: hasMainRating, withLabel: true })));
|
|
1130
|
+
}
|
|
1126
1131
|
renderProductReviewFactors(productId, index, options = {}) {
|
|
1127
1132
|
const factors = this.productReviewFactors[productId] || [];
|
|
1128
1133
|
const fieldPrefix = options.fieldPrefix ?? `products[${index}]`;
|
|
1129
|
-
const mainRatingName = fieldPrefix ? `${fieldPrefix}[rating]` : 'rating';
|
|
1130
1134
|
const factorRatings = {
|
|
1131
1135
|
...(this.editMode ? {} : this.productFactorRatings[productId] || {}),
|
|
1132
1136
|
...(options.factorRatings || {}),
|
|
1133
1137
|
};
|
|
1134
|
-
const normalizedMainRating = Number(options.mainRating ??
|
|
1135
|
-
(this.editMode ? this.editMainRating : this.productMainRatings[productId]));
|
|
1136
|
-
const hasMainRating = !Number.isNaN(normalizedMainRating);
|
|
1137
1138
|
const getPrefilledFactorRating = (factor, factorIndex) => {
|
|
1138
1139
|
const byId = factor.id !== undefined ? factorRatings[String(factor.id)] : undefined;
|
|
1139
1140
|
const byName = factor.name ? factorRatings[factor.name.trim()] : undefined;
|
|
@@ -1141,8 +1142,12 @@ export class SallaRatingModalV2 {
|
|
|
1141
1142
|
const normalized = Number(byId ?? byName ?? byIndex);
|
|
1142
1143
|
return Number.isNaN(normalized) ? undefined : normalized;
|
|
1143
1144
|
};
|
|
1144
|
-
|
|
1145
|
-
|
|
1145
|
+
if (!factors.length) {
|
|
1146
|
+
return null;
|
|
1147
|
+
}
|
|
1148
|
+
const hasRequiredFactor = factors.some(factor => factor.required);
|
|
1149
|
+
return (h("div", { class: "s-rating-modal-product-factors-card" }, h("div", { class: "s-rating-modal-product-factors-heading" }, this.rateTheFollowingLabel, hasRequiredFactor ? h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), h("div", { class: "s-rating-modal-product-rating-rows" }, factors.map((factor, factorIndex) => (h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-factor-row", "data-required": factor.required ? 'true' : 'false', "data-factor-key": this.getFactorKey(factor, factorIndex) }, h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), h("span", { class: "s-rating-modal-product-factor-name" }, factor.name), h("salla-rating-stars", { size: "medium", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'rating'), key: `factor-rating-${factor.id ?? factorIndex}-${getPrefilledFactorRating(factor, factorIndex) ?? 0}`, value: getPrefilledFactorRating(factor, factorIndex), editable: options.alwaysEditable ||
|
|
1150
|
+
typeof getPrefilledFactorRating(factor, factorIndex) === 'number', tag: false })))))));
|
|
1146
1151
|
}
|
|
1147
1152
|
handleSendEmail() {
|
|
1148
1153
|
if (!this.order) {
|
|
@@ -1233,21 +1238,24 @@ export class SallaRatingModalV2 {
|
|
|
1233
1238
|
return (h("salla-modal", { ref: modal => {
|
|
1234
1239
|
if (modal)
|
|
1235
1240
|
this.editModal = modal;
|
|
1236
|
-
}, width: "
|
|
1241
|
+
}, width: "custom", customWidth: MODAL_WIDTH, onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-edit-wrapper", ref: el => {
|
|
1237
1242
|
if (el)
|
|
1238
1243
|
this.body = el;
|
|
1239
1244
|
} }, this.editType === 'store' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "store", ref: currentTab => {
|
|
1240
1245
|
if (currentTab)
|
|
1241
1246
|
this.currentTab = currentTab;
|
|
1242
|
-
} }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => {
|
|
1247
|
+
} }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), h("h2", { class: "s-rating-modal-title" }, salla.config.get('store.name')), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => {
|
|
1243
1248
|
if (currentTab)
|
|
1244
1249
|
this.currentTab = currentTab;
|
|
1245
|
-
} }, this.editItem.shipping.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => {
|
|
1250
|
+
} }, this.editItem.shipping.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_shipping_rate')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => {
|
|
1246
1251
|
if (currentTab)
|
|
1247
1252
|
this.currentTab = currentTab;
|
|
1248
|
-
} }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-
|
|
1253
|
+
} }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details", ref: el => el && this.setupProductRatingAutofill(el, this.editItem.product.id) }, h("div", { class: "s-rating-modal-step-wrap" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-title" }, this.editItem.product.name), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_product_rate')), this.renderProductMainRating(this.editItem.product.id, 0, {
|
|
1254
|
+
fieldPrefix: '',
|
|
1255
|
+
mainRating: this.editMainRating ??
|
|
1256
|
+
Number(this.editItem.stars ?? this.editItem.rating),
|
|
1257
|
+
})), this.renderProductReviewFactors(this.editItem.product.id, 0, {
|
|
1249
1258
|
fieldPrefix: '',
|
|
1250
|
-
mainRating: this.editMainRating ?? Number(this.editItem.stars ?? this.editItem.rating),
|
|
1251
1259
|
factorRatings: this.editFactorRatings,
|
|
1252
1260
|
alwaysEditable: true,
|
|
1253
1261
|
}), h("input", { type: "hidden", name: "product_id", value: this.editItem.product.id }), h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
|
|
@@ -1287,15 +1295,15 @@ export class SallaRatingModalV2 {
|
|
|
1287
1295
|
return h(Host, { class: "s-rating-modal" }, this.getEditModal());
|
|
1288
1296
|
}
|
|
1289
1297
|
if (this.defaultMode) {
|
|
1290
|
-
return (h(Host, { class: "s-rating-modal" }, h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "
|
|
1298
|
+
return (h(Host, { class: "s-rating-modal" }, h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "custom", customWidth: MODAL_WIDTH, ref: modal => {
|
|
1291
1299
|
if (modal)
|
|
1292
1300
|
this.modal = modal;
|
|
1293
1301
|
} }, h("div", { slot: "loading" }, h("div", { class: "s-rating-modal-skeleton" }, h("salla-skeleton", { type: "circle", height: "80px", width: "80px" }), h("salla-skeleton", { height: "15px", width: "60%" }), h("salla-skeleton", { height: "10px", width: "30%" }), h("div", { class: "s-rating-modal-skeleton-stars" }, [...Array(5)].map(v => (h("div", { key: v, innerHTML: Star })))), h("salla-skeleton", { height: "100px", width: "100%" }), h("div", { class: "s-rating-modal-skeleton-footer" }, h("salla-skeleton", { height: "40px", width: "30%" })))), !this.hasError && this.order ? ([
|
|
1294
1302
|
h("div", { class: "s-rating-modal-wrapper", ref: el => {
|
|
1295
1303
|
if (el)
|
|
1296
1304
|
this.body = el;
|
|
1297
|
-
} }, this.isTestimonialsEnabled() ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
|
|
1298
|
-
this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => {
|
|
1305
|
+
} }, this.isTestimonialsEnabled() ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), h("h2", { class: "s-rating-modal-title" }, salla.config.get('store.name')), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
|
|
1306
|
+
this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_shipping_rate')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => {
|
|
1299
1307
|
if (el)
|
|
1300
1308
|
this.thanksTab = el;
|
|
1301
1309
|
} }, h("span", { class: "s-rating-modal-icon", innerHTML: CheckCircle2 }), h("h3", { class: "s-rating-modal-thanks-title" }, salla.lang.get('pages.rating.thanks')), h("div", { class: "s-rating-modal-thanks-msg", innerHTML: this.order.thanks_message }), h("time", { class: "s-rating-modal-thanks-time", ref: el => {
|
|
@@ -1318,8 +1326,105 @@ export class SallaRatingModalV2 {
|
|
|
1318
1326
|
}
|
|
1319
1327
|
async componentWillLoad() {
|
|
1320
1328
|
await salla.onReady();
|
|
1329
|
+
await salla.lang.onLoaded();
|
|
1330
|
+
this.registerTranslations();
|
|
1321
1331
|
this.syncStoreSettings();
|
|
1322
1332
|
}
|
|
1333
|
+
registerTranslations() {
|
|
1334
|
+
salla.lang.addBulk({
|
|
1335
|
+
'common.uploader.drag_and_drop_files': {
|
|
1336
|
+
ar: 'اسحب الملفات وأفلتها هنا',
|
|
1337
|
+
en: 'Drag and drop files here',
|
|
1338
|
+
},
|
|
1339
|
+
'common.uploader.allowed_images_types': {
|
|
1340
|
+
ar: ' .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة',
|
|
1341
|
+
en: 'Images in jpg, jpeg, or png format are allowed.',
|
|
1342
|
+
},
|
|
1343
|
+
'pages.rating.add_images': { ar: 'اضافة صور', en: 'Add Images' },
|
|
1344
|
+
'pages.rating.edit_images': { ar: 'تعديل الصور', en: 'Edit Images' },
|
|
1345
|
+
'pages.rating.edit_review': { ar: 'تعديل التقييم', en: 'Edit review' },
|
|
1346
|
+
'pages.rating.confirm_deletion': { ar: 'تأكيد حذف التقييم', en: 'Confirm review deletion' },
|
|
1347
|
+
'pages.rating.are_you_sure_you_want_to_delete_review': {
|
|
1348
|
+
ar: 'هل أنت متأكد من حذف تقييمك؟',
|
|
1349
|
+
en: 'Are you sure you want to delete your review?',
|
|
1350
|
+
},
|
|
1351
|
+
'pages.rating.review_updated_successfully': {
|
|
1352
|
+
ar: 'تم تعديل التقييم بنجاح',
|
|
1353
|
+
en: 'The review has been successfully updated.',
|
|
1354
|
+
},
|
|
1355
|
+
'pages.rating.review_deleted_successfully': {
|
|
1356
|
+
ar: 'تم حذف التقييم بنجاح',
|
|
1357
|
+
en: 'The review has been successfully deleted.',
|
|
1358
|
+
},
|
|
1359
|
+
'pages.rating.images_count': {
|
|
1360
|
+
ar: 'الصور ( :current من أصل :total )',
|
|
1361
|
+
en: 'Images ( :current of :total )',
|
|
1362
|
+
},
|
|
1363
|
+
'pages.rating.media_count': {
|
|
1364
|
+
ar: 'الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)',
|
|
1365
|
+
en: 'Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)',
|
|
1366
|
+
},
|
|
1367
|
+
'common.uploader.allowed_videos_types': {
|
|
1368
|
+
ar: 'يُسمح بفيديوهات mp4 أو mov أو avi أو mkv',
|
|
1369
|
+
en: 'Videos in mp4, mov, avi, or mkv format are allowed.',
|
|
1370
|
+
},
|
|
1371
|
+
'pages.rating.videos_count': {
|
|
1372
|
+
ar: 'الفيديو ( :current من أصل :total )',
|
|
1373
|
+
en: 'Videos ( :current of :total )',
|
|
1374
|
+
},
|
|
1375
|
+
'common.uploader.allowed_media_types': {
|
|
1376
|
+
ar: 'يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv',
|
|
1377
|
+
en: 'Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed.',
|
|
1378
|
+
},
|
|
1379
|
+
'common.uploader.max_three_images': {
|
|
1380
|
+
ar: `أضف حتى ${MAX_IMAGE_UPLOAD_LIMIT} صور و ${MAX_VIDEO_UPLOAD_LIMIT} فيديوهات كحد أقصى`,
|
|
1381
|
+
en: `Add up to ${MAX_IMAGE_UPLOAD_LIMIT} images and ${MAX_VIDEO_UPLOAD_LIMIT} videos maximum.`,
|
|
1382
|
+
},
|
|
1383
|
+
'common.uploader.max_images_count': {
|
|
1384
|
+
ar: 'أضف :count صور كحد أقصى',
|
|
1385
|
+
en: 'Add up to :count images maximum.',
|
|
1386
|
+
},
|
|
1387
|
+
'common.uploader.max_videos_count': {
|
|
1388
|
+
ar: 'أضف :count فيديوهات كحد أقصى',
|
|
1389
|
+
en: 'Add up to :count videos maximum.',
|
|
1390
|
+
},
|
|
1391
|
+
'common.elements.confirm_delete': { ar: 'تأكيد الحذف', en: 'Confirm deletion' },
|
|
1392
|
+
'pages.rating.rate_required_factors': {
|
|
1393
|
+
ar: 'يرجى تقييم جميع المعايير لإتمام مراجعتك.',
|
|
1394
|
+
en: 'Please rate all required factors to complete your review.',
|
|
1395
|
+
},
|
|
1396
|
+
'pages.rating.overall_product_rating': {
|
|
1397
|
+
ar: 'التقييم العام للمنتج',
|
|
1398
|
+
en: 'Overall product rating',
|
|
1399
|
+
},
|
|
1400
|
+
'pages.rating.rate_the_following_factors': {
|
|
1401
|
+
ar: 'كيف تقيِّم التالي؟',
|
|
1402
|
+
en: 'How would you rate the following?',
|
|
1403
|
+
},
|
|
1404
|
+
'pages.rating.loyalty_points_for_images': {
|
|
1405
|
+
ar: 'شاركنا صورة مع تقييمك للطلب واكسب :points نقطة ولاء',
|
|
1406
|
+
en: 'Share a photo with your order review and earn :points loyalty points',
|
|
1407
|
+
},
|
|
1408
|
+
});
|
|
1409
|
+
this.contactUsLabel = salla.lang.get('blocks.footer.social');
|
|
1410
|
+
this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
|
|
1411
|
+
this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
|
|
1412
|
+
this.threeImagesMax = this.getMaxUploadHintLabel();
|
|
1413
|
+
this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
|
|
1414
|
+
this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
|
|
1415
|
+
this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
|
|
1416
|
+
this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
|
|
1417
|
+
this.cancelLabel = salla.lang.get('common.elements.cancel');
|
|
1418
|
+
this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
|
|
1419
|
+
this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
|
|
1420
|
+
this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
|
|
1421
|
+
this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
|
|
1422
|
+
this.rateTheFollowingLabel = salla.lang.get('pages.rating.rate_the_following_factors');
|
|
1423
|
+
this.loyaltyPointsForImagesLabel = salla.lang.get('pages.rating.loyalty_points_for_images', {
|
|
1424
|
+
points: ':points',
|
|
1425
|
+
});
|
|
1426
|
+
this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_body', { store, id, customer });
|
|
1427
|
+
}
|
|
1323
1428
|
componentDidRender() {
|
|
1324
1429
|
if (!this.scheduleWizardSetup || !this.defaultMode || !this.order) {
|
|
1325
1430
|
return;
|
|
@@ -1344,19 +1449,38 @@ export class SallaRatingModalV2 {
|
|
|
1344
1449
|
static get properties() {
|
|
1345
1450
|
return {
|
|
1346
1451
|
"orderId": {
|
|
1347
|
-
"type": "
|
|
1452
|
+
"type": "any",
|
|
1348
1453
|
"attribute": "order-id",
|
|
1349
|
-
"mutable":
|
|
1454
|
+
"mutable": true,
|
|
1350
1455
|
"complexType": {
|
|
1351
|
-
"original": "number",
|
|
1352
|
-
"resolved": "number",
|
|
1456
|
+
"original": "number | string | null",
|
|
1457
|
+
"resolved": "number | string",
|
|
1353
1458
|
"references": {}
|
|
1354
1459
|
},
|
|
1355
1460
|
"required": false,
|
|
1356
1461
|
"optional": true,
|
|
1357
1462
|
"docs": {
|
|
1358
1463
|
"tags": [],
|
|
1359
|
-
"text": "The order id, to rate on its products & shipping"
|
|
1464
|
+
"text": "The order id, to rate on its products & shipping.\nExplicitly `null` means an unverified (no order) product review."
|
|
1465
|
+
},
|
|
1466
|
+
"getter": false,
|
|
1467
|
+
"setter": false,
|
|
1468
|
+
"reflect": false
|
|
1469
|
+
},
|
|
1470
|
+
"productId": {
|
|
1471
|
+
"type": "any",
|
|
1472
|
+
"attribute": "product-id",
|
|
1473
|
+
"mutable": true,
|
|
1474
|
+
"complexType": {
|
|
1475
|
+
"original": "number | string",
|
|
1476
|
+
"resolved": "number | string",
|
|
1477
|
+
"references": {}
|
|
1478
|
+
},
|
|
1479
|
+
"required": false,
|
|
1480
|
+
"optional": true,
|
|
1481
|
+
"docs": {
|
|
1482
|
+
"tags": [],
|
|
1483
|
+
"text": ""
|
|
1360
1484
|
},
|
|
1361
1485
|
"getter": false,
|
|
1362
1486
|
"setter": false,
|
|
@@ -1399,6 +1523,31 @@ export class SallaRatingModalV2 {
|
|
|
1399
1523
|
}
|
|
1400
1524
|
static get methods() {
|
|
1401
1525
|
return {
|
|
1526
|
+
"setOrder": {
|
|
1527
|
+
"complexType": {
|
|
1528
|
+
"signature": "(orderId: number | string | null, productId?: number | string) => Promise<void>",
|
|
1529
|
+
"parameters": [{
|
|
1530
|
+
"name": "orderId",
|
|
1531
|
+
"type": "string | number",
|
|
1532
|
+
"docs": ""
|
|
1533
|
+
}, {
|
|
1534
|
+
"name": "productId",
|
|
1535
|
+
"type": "string | number",
|
|
1536
|
+
"docs": ""
|
|
1537
|
+
}],
|
|
1538
|
+
"references": {
|
|
1539
|
+
"Promise": {
|
|
1540
|
+
"location": "global",
|
|
1541
|
+
"id": "global::Promise"
|
|
1542
|
+
}
|
|
1543
|
+
},
|
|
1544
|
+
"return": "Promise<void>"
|
|
1545
|
+
},
|
|
1546
|
+
"docs": {
|
|
1547
|
+
"text": "Point the modal at a different order/product and invalidate any cached\norder so the next open() re-fetches instead of reusing stale data.\nPass `orderId` as `null` for an eligible-but-unverified product review.",
|
|
1548
|
+
"tags": []
|
|
1549
|
+
}
|
|
1550
|
+
},
|
|
1402
1551
|
"open": {
|
|
1403
1552
|
"complexType": {
|
|
1404
1553
|
"signature": "() => Promise<unknown>",
|