@stigg/react-sdk 4.4.0-beta.1 → 4.4.0-beta.2
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.
- package/dist/components/checkout/CheckoutProvider.d.ts +1 -1
- package/dist/components/checkout/index.d.ts +1 -0
- package/dist/components/customerPortal/subscriptionOverview/subscriptionView/SubscriptionView.style.d.ts +1 -1
- package/dist/react-sdk.cjs.development.js +10 -8
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +10 -8
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/checkout/Checkout.tsx +1 -2
- package/src/components/checkout/CheckoutProvider.tsx +10 -14
- package/src/components/checkout/hooks/usePreviewSubscription.ts +1 -2
- package/src/components/checkout/index.ts +1 -0
- package/src/stories/Checkout.stories.tsx +6 -5
|
@@ -29,6 +29,6 @@ export declare type CheckoutProviderProps = {
|
|
|
29
29
|
billingCountryCode?: string;
|
|
30
30
|
billableFeatures?: BillableFeature[];
|
|
31
31
|
};
|
|
32
|
-
export declare function CheckoutProvider({ children, textOverrides, theme,
|
|
32
|
+
export declare function CheckoutProvider({ children, textOverrides, theme, preferredBillingPeriod, billableFeatures, resourceId, planId, billingCountryCode, }: {
|
|
33
33
|
children: React.ReactNode;
|
|
34
34
|
} & CheckoutProviderProps): JSX.Element;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
/// <reference types="@emotion/styled/macro" />
|
|
3
3
|
export declare const SubscriptionViewLayout: import("@emotion/styled/macro").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "
|
|
5
|
+
as?: "symbol" | "object" | "big" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
|
6
6
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -6704,7 +6704,6 @@ var usePreviewSubscriptionAction = function usePreviewSubscriptionAction() {
|
|
|
6704
6704
|
|
|
6705
6705
|
var _ref = checkoutState || {},
|
|
6706
6706
|
plan = _ref.plan,
|
|
6707
|
-
activeSubscription = _ref.activeSubscription,
|
|
6708
6707
|
customer = _ref.customer;
|
|
6709
6708
|
|
|
6710
6709
|
var previewSubscriptionAction = React.useCallback( /*#__PURE__*/function () {
|
|
@@ -6776,7 +6775,7 @@ var usePreviewSubscriptionAction = function usePreviewSubscriptionAction() {
|
|
|
6776
6775
|
return function (_x) {
|
|
6777
6776
|
return _ref2.apply(this, arguments);
|
|
6778
6777
|
};
|
|
6779
|
-
}(), [
|
|
6778
|
+
}(), [customer, plan, resourceId, stigg, subscription.addons, subscription.billingPeriod, subscription.billableFeatures, subscription.promotionCode, planStep.billingCountryCode]);
|
|
6780
6779
|
return {
|
|
6781
6780
|
previewSubscriptionAction: previewSubscriptionAction
|
|
6782
6781
|
};
|
|
@@ -6968,6 +6967,9 @@ var CheckoutContextProvider = function CheckoutContextProvider(_ref) {
|
|
|
6968
6967
|
state = _useState[0],
|
|
6969
6968
|
innerSetState = _useState[1];
|
|
6970
6969
|
|
|
6970
|
+
React.useEffect(function () {
|
|
6971
|
+
innerSetState(initialState);
|
|
6972
|
+
}, [initialState]);
|
|
6971
6973
|
var setState = React.useCallback(function (updater) {
|
|
6972
6974
|
return innerSetState(function (old) {
|
|
6973
6975
|
return immer.produce(old, function (draft) {
|
|
@@ -6978,7 +6980,7 @@ var CheckoutContextProvider = function CheckoutContextProvider(_ref) {
|
|
|
6978
6980
|
|
|
6979
6981
|
var _useMemo = React.useMemo(function () {
|
|
6980
6982
|
return [state, setState];
|
|
6981
|
-
}, [state]),
|
|
6983
|
+
}, [setState, state]),
|
|
6982
6984
|
contextValue = _useMemo[0],
|
|
6983
6985
|
setContextValue = _useMemo[1];
|
|
6984
6986
|
|
|
@@ -6991,11 +6993,11 @@ function CheckoutProvider(_ref2) {
|
|
|
6991
6993
|
var children = _ref2.children,
|
|
6992
6994
|
textOverrides = _ref2.textOverrides,
|
|
6993
6995
|
theme = _ref2.theme,
|
|
6996
|
+
preferredBillingPeriod = _ref2.preferredBillingPeriod,
|
|
6997
|
+
billableFeatures = _ref2.billableFeatures,
|
|
6994
6998
|
resourceId = _ref2.resourceId,
|
|
6995
6999
|
planId = _ref2.planId,
|
|
6996
|
-
|
|
6997
|
-
billingCountryCode = _ref2.billingCountryCode,
|
|
6998
|
-
billableFeatures = _ref2.billableFeatures;
|
|
7000
|
+
billingCountryCode = _ref2.billingCountryCode;
|
|
6999
7001
|
|
|
7000
7002
|
var _useLoadCheckout = useLoadCheckout({
|
|
7001
7003
|
resourceId: resourceId,
|
|
@@ -7045,8 +7047,8 @@ function CheckoutProvider(_ref2) {
|
|
|
7045
7047
|
isLoadingCheckoutData: isLoading
|
|
7046
7048
|
}
|
|
7047
7049
|
};
|
|
7048
|
-
return initialState;
|
|
7049
|
-
}, [
|
|
7050
|
+
return initialState; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7051
|
+
}, [preferredBillingPeriod, billingCountryCode, checkout, isLoading]);
|
|
7050
7052
|
return React__default.createElement(SdkThemeProvider, {
|
|
7051
7053
|
key: checkout == null ? void 0 : checkout.plan.id,
|
|
7052
7054
|
componentTheme: configuration
|