@zonos/elements 1.3.87 → 1.3.89
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/{cart-120d68f9.js → cart-e15290ab.js} +15 -7
- package/dist/cjs/{createCustomEvent-ed9156dc.js → createCustomEvent-3da45800.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-875cfaf1.js → paypal-47b71e3b.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +8 -6
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +1022 -11
- package/dist/cjs/zonos-checkout.cjs.entry.js +4 -6
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +20 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -4
- package/dist/collection/components/store/checkout/stripe.js +2 -3
- package/dist/collection/components/store/hello/localization.js +13 -4
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +9 -6
- package/dist/collection/components/utils/cleanHtmlMarkdown.js +28 -0
- package/dist/esm/{cart-9f1caabf.js → cart-08c2a740.js} +15 -7
- package/dist/esm/{createCustomEvent-464c49c0.js → createCustomEvent-a8a9fe09.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-fb449438.js → paypal-4a21792c.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +9 -7
- package/dist/esm/zonos-cart-items_12.entry.js +1022 -11
- package/dist/esm/zonos-checkout.entry.js +4 -6
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/{cart-9f1caabf.js → cart-08c2a740.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-464c49c0.js → createCustomEvent-a8a9fe09.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-fb449438.js → paypal-4a21792c.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.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_4.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-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.d.ts +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/store/hello/localization.d.ts +1 -4
- package/dist/types/components/utils/cleanHtmlMarkdown.d.ts +16 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-0033c20b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-89d2a27b.system.js → p-00706ef7.system.js} +1 -1
- package/dist/zonos-elements/{p-d7cf2a25.system.js → p-05b75d37.system.js} +1 -1
- package/dist/zonos-elements/{p-3d521899.system.entry.js → p-12f25739.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9f36076f.entry.js → p-2aeb1f26.entry.js} +1 -1
- package/dist/zonos-elements/{p-cb9ff4df.js → p-3214b2df.js} +1 -1
- package/dist/zonos-elements/{p-7fce2a19.entry.js → p-3951ac01.entry.js} +1 -1
- package/dist/zonos-elements/{p-e6129027.entry.js → p-3ac3a8be.entry.js} +1 -1
- package/dist/zonos-elements/p-48b151ae.entry.js +1 -0
- package/dist/zonos-elements/{p-5bef550e.system.entry.js → p-49010cea.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-35577bd8.system.entry.js → p-4a417566.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-72513d54.entry.js → p-4f13a851.entry.js} +1 -1
- package/dist/zonos-elements/{p-d33a87fc.entry.js → p-531973ca.entry.js} +1 -1
- package/dist/zonos-elements/{p-294026a0.system.js → p-5f0c4397.system.js} +1 -1
- package/dist/zonos-elements/{p-92f1cf70.entry.js → p-6d5d31ac.entry.js} +1 -1
- package/dist/zonos-elements/{p-0b01b9b1.system.entry.js → p-76015899.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f7ec6999.js → p-7c8ad901.js} +1 -1
- package/dist/zonos-elements/p-8bbe007f.system.entry.js +1 -0
- package/dist/zonos-elements/p-9773abc9.entry.js +1 -0
- package/dist/zonos-elements/{p-253cbdae.entry.js → p-aab5ccde.entry.js} +1 -1
- package/dist/zonos-elements/{p-6c380fa8.system.js → p-c1f0aeb4.system.js} +1 -1
- package/dist/zonos-elements/p-c28824a0.system.entry.js +1 -0
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-d81f35bf.js → p-db4c833d.js} +2 -2
- package/dist/zonos-elements/{p-c0a7750c.system.entry.js → p-dbd51a62.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f49ca64f.entry.js +1 -0
- package/dist/zonos-elements/{p-69bb9b53.system.entry.js → p-f5e29ed6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-94589f18.system.entry.js → p-fc2191b7.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +5 -4
- package/dist/zonos-elements/p-4412b94b.system.entry.js +0 -1
- package/dist/zonos-elements/p-49a3a2a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-7f21c1c4.entry.js +0 -1
- package/dist/zonos-elements/p-a7b6fd9c.entry.js +0 -1
- package/dist/zonos-elements/p-b58f4433.entry.js +0 -1
- package/dist/zonos-elements/p-e05eed8e.system.entry.js +0 -1
|
@@ -8399,10 +8399,6 @@ const setZCountryUrlParam = (selectedCountryCode) => {
|
|
|
8399
8399
|
}
|
|
8400
8400
|
};
|
|
8401
8401
|
|
|
8402
|
-
/**
|
|
8403
|
-
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8404
|
-
*/
|
|
8405
|
-
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8406
8402
|
const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = zonosStore.createStore({
|
|
8407
8403
|
countryLandedCost: null,
|
|
8408
8404
|
customMessages: [],
|
|
@@ -8430,6 +8426,18 @@ const triggerGetExchangeRate = async (isGuaranteed) => {
|
|
|
8430
8426
|
}
|
|
8431
8427
|
return { maxAge };
|
|
8432
8428
|
};
|
|
8429
|
+
/**
|
|
8430
|
+
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8431
|
+
*/
|
|
8432
|
+
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8433
|
+
const getFallbackDefaultCountryCode = (allowedCountries) => {
|
|
8434
|
+
if (localizationStore.selectedCountryCode &&
|
|
8435
|
+
allowedCountries.includes(localizationStore.selectedCountryCode)) {
|
|
8436
|
+
return localizationStore.selectedCountryCode;
|
|
8437
|
+
}
|
|
8438
|
+
// Don't check if it is allowed. If it is not allowed it will fallback to Albania (first option).
|
|
8439
|
+
return DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
8440
|
+
};
|
|
8433
8441
|
// This recursive function is for users who step away from their computer and come back needing a new exchange rate
|
|
8434
8442
|
const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
8435
8443
|
if (localizationStore.exchangeRateTimeout) {
|
|
@@ -8578,6 +8586,7 @@ const initLocalizationStore = async () => {
|
|
|
8578
8586
|
// Initialize the country list for the hello widget
|
|
8579
8587
|
initHelloCountryList(allCountries || {});
|
|
8580
8588
|
const { country, locale } = localization;
|
|
8589
|
+
handleFetch.log(`Country code from localization: ${country}`);
|
|
8581
8590
|
// update selected country code in store
|
|
8582
8591
|
localizationStoreUpdateSelectedCountryCode(country);
|
|
8583
8592
|
// use locale from params if it exists, otherwise use locale from localization
|
|
@@ -9477,8 +9486,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
9477
9486
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
9478
9487
|
itemsAmount: total,
|
|
9479
9488
|
metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
|
|
9480
|
-
presentmentCountryCode: localizationStore.selectedCountryCode
|
|
9481
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
9489
|
+
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
9482
9490
|
},
|
|
9483
9491
|
method: 'POST',
|
|
9484
9492
|
});
|
|
@@ -10017,7 +10025,6 @@ const cartStoreResetTabItems = () => {
|
|
|
10017
10025
|
cartStoreResetSelectedShippingOption();
|
|
10018
10026
|
};
|
|
10019
10027
|
|
|
10020
|
-
exports.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
10021
10028
|
exports.cartStore = cartStore;
|
|
10022
10029
|
exports.cartStoreClearCheckoutInterval = cartStoreClearCheckoutInterval;
|
|
10023
10030
|
exports.cartStoreGetShippingTransitInfo = cartStoreGetShippingTransitInfo;
|
|
@@ -10034,6 +10041,7 @@ exports.currencyConvert = currencyConvert;
|
|
|
10034
10041
|
exports.currencyConvertAndFormat = currencyConvertAndFormat;
|
|
10035
10042
|
exports.currencyDisplay = currencyDisplay;
|
|
10036
10043
|
exports.currencyFormat = currencyFormat;
|
|
10044
|
+
exports.getFallbackDefaultCountryCode = getFallbackDefaultCountryCode;
|
|
10037
10045
|
exports.getZCountryUrlParam = getZCountryUrlParam;
|
|
10038
10046
|
exports.initLocalizationStore = initLocalizationStore;
|
|
10039
10047
|
exports.initStripeElements = initStripeElements;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
100
|
-
const cdnUrl = "https://v1.3.
|
|
100
|
+
const cdnUrl = "https://v1.3.89.js.zonos.com";
|
|
101
101
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
102
102
|
if (!qaUrl &&
|
|
103
103
|
(cdnUrl.includes('test.') ||
|
|
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
|
|
|
281
281
|
}
|
|
282
282
|
return null;
|
|
283
283
|
})();
|
|
284
|
-
const ZONOS_URL = "https://v1.3.
|
|
285
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
286
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
287
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
284
|
+
const ZONOS_URL = "https://v1.3.89.js.zonos.com";
|
|
285
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.89";
|
|
286
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.89";
|
|
287
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.89";
|
|
288
288
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
289
289
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
290
290
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
299
299
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
300
300
|
Zonos._paypalMockResponse = null;
|
|
301
301
|
Zonos.isBigCommerce = false;
|
|
302
|
-
Zonos.releaseDate = "
|
|
302
|
+
Zonos.releaseDate = "1728924518080";
|
|
303
303
|
Zonos.isLegacyCheckout = false;
|
|
304
304
|
/**
|
|
305
305
|
* By default, the package will load from npm
|
|
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
307
307
|
Zonos.isNpm = true;
|
|
308
308
|
Zonos.zonosQaUrl = null;
|
|
309
309
|
Zonos.zonosQaUrlApi = null;
|
|
310
|
-
Zonos.version = `v${"1.3.
|
|
310
|
+
Zonos.version = `v${"1.3.89"}`;
|
|
311
311
|
Zonos.modeAlerted = false;
|
|
312
312
|
Zonos.cartData = null;
|
|
313
313
|
Zonos.paypal = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
4
|
-
const cart = require('./cart-
|
|
4
|
+
const cart = require('./cart-e15290ab.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -75,16 +75,18 @@ const ZonosAddress = class {
|
|
|
75
75
|
const shippingZone = shippableCountries
|
|
76
76
|
? Object.values(shippableCountries).map(country => country.code)
|
|
77
77
|
: [];
|
|
78
|
+
const allowedCountries = this.type === 'shipping' ? shippingZone : [];
|
|
79
|
+
const defaultAddressCountry = (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
80
|
+
cart.getFallbackDefaultCountryCode(allowedCountries);
|
|
81
|
+
handleFetch.log(`Stripe country code: ${defaultAddressCountry}`, 'info');
|
|
78
82
|
const addressElement = stripeElements.create('address', {
|
|
79
|
-
allowedCountries
|
|
83
|
+
allowedCountries,
|
|
80
84
|
// only show the default address if stripeAddressEventData is not provided
|
|
81
85
|
contacts: this.defaultAddress && !stripeAddressEventData
|
|
82
86
|
? [this.defaultAddress]
|
|
83
87
|
: [],
|
|
84
88
|
defaultValues: {
|
|
85
|
-
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country:
|
|
86
|
-
cart.localizationStore.selectedCountryCode ||
|
|
87
|
-
cart.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
|
|
89
|
+
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
|
|
88
90
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
89
91
|
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
90
92
|
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
@@ -147,7 +149,7 @@ const ZonosAddress = class {
|
|
|
147
149
|
}
|
|
148
150
|
render() {
|
|
149
151
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
150
|
-
return (index.h(index.Host, { key: '
|
|
152
|
+
return (index.h(index.Host, { key: '15074e6cf5021e2d583838eb866f92cb8dad0c1e', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '4203a4dffc101ba0667e975ff2ebe6125e023509', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: '66add8724cb61193252e44b7a8179fbabc34d3d2', class: "zonos--address-component" })));
|
|
151
153
|
}
|
|
152
154
|
get el() { return index.getElement(this); }
|
|
153
155
|
static get watchers() { return {
|