fontdue-js 2.13.0 → 2.14.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 2.14.0
2
+
3
+ - Adds stripe.appearance to the config
4
+
5
+ ## 2.13.0
6
+
7
+ - Adds the "letter spacing" option to the type tester
8
+ - Type tester now responds to the "autofit" setting set from the backend
9
+ - Simplifies the coupon text input, requiring users to submit it rather than auto submitting when the input blurs. This fixes an issue where the coupon appears to be submitted when it's not.
10
+
11
+ ## 2.12.1
12
+
13
+ - Bug fixes for "share cart"
14
+
1
15
  ## 2.12.0
2
16
 
3
17
  - Adds "share cart" feature
@@ -1,13 +1,18 @@
1
1
  import React from 'react';
2
2
  import { TypeTesterConfig } from './TypeTester';
3
3
  import { StoreModalConfig } from './StoreModal/types';
4
+ import { Appearance } from '@stripe/stripe-js';
4
5
  interface FormConfig {
5
6
  checkboxStyle?: 'check' | 'cross';
6
7
  }
8
+ interface StripeConfig {
9
+ appearance?: Appearance;
10
+ }
7
11
  export interface Config {
8
12
  form?: FormConfig;
9
13
  storeModal?: StoreModalConfig;
10
14
  typeTester?: TypeTesterConfig;
15
+ stripe?: StripeConfig;
11
16
  }
12
17
  export declare const makeConfig: (config?: Config) => {
13
18
  typeTester: {
@@ -64,6 +69,9 @@ export declare const makeConfig: (config?: Config) => {
64
69
  indexExcludeTags: string[] | undefined;
65
70
  productLicensesPosition: "top" | "bottom";
66
71
  };
72
+ stripe: {
73
+ appearance: Appearance | null;
74
+ };
67
75
  };
68
76
  declare const _default: React.Context<{
69
77
  typeTester: {
@@ -120,5 +128,8 @@ declare const _default: React.Context<{
120
128
  indexExcludeTags: string[] | undefined;
121
129
  productLicensesPosition: "top" | "bottom";
122
130
  };
131
+ stripe: {
132
+ appearance: Appearance | null;
133
+ };
123
134
  }>;
124
135
  export default _default;
@@ -54,7 +54,7 @@ const makeTypeTesterConfig = config => {
54
54
  };
55
55
  };
56
56
  const makeConfig = config => {
57
- var _config$form, _config$storeModal, _config$storeModal2, _config$storeModal3;
57
+ var _config$form, _config$storeModal, _config$storeModal2, _config$storeModal3, _config$stripe;
58
58
  return {
59
59
  typeTester: makeTypeTesterConfig(config === null || config === void 0 ? void 0 : config.typeTester),
60
60
  form: {
@@ -64,6 +64,9 @@ const makeConfig = config => {
64
64
  indexLayout: (config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.indexLayout) ?? 'styled-aa',
65
65
  indexExcludeTags: config === null || config === void 0 ? void 0 : (_config$storeModal2 = config.storeModal) === null || _config$storeModal2 === void 0 ? void 0 : _config$storeModal2.indexExcludeTags,
66
66
  productLicensesPosition: (config === null || config === void 0 ? void 0 : (_config$storeModal3 = config.storeModal) === null || _config$storeModal3 === void 0 ? void 0 : _config$storeModal3.productLicensesPosition) ?? 'top'
67
+ },
68
+ stripe: {
69
+ appearance: (config === null || config === void 0 ? void 0 : (_config$stripe = config.stripe) === null || _config$stripe === void 0 ? void 0 : _config$stripe.appearance) ?? null
67
70
  }
68
71
  };
69
72
  };
@@ -11,6 +11,7 @@ var _reactRelay = require("react-relay");
11
11
  var _reactStripeJs = require("@stripe/react-stripe-js");
12
12
  var _stripeJs = require("@stripe/stripe-js");
13
13
  var _utils = require("../../utils");
14
+ var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
14
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -72,8 +73,11 @@ const StripeProvider = _ref => {
72
73
  });
73
74
  });
74
75
  }, [environment]);
76
+ const {
77
+ stripe: config
78
+ } = (0, _react.useContext)(_ConfigContext.default);
75
79
  const options = {
76
- appearance: {
80
+ appearance: config.appearance ?? {
77
81
  theme: 'flat',
78
82
  variables: {
79
83
  borderRadius: '0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontdue-js",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "scripts": {
5
5
  "build": "npm run relay && run-p build-js build-css build-ts",
6
6
  "build-js": "babel src --out-dir dist --extensions .ts,.tsx,.js,.jsx",