fontdue-js 2.22.2 → 2.22.3
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 +4 -0
- package/dist/__generated__/StoreModalFamily_collection.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalFamily_collection.graphql.js +49 -31
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductQuery.graphql.js +68 -50
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +61 -43
- package/dist/components/StoreModal/StoreModalFamily.js +13 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 2.22.3
|
|
2
|
+
|
|
3
|
+
- Fixed the store modal over-grouping styles within a family. Previously, any consecutive styles sharing `cssFamily`/`cssWeight`/`cssStretch` were rendered together on a single row, which could collapse 3+ unrelated styles into one visual pair. Styles are now only paired when they're exactly one upright + one slanted (italic or oblique) counterpart; anything else renders on its own row.
|
|
4
|
+
|
|
1
5
|
## 2.22.2
|
|
2
6
|
|
|
3
7
|
- Fixed country order variables (e.g. *Fair Price Adjustment*) not updating when the licensee country changed at checkout. The unified checkout now clears the option id when syncing the licensee country to a country-type variable, so the server can re-evaluate the multiplier against the new country.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<71e15c23d9444275ac11174d1e9f180b>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -22,6 +22,7 @@ export type StoreModalFamily_collection$data = {
|
|
|
22
22
|
readonly fontStyles: ReadonlyArray<{
|
|
23
23
|
readonly cssFamily: string | null;
|
|
24
24
|
readonly cssStretch: string | null;
|
|
25
|
+
readonly cssStyle: string | null;
|
|
25
26
|
readonly cssWeight: string | null;
|
|
26
27
|
readonly id: string;
|
|
27
28
|
readonly " $fragmentSpreads": FragmentRefs<"StoreModalStyleButton_fontStyle">;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<71e15c23d9444275ac11174d1e9f180b>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -34,34 +34,28 @@ const node = function () {
|
|
|
34
34
|
v2 = {
|
|
35
35
|
"alias": null,
|
|
36
36
|
"args": null,
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"name": "fontStyles",
|
|
40
|
-
"plural": true,
|
|
41
|
-
"selections": [v1 /*: any*/, {
|
|
42
|
-
"alias": null,
|
|
43
|
-
"args": null,
|
|
44
|
-
"kind": "ScalarField",
|
|
45
|
-
"name": "cssFamily",
|
|
46
|
-
"storageKey": null
|
|
47
|
-
}, {
|
|
48
|
-
"alias": null,
|
|
49
|
-
"args": null,
|
|
50
|
-
"kind": "ScalarField",
|
|
51
|
-
"name": "cssWeight",
|
|
52
|
-
"storageKey": null
|
|
53
|
-
}, {
|
|
54
|
-
"alias": null,
|
|
55
|
-
"args": null,
|
|
56
|
-
"kind": "ScalarField",
|
|
57
|
-
"name": "cssStretch",
|
|
58
|
-
"storageKey": null
|
|
59
|
-
}, {
|
|
60
|
-
"args": v0 /*: any*/,
|
|
61
|
-
"kind": "FragmentSpread",
|
|
62
|
-
"name": "StoreModalStyleButton_fontStyle"
|
|
63
|
-
}],
|
|
37
|
+
"kind": "ScalarField",
|
|
38
|
+
"name": "cssFamily",
|
|
64
39
|
"storageKey": null
|
|
40
|
+
},
|
|
41
|
+
v3 = {
|
|
42
|
+
"alias": null,
|
|
43
|
+
"args": null,
|
|
44
|
+
"kind": "ScalarField",
|
|
45
|
+
"name": "cssWeight",
|
|
46
|
+
"storageKey": null
|
|
47
|
+
},
|
|
48
|
+
v4 = {
|
|
49
|
+
"alias": null,
|
|
50
|
+
"args": null,
|
|
51
|
+
"kind": "ScalarField",
|
|
52
|
+
"name": "cssStretch",
|
|
53
|
+
"storageKey": null
|
|
54
|
+
},
|
|
55
|
+
v5 = {
|
|
56
|
+
"args": v0 /*: any*/,
|
|
57
|
+
"kind": "FragmentSpread",
|
|
58
|
+
"name": "StoreModalStyleButton_fontStyle"
|
|
65
59
|
};
|
|
66
60
|
return {
|
|
67
61
|
"argumentDefinitions": [{
|
|
@@ -114,17 +108,41 @@ const node = function () {
|
|
|
114
108
|
"kind": "ScalarField",
|
|
115
109
|
"name": "hidden",
|
|
116
110
|
"storageKey": null
|
|
117
|
-
},
|
|
111
|
+
}, {
|
|
112
|
+
"alias": null,
|
|
113
|
+
"args": null,
|
|
114
|
+
"concreteType": "FontStyle",
|
|
115
|
+
"kind": "LinkedField",
|
|
116
|
+
"name": "fontStyles",
|
|
117
|
+
"plural": true,
|
|
118
|
+
"selections": [v1 /*: any*/, v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, v5 /*: any*/],
|
|
119
|
+
"storageKey": null
|
|
120
|
+
}, {
|
|
118
121
|
"args": v0 /*: any*/,
|
|
119
122
|
"kind": "FragmentSpread",
|
|
120
123
|
"name": "StoreModalBundleButton_bundle"
|
|
121
124
|
}],
|
|
122
125
|
"storageKey": null
|
|
123
|
-
},
|
|
126
|
+
}, {
|
|
127
|
+
"alias": null,
|
|
128
|
+
"args": null,
|
|
129
|
+
"concreteType": "FontStyle",
|
|
130
|
+
"kind": "LinkedField",
|
|
131
|
+
"name": "fontStyles",
|
|
132
|
+
"plural": true,
|
|
133
|
+
"selections": [v1 /*: any*/, v2 /*: any*/, v3 /*: any*/, v4 /*: any*/, {
|
|
134
|
+
"alias": null,
|
|
135
|
+
"args": null,
|
|
136
|
+
"kind": "ScalarField",
|
|
137
|
+
"name": "cssStyle",
|
|
138
|
+
"storageKey": null
|
|
139
|
+
}, v5 /*: any*/],
|
|
140
|
+
"storageKey": null
|
|
141
|
+
}],
|
|
124
142
|
"type": "FontCollection",
|
|
125
143
|
"abstractKey": null
|
|
126
144
|
};
|
|
127
145
|
}();
|
|
128
|
-
node.hash = "
|
|
146
|
+
node.hash = "d2d429ebada7593dd5debcce7a69317d";
|
|
129
147
|
var _default = node;
|
|
130
148
|
exports.default = _default;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<c89ad11922bfdc3daa3eeb12dc141b85>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -286,56 +286,49 @@ const node = function () {
|
|
|
286
286
|
v35 = {
|
|
287
287
|
"alias": null,
|
|
288
288
|
"args": null,
|
|
289
|
-
"
|
|
289
|
+
"kind": "ScalarField",
|
|
290
|
+
"name": "cssWeight",
|
|
291
|
+
"storageKey": null
|
|
292
|
+
},
|
|
293
|
+
v36 = {
|
|
294
|
+
"alias": null,
|
|
295
|
+
"args": null,
|
|
296
|
+
"kind": "ScalarField",
|
|
297
|
+
"name": "cssStretch",
|
|
298
|
+
"storageKey": null
|
|
299
|
+
},
|
|
300
|
+
v37 = {
|
|
301
|
+
"alias": null,
|
|
302
|
+
"args": null,
|
|
303
|
+
"concreteType": "VariableInstance",
|
|
290
304
|
"kind": "LinkedField",
|
|
291
|
-
"name": "
|
|
305
|
+
"name": "variableInstances",
|
|
292
306
|
"plural": true,
|
|
293
|
-
"selections": [
|
|
307
|
+
"selections": [v11 /*: any*/, {
|
|
294
308
|
"alias": null,
|
|
295
309
|
"args": null,
|
|
296
|
-
"
|
|
297
|
-
"name": "cssWeight",
|
|
298
|
-
"storageKey": null
|
|
299
|
-
}, {
|
|
300
|
-
"alias": null,
|
|
301
|
-
"args": null,
|
|
302
|
-
"kind": "ScalarField",
|
|
303
|
-
"name": "cssStretch",
|
|
304
|
-
"storageKey": null
|
|
305
|
-
}, v11 /*: any*/, v30 /*: any*/, {
|
|
306
|
-
"alias": null,
|
|
307
|
-
"args": null,
|
|
308
|
-
"concreteType": "VariableInstance",
|
|
310
|
+
"concreteType": "VariableSetting",
|
|
309
311
|
"kind": "LinkedField",
|
|
310
|
-
"name": "
|
|
312
|
+
"name": "coordinates",
|
|
311
313
|
"plural": true,
|
|
312
|
-
"selections": [
|
|
314
|
+
"selections": [{
|
|
313
315
|
"alias": null,
|
|
314
316
|
"args": null,
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
|
|
319
|
-
"
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
"name": "axis",
|
|
324
|
-
"storageKey": null
|
|
325
|
-
}, {
|
|
326
|
-
"alias": null,
|
|
327
|
-
"args": null,
|
|
328
|
-
"kind": "ScalarField",
|
|
329
|
-
"name": "value",
|
|
330
|
-
"storageKey": null
|
|
331
|
-
}],
|
|
317
|
+
"kind": "ScalarField",
|
|
318
|
+
"name": "axis",
|
|
319
|
+
"storageKey": null
|
|
320
|
+
}, {
|
|
321
|
+
"alias": null,
|
|
322
|
+
"args": null,
|
|
323
|
+
"kind": "ScalarField",
|
|
324
|
+
"name": "value",
|
|
332
325
|
"storageKey": null
|
|
333
326
|
}],
|
|
334
327
|
"storageKey": null
|
|
335
|
-
}
|
|
328
|
+
}],
|
|
336
329
|
"storageKey": null
|
|
337
330
|
},
|
|
338
|
-
|
|
331
|
+
v38 = {
|
|
339
332
|
"alias": null,
|
|
340
333
|
"args": null,
|
|
341
334
|
"concreteType": "Bundle",
|
|
@@ -348,18 +341,43 @@ const node = function () {
|
|
|
348
341
|
"kind": "ScalarField",
|
|
349
342
|
"name": "hidden",
|
|
350
343
|
"storageKey": null
|
|
351
|
-
},
|
|
344
|
+
}, {
|
|
345
|
+
"alias": null,
|
|
346
|
+
"args": null,
|
|
347
|
+
"concreteType": "FontStyle",
|
|
348
|
+
"kind": "LinkedField",
|
|
349
|
+
"name": "fontStyles",
|
|
350
|
+
"plural": true,
|
|
351
|
+
"selections": [v4 /*: any*/, v26 /*: any*/, v35 /*: any*/, v36 /*: any*/, v11 /*: any*/, v30 /*: any*/, v37 /*: any*/, v23 /*: any*/, v28 /*: any*/, v29 /*: any*/],
|
|
352
|
+
"storageKey": null
|
|
353
|
+
}, v11 /*: any*/, v23 /*: any*/],
|
|
354
|
+
"storageKey": null
|
|
355
|
+
},
|
|
356
|
+
v39 = {
|
|
357
|
+
"alias": null,
|
|
358
|
+
"args": null,
|
|
359
|
+
"concreteType": "FontStyle",
|
|
360
|
+
"kind": "LinkedField",
|
|
361
|
+
"name": "fontStyles",
|
|
362
|
+
"plural": true,
|
|
363
|
+
"selections": [v4 /*: any*/, v26 /*: any*/, v35 /*: any*/, v36 /*: any*/, {
|
|
364
|
+
"alias": null,
|
|
365
|
+
"args": null,
|
|
366
|
+
"kind": "ScalarField",
|
|
367
|
+
"name": "cssStyle",
|
|
368
|
+
"storageKey": null
|
|
369
|
+
}, v11 /*: any*/, v30 /*: any*/, v37 /*: any*/, v23 /*: any*/, v28 /*: any*/, v29 /*: any*/],
|
|
352
370
|
"storageKey": null
|
|
353
371
|
},
|
|
354
|
-
|
|
355
|
-
|
|
372
|
+
v40 = [v21 /*: any*/],
|
|
373
|
+
v41 = [v32 /*: any*/, {
|
|
356
374
|
"alias": null,
|
|
357
375
|
"args": v7 /*: any*/,
|
|
358
376
|
"concreteType": "Money",
|
|
359
377
|
"kind": "LinkedField",
|
|
360
378
|
"name": "totalStylesPrice",
|
|
361
379
|
"plural": false,
|
|
362
|
-
"selections":
|
|
380
|
+
"selections": v40 /*: any*/,
|
|
363
381
|
"storageKey": null
|
|
364
382
|
}];
|
|
365
383
|
return {
|
|
@@ -453,9 +471,9 @@ const node = function () {
|
|
|
453
471
|
"plural": true,
|
|
454
472
|
"selections": [v19 /*: any*/, v32 /*: any*/, v4 /*: any*/],
|
|
455
473
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
456
|
-
},
|
|
474
|
+
}, v38 /*: any*/, v39 /*: any*/],
|
|
457
475
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
458
|
-
},
|
|
476
|
+
}, v38 /*: any*/, v39 /*: any*/, {
|
|
459
477
|
"alias": null,
|
|
460
478
|
"args": null,
|
|
461
479
|
"concreteType": "License",
|
|
@@ -639,7 +657,7 @@ const node = function () {
|
|
|
639
657
|
"kind": "LinkedField",
|
|
640
658
|
"name": "price",
|
|
641
659
|
"plural": false,
|
|
642
|
-
"selections":
|
|
660
|
+
"selections": v40 /*: any*/,
|
|
643
661
|
"storageKey": null
|
|
644
662
|
}, {
|
|
645
663
|
"alias": null,
|
|
@@ -650,17 +668,17 @@ const node = function () {
|
|
|
650
668
|
"plural": false,
|
|
651
669
|
"selections": [v18 /*: any*/, {
|
|
652
670
|
"kind": "InlineFragment",
|
|
653
|
-
"selections":
|
|
671
|
+
"selections": v41 /*: any*/,
|
|
654
672
|
"type": "FontCollection",
|
|
655
673
|
"abstractKey": null
|
|
656
674
|
}, {
|
|
657
675
|
"kind": "InlineFragment",
|
|
658
|
-
"selections":
|
|
676
|
+
"selections": v41 /*: any*/,
|
|
659
677
|
"type": "Bundle",
|
|
660
678
|
"abstractKey": null
|
|
661
679
|
}, {
|
|
662
680
|
"kind": "InlineFragment",
|
|
663
|
-
"selections":
|
|
681
|
+
"selections": v41 /*: any*/,
|
|
664
682
|
"type": "CollectionBundle",
|
|
665
683
|
"abstractKey": null
|
|
666
684
|
}, {
|
|
@@ -688,12 +706,12 @@ const node = function () {
|
|
|
688
706
|
}]
|
|
689
707
|
},
|
|
690
708
|
"params": {
|
|
691
|
-
"cacheID": "
|
|
709
|
+
"cacheID": "104a32b41807b73dd9d88e355d720a3b",
|
|
692
710
|
"id": null,
|
|
693
711
|
"metadata": {},
|
|
694
712
|
"name": "StoreModalProductQuery",
|
|
695
713
|
"operationKind": "query",
|
|
696
|
-
"text": "query StoreModalProductQuery(\n $productId: ID!\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n) {\n collection: node(id: $productId) {\n __typename\n id\n ...StoreModalProductContent_collection_4sncub\n }\n viewer {\n endpoint\n stripeAccountId\n ...OrderVariableSelectionRedux_viewer_2ZguDv\n ...StoreModalProductSummary_viewer_4sncub\n orderVariables {\n id\n variableType\n name\n }\n settings {\n storeModalSelectLicenseeLabel(format: HTML)\n storeModalSelectOrderVariablesLabel(format: HTML)\n storeModalSelectLicensesLabel(format: HTML)\n storeModalSelectFontsLabel(format: HTML)\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment OrderVariableSelectionRedux_viewer_2ZguDv on Viewer {\n ...OrderVariableSelection_variables_2ZguDv\n detectedCountry\n orderVariables {\n id\n variableType\n }\n}\n\nfragment OrderVariableSelection_variables_2ZguDv on Viewer {\n orderVariables {\n id\n name\n variableType\n description(format: HTML, orderVariables: $orderVariables)\n orderVariableOptions {\n id\n amount\n }\n }\n countries {\n code\n name\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_4sncub on Sku {\n id\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalBundleButton_bundle_4sncub on Bundle {\n id\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n fontStyles {\n id\n ...FontStyle_fontStyle\n }\n}\n\nfragment StoreModalFamilyButton_collection_4sncub on FontCollection {\n isVariableFont\n collectionType\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n parent {\n id\n }\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\n totalStyles\n totalStylesPrice {\n ...Price_price\n }\n ...useTotalStyles_fontCollection\n}\n\nfragment StoreModalFamily_collection_4sncub on FontCollection {\n ...StoreModalFamilyButton_collection_4sncub\n collectionType\n sku {\n id\n }\n isVariableFont\n bundles {\n id\n hidden\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n ...StoreModalBundleButton_bundle_4sncub\n }\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n}\n\nfragment StoreModalProductContent_collection_4sncub on Node {\n __isNode: __typename\n ... on FontCollection {\n id\n ...StoreModalFamily_collection_4sncub\n ...StoreModalProductLicenseSelection_collection\n children(collectionTypes: [FAMILY]) {\n id\n ...StoreModalFamily_collection_4sncub\n }\n }\n id\n}\n\nfragment StoreModalProductLicenseSelection_collection on FontCollection {\n licenses {\n id\n ...StoreModalProductLicense_license\n }\n}\n\nfragment StoreModalProductLicense_license on License {\n id\n url\n name\n description(format: HTML)\n defaultSelected\n variables: licenseVariables {\n id\n name\n variableType\n ...VariableTableAmounts_variable\n options: licenseOptions {\n id\n name\n amount\n ...VariableTableAmounts_option\n }\n }\n}\n\nfragment StoreModalProductSummary_viewer_4sncub on Viewer {\n settings {\n taxSystem\n stripeTaxSettings {\n taxBehavior\n }\n }\n taxCollections {\n taxName\n inclusive\n }\n orderVariables {\n id\n variableType\n name\n }\n precart(skuIds: [], licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n skus {\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n product {\n __typename\n ... on FontCollection {\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n }\n ... on Bundle {\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n }\n ... on CollectionBundle {\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n subtotal {\n ...Price_price\n amount\n currency\n }\n }\n}\n\nfragment StoreModalStyleButton_fontStyle_4sncub on FontStyle {\n id\n name\n supportedLanguages\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n ...FontStyle_fontStyle\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 }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n\nfragment useTotalStyles_fontCollection on FontCollection {\n isVariableFont\n totalStyles\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n}\n"
|
|
714
|
+
"text": "query StoreModalProductQuery(\n $productId: ID!\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n) {\n collection: node(id: $productId) {\n __typename\n id\n ...StoreModalProductContent_collection_4sncub\n }\n viewer {\n endpoint\n stripeAccountId\n ...OrderVariableSelectionRedux_viewer_2ZguDv\n ...StoreModalProductSummary_viewer_4sncub\n orderVariables {\n id\n variableType\n name\n }\n settings {\n storeModalSelectLicenseeLabel(format: HTML)\n storeModalSelectOrderVariablesLabel(format: HTML)\n storeModalSelectLicensesLabel(format: HTML)\n storeModalSelectFontsLabel(format: HTML)\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment OrderVariableSelectionRedux_viewer_2ZguDv on Viewer {\n ...OrderVariableSelection_variables_2ZguDv\n detectedCountry\n orderVariables {\n id\n variableType\n }\n}\n\nfragment OrderVariableSelection_variables_2ZguDv on Viewer {\n orderVariables {\n id\n name\n variableType\n description(format: HTML, orderVariables: $orderVariables)\n orderVariableOptions {\n id\n amount\n }\n }\n countries {\n code\n name\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_4sncub on Sku {\n id\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalBundleButton_bundle_4sncub on Bundle {\n id\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n fontStyles {\n id\n ...FontStyle_fontStyle\n }\n}\n\nfragment StoreModalFamilyButton_collection_4sncub on FontCollection {\n isVariableFont\n collectionType\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n parent {\n id\n }\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\n totalStyles\n totalStylesPrice {\n ...Price_price\n }\n ...useTotalStyles_fontCollection\n}\n\nfragment StoreModalFamily_collection_4sncub on FontCollection {\n ...StoreModalFamilyButton_collection_4sncub\n collectionType\n sku {\n id\n }\n isVariableFont\n bundles {\n id\n hidden\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n ...StoreModalBundleButton_bundle_4sncub\n }\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n cssStyle\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n}\n\nfragment StoreModalProductContent_collection_4sncub on Node {\n __isNode: __typename\n ... on FontCollection {\n id\n ...StoreModalFamily_collection_4sncub\n ...StoreModalProductLicenseSelection_collection\n children(collectionTypes: [FAMILY]) {\n id\n ...StoreModalFamily_collection_4sncub\n }\n }\n id\n}\n\nfragment StoreModalProductLicenseSelection_collection on FontCollection {\n licenses {\n id\n ...StoreModalProductLicense_license\n }\n}\n\nfragment StoreModalProductLicense_license on License {\n id\n url\n name\n description(format: HTML)\n defaultSelected\n variables: licenseVariables {\n id\n name\n variableType\n ...VariableTableAmounts_variable\n options: licenseOptions {\n id\n name\n amount\n ...VariableTableAmounts_option\n }\n }\n}\n\nfragment StoreModalProductSummary_viewer_4sncub on Viewer {\n settings {\n taxSystem\n stripeTaxSettings {\n taxBehavior\n }\n }\n taxCollections {\n taxName\n inclusive\n }\n orderVariables {\n id\n variableType\n name\n }\n precart(skuIds: [], licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n skus {\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n product {\n __typename\n ... on FontCollection {\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n }\n ... on Bundle {\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n }\n ... on CollectionBundle {\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n }\n }\n ... on Node {\n __isNode: __typename\n id\n }\n }\n id\n }\n subtotal {\n ...Price_price\n amount\n currency\n }\n }\n}\n\nfragment StoreModalStyleButton_fontStyle_4sncub on FontStyle {\n id\n name\n supportedLanguages\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n ...FontStyle_fontStyle\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 }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n\nfragment useTotalStyles_fontCollection on FontCollection {\n isVariableFont\n totalStyles\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n}\n"
|
|
697
715
|
}
|
|
698
716
|
};
|
|
699
717
|
}();
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
|
-
* @generated SignedSource<<
|
|
8
|
+
* @generated SignedSource<<52c18d108c3d802a9478b6b6002d480a>>
|
|
9
9
|
* @lightSyntaxTransform
|
|
10
10
|
* @nogrep
|
|
11
11
|
*/
|
|
@@ -221,56 +221,49 @@ const node = function () {
|
|
|
221
221
|
v22 = {
|
|
222
222
|
"alias": null,
|
|
223
223
|
"args": null,
|
|
224
|
-
"
|
|
224
|
+
"kind": "ScalarField",
|
|
225
|
+
"name": "cssWeight",
|
|
226
|
+
"storageKey": null
|
|
227
|
+
},
|
|
228
|
+
v23 = {
|
|
229
|
+
"alias": null,
|
|
230
|
+
"args": null,
|
|
231
|
+
"kind": "ScalarField",
|
|
232
|
+
"name": "cssStretch",
|
|
233
|
+
"storageKey": null
|
|
234
|
+
},
|
|
235
|
+
v24 = {
|
|
236
|
+
"alias": null,
|
|
237
|
+
"args": null,
|
|
238
|
+
"concreteType": "VariableInstance",
|
|
225
239
|
"kind": "LinkedField",
|
|
226
|
-
"name": "
|
|
240
|
+
"name": "variableInstances",
|
|
227
241
|
"plural": true,
|
|
228
|
-
"selections": [
|
|
229
|
-
"alias": null,
|
|
230
|
-
"args": null,
|
|
231
|
-
"kind": "ScalarField",
|
|
232
|
-
"name": "cssWeight",
|
|
233
|
-
"storageKey": null
|
|
234
|
-
}, {
|
|
235
|
-
"alias": null,
|
|
236
|
-
"args": null,
|
|
237
|
-
"kind": "ScalarField",
|
|
238
|
-
"name": "cssStretch",
|
|
239
|
-
"storageKey": null
|
|
240
|
-
}, v8 /*: any*/, v17 /*: any*/, {
|
|
242
|
+
"selections": [v8 /*: any*/, {
|
|
241
243
|
"alias": null,
|
|
242
244
|
"args": null,
|
|
243
|
-
"concreteType": "
|
|
245
|
+
"concreteType": "VariableSetting",
|
|
244
246
|
"kind": "LinkedField",
|
|
245
|
-
"name": "
|
|
247
|
+
"name": "coordinates",
|
|
246
248
|
"plural": true,
|
|
247
|
-
"selections": [
|
|
249
|
+
"selections": [{
|
|
248
250
|
"alias": null,
|
|
249
251
|
"args": null,
|
|
250
|
-
"
|
|
251
|
-
"
|
|
252
|
-
"
|
|
253
|
-
|
|
254
|
-
"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
"name": "axis",
|
|
259
|
-
"storageKey": null
|
|
260
|
-
}, {
|
|
261
|
-
"alias": null,
|
|
262
|
-
"args": null,
|
|
263
|
-
"kind": "ScalarField",
|
|
264
|
-
"name": "value",
|
|
265
|
-
"storageKey": null
|
|
266
|
-
}],
|
|
252
|
+
"kind": "ScalarField",
|
|
253
|
+
"name": "axis",
|
|
254
|
+
"storageKey": null
|
|
255
|
+
}, {
|
|
256
|
+
"alias": null,
|
|
257
|
+
"args": null,
|
|
258
|
+
"kind": "ScalarField",
|
|
259
|
+
"name": "value",
|
|
267
260
|
"storageKey": null
|
|
268
261
|
}],
|
|
269
262
|
"storageKey": null
|
|
270
|
-
}
|
|
263
|
+
}],
|
|
271
264
|
"storageKey": null
|
|
272
265
|
},
|
|
273
|
-
|
|
266
|
+
v25 = {
|
|
274
267
|
"alias": null,
|
|
275
268
|
"args": null,
|
|
276
269
|
"concreteType": "Bundle",
|
|
@@ -283,7 +276,32 @@ const node = function () {
|
|
|
283
276
|
"kind": "ScalarField",
|
|
284
277
|
"name": "hidden",
|
|
285
278
|
"storageKey": null
|
|
286
|
-
},
|
|
279
|
+
}, {
|
|
280
|
+
"alias": null,
|
|
281
|
+
"args": null,
|
|
282
|
+
"concreteType": "FontStyle",
|
|
283
|
+
"kind": "LinkedField",
|
|
284
|
+
"name": "fontStyles",
|
|
285
|
+
"plural": true,
|
|
286
|
+
"selections": [v5 /*: any*/, v13 /*: any*/, v22 /*: any*/, v23 /*: any*/, v8 /*: any*/, v17 /*: any*/, v24 /*: any*/, v11 /*: any*/, v15 /*: any*/, v16 /*: any*/],
|
|
287
|
+
"storageKey": null
|
|
288
|
+
}, v8 /*: any*/, v11 /*: any*/],
|
|
289
|
+
"storageKey": null
|
|
290
|
+
},
|
|
291
|
+
v26 = {
|
|
292
|
+
"alias": null,
|
|
293
|
+
"args": null,
|
|
294
|
+
"concreteType": "FontStyle",
|
|
295
|
+
"kind": "LinkedField",
|
|
296
|
+
"name": "fontStyles",
|
|
297
|
+
"plural": true,
|
|
298
|
+
"selections": [v5 /*: any*/, v13 /*: any*/, v22 /*: any*/, v23 /*: any*/, {
|
|
299
|
+
"alias": null,
|
|
300
|
+
"args": null,
|
|
301
|
+
"kind": "ScalarField",
|
|
302
|
+
"name": "cssStyle",
|
|
303
|
+
"storageKey": null
|
|
304
|
+
}, v8 /*: any*/, v17 /*: any*/, v24 /*: any*/, v11 /*: any*/, v15 /*: any*/, v16 /*: any*/],
|
|
287
305
|
"storageKey": null
|
|
288
306
|
};
|
|
289
307
|
return {
|
|
@@ -348,9 +366,9 @@ const node = function () {
|
|
|
348
366
|
"plural": true,
|
|
349
367
|
"selections": [v6 /*: any*/, v19 /*: any*/, v5 /*: any*/],
|
|
350
368
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
351
|
-
},
|
|
369
|
+
}, v25 /*: any*/, v26 /*: any*/],
|
|
352
370
|
"storageKey": "children(collectionTypes:[\"FAMILY\"])"
|
|
353
|
-
},
|
|
371
|
+
}, v25 /*: any*/, v26 /*: any*/, {
|
|
354
372
|
"alias": null,
|
|
355
373
|
"args": null,
|
|
356
374
|
"concreteType": "License",
|
|
@@ -419,12 +437,12 @@ const node = function () {
|
|
|
419
437
|
}]
|
|
420
438
|
},
|
|
421
439
|
"params": {
|
|
422
|
-
"cacheID": "
|
|
440
|
+
"cacheID": "4d650f53c6065f4ee977deb9f9b8080e",
|
|
423
441
|
"id": null,
|
|
424
442
|
"metadata": {},
|
|
425
443
|
"name": "StoreModalProductRefetchQuery",
|
|
426
444
|
"operationKind": "query",
|
|
427
|
-
"text": "query StoreModalProductRefetchQuery(\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...StoreModalProductContent_collection_4sncub\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_4sncub on Sku {\n id\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalBundleButton_bundle_4sncub on Bundle {\n id\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n fontStyles {\n id\n ...FontStyle_fontStyle\n }\n}\n\nfragment StoreModalFamilyButton_collection_4sncub on FontCollection {\n isVariableFont\n collectionType\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n parent {\n id\n }\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\n totalStyles\n totalStylesPrice {\n ...Price_price\n }\n ...useTotalStyles_fontCollection\n}\n\nfragment StoreModalFamily_collection_4sncub on FontCollection {\n ...StoreModalFamilyButton_collection_4sncub\n collectionType\n sku {\n id\n }\n isVariableFont\n bundles {\n id\n hidden\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n ...StoreModalBundleButton_bundle_4sncub\n }\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n}\n\nfragment StoreModalProductContent_collection_4sncub on Node {\n __isNode: __typename\n ... on FontCollection {\n id\n ...StoreModalFamily_collection_4sncub\n ...StoreModalProductLicenseSelection_collection\n children(collectionTypes: [FAMILY]) {\n id\n ...StoreModalFamily_collection_4sncub\n }\n }\n id\n}\n\nfragment StoreModalProductLicenseSelection_collection on FontCollection {\n licenses {\n id\n ...StoreModalProductLicense_license\n }\n}\n\nfragment StoreModalProductLicense_license on License {\n id\n url\n name\n description(format: HTML)\n defaultSelected\n variables: licenseVariables {\n id\n name\n variableType\n ...VariableTableAmounts_variable\n options: licenseOptions {\n id\n name\n amount\n ...VariableTableAmounts_option\n }\n }\n}\n\nfragment StoreModalStyleButton_fontStyle_4sncub on FontStyle {\n id\n name\n supportedLanguages\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n ...FontStyle_fontStyle\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 }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n\nfragment useTotalStyles_fontCollection on FontCollection {\n isVariableFont\n totalStyles\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n}\n"
|
|
445
|
+
"text": "query StoreModalProductRefetchQuery(\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...StoreModalProductContent_collection_4sncub\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_4sncub on Sku {\n id\n price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n amount\n ...Price_price\n }\n}\n\nfragment StoreModalBundleButton_bundle_4sncub on Bundle {\n id\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n fontStyles {\n id\n ...FontStyle_fontStyle\n }\n}\n\nfragment StoreModalFamilyButton_collection_4sncub on FontCollection {\n isVariableFont\n collectionType\n name\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n parent {\n id\n }\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\n totalStyles\n totalStylesPrice {\n ...Price_price\n }\n ...useTotalStyles_fontCollection\n}\n\nfragment StoreModalFamily_collection_4sncub on FontCollection {\n ...StoreModalFamilyButton_collection_4sncub\n collectionType\n sku {\n id\n }\n isVariableFont\n bundles {\n id\n hidden\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n ...StoreModalBundleButton_bundle_4sncub\n }\n fontStyles {\n id\n cssFamily\n cssWeight\n cssStretch\n cssStyle\n ...StoreModalStyleButton_fontStyle_4sncub\n }\n}\n\nfragment StoreModalProductContent_collection_4sncub on Node {\n __isNode: __typename\n ... on FontCollection {\n id\n ...StoreModalFamily_collection_4sncub\n ...StoreModalProductLicenseSelection_collection\n children(collectionTypes: [FAMILY]) {\n id\n ...StoreModalFamily_collection_4sncub\n }\n }\n id\n}\n\nfragment StoreModalProductLicenseSelection_collection on FontCollection {\n licenses {\n id\n ...StoreModalProductLicense_license\n }\n}\n\nfragment StoreModalProductLicense_license on License {\n id\n url\n name\n description(format: HTML)\n defaultSelected\n variables: licenseVariables {\n id\n name\n variableType\n ...VariableTableAmounts_variable\n options: licenseOptions {\n id\n name\n amount\n ...VariableTableAmounts_option\n }\n }\n}\n\nfragment StoreModalStyleButton_fontStyle_4sncub on FontStyle {\n id\n name\n supportedLanguages\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n sku {\n ...SKUPrice_sku_4sncub\n id\n }\n ...FontStyle_fontStyle\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 }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n\nfragment useTotalStyles_fontCollection on FontCollection {\n isVariableFont\n totalStyles\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n}\n"
|
|
428
446
|
}
|
|
429
447
|
};
|
|
430
448
|
}();
|
|
@@ -25,9 +25,20 @@ function chunkConsecutiveBy(collection, compare) {
|
|
|
25
25
|
return acc.concat([[item]]);
|
|
26
26
|
}, []);
|
|
27
27
|
}
|
|
28
|
+
const isSlanted = cssStyle => cssStyle === 'italic' || cssStyle === 'oblique';
|
|
28
29
|
const stylesGrouped = collection => {
|
|
29
30
|
if (!collection.fontStyles) return [];
|
|
30
|
-
|
|
31
|
+
const chunks = chunkConsecutiveBy(collection.fontStyles, (left, right) => left.cssFamily === right.cssFamily && left.cssWeight === right.cssWeight && left.cssStretch === right.cssStretch && isSlanted(left.cssStyle) !== isSlanted(right.cssStyle));
|
|
32
|
+
|
|
33
|
+
// Only keep a chunk paired when it's exactly one upright + one slanted
|
|
34
|
+
// (italic or oblique) style. Anything else (3+ consecutive matches, or
|
|
35
|
+
// two styles that aren't a clean upright/slanted pair) is split back
|
|
36
|
+
// into individual entries.
|
|
37
|
+
return chunks.flatMap(chunk => {
|
|
38
|
+
if (chunk.length !== 2) return chunk.map(style => [style]);
|
|
39
|
+
const slantedCount = chunk.filter(s => isSlanted(s.cssStyle)).length;
|
|
40
|
+
return slantedCount === 1 ? [chunk] : chunk.map(style => [style]);
|
|
41
|
+
});
|
|
31
42
|
};
|
|
32
43
|
function StoreModalFamily(_ref) {
|
|
33
44
|
var _collection$bundles;
|
|
@@ -36,7 +47,7 @@ function StoreModalFamily(_ref) {
|
|
|
36
47
|
onSelect,
|
|
37
48
|
title
|
|
38
49
|
} = _ref;
|
|
39
|
-
const collection = (0, _reactRelay.useFragment)((_StoreModalFamily_collection2.default.hash && _StoreModalFamily_collection2.default.hash !== "
|
|
50
|
+
const collection = (0, _reactRelay.useFragment)((_StoreModalFamily_collection2.default.hash && _StoreModalFamily_collection2.default.hash !== "d2d429ebada7593dd5debcce7a69317d" && console.error("The definition of 'StoreModalFamily_collection' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalFamily_collection2.default), collectionKey);
|
|
40
51
|
const fontStyles = (0, _react.useMemo)(() => stylesGrouped(collection), [collection]);
|
|
41
52
|
if ((fontStyles === null || fontStyles === void 0 ? void 0 : fontStyles.length) === 0 && collection.collectionType === 'superfamily' && !collection.sku) return null;
|
|
42
53
|
return /*#__PURE__*/_react.default.createElement(_StoreModalFamily.default, null, {
|