@dropins/storefront-checkout 1.4.0-beta1 → 2.0.0-beta1
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/api/estimateShippingMethods/graphql/index.d.ts +15 -15
- package/api/estimateShippingMethods/index.d.ts +15 -15
- package/api/fetch-graphql/fetch-graphql.d.ts +19 -19
- package/api/fetch-graphql/index.d.ts +15 -15
- package/api/getCart/getCart.d.ts +1 -1
- package/api/getCart/graphql/index.d.ts +15 -15
- package/api/getCart/index.d.ts +15 -15
- package/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts +1 -1
- package/api/getCustomer/graphql/index.d.ts +15 -15
- package/api/getCustomer/index.d.ts +15 -15
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +1 -1
- package/api/getStoreConfig/index.d.ts +15 -15
- package/api/initialize/index.d.ts +15 -15
- package/api/initializeCheckout/index.d.ts +15 -15
- package/api/initializeCheckout/initializeCheckout.d.ts +1 -1
- package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +15 -15
- package/api/isEmailAvailable/index.d.ts +15 -15
- package/api/setBillingAddress/index.d.ts +15 -15
- package/api/setBillingAddress/setBillingAddress.d.ts +1 -1
- package/api/setGuestEmailOnCart/index.d.ts +15 -15
- package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +1 -1
- package/api/setPaymentMethod/index.d.ts +15 -15
- package/api/setPaymentMethod/setPaymentMethod.d.ts +1 -1
- package/api/setShippingAddress/index.d.ts +15 -15
- package/api/setShippingAddress/setShippingAddress.d.ts +1 -1
- package/api/setShippingMethods/index.d.ts +15 -15
- package/api/setShippingMethods/setShippingMethods.d.ts +1 -1
- package/api/synchronizeCheckout/synchronizeCheckout.d.ts +1 -1
- package/api.js +9 -9
- package/chunks/ConditionalWrapper.js +3 -0
- package/chunks/ServerErrorSignal.js +3 -0
- package/chunks/TermsAndConditions.js +2 -2
- package/chunks/errors.js +11 -1
- package/chunks/setBillingAddress.js +2 -2
- package/chunks/setGuestEmailOnCart.js +6 -6
- package/chunks/setPaymentMethod.js +2 -2
- package/chunks/setShippingMethods.js +3 -3
- package/chunks/synchronizeCheckout.js +5 -5
- package/chunks/values.js +3 -0
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +2 -1
- package/components/BillToShippingAddress/index.d.ts +15 -15
- package/components/ConditionalWrapper/ConditionalWrapper.d.ts +8 -0
- package/{containers/Newsletter → components/ConditionalWrapper}/index.d.ts +2 -2
- package/components/EstimateShipping/EstimateShipping.d.ts +2 -2
- package/components/EstimateShipping/index.d.ts +15 -15
- package/components/LoginForm/LoginForm.d.ts +2 -2
- package/components/OutOfStock/index.d.ts +15 -15
- package/components/PaymentMethods/PaymentMethods.d.ts +7 -8
- package/components/PlaceOrder/PlaceOrder.d.ts +1 -1
- package/components/PlaceOrder/index.d.ts +15 -15
- package/components/ServerError/index.d.ts +15 -15
- package/components/ShippingMethods/ShippingMethods.d.ts +6 -4
- package/components/TermsAndConditions/TermsAndConditions.d.ts +2 -2
- package/components/index.d.ts +1 -1
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +5 -20
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/EstimateShipping/EstimateShipping.d.ts +5 -2
- package/containers/EstimateShipping/index.d.ts +15 -15
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm/LoginForm.d.ts +4 -5
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +5 -4
- package/containers/MergedCartBanner.js +1 -1
- package/containers/OutOfStock/OutOfStock.d.ts +1 -0
- package/containers/OutOfStock/index.d.ts +15 -15
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods/PaymentMethods.d.ts +6 -23
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +3 -6
- package/containers/PlaceOrder/index.d.ts +15 -15
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError/ServerError.d.ts +1 -0
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods/ShippingMethods.d.ts +8 -11
- package/containers/ShippingMethods/utils/emitShippingEstimateEvent.d.ts +1 -1
- package/containers/ShippingMethods.js +1 -1
- package/containers/TermsAndConditions/TermsAndConditions.d.ts +1 -0
- package/containers/TermsAndConditions.js +1 -1
- package/containers/index.d.ts +0 -1
- package/data/models/country.d.ts +15 -15
- package/data/models/custom-attribute.d.ts +15 -15
- package/data/models/email-availability.d.ts +15 -15
- package/data/models/index.d.ts +1 -0
- package/data/models/payment-method.d.ts +15 -15
- package/data/models/price.d.ts +15 -15
- package/data/models/shipping-estimate.d.ts +4 -0
- package/data/models/store-config.d.ts +1 -4
- package/data/models/values.d.ts +11 -0
- package/data/transforms/transform-cart.d.ts +1 -1
- package/data/transforms/transform-shipping-methods.d.ts +1 -1
- package/i18n/en_US.json.d.ts +0 -3
- package/lib/dispatchApiCall.d.ts +6 -22
- package/lib/enqueueRequest.d.ts +11 -24
- package/lib/events.d.ts +8 -0
- package/lib/index.d.ts +3 -2
- package/lib/network-error.d.ts +15 -15
- package/lib/values.d.ts +17 -0
- package/msw/browser.d.ts +15 -15
- package/msw/fixtures/fragments/cart.d.ts +15 -15
- package/msw/fixtures/index.d.ts +15 -15
- package/msw/fixtures/mutations/index.d.ts +15 -15
- package/msw/fixtures/queries/index.d.ts +15 -15
- package/msw/server.d.ts +15 -15
- package/package.json +1 -1
- package/render/index.d.ts +15 -15
- package/render.js +5 -6
- package/signals/ShippingEstimateSignal.d.ts +6 -5
- package/signals/index.d.ts +0 -5
- package/tests/constants.d.ts +15 -15
- package/{api/getCart/fixtures.d.ts → tests/fixtures/cart.d.ts} +3 -3
- package/{api/getCustomer/fixtures.d.ts → tests/fixtures/customer.d.ts} +1 -1
- package/tests/fixtures/payments.d.ts +8 -0
- package/{api/estimateShippingMethods/fixtures.d.ts → tests/fixtures/shipping.d.ts} +1 -1
- package/tests/integration/utils/index.d.ts +15 -15
- package/tests/integration/utils/setup.d.ts +1 -1
- package/tests/integration/utils/user-actions.d.ts +15 -15
- package/tests/mocks/svg.d.ts +15 -15
- package/tests/utils/expectError.d.ts +15 -15
- package/tests/utils/index.d.ts +15 -15
- package/tests/utils/mockEvents.d.ts +15 -15
- package/chunks/ShippingEstimateSignal.js +0 -14
- package/chunks/store-config.js +0 -3
- package/chunks/withConditionalRendering.js +0 -3
- package/chunks/withSkeleton.js +0 -3
- package/components/Newsletter/Newsletter.d.ts +0 -6
- package/components/Newsletter/NewsletterSkeleton.d.ts +0 -4
- package/components/Newsletter/index.d.ts +0 -20
- package/containers/Newsletter/Newsletter.d.ts +0 -9
- package/containers/Newsletter.d.ts +0 -3
- package/containers/Newsletter.js +0 -3
- package/hocs/index.d.ts +0 -19
- package/hocs/withConditionalRendering.d.ts +0 -13
- package/hocs/withSkeleton.d.ts +0 -8
- package/hooks/index.d.ts +0 -19
- package/hooks/useBreakpoint/index.d.ts +0 -18
- package/hooks/useBreakpoint/useBreakpoint.d.ts +0 -18
- package/hooks/useStableList/index.d.ts +0 -2
- package/hooks/useStableList/useStableList.d.ts +0 -2
- package/lib/debounce.d.ts +0 -30
- package/lib/fetch-error.d.ts +0 -23
- package/signals/CartSignal.d.ts +0 -7
- package/signals/IsBillToShippingSignal.d.ts +0 -18
- package/signals/IsSubscribedToNewsletterSignal.d.ts +0 -18
- package/signals/SelectedPaymentMethodSignal.d.ts +0 -18
- package/signals/SelectedShippingMethodSignal.d.ts +0 -4
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './EstimateShipping';
|
|
18
18
|
export { EstimateShipping as default } from './EstimateShipping';
|
|
19
19
|
export * from './EstimateShippingSkeleton';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Customer } from '../../data/models';
|
|
2
|
-
import { VNode } from 'preact';
|
|
2
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
3
3
|
import { HTMLAttributes } from 'preact/compat';
|
|
4
4
|
|
|
5
5
|
export interface LoginFormProps extends Omit<HTMLAttributes<HTMLFormElement>, 'title'> {
|
|
@@ -13,5 +13,5 @@ export interface LoginFormProps extends Omit<HTMLAttributes<HTMLFormElement>, 't
|
|
|
13
13
|
onEmailInvalid: (event: Event) => void;
|
|
14
14
|
title?: VNode;
|
|
15
15
|
}
|
|
16
|
-
export declare const LoginForm:
|
|
16
|
+
export declare const LoginForm: FunctionComponent<LoginFormProps & import('..').ConditionalProps>;
|
|
17
17
|
//# sourceMappingURL=LoginForm.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './OutOfStock';
|
|
18
18
|
export { OutOfStock as default } from './OutOfStock';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { PaymentMethodConfig } from '../../containers';
|
|
2
2
|
import { PaymentMethod } from '../../data/models/payment-method';
|
|
3
|
-
import { VNode } from 'preact';
|
|
4
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
5
3
|
import { UIComponentType } from '../../types/ComponentTypes';
|
|
4
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
5
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
6
6
|
|
|
7
7
|
interface ExtendedPaymentMethod extends PaymentMethodConfig, PaymentMethod {
|
|
8
8
|
}
|
|
9
9
|
export interface PaymentMethodsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'loading' | 'title'> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
loading?: boolean;
|
|
13
|
-
onChange?: (value: string) => void;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
onChange?: (value: PaymentMethod) => void;
|
|
14
12
|
options?: ExtendedPaymentMethod[];
|
|
15
13
|
paymentMethodContent?: VNode;
|
|
16
|
-
selection
|
|
14
|
+
selection: PaymentMethod | null;
|
|
15
|
+
title?: VNode;
|
|
17
16
|
UIComponentType?: UIComponentType;
|
|
18
17
|
}
|
|
19
|
-
export declare const PaymentMethods:
|
|
18
|
+
export declare const PaymentMethods: FunctionComponent<PaymentMethodsProps & import('../ConditionalWrapper/ConditionalWrapper').ConditionalProps>;
|
|
20
19
|
export {};
|
|
21
20
|
//# sourceMappingURL=PaymentMethods.d.ts.map
|
|
@@ -5,5 +5,5 @@ export interface PlaceOrderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
onClick: (event: Event) => Promise<void>;
|
|
7
7
|
}
|
|
8
|
-
export declare const PlaceOrder: FunctionComponent<PlaceOrderProps>;
|
|
8
|
+
export declare const PlaceOrder: FunctionComponent<PlaceOrderProps & import('../ConditionalWrapper/index').ConditionalProps>;
|
|
9
9
|
//# sourceMappingURL=PlaceOrder.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './PlaceOrder';
|
|
18
18
|
export * from './PlaceOrderSkeleton';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './ServerError';
|
|
18
18
|
export { ServerError as default } from './ServerError';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ShippingMethod } from '../../data/models';
|
|
2
|
-
import {
|
|
2
|
+
import { UIComponentType } from '../../types/ComponentTypes';
|
|
3
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
3
4
|
import { HTMLAttributes } from 'preact/compat';
|
|
4
5
|
|
|
5
6
|
export interface ShippingMethodsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
6
|
-
isLoading?: boolean;
|
|
7
7
|
onSelectionChange?: (method: ShippingMethod) => void;
|
|
8
|
+
isLoading?: boolean;
|
|
8
9
|
options: ShippingMethod[];
|
|
9
|
-
selection
|
|
10
|
+
selection: ShippingMethod | null;
|
|
10
11
|
title?: VNode;
|
|
12
|
+
UIComponentType?: UIComponentType;
|
|
11
13
|
}
|
|
12
|
-
export declare const ShippingMethods:
|
|
14
|
+
export declare const ShippingMethods: FunctionComponent<ShippingMethodsProps & import('../ConditionalWrapper/ConditionalWrapper').ConditionalProps>;
|
|
13
15
|
//# sourceMappingURL=ShippingMethods.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { VNode } from 'preact';
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
3
3
|
|
|
4
4
|
export interface TermsAndConditionsProps extends HTMLAttributes<HTMLFormElement> {
|
|
5
5
|
agreements?: VNode;
|
|
6
6
|
error?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const TermsAndConditions:
|
|
8
|
+
export declare const TermsAndConditions: FunctionComponent<TermsAndConditionsProps & import('..').ConditionalProps>;
|
|
9
9
|
//# sourceMappingURL=TermsAndConditions.d.ts.map
|
package/components/index.d.ts
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
17
|
export * from './BillToShippingAddress';
|
|
18
|
+
export * from './ConditionalWrapper/index';
|
|
18
19
|
export * from './EstimateShipping';
|
|
19
20
|
export * from './LoginForm';
|
|
20
21
|
export * from './Markup';
|
|
21
|
-
export * from './Newsletter';
|
|
22
22
|
export * from './OutOfStock';
|
|
23
23
|
export * from './PaymentMethods';
|
|
24
24
|
export * from './PlaceOrder';
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
1
|
+
import { Container } from '@dropins/tools/types/elsie/src/lib';
|
|
2
|
+
|
|
17
3
|
export interface BillToShippingAddressProps {
|
|
18
4
|
onChange?: (checked: boolean) => void;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
autoSync?: boolean;
|
|
19
7
|
}
|
|
20
|
-
export declare const BillToShippingAddress:
|
|
21
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & BillToShippingAddressProps): import("preact").JSX.Element;
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
8
|
+
export declare const BillToShippingAddress: Container<BillToShippingAddressProps>;
|
|
24
9
|
//# sourceMappingURL=BillToShippingAddress.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as p}from"@dropins/tools/preact-jsx-runtime.js";import{h as x}from"../chunks/errors.js";import"@dropins/tools/lib.js";import{events as f}from"@dropins/tools/event-bus.js";import{W as _,h as z,g as I}from"../chunks/ConditionalWrapper.js";import{n as h}from"../chunks/values.js";import{s as V}from"../chunks/setBillingAddress.js";/* empty css */import{Skeleton as E,SkeletonRow as N,Checkbox as U}from"@dropins/tools/components.js";import{c as w}from"../chunks/classes.js";import{useText as y}from"@dropins/tools/i18n.js";import{useState as m,useRef as D,useCallback as g,useEffect as k}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const P=()=>p(E,{className:"bill-to-shipping-address__skeleton","data-testid":"bill-to-shipping-skeleton",children:p(N,{size:"small",variant:"row"})}),R=({className:s,checked:e,disabled:r,onChange:c})=>{const l=y({title:"Checkout.BillToShippingAddress.title"});return p("div",{className:"checkout-bill-to-shipping-address",children:p(U,{checked:e,className:w(["checkout-bill-to-shipping-address__checkbox",s]),"data-testid":"bill-to-shipping-checkbox",disabled:r,label:l.title,name:"checkout-bill-to-shipping-address__checkbox",onChange:c})})},W=_(R,P);function j(s){var l;const e=(l=s.shippingAddresses)==null?void 0:l[0],r=!!s.billingAddress;return(e==null?void 0:e.sameAsBilling)??!r}const ii=({onChange:s,active:e=!0,autoSync:r=!0})=>{const[c,l]=m(!1),[B,S]=m(!1),[b,a]=m(!0),d=D(!1),A=x.value,T=g(i=>{const t=i.target.checked;a(t),s==null||s(t),h({isBillToShipping:t}),r&&t&&z()&&V({sameAsShipping:!0}).catch(console.error)},[r,s]),n=g(i=>{const o=!i||(i==null?void 0:i.isEmpty),t=!!(i!=null&&i.isVirtual);if(o||t){S(t),a(!1),h({isBillToShipping:!1}),d.current=!1;return}if(!d.current){const u=j(i);a(u),d.current=!0,s==null||s(u),h({isBillToShipping:u})}},[s]);return k(()=>{if(!e)return;const i=I();if(i){l(!0),n(i);return}const o=f.on("checkout/initialized",t=>{l(!0),n(t)},{eager:!0});return()=>{o==null||o.off()}},[e,n]),k(()=>{if(!e)return;const i=f.on("checkout/updated",n,{eager:!1});return()=>{i==null||i.off()}},[e,n]),p(W,{checked:b,disabled:A,initialized:c,visible:e&&!B,onChange:T})};export{ii as BillToShippingAddress,ii as default};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Container } from '@dropins/tools/types/elsie/src/lib';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface EstimateShippingProps {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const EstimateShipping: Container<EstimateShippingProps>;
|
|
4
7
|
//# sourceMappingURL=EstimateShipping.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './EstimateShipping';
|
|
18
18
|
export { EstimateShipping as default } from './EstimateShipping';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{
|
|
3
|
+
import{jsx as i,jsxs as k}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as B,SkeletonRow as U,Price as h}from"@dropins/tools/components.js";import{W as z,g as G}from"../chunks/ConditionalWrapper.js";import"../chunks/TermsAndConditions.js";import{VComponent as C,classes as I}from"@dropins/tools/lib.js";import{useText as _}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{s as P,T as D}from"../chunks/errors.js";import{events as d}from"@dropins/tools/event-bus.js";import{useState as V,useCallback as b,useEffect as x}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const X=()=>i(B,{"data-testid":"estimate-shipping-skeleton",children:i(U,{size:"xsmall"})}),j=({label:n,price:t,priceExclTax:a,taxExcluded:o=!1,taxIncluded:c=!1})=>{const l=_({withTaxes:"Checkout.EstimateShipping.withTaxes",withoutTaxes:"Checkout.EstimateShipping.withoutTaxes"});return k("div",{className:"checkout-estimate-shipping","data-testid":"estimate-shipping",children:[i(C,{className:"checkout-estimate-shipping__label",node:n}),i(C,{className:"checkout-estimate-shipping__price",node:t}),c&&i("span",{className:I(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included",children:l.withTaxes}),o&&k("span",{className:I(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included-excluded",children:[a," ",l.withoutTaxes]})]})},v=z(j,X),nt=({active:n=!0})=>{var T;const[t,a]=V(),o=(t==null?void 0:t.amount.value)===0,c=(T=P.config)==null?void 0:T.shoppingCartDisplaySetting.shipping,l=c===D.INCLUDING_EXCLUDING_TAX,g=c===D.INCLUDING_TAX,u=_({freeShipping:"Checkout.EstimateShipping.freeShipping",taxToBeDetermined:"Checkout.EstimateShipping.taxToBeDetermined",label:"Checkout.EstimateShipping.label",estimated:"Checkout.EstimateShipping.estimated"}),r=b(e=>{var S;const s=!e||e.isEmpty,p=!!(e!=null&&e.isVirtual);if(s||p){a(null);return}const m=(S=e.shippingAddresses)==null?void 0:S[0];if(!m)return;const E=m==null?void 0:m.selectedShippingMethod;if(!E){a(null);return}const{amount:w,amountExclTax:L,amountInclTax:M}=E;a({estimated:!1,amount:w,amountExclTax:L,amountInclTax:M})},[]),f=b(e=>{let s=null;if(e.shippingMethod){const p=e.shippingMethod;s={estimated:!0,amount:p.amount,amountExclTax:p.amountExclTax,amountInclTax:p.amountInclTax}}a(s)},[]);x(()=>{if(!n)return;const e=d.on("shipping/estimate",f,{eager:!0});return()=>{e==null||e.off()}},[n,f]),x(()=>{if(!n)return;const e=G();if(e){r(e);return}const s=d.on("checkout/initialized",r,{eager:!0});return()=>{s==null||s.off()}},[n,r]),x(()=>{if(!n)return;const e=d.on("checkout/updated",r,{eager:!1});return()=>{e==null||e.off()}},[n,r]);const y=()=>o?i("span",{"data-testId":"free-shipping",children:u.freeShipping}):g&&(t!=null&&t.amountInclTax)?i(h,{amount:t.amountInclTax.value,currency:t.amountInclTax.currency,"data-testid":"shipping"}):i(h,{amount:t==null?void 0:t.amount.value,currency:t==null?void 0:t.amount.currency,"data-testid":"shipping"}),N=()=>t!=null&&t.amountExclTax?i(h,{amount:t.amountExclTax.value,currency:t.amountExclTax.currency,"data-testid":"shipping-excluding-tax"}):i("span",{children:u.taxToBeDetermined});return i(v,{initialized:t!==void 0,label:(()=>{const e=t!=null&&t.estimated?u.estimated:u.label;return i("span",{"data-testid":"estimate-shipping-label",children:e})})(),price:y(),priceExclTax:N(),taxExcluded:l&&!o,taxIncluded:g&&!o,visible:n&&t!==null})};export{nt as EstimateShipping,nt as default};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { TitleProps } from '../../types/TitleProps';
|
|
2
|
-
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
3
|
import { HTMLAttributes } from 'preact/compat';
|
|
4
4
|
|
|
5
5
|
export interface LoginFormProps extends HTMLAttributes<HTMLFormElement>, TitleProps {
|
|
6
6
|
displayHeadingContent?: boolean;
|
|
7
|
+
active?: boolean;
|
|
7
8
|
onSignInClick?: (email: string) => void;
|
|
8
9
|
onSignOutClick?: () => void;
|
|
10
|
+
autoSync?: boolean;
|
|
9
11
|
slots?: {
|
|
10
12
|
Heading?: SlotProps<{
|
|
11
13
|
authenticated: boolean;
|
|
12
14
|
}>;
|
|
13
15
|
} & TitleProps['slots'];
|
|
14
16
|
}
|
|
15
|
-
export declare const LoginForm:
|
|
16
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & LoginFormProps): import("preact/compat").JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
17
|
+
export declare const LoginForm: Container<LoginFormProps>;
|
|
19
18
|
//# sourceMappingURL=LoginForm.d.ts.map
|
package/containers/LoginForm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as r,jsxs as d,Fragment as Y}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/errors.js";import{VComponent as W,classes as Z,Slot as P}from"@dropins/tools/lib.js";import{events as H}from"@dropins/tools/event-bus.js";import{W as ee,a as te,g as re}from"../chunks/ConditionalWrapper.js";import{n as z,g as j}from"../chunks/values.js";import{i as ie,s as oe,g as ne}from"../chunks/setGuestEmailOnCart.js";import{Field as ae,Input as le,Skeleton as se,SkeletonRow as q}from"@dropins/tools/components.js";import{useText as I}from"@dropins/tools/i18n.js";/* empty css */import"../chunks/TermsAndConditions.js";/* empty css *//* empty css *//* empty css */import{useState as f,useRef as ce,useCallback as g,useEffect as T,useMemo as x}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const me={EMAIL:/^[a-z0-9,!#$%&'*+/=?^_`{|}~-]+(\.[a-z0-9,!#$%&'*+/=?^_`{|}~-]+)*@([a-z0-9-]+\.)+[a-z]{2,}$/i},V=a=>me.EMAIL.test(a),ue=({value:a,error:n,hint:c,onChange:u,onBlur:m,onInvalid:s})=>{const l=I({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return r(ae,{error:n,hint:c,children:r(le,{"aria-label":l.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:l.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",placeholder:l.LoginFormPlaceholder,required:!0,type:"email",value:a,onBlur:m,onChange:u,onInvalid:s})})},de=({onClick:a})=>{const n=I({account:"Checkout.LoginForm.account",signIn:"Checkout.LoginForm.signIn"});return d("div",{className:"checkout-login-form__sign-in",children:[n.account,r("a",{className:"checkout-login-form__link","data-testid":"sign-in-link",href:"#",rel:"noreferrer",target:"_blank",onClick:c=>{c.preventDefault(),a(c)},children:n.signIn})]})},he=()=>d(se,{"data-testid":"login-form-skeleton",children:[r(q,{fullWidth:!0,variant:"heading"}),r(q,{fullWidth:!0,size:"medium"})]}),ge=({className:a,customer:n,email:c,error:u,headingContent:m,hint:s,name:l,onEmailBlur:k,onEmailChange:N,onEmailInvalid:A,title:L,...y})=>d("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[d("div",{className:"checkout-login-form__heading",children:[L&&r(W,{className:"checkout-login-form__title",node:L}),m&&r(W,{className:"checkout-login-form__heading-label",node:m})]}),n?d("div",{className:"checkout-login-form__customer-details",children:[r("div",{className:"checkout-login-form__customer-name",children:`${n.firstName} ${n.lastName}`}),r("div",{className:"checkout-login-form__customer-email",children:n.email})]}):r("div",{className:"checkout-login-form__content",children:d("form",{...y,noValidate:!0,className:Z(["dropin-login-form__form",a]),name:l,children:[r("button",{disabled:!0,"aria-hidden":"true",style:"display: none",type:"submit"}),r(ue,{error:u,hint:s,value:c,onBlur:k,onChange:N,onInvalid:A})]})})]}),fe=ee(ge,he),Ee=({onClick:a})=>{const n=I({switch:"Checkout.LoginForm.switch",signOut:"Checkout.LoginForm.signOut"});return d("p",{className:"checkout-login-form__sign-out",children:[n.switch,r("a",{className:"checkout-login-form__link",href:"#",rel:"noreferrer",target:"_blank",onClick:c=>{c.preventDefault(),a==null||a(c)},children:n.signOut})]})},ke=1e3,De=({displayHeadingContent:a=!0,displayTitle:n=!0,initialData:c,onSignInClick:u,onSignOutClick:m,slots:s,active:l=!0,autoSync:k=!0,...N})=>{const[A,L]=f(null),[y,$]=f(""),[O,p]=f(""),[M,R]=f(!1),[B,v]=f(!0),[U,D]=f(!1),h=ce(null),o=I({AlreadyHaveAccountHint:"Checkout.LoginForm.emailExists.alreadyHaveAccount",FasterCheckoutHint:"Checkout.LoginForm.emailExists.forFasterCheckout",InvalidEmailError:"Checkout.LoginForm.invalidEmailError",MissingEmailError:"Checkout.LoginForm.missingEmailError",SignInLabel:"Checkout.LoginForm.emailExists.signInButton",Title:"Checkout.LoginForm.title"}),F=g(e=>{!V(e)||e===te()||(ie(e).then(t=>{v(t)}).catch(t=>{console.error(t),v(!0)}),k&&oe(e).catch(t=>{console.error("Error setting guest email on cart:",t)}))},[k]),G=g(e=>{const i=e.target.value;$(i),v(!0),p(""),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{F(i),z({email:i}),h.current=null},ke)},[F]),S=g(e=>{const t=e.target,i=t.value.trim(),b=V(i);let C="";i===""?C=o.MissingEmailError:b||(C=o.InvalidEmailError),p(C),t.setCustomValidity(C),b&&h.current&&(clearTimeout(h.current),h.current=null,F(i),z({email:i}))},[o.InvalidEmailError,o.MissingEmailError,F]),J=g(e=>{const b=e.target.validity.valueMissing?o.MissingEmailError:o.InvalidEmailError;p(b)},[o.MissingEmailError,o.InvalidEmailError]),_=g(()=>{const e=j("email")??"",t=V(e);u==null||u(t?e:"")},[u]),w=g(()=>{m==null||m()},[m]),E=g(e=>{const t=j("email")??"",i=(e==null?void 0:e.email)??"";i!==t&&($(i),p(""),v(!0),z({email:i}))},[]);T(()=>{if(!l)return;const e=H.on("authenticated",t=>{R(t),ne().then(i=>{L(i)}).catch(console.error)},{eager:!0});return()=>{e==null||e.off()}},[l]),T(()=>{if(!l)return;const e=re();if(e){D(!0),E(e);return}const t=H.on("checkout/initialized",i=>{D(!0),E(i)},{eager:!0});return()=>{t==null||t.off()}},[l,E]),T(()=>{if(!l)return;const e=H.on("checkout/updated",E,{eager:!1});return()=>{e==null||e.off()}},[l,E]);const K=x(()=>{if(n)return r(P,{name:"checkout-login-form-title",slot:s==null?void 0:s.Title,children:r("h2",{children:o.Title})})},[n,s,o.Title]),Q=x(()=>{if(a)return r(P,{context:{authenticated:M},name:"checkout-login-form-heading-label",slot:s==null?void 0:s.Heading,children:M?r(Ee,{onClick:w}):r(de,{onClick:_})})},[a,M,s,_,w]),X=x(()=>B?"":d(Y,{children:[o.AlreadyHaveAccountHint," ",r("a",{href:"#",onClick:_,children:o.SignInLabel})," ",o.FasterCheckoutHint]}),[B,o.AlreadyHaveAccountHint,o.SignInLabel,o.FasterCheckoutHint,_]);return r(fe,{...N,customer:A,email:y,error:O,headingContent:Q,hint:X,initialized:U,title:K,visible:l,onEmailBlur:S,onEmailChange:G,onEmailInvalid:J})};export{De as LoginForm,De as default};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AlertBannerProps } from '@dropins/tools/types/elsie/src/components';
|
|
2
|
+
import { Container } from '@dropins/tools/types/elsie/src/lib/types';
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export interface MergedCartBannerProps extends AlertBannerProps {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const MergedCartBanner: Container<MergedCartBannerProps>;
|
|
7
8
|
//# sourceMappingURL=MergedCartBanner.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as g,Icon as p}from"@dropins/tools/components.js";import{c as h}from"../chunks/classes.js";import{events as I}from"@dropins/tools/event-bus.js";import{useState as B,useCallback as M,useEffect as v}from"@dropins/tools/preact-hooks.js";import*as c from"@dropins/tools/preact-compat.js";import{useText as w,Text as x}from"@dropins/tools/i18n.js";const H=r=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),D=({className:r,initialData:V,active:n=!0,...C})=>{const[s,o]=B(0),a=w({mergedCartBannerItems:t(x,{fields:{count:s},id:"Checkout.MergedCartBanner.items",plural:s})}),u=()=>{o(0)},l=M(e=>{var i;const m=(i=e==null?void 0:e.oldCartItems)==null?void 0:i.reduce((d,f)=>d+f.quantity,0);m>0&&o(m)},[]);return v(()=>{if(!n)return;const e=I.on("cart/merged",l,{eager:!0});return()=>{e==null||e.off()}},[n,l]),!n||!s?null:t(g,{...C,"aria-label":a.mergedCartBannerItems,className:h(["checkout__banner",r]),"data-testid":"merged-cart-banner",icon:t(p,{source:H}),message:t("span",{children:a.mergedCartBannerItems}),variant:"neutral",onDismiss:u})};export{D as MergedCartBanner,D as default};
|
|
@@ -8,6 +8,7 @@ export type UpdateProductsFromCart = Array<{
|
|
|
8
8
|
export interface OutOfStockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'icon'> {
|
|
9
9
|
onCartProductsUpdate?: (items: UpdateProductsFromCart) => void;
|
|
10
10
|
routeCart?: () => string;
|
|
11
|
+
active?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare const OutOfStock: Container<OutOfStockProps>;
|
|
13
14
|
//# sourceMappingURL=OutOfStock.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './OutOfStock';
|
|
18
18
|
export { OutOfStock as default } from './OutOfStock';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/containers/OutOfStock.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as n,jsx as
|
|
3
|
+
import{jsxs as n,jsx as o}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Card as l,Icon as h,Image as O}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{classes as d}from"@dropins/tools/lib.js";import{S as p}from"../chunks/OrderError.js";import{useText as S}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{events as _}from"@dropins/tools/event-bus.js";import{useState as g,useCallback as v,useEffect as N}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";const w=({className:r,items:u,onRemoveOutOfStock:s,routeCart:t,...m})=>{const i=S({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return n(l,{className:d(["checkout-out-of-stock",r]),"data-testid":"checkout-out-of-stock",variant:"secondary",...m,children:[n("h4",{className:"checkout-out-of-stock__title",children:[o(h,{size:"16",source:p,stroke:"1"}),i.title]}),o("p",{className:"checkout-out-of-stock__message",children:i.message}),o("ol",{className:"checkout-out-of-stock__items",children:u.map(a=>o("li",{className:"checkout-out-of-stock__item","data-testid":"out-of-stock-item",children:o(O,{alt:a.image.alt,height:"100",loading:"eager",params:{width:100},src:a.image.src,width:"100"})},a.sku))}),n("div",{className:"checkout-out-of-stock__actions",children:[t&&o("a",{className:"checkout-out-of-stock__action","data-testid":"review-cart",href:t,children:i.reviewCart}),s&&o("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:s,children:i.removeOutOfStock})]})]})},A=({onCartProductsUpdate:r,routeCart:u,active:s=!0})=>{const[t,m]=g([]),i=v(()=>{if(!r)return;const e=t.filter(c=>c.outOfStock).map(c=>({uid:c.uid,quantity:0}));r(e)},[t,r]);if(N(()=>{if(!s)return;const e=_.on("cart/data",c=>{const k=(c==null?void 0:c.items)||[];m(k.filter(f=>f.outOfStock||f.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[s]),!s||t.length===0)return null;const a=!t.some(e=>e.insufficientQuantity);return o(w,{items:t,routeCart:u==null?void 0:u(),onRemoveOutOfStock:a?i:void 0})};export{A as OutOfStock,A as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { UIComponentType } from '../../types/ComponentTypes';
|
|
1
2
|
import { TitleProps } from '../../types/TitleProps';
|
|
2
|
-
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
4
|
import { HTMLAttributes } from 'preact/compat';
|
|
4
|
-
import { UIComponentType } from '../../types/ComponentTypes';
|
|
5
5
|
|
|
6
6
|
export interface PaymentMethodRenderCtx {
|
|
7
7
|
cartId: string;
|
|
@@ -11,36 +11,19 @@ export interface PaymentMethodConfig {
|
|
|
11
11
|
displayLabel?: boolean;
|
|
12
12
|
enabled?: boolean;
|
|
13
13
|
icon?: string;
|
|
14
|
-
|
|
14
|
+
autoSync?: boolean;
|
|
15
15
|
render?: SlotProps<PaymentMethodRenderCtx>;
|
|
16
16
|
}
|
|
17
17
|
export interface PaymentMethodsSlot {
|
|
18
18
|
[code: string]: PaymentMethodConfig;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated This property is deprecated and will be removed in future versions.
|
|
22
|
-
*/
|
|
23
|
-
export interface PaymentMethodsHandlerSlot {
|
|
24
|
-
[code: string]: PaymentMethodConfig['render'];
|
|
25
|
-
}
|
|
26
20
|
export interface PaymentMethodsProps extends HTMLAttributes<HTMLDivElement>, TitleProps {
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated This property is deprecated and will be removed in future versions.
|
|
29
|
-
*/
|
|
30
|
-
setOnChange?: {
|
|
31
|
-
[key: string]: boolean;
|
|
32
|
-
};
|
|
33
21
|
slots?: {
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated This property is deprecated and will be removed in future versions, use Methods instead.
|
|
36
|
-
*/
|
|
37
|
-
Handlers?: PaymentMethodsHandlerSlot;
|
|
38
22
|
Methods?: PaymentMethodsSlot;
|
|
39
23
|
} & TitleProps['slots'];
|
|
40
24
|
UIComponentType?: UIComponentType;
|
|
25
|
+
active?: boolean;
|
|
26
|
+
autoSync?: boolean;
|
|
41
27
|
}
|
|
42
|
-
export declare const PaymentMethods:
|
|
43
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & PaymentMethodsProps): import("preact/compat").JSX.Element;
|
|
44
|
-
displayName: string;
|
|
45
|
-
};
|
|
28
|
+
export declare const PaymentMethods: Container<PaymentMethodsProps>;
|
|
46
29
|
//# sourceMappingURL=PaymentMethods.d.ts.map
|