@stripe/connect-js 1.0.9 → 1.1.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/connect.esm.js +3 -2
- package/dist/connect.js +3 -2
- package/dist/pure.esm.js +3 -2
- package/dist/pure.js +3 -2
- package/package.json +1 -1
- package/src/shared.ts +7 -0
- package/types/shared.d.ts +100 -65
package/dist/connect.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "1.0.
|
|
1
|
+
var version = "1.0.10";
|
|
2
2
|
|
|
3
3
|
const componentNameMapping = {
|
|
4
4
|
payments: "stripe-connect-payments",
|
|
@@ -78,7 +78,8 @@ const createWrapper = stripeConnect => {
|
|
|
78
78
|
sdkVersion: version
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
|
-
}));
|
|
81
|
+
})).connect;
|
|
82
|
+
console.log(stripeConnectInstance, "lemon");
|
|
82
83
|
// We wrap create so we can map its different strings to supported components
|
|
83
84
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
84
85
|
stripeConnectInstance.create = tagName => {
|
package/dist/connect.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "1.0.
|
|
5
|
+
var version = "1.0.10";
|
|
6
6
|
|
|
7
7
|
const componentNameMapping = {
|
|
8
8
|
payments: "stripe-connect-payments",
|
|
@@ -82,7 +82,8 @@ const createWrapper = stripeConnect => {
|
|
|
82
82
|
sdkVersion: version
|
|
83
83
|
}
|
|
84
84
|
})
|
|
85
|
-
}));
|
|
85
|
+
})).connect;
|
|
86
|
+
console.log(stripeConnectInstance, "lemon");
|
|
86
87
|
// We wrap create so we can map its different strings to supported components
|
|
87
88
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
88
89
|
stripeConnectInstance.create = tagName => {
|
package/dist/pure.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "1.0.
|
|
1
|
+
var version = "1.0.10";
|
|
2
2
|
|
|
3
3
|
const componentNameMapping = {
|
|
4
4
|
payments: "stripe-connect-payments",
|
|
@@ -78,7 +78,8 @@ const createWrapper = stripeConnect => {
|
|
|
78
78
|
sdkVersion: version
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
|
-
}));
|
|
81
|
+
})).connect;
|
|
82
|
+
console.log(stripeConnectInstance, "lemon");
|
|
82
83
|
// We wrap create so we can map its different strings to supported components
|
|
83
84
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
84
85
|
stripeConnectInstance.create = tagName => {
|
package/dist/pure.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "1.0.
|
|
5
|
+
var version = "1.0.10";
|
|
6
6
|
|
|
7
7
|
const componentNameMapping = {
|
|
8
8
|
payments: "stripe-connect-payments",
|
|
@@ -82,7 +82,8 @@ const createWrapper = stripeConnect => {
|
|
|
82
82
|
sdkVersion: version
|
|
83
83
|
}
|
|
84
84
|
})
|
|
85
|
-
}));
|
|
85
|
+
})).connect;
|
|
86
|
+
console.log(stripeConnectInstance, "lemon");
|
|
86
87
|
// We wrap create so we can map its different strings to supported components
|
|
87
88
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
88
89
|
stripeConnectInstance.create = tagName => {
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -59,6 +59,13 @@ export const loadScript = (): Promise<StripeConnectWrapper | null> => {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
stripePromise = new Promise((resolve, reject) => {
|
|
62
|
+
if (typeof window === "undefined") {
|
|
63
|
+
reject(
|
|
64
|
+
"ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects."
|
|
65
|
+
);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
62
69
|
if ((window as any).StripeConnect) {
|
|
63
70
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
64
71
|
}
|
package/types/shared.d.ts
CHANGED
|
@@ -2,116 +2,148 @@ export declare type LoadConnect = () => Promise<StripeConnectWrapper>;
|
|
|
2
2
|
|
|
3
3
|
export declare type OverlayOption = "dialog" | "drawer";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Appearance options for the Connect instance.
|
|
7
|
+
*/
|
|
8
|
+
export declare type AppearanceOptions = {
|
|
9
|
+
overlays?: OverlayOption;
|
|
10
|
+
variables?: AppearanceVariables;
|
|
8
11
|
};
|
|
9
12
|
|
|
10
|
-
export declare type
|
|
13
|
+
export declare type AppearanceVariables = {
|
|
11
14
|
colorPrimary?: string;
|
|
12
15
|
// Primary Button
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
buttonPrimaryColorBorder?: string;
|
|
17
|
+
buttonPrimaryColorBackground?: string;
|
|
18
|
+
buttonPrimaryColorText?: string;
|
|
16
19
|
// Secondary Button
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
buttonSecondaryColorBorder?: string;
|
|
21
|
+
buttonSecondaryColorBackground?: string;
|
|
22
|
+
buttonSecondaryColorText?: string;
|
|
20
23
|
// Link
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
actionPrimaryColorText?: string;
|
|
25
|
+
actionSecondaryColorText?: string;
|
|
23
26
|
// Border
|
|
24
27
|
colorBorder?: string;
|
|
25
28
|
// Form
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
formHighlightColorBorder?: string;
|
|
30
|
+
formAccentColor?: string;
|
|
28
31
|
// Text
|
|
29
32
|
colorText?: string;
|
|
30
33
|
colorSecondaryText?: string;
|
|
31
34
|
// Background
|
|
32
35
|
colorBackground?: string;
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
offsetBackgroundColor?: string;
|
|
37
|
+
formBackgroundColor?: string;
|
|
35
38
|
|
|
36
39
|
// Feedback Colors
|
|
37
40
|
colorDanger?: string;
|
|
38
41
|
|
|
39
42
|
// Neutral Badge Colors
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
badgeNeutralColorBorder?: string;
|
|
44
|
+
badgeNeutralColorBackground?: string;
|
|
45
|
+
badgeNeutralColorText?: string;
|
|
43
46
|
|
|
44
47
|
// Success Badge Colors
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
badgeSuccessColorBorder?: string;
|
|
49
|
+
badgeSuccessColorBackground?: string;
|
|
50
|
+
badgeSuccessColorText?: string;
|
|
48
51
|
|
|
49
52
|
// Warning Badge Colors
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
badgeWarningColorBorder?: string;
|
|
54
|
+
badgeWarningColorBackground?: string;
|
|
55
|
+
badgeWarningColorText?: string;
|
|
53
56
|
|
|
54
57
|
// Danger Badge Colors
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
badgeDangerColorBorder?: string;
|
|
59
|
+
badgeDangerColorBackground?: string;
|
|
60
|
+
badgeDangerColorText?: string;
|
|
58
61
|
|
|
59
62
|
// Border Sizing
|
|
60
63
|
borderRadius?: string;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
buttonBorderRadius?: string;
|
|
65
|
+
formBorderRadius?: string;
|
|
66
|
+
badgeBorderRadius?: string;
|
|
67
|
+
overlayBorderRadius?: string;
|
|
68
|
+
|
|
69
|
+
// Overlay
|
|
70
|
+
overlayZIndex?: number;
|
|
71
|
+
|
|
72
|
+
// Font Sizing
|
|
73
|
+
fontSizeBase?: string;
|
|
74
|
+
|
|
75
|
+
// Spacing
|
|
76
|
+
spacingUnit?: string;
|
|
64
77
|
|
|
65
78
|
// Body Typography
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
bodyLgFontSize?: string;
|
|
80
|
+
bodyLgFontWeight?: string;
|
|
81
|
+
bodyMdFontSize?: string;
|
|
82
|
+
bodyMdFontWeight?: string;
|
|
83
|
+
bodySmFontSize?: string;
|
|
84
|
+
bodySmFontWeight?: string;
|
|
72
85
|
|
|
73
86
|
// Label Typography
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
labelLgFontSize?: string;
|
|
88
|
+
labelLgFontWeight?: string;
|
|
89
|
+
labelLgTextTransform?: string;
|
|
90
|
+
labelMdFontSize?: string;
|
|
91
|
+
labelMdFontWeight?: string;
|
|
92
|
+
labelMdTextTransform?: string;
|
|
93
|
+
labelSmFontSize?: string;
|
|
94
|
+
labelSmFontWeight?: string;
|
|
95
|
+
labelSmTextTransform?: string;
|
|
83
96
|
|
|
84
97
|
// Heading Typography
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// Spacing
|
|
102
|
-
spacingScale?: string;
|
|
98
|
+
headingXlFontSize?: string;
|
|
99
|
+
headingXlFontWeight?: string;
|
|
100
|
+
headingXlTextTransform?: string;
|
|
101
|
+
headingLgFontSize?: string;
|
|
102
|
+
headingLgFontWeight?: string;
|
|
103
|
+
headingLgTextTransform?: string;
|
|
104
|
+
headingMdFontSize?: string;
|
|
105
|
+
headingMdFontWeight?: string;
|
|
106
|
+
headingMdTextTransform?: string;
|
|
107
|
+
headingSmFontSize?: string;
|
|
108
|
+
headingSmFontWeight?: string;
|
|
109
|
+
headingSmTextTransform?: string;
|
|
110
|
+
headingXsFontSize?: string;
|
|
111
|
+
headingXsFontWeight?: string;
|
|
112
|
+
headingXsTextTransform?: string;
|
|
103
113
|
};
|
|
104
114
|
|
|
105
115
|
export type IStripeConnectUpdateParams = {
|
|
106
116
|
appearance?: AppearanceOptions;
|
|
107
117
|
};
|
|
108
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Initialization parameters for Connect JS. See https://stripe.com/docs/connect/get-started-connect-embedded-components#configuring-connect-js for more details.
|
|
121
|
+
*/
|
|
109
122
|
export interface IStripeConnectInitParams {
|
|
123
|
+
/**
|
|
124
|
+
* The publishable key for the connected account.
|
|
125
|
+
*/
|
|
110
126
|
publishableKey: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The client secret for the connected account.
|
|
130
|
+
*/
|
|
111
131
|
clientSecret: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Appearance options for the Connect instance.
|
|
135
|
+
* @see https://stripe.com/docs/connect/customize-connect-embedded-components
|
|
136
|
+
*/
|
|
112
137
|
appearance?: AppearanceOptions;
|
|
113
|
-
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Callback function that returns a new client secret. Used to support long running sessions and called on account session expiry.
|
|
141
|
+
*/
|
|
114
142
|
refreshClientSecret?: () => Promise<string>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The locale to use for the Connect instance.
|
|
146
|
+
*/
|
|
115
147
|
locale?: string;
|
|
116
148
|
}
|
|
117
149
|
|
|
@@ -145,6 +177,9 @@ export interface StripeConnectInstance {
|
|
|
145
177
|
logout: () => Promise<void>;
|
|
146
178
|
}
|
|
147
179
|
|
|
180
|
+
/**
|
|
181
|
+
* Tagnames to be used with the `create` method of the Connect instance.
|
|
182
|
+
*/
|
|
148
183
|
export type ConnectElementTagName =
|
|
149
184
|
| "payments"
|
|
150
185
|
| "payouts"
|