@salla.sa/twilight-components 2.14.540 → 2.14.541
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-U8F_iDbp.js → filepond-CNdvfaMJ.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-CAJAmCHU.js → filepond-plugin-file-poster-Di_D3w89.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-Dxgl8Gdz.js → filepond-plugin-file-validate-size-BiRa98qd.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-BPhw8zXs.js → filepond-plugin-file-validate-type-Bolv-kyJ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-DNKfSuCy.js → filepond-plugin-image-edit-AN6huMV9.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-NCmUtKOd.js → filepond-plugin-image-exif-orientation-Bwa8QtGo.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-jRCd9jSG.js → filepond-plugin-image-preview-CaVYLAvG.js} +1 -1
- package/dist/cjs/helpers-ClOJIAG8.js +89 -0
- package/dist/cjs/{index-F_FURF-0.js → index-DX2EKTCE.js} +18 -14
- package/dist/cjs/{intlTelInput-yt9noy9U.js → intlTelInput-DnwdGAiP.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-booking-field_7.cjs.entry.js → salla-attachment-view_9.cjs.entry.js} +1003 -40
- 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 +2 -2
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +14 -5
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
- package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-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 +1 -1
- package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-map_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 +1 -1
- package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +420 -84
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -5
- package/dist/cjs/salla-review-factors-tags.cjs.entry.js +4 -83
- package/dist/cjs/salla-review-order-item.cjs.entry.js +125 -0
- 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/twilight.cjs.js +2 -2
- package/dist/cjs/upload-limits-C3RarAPN.js +136 -0
- package/dist/cjs/{vanilla-picker-DXgSpklI.js → vanilla-picker-BUFYPi-_.js} +1 -1
- package/dist/collection/collection-manifest.json +16 -11
- package/dist/collection/components/salla-attachment-view/salla-attachment-view.css +164 -0
- package/dist/collection/components/salla-attachment-view/salla-attachment-view.js +250 -0
- package/dist/collection/components/salla-attachments/salla-attachments.css +69 -0
- package/dist/collection/components/salla-attachments/salla-attachments.js +375 -0
- package/dist/collection/components/salla-comments/salla-comment-item.js +13 -3
- package/dist/collection/components/salla-comments/salla-comments.css +7 -0
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.css +149 -0
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +784 -42
- package/dist/collection/components/salla-file-upload/upload-limits.js +127 -0
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +1 -1
- package/dist/collection/components/salla-rating-modal/rating-modal-media.js +85 -0
- package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +348 -85
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +17 -7
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +1 -3
- package/dist/collection/components/salla-review-factors-tags/helpers.js +8 -7
- package/dist/collection/components/salla-review-order-item/interfaces.js +1 -0
- package/dist/collection/components/salla-review-order-item/salla-review-order-item.js +154 -0
- package/dist/components/index.js +2 -2
- package/dist/components/salla-add-product-button2.js +40 -28
- package/dist/components/salla-attachment-view.d.ts +11 -0
- package/dist/components/salla-attachment-view.js +9 -0
- package/dist/components/salla-attachment-view2.js +323 -0
- package/dist/components/salla-attachments.d.ts +11 -0
- package/dist/components/salla-attachments.js +9 -0
- package/dist/components/salla-attachments2.js +232 -0
- package/dist/components/salla-basket-gap.js +46 -34
- package/dist/components/salla-breadcrumb.js +1 -1
- package/dist/components/salla-comment-factors2.js +1 -1
- package/dist/components/salla-comment-item2.js +26 -4
- package/dist/components/salla-comments.js +14 -2
- package/dist/components/salla-custom-fields.js +28 -4
- package/dist/components/salla-file-upload2.js +703 -31
- package/dist/components/salla-gifting.js +7 -1
- package/dist/components/salla-loyalty-exchange-product-card2.js +46 -34
- package/dist/components/salla-loyalty-panel.js +8 -2
- package/dist/components/salla-loyalty-program.js +8 -2
- package/dist/components/salla-multiple-bundle-product-cart2.js +40 -28
- package/dist/components/salla-multiple-bundle-product-details2.js +12 -6
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +7 -1
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
- package/dist/components/salla-multiple-bundle-product.js +12 -6
- package/dist/components/salla-offer-modal.js +8 -2
- package/dist/components/salla-order-edit-item2.js +36 -24
- package/dist/components/salla-order-edit.js +42 -30
- package/dist/components/salla-order-options-modal2.js +34 -22
- package/dist/components/salla-product-card2.js +44 -32
- package/dist/components/salla-product-options2.js +32 -20
- package/dist/components/salla-products-slider2.js +8 -2
- package/dist/components/salla-quick-buy2.js +36 -24
- package/dist/components/salla-rating-modal-v22.js +449 -97
- package/dist/components/salla-rating-modal.js +30 -20
- package/dist/components/salla-review-factors-tags2.js +9 -8
- package/dist/components/salla-review-order-item.d.ts +11 -0
- package/dist/components/salla-review-order-item.js +196 -0
- package/dist/components/salla-reward-details2.js +8 -2
- package/dist/components/salla-slider2.js +1 -1
- package/dist/esm/{filepond-Bxzb6RRZ.js → filepond-CKsbRWmS.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CZfrjnEX.js → filepond-plugin-file-poster-B_gYCESq.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-Dqa69lX7.js → filepond-plugin-file-validate-size-Bep6fNi3.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-C_76nxDb.js → filepond-plugin-file-validate-type-r3uRmGIr.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-BvzVMeMY.js → filepond-plugin-image-edit-BJcOlOFL.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-Br4ANTi7.js → filepond-plugin-image-exif-orientation-DJoDaRwQ.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-e54xZ08P.js → filepond-plugin-image-preview-BsuTLPS0.js} +1 -1
- package/dist/esm/helpers-DqXpn47Z.js +85 -0
- package/dist/esm/{index-5UtJVEzd.js → index-BVqCTDsV.js} +18 -14
- package/dist/esm/{intlTelInput-BQXch__5.js → intlTelInput-CD2FA0nI.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-booking-field_7.entry.js → salla-attachment-view_9.entry.js} +1002 -41
- 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 +2 -2
- package/dist/esm/salla-comment-form_8.entry.js +14 -5
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-cookies-bar.entry.js +1 -1
- package/dist/esm/salla-count-down.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-edit-order-button.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-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 +1 -1
- package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
- package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty.entry.js +1 -1
- package/dist/esm/salla-maintenance-alert.entry.js +1 -1
- package/dist/esm/salla-map_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 +1 -1
- package/dist/esm/salla-rating-modal-v2.entry.js +420 -84
- package/dist/esm/salla-rating-modal.entry.js +3 -5
- package/dist/esm/salla-review-factors-tags.entry.js +2 -81
- package/dist/esm/salla-review-order-item.entry.js +123 -0
- 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/twilight.js +3 -3
- package/dist/esm/upload-limits-DrXX8XG8.js +121 -0
- package/dist/esm/{vanilla-picker-lLULIehu.js → vanilla-picker-Ba_za9Iy.js} +1 -1
- package/dist/twilight/{p-1c66fdb3.entry.js → p-003499a8.entry.js} +1 -1
- package/dist/twilight/{p-0bc1c246.entry.js → p-0974f6c6.entry.js} +1 -1
- package/dist/twilight/{p-1578cbe5.entry.js → p-0a9093f1.entry.js} +1 -1
- package/dist/twilight/{p-ad54610c.entry.js → p-0ce2c41f.entry.js} +1 -1
- package/dist/twilight/{p-acd1a9d8.entry.js → p-0ea8365b.entry.js} +1 -1
- package/dist/twilight/p-1174e53e.entry.js +4 -0
- package/dist/twilight/{p-d8a69feb.entry.js → p-11ef8b82.entry.js} +1 -1
- package/dist/twilight/{p-5cbbf472.entry.js → p-13244c52.entry.js} +1 -1
- package/dist/twilight/{p-9af31040.entry.js → p-14689252.entry.js} +1 -1
- package/dist/twilight/{p-397acd73.entry.js → p-17940d8a.entry.js} +1 -1
- package/dist/twilight/{p-40a0baa7.entry.js → p-1974f6da.entry.js} +1 -1
- package/dist/twilight/{p-02e821a0.entry.js → p-1a191989.entry.js} +1 -1
- package/dist/twilight/{p-900ee42a.entry.js → p-1ec6e0fe.entry.js} +1 -1
- package/dist/twilight/{p-3af52c82.entry.js → p-1fcebaad.entry.js} +1 -1
- package/dist/twilight/{p-6c4cef7a.entry.js → p-2b0cf190.entry.js} +1 -1
- package/dist/twilight/{p-7e9d67f2.entry.js → p-333ea76b.entry.js} +1 -1
- package/dist/twilight/{p-d6b6f984.entry.js → p-337cc9f6.entry.js} +1 -1
- package/dist/twilight/{p-71731e63.entry.js → p-34d5c7bf.entry.js} +1 -1
- package/dist/twilight/{p-49c2e935.entry.js → p-36abc50f.entry.js} +1 -1
- package/dist/twilight/{p-e6007706.entry.js → p-37d9f762.entry.js} +1 -1
- package/dist/twilight/{p-891009e2.entry.js → p-3961522a.entry.js} +1 -1
- package/dist/twilight/{p-b5c90151.entry.js → p-39d9e02f.entry.js} +1 -1
- package/dist/twilight/{p-088c1ab3.entry.js → p-3a4bb8de.entry.js} +1 -1
- package/dist/twilight/{p-538a1642.entry.js → p-409f95a8.entry.js} +1 -1
- package/dist/twilight/{p-fb2c863d.entry.js → p-42952fac.entry.js} +1 -1
- package/dist/twilight/{p-913d4965.entry.js → p-436dfe93.entry.js} +1 -1
- package/dist/twilight/{p-ed9899c0.entry.js → p-50c90e0a.entry.js} +1 -1
- package/dist/twilight/{p-ce941081.entry.js → p-5115117b.entry.js} +1 -1
- package/dist/twilight/{p-693d012f.entry.js → p-56647774.entry.js} +1 -1
- package/dist/twilight/{p-18d7763b.entry.js → p-598cadf4.entry.js} +1 -1
- package/dist/twilight/{p-66313db6.entry.js → p-635265d1.entry.js} +1 -1
- package/dist/twilight/{p-95224232.entry.js → p-659e2280.entry.js} +1 -1
- package/dist/twilight/{p-6757a647.entry.js → p-6a3487de.entry.js} +1 -1
- package/dist/twilight/{p-582247b3.entry.js → p-6d07d195.entry.js} +1 -1
- package/dist/twilight/{p-8dab94d8.entry.js → p-6ee096e8.entry.js} +1 -1
- package/dist/twilight/{p-c138132c.entry.js → p-723aeda4.entry.js} +1 -1
- package/dist/twilight/{p-c8c36233.entry.js → p-743b79ae.entry.js} +1 -1
- package/dist/twilight/{p-5f1b8510.entry.js → p-75e692d1.entry.js} +1 -1
- package/dist/twilight/{p-0895958b.entry.js → p-79444897.entry.js} +1 -1
- package/dist/twilight/{p-4e2e4e92.entry.js → p-7b23dec7.entry.js} +1 -1
- package/dist/twilight/p-7bb24ad6.entry.js +4 -0
- package/dist/twilight/{p-4c34e1fd.entry.js → p-7d9288b0.entry.js} +1 -1
- package/dist/twilight/{p-0ecbe43b.entry.js → p-85f95a58.entry.js} +1 -1
- package/dist/twilight/{p-2a9a4e12.entry.js → p-86a1f616.entry.js} +1 -1
- package/dist/twilight/{p-1bc7ab28.entry.js → p-87115499.entry.js} +1 -1
- package/dist/twilight/{p-497cc3a6.entry.js → p-878c2be2.entry.js} +1 -1
- package/dist/twilight/{p-524aabd2.entry.js → p-89e9a91f.entry.js} +1 -1
- package/dist/twilight/{p-f3771ebc.entry.js → p-90ee37c7.entry.js} +1 -1
- package/dist/twilight/{p-e4cb5ee8.entry.js → p-96584590.entry.js} +1 -1
- package/dist/twilight/{p-3136d942.entry.js → p-96a57e9c.entry.js} +1 -1
- package/dist/twilight/{p-7a17138f.entry.js → p-978e4164.entry.js} +1 -1
- package/dist/twilight/{p-b9b32feb.entry.js → p-97fc57c1.entry.js} +1 -1
- package/dist/twilight/p-98b1ff35.entry.js +4 -0
- package/dist/twilight/{p-5a26fb06.entry.js → p-9d18525b.entry.js} +1 -1
- package/dist/twilight/p-B83s3cRn.js +9 -0
- package/dist/twilight/{p-5UtJVEzd.js → p-BVqCTDsV.js} +1 -1
- package/dist/twilight/{p-5njrWPq2.js → p-CP29f7RQ.js} +2 -2
- package/dist/twilight/{p-CXv4fDWa.js → p-CS-t4QAX.js} +1 -1
- package/dist/twilight/{p-1YJa6YaH.js → p-Cluq3aDa.js} +1 -1
- package/dist/twilight/{p-yEKxvrPt.js → p-D-zqM6k8.js} +1 -1
- package/dist/twilight/{p-Dke2dnYe.js → p-DJmqmO68.js} +1 -1
- package/dist/twilight/{p-CkJpLPBM.js → p-DgwK96eP.js} +1 -1
- package/dist/twilight/p-DqXpn47Z.js +4 -0
- package/dist/twilight/p-DrXX8XG8.js +4 -0
- package/dist/twilight/{p-Cf5WZwC9.js → p-DzW3U8TR.js} +1 -1
- package/dist/twilight/{p-Dso9PQdO.js → p-JKh0XFIn.js} +1 -1
- package/dist/twilight/{p-64ee420e.entry.js → p-a347e701.entry.js} +1 -1
- package/dist/twilight/{p-271a2d55.entry.js → p-a5d08af6.entry.js} +1 -1
- package/dist/twilight/{p-fbb156e8.entry.js → p-a774f6f0.entry.js} +7 -7
- package/dist/twilight/p-afaa0fbe.entry.js +4 -0
- package/dist/twilight/p-b389b1d3.entry.js +4 -0
- package/dist/twilight/{p-3b0032e4.entry.js → p-b6d5ae9b.entry.js} +1 -1
- package/dist/twilight/{p-2d62c356.entry.js → p-b862c670.entry.js} +1 -1
- package/dist/twilight/{p-4e71dacc.entry.js → p-bab59319.entry.js} +1 -1
- package/dist/twilight/{p-16c09de9.entry.js → p-bf4c2184.entry.js} +1 -1
- package/dist/twilight/{p-b9477568.entry.js → p-c19cf93c.entry.js} +1 -1
- package/dist/twilight/{p-b16c1eac.entry.js → p-c34f8c08.entry.js} +1 -1
- package/dist/twilight/{p-d4e1a8f7.entry.js → p-c47ecca7.entry.js} +1 -1
- package/dist/twilight/{p-46d2375b.entry.js → p-c48f5c6b.entry.js} +1 -1
- package/dist/twilight/{p-1c049149.entry.js → p-c53c2f59.entry.js} +1 -1
- package/dist/twilight/{p-f5747d3c.entry.js → p-cd805a38.entry.js} +1 -1
- package/dist/twilight/{p-ac9a54cc.entry.js → p-cdd8ed7f.entry.js} +1 -1
- package/dist/twilight/{p-02df1c31.entry.js → p-ced4b7ac.entry.js} +1 -1
- package/dist/twilight/{p-21e9a475.entry.js → p-cf3365e2.entry.js} +1 -1
- package/dist/twilight/p-d78998b7.entry.js +4 -0
- package/dist/twilight/{p-bb7bc52f.entry.js → p-daea3207.entry.js} +1 -1
- package/dist/twilight/{p-6e766b2a.entry.js → p-dff6d623.entry.js} +1 -1
- package/dist/twilight/p-e04221de.entry.js +4 -0
- package/dist/twilight/{p-66448f0f.entry.js → p-e2934193.entry.js} +1 -1
- package/dist/twilight/{p-a9e276fa.entry.js → p-e3dab961.entry.js} +1 -1
- package/dist/twilight/{p-73607393.entry.js → p-e41e5fc7.entry.js} +1 -1
- package/dist/twilight/{p-fe222cbe.entry.js → p-e4c9cef4.entry.js} +1 -1
- package/dist/twilight/{p-a5afb821.entry.js → p-eaf9d536.entry.js} +1 -1
- package/dist/twilight/{p-c05513ae.entry.js → p-ee2b16d7.entry.js} +1 -1
- package/dist/twilight/{p-c224fa3a.entry.js → p-ee3ddc23.entry.js} +1 -1
- package/dist/twilight/{p-963d34af.entry.js → p-f0a14b18.entry.js} +1 -1
- package/dist/twilight/{p-4cff8533.entry.js → p-f195a63d.entry.js} +1 -1
- package/dist/twilight/{p-200a9c11.entry.js → p-f2c688d6.entry.js} +1 -1
- package/dist/twilight/{p-b7f1bad9.entry.js → p-f4ac8cae.entry.js} +1 -1
- package/dist/twilight/{p-1ee008c3.entry.js → p-f58d14ed.entry.js} +1 -1
- package/dist/twilight/{p-d505caaf.entry.js → p-f82cee0c.entry.js} +1 -1
- package/dist/twilight/{p-b639f062.entry.js → p-fa17989b.entry.js} +1 -1
- package/dist/twilight/{p-575b3b4c.entry.js → p-fbc075fe.entry.js} +1 -1
- package/dist/twilight/{p-f27472f4.entry.js → p-fc5d5473.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-attachment-view/salla-attachment-view.d.ts +47 -0
- package/dist/types/components/salla-attachments/salla-attachments.d.ts +73 -0
- package/dist/types/components/salla-comments/interfaces.d.ts +1 -0
- package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -1
- package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +127 -4
- package/dist/types/components/salla-file-upload/upload-limits.d.ts +49 -0
- package/dist/types/components/salla-rating-modal/rating-modal-media.d.ts +38 -0
- package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +30 -7
- package/dist/types/components/salla-review-factors-tags/helpers.d.ts +1 -1
- package/dist/types/components/salla-review-factors-tags/interfaces.d.ts +7 -0
- package/dist/types/components/salla-review-order-item/interfaces.d.ts +30 -0
- package/dist/types/components/salla-review-order-item/salla-review-order-item.d.ts +30 -0
- package/dist/types/components.d.ts +282 -7
- package/package.json +5 -5
- package/dist/twilight/p-3024f859.entry.js +0 -4
- package/dist/twilight/p-3b821dc9.entry.js +0 -4
- package/dist/twilight/p-4dabd999.entry.js +0 -4
- package/dist/twilight/p-WDLGvEaR.js +0 -9
- package/dist/twilight/p-aaa37ca1.entry.js +0 -4
- package/dist/twilight/p-dcf53c45.entry.js +0 -4
- package/dist/twilight/p-f17fa83f.entry.js +0 -4
- package/dist/components/{keyboard_arrow_right.js → keyboard_arrow_left.js} +6 -6
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import { h, Host } from "@stencil/core";
|
|
5
|
+
import { isVideoMimeType, isImageMimeType } from "../salla-file-upload/upload-limits";
|
|
6
|
+
import PlayIcon from "../../assets/svg/play-circle.svg";
|
|
7
|
+
/**
|
|
8
|
+
* Renders a horizontal strip of image/video attachment thumbnails with an
|
|
9
|
+
* optional "+N" overflow indicator on the last visible item. When `clickable`
|
|
10
|
+
* is true, opens `salla-attachment-view` when a thumbnail is clicked.
|
|
11
|
+
*
|
|
12
|
+
* Media can be supplied as:
|
|
13
|
+
* - `attachments` — full `{ id, url, mimeType?/type? }` objects
|
|
14
|
+
* - `images` / `videos` — URL string arrays
|
|
15
|
+
* - `rating` — object with `images` / `videos` arrays
|
|
16
|
+
* - `productRatings` + `productId` — match a product rating, else fall back to `rating`
|
|
17
|
+
*/
|
|
18
|
+
export class SallaAttachments {
|
|
19
|
+
constructor() {
|
|
20
|
+
/**
|
|
21
|
+
* Attachments to display. Accepts an array of `{ id, url, mimeType? }` or a
|
|
22
|
+
* JSON string of the same shape.
|
|
23
|
+
*/
|
|
24
|
+
this.attachments = [];
|
|
25
|
+
/**
|
|
26
|
+
* Image URLs to display. Accepts a string array or a JSON string.
|
|
27
|
+
*/
|
|
28
|
+
this.images = [];
|
|
29
|
+
/**
|
|
30
|
+
* Video URLs to display. Accepts a string array or a JSON string.
|
|
31
|
+
*/
|
|
32
|
+
this.videos = [];
|
|
33
|
+
/**
|
|
34
|
+
* Rating-like object with `images` / `videos` URL arrays. Used when
|
|
35
|
+
* `images`/`videos` are empty, and as a fallback when resolving
|
|
36
|
+
* `productRatings`.
|
|
37
|
+
*/
|
|
38
|
+
this.rating = null;
|
|
39
|
+
/**
|
|
40
|
+
* Product ratings list. When set with `productId`, the matching rating's
|
|
41
|
+
* media is preferred over `rating`.
|
|
42
|
+
*/
|
|
43
|
+
this.productRatings = [];
|
|
44
|
+
/**
|
|
45
|
+
* Product id used to match an entry in `productRatings`.
|
|
46
|
+
*/
|
|
47
|
+
this.productId = null;
|
|
48
|
+
/**
|
|
49
|
+
* Maximum number of thumbnails to show before displaying a "+N" overlay on
|
|
50
|
+
* the last visible item.
|
|
51
|
+
*/
|
|
52
|
+
this.maxVisible = 4;
|
|
53
|
+
/**
|
|
54
|
+
* When true, clicking a thumbnail opens the attachment lightbox.
|
|
55
|
+
*/
|
|
56
|
+
this.clickable = false;
|
|
57
|
+
}
|
|
58
|
+
parseJson(value, fallback) {
|
|
59
|
+
if (typeof value !== 'string') {
|
|
60
|
+
return (value ?? fallback);
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
return JSON.parse(value);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return fallback;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
parseStringList(value) {
|
|
70
|
+
const parsed = this.parseJson(value, []);
|
|
71
|
+
return Array.isArray(parsed) ? parsed.filter(url => typeof url === 'string' && url) : [];
|
|
72
|
+
}
|
|
73
|
+
parseMediaSource(value) {
|
|
74
|
+
if (!value)
|
|
75
|
+
return null;
|
|
76
|
+
const parsed = this.parseJson(value, null);
|
|
77
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : null;
|
|
78
|
+
}
|
|
79
|
+
parseMediaSourceList(value) {
|
|
80
|
+
const parsed = this.parseJson(value, []);
|
|
81
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
82
|
+
}
|
|
83
|
+
resolveMediaSource() {
|
|
84
|
+
const images = this.parseStringList(this.images);
|
|
85
|
+
const videos = this.parseStringList(this.videos);
|
|
86
|
+
if (images.length || videos.length) {
|
|
87
|
+
return { images, videos };
|
|
88
|
+
}
|
|
89
|
+
const rating = this.parseMediaSource(this.rating);
|
|
90
|
+
const productRatings = this.parseMediaSourceList(this.productRatings);
|
|
91
|
+
const productId = this.productId == null || this.productId === ''
|
|
92
|
+
? null
|
|
93
|
+
: String(this.productId);
|
|
94
|
+
if (productId && productRatings.length) {
|
|
95
|
+
const matched = productRatings.find(entry => entry?.product?.id != null && String(entry.product.id) === productId);
|
|
96
|
+
if (matched)
|
|
97
|
+
return matched;
|
|
98
|
+
}
|
|
99
|
+
return rating || { images: [], videos: [] };
|
|
100
|
+
}
|
|
101
|
+
mediaToAttachments(source) {
|
|
102
|
+
const images = (source.images || []).map(url => ({ type: 'image', url }));
|
|
103
|
+
const videos = (source.videos || []).map(url => ({ type: 'video', url }));
|
|
104
|
+
return [...images, ...videos];
|
|
105
|
+
}
|
|
106
|
+
getAttachments() {
|
|
107
|
+
let items = [];
|
|
108
|
+
if (typeof this.attachments === 'string') {
|
|
109
|
+
try {
|
|
110
|
+
const parsed = JSON.parse(this.attachments);
|
|
111
|
+
items = Array.isArray(parsed) ? parsed : [];
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
items = [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (Array.isArray(this.attachments)) {
|
|
118
|
+
items = this.attachments;
|
|
119
|
+
}
|
|
120
|
+
if (!items.length) {
|
|
121
|
+
items = this.mediaToAttachments(this.resolveMediaSource());
|
|
122
|
+
}
|
|
123
|
+
return items
|
|
124
|
+
.map((attachment, index) => this.normalizeAttachment(attachment, index))
|
|
125
|
+
.filter(attachment => this.isRenderableAttachment(attachment));
|
|
126
|
+
}
|
|
127
|
+
normalizeAttachment(attachment, index) {
|
|
128
|
+
const mimeType = attachment.mimeType || this.resolveMimeType(attachment.type, attachment.url);
|
|
129
|
+
return {
|
|
130
|
+
id: attachment.id || `attachment-${index}`,
|
|
131
|
+
url: attachment.url,
|
|
132
|
+
mimeType,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
resolveMimeType(type, url) {
|
|
136
|
+
if (type === 'image')
|
|
137
|
+
return 'image/jpeg';
|
|
138
|
+
if (type === 'video')
|
|
139
|
+
return 'video/mp4';
|
|
140
|
+
if (type?.includes('/'))
|
|
141
|
+
return type;
|
|
142
|
+
if (url && /\.(png|jpe?g|gif|webp|heic|heif)$/i.test(url))
|
|
143
|
+
return 'image/jpeg';
|
|
144
|
+
if (url && /\.(mp4|webm|mov|avi|mkv)$/i.test(url))
|
|
145
|
+
return 'video/mp4';
|
|
146
|
+
return type;
|
|
147
|
+
}
|
|
148
|
+
isRenderableAttachment(attachment) {
|
|
149
|
+
return isImageMimeType(attachment.mimeType, attachment.url)
|
|
150
|
+
|| isVideoMimeType(attachment.mimeType, attachment.url);
|
|
151
|
+
}
|
|
152
|
+
isVideo(attachment) {
|
|
153
|
+
return isVideoMimeType(attachment.mimeType, attachment.url);
|
|
154
|
+
}
|
|
155
|
+
openAt(index) {
|
|
156
|
+
if (!this.clickable)
|
|
157
|
+
return;
|
|
158
|
+
this.attachmentView?.open(index);
|
|
159
|
+
}
|
|
160
|
+
render() {
|
|
161
|
+
const items = this.getAttachments();
|
|
162
|
+
if (!items.length)
|
|
163
|
+
return null;
|
|
164
|
+
const visible = items.slice(0, this.maxVisible);
|
|
165
|
+
const remaining = items.length - this.maxVisible;
|
|
166
|
+
return (h(Host, null, h("div", { class: {
|
|
167
|
+
's-attachments': true,
|
|
168
|
+
'is-clickable': this.clickable,
|
|
169
|
+
} }, visible.map((attachment, index) => {
|
|
170
|
+
const isLastVisible = index === this.maxVisible - 1;
|
|
171
|
+
const showMoreOverlay = isLastVisible && remaining > 0;
|
|
172
|
+
const thumbProps = this.clickable
|
|
173
|
+
? { onClick: () => this.openAt(index) }
|
|
174
|
+
: {};
|
|
175
|
+
return this.isVideo(attachment)
|
|
176
|
+
? h("div", { key: attachment.id, class: "s-attachments-video-thumb", ...thumbProps }, h("video", { src: attachment.url, muted: true, playsInline: true, preload: "metadata" }), showMoreOverlay
|
|
177
|
+
? h("span", { class: "s-attachments-more-overlay" }, "+", remaining)
|
|
178
|
+
: h("span", { class: "s-attachments-video-thumb-play", innerHTML: PlayIcon }))
|
|
179
|
+
: h("div", { key: attachment.id, class: "s-attachments-image-thumb", ...thumbProps }, h("img", { src: attachment.url, alt: "" }), showMoreOverlay
|
|
180
|
+
? h("span", { class: "s-attachments-more-overlay" }, "+", remaining)
|
|
181
|
+
: null);
|
|
182
|
+
}), this.clickable && (h("salla-attachment-view", { ref: el => (this.attachmentView = el), attachments: items })))));
|
|
183
|
+
}
|
|
184
|
+
static get is() { return "salla-attachments"; }
|
|
185
|
+
static get originalStyleUrls() {
|
|
186
|
+
return {
|
|
187
|
+
"$": ["salla-attachments.scss"]
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
static get styleUrls() {
|
|
191
|
+
return {
|
|
192
|
+
"$": ["salla-attachments.css"]
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
static get properties() {
|
|
196
|
+
return {
|
|
197
|
+
"attachments": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"attribute": "attachments",
|
|
200
|
+
"mutable": false,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "Attachment[] | string",
|
|
203
|
+
"resolved": "Attachment[] | string",
|
|
204
|
+
"references": {
|
|
205
|
+
"Attachment": {
|
|
206
|
+
"location": "import",
|
|
207
|
+
"path": "../salla-attachment-view/salla-attachment-view",
|
|
208
|
+
"id": "src/components/salla-attachment-view/salla-attachment-view.tsx::Attachment"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"required": false,
|
|
213
|
+
"optional": false,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": "Attachments to display. Accepts an array of `{ id, url, mimeType? }` or a\nJSON string of the same shape."
|
|
217
|
+
},
|
|
218
|
+
"getter": false,
|
|
219
|
+
"setter": false,
|
|
220
|
+
"reflect": false,
|
|
221
|
+
"defaultValue": "[]"
|
|
222
|
+
},
|
|
223
|
+
"images": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"attribute": "images",
|
|
226
|
+
"mutable": false,
|
|
227
|
+
"complexType": {
|
|
228
|
+
"original": "string[] | string",
|
|
229
|
+
"resolved": "string | string[]",
|
|
230
|
+
"references": {}
|
|
231
|
+
},
|
|
232
|
+
"required": false,
|
|
233
|
+
"optional": false,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": "Image URLs to display. Accepts a string array or a JSON string."
|
|
237
|
+
},
|
|
238
|
+
"getter": false,
|
|
239
|
+
"setter": false,
|
|
240
|
+
"reflect": false,
|
|
241
|
+
"defaultValue": "[]"
|
|
242
|
+
},
|
|
243
|
+
"videos": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"attribute": "videos",
|
|
246
|
+
"mutable": false,
|
|
247
|
+
"complexType": {
|
|
248
|
+
"original": "string[] | string",
|
|
249
|
+
"resolved": "string | string[]",
|
|
250
|
+
"references": {}
|
|
251
|
+
},
|
|
252
|
+
"required": false,
|
|
253
|
+
"optional": false,
|
|
254
|
+
"docs": {
|
|
255
|
+
"tags": [],
|
|
256
|
+
"text": "Video URLs to display. Accepts a string array or a JSON string."
|
|
257
|
+
},
|
|
258
|
+
"getter": false,
|
|
259
|
+
"setter": false,
|
|
260
|
+
"reflect": false,
|
|
261
|
+
"defaultValue": "[]"
|
|
262
|
+
},
|
|
263
|
+
"rating": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"attribute": "rating",
|
|
266
|
+
"mutable": false,
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "MediaSource | string",
|
|
269
|
+
"resolved": "string | { images?: string[]; videos?: string[]; product?: { id?: string | number; }; }",
|
|
270
|
+
"references": {
|
|
271
|
+
"MediaSource": {
|
|
272
|
+
"location": "global",
|
|
273
|
+
"id": "global::MediaSource"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"required": false,
|
|
278
|
+
"optional": false,
|
|
279
|
+
"docs": {
|
|
280
|
+
"tags": [],
|
|
281
|
+
"text": "Rating-like object with `images` / `videos` URL arrays. Used when\n`images`/`videos` are empty, and as a fallback when resolving\n`productRatings`."
|
|
282
|
+
},
|
|
283
|
+
"getter": false,
|
|
284
|
+
"setter": false,
|
|
285
|
+
"reflect": false,
|
|
286
|
+
"defaultValue": "null"
|
|
287
|
+
},
|
|
288
|
+
"productRatings": {
|
|
289
|
+
"type": "string",
|
|
290
|
+
"attribute": "product-ratings",
|
|
291
|
+
"mutable": false,
|
|
292
|
+
"complexType": {
|
|
293
|
+
"original": "MediaSource[] | string",
|
|
294
|
+
"resolved": "MediaSource[] | string",
|
|
295
|
+
"references": {
|
|
296
|
+
"MediaSource": {
|
|
297
|
+
"location": "global",
|
|
298
|
+
"id": "global::MediaSource"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"required": false,
|
|
303
|
+
"optional": false,
|
|
304
|
+
"docs": {
|
|
305
|
+
"tags": [],
|
|
306
|
+
"text": "Product ratings list. When set with `productId`, the matching rating's\nmedia is preferred over `rating`."
|
|
307
|
+
},
|
|
308
|
+
"getter": false,
|
|
309
|
+
"setter": false,
|
|
310
|
+
"reflect": false,
|
|
311
|
+
"defaultValue": "[]"
|
|
312
|
+
},
|
|
313
|
+
"productId": {
|
|
314
|
+
"type": "any",
|
|
315
|
+
"attribute": "product-id",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "number | string",
|
|
319
|
+
"resolved": "number | string",
|
|
320
|
+
"references": {}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": false,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": "Product id used to match an entry in `productRatings`."
|
|
327
|
+
},
|
|
328
|
+
"getter": false,
|
|
329
|
+
"setter": false,
|
|
330
|
+
"reflect": false,
|
|
331
|
+
"defaultValue": "null"
|
|
332
|
+
},
|
|
333
|
+
"maxVisible": {
|
|
334
|
+
"type": "number",
|
|
335
|
+
"attribute": "max-visible",
|
|
336
|
+
"mutable": false,
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "number",
|
|
339
|
+
"resolved": "number",
|
|
340
|
+
"references": {}
|
|
341
|
+
},
|
|
342
|
+
"required": false,
|
|
343
|
+
"optional": false,
|
|
344
|
+
"docs": {
|
|
345
|
+
"tags": [],
|
|
346
|
+
"text": "Maximum number of thumbnails to show before displaying a \"+N\" overlay on\nthe last visible item."
|
|
347
|
+
},
|
|
348
|
+
"getter": false,
|
|
349
|
+
"setter": false,
|
|
350
|
+
"reflect": false,
|
|
351
|
+
"defaultValue": "4"
|
|
352
|
+
},
|
|
353
|
+
"clickable": {
|
|
354
|
+
"type": "boolean",
|
|
355
|
+
"attribute": "clickable",
|
|
356
|
+
"mutable": false,
|
|
357
|
+
"complexType": {
|
|
358
|
+
"original": "boolean",
|
|
359
|
+
"resolved": "boolean",
|
|
360
|
+
"references": {}
|
|
361
|
+
},
|
|
362
|
+
"required": false,
|
|
363
|
+
"optional": false,
|
|
364
|
+
"docs": {
|
|
365
|
+
"tags": [],
|
|
366
|
+
"text": "When true, clicking a thumbnail opens the attachment lightbox."
|
|
367
|
+
},
|
|
368
|
+
"getter": false,
|
|
369
|
+
"setter": false,
|
|
370
|
+
"reflect": false,
|
|
371
|
+
"defaultValue": "false"
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { Host, h } from "@stencil/core";
|
|
5
5
|
import CheckIcon from "../../assets/svg/check.svg";
|
|
6
6
|
import Reply from "../../assets/svg/reply.svg";
|
|
7
7
|
import ThumbsUp from "../../assets/svg/thumbs-up.svg";
|
|
@@ -15,6 +15,7 @@ export class SallaCommentItem {
|
|
|
15
15
|
this.has_order_trans = salla.lang.get('blocks.comments.has_order');
|
|
16
16
|
this.allowLikes = salla.config.get('store.settings.rating.allow_likes');
|
|
17
17
|
this.allowAttachImages = salla.config.get('store.settings.rating.allow_attach_images');
|
|
18
|
+
this.allowAttachVideos = salla.config.get('store.settings.rating.allow_attach_videos');
|
|
18
19
|
this.helpfulLabel = salla.lang.get('blocks.comments.helpful');
|
|
19
20
|
this.reviewDetailsLabel = salla.lang.get('blocks.comments.review_details');
|
|
20
21
|
this.likesCount = 0;
|
|
@@ -61,10 +62,15 @@ export class SallaCommentItem {
|
|
|
61
62
|
salla.log('Bad json for liked_comments');
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
;
|
|
65
65
|
getReplies() {
|
|
66
66
|
return Array.isArray(this.comment.replies) ? this.comment.replies : [this.comment.replies];
|
|
67
67
|
}
|
|
68
|
+
getImages() {
|
|
69
|
+
return this.allowAttachImages && Array.isArray(this.comment.images) ? this.comment.images : [];
|
|
70
|
+
}
|
|
71
|
+
getVideos() {
|
|
72
|
+
return this.allowAttachVideos && Array.isArray(this.comment.videos) ? this.comment.videos : [];
|
|
73
|
+
}
|
|
68
74
|
getDate(dateString) {
|
|
69
75
|
const [datePart] = dateString.split(' ');
|
|
70
76
|
const [year, month, day] = datePart.split('-');
|
|
@@ -146,6 +152,9 @@ export class SallaCommentItem {
|
|
|
146
152
|
return null;
|
|
147
153
|
}
|
|
148
154
|
let isAdmin = this.comment.type == 'admin';
|
|
155
|
+
const images = this.getImages();
|
|
156
|
+
const videos = this.getVideos();
|
|
157
|
+
const hasAttachments = images.length > 0 || videos.length > 0;
|
|
149
158
|
const reviewFactors = this.getReviewFactors();
|
|
150
159
|
const hasReviewFactors = reviewFactors.length > 0;
|
|
151
160
|
return (h(Host, { class: isAdmin ? 's-comments-item-admin' : 's-comments-item' }, h("div", { class: { "s-comments-item-wrapper": !isAdmin, "s-comments-item-admin-wrapper": isAdmin }, id: `s-comments-item-${this.comment.id}` }, h("div", { class: "s-comments-item-inner s-comments-flex-1" }, isAdmin && h("span", { class: "s-comments-item-reply-icon", innerHTML: Reply }), h("div", { class: "s-comments-item-avatar" }, h("img", { "data-src": this.comment?.avatar, alt: this.comment?.name, src: this.comment?.avatar, class: "s-comments-item-avatar-img lazy" })), h("div", { class: "s-comments-flex-1" }, h("div", { class: "s-comments-item-user-wrapper" }, h("div", { class: "s-comments-item-user-info" }, h("h3", { class: this.comment.is_pinned ? "s-comments-item-user-info-name" : "s-comments-item-user-info-name-with-margin" }, this.comment?.name), this.comment.is_pinned ?
|
|
@@ -157,7 +166,7 @@ export class SallaCommentItem {
|
|
|
157
166
|
: null), h("p", { class: "s-comments-item-timestamp s-ltr" }, this.getDate(this.comment.created_at?.date), h("span", { class: "s-comments-item-time" }, " - ", this.getTime(this.comment.created_at?.date)))), (!!this.comment.rating || !!this.comment.stars || hasReviewFactors) && (h("div", { class: "flex flex-row gap-4 mt-2 mb-4" }, (!!this.comment.rating || !!this.comment.stars) ? (h("salla-rating-stars", { class: "w-auto", size: "medium", value: this.comment.rating || this.comment.stars })) : null, hasReviewFactors && (h("button", { class: "s-comments-item-review-factors-toggle", type: "button", onClick: () => (this.showReviewFactors = !this.showReviewFactors) }, h("span", null, this.reviewDetailsLabel), h("span", { class: {
|
|
158
167
|
"s-comments-item-review-factors-chevron": true,
|
|
159
168
|
"is-open": this.showReviewFactors,
|
|
160
|
-
} }, "\u2303"))))), h("div", { class: "s-comments-item-content" }, hasReviewFactors && this.showReviewFactors && (h("salla-comment-factors", { factors: reviewFactors })), h("div", { class: "s-comments-item-content-container" }, this.isPrivateComment(this.comment) ? (h("div", { id: `s-comments-item-${this.comment.id}-locked-icon`, class: "s-comments-item-pinned-icon" }, this.LockedIcon())) : null, h("p", { innerHTML: this.comment.content })), this.isPrivateComment(this.comment) ? (h("salla-tooltip", { text: this.locked_trans, targetId: `s-comments-item-${this.comment.id}-locked-icon` })) : null,
|
|
169
|
+
} }, "\u2303"))))), h("div", { class: "s-comments-item-content" }, hasReviewFactors && this.showReviewFactors && (h("salla-comment-factors", { factors: reviewFactors })), h("div", { class: "s-comments-item-content-container" }, this.isPrivateComment(this.comment) ? (h("div", { id: `s-comments-item-${this.comment.id}-locked-icon`, class: "s-comments-item-pinned-icon" }, this.LockedIcon())) : null, h("p", { innerHTML: this.comment.content })), this.isPrivateComment(this.comment) ? (h("salla-tooltip", { text: this.locked_trans, targetId: `s-comments-item-${this.comment.id}-locked-icon` })) : null, hasAttachments && (h("div", { class: "mt-6 mb-4" }, h("salla-attachments", { images: images, videos: videos, clickable: true }))), this.allowLikes && !isAdmin && !!this.comment.id && salla.url.is_page('product.single') ? h("salla-button", { ref: el => this.likeBtn = el, class: `s-comments-item-like-btn ${this.likedComments.includes(this.comment.id) ? 'liked' : ''}`, loaderPosition: 'center', fill: 'outline', size: 'small', onClick: () => this.toggleLike() }, h("span", null, this.helpfulLabel, " ", this.likesCount > 0 ? `(${this.likesCount})` : ''), h("span", { innerHTML: ThumbsUp })) : '', this.comment.is_pending ?
|
|
161
170
|
h("span", { class: "s-comments-item-pending-text" }, this.waiting_approval_trans) : null))), !!this.getReplies().length && !isAdmin ?
|
|
162
171
|
this.getReplies().map((reply) => {
|
|
163
172
|
return h("div", null, h("salla-comment-item", { comment: reply }));
|
|
@@ -234,6 +243,7 @@ export class SallaCommentItem {
|
|
|
234
243
|
"has_order_trans": {},
|
|
235
244
|
"allowLikes": {},
|
|
236
245
|
"allowAttachImages": {},
|
|
246
|
+
"allowAttachVideos": {},
|
|
237
247
|
"helpfulLabel": {},
|
|
238
248
|
"reviewDetailsLabel": {},
|
|
239
249
|
"likesCount": {},
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
salla-comment-item .s-comments-flex-1 {
|
|
6
|
+
min-width: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.s-comments-item-review-factors-toggle {
|
|
6
10
|
display: inline-flex;
|
|
7
11
|
align-items: center;
|
|
@@ -120,6 +124,9 @@
|
|
|
120
124
|
.mt-2 {
|
|
121
125
|
margin-top: 0.5rem;
|
|
122
126
|
}
|
|
127
|
+
.mt-6 {
|
|
128
|
+
margin-top: 1.5rem;
|
|
129
|
+
}
|
|
123
130
|
.flex {
|
|
124
131
|
display: flex;
|
|
125
132
|
}
|
|
@@ -879,7 +879,7 @@ export class SallaDatetimePicker {
|
|
|
879
879
|
"mutable": false,
|
|
880
880
|
"complexType": {
|
|
881
881
|
"original": "LocaleKey",
|
|
882
|
-
"resolved": "\"at\" | \"hr\" | \"th\" | \"tr\" | \"id\" | \"is\" | \"default\" | \"no\" | \"cy\" | \"es\" | \"ar\" | \"az\" | \"be\" | \"bg\" | \"bn\" | \"bs\" | \"ca\" | \"cat\" | \"ckb\" | \"cs\" | \"da\" | \"de\" | \"en\" | \"eo\" | \"et\" | \"fa\" | \"fi\" | \"fo\" | \"fr\" | \"gr\" | \"he\" | \"hi\" | \"hu\" | \"hy\" | \"it\" | \"ja\" | \"ka\" | \"ko\" | \"km\" | \"kz\" | \"lt\" | \"lv\" | \"mk\" | \"
|
|
882
|
+
"resolved": "\"at\" | \"hr\" | \"th\" | \"tr\" | \"id\" | \"is\" | \"default\" | \"no\" | \"cy\" | \"es\" | \"mn\" | \"ms\" | \"ar\" | \"az\" | \"be\" | \"bg\" | \"bn\" | \"bs\" | \"ca\" | \"cat\" | \"ckb\" | \"cs\" | \"da\" | \"de\" | \"en\" | \"eo\" | \"et\" | \"fa\" | \"fi\" | \"fo\" | \"fr\" | \"gr\" | \"he\" | \"hi\" | \"hu\" | \"hy\" | \"it\" | \"ja\" | \"ka\" | \"ko\" | \"km\" | \"kz\" | \"lt\" | \"lv\" | \"mk\" | \"my\" | \"nl\" | \"nn\" | \"pa\" | \"pl\" | \"pt\" | \"ro\" | \"ru\" | \"si\" | \"sk\" | \"sl\" | \"sq\" | \"sr\" | \"sv\" | \"uk\" | \"vn\" | \"zh\" | \"uz\" | \"uz_latn\" | \"zh_tw\"",
|
|
883
883
|
"references": {
|
|
884
884
|
"LocaleKey": {
|
|
885
885
|
"location": "import",
|
|
@@ -223,6 +223,138 @@
|
|
|
223
223
|
display: -webkit-box;
|
|
224
224
|
-webkit-box-orient: vertical;
|
|
225
225
|
}
|
|
226
|
+
.s-file-upload-has-gallery.s-file-upload-multiple .filepond--list-scroller {
|
|
227
|
+
display: none !important;
|
|
228
|
+
}
|
|
229
|
+
.s-file-upload-has-gallery.s-file-upload-multiple .filepond--drop-label:not(.s-hidden) {
|
|
230
|
+
cursor: pointer;
|
|
231
|
+
}
|
|
232
|
+
.s-file-upload-has-gallery.s-file-upload-multiple.s-file-upload-at-max .filepond--root {
|
|
233
|
+
min-height: 120px;
|
|
234
|
+
}
|
|
235
|
+
.s-file-upload-has-gallery.s-file-upload-multiple .filepond--drop-label.s-file-upload-drop-label-disabled {
|
|
236
|
+
visibility: visible !important;
|
|
237
|
+
opacity: 0.55 !important;
|
|
238
|
+
transform: none !important;
|
|
239
|
+
height: auto !important;
|
|
240
|
+
min-height: 4.75em !important;
|
|
241
|
+
pointer-events: none !important;
|
|
242
|
+
cursor: not-allowed;
|
|
243
|
+
}
|
|
244
|
+
.s-file-upload-has-gallery.s-file-upload-multiple .filepond--drop-label.s-file-upload-drop-label-disabled label {
|
|
245
|
+
opacity: 1 !important;
|
|
246
|
+
}
|
|
247
|
+
.s-file-upload-wrapper .filepond--root[data-disabled] .filepond--drop-label label {
|
|
248
|
+
opacity: 0.55;
|
|
249
|
+
}
|
|
250
|
+
.s-file-upload-gallery {
|
|
251
|
+
--s-file-upload-preview-size: 75px;
|
|
252
|
+
--s-file-upload-remove-size: 18px;
|
|
253
|
+
--s-file-upload-remove-icon-size: 10px;
|
|
254
|
+
--s-file-upload-gallery-gap: 12px;
|
|
255
|
+
position: relative;
|
|
256
|
+
margin-top: 0.5rem;
|
|
257
|
+
padding-top: calc(var(--s-file-upload-remove-size) / 2);
|
|
258
|
+
padding-inline-end: calc(var(--s-file-upload-remove-size) / 2);
|
|
259
|
+
overflow: visible;
|
|
260
|
+
}
|
|
261
|
+
.s-file-upload-gallery-track {
|
|
262
|
+
display: flex;
|
|
263
|
+
gap: var(--s-file-upload-gallery-gap);
|
|
264
|
+
width: 100%;
|
|
265
|
+
min-height: var(--s-file-upload-preview-size);
|
|
266
|
+
overflow-x: auto;
|
|
267
|
+
overflow-y: hidden;
|
|
268
|
+
scrollbar-width: thin;
|
|
269
|
+
padding-bottom: 0.25rem;
|
|
270
|
+
}
|
|
271
|
+
.s-file-upload-gallery-item {
|
|
272
|
+
position: relative;
|
|
273
|
+
display: block;
|
|
274
|
+
width: var(--s-file-upload-preview-size);
|
|
275
|
+
height: var(--s-file-upload-preview-size);
|
|
276
|
+
flex-shrink: 0;
|
|
277
|
+
overflow: visible;
|
|
278
|
+
}
|
|
279
|
+
.s-file-upload-gallery-thumb {
|
|
280
|
+
width: var(--s-file-upload-preview-size);
|
|
281
|
+
height: var(--s-file-upload-preview-size);
|
|
282
|
+
aspect-ratio: 1/1;
|
|
283
|
+
border-radius: 0.375rem;
|
|
284
|
+
overflow: hidden;
|
|
285
|
+
background-color: #f3f4f6;
|
|
286
|
+
cursor: pointer;
|
|
287
|
+
position: relative;
|
|
288
|
+
border: 1px solid #e5e7eb;
|
|
289
|
+
box-sizing: border-box;
|
|
290
|
+
}
|
|
291
|
+
.s-file-upload-gallery-thumb.is-processing {
|
|
292
|
+
opacity: 0.7;
|
|
293
|
+
}
|
|
294
|
+
.s-file-upload-gallery-thumb img {
|
|
295
|
+
display: block;
|
|
296
|
+
width: 100%;
|
|
297
|
+
height: 100%;
|
|
298
|
+
aspect-ratio: 1/1;
|
|
299
|
+
object-fit: cover;
|
|
300
|
+
}
|
|
301
|
+
.s-file-upload-gallery-thumb video.s-file-upload-gallery-video-thumb {
|
|
302
|
+
display: block;
|
|
303
|
+
width: 100%;
|
|
304
|
+
height: 100%;
|
|
305
|
+
aspect-ratio: 1/1;
|
|
306
|
+
object-fit: cover;
|
|
307
|
+
pointer-events: none;
|
|
308
|
+
}
|
|
309
|
+
.s-file-upload-gallery-remove {
|
|
310
|
+
position: absolute;
|
|
311
|
+
top: 0;
|
|
312
|
+
inset-inline-end: 0;
|
|
313
|
+
inset-inline-start: auto;
|
|
314
|
+
z-index: 5;
|
|
315
|
+
display: flex;
|
|
316
|
+
align-items: center;
|
|
317
|
+
justify-content: center;
|
|
318
|
+
width: var(--s-file-upload-remove-size);
|
|
319
|
+
height: var(--s-file-upload-remove-size);
|
|
320
|
+
padding: 0;
|
|
321
|
+
line-height: 1;
|
|
322
|
+
border-radius: 9999px;
|
|
323
|
+
background-color: #fff;
|
|
324
|
+
border: 1px solid #9ca3af;
|
|
325
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
|
|
326
|
+
cursor: pointer;
|
|
327
|
+
}
|
|
328
|
+
.s-file-upload-gallery-remove:hover {
|
|
329
|
+
background-color: #f9fafb;
|
|
330
|
+
}
|
|
331
|
+
.s-file-upload-gallery-remove svg {
|
|
332
|
+
display: block;
|
|
333
|
+
width: var(--s-file-upload-remove-icon-size);
|
|
334
|
+
height: var(--s-file-upload-remove-icon-size);
|
|
335
|
+
fill: #1f2937;
|
|
336
|
+
pointer-events: none;
|
|
337
|
+
}
|
|
338
|
+
.s-file-upload-gallery-video-icon {
|
|
339
|
+
position: absolute;
|
|
340
|
+
inset: 0;
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
345
|
+
pointer-events: none;
|
|
346
|
+
}
|
|
347
|
+
.s-file-upload-gallery-video-icon svg {
|
|
348
|
+
width: calc(var(--s-file-upload-preview-size) * 0.28);
|
|
349
|
+
height: calc(var(--s-file-upload-preview-size) * 0.28);
|
|
350
|
+
max-width: 2rem;
|
|
351
|
+
max-height: 2rem;
|
|
352
|
+
fill: #fff;
|
|
353
|
+
opacity: 0.9;
|
|
354
|
+
}
|
|
355
|
+
.visible{
|
|
356
|
+
visibility: visible;
|
|
357
|
+
}
|
|
226
358
|
.fixed{
|
|
227
359
|
position: fixed;
|
|
228
360
|
}
|
|
@@ -238,12 +370,29 @@
|
|
|
238
370
|
.resize{
|
|
239
371
|
resize: both;
|
|
240
372
|
}
|
|
373
|
+
.ps-2{
|
|
374
|
+
padding-inline-start: 0.5rem;
|
|
375
|
+
}
|
|
241
376
|
.filter{
|
|
242
377
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
243
378
|
}
|
|
244
379
|
.s-hidden{
|
|
245
380
|
display: none;
|
|
246
381
|
}
|
|
382
|
+
.s-scrollbar::-webkit-scrollbar{
|
|
383
|
+
width: 5px;
|
|
384
|
+
}
|
|
385
|
+
.s-scrollbar::-webkit-scrollbar-track{
|
|
386
|
+
background-color: #eee;
|
|
387
|
+
}
|
|
388
|
+
.s-scrollbar::-webkit-scrollbar-thumb{
|
|
389
|
+
background-color: var(--color-primary);
|
|
390
|
+
border-radius: 10px;
|
|
391
|
+
-webkit-border-radius: 10px;
|
|
392
|
+
-moz-border-radius: 10px;
|
|
393
|
+
-ms-border-radius: 10px;
|
|
394
|
+
-o-border-radius: 10px;
|
|
395
|
+
}
|
|
247
396
|
.s-file-upload-wrapper .filepond--drop-label{
|
|
248
397
|
height: 100%;
|
|
249
398
|
cursor: pointer;
|