fontdue-js 2.22.4 → 3.0.0-alpha1
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/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__/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__/ServerConfigProviderQuery.graphql.js +1 -8
- 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__/TestModeBannerQuery.graphql.js +1 -8
- package/dist/__generated__/ThemeConfigQuery.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__/TypeTesterStyleSelectData_viewer.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__/TypeTester_viewer.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__/TypeTesters_viewer.graphql.js +1 -8
- package/dist/__generated__/VariableTableAmounts_option.graphql.js +1 -8
- package/dist/__generated__/VariableTableAmounts_variable.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/components/AddToCartBanner/index.js +19 -29
- package/dist/components/BuyButton/index.d.ts +3 -3
- package/dist/components/BuyButton/index.js +36 -46
- package/dist/components/BuyButton/index.server.d.ts +1 -1
- package/dist/components/BuyButton/index.server.js +10 -17
- 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 +99 -110
- 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/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 +2 -2
- package/dist/components/CartButton/index.js +29 -38
- package/dist/components/CartButton/index.server.d.ts +1 -1
- package/dist/components/CartButton/index.server.js +7 -14
- package/dist/components/CharacterViewer/StyleSelect.d.ts +1 -1
- package/dist/components/CharacterViewer/StyleSelect.js +10 -17
- package/dist/components/CharacterViewer/index.d.ts +3 -3
- package/dist/components/CharacterViewer/index.js +79 -89
- package/dist/components/CharacterViewer/index.server.d.ts +1 -1
- package/dist/components/CharacterViewer/index.server.js +10 -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 +12 -12
- package/dist/components/ConfigContext.js +4 -11
- package/dist/components/ConsentBanner/consent.js +6 -17
- package/dist/components/ConsentBanner/index.js +19 -29
- package/dist/components/CookieNotification/index.js +19 -27
- 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 +23 -32
- 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 +1 -1
- package/dist/components/FontStyle/index.js +8 -15
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.d.ts +6 -4
- package/dist/components/FontdueProvider/FontdueProviderClientComponent.js +48 -39
- package/dist/components/FontdueProvider/index.d.ts +2 -2
- package/dist/components/FontdueProvider/index.js +32 -15
- package/dist/components/FontdueProvider/index.server.d.ts +2 -2
- package/dist/components/FontdueProvider/index.server.js +24 -22
- 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 +2 -2
- package/dist/components/NewsletterSignup/index.js +51 -60
- package/dist/components/NewsletterSignup/index.server.d.ts +1 -1
- package/dist/components/NewsletterSignup/index.server.js +7 -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 +1 -1
- package/dist/components/ServerConfigProvider/index.js +9 -18
- 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 +51 -61
- 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.js +10 -19
- 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 +2 -2
- package/dist/components/TestFontsForm/index.js +56 -65
- package/dist/components/TestFontsForm/index.server.d.ts +1 -1
- package/dist/components/TestFontsForm/index.server.js +7 -14
- package/dist/components/TestModeBanner/index.js +10 -16
- package/dist/components/TextField/index.js +9 -17
- package/dist/components/ThemeConfig/index.d.ts +2 -2
- package/dist/components/ThemeConfig/index.js +14 -20
- package/dist/components/ThemeConfig/index.server.js +7 -14
- 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/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 +3 -3
- package/dist/components/TypeTester/TypeTesterStandalone.js +31 -40
- package/dist/components/TypeTester/TypeTesterStandalone.preload.d.ts +3 -3
- package/dist/components/TypeTester/TypeTesterStandalone.preload.js +4 -4
- package/dist/components/TypeTester/TypeTesterStandalone.server.d.ts +1 -1
- package/dist/components/TypeTester/TypeTesterStandalone.server.js +7 -14
- 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 +4 -4
- package/dist/components/TypeTester/TypeTesterStyleSelectData.js +21 -30
- 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 +3 -3
- 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 +2 -2
- package/dist/components/TypeTester/useTypeTesterStyler.js +6 -13
- package/dist/components/TypeTesters/TypeTestersElement.js +4 -12
- package/dist/components/TypeTesters/index.d.ts +4 -4
- package/dist/components/TypeTesters/index.js +61 -70
- package/dist/components/TypeTesters/index.server.d.ts +1 -1
- package/dist/components/TypeTesters/index.server.js +10 -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 +9 -19
- 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 +16 -25
- 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 +107 -115
- package/dist/components/useConsent.js +4 -9
- 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 +2 -9
- 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 +5 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- 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 +58 -33
- package/dist/relay/loadSerializableQuery.d.ts +5 -1
- package/dist/relay/loadSerializableQuery.js +4 -8
- 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 +1 -0
- package/dist/vite.js +74 -0
- package/package.json +7 -4
- package/scripts/addJsExtensionsBabelPlugin.cjs +62 -0
- package/types/globals.d.ts +3 -0
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = NewsletterSignup;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _loadSerializableQuery = _interopRequireDefault(require("../../relay/loadSerializableQuery"));
|
|
9
|
-
var _index = require("./index");
|
|
10
|
-
var _NewsletterSignupQuery = _interopRequireDefault(require("../../__generated__/NewsletterSignupQuery.graphql"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
1
|
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); }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import loadSerializableQuery from '../../relay/loadSerializableQuery.js';
|
|
4
|
+
import { NewsletterSignupPreloadedQueryRenderer } from './index.js';
|
|
5
|
+
import NewsletterSignupQueryNode from '../../__generated__/NewsletterSignupQuery.graphql.js';
|
|
6
|
+
export default async function NewsletterSignup(props) {
|
|
7
|
+
const preloadedQuery = await loadSerializableQuery(NewsletterSignupQueryNode, {});
|
|
8
|
+
return /*#__PURE__*/React.createElement(NewsletterSignupPreloadedQueryRenderer, _extends({}, props, {
|
|
16
9
|
preloadedQuery: preloadedQuery
|
|
17
10
|
}));
|
|
18
11
|
}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
2
|
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = NodePasswordForm;
|
|
8
|
-
var _NodePasswordFormSlugQuery2 = _interopRequireDefault(require("../../__generated__/NodePasswordFormSlugQuery.graphql"));
|
|
9
|
-
var _NodePasswordFormIDQuery2 = _interopRequireDefault(require("../../__generated__/NodePasswordFormIDQuery.graphql"));
|
|
10
|
-
var _NodePasswordFormAccessNodeMutation2 = _interopRequireDefault(require("../../__generated__/NodePasswordFormAccessNodeMutation.graphql"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _reactRelay = require("react-relay");
|
|
13
|
-
var _TextField = _interopRequireDefault(require("../TextField"));
|
|
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
3
|
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); }
|
|
18
|
-
|
|
4
|
+
import _NodePasswordFormSlugQuery from "../../__generated__/NodePasswordFormSlugQuery.graphql.js";
|
|
5
|
+
import _NodePasswordFormIDQuery from "../../__generated__/NodePasswordFormIDQuery.graphql.js";
|
|
6
|
+
import _NodePasswordFormAccessNodeMutation from "../../__generated__/NodePasswordFormAccessNodeMutation.graphql.js";
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { graphql, useLazyLoadQuery, useMutation } from 'react-relay';
|
|
9
|
+
import TextField from '../TextField/index.js';
|
|
10
|
+
const accessNodeMutation = (_NodePasswordFormAccessNodeMutation.hash && _NodePasswordFormAccessNodeMutation.hash !== "d0beeb729c358ef4eebd1c8be47ec68e" && console.error("The definition of 'NodePasswordFormAccessNodeMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NodePasswordFormAccessNodeMutation);
|
|
19
11
|
function NodePasswordFormComponent(props) {
|
|
20
|
-
const [password, setPassword] =
|
|
21
|
-
const [error, setError] =
|
|
22
|
-
const [commitMutation, submitting] =
|
|
12
|
+
const [password, setPassword] = useState('');
|
|
13
|
+
const [error, setError] = useState(null);
|
|
14
|
+
const [commitMutation, submitting] = useMutation(accessNodeMutation);
|
|
23
15
|
const disabled = submitting || !password;
|
|
24
16
|
const handleSubmit = e => {
|
|
25
17
|
e.preventDefault();
|
|
@@ -43,75 +35,75 @@ function NodePasswordFormComponent(props) {
|
|
|
43
35
|
}
|
|
44
36
|
});
|
|
45
37
|
};
|
|
46
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement("form", {
|
|
47
39
|
onSubmit: handleSubmit,
|
|
48
40
|
className: "node-password-form"
|
|
49
|
-
}, error && /*#__PURE__*/
|
|
41
|
+
}, error && /*#__PURE__*/React.createElement("p", {
|
|
50
42
|
className: "node-password-form__error"
|
|
51
|
-
}, error), /*#__PURE__*/
|
|
43
|
+
}, error), /*#__PURE__*/React.createElement("div", {
|
|
52
44
|
className: "node-password-form__section"
|
|
53
|
-
}, /*#__PURE__*/
|
|
45
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
54
46
|
label: "Password *",
|
|
55
47
|
placeholder: "Enter password",
|
|
56
48
|
autocomplete: "off",
|
|
57
49
|
type: "password",
|
|
58
50
|
value: password,
|
|
59
51
|
onChange: value => setPassword(value)
|
|
60
|
-
})), /*#__PURE__*/
|
|
52
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
61
53
|
className: "node-password-form__section"
|
|
62
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
63
55
|
disabled: disabled,
|
|
64
56
|
className: "submit-button"
|
|
65
57
|
}, "Submit")));
|
|
66
58
|
}
|
|
67
|
-
const idQuery = (
|
|
59
|
+
const idQuery = (_NodePasswordFormIDQuery.hash && _NodePasswordFormIDQuery.hash !== "2af86f8f6df3d2e6061ea1c9dd777a26" && console.error("The definition of 'NodePasswordFormIDQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NodePasswordFormIDQuery);
|
|
68
60
|
function NodePasswordFormIDQueryRenderer(_ref) {
|
|
69
61
|
let {
|
|
70
62
|
collectionId,
|
|
71
63
|
...rest
|
|
72
64
|
} = _ref;
|
|
73
|
-
const data =
|
|
65
|
+
const data = useLazyLoadQuery(idQuery, {
|
|
74
66
|
collectionId
|
|
75
67
|
});
|
|
76
68
|
// this is counterintuitive, but we've added the @catch directive on the collection,
|
|
77
69
|
// and we're expecting it to respond with an error if the node is inaccessible due to being
|
|
78
70
|
// password-protected. so, when we encounter the error we're safe to render the password form.
|
|
79
71
|
// (we don't want to show the form if the user has already gained access)
|
|
80
|
-
if (data.collection.ok === false) return /*#__PURE__*/
|
|
72
|
+
if (data.collection.ok === false) return /*#__PURE__*/React.createElement(NodePasswordFormComponent, _extends({}, rest, {
|
|
81
73
|
collectionId: collectionId
|
|
82
74
|
}));
|
|
83
75
|
}
|
|
84
|
-
const slugQuery = (
|
|
76
|
+
const slugQuery = (_NodePasswordFormSlugQuery.hash && _NodePasswordFormSlugQuery.hash !== "c40faf067007027fa9ba6673350c7202" && console.error("The definition of 'NodePasswordFormSlugQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _NodePasswordFormSlugQuery);
|
|
85
77
|
function NodePasswordFormSlugQueryRenderer(_ref2) {
|
|
86
78
|
var _data$viewer$slug;
|
|
87
79
|
let {
|
|
88
80
|
collectionSlug,
|
|
89
81
|
...rest
|
|
90
82
|
} = _ref2;
|
|
91
|
-
const data =
|
|
83
|
+
const data = useLazyLoadQuery(slugQuery, {
|
|
92
84
|
collectionSlug
|
|
93
85
|
});
|
|
94
86
|
// see note in NodePasswordFormIDQueryRenderer
|
|
95
|
-
if (((_data$viewer$slug = data.viewer.slug) === null || _data$viewer$slug === void 0 ? void 0 : _data$viewer$slug.collection.ok) === false) return /*#__PURE__*/
|
|
87
|
+
if (((_data$viewer$slug = data.viewer.slug) === null || _data$viewer$slug === void 0 ? void 0 : _data$viewer$slug.collection.ok) === false) return /*#__PURE__*/React.createElement(NodePasswordFormComponent, _extends({}, rest, {
|
|
96
88
|
collectionSlug: collectionSlug
|
|
97
89
|
}));
|
|
98
90
|
return null;
|
|
99
91
|
}
|
|
100
92
|
|
|
101
93
|
// default client export
|
|
102
|
-
function NodePasswordForm(_ref3) {
|
|
94
|
+
export default function NodePasswordForm(_ref3) {
|
|
103
95
|
let {
|
|
104
96
|
collectionId,
|
|
105
97
|
collectionSlug,
|
|
106
98
|
...rest
|
|
107
99
|
} = _ref3;
|
|
108
100
|
if (collectionId) {
|
|
109
|
-
return /*#__PURE__*/
|
|
101
|
+
return /*#__PURE__*/React.createElement(NodePasswordFormIDQueryRenderer, _extends({
|
|
110
102
|
collectionId: collectionId
|
|
111
103
|
}, rest));
|
|
112
104
|
}
|
|
113
105
|
if (collectionSlug) {
|
|
114
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/React.createElement(NodePasswordFormSlugQueryRenderer, _extends({
|
|
115
107
|
collectionSlug: collectionSlug
|
|
116
108
|
}, rest));
|
|
117
109
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { OrderVariableSelectionRedux_viewer$key } from '__generated__/OrderVariableSelectionRedux_viewer.graphql';
|
|
2
|
+
import { OrderVariableSelectionRedux_viewer$key } from '__generated__/OrderVariableSelectionRedux_viewer.graphql.js';
|
|
3
3
|
interface Props {
|
|
4
4
|
viewer: OrderVariableSelectionRedux_viewer$key;
|
|
5
5
|
disabled: boolean;
|
|
@@ -1,37 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _reactRelay = require("react-relay");
|
|
10
|
-
var _reactRedux = require("react-redux");
|
|
11
|
-
var _index = _interopRequireDefault(require("./index"));
|
|
12
|
-
var _OrderVariableSelectionReduxRefetchQuery = _interopRequireDefault(require("../../__generated__/OrderVariableSelectionReduxRefetchQuery.graphql"));
|
|
13
|
-
var _useRefetchOnLicenseChanges = require("../../hooks/useRefetchOnLicenseChanges");
|
|
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 OrderVariableSelectionRedux(_ref) {
|
|
1
|
+
import _OrderVariableSelectionRedux_viewer from "../../__generated__/OrderVariableSelectionRedux_viewer.graphql.js";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
3
|
+
import { graphql, useRefetchableFragment, useRelayEnvironment } from 'react-relay';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
5
|
+
import OrderVariableSelection from './index.js';
|
|
6
|
+
import OrderVariableSelectionReduxRefetchQuery from '../../__generated__/OrderVariableSelectionReduxRefetchQuery.graphql.js';
|
|
7
|
+
import { useRefetchOnLicenseChanges } from '../../hooks/useRefetchOnLicenseChanges.js';
|
|
8
|
+
export default function OrderVariableSelectionRedux(_ref) {
|
|
18
9
|
let {
|
|
19
10
|
viewer: viewerKey,
|
|
20
11
|
disabled,
|
|
21
12
|
children
|
|
22
13
|
} = _ref;
|
|
23
|
-
const environment =
|
|
24
|
-
const [viewer, refetch] =
|
|
25
|
-
const refetchVariables =
|
|
26
|
-
|
|
14
|
+
const environment = useRelayEnvironment();
|
|
15
|
+
const [viewer, refetch] = useRefetchableFragment((_OrderVariableSelectionRedux_viewer.hash && _OrderVariableSelectionRedux_viewer.hash !== "eaa5e1fdf47cb582dd3c7bdea0a5e6b2" && console.error("The definition of 'OrderVariableSelectionRedux_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _OrderVariableSelectionRedux_viewer), viewerKey);
|
|
16
|
+
const refetchVariables = useMemo(() => ({}), []);
|
|
17
|
+
useRefetchOnLicenseChanges({
|
|
27
18
|
environment,
|
|
28
19
|
refetch,
|
|
29
|
-
query:
|
|
20
|
+
query: OrderVariableSelectionReduxRefetchQuery,
|
|
30
21
|
variables: refetchVariables
|
|
31
22
|
});
|
|
32
|
-
const dispatch =
|
|
33
|
-
const selections =
|
|
34
|
-
const handleSelectionChange =
|
|
23
|
+
const dispatch = useDispatch();
|
|
24
|
+
const selections = useSelector(state => state.orderVariableSelections);
|
|
25
|
+
const handleSelectionChange = useCallback(newSelections => {
|
|
35
26
|
dispatch({
|
|
36
27
|
type: 'UPDATE_ORDER_VARIABLE_SELECTIONS',
|
|
37
28
|
selections: newSelections
|
|
@@ -39,7 +30,7 @@ function OrderVariableSelectionRedux(_ref) {
|
|
|
39
30
|
}, [dispatch]);
|
|
40
31
|
|
|
41
32
|
// Auto-populate Redux state with detected country for country-type variables
|
|
42
|
-
|
|
33
|
+
useEffect(() => {
|
|
43
34
|
if (!viewer.detectedCountry || !viewer.orderVariables) return;
|
|
44
35
|
|
|
45
36
|
// Find country-type variables that don't have a selection yet
|
|
@@ -57,7 +48,7 @@ function OrderVariableSelectionRedux(_ref) {
|
|
|
57
48
|
selections: newSelections
|
|
58
49
|
});
|
|
59
50
|
}, [viewer.detectedCountry, viewer.orderVariables, selections, dispatch]);
|
|
60
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/React.createElement(OrderVariableSelection, {
|
|
61
52
|
variables: viewer,
|
|
62
53
|
selections: selections,
|
|
63
54
|
onSelectionChange: handleSelectionChange,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { OrderVariableSelection_variables$key } from '__generated__/OrderVariableSelection_variables.graphql';
|
|
2
|
+
import { OrderVariableSelection_variables$key } from '__generated__/OrderVariableSelection_variables.graphql.js';
|
|
3
3
|
export interface OrderVariableSelectionInput {
|
|
4
4
|
orderVariableId: string;
|
|
5
5
|
orderVariableOptionId: string | null;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import _OrderVariableSelection_variables from "../../__generated__/OrderVariableSelection_variables.graphql.js";
|
|
2
|
+
import React, { useCallback, useContext } from 'react';
|
|
3
|
+
import { graphql, useFragment } from 'react-relay';
|
|
4
|
+
import Button from '../elements/Button/index.js';
|
|
5
|
+
import ConfigContext from '../ConfigContext.js';
|
|
6
|
+
import { CarrotDown, Checkbox, CheckboxChecked, CheckboxCrossed } from '../Icons/index.js';
|
|
2
7
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = OrderVariableSelection;
|
|
7
|
-
var _OrderVariableSelection_variables2 = _interopRequireDefault(require("../../__generated__/OrderVariableSelection_variables.graphql"));
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactRelay = require("react-relay");
|
|
10
|
-
var _Button = _interopRequireDefault(require("../elements/Button"));
|
|
11
|
-
var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
|
|
12
|
-
var _Icons = require("../Icons");
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
8
|
// Ghost variable type
|
|
17
9
|
|
|
18
10
|
// Component props
|
|
@@ -29,9 +21,9 @@ function Variable(_ref) {
|
|
|
29
21
|
} = _ref;
|
|
30
22
|
const {
|
|
31
23
|
form: config
|
|
32
|
-
} =
|
|
24
|
+
} = useContext(ConfigContext);
|
|
33
25
|
const isSelected = Boolean(selection);
|
|
34
|
-
const handleClickVariable =
|
|
26
|
+
const handleClickVariable = useCallback(() => {
|
|
35
27
|
var _variable$orderVariab;
|
|
36
28
|
// Only toggle boolean variables when clicked
|
|
37
29
|
if (variable.variableType === 'boolean') {
|
|
@@ -42,7 +34,7 @@ function Variable(_ref) {
|
|
|
42
34
|
}
|
|
43
35
|
// Country variables are now static (non-editable)
|
|
44
36
|
}, [variable, isSelected, onToggle]);
|
|
45
|
-
const handleChangeVariableOption =
|
|
37
|
+
const handleChangeVariableOption = useCallback(e => {
|
|
46
38
|
onToggle(variable.id, e.target.value);
|
|
47
39
|
}, [variable.id, onToggle]);
|
|
48
40
|
let options = (_variable$orderVariab2 = variable.orderVariableOptions) === null || _variable$orderVariab2 === void 0 ? void 0 : _variable$orderVariab2.map(option => ({
|
|
@@ -63,26 +55,26 @@ function Variable(_ref) {
|
|
|
63
55
|
}
|
|
64
56
|
const selectedOption = (_options = options) === null || _options === void 0 ? void 0 : _options.find(o => o.id === (selection === null || selection === void 0 ? void 0 : selection.orderVariableOptionId));
|
|
65
57
|
const selectedCountry = countries === null || countries === void 0 ? void 0 : countries.find(c => c.code === (selection === null || selection === void 0 ? void 0 : selection.countryCode));
|
|
66
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
59
|
className: "store-modal__order-variable-selection__item",
|
|
68
60
|
"data-variable-type": variable.variableType,
|
|
69
61
|
"data-ghost": ghost
|
|
70
|
-
}, /*#__PURE__*/
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
71
63
|
className: "store-modal__order-variable-selection__button",
|
|
72
64
|
onClick: handleClickVariable,
|
|
73
65
|
"data-selected": isSelected
|
|
74
|
-
}, /*#__PURE__*/
|
|
66
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
75
67
|
className: "store-modal__order-variable-selection__label"
|
|
76
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
77
69
|
className: "store-modal__order-variable-selection__icon-pair"
|
|
78
|
-
}, variable.variableType === 'boolean' ? isSelected ? config.checkboxStyle === 'check' ? /*#__PURE__*/
|
|
70
|
+
}, variable.variableType === 'boolean' ? isSelected ? config.checkboxStyle === 'check' ? /*#__PURE__*/React.createElement(CheckboxChecked, null) : /*#__PURE__*/React.createElement(CheckboxCrossed, null) : /*#__PURE__*/React.createElement(Checkbox, null) : null, variable.name)), variable.variableType === 'select' ? /*#__PURE__*/React.createElement("label", {
|
|
79
71
|
className: "store-modal__order-variable-selection__select-label"
|
|
80
|
-
}, selectedOption ? selectedOption.amount : `Select an option`, /*#__PURE__*/
|
|
72
|
+
}, selectedOption ? selectedOption.amount : `Select an option`, /*#__PURE__*/React.createElement(CarrotDown, null), /*#__PURE__*/React.createElement("select", {
|
|
81
73
|
className: "store-modal__order-variable-selection__select",
|
|
82
74
|
value: (selection === null || selection === void 0 ? void 0 : selection.orderVariableOptionId) || '',
|
|
83
75
|
onChange: handleChangeVariableOption,
|
|
84
76
|
onClick: e => e.stopPropagation()
|
|
85
|
-
}, /*#__PURE__*/
|
|
77
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
86
78
|
value: "",
|
|
87
79
|
disabled: true
|
|
88
80
|
}, "Select an option"), (_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.map(_ref2 => {
|
|
@@ -91,26 +83,26 @@ function Variable(_ref) {
|
|
|
91
83
|
amount,
|
|
92
84
|
disabled
|
|
93
85
|
} = _ref2;
|
|
94
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
95
87
|
key: id,
|
|
96
88
|
value: id,
|
|
97
89
|
disabled: disabled
|
|
98
90
|
}, amount, " ", disabled ? '(Deprecated)' : null);
|
|
99
|
-
}))) : null, variable.variableType === 'country' && selectedCountry ? /*#__PURE__*/
|
|
91
|
+
}))) : null, variable.variableType === 'country' && selectedCountry ? /*#__PURE__*/React.createElement("span", {
|
|
100
92
|
className: "store-modal__order-variable-selection__country-value"
|
|
101
|
-
}, selectedCountry.name) : null), variable.description ? /*#__PURE__*/
|
|
93
|
+
}, selectedCountry.name) : null), variable.description ? /*#__PURE__*/React.createElement("div", {
|
|
102
94
|
className: "store-modal__order-variable-selection__description",
|
|
103
95
|
dangerouslySetInnerHTML: {
|
|
104
96
|
__html: variable.description
|
|
105
97
|
}
|
|
106
|
-
}) : null, ghost && /*#__PURE__*/
|
|
98
|
+
}) : null, ghost && /*#__PURE__*/React.createElement("div", {
|
|
107
99
|
className: "store-modal__order-variable-selection__ghost-container"
|
|
108
|
-
}, "This variable has been removed from our system and is deprecated", ' ', /*#__PURE__*/
|
|
100
|
+
}, "This variable has been removed from our system and is deprecated", ' ', /*#__PURE__*/React.createElement("button", {
|
|
109
101
|
className: "store-modal__order-variable-selection__ghost-remove",
|
|
110
102
|
onClick: onRemoveGhost
|
|
111
103
|
}, "Remove")));
|
|
112
104
|
}
|
|
113
|
-
function OrderVariableSelection(_ref3) {
|
|
105
|
+
export default function OrderVariableSelection(_ref3) {
|
|
114
106
|
let {
|
|
115
107
|
variables: variablesKey,
|
|
116
108
|
selections,
|
|
@@ -123,8 +115,8 @@ function OrderVariableSelection(_ref3) {
|
|
|
123
115
|
label
|
|
124
116
|
}
|
|
125
117
|
} = _ref3;
|
|
126
|
-
const variables =
|
|
127
|
-
const handleSelectionChange =
|
|
118
|
+
const variables = useFragment((_OrderVariableSelection_variables.hash && _OrderVariableSelection_variables.hash !== "b73b43b61cd5edd5face7d4a5615b2f5" && console.error("The definition of 'OrderVariableSelection_variables' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _OrderVariableSelection_variables), variablesKey);
|
|
119
|
+
const handleSelectionChange = useCallback((variableId, optionId, countryCode) => {
|
|
128
120
|
var _variables$orderVaria;
|
|
129
121
|
// Update the selections with the new value
|
|
130
122
|
const newSelections = selections.map(selection => ({
|
|
@@ -165,10 +157,10 @@ function OrderVariableSelection(_ref3) {
|
|
|
165
157
|
if (!variables.orderVariables || variables.orderVariables.length === 0) {
|
|
166
158
|
return null;
|
|
167
159
|
}
|
|
168
|
-
return /*#__PURE__*/
|
|
160
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
169
161
|
className: "store-modal__order-variable-selection__container",
|
|
170
162
|
"data-disabled": disabled
|
|
171
|
-
}, /*#__PURE__*/
|
|
163
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
172
164
|
className: "store-modal__order-variable-selection__title"
|
|
173
165
|
}, label), variables.orderVariables.map(variable => {
|
|
174
166
|
var _variables$countries;
|
|
@@ -179,7 +171,7 @@ function OrderVariableSelection(_ref3) {
|
|
|
179
171
|
...variable,
|
|
180
172
|
description: descriptionOverrides[variable.id]
|
|
181
173
|
} : variable;
|
|
182
|
-
return /*#__PURE__*/
|
|
174
|
+
return /*#__PURE__*/React.createElement(Variable, {
|
|
183
175
|
key: variable.id,
|
|
184
176
|
variable: effectiveVariable,
|
|
185
177
|
selection: currentSelection,
|
|
@@ -188,7 +180,7 @@ function OrderVariableSelection(_ref3) {
|
|
|
188
180
|
});
|
|
189
181
|
}), ghostVariables.map(ghost => {
|
|
190
182
|
var _ghost$orderVariableO, _ghost$orderVariableO2, _variables$countries2;
|
|
191
|
-
return /*#__PURE__*/
|
|
183
|
+
return /*#__PURE__*/React.createElement(Variable, {
|
|
192
184
|
key: ghost.orderVariable.id,
|
|
193
185
|
variable: {
|
|
194
186
|
...ghost.orderVariable,
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _License_node2 = _interopRequireDefault(require("../../__generated__/License_node.graphql"));
|
|
8
|
-
var _reactRelay = require("react-relay");
|
|
9
|
-
var _reactRedux = require("react-redux");
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _Icons = require("../Icons");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1
|
+
import _License_node from "../../__generated__/License_node.graphql.js";
|
|
2
|
+
import { graphql, useFragment } from 'react-relay';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { CarrotDown, CircledInfo, Check } from '../Icons/index.js';
|
|
13
6
|
const License = _ref => {
|
|
14
7
|
let {
|
|
15
8
|
node: nodeKey,
|
|
@@ -17,56 +10,55 @@ const License = _ref => {
|
|
|
17
10
|
onSelectLicense,
|
|
18
11
|
onSelectLicenseOption
|
|
19
12
|
} = _ref;
|
|
20
|
-
const node =
|
|
13
|
+
const node = useFragment((_License_node.hash && _License_node.hash !== "1550b152731d8412ffc55716cb536407" && console.error("The definition of 'License_node' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _License_node), nodeKey);
|
|
21
14
|
if (!node) return null;
|
|
22
|
-
const selectedLicenseOptions =
|
|
15
|
+
const selectedLicenseOptions = useSelector(state => state.licenseOptions);
|
|
23
16
|
const selectedOptions = selectedLicenseOptions.find(spec => spec.licenseId === node.id);
|
|
24
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
18
|
className: "pre-cart__license-wrapper"
|
|
26
|
-
}, /*#__PURE__*/
|
|
19
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27
20
|
className: "pre-cart__license",
|
|
28
21
|
"data-selected": selected
|
|
29
|
-
}, /*#__PURE__*/
|
|
22
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
23
|
className: "pre-cart__license__name-wrapper"
|
|
31
|
-
}, /*#__PURE__*/
|
|
24
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
32
25
|
className: "pre-cart__license__name"
|
|
33
|
-
}, /*#__PURE__*/
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
34
27
|
className: "pre-cart__license__checkbox"
|
|
35
|
-
}, selected && /*#__PURE__*/
|
|
28
|
+
}, selected && /*#__PURE__*/React.createElement(Check, null)), node.name, /*#__PURE__*/React.createElement("input", {
|
|
36
29
|
type: "checkbox",
|
|
37
30
|
checked: selected,
|
|
38
31
|
value: node.id,
|
|
39
32
|
onChange: e => onSelectLicense(node.id, e.target.checked)
|
|
40
|
-
})), selected && /*#__PURE__*/
|
|
33
|
+
})), selected && /*#__PURE__*/React.createElement("a", {
|
|
41
34
|
href: node.url,
|
|
42
35
|
"aria-label": "Info",
|
|
43
36
|
className: "pre-cart__license__icon",
|
|
44
37
|
"data-label": "info"
|
|
45
|
-
}, /*#__PURE__*/
|
|
38
|
+
}, /*#__PURE__*/React.createElement(CircledInfo, null))), selected && /*#__PURE__*/React.createElement("ul", null, node.variables && node.variables.map(variable => {
|
|
46
39
|
var _variable$options, _variable$options$fin;
|
|
47
40
|
const selectedLicenseOption = selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.licenseOptions[variable.id];
|
|
48
41
|
if (variable.variableType === 'text') return null;
|
|
49
42
|
const selectedLicenseAmount = variable === null || variable === void 0 ? void 0 : (_variable$options = variable.options) === null || _variable$options === void 0 ? void 0 : (_variable$options$fin = _variable$options.find(option => option.id === selectedLicenseOption)) === null || _variable$options$fin === void 0 ? void 0 : _variable$options$fin.amount;
|
|
50
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
51
44
|
key: variable.id
|
|
52
|
-
}, /*#__PURE__*/
|
|
45
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
53
46
|
className: "pre-cart__license__option"
|
|
54
|
-
}, "\u21B3 ", selectedLicenseAmount, /*#__PURE__*/
|
|
47
|
+
}, "\u21B3 ", selectedLicenseAmount, /*#__PURE__*/React.createElement(CarrotDown, null), /*#__PURE__*/React.createElement("select", {
|
|
55
48
|
value: selectedLicenseOption || '',
|
|
56
49
|
onChange: e => onSelectLicenseOption(node.id, variable.id, e.target.value)
|
|
57
|
-
}, /*#__PURE__*/
|
|
50
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
58
51
|
value: "",
|
|
59
52
|
disabled: true
|
|
60
|
-
}, "Select one"), variable.options && variable.options.map(option => /*#__PURE__*/
|
|
53
|
+
}, "Select one"), variable.options && variable.options.map(option => /*#__PURE__*/React.createElement("option", {
|
|
61
54
|
key: option.id,
|
|
62
55
|
value: option.id
|
|
63
56
|
}, option.amount)))));
|
|
64
|
-
}))), node.description && /*#__PURE__*/
|
|
57
|
+
}))), node.description && /*#__PURE__*/React.createElement("div", {
|
|
65
58
|
className: "pre-cart__license__description",
|
|
66
59
|
dangerouslySetInnerHTML: {
|
|
67
60
|
__html: node.description
|
|
68
61
|
}
|
|
69
62
|
}));
|
|
70
63
|
};
|
|
71
|
-
|
|
72
|
-
exports.default = _default;
|
|
64
|
+
export default License;
|