@salla.sa/twilight-components 2.14.489 → 2.14.490

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.
Files changed (401) hide show
  1. package/dist/cjs/{filepond-C-1J1qrF.js → filepond-DMNwZGDe.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-B8fUrKqJ.js → filepond-plugin-file-poster-CwJqn9cv.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-BJ4Bw3Ju.js → filepond-plugin-file-validate-size-D8HCq_yt.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-D_Smjf6h.js → filepond-plugin-file-validate-type-DZHIztrf.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BDZBDL-U.js → filepond-plugin-image-edit-DtW6aab5.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-B68mU2op.js → filepond-plugin-image-exif-orientation-DlHuggE7.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-B2RzZ9r9.js → filepond-plugin-image-preview-rSt0R5Fs.js} +1 -1
  8. package/dist/cjs/{functions-DdZX56J7.js → functions-Cl4vQLXn.js} +1 -1
  9. package/dist/cjs/{index-DWea49r_.js → index-CfrGmYJa.js} +17 -5
  10. package/dist/cjs/{index-B5CW9Xve.js → index-CrTL2nRh.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +5 -5
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-factors.cjs.entry.js +45 -0
  27. package/dist/cjs/salla-comment-form_8.cjs.entry.js +112 -30
  28. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  52. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  53. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-options-modal_3.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1060 -0
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +38 -14
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +127 -0
  88. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +6 -6
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  96. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  102. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  105. package/dist/cjs/shipping-fast-CsqEQE78.js +13 -0
  106. package/dist/{esm/star-ZT7ehBBk.js → cjs/star-DMzrN05M.js} +4 -2
  107. package/dist/cjs/{tracked-promise-DNxhV4_1.js → tracked-promise-ClJBjg9o.js} +1 -1
  108. package/dist/cjs/twilight.cjs.js +2 -2
  109. package/dist/cjs/{vanilla-picker-ClijNDRd.js → vanilla-picker-um8NlppX.js} +1 -1
  110. package/dist/collection/collection-manifest.json +3 -0
  111. package/dist/collection/components/salla-comments/salla-comment-factors.js +76 -0
  112. package/dist/collection/components/salla-comments/salla-comment-item.js +20 -6
  113. package/dist/collection/components/salla-comments/salla-comments.css +110 -0
  114. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +1203 -0
  115. package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +112 -1
  116. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +33 -2
  117. package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +34 -1
  118. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +117 -16
  119. package/dist/collection/components/salla-review-factors-tags/helpers.js +86 -0
  120. package/dist/collection/components/salla-review-factors-tags/interfaces.js +1 -0
  121. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.css +41 -0
  122. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +135 -0
  123. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  124. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  125. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.css +60 -0
  126. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +12 -2
  127. package/dist/collection/components/salla-search/salla-search.js +5 -5
  128. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  129. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  130. package/dist/collection/components/salla-social/salla-social.js +1 -1
  131. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  132. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  133. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  134. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  135. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  136. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  137. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  138. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  139. package/dist/components/index.js +3 -3
  140. package/dist/components/salla-comment-factors.d.ts +11 -0
  141. package/dist/components/salla-comment-factors.js +9 -0
  142. package/dist/components/salla-comment-factors2.js +66 -0
  143. package/dist/components/salla-comment-item2.js +29 -9
  144. package/dist/components/salla-comments.js +9 -3
  145. package/dist/components/salla-rating-modal-v2.d.ts +11 -0
  146. package/dist/components/salla-rating-modal-v2.js +9 -0
  147. package/dist/components/salla-rating-modal-v22.js +1149 -0
  148. package/dist/components/salla-rating-modal.js +49 -19
  149. package/dist/components/salla-rating-stars2.js +80 -17
  150. package/dist/components/salla-review-factors-tags.d.ts +11 -0
  151. package/dist/components/salla-review-factors-tags.js +149 -0
  152. package/dist/components/salla-reviews-page.js +1 -1
  153. package/dist/components/salla-reviews-summary2.js +13 -3
  154. package/dist/components/salla-reviews.js +1 -1
  155. package/dist/components/salla-search.js +5 -5
  156. package/dist/components/salla-searchable-dropdown2.js +4 -4
  157. package/dist/components/salla-skeleton2.js +1 -1
  158. package/dist/components/salla-social-share2.js +1 -1
  159. package/dist/components/salla-social.js +1 -1
  160. package/dist/components/salla-tab-content2.js +1 -1
  161. package/dist/components/salla-tab-header2.js +1 -1
  162. package/dist/components/salla-tabs2.js +1 -1
  163. package/dist/components/salla-tel-input2.js +1 -1
  164. package/dist/components/salla-tooltip2.js +1 -1
  165. package/dist/components/salla-user-settings.js +1 -1
  166. package/dist/components/salla-wishlist-actions.js +1 -1
  167. package/dist/esm/{filepond-z2hEBvHC.js → filepond-Cg7o_vnN.js} +1 -1
  168. package/dist/esm/{filepond-plugin-file-poster-B9sxi6Yz.js → filepond-plugin-file-poster-BJ1q5i_Q.js} +1 -1
  169. package/dist/esm/{filepond-plugin-file-validate-size-HWpVatr_.js → filepond-plugin-file-validate-size-KAp2gG4p.js} +1 -1
  170. package/dist/esm/{filepond-plugin-file-validate-type-SgpUhQB_.js → filepond-plugin-file-validate-type-D6KC6aKt.js} +1 -1
  171. package/dist/esm/{filepond-plugin-image-edit-0F90Q6lM.js → filepond-plugin-image-edit-CsviUA8z.js} +1 -1
  172. package/dist/esm/{filepond-plugin-image-exif-orientation-CXJDp_1v.js → filepond-plugin-image-exif-orientation-DORQxh2z.js} +1 -1
  173. package/dist/esm/{filepond-plugin-image-preview-APl1nt4k.js → filepond-plugin-image-preview-DiN_MPtQ.js} +1 -1
  174. package/dist/esm/{functions-BCdJLPcs.js → functions-ChcWts7Y.js} +1 -1
  175. package/dist/esm/{index-DNWyGkAx.js → index-DkTbP5UX.js} +17 -5
  176. package/dist/esm/{index-DhwQVX77.js → index-nv62Rr6s.js} +1 -1
  177. package/dist/esm/loader.js +3 -3
  178. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  179. package/dist/esm/salla-accordion_6.entry.js +1 -1
  180. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  181. package/dist/esm/salla-advertisement.entry.js +1 -1
  182. package/dist/esm/salla-alert_2.entry.js +1 -1
  183. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  184. package/dist/esm/salla-apps-icons.entry.js +1 -1
  185. package/dist/esm/salla-badge.entry.js +1 -1
  186. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  187. package/dist/esm/salla-bullet-delivery_2.entry.js +5 -5
  188. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  189. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  190. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  191. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  192. package/dist/esm/salla-comment-factors.entry.js +43 -0
  193. package/dist/esm/salla-comment-form_8.entry.js +112 -30
  194. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  195. package/dist/esm/salla-contacts.entry.js +1 -1
  196. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  197. package/dist/esm/salla-count-down.entry.js +1 -1
  198. package/dist/esm/salla-custom-fields.entry.js +1 -1
  199. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  200. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  201. package/dist/esm/salla-filters-widget.entry.js +1 -1
  202. package/dist/esm/salla-filters.entry.js +1 -1
  203. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  204. package/dist/esm/salla-gifting.entry.js +1 -1
  205. package/dist/esm/salla-hook.entry.js +1 -1
  206. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  207. package/dist/esm/salla-installment.entry.js +1 -1
  208. package/dist/esm/salla-list-tile.entry.js +1 -1
  209. package/dist/esm/salla-localization-modal.entry.js +1 -1
  210. package/dist/esm/salla-login-modal.entry.js +1 -1
  211. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  212. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  213. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  214. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  215. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  216. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  217. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  218. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  219. package/dist/esm/salla-loyalty.entry.js +1 -1
  220. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  221. package/dist/esm/salla-map_2.entry.js +1 -1
  222. package/dist/esm/salla-menu.entry.js +1 -1
  223. package/dist/esm/salla-metadata.entry.js +1 -1
  224. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  225. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  226. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  227. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  228. package/dist/esm/salla-notification-item.entry.js +1 -1
  229. package/dist/esm/salla-notifications.entry.js +1 -1
  230. package/dist/esm/salla-offer-modal.entry.js +1 -1
  231. package/dist/esm/salla-offer.entry.js +1 -1
  232. package/dist/esm/salla-order-branch.entry.js +1 -1
  233. package/dist/esm/salla-order-cancel.entry.js +1 -1
  234. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  235. package/dist/esm/salla-order-details-options.entry.js +1 -1
  236. package/dist/esm/salla-order-details.entry.js +1 -1
  237. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  238. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  239. package/dist/esm/salla-order-edit.entry.js +1 -1
  240. package/dist/esm/salla-order-options-modal_3.entry.js +1 -1
  241. package/dist/esm/salla-order-summary.entry.js +1 -1
  242. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  243. package/dist/esm/salla-orders.entry.js +1 -1
  244. package/dist/esm/salla-payments.entry.js +1 -1
  245. package/dist/esm/salla-placeholder.entry.js +1 -1
  246. package/dist/esm/salla-price-range.entry.js +1 -1
  247. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  248. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  249. package/dist/esm/salla-products-list.entry.js +1 -1
  250. package/dist/esm/salla-quick-order.entry.js +1 -1
  251. package/dist/esm/salla-rating-modal-v2.entry.js +1058 -0
  252. package/dist/esm/salla-rating-modal.entry.js +36 -12
  253. package/dist/esm/salla-review-factors-tags.entry.js +125 -0
  254. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  255. package/dist/esm/salla-scopes.entry.js +1 -1
  256. package/dist/esm/salla-search.entry.js +6 -6
  257. package/dist/esm/salla-skeleton.entry.js +2 -2
  258. package/dist/esm/salla-slider.entry.js +1 -1
  259. package/dist/esm/salla-social-share.entry.js +2 -2
  260. package/dist/esm/salla-social.entry.js +2 -2
  261. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  262. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  263. package/dist/esm/salla-tooltip.entry.js +2 -2
  264. package/dist/esm/salla-trust-badges.entry.js +1 -1
  265. package/dist/esm/salla-user-menu.entry.js +5 -5
  266. package/dist/esm/salla-user-profile.entry.js +1 -1
  267. package/dist/esm/salla-user-settings.entry.js +2 -2
  268. package/dist/esm/salla-verify.entry.js +1 -1
  269. package/dist/esm/salla-wallet.entry.js +1 -1
  270. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  271. package/dist/esm/shipping-fast-lMgMt31Q.js +11 -0
  272. package/dist/{cjs/star-DGcH7Yso.js → esm/star-CeFAfcTv.js} +2 -4
  273. package/dist/esm/{tracked-promise-CjtqaGP2.js → tracked-promise-BhGtlRVb.js} +1 -1
  274. package/dist/esm/twilight.js +3 -3
  275. package/dist/esm/{vanilla-picker-DPMDb9SB.js → vanilla-picker-CBI_4fLe.js} +1 -1
  276. package/dist/twilight/{p-61813e83.entry.js → p-01240db4.entry.js} +1 -1
  277. package/dist/twilight/{p-90534314.entry.js → p-01cd2407.entry.js} +1 -1
  278. package/dist/twilight/{p-40407996.entry.js → p-02b365bd.entry.js} +1 -1
  279. package/dist/twilight/p-03ab9920.entry.js +4 -0
  280. package/dist/twilight/{p-b5d32897.entry.js → p-03cc6665.entry.js} +1 -1
  281. package/dist/twilight/{p-f9192741.entry.js → p-0a32b0d6.entry.js} +1 -1
  282. package/dist/twilight/{p-1aeeb0f0.entry.js → p-0de58301.entry.js} +1 -1
  283. package/dist/twilight/{p-da66f939.entry.js → p-0e0db003.entry.js} +1 -1
  284. package/dist/twilight/{p-e9cdcf2f.entry.js → p-0f853d19.entry.js} +1 -1
  285. package/dist/twilight/{p-991b1e85.entry.js → p-0f859745.entry.js} +1 -1
  286. package/dist/twilight/{p-26faf85e.entry.js → p-0ff0a5cd.entry.js} +1 -1
  287. package/dist/twilight/{p-fa5fa155.entry.js → p-111e8bd4.entry.js} +1 -1
  288. package/dist/twilight/{p-160fc21e.entry.js → p-1182a8df.entry.js} +1 -1
  289. package/dist/twilight/{p-46cd5ece.entry.js → p-121dc015.entry.js} +1 -1
  290. package/dist/twilight/{p-1a957d13.entry.js → p-15bc19e7.entry.js} +1 -1
  291. package/dist/twilight/{p-5171b440.entry.js → p-18dada14.entry.js} +1 -1
  292. package/dist/twilight/{p-14f8ba23.entry.js → p-1a3e548c.entry.js} +1 -1
  293. package/dist/twilight/{p-7fb92e0b.entry.js → p-1f43ed62.entry.js} +1 -1
  294. package/dist/twilight/{p-3e7a3c6e.entry.js → p-2414aef5.entry.js} +1 -1
  295. package/dist/twilight/{p-3ce46edf.entry.js → p-25bfec19.entry.js} +1 -1
  296. package/dist/twilight/{p-f14fe365.entry.js → p-26211933.entry.js} +1 -1
  297. package/dist/twilight/{p-4ab4e5ea.entry.js → p-2656742a.entry.js} +1 -1
  298. package/dist/twilight/{p-aaf7cbb1.entry.js → p-26594c13.entry.js} +1 -1
  299. package/dist/twilight/{p-06966ed6.entry.js → p-271b69a0.entry.js} +1 -1
  300. package/dist/twilight/{p-9fc965a7.entry.js → p-27ae0022.entry.js} +1 -1
  301. package/dist/twilight/{p-85fc94be.entry.js → p-28318fdf.entry.js} +1 -1
  302. package/dist/twilight/{p-8fec15f8.entry.js → p-28636b6b.entry.js} +1 -1
  303. package/dist/twilight/{p-1efc0eed.entry.js → p-2b6f45d9.entry.js} +1 -1
  304. package/dist/twilight/{p-6852162e.entry.js → p-2bcfed29.entry.js} +1 -1
  305. package/dist/twilight/{p-082f3913.entry.js → p-2e2d9a86.entry.js} +1 -1
  306. package/dist/twilight/{p-78f161f2.entry.js → p-31c63840.entry.js} +1 -1
  307. package/dist/twilight/{p-edc4193f.entry.js → p-38e6442f.entry.js} +1 -1
  308. package/dist/twilight/p-3956807e.entry.js +4 -0
  309. package/dist/twilight/{p-6sBYUIya.js → p-495aeIVH.js} +1 -1
  310. package/dist/twilight/{p-12ccff98.entry.js → p-4b659dd8.entry.js} +1 -1
  311. package/dist/twilight/{p-43a2f42e.entry.js → p-51be1247.entry.js} +1 -1
  312. package/dist/twilight/{p-6ab60f90.entry.js → p-556550d6.entry.js} +1 -1
  313. package/dist/twilight/{p-844c6c1f.entry.js → p-57926552.entry.js} +1 -1
  314. package/dist/twilight/{p-7a0d2f4d.entry.js → p-583b37a5.entry.js} +1 -1
  315. package/dist/twilight/{p-c9aa80c3.entry.js → p-5932a5aa.entry.js} +1 -1
  316. package/dist/twilight/{p-094dcf0c.entry.js → p-5cd89a8e.entry.js} +1 -1
  317. package/dist/twilight/{p-56365c64.entry.js → p-6c74b5a4.entry.js} +1 -1
  318. package/dist/twilight/{p-6891f00b.entry.js → p-7092d5e9.entry.js} +1 -1
  319. package/dist/twilight/{p-b0d5084c.entry.js → p-7331a7d0.entry.js} +1 -1
  320. package/dist/twilight/{p-de942889.entry.js → p-75b9780f.entry.js} +1 -1
  321. package/dist/twilight/{p-ed02b506.entry.js → p-75d071f5.entry.js} +1 -1
  322. package/dist/twilight/{p-5b989746.entry.js → p-78364b26.entry.js} +1 -1
  323. package/dist/twilight/{p-d3f3eed5.entry.js → p-7869e2b4.entry.js} +1 -1
  324. package/dist/twilight/{p-24127075.entry.js → p-789ede46.entry.js} +1 -1
  325. package/dist/twilight/{p-f2e9d83b.entry.js → p-7cb04076.entry.js} +1 -1
  326. package/dist/twilight/{p-6e7a6f4b.entry.js → p-7fa40598.entry.js} +1 -1
  327. package/dist/twilight/{p-f8933bd5.entry.js → p-8430e33c.entry.js} +1 -1
  328. package/dist/twilight/p-8549ed85.entry.js +4 -0
  329. package/dist/twilight/{p-f6d6dada.entry.js → p-88bc9aff.entry.js} +1 -1
  330. package/dist/twilight/{p-c4c32432.entry.js → p-8d83987b.entry.js} +1 -1
  331. package/dist/twilight/{p-9474d525.entry.js → p-956be35f.entry.js} +1 -1
  332. package/dist/twilight/{p-f2dbde1c.entry.js → p-9c27c468.entry.js} +1 -1
  333. package/dist/twilight/{p-Ca18LMTl.js → p-B4xPvvKC.js} +1 -1
  334. package/dist/twilight/{p-C72A7Y44.js → p-Bp81rq7T.js} +1 -1
  335. package/dist/twilight/{p-ZT7ehBBk.js → p-CeFAfcTv.js} +1 -1
  336. package/dist/twilight/{p-DJ3ziTwG.js → p-CszkocSp.js} +2 -2
  337. package/dist/twilight/{p-5wempgCB.js → p-CvcP7d1k.js} +1 -1
  338. package/dist/twilight/{p-Bw7P5SwX.js → p-D1tp_3zr.js} +1 -1
  339. package/dist/twilight/{p-BwggHXVj.js → p-D3lg7_WR.js} +1 -1
  340. package/dist/twilight/{p-DQUSqsnq.js → p-D68AOZPQ.js} +1 -1
  341. package/dist/twilight/{p-DNWyGkAx.js → p-DkTbP5UX.js} +2 -2
  342. package/dist/twilight/{p-3c10826c.entry.js → p-a104a885.entry.js} +1 -1
  343. package/dist/twilight/{p-85c6c44f.entry.js → p-a5310ab5.entry.js} +1 -1
  344. package/dist/twilight/{p-04a6cb8f.entry.js → p-ab8ffcbf.entry.js} +1 -1
  345. package/dist/twilight/{p-0a9af711.entry.js → p-acf6a8f0.entry.js} +1 -1
  346. package/dist/twilight/{p-47dd6817.entry.js → p-ad8111fa.entry.js} +1 -1
  347. package/dist/twilight/{p-cbc66d20.entry.js → p-af41ebe4.entry.js} +1 -1
  348. package/dist/twilight/{p-f01c12dc.entry.js → p-b4fc5871.entry.js} +1 -1
  349. package/dist/twilight/{p-ca028945.entry.js → p-b7916db2.entry.js} +1 -1
  350. package/dist/twilight/{p-e2da0555.entry.js → p-b87ac43c.entry.js} +1 -1
  351. package/dist/twilight/{p-338a55c1.entry.js → p-bdca0d7a.entry.js} +1 -1
  352. package/dist/twilight/{p-6494c6bf.entry.js → p-be44f2e4.entry.js} +1 -1
  353. package/dist/twilight/{p-5993b7d0.entry.js → p-bf50723d.entry.js} +1 -1
  354. package/dist/twilight/{p-a965c431.entry.js → p-c0dd76e3.entry.js} +1 -1
  355. package/dist/twilight/{p-db9dc344.entry.js → p-c3c9b136.entry.js} +1 -1
  356. package/dist/twilight/{p-d239611f.entry.js → p-c583ab13.entry.js} +1 -1
  357. package/dist/twilight/p-c71a6e9c.entry.js +4 -0
  358. package/dist/twilight/{p-ef2d94d3.entry.js → p-c774a729.entry.js} +1 -1
  359. package/dist/twilight/p-c80b8b30.entry.js +4 -0
  360. package/dist/twilight/{p-52283d18.entry.js → p-c9dcf28b.entry.js} +1 -1
  361. package/dist/twilight/{p-C5HojqDY.js → p-cUujZ85s.js} +1 -1
  362. package/dist/twilight/{p-3f924fc5.entry.js → p-ca1c1c50.entry.js} +2 -2
  363. package/dist/twilight/{p-9273a620.entry.js → p-cbbfec66.entry.js} +1 -1
  364. package/dist/twilight/{p-602df9ed.entry.js → p-ce0d56c1.entry.js} +1 -1
  365. package/dist/twilight/{p-7bbea228.entry.js → p-d0eb0e3d.entry.js} +1 -1
  366. package/dist/twilight/{p-08641aeb.entry.js → p-d27c3758.entry.js} +1 -1
  367. package/dist/twilight/p-d617bb3f.entry.js +4 -0
  368. package/dist/twilight/{p-cee1f87a.entry.js → p-d7633d87.entry.js} +1 -1
  369. package/dist/twilight/{p-ac7c0ea4.entry.js → p-d981255b.entry.js} +1 -1
  370. package/dist/twilight/{p-69766916.entry.js → p-d9e7a2a9.entry.js} +1 -1
  371. package/dist/twilight/{p-02e2f661.entry.js → p-dca909c8.entry.js} +1 -1
  372. package/dist/twilight/{p-4b17c9a0.entry.js → p-df9267ca.entry.js} +1 -1
  373. package/dist/twilight/{p-cfc209db.entry.js → p-eba770b4.entry.js} +1 -1
  374. package/dist/twilight/{p-c84ada78.entry.js → p-ee67787c.entry.js} +1 -1
  375. package/dist/twilight/{p-0cd023d2.entry.js → p-f303739b.entry.js} +1 -1
  376. package/dist/twilight/{p-afc451ef.entry.js → p-f834ded2.entry.js} +1 -1
  377. package/dist/twilight/{p-ab2a5243.entry.js → p-f855ad35.entry.js} +1 -1
  378. package/dist/twilight/{p-39b8ffcd.entry.js → p-faf369b8.entry.js} +1 -1
  379. package/dist/twilight/{p-b6cdfd09.entry.js → p-fc26088c.entry.js} +1 -1
  380. package/dist/twilight/{p-Dp4UckOj.js → p-jgiIvZFz.js} +1 -1
  381. package/dist/twilight/p-lMgMt31Q.js +4 -0
  382. package/dist/twilight/{p-CsSICzhL.js → p-qT0_dvbw.js} +1 -1
  383. package/dist/twilight/twilight.esm.js +1 -1
  384. package/dist/types/components/salla-comments/interfaces.d.ts +6 -0
  385. package/dist/types/components/salla-comments/salla-comment-factors.d.ts +6 -0
  386. package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -0
  387. package/dist/types/components/salla-comments/salla-comments.d.ts +2 -2
  388. package/dist/types/components/salla-rating-modal/order-feedback-response.d.ts +32 -0
  389. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +151 -0
  390. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +5 -1
  391. package/dist/types/components/salla-rating-stars/salla-rating-stars.d.ts +13 -0
  392. package/dist/types/components/salla-review-factors-tags/helpers.d.ts +16 -0
  393. package/dist/types/components/salla-review-factors-tags/interfaces.d.ts +17 -0
  394. package/dist/types/components/salla-review-factors-tags/salla-review-factors-tags.d.ts +24 -0
  395. package/dist/types/components/salla-reviews-summary/interfaces.d.ts +5 -0
  396. package/dist/types/components/salla-reviews-summary/salla-reviews-summary.d.ts +2 -0
  397. package/dist/types/components.d.ts +114 -2
  398. package/package.json +5 -5
  399. package/dist/twilight/p-f12a28f9.entry.js +0 -4
  400. package/dist/twilight/p-f6205375.entry.js +0 -4
  401. package/dist/twilight/p-fc676125.entry.js +0 -4
@@ -1,4 +1,115 @@
1
1
  /*
2
2
  * Salla Rating Component: Order rating modal, used in the order single page
3
3
  * You can use these classes to target the elements in the component.
4
- */
4
+ */
5
+ .s-rating-modal-product-details {
6
+ padding-bottom: 0.5rem;
7
+ }
8
+ .s-rating-modal-comment {
9
+ margin-top: 0.35rem;
10
+ }
11
+ .s-rating-modal-product {
12
+ margin-bottom: 1rem;
13
+ }
14
+ .s-rating-modal-product-img {
15
+ display: block;
16
+ width: 100%;
17
+ height: 100%;
18
+ object-fit: cover;
19
+ }
20
+ .s-rating-modal-product-title {
21
+ font-size: 0.95rem;
22
+ font-weight: 600;
23
+ line-height: 1.5;
24
+ margin: 0;
25
+ }
26
+ .s-rating-modal-stars-product {
27
+ margin-top: 0.5rem;
28
+ }
29
+ .s-rating-modal-product-details-main {
30
+ display: flex;
31
+ align-items: center;
32
+ margin-bottom: 0.5rem;
33
+ padding-bottom: 0;
34
+ border-bottom: 0;
35
+ }
36
+ .s-rating-modal-product-info-row {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 0.6rem;
40
+ margin-bottom: 0.5rem;
41
+ padding-bottom: 0;
42
+ border-bottom: 0;
43
+ }
44
+ .s-rating-modal-product-main-review {
45
+ width: 100%;
46
+ text-align: right;
47
+ }
48
+ .s-rating-modal-product-rating-rows {
49
+ display: grid;
50
+ gap: 0.45rem;
51
+ margin: 0.2rem 0 0.7rem;
52
+ }
53
+ .s-rating-modal-product-rating-row {
54
+ display: flex;
55
+ align-items: center;
56
+ justify-content: space-between;
57
+ gap: 0.75rem;
58
+ min-height: 2rem;
59
+ }
60
+ .s-rating-modal-product-rating-row salla-rating-stars {
61
+ flex-shrink: 0;
62
+ }
63
+ .s-rating-modal-product-rating-row .s-rating-stars-wrapper {
64
+ align-items: center;
65
+ min-height: 1.75rem;
66
+ }
67
+ .s-rating-modal-product-rating-row .s-rating-stars-label, .s-rating-modal-product-rating-row .s-rating-stars-label-without-tag {
68
+ min-width: auto;
69
+ min-height: 1.25rem;
70
+ line-height: 1.25rem;
71
+ font-size: 0.8rem;
72
+ color: #5b6470;
73
+ white-space: nowrap;
74
+ text-align: end;
75
+ transition: opacity 0.15s ease;
76
+ }
77
+ .s-rating-modal-product-rating-row .s-rating-stars-label--empty, .s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty {
78
+ opacity: 0;
79
+ }
80
+ .s-rating-modal-product-rating-row-main {
81
+ margin-bottom: 0.35rem;
82
+ padding: 0.5rem 0.6rem;
83
+ border: 1px solid #d1d5db;
84
+ border-radius: 0.45rem;
85
+ background: transparent;
86
+ }
87
+ .s-rating-modal-product-factor-name {
88
+ color: #5b6470;
89
+ font-size: 0.9rem;
90
+ line-height: 1.25;
91
+ }
92
+ .s-rating-modal-product-rating-row-main .s-rating-modal-product-factor-name {
93
+ font-size: 1rem;
94
+ color: #5b6470;
95
+ }
96
+ .s-rating-modal-product-factor-required {
97
+ color: #f87171;
98
+ margin-inline-start: 0.2rem;
99
+ }
100
+ .s-rating-modal-product-img-wrap {
101
+ width: 5rem;
102
+ min-width: 5rem;
103
+ height: 3.5rem;
104
+ flex-shrink: 0;
105
+ overflow: hidden;
106
+ border-radius: 0.375rem;
107
+ background: #f3f4f6;
108
+ }
109
+ .s-rating-modal-uploader.is-opened {
110
+ height: auto !important;
111
+ opacity: 1 !important;
112
+ overflow: visible !important;
113
+ pointer-events: auto !important;
114
+ margin-bottom: 1rem;
115
+ }
@@ -23,6 +23,7 @@ export class SallaRatingModal {
23
23
  this.deleteMode = false;
24
24
  this.shouldOpenDeleteModal = false;
25
25
  this.editItem = null;
26
+ this.enableNewPopUp = false;
26
27
  this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
27
28
  this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
28
29
  this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
@@ -133,10 +134,21 @@ export class SallaRatingModal {
133
134
  setTranslations();
134
135
  });
135
136
  }
