fontdue-js 2.0.0-alpha8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +3 -2
  2. package/README.md +34 -1
  3. package/dist/__generated__/TypeTesterFeaturesButton_fontStyle.graphql.d.ts +17 -0
  4. package/dist/__generated__/TypeTesterFeaturesButton_fontStyle.graphql.js +32 -0
  5. package/dist/__generated__/TypeTesterFeatures_fontStyle.graphql.d.ts +2 -2
  6. package/dist/__generated__/TypeTesterFeatures_fontStyle.graphql.js +6 -2
  7. package/dist/__generated__/TypeTesterFloatingToolbar_testers.graphql.d.ts +2 -2
  8. package/dist/__generated__/TypeTesterFloatingToolbar_testers.graphql.js +3 -3
  9. package/dist/__generated__/TypeTesterStandaloneQuery.graphql.d.ts +1 -1
  10. package/dist/__generated__/TypeTesterStandaloneQuery.graphql.js +24 -24
  11. package/dist/__generated__/TypeTesterToolbar_fontStyle.graphql.d.ts +17 -0
  12. package/dist/__generated__/TypeTesterToolbar_fontStyle.graphql.js +36 -0
  13. package/dist/__generated__/TypeTesterVariableAxes_fontStyle.graphql.d.ts +22 -0
  14. package/dist/__generated__/TypeTesterVariableAxes_fontStyle.graphql.js +61 -0
  15. package/dist/__generated__/TypeTester_NewStyleQuery.graphql.d.ts +2 -2
  16. package/dist/__generated__/TypeTester_NewStyleQuery.graphql.js +29 -25
  17. package/dist/__generated__/TypeTester_fontStyle.graphql.d.ts +2 -2
  18. package/dist/__generated__/TypeTester_fontStyle.graphql.js +7 -3
  19. package/dist/__generated__/TypeTestersIDQuery.graphql.d.ts +1 -1
  20. package/dist/__generated__/TypeTestersIDQuery.graphql.js +24 -24
  21. package/dist/__generated__/TypeTestersSlugQuery.graphql.d.ts +1 -1
  22. package/dist/__generated__/TypeTestersSlugQuery.graphql.js +24 -24
  23. package/dist/__generated__/useFeaturesData_fontStyle.graphql.d.ts +1 -7
  24. package/dist/__generated__/useFeaturesData_fontStyle.graphql.js +2 -35
  25. package/dist/components/ConfigContext.d.ts +2 -0
  26. package/dist/components/ConfigContext.js +1 -0
  27. package/dist/components/TypeTester/TypeTesterFeatures.d.ts +1 -1
  28. package/dist/components/TypeTester/TypeTesterFeatures.js +6 -11
  29. package/dist/components/TypeTester/TypeTesterFeaturesButton.d.ts +2 -2
  30. package/dist/components/TypeTester/TypeTesterFeaturesButton.js +4 -1
  31. package/dist/components/TypeTester/TypeTesterFloatingToolbar.js +7 -1
  32. package/dist/components/TypeTester/TypeTesterToolbar.d.ts +4 -2
  33. package/dist/components/TypeTester/TypeTesterToolbar.js +11 -2
  34. package/dist/components/TypeTester/TypeTesterVariableAxes.d.ts +3 -6
  35. package/dist/components/TypeTester/TypeTesterVariableAxes.js +15 -2
  36. package/dist/components/TypeTester/index.d.ts +2 -1
  37. package/dist/components/TypeTester/index.js +11 -4
  38. package/dist/components/TypeTester/types.d.ts +1 -0
  39. package/dist/components/TypeTester/useFeaturesData.d.ts +0 -6
  40. package/dist/components/TypeTester/useFeaturesData.js +1 -1
  41. package/dist/fontdue.css +28 -7
  42. package/package.json +1 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<909be9f617c199ac4262b87a1802971b>>
8
+ * @generated SignedSource<<0c546bb85927f14769c29310a2287389>>
9
9
  * @lightSyntaxTransform
10
10
  * @nogrep
11
11
  */
@@ -386,27 +386,6 @@ const node = function () {
386
386
  "name": "fontStyle",
387
387
  "plural": false,
388
388
  "selections": [v8 /*: any*/, {
389
- "alias": null,
390
- "args": null,
391
- "concreteType": "VariableAxis",
392
- "kind": "LinkedField",
393
- "name": "variableAxes",
394
- "plural": true,
395
- "selections": [v13 /*: any*/, v9 /*: any*/, {
396
- "alias": null,
397
- "args": null,
398
- "kind": "ScalarField",
399
- "name": "minValue",
400
- "storageKey": null
401
- }, {
402
- "alias": null,
403
- "args": null,
404
- "kind": "ScalarField",
405
- "name": "maxValue",
406
- "storageKey": null
407
- }],
408
- "storageKey": null
409
- }, {
410
389
  "alias": null,
411
390
  "args": null,
412
391
  "concreteType": "FontFeatures",
@@ -442,6 +421,27 @@ const node = function () {
442
421
  "storageKey": null
443
422
  }],
444
423
  "storageKey": null
424
+ }, {
425
+ "alias": null,
426
+ "args": null,
427
+ "concreteType": "VariableAxis",
428
+ "kind": "LinkedField",
429
+ "name": "variableAxes",
430
+ "plural": true,
431
+ "selections": [v13 /*: any*/, v9 /*: any*/, {
432
+ "alias": null,
433
+ "args": null,
434
+ "kind": "ScalarField",
435
+ "name": "minValue",
436
+ "storageKey": null
437
+ }, {
438
+ "alias": null,
439
+ "args": null,
440
+ "kind": "ScalarField",
441
+ "name": "maxValue",
442
+ "storageKey": null
443
+ }],
444
+ "storageKey": null
445
445
  }, v9 /*: any*/, v10 /*: any*/, v11 /*: any*/, v12 /*: any*/, v16 /*: any*/, {
446
446
  "alias": null,
447
447
  "args": null,
@@ -537,12 +537,12 @@ const node = function () {
537
537
  }]
538
538
  },
539
539
  "params": {
540
- "cacheID": "201b12566d89606ba3084b95513b48a8",
540
+ "cacheID": "d294f032d7303c90c749635091fef19e",
541
541
  "id": null,
542
542
  "metadata": {},
543
543
  "name": "TypeTestersIDQuery",
544
544
  "operationKind": "query",
545
- "text": "query TypeTestersIDQuery(\n $collectionId: ID!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n viewer {\n ...TypeTesters_viewer\n id\n }\n collection: node(id: $collectionId) {\n __typename\n ...TypeTesters_collection_4Goyz5\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_2AMk59\n id\n price(licenseOptions: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node on FontCollection {\n ...PriceBarSection_node\n parent {\n ...PriceBarSection_node\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SKUPrice_sku_2AMk59 on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment SelectButton_sku_2AMk59 on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_viewer on Viewer {\n families: fontCollections(collectionTypes: [FAMILY], first: 999) {\n edges {\n node {\n id\n name\n isVariableFont\n fontStyles {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n }\n }\n }\n }\n}\n\nfragment TypeTester_fontStyle on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...useFeaturesData_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n fontCollections {\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n id\n }\n}\n\nfragment TypeTester_viewer on Viewer {\n ...TypeTesterStyleSelectData_viewer\n}\n\nfragment TypeTesters_collection_4Goyz5 on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n direction\n fontStyle {\n ...TypeTester_fontStyle\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node\n }\n parent {\n id\n }\n}\n\nfragment TypeTesters_viewer on Viewer {\n ...TypeTester_viewer\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
545
+ "text": "query TypeTestersIDQuery(\n $collectionId: ID!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n viewer {\n ...TypeTesters_viewer\n id\n }\n collection: node(id: $collectionId) {\n __typename\n ...TypeTesters_collection_4Goyz5\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_2AMk59\n id\n price(licenseOptions: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node on FontCollection {\n ...PriceBarSection_node\n parent {\n ...PriceBarSection_node\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SKUPrice_sku_2AMk59 on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment SelectButton_sku_2AMk59 on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment TypeTesterFeaturesButton_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...TypeTesterToolbar_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_viewer on Viewer {\n families: fontCollections(collectionTypes: [FAMILY], first: 999) {\n edges {\n node {\n id\n name\n isVariableFont\n fontStyles {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n }\n }\n }\n }\n}\n\nfragment TypeTesterToolbar_fontStyle on FontStyle {\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterFeaturesButton_fontStyle\n}\n\nfragment TypeTesterVariableAxes_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n}\n\nfragment TypeTester_fontStyle on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n fontCollections {\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n id\n }\n}\n\nfragment TypeTester_viewer on Viewer {\n ...TypeTesterStyleSelectData_viewer\n}\n\nfragment TypeTesters_collection_4Goyz5 on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n direction\n fontStyle {\n ...TypeTester_fontStyle\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node\n }\n parent {\n id\n }\n}\n\nfragment TypeTesters_viewer on Viewer {\n ...TypeTester_viewer\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
546
546
  }
547
547
  };
548
548
  }();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<f5c5e5a1071171464fb637676ecd406a>>
2
+ * @generated SignedSource<<7aef54213b657464f66a2a82ace12b91>>
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<<f5c5e5a1071171464fb637676ecd406a>>
8
+ * @generated SignedSource<<7aef54213b657464f66a2a82ace12b91>>
9
9
  * @lightSyntaxTransform
10
10
  * @nogrep
11
11
  */
@@ -391,27 +391,6 @@ const node = function () {
391
391
  "name": "fontStyle",
392
392
  "plural": false,
393
393
  "selections": [v8 /*: any*/, {
394
- "alias": null,
395
- "args": null,
396
- "concreteType": "VariableAxis",
397
- "kind": "LinkedField",
398
- "name": "variableAxes",
399
- "plural": true,
400
- "selections": [v13 /*: any*/, v9 /*: any*/, {
401
- "alias": null,
402
- "args": null,
403
- "kind": "ScalarField",
404
- "name": "minValue",
405
- "storageKey": null
406
- }, {
407
- "alias": null,
408
- "args": null,
409
- "kind": "ScalarField",
410
- "name": "maxValue",
411
- "storageKey": null
412
- }],
413
- "storageKey": null
414
- }, {
415
394
  "alias": null,
416
395
  "args": null,
417
396
  "concreteType": "FontFeatures",
@@ -447,6 +426,27 @@ const node = function () {
447
426
  "storageKey": null
448
427
  }],
449
428
  "storageKey": null
429
+ }, {
430
+ "alias": null,
431
+ "args": null,
432
+ "concreteType": "VariableAxis",
433
+ "kind": "LinkedField",
434
+ "name": "variableAxes",
435
+ "plural": true,
436
+ "selections": [v13 /*: any*/, v9 /*: any*/, {
437
+ "alias": null,
438
+ "args": null,
439
+ "kind": "ScalarField",
440
+ "name": "minValue",
441
+ "storageKey": null
442
+ }, {
443
+ "alias": null,
444
+ "args": null,
445
+ "kind": "ScalarField",
446
+ "name": "maxValue",
447
+ "storageKey": null
448
+ }],
449
+ "storageKey": null
450
450
  }, v9 /*: any*/, v10 /*: any*/, v11 /*: any*/, v12 /*: any*/, v16 /*: any*/, {
451
451
  "alias": null,
452
452
  "args": null,
@@ -545,12 +545,12 @@ const node = function () {
545
545
  }]
546
546
  },
547
547
  "params": {
548
- "cacheID": "2cc2d650d7a66f47092453908a3b260e",
548
+ "cacheID": "b65ab81be6b235d7f4ed1389c70a66e0",
549
549
  "id": null,
550
550
  "metadata": {},
551
551
  "name": "TypeTestersSlugQuery",
552
552
  "operationKind": "query",
553
- "text": "query TypeTestersSlugQuery(\n $collectionSlug: String!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n viewer {\n ...TypeTesters_viewer\n slug(name: $collectionSlug) {\n collection: fontCollection {\n ...TypeTesters_collection_4Goyz5\n id\n }\n id\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_2AMk59\n id\n price(licenseOptions: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node on FontCollection {\n ...PriceBarSection_node\n parent {\n ...PriceBarSection_node\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SKUPrice_sku_2AMk59 on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment SelectButton_sku_2AMk59 on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_viewer on Viewer {\n families: fontCollections(collectionTypes: [FAMILY], first: 999) {\n edges {\n node {\n id\n name\n isVariableFont\n fontStyles {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n }\n }\n }\n }\n}\n\nfragment TypeTester_fontStyle on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...useFeaturesData_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n fontCollections {\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n id\n }\n}\n\nfragment TypeTester_viewer on Viewer {\n ...TypeTesterStyleSelectData_viewer\n}\n\nfragment TypeTesters_collection_4Goyz5 on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n direction\n fontStyle {\n ...TypeTester_fontStyle\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node\n }\n parent {\n id\n }\n}\n\nfragment TypeTesters_viewer on Viewer {\n ...TypeTester_viewer\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
553
+ "text": "query TypeTestersSlugQuery(\n $collectionSlug: String!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n viewer {\n ...TypeTesters_viewer\n slug(name: $collectionSlug) {\n collection: fontCollection {\n ...TypeTesters_collection_4Goyz5\n id\n }\n id\n }\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n cssFamily\n name\n}\n\nfragment PriceBarSection_node on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_2AMk59\n id\n price(licenseOptions: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node on FontCollection {\n ...PriceBarSection_node\n parent {\n ...PriceBarSection_node\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SKUPrice_sku_2AMk59 on Sku {\n id\n price(licenseOptions: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment SelectButton_sku_2AMk59 on Sku {\n id\n ...SKUPrice_sku_2AMk59\n}\n\nfragment TypeTesterFeaturesButton_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n}\n\nfragment TypeTesterFeatures_fontStyle on FontStyle {\n ...useFeaturesData_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n}\n\nfragment TypeTesterFloatingToolbar_testers on TypeTester {\n id\n fontStyle {\n ...TypeTesterToolbar_fontStyle\n ...TypeTesterFeatures_fontStyle\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n name\n id\n }\n}\n\nfragment TypeTesterStyleSelectData_viewer on Viewer {\n families: fontCollections(collectionTypes: [FAMILY], first: 999) {\n edges {\n node {\n id\n name\n isVariableFont\n fontStyles {\n id\n name\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n }\n }\n }\n }\n}\n\nfragment TypeTesterToolbar_fontStyle on FontStyle {\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterFeaturesButton_fontStyle\n}\n\nfragment TypeTesterVariableAxes_fontStyle on FontStyle {\n variableAxes {\n axis\n name\n minValue\n maxValue\n }\n}\n\nfragment TypeTester_fontStyle on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n family {\n cssUrl\n id\n }\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n fontCollections {\n sku {\n ...SelectButton_sku\n ...SKUPrice_sku\n id\n basePrice: price {\n amount\n }\n }\n id\n }\n}\n\nfragment TypeTester_viewer on Viewer {\n ...TypeTesterStyleSelectData_viewer\n}\n\nfragment TypeTesters_collection_4Goyz5 on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n direction\n fontStyle {\n ...TypeTester_fontStyle\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node\n }\n parent {\n id\n }\n}\n\nfragment TypeTesters_viewer on Viewer {\n ...TypeTester_viewer\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n"
554
554
  }
555
555
  };
556
556
  }();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<7d4999e57a7c997c4cbcbf4ed36e6c04>>
2
+ * @generated SignedSource<<9312afbe2cf53f2aa12bf530c59225e0>>
3
3
  * @lightSyntaxTransform
4
4
  * @nogrep
5
5
  */
@@ -13,12 +13,6 @@ export type useFeaturesData_fontStyle$data = {
13
13
  }>;
14
14
  readonly supportedFeatures: ReadonlyArray<string>;
15
15
  };
16
- readonly variableAxes: ReadonlyArray<{
17
- readonly axis: string;
18
- readonly maxValue: number;
19
- readonly minValue: number;
20
- readonly name: string;
21
- }> | null;
22
16
  readonly " $fragmentType": "useFeaturesData_fontStyle";
23
17
  };
24
18
  export type useFeaturesData_fontStyle$key = {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<7d4999e57a7c997c4cbcbf4ed36e6c04>>
8
+ * @generated SignedSource<<9312afbe2cf53f2aa12bf530c59225e0>>
9
9
  * @lightSyntaxTransform
10
10
  * @nogrep
11
11
  */
@@ -20,39 +20,6 @@ const node = {
20
20
  "metadata": null,
21
21
  "name": "useFeaturesData_fontStyle",
22
22
  "selections": [{
23
- "alias": null,
24
- "args": null,
25
- "concreteType": "VariableAxis",
26
- "kind": "LinkedField",
27
- "name": "variableAxes",
28
- "plural": true,
29
- "selections": [{
30
- "alias": null,
31
- "args": null,
32
- "kind": "ScalarField",
33
- "name": "axis",
34
- "storageKey": null
35
- }, {
36
- "alias": null,
37
- "args": null,
38
- "kind": "ScalarField",
39
- "name": "name",
40
- "storageKey": null
41
- }, {
42
- "alias": null,
43
- "args": null,
44
- "kind": "ScalarField",
45
- "name": "minValue",
46
- "storageKey": null
47
- }, {
48
- "alias": null,
49
- "args": null,
50
- "kind": "ScalarField",
51
- "name": "maxValue",
52
- "storageKey": null
53
- }],
54
- "storageKey": null
55
- }, {
56
23
  "alias": null,
57
24
  "args": null,
58
25
  "concreteType": "FontFeatures",
@@ -92,6 +59,6 @@ const node = {
92
59
  "type": "FontStyle",
93
60
  "abstractKey": null
94
61
  };
95
- node.hash = "f698c938cad6a351aaba65d33ce650d2";
62
+ node.hash = "3c48a87b1b19f52e3dda10fc11f0030a";
96
63
  var _default = node;
97
64
  exports.default = _default;
@@ -36,6 +36,7 @@ export declare const makeConfig: (config?: Config) => {
36
36
  }[] | undefined;
37
37
  selectionStyle: "checkbox" | "bullet";
38
38
  };
39
+ variableAxesPosition: import("./TypeTester/types").TypeTesterAxesPosition;
39
40
  alignmentButtons: boolean;
40
41
  initialAlignment: import("./TypeTester/types").Alignment;
41
42
  size: {
@@ -85,6 +86,7 @@ declare const _default: React.Context<{
85
86
  }[] | undefined;
86
87
  selectionStyle: "checkbox" | "bullet";
87
88
  };
89
+ variableAxesPosition: import("./TypeTester/types").TypeTesterAxesPosition;
88
90
  alignmentButtons: boolean;
89
91
  initialAlignment: import("./TypeTester/types").Alignment;
90
92
  size: {
@@ -32,6 +32,7 @@ const makeTypeTesterConfig = config => {
32
32
  columns: config === null || config === void 0 ? void 0 : (_config$openTypeFeatu2 = config.openTypeFeatures) === null || _config$openTypeFeatu2 === void 0 ? void 0 : _config$openTypeFeatu2.columns,
33
33
  selectionStyle: (config === null || config === void 0 ? void 0 : (_config$openTypeFeatu3 = config.openTypeFeatures) === null || _config$openTypeFeatu3 === void 0 ? void 0 : _config$openTypeFeatu3.selectionStyle) ?? 'bullet'
34
34
  },
35
+ variableAxesPosition: (config === null || config === void 0 ? void 0 : config.variableAxesPosition) ?? 'auto',
35
36
  alignmentButtons: (config === null || config === void 0 ? void 0 : config.alignmentButtons) ?? false,
36
37
  initialAlignment: (config === null || config === void 0 ? void 0 : config.initialAlignment) ?? 'left',
37
38
  size: {
@@ -6,5 +6,5 @@ interface TypeTesterFeatures_props {
6
6
  features: ReadonlyArray<string> | null;
7
7
  axes: ReadonlyArray<string> | null | undefined;
8
8
  }
9
- export default function TypeTesterFeatures({ id, fontStyle: fontStyleKey, features: showFeatures, axes: showAxes, }: TypeTesterFeatures_props): React.JSX.Element;
9
+ export default function TypeTesterFeatures({ id, fontStyle: fontStyleKey, features: showFeatures, axes, }: TypeTesterFeatures_props): React.JSX.Element;
10
10
  export {};
@@ -58,9 +58,9 @@ function TypeTesterFeatures(_ref) {
58
58
  id,
59
59
  fontStyle: fontStyleKey,
60
60
  features: showFeatures,
61
- axes: showAxes
61
+ axes
62
62
  } = _ref;
63
- const fontStyle = (0, _reactRelay.useFragment)(_TypeTesterFeatures_fontStyle !== void 0 ? _TypeTesterFeatures_fontStyle : (_TypeTesterFeatures_fontStyle = require("../../__generated__/TypeTesterFeatures_fontStyle.graphql"), _TypeTesterFeatures_fontStyle.hash && _TypeTesterFeatures_fontStyle.hash !== "25582c33916ebaadd2f674b1d0b6bf4b" && console.error("The definition of 'TypeTesterFeatures_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterFeatures_fontStyle), fontStyleKey);
63
+ const fontStyle = (0, _reactRelay.useFragment)(_TypeTesterFeatures_fontStyle !== void 0 ? _TypeTesterFeatures_fontStyle : (_TypeTesterFeatures_fontStyle = require("../../__generated__/TypeTesterFeatures_fontStyle.graphql"), _TypeTesterFeatures_fontStyle.hash && _TypeTesterFeatures_fontStyle.hash !== "d0c693dadaa9ae68f5295f3fc69a7578" && console.error("The definition of 'TypeTesterFeatures_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterFeatures_fontStyle), fontStyleKey);
64
64
  const {
65
65
  typeTester: config
66
66
  } = (0, _react.useContext)(_ConfigContext.default);
@@ -73,7 +73,6 @@ function TypeTesterFeatures(_ref) {
73
73
  });
74
74
  const selectionStyle = config.openTypeFeatures.selectionStyle;
75
75
  const {
76
- variableAxes,
77
76
  featureNames,
78
77
  fontFeatures
79
78
  } = (0, _useFeaturesData.default)({
@@ -126,15 +125,11 @@ function TypeTesterFeatures(_ref) {
126
125
  }
127
126
  }, /*#__PURE__*/_react.default.createElement("div", {
128
127
  ref: featuresContentRef
129
- }, /*#__PURE__*/_react.default.createElement(_TypeTesterVariableAxes.default, {
128
+ }, axes ? /*#__PURE__*/_react.default.createElement(_TypeTesterVariableAxes.default, {
130
129
  id: id,
131
- axes: variableAxes === null || variableAxes === void 0 ? void 0 : variableAxes.filter(_ref2 => {
132
- let {
133
- axis
134
- } = _ref2;
135
- return showAxes === null || showAxes === void 0 ? void 0 : showAxes.includes(axis);
136
- })
137
- }), /*#__PURE__*/_react.default.createElement("div", {
130
+ axes: axes,
131
+ fontStyle: fontStyle
132
+ }) : null, /*#__PURE__*/_react.default.createElement("div", {
138
133
  className: "type-tester__features",
139
134
  "data-selection-style": selectionStyle,
140
135
  "data-columns": (_config$openTypeFeatu3 = config.openTypeFeatures) !== null && _config$openTypeFeatu3 !== void 0 && (_config$openTypeFeatu4 = _config$openTypeFeatu3.columns) !== null && _config$openTypeFeatu4 !== void 0 && _config$openTypeFeatu4.length ? 'set' : 'auto'
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { useFeaturesData_fontStyle$key } from '__generated__/useFeaturesData_fontStyle.graphql';
2
+ import { TypeTesterFeaturesButton_fontStyle$key } from '__generated__/TypeTesterFeaturesButton_fontStyle.graphql';
3
3
  interface TypeTesterFeaturesButton_props {
4
4
  id: string;
5
- fontStyle: useFeaturesData_fontStyle$key;
5
+ fontStyle: TypeTesterFeaturesButton_fontStyle$key;
6
6
  onNeedsRefocus?: () => void;
7
7
  features: readonly string[] | null | undefined;
8
8
  }
@@ -11,13 +11,15 @@ var _CarrotUp = _interopRequireDefault(require("../Icons/CarrotUp"));
11
11
  var _Select = _interopRequireDefault(require("../Select"));
12
12
  var _TypeTesterState = _interopRequireDefault(require("./TypeTesterState"));
13
13
  var _useFeaturesData = _interopRequireDefault(require("./useFeaturesData"));
14
+ var _reactRelay = require("react-relay");
15
+ var _TypeTesterFeaturesButton_fontStyle;
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
19
  const TypeTesterFeaturesButton = _ref => {
18
20
  let {
19
21
  id,
20
- fontStyle,
22
+ fontStyle: fontStyleKey,
21
23
  onNeedsRefocus,
22
24
  features: showFeatures
23
25
  } = _ref;
@@ -33,6 +35,7 @@ const TypeTesterFeaturesButton = _ref => {
33
35
  id
34
36
  });
35
37
  const selectedFeature = features[0];
38
+ const fontStyle = (0, _reactRelay.useFragment)(_TypeTesterFeaturesButton_fontStyle !== void 0 ? _TypeTesterFeaturesButton_fontStyle : (_TypeTesterFeaturesButton_fontStyle = require("../../__generated__/TypeTesterFeaturesButton_fontStyle.graphql"), _TypeTesterFeaturesButton_fontStyle.hash && _TypeTesterFeaturesButton_fontStyle.hash !== "bfda99c867db0b614314fc774911c4b0" && console.error("The definition of 'TypeTesterFeaturesButton_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterFeaturesButton_fontStyle), fontStyleKey);
36
39
  const {
37
40
  featureNames
38
41
  } = (0, _useFeaturesData.default)({
@@ -9,6 +9,7 @@ var _reactRelay = require("react-relay");
9
9
  var _TypeTesterContext = require("./TypeTesterContext");
10
10
  var _TypeTesterFeatures = _interopRequireDefault(require("./TypeTesterFeatures"));
11
11
  var _TypeTesterToolbar = _interopRequireDefault(require("./TypeTesterToolbar"));
12
+ var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
12
13
  var _TypeTesterFloatingToolbar_testers;
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -21,7 +22,7 @@ function TypeTesterFloatingToolbar(_ref) {
21
22
  axes,
22
23
  onToolbarOpenClose
23
24
  } = _ref;
24
- const testersData = (0, _reactRelay.useFragment)(_TypeTesterFloatingToolbar_testers !== void 0 ? _TypeTesterFloatingToolbar_testers : (_TypeTesterFloatingToolbar_testers = require("../../__generated__/TypeTesterFloatingToolbar_testers.graphql"), _TypeTesterFloatingToolbar_testers.hash && _TypeTesterFloatingToolbar_testers.hash !== "3b87269ef35fe6c6cfabcc7a2e330a3c" && console.error("The definition of 'TypeTesterFloatingToolbar_testers' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterFloatingToolbar_testers), testersKey);
25
+ const testersData = (0, _reactRelay.useFragment)(_TypeTesterFloatingToolbar_testers !== void 0 ? _TypeTesterFloatingToolbar_testers : (_TypeTesterFloatingToolbar_testers = require("../../__generated__/TypeTesterFloatingToolbar_testers.graphql"), _TypeTesterFloatingToolbar_testers.hash && _TypeTesterFloatingToolbar_testers.hash !== "5f037fca9e02cba8c202f17e08ff8db6" && console.error("The definition of 'TypeTesterFloatingToolbar_testers' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterFloatingToolbar_testers), testersKey);
25
26
  const {
26
27
  testers
27
28
  } = (0, _react.useContext)(_TypeTesterContext.TypeTesterContext);
@@ -57,7 +58,11 @@ function TypeTesterFloatingToolbar(_ref) {
57
58
  (0, _react.useEffect)(() => {
58
59
  onToolbarOpenClose === null || onToolbarOpenClose === void 0 ? void 0 : onToolbarOpenClose(open);
59
60
  }, [onToolbarOpenClose, open]);
61
+ const {
62
+ typeTester: config
63
+ } = (0, _react.useContext)(_ConfigContext.default);
60
64
  const fontStyle = (_testersData$find = testersData.find(tester => tester.id === activeId)) === null || _testersData$find === void 0 ? void 0 : _testersData$find.fontStyle;
65
+ const axesPosition = config.variableAxesPosition === 'auto' ? ((axes === null || axes === void 0 ? void 0 : axes.length) ?? 0) > 1 ? 'features-panel' : 'inline' : config.variableAxesPosition;
61
66
  return /*#__PURE__*/_react.default.createElement("div", {
62
67
  className: "type-tester__floating-toolbar",
63
68
  onMouseDown: e => e.preventDefault(),
@@ -66,6 +71,7 @@ function TypeTesterFloatingToolbar(_ref) {
66
71
  id: activeId,
67
72
  features: features,
68
73
  axes: axes,
74
+ axesPosition: axesPosition,
69
75
  fontStyle: fontStyle
70
76
  }), features && /*#__PURE__*/_react.default.createElement(_TypeTesterFeatures.default, {
71
77
  id: activeId,
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
- import { useFeaturesData_fontStyle$key } from '__generated__/useFeaturesData_fontStyle.graphql';
2
+ import { TypeTesterAxesPosition } from './types';
3
+ import { TypeTesterToolbar_fontStyle$key } from '__generated__/TypeTesterToolbar_fontStyle.graphql';
3
4
  interface TypeTesterToolbar_props {
4
5
  id: string;
5
6
  features?: ReadonlyArray<string> | null;
6
7
  axes?: ReadonlyArray<string> | null;
7
- fontStyle: useFeaturesData_fontStyle$key;
8
+ axesPosition: TypeTesterAxesPosition;
9
+ fontStyle: TypeTesterToolbar_fontStyle$key;
8
10
  onNeedsRefocus?: () => void;
9
11
  groupEdit?: boolean;
10
12
  }
@@ -12,6 +12,9 @@ var _TypeTesterInput = _interopRequireDefault(require("./TypeTesterInput"));
12
12
  var _TypeTesterState = _interopRequireDefault(require("./TypeTesterState"));
13
13
  var _TypeTesterAlignButtons = _interopRequireDefault(require("./TypeTesterAlignButtons"));
14
14
  var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
15
+ var _TypeTesterVariableAxes = _interopRequireDefault(require("./TypeTesterVariableAxes"));
16
+ var _reactRelay = require("react-relay");
17
+ var _TypeTesterToolbar_fontStyle;
15
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -20,7 +23,8 @@ const TypeTesterToolbar = _ref => {
20
23
  id,
21
24
  features,
22
25
  axes,
23
- fontStyle,
26
+ axesPosition,
27
+ fontStyle: fontStyleKey,
24
28
  onNeedsRefocus,
25
29
  groupEdit
26
30
  } = _ref;
@@ -30,6 +34,7 @@ const TypeTesterToolbar = _ref => {
30
34
  const props = (0, _TypeTesterState.default)({
31
35
  id
32
36
  });
37
+ const fontStyle = (0, _reactRelay.useFragment)(_TypeTesterToolbar_fontStyle !== void 0 ? _TypeTesterToolbar_fontStyle : (_TypeTesterToolbar_fontStyle = require("../../__generated__/TypeTesterToolbar_fontStyle.graphql"), _TypeTesterToolbar_fontStyle.hash && _TypeTesterToolbar_fontStyle.hash !== "1a0f844cbe51f96ed0145d8009f8bff0" && console.error("The definition of 'TypeTesterToolbar_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterToolbar_fontStyle), fontStyleKey);
33
38
  return /*#__PURE__*/_react.default.createElement("div", {
34
39
  className: "type-tester__toolbar__tools",
35
40
  onMouseDown: e => e.preventDefault()
@@ -60,7 +65,11 @@ const TypeTesterToolbar = _ref => {
60
65
  onChange: props.setLineHeight,
61
66
  stepSize: 0.01,
62
67
  interpolator: "log10"
63
- }))), (Boolean(features === null || features === void 0 ? void 0 : features.length) || Boolean(axes === null || axes === void 0 ? void 0 : axes.length)) && /*#__PURE__*/_react.default.createElement(_TypeTesterFeaturesButton.default, {
68
+ }))), axesPosition === 'inline' && /*#__PURE__*/_react.default.createElement(_TypeTesterVariableAxes.default, {
69
+ id: id,
70
+ fontStyle: fontStyle,
71
+ axes: axes
72
+ }), (Boolean(features === null || features === void 0 ? void 0 : features.length) || Boolean(axes === null || axes === void 0 ? void 0 : axes.length) && axesPosition === 'features-panel') && /*#__PURE__*/_react.default.createElement(_TypeTesterFeaturesButton.default, {
64
73
  id: id,
65
74
  fontStyle: fontStyle,
66
75
  onNeedsRefocus: onNeedsRefocus,
@@ -1,12 +1,9 @@
1
1
  import React from 'react';
2
+ import { TypeTesterVariableAxes_fontStyle$key } from '__generated__/TypeTesterVariableAxes_fontStyle.graphql';
2
3
  interface TypeTesterVariableAxes_props {
3
4
  id: string;
4
- axes: ReadonlyArray<{
5
- axis: string;
6
- name: string;
7
- minValue: number;
8
- maxValue: number;
9
- }> | null | undefined;
5
+ fontStyle: TypeTesterVariableAxes_fontStyle$key;
6
+ axes: readonly string[] | null | undefined;
10
7
  }
11
8
  declare const TypeTesterVariableAxes: React.FC<TypeTesterVariableAxes_props>;
12
9
  export default TypeTesterVariableAxes;
@@ -7,10 +7,14 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _TypeTesterSlider = _interopRequireDefault(require("./TypeTesterSlider"));
9
9
  var _TypeTesterState = _interopRequireDefault(require("./TypeTesterState"));
10
+ var _reactRelay = require("react-relay");
11
+ var _utils = require("../../utils");
12
+ var _TypeTesterVariableAxes_fontStyle;
10
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
14
  const TypeTesterVariableAxes = _ref => {
12
15
  let {
13
16
  id,
17
+ fontStyle: fontStyleKey,
14
18
  axes
15
19
  } = _ref;
16
20
  const {
@@ -19,6 +23,7 @@ const TypeTesterVariableAxes = _ref => {
19
23
  } = (0, _TypeTesterState.default)({
20
24
  id
21
25
  });
26
+ const fontStyle = (0, _reactRelay.useFragment)(_TypeTesterVariableAxes_fontStyle !== void 0 ? _TypeTesterVariableAxes_fontStyle : (_TypeTesterVariableAxes_fontStyle = require("../../__generated__/TypeTesterVariableAxes_fontStyle.graphql"), _TypeTesterVariableAxes_fontStyle.hash && _TypeTesterVariableAxes_fontStyle.hash !== "a73e45dbb7a154107456088125a01f88" && console.error("The definition of 'TypeTesterVariableAxes_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterVariableAxes_fontStyle), fontStyleKey);
22
27
  if (!variableSettings) return null;
23
28
  if (!axes) return null;
24
29
  const handleChange = (axis, value) => {
@@ -27,13 +32,21 @@ const TypeTesterVariableAxes = _ref => {
27
32
  };
28
33
  return /*#__PURE__*/_react.default.createElement("div", {
29
34
  className: "type-tester__variable-axes"
30
- }, axes.map(_ref2 => {
35
+ }, axes.map(showAxis => {
36
+ var _fontStyle$variableAx;
37
+ return (_fontStyle$variableAx = fontStyle.variableAxes) === null || _fontStyle$variableAx === void 0 ? void 0 : _fontStyle$variableAx.find(_ref2 => {
38
+ let {
39
+ axis
40
+ } = _ref2;
41
+ return axis === showAxis;
42
+ });
43
+ }).filter(_utils.notEmpty).map(_ref3 => {
31
44
  let {
32
45
  axis,
33
46
  name,
34
47
  minValue,
35
48
  maxValue
36
- } = _ref2;
49
+ } = _ref3;
37
50
  const isSmall = Math.abs(maxValue - minValue) <= 1;
38
51
  const value = variableSettings[axis];
39
52
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TypeTester_viewer$key } from '../../__generated__/TypeTester_viewer.graphql';
3
3
  import { TypeTester_fontStyle$key } from '../../__generated__/TypeTester_fontStyle.graphql';
4
- import { Alignment, Direction } from './types';
4
+ import { Alignment, Direction, TypeTesterAxesPosition } from './types';
5
5
  export interface TypeTesterConfig {
6
6
  min?: number;
7
7
  max?: number;
@@ -31,6 +31,7 @@ export interface TypeTesterConfig {
31
31
  }[];
32
32
  selectionStyle?: 'bullet' | 'checkbox';
33
33
  };
34
+ variableAxesPosition?: TypeTesterAxesPosition;
34
35
  alignmentButtons?: boolean;
35
36
  initialAlignment?: Alignment;
36
37
  size?: {
@@ -18,6 +18,7 @@ var _TypeTesterFeatures = _interopRequireDefault(require("./TypeTesterFeatures")
18
18
  var _TypeTesterContent = _interopRequireDefault(require("./TypeTesterContent"));
19
19
  var _TypeTesterState = _interopRequireDefault(require("./TypeTesterState"));
20
20
  var _TypeTesterToolbar = _interopRequireDefault(require("./TypeTesterToolbar"));
21
+ var _TypeTesterVariableAxes = _interopRequireDefault(require("./TypeTesterVariableAxes"));
21
22
  var _TypeTester_fontStyle, _TypeTester_viewer, _TypeTester_NewStyleQuery, _TypeTester_sku;
22
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -53,7 +54,7 @@ const TypeTester = _ref => {
53
54
  axes,
54
55
  groupEdit
55
56
  } = _ref;
56
- const fontStyleData = (0, _reactRelay.useFragment)(_TypeTester_fontStyle !== void 0 ? _TypeTester_fontStyle : (_TypeTester_fontStyle = require("../../__generated__/TypeTester_fontStyle.graphql"), _TypeTester_fontStyle.hash && _TypeTester_fontStyle.hash !== "96336f74661d90c44c9a83479fa8c263" && console.error("The definition of 'TypeTester_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTester_fontStyle), fontStyleKey);
57
+ const fontStyleData = (0, _reactRelay.useFragment)(_TypeTester_fontStyle !== void 0 ? _TypeTester_fontStyle : (_TypeTester_fontStyle = require("../../__generated__/TypeTester_fontStyle.graphql"), _TypeTester_fontStyle.hash && _TypeTester_fontStyle.hash !== "e05fd846d7bcc3733b7afeb36403a7ef" && console.error("The definition of 'TypeTester_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTester_fontStyle), fontStyleKey);
57
58
  const viewer = (0, _reactRelay.useFragment)(_TypeTester_viewer !== void 0 ? _TypeTester_viewer : (_TypeTester_viewer = require("../../__generated__/TypeTester_viewer.graphql"), _TypeTester_viewer.hash && _TypeTester_viewer.hash !== "a12af7126d512a50ab0b7e5e14a7d8eb" && console.error("The definition of 'TypeTester_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTester_viewer), viewerKey);
58
59
  const [selectedFontStyleId, setSelectedFontStyleId] = (0, _react.useState)((fontStyleData === null || fontStyleData === void 0 ? void 0 : fontStyleData.id) ?? null);
59
60
  const [fontStyle, setFontStyle] = (0, _react.useState)(fontStyleData);
@@ -79,6 +80,7 @@ const TypeTester = _ref => {
79
80
  let {
80
81
  typeTester: config
81
82
  } = (0, _react.useContext)(_ConfigContext.default);
83
+ const axesPosition = config.variableAxesPosition === 'auto' ? ((axes === null || axes === void 0 ? void 0 : axes.length) ?? 0) > 1 ? 'features-panel' : 'inline' : config.variableAxesPosition;
82
84
  const props = (0, _TypeTesterState.default)({
83
85
  id
84
86
  });
@@ -109,7 +111,11 @@ const TypeTester = _ref => {
109
111
  "data-shy": config.shy,
110
112
  "data-select-button-style": config.selectButtonStyle,
111
113
  "data-alignment": props.alignment
112
- }, /*#__PURE__*/_react.default.createElement("div", {
114
+ }, axesPosition === 'above' ? /*#__PURE__*/_react.default.createElement(_TypeTesterVariableAxes.default, {
115
+ id: id,
116
+ axes: axes,
117
+ fontStyle: fontStyle
118
+ }) : null, /*#__PURE__*/_react.default.createElement("div", {
113
119
  className: "type-tester__toolbar"
114
120
  }, /*#__PURE__*/_react.default.createElement(_TypeTesterStyleSelectData.default, {
115
121
  fontStyle: fontStyle,
@@ -129,7 +135,7 @@ const TypeTester = _ref => {
129
135
  props.setFeaturesOpen(true);
130
136
  },
131
137
  config: config,
132
- includeVariableAxesOption: Boolean(axes === null || axes === void 0 ? void 0 : axes.length)
138
+ includeVariableAxesOption: Boolean(axes === null || axes === void 0 ? void 0 : axes.length) && axesPosition === 'features-panel'
133
139
  }), config.priceText && fontStyle.sku && /*#__PURE__*/_react.default.createElement("div", {
134
140
  className: "type-tester__toolbar__price-text",
135
141
  onMouseDown: e => e.preventDefault()
@@ -139,6 +145,7 @@ const TypeTester = _ref => {
139
145
  id: id,
140
146
  features: features,
141
147
  axes: axes,
148
+ axesPosition: axesPosition,
142
149
  fontStyle: fontStyle,
143
150
  onNeedsRefocus: onNeedsRefocus,
144
151
  groupEdit: groupEdit
@@ -163,7 +170,7 @@ const TypeTester = _ref => {
163
170
  id: id,
164
171
  fontStyle: fontStyle,
165
172
  features: features ?? null,
166
- axes: axes ?? null
173
+ axes: axesPosition === 'features-panel' ? axes ?? null : null
167
174
  }), /*#__PURE__*/_react.default.createElement("div", {
168
175
  className: "type-tester__text"
169
176
  }, /*#__PURE__*/_react.default.createElement(_FontStyle.default, {