fontdue-js 0.1.1 → 1.0.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/CharacterViewer.d.ts +3 -0
- package/CharacterViewer.js +1 -0
- package/README.md +37 -25
- package/dist/__generated__/CharacterViewer_SlugQuery.graphql.d.ts +20 -0
- package/dist/__generated__/CharacterViewer_SlugQuery.graphql.js +289 -0
- package/dist/__generated__/TypeTesterStandalone_StyleQuery.graphql.d.ts +6 -0
- package/dist/__generated__/TypeTesterStandalone_StyleQuery.graphql.js +32 -4
- package/dist/components/Cart/CustomerFields.d.ts +14 -0
- package/dist/components/Cart/CustomerFields.js +4 -5
- package/dist/components/CharacterViewer/index.d.ts +2 -1
- package/dist/components/CharacterViewer/index.js +47 -21
- package/dist/components/Checkbox/index.js +4 -5
- package/dist/components/ConfigContext.d.ts +78 -1
- package/dist/components/ConfigContext.js +52 -2
- package/dist/components/FontdueProvider/index.js +2 -2
- package/dist/components/SelectButton/index.js +1 -3
- package/dist/components/StoreModal/StoreModalIndex.js +6 -5
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.js +4 -5
- package/dist/components/TypeTester/TypeTesterEditAll.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterEditAll.js +6 -4
- package/dist/components/TypeTester/TypeTesterFeatures.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterFeatures.js +11 -6
- package/dist/components/TypeTester/TypeTesterFloatingToolbar.js +3 -5
- package/dist/components/TypeTester/TypeTesterStandalone.js +3 -3
- package/dist/components/TypeTester/TypeTesterState.js +1 -3
- package/dist/components/TypeTester/TypeTesterStyleSelect.js +0 -2
- package/dist/components/TypeTester/TypeTesterToolbar.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterToolbar.js +15 -13
- package/dist/components/TypeTester/index.d.ts +2 -1
- package/dist/components/TypeTester/index.js +12 -26
- package/dist/components/TypeTesters/index.js +7 -10
- package/dist/components/elements/StoreModalReviewConfirm/index.js +4 -5
- package/fontdue.css +4 -0
- package/fontdue.css.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/components/CharacterViewer');
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ This package exports [Fontdue.js](https://docs.fontdue.com/fontduejs) components
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
1. Wrap the root of your project with the [`FontdueProvider`](#fontdueprovider) component. For example in a Next.js app, add it to your `_app.tsx`.
|
|
8
|
-
2.
|
|
8
|
+
2. Include the `url` property with your Fontdue store URL.
|
|
9
9
|
3. Render the [`StoreModal`](#storemodal) component so that is it available on every page.
|
|
10
10
|
4. Import the `fontdue-js/fontdue.css` CSS file. (This example uses Next.js)
|
|
11
11
|
|
|
@@ -21,13 +21,11 @@ import 'fontdue-js/fontdue.css';
|
|
|
21
21
|
|
|
22
22
|
function MyApp({ Component, pageProps }: AppProps) {
|
|
23
23
|
return (
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<Component {...pageProps} />
|
|
24
|
+
<FontdueProvider url="https://example.fontdue.com" config={{}}>
|
|
25
|
+
<Component {...pageProps} />
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</React.Fragment>
|
|
27
|
+
<StoreModal />
|
|
28
|
+
</FontdueProvider>
|
|
31
29
|
);
|
|
32
30
|
}
|
|
33
31
|
|
|
@@ -69,7 +67,9 @@ import StoreModal from 'fontdue-js/StoreModal';
|
|
|
69
67
|
|
|
70
68
|
## `BuyButton`
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
A button which when clicked opens the Cart to the relevant collection, and selects the collection.
|
|
71
|
+
|
|
72
|
+
Renders a button with the text `Buy {collectionName}`
|
|
73
73
|
|
|
74
74
|
```tsx
|
|
75
75
|
import BuyButton from 'fontdue-js/BuyButton';
|
|
@@ -78,11 +78,11 @@ import BuyButton from 'fontdue-js/BuyButton';
|
|
|
78
78
|
| Prop | Description |
|
|
79
79
|
| --- | --- |
|
|
80
80
|
| `collectionId` or `collectionSlug` | (Required) `string` Collection identifier |
|
|
81
|
-
| `collectionName` | (Optional) `string`
|
|
81
|
+
| `collectionName` | (Optional) `string` The name to render in the button: `Buy {collectionName}` |
|
|
82
82
|
|
|
83
83
|
## `CartButton`
|
|
84
84
|
|
|
85
|
-
A
|
|
85
|
+
A button to open the Store Modal. If the user has items in their cart, the button will navigate straight to the Cart screen. Otherwise it opens the fonts index.
|
|
86
86
|
|
|
87
87
|
```tsx
|
|
88
88
|
import CartButton from 'fontdue-js/CartButton';
|
|
@@ -90,12 +90,24 @@ import CartButton from 'fontdue-js/CartButton';
|
|
|
90
90
|
|
|
91
91
|
| Prop | Description |
|
|
92
92
|
| --- | --- |
|
|
93
|
-
| `buttonStyle` | (Optional) `'icon' \| 'inline'`
|
|
94
|
-
| `label` | (Optional) `string`
|
|
93
|
+
| `buttonStyle` | (Optional) `'icon' \| 'inline'` Button style. If left blank, the button is unstyled. |
|
|
94
|
+
| `label` | (Optional) `string` For non-icon style buttons, the text to render inside the button. Defaults to "Cart" |
|
|
95
|
+
|
|
96
|
+
## `CharacterViewer`
|
|
97
|
+
|
|
98
|
+
An interactive character/glyph explorer.
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import CharacterViewer from 'fontdue-js/CharacterViewer';
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
| Prop | Description |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `collectionId` or `collectionSlug` | (Required) `string` Identifier for collection |
|
|
95
107
|
|
|
96
108
|
## `TypeTesters`
|
|
97
109
|
|
|
98
|
-
|
|
110
|
+
A group of type tester components for a collection. You must first add content for the collection's type testers through the Fontdue dashboard.
|
|
99
111
|
|
|
100
112
|
```tsx
|
|
101
113
|
import TypeTesters from 'fontdue-js/TypeTesters';
|
|
@@ -122,33 +134,33 @@ The props accepted for this compnenent will change and be documented thereafter.
|
|
|
122
134
|
import TypeTester from 'fontdue-js/TypeTester';
|
|
123
135
|
```
|
|
124
136
|
|
|
125
|
-
## `
|
|
137
|
+
## `TestFontsForm`
|
|
126
138
|
|
|
127
|
-
|
|
139
|
+
Displays a form for users to enter their information and download test fonts. Make sure you have configured [Test Fonts](https://docs.fontdue.com/test-fonts) for this to work.
|
|
128
140
|
|
|
129
141
|
```tsx
|
|
130
|
-
import
|
|
142
|
+
import TestFontsForm from 'fontdue-js/TestFontsForm';
|
|
131
143
|
```
|
|
132
144
|
|
|
133
145
|
| Prop | Description |
|
|
134
146
|
| --- | --- |
|
|
135
|
-
| `
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
147
|
+
| `agreementLabel` | (Optional) `string` Label for required checkbox. Defaults to the field "EULA agreement text" in your Fontdue Labels settings |
|
|
148
|
+
| `downloadLabel` | (Optional) `string` Download button label. Defaults to "Download test fonts" |
|
|
149
|
+
| `newsletterCheckboxChecked` | (Optional) `boolean` Set the newsletter opt-in checkbox checked by default |
|
|
138
150
|
|
|
139
|
-
## `
|
|
151
|
+
## `NewsletterSignup`
|
|
140
152
|
|
|
141
|
-
|
|
153
|
+
A newsletter signup form. Customers entering their information here simply adds them as a Customer in the Fontdue CMS.
|
|
142
154
|
|
|
143
155
|
```tsx
|
|
144
|
-
import
|
|
156
|
+
import NewsletterSignup from 'fontdue-js/NewsletterSignup';
|
|
145
157
|
```
|
|
146
158
|
|
|
147
159
|
| Prop | Description |
|
|
148
160
|
| --- | --- |
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
| `
|
|
161
|
+
| `optInLabel` | (Required) `string` Label that appears with the checkbox required to be checked. |
|
|
162
|
+
| `buttonLabel` | (Optional) `string` Label for the button. Defaults to "Subscribe" |
|
|
163
|
+
| `optInCheckboxChecked` | (Optional) `boolean` Set the checkbox checked by default. |
|
|
152
164
|
|
|
153
165
|
## `useFontStyle`
|
|
154
166
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ConcreteRequest } from "relay-runtime";
|
|
2
|
+
import { FragmentRefs } from "relay-runtime";
|
|
3
|
+
export declare type CharacterViewer_SlugQueryVariables = {
|
|
4
|
+
collectionSlug: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type CharacterViewer_SlugQueryResponse = {
|
|
7
|
+
readonly viewer: {
|
|
8
|
+
readonly slug: {
|
|
9
|
+
readonly fontCollection: {
|
|
10
|
+
readonly " $fragmentRefs": FragmentRefs<"CharacterViewer_collection">;
|
|
11
|
+
} | null;
|
|
12
|
+
} | null;
|
|
13
|
+
} | null;
|
|
14
|
+
};
|
|
15
|
+
export declare type CharacterViewer_SlugQuery = {
|
|
16
|
+
readonly response: CharacterViewer_SlugQueryResponse;
|
|
17
|
+
readonly variables: CharacterViewer_SlugQueryVariables;
|
|
18
|
+
};
|
|
19
|
+
declare const node: ConcreteRequest;
|
|
20
|
+
export default node;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
/* tslint:disable */
|
|
9
|
+
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
// @ts-nocheck
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
query CharacterViewer_SlugQuery(
|
|
15
|
+
$collectionSlug: String!
|
|
16
|
+
) {
|
|
17
|
+
viewer {
|
|
18
|
+
slug(name: $collectionSlug) {
|
|
19
|
+
fontCollection {
|
|
20
|
+
...CharacterViewer_collection
|
|
21
|
+
id
|
|
22
|
+
}
|
|
23
|
+
id
|
|
24
|
+
}
|
|
25
|
+
id
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
fragment CharacterViewer_collection on FontCollection {
|
|
30
|
+
featureStyle {
|
|
31
|
+
id
|
|
32
|
+
}
|
|
33
|
+
id
|
|
34
|
+
name
|
|
35
|
+
fontStyles {
|
|
36
|
+
id
|
|
37
|
+
cssFamily
|
|
38
|
+
name
|
|
39
|
+
characterBlocks {
|
|
40
|
+
name
|
|
41
|
+
characters
|
|
42
|
+
}
|
|
43
|
+
featureCharacters {
|
|
44
|
+
feature
|
|
45
|
+
name
|
|
46
|
+
characters
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
children(collectionTypes: [FAMILY]) {
|
|
50
|
+
id
|
|
51
|
+
name
|
|
52
|
+
fontStyles {
|
|
53
|
+
id
|
|
54
|
+
cssFamily
|
|
55
|
+
name
|
|
56
|
+
characterBlocks {
|
|
57
|
+
name
|
|
58
|
+
characters
|
|
59
|
+
}
|
|
60
|
+
featureCharacters {
|
|
61
|
+
feature
|
|
62
|
+
name
|
|
63
|
+
characters
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
*/
|
|
69
|
+
const node = function () {
|
|
70
|
+
var v0 = [{
|
|
71
|
+
"defaultValue": null,
|
|
72
|
+
"kind": "LocalArgument",
|
|
73
|
+
"name": "collectionSlug"
|
|
74
|
+
}],
|
|
75
|
+
v1 = [{
|
|
76
|
+
"kind": "Variable",
|
|
77
|
+
"name": "name",
|
|
78
|
+
"variableName": "collectionSlug"
|
|
79
|
+
}],
|
|
80
|
+
v2 = {
|
|
81
|
+
"alias": null,
|
|
82
|
+
"args": null,
|
|
83
|
+
"kind": "ScalarField",
|
|
84
|
+
"name": "id",
|
|
85
|
+
"storageKey": null
|
|
86
|
+
},
|
|
87
|
+
v3 = {
|
|
88
|
+
"alias": null,
|
|
89
|
+
"args": null,
|
|
90
|
+
"kind": "ScalarField",
|
|
91
|
+
"name": "name",
|
|
92
|
+
"storageKey": null
|
|
93
|
+
},
|
|
94
|
+
v4 = {
|
|
95
|
+
"alias": null,
|
|
96
|
+
"args": null,
|
|
97
|
+
"kind": "ScalarField",
|
|
98
|
+
"name": "characters",
|
|
99
|
+
"storageKey": null
|
|
100
|
+
},
|
|
101
|
+
v5 = {
|
|
102
|
+
"alias": null,
|
|
103
|
+
"args": null,
|
|
104
|
+
"concreteType": "FontStyle",
|
|
105
|
+
"kind": "LinkedField",
|
|
106
|
+
"name": "fontStyles",
|
|
107
|
+
"plural": true,
|
|
108
|
+
"selections": [v2
|
|
109
|
+
/*: any*/
|
|
110
|
+
, {
|
|
111
|
+
"alias": null,
|
|
112
|
+
"args": null,
|
|
113
|
+
"kind": "ScalarField",
|
|
114
|
+
"name": "cssFamily",
|
|
115
|
+
"storageKey": null
|
|
116
|
+
}, v3
|
|
117
|
+
/*: any*/
|
|
118
|
+
, {
|
|
119
|
+
"alias": null,
|
|
120
|
+
"args": null,
|
|
121
|
+
"concreteType": "CharacterBlock",
|
|
122
|
+
"kind": "LinkedField",
|
|
123
|
+
"name": "characterBlocks",
|
|
124
|
+
"plural": true,
|
|
125
|
+
"selections": [v3
|
|
126
|
+
/*: any*/
|
|
127
|
+
, v4
|
|
128
|
+
/*: any*/
|
|
129
|
+
],
|
|
130
|
+
"storageKey": null
|
|
131
|
+
}, {
|
|
132
|
+
"alias": null,
|
|
133
|
+
"args": null,
|
|
134
|
+
"concreteType": "FeatureCharacters",
|
|
135
|
+
"kind": "LinkedField",
|
|
136
|
+
"name": "featureCharacters",
|
|
137
|
+
"plural": true,
|
|
138
|
+
"selections": [{
|
|
139
|
+
"alias": null,
|
|
140
|
+
"args": null,
|
|
141
|
+
"kind": "ScalarField",
|
|
142
|
+
"name": "feature",
|
|
143
|
+
"storageKey": null
|
|
144
|
+
}, v3
|
|
145
|
+
/*: any*/
|
|
146
|
+
, v4
|
|
147
|
+
/*: any*/
|
|
148
|
+
],
|
|
149
|
+
"storageKey": null
|
|
150
|
+
}],
|
|
151
|
+
"storageKey": null
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
"fragment": {
|
|
155
|
+
"argumentDefinitions": v0
|
|
156
|
+
/*: any*/
|
|
157
|
+
,
|
|
158
|
+
"kind": "Fragment",
|
|
159
|
+
"metadata": null,
|
|
160
|
+
"name": "CharacterViewer_SlugQuery",
|
|
161
|
+
"selections": [{
|
|
162
|
+
"alias": null,
|
|
163
|
+
"args": null,
|
|
164
|
+
"concreteType": "Viewer",
|
|
165
|
+
"kind": "LinkedField",
|
|
166
|
+
"name": "viewer",
|
|
167
|
+
"plural": false,
|
|
168
|
+
"selections": [{
|
|
169
|
+
"alias": null,
|
|
170
|
+
"args": v1
|
|
171
|
+
/*: any*/
|
|
172
|
+
,
|
|
173
|
+
"concreteType": "Slug",
|
|
174
|
+
"kind": "LinkedField",
|
|
175
|
+
"name": "slug",
|
|
176
|
+
"plural": false,
|
|
177
|
+
"selections": [{
|
|
178
|
+
"alias": null,
|
|
179
|
+
"args": null,
|
|
180
|
+
"concreteType": "FontCollection",
|
|
181
|
+
"kind": "LinkedField",
|
|
182
|
+
"name": "fontCollection",
|
|
183
|
+
"plural": false,
|
|
184
|
+
"selections": [{
|
|
185
|
+
"args": null,
|
|
186
|
+
"kind": "FragmentSpread",
|
|
187
|
+
"name": "CharacterViewer_collection"
|
|
188
|
+
}],
|
|
189
|
+
"storageKey": null
|
|
190
|
+
}],
|
|
191
|
+
"storageKey": null
|
|
192
|
+
}],
|
|
193
|
+
"storageKey": null
|
|
194
|
+
}],
|
|
195
|
+
"type": "RootQueryType",
|
|
196
|
+
"abstractKey": null
|
|
197
|
+
},
|
|
198
|
+
"kind": "Request",
|
|
199
|
+
"operation": {
|
|
200
|
+
"argumentDefinitions": v0
|
|
201
|
+
/*: any*/
|
|
202
|
+
,
|
|
203
|
+
"kind": "Operation",
|
|
204
|
+
"name": "CharacterViewer_SlugQuery",
|
|
205
|
+
"selections": [{
|
|
206
|
+
"alias": null,
|
|
207
|
+
"args": null,
|
|
208
|
+
"concreteType": "Viewer",
|
|
209
|
+
"kind": "LinkedField",
|
|
210
|
+
"name": "viewer",
|
|
211
|
+
"plural": false,
|
|
212
|
+
"selections": [{
|
|
213
|
+
"alias": null,
|
|
214
|
+
"args": v1
|
|
215
|
+
/*: any*/
|
|
216
|
+
,
|
|
217
|
+
"concreteType": "Slug",
|
|
218
|
+
"kind": "LinkedField",
|
|
219
|
+
"name": "slug",
|
|
220
|
+
"plural": false,
|
|
221
|
+
"selections": [{
|
|
222
|
+
"alias": null,
|
|
223
|
+
"args": null,
|
|
224
|
+
"concreteType": "FontCollection",
|
|
225
|
+
"kind": "LinkedField",
|
|
226
|
+
"name": "fontCollection",
|
|
227
|
+
"plural": false,
|
|
228
|
+
"selections": [{
|
|
229
|
+
"alias": null,
|
|
230
|
+
"args": null,
|
|
231
|
+
"concreteType": "FontStyle",
|
|
232
|
+
"kind": "LinkedField",
|
|
233
|
+
"name": "featureStyle",
|
|
234
|
+
"plural": false,
|
|
235
|
+
"selections": [v2
|
|
236
|
+
/*: any*/
|
|
237
|
+
],
|
|
238
|
+
"storageKey": null
|
|
239
|
+
}, v2
|
|
240
|
+
/*: any*/
|
|
241
|
+
, v3
|
|
242
|
+
/*: any*/
|
|
243
|
+
, v5
|
|
244
|
+
/*: any*/
|
|
245
|
+
, {
|
|
246
|
+
"alias": null,
|
|
247
|
+
"args": [{
|
|
248
|
+
"kind": "Literal",
|
|
249
|
+
"name": "collectionTypes",
|
|
250
|
+
"value": ["FAMILY"]
|
|
251
|
+
}],
|
|
252
|
+
"concreteType": "FontCollection",
|
|
253
|
+
"kind": "LinkedField",
|
|
254
|
+
"name": "children",
|
|
255
|
+
"plural": true,
|
|
256
|
+
"selections": [v2
|
|
257
|
+
/*: any*/
|
|
258
|
+
, v3
|
|
259
|
+
/*: any*/
|
|
260
|
+
, v5
|
|
261
|
+
/*: any*/
|
|
262
|
+
],
|
|
263
|
+
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
264
|
+
}],
|
|
265
|
+
"storageKey": null
|
|
266
|
+
}, v2
|
|
267
|
+
/*: any*/
|
|
268
|
+
],
|
|
269
|
+
"storageKey": null
|
|
270
|
+
}, v2
|
|
271
|
+
/*: any*/
|
|
272
|
+
],
|
|
273
|
+
"storageKey": null
|
|
274
|
+
}]
|
|
275
|
+
},
|
|
276
|
+
"params": {
|
|
277
|
+
"cacheID": "f69a908fd095e2408ba06adeeb8cd0f0",
|
|
278
|
+
"id": null,
|
|
279
|
+
"metadata": {},
|
|
280
|
+
"name": "CharacterViewer_SlugQuery",
|
|
281
|
+
"operationKind": "query",
|
|
282
|
+
"text": "query CharacterViewer_SlugQuery(\n $collectionSlug: String!\n) {\n viewer {\n slug(name: $collectionSlug) {\n fontCollection {\n ...CharacterViewer_collection\n id\n }\n id\n }\n id\n }\n}\n\nfragment CharacterViewer_collection on FontCollection {\n featureStyle {\n id\n }\n id\n name\n fontStyles {\n id\n cssFamily\n name\n characterBlocks {\n name\n characters\n }\n featureCharacters {\n feature\n name\n characters\n }\n }\n children(collectionTypes: [FAMILY]) {\n id\n name\n fontStyles {\n id\n cssFamily\n name\n characterBlocks {\n name\n characters\n }\n featureCharacters {\n feature\n name\n characters\n }\n }\n }\n}\n"
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
}();
|
|
286
|
+
|
|
287
|
+
node.hash = 'de903e7c2640562aee374a900e089c9c';
|
|
288
|
+
var _default = node;
|
|
289
|
+
exports.default = _default;
|
|
@@ -7,6 +7,12 @@ export declare type TypeTesterStandalone_StyleQueryResponse = {
|
|
|
7
7
|
readonly viewer: {
|
|
8
8
|
readonly fontStyle: {
|
|
9
9
|
readonly id: string;
|
|
10
|
+
readonly family: {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly parent: {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
} | null;
|
|
15
|
+
} | null;
|
|
10
16
|
} | null;
|
|
11
17
|
} | null;
|
|
12
18
|
};
|
|
@@ -18,6 +18,12 @@ query TypeTesterStandalone_StyleQuery(
|
|
|
18
18
|
viewer {
|
|
19
19
|
fontStyle(familyName: $familyName, styleName: $styleName) {
|
|
20
20
|
id
|
|
21
|
+
family {
|
|
22
|
+
id
|
|
23
|
+
parent {
|
|
24
|
+
id
|
|
25
|
+
}
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
id
|
|
23
29
|
}
|
|
@@ -57,7 +63,29 @@ const node = function () {
|
|
|
57
63
|
"plural": false,
|
|
58
64
|
"selections": [v1
|
|
59
65
|
/*: any*/
|
|
60
|
-
|
|
66
|
+
, {
|
|
67
|
+
"alias": null,
|
|
68
|
+
"args": null,
|
|
69
|
+
"concreteType": "FontCollection",
|
|
70
|
+
"kind": "LinkedField",
|
|
71
|
+
"name": "family",
|
|
72
|
+
"plural": false,
|
|
73
|
+
"selections": [v1
|
|
74
|
+
/*: any*/
|
|
75
|
+
, {
|
|
76
|
+
"alias": null,
|
|
77
|
+
"args": null,
|
|
78
|
+
"concreteType": "FontCollection",
|
|
79
|
+
"kind": "LinkedField",
|
|
80
|
+
"name": "parent",
|
|
81
|
+
"plural": false,
|
|
82
|
+
"selections": [v1
|
|
83
|
+
/*: any*/
|
|
84
|
+
],
|
|
85
|
+
"storageKey": null
|
|
86
|
+
}],
|
|
87
|
+
"storageKey": null
|
|
88
|
+
}],
|
|
61
89
|
"storageKey": null
|
|
62
90
|
};
|
|
63
91
|
return {
|
|
@@ -106,16 +134,16 @@ const node = function () {
|
|
|
106
134
|
}]
|
|
107
135
|
},
|
|
108
136
|
"params": {
|
|
109
|
-
"cacheID": "
|
|
137
|
+
"cacheID": "55ed0cd020e94e2c67fcbb7d3507fe25",
|
|
110
138
|
"id": null,
|
|
111
139
|
"metadata": {},
|
|
112
140
|
"name": "TypeTesterStandalone_StyleQuery",
|
|
113
141
|
"operationKind": "query",
|
|
114
|
-
"text": "query TypeTesterStandalone_StyleQuery(\n $familyName: String!\n $styleName: String!\n) {\n viewer {\n fontStyle(familyName: $familyName, styleName: $styleName) {\n id\n }\n id\n }\n}\n"
|
|
142
|
+
"text": "query TypeTesterStandalone_StyleQuery(\n $familyName: String!\n $styleName: String!\n) {\n viewer {\n fontStyle(familyName: $familyName, styleName: $styleName) {\n id\n family {\n id\n parent {\n id\n }\n }\n }\n id\n }\n}\n"
|
|
115
143
|
}
|
|
116
144
|
};
|
|
117
145
|
}();
|
|
118
146
|
|
|
119
|
-
node.hash = '
|
|
147
|
+
node.hash = '6b7470fc7c096c1adc484c7b3d32b126';
|
|
120
148
|
var _default = node;
|
|
121
149
|
exports.default = _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Customer {
|
|
3
|
+
name?: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
newsletterOptIn?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface CustomerFields_props {
|
|
8
|
+
title: string;
|
|
9
|
+
value: Customer;
|
|
10
|
+
onChange: (value: Customer) => void;
|
|
11
|
+
optInLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const CustomerFields: React.FC<CustomerFields_props>;
|
|
14
|
+
export default CustomerFields;
|
|
@@ -24,16 +24,15 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
24
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
25
|
|
|
26
26
|
const CustomerFields = _ref => {
|
|
27
|
-
var _config$form$checkbox, _config$form;
|
|
28
|
-
|
|
29
27
|
let {
|
|
30
28
|
title,
|
|
31
29
|
value,
|
|
32
30
|
onChange,
|
|
33
31
|
optInLabel
|
|
34
32
|
} = _ref;
|
|
35
|
-
const
|
|
36
|
-
|
|
33
|
+
const {
|
|
34
|
+
form: config
|
|
35
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
37
36
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
38
37
|
className: "checkout-modal__section"
|
|
39
38
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -76,7 +75,7 @@ const CustomerFields = _ref => {
|
|
|
76
75
|
})
|
|
77
76
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
78
77
|
className: "checkbox__icon"
|
|
79
|
-
}, checkboxStyle === 'check' ? /*#__PURE__*/_react.default.createElement(_Check.default, null) : /*#__PURE__*/_react.default.createElement(_X.default, null))), /*#__PURE__*/_react.default.createElement("label", {
|
|
78
|
+
}, config.checkboxStyle === 'check' ? /*#__PURE__*/_react.default.createElement(_Check.default, null) : /*#__PURE__*/_react.default.createElement(_X.default, null))), /*#__PURE__*/_react.default.createElement("label", {
|
|
80
79
|
htmlFor: "customer-newsletter-opt-in"
|
|
81
80
|
}, optInLabel))));
|
|
82
81
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface CharacterViewer_props {
|
|
3
|
-
collectionId
|
|
3
|
+
collectionId?: string;
|
|
4
|
+
collectionSlug?: string;
|
|
4
5
|
}
|
|
5
6
|
declare const CharacterViewerQueryRenderer: React.FC<CharacterViewer_props>;
|
|
6
7
|
export default CharacterViewerQueryRenderer;
|
|
@@ -9,8 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactRelay = require("react-relay");
|
|
11
11
|
|
|
12
|
-
var _reactStaticContainer = _interopRequireDefault(require("react-static-container"));
|
|
13
|
-
|
|
14
12
|
var _resizeObserver = _interopRequireDefault(require("@react-hook/resize-observer"));
|
|
15
13
|
|
|
16
14
|
var _utils = require("../../utils");
|
|
@@ -19,7 +17,7 @@ var _Select = _interopRequireDefault(require("../Select"));
|
|
|
19
17
|
|
|
20
18
|
var _useFontStyle = _interopRequireDefault(require("../useFontStyle"));
|
|
21
19
|
|
|
22
|
-
var _CharacterViewer_family, _CharacterViewer_collection, _CharacterViewer_Query;
|
|
20
|
+
var _CharacterViewer_family, _CharacterViewer_collection, _CharacterViewer_Query, _CharacterViewer_SlugQuery;
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
23
|
|
|
@@ -230,26 +228,54 @@ const CharacterViewer = (0, _reactRelay.createFragmentContainer)(CharacterViewer
|
|
|
230
228
|
|
|
231
229
|
const CharacterViewerQueryRenderer = _ref5 => {
|
|
232
230
|
let {
|
|
233
|
-
collectionId
|
|
231
|
+
collectionId,
|
|
232
|
+
collectionSlug
|
|
234
233
|
} = _ref5;
|
|
235
234
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
235
|
+
|
|
236
|
+
if (collectionId) {
|
|
237
|
+
return /*#__PURE__*/_react.default.createElement(_reactRelay.QueryRenderer, {
|
|
238
|
+
query: _CharacterViewer_Query !== void 0 ? _CharacterViewer_Query : (_CharacterViewer_Query = require("../../__generated__/CharacterViewer_Query.graphql"), _CharacterViewer_Query.hash && _CharacterViewer_Query.hash !== "10b58f0e5e086adbcd2a0d4cd44c442c" && console.error("The definition of 'CharacterViewer_Query' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewer_Query),
|
|
239
|
+
variables: {
|
|
240
|
+
collectionId
|
|
241
|
+
},
|
|
242
|
+
environment: environment,
|
|
243
|
+
render: _ref6 => {
|
|
244
|
+
let {
|
|
245
|
+
props
|
|
246
|
+
} = _ref6;
|
|
247
|
+
const node = props === null || props === void 0 ? void 0 : props.node;
|
|
248
|
+
if (!node) return null;
|
|
249
|
+
return /*#__PURE__*/_react.default.createElement(CharacterViewer, {
|
|
250
|
+
collection: node
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (collectionSlug) {
|
|
257
|
+
return /*#__PURE__*/_react.default.createElement(_reactRelay.QueryRenderer, {
|
|
258
|
+
query: _CharacterViewer_SlugQuery !== void 0 ? _CharacterViewer_SlugQuery : (_CharacterViewer_SlugQuery = require("../../__generated__/CharacterViewer_SlugQuery.graphql"), _CharacterViewer_SlugQuery.hash && _CharacterViewer_SlugQuery.hash !== "de903e7c2640562aee374a900e089c9c" && console.error("The definition of 'CharacterViewer_SlugQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewer_SlugQuery),
|
|
259
|
+
variables: {
|
|
260
|
+
collectionSlug
|
|
261
|
+
},
|
|
262
|
+
environment: environment,
|
|
263
|
+
render: _ref7 => {
|
|
264
|
+
var _props$viewer, _props$viewer$slug;
|
|
265
|
+
|
|
266
|
+
let {
|
|
267
|
+
props
|
|
268
|
+
} = _ref7;
|
|
269
|
+
const collection = props === null || props === void 0 ? void 0 : (_props$viewer = props.viewer) === null || _props$viewer === void 0 ? void 0 : (_props$viewer$slug = _props$viewer.slug) === null || _props$viewer$slug === void 0 ? void 0 : _props$viewer$slug.fontCollection;
|
|
270
|
+
if (!collection) return null;
|
|
271
|
+
return /*#__PURE__*/_react.default.createElement(CharacterViewer, {
|
|
272
|
+
collection: collection
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
throw new Error('Unable to render CharacterViewer without a collectionId or collectionSlug');
|
|
253
279
|
};
|
|
254
280
|
|
|
255
281
|
var _default = CharacterViewerQueryRenderer;
|