@salla.sa/twilight-components 2.14.596 → 2.14.598

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 (551) hide show
  1. package/dist/cjs/{filepond-MMeFYRaC.js → filepond-Yrcu23Ew.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-Dd1aobB-.js → filepond-plugin-file-poster-DRez16xM.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-Be46s5wp.js → filepond-plugin-file-validate-size-H6Ijvhk2.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-Cf3OjTHE.js → filepond-plugin-file-validate-type-ozbX9Tb-.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BDX5qgng.js → filepond-plugin-image-edit-CynCgK8H.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-ilZNc8J4.js → filepond-plugin-image-exif-orientation-C18fCqoh.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-C9c7tVEB.js → filepond-plugin-image-preview-FiRPNiZp.js} +1 -1
  8. package/dist/cjs/{index-zv0p1Eys.js → index-CpkvCUQ3.js} +7 -7
  9. package/dist/cjs/{intlTelInput-C8hiSJ_i.js → intlTelInput-dW1ObsSS.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +10 -18
  13. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +37 -15
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +26 -20
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +7 -2
  19. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +111 -37
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +2 -2
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +12 -5
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-form_9.cjs.entry.js +47 -24
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +10 -3
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down.cjs.entry.js +17 -12
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +7 -4
  37. package/dist/cjs/salla-filters.cjs.entry.js +10 -5
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +12 -7
  41. package/dist/cjs/salla-hook.cjs.entry.js +2 -2
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +7 -2
  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 +14 -2
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +14 -3
  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 +12 -5
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_3.cjs.entry.js +39 -15
  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 +7 -2
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +14 -7
  63. package/dist/cjs/salla-offer.cjs.entry.js +14 -9
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +42 -4
  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-options-modal.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +7 -4
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +11 -4
  76. package/dist/cjs/salla-orders.cjs.entry.js +41 -7
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +10 -3
  79. package/dist/cjs/salla-price-range.cjs.entry.js +7 -4
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card.cjs.entry.js +16 -9
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +9 -4
  83. package/dist/cjs/salla-products-list.cjs.entry.js +5 -4
  84. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-quick-order.cjs.entry.js +7 -2
  86. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-rating-modal.cjs.entry.js +9 -3
  88. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-scopes.cjs.entry.js +9 -2
  91. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-skeleton.cjs.entry.js +8 -8
  94. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-social.cjs.entry.js +8 -3
  96. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  97. package/dist/cjs/salla-tiered-offer.cjs.entry.js +7 -2
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +9 -5
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +39 -2
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +7 -3
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +8 -3
  102. package/dist/cjs/salla-verify.cjs.entry.js +13 -6
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +1 -1
  106. package/dist/cjs/translate-Cvomt6Jh.js +58 -0
  107. package/dist/cjs/twilight.cjs.js +2 -2
  108. package/dist/cjs/{vanilla-picker-DRrOfZz0.js → vanilla-picker-CSaDVE6R.js} +1 -1
  109. package/dist/collection/Helpers/money-text.js +37 -0
  110. package/dist/collection/Helpers/translate.js +36 -0
  111. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +7 -2
  112. package/dist/collection/components/salla-alert/salla-alert.js +5 -5
  113. package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +6 -1
  114. package/dist/collection/components/salla-booking-field/salla-booking-field.js +10 -4
  115. package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +23 -17
  116. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.css +2 -0
  117. package/dist/collection/components/salla-button/salla-button.js +19 -27
  118. package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js +10 -3
  119. package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +2 -2
  120. package/dist/collection/components/salla-comment-form/salla-comment-form.js +10 -5
  121. package/dist/collection/components/salla-comments/salla-comment-item.js +11 -3
  122. package/dist/collection/components/salla-comments/salla-comments.js +9 -3
  123. package/dist/collection/components/salla-contacts/salla-contacts.js +9 -2
  124. package/dist/collection/components/salla-count-down/salla-count-down.js +23 -18
  125. package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +4 -0
  126. package/dist/collection/components/salla-file-upload/salla-file-upload.js +69 -5
  127. package/dist/collection/components/salla-filters/salla-filters.js +10 -5
  128. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +6 -3
  129. package/dist/collection/components/salla-gifting/salla-gifting.js +11 -6
  130. package/dist/collection/components/salla-hook/salla-hook.js +5 -1
  131. package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +6 -1
  132. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +15 -2
  133. package/dist/collection/components/salla-login-modal/salla-login-modal.css +3 -0
  134. package/dist/collection/components/salla-login-modal/salla-login-modal.js +12 -1
  135. package/dist/collection/components/salla-loyalty/salla-loyalty.js +12 -5
  136. package/dist/collection/components/salla-map/salla-map.js +12 -7
  137. package/dist/collection/components/salla-notifications/salla-notifications.js +6 -1
  138. package/dist/collection/components/salla-offer/salla-offer.js +12 -7
  139. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +13 -6
  140. package/dist/collection/components/salla-order-branch/salla-order-branch.css +35 -0
  141. package/dist/collection/components/salla-order-branch/salla-order-branch.js +40 -2
  142. package/dist/collection/components/salla-order-summary/salla-order-summary.js +6 -3
  143. package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +10 -3
  144. package/dist/collection/components/salla-orders/salla-orders.js +13 -6
  145. package/dist/collection/components/salla-placeholder/salla-placeholder.js +10 -3
  146. package/dist/collection/components/salla-price-range/salla-price-range.js +6 -3
  147. package/dist/collection/components/salla-product-availability/salla-product-availability.js +16 -7
  148. package/dist/collection/components/salla-product-card/salla-product-card.js +24 -17
  149. package/dist/collection/components/salla-product-options/salla-product-options.js +9 -6
  150. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +8 -3
  151. package/dist/collection/components/salla-products-list/salla-products-list.js +4 -3
  152. package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +20 -4
  153. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +6 -1
  154. package/dist/collection/components/salla-quick-order/salla-quick-order.js +6 -1
  155. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +8 -2
  156. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +16 -16
  157. package/dist/collection/components/salla-review-card/salla-review-card.js +5 -1
  158. package/dist/collection/components/salla-reviews/salla-reviews.js +6 -1
  159. package/dist/collection/components/salla-scopes/salla-scopes.js +9 -2
  160. package/dist/collection/components/salla-skeleton/salla-skeleton.js +10 -10
  161. package/dist/collection/components/salla-slider/salla-slider.js +6 -3
  162. package/dist/collection/components/salla-social/salla-social.js +7 -2
  163. package/dist/collection/components/salla-tabs/salla-tab-header.js +3 -3
  164. package/dist/collection/components/salla-tel-input/salla-tel-input.js +24 -19
  165. package/dist/collection/components/salla-tiered-offer/salla-tiered-offer.js +6 -1
  166. package/dist/collection/components/salla-trust-badges/salla-trust-badges.css +17 -12
  167. package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +7 -3
  168. package/dist/collection/components/salla-user-menu/salla-user-menu.js +38 -1
  169. package/dist/collection/components/salla-user-profile/salla-user-profile.js +6 -2
  170. package/dist/collection/components/salla-user-settings/salla-user-settings.js +7 -2
  171. package/dist/collection/components/salla-verify/salla-verify.js +13 -6
  172. package/dist/components/index.js +3 -3
  173. package/dist/components/salla-add-product-button2.js +7 -2
  174. package/dist/components/salla-alert.js +2 -2
  175. package/dist/components/salla-apps-icons.js +6 -1
  176. package/dist/components/salla-booking-field2.js +10 -4
  177. package/dist/components/salla-bottom-alert.js +23 -17
  178. package/dist/components/salla-bullet-delivery.js +1 -1
  179. package/dist/components/salla-button2.js +9 -17
  180. package/dist/components/salla-cart-item-offers.js +10 -3
  181. package/dist/components/salla-cart-summary.js +1 -1
  182. package/dist/components/salla-comment-form2.js +10 -5
  183. package/dist/components/salla-comment-item2.js +11 -3
  184. package/dist/components/salla-comments.js +9 -3
  185. package/dist/components/salla-contacts.js +9 -2
  186. package/dist/components/salla-count-down2.js +16 -11
  187. package/dist/components/salla-file-upload2.js +69 -5
  188. package/dist/components/salla-filters-widget2.js +6 -3
  189. package/dist/components/salla-filters.js +9 -4
  190. package/dist/components/salla-gifting.js +11 -6
  191. package/dist/components/salla-hook.js +1 -1
  192. package/dist/components/salla-infinite-scroll.js +6 -1
  193. package/dist/components/salla-localization-modal.js +15 -2
  194. package/dist/components/salla-login-modal2.js +13 -2
  195. package/dist/components/salla-loyalty.js +12 -5
  196. package/dist/components/salla-map2.js +12 -7
  197. package/dist/components/salla-notifications.js +6 -1
  198. package/dist/components/salla-offer-modal.js +13 -6
  199. package/dist/components/salla-offer.js +12 -7
  200. package/dist/components/salla-order-branch.js +41 -3
  201. package/dist/components/salla-order-summary.js +6 -3
  202. package/dist/components/salla-order-totals-card.js +10 -3
  203. package/dist/components/salla-orders.js +40 -6
  204. package/dist/components/salla-placeholder2.js +10 -3
  205. package/dist/components/salla-price-range2.js +6 -3
  206. package/dist/components/salla-product-availability2.js +16 -7
  207. package/dist/components/salla-product-card2.js +15 -8
  208. package/dist/components/salla-product-options2.js +9 -6
  209. package/dist/components/salla-product-size-guide.js +8 -3
  210. package/dist/components/salla-products-list2.js +4 -3
  211. package/dist/components/salla-progress-bar2.js +20 -4
  212. package/dist/components/salla-quick-buy2.js +6 -1
  213. package/dist/components/salla-quick-order.js +6 -1
  214. package/dist/components/salla-rating-modal2.js +8 -2
  215. package/dist/components/salla-rating-stars2.js +10 -10
  216. package/dist/components/salla-review-card2.js +1 -1
  217. package/dist/components/salla-reviews.js +6 -1
  218. package/dist/components/salla-scopes.js +9 -2
  219. package/dist/components/salla-skeleton2.js +7 -7
  220. package/dist/components/salla-slider2.js +6 -3
  221. package/dist/components/salla-social.js +7 -2
  222. package/dist/components/salla-tab-header2.js +3 -3
  223. package/dist/components/salla-tel-input2.js +24 -19
  224. package/dist/components/salla-tiered-offer.js +6 -1
  225. package/dist/components/salla-trust-badges.js +8 -4
  226. package/dist/components/salla-user-menu.js +38 -1
  227. package/dist/components/salla-user-profile.js +6 -2
  228. package/dist/components/salla-user-settings.js +7 -2
  229. package/dist/components/salla-verify.js +13 -6
  230. package/dist/components/translate.js +37 -1
  231. package/dist/docs.json +44 -44
  232. package/dist/esm/{filepond-okemUEVJ.js → filepond-Cqatu146.js} +1 -1
  233. package/dist/esm/{filepond-plugin-file-poster-He-1QDcm.js → filepond-plugin-file-poster-DbVXhgv4.js} +1 -1
  234. package/dist/esm/{filepond-plugin-file-validate-size-BoQ9OZHK.js → filepond-plugin-file-validate-size-BpJPambh.js} +1 -1
  235. package/dist/esm/{filepond-plugin-file-validate-type-BVxE-7xU.js → filepond-plugin-file-validate-type-3Qrskyxw.js} +1 -1
  236. package/dist/esm/{filepond-plugin-image-edit-DJnNmArQ.js → filepond-plugin-image-edit-Cjy7cOV1.js} +1 -1
  237. package/dist/esm/{filepond-plugin-image-exif-orientation-CgkqV9g5.js → filepond-plugin-image-exif-orientation-DYM12Yp-.js} +1 -1
  238. package/dist/esm/{filepond-plugin-image-preview-DxbixTNR.js → filepond-plugin-image-preview-C9nMEHVX.js} +1 -1
  239. package/dist/esm/{index-C1mBhG6Z.js → index-noRE1pbw.js} +7 -7
  240. package/dist/esm/{intlTelInput-wxpsRy0u.js → intlTelInput-CiinYrbq.js} +1 -1
  241. package/dist/esm/loader.js +3 -3
  242. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  243. package/dist/esm/salla-accordion_6.entry.js +10 -18
  244. package/dist/esm/salla-add-product-button_5.entry.js +37 -15
  245. package/dist/esm/salla-advertisement.entry.js +1 -1
  246. package/dist/esm/salla-alert_2.entry.js +26 -20
  247. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  248. package/dist/esm/salla-applied-filters.entry.js +1 -1
  249. package/dist/esm/salla-apps-icons.entry.js +7 -2
  250. package/dist/esm/salla-attachment-view_9.entry.js +111 -37
  251. package/dist/esm/salla-badge.entry.js +1 -1
  252. package/dist/esm/salla-basket-gap.entry.js +1 -1
  253. package/dist/esm/salla-bullet-delivery_3.entry.js +2 -2
  254. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  255. package/dist/esm/salla-cart-item-offers_2.entry.js +12 -5
  256. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  257. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  258. package/dist/esm/salla-comment-factors.entry.js +1 -1
  259. package/dist/esm/salla-comment-form_9.entry.js +47 -24
  260. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  261. package/dist/esm/salla-contacts.entry.js +10 -3
  262. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  263. package/dist/esm/salla-count-down.entry.js +17 -12
  264. package/dist/esm/salla-custom-fields.entry.js +1 -1
  265. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  266. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  267. package/dist/esm/salla-filters-widget.entry.js +7 -4
  268. package/dist/esm/salla-filters.entry.js +10 -5
  269. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  270. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  271. package/dist/esm/salla-gifting.entry.js +12 -7
  272. package/dist/esm/salla-hook.entry.js +2 -2
  273. package/dist/esm/salla-infinite-scroll.entry.js +7 -2
  274. package/dist/esm/salla-installment.entry.js +1 -1
  275. package/dist/esm/salla-list-tile.entry.js +1 -1
  276. package/dist/esm/salla-localization-modal.entry.js +14 -2
  277. package/dist/esm/salla-login-modal.entry.js +14 -3
  278. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  279. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  280. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  281. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  282. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  283. package/dist/esm/salla-loyalty.entry.js +12 -5
  284. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  285. package/dist/esm/salla-map_3.entry.js +39 -15
  286. package/dist/esm/salla-menu.entry.js +1 -1
  287. package/dist/esm/salla-metadata.entry.js +1 -1
  288. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  289. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  290. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  291. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  292. package/dist/esm/salla-notification-item_2.entry.js +7 -2
  293. package/dist/esm/salla-offer-modal.entry.js +14 -7
  294. package/dist/esm/salla-offer.entry.js +14 -9
  295. package/dist/esm/salla-order-branch.entry.js +42 -4
  296. package/dist/esm/salla-order-cancel.entry.js +1 -1
  297. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  298. package/dist/esm/salla-order-details-options.entry.js +1 -1
  299. package/dist/esm/salla-order-details.entry.js +1 -1
  300. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  301. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  302. package/dist/esm/salla-order-edit.entry.js +1 -1
  303. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  304. package/dist/esm/salla-order-shipments.entry.js +1 -1
  305. package/dist/esm/salla-order-summary.entry.js +7 -4
  306. package/dist/esm/salla-order-totals-card.entry.js +11 -4
  307. package/dist/esm/salla-orders.entry.js +41 -7
  308. package/dist/esm/salla-payments.entry.js +1 -1
  309. package/dist/esm/salla-placeholder.entry.js +10 -3
  310. package/dist/esm/salla-price-range.entry.js +7 -4
  311. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  312. package/dist/esm/salla-product-card.entry.js +16 -9
  313. package/dist/esm/salla-product-size-guide.entry.js +9 -4
  314. package/dist/esm/salla-products-list.entry.js +5 -4
  315. package/dist/esm/salla-products-slider.entry.js +1 -1
  316. package/dist/esm/salla-quick-order.entry.js +7 -2
  317. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  318. package/dist/esm/salla-rating-modal.entry.js +9 -3
  319. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  320. package/dist/esm/salla-review-order-item.entry.js +1 -1
  321. package/dist/esm/salla-scopes.entry.js +9 -2
  322. package/dist/esm/salla-search-product-card.entry.js +1 -1
  323. package/dist/esm/salla-search.entry.js +1 -1
  324. package/dist/esm/salla-skeleton.entry.js +8 -8
  325. package/dist/esm/salla-social-share.entry.js +1 -1
  326. package/dist/esm/salla-social.entry.js +8 -3
  327. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  328. package/dist/esm/salla-tiered-offer.entry.js +7 -2
  329. package/dist/esm/salla-trust-badges.entry.js +9 -5
  330. package/dist/esm/salla-user-menu.entry.js +39 -2
  331. package/dist/esm/salla-user-profile.entry.js +7 -3
  332. package/dist/esm/salla-user-settings.entry.js +8 -3
  333. package/dist/esm/salla-verify.entry.js +13 -6
  334. package/dist/esm/salla-wallet.entry.js +1 -1
  335. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  336. package/dist/esm/salla-wishlist-summary.entry.js +1 -1
  337. package/dist/esm/translate-CxrJQ3Jf.js +54 -0
  338. package/dist/esm/twilight.js +3 -3
  339. package/dist/esm/{vanilla-picker-CQEJbE9K.js → vanilla-picker-BWBrgMJQ.js} +1 -1
  340. package/dist/twilight/{p-c28395c6.entry.js → p-03e89cb1.entry.js} +1 -1
  341. package/dist/twilight/{p-5babb989.entry.js → p-07dc637e.entry.js} +1 -1
  342. package/dist/twilight/p-0859fe23.entry.js +4 -0
  343. package/dist/twilight/p-0b54834f.entry.js +4 -0
  344. package/dist/twilight/{p-e00ed6c9.entry.js → p-0c9f5232.entry.js} +1 -1
  345. package/dist/twilight/p-0ca1a782.entry.js +4 -0
  346. package/dist/twilight/p-0cb548be.entry.js +4 -0
  347. package/dist/twilight/{p-8ec0fc03.entry.js → p-138d6214.entry.js} +1 -1
  348. package/dist/twilight/p-141218a3.entry.js +4 -0
  349. package/dist/twilight/p-15b8fa7f.entry.js +4 -0
  350. package/dist/twilight/{p-ac20a6de.entry.js → p-15f5d424.entry.js} +1 -1
  351. package/dist/twilight/{p-21ba0eac.entry.js → p-16072449.entry.js} +1 -1
  352. package/dist/twilight/{p-dcb5ceda.entry.js → p-16b2f58b.entry.js} +1 -1
  353. package/dist/twilight/{p-f643bf2f.entry.js → p-18aff2d5.entry.js} +1 -1
  354. package/dist/twilight/{p-7ac91ace.entry.js → p-1930b915.entry.js} +1 -1
  355. package/dist/twilight/p-1cbbdcea.entry.js +4 -0
  356. package/dist/twilight/{p-d75157e0.entry.js → p-1fe92c36.entry.js} +1 -1
  357. package/dist/twilight/{p-f130c67f.entry.js → p-221e47a5.entry.js} +1 -1
  358. package/dist/twilight/p-2636c473.entry.js +4 -0
  359. package/dist/twilight/p-27712ed1.entry.js +4 -0
  360. package/dist/twilight/{p-fac4da2b.entry.js → p-2eea4245.entry.js} +1 -1
  361. package/dist/twilight/{p-d6d72996.entry.js → p-3263103c.entry.js} +1 -1
  362. package/dist/twilight/{p-ca7593c0.entry.js → p-341a7ab8.entry.js} +1 -1
  363. package/dist/twilight/{p-1080831a.entry.js → p-3b4f66d3.entry.js} +1 -1
  364. package/dist/twilight/p-3c45c49f.entry.js +4 -0
  365. package/dist/twilight/{p-e98835e3.entry.js → p-3f730d01.entry.js} +1 -1
  366. package/dist/twilight/{p-12a2b743.entry.js → p-40c8b553.entry.js} +1 -1
  367. package/dist/twilight/p-4333c630.entry.js +4 -0
  368. package/dist/twilight/{p-1a5d0b25.entry.js → p-454b32f0.entry.js} +1 -1
  369. package/dist/twilight/{p-8bdb7f71.entry.js → p-475d01e2.entry.js} +1 -1
  370. package/dist/twilight/{p-f8aa1b23.entry.js → p-4962d869.entry.js} +1 -1
  371. package/dist/twilight/{p-4b0eaa16.entry.js → p-4ce97595.entry.js} +1 -1
  372. package/dist/twilight/p-4d1582f8.entry.js +4 -0
  373. package/dist/twilight/{p-5e426c78.entry.js → p-4d482ee4.entry.js} +1 -1
  374. package/dist/twilight/{p-67d3ee58.entry.js → p-5110433d.entry.js} +1 -1
  375. package/dist/twilight/p-517807b2.entry.js +4 -0
  376. package/dist/twilight/p-52a7dbb7.entry.js +4 -0
  377. package/dist/twilight/{p-160476f0.entry.js → p-5360d082.entry.js} +1 -1
  378. package/dist/twilight/p-53bf1d54.entry.js +4 -0
  379. package/dist/twilight/p-540a7588.entry.js +4 -0
  380. package/dist/twilight/{p-9d434410.entry.js → p-5a6c4fdf.entry.js} +1 -1
  381. package/dist/twilight/{p-5e099f96.entry.js → p-5ac2e6ab.entry.js} +1 -1
  382. package/dist/twilight/{p-de55326d.entry.js → p-64158678.entry.js} +1 -1
  383. package/dist/twilight/p-67ecb74a.entry.js +4 -0
  384. package/dist/twilight/{p-342b31ba.entry.js → p-6e53afc6.entry.js} +1 -1
  385. package/dist/twilight/{p-474997dd.entry.js → p-6f66a0f2.entry.js} +1 -1
  386. package/dist/twilight/p-721819ee.entry.js +4 -0
  387. package/dist/twilight/p-76d11b5c.entry.js +4 -0
  388. package/dist/twilight/p-78b86647.entry.js +4 -0
  389. package/dist/twilight/p-7f0bdf0e.entry.js +4 -0
  390. package/dist/twilight/{p-caee5b0d.entry.js → p-7f882abf.entry.js} +1 -1
  391. package/dist/twilight/{p-6602a61a.entry.js → p-826ed1c6.entry.js} +1 -1
  392. package/dist/twilight/{p-8eb75cf8.entry.js → p-82d59bf3.entry.js} +1 -1
  393. package/dist/twilight/p-856ed222.entry.js +4 -0
  394. package/dist/twilight/{p-4bde9c4e.entry.js → p-87b3c231.entry.js} +1 -1
  395. package/dist/twilight/p-87dcc9d8.entry.js +4 -0
  396. package/dist/twilight/{p-58058ae9.entry.js → p-8876efa6.entry.js} +1 -1
  397. package/dist/twilight/{p-81596b48.entry.js → p-88d64b87.entry.js} +1 -1
  398. package/dist/twilight/p-88f650da.entry.js +4 -0
  399. package/dist/twilight/p-8e248aa7.entry.js +4 -0
  400. package/dist/twilight/p-919dd049.entry.js +4 -0
  401. package/dist/twilight/{p-62653d93.entry.js → p-950634d1.entry.js} +1 -1
  402. package/dist/twilight/{p-a11b77df.entry.js → p-9ce917a6.entry.js} +1 -1
  403. package/dist/twilight/{p-672a709e.entry.js → p-9e084610.entry.js} +1 -1
  404. package/dist/twilight/{p-8513fec2.entry.js → p-9ed52621.entry.js} +1 -1
  405. package/dist/twilight/{p-60d06105.entry.js → p-9fcc7eeb.entry.js} +1 -1
  406. package/dist/twilight/{p-Gxv67UlH.js → p-B867dk1j.js} +1 -1
  407. package/dist/twilight/{p-CJPWrlxL.js → p-BT5AJCX9.js} +1 -1
  408. package/dist/twilight/{p-CtcjG32v.js → p-CADeV7A-.js} +1 -1
  409. package/dist/twilight/{p-E2n9kJc8.js → p-CbJEogz0.js} +1 -1
  410. package/dist/twilight/p-CxrJQ3Jf.js +4 -0
  411. package/dist/twilight/{p-C57CqqgQ.js → p-CyV163V_.js} +1 -1
  412. package/dist/twilight/{p-DiU9tYvl.js → p-D98H4WeK.js} +1 -1
  413. package/dist/twilight/p-DN2opqoB.js +9 -0
  414. package/dist/twilight/{p-pzi0Osm7.js → p-DWkNp24H.js} +1 -1
  415. package/dist/twilight/{p-Bm1ywp6t.js → p-DomdkzLW.js} +1 -1
  416. package/dist/twilight/{p-c28c53c3.entry.js → p-a030da8e.entry.js} +1 -1
  417. package/dist/twilight/{p-3a465851.entry.js → p-a2de7999.entry.js} +1 -1
  418. package/dist/twilight/{p-c89282b0.entry.js → p-a8408d51.entry.js} +1 -1
  419. package/dist/twilight/p-aabc57e3.entry.js +4 -0
  420. package/dist/twilight/p-b1a35349.entry.js +4 -0
  421. package/dist/twilight/{p-fd787b30.entry.js → p-ba76a96a.entry.js} +1 -1
  422. package/dist/twilight/{p-d6508494.entry.js → p-ba9ee435.entry.js} +1 -1
  423. package/dist/twilight/{p-f47a1351.entry.js → p-be7dcc25.entry.js} +1 -1
  424. package/dist/twilight/{p-54bc613c.entry.js → p-c41c1eff.entry.js} +1 -1
  425. package/dist/twilight/p-c589a326.entry.js +4 -0
  426. package/dist/twilight/{p-e43c49e9.entry.js → p-c5d4682b.entry.js} +1 -1
  427. package/dist/twilight/p-c631e2cd.entry.js +4 -0
  428. package/dist/twilight/{p-97bb12a6.entry.js → p-c6af4f05.entry.js} +1 -1
  429. package/dist/twilight/{p-da9bd7f6.entry.js → p-c8d269df.entry.js} +1 -1
  430. package/dist/twilight/{p-e4589779.entry.js → p-cab2f22a.entry.js} +1 -1
  431. package/dist/twilight/{p-f3985cfd.entry.js → p-ce120ce6.entry.js} +1 -1
  432. package/dist/twilight/{p-80699771.entry.js → p-ce981b2f.entry.js} +1 -1
  433. package/dist/twilight/p-d09b6b8c.entry.js +4 -0
  434. package/dist/twilight/{p-b3abf071.entry.js → p-d13f5256.entry.js} +1 -1
  435. package/dist/twilight/{p-c82f46a9.entry.js → p-d306b947.entry.js} +1 -1
  436. package/dist/twilight/p-d986aa18.entry.js +4 -0
  437. package/dist/twilight/{p-844176cb.entry.js → p-e4c88bee.entry.js} +1 -1
  438. package/dist/twilight/p-e7fc0d63.entry.js +4 -0
  439. package/dist/twilight/p-eef846fa.entry.js +4 -0
  440. package/dist/twilight/{p-dbc1e40c.entry.js → p-f03f893c.entry.js} +1 -1
  441. package/dist/twilight/p-f5f0246f.entry.js +4 -0
  442. package/dist/twilight/p-f6f633fc.entry.js +4 -0
  443. package/dist/twilight/p-f9fbcb8d.entry.js +4 -0
  444. package/dist/twilight/p-fc717703.entry.js +4 -0
  445. package/dist/twilight/{p-C1mBhG6Z.js → p-noRE1pbw.js} +2 -2
  446. package/dist/twilight/twilight.esm.js +1 -1
  447. package/dist/types/Helpers/money-text.d.ts +13 -0
  448. package/dist/types/Helpers/translate.d.ts +17 -0
  449. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +2 -1
  450. package/dist/types/components/salla-alert/salla-alert.d.ts +3 -3
  451. package/dist/types/components/salla-apps-icons/salla-apps-icons.d.ts +3 -0
  452. package/dist/types/components/salla-booking-field/salla-booking-field.d.ts +3 -0
  453. package/dist/types/components/salla-bottom-alert/salla-bottom-alert.d.ts +3 -1
  454. package/dist/types/components/salla-button/salla-button.d.ts +10 -18
  455. package/dist/types/components/salla-cart-item-offers/salla-cart-item-offers.d.ts +3 -0
  456. package/dist/types/components/salla-cart-summary/salla-cart-summary.d.ts +2 -2
  457. package/dist/types/components/salla-comment-form/salla-comment-form.d.ts +3 -0
  458. package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -1
  459. package/dist/types/components/salla-comments/salla-comments.d.ts +3 -0
  460. package/dist/types/components/salla-contacts/salla-contacts.d.ts +4 -0
  461. package/dist/types/components/salla-count-down/salla-count-down.d.ts +17 -14
  462. package/dist/types/components/salla-custom-fields/salla-custom-fields.d.ts +4 -0
  463. package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +12 -0
  464. package/dist/types/components/salla-filters/salla-filters.d.ts +4 -1
  465. package/dist/types/components/salla-filters-widget/salla-filters-widget.d.ts +2 -0
  466. package/dist/types/components/salla-gifting/salla-gifting.d.ts +3 -0
  467. package/dist/types/components/salla-hook/salla-hook.d.ts +4 -0
  468. package/dist/types/components/salla-infinite-scroll/salla-infinite-scroll.d.ts +3 -0
  469. package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +4 -0
  470. package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +3 -0
  471. package/dist/types/components/salla-loyalty/salla-loyalty.d.ts +3 -0
  472. package/dist/types/components/salla-map/salla-map.d.ts +3 -0
  473. package/dist/types/components/salla-notifications/salla-notifications.d.ts +3 -1
  474. package/dist/types/components/salla-offer/salla-offer.d.ts +3 -0
  475. package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +3 -0
  476. package/dist/types/components/salla-order-branch/interfaces.d.ts +1 -0
  477. package/dist/types/components/salla-order-branch/salla-order-branch.d.ts +10 -1
  478. package/dist/types/components/salla-order-summary/salla-order-summary.d.ts +2 -0
  479. package/dist/types/components/salla-order-totals-card/interfaces.d.ts +4 -3
  480. package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +2 -0
  481. package/dist/types/components/salla-orders/salla-orders.d.ts +3 -1
  482. package/dist/types/components/salla-placeholder/salla-placeholder.d.ts +3 -1
  483. package/dist/types/components/salla-price-range/salla-price-range.d.ts +2 -0
  484. package/dist/types/components/salla-product-availability/salla-product-availability.d.ts +4 -0
  485. package/dist/types/components/salla-product-card/salla-product-card.d.ts +12 -9
  486. package/dist/types/components/salla-product-options/salla-product-options.d.ts +2 -0
  487. package/dist/types/components/salla-product-size-guide/salla-product-size-guide.d.ts +3 -0
  488. package/dist/types/components/salla-products-list/salla-products-list.d.ts +1 -0
  489. package/dist/types/components/salla-progress-bar/salla-progress-bar.d.ts +5 -0
  490. package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +3 -1
  491. package/dist/types/components/salla-quick-order/salla-quick-order.d.ts +3 -0
  492. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +3 -0
  493. package/dist/types/components/salla-rating-stars/salla-rating-stars.d.ts +14 -14
  494. package/dist/types/components/salla-review-card/salla-review-card.d.ts +4 -0
  495. package/dist/types/components/salla-reviews/salla-reviews.d.ts +3 -0
  496. package/dist/types/components/salla-scopes/salla-scopes.d.ts +3 -0
  497. package/dist/types/components/salla-skeleton/salla-skeleton.d.ts +6 -6
  498. package/dist/types/components/salla-slider/salla-slider.d.ts +2 -0
  499. package/dist/types/components/salla-social/salla-social.d.ts +3 -0
  500. package/dist/types/components/salla-tabs/salla-tab-header.d.ts +2 -2
  501. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +3 -1
  502. package/dist/types/components/salla-tiered-offer/salla-tiered-offer.d.ts +3 -1
  503. package/dist/types/components/salla-trust-badges/salla-trust-badges.d.ts +3 -1
  504. package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +16 -0
  505. package/dist/types/components/salla-user-profile/salla-user-profile.d.ts +3 -1
  506. package/dist/types/components/salla-user-settings/salla-user-settings.d.ts +3 -0
  507. package/dist/types/components/salla-verify/salla-verify.d.ts +3 -0
  508. package/dist/types/components.d.ts +128 -80
  509. package/package.json +19 -19
  510. package/dist/cjs/translate-BeU1QX_r.js +0 -20
  511. package/dist/esm/translate-CrSV-tno.js +0 -18
  512. package/dist/twilight/p-020eb2a1.entry.js +0 -4
  513. package/dist/twilight/p-06799084.entry.js +0 -4
  514. package/dist/twilight/p-0a3abfd4.entry.js +0 -4
  515. package/dist/twilight/p-0ef388be.entry.js +0 -4
  516. package/dist/twilight/p-1f99db23.entry.js +0 -4
  517. package/dist/twilight/p-232c39e9.entry.js +0 -4
  518. package/dist/twilight/p-305ed224.entry.js +0 -4
  519. package/dist/twilight/p-3a4cf66c.entry.js +0 -4
  520. package/dist/twilight/p-3c4702bb.entry.js +0 -4
  521. package/dist/twilight/p-3dcb5129.entry.js +0 -4
  522. package/dist/twilight/p-43d0c80e.entry.js +0 -4
  523. package/dist/twilight/p-50bbbd18.entry.js +0 -4
  524. package/dist/twilight/p-51c26ce7.entry.js +0 -4
  525. package/dist/twilight/p-54054ab9.entry.js +0 -4
  526. package/dist/twilight/p-5c1a36ab.entry.js +0 -4
  527. package/dist/twilight/p-5cf3929c.entry.js +0 -4
  528. package/dist/twilight/p-8028be6f.entry.js +0 -4
  529. package/dist/twilight/p-82939afe.entry.js +0 -4
  530. package/dist/twilight/p-85cff524.entry.js +0 -4
  531. package/dist/twilight/p-8dfdd6c9.entry.js +0 -4
  532. package/dist/twilight/p-92f6aa52.entry.js +0 -4
  533. package/dist/twilight/p-BB23a2fo.js +0 -9
  534. package/dist/twilight/p-CrSV-tno.js +0 -4
  535. package/dist/twilight/p-a4aac112.entry.js +0 -4
  536. package/dist/twilight/p-a52bfa57.entry.js +0 -4
  537. package/dist/twilight/p-a9aadc0b.entry.js +0 -4
  538. package/dist/twilight/p-bc26490f.entry.js +0 -4
  539. package/dist/twilight/p-bef93c52.entry.js +0 -4
  540. package/dist/twilight/p-c30bfc0b.entry.js +0 -4
  541. package/dist/twilight/p-cb770a9e.entry.js +0 -4
  542. package/dist/twilight/p-cbcca1ff.entry.js +0 -4
  543. package/dist/twilight/p-d81bcfb3.entry.js +0 -4
  544. package/dist/twilight/p-e67b2aa8.entry.js +0 -4
  545. package/dist/twilight/p-e9ce8dec.entry.js +0 -4
  546. package/dist/twilight/p-eb718f6b.entry.js +0 -4
  547. package/dist/twilight/p-ec361a66.entry.js +0 -4
  548. package/dist/twilight/p-f32de457.entry.js +0 -4
  549. package/dist/twilight/p-f626ef96.entry.js +0 -4
  550. package/dist/twilight/p-f6df7f8a.entry.js +0 -4
  551. package/dist/twilight/p-fd3bb3f2.entry.js +0 -4
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ const escapeHtml = (value) => String(value).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
5
+ /** Riyal icon swap, the same rule `salla.money()` applies when the store enables `use_sar_symbol`. */
6
+ const withSarIcon = (html) => salla?.config?.get?.('store.settings.use_sar_symbol') ? html.replace(/SAR|ر\.س\.?/g, '<i class=sicon-sar></i>') : html;
7
+ /**
8
+ * Money in a given currency as HTML, without ever borrowing another currency's symbol.
9
+ * `salla.money()` resolves currencies from the page config, which under Multimarket only holds the
10
+ * selected market's currencies, and silently falls back to them — so an order placed in SAR (or KWD)
11
+ * would show the current market's symbol. Known currencies keep `salla.money()`'s store formatting;
12
+ * unknown ones use the ISO symbol from `Intl`, separated by a non-breaking space.
13
+ */
14
+ export function moneyHtml(amount, currency) {
15
+ // Only bypass salla.money when the page's currency list is known and lacks this code.
16
+ const currencies = salla?.config?.get?.('currencies');
17
+ if (!currency || !currencies || typeof currencies !== 'object' || currencies[currency]) {
18
+ return salla.money({ amount, currency });
19
+ }
20
+ let symbol = currency;
21
+ try {
22
+ symbol = new Intl.NumberFormat(salla?.lang?.locale || 'ar', { style: 'currency', currency, currencyDisplay: 'narrowSymbol' })
23
+ .formatToParts(0)
24
+ .find(part => part.type === 'currency')?.value || currency;
25
+ }
26
+ catch {
27
+ // unknown ISO code: show the code itself
28
+ }
29
+ return withSarIcon(`${escapeHtml(salla.helpers.number(amount))} ${escapeHtml(symbol)}`);
30
+ }
31
+ /**
32
+ * Server-formatted money text (twig `|money`) as safe HTML: escaped, then the riyal icon swap.
33
+ * Kept for payloads that still send formatted strings.
34
+ */
35
+ export function moneyTextHtml(text) {
36
+ return withSarIcon(escapeHtml(text));
37
+ }
@@ -14,3 +14,39 @@ export function translate(key, replacements, fallback) {
14
14
  const value = salla.lang.get(key, replacements);
15
15
  return !value || value === key ? fallback : value;
16
16
  }
17
+ /**
18
+ * The value stored for `key` in one locale bucket of `salla.lang.messages` (e.g. `'en.trans'`).
19
+ * Read the bucket directly: `salla.lang.get()` falls back to English, so it can't tell which locale is missing.
20
+ */
21
+ function getLocaleTranslation(locale, key) {
22
+ return key.split('.').reduce((node, part) => node?.[part], salla.lang.messages?.[locale]);
23
+ }
24
+ /**
25
+ * Register bundled ar/en defaults only where a locale has no translation for the key yet.
26
+ *
27
+ * `salla.lang.addBulk()` overwrites, and a `salla.lang.subscribe()` callback runs again on every
28
+ * `salla.lang.setMessages()`, so adding unconditionally would replace the store's own text for these keys.
29
+ */
30
+ export function addMissingTranslations(defaults) {
31
+ const missing = Object.entries(defaults).reduce((acc, [key, translations]) => {
32
+ Object.entries(translations).forEach(([locale, value]) => {
33
+ if (getLocaleTranslation(`${locale}.trans`, key) === undefined) {
34
+ (acc[key] = acc[key] || {})[locale] = value;
35
+ }
36
+ });
37
+ return acc;
38
+ }, {});
39
+ if (Object.keys(missing).length) {
40
+ salla.lang.addBulk(missing);
41
+ }
42
+ }
43
+ /**
44
+ * Set a bundled default in one locale bucket of `salla.lang.messages` (e.g. `'en.trans'`), unless that key
45
+ * already has a value there. Same reason as {@link addMissingTranslations}: `setNested()` overwrites.
46
+ */
47
+ export function setTranslationDefault(locale, key, value) {
48
+ const messages = salla.lang.messages?.[locale];
49
+ if (messages && getLocaleTranslation(locale, key) === undefined) {
50
+ salla.helpers.setNested(messages, key, value);
51
+ }
52
+ }
@@ -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, forceUpdate } from "@stencil/core";
5
5
  import Cart from "../../assets/svg/cart.svg";
6
6
  // import SallaIcon from '../../assets/svg/salla.svg';
7
7
  import WalletIcon from "../../assets/svg/full-wallet.svg";
@@ -48,8 +48,12 @@ export class SallaAddProductButton {
48
48
  this.isDesktopViewport = e.matches;
49
49
  this.btn?.setText((e.matches && !!this.passedLabel) ? this.passedLabel : this.getLabel());
50
50
  };
51
- salla.lang.onLoaded(() => {
51
+ }
52
+ connectedCallback() {
53
+ this.langUnsubscribe = salla.lang.subscribe(() => {
52
54
  this.buyNowText = salla.lang.get('pages.products.buy_now');
55
+ // re-render so componentDidRender() re-applies the button label
56
+ forceUpdate(this);
53
57
  });
54
58
  }
55
59
  /**
@@ -377,6 +381,7 @@ export class SallaAddProductButton {
377
381
  salla.lang.onLoaded(() => this.btn?.setText(this.getLabel()));
378
382
  }
379
383
  disconnectedCallback() {
384
+ this.langUnsubscribe?.();
380
385
  this.viewportMediaQuery?.removeEventListener('change', this.onViewportChange);
381
386
  salla.product?.event?.offPriceUpdated?.(this.onBuyNowPriceUpdated);
382
387
  }
@@ -5,7 +5,7 @@ import { Host, h } from "@stencil/core";
5
5
  import informationIcon from "../../assets/svg/information-line.svg";
6
6
  export class SallaAlert {
7
7
  constructor() {
8
- /** Variant theme */
8
+ /** The visual style/theme of the alert. Can be 'info', 'success', 'warning', or 'error'. Default is 'info'. */
9
9
  this.variant = 'info';
10
10
  }
11
11
  renderIcon() {
@@ -24,7 +24,7 @@ export class SallaAlert {
24
24
  }
25
25
  }
26
26
  render() {
27
- return (h(Host, { key: '053085e619a62bc641cf05e5fab4c3d601560d4b', class: `s-alert-wrapper s-alert-${this.variant}` }, h("span", { key: '8c9b20d9382b0e9eaec53b769c98c73df01043b6', class: "s-alert-icon" }, this.renderIcon()), h("span", { key: '0ab4176e253bfe191c4115c6d4bcdf815895e746', class: "s-alert-text" }, this.message, h("slot", { key: 'd4f428d1d47ddf977d0363c0476e7190ef680857' }))));
27
+ return (h(Host, { key: 'c1a1e9575ed9aab90960ad3a54ada18d8e3ee240', class: `s-alert-wrapper s-alert-${this.variant}` }, h("span", { key: '7fb08789ad8355cc4bd441a5869e95d2337685a5', class: "s-alert-icon" }, this.renderIcon()), h("span", { key: 'ed3c4fcb5450f21caedeeca28a9a177b151333ec', class: "s-alert-text" }, this.message, h("slot", { key: '6818451171f85fd6ad63f07c69871082d3fcba4e' }))));
28
28
  }
29
29
  static get is() { return "salla-alert"; }
30
30
  static get originalStyleUrls() {
@@ -52,7 +52,7 @@ export class SallaAlert {
52
52
  "optional": false,
53
53
  "docs": {
54
54
  "tags": [],
55
- "text": "Message text"
55
+ "text": "The alert message text to display."
56
56
  },
57
57
  "getter": false,
58
58
  "setter": false,
@@ -71,7 +71,7 @@ export class SallaAlert {
71
71
  "optional": false,
72
72
  "docs": {
73
73
  "tags": [],
74
- "text": "Variant theme"
74
+ "text": "The visual style/theme of the alert. Can be 'info', 'success', 'warning', or 'error'. Default is 'info'."
75
75
  },
76
76
  "getter": false,
77
77
  "setter": false,
@@ -91,7 +91,7 @@ export class SallaAlert {
91
91
  "optional": true,
92
92
  "docs": {
93
93
  "tags": [],
94
- "text": "Icon type (defaults to variant)"
94
+ "text": "The icon type to display. Defaults to the variant type. Set to 'none' to hide the icon."
95
95
  },
96
96
  "getter": false,
97
97
  "setter": false,
@@ -12,10 +12,15 @@ export class SallaAppsIcons {
12
12
  salla.onReady(() => {
13
13
  this.apps = salla.config.get('store.apps');
14
14
  });
15
- salla.lang.onLoaded(() => {
15
+ }
16
+ connectedCallback() {
17
+ this.langUnsubscribe = salla.lang.subscribe(() => {
16
18
  this.appsTitle = salla.lang.get('blocks.footer.download_apps');
17
19
  });
18
20
  }
21
+ disconnectedCallback() {
22
+ this.langUnsubscribe?.();
23
+ }
19
24
  getAppsArray() {
20
25
  return Object.entries(this.apps)
21
26
  .map(([name, value]) => ({ name, value }));
@@ -5,6 +5,7 @@ import { Host, h } from "@stencil/core";
5
5
  import BookingTime from "../../assets/svg/calendar-time.svg";
6
6
  import Calendar from "../../assets/svg/calendar.svg";
7
7
  import TimeIcon from "../../assets/svg/time.svg";
8
+ import { setTranslationDefault } from "../../Helpers/translate";
8
9
  export class SallaBookingField {
9
10
  constructor() {
10
11
  this.bookNowLabel = salla.lang.get('pages.cart.book_an_appointment', 'حجز موعد');
@@ -14,15 +15,20 @@ export class SallaBookingField {
14
15
  this.bookingUrl = '';
15
16
  this.iframeReady = false;
16
17
  this.reservations = [];
17
- // Load translations
18
- salla.lang.onLoaded(() => this.setTranslations());
19
18
  // Register event listeners
20
19
  Salla.event.on('booking::open', (data) => this.handleBookingOpen(data));
21
20
  }
21
+ connectedCallback() {
22
+ // Load translations
23
+ this.langUnsubscribe = salla.lang.subscribe(() => this.setTranslations());
24
+ }
25
+ disconnectedCallback() {
26
+ this.langUnsubscribe?.();
27
+ }
22
28
  async setTranslations() {
23
29
  const setNestedAsync = (lang, key, value) => {
24
30
  return new Promise((resolve) => {
25
- salla.helpers.setNested(salla.lang.messages[lang], key, value);
31
+ setTranslationDefault(lang, key, value);
26
32
  resolve(true);
27
33
  });
28
34
  };
@@ -148,7 +154,7 @@ export class SallaBookingField {
148
154
  return (h("span", { class: "s-booking-field-reservations-time" }, h("i", { class: "s-booking-field-reservations-icon", innerHTML: TimeIcon }), h("span", null, reservation.from_timestamp, " - ", reservation.to_timestamp)));
149
155
  }
150
156
  render() {
151
- return (h(Host, { key: '2ccdcbee3a61bfa69e1e272dca9e993cd568baf8' }, h("div", { key: 'b26b71c2d9ac60e84461e54b4979c5e89e87e437', class: "s-booking-field-main" }, this.option.required || this.reservations.length > 0 ? h("div", { class: "s-booking-field-price" }, h("span", { innerHTML: salla.money(this.option.price) })) : '', h("salla-button", { key: '739e1d72691af1760caa732090057b24c751a807', class: "s-booking-field-book-now", size: "small", loaderPosition: "center", fill: "outline", onClick: event => this.openBookingModal(event, false) }, h("span", { key: 'c00e5db1bd56c66c2b72db3371c748fa9fa10602', class: "s-booking-field-book-now-content" }, h("span", { key: 'd85c983123460c3f528ab6aea7b6c57bb9cb0f0f', innerHTML: BookingTime }), this.reservations.length ? this.editLabel : this.bookNowLabel))), this.reservations.length > 0 && (h("div", { key: 'b94321aaad303ab7aa21f629b8c9de458209346b', class: "s-booking-field-reservations" }, this.reservations.map((reservation, index) => (h("div", { key: index, class: "s-booking-field-reservations-item" }, this.renderReservationDate(reservation), this.renderReservationTime(reservation)))))), h("input", { key: 'aa18bd55cfd8903cfe66655ed4737854aab6da75', class: "s-hidden", name: this.option.name, required: this.option.required, value: JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations), ref: reservations => this.reservationsInput = reservations }), this.iframeReady && this.bookingModal()));
157
+ return (h(Host, { key: '58a42c3f74c835039e3eeab63b3fdb8b1ab3f3d7' }, h("div", { key: '3e700a1f5de967167a1a5014ee6a39ae99ce53e7', class: "s-booking-field-main" }, this.option.required || this.reservations.length > 0 ? h("div", { class: "s-booking-field-price" }, h("span", { innerHTML: salla.money(this.option.price) })) : '', h("salla-button", { key: '7f86d43a5a5100869f249b690545269e218a1799', class: "s-booking-field-book-now", size: "small", loaderPosition: "center", fill: "outline", onClick: event => this.openBookingModal(event, false) }, h("span", { key: '9a8b446c2d59ffe0b2800d48de1911c2b94a9078', class: "s-booking-field-book-now-content" }, h("span", { key: '678a8be040e17bdd6234c05d79a29fb45286156d', innerHTML: BookingTime }), this.reservations.length ? this.editLabel : this.bookNowLabel))), this.reservations.length > 0 && (h("div", { key: 'c1271b41d4584887a2c4e07b90c4d3b7ef285447', class: "s-booking-field-reservations" }, this.reservations.map((reservation, index) => (h("div", { key: index, class: "s-booking-field-reservations-item" }, this.renderReservationDate(reservation), this.renderReservationTime(reservation)))))), h("input", { key: 'b4f42ddb7adee25ef281805491bd4e5effc73ab9', class: "s-hidden", name: this.option.name, required: this.option.required, value: JSON.stringify(this.reservations) === '[]' ? '' : JSON.stringify(this.reservations), ref: reservations => this.reservationsInput = reservations }), this.iframeReady && this.bookingModal()));
152
158
  }
153
159
  static get is() { return "salla-booking-field"; }
154
160
  static get originalStyleUrls() {
@@ -7,6 +7,7 @@ import cartIcon from "../../assets/svg/cart.svg";
7
7
  import imageIcon from "../../assets/svg/image.svg";
8
8
  import moneyIcon from "../../assets/svg/money-card.svg";
9
9
  import checkCircleIcon from "../../assets/svg/check-circle.svg";
10
+ import { setTranslationDefault } from "../../Helpers/translate";
10
11
  export class SallaBottomAlert {
11
12
  constructor() {
12
13
  this.storeId = salla.config.get('store.id');
@@ -31,7 +32,9 @@ export class SallaBottomAlert {
31
32
  * Alert Type
32
33
  * */
33
34
  this.type = 'popup';
34
- salla.lang.onLoaded(() => {
35
+ }
36
+ connectedCallback() {
37
+ this.langUnsubscribe = salla.lang.subscribe(() => {
35
38
  this.defaultMessage = salla.lang.get('common.elements.experimental_and_available_store');
36
39
  this.defaultActionLabel = salla.lang.get('common.elements.know_more');
37
40
  this.storeFeatures = salla.lang.get('common.elements.store_features');
@@ -42,20 +45,20 @@ export class SallaBottomAlert {
42
45
  const enTrans = salla.lang.messages?.['en.trans'];
43
46
  if (!arTrans || !enTrans)
44
47
  return;
45
- salla.helpers.setNested(arTrans, 'common.elements.more_details', 'تفاصيل أكثر');
46
- salla.helpers.setNested(enTrans, 'common.elements.more_details', 'More Details');
47
- salla.helpers.setNested(arTrans, 'common.elements.store_price', 'سعر المتجر');
48
- salla.helpers.setNested(enTrans, 'common.elements.store_price', 'Store Price');
49
- salla.helpers.setNested(arTrans, 'common.elements.the_developer', 'المطور');
50
- salla.helpers.setNested(enTrans, 'common.elements.the_developer', 'the developer');
51
- salla.helpers.setNested(arTrans, 'common.elements.store_price_details', 'السعر يشمل');
52
- salla.helpers.setNested(enTrans, 'common.elements.store_price_details', 'Price Includes');
53
- salla.helpers.setNested(arTrans, 'common.elements.salla', 'سلة');
54
- salla.helpers.setNested(enTrans, 'common.elements.salla', 'Salla');
55
- salla.helpers.setNested(arTrans, 'common.elements.store_is_available_for_purchase', 'هذا المتجر تطويري ومتاح للشراء من');
56
- salla.helpers.setNested(enTrans, 'common.elements.store_is_available_for_purchase', 'This ready store is available for purchase from');
57
- salla.helpers.setNested(arTrans, 'common.elements.ready_stores', 'المتاجر الجاهزة');
58
- salla.helpers.setNested(enTrans, 'common.elements.ready_stores', 'Ready Stores');
48
+ setTranslationDefault('ar.trans', 'common.elements.more_details', 'تفاصيل أكثر');
49
+ setTranslationDefault('en.trans', 'common.elements.more_details', 'More Details');
50
+ setTranslationDefault('ar.trans', 'common.elements.store_price', 'سعر المتجر');
51
+ setTranslationDefault('en.trans', 'common.elements.store_price', 'Store Price');
52
+ setTranslationDefault('ar.trans', 'common.elements.the_developer', 'المطور');
53
+ setTranslationDefault('en.trans', 'common.elements.the_developer', 'the developer');
54
+ setTranslationDefault('ar.trans', 'common.elements.store_price_details', 'السعر يشمل');
55
+ setTranslationDefault('en.trans', 'common.elements.store_price_details', 'Price Includes');
56
+ setTranslationDefault('ar.trans', 'common.elements.salla', 'سلة');
57
+ setTranslationDefault('en.trans', 'common.elements.salla', 'Salla');
58
+ setTranslationDefault('ar.trans', 'common.elements.store_is_available_for_purchase', 'هذا المتجر تطويري ومتاح للشراء من');
59
+ setTranslationDefault('en.trans', 'common.elements.store_is_available_for_purchase', 'This ready store is available for purchase from');
60
+ setTranslationDefault('ar.trans', 'common.elements.ready_stores', 'المتاجر الجاهزة');
61
+ setTranslationDefault('en.trans', 'common.elements.ready_stores', 'Ready Stores');
59
62
  setTimeout(() => {
60
63
  this.storePrice = salla.lang.get('common.elements.store_price');
61
64
  this.theDeveloper = salla.lang.get('common.elements.the_developer');
@@ -68,6 +71,9 @@ export class SallaBottomAlert {
68
71
  }, 100);
69
72
  });
70
73
  }
74
+ disconnectedCallback() {
75
+ this.langUnsubscribe?.();
76
+ }
71
77
  componentDidLoad() {
72
78
  // Fetch template data on mount if there's a template
73
79
  if (this.template &&
@@ -128,9 +134,9 @@ export class SallaBottomAlert {
128
134
  }
129
135
  render() {
130
136
  const hasTemplate = this.template && typeof this.template === 'object' && Object.keys(this.template).length > 0;
131
- return (h(Host, { key: '00d1b1e0b98318096f366dfa13c43df13d95df1c', class: `s-bottom-alert-wrapper ${hasTemplate ? 's-bottom-alert-wrapper-with-template' : ''}` }, hasTemplate && (h("div", { key: '01079527fba6e46eb5e893e64b68e66f35f12c2f', class: "s-bottom-alert-logo-section" }, h("img", { key: '49fd2f67e97ded7ff6240573b825dcea349e47f8', src: "https://cdn.salla.network/images/logo/logo-light.svg", alt: "Salla", class: "s-bottom-alert-logo" }), h("span", { key: '998216dbcfb5381c94ef3b94ddfa2334ccfd24ac', class: "s-bottom-alert-logo-text" }, this.readyStores))), h("div", { key: '68bd744c9b41847ca757f1127610c84e3eededf6', class: "s-bottom-alert-content" }, h("div", { key: '2dd6195b822a6e076fffddc8fb851292f97e8074', class: "flex items-center gap-2" }, h("div", { key: '67ea932ac092fa207b1888f7641d8733c5109f01', class: "s-bottom-alert-icon" }, this.icon ? h("i", { class: this.icon }) : h("i", { innerHTML: infoIcon })), h("div", { key: '5ea417ca4e00f9a3e19902d84192a9f788c1e75b', class: "s-bottom-alert-message" }, this.message ? (this.message) : hasTemplate ? (h("span", { class: "flex flex-wrap items-center gap-1" }, this.defaultMessage, h("span", { class: {
137
+ return (h(Host, { key: '4c3b1d7d0be604027b8b95fd78b9b464621e526a', class: `s-bottom-alert-wrapper ${hasTemplate ? 's-bottom-alert-wrapper-with-template' : ''}` }, hasTemplate && (h("div", { key: '6c90fd96f45ca304de08324a3ae40de3e868dc23', class: "s-bottom-alert-logo-section" }, h("img", { key: 'f84bae86ce5d82750d7ba6d2d29ce81140e1fe3f', src: "https://cdn.salla.network/images/logo/logo-light.svg", alt: "Salla", class: "s-bottom-alert-logo" }), h("span", { key: '8e78eb67f2b02934fe9fe9ed08aa3b0fb81c82d4', class: "s-bottom-alert-logo-text" }, this.readyStores))), h("div", { key: '1c64cbdced918c2568089c9e0c9cd6b3ec02229a', class: "s-bottom-alert-content" }, h("div", { key: 'bdbfa17a0c192ddfd5e315b097a1c6dae8b30047', class: "flex items-center gap-2" }, h("div", { key: 'e908c88635ac3a38a609aa21a4e6aa901fc5d7eb', class: "s-bottom-alert-icon" }, this.icon ? h("i", { class: this.icon }) : h("i", { innerHTML: infoIcon })), h("div", { key: 'a57c3f1d12302dae8bce086cc7a76c6251a1de37', class: "s-bottom-alert-message" }, this.message ? (this.message) : hasTemplate ? (h("span", { class: "flex flex-wrap items-center gap-1" }, this.defaultMessage, h("span", { class: {
132
138
  's-bottom-alert-message-highlight': true,
133
- }, "aria-label": "Developer" }, this.salla), h("span", { innerHTML: salla.money(this.template.price) }))) : (this.defaultMessage))), this.type !== 'banner' && (h("div", { key: '06f2d2949b3a5864151eb96378fc8f82373397a7', class: hasTemplate ? 's-bottom-alert-actions-group' : 's-bottom-alert-action' }, hasTemplate ? (this.loading ? (h("salla-loading", { size: "20" })) : (h("div", { class: "s-bottom-alert-actions-group-container" }, h("a", { class: "s-bottom-alert-action-link", onClick: () => this.handleAction() }, this.actionLabel || this.moreDetailsLabel), this.templateData?.link ? (h("button", { type: "button", class: "s-bottom-alert-action-purchase-button", onClick: () => window.open(this.templateData?.link, '_blank') }, this.buyTheTemplate)) : null))) : (h("salla-button", { href: this.actionUrl, size: "medium", onClick: () => this.handleAction(), width: "normal" }, this.actionLabel || this.defaultActionLabel)))), this.type === 'popup' && this.popup())));
139
+ }, "aria-label": "Developer" }, this.salla), h("span", { innerHTML: salla.money(this.template.price) }))) : (this.defaultMessage))), this.type !== 'banner' && (h("div", { key: 'f80ef6a48ed2b1d0c6e3aacf1988878bc8eee9a3', class: hasTemplate ? 's-bottom-alert-actions-group' : 's-bottom-alert-action' }, hasTemplate ? (this.loading ? (h("salla-loading", { size: "20" })) : (h("div", { class: "s-bottom-alert-actions-group-container" }, h("a", { class: "s-bottom-alert-action-link", onClick: () => this.handleAction() }, this.actionLabel || this.moreDetailsLabel), this.templateData?.link ? (h("button", { type: "button", class: "s-bottom-alert-action-purchase-button", onClick: () => window.open(this.templateData?.link, '_blank') }, this.buyTheTemplate)) : null))) : (h("salla-button", { href: this.actionUrl, size: "medium", onClick: () => this.handleAction(), width: "normal" }, this.actionLabel || this.defaultActionLabel)))), this.type === 'popup' && this.popup())));
134
140
  }
135
141
  static get is() { return "salla-bottom-alert"; }
136
142
  static get originalStyleUrls() {
@@ -675,6 +675,7 @@
675
675
  color: rgb(107 114 128 / var(--tw-text-opacity, 1));
676
676
  }
677
677
  .s-bullet-delivery-addresses-list{
678
+ position: relative;
678
679
  display: flex;
679
680
  max-height: 260px;
680
681
  flex-direction: column;
@@ -923,6 +924,7 @@
923
924
  overflow: hidden;
924
925
  }
925
926
  .s-bullet-delivery-branches-list{
927
+ position: relative;
926
928
  max-height: min(260px, 32svh);
927
929
  overflow-y: auto;
928
930
  border-radius: 0.5rem;
@@ -5,27 +5,27 @@ import { h, Host } from "@stencil/core";
5
5
  export class SallaButton {
6
6
  constructor() {
7
7
  /**
8
- * Button Type
8
+ * The shape/variant of the button. Can be 'link' (text-only style), 'icon' (circular icon button), or 'btn' (standard button). Default is 'btn'.
9
9
  */
10
10
  this.shape = 'btn';
11
11
  /**
12
- * Button Color
12
+ * The color theme of the button. Available options: 'primary', 'success', 'warning', 'danger', 'light', 'gray', 'dark'. Default is 'primary'.
13
13
  */
14
14
  this.color = 'primary';
15
15
  /**
16
- * Button Fill
16
+ * The fill style of the button. 'solid' (filled background), 'outline' (bordered, transparent background), or 'none'. Default is 'solid'.
17
17
  */
18
18
  this.fill = 'solid';
19
19
  /**
20
- * Button Size
20
+ * The size of the button. Can be 'small', 'medium', or 'large'. Default is 'medium'.
21
21
  */
22
22
  this.size = 'medium';
23
23
  /**
24
- * Button Width
24
+ * The width of the button. 'wide' makes the button full-width, 'normal' uses auto width. Default is 'normal'.
25
25
  */
26
26
  this.width = 'normal';
27
27
  /**
28
- * Is the button currently loading
28
+ * Shows a loading spinner on the button. Default is false.
29
29
  */
30
30
  this.loading = false;
31
31
  /**
@@ -35,23 +35,15 @@ export class SallaButton {
35
35
  */
36
36
  this.enableLoader = true;
37
37
  /**
38
- * Is the button currently disabled
38
+ * Disables the button, preventing user interaction. Default is false.
39
39
  */
40
40
  this.disabled = false;
41
41
  /**
42
- * If there is need to change loader position, pass the position
42
+ * Position of the loading spinner. Can be 'start', 'end', 'center', or 'after' (after the button text). Default is 'after'.
43
43
  */
44
44
  this.loaderPosition = 'after';
45
45
  /**
46
- * Determines the type of the rendered button.
47
- * By default, the type is set to "button," making it a general-purpose button.
48
- * Setting `type` to "submit" makes the button behave as a submit button within a form, triggering form submission.
49
- * Possible values for `type` include "button," "submit," "reset," and "menu.".
50
- *
51
- * Possible values and their usage are as follows:
52
- * "button" (default, used for general button functionality),
53
- * "reset" (resets form fields to their default values), and
54
- * "menu" (represents a button that, when activated, displays a context menu).
46
+ * The HTML type attribute for the button. 'button' (default, general-purpose), 'submit' (submits forms), or 'reset' (resets form fields).
55
47
  */
56
48
  this.type = "button";
57
49
  }
@@ -186,7 +178,7 @@ export class SallaButton {
186
178
  "optional": false,
187
179
  "docs": {
188
180
  "tags": [],
189
- "text": "Button Type"
181
+ "text": "The shape/variant of the button. Can be 'link' (text-only style), 'icon' (circular icon button), or 'btn' (standard button). Default is 'btn'."
190
182
  },
191
183
  "getter": false,
192
184
  "setter": false,
@@ -206,7 +198,7 @@ export class SallaButton {
206
198
  "optional": false,
207
199
  "docs": {
208
200
  "tags": [],
209
- "text": "Button Color"
201
+ "text": "The color theme of the button. Available options: 'primary', 'success', 'warning', 'danger', 'light', 'gray', 'dark'. Default is 'primary'."
210
202
  },
211
203
  "getter": false,
212
204
  "setter": false,
@@ -226,7 +218,7 @@ export class SallaButton {
226
218
  "optional": false,
227
219
  "docs": {
228
220
  "tags": [],
229
- "text": "Button Fill"
221
+ "text": "The fill style of the button. 'solid' (filled background), 'outline' (bordered, transparent background), or 'none'. Default is 'solid'."
230
222
  },
231
223
  "getter": false,
232
224
  "setter": false,
@@ -246,7 +238,7 @@ export class SallaButton {
246
238
  "optional": false,
247
239
  "docs": {
248
240
  "tags": [],
249
- "text": "Button Size"
241
+ "text": "The size of the button. Can be 'small', 'medium', or 'large'. Default is 'medium'."
250
242
  },
251
243
  "getter": false,
252
244
  "setter": false,
@@ -266,7 +258,7 @@ export class SallaButton {
266
258
  "optional": false,
267
259
  "docs": {
268
260
  "tags": [],
269
- "text": "Button Width"
261
+ "text": "The width of the button. 'wide' makes the button full-width, 'normal' uses auto width. Default is 'normal'."
270
262
  },
271
263
  "getter": false,
272
264
  "setter": false,
@@ -286,7 +278,7 @@ export class SallaButton {
286
278
  "optional": false,
287
279
  "docs": {
288
280
  "tags": [],
289
- "text": "Is the button currently loading"
281
+ "text": "Shows a loading spinner on the button. Default is false."
290
282
  },
291
283
  "getter": false,
292
284
  "setter": false,
@@ -326,7 +318,7 @@ export class SallaButton {
326
318
  "optional": false,
327
319
  "docs": {
328
320
  "tags": [],
329
- "text": "Is the button currently disabled"
321
+ "text": "Disables the button, preventing user interaction. Default is false."
330
322
  },
331
323
  "getter": false,
332
324
  "setter": false,
@@ -346,7 +338,7 @@ export class SallaButton {
346
338
  "optional": false,
347
339
  "docs": {
348
340
  "tags": [],
349
- "text": "If there is need to change loader position, pass the position"
341
+ "text": "Position of the loading spinner. Can be 'start', 'end', 'center', or 'after' (after the button text). Default is 'after'."
350
342
  },
351
343
  "getter": false,
352
344
  "setter": false,
@@ -366,7 +358,7 @@ export class SallaButton {
366
358
  "optional": false,
367
359
  "docs": {
368
360
  "tags": [],
369
- "text": "Button with href as normal link"
361
+ "text": "When provided, renders the button as an anchor (`<a>`) element with this URL."
370
362
  },
371
363
  "getter": false,
372
364
  "setter": false,
@@ -385,7 +377,7 @@ export class SallaButton {
385
377
  "optional": false,
386
378
  "docs": {
387
379
  "tags": [],
388
- "text": "Determines the type of the rendered button.\nBy default, the type is set to \"button,\" making it a general-purpose button.\nSetting `type` to \"submit\" makes the button behave as a submit button within a form, triggering form submission.\nPossible values for `type` include \"button,\" \"submit,\" \"reset,\" and \"menu.\".\n\nPossible values and their usage are as follows:\n\"button\" (default, used for general button functionality), \n\"reset\" (resets form fields to their default values), and \n\"menu\" (represents a button that, when activated, displays a context menu)."
380
+ "text": "The HTML type attribute for the button. 'button' (default, general-purpose), 'submit' (submits forms), or 'reset' (resets form fields)."
389
381
  },
390
382
  "getter": false,
391
383
  "setter": false,
@@ -37,14 +37,21 @@ export class SallaCartItemOffers {
37
37
  this.showAll = !this.showAll;
38
38
  };
39
39
  }
40
- async componentWillLoad() {
41
- await Salla.onReady();
42
- await salla.lang.onLoaded(() => {
40
+ connectedCallback() {
41
+ this.langUnsubscribe = salla.lang.subscribe(() => {
43
42
  this.freeLabel = salla.lang.get('common.elements.freeExclam');
44
43
  this.receivedOffer = salla.lang.get('pages.cart.received_offer');
45
44
  this.discountAmountLabel = salla.lang.get('pages.cart.discount_amount');
46
45
  this.showMoreOffers = salla.lang.get('pages.cart.show_more_offers');
47
46
  });
47
+ }
48
+ disconnectedCallback() {
49
+ this.langUnsubscribe?.();
50
+ }
51
+ async componentWillLoad() {
52
+ await Salla.onReady();
53
+ // still hold the first render until translations are in; the labels come from the subscriber
54
+ await salla.lang.onLoaded();
48
55
  this.internalQuantity = this.quantity;
49
56
  this.internalOffers = this.parseOffers(this.offers);
50
57
  this.internalProductPrice = this.productPrice;
@@ -118,7 +118,7 @@ export class SallaCartSummary {
118
118
  return cartUrl;
119
119
  }
120
120
  render() {
121
- return (h(Host, { key: '80544f74203447490842d9ef9519ba3013fe0d02' }, h("a", { key: 'd769586f49b37a079653587d990871cb3ffe6542', class: "s-cart-summary-wrapper", href: this.getCartLink(), onClick: this.handleCheckoutClick }, h("div", { key: 'ad1833c7562138c211def82a365a89216157db20', id: "s-cart-icon" }, h("slot", { key: 'a5d60463eb9f023ffed29586a94d3b5feaf586c8', name: "icon" }, h("i", { key: '64a0c861706a05edc9057b1692d33945306958c0', class: "s-cart-summary-icon", innerHTML: CartIcon }))), h("span", { key: '6781086462fdb3e9910d9d32bd53014345c7148b', class: "s-cart-summary-count" }, salla.helpers.number(this.cartSummaryCount)), h("p", { key: '04dd5019a64ac99153b843ec2cff9103cf247c6a', class: "s-cart-summary-content" }, this.showCartLabel && h("span", { key: '2625556cc87729a72eb9ab455e3274a24c1738fa', class: "s-cart-summary-label" }, this.cartLabel), h("b", { key: '97a1a1911d6e18f9dde89437bd8749553ce8d35c', class: "s-cart-summary-total", innerHTML: salla.money(this.cartSummaryTotal) })))));
121
+ return (h(Host, { key: '4ed9d259a12ec48915a500bbeddb87c0078e8a3a' }, h("a", { key: '0d15f13e6e225dfe25e5b714f2bab5e6804fa387', class: "s-cart-summary-wrapper", href: this.getCartLink(), onClick: this.handleCheckoutClick }, h("div", { key: '9bbb00e5582afd7b79c65ae10d7dc1f28f67b943', id: "s-cart-icon" }, h("slot", { key: 'fa36457a1adf6587b787c1d2a4eeb50580593929', name: "icon" }, h("i", { key: 'fcdc45a58e4ab257af5965b8cb2d04c722ca7bea', class: "s-cart-summary-icon", innerHTML: CartIcon }))), h("span", { key: 'da492932c9cf9aec194a1f009960c132e5c79c5c', class: "s-cart-summary-count" }, salla.helpers.number(this.cartSummaryCount)), h("p", { key: 'a5465b7f3a2366136cb1a294f5b345807b93d4de', class: "s-cart-summary-content" }, this.showCartLabel && h("span", { key: '17497746811a5d6c33ca2ebcb5ba2a17e1fc86c3', class: "s-cart-summary-label" }, this.cartLabel), h("b", { key: '828ab6dee93cd7dee0e8964b8503831ebefc08da', class: "s-cart-summary-total", innerHTML: salla.money(this.cartSummaryTotal) })))));
122
122
  }
123
123
  static get is() { return "salla-cart-summary"; }
124
124
  static get originalStyleUrls() {
@@ -146,7 +146,7 @@ export class SallaCartSummary {
146
146
  "optional": false,
147
147
  "docs": {
148
148
  "tags": [],
149
- "text": "Show cart label"
149
+ "text": "Whether to show the cart label text alongside the cart icon. Default is false (icon only)."
150
150
  },
151
151
  "getter": false,
152
152
  "setter": false,
@@ -6,16 +6,21 @@ export class SallaCommentForm {
6
6
  constructor() {
7
7
  this.placeholder = salla.lang.get('blocks.comments.placeholder');
8
8
  this.submitText = salla.lang.get('blocks.comments.submit');
9
- salla.lang.onLoaded(() => {
10
- this.placeholder = salla.lang.get('blocks.comments.placeholder');
11
- this.submitText = salla.lang.get('blocks.comments.submit');
12
- });
13
9
  salla.onReady(() => {
14
10
  this.canComment = salla.config.get('user.can_comment');
15
11
  this.itemId = salla.config.get('page.id');
16
12
  this.type = salla.url.is_page('page-single') ? 'page' : salla.url.is_page('blog.single') ? 'blog' : 'product';
17
13
  });
18
14
  }
15
+ connectedCallback() {
16
+ this.langUnsubscribe = salla.lang.subscribe(() => {
17
+ this.placeholder = salla.lang.get('blocks.comments.placeholder');
18
+ this.submitText = salla.lang.get('blocks.comments.submit');
19
+ });
20
+ }
21
+ disconnectedCallback() {
22
+ this.langUnsubscribe?.();
23
+ }
19
24
  submit() {
20
25
  if (!this.commentForm.reportValidity()) {
21
26
  salla.log('CommentForm:: validation error!');
@@ -38,7 +43,7 @@ export class SallaCommentForm {
38
43
  .finally(() => this.submitBtn.stop());
39
44
  }
40
45
  render() {
41
- return (h(Host, { key: '16f5113a8345c31dce2f8302bcb5a5fba62e91c3' }, !!this.canComment ? h("form", { ref: frm => this.commentForm = frm }, h("div", { class: "s-comment-form-wrapper" }, this.showAvatar ?
46
+ return (h(Host, { key: '12db8a037d96013df1c9f3e4547d3383b6332fcc' }, !!this.canComment ? h("form", { ref: frm => this.commentForm = frm }, h("div", { class: "s-comment-form-wrapper" }, this.showAvatar ?
42
47
  h("img", { class: "s-comment-form-avatar", src: salla.config.get('user.avatar'), alt: "user avatar" }) : '', h("div", { class: "s-comment-form-content" }, h("textarea", { cols: 30, rows: 5, minlength: "4", maxlength: "500", ref: field => this.commentField = field, placeholder: this.placeholder, class: "s-comment-form-input", required: true }), h("br", null), h("div", { class: "s-comment-form-action" }, h("salla-button", { ref: btn => this.submitBtn = btn, "loader-position": 'center', onClick: () => this.submit() }, this.submitText))))) : ''));
43
48
  }
44
49
  static get is() { return "salla-comment-form"; }
@@ -5,6 +5,7 @@ import { Host, h } from "@stencil/core";
5
5
  import CheckIcon from "../../assets/svg/check.svg";
6
6
  import Reply from "../../assets/svg/reply.svg";
7
7
  import ThumbsUp from "../../assets/svg/thumbs-up.svg";
8
+ import { setTranslationDefault } from "../../Helpers/translate";
8
9
  export class SallaCommentItem {
9
10
  constructor() {
10
11
  // Translations
@@ -21,10 +22,12 @@ export class SallaCommentItem {
21
22
  this.likesCount = 0;
22
23
  this.likedComments = [];
23
24
  this.showReviewFactors = false;
24
- salla.lang.onLoaded(() => {
25
+ }
26
+ connectedCallback() {
27
+ this.langUnsubscribe = salla.lang.subscribe(() => {
25
28
  const setNestedAsync = (lang, key, value) => {
26
29
  return new Promise((resolve) => {
27
- salla.helpers.setNested(salla.lang.messages[lang], key, value);
30
+ setTranslationDefault(lang, key, value);
28
31
  resolve(true);
29
32
  });
30
33
  };
@@ -47,6 +50,9 @@ export class SallaCommentItem {
47
50
  setTranslations();
48
51
  });
49
52
  }
53
+ disconnectedCallback() {
54
+ this.langUnsubscribe?.();
55
+ }
50
56
  componentDidLoad() {
51
57
  if (!this.comment)
52
58
  return;
@@ -61,6 +67,8 @@ export class SallaCommentItem {
61
67
  catch {
62
68
  salla.log('Bad json for liked_comments');
63
69
  }
70
+ // back from an SSO login redirect: finish the like the guest asked for
71
+ salla.auth?.api?.takeResume?.('comment.like', this.comment.id) && this.toggleLike();
64
72
  }
65
73
  getReplies() {
66
74
  return Array.isArray(this.comment.replies) ? this.comment.replies : [this.comment.replies];
@@ -85,7 +93,7 @@ export class SallaCommentItem {
85
93
  }
86
94
  async toggleLike() {
87
95
  if (salla.config.isGuest()) {
88
- return salla.notify.error(salla.lang.get('common.messages.must_login'));
96
+ return salla.api.auth.requireLoginThen(`comment::like.after-login.${this.comment.id}`, () => this.toggleLike(), { action: 'comment.like', payload: this.comment.id });
89
97
  }
90
98
  this.likedComments = JSON.parse(localStorage.getItem('liked_comments') || '[]');
91
99
  const isLiked = this.likedComments.includes(this.comment.id);