@stripe/connect-js 3.0.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
@@ -125,7 +125,7 @@ const createWrapper = stripeConnect => {
125
125
  sdk: true,
126
126
  sdkOptions: {
127
127
  // This will be replaced by the npm package version when bundling
128
- sdkVersion: "3.0.1"
128
+ sdkVersion: "3.1.0"
129
129
  }
130
130
  })
131
131
  }));
package/dist/connect.js CHANGED
@@ -129,7 +129,7 @@ const createWrapper = stripeConnect => {
129
129
  sdk: true,
130
130
  sdkOptions: {
131
131
  // This will be replaced by the npm package version when bundling
132
- sdkVersion: "3.0.1"
132
+ sdkVersion: "3.1.0"
133
133
  }
134
134
  })
135
135
  }));
package/dist/pure.esm.js CHANGED
@@ -125,7 +125,7 @@ const createWrapper = stripeConnect => {
125
125
  sdk: true,
126
126
  sdkOptions: {
127
127
  // This will be replaced by the npm package version when bundling
128
- sdkVersion: "3.0.1"
128
+ sdkVersion: "3.1.0"
129
129
  }
130
130
  })
131
131
  }));
package/dist/pure.js CHANGED
@@ -129,7 +129,7 @@ const createWrapper = stripeConnect => {
129
129
  sdk: true,
130
130
  sdkOptions: {
131
131
  // This will be replaced by the npm package version when bundling
132
- sdkVersion: "3.0.1"
132
+ sdkVersion: "3.1.0"
133
133
  }
134
134
  })
135
135
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.0.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/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
  */
@@ -354,6 +404,11 @@ export interface IStripeConnectInitParams {
354
404
  * The locale to use for the Connect instance.
355
405
  */
356
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>;
357
412
  }
358
413
 
359
414
  type ConnectElementCustomMethods = typeof ConnectElementCustomMethodConfig;
File without changes