@stripe/connect-js 3.4.1-preview-1 → 3.4.2-preview-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/connect.esm.js +10 -10
- package/dist/connect.js +10 -10
- package/dist/pure.esm.js +2 -2
- package/dist/pure.js +2 -2
- package/package.json +3 -3
package/dist/connect.esm.js
CHANGED
|
@@ -157,7 +157,7 @@ const componentNameMapping = connectElementTagNames.reduce((acc, name) => {
|
|
|
157
157
|
acc[name] = `stripe-connect-${name}`;
|
|
158
158
|
return acc;
|
|
159
159
|
}, {});
|
|
160
|
-
let stripePromise = null;
|
|
160
|
+
let stripePromise$1 = null;
|
|
161
161
|
const isWindowStripeConnectDefined = stripeConnect => {
|
|
162
162
|
// We only consider `StripeConnect` defined if `init` is a function
|
|
163
163
|
// Why? HTML markup like:
|
|
@@ -167,10 +167,10 @@ const isWindowStripeConnectDefined = stripeConnect => {
|
|
|
167
167
|
};
|
|
168
168
|
const loadScript = () => {
|
|
169
169
|
// Ensure that we only attempt to load Connect.js at most once
|
|
170
|
-
if (stripePromise !== null) {
|
|
171
|
-
return stripePromise;
|
|
170
|
+
if (stripePromise$1 !== null) {
|
|
171
|
+
return stripePromise$1;
|
|
172
172
|
}
|
|
173
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
173
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
174
174
|
if (typeof window === "undefined") {
|
|
175
175
|
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.");
|
|
176
176
|
return;
|
|
@@ -203,7 +203,7 @@ const loadScript = () => {
|
|
|
203
203
|
reject(error);
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
|
-
return stripePromise;
|
|
206
|
+
return stripePromise$1;
|
|
207
207
|
};
|
|
208
208
|
const hasCustomMethod = tagName => {
|
|
209
209
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -236,7 +236,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
236
236
|
element[method] = function (value) {
|
|
237
237
|
stripeConnectInstance.then(() => {
|
|
238
238
|
if (!this[`${method}InternalOnly`]) {
|
|
239
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.
|
|
239
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.2-preview-1`);
|
|
240
240
|
}
|
|
241
241
|
this[`${method}InternalOnly`](value);
|
|
242
242
|
});
|
|
@@ -290,7 +290,7 @@ const createWrapper = stripeConnect => {
|
|
|
290
290
|
sdk: true,
|
|
291
291
|
sdkOptions: {
|
|
292
292
|
// This will be replaced by the npm package version when bundling
|
|
293
|
-
sdkVersion: "3.4.
|
|
293
|
+
sdkVersion: "3.4.2-preview-1"
|
|
294
294
|
}
|
|
295
295
|
})
|
|
296
296
|
}));
|
|
@@ -302,16 +302,16 @@ const createWrapper = stripeConnect => {
|
|
|
302
302
|
|
|
303
303
|
// Execute our own script injection after a tick to give users time to do their
|
|
304
304
|
// own script injection.
|
|
305
|
-
const stripePromise
|
|
305
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
306
306
|
let loadCalled = false;
|
|
307
|
-
stripePromise
|
|
307
|
+
stripePromise.catch(err => {
|
|
308
308
|
if (!loadCalled) {
|
|
309
309
|
console.warn(err);
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
const loadConnectAndInitialize = initParams => {
|
|
313
313
|
loadCalled = true;
|
|
314
|
-
return initStripeConnect(stripePromise
|
|
314
|
+
return initStripeConnect(stripePromise, initParams);
|
|
315
315
|
};
|
|
316
316
|
|
|
317
317
|
export { ConnectElementCommonMethodConfig, ConnectElementCustomMethodConfig, connectElementTagNames, loadConnectAndInitialize };
|
package/dist/connect.js
CHANGED
|
@@ -161,7 +161,7 @@ const componentNameMapping = connectElementTagNames.reduce((acc, name) => {
|
|
|
161
161
|
acc[name] = `stripe-connect-${name}`;
|
|
162
162
|
return acc;
|
|
163
163
|
}, {});
|
|
164
|
-
let stripePromise = null;
|
|
164
|
+
let stripePromise$1 = null;
|
|
165
165
|
const isWindowStripeConnectDefined = stripeConnect => {
|
|
166
166
|
// We only consider `StripeConnect` defined if `init` is a function
|
|
167
167
|
// Why? HTML markup like:
|
|
@@ -171,10 +171,10 @@ const isWindowStripeConnectDefined = stripeConnect => {
|
|
|
171
171
|
};
|
|
172
172
|
const loadScript = () => {
|
|
173
173
|
// Ensure that we only attempt to load Connect.js at most once
|
|
174
|
-
if (stripePromise !== null) {
|
|
175
|
-
return stripePromise;
|
|
174
|
+
if (stripePromise$1 !== null) {
|
|
175
|
+
return stripePromise$1;
|
|
176
176
|
}
|
|
177
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
177
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
178
178
|
if (typeof window === "undefined") {
|
|
179
179
|
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.");
|
|
180
180
|
return;
|
|
@@ -207,7 +207,7 @@ const loadScript = () => {
|
|
|
207
207
|
reject(error);
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
|
-
return stripePromise;
|
|
210
|
+
return stripePromise$1;
|
|
211
211
|
};
|
|
212
212
|
const hasCustomMethod = tagName => {
|
|
213
213
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -240,7 +240,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
240
240
|
element[method] = function (value) {
|
|
241
241
|
stripeConnectInstance.then(() => {
|
|
242
242
|
if (!this[`${method}InternalOnly`]) {
|
|
243
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.
|
|
243
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.2-preview-1`);
|
|
244
244
|
}
|
|
245
245
|
this[`${method}InternalOnly`](value);
|
|
246
246
|
});
|
|
@@ -294,7 +294,7 @@ const createWrapper = stripeConnect => {
|
|
|
294
294
|
sdk: true,
|
|
295
295
|
sdkOptions: {
|
|
296
296
|
// This will be replaced by the npm package version when bundling
|
|
297
|
-
sdkVersion: "3.4.
|
|
297
|
+
sdkVersion: "3.4.2-preview-1"
|
|
298
298
|
}
|
|
299
299
|
})
|
|
300
300
|
}));
|
|
@@ -306,16 +306,16 @@ const createWrapper = stripeConnect => {
|
|
|
306
306
|
|
|
307
307
|
// Execute our own script injection after a tick to give users time to do their
|
|
308
308
|
// own script injection.
|
|
309
|
-
const stripePromise
|
|
309
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
310
310
|
let loadCalled = false;
|
|
311
|
-
stripePromise
|
|
311
|
+
stripePromise.catch(err => {
|
|
312
312
|
if (!loadCalled) {
|
|
313
313
|
console.warn(err);
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
const loadConnectAndInitialize = initParams => {
|
|
317
317
|
loadCalled = true;
|
|
318
|
-
return initStripeConnect(stripePromise
|
|
318
|
+
return initStripeConnect(stripePromise, initParams);
|
|
319
319
|
};
|
|
320
320
|
|
|
321
321
|
exports.ConnectElementCommonMethodConfig = ConnectElementCommonMethodConfig;
|
package/dist/pure.esm.js
CHANGED
|
@@ -236,7 +236,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
236
236
|
element[method] = function (value) {
|
|
237
237
|
stripeConnectInstance.then(() => {
|
|
238
238
|
if (!this[`${method}InternalOnly`]) {
|
|
239
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.
|
|
239
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.2-preview-1`);
|
|
240
240
|
}
|
|
241
241
|
this[`${method}InternalOnly`](value);
|
|
242
242
|
});
|
|
@@ -290,7 +290,7 @@ const createWrapper = stripeConnect => {
|
|
|
290
290
|
sdk: true,
|
|
291
291
|
sdkOptions: {
|
|
292
292
|
// This will be replaced by the npm package version when bundling
|
|
293
|
-
sdkVersion: "3.4.
|
|
293
|
+
sdkVersion: "3.4.2-preview-1"
|
|
294
294
|
}
|
|
295
295
|
})
|
|
296
296
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -240,7 +240,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
240
240
|
element[method] = function (value) {
|
|
241
241
|
stripeConnectInstance.then(() => {
|
|
242
242
|
if (!this[`${method}InternalOnly`]) {
|
|
243
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.
|
|
243
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.2-preview-1`);
|
|
244
244
|
}
|
|
245
245
|
this[`${method}InternalOnly`](value);
|
|
246
246
|
});
|
|
@@ -294,7 +294,7 @@ const createWrapper = stripeConnect => {
|
|
|
294
294
|
sdk: true,
|
|
295
295
|
sdkOptions: {
|
|
296
296
|
// This will be replaced by the npm package version when bundling
|
|
297
|
-
sdkVersion: "3.4.
|
|
297
|
+
sdkVersion: "3.4.2-preview-1"
|
|
298
298
|
}
|
|
299
299
|
})
|
|
300
300
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2-preview-1",
|
|
4
4
|
"description": "Connect.js loading utility package (preview version)",
|
|
5
5
|
"main": "dist/connect.js",
|
|
6
6
|
"module": "dist/connect.esm.js",
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
"jest-environment-jsdom": "^29.5.0",
|
|
64
64
|
"prettier": "2.8.8",
|
|
65
65
|
"rimraf": "^2.6.2",
|
|
66
|
-
"rollup": "^
|
|
66
|
+
"rollup": "^2.80.0",
|
|
67
67
|
"rollup-plugin-babel": "^4.4.0",
|
|
68
68
|
"rollup-plugin-typescript2": "^0.25.3",
|
|
69
69
|
"ts-jest": "^29.1.0",
|
|
70
70
|
"typescript": "^4.1.2",
|
|
71
71
|
"yalc": "^1.0.0-pre.53",
|
|
72
|
-
"zx": "^
|
|
72
|
+
"zx": "^8.8.5"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {}
|
|
75
75
|
}
|