fontdue-js 2.0.0 → 2.0.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/README.md +17 -0
- package/dist/relay/environment.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
This package exports [Fontdue.js](https://docs.fontdue.com/fontduejs) components for React projects.
|
|
4
4
|
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- `react` >= 18
|
|
8
|
+
- `node` >= 16
|
|
9
|
+
|
|
10
|
+
If using TypeScript, update to >= 4.7 and change your `tsconfig.json` moduleResolution setting to `node16`:
|
|
11
|
+
|
|
12
|
+
``` json
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
"compilerOptions": {
|
|
16
|
+
"moduleResolution": "node16",
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
|
|
5
22
|
## Installation
|
|
6
23
|
|
|
7
24
|
``` shell
|
|
@@ -13,19 +13,19 @@ const FONTDUE_URL = process.env.NEXT_PUBLIC_FONTDUE_URL;
|
|
|
13
13
|
if (IS_SERVER && (FONTDUE_URL == null || FONTDUE_URL === '')) {
|
|
14
14
|
throw new Error('fontdue-js requires a Fontdue URL to be configured via environment variables on the server, please set a NEXT_PUBLIC_FONTDUE_URL');
|
|
15
15
|
}
|
|
16
|
-
const STRIPE_INTEGRATION = process.env.NEXT_PUBLIC_FONTDUE_STRIPE_INTEGRATION
|
|
16
|
+
const STRIPE_INTEGRATION = process.env.NEXT_PUBLIC_FONTDUE_STRIPE_INTEGRATION;
|
|
17
17
|
const CACHE_TTL = 10 * 1000; // 10 seconds, to resolve preloaded results
|
|
18
18
|
|
|
19
19
|
function createNetworkFetch(options) {
|
|
20
20
|
return async function networkFetch(request, variables) {
|
|
21
21
|
const url = (FONTDUE_URL && `${FONTDUE_URL}/graphql`) ?? ((options === null || options === void 0 ? void 0 : options.url) ?? '') + '/graphql';
|
|
22
|
-
const resp = await fetch(url
|
|
22
|
+
const resp = await fetch(url + `?queryName=${request.name}`, {
|
|
23
23
|
method: 'POST',
|
|
24
24
|
credentials: 'include',
|
|
25
25
|
headers: {
|
|
26
26
|
Accept: 'application/json',
|
|
27
27
|
'Content-Type': 'application/json',
|
|
28
|
-
'fontdue-stripe-integration':
|
|
28
|
+
'fontdue-stripe-integration': STRIPE_INTEGRATION ?? ((options === null || options === void 0 ? void 0 : options.stripeIntegration) || 'payment-element')
|
|
29
29
|
},
|
|
30
30
|
body: JSON.stringify({
|
|
31
31
|
query: request.text,
|