@dropins/storefront-checkout 0.1.0-alpha50 → 0.1.0-alpha52
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/authenticateCustomer/authenticateCustomer.d.ts +18 -0
- package/api/authenticateCustomer/index.d.ts +18 -0
- package/api/fragments.d.ts +19 -0
- package/api/getCart/graphql/getCart.graphql.d.ts +0 -1
- package/api/getCustomer/graphql/getCustomer.graphql.d.ts +16 -16
- package/api/graphql/CartAddressFragment.graphql.d.ts +19 -0
- package/api/graphql/CheckoutDataFragment.graphql.d.ts +18 -0
- package/api/graphql/CustomerFragment.graphql.d.ts +18 -0
- package/api/graphql/OrderAddressFragment.graphql.d.ts +18 -0
- package/api/graphql/OrderFragment.graphql.d.ts +19 -0
- package/api/graphql/OrderItemFragment.graphql.d.ts +6 -0
- package/api/index.d.ts +17 -18
- package/api/initialize/initialize.d.ts +5 -5
- package/api/initialize/listeners.d.ts +15 -15
- package/api/initializeCheckout/initializeCheckout.d.ts +2 -2
- package/api/placeOrder/fixtures.d.ts +19 -5
- package/api/placeOrder/graphql/placeOrder.graphql.d.ts +16 -16
- package/api/placeOrder/placeOrder.d.ts +1 -1
- package/api/resetCheckout/index.d.ts +0 -16
- package/api/resetCheckout/resetCheckout.d.ts +15 -15
- package/api/setGuestEmailOnCart/graphql/setGuestEmailOnCart.graphql.d.ts +15 -15
- package/api/setPaymentMethod/graphql/setPaymentMethod.graphql.d.ts +15 -15
- package/api/setShippingMethods/graphql/setShippingMethodsOnCart.graphql.d.ts +15 -15
- package/api/synchronizeCheckout/index.d.ts +18 -0
- package/api/synchronizeCheckout/synchronizeCheckout.d.ts +4 -0
- package/api.js +8 -6
- package/chunks/Heading.js +2 -0
- package/chunks/OrderError.js +2 -0
- package/chunks/ServerErrorSignal.js +3 -0
- package/chunks/classes.js +2 -0
- package/chunks/fetch-graphql.js +4 -2
- package/chunks/isEmailAvailable.js +9 -0
- package/chunks/placeOrder2.js +252 -120
- package/chunks/setBillingAddress.js +7 -5
- package/chunks/setGuestEmailOnCart.js +7 -11
- package/chunks/setPaymentMethod.js +7 -5
- package/chunks/setShippingMethods.js +7 -5
- package/chunks/store-config.js +3 -1
- package/chunks/synchronizeCheckout.js +27 -0
- package/chunks/withConditionalRendering.js +3 -1
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +2 -1
- package/components/OrderConfirmationHeader/OrderConfirmationHeader.d.ts +10 -0
- package/components/OrderConfirmationHeader/OrderConfirmationHeaderSkeleton.d.ts +4 -0
- package/components/OrderConfirmationHeader/index.d.ts +3 -0
- package/components/index.d.ts +1 -0
- package/containers/BillToShippingAddress.js +3 -1
- package/containers/ErrorBanner.js +2 -0
- package/containers/EstimateShipping.js +3 -1
- package/containers/LoginForm.js +3 -1
- package/containers/MergedCartBanner.js +2 -0
- package/containers/OrderConfirmationHeader/OrderConfirmationHeader.d.ts +18 -0
- package/containers/OrderConfirmationHeader/index.d.ts +3 -0
- package/containers/OrderConfirmationHeader.d.ts +3 -0
- package/containers/OrderConfirmationHeader.js +3 -0
- package/containers/OutOfStock.js +2 -0
- package/containers/PaymentMethods.js +3 -1
- package/containers/PlaceOrder.js +3 -1
- package/containers/ServerError/ServerError.d.ts +3 -3
- package/containers/ServerError.js +3 -1
- package/containers/ShippingMethods.js +3 -1
- package/containers/index.d.ts +1 -0
- package/data/models/cart.d.ts +1 -0
- package/data/models/customer.d.ts +18 -10
- package/data/models/order.d.ts +111 -42
- package/data/transforms/index.d.ts +1 -0
- package/data/transforms/transform-acdl.d.ts +0 -1
- package/data/transforms/transform-cart.d.ts +1 -1
- package/data/transforms/transform-customer-address-input.d.ts +5 -0
- package/data/transforms/transform-customer.d.ts +2 -9
- package/data/transforms/transform-order.d.ts +16 -3
- package/fragments.d.ts +1 -0
- package/fragments.js +126 -0
- package/i18n/en_US.json.d.ts +9 -0
- package/lib/state.d.ts +17 -16
- package/package.json +1 -1
- package/render.js +6 -4
- package/utils/convertCase/convertCase.d.ts +4 -0
- package/utils/convertCase/index.d.ts +18 -0
- package/utils/index.d.ts +1 -0
- package/api/getCheckoutData/getCheckoutData.d.ts +0 -18
- package/api/getCheckoutData/index.d.ts +0 -18
- package/api/redirect/index.d.ts +0 -18
- package/api/redirect/redirect.d.ts +0 -18
- package/api/resetCustomer/index.d.ts +0 -18
- package/api/resetCustomer/resetCustomer.d.ts +0 -18
- package/chunks/getCart.graphql.js +0 -122
- package/chunks/getCustomer.js +0 -34
- package/chunks/resetCustomer.js +0 -1
package/fragments.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api/fragments'
|
package/fragments.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
const e=`
|
|
4
|
+
fragment BILLING_CART_ADDRESS_FRAGMENT on BillingCartAddress {
|
|
5
|
+
id
|
|
6
|
+
city
|
|
7
|
+
country {
|
|
8
|
+
code
|
|
9
|
+
label
|
|
10
|
+
}
|
|
11
|
+
firstname
|
|
12
|
+
lastname
|
|
13
|
+
company
|
|
14
|
+
postcode
|
|
15
|
+
vat_id
|
|
16
|
+
region {
|
|
17
|
+
region_id
|
|
18
|
+
code
|
|
19
|
+
label
|
|
20
|
+
}
|
|
21
|
+
street
|
|
22
|
+
telephone
|
|
23
|
+
custom_attributes {
|
|
24
|
+
... on AttributeValue {
|
|
25
|
+
code
|
|
26
|
+
value
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`,t=`
|
|
31
|
+
fragment SHIPPING_CART_ADDRESS_FRAGMENT on ShippingCartAddress {
|
|
32
|
+
id
|
|
33
|
+
firstname
|
|
34
|
+
lastname
|
|
35
|
+
company
|
|
36
|
+
street
|
|
37
|
+
city
|
|
38
|
+
postcode
|
|
39
|
+
vat_id
|
|
40
|
+
region {
|
|
41
|
+
region_id
|
|
42
|
+
code
|
|
43
|
+
label
|
|
44
|
+
}
|
|
45
|
+
country {
|
|
46
|
+
code
|
|
47
|
+
label
|
|
48
|
+
}
|
|
49
|
+
telephone
|
|
50
|
+
custom_attributes {
|
|
51
|
+
... on AttributeValue {
|
|
52
|
+
code
|
|
53
|
+
value
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
available_shipping_methods {
|
|
57
|
+
amount {
|
|
58
|
+
currency
|
|
59
|
+
value
|
|
60
|
+
}
|
|
61
|
+
available
|
|
62
|
+
carrier_code
|
|
63
|
+
carrier_title
|
|
64
|
+
error_message
|
|
65
|
+
method_code
|
|
66
|
+
method_title
|
|
67
|
+
price_excl_tax {
|
|
68
|
+
value
|
|
69
|
+
currency
|
|
70
|
+
}
|
|
71
|
+
price_incl_tax {
|
|
72
|
+
value
|
|
73
|
+
currency
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
selected_shipping_method {
|
|
77
|
+
amount {
|
|
78
|
+
value
|
|
79
|
+
currency
|
|
80
|
+
}
|
|
81
|
+
carrier_code
|
|
82
|
+
carrier_title
|
|
83
|
+
method_code
|
|
84
|
+
method_title
|
|
85
|
+
price_excl_tax {
|
|
86
|
+
value
|
|
87
|
+
currency
|
|
88
|
+
}
|
|
89
|
+
price_incl_tax {
|
|
90
|
+
value
|
|
91
|
+
currency
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
same_as_billing
|
|
95
|
+
}
|
|
96
|
+
`,a=`
|
|
97
|
+
fragment CHECKOUT_DATA_FRAGMENT on Cart {
|
|
98
|
+
id
|
|
99
|
+
is_virtual
|
|
100
|
+
email
|
|
101
|
+
total_quantity
|
|
102
|
+
billing_address {
|
|
103
|
+
...BILLING_CART_ADDRESS_FRAGMENT
|
|
104
|
+
}
|
|
105
|
+
shipping_addresses {
|
|
106
|
+
...SHIPPING_CART_ADDRESS_FRAGMENT
|
|
107
|
+
}
|
|
108
|
+
available_payment_methods {
|
|
109
|
+
code
|
|
110
|
+
title
|
|
111
|
+
}
|
|
112
|
+
selected_payment_method {
|
|
113
|
+
code
|
|
114
|
+
title
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
${e}
|
|
119
|
+
${t}
|
|
120
|
+
`,_=`
|
|
121
|
+
fragment CUSTOMER_FRAGMENT on Customer {
|
|
122
|
+
firstname
|
|
123
|
+
lastname
|
|
124
|
+
email
|
|
125
|
+
}
|
|
126
|
+
`;export{a as CHECKOUT_DATA_FRAGMENT,_ as CUSTOMER_FRAGMENT};
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -71,6 +71,15 @@ declare const _default: {
|
|
|
71
71
|
"taxToBeDetermined": "TBD",
|
|
72
72
|
"withTaxes": "Including taxes",
|
|
73
73
|
"withoutTaxes": "Excluding taxes"
|
|
74
|
+
},
|
|
75
|
+
"OrderConfirmationHeader": {
|
|
76
|
+
"title": "{{name}}, thank you for your order!",
|
|
77
|
+
"defaultTitle": "Thank you for your order!",
|
|
78
|
+
"order": "ORDER #{{order}}",
|
|
79
|
+
"CreateAccount": {
|
|
80
|
+
"message": "Save your information for faster checkout next time.",
|
|
81
|
+
"button": "Create an account"
|
|
82
|
+
}
|
|
74
83
|
}
|
|
75
84
|
}
|
|
76
85
|
}
|
package/lib/state.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
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
|
type State = {
|
|
18
|
-
cartId: string | null;
|
|
19
18
|
authenticated: boolean;
|
|
19
|
+
cartId: string | null;
|
|
20
|
+
initialized: boolean;
|
|
20
21
|
};
|
|
21
22
|
export declare const state: State;
|
|
22
23
|
export {};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-checkout", "version": "0.1.0-
|
|
1
|
+
{"name": "@dropins/storefront-checkout", "version": "0.1.0-alpha52", "@dropins/tools": "~0.35.0"}
|
package/render.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.
|
|
4
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
(function(r,o){try{if(typeof document<"u"){const t=document.createElement("style"),n=o.styleId;for(const e in o.attributes)t.setAttribute(e,o.attributes[e]);t.setAttribute("data-dropin",n),t.appendChild(document.createTextNode(r));const a=document.querySelector('style[data-dropin="sdk"]');if(a)a.after(t);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(`.checkout-place-order{display:grid;padding-bottom:var(--spacing-big)}.checkout-place-order__button{align-self:flex-end;justify-self:flex-end}@media only screen and (min-width:320px) and (max-width: 768px){.checkout-place-order{background-color:var(--color-neutral-200);padding:var(--spacing-medium) var(--spacing-medium) var(--spacing-big) var(--spacing-medium)}.checkout-place-order__button{align-self:center;justify-self:stretch}}
|
|
4
|
+
.checkout-bill-to-shipping-address label{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);gap:0}
|
|
5
|
+
.checkout-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.checkout-estimate-shipping__label,.checkout-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-estimate-shipping__price{text-align:right}.checkout-estimate-shipping__label--bold,.checkout-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.checkout-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__shipping .dropin-skeleton{grid-template-columns:1fr}.checkout-login-form__heading{display:grid;grid-template-columns:1fr max-content;grid-auto-rows:max-content}.checkout-login-form__content{grid-auto-rows:max-content}.checkout-login-form__customer-details{display:grid;grid-auto-flow:row;gap:var(--spacing-xxsmall)}.checkout-login-form__customer-name{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-login-form__customer-email{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-login-form__title{grid-column-start:1;color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);justify-self:flex-end;margin-top:var(--spacing-xxsmall)}a.checkout-login-form__link{font:var(--type-body-2-strong-font);margin-left:var(--spacing-xxsmall)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-login-form__heading{grid-template-columns:repeat(1,1fr [col-start]);grid-template-rows:1fr}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:0;margin-bottom:var(--spacing-medium)}}.checkout-out-of-stock.dropin-card{border-color:var(--color-warning-500)}.checkout-out-of-stock .dropin-card__content{gap:var(--spacing-small);padding:var(--spacing-small)}.checkout-out-of-stock__title{color:var(--color-neutral-900);font:var(--type-body-2-strong-font);margin:0;display:flex;gap:var(--spacing-xxsmall);align-items:center;justify-content:left;text-align:center}.checkout-out-of-stock__message{color:var(--color-neutral-800);font:var(--type-body-2-default-font);margin:0}.checkout-out-of-stock__items{display:grid;grid-template-columns:repeat(5,100px);grid-gap:var(--spacing-small);list-style:none;padding:0;margin:0}.checkout-out-of-stock__item img{width:100%;height:auto}.checkout-out-of-stock__actions{display:flex;gap:var(--spacing-small);justify-content:flex-end}a.checkout-out-of-stock__action{font:var(--type-details-caption-1-font)}.checkout-out-of-stock__action{background:none;border:none;padding:0;cursor:pointer}.checkout-out-of-stock__action:hover{--textColor: var(--color-brand-700);text-decoration:solid underline var(--textColor);text-underline-offset:6px}.checkout-overlay-loader{align-items:center;background:var(--color-neutral-50);display:flex;height:100vh;justify-content:center;left:0;opacity:.5;position:fixed;top:0;width:100%;z-index:9999}.checkout-payment-methods__title{color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-payment-methods__wrapper{position:relative;display:grid}.checkout-payment-methods__methods{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-payment-methods__content{margin-top:var(--spacing-medium)}.checkout-payment-methods--full-width{grid-template-columns:1fr}.checkout-payment-methods--loading{opacity:.4;pointer-events:none}.checkout-payment-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.checkout__content [data-slot=PaymentMethods]:empty{display:none}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-payment-methods__methods{grid-template-columns:1fr}}.checkout-server-error{position:relative;text-align:center}.checkout-server-error__icon .error-icon{color:var(--color-alert-500)}.checkout-server-error a{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing)}.order-confirmation-header{text-align:center;padding:var(--spacing-xxbig)}.order-confirmation-header__icon{margin-bottom:var(--spacing-small)}.order-confirmation-header__title{color:var(--color-neutral-800);font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);margin:0}.order-confirmation-header__title:first-letter{text-transform:uppercase}.order-confirmation-header__order{color:var(--color-neutral-700);font:var(--type-details-overline-font);letter-spacing:var(--type-details-overline-letter-spacing);margin:var(--spacing-xxsmall) 0 0 0}.order-confirmation-header .success-icon{color:var(--color-positive-500)}.order-confirmation-create-account{gap:var(--spacing-small);margin-top:var(--spacing-large)}.order-confirmation-create-account__message{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-confirmation-create-account__button{margin:0 auto;text-align:center;display:inline-block}.checkout-shipping-methods__title{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-shipping-methods__content{position:relative;display:block}.checkout-shipping-methods__method{margin-bottom:var(--spacing-medium);width:fit-content;cursor:pointer;font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-shipping-methods__method:last-child{margin-bottom:0}.dropin-radio-button__label .dropin-price{color:var(--color-neutral-800);font-weight:400}.checkout-shipping-methods__options--loading{opacity:.4;pointer-events:none}.checkout-shipping-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}`,{styleId:"checkout"});
|
|
6
|
+
import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/store-config.js";import"./chunks/ServerErrorSignal.js";import{events as p}from"@dropins/tools/event-bus.js";import"./chunks/fetch-graphql.js";import{e as y}from"./chunks/synchronizeCheckout.js";import{UIProvider as g}from"@dropins/tools/components.js";import{useState as b,useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"./fragments.js";function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S=function(r){return E(r)&&!v(r)};function E(e){return!!e&&typeof e=="object"}function v(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||M(e)}var w=typeof Symbol=="function"&&Symbol.for,j=w?Symbol.for("react.element"):60103;function M(e){return e.$$typeof===j}function A(e){return Array.isArray(e)?[]:{}}function i(e,r){return r.clone!==!1&&r.isMergeableObject(e)?a(A(e),e,r):e}function P(e,r,t){return e.concat(r).map(function(o){return i(o,t)})}function T(e,r){if(!r.customMerge)return a;var t=r.customMerge(e);return typeof t=="function"?t:a}function C(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function l(e){return Object.keys(e).concat(C(e))}function m(e,r){try{return r in e}catch{return!1}}function I(e,r){return m(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function x(e,r,t){var o={};return t.isMergeableObject(e)&&l(e).forEach(function(n){o[n]=i(e[n],t)}),l(r).forEach(function(n){I(e,n)||(m(e,n)&&t.isMergeableObject(r[n])?o[n]=T(n,t)(e[n],r[n],t):o[n]=i(r[n],t))}),o}function a(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||P,t.isMergeableObject=t.isMergeableObject||S,t.cloneUnlessOtherwiseSpecified=i;var o=Array.isArray(r),n=Array.isArray(e),c=o===n;return c?o?t.arrayMerge(e,r,t):x(e,r,t):i(r,t)}a.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(o,n){return a(o,n,t)},{})};var D=a,k=D;const R=O(k),B={title:"Checkout",LoginForm:{title:"Contact details",account:"Already have an account?",ariaLabel:"Email",invalidEmailError:"Please enter a valid email address.",missingEmailError:"Enter an email address.",emailExists:{alreadyHaveAccount:"It looks like you already have an account.",signInButton:"Sign in",forFasterCheckout:"for a faster checkout."},floatingLabel:"Email *",placeholder:"Enter your email address",signIn:"Sign In",switch:"Do you want to switch account?",signOut:"Sign Out"},ShippingMethods:{title:"Shipping options",emptyState:"This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."},BillToShippingAddress:{title:"Bill to shipping address"},PaymentMethods:{title:"Payment",emptyState:"No payment methods available"},OutOfStock:{title:"Your cart contains items that are out of stock",message:"The following items are out of stock:",actions:{reviewCart:"Review cart",removeOutOfStock:"Remove out of stock items"},lowInventory:{one:"Last item!",many:"Only {{count}} left!"},alert:"Out of stock!"},PlaceOrder:{button:"Place Order"},ServerError:{title:"We were unable to process your order",contactSupport:"If you continue to have issues, please contact support.",unexpected:"An unexpected error occurred while processing your order. Please try again later.",button:"Try again"},EmptyCart:{title:"Your cart is empty",button:"Start shopping"},ErrorBanner:{genericMessage:"Server error detected. Please check your connection and try again."},MergedCartBanner:{items:{one:"1 item from a previous session was added to your cart. Please review your new subtotal.",many:"{{count}} items from a previous session were added to your cart. Please review your new subtotal."}},EstimateShipping:{estimated:"Estimated Shipping",freeShipping:"Free",label:"Shipping",taxToBeDetermined:"TBD",withTaxes:"Including taxes",withoutTaxes:"Excluding taxes"},OrderConfirmationHeader:{title:"{{name}}, thank you for your order!",defaultTitle:"Thank you for your order!",order:"ORDER #{{order}}",CreateAccount:{message:"Save your information for faster checkout next time.",button:"Create an account"}}},L={Checkout:B},_={default:L},U=({children:e})=>{var c;const[r,t]=b(),o=(c=y.getConfig())==null?void 0:c.langDefinitions;h(()=>{const s=p.on("locale",u=>{u!==r&&t(u)},{eager:!0});return()=>{s==null||s.off()}},[r]);const n=R(_,o??{});return f(g,{lang:r,langDefinitions:n,children:e})},Q=new d(f(U,{}));export{U as Provider,Q as render};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const convertToCamelCase: (key: string) => string;
|
|
2
|
+
export declare const convertToSnakeCase: (key: string) => string;
|
|
3
|
+
export declare const convertKeysCase: (data: any, type: 'snakeCase' | 'camelCase', dictionary?: Record<string, string>) => any;
|
|
4
|
+
//# sourceMappingURL=convertCase.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
*******************************************************************/
|
|
17
|
+
export * from './convertCase';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
package/utils/index.d.ts
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export declare const getCheckoutData: () => Promise<void>;
|
|
18
|
-
//# sourceMappingURL=getCheckoutData.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export * from './getCheckoutData';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
package/api/redirect/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export * from './redirect';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export declare const redirect: (url: string) => void;
|
|
18
|
-
//# sourceMappingURL=redirect.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export * from './resetCustomer';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export declare const resetCustomer: () => void;
|
|
18
|
-
//# sourceMappingURL=resetCustomer.d.ts.map
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const a=e=>e==null,m=(e,t)=>e.amount.value-t.amount.value,n=e=>!(!e||!e.method_code||!e.method_title||a(e.amount.value)||!e.amount.currency),o=e=>({amount:{value:e.amount.value,currency:e.amount.currency},title:e.method_title,code:e.method_code,carrier:{code:e.carrier_code,title:e.carrier_title},value:`${e.carrier_code} - ${e.method_code}`,...e.price_excl_tax&&{amountExclTax:{value:e.price_excl_tax.value,currency:e.price_excl_tax.currency}},...e.price_incl_tax&&{amountInclTax:{value:e.price_incl_tax.value,currency:e.price_incl_tax.currency}}}),_=e=>{if(n(e))return o(e)},d=e=>{if(e)return e.filter(n).map(t=>o(t)).sort(m)},p=e=>e?!!e.code&&!!e.label:!1,y=e=>{if(!p(e))return;const{code:t,label:r,region_id:i}=e;return i?{code:t,name:r,id:i}:{code:t,name:r}},v=e=>{const{code:t,label:r}=e;return{value:t,label:r}},h=e=>e?"code"in e&&"value"in e:!1,f=e=>e.filter(h).map(t=>{const{code:r,value:i}=t;return{code:r,value:i}}),c=e=>{const t=e.street.filter(Boolean);return{id:(e==null?void 0:e.id)||void 0,city:e.city,company:e.company||void 0,country:v(e.country),customAttributes:f(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:y(e.region),street:t,telephone:e.telephone||void 0,vatId:e.vat_id||void 0}},g=e=>{if(e)return c(e)},b=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:r,selected_shipping_method:i,same_as_billing:l,...u}=t;return{...c(u),availableShippingMethods:d(r),selectedShippingMethod:_(i),sameAsBilling:l}}),x=e=>({city:e.city,company:e.company,country_code:e.countryCode,custom_attributes:e.customAttributes.map(t=>({attribute_code:t.code,value:t.value})),firstname:e.firstName,lastname:e.lastName,postcode:e.postcode,region:e.region,region_id:e.regionId,save_in_address_book:e.saveInAddressBook??!0,street:e.street,telephone:e.telephone,vat_id:e.vatId}),A=e=>{if(e)return{code:e.code,title:e.title}},C=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:r,title:i}=t;return{code:r,title:i}})},M=e=>({availablePaymentMethods:C(e.available_payment_methods),billingAddress:g(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:A(e.selected_payment_method),shippingAddresses:b(e.shipping_addresses)}),s=`
|
|
2
|
-
fragment CheckoutData on Cart {
|
|
3
|
-
is_virtual
|
|
4
|
-
email
|
|
5
|
-
total_quantity
|
|
6
|
-
billing_address {
|
|
7
|
-
id
|
|
8
|
-
city
|
|
9
|
-
country {
|
|
10
|
-
code
|
|
11
|
-
label
|
|
12
|
-
}
|
|
13
|
-
firstname
|
|
14
|
-
lastname
|
|
15
|
-
company
|
|
16
|
-
postcode
|
|
17
|
-
vat_id
|
|
18
|
-
region {
|
|
19
|
-
region_id
|
|
20
|
-
code
|
|
21
|
-
label
|
|
22
|
-
}
|
|
23
|
-
street
|
|
24
|
-
telephone
|
|
25
|
-
custom_attributes {
|
|
26
|
-
... on AttributeValue {
|
|
27
|
-
code
|
|
28
|
-
value
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
shipping_addresses {
|
|
33
|
-
id
|
|
34
|
-
firstname
|
|
35
|
-
lastname
|
|
36
|
-
company
|
|
37
|
-
street
|
|
38
|
-
city
|
|
39
|
-
postcode
|
|
40
|
-
vat_id
|
|
41
|
-
region {
|
|
42
|
-
region_id
|
|
43
|
-
code
|
|
44
|
-
label
|
|
45
|
-
}
|
|
46
|
-
country {
|
|
47
|
-
code
|
|
48
|
-
label
|
|
49
|
-
}
|
|
50
|
-
telephone
|
|
51
|
-
custom_attributes {
|
|
52
|
-
... on AttributeValue {
|
|
53
|
-
code
|
|
54
|
-
value
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
available_shipping_methods {
|
|
58
|
-
amount {
|
|
59
|
-
currency
|
|
60
|
-
value
|
|
61
|
-
}
|
|
62
|
-
available
|
|
63
|
-
carrier_code
|
|
64
|
-
carrier_title
|
|
65
|
-
error_message
|
|
66
|
-
method_code
|
|
67
|
-
method_title
|
|
68
|
-
price_excl_tax {
|
|
69
|
-
value
|
|
70
|
-
currency
|
|
71
|
-
}
|
|
72
|
-
price_incl_tax {
|
|
73
|
-
value
|
|
74
|
-
currency
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
selected_shipping_method {
|
|
78
|
-
amount {
|
|
79
|
-
value
|
|
80
|
-
currency
|
|
81
|
-
}
|
|
82
|
-
carrier_code
|
|
83
|
-
carrier_title
|
|
84
|
-
method_code
|
|
85
|
-
method_title
|
|
86
|
-
price_excl_tax {
|
|
87
|
-
value
|
|
88
|
-
currency
|
|
89
|
-
}
|
|
90
|
-
price_incl_tax {
|
|
91
|
-
value
|
|
92
|
-
currency
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
same_as_billing
|
|
96
|
-
}
|
|
97
|
-
available_payment_methods {
|
|
98
|
-
code
|
|
99
|
-
title
|
|
100
|
-
}
|
|
101
|
-
selected_payment_method {
|
|
102
|
-
code
|
|
103
|
-
title
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
`,S=`
|
|
107
|
-
query getCart($cartId: String!) {
|
|
108
|
-
cart(cart_id: $cartId) {
|
|
109
|
-
id
|
|
110
|
-
...CheckoutData
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
${s}
|
|
114
|
-
`,I=`
|
|
115
|
-
query getCustomerCart {
|
|
116
|
-
cart: customerCart {
|
|
117
|
-
id
|
|
118
|
-
...CheckoutData
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
${s}
|
|
122
|
-
`;export{s as C,x as a,M as b,I as c,S as g,d as t};
|
package/chunks/getCustomer.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import"@dropins/tools/event-bus.js";import"./store-config.js";import{s as o,M as l,d as u}from"./fetch-graphql.js";import{b as d,g as f,c as g}from"./getCart.graphql.js";const p=e=>e?"code"in e&&"value"in e:!1,y=e=>e.filter(p).map(t=>{const{code:r,value:s}=t;return{code:r,value:s}}),m=e=>{var n,i,c;const t=e.street.filter(Boolean),r=(n=e.region)==null?void 0:n.region_id,s=r&&r>0;return{id:String(e.id),firstName:e.firstname,lastName:e.lastname,company:e.company||void 0,city:e.city,street:t,postCode:e.postcode||void 0,vatId:e.vat_id||void 0,telephone:e.telephone||void 0,region:{id:s?r:void 0,code:(i=e.region)==null?void 0:i.region_code,name:(c=e.region)==null?void 0:c.region},country:{value:e.country_code,label:e.country_code},customAttributes:y(e.custom_attributesV2)}},h=e=>e?e.filter(Boolean).map(m):[],a=(e,t)=>{if(!t)return;const r=t.find(s=>(s==null?void 0:s[e])===!0);if(r)return m(r)},C=e=>{if(!e)return;const t=e.addresses;return{firstName:e.firstname||"",lastName:e.lastname||"",email:e.email||"",addresses:h(t),defaultBillingAddress:a("default_billing",t),defaultShippingAddress:a("default_shipping",t)}},_=async()=>{const e=o.cartId,t=o.authenticated===!1,r=t?f:g,s=t?{cartId:e}:{};if(t&&!e)throw new l;return await u({type:"query",query:r,options:{method:"POST",cache:"no-cache",variables:s},path:"cart",signalType:"cart",transformer:d})},V=async()=>{const e=o.cartId,t=o.authenticated;if(e)try{await _(),t&&await A()}catch(r){console.error(r)}},v=`
|
|
2
|
-
query getCustomer {
|
|
3
|
-
customer {
|
|
4
|
-
firstname
|
|
5
|
-
lastname
|
|
6
|
-
email
|
|
7
|
-
addresses {
|
|
8
|
-
id
|
|
9
|
-
default_shipping
|
|
10
|
-
default_billing
|
|
11
|
-
city
|
|
12
|
-
country_code
|
|
13
|
-
firstname
|
|
14
|
-
lastname
|
|
15
|
-
company
|
|
16
|
-
postcode
|
|
17
|
-
vat_id
|
|
18
|
-
region {
|
|
19
|
-
region
|
|
20
|
-
region_id
|
|
21
|
-
region_code
|
|
22
|
-
}
|
|
23
|
-
street
|
|
24
|
-
telephone
|
|
25
|
-
custom_attributesV2 {
|
|
26
|
-
... on AttributeValue {
|
|
27
|
-
code
|
|
28
|
-
value
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
`,A=async()=>{if(o.authenticated)return await u({type:"query",query:v,options:{method:"POST",cache:"no-cache"},path:"customer",signalType:"customer",transformer:C})};export{_ as a,A as b,V as g};
|
package/chunks/resetCustomer.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{events as n}from"@dropins/tools/event-bus.js";import{a as l,c as d,d as c}from"./store-config.js";import{s as a,l as u}from"./fetch-graphql.js";import{Initializer as f}from"@dropins/tools/lib.js";import{g as s}from"./getCustomer.js";const g=()=>[n.on("cart/initialized",e=>{const t=(e==null?void 0:e.id)||null;a.cartId=t,t?s():o()},{eager:!0}),n.on("cart/data",e=>{const t=(e==null?void 0:e.id)||null;t!==a.cartId&&(a.cartId=t,t?s():o())},{eager:!0}),n.on("authenticated",e=>{a.authenticated=e,e||C()},{eager:!0})],r=new f({init:async e=>{const t=e||{};r.config.setConfig(t),m(t)},listeners:g}),k=r.config,m=async e=>{var i;const t=(i=e==null?void 0:e.models)==null?void 0:i.StoreConfig;if(!t)return u();l.value={data:t.initialData,pending:!1}},o=()=>{a.cartId=null,d.value={pending:!1,data:null}},C=()=>{a.authenticated=!1,c.value={pending:!1,data:null}};export{m as a,C as b,k as c,r as i,o as r};
|