@stripe/connect-js 3.1.0-beta.1 → 3.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/README.md CHANGED
@@ -60,17 +60,6 @@ script tag is inserted immediately upon page load.
60
60
  import "@stripe/connect-js";
61
61
  ```
62
62
 
63
- ### Manually include the script tag
64
-
65
- Manually add the Connect.js script tag to the `<head>` of each page on your site.
66
- If an existing script tag is already present, this module will not insert a new
67
- one. When you call `loadConnectAndInitialize`, it will use the existing script tag.
68
-
69
- ```html
70
- <!-- Somewhere in your site's <head> -->
71
- <script src="https://connect-js.stripe.com/v0.1/connect.js" async></script>
72
- ```
73
-
74
63
  ### Importing `loadConnectAndInitialize` without side effects
75
64
 
76
65
  If you would like to use `loadConnectAndInitialize` in your application, but defer loading the
@@ -1,41 +1,20 @@
1
1
  /* eslint-disable @typescript-eslint/no-empty-function */
2
2
  /* eslint-disable @typescript-eslint/no-unused-vars */
3
3
  const ConnectElementCustomMethodConfig = {
4
- "payment-details": {
5
- setPayment: payment => {},
6
- setOnClose: listener => {}
7
- },
8
4
  "account-onboarding": {
9
5
  setFullTermsOfServiceUrl: termOfServiceUrl => {},
10
6
  setRecipientTermsOfServiceUrl: recipientTermsOfServiceUrl => {},
11
7
  setPrivacyPolicyUrl: privacyPolicyUrl => {},
12
8
  setSkipTermsOfServiceCollection: skipTermsOfServiceCollection => {},
13
9
  setOnExit: listener => {}
14
- },
15
- "issuing-card": {
16
- setDefaultCard: defaultCard => {},
17
- setCardArtFileLink: cardArtFileLink => {},
18
- setCardSwitching: cardSwitching => {}
19
- },
20
- "issuing-cards-list": {
21
- setCardArtFileLink: cardArtFileLink => {}
22
10
  }
23
11
  };
24
12
 
25
13
  const componentNameMapping = {
26
- payments: "stripe-connect-payments",
27
- payouts: "stripe-connect-payouts",
28
- "payment-details": "stripe-connect-payment-details",
29
- "account-onboarding": "stripe-connect-account-onboarding",
30
- "payment-method-settings": "stripe-connect-payment-method-settings",
31
- "account-management": "stripe-connect-account-management",
32
- "notification-banner": "stripe-connect-notification-banner",
33
- "instant-payouts": "stripe-connect-instant-payouts",
34
- "issuing-card": "stripe-connect-issuing-card",
35
- "issuing-cards-list": "stripe-connect-issuing-cards-list"
14
+ "account-onboarding": "stripe-connect-account-onboarding"
36
15
  };
37
16
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
38
- const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
17
+ const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
39
18
  const findScript = () => {
40
19
  return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
41
20
  };
@@ -146,7 +125,7 @@ const createWrapper = stripeConnect => {
146
125
  sdk: true,
147
126
  sdkOptions: {
148
127
  // This will be replaced by the npm package version when bundling
149
- sdkVersion: "3.1.0-beta.1"
128
+ sdkVersion: "3.1.0"
150
129
  }
151
130
  })
152
131
  }));
package/dist/connect.js CHANGED
@@ -5,41 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  /* eslint-disable @typescript-eslint/no-empty-function */
6
6
  /* eslint-disable @typescript-eslint/no-unused-vars */
7
7
  const ConnectElementCustomMethodConfig = {
8
- "payment-details": {
9
- setPayment: payment => {},
10
- setOnClose: listener => {}
11
- },
12
8
  "account-onboarding": {
13
9
  setFullTermsOfServiceUrl: termOfServiceUrl => {},
14
10
  setRecipientTermsOfServiceUrl: recipientTermsOfServiceUrl => {},
15
11
  setPrivacyPolicyUrl: privacyPolicyUrl => {},
16
12
  setSkipTermsOfServiceCollection: skipTermsOfServiceCollection => {},
17
13
  setOnExit: listener => {}
18
- },
19
- "issuing-card": {
20
- setDefaultCard: defaultCard => {},
21
- setCardArtFileLink: cardArtFileLink => {},
22
- setCardSwitching: cardSwitching => {}
23
- },
24
- "issuing-cards-list": {
25
- setCardArtFileLink: cardArtFileLink => {}
26
14
  }
27
15
  };
28
16
 
29
17
  const componentNameMapping = {
30
- payments: "stripe-connect-payments",
31
- payouts: "stripe-connect-payouts",
32
- "payment-details": "stripe-connect-payment-details",
33
- "account-onboarding": "stripe-connect-account-onboarding",
34
- "payment-method-settings": "stripe-connect-payment-method-settings",
35
- "account-management": "stripe-connect-account-management",
36
- "notification-banner": "stripe-connect-notification-banner",
37
- "instant-payouts": "stripe-connect-instant-payouts",
38
- "issuing-card": "stripe-connect-issuing-card",
39
- "issuing-cards-list": "stripe-connect-issuing-cards-list"
18
+ "account-onboarding": "stripe-connect-account-onboarding"
40
19
  };
41
20
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
42
- const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
21
+ const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
43
22
  const findScript = () => {
44
23
  return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
45
24
  };
@@ -150,7 +129,7 @@ const createWrapper = stripeConnect => {
150
129
  sdk: true,
151
130
  sdkOptions: {
152
131
  // This will be replaced by the npm package version when bundling
153
- sdkVersion: "3.1.0-beta.1"
132
+ sdkVersion: "3.1.0"
154
133
  }
155
134
  })
156
135
  }));
package/dist/pure.esm.js CHANGED
@@ -1,41 +1,20 @@
1
1
  /* eslint-disable @typescript-eslint/no-empty-function */
2
2
  /* eslint-disable @typescript-eslint/no-unused-vars */
3
3
  const ConnectElementCustomMethodConfig = {
4
- "payment-details": {
5
- setPayment: payment => {},
6
- setOnClose: listener => {}
7
- },
8
4
  "account-onboarding": {
9
5
  setFullTermsOfServiceUrl: termOfServiceUrl => {},
10
6
  setRecipientTermsOfServiceUrl: recipientTermsOfServiceUrl => {},
11
7
  setPrivacyPolicyUrl: privacyPolicyUrl => {},
12
8
  setSkipTermsOfServiceCollection: skipTermsOfServiceCollection => {},
13
9
  setOnExit: listener => {}
14
- },
15
- "issuing-card": {
16
- setDefaultCard: defaultCard => {},
17
- setCardArtFileLink: cardArtFileLink => {},
18
- setCardSwitching: cardSwitching => {}
19
- },
20
- "issuing-cards-list": {
21
- setCardArtFileLink: cardArtFileLink => {}
22
10
  }
23
11
  };
24
12
 
25
13
  const componentNameMapping = {
26
- payments: "stripe-connect-payments",
27
- payouts: "stripe-connect-payouts",
28
- "payment-details": "stripe-connect-payment-details",
29
- "account-onboarding": "stripe-connect-account-onboarding",
30
- "payment-method-settings": "stripe-connect-payment-method-settings",
31
- "account-management": "stripe-connect-account-management",
32
- "notification-banner": "stripe-connect-notification-banner",
33
- "instant-payouts": "stripe-connect-instant-payouts",
34
- "issuing-card": "stripe-connect-issuing-card",
35
- "issuing-cards-list": "stripe-connect-issuing-cards-list"
14
+ "account-onboarding": "stripe-connect-account-onboarding"
36
15
  };
37
16
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
38
- const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
17
+ const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
39
18
  const findScript = () => {
40
19
  return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
41
20
  };
@@ -146,7 +125,7 @@ const createWrapper = stripeConnect => {
146
125
  sdk: true,
147
126
  sdkOptions: {
148
127
  // This will be replaced by the npm package version when bundling
149
- sdkVersion: "3.1.0-beta.1"
128
+ sdkVersion: "3.1.0"
150
129
  }
151
130
  })
152
131
  }));
package/dist/pure.js CHANGED
@@ -5,41 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  /* eslint-disable @typescript-eslint/no-empty-function */
6
6
  /* eslint-disable @typescript-eslint/no-unused-vars */
7
7
  const ConnectElementCustomMethodConfig = {
8
- "payment-details": {
9
- setPayment: payment => {},
10
- setOnClose: listener => {}
11
- },
12
8
  "account-onboarding": {
13
9
  setFullTermsOfServiceUrl: termOfServiceUrl => {},
14
10
  setRecipientTermsOfServiceUrl: recipientTermsOfServiceUrl => {},
15
11
  setPrivacyPolicyUrl: privacyPolicyUrl => {},
16
12
  setSkipTermsOfServiceCollection: skipTermsOfServiceCollection => {},
17
13
  setOnExit: listener => {}
18
- },
19
- "issuing-card": {
20
- setDefaultCard: defaultCard => {},
21
- setCardArtFileLink: cardArtFileLink => {},
22
- setCardSwitching: cardSwitching => {}
23
- },
24
- "issuing-cards-list": {
25
- setCardArtFileLink: cardArtFileLink => {}
26
14
  }
27
15
  };
28
16
 
29
17
  const componentNameMapping = {
30
- payments: "stripe-connect-payments",
31
- payouts: "stripe-connect-payouts",
32
- "payment-details": "stripe-connect-payment-details",
33
- "account-onboarding": "stripe-connect-account-onboarding",
34
- "payment-method-settings": "stripe-connect-payment-method-settings",
35
- "account-management": "stripe-connect-account-management",
36
- "notification-banner": "stripe-connect-notification-banner",
37
- "instant-payouts": "stripe-connect-instant-payouts",
38
- "issuing-card": "stripe-connect-issuing-card",
39
- "issuing-cards-list": "stripe-connect-issuing-cards-list"
18
+ "account-onboarding": "stripe-connect-account-onboarding"
40
19
  };
41
20
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
42
- const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
21
+ const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
43
22
  const findScript = () => {
44
23
  return document.querySelectorAll(`script[src="${V0_URL}"]`)[0];
45
24
  };
@@ -150,7 +129,7 @@ const createWrapper = stripeConnect => {
150
129
  sdk: true,
151
130
  sdkOptions: {
152
131
  // This will be replaced by the npm package version when bundling
153
- sdkVersion: "3.1.0-beta.1"
132
+ sdkVersion: "3.1.0"
154
133
  }
155
134
  })
156
135
  }));
@@ -1,6 +1,6 @@
1
1
  import { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
2
2
  export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
3
- export type ConnectElementHTMLName = "stripe-connect-payments" | "stripe-connect-payouts" | "stripe-connect-payment-details" | "stripe-connect-account-onboarding" | "stripe-connect-payment-method-settings" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-instant-payouts" | "stripe-connect-issuing-card" | "stripe-connect-issuing-cards-list";
3
+ type ConnectElementHTMLName = "stripe-connect-account-onboarding";
4
4
  export declare const componentNameMapping: Record<ConnectElementTagName, ConnectElementHTMLName>;
5
5
  type StripeConnectInstanceExtended = StripeConnectInstance & {
6
6
  debugInstance: () => Promise<StripeConnectInstance>;
@@ -1,8 +1,4 @@
1
1
  export declare const ConnectElementCustomMethodConfig: {
2
- "payment-details": {
3
- setPayment: (payment: string | undefined) => void;
4
- setOnClose: (listener: (() => void) | undefined) => void;
5
- };
6
2
  "account-onboarding": {
7
3
  setFullTermsOfServiceUrl: (termOfServiceUrl: string | undefined) => void;
8
4
  setRecipientTermsOfServiceUrl: (recipientTermsOfServiceUrl: string | undefined) => void;
@@ -10,12 +6,4 @@ export declare const ConnectElementCustomMethodConfig: {
10
6
  setSkipTermsOfServiceCollection: (skipTermsOfServiceCollection: boolean | undefined) => void;
11
7
  setOnExit: (listener: (() => void) | undefined) => void;
12
8
  };
13
- "issuing-card": {
14
- setDefaultCard: (defaultCard: string | undefined) => void;
15
- setCardArtFileLink: (cardArtFileLink: string | undefined) => void;
16
- setCardSwitching: (cardSwitching: boolean | undefined) => void;
17
- };
18
- "issuing-cards-list": {
19
- setCardArtFileLink: (cardArtFileLink: string | undefined) => void;
20
- };
21
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.1.0-beta.1",
3
+ "version": "3.1.0",
4
4
  "description": "Connect.js loading utility package",
5
5
  "main": "dist/connect.js",
6
6
  "module": "dist/connect.esm.js",
package/src/shared.ts CHANGED
@@ -10,32 +10,13 @@ export type LoadConnectAndInitialize = (
10
10
  initParams: IStripeConnectInitParams
11
11
  ) => StripeConnectInstance;
12
12
 
13
- export type ConnectElementHTMLName =
14
- | "stripe-connect-payments"
15
- | "stripe-connect-payouts"
16
- | "stripe-connect-payment-details"
17
- | "stripe-connect-account-onboarding"
18
- | "stripe-connect-payment-method-settings"
19
- | "stripe-connect-account-management"
20
- | "stripe-connect-notification-banner"
21
- | "stripe-connect-instant-payouts"
22
- | "stripe-connect-issuing-card"
23
- | "stripe-connect-issuing-cards-list";
13
+ type ConnectElementHTMLName = "stripe-connect-account-onboarding";
24
14
 
25
15
  export const componentNameMapping: Record<
26
16
  ConnectElementTagName,
27
17
  ConnectElementHTMLName
28
18
  > = {
29
- payments: "stripe-connect-payments",
30
- payouts: "stripe-connect-payouts",
31
- "payment-details": "stripe-connect-payment-details",
32
- "account-onboarding": "stripe-connect-account-onboarding",
33
- "payment-method-settings": "stripe-connect-payment-method-settings",
34
- "account-management": "stripe-connect-account-management",
35
- "notification-banner": "stripe-connect-notification-banner",
36
- "instant-payouts": "stripe-connect-instant-payouts",
37
- "issuing-card": "stripe-connect-issuing-card",
38
- "issuing-cards-list": "stripe-connect-issuing-cards-list"
19
+ "account-onboarding": "stripe-connect-account-onboarding"
39
20
  };
40
21
 
41
22
  type StripeConnectInstanceExtended = StripeConnectInstance & {
@@ -48,7 +29,7 @@ interface StripeConnectWrapper {
48
29
 
49
30
  const EXISTING_SCRIPT_MESSAGE =
50
31
  "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
51
- const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
32
+ const V0_URL = "https://connect-js.stripe.com/v1.0/connect.js";
52
33
 
53
34
  export const findScript = (): HTMLScriptElement | null => {
54
35
  return document.querySelectorAll<HTMLScriptElement>(
package/types/config.ts CHANGED
@@ -4,10 +4,6 @@ import { ConnectElementTagName } from "./shared.d";
4
4
  /* eslint-disable @typescript-eslint/no-unused-vars */
5
5
 
6
6
  export const ConnectElementCustomMethodConfig = {
7
- "payment-details": {
8
- setPayment: (payment: string | undefined): void => {},
9
- setOnClose: (listener: (() => void) | undefined): void => {}
10
- },
11
7
  "account-onboarding": {
12
8
  setFullTermsOfServiceUrl: (
13
9
  termOfServiceUrl: string | undefined
@@ -20,14 +16,6 @@ export const ConnectElementCustomMethodConfig = {
20
16
  skipTermsOfServiceCollection: boolean | undefined
21
17
  ): void => {},
22
18
  setOnExit: (listener: (() => void) | undefined): void => {}
23
- },
24
- "issuing-card": {
25
- setDefaultCard: (defaultCard: string | undefined): void => {},
26
- setCardArtFileLink: (cardArtFileLink: string | undefined): void => {},
27
- setCardSwitching: (cardSwitching: boolean | undefined): void => {}
28
- },
29
- "issuing-cards-list": {
30
- setCardArtFileLink: (cardArtFileLink: string | undefined): void => {}
31
19
  }
32
20
  };
33
21
 
package/types/shared.d.ts CHANGED
@@ -6,6 +6,56 @@ export declare type LoadConnectAndInitialize = (
6
6
 
7
7
  export declare type OverlayOption = "dialog" | "drawer";
8
8
 
9
+ /*
10
+ * Use a `CssFontSource` to pass custom fonts via a stylesheet URL when initializing a Connect instance.
11
+ */
12
+ export declare type CssFontSource = {
13
+ /**
14
+ * A relative or absolute URL pointing to a CSS file with [@font-face](https://developer.mozilla.org/en/docs/Web/CSS/@font-face) definitions, for example:
15
+ *
16
+ * https://fonts.googleapis.com/css?family=Open+Sans
17
+ *
18
+ * Note that if you are using a [content security policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) (CSP), [additional directives](https://stripe.com/docs/security#content-security-policy) may be necessary.
19
+ */
20
+ cssSrc: string;
21
+ };
22
+
23
+ /*
24
+ * Use a `CustomFontSource` to pass custom fonts when initializing a Connect instance.
25
+ */
26
+ export declare type CustomFontSource = {
27
+ /**
28
+ * The name to give the font
29
+ */
30
+ family: string;
31
+
32
+ /**
33
+ * A valid [src](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src) value pointing to your custom font file.
34
+ * This is usually (though not always) a link to a file with a `.woff` , `.otf`, or `.svg` suffix.
35
+ */
36
+ src: string;
37
+
38
+ /**
39
+ * A valid [font-display](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display) value.
40
+ */
41
+ display?: string;
42
+
43
+ /**
44
+ * Defaults to `normal`.
45
+ */
46
+ style?: "normal" | "italic" | "oblique";
47
+
48
+ /**
49
+ * A valid [unicode-range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range) value.
50
+ */
51
+ unicodeRange?: string;
52
+
53
+ /**
54
+ * A valid [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight), as a string.
55
+ */
56
+ weight?: string;
57
+ };
58
+
9
59
  /**
10
60
  * Appearance options for the Connect instance.
11
61
  */
@@ -211,14 +261,6 @@ export declare type AppearanceVariables = {
211
261
  overlayZIndex?: number;
212
262
 
213
263
  // Body Typography
214
- /**
215
- * The font size for the large body typography. Body typography variables accept a valid font size value.
216
- */
217
- bodyLgFontSize?: string;
218
- /**
219
- * The font weight for the large body typography. Body typography variables accept a valid font weight value.
220
- */
221
- bodyLgFontWeight?: string;
222
264
  /**
223
265
  * The font size for the medium body typography. Body typography variables accept a valid font size value.
224
266
  */
@@ -299,18 +341,6 @@ export declare type AppearanceVariables = {
299
341
  headingXsTextTransform?: string;
300
342
 
301
343
  // Label Typography
302
- /**
303
- * The font size for the large label typography. Label typography variables accept a valid font size value.
304
- */
305
- labelLgFontSize?: string;
306
- /**
307
- * The font weight for the large label typography. Label typography variables accept a valid font weight value.
308
- */
309
- labelLgFontWeight?: string;
310
- /**
311
- * The text transform for the large label typography. Label typography variables accept a valid text transform value.
312
- */
313
- labelLgTextTransform?: string;
314
344
  /**
315
345
  * The font size for the medium label typography. Label typography variables accept a valid font size value.
316
346
  */
@@ -374,6 +404,11 @@ export interface IStripeConnectInitParams {
374
404
  * The locale to use for the Connect instance.
375
405
  */
376
406
  locale?: string;
407
+
408
+ /**
409
+ * An array of custom fonts, which embedded components created from a ConnectInstance can use.
410
+ */
411
+ fonts?: Array<CssFontSource | CustomFontSource>;
377
412
  }
378
413
 
379
414
  type ConnectElementCustomMethods = typeof ConnectElementCustomMethodConfig;
@@ -411,14 +446,4 @@ export interface StripeConnectInstance {
411
446
  /**
412
447
  * Tagnames to be used with the `create` method of the Connect instance.
413
448
  */
414
- export type ConnectElementTagName =
415
- | "payments"
416
- | "payouts"
417
- | "payment-details"
418
- | "account-onboarding"
419
- | "payment-method-settings"
420
- | "account-management"
421
- | "notification-banner"
422
- | "instant-payouts"
423
- | "issuing-card"
424
- | "issuing-cards-list";
449
+ export type ConnectElementTagName = "account-onboarding";
File without changes