137
+ getV2Ref() {
138
+ return this.v2Ref ?? this.host.querySelector('salla-rating-modal-v2');
139
+ }
140
+ syncNewPopUpFlag() {
141
+ this.enableNewPopUp = !!salla.config.get('store.features')?.includes('new_popup_rating');
142
+ }
136
143
  /**
137
144
  * Show the rating modal
138
145
  */
139
146
  async open() {
147
+ await salla.onReady();
148
+ this.syncNewPopUpFlag();
149
+ if (this.enableNewPopUp) {
150
+ return this.getV2Ref()?.open();
151
+ }
140
152
  this.defaultMode = true;
141
153
  return new Promise((resolve) => {
142
154
  setTimeout(() => {
@@ -166,6 +178,11 @@ export class SallaRatingModal {
166
178
  });
167
179
  }
168
180
  async openEditModal(params) {
181
+ await salla.onReady();
182
+ this.syncNewPopUpFlag();
183
+ if (this.enableNewPopUp) {
184
+ return this.getV2Ref()?.openEditModal(params);
185
+ }
169
186
  this.defaultMode = false;
170
187
  this.editMode = true;
171
188
  this.editType = params.type;
@@ -206,6 +223,11 @@ export class SallaRatingModal {
206
223
  });
207
224
  }
208
225
  async openDeleteModal(params) {
226
+ await salla.onReady();
227
+ this.syncNewPopUpFlag();
228
+ if (this.enableNewPopUp) {
229
+ return this.getV2Ref()?.openDeleteModal(params);
230
+ }
209
231
  this.defaultMode = false;
210
232
  this.deleteMode = true;
211
233
  this.deleteFeedbackId = params.feedback_id;
@@ -230,6 +252,9 @@ export class SallaRatingModal {
230
252
  * Show the rating modal
231
253
  */
232
254
  async close() {
255
+ if (this.enableNewPopUp) {
256
+ return this.getV2Ref()?.close();
257
+ }
233
258
  return this.modal.close();
234
259
  }
235
260
  // handle wizard
@@ -393,6 +418,9 @@ export class SallaRatingModal {
393
418
  : null, h("div", { class: "s-rating-modal-footer s-rating-modal-footer-end" }, h("salla-button", { "loader-position": 'center', onClick: () => this.editReview() }, this.editReviewLabel)))));
394
419
  }
395
420
  render() {
421
+ if (this.enableNewPopUp) {
422
+ return (h(Host, { class: "s-rating-modal" }, h("salla-rating-modal-v2", { ref: (el) => (this.v2Ref = el), orderId: this.orderId })));
423
+ }
396
424
  if (this.deleteMode) {
397
425
  return h(Host, { class: "s-rating-modal" }, this.getDeleteModal());
398
426
  }
@@ -428,10 +456,12 @@ export class SallaRatingModal {
428
456
  : h("salla-placeholder", { alignment: "center" }))));
429
457
  }
430
458
  }
431
- componentWillLoad() {
459
+ async componentWillLoad() {
432
460
  salla.event.on('rating::open', () => this.open());
433
461
  salla.event.on('rating::edit', (params) => this.openEditModal(params));
434
462
  salla.event.on('rating::delete', (params) => this.openDeleteModal(params));
463
+ await salla.onReady();
464
+ this.syncNewPopUpFlag();
435
465
  }
436
466
  componentDidLoad() {
437
467
  salla.event.dispatch('rating::ready', this);
@@ -487,7 +517,8 @@ export class SallaRatingModal {
487
517
  "editType": {},
488
518
  "editFeedbackId": {},
489
519
  "deleteFeedbackId": {},
490
- "editItem": {}
520
+ "editItem": {},
521
+ "enableNewPopUp": {}
491
522
  };
492
523
  }
493
524
  static get methods() {
@@ -1,4 +1,37 @@
1
1
  /*
2
2
  * Salla Rating Stars Component: Rating starts as rating input or to display rating values.
3
3
  * You can use these classes to target the elements in the component.
4
- */
4
+ */
5
+ :host {
6
+ display: inline-flex;
7
+ vertical-align: middle;
8
+ }
9
+
10
+ .s-rating-stars-wrapper {
11
+ display: inline-flex;
12
+ align-items: center;
13
+ gap: 0.5rem;
14
+ min-height: 1.75rem;
15
+ }
16
+ .s-rating-stars-wrapper--with-label {
17
+ min-height: 1.75rem;
18
+ }
19
+ .s-rating-stars-element {
20
+ display: inline-flex;
21
+ align-items: center;
22
+ flex-shrink: 0;
23
+ }
24
+ .s-rating-stars-label, .s-rating-stars-label-without-tag {
25
+ flex-shrink: 0;
26
+ min-width: 5.5rem;
27
+ min-height: 1.25rem;
28
+ line-height: 1.25rem;
29
+ text-align: end;
30
+ transition: opacity 0.15s ease;
31
+ }
32
+ .s-rating-stars-label--empty, .s-rating-stars-label-without-tag--empty {
33
+ opacity: 0;
34
+ }
35
+ .s-rating-stars-btn-star {
36
+ flex-shrink: 0;
37
+ }
@@ -23,9 +23,26 @@ export class SallaRatingStars {
23
23
  */
24
24
  this.reviews = 0;
25
25
  /**
26
+ * Render the description label before the stars instead of after.
27
+ */
28
+ this.labelBeforeStars = false;
29
+ /**
26
30
  * Allows the rating to be editable.
27
31
  */
28
32
  this.editable = false;
33
+ this.tag = true;
34
+ }
35
+ getLabelClassName() {
36
+ return this.tag ? 's-rating-stars-label' : 's-rating-stars-label-without-tag';
37
+ }
38
+ setLabelDisplay(text) {
39
+ if (!this.labelElem) {
40
+ return;
41
+ }
42
+ this.labelElem.textContent = text || '\u00a0';
43
+ const labelClass = this.getLabelClassName();
44
+ this.labelElem.classList.toggle(`${labelClass}--empty`, !text);
45
+ this.labelElem.setAttribute('aria-hidden', text ? 'false' : 'true');
29
46
  }
30
47
  async componentWillLoad() {
31
48
  await new Promise(resolve => {
@@ -49,23 +66,30 @@ export class SallaRatingStars {
49
66
  });
50
67
  }
51
68
  initiateRating() {
52
- this.host.addEventListener('click', this.handleRating.bind(this));
69
+ this.host.addEventListener('click', event => this.handleRating(event));
53
70
  }
54
- handleRating() {
71
+ handleRating(event) {
55
72
  if (!this.starsElem)
56
73
  return;
57
74
  let activeStars = this.starsElem.querySelectorAll('.s-rating-stars-hovered');
58
75
  let selected = activeStars[activeStars.length - 1];
76
+ if (!selected && event?.target instanceof HTMLElement) {
77
+ selected = event.target.closest('.s-rating-stars-btn-star[data-star]');
78
+ }
59
79
  if (!selected)
60
80
  return;
61
81
  let selectedIndex = parseInt(selected.getAttribute('data-star'));
62
- this.starsElem.querySelector('.rating_hidden_input').value = selectedIndex.toString();
63
- this.starsElem.querySelectorAll('.s-rating-stars-btn-star')
82
+ this.starsElem.querySelector('.rating_hidden_input').value =
83
+ selectedIndex.toString();
84
+ this.starsElem
85
+ .querySelectorAll('.s-rating-stars-btn-star')
64
86
  .forEach((star, index) => Helper.toggleElementClassIf(star, 's-rating-stars-selected', 's-rating-stars-unselected', () => index < selectedIndex));
65
87
  this.starsElem.querySelectorAll('[aria-pressed]').forEach(star => star.removeAttribute('aria-pressed'));
66
88
  selected.setAttribute('aria-pressed', 'true');
67
89
  this.selectedStar = selectedIndex;
68
- this.withLabel && (this.reviewLabel = this.labels[selectedIndex - 1]);
90
+ if (this.withLabel) {
91
+ this.setLabelDisplay(this.labels[selectedIndex - 1]);
92
+ }
69
93
  }
70
94
  triggerRatingProgrammatically(index) {
71
95
  if (!this.starsElem)
@@ -87,11 +111,15 @@ export class SallaRatingStars {
87
111
  for (let i = 0; i <= index; i++) {
88
112
  stars[i].classList.add(hoveredClass);
89
113
  }
90
- this.withLabel && (this.reviewLabel = this.labels[index]);
114
+ if (this.withLabel) {
115
+ this.setLabelDisplay(this.labels[index]);
116
+ }
91
117
  });
92
118
  star.addEventListener('mouseout', () => {
93
119
  star.classList.remove(hoveredClass);
94
- this.withLabel && (this.reviewLabel = this.selectedStar ? this.labels[this.selectedStar - 1] : '');
120
+ if (this.withLabel) {
121
+ this.setLabelDisplay(this.selectedStar ? this.labels[this.selectedStar - 1] : '');
122
+ }
95
123
  });
96
124
  });
97
125
  this.starsElem?.addEventListener('mouseout', () => stars.forEach(star => star.classList.remove(hoveredClass)));
@@ -110,22 +138,55 @@ export class SallaRatingStars {
110
138
  }
111
139
  return stars;
112
140
  }
141
+ renderReviewLabel() {
142
+ if (!this.withLabel) {
143
+ return null;
144
+ }
145
+ const labelClass = this.getLabelClassName();
146
+ return (h("span", { ref: el => {
147
+ this.labelElem = el;
148
+ }, class: {
149
+ [labelClass]: true,
150
+ [`${labelClass}--empty`]: !this.reviewLabel,
151
+ }, "aria-hidden": !this.reviewLabel ? 'true' : 'false' }, this.reviewLabel || '\u00a0'));
152
+ }
153
+ renderStarsWrapper(starsContent) {
154
+ const label = this.renderReviewLabel();
155
+ return (h("div", { class: {
156
+ 's-rating-stars-wrapper': true,
157
+ 's-rating-stars-wrapper--with-label': this.withLabel,
158
+ 's-rating-stars-wrapper--label-first': this.labelBeforeStars,
159
+ } }, this.labelBeforeStars ? [label, starsContent] : [starsContent, label]));
160
+ }
161
+ renderEditableStars() {
162
+ return (h("div", { class: "s-rating-stars-element", ref: el => (this.starsElem = el) }, h("input", { type: "hidden", class: "rating_hidden_input", name: this.name, value: "" }), [1, 2, 3, 4, 5].map(star => (h("button", { class: `s-rating-stars-btn-star s-rating-stars-` + this.size, "data-star": star }, h("span", { innerHTML: Star2 }))))));
163
+ }
113
164
  render() {
114
165
  return this.translationsLoaded ? (this.host.closest('.swiper-slide')?.classList.contains('swiper-slide-duplicate')
115
166
  ? ''
116
- : (h(Host, null, (this.value || this.value == 0) && !this.editable ?
117
- h("div", { class: "s-rating-stars-wrapper" }, this.createStars(this.value), this.withLabel && this.reviewLabel ? h("span", { class: "s-rating-stars-label" }, this.reviewLabel) : '')
118
- :
119
- h("div", { class: "s-rating-stars-wrapper" }, h("div", { class: "s-rating-stars-element", ref: (el) => this.starsElem = el }, h("input", { type: "hidden", class: "rating_hidden_input", name: this.name, value: "" }), [1, 2, 3, 4, 5].map(star => h("button", { class: `s-rating-stars-btn-star s-rating-stars-` + this.size, "data-star": star }, h("span", { innerHTML: Star2 })))), this.withLabel && this.reviewLabel ? h("span", { class: "s-rating-stars-label" }, this.reviewLabel) : '')))) : (h(Host, null));
167
+ : (h(Host, null, (this.value || this.value == 0) && !this.editable
168
+ ? this.renderStarsWrapper(this.createStars(this.value))
169
+ : this.renderStarsWrapper(this.renderEditableStars())))) : (h(Host, null));
120
170
  }
121
171
  componentDidLoad() {
122
172
  this.initiateRating();
123
173
  this.highlightSelectedStars();
124
- if (this.value && this.editable) {
125
- const stars = this.starsElem?.querySelectorAll('.s-rating-stars-btn-star');
126
- if (stars && this.value >= 0 && this.value <= stars.length) {
127
- this.triggerRatingProgrammatically(this.value - 1);
128
- }
174
+ this.syncEditableRating();
175
+ }
176
+ componentDidUpdate() {
177
+ this.syncEditableRating();
178
+ }
179
+ syncEditableRating() {
180
+ if (!this.translationsLoaded || !this.editable || !this.value || !this.starsElem) {
181
+ return;
182
+ }
183
+ // Prefill only while untouched — don't reset after the user picks a new rating
184
+ if (this.selectedStar > 0) {
185
+ return;
186
+ }
187
+ const stars = this.starsElem.querySelectorAll('.s-rating-stars-btn-star');
188
+ if (stars?.length && this.value >= 1 && this.value <= stars.length) {
189
+ this.triggerRatingProgrammatically(this.value - 1);
129
190
  }
130
191
  }
131
192
  static get is() { return "salla-rating-stars"; }
@@ -239,6 +300,26 @@ export class SallaRatingStars {
239
300
  "setter": false,
240
301
  "reflect": false
241
302
  },
303
+ "labelBeforeStars": {
304
+ "type": "boolean",
305
+ "attribute": "label-before-stars",
306
+ "mutable": false,
307
+ "complexType": {
308
+ "original": "boolean",
309
+ "resolved": "boolean",
310
+ "references": {}
311
+ },
312
+ "required": false,
313
+ "optional": false,
314
+ "docs": {
315
+ "tags": [],
316
+ "text": "Render the description label before the stars instead of after."
317
+ },
318
+ "getter": false,
319
+ "setter": false,
320
+ "reflect": false,
321
+ "defaultValue": "false"
322
+ },
242
323
  "editable": {
243
324
  "type": "boolean",
244
325
  "attribute": "editable",
@@ -258,6 +339,26 @@ export class SallaRatingStars {
258
339
  "setter": false,
259
340
  "reflect": false,
260
341
  "defaultValue": "false"
342
+ },
343
+ "tag": {
344
+ "type": "boolean",
345
+ "attribute": "tag",
346
+ "mutable": false,
347
+ "complexType": {
348
+ "original": "boolean",
349
+ "resolved": "boolean",
350
+ "references": {}
351
+ },
352
+ "required": false,
353
+ "optional": false,
354
+ "docs": {
355
+ "tags": [],
356
+ "text": ""
357
+ },
358
+ "getter": false,
359
+ "setter": false,
360
+ "reflect": false,
361
+ "defaultValue": "true"
261
362
  }
262
363
  };
263
364
  }
@@ -0,0 +1,86 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ const CACHE_TTL = 5 * 60 * 1000;
5
+ const orderCache = new Map();
6
+ const inFlightRequests = new Map();
7
+ export function normalizeList(value) {
8
+ if (!value) {
9
+ return [];
10
+ }
11
+ return Array.isArray(value) ? value : Object.values(value);
12
+ }
13
+ export function getProductRatings(rating) {
14
+ if (!rating) {
15
+ return [];
16
+ }
17
+ return [
18
+ ...normalizeList(rating.product),
19
+ ...normalizeList(rating.products),
20
+ ];
21
+ }
22
+ export function extractFactors(source) {
23
+ if (!source) {
24
+ return [];
25
+ }
26
+ for (const key of ['factor_reviews', 'review_factors', 'factors']) {
27
+ const value = source[key];
28
+ if (Array.isArray(value) && value.length) {
29
+ return value;
30
+ }
31
+ }
32
+ return [];
33
+ }
34
+ export function findProductRating(productRatings, ratingId, productId, itemId) {
35
+ return productRatings.find((productRating) => {
36
+ if (ratingId && Number(productRating.id ?? productRating.feedback_id) === Number(ratingId)) {
37
+ return true;
38
+ }
39
+ if (itemId && Number(productRating.order_item_id) === Number(itemId)) {
40
+ return true;
41
+ }
42
+ if (productId && Number(productRating.product_id ?? productRating.product?.id) === Number(productId)) {
43
+ return true;
44
+ }
45
+ return false;
46
+ });
47
+ }
48
+ export function resolveReviewFactors(order, ratingId, productId, itemId) {
49
+ const productRatings = getProductRatings(order?.rating);
50
+ const productRating = findProductRating(productRatings, ratingId, productId, itemId);
51
+ return extractFactors(productRating);
52
+ }
53
+ export async function fetchOrder(orderId) {
54
+ if (!orderId) {
55
+ return null;
56
+ }
57
+ const cached = orderCache.get(orderId);
58
+ if (cached && Date.now() - cached.timestamp <= CACHE_TTL) {
59
+ return cached.data;
60
+ }
61
+ const pending = inFlightRequests.get(orderId);
62
+ if (pending) {
63
+ return pending;
64
+ }
65
+ const request = (async () => {
66
+ try {
67
+ const response = await salla.api.request(`orders/${orderId}`, '', 'get');
68
+ const data = response?.data ?? response;
69
+ orderCache.set(orderId, { data, timestamp: Date.now() });
70
+ return data;
71
+ }
72
+ catch (error) {
73
+ orderCache.delete(orderId);
74
+ throw error;
75
+ }
76
+ finally {
77
+ inFlightRequests.delete(orderId);
78
+ }
79
+ })();
80
+ inFlightRequests.set(orderId, request);
81
+ return request;
82
+ }
83
+ export function resetOrderCacheForTests() {
84
+ orderCache.clear();
85
+ inFlightRequests.clear();
86
+ }
@@ -0,0 +1,41 @@
1
+ :host {
2
+ display: inline-flex;
3
+ }
4
+
5
+ .s-review-factors-tags-factors {
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ gap: 0.5rem;
9
+ justify-content: flex-start;
10
+ margin-bottom: 0.6rem;
11
+ }
12
+
13
+ .s-review-factors-tags-factor-tag {
14
+ display: inline-flex;
15
+ align-items: center;
16
+ gap: 0.25rem;
17
+ border-radius: 999px;
18
+ border: 1px solid #e8e8e8;
19
+ background: rgba(255, 255, 255, 0.3);
20
+ color: #374151;
21
+ font-size: 0.85rem;
22
+ line-height: 1;
23
+ padding: 0.4rem 0.65rem;
24
+ }
25
+
26
+ .s-review-factors-tags-factor-rating {
27
+ font-weight: 600;
28
+ color: #0f6a7c;
29
+ }
30
+
31
+ .s-review-factors-tags-factor-star {
32
+ display: inline-flex;
33
+ width: 0.8rem;
34
+ height: 0.8rem;
35
+ fill: #0f6a7c;
36
+ }
37
+
38
+ .s-review-factors-tags-factor-star svg {
39
+ width: 100%;
40
+ height: 100%;
41
+ }