fontdue-js 2.22.0 → 2.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/components/ConfigContext.d.ts +3 -0
- package/dist/components/ConfigContext.js +2 -1
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.js +2 -0
- package/dist/corsError.d.ts +1 -0
- package/dist/corsError.js +16 -9
- package/dist/global-shim.d.ts +1 -0
- package/dist/global-shim.js +8 -0
- package/dist/relay/environment.js +51 -42
- package/dist-cjs/__generated__/AddToCartBannerQuery.graphql.js +194 -0
- package/dist-cjs/__generated__/AddToCartBanner_item.graphql.js +107 -0
- package/dist-cjs/__generated__/AddToCartBanner_order.graphql.js +131 -0
- package/dist-cjs/__generated__/AddressFieldsRefetchQuery.graphql.js +170 -0
- package/dist-cjs/__generated__/AddressFields_viewer.graphql.js +125 -0
- package/dist-cjs/__generated__/BuyButtonIDQuery.graphql.js +121 -0
- package/dist-cjs/__generated__/BuyButtonSlugQuery.graphql.js +146 -0
- package/dist-cjs/__generated__/BuyButton_collection.graphql.js +56 -0
- package/dist-cjs/__generated__/CartButtonQuery.graphql.js +139 -0
- package/dist-cjs/__generated__/CartButton_order.graphql.js +71 -0
- package/dist-cjs/__generated__/CartItemAdditionalLicenses_licenses.graphql.js +42 -0
- package/dist-cjs/__generated__/CartItemAdditionalLicenses_orderItem.graphql.js +52 -0
- package/dist-cjs/__generated__/CartItemLicense_selection.graphql.js +80 -0
- package/dist-cjs/__generated__/CartItemProduct_product.graphql.js +113 -0
- package/dist-cjs/__generated__/CartItemVariable_selection.graphql.js +107 -0
- package/dist-cjs/__generated__/CartItemVariable_variable.graphql.js +58 -0
- package/dist-cjs/__generated__/CartItem_node.graphql.js +166 -0
- package/dist-cjs/__generated__/CartOrderCompleteOrderMutation.graphql.js +783 -0
- package/dist-cjs/__generated__/CartOrderRemoveDiscountMutation.graphql.js +760 -0
- package/dist-cjs/__generated__/CartOrderUpdateMutation.graphql.js +795 -0
- package/dist-cjs/__generated__/CartOrder_UpdateErrors.graphql.js +43 -0
- package/dist-cjs/__generated__/CartOrder_order.graphql.js +264 -0
- package/dist-cjs/__generated__/CartOrder_viewer.graphql.js +51 -0
- package/dist-cjs/__generated__/CartQuery.graphql.js +887 -0
- package/dist-cjs/__generated__/CartStateRemoveDiscountMutation.graphql.js +422 -0
- package/dist-cjs/__generated__/CartStateUpdateMutation.graphql.js +790 -0
- package/dist-cjs/__generated__/CartState_order.graphql.js +122 -0
- package/dist-cjs/__generated__/CartTotals_order.graphql.js +140 -0
- package/dist-cjs/__generated__/CharacterViewerIDQuery.graphql.js +332 -0
- package/dist-cjs/__generated__/CharacterViewerSlugQuery.graphql.js +362 -0
- package/dist-cjs/__generated__/CharacterViewerStyleRefetchQuery.graphql.js +226 -0
- package/dist-cjs/__generated__/CharacterViewer_collection.graphql.js +197 -0
- package/dist-cjs/__generated__/CharacterViewer_family.graphql.js +101 -0
- package/dist-cjs/__generated__/CharacterViewer_style.graphql.js +161 -0
- package/dist-cjs/__generated__/CheckoutUpdateCustomerMutation.graphql.js +770 -0
- package/dist-cjs/__generated__/CheckoutUpdateOrderMutation.graphql.js +811 -0
- package/dist-cjs/__generated__/Checkout_UpdateOrderErrors.graphql.js +97 -0
- package/dist-cjs/__generated__/Checkout_identity.graphql.js +94 -0
- package/dist-cjs/__generated__/Checkout_order.graphql.js +144 -0
- package/dist-cjs/__generated__/Checkout_viewer.graphql.js +74 -0
- package/dist-cjs/__generated__/CollectionAa_Query.graphql.js +192 -0
- package/dist-cjs/__generated__/CollectionAa_product.graphql.js +69 -0
- package/dist-cjs/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +432 -0
- package/dist-cjs/__generated__/CouponText_coupon.graphql.js +73 -0
- package/dist-cjs/__generated__/CustomerLoginFormLoginMutation.graphql.js +72 -0
- package/dist-cjs/__generated__/CustomerLoginFormQuery.graphql.js +91 -0
- package/dist-cjs/__generated__/DownloadRefetchQuery.graphql.js +124 -0
- package/dist-cjs/__generated__/Download_order.graphql.js +61 -0
- package/dist-cjs/__generated__/FamilyList_node.graphql.js +96 -0
- package/dist-cjs/__generated__/Family_node.graphql.js +160 -0
- package/dist-cjs/__generated__/FontFamiliesQuery.graphql.js +368 -0
- package/dist-cjs/__generated__/FontStyle_fontStyle.graphql.js +32 -0
- package/dist-cjs/__generated__/IdentityBox_identity.graphql.js +52 -0
- package/dist-cjs/__generated__/License_node.graphql.js +97 -0
- package/dist-cjs/__generated__/NewsletterSignupQuery.graphql.js +110 -0
- package/dist-cjs/__generated__/NewsletterSignupUpdateCustomerMutation.graphql.js +81 -0
- package/dist-cjs/__generated__/NodePasswordFormAccessNodeMutation.graphql.js +72 -0
- package/dist-cjs/__generated__/NodePasswordFormIDQuery.graphql.js +93 -0
- package/dist-cjs/__generated__/NodePasswordFormSlugQuery.graphql.js +115 -0
- package/dist-cjs/__generated__/OrderVariableSelectionReduxRefetchQuery.graphql.js +154 -0
- package/dist-cjs/__generated__/OrderVariableSelectionRedux_viewer.graphql.js +75 -0
- package/dist-cjs/__generated__/OrderVariableSelection_variables.graphql.js +107 -0
- package/dist-cjs/__generated__/PrecartAddToCartMutation.graphql.js +793 -0
- package/dist-cjs/__generated__/PrecartClearCartMutation.graphql.js +81 -0
- package/dist-cjs/__generated__/PrecartQuery.graphql.js +308 -0
- package/dist-cjs/__generated__/Precart_collection.graphql.js +81 -0
- package/dist-cjs/__generated__/Precart_license.graphql.js +67 -0
- package/dist-cjs/__generated__/Precart_viewer.graphql.js +161 -0
- package/dist-cjs/__generated__/PriceBarSectionRefetchQuery.graphql.js +184 -0
- package/dist-cjs/__generated__/PriceBarSection_node.graphql.js +121 -0
- package/dist-cjs/__generated__/PriceBar_node.graphql.js +60 -0
- package/dist-cjs/__generated__/Price_price.graphql.js +40 -0
- package/dist-cjs/__generated__/SKUPrice_sku.graphql.js +69 -0
- package/dist-cjs/__generated__/SelectButton_sku.graphql.js +54 -0
- package/{dist-bundle/chunks/index-o29NNufd.js → dist-cjs/__generated__/ServerConfigProviderQuery.graphql.js} +7 -30
- package/dist-cjs/__generated__/ShareCartCreateSnapshotMutation.graphql.js +84 -0
- package/dist-cjs/__generated__/SpecimenLinkQuery.graphql.js +120 -0
- package/dist-cjs/__generated__/StoreModalBundleButton_bundle.graphql.js +85 -0
- package/dist-cjs/__generated__/StoreModalCartQuery.graphql.js +1017 -0
- package/dist-cjs/__generated__/StoreModalCheckoutQuery.graphql.js +194 -0
- package/dist-cjs/__generated__/StoreModalContainerQuery.graphql.js +228 -0
- package/dist-cjs/__generated__/StoreModalDownloadRefetchQuery.graphql.js +102 -0
- package/dist-cjs/__generated__/StoreModalDownload_order.graphql.js +40 -0
- package/dist-cjs/__generated__/StoreModalFamilyButton_collection.graphql.js +135 -0
- package/dist-cjs/__generated__/StoreModalFamily_collection.graphql.js +130 -0
- package/dist-cjs/__generated__/StoreModalIndexItem_fontCollection.graphql.js +98 -0
- package/dist-cjs/__generated__/StoreModalIndexQuery.graphql.js +263 -0
- package/dist-cjs/__generated__/StoreModalOrderVariableSelection_order.graphql.js +98 -0
- package/dist-cjs/__generated__/StoreModalOrderVariableSelection_viewer.graphql.js +66 -0
- package/dist-cjs/__generated__/StoreModalProductContent_collection.graphql.js +92 -0
- package/dist-cjs/__generated__/StoreModalProductLicenseSelection_collection.graphql.js +47 -0
- package/dist-cjs/__generated__/StoreModalProductLicense_license.graphql.js +104 -0
- package/dist-cjs/__generated__/StoreModalProductQuery.graphql.js +702 -0
- package/dist-cjs/__generated__/StoreModalProductRefetchQuery.graphql.js +433 -0
- package/dist-cjs/__generated__/StoreModalProductSummaryAddToCartMutation.graphql.js +149 -0
- package/dist-cjs/__generated__/StoreModalProductSummaryClearCartMutation.graphql.js +81 -0
- package/dist-cjs/__generated__/StoreModalProductSummaryRefetchQuery.graphql.js +281 -0
- package/dist-cjs/__generated__/StoreModalProductSummary_viewer.graphql.js +243 -0
- package/dist-cjs/__generated__/StoreModalReviewIdentity_identity.graphql.js +52 -0
- package/dist-cjs/__generated__/StoreModalStyleButton_fontStyle.graphql.js +113 -0
- package/dist-cjs/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.js +302 -0
- package/dist-cjs/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +323 -0
- package/dist-cjs/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.js +473 -0
- package/dist-cjs/__generated__/StoreModalUnifiedCheckout_order.graphql.js +237 -0
- package/dist-cjs/__generated__/StoreModalUnifiedCheckout_viewer.graphql.js +117 -0
- package/dist-cjs/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.js +105 -0
- package/dist-cjs/__generated__/StripeProvider_viewer.graphql.js +139 -0
- package/dist-cjs/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +770 -0
- package/dist-cjs/__generated__/TestFontsForm_Query.graphql.js +126 -0
- package/dist-cjs/__generated__/TestModeBannerQuery.graphql.js +87 -0
- package/dist-cjs/__generated__/ThemeConfigQuery.graphql.js +87 -0
- package/dist-cjs/__generated__/TypeTesterFeaturesButton_fontStyle.graphql.js +32 -0
- package/dist-cjs/__generated__/TypeTesterFeatures_fontStyle.graphql.js +36 -0
- package/dist-cjs/__generated__/TypeTesterFloatingToolbar_testers.graphql.js +53 -0
- package/dist-cjs/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +347 -0
- package/dist-cjs/__generated__/TypeTesterStandaloneQuery.graphql.js +450 -0
- package/dist-cjs/__generated__/TypeTesterStyleSelectData_fontStyle.graphql.js +106 -0
- package/dist-cjs/__generated__/TypeTesterStyleSelectData_fontStyleData.graphql.js +88 -0
- package/dist-cjs/__generated__/TypeTesterStyleSelectData_viewer.graphql.js +166 -0
- package/dist-cjs/__generated__/TypeTesterToolbar_fontStyle.graphql.js +36 -0
- package/dist-cjs/__generated__/TypeTesterVariableAxes_fontStyle.graphql.js +61 -0
- package/dist-cjs/__generated__/TypeTester_fontStyle.graphql.js +106 -0
- package/dist-cjs/__generated__/TypeTester_viewer.graphql.js +40 -0
- package/dist-cjs/__generated__/TypeTestersChangedStylesQuery.graphql.js +347 -0
- package/dist-cjs/__generated__/TypeTestersIDQuery.graphql.js +637 -0
- package/dist-cjs/__generated__/TypeTestersRefetchQuery.graphql.js +554 -0
- package/dist-cjs/__generated__/TypeTestersSlugQuery.graphql.js +644 -0
- package/dist-cjs/__generated__/TypeTesters_collection.graphql.js +258 -0
- package/dist-cjs/__generated__/TypeTesters_viewer.graphql.js +40 -0
- package/dist-cjs/__generated__/VariableTableAmounts_option.graphql.js +34 -0
- package/dist-cjs/__generated__/VariableTableAmounts_variable.graphql.js +34 -0
- package/dist-cjs/__generated__/productState_Query.graphql.js +184 -0
- package/dist-cjs/__generated__/productState_bundle.graphql.js +79 -0
- package/dist-cjs/__generated__/productState_collection.graphql.js +90 -0
- package/dist-cjs/__generated__/productState_collectionBundle.graphql.js +88 -0
- package/dist-cjs/__generated__/productState_node.graphql.js +122 -0
- package/dist-cjs/__generated__/productState_sku.graphql.js +51 -0
- package/dist-cjs/__generated__/useFeaturesData_fontStyle.graphql.js +64 -0
- package/dist-cjs/__generated__/useFontStyle_fontStyle.graphql.js +94 -0
- package/dist-cjs/__generated__/useTotalStyles_fontCollection.graphql.js +57 -0
- package/dist-cjs/__tests__/collectionBundleSelection.test.js +1630 -0
- package/dist-cjs/components/AddToCartBanner/index.js +75 -0
- package/dist-cjs/components/BuyButton/index.js +124 -0
- package/dist-cjs/components/BuyButton/index.server.js +36 -0
- package/dist-cjs/components/BuyingOptions/index.js +23 -0
- package/dist-cjs/components/Cart/AddressFields.js +162 -0
- package/dist-cjs/components/Cart/CartItem/CartItemAdditionalLicenses.js +33 -0
- package/dist-cjs/components/Cart/CartItem/CartItemLicense.js +66 -0
- package/dist-cjs/components/Cart/CartItem/CartItemProduct.js +36 -0
- package/dist-cjs/components/Cart/CartItem/CartItemVariable.js +66 -0
- package/dist-cjs/components/Cart/CartItem/VariableTextInput.js +79 -0
- package/dist-cjs/components/Cart/CartItem/index.js +95 -0
- package/dist-cjs/components/Cart/CartOrder.js +314 -0
- package/dist-cjs/components/Cart/CartState.js +93 -0
- package/dist-cjs/components/Cart/CartTotals.js +97 -0
- package/dist-cjs/components/Cart/Checkout.js +473 -0
- package/dist-cjs/components/Cart/CheckoutSteps.js +15 -0
- package/dist-cjs/components/Cart/CouponCodeInput.js +90 -0
- package/dist-cjs/components/Cart/CustomerFields.js +80 -0
- package/dist-cjs/components/Cart/Download.js +62 -0
- package/dist-cjs/components/Cart/EmptyCart.js +42 -0
- package/dist-cjs/components/Cart/IdentityBox.js +37 -0
- package/dist-cjs/components/Cart/ShareCart.js +87 -0
- package/dist-cjs/components/Cart/index.js +36 -0
- package/dist-cjs/components/Cart/injectRelayEnvironment.js +21 -0
- package/dist-cjs/components/Cart/types.js +5 -0
- package/dist-cjs/components/Cart/utils.js +8 -0
- package/dist-cjs/components/CartButton/index.js +127 -0
- package/dist-cjs/components/CartButton/index.server.js +18 -0
- package/dist-cjs/components/CharacterViewer/StyleSelect.js +60 -0
- package/dist-cjs/components/CharacterViewer/index.js +441 -0
- package/dist-cjs/components/CharacterViewer/index.server.js +36 -0
- package/dist-cjs/components/Checkbox/index.js +27 -0
- package/dist-cjs/components/CollectionAa/index.js +38 -0
- package/dist-cjs/components/ComponentsContext.js +12 -0
- package/dist-cjs/components/ConfigContext.js +86 -0
- package/{dist-bundle/chunks/consent-DMvR5rEh.js → dist-cjs/components/ConsentBanner/consent.js} +12 -4
- package/dist-cjs/components/ConsentBanner/index.js +84 -0
- package/dist-cjs/components/CookieNotification/index.js +83 -0
- package/{dist-bundle/chunks/CorsErrorModal-C1g_-3Re.js → dist-cjs/components/CorsErrorModal.js} +19 -16
- package/dist-cjs/components/CouponText/index.js +38 -0
- package/dist-cjs/components/CustomerLoginForm/index.js +88 -0
- package/dist-cjs/components/Family/FamilyList.js +43 -0
- package/dist-cjs/components/Family/index.js +77 -0
- package/dist-cjs/components/FontFamilies/index.js +53 -0
- package/dist-cjs/components/FontStyle/index.js +37 -0
- package/dist-cjs/components/FontdueProvider/FontdueProviderClientComponent.js +74 -0
- package/dist-cjs/components/FontdueProvider/index.js +43 -0
- package/dist-cjs/components/FontdueProvider/index.server.js +35 -0
- package/dist-cjs/components/FontdueProvider/useAuxUIOwner.js +32 -0
- package/dist-cjs/components/Icons/Align.js +58 -0
- package/dist-cjs/components/Icons/ArrowDownRight.js +19 -0
- package/dist-cjs/components/Icons/ArrowLeft.js +22 -0
- package/dist-cjs/components/Icons/ArrowRight.js +19 -0
- package/dist-cjs/components/Icons/CarrotDown.js +19 -0
- package/dist-cjs/components/Icons/CarrotUp.js +19 -0
- package/dist-cjs/components/Icons/Cart.js +23 -0
- package/dist-cjs/components/Icons/CartNew.js +33 -0
- package/dist-cjs/components/Icons/Check.js +19 -0
- package/dist-cjs/components/Icons/Checkbox.js +24 -0
- package/dist-cjs/components/Icons/CheckboxChecked.js +24 -0
- package/dist-cjs/components/Icons/CheckboxCrossed.js +26 -0
- package/dist-cjs/components/Icons/CircledCheck.js +21 -0
- package/dist-cjs/components/Icons/CircledInfo.js +21 -0
- package/dist-cjs/components/Icons/CircledMinus.js +21 -0
- package/dist-cjs/components/Icons/ColorPicker.js +19 -0
- package/dist-cjs/components/Icons/CreditCard.js +21 -0
- package/dist-cjs/components/Icons/DownArrow.js +24 -0
- package/dist-cjs/components/Icons/DownloadFonts.js +25 -0
- package/dist-cjs/components/Icons/FrowningFace.js +25 -0
- package/dist-cjs/components/Icons/License.js +19 -0
- package/dist-cjs/components/Icons/Receipt.js +34 -0
- package/dist-cjs/components/Icons/User.js +19 -0
- package/dist-cjs/components/Icons/X.js +19 -0
- package/dist-cjs/components/Icons/index.js +167 -0
- package/dist-cjs/components/NewsletterSignup/NewsletterSignupElement.js +15 -0
- package/dist-cjs/components/NewsletterSignup/index.js +192 -0
- package/dist-cjs/components/NewsletterSignup/index.server.js +18 -0
- package/dist-cjs/components/NodePasswordForm/index.js +114 -0
- package/dist-cjs/components/OrderVariableSelection/OrderVariableSelectionRedux.js +66 -0
- package/dist-cjs/components/OrderVariableSelection/index.js +199 -0
- package/dist-cjs/components/Precart/License.js +70 -0
- package/dist-cjs/components/Precart/index.js +331 -0
- package/dist-cjs/components/Price/index.js +111 -0
- package/dist-cjs/components/PriceBar/PriceBarSection.js +61 -0
- package/dist-cjs/components/PriceBar/index.js +49 -0
- package/dist-cjs/components/Root/index.js +208 -0
- package/dist-cjs/components/Root/productState.js +143 -0
- package/dist-cjs/components/SKUPrice/index.js +46 -0
- package/dist-cjs/components/Select/index.js +36 -0
- package/dist-cjs/components/SelectButton/index.js +79 -0
- package/dist-cjs/components/ServerConfigProvider/index.js +39 -0
- package/dist-cjs/components/SpecimenLink/index.js +37 -0
- package/dist-cjs/components/StickyNav/index.js +80 -0
- package/dist-cjs/components/StoreModal/StoreModalBundleButton.js +47 -0
- package/dist-cjs/components/StoreModal/StoreModalCart.js +79 -0
- package/dist-cjs/components/StoreModal/StoreModalCheckout.js +24 -0
- package/dist-cjs/components/StoreModal/StoreModalCheckoutContext.js +14 -0
- package/dist-cjs/components/StoreModal/StoreModalContainer.js +117 -0
- package/dist-cjs/components/StoreModal/StoreModalDownload.js +38 -0
- package/dist-cjs/components/StoreModal/StoreModalFamily.js +58 -0
- package/dist-cjs/components/StoreModal/StoreModalFamilyButton.js +69 -0
- package/dist-cjs/components/StoreModal/StoreModalIndex.js +27 -0
- package/dist-cjs/components/StoreModal/StoreModalIndexItem.js +63 -0
- package/dist-cjs/components/StoreModal/StoreModalLicenseeIsBillingSelection.js +30 -0
- package/dist-cjs/components/StoreModal/StoreModalLoader.js +22 -0
- package/dist-cjs/components/StoreModal/StoreModalOrderVariableSelection.js +89 -0
- package/dist-cjs/components/StoreModal/StoreModalProduct.js +154 -0
- package/dist-cjs/components/StoreModal/StoreModalReviewIdentity.js +18 -0
- package/dist-cjs/components/StoreModal/StoreModalRouter.js +28 -0
- package/dist-cjs/components/StoreModal/StoreModalStyleButton.js +52 -0
- package/dist-cjs/components/StoreModal/index.js +39 -0
- package/dist-cjs/components/StoreModal/routes.js +51 -0
- package/dist-cjs/components/StoreModal/types.js +5 -0
- package/dist-cjs/components/StoreModalProductLicenseSelection/LicenseElement.js +46 -0
- package/dist-cjs/components/StoreModalProductLicenseSelection/LicenseVariableElement.js +35 -0
- package/dist-cjs/components/StoreModalProductLicenseSelection/LicenseVariableRadioElement.js +47 -0
- package/dist-cjs/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +133 -0
- package/dist-cjs/components/StoreModalProductLicenseSelection/index.js +31 -0
- package/dist-cjs/components/StoreModalProductSummary/index.js +219 -0
- package/dist-cjs/components/StripeLogo.js +17 -0
- package/dist-cjs/components/StripeProvider/index.js +172 -0
- package/dist-cjs/components/Switch/index.js +7 -0
- package/dist-cjs/components/TestFontsForm/TestFontsFormElement.js +15 -0
- package/dist-cjs/components/TestFontsForm/index.js +208 -0
- package/dist-cjs/components/TestFontsForm/index.server.js +18 -0
- package/dist-cjs/components/TestModeBanner/index.js +34 -0
- package/dist-cjs/components/TextField/index.js +42 -0
- package/dist-cjs/components/ThemeConfig/index.js +41 -0
- package/dist-cjs/components/ThemeConfig/index.server.js +17 -0
- package/{dist-bundle/chunks/index-DsvF5W13.js → dist-cjs/components/Tracking/index.js} +19 -14
- package/dist-cjs/components/TypeTester/TypeTesterAlignButtons.js +34 -0
- package/dist-cjs/components/TypeTester/TypeTesterBullet.js +23 -0
- package/dist-cjs/components/TypeTester/TypeTesterContent.js +58 -0
- package/dist-cjs/components/TypeTester/TypeTesterContext.js +166 -0
- package/dist-cjs/components/TypeTester/TypeTesterEditAll.js +36 -0
- package/dist-cjs/components/TypeTester/TypeTesterFeatures.js +133 -0
- package/dist-cjs/components/TypeTester/TypeTesterFeaturesButton.js +82 -0
- package/dist-cjs/components/TypeTester/TypeTesterFitter.js +21 -0
- package/dist-cjs/components/TypeTester/TypeTesterFloatingToolbar.js +79 -0
- package/dist-cjs/components/TypeTester/TypeTesterInput.js +72 -0
- package/dist-cjs/components/TypeTester/TypeTesterSlider.js +76 -0
- package/dist-cjs/components/TypeTester/TypeTesterStandalone.js +137 -0
- package/dist-cjs/components/TypeTester/TypeTesterStandalone.preload.js +27 -0
- package/dist-cjs/components/TypeTester/TypeTesterStandalone.server.js +26 -0
- package/dist-cjs/components/TypeTester/TypeTesterStandaloneElement.js +65 -0
- package/dist-cjs/components/TypeTester/TypeTesterState.js +133 -0
- package/dist-cjs/components/TypeTester/TypeTesterStyleSelect.js +101 -0
- package/dist-cjs/components/TypeTester/TypeTesterStyleSelectData.js +102 -0
- package/dist-cjs/components/TypeTester/TypeTesterToolbar.js +94 -0
- package/dist-cjs/components/TypeTester/TypeTesterVariableAxes.js +65 -0
- package/dist-cjs/components/TypeTester/features.js +150 -0
- package/dist-cjs/components/TypeTester/index.js +169 -0
- package/dist-cjs/components/TypeTester/types.js +14 -0
- package/dist-cjs/components/TypeTester/useFeaturesData.js +36 -0
- package/dist-cjs/components/TypeTester/useTypeTesterStyler.js +83 -0
- package/dist-cjs/components/TypeTesters/TypeTestersElement.js +33 -0
- package/dist-cjs/components/TypeTesters/index.js +271 -0
- package/dist-cjs/components/TypeTesters/index.server.js +44 -0
- package/dist-cjs/components/UrlContext.js +16 -0
- package/dist-cjs/components/VariableTableAmounts/index.js +28 -0
- package/dist-cjs/components/elements/Button/index.js +21 -0
- package/dist-cjs/components/elements/EmptyCart/index.js +30 -0
- package/dist-cjs/components/elements/StoreModalCartLayout/index.js +38 -0
- package/dist-cjs/components/elements/StoreModalContainer/StoreModalContainerContext.js +11 -0
- package/dist-cjs/components/elements/StoreModalContainer/index.js +77 -0
- package/dist-cjs/components/elements/StoreModalDownloadLayout/index.js +25 -0
- package/dist-cjs/components/elements/StoreModalFamily/index.js +31 -0
- package/dist-cjs/components/elements/StoreModalFamilyButton/index.js +45 -0
- package/dist-cjs/components/elements/StoreModalIndexItem/index.js +35 -0
- package/dist-cjs/components/elements/StoreModalLicenseeIsBillingIdentityElement.js +59 -0
- package/dist-cjs/components/elements/StoreModalLoadingScreen/index.js +14 -0
- package/dist-cjs/components/elements/StoreModalPageContainer/index.js +22 -0
- package/dist-cjs/components/elements/StoreModalStyleButton/index.js +37 -0
- package/dist-cjs/components/elements/StoreModalUnifiedCheckout.js +753 -0
- package/dist-cjs/components/useConsent.js +26 -0
- package/dist-cjs/components/useFont.js +76 -0
- package/dist-cjs/components/useFontStyle.js +58 -0
- package/dist-cjs/components/useInterval.js +28 -0
- package/dist-cjs/components/useTotalStyles.js +26 -0
- package/{dist-bundle/index.js → dist-cjs/config.js} +8 -4
- package/dist-cjs/corsError.js +89 -0
- package/dist-cjs/data/unicodeData.js +1 -0
- package/dist-cjs/fontLoader.js +55 -0
- package/dist-cjs/global-shim.js +12 -0
- package/dist-cjs/hooks/useAutofit.js +114 -0
- package/dist-cjs/hooks/useLicenseAndOrderVariables.js +25 -0
- package/dist-cjs/hooks/useRefetchOnLicenseChanges.js +60 -0
- package/dist-cjs/hooks.js +18 -0
- package/dist-cjs/index.js +18 -0
- package/dist-cjs/package.json +1 -0
- package/dist-cjs/react-ranger.d.js +1 -0
- package/dist-cjs/react-ranger.js +301 -0
- package/dist-cjs/reducer.js +291 -0
- package/dist-cjs/relay/environment.js +148 -0
- package/{dist-bundle/TypeTester.preload.js → dist-cjs/relay/loadSerializableQuery.js} +8 -26
- package/dist-cjs/relay/useSerializablePreloadedQuery.js +52 -0
- package/dist-cjs/retryImport.js +24 -0
- package/dist-cjs/scripts/updateUnicodeData.js +49 -0
- package/dist-cjs/utils.js +107 -0
- package/dist-cjs/vanilla/FontStyle.js +58 -0
- package/dist-cjs/vanilla/TruncatedMarkdown.js +28 -0
- package/package.json +1 -1
- package/dist-bundle/FontdueProvider.js +0 -6
- package/dist-bundle/FontdueProvider.js.map +0 -1
- package/dist-bundle/TypeTester.js +0 -7
- package/dist-bundle/TypeTester.js.map +0 -1
- package/dist-bundle/TypeTester.preload.js.map +0 -1
- package/dist-bundle/chunks/ComponentsContext-CmkN9J4X.js +0 -20843
- package/dist-bundle/chunks/ComponentsContext-CmkN9J4X.js.map +0 -1
- package/dist-bundle/chunks/CorsErrorModal-C1g_-3Re.js.map +0 -1
- package/dist-bundle/chunks/TypeTesterStandalone-BMWuv8Ca.js +0 -27486
- package/dist-bundle/chunks/TypeTesterStandalone-BMWuv8Ca.js.map +0 -1
- package/dist-bundle/chunks/consent-DMvR5rEh.js.map +0 -1
- package/dist-bundle/chunks/index-BNSbxp7B.js +0 -78
- package/dist-bundle/chunks/index-BNSbxp7B.js.map +0 -1
- package/dist-bundle/chunks/index-C4ak9qTL.js +0 -423
- package/dist-bundle/chunks/index-C4ak9qTL.js.map +0 -1
- package/dist-bundle/chunks/index-DsvF5W13.js.map +0 -1
- package/dist-bundle/chunks/index-o29NNufd.js.map +0 -1
- package/dist-bundle/index.js.map +0 -1
|
@@ -0,0 +1,291 @@
|
|
|
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;
|
|
@@ -0,0 +1,148 @@
|
|
|
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,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { c as createNetworkFetch } from './chunks/ComponentsContext-CmkN9J4X.js';
|
|
3
|
-
import { T as TypeTesterStandalonePreloadedQueryRenderer, n as node } from './chunks/TypeTesterStandalone-BMWuv8Ca.js';
|
|
4
|
-
import { F as FontdueProvider } from './chunks/index-C4ak9qTL.js';
|
|
5
|
-
import './index.js';
|
|
6
|
-
import 'react-dom';
|
|
1
|
+
"use strict";
|
|
7
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = loadSerializableQuery;
|
|
7
|
+
var _environment = require("./environment");
|
|
8
8
|
/**
|
|
9
9
|
* RELAY CACHE KEY NORMALIZATION
|
|
10
10
|
*
|
|
@@ -47,29 +47,11 @@ import 'react-dom';
|
|
|
47
47
|
// to avoid the client fetches.
|
|
48
48
|
async function loadSerializableQuery(query, variables, options) {
|
|
49
49
|
if (!('params' in query)) throw new Error('Params not found in query, is it a fragment instead of a query?');
|
|
50
|
-
const fetcher = createNetworkFetch(options);
|
|
50
|
+
const fetcher = (0, _environment.createNetworkFetch)(options);
|
|
51
51
|
const response = await fetcher(query.params, variables);
|
|
52
52
|
return {
|
|
53
53
|
params: query.params,
|
|
54
54
|
variables,
|
|
55
55
|
response
|
|
56
56
|
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function loadTypeTesterQuery(variables, options) {
|
|
60
|
-
return loadSerializableQuery(node, {
|
|
61
|
-
familyName: variables.familyName,
|
|
62
|
-
styleName: variables.styleName,
|
|
63
|
-
selectable: variables.selectable ?? true
|
|
64
|
-
}, options);
|
|
65
|
-
}
|
|
66
|
-
// Self-wraps with FontdueProvider so consumers don't need to. The provider
|
|
67
|
-
// state is a module-level singleton under the hood, so multiple
|
|
68
|
-
// TypeTesterPreloaded (or other *Preloaded) components on a page all share
|
|
69
|
-
// one Relay env + Redux store + auxiliary UI.
|
|
70
|
-
function TypeTesterPreloaded(props) {
|
|
71
|
-
return /*#__PURE__*/React__default.createElement(FontdueProvider, null, /*#__PURE__*/React__default.createElement(TypeTesterStandalonePreloadedQueryRenderer, props));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { TypeTesterPreloaded, loadTypeTesterQuery };
|
|
75
|
-
//# sourceMappingURL=TypeTester.preload.js.map
|
|
57
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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();
|