fontdue-js 2.22.1 → 2.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/__generated__/StoreModalFamily_collection.graphql.d.ts +2 -1
  3. package/dist/__generated__/StoreModalFamily_collection.graphql.js +49 -31
  4. package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
  5. package/dist/__generated__/StoreModalProductQuery.graphql.js +68 -50
  6. package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +1 -1
  7. package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +61 -43
  8. package/dist/components/StoreModal/StoreModalFamily.js +13 -2
  9. package/dist/components/elements/StoreModalUnifiedCheckout.js +7 -3
  10. package/package.json +1 -1
  11. package/dist-cjs/__generated__/AddToCartBannerQuery.graphql.js +0 -194
  12. package/dist-cjs/__generated__/AddToCartBanner_item.graphql.js +0 -107
  13. package/dist-cjs/__generated__/AddToCartBanner_order.graphql.js +0 -131
  14. package/dist-cjs/__generated__/AddressFieldsRefetchQuery.graphql.js +0 -170
  15. package/dist-cjs/__generated__/AddressFields_viewer.graphql.js +0 -125
  16. package/dist-cjs/__generated__/BuyButtonIDQuery.graphql.js +0 -121
  17. package/dist-cjs/__generated__/BuyButtonSlugQuery.graphql.js +0 -146
  18. package/dist-cjs/__generated__/BuyButton_collection.graphql.js +0 -56
  19. package/dist-cjs/__generated__/CartButtonQuery.graphql.js +0 -139
  20. package/dist-cjs/__generated__/CartButton_order.graphql.js +0 -71
  21. package/dist-cjs/__generated__/CartItemAdditionalLicenses_licenses.graphql.js +0 -42
  22. package/dist-cjs/__generated__/CartItemAdditionalLicenses_orderItem.graphql.js +0 -52
  23. package/dist-cjs/__generated__/CartItemLicense_selection.graphql.js +0 -80
  24. package/dist-cjs/__generated__/CartItemProduct_product.graphql.js +0 -113
  25. package/dist-cjs/__generated__/CartItemVariable_selection.graphql.js +0 -107
  26. package/dist-cjs/__generated__/CartItemVariable_variable.graphql.js +0 -58
  27. package/dist-cjs/__generated__/CartItem_node.graphql.js +0 -166
  28. package/dist-cjs/__generated__/CartOrderCompleteOrderMutation.graphql.js +0 -783
  29. package/dist-cjs/__generated__/CartOrderRemoveDiscountMutation.graphql.js +0 -760
  30. package/dist-cjs/__generated__/CartOrderUpdateMutation.graphql.js +0 -795
  31. package/dist-cjs/__generated__/CartOrder_UpdateErrors.graphql.js +0 -43
  32. package/dist-cjs/__generated__/CartOrder_order.graphql.js +0 -264
  33. package/dist-cjs/__generated__/CartOrder_viewer.graphql.js +0 -51
  34. package/dist-cjs/__generated__/CartQuery.graphql.js +0 -887
  35. package/dist-cjs/__generated__/CartStateRemoveDiscountMutation.graphql.js +0 -422
  36. package/dist-cjs/__generated__/CartStateUpdateMutation.graphql.js +0 -790
  37. package/dist-cjs/__generated__/CartState_order.graphql.js +0 -122
  38. package/dist-cjs/__generated__/CartTotals_order.graphql.js +0 -140
  39. package/dist-cjs/__generated__/CharacterViewerIDQuery.graphql.js +0 -332
  40. package/dist-cjs/__generated__/CharacterViewerSlugQuery.graphql.js +0 -362
  41. package/dist-cjs/__generated__/CharacterViewerStyleRefetchQuery.graphql.js +0 -226
  42. package/dist-cjs/__generated__/CharacterViewer_collection.graphql.js +0 -197
  43. package/dist-cjs/__generated__/CharacterViewer_family.graphql.js +0 -101
  44. package/dist-cjs/__generated__/CharacterViewer_style.graphql.js +0 -161
  45. package/dist-cjs/__generated__/CheckoutUpdateCustomerMutation.graphql.js +0 -770
  46. package/dist-cjs/__generated__/CheckoutUpdateOrderMutation.graphql.js +0 -811
  47. package/dist-cjs/__generated__/Checkout_UpdateOrderErrors.graphql.js +0 -97
  48. package/dist-cjs/__generated__/Checkout_identity.graphql.js +0 -94
  49. package/dist-cjs/__generated__/Checkout_order.graphql.js +0 -144
  50. package/dist-cjs/__generated__/Checkout_viewer.graphql.js +0 -74
  51. package/dist-cjs/__generated__/CollectionAa_Query.graphql.js +0 -192
  52. package/dist-cjs/__generated__/CollectionAa_product.graphql.js +0 -69
  53. package/dist-cjs/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +0 -432
  54. package/dist-cjs/__generated__/CouponText_coupon.graphql.js +0 -73
  55. package/dist-cjs/__generated__/CustomerLoginFormLoginMutation.graphql.js +0 -72
  56. package/dist-cjs/__generated__/CustomerLoginFormQuery.graphql.js +0 -91
  57. package/dist-cjs/__generated__/DownloadRefetchQuery.graphql.js +0 -124
  58. package/dist-cjs/__generated__/Download_order.graphql.js +0 -61
  59. package/dist-cjs/__generated__/FamilyList_node.graphql.js +0 -96
  60. package/dist-cjs/__generated__/Family_node.graphql.js +0 -160
  61. package/dist-cjs/__generated__/FontFamiliesQuery.graphql.js +0 -368
  62. package/dist-cjs/__generated__/FontStyle_fontStyle.graphql.js +0 -32
  63. package/dist-cjs/__generated__/IdentityBox_identity.graphql.js +0 -52
  64. package/dist-cjs/__generated__/License_node.graphql.js +0 -97
  65. package/dist-cjs/__generated__/NewsletterSignupQuery.graphql.js +0 -110
  66. package/dist-cjs/__generated__/NewsletterSignupUpdateCustomerMutation.graphql.js +0 -81
  67. package/dist-cjs/__generated__/NodePasswordFormAccessNodeMutation.graphql.js +0 -72
  68. package/dist-cjs/__generated__/NodePasswordFormIDQuery.graphql.js +0 -93
  69. package/dist-cjs/__generated__/NodePasswordFormSlugQuery.graphql.js +0 -115
  70. package/dist-cjs/__generated__/OrderVariableSelectionReduxRefetchQuery.graphql.js +0 -154
  71. package/dist-cjs/__generated__/OrderVariableSelectionRedux_viewer.graphql.js +0 -75
  72. package/dist-cjs/__generated__/OrderVariableSelection_variables.graphql.js +0 -107
  73. package/dist-cjs/__generated__/PrecartAddToCartMutation.graphql.js +0 -793
  74. package/dist-cjs/__generated__/PrecartClearCartMutation.graphql.js +0 -81
  75. package/dist-cjs/__generated__/PrecartQuery.graphql.js +0 -308
  76. package/dist-cjs/__generated__/Precart_collection.graphql.js +0 -81
  77. package/dist-cjs/__generated__/Precart_license.graphql.js +0 -67
  78. package/dist-cjs/__generated__/Precart_viewer.graphql.js +0 -161
  79. package/dist-cjs/__generated__/PriceBarSectionRefetchQuery.graphql.js +0 -184
  80. package/dist-cjs/__generated__/PriceBarSection_node.graphql.js +0 -121
  81. package/dist-cjs/__generated__/PriceBar_node.graphql.js +0 -60
  82. package/dist-cjs/__generated__/Price_price.graphql.js +0 -40
  83. package/dist-cjs/__generated__/SKUPrice_sku.graphql.js +0 -69
  84. package/dist-cjs/__generated__/SelectButton_sku.graphql.js +0 -54
  85. package/dist-cjs/__generated__/ServerConfigProviderQuery.graphql.js +0 -108
  86. package/dist-cjs/__generated__/ShareCartCreateSnapshotMutation.graphql.js +0 -84
  87. package/dist-cjs/__generated__/SpecimenLinkQuery.graphql.js +0 -120
  88. package/dist-cjs/__generated__/StoreModalBundleButton_bundle.graphql.js +0 -85
  89. package/dist-cjs/__generated__/StoreModalCartQuery.graphql.js +0 -1017
  90. package/dist-cjs/__generated__/StoreModalCheckoutQuery.graphql.js +0 -194
  91. package/dist-cjs/__generated__/StoreModalContainerQuery.graphql.js +0 -228
  92. package/dist-cjs/__generated__/StoreModalDownloadRefetchQuery.graphql.js +0 -102
  93. package/dist-cjs/__generated__/StoreModalDownload_order.graphql.js +0 -40
  94. package/dist-cjs/__generated__/StoreModalFamilyButton_collection.graphql.js +0 -135
  95. package/dist-cjs/__generated__/StoreModalFamily_collection.graphql.js +0 -130
  96. package/dist-cjs/__generated__/StoreModalIndexItem_fontCollection.graphql.js +0 -98
  97. package/dist-cjs/__generated__/StoreModalIndexQuery.graphql.js +0 -263
  98. package/dist-cjs/__generated__/StoreModalOrderVariableSelection_order.graphql.js +0 -98
  99. package/dist-cjs/__generated__/StoreModalOrderVariableSelection_viewer.graphql.js +0 -66
  100. package/dist-cjs/__generated__/StoreModalProductContent_collection.graphql.js +0 -92
  101. package/dist-cjs/__generated__/StoreModalProductLicenseSelection_collection.graphql.js +0 -47
  102. package/dist-cjs/__generated__/StoreModalProductLicense_license.graphql.js +0 -104
  103. package/dist-cjs/__generated__/StoreModalProductQuery.graphql.js +0 -702
  104. package/dist-cjs/__generated__/StoreModalProductRefetchQuery.graphql.js +0 -433
  105. package/dist-cjs/__generated__/StoreModalProductSummaryAddToCartMutation.graphql.js +0 -149
  106. package/dist-cjs/__generated__/StoreModalProductSummaryClearCartMutation.graphql.js +0 -81
  107. package/dist-cjs/__generated__/StoreModalProductSummaryRefetchQuery.graphql.js +0 -281
  108. package/dist-cjs/__generated__/StoreModalProductSummary_viewer.graphql.js +0 -243
  109. package/dist-cjs/__generated__/StoreModalReviewIdentity_identity.graphql.js +0 -52
  110. package/dist-cjs/__generated__/StoreModalStyleButton_fontStyle.graphql.js +0 -113
  111. package/dist-cjs/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.js +0 -302
  112. package/dist-cjs/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +0 -323
  113. package/dist-cjs/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.js +0 -473
  114. package/dist-cjs/__generated__/StoreModalUnifiedCheckout_order.graphql.js +0 -237
  115. package/dist-cjs/__generated__/StoreModalUnifiedCheckout_viewer.graphql.js +0 -117
  116. package/dist-cjs/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.js +0 -105
  117. package/dist-cjs/__generated__/StripeProvider_viewer.graphql.js +0 -139
  118. package/dist-cjs/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +0 -770
  119. package/dist-cjs/__generated__/TestFontsForm_Query.graphql.js +0 -126
  120. package/dist-cjs/__generated__/TestModeBannerQuery.graphql.js +0 -87
  121. package/dist-cjs/__generated__/ThemeConfigQuery.graphql.js +0 -87
  122. package/dist-cjs/__generated__/TypeTesterFeaturesButton_fontStyle.graphql.js +0 -32
  123. package/dist-cjs/__generated__/TypeTesterFeatures_fontStyle.graphql.js +0 -36
  124. package/dist-cjs/__generated__/TypeTesterFloatingToolbar_testers.graphql.js +0 -53
  125. package/dist-cjs/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +0 -347
  126. package/dist-cjs/__generated__/TypeTesterStandaloneQuery.graphql.js +0 -450
  127. package/dist-cjs/__generated__/TypeTesterStyleSelectData_fontStyle.graphql.js +0 -106
  128. package/dist-cjs/__generated__/TypeTesterStyleSelectData_fontStyleData.graphql.js +0 -88
  129. package/dist-cjs/__generated__/TypeTesterStyleSelectData_viewer.graphql.js +0 -166
  130. package/dist-cjs/__generated__/TypeTesterToolbar_fontStyle.graphql.js +0 -36
  131. package/dist-cjs/__generated__/TypeTesterVariableAxes_fontStyle.graphql.js +0 -61
  132. package/dist-cjs/__generated__/TypeTester_fontStyle.graphql.js +0 -106
  133. package/dist-cjs/__generated__/TypeTester_viewer.graphql.js +0 -40
  134. package/dist-cjs/__generated__/TypeTestersChangedStylesQuery.graphql.js +0 -347
  135. package/dist-cjs/__generated__/TypeTestersIDQuery.graphql.js +0 -637
  136. package/dist-cjs/__generated__/TypeTestersRefetchQuery.graphql.js +0 -554
  137. package/dist-cjs/__generated__/TypeTestersSlugQuery.graphql.js +0 -644
  138. package/dist-cjs/__generated__/TypeTesters_collection.graphql.js +0 -258
  139. package/dist-cjs/__generated__/TypeTesters_viewer.graphql.js +0 -40
  140. package/dist-cjs/__generated__/VariableTableAmounts_option.graphql.js +0 -34
  141. package/dist-cjs/__generated__/VariableTableAmounts_variable.graphql.js +0 -34
  142. package/dist-cjs/__generated__/productState_Query.graphql.js +0 -184
  143. package/dist-cjs/__generated__/productState_bundle.graphql.js +0 -79
  144. package/dist-cjs/__generated__/productState_collection.graphql.js +0 -90
  145. package/dist-cjs/__generated__/productState_collectionBundle.graphql.js +0 -88
  146. package/dist-cjs/__generated__/productState_node.graphql.js +0 -122
  147. package/dist-cjs/__generated__/productState_sku.graphql.js +0 -51
  148. package/dist-cjs/__generated__/useFeaturesData_fontStyle.graphql.js +0 -64
  149. package/dist-cjs/__generated__/useFontStyle_fontStyle.graphql.js +0 -94
  150. package/dist-cjs/__generated__/useTotalStyles_fontCollection.graphql.js +0 -57
  151. package/dist-cjs/__tests__/collectionBundleSelection.test.js +0 -1630
  152. package/dist-cjs/components/AddToCartBanner/index.js +0 -75
  153. package/dist-cjs/components/BuyButton/index.js +0 -124
  154. package/dist-cjs/components/BuyButton/index.server.js +0 -36
  155. package/dist-cjs/components/BuyingOptions/index.js +0 -23
  156. package/dist-cjs/components/Cart/AddressFields.js +0 -162
  157. package/dist-cjs/components/Cart/CartItem/CartItemAdditionalLicenses.js +0 -33
  158. package/dist-cjs/components/Cart/CartItem/CartItemLicense.js +0 -66
  159. package/dist-cjs/components/Cart/CartItem/CartItemProduct.js +0 -36
  160. package/dist-cjs/components/Cart/CartItem/CartItemVariable.js +0 -66
  161. package/dist-cjs/components/Cart/CartItem/VariableTextInput.js +0 -79
  162. package/dist-cjs/components/Cart/CartItem/index.js +0 -95
  163. package/dist-cjs/components/Cart/CartOrder.js +0 -314
  164. package/dist-cjs/components/Cart/CartState.js +0 -93
  165. package/dist-cjs/components/Cart/CartTotals.js +0 -97
  166. package/dist-cjs/components/Cart/Checkout.js +0 -473
  167. package/dist-cjs/components/Cart/CheckoutSteps.js +0 -15
  168. package/dist-cjs/components/Cart/CouponCodeInput.js +0 -90
  169. package/dist-cjs/components/Cart/CustomerFields.js +0 -80
  170. package/dist-cjs/components/Cart/Download.js +0 -62
  171. package/dist-cjs/components/Cart/EmptyCart.js +0 -42
  172. package/dist-cjs/components/Cart/IdentityBox.js +0 -37
  173. package/dist-cjs/components/Cart/ShareCart.js +0 -87
  174. package/dist-cjs/components/Cart/index.js +0 -36
  175. package/dist-cjs/components/Cart/injectRelayEnvironment.js +0 -21
  176. package/dist-cjs/components/Cart/types.js +0 -5
  177. package/dist-cjs/components/Cart/utils.js +0 -8
  178. package/dist-cjs/components/CartButton/index.js +0 -127
  179. package/dist-cjs/components/CartButton/index.server.js +0 -18
  180. package/dist-cjs/components/CharacterViewer/StyleSelect.js +0 -60
  181. package/dist-cjs/components/CharacterViewer/index.js +0 -441
  182. package/dist-cjs/components/CharacterViewer/index.server.js +0 -36
  183. package/dist-cjs/components/Checkbox/index.js +0 -27
  184. package/dist-cjs/components/CollectionAa/index.js +0 -38
  185. package/dist-cjs/components/ComponentsContext.js +0 -12
  186. package/dist-cjs/components/ConfigContext.js +0 -86
  187. package/dist-cjs/components/ConsentBanner/consent.js +0 -92
  188. package/dist-cjs/components/ConsentBanner/index.js +0 -84
  189. package/dist-cjs/components/CookieNotification/index.js +0 -83
  190. package/dist-cjs/components/CorsErrorModal.js +0 -98
  191. package/dist-cjs/components/CouponText/index.js +0 -38
  192. package/dist-cjs/components/CustomerLoginForm/index.js +0 -88
  193. package/dist-cjs/components/Family/FamilyList.js +0 -43
  194. package/dist-cjs/components/Family/index.js +0 -77
  195. package/dist-cjs/components/FontFamilies/index.js +0 -53
  196. package/dist-cjs/components/FontStyle/index.js +0 -37
  197. package/dist-cjs/components/FontdueProvider/FontdueProviderClientComponent.js +0 -74
  198. package/dist-cjs/components/FontdueProvider/index.js +0 -43
  199. package/dist-cjs/components/FontdueProvider/index.server.js +0 -35
  200. package/dist-cjs/components/FontdueProvider/useAuxUIOwner.js +0 -32
  201. package/dist-cjs/components/Icons/Align.js +0 -58
  202. package/dist-cjs/components/Icons/ArrowDownRight.js +0 -19
  203. package/dist-cjs/components/Icons/ArrowLeft.js +0 -22
  204. package/dist-cjs/components/Icons/ArrowRight.js +0 -19
  205. package/dist-cjs/components/Icons/CarrotDown.js +0 -19
  206. package/dist-cjs/components/Icons/CarrotUp.js +0 -19
  207. package/dist-cjs/components/Icons/Cart.js +0 -23
  208. package/dist-cjs/components/Icons/CartNew.js +0 -33
  209. package/dist-cjs/components/Icons/Check.js +0 -19
  210. package/dist-cjs/components/Icons/Checkbox.js +0 -24
  211. package/dist-cjs/components/Icons/CheckboxChecked.js +0 -24
  212. package/dist-cjs/components/Icons/CheckboxCrossed.js +0 -26
  213. package/dist-cjs/components/Icons/CircledCheck.js +0 -21
  214. package/dist-cjs/components/Icons/CircledInfo.js +0 -21
  215. package/dist-cjs/components/Icons/CircledMinus.js +0 -21
  216. package/dist-cjs/components/Icons/ColorPicker.js +0 -19
  217. package/dist-cjs/components/Icons/CreditCard.js +0 -21
  218. package/dist-cjs/components/Icons/DownArrow.js +0 -24
  219. package/dist-cjs/components/Icons/DownloadFonts.js +0 -25
  220. package/dist-cjs/components/Icons/FrowningFace.js +0 -25
  221. package/dist-cjs/components/Icons/License.js +0 -19
  222. package/dist-cjs/components/Icons/Receipt.js +0 -34
  223. package/dist-cjs/components/Icons/User.js +0 -19
  224. package/dist-cjs/components/Icons/X.js +0 -19
  225. package/dist-cjs/components/Icons/index.js +0 -167
  226. package/dist-cjs/components/NewsletterSignup/NewsletterSignupElement.js +0 -15
  227. package/dist-cjs/components/NewsletterSignup/index.js +0 -192
  228. package/dist-cjs/components/NewsletterSignup/index.server.js +0 -18
  229. package/dist-cjs/components/NodePasswordForm/index.js +0 -114
  230. package/dist-cjs/components/OrderVariableSelection/OrderVariableSelectionRedux.js +0 -66
  231. package/dist-cjs/components/OrderVariableSelection/index.js +0 -199
  232. package/dist-cjs/components/Precart/License.js +0 -70
  233. package/dist-cjs/components/Precart/index.js +0 -331
  234. package/dist-cjs/components/Price/index.js +0 -111
  235. package/dist-cjs/components/PriceBar/PriceBarSection.js +0 -61
  236. package/dist-cjs/components/PriceBar/index.js +0 -49
  237. package/dist-cjs/components/Root/index.js +0 -208
  238. package/dist-cjs/components/Root/productState.js +0 -143
  239. package/dist-cjs/components/SKUPrice/index.js +0 -46
  240. package/dist-cjs/components/Select/index.js +0 -36
  241. package/dist-cjs/components/SelectButton/index.js +0 -79
  242. package/dist-cjs/components/ServerConfigProvider/index.js +0 -39
  243. package/dist-cjs/components/SpecimenLink/index.js +0 -37
  244. package/dist-cjs/components/StickyNav/index.js +0 -80
  245. package/dist-cjs/components/StoreModal/StoreModalBundleButton.js +0 -47
  246. package/dist-cjs/components/StoreModal/StoreModalCart.js +0 -79
  247. package/dist-cjs/components/StoreModal/StoreModalCheckout.js +0 -24
  248. package/dist-cjs/components/StoreModal/StoreModalCheckoutContext.js +0 -14
  249. package/dist-cjs/components/StoreModal/StoreModalContainer.js +0 -117
  250. package/dist-cjs/components/StoreModal/StoreModalDownload.js +0 -38
  251. package/dist-cjs/components/StoreModal/StoreModalFamily.js +0 -58
  252. package/dist-cjs/components/StoreModal/StoreModalFamilyButton.js +0 -69
  253. package/dist-cjs/components/StoreModal/StoreModalIndex.js +0 -27
  254. package/dist-cjs/components/StoreModal/StoreModalIndexItem.js +0 -63
  255. package/dist-cjs/components/StoreModal/StoreModalLicenseeIsBillingSelection.js +0 -30
  256. package/dist-cjs/components/StoreModal/StoreModalLoader.js +0 -22
  257. package/dist-cjs/components/StoreModal/StoreModalOrderVariableSelection.js +0 -89
  258. package/dist-cjs/components/StoreModal/StoreModalProduct.js +0 -154
  259. package/dist-cjs/components/StoreModal/StoreModalReviewIdentity.js +0 -18
  260. package/dist-cjs/components/StoreModal/StoreModalRouter.js +0 -28
  261. package/dist-cjs/components/StoreModal/StoreModalStyleButton.js +0 -52
  262. package/dist-cjs/components/StoreModal/index.js +0 -39
  263. package/dist-cjs/components/StoreModal/routes.js +0 -51
  264. package/dist-cjs/components/StoreModal/types.js +0 -5
  265. package/dist-cjs/components/StoreModalProductLicenseSelection/LicenseElement.js +0 -46
  266. package/dist-cjs/components/StoreModalProductLicenseSelection/LicenseVariableElement.js +0 -35
  267. package/dist-cjs/components/StoreModalProductLicenseSelection/LicenseVariableRadioElement.js +0 -47
  268. package/dist-cjs/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +0 -133
  269. package/dist-cjs/components/StoreModalProductLicenseSelection/index.js +0 -31
  270. package/dist-cjs/components/StoreModalProductSummary/index.js +0 -219
  271. package/dist-cjs/components/StripeLogo.js +0 -17
  272. package/dist-cjs/components/StripeProvider/index.js +0 -172
  273. package/dist-cjs/components/Switch/index.js +0 -7
  274. package/dist-cjs/components/TestFontsForm/TestFontsFormElement.js +0 -15
  275. package/dist-cjs/components/TestFontsForm/index.js +0 -208
  276. package/dist-cjs/components/TestFontsForm/index.server.js +0 -18
  277. package/dist-cjs/components/TestModeBanner/index.js +0 -34
  278. package/dist-cjs/components/TextField/index.js +0 -42
  279. package/dist-cjs/components/ThemeConfig/index.js +0 -41
  280. package/dist-cjs/components/ThemeConfig/index.server.js +0 -17
  281. package/dist-cjs/components/Tracking/index.js +0 -164
  282. package/dist-cjs/components/TypeTester/TypeTesterAlignButtons.js +0 -34
  283. package/dist-cjs/components/TypeTester/TypeTesterBullet.js +0 -23
  284. package/dist-cjs/components/TypeTester/TypeTesterContent.js +0 -58
  285. package/dist-cjs/components/TypeTester/TypeTesterContext.js +0 -166
  286. package/dist-cjs/components/TypeTester/TypeTesterEditAll.js +0 -36
  287. package/dist-cjs/components/TypeTester/TypeTesterFeatures.js +0 -133
  288. package/dist-cjs/components/TypeTester/TypeTesterFeaturesButton.js +0 -82
  289. package/dist-cjs/components/TypeTester/TypeTesterFitter.js +0 -21
  290. package/dist-cjs/components/TypeTester/TypeTesterFloatingToolbar.js +0 -79
  291. package/dist-cjs/components/TypeTester/TypeTesterInput.js +0 -72
  292. package/dist-cjs/components/TypeTester/TypeTesterSlider.js +0 -76
  293. package/dist-cjs/components/TypeTester/TypeTesterStandalone.js +0 -137
  294. package/dist-cjs/components/TypeTester/TypeTesterStandalone.preload.js +0 -27
  295. package/dist-cjs/components/TypeTester/TypeTesterStandalone.server.js +0 -26
  296. package/dist-cjs/components/TypeTester/TypeTesterStandaloneElement.js +0 -65
  297. package/dist-cjs/components/TypeTester/TypeTesterState.js +0 -133
  298. package/dist-cjs/components/TypeTester/TypeTesterStyleSelect.js +0 -101
  299. package/dist-cjs/components/TypeTester/TypeTesterStyleSelectData.js +0 -102
  300. package/dist-cjs/components/TypeTester/TypeTesterToolbar.js +0 -94
  301. package/dist-cjs/components/TypeTester/TypeTesterVariableAxes.js +0 -65
  302. package/dist-cjs/components/TypeTester/features.js +0 -150
  303. package/dist-cjs/components/TypeTester/index.js +0 -169
  304. package/dist-cjs/components/TypeTester/types.js +0 -14
  305. package/dist-cjs/components/TypeTester/useFeaturesData.js +0 -36
  306. package/dist-cjs/components/TypeTester/useTypeTesterStyler.js +0 -83
  307. package/dist-cjs/components/TypeTesters/TypeTestersElement.js +0 -33
  308. package/dist-cjs/components/TypeTesters/index.js +0 -271
  309. package/dist-cjs/components/TypeTesters/index.server.js +0 -44
  310. package/dist-cjs/components/UrlContext.js +0 -16
  311. package/dist-cjs/components/VariableTableAmounts/index.js +0 -28
  312. package/dist-cjs/components/elements/Button/index.js +0 -21
  313. package/dist-cjs/components/elements/EmptyCart/index.js +0 -30
  314. package/dist-cjs/components/elements/StoreModalCartLayout/index.js +0 -38
  315. package/dist-cjs/components/elements/StoreModalContainer/StoreModalContainerContext.js +0 -11
  316. package/dist-cjs/components/elements/StoreModalContainer/index.js +0 -77
  317. package/dist-cjs/components/elements/StoreModalDownloadLayout/index.js +0 -25
  318. package/dist-cjs/components/elements/StoreModalFamily/index.js +0 -31
  319. package/dist-cjs/components/elements/StoreModalFamilyButton/index.js +0 -45
  320. package/dist-cjs/components/elements/StoreModalIndexItem/index.js +0 -35
  321. package/dist-cjs/components/elements/StoreModalLicenseeIsBillingIdentityElement.js +0 -59
  322. package/dist-cjs/components/elements/StoreModalLoadingScreen/index.js +0 -14
  323. package/dist-cjs/components/elements/StoreModalPageContainer/index.js +0 -22
  324. package/dist-cjs/components/elements/StoreModalStyleButton/index.js +0 -37
  325. package/dist-cjs/components/elements/StoreModalUnifiedCheckout.js +0 -753
  326. package/dist-cjs/components/useConsent.js +0 -26
  327. package/dist-cjs/components/useFont.js +0 -76
  328. package/dist-cjs/components/useFontStyle.js +0 -58
  329. package/dist-cjs/components/useInterval.js +0 -28
  330. package/dist-cjs/components/useTotalStyles.js +0 -26
  331. package/dist-cjs/config.js +0 -27
  332. package/dist-cjs/corsError.js +0 -89
  333. package/dist-cjs/data/unicodeData.js +0 -1
  334. package/dist-cjs/fontLoader.js +0 -55
  335. package/dist-cjs/global-shim.js +0 -12
  336. package/dist-cjs/hooks/useAutofit.js +0 -114
  337. package/dist-cjs/hooks/useLicenseAndOrderVariables.js +0 -25
  338. package/dist-cjs/hooks/useRefetchOnLicenseChanges.js +0 -60
  339. package/dist-cjs/hooks.js +0 -18
  340. package/dist-cjs/index.js +0 -18
  341. package/dist-cjs/package.json +0 -1
  342. package/dist-cjs/react-ranger.d.js +0 -1
  343. package/dist-cjs/react-ranger.js +0 -301
  344. package/dist-cjs/reducer.js +0 -291
  345. package/dist-cjs/relay/environment.js +0 -148
  346. package/dist-cjs/relay/loadSerializableQuery.js +0 -57
  347. package/dist-cjs/relay/useSerializablePreloadedQuery.js +0 -52
  348. package/dist-cjs/retryImport.js +0 -24
  349. package/dist-cjs/scripts/updateUnicodeData.js +0 -49
  350. package/dist-cjs/utils.js +0 -107
  351. package/dist-cjs/vanilla/FontStyle.js +0 -58
  352. package/dist-cjs/vanilla/TruncatedMarkdown.js +0 -28
@@ -1,291 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.collectionSkuIdWithDiscount = void 0;
7
- Object.defineProperty(exports, "collectionSkuIdsDifferences", {
8
- enumerable: true,
9
- get: function () {
10
- return _utils.collectionSkuIdsDifferences;
11
- }
12
- });
13
- exports.createDefaultStore = createDefaultStore;
14
- exports.default = void 0;
15
- Object.defineProperty(exports, "isSelected", {
16
- enumerable: true,
17
- get: function () {
18
- return _utils.isSelected;
19
- }
20
- });
21
- var _productState = require("./components/Root/productState");
22
- var _redux = require("redux");
23
- var _reactRedux = require("react-redux");
24
- var _utils = require("./utils");
25
- var _ConfigContext = require("./components/ConfigContext");
26
- const unselectLicense = (state, action) => {
27
- if (!(action.type === 'PRECART_UNSELECT_LICENSE' || action.type === 'PRECART_TOGGLE_LICENSE')) return state;
28
- return {
29
- ...state,
30
- licenseOptions: state.licenseOptions.filter(option => option.licenseId !== action.licenseId)
31
- };
32
- };
33
- const selectLicense = (state, action) => {
34
- if (!(action.type === 'PRECART_SELECT_LICENSE' || action.type === 'PRECART_TOGGLE_LICENSE')) return state;
35
- const existingLicenseOption = state.licenseOptions.findIndex(option => option.licenseId === action.licenseOptionSpec.licenseId);
36
- if (existingLicenseOption >= 0) return state;
37
- return {
38
- ...state,
39
- licenseOptions: state.licenseOptions.concat(action.licenseOptionSpec)
40
- };
41
- };
42
- const toggleLicense = (state, action) => {
43
- if (action.type !== 'PRECART_TOGGLE_LICENSE') return state;
44
- const {
45
- licenseOptions
46
- } = state;
47
- const existingLicenseOption = licenseOptions.findIndex(option => option.licenseId === action.licenseOptionSpec.licenseId);
48
- if (existingLicenseOption >= 0 && !action.checked) {
49
- return unselectLicense(state, action);
50
- } else if (existingLicenseOption === -1 && action.checked) {
51
- return selectLicense(state, action);
52
- }
53
- return state;
54
- };
55
- const selectLicenseOption = (state, action) => {
56
- if (action.type !== 'PRECART_SELECT_LICENSE_OPTION') return state;
57
- const {
58
- licenseId,
59
- variableId,
60
- optionId
61
- } = action;
62
- const {
63
- licenseOptions
64
- } = state;
65
- return {
66
- ...state,
67
- licenseOptions: licenseOptions.map(option => {
68
- if (option.licenseId === licenseId) {
69
- return {
70
- ...option,
71
- licenseOptions: {
72
- ...option.licenseOptions,
73
- [variableId]: optionId
74
- }
75
- };
76
- }
77
- return option;
78
- })
79
- };
80
- };
81
- const collectionSkuIdWithDiscount = (state, skuId) => {
82
- const differences = (0, _utils.collectionSkuIdsDifferences)(state, skuId);
83
- const collectionId = Object.keys(differences).filter(collSkuId => differences[collSkuId] <= state.skuPrices[skuId]).reduce((smallest, key) => {
84
- if (!smallest || differences[key] < differences[smallest]) return key;
85
- if (differences[key] === differences[smallest]) {
86
- // When differences are equal, prefer a collection that is not the
87
- // SKU being selected — this ensures collection bundles are preferred
88
- // over selecting the family itself at the same price
89
- if (smallest === skuId && key !== skuId) return key;
90
- // Among non-self candidates, prefer the one covering more unique
91
- // font styles — this ensures the most comprehensive collection wins
92
- if (smallest !== skuId && key !== skuId) {
93
- const smallestStyles = new Set(state.collectionStyleSkus[smallest]?.fontStyleSkuIds).size;
94
- const keyStyles = new Set(state.collectionStyleSkus[key]?.fontStyleSkuIds).size;
95
- if (keyStyles > smallestStyles) return key;
96
- }
97
- }
98
- return smallest;
99
- }, null);
100
- if (collectionId) return [collectionId, differences[collectionId]];
101
- return [null, null];
102
- };
103
- exports.collectionSkuIdWithDiscount = collectionSkuIdWithDiscount;
104
- const selectedCollectionSkuIdContainingSkuId = (state, skuId) => Object.keys(state.selectedSkuIds).filter(id => state.selectedSkuIds[id] === true).find(selectedSkuId => (0, _utils.collTransitivelyContainsSkuId)(state.collectionStyleSkus, selectedSkuId, skuId));
105
- const setKeysFalse = (acc, key) => {
106
- acc[key] = false;
107
- return acc;
108
- };
109
- const unselectedMembersSkuIds = (state, action) => {
110
- if (action.type !== 'SELECT_SKU_ID') throw new Error('Wrong action ${action.type}');
111
- const {
112
- skuId,
113
- selected
114
- } = action;
115
- if (!selected) return {}; // only do this in case we are selecting something
116
-
117
- // Recursively collect all descendant SKU IDs so that transitive
118
- // selections (e.g., collection bundle → family → bundle) are all
119
- // marked as false
120
- const result = {};
121
- const collectMembers = collSkuId => {
122
- const members = state.collectionStyleSkus[collSkuId];
123
- if (!members) return;
124
- for (const id of members.fontStyleSkuIds) {
125
- result[id] = false;
126
- }
127
- for (const id of members.childrenSkuIds) {
128
- result[id] = false;
129
- collectMembers(id);
130
- }
131
- };
132
- collectMembers(skuId);
133
- return result;
134
- };
135
- const selectSkuId = (state, action) => {
136
- if (action.type !== 'SELECT_SKU_ID') return state;
137
- const {
138
- skuId,
139
- selected
140
- } = action;
141
- let actualSkuId = skuId;
142
- if (selected) {
143
- // check if selecting any collections instead of this sku
144
- // would reduce the selection price
145
- const [collectionSkuId, _amount] = collectionSkuIdWithDiscount(state, skuId);
146
- actualSkuId = collectionSkuId || actualSkuId;
147
- } else if (state.selectedSkuIds[skuId] === false) {
148
- // we're clicking "deselect" on an item that's not actually selected,
149
- // it's a member of a collection which is selected. in this case
150
- // we'll find the collection and deselect that collection instead
151
- const parentId = selectedCollectionSkuIdContainingSkuId(state, skuId);
152
- if (parentId) actualSkuId = parentId;
153
- }
154
- return {
155
- ...state,
156
- precartOpen: true,
157
- selectedSkuIds: {
158
- ...state.selectedSkuIds,
159
- [actualSkuId]: selected,
160
- ...unselectedMembersSkuIds(state, {
161
- ...action,
162
- skuId: actualSkuId,
163
- selected
164
- })
165
- }
166
- };
167
- };
168
- const unselectSkus = state => ({
169
- ...state,
170
- selectedSkuIds: {}
171
- });
172
- const storeModalNavigate = (state, action) => {
173
- if (action.type !== 'STORE_MODAL_NAVIGATE') return state;
174
- if (state.storeModalRoute.name === action.route && (0, _reactRedux.shallowEqual)(state.storeModalRoute.variables, action.variables)) {
175
- return state;
176
- }
177
- return {
178
- ...state,
179
- storeModalRoute: {
180
- name: action.route,
181
- variables: action.variables
182
- },
183
- storeModalHistory: state.storeModalHistory.concat(state.storeModalRoute)
184
- };
185
- };
186
- const storeModalReplace = (state, action) => {
187
- if (action.type !== 'STORE_MODAL_REPLACE') return state;
188
- return {
189
- ...state,
190
- storeModalRoute: {
191
- name: action.route,
192
- variables: action.variables
193
- }
194
- };
195
- };
196
- const storeModalBack = state => {
197
- const history = state.storeModalHistory;
198
- if (history.length < 1) return state;
199
- const previousRoute = history[history.length - 1];
200
- return {
201
- ...state,
202
- storeModalRoute: previousRoute,
203
- storeModalHistory: history.slice(0, history.length - 1)
204
- };
205
- };
206
- const updateOrderVariableSelections = (state, action) => {
207
- if (action.type !== 'UPDATE_ORDER_VARIABLE_SELECTIONS') return state;
208
- return {
209
- ...state,
210
- orderVariableSelections: action.selections
211
- };
212
- };
213
- const reducer = (state, action) => {
214
- if (!state) throw 'Reducer called without state';
215
- switch (action.type) {
216
- case 'POPULATE_PRODUCT_STATE':
217
- return (0, _productState.populateProductStateReducer)(state, action);
218
- case 'PRECART_TOGGLE_LICENSE':
219
- return toggleLicense(state, action);
220
- case 'PRECART_UNSELECT_LICENSE':
221
- return unselectLicense(state, action);
222
- case 'PRECART_SELECT_LICENSE':
223
- return selectLicense(state, action);
224
- case 'PRECART_SELECT_LICENSE_OPTION':
225
- return selectLicenseOption(state, action);
226
- case 'SELECT_SKU_ID':
227
- return selectSkuId(state, action);
228
- case 'UNSELECT_SKUS':
229
- return unselectSkus(state);
230
- case 'OPEN_PRECART':
231
- return {
232
- ...state,
233
- precartOpen: true
234
- };
235
- case 'CLOSE_PRECART':
236
- return {
237
- ...state,
238
- precartOpen: false
239
- };
240
- case 'OPEN_CART':
241
- return {
242
- ...state,
243
- cartOpen: true
244
- };
245
- case 'CLOSE_CART':
246
- return {
247
- ...state,
248
- cartOpen: false
249
- };
250
- case 'STORE_MODAL_NAVIGATE':
251
- return storeModalNavigate(state, action);
252
- case 'STORE_MODAL_REPLACE':
253
- return storeModalReplace(state, action);
254
- case 'STORE_MODAL_BACK':
255
- return storeModalBack(state);
256
- case 'UPDATE_ORDER_VARIABLE_SELECTIONS':
257
- return updateOrderVariableSelections(state, action);
258
- case 'UPDATE_LICENSEE_IS_BILLING_IDENTITY':
259
- return {
260
- ...state,
261
- licenseeIsBillingIdentity: action.value
262
- };
263
- default:
264
- return state;
265
- }
266
- };
267
- function createDefaultStore(config) {
268
- const configValue = (0, _ConfigContext.makeConfig)(config);
269
- return (0, _redux.createStore)(reducer, {
270
- selectedSkuIds: {},
271
- // { [skuId]: Boolean }
272
- licenseOptions: [],
273
- cartOpen: false,
274
- precartOpen: false,
275
- collectionStyleSkus: {},
276
- skuPrices: {},
277
- collectionSkus: {},
278
- fetchedCollectionIds: [],
279
- storeModalRoute: {
280
- name: 'index',
281
- variables: {
282
- excludeTags: configValue.storeModal.indexExcludeTags
283
- }
284
- },
285
- storeModalHistory: [],
286
- orderVariableSelections: [],
287
- licenseeIsBillingIdentity: null
288
- });
289
- }
290
- var _default = reducer;
291
- exports.default = _default;
@@ -1,148 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createEnvironment = createEnvironment;
7
- exports.createNetworkFetch = createNetworkFetch;
8
- exports.responseCache = exports.networkFetch = void 0;
9
- exports.useCurrentEnvironment = useCurrentEnvironment;
10
- var _relayRuntime = require("relay-runtime");
11
- var _corsError = require("../corsError");
12
- var _config = require("../config");
13
- var _package = _interopRequireDefault(require("../../package.json"));
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- // @ts-ignore - JSON default import (ESM named imports from JSON require
16
- // import attributes which aren't supported consistently across bundlers).
17
-
18
- const version = _package.default.version;
19
- const IS_SERVER = typeof window === typeof undefined;
20
-
21
- // Read env from either process.env (Node/Next.js) or import.meta.env (Vite/Astro).
22
- // Prefer the framework-agnostic FONTDUE_URL name; fall back to NEXT_PUBLIC_FONTDUE_URL
23
- // for backwards compatibility with existing Next.js integrations.
24
- function readEnv(name) {
25
- if (typeof process !== 'undefined' && process.env) {
26
- const v = process.env[name];
27
- if (v != null && v !== '') return v;
28
- }
29
- try {
30
- // @ts-ignore - import.meta.env is Vite/Astro-specific
31
- const metaEnv = typeof undefined !== 'undefined' ? undefined.env : undefined;
32
- if (metaEnv) {
33
- const v = metaEnv[name] ?? metaEnv[`PUBLIC_${name}`];
34
- if (v != null && v !== '') return v;
35
- }
36
- } catch {}
37
- return undefined;
38
- }
39
-
40
- // On Next.js client bundles, only LITERAL `process.env.NAME` accesses get
41
- // inlined at build time — `process.env[dynamicName]` stays as a runtime
42
- // lookup that returns undefined in the browser. Check literal references
43
- // first so existing Next.js consumers keep working without changes.
44
- const NEXT_PUBLIC_URL = typeof process !== 'undefined' && process.env ? process.env.NEXT_PUBLIC_FONTDUE_URL : undefined;
45
- const NEXT_PUBLIC_STRIPE = typeof process !== 'undefined' && process.env ? process.env.NEXT_PUBLIC_FONTDUE_STRIPE_INTEGRATION : undefined;
46
- const FONTDUE_URL = readEnv('FONTDUE_URL') ?? readEnv('NEXT_PUBLIC_FONTDUE_URL') ?? NEXT_PUBLIC_URL;
47
- const STRIPE_INTEGRATION = readEnv('FONTDUE_STRIPE_INTEGRATION') ?? readEnv('NEXT_PUBLIC_FONTDUE_STRIPE_INTEGRATION') ?? NEXT_PUBLIC_STRIPE;
48
- const CACHE_TTL = 10 * 1000; // 10 seconds, to resolve preloaded results
49
-
50
- function createNetworkFetch(options) {
51
- return async function networkFetch(request, variables) {
52
- const base = options?.url ?? (0, _config.getConfig)().url ?? FONTDUE_URL;
53
- if (IS_SERVER && (base == null || base === '')) {
54
- throw new Error('fontdue-js: no Fontdue URL configured for server-side fetch. ' + 'Call configure({ url }) at app startup, set FONTDUE_URL in your environment, ' + 'or pass `url` explicitly to loadSerializableQuery / createEnvironment.');
55
- }
56
- const url = `${base ?? ''}/graphql`;
57
- let resp;
58
- try {
59
- resp = await fetch(url + `?queryName=${request.name}`, {
60
- method: 'POST',
61
- credentials: 'include',
62
- headers: {
63
- Accept: 'application/json',
64
- 'Content-Type': 'application/json',
65
- 'fontdue-stripe-integration': options?.stripeIntegration ?? (0, _config.getConfig)().stripeIntegration ?? STRIPE_INTEGRATION ?? 'dynamic',
66
- 'fontdue-client-version': version
67
- },
68
- body: JSON.stringify({
69
- query: request.text,
70
- variables
71
- }),
72
- // @ts-ignore
73
- next: {
74
- tags: ['graphql', `operation:${request.name}`]
75
- }
76
- });
77
- } catch (error) {
78
- if ((0, _corsError.handlePossibleCorsError)(error, url)) {
79
- return {
80
- data: undefined,
81
- errors: [{
82
- message: 'Cross-origin request blocked'
83
- }]
84
- };
85
- }
86
- throw error;
87
- }
88
- const json = await resp.json();
89
-
90
- // GraphQL returns exceptions (for example, a missing required variable) in the "errors"
91
- // property of the response. If any exceptions occurred when processing the request,
92
- // throw an error to indicate to the developer what went wrong.
93
- if (Array.isArray(json.errors)) {
94
- const error = json.errors?.[0];
95
- console.error('GraphQL Error:', {
96
- message: error.message,
97
- code: error.extensions?.code,
98
- path: error.path
99
- });
100
- }
101
- return json;
102
- };
103
- }
104
- const networkFetch = createNetworkFetch();
105
- exports.networkFetch = networkFetch;
106
- const responseCache = IS_SERVER ? null : new _relayRuntime.QueryResponseCache({
107
- size: 250,
108
- ttl: CACHE_TTL
109
- });
110
- exports.responseCache = responseCache;
111
- function createNetwork(options) {
112
- async function fetchResponse(params, variables, cacheConfig) {
113
- const isQuery = params.operationKind === 'query';
114
- // @ts-ignore
115
- const cacheKey = params.id ?? params.cacheID;
116
- const forceFetch = cacheConfig && cacheConfig.force;
117
- if (responseCache != null && isQuery && !forceFetch) {
118
- const fromCache = responseCache.get(cacheKey, variables);
119
- if (fromCache != null) {
120
- return Promise.resolve(fromCache);
121
- }
122
- }
123
- return createNetworkFetch(options)(params, variables);
124
- }
125
- const network = _relayRuntime.Network.create(fetchResponse);
126
- return network;
127
- }
128
- function createEnvironment(options) {
129
- return new _relayRuntime.Environment({
130
- network: createNetwork(options),
131
- store: new _relayRuntime.Store(_relayRuntime.RecordSource.create()),
132
- isServer: IS_SERVER
133
- });
134
- }
135
-
136
- // Client-side Relay environment is a module-level singleton so multiple
137
- // FontdueProviders on a page (e.g. one per Astro island) share cache and
138
- // data. Server-side stays per-render to avoid cross-request pollution.
139
- let clientEnvironment = null;
140
- function useCurrentEnvironment(options) {
141
- if (IS_SERVER) {
142
- return createEnvironment(options);
143
- }
144
- if (clientEnvironment == null) {
145
- clientEnvironment = createEnvironment(options);
146
- }
147
- return clientEnvironment;
148
- }
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = loadSerializableQuery;
7
- var _environment = require("./environment");
8
- /**
9
- * RELAY CACHE KEY NORMALIZATION
10
- *
11
- * This type transformation is required to fix a cache key inconsistency issue in Relay.
12
- *
13
- * THE PROBLEM:
14
- * Relay's `getOperationVariables()` function always includes ALL argumentDefinitions
15
- * from the GraphQL operation, even optional ones, setting them to their defaultValue
16
- * (typically null). This means when Relay generates cache keys, it creates entries like:
17
- *
18
- * Cache Key A: { collectionId: "123", tags: null, excludeTags: null, selectable: true }
19
- * Cache Key B: { collectionId: "123", selectable: true } // when optional vars omitted
20
- *
21
- * Even though these represent the same logical query, they produce different cache keys
22
- * because `JSON.stringify(stableCopy(variables))` serializes them differently.
23
- *
24
- * (This is possibly caused by NextJS RSC data serialization and hydration)
25
- *
26
- * THE ROOT CAUSE:
27
- * - GraphQL schema defines: `$tags: [String!], $excludeTags: [String!]` (optional)
28
- * - TypeScript generates: `tags?: ReadonlyArray<string> | null`
29
- * - Relay's argumentDefinitions include: `{ name: "tags", defaultValue: null }`
30
- * - getOperationVariables() always sets: `operationVariables[def.name] = def.defaultValue`
31
- *
32
- * THE SOLUTION:
33
- * RequireAllWithNull<T> transforms optional properties to required properties with
34
- * explicit null values, forcing callers to be consistent. This ensures server-side
35
- * preloaded queries and client-side cache lookups use identical variable structures.
36
- *
37
- * USAGE:
38
- * Instead of: { tags, excludeTags } // undefined values
39
- * Use: { tags: tags ?? null, excludeTags: excludeTags ?? null } // explicit nulls
40
- *
41
- * This eliminates cache misses caused by variable structure inconsistencies between
42
- * server-side rendering and client-side Relay operations.
43
- */
44
-
45
- // Call into raw network fetch to get serializable GraphQL query response
46
- // This response will be sent to the client to "warm" the QueryResponseCache
47
- // to avoid the client fetches.
48
- async function loadSerializableQuery(query, variables, options) {
49
- if (!('params' in query)) throw new Error('Params not found in query, is it a fragment instead of a query?');
50
- const fetcher = (0, _environment.createNetworkFetch)(options);
51
- const response = await fetcher(query.params, variables);
52
- return {
53
- params: query.params,
54
- variables,
55
- response
56
- };
57
- }
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = useSerializablePreloadedQuery;
7
- var _react = require("react");
8
- var _reactRelay = require("react-relay");
9
- var _relayRuntime = require("relay-runtime");
10
- var _environment = require("./environment");
11
- // Convert preloaded query object (with raw GraphQL Response) into
12
- // Relay's PreloadedQuery.
13
-
14
- // This hook converts a serializable preloaded query into Relay's PreloadedQuery
15
- // object. It primes Relay so that `usePreloadedQuery` resolves synchronously on
16
- // both server and client:
17
- // - On the client, it warms the QueryResponseCache so network-layer lookups hit.
18
- // - When a `query` tagged node is provided, it also commits the response
19
- // payload directly into the environment's Store via `commitPayload`. This is
20
- // required for SSR frameworks (Astro, Vite SSR, etc.) whose non-streaming
21
- // `renderToString` needs the data available synchronously during render.
22
- function useSerializablePreloadedQuery(preloadQuery, fetchPolicy = "store-or-network", query) {
23
- const environment = (0, _reactRelay.useRelayEnvironment)();
24
- (0, _react.useMemo)(() => {
25
- writePreloadedQueryToCache(preloadQuery);
26
- if (query != null) {
27
- const response = preloadQuery.response;
28
- const singular = Array.isArray(response) ? response[0] : response;
29
- if (singular?.data != null) {
30
- const operation = (0, _relayRuntime.createOperationDescriptor)((0, _relayRuntime.getRequest)(query), preloadQuery.variables);
31
- environment.commitPayload(operation, singular.data);
32
- }
33
- }
34
- }, [preloadQuery, environment, query]);
35
- return {
36
- environment,
37
- fetchKey: preloadQuery.params.id ?? preloadQuery.params.cacheID,
38
- fetchPolicy,
39
- isDisposed: false,
40
- name: preloadQuery.params.name,
41
- kind: "PreloadedQuery",
42
- variables: preloadQuery.variables,
43
- dispose: () => {
44
- return;
45
- }
46
- };
47
- }
48
- function writePreloadedQueryToCache(preloadedQueryObject) {
49
- // @ts-ignore
50
- const cacheKey = preloadedQueryObject.params.id ?? preloadedQueryObject.params.cacheID;
51
- _environment.responseCache?.set(cacheKey, preloadedQueryObject.variables, preloadedQueryObject.response);
52
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = retryImport;
7
- /**
8
- * Wraps a dynamic import in retry logic.
9
- *
10
- * Retries the factory up to `retries` times with a delay between attempts.
11
- * Re-invoking the factory works on Safari (which doesn't cache module-map
12
- * failures) and handles transient network blips on all browsers. Chrome and
13
- * Firefox cache failed module fetches in the module map, so retries of the
14
- * same specifier may return the cached rejection without a network request;
15
- * the delay helps partially mitigate that, but is not a guaranteed fix.
16
- *
17
- * See: https://github.com/whatwg/html/issues/6768
18
- */
19
- function retryImport(load, retries = 2, delay = 1000) {
20
- return load().catch(error => {
21
- if (retries === 0) throw error;
22
- return new Promise(resolve => setTimeout(resolve, delay)).then(() => retryImport(load, retries - 1, delay));
23
- });
24
- }
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- const https = require('https');
4
- const fs = require('fs');
5
- const path = require('path');
6
-
7
- // URL from which to fetch the Unicode data
8
- const UNICODE_DATA_URL = 'https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt';
9
-
10
- // Function to fetch the Unicode data
11
- function fetchUnicodeData() {
12
- return new Promise((resolve, reject) => {
13
- https.get(UNICODE_DATA_URL, res => {
14
- let data = '';
15
- res.on('data', chunk => data += chunk);
16
- res.on('end', () => resolve(data));
17
- }).on('error', err => reject(err));
18
- });
19
- }
20
-
21
- // Function to parse the Unicode data and convert it into the desired JSON format
22
- function parseAndConvertData(data) {
23
- const lines = data.split('\n');
24
- const result = {};
25
- lines.forEach(line => {
26
- const parts = line.split(';');
27
- if (parts.length > 1) {
28
- const code = parseInt(parts[0], 16);
29
- const name = parts[1].toLowerCase().replace(/\b\w/g, char => char.toUpperCase());
30
- result[code] = name;
31
- }
32
- });
33
- return result;
34
- }
35
-
36
- // Main function to fetch, parse, and write the Unicode data to a JSON file
37
- async function main() {
38
- try {
39
- const data = await fetchUnicodeData();
40
- const jsonData = parseAndConvertData(data);
41
- fs.writeFileSync(path.join(__dirname, '../data/unicodeData.ts'), `const data: { [code: string]: string} = ${JSON.stringify(jsonData)}; export default data;`);
42
- console.log('unicode data has been written to unicodeData.ts');
43
- } catch (error) {
44
- console.error('Error:', error);
45
- }
46
- }
47
-
48
- // Run the main function
49
- main();