@stigg/react-sdk 4.12.1 → 4.13.1
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/paywall/Paywall.d.ts +3 -2
- package/dist/components/paywall/PaywallContainer.d.ts +3 -2
- package/dist/components/paywall/PlanOffering.d.ts +3 -2
- package/dist/components/paywall/index.d.ts +1 -1
- package/dist/components/paywall/paywallTextOverrides.d.ts +1 -0
- package/dist/components/paywall/types.d.ts +3 -0
- package/dist/components/utils/priceTierUtils.d.ts +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/react-sdk.cjs.development.js +28 -20
- 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 +28 -20
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/paywall/Paywall.tsx +10 -1
- package/src/components/paywall/PaywallContainer.tsx +4 -1
- package/src/components/paywall/PlanOffering.tsx +4 -2
- package/src/components/paywall/index.ts +1 -1
- package/src/components/paywall/paywallTextOverrides.ts +2 -0
- package/src/components/paywall/types.ts +2 -0
- package/src/components/utils/getPlanPrice.ts +1 -1
- package/src/components/utils/priceTierUtils.ts +5 -3
- package/src/index.ts +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BillingPeriod, Customer, Subscription } from '@stigg/js-client-sdk';
|
|
3
|
-
import { ShouldHidePlanFn, OnPlanSelectedCallbackFn, PaywallPlan } from './types';
|
|
3
|
+
import { ShouldHidePlanFn, OnPlanSelectedCallbackFn, PaywallPlan, SelectDefaultTierIndexFn } from './types';
|
|
4
4
|
import { PaywallLocalization } from './paywallTextOverrides';
|
|
5
5
|
declare type PaywallProps = {
|
|
6
6
|
plans: PaywallPlan[];
|
|
@@ -15,6 +15,7 @@ declare type PaywallProps = {
|
|
|
15
15
|
paywallLocale: PaywallLocalization;
|
|
16
16
|
locale: string;
|
|
17
17
|
shouldHidePlan?: ShouldHidePlanFn;
|
|
18
|
+
selectDefaultTierIndex?: SelectDefaultTierIndexFn;
|
|
18
19
|
};
|
|
19
|
-
export declare const Paywall: ({ plans, customer, currentSubscription, highlightedPlanId, selectedBillingPeriod, onBillingPeriodChanged, availableBillingPeriods, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, shouldHidePlan, }: PaywallProps) => JSX.Element;
|
|
20
|
+
export declare const Paywall: ({ plans, customer, currentSubscription, highlightedPlanId, selectedBillingPeriod, onBillingPeriodChanged, availableBillingPeriods, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, shouldHidePlan, selectDefaultTierIndex, }: PaywallProps) => JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BillingPeriod } from '@stigg/js-client-sdk';
|
|
3
|
-
import { ShouldHidePlanFn, OnPlanSelectedCallbackFn } from './types';
|
|
3
|
+
import { ShouldHidePlanFn, OnPlanSelectedCallbackFn, SelectDefaultTierIndexFn } from './types';
|
|
4
4
|
import { PaywallLocalization } from './paywallTextOverrides';
|
|
5
5
|
import { DeepPartial } from '../../types';
|
|
6
6
|
export declare type PaywallContainerProps = {
|
|
@@ -14,5 +14,6 @@ export declare type PaywallContainerProps = {
|
|
|
14
14
|
textOverrides?: DeepPartial<PaywallLocalization>;
|
|
15
15
|
billingCountryCode?: string;
|
|
16
16
|
shouldHidePlan?: ShouldHidePlanFn;
|
|
17
|
+
selectDefaultTierIndex?: SelectDefaultTierIndexFn;
|
|
17
18
|
};
|
|
18
|
-
export declare const PaywallContainer: ({ productId, resourceId, highlightedPlanId, showOnlyEligiblePlans, textOverrides, onPlanSelected, preferredBillingPeriod, onBillingPeriodChange, billingCountryCode, shouldHidePlan, }: PaywallContainerProps) => JSX.Element;
|
|
19
|
+
export declare const PaywallContainer: ({ productId, resourceId, highlightedPlanId, showOnlyEligiblePlans, textOverrides, onPlanSelected, preferredBillingPeriod, onBillingPeriodChange, billingCountryCode, shouldHidePlan, selectDefaultTierIndex, }: PaywallContainerProps) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BillableFeature, BillingPeriod, Customer, Subscription } from '@stigg/js-client-sdk';
|
|
3
|
-
import { PaywallPlan, SubscribeIntentionType } from './types';
|
|
3
|
+
import { PaywallPlan, SelectDefaultTierIndexFn, SubscribeIntentionType } from './types';
|
|
4
4
|
import { PaywallLocalization } from './paywallTextOverrides';
|
|
5
5
|
declare type PlanOfferingProps = {
|
|
6
6
|
withUnitPriceRow: boolean;
|
|
@@ -20,6 +20,7 @@ declare type PlanOfferingProps = {
|
|
|
20
20
|
locale: string;
|
|
21
21
|
withStartingAtRow: boolean;
|
|
22
22
|
isCustomerInCustomPlan: boolean;
|
|
23
|
+
selectDefaultTierIndex?: SelectDefaultTierIndexFn;
|
|
23
24
|
};
|
|
24
|
-
export declare function PlanOffering({ withUnitPriceRow, withTiersRow, withTrialLeftRow, customer, plan, billingPeriod, isHighlighted, currentSubscription, shouldShowDescriptionSection, hasMonthlyPrice, hasAnnuallyPrice, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, withStartingAtRow, isCustomerInCustomPlan, }: PlanOfferingProps): JSX.Element;
|
|
25
|
+
export declare function PlanOffering({ withUnitPriceRow, withTiersRow, withTrialLeftRow, customer, plan, billingPeriod, isHighlighted, currentSubscription, shouldShowDescriptionSection, hasMonthlyPrice, hasAnnuallyPrice, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, withStartingAtRow, isCustomerInCustomPlan, selectDefaultTierIndex, }: PlanOfferingProps): JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { PaywallContainer as Paywall, PaywallContainerProps as PaywallProps } from './PaywallContainer';
|
|
2
2
|
export { PaywallPlan, OnPlanSelectedCallbackFn, SubscribeIntentionType } from './types';
|
|
3
|
-
export { PaywallLocalization } from './paywallTextOverrides';
|
|
3
|
+
export { PaywallLocalization, PlanPriceText } from './paywallTextOverrides';
|
|
@@ -2,6 +2,7 @@ import { BillingPeriod, PaywallCalculatedPricePoint, PaywallCurrency, Plan, Pric
|
|
|
2
2
|
import { DeepPartial } from '../../types';
|
|
3
3
|
import { PlanPriceText } from '../utils/getPlanPrice';
|
|
4
4
|
import { PaywallPlan } from './types';
|
|
5
|
+
export { PlanPriceText } from '../utils/getPlanPrice';
|
|
5
6
|
export declare type PaywallLocalization = {
|
|
6
7
|
highlightChip: string;
|
|
7
8
|
entitlementsTitle?: (plan: PaywallPlan) => string;
|
|
@@ -44,3 +44,6 @@ export declare type OnPlanSelectedCallbackFn = ({ plan, customer, subscription,
|
|
|
44
44
|
export declare type ShouldHidePlanFn = ({ plan }: {
|
|
45
45
|
plan: PaywallPlan;
|
|
46
46
|
}) => boolean | Promise<boolean>;
|
|
47
|
+
export declare type SelectDefaultTierIndexFn = ({ plan }: {
|
|
48
|
+
plan: PaywallPlan;
|
|
49
|
+
}) => number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BillingPeriod, Price, PriceTierFragment, Subscription } from '@stigg/js-client-sdk';
|
|
2
|
-
import { PaywallPlan } from '../paywall
|
|
2
|
+
import { PaywallPlan } from '../paywall';
|
|
3
|
+
import { SelectDefaultTierIndexFn } from '../paywall/types';
|
|
3
4
|
export declare function getPriceFeatureUnit(price: Price): string;
|
|
4
5
|
export declare function getTierByQuantity(tiers: PriceTierFragment[], quantity: number): PriceTierFragment | undefined;
|
|
5
6
|
export declare function calculateTierPrice(price: Price, currentTier: PriceTierFragment, selectedBillingPeriod: BillingPeriod, shouldShowMonthlyPriceAmount: boolean): number;
|
|
6
|
-
export declare function getSelectedTier(plan: PaywallPlan, billingPeriod: BillingPeriod, currentSubscription: Subscription | null, selectedTierByFeature: Record<string, PriceTierFragment
|
|
7
|
+
export declare function getSelectedTier(plan: PaywallPlan, billingPeriod: BillingPeriod, currentSubscription: Subscription | null, selectedTierByFeature: Record<string, PriceTierFragment>, selectDefaultTierIndex?: SelectDefaultTierIndexFn): Record<string, PriceTierFragment>;
|
|
7
8
|
export declare enum PriceTierComparison {
|
|
8
9
|
Lower = -1,
|
|
9
10
|
Equal = 0,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './styles.css';
|
|
2
2
|
export * from '@stigg/js-client-sdk';
|
|
3
|
-
export { Paywall, PaywallProps, OnPlanSelectedCallbackFn, PaywallPlan, SubscribeIntentionType, PaywallLocalization, } from './components/paywall';
|
|
3
|
+
export { Paywall, PaywallProps, OnPlanSelectedCallbackFn, PaywallPlan, SubscribeIntentionType, PaywallLocalization, PlanPriceText, } from './components/paywall';
|
|
4
4
|
export { CustomerPortalProvider, CustomerPortal, CustomerPortalProps, CustomerPortalSection, AddonsList, PaymentDetailsSection, InvoicesSection, CustomerUsageData, CustomerUsageDataProps, SubscriptionsOverview, SubscriptionsOverviewProps, Promotions, } from './components/customerPortal';
|
|
5
5
|
export { StiggProvider, StiggProviderProps, useStiggContext, StiggContextValue, StiggContext, } from './components/StiggProvider';
|
|
6
6
|
export { Checkout, CheckoutProps, CheckoutProviderProps, CheckoutContainerProps, CheckoutLocalization, CheckoutResult, OnCheckoutCompletedParams, OnCheckoutParams, CheckoutTheme, CheckoutMockProps, MockCheckoutPreviewCallback, MockCheckoutStateCallback, BillingInformation, TaxDetailsInput, } from './components/checkout';
|