@ikas/storefront 6.1.0-beta.4 → 6.1.0-beta.5

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.
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import{ErrorType as a}from"../../model.js";import{PayPalScriptProvider as o,usePayPalScriptReducer as l,PayPalButtons as i}from"@paypal/react-paypal-js";import c from"../../../../store/checkout/index.js";import s from"./style.module.scss.js";var d=n((function(n){var d=n.vm;if(!d.payPalClientIdResponse)return null;var p={"client-id":d.payPalClientIdResponse.clientId,currency:d.checkout.currencyCode,"merchant-id":d.payPalClientIdResponse.merchantId};return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(o,{options:p},r.createElement((function(){return l()[0].isPending?r.createElement("div",{className:s.Main},r.createElement("div",{className:s.loader})):r.createElement(i,{style:{layout:"horizontal"},onClick:function(e,t){return d.checkPaypalButtonAvailable()?t.resolve():t.reject()},onCancel:function(e,t){d.paypalOrderResponse&&(window.location.href="".concat(d.paypalOrderResponse.failUrl)),d.isStepLoading=!1},createOrder:function(r,n){return e(void 0,void 0,void 0,(function(){var e,r,n;return t(this,(function(t){switch(t.label){case 0:return d.isDigitalOnly?[4,d.onCompleteDigitalOnlyPaymentClick()]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,d.onCompletePaymentClick()];case 3:t.sent(),t.label=4;case 4:return[4,c.createPayPalOrder({input:{cartId:d.checkout.id,paymentGatewayId:(null===(r=d.checkout.selectedPaymentGateway)||void 0===r?void 0:r.id)||""}})];case 5:return!(e=t.sent()).isSuccess&&e.errors.length&&(d.error={type:a.PAYMENT_ERROR,data:e.errors[0]}),e.data&&(d.paypalOrderResponse=e.data),[2,e&&(null===(n=e.data)||void 0===n?void 0:n.sessionToken)||""]}}))}))},onApprove:function(r,n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return d.paypalOrderResponse&&(window.location.href="".concat(d.paypalOrderResponse.returnUrl)),[2]}))}))}})}),null))))}));export{d as PayPal};
1
+ import{__assign as e,__awaiter as t,__generator as n}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as a}from"mobx-react-lite";import{ErrorType as o}from"../../model.js";import{PayPalScriptProvider as l,usePayPalScriptReducer as i,PayPalButtons as c}from"@paypal/react-paypal-js";import s from"../../../../store/checkout/index.js";import d from"./style.module.scss.js";var u=a((function(a){var u=a.vm;if(!u.payPalClientIdResponse)return null;var p={"client-id":u.payPalClientIdResponse.clientId,currency:u.checkout.currencyCode,"merchant-id":u.payPalClientIdResponse.merchantId};return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(l,{options:p},r.createElement((function(){var a,l,p,m,v=function(e){var t,n=null===(t=u.checkout.selectedPaymentGateway)||void 0===t?void 0:t.settings;if(n)return n.find((function(t){return t.label===e}))};return i()[0].isPending?r.createElement("div",{className:d.Main},r.createElement("div",{className:d.loader})):r.createElement(c,{style:e(e(e(e({layout:"horizontal"},v("color")?{color:null===(a=v("color"))||void 0===a?void 0:a.value}:{}),v("shape")?{shape:null===(l=v("shape"))||void 0===l?void 0:l.value}:{}),v("label")?{label:null===(p=v("label"))||void 0===p?void 0:p.value}:{}),v("tagline")?{tagline:"true"===(null===(m=v("tagline"))||void 0===m?void 0:m.value)}:{}),onClick:function(e,t){return u.checkPaypalButtonAvailable()?t.resolve():t.reject()},onCancel:function(e,t){u.paypalOrderResponse&&(window.location.href="".concat(u.paypalOrderResponse.failUrl)),u.isStepLoading=!1},createOrder:function(e,r){return t(void 0,void 0,void 0,(function(){var e,t,r;return n(this,(function(n){switch(n.label){case 0:return u.isDigitalOnly?[4,u.onCompleteDigitalOnlyPaymentClick()]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,u.onCompletePaymentClick()];case 3:n.sent(),n.label=4;case 4:return[4,s.createPayPalOrder({input:{cartId:u.checkout.id,paymentGatewayId:(null===(t=u.checkout.selectedPaymentGateway)||void 0===t?void 0:t.id)||""}})];case 5:return!(e=n.sent()).isSuccess&&e.errors.length&&(u.error={type:o.PAYMENT_ERROR,data:e.errors[0]}),e.data&&(u.paypalOrderResponse=e.data),[2,e&&(null===(r=e.data)||void 0===r?void 0:r.sessionToken)||""]}}))}))},onApprove:function(e,r){return t(void 0,void 0,void 0,(function(){return n(this,(function(e){return u.paypalOrderResponse&&(window.location.href="".concat(u.paypalOrderResponse.returnUrl)),[2]}))}))}})}),null))))}));export{u as PayPal};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.4",
3
+ "version": "6.1.0-beta.5",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -21,11 +21,11 @@
21
21
  "swiper": "11.0.6"
22
22
  },
23
23
  "devDependencies": {
24
- "@ikas/storefront-api": "^6.1.0-beta.4",
25
- "@ikas/storefront-config": "^6.1.0-beta.4",
26
- "@ikas/storefront-model-functions": "^6.1.0-beta.4",
27
- "@ikas/storefront-models": "^6.1.0-beta.4",
28
- "@ikas/storefront-providers": "^6.1.0-beta.4",
24
+ "@ikas/storefront-api": "^6.1.0-beta.5",
25
+ "@ikas/storefront-config": "^6.1.0-beta.5",
26
+ "@ikas/storefront-model-functions": "^6.1.0-beta.5",
27
+ "@ikas/storefront-models": "^6.1.0-beta.5",
28
+ "@ikas/storefront-providers": "^6.1.0-beta.5",
29
29
  "@ikas/localized-address": "1.0.0-beta.6",
30
30
  "@adyen/adyen-web": "^5.57.0",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -60,11 +60,11 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@ikas/localized-address": "1.0.0-beta.6",
63
- "@ikas/storefront-api": "^6.1.0-beta.4",
64
- "@ikas/storefront-config": "^6.1.0-beta.4",
65
- "@ikas/storefront-model-functions": "^6.1.0-beta.4",
66
- "@ikas/storefront-models": "^6.1.0-beta.4",
67
- "@ikas/storefront-providers": "^6.1.0-beta.4",
63
+ "@ikas/storefront-api": "^6.1.0-beta.5",
64
+ "@ikas/storefront-config": "^6.1.0-beta.5",
65
+ "@ikas/storefront-model-functions": "^6.1.0-beta.5",
66
+ "@ikas/storefront-models": "^6.1.0-beta.5",
67
+ "@ikas/storefront-providers": "^6.1.0-beta.5",
68
68
  "mobx": "^6.1.3",
69
69
  "mobx-react-lite": "^3.1.5",
70
70
  "next": "12.2.0",