@salla.sa/twilight-components 2.14.267 → 2.14.268

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 (140) hide show
  1. package/dist/cjs/{app-globals-CHVPOl9V.js → app-globals-DCdSMY4P.js} +1 -1
  2. package/dist/cjs/{filepond-DRd4_s2v.js → filepond-DSrOeCIF.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-DgrI1jkW.js → filepond-plugin-file-poster-kTPFjj4a.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-DDaoAhJ6.js → filepond-plugin-file-validate-size-CWcxao8l.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-DEDV1a3V.js → filepond-plugin-file-validate-type-CP295r_S.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-CPDGO4As.js → filepond-plugin-image-edit-B8p_l6WM.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-BRgevbMC.js → filepond-plugin-image-exif-orientation-BH0nNaQs.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-DYGUzAm7.js → filepond-plugin-image-preview-A5H8-Nsz.js} +1 -1
  9. package/dist/cjs/{index-C7arMWIB.js → index-BjUgPABq.js} +2 -2
  10. package/dist/cjs/{index-DXIo87Tk.js → index-Dwv0QRlo.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion_4.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_51.cjs.entry.js +20 -14
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  45. package/dist/cjs/twilight.cjs.js +2 -2
  46. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +11 -5
  47. package/dist/components/index.js +2 -2
  48. package/dist/components/salla-add-product-button2.js +11 -5
  49. package/dist/esm/{app-globals-mR93fe4w.js → app-globals-DKMXkUnR.js} +1 -1
  50. package/dist/esm/{filepond-DjrTyRS6.js → filepond-PEXRwe-a.js} +1 -1
  51. package/dist/esm/{filepond-plugin-file-poster-PEdA9y9p.js → filepond-plugin-file-poster-kyH2loNg.js} +1 -1
  52. package/dist/esm/{filepond-plugin-file-validate-size-BRP8EqLj.js → filepond-plugin-file-validate-size-erHt3cr_.js} +1 -1
  53. package/dist/esm/{filepond-plugin-file-validate-type-oap4DCYj.js → filepond-plugin-file-validate-type-gyWa6zhf.js} +1 -1
  54. package/dist/esm/{filepond-plugin-image-edit-Bvj24IHY.js → filepond-plugin-image-edit-ChS32vNL.js} +1 -1
  55. package/dist/esm/{filepond-plugin-image-exif-orientation-CGcS6jKF.js → filepond-plugin-image-exif-orientation-qhVLNALS.js} +1 -1
  56. package/dist/esm/{filepond-plugin-image-preview-Bd3LP9bc.js → filepond-plugin-image-preview-BwgD68LJ.js} +1 -1
  57. package/dist/esm/{index-BKlB0LJo.js → index-Bc4ObK1O.js} +1 -1
  58. package/dist/esm/{index-BSp_SAn6.js → index-Dkrl7rvC.js} +2 -2
  59. package/dist/esm/loader.js +3 -3
  60. package/dist/esm/salla-accordion_4.entry.js +1 -1
  61. package/dist/esm/salla-add-product-button_51.entry.js +20 -14
  62. package/dist/esm/salla-advertisement.entry.js +1 -1
  63. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  64. package/dist/esm/salla-apps-icons.entry.js +1 -1
  65. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  66. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  67. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  68. package/dist/esm/salla-contacts.entry.js +1 -1
  69. package/dist/esm/salla-filters-widget.entry.js +1 -1
  70. package/dist/esm/salla-filters.entry.js +1 -1
  71. package/dist/esm/salla-installment.entry.js +1 -1
  72. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  73. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  74. package/dist/esm/salla-metadata.entry.js +1 -1
  75. package/dist/esm/salla-notification-item.entry.js +1 -1
  76. package/dist/esm/salla-notifications.entry.js +1 -1
  77. package/dist/esm/salla-offer.entry.js +1 -1
  78. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  79. package/dist/esm/salla-order-details.entry.js +1 -1
  80. package/dist/esm/salla-order-summary.entry.js +1 -1
  81. package/dist/esm/salla-orders.entry.js +1 -1
  82. package/dist/esm/salla-payments.entry.js +1 -1
  83. package/dist/esm/salla-price-range.entry.js +1 -1
  84. package/dist/esm/salla-product-options.entry.js +1 -1
  85. package/dist/esm/salla-review-card.entry.js +1 -1
  86. package/dist/esm/salla-reviews-page.entry.js +1 -1
  87. package/dist/esm/salla-reviews.entry.js +1 -1
  88. package/dist/esm/salla-social.entry.js +1 -1
  89. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  90. package/dist/esm/salla-tooltip.entry.js +1 -1
  91. package/dist/esm/salla-verify.entry.js +1 -1
  92. package/dist/esm/salla-wallet.entry.js +1 -1
  93. package/dist/esm/twilight.js +3 -3
  94. package/dist/twilight/{p-8c6f935e.entry.js → p-02c9b8cd.entry.js} +1 -1
  95. package/dist/twilight/{p-618cdb9c.entry.js → p-0f7c48c5.entry.js} +1 -1
  96. package/dist/twilight/{p-C9AUQgJM.js → p-0wo7xVMQ.js} +1 -1
  97. package/dist/twilight/{p-6ae72cb1.entry.js → p-100dc2af.entry.js} +1 -1
  98. package/dist/twilight/{p-0f8564ba.entry.js → p-231c080a.entry.js} +1 -1
  99. package/dist/twilight/{p-5e6df0f2.entry.js → p-2aa837e5.entry.js} +1 -1
  100. package/dist/twilight/{p-8a783da7.entry.js → p-3096365c.entry.js} +1 -1
  101. package/dist/twilight/{p-1d103017.entry.js → p-3fca5120.entry.js} +1 -1
  102. package/dist/twilight/{p-e5539fc7.entry.js → p-43eeca9d.entry.js} +1 -1
  103. package/dist/twilight/{p-a97b26d4.entry.js → p-4cf87671.entry.js} +1 -1
  104. package/dist/twilight/{p-95994e91.entry.js → p-5b7c9c27.entry.js} +1 -1
  105. package/dist/twilight/{p-2c96cfdf.entry.js → p-61386416.entry.js} +1 -1
  106. package/dist/twilight/{p-8cf1162f.entry.js → p-63ea69b0.entry.js} +1 -1
  107. package/dist/twilight/{p-c40ec87b.entry.js → p-6b5e5a40.entry.js} +1 -1
  108. package/dist/twilight/{p-a695e3b6.entry.js → p-765187bb.entry.js} +1 -1
  109. package/dist/twilight/{p-431a4cd8.entry.js → p-76faa3dc.entry.js} +1 -1
  110. package/dist/twilight/{p-d267dd67.entry.js → p-77558f05.entry.js} +1 -1
  111. package/dist/twilight/{p-89659f7a.entry.js → p-8a388d90.entry.js} +1 -1
  112. package/dist/twilight/{p-f92480a2.entry.js → p-8f1c1e48.entry.js} +1 -1
  113. package/dist/twilight/{p-0b2a463a.entry.js → p-94d5abb2.entry.js} +1 -1
  114. package/dist/twilight/{p-CsGVv0Wz.js → p-BOZpx8y8.js} +1 -1
  115. package/dist/twilight/{p-Ba1RIuVG.js → p-BdZFi-dF.js} +2 -2
  116. package/dist/twilight/{p--M0fKW6W.js → p-Bfh2Ewd2.js} +1 -1
  117. package/dist/twilight/{p-CfFJPXVG.js → p-C6w77Z-I.js} +1 -1
  118. package/dist/twilight/{p-DOUOHu42.js → p-CMGWNTqw.js} +1 -1
  119. package/dist/twilight/{p-c4_T7k1X.js → p-CMIEpBEo.js} +1 -1
  120. package/dist/twilight/{p-BSp_SAn6.js → p-Dkrl7rvC.js} +2 -2
  121. package/dist/twilight/p-DqXHRruO.js +9 -0
  122. package/dist/twilight/{p-DvCwaAfs.js → p-Drf1TOhi.js} +1 -1
  123. package/dist/twilight/{p-753c0985.entry.js → p-a57e243b.entry.js} +2 -2
  124. package/dist/twilight/{p-71fad6c0.entry.js → p-b2667b1a.entry.js} +1 -1
  125. package/dist/twilight/{p-ba2bad24.entry.js → p-c146c961.entry.js} +1 -1
  126. package/dist/twilight/{p-275e7747.entry.js → p-c89dfa69.entry.js} +1 -1
  127. package/dist/twilight/{p-38b110ac.entry.js → p-c94c1971.entry.js} +1 -1
  128. package/dist/twilight/{p-ad7f62eb.entry.js → p-d2e43463.entry.js} +1 -1
  129. package/dist/twilight/{p-769a4f2c.entry.js → p-d614ac6e.entry.js} +1 -1
  130. package/dist/twilight/{p-60a093f1.entry.js → p-e0541abb.entry.js} +1 -1
  131. package/dist/twilight/{p-ecb77312.entry.js → p-e44dfa5a.entry.js} +1 -1
  132. package/dist/twilight/{p-8d71342f.entry.js → p-edac5aa4.entry.js} +1 -1
  133. package/dist/twilight/{p-7b764c4d.entry.js → p-ee72cd10.entry.js} +1 -1
  134. package/dist/twilight/{p-33ed545b.entry.js → p-f4054651.entry.js} +1 -1
  135. package/dist/twilight/{p-072c6b64.entry.js → p-f6262928.entry.js} +1 -1
  136. package/dist/twilight/{p-43e92061.entry.js → p-ff2c2e92.entry.js} +1 -1
  137. package/dist/twilight/twilight.esm.js +1 -1
  138. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +1 -1
  139. package/package.json +5 -5
  140. package/dist/twilight/p-CToUtIYp.js +0 -9
@@ -78,8 +78,11 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
78
78
  const optionsEl = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
79
79
  if (optionsEl && typeof optionsEl.validateAndScroll === 'function') {
80
80
  return optionsEl.validateAndScroll()
81
- .then((isValid) => {
82
- if (!isValid) {
81
+ .then(async (isValid) => {
82
+ // Call validate hook
83
+ const ctx = { isValid, component: this };
84
+ await salla.hooks.call('salla-add-product-button', 'validate', ctx);
85
+ if (!ctx.isValid) {
83
86
  this.btn?.enable();
84
87
  return;
85
88
  }
@@ -92,7 +95,7 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
92
95
  // Fallback if options component not found
93
96
  return this._proceedAddToCart();
94
97
  }
95
- _proceedAddToCart() {
98
+ async _proceedAddToCart() {
96
99
  /**
97
100
  * by default the quick add is just an alias for add item function
98
101
  * but its work only when the id is the only value is passed via the object
@@ -104,8 +107,9 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
104
107
  quantity: this.quantity,
105
108
  endpoint: 'quickAdd'
106
109
  }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
110
+ // Use the potentially modified data
107
111
  return salla.cart.addItem(data)
108
- .then(response => {
112
+ .then(async (response) => {
109
113
  this.selectedOptions = [];
110
114
  this.btn?.enable();
111
115
  this.success.emit(response);
@@ -185,7 +189,9 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
185
189
  'w-full': !document.getElementById('fast-checkout-js') || ['financial_support', 'donating'].includes(this.productType) // This is a temporary fix until all themes fully support the fast checkout -- To be removed later
186
190
  } }, h("salla-button", { color: this.productStatus === 'sale' ? 'primary' : 'light', type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale', ...this.getBtnAttributes(), "loader-position": "center" }, h("slot", null)), this.showQuickBuy && !!document.getElementById('fast-checkout-js') && !['financial_support', 'donating'].includes(this.productType) ? this.miniCheckoutWidget() : ''), this.showQuickBuy && this.isApplePayActive ? h("salla-quick-buy", { ...this.getQuickBuyBtnAttributes() }) : '');
187
191
  }
188
- componentDidLoad() {
192
+ async componentDidLoad() {
193
+ // Register this component for hooks system, already on it logic to run componentDidLoad trigger
194
+ await Salla.hooks.registerComponent('salla-add-product-button', this);
189
195
  if (!this.notifyOptionsAvailability) {
190
196
  return;
191
197
  }
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { L as LazyLoad } from './index-BSp_SAn6.js';
4
+ import { L as LazyLoad } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function appGlobalScript () {
7
7
  // Only initialize it one time for the entire application
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { a as getDefaultExportFromCjs } from './index-BSp_SAn6.js';
4
+ import { a as getDefaultExportFromCjs } from './index-Dkrl7rvC.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {