@salla.sa/twilight-components 2.12.54 → 2.12.56

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 (36) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/salla-add-product-button_41.cjs.entry.js +17 -7
  3. package/dist/cjs/salla-add-product-button_41.cjs.entry.js.map +1 -1
  4. package/dist/cjs/twilight.cjs.js +1 -1
  5. package/dist/collection/components/salla-product-card/salla-product-card.js +6 -6
  6. package/dist/collection/components/salla-product-card/salla-product-card.js.map +1 -1
  7. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +31 -1
  8. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js.map +1 -1
  9. package/dist/components/salla-product-card2.js +6 -6
  10. package/dist/components/salla-product-card2.js.map +1 -1
  11. package/dist/components/salla-quick-buy2.js +12 -1
  12. package/dist/components/salla-quick-buy2.js.map +1 -1
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/esm/salla-add-product-button_41.entry.js +17 -7
  15. package/dist/esm/salla-add-product-button_41.entry.js.map +1 -1
  16. package/dist/esm/twilight.js +1 -1
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/esm-es5/loader.js.map +1 -1
  19. package/dist/esm-es5/salla-add-product-button_41.entry.js +2 -2
  20. package/dist/esm-es5/salla-add-product-button_41.entry.js.map +1 -1
  21. package/dist/esm-es5/twilight.js +1 -1
  22. package/dist/esm-es5/twilight.js.map +1 -1
  23. package/dist/twilight/{p-79705026.entry.js → p-9a9fe6f6.entry.js} +8 -8
  24. package/dist/twilight/p-9a9fe6f6.entry.js.map +1 -0
  25. package/dist/twilight/p-9f2e0944.system.js +1 -1
  26. package/dist/twilight/p-9f2e0944.system.js.map +1 -1
  27. package/dist/twilight/{p-e90369c0.system.entry.js → p-d6f3ac98.system.entry.js} +2 -2
  28. package/dist/twilight/p-d6f3ac98.system.entry.js.map +1 -0
  29. package/dist/twilight/twilight.esm.js +1 -1
  30. package/dist/twilight/twilight.esm.js.map +1 -1
  31. package/dist/types/components/salla-quick-buy/salla-quick-buy.d.ts +6 -0
  32. package/dist/types/components.d.ts +10 -0
  33. package/package.json +2 -2
  34. package/dist/twilight/p-79705026.entry.js.map +0 -1
  35. package/dist/twilight/p-e90369c0.system.entry.js.map +0 -1
  36. package/dist/types/global.d.ts +0 -17
@@ -2413,6 +2413,7 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
2413
2413
  this.__registerHost();
2414
2414
  this.type = 'buy';
2415
2415
  this.productId = undefined;
2416
+ this.cartId = undefined;
2416
2417
  this.amount = undefined;
2417
2418
  this.currency = undefined;
2418
2419
  this.options = {};
@@ -2470,6 +2471,15 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
2470
2471
  validateMerchant: {
2471
2472
  url: salla.url.get('checkout/applepay/validate'),
2472
2473
  onSuccess: () => {
2474
+ if (this.applePayOnly && !this.productId) { // the cart is not passes
2475
+ if (!this.cartId) {
2476
+ salla.logger.warn('🍏 Pay: trying to create applePay transaction without cartId/ProductId !');
2477
+ return;
2478
+ }
2479
+ window.SallaApplePay.id = this.cartId;
2480
+ salla.log('🍏 Pay: create checkout success: with id #' + this.cartId);
2481
+ return;
2482
+ }
2473
2483
  return salla.api.request('checkout/quick-purchase/' + this.productId, typeof data == 'object' ? data : undefined, 'post', {}).then(response => {
2474
2484
  var _a, _b;
2475
2485
  // if is redirect url returned for any reason, lets redirect the user to check out
@@ -2483,7 +2493,7 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
2483
2493
  salla.logger.warn('🍏 Pay: create checkout success: No id, or redirect');
2484
2494
  return response;
2485
2495
  }
2486
- window.SallaApplePay.id = response.data.id || response.data.data.id;
2496
+ window.SallaApplePay.id = response.data.id;
2487
2497
  salla.log('🍏 Pay: create checkout success: with id #' + window.SallaApplePay.id);
2488
2498
  });
2489
2499
  }
@@ -2600,6 +2610,7 @@ const SallaQuickBuy = /*@__PURE__*/ proxyCustomElement(class SallaQuickBuy exten
2600
2610
  }, [0, "salla-quick-buy", {
2601
2611
  "type": [1025],
2602
2612
  "productId": [1025, "product-id"],
2613
+ "cartId": [1025, "cart-id"],
2603
2614
  "amount": [1538],
2604
2615
  "currency": [1025],
2605
2616
  "options": [16],