@stigg/react-sdk 5.25.0 → 5.27.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/BooleanEntitlementGuard.d.ts +8 -0
- package/dist/components/MeteredEntitlementGuard.d.ts +8 -0
- package/dist/components/StiggProvider.d.ts +1 -1
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useActiveSubscriptions.d.ts +6 -0
- package/dist/hooks/useBooleanEntitlement.d.ts +5 -0
- package/dist/hooks/useCustomerPortal.d.ts +6 -0
- package/dist/hooks/useFetch.d.ts +8 -0
- package/dist/hooks/useMeteredEntitlement.d.ts +6 -0
- package/dist/hooks/useNumericEntitlement.d.ts +6 -0
- package/dist/hooks/usePaywall.d.ts +6 -0
- package/dist/hooks/useStiggContext.d.ts +7 -0
- package/dist/index.d.ts +4 -1
- package/dist/react-sdk.cjs.development.js +432 -200
- 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 +426 -202
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/BooleanEntitlementGuard.tsx +22 -0
- package/src/components/MeteredEntitlementGuard.tsx +22 -0
- package/src/components/StiggProvider.tsx +4 -9
- package/src/components/checkout/hooks/useLoadCheckout.ts +1 -1
- package/src/components/checkout/hooks/usePreviewSubscription.ts +1 -1
- package/src/components/customerPortal/hooks/useCustomerPortal.ts +1 -1
- package/src/components/hooks/useWaitForCheckoutCompleted.ts +1 -1
- package/src/components/paywall/hooks/useLoadPaywallData.ts +1 -1
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useActiveSubscriptions.ts +21 -0
- package/src/hooks/useBooleanEntitlement.ts +20 -0
- package/src/hooks/useCustomerPortal.ts +21 -0
- package/src/hooks/useFetch.ts +31 -0
- package/src/hooks/useMeteredEntitlement.ts +20 -0
- package/src/hooks/useNumericEntitlement.ts +20 -0
- package/src/hooks/usePaywall.ts +21 -0
- package/src/hooks/useStiggContext.ts +13 -0
- package/src/index.ts +12 -7
- package/src/theme/Theme.tsx +2 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GetBooleanEntitlement } from '@stigg/js-client-sdk';
|
|
3
|
+
declare type BooleanEntitlementGuardProps = GetBooleanEntitlement & {
|
|
4
|
+
noAccessComponent?: React.ReactNode;
|
|
5
|
+
children: React.ReactElement;
|
|
6
|
+
};
|
|
7
|
+
export declare function BooleanEntitlementGuard({ noAccessComponent, children, ...rest }: BooleanEntitlementGuardProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GetMeteredEntitlement } from '@stigg/js-client-sdk';
|
|
3
|
+
declare type MeteredEntitlementGuardProps = GetMeteredEntitlement & {
|
|
4
|
+
noAccessComponent?: React.ReactNode;
|
|
5
|
+
children: React.ReactElement;
|
|
6
|
+
};
|
|
7
|
+
export declare function MeteredEntitlementGuard({ noAccessComponent, children, ...rest }: MeteredEntitlementGuardProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -23,6 +23,7 @@ export declare type StiggProviderProps = {
|
|
|
23
23
|
resourceId?: string;
|
|
24
24
|
theme?: CustomizedTheme;
|
|
25
25
|
locale?: string;
|
|
26
|
+
offline?: boolean;
|
|
26
27
|
cacheTtlMs?: number;
|
|
27
28
|
/** @deprecated not longer in use */
|
|
28
29
|
useEntitlementPolling?: boolean;
|
|
@@ -33,4 +34,3 @@ export declare type StiggProviderProps = {
|
|
|
33
34
|
clientVersion?: string;
|
|
34
35
|
};
|
|
35
36
|
export declare const StiggProvider: React.FC<PropsWithChildren<StiggProviderProps>>;
|
|
36
|
-
export declare const useStiggContext: () => StiggContextValue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useBooleanEntitlement } from './useBooleanEntitlement';
|
|
2
|
+
export { useNumericEntitlement } from './useNumericEntitlement';
|
|
3
|
+
export { useMeteredEntitlement } from './useMeteredEntitlement';
|
|
4
|
+
export { useActiveSubscriptions } from './useActiveSubscriptions';
|
|
5
|
+
export { usePaywall } from './usePaywall';
|
|
6
|
+
export { useCustomerPortal } from './useCustomerPortal';
|
|
7
|
+
export { useStiggContext } from './useStiggContext';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GetActiveSubscriptions } from '@stigg/js-client-sdk';
|
|
2
|
+
export declare function useActiveSubscriptions(params?: GetActiveSubscriptions): {
|
|
3
|
+
activeSubscriptions: import("@stigg/js-client-sdk").Subscription[] | null;
|
|
4
|
+
isLoaded: boolean;
|
|
5
|
+
error: Error | null;
|
|
6
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BooleanEntitlement, GetBooleanEntitlement } from '@stigg/js-client-sdk';
|
|
2
|
+
export declare type TypedGetBooleanEntitlement<T> = Omit<GetBooleanEntitlement, 'featureId'> & {
|
|
3
|
+
featureId: T;
|
|
4
|
+
};
|
|
5
|
+
export declare function useBooleanEntitlement<T extends string>(params: TypedGetBooleanEntitlement<T>): BooleanEntitlement;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GetMeteredEntitlement, MeteredEntitlement } from '@stigg/js-client-sdk';
|
|
2
|
+
declare type TypedGetMeteredEntitlement<T> = Omit<GetMeteredEntitlement, 'featureId'> & {
|
|
3
|
+
featureId: T;
|
|
4
|
+
};
|
|
5
|
+
export declare function useMeteredEntitlement<T extends string>(params: TypedGetMeteredEntitlement<T>): MeteredEntitlement;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NumericEntitlement, GetNumericEntitlement } from '@stigg/js-client-sdk';
|
|
2
|
+
declare type TypedGetNumericEntitlement<T> = Omit<GetNumericEntitlement, 'featureId'> & {
|
|
3
|
+
featureId: T;
|
|
4
|
+
};
|
|
5
|
+
export declare function useNumericEntitlement<T extends string>(params: TypedGetNumericEntitlement<T>): NumericEntitlement;
|
|
6
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import './styles.css';
|
|
|
2
2
|
export * from '@stigg/js-client-sdk';
|
|
3
3
|
export { Paywall, PaywallProps, OnPlanSelectedCallbackFn, PaywallPlan, SubscribeIntentionType, PaywallLocalization, PlanPriceText, CurrentPlanParams, PaywallData, SelectDefaultTierIndexFn, ShouldHidePlanFn, } from './components/paywall';
|
|
4
4
|
export { CustomerPortalProvider, CustomerPortal, CustomerPortalProps, CustomerPortalSection, AddonsList, PaymentDetailsSection, InvoicesSection, CustomerUsageData, CustomerUsageDataProps, SubscriptionsOverview, SubscriptionsOverviewProps, Promotions, CustomerPortalIntentionType, OnBuyMoreCallbackFn, OnManageSubscriptionFn, CustomerPortalLocalization, CustomerPortalTheme, } from './components/customerPortal';
|
|
5
|
-
export { StiggProvider, StiggProviderProps,
|
|
5
|
+
export { StiggProvider, StiggProviderProps, 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';
|
|
7
7
|
export { useWaitForCheckoutCompleted, ProvisionStatus } from './components/hooks';
|
|
8
|
+
export { useBooleanEntitlement, useMeteredEntitlement, useNumericEntitlement, useActiveSubscriptions, useCustomerPortal, useStiggContext, usePaywall, } from './hooks';
|
|
8
9
|
export { HorizontalAlignment, TextAlignment, FontVariant, FontWeight, StiggTheme } from './theme/types';
|
|
9
10
|
export { CustomizedTheme as Theme } from './theme/Theme';
|
|
11
|
+
export { BooleanEntitlementGuard } from './components/BooleanEntitlementGuard';
|
|
12
|
+
export { MeteredEntitlementGuard } from './components/MeteredEntitlementGuard';
|