fontdue-js 3.14.0 → 3.15.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 +9 -0
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderCompleteOrderMutation.graphql.js +3 -3
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderRemoveDiscountMutation.graphql.js +3 -3
- package/dist/__generated__/CartOrderUpdateMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CartOrderUpdateMutation.graphql.js +3 -3
- package/dist/__generated__/CartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/CartQuery.graphql.js +3 -3
- package/dist/__generated__/CartStateUpdateMutation.graphql.d.ts +5 -1
- package/dist/__generated__/CartStateUpdateMutation.graphql.js +132 -117
- package/dist/__generated__/CartState_order.graphql.d.ts +4 -1
- package/dist/__generated__/CartState_order.graphql.js +11 -2
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateCustomerMutation.graphql.js +3 -3
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.d.ts +1 -1
- package/dist/__generated__/CheckoutUpdateOrderMutation.graphql.js +3 -3
- package/dist/__generated__/FamilyList_node.graphql.d.ts +3 -1
- package/dist/__generated__/FamilyList_node.graphql.js +8 -2
- package/dist/__generated__/FontFamiliesQuery.graphql.d.ts +1 -1
- package/dist/__generated__/FontFamiliesQuery.graphql.js +5 -5
- package/dist/__generated__/PrecartAddToCartMutation.graphql.d.ts +1 -1
- package/dist/__generated__/PrecartAddToCartMutation.graphql.js +3 -3
- package/dist/__generated__/StoreModalCartQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalCartQuery.graphql.js +69 -69
- package/dist/__generated__/StoreModalFamily_collection.graphql.d.ts +2 -1
- package/dist/__generated__/StoreModalFamily_collection.graphql.js +16 -15
- package/dist/__generated__/StoreModalIndexItem_fontCollection.graphql.d.ts +19 -1
- package/dist/__generated__/StoreModalIndexItem_fontCollection.graphql.js +39 -4
- package/dist/__generated__/StoreModalIndexPaginationQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalIndexPaginationQuery.graphql.js +40 -5
- package/dist/__generated__/StoreModalIndexQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalIndexQuery.graphql.js +40 -5
- package/dist/__generated__/StoreModalProductContent_collection.graphql.d.ts +19 -1
- package/dist/__generated__/StoreModalProductContent_collection.graphql.js +46 -11
- package/dist/__generated__/StoreModalProductQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductQuery.graphql.js +198 -167
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductRefetchQuery.graphql.js +171 -140
- package/dist/__generated__/StoreModalProductSlugQuery.graphql.d.ts +1 -1
- package/dist/__generated__/StoreModalProductSlugQuery.graphql.js +201 -170
- package/dist/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.d.ts +5 -2
- package/dist/__generated__/StripeProviderCreateCheckoutSessionMutation.graphql.js +41 -22
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.d.ts +1 -1
- package/dist/__generated__/TestFontsFormUpdateCustomerMutation.graphql.js +3 -3
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTesterStandaloneChangedStylesQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTesterStandaloneQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTester_fontStyle.graphql.d.ts +3 -1
- package/dist/__generated__/TypeTester_fontStyle.graphql.js +8 -2
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersChangedStylesQuery.graphql.js +9 -3
- package/dist/__generated__/TypeTestersIDQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersIDQuery.graphql.js +39 -39
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersRefetchQuery.graphql.js +37 -37
- package/dist/__generated__/TypeTestersSlugQuery.graphql.d.ts +1 -1
- package/dist/__generated__/TypeTestersSlugQuery.graphql.js +39 -39
- package/dist/__tests__/cartDiscountRemoved.test.js +195 -0
- package/dist/__tests__/characterViewerCollapse.test.js +199 -0
- package/dist/__tests__/characterViewerStyleSelect.test.js +52 -0
- package/dist/__tests__/checkoutReturn.test.js +66 -0
- package/dist/__tests__/familyStyleCounts.test.js +71 -0
- package/dist/__tests__/i18n.test.js +171 -0
- package/dist/__tests__/i18nComponents.test.js +408 -0
- package/dist/__tests__/localeEnvironments.test.js +275 -0
- package/dist/__tests__/localeMiddleware.test.js +68 -0
- package/dist/__tests__/localeTransport.test.js +209 -0
- package/dist/__tests__/recaptchaLocale.test.js +62 -0
- package/dist/__tests__/serverEntryLocale.test.js +124 -0
- package/dist/__tests__/storeModalIndexUnlisted.test.js +69 -11
- package/dist/__tests__/useSerializablePreloadedQuery.test.js +4 -3
- package/dist/components/AddToCartBanner/index.js +8 -2
- package/dist/components/BuyButton/index.d.ts +1 -0
- package/dist/components/BuyButton/index.js +8 -2
- package/dist/components/BuyButton/index.server.d.ts +1 -0
- package/dist/components/BuyButton/index.server.js +8 -0
- package/dist/components/BuyingOptions/index.js +3 -1
- package/dist/components/Cart/AddressFields.js +5 -3
- package/dist/components/Cart/CartCouponNotice.d.ts +7 -0
- package/dist/components/Cart/CartCouponNotice.js +21 -0
- package/dist/components/Cart/CartItem/CartItemAdditionalLicenses.js +3 -1
- package/dist/components/Cart/CartItem/CartItemLicense.js +3 -1
- package/dist/components/Cart/CartItem/CartItemProduct.js +6 -3
- package/dist/components/Cart/CartItem/VariableTextInput.js +7 -3
- package/dist/components/Cart/CartItem/index.js +5 -1
- package/dist/components/Cart/CartOrder.js +27 -17
- package/dist/components/Cart/CartState.d.ts +1 -0
- package/dist/components/Cart/CartState.js +18 -3
- package/dist/components/Cart/CartTotals.js +17 -9
- package/dist/components/Cart/Checkout.js +18 -15
- package/dist/components/Cart/CouponCodeInput.js +5 -3
- package/dist/components/Cart/CustomerFields.js +6 -4
- package/dist/components/Cart/EmptyCart.js +4 -2
- package/dist/components/Cart/IdentityBox.js +6 -2
- package/dist/components/Cart/ShareCart.js +8 -6
- package/dist/components/Cart/checkoutReturn.d.ts +17 -0
- package/dist/components/Cart/checkoutReturn.js +38 -0
- package/dist/components/CartButton/index.d.ts +2 -1
- package/dist/components/CartButton/index.js +6 -2
- package/dist/components/CharacterViewer/StyleSelect.js +6 -2
- package/dist/components/CharacterViewer/collapse.d.ts +10 -0
- package/dist/components/CharacterViewer/collapse.js +39 -0
- package/dist/components/CharacterViewer/index.d.ts +4 -0
- package/dist/components/CharacterViewer/index.js +78 -24
- package/dist/components/CharacterViewer/index.server.d.ts +1 -0
- package/dist/components/CharacterViewer/index.server.js +4 -0
- package/dist/components/ConfigContext.d.ts +14 -10
- package/dist/components/ConfigContext.js +12 -7
- package/dist/components/ConsentBanner/index.js +6 -5
- package/dist/components/CookieNotification/index.js +11 -5
- package/dist/components/CouponText/index.js +15 -7
- package/dist/components/CustomerLoginForm/index.js +14 -9
- package/dist/components/CustomerSignIn/CustomerSignInElement.d.ts +1 -1
- package/dist/components/CustomerSignIn/CustomerSignInElement.js +8 -2
- package/dist/components/CustomerSignIn/index.d.ts +6 -1
- package/dist/components/CustomerSignIn/index.js +27 -15
- package/dist/components/Family/FamilyList.js +5 -2
- package/dist/components/Family/index.js +21 -12
- package/dist/components/FeatureTester/FeatureTesters.d.ts +2 -1
- package/dist/components/FeatureTester/FeatureTesters.js +4 -1
- package/dist/components/FeatureTester/FeatureTesters.server.js +4 -0
- package/dist/components/FeatureTester/index.d.ts +1 -0
- package/dist/components/FeatureTester/index.js +3 -1
- package/dist/components/FeatureTester/index.server.js +2 -0
- package/dist/components/FontdueContextProvider/index.d.ts +12 -2
- package/dist/components/FontdueContextProvider/index.js +85 -11
- package/dist/components/FontdueProvider/index.js +7 -1
- package/dist/components/FontdueProvider/index.server.js +21 -3
- package/dist/components/LocaleContext.d.ts +9 -0
- package/dist/components/LocaleContext.js +20 -0
- package/dist/components/NewsletterSignup/index.d.ts +2 -1
- package/dist/components/NewsletterSignup/index.js +20 -11
- package/dist/components/NewsletterSignup/index.server.d.ts +1 -0
- package/dist/components/NewsletterSignup/index.server.js +3 -1
- package/dist/components/NodePasswordForm/index.d.ts +6 -1
- package/dist/components/NodePasswordForm/index.js +14 -6
- package/dist/components/OrderVariableSelection/index.js +7 -5
- package/dist/components/Precart/License.js +4 -2
- package/dist/components/Precart/index.js +15 -12
- package/dist/components/Price/index.d.ts +1 -0
- package/dist/components/Price/index.js +15 -5
- package/dist/components/Root/index.js +2 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.js +4 -1
- package/dist/components/SelectButton/index.js +3 -1
- package/dist/components/SpecimenLink/index.js +3 -1
- package/dist/components/StoreModal/StoreModalCart.js +6 -0
- package/dist/components/StoreModal/StoreModalContainer.js +14 -12
- package/dist/components/StoreModal/StoreModalDownload.js +3 -1
- package/dist/components/StoreModal/StoreModalFamily.js +16 -7
- package/dist/components/StoreModal/StoreModalFamilyButton.js +14 -9
- package/dist/components/StoreModal/StoreModalIndexItem.js +21 -10
- package/dist/components/StoreModal/StoreModalIndexPackItem.js +8 -3
- package/dist/components/StoreModal/StoreModalPackButton.js +5 -2
- package/dist/components/StoreModal/StoreModalProduct.js +14 -5
- package/dist/components/StoreModal/index.d.ts +1 -0
- package/dist/components/StoreModal/index.js +4 -2
- package/dist/components/StoreModal/offered.d.ts +31 -0
- package/dist/components/StoreModal/offered.js +21 -0
- package/dist/components/StoreModal/types.d.ts +9 -0
- package/dist/components/StoreModalProductLicenseSelection/LicenseVariableElement.js +3 -1
- package/dist/components/StoreModalProductLicenseSelection/StoreModalProductLicense.js +5 -1
- package/dist/components/StoreModalProductSummary/index.js +37 -23
- package/dist/components/StripeProvider/index.js +18 -5
- package/dist/components/TestFontsForm/index.d.ts +2 -1
- package/dist/components/TestFontsForm/index.js +28 -16
- package/dist/components/TestFontsForm/index.server.d.ts +1 -0
- package/dist/components/TestFontsForm/index.server.js +3 -1
- package/dist/components/TestModeBanner/index.js +3 -1
- package/dist/components/TypeTester/TypeTesterEditAll.js +3 -1
- package/dist/components/TypeTester/TypeTesterFeaturesButton.js +4 -2
- package/dist/components/TypeTester/TypeTesterStandalone.d.ts +1 -0
- package/dist/components/TypeTester/TypeTesterStandalone.js +6 -2
- package/dist/components/TypeTester/TypeTesterStandalone.server.js +2 -0
- package/dist/components/TypeTester/TypeTesterStyleSelect.js +5 -3
- package/dist/components/TypeTester/TypeTesterStyleSelectData.js +3 -1
- package/dist/components/TypeTester/TypeTesterToolbar.js +12 -6
- package/dist/components/TypeTester/index.js +7 -2
- package/dist/components/TypeTesters/index.d.ts +2 -1
- package/dist/components/TypeTesters/index.js +3 -1
- package/dist/components/TypeTesters/index.server.d.ts +1 -0
- package/dist/components/TypeTesters/index.server.js +4 -0
- package/dist/components/elements/EmptyCart/index.js +4 -2
- package/dist/components/elements/StoreModalCartLayout/index.d.ts +1 -0
- package/dist/components/elements/StoreModalCartLayout/index.js +2 -1
- package/dist/components/elements/StoreModalContainer/index.js +4 -2
- package/dist/components/elements/StoreModalDownloadLayout/index.js +3 -1
- package/dist/components/elements/StoreModalIndexItem/index.js +3 -1
- package/dist/components/elements/StoreModalIndexLoadMore/index.js +3 -1
- package/dist/components/elements/StoreModalLicenseeIsBillingIdentityElement.js +4 -2
- package/dist/components/elements/StoreModalLoadingScreen/index.js +7 -3
- package/dist/components/elements/StoreModalUnifiedCheckout.js +44 -27
- package/dist/fontdue.css +58 -0
- package/dist/hooks/useRecaptchaTimeout.d.ts +1 -1
- package/dist/hooks/useRecaptchaTimeout.js +4 -2
- package/dist/i18n/de.d.ts +3 -0
- package/dist/i18n/de.js +279 -0
- package/dist/i18n/en.d.ts +212 -0
- package/dist/i18n/en.js +261 -0
- package/dist/i18n/index.d.ts +42 -0
- package/dist/i18n/index.js +115 -0
- package/dist/i18n/types.d.ts +28 -0
- package/dist/i18n/types.js +1 -0
- package/dist/i18n/useT.d.ts +15 -0
- package/dist/i18n/useT.js +21 -0
- package/dist/locale.d.ts +20 -0
- package/dist/locale.js +52 -0
- package/dist/next/tenant.d.ts +3 -1
- package/dist/next/tenant.js +11 -2
- package/dist/relay/environment.d.ts +8 -2
- package/dist/relay/environment.js +65 -15
- package/dist/relay/loadSerializableQuery.d.ts +17 -0
- package/dist/relay/loadSerializableQuery.js +14 -2
- package/dist/relay/serverConfig.d.ts +9 -0
- package/dist/relay/serverConfig.js +16 -0
- package/dist/relay/useSerializablePreloadedQuery.js +27 -6
- package/dist/server/index.d.ts +11 -0
- package/dist/server/index.js +7 -0
- package/dist/server/middleware.d.ts +19 -1
- package/dist/server/middleware.js +56 -13
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -5
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ const TypeTester = _ref => {
|
|
|
30
30
|
onStyleSelect,
|
|
31
31
|
isLoading
|
|
32
32
|
} = _ref;
|
|
33
|
-
const fontStyle = useFragment((_TypeTester_fontStyle.hash && _TypeTester_fontStyle.hash !== "
|
|
33
|
+
const fontStyle = useFragment((_TypeTester_fontStyle.hash && _TypeTester_fontStyle.hash !== "72c3b8c9b282bdd217189ac0a48c5fb1" && console.error("The definition of 'TypeTester_fontStyle' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTester_fontStyle), fontStyleKey);
|
|
34
34
|
const contentRef = useRef(null);
|
|
35
35
|
const ref = useRef(null);
|
|
36
36
|
const [buyButtonIsHovered, setBuyButtonIsHovered] = useState(false);
|
|
@@ -56,6 +56,11 @@ const TypeTester = _ref => {
|
|
|
56
56
|
const selected = useSelector(fontStyle && fontStyle.sku ? isSelected(fontStyle.sku.id) : () => false);
|
|
57
57
|
const precartOpen = useSelector(state => state.precartOpen);
|
|
58
58
|
const sku = fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.sku;
|
|
59
|
+
|
|
60
|
+
// The tester still shows an unlisted style, which is part of the family,
|
|
61
|
+
// but a select button would sell it on its own. This was the per-style gap
|
|
62
|
+
// FD-1239 left open.
|
|
63
|
+
const listed = (fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.visibility) !== 'UNLISTED';
|
|
59
64
|
const onNeedsRefocus = () => {
|
|
60
65
|
var _contentRef$current;
|
|
61
66
|
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.focus();
|
|
@@ -113,7 +118,7 @@ const TypeTester = _ref => {
|
|
|
113
118
|
fontStyle: fontStyle,
|
|
114
119
|
onNeedsRefocus: onNeedsRefocus,
|
|
115
120
|
groupEdit: groupEdit
|
|
116
|
-
}), config.selectButton && sku && productId && /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
}), config.selectButton && sku && productId && listed && /*#__PURE__*/React.createElement("div", {
|
|
117
122
|
className: "type-tester__select-button-wrapper",
|
|
118
123
|
onMouseDown: e => e.preventDefault()
|
|
119
124
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -39,5 +39,6 @@ export declare function loadTypeTestersQuery(variables: LoadTypeTestersQueryVari
|
|
|
39
39
|
export type TypeTesters_unifiedProps = TypeTesters_props & {
|
|
40
40
|
preloadedQuery?: TypeTestersPreloadedQuery;
|
|
41
41
|
config?: Config;
|
|
42
|
+
locale?: string;
|
|
42
43
|
};
|
|
43
|
-
export default function TypeTesters({ collectionId, collectionSlug, preloadedQuery, config, ...rest }: TypeTesters_unifiedProps): React.JSX.Element | null;
|
|
44
|
+
export default function TypeTesters({ collectionId, collectionSlug, preloadedQuery, config, locale, ...rest }: TypeTesters_unifiedProps): React.JSX.Element | null;
|
|
@@ -298,6 +298,7 @@ export default function TypeTesters(_ref8) {
|
|
|
298
298
|
collectionSlug,
|
|
299
299
|
preloadedQuery,
|
|
300
300
|
config,
|
|
301
|
+
locale,
|
|
301
302
|
...rest
|
|
302
303
|
} = _ref8;
|
|
303
304
|
let inner = null;
|
|
@@ -316,6 +317,7 @@ export default function TypeTesters(_ref8) {
|
|
|
316
317
|
}
|
|
317
318
|
if (!inner) return null;
|
|
318
319
|
return /*#__PURE__*/React.createElement(EnsureFontdueContext, {
|
|
319
|
-
config: config
|
|
320
|
+
config: config,
|
|
321
|
+
locale: locale ?? (preloadedQuery === null || preloadedQuery === void 0 ? void 0 : preloadedQuery.locale)
|
|
320
322
|
}, inner);
|
|
321
323
|
}
|
|
@@ -5,4 +5,5 @@ export type { TypeTestersPreloadedQuery } from './index.js';
|
|
|
5
5
|
export declare function loadTypeTestersQuery(): never;
|
|
6
6
|
export default function TypeTesters({ collectionId, collectionSlug, tags, excludeTags, ...rest }: TypeTesters_props & {
|
|
7
7
|
config?: Config;
|
|
8
|
+
locale?: string;
|
|
8
9
|
}): Promise<React.JSX.Element | null>;
|
|
@@ -35,6 +35,8 @@ export default async function TypeTesters(_ref) {
|
|
|
35
35
|
collectionId,
|
|
36
36
|
tags,
|
|
37
37
|
excludeTags
|
|
38
|
+
}, {
|
|
39
|
+
locale: rest.locale
|
|
38
40
|
});
|
|
39
41
|
return /*#__PURE__*/React.createElement(TypeTestersPreloadedIDQueryRenderer, _extends({
|
|
40
42
|
preloadedQuery: preloadedQuery,
|
|
@@ -47,6 +49,8 @@ export default async function TypeTesters(_ref) {
|
|
|
47
49
|
collectionSlug,
|
|
48
50
|
tags,
|
|
49
51
|
excludeTags
|
|
52
|
+
}, {
|
|
53
|
+
locale: rest.locale
|
|
50
54
|
});
|
|
51
55
|
return /*#__PURE__*/React.createElement(TypeTestersPreloadedSlugQueryRenderer, _extends({
|
|
52
56
|
preloadedQuery: preloadedQuery,
|
|
@@ -2,8 +2,10 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import Button from '../Button/index.js';
|
|
3
3
|
import { useDispatch } from 'react-redux';
|
|
4
4
|
import ConfigContext from '../../ConfigContext.js';
|
|
5
|
+
import { useT } from '../../../i18n/useT.js';
|
|
5
6
|
const EmptyCart = () => {
|
|
6
7
|
const dispatch = useDispatch();
|
|
8
|
+
const t = useT();
|
|
7
9
|
const config = useContext(ConfigContext);
|
|
8
10
|
const {
|
|
9
11
|
hideAllCollections
|
|
@@ -27,8 +29,8 @@ const EmptyCart = () => {
|
|
|
27
29
|
className: "empty-cart__container"
|
|
28
30
|
}, /*#__PURE__*/React.createElement("p", {
|
|
29
31
|
className: "empty-cart__message"
|
|
30
|
-
},
|
|
32
|
+
}, t('emptyCart.message')), /*#__PURE__*/React.createElement(Button, {
|
|
31
33
|
onClick: handleContinueShopping
|
|
32
|
-
},
|
|
34
|
+
}, t('emptyCart.continueShopping')));
|
|
33
35
|
};
|
|
34
36
|
export default EmptyCart;
|
|
@@ -4,6 +4,7 @@ const StoreModalCartLayout = _ref => {
|
|
|
4
4
|
checkoutEnabled,
|
|
5
5
|
children: {
|
|
6
6
|
items,
|
|
7
|
+
notice,
|
|
7
8
|
couponCodeInput,
|
|
8
9
|
totals,
|
|
9
10
|
checkout,
|
|
@@ -19,7 +20,7 @@ const StoreModalCartLayout = _ref => {
|
|
|
19
20
|
className: "store-modal__cart__order-variables"
|
|
20
21
|
}, orderVariables), /*#__PURE__*/React.createElement("div", {
|
|
21
22
|
className: "store-modal__cart__items"
|
|
22
|
-
}, items), /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
}, items), notice, /*#__PURE__*/React.createElement("div", {
|
|
23
24
|
className: "store-modal__cart__coupon-code-input"
|
|
24
25
|
}, couponCodeInput), /*#__PURE__*/React.createElement("div", {
|
|
25
26
|
className: "store-modal__cart__share"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useCallback, useMemo } from 'react';
|
|
2
2
|
import { ArrowLeft, CartNew, X } from '../../Icons/index.js';
|
|
3
3
|
import StoreModalContainerContext from './StoreModalContainerContext.js';
|
|
4
|
+
import { useT } from '../../../i18n/useT.js';
|
|
4
5
|
const StoreModalContainer = _ref => {
|
|
5
6
|
let {
|
|
6
7
|
onClickBackground,
|
|
@@ -17,6 +18,7 @@ const StoreModalContainer = _ref => {
|
|
|
17
18
|
body
|
|
18
19
|
}
|
|
19
20
|
} = _ref;
|
|
21
|
+
const t = useT();
|
|
20
22
|
const container = useRef(null);
|
|
21
23
|
const handleScrollToTop = useCallback(() => {
|
|
22
24
|
var _container$current, _container$current$sc;
|
|
@@ -61,12 +63,12 @@ const StoreModalContainer = _ref => {
|
|
|
61
63
|
}, showCartButton && /*#__PURE__*/React.createElement("button", {
|
|
62
64
|
className: "store-modal__container__cart-button",
|
|
63
65
|
onClick: onClickCart,
|
|
64
|
-
"aria-label":
|
|
66
|
+
"aria-label": t('storeModal.cart'),
|
|
65
67
|
"data-count": orderItemCount
|
|
66
68
|
}, /*#__PURE__*/React.createElement(CartNew, null)), /*#__PURE__*/React.createElement("button", {
|
|
67
69
|
className: "store-modal__container__close-button",
|
|
68
70
|
onClick: onClickClose,
|
|
69
|
-
"aria-label":
|
|
71
|
+
"aria-label": t('storeModal.close')
|
|
70
72
|
}, /*#__PURE__*/React.createElement(X, null)))), /*#__PURE__*/React.createElement("div", {
|
|
71
73
|
className: "store-modal__container__body"
|
|
72
74
|
}, body))));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DownloadFonts } from '../../Icons/index.js';
|
|
3
|
+
import { useT } from '../../../i18n/useT.js';
|
|
3
4
|
const StoreModalDownloadLayout = _ref => {
|
|
4
5
|
let {
|
|
5
6
|
archiveUrl,
|
|
@@ -7,6 +8,7 @@ const StoreModalDownloadLayout = _ref => {
|
|
|
7
8
|
message
|
|
8
9
|
}
|
|
9
10
|
} = _ref;
|
|
11
|
+
const t = useT();
|
|
10
12
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
11
13
|
className: "store-modal__download__section"
|
|
12
14
|
}, message), archiveUrl && /*#__PURE__*/React.createElement("div", {
|
|
@@ -15,6 +17,6 @@ const StoreModalDownloadLayout = _ref => {
|
|
|
15
17
|
target: "_blank",
|
|
16
18
|
href: archiveUrl,
|
|
17
19
|
className: "store-modal__download__button"
|
|
18
|
-
}, /*#__PURE__*/React.createElement(DownloadFonts, null), "
|
|
20
|
+
}, /*#__PURE__*/React.createElement(DownloadFonts, null), " ", t('download.downloadYourOrder'))));
|
|
19
21
|
};
|
|
20
22
|
export default StoreModalDownloadLayout;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useT } from '../../../i18n/useT.js';
|
|
2
3
|
const StoreModalIndexItem = _ref => {
|
|
3
4
|
let {
|
|
4
5
|
onClick,
|
|
@@ -8,6 +9,7 @@ const StoreModalIndexItem = _ref => {
|
|
|
8
9
|
label
|
|
9
10
|
}
|
|
10
11
|
} = _ref;
|
|
12
|
+
const t = useT();
|
|
11
13
|
return /*#__PURE__*/React.createElement("button", {
|
|
12
14
|
onClick: onClick,
|
|
13
15
|
className: "store-modal__index-item__button"
|
|
@@ -23,6 +25,6 @@ const StoreModalIndexItem = _ref => {
|
|
|
23
25
|
className: "store-modal__index-item__label"
|
|
24
26
|
}, label))), /*#__PURE__*/React.createElement("div", {
|
|
25
27
|
className: "store-modal__index-item__buy"
|
|
26
|
-
},
|
|
28
|
+
}, t('storeModal.buy')));
|
|
27
29
|
};
|
|
28
30
|
export default StoreModalIndexItem;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useT } from '../../../i18n/useT.js';
|
|
2
3
|
// Sits after the last collection while more remain. The button is what a
|
|
3
4
|
// visitor sees while a page is on its way, and the way to go on without
|
|
4
5
|
// scrolling — with a keyboard, or if the observer never fires.
|
|
@@ -8,6 +9,7 @@ const StoreModalIndexLoadMore = _ref => {
|
|
|
8
9
|
onClick,
|
|
9
10
|
loading
|
|
10
11
|
} = _ref;
|
|
12
|
+
const t = useT();
|
|
11
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
14
|
className: "store-modal__index__load-more",
|
|
13
15
|
ref: sentinelRef
|
|
@@ -16,6 +18,6 @@ const StoreModalIndexLoadMore = _ref => {
|
|
|
16
18
|
className: "store-modal__index__load-more__button",
|
|
17
19
|
onClick: onClick,
|
|
18
20
|
disabled: loading
|
|
19
|
-
}, loading ? '
|
|
21
|
+
}, loading ? t('common.loading') : t('storeModal.loadMore')));
|
|
20
22
|
};
|
|
21
23
|
export default StoreModalIndexLoadMore;
|
|
@@ -2,6 +2,7 @@ import React, { useCallback, useContext } from 'react';
|
|
|
2
2
|
import ConfigContext from '../ConfigContext.js';
|
|
3
3
|
import Button from './Button/index.js';
|
|
4
4
|
import { Checkbox, CheckboxChecked, CheckboxCrossed } from '../Icons/index.js';
|
|
5
|
+
import { useT } from '../../i18n/useT.js';
|
|
5
6
|
function CheckboxButton(_ref) {
|
|
6
7
|
let {
|
|
7
8
|
label,
|
|
@@ -34,6 +35,7 @@ export default function StoreModalLicenseeIsBillingIdentityElement(_ref2) {
|
|
|
34
35
|
clientDescription
|
|
35
36
|
}
|
|
36
37
|
} = _ref2;
|
|
38
|
+
const t = useT();
|
|
37
39
|
const handleClick = useCallback(licenseeIsBilling => () => {
|
|
38
40
|
onChange(licenseeIsBilling);
|
|
39
41
|
}, [onChange]);
|
|
@@ -47,7 +49,7 @@ export default function StoreModalLicenseeIsBillingIdentityElement(_ref2) {
|
|
|
47
49
|
}, /*#__PURE__*/React.createElement("div", {
|
|
48
50
|
className: "store-modal__licensee-is-billing-identity__option"
|
|
49
51
|
}, /*#__PURE__*/React.createElement(CheckboxButton, {
|
|
50
|
-
label: selfLabel ?? '
|
|
52
|
+
label: selfLabel ?? t('checkout.licenseeSelf'),
|
|
51
53
|
selected: value === true,
|
|
52
54
|
onClick: handleClick(true)
|
|
53
55
|
}), selfDescription ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -55,7 +57,7 @@ export default function StoreModalLicenseeIsBillingIdentityElement(_ref2) {
|
|
|
55
57
|
}, selfDescription) : null), /*#__PURE__*/React.createElement("div", {
|
|
56
58
|
className: "store-modal__licensee-is-billing-identity__option"
|
|
57
59
|
}, /*#__PURE__*/React.createElement(CheckboxButton, {
|
|
58
|
-
label: clientLabel ?? '
|
|
60
|
+
label: clientLabel ?? t('checkout.licenseeClient'),
|
|
59
61
|
selected: value === false,
|
|
60
62
|
onClick: handleClick(false)
|
|
61
63
|
}), clientDescription ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import StoreModalPageContainer from '../StoreModalPageContainer/index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { useT } from '../../../i18n/useT.js';
|
|
4
|
+
const StoreModalLoadingScreen = () => {
|
|
5
|
+
const t = useT();
|
|
6
|
+
return /*#__PURE__*/React.createElement(StoreModalPageContainer, null, {
|
|
7
|
+
body: t('common.loadingDots')
|
|
8
|
+
});
|
|
9
|
+
};
|
|
6
10
|
export default StoreModalLoadingScreen;
|
|
@@ -67,6 +67,7 @@ import React, { useCallback, useContext, useEffect, useMemo, useRef, useState }
|
|
|
67
67
|
// package's barebone named export instead was the FD-917 root cause; see
|
|
68
68
|
// ../Recaptcha for the full explanation.
|
|
69
69
|
import { ReCAPTCHA } from '../Recaptcha.js';
|
|
70
|
+
import { useLocale } from '../LocaleContext.js';
|
|
70
71
|
import * as Sentry from '@sentry/react';
|
|
71
72
|
import { commitMutation, graphql, useFragment, useRelayEnvironment } from 'react-relay';
|
|
72
73
|
import AddressFields from '../Cart/AddressFields.js';
|
|
@@ -79,9 +80,11 @@ import { Check, X } from '../Icons/index.js';
|
|
|
79
80
|
import ConfigContext from '../ConfigContext.js';
|
|
80
81
|
import { Price } from '../Price/index.js';
|
|
81
82
|
import { sendOrderTracking } from '../Cart/orderTracking.js';
|
|
83
|
+
import { withCheckoutReturn } from '../Cart/checkoutReturn.js';
|
|
82
84
|
import { trackPaymentInfoEntered } from '../Cart/storefrontEvents.js';
|
|
83
85
|
import { validateAddressElements, validateElements } from '../../stripeElements.js';
|
|
84
|
-
import { useRecaptchaTimeout, isRecaptchaScriptLoaded
|
|
86
|
+
import { useRecaptchaTimeout, isRecaptchaScriptLoaded } from '../../hooks/useRecaptchaTimeout.js';
|
|
87
|
+
import { useT } from '../../i18n/useT.js';
|
|
85
88
|
|
|
86
89
|
/* const LICENSEE_REQUIRED_FIELDS = ['organization', 'country'] as (keyof Identity)[]; */
|
|
87
90
|
|
|
@@ -130,6 +133,7 @@ function EditableSection(_ref) {
|
|
|
130
133
|
save
|
|
131
134
|
}
|
|
132
135
|
} = _ref;
|
|
136
|
+
const t = useT();
|
|
133
137
|
const [submitting, setSubmitting] = useState(false);
|
|
134
138
|
const handleSubmit = useCallback(e => {
|
|
135
139
|
e.preventDefault();
|
|
@@ -157,15 +161,15 @@ function EditableSection(_ref) {
|
|
|
157
161
|
className: "store-modal__cart__button",
|
|
158
162
|
type: "button",
|
|
159
163
|
onClick: handleCancel
|
|
160
|
-
},
|
|
164
|
+
}, t('common.cancel')) : null, /*#__PURE__*/React.createElement("button", {
|
|
161
165
|
className: "store-modal__cart__button",
|
|
162
166
|
type: "submit",
|
|
163
167
|
disabled: submitting || disableSubmit
|
|
164
|
-
}, submitting ? '
|
|
168
|
+
}, submitting ? t('common.submittingDots') : save))) : /*#__PURE__*/React.createElement(React.Fragment, null, show, /*#__PURE__*/React.createElement("button", {
|
|
165
169
|
type: "button",
|
|
166
170
|
className: "store-modal__cart__edit-button",
|
|
167
171
|
onClick: onEdit
|
|
168
|
-
},
|
|
172
|
+
}, t('checkout.change'))));
|
|
169
173
|
}
|
|
170
174
|
export default function StoreModalUnifiedCheckout(_ref2) {
|
|
171
175
|
var _order$orderVariableS, _viewer$settings, _viewer$settings2, _viewer$settings3, _viewer$settings4, _viewer$settings5, _viewer$settings6, _viewer$settings7, _viewer$settings8, _order$stripePaymentI, _viewer$settings9, _order$stripePaymentI2, _order$stripePaymentI3;
|
|
@@ -175,6 +179,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
175
179
|
onScrollToTop,
|
|
176
180
|
onUpdateOrderVariableSelections
|
|
177
181
|
} = _ref2;
|
|
182
|
+
const t = useT();
|
|
178
183
|
const viewer = useFragment((_StoreModalUnifiedCheckout_viewer.hash && _StoreModalUnifiedCheckout_viewer.hash !== "5e8a59a64c401bb354b53ab83d993e03" && console.error("The definition of 'StoreModalUnifiedCheckout_viewer' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalUnifiedCheckout_viewer), viewerKey);
|
|
179
184
|
const order = useFragment((_StoreModalUnifiedCheckout_order.hash && _StoreModalUnifiedCheckout_order.hash !== "7c5503876a562732ebaead9b2ae97180" && console.error("The definition of 'StoreModalUnifiedCheckout_order' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalUnifiedCheckout_order), orderKey);
|
|
180
185
|
|
|
@@ -281,6 +286,9 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
281
286
|
}));
|
|
282
287
|
}, [setLicenseeIdentity]);
|
|
283
288
|
const environment = useRelayEnvironment();
|
|
289
|
+
const {
|
|
290
|
+
storeModal: storeModalConfig
|
|
291
|
+
} = useContext(ConfigContext);
|
|
284
292
|
|
|
285
293
|
// Capture analytics consent + attribution on the order for the purchase
|
|
286
294
|
// event the server emits on completion (from a Stripe webhook, where no
|
|
@@ -317,6 +325,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
317
325
|
// payment-section `error`, which isn't rendered until a customer exists).
|
|
318
326
|
const [customerError, setCustomerError] = useState(null);
|
|
319
327
|
const recaptchaRef = useRef(null);
|
|
328
|
+
const locale = useLocale();
|
|
320
329
|
const recaptchaTimeout = useRecaptchaTimeout();
|
|
321
330
|
const recaptchaEnabled = ((_viewer$settings = viewer.settings) === null || _viewer$settings === void 0 ? void 0 : _viewer$settings.recaptchaEnabled) ?? false;
|
|
322
331
|
const recaptchaSiteKey = (_viewer$settings2 = viewer.settings) === null || _viewer$settings2 === void 0 ? void 0 : _viewer$settings2.recaptchaSiteKey;
|
|
@@ -495,9 +504,9 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
495
504
|
setPendingCustomerSubmit(null);
|
|
496
505
|
setRecaptchaToken(null);
|
|
497
506
|
(_recaptchaRef$current3 = recaptchaRef.current) === null || _recaptchaRef$current3 === void 0 ? void 0 : _recaptchaRef$current3.reset();
|
|
498
|
-
setCustomerError(
|
|
507
|
+
setCustomerError(t('recaptcha.unavailable'));
|
|
499
508
|
callbacks.onError();
|
|
500
|
-
}, [recaptchaTimeout]);
|
|
509
|
+
}, [recaptchaTimeout, t]);
|
|
501
510
|
const handleRecaptchaErrored = useCallback(() => {
|
|
502
511
|
// Widget loaded but errored during execution — recover the same way.
|
|
503
512
|
if (pendingCustomerSubmit) {
|
|
@@ -613,11 +622,14 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
613
622
|
// If billing identity is not saved yet, don't proceed with payment
|
|
614
623
|
// The validation above will show errors for incomplete fields
|
|
615
624
|
if (!isBillingIdentitySaved) {
|
|
616
|
-
setError('
|
|
625
|
+
setError(t('checkout.completeBilling'));
|
|
617
626
|
return;
|
|
618
627
|
}
|
|
619
628
|
setCompleting(true);
|
|
620
629
|
setError(null);
|
|
630
|
+
|
|
631
|
+
// The order page, told where its link back goes (`storeModal.returnUrl`).
|
|
632
|
+
const completeUrl = withCheckoutReturn(order.completeUrl, storeModalConfig, window.location.href);
|
|
621
633
|
const processPayment = () => {
|
|
622
634
|
var _billingIdentity$stre, _billingIdentity$stre2;
|
|
623
635
|
if (order.canCompleteWithCoupon) {
|
|
@@ -630,7 +642,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
630
642
|
setError(errors[0].message);
|
|
631
643
|
return;
|
|
632
644
|
}
|
|
633
|
-
window.location.href =
|
|
645
|
+
window.location.href = completeUrl;
|
|
634
646
|
}
|
|
635
647
|
});
|
|
636
648
|
return;
|
|
@@ -639,7 +651,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
639
651
|
stripe === null || stripe === void 0 ? void 0 : stripe.confirmPayment({
|
|
640
652
|
elements,
|
|
641
653
|
confirmParams: {
|
|
642
|
-
return_url:
|
|
654
|
+
return_url: completeUrl,
|
|
643
655
|
payment_method_data: {
|
|
644
656
|
billing_details: {
|
|
645
657
|
email: billingIdentity.email,
|
|
@@ -659,7 +671,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
659
671
|
}).then(result => {
|
|
660
672
|
if ('error' in result) {
|
|
661
673
|
setCompleting(false);
|
|
662
|
-
setError(result.error.message ?? '
|
|
674
|
+
setError(result.error.message ?? t('checkout.paymentFailed'));
|
|
663
675
|
}
|
|
664
676
|
}).catch(error => {
|
|
665
677
|
console.log(error);
|
|
@@ -698,13 +710,13 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
698
710
|
onSubmit: handleCustomerSubmit,
|
|
699
711
|
disableSubmit: false
|
|
700
712
|
}, {
|
|
701
|
-
save: canUseEmbeddedCheckout ? order.customer ? '
|
|
713
|
+
save: canUseEmbeddedCheckout ? order.customer ? t('checkout.save') : t('checkout.continue') : t('checkout.checkout'),
|
|
702
714
|
show: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", {
|
|
703
715
|
className: "store-modal__cart__checkout-section-title"
|
|
704
|
-
},
|
|
716
|
+
}, t('cart.contactInformation')), order.customer ? /*#__PURE__*/React.createElement(React.Fragment, null, order.customer.name, /*#__PURE__*/React.createElement("br", null), order.customer.email) : t('common.loadingDots')),
|
|
705
717
|
edit: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
|
|
706
718
|
className: "store-modal__cart__checkout-section-title"
|
|
707
|
-
},
|
|
719
|
+
}, t('cart.contactInformation')), /*#__PURE__*/React.createElement(CustomerFields, {
|
|
708
720
|
value: customer,
|
|
709
721
|
onChange: handleCustomerChange,
|
|
710
722
|
optInLabel: (_viewer$settings3 = viewer.settings) === null || _viewer$settings3 === void 0 ? void 0 : _viewer$settings3.newsletterOptInLabel,
|
|
@@ -714,6 +726,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
714
726
|
}, customerError), recaptchaEnabled && recaptchaSiteKey && /*#__PURE__*/React.createElement(ReCAPTCHA, {
|
|
715
727
|
ref: recaptchaRef,
|
|
716
728
|
sitekey: recaptchaSiteKey,
|
|
729
|
+
hl: locale,
|
|
717
730
|
size: "invisible",
|
|
718
731
|
onChange: handleRecaptchaChange,
|
|
719
732
|
onExpired: handleRecaptchaExpired,
|
|
@@ -731,7 +744,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
731
744
|
}),
|
|
732
745
|
selfLabel: /*#__PURE__*/React.createElement("span", {
|
|
733
746
|
dangerouslySetInnerHTML: {
|
|
734
|
-
__html: ((_viewer$settings5 = viewer.settings) === null || _viewer$settings5 === void 0 ? void 0 : _viewer$settings5.storeModalLicenseeSelfLabel) ?? '
|
|
747
|
+
__html: ((_viewer$settings5 = viewer.settings) === null || _viewer$settings5 === void 0 ? void 0 : _viewer$settings5.storeModalLicenseeSelfLabel) ?? t('checkout.licenseeSelf')
|
|
735
748
|
}
|
|
736
749
|
}),
|
|
737
750
|
selfDescription: (_viewer$settings6 = viewer.settings) !== null && _viewer$settings6 !== void 0 && _viewer$settings6.storeModalLicenseeSelfDescription ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -741,7 +754,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
741
754
|
}) : null,
|
|
742
755
|
clientLabel: /*#__PURE__*/React.createElement("span", {
|
|
743
756
|
dangerouslySetInnerHTML: {
|
|
744
|
-
__html: ((_viewer$settings7 = viewer.settings) === null || _viewer$settings7 === void 0 ? void 0 : _viewer$settings7.storeModalLicenseeClientLabel) ?? '
|
|
757
|
+
__html: ((_viewer$settings7 = viewer.settings) === null || _viewer$settings7 === void 0 ? void 0 : _viewer$settings7.storeModalLicenseeClientLabel) ?? t('checkout.licenseeClient')
|
|
745
758
|
}
|
|
746
759
|
}),
|
|
747
760
|
clientDescription: (_viewer$settings8 = viewer.settings) !== null && _viewer$settings8 !== void 0 && _viewer$settings8.storeModalLicenseeClientDescription ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -753,7 +766,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
753
766
|
className: "store-modal__cart__checkout-section"
|
|
754
767
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
755
768
|
className: "store-modal__cart__checkout-section-title"
|
|
756
|
-
}, hasCountryMismatch ? '
|
|
769
|
+
}, hasCountryMismatch ? t('cart.licenseeInformation') : t('checkout.licenseeInformationClient')), /*#__PURE__*/React.createElement("div", {
|
|
757
770
|
className: "store-modal__cart__identity-fields"
|
|
758
771
|
}, /*#__PURE__*/React.createElement(AddressFields, {
|
|
759
772
|
viewer: viewer,
|
|
@@ -766,7 +779,7 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
766
779
|
"data-disabled": !order.customer
|
|
767
780
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
768
781
|
className: "store-modal__cart__checkout-section-title"
|
|
769
|
-
},
|
|
782
|
+
}, t('cart.billingInformation')), /*#__PURE__*/React.createElement("div", {
|
|
770
783
|
className: "store-modal__cart__identity-fields"
|
|
771
784
|
}, /*#__PURE__*/React.createElement(AddressFields, {
|
|
772
785
|
viewer: viewer,
|
|
@@ -782,23 +795,25 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
782
795
|
className: "store-modal__cart__button",
|
|
783
796
|
onClick: handleCheckout,
|
|
784
797
|
disabled: checkingOut
|
|
785
|
-
}, checkingOut ? '
|
|
798
|
+
}, checkingOut ? t('common.submittingDots') : t('checkout.checkout'))) : null, showPaymentSection ? /*#__PURE__*/React.createElement("div", {
|
|
786
799
|
className: "store-modal__cart__checkout-section",
|
|
787
800
|
"data-disabled": false
|
|
788
801
|
}, /*#__PURE__*/React.createElement("form", {
|
|
789
802
|
onSubmit: handleComplete
|
|
790
803
|
}, !zeroOrder && ((_order$stripePaymentI = order.stripePaymentIntent) === null || _order$stripePaymentI === void 0 ? void 0 : _order$stripePaymentI.clientSecret) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
|
|
791
804
|
className: "store-modal__cart__checkout-section-title"
|
|
792
|
-
},
|
|
805
|
+
}, t('checkout.paymentInformation'), /*#__PURE__*/React.createElement("span", {
|
|
793
806
|
className: "store-modal__cart__checkout-section-subtitle"
|
|
794
807
|
}, /*#__PURE__*/React.createElement("a", {
|
|
795
808
|
href: "https://stripe.com",
|
|
796
809
|
target: "_blank",
|
|
797
810
|
rel: "noopener"
|
|
798
|
-
},
|
|
811
|
+
}, t.rich('checkout.poweredBy', {
|
|
812
|
+
logo: /*#__PURE__*/React.createElement(StripeLogo, null)
|
|
813
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
799
814
|
className: "store-modal__cart__payment"
|
|
800
815
|
}, /*#__PURE__*/React.createElement(Sentry.ErrorBoundary, {
|
|
801
|
-
fallback: /*#__PURE__*/React.createElement("div", null,
|
|
816
|
+
fallback: /*#__PURE__*/React.createElement("div", null, t('common.somethingWentWrong'))
|
|
802
817
|
}, /*#__PURE__*/React.createElement(PaymentElement, {
|
|
803
818
|
onChange: handlePaymentChange,
|
|
804
819
|
options: {
|
|
@@ -832,10 +847,12 @@ export default function StoreModalUnifiedCheckout(_ref2) {
|
|
|
832
847
|
type: "submit",
|
|
833
848
|
className: "store-modal__cart__button",
|
|
834
849
|
disabled: completing || !acceptedEULA
|
|
835
|
-
}, completing ? '
|
|
836
|
-
price: {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
850
|
+
}, completing ? t('common.submittingDots') : zeroOrder ? t('checkout.completeOrder') : /*#__PURE__*/React.createElement("span", null, t.rich('checkout.pay', {
|
|
851
|
+
price: (_order$stripePaymentI2 = order.stripePaymentIntent) !== null && _order$stripePaymentI2 !== void 0 && _order$stripePaymentI2.amount && (_order$stripePaymentI3 = order.stripePaymentIntent) !== null && _order$stripePaymentI3 !== void 0 && _order$stripePaymentI3.currency ? /*#__PURE__*/React.createElement(Price, {
|
|
852
|
+
price: {
|
|
853
|
+
amount: order.stripePaymentIntent.amount,
|
|
854
|
+
currency: order.stripePaymentIntent.currency
|
|
855
|
+
}
|
|
856
|
+
}) : null
|
|
857
|
+
}))))) : null);
|
|
841
858
|
}
|
package/dist/fontdue.css
CHANGED
|
@@ -1332,6 +1332,52 @@ fontdue-feature-testers {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
|
+
.character-viewer_blocks[data-collapsed=height] {
|
|
1336
|
+
max-height: var(--collapsed-height);
|
|
1337
|
+
overflow: hidden;
|
|
1338
|
+
}
|
|
1339
|
+
.character-viewer_blocks[data-collapsed=height][data-overflowing] {
|
|
1340
|
+
mask-image: linear-gradient(to bottom, black calc(100% - 80px), transparent);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
.character-viewer__load-more {
|
|
1344
|
+
grid-column: -2/-1;
|
|
1345
|
+
align-self: start;
|
|
1346
|
+
margin-top: -10px;
|
|
1347
|
+
text-align: center;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
.character-viewer__character-map[data-collapsible] {
|
|
1351
|
+
grid-template-rows: auto 1fr;
|
|
1352
|
+
}
|
|
1353
|
+
.character-viewer__character-map[data-collapsible] > .character-viewer__monitor {
|
|
1354
|
+
grid-row: span 2;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
.character-viewer__load-more__button {
|
|
1358
|
+
background: none;
|
|
1359
|
+
color: inherit;
|
|
1360
|
+
font: inherit;
|
|
1361
|
+
text-decoration: inherit;
|
|
1362
|
+
text-align: inherit;
|
|
1363
|
+
border: 0;
|
|
1364
|
+
border-radius: 0;
|
|
1365
|
+
padding: 0;
|
|
1366
|
+
margin: 0;
|
|
1367
|
+
appearance: none;
|
|
1368
|
+
text-transform: inherit;
|
|
1369
|
+
}
|
|
1370
|
+
.character-viewer__load-more__button:active, .character-viewer__load-more__button:focus {
|
|
1371
|
+
outline: none;
|
|
1372
|
+
}
|
|
1373
|
+
.character-viewer__load-more__button:not(:disabled) {
|
|
1374
|
+
cursor: pointer;
|
|
1375
|
+
}
|
|
1376
|
+
.character-viewer__load-more__button {
|
|
1377
|
+
color: var(--character_viewer_load_more_color, var(--secondary_text_color));
|
|
1378
|
+
text-decoration: underline;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1335
1381
|
.character-viewer__block {
|
|
1336
1382
|
clear: both;
|
|
1337
1383
|
}
|
|
@@ -1668,6 +1714,18 @@ input:checked + .checkbox__icon {
|
|
|
1668
1714
|
margin-bottom: 20px;
|
|
1669
1715
|
}
|
|
1670
1716
|
|
|
1717
|
+
.store-modal__cart__notice,
|
|
1718
|
+
.store-modal__cart__review > .store-modal__cart__error {
|
|
1719
|
+
grid-column: 1/span 2;
|
|
1720
|
+
margin: 20px 0;
|
|
1721
|
+
}
|
|
1722
|
+
@media (min-width: 900px) {
|
|
1723
|
+
.store-modal__cart__notice,
|
|
1724
|
+
.store-modal__cart__review > .store-modal__cart__error {
|
|
1725
|
+
margin: 0;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1671
1729
|
.store-modal__cart__payment {
|
|
1672
1730
|
margin-bottom: 20px;
|
|
1673
1731
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const RECAPTCHA_TIMEOUT_MS = 15000;
|
|
2
|
-
export declare const RECAPTCHA_UNAVAILABLE_MESSAGE
|
|
2
|
+
export declare const RECAPTCHA_UNAVAILABLE_MESSAGE: string;
|
|
3
3
|
export declare function isRecaptchaScriptLoaded(): boolean;
|
|
4
4
|
export interface RecaptchaTimeout {
|
|
5
5
|
/** (Re)start the timer. Any previously scheduled callback is cancelled. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
+
import en from '../i18n/en.js';
|
|
2
3
|
|
|
3
4
|
// How long we wait for the invisible reCAPTCHA widget to hand back a token
|
|
4
5
|
// after calling `execute()` before we give up. reCAPTCHA normally resolves in
|
|
@@ -9,8 +10,9 @@ export const RECAPTCHA_TIMEOUT_MS = 15000;
|
|
|
9
10
|
|
|
10
11
|
// User-facing message shown when the reCAPTCHA widget never produced a token
|
|
11
12
|
// (typically because Google's api.js failed to load). Curly apostrophes per
|
|
12
|
-
// the Fontdue house style.
|
|
13
|
-
|
|
13
|
+
// the Fontdue house style. This is the English message; components show it
|
|
14
|
+
// through `t('recaptcha.unavailable')` so it follows the page's language.
|
|
15
|
+
export const RECAPTCHA_UNAVAILABLE_MESSAGE = en['recaptcha.unavailable'];
|
|
14
16
|
|
|
15
17
|
// True once Google's reCAPTCHA script (`window.grecaptcha`) has loaded. We use
|
|
16
18
|
// this to tell the two failure modes apart when the timeout fires:
|