@stripe/connect-js 2.0.0 → 2.0.2
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 +7 -7
- package/dist/connect.js +7 -7
- package/dist/pure.esm.js +7 -7
- package/dist/pure.js +7 -7
- package/package.json +1 -1
- package/src/shared.ts +2 -9
- package/types/shared.d.ts +2 -5
package/dist/connect.esm.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
var version = "
|
|
1
|
+
var version = "2.0.2";
|
|
2
2
|
|
|
3
3
|
const componentNameMapping = {
|
|
4
|
-
payments: "stripe-connect-payments",
|
|
5
|
-
payouts: "stripe-connect-payouts",
|
|
6
|
-
"payment-details": "stripe-connect-payment-details",
|
|
7
4
|
"account-onboarding": "stripe-connect-account-onboarding"
|
|
8
5
|
};
|
|
9
6
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
10
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
7
|
+
const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
11
8
|
const findScript = () => {
|
|
12
9
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
|
|
13
10
|
};
|
|
@@ -28,6 +25,10 @@ const loadScript = () => {
|
|
|
28
25
|
return stripePromise;
|
|
29
26
|
}
|
|
30
27
|
stripePromise = new Promise((resolve, reject) => {
|
|
28
|
+
if (typeof window === "undefined") {
|
|
29
|
+
reject("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.");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
31
32
|
if (window.StripeConnect) {
|
|
32
33
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
33
34
|
}
|
|
@@ -78,8 +79,7 @@ const createWrapper = stripeConnect => {
|
|
|
78
79
|
sdkVersion: version
|
|
79
80
|
}
|
|
80
81
|
})
|
|
81
|
-
}))
|
|
82
|
-
console.log(stripeConnectInstance, "lemon");
|
|
82
|
+
}));
|
|
83
83
|
// We wrap create so we can map its different strings to supported components
|
|
84
84
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
85
85
|
stripeConnectInstance.create = tagName => {
|
package/dist/connect.js
CHANGED
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "
|
|
5
|
+
var version = "2.0.2";
|
|
6
6
|
|
|
7
7
|
const componentNameMapping = {
|
|
8
|
-
payments: "stripe-connect-payments",
|
|
9
|
-
payouts: "stripe-connect-payouts",
|
|
10
|
-
"payment-details": "stripe-connect-payment-details",
|
|
11
8
|
"account-onboarding": "stripe-connect-account-onboarding"
|
|
12
9
|
};
|
|
13
10
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
14
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
11
|
+
const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
15
12
|
const findScript = () => {
|
|
16
13
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
|
|
17
14
|
};
|
|
@@ -32,6 +29,10 @@ const loadScript = () => {
|
|
|
32
29
|
return stripePromise;
|
|
33
30
|
}
|
|
34
31
|
stripePromise = new Promise((resolve, reject) => {
|
|
32
|
+
if (typeof window === "undefined") {
|
|
33
|
+
reject("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.");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
35
36
|
if (window.StripeConnect) {
|
|
36
37
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
37
38
|
}
|
|
@@ -82,8 +83,7 @@ const createWrapper = stripeConnect => {
|
|
|
82
83
|
sdkVersion: version
|
|
83
84
|
}
|
|
84
85
|
})
|
|
85
|
-
}))
|
|
86
|
-
console.log(stripeConnectInstance, "lemon");
|
|
86
|
+
}));
|
|
87
87
|
// We wrap create so we can map its different strings to supported components
|
|
88
88
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
89
89
|
stripeConnectInstance.create = tagName => {
|
package/dist/pure.esm.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
var version = "
|
|
1
|
+
var version = "2.0.2";
|
|
2
2
|
|
|
3
3
|
const componentNameMapping = {
|
|
4
|
-
payments: "stripe-connect-payments",
|
|
5
|
-
payouts: "stripe-connect-payouts",
|
|
6
|
-
"payment-details": "stripe-connect-payment-details",
|
|
7
4
|
"account-onboarding": "stripe-connect-account-onboarding"
|
|
8
5
|
};
|
|
9
6
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
10
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
7
|
+
const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
11
8
|
const findScript = () => {
|
|
12
9
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
|
|
13
10
|
};
|
|
@@ -28,6 +25,10 @@ const loadScript = () => {
|
|
|
28
25
|
return stripePromise;
|
|
29
26
|
}
|
|
30
27
|
stripePromise = new Promise((resolve, reject) => {
|
|
28
|
+
if (typeof window === "undefined") {
|
|
29
|
+
reject("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.");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
31
32
|
if (window.StripeConnect) {
|
|
32
33
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
33
34
|
}
|
|
@@ -78,8 +79,7 @@ const createWrapper = stripeConnect => {
|
|
|
78
79
|
sdkVersion: version
|
|
79
80
|
}
|
|
80
81
|
})
|
|
81
|
-
}))
|
|
82
|
-
console.log(stripeConnectInstance, "lemon");
|
|
82
|
+
}));
|
|
83
83
|
// We wrap create so we can map its different strings to supported components
|
|
84
84
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
85
85
|
stripeConnectInstance.create = tagName => {
|
package/dist/pure.js
CHANGED
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "
|
|
5
|
+
var version = "2.0.2";
|
|
6
6
|
|
|
7
7
|
const componentNameMapping = {
|
|
8
|
-
payments: "stripe-connect-payments",
|
|
9
|
-
payouts: "stripe-connect-payouts",
|
|
10
|
-
"payment-details": "stripe-connect-payment-details",
|
|
11
8
|
"account-onboarding": "stripe-connect-account-onboarding"
|
|
12
9
|
};
|
|
13
10
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
14
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
11
|
+
const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
15
12
|
const findScript = () => {
|
|
16
13
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
|
|
17
14
|
};
|
|
@@ -32,6 +29,10 @@ const loadScript = () => {
|
|
|
32
29
|
return stripePromise;
|
|
33
30
|
}
|
|
34
31
|
stripePromise = new Promise((resolve, reject) => {
|
|
32
|
+
if (typeof window === "undefined") {
|
|
33
|
+
reject("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.");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
35
36
|
if (window.StripeConnect) {
|
|
36
37
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
37
38
|
}
|
|
@@ -82,8 +83,7 @@ const createWrapper = stripeConnect => {
|
|
|
82
83
|
sdkVersion: version
|
|
83
84
|
}
|
|
84
85
|
})
|
|
85
|
-
}))
|
|
86
|
-
console.log(stripeConnectInstance, "lemon");
|
|
86
|
+
}));
|
|
87
87
|
// We wrap create so we can map its different strings to supported components
|
|
88
88
|
const oldCreate = stripeConnectInstance.create.bind(stripeConnectInstance);
|
|
89
89
|
stripeConnectInstance.create = tagName => {
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -7,25 +7,18 @@ import {
|
|
|
7
7
|
|
|
8
8
|
export type LoadConnect = () => Promise<StripeConnectWrapper>;
|
|
9
9
|
|
|
10
|
-
type ConnectElementHTMLName =
|
|
11
|
-
| "stripe-connect-payments"
|
|
12
|
-
| "stripe-connect-payouts"
|
|
13
|
-
| "stripe-connect-payment-details"
|
|
14
|
-
| "stripe-connect-account-onboarding";
|
|
10
|
+
type ConnectElementHTMLName = "stripe-connect-account-onboarding";
|
|
15
11
|
|
|
16
12
|
const componentNameMapping: Record<
|
|
17
13
|
ConnectElementTagName,
|
|
18
14
|
ConnectElementHTMLName
|
|
19
15
|
> = {
|
|
20
|
-
payments: "stripe-connect-payments",
|
|
21
|
-
payouts: "stripe-connect-payouts",
|
|
22
|
-
"payment-details": "stripe-connect-payment-details",
|
|
23
16
|
"account-onboarding": "stripe-connect-account-onboarding"
|
|
24
17
|
};
|
|
25
18
|
|
|
26
19
|
const EXISTING_SCRIPT_MESSAGE =
|
|
27
20
|
"loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
28
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
21
|
+
const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
29
22
|
|
|
30
23
|
export const findScript = (): HTMLScriptElement | null => {
|
|
31
24
|
return document.querySelectorAll<HTMLScriptElement>(
|
package/types/shared.d.ts
CHANGED
|
@@ -114,6 +114,7 @@ export declare type AppearanceVariables = {
|
|
|
114
114
|
|
|
115
115
|
export type IStripeConnectUpdateParams = {
|
|
116
116
|
appearance?: AppearanceOptions;
|
|
117
|
+
locale?: string;
|
|
117
118
|
};
|
|
118
119
|
|
|
119
120
|
/**
|
|
@@ -180,11 +181,7 @@ export interface StripeConnectInstance {
|
|
|
180
181
|
/**
|
|
181
182
|
* Tagnames to be used with the `create` method of the Connect instance.
|
|
182
183
|
*/
|
|
183
|
-
export type ConnectElementTagName =
|
|
184
|
-
| "payments"
|
|
185
|
-
| "payouts"
|
|
186
|
-
| "payment-details"
|
|
187
|
-
| "account-onboarding";
|
|
184
|
+
export type ConnectElementTagName = "account-onboarding";
|
|
188
185
|
|
|
189
186
|
export declare const findScript: () => HTMLScriptElement | null;
|
|
190
187
|
|