fontdue-js 3.14.0 → 3.15.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 (226) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
  3. package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +3 -3
  4. package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
  5. package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +3 -3
  6. package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +1 -1
  7. package/dist/__generated__/CartOrderUpdateMutation.graphql.js +3 -3
  8. package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
  9. package/dist/__generated__/CartQuery.graphql.js +3 -3
  10. package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +5 -1
  11. package/dist/__generated__/CartStateUpdateMutation.graphql.js +132 -117
  12. package/dist/__generated__/CartState_order.graphql.d.ts +4 -1
  13. package/dist/__generated__/CartState_order.graphql.js +11 -2
  14. package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
  15. package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +3 -3
  16. package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +1 -1
  17. package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +3 -3
  18. package/dist/__generated__/FamilyList_node.graphql.d.ts +3 -1
  19. package/dist/__generated__/FamilyList_node.graphql.js +8 -2
  20. package/dist/__generated__/FontFamiliesQuery.graphql.d.ts +1 -1
  21. package/dist/__generated__/FontFamiliesQuery.graphql.js +5 -5
  22. package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +1 -1
  23. package/dist/__generated__/PrecartAddToCartMutation.graphql.js +3 -3
  24. package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +1 -1
  25. package/dist/__generated__/StoreModalCartQuery.graphql.js +69 -69
  26. package/dist/__generated__/StoreModalFamily_collection.graphql.d.ts +2 -1
  27. package/dist/__generated__/StoreModalFamily_collection.graphql.js +16 -15
  28. package/dist/__generated__/StoreModalIndexItem_fontCollection.graphql.d.ts +19 -1
  29. package/dist/__generated__/StoreModalIndexItem_fontCollection.graphql.js +39 -4
  30. package/dist/__generated__/StoreModalIndexPaginationQuery.graphql.d.ts +1 -1
  31. package/dist/__generated__/StoreModalIndexPaginationQuery.graphql.js +40 -5
  32. package/dist/__generated__/StoreModalIndexQuery.graphql.d.ts +1 -1
  33. package/dist/__generated__/StoreModalIndexQuery.graphql.js +40 -5
  34. package/dist/__generated__/StoreModalProductContent_collection.graphql.d.ts +19 -1
  35. package/dist/__generated__/StoreModalProductContent_collection.graphql.js +46 -11
  36. package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
  37. package/dist/__generated__/StoreModalProductQuery.graphql.js +198 -167
  38. package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +1 -1
  39. package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +171 -140
  40. package/dist/__generated__/StoreModalProductSlugQuery.graphql.d.ts +1 -1
  41. package/dist/__generated__/StoreModalProductSlugQuery.graphql.js +201 -170
  42. package/dist/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.d.ts +5 -2
  43. package/dist/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.js +41 -22
  44. package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
  45. package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +3 -3
  46. package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.d.ts +1 -1
  47. package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +9 -3
  48. package/dist/__generated__/TypeTesterStandaloneQuery.graphql.d.ts +1 -1
  49. package/dist/__generated__/TypeTesterStandaloneQuery.graphql.js +9 -3
  50. package/dist/__generated__/TypeTester_fontStyle.graphql.d.ts +3 -1
  51. package/dist/__generated__/TypeTester_fontStyle.graphql.js +8 -2
  52. package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.d.ts +1 -1
  53. package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.js +9 -3
  54. package/dist/__generated__/TypeTestersIDQuery.graphql.d.ts +1 -1
  55. package/dist/__generated__/TypeTestersIDQuery.graphql.js +39 -39
  56. package/dist/__generated__/TypeTestersRefetchQuery.graphql.d.ts +1 -1
  57. package/dist/__generated__/TypeTestersRefetchQuery.graphql.js +37 -37
  58. package/dist/__generated__/TypeTestersSlugQuery.graphql.d.ts +1 -1
  59. package/dist/__generated__/TypeTestersSlugQuery.graphql.js +39 -39
  60. package/dist/__tests__/cartDiscountRemoved.test.js +195 -0
  61. package/dist/__tests__/characterViewerCollapse.test.js +199 -0
  62. package/dist/__tests__/characterViewerStyleSelect.test.js +52 -0
  63. package/dist/__tests__/checkoutReturn.test.js +66 -0
  64. package/dist/__tests__/familyStyleCounts.test.js +71 -0
  65. package/dist/__tests__/i18n.test.js +171 -0
  66. package/dist/__tests__/i18nComponents.test.js +408 -0
  67. package/dist/__tests__/localeEnvironments.test.js +275 -0
  68. package/dist/__tests__/localeMiddleware.test.js +68 -0
  69. package/dist/__tests__/localeTransport.test.js +209 -0
  70. package/dist/__tests__/recaptchaLocale.test.js +62 -0
  71. package/dist/__tests__/serverEntryLocale.test.js +124 -0
  72. package/dist/__tests__/storeModalIndexUnlisted.test.js +69 -11
  73. package/dist/__tests__/useSerializablePreloadedQuery.test.js +4 -3
  74. package/dist/components/AddToCartBanner/index.js +8 -2
  75. package/dist/components/BuyButton/index.d.ts +1 -0
  76. package/dist/components/BuyButton/index.js +8 -2
  77. package/dist/components/BuyButton/index.server.d.ts +1 -0
  78. package/dist/components/BuyButton/index.server.js +8 -0
  79. package/dist/components/BuyingOptions/index.js +3 -1
  80. package/dist/components/Cart/AddressFields.js +5 -3
  81. package/dist/components/Cart/CartCouponNotice.d.ts +7 -0
  82. package/dist/components/Cart/CartCouponNotice.js +21 -0
  83. package/dist/components/Cart/CartItem/CartItemAdditionalLicenses.js +3 -1
  84. package/dist/components/Cart/CartItem/CartItemLicense.js +3 -1
  85. package/dist/components/Cart/CartItem/CartItemProduct.js +6 -3
  86. package/dist/components/Cart/CartItem/VariableTextInput.js +7 -3
  87. package/dist/components/Cart/CartItem/index.js +5 -1
  88. package/dist/components/Cart/CartOrder.js +27 -17
  89. package/dist/components/Cart/CartState.d.ts +1 -0
  90. package/dist/components/Cart/CartState.js +18 -3
  91. package/dist/components/Cart/CartTotals.js +17 -9
  92. package/dist/components/Cart/Checkout.js +18 -15
  93. package/dist/components/Cart/CouponCodeInput.js +5 -3
  94. package/dist/components/Cart/CustomerFields.js +6 -4
  95. package/dist/components/Cart/EmptyCart.js +4 -2
  96. package/dist/components/Cart/IdentityBox.js +6 -2
  97. package/dist/components/Cart/ShareCart.js +8 -6
  98. package/dist/components/Cart/checkoutReturn.d.ts +17 -0
  99. package/dist/components/Cart/checkoutReturn.js +38 -0
  100. package/dist/components/CartButton/index.d.ts +2 -1
  101. package/dist/components/CartButton/index.js +6 -2
  102. package/dist/components/CharacterViewer/StyleSelect.js +6 -2
  103. package/dist/components/CharacterViewer/collapse.d.ts +10 -0
  104. package/dist/components/CharacterViewer/collapse.js +39 -0
  105. package/dist/components/CharacterViewer/index.d.ts +4 -0
  106. package/dist/components/CharacterViewer/index.js +78 -24
  107. package/dist/components/CharacterViewer/index.server.d.ts +1 -0
  108. package/dist/components/CharacterViewer/index.server.js +4 -0
  109. package/dist/components/ConfigContext.d.ts +14 -10
  110. package/dist/components/ConfigContext.js +12 -7
  111. package/dist/components/ConsentBanner/index.js +6 -5
  112. package/dist/components/CookieNotification/index.js +11 -5
  113. package/dist/components/CouponText/index.js +15 -7
  114. package/dist/components/CustomerLoginForm/index.js +14 -9
  115. package/dist/components/CustomerSignIn/CustomerSignInElement.d.ts +1 -1
  116. package/dist/components/CustomerSignIn/CustomerSignInElement.js +8 -2
  117. package/dist/components/CustomerSignIn/index.d.ts +6 -1
  118. package/dist/components/CustomerSignIn/index.js +27 -15
  119. package/dist/components/Family/FamilyList.js +5 -2
  120. package/dist/components/Family/index.js +21 -12
  121. package/dist/components/FeatureTester/FeatureTesters.d.ts +2 -1
  122. package/dist/components/FeatureTester/FeatureTesters.js +4 -1
  123. package/dist/components/FeatureTester/FeatureTesters.server.js +4 -0
  124. package/dist/components/FeatureTester/index.d.ts +1 -0
  125. package/dist/components/FeatureTester/index.js +3 -1
  126. package/dist/components/FeatureTester/index.server.js +2 -0
  127. package/dist/components/FontdueContextProvider/index.d.ts +12 -2
  128. package/dist/components/FontdueContextProvider/index.js +85 -11
  129. package/dist/components/FontdueProvider/index.js +7 -1
  130. package/dist/components/FontdueProvider/index.server.js +21 -3
  131. package/dist/components/LocaleContext.d.ts +9 -0
  132. package/dist/components/LocaleContext.js +20 -0
  133. package/dist/components/NewsletterSignup/index.d.ts +2 -1
  134. package/dist/components/NewsletterSignup/index.js +20 -11
  135. package/dist/components/NewsletterSignup/index.server.d.ts +1 -0
  136. package/dist/components/NewsletterSignup/index.server.js +3 -1
  137. package/dist/components/NodePasswordForm/index.d.ts +6 -1
  138. package/dist/components/NodePasswordForm/index.js +14 -6
  139. package/dist/components/OrderVariableSelection/index.js +7 -5
  140. package/dist/components/Precart/License.js +4 -2
  141. package/dist/components/Precart/index.js +15 -12
  142. package/dist/components/Price/index.d.ts +1 -0
  143. package/dist/components/Price/index.js +15 -5
  144. package/dist/components/Root/index.js +2 -1
  145. package/dist/components/Select/index.d.ts +1 -1
  146. package/dist/components/Select/index.js +4 -1
  147. package/dist/components/SelectButton/index.js +3 -1
  148. package/dist/components/SpecimenLink/index.js +3 -1
  149. package/dist/components/StoreModal/StoreModalCart.js +6 -0
  150. package/dist/components/StoreModal/StoreModalContainer.js +14 -12
  151. package/dist/components/StoreModal/StoreModalDownload.js +3 -1
  152. package/dist/components/StoreModal/StoreModalFamily.js +16 -7
  153. package/dist/components/StoreModal/StoreModalFamilyButton.js +14 -9
  154. package/dist/components/StoreModal/StoreModalIndexItem.js +21 -10
  155. package/dist/components/StoreModal/StoreModalIndexPackItem.js +8 -3
  156. package/dist/components/StoreModal/StoreModalPackButton.js +5 -2
  157. package/dist/components/StoreModal/StoreModalProduct.js +14 -5
  158. package/dist/components/StoreModal/index.d.ts +1 -0
  159. package/dist/components/StoreModal/index.js +4 -2
  160. package/dist/components/StoreModal/offered.d.ts +31 -0
  161. package/dist/components/StoreModal/offered.js +21 -0
  162. package/dist/components/StoreModal/types.d.ts +9 -0
  163. package/dist/components/StoreModalProductLicenseSelection/LicenseVariableElement.js +3 -1
  164. package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +5 -1
  165. package/dist/components/StoreModalProductSummary/index.js +37 -23
  166. package/dist/components/StripeProvider/index.js +18 -5
  167. package/dist/components/TestFontsForm/index.d.ts +2 -1
  168. package/dist/components/TestFontsForm/index.js +28 -16
  169. package/dist/components/TestFontsForm/index.server.d.ts +1 -0
  170. package/dist/components/TestFontsForm/index.server.js +3 -1
  171. package/dist/components/TestModeBanner/index.js +3 -1
  172. package/dist/components/TypeTester/TypeTesterEditAll.js +3 -1
  173. package/dist/components/TypeTester/TypeTesterFeaturesButton.js +4 -2
  174. package/dist/components/TypeTester/TypeTesterStandalone.d.ts +1 -0
  175. package/dist/components/TypeTester/TypeTesterStandalone.js +6 -2
  176. package/dist/components/TypeTester/TypeTesterStandalone.server.js +2 -0
  177. package/dist/components/TypeTester/TypeTesterStyleSelect.js +5 -3
  178. package/dist/components/TypeTester/TypeTesterStyleSelectData.js +3 -1
  179. package/dist/components/TypeTester/TypeTesterToolbar.js +12 -6
  180. package/dist/components/TypeTester/index.js +7 -2
  181. package/dist/components/TypeTesters/index.d.ts +2 -1
  182. package/dist/components/TypeTesters/index.js +3 -1
  183. package/dist/components/TypeTesters/index.server.d.ts +1 -0
  184. package/dist/components/TypeTesters/index.server.js +4 -0
  185. package/dist/components/elements/EmptyCart/index.js +4 -2
  186. package/dist/components/elements/StoreModalCartLayout/index.d.ts +1 -0
  187. package/dist/components/elements/StoreModalCartLayout/index.js +2 -1
  188. package/dist/components/elements/StoreModalContainer/index.js +4 -2
  189. package/dist/components/elements/StoreModalDownloadLayout/index.js +3 -1
  190. package/dist/components/elements/StoreModalIndexItem/index.js +3 -1
  191. package/dist/components/elements/StoreModalIndexLoadMore/index.js +3 -1
  192. package/dist/components/elements/StoreModalLicenseeIsBillingIdentityElement.js +4 -2
  193. package/dist/components/elements/StoreModalLoadingScreen/index.js +7 -3
  194. package/dist/components/elements/StoreModalUnifiedCheckout.js +44 -27
  195. package/dist/fontdue.css +58 -0
  196. package/dist/hooks/useRecaptchaTimeout.d.ts +1 -1
  197. package/dist/hooks/useRecaptchaTimeout.js +4 -2
  198. package/dist/i18n/de.d.ts +3 -0
  199. package/dist/i18n/de.js +279 -0
  200. package/dist/i18n/en.d.ts +212 -0
  201. package/dist/i18n/en.js +261 -0
  202. package/dist/i18n/index.d.ts +42 -0
  203. package/dist/i18n/index.js +115 -0
  204. package/dist/i18n/types.d.ts +28 -0
  205. package/dist/i18n/types.js +1 -0
  206. package/dist/i18n/useT.d.ts +15 -0
  207. package/dist/i18n/useT.js +21 -0
  208. package/dist/locale.d.ts +20 -0
  209. package/dist/locale.js +52 -0
  210. package/dist/next/tenant.d.ts +3 -1
  211. package/dist/next/tenant.js +11 -2
  212. package/dist/relay/environment.d.ts +8 -2
  213. package/dist/relay/environment.js +65 -15
  214. package/dist/relay/loadSerializableQuery.d.ts +17 -0
  215. package/dist/relay/loadSerializableQuery.js +14 -2
  216. package/dist/relay/serverConfig.d.ts +9 -0
  217. package/dist/relay/serverConfig.js +16 -0
  218. package/dist/relay/useSerializablePreloadedQuery.js +27 -6
  219. package/dist/server/index.d.ts +11 -0
  220. package/dist/server/index.js +7 -0
  221. package/dist/server/middleware.d.ts +19 -1
  222. package/dist/server/middleware.js +56 -13
  223. package/dist/utils.d.ts +0 -1
  224. package/dist/utils.js +0 -5
  225. package/dist/version.js +1 -1
  226. package/package.json +1 -1
@@ -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, useContext, useEffect, useMemo, useRef, useState } from 'react';
9
+ import React, { useCallback, useContext, useEffect, useId, 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';
@@ -24,6 +24,8 @@ import { EnsureFontdueContext, LazyQueryBoundary } from '../FontdueContextProvid
24
24
  import ConfigContext from '../ConfigContext.js';
25
25
  import { unicodeNamesUrl } from '../../data/unicodeNamesUrl.js';
26
26
  import { compareGlyphs, flattenCharacterList } from './glyphMatch.js';
27
+ import { useT } from '../../i18n/useT.js';
28
+ import { parseCollapse } from './collapse.js';
27
29
  function useSize() {
28
30
  const ref = useRef(null);
29
31
  const [size, setSize] = React.useState();
@@ -70,11 +72,14 @@ function GlyphMeta(_ref) {
70
72
  getUnicodeName,
71
73
  featureNames
72
74
  } = _ref;
75
+ const t = useT();
73
76
  if (!glyph) return null;
74
77
  const unicodeName = getUnicodeName(glyph);
75
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "Glyph name"), /*#__PURE__*/React.createElement("span", null, getGlyphName(glyph)), unicodeName && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "Unicode name"), /*#__PURE__*/React.createElement("span", {
78
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, t('characterViewer.glyphName')), /*#__PURE__*/React.createElement("span", null, getGlyphName(glyph)), unicodeName && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, t('characterViewer.unicodeName')), /*#__PURE__*/React.createElement("span", {
76
79
  title: unicodeName
77
- }, unicodeName)), /*#__PURE__*/React.createElement("span", null, "Unicode decimal"), /*#__PURE__*/React.createElement("span", null, glyph.string.split('').map(str => str.charCodeAt(0).toString(10)).join(', ')), /*#__PURE__*/React.createElement("span", null, "Unicode hex"), /*#__PURE__*/React.createElement("span", null, glyph.string.split('').map(str => str.charCodeAt(0).toString(16).padStart(4, '0')).join(', ')), glyph.features && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "OpenType feature", glyph.features.length > 1 ? 's' : ''), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement(Checkbox, {
80
+ }, unicodeName)), /*#__PURE__*/React.createElement("span", null, t('characterViewer.unicodeDecimal')), /*#__PURE__*/React.createElement("span", null, glyph.string.split('').map(str => str.charCodeAt(0).toString(10)).join(', ')), /*#__PURE__*/React.createElement("span", null, t('characterViewer.unicodeHex')), /*#__PURE__*/React.createElement("span", null, glyph.string.split('').map(str => str.charCodeAt(0).toString(16).padStart(4, '0')).join(', ')), glyph.features && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, t('characterViewer.openTypeFeatures', {
81
+ count: Math.max(1, glyph.features.length)
82
+ })), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement(Checkbox, {
78
83
  checked: featuresChecked,
79
84
  onChange: e => setFeaturesChecked(e.target.checked)
80
85
  }), glyph.features.map(feature => featureNames[feature] ? `${featureNames[feature]} (${feature})` : feature).join(', ')))));
@@ -128,8 +133,11 @@ function hasUnsupportedPositionalFeatures(features) {
128
133
  }
129
134
  function CharacterViewerComponent(_ref2) {
130
135
  let {
131
- collection: collectionKey
136
+ collection: collectionKey,
137
+ collapse,
138
+ loadMoreLabel
132
139
  } = _ref2;
140
+ const t = useT();
133
141
  const collection = useFragment((_CharacterViewer_collection.hash && _CharacterViewer_collection.hash !== "c2116c3c2c795e5306c3a2a0ecd60137" && console.error("The definition of 'CharacterViewer_collection' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewer_collection), collectionKey);
134
142
  const [fontStyle, refetchFontStyle] = useRefetchableFragment((_CharacterViewer_style.hash && _CharacterViewer_style.hash !== "087471e544e0a6ed17f1b17cd0570e28" && console.error("The definition of 'CharacterViewer_style' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewer_style), collection.featureStyle);
135
143
  let families = [];
@@ -165,7 +173,7 @@ function CharacterViewerComponent(_ref2) {
165
173
  let {
166
174
  style
167
175
  } = useFontStyle({
168
- fontStyle: fontStyle
176
+ fontStyle
169
177
  });
170
178
  const {
171
179
  featureNames
@@ -231,6 +239,22 @@ function CharacterViewerComponent(_ref2) {
231
239
  useResizeObserver(blocksRef, measureCell, {
232
240
  polyfill: typeof window === 'undefined' ? ServerSideResizeObserverPolyfill : null
233
241
  });
242
+ const blocksId = useId();
243
+ const collapseMode = parseCollapse(collapse);
244
+ const [expanded, setExpanded] = useState(false);
245
+ const collapsed = collapseMode.kind !== 'none' && !expanded;
246
+
247
+ // A height-collapsed grid only needs its button (and fade) when the glyphs
248
+ // actually run past the cut. Assume they do until measured, so the server
249
+ // render and the first paint match; the ResizeObserver above doesn't help
250
+ // here because a clipped element keeps its size as its content grows.
251
+ const [overflowing, setOverflowing] = useState(true);
252
+ useEffect(() => {
253
+ const blocks = blocksRef.current;
254
+ if (!blocks || collapseMode.kind !== 'height' || !collapsed) return;
255
+ const next = blocks.scrollHeight > blocks.clientHeight + 1;
256
+ if (next !== overflowing) setOverflowing(next);
257
+ });
234
258
  if (!fontStyle) return null;
235
259
  const {
236
260
  ascender,
@@ -250,27 +274,27 @@ function CharacterViewerComponent(_ref2) {
250
274
  const lines = [{
251
275
  name: 'baseline',
252
276
  position: pos(0),
253
- label: 'Baseline',
277
+ label: t('characterViewer.baseline'),
254
278
  value: 0
255
279
  }, capHeight != null && {
256
280
  name: 'cap-height',
257
281
  position: pos(capHeight),
258
- label: 'Cap height',
282
+ label: t('characterViewer.capHeight'),
259
283
  value: capHeight
260
284
  }, xHeight != null && {
261
285
  name: 'x-height',
262
286
  position: pos(xHeight),
263
- label: 'x-Height',
287
+ label: t('characterViewer.xHeight'),
264
288
  value: xHeight
265
289
  }, {
266
290
  name: 'ascender',
267
291
  position: pos(ascender),
268
- label: 'Ascender',
292
+ label: t('characterViewer.ascender'),
269
293
  value: ascender
270
294
  }, {
271
295
  name: 'descender',
272
296
  position: pos(descender),
273
- label: 'Descender',
297
+ label: t('characterViewer.descender'),
274
298
  value: descender
275
299
  }].filter(line => Boolean(line)).reduce((visible, line) =>
276
300
  // Skip this line if it's within the threshold of any already-accepted
@@ -278,6 +302,7 @@ function CharacterViewerComponent(_ref2) {
278
302
  threshold > 0 && visible.some(v => Math.abs(v.position - line.position) < threshold) ? visible : [...visible, line], []);
279
303
  const groups = useMemo(() => {
280
304
  var _collection$glyphGrou;
305
+ if (!fontStyle) return [];
281
306
  return (_collection$glyphGrou = collection.glyphGroups) === null || _collection$glyphGrou === void 0 ? void 0 : _collection$glyphGrou.map(_ref4 => {
282
307
  var _characterSets$filter;
283
308
  let {
@@ -301,6 +326,18 @@ function CharacterViewerComponent(_ref2) {
301
326
  // Filter out groups that have no character sets left after filtering
302
327
  .filter(group => group.characterSets && group.characterSets.length > 0);
303
328
  }, [collection, fontStyle]);
329
+
330
+ // `collection.featureStyle` is null when the collection has no style to
331
+ // fall back to – a superfamily whose families are all hidden. Everything
332
+ // below reads the style, so there is nothing to draw.
333
+ if (!fontStyle) return null;
334
+
335
+ // First-group mode renders only the first group until expanded, rather than
336
+ // clipping to its measured height: no measurement to wait for on the server
337
+ // render, and the hidden groups' cells (each with its own ResizeObserver)
338
+ // aren't built until someone asks for them.
339
+ const visibleGroups = collapsed && collapseMode.kind === 'first-group' ? groups === null || groups === void 0 ? void 0 : groups.slice(0, 1) : groups;
340
+ const showLoadMore = collapsed && (collapseMode.kind === 'first-group' ? ((groups === null || groups === void 0 ? void 0 : groups.length) ?? 0) > 1 : overflowing);
304
341
  return /*#__PURE__*/React.createElement("div", {
305
342
  className: "character-viewer",
306
343
  style: {
@@ -313,7 +350,8 @@ function CharacterViewerComponent(_ref2) {
313
350
  '--monitor-width': monitorWidth
314
351
  }
315
352
  }, /*#__PURE__*/React.createElement("div", {
316
- className: "character-viewer__character-map"
353
+ className: "character-viewer__character-map",
354
+ "data-collapsible": showLoadMore || undefined
317
355
  }, /*#__PURE__*/React.createElement("div", {
318
356
  className: "character-viewer__monitor"
319
357
  }, visibleGlyph && /*#__PURE__*/React.createElement("div", {
@@ -337,7 +375,7 @@ function CharacterViewerComponent(_ref2) {
337
375
  className: "character-viewer__monitor__line__value"
338
376
  }, line.value)))), /*#__PURE__*/React.createElement("div", {
339
377
  className: "character-viewer__monitor__details"
340
- }, /*#__PURE__*/React.createElement("span", null, "Font style"), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(StyleSelect, {
378
+ }, /*#__PURE__*/React.createElement("span", null, t('characterViewer.fontStyle')), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(StyleSelect, {
341
379
  collections: families,
342
380
  onChange: handleStyleSelect,
343
381
  value: {
@@ -353,11 +391,15 @@ function CharacterViewerComponent(_ref2) {
353
391
  featureNames: featureNames
354
392
  })))), /*#__PURE__*/React.createElement("div", {
355
393
  className: "character-viewer_blocks",
394
+ id: blocksId,
356
395
  ref: blocksRef,
357
- style: cellWidth ? {
358
- '--cell-width': `${cellWidth}px`
359
- } : undefined
360
- }, groups === null || groups === void 0 ? void 0 : groups.map((_ref5, i) => {
396
+ "data-collapsed": collapsed ? collapseMode.kind : undefined,
397
+ "data-overflowing": showLoadMore || undefined,
398
+ style: {
399
+ '--cell-width': cellWidth ? `${cellWidth}px` : undefined,
400
+ '--collapsed-height': collapseMode.kind === 'height' ? collapseMode.height : undefined
401
+ }
402
+ }, visibleGroups === null || visibleGroups === void 0 ? void 0 : visibleGroups.map((_ref5, i) => {
361
403
  let {
362
404
  name,
363
405
  characterSets
@@ -390,7 +432,15 @@ function CharacterViewerComponent(_ref2) {
390
432
  "data-selected": compareGlyphs(selectedGlyph, selection)
391
433
  }, areCombiningChars(chars) ? /*#__PURE__*/React.createElement("span", null, '\u200C', chars) : chars);
392
434
  })))));
393
- }))));
435
+ })), showLoadMore && /*#__PURE__*/React.createElement("div", {
436
+ className: "character-viewer__load-more"
437
+ }, /*#__PURE__*/React.createElement("button", {
438
+ type: "button",
439
+ className: "character-viewer__load-more__button",
440
+ "aria-controls": blocksId,
441
+ "aria-expanded": false,
442
+ onClick: () => setExpanded(true)
443
+ }, loadMoreLabel || t('characterViewer.loadMore')))));
394
444
  }
395
445
  const idQuery = (_CharacterViewerIDQuery.hash && _CharacterViewerIDQuery.hash !== "f90b09a4df6d95307b0a5d5fda487cdc" && console.error("The definition of 'CharacterViewerIDQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewerIDQuery);
396
446
  const slugQuery = (_CharacterViewerSlugQuery.hash && _CharacterViewerSlugQuery.hash !== "afa08a8f050e0434308892fea6e3c267" && console.error("The definition of 'CharacterViewerSlugQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CharacterViewerSlugQuery);
@@ -409,15 +459,16 @@ export async function loadCharacterViewerQuery(variables, options) {
409
459
  }
410
460
  function CharacterViewerIdQueryRenderer(_ref6) {
411
461
  let {
412
- collectionId
462
+ collectionId,
463
+ ...rest
413
464
  } = _ref6;
414
465
  const data = useLazyLoadQuery(idQuery, {
415
466
  collectionId
416
467
  });
417
468
  if (!data.node) return null;
418
- return /*#__PURE__*/React.createElement(CharacterViewerComponent, {
469
+ return /*#__PURE__*/React.createElement(CharacterViewerComponent, _extends({}, rest, {
419
470
  collection: data.node
420
- });
471
+ }));
421
472
  }
422
473
  export function CharacterViewerPreloadedIDQueryRenderer(_ref7) {
423
474
  let {
@@ -437,16 +488,17 @@ export function CharacterViewerPreloadedIDQueryRenderer(_ref7) {
437
488
  function CharacterViewerSlugQueryRenderer(_ref8) {
438
489
  var _data$viewer, _data$viewer$slug;
439
490
  let {
440
- collectionSlug
491
+ collectionSlug,
492
+ ...rest
441
493
  } = _ref8;
442
494
  const data = useLazyLoadQuery(slugQuery, {
443
495
  collectionSlug
444
496
  });
445
497
  const collection = data === null || data === void 0 ? void 0 : (_data$viewer = data.viewer) === null || _data$viewer === void 0 ? void 0 : (_data$viewer$slug = _data$viewer.slug) === null || _data$viewer$slug === void 0 ? void 0 : _data$viewer$slug.fontCollection;
446
498
  if (!collection) return null;
447
- return /*#__PURE__*/React.createElement(CharacterViewerComponent, {
499
+ return /*#__PURE__*/React.createElement(CharacterViewerComponent, _extends({}, rest, {
448
500
  collection: collection
449
- });
501
+ }));
450
502
  }
451
503
  export function CharacterViewerPreloadedSlugQueryRenderer(_ref9) {
452
504
  var _data$viewer2, _data$viewer2$slug;
@@ -484,6 +536,7 @@ function CharacterViewerPreloadedRenderer(_ref10) {
484
536
  // `EnsureFontdueContext` only self-wraps with `FontdueContextProvider` when
485
537
  // no parent Fontdue context is present, seeding it with `config`.
486
538
  export default function CharacterViewer(props) {
539
+ var _props$preloadedQuery;
487
540
  let inner;
488
541
  if ('preloadedQuery' in props && props.preloadedQuery) {
489
542
  const {
@@ -513,6 +566,7 @@ export default function CharacterViewer(props) {
513
566
  throw new Error('CharacterViewer expected one of preloadedQuery, collectionId, or collectionSlug');
514
567
  }
515
568
  return /*#__PURE__*/React.createElement(EnsureFontdueContext, {
516
- config: props.config
569
+ config: props.config,
570
+ locale: props.locale ?? ((_props$preloadedQuery = props.preloadedQuery) === null || _props$preloadedQuery === void 0 ? void 0 : _props$preloadedQuery.locale)
517
571
  }, inner);
518
572
  }
@@ -7,4 +7,5 @@ export default function CharacterViewer({ collectionId, collectionSlug, ...rest
7
7
  collectionId?: string | null;
8
8
  collectionSlug?: string | null;
9
9
  config?: Config;
10
+ locale?: string;
10
11
  }): Promise<React.JSX.Element | null>;
@@ -24,6 +24,8 @@ export default async function CharacterViewer(_ref) {
24
24
  if (collectionId) {
25
25
  const preloadedQuery = await loadSerializableQuery(CharacterViewerIDQueryNode, {
26
26
  collectionId
27
+ }, {
28
+ locale: rest.locale
27
29
  });
28
30
  return /*#__PURE__*/React.createElement(CharacterViewerPreloadedIDQueryRenderer, _extends({
29
31
  preloadedQuery: preloadedQuery
@@ -32,6 +34,8 @@ export default async function CharacterViewer(_ref) {
32
34
  if (collectionSlug) {
33
35
  const preloadedQuery = await loadSerializableQuery(CharacterViewerSlugQueryNode, {
34
36
  collectionSlug
37
+ }, {
38
+ locale: rest.locale
35
39
  });
36
40
  return /*#__PURE__*/React.createElement(CharacterViewerPreloadedSlugQueryRenderer, _extends({
37
41
  preloadedQuery: preloadedQuery
@@ -52,7 +52,7 @@ export declare const makeConfig: (config?: Config) => {
52
52
  truncate: import("./TypeTester/truncate.js").TruncateOption;
53
53
  priceText: boolean;
54
54
  selectButtonStyle: "inline" | "outlined";
55
- selectButtonLabel: string;
55
+ selectButtonLabel: string | undefined;
56
56
  selectButton: boolean;
57
57
  shy: false | "focus" | "hover";
58
58
  toolsPosition: "inline" | "floating";
@@ -63,7 +63,7 @@ export declare const makeConfig: (config?: Config) => {
63
63
  groupEdit: boolean;
64
64
  bulletStyle: "round" | "square";
65
65
  openTypeFeatures: {
66
- buttonLabel: string;
66
+ buttonLabel: string | undefined;
67
67
  interactionStyle: "select" | "panel" | "dropdown";
68
68
  columns: {
69
69
  features: ({
@@ -78,17 +78,17 @@ export declare const makeConfig: (config?: Config) => {
78
78
  alignmentButtons: boolean;
79
79
  initialAlignment: import("./TypeTester/types.js").Alignment;
80
80
  size: {
81
- label: string | false;
81
+ label: string | false | undefined;
82
82
  min: number;
83
83
  max: number;
84
84
  };
85
85
  lineHeight: {
86
- label: string | false;
86
+ label: string | false | undefined;
87
87
  min: number;
88
88
  max: number;
89
89
  } | undefined;
90
90
  letterSpacing: {
91
- label: string | false;
91
+ label: string | false | undefined;
92
92
  min: number;
93
93
  max: number;
94
94
  } | undefined;
@@ -110,6 +110,8 @@ export declare const makeConfig: (config?: Config) => {
110
110
  indexExcludeTags: string[] | undefined;
111
111
  productLicensesPosition: "bottom" | "top";
112
112
  hideAllCollections: boolean;
113
+ returnUrl: string | undefined;
114
+ returnLabel: string | undefined;
113
115
  };
114
116
  stripe: {
115
117
  appearance: Appearance | null;
@@ -134,7 +136,7 @@ declare const _default: React.Context<{
134
136
  truncate: import("./TypeTester/truncate.js").TruncateOption;
135
137
  priceText: boolean;
136
138
  selectButtonStyle: "inline" | "outlined";
137
- selectButtonLabel: string;
139
+ selectButtonLabel: string | undefined;
138
140
  selectButton: boolean;
139
141
  shy: false | "focus" | "hover";
140
142
  toolsPosition: "inline" | "floating";
@@ -145,7 +147,7 @@ declare const _default: React.Context<{
145
147
  groupEdit: boolean;
146
148
  bulletStyle: "round" | "square";
147
149
  openTypeFeatures: {
148
- buttonLabel: string;
150
+ buttonLabel: string | undefined;
149
151
  interactionStyle: "select" | "panel" | "dropdown";
150
152
  columns: {
151
153
  features: ({
@@ -160,17 +162,17 @@ declare const _default: React.Context<{
160
162
  alignmentButtons: boolean;
161
163
  initialAlignment: import("./TypeTester/types.js").Alignment;
162
164
  size: {
163
- label: string | false;
165
+ label: string | false | undefined;
164
166
  min: number;
165
167
  max: number;
166
168
  };
167
169
  lineHeight: {
168
- label: string | false;
170
+ label: string | false | undefined;
169
171
  min: number;
170
172
  max: number;
171
173
  } | undefined;
172
174
  letterSpacing: {
173
- label: string | false;
175
+ label: string | false | undefined;
174
176
  min: number;
175
177
  max: number;
176
178
  } | undefined;
@@ -192,6 +194,8 @@ declare const _default: React.Context<{
192
194
  indexExcludeTags: string[] | undefined;
193
195
  productLicensesPosition: "bottom" | "top";
194
196
  hideAllCollections: boolean;
197
+ returnUrl: string | undefined;
198
+ returnLabel: string | undefined;
195
199
  };
196
200
  stripe: {
197
201
  appearance: Appearance | null;
@@ -21,7 +21,10 @@ const makeTypeTesterConfig = config => {
21
21
  truncate: (config === null || config === void 0 ? void 0 : config.truncate) ?? false,
22
22
  priceText: (config === null || config === void 0 ? void 0 : config.priceText) ?? false,
23
23
  selectButtonStyle: (config === null || config === void 0 ? void 0 : config.selectButtonStyle) ?? 'inline',
24
- selectButtonLabel: (config === null || config === void 0 ? void 0 : config.selectButtonLabel) ?? 'Select',
24
+ // The text labels default at render time through the UI catalogue
25
+ // (`t('typeTester.…')`), so they follow the page's language; a label set
26
+ // here – or `false` to hide one – always wins.
27
+ selectButtonLabel: config === null || config === void 0 ? void 0 : config.selectButtonLabel,
25
28
  selectButton: (config === null || config === void 0 ? void 0 : config.selectButton) ?? (config === null || config === void 0 ? void 0 : config.buyButton) ?? true,
26
29
  shy,
27
30
  toolsPosition,
@@ -32,7 +35,7 @@ const makeTypeTesterConfig = config => {
32
35
  groupEdit: (config === null || config === void 0 ? void 0 : config.groupEdit) ?? false,
33
36
  bulletStyle: (config === null || config === void 0 ? void 0 : config.bulletStyle) ?? 'square',
34
37
  openTypeFeatures: {
35
- buttonLabel: (config === null || config === void 0 ? void 0 : (_config$openTypeFeatu2 = config.openTypeFeatures) === null || _config$openTypeFeatu2 === void 0 ? void 0 : _config$openTypeFeatu2.buttonLabel) ?? 'OT Features',
38
+ buttonLabel: config === null || config === void 0 ? void 0 : (_config$openTypeFeatu2 = config.openTypeFeatures) === null || _config$openTypeFeatu2 === void 0 ? void 0 : _config$openTypeFeatu2.buttonLabel,
36
39
  interactionStyle: featuresInteractionStyle,
37
40
  columns: config === null || config === void 0 ? void 0 : (_config$openTypeFeatu3 = config.openTypeFeatures) === null || _config$openTypeFeatu3 === void 0 ? void 0 : _config$openTypeFeatu3.columns,
38
41
  selectionStyle: (config === null || config === void 0 ? void 0 : (_config$openTypeFeatu4 = config.openTypeFeatures) === null || _config$openTypeFeatu4 === void 0 ? void 0 : _config$openTypeFeatu4.selectionStyle) ?? 'bullet'
@@ -41,17 +44,17 @@ const makeTypeTesterConfig = config => {
41
44
  alignmentButtons: (config === null || config === void 0 ? void 0 : config.alignmentButtons) ?? false,
42
45
  initialAlignment: (config === null || config === void 0 ? void 0 : config.initialAlignment) ?? 'left',
43
46
  size: {
44
- label: (config === null || config === void 0 ? void 0 : (_config$size = config.size) === null || _config$size === void 0 ? void 0 : _config$size.label) ?? 'Size',
47
+ label: config === null || config === void 0 ? void 0 : (_config$size = config.size) === null || _config$size === void 0 ? void 0 : _config$size.label,
45
48
  min: (config === null || config === void 0 ? void 0 : (_config$size2 = config.size) === null || _config$size2 === void 0 ? void 0 : _config$size2.min) ?? (config === null || config === void 0 ? void 0 : config.min) ?? 10,
46
49
  max: (config === null || config === void 0 ? void 0 : (_config$size3 = config.size) === null || _config$size3 === void 0 ? void 0 : _config$size3.max) ?? (config === null || config === void 0 ? void 0 : config.max) ?? 200
47
50
  },
48
51
  lineHeight: config !== null && config !== void 0 && config.lineHeight ? {
49
- label: (config === null || config === void 0 ? void 0 : (_config$lineHeight = config.lineHeight) === null || _config$lineHeight === void 0 ? void 0 : _config$lineHeight.label) ?? 'Line height',
52
+ label: config === null || config === void 0 ? void 0 : (_config$lineHeight = config.lineHeight) === null || _config$lineHeight === void 0 ? void 0 : _config$lineHeight.label,
50
53
  min: (config === null || config === void 0 ? void 0 : (_config$lineHeight2 = config.lineHeight) === null || _config$lineHeight2 === void 0 ? void 0 : _config$lineHeight2.min) ?? 0.7,
51
54
  max: (config === null || config === void 0 ? void 0 : (_config$lineHeight3 = config.lineHeight) === null || _config$lineHeight3 === void 0 ? void 0 : _config$lineHeight3.max) ?? 2
52
55
  } : undefined,
53
56
  letterSpacing: config !== null && config !== void 0 && config.letterSpacing ? {
54
- label: (config === null || config === void 0 ? void 0 : (_config$letterSpacing = config.letterSpacing) === null || _config$letterSpacing === void 0 ? void 0 : _config$letterSpacing.label) ?? 'Letter spacing',
57
+ label: config === null || config === void 0 ? void 0 : (_config$letterSpacing = config.letterSpacing) === null || _config$letterSpacing === void 0 ? void 0 : _config$letterSpacing.label,
55
58
  min: (config === null || config === void 0 ? void 0 : (_config$letterSpacing2 = config.letterSpacing) === null || _config$letterSpacing2 === void 0 ? void 0 : _config$letterSpacing2.min) ?? -0.05,
56
59
  max: (config === null || config === void 0 ? void 0 : (_config$letterSpacing3 = config.letterSpacing) === null || _config$letterSpacing3 === void 0 ? void 0 : _config$letterSpacing3.max) ?? 0.2
57
60
  } : undefined,
@@ -88,7 +91,7 @@ export const mergeConfig = (base, override) => {
88
91
  return deepMerge(base, override);
89
92
  };
90
93
  export const makeConfig = config => {
91
- var _config$form, _config$testFonts, _config$testFonts2, _config$storeModal, _config$storeModal2, _config$storeModal3, _config$storeModal4, _config$stripe, _config$tracking, _config$tracking2, _config$tracking3, _config$tracking4, _config$preview, _config$preview2, _config$preview3;
94
+ var _config$form, _config$testFonts, _config$testFonts2, _config$storeModal, _config$storeModal2, _config$storeModal3, _config$storeModal4, _config$storeModal5, _config$storeModal6, _config$stripe, _config$tracking, _config$tracking2, _config$tracking3, _config$tracking4, _config$preview, _config$preview2, _config$preview3;
92
95
  return {
93
96
  typeTester: makeTypeTesterConfig(config === null || config === void 0 ? void 0 : config.typeTester),
94
97
  form: {
@@ -105,7 +108,9 @@ export const makeConfig = config => {
105
108
  indexLayout: (config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.indexLayout) ?? 'styled-aa',
106
109
  indexExcludeTags: config === null || config === void 0 ? void 0 : (_config$storeModal2 = config.storeModal) === null || _config$storeModal2 === void 0 ? void 0 : _config$storeModal2.indexExcludeTags,
107
110
  productLicensesPosition: (config === null || config === void 0 ? void 0 : (_config$storeModal3 = config.storeModal) === null || _config$storeModal3 === void 0 ? void 0 : _config$storeModal3.productLicensesPosition) ?? 'top',
108
- hideAllCollections: (config === null || config === void 0 ? void 0 : (_config$storeModal4 = config.storeModal) === null || _config$storeModal4 === void 0 ? void 0 : _config$storeModal4.hideAllCollections) ?? false
111
+ hideAllCollections: (config === null || config === void 0 ? void 0 : (_config$storeModal4 = config.storeModal) === null || _config$storeModal4 === void 0 ? void 0 : _config$storeModal4.hideAllCollections) ?? false,
112
+ returnUrl: config === null || config === void 0 ? void 0 : (_config$storeModal5 = config.storeModal) === null || _config$storeModal5 === void 0 ? void 0 : _config$storeModal5.returnUrl,
113
+ returnLabel: config === null || config === void 0 ? void 0 : (_config$storeModal6 = config.storeModal) === null || _config$storeModal6 === void 0 ? void 0 : _config$storeModal6.returnLabel
109
114
  },
110
115
  stripe: {
111
116
  appearance: (config === null || config === void 0 ? void 0 : (_config$stripe = config.stripe) === null || _config$stripe === void 0 ? void 0 : _config$stripe.appearance) ?? null
@@ -2,10 +2,11 @@ import React, { useContext, useEffect, useState } from 'react';
2
2
  import ConfigContext from '../ConfigContext.js';
3
3
  import { useFontdueUrl } from '../UrlContext.js';
4
4
  import { setConsent, activateConsentedScripts, getClientAnonymousId, getEntryAttribution } from './consent.js';
5
- const DEFAULT_MESSAGE = 'We use cookies to analyze site usage and improve your\u00A0experience.';
5
+ import { useT } from '../../i18n/useT.js';
6
6
  const ConsentBanner = () => {
7
7
  const config = useContext(ConfigContext);
8
8
  const url = useFontdueUrl();
9
+ const t = useT();
9
10
 
10
11
  // Start dismissed to avoid hydration mismatch (server has no document.cookie).
11
12
  // Check on the client in useEffect.
@@ -21,7 +22,7 @@ const ConsentBanner = () => {
21
22
  }
22
23
  }, [config.tracking.consentRequired]);
23
24
  if (dismissed) return null;
24
- const message = config.tracking.consentMessage || DEFAULT_MESSAGE;
25
+ const message = config.tracking.consentMessage || t('consent.message');
25
26
  const sendConsentEvent = categories => {
26
27
  // Fire a normal tracking event on the existing pipeline. Because the consent
27
28
  // cookie was just written, the server is now permitted to forward, sets the
@@ -65,7 +66,7 @@ const ConsentBanner = () => {
65
66
  return /*#__PURE__*/React.createElement("div", {
66
67
  className: "fontdue-consent-banner",
67
68
  role: "region",
68
- "aria-label": "Cookie consent"
69
+ "aria-label": t('consent.label')
69
70
  }, /*#__PURE__*/React.createElement("div", {
70
71
  className: "fontdue-consent-banner__container"
71
72
  }, /*#__PURE__*/React.createElement("p", {
@@ -76,10 +77,10 @@ const ConsentBanner = () => {
76
77
  type: "button",
77
78
  className: "fontdue-consent-banner__button fontdue-consent-banner__button--secondary",
78
79
  onClick: handleReject
79
- }, "Necessary only"), /*#__PURE__*/React.createElement("button", {
80
+ }, t('consent.necessaryOnly')), /*#__PURE__*/React.createElement("button", {
80
81
  type: "button",
81
82
  className: "fontdue-consent-banner__button fontdue-consent-banner__button--primary",
82
83
  onClick: handleAcceptAll
83
- }, "Accept all"))));
84
+ }, t('consent.acceptAll')))));
84
85
  };
85
86
  export default ConsentBanner;
@@ -3,12 +3,14 @@ import React from 'react';
3
3
  // @ts-ignore — `store` package has no published types
4
4
  import store from 'store';
5
5
  import ComponentsContext from '../ComponentsContext.js';
6
+ import { useT } from '../../i18n/useT.js';
6
7
  const DefaultCookieNotification = _ref => {
7
8
  let {
8
9
  onDismiss,
9
10
  open,
10
11
  siteTitle
11
12
  } = _ref;
13
+ const t = useT();
12
14
  return /*#__PURE__*/React.createElement("div", {
13
15
  className: "cookie-notification",
14
16
  "data-open": open
@@ -18,17 +20,21 @@ const DefaultCookieNotification = _ref => {
18
20
  className: "cookie-notification__text-container"
19
21
  }, /*#__PURE__*/React.createElement("p", {
20
22
  className: "cookie-notification__label"
21
- }, siteTitle, " website uses cookies"), /*#__PURE__*/React.createElement("p", {
23
+ }, t('cookies.title', {
24
+ siteTitle: siteTitle ?? ''
25
+ })), /*#__PURE__*/React.createElement("p", {
22
26
  className: "cookie-notification__text"
23
- }, "We use cookies to ensure that we give you the best experience. By continuing to visit this site you agree to receive cookies from generaltypestudio.com. You can read more about cookies in our ", /*#__PURE__*/React.createElement("a", {
24
- href: "/privacy-policy"
25
- }, "privacy policy"), ".")), /*#__PURE__*/React.createElement("div", {
27
+ }, t.rich('cookies.text', {
28
+ link: /*#__PURE__*/React.createElement("a", {
29
+ href: "/privacy-policy"
30
+ }, t('cookies.privacyPolicy'))
31
+ }))), /*#__PURE__*/React.createElement("div", {
26
32
  className: "cookie-notification__button-container"
27
33
  }, /*#__PURE__*/React.createElement("button", {
28
34
  type: "button",
29
35
  className: "cookie-notification__button",
30
36
  onClick: onDismiss
31
- }, "Got it"))));
37
+ }, t('cookies.gotIt')))));
32
38
  };
33
39
  function GetComponent(_ref2) {
34
40
  let {
@@ -2,11 +2,13 @@ import _CouponText_coupon from "../../__generated__/CouponText_coupon.graphql.js
2
2
  import { graphql, useFragment } from 'react-relay';
3
3
  import React, { Fragment } from 'react';
4
4
  import { Price } from '../Price/index.js';
5
+ import { useT } from '../../i18n/useT.js';
5
6
  export default function CouponText(_ref) {
6
7
  let {
7
8
  coupon: couponKey,
8
9
  subtract = 0
9
10
  } = _ref;
11
+ const t = useT();
10
12
  const coupon = useFragment((_CouponText_coupon.hash && _CouponText_coupon.hash !== "484f6e7b6a444d53ee056ac4a43a58f3" && console.error("The definition of 'CouponText_coupon' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CouponText_coupon), couponKey);
11
13
  if (coupon.type === 'credit') {
12
14
  const amountRemaining = {
@@ -14,17 +16,23 @@ export default function CouponText(_ref) {
14
16
  amount: coupon.creditAmountRemaining.amount - subtract,
15
17
  currency: coupon.creditAmountRemaining.currency
16
18
  };
17
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Price, {
18
- price: amountRemaining
19
- }), " remaining");
19
+ return /*#__PURE__*/React.createElement(Fragment, null, t.rich('coupon.remaining', {
20
+ price: /*#__PURE__*/React.createElement(Price, {
21
+ price: amountRemaining
22
+ })
23
+ }));
20
24
  }
21
25
  if (coupon.type === 'percent') {
22
- return /*#__PURE__*/React.createElement(Fragment, null, `${coupon.percentAmount}% off`);
26
+ return /*#__PURE__*/React.createElement(Fragment, null, t('coupon.percentOff', {
27
+ percent: String(coupon.percentAmount)
28
+ }));
23
29
  }
24
30
  if (coupon.type === 'static_credit') {
25
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Price, {
26
- price: coupon.creditAmount
27
- }), " off");
31
+ return /*#__PURE__*/React.createElement(Fragment, null, t.rich('coupon.amountOff', {
32
+ price: /*#__PURE__*/React.createElement(Price, {
33
+ price: coupon.creditAmount
34
+ })
35
+ }));
28
36
  }
29
37
  return null;
30
38
  }