@salla.sa/twilight-components 2.14.467 → 2.14.469

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 (364) hide show
  1. package/dist/cjs/{filepond-Li5IcLEr.js → filepond-CG7dNZgq.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-CXgEvsrj.js → filepond-plugin-file-poster-B1zrjwgr.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DISjKBXN.js → filepond-plugin-file-validate-size-BqZtoWbe.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-BeDqb2RU.js → filepond-plugin-file-validate-type-BGmGKK9L.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-CTKgasCY.js → filepond-plugin-image-edit-CYeh6qmG.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BqvyVbfM.js → filepond-plugin-image-exif-orientation-BEVpo-ZQ.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-DfX-wD-s.js → filepond-plugin-image-preview-C7MMEZFE.js} +1 -1
  8. package/dist/cjs/{functions-DXNacMtu.js → functions-CnBVKKGk.js} +1 -1
  9. package/dist/cjs/{index-2n84VIdz.js → index-BNOCK3IN.js} +1 -1
  10. package/dist/cjs/{index-JuURs8Nc.js → index-inmL4H71.js} +9 -5
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/{mail-Bgvt2hc9.js → mail-C9D8MHae.js} +2 -2
  13. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +29 -84
  16. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +91 -7
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  29. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-gifting.cjs.entry.js +85 -31
  38. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-login-modal.cjs.entry.js +32 -2
  44. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +4 -4
  46. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  51. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  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.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.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-branch.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-summary.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-products-list.cjs.entry.js +259 -64
  82. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
  85. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  86. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-social-share.cjs.entry.js +252 -32
  91. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  93. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  99. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  100. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +329 -0
  102. package/dist/cjs/{tracked-promise-BdbqBT_O.js → tracked-promise-DvLhM2Sx.js} +1 -1
  103. package/dist/cjs/twilight.cjs.js +2 -2
  104. package/dist/cjs/{vanilla-picker-Cj5ogibZ.js → vanilla-picker-DtuN6WGq.js} +1 -1
  105. package/dist/collection/collection-manifest.json +2 -1
  106. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +90 -6
  107. package/dist/collection/components/salla-gifting/salla-gifting.css +18 -0
  108. package/dist/collection/components/salla-gifting/salla-gifting.js +91 -31
  109. package/dist/collection/components/salla-login-modal/salla-login-modal.js +31 -1
  110. package/dist/collection/components/salla-product-options/salla-product-options.css +0 -3
  111. package/dist/collection/components/salla-product-options/salla-product-options.js +28 -84
  112. package/dist/collection/components/salla-products-list/salla-products-list.css +76 -0
  113. package/dist/collection/components/salla-products-list/salla-products-list.js +387 -65
  114. package/dist/collection/components/salla-social-share/salla-social-share.css +161 -0
  115. package/dist/collection/components/salla-social-share/salla-social-share.js +316 -50
  116. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  117. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  118. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  119. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  120. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  121. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  122. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.css +65 -0
  123. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +432 -0
  124. package/dist/components/index.js +5 -5
  125. package/dist/components/salla-bullet-delivery.js +90 -6
  126. package/dist/components/salla-gifting.js +86 -30
  127. package/dist/components/salla-login-modal2.js +31 -1
  128. package/dist/components/salla-product-options2.js +28 -84
  129. package/dist/components/salla-products-list2.js +266 -64
  130. package/dist/components/salla-social-share.js +1 -189
  131. package/dist/components/salla-social-share2.js +420 -0
  132. package/dist/components/salla-tab-content2.js +1 -1
  133. package/dist/components/salla-tab-header2.js +1 -1
  134. package/dist/components/salla-tabs2.js +1 -1
  135. package/dist/components/salla-tel-input2.js +1 -1
  136. package/dist/components/salla-tooltip2.js +1 -1
  137. package/dist/components/salla-user-settings.js +1 -1
  138. package/dist/components/salla-wishlist-actions.d.ts +11 -0
  139. package/dist/components/salla-wishlist-actions.js +375 -0
  140. package/dist/esm/{filepond-Cpf2HNH9.js → filepond-D4dDq1wa.js} +1 -1
  141. package/dist/esm/{filepond-plugin-file-poster-CVurRtjC.js → filepond-plugin-file-poster-CcnsMPSH.js} +1 -1
  142. package/dist/esm/{filepond-plugin-file-validate-size-Dw2xFbfx.js → filepond-plugin-file-validate-size-qgEgRYkk.js} +1 -1
  143. package/dist/esm/{filepond-plugin-file-validate-type-D6seJVa2.js → filepond-plugin-file-validate-type-BuFGnco8.js} +1 -1
  144. package/dist/esm/{filepond-plugin-image-edit-CBikW78V.js → filepond-plugin-image-edit-kS2Sie2d.js} +1 -1
  145. package/dist/esm/{filepond-plugin-image-exif-orientation-5yNhe9TO.js → filepond-plugin-image-exif-orientation-Bjoh_of2.js} +1 -1
  146. package/dist/esm/{filepond-plugin-image-preview-PlAAXB7f.js → filepond-plugin-image-preview-b_VEHHGf.js} +1 -1
  147. package/dist/esm/{functions-Egzz8fEM.js → functions-ISZQDw0y.js} +1 -1
  148. package/dist/esm/{index-Do4FV1UZ.js → index-CqC4wD_f.js} +1 -1
  149. package/dist/esm/{index-a4x9urdK.js → index-Cqh-ta1v.js} +9 -5
  150. package/dist/esm/loader.js +3 -3
  151. package/dist/esm/{mail-DLNIOD9t.js → mail-DzAIgzdz.js} +2 -2
  152. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  153. package/dist/esm/salla-accordion_6.entry.js +1 -1
  154. package/dist/esm/salla-add-product-button_5.entry.js +29 -84
  155. package/dist/esm/salla-advertisement.entry.js +1 -1
  156. package/dist/esm/salla-alert_2.entry.js +1 -1
  157. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  158. package/dist/esm/salla-apps-icons.entry.js +1 -1
  159. package/dist/esm/salla-badge.entry.js +1 -1
  160. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  161. package/dist/esm/salla-bullet-delivery_2.entry.js +91 -7
  162. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  163. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  164. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  165. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  166. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  167. package/dist/esm/salla-contacts.entry.js +3 -3
  168. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  169. package/dist/esm/salla-count-down.entry.js +1 -1
  170. package/dist/esm/salla-custom-fields.entry.js +1 -1
  171. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  172. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  173. package/dist/esm/salla-filters-widget.entry.js +1 -1
  174. package/dist/esm/salla-filters.entry.js +1 -1
  175. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  176. package/dist/esm/salla-gifting.entry.js +85 -31
  177. package/dist/esm/salla-hook.entry.js +1 -1
  178. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  179. package/dist/esm/salla-installment.entry.js +1 -1
  180. package/dist/esm/salla-list-tile.entry.js +1 -1
  181. package/dist/esm/salla-localization-modal.entry.js +1 -1
  182. package/dist/esm/salla-login-modal.entry.js +32 -2
  183. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  184. package/dist/esm/salla-loyalty-hero_2.entry.js +4 -4
  185. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  186. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  187. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  188. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  189. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  190. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  191. package/dist/esm/salla-loyalty.entry.js +1 -1
  192. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  193. package/dist/esm/salla-map.entry.js +1 -1
  194. package/dist/esm/salla-menu.entry.js +1 -1
  195. package/dist/esm/salla-metadata.entry.js +1 -1
  196. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  197. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  198. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  199. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  200. package/dist/esm/salla-notification-item.entry.js +1 -1
  201. package/dist/esm/salla-notifications.entry.js +1 -1
  202. package/dist/esm/salla-offer-modal.entry.js +1 -1
  203. package/dist/esm/salla-offer.entry.js +1 -1
  204. package/dist/esm/salla-order-branch.entry.js +1 -1
  205. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  206. package/dist/esm/salla-order-details-options.entry.js +1 -1
  207. package/dist/esm/salla-order-details.entry.js +1 -1
  208. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  209. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  210. package/dist/esm/salla-order-edit.entry.js +1 -1
  211. package/dist/esm/salla-order-summary.entry.js +1 -1
  212. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  213. package/dist/esm/salla-orders.entry.js +1 -1
  214. package/dist/esm/salla-payments.entry.js +1 -1
  215. package/dist/esm/salla-placeholder.entry.js +1 -1
  216. package/dist/esm/salla-price-range.entry.js +1 -1
  217. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  218. package/dist/esm/salla-product-card_2.entry.js +1 -1
  219. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  220. package/dist/esm/salla-products-list.entry.js +259 -64
  221. package/dist/esm/salla-progress-bar.entry.js +1 -1
  222. package/dist/esm/salla-quick-order.entry.js +3 -3
  223. package/dist/esm/salla-rating-modal.entry.js +3 -3
  224. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  225. package/dist/esm/salla-scopes.entry.js +1 -1
  226. package/dist/esm/salla-search.entry.js +1 -1
  227. package/dist/esm/salla-skeleton.entry.js +1 -1
  228. package/dist/esm/salla-slider.entry.js +1 -1
  229. package/dist/esm/salla-social-share.entry.js +252 -32
  230. package/dist/esm/salla-social.entry.js +1 -1
  231. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  232. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  233. package/dist/esm/salla-tooltip.entry.js +2 -2
  234. package/dist/esm/salla-trust-badges.entry.js +1 -1
  235. package/dist/esm/salla-user-menu.entry.js +1 -1
  236. package/dist/esm/salla-user-profile.entry.js +1 -1
  237. package/dist/esm/salla-user-settings.entry.js +2 -2
  238. package/dist/esm/salla-verify.entry.js +3 -3
  239. package/dist/esm/salla-wallet.entry.js +1 -1
  240. package/dist/esm/salla-wishlist-actions.entry.js +327 -0
  241. package/dist/esm/{tracked-promise-BX5clCDX.js → tracked-promise-CH_UyK-l.js} +1 -1
  242. package/dist/esm/twilight.js +3 -3
  243. package/dist/esm/{vanilla-picker-DB0pDHa7.js → vanilla-picker-PE31tu9y.js} +1 -1
  244. package/dist/twilight/{p-afcb0117.entry.js → p-054c9462.entry.js} +1 -1
  245. package/dist/twilight/{p-78020271.entry.js → p-06372aeb.entry.js} +1 -1
  246. package/dist/twilight/p-06c06719.entry.js +4 -0
  247. package/dist/twilight/{p-16bcc5ab.entry.js → p-0c7efc0b.entry.js} +1 -1
  248. package/dist/twilight/{p-53cbb271.entry.js → p-0cca1b63.entry.js} +1 -1
  249. package/dist/twilight/{p-ad19661d.entry.js → p-1415eb5e.entry.js} +1 -1
  250. package/dist/twilight/{p-a53d5944.entry.js → p-14a3277b.entry.js} +1 -1
  251. package/dist/twilight/{p-92b02f3c.entry.js → p-15b3f969.entry.js} +1 -1
  252. package/dist/twilight/{p-241bd42e.entry.js → p-16b64bb5.entry.js} +1 -1
  253. package/dist/twilight/{p-37457147.entry.js → p-16c64a38.entry.js} +1 -1
  254. package/dist/twilight/{p-f5135cb5.entry.js → p-17920aa7.entry.js} +1 -1
  255. package/dist/twilight/{p-ec5ae058.entry.js → p-196fad8d.entry.js} +1 -1
  256. package/dist/twilight/{p-5803c158.entry.js → p-19fe2b27.entry.js} +1 -1
  257. package/dist/twilight/{p-316135f8.entry.js → p-1c0f9fd9.entry.js} +1 -1
  258. package/dist/twilight/{p-1130d4b7.entry.js → p-1db8b515.entry.js} +1 -1
  259. package/dist/twilight/{p-d0340e11.entry.js → p-219b14c4.entry.js} +1 -1
  260. package/dist/twilight/{p-127ee640.entry.js → p-227d11a0.entry.js} +1 -1
  261. package/dist/twilight/p-293a6d6b.entry.js +4 -0
  262. package/dist/twilight/{p-0c748664.entry.js → p-2ba603bc.entry.js} +1 -1
  263. package/dist/twilight/p-2dbb3b49.entry.js +4 -0
  264. package/dist/twilight/{p-5b365561.entry.js → p-31bd852c.entry.js} +1 -1
  265. package/dist/twilight/{p-92f3ea44.entry.js → p-32a7cb85.entry.js} +1 -1
  266. package/dist/twilight/{p-1a37b959.entry.js → p-32d5d279.entry.js} +1 -1
  267. package/dist/twilight/{p-91363b7e.entry.js → p-36884c05.entry.js} +1 -1
  268. package/dist/twilight/{p-13a033fa.entry.js → p-38a791cb.entry.js} +1 -1
  269. package/dist/twilight/{p-0b169d4e.entry.js → p-3b198162.entry.js} +1 -1
  270. package/dist/twilight/{p-735fafef.entry.js → p-3d517178.entry.js} +1 -1
  271. package/dist/twilight/{p-d9d4ea5b.entry.js → p-3e5a57cc.entry.js} +1 -1
  272. package/dist/twilight/{p-fa1cc092.entry.js → p-40eb9556.entry.js} +6 -6
  273. package/dist/twilight/{p-1ce817c2.entry.js → p-49181c4a.entry.js} +1 -1
  274. package/dist/twilight/p-4a81a708.entry.js +4 -0
  275. package/dist/twilight/{p-35ac1fc9.entry.js → p-4b20872a.entry.js} +1 -1
  276. package/dist/twilight/{p-e27363dd.entry.js → p-4c370853.entry.js} +1 -1
  277. package/dist/twilight/{p-e1205d19.entry.js → p-4ee20a54.entry.js} +1 -1
  278. package/dist/twilight/{p-b0bf7a5b.entry.js → p-51c30ec2.entry.js} +1 -1
  279. package/dist/twilight/{p-2bcfb4f3.entry.js → p-5334222c.entry.js} +1 -1
  280. package/dist/twilight/{p-c0380d40.entry.js → p-559bdcca.entry.js} +1 -1
  281. package/dist/twilight/{p-03d13b9f.entry.js → p-5701244a.entry.js} +1 -1
  282. package/dist/twilight/{p-0da78d4e.entry.js → p-5d364fc2.entry.js} +1 -1
  283. package/dist/twilight/{p-DiWHgCMH.js → p-5fxCpxw5.js} +1 -1
  284. package/dist/twilight/{p-08b2c781.entry.js → p-61ad2660.entry.js} +1 -1
  285. package/dist/twilight/p-6590acee.entry.js +4 -0
  286. package/dist/twilight/{p-b8ab7da8.entry.js → p-681f8874.entry.js} +1 -1
  287. package/dist/twilight/{p-d17596ff.entry.js → p-6b6f9822.entry.js} +1 -1
  288. package/dist/twilight/{p-4d393389.entry.js → p-6d23fd92.entry.js} +1 -1
  289. package/dist/twilight/p-6e723d46.entry.js +4 -0
  290. package/dist/twilight/{p-d33203b7.entry.js → p-71f2ba66.entry.js} +1 -1
  291. package/dist/twilight/{p-c8fd03c0.entry.js → p-732bd9fb.entry.js} +1 -1
  292. package/dist/twilight/{p-42a0b54a.entry.js → p-73d9e4c8.entry.js} +1 -1
  293. package/dist/twilight/{p-e90d18b2.entry.js → p-74e0d0c2.entry.js} +1 -1
  294. package/dist/twilight/{p-52fe97c8.entry.js → p-77d2312a.entry.js} +1 -1
  295. package/dist/twilight/{p-635347c9.entry.js → p-78ff445c.entry.js} +1 -1
  296. package/dist/twilight/{p-74a61155.entry.js → p-798fb3c7.entry.js} +1 -1
  297. package/dist/twilight/{p-e726123e.entry.js → p-79c20964.entry.js} +1 -1
  298. package/dist/twilight/{p-C4aFleDM.js → p-7FtjQghq.js} +1 -1
  299. package/dist/twilight/{p-0405f5e8.entry.js → p-7afe6e1a.entry.js} +1 -1
  300. package/dist/twilight/{p-b80adb19.entry.js → p-7e185acf.entry.js} +1 -1
  301. package/dist/twilight/{p-f684d7bf.entry.js → p-8b538bd7.entry.js} +1 -1
  302. package/dist/twilight/{p-bfbf8121.entry.js → p-8bcc3b86.entry.js} +1 -1
  303. package/dist/twilight/{p-a068fff4.entry.js → p-8db52fe9.entry.js} +1 -1
  304. package/dist/twilight/{p-89f11893.entry.js → p-93ec294d.entry.js} +1 -1
  305. package/dist/twilight/p-9785f314.entry.js +4 -0
  306. package/dist/twilight/{p-ff270706.entry.js → p-9a3f27e9.entry.js} +1 -1
  307. package/dist/twilight/{p-DSBkBAFI.js → p-B0uENqSF.js} +1 -1
  308. package/dist/twilight/{p-B7KW0zhB.js → p-C3kw3FEZ.js} +1 -1
  309. package/dist/twilight/{p-BVqg7xd9.js → p-CUfwD9kr.js} +1 -1
  310. package/dist/twilight/{p-a4x9urdK.js → p-Cqh-ta1v.js} +2 -2
  311. package/dist/twilight/{p-fCaOxwGH.js → p-DZ18vMT2.js} +1 -1
  312. package/dist/twilight/{p-EPfEwqOC.js → p-DyQ5MH6F.js} +1 -1
  313. package/dist/twilight/{p-DLNIOD9t.js → p-DzAIgzdz.js} +1 -1
  314. package/dist/twilight/{p-pOgjUtf9.js → p-J_27I63T.js} +1 -1
  315. package/dist/twilight/{p-10e0936d.entry.js → p-a85d80b5.entry.js} +1 -1
  316. package/dist/twilight/{p-6d47892b.entry.js → p-a918b812.entry.js} +1 -1
  317. package/dist/twilight/{p-ba1199ba.entry.js → p-aec0a2df.entry.js} +1 -1
  318. package/dist/twilight/{p-9b639078.entry.js → p-b16d8b19.entry.js} +1 -1
  319. package/dist/twilight/{p-ee605cef.entry.js → p-b295c1f1.entry.js} +1 -1
  320. package/dist/twilight/{p-0957f323.entry.js → p-b6c0aa79.entry.js} +1 -1
  321. package/dist/twilight/{p-0bdf58a4.entry.js → p-b7727021.entry.js} +1 -1
  322. package/dist/twilight/{p-e8a82952.entry.js → p-badf4c9d.entry.js} +1 -1
  323. package/dist/twilight/{p-fe506679.entry.js → p-c6be8afd.entry.js} +1 -1
  324. package/dist/twilight/{p-ec073354.entry.js → p-ccd8c960.entry.js} +1 -1
  325. package/dist/twilight/{p-3fbd88d0.entry.js → p-ce0410d5.entry.js} +1 -1
  326. package/dist/twilight/{p-ef8fb222.entry.js → p-cee7a8ad.entry.js} +1 -1
  327. package/dist/twilight/{p-f6bb956c.entry.js → p-d0c8435f.entry.js} +1 -1
  328. package/dist/twilight/{p-59f815bc.entry.js → p-d23eeb0c.entry.js} +1 -1
  329. package/dist/twilight/{p-f170aff7.entry.js → p-d63f2cbd.entry.js} +1 -1
  330. package/dist/twilight/{p-6d87b134.entry.js → p-d6b6a8ad.entry.js} +1 -1
  331. package/dist/twilight/{p-b0ed6a9f.entry.js → p-d823cbcd.entry.js} +1 -1
  332. package/dist/twilight/{p-9df5c9a7.entry.js → p-d8f22e4b.entry.js} +1 -1
  333. package/dist/twilight/{p-CsMnvJkR.js → p-dKdk2xpB.js} +1 -1
  334. package/dist/twilight/p-dbdbb882.entry.js +4 -0
  335. package/dist/twilight/{p-d905fbca.entry.js → p-dc8555bf.entry.js} +1 -1
  336. package/dist/twilight/{p-fbfacb11.entry.js → p-dca3b67e.entry.js} +1 -1
  337. package/dist/twilight/{p-056400a1.entry.js → p-e0671ff1.entry.js} +1 -1
  338. package/dist/twilight/{p-59f7f014.entry.js → p-e06e37c1.entry.js} +1 -1
  339. package/dist/twilight/{p-c60c302f.entry.js → p-e265d626.entry.js} +1 -1
  340. package/dist/twilight/{p-61b1fd3b.entry.js → p-f0e96875.entry.js} +1 -1
  341. package/dist/twilight/p-f64168cc.entry.js +4 -0
  342. package/dist/twilight/{p-0b1970c2.entry.js → p-f67639df.entry.js} +1 -1
  343. package/dist/twilight/{p-fa039238.entry.js → p-fd180bd3.entry.js} +1 -1
  344. package/dist/twilight/{p-D9ni3BuG.js → p-m2p-QAbu.js} +1 -1
  345. package/dist/twilight/{p-CkA6UKAD.js → p-yyvPGK6r.js} +2 -2
  346. package/dist/twilight/twilight.esm.js +1 -1
  347. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +16 -0
  348. package/dist/types/components/salla-gifting/gift-schema.d.ts +4 -0
  349. package/dist/types/components/salla-gifting/salla-gifting.d.ts +5 -1
  350. package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +2 -0
  351. package/dist/types/components/salla-product-options/salla-product-options.d.ts +0 -11
  352. package/dist/types/components/salla-products-list/salla-products-list.d.ts +60 -6
  353. package/dist/types/components/salla-social-share/salla-social-share.d.ts +39 -2
  354. package/dist/types/components/salla-wishlist-actions/salla-wishlist-actions.d.ts +93 -0
  355. package/dist/types/components.d.ts +172 -18
  356. package/package.json +5 -5
  357. package/dist/twilight/p-234fdf72.entry.js +0 -4
  358. package/dist/twilight/p-7a1cfd65.entry.js +0 -4
  359. package/dist/twilight/p-865c602e.entry.js +0 -4
  360. package/dist/twilight/p-9dc0fec4.entry.js +0 -4
  361. package/dist/twilight/p-e485d0b8.entry.js +0 -4
  362. package/dist/twilight/p-f5072671.entry.js +0 -4
  363. package/dist/twilight/p-fb7904e6.entry.js +0 -4
  364. package/dist/twilight/p-fdde8399.entry.js +0 -4
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { Host, h } from "@stencil/core";
4
+ import { Host, h, } from "@stencil/core";
5
5
  import anime from "animejs";
6
6
  import ShoppingBag from "../../assets/svg/shopping-bag.svg";
7
7
  import Helper from "../../Helpers/Helper";
@@ -21,6 +21,18 @@ export class SallaProductsList {
21
21
  * <salla-products-list product-card-component="my-custom-card-style2" ...
22
22
  */
23
23
  this.productCardComponent = 'custom-salla-product-card';
24
+ /**
25
+ * Enables multi-selection of products. When enabled, a checkbox overlay is
26
+ * rendered on top of each product card and the selected products are exposed
27
+ * via the `selectionChanged` event, the `salla-products-list::selection.changed`
28
+ * global event and the `getSelected()` method.
29
+ *
30
+ * This is source-agnostic (works for any `source`) and defaults to `false`.
31
+ * On the wishlist page the `salla-wishlist-actions` panel turns it on at
32
+ * runtime (when the customer chooses "share specific items"), so no theme
33
+ * markup changes are required.
34
+ */
35
+ this.selectable = false;
24
36
  // State
25
37
  this.page = 1;
26
38
  this.placeholderText = salla.lang.get('pages.categories.no_products');
@@ -28,10 +40,12 @@ export class SallaProductsList {
28
40
  this.failedLoadMore = salla.lang.get('common.elements.failed_to_load_more');
29
41
  this.currentPage = salla.config.get('page');
30
42
  this.filtersSnapshot = [];
31
- this.lastViewedProductKey = "lastViewedProductId";
32
- this.filtersKey = "filters";
33
- this.infiniteScrollStateKey = "infiniteScrollState";
34
- this.prevCategoryIdKey = "prevCategoryId";
43
+ /** Map of selected products keyed by product id (preserves selection across pagination). */
44
+ this.selectedProducts = new Map();
45
+ this.lastViewedProductKey = 'lastViewedProductId';
46
+ this.filtersKey = 'filters';
47
+ this.infiniteScrollStateKey = 'infiniteScrollState';
48
+ this.prevCategoryIdKey = 'prevCategoryId';
35
49
  this.isProcessing = false; // Tracks if we are processing data
36
50
  this.scrollTimeout = null;
37
51
  this.boundScrollToLastViewedProduct = () => this.scrollToLastViewedProduct();
@@ -40,7 +54,44 @@ export class SallaProductsList {
40
54
  'product.index.latest': 'latest',
41
55
  'product.index.offers': 'offers',
42
56
  'product.index.search': 'search',
43
- 'product.index.sales': 'sales'
57
+ 'product.index.sales': 'sales',
58
+ };
59
+ this.onWishlistItemRemoved = (_response, productId) => {
60
+ if (this.getSource() !== 'wishlist' || !this.wrapper) {
61
+ return;
62
+ }
63
+ const normalizedId = String(productId);
64
+ const cardTag = this.hasCustomComponent ? this.productCardComponent : 'salla-product-card';
65
+ for (const child of Array.from(this.wrapper.children)) {
66
+ const listItem = child;
67
+ const card = child.querySelector(cardTag);
68
+ const id = listItem.product?.id ?? card?.product?.id;
69
+ if (id != null && String(id) === normalizedId) {
70
+ child.remove();
71
+ break;
72
+ }
73
+ }
74
+ // Theme may remove the card first and leave an empty selectable shell.
75
+ for (const child of Array.from(this.wrapper.children)) {
76
+ if (!child.classList.contains('s-products-list-selectable-item')) {
77
+ continue;
78
+ }
79
+ const listItem = child;
80
+ if (listItem.product?.id != null &&
81
+ String(listItem.product.id) === normalizedId &&
82
+ !child.querySelector(cardTag)) {
83
+ child.remove();
84
+ break;
85
+ }
86
+ }
87
+ if (this.selectable) {
88
+ for (const id of Array.from(this.selectedProducts.keys())) {
89
+ if (String(id) === normalizedId) {
90
+ this.selectedProducts.delete(id);
91
+ }
92
+ }
93
+ this.emitSelection();
94
+ }
44
95
  };
45
96
  //TODO:: check why `this.includes` not working!!
46
97
  this.includes = Helper.parseJson(this.includes || this.host.getAttribute('includes'));
@@ -57,15 +108,17 @@ export class SallaProductsList {
57
108
  }
58
109
  connectedCallback() {
59
110
  //Override browser scroll restoration default behaviour
60
- if ("scrollRestoration" in history)
61
- history.scrollRestoration = "manual";
111
+ if ('scrollRestoration' in history)
112
+ history.scrollRestoration = 'manual';
62
113
  // required for scroll restoration case when the component loads before DOM content is completed (slow internet bandwidth /low device specs)
63
114
  window.addEventListener('DOMContentLoaded', this.boundScrollToLastViewedProduct);
64
115
  salla.event.on('salla-filters::changed', filters => this.setFilters(filters));
116
+ salla.event.on('wishlist::removed', this.onWishlistItemRemoved);
65
117
  }
66
118
  disconnectedCallback() {
67
119
  window.removeEventListener('DOMContentLoaded', this.boundScrollToLastViewedProduct);
68
120
  window.removeEventListener('scroll', this.boundHandleScroll);
121
+ salla.event.off('wishlist::removed', this.onWishlistItemRemoved);
69
122
  }
70
123
  /**
71
124
  * Set parsed filters data from URI
@@ -78,7 +131,9 @@ export class SallaProductsList {
78
131
  window.scrollTo({ top: 0, behavior: 'smooth' });
79
132
  // Create a deep copy of the filters object to avoid mutating the original object
80
133
  this.parsedFilters = JSON.parse(JSON.stringify(filters));
81
- if (this.currentPage?.slug == "product.index" && this.parsedFilters && this.parsedFilters.category_id) {
134
+ if (this.currentPage?.slug == 'product.index' &&
135
+ this.parsedFilters &&
136
+ this.parsedFilters.category_id) {
82
137
  this.currentCategoryIdFilter = [this.parsedFilters.category_id];
83
138
  }
84
139
  return this.reload();
@@ -166,12 +221,12 @@ export class SallaProductsList {
166
221
  }
167
222
  this.nextPage += '&filterable=1';
168
223
  for (const [key, value] of Object.entries(this.parsedFilters || {})) {
169
- if (["string", "number"].includes(typeof value)) {
224
+ if (['string', 'number'].includes(typeof value)) {
170
225
  // @ts-ignore
171
226
  this.nextPage += `&filters[${encodeURIComponent(key)}]=${encodeURIComponent(value)}`;
172
227
  }
173
228
  else if (Array.isArray(value)) {
174
- value.forEach(item => this.nextPage += `&filters[${encodeURIComponent(key)}][]=${encodeURIComponent(item)}`);
229
+ value.forEach(item => (this.nextPage += `&filters[${encodeURIComponent(key)}][]=${encodeURIComponent(item)}`));
175
230
  }
176
231
  else if (typeof value === 'object') {
177
232
  for (const [k, v] of Object.entries(value)) {
@@ -225,7 +280,9 @@ export class SallaProductsList {
225
280
  //as a request they don't want to let the user to open the product details
226
281
  //todo:: find a better way to handle this request
227
282
  this.getSource() === 'landing-page' && (product.url = '');
228
- const customComponentTag = this.hasCustomComponent ? this.productCardComponent : 'salla-product-card';
283
+ const customComponentTag = this.hasCustomComponent
284
+ ? this.productCardComponent
285
+ : 'salla-product-card';
229
286
  const productCard = document.createElement(customComponentTag);
230
287
  productCard.product = product;
231
288
  // Apply compact layout if requested - set both property and attribute for compatibility
@@ -236,7 +293,7 @@ export class SallaProductsList {
236
293
  this.applyLandingPageStyles(productCard);
237
294
  this.applyHorizontalCardStyles(productCard);
238
295
  // Attach click event listener to save the current products snapshot
239
- productCard.addEventListener('click', (event) => {
296
+ productCard.addEventListener('click', event => {
240
297
  const target = event.target;
241
298
  // Check if the clicked element is an anchor or inside an anchor
242
299
  const anchor = target.closest('a');
@@ -248,8 +305,69 @@ export class SallaProductsList {
248
305
  }
249
306
  }
250
307
  });
308
+ if (this.selectable) {
309
+ return this.wrapSelectableItem(productCard, product);
310
+ }
251
311
  return productCard;
252
312
  }
313
+ /**
314
+ * Wrap a product card with a selection control. The wrapper mirrors `product`
315
+ * so the scroll-restoration snapshot logic (which reads `child.product`) keeps
316
+ * working, and the card keeps its id for `scrollToLastViewedProduct`.
317
+ */
318
+ wrapSelectableItem(productCard, product) {
319
+ const container = document.createElement('div');
320
+ container.className = 's-products-list-selectable-item';
321
+ container.product = product;
322
+ const isSelected = this.selectedProducts.has(product.id);
323
+ if (isSelected) {
324
+ container.classList.add('s-products-list-item-selected');
325
+ }
326
+ const control = document.createElement('label');
327
+ control.className = 's-products-list-select-control';
328
+ control.setAttribute('aria-label', salla.lang.get('common.elements.select', 'تحديد'));
329
+ const checkbox = document.createElement('input');
330
+ checkbox.type = 'checkbox';
331
+ checkbox.className = 's-products-list-select-checkbox';
332
+ checkbox.checked = isSelected;
333
+ checkbox.addEventListener('change', () => this.toggleSelection(product, container, checkbox.checked));
334
+ control.appendChild(checkbox);
335
+ container.appendChild(control);
336
+ container.appendChild(productCard);
337
+ return container;
338
+ }
339
+ toggleSelection(product, container, checked) {
340
+ if (checked) {
341
+ this.selectedProducts.set(product.id, product);
342
+ container?.classList.add('s-products-list-item-selected');
343
+ }
344
+ else {
345
+ this.selectedProducts.delete(product.id);
346
+ container?.classList.remove('s-products-list-item-selected');
347
+ }
348
+ this.emitSelection();
349
+ }
350
+ emitSelection() {
351
+ const products = Array.from(this.selectedProducts.values());
352
+ const ids = Array.from(this.selectedProducts.keys());
353
+ const detail = { ids, products, count: ids.length };
354
+ this.selectionChanged.emit(detail);
355
+ salla.event.emit('salla-products-list::selection.changed', detail);
356
+ }
357
+ /**
358
+ * Re-render the list when selection mode is toggled at runtime (e.g. enabled
359
+ * by the wishlist actions panel after the list already loaded).
360
+ */
361
+ onSelectableChanged(newValue, oldValue) {
362
+ if (newValue === oldValue || !this.isReady || !this.wrapper) {
363
+ return;
364
+ }
365
+ if (!newValue) {
366
+ this.selectedProducts.clear();
367
+ this.emitSelection();
368
+ }
369
+ this.reload();
370
+ }
253
371
  applyLandingPageStyles(productCard) {
254
372
  if (this.getSource() === 'landing-page' && !this.hasCustomComponent) {
255
373
  productCard.toggleAttribute('hide-add-btn', true);
@@ -267,7 +385,7 @@ export class SallaProductsList {
267
385
  }
268
386
  waitForResizing(element) {
269
387
  let timeout = null;
270
- return new Promise((resolve) => {
388
+ return new Promise(resolve => {
271
389
  const resizeObserver = new ResizeObserver(() => {
272
390
  clearTimeout(timeout);
273
391
  timeout = setTimeout(() => {
@@ -280,7 +398,7 @@ export class SallaProductsList {
280
398
  }
281
399
  waitForLayoutStable(element) {
282
400
  let timeout = null;
283
- return new Promise((resolve) => {
401
+ return new Promise(resolve => {
284
402
  const observer = new MutationObserver(() => {
285
403
  clearTimeout(timeout);
286
404
  timeout = setTimeout(() => {
@@ -300,15 +418,14 @@ export class SallaProductsList {
300
418
  // Wait for DOM mutations and layout shifts to stabilize
301
419
  return await Promise.allSettled([
302
420
  this.waitForResizing(element),
303
- this.waitForLayoutStable(element)
421
+ this.waitForLayoutStable(element),
304
422
  ]);
305
423
  }
306
424
  scrollToLastViewedProduct() {
307
425
  const lastViewedProductId = sessionStorage.getItem(this.lastViewedProductKey);
308
426
  if (!lastViewedProductId || salla.url.is_page('product.single'))
309
427
  return;
310
- this.isElementLoaded(`[id*="${lastViewedProductId}"]`)
311
- .then(() => {
428
+ this.isElementLoaded(`[id*="${lastViewedProductId}"]`).then(() => {
312
429
  const productCard = this.wrapper?.querySelector(`[id*="${lastViewedProductId}"]`);
313
430
  if (!productCard)
314
431
  return;
@@ -316,8 +433,12 @@ export class SallaProductsList {
316
433
  const scrollToProductCard = () => {
317
434
  // calculations is located here for last second changes in the ui (ie. sticky header height)
318
435
  productCard.scrollIntoView({ block: 'start', behavior: 'instant' });
319
- const headerSelector = matchMedia('(max-width: 1024px)').matches ? "header .inner" : "ul.main-menu";
320
- const headerHeight = window?.header_is_sticky ? (document.querySelector(headerSelector)?.getBoundingClientRect()?.height ?? 56) : 0;
436
+ const headerSelector = matchMedia('(max-width: 1024px)').matches
437
+ ? 'header .inner'
438
+ : 'ul.main-menu';
439
+ const headerHeight = window?.header_is_sticky
440
+ ? (document.querySelector(headerSelector)?.getBoundingClientRect()?.height ?? 56)
441
+ : 0;
321
442
  const cardsListRowGap = parseInt(getComputedStyle(this.wrapper).rowGap) ?? 16;
322
443
  const productCardOffset = headerHeight + cardsListRowGap;
323
444
  scrollBy({ top: productCardOffset * -1, behavior: 'instant' });
@@ -325,7 +446,7 @@ export class SallaProductsList {
325
446
  //start scrolling to the product card position
326
447
  requestAnimationFrame(scrollToProductCard);
327
448
  const productImages = productCard.querySelectorAll('img.lazy');
328
- productImages.forEach((image) => {
449
+ productImages.forEach(image => {
329
450
  const productImage = image;
330
451
  const handleImageEvent = () => {
331
452
  requestAnimationFrame(scrollToProductCard);
@@ -342,16 +463,15 @@ export class SallaProductsList {
342
463
  });
343
464
  }
344
465
  isElementLoaded(selector) {
345
- return new Promise((resolve => {
466
+ return new Promise(resolve => {
346
467
  const interval = setInterval(() => {
347
468
  if (document.querySelector(selector)) {
348
469
  clearInterval(interval);
349
470
  return resolve(document.querySelector(selector));
350
471
  }
351
472
  }, 50);
352
- }));
473
+ });
353
474
  }
354
- ;
355
475
  takeStateSnapshot() {
356
476
  const currentPageData = [];
357
477
  // Classic for-loop for performance
@@ -362,7 +482,7 @@ export class SallaProductsList {
362
482
  const scrollState = {
363
483
  pageIndex: Math.max((this.infiniteScroll?.pageIndex ?? 1) - 1, 1),
364
484
  nextPage: this.nextPage,
365
- currentPageData
485
+ currentPageData,
366
486
  };
367
487
  if (this.isFilterable()) {
368
488
  const existingFilters = sessionStorage.getItem(this.filtersKey);
@@ -409,9 +529,8 @@ export class SallaProductsList {
409
529
  const isDifferentCategory = currentPageSlug
410
530
  ? prevCategory !== currentPageSlug // Compare slugs for special pages
411
531
  : prevCategory !== String(currentPageId); // Compare IDs otherwise
412
- if ((prevCategory && isDifferentCategory && !isHomepage && !isProductPage)
413
- ||
414
- (isHomepage && !this.hasInfiniteScroll)) {
532
+ if ((prevCategory && isDifferentCategory && !isHomepage && !isProductPage) ||
533
+ (isHomepage && !this.hasInfiniteScroll)) {
415
534
  this.removeScrollRestorationSession();
416
535
  this.switchToNormalBehavior = true;
417
536
  return false;
@@ -455,7 +574,9 @@ export class SallaProductsList {
455
574
  return ['json', 'selected', 'related', 'landing-page', 'recently'].includes(this.getSource());
456
575
  }
457
576
  getSourceValue() {
458
- return this.currentCategoryIdFilter ? this.currentCategoryIdFilter : Helper.getProductsSourceValue(this.source, this.sourceValue);
577
+ return this.currentCategoryIdFilter
578
+ ? this.currentCategoryIdFilter
579
+ : Helper.getProductsSourceValue(this.source, this.sourceValue);
459
580
  }
460
581
  logFetchError(errorPhase, error, fetchPath, http, response) {
461
582
  try {
@@ -466,7 +587,9 @@ export class SallaProductsList {
466
587
  source: this.getSource(),
467
588
  sourceValue: typeof sourceValue === 'string' && sourceValue.length > 200
468
589
  ? `${sourceValue.slice(0, 200)}…`
469
- : Array.isArray(sourceValue) ? { length: sourceValue.length } : sourceValue,
590
+ : Array.isArray(sourceValue)
591
+ ? { length: sourceValue.length }
592
+ : sourceValue,
470
593
  pageIndex: this.infiniteScroll?.pageIndex,
471
594
  fetchPath,
472
595
  httpStatus: http?.status,
@@ -483,7 +606,9 @@ export class SallaProductsList {
483
606
  : {}),
484
607
  });
485
608
  }
486
- catch { /* analytics */ }
609
+ catch {
610
+ /* analytics */
611
+ }
487
612
  }
488
613
  appendDataLayer(data) {
489
614
  if (typeof dataLayer !== 'object' || !Array.isArray(dataLayer)) {
@@ -491,29 +616,29 @@ export class SallaProductsList {
491
616
  return;
492
617
  }
493
618
  dataLayer.push({
494
- "event": "impressions",
495
- "ecommerce": {
496
- "currencyCode": salla.config.currency().code,
619
+ event: 'impressions',
620
+ ecommerce: {
621
+ currencyCode: salla.config.currency().code,
497
622
  // "event_id":"", // todo
498
- "impressions": data.map((product, index) => {
623
+ impressions: data.map((product, index) => {
499
624
  return {
500
- "id": product.id,
501
- "name": product.name,
502
- "price": product.price,
503
- "brand": product.brand?.name || '',
504
- "quantity": product.quantity,
625
+ id: product.id,
626
+ name: product.name,
627
+ price: product.price,
628
+ brand: product.brand?.name || '',
629
+ quantity: product.quantity,
505
630
  // "variant": "",
506
- "categories": [
631
+ categories: [
507
632
  {
508
- "name": product.category?.name || salla.config.get('page.title'),
509
- "id": salla.config.get('page.id')
510
- }
633
+ name: product.category?.name || salla.config.get('page.title'),
634
+ id: salla.config.get('page.id'),
635
+ },
511
636
  ],
512
- "category": product.category?.name || salla.config.get('page.title'),
513
- 'position': index + 1
637
+ category: product.category?.name || salla.config.get('page.title'),
638
+ position: index + 1,
514
639
  };
515
- })
516
- }
640
+ }),
641
+ },
517
642
  });
518
643
  }
519
644
  initiateInfiniteScroll() {
@@ -526,7 +651,7 @@ export class SallaProductsList {
526
651
  history: false,
527
652
  nextPage: this.nextPage,
528
653
  scrollThreshold: shouldApplyManualLoad ? false : this.autoload ? 100 : false,
529
- loadOnScroll: shouldApplyManualLoad ? false : this.autoload
654
+ loadOnScroll: shouldApplyManualLoad ? false : this.autoload,
530
655
  }, true);
531
656
  this.infiniteScroll.pageIndex = this.page;
532
657
  this.infiniteScroll?.on('request', () => {
@@ -637,11 +762,13 @@ export class SallaProductsList {
637
762
  }
638
763
  getInitialData() {
639
764
  this.loading();
640
- return salla.api.withoutNotifier(() => salla.product.api.fetch({
765
+ return salla.api.withoutNotifier(() => salla.product.api
766
+ .fetch({
641
767
  source: Helper.getApiSource(this.getSource()),
642
768
  source_value: this.getSourceValue(),
643
- limit: this.limit
644
- }).then(async (response) => {
769
+ limit: this.limit,
770
+ })
771
+ .then(async (response) => {
645
772
  if (!response.data.length) {
646
773
  this.showPlaceholder = true;
647
774
  this.placeholderLoader && this.placeholderLoader.remove();
@@ -665,9 +792,65 @@ export class SallaProductsList {
665
792
  async loadMore() {
666
793
  this.infiniteScroll?.loadNextPage();
667
794
  }
795
+ /**
796
+ * Get the currently selected products.
797
+ */
798
+ async getSelected() {
799
+ return {
800
+ ids: Array.from(this.selectedProducts.keys()),
801
+ products: Array.from(this.selectedProducts.values()),
802
+ };
803
+ }
804
+ /**
805
+ * Get all products currently rendered in the list (works whether selection
806
+ * is enabled or not). Useful to gather ids for "share all".
807
+ */
808
+ async getLoadedProducts() {
809
+ const products = [];
810
+ if (!this.wrapper) {
811
+ return products;
812
+ }
813
+ for (let i = 0; i < this.wrapper.children.length; i++) {
814
+ const item = this.wrapper.children[i];
815
+ item?.product && products.push(item.product);
816
+ }
817
+ return products;
818
+ }
819
+ /**
820
+ * Select all currently rendered products.
821
+ */
822
+ async selectAll() {
823
+ if (!this.selectable || !this.wrapper) {
824
+ return;
825
+ }
826
+ for (let i = 0; i < this.wrapper.children.length; i++) {
827
+ const item = this.wrapper.children[i];
828
+ if (item?.product) {
829
+ this.selectedProducts.set(item.product.id, item.product);
830
+ item.classList.add('s-products-list-item-selected');
831
+ const checkbox = item.querySelector('.s-products-list-select-checkbox');
832
+ checkbox && (checkbox.checked = true);
833
+ }
834
+ }
835
+ this.emitSelection();
836
+ }
837
+ /**
838
+ * Clear the current selection.
839
+ */
840
+ async clearSelection() {
841
+ this.selectedProducts.clear();
842
+ if (this.wrapper) {
843
+ this.wrapper
844
+ .querySelectorAll('.s-products-list-select-checkbox')
845
+ .forEach((checkbox) => (checkbox.checked = false));
846
+ this.wrapper
847
+ .querySelectorAll('.s-products-list-item-selected')
848
+ .forEach(item => item.classList.remove('s-products-list-item-selected'));
849
+ }
850
+ this.emitSelection();
851
+ }
668
852
  componentWillLoad() {
669
- return salla.onReady()
670
- .then(async () => {
853
+ return salla.onReady().then(async () => {
671
854
  this.hasCustomComponent = !!customElements.get(this.productCardComponent);
672
855
  this.sourceValueIsValid = !!(this.getSourceValue() || this.isSourceWithoutValue());
673
856
  this.hasInfiniteScroll = !this.isAuxiliaryProductsListSource() && !this.limit;
@@ -747,15 +930,16 @@ export class SallaProductsList {
747
930
  });
748
931
  }
749
932
  else {
750
- console.error("No response received after getInitialData.");
933
+ console.error('No response received after getInitialData.');
751
934
  }
752
935
  })
753
936
  .catch(error => {
754
- console.error("Error during initial data fetch:", error);
937
+ console.error('Error during initial data fetch:', error);
755
938
  });
756
939
  }
757
940
  else {
758
- this.firstPageResponse && (await this.handleResponse(this.firstPageResponse, false)).forEach(card => this.wrapper.append(card));
941
+ this.firstPageResponse &&
942
+ (await this.handleResponse(this.firstPageResponse, false)).forEach(card => this.wrapper.append(card));
759
943
  }
760
944
  }
761
945
  canRender() {
@@ -766,16 +950,18 @@ export class SallaProductsList {
766
950
  return '';
767
951
  }
768
952
  if (this.showPlaceholder) {
769
- return h("div", { class: "s-products-list-placeholder" }, h("span", { innerHTML: ShoppingBag }), h("p", null, this.placeholderText));
953
+ return (h("div", { class: "s-products-list-placeholder" }, h("span", { innerHTML: ShoppingBag }), h("p", null, this.placeholderText)));
770
954
  }
771
955
  return (h(Host, { class: "s-products-list" }, h("div", { class: {
772
- "s-products-list-wrapper": true,
956
+ 's-products-list-wrapper': true,
773
957
  's-products-list-horizontal-cards': this.horizontalCards && !this.filtersResults,
774
958
  's-products-list-vertical-cards': !this.horizontalCards && !this.rowCards && !this.filtersResults,
775
959
  's-products-list-row-cards': this.rowCards,
776
960
  's-products-list-compact-cards': this.compactCards,
777
961
  's-products-list-filters-results': this.filtersResults,
778
- }, ref: wrapper => this.wrapper = wrapper }), h("div", { class: "s-infinite-scroll-status", ref: status => this.status = status }, h("p", { class: "s-infinite-scroll-last infinite-scroll-last s-hidden" }, this.endOfText), h("p", { class: "s-infinite-scroll-error infinite-scroll-error s-hidden" }, this.failedLoadMore)), this.autoload && h("div", { class: "s-products-list-loading-wrapper", style: { "display": "none" }, ref: loader => this.loader = loader }, h("span", { class: "s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" })), this.hasInfiniteScroll && this.nextPage && !this.autoload ? (h("div", { class: "s-infinite-scroll-wrapper", style: { "display": "none" }, ref: loadMoreWrapper => this.loadMoreWrapper = loadMoreWrapper }, h("button", { onClick: () => this.loadMore(), class: "s-infinite-scroll-btn s-button-btn s-button-primary" }, h("span", { class: "s-button-text s-infinite-scroll-btn-text" }, this.loadMoreText ? this.loadMoreText : salla.lang.get('common.elements.load_more')), h("span", { class: "s-button-loader s-button-loader-center s-infinite-scroll-btn-loader", ref: btnLoader => this.btnLoader = btnLoader, style: { "display": "none" } })))) : ""));
962
+ }, ref: wrapper => (this.wrapper = wrapper) }), h("div", { class: "s-infinite-scroll-status", ref: status => (this.status = status) }, h("p", { class: "s-infinite-scroll-last infinite-scroll-last s-hidden" }, this.endOfText), h("p", { class: "s-infinite-scroll-error infinite-scroll-error s-hidden" }, this.failedLoadMore)), this.autoload && (h("div", { class: "s-products-list-loading-wrapper", style: { display: 'none' }, ref: loader => (this.loader = loader) }, h("span", { class: "s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" }))), this.hasInfiniteScroll && this.nextPage && !this.autoload ? (h("div", { class: "s-infinite-scroll-wrapper", style: { display: 'none' }, ref: loadMoreWrapper => (this.loadMoreWrapper = loadMoreWrapper) }, h("button", { onClick: () => this.loadMore(), class: "s-infinite-scroll-btn s-button-btn s-button-primary" }, h("span", { class: "s-button-text s-infinite-scroll-btn-text" }, this.loadMoreText
963
+ ? this.loadMoreText
964
+ : salla.lang.get('common.elements.load_more')), h("span", { class: "s-button-loader s-button-loader-center s-infinite-scroll-btn-loader", ref: btnLoader => (this.btnLoader = btnLoader), style: { display: 'none' } })))) : ('')));
779
965
  }
780
966
  init() {
781
967
  this.initiateInfiniteScroll();
@@ -792,14 +978,19 @@ export class SallaProductsList {
792
978
  let title = Helper.getPageTitleForSource(source);
793
979
  try {
794
980
  if (this.getSource() === 'search') {
795
- title = salla.lang.get('common.elements.search_about', { 'word': this.getSourceValue() });
981
+ title = salla.lang.get('common.elements.search_about', { word: this.getSourceValue() });
796
982
  }
797
983
  else if (!title) {
798
984
  let catId = this.parsedFilters.category_id || this.getSourceValue()[0];
799
985
  // get the first filter that its key is category_id, then get the value when filter.value.*.key==catId
800
- title = response.filters?.find(filter => filter.key === 'category_id')?.values?.find(cat => cat.key === catId)?.value ?? '';
986
+ title =
987
+ response.filters
988
+ ?.find(filter => filter.key === 'category_id')
989
+ ?.values?.find(cat => cat.key === catId)?.value ?? '';
801
990
  }
802
- title += (title ? ' - ' : '') + salla.lang.choice('blocks.header.products_count', response.data?.length);
991
+ title +=
992
+ (title ? ' - ' : '') +
993
+ salla.lang.choice('blocks.header.products_count', response.data?.length);
803
994
  if (response.data.length === 15) {
804
995
  title = title.replace(response.data.length, salla.lang.get('common.elements.more_than') + ' ' + response.data.length);
805
996
  }
@@ -855,7 +1046,7 @@ export class SallaProductsList {
855
1046
  "attribute": "source",
856
1047
  "mutable": true,
857
1048
  "complexType": {
858
- "original": "'categories' | 'latest' | 'related' | 'brands' | 'json' | 'search' | 'tags' | 'selected' | 'offers' | 'landing-page' | 'sales' | 'wishlist' | 'top-rated' | 'reorder' | 'recently'",
1049
+ "original": "| 'categories'\n | 'latest'\n | 'related'\n | 'brands'\n | 'json'\n | 'search'\n | 'tags'\n | 'selected'\n | 'offers'\n | 'landing-page'\n | 'sales'\n | 'wishlist'\n | 'top-rated'\n | 'reorder'\n | 'recently'",
859
1050
  "resolved": "\"brands\" | \"categories\" | \"json\" | \"landing-page\" | \"latest\" | \"offers\" | \"recently\" | \"related\" | \"reorder\" | \"sales\" | \"search\" | \"selected\" | \"tags\" | \"top-rated\" | \"wishlist\"",
860
1051
  "references": {}
861
1052
  },
@@ -918,7 +1109,7 @@ export class SallaProductsList {
918
1109
  "attribute": "sort-by",
919
1110
  "mutable": true,
920
1111
  "complexType": {
921
- "original": "string | 'ourSuggest' | 'bestSell' | 'topRated' | 'priceFromTopToLow' | 'priceFromLowToTop'",
1112
+ "original": "| string\n | 'ourSuggest'\n | 'bestSell'\n | 'topRated'\n | 'priceFromTopToLow'\n | 'priceFromLowToTop'",
922
1113
  "resolved": "string",
923
1114
  "references": {}
924
1115
  },
@@ -1087,6 +1278,26 @@ export class SallaProductsList {
1087
1278
  },
1088
1279
  "getter": false,
1089
1280
  "setter": false
1281
+ },
1282
+ "selectable": {
1283
+ "type": "boolean",
1284
+ "attribute": "selectable",
1285
+ "mutable": true,
1286
+ "complexType": {
1287
+ "original": "boolean",
1288
+ "resolved": "boolean",
1289
+ "references": {}
1290
+ },
1291
+ "required": false,
1292
+ "optional": false,
1293
+ "docs": {
1294
+ "tags": [],
1295
+ "text": "Enables multi-selection of products. When enabled, a checkbox overlay is\nrendered on top of each product card and the selected products are exposed\nvia the `selectionChanged` event, the `salla-products-list::selection.changed`\nglobal event and the `getSelected()` method.\n\nThis is source-agnostic (works for any `source`) and defaults to `false`.\nOn the wishlist page the `salla-wishlist-actions` panel turns it on at\nruntime (when the customer chooses \"share specific items\"), so no theme\nmarkup changes are required."
1296
+ },
1297
+ "getter": false,
1298
+ "setter": false,
1299
+ "reflect": true,
1300
+ "defaultValue": "false"
1090
1301
  }
1091
1302
  };
1092
1303
  }
@@ -1125,6 +1336,21 @@ export class SallaProductsList {
1125
1336
  "resolved": "any",
1126
1337
  "references": {}
1127
1338
  }
1339
+ }, {
1340
+ "method": "selectionChanged",
1341
+ "name": "selectionChanged",
1342
+ "bubbles": true,
1343
+ "cancelable": true,
1344
+ "composed": true,
1345
+ "docs": {
1346
+ "tags": [],
1347
+ "text": "Custom event fired when the selection changes (only when `selectable` is enabled).\nDetail: `{ ids: Array<string|number>, products: Product[], count: number }`."
1348
+ },
1349
+ "complexType": {
1350
+ "original": "any",
1351
+ "resolved": "any",
1352
+ "references": {}
1353
+ }
1128
1354
  }];
1129
1355
  }
1130
1356
  static get methods() {
@@ -1186,8 +1412,104 @@ export class SallaProductsList {
1186
1412
  "text": "Load the next products page.",
1187
1413
  "tags": []
1188
1414
  }
1415
+ },
1416
+ "getSelected": {
1417
+ "complexType": {
1418
+ "signature": "() => Promise<{ ids: Array<string | number>; products: Product[]; }>",
1419
+ "parameters": [],
1420
+ "references": {
1421
+ "Promise": {
1422
+ "location": "global",
1423
+ "id": "global::Promise"
1424
+ },
1425
+ "Array": {
1426
+ "location": "global",
1427
+ "id": "global::Array"
1428
+ },
1429
+ "Product": {
1430
+ "location": "import",
1431
+ "path": "@salla.sa/twilight/types/common",
1432
+ "id": "../twilight/types/common.d.ts::Product"
1433
+ }
1434
+ },
1435
+ "return": "Promise<{ ids: (string | number)[]; products: Product[]; }>"
1436
+ },
1437
+ "docs": {
1438
+ "text": "Get the currently selected products.",
1439
+ "tags": []
1440
+ }
1441
+ },
1442
+ "getLoadedProducts": {
1443
+ "complexType": {
1444
+ "signature": "() => Promise<Product[]>",
1445
+ "parameters": [],
1446
+ "references": {
1447
+ "Promise": {
1448
+ "location": "global",
1449
+ "id": "global::Promise"
1450
+ },
1451
+ "Product": {
1452
+ "location": "import",
1453
+ "path": "@salla.sa/twilight/types/common",
1454
+ "id": "../twilight/types/common.d.ts::Product"
1455
+ }
1456
+ },
1457
+ "return": "Promise<Product[]>"
1458
+ },
1459
+ "docs": {
1460
+ "text": "Get all products currently rendered in the list (works whether selection\nis enabled or not). Useful to gather ids for \"share all\".",
1461
+ "tags": []
1462
+ }
1463
+ },
1464
+ "selectAll": {
1465
+ "complexType": {
1466
+ "signature": "() => Promise<void>",
1467
+ "parameters": [],
1468
+ "references": {
1469
+ "Promise": {
1470
+ "location": "global",
1471
+ "id": "global::Promise"
1472
+ },
1473
+ "HTMLInputElement": {
1474
+ "location": "global",
1475
+ "id": "global::HTMLInputElement"
1476
+ }
1477
+ },
1478
+ "return": "Promise<void>"
1479
+ },
1480
+ "docs": {
1481
+ "text": "Select all currently rendered products.",
1482
+ "tags": []
1483
+ }
1484
+ },
1485
+ "clearSelection": {
1486
+ "complexType": {
1487
+ "signature": "() => Promise<void>",
1488
+ "parameters": [],
1489
+ "references": {
1490
+ "Promise": {
1491
+ "location": "global",
1492
+ "id": "global::Promise"
1493
+ },
1494
+ "HTMLInputElement": {
1495
+ "location": "global",
1496
+ "id": "global::HTMLInputElement"
1497
+ }
1498
+ },
1499
+ "return": "Promise<void>"
1500
+ },
1501
+ "docs": {
1502
+ "text": "Clear the current selection.",
1503
+ "tags": []
1504
+ }
1189
1505
  }
1190
1506
  };
1191
1507
  }
1192
1508
  static get elementRef() { return "host"; }
1509
+ static get watchers() {
1510
+ return [{
1511
+ "propName": "selectable",
1512
+ "methodName": "onSelectableChanged"
1513
+ }];
1514
+ }
1193
1515
  }