@goodhood/chargebee
Advanced tools
Comparing version 1.7.0 to 1.7.1
import { useEffect, useRef, useState } from 'react'; | ||
import Script from 'react-load-script'; | ||
import { jsxs, Fragment, jsx } from 'react/jsx-runtime'; | ||
import { jsx, jsxs, Fragment } from 'react/jsx-runtime'; | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
} | ||
const useOnUnmount = callback => { | ||
@@ -36,10 +9,10 @@ useEffect(() => callback, []); | ||
const Action = _a => { | ||
var { | ||
disabled = false, | ||
onClick, | ||
onCall, | ||
site | ||
} = _a, | ||
rest = __rest(_a, ["disabled", "onClick", "onCall", "site"]); | ||
const Action = _ref => { | ||
let { | ||
disabled = false, | ||
onClick, | ||
onCall, | ||
site, | ||
...rest | ||
} = _ref; | ||
const instanceRef = useRef(); | ||
@@ -64,6 +37,5 @@ const [isReady, setReady] = useState(false); | ||
const handleClick = event => { | ||
var _a, _b; | ||
(_a = onClick === null || onClick === void 0 ? void 0 : onClick.call) === null || _a === void 0 ? void 0 : _a.call(onClick, undefined, event); | ||
onClick?.call?.(undefined, event); | ||
if (!disabled) { | ||
(_b = onCall === null || onCall === void 0 ? void 0 : onCall.call) === null || _b === void 0 ? void 0 : _b.call(onCall, undefined, instanceRef.current, global.Chargebee); | ||
onCall?.call?.(undefined, instanceRef.current, global.Chargebee); | ||
} | ||
@@ -92,9 +64,9 @@ }; | ||
const PortalLink = _a => { | ||
var { | ||
section, | ||
onSessionGet, | ||
onClose | ||
} = _a, | ||
rest = __rest(_a, ["section", "onSessionGet", "onClose"]); | ||
const PortalLink = _ref => { | ||
let { | ||
section, | ||
onSessionGet, | ||
onClose, | ||
...rest | ||
} = _ref; | ||
const handleOpenLink = (instance, Chargebee) => { | ||
@@ -104,3 +76,3 @@ let forwardOptions; | ||
forwardOptions = { | ||
sectionType: Chargebee === null || Chargebee === void 0 ? void 0 : Chargebee.getPortalSections()[section] | ||
sectionType: Chargebee?.getPortalSections()[section] | ||
}; | ||
@@ -120,12 +92,12 @@ } | ||
const Checkout = _a => { | ||
var { | ||
onHostedPageGet, | ||
onSuccess, | ||
onLoaded, | ||
onClose, | ||
onError, | ||
onStep | ||
} = _a, | ||
rest = __rest(_a, ["onHostedPageGet", "onSuccess", "onLoaded", "onClose", "onError", "onStep"]); | ||
const Checkout = _ref => { | ||
let { | ||
onHostedPageGet, | ||
onSuccess, | ||
onLoaded, | ||
onClose, | ||
onError, | ||
onStep, | ||
...rest | ||
} = _ref; | ||
const handleCheckout = instance => { | ||
@@ -142,5 +114,4 @@ let isSuccess = false; | ||
close: () => { | ||
var _a, _b; | ||
(_a = onClose === null || onClose === void 0 ? void 0 : onClose.call) === null || _a === void 0 ? void 0 : _a.call(onClose, undefined); | ||
if (isSuccess) (_b = onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.call) === null || _b === void 0 ? void 0 : _b.call(onSuccess, undefined); | ||
onClose?.call?.(undefined); | ||
if (isSuccess) onSuccess?.call?.(undefined); | ||
} | ||
@@ -147,0 +118,0 @@ }); |
@@ -13,29 +13,2 @@ 'use strict'; | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
} | ||
const useOnUnmount = callback => { | ||
@@ -45,10 +18,10 @@ react.useEffect(() => callback, []); | ||
const Action = _a => { | ||
var { | ||
disabled = false, | ||
onClick, | ||
onCall, | ||
site | ||
} = _a, | ||
rest = __rest(_a, ["disabled", "onClick", "onCall", "site"]); | ||
const Action = _ref => { | ||
let { | ||
disabled = false, | ||
onClick, | ||
onCall, | ||
site, | ||
...rest | ||
} = _ref; | ||
const instanceRef = react.useRef(); | ||
@@ -73,6 +46,5 @@ const [isReady, setReady] = react.useState(false); | ||
const handleClick = event => { | ||
var _a, _b; | ||
(_a = onClick === null || onClick === void 0 ? void 0 : onClick.call) === null || _a === void 0 ? void 0 : _a.call(onClick, undefined, event); | ||
onClick?.call?.(undefined, event); | ||
if (!disabled) { | ||
(_b = onCall === null || onCall === void 0 ? void 0 : onCall.call) === null || _b === void 0 ? void 0 : _b.call(onCall, undefined, instanceRef.current, global.Chargebee); | ||
onCall?.call?.(undefined, instanceRef.current, global.Chargebee); | ||
} | ||
@@ -101,9 +73,9 @@ }; | ||
const PortalLink = _a => { | ||
var { | ||
section, | ||
onSessionGet, | ||
onClose | ||
} = _a, | ||
rest = __rest(_a, ["section", "onSessionGet", "onClose"]); | ||
const PortalLink = _ref => { | ||
let { | ||
section, | ||
onSessionGet, | ||
onClose, | ||
...rest | ||
} = _ref; | ||
const handleOpenLink = (instance, Chargebee) => { | ||
@@ -113,3 +85,3 @@ let forwardOptions; | ||
forwardOptions = { | ||
sectionType: Chargebee === null || Chargebee === void 0 ? void 0 : Chargebee.getPortalSections()[section] | ||
sectionType: Chargebee?.getPortalSections()[section] | ||
}; | ||
@@ -129,12 +101,12 @@ } | ||
const Checkout = _a => { | ||
var { | ||
onHostedPageGet, | ||
onSuccess, | ||
onLoaded, | ||
onClose, | ||
onError, | ||
onStep | ||
} = _a, | ||
rest = __rest(_a, ["onHostedPageGet", "onSuccess", "onLoaded", "onClose", "onError", "onStep"]); | ||
const Checkout = _ref => { | ||
let { | ||
onHostedPageGet, | ||
onSuccess, | ||
onLoaded, | ||
onClose, | ||
onError, | ||
onStep, | ||
...rest | ||
} = _ref; | ||
const handleCheckout = instance => { | ||
@@ -151,5 +123,4 @@ let isSuccess = false; | ||
close: () => { | ||
var _a, _b; | ||
(_a = onClose === null || onClose === void 0 ? void 0 : onClose.call) === null || _a === void 0 ? void 0 : _a.call(onClose, undefined); | ||
if (isSuccess) (_b = onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.call) === null || _b === void 0 ? void 0 : _b.call(onSuccess, undefined); | ||
onClose?.call?.(undefined); | ||
if (isSuccess) onSuccess?.call?.(undefined); | ||
} | ||
@@ -156,0 +127,0 @@ }); |
@@ -8,3 +8,3 @@ import React from 'react'; | ||
} & React.ComponentPropsWithoutRef<'span'>; | ||
declare const Action: ({ disabled, onClick, onCall, site, ...rest }: ActionProps) => JSX.Element; | ||
declare const Action: ({ disabled, onClick, onCall, site, ...rest }: ActionProps) => React.JSX.Element; | ||
export default Action; |
@@ -12,3 +12,3 @@ /// <reference types="react" /> | ||
}; | ||
declare const Checkout: ({ onHostedPageGet, onSuccess, onLoaded, onClose, onError, onStep, ...rest }: CheckoutProps) => JSX.Element; | ||
declare const Checkout: ({ onHostedPageGet, onSuccess, onLoaded, onClose, onError, onStep, ...rest }: CheckoutProps) => import("react").JSX.Element; | ||
export default Checkout; |
@@ -11,3 +11,3 @@ /// <reference types="react" /> | ||
declare const PortalLink: { | ||
({ section, onSessionGet, onClose, ...rest }: PortalLinkProps): JSX.Element; | ||
({ section, onSessionGet, onClose, ...rest }: PortalLinkProps): import("react").JSX.Element; | ||
propTypes: { | ||
@@ -14,0 +14,0 @@ section: PropTypes.Requireable<"BILLING_HISTORY" | "EDIT_BILLING_ADDRESS" | "ADD_PAYMENT_SOURCE" | "EDIT_PAYMENT_SOURCE" | "VIEW_PAYMENT_SOURCE">; |
{ | ||
"name": "@goodhood/chargebee", | ||
"description": "Chargebee components", | ||
"author": "goodhood.eu <max@nebenan.de>", | ||
"license": "SEE LICENSE IN LICENSE FILE", | ||
"homepage": "https://goodhood.eu/", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/goodhood-eu/goodhood.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/goodhood-eu/goodhood/issues" | ||
}, | ||
"version": "1.7.0", | ||
"author": "Good Hood GmbH <tech@nebenan.de>", | ||
"license": "MIT", | ||
"homepage": "https://github.com/goodhood-eu/goodhood/packages/chargebee#readme", | ||
"repository": "github:goodhood-eu/goodhood", | ||
"bugs": "https://github.com/goodhood-eu/goodhood/issues", | ||
"version": "1.7.1", | ||
"module": "lib/index.esm.js", | ||
@@ -16,0 +11,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
0
100
35599
405
1
1
1
1