fontdue-js 2.28.0 → 3.0.0-alpha10
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/.babelrc.cjs +72 -0
- package/README.md +639 -93
- package/dist/__generated__/AddToCartBannerQuery.graphql.js +1 -8
- package/dist/__generated__/AddToCartBanner_item.graphql.js +1 -8
- package/dist/__generated__/AddToCartBanner_order.graphql.js +1 -8
- package/dist/__generated__/AddressFieldsRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/AddressFields_viewer.graphql.js +3 -11
- package/dist/__generated__/BuyButtonIDQuery.graphql.js +1 -8
- package/dist/__generated__/BuyButtonSlugQuery.graphql.js +1 -8
- package/dist/__generated__/BuyButton_collection.graphql.js +1 -8
- package/dist/__generated__/CartButtonQuery.graphql.js +1 -8
- package/dist/__generated__/CartButton_order.graphql.js +1 -8
- package/dist/__generated__/CartItemAdditionalLicenses_licenses.graphql.js +1 -8
- package/dist/__generated__/CartItemAdditionalLicenses_orderItem.graphql.js +1 -8
- package/dist/__generated__/CartItemLicense_selection.graphql.js +1 -8
- package/dist/__generated__/CartItemProduct_product.graphql.js +1 -8
- package/dist/__generated__/CartItemVariable_selection.graphql.js +1 -8
- package/dist/__generated__/CartItemVariable_variable.graphql.js +1 -8
- package/dist/__generated__/CartItem_node.graphql.js +1 -8
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +1 -8
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +1 -8
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +1 -8
- package/dist/__generated__/CartOrder_UpdateErrors.graphql.js +1 -8
- package/dist/__generated__/CartOrder_order.graphql.js +1 -8
- package/dist/__generated__/CartOrder_viewer.graphql.js +1 -8
- package/dist/__generated__/CartQuery.graphql.js +1 -8
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.js +1 -8
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +1 -8
- package/dist/__generated__/CartState_order.graphql.js +1 -8
- package/dist/__generated__/CartTotals_order.graphql.js +1 -8
- package/dist/__generated__/CharacterViewerIDQuery.graphql.js +1 -8
- package/dist/__generated__/CharacterViewerSlugQuery.graphql.js +1 -8
- package/dist/__generated__/CharacterViewerStyleRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/CharacterViewer_collection.graphql.js +1 -8
- package/dist/__generated__/CharacterViewer_family.graphql.js +1 -8
- package/dist/__generated__/CharacterViewer_style.graphql.js +3 -11
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +1 -8
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +1 -8
- package/dist/__generated__/Checkout_UpdateOrderErrors.graphql.js +1 -8
- package/dist/__generated__/Checkout_identity.graphql.js +1 -8
- package/dist/__generated__/Checkout_order.graphql.js +1 -8
- package/dist/__generated__/Checkout_viewer.graphql.js +1 -8
- package/dist/__generated__/CollectionAa_Query.graphql.js +1 -8
- package/dist/__generated__/CollectionAa_product.graphql.js +1 -8
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +1 -8
- package/dist/__generated__/CouponText_coupon.graphql.js +1 -8
- package/dist/__generated__/CustomerLoginFormLoginMutation.graphql.js +1 -8
- package/dist/__generated__/CustomerLoginFormQuery.graphql.js +1 -8
- package/dist/__generated__/DownloadRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/Download_order.graphql.js +1 -8
- package/dist/__generated__/FamilyList_node.graphql.js +1 -8
- package/dist/__generated__/Family_node.graphql.js +1 -8
- package/dist/__generated__/FontFamiliesQuery.graphql.js +1 -8
- package/dist/__generated__/FontStyle_fontStyle.graphql.js +1 -8
- package/dist/__generated__/FontdueAdminToolbarStaffQuery.graphql.d.ts +20 -0
- package/dist/__generated__/{TestModeBannerQuery.graphql.js → FontdueAdminToolbarStaffQuery.graphql.js} +11 -18
- package/dist/__generated__/FontdueAdminToolbarTokenMutation.graphql.d.ts +18 -0
- package/dist/__generated__/FontdueAdminToolbarTokenMutation.graphql.js +56 -0
- package/dist/__generated__/FontdueProviderQuery.graphql.d.ts +19 -0
- package/dist/__generated__/FontdueProviderQuery.graphql.js +140 -0
- package/dist/__generated__/IdentityBox_identity.graphql.js +1 -8
- package/dist/__generated__/License_node.graphql.js +1 -8
- package/dist/__generated__/NewsletterSignupQuery.graphql.js +1 -8
- package/dist/__generated__/NewsletterSignupUpdateCustomerMutation.graphql.js +1 -8
- package/dist/__generated__/NodePasswordFormAccessNodeMutation.graphql.js +1 -8
- package/dist/__generated__/NodePasswordFormIDQuery.graphql.js +1 -8
- package/dist/__generated__/NodePasswordFormSlugQuery.graphql.js +1 -8
- package/dist/__generated__/OrderVariableSelectionReduxRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/OrderVariableSelectionRedux_viewer.graphql.js +3 -11
- package/dist/__generated__/OrderVariableSelection_variables.graphql.js +1 -8
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +1 -8
- package/dist/__generated__/PrecartClearCartMutation.graphql.js +1 -8
- package/dist/__generated__/PrecartQuery.graphql.js +1 -8
- package/dist/__generated__/Precart_collection.graphql.js +1 -8
- package/dist/__generated__/Precart_license.graphql.js +1 -8
- package/dist/__generated__/Precart_viewer.graphql.js +1 -8
- package/dist/__generated__/PriceBarSectionRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/PriceBarSection_node.graphql.js +3 -11
- package/dist/__generated__/PriceBar_node.graphql.js +1 -8
- package/dist/__generated__/Price_price.graphql.js +1 -8
- package/dist/__generated__/SKUPrice_sku.graphql.js +1 -8
- package/dist/__generated__/SelectButton_sku.graphql.js +1 -8
- package/dist/__generated__/ServerConfigProvider_viewer.graphql.d.ts +23 -0
- package/dist/__generated__/ServerConfigProvider_viewer.graphql.js +57 -0
- package/dist/__generated__/ShareCartCreateSnapshotMutation.graphql.js +1 -8
- package/dist/__generated__/SpecimenLinkQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalBundleButton_bundle.graphql.js +1 -8
- package/dist/__generated__/StoreModalCartQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalCheckoutQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalContainerQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalDownloadRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalDownload_order.graphql.js +1 -8
- package/dist/__generated__/StoreModalFamilyButton_collection.graphql.js +1 -8
- package/dist/__generated__/StoreModalFamily_collection.graphql.js +1 -8
- package/dist/__generated__/StoreModalIndexItem_fontCollection.graphql.js +1 -8
- package/dist/__generated__/StoreModalIndexQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalOrderVariableSelection_order.graphql.js +1 -8
- package/dist/__generated__/StoreModalOrderVariableSelection_viewer.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductContent_collection.graphql.js +3 -11
- package/dist/__generated__/StoreModalProductLicenseSelection_collection.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductLicense_license.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductSummaryAddToCartMutation.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductSummaryClearCartMutation.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductSummaryRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/StoreModalProductSummary_viewer.graphql.js +3 -11
- package/dist/__generated__/StoreModalReviewIdentity_identity.graphql.js +1 -8
- package/dist/__generated__/StoreModalStyleButton_fontStyle.graphql.js +1 -8
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.js +1 -8
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +1 -8
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.js +1 -8
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.js +1 -8
- package/dist/__generated__/StoreModalUnifiedCheckout_viewer.graphql.js +1 -8
- package/dist/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.js +1 -8
- package/dist/__generated__/StripeProvider_viewer.graphql.js +1 -8
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +1 -8
- package/dist/__generated__/TestFontsForm_Query.graphql.js +1 -8
- package/dist/__generated__/TestModeBanner_viewer.graphql.d.ts +19 -0
- package/dist/__generated__/TestModeBanner_viewer.graphql.js +36 -0
- package/dist/__generated__/ThemeConfig_viewer.graphql.d.ts +19 -0
- package/dist/__generated__/ThemeConfig_viewer.graphql.js +36 -0
- package/dist/__generated__/TypeTesterFamiliesQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTesterFamiliesStylesQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTesterFeaturesButton_fontStyle.graphql.js +1 -8
- package/dist/__generated__/TypeTesterFeatures_fontStyle.graphql.js +1 -8
- package/dist/__generated__/TypeTesterFloatingToolbar_testers.graphql.js +1 -8
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTesterStyleSelectData_fontStyle.graphql.js +1 -8
- package/dist/__generated__/TypeTesterStyleSelectData_fontStyleData.graphql.js +1 -8
- package/dist/__generated__/TypeTesterToolbar_fontStyle.graphql.js +1 -8
- package/dist/__generated__/TypeTesterVariableAxes_fontStyle.graphql.js +1 -8
- package/dist/__generated__/TypeTester_fontStyle.graphql.js +1 -8
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTestersIDQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTestersSlugQuery.graphql.js +1 -8
- package/dist/__generated__/TypeTesters_collection.graphql.js +3 -11
- package/dist/__generated__/VariableTableAmounts_option.graphql.js +1 -8
- package/dist/__generated__/VariableTableAmounts_variable.graphql.js +1 -8
- package/dist/__generated__/orderTrackingUpdateOrderTrackingMutation.graphql.js +1 -8
- package/dist/__generated__/productState_Query.graphql.js +1 -8
- package/dist/__generated__/productState_bundle.graphql.js +1 -8
- package/dist/__generated__/productState_collection.graphql.js +1 -8
- package/dist/__generated__/productState_collectionBundle.graphql.js +1 -8
- package/dist/__generated__/productState_node.graphql.js +1 -8
- package/dist/__generated__/productState_sku.graphql.js +1 -8
- package/dist/__generated__/useFeaturesData_fontStyle.graphql.js +1 -8
- package/dist/__generated__/useFontStyle_fontStyle.graphql.js +1 -8
- package/dist/__generated__/useTotalStyles_fontCollection.graphql.js +1 -8
- package/dist/__tests__/collectionBundleSelection.test.js +221 -222
- package/dist/__tests__/fontLoader.test.js +24 -26
- package/dist/__tests__/licenseExclusions.test.js +27 -30
- package/dist/__tests__/networkFetch.test.js +66 -0
- package/dist/__tests__/nextAdapter.test.js +447 -0
- package/dist/components/AddToCartBanner/index.js +19 -29
- package/dist/components/BuyButton/index.d.ts +29 -6
- package/dist/components/BuyButton/index.js +98 -57
- package/dist/components/BuyButton/index.server.d.ts +9 -2
- package/dist/components/BuyButton/index.server.js +20 -17
- package/dist/components/BuyingOptions/index.d.ts +9 -0
- package/dist/components/BuyingOptions/index.js +4 -12
- package/dist/components/Cart/AddressFields.d.ts +2 -2
- package/dist/components/Cart/AddressFields.js +25 -35
- package/dist/components/Cart/CartItem/CartItemAdditionalLicenses.d.ts +2 -2
- package/dist/components/Cart/CartItem/CartItemAdditionalLicenses.js +9 -16
- package/dist/components/Cart/CartItem/CartItemLicense.d.ts +2 -2
- package/dist/components/Cart/CartItem/CartItemLicense.js +15 -24
- package/dist/components/Cart/CartItem/CartItemProduct.d.ts +1 -1
- package/dist/components/Cart/CartItem/CartItemProduct.js +16 -23
- package/dist/components/Cart/CartItem/CartItemVariable.d.ts +3 -3
- package/dist/components/Cart/CartItem/CartItemVariable.js +16 -23
- package/dist/components/Cart/CartItem/VariableTextInput.js +13 -21
- package/dist/components/Cart/CartItem/index.d.ts +2 -2
- package/dist/components/Cart/CartItem/index.js +18 -27
- package/dist/components/Cart/CartOrder.d.ts +2 -2
- package/dist/components/Cart/CartOrder.js +102 -113
- package/dist/components/Cart/CartState.d.ts +3 -3
- package/dist/components/Cart/CartState.js +18 -25
- package/dist/components/Cart/CartTotals.d.ts +1 -1
- package/dist/components/Cart/CartTotals.js +31 -38
- package/dist/components/Cart/Checkout.d.ts +3 -3
- package/dist/components/Cart/Checkout.js +109 -118
- package/dist/components/Cart/CheckoutSteps.js +1 -8
- package/dist/components/Cart/CouponCodeInput.js +22 -32
- package/dist/components/Cart/CustomerFields.d.ts +1 -1
- package/dist/components/Cart/CustomerFields.js +21 -31
- package/dist/components/Cart/Download.d.ts +1 -1
- package/dist/components/Cart/Download.js +17 -27
- package/dist/components/Cart/EmptyCart.js +15 -23
- package/dist/components/Cart/IdentityBox.d.ts +1 -1
- package/dist/components/Cart/IdentityBox.js +12 -19
- package/dist/components/Cart/ShareCart.js +24 -32
- package/dist/components/Cart/index.js +13 -21
- package/dist/components/Cart/injectRelayEnvironment.js +5 -13
- package/dist/components/Cart/orderTracking.js +8 -15
- package/dist/components/Cart/types.d.ts +1 -1
- package/dist/components/Cart/types.js +1 -5
- package/dist/components/Cart/utils.js +2 -9
- package/dist/components/CartButton/index.d.ts +5 -8
- package/dist/components/CartButton/index.js +53 -62
- package/dist/components/CharacterViewer/StyleSelect.d.ts +1 -1
- package/dist/components/CharacterViewer/StyleSelect.js +10 -17
- package/dist/components/CharacterViewer/index.d.ts +29 -6
- package/dist/components/CharacterViewer/index.js +150 -102
- package/dist/components/CharacterViewer/index.server.d.ts +9 -2
- package/dist/components/CharacterViewer/index.server.js +21 -17
- package/dist/components/Checkbox/index.js +9 -19
- package/dist/components/CollectionAa/index.d.ts +1 -1
- package/dist/components/CollectionAa/index.js +12 -21
- package/dist/components/ComponentsContext.d.ts +1 -1
- package/dist/components/ComponentsContext.js +4 -10
- package/dist/components/ConfigContext.d.ts +13 -12
- package/dist/components/ConfigContext.js +29 -11
- package/dist/components/ConsentBanner/consent.js +6 -17
- package/dist/components/ConsentBanner/index.js +19 -29
- package/dist/components/CookieNotification/index.d.ts +13 -0
- package/dist/components/CookieNotification/index.js +23 -31
- package/dist/components/CorsErrorModal.js +13 -20
- package/dist/components/CouponText/index.d.ts +1 -1
- package/dist/components/CouponText/index.js +9 -18
- package/dist/components/CustomerLoginForm/index.js +37 -38
- package/dist/components/Family/FamilyList.d.ts +1 -1
- package/dist/components/Family/FamilyList.js +10 -17
- package/dist/components/Family/index.d.ts +1 -1
- package/dist/components/Family/index.js +37 -46
- package/dist/components/FontFamilies/index.js +18 -28
- package/dist/components/FontStyle/index.d.ts +2 -2
- package/dist/components/FontStyle/index.js +8 -15
- package/dist/components/FontdueAdminToolbar/index.d.ts +2 -0
- package/dist/components/FontdueAdminToolbar/index.js +146 -0
- package/dist/components/FontdueContextProvider/index.d.ts +18 -0
- package/dist/components/FontdueContextProvider/index.js +148 -0
- package/dist/components/FontdueProvider/index.d.ts +19 -3
- package/dist/components/FontdueProvider/index.js +75 -13
- package/dist/components/FontdueProvider/index.server.d.ts +6 -3
- package/dist/components/FontdueProvider/index.server.js +37 -21
- package/dist/components/Icons/Align.js +13 -22
- package/dist/components/Icons/ArrowDownRight.js +5 -13
- package/dist/components/Icons/ArrowLeft.js +5 -13
- package/dist/components/Icons/ArrowRight.js +5 -13
- package/dist/components/Icons/CarrotDown.js +5 -13
- package/dist/components/Icons/CarrotUp.js +5 -13
- package/dist/components/Icons/Cart.js +7 -15
- package/dist/components/Icons/CartNew.js +7 -15
- package/dist/components/Icons/Check.js +5 -13
- package/dist/components/Icons/Checkbox.js +5 -13
- package/dist/components/Icons/CheckboxChecked.js +5 -13
- package/dist/components/Icons/CheckboxCrossed.js +6 -14
- package/dist/components/Icons/CircledCheck.js +6 -14
- package/dist/components/Icons/CircledInfo.js +6 -14
- package/dist/components/Icons/CircledMinus.js +6 -14
- package/dist/components/Icons/ColorPicker.js +5 -13
- package/dist/components/Icons/CreditCard.js +6 -14
- package/dist/components/Icons/DownArrow.js +5 -13
- package/dist/components/Icons/DownloadFonts.js +8 -16
- package/dist/components/Icons/FrowningFace.js +8 -16
- package/dist/components/Icons/License.js +5 -13
- package/dist/components/Icons/Receipt.js +8 -16
- package/dist/components/Icons/User.js +5 -13
- package/dist/components/Icons/X.js +5 -13
- package/dist/components/Icons/index.d.ts +23 -23
- package/dist/components/Icons/index.js +23 -167
- package/dist/components/NewsletterSignup/NewsletterSignupElement.d.ts +1 -1
- package/dist/components/NewsletterSignup/NewsletterSignupElement.js +4 -11
- package/dist/components/NewsletterSignup/index.d.ts +11 -6
- package/dist/components/NewsletterSignup/index.js +75 -60
- package/dist/components/NewsletterSignup/index.server.d.ts +7 -2
- package/dist/components/NewsletterSignup/index.server.js +17 -14
- package/dist/components/NodePasswordForm/index.js +25 -33
- package/dist/components/OrderVariableSelection/OrderVariableSelectionRedux.d.ts +1 -1
- package/dist/components/OrderVariableSelection/OrderVariableSelectionRedux.js +18 -27
- package/dist/components/OrderVariableSelection/index.d.ts +1 -1
- package/dist/components/OrderVariableSelection/index.js +28 -36
- package/dist/components/Precart/License.d.ts +1 -1
- package/dist/components/Precart/License.js +22 -30
- package/dist/components/Precart/index.js +64 -74
- package/dist/components/Price/index.d.ts +1 -1
- package/dist/components/Price/index.js +10 -20
- package/dist/components/PriceBar/PriceBarSection.d.ts +1 -1
- package/dist/components/PriceBar/PriceBarSection.js +23 -33
- package/dist/components/PriceBar/index.d.ts +1 -1
- package/dist/components/PriceBar/index.js +13 -23
- package/dist/components/Root/index.d.ts +1 -1
- package/dist/components/Root/index.js +41 -51
- package/dist/components/Root/productState.d.ts +1 -1
- package/dist/components/Root/productState.js +20 -29
- package/dist/components/SKUPrice/index.d.ts +2 -2
- package/dist/components/SKUPrice/index.js +12 -20
- package/dist/components/Select/index.js +9 -17
- package/dist/components/SelectButton/index.d.ts +2 -2
- package/dist/components/SelectButton/index.js +20 -29
- package/dist/components/ServerConfigProvider/index.d.ts +4 -2
- package/dist/components/ServerConfigProvider/index.js +12 -20
- package/dist/components/SpecimenLink/index.js +12 -20
- package/dist/components/StickyNav/index.js +16 -26
- package/dist/components/StoreModal/StoreModalBundleButton.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalBundleButton.js +16 -23
- package/dist/components/StoreModal/StoreModalCart.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalCart.js +29 -38
- package/dist/components/StoreModal/StoreModalCheckout.js +9 -17
- package/dist/components/StoreModal/StoreModalCheckoutContext.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalCheckoutContext.js +6 -12
- package/dist/components/StoreModal/StoreModalContainer.js +25 -35
- package/dist/components/StoreModal/StoreModalDownload.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalDownload.js +14 -24
- package/dist/components/StoreModal/StoreModalFamily.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalFamily.js +14 -23
- package/dist/components/StoreModal/StoreModalFamilyButton.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalFamilyButton.js +23 -30
- package/dist/components/StoreModal/StoreModalIndex.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalIndex.js +9 -17
- package/dist/components/StoreModal/StoreModalIndexItem.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalIndexItem.js +20 -30
- package/dist/components/StoreModal/StoreModalLicenseeIsBillingSelection.js +8 -17
- package/dist/components/StoreModal/StoreModalLoader.js +6 -15
- package/dist/components/StoreModal/StoreModalOrderVariableSelection.d.ts +3 -3
- package/dist/components/StoreModal/StoreModalOrderVariableSelection.js +12 -21
- package/dist/components/StoreModal/StoreModalProduct.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalProduct.js +55 -65
- package/dist/components/StoreModal/StoreModalReviewIdentity.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalReviewIdentity.js +6 -15
- package/dist/components/StoreModal/StoreModalRouter.js +12 -22
- package/dist/components/StoreModal/StoreModalStyleButton.d.ts +1 -1
- package/dist/components/StoreModal/StoreModalStyleButton.js +20 -27
- package/dist/components/StoreModal/index.d.ts +5 -1
- package/dist/components/StoreModal/index.js +24 -20
- package/dist/components/StoreModal/routes.d.ts +4 -4
- package/dist/components/StoreModal/routes.js +18 -26
- package/dist/components/StoreModal/types.js +1 -5
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.js +12 -22
- package/dist/components/StoreModalProductLicenseSelection/LicenseVariableElement.js +7 -15
- package/dist/components/StoreModalProductLicenseSelection/LicenseVariableRadioElement.js +9 -19
- package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.d.ts +1 -1
- package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +19 -28
- package/dist/components/StoreModalProductLicenseSelection/index.d.ts +1 -1
- package/dist/components/StoreModalProductLicenseSelection/index.js +10 -17
- package/dist/components/StoreModalProductSummary/index.d.ts +1 -1
- package/dist/components/StoreModalProductSummary/index.js +45 -55
- package/dist/components/StripeLogo.js +4 -11
- package/dist/components/StripeProvider/index.d.ts +1 -1
- package/dist/components/StripeProvider/index.js +19 -29
- package/dist/components/Switch/index.js +1 -7
- package/dist/components/TestFontsForm/TestFontsFormElement.js +4 -12
- package/dist/components/TestFontsForm/index.d.ts +11 -4
- package/dist/components/TestFontsForm/index.js +80 -65
- package/dist/components/TestFontsForm/index.server.d.ts +7 -2
- package/dist/components/TestFontsForm/index.server.js +17 -14
- package/dist/components/TestModeBanner/index.d.ts +4 -1
- package/dist/components/TestModeBanner/index.js +13 -27
- package/dist/components/TextField/index.js +9 -17
- package/dist/components/ThemeConfig/index.d.ts +3 -5
- package/dist/components/ThemeConfig/index.js +12 -36
- package/dist/components/Tracking/index.js +11 -18
- package/dist/components/TypeTester/TypeTesterAlignButtons.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterAlignButtons.js +8 -16
- package/dist/components/TypeTester/TypeTesterBullet.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterBullet.js +4 -12
- package/dist/components/TypeTester/TypeTesterContent.d.ts +2 -2
- package/dist/components/TypeTester/TypeTesterContent.js +22 -21
- package/dist/components/TypeTester/TypeTesterContext.d.ts +2 -2
- package/dist/components/TypeTester/TypeTesterContext.js +10 -17
- package/dist/components/TypeTester/TypeTesterEditAll.js +10 -20
- package/dist/components/TypeTester/TypeTesterFamilies.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterFamilies.js +26 -37
- package/dist/components/TypeTester/TypeTesterFeatures.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterFeatures.js +28 -37
- package/dist/components/TypeTester/TypeTesterFeaturesButton.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterFeaturesButton.js +20 -30
- package/dist/components/TypeTester/TypeTesterFitter.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterFitter.js +5 -13
- package/dist/components/TypeTester/TypeTesterFloatingToolbar.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterFloatingToolbar.js +19 -28
- package/dist/components/TypeTester/TypeTesterInput.js +12 -22
- package/dist/components/TypeTester/TypeTesterSlider.js +7 -16
- package/dist/components/TypeTester/TypeTesterStandalone.d.ts +20 -6
- package/dist/components/TypeTester/TypeTesterStandalone.js +49 -39
- package/dist/components/TypeTester/TypeTesterStandalone.server.d.ts +6 -2
- package/dist/components/TypeTester/TypeTesterStandalone.server.js +20 -16
- package/dist/components/TypeTester/TypeTesterStandaloneElement.js +7 -16
- package/dist/components/TypeTester/TypeTesterState.d.ts +2 -2
- package/dist/components/TypeTester/TypeTesterState.js +6 -14
- package/dist/components/TypeTester/TypeTesterStyleSelect.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterStyleSelect.js +9 -17
- package/dist/components/TypeTester/TypeTesterStyleSelectData.d.ts +3 -3
- package/dist/components/TypeTester/TypeTesterStyleSelectData.js +31 -40
- package/dist/components/TypeTester/TypeTesterToolbar.d.ts +2 -2
- package/dist/components/TypeTester/TypeTesterToolbar.js +29 -39
- package/dist/components/TypeTester/TypeTesterVariableAxes.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterVariableAxes.js +16 -24
- package/dist/components/TypeTester/features.js +1 -8
- package/dist/components/TypeTester/index.d.ts +2 -2
- package/dist/components/TypeTester/index.js +45 -55
- package/dist/components/TypeTester/types.js +3 -11
- package/dist/components/TypeTester/useFeaturesData.d.ts +1 -1
- package/dist/components/TypeTester/useFeaturesData.js +7 -15
- package/dist/components/TypeTester/useTypeTesterStyler.d.ts +3 -3
- package/dist/components/TypeTester/useTypeTesterStyler.js +6 -13
- package/dist/components/TypeTesters/TypeTestersElement.js +4 -12
- package/dist/components/TypeTesters/index.d.ts +22 -5
- package/dist/components/TypeTesters/index.js +118 -71
- package/dist/components/TypeTesters/index.server.d.ts +7 -2
- package/dist/components/TypeTesters/index.server.js +20 -17
- package/dist/components/UrlContext.js +6 -12
- package/dist/components/VariableTableAmounts/index.d.ts +2 -2
- package/dist/components/VariableTableAmounts/index.js +9 -16
- package/dist/components/elements/Button/index.js +3 -11
- package/dist/components/elements/EmptyCart/index.js +10 -20
- package/dist/components/elements/StoreModalCartLayout/index.js +10 -18
- package/dist/components/elements/StoreModalContainer/StoreModalContainerContext.js +3 -9
- package/dist/components/elements/StoreModalContainer/index.js +17 -27
- package/dist/components/elements/StoreModalDownloadLayout/index.js +7 -15
- package/dist/components/elements/StoreModalFamily/index.js +8 -16
- package/dist/components/elements/StoreModalFamilyButton/index.d.ts +1 -1
- package/dist/components/elements/StoreModalFamilyButton/index.js +11 -20
- package/dist/components/elements/StoreModalIndexItem/index.js +9 -17
- package/dist/components/elements/StoreModalLicenseeIsBillingIdentityElement.js +20 -29
- package/dist/components/elements/StoreModalLoadingScreen/index.js +4 -12
- package/dist/components/elements/StoreModalPageContainer/index.js +5 -13
- package/dist/components/elements/StoreModalStyleButton/index.d.ts +1 -1
- package/dist/components/elements/StoreModalStyleButton/index.js +10 -18
- package/dist/components/elements/StoreModalUnifiedCheckout.d.ts +2 -2
- package/dist/components/elements/StoreModalUnifiedCheckout.js +114 -122
- package/dist/components/useConsent.js +4 -9
- package/dist/components/useFont.d.ts +1 -1
- package/dist/components/useFont.js +8 -15
- package/dist/components/useFontStyle.d.ts +1 -1
- package/dist/components/useFontStyle.js +12 -20
- package/dist/components/useInterval.js +5 -12
- package/dist/components/useTotalStyles.d.ts +1 -1
- package/dist/components/useTotalStyles.js +4 -12
- package/dist/corsError.js +4 -14
- package/dist/data/unicodeData.js +1 -1
- package/dist/fontLoader.js +3 -11
- package/dist/fontdue.css +127 -12
- package/dist/global-shim.d.ts +1 -0
- package/dist/global-shim.js +8 -0
- package/dist/hooks/useAutofit.js +11 -19
- package/dist/hooks/useLicenseAndOrderVariables.d.ts +2 -2
- package/dist/hooks/useLicenseAndOrderVariables.js +7 -12
- package/dist/hooks/useRefetchOnLicenseChanges.d.ts +1 -1
- package/dist/hooks/useRefetchOnLicenseChanges.js +7 -13
- package/dist/hooks/useResizeObserver.d.ts +11 -0
- package/dist/hooks/useResizeObserver.js +23 -0
- package/dist/hooks.js +9 -16
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/loadFontdueProviderQuery.d.ts +3 -0
- package/dist/loadFontdueProviderQuery.js +10 -0
- package/dist/next/config.d.ts +41 -0
- package/dist/next/config.js +193 -0
- package/dist/next/image-loader.d.ts +7 -0
- package/dist/next/image-loader.js +39 -0
- package/dist/next/index.d.ts +2 -0
- package/dist/next/index.js +10 -0
- package/dist/next/revalidate.d.ts +1 -0
- package/dist/next/revalidate.js +37 -0
- package/dist/next/tenant.d.ts +26 -0
- package/dist/next/tenant.js +169 -0
- package/dist/react-ranger.d.js +0 -1
- package/dist/react-ranger.js +17 -24
- package/dist/reducer.d.ts +5 -5
- package/dist/reducer.js +15 -36
- package/dist/relay/environment.d.ts +1 -0
- package/dist/relay/environment.js +74 -34
- package/dist/relay/loadSerializableQuery.d.ts +3 -1
- package/dist/relay/loadSerializableQuery.js +4 -8
- package/dist/relay/serverConfig.d.ts +16 -0
- package/dist/relay/serverConfig.js +38 -0
- package/dist/relay/useSerializablePreloadedQuery.d.ts +3 -3
- package/dist/relay/useSerializablePreloadedQuery.js +26 -22
- package/dist/retryImport.js +1 -7
- package/dist/scripts/updateUnicodeData.js +0 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +14 -36
- package/dist/vanilla/FontStyle.js +3 -11
- package/dist/vanilla/TruncatedMarkdown.js +2 -9
- package/dist/vite.d.ts +2 -0
- package/dist/vite.js +141 -0
- package/package.json +13 -9
- package/scripts/addJsExtensionsBabelPlugin.cjs +62 -0
- package/types/globals.d.ts +3 -0
- package/types/next-cache.d.ts +6 -0
- package/types/next-navigation.d.ts +6 -0
- package/vitest.config.ts +4 -0
- package/dist/__generated__/ServerConfigProviderQuery.graphql.d.ts +0 -24
- package/dist/__generated__/ServerConfigProviderQuery.graphql.js +0 -108
- package/dist/__generated__/TestModeBannerQuery.graphql.d.ts +0 -20
- package/dist/__generated__/ThemeConfigQuery.graphql.d.ts +0 -20
- package/dist/__generated__/ThemeConfigQuery.graphql.js +0 -87
- package/dist/components/CartButton/index.server.d.ts +0 -3
- package/dist/components/CartButton/index.server.js +0 -18
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.d.ts +0 -14
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.js +0 -61
- package/dist/components/ThemeConfig/index.server.d.ts +0 -2
- package/dist/components/ThemeConfig/index.server.js +0 -17
- package/fontdue.css +0 -2733
- package/fontdue.css.map +0 -1
package/dist/reducer.js
CHANGED
|
@@ -1,28 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
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");
|
|
1
|
+
import { populateProductStateReducer } from './components/Root/productState.js';
|
|
2
|
+
import { createStore } from 'redux';
|
|
3
|
+
import { shallowEqual } from 'react-redux';
|
|
4
|
+
import { collectionSkuIdsDifferences, collTransitivelyContainsSkuId, isSelected } from './utils.js';
|
|
5
|
+
import { makeConfig } from './components/ConfigContext.js';
|
|
6
|
+
export { collectionSkuIdsDifferences, isSelected };
|
|
26
7
|
const unselectLicense = (state, action) => {
|
|
27
8
|
if (!(action.type === 'PRECART_UNSELECT_LICENSE' || action.type === 'PRECART_TOGGLE_LICENSE')) return state;
|
|
28
9
|
return {
|
|
@@ -80,8 +61,8 @@ const selectLicenseOption = (state, action) => {
|
|
|
80
61
|
})
|
|
81
62
|
};
|
|
82
63
|
};
|
|
83
|
-
const collectionSkuIdWithDiscount = (state, skuId) => {
|
|
84
|
-
const differences =
|
|
64
|
+
export const collectionSkuIdWithDiscount = (state, skuId) => {
|
|
65
|
+
const differences = collectionSkuIdsDifferences(state, skuId);
|
|
85
66
|
const collectionId = Object.keys(differences).filter(collSkuId => differences[collSkuId] <= state.skuPrices[skuId]).reduce((smallest, key) => {
|
|
86
67
|
if (!smallest || differences[key] < differences[smallest]) return key;
|
|
87
68
|
if (differences[key] === differences[smallest]) {
|
|
@@ -103,8 +84,7 @@ const collectionSkuIdWithDiscount = (state, skuId) => {
|
|
|
103
84
|
if (collectionId) return [collectionId, differences[collectionId]];
|
|
104
85
|
return [null, null];
|
|
105
86
|
};
|
|
106
|
-
|
|
107
|
-
const selectedCollectionSkuIdContainingSkuId = (state, skuId) => Object.keys(state.selectedSkuIds).filter(id => state.selectedSkuIds[id] === true).find(selectedSkuId => (0, _utils.collTransitivelyContainsSkuId)(state.collectionStyleSkus, selectedSkuId, skuId));
|
|
87
|
+
const selectedCollectionSkuIdContainingSkuId = (state, skuId) => Object.keys(state.selectedSkuIds).filter(id => state.selectedSkuIds[id] === true).find(selectedSkuId => collTransitivelyContainsSkuId(state.collectionStyleSkus, selectedSkuId, skuId));
|
|
108
88
|
const setKeysFalse = (acc, key) => {
|
|
109
89
|
acc[key] = false;
|
|
110
90
|
return acc;
|
|
@@ -174,7 +154,7 @@ const unselectSkus = state => ({
|
|
|
174
154
|
});
|
|
175
155
|
const storeModalNavigate = (state, action) => {
|
|
176
156
|
if (action.type !== 'STORE_MODAL_NAVIGATE') return state;
|
|
177
|
-
if (state.storeModalRoute.name === action.route &&
|
|
157
|
+
if (state.storeModalRoute.name === action.route && shallowEqual(state.storeModalRoute.variables, action.variables)) {
|
|
178
158
|
return state;
|
|
179
159
|
}
|
|
180
160
|
return {
|
|
@@ -217,7 +197,7 @@ const reducer = (state, action) => {
|
|
|
217
197
|
if (!state) throw 'Reducer called without state';
|
|
218
198
|
switch (action.type) {
|
|
219
199
|
case 'POPULATE_PRODUCT_STATE':
|
|
220
|
-
return
|
|
200
|
+
return populateProductStateReducer(state, action);
|
|
221
201
|
case 'PRECART_TOGGLE_LICENSE':
|
|
222
202
|
return toggleLicense(state, action);
|
|
223
203
|
case 'PRECART_UNSELECT_LICENSE':
|
|
@@ -267,8 +247,8 @@ const reducer = (state, action) => {
|
|
|
267
247
|
return state;
|
|
268
248
|
}
|
|
269
249
|
};
|
|
270
|
-
function createDefaultStore(config) {
|
|
271
|
-
const configValue =
|
|
250
|
+
export function createDefaultStore(config) {
|
|
251
|
+
const configValue = makeConfig(config);
|
|
272
252
|
const initialRoute = configValue.storeModal.hideAllCollections ? {
|
|
273
253
|
name: 'cart'
|
|
274
254
|
} : {
|
|
@@ -277,7 +257,7 @@ function createDefaultStore(config) {
|
|
|
277
257
|
excludeTags: configValue.storeModal.indexExcludeTags
|
|
278
258
|
}
|
|
279
259
|
};
|
|
280
|
-
return
|
|
260
|
+
return createStore(reducer, {
|
|
281
261
|
selectedSkuIds: {},
|
|
282
262
|
// { [skuId]: Boolean }
|
|
283
263
|
licenseOptions: [],
|
|
@@ -293,5 +273,4 @@ function createDefaultStore(config) {
|
|
|
293
273
|
licenseeIsBillingIdentity: null
|
|
294
274
|
});
|
|
295
275
|
}
|
|
296
|
-
|
|
297
|
-
exports.default = _default;
|
|
276
|
+
export default reducer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Environment, RequestParameters, QueryResponseCache, Variables, GraphQLResponse } from 'relay-runtime';
|
|
2
|
+
export declare function createNetworkFetch(options?: CreateRelayEnvironmentOptions): (request: RequestParameters, variables: Variables) => Promise<GraphQLResponse>;
|
|
2
3
|
export declare const networkFetch: (request: RequestParameters, variables: Variables) => Promise<GraphQLResponse>;
|
|
3
4
|
export declare const responseCache: QueryResponseCache | null;
|
|
4
5
|
interface CreateRelayEnvironmentOptions {
|
|
@@ -1,46 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createEnvironment = createEnvironment;
|
|
7
|
-
exports.responseCache = exports.networkFetch = void 0;
|
|
8
|
-
exports.useCurrentEnvironment = useCurrentEnvironment;
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _relayRuntime = require("relay-runtime");
|
|
11
|
-
var _corsError = require("../corsError");
|
|
12
|
-
var _package = require("../../package.json");
|
|
13
|
-
// @ts-ignore - JSON import
|
|
1
|
+
import { Environment, Network, RecordSource, Store, QueryResponseCache } from 'relay-runtime';
|
|
2
|
+
import { handlePossibleCorsError } from '../corsError.js';
|
|
3
|
+
import { getFontdueServerConfig } from './serverConfig.js';
|
|
14
4
|
|
|
5
|
+
// `__FONTDUE_JS_VERSION__` is replaced by an inline babel plugin
|
|
6
|
+
// (defineVersionPlugin in .babelrc.cjs) with the literal package.json#version.
|
|
7
|
+
const version = "3.0.0-alpha10";
|
|
15
8
|
const IS_SERVER = typeof window === typeof undefined;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
|
|
10
|
+
// Read env from either process.env (Node/Next.js) or import.meta.env (Vite/Astro).
|
|
11
|
+
// Prefer the framework-agnostic FONTDUE_URL name; fall back to NEXT_PUBLIC_FONTDUE_URL
|
|
12
|
+
// for backwards compatibility with existing Next.js integrations.
|
|
13
|
+
function readEnv(name) {
|
|
14
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
15
|
+
const v = process.env[name];
|
|
16
|
+
if (v != null && v !== '') return v;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
// @ts-ignore - import.meta.env is Vite/Astro-specific
|
|
20
|
+
const metaEnv = typeof import.meta !== 'undefined' ? import.meta.env : undefined;
|
|
21
|
+
if (metaEnv) {
|
|
22
|
+
const v = metaEnv[name] ?? metaEnv[`PUBLIC_${name}`] ?? metaEnv[`VITE_${name}`];
|
|
23
|
+
if (v != null && v !== '') return v;
|
|
24
|
+
}
|
|
25
|
+
} catch {}
|
|
26
|
+
return undefined;
|
|
19
27
|
}
|
|
20
|
-
|
|
28
|
+
|
|
29
|
+
// On Next.js client bundles, only LITERAL `process.env.NAME` accesses get
|
|
30
|
+
// inlined at build time — `process.env[dynamicName]` stays as a runtime
|
|
31
|
+
// lookup that returns undefined in the browser. Check literal references
|
|
32
|
+
// first so existing Next.js consumers keep working without changes.
|
|
33
|
+
const NEXT_PUBLIC_URL = typeof process !== 'undefined' && process.env ? process.env.NEXT_PUBLIC_FONTDUE_URL : undefined;
|
|
34
|
+
const NEXT_PUBLIC_STRIPE = typeof process !== 'undefined' && process.env ? process.env.NEXT_PUBLIC_FONTDUE_STRIPE_INTEGRATION : undefined;
|
|
35
|
+
const FONTDUE_URL = readEnv('FONTDUE_URL') ?? readEnv('NEXT_PUBLIC_FONTDUE_URL') ?? NEXT_PUBLIC_URL;
|
|
36
|
+
const STRIPE_INTEGRATION = readEnv('FONTDUE_STRIPE_INTEGRATION') ?? readEnv('NEXT_PUBLIC_FONTDUE_STRIPE_INTEGRATION') ?? NEXT_PUBLIC_STRIPE;
|
|
21
37
|
const CACHE_TTL = 10 * 1000; // 10 seconds, to resolve preloaded results
|
|
22
38
|
|
|
23
|
-
function createNetworkFetch(options) {
|
|
39
|
+
export function createNetworkFetch(options) {
|
|
24
40
|
return async function networkFetch(request, variables) {
|
|
25
|
-
|
|
41
|
+
// Per-render server config (set via setFontdueServerConfig or the
|
|
42
|
+
// FontdueProvider server entrypoint). Resolved per call, not per
|
|
43
|
+
// createNetworkFetch, because module-level fetchers outlive renders.
|
|
44
|
+
const serverConfig = IS_SERVER ? getFontdueServerConfig() : undefined;
|
|
45
|
+
const base = (options === null || options === void 0 ? void 0 : options.url) ?? (serverConfig === null || serverConfig === void 0 ? void 0 : serverConfig.url) ?? FONTDUE_URL;
|
|
46
|
+
if (IS_SERVER && (base == null || base === '')) {
|
|
47
|
+
throw new Error('fontdue-js: no Fontdue URL configured for server-side fetch. ' + 'Set FONTDUE_URL / PUBLIC_FONTDUE_URL / VITE_FONTDUE_URL in your environment, ' + 'pass `url` to loadSerializableQuery, or call setFontdueServerConfig ' + '(or render <FontdueProvider url=…>) earlier in the server render.');
|
|
48
|
+
}
|
|
49
|
+
const url = `${base ?? ''}/graphql`;
|
|
26
50
|
for (let attempt = 0; attempt <= 2; attempt++) {
|
|
27
51
|
try {
|
|
28
52
|
const resp = await fetch(url + `?queryName=${request.name}`, {
|
|
29
53
|
method: 'POST',
|
|
30
54
|
credentials: 'include',
|
|
31
55
|
headers: {
|
|
56
|
+
...(serverConfig === null || serverConfig === void 0 ? void 0 : serverConfig.headers),
|
|
32
57
|
Accept: 'application/json',
|
|
33
58
|
'Content-Type': 'application/json',
|
|
34
|
-
'fontdue-stripe-integration':
|
|
35
|
-
'fontdue-client-version':
|
|
59
|
+
'fontdue-stripe-integration': (options === null || options === void 0 ? void 0 : options.stripeIntegration) ?? STRIPE_INTEGRATION ?? 'dynamic',
|
|
60
|
+
'fontdue-client-version': version
|
|
36
61
|
},
|
|
37
62
|
body: JSON.stringify({
|
|
38
63
|
query: request.text,
|
|
39
64
|
variables
|
|
40
65
|
}),
|
|
66
|
+
// Server-side fetches are all site content (per-session data is
|
|
67
|
+
// fetched client-side only), so opt them into Next's data cache —
|
|
68
|
+
// without this, Next 15 treats them as no-store and silently makes
|
|
69
|
+
// every page fully dynamic. The tags below let the revalidate
|
|
70
|
+
// handler purge them when content changes. Inert outside Next:
|
|
71
|
+
// Node's fetch accepts and ignores this cache mode, and the
|
|
72
|
+
// browser path doesn't set it.
|
|
73
|
+
...(IS_SERVER ? {
|
|
74
|
+
cache: 'force-cache'
|
|
75
|
+
} : {}),
|
|
41
76
|
// @ts-ignore
|
|
42
77
|
next: {
|
|
43
|
-
tags: ['graphql', `operation:${request.name}`]
|
|
78
|
+
tags: ['graphql', ...((serverConfig === null || serverConfig === void 0 ? void 0 : serverConfig.cacheTags) ?? []), `operation:${request.name}`]
|
|
44
79
|
}
|
|
45
80
|
});
|
|
46
81
|
const json = await resp.json();
|
|
@@ -64,7 +99,7 @@ function createNetworkFetch(options) {
|
|
|
64
99
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
65
100
|
continue;
|
|
66
101
|
}
|
|
67
|
-
if (
|
|
102
|
+
if (handlePossibleCorsError(error, url)) {
|
|
68
103
|
return {
|
|
69
104
|
data: undefined,
|
|
70
105
|
errors: [{
|
|
@@ -80,13 +115,11 @@ function createNetworkFetch(options) {
|
|
|
80
115
|
throw new Error('Unexpected: exhausted retries');
|
|
81
116
|
};
|
|
82
117
|
}
|
|
83
|
-
const networkFetch = createNetworkFetch();
|
|
84
|
-
|
|
85
|
-
const responseCache = IS_SERVER ? null : new _relayRuntime.QueryResponseCache({
|
|
118
|
+
export const networkFetch = createNetworkFetch();
|
|
119
|
+
export const responseCache = IS_SERVER ? null : new QueryResponseCache({
|
|
86
120
|
size: 250,
|
|
87
121
|
ttl: CACHE_TTL
|
|
88
122
|
});
|
|
89
|
-
exports.responseCache = responseCache;
|
|
90
123
|
function createNetwork(options) {
|
|
91
124
|
async function fetchResponse(params, variables, cacheConfig) {
|
|
92
125
|
const isQuery = params.operationKind === 'query';
|
|
@@ -101,20 +134,27 @@ function createNetwork(options) {
|
|
|
101
134
|
}
|
|
102
135
|
return createNetworkFetch(options)(params, variables);
|
|
103
136
|
}
|
|
104
|
-
const network =
|
|
137
|
+
const network = Network.create(fetchResponse);
|
|
105
138
|
return network;
|
|
106
139
|
}
|
|
107
|
-
function createEnvironment(options) {
|
|
108
|
-
return new
|
|
140
|
+
export function createEnvironment(options) {
|
|
141
|
+
return new Environment({
|
|
109
142
|
network: createNetwork(options),
|
|
110
|
-
store: new
|
|
143
|
+
store: new Store(RecordSource.create()),
|
|
111
144
|
isServer: IS_SERVER
|
|
112
145
|
});
|
|
113
146
|
}
|
|
114
|
-
|
|
147
|
+
|
|
148
|
+
// Client-side Relay environment is a module-level singleton so multiple
|
|
149
|
+
// FontdueProviders on a page (e.g. one per Astro island) share cache and
|
|
150
|
+
// data. Server-side stays per-render to avoid cross-request pollution.
|
|
151
|
+
let clientEnvironment = null;
|
|
152
|
+
export function useCurrentEnvironment(options) {
|
|
115
153
|
if (IS_SERVER) {
|
|
116
154
|
return createEnvironment(options);
|
|
117
155
|
}
|
|
118
|
-
|
|
119
|
-
|
|
156
|
+
if (clientEnvironment == null) {
|
|
157
|
+
clientEnvironment = createEnvironment(options);
|
|
158
|
+
}
|
|
159
|
+
return clientEnvironment;
|
|
120
160
|
}
|
|
@@ -43,5 +43,7 @@ export interface SerializablePreloadedQuery<TQuery extends OperationType> {
|
|
|
43
43
|
type RequireAllWithNull<T> = {
|
|
44
44
|
[K in keyof T]-?: T[K] | null;
|
|
45
45
|
};
|
|
46
|
-
export default function loadSerializableQuery<TQuery extends OperationType>(query: GraphQLTaggedNode, variables: RequireAllWithNull<VariablesOf<TQuery
|
|
46
|
+
export default function loadSerializableQuery<TQuery extends OperationType>(query: GraphQLTaggedNode, variables: RequireAllWithNull<VariablesOf<TQuery>>, options?: {
|
|
47
|
+
url?: string;
|
|
48
|
+
}): Promise<SerializablePreloadedQuery<TQuery>>;
|
|
47
49
|
export {};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { createNetworkFetch } from './environment.js';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = loadSerializableQuery;
|
|
7
|
-
var _environment = require("./environment");
|
|
8
3
|
/**
|
|
9
4
|
* RELAY CACHE KEY NORMALIZATION
|
|
10
5
|
*
|
|
@@ -45,9 +40,10 @@ var _environment = require("./environment");
|
|
|
45
40
|
// Call into raw network fetch to get serializable GraphQL query response
|
|
46
41
|
// This response will be sent to the client to "warm" the QueryResponseCache
|
|
47
42
|
// to avoid the client fetches.
|
|
48
|
-
async function loadSerializableQuery(query, variables) {
|
|
43
|
+
export default async function loadSerializableQuery(query, variables, options) {
|
|
49
44
|
if (!('params' in query)) throw new Error('Params not found in query, is it a fragment instead of a query?');
|
|
50
|
-
const
|
|
45
|
+
const fetcher = createNetworkFetch(options);
|
|
46
|
+
const response = await fetcher(query.params, variables);
|
|
51
47
|
return {
|
|
52
48
|
params: query.params,
|
|
53
49
|
variables,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface FontdueServerConfig {
|
|
2
|
+
/** Base URL for server-side GraphQL fetches, e.g. https://acme.fontdue.com */
|
|
3
|
+
url?: string;
|
|
4
|
+
/** Extra headers sent with every server-side GraphQL fetch. */
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
/** Extra Next.js fetch cache tags applied to every server-side GraphQL fetch. */
|
|
7
|
+
cacheTags?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* The site domain this render is for, when known. Set by
|
|
10
|
+
* fontdue-js/next's prepareFontdueRender so render-scoped helpers
|
|
11
|
+
* (currentFontdueEndpoint) can recover it.
|
|
12
|
+
*/
|
|
13
|
+
domain?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function setFontdueServerConfig(config: FontdueServerConfig): void;
|
|
16
|
+
export declare function getFontdueServerConfig(): FontdueServerConfig | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Per-render configuration for server-side GraphQL fetches.
|
|
2
|
+
//
|
|
3
|
+
// React Server Components have no context API, so a `<FontdueProvider url=…>`
|
|
4
|
+
// prop cannot reach the nested server components that preload queries — the
|
|
5
|
+
// prop historically only configured client-side fetches. What RSC does have
|
|
6
|
+
// is React.cache(): a memoization store scoped to one server render pass and
|
|
7
|
+
// shared by every server component in it. We use a single cache cell as a
|
|
8
|
+
// render-scoped mutable slot: the host app (or the FontdueProvider server
|
|
9
|
+
// entrypoint) writes the config early in the render, and every later
|
|
10
|
+
// server-side fetch in the same pass reads it.
|
|
11
|
+
//
|
|
12
|
+
// Unlike AsyncLocalStorage-based approaches (e.g. Next's headers()), reading
|
|
13
|
+
// this store does not opt the route into dynamic rendering, so static
|
|
14
|
+
// generation and ISR keep working. Each render pass gets a fresh store, so
|
|
15
|
+
// concurrent requests cannot leak config into each other.
|
|
16
|
+
//
|
|
17
|
+
// Caveat that callers must own: the write has to happen in the same render
|
|
18
|
+
// pass, before the fetch. A provider in a layout covers full-page renders,
|
|
19
|
+
// but an App Router soft navigation re-renders only the page segment — set
|
|
20
|
+
// the config at the top of each page (or in a shared data helper every page
|
|
21
|
+
// calls) when pages contain Fontdue components.
|
|
22
|
+
//
|
|
23
|
+
// Outside an RSC render (client bundles, SSR setups without React.cache
|
|
24
|
+
// semantics) the slot degrades to a throwaway object: writes become no-ops
|
|
25
|
+
// and the environment variables remain the configuration source.
|
|
26
|
+
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
const getSlot = typeof React.cache === 'function' ? React.cache(() => ({
|
|
29
|
+
current: undefined
|
|
30
|
+
})) : () => ({
|
|
31
|
+
current: undefined
|
|
32
|
+
});
|
|
33
|
+
export function setFontdueServerConfig(config) {
|
|
34
|
+
getSlot().current = config;
|
|
35
|
+
}
|
|
36
|
+
export function getFontdueServerConfig() {
|
|
37
|
+
return getSlot().current;
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PreloadedQuery, PreloadFetchPolicy } from "react-relay";
|
|
2
|
-
import { OperationType } from "relay-runtime";
|
|
3
|
-
import { SerializablePreloadedQuery } from "./loadSerializableQuery";
|
|
4
|
-
export default function useSerializablePreloadedQuery<TQuery extends OperationType>(preloadQuery: SerializablePreloadedQuery<TQuery>, fetchPolicy?: PreloadFetchPolicy): PreloadedQuery<TQuery>;
|
|
2
|
+
import { GraphQLTaggedNode, OperationType } from "relay-runtime";
|
|
3
|
+
import { SerializablePreloadedQuery } from "./loadSerializableQuery.js";
|
|
4
|
+
export default function useSerializablePreloadedQuery<TQuery extends OperationType>(preloadQuery: SerializablePreloadedQuery<TQuery>, fetchPolicy?: PreloadFetchPolicy, query?: GraphQLTaggedNode): PreloadedQuery<TQuery>;
|
|
@@ -1,29 +1,33 @@
|
|
|
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 _environment = require("./environment");
|
|
10
1
|
// Convert preloaded query object (with raw GraphQL Response) into
|
|
11
2
|
// Relay's PreloadedQuery.
|
|
12
3
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { useRelayEnvironment } from "react-relay";
|
|
6
|
+
import { createOperationDescriptor, getRequest } from "relay-runtime";
|
|
7
|
+
import { responseCache } from "./environment.js";
|
|
8
|
+
// This hook converts a serializable preloaded query into Relay's PreloadedQuery
|
|
9
|
+
// object. It primes Relay so that `usePreloadedQuery` resolves synchronously on
|
|
10
|
+
// both server and client:
|
|
11
|
+
// - On the client, it warms the QueryResponseCache so network-layer lookups hit.
|
|
12
|
+
// - When a `query` tagged node is provided, it also commits the response
|
|
13
|
+
// payload directly into the environment's Store via `commitPayload`. This is
|
|
14
|
+
// required for SSR frameworks (Astro, Vite SSR, etc.) whose non-streaming
|
|
15
|
+
// `renderToString` needs the data available synchronously during render.
|
|
16
|
+
export default function useSerializablePreloadedQuery(preloadQuery) {
|
|
22
17
|
let fetchPolicy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "store-or-network";
|
|
23
|
-
|
|
18
|
+
let query = arguments.length > 2 ? arguments[2] : undefined;
|
|
19
|
+
const environment = useRelayEnvironment();
|
|
20
|
+
useMemo(() => {
|
|
24
21
|
writePreloadedQueryToCache(preloadQuery);
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
if (query != null) {
|
|
23
|
+
const response = preloadQuery.response;
|
|
24
|
+
const singular = Array.isArray(response) ? response[0] : response;
|
|
25
|
+
if ((singular === null || singular === void 0 ? void 0 : singular.data) != null) {
|
|
26
|
+
const operation = createOperationDescriptor(getRequest(query), preloadQuery.variables);
|
|
27
|
+
environment.commitPayload(operation, singular.data);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, [preloadQuery, environment, query]);
|
|
27
31
|
return {
|
|
28
32
|
environment,
|
|
29
33
|
fetchKey: preloadQuery.params.id ?? preloadQuery.params.cacheID,
|
|
@@ -40,5 +44,5 @@ preloadQuery) {
|
|
|
40
44
|
function writePreloadedQueryToCache(preloadedQueryObject) {
|
|
41
45
|
// @ts-ignore
|
|
42
46
|
const cacheKey = preloadedQueryObject.params.id ?? preloadedQueryObject.params.cacheID;
|
|
43
|
-
|
|
47
|
+
responseCache === null || responseCache === void 0 ? void 0 : responseCache.set(cacheKey, preloadedQueryObject.variables, preloadedQueryObject.response);
|
|
44
48
|
}
|
package/dist/retryImport.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = retryImport;
|
|
7
1
|
/**
|
|
8
2
|
* Wraps a dynamic import in retry logic.
|
|
9
3
|
*
|
|
@@ -16,7 +10,7 @@ exports.default = retryImport;
|
|
|
16
10
|
*
|
|
17
11
|
* See: https://github.com/whatwg/html/issues/6768
|
|
18
12
|
*/
|
|
19
|
-
function retryImport(load) {
|
|
13
|
+
export default function retryImport(load) {
|
|
20
14
|
let retries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
21
15
|
let delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
|
|
22
16
|
return load().catch(error => {
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CollectionStyleSkus } from './components/Root/productState';
|
|
2
|
-
import type { FontdueState } from './reducer';
|
|
1
|
+
import { CollectionStyleSkus } from './components/Root/productState.js';
|
|
2
|
+
import type { FontdueState } from './reducer.js';
|
|
3
3
|
export declare const pluralize: (count: number, singular: string, plural?: string) => string;
|
|
4
4
|
export declare function notEmpty<TValue>(value: TValue | null | undefined): value is TValue;
|
|
5
5
|
export declare function kebabToCamel(str: string): string;
|
package/dist/utils.js
CHANGED
|
@@ -1,46 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.compareVariableSettings = exports.collectionSkuIdsDifferences = exports.collTransitivelyContainsSkuId = exports.collContainsSkuId = void 0;
|
|
7
|
-
exports.getFeatureGlyphs = getFeatureGlyphs;
|
|
8
|
-
exports.isSelected = exports.inspect = void 0;
|
|
9
|
-
exports.kebabToCamel = kebabToCamel;
|
|
10
|
-
exports.notEmpty = notEmpty;
|
|
11
|
-
exports.variableSettingsCSS = exports.variableInstanceSettings = exports.variableInstanceCSS = exports.pluralize = exports.parseCustomProperties = void 0;
|
|
12
|
-
const pluralize = (count, singular, plural) => {
|
|
1
|
+
export const pluralize = (count, singular, plural) => {
|
|
13
2
|
if (count === 1) return `1 ${singular}`;
|
|
14
3
|
if (!plural) return `${count} ${singular}s`;
|
|
15
4
|
return `${count}\xa0${plural}`;
|
|
16
5
|
};
|
|
17
|
-
|
|
18
|
-
function notEmpty(value) {
|
|
6
|
+
export function notEmpty(value) {
|
|
19
7
|
return value !== null && value !== undefined;
|
|
20
8
|
}
|
|
21
|
-
function kebabToCamel(str) {
|
|
9
|
+
export function kebabToCamel(str) {
|
|
22
10
|
return str.replace(/-([a-z])/g, function (g) {
|
|
23
11
|
return g[1].toUpperCase();
|
|
24
12
|
});
|
|
25
13
|
}
|
|
26
14
|
|
|
27
15
|
// where coll is a member of `collectionStyleSkus`;
|
|
28
|
-
const collContainsSkuId = (coll, skuIdOrStyleId) => {
|
|
16
|
+
export const collContainsSkuId = (coll, skuIdOrStyleId) => {
|
|
29
17
|
if (!coll) return false;
|
|
30
18
|
return coll.childrenSkuIds.indexOf(skuIdOrStyleId) >= 0 || coll.fontStyleSkuIds.indexOf(skuIdOrStyleId) >= 0 || coll.fontStyleIds.indexOf(skuIdOrStyleId) >= 0;
|
|
31
19
|
};
|
|
32
20
|
|
|
33
21
|
// Transitive containment check — walks the collection hierarchy to find
|
|
34
22
|
// if a SKU is contained at any depth (e.g., collection bundle → family → bundle)
|
|
35
|
-
|
|
36
|
-
const collTransitivelyContainsSkuId = (collectionStyleSkus, collSkuId, skuIdOrStyleId) => {
|
|
23
|
+
export const collTransitivelyContainsSkuId = (collectionStyleSkus, collSkuId, skuIdOrStyleId) => {
|
|
37
24
|
const coll = collectionStyleSkus[collSkuId];
|
|
38
25
|
if (!coll) return false;
|
|
39
26
|
if (collContainsSkuId(coll, skuIdOrStyleId)) return true;
|
|
40
27
|
return coll.childrenSkuIds.some(childSkuId => collTransitivelyContainsSkuId(collectionStyleSkus, childSkuId, skuIdOrStyleId));
|
|
41
28
|
};
|
|
42
|
-
|
|
43
|
-
const isSelected = skuIdOrStyleId => state => {
|
|
29
|
+
export const isSelected = skuIdOrStyleId => state => {
|
|
44
30
|
if (!skuIdOrStyleId) return false;
|
|
45
31
|
if (state.selectedSkuIds[skuIdOrStyleId] === true) return true;
|
|
46
32
|
// get the collections that contain this skuId as a fontStyle or child
|
|
@@ -53,8 +39,7 @@ const isSelected = skuIdOrStyleId => state => {
|
|
|
53
39
|
// find any collection ancestors that contain this skuId,
|
|
54
40
|
// then for each collection, sum the price of selected skus,
|
|
55
41
|
// and return the delta between the collection price and the sum.
|
|
56
|
-
|
|
57
|
-
const collectionSkuIdsDifferences = (state, skuId) => Object.keys(state.collectionStyleSkus).filter(collectionSkuId => {
|
|
42
|
+
export const collectionSkuIdsDifferences = (state, skuId) => Object.keys(state.collectionStyleSkus).filter(collectionSkuId => {
|
|
58
43
|
return skuId === collectionSkuId || collTransitivelyContainsSkuId(state.collectionStyleSkus, collectionSkuId, skuId);
|
|
59
44
|
}).reduce((acc, collectionSkuId) => {
|
|
60
45
|
const selectedSkuIdsInColl = Object.keys(state.selectedSkuIds).filter(selectedSkuId => state.selectedSkuIds[selectedSkuId] === true && collTransitivelyContainsSkuId(state.collectionStyleSkus, collectionSkuId, selectedSkuId));
|
|
@@ -62,8 +47,7 @@ const collectionSkuIdsDifferences = (state, skuId) => Object.keys(state.collecti
|
|
|
62
47
|
acc[collectionSkuId] = (state.skuPrices[collectionSkuId] ?? 0) - sumOfSelectedSkuIdsInColl;
|
|
63
48
|
return acc;
|
|
64
49
|
}, {});
|
|
65
|
-
|
|
66
|
-
const variableInstanceSettings = instance => instance === null || instance === void 0 ? void 0 : instance.coordinates.reduce((acc, _ref) => {
|
|
50
|
+
export const variableInstanceSettings = instance => instance === null || instance === void 0 ? void 0 : instance.coordinates.reduce((acc, _ref) => {
|
|
67
51
|
let {
|
|
68
52
|
axis,
|
|
69
53
|
value
|
|
@@ -71,14 +55,11 @@ const variableInstanceSettings = instance => instance === null || instance === v
|
|
|
71
55
|
acc[axis] = value;
|
|
72
56
|
return acc;
|
|
73
57
|
}, {});
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
exports.compareVariableSettings = compareVariableSettings;
|
|
77
|
-
const variableSettingsCSS = variableSettings => ({
|
|
58
|
+
export const compareVariableSettings = (instance, settings) => instance.coordinates.every(coord => settings[coord.axis] === coord.value);
|
|
59
|
+
export const variableSettingsCSS = variableSettings => ({
|
|
78
60
|
fontVariationSettings: Object.keys(variableSettings).map(axis => `'${axis}' ${variableSettings[axis]}`).join(',')
|
|
79
61
|
});
|
|
80
|
-
|
|
81
|
-
const variableInstanceCSS = variableInstance => ({
|
|
62
|
+
export const variableInstanceCSS = variableInstance => ({
|
|
82
63
|
fontVariationSettings: variableInstance.coordinates.map(_ref2 => {
|
|
83
64
|
let {
|
|
84
65
|
axis,
|
|
@@ -87,8 +68,7 @@ const variableInstanceCSS = variableInstance => ({
|
|
|
87
68
|
return `'${axis}' ${value}`;
|
|
88
69
|
}).join(',')
|
|
89
70
|
});
|
|
90
|
-
|
|
91
|
-
const parseCustomProperties = props => {
|
|
71
|
+
export const parseCustomProperties = props => {
|
|
92
72
|
if (!props) return {};
|
|
93
73
|
return props.reduce((acc, prop) => {
|
|
94
74
|
const [key, val] = prop.split(':');
|
|
@@ -96,13 +76,11 @@ const parseCustomProperties = props => {
|
|
|
96
76
|
return acc;
|
|
97
77
|
}, {});
|
|
98
78
|
};
|
|
99
|
-
|
|
100
|
-
const inspect = value => {
|
|
79
|
+
export const inspect = value => {
|
|
101
80
|
console.log(value);
|
|
102
81
|
return value;
|
|
103
82
|
};
|
|
104
|
-
|
|
105
|
-
function getFeatureGlyphs(supportedLanguages) {
|
|
83
|
+
export function getFeatureGlyphs(supportedLanguages) {
|
|
106
84
|
if (supportedLanguages !== null && supportedLanguages !== void 0 && supportedLanguages.includes('en')) return 'Aa';
|
|
107
85
|
if (supportedLanguages !== null && supportedLanguages !== void 0 && supportedLanguages.includes('ar')) return 'ت';
|
|
108
86
|
if (supportedLanguages !== null && supportedLanguages !== void 0 && supportedLanguages.includes('gr')) return 'Αα';
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _fontfaceobserver = _interopRequireDefault(require("fontfaceobserver"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1
|
+
import FontFaceObserver from 'fontfaceobserver';
|
|
9
2
|
const FALLBACK_FAMILY = 'Fallback';
|
|
10
3
|
const setStyle = ($el, _ref) => {
|
|
11
4
|
let {
|
|
@@ -38,7 +31,7 @@ class FontStyle {
|
|
|
38
31
|
fontWeight: 'normal',
|
|
39
32
|
fontStyle: 'normal'
|
|
40
33
|
});
|
|
41
|
-
const observer = new
|
|
34
|
+
const observer = new FontFaceObserver(fontFamily, {
|
|
42
35
|
weight: fontWeight,
|
|
43
36
|
style: fontStyle
|
|
44
37
|
});
|
|
@@ -56,5 +49,4 @@ class FontStyle {
|
|
|
56
49
|
});
|
|
57
50
|
}
|
|
58
51
|
}
|
|
59
|
-
|
|
60
|
-
exports.default = _default;
|
|
52
|
+
export default FontStyle;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
function insertAfter(newNode, referenceNode) {
|
|
8
2
|
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
|
9
3
|
}
|
|
@@ -19,10 +13,9 @@ const init = $element => {
|
|
|
19
13
|
expand($element);
|
|
20
14
|
});
|
|
21
15
|
};
|
|
22
|
-
class TruncatedMarkdown {
|
|
16
|
+
export default class TruncatedMarkdown {
|
|
23
17
|
constructor() {
|
|
24
18
|
this.$elements = [...document.querySelectorAll('[data-truncated-rest-text]')];
|
|
25
19
|
this.$elements.forEach(init);
|
|
26
20
|
}
|
|
27
|
-
}
|
|
28
|
-
exports.default = TruncatedMarkdown;
|
|
21
|
+
}
|
package/dist/vite.d.ts
ADDED