@goodhood/chargebee
Advanced tools
Comparing version 1.5.0 to 1.5.1
import { useEffect, useRef, useState } from 'react'; | ||
import 'prop-types'; | ||
import Script from 'react-load-script'; | ||
@@ -14,3 +13,2 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime'; | ||
} | ||
if (typeof fn === 'function') return fn(...args); | ||
@@ -32,3 +30,2 @@ }; | ||
}); | ||
const handleLoad = () => { | ||
@@ -45,8 +42,5 @@ try { | ||
} | ||
setReady(true); | ||
}; | ||
let node; | ||
if (isReady) { | ||
@@ -57,8 +51,7 @@ const handleClick = event => { | ||
}; | ||
node = /*#__PURE__*/jsx("span", { ...rest, | ||
node = /*#__PURE__*/jsx("span", { | ||
...rest, | ||
onClick: handleClick | ||
}); | ||
} | ||
return /*#__PURE__*/jsxs(Fragment, { | ||
@@ -71,3 +64,2 @@ children: [/*#__PURE__*/jsx(Script, { | ||
}; | ||
Action.defaultProps = { | ||
@@ -92,6 +84,4 @@ disabled: false | ||
} = _ref; | ||
const handleOpenLink = (instance, Chargebee) => { | ||
let forwardOptions; | ||
if (section) { | ||
@@ -102,3 +92,2 @@ forwardOptions = { | ||
} | ||
instance.setPortalSession(() => onSessionGet()); | ||
@@ -110,8 +99,7 @@ const portal = instance.createChargebeePortal(); | ||
}; | ||
return /*#__PURE__*/jsx(Action$1, { ...rest, | ||
return /*#__PURE__*/jsx(Action$1, { | ||
...rest, | ||
onCall: handleOpenLink | ||
}); | ||
}; | ||
var PortalLink$1 = PortalLink; | ||
@@ -129,3 +117,2 @@ | ||
} = _ref; | ||
const handleCheckout = instance => { | ||
@@ -147,8 +134,7 @@ let isSuccess = false; | ||
}; | ||
return /*#__PURE__*/jsx(Action$1, { ...rest, | ||
return /*#__PURE__*/jsx(Action$1, { | ||
...rest, | ||
onCall: handleCheckout | ||
}); | ||
}; | ||
var Checkout$1 = Checkout; | ||
@@ -155,0 +141,0 @@ |
@@ -6,3 +6,2 @@ 'use strict'; | ||
var react = require('react'); | ||
require('prop-types'); | ||
var Script = require('react-load-script'); | ||
@@ -23,3 +22,2 @@ var jsxRuntime = require('react/jsx-runtime'); | ||
} | ||
if (typeof fn === 'function') return fn(...args); | ||
@@ -41,3 +39,2 @@ }; | ||
}); | ||
const handleLoad = () => { | ||
@@ -54,8 +51,5 @@ try { | ||
} | ||
setReady(true); | ||
}; | ||
let node; | ||
if (isReady) { | ||
@@ -66,8 +60,7 @@ const handleClick = event => { | ||
}; | ||
node = /*#__PURE__*/jsxRuntime.jsx("span", { ...rest, | ||
node = /*#__PURE__*/jsxRuntime.jsx("span", { | ||
...rest, | ||
onClick: handleClick | ||
}); | ||
} | ||
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, { | ||
@@ -80,3 +73,2 @@ children: [/*#__PURE__*/jsxRuntime.jsx(Script__default["default"], { | ||
}; | ||
Action.defaultProps = { | ||
@@ -101,6 +93,4 @@ disabled: false | ||
} = _ref; | ||
const handleOpenLink = (instance, Chargebee) => { | ||
let forwardOptions; | ||
if (section) { | ||
@@ -111,3 +101,2 @@ forwardOptions = { | ||
} | ||
instance.setPortalSession(() => onSessionGet()); | ||
@@ -119,8 +108,7 @@ const portal = instance.createChargebeePortal(); | ||
}; | ||
return /*#__PURE__*/jsxRuntime.jsx(Action$1, { ...rest, | ||
return /*#__PURE__*/jsxRuntime.jsx(Action$1, { | ||
...rest, | ||
onCall: handleOpenLink | ||
}); | ||
}; | ||
var PortalLink$1 = PortalLink; | ||
@@ -138,3 +126,2 @@ | ||
} = _ref; | ||
const handleCheckout = instance => { | ||
@@ -156,8 +143,7 @@ let isSuccess = false; | ||
}; | ||
return /*#__PURE__*/jsxRuntime.jsx(Action$1, { ...rest, | ||
return /*#__PURE__*/jsxRuntime.jsx(Action$1, { | ||
...rest, | ||
onCall: handleCheckout | ||
}); | ||
}; | ||
var Checkout$1 = Checkout; | ||
@@ -164,0 +150,0 @@ |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"module": "lib/index.esm.js", | ||
@@ -28,10 +28,11 @@ "main": "lib/index.js", | ||
"start": "../../scripts/start-preview", | ||
"test": "../../scripts/run-tests" | ||
"test": "../../scripts/run-tests", | ||
"lint:typescript": "../../scripts/check-typescript" | ||
}, | ||
"devDependencies": { | ||
"react-load-script": "0.0.6" | ||
"react-load-script": "0.0.6", | ||
"prop-types": "^15.7.2" | ||
}, | ||
"peerDependencies": { | ||
"@babel/runtime": "^7.12.5", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.14.0 || ^17.0.1", | ||
@@ -38,0 +39,0 @@ "react-load-script": "^0.0.6" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28019
3
263
2