@schematichq/schematic-react 0.2.0-rc.4 → 0.2.0-rc.6
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/schematic-react.cjs.js +1492 -1088
- package/dist/schematic-react.d.ts +32 -36
- package/dist/schematic-react.esm.js +1476 -1078
- package/package.json +2 -2
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Context } from 'react';
|
2
2
|
import * as Craft from '@craftjs/core';
|
3
3
|
import { DetailedHTMLProps } from 'react';
|
4
|
-
import { Dispatch } from 'react';
|
5
4
|
import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES } from 'react';
|
6
5
|
import { Event as Event_2 } from '@schematichq/schematic-js';
|
7
6
|
import { EventBody } from '@schematichq/schematic-js';
|
@@ -16,14 +15,13 @@ import { HTMLAttributes } from 'react';
|
|
16
15
|
import { IStyledComponentBase } from 'styled-components/dist/types';
|
17
16
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
18
17
|
import { Keys } from '@schematichq/schematic-js';
|
19
|
-
import {
|
18
|
+
import { default as React_2 } from 'react';
|
20
19
|
import { RefAttributes } from 'react';
|
21
20
|
import { RefObject } from 'react';
|
22
21
|
import { Schematic } from '@schematichq/schematic-js';
|
23
22
|
import { SchematicContext } from '@schematichq/schematic-js';
|
24
23
|
import * as SchematicJS from '@schematichq/schematic-js';
|
25
24
|
import { SchematicOptions } from '@schematichq/schematic-js';
|
26
|
-
import { SetStateAction } from 'react';
|
27
25
|
import { Stripe } from '@stripe/stripe-js';
|
28
26
|
import { Substitute } from 'styled-components/dist/types';
|
29
27
|
import { Traits } from '@schematichq/schematic-js';
|
@@ -79,7 +77,7 @@ declare class BaseAPI {
|
|
79
77
|
}
|
80
78
|
|
81
79
|
declare type BaseSchematicProviderProps = Omit<SchematicJS.SchematicOptions, "client" | "publishableKey"> & {
|
82
|
-
children:
|
80
|
+
children: React_2.ReactNode;
|
83
81
|
};
|
84
82
|
|
85
83
|
/**
|
@@ -1165,6 +1163,8 @@ export declare interface EmbedContextProps {
|
|
1165
1163
|
stripe: Promise<Stripe | null> | null;
|
1166
1164
|
layout: EmbedLayout;
|
1167
1165
|
error?: Error;
|
1166
|
+
isPending: boolean;
|
1167
|
+
hydrate: () => void;
|
1168
1168
|
setData: (data: RecursivePartial<ComponentHydrateResponseData>) => void;
|
1169
1169
|
updateSettings: (settings: RecursivePartial<EmbedSettings>) => void;
|
1170
1170
|
setStripe: (stripe: Promise<Stripe | null> | null) => void;
|
@@ -1953,7 +1953,7 @@ export declare const IconRound: ({ name, variant, size, colors, ...props }: Icon
|
|
1953
1953
|
export declare interface IconRoundProps extends React.HTMLAttributes<HTMLElement> {
|
1954
1954
|
name: IconNameTypes;
|
1955
1955
|
variant?: "outline" | "filled";
|
1956
|
-
size?: "tn" | "sm" | "md" | "lg";
|
1956
|
+
size?: "tn" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
1957
1957
|
colors?: [string, string];
|
1958
1958
|
}
|
1959
1959
|
|
@@ -2055,6 +2055,12 @@ declare interface InvoiceResponseData {
|
|
2055
2055
|
* @memberof InvoiceResponseData
|
2056
2056
|
*/
|
2057
2057
|
id: string;
|
2058
|
+
/**
|
2059
|
+
*
|
2060
|
+
* @type {string}
|
2061
|
+
* @memberof InvoiceResponseData
|
2062
|
+
*/
|
2063
|
+
paymentMethodExternalId?: string | null;
|
2058
2064
|
/**
|
2059
2065
|
*
|
2060
2066
|
* @type {string}
|
@@ -2102,28 +2108,23 @@ declare interface Middleware {
|
|
2102
2108
|
onError?(context: ErrorContext): Promise<Response | void>;
|
2103
2109
|
}
|
2104
2110
|
|
2105
|
-
declare
|
2111
|
+
export declare const Modal: ({ children, size, onClose }: ModalProps) => JSX_2.Element;
|
2112
|
+
|
2113
|
+
export declare const ModalHeader: ({ children, bordered, onClose, }: ModalHeaderProps) => JSX_2.Element;
|
2106
2114
|
|
2107
|
-
|
2108
|
-
children: ReactNode;
|
2115
|
+
declare interface ModalHeaderProps {
|
2116
|
+
children: React.ReactNode;
|
2117
|
+
bordered?: boolean;
|
2109
2118
|
onClose?: () => void;
|
2110
|
-
}
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
checkoutStage: "plan" | "checkout";
|
2116
|
-
setCheckoutStage: Dispatch<SetStateAction<"plan" | "checkout">>;
|
2117
|
-
currentPlan?: BillingPlan;
|
2118
|
-
selectedPlan?: CompanyPlanDetailResponseData;
|
2119
|
-
paymentMethodId?: string;
|
2120
|
-
}) => JSX_2.Element;
|
2121
|
-
|
2122
|
-
export declare const OverlayWrapper: ({ children, size, onClose, }: {
|
2123
|
-
children: ReactNode;
|
2124
|
-
size?: "md" | "lg";
|
2119
|
+
}
|
2120
|
+
|
2121
|
+
declare interface ModalProps {
|
2122
|
+
children: React.ReactNode;
|
2123
|
+
size?: "sm" | "md" | "lg" | "auto";
|
2125
2124
|
onClose?: () => void;
|
2126
|
-
}
|
2125
|
+
}
|
2126
|
+
|
2127
|
+
declare type ModelPropertyNaming = "camelCase" | "snake_case" | "PascalCase" | "original";
|
2127
2128
|
|
2128
2129
|
export declare const PaymentMethod: ForwardRefExoticComponent<ElementProps & RecursivePartial<DesignProps_5> & HTMLAttributes<HTMLDivElement> & {
|
2129
2130
|
portal?: HTMLElement | null;
|
@@ -2208,12 +2209,6 @@ declare interface PaymentMethodResponseData {
|
|
2208
2209
|
* @memberof PaymentMethodResponseData
|
2209
2210
|
*/
|
2210
2211
|
id: string;
|
2211
|
-
/**
|
2212
|
-
*
|
2213
|
-
* @type {string}
|
2214
|
-
* @memberof PaymentMethodResponseData
|
2215
|
-
*/
|
2216
|
-
invoiceExternalId?: string | null;
|
2217
2212
|
/**
|
2218
2213
|
*
|
2219
2214
|
* @type {string}
|
@@ -2851,8 +2846,7 @@ export { Schematic }
|
|
2851
2846
|
export { SchematicContext }
|
2852
2847
|
|
2853
2848
|
declare interface SchematicContextProps {
|
2854
|
-
client
|
2855
|
-
flagValues: Record<string, boolean>;
|
2849
|
+
client: SchematicJS.Schematic;
|
2856
2850
|
}
|
2857
2851
|
|
2858
2852
|
export declare const SchematicEmbed: ({ id, accessToken, apiConfig }: EmbedProps) => JSX_2.Element;
|
@@ -2863,7 +2857,7 @@ export declare interface SchematicHookOpts {
|
|
2863
2857
|
|
2864
2858
|
export { SchematicOptions }
|
2865
2859
|
|
2866
|
-
export declare const SchematicProvider:
|
2860
|
+
export declare const SchematicProvider: React_2.FC<SchematicProviderProps>;
|
2867
2861
|
|
2868
2862
|
export declare type SchematicProviderProps = SchematicProviderPropsWithClient | SchematicProviderPropsWithPublishableKey;
|
2869
2863
|
|
@@ -2963,12 +2957,12 @@ export declare const useEmbed: () => EmbedContextProps;
|
|
2963
2957
|
export declare const useSchematic: () => SchematicContextProps;
|
2964
2958
|
|
2965
2959
|
export declare const useSchematicContext: (opts?: SchematicHookOpts) => {
|
2966
|
-
setContext: (
|
2960
|
+
setContext: (context: SchematicJS.SchematicContext) => Promise<void>;
|
2967
2961
|
};
|
2968
2962
|
|
2969
2963
|
export declare const useSchematicEvents: (opts?: SchematicHookOpts) => {
|
2970
|
-
track: (
|
2971
|
-
identify: (
|
2964
|
+
track: (body: SchematicJS.EventBodyTrack) => Promise<void>;
|
2965
|
+
identify: (body: SchematicJS.EventBodyIdentify) => Promise<void>;
|
2972
2966
|
};
|
2973
2967
|
|
2974
2968
|
export declare const useSchematicFlag: (key: string, opts?: UseSchematicFlagOpts) => boolean;
|
@@ -2977,6 +2971,8 @@ export declare type UseSchematicFlagOpts = SchematicHookOpts & {
|
|
2977
2971
|
fallback?: boolean;
|
2978
2972
|
};
|
2979
2973
|
|
2974
|
+
export declare const useSchematicIsPending: (opts?: SchematicHookOpts) => boolean;
|
2975
|
+
|
2980
2976
|
export declare const Viewport: ForwardRefExoticComponent<Omit<ViewportProps, "ref"> & RefAttributes<HTMLDivElement | null>>;
|
2981
2977
|
|
2982
2978
|
export declare interface ViewportProps extends React.HTMLProps<HTMLDivElement> {
|