@zonos/elements 1.3.32 → 1.3.33
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-d07e8ea1.js → cart-11b47252.js} +3 -2
- package/dist/cjs/index.cjs.js +12 -5
- package/dist/cjs/{submitGtag-f1aeac3e.js → submitGtag-3a1d091e.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +5 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +3 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_3.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_2.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +3 -1
- package/dist/collection/components/main/zonos-controller.js +2 -1
- package/dist/collection/components/store/hello/localization.js +3 -2
- package/dist/collection/scripts/_zonosBase.js +8 -1
- package/dist/esm/{cart-a90aa9ae.js → cart-22ba08ec.js} +3 -2
- package/dist/esm/index.js +12 -5
- package/dist/esm/{submitGtag-849e2bc9.js → submitGtag-1435eec8.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +5 -3
- package/dist/esm/zonos-controller.entry.js +3 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_3.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_2.entry.js +1 -1
- package/dist/esm-es5/{cart-a90aa9ae.js → cart-22ba08ec.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{submitGtag-849e2bc9.js → submitGtag-1435eec8.js} +1 -1
- package/dist/esm-es5/zonos-address_8.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_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-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +5 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/types/checkout/CheckoutConfig.d.ts +5 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-41ef293d.js → p-11672829.js} +1 -1
- package/dist/zonos-elements/{p-16ab16f9.system.entry.js → p-28e6963b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-93e493ce.entry.js → p-35604380.entry.js} +1 -1
- package/dist/zonos-elements/{p-7a6dcfa2.entry.js → p-36bb4360.entry.js} +1 -1
- package/dist/zonos-elements/{p-cc965417.entry.js → p-3b95a9a3.entry.js} +1 -1
- package/dist/zonos-elements/p-450eb8ff.system.js +1 -0
- package/dist/zonos-elements/{p-b6c515e1.system.entry.js → p-478357b0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-21b61106.system.entry.js → p-56152835.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8aadefbb.entry.js → p-6f589755.entry.js} +1 -1
- package/dist/zonos-elements/{p-1eab7a86.entry.js → p-74bd6150.entry.js} +1 -1
- package/dist/zonos-elements/{p-3ba86711.system.js → p-7624013b.system.js} +1 -1
- package/dist/zonos-elements/{p-2d6d0d57.js → p-84997f2e.js} +1 -1
- package/dist/zonos-elements/{p-38a90e86.system.entry.js → p-88129ef9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-af0d3ca0.system.entry.js → p-95d52a24.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6de51a79.system.entry.js → p-a0b17e0b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-344ce057.entry.js → p-b5825bb7.entry.js} +1 -1
- package/dist/zonos-elements/{p-85503e70.system.entry.js → p-b8a4b345.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-672e80e5.system.entry.js → p-cdb53aaf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-057380ad.system.js → p-dafa2b79.system.js} +1 -1
- package/dist/zonos-elements/p-ddb1cfe2.entry.js +1 -0
- package/dist/zonos-elements/{p-da787898.system.entry.js → p-dec21ca2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9d599745.entry.js → p-e09df465.entry.js} +1 -1
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
- package/dist/zonos-elements/{p-717faabd.system.entry.js → p-eb566457.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6f04e132.entry.js → p-fa7e2a01.entry.js} +1 -1
- package/dist/zonos-elements/{p-e344cb12.entry.js → p-fe296307.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-8b771620.entry.js +0 -1
- package/dist/zonos-elements/p-ca8fb99c.system.js +0 -1
|
@@ -7046,7 +7046,7 @@ const addInternationalHideClass = () => {
|
|
|
7046
7046
|
};
|
|
7047
7047
|
const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
7048
7048
|
var _a, _b;
|
|
7049
|
-
logError.log(
|
|
7049
|
+
logError.log(`Updating selected country code to ${newSelectedCountryCode}`);
|
|
7050
7050
|
const isFirstTime = !localizationStore.selectedCountryCode;
|
|
7051
7051
|
localizationStore.selectedCountryCode = newSelectedCountryCode;
|
|
7052
7052
|
const { selectedCountryCode, shippingZoneCountries } = localizationStore;
|
|
@@ -7055,12 +7055,13 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
7055
7055
|
!!shippingZoneCountries[selectedCountryCode];
|
|
7056
7056
|
// update shippable country
|
|
7057
7057
|
localizationStore.isShippableCountry = !!isShippableCountry;
|
|
7058
|
-
logError.log(
|
|
7058
|
+
logError.log(`${localizationStore.selectedCountryCode} is shippable country: ${localizationStore.isShippableCountry}`);
|
|
7059
7059
|
addInternationalHideClass();
|
|
7060
7060
|
if (!selectedCountryCode) {
|
|
7061
7061
|
return;
|
|
7062
7062
|
}
|
|
7063
7063
|
const currencyCode = getCurrencyCode(selectedCountryCode);
|
|
7064
|
+
logError.log({ currencyCode });
|
|
7064
7065
|
if (!currencyCode) {
|
|
7065
7066
|
return;
|
|
7066
7067
|
}
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -249,9 +249,9 @@ const zonosLoadUrl = (() => {
|
|
|
249
249
|
}
|
|
250
250
|
return null;
|
|
251
251
|
})();
|
|
252
|
-
const ZONOS_URL = "https://v1.3.
|
|
253
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
254
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
252
|
+
const ZONOS_URL = "https://v1.3.33.js.zonos.com";
|
|
253
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.33";
|
|
254
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.33";
|
|
255
255
|
const MAIN_LOAD_CDN_TYPE = 'jsdelivr';
|
|
256
256
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
257
257
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
@@ -271,7 +271,7 @@ Zonos.isBigCommerce = false;
|
|
|
271
271
|
*/
|
|
272
272
|
Zonos.isNpm = true;
|
|
273
273
|
Zonos.zonosQaUrl = null;
|
|
274
|
-
Zonos.version = `v${"1.3.
|
|
274
|
+
Zonos.version = `v${"1.3.33"}`;
|
|
275
275
|
Zonos.modeAlerted = false;
|
|
276
276
|
Zonos.tempCartData = null;
|
|
277
277
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
@@ -330,7 +330,12 @@ Zonos.updateOrganizationName = (organizationName) => {
|
|
|
330
330
|
var _b;
|
|
331
331
|
void ((_b = _a.zonosController) === null || _b === void 0 ? void 0 : _b.updateOrganizationName(organizationName));
|
|
332
332
|
};
|
|
333
|
-
Zonos.disablePlaceOrderButtons = ({ autoEnable = true, disable, placeOrderButtonSelector, }) => {
|
|
333
|
+
Zonos.disablePlaceOrderButtons = ({ autoEnable = true, config, disable, placeOrderButtonSelector, }) => {
|
|
334
|
+
var _b;
|
|
335
|
+
// if disablePlaceOrderButtonActivation is true, do nothing
|
|
336
|
+
if ((_b = config.checkoutSettings) === null || _b === void 0 ? void 0 : _b.disablePlaceOrderButtonActivation) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
334
339
|
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
335
340
|
if (placeOrderButtonSelector) {
|
|
336
341
|
const placeOrderButton = document.querySelectorAll(placeOrderButtonSelector);
|
|
@@ -381,12 +386,14 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
381
386
|
if ((_b = config.checkoutSettings) === null || _b === void 0 ? void 0 : _b.placeOrderButtonSelector) {
|
|
382
387
|
const placeOrderButtonSelector = config.checkoutSettings.placeOrderButtonSelector;
|
|
383
388
|
_a.disablePlaceOrderButtons({
|
|
389
|
+
config,
|
|
384
390
|
disable: true,
|
|
385
391
|
placeOrderButtonSelector,
|
|
386
392
|
});
|
|
387
393
|
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
388
394
|
const observer = new MutationObserver(() => {
|
|
389
395
|
_a.disablePlaceOrderButtons({
|
|
396
|
+
config,
|
|
390
397
|
disable: true,
|
|
391
398
|
placeOrderButtonSelector,
|
|
392
399
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const logError = require('./logError-4e2f2020.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
9
|
-
const submitGtag = require('./submitGtag-
|
|
9
|
+
const submitGtag = require('./submitGtag-3a1d091e.js');
|
|
10
10
|
const getBorderRadius = require('./getBorderRadius-074b46ef.js');
|
|
11
11
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
12
12
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
|
-
const submitGtag = require('./submitGtag-
|
|
8
|
+
const submitGtag = require('./submitGtag-3a1d091e.js');
|
|
9
9
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
10
10
|
const logError = require('./logError-4e2f2020.js');
|
|
11
11
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -493,7 +493,9 @@ const ZonosCheckout = class {
|
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
|
-
|
|
496
|
+
if (!zonosStore.zonosStore.checkoutSettings.disablePlaceOrderButtonActivation) {
|
|
497
|
+
button.removeAttribute('disabled');
|
|
498
|
+
}
|
|
497
499
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
498
500
|
// if this button is the hidden button, trigger the click event
|
|
499
501
|
if (button.matches(this.domesticRedirectedBtnSelector)) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const logError = require('./logError-4e2f2020.js');
|
|
9
9
|
require('./isDarkColor-371a3b1a.js');
|
|
@@ -281,6 +281,7 @@ const ZonosController = class {
|
|
|
281
281
|
* Override country code for storybook
|
|
282
282
|
*/
|
|
283
283
|
async overrideCountry(countryCode) {
|
|
284
|
+
logError.log(`Override country code to ${countryCode}`);
|
|
284
285
|
void cart.localizationStoreUpdateSelectedCountryCode(countryCode);
|
|
285
286
|
}
|
|
286
287
|
/**
|
|
@@ -296,7 +297,7 @@ const ZonosController = class {
|
|
|
296
297
|
zonosStore.zonosStore.organizationName = organizationName;
|
|
297
298
|
}
|
|
298
299
|
render() {
|
|
299
|
-
return index.h(index.Host, { key: '
|
|
300
|
+
return index.h(index.Host, { key: 'd7af0426a1f93b8ec8b37ef73babe045bc2a7624', class: "zonos--elements" });
|
|
300
301
|
}
|
|
301
302
|
};
|
|
302
303
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./logError-4e2f2020.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-371a3b1a.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-11b47252.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const logError = require('./logError-4e2f2020.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-11b47252.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./logError-4e2f2020.js');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-11b47252.js');
|
|
9
9
|
const logError = require('./logError-4e2f2020.js');
|
|
10
10
|
require('./isDarkColor-371a3b1a.js');
|
|
11
11
|
require('./getBorderRadius-074b46ef.js');
|
|
@@ -224,7 +224,9 @@ export class ZonosCheckout {
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
|
-
|
|
227
|
+
if (!zonosStore.checkoutSettings.disablePlaceOrderButtonActivation) {
|
|
228
|
+
button.removeAttribute('disabled');
|
|
229
|
+
}
|
|
228
230
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
229
231
|
// if this button is the hidden button, trigger the click event
|
|
230
232
|
if (button.matches(this.domesticRedirectedBtnSelector)) {
|
|
@@ -163,6 +163,7 @@ export class ZonosController {
|
|
|
163
163
|
* Override country code for storybook
|
|
164
164
|
*/
|
|
165
165
|
async overrideCountry(countryCode) {
|
|
166
|
+
log(`Override country code to ${countryCode}`);
|
|
166
167
|
void localizationStoreUpdateSelectedCountryCode(countryCode);
|
|
167
168
|
}
|
|
168
169
|
/**
|
|
@@ -178,7 +179,7 @@ export class ZonosController {
|
|
|
178
179
|
zonosStore.organizationName = organizationName;
|
|
179
180
|
}
|
|
180
181
|
render() {
|
|
181
|
-
return h(Host, { key: '
|
|
182
|
+
return h(Host, { key: 'd7af0426a1f93b8ec8b37ef73babe045bc2a7624', class: "zonos--elements" });
|
|
182
183
|
}
|
|
183
184
|
static get is() { return "zonos-controller"; }
|
|
184
185
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,7 +99,7 @@ const addInternationalHideClass = () => {
|
|
|
99
99
|
};
|
|
100
100
|
const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
101
101
|
var _a, _b;
|
|
102
|
-
log(
|
|
102
|
+
log(`Updating selected country code to ${newSelectedCountryCode}`);
|
|
103
103
|
const isFirstTime = !localizationStore.selectedCountryCode;
|
|
104
104
|
localizationStore.selectedCountryCode = newSelectedCountryCode;
|
|
105
105
|
const { selectedCountryCode, shippingZoneCountries } = localizationStore;
|
|
@@ -108,12 +108,13 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
108
108
|
!!shippingZoneCountries[selectedCountryCode];
|
|
109
109
|
// update shippable country
|
|
110
110
|
localizationStore.isShippableCountry = !!isShippableCountry;
|
|
111
|
-
log(
|
|
111
|
+
log(`${localizationStore.selectedCountryCode} is shippable country: ${localizationStore.isShippableCountry}`);
|
|
112
112
|
addInternationalHideClass();
|
|
113
113
|
if (!selectedCountryCode) {
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
const currencyCode = getCurrencyCode(selectedCountryCode);
|
|
117
|
+
log({ currencyCode });
|
|
117
118
|
if (!currencyCode) {
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
@@ -102,7 +102,12 @@ Zonos.updateOrganizationName = (organizationName) => {
|
|
|
102
102
|
var _b;
|
|
103
103
|
void ((_b = _a.zonosController) === null || _b === void 0 ? void 0 : _b.updateOrganizationName(organizationName));
|
|
104
104
|
};
|
|
105
|
-
Zonos.disablePlaceOrderButtons = ({ autoEnable = true, disable, placeOrderButtonSelector, }) => {
|
|
105
|
+
Zonos.disablePlaceOrderButtons = ({ autoEnable = true, config, disable, placeOrderButtonSelector, }) => {
|
|
106
|
+
var _b;
|
|
107
|
+
// if disablePlaceOrderButtonActivation is true, do nothing
|
|
108
|
+
if ((_b = config.checkoutSettings) === null || _b === void 0 ? void 0 : _b.disablePlaceOrderButtonActivation) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
106
111
|
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
107
112
|
if (placeOrderButtonSelector) {
|
|
108
113
|
const placeOrderButton = document.querySelectorAll(placeOrderButtonSelector);
|
|
@@ -153,12 +158,14 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
153
158
|
if ((_b = config.checkoutSettings) === null || _b === void 0 ? void 0 : _b.placeOrderButtonSelector) {
|
|
154
159
|
const placeOrderButtonSelector = config.checkoutSettings.placeOrderButtonSelector;
|
|
155
160
|
_a.disablePlaceOrderButtons({
|
|
161
|
+
config,
|
|
156
162
|
disable: true,
|
|
157
163
|
placeOrderButtonSelector,
|
|
158
164
|
});
|
|
159
165
|
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
160
166
|
const observer = new MutationObserver(() => {
|
|
161
167
|
_a.disablePlaceOrderButtons({
|
|
168
|
+
config,
|
|
162
169
|
disable: true,
|
|
163
170
|
placeOrderButtonSelector,
|
|
164
171
|
});
|
|
@@ -7044,7 +7044,7 @@ const addInternationalHideClass = () => {
|
|
|
7044
7044
|
};
|
|
7045
7045
|
const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
7046
7046
|
var _a, _b;
|
|
7047
|
-
log(
|
|
7047
|
+
log(`Updating selected country code to ${newSelectedCountryCode}`);
|
|
7048
7048
|
const isFirstTime = !localizationStore.selectedCountryCode;
|
|
7049
7049
|
localizationStore.selectedCountryCode = newSelectedCountryCode;
|
|
7050
7050
|
const { selectedCountryCode, shippingZoneCountries } = localizationStore;
|
|
@@ -7053,12 +7053,13 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
7053
7053
|
!!shippingZoneCountries[selectedCountryCode];
|
|
7054
7054
|
// update shippable country
|
|
7055
7055
|
localizationStore.isShippableCountry = !!isShippableCountry;
|
|
7056
|
-
log(
|
|
7056
|
+
log(`${localizationStore.selectedCountryCode} is shippable country: ${localizationStore.isShippableCountry}`);
|
|
7057
7057
|
addInternationalHideClass();
|
|
7058
7058
|
if (!selectedCountryCode) {
|
|
7059
7059
|
return;
|
|
7060
7060
|
}
|
|
7061
7061
|
const currencyCode = getCurrencyCode(selectedCountryCode);
|
|
7062
|
+
log({ currencyCode });
|
|
7062
7063
|
if (!currencyCode) {
|
|
7063
7064
|
return;
|
|
7064
7065
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -245,9 +245,9 @@ const zonosLoadUrl = (() => {
|
|
|
245
245
|
}
|
|
246
246
|
return null;
|
|
247
247
|
})();
|
|
248
|
-
const ZONOS_URL = "https://v1.3.
|
|
249
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
250
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
248
|
+
const ZONOS_URL = "https://v1.3.33.js.zonos.com";
|
|
249
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.33";
|
|
250
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.33";
|
|
251
251
|
const MAIN_LOAD_CDN_TYPE = 'jsdelivr';
|
|
252
252
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
253
253
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
@@ -267,7 +267,7 @@ Zonos.isBigCommerce = false;
|
|
|
267
267
|
*/
|
|
268
268
|
Zonos.isNpm = true;
|
|
269
269
|
Zonos.zonosQaUrl = null;
|
|
270
|
-
Zonos.version = `v${"1.3.
|
|
270
|
+
Zonos.version = `v${"1.3.33"}`;
|
|
271
271
|
Zonos.modeAlerted = false;
|
|
272
272
|
Zonos.tempCartData = null;
|
|
273
273
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
@@ -326,7 +326,12 @@ Zonos.updateOrganizationName = (organizationName) => {
|
|
|
326
326
|
var _b;
|
|
327
327
|
void ((_b = _a.zonosController) === null || _b === void 0 ? void 0 : _b.updateOrganizationName(organizationName));
|
|
328
328
|
};
|
|
329
|
-
Zonos.disablePlaceOrderButtons = ({ autoEnable = true, disable, placeOrderButtonSelector, }) => {
|
|
329
|
+
Zonos.disablePlaceOrderButtons = ({ autoEnable = true, config, disable, placeOrderButtonSelector, }) => {
|
|
330
|
+
var _b;
|
|
331
|
+
// if disablePlaceOrderButtonActivation is true, do nothing
|
|
332
|
+
if ((_b = config.checkoutSettings) === null || _b === void 0 ? void 0 : _b.disablePlaceOrderButtonActivation) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
330
335
|
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
331
336
|
if (placeOrderButtonSelector) {
|
|
332
337
|
const placeOrderButton = document.querySelectorAll(placeOrderButtonSelector);
|
|
@@ -377,12 +382,14 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
377
382
|
if ((_b = config.checkoutSettings) === null || _b === void 0 ? void 0 : _b.placeOrderButtonSelector) {
|
|
378
383
|
const placeOrderButtonSelector = config.checkoutSettings.placeOrderButtonSelector;
|
|
379
384
|
_a.disablePlaceOrderButtons({
|
|
385
|
+
config,
|
|
380
386
|
disable: true,
|
|
381
387
|
placeOrderButtonSelector,
|
|
382
388
|
});
|
|
383
389
|
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
384
390
|
const observer = new MutationObserver(() => {
|
|
385
391
|
_a.disablePlaceOrderButtons({
|
|
392
|
+
config,
|
|
386
393
|
disable: true,
|
|
387
394
|
placeOrderButtonSelector,
|
|
388
395
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as handleFetch, d as cartStore, l as localizationStore } from './cart-
|
|
1
|
+
import { r as handleFetch, d as cartStore, l as localizationStore } from './cart-22ba08ec.js';
|
|
2
2
|
import { z as zonosStore } from './zonosStore-ba9e541e.js';
|
|
3
3
|
import { l as log } from './logError-c456c092.js';
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { h as stripeStore, l as localizationStore, t as translate } from './cart-
|
|
2
|
+
import { h as stripeStore, l as localizationStore, t as translate } from './cart-22ba08ec.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { a as logError } from './logError-c456c092.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { d as cartStore, B as currencyFormat, C as cartStoreHasOneEligibleItem, t as translate, r as handleFetch, p as stripeStoreReset, h as stripeStore, D as stripeStoreRetrievePayment, l as localizationStore, E as stripeStoreTranslateAddressToLatin, F as cartStoreUpdateSelectedShippingOption, G as cartStoreGetShippingTransitInfo } from './cart-
|
|
2
|
+
import { d as cartStore, B as currencyFormat, C as cartStoreHasOneEligibleItem, t as translate, r as handleFetch, p as stripeStoreReset, h as stripeStore, D as stripeStoreRetrievePayment, l as localizationStore, E as stripeStoreTranslateAddressToLatin, F as cartStoreUpdateSelectedShippingOption, G as cartStoreGetShippingTransitInfo } from './cart-22ba08ec.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
5
|
-
import { t as trackConversionEvent, s as sendErrorLog, a as submitGtag, c as createCustomEvent, g as getIsTestMode } from './submitGtag-
|
|
5
|
+
import { t as trackConversionEvent, s as sendErrorLog, a as submitGtag, c as createCustomEvent, g as getIsTestMode } from './submitGtag-1435eec8.js';
|
|
6
6
|
import { g as getBorderRadius } from './getBorderRadius-947c24de.js';
|
|
7
7
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
8
8
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-3b46f3c3.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as stripeStore, j as stripeStoreInitCheckoutSession, k as cartStoreUpdateToErrorState, t as translate, m as stripeStorePrefetchLandedCost, n as cartStoreNextStep, o as stripeStoreConfirmPayment, p as stripeStoreReset, q as localizationStoreOnUpdate } from './cart-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as stripeStore, j as stripeStoreInitCheckoutSession, k as cartStoreUpdateToErrorState, t as translate, m as stripeStorePrefetchLandedCost, n as cartStoreNextStep, o as stripeStoreConfirmPayment, p as stripeStoreReset, q as localizationStoreOnUpdate } from './cart-22ba08ec.js';
|
|
3
3
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-ba9e541e.js';
|
|
4
|
-
import { c as createCustomEvent, s as sendErrorLog, a as submitGtag, t as trackConversionEvent, g as getIsTestMode } from './submitGtag-
|
|
4
|
+
import { c as createCustomEvent, s as sendErrorLog, a as submitGtag, t as trackConversionEvent, g as getIsTestMode } from './submitGtag-1435eec8.js';
|
|
5
5
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
6
6
|
import { l as log, a as logError } from './logError-c456c092.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -489,7 +489,9 @@ const ZonosCheckout = class {
|
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
491
|
});
|
|
492
|
-
|
|
492
|
+
if (!zonosStore.checkoutSettings.disablePlaceOrderButtonActivation) {
|
|
493
|
+
button.removeAttribute('disabled');
|
|
494
|
+
}
|
|
493
495
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
494
496
|
// if this button is the hidden button, trigger the click event
|
|
495
497
|
if (button.matches(this.domesticRedirectedBtnSelector)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { r as handleFetch, u as isValidSelector, h as stripeStore, v as initLocalizationStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { r as handleFetch, u as isValidSelector, h as stripeStore, v as initLocalizationStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-22ba08ec.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
4
4
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
5
5
|
import './isDarkColor-f8324c10.js';
|
|
@@ -277,6 +277,7 @@ const ZonosController = class {
|
|
|
277
277
|
* Override country code for storybook
|
|
278
278
|
*/
|
|
279
279
|
async overrideCountry(countryCode) {
|
|
280
|
+
log(`Override country code to ${countryCode}`);
|
|
280
281
|
void localizationStoreUpdateSelectedCountryCode(countryCode);
|
|
281
282
|
}
|
|
282
283
|
/**
|
|
@@ -292,7 +293,7 @@ const ZonosController = class {
|
|
|
292
293
|
zonosStore.organizationName = organizationName;
|
|
293
294
|
}
|
|
294
295
|
render() {
|
|
295
|
-
return h(Host, { key: '
|
|
296
|
+
return h(Host, { key: 'd7af0426a1f93b8ec8b37ef73babe045bc2a7624', class: "zonos--elements" });
|
|
296
297
|
}
|
|
297
298
|
};
|
|
298
299
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-22ba08ec.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './logError-c456c092.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { a as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-22ba08ec.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-f8324c10.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { l as localizationStore, B as currencyFormat, t as translate } from './cart-
|
|
2
|
+
import { l as localizationStore, B as currencyFormat, t as translate } from './cart-22ba08ec.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-ba9e541e.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-3b46f3c3.js';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-ba9e541e.js';
|
|
3
|
-
import { r as handleFetch, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-
|
|
3
|
+
import { r as handleFetch, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-22ba08ec.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { H as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { H as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-22ba08ec.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
5
|
import './logError-c456c092.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
2
|
import { d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { h as stripeStore } from './cart-
|
|
4
|
+
import { h as stripeStore } from './cart-22ba08ec.js';
|
|
5
5
|
import { a as logError } from './logError-c456c092.js';
|
|
6
6
|
import './isDarkColor-f8324c10.js';
|
|
7
7
|
import './getBorderRadius-947c24de.js';
|