@zonos/elements 1.3.6 → 1.3.7-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{localization-2c9f5765.js → cart-ecc80eb0.js} +721 -2
- package/dist/cjs/{getBorderRadius-b252096d.js → getBorderRadius-834c321d.js} +1 -1
- package/dist/cjs/{isDarkColor-168002d6.js → isDarkColor-924e6a7a.js} +1 -1
- package/dist/cjs/{submitGtag-792fe45d.js → submitGtag-907e71d3.js} +3 -3
- package/dist/cjs/zonos-address_4.cjs.entry.js +22 -10
- package/dist/cjs/zonos-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_2.cjs.entry.js +7 -5
- package/dist/cjs/zonos-cart-items_9.cjs.entry.js +39 -31
- package/dist/cjs/zonos-checkout.cjs.entry.js +20 -21
- package/dist/cjs/zonos-controller.cjs.entry.js +27 -28
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -3
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +9 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +18 -16
- package/dist/cjs/zonos-hello.cjs.entry.js +34 -32
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +4 -5
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-5d94dabb.js → zonosStore-49d4c92a.js} +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +9 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +2 -1
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +15 -2
- package/dist/collection/components/store/checkout/stripe.js +3 -0
- package/dist/collection/components/store/hello/localization.js +27 -1
- package/dist/collection/components/store/zonosStore.js +4 -4
- package/dist/collection/types/generated/graphql.customer.types.js +6 -0
- package/dist/components/stripe.js +4040 -2
- package/dist/components/submitGtag.js +1 -1
- package/dist/components/zonos-address2.js +1 -2
- package/dist/components/zonos-cart-subtotal2.js +1 -2
- package/dist/components/zonos-checkout-finish2.js +14 -6
- package/dist/components/zonos-checkout-footer2.js +1 -1
- package/dist/components/zonos-checkout-payment2.js +1 -2
- package/dist/components/zonos-checkout.js +1 -2
- package/dist/components/zonos-collapse2.js +15 -2
- package/dist/components/zonos-controller.js +1 -2
- package/dist/components/zonos-country-flag2.js +1 -1
- package/dist/components/zonos-country-select2.js +1 -1
- package/dist/components/zonos-customer-info2.js +2 -3
- package/dist/components/zonos-hello-dialog-footer2.js +1 -1
- package/dist/components/zonos-hello-dialog2.js +1 -1
- package/dist/components/zonos-hello.js +1 -1
- package/dist/components/zonos-language-select2.js +1 -1
- package/dist/components/zonos-review2.js +1 -2
- package/dist/components/zonos-shipping2.js +1 -2
- package/dist/components/zonosStore.js +4 -4
- package/dist/esm/{localization-d8f6453b.js → cart-2a0a6871.js} +707 -3
- package/dist/esm/{getBorderRadius-e9736f7e.js → getBorderRadius-0c7dfcf0.js} +1 -1
- package/dist/esm/{isDarkColor-e982fa09.js → isDarkColor-d0a57fd2.js} +1 -1
- package/dist/esm/{submitGtag-bebe2cb0.js → submitGtag-a38aed23.js} +2 -2
- package/dist/esm/zonos-address_4.entry.js +19 -7
- package/dist/esm/zonos-badge_2.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card_2.entry.js +4 -2
- package/dist/esm/zonos-cart-items_9.entry.js +19 -11
- package/dist/esm/zonos-checkout.entry.js +5 -6
- package/dist/esm/zonos-controller.entry.js +4 -5
- package/dist/esm/zonos-country-flag.entry.js +4 -2
- package/dist/esm/zonos-country-select_3.entry.js +4 -3
- package/dist/esm/zonos-hello-dialog.entry.js +4 -2
- package/dist/esm/zonos-hello.entry.js +4 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +4 -5
- package/dist/esm/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-e6c7be3a.js → zonosStore-dec6bd7e.js} +4 -4
- package/dist/esm-es5/cart-2a0a6871.js +1 -0
- package/dist/esm-es5/{getBorderRadius-e9736f7e.js → getBorderRadius-0c7dfcf0.js} +1 -1
- package/dist/esm-es5/{isDarkColor-e982fa09.js → isDarkColor-d0a57fd2.js} +1 -1
- package/dist/esm-es5/submitGtag-a38aed23.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e6c7be3a.js → zonosStore-dec6bd7e.js} +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/store/checkout/stripe.d.ts +4 -0
- package/dist/types/components/store/zonosStore.d.ts +1 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/getLanguageCode.d.ts +1 -1
- package/dist/types/types/ICountryJson.d.ts +2 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +15 -0
- package/dist/types/types/generated/graphql.customer.types.ts +24 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/zonos-elements/p-0057e374.entry.js +1 -0
- package/dist/zonos-elements/p-066c5893.system.js +1 -1
- package/dist/zonos-elements/p-0c72fb79.system.entry.js +1 -0
- package/dist/zonos-elements/p-1f85a98c.system.entry.js +1 -0
- package/dist/zonos-elements/{p-96aabe02.entry.js → p-290c3670.entry.js} +1 -1
- package/dist/zonos-elements/{p-e8a9bc56.entry.js → p-2d2e1831.entry.js} +1 -1
- package/dist/zonos-elements/p-2f1e1cbb.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a682fd38.system.entry.js → p-33080cde.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-17550a10.js → p-34c03be2.js} +1 -1
- package/dist/zonos-elements/{p-a33745e9.entry.js → p-34efed1d.entry.js} +1 -1
- package/dist/zonos-elements/p-375c472a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-fcc4f140.system.js → p-549c181b.system.js} +1 -1
- package/dist/zonos-elements/{p-32bca9c8.system.entry.js → p-55970b10.system.entry.js} +1 -1
- package/dist/zonos-elements/p-561e44d6.entry.js +1 -0
- package/dist/zonos-elements/{p-50287643.system.js → p-591eb6dd.system.js} +1 -1
- package/dist/zonos-elements/p-5b44abc8.system.js +1 -0
- package/dist/zonos-elements/p-5c4dc123.js +1 -0
- package/dist/zonos-elements/{p-ec25f180.entry.js → p-656c836b.entry.js} +1 -1
- package/dist/zonos-elements/{p-49a764e9.system.entry.js → p-67737613.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-dd7729fd.system.entry.js → p-79b910bf.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7d1d862f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5a113c3d.system.entry.js → p-88a55076.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7dd8e8ba.system.entry.js → p-8aeb4679.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8d645a00.entry.js +1 -0
- package/dist/zonos-elements/p-9878a770.js +1 -0
- package/dist/zonos-elements/p-a219689f.entry.js +1 -0
- package/dist/zonos-elements/p-a3d72a33.entry.js +1 -0
- package/dist/zonos-elements/p-a93c594f.entry.js +1 -0
- package/dist/zonos-elements/{p-0c7480a5.entry.js → p-a95c034c.entry.js} +1 -1
- package/dist/zonos-elements/{p-7a6144b1.entry.js → p-afe40057.entry.js} +1 -1
- package/dist/zonos-elements/p-b10ff468.entry.js +1 -0
- package/dist/zonos-elements/p-b6992dc2.system.entry.js +1 -0
- package/dist/zonos-elements/{p-3ef27745.js → p-bce46c41.js} +1 -1
- package/dist/zonos-elements/p-c56d4a44.entry.js +1 -0
- package/dist/zonos-elements/{p-bd6a2095.entry.js → p-c7098c3b.entry.js} +1 -1
- package/dist/zonos-elements/{p-f49dfd06.system.js → p-cbb1e700.system.js} +1 -1
- package/dist/zonos-elements/p-cc63a29f.system.entry.js +1 -0
- package/dist/zonos-elements/p-cd8bd5e9.system.entry.js +1 -0
- package/dist/zonos-elements/p-d36faf87.system.entry.js +1 -0
- package/dist/zonos-elements/p-dfd3edcf.entry.js +1 -0
- package/dist/zonos-elements/{p-ba43275e.entry.js → p-e161a08c.entry.js} +1 -1
- package/dist/zonos-elements/{p-9cbbf261.system.entry.js → p-e2770968.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e2c6ad57.entry.js +1 -0
- package/dist/zonos-elements/{p-b81a0577.system.entry.js → p-e855966f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ea93943a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-e99d79d9.system.js → p-ec4d08b3.system.js} +1 -1
- package/dist/zonos-elements/{p-47fac33f.js → p-f455e08c.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/cart-b8bbf22d.js +0 -698
- package/dist/components/localization.js +0 -4016
- package/dist/esm/cart-bc3bb22e.js +0 -682
- package/dist/esm-es5/cart-bc3bb22e.js +0 -1
- package/dist/esm-es5/localization-d8f6453b.js +0 -1
- package/dist/esm-es5/submitGtag-bebe2cb0.js +0 -1
- package/dist/zonos-elements/p-00d63df1.system.entry.js +0 -1
- package/dist/zonos-elements/p-04f63cea.entry.js +0 -1
- package/dist/zonos-elements/p-16b74c31.system.js +0 -1
- package/dist/zonos-elements/p-1d16a6fb.js +0 -1
- package/dist/zonos-elements/p-1ea68e3b.entry.js +0 -1
- package/dist/zonos-elements/p-1ed530cc.entry.js +0 -1
- package/dist/zonos-elements/p-289c8b1a.system.entry.js +0 -1
- package/dist/zonos-elements/p-2a00c270.system.entry.js +0 -1
- package/dist/zonos-elements/p-37f53a79.entry.js +0 -1
- package/dist/zonos-elements/p-394cf1cf.js +0 -1
- package/dist/zonos-elements/p-458fd100.system.entry.js +0 -1
- package/dist/zonos-elements/p-4fafb2a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-4fb71a93.js +0 -1
- package/dist/zonos-elements/p-5276c61b.system.entry.js +0 -1
- package/dist/zonos-elements/p-6308b347.entry.js +0 -1
- package/dist/zonos-elements/p-63d1b1fe.entry.js +0 -1
- package/dist/zonos-elements/p-7347ee7c.system.entry.js +0 -1
- package/dist/zonos-elements/p-8c26a080.system.js +0 -1
- package/dist/zonos-elements/p-ba1a111a.system.entry.js +0 -1
- package/dist/zonos-elements/p-c4321084.system.entry.js +0 -1
- package/dist/zonos-elements/p-cdf114a2.entry.js +0 -1
- package/dist/zonos-elements/p-d5ae3cbb.system.entry.js +0 -1
- package/dist/zonos-elements/p-d5d7c8f5.entry.js +0 -1
- package/dist/zonos-elements/p-de339fb6.entry.js +0 -1
- package/dist/zonos-elements/p-f6f5f644.entry.js +0 -1
|
@@ -41,6 +41,7 @@ export class ZonosCheckoutFinish {
|
|
|
41
41
|
case 'ZONOS_SUCCESS_PAGE':
|
|
42
42
|
default:
|
|
43
43
|
// Do nothing, display Zonos success page
|
|
44
|
+
this.isLoading = false;
|
|
44
45
|
break;
|
|
45
46
|
}
|
|
46
47
|
};
|
|
@@ -50,7 +51,6 @@ export class ZonosCheckoutFinish {
|
|
|
50
51
|
if (order) {
|
|
51
52
|
this.order = order;
|
|
52
53
|
this.handleSuccessBehavior(order.id);
|
|
53
|
-
this.isLoading = false;
|
|
54
54
|
}
|
|
55
55
|
else if (!order && attempts < 5) {
|
|
56
56
|
// Wait for 1 second before the next attempt
|
|
@@ -102,12 +102,17 @@ export class ZonosCheckoutFinish {
|
|
|
102
102
|
}
|
|
103
103
|
// Attempt to pull the order details from the graph every second on 5 attempts
|
|
104
104
|
if (this.notificationType === 'success') {
|
|
105
|
-
this.isLoading = true;
|
|
106
105
|
void this.getPullOrder();
|
|
107
106
|
}
|
|
107
|
+
else {
|
|
108
|
+
this.isLoading = false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.isLoading = false;
|
|
108
113
|
}
|
|
109
114
|
stripeStoreReset();
|
|
110
|
-
|
|
115
|
+
cartStore.checkoutSessionId = null;
|
|
111
116
|
};
|
|
112
117
|
this.closeClickHandler = () => {
|
|
113
118
|
this.closeClick.emit();
|
|
@@ -140,7 +145,7 @@ export class ZonosCheckoutFinish {
|
|
|
140
145
|
// const totalItems = this.order?.items?.reduce((acc, item) => {
|
|
141
146
|
// return acc + item.quantity;
|
|
142
147
|
// }, 0);
|
|
143
|
-
return (h(Host, { key: '
|
|
148
|
+
return (h(Host, { key: '08886ec74e789091534c8bd6561a8349a5a6966c', class: "zonos--checkout-finish zonos--elements", style: {
|
|
144
149
|
'--border-radius': getBorderRadius(this.borderRadius),
|
|
145
150
|
} }, this.isLoading && (h("div", { class: "loading-wrapper" }, h("zonos-spinner", null))), !this.isLoading && (h(Fragment, null, h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", null, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Keep shopping')))))));
|
|
146
151
|
}
|
|
@@ -23,10 +23,23 @@ export class ZonosCollapse {
|
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
this.height = this.el.scrollHeight;
|
|
26
|
-
|
|
26
|
+
if (!this.collapsed) {
|
|
27
|
+
// wait for the collapse animation to finish, then set overflow to visible
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
// if the element collapsed state is still not changed, set overflow to visible
|
|
30
|
+
if (!this.collapsed) {
|
|
31
|
+
this.el.style.overflow = 'visible';
|
|
32
|
+
}
|
|
33
|
+
}, 300);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// set overflow to hidden to prevent content from showing when collapsed
|
|
37
|
+
this.el.style.overflow = 'hidden';
|
|
38
|
+
}
|
|
39
|
+
return (h(Host, { key: 'cbec79617b603172a6c3c41d29ee093f61eead92', class: 'zonos--elements zonos--collapse', style: {
|
|
27
40
|
'--font-family': zonosStoreFontFamily(),
|
|
28
41
|
height: this.getElementHeight(),
|
|
29
|
-
} }, h("div", { key: '
|
|
42
|
+
} }, h("div", { key: '6e72b98c155ee436bbaabce3d7b58294bb6ccc7a' }, h("iframe", { key: 'ef3306219530d635fa320099727a3574d5800285', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: 'a66b3d6d08a12f0c184a5c4294afdb2c340fe95d' }))));
|
|
30
43
|
}
|
|
31
44
|
static get is() { return "zonos-collapse"; }
|
|
32
45
|
static get encapsulation() { return "shadow"; }
|
|
@@ -295,6 +295,9 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
295
295
|
body: {
|
|
296
296
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
297
297
|
itemsAmount: total,
|
|
298
|
+
metadata: [
|
|
299
|
+
{ key: 'language', value: localizationStore.selectedLocale },
|
|
300
|
+
],
|
|
298
301
|
presentmentCountryCode: localizationStore.selectedCountryCode || null,
|
|
299
302
|
},
|
|
300
303
|
method: 'POST',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
|
+
import { cartStore } from "../checkout/cart";
|
|
2
3
|
import { translationStoreUpdateLanguage } from "../translationStore";
|
|
3
4
|
import { zonosStore } from "../zonosStore";
|
|
4
5
|
import { getCountries } from "../../utils/api/getCountries";
|
|
@@ -7,10 +8,12 @@ import { getExchangeRate, } from "../../utils/api/getExchangeRate";
|
|
|
7
8
|
import { getLocaleMessages } from "../../utils/api/getLocaleMessages";
|
|
8
9
|
import { getLocalization } from "../../utils/api/getLocalization";
|
|
9
10
|
import { getShippingZones } from "../../utils/api/getShippingZones";
|
|
11
|
+
import { handleFetch } from "../../utils/handleFetch";
|
|
10
12
|
import { currencyDisplay } from "../../utils/hello/currencyConversion/currencyDisplay";
|
|
11
13
|
import { getCurrencyCode } from "../../utils/hello/currencyConversion/getCurrencyCode";
|
|
12
14
|
import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
|
|
13
15
|
import { log } from "../../utils/logging/log";
|
|
16
|
+
import { logError } from "../../utils/logging/logError";
|
|
14
17
|
const { state: localizationStore } = createStore({
|
|
15
18
|
countryLandedCost: null,
|
|
16
19
|
customMessages: [],
|
|
@@ -119,7 +122,7 @@ const initLocalizationStore = async () => {
|
|
|
119
122
|
// Filter countries to only include countries in the shipping zone
|
|
120
123
|
const filteredCountries = shippingZoneCountries === null || shippingZoneCountries === void 0 ? void 0 : shippingZoneCountries.reduce((acc, countryCode) => {
|
|
121
124
|
const countryInfo = allCountries === null || allCountries === void 0 ? void 0 : allCountries[countryCode];
|
|
122
|
-
return countryInfo
|
|
125
|
+
return countryInfo && countryInfo.active
|
|
123
126
|
? Object.assign(Object.assign({}, acc), { [countryCode]: countryInfo }) : acc;
|
|
124
127
|
}, {});
|
|
125
128
|
localizationStore.shippingZoneCountries = filteredCountries || null;
|
|
@@ -140,8 +143,31 @@ const initLocalizationStore = async () => {
|
|
|
140
143
|
localizationStore.localizationLoaded = true;
|
|
141
144
|
void getCustomMessages();
|
|
142
145
|
};
|
|
146
|
+
const updateCheckoutSessionLanguage = async () => {
|
|
147
|
+
if (!cartStore.checkoutSessionId) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/update-checkout-session-metadata`, {
|
|
151
|
+
body: {
|
|
152
|
+
id: cartStore.checkoutSessionId,
|
|
153
|
+
metadata: [
|
|
154
|
+
{
|
|
155
|
+
key: 'language',
|
|
156
|
+
value: localizationStore.selectedLocale,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
method: 'POST',
|
|
161
|
+
});
|
|
162
|
+
if (errors.length || !json) {
|
|
163
|
+
logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
|
|
164
|
+
return { errors, json };
|
|
165
|
+
}
|
|
166
|
+
return { errors: [], json };
|
|
167
|
+
};
|
|
143
168
|
const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
|
|
144
169
|
localizationStore.selectedLocale = newSelectedLocale;
|
|
145
170
|
translationStoreUpdateLanguage(newSelectedLocale);
|
|
171
|
+
void updateCheckoutSessionLanguage();
|
|
146
172
|
};
|
|
147
173
|
export { initLocalizationStore, localizationStore, localizationStoreUpdateSelectedCountryCode, localizationStoreUpdateSelectedLocale, };
|
|
@@ -84,16 +84,16 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
|
|
|
84
84
|
}
|
|
85
85
|
zonosStore.appearance = mergeConfig(zonosStore.appearance, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.appearanceSettings) ||
|
|
86
86
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.appearanceSettings) ||
|
|
87
|
-
null, overrideSettings.appearance);
|
|
87
|
+
null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.appearance);
|
|
88
88
|
zonosStore.checkoutSettings = mergeConfig(zonosStore.checkoutSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.checkoutSettings) ||
|
|
89
89
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
|
|
90
|
-
null, overrideSettings.checkoutSettings);
|
|
91
|
-
zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings.helloSettings);
|
|
90
|
+
null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.checkoutSettings);
|
|
91
|
+
zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.helloSettings);
|
|
92
92
|
// set flag to true to indicate that config is ready
|
|
93
93
|
zonosStore.loadedConfig = true;
|
|
94
94
|
zonosStore.organizationName = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
95
95
|
zonosStore.storeId = ((_c = (_b = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _b === void 0 ? void 0 : _b.references) === null || _c === void 0 ? void 0 : _c.storeId) || null;
|
|
96
|
-
zonosStore.currencyConverter = overrideSettings.currencyConverter;
|
|
96
|
+
zonosStore.currencyConverter = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.currencyConverter;
|
|
97
97
|
};
|
|
98
98
|
const zonosStoreFontFamily = () => {
|
|
99
99
|
const fontFamily = zonosStore.appearance.fontFamily || 'Inter';
|
|
@@ -1324,8 +1324,11 @@ export const landedCostFeeType = {
|
|
|
1324
1324
|
Shipping: 'SHIPPING',
|
|
1325
1325
|
Tax: 'TAX',
|
|
1326
1326
|
ZonosAccessFee: 'ZONOS_ACCESS_FEE',
|
|
1327
|
+
ZonosLandedCost: 'ZONOS_LANDED_COST',
|
|
1327
1328
|
ZonosLandedCostGuarantee: 'ZONOS_LANDED_COST_GUARANTEE',
|
|
1328
1329
|
ZonosMerchantFee: 'ZONOS_MERCHANT_FEE',
|
|
1330
|
+
ZonosMerchantProcessing: 'ZONOS_MERCHANT_PROCESSING',
|
|
1331
|
+
ZonosTransaction: 'ZONOS_TRANSACTION',
|
|
1329
1332
|
};
|
|
1330
1333
|
export const landedCostGuaranteeCode = {
|
|
1331
1334
|
InclusivePrice: 'INCLUSIVE_PRICE',
|
|
@@ -1870,6 +1873,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
1870
1873
|
CheckoutSessionUpdate(variables, requestHeaders) {
|
|
1871
1874
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'CheckoutSessionUpdate', 'mutation');
|
|
1872
1875
|
},
|
|
1876
|
+
CheckoutSessionUpdateMetadata(variables, requestHeaders) {
|
|
1877
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'CheckoutSessionUpdateMetadata', 'mutation');
|
|
1878
|
+
},
|
|
1873
1879
|
ExchangeRateCreate(variables, requestHeaders) {
|
|
1874
1880
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'ExchangeRateCreate', 'mutation');
|
|
1875
1881
|
},
|