fontdue-js 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/__generated__/AddressFieldsRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/AddressFieldsRefetchQuery.graphql.js +11 -63
- package/dist/__generated__/AddressFields_viewer.graphql.d.ts +1 -11
- package/dist/__generated__/AddressFields_viewer.graphql.js +68 -122
- package/dist/__generated__/BuyButton_collection.graphql.d.ts +2 -2
- package/dist/__generated__/BuyButton_collection.graphql.js +1 -1
- package/dist/__generated__/CartButtonQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartButtonQuery.graphql.js +24 -3
- package/dist/__generated__/CartButton_order.graphql.d.ts +4 -1
- package/dist/__generated__/CartButton_order.graphql.js +15 -2
- package/dist/__generated__/CartItemAdditionalLicenses_licenses.graphql.d.ts +18 -0
- package/dist/__generated__/CartItemAdditionalLicenses_licenses.graphql.js +42 -0
- package/dist/__generated__/CartItemAdditionalLicenses_orderItem.graphql.d.ts +21 -0
- package/dist/__generated__/CartItemAdditionalLicenses_orderItem.graphql.js +52 -0
- package/dist/__generated__/CartItemLicense_selection.graphql.d.ts +29 -0
- package/dist/__generated__/CartItemLicense_selection.graphql.js +80 -0
- package/dist/__generated__/CartItemProduct_product.graphql.d.ts +33 -0
- package/dist/__generated__/CartItemProduct_product.graphql.js +122 -0
- package/dist/__generated__/CartItemVariable_selection.graphql.d.ts +36 -0
- package/dist/__generated__/CartItemVariable_selection.graphql.js +107 -0
- package/dist/__generated__/CartItemVariable_variable.graphql.d.ts +22 -0
- package/dist/__generated__/CartItemVariable_variable.graphql.js +58 -0
- package/dist/__generated__/CartItem_node.graphql.d.ts +9 -34
- package/dist/__generated__/CartItem_node.graphql.js +31 -129
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +137 -108
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +137 -108
- package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +7 -1
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +137 -108
- package/dist/__generated__/CartOrder_order.graphql.d.ts +11 -2
- package/dist/__generated__/CartOrder_order.graphql.js +33 -2
- package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartQuery.graphql.js +143 -108
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.d.ts +2 -2
- package/dist/__generated__/CartStateRemoveDiscountMutation.graphql.js +162 -17
- package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +8 -2
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +249 -91
- package/dist/__generated__/CartState_order.graphql.d.ts +10 -1
- package/dist/__generated__/CartState_order.graphql.js +30 -3
- package/dist/__generated__/CharacterViewer_collection.graphql.d.ts +5 -5
- package/dist/__generated__/CharacterViewer_collection.graphql.js +1 -1
- package/dist/__generated__/CharacterViewer_family.graphql.d.ts +2 -2
- package/dist/__generated__/CharacterViewer_family.graphql.js +1 -1
- package/dist/__generated__/CharacterViewer_style.graphql.js +1 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +137 -108
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +7 -1
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +137 -108
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.d.ts +2 -2
- package/dist/__generated__/CouponCodeInputApplyCouponMutation.graphql.js +162 -17
- package/dist/__generated__/CouponCodeInput_viewer.graphql.js +1 -1
- package/dist/__generated__/CouponCodeRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CouponCodeRefetchQuery.graphql.js +29 -19
- package/dist/__generated__/CouponText_coupon.graphql.d.ts +5 -1
- package/dist/__generated__/CouponText_coupon.graphql.js +36 -24
- package/dist/__generated__/FamilyList_node.graphql.d.ts +2 -2
- package/dist/__generated__/FamilyList_node.graphql.js +1 -1
- package/dist/__generated__/Family_node.graphql.d.ts +2 -2
- package/dist/__generated__/Family_node.graphql.js +27 -10
- package/dist/__generated__/Family_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/FontFamiliesQuery.graphql.d.ts +11 -1
- package/dist/__generated__/FontFamiliesQuery.graphql.js +58 -45
- package/dist/__generated__/OrderVariableSelectionMutation.graphql.d.ts +69 -0
- package/dist/__generated__/OrderVariableSelectionMutation_viewer.graphql.d.ts +30 -0
- package/dist/__generated__/OrderVariableSelectionRedux_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/OrderVariableSelectionRedux_viewer.graphql.js +32 -0
- package/dist/__generated__/OrderVariableSelection_variables.graphql.d.ts +26 -0
- package/dist/__generated__/OrderVariableSelection_variables.graphql.js +79 -0
- package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +8 -1
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +171 -142
- package/dist/__generated__/PriceBarSectionRefetchQuery.graphql.d.ts +7 -2
- package/dist/__generated__/PriceBarSectionRefetchQuery.graphql.js +43 -28
- package/dist/__generated__/PriceBarSection_node.graphql.d.ts +2 -2
- package/dist/__generated__/PriceBarSection_node.graphql.js +22 -17
- package/dist/__generated__/PriceBarSection_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/PriceBar_node.graphql.d.ts +1 -1
- package/dist/__generated__/PriceBar_node.graphql.js +20 -4
- package/dist/__generated__/PriceBar_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/SKUPriceRefetchQuery.graphql.d.ts +6 -1
- package/dist/__generated__/SKUPriceUpdateQuery.graphql.d.ts +29 -0
- package/dist/__generated__/SKUPrice_sku.graphql.d.ts +1 -1
- package/dist/__generated__/SKUPrice_sku.graphql.js +13 -17
- package/dist/__generated__/SKUPrice_viewer.graphql.d.ts +19 -0
- package/dist/__generated__/SelectButton_sku.graphql.d.ts +1 -1
- package/dist/__generated__/SelectButton_sku.graphql.js +13 -5
- package/dist/__generated__/SelectButton_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/StoreModalBundleButton_bundle.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalBundleButton_bundle.graphql.js +21 -5
- package/dist/__generated__/StoreModalBundleButton_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +7 -3
- package/dist/__generated__/StoreModalCartQuery.graphql.js +391 -66
- package/dist/__generated__/StoreModalCheckoutQuery.graphql.d.ts +3 -6
- package/dist/__generated__/StoreModalCheckoutQuery.graphql.js +36 -147
- package/dist/__generated__/StoreModalFamilyButton_collection.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalFamilyButton_collection.graphql.js +20 -4
- package/dist/__generated__/StoreModalFamilyButton_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/StoreModalFamily_collection.graphql.d.ts +2 -2
- package/dist/__generated__/StoreModalFamily_collection.graphql.js +29 -12
- package/dist/__generated__/StoreModalFamily_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/StoreModalOrderVariableSelectionOrderUpdateMutation.graphql.d.ts +60 -0
- package/dist/__generated__/StoreModalOrderVariableSelectionVariable_order.graphql.d.ts +27 -0
- package/dist/__generated__/StoreModalOrderVariableSelectionVariable_variable.graphql.d.ts +24 -0
- package/dist/__generated__/StoreModalOrderVariableSelection_viewer.graphql.d.ts +38 -0
- package/dist/__generated__/StoreModalOrderVariableSelection_viewer.graphql.js +129 -0
- package/dist/__generated__/StoreModalProductContent_collection.graphql.d.ts +22 -0
- package/dist/__generated__/StoreModalProductContent_collection.graphql.js +92 -0
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +24 -7
- package/dist/__generated__/StoreModalProductQuery.graphql.js +193 -130
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +31 -0
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +383 -0
- package/dist/__generated__/StoreModalProductSummaryAddToCartMutation.graphql.d.ts +8 -1
- package/dist/__generated__/StoreModalProductSummaryAddToCartMutation.graphql.js +24 -3
- package/dist/__generated__/StoreModalProductSummaryRefetchQuery.graphql.d.ts +8 -3
- package/dist/__generated__/StoreModalProductSummaryRefetchQuery.graphql.js +59 -29
- package/dist/__generated__/StoreModalProductSummary_viewer.graphql.d.ts +6 -1
- package/dist/__generated__/StoreModalProductSummary_viewer.graphql.js +59 -15
- package/dist/__generated__/StoreModalReviewCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalReviewQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalReviewUpdateOrderMutation.graphql.d.ts +6 -1
- package/dist/__generated__/StoreModalStyleButton_fontStyle.graphql.d.ts +1 -4
- package/dist/__generated__/StoreModalStyleButton_fontStyle.graphql.js +32 -25
- package/dist/__generated__/StoreModalStyleButton_viewer.graphql.d.ts +17 -0
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.d.ts +21 -0
- package/dist/__generated__/StoreModalUnifiedCheckoutCompleteOrderMutation.graphql.js +241 -0
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.d.ts +28 -0
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateCustomerMutation.graphql.js +251 -0
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.d.ts +82 -0
- package/dist/__generated__/StoreModalUnifiedCheckoutUpdateOrderMutation.graphql.js +292 -0
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.d.ts +55 -0
- package/dist/__generated__/StoreModalUnifiedCheckout_order.graphql.js +169 -0
- package/dist/__generated__/StoreModalUnifiedCheckout_viewer.graphql.d.ts +28 -0
- package/dist/__generated__/StoreModalUnifiedCheckout_viewer.graphql.js +99 -0
- package/dist/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.d.ts +22 -0
- package/dist/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.js +105 -0
- package/dist/__generated__/StripeProvider_viewer.graphql.d.ts +2 -1
- package/dist/__generated__/StripeProvider_viewer.graphql.js +8 -2
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +137 -108
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.d.ts +32 -0
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +293 -0
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.js +40 -46
- package/dist/__generated__/TypeTesterStyleSelectData_viewer.graphql.d.ts +2 -2
- package/dist/__generated__/TypeTesterStyleSelectData_viewer.graphql.js +3 -3
- package/dist/__generated__/TypeTester_NewStyleQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTester_fontStyle.graphql.d.ts +1 -10
- package/dist/__generated__/TypeTester_fontStyle.graphql.js +48 -41
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.d.ts +32 -0
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.js +293 -0
- package/dist/__generated__/TypeTestersIDQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersIDQuery.graphql.js +41 -37
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.d.ts +33 -0
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.js +482 -0
- package/dist/__generated__/TypeTestersSlugQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersSlugQuery.graphql.js +41 -37
- package/dist/__generated__/TypeTesters_collection.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTesters_collection.graphql.js +43 -14
- package/dist/__generated__/productState_Query.graphql.d.ts +3 -3
- package/dist/__generated__/productState_Query.graphql.js +1 -1
- package/dist/__generated__/productState_collection.graphql.d.ts +2 -2
- package/dist/__generated__/productState_collection.graphql.js +1 -1
- package/dist/__generated__/productState_node.graphql.d.ts +3 -3
- package/dist/__generated__/productState_node.graphql.js +1 -1
- package/dist/__generated__/useOrderVariables_order.graphql.d.ts +24 -0
- package/dist/components/AddToCartBanner/index.js +3 -3
- package/dist/components/BuyButton/index.js +4 -4
- package/dist/components/BuyButton/index.server.js +2 -2
- package/dist/components/BuyingOptions/index.js +1 -1
- package/dist/components/Cart/AddressFields.d.ts +2 -3
- package/dist/components/Cart/AddressFields.js +85 -142
- package/dist/components/Cart/CartItem/CartItemAdditionalLicenses.d.ts +10 -0
- package/dist/components/Cart/CartItem/CartItemAdditionalLicenses.js +38 -0
- package/dist/components/Cart/CartItem/CartItemLicense.d.ts +12 -0
- package/dist/components/Cart/CartItem/CartItemLicense.js +75 -0
- package/dist/components/Cart/CartItem/CartItemProduct.d.ts +7 -0
- package/dist/components/Cart/CartItem/CartItemProduct.js +43 -0
- package/dist/components/Cart/CartItem/CartItemVariable.d.ts +11 -0
- package/dist/components/Cart/CartItem/CartItemVariable.js +76 -0
- package/dist/components/Cart/CartItem/VariableTextInput.d.ts +1 -3
- package/dist/components/Cart/CartItem/VariableTextInput.js +7 -6
- package/dist/components/Cart/CartItem/index.d.ts +4 -1
- package/dist/components/Cart/CartItem/index.js +73 -284
- package/dist/components/Cart/CartOrder.js +19 -39
- package/dist/components/Cart/CartState.d.ts +4 -2
- package/dist/components/Cart/CartState.js +40 -29
- package/dist/components/Cart/CartTotals.js +2 -2
- package/dist/components/Cart/Checkout.js +5 -7
- package/dist/components/Cart/CouponCodeInput.js +4 -4
- package/dist/components/Cart/CustomerFields.d.ts +1 -1
- package/dist/components/Cart/CustomerFields.js +5 -5
- package/dist/components/Cart/Download.js +3 -3
- package/dist/components/Cart/EmptyCart.js +1 -1
- package/dist/components/Cart/IdentityBox.js +1 -1
- package/dist/components/Cart/index.js +2 -2
- package/dist/components/Cart/injectRelayEnvironment.js +2 -2
- package/dist/components/Cart/types.d.ts +5 -4
- package/dist/components/CartButton/index.d.ts +1 -0
- package/dist/components/CartButton/index.js +52 -11
- package/dist/components/CartButton/index.server.js +2 -2
- package/dist/components/CharacterViewer/StyleSelect.js +1 -1
- package/dist/components/CharacterViewer/index.js +8 -8
- package/dist/components/CharacterViewer/index.server.js +2 -2
- package/dist/components/Checkbox/index.js +4 -4
- package/dist/components/CollectionAa/index.js +1 -1
- package/dist/components/ComponentsContext.js +1 -1
- package/dist/components/ConfigContext.js +2 -2
- package/dist/components/CookieNotification/index.js +2 -2
- package/dist/components/CouponText/index.js +9 -4
- package/dist/components/CustomerLoginForm/index.js +3 -3
- package/dist/components/Family/FamilyList.js +1 -1
- package/dist/components/Family/index.js +4 -4
- package/dist/components/FontFamilies/index.js +12 -5
- package/dist/components/FontStyle/index.js +1 -1
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.d.ts +1 -1
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.js +3 -3
- package/dist/components/FontdueProvider/index.js +1 -1
- package/dist/components/FontdueProvider/index.server.js +3 -3
- package/dist/components/Icons/Align.js +1 -1
- package/dist/components/Icons/ArrowDownRight.js +1 -1
- package/dist/components/Icons/ArrowLeft.js +1 -1
- package/dist/components/Icons/ArrowRight.js +1 -1
- package/dist/components/Icons/CarrotDown.js +1 -1
- package/dist/components/Icons/CarrotUp.js +1 -1
- package/dist/components/Icons/Cart.js +1 -1
- package/dist/components/Icons/CartNew.js +1 -1
- package/dist/components/Icons/Check.js +1 -1
- package/dist/components/Icons/Checkbox.js +1 -1
- package/dist/components/Icons/CheckboxChecked.js +1 -1
- package/dist/components/Icons/CheckboxCrossed.js +1 -1
- package/dist/components/Icons/CircledCheck.js +1 -1
- package/dist/components/Icons/CircledInfo.js +1 -1
- package/dist/components/Icons/CircledMinus.js +1 -1
- package/dist/components/Icons/ColorPicker.js +1 -1
- package/dist/components/Icons/CreditCard.js +1 -1
- package/dist/components/Icons/DownArrow.js +1 -1
- package/dist/components/Icons/DownloadFonts.js +1 -1
- package/dist/components/Icons/FrowningFace.js +1 -1
- package/dist/components/Icons/License.js +1 -1
- package/dist/components/Icons/Receipt.js +1 -1
- package/dist/components/Icons/User.js +1 -1
- package/dist/components/Icons/X.js +1 -1
- package/dist/components/Icons/index.js +1 -1
- package/dist/components/NewsletterSignup/NewsletterSignupElement.js +2 -2
- package/dist/components/NewsletterSignup/index.js +4 -4
- package/dist/components/NewsletterSignup/index.server.js +2 -2
- package/dist/components/NodePasswordForm/index.js +6 -7
- package/dist/components/OrderVariableSelection/OrderVariableSelectionMutation.d.ts +7 -0
- package/dist/components/OrderVariableSelection/OrderVariableSelectionRedux.d.ts +11 -0
- package/dist/components/OrderVariableSelection/OrderVariableSelectionRedux.js +37 -0
- package/dist/components/OrderVariableSelection/index.d.ts +33 -0
- package/dist/components/OrderVariableSelection/index.js +184 -0
- package/dist/components/Precart/License.js +1 -1
- package/dist/components/Precart/index.js +4 -4
- package/dist/components/Price/index.js +2 -2
- package/dist/components/PriceBar/PriceBarSection.js +7 -27
- package/dist/components/PriceBar/index.js +4 -4
- package/dist/components/Root/index.js +4 -4
- package/dist/components/Root/productState.js +1 -1
- package/dist/components/SKUPrice/index.js +5 -31
- package/dist/components/Select/index.js +2 -2
- package/dist/components/SelectButton/index.js +5 -5
- package/dist/components/SelectField/index.js +4 -4
- package/dist/components/SpecimenLink/index.js +1 -1
- package/dist/components/StickyNav/index.js +3 -3
- package/dist/components/StoreModal/StoreModalBundleButton.js +3 -3
- package/dist/components/StoreModal/StoreModalCart.d.ts +0 -1
- package/dist/components/StoreModal/StoreModalCart.js +34 -21
- package/dist/components/StoreModal/StoreModalCheckout.js +46 -49
- package/dist/components/StoreModal/StoreModalCheckoutContext.js +1 -1
- package/dist/components/StoreModal/StoreModalContainer.js +5 -4
- package/dist/components/StoreModal/StoreModalDownload.js +3 -3
- package/dist/components/StoreModal/StoreModalFamily.js +4 -4
- package/dist/components/StoreModal/StoreModalFamilyButton.js +3 -3
- package/dist/components/StoreModal/StoreModalIndex.js +1 -1
- package/dist/components/StoreModal/StoreModalIndexItem.js +3 -3
- package/dist/components/StoreModal/StoreModalLicenseeIsBillingSelection.d.ts +7 -0
- package/dist/components/StoreModal/StoreModalLicenseeIsBillingSelection.js +31 -0
- package/dist/components/StoreModal/StoreModalLoader.js +2 -2
- package/dist/components/StoreModal/StoreModalOrderVariableSelection.d.ts +9 -0
- package/dist/components/StoreModal/StoreModalOrderVariableSelection.js +78 -0
- package/dist/components/StoreModal/StoreModalProduct.js +89 -16
- package/dist/components/StoreModal/StoreModalReviewIdentity.js +3 -3
- package/dist/components/StoreModal/StoreModalRouter.js +3 -3
- package/dist/components/StoreModal/StoreModalStyleButton.js +3 -3
- package/dist/components/StoreModal/index.js +3 -3
- package/dist/components/StoreModal/routes.d.ts +0 -2
- package/dist/components/StoreModal/routes.js +6 -12
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.d.ts +1 -1
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.js +5 -5
- package/dist/components/StoreModalProductLicenseSelection/LicenseVariableElement.js +1 -1
- package/dist/components/StoreModalProductLicenseSelection/LicenseVariableRadioElement.js +3 -3
- package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +6 -5
- package/dist/components/StoreModalProductLicenseSelection/index.d.ts +5 -1
- package/dist/components/StoreModalProductLicenseSelection/index.js +17 -10
- package/dist/components/StoreModalProductSummary/index.d.ts +5 -6
- package/dist/components/StoreModalProductSummary/index.js +78 -48
- package/dist/components/StripeLogo.d.ts +2 -0
- package/dist/components/StripeLogo.js +17 -0
- package/dist/components/StripeProvider/index.d.ts +2 -1
- package/dist/components/StripeProvider/index.js +122 -60
- package/dist/components/Stylesheet/index.js +2 -2
- package/dist/components/TestFontsForm/TestFontsFormElement.js +2 -2
- package/dist/components/TestFontsForm/index.js +4 -4
- package/dist/components/TestFontsForm/index.server.js +2 -2
- package/dist/components/TestModeBanner/index.js +1 -1
- package/dist/components/TextField/index.js +2 -2
- package/dist/components/ThemeConfig/index.js +1 -1
- package/dist/components/ThemeConfig/index.server.js +1 -1
- package/dist/components/TypeTester/TypeTesterAlignButtons.js +1 -1
- package/dist/components/TypeTester/TypeTesterBullet.js +1 -1
- package/dist/components/TypeTester/TypeTesterContent.js +4 -4
- package/dist/components/TypeTester/TypeTesterContext.js +2 -2
- package/dist/components/TypeTester/TypeTesterEditAll.js +3 -3
- package/dist/components/TypeTester/TypeTesterFeatures.js +3 -3
- package/dist/components/TypeTester/TypeTesterFeaturesButton.js +3 -3
- package/dist/components/TypeTester/TypeTesterFitter.js +2 -2
- package/dist/components/TypeTester/TypeTesterFloatingToolbar.js +3 -3
- package/dist/components/TypeTester/TypeTesterInput.js +2 -2
- package/dist/components/TypeTester/TypeTesterSlider.js +2 -2
- package/dist/components/TypeTester/TypeTesterStandalone.js +36 -5
- package/dist/components/TypeTester/TypeTesterStandalone.server.js +4 -10
- package/dist/components/TypeTester/TypeTesterStandaloneElement.js +2 -2
- package/dist/components/TypeTester/TypeTesterState.js +1 -1
- package/dist/components/TypeTester/TypeTesterStyleSelect.js +1 -1
- package/dist/components/TypeTester/TypeTesterStyleSelectData.js +4 -4
- package/dist/components/TypeTester/TypeTesterToolbar.js +3 -3
- package/dist/components/TypeTester/TypeTesterVariableAxes.js +1 -1
- package/dist/components/TypeTester/index.d.ts +2 -0
- package/dist/components/TypeTester/index.js +12 -47
- package/dist/components/TypeTester/useFeaturesData.js +1 -1
- package/dist/components/TypeTesters/TypeTestersElement.js +2 -2
- package/dist/components/TypeTesters/index.js +85 -20
- package/dist/components/TypeTesters/index.server.js +5 -11
- package/dist/components/VariableTableAmounts/index.js +1 -1
- package/dist/components/elements/Button/index.js +2 -2
- package/dist/components/elements/EmptyCart/index.js +3 -3
- package/dist/components/elements/StoreModalCartLayout/index.d.ts +3 -3
- package/dist/components/elements/StoreModalCartLayout/index.js +12 -14
- package/dist/components/elements/StoreModalContainer/StoreModalContainerContext.js +1 -1
- package/dist/components/elements/StoreModalContainer/index.d.ts +1 -0
- package/dist/components/elements/StoreModalContainer/index.js +6 -4
- package/dist/components/elements/StoreModalDownloadLayout/index.js +1 -1
- package/dist/components/elements/StoreModalFamily/index.js +1 -1
- package/dist/components/elements/StoreModalFamilyButton/index.js +2 -2
- package/dist/components/elements/StoreModalIndexItem/index.js +1 -1
- package/dist/components/elements/StoreModalLicenseeIsBillingIdentityElement.d.ts +11 -0
- package/dist/components/elements/StoreModalLicenseeIsBillingIdentityElement.js +61 -0
- package/dist/components/elements/StoreModalLoadingScreen/index.js +1 -1
- package/dist/components/elements/StoreModalPageContainer/index.js +1 -1
- package/dist/components/elements/StoreModalStyleButton/index.js +2 -2
- package/dist/components/elements/StoreModalUnifiedCheckout.d.ts +10 -0
- package/dist/components/elements/StoreModalUnifiedCheckout.js +494 -0
- package/dist/components/useFontStyle.js +1 -1
- package/dist/components/useTotalStyles.js +1 -1
- package/dist/fontdue.css +339 -232
- package/dist/hooks/useLicenseAndOrderVariables.d.ts +5 -0
- package/dist/hooks/useLicenseAndOrderVariables.js +25 -0
- package/dist/hooks/useOrderVariables.d.ts +5 -0
- package/dist/hooks/useRefetchOnLicenseChanges.d.ts +22 -0
- package/dist/hooks/useRefetchOnLicenseChanges.js +61 -0
- package/dist/react-ranger.js +1 -1
- package/dist/reducer.d.ts +12 -0
- package/dist/reducer.js +17 -1
- package/dist/relay/environment.d.ts +1 -1
- package/dist/relay/environment.js +6 -9
- package/dist/vanilla/FontStyle.js +1 -1
- package/package.json +5 -5
|
@@ -4,312 +4,101 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = CartItem;
|
|
7
|
-
var _CartItem_product2 = _interopRequireDefault(require("../../../__generated__/CartItem_product.graphql"));
|
|
8
|
-
var _CartItem_licenseSelection2 = _interopRequireDefault(require("../../../__generated__/CartItem_licenseSelection.graphql"));
|
|
9
|
-
var _CartItem_variable2 = _interopRequireDefault(require("../../../__generated__/CartItem_variable.graphql"));
|
|
10
|
-
var _CartItem_license2 = _interopRequireDefault(require("../../../__generated__/CartItem_license.graphql"));
|
|
11
7
|
var _CartItem_node2 = _interopRequireDefault(require("../../../__generated__/CartItem_node.graphql"));
|
|
12
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
9
|
var _reactRelay = require("react-relay");
|
|
14
10
|
var _Price = _interopRequireDefault(require("../../Price"));
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
const plural = (count, singularString, pluralString) => {
|
|
25
|
-
if (count === 1) return `1 ${singularString}`;
|
|
26
|
-
const str = pluralString || `${singularString}s`;
|
|
27
|
-
return `${count} ${str}`;
|
|
28
|
-
};
|
|
29
|
-
const groupSelectionsByLicense = node => {
|
|
30
|
-
var _node$licenseSelectio;
|
|
31
|
-
return (_node$licenseSelectio = node.licenseSelections) === null || _node$licenseSelectio === void 0 ? void 0 : _node$licenseSelectio.reduce((res, _ref) => {
|
|
32
|
-
var _res$license$id;
|
|
33
|
-
let {
|
|
34
|
-
license,
|
|
35
|
-
...selection
|
|
36
|
-
} = _ref;
|
|
37
|
-
return {
|
|
38
|
-
...res,
|
|
39
|
-
[license.id]: {
|
|
40
|
-
license,
|
|
41
|
-
selections: (((_res$license$id = res[license.id]) === null || _res$license$id === void 0 ? void 0 : _res$license$id.selections) ?? []).concat(selection)
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}, {});
|
|
45
|
-
};
|
|
46
|
-
const productName = product => {
|
|
47
|
-
if (!product) return '??';
|
|
48
|
-
if (product.__typename === 'FontStyle' && product.family) return `${product.family.name} ${product.name}`;
|
|
49
|
-
return product.name;
|
|
50
|
-
};
|
|
51
|
-
const ProductName = _ref2 => {
|
|
52
|
-
let {
|
|
53
|
-
product
|
|
54
|
-
} = _ref2;
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement("h3", {
|
|
56
|
-
className: "cart-item__name"
|
|
57
|
-
}, productName(product));
|
|
58
|
-
};
|
|
59
|
-
const Variable = _ref3 => {
|
|
60
|
-
var _selection$option, _selection$option2, _selection$option3, _variable$options;
|
|
61
|
-
let {
|
|
62
|
-
selection,
|
|
63
|
-
variable,
|
|
64
|
-
onChange
|
|
65
|
-
} = _ref3;
|
|
66
|
-
if (!variable) return null;
|
|
67
|
-
if (!selection.variable) return null;
|
|
68
|
-
return /*#__PURE__*/_react.default.createElement("label", {
|
|
69
|
-
className: "cart-item__license-variable__option",
|
|
70
|
-
"data-variable-type": selection.variable.variableType
|
|
71
|
-
}, selection.variable.variableType === 'select' || selection.variable.variableType === 'table' ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, selection.variable.variableType === 'table' ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
72
|
-
className: "cart-item__license-variable__option-name"
|
|
73
|
-
}, (_selection$option = selection.option) === null || _selection$option === void 0 ? void 0 : _selection$option.name), /*#__PURE__*/_react.default.createElement(_VariableTableAmounts.default, {
|
|
74
|
-
variable: selection.variable,
|
|
75
|
-
option: selection.option
|
|
76
|
-
})) : (_selection$option2 = selection.option) === null || _selection$option2 === void 0 ? void 0 : _selection$option2.amount, /*#__PURE__*/_react.default.createElement(_Icons.CarrotDown, null), /*#__PURE__*/_react.default.createElement("select", {
|
|
77
|
-
value: (_selection$option3 = selection.option) === null || _selection$option3 === void 0 ? void 0 : _selection$option3.id,
|
|
78
|
-
onChange: e => onChange({
|
|
79
|
-
licenseOptionId: e.target.value
|
|
80
|
-
})
|
|
81
|
-
}, (_variable$options = variable.options) === null || _variable$options === void 0 ? void 0 : _variable$options.map((option, i) => {
|
|
82
|
-
var _selection$variable;
|
|
83
|
-
return /*#__PURE__*/_react.default.createElement("option", {
|
|
84
|
-
key: i,
|
|
85
|
-
value: option.id
|
|
86
|
-
}, ((_selection$variable = selection.variable) === null || _selection$variable === void 0 ? void 0 : _selection$variable.variableType) === 'table' ? option.name : option.amount);
|
|
87
|
-
}))) : /*#__PURE__*/_react.default.createElement(_VariableTextInput.default, {
|
|
88
|
-
defaultValue: selection.variableText,
|
|
89
|
-
placeholder: `${variable.name} *`,
|
|
90
|
-
onChange: onChange
|
|
91
|
-
}));
|
|
92
|
-
};
|
|
93
|
-
const getSelectionIds = _ref4 => {
|
|
94
|
-
let {
|
|
95
|
-
license,
|
|
96
|
-
variable,
|
|
97
|
-
option,
|
|
98
|
-
variableText
|
|
99
|
-
} = _ref4;
|
|
100
|
-
return {
|
|
101
|
-
licenseId: license.id,
|
|
102
|
-
licenseVariableId: variable ? variable.id : null,
|
|
103
|
-
licenseOptionId: option ? option.id : null,
|
|
104
|
-
variableText
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
const inputFromOptionChange = (node, variableId, value) => {
|
|
108
|
-
var _node$licenseSelectio2;
|
|
109
|
-
return {
|
|
110
|
-
id: node.id,
|
|
111
|
-
licenseSelections: ((_node$licenseSelectio2 = node.licenseSelections) === null || _node$licenseSelectio2 === void 0 ? void 0 : _node$licenseSelectio2.map(selection => {
|
|
112
|
-
if (selection.variable && selection.variable.id === variableId) {
|
|
113
|
-
return {
|
|
114
|
-
licenseId: selection.license.id,
|
|
115
|
-
licenseVariableId: selection.variable.id,
|
|
116
|
-
licenseOptionId: value.licenseOptionId ?? null,
|
|
117
|
-
variableText: value.variableText || null
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// map gql output to input
|
|
122
|
-
return getSelectionIds(selection);
|
|
123
|
-
})) ?? []
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
const inputFromLicenseRemoval = (node, licenseToRemove) => {
|
|
127
|
-
var _node$licenseSelectio3;
|
|
128
|
-
const licenseSelections = ((_node$licenseSelectio3 = node.licenseSelections) === null || _node$licenseSelectio3 === void 0 ? void 0 : _node$licenseSelectio3.filter(_ref5 => {
|
|
129
|
-
let {
|
|
130
|
-
license
|
|
131
|
-
} = _ref5;
|
|
132
|
-
return license.id !== licenseToRemove.id;
|
|
133
|
-
}).map(getSelectionIds)) ?? [];
|
|
134
|
-
return {
|
|
135
|
-
id: node.id,
|
|
136
|
-
licenseSelections
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
const additionalLicenseInput = license => {
|
|
140
|
-
if (license.variables && license.variables.length > 0) {
|
|
141
|
-
return license.variables.map(variable => {
|
|
142
|
-
var _variable$options2, _variable$options2$;
|
|
143
|
-
return {
|
|
144
|
-
licenseId: license.id,
|
|
145
|
-
licenseVariableId: variable.id,
|
|
146
|
-
licenseOptionId: ((_variable$options2 = variable.options) === null || _variable$options2 === void 0 ? void 0 : (_variable$options2$ = _variable$options2[0]) === null || _variable$options2$ === void 0 ? void 0 : _variable$options2$.id) ?? null
|
|
147
|
-
};
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
return [{
|
|
151
|
-
licenseId: license.id,
|
|
152
|
-
licenseVariableId: null,
|
|
153
|
-
licenseOptionId: null
|
|
154
|
-
}];
|
|
155
|
-
};
|
|
156
|
-
const inputFromLicenseAddition = (node, licenseToAdd) => {
|
|
157
|
-
var _node$licenseSelectio4;
|
|
158
|
-
const licenseSelections = ((_node$licenseSelectio4 = node.licenseSelections) === null || _node$licenseSelectio4 === void 0 ? void 0 : _node$licenseSelectio4.map(getSelectionIds).concat(additionalLicenseInput(licenseToAdd))) ?? [];
|
|
159
|
-
return {
|
|
160
|
-
id: node.id,
|
|
161
|
-
licenseSelections
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
const AdditionalLicenses = _ref6 => {
|
|
165
|
-
var _orderItem$licenseSel;
|
|
166
|
-
let {
|
|
167
|
-
licenses,
|
|
168
|
-
orderItem,
|
|
169
|
-
onAddLicense
|
|
170
|
-
} = _ref6;
|
|
171
|
-
if (!licenses) return null;
|
|
172
|
-
const licenseIds = (_orderItem$licenseSel = orderItem.licenseSelections) === null || _orderItem$licenseSel === void 0 ? void 0 : _orderItem$licenseSel.map(_ref7 => {
|
|
173
|
-
let {
|
|
174
|
-
license
|
|
175
|
-
} = _ref7;
|
|
176
|
-
return license.id;
|
|
177
|
-
});
|
|
178
|
-
const additionalLicenses = licenses.filter(license => !(licenseIds !== null && licenseIds !== void 0 && licenseIds.some(id => id === license.id)));
|
|
179
|
-
if (additionalLicenses.length < 1) return null;
|
|
180
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
181
|
-
className: "cart-item__additional-licenses"
|
|
182
|
-
}, "+ Add:", ' ', additionalLicenses.map(license => /*#__PURE__*/_react.default.createElement("button", {
|
|
183
|
-
type: "button",
|
|
184
|
-
className: "cart-item__additional-licenses__item",
|
|
185
|
-
key: license.id,
|
|
186
|
-
onClick: onAddLicense.bind(null, license)
|
|
187
|
-
}, license.name)));
|
|
188
|
-
};
|
|
189
|
-
const CartItemLicense = _ref8 => {
|
|
11
|
+
var _CartItemLicense = _interopRequireDefault(require("./CartItemLicense"));
|
|
12
|
+
var _CartItemAdditionalLicenses = _interopRequireDefault(require("./CartItemAdditionalLicenses"));
|
|
13
|
+
var _CartItemProduct = _interopRequireDefault(require("./CartItemProduct"));
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function CartItem(_ref) {
|
|
18
|
+
var _node$licenseSelectio, _node$licenseSelectio2, _node$sku2, _node$sku3, _node$sku3$product;
|
|
190
19
|
let {
|
|
191
|
-
node,
|
|
20
|
+
node: nodeKey,
|
|
192
21
|
onChange,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
selections
|
|
197
|
-
} = _ref8;
|
|
198
|
-
if (!license) return null;
|
|
22
|
+
errors
|
|
23
|
+
} = _ref;
|
|
24
|
+
const node = (0, _reactRelay.useFragment)((_CartItem_node2.default.hash && _CartItem_node2.default.hash !== "c17a59a874f66eaed523d8928f9f1171" && console.error("The definition of 'CartItem_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItem_node2.default), nodeKey);
|
|
199
25
|
const [closeButtonIsHovered, setCloseButtonIsHovered] = (0, _react.useState)(false);
|
|
200
26
|
const closeButtonMouseEnter = () => {
|
|
201
|
-
parentCloseButtonMouseEnter();
|
|
202
27
|
setCloseButtonIsHovered(true);
|
|
203
28
|
};
|
|
204
29
|
const closeButtonMouseLeave = () => {
|
|
205
|
-
parentCloseButtonMouseLeave();
|
|
206
30
|
setCloseButtonIsHovered(false);
|
|
207
31
|
};
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
32
|
+
const groupedSelections = (_node$licenseSelectio = node.licenseSelections) === null || _node$licenseSelectio === void 0 ? void 0 : _node$licenseSelectio.reduce((res, selection) => ({
|
|
33
|
+
...res,
|
|
34
|
+
[selection.license.id]: (res[selection.license.id] ?? []).concat(selection)
|
|
35
|
+
}), {});
|
|
36
|
+
if (!groupedSelections) return null;
|
|
37
|
+
const existingLicenseSelectionsInputs = ((_node$licenseSelectio2 = node.licenseSelections) === null || _node$licenseSelectio2 === void 0 ? void 0 : _node$licenseSelectio2.map(s => {
|
|
38
|
+
var _s$licenseVariable, _s$licenseOption;
|
|
39
|
+
return {
|
|
40
|
+
id: s.id,
|
|
41
|
+
licenseId: s.license.id,
|
|
42
|
+
licenseVariableId: (_s$licenseVariable = s.licenseVariable) === null || _s$licenseVariable === void 0 ? void 0 : _s$licenseVariable.id,
|
|
43
|
+
licenseOptionId: (_s$licenseOption = s.licenseOption) === null || _s$licenseOption === void 0 ? void 0 : _s$licenseOption.id,
|
|
44
|
+
variableText: s.variableText
|
|
45
|
+
};
|
|
46
|
+
})) ?? [];
|
|
47
|
+
const handleChangeSelection = selection => {
|
|
48
|
+
onChange({
|
|
49
|
+
id: node.id,
|
|
50
|
+
licenseSelections: existingLicenseSelectionsInputs.filter(s => s.id !== selection.id).concat(selection)
|
|
51
|
+
});
|
|
211
52
|
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
className: "cart-item__license__wrapper"
|
|
218
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
-
className: "cart-item__license-name"
|
|
220
|
-
}, license.name), selections.length > 0 && /*#__PURE__*/_react.default.createElement("ul", {
|
|
221
|
-
className: "cart-item__license-variables"
|
|
222
|
-
}, selections.map(selection => {
|
|
223
|
-
var _license$variables;
|
|
224
|
-
return /*#__PURE__*/_react.default.createElement("li", {
|
|
225
|
-
className: "cart-item__license-variable",
|
|
226
|
-
key: selection.id
|
|
227
|
-
}, /*#__PURE__*/_react.default.createElement(Variable, {
|
|
228
|
-
selection: selection,
|
|
229
|
-
onChange: value => onChange(inputFromOptionChange(node, selection.variable.id, value)),
|
|
230
|
-
variable: (_license$variables = license.variables) === null || _license$variables === void 0 ? void 0 : _license$variables.find(_ref9 => {
|
|
231
|
-
var _selection$variable2;
|
|
232
|
-
let {
|
|
233
|
-
id
|
|
234
|
-
} = _ref9;
|
|
235
|
-
return id === ((_selection$variable2 = selection.variable) === null || _selection$variable2 === void 0 ? void 0 : _selection$variable2.id);
|
|
236
|
-
})
|
|
237
|
-
}));
|
|
238
|
-
}))), /*#__PURE__*/_react.default.createElement("button", {
|
|
239
|
-
type: "button",
|
|
240
|
-
className: "cart-item__license__delete-button",
|
|
241
|
-
"aria-label": "Remove license",
|
|
242
|
-
onClick: handleClick,
|
|
243
|
-
onMouseEnter: closeButtonMouseEnter,
|
|
244
|
-
onMouseLeave: closeButtonMouseLeave
|
|
245
|
-
}, /*#__PURE__*/_react.default.createElement(_Icons.X, null)));
|
|
246
|
-
};
|
|
247
|
-
const productCss = product => {
|
|
248
|
-
var _product$family, _product$featureStyle, _product$featureStyle2;
|
|
249
|
-
if (!product) return;
|
|
250
|
-
if (product.__typename === 'FontStyle') return (_product$family = product.family) === null || _product$family === void 0 ? void 0 : _product$family.cssUrl;
|
|
251
|
-
if (product.__typename === 'FontCollection') return (_product$featureStyle = product.featureStyle) === null || _product$featureStyle === void 0 ? void 0 : (_product$featureStyle2 = _product$featureStyle.family) === null || _product$featureStyle2 === void 0 ? void 0 : _product$featureStyle2.cssUrl;
|
|
252
|
-
};
|
|
253
|
-
function CartItem(_ref10) {
|
|
254
|
-
var _node$sku$product, _node$sku$product2, _node$sku$product2$va, _node$sku$product3, _node$sku2, _node$sku2$product;
|
|
255
|
-
let {
|
|
256
|
-
node: nodeKey,
|
|
257
|
-
onChange
|
|
258
|
-
} = _ref10;
|
|
259
|
-
const node = (0, _reactRelay.useFragment)((_CartItem_node2.default.hash && _CartItem_node2.default.hash !== "8db972f6d8b84100198d9e31bdb3071a" && console.error("The definition of 'CartItem_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItem_node2.default), nodeKey);
|
|
260
|
-
const [closeButtonIsHovered, setCloseButtonIsHovered] = (0, _react.useState)(false);
|
|
261
|
-
const closeButtonMouseEnter = () => {
|
|
262
|
-
setCloseButtonIsHovered(true);
|
|
53
|
+
const handleRemoveLicense = licenseId => {
|
|
54
|
+
onChange({
|
|
55
|
+
id: node.id,
|
|
56
|
+
licenseSelections: existingLicenseSelectionsInputs.filter(input => input.licenseId !== licenseId)
|
|
57
|
+
});
|
|
263
58
|
};
|
|
264
|
-
const
|
|
265
|
-
|
|
59
|
+
const handleAddLicense = licenseId => {
|
|
60
|
+
var _node$sku, _node$sku$product, _node$sku$product$lic, _license$licenseVaria;
|
|
61
|
+
const license = (_node$sku = node.sku) === null || _node$sku === void 0 ? void 0 : (_node$sku$product = _node$sku.product) === null || _node$sku$product === void 0 ? void 0 : (_node$sku$product$lic = _node$sku$product.licenses) === null || _node$sku$product$lic === void 0 ? void 0 : _node$sku$product$lic.find(l => l.id === licenseId);
|
|
62
|
+
if (!license) return;
|
|
63
|
+
const newLicenseSelectionInput = (_license$licenseVaria = license.licenseVariables) !== null && _license$licenseVaria !== void 0 && _license$licenseVaria.length ? license.licenseVariables.map(variable => {
|
|
64
|
+
var _variable$licenseOpti, _variable$licenseOpti2;
|
|
65
|
+
return {
|
|
66
|
+
licenseId,
|
|
67
|
+
licenseVariableId: variable.id,
|
|
68
|
+
licenseOptionId: (_variable$licenseOpti = variable.licenseOptions) === null || _variable$licenseOpti === void 0 ? void 0 : (_variable$licenseOpti2 = _variable$licenseOpti[0]) === null || _variable$licenseOpti2 === void 0 ? void 0 : _variable$licenseOpti2.id
|
|
69
|
+
};
|
|
70
|
+
}) : [{
|
|
71
|
+
licenseId
|
|
72
|
+
}];
|
|
73
|
+
onChange({
|
|
74
|
+
id: node.id,
|
|
75
|
+
licenseSelections: existingLicenseSelectionsInputs.concat(newLicenseSelectionInput)
|
|
76
|
+
});
|
|
266
77
|
};
|
|
267
|
-
if (!node.sku) return null;
|
|
268
|
-
if (!node.sku.product) return null;
|
|
269
|
-
const groupedLicenses = groupSelectionsByLicense(node);
|
|
270
|
-
if (!groupedLicenses) return null;
|
|
271
78
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
272
79
|
className: "cart-item",
|
|
273
80
|
"data-close-button-hovered": closeButtonIsHovered,
|
|
274
|
-
"data-license-count": Object.keys(
|
|
275
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
href: productCss(node.sku.product)
|
|
279
|
-
}), ['FontCollection', 'Bundle'].indexOf(node.sku.product.__typename) >= 0 ? /*#__PURE__*/_react.default.createElement(_CollectionAa.CollectionAa, {
|
|
280
|
-
product: node.sku.product
|
|
281
|
-
}) : /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
|
|
282
|
-
fontStyle: node.sku.product
|
|
283
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, "A"), /*#__PURE__*/_react.default.createElement("span", null, "a"))) : '??'), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(ProductName, {
|
|
284
|
-
product: node.sku.product
|
|
285
|
-
}), (_node$sku$product = node.sku.product) !== null && _node$sku$product !== void 0 && _node$sku$product.isVariableFont || (_node$sku$product2 = node.sku.product) !== null && _node$sku$product2 !== void 0 && (_node$sku$product2$va = _node$sku$product2.variableInstances) !== null && _node$sku$product2$va !== void 0 && _node$sku$product2$va.length ? /*#__PURE__*/_react.default.createElement("div", {
|
|
286
|
-
className: "cart-item__label"
|
|
287
|
-
}, "Variable font") : ((_node$sku$product3 = node.sku.product) === null || _node$sku$product3 === void 0 ? void 0 : _node$sku$product3.__typename) === 'FontCollection' && /*#__PURE__*/_react.default.createElement("div", {
|
|
288
|
-
className: "cart-item__label"
|
|
289
|
-
}, "(", plural(node.sku.product.totalStyles ?? 0, 'style'), ")")), /*#__PURE__*/_react.default.createElement("ul", {
|
|
81
|
+
"data-license-count": Object.keys(groupedSelections).length
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_CartItemProduct.default, {
|
|
83
|
+
product: ((_node$sku2 = node.sku) === null || _node$sku2 === void 0 ? void 0 : _node$sku2.product) ?? null
|
|
84
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("ul", {
|
|
290
85
|
className: "cart-item__licenses"
|
|
291
|
-
}, Object.keys(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
});
|
|
302
|
-
})), node.price && /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
+
}, Object.keys(groupedSelections).filter(licenseId => groupedSelections[licenseId].length > 0).map(licenseId => /*#__PURE__*/_react.default.createElement(_CartItemLicense.default, {
|
|
87
|
+
key: licenseId,
|
|
88
|
+
onChange: handleChangeSelection,
|
|
89
|
+
onRemoveLicense: handleRemoveLicense,
|
|
90
|
+
selections: groupedSelections[licenseId],
|
|
91
|
+
closeButtonMouseEnter: closeButtonMouseEnter,
|
|
92
|
+
closeButtonMouseLeave: closeButtonMouseLeave
|
|
93
|
+
}))), errors !== null && errors !== void 0 && errors.licenseSelections ? /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
+
className: "cart-item__error"
|
|
95
|
+
}, "License selections ", errors === null || errors === void 0 ? void 0 : errors.licenseSelections) : null), node.price && /*#__PURE__*/_react.default.createElement("div", {
|
|
303
96
|
className: "cart-item__price"
|
|
304
97
|
}, /*#__PURE__*/_react.default.createElement(_Price.default, {
|
|
305
98
|
price: node.price
|
|
306
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
307
|
-
licenses: (_node$
|
|
99
|
+
})), /*#__PURE__*/_react.default.createElement(_CartItemAdditionalLicenses.default, {
|
|
100
|
+
licenses: ((_node$sku3 = node.sku) === null || _node$sku3 === void 0 ? void 0 : (_node$sku3$product = _node$sku3.product) === null || _node$sku3$product === void 0 ? void 0 : _node$sku3$product.licenses) ?? null,
|
|
308
101
|
orderItem: node,
|
|
309
|
-
onAddLicense:
|
|
102
|
+
onAddLicense: handleAddLicense
|
|
310
103
|
}));
|
|
311
|
-
}
|
|
312
|
-
_CartItem_license2.default.hash && _CartItem_license2.default.hash !== "3d3c0b942c4cb8683b41bb52ab637339" && console.error("The definition of 'CartItem_license' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItem_license2.default;
|
|
313
|
-
_CartItem_variable2.default.hash && _CartItem_variable2.default.hash !== "3e4dbfb04637c3535a85a0b920aa148b" && console.error("The definition of 'CartItem_variable' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItem_variable2.default;
|
|
314
|
-
_CartItem_licenseSelection2.default.hash && _CartItem_licenseSelection2.default.hash !== "623e900c36a5bb9ad347ddcad84598e3" && console.error("The definition of 'CartItem_licenseSelection' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItem_licenseSelection2.default;
|
|
315
|
-
_CartItem_product2.default.hash && _CartItem_product2.default.hash !== "228788dc0026bbd807c5e299620953c0" && console.error("The definition of 'CartItem_product' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartItem_product2.default;
|
|
104
|
+
}
|
|
@@ -24,41 +24,14 @@ var _CartTotals = _interopRequireDefault(require("./CartTotals"));
|
|
|
24
24
|
var _utils = require("./utils");
|
|
25
25
|
var _reactStripeJs = require("@stripe/react-stripe-js");
|
|
26
26
|
var _reactRedux = require("react-redux");
|
|
27
|
-
var
|
|
28
|
-
function _getRequireWildcardCache(
|
|
29
|
-
function _interopRequireWildcard(
|
|
30
|
-
function _interopRequireDefault(
|
|
27
|
+
var _CartState = _interopRequireDefault(require("./CartState"));
|
|
28
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
29
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
30
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
31
31
|
// @ts-ignore
|
|
32
32
|
|
|
33
33
|
// @ts-ignore
|
|
34
34
|
|
|
35
|
-
const orderChangeInput = (order, orderItem) => {
|
|
36
|
-
var _order$orderItems;
|
|
37
|
-
return (_order$orderItems = order.orderItems) === null || _order$orderItems === void 0 ? void 0 : _order$orderItems.reduce((res, item) => {
|
|
38
|
-
var _item$licenseSelectio;
|
|
39
|
-
if (item.id === orderItem.id) return res.concat(orderItem);
|
|
40
|
-
return res.concat({
|
|
41
|
-
id: item.id,
|
|
42
|
-
licenseSelections: ((_item$licenseSelectio = item.licenseSelections) === null || _item$licenseSelectio === void 0 ? void 0 : _item$licenseSelectio.map(_ref => {
|
|
43
|
-
let {
|
|
44
|
-
license,
|
|
45
|
-
licenseVariable,
|
|
46
|
-
licenseOption,
|
|
47
|
-
variableText
|
|
48
|
-
} = _ref;
|
|
49
|
-
return {
|
|
50
|
-
licenseId: license.id,
|
|
51
|
-
licenseVariableId: licenseVariable && licenseVariable.id,
|
|
52
|
-
licenseOptionId: licenseOption && licenseOption.id,
|
|
53
|
-
variableText
|
|
54
|
-
};
|
|
55
|
-
}).filter(_utils2.notEmpty)) ?? []
|
|
56
|
-
});
|
|
57
|
-
}, [])
|
|
58
|
-
|
|
59
|
-
/* remove order items if there are no licenses */.filter(item => item.licenseSelections.length > 0);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
35
|
// note here we're only updating the order (by id).
|
|
63
36
|
// careful not to update the current customer's reference
|
|
64
37
|
// to its order, since at this time it will turn to `null`
|
|
@@ -71,17 +44,17 @@ const submitCompleteMutation = (_CartOrderCompleteOrderMutation2.default.hash &&
|
|
|
71
44
|
_CartOrder_UpdateErrors2.default.hash && _CartOrder_UpdateErrors2.default.hash !== "0bc5cd4fa568238d362a545367f9c306" && console.error("The definition of 'CartOrder_UpdateErrors' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartOrder_UpdateErrors2.default;
|
|
72
45
|
const orderChangeMutation = (_CartOrderUpdateMutation2.default.hash && _CartOrderUpdateMutation2.default.hash !== "9f208ec36dbea5d90eeae4574b48bd15" && console.error("The definition of 'CartOrderUpdateMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartOrderUpdateMutation2.default);
|
|
73
46
|
const removeDiscountMutation = (_CartOrderRemoveDiscountMutation2.default.hash && _CartOrderRemoveDiscountMutation2.default.hash !== "8a84a9135f1406fa9c4cc16dc2e11d30" && console.error("The definition of 'CartOrderRemoveDiscountMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartOrderRemoveDiscountMutation2.default);
|
|
74
|
-
const CartOrder =
|
|
47
|
+
const CartOrder = _ref => {
|
|
75
48
|
var _order$stripePaymentM, _viewer$settings;
|
|
76
49
|
let {
|
|
77
50
|
order: orderKey,
|
|
78
51
|
viewer: viewerKey,
|
|
79
52
|
status
|
|
80
|
-
} =
|
|
53
|
+
} = _ref;
|
|
81
54
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
82
55
|
const stripe = (0, _reactStripeJs.useStripe)();
|
|
83
56
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
84
|
-
const order = (0, _reactRelay.useFragment)((_CartOrder_order2.default.hash && _CartOrder_order2.default.hash !== "
|
|
57
|
+
const order = (0, _reactRelay.useFragment)((_CartOrder_order2.default.hash && _CartOrder_order2.default.hash !== "25ef000c40000c4f76f973ac6ac7f593" && console.error("The definition of 'CartOrder_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartOrder_order2.default), orderKey);
|
|
85
58
|
const viewer = (0, _reactRelay.useFragment)((_CartOrder_viewer2.default.hash && _CartOrder_viewer2.default.hash !== "13e1fb5c61670fcdf4add0214ea88ea5" && console.error("The definition of 'CartOrder_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartOrder_viewer2.default), viewerKey);
|
|
86
59
|
|
|
87
60
|
// errors is from the payload, typically user errors,
|
|
@@ -261,11 +234,18 @@ const CartOrder = _ref2 => {
|
|
|
261
234
|
className: "cart__error__button"
|
|
262
235
|
}, "Click here"), ' ', "to empty your cart and continue shopping."), /*#__PURE__*/_react.default.createElement("div", {
|
|
263
236
|
className: "cart__middle"
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
237
|
+
}, /*#__PURE__*/_react.default.createElement(_CartState.default, {
|
|
238
|
+
order: order
|
|
239
|
+
}, _ref2 => {
|
|
240
|
+
let {
|
|
241
|
+
onUpdateOrderItem
|
|
242
|
+
} = _ref2;
|
|
243
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderItems.map((item, i) => /*#__PURE__*/_react.default.createElement(_CartItem.default, {
|
|
244
|
+
key: i,
|
|
245
|
+
node: item,
|
|
246
|
+
onChange: onUpdateOrderItem
|
|
247
|
+
})));
|
|
248
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
269
249
|
className: "cart__bottom"
|
|
270
250
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
271
251
|
className: "cart__bottom__wrapper"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { OrderVariableSelectionInput } from '../../__generated__/CartStateUpdateMutation.graphql';
|
|
3
3
|
import { CartState_order$key } from '../../__generated__/CartState_order.graphql';
|
|
4
|
+
import { CartItemChangeInput } from './types';
|
|
4
5
|
interface CartStateProps {
|
|
5
6
|
order: CartState_order$key;
|
|
6
7
|
children: (props: {
|
|
7
|
-
|
|
8
|
+
onUpdateOrderVariableSelections: (variables: OrderVariableSelectionInput[]) => void;
|
|
9
|
+
onUpdateOrderItem: (item: CartItemChangeInput) => void;
|
|
8
10
|
onRemoveDiscount: () => void;
|
|
9
11
|
error: any;
|
|
10
12
|
errors: any;
|
|
@@ -9,40 +9,54 @@ var _CartStateRemoveDiscountMutation2 = _interopRequireDefault(require("../../__
|
|
|
9
9
|
var _CartStateUpdateMutation2 = _interopRequireDefault(require("../../__generated__/CartStateUpdateMutation.graphql"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _reactRelay = require("react-relay");
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
const orderChangeMutation = (_CartStateUpdateMutation2.default.hash && _CartStateUpdateMutation2.default.hash !== "
|
|
14
|
-
const removeDiscountMutation = (_CartStateRemoveDiscountMutation2.default.hash && _CartStateRemoveDiscountMutation2.default.hash !== "
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const orderChangeMutation = (_CartStateUpdateMutation2.default.hash && _CartStateUpdateMutation2.default.hash !== "eaef5edfd81a204aa6b0c9bd579509ec" && console.error("The definition of 'CartStateUpdateMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartStateUpdateMutation2.default);
|
|
14
|
+
const removeDiscountMutation = (_CartStateRemoveDiscountMutation2.default.hash && _CartStateRemoveDiscountMutation2.default.hash !== "bdcfcd6638660e83a61555dcd1786886" && console.error("The definition of 'CartStateRemoveDiscountMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartStateRemoveDiscountMutation2.default);
|
|
15
15
|
function CartState(_ref) {
|
|
16
16
|
let {
|
|
17
17
|
order: orderKey,
|
|
18
18
|
children
|
|
19
19
|
} = _ref;
|
|
20
|
-
const order = (0, _reactRelay.useFragment)((_CartState_order2.default.hash && _CartState_order2.default.hash !== "
|
|
20
|
+
const order = (0, _reactRelay.useFragment)((_CartState_order2.default.hash && _CartState_order2.default.hash !== "68bef9bb04269f0547150c81f957d45b" && console.error("The definition of 'CartState_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _CartState_order2.default), orderKey);
|
|
21
21
|
const [error, setError] = (0, _react.useState)(null);
|
|
22
22
|
const [errors, setErrors] = (0, _react.useState)(null);
|
|
23
23
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
24
|
-
const
|
|
24
|
+
const handleUpdateOrder = (0, _react.useCallback)(input => {
|
|
25
25
|
(0, _reactRelay.commitMutation)(environment, {
|
|
26
26
|
mutation: orderChangeMutation,
|
|
27
27
|
variables: {
|
|
28
|
-
input
|
|
29
|
-
orderItems
|
|
30
|
-
}
|
|
28
|
+
input
|
|
31
29
|
},
|
|
32
30
|
onCompleted: (result, error) => {
|
|
33
31
|
if (error) {
|
|
34
32
|
setError(error);
|
|
35
33
|
} else if (result.updateOrder && result.updateOrder.errors) {
|
|
36
34
|
setErrors(result.updateOrder.errors);
|
|
35
|
+
} else {
|
|
36
|
+
setError(null);
|
|
37
|
+
setErrors(null);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, [environment, order]);
|
|
42
|
+
const handleRemoveDiscount = (0, _react.useCallback)(() => {
|
|
43
|
+
(0, _reactRelay.commitMutation)(environment, {
|
|
44
|
+
mutation: removeDiscountMutation,
|
|
45
|
+
variables: {},
|
|
46
|
+
onCompleted: (_result, error) => {
|
|
47
|
+
if (error) {
|
|
48
|
+
setError(error);
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
51
|
});
|
|
40
|
-
};
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
}, [environment]);
|
|
53
|
+
const handleUpdateOrderItem = (0, _react.useCallback)(item => {
|
|
54
|
+
// Handle CartItemChangeInput to maintain backward compatibility
|
|
55
|
+
const newItem = item;
|
|
56
|
+
const orderItems = (order.orderItems || []).reduce((res, item) => {
|
|
57
|
+
if (item.id === newItem.id) return res.concat([newItem]);
|
|
44
58
|
if (!item.licenseSelections) return res;
|
|
45
|
-
return res.concat({
|
|
59
|
+
return res.concat([{
|
|
46
60
|
id: item.id,
|
|
47
61
|
licenseSelections: item.licenseSelections.map(_ref2 => {
|
|
48
62
|
let {
|
|
@@ -59,26 +73,23 @@ function CartState(_ref) {
|
|
|
59
73
|
variableText
|
|
60
74
|
};
|
|
61
75
|
})
|
|
62
|
-
}).filter(Boolean);
|
|
76
|
+
}]).filter(Boolean);
|
|
63
77
|
}, [])
|
|
64
78
|
/* remove order items if there are no licenses */.filter(item => item.licenseSelections.length > 0);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (error) {
|
|
73
|
-
setError(error);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
79
|
+
handleUpdateOrder({
|
|
80
|
+
orderItems
|
|
81
|
+
});
|
|
82
|
+
}, [order.orderItems]);
|
|
83
|
+
const handleUpdateOrderVariableSelections = (0, _react.useCallback)(variables => {
|
|
84
|
+
handleUpdateOrder({
|
|
85
|
+
orderVariableSelections: variables
|
|
76
86
|
});
|
|
77
|
-
}, []);
|
|
87
|
+
}, [handleUpdateOrder]);
|
|
78
88
|
return children({
|
|
79
|
-
|
|
89
|
+
onUpdateOrderVariableSelections: handleUpdateOrderVariableSelections,
|
|
80
90
|
onRemoveDiscount: handleRemoveDiscount,
|
|
81
|
-
|
|
82
|
-
|
|
91
|
+
onUpdateOrderItem: handleUpdateOrderItem,
|
|
92
|
+
errors,
|
|
93
|
+
error
|
|
83
94
|
});
|
|
84
95
|
}
|
|
@@ -11,8 +11,8 @@ var _relayRuntime = require("relay-runtime");
|
|
|
11
11
|
var _Price = _interopRequireDefault(require("../Price"));
|
|
12
12
|
var _CouponText = _interopRequireDefault(require("../CouponText"));
|
|
13
13
|
var _Icons = require("../Icons");
|
|
14
|
-
function _interopRequireDefault(
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
16
|
function percentage(decimalValue) {
|
|
17
17
|
if (!decimalValue) return null;
|
|
18
18
|
return `${parseFloat(decimalValue) * 100}%`;
|