@dropins/storefront-checkout 1.4.0-beta1 → 1.4.0-beta2
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/__generated__/types.d.ts +12644 -0
- 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/fixtures.d.ts +2 -2
- 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/index.d.ts +15 -15
- package/api/index.d.ts +1 -0
- package/api/initialize/index.d.ts +15 -15
- package/api/initialize/initialize.d.ts +3 -3
- 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/{lib/debounce.d.ts → api/subscribeEmailToNewsletter/graphql/subscribeEmailToNewsletter.graphql.d.ts} +3 -15
- package/{hooks → api/subscribeEmailToNewsletter}/index.d.ts +1 -2
- package/api/subscribeEmailToNewsletter/subscribeEmailToNewsletter.d.ts +4 -0
- package/api/synchronizeCheckout/synchronizeCheckout.d.ts +1 -1
- package/api.js +12 -6
- package/chunks/ConditionalWrapper.js +3 -0
- package/chunks/IsBillToShippingSignal.js +14 -0
- package/chunks/SelectedPaymentMethodSignal.js +3 -0
- package/chunks/SelectedShippingMethodSignal.js +3 -0
- package/chunks/ServerErrorSignal.js +3 -0
- package/chunks/TermsAndConditions.js +2 -2
- 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/subscription-email-statuses.js +3 -0
- package/chunks/synchronizeCheckout.js +5 -5
- 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/{hocs → 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/Newsletter/Newsletter.d.ts +2 -1
- package/components/OutOfStock/index.d.ts +15 -15
- package/components/PaymentMethods/PaymentMethods.d.ts +5 -6
- 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 +5 -3
- package/components/TermsAndConditions/TermsAndConditions.d.ts +2 -2
- package/components/index.d.ts +1 -0
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +3 -20
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/EstimateShipping/index.d.ts +15 -15
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm/LoginForm.d.ts +2 -5
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +3 -5
- package/containers/MergedCartBanner.js +1 -1
- package/containers/Newsletter/Newsletter.d.ts +1 -1
- package/containers/Newsletter.js +1 -1
- package/containers/OutOfStock/OutOfStock.d.ts +1 -1
- package/containers/OutOfStock/index.d.ts +15 -15
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods/PaymentMethods.d.ts +3 -6
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +4 -6
- package/containers/PlaceOrder/index.d.ts +15 -15
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError/ServerError.d.ts +1 -1
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods/ShippingMethods.d.ts +4 -6
- package/containers/ShippingMethods/utils/emitShippingEstimateEvent.d.ts +1 -1
- package/containers/ShippingMethods.js +1 -1
- package/containers/TermsAndConditions/TermsAndConditions.d.ts +1 -1
- package/containers/TermsAndConditions.js +1 -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/store-config.d.ts +1 -3
- package/data/models/subscription-email-statuses.d.ts +24 -0
- package/lib/dispatchApiCall.d.ts +6 -22
- package/lib/enqueueRequest.d.ts +11 -24
- package/lib/index.d.ts +0 -2
- package/lib/network-error.d.ts +15 -15
- package/lib/preact.d.ts +1 -1
- 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/render.d.ts +1 -1
- package/render.js +4 -4
- package/signals/ShippingEstimateSignal.d.ts +6 -5
- package/signals/index.d.ts +0 -1
- package/tests/constants.d.ts +15 -15
- package/tests/integration/utils/index.d.ts +15 -15
- 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/types/TitleProps.d.ts +1 -1
- package/chunks/ShippingEstimateSignal.js +0 -14
- package/chunks/errors.js +0 -3
- package/chunks/store-config.js +0 -3
- package/chunks/withConditionalRendering.js +0 -3
- package/chunks/withSkeleton.js +0 -3
- package/hocs/withConditionalRendering.d.ts +0 -13
- package/hocs/withSkeleton.d.ts +0 -8
- 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/fetch-error.d.ts +0 -23
- package/signals/CartSignal.d.ts +0 -7
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent } from 'preact';
|
|
1
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
3
|
|
|
3
4
|
export interface BillToShippingAddressProps extends Omit<HTMLAttributes<HTMLInputElement>, 'loading' | 'disabled'> {
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const BillToShippingAddress:
|
|
7
|
+
export declare const BillToShippingAddress: FunctionComponent<BillToShippingAddressProps & import('../ConditionalWrapper/ConditionalWrapper').ConditionalProps>;
|
|
7
8
|
//# sourceMappingURL=BillToShippingAddress.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 './BillToShippingAddress';
|
|
18
18
|
export * from './BillToShippingAddressSkeleton';
|
|
19
19
|
export { BillToShippingAddress as default } from './BillToShippingAddress';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent } from 'preact';
|
|
2
|
+
|
|
3
|
+
export interface ConditionalProps {
|
|
4
|
+
isInitialized?: boolean;
|
|
5
|
+
isVisible?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function WithConditionals<P extends object>(Component: FunctionComponent<P>, Skeleton: FunctionComponent): FunctionComponent<P & ConditionalProps>;
|
|
8
|
+
//# sourceMappingURL=ConditionalWrapper.d.ts.map
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export * from './
|
|
18
|
-
export
|
|
17
|
+
export * from './ConditionalWrapper';
|
|
18
|
+
export { WithConditionals as default } from './ConditionalWrapper';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,11 +2,11 @@ import { FunctionComponent, VNode } from 'preact';
|
|
|
2
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
3
3
|
|
|
4
4
|
export interface EstimateShippingProps {
|
|
5
|
-
|
|
5
|
+
label: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
6
6
|
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
7
7
|
priceExclTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
8
8
|
taxExcluded?: boolean;
|
|
9
9
|
taxIncluded?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const EstimateShipping: FunctionComponent<EstimateShippingProps>;
|
|
11
|
+
export declare const EstimateShipping: FunctionComponent<EstimateShippingProps & import('../ConditionalWrapper').ConditionalProps>;
|
|
12
12
|
//# 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
|
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,6 +1,7 @@
|
|
|
1
|
+
import { FunctionComponent } from 'preact';
|
|
1
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
3
|
|
|
3
4
|
export interface NewsletterProps extends HTMLAttributes<HTMLInputElement> {
|
|
4
5
|
}
|
|
5
|
-
export declare const Newsletter:
|
|
6
|
+
export declare const Newsletter: FunctionComponent<NewsletterProps & import('../ConditionalWrapper').ConditionalProps>;
|
|
6
7
|
//# sourceMappingURL=Newsletter.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
|
-
initializing?: boolean;
|
|
12
|
-
loading?: boolean;
|
|
10
|
+
isLoading?: boolean;
|
|
13
11
|
onChange?: (value: string) => void;
|
|
14
12
|
options?: ExtendedPaymentMethod[];
|
|
15
13
|
paymentMethodContent?: VNode;
|
|
16
14
|
selection?: string;
|
|
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 { VNode } from 'preact';
|
|
2
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
3
3
|
import { HTMLAttributes } from 'preact/compat';
|
|
4
|
+
import { UIComponentType } from '../../types/ComponentTypes';
|
|
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
10
|
selection?: ShippingMethod;
|
|
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,6 +15,7 @@
|
|
|
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';
|
|
@@ -1,24 +1,7 @@
|
|
|
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 '../../../@adobe-commerce/elsie/src/lib';
|
|
2
|
+
|
|
17
3
|
export interface BillToShippingAddressProps {
|
|
18
4
|
onChange?: (checked: boolean) => void;
|
|
19
5
|
}
|
|
20
|
-
export declare const BillToShippingAddress:
|
|
21
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & BillToShippingAddressProps): import("preact").JSX.Element;
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
6
|
+
export declare const BillToShippingAddress: Container<BillToShippingAddressProps>;
|
|
24
7
|
//# 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 n}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/subscription-email-statuses.js";import"@dropins/tools/lib.js";import{i as a,h as S}from"../chunks/IsBillToShippingSignal.js";import{events as u}from"@dropins/tools/event-bus.js";import{s as T}from"../chunks/setBillingAddress.js";/* empty css */import{Skeleton as x,SkeletonRow as v,Checkbox as _}from"@dropins/tools/components.js";import{W as z}from"../chunks/ConditionalWrapper.js";import{c as I}from"../chunks/classes.js";import{useText as V}from"@dropins/tools/i18n.js";import"../chunks/SelectedPaymentMethodSignal.js";import"../chunks/SelectedShippingMethodSignal.js";import"../chunks/ServerErrorSignal.js";import{useState as h,useRef as f,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 N=()=>n(x,{className:"bill-to-shipping-address__skeleton","data-testid":"bill-to-shipping-skeleton",children:n(v,{size:"small",variant:"row"})}),w=({className:s,checked:e,disabled:t,onChange:c})=>{const l=V({title:"Checkout.BillToShippingAddress.title"});return n("div",{className:"checkout-bill-to-shipping-address",children:n(_,{checked:e,className:I(["checkout-bill-to-shipping-address__checkbox",s]),"data-testid":"bill-to-shipping-checkbox",disabled:t,label:l.title,name:"checkout-bill-to-shipping-address__checkbox",onChange:c})})},D=z(w,N);function E(s){var l;const e=(l=s.shippingAddresses)==null?void 0:l[0],t=!!s.billingAddress;return(e==null?void 0:e.sameAsBilling)??!t}function P(s){var t;return!!((t=s.shippingAddresses)==null?void 0:t[0])}const C=({onChange:s})=>{const[e,t]=h(!0),[c,l]=h(!1),d=f(!1),m=f(!1),b=a.value,A=S.value,B=g(i=>{const r=i.target.checked;a.value=r,s==null||s(r),m.current&&r&&T({sameAsShipping:!0}).catch(console.error)},[s]),p=g(i=>{const o=!!i&&!i.isEmpty&&!i.isVirtual;if(t(o),!o){a.value=!1,d.current=!1;return}if(m.current=P(i),!d.current){const r=E(i);a.value=r,d.current=!0,s==null||s(r)}},[s]);return k(()=>{const i=u.on("checkout/initialized",o=>{l(!0),p(o)},{eager:!0});return()=>{i==null||i.off()}},[p]),k(()=>{const i=u.on("checkout/updated",p,{eager:!1});return()=>{i==null||i.off()}},[p]),n(D,{checked:b,disabled:A,isInitialized:c,isVisible:e,onChange:B})};export{C as BillToShippingAddress,C as default};
|
|
@@ -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 S}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as z,SkeletonRow as w,Price as h}from"@dropins/tools/components.js";import{W as B}from"../chunks/ConditionalWrapper.js";import"../chunks/TermsAndConditions.js";import{VComponent as k,classes as I}from"@dropins/tools/lib.js";import{Text as C,useText as G}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css *//* empty css */import{s as P,T as D}from"../chunks/subscription-email-statuses.js";import{events as d}from"@dropins/tools/event-bus.js";import{useState as b,useCallback as X,useEffect as x}from"@dropins/tools/preact-hooks.js";const j=()=>i(z,{"data-testid":"estimate-shipping-skeleton",children:i(w,{size:"xsmall"})}),A=({label:o,price:p,priceExclTax:e,taxExcluded:n=!1,taxIncluded:l=!1})=>S("div",{className:"checkout-estimate-shipping","data-testid":"estimate-shipping",children:[i(k,{className:"checkout-estimate-shipping__label",node:o}),i(k,{className:"checkout-estimate-shipping__price",node:p}),l&&i("span",{className:I(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included",children:i(C,{id:"Checkout.EstimateShipping.withTaxes"})}),n&&S("span",{className:I(["checkout-estimate-shipping__caption"]),"data-testid":"shipping-tax-included-excluded",children:[e," ",i(C,{id:"Checkout.EstimateShipping.withoutTaxes"})]})]}),U=B(A,j),ie=()=>{var T;const[o,p]=b(!1),[e,n]=b(null),l=!o||o&&e!==null,u=(e==null?void 0:e.amount.value)===0,g=(T=P.config)==null?void 0:T.shoppingCartDisplaySetting.shipping,y=g===D.INCLUDING_EXCLUDING_TAX,f=g===D.INCLUDING_TAX,c=G({freeShipping:"Checkout.EstimateShipping.freeShipping",taxToBeDetermined:"Checkout.EstimateShipping.taxToBeDetermined",label:"Checkout.EstimateShipping.label",estimated:"Checkout.EstimateShipping.estimated"}),r=X(t=>{var E;if(!t||t.isEmpty){n(null);return}const s=(E=t.shippingAddresses)==null?void 0:E[0],a=s==null?void 0:s.selectedShippingMethod;if(!a){n(null);return}const{amount:v,amountExclTax:L,amountInclTax:M}=a;n({estimated:!1,amount:v,amountExclTax:L,amountInclTax:M}),p(!0)},[]);x(()=>{const t=d.on("shipping/estimate",m=>{let s=null;if(m.shippingMethod){const a=m.shippingMethod;s={estimated:!0,amount:a.amount,amountExclTax:a.amountExclTax,amountInclTax:a.amountInclTax}}n(s),p(!0)},{eager:!0});return()=>{t==null||t.off()}},[]),x(()=>{const t=d.on("checkout/initialized",r,{eager:!0});return()=>{t==null||t.off()}},[r]),x(()=>{const t=d.on("checkout/updated",r,{eager:!1});return()=>{t==null||t.off()}},[r]);const _=()=>u?i("span",{"data-testId":"free-shipping",children:c.freeShipping}):f&&(e!=null&&e.amountInclTax)?i(h,{amount:e.amountInclTax.value,currency:e.amountInclTax.currency,"data-testid":"shipping"}):i(h,{amount:e==null?void 0:e.amount.value,currency:e==null?void 0:e.amount.currency,"data-testid":"shipping"}),N=()=>e!=null&&e.amountExclTax?i(h,{amount:e.amountExclTax.value,currency:e.amountExclTax.currency,"data-testid":"shipping-excluding-tax"}):i("span",{children:c.taxToBeDetermined});return i(U,{isInitialized:o,isVisible:l,label:(()=>{const t=e!=null&&e.estimated?c.estimated:c.label;return i("span",{"data-testid":"estimate-shipping-label",children:t})})(),price:_(),priceExclTax:N(),taxExcluded:y&&!u,taxIncluded:f&&!u})};export{ie as EstimateShipping,ie as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TitleProps } from '../../types/TitleProps';
|
|
2
|
-
import { SlotProps } from '
|
|
2
|
+
import { Container, SlotProps } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { HTMLAttributes } from 'preact/compat';
|
|
4
4
|
|
|
5
5
|
export interface LoginFormProps extends HTMLAttributes<HTMLFormElement>, TitleProps {
|
|
@@ -12,8 +12,5 @@ export interface LoginFormProps extends HTMLAttributes<HTMLFormElement>, TitlePr
|
|
|
12
12
|
}>;
|
|
13
13
|
} & TitleProps['slots'];
|
|
14
14
|
}
|
|
15
|
-
export declare const LoginForm:
|
|
16
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & LoginFormProps): import("preact/compat").JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
15
|
+
export declare const LoginForm: Container<LoginFormProps>;
|
|
19
16
|
//# 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 t,jsxs as
|
|
3
|
+
import{jsx as t,jsxs as m,Fragment as te}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/subscription-email-statuses.js";import{VComponent as S,classes as re,Slot as j}from"@dropins/tools/lib.js";import"../chunks/IsBillToShippingSignal.js";import{events as z}from"@dropins/tools/event-bus.js";import{i as ie,s as oe,g as ne}from"../chunks/setGuestEmailOnCart.js";import{Field as ae,Input as le,Skeleton as ce,SkeletonRow as q}from"@dropins/tools/components.js";import{useText as w,Text as N}from"@dropins/tools/i18n.js";/* empty css */import{W as se}from"../chunks/ConditionalWrapper.js";import"../chunks/TermsAndConditions.js";/* empty css *//* empty css *//* empty css *//* empty css */import{useState as h,useRef as I,useCallback as g,useEffect as V,useMemo as D}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},$=n=>me.EMAIL.test(n),ue=({value:n,error:i,hint:c,onChange:s,onBlur:f,onInvalid:l})=>{const u=w({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return t(ae,{error:i,hint:c,children:t(le,{"aria-label":u.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:u.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",placeholder:u.LoginFormPlaceholder,required:!0,type:"email",value:n,onBlur:f,onChange:s,onInvalid:l})})},de=({onClick:n})=>m("div",{className:"checkout-login-form__sign-in",children:[t(N,{id:"Checkout.LoginForm.account"}),t("a",{className:"checkout-login-form__link","data-testid":"sign-in-link",href:"#",rel:"noreferrer",target:"_blank",onClick:i=>{i.preventDefault(),n(i)},children:t(N,{id:"Checkout.LoginForm.signIn"})})]}),he=()=>m(ce,{"data-testid":"login-form-skeleton",children:[t(q,{fullWidth:!0,variant:"heading"}),t(q,{fullWidth:!0,size:"medium"})]}),ge=({className:n,customer:i,email:c,error:s,headingContent:f,hint:l,name:u,onEmailBlur:A,onEmailChange:y,onEmailInvalid:M,title:E,...H})=>m("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[m("div",{className:"checkout-login-form__heading",children:[E&&t(S,{className:"checkout-login-form__title",node:E}),f&&t(S,{className:"checkout-login-form__heading-label",node:f})]}),i?m("div",{className:"checkout-login-form__customer-details",children:[t("div",{className:"checkout-login-form__customer-name",children:`${i.firstName} ${i.lastName}`}),t("div",{className:"checkout-login-form__customer-email",children:i.email})]}):t("div",{className:"checkout-login-form__content",children:m("form",{...H,noValidate:!0,className:re(["dropin-login-form__form",n]),name:u,children:[t("button",{disabled:!0,"aria-hidden":"true",style:"display: none",type:"submit"}),t(ue,{error:s,hint:l,value:c,onBlur:A,onChange:y,onInvalid:M})]})})]}),fe=se(ge,he),Ee=({onClick:n})=>m("p",{className:"checkout-login-form__sign-out",children:[t(N,{id:"Checkout.LoginForm.switch"}),t("a",{className:"checkout-login-form__link",href:"#",rel:"noreferrer",target:"_blank",onClick:i=>{i.preventDefault(),n==null||n(i)},children:t(N,{id:"Checkout.LoginForm.signOut"})})]}),ve=1e3,Pe=({displayTitle:n=!0,displayHeadingContent:i=!0,onSignInClick:c,onSignOutClick:s,initialData:f,slots:l,...u})=>{const[A,y]=h(null),[M,E]=h(""),[H,v]=h(""),[T,R]=h(!1),[B,k]=h(!0),[G,J]=h(!1),[K,O]=h(!0),P=I(!1),x=I(""),L=I(""),d=I(null),r=w({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"}),p=g(e=>{!$(e)||e===x.current||Promise.all([ie(e),oe(e)]).then(([o])=>{k(o),x.current=e}).catch(o=>{console.error(o),k(!0)})},[]),Q=g(e=>{const a=e.target.value;E(a),k(!0),v(""),L.current=a,d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{p(a),d.current=null},ve)},[p]),U=g(e=>{const o=e.target,a=o.value.trim(),b=$(a);let C="";a===""?C=r.MissingEmailError:b||(C=r.InvalidEmailError),v(C),o.setCustomValidity(C),b&&d.current&&(clearTimeout(d.current),d.current=null,p(a))},[r.InvalidEmailError,r.MissingEmailError,p]),X=g(e=>{const b=e.target.validity.valueMissing?r.MissingEmailError:r.InvalidEmailError;v(b)},[r.MissingEmailError,r.InvalidEmailError]),F=g(()=>{const e=L.current;c==null||c($(e)?e:"")},[c]),W=g(()=>{L.current="",s==null||s()},[s]),_=g(e=>{const o=!!e&&!e.isEmpty;if(O(o),!o||P.current)return;const a=e.email??"";E(a),v(""),k(!0),P.current=!0,L.current=a,x.current=a},[]);V(()=>{const e=z.on("authenticated",o=>{R(o),ne().then(a=>{y(a)}).catch(console.error)},{eager:!0});return()=>{e==null||e.off()}},[]),V(()=>{const e=z.on("checkout/initialized",o=>{J(!0),_(o)},{eager:!0});return()=>{e==null||e.off()}},[_]),V(()=>{const e=z.on("checkout/updated",_,{eager:!1});return()=>{e==null||e.off()}},[_]);const Y=D(()=>{if(n)return t(j,{name:"checkout-login-form-title",slot:l==null?void 0:l.Title,children:t("h2",{children:r.Title})})},[n,l,r.Title]),Z=D(()=>{if(i)return t(j,{context:{authenticated:T},name:"checkout-login-form-heading-label",slot:l==null?void 0:l.Heading,children:T?t(Ee,{onClick:W}):t(de,{onClick:F})})},[i,T,l,F,W]),ee=D(()=>B?"":m(te,{children:[r.AlreadyHaveAccountHint," ",t("a",{href:"#",onClick:F,children:r.SignInLabel})," ",r.FasterCheckoutHint]}),[B,r.AlreadyHaveAccountHint,r.SignInLabel,r.FasterCheckoutHint,F]);return t(fe,{...u,customer:A,email:M,error:H,headingContent:Z,hint:ee,isInitialized:G,isVisible:K,title:Y,onEmailBlur:U,onEmailChange:Q,onEmailInvalid:X})};export{Pe as LoginForm,Pe as default};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { AlertBannerProps } from '
|
|
1
|
+
import { AlertBannerProps } from '../../../@adobe-commerce/elsie/src/components';
|
|
2
|
+
import { Container } from '../../../@adobe-commerce/elsie/src/lib/types';
|
|
2
3
|
|
|
3
|
-
export declare const MergedCartBanner:
|
|
4
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs').ConditionalProps & AlertBannerProps): import("preact").JSX.Element;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
4
|
+
export declare const MergedCartBanner: Container<AlertBannerProps>;
|
|
7
5
|
//# sourceMappingURL=MergedCartBanner.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as
|
|
3
|
+
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as u,Icon as g}from"@dropins/tools/components.js";import{c as p}from"../chunks/classes.js";import{events as I}from"@dropins/tools/event-bus.js";import{useState as h,useEffect as v}from"@dropins/tools/preact-hooks.js";import*as i from"@dropins/tools/preact-compat.js";import{useText as B,Text as w}from"@dropins/tools/i18n.js";const x=t=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},i.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"})),Z=({className:t,initialData:H,...c})=>{const[r,s]=h(0),a=B({mergedCartBannerItems:e(w,{fields:{count:r},id:"Checkout.MergedCartBanner.items",plural:r})}),C=()=>{s(0)};return v(()=>{const n=I.on("cart/merged",o=>{var m;const l=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((d,f)=>d+f.quantity,0);l>0&&s(l)});return()=>{n==null||n.off()}},[]),r?e(u,{...c,"aria-label":a.mergedCartBannerItems,className:p(["checkout__banner",t]),"data-testid":"merged-cart-banner",icon:e(g,{source:x}),message:e("span",{children:a.mergedCartBannerItems}),variant:"neutral",onDismiss:C}):null};export{Z as MergedCartBanner,Z as default};
|
package/containers/Newsletter.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as l}from"@dropins/tools/preact-jsx-runtime.js";import{W as S}from"../chunks/ConditionalWrapper.js";/* empty css */import{Skeleton as g,SkeletonRow as V,Checkbox as z}from"@dropins/tools/components.js";import{c as I}from"../chunks/classes.js";import{useText as _}from"@dropins/tools/i18n.js";import{s as C}from"../chunks/subscription-email-statuses.js";import"@dropins/tools/lib.js";import"../chunks/IsBillToShippingSignal.js";import{events as f}from"@dropins/tools/event-bus.js";import{i as r}from"../chunks/SelectedPaymentMethodSignal.js";import"../chunks/SelectedShippingMethodSignal.js";import"../chunks/ServerErrorSignal.js";import{useState as m,useCallback as E,useEffect as n}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const T=()=>l(g,{className:"checkout-newsletter-skeleton","data-testid":"checkout-newsletter-skeleton",children:l(V,{size:"small",variant:"row"})}),y=({className:c,checked:i,onChange:o})=>{const u=_({title:"Checkout.Newsletter.title"});return l("div",{className:"checkout-newsletter","data-testid":"checkout-newsletter",children:l(z,{checked:i,className:I(["checkout-newsletter__checkbox",c]),"data-testid":"checkout-newsletter-checkbox",label:u.title,name:"checkout-newsletter__checkbox",onChange:o})})},W=S(y,T),Y=({defaultChecked:c=!1,onChange:i,showForAuthenticatedUsers:o=!1})=>{var p;const[u,b]=m(!0),[h,w]=m(!1),[N,v]=m(!1),d=r.value,s=((p=C.config)==null?void 0:p.newsletterEnabled)===!1,k=!o&&h,x=async e=>{const t=e.target.checked;r.value=t,i==null||i(t)},a=E(e=>{const t=!!e&&!e.isEmpty;if(b(t),!t){r.value=!1;return}},[]);return n(()=>{if(s)return;const e=f.on("authenticated",t=>{w(t),t&&!o&&(r.value=!1)},{eager:!0});return()=>{e==null||e.off()}},[s,o]),n(()=>{if(s)return;const e=f.on("checkout/initialized",t=>{v(!0),a(t)},{eager:!0});return()=>{e==null||e.off()}},[s,a]),n(()=>{if(s)return;const e=f.on("checkout/updated",a,{eager:!1});return()=>{e==null||e.off()}},[s,a]),n(()=>{c&&!d&&(r.value=c)},[]),(s||k)&&(r.value=!1),l(W,{checked:d,isInitialized:N,isVisible:u&&!s&&!k,onChange:x})};export{Y as Newsletter,Y as default};
|