fontdue-js 3.2.2 → 3.2.4
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 +11 -0
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +7 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +84 -67
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +11 -5
- package/dist/components/Cart/Checkout.js +15 -3
- package/dist/components/FontdueAdminToolbar/index.js +6 -4
- package/dist/components/TypeTester/TypeTesterContent.js +7 -1
- package/dist/components/TypeTester/useTypeTesterStyler.js +21 -3
- package/dist/components/elements/StoreModalUnifiedCheckout.js +10 -3
- package/dist/fontdue.css +25 -4
- package/dist/relay/environment.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 3.2.4
|
|
2
|
+
|
|
3
|
+
- **The `StoreModal` checkout no longer advances past the customer step when the customer fails to save.** A rejected save — an invalid email, a duplicate record — previously moved the buyer on to payment with their details unsaved. The step now holds and shows the field errors. No public API change.
|
|
4
|
+
- **Per-customer coupon limits are surfaced at checkout.** When a buyer enters an email address that has used up its allowance on a coupon, the checkout shows the reason and keeps them on the customer step so they can remove the code from the cart.
|
|
5
|
+
|
|
6
|
+
## 3.2.3
|
|
7
|
+
|
|
8
|
+
- **Fixed `TypeTester` text drifting out of alignment at small font sizes.** The automatic columns (`columns: {count: 'auto', width: '40ch', gap: '1em'}` by default) sat on the full-width text container, and `ch` tracks the font size — so once the font was small enough for two columns to fit, multicol partitioned the strip and short content landed in the first column, leaving `alignment="center"` centred within *that column* rather than the tester. Right-aligned and RTL testers drifted the same way. The column properties now ride on the inner `[data-contents]` block, which shrink-wraps (`width: max-content`, capped at 100%) and is placed by alignment-driven auto margins; wrapping content still spans the full width and flows into columns as before. The editable container keeps its full width, so click-anywhere-to-edit and autofit width measurement are unchanged, and the SSR branch renders the same wrapper so the first paint matches. Truncating testers keep their columns on the height-capped container their sideways-overflow design requires. Ships new stylesheet rules, so take the `fontdue-js/dist/fontdue.css` from this version alongside the JS.
|
|
9
|
+
- Also fixed centred testers sitting half the autofit side buffer off centre at *every* size — the buffer was applied entirely on one side and is now split across both.
|
|
10
|
+
- **`FontdueAdminToolbar`: the collapsed pill now carries the Fontdue wordmark** — *Fontdue* idle, *Fontdue · Previewing hidden fonts* while previewing, *Fontdue · Preview expired* when the token lapses, matching the connection-error pill's existing wording. The `F` mark and the warning glyph leave the pill (the mark still brands the panel header, the glyph the expired notice). If you style the toolbar yourself: `__mark` no longer appears inside `__button`, and the expired suffix is a new `__expired-suffix` span. Chrome, sizing, shadow, the panel, and `data-testid="preview-toggle"` are unchanged.
|
|
11
|
+
|
|
1
12
|
## 3.2.2
|
|
2
13
|
|
|
3
14
|
- **Fixed the reCAPTCHA forms failing to server-render under Vite SSR** (Astro, and any framework whose dev SSR externalizes CJS deps through Node's ESM interop). 3.2.1 switched to `react-google-recaptcha`'s default export, which bundlers honouring the `__esModule` marker (webpack/Next, and Vite's browser optimizer) unwrap straight to the widget wrapper — but Node's strict ESM↔CJS interop models that same default import as the whole module *namespace*, so `<ReCAPTCHA>` was an object at SSR time. React threw "Element type is invalid … got: object" and the checkout, `NewsletterSignup` and `TestFontsForm` islands fell back to client rendering with a console error. The re-export now normalises the binding (`__esModule ? .default : obj`), resolving the wrapper on every path. A no-op for webpack and Vite's browser build. No public API change.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<796d04529c0ea8f6b6236945a158b754>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -16,6 +16,12 @@ export type CheckoutUpdateCustomerMutation$variables = {
|
|
|
16
16
|
};
|
|
17
17
|
export type CheckoutUpdateCustomerMutation$data = {
|
|
18
18
|
readonly updateCustomer: {
|
|
19
|
+
readonly errors: {
|
|
20
|
+
readonly coupon: ReadonlyArray<string | null> | null;
|
|
21
|
+
readonly email: ReadonlyArray<string | null> | null;
|
|
22
|
+
readonly name: ReadonlyArray<string | null> | null;
|
|
23
|
+
readonly newsletterOptIn: ReadonlyArray<string | null> | null;
|
|
24
|
+
} | null;
|
|
19
25
|
readonly order: {
|
|
20
26
|
readonly " $fragmentSpreads": FragmentRefs<"CartOrder_order">;
|
|
21
27
|
} | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<796d04529c0ea8f6b6236945a158b754>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -34,13 +34,36 @@ const node = function () {
|
|
|
34
34
|
"storageKey": null
|
|
35
35
|
},
|
|
36
36
|
v4 = {
|
|
37
|
+
"alias": null,
|
|
38
|
+
"args": null,
|
|
39
|
+
"kind": "ScalarField",
|
|
40
|
+
"name": "newsletterOptIn",
|
|
41
|
+
"storageKey": null
|
|
42
|
+
},
|
|
43
|
+
v5 = {
|
|
44
|
+
"alias": null,
|
|
45
|
+
"args": null,
|
|
46
|
+
"concreteType": "UpdateCustomerErrors",
|
|
47
|
+
"kind": "LinkedField",
|
|
48
|
+
"name": "errors",
|
|
49
|
+
"plural": false,
|
|
50
|
+
"selections": [v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, {
|
|
51
|
+
"alias": null,
|
|
52
|
+
"args": null,
|
|
53
|
+
"kind": "ScalarField",
|
|
54
|
+
"name": "coupon",
|
|
55
|
+
"storageKey": null
|
|
56
|
+
}],
|
|
57
|
+
"storageKey": null
|
|
58
|
+
},
|
|
59
|
+
v6 = {
|
|
37
60
|
"alias": null,
|
|
38
61
|
"args": null,
|
|
39
62
|
"kind": "ScalarField",
|
|
40
63
|
"name": "id",
|
|
41
64
|
"storageKey": null
|
|
42
65
|
},
|
|
43
|
-
|
|
66
|
+
v7 = [v2 /*: any*/, {
|
|
44
67
|
"alias": null,
|
|
45
68
|
"args": null,
|
|
46
69
|
"kind": "ScalarField",
|
|
@@ -107,49 +130,49 @@ const node = function () {
|
|
|
107
130
|
"name": "addressFormatted",
|
|
108
131
|
"storageKey": null
|
|
109
132
|
}],
|
|
110
|
-
|
|
133
|
+
v8 = {
|
|
111
134
|
"alias": null,
|
|
112
135
|
"args": null,
|
|
113
136
|
"kind": "ScalarField",
|
|
114
137
|
"name": "amount",
|
|
115
138
|
"storageKey": null
|
|
116
139
|
},
|
|
117
|
-
|
|
140
|
+
v9 = [v8 /*: any*/, {
|
|
118
141
|
"alias": null,
|
|
119
142
|
"args": null,
|
|
120
143
|
"kind": "ScalarField",
|
|
121
144
|
"name": "currency",
|
|
122
145
|
"storageKey": null
|
|
123
146
|
}],
|
|
124
|
-
|
|
125
|
-
|
|
147
|
+
v10 = [v6 /*: any*/],
|
|
148
|
+
v11 = {
|
|
126
149
|
"alias": null,
|
|
127
150
|
"args": null,
|
|
128
151
|
"concreteType": "LicenseOption",
|
|
129
152
|
"kind": "LinkedField",
|
|
130
153
|
"name": "licenseOptions",
|
|
131
154
|
"plural": true,
|
|
132
|
-
"selections":
|
|
155
|
+
"selections": v10 /*: any*/,
|
|
133
156
|
"storageKey": null
|
|
134
157
|
},
|
|
135
|
-
|
|
158
|
+
v12 = {
|
|
136
159
|
"alias": null,
|
|
137
160
|
"args": null,
|
|
138
161
|
"concreteType": "Money",
|
|
139
162
|
"kind": "LinkedField",
|
|
140
163
|
"name": "price",
|
|
141
164
|
"plural": false,
|
|
142
|
-
"selections":
|
|
165
|
+
"selections": v9 /*: any*/,
|
|
143
166
|
"storageKey": null
|
|
144
167
|
},
|
|
145
|
-
|
|
168
|
+
v13 = {
|
|
146
169
|
"alias": null,
|
|
147
170
|
"args": null,
|
|
148
171
|
"kind": "ScalarField",
|
|
149
172
|
"name": "cssFamily",
|
|
150
173
|
"storageKey": null
|
|
151
174
|
},
|
|
152
|
-
|
|
175
|
+
v14 = {
|
|
153
176
|
"alias": null,
|
|
154
177
|
"args": null,
|
|
155
178
|
"concreteType": "WebfontSource",
|
|
@@ -177,7 +200,7 @@ const node = function () {
|
|
|
177
200
|
}],
|
|
178
201
|
"storageKey": null
|
|
179
202
|
},
|
|
180
|
-
|
|
203
|
+
v15 = {
|
|
181
204
|
"alias": null,
|
|
182
205
|
"args": null,
|
|
183
206
|
"concreteType": "VerticalMetrics",
|
|
@@ -217,23 +240,23 @@ const node = function () {
|
|
|
217
240
|
}],
|
|
218
241
|
"storageKey": null
|
|
219
242
|
},
|
|
220
|
-
|
|
221
|
-
|
|
243
|
+
v16 = [v13 /*: any*/, v2 /*: any*/, v14 /*: any*/, v15 /*: any*/, v6 /*: any*/],
|
|
244
|
+
v17 = {
|
|
222
245
|
"alias": null,
|
|
223
246
|
"args": null,
|
|
224
247
|
"kind": "ScalarField",
|
|
225
248
|
"name": "totalStyles",
|
|
226
249
|
"storageKey": null
|
|
227
250
|
},
|
|
228
|
-
|
|
229
|
-
|
|
251
|
+
v18 = [v2 /*: any*/, v6 /*: any*/],
|
|
252
|
+
v19 = {
|
|
230
253
|
"alias": null,
|
|
231
254
|
"args": null,
|
|
232
255
|
"concreteType": "FontCollection",
|
|
233
256
|
"kind": "LinkedField",
|
|
234
257
|
"name": "fontCollection",
|
|
235
258
|
"plural": false,
|
|
236
|
-
"selections":
|
|
259
|
+
"selections": v18 /*: any*/,
|
|
237
260
|
"storageKey": null
|
|
238
261
|
};
|
|
239
262
|
return {
|
|
@@ -262,7 +285,7 @@ const node = function () {
|
|
|
262
285
|
"name": "CartOrder_order"
|
|
263
286
|
}],
|
|
264
287
|
"storageKey": null
|
|
265
|
-
}],
|
|
288
|
+
}, v5 /*: any*/],
|
|
266
289
|
"storageKey": null
|
|
267
290
|
}],
|
|
268
291
|
"type": "RootMutationType",
|
|
@@ -300,13 +323,7 @@ const node = function () {
|
|
|
300
323
|
"kind": "LinkedField",
|
|
301
324
|
"name": "customer",
|
|
302
325
|
"plural": false,
|
|
303
|
-
"selections": [v2 /*: any*/, v3 /*: any*/, {
|
|
304
|
-
"alias": null,
|
|
305
|
-
"args": null,
|
|
306
|
-
"kind": "ScalarField",
|
|
307
|
-
"name": "newsletterOptIn",
|
|
308
|
-
"storageKey": null
|
|
309
|
-
}, v4 /*: any*/, {
|
|
326
|
+
"selections": [v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, v6 /*: any*/, {
|
|
310
327
|
"alias": null,
|
|
311
328
|
"args": null,
|
|
312
329
|
"kind": "ScalarField",
|
|
@@ -321,7 +338,7 @@ const node = function () {
|
|
|
321
338
|
"kind": "LinkedField",
|
|
322
339
|
"name": "billingIdentity",
|
|
323
340
|
"plural": false,
|
|
324
|
-
"selections":
|
|
341
|
+
"selections": v7 /*: any*/,
|
|
325
342
|
"storageKey": null
|
|
326
343
|
}, {
|
|
327
344
|
"alias": null,
|
|
@@ -330,7 +347,7 @@ const node = function () {
|
|
|
330
347
|
"kind": "LinkedField",
|
|
331
348
|
"name": "licenseeIdentity",
|
|
332
349
|
"plural": false,
|
|
333
|
-
"selections":
|
|
350
|
+
"selections": v7 /*: any*/,
|
|
334
351
|
"storageKey": null
|
|
335
352
|
}, {
|
|
336
353
|
"alias": null,
|
|
@@ -338,7 +355,7 @@ const node = function () {
|
|
|
338
355
|
"kind": "ScalarField",
|
|
339
356
|
"name": "licenseeIsBillingIdentity",
|
|
340
357
|
"storageKey": null
|
|
341
|
-
},
|
|
358
|
+
}, v6 /*: any*/, {
|
|
342
359
|
"alias": null,
|
|
343
360
|
"args": null,
|
|
344
361
|
"kind": "ScalarField",
|
|
@@ -357,7 +374,7 @@ const node = function () {
|
|
|
357
374
|
"kind": "LinkedField",
|
|
358
375
|
"name": "subtotal",
|
|
359
376
|
"plural": false,
|
|
360
|
-
"selections":
|
|
377
|
+
"selections": v9 /*: any*/,
|
|
361
378
|
"storageKey": null
|
|
362
379
|
}, {
|
|
363
380
|
"alias": null,
|
|
@@ -373,7 +390,7 @@ const node = function () {
|
|
|
373
390
|
"kind": "LinkedField",
|
|
374
391
|
"name": "amount",
|
|
375
392
|
"plural": false,
|
|
376
|
-
"selections":
|
|
393
|
+
"selections": v9 /*: any*/,
|
|
377
394
|
"storageKey": null
|
|
378
395
|
}, {
|
|
379
396
|
"alias": null,
|
|
@@ -401,7 +418,7 @@ const node = function () {
|
|
|
401
418
|
"kind": "LinkedField",
|
|
402
419
|
"name": "creditAmount",
|
|
403
420
|
"plural": false,
|
|
404
|
-
"selections":
|
|
421
|
+
"selections": v9 /*: any*/,
|
|
405
422
|
"storageKey": null
|
|
406
423
|
}, {
|
|
407
424
|
"alias": null,
|
|
@@ -410,11 +427,11 @@ const node = function () {
|
|
|
410
427
|
"kind": "LinkedField",
|
|
411
428
|
"name": "creditAmountRemaining",
|
|
412
429
|
"plural": false,
|
|
413
|
-
"selections":
|
|
430
|
+
"selections": v9 /*: any*/,
|
|
414
431
|
"storageKey": null
|
|
415
|
-
},
|
|
432
|
+
}, v6 /*: any*/],
|
|
416
433
|
"storageKey": null
|
|
417
|
-
},
|
|
434
|
+
}, v6 /*: any*/],
|
|
418
435
|
"storageKey": null
|
|
419
436
|
}, {
|
|
420
437
|
"alias": null,
|
|
@@ -423,7 +440,7 @@ const node = function () {
|
|
|
423
440
|
"kind": "LinkedField",
|
|
424
441
|
"name": "discountedSubtotal",
|
|
425
442
|
"plural": false,
|
|
426
|
-
"selections":
|
|
443
|
+
"selections": v9 /*: any*/,
|
|
427
444
|
"storageKey": null
|
|
428
445
|
}, {
|
|
429
446
|
"alias": null,
|
|
@@ -432,7 +449,7 @@ const node = function () {
|
|
|
432
449
|
"kind": "LinkedField",
|
|
433
450
|
"name": "total",
|
|
434
451
|
"plural": false,
|
|
435
|
-
"selections":
|
|
452
|
+
"selections": v9 /*: any*/,
|
|
436
453
|
"storageKey": null
|
|
437
454
|
}, {
|
|
438
455
|
"alias": null,
|
|
@@ -447,7 +464,7 @@ const node = function () {
|
|
|
447
464
|
"kind": "LinkedField",
|
|
448
465
|
"name": "taxes",
|
|
449
466
|
"plural": false,
|
|
450
|
-
"selections":
|
|
467
|
+
"selections": v9 /*: any*/,
|
|
451
468
|
"storageKey": null
|
|
452
469
|
}, {
|
|
453
470
|
"alias": null,
|
|
@@ -480,7 +497,7 @@ const node = function () {
|
|
|
480
497
|
"kind": "LinkedField",
|
|
481
498
|
"name": "orderItems",
|
|
482
499
|
"plural": true,
|
|
483
|
-
"selections": [
|
|
500
|
+
"selections": [v6 /*: any*/, {
|
|
484
501
|
"alias": null,
|
|
485
502
|
"args": null,
|
|
486
503
|
"concreteType": "LicenseSelection",
|
|
@@ -494,14 +511,14 @@ const node = function () {
|
|
|
494
511
|
"kind": "LinkedField",
|
|
495
512
|
"name": "license",
|
|
496
513
|
"plural": false,
|
|
497
|
-
"selections": [
|
|
514
|
+
"selections": [v6 /*: any*/, {
|
|
498
515
|
"alias": null,
|
|
499
516
|
"args": null,
|
|
500
517
|
"concreteType": "License",
|
|
501
518
|
"kind": "LinkedField",
|
|
502
519
|
"name": "excludedLicenses",
|
|
503
520
|
"plural": true,
|
|
504
|
-
"selections":
|
|
521
|
+
"selections": v10 /*: any*/,
|
|
505
522
|
"storageKey": null
|
|
506
523
|
}, v2 /*: any*/, {
|
|
507
524
|
"alias": null,
|
|
@@ -510,14 +527,14 @@ const node = function () {
|
|
|
510
527
|
"kind": "LinkedField",
|
|
511
528
|
"name": "licenseVariables",
|
|
512
529
|
"plural": true,
|
|
513
|
-
"selections": [
|
|
530
|
+
"selections": [v6 /*: any*/, {
|
|
514
531
|
"alias": null,
|
|
515
532
|
"args": null,
|
|
516
533
|
"concreteType": "LicenseOption",
|
|
517
534
|
"kind": "LinkedField",
|
|
518
535
|
"name": "licenseOptions",
|
|
519
536
|
"plural": true,
|
|
520
|
-
"selections": [
|
|
537
|
+
"selections": [v6 /*: any*/, v2 /*: any*/, v8 /*: any*/],
|
|
521
538
|
"storageKey": null
|
|
522
539
|
}],
|
|
523
540
|
"storageKey": null
|
|
@@ -530,7 +547,7 @@ const node = function () {
|
|
|
530
547
|
"kind": "LinkedField",
|
|
531
548
|
"name": "licenseVariable",
|
|
532
549
|
"plural": false,
|
|
533
|
-
"selections": [
|
|
550
|
+
"selections": [v6 /*: any*/, {
|
|
534
551
|
"alias": null,
|
|
535
552
|
"args": null,
|
|
536
553
|
"kind": "ScalarField",
|
|
@@ -542,7 +559,7 @@ const node = function () {
|
|
|
542
559
|
"kind": "ScalarField",
|
|
543
560
|
"name": "variableType",
|
|
544
561
|
"storageKey": null
|
|
545
|
-
},
|
|
562
|
+
}, v11 /*: any*/],
|
|
546
563
|
"storageKey": null
|
|
547
564
|
}, {
|
|
548
565
|
"alias": null,
|
|
@@ -551,13 +568,13 @@ const node = function () {
|
|
|
551
568
|
"kind": "LinkedField",
|
|
552
569
|
"name": "licenseOption",
|
|
553
570
|
"plural": false,
|
|
554
|
-
"selections": [
|
|
571
|
+
"selections": [v6 /*: any*/, {
|
|
555
572
|
"alias": null,
|
|
556
573
|
"args": null,
|
|
557
574
|
"kind": "ScalarField",
|
|
558
575
|
"name": "amounts",
|
|
559
576
|
"storageKey": null
|
|
560
|
-
}, v2 /*: any*/,
|
|
577
|
+
}, v2 /*: any*/, v8 /*: any*/],
|
|
561
578
|
"storageKey": null
|
|
562
579
|
}, {
|
|
563
580
|
"alias": null,
|
|
@@ -565,16 +582,16 @@ const node = function () {
|
|
|
565
582
|
"kind": "ScalarField",
|
|
566
583
|
"name": "variableText",
|
|
567
584
|
"storageKey": null
|
|
568
|
-
},
|
|
585
|
+
}, v6 /*: any*/],
|
|
569
586
|
"storageKey": null
|
|
570
|
-
},
|
|
587
|
+
}, v12 /*: any*/, {
|
|
571
588
|
"alias": null,
|
|
572
589
|
"args": null,
|
|
573
590
|
"concreteType": "Sku",
|
|
574
591
|
"kind": "LinkedField",
|
|
575
592
|
"name": "sku",
|
|
576
593
|
"plural": false,
|
|
577
|
-
"selections": [
|
|
594
|
+
"selections": [v12 /*: any*/, {
|
|
578
595
|
"alias": null,
|
|
579
596
|
"args": null,
|
|
580
597
|
"concreteType": null,
|
|
@@ -599,7 +616,7 @@ const node = function () {
|
|
|
599
616
|
"kind": "LinkedField",
|
|
600
617
|
"name": "featureStyle",
|
|
601
618
|
"plural": false,
|
|
602
|
-
"selections":
|
|
619
|
+
"selections": v16 /*: any*/,
|
|
603
620
|
"storageKey": null
|
|
604
621
|
}, v2 /*: any*/, {
|
|
605
622
|
"alias": null,
|
|
@@ -607,7 +624,7 @@ const node = function () {
|
|
|
607
624
|
"kind": "ScalarField",
|
|
608
625
|
"name": "isVariableFont",
|
|
609
626
|
"storageKey": null
|
|
610
|
-
},
|
|
627
|
+
}, v17 /*: any*/],
|
|
611
628
|
"type": "FontCollection",
|
|
612
629
|
"abstractKey": null
|
|
613
630
|
}, {
|
|
@@ -619,21 +636,21 @@ const node = function () {
|
|
|
619
636
|
"kind": "LinkedField",
|
|
620
637
|
"name": "fontStyles",
|
|
621
638
|
"plural": true,
|
|
622
|
-
"selections":
|
|
639
|
+
"selections": v16 /*: any*/,
|
|
623
640
|
"storageKey": null
|
|
624
|
-
}, v2 /*: any*/,
|
|
641
|
+
}, v2 /*: any*/, v19 /*: any*/],
|
|
625
642
|
"type": "Bundle",
|
|
626
643
|
"abstractKey": null
|
|
627
644
|
}, {
|
|
628
645
|
"kind": "InlineFragment",
|
|
629
|
-
"selections": [
|
|
646
|
+
"selections": [v13 /*: any*/, v2 /*: any*/, v14 /*: any*/, v15 /*: any*/, {
|
|
630
647
|
"alias": null,
|
|
631
648
|
"args": null,
|
|
632
649
|
"concreteType": "FontCollection",
|
|
633
650
|
"kind": "LinkedField",
|
|
634
651
|
"name": "family",
|
|
635
652
|
"plural": false,
|
|
636
|
-
"selections":
|
|
653
|
+
"selections": v18 /*: any*/,
|
|
637
654
|
"storageKey": null
|
|
638
655
|
}, {
|
|
639
656
|
"alias": null,
|
|
@@ -649,7 +666,7 @@ const node = function () {
|
|
|
649
666
|
"abstractKey": null
|
|
650
667
|
}, {
|
|
651
668
|
"kind": "InlineFragment",
|
|
652
|
-
"selections": [v2 /*: any*/,
|
|
669
|
+
"selections": [v2 /*: any*/, v17 /*: any*/, v19 /*: any*/],
|
|
653
670
|
"type": "CollectionBundle",
|
|
654
671
|
"abstractKey": null
|
|
655
672
|
}, {
|
|
@@ -661,14 +678,14 @@ const node = function () {
|
|
|
661
678
|
"kind": "LinkedField",
|
|
662
679
|
"name": "licenses",
|
|
663
680
|
"plural": true,
|
|
664
|
-
"selections": [
|
|
681
|
+
"selections": [v6 /*: any*/, v2 /*: any*/, {
|
|
665
682
|
"alias": null,
|
|
666
683
|
"args": null,
|
|
667
684
|
"concreteType": "LicenseVariable",
|
|
668
685
|
"kind": "LinkedField",
|
|
669
686
|
"name": "licenseVariables",
|
|
670
687
|
"plural": true,
|
|
671
|
-
"selections": [
|
|
688
|
+
"selections": [v6 /*: any*/, v11 /*: any*/],
|
|
672
689
|
"storageKey": null
|
|
673
690
|
}],
|
|
674
691
|
"storageKey": null
|
|
@@ -677,12 +694,12 @@ const node = function () {
|
|
|
677
694
|
"abstractKey": "__isLicenseable"
|
|
678
695
|
}, {
|
|
679
696
|
"kind": "InlineFragment",
|
|
680
|
-
"selections":
|
|
697
|
+
"selections": v10 /*: any*/,
|
|
681
698
|
"type": "Node",
|
|
682
699
|
"abstractKey": "__isNode"
|
|
683
700
|
}],
|
|
684
701
|
"storageKey": null
|
|
685
|
-
},
|
|
702
|
+
}, v6 /*: any*/],
|
|
686
703
|
"storageKey": null
|
|
687
704
|
}],
|
|
688
705
|
"storageKey": null
|
|
@@ -700,7 +717,7 @@ const node = function () {
|
|
|
700
717
|
"kind": "LinkedField",
|
|
701
718
|
"name": "orderVariable",
|
|
702
719
|
"plural": false,
|
|
703
|
-
"selections":
|
|
720
|
+
"selections": v10 /*: any*/,
|
|
704
721
|
"storageKey": null
|
|
705
722
|
}, {
|
|
706
723
|
"alias": null,
|
|
@@ -709,7 +726,7 @@ const node = function () {
|
|
|
709
726
|
"kind": "LinkedField",
|
|
710
727
|
"name": "orderVariableOption",
|
|
711
728
|
"plural": false,
|
|
712
|
-
"selections":
|
|
729
|
+
"selections": v10 /*: any*/,
|
|
713
730
|
"storageKey": null
|
|
714
731
|
}, {
|
|
715
732
|
"alias": null,
|
|
@@ -717,7 +734,7 @@ const node = function () {
|
|
|
717
734
|
"kind": "ScalarField",
|
|
718
735
|
"name": "countryCode",
|
|
719
736
|
"storageKey": null
|
|
720
|
-
},
|
|
737
|
+
}, v6 /*: any*/],
|
|
721
738
|
"storageKey": null
|
|
722
739
|
}, {
|
|
723
740
|
"alias": null,
|
|
@@ -766,19 +783,19 @@ const node = function () {
|
|
|
766
783
|
"storageKey": null
|
|
767
784
|
}],
|
|
768
785
|
"storageKey": null
|
|
769
|
-
}],
|
|
786
|
+
}, v5 /*: any*/],
|
|
770
787
|
"storageKey": null
|
|
771
788
|
}]
|
|
772
789
|
},
|
|
773
790
|
"params": {
|
|
774
|
-
"cacheID": "
|
|
791
|
+
"cacheID": "42f4aacb7984635baeb967f560d8d683",
|
|
775
792
|
"id": null,
|
|
776
793
|
"metadata": {},
|
|
777
794
|
"name": "CheckoutUpdateCustomerMutation",
|
|
778
795
|
"operationKind": "mutation",
|
|
779
|
-
"text": "mutation CheckoutUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...CartOrder_order\n id\n }\n }\n}\n\nfragment CartItemAdditionalLicenses_licenses on License {\n id\n name\n}\n\nfragment CartItemAdditionalLicenses_orderItem on OrderItem {\n licenseSelections {\n license {\n id\n excludedLicenses {\n id\n }\n }\n id\n }\n}\n\nfragment CartItemLicense_selection on LicenseSelection {\n id\n license {\n id\n name\n licenseVariables {\n id\n ...CartItemVariable_variable\n }\n }\n licenseVariable {\n id\n }\n ...CartItemVariable_selection\n}\n\nfragment CartItemProduct_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ...CollectionAa_product\n ...FontStyle_fontStyle\n ... on FontStyle {\n family {\n name\n id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n fontCollection {\n name\n id\n }\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n }\n ... on CollectionBundle {\n name\n totalStyles\n fontCollection {\n name\n id\n }\n }\n}\n\nfragment CartItemVariable_selection on LicenseSelection {\n id\n variableText\n license {\n id\n }\n licenseVariable {\n ...VariableTableAmounts_variable\n id\n name\n variableType\n licenseOptions {\n id\n }\n }\n licenseOption {\n ...VariableTableAmounts_option\n id\n name\n amount\n }\n}\n\nfragment CartItemVariable_variable on LicenseVariable {\n id\n licenseOptions {\n id\n name\n amount\n }\n}\n\nfragment CartItem_node on OrderItem {\n ...CartItemAdditionalLicenses_orderItem\n id\n price {\n ...Price_price\n }\n sku {\n price {\n ...Price_price\n }\n product {\n ...CartItemProduct_product\n __typename\n ... on Licenseable {\n __isLicenseable: __typename\n licenses {\n ...CartItemAdditionalLicenses_licenses\n id\n licenseVariables {\n id\n licenseOptions {\n id\n }\n }\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n licenseSelections {\n ...CartItemLicense_selection\n id\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n }\n}\n\nfragment CartOrder_order on Order {\n ...Checkout_order\n ...Download_order\n ...CartTotals_order\n ...CartState_order\n id\n orderItems {\n ...CartItem_node\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n variableType\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n id\n }\n discount {\n id\n }\n customer {\n email\n name\n anonymous\n id\n }\n billingIdentity {\n ...IdentityBox_identity\n }\n licenseeIdentity {\n ...IdentityBox_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brand\n }\n }\n stripePaymentIntent {\n status\n }\n canCompleteWithCoupon\n completedWithCoupon\n}\n\nfragment CartState_order on Order {\n id\n orderItems {\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n countryCode\n id\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxRate\n taxes {\n ...Price_price\n }\n taxName\n taxNotApplicable\n taxNotApplicableReason\n gstIncluded\n}\n\nfragment Checkout_order on Order {\n canCompleteWithCoupon\n customer {\n name\n email\n newsletterOptIn\n id\n }\n billingIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIsBillingIdentity\n}\n\nfragment CollectionAa_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ... on FontCollection {\n featureStyle {\n ...FontStyle_fontStyle\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmount {\n amount\n currency\n }\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Download_order on Order {\n id\n archiveUrl\n customer {\n email\n id\n }\n completedWithCoupon\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment IdentityBox_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
796
|
+
"text": "mutation CheckoutUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...CartOrder_order\n id\n }\n errors {\n name\n email\n newsletterOptIn\n coupon\n }\n }\n}\n\nfragment CartItemAdditionalLicenses_licenses on License {\n id\n name\n}\n\nfragment CartItemAdditionalLicenses_orderItem on OrderItem {\n licenseSelections {\n license {\n id\n excludedLicenses {\n id\n }\n }\n id\n }\n}\n\nfragment CartItemLicense_selection on LicenseSelection {\n id\n license {\n id\n name\n licenseVariables {\n id\n ...CartItemVariable_variable\n }\n }\n licenseVariable {\n id\n }\n ...CartItemVariable_selection\n}\n\nfragment CartItemProduct_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ...CollectionAa_product\n ...FontStyle_fontStyle\n ... on FontStyle {\n family {\n name\n id\n }\n name\n variableInstances {\n name\n }\n }\n ... on Bundle {\n name\n fontCollection {\n name\n id\n }\n }\n ... on FontCollection {\n name\n isVariableFont\n totalStyles\n }\n ... on CollectionBundle {\n name\n totalStyles\n fontCollection {\n name\n id\n }\n }\n}\n\nfragment CartItemVariable_selection on LicenseSelection {\n id\n variableText\n license {\n id\n }\n licenseVariable {\n ...VariableTableAmounts_variable\n id\n name\n variableType\n licenseOptions {\n id\n }\n }\n licenseOption {\n ...VariableTableAmounts_option\n id\n name\n amount\n }\n}\n\nfragment CartItemVariable_variable on LicenseVariable {\n id\n licenseOptions {\n id\n name\n amount\n }\n}\n\nfragment CartItem_node on OrderItem {\n ...CartItemAdditionalLicenses_orderItem\n id\n price {\n ...Price_price\n }\n sku {\n price {\n ...Price_price\n }\n product {\n ...CartItemProduct_product\n __typename\n ... on Licenseable {\n __isLicenseable: __typename\n licenses {\n ...CartItemAdditionalLicenses_licenses\n id\n licenseVariables {\n id\n licenseOptions {\n id\n }\n }\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n licenseSelections {\n ...CartItemLicense_selection\n id\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n }\n}\n\nfragment CartOrder_order on Order {\n ...Checkout_order\n ...Download_order\n ...CartTotals_order\n ...CartState_order\n id\n orderItems {\n ...CartItem_node\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n variableType\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n id\n }\n discount {\n id\n }\n customer {\n email\n name\n anonymous\n id\n }\n billingIdentity {\n ...IdentityBox_identity\n }\n licenseeIdentity {\n ...IdentityBox_identity\n }\n licenseeIsBillingIdentity\n stripePaymentMethod {\n card {\n last4\n brand\n }\n }\n stripePaymentIntent {\n status\n }\n canCompleteWithCoupon\n completedWithCoupon\n}\n\nfragment CartState_order on Order {\n id\n orderItems {\n id\n licenseSelections {\n license {\n id\n }\n licenseVariable {\n id\n }\n licenseOption {\n id\n }\n variableText\n id\n }\n }\n orderVariableSelections {\n orderVariable {\n id\n }\n orderVariableOption {\n id\n }\n countryCode\n id\n }\n}\n\nfragment CartTotals_order on Order {\n subtotal {\n ...Price_price\n }\n discount {\n amount {\n amount\n ...Price_price\n }\n coupon {\n ...CouponText_coupon\n id\n }\n id\n }\n discountedSubtotal {\n ...Price_price\n }\n total {\n amount\n ...Price_price\n }\n taxRate\n taxes {\n ...Price_price\n }\n taxName\n taxNotApplicable\n taxNotApplicableReason\n gstIncluded\n}\n\nfragment Checkout_order on Order {\n canCompleteWithCoupon\n customer {\n name\n email\n newsletterOptIn\n id\n }\n billingIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIdentity {\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n licenseeIsBillingIdentity\n}\n\nfragment CollectionAa_product on SkuProduct {\n __isSkuProduct: __typename\n __typename\n ... on FontCollection {\n featureStyle {\n ...FontStyle_fontStyle\n id\n }\n }\n ... on Bundle {\n fontStyles {\n ...FontStyle_fontStyle\n id\n }\n }\n}\n\nfragment CouponText_coupon on Coupon {\n type\n percentAmount\n creditAmount {\n amount\n currency\n }\n creditAmountRemaining {\n amount\n currency\n }\n}\n\nfragment Download_order on Order {\n id\n archiveUrl\n customer {\n email\n id\n }\n completedWithCoupon\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment IdentityBox_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment VariableTableAmounts_option on LicenseOption {\n amounts\n}\n\nfragment VariableTableAmounts_variable on LicenseVariable {\n units\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
780
797
|
}
|
|
781
798
|
};
|
|
782
799
|
}();
|
|
783
|
-
node.hash = "
|
|
800
|
+
node.hash = "6cf3a893d17d4059cdad72af115b10ed";
|
|
784
801
|
export default node;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<c39ff0b9a13f384bdd0130a788ead992>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -17,6 +17,7 @@ export type StoreModalUnifiedCheckoutUpdateCustomerMutation$variables = {
|
|
|
17
17
|
export type StoreModalUnifiedCheckoutUpdateCustomerMutation$data = {
|
|
18
18
|
readonly updateCustomer: {
|
|
19
19
|
readonly errors: {
|
|
20
|
+
readonly coupon: ReadonlyArray<string | null> | null;
|
|
20
21
|
readonly email: ReadonlyArray<string | null> | null;
|
|
21
22
|
readonly name: ReadonlyArray<string | null> | null;
|
|
22
23
|
readonly newsletterOptIn: ReadonlyArray<string | null> | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<c39ff0b9a13f384bdd0130a788ead992>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -47,7 +47,13 @@ const node = function () {
|
|
|
47
47
|
"kind": "LinkedField",
|
|
48
48
|
"name": "errors",
|
|
49
49
|
"plural": false,
|
|
50
|
-
"selections": [v2 /*: any*/, v3 /*: any*/, v4 /*: any
|
|
50
|
+
"selections": [v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, {
|
|
51
|
+
"alias": null,
|
|
52
|
+
"args": null,
|
|
53
|
+
"kind": "ScalarField",
|
|
54
|
+
"name": "coupon",
|
|
55
|
+
"storageKey": null
|
|
56
|
+
}],
|
|
51
57
|
"storageKey": null
|
|
52
58
|
},
|
|
53
59
|
v6 = {
|
|
@@ -303,14 +309,14 @@ const node = function () {
|
|
|
303
309
|
}]
|
|
304
310
|
},
|
|
305
311
|
"params": {
|
|
306
|
-
"cacheID": "
|
|
312
|
+
"cacheID": "d70ed8aafb03bf94f6f4ca668b7f8893",
|
|
307
313
|
"id": null,
|
|
308
314
|
"metadata": {},
|
|
309
315
|
"name": "StoreModalUnifiedCheckoutUpdateCustomerMutation",
|
|
310
316
|
"operationKind": "mutation",
|
|
311
|
-
"text": "mutation StoreModalUnifiedCheckoutUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...StoreModalUnifiedCheckout_order\n id\n }\n errors {\n name\n email\n newsletterOptIn\n }\n }\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalUnifiedCheckout_order on Order {\n completeUrl\n canCompleteWithCoupon\n total {\n amount\n }\n customer {\n name\n email\n newsletterOptIn\n id\n }\n licenseeIsBillingIdentity\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n billingIdentity {\n ...StoreModalReviewIdentity_identity\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n stripePaymentIntent {\n clientSecret\n amount\n currency\n }\n orderVariableSelections {\n orderVariable {\n id\n variableType\n }\n orderVariableOption {\n id\n }\n countryCode\n id\n }\n}\n"
|
|
317
|
+
"text": "mutation StoreModalUnifiedCheckoutUpdateCustomerMutation(\n $input: UpdateCustomerInput!\n) {\n updateCustomer(input: $input) {\n order {\n ...StoreModalUnifiedCheckout_order\n id\n }\n errors {\n name\n email\n newsletterOptIn\n coupon\n }\n }\n}\n\nfragment StoreModalReviewIdentity_identity on Identity {\n email\n phoneFormatted\n addressFormatted\n vatNumber\n}\n\nfragment StoreModalUnifiedCheckout_order on Order {\n completeUrl\n canCompleteWithCoupon\n total {\n amount\n }\n customer {\n name\n email\n newsletterOptIn\n id\n }\n licenseeIsBillingIdentity\n licenseeIdentity {\n ...StoreModalReviewIdentity_identity\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n billingIdentity {\n ...StoreModalReviewIdentity_identity\n name\n organization\n email\n phoneNullable\n street\n locality\n sublocality\n country\n administrativeArea\n zip\n vatNumber\n }\n stripePaymentIntent {\n clientSecret\n amount\n currency\n }\n orderVariableSelections {\n orderVariable {\n id\n variableType\n }\n orderVariableOption {\n id\n }\n countryCode\n id\n }\n}\n"
|
|
312
318
|
}
|
|
313
319
|
};
|
|
314
320
|
}();
|
|
315
|
-
node.hash = "
|
|
321
|
+
node.hash = "dac1a266d63dfa7bee9f22a9373e855a";
|
|
316
322
|
export default node;
|
|
@@ -21,7 +21,7 @@ const DESKTOP = 'desktop';
|
|
|
21
21
|
// are required
|
|
22
22
|
const IDENTITY_REQUIRED_FIELDS = ['name', 'email', 'country'];
|
|
23
23
|
_Checkout_identity.hash && _Checkout_identity.hash !== "bd574bf28c2ab018312eb3f033fabb73" && console.error("The definition of 'Checkout_identity' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _Checkout_identity;
|
|
24
|
-
const updateCustomerMutation = (_CheckoutUpdateCustomerMutation.hash && _CheckoutUpdateCustomerMutation.hash !== "
|
|
24
|
+
const updateCustomerMutation = (_CheckoutUpdateCustomerMutation.hash && _CheckoutUpdateCustomerMutation.hash !== "6cf3a893d17d4059cdad72af115b10ed" && console.error("The definition of 'CheckoutUpdateCustomerMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CheckoutUpdateCustomerMutation);
|
|
25
25
|
_Checkout_UpdateOrderErrors.hash && _Checkout_UpdateOrderErrors.hash !== "15a33f6b0c5a3de7f1b1dee6982f12ff" && console.error("The definition of 'Checkout_UpdateOrderErrors' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _Checkout_UpdateOrderErrors;
|
|
26
26
|
const updateOrderMutation = (_CheckoutUpdateOrderMutation.hash && _CheckoutUpdateOrderMutation.hash !== "089745e2478edf385a09357905e4173c" && console.error("The definition of 'CheckoutUpdateOrderMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CheckoutUpdateOrderMutation);
|
|
27
27
|
const Checkout = _ref => {
|
|
@@ -94,16 +94,27 @@ const Checkout = _ref => {
|
|
|
94
94
|
useEffect(() => {
|
|
95
95
|
setError(null);
|
|
96
96
|
setErrorsObject(null);
|
|
97
|
+
setCustomerErrorsObject(null);
|
|
97
98
|
onScrollToTop();
|
|
98
99
|
}, [checkoutStep]);
|
|
99
100
|
const environment = useRelayEnvironment();
|
|
100
101
|
const [errorsObject, setErrorsObject] = useState(null);
|
|
102
|
+
const [customerErrorsObject, setCustomerErrorsObject] = useState(null);
|
|
101
103
|
const onCompleted = (res, errors, onSuccess) => {
|
|
102
|
-
var _res$updateOrder;
|
|
104
|
+
var _res$updateCustomer, _res$updateOrder;
|
|
103
105
|
if (errors && errors.length > 0) {
|
|
104
106
|
setError(errors[0].message);
|
|
105
107
|
setSubmitting(false);
|
|
106
108
|
onScrollToTop();
|
|
109
|
+
} else if ('updateCustomer' in res && (_res$updateCustomer = res.updateCustomer) !== null && _res$updateCustomer !== void 0 && _res$updateCustomer.errors) {
|
|
110
|
+
var _res$updateCustomer$e;
|
|
111
|
+
// The customer wasn't saved, so don't advance the step. A coupon error
|
|
112
|
+
// isn't about any field the customer can edit here — it means the coupon
|
|
113
|
+
// already on the order isn't usable by them — so it goes in the banner.
|
|
114
|
+
setSubmitting(false);
|
|
115
|
+
setCustomerErrorsObject(res.updateCustomer.errors);
|
|
116
|
+
setError(((_res$updateCustomer$e = res.updateCustomer.errors.coupon) === null || _res$updateCustomer$e === void 0 ? void 0 : _res$updateCustomer$e[0]) ?? null);
|
|
117
|
+
onScrollToTop();
|
|
107
118
|
} else if ('updateOrder' in res && (_res$updateOrder = res.updateOrder) !== null && _res$updateOrder !== void 0 && _res$updateOrder.errors) {
|
|
108
119
|
setSubmitting(false);
|
|
109
120
|
setErrorsObject(res.updateOrder.errors);
|
|
@@ -340,7 +351,8 @@ const Checkout = _ref => {
|
|
|
340
351
|
title: "Contact information",
|
|
341
352
|
value: customer,
|
|
342
353
|
onChange: handleCustomerChange,
|
|
343
|
-
optInLabel: (_viewerData$settings2 = viewerData.settings) === null || _viewerData$settings2 === void 0 ? void 0 : _viewerData$settings2.newsletterOptInLabel
|
|
354
|
+
optInLabel: (_viewerData$settings2 = viewerData.settings) === null || _viewerData$settings2 === void 0 ? void 0 : _viewerData$settings2.newsletterOptInLabel,
|
|
355
|
+
errors: customerErrorsObject
|
|
344
356
|
});
|
|
345
357
|
}
|
|
346
358
|
const customerBreadcrumb = /*#__PURE__*/React.createElement("div", {
|
|
@@ -262,12 +262,14 @@ export default function FontdueAdminToolbar() {
|
|
|
262
262
|
onClick: () => setOpen(v => !v),
|
|
263
263
|
"aria-expanded": open,
|
|
264
264
|
"data-testid": "fontdue-admin-toolbar-button"
|
|
265
|
-
},
|
|
265
|
+
}, /*#__PURE__*/React.createElement("span", null, "Fontdue", expired ? /*#__PURE__*/React.createElement("span", {
|
|
266
|
+
className: "fontdue-admin-toolbar__expired-suffix"
|
|
267
|
+
}, ' · Preview expired') : previewing ? ' · Previewing hidden fonts' : null)));
|
|
266
268
|
}
|
|
267
269
|
|
|
268
|
-
// The Fontdue mark: a serif F on an iris square. Brands the
|
|
269
|
-
//
|
|
270
|
-
//
|
|
270
|
+
// The Fontdue mark: a serif F on an iris square. Brands the panel header —
|
|
271
|
+
// the collapsed pill carries the wordmark itself, so it doesn't also wear
|
|
272
|
+
// the mark (F next to "Fontdue" would say the brand twice).
|
|
271
273
|
function FontdueMark() {
|
|
272
274
|
return /*#__PURE__*/React.createElement("span", {
|
|
273
275
|
className: "fontdue-admin-toolbar__mark",
|
|
@@ -46,6 +46,12 @@ const TypeTesterContent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
46
46
|
stripPastedStyles: true,
|
|
47
47
|
textDirectionality: direction === 'rtl' ? 'RTL' : 'LTR',
|
|
48
48
|
textAlignment: alignment
|
|
49
|
-
}) :
|
|
49
|
+
}) :
|
|
50
|
+
/*#__PURE__*/
|
|
51
|
+
// Mirror Draft's wrapper so the column rules already apply to the
|
|
52
|
+
// SSR/pre-hydration paint.
|
|
53
|
+
React.createElement("div", {
|
|
54
|
+
"data-contents": "true"
|
|
55
|
+
}, plainText));
|
|
50
56
|
});
|
|
51
57
|
export default TypeTesterContent;
|
|
@@ -81,12 +81,30 @@ const useTypeTesterStyler = _ref => {
|
|
|
81
81
|
columnGap: columns.gap
|
|
82
82
|
} : undefined;
|
|
83
83
|
|
|
84
|
+
// Outside truncation the columns apply to Draft's `[data-contents]` block
|
|
85
|
+
// (via _type-tester.scss), which shrink-wraps — on the full-width container,
|
|
86
|
+
// short content at small sizes lands in the first column and center/right
|
|
87
|
+
// alignment goes off-center (FD-1017). Truncation keeps its columns here:
|
|
88
|
+
// its sideways overflow needs the multicol box to be the height-capped one.
|
|
89
|
+
const columnVars = columns ? {
|
|
90
|
+
'--type-tester--column-count': `${columns.count}`,
|
|
91
|
+
'--type-tester--column-width': columns.width,
|
|
92
|
+
'--type-tester--column-gap': columns.gap,
|
|
93
|
+
'--type-tester--content-width': 'max-content'
|
|
94
|
+
} : undefined;
|
|
95
|
+
|
|
84
96
|
// A glyph's side bearings — ink that sits outside its advance width, like a
|
|
85
97
|
// leading lowercase 'j' or an italic overhang — would be shorn by the inline
|
|
86
98
|
// clip. Per-glyph bearings aren't in the font metrics, so reserve a flat 0.1em
|
|
87
99
|
// on each inline edge and cancel it with a negative margin so
|
|
88
100
|
// wrapping and text position stay put.
|
|
89
101
|
const sideBearing = shouldTruncate ? '0.1em' : '0px';
|
|
102
|
+
|
|
103
|
+
// The autofit slack must sit where it is invisible: after the text for
|
|
104
|
+
// left, before it for right, half on each side for center — one-sided it
|
|
105
|
+
// left centered text `sideBuffer / 2` off center (FD-804).
|
|
106
|
+
const bufferRight = alignment === 'center' ? sideBuffer / 2 : alignment === 'left' ? sideBuffer : 0;
|
|
107
|
+
const bufferLeft = alignment === 'center' ? sideBuffer / 2 : alignment === 'right' ? sideBuffer : 0;
|
|
90
108
|
const style = {
|
|
91
109
|
fontSize: autofit ? `${size}px` : `calc(var(--type-tester--adjustment, 1) * ${size}px)`,
|
|
92
110
|
lineHeight: `${lineHeight}`,
|
|
@@ -127,11 +145,11 @@ const useTypeTesterStyler = _ref => {
|
|
|
127
145
|
} : {
|
|
128
146
|
height: 'auto',
|
|
129
147
|
overflow: 'visible',
|
|
130
|
-
...
|
|
148
|
+
...columnVars
|
|
131
149
|
}),
|
|
132
150
|
fontFeatureSettings,
|
|
133
|
-
marginRight: `calc(${
|
|
134
|
-
marginLeft: `calc(${
|
|
151
|
+
marginRight: `calc(${-bufferRight}px - ${sideBearing})`,
|
|
152
|
+
marginLeft: `calc(${-bufferLeft}px - ${sideBearing})`,
|
|
135
153
|
letterSpacing: `${letterSpacing}em`,
|
|
136
154
|
fontVariationSettings,
|
|
137
155
|
textAlign: alignment
|
|
@@ -309,12 +309,19 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
309
309
|
const recaptchaEnabled = ((_viewer$settings = viewer.settings) === null || _viewer$settings === void 0 ? void 0 : _viewer$settings.recaptchaEnabled) ?? false;
|
|
310
310
|
const recaptchaSiteKey = (_viewer$settings2 = viewer.settings) === null || _viewer$settings2 === void 0 ? void 0 : _viewer$settings2.recaptchaSiteKey;
|
|
311
311
|
const onCompleted = (res, errors, onSuccess, onError) => {
|
|
312
|
-
var _res$updateCustomer, _res$updateOrder;
|
|
312
|
+
var _res$updateCustomer, _res$updateCustomer$e, _res$updateCustomer$e2, _res$updateCustomer2, _res$updateOrder;
|
|
313
313
|
if (errors && errors.length > 0) {
|
|
314
314
|
setError(errors[0].message);
|
|
315
315
|
setSubmitting(false);
|
|
316
316
|
onError === null || onError === void 0 ? void 0 : onError();
|
|
317
|
-
} else if ('updateCustomer' in res && (_res$updateCustomer = res.updateCustomer) !== null && _res$updateCustomer !== void 0 && _res$updateCustomer.errors && (
|
|
317
|
+
} else if ('updateCustomer' in res && (_res$updateCustomer = res.updateCustomer) !== null && _res$updateCustomer !== void 0 && (_res$updateCustomer$e = _res$updateCustomer.errors) !== null && _res$updateCustomer$e !== void 0 && (_res$updateCustomer$e2 = _res$updateCustomer$e.coupon) !== null && _res$updateCustomer$e2 !== void 0 && _res$updateCustomer$e2[0]) {
|
|
318
|
+
// Not a field error — the customer's details are fine, the coupon
|
|
319
|
+
// already on the order isn't usable by them. Keep them on this step so
|
|
320
|
+
// they can remove it from the cart summary and try again.
|
|
321
|
+
setSubmitting(false);
|
|
322
|
+
setCustomerError(res.updateCustomer.errors.coupon[0]);
|
|
323
|
+
onError === null || onError === void 0 ? void 0 : onError();
|
|
324
|
+
} else if ('updateCustomer' in res && (_res$updateCustomer2 = res.updateCustomer) !== null && _res$updateCustomer2 !== void 0 && _res$updateCustomer2.errors && (res.updateCustomer.errors.name || res.updateCustomer.errors.email || res.updateCustomer.errors.newsletterOptIn)) {
|
|
318
325
|
setSubmitting(false);
|
|
319
326
|
setCustomerErrorsObject(res.updateCustomer.errors);
|
|
320
327
|
onError === null || onError === void 0 ? void 0 : onError();
|
|
@@ -336,7 +343,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
336
343
|
};
|
|
337
344
|
const updateCustomer = useCallback((variables, onSuccess, onErrorCallback) => {
|
|
338
345
|
commitMutation(environment, {
|
|
339
|
-
mutation: (_StoreModalUnifiedCheckoutUpdateCustomerMutation.hash && _StoreModalUnifiedCheckoutUpdateCustomerMutation.hash !== "
|
|
346
|
+
mutation: (_StoreModalUnifiedCheckoutUpdateCustomerMutation.hash && _StoreModalUnifiedCheckoutUpdateCustomerMutation.hash !== "dac1a266d63dfa7bee9f22a9373e855a" && console.error("The definition of 'StoreModalUnifiedCheckoutUpdateCustomerMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalUnifiedCheckoutUpdateCustomerMutation),
|
|
340
347
|
variables,
|
|
341
348
|
onCompleted: (res, errors) => onCompleted(res, errors, onSuccess, onErrorCallback),
|
|
342
349
|
onError
|
package/dist/fontdue.css
CHANGED
|
@@ -798,6 +798,23 @@ fontdue-type-tester {
|
|
|
798
798
|
position: relative;
|
|
799
799
|
z-index: 0;
|
|
800
800
|
}
|
|
801
|
+
.type-tester__text__container [data-contents=true] {
|
|
802
|
+
column-count: var(--type-tester--column-count, auto);
|
|
803
|
+
column-width: var(--type-tester--column-width, auto);
|
|
804
|
+
column-gap: var(--type-tester--column-gap, normal);
|
|
805
|
+
width: var(--type-tester--content-width, auto);
|
|
806
|
+
max-width: 100%;
|
|
807
|
+
}
|
|
808
|
+
.type-tester[data-alignment=left] .type-tester__text__container [data-contents=true] {
|
|
809
|
+
margin-right: auto;
|
|
810
|
+
}
|
|
811
|
+
.type-tester[data-alignment=center] .type-tester__text__container [data-contents=true] {
|
|
812
|
+
margin-left: auto;
|
|
813
|
+
margin-right: auto;
|
|
814
|
+
}
|
|
815
|
+
.type-tester[data-alignment=right] .type-tester__text__container [data-contents=true] {
|
|
816
|
+
margin-left: auto;
|
|
817
|
+
}
|
|
801
818
|
|
|
802
819
|
.type-tester-select {
|
|
803
820
|
display: flex;
|
|
@@ -2872,7 +2889,11 @@ body[data-fontdue-store-modal=open] {
|
|
|
2872
2889
|
.cart-item__license-variable__option-name {
|
|
2873
2890
|
margin-bottom: 0.5em;
|
|
2874
2891
|
}
|
|
2892
|
+
.cart-item__license-variable__text-input-form {
|
|
2893
|
+
flex: 1;
|
|
2894
|
+
}
|
|
2875
2895
|
.cart-item__license-variable__text-input {
|
|
2896
|
+
width: 100%;
|
|
2876
2897
|
background: transparent;
|
|
2877
2898
|
color: var(--primary_text_color);
|
|
2878
2899
|
font-family: inherit;
|
|
@@ -3550,6 +3571,10 @@ textarea.text-field__input {
|
|
|
3550
3571
|
border-color: #fff;
|
|
3551
3572
|
}
|
|
3552
3573
|
|
|
3574
|
+
.fontdue-admin-toolbar__expired-suffix {
|
|
3575
|
+
color: #e8c07a;
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3553
3578
|
.fontdue-admin-toolbar__mark {
|
|
3554
3579
|
flex: none;
|
|
3555
3580
|
width: 16px;
|
|
@@ -3563,10 +3588,6 @@ textarea.text-field__input {
|
|
|
3563
3588
|
font-size: 10px;
|
|
3564
3589
|
line-height: 1;
|
|
3565
3590
|
}
|
|
3566
|
-
.fontdue-admin-toolbar[data-previewing=true] .fontdue-admin-toolbar__button .fontdue-admin-toolbar__mark {
|
|
3567
|
-
background: #fff;
|
|
3568
|
-
color: var(--fdat-accent);
|
|
3569
|
-
}
|
|
3570
3591
|
|
|
3571
3592
|
.fontdue-admin-toolbar__panel {
|
|
3572
3593
|
width: 280px;
|
|
@@ -8,7 +8,7 @@ import { NODE_ACCESS_HEADER } from '../nodeAccess.js';
|
|
|
8
8
|
// (defineVersionPlugin in .babelrc.cjs) with the literal package.json#version.
|
|
9
9
|
// Exported so UI (the admin toolbar) can surface it without re-reading the
|
|
10
10
|
// build-time global in a 'use client' module.
|
|
11
|
-
export const version = "3.2.
|
|
11
|
+
export const version = "3.2.4";
|
|
12
12
|
const IS_SERVER = typeof window === typeof undefined;
|
|
13
13
|
|
|
14
14
|
// Opt server fetches into Next's data cache only in production; dev stays
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fontdue-js",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run relay && run-p build-js build-css build-ts",
|
|
@@ -135,4 +135,4 @@
|
|
|
135
135
|
"./useFont": "./dist/components/useFont.js",
|
|
136
136
|
"./useFontStyle": "./dist/components/useFont.js"
|
|
137
137
|
}
|
|
138
|
-
}
|
|
138
|
+
}
|