@salla.sa/twilight-components 2.14.556 → 2.14.558

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 (384) hide show
  1. package/dist/{esm/cart-DY4LZmNP.js → cjs/cart-DSvlJXCH.js} +4 -2
  2. package/dist/cjs/{filepond-t0Yy69qV.js → filepond-LS8ytqmE.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-DNZM6Czl.js → filepond-plugin-file-poster-DexU9y97.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-BPMIodJt.js → filepond-plugin-file-validate-size-BJJ_spY7.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-DgYmyGCI.js → filepond-plugin-file-validate-type-BYz_biwv.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-B4itf01h.js → filepond-plugin-image-edit-C3R9xG9P.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-Dj43xu10.js → filepond-plugin-image-exif-orientation-DC7e2K9l.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-C6Gm9i9o.js → filepond-plugin-image-preview-DLbo1P7r.js} +1 -1
  9. package/dist/cjs/{index-DyL5Ypj3.js → index-BkcJlC9S.js} +14 -14
  10. package/dist/cjs/{intlTelInput-BTUy-aYK.js → intlTelInput-DvZz7cvU.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 +21 -6
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +3 -3
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +3 -3
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +5 -5
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +3 -3
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-orders.cjs.entry.js +224 -46
  76. package/dist/cjs/salla-payments.cjs.entry.js +76 -2
  77. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card.cjs.entry.js +48 -13
  81. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-slider.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 +33 -4
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -2
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +279 -33
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  95. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  97. package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -165
  98. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  99. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  101. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  104. package/dist/cjs/twilight.cjs.js +2 -2
  105. package/dist/cjs/{vanilla-picker-C_t8j4f7.js → vanilla-picker-COagKVR0.js} +1 -1
  106. package/dist/collection/components/salla-button/salla-button.js +32 -2
  107. package/dist/collection/components/salla-modal/salla-modal.css +34 -16
  108. package/dist/collection/components/salla-modal/salla-modal.js +27 -2
  109. package/dist/collection/components/salla-orders/salla-orders.css +122 -0
  110. package/dist/collection/components/salla-orders/salla-orders.js +231 -45
  111. package/dist/collection/components/salla-payments/salla-payments.css +3 -0
  112. package/dist/collection/components/salla-payments/salla-payments.js +74 -0
  113. package/dist/collection/components/salla-product-card/salla-product-card.css +22 -2
  114. package/dist/collection/components/salla-product-card/salla-product-card.js +106 -11
  115. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +32 -3
  116. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -1
  117. package/dist/collection/components/salla-search/interfaces.js +1 -0
  118. package/dist/collection/components/salla-search/salla-search.css +324 -14
  119. package/dist/collection/components/salla-search/salla-search.js +179 -32
  120. package/dist/collection/components/salla-search/utils.js +111 -0
  121. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  122. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  123. package/dist/collection/components/salla-social/salla-social.js +1 -1
  124. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  125. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  126. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  127. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  128. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  129. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  130. package/dist/collection/components/salla-trust-badges/salla-trust-badges.css +1 -16
  131. package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -163
  132. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  133. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  134. package/dist/components/index.js +2 -2
  135. package/dist/components/salla-button2.js +13 -2
  136. package/dist/components/salla-modal2.js +9 -3
  137. package/dist/components/salla-orders.js +294 -48
  138. package/dist/components/salla-payments.js +75 -1
  139. package/dist/components/salla-product-card2.js +50 -12
  140. package/dist/components/salla-rating-modal-v22.js +32 -3
  141. package/dist/components/salla-rating-modal2.js +2 -1
  142. package/dist/components/salla-search.js +392 -39
  143. package/dist/components/salla-searchable-dropdown2.js +4 -4
  144. package/dist/components/salla-skeleton2.js +1 -1
  145. package/dist/components/salla-social-share2.js +1 -1
  146. package/dist/components/salla-social.js +1 -1
  147. package/dist/components/salla-tab-content2.js +1 -1
  148. package/dist/components/salla-tab-header2.js +1 -1
  149. package/dist/components/salla-tabs2.js +1 -1
  150. package/dist/components/salla-tel-input2.js +1 -1
  151. package/dist/components/salla-tooltip2.js +1 -1
  152. package/dist/components/salla-trust-badges.js +2 -164
  153. package/dist/components/salla-user-settings.js +1 -1
  154. package/dist/components/salla-wishlist-actions.js +1 -1
  155. package/dist/{cjs/cart-s-x1Fshk.js → esm/cart-gFG8By9O.js} +2 -4
  156. package/dist/esm/{filepond-Dl-e9LIA.js → filepond-D5Fnwsco.js} +1 -1
  157. package/dist/esm/{filepond-plugin-file-poster-B44qzFr7.js → filepond-plugin-file-poster-BfePPO64.js} +1 -1
  158. package/dist/esm/{filepond-plugin-file-validate-size-DeewGi6D.js → filepond-plugin-file-validate-size-CVpLCDVB.js} +1 -1
  159. package/dist/esm/{filepond-plugin-file-validate-type-DquQHM9K.js → filepond-plugin-file-validate-type-BhzMnQfH.js} +1 -1
  160. package/dist/esm/{filepond-plugin-image-edit-DPSC2V4u.js → filepond-plugin-image-edit-Bvj3qwXE.js} +1 -1
  161. package/dist/esm/{filepond-plugin-image-exif-orientation-A-4MC3po.js → filepond-plugin-image-exif-orientation-NlBBLgPL.js} +1 -1
  162. package/dist/esm/{filepond-plugin-image-preview-vvc3KNls.js → filepond-plugin-image-preview-CA1k8ex-.js} +1 -1
  163. package/dist/esm/{index-BJmvvw9H.js → index-B6Lo-Jz2.js} +14 -14
  164. package/dist/esm/{intlTelInput-DFX9QeWQ.js → intlTelInput-nu7FH85H.js} +1 -1
  165. package/dist/esm/loader.js +3 -3
  166. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  167. package/dist/esm/salla-accordion_6.entry.js +21 -6
  168. package/dist/esm/salla-add-product-button_5.entry.js +3 -3
  169. package/dist/esm/salla-advertisement.entry.js +1 -1
  170. package/dist/esm/salla-alert_2.entry.js +3 -3
  171. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  172. package/dist/esm/salla-applied-filters.entry.js +1 -1
  173. package/dist/esm/salla-apps-icons.entry.js +1 -1
  174. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  175. package/dist/esm/salla-badge.entry.js +1 -1
  176. package/dist/esm/salla-basket-gap.entry.js +1 -1
  177. package/dist/esm/salla-bullet-delivery_3.entry.js +5 -5
  178. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  179. package/dist/esm/salla-cart-item-offers_2.entry.js +3 -3
  180. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  181. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  182. package/dist/esm/salla-comment-factors.entry.js +1 -1
  183. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  184. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  185. package/dist/esm/salla-contacts.entry.js +1 -1
  186. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  187. package/dist/esm/salla-count-down_2.entry.js +1 -1
  188. package/dist/esm/salla-custom-fields.entry.js +1 -1
  189. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  190. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  191. package/dist/esm/salla-filters-widget.entry.js +1 -1
  192. package/dist/esm/salla-filters.entry.js +1 -1
  193. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  194. package/dist/esm/salla-gifting.entry.js +1 -1
  195. package/dist/esm/salla-hook.entry.js +1 -1
  196. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  197. package/dist/esm/salla-installment.entry.js +1 -1
  198. package/dist/esm/salla-list-tile.entry.js +1 -1
  199. package/dist/esm/salla-localization-modal.entry.js +1 -1
  200. package/dist/esm/salla-login-modal.entry.js +1 -1
  201. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  202. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  203. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  204. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  205. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  206. package/dist/esm/salla-loyalty.entry.js +1 -1
  207. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  208. package/dist/esm/salla-map_3.entry.js +1 -1
  209. package/dist/esm/salla-menu.entry.js +1 -1
  210. package/dist/esm/salla-metadata.entry.js +1 -1
  211. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  212. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  213. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  214. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  215. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  216. package/dist/esm/salla-offer-modal.entry.js +1 -1
  217. package/dist/esm/salla-offer.entry.js +1 -1
  218. package/dist/esm/salla-order-branch.entry.js +1 -1
  219. package/dist/esm/salla-order-cancel.entry.js +1 -1
  220. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  221. package/dist/esm/salla-order-details-options.entry.js +1 -1
  222. package/dist/esm/salla-order-details.entry.js +1 -1
  223. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  224. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  225. package/dist/esm/salla-order-edit.entry.js +1 -1
  226. package/dist/esm/salla-order-shipments.entry.js +1 -1
  227. package/dist/esm/salla-order-summary.entry.js +1 -1
  228. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  229. package/dist/esm/salla-orders.entry.js +224 -46
  230. package/dist/esm/salla-payments.entry.js +76 -2
  231. package/dist/esm/salla-placeholder.entry.js +1 -1
  232. package/dist/esm/salla-price-range.entry.js +1 -1
  233. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  234. package/dist/esm/salla-product-card.entry.js +48 -13
  235. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  236. package/dist/esm/salla-products-list.entry.js +1 -1
  237. package/dist/esm/salla-products-slider.entry.js +1 -1
  238. package/dist/esm/salla-quick-order.entry.js +1 -1
  239. package/dist/esm/salla-rating-modal-v2.entry.js +33 -4
  240. package/dist/esm/salla-rating-modal.entry.js +3 -2
  241. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  242. package/dist/esm/salla-review-order-item.entry.js +1 -1
  243. package/dist/esm/salla-scopes.entry.js +1 -1
  244. package/dist/esm/salla-search.entry.js +279 -33
  245. package/dist/esm/salla-skeleton.entry.js +2 -2
  246. package/dist/esm/salla-social-share.entry.js +2 -2
  247. package/dist/esm/salla-social.entry.js +2 -2
  248. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  249. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  250. package/dist/esm/salla-tooltip.entry.js +2 -2
  251. package/dist/esm/salla-trust-badges.entry.js +3 -165
  252. package/dist/esm/salla-user-menu.entry.js +3 -3
  253. package/dist/esm/salla-user-profile.entry.js +1 -1
  254. package/dist/esm/salla-user-settings.entry.js +2 -2
  255. package/dist/esm/salla-verify.entry.js +1 -1
  256. package/dist/esm/salla-wallet.entry.js +1 -1
  257. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  258. package/dist/esm/twilight.js +3 -3
  259. package/dist/esm/{vanilla-picker-Ld2F0WbU.js → vanilla-picker-Dn7Q0By-.js} +1 -1
  260. package/dist/twilight/{p-f0c19b59.entry.js → p-00f3dc2a.entry.js} +1 -1
  261. package/dist/twilight/{p-cc3c48b4.entry.js → p-051740db.entry.js} +1 -1
  262. package/dist/twilight/{p-95b8806a.entry.js → p-05f65278.entry.js} +1 -1
  263. package/dist/twilight/{p-3ec284fd.entry.js → p-0e9845d3.entry.js} +1 -1
  264. package/dist/twilight/{p-5391291e.entry.js → p-0ea66288.entry.js} +1 -1
  265. package/dist/twilight/{p-6b3e668c.entry.js → p-0f9d25c2.entry.js} +1 -1
  266. package/dist/twilight/{p-f6e44ad6.entry.js → p-100cb969.entry.js} +1 -1
  267. package/dist/twilight/{p-b654ffbd.entry.js → p-11234d66.entry.js} +1 -1
  268. package/dist/twilight/{p-54b4dec6.entry.js → p-1546f64d.entry.js} +1 -1
  269. package/dist/twilight/{p-bd68067a.entry.js → p-191b4fa6.entry.js} +1 -1
  270. package/dist/twilight/p-19607f60.entry.js +4 -0
  271. package/dist/twilight/p-1d1bbac7.entry.js +4 -0
  272. package/dist/twilight/{p-7e7f0849.entry.js → p-1d220636.entry.js} +1 -1
  273. package/dist/twilight/{p-7d0e8486.entry.js → p-1d9aa36c.entry.js} +1 -1
  274. package/dist/twilight/{p-1b97e436.entry.js → p-257717f5.entry.js} +1 -1
  275. package/dist/twilight/{p-ec27e0f4.entry.js → p-289574f0.entry.js} +1 -1
  276. package/dist/twilight/{p-d4263617.entry.js → p-28aeea5d.entry.js} +1 -1
  277. package/dist/twilight/{p-4df9ca99.entry.js → p-29a9ff44.entry.js} +1 -1
  278. package/dist/twilight/{p-1882e5b9.entry.js → p-2cb160a8.entry.js} +1 -1
  279. package/dist/twilight/{p-d8808de5.entry.js → p-2dc5f115.entry.js} +1 -1
  280. package/dist/twilight/{p-75e126cc.entry.js → p-2de7945d.entry.js} +1 -1
  281. package/dist/twilight/{p-a1ce8d6d.entry.js → p-2ebe428c.entry.js} +1 -1
  282. package/dist/twilight/{p-45b85a45.entry.js → p-31c017ae.entry.js} +1 -1
  283. package/dist/twilight/{p-8a640353.entry.js → p-344e7a53.entry.js} +1 -1
  284. package/dist/twilight/{p-4023d48a.entry.js → p-3661b790.entry.js} +1 -1
  285. package/dist/twilight/{p-55c89592.entry.js → p-3c312812.entry.js} +1 -1
  286. package/dist/twilight/{p-e209addd.entry.js → p-3f12a3a2.entry.js} +1 -1
  287. package/dist/twilight/{p-d16a17d2.entry.js → p-400c631e.entry.js} +1 -1
  288. package/dist/twilight/{p-d9e98286.entry.js → p-44f20e64.entry.js} +1 -1
  289. package/dist/twilight/{p-5af2868f.entry.js → p-4604590c.entry.js} +1 -1
  290. package/dist/twilight/{p-5b148ad4.entry.js → p-4c422a3d.entry.js} +1 -1
  291. package/dist/twilight/{p-d5a486bb.entry.js → p-4f645457.entry.js} +1 -1
  292. package/dist/twilight/{p-5ab257bf.entry.js → p-529a60e2.entry.js} +1 -1
  293. package/dist/twilight/{p-f37147c7.entry.js → p-5a2150e8.entry.js} +1 -1
  294. package/dist/twilight/{p-e0f7a4e1.entry.js → p-5d6db148.entry.js} +1 -1
  295. package/dist/twilight/{p-4ca525cb.entry.js → p-5d6f9c3e.entry.js} +1 -1
  296. package/dist/twilight/{p-2f59ef9c.entry.js → p-5dcf8a71.entry.js} +1 -1
  297. package/dist/twilight/{p-c266feb3.entry.js → p-5f4331f0.entry.js} +1 -1
  298. package/dist/twilight/{p-91351958.entry.js → p-5ffdb544.entry.js} +1 -1
  299. package/dist/twilight/{p-c4582e2b.entry.js → p-63b48fb1.entry.js} +1 -1
  300. package/dist/twilight/{p-291d6f2b.entry.js → p-647a1b63.entry.js} +1 -1
  301. package/dist/twilight/{p-92992a1e.entry.js → p-6840449d.entry.js} +1 -1
  302. package/dist/twilight/{p-99af9a68.entry.js → p-747fdf8c.entry.js} +1 -1
  303. package/dist/twilight/{p-918eb4b7.entry.js → p-7512638e.entry.js} +1 -1
  304. package/dist/twilight/{p-6d7629ee.entry.js → p-75ba562a.entry.js} +1 -1
  305. package/dist/twilight/{p-3bba916f.entry.js → p-7639c5a8.entry.js} +1 -1
  306. package/dist/twilight/{p-e64ad9de.entry.js → p-778f38ce.entry.js} +1 -1
  307. package/dist/twilight/{p-275b49b7.entry.js → p-785ac87d.entry.js} +1 -1
  308. package/dist/twilight/{p-90d5e633.entry.js → p-78cba566.entry.js} +1 -1
  309. package/dist/twilight/{p-e0e614d1.entry.js → p-7a78cbcd.entry.js} +1 -1
  310. package/dist/twilight/{p-3eb18438.entry.js → p-7b286e8d.entry.js} +1 -1
  311. package/dist/twilight/{p-2f2956d9.entry.js → p-8284d68b.entry.js} +1 -1
  312. package/dist/twilight/{p-4af910f1.entry.js → p-86622485.entry.js} +1 -1
  313. package/dist/twilight/{p-67efee3a.entry.js → p-8ca39b58.entry.js} +1 -1
  314. package/dist/twilight/{p-12a43d43.entry.js → p-8e10a9a9.entry.js} +1 -1
  315. package/dist/twilight/{p-dff3411a.entry.js → p-8ee698cc.entry.js} +1 -1
  316. package/dist/twilight/{p-89a82ff5.entry.js → p-8f11c556.entry.js} +1 -1
  317. package/dist/twilight/p-91ab3a03.entry.js +4 -0
  318. package/dist/twilight/{p-Ye-NG0xO.js → p-9L0Aq4PZ.js} +1 -1
  319. package/dist/twilight/{p-BJmvvw9H.js → p-B6Lo-Jz2.js} +1 -1
  320. package/dist/twilight/{p-BUfrGdXG.js → p-Ble2-eBI.js} +1 -1
  321. package/dist/twilight/{p-pCB_h2Xn.js → p-BopTxsQ2.js} +1 -1
  322. package/dist/twilight/{p-SDB-lCJg.js → p-CMHD60jb.js} +1 -1
  323. package/dist/twilight/{p-DXzyepGb.js → p-CUuXQJdT.js} +1 -1
  324. package/dist/twilight/{p-DpFFhlK6.js → p-CvrBhStg.js} +1 -1
  325. package/dist/twilight/{p-BscSw0sZ.js → p-DexDAAf1.js} +1 -1
  326. package/dist/twilight/{p-CLEHV1kt.js → p-Dgq6RHqV.js} +1 -1
  327. package/dist/twilight/{p-VDJLgJLw.js → p-VJGJYEfb.js} +1 -1
  328. package/dist/twilight/p-a1035984.entry.js +4 -0
  329. package/dist/twilight/{p-74f730e1.entry.js → p-a50073b5.entry.js} +1 -1
  330. package/dist/twilight/{p-4fdc296f.entry.js → p-a82db499.entry.js} +1 -1
  331. package/dist/twilight/{p-99702306.entry.js → p-a8d3ae7e.entry.js} +1 -1
  332. package/dist/twilight/p-a8d90638.entry.js +4 -0
  333. package/dist/twilight/{p-bfb82c90.entry.js → p-abce7e02.entry.js} +1 -1
  334. package/dist/twilight/{p-ba5546ab.entry.js → p-ad12ab8c.entry.js} +1 -1
  335. package/dist/twilight/{p-427d38a0.entry.js → p-adb31a76.entry.js} +1 -1
  336. package/dist/twilight/{p-601013e8.entry.js → p-b5a68a1a.entry.js} +1 -1
  337. package/dist/twilight/{p-fdc36d7c.entry.js → p-b695db2e.entry.js} +1 -1
  338. package/dist/twilight/{p-e1cca558.entry.js → p-ba941354.entry.js} +1 -1
  339. package/dist/twilight/{p-fa1900ec.entry.js → p-bb94c4e4.entry.js} +1 -1
  340. package/dist/twilight/{p-fc0304bf.entry.js → p-bbfaf5ac.entry.js} +1 -1
  341. package/dist/twilight/{p-2815c25a.entry.js → p-be292e0b.entry.js} +1 -1
  342. package/dist/twilight/{p-cb892619.entry.js → p-be34bd30.entry.js} +1 -1
  343. package/dist/twilight/{p-cddd3975.entry.js → p-bf2f2a36.entry.js} +1 -1
  344. package/dist/twilight/p-bfa7a257.entry.js +4 -0
  345. package/dist/twilight/{p-17522796.entry.js → p-c39c8112.entry.js} +1 -1
  346. package/dist/twilight/{p-3a1fd71a.entry.js → p-c56e1aa1.entry.js} +1 -1
  347. package/dist/twilight/{p-91f9f647.entry.js → p-c8c09f5c.entry.js} +1 -1
  348. package/dist/twilight/{p-a893e7e3.entry.js → p-c8c34286.entry.js} +1 -1
  349. package/dist/twilight/{p-88045527.entry.js → p-d41903f9.entry.js} +1 -1
  350. package/dist/twilight/{p-13011571.entry.js → p-d55b86b5.entry.js} +1 -1
  351. package/dist/twilight/{p-2fddb802.entry.js → p-d72e0350.entry.js} +1 -1
  352. package/dist/twilight/{p-95918a1a.entry.js → p-d96bc0c1.entry.js} +1 -1
  353. package/dist/twilight/{p-62dfd479.entry.js → p-db9f8104.entry.js} +2 -2
  354. package/dist/twilight/p-dd734bcb.entry.js +4 -0
  355. package/dist/twilight/p-df9d5f85.entry.js +4 -0
  356. package/dist/twilight/{p-8d7bfcf6.entry.js → p-e3a45456.entry.js} +1 -1
  357. package/dist/twilight/{p-6e08f950.entry.js → p-e5169250.entry.js} +1 -1
  358. package/dist/twilight/{p-a1738bf0.entry.js → p-ea606acc.entry.js} +1 -1
  359. package/dist/twilight/{p-2ce0c4ca.entry.js → p-effc8ceb.entry.js} +1 -1
  360. package/dist/twilight/{p-0d3be88f.entry.js → p-f2fb1121.entry.js} +1 -1
  361. package/dist/twilight/{p-5527801b.entry.js → p-fa7c358f.entry.js} +1 -1
  362. package/dist/twilight/{p-DY4LZmNP.js → p-gFG8By9O.js} +1 -1
  363. package/dist/twilight/twilight.esm.js +1 -1
  364. package/dist/types/components/salla-button/salla-button.d.ts +6 -0
  365. package/dist/types/components/salla-modal/salla-modal.d.ts +5 -0
  366. package/dist/types/components/salla-orders/interface.d.ts +1 -0
  367. package/dist/types/components/salla-orders/salla-orders.d.ts +29 -2
  368. package/dist/types/components/salla-payments/salla-payments.d.ts +4 -0
  369. package/dist/types/components/salla-product-card/salla-product-card.d.ts +18 -0
  370. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +7 -0
  371. package/dist/types/components/salla-search/interfaces.d.ts +21 -0
  372. package/dist/types/components/salla-search/salla-search.d.ts +40 -2
  373. package/dist/types/components/salla-search/utils.d.ts +19 -0
  374. package/dist/types/components/salla-trust-badges/salla-trust-badges.d.ts +0 -22
  375. package/dist/types/components.d.ts +50 -0
  376. package/package.json +5 -5
  377. package/dist/twilight/p-08fa9f0b.entry.js +0 -4
  378. package/dist/twilight/p-1066a05c.entry.js +0 -4
  379. package/dist/twilight/p-11afb8be.entry.js +0 -4
  380. package/dist/twilight/p-164cb0d8.entry.js +0 -4
  381. package/dist/twilight/p-5ecc99df.entry.js +0 -4
  382. package/dist/twilight/p-acc63da6.entry.js +0 -4
  383. package/dist/twilight/p-bb082b47.entry.js +0 -4
  384. package/dist/twilight/p-f3eab493.entry.js +0 -4
@@ -51,6 +51,79 @@ export class SallaPayments {
51
51
  .replace(/\{image\}/g, salla.url.cdn(`images/sbc.png`, 58, 58))
52
52
  .replace(/\{link\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${sbcId}`) }))));
53
53
  }
54
+ componentDidLoad() {
55
+ this.auditTrustBadge();
56
+ }
57
+ /** Reports KSA stores whose commercial-register / freelance badge is gone or hidden. */
58
+ auditTrustBadge() {
59
+ if (SallaPayments.audited || typeof IntersectionObserver === 'undefined')
60
+ return;
61
+ // Only the footer copy anchors the check; the drawer and product page ones say nothing.
62
+ if (!this.host.closest('footer'))
63
+ return;
64
+ if (salla.config.get('store.store_country') !== 'SA')
65
+ return;
66
+ if (salla.config.get('page.slug') !== 'index')
67
+ return;
68
+ if (!salla.config.get('store.settings.commercial_number')
69
+ && !salla.config.get('store.settings.freelance_number'))
70
+ return;
71
+ const isShown = (el) => {
72
+ const check = el.checkVisibility;
73
+ if (typeof check !== 'function')
74
+ return true;
75
+ const options = { contentVisibilityAuto: true, visibilityProperty: true };
76
+ if (!check.call(el, options))
77
+ return false;
78
+ if (check.call(el, { ...options, opacityProperty: true }))
79
+ return true;
80
+ // Faded out but off screen: a scroll animation not run yet, not a hide.
81
+ const rect = el.getBoundingClientRect();
82
+ return !(rect.bottom > 0 && rect.right > 0
83
+ && rect.top < window.innerHeight && rect.left < window.innerWidth);
84
+ };
85
+ const verdict = () => {
86
+ const badges = Array.from(document.querySelectorAll('salla-trust-badges'));
87
+ if (!badges.length)
88
+ return 'absent';
89
+ // Un-hydrated: Stencil keeps the host hidden, not the merchant.
90
+ if (badges.some(el => !el.classList.contains('hydrated')))
91
+ return null;
92
+ return badges.some(isShown) ? null : 'hidden';
93
+ };
94
+ const observer = new IntersectionObserver(entries => {
95
+ if (SallaPayments.audited || !entries.some(entry => entry.isIntersecting))
96
+ return;
97
+ SallaPayments.audited = true;
98
+ observer.disconnect();
99
+ // Settle first, so a footer still running its entrance animation is not read as a hide.
100
+ setTimeout(() => {
101
+ if (!verdict())
102
+ return;
103
+ // Second look, so a late animation is not read as a hide.
104
+ setTimeout(async () => {
105
+ const cause = verdict();
106
+ if (!cause || salla.storage.getWithTTL('salla::tb-audit'))
107
+ return;
108
+ try {
109
+ await salla.analytics?.log('salla::trust-badges.hidden', {
110
+ store_id: salla.config.get('store.id'),
111
+ store_username: salla.config.get('store.username'),
112
+ theme_id: salla.config.get('theme.name'),
113
+ page_slug: salla.config.get('page.slug'),
114
+ cause,
115
+ });
116
+ // Marker lands after delivery, so a dropped request retries next visit.
117
+ salla.storage.setWithTTL('salla::tb-audit', true, 24 * 60);
118
+ }
119
+ catch (error) {
120
+ salla.logger.error('salla-payments:: failed to report a hidden trust badge', error);
121
+ }
122
+ }, 2000);
123
+ }, 4000);
124
+ }, { threshold: 0.5 });
125
+ observer.observe(this.host);
126
+ }
54
127
  componentDidRender() {
55
128
  //todo:: double check about the following workaround to reduce the dom length, it looks unusal
56
129
  this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));
@@ -98,3 +171,4 @@ export class SallaPayments {
98
171
  }
99
172
  /** Slugs whose mini logo lives on the new assets CDN; add one when its logo is re-uploaded there. */
100
173
  SallaPayments.NEW_CDN_LOGOS = ['tabby_installment', 'emkan_installment'];
174
+ SallaPayments.audited = false;
@@ -366,6 +366,7 @@
366
366
  }
367
367
  .s-product-card-content-title a {
368
368
  display: block;
369
+ text-align: start;
369
370
  font-size: 0.875rem;
370
371
  line-height: 1.25rem;
371
372
  font-weight: 700;
@@ -382,6 +383,13 @@
382
383
  align-items: center;
383
384
  justify-content: space-between;
384
385
  }
386
+ .s-product-card-out-of-stock-label {
387
+ font-size: 0.75rem;
388
+ line-height: 1rem;
389
+ font-weight: 700;
390
+ --tw-text-opacity: 1;
391
+ color: rgb(239 68 68 / var(--tw-text-opacity, 1));
392
+ }
385
393
  .s-product-card-rating {
386
394
  display: flex;
387
395
  align-items: center;
@@ -622,6 +630,12 @@
622
630
  .s-product-card-compact .s-product-card-content-footer {
623
631
  margin-top: 0px;
624
632
  flex-shrink: 0;
633
+ gap: 0.5rem;
634
+ }
635
+ .s-product-card-add-to-cart-icon svg {
636
+ height: 1rem;
637
+ width: 1rem;
638
+ fill: currentColor;
625
639
  }
626
640
  .s-product-card-compact .s-add-product-button-compact salla-button .s-button-btn {
627
641
  height: 2rem;
@@ -658,7 +672,7 @@
658
672
  .s-product-card-compact .s-product-card-content-title {
659
673
  font-size: 0.875rem;
660
674
  line-height: 1.25rem;
661
- font-weight: 600;
675
+ font-weight: 500;
662
676
  line-height: 1.25;
663
677
  --tw-text-opacity: 1;
664
678
  color: rgb(55 65 81 / var(--tw-text-opacity, 1));
@@ -668,7 +682,7 @@
668
682
  display: -webkit-box;
669
683
  -webkit-box-orient: vertical;
670
684
  -webkit-line-clamp: 2;
671
- display: block;
685
+ font-weight: 500;
672
686
  }
673
687
  .s-product-card-compact .s-product-card-content-subtitle {
674
688
  margin-top: 0.25rem;
@@ -710,3 +724,9 @@
710
724
  .s-product-card-compact .s-product-card-promotion-title {
711
725
  display: none;
712
726
  }
727
+ .s-search-grid-item .s-product-card-out-badge {
728
+ --tw-bg-opacity: 1;
729
+ background-color: rgb(254 226 226 / var(--tw-bg-opacity, 1));
730
+ --tw-text-opacity: 1;
731
+ color: rgb(220 38 38 / var(--tw-text-opacity, 1));
732
+ }
@@ -4,11 +4,30 @@
4
4
  import { Host, h } from "@stencil/core";
5
5
  import Heart from "../../assets/svg/heart.svg";
6
6
  import Star from "../../assets/svg/star2.svg";
7
+ import Cart from "../../assets/svg/cart.svg";
7
8
  /**
8
9
  * @slot add-to-cart-label - Add to cart label.
9
10
  */
10
11
  export class SallaProductCard {
11
12
  constructor() {
13
+ /**
14
+ * Force-show the wishlist button even in layouts (e.g. horizontal + compact)
15
+ * that otherwise wouldn't render one. Defaults to `false`.
16
+ */
17
+ this.forceShowWishlistButton = false;
18
+ /**
19
+ * Show only the cart icon instead of the text label on the add-to-cart button.
20
+ * Defaults to `false`.
21
+ */
22
+ this.compactAddToCart = false;
23
+ /**
24
+ * Show the out-of-stock label beside the price instead of as the image badge
25
+ * rendered by `getProductBadge()`. Defaults to `false`.
26
+ */
27
+ this.showOutOfStockBesidePrice = false;
28
+ // CSS line-clamp alone isn't reliable enough here (cross-browser + RTL edge cases), so
29
+ // compact titles are also hard-truncated in JS to guarantee at most ~2 lines.
30
+ this.COMPACT_TITLE_MAX_LENGTH = 60;
12
31
  // Store configs
13
32
  salla.onReady(() => {
14
33
  this.fitImageHeight = salla.config.get('store.settings.product.fit_type');
@@ -63,18 +82,30 @@ export class SallaProductCard {
63
82
  let d = new Date(date);
64
83
  return `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`;
65
84
  }
85
+ getDisplayTitle() {
86
+ const name = this.productData?.name || '';
87
+ if (!this.compact || name.length <= this.COMPACT_TITLE_MAX_LENGTH) {
88
+ return name;
89
+ }
90
+ return name.slice(0, this.COMPACT_TITLE_MAX_LENGTH).trimEnd() + '…';
91
+ }
66
92
  getProductBadge() {
67
- if (this.productData.promotion_title) {
68
- return h("div", { class: "s-product-card-promotion-title" }, this.productData.promotion_title);
93
+ if (this.productData?.is_out_of_stock && !this.showOutOfStockBesidePrice) {
94
+ return h("div", { class: "s-product-card-out-badge" }, this.outOfStock);
69
95
  }
70
96
  if (this.showQuantity && this.productData?.quantity) {
71
97
  return h("div", { class: "s-product-card-quantity" }, this.remained, " ", salla.helpers.number(this.productData?.quantity));
72
98
  }
73
- if (this.showQuantity && this.productData?.is_out_of_stock) {
74
- return h("div", { class: "s-product-card-out-badge" }, this.outOfStock);
99
+ if (this.productData.promotion_title) {
100
+ return h("div", { class: "s-product-card-promotion-title" }, this.productData.promotion_title);
75
101
  }
76
102
  return '';
77
103
  }
104
+ renderAddToCartLabel() {
105
+ return (h("slot", { name: "add-to-cart-label" }, this.compactAddToCart
106
+ ? h("span", { class: "s-product-card-add-to-cart-icon", innerHTML: Cart })
107
+ : this.productData.add_to_cart_label));
108
+ }
78
109
  getPriceFormat(price) {
79
110
  if (!price || price == 0) {
80
111
  return salla.config.get('store.settings.product.show_price_as_dash') ? '-' : '';
@@ -105,14 +136,14 @@ export class SallaProductCard {
105
136
  's-product-card-out-of-stock': this.productData?.is_out_of_stock,
106
137
  };
107
138
  const hrefProp = this.productData?.url ? { href: this.productData.url, title: `Learn more about ${this.productData?.name}` } : {};
108
- return (h(Host, { key: 'c5a6d2bc2fcf23da1a41ab8b19b2e981fb111e30', id: `product-${this.productData?.id}`, class: classes }, h("div", { key: 'e8d5105e4dbe367c612d62ef1dd6c95d04f440b0', class: !this.fullImage ? 's-product-card-image' : 's-product-card-image-full' }, h("a", { key: '8714997fcb48ef0eaabdf0a52cb775514e53db56', ...hrefProp }, h("img", { key: 'eebd3c1dde0894037a7723c46e2f07f6a5aef939', class: `s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)
139
+ return (h(Host, { key: 'e0748a44b8e851c7aff3ee741a17dcb19dabfdaf', id: `product-${this.productData?.id}`, class: classes }, h("div", { key: '10cc1deb8384ad2bbe83263f82b257d5042cff8e', class: !this.fullImage ? 's-product-card-image' : 's-product-card-image-full' }, h("a", { key: 'd976cc14bb10c2d5fe6c55253ea051b8a57d7721', ...hrefProp }, h("img", { key: '9007014be0cb7adc56541e0b1e823fb4d6f92b84', class: `s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)
109
140
  ? 'contain'
110
141
  : this.fitImageHeight
111
142
  ? this.fitImageHeight
112
- : 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && h("a", { key: '72e240315320e976dcad8d3f027711b9c1d7bcf1', ...hrefProp, class: "s-product-card-overlay" }), !this.horizontal && !this.fullImage ?
113
- h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, h("span", { innerHTML: Heart })) : ''), h("div", { key: '2f0186ffc102488824cd7c346f4e07439474fc26', class: "s-product-card-content" }, this.isSpecial && this.productData?.quantity ?
143
+ : 'cover'} lazy`, src: this.placeholder, alt: this.productData?.image?.alt || this.productData?.name, "data-src": this.productData?.image?.url || this.productData?.thumbnail }), !this.fullImage && !this.minimal ? this.getProductBadge() : ''), this.fullImage && h("a", { key: 'c101c02eeb4e0245fbcd713b0e83c81148e594c1', ...hrefProp, class: "s-product-card-overlay" }), !this.horizontal && !this.fullImage ?
144
+ h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, "aria-label": "Add or remove to wishlist", ref: el => this.wishlistBtn = el, class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, h("span", { innerHTML: Heart })) : ''), h("div", { key: 'f02eaeabefd56d7b560dcd268e2b941cf843cc95', class: "s-product-card-content" }, this.isSpecial && this.productData?.quantity ?
114
145
  h("div", { class: "s-product-card-content-pie", ref: pie => this.pie = pie }, h("span", null, h("b", null, salla.helpers.number(this.productData?.quantity)), this.remained), h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -1 36 34", class: "s-product-card-content-pie-svg" }, h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-base" }), h("circle", { cx: "16", cy: "16", r: "15.9155", class: "s-product-card-content-pie-svg-bar" })))
115
- : '', h("div", { key: 'd50ea0726d25bf3b551050e906fc615bc682e694', class: { 's-product-card-content-main': true, 's-product-card-content-extra-padding': this.isSpecial } }, h("h3", { key: 'e4f39676d661a01d1aa6352cac7be6e764fa8687', class: "s-product-card-content-title" }, h("a", { key: '0aacc2e00a0db730d1e803da34336085082df75d', ...hrefProp }, this.productData?.name)), this.productData?.subtitle && !this.minimal ?
146
+ : '', h("div", { key: '9776564de24468852192dce1ff0db35cd6c533c3', class: { 's-product-card-content-main': true, 's-product-card-content-extra-padding': this.isSpecial } }, h("h3", { key: 'd78ea05cba95053f99495c5e8aeb59a9b66557c8', class: "s-product-card-content-title" }, h("a", { key: 'a8ba81e8ba7a4e59cf4c6bcb4370ea0965b82087', ...hrefProp }, this.getDisplayTitle())), this.productData?.subtitle && !this.minimal ?
116
147
  h("p", { class: "s-product-card-content-subtitle" }, this.productData?.subtitle)
117
148
  : ''), this.productData?.donation && !this.minimal && !this.fullImage ?
118
149
  [h("salla-progress-bar", { donation: this.productData?.donation }), h("div", { class: "s-product-card-donation-input" }, this.productData?.donation?.can_donate ?
@@ -121,16 +152,20 @@ export class SallaProductCard {
121
152
  this.addBtn.donatingAmount = e.target.value;
122
153
  }, id: "donation-amount", name: "donating_amount", class: "s-form-control", placeholder: this.donationAmount })]
123
154
  : '')]
124
- : '', h("div", { key: '445a1e16fee6ebb6ab5012aca324d3845991d13e', class: { 's-product-card-content-sub': true, 's-product-card-content-extra-padding': this.isSpecial } }, this.getProductPrice(), this.productData?.rating?.stars && !this.minimal ?
155
+ : '', h("div", { key: '290e93db790c81a11e8d2edf3d215cec03edc965', class: { 's-product-card-content-sub': true, 's-product-card-content-extra-padding': this.isSpecial } }, this.getProductPrice(), this.showOutOfStockBesidePrice && this.productData?.is_out_of_stock ?
156
+ h("span", { class: "s-product-card-out-of-stock-label" }, this.outOfStock)
157
+ : '', this.productData?.rating?.stars && !this.minimal ?
125
158
  h("div", { class: "s-product-card-rating" }, h("span", { innerHTML: Star }), h("span", null, this.productData.rating.stars))
126
159
  : ''), this.isSpecial && this.productData.discount_ends
127
160
  ? h("salla-count-down", { date: this.formatDate(this.productData.discount_ends), "end-of-day": true, boxed: true, labeled: true })
128
161
  : '', !this.hideAddBtn && !this.compact ?
129
- h("div", { class: "s-product-card-content-footer" }, h("salla-add-product-button", { fill: "outline", width: "wide", ref: el => this.addBtn = el, "product-id": this.productData.id, "product-status": this.productData.status, "product-type": this.productData.type }, h("slot", { name: "add-to-cart-label" }, this.productData.add_to_cart_label)), this.horizontal || this.fullImage ?
162
+ h("div", { class: "s-product-card-content-footer" }, h("salla-add-product-button", { fill: "outline", width: "wide", ref: el => this.addBtn = el, "product-id": this.productData.id, "product-status": this.productData.status, "product-type": this.productData.type }, this.renderAddToCartLabel()), this.horizontal || this.fullImage ?
130
163
  h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, ref: el => this.wishlistBtn = el, "aria-label": "Add or remove to wishlist", class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick(), "data-id": "{{ product.id }}" }, h("span", { class: "text-xl", innerHTML: Heart }))
131
164
  : '')
132
165
  : ''), !this.hideAddBtn && this.compact ?
133
- h("div", { class: "s-product-card-content-footer" }, h("salla-add-product-button", { ref: el => this.addBtn = el, "product-id": this.productData.id, "product-status": this.productData.status, "product-type": this.productData.type, class: "s-add-product-button-compact" }, h("slot", { name: "add-to-cart-label" }, this.productData.add_to_cart_label)))
166
+ h("div", { class: "s-product-card-content-footer" }, h("salla-add-product-button", { ref: el => this.addBtn = el, "product-id": this.productData.id, "product-status": this.productData.status, "product-type": this.productData.type, class: "s-add-product-button-compact" }, this.renderAddToCartLabel()), this.forceShowWishlistButton ?
167
+ h("salla-button", { shape: "icon", fill: "none", color: "light", loading: false, ref: el => this.wishlistBtn = el, "aria-label": "Add or remove to wishlist", class: "s-product-card-wishlist-btn animated", onClick: () => this.handleWishlistClick() }, h("span", { innerHTML: Heart }))
168
+ : '')
134
169
  : ''));
135
170
  }
136
171
  componentDidLoad() {
@@ -326,6 +361,66 @@ export class SallaProductCard {
326
361
  "getter": false,
327
362
  "setter": false,
328
363
  "reflect": true
364
+ },
365
+ "forceShowWishlistButton": {
366
+ "type": "boolean",
367
+ "attribute": "force-show-wishlist-button",
368
+ "mutable": false,
369
+ "complexType": {
370
+ "original": "boolean",
371
+ "resolved": "boolean",
372
+ "references": {}
373
+ },
374
+ "required": false,
375
+ "optional": false,
376
+ "docs": {
377
+ "tags": [],
378
+ "text": "Force-show the wishlist button even in layouts (e.g. horizontal + compact)\nthat otherwise wouldn't render one. Defaults to `false`."
379
+ },
380
+ "getter": false,
381
+ "setter": false,
382
+ "reflect": false,
383
+ "defaultValue": "false"
384
+ },
385
+ "compactAddToCart": {
386
+ "type": "boolean",
387
+ "attribute": "compact-add-to-cart",
388
+ "mutable": false,
389
+ "complexType": {
390
+ "original": "boolean",
391
+ "resolved": "boolean",
392
+ "references": {}
393
+ },
394
+ "required": false,
395
+ "optional": false,
396
+ "docs": {
397
+ "tags": [],
398
+ "text": "Show only the cart icon instead of the text label on the add-to-cart button.\nDefaults to `false`."
399
+ },
400
+ "getter": false,
401
+ "setter": false,
402
+ "reflect": false,
403
+ "defaultValue": "false"
404
+ },
405
+ "showOutOfStockBesidePrice": {
406
+ "type": "boolean",
407
+ "attribute": "show-out-of-stock-beside-price",
408
+ "mutable": false,
409
+ "complexType": {
410
+ "original": "boolean",
411
+ "resolved": "boolean",
412
+ "references": {}
413
+ },
414
+ "required": false,
415
+ "optional": false,
416
+ "docs": {
417
+ "tags": [],
418
+ "text": "Show the out-of-stock label beside the price instead of as the image badge\nrendered by `getProductBadge()`. Defaults to `false`."
419
+ },
420
+ "getter": false,
421
+ "setter": false,
422
+ "reflect": false,
423
+ "defaultValue": "false"
329
424
  }
330
425
  };
331
426
  }
@@ -49,6 +49,7 @@ export class SallaRatingModalV2 {
49
49
  this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
50
50
  this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
51
51
  this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
52
+ this.nothingToRateLabel = salla.lang.get('pages.rating.nothing_to_rate');
52
53
  this.contactUsLabel = salla.lang.get('blocks.footer.social');
53
54
  this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
54
55
  this.rateTheFollowingLabel = salla.lang.get('pages.rating.rate_the_following_factors');
@@ -270,6 +271,23 @@ export class SallaRatingModalV2 {
270
271
  return this.getOrderProducts(order).filter(item => !this.hasRatingFeedback(item?.feedback) &&
271
272
  (!this.productId || String(item.product.id) === String(this.productId)));
272
273
  }
274
+ /**
275
+ * True when the order never had anything ratable to begin with (as opposed to
276
+ * everything already being rated). Distinguishes a genuinely broken/empty
277
+ * order-feedback response from the legitimate "all done, thank you" state.
278
+ */
279
+ hasNothingToRate(order = this.order) {
280
+ if (!order) {
281
+ return true;
282
+ }
283
+ const testimonialsEverPossible = order.testimonials_enabled !== false &&
284
+ (order.testimonials_enabled === true || !!order.allowed_ratings?.testimonials_enabled);
285
+ const shippingEverPossible = !!order.shipping?.company &&
286
+ order.shipping_enabled !== false &&
287
+ (order.shipping_enabled === true || !!order.allowed_ratings?.shipping_enabled);
288
+ const productsEverPossible = order.products_enabled !== false && this.getOrderProducts(order).length > 0;
289
+ return !testimonialsEverPossible && !shippingEverPossible && !productsEverPossible;
290
+ }
273
291
  getStepsCount(order = this.order) {
274
292
  if (!order) {
275
293
  return 0;
@@ -349,15 +367,16 @@ export class SallaRatingModalV2 {
349
367
  this.defaultMode = true;
350
368
  this.currentIndex = 0;
351
369
  this.submitted = [];
370
+ const requestedOrderId = this.getRatingOrderId();
352
371
  return new Promise(resolve => {
353
372
  setTimeout(() => {
354
373
  this.modal
355
374
  ?.open()
356
- .then(() => this.order ||
375
+ .then(() => (this.order && this.order.id === requestedOrderId) ||
357
376
  (this.isUnverifiedReview()
358
377
  ? this.loadUnverifiedProductOrder()
359
378
  : salla.api
360
- .withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
379
+ .withoutNotifier(() => salla.rating.api.order(requestedOrderId))
361
380
  .then(async (res) => {
362
381
  this.order = res.data;
363
382
  this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
@@ -503,6 +522,11 @@ export class SallaRatingModalV2 {
503
522
  this.steps = this.modal?.querySelectorAll('.s-rating-modal-step');
504
523
  this.dots = this.modal?.querySelectorAll('.s-rating-modal-step-dot');
505
524
  if (this.stepsCount === 0) {
525
+ if (this.hasNothingToRate()) {
526
+ this.hasError = true;
527
+ this.errorMessage = this.nothingToRateLabel;
528
+ return;
529
+ }
506
530
  this.showThankYou();
507
531
  return;
508
532
  }
@@ -1321,7 +1345,7 @@ export class SallaRatingModalV2 {
1321
1345
  if (el)
1322
1346
  this.nextBtn = el;
1323
1347
  }, onClick: () => this.submit() }, salla.lang.get('common.elements.next'))),
1324
- ]) : (h("salla-placeholder", { alignment: "center" })))));
1348
+ ]) : (h("div", { class: "s-rating-modal-wrapper" }, h("salla-placeholder", { alignment: "center" }, this.errorMessage ? (h("span", { slot: "description" }, this.errorMessage)) : null))))));
1325
1349
  }
1326
1350
  }
1327
1351
  async componentWillLoad() {
@@ -1405,6 +1429,10 @@ export class SallaRatingModalV2 {
1405
1429
  ar: 'شاركنا صورة مع تقييمك للطلب واكسب :points نقطة ولاء',
1406
1430
  en: 'Share a photo with your order review and earn :points loyalty points',
1407
1431
  },
1432
+ 'pages.rating.nothing_to_rate': {
1433
+ ar: 'لا يوجد شيء متاح للتقييم في هذا الطلب حاليًا.',
1434
+ en: 'There is nothing available to rate for this order right now.',
1435
+ },
1408
1436
  });
1409
1437
  this.contactUsLabel = salla.lang.get('blocks.footer.social');
1410
1438
  this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
@@ -1417,6 +1445,7 @@ export class SallaRatingModalV2 {
1417
1445
  this.cancelLabel = salla.lang.get('common.elements.cancel');
1418
1446
  this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
1419
1447
  this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
1448
+ this.nothingToRateLabel = salla.lang.get('pages.rating.nothing_to_rate');
1420
1449
  this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
1421
1450
  this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
1422
1451
  this.rateTheFollowingLabel = salla.lang.get('pages.rating.rate_the_following_factors');
@@ -167,9 +167,10 @@ export class SallaRatingModal {
167
167
  return this.getV2Ref()?.open();
168
168
  }
169
169
  this.defaultMode = true;
170
+ const requestedOrderId = this.orderId ? this.orderId : salla.config.get('page.id');
170
171
  return new Promise((resolve) => {
171
172
  setTimeout(() => {
172
- this.modal.open().then(() => this.order || salla.api.withoutNotifier(() => salla.rating.api.order(this.orderId ? this.orderId : salla.config.get('page.id'))).then(res => this.order = res.data))
173
+ this.modal.open().then(() => (this.order && this.order.id === requestedOrderId) || salla.api.withoutNotifier(() => salla.rating.api.order(requestedOrderId)).then(res => this.order = res.data))
173
174
  .then(() => this.readyUpLoyaltyPoints())
174
175
  .then(() => this.modal.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
175
176
  .then(() => {