fontdue-js 3.2.3 → 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 +5 -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/elements/StoreModalUnifiedCheckout.js +10 -3
- package/dist/relay/environment.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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
|
+
|
|
1
6
|
## 3.2.3
|
|
2
7
|
|
|
3
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.
|
|
@@ -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", {
|
|
@@ -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
|
|
@@ -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
|