fontdue-js 3.0.0-alpha6 → 3.0.0-alpha8
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/__generated__/orderTrackingUpdateOrderTrackingMutation.graphql.d.ts +27 -0
- package/dist/__generated__/orderTrackingUpdateOrderTrackingMutation.graphql.js +72 -0
- package/dist/__tests__/nextAdapter.test.js +307 -0
- package/dist/components/BuyButton/index.js +8 -2
- package/dist/components/Cart/orderTracking.d.ts +10 -0
- package/dist/components/Cart/orderTracking.js +43 -0
- package/dist/components/CartButton/index.js +16 -4
- package/dist/components/CharacterViewer/index.js +8 -2
- package/dist/components/CustomerLoginForm/index.js +17 -9
- package/dist/components/FontdueProvider/index.d.ts +10 -1
- package/dist/components/FontdueProvider/index.js +1 -0
- package/dist/components/FontdueProvider/index.server.d.ts +2 -1
- package/dist/components/FontdueProvider/index.server.js +16 -0
- package/dist/components/NewsletterSignup/index.js +4 -1
- package/dist/components/TestFontsForm/index.js +4 -1
- package/dist/components/TypeTesters/index.js +8 -2
- package/dist/next/config.d.ts +45 -0
- package/dist/next/config.js +180 -0
- package/dist/next/image-loader.d.ts +7 -0
- package/dist/next/image-loader.js +39 -0
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +10 -0
- package/dist/next/revalidate.d.ts +1 -0
- package/dist/next/revalidate.js +37 -0
- package/dist/next/tenant.d.ts +18 -0
- package/dist/next/tenant.js +105 -0
- package/dist/relay/environment.js +10 -4
- package/dist/relay/loadSerializableQuery.d.ts +3 -1
- package/dist/relay/loadSerializableQuery.js +2 -2
- package/dist/relay/serverConfig.d.ts +10 -0
- package/dist/relay/serverConfig.js +38 -0
- package/dist/vite.js +2 -0
- package/package.json +5 -1
- package/types/next-cache.d.ts +6 -0
- package/dist/__generated__/TypeTesterStyleSelectData_viewer.graphql.d.ts +0 -42
- package/dist/__generated__/TypeTesterStyleSelectData_viewer.graphql.js +0 -166
- package/dist/__generated__/TypeTester_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/TypeTester_viewer.graphql.js +0 -40
- package/dist/__generated__/TypeTesters_viewer.graphql.d.ts +0 -17
- package/dist/__generated__/TypeTesters_viewer.graphql.js +0 -40
- package/dist/components/FontdueContextProvider/index.server.d.ts +0 -4
- package/dist/components/FontdueContextProvider/index.server.js +0 -7
- package/dist/components/FontdueProvider/useAuxUIOwner.d.ts +0 -1
- package/dist/components/FontdueProvider/useAuxUIOwner.js +0 -28
- package/dist/components/TypeTester/TypeTesterStandalone.preload.d.ts +0 -14
- package/dist/components/TypeTester/TypeTesterStandalone.preload.js +0 -20
- package/dist/config.d.ts +0 -7
- package/dist/config.js +0 -31
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Per-render configuration for server-side GraphQL fetches.
|
|
2
|
+
//
|
|
3
|
+
// React Server Components have no context API, so a `<FontdueProvider url=…>`
|
|
4
|
+
// prop cannot reach the nested server components that preload queries — the
|
|
5
|
+
// prop historically only configured client-side fetches. What RSC does have
|
|
6
|
+
// is React.cache(): a memoization store scoped to one server render pass and
|
|
7
|
+
// shared by every server component in it. We use a single cache cell as a
|
|
8
|
+
// render-scoped mutable slot: the host app (or the FontdueProvider server
|
|
9
|
+
// entrypoint) writes the config early in the render, and every later
|
|
10
|
+
// server-side fetch in the same pass reads it.
|
|
11
|
+
//
|
|
12
|
+
// Unlike AsyncLocalStorage-based approaches (e.g. Next's headers()), reading
|
|
13
|
+
// this store does not opt the route into dynamic rendering, so static
|
|
14
|
+
// generation and ISR keep working. Each render pass gets a fresh store, so
|
|
15
|
+
// concurrent requests cannot leak config into each other.
|
|
16
|
+
//
|
|
17
|
+
// Caveat that callers must own: the write has to happen in the same render
|
|
18
|
+
// pass, before the fetch. A provider in a layout covers full-page renders,
|
|
19
|
+
// but an App Router soft navigation re-renders only the page segment — set
|
|
20
|
+
// the config at the top of each page (or in a shared data helper every page
|
|
21
|
+
// calls) when pages contain Fontdue components.
|
|
22
|
+
//
|
|
23
|
+
// Outside an RSC render (client bundles, SSR setups without React.cache
|
|
24
|
+
// semantics) the slot degrades to a throwaway object: writes become no-ops
|
|
25
|
+
// and the environment variables remain the configuration source.
|
|
26
|
+
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
const getSlot = typeof React.cache === 'function' ? React.cache(() => ({
|
|
29
|
+
current: undefined
|
|
30
|
+
})) : () => ({
|
|
31
|
+
current: undefined
|
|
32
|
+
});
|
|
33
|
+
export function setFontdueServerConfig(config) {
|
|
34
|
+
getSlot().current = config;
|
|
35
|
+
}
|
|
36
|
+
export function getFontdueServerConfig() {
|
|
37
|
+
return getSlot().current;
|
|
38
|
+
}
|
package/dist/vite.js
CHANGED
|
@@ -79,7 +79,9 @@ function getFontdueJsSubpaths() {
|
|
|
79
79
|
for (const key of Object.keys(pkg.exports ?? {})) {
|
|
80
80
|
if (!key.startsWith('./')) continue;
|
|
81
81
|
if (key.endsWith('.css')) continue;
|
|
82
|
+
// Build-config and server-only entrypoints never reach a browser bundle.
|
|
82
83
|
if (key === './vite') continue;
|
|
84
|
+
if (key === './next' || key.startsWith('./next/')) continue;
|
|
83
85
|
out.push(`fontdue-js/${key.slice(2)}`);
|
|
84
86
|
}
|
|
85
87
|
return out;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fontdue-js",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-alpha8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run relay && run-p build-js build-css build-ts",
|
|
@@ -82,6 +82,10 @@
|
|
|
82
82
|
},
|
|
83
83
|
"exports": {
|
|
84
84
|
".": "./dist/index.js",
|
|
85
|
+
"./next": "./dist/next/index.js",
|
|
86
|
+
"./next/config": "./dist/next/config.js",
|
|
87
|
+
"./next/revalidate": "./dist/next/revalidate.js",
|
|
88
|
+
"./next/image-loader": "./dist/next/image-loader.js",
|
|
85
89
|
"./fontdue.css": "./dist/fontdue.css",
|
|
86
90
|
"./BuyButton": {
|
|
87
91
|
"react-server": "./dist/components/BuyButton/index.server.js",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Minimal declaration so src/next/revalidate.ts type-checks without `next`
|
|
2
|
+
// installed (it's the host app's dependency; this package only ever runs the
|
|
3
|
+
// import inside a Next.js server).
|
|
4
|
+
declare module 'next/cache' {
|
|
5
|
+
export function revalidateTag(tag: string): void;
|
|
6
|
+
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated SignedSource<<de2a1d20c5692c0b9d1b3fb9726732b0>>
|
|
3
|
-
* @lightSyntaxTransform
|
|
4
|
-
* @nogrep
|
|
5
|
-
*/
|
|
6
|
-
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
-
import { FragmentRefs } from "relay-runtime";
|
|
8
|
-
export type TypeTesterStyleSelectData_viewer$data = {
|
|
9
|
-
readonly families?: {
|
|
10
|
-
readonly edges: ReadonlyArray<{
|
|
11
|
-
readonly node: {
|
|
12
|
-
readonly featureStyle: {
|
|
13
|
-
readonly supportedLanguages: ReadonlyArray<string> | null;
|
|
14
|
-
} | null;
|
|
15
|
-
readonly fontStyles: ReadonlyArray<{
|
|
16
|
-
readonly cssStretch: string | null;
|
|
17
|
-
readonly cssStyle: string | null;
|
|
18
|
-
readonly cssWeight: string | null;
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly variableInstances: ReadonlyArray<{
|
|
22
|
-
readonly coordinates: ReadonlyArray<{
|
|
23
|
-
readonly axis: string;
|
|
24
|
-
readonly value: number;
|
|
25
|
-
}>;
|
|
26
|
-
readonly name: string;
|
|
27
|
-
}> | null;
|
|
28
|
-
}>;
|
|
29
|
-
readonly id: string;
|
|
30
|
-
readonly isVariableFont: boolean;
|
|
31
|
-
readonly name: string;
|
|
32
|
-
} | null;
|
|
33
|
-
} | null> | null;
|
|
34
|
-
} | null;
|
|
35
|
-
readonly " $fragmentType": "TypeTesterStyleSelectData_viewer";
|
|
36
|
-
};
|
|
37
|
-
export type TypeTesterStyleSelectData_viewer$key = {
|
|
38
|
-
readonly " $data"?: TypeTesterStyleSelectData_viewer$data;
|
|
39
|
-
readonly " $fragmentSpreads": FragmentRefs<"TypeTesterStyleSelectData_viewer">;
|
|
40
|
-
};
|
|
41
|
-
declare const node: ReaderFragment;
|
|
42
|
-
export default node;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @generated SignedSource<<de2a1d20c5692c0b9d1b3fb9726732b0>>
|
|
9
|
-
* @lightSyntaxTransform
|
|
10
|
-
* @nogrep
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/* tslint:disable */
|
|
14
|
-
/* eslint-disable */
|
|
15
|
-
// @ts-nocheck
|
|
16
|
-
|
|
17
|
-
const node = function () {
|
|
18
|
-
var v0 = {
|
|
19
|
-
"alias": null,
|
|
20
|
-
"args": null,
|
|
21
|
-
"kind": "ScalarField",
|
|
22
|
-
"name": "id",
|
|
23
|
-
"storageKey": null
|
|
24
|
-
},
|
|
25
|
-
v1 = {
|
|
26
|
-
"alias": null,
|
|
27
|
-
"args": null,
|
|
28
|
-
"kind": "ScalarField",
|
|
29
|
-
"name": "name",
|
|
30
|
-
"storageKey": null
|
|
31
|
-
};
|
|
32
|
-
return {
|
|
33
|
-
"argumentDefinitions": [{
|
|
34
|
-
"defaultValue": true,
|
|
35
|
-
"kind": "LocalArgument",
|
|
36
|
-
"name": "selectable"
|
|
37
|
-
}],
|
|
38
|
-
"kind": "Fragment",
|
|
39
|
-
"metadata": null,
|
|
40
|
-
"name": "TypeTesterStyleSelectData_viewer",
|
|
41
|
-
"selections": [{
|
|
42
|
-
"condition": "selectable",
|
|
43
|
-
"kind": "Condition",
|
|
44
|
-
"passingValue": true,
|
|
45
|
-
"selections": [{
|
|
46
|
-
"alias": "families",
|
|
47
|
-
"args": [{
|
|
48
|
-
"kind": "Literal",
|
|
49
|
-
"name": "collectionTypes",
|
|
50
|
-
"value": ["FAMILY"]
|
|
51
|
-
}, {
|
|
52
|
-
"kind": "Literal",
|
|
53
|
-
"name": "first",
|
|
54
|
-
"value": 999
|
|
55
|
-
}],
|
|
56
|
-
"concreteType": "FontCollectionConnection",
|
|
57
|
-
"kind": "LinkedField",
|
|
58
|
-
"name": "fontCollections",
|
|
59
|
-
"plural": false,
|
|
60
|
-
"selections": [{
|
|
61
|
-
"alias": null,
|
|
62
|
-
"args": null,
|
|
63
|
-
"concreteType": "FontCollectionEdge",
|
|
64
|
-
"kind": "LinkedField",
|
|
65
|
-
"name": "edges",
|
|
66
|
-
"plural": true,
|
|
67
|
-
"selections": [{
|
|
68
|
-
"alias": null,
|
|
69
|
-
"args": null,
|
|
70
|
-
"concreteType": "FontCollection",
|
|
71
|
-
"kind": "LinkedField",
|
|
72
|
-
"name": "node",
|
|
73
|
-
"plural": false,
|
|
74
|
-
"selections": [v0 /*: any*/, v1 /*: any*/, {
|
|
75
|
-
"alias": null,
|
|
76
|
-
"args": null,
|
|
77
|
-
"kind": "ScalarField",
|
|
78
|
-
"name": "isVariableFont",
|
|
79
|
-
"storageKey": null
|
|
80
|
-
}, {
|
|
81
|
-
"alias": null,
|
|
82
|
-
"args": null,
|
|
83
|
-
"concreteType": "FontStyle",
|
|
84
|
-
"kind": "LinkedField",
|
|
85
|
-
"name": "featureStyle",
|
|
86
|
-
"plural": false,
|
|
87
|
-
"selections": [{
|
|
88
|
-
"alias": null,
|
|
89
|
-
"args": null,
|
|
90
|
-
"kind": "ScalarField",
|
|
91
|
-
"name": "supportedLanguages",
|
|
92
|
-
"storageKey": null
|
|
93
|
-
}],
|
|
94
|
-
"storageKey": null
|
|
95
|
-
}, {
|
|
96
|
-
"alias": null,
|
|
97
|
-
"args": null,
|
|
98
|
-
"concreteType": "FontStyle",
|
|
99
|
-
"kind": "LinkedField",
|
|
100
|
-
"name": "fontStyles",
|
|
101
|
-
"plural": true,
|
|
102
|
-
"selections": [v0 /*: any*/, v1 /*: any*/, {
|
|
103
|
-
"alias": null,
|
|
104
|
-
"args": null,
|
|
105
|
-
"kind": "ScalarField",
|
|
106
|
-
"name": "cssWeight",
|
|
107
|
-
"storageKey": null
|
|
108
|
-
}, {
|
|
109
|
-
"alias": null,
|
|
110
|
-
"args": null,
|
|
111
|
-
"kind": "ScalarField",
|
|
112
|
-
"name": "cssStyle",
|
|
113
|
-
"storageKey": null
|
|
114
|
-
}, {
|
|
115
|
-
"alias": null,
|
|
116
|
-
"args": null,
|
|
117
|
-
"kind": "ScalarField",
|
|
118
|
-
"name": "cssStretch",
|
|
119
|
-
"storageKey": null
|
|
120
|
-
}, {
|
|
121
|
-
"alias": null,
|
|
122
|
-
"args": null,
|
|
123
|
-
"concreteType": "VariableInstance",
|
|
124
|
-
"kind": "LinkedField",
|
|
125
|
-
"name": "variableInstances",
|
|
126
|
-
"plural": true,
|
|
127
|
-
"selections": [v1 /*: any*/, {
|
|
128
|
-
"alias": null,
|
|
129
|
-
"args": null,
|
|
130
|
-
"concreteType": "VariableSetting",
|
|
131
|
-
"kind": "LinkedField",
|
|
132
|
-
"name": "coordinates",
|
|
133
|
-
"plural": true,
|
|
134
|
-
"selections": [{
|
|
135
|
-
"alias": null,
|
|
136
|
-
"args": null,
|
|
137
|
-
"kind": "ScalarField",
|
|
138
|
-
"name": "axis",
|
|
139
|
-
"storageKey": null
|
|
140
|
-
}, {
|
|
141
|
-
"alias": null,
|
|
142
|
-
"args": null,
|
|
143
|
-
"kind": "ScalarField",
|
|
144
|
-
"name": "value",
|
|
145
|
-
"storageKey": null
|
|
146
|
-
}],
|
|
147
|
-
"storageKey": null
|
|
148
|
-
}],
|
|
149
|
-
"storageKey": null
|
|
150
|
-
}],
|
|
151
|
-
"storageKey": null
|
|
152
|
-
}],
|
|
153
|
-
"storageKey": null
|
|
154
|
-
}],
|
|
155
|
-
"storageKey": null
|
|
156
|
-
}],
|
|
157
|
-
"storageKey": "fontCollections(collectionTypes:[\"FAMILY\"],first:999)"
|
|
158
|
-
}]
|
|
159
|
-
}],
|
|
160
|
-
"type": "Viewer",
|
|
161
|
-
"abstractKey": null
|
|
162
|
-
};
|
|
163
|
-
}();
|
|
164
|
-
node.hash = "5e5834d9202f90bdde5a0a7db49e8639";
|
|
165
|
-
var _default = node;
|
|
166
|
-
exports.default = _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated SignedSource<<abd37f03c566e5adecd035ce761cfe89>>
|
|
3
|
-
* @lightSyntaxTransform
|
|
4
|
-
* @nogrep
|
|
5
|
-
*/
|
|
6
|
-
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
-
import { FragmentRefs } from "relay-runtime";
|
|
8
|
-
export type TypeTester_viewer$data = {
|
|
9
|
-
readonly " $fragmentSpreads": FragmentRefs<"TypeTesterStyleSelectData_viewer">;
|
|
10
|
-
readonly " $fragmentType": "TypeTester_viewer";
|
|
11
|
-
};
|
|
12
|
-
export type TypeTester_viewer$key = {
|
|
13
|
-
readonly " $data"?: TypeTester_viewer$data;
|
|
14
|
-
readonly " $fragmentSpreads": FragmentRefs<"TypeTester_viewer">;
|
|
15
|
-
};
|
|
16
|
-
declare const node: ReaderFragment;
|
|
17
|
-
export default node;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @generated SignedSource<<abd37f03c566e5adecd035ce761cfe89>>
|
|
9
|
-
* @lightSyntaxTransform
|
|
10
|
-
* @nogrep
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/* tslint:disable */
|
|
14
|
-
/* eslint-disable */
|
|
15
|
-
// @ts-nocheck
|
|
16
|
-
|
|
17
|
-
const node = {
|
|
18
|
-
"argumentDefinitions": [{
|
|
19
|
-
"defaultValue": null,
|
|
20
|
-
"kind": "LocalArgument",
|
|
21
|
-
"name": "selectable"
|
|
22
|
-
}],
|
|
23
|
-
"kind": "Fragment",
|
|
24
|
-
"metadata": null,
|
|
25
|
-
"name": "TypeTester_viewer",
|
|
26
|
-
"selections": [{
|
|
27
|
-
"args": [{
|
|
28
|
-
"kind": "Variable",
|
|
29
|
-
"name": "selectable",
|
|
30
|
-
"variableName": "selectable"
|
|
31
|
-
}],
|
|
32
|
-
"kind": "FragmentSpread",
|
|
33
|
-
"name": "TypeTesterStyleSelectData_viewer"
|
|
34
|
-
}],
|
|
35
|
-
"type": "Viewer",
|
|
36
|
-
"abstractKey": null
|
|
37
|
-
};
|
|
38
|
-
node.hash = "26c2b3145462407675ab9b202b0d1b4c";
|
|
39
|
-
var _default = node;
|
|
40
|
-
exports.default = _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @generated SignedSource<<989cf2f044377f9f42d9f840f839af4b>>
|
|
3
|
-
* @lightSyntaxTransform
|
|
4
|
-
* @nogrep
|
|
5
|
-
*/
|
|
6
|
-
import { ReaderFragment } from 'relay-runtime';
|
|
7
|
-
import { FragmentRefs } from "relay-runtime";
|
|
8
|
-
export type TypeTesters_viewer$data = {
|
|
9
|
-
readonly " $fragmentSpreads": FragmentRefs<"TypeTester_viewer">;
|
|
10
|
-
readonly " $fragmentType": "TypeTesters_viewer";
|
|
11
|
-
};
|
|
12
|
-
export type TypeTesters_viewer$key = {
|
|
13
|
-
readonly " $data"?: TypeTesters_viewer$data;
|
|
14
|
-
readonly " $fragmentSpreads": FragmentRefs<"TypeTesters_viewer">;
|
|
15
|
-
};
|
|
16
|
-
declare const node: ReaderFragment;
|
|
17
|
-
export default node;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* @generated SignedSource<<989cf2f044377f9f42d9f840f839af4b>>
|
|
9
|
-
* @lightSyntaxTransform
|
|
10
|
-
* @nogrep
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/* tslint:disable */
|
|
14
|
-
/* eslint-disable */
|
|
15
|
-
// @ts-nocheck
|
|
16
|
-
|
|
17
|
-
const node = {
|
|
18
|
-
"argumentDefinitions": [{
|
|
19
|
-
"defaultValue": null,
|
|
20
|
-
"kind": "LocalArgument",
|
|
21
|
-
"name": "selectable"
|
|
22
|
-
}],
|
|
23
|
-
"kind": "Fragment",
|
|
24
|
-
"metadata": null,
|
|
25
|
-
"name": "TypeTesters_viewer",
|
|
26
|
-
"selections": [{
|
|
27
|
-
"args": [{
|
|
28
|
-
"kind": "Variable",
|
|
29
|
-
"name": "selectable",
|
|
30
|
-
"variableName": "selectable"
|
|
31
|
-
}],
|
|
32
|
-
"kind": "FragmentSpread",
|
|
33
|
-
"name": "TypeTester_viewer"
|
|
34
|
-
}],
|
|
35
|
-
"type": "Viewer",
|
|
36
|
-
"abstractKey": null
|
|
37
|
-
};
|
|
38
|
-
node.hash = "8fbadb67d6506fee0f3ccc09624517c6";
|
|
39
|
-
var _default = node;
|
|
40
|
-
exports.default = _default;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FontdueContextProvider_props } from './index.js';
|
|
3
|
-
export type { FontdueContextProvider_props } from './index.js';
|
|
4
|
-
export default function FontdueContextProviderServer(props: FontdueContextProvider_props): Promise<React.JSX.Element>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FontdueContextProvider from './index.js';
|
|
3
|
-
// RSC entry. The client component does the work; this exists so the
|
|
4
|
-
// `react-server` export condition resolves to a server-renderable file.
|
|
5
|
-
export default async function FontdueContextProviderServer(props) {
|
|
6
|
-
return /*#__PURE__*/React.createElement(FontdueContextProvider, props);
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useAuxUIOwner(): boolean;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
// Module-level claim: only one FontdueProvider on a page renders
|
|
6
|
-
// auxiliary UI (TestModeBanner, ThemeConfig, Tracking, ConsentBanner,
|
|
7
|
-
// ServerConfigProvider). Starts false on both server and client to avoid
|
|
8
|
-
// hydration mismatch; the first provider to run `useEffect` wins and flips
|
|
9
|
-
// its own state to true. Relinquishes the claim on unmount so HMR and
|
|
10
|
-
// route changes don't leak.
|
|
11
|
-
|
|
12
|
-
let ownerId = null;
|
|
13
|
-
export default function useAuxUIOwner() {
|
|
14
|
-
const [isOwner, setIsOwner] = useState(false);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const myId = {};
|
|
17
|
-
if (ownerId == null) {
|
|
18
|
-
ownerId = myId;
|
|
19
|
-
setIsOwner(true);
|
|
20
|
-
}
|
|
21
|
-
return () => {
|
|
22
|
-
if (ownerId === myId) {
|
|
23
|
-
ownerId = null;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}, []);
|
|
27
|
-
return isOwner;
|
|
28
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LoadSerializableQueryOptions, SerializablePreloadedQuery } from '../../relay/loadSerializableQuery.js';
|
|
3
|
-
import { TypeTesterStandaloneQuery } from '../../__generated__/TypeTesterStandaloneQuery.graphql.js';
|
|
4
|
-
import { TypeTesterStandalonePreloadedQueryRenderer } from './TypeTesterStandalone.js';
|
|
5
|
-
export type TypeTesterPreloadedQuery = SerializablePreloadedQuery<TypeTesterStandaloneQuery>;
|
|
6
|
-
export interface LoadTypeTesterQueryVariables {
|
|
7
|
-
familyName: string;
|
|
8
|
-
styleName: string;
|
|
9
|
-
selectable?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function loadTypeTesterQuery(variables: LoadTypeTesterQueryVariables, options?: LoadSerializableQueryOptions): Promise<TypeTesterPreloadedQuery>;
|
|
12
|
-
type RendererProps = React.ComponentProps<typeof TypeTesterStandalonePreloadedQueryRenderer>;
|
|
13
|
-
export declare function TypeTesterPreloaded(props: RendererProps): React.JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import loadSerializableQuery from '../../relay/loadSerializableQuery.js';
|
|
3
|
-
import TypeTesterStandaloneQueryNode from '../../__generated__/TypeTesterStandaloneQuery.graphql.js';
|
|
4
|
-
import FontdueContextProvider from '../FontdueContextProvider/index.js';
|
|
5
|
-
import { TypeTesterStandalonePreloadedQueryRenderer } from './TypeTesterStandalone.js';
|
|
6
|
-
export async function loadTypeTesterQuery(variables, options) {
|
|
7
|
-
return loadSerializableQuery(TypeTesterStandaloneQueryNode, {
|
|
8
|
-
familyName: variables.familyName,
|
|
9
|
-
styleName: variables.styleName,
|
|
10
|
-
selectable: variables.selectable ?? true
|
|
11
|
-
}, options);
|
|
12
|
-
}
|
|
13
|
-
// Self-wraps with FontdueContextProvider so consumers don't need to wire up
|
|
14
|
-
// Relay env / Redux store / contexts at the call site. Aux UI (theme,
|
|
15
|
-
// test-mode banner, consent, tracking) is NOT rendered here — that belongs
|
|
16
|
-
// to a single layout-level `<FontdueProvider>` per page. State is shared
|
|
17
|
-
// across multiple preloaded components on a page via module-level singletons.
|
|
18
|
-
export function TypeTesterPreloaded(props) {
|
|
19
|
-
return /*#__PURE__*/React.createElement(FontdueContextProvider, null, /*#__PURE__*/React.createElement(TypeTesterStandalonePreloadedQueryRenderer, props));
|
|
20
|
-
}
|
package/dist/config.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Config } from './components/ConfigContext.js';
|
|
2
|
-
export interface FontdueConfig extends Config {
|
|
3
|
-
url?: string;
|
|
4
|
-
stripeIntegration?: 'card-element' | 'dynamic';
|
|
5
|
-
}
|
|
6
|
-
export declare function configure(opts: Partial<FontdueConfig>): void;
|
|
7
|
-
export declare function getConfig(): Readonly<FontdueConfig>;
|
package/dist/config.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Module-level global configuration. Consumers call `configure()` once at
|
|
2
|
-
// app startup (Astro layout, Next layout, Vite entry) and every fontdue-js
|
|
3
|
-
// entry point reads defaults from here.
|
|
4
|
-
//
|
|
5
|
-
// Precedence (low to high):
|
|
6
|
-
// 1. Server admin config (from the tenant dashboard, fetched via Relay)
|
|
7
|
-
// 2. configure({...}) — module-level code defaults
|
|
8
|
-
// 3. <FontdueProvider config={...}> — per-instance prop override
|
|
9
|
-
//
|
|
10
|
-
// Per-request isolation note: `configure` sets module-level state. That's
|
|
11
|
-
// fine for single-tenant apps. Multi-tenant servers that switch URL per
|
|
12
|
-
// request should pass `url` explicitly to loadSerializableQuery rather than
|
|
13
|
-
// rely on configure().
|
|
14
|
-
|
|
15
|
-
// Network-layer + UI config in one bag. UI fields come from `Config` (the
|
|
16
|
-
// shape passed to ConfigContext); URL + stripeIntegration are network-layer.
|
|
17
|
-
|
|
18
|
-
let current = {};
|
|
19
|
-
|
|
20
|
-
// Shallow-merges with prior values. Calling `configure({tracking: {...}})`
|
|
21
|
-
// replaces the whole `tracking` subtree; pass nested fields fully populated
|
|
22
|
-
// when partial-updating.
|
|
23
|
-
export function configure(opts) {
|
|
24
|
-
current = {
|
|
25
|
-
...current,
|
|
26
|
-
...opts
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export function getConfig() {
|
|
30
|
-
return current;
|
|
31
|
-
}
|