fontdue-js 3.0.0-alpha13 → 3.0.0-alpha15
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 +1 -1
- package/README.md +1 -1
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +9 -3
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +9 -3
- package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +9 -3
- package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartQuery.graphql.js +9 -3
- package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +9 -3
- package/dist/__generated__/CharacterViewerIDQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CharacterViewerIDQuery.graphql.js +9 -3
- package/dist/__generated__/CharacterViewerSlugQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CharacterViewerSlugQuery.graphql.js +9 -3
- package/dist/__generated__/CharacterViewerStyleRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CharacterViewerStyleRefetchQuery.graphql.js +9 -3
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +9 -3
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +9 -3
- package/dist/__generated__/CollectionAa_Query.graphql.d.ts +1 -1
- package/dist/__generated__/CollectionAa_Query.graphql.js +9 -3
- package/dist/__generated__/FontFamiliesQuery.graphql.d.ts +1 -1
- package/dist/__generated__/FontFamiliesQuery.graphql.js +9 -3
- package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +1 -1
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +9 -3
- package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalCartQuery.graphql.js +9 -3
- package/dist/__generated__/StoreModalContainerQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalContainerQuery.graphql.js +9 -3
- package/dist/__generated__/StoreModalIndexQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalIndexQuery.graphql.js +9 -3
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductQuery.graphql.js +9 -3
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +9 -3
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +9 -3
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTestersIDQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersIDQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTestersSlugQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersSlugQuery.graphql.js +9 -3
- package/dist/__generated__/useFontStyle_fontStyle.graphql.d.ts +2 -1
- package/dist/__generated__/useFontStyle_fontStyle.graphql.js +8 -2
- package/dist/__tests__/metricFallback.test.js +74 -0
- package/dist/__tests__/nextAdapter.test.js +4 -98
- package/dist/components/CharacterViewer/index.js +17 -8
- package/dist/components/ConfigContext.d.ts +3 -0
- package/dist/components/ConfigContext.js +3 -1
- package/dist/components/useFontStyle.d.ts +1 -0
- package/dist/components/useFontStyle.js +12 -3
- package/dist/data/unicodeNamesUrl.d.ts +2 -0
- package/dist/data/unicodeNamesUrl.js +18 -0
- package/dist/data/unicodeNamesVersion.d.ts +1 -0
- package/dist/data/unicodeNamesVersion.js +4 -0
- package/dist/fallbackFontData.d.ts +2 -0
- package/dist/fallbackFontData.js +10 -0
- package/dist/fontdue.css +4 -4
- package/dist/metricFallback.d.ts +48 -0
- package/dist/metricFallback.js +98 -0
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +12 -14
- package/dist/next/registerSingleTenantResolver.js +2 -3
- package/dist/next/tenant.d.ts +0 -2
- package/dist/next/tenant.js +9 -51
- package/dist/relay/environment.js +1 -1
- package/dist/relay/serverConfig.d.ts +0 -7
- package/dist/relay/serverConfig.js +0 -12
- package/dist/scripts/publishUnicodeData.js +68 -0
- package/dist/scripts/updateUnicodeData.js +41 -6
- package/dist/server/index.js +4 -3
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<642da79d6304c9a0bba1e98cb8b9b3fe>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -290,6 +290,12 @@ const node = function () {
|
|
|
290
290
|
"kind": "ScalarField",
|
|
291
291
|
"name": "lineGap",
|
|
292
292
|
"storageKey": null
|
|
293
|
+
}, {
|
|
294
|
+
"alias": null,
|
|
295
|
+
"args": null,
|
|
296
|
+
"kind": "ScalarField",
|
|
297
|
+
"name": "avgCharWidth",
|
|
298
|
+
"storageKey": null
|
|
293
299
|
}],
|
|
294
300
|
"storageKey": null
|
|
295
301
|
}, {
|
|
@@ -333,12 +339,12 @@ const node = function () {
|
|
|
333
339
|
}]
|
|
334
340
|
},
|
|
335
341
|
"params": {
|
|
336
|
-
"cacheID": "
|
|
342
|
+
"cacheID": "7af7018fb6a82dcbc5b5c0b29e575642",
|
|
337
343
|
"id": null,
|
|
338
344
|
"metadata": {},
|
|
339
345
|
"name": "TypeTesterStandaloneChangedStylesQuery",
|
|
340
346
|
"operationKind": "query",
|
|
341
|
-
"text": "query TypeTesterStandaloneChangedStylesQuery(\n $id: ID!\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n) {\n node(id: $id) {\n __typename\n ... on FontStyle {\n id\n ...TypeTester_fontStyle_4sncub\n }\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 SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\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 TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
347
|
+
"text": "query TypeTesterStandaloneChangedStylesQuery(\n $id: ID!\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n) {\n node(id: $id) {\n __typename\n ... on FontStyle {\n id\n ...TypeTester_fontStyle_4sncub\n }\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 SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\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 TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
342
348
|
}
|
|
343
349
|
};
|
|
344
350
|
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<95cac7c5372e2efe67c6e5f504552128>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -303,6 +303,12 @@ const node = function () {
|
|
|
303
303
|
"kind": "ScalarField",
|
|
304
304
|
"name": "lineGap",
|
|
305
305
|
"storageKey": null
|
|
306
|
+
}, {
|
|
307
|
+
"alias": null,
|
|
308
|
+
"args": null,
|
|
309
|
+
"kind": "ScalarField",
|
|
310
|
+
"name": "avgCharWidth",
|
|
311
|
+
"storageKey": null
|
|
306
312
|
}],
|
|
307
313
|
"storageKey": null
|
|
308
314
|
}, {
|
|
@@ -353,12 +359,12 @@ const node = function () {
|
|
|
353
359
|
}]
|
|
354
360
|
},
|
|
355
361
|
"params": {
|
|
356
|
-
"cacheID": "
|
|
362
|
+
"cacheID": "7f017d3093445d5704abf5563ee16983",
|
|
357
363
|
"id": null,
|
|
358
364
|
"metadata": {},
|
|
359
365
|
"name": "TypeTesterStandaloneQuery",
|
|
360
366
|
"operationKind": "query",
|
|
361
|
-
"text": "query TypeTesterStandaloneQuery(\n $familyName: String!\n $styleName: String!\n) {\n viewer {\n fontStyle(familyName: $familyName, styleName: $styleName) {\n ...TypeTester_fontStyle\n id\n family {\n id\n parent {\n id\n }\n }\n }\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_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\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 TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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 sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
367
|
+
"text": "query TypeTesterStandaloneQuery(\n $familyName: String!\n $styleName: String!\n) {\n viewer {\n fontStyle(familyName: $familyName, styleName: $styleName) {\n ...TypeTester_fontStyle\n id\n family {\n id\n parent {\n id\n }\n }\n }\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_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\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 TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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 sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
362
368
|
}
|
|
363
369
|
};
|
|
364
370
|
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<7fda4c3e8c368c9043d2359b15ba2d71>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -290,6 +290,12 @@ const node = function () {
|
|
|
290
290
|
"kind": "ScalarField",
|
|
291
291
|
"name": "lineGap",
|
|
292
292
|
"storageKey": null
|
|
293
|
+
}, {
|
|
294
|
+
"alias": null,
|
|
295
|
+
"args": null,
|
|
296
|
+
"kind": "ScalarField",
|
|
297
|
+
"name": "avgCharWidth",
|
|
298
|
+
"storageKey": null
|
|
293
299
|
}],
|
|
294
300
|
"storageKey": null
|
|
295
301
|
}, {
|
|
@@ -333,12 +339,12 @@ const node = function () {
|
|
|
333
339
|
}]
|
|
334
340
|
},
|
|
335
341
|
"params": {
|
|
336
|
-
"cacheID": "
|
|
342
|
+
"cacheID": "881d799f450cec2d9201af51cf743485",
|
|
337
343
|
"id": null,
|
|
338
344
|
"metadata": {},
|
|
339
345
|
"name": "TypeTestersChangedStylesQuery",
|
|
340
346
|
"operationKind": "query",
|
|
341
|
-
"text": "query TypeTestersChangedStylesQuery(\n $ids: [ID!]!\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n) {\n nodes(ids: $ids) {\n __typename\n ... on FontStyle {\n id\n ...TypeTester_fontStyle_4sncub\n }\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 SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\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 TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
347
|
+
"text": "query TypeTestersChangedStylesQuery(\n $ids: [ID!]!\n $licenseOptions: [LicenseOptionsSpec]!\n $orderVariables: [OrderVariableSelectionInput!]\n) {\n nodes(ids: $ids) {\n __typename\n ... on FontStyle {\n id\n ...TypeTester_fontStyle_4sncub\n }\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 SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\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 TypeTesterStyleSelectData_fontStyle on FontStyle {\n id\n name\n supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
342
348
|
}
|
|
343
349
|
};
|
|
344
350
|
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<815340c80adbf3bc8af6c59ba197d147>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -438,6 +438,12 @@ const node = function () {
|
|
|
438
438
|
"kind": "ScalarField",
|
|
439
439
|
"name": "lineGap",
|
|
440
440
|
"storageKey": null
|
|
441
|
+
}, {
|
|
442
|
+
"alias": null,
|
|
443
|
+
"args": null,
|
|
444
|
+
"kind": "ScalarField",
|
|
445
|
+
"name": "avgCharWidth",
|
|
446
|
+
"storageKey": null
|
|
441
447
|
}],
|
|
442
448
|
"storageKey": null
|
|
443
449
|
}, {
|
|
@@ -529,12 +535,12 @@ const node = function () {
|
|
|
529
535
|
}]
|
|
530
536
|
},
|
|
531
537
|
"params": {
|
|
532
|
-
"cacheID": "
|
|
538
|
+
"cacheID": "f6b0d425b91df861af9f486526b12d4c",
|
|
533
539
|
"id": null,
|
|
534
540
|
"metadata": {},
|
|
535
541
|
"name": "TypeTestersIDQuery",
|
|
536
542
|
"operationKind": "query",
|
|
537
|
-
"text": "query TypeTestersIDQuery(\n $collectionId: ID!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n collection: node(id: $collectionId) {\n __typename\n ...TypeTesters_collection_4Goyz5\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment PriceBarSection_node_3BtHDv on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_3BtHDv\n id\n priceWithLicenseOptions: price(licenseOptions: [], orderVariables: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_3BtHDv on FontCollection {\n ...PriceBarSection_node_3BtHDv\n parent {\n ...PriceBarSection_node_3BtHDv\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\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 supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_3BtHDv on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\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 letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_3BtHDv\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_3BtHDv\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_3BtHDv\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
543
|
+
"text": "query TypeTestersIDQuery(\n $collectionId: ID!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n collection: node(id: $collectionId) {\n __typename\n ...TypeTesters_collection_4Goyz5\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment PriceBarSection_node_3BtHDv on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_3BtHDv\n id\n priceWithLicenseOptions: price(licenseOptions: [], orderVariables: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_3BtHDv on FontCollection {\n ...PriceBarSection_node_3BtHDv\n parent {\n ...PriceBarSection_node_3BtHDv\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\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 supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_3BtHDv on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\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 letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_3BtHDv\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_3BtHDv\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_3BtHDv\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
538
544
|
}
|
|
539
545
|
};
|
|
540
546
|
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<f83e94ff9d88fd3beed82d281882eeab>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -449,6 +449,12 @@ const node = function () {
|
|
|
449
449
|
"kind": "ScalarField",
|
|
450
450
|
"name": "lineGap",
|
|
451
451
|
"storageKey": null
|
|
452
|
+
}, {
|
|
453
|
+
"alias": null,
|
|
454
|
+
"args": null,
|
|
455
|
+
"kind": "ScalarField",
|
|
456
|
+
"name": "avgCharWidth",
|
|
457
|
+
"storageKey": null
|
|
452
458
|
}],
|
|
453
459
|
"storageKey": null
|
|
454
460
|
}, {
|
|
@@ -540,12 +546,12 @@ const node = function () {
|
|
|
540
546
|
}]
|
|
541
547
|
},
|
|
542
548
|
"params": {
|
|
543
|
-
"cacheID": "
|
|
549
|
+
"cacheID": "004aa7704a62b6138f2a2fde0326aa98",
|
|
544
550
|
"id": null,
|
|
545
551
|
"metadata": {},
|
|
546
552
|
"name": "TypeTestersRefetchQuery",
|
|
547
553
|
"operationKind": "query",
|
|
548
|
-
"text": "query TypeTestersRefetchQuery(\n $excludeTags: [String!] = null\n $licenseOptions: [LicenseOptionsSpec] = []\n $orderVariables: [OrderVariableSelectionInput!] = []\n $tags: [String!] = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...TypeTesters_collection_32it0Z\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment PriceBarSection_node_4sncub on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_4sncub\n id\n priceWithLicenseOptions: price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_4sncub on FontCollection {\n ...PriceBarSection_node_4sncub\n parent {\n ...PriceBarSection_node_4sncub\n id\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 SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\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 supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment TypeTesters_collection_32it0Z on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_4sncub\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_4sncub\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_4sncub\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
554
|
+
"text": "query TypeTestersRefetchQuery(\n $excludeTags: [String!] = null\n $licenseOptions: [LicenseOptionsSpec] = []\n $orderVariables: [OrderVariableSelectionInput!] = []\n $tags: [String!] = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...TypeTesters_collection_32it0Z\n id\n }\n}\n\nfragment FontStyle_fontStyle on FontStyle {\n ...useFontStyle_fontStyle\n}\n\nfragment PriceBarSection_node_4sncub on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_4sncub\n id\n priceWithLicenseOptions: price(licenseOptions: $licenseOptions, orderVariables: $orderVariables) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: $licenseOptions) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_4sncub on FontCollection {\n ...PriceBarSection_node_4sncub\n parent {\n ...PriceBarSection_node_4sncub\n id\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 SelectButton_sku_4sncub on Sku {\n id\n ...SKUPrice_sku_4sncub\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 supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_4sncub on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_4sncub\n ...SKUPrice_sku_4sncub\n id\n basePrice: price {\n amount\n }\n }\n}\n\nfragment TypeTesters_collection_32it0Z on FontCollection {\n typeTesters(first: 999, tags: $tags, excludeTags: $excludeTags) {\n edges {\n node {\n id\n content\n size\n lineHeight\n letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_4sncub\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_4sncub\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_4sncub\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
549
555
|
}
|
|
550
556
|
};
|
|
551
557
|
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<a94d6158d79c64567c40e76f81d7008d>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -462,6 +462,12 @@ const node = function () {
|
|
|
462
462
|
"kind": "ScalarField",
|
|
463
463
|
"name": "lineGap",
|
|
464
464
|
"storageKey": null
|
|
465
|
+
}, {
|
|
466
|
+
"alias": null,
|
|
467
|
+
"args": null,
|
|
468
|
+
"kind": "ScalarField",
|
|
469
|
+
"name": "avgCharWidth",
|
|
470
|
+
"storageKey": null
|
|
465
471
|
}],
|
|
466
472
|
"storageKey": null
|
|
467
473
|
}, {
|
|
@@ -554,12 +560,12 @@ const node = function () {
|
|
|
554
560
|
}]
|
|
555
561
|
},
|
|
556
562
|
"params": {
|
|
557
|
-
"cacheID": "
|
|
563
|
+
"cacheID": "1e8ea8e801f6c97ced8499dc87a6afad",
|
|
558
564
|
"id": null,
|
|
559
565
|
"metadata": {},
|
|
560
566
|
"name": "TypeTestersSlugQuery",
|
|
561
567
|
"operationKind": "query",
|
|
562
|
-
"text": "query TypeTestersSlugQuery(\n $collectionSlug: String!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n 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 ...useFontStyle_fontStyle\n}\n\nfragment PriceBarSection_node_3BtHDv on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_3BtHDv\n id\n priceWithLicenseOptions: price(licenseOptions: [], orderVariables: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_3BtHDv on FontCollection {\n ...PriceBarSection_node_3BtHDv\n parent {\n ...PriceBarSection_node_3BtHDv\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\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 supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_3BtHDv on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\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 letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_3BtHDv\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_3BtHDv\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_3BtHDv\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n }\n}\n"
|
|
568
|
+
"text": "query TypeTestersSlugQuery(\n $collectionSlug: String!\n $tags: [String!]\n $excludeTags: [String!]\n) {\n 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 ...useFontStyle_fontStyle\n}\n\nfragment PriceBarSection_node_3BtHDv on FontCollection {\n id\n name\n collectionType\n sku {\n ...SelectButton_sku_3BtHDv\n id\n priceWithLicenseOptions: price(licenseOptions: [], orderVariables: []) {\n ...Price_price\n }\n }\n totalStyles\n totalStylesPrice(licenseOptions: []) {\n ...Price_price\n }\n}\n\nfragment PriceBar_node_3BtHDv on FontCollection {\n ...PriceBarSection_node_3BtHDv\n parent {\n ...PriceBarSection_node_3BtHDv\n id\n }\n}\n\nfragment Price_price on Money {\n amount\n currency\n}\n\nfragment SKUPrice_sku_3BtHDv on Sku {\n id\n price(licenseOptions: [], orderVariables: []) {\n amount\n ...Price_price\n }\n}\n\nfragment SelectButton_sku_3BtHDv on Sku {\n id\n ...SKUPrice_sku_3BtHDv\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 supportedLanguages\n cssWeight\n cssStyle\n cssStretch\n variableInstances {\n name\n coordinates {\n axis\n value\n }\n }\n family {\n id\n name\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_3BtHDv on FontStyle {\n id\n ...TypeTesterFeatures_fontStyle\n ...TypeTesterStyleSelectData_fontStyle\n ...FontStyle_fontStyle\n ...TypeTesterVariableAxes_fontStyle\n ...TypeTesterToolbar_fontStyle\n sku {\n ...SelectButton_sku_3BtHDv\n ...SKUPrice_sku_3BtHDv\n id\n basePrice: price {\n amount\n }\n }\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 letterSpacing\n autofit\n direction\n fontStyle {\n ...TypeTester_fontStyle_3BtHDv\n id\n family {\n id\n }\n }\n variableSettings {\n axis\n value\n }\n featureSettings {\n feature\n value\n }\n tags\n ...TypeTesterFloatingToolbar_testers\n }\n }\n }\n typeTesterFeatures\n typeTesterAxes\n id\n ...PriceBar_node_3BtHDv\n families: children(collectionTypes: [FAMILY]) {\n id\n ...PriceBar_node_3BtHDv\n }\n parent {\n id\n }\n}\n\nfragment useFeaturesData_fontStyle on FontStyle {\n fontFeatures {\n supportedFeatures\n stylisticSetNames {\n featureName\n humanName\n }\n }\n}\n\nfragment useFontStyle_fontStyle on FontStyle {\n cssFamily\n name\n webfontSources {\n url\n format\n tech\n }\n verticalMetrics {\n unitsPerEm\n ascender\n descender\n lineGap\n avgCharWidth\n }\n}\n"
|
|
563
569
|
}
|
|
564
570
|
};
|
|
565
571
|
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<fdda61b158e716b142895d69f2c1fae9>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -10,6 +10,7 @@ export type useFontStyle_fontStyle$data = {
|
|
|
10
10
|
readonly name: string;
|
|
11
11
|
readonly verticalMetrics: {
|
|
12
12
|
readonly ascender: number;
|
|
13
|
+
readonly avgCharWidth: number | null;
|
|
13
14
|
readonly descender: number;
|
|
14
15
|
readonly lineGap: number | null;
|
|
15
16
|
readonly unitsPerEm: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated SignedSource<<
|
|
2
|
+
* @generated SignedSource<<fdda61b158e716b142895d69f2c1fae9>>
|
|
3
3
|
* @lightSyntaxTransform
|
|
4
4
|
* @nogrep
|
|
5
5
|
*/
|
|
@@ -83,11 +83,17 @@ const node = {
|
|
|
83
83
|
"kind": "ScalarField",
|
|
84
84
|
"name": "lineGap",
|
|
85
85
|
"storageKey": null
|
|
86
|
+
}, {
|
|
87
|
+
"alias": null,
|
|
88
|
+
"args": null,
|
|
89
|
+
"kind": "ScalarField",
|
|
90
|
+
"name": "avgCharWidth",
|
|
91
|
+
"storageKey": null
|
|
86
92
|
}],
|
|
87
93
|
"storageKey": null
|
|
88
94
|
}],
|
|
89
95
|
"type": "FontStyle",
|
|
90
96
|
"abstractKey": null
|
|
91
97
|
};
|
|
92
|
-
node.hash = "
|
|
98
|
+
node.hash = "171c546f40909692656c5e143a98d8a3";
|
|
93
99
|
export default node;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { fallbackDescriptors, metricFallbackFamily } from "../metricFallback.js";
|
|
3
|
+
describe('fallbackDescriptors', () => {
|
|
4
|
+
it('matches average width via size-adjust and divides overrides by it', () => {
|
|
5
|
+
// Browser-validated (see the metric-fallback render test): at 1000px this
|
|
6
|
+
// renders ascent 800, descent 200, advance 600 — the target's exact box.
|
|
7
|
+
const d = fallbackDescriptors({
|
|
8
|
+
unitsPerEm: 1000,
|
|
9
|
+
ascender: 800,
|
|
10
|
+
descender: -200,
|
|
11
|
+
lineGap: 0,
|
|
12
|
+
avgCharWidth: 600
|
|
13
|
+
});
|
|
14
|
+
// size-adjust = (600/1000) / 0.458
|
|
15
|
+
expect(d.sizeAdjust).toBe(`${0.6 / 0.458 * 100}%`);
|
|
16
|
+
// ascent-override = (800/1000) / sizeAdjust -> effective ascent = 0.8em
|
|
17
|
+
expect(d.ascentOverride).toBe(`${0.8 / (0.6 / 0.458) * 100}%`);
|
|
18
|
+
expect(d.descentOverride).toBe(`${0.2 / (0.6 / 0.458) * 100}%`);
|
|
19
|
+
expect(d.lineGapOverride).toBe('0%');
|
|
20
|
+
expect(d.display).toBe('block');
|
|
21
|
+
});
|
|
22
|
+
it('scales correctly for a non-1000 unitsPerEm', () => {
|
|
23
|
+
const d = fallbackDescriptors({
|
|
24
|
+
unitsPerEm: 2048,
|
|
25
|
+
ascender: 1536,
|
|
26
|
+
descender: -512,
|
|
27
|
+
lineGap: 0,
|
|
28
|
+
avgCharWidth: 820
|
|
29
|
+
});
|
|
30
|
+
const s = 820 / 2048 / 0.458;
|
|
31
|
+
expect(d.sizeAdjust).toBe(`${s * 100}%`);
|
|
32
|
+
expect(d.ascentOverride).toBe(`${1536 / 2048 / s * 100}%`);
|
|
33
|
+
expect(d.descentOverride).toBe(`${512 / 2048 / s * 100}%`);
|
|
34
|
+
});
|
|
35
|
+
it('omits size-adjust and uses raw ratios when avgCharWidth is missing', () => {
|
|
36
|
+
const d = fallbackDescriptors({
|
|
37
|
+
unitsPerEm: 1000,
|
|
38
|
+
ascender: 750,
|
|
39
|
+
descender: -250,
|
|
40
|
+
lineGap: 0,
|
|
41
|
+
avgCharWidth: null
|
|
42
|
+
});
|
|
43
|
+
expect(d.sizeAdjust).toBeUndefined();
|
|
44
|
+
expect(d.ascentOverride).toBe('75%');
|
|
45
|
+
expect(d.descentOverride).toBe('25%');
|
|
46
|
+
});
|
|
47
|
+
it('treats a zero/absent avgCharWidth like no width match', () => {
|
|
48
|
+
const d = fallbackDescriptors({
|
|
49
|
+
unitsPerEm: 1000,
|
|
50
|
+
ascender: 900,
|
|
51
|
+
descender: -100,
|
|
52
|
+
lineGap: 200,
|
|
53
|
+
avgCharWidth: 0
|
|
54
|
+
});
|
|
55
|
+
expect(d.sizeAdjust).toBeUndefined();
|
|
56
|
+
expect(d.lineGapOverride).toBe('20%');
|
|
57
|
+
});
|
|
58
|
+
it('returns null for unusable metrics', () => {
|
|
59
|
+
expect(fallbackDescriptors(null)).toBeNull();
|
|
60
|
+
expect(fallbackDescriptors(undefined)).toBeNull();
|
|
61
|
+
expect(fallbackDescriptors({
|
|
62
|
+
unitsPerEm: 0,
|
|
63
|
+
ascender: 800,
|
|
64
|
+
descender: -200,
|
|
65
|
+
lineGap: 0,
|
|
66
|
+
avgCharWidth: 500
|
|
67
|
+
})).toBeNull();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
describe('metricFallbackFamily', () => {
|
|
71
|
+
it('derives a per-family name', () => {
|
|
72
|
+
expect(metricFallbackFamily('Archivo Bold')).toBe('Archivo Bold fallback');
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -174,11 +174,8 @@ describe('configureFontdueRender', () => {
|
|
|
174
174
|
const {
|
|
175
175
|
configureFontdueRender
|
|
176
176
|
} = await importTenant();
|
|
177
|
-
|
|
178
|
-
getFontdueSlotConfig
|
|
179
|
-
} = await import("../relay/serverConfig.js");
|
|
177
|
+
// Invalid domain returns null before any setFontdueServerConfig call.
|
|
180
178
|
expect(configureFontdueRender('not a domain')).toBeNull();
|
|
181
|
-
expect(getFontdueSlotConfig()).toBeUndefined();
|
|
182
179
|
});
|
|
183
180
|
it('sets the per-render server config and returns the endpoint', async () => {
|
|
184
181
|
stubMultiTenant({
|
|
@@ -202,8 +199,7 @@ describe('configureFontdueRender', () => {
|
|
|
202
199
|
'x-forwarded-host': 'acme.fontdue.com',
|
|
203
200
|
'x-fontdue-proxy-secret': 's3cret'
|
|
204
201
|
},
|
|
205
|
-
cacheTags: ['graphql:acme.fontdue.com']
|
|
206
|
-
domain: 'acme.fontdue.com'
|
|
202
|
+
cacheTags: ['graphql:acme.fontdue.com']
|
|
207
203
|
});
|
|
208
204
|
});
|
|
209
205
|
});
|
|
@@ -283,62 +279,11 @@ describe('__prepareFontdueRender', () => {
|
|
|
283
279
|
expect(config.cacheTags).toBeUndefined();
|
|
284
280
|
});
|
|
285
281
|
});
|
|
286
|
-
describe('configureFontduePreview (single-tenant)', () => {
|
|
287
|
-
async function captureConfig() {
|
|
288
|
-
let captured;
|
|
289
|
-
vi.doMock('../relay/serverConfig', async importActual => ({
|
|
290
|
-
...(await importActual()),
|
|
291
|
-
setFontdueServerConfig: c => {
|
|
292
|
-
captured = c;
|
|
293
|
-
}
|
|
294
|
-
}));
|
|
295
|
-
const {
|
|
296
|
-
configureFontduePreview
|
|
297
|
-
} = await importTenant();
|
|
298
|
-
const endpoint = await configureFontduePreview();
|
|
299
|
-
vi.doUnmock('../relay/serverConfig');
|
|
300
|
-
return {
|
|
301
|
-
captured,
|
|
302
|
-
endpoint
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
it('public render: configures the NEXT_PUBLIC_FONTDUE_URL site with cache tags', async () => {
|
|
306
|
-
var _captured$headers;
|
|
307
|
-
stubSingleTenant('https://acme.fontdue.com');
|
|
308
|
-
const {
|
|
309
|
-
captured,
|
|
310
|
-
endpoint
|
|
311
|
-
} = await captureConfig();
|
|
312
|
-
expect(endpoint.origin).toBe('https://acme.fontdue.com');
|
|
313
|
-
expect(captured.url).toBe('https://acme.fontdue.com');
|
|
314
|
-
expect(captured.cacheTags).toEqual(['graphql:acme.fontdue.com']);
|
|
315
|
-
expect((_captured$headers = captured.headers) === null || _captured$headers === void 0 ? void 0 : _captured$headers.authorization).toBeUndefined();
|
|
316
|
-
});
|
|
317
|
-
it('preview render: forwards the token and drops cache tags', async () => {
|
|
318
|
-
var _captured$headers2;
|
|
319
|
-
stubSingleTenant('https://acme.fontdue.com');
|
|
320
|
-
draft.enabled = true;
|
|
321
|
-
draft.token = 'admin-tok';
|
|
322
|
-
const {
|
|
323
|
-
captured
|
|
324
|
-
} = await captureConfig();
|
|
325
|
-
expect((_captured$headers2 = captured.headers) === null || _captured$headers2 === void 0 ? void 0 : _captured$headers2.authorization).toBe('Bearer admin-tok');
|
|
326
|
-
expect(captured.cacheTags).toBeUndefined();
|
|
327
|
-
});
|
|
328
|
-
it('throws a helpful error when NEXT_PUBLIC_FONTDUE_URL is unset', async () => {
|
|
329
|
-
stubMultiTenant();
|
|
330
|
-
const {
|
|
331
|
-
configureFontduePreview
|
|
332
|
-
} = await importTenant();
|
|
333
|
-
await expect(configureFontduePreview()).rejects.toThrow(/NEXT_PUBLIC_FONTDUE_URL/);
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
282
|
describe('single-tenant ambient resolver (no per-render call)', () => {
|
|
337
283
|
// Importing registerSingleTenantResolver registers the resolver as a module
|
|
338
284
|
// side effect — the FontdueProvider RSC entrypoint does this import, so
|
|
339
|
-
// merely mounting the provider wires it up. No
|
|
340
|
-
//
|
|
341
|
-
// these tests; the config is pulled at fetch time.
|
|
285
|
+
// merely mounting the provider wires it up. No per-render setup call is made
|
|
286
|
+
// in any of these tests; the config is pulled at fetch time.
|
|
342
287
|
it('public render: feeds the env URL + cache tags, no token', async () => {
|
|
343
288
|
var _config$headers3;
|
|
344
289
|
stubSingleTenant('https://acme.fontdue.com');
|
|
@@ -415,45 +360,6 @@ describe('single-tenant ambient resolver (no per-render call)', () => {
|
|
|
415
360
|
expect(config === null || config === void 0 ? void 0 : (_config$headers5 = config.headers) === null || _config$headers5 === void 0 ? void 0 : _config$headers5.authorization).toBeUndefined();
|
|
416
361
|
});
|
|
417
362
|
});
|
|
418
|
-
describe('fontdueEndpoint', () => {
|
|
419
|
-
it('multi-tenant: throws when no render config was set', async () => {
|
|
420
|
-
stubMultiTenant({
|
|
421
|
-
origin: 'http://app:4000'
|
|
422
|
-
});
|
|
423
|
-
const {
|
|
424
|
-
fontdueEndpoint
|
|
425
|
-
} = await importTenant();
|
|
426
|
-
expect(() => fontdueEndpoint()).toThrow(/__prepareFontdueRender/);
|
|
427
|
-
});
|
|
428
|
-
it('single-tenant: derives the endpoint from NEXT_PUBLIC_FONTDUE_URL', async () => {
|
|
429
|
-
stubSingleTenant('https://acme.fontdue.com');
|
|
430
|
-
const {
|
|
431
|
-
fontdueEndpoint
|
|
432
|
-
} = await importTenant();
|
|
433
|
-
expect(fontdueEndpoint()).toEqual({
|
|
434
|
-
domain: 'acme.fontdue.com',
|
|
435
|
-
origin: 'https://acme.fontdue.com',
|
|
436
|
-
headers: {},
|
|
437
|
-
tags: ['graphql', 'graphql:acme.fontdue.com']
|
|
438
|
-
});
|
|
439
|
-
});
|
|
440
|
-
it('uses the render-configured domain when set', async () => {
|
|
441
|
-
stubMultiTenant({
|
|
442
|
-
origin: 'http://app:4000'
|
|
443
|
-
});
|
|
444
|
-
vi.doMock('../relay/serverConfig', async importActual => ({
|
|
445
|
-
...(await importActual()),
|
|
446
|
-
getFontdueSlotConfig: () => ({
|
|
447
|
-
domain: 'acme.fontdue.com'
|
|
448
|
-
})
|
|
449
|
-
}));
|
|
450
|
-
const {
|
|
451
|
-
fontdueEndpoint
|
|
452
|
-
} = await importTenant();
|
|
453
|
-
expect(fontdueEndpoint().headers['x-forwarded-host']).toBe('acme.fontdue.com');
|
|
454
|
-
vi.doUnmock('../relay/serverConfig');
|
|
455
|
-
});
|
|
456
|
-
});
|
|
457
363
|
|
|
458
364
|
// withFontdue detects the route-tree shape from the working directory; give
|
|
459
365
|
// it one with or without src/app/[domain].
|
|
@@ -6,7 +6,7 @@ import _CharacterViewerIDQuery from "../../__generated__/CharacterViewerIDQuery.
|
|
|
6
6
|
import _CharacterViewer_style from "../../__generated__/CharacterViewer_style.graphql.js";
|
|
7
7
|
import _CharacterViewer_collection from "../../__generated__/CharacterViewer_collection.graphql.js";
|
|
8
8
|
import _CharacterViewer_family from "../../__generated__/CharacterViewer_family.graphql.js";
|
|
9
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
10
|
import { fetchQuery, graphql, useFragment, useLazyLoadQuery, usePreloadedQuery, useRefetchableFragment, useRelayEnvironment } from 'react-relay';
|
|
11
11
|
import useResizeObserver from '../../hooks/useResizeObserver.js';
|
|
12
12
|
import retryImport from '../../retryImport.js';
|
|
@@ -20,6 +20,8 @@ import StyleSelect from './StyleSelect.js';
|
|
|
20
20
|
import Checkbox from '../Checkbox/index.js';
|
|
21
21
|
import CharacterViewerStyleRefetchQueryNode from '../../__generated__/CharacterViewerStyleRefetchQuery.graphql.js';
|
|
22
22
|
import { EnsureFontdueContext } from '../FontdueContextProvider/index.js';
|
|
23
|
+
import ConfigContext from '../ConfigContext.js';
|
|
24
|
+
import { unicodeNamesUrl } from '../../data/unicodeNamesUrl.js';
|
|
23
25
|
function useSize() {
|
|
24
26
|
const ref = useRef(null);
|
|
25
27
|
const [size, setSize] = React.useState();
|
|
@@ -74,20 +76,27 @@ function GlyphMeta(_ref) {
|
|
|
74
76
|
onChange: e => setFeaturesChecked(e.target.checked)
|
|
75
77
|
}), glyph.features.join(', ')))));
|
|
76
78
|
}
|
|
79
|
+
|
|
80
|
+
// Glyph unicode names (~1.2 MB) are fetched lazily from the Fontdue CDN rather
|
|
81
|
+
// than bundled — see data/unicodeNamesUrl.ts. Purely cosmetic (the “Unicode
|
|
82
|
+
// name” label), so a failed fetch degrades silently. `retryImport` is reused
|
|
83
|
+
// here as a generic retry wrapper for transient network blips.
|
|
77
84
|
function useUnicodeData() {
|
|
85
|
+
const config = useContext(ConfigContext);
|
|
86
|
+
const url = unicodeNamesUrl(config.cdnUrl);
|
|
78
87
|
const [data, setData] = useState();
|
|
79
88
|
useEffect(() => {
|
|
80
|
-
function fetchData() {
|
|
81
|
-
retryImport(() => import('../../data/unicodeData.js')).then(data => {
|
|
82
|
-
if (!ignore) setData(data.default);
|
|
83
|
-
}).catch(() => {});
|
|
84
|
-
}
|
|
85
89
|
let ignore = false;
|
|
86
|
-
|
|
90
|
+
retryImport(() => fetch(url).then(res => {
|
|
91
|
+
if (!res.ok) throw new Error(`unicode names request failed: ${res.status}`);
|
|
92
|
+
return res.json();
|
|
93
|
+
})).then(json => {
|
|
94
|
+
if (!ignore) setData(json);
|
|
95
|
+
}).catch(() => {});
|
|
87
96
|
return () => {
|
|
88
97
|
ignore = true;
|
|
89
98
|
};
|
|
90
|
-
}, []);
|
|
99
|
+
}, [url]);
|
|
91
100
|
return data;
|
|
92
101
|
}
|
|
93
102
|
function compareGlyphs(a, b) {
|
|
@@ -35,6 +35,7 @@ export interface Config {
|
|
|
35
35
|
tracking?: TrackingConfig;
|
|
36
36
|
preview?: PreviewConfig;
|
|
37
37
|
corsErrorModal?: boolean;
|
|
38
|
+
cdnUrl?: string;
|
|
38
39
|
}
|
|
39
40
|
export declare const mergeConfig: (base?: Config, override?: Config) => Config;
|
|
40
41
|
export declare const makeConfig: (config?: Config) => {
|
|
@@ -112,6 +113,7 @@ export declare const makeConfig: (config?: Config) => {
|
|
|
112
113
|
revalidateEndpoint: string | undefined;
|
|
113
114
|
};
|
|
114
115
|
corsErrorModal: boolean;
|
|
116
|
+
cdnUrl: string;
|
|
115
117
|
};
|
|
116
118
|
declare const _default: React.Context<{
|
|
117
119
|
typeTester: {
|
|
@@ -188,5 +190,6 @@ declare const _default: React.Context<{
|
|
|
188
190
|
revalidateEndpoint: string | undefined;
|
|
189
191
|
};
|
|
190
192
|
corsErrorModal: boolean;
|
|
193
|
+
cdnUrl: string;
|
|
191
194
|
}>;
|
|
192
195
|
export default _default;
|