@stigg/react-sdk 5.5.0 → 5.6.0
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/customerPortal/CustomerPortal.d.ts +2 -1
- package/dist/components/customerPortal/CustomerPortalContainer.d.ts +1 -1
- package/dist/components/customerPortal/types.d.ts +1 -0
- package/dist/components/customerPortal/usage/CustomerUsageData.d.ts +3 -2
- package/dist/react-sdk.cjs.development.js +13 -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 +13 -8
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/customerPortal/CustomerPortal.tsx +2 -1
- package/src/components/customerPortal/CustomerPortalContainer.tsx +8 -1
- package/src/components/customerPortal/subscriptionOverview/charges/ChargeItem.tsx +3 -1
- package/src/components/customerPortal/types.ts +2 -0
- package/src/components/customerPortal/usage/CustomerUsageData.tsx +13 -6
package/dist/react-sdk.esm.js
CHANGED
|
@@ -6074,7 +6074,7 @@ function ChargeItem(_ref) {
|
|
|
6074
6074
|
canUpgradeSubscription = _ref.canUpgradeSubscription,
|
|
6075
6075
|
hasCustomSubscription = _ref.hasCustomSubscription;
|
|
6076
6076
|
return React__default.createElement("div", {
|
|
6077
|
-
className: "stigg-charge-list-item",
|
|
6077
|
+
className: "stigg-charge-list-item stigg-charge-list-item-" + entitlement.feature.refId,
|
|
6078
6078
|
style: {
|
|
6079
6079
|
display: 'flex',
|
|
6080
6080
|
flexDirection: 'column',
|
|
@@ -6726,7 +6726,8 @@ function CustomerUsageLoader() {
|
|
|
6726
6726
|
var MAX_BOXES = 6;
|
|
6727
6727
|
function CustomerUsageData(_ref) {
|
|
6728
6728
|
var onManageSubscription = _ref.onManageSubscription,
|
|
6729
|
-
onBuyMore = _ref.onBuyMore
|
|
6729
|
+
onBuyMore = _ref.onBuyMore,
|
|
6730
|
+
filterEntitlements = _ref.filterEntitlements;
|
|
6730
6731
|
|
|
6731
6732
|
var _React$useState = React__default.useState(false),
|
|
6732
6733
|
showAll = _React$useState[0],
|
|
@@ -6764,10 +6765,11 @@ function CustomerUsageData(_ref) {
|
|
|
6764
6765
|
var otherEntitlements = compact(meteredEntitlements == null ? void 0 : meteredEntitlements.filter(function (entitlement) {
|
|
6765
6766
|
return !subscriptionPriceByFeature[entitlement.feature.refId];
|
|
6766
6767
|
}));
|
|
6767
|
-
var sortedEntitlements = [].concat(priceEntitlements, otherEntitlements);
|
|
6768
|
+
var sortedEntitlements = [].concat(priceEntitlements, otherEntitlements);
|
|
6769
|
+
var filteredEntitlements = filterEntitlements ? filterEntitlements(sortedEntitlements) : sortedEntitlements; // 4 -> 3 per row, 6 -> 2 per row
|
|
6768
6770
|
|
|
6769
|
-
var xs =
|
|
6770
|
-
var entitlementsToShow = showAll ?
|
|
6771
|
+
var xs = filteredEntitlements.length > 2 ? 4 : 6;
|
|
6772
|
+
var entitlementsToShow = showAll ? filteredEntitlements : filteredEntitlements.slice(0, MAX_BOXES);
|
|
6771
6773
|
|
|
6772
6774
|
var toggleShowAll = function toggleShowAll() {
|
|
6773
6775
|
return setShowAll(function (prevState) {
|
|
@@ -6792,6 +6794,7 @@ function CustomerUsageData(_ref) {
|
|
|
6792
6794
|
spacing: 4
|
|
6793
6795
|
}, entitlementsToShow.map(function (entitlement) {
|
|
6794
6796
|
return React__default.createElement(Grid, {
|
|
6797
|
+
className: "stigg-entitlement-usage-" + entitlement.feature.refId,
|
|
6795
6798
|
key: entitlement.feature.refId,
|
|
6796
6799
|
item: true,
|
|
6797
6800
|
xs: xs
|
|
@@ -6804,7 +6807,7 @@ function CustomerUsageData(_ref) {
|
|
|
6804
6807
|
hasCustomSubscription: hasCustomSubscription,
|
|
6805
6808
|
canUpgradeSubscription: canUpgradeSubscription
|
|
6806
6809
|
}));
|
|
6807
|
-
})),
|
|
6810
|
+
})), filteredEntitlements.length > MAX_BOXES && React__default.createElement(Footer, null, React__default.createElement(StyledButton$1, {
|
|
6808
6811
|
className: "stigg-usage-toggle-many-button",
|
|
6809
6812
|
variant: "text",
|
|
6810
6813
|
startIcon: showAll ? React__default.createElement(Minus, null) : React__default.createElement(Plus, null),
|
|
@@ -6818,7 +6821,8 @@ function CustomerPortalContainer(_ref) {
|
|
|
6818
6821
|
onCancelScheduledUpdates = _ref.onCancelScheduledUpdates,
|
|
6819
6822
|
onContactSupport = _ref.onContactSupport,
|
|
6820
6823
|
paywallComponent = _ref.paywallComponent,
|
|
6821
|
-
hiddenSections = _ref.hiddenSections
|
|
6824
|
+
hiddenSections = _ref.hiddenSections,
|
|
6825
|
+
filterEntitlements = _ref.filterEntitlements;
|
|
6822
6826
|
|
|
6823
6827
|
var _useStiggContext = useStiggContext(),
|
|
6824
6828
|
stigg = _useStiggContext.stigg;
|
|
@@ -6874,7 +6878,8 @@ function CustomerPortalContainer(_ref) {
|
|
|
6874
6878
|
cancelScheduledUpdatesButtonTitle: textOverrides.cancelScheduledUpdatesButtonTitle
|
|
6875
6879
|
}), shouldShowUsage && React__default.createElement(CustomerUsageData, {
|
|
6876
6880
|
onManageSubscription: onManageClick,
|
|
6877
|
-
onBuyMore: onBuyMore
|
|
6881
|
+
onBuyMore: onBuyMore,
|
|
6882
|
+
filterEntitlements: filterEntitlements
|
|
6878
6883
|
}), React__default.createElement(CustomerPortalPaywall, {
|
|
6879
6884
|
ref: customerPortalSectionRef,
|
|
6880
6885
|
paywallComponent: paywallComponent,
|