fontdue-js 2.22.2 → 2.22.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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.22.4
2
+
3
+ - Raised the store modal index collection limit from 99 to 9999, so very large libraries are no longer silently capped on the store modal landing page.
4
+
5
+ ## 2.22.3
6
+
7
+ - 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.
8
+
1
9
  ## 2.22.2
2
10
 
3
11
  - 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<<5d6e34313ae722e7716a2bf089cac778>>
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<<5d6e34313ae722e7716a2bf089cac778>>
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
- "concreteType": "FontStyle",
38
- "kind": "LinkedField",
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
- }, v2 /*: any*/, {
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
- }, v2 /*: any*/],
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 = "73d00dd2b57a2b44a86ee085b4313d77";
146
+ node.hash = "d2d429ebada7593dd5debcce7a69317d";
129
147
  var _default = node;
130
148
  exports.default = _default;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<f6fed31e6723d222cf0d687e1013cc38>>
2
+ * @generated SignedSource<<52e391f8940a4f6eb94fcf4f4d884f31>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<f6fed31e6723d222cf0d687e1013cc38>>
8
+ * @generated SignedSource<<52e391f8940a4f6eb94fcf4f4d884f31>>
9
9
  * @lightSyntaxTransform
10
10
  * @nogrep
11
11
  */
@@ -27,7 +27,7 @@ const node = function () {
27
27
  }, {
28
28
  "kind": "Literal",
29
29
  "name": "first",
30
- "value": 99
30
+ "value": 9999
31
31
  }, {
32
32
  "kind": "Literal",
33
33
  "name": "onlyRoots",
@@ -249,15 +249,15 @@ const node = function () {
249
249
  }]
250
250
  },
251
251
  "params": {
252
- "cacheID": "6c9f9bd4a6c1817100984d2a29c8017f",
252
+ "cacheID": "df65908a69bef4f72b19f28c399fe53b",
253
253
  "id": null,
254
254
  "metadata": {},
255
255
  "name": "StoreModalIndexQuery",
256
256
  "operationKind": "query",
257
- "text": "query StoreModalIndexQuery(\n $excludeTags: [String!]\n) {\n viewer {\n rootCollections: fontCollections(onlyRoots: true, first: 99, excludeTags: $excludeTags) {\n edges {\n node {\n id\n ...StoreModalIndexItem_fontCollection\n }\n }\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment StoreModalIndexItem_fontCollection on FontCollection {\n ...useTotalStyles_fontCollection\n id\n name\n totalStyles\n isVariableFont\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n collectionType\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\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"
257
+ "text": "query StoreModalIndexQuery(\n $excludeTags: [String!]\n) {\n viewer {\n rootCollections: fontCollections(onlyRoots: true, first: 9999, excludeTags: $excludeTags) {\n edges {\n node {\n id\n ...StoreModalIndexItem_fontCollection\n }\n }\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment StoreModalIndexItem_fontCollection on FontCollection {\n ...useTotalStyles_fontCollection\n id\n name\n totalStyles\n isVariableFont\n children(collectionTypes: [FAMILY]) {\n isVariableFont\n totalStyles\n id\n }\n collectionType\n featureStyle {\n ...FontStyle_fontStyle\n supportedLanguages\n id\n }\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"
258
258
  }
259
259
  };
260
260
  }();
261
- node.hash = "300b462c41a951b4f94c4b8da7a6821f";
261
+ node.hash = "099c77808b41054885365ebe3eda03c8";
262
262
  var _default = node;
263
263
  exports.default = _default;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<4e14c3e4e437e08b0e34cb3f12daba1a>>
2
+ * @generated SignedSource<<c89ad11922bfdc3daa3eeb12dc141b85>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<4e14c3e4e437e08b0e34cb3f12daba1a>>
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
- "concreteType": "FontStyle",
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": "fontStyles",
305
+ "name": "variableInstances",
292
306
  "plural": true,
293
- "selections": [v4 /*: any*/, v26 /*: any*/, {
307
+ "selections": [v11 /*: any*/, {
294
308
  "alias": null,
295
309
  "args": null,
296
- "kind": "ScalarField",
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": "variableInstances",
312
+ "name": "coordinates",
311
313
  "plural": true,
312
- "selections": [v11 /*: any*/, {
314
+ "selections": [{
313
315
  "alias": null,
314
316
  "args": null,
315
- "concreteType": "VariableSetting",
316
- "kind": "LinkedField",
317
- "name": "coordinates",
318
- "plural": true,
319
- "selections": [{
320
- "alias": null,
321
- "args": null,
322
- "kind": "ScalarField",
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
- }, v23 /*: any*/, v28 /*: any*/, v29 /*: any*/],
328
+ }],
336
329
  "storageKey": null
337
330
  },
338
- v36 = {
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
- }, v35 /*: any*/, v11 /*: any*/, v23 /*: any*/],
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
- v37 = [v21 /*: any*/],
355
- v38 = [v32 /*: any*/, {
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": v37 /*: any*/,
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
- }, v36 /*: any*/, v35 /*: any*/],
474
+ }, v38 /*: any*/, v39 /*: any*/],
457
475
  "storageKey": "children(collectionTypes:[\"FAMILY\"])"
458
- }, v36 /*: any*/, v35 /*: any*/, {
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": v37 /*: any*/,
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": v38 /*: any*/,
671
+ "selections": v41 /*: any*/,
654
672
  "type": "FontCollection",
655
673
  "abstractKey": null
656
674
  }, {
657
675
  "kind": "InlineFragment",
658
- "selections": v38 /*: any*/,
676
+ "selections": v41 /*: any*/,
659
677
  "type": "Bundle",
660
678
  "abstractKey": null
661
679
  }, {
662
680
  "kind": "InlineFragment",
663
- "selections": v38 /*: any*/,
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": "40d8a2a33826a2d10b1521bccd10681c",
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
  }();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<3f84262d5e8bba617e774f141016edc5>>
2
+ * @generated SignedSource<<52c18d108c3d802a9478b6b6002d480a>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<3f84262d5e8bba617e774f141016edc5>>
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
- "concreteType": "FontStyle",
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": "fontStyles",
240
+ "name": "variableInstances",
227
241
  "plural": true,
228
- "selections": [v5 /*: any*/, v13 /*: any*/, {
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": "VariableInstance",
245
+ "concreteType": "VariableSetting",
244
246
  "kind": "LinkedField",
245
- "name": "variableInstances",
247
+ "name": "coordinates",
246
248
  "plural": true,
247
- "selections": [v8 /*: any*/, {
249
+ "selections": [{
248
250
  "alias": null,
249
251
  "args": null,
250
- "concreteType": "VariableSetting",
251
- "kind": "LinkedField",
252
- "name": "coordinates",
253
- "plural": true,
254
- "selections": [{
255
- "alias": null,
256
- "args": null,
257
- "kind": "ScalarField",
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
- }, v11 /*: any*/, v15 /*: any*/, v16 /*: any*/],
263
+ }],
271
264
  "storageKey": null
272
265
  },
273
- v23 = {
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
- }, v22 /*: any*/, v8 /*: any*/, v11 /*: any*/],
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
- }, v23 /*: any*/, v22 /*: any*/],
369
+ }, v25 /*: any*/, v26 /*: any*/],
352
370
  "storageKey": "children(collectionTypes:[\"FAMILY\"])"
353
- }, v23 /*: any*/, v22 /*: any*/, {
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": "db67729502b6f5caa899ebd9c82f964d",
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
- return chunkConsecutiveBy(collection.fontStyles, (left, right) => left.cssFamily === right.cssFamily && left.cssWeight === right.cssWeight && left.cssStretch === right.cssStretch);
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 !== "73d00dd2b57a2b44a86ee085b4313d77" && 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);
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, {
@@ -15,7 +15,7 @@ const StoreModalIndex = _ref => {
15
15
  let {
16
16
  prepared
17
17
  } = _ref;
18
- const data = (0, _reactRelay.usePreloadedQuery)((_StoreModalIndexQuery2.default.hash && _StoreModalIndexQuery2.default.hash !== "300b462c41a951b4f94c4b8da7a6821f" && console.error("The definition of 'StoreModalIndexQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalIndexQuery2.default), prepared.indexQuery);
18
+ const data = (0, _reactRelay.usePreloadedQuery)((_StoreModalIndexQuery2.default.hash && _StoreModalIndexQuery2.default.hash !== "099c77808b41054885365ebe3eda03c8" && console.error("The definition of 'StoreModalIndexQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalIndexQuery2.default), prepared.indexQuery);
19
19
  const viewer = data.viewer;
20
20
  const edges = (viewer === null || viewer === void 0 ? void 0 : (_viewer$rootCollectio = viewer.rootCollections) === null || _viewer$rootCollectio === void 0 ? void 0 : _viewer$rootCollectio.edges) ?? [];
21
21
  return /*#__PURE__*/_react.default.createElement(_StoreModalPageContainer.default, null, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontdue-js",
3
- "version": "2.22.2",
3
+ "version": "2.22.4",
4
4
  "scripts": {
5
5
  "build": "npm run relay && run-p build-js build-css build-ts",
6
6
  "build-js": "babel src --out-dir dist --extensions .ts,.tsx,.js,.jsx",
@@ -0,0 +1,11 @@
1
+ declare global {
2
+ interface FontFaceSet {
3
+ add(font: FontFace): FontFaceSet;
4
+ delete(font: FontFace): boolean;
5
+ clear(): void;
6
+ has(font: FontFace): boolean;
7
+ readonly size: number;
8
+ }
9
+ }
10
+
11
+ export {};
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v14.13.1