@zonos/elements 1.3.81 → 1.3.83
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-97e693e4.js → cart-4de3faca.js} +798 -74
- package/dist/cjs/{createCustomEvent-777b3fa7.js → createCustomEvent-65331eae.js} +1 -3
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-16029169.js → paypal-370b3a10.js} +1 -1
- package/dist/cjs/{zonos-address_8.cjs.entry.js → zonos-address_7.cjs.entry.js} +9 -64
- package/dist/cjs/zonos-badge.cjs.entry.js +44 -0
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card.cjs.entry.js +4 -4
- package/dist/cjs/{zonos-badge_13.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +135 -80
- package/dist/cjs/zonos-checkout.cjs.entry.js +5 -5
- package/dist/cjs/zonos-collapse.cjs.entry.js +62 -0
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -9
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +1 -11
- package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +10 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +89 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/assets/ChevronUpIcon.svg +23 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +55 -9
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +52 -12
- package/dist/collection/components/common/zonos-badge/assets/RemoveLineIcon.svg +3 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.css +3 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +43 -3
- package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
- package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +8 -7
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +20 -27
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +45 -11
- package/dist/collection/components/store/checkout/stripe.js +119 -65
- package/dist/collection/components/store/translationStore/strings.arabic.js +30 -0
- package/dist/collection/components/store/translationStore/strings.base.js +30 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +30 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +30 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +30 -0
- package/dist/collection/components/store/translationStore/strings.french.js +30 -0
- package/dist/collection/components/store/translationStore/strings.german.js +30 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +30 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +30 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +30 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +30 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +30 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +30 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +30 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +30 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +30 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +30 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +30 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +30 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +30 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +22 -0
- package/dist/collection/components/utils/api/trackConversionEvent.js +0 -2
- package/dist/collection/components/utils/api/triggerBuildLandedCost.js +1 -0
- package/dist/collection/components/utils/checkout/{sortServiceLevelOptions.js → sortServiceLevelOptionsByAmount.js} +1 -1
- package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +1 -1
- package/dist/esm/{cart-9bf6dece.js → cart-bdc45f59.js} +795 -75
- package/dist/esm/{createCustomEvent-a18e45a2.js → createCustomEvent-4db13122.js} +1 -3
- package/dist/esm/index.js +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-edab4cee.js → paypal-1b29d424.js} +1 -1
- package/dist/esm/{zonos-address_8.entry.js → zonos-address_7.entry.js} +10 -64
- package/dist/esm/zonos-badge.entry.js +40 -0
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card.entry.js +4 -4
- package/dist/esm/{zonos-badge_13.entry.js → zonos-cart-items_12.entry.js} +137 -81
- package/dist/esm/zonos-checkout.entry.js +5 -5
- package/dist/esm/zonos-collapse.entry.js +58 -0
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +9 -9
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +5 -5
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +4 -4
- package/dist/esm/zonos-shipping-rich-radio.entry.js +1 -11
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/cart-bdc45f59.js +1 -0
- package/dist/esm-es5/{createCustomEvent-a18e45a2.js → createCustomEvent-4db13122.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-edab4cee.js → paypal-1b29d424.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -0
- package/dist/esm-es5/zonos-badge.entry.js +1 -0
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -0
- package/dist/esm-es5/zonos-component.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-elements.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-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/scripts/index.d.ts +542 -494
- 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/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.d.ts +12 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.d.ts +4 -1
- package/dist/types/components/common/zonos-badge/zonos-badge.d.ts +9 -0
- package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +2 -6
- package/dist/types/components/store/checkout/cart.d.ts +16 -7
- package/dist/types/components/store/checkout/stripe.d.ts +12 -2
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +30 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +30 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +1 -0
- package/dist/types/components/utils/checkout/sortServiceLevelOptionsByAmount.d.ts +6 -0
- package/dist/types/components.d.ts +44 -8
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +2 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +12 -0
- package/dist/types/types/generated/graphql.internal.types.ts +9 -0
- package/dist/zonos-elements/assets/ChevronUpIcon.svg +23 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-8cbbdd53.system.entry.js → p-00bb8221.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e468f85e.entry.js → p-017bf338.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b8c8e0c.system.entry.js → p-01d11845.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0cc8c6a3.system.js +1 -0
- package/dist/zonos-elements/p-1a92ff9a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-92ba4082.system.entry.js → p-2140ccb4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8dae668f.system.entry.js → p-2183128a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1e4f7997.system.entry.js → p-22e81fee.system.entry.js} +1 -1
- package/dist/zonos-elements/p-278d61ed.js +1 -0
- package/dist/zonos-elements/p-2b60faf8.entry.js +1 -0
- package/dist/zonos-elements/p-2d2ff962.entry.js +1 -0
- package/dist/zonos-elements/{p-bc4a147d.entry.js → p-3347e142.entry.js} +1 -1
- package/dist/zonos-elements/{p-811ed9bf.system.entry.js → p-3457c5e8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a47d2cc.system.entry.js → p-38886017.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-41f42a5c.entry.js → p-42636c5a.entry.js} +1 -1
- package/dist/zonos-elements/p-4abca0e9.system.entry.js +1 -0
- package/dist/zonos-elements/{p-e3cb74fd.system.js → p-4ec7afc5.system.js} +1 -1
- package/dist/zonos-elements/{p-25633055.entry.js → p-58832515.entry.js} +1 -1
- package/dist/zonos-elements/{p-19fc5e11.system.entry.js → p-5d186fc7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a2fedd1c.entry.js → p-5fb337a0.entry.js} +1 -1
- package/dist/zonos-elements/{p-f3fc05a8.entry.js → p-6a5d714a.entry.js} +1 -1
- package/dist/zonos-elements/{p-fca6f444.entry.js → p-6a83b682.entry.js} +1 -1
- package/dist/zonos-elements/{p-97f0d9d2.entry.js → p-6aa35f18.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3200d5c.entry.js → p-771e2623.entry.js} +1 -1
- package/dist/zonos-elements/{p-7ca0622f.js → p-7cc5e325.js} +1 -1
- package/dist/zonos-elements/p-7f3aeb53.system.entry.js +1 -0
- package/dist/zonos-elements/p-844ec9f9.system.entry.js +1 -0
- package/dist/zonos-elements/p-9931bea7.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7be7bd28.entry.js → p-997c8f07.entry.js} +1 -1
- package/dist/zonos-elements/{p-fac38f60.entry.js → p-9b911f6f.entry.js} +1 -1
- package/dist/zonos-elements/{p-95f0ffd1.system.entry.js → p-9cfa3736.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-49478dba.system.js → p-a1fa0a1c.system.js} +1 -1
- package/dist/zonos-elements/{p-df4deb97.entry.js → p-a34f0674.entry.js} +1 -1
- package/dist/zonos-elements/{p-d26d827d.system.js → p-a6cff57f.system.js} +1 -1
- package/dist/zonos-elements/{p-a3e2592b.system.entry.js → p-ae7526a2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6de38759.entry.js → p-afad2fae.entry.js} +1 -1
- package/dist/zonos-elements/{p-264fbd27.entry.js → p-b0303b0e.entry.js} +1 -1
- package/dist/zonos-elements/{p-a033685e.system.entry.js → p-c2b7b670.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d775bd42.entry.js → p-c6350880.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/p-ce41cbde.js +1 -0
- package/dist/zonos-elements/p-cec3e1ed.entry.js +1 -0
- package/dist/zonos-elements/{p-ba05f1d6.system.entry.js → p-d621f462.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f7b5ae86.system.entry.js → p-e3df5ff6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f4765417.entry.js → p-e93b511f.entry.js} +1 -1
- package/dist/zonos-elements/{p-747eed39.entry.js → p-ea68ee1f.entry.js} +1 -1
- package/dist/zonos-elements/{p-51f8c3d5.system.entry.js → p-f1d043ad.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f1e452e1.entry.js +1 -0
- package/dist/zonos-elements/{p-de93cc65.system.entry.js → p-f68c38d8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d56f87ab.system.entry.js → p-f7bbdd0c.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-9bf6dece.js +0 -1
- package/dist/esm-es5/zonos-address_8.entry.js +0 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +0 -1
- package/dist/types/components/utils/checkout/sortServiceLevelOptions.d.ts +0 -5
- package/dist/zonos-elements/p-214724f8.system.entry.js +0 -1
- package/dist/zonos-elements/p-23358611.js +0 -1
- package/dist/zonos-elements/p-62044821.system.js +0 -1
- package/dist/zonos-elements/p-6b4fec5a.js +0 -1
- package/dist/zonos-elements/p-6f821997.entry.js +0 -1
- package/dist/zonos-elements/p-a1c5c1a2.entry.js +0 -1
- package/dist/zonos-elements/p-d08ed3ea.system.entry.js +0 -1
- package/dist/zonos-elements/p-f4667002.system.entry.js +0 -1
package/dist/scripts/index.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ import { BrowserOptions } from '@sentry/browser';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
|
|
6
6
|
|
|
7
|
+
declare const adjustmentSource: {
|
|
8
|
+
readonly ApiRequest: "API_REQUEST";
|
|
9
|
+
readonly PromoCode: "PROMO_CODE";
|
|
10
|
+
};
|
|
11
|
+
type AdjustmentSource = (typeof adjustmentSource)[keyof typeof adjustmentSource];
|
|
7
12
|
declare const analyticsProviderStatus: {
|
|
8
13
|
readonly Disabled: "DISABLED";
|
|
9
14
|
readonly Enabled: "ENABLED";
|
|
@@ -715,6 +720,10 @@ type CalculateLandedCostMutation = {
|
|
|
715
720
|
discounts: number | null;
|
|
716
721
|
} | null;
|
|
717
722
|
appliedAdjustments: Array<{
|
|
723
|
+
adjustment: {
|
|
724
|
+
name: string | null;
|
|
725
|
+
source: AdjustmentSource | null;
|
|
726
|
+
} | null;
|
|
718
727
|
amount: number;
|
|
719
728
|
item: {
|
|
720
729
|
amount: number;
|
|
@@ -941,130 +950,445 @@ type GetOrderQuery = {
|
|
|
941
950
|
} | null;
|
|
942
951
|
};
|
|
943
952
|
|
|
944
|
-
type
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
953
|
+
type TabItem = {
|
|
954
|
+
index: number;
|
|
955
|
+
isDone: boolean;
|
|
956
|
+
label: 'Customer' | 'Delivery' | 'Payment';
|
|
957
|
+
value: 'customer-info' | 'shipping' | 'payment';
|
|
949
958
|
};
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.ZodString;
|
|
959
|
-
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.ZodString;
|
|
960
|
-
NEXT_PUBLIC_ZONOS_ROUTE_URL: z.ZodString;
|
|
961
|
-
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: z.ZodString;
|
|
962
|
-
}, "strip", z.ZodTypeAny, {
|
|
963
|
-
NEXT_PUBLIC_FLAG_URL: string;
|
|
964
|
-
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
965
|
-
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
966
|
-
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
967
|
-
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
968
|
-
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
969
|
-
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
970
|
-
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
971
|
-
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
972
|
-
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
973
|
-
}, {
|
|
974
|
-
NEXT_PUBLIC_FLAG_URL: string;
|
|
975
|
-
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
976
|
-
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
977
|
-
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
978
|
-
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
979
|
-
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
980
|
-
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
981
|
-
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
982
|
-
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
983
|
-
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
984
|
-
}>;
|
|
985
|
-
interface Env extends z.infer<typeof envClientSchema> {
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
/* eslint-disable no-relative-import-paths/no-relative-import-paths */
|
|
989
|
-
|
|
990
|
-
declare global {
|
|
991
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
992
|
-
interface Document {
|
|
993
|
-
addEventListener<K extends keyof CustomEventMap>(
|
|
994
|
-
type: K,
|
|
995
|
-
listener: (this: Document, ev: CustomEvent<CustomEventMap[K]>) => void,
|
|
996
|
-
): void;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1000
|
-
interface Window {
|
|
1001
|
-
Sentry?: {
|
|
1002
|
-
init: (config: BrowserOptions) => void;
|
|
1003
|
-
};
|
|
1004
|
-
Stripe?: StripeConstructor;
|
|
1005
|
-
Zonos: Zonos;
|
|
1006
|
-
/**
|
|
1007
|
-
* A flag to determine if the current page is a BigCommerce page
|
|
1008
|
-
*/
|
|
1009
|
-
bcConfig?: unknown;
|
|
1010
|
-
/**
|
|
1011
|
-
* A flag to determine if the current page is a BigCommerce page
|
|
1012
|
-
*/
|
|
1013
|
-
stencilBootstrap?: unknown;
|
|
1014
|
-
sentryOnLoad?: () => void;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
namespace NodeJS {
|
|
1018
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1019
|
-
interface ProcessEnv extends Env {}
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
type TranslatedText = {
|
|
1024
|
-
[key: string]: string;
|
|
959
|
+
type TabItems = Record<TabItem['value'], TabItem>;
|
|
960
|
+
type ItemMeasurement = {
|
|
961
|
+
/** Indicates what type of `Measurement`, e.g. weight, specific dim unit. */
|
|
962
|
+
type: ItemMeasurementType;
|
|
963
|
+
/** Indicates the `Measurement` units to be used. */
|
|
964
|
+
unitOfMeasure: ItemUnitOfMeasure;
|
|
965
|
+
/** The `Measurement` value. */
|
|
966
|
+
value: number;
|
|
1025
967
|
};
|
|
1026
|
-
type
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
968
|
+
type CartItem = {
|
|
969
|
+
amount: number;
|
|
970
|
+
attributes?: {
|
|
971
|
+
key: string;
|
|
972
|
+
value: string;
|
|
973
|
+
}[];
|
|
974
|
+
countryOfOrigin?: CountryCode;
|
|
975
|
+
currencyCode: CurrencyCode;
|
|
976
|
+
description?: string;
|
|
977
|
+
hsCode?: string;
|
|
978
|
+
imageUrl?: string;
|
|
979
|
+
itemType?: ItemType;
|
|
980
|
+
measurements?: ItemMeasurement[];
|
|
981
|
+
metadata?: {
|
|
982
|
+
key: string;
|
|
983
|
+
value: string;
|
|
984
|
+
}[];
|
|
1032
985
|
name: string;
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
986
|
+
productId?: string;
|
|
987
|
+
quantity: number;
|
|
988
|
+
sku?: string;
|
|
1036
989
|
};
|
|
1037
|
-
|
|
1038
|
-
|
|
990
|
+
|
|
991
|
+
type CalculateLandedCostAdjustmentInput = {
|
|
992
|
+
amount: number;
|
|
993
|
+
productId: string | null;
|
|
994
|
+
promoCode?: string | null;
|
|
995
|
+
sku: string | null;
|
|
996
|
+
type: LandedCostAdjustmentType;
|
|
1039
997
|
};
|
|
1040
|
-
type
|
|
1041
|
-
|
|
998
|
+
type CalculateLandedCostRequest = {
|
|
999
|
+
billingAddress: {
|
|
1000
|
+
addressLine1: string;
|
|
1001
|
+
addressLine2?: string | undefined;
|
|
1002
|
+
city: string;
|
|
1003
|
+
country: CountryCode;
|
|
1004
|
+
postalCode: string;
|
|
1005
|
+
state: string;
|
|
1006
|
+
};
|
|
1007
|
+
billingContact: {
|
|
1008
|
+
firstName: string;
|
|
1009
|
+
lastName: string;
|
|
1010
|
+
phone: string;
|
|
1011
|
+
};
|
|
1012
|
+
checkoutSessionId: string;
|
|
1013
|
+
contact: {
|
|
1014
|
+
email?: string;
|
|
1015
|
+
firstName: string;
|
|
1016
|
+
lastName: string;
|
|
1017
|
+
phone: string;
|
|
1018
|
+
};
|
|
1019
|
+
items: CartItem[];
|
|
1020
|
+
landedCostAdjustments?: CalculateLandedCostAdjustmentInput[];
|
|
1021
|
+
metadata?: {
|
|
1022
|
+
key: string;
|
|
1023
|
+
value: string;
|
|
1024
|
+
}[];
|
|
1025
|
+
shippingAddress: {
|
|
1026
|
+
addressLine1: string;
|
|
1027
|
+
addressLine2?: string | undefined;
|
|
1028
|
+
city: string;
|
|
1029
|
+
country: CountryCode;
|
|
1030
|
+
postalCode: string;
|
|
1031
|
+
state: string;
|
|
1032
|
+
};
|
|
1042
1033
|
};
|
|
1043
1034
|
|
|
1044
|
-
type
|
|
1045
|
-
billingAddress:
|
|
1046
|
-
|
|
1035
|
+
type BuildLandedCostParams = {
|
|
1036
|
+
billingAddress: CalculateLandedCostRequest['billingAddress'];
|
|
1037
|
+
billingContact: CalculateLandedCostRequest['billingContact'];
|
|
1038
|
+
checkoutSessionId: string;
|
|
1039
|
+
contact: CalculateLandedCostRequest['contact'];
|
|
1040
|
+
landedCostAdjustments?: CalculateLandedCostRequest['landedCostAdjustments'];
|
|
1041
|
+
shippingAddress: CalculateLandedCostRequest['shippingAddress'];
|
|
1042
|
+
zonosApiRoute: string;
|
|
1047
1043
|
};
|
|
1044
|
+
type BuildLandedCostResponse = (CalculateLandedCostMutation & {
|
|
1045
|
+
errors?: {
|
|
1046
|
+
message: string;
|
|
1047
|
+
}[];
|
|
1048
|
+
}) | null;
|
|
1048
1049
|
|
|
1049
|
-
|
|
1050
|
-
declare const colorContrasts: readonly ["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000"];
|
|
1051
|
-
type ColorContrast = (typeof colorContrasts)[number];
|
|
1052
|
-
type ColorPrefix = (typeof colorPrefixes)[number];
|
|
1053
|
-
type Color = 'gray-0' | 'gray-50' | 'glass-0' | 'glass-50' | `${ColorPrefix}-${ColorContrast}` | 'gray-1100' | 'gray-1200' | 'glass-1100' | 'glass-1200';
|
|
1054
|
-
declare const checkboxColorPrefix: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray"];
|
|
1055
|
-
type CheckboxColorPrefix = (typeof checkboxColorPrefix)[number];
|
|
1056
|
-
|
|
1057
|
-
type BannerIntent = 'default' | 'error' | 'success' | 'warning' | 'info';
|
|
1050
|
+
type ZonosOrder = GetOrderQuery['order'];
|
|
1058
1051
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1052
|
+
type BuildCardDetailParams = {
|
|
1053
|
+
countryCode: CountryCode;
|
|
1054
|
+
currencyCode: CurrencyCode;
|
|
1055
|
+
};
|
|
1056
|
+
type CheckoutConfig = {
|
|
1057
|
+
/**
|
|
1058
|
+
* Validate address to allow specific character sets
|
|
1059
|
+
* @default ALL
|
|
1060
|
+
*/
|
|
1061
|
+
allowedCharacterSets?: 'ALL' | 'LATIN';
|
|
1062
|
+
analyticsProviders: Array<{
|
|
1063
|
+
status: AnalyticsProviderStatus;
|
|
1064
|
+
type: AnalyticsProviderType;
|
|
1065
|
+
}>;
|
|
1066
|
+
/**
|
|
1067
|
+
* @default false - when false, we disable the place order button until the script is loaded
|
|
1068
|
+
* @note if set to true, we will not enable or disable the place order button
|
|
1069
|
+
*/
|
|
1070
|
+
disablePlaceOrderButtonActivation?: boolean;
|
|
1071
|
+
externalPaymentMethods: Array<{
|
|
1072
|
+
status: ExternalPaymentMethodStatus;
|
|
1073
|
+
type: ExternalPaymentMethodType;
|
|
1074
|
+
}> | null;
|
|
1075
|
+
externalServiceTokens: {
|
|
1076
|
+
token: string;
|
|
1077
|
+
type: ExternalServiceTokenType;
|
|
1078
|
+
}[];
|
|
1079
|
+
/**
|
|
1080
|
+
* Test mode for checkout (sandbox or production)
|
|
1081
|
+
* @default TEST
|
|
1082
|
+
*/
|
|
1083
|
+
mode: Mode;
|
|
1084
|
+
orderNotifications: {
|
|
1085
|
+
abandonedCart: {
|
|
1086
|
+
delay: number;
|
|
1087
|
+
discountPercent: number;
|
|
1088
|
+
status: {
|
|
1089
|
+
active: NotificationActiveStatus;
|
|
1090
|
+
sendCopiesTo: Array<string>;
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
orderCancelled: {
|
|
1094
|
+
active: NotificationActiveStatus;
|
|
1095
|
+
sendCopiesTo: Array<string>;
|
|
1096
|
+
};
|
|
1097
|
+
orderConfirmation: {
|
|
1098
|
+
active: NotificationActiveStatus;
|
|
1099
|
+
sendCopiesTo: Array<string>;
|
|
1100
|
+
} | null;
|
|
1101
|
+
orderShipped: {
|
|
1102
|
+
active: NotificationActiveStatus;
|
|
1103
|
+
sendCopiesTo: Array<string>;
|
|
1104
|
+
};
|
|
1065
1105
|
};
|
|
1066
|
-
|
|
1067
|
-
|
|
1106
|
+
organization: string;
|
|
1107
|
+
placeOrderButtonSelector: string | null;
|
|
1108
|
+
/**
|
|
1109
|
+
* @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
|
|
1110
|
+
*
|
|
1111
|
+
* **NOTE: this value can't be overridden in Zonos.init**
|
|
1112
|
+
*/
|
|
1113
|
+
subscriptionStatus: CheckoutSubscriptionStatus;
|
|
1114
|
+
successBehavior: CheckoutSuccessBehavior;
|
|
1115
|
+
/**
|
|
1116
|
+
* The success page action text for checkout.
|
|
1117
|
+
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
1118
|
+
*/
|
|
1119
|
+
successPageActionText?: string;
|
|
1120
|
+
/**
|
|
1121
|
+
* The success page subtitle text for checkout. Each item in the array will appear on a new line.
|
|
1122
|
+
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
1123
|
+
*/
|
|
1124
|
+
successPageSubtitleText?: string[];
|
|
1125
|
+
/**
|
|
1126
|
+
* The success page title text for checkout.
|
|
1127
|
+
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
1128
|
+
*/
|
|
1129
|
+
successPageTitleText?: string;
|
|
1130
|
+
successRedirectUrl: string;
|
|
1131
|
+
visibilityStatus: CheckoutVisibilityStatus;
|
|
1132
|
+
/**
|
|
1133
|
+
* Cart info callback for checkout (optional),
|
|
1134
|
+
* @deprecated
|
|
1135
|
+
* @note
|
|
1136
|
+
* This function is deprecated in favor of new API `createCartId`
|
|
1137
|
+
* @note will attempt to use cart data if available
|
|
1138
|
+
* User can dispatch an event 'zonos--init-cart-info' to update the cart
|
|
1139
|
+
* @example
|
|
1140
|
+
* const initEvent = new CustomEvent<CartItem[]>('zonos--init-cart-info', {
|
|
1141
|
+
* detail: cartItems,
|
|
1142
|
+
* });
|
|
1143
|
+
* document.body.dispatchEvent(initEvent);
|
|
1144
|
+
* @returns {object[]} - object with the the item info to be added to cart:
|
|
1145
|
+
* - amount: number;
|
|
1146
|
+
* - countryOfOrigin?: string;
|
|
1147
|
+
* - currencyCode: string;
|
|
1148
|
+
* - description?: string;
|
|
1149
|
+
* - hsCode?: string;
|
|
1150
|
+
* - imageUrl?: string;
|
|
1151
|
+
* - name: string;
|
|
1152
|
+
* - productId?: string;
|
|
1153
|
+
* - quantity: number;
|
|
1154
|
+
*/
|
|
1155
|
+
buildCartDetail?: (params: BuildCardDetailParams) => Promise<CartItem[]>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Calculate landed cost callback for checkout (optional)
|
|
1158
|
+
* @deprecated
|
|
1159
|
+
* @note
|
|
1160
|
+
* This function is deprecated in favor of new API `createCartId`
|
|
1161
|
+
* @note will attempt to use cart data if available
|
|
1162
|
+
*/
|
|
1163
|
+
buildLandedCost?: (params: BuildLandedCostParams) => Promise<BuildLandedCostResponse>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Callback that returns the cart id from `cartCreate` mutation.
|
|
1166
|
+
* @note
|
|
1167
|
+
* The mutation `cartCreate` is preferred to be called in the server side
|
|
1168
|
+
* @returns string - Cart ID
|
|
1169
|
+
*/
|
|
1170
|
+
createCartId?: () => Promise<string> | string;
|
|
1171
|
+
/**
|
|
1172
|
+
* Callback trigger when the checkout is closed
|
|
1173
|
+
*/
|
|
1174
|
+
onClose?: () => void;
|
|
1175
|
+
/**
|
|
1176
|
+
* This callback is optional. If provided, it will be called right before the payment is processed.
|
|
1177
|
+
* @param items - The cart items.
|
|
1178
|
+
* @returns {string | null} - The error message to display to the user. If the message is empty or null, the payment will proceed.
|
|
1179
|
+
* @example
|
|
1180
|
+
* onInventoryCheck: async ({ items }) => {
|
|
1181
|
+
* // Check if all items are available from the server. If the fetch is throwing an error, we will show a generic error message "Unable to check inventory. Please try again.".
|
|
1182
|
+
* const itemsInfo = await fetch('https://yourserver.com/api/get-available-items', {
|
|
1183
|
+
* method: 'POST',
|
|
1184
|
+
* body: JSON.stringify({ items }),
|
|
1185
|
+
* });
|
|
1186
|
+
* const items = await itemsInfo.json();
|
|
1187
|
+
* // Filter out unavailable items.
|
|
1188
|
+
* const unavailableItems = items.filter(item => !item.available);
|
|
1189
|
+
* if (unavailableItems.length) {
|
|
1190
|
+
* // Display an error message to the user.
|
|
1191
|
+
* return `The following items are not available: ${unavailableItems.map(item => item.name).join(', ')}`;
|
|
1192
|
+
* }
|
|
1193
|
+
* // Proceed with the payment if you return an empty string or null.
|
|
1194
|
+
* return '';
|
|
1195
|
+
* }
|
|
1196
|
+
*/
|
|
1197
|
+
onInventoryCheck?: (params: {
|
|
1198
|
+
items: CartItem[];
|
|
1199
|
+
}) => Promise<string | null>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Callback trigger when payment succeeds
|
|
1202
|
+
*/
|
|
1203
|
+
onOrderSuccess?: (props: {
|
|
1204
|
+
zonosApiRoute: string;
|
|
1205
|
+
zonosOrder: ZonosOrder;
|
|
1206
|
+
}) => Promise<void>;
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
|
|
1210
|
+
type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
1211
|
+
type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
1212
|
+
type HelloConfig = {
|
|
1213
|
+
anchorElementSelector: string;
|
|
1214
|
+
cartUrlPattern: string | null;
|
|
1215
|
+
/**
|
|
1216
|
+
* The behavior to use when determining the country to use for the user.
|
|
1217
|
+
* @default 'URL_PARAM'
|
|
1218
|
+
*/
|
|
1219
|
+
countryOverrideBehavior?: CountryOverrideBehavior;
|
|
1220
|
+
currencyBehavior: HelloCurrencyBehavior;
|
|
1221
|
+
currencyElementSelector: string;
|
|
1222
|
+
desktopLocation?: HelloMobileLocation | null;
|
|
1223
|
+
excludedUrlPatterns: Array<string>;
|
|
1224
|
+
homepageUrlPattern: string | null;
|
|
1225
|
+
mobileLocation: HelloMobileLocation | null;
|
|
1226
|
+
mode: Mode;
|
|
1227
|
+
organization: string;
|
|
1228
|
+
peekMessageBehavior: HelloPeekMessageBehavior;
|
|
1229
|
+
peekMessageDelay: number;
|
|
1230
|
+
productAddToCartElementSelector: string | null;
|
|
1231
|
+
productDescriptionElementSelector: string | null;
|
|
1232
|
+
productDetailUrlPattern: string | null;
|
|
1233
|
+
productListUrlPattern: string | null;
|
|
1234
|
+
productTitleElementSelector: string | null;
|
|
1235
|
+
restrictionBehavior: HelloRestrictionBehavior;
|
|
1236
|
+
/**
|
|
1237
|
+
* The countries to include in the country list dropdown of the Hello widget.
|
|
1238
|
+
* @default ONLY_SHIPPABLE
|
|
1239
|
+
*/
|
|
1240
|
+
showCountryList?: ShowCountryList;
|
|
1241
|
+
/**
|
|
1242
|
+
* The countries to show the widget for.
|
|
1243
|
+
* @default ONLY_SHIPPABLE
|
|
1244
|
+
*/
|
|
1245
|
+
showForCountries?: ShowForCountries;
|
|
1246
|
+
visibilityStatus?: 'ENABLED' | 'DISABLED';
|
|
1247
|
+
/**
|
|
1248
|
+
* Callback function to run after the Hello widget has been initialized. This should be triggered only once when hello is attached to the DOM.
|
|
1249
|
+
* **Note**: If hello is detached from the DOM and reattached, this callback will be called again.
|
|
1250
|
+
* @param params - The parameters containing the country code and currency code that hello is initialized with.
|
|
1251
|
+
*/
|
|
1252
|
+
onInitSuccess?: (params: {
|
|
1253
|
+
countryCode: CountryCode;
|
|
1254
|
+
currencyCode: CurrencyCode;
|
|
1255
|
+
}) => Promise<void>;
|
|
1256
|
+
};
|
|
1257
|
+
|
|
1258
|
+
type AppearanceConfig = {
|
|
1259
|
+
colorPrimary?: string;
|
|
1260
|
+
colorSecondary?: string;
|
|
1261
|
+
fontFamily: string;
|
|
1262
|
+
logoUrl: string;
|
|
1263
|
+
style: ElementsUiStyle;
|
|
1264
|
+
theme: ElementsUiTheme;
|
|
1265
|
+
zonosAttribution: ZonosAttribution | null;
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1268
|
+
type CustomEventMap = {
|
|
1269
|
+
legacyCheckoutError: string;
|
|
1270
|
+
'zonos-checkout-success': {
|
|
1271
|
+
message: string;
|
|
1272
|
+
};
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
declare const envClientSchema: z.ZodObject<{
|
|
1276
|
+
NEXT_PUBLIC_FLAG_URL: z.ZodString;
|
|
1277
|
+
NEXT_PUBLIC_RELEASE_DATE: z.ZodString;
|
|
1278
|
+
NEXT_PUBLIC_ZONOS_API_KEY: z.ZodString;
|
|
1279
|
+
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: z.ZodString;
|
|
1280
|
+
NEXT_PUBLIC_ZONOS_CDN_URL: z.ZodString;
|
|
1281
|
+
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: z.ZodString;
|
|
1282
|
+
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.ZodString;
|
|
1283
|
+
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.ZodString;
|
|
1284
|
+
NEXT_PUBLIC_ZONOS_ROUTE_URL: z.ZodString;
|
|
1285
|
+
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: z.ZodString;
|
|
1286
|
+
}, "strip", z.ZodTypeAny, {
|
|
1287
|
+
NEXT_PUBLIC_FLAG_URL: string;
|
|
1288
|
+
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
1289
|
+
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
1290
|
+
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
1291
|
+
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
1292
|
+
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
1293
|
+
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
1294
|
+
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
1295
|
+
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
1296
|
+
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
1297
|
+
}, {
|
|
1298
|
+
NEXT_PUBLIC_FLAG_URL: string;
|
|
1299
|
+
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
1300
|
+
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
1301
|
+
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
1302
|
+
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
1303
|
+
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
1304
|
+
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
1305
|
+
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
1306
|
+
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
1307
|
+
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
1308
|
+
}>;
|
|
1309
|
+
interface Env extends z.infer<typeof envClientSchema> {
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/* eslint-disable no-relative-import-paths/no-relative-import-paths */
|
|
1313
|
+
|
|
1314
|
+
declare global {
|
|
1315
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1316
|
+
interface Document {
|
|
1317
|
+
addEventListener<K extends keyof CustomEventMap>(
|
|
1318
|
+
type: K,
|
|
1319
|
+
listener: (this: Document, ev: CustomEvent<CustomEventMap[K]>) => void,
|
|
1320
|
+
): void;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1324
|
+
interface Window {
|
|
1325
|
+
Sentry?: {
|
|
1326
|
+
init: (config: BrowserOptions) => void;
|
|
1327
|
+
};
|
|
1328
|
+
Stripe?: StripeConstructor;
|
|
1329
|
+
Zonos: Zonos;
|
|
1330
|
+
/**
|
|
1331
|
+
* A flag to determine if the current page is a BigCommerce page
|
|
1332
|
+
*/
|
|
1333
|
+
bcConfig?: unknown;
|
|
1334
|
+
/**
|
|
1335
|
+
* A flag to determine if the current page is a BigCommerce page
|
|
1336
|
+
*/
|
|
1337
|
+
stencilBootstrap?: unknown;
|
|
1338
|
+
sentryOnLoad?: () => void;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
namespace NodeJS {
|
|
1342
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1343
|
+
interface ProcessEnv extends Env {}
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
type TranslatedText = {
|
|
1348
|
+
[key: string]: string;
|
|
1349
|
+
};
|
|
1350
|
+
type EnteredInfo = {
|
|
1351
|
+
city: string;
|
|
1352
|
+
country: CountryCode;
|
|
1353
|
+
email: string;
|
|
1354
|
+
line1: string;
|
|
1355
|
+
line2: string;
|
|
1356
|
+
name: string;
|
|
1357
|
+
phone: string;
|
|
1358
|
+
postal_code: string;
|
|
1359
|
+
state: string;
|
|
1360
|
+
};
|
|
1361
|
+
type ValidateAddressFields = Omit<StripeAddressElementChangeEvent['value']['address'], 'country'> & {
|
|
1362
|
+
name: string;
|
|
1363
|
+
};
|
|
1364
|
+
type TranslatedAddressObject = {
|
|
1365
|
+
[key in keyof ValidateAddressFields]?: TranslatedText;
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
type SubmitEventData = {
|
|
1369
|
+
billingAddress: Record<keyof TranslatedAddressObject, string> | null;
|
|
1370
|
+
shippingAddress: Record<keyof TranslatedAddressObject, string>;
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
declare const colorPrefixes: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray", "glass"];
|
|
1374
|
+
declare const colorContrasts: readonly ["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000"];
|
|
1375
|
+
type ColorContrast = (typeof colorContrasts)[number];
|
|
1376
|
+
type ColorPrefix = (typeof colorPrefixes)[number];
|
|
1377
|
+
type Color = 'gray-0' | 'gray-50' | 'glass-0' | 'glass-50' | `${ColorPrefix}-${ColorContrast}` | 'gray-1100' | 'gray-1200' | 'glass-1100' | 'glass-1200';
|
|
1378
|
+
declare const checkboxColorPrefix: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray"];
|
|
1379
|
+
type CheckboxColorPrefix = (typeof checkboxColorPrefix)[number];
|
|
1380
|
+
|
|
1381
|
+
type BannerIntent = 'default' | 'error' | 'success' | 'warning' | 'info';
|
|
1382
|
+
|
|
1383
|
+
declare const textOptions: {
|
|
1384
|
+
readonly pageHeader: {
|
|
1385
|
+
readonly label: "Page Header (3XL) · 34px (2.125rem)";
|
|
1386
|
+
readonly size: "3xl";
|
|
1387
|
+
readonly tag: "h2";
|
|
1388
|
+
readonly weight: 900;
|
|
1389
|
+
};
|
|
1390
|
+
readonly secondaryPageHeader: {
|
|
1391
|
+
readonly label: "Secondary Page Header (3XL) • 34px, 500 \"Medium\"";
|
|
1068
1392
|
readonly size: "3xl";
|
|
1069
1393
|
readonly tag: "h2";
|
|
1070
1394
|
readonly weight: 500;
|
|
@@ -1153,6 +1477,20 @@ type Size = TextOptions[keyof TextOptions]['size'];
|
|
|
1153
1477
|
type Type = keyof TextOptions;
|
|
1154
1478
|
type FontWeight = TextOptions[keyof TextOptions]['weight'];
|
|
1155
1479
|
|
|
1480
|
+
type StripeStoreContactOption = {
|
|
1481
|
+
address: {
|
|
1482
|
+
city: string;
|
|
1483
|
+
country: string;
|
|
1484
|
+
line1: string;
|
|
1485
|
+
line2?: string;
|
|
1486
|
+
postal_code: string;
|
|
1487
|
+
state: string;
|
|
1488
|
+
};
|
|
1489
|
+
email: string;
|
|
1490
|
+
name: string;
|
|
1491
|
+
phone?: string;
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1156
1494
|
type NotificationInit = {
|
|
1157
1495
|
message: string;
|
|
1158
1496
|
/**
|
|
@@ -1215,6 +1553,7 @@ type ShippingRichRadioItem = {
|
|
|
1215
1553
|
caption?: string;
|
|
1216
1554
|
label: string;
|
|
1217
1555
|
landedCostId: string;
|
|
1556
|
+
method: IncotermCode;
|
|
1218
1557
|
price: string;
|
|
1219
1558
|
shipmentRatingId: string;
|
|
1220
1559
|
sublabel?: string;
|
|
@@ -1324,6 +1663,10 @@ declare namespace Components {
|
|
|
1324
1663
|
* @default false
|
|
1325
1664
|
*/
|
|
1326
1665
|
"bold": boolean;
|
|
1666
|
+
/**
|
|
1667
|
+
* Callback for when the badge is dismissed. Also determines if dismiss icon shown.
|
|
1668
|
+
*/
|
|
1669
|
+
"dismissHandler"?: () => void;
|
|
1327
1670
|
/**
|
|
1328
1671
|
* The icon element to display
|
|
1329
1672
|
* @default null
|
|
@@ -1334,6 +1677,11 @@ declare namespace Components {
|
|
|
1334
1677
|
* @default false
|
|
1335
1678
|
*/
|
|
1336
1679
|
"iconRight": boolean;
|
|
1680
|
+
/**
|
|
1681
|
+
* Whether or not the badge is loading
|
|
1682
|
+
* @default false
|
|
1683
|
+
*/
|
|
1684
|
+
"loading": boolean;
|
|
1337
1685
|
/**
|
|
1338
1686
|
* Whether or not the badge is rounded
|
|
1339
1687
|
* @default false
|
|
@@ -1479,6 +1827,14 @@ declare namespace Components {
|
|
|
1479
1827
|
"hide": boolean;
|
|
1480
1828
|
}
|
|
1481
1829
|
interface ZonosCartSubtotal {
|
|
1830
|
+
/**
|
|
1831
|
+
* Button color of the submit button
|
|
1832
|
+
*/
|
|
1833
|
+
"submitBtnColor"?: string;
|
|
1834
|
+
/**
|
|
1835
|
+
* Button type of the submit button
|
|
1836
|
+
*/
|
|
1837
|
+
"submitBtnType"?: HTMLZonosButtonElement['variant'];
|
|
1482
1838
|
}
|
|
1483
1839
|
interface ZonosCheckbox {
|
|
1484
1840
|
/**
|
|
@@ -2093,14 +2449,15 @@ declare namespace Components {
|
|
|
2093
2449
|
* Override border color of the radio item
|
|
2094
2450
|
*/
|
|
2095
2451
|
"borderStyle"?: ElementsUiStyle;
|
|
2096
|
-
/**
|
|
2097
|
-
* Initial selected value
|
|
2098
|
-
*/
|
|
2099
|
-
"initialSelectedValue"?: string | number;
|
|
2100
2452
|
/**
|
|
2101
2453
|
* List of items to display
|
|
2102
2454
|
*/
|
|
2103
2455
|
"items": ShippingRichRadioItem[];
|
|
2456
|
+
/**
|
|
2457
|
+
* Selected item
|
|
2458
|
+
* @default {null|firstItem}
|
|
2459
|
+
*/
|
|
2460
|
+
"selectedItem": ShippingRichRadioItem | null;
|
|
2104
2461
|
/**
|
|
2105
2462
|
* Theme of the radio item
|
|
2106
2463
|
*/
|
|
@@ -2867,6 +3224,10 @@ declare namespace LocalJSX {
|
|
|
2867
3224
|
* @default false
|
|
2868
3225
|
*/
|
|
2869
3226
|
"bold"?: boolean;
|
|
3227
|
+
/**
|
|
3228
|
+
* Callback for when the badge is dismissed. Also determines if dismiss icon shown.
|
|
3229
|
+
*/
|
|
3230
|
+
"dismissHandler"?: () => void;
|
|
2870
3231
|
/**
|
|
2871
3232
|
* The icon element to display
|
|
2872
3233
|
* @default null
|
|
@@ -2877,6 +3238,11 @@ declare namespace LocalJSX {
|
|
|
2877
3238
|
* @default false
|
|
2878
3239
|
*/
|
|
2879
3240
|
"iconRight"?: boolean;
|
|
3241
|
+
/**
|
|
3242
|
+
* Whether or not the badge is loading
|
|
3243
|
+
* @default false
|
|
3244
|
+
*/
|
|
3245
|
+
"loading"?: boolean;
|
|
2880
3246
|
/**
|
|
2881
3247
|
* Whether or not the badge is rounded
|
|
2882
3248
|
* @default false
|
|
@@ -3022,6 +3388,14 @@ declare namespace LocalJSX {
|
|
|
3022
3388
|
"hide"?: boolean;
|
|
3023
3389
|
}
|
|
3024
3390
|
interface ZonosCartSubtotal {
|
|
3391
|
+
/**
|
|
3392
|
+
* Button color of the submit button
|
|
3393
|
+
*/
|
|
3394
|
+
"submitBtnColor"?: string;
|
|
3395
|
+
/**
|
|
3396
|
+
* Button type of the submit button
|
|
3397
|
+
*/
|
|
3398
|
+
"submitBtnType"?: HTMLZonosButtonElement['variant'];
|
|
3025
3399
|
}
|
|
3026
3400
|
interface ZonosCheckbox {
|
|
3027
3401
|
/**
|
|
@@ -3610,10 +3984,6 @@ declare namespace LocalJSX {
|
|
|
3610
3984
|
* Override border color of the radio item
|
|
3611
3985
|
*/
|
|
3612
3986
|
"borderStyle"?: ElementsUiStyle;
|
|
3613
|
-
/**
|
|
3614
|
-
* Initial selected value
|
|
3615
|
-
*/
|
|
3616
|
-
"initialSelectedValue"?: string | number;
|
|
3617
3987
|
/**
|
|
3618
3988
|
* List of items to display
|
|
3619
3989
|
*/
|
|
@@ -3622,6 +3992,11 @@ declare namespace LocalJSX {
|
|
|
3622
3992
|
* Event emitted when an item is selected
|
|
3623
3993
|
*/
|
|
3624
3994
|
"onRadioSelected"?: (event: ZonosShippingRichRadioCustomEvent<ShippingRichRadioItem>) => void;
|
|
3995
|
+
/**
|
|
3996
|
+
* Selected item
|
|
3997
|
+
* @default {null|firstItem}
|
|
3998
|
+
*/
|
|
3999
|
+
"selectedItem"?: ShippingRichRadioItem | null;
|
|
3625
4000
|
/**
|
|
3626
4001
|
* Theme of the radio item
|
|
3627
4002
|
*/
|
|
@@ -3794,389 +4169,62 @@ declare module "@stencil/core" {
|
|
|
3794
4169
|
"zonos-link-authentication": LocalJSX.ZonosLinkAuthentication & JSXBase.HTMLAttributes<HTMLZonosLinkAuthenticationElement>;
|
|
3795
4170
|
"zonos-logo": LocalJSX.ZonosLogo & JSXBase.HTMLAttributes<HTMLZonosLogoElement>;
|
|
3796
4171
|
"zonos-notification": LocalJSX.ZonosNotification & JSXBase.HTMLAttributes<HTMLZonosNotificationElement>;
|
|
3797
|
-
"zonos-payment": LocalJSX.ZonosPayment & JSXBase.HTMLAttributes<HTMLZonosPaymentElement>;
|
|
3798
|
-
"zonos-paypal-payment": LocalJSX.ZonosPaypalPayment & JSXBase.HTMLAttributes<HTMLZonosPaypalPaymentElement>;
|
|
3799
|
-
"zonos-rest-state": LocalJSX.ZonosRestState & JSXBase.HTMLAttributes<HTMLZonosRestStateElement>;
|
|
3800
|
-
"zonos-review": LocalJSX.ZonosReview & JSXBase.HTMLAttributes<HTMLZonosReviewElement>;
|
|
3801
|
-
"zonos-select-dialog-header": LocalJSX.ZonosSelectDialogHeader & JSXBase.HTMLAttributes<HTMLZonosSelectDialogHeaderElement>;
|
|
3802
|
-
"zonos-shipping": LocalJSX.ZonosShipping & JSXBase.HTMLAttributes<HTMLZonosShippingElement>;
|
|
3803
|
-
"zonos-shipping-rich-radio": LocalJSX.ZonosShippingRichRadio & JSXBase.HTMLAttributes<HTMLZonosShippingRichRadioElement>;
|
|
3804
|
-
"zonos-spinner": LocalJSX.ZonosSpinner & JSXBase.HTMLAttributes<HTMLZonosSpinnerElement>;
|
|
3805
|
-
"zonos-text": LocalJSX.ZonosText & JSXBase.HTMLAttributes<HTMLZonosTextElement>;
|
|
3806
|
-
"zonos-tooltip": LocalJSX.ZonosTooltip & JSXBase.HTMLAttributes<HTMLZonosTooltipElement>;
|
|
3807
|
-
"zonos-v-stack": LocalJSX.ZonosVStack & JSXBase.HTMLAttributes<HTMLZonosVStackElement>;
|
|
3808
|
-
/**
|
|
3809
|
-
* The idea is from
|
|
3810
|
-
* @ref https://github.com/beenotung/stencil-virtual-scroll/blob/master/src/components/virtual-scroll-list/virtual-scroll-list.scss
|
|
3811
|
-
* @ref https://github.dev/ionic-team/ionic-framework/blob/v6.7.5/core/src/components/virtual-scroll/virtual-scroll.tsx
|
|
3812
|
-
*/
|
|
3813
|
-
"zonos-virtual-scroll": LocalJSX.ZonosVirtualScroll & JSXBase.HTMLAttributes<HTMLZonosVirtualScrollElement>;
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
}
|
|
3817
|
-
|
|
3818
|
-
type CalculateLandedCostAdjustmentInput = {
|
|
3819
|
-
amount: number;
|
|
3820
|
-
productId: string | null;
|
|
3821
|
-
sku: string | null;
|
|
3822
|
-
type: LandedCostAdjustmentType;
|
|
3823
|
-
};
|
|
3824
|
-
type CalculateLandedCostRequest = {
|
|
3825
|
-
billingAddress: {
|
|
3826
|
-
addressLine1: string;
|
|
3827
|
-
addressLine2?: string | undefined;
|
|
3828
|
-
city: string;
|
|
3829
|
-
country: CountryCode;
|
|
3830
|
-
postalCode: string;
|
|
3831
|
-
state: string;
|
|
3832
|
-
};
|
|
3833
|
-
billingContact: {
|
|
3834
|
-
firstName: string;
|
|
3835
|
-
lastName: string;
|
|
3836
|
-
phone: string;
|
|
3837
|
-
};
|
|
3838
|
-
checkoutSessionId: string;
|
|
3839
|
-
contact: {
|
|
3840
|
-
email?: string;
|
|
3841
|
-
firstName: string;
|
|
3842
|
-
lastName: string;
|
|
3843
|
-
phone: string;
|
|
3844
|
-
};
|
|
3845
|
-
items: CartItem[];
|
|
3846
|
-
landedCostAdjustments?: CalculateLandedCostAdjustmentInput[];
|
|
3847
|
-
metadata?: {
|
|
3848
|
-
key: string;
|
|
3849
|
-
value: string;
|
|
3850
|
-
}[];
|
|
3851
|
-
shippingAddress: {
|
|
3852
|
-
addressLine1: string;
|
|
3853
|
-
addressLine2?: string | undefined;
|
|
3854
|
-
city: string;
|
|
3855
|
-
country: CountryCode;
|
|
3856
|
-
postalCode: string;
|
|
3857
|
-
state: string;
|
|
3858
|
-
};
|
|
3859
|
-
};
|
|
3860
|
-
|
|
3861
|
-
type NormalizedTempCartItem = {
|
|
3862
|
-
amount: number;
|
|
3863
|
-
attributes: {
|
|
3864
|
-
key: string;
|
|
3865
|
-
value: string;
|
|
3866
|
-
}[];
|
|
3867
|
-
countryOfOrigin: CountryCode | null;
|
|
3868
|
-
currencyCode: CurrencyCode;
|
|
3869
|
-
description: string | null;
|
|
3870
|
-
id: string;
|
|
3871
|
-
imageUrl: string | null;
|
|
3872
|
-
itemType: ItemType | null;
|
|
3873
|
-
measurements: {
|
|
3874
|
-
type: ItemMeasurementType;
|
|
3875
|
-
unitOfMeasure: ItemUnitOfMeasure;
|
|
3876
|
-
value: number;
|
|
3877
|
-
}[];
|
|
3878
|
-
name: string | null;
|
|
3879
|
-
productId: string | null;
|
|
3880
|
-
quantity: number;
|
|
3881
|
-
sku: string | null;
|
|
3882
|
-
};
|
|
3883
|
-
type NormalizedTempCart = {
|
|
3884
|
-
adjustments: {
|
|
3885
|
-
amount: number;
|
|
3886
|
-
currencyCode: CurrencyCode;
|
|
3887
|
-
description: string;
|
|
3888
|
-
productId: string | null;
|
|
3889
|
-
sku: string | null;
|
|
3890
|
-
type: CartAdjustmentType;
|
|
3891
|
-
}[];
|
|
3892
|
-
credentialToken: string;
|
|
3893
|
-
items: NormalizedTempCartItem[];
|
|
3894
|
-
storeBaseUrl: string;
|
|
3895
|
-
storeId: number;
|
|
3896
|
-
};
|
|
3897
|
-
|
|
3898
|
-
type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
|
|
3899
|
-
type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
3900
|
-
type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
3901
|
-
type HelloConfig = {
|
|
3902
|
-
anchorElementSelector: string;
|
|
3903
|
-
cartUrlPattern: string | null;
|
|
3904
|
-
/**
|
|
3905
|
-
* The behavior to use when determining the country to use for the user.
|
|
3906
|
-
* @default 'URL_PARAM'
|
|
3907
|
-
*/
|
|
3908
|
-
countryOverrideBehavior?: CountryOverrideBehavior;
|
|
3909
|
-
currencyBehavior: HelloCurrencyBehavior;
|
|
3910
|
-
currencyElementSelector: string;
|
|
3911
|
-
desktopLocation?: HelloMobileLocation | null;
|
|
3912
|
-
excludedUrlPatterns: Array<string>;
|
|
3913
|
-
homepageUrlPattern: string | null;
|
|
3914
|
-
mobileLocation: HelloMobileLocation | null;
|
|
3915
|
-
mode: Mode;
|
|
3916
|
-
organization: string;
|
|
3917
|
-
peekMessageBehavior: HelloPeekMessageBehavior;
|
|
3918
|
-
peekMessageDelay: number;
|
|
3919
|
-
productAddToCartElementSelector: string | null;
|
|
3920
|
-
productDescriptionElementSelector: string | null;
|
|
3921
|
-
productDetailUrlPattern: string | null;
|
|
3922
|
-
productListUrlPattern: string | null;
|
|
3923
|
-
productTitleElementSelector: string | null;
|
|
3924
|
-
restrictionBehavior: HelloRestrictionBehavior;
|
|
3925
|
-
/**
|
|
3926
|
-
* The countries to include in the country list dropdown of the Hello widget.
|
|
3927
|
-
* @default ONLY_SHIPPABLE
|
|
3928
|
-
*/
|
|
3929
|
-
showCountryList?: ShowCountryList;
|
|
3930
|
-
/**
|
|
3931
|
-
* The countries to show the widget for.
|
|
3932
|
-
* @default ONLY_SHIPPABLE
|
|
3933
|
-
*/
|
|
3934
|
-
showForCountries?: ShowForCountries;
|
|
3935
|
-
visibilityStatus?: 'ENABLED' | 'DISABLED';
|
|
3936
|
-
/**
|
|
3937
|
-
* Callback function to run after the Hello widget has been initialized. This should be triggered only once when hello is attached to the DOM.
|
|
3938
|
-
* **Note**: If hello is detached from the DOM and reattached, this callback will be called again.
|
|
3939
|
-
* @param params - The parameters containing the country code and currency code that hello is initialized with.
|
|
3940
|
-
*/
|
|
3941
|
-
onInitSuccess?: (params: {
|
|
3942
|
-
countryCode: CountryCode;
|
|
3943
|
-
currencyCode: CurrencyCode;
|
|
3944
|
-
}) => Promise<void>;
|
|
3945
|
-
};
|
|
3946
|
-
|
|
3947
|
-
type StripeStoreContactOption = {
|
|
3948
|
-
address: {
|
|
3949
|
-
city: string;
|
|
3950
|
-
country: string;
|
|
3951
|
-
line1: string;
|
|
3952
|
-
line2?: string;
|
|
3953
|
-
postal_code: string;
|
|
3954
|
-
state: string;
|
|
3955
|
-
};
|
|
3956
|
-
email: string;
|
|
3957
|
-
name: string;
|
|
3958
|
-
phone?: string;
|
|
3959
|
-
};
|
|
4172
|
+
"zonos-payment": LocalJSX.ZonosPayment & JSXBase.HTMLAttributes<HTMLZonosPaymentElement>;
|
|
4173
|
+
"zonos-paypal-payment": LocalJSX.ZonosPaypalPayment & JSXBase.HTMLAttributes<HTMLZonosPaypalPaymentElement>;
|
|
4174
|
+
"zonos-rest-state": LocalJSX.ZonosRestState & JSXBase.HTMLAttributes<HTMLZonosRestStateElement>;
|
|
4175
|
+
"zonos-review": LocalJSX.ZonosReview & JSXBase.HTMLAttributes<HTMLZonosReviewElement>;
|
|
4176
|
+
"zonos-select-dialog-header": LocalJSX.ZonosSelectDialogHeader & JSXBase.HTMLAttributes<HTMLZonosSelectDialogHeaderElement>;
|
|
4177
|
+
"zonos-shipping": LocalJSX.ZonosShipping & JSXBase.HTMLAttributes<HTMLZonosShippingElement>;
|
|
4178
|
+
"zonos-shipping-rich-radio": LocalJSX.ZonosShippingRichRadio & JSXBase.HTMLAttributes<HTMLZonosShippingRichRadioElement>;
|
|
4179
|
+
"zonos-spinner": LocalJSX.ZonosSpinner & JSXBase.HTMLAttributes<HTMLZonosSpinnerElement>;
|
|
4180
|
+
"zonos-text": LocalJSX.ZonosText & JSXBase.HTMLAttributes<HTMLZonosTextElement>;
|
|
4181
|
+
"zonos-tooltip": LocalJSX.ZonosTooltip & JSXBase.HTMLAttributes<HTMLZonosTooltipElement>;
|
|
4182
|
+
"zonos-v-stack": LocalJSX.ZonosVStack & JSXBase.HTMLAttributes<HTMLZonosVStackElement>;
|
|
4183
|
+
/**
|
|
4184
|
+
* The idea is from
|
|
4185
|
+
* @ref https://github.com/beenotung/stencil-virtual-scroll/blob/master/src/components/virtual-scroll-list/virtual-scroll-list.scss
|
|
4186
|
+
* @ref https://github.dev/ionic-team/ionic-framework/blob/v6.7.5/core/src/components/virtual-scroll/virtual-scroll.tsx
|
|
4187
|
+
*/
|
|
4188
|
+
"zonos-virtual-scroll": LocalJSX.ZonosVirtualScroll & JSXBase.HTMLAttributes<HTMLZonosVirtualScrollElement>;
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
3960
4192
|
|
|
3961
|
-
type
|
|
3962
|
-
index: number;
|
|
3963
|
-
isDone: boolean;
|
|
3964
|
-
label: 'Customer' | 'Delivery' | 'Payment';
|
|
3965
|
-
value: 'customer-info' | 'shipping' | 'payment';
|
|
3966
|
-
};
|
|
3967
|
-
type TabItems = Record<TabItem['value'], TabItem>;
|
|
3968
|
-
type ItemMeasurement = {
|
|
3969
|
-
/** Indicates what type of `Measurement`, e.g. weight, specific dim unit. */
|
|
3970
|
-
type: ItemMeasurementType;
|
|
3971
|
-
/** Indicates the `Measurement` units to be used. */
|
|
3972
|
-
unitOfMeasure: ItemUnitOfMeasure;
|
|
3973
|
-
/** The `Measurement` value. */
|
|
3974
|
-
value: number;
|
|
3975
|
-
};
|
|
3976
|
-
type CartItem = {
|
|
4193
|
+
type NormalizedTempCartItem = {
|
|
3977
4194
|
amount: number;
|
|
3978
|
-
attributes
|
|
4195
|
+
attributes: {
|
|
3979
4196
|
key: string;
|
|
3980
4197
|
value: string;
|
|
3981
4198
|
}[];
|
|
3982
|
-
countryOfOrigin
|
|
4199
|
+
countryOfOrigin: CountryCode | null;
|
|
3983
4200
|
currencyCode: CurrencyCode;
|
|
3984
|
-
description
|
|
3985
|
-
|
|
3986
|
-
imageUrl
|
|
3987
|
-
itemType
|
|
3988
|
-
measurements
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
value:
|
|
4201
|
+
description: string | null;
|
|
4202
|
+
id: string;
|
|
4203
|
+
imageUrl: string | null;
|
|
4204
|
+
itemType: ItemType | null;
|
|
4205
|
+
measurements: {
|
|
4206
|
+
type: ItemMeasurementType;
|
|
4207
|
+
unitOfMeasure: ItemUnitOfMeasure;
|
|
4208
|
+
value: number;
|
|
3992
4209
|
}[];
|
|
3993
|
-
name: string;
|
|
3994
|
-
productId
|
|
4210
|
+
name: string | null;
|
|
4211
|
+
productId: string | null;
|
|
3995
4212
|
quantity: number;
|
|
3996
|
-
sku
|
|
3997
|
-
};
|
|
3998
|
-
|
|
3999
|
-
type BuildLandedCostParams = {
|
|
4000
|
-
billingAddress: CalculateLandedCostRequest['billingAddress'];
|
|
4001
|
-
billingContact: CalculateLandedCostRequest['billingContact'];
|
|
4002
|
-
checkoutSessionId: string;
|
|
4003
|
-
contact: CalculateLandedCostRequest['contact'];
|
|
4004
|
-
shippingAddress: CalculateLandedCostRequest['shippingAddress'];
|
|
4005
|
-
zonosApiRoute: string;
|
|
4006
|
-
};
|
|
4007
|
-
type BuildLandedCostResponse = (CalculateLandedCostMutation & {
|
|
4008
|
-
errors?: {
|
|
4009
|
-
message: string;
|
|
4010
|
-
}[];
|
|
4011
|
-
}) | null;
|
|
4012
|
-
|
|
4013
|
-
type ZonosOrder = GetOrderQuery['order'];
|
|
4014
|
-
|
|
4015
|
-
type BuildCardDetailParams = {
|
|
4016
|
-
countryCode: CountryCode;
|
|
4017
|
-
currencyCode: CurrencyCode;
|
|
4213
|
+
sku: string | null;
|
|
4018
4214
|
};
|
|
4019
|
-
type
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
type: AnalyticsProviderType;
|
|
4028
|
-
}>;
|
|
4029
|
-
/**
|
|
4030
|
-
* @default false - when false, we disable the place order button until the script is loaded
|
|
4031
|
-
* @note if set to true, we will not enable or disable the place order button
|
|
4032
|
-
*/
|
|
4033
|
-
disablePlaceOrderButtonActivation?: boolean;
|
|
4034
|
-
externalPaymentMethods: Array<{
|
|
4035
|
-
status: ExternalPaymentMethodStatus;
|
|
4036
|
-
type: ExternalPaymentMethodType;
|
|
4037
|
-
}> | null;
|
|
4038
|
-
externalServiceTokens: {
|
|
4039
|
-
token: string;
|
|
4040
|
-
type: ExternalServiceTokenType;
|
|
4215
|
+
type NormalizedTempCart = {
|
|
4216
|
+
adjustments: {
|
|
4217
|
+
amount: number;
|
|
4218
|
+
currencyCode: CurrencyCode;
|
|
4219
|
+
description: string;
|
|
4220
|
+
productId: string | null;
|
|
4221
|
+
sku: string | null;
|
|
4222
|
+
type: CartAdjustmentType;
|
|
4041
4223
|
}[];
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
mode: Mode;
|
|
4047
|
-
orderNotifications: {
|
|
4048
|
-
abandonedCart: {
|
|
4049
|
-
delay: number;
|
|
4050
|
-
discountPercent: number;
|
|
4051
|
-
status: {
|
|
4052
|
-
active: NotificationActiveStatus;
|
|
4053
|
-
sendCopiesTo: Array<string>;
|
|
4054
|
-
};
|
|
4055
|
-
};
|
|
4056
|
-
orderCancelled: {
|
|
4057
|
-
active: NotificationActiveStatus;
|
|
4058
|
-
sendCopiesTo: Array<string>;
|
|
4059
|
-
};
|
|
4060
|
-
orderConfirmation: {
|
|
4061
|
-
active: NotificationActiveStatus;
|
|
4062
|
-
sendCopiesTo: Array<string>;
|
|
4063
|
-
} | null;
|
|
4064
|
-
orderShipped: {
|
|
4065
|
-
active: NotificationActiveStatus;
|
|
4066
|
-
sendCopiesTo: Array<string>;
|
|
4067
|
-
};
|
|
4068
|
-
};
|
|
4069
|
-
organization: string;
|
|
4070
|
-
placeOrderButtonSelector: string | null;
|
|
4071
|
-
/**
|
|
4072
|
-
* @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
|
|
4073
|
-
*
|
|
4074
|
-
* **NOTE: this value can't be overridden in Zonos.init**
|
|
4075
|
-
*/
|
|
4076
|
-
subscriptionStatus: CheckoutSubscriptionStatus;
|
|
4077
|
-
successBehavior: CheckoutSuccessBehavior;
|
|
4078
|
-
/**
|
|
4079
|
-
* The success page action text for checkout.
|
|
4080
|
-
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
4081
|
-
*/
|
|
4082
|
-
successPageActionText?: string;
|
|
4083
|
-
/**
|
|
4084
|
-
* The success page subtitle text for checkout. Each item in the array will appear on a new line.
|
|
4085
|
-
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
4086
|
-
*/
|
|
4087
|
-
successPageSubtitleText?: string[];
|
|
4088
|
-
/**
|
|
4089
|
-
* The success page title text for checkout.
|
|
4090
|
-
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
4091
|
-
*/
|
|
4092
|
-
successPageTitleText?: string;
|
|
4093
|
-
successRedirectUrl: string;
|
|
4094
|
-
visibilityStatus: CheckoutVisibilityStatus;
|
|
4095
|
-
/**
|
|
4096
|
-
* Cart info callback for checkout (optional),
|
|
4097
|
-
* @deprecated
|
|
4098
|
-
* @note
|
|
4099
|
-
* This function is deprecated in favor of new API `createCartId`
|
|
4100
|
-
* @note will attempt to use cart data if available
|
|
4101
|
-
* User can dispatch an event 'zonos--init-cart-info' to update the cart
|
|
4102
|
-
* @example
|
|
4103
|
-
* const initEvent = new CustomEvent<CartItem[]>('zonos--init-cart-info', {
|
|
4104
|
-
* detail: cartItems,
|
|
4105
|
-
* });
|
|
4106
|
-
* document.body.dispatchEvent(initEvent);
|
|
4107
|
-
* @returns {object[]} - object with the the item info to be added to cart:
|
|
4108
|
-
* - amount: number;
|
|
4109
|
-
* - countryOfOrigin?: string;
|
|
4110
|
-
* - currencyCode: string;
|
|
4111
|
-
* - description?: string;
|
|
4112
|
-
* - hsCode?: string;
|
|
4113
|
-
* - imageUrl?: string;
|
|
4114
|
-
* - name: string;
|
|
4115
|
-
* - productId?: string;
|
|
4116
|
-
* - quantity: number;
|
|
4117
|
-
*/
|
|
4118
|
-
buildCartDetail?: (params: BuildCardDetailParams) => Promise<CartItem[]>;
|
|
4119
|
-
/**
|
|
4120
|
-
* Calculate landed cost callback for checkout (optional)
|
|
4121
|
-
* @deprecated
|
|
4122
|
-
* @note
|
|
4123
|
-
* This function is deprecated in favor of new API `createCartId`
|
|
4124
|
-
* @note will attempt to use cart data if available
|
|
4125
|
-
*/
|
|
4126
|
-
buildLandedCost?: (params: BuildLandedCostParams) => Promise<BuildLandedCostResponse>;
|
|
4127
|
-
/**
|
|
4128
|
-
* Callback that returns the cart id from `cartCreate` mutation.
|
|
4129
|
-
* @note
|
|
4130
|
-
* The mutation `cartCreate` is preferred to be called in the server side
|
|
4131
|
-
* @returns string - Cart ID
|
|
4132
|
-
*/
|
|
4133
|
-
createCartId?: () => Promise<string> | string;
|
|
4134
|
-
/**
|
|
4135
|
-
* Callback trigger when the checkout is closed
|
|
4136
|
-
*/
|
|
4137
|
-
onClose?: () => void;
|
|
4138
|
-
/**
|
|
4139
|
-
* This callback is optional. If provided, it will be called right before the payment is processed.
|
|
4140
|
-
* @param items - The cart items.
|
|
4141
|
-
* @returns {string | null} - The error message to display to the user. If the message is empty or null, the payment will proceed.
|
|
4142
|
-
* @example
|
|
4143
|
-
* onInventoryCheck: async ({ items }) => {
|
|
4144
|
-
* // Check if all items are available from the server. If the fetch is throwing an error, we will show a generic error message "Unable to check inventory. Please try again.".
|
|
4145
|
-
* const itemsInfo = await fetch('https://yourserver.com/api/get-available-items', {
|
|
4146
|
-
* method: 'POST',
|
|
4147
|
-
* body: JSON.stringify({ items }),
|
|
4148
|
-
* });
|
|
4149
|
-
* const items = await itemsInfo.json();
|
|
4150
|
-
* // Filter out unavailable items.
|
|
4151
|
-
* const unavailableItems = items.filter(item => !item.available);
|
|
4152
|
-
* if (unavailableItems.length) {
|
|
4153
|
-
* // Display an error message to the user.
|
|
4154
|
-
* return `The following items are not available: ${unavailableItems.map(item => item.name).join(', ')}`;
|
|
4155
|
-
* }
|
|
4156
|
-
* // Proceed with the payment if you return an empty string or null.
|
|
4157
|
-
* return '';
|
|
4158
|
-
* }
|
|
4159
|
-
*/
|
|
4160
|
-
onInventoryCheck?: (params: {
|
|
4161
|
-
items: CartItem[];
|
|
4162
|
-
}) => Promise<string | null>;
|
|
4163
|
-
/**
|
|
4164
|
-
* Callback trigger when payment succeeds
|
|
4165
|
-
*/
|
|
4166
|
-
onOrderSuccess?: (props: {
|
|
4167
|
-
zonosApiRoute: string;
|
|
4168
|
-
zonosOrder: ZonosOrder;
|
|
4169
|
-
}) => Promise<void>;
|
|
4170
|
-
};
|
|
4171
|
-
|
|
4172
|
-
type AppearanceConfig = {
|
|
4173
|
-
colorPrimary?: string;
|
|
4174
|
-
colorSecondary?: string;
|
|
4175
|
-
fontFamily: string;
|
|
4176
|
-
logoUrl: string;
|
|
4177
|
-
style: ElementsUiStyle;
|
|
4178
|
-
theme: ElementsUiTheme;
|
|
4179
|
-
zonosAttribution: ZonosAttribution | null;
|
|
4224
|
+
credentialToken: string;
|
|
4225
|
+
items: NormalizedTempCartItem[];
|
|
4226
|
+
storeBaseUrl: string;
|
|
4227
|
+
storeId: number;
|
|
4180
4228
|
};
|
|
4181
4229
|
|
|
4182
4230
|
/**
|