@zonos/elements 1.1.1 → 1.1.2
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-108bc407.js → cart-a969ee0b.js} +8 -8
- package/dist/cjs/{cart-108bc407.js.map → cart-a969ee0b.js.map} +1 -1
- package/dist/cjs/{getBorderRadius-2904800c.js → getBorderRadius-ae52cae1.js} +2 -2
- package/dist/cjs/{getBorderRadius-2904800c.js.map → getBorderRadius-ae52cae1.js.map} +1 -1
- package/dist/cjs/{isDarkColor-a86b8a05.js → isDarkColor-e1a7bf45.js} +2 -2
- package/dist/cjs/{isDarkColor-a86b8a05.js.map → isDarkColor-e1a7bf45.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-f6a1b679.js → localization-d510574c.js} +200 -12
- package/dist/cjs/localization-d510574c.js.map +1 -0
- package/dist/cjs/{submitGtag-b1b96579.js → submitGtag-4de4430f.js} +3 -3
- package/dist/cjs/{submitGtag-b1b96579.js.map → submitGtag-4de4430f.js.map} +1 -1
- package/dist/cjs/zonos-address_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-banner.cjs.entry.js +68 -0
- package/dist/cjs/zonos-banner.cjs.entry.js.map +1 -0
- package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +12 -12
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-controller.cjs.entry.js.map +1 -1
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +6 -6
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +12 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +237 -22
- package/dist/cjs/zonos-hello.cjs.entry.js.map +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +60 -0
- package/dist/cjs/zonos-payment.cjs.entry.js.map +1 -0
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/{zonosStore-960e5542.js → zonosStore-d9cdaec6.js} +6 -22
- package/dist/cjs/zonosStore-d9cdaec6.js.map +1 -0
- package/dist/collection/components/checkout/zonos-checkout/assets/LeftArrow.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/assets/MessageIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/assets/RemoveIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/assets/InfoIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/RemoveIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/SuccessIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronDownIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronUpIcon.svg +1 -1
- package/dist/collection/components/common/zonos-banner/zonos-banner.css +6 -1
- package/dist/collection/components/common/zonos-banner/zonos-banner.js +1 -1
- package/dist/collection/components/common/zonos-banner/zonos-banner.js.map +1 -1
- package/dist/collection/components/common/zonos-country-select/assets/arrowLeftBlue.svg +1 -1
- package/dist/collection/components/common/zonos-dialog/assets/removeIcon.svg +1 -1
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js.map +1 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.css +20 -2
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +135 -20
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js.map +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/bagIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/messageIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/moneyIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/removeIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/chevronDownIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/zonosIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +12 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +30 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js.map +1 -1
- package/dist/collection/components/store/hello/localization.js +2 -4
- package/dist/collection/components/store/hello/localization.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
- package/dist/collection/components/store/translationStore/strings.arabic.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.base.js +9 -0
- package/dist/collection/components/store/translationStore/strings.base.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.danish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.french.js +9 -0
- package/dist/collection/components/store/translationStore/strings.french.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.german.js +9 -0
- package/dist/collection/components/store/translationStore/strings.german.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.italian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
- package/dist/collection/components/store/translationStore/strings.korean.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.polish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.russian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js.map +1 -1
- package/dist/collection/components/store/zonosStore.js +5 -3
- package/dist/collection/components/store/zonosStore.js.map +1 -1
- package/dist/collection/components/utils/api/checkItemRestrictions.js +18 -0
- package/dist/collection/components/utils/api/checkItemRestrictions.js.map +1 -0
- package/dist/collection/components/utils/hello/detectItemRestrictions.js +29 -0
- package/dist/collection/components/utils/hello/detectItemRestrictions.js.map +1 -0
- package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js +8 -7
- package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js.map +1 -1
- package/dist/collection/components/utils/hello/getProductsOnPage.js +49 -0
- package/dist/collection/components/utils/hello/getProductsOnPage.js.map +1 -0
- package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js +10 -0
- package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js.map +1 -0
- package/dist/collection/environment.js +34 -7
- package/dist/collection/environment.js.map +1 -1
- package/dist/collection/scripts/loadStripe.js +3 -3
- package/dist/collection/scripts/loadStripe.js.map +1 -1
- package/dist/collection/scripts/stripe.js +3 -3
- package/dist/collection/scripts/stripe.js.map +1 -1
- package/dist/collection/scripts/zonos.js +83 -30
- package/dist/collection/scripts/zonos.js.map +1 -1
- package/dist/collection/types/generated/graphql.customer.types.js +34 -0
- package/dist/collection/types/generated/graphql.customer.types.js.map +1 -1
- package/dist/collection/types/hello/HelloConfig.js.map +1 -1
- package/dist/collection/types/hello/Product.js +2 -0
- package/dist/collection/types/hello/Product.js.map +1 -0
- package/dist/collection/types/hello/RestrictedItem.js +2 -0
- package/dist/collection/types/hello/RestrictedItem.js.map +1 -0
- package/dist/components/localization.js +198 -11
- package/dist/components/localization.js.map +1 -1
- package/dist/components/stripe.js +3 -3
- package/dist/components/stripe.js.map +1 -1
- package/dist/components/zonos-banner2.js +2 -2
- package/dist/components/zonos-banner2.js.map +1 -1
- package/dist/components/zonos-cart-subtotal2.js +1 -1
- package/dist/components/zonos-checkout-finish2.js +2 -2
- package/dist/components/zonos-checkout.js +3 -3
- package/dist/components/zonos-controller.js +1 -1
- package/dist/components/zonos-controller.js.map +1 -1
- package/dist/components/zonos-country-select2.js +1 -1
- package/dist/components/zonos-dialog2.js +1 -1
- package/dist/components/zonos-hello-dialog-footer2.js +2 -2
- package/dist/components/zonos-hello-dialog2.js +18 -7
- package/dist/components/zonos-hello-dialog2.js.map +1 -1
- package/dist/components/zonos-hello.js +247 -22
- package/dist/components/zonos-hello.js.map +1 -1
- package/dist/components/zonos-review2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping-rich-radio2.js.map +1 -1
- package/dist/components/zonosStore.js +5 -21
- package/dist/components/zonosStore.js.map +1 -1
- package/dist/{zonos-elements/cart-2f83e048.js → esm/cart-d00e1acb.js} +8 -8
- package/dist/esm/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
- package/dist/{zonos-elements/getBorderRadius-82fbaf25.js → esm/getBorderRadius-e8ad5967.js} +2 -2
- package/dist/esm/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
- package/dist/{zonos-elements/isDarkColor-b21326ae.js → esm/isDarkColor-3bb345f4.js} +2 -2
- package/dist/{zonos-elements/isDarkColor-b21326ae.js.map → esm/isDarkColor-3bb345f4.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/{zonos-elements/localization-4a424f49.js → esm/localization-1d92a557.js} +200 -13
- package/dist/esm/localization-1d92a557.js.map +1 -0
- package/dist/{zonos-elements/submitGtag-fbdb454b.js → esm/submitGtag-85914088.js} +3 -3
- package/dist/esm/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
- package/dist/esm/zonos-address_2.entry.js +5 -5
- package/dist/esm/zonos-banner.entry.js +64 -0
- package/dist/esm/zonos-banner.entry.js.map +1 -0
- package/dist/esm/zonos-button_2.entry.js +3 -3
- package/dist/esm/zonos-cart-items_10.entry.js +12 -12
- package/dist/esm/zonos-checkout.entry.js +9 -9
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-controller.entry.js.map +1 -1
- package/dist/esm/zonos-country-flag_4.entry.js +6 -6
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +12 -8
- package/dist/esm/zonos-hello-dialog.entry.js.map +1 -1
- package/dist/esm/zonos-hello.entry.js +237 -22
- package/dist/esm/zonos-hello.entry.js.map +1 -1
- package/dist/esm/zonos-payment.entry.js +56 -0
- package/dist/esm/zonos-payment.entry.js.map +1 -0
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-shipping-rich-radio.entry.js.map +1 -1
- package/dist/{zonos-elements/zonosStore-13a7b534.js → esm/zonosStore-1c9c7d76.js} +6 -22
- package/dist/esm/zonosStore-1c9c7d76.js.map +1 -0
- package/dist/esm-es5/cart-d00e1acb.js +2 -0
- package/dist/esm-es5/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
- package/dist/esm-es5/{getBorderRadius-82fbaf25.js → getBorderRadius-e8ad5967.js} +2 -2
- package/dist/esm-es5/{isDarkColor-b21326ae.js → isDarkColor-3bb345f4.js} +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/localization-1d92a557.js +2 -0
- package/dist/esm-es5/localization-1d92a557.js.map +1 -0
- package/dist/esm-es5/{submitGtag-fbdb454b.js → submitGtag-85914088.js} +2 -2
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +2 -0
- package/dist/esm-es5/zonos-banner.entry.js.map +1 -0
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js.map +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js.map +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js.map +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js.map +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-elements.js.map +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js.map +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js.map +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +2 -0
- package/dist/esm-es5/zonos-payment.entry.js.map +1 -0
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js.map +1 -1
- package/dist/esm-es5/zonosStore-1c9c7d76.js +2 -0
- package/dist/esm-es5/zonosStore-1c9c7d76.js.map +1 -0
- package/dist/scripts/loadStripe.js +6 -6
- package/dist/scripts/loadZonos.js +92 -35
- package/dist/scripts/stripe.js +5 -5
- package/dist/scripts/zonos.js +92 -35
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +24 -1
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
- package/dist/types/components/store/zonosStore.d.ts +1 -1
- package/dist/types/components/utils/api/checkItemRestrictions.d.ts +22 -0
- package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +14 -0
- package/dist/types/components/utils/hello/getCurrentHelloLocalePage.d.ts +2 -1
- package/dist/types/components/utils/hello/getProductsOnPage.d.ts +2 -0
- package/dist/types/components/utils/hello/setZonosCountryUrlParam.d.ts +2 -0
- package/dist/types/components.d.ts +12 -0
- package/dist/types/environment.d.ts +9 -0
- package/dist/types/scripts/loadStripe.d.ts +1 -1
- package/dist/types/scripts/stripe.d.ts +2 -2
- package/dist/types/scripts/zonos.d.ts +2 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +75 -1
- package/dist/types/types/generated/graphql.customer.types.ts +113 -1
- package/dist/types/types/hello/HelloConfig.d.ts +4 -0
- package/dist/types/types/hello/Product.d.ts +5 -0
- package/dist/types/types/hello/RestrictedItem.d.ts +6 -0
- package/dist/zonos-elements/assets/ChevronDownIcon.svg +1 -1
- package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -1
- package/dist/zonos-elements/assets/InfoIcon.svg +1 -1
- package/dist/zonos-elements/assets/LeftArrow.svg +1 -1
- package/dist/zonos-elements/assets/MessageIcon.svg +1 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/assets/SuccessIcon.svg +1 -1
- package/dist/zonos-elements/assets/bagIcon.svg +1 -1
- package/dist/zonos-elements/assets/messageIcon.svg +1 -1
- package/dist/zonos-elements/assets/moneyIcon.svg +1 -1
- package/dist/zonos-elements/assets/removeIcon.svg +1 -1
- package/dist/zonos-elements/cart-c641ddaf.system.js +2 -0
- package/dist/zonos-elements/{cart-9780fa28.system.js.map → cart-c641ddaf.system.js.map} +1 -1
- package/dist/{esm/cart-2f83e048.js → zonos-elements/cart-d00e1acb.js} +8 -8
- package/dist/zonos-elements/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
- package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js → getBorderRadius-b59c3ada.system.js} +2 -2
- package/dist/{esm/getBorderRadius-82fbaf25.js → zonos-elements/getBorderRadius-e8ad5967.js} +2 -2
- package/dist/zonos-elements/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
- package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js → isDarkColor-231502d4.system.js} +2 -2
- package/dist/{esm/isDarkColor-b21326ae.js → zonos-elements/isDarkColor-3bb345f4.js} +2 -2
- package/dist/{esm/isDarkColor-b21326ae.js.map → zonos-elements/isDarkColor-3bb345f4.js.map} +1 -1
- package/dist/{esm/localization-4a424f49.js → zonos-elements/localization-1d92a557.js} +200 -13
- package/dist/zonos-elements/localization-1d92a557.js.map +1 -0
- package/dist/zonos-elements/localization-a6b6a5a5.system.js +2 -0
- package/dist/zonos-elements/localization-a6b6a5a5.system.js.map +1 -0
- package/dist/zonos-elements/submitGtag-764af8c4.system.js +2 -0
- package/dist/{esm/submitGtag-fbdb454b.js → zonos-elements/submitGtag-85914088.js} +3 -3
- package/dist/zonos-elements/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
- package/dist/zonos-elements/zonos-address_2.entry.js +5 -5
- package/dist/zonos-elements/zonos-address_2.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-banner.entry.js +64 -0
- package/dist/zonos-elements/zonos-banner.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-banner.system.entry.js +2 -0
- package/dist/zonos-elements/zonos-banner.system.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-button_2.entry.js +3 -3
- package/dist/zonos-elements/zonos-button_2.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-cart-items_10.entry.js +12 -12
- package/dist/zonos-elements/zonos-cart-items_10.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-cart-items_10.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-checkout.entry.js +9 -9
- package/dist/zonos-elements/zonos-checkout.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-checkout.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-controller.entry.js +6 -6
- package/dist/zonos-elements/zonos-controller.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-controller.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-controller.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-country-flag_4.entry.js +6 -6
- package/dist/zonos-elements/zonos-country-flag_4.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-country-flag_4.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.system.js +1 -1
- package/dist/zonos-elements/zonos-elements.system.js.map +1 -1
- package/dist/zonos-elements/zonos-hello-dialog.entry.js +12 -8
- package/dist/zonos-elements/zonos-hello-dialog.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-hello-dialog.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-hello-dialog.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-hello.entry.js +237 -22
- package/dist/zonos-elements/zonos-hello.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-hello.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-hello.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-payment.entry.js +56 -0
- package/dist/zonos-elements/zonos-payment.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-payment.system.entry.js +2 -0
- package/dist/zonos-elements/zonos-payment.system.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js.map +1 -1
- package/dist/{esm/zonosStore-13a7b534.js → zonos-elements/zonosStore-1c9c7d76.js} +6 -22
- package/dist/zonos-elements/zonosStore-1c9c7d76.js.map +1 -0
- package/dist/zonos-elements/zonosStore-e5c545ea.system.js +2 -0
- package/dist/zonos-elements/zonosStore-e5c545ea.system.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/localization-f6a1b679.js.map +0 -1
- package/dist/cjs/zonos-banner_2.cjs.entry.js +0 -120
- package/dist/cjs/zonos-banner_2.cjs.entry.js.map +0 -1
- package/dist/cjs/zonosStore-960e5542.js.map +0 -1
- package/dist/esm/localization-4a424f49.js.map +0 -1
- package/dist/esm/zonos-banner_2.entry.js +0 -115
- package/dist/esm/zonos-banner_2.entry.js.map +0 -1
- package/dist/esm/zonosStore-13a7b534.js.map +0 -1
- package/dist/esm-es5/cart-2f83e048.js +0 -2
- package/dist/esm-es5/localization-4a424f49.js +0 -2
- package/dist/esm-es5/localization-4a424f49.js.map +0 -1
- package/dist/esm-es5/zonos-banner_2.entry.js +0 -2
- package/dist/esm-es5/zonos-banner_2.entry.js.map +0 -1
- package/dist/esm-es5/zonosStore-13a7b534.js +0 -2
- package/dist/esm-es5/zonosStore-13a7b534.js.map +0 -1
- package/dist/zonos-elements/cart-9780fa28.system.js +0 -2
- package/dist/zonos-elements/localization-3c43290f.system.js +0 -2
- package/dist/zonos-elements/localization-3c43290f.system.js.map +0 -1
- package/dist/zonos-elements/localization-4a424f49.js.map +0 -1
- package/dist/zonos-elements/submitGtag-23ecdc20.system.js +0 -2
- package/dist/zonos-elements/zonos-banner_2.entry.js +0 -115
- package/dist/zonos-elements/zonos-banner_2.entry.js.map +0 -1
- package/dist/zonos-elements/zonos-banner_2.system.entry.js +0 -2
- package/dist/zonos-elements/zonos-banner_2.system.entry.js.map +0 -1
- package/dist/zonos-elements/zonosStore-13a7b534.js.map +0 -1
- package/dist/zonos-elements/zonosStore-77bcd7c0.system.js +0 -2
- package/dist/zonos-elements/zonosStore-77bcd7c0.system.js.map +0 -1
- /package/dist/esm-es5/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +0 -0
- /package/dist/esm-es5/{isDarkColor-b21326ae.js.map → isDarkColor-3bb345f4.js.map} +0 -0
- /package/dist/esm-es5/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +0 -0
- /package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js.map → getBorderRadius-b59c3ada.system.js.map} +0 -0
- /package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js.map → isDarkColor-231502d4.system.js.map} +0 -0
- /package/dist/zonos-elements/{submitGtag-23ecdc20.system.js.map → submitGtag-764af8c4.system.js.map} +0 -0
|
@@ -35,7 +35,7 @@ const logError = (message, ...rest) => {
|
|
|
35
35
|
const V3_URL = 'https://js.stripe.com/v3';
|
|
36
36
|
const V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
37
37
|
const EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
|
|
38
|
-
const
|
|
38
|
+
const zonosStripeFindScript = () => {
|
|
39
39
|
const scripts = document.querySelectorAll(`script[src^="${V3_URL}"]`);
|
|
40
40
|
for (let i = 0; i < scripts.length; i++) {
|
|
41
41
|
const script = scripts[i];
|
|
@@ -62,7 +62,7 @@ const injectScript = (params) => {
|
|
|
62
62
|
headBody.appendChild(script);
|
|
63
63
|
return script;
|
|
64
64
|
};
|
|
65
|
-
const
|
|
65
|
+
const zonosStripeLoadScript = (params) => {
|
|
66
66
|
// Ensure that we only attempt to load Stripe.js at most once
|
|
67
67
|
if (stripePromise$1 !== null) {
|
|
68
68
|
return stripePromise$1;
|
|
@@ -82,7 +82,7 @@ const loadScript = (params) => {
|
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
try {
|
|
85
|
-
let script =
|
|
85
|
+
let script = zonosStripeFindScript();
|
|
86
86
|
if (script && params) {
|
|
87
87
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
88
88
|
}
|
|
@@ -126,7 +126,7 @@ const initStripe = (maybeStripe, args, startTime) => {
|
|
|
126
126
|
|
|
127
127
|
// Execute our own script injection after a tick to give users time to do their
|
|
128
128
|
// own script injection.
|
|
129
|
-
const stripePromise = Promise.resolve().then(() =>
|
|
129
|
+
const stripePromise = Promise.resolve().then(() => zonosStripeLoadScript(null));
|
|
130
130
|
let loadCalled = false;
|
|
131
131
|
stripePromise.catch((err) => {
|
|
132
132
|
if (!loadCalled) {
|
|
@@ -134,14 +134,15 @@ stripePromise.catch((err) => {
|
|
|
134
134
|
console.warn(err);
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
|
-
const
|
|
137
|
+
const zonosLoadStripe = async (...args) => {
|
|
138
138
|
loadCalled = true;
|
|
139
139
|
const startTime = Date.now();
|
|
140
140
|
return stripePromise.then(maybeStripe => initStripe(maybeStripe, args, startTime));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
var _a;
|
|
144
|
-
const ZONOS_URL = "https://
|
|
144
|
+
const ZONOS_URL = "https://v1.1.2.js.zonos.com";
|
|
145
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.1.2";
|
|
145
146
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
146
147
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
147
148
|
class Zonos {
|
|
@@ -155,7 +156,7 @@ Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSett
|
|
|
155
156
|
// do nothing if zonos is already initializeds
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
|
-
log(
|
|
159
|
+
log(`====== ZONOS DEBUG MODE: on (v${"1.1.2"}) ======`);
|
|
159
160
|
if (!zonosApiKey) {
|
|
160
161
|
logError('Missing Zonos API key');
|
|
161
162
|
return;
|
|
@@ -201,7 +202,7 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
201
202
|
zonosController.addEventListener('stripeInitEvent', async (event) => {
|
|
202
203
|
const { detail } = event;
|
|
203
204
|
log('loading Stripe');
|
|
204
|
-
const stripe = await
|
|
205
|
+
const stripe = await zonosLoadStripe(detail.publishableKey);
|
|
205
206
|
if (!stripe) {
|
|
206
207
|
logError('API seems to be invalid or missing. Failed to load Stripe');
|
|
207
208
|
return;
|
|
@@ -213,32 +214,93 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
213
214
|
// eslint-disable-next-line no-console
|
|
214
215
|
log('Zonos controller injected!');
|
|
215
216
|
};
|
|
216
|
-
Zonos.
|
|
217
|
+
Zonos.injectScript = ({ fallBackDomain, isModule, scriptDomain, theRestUrl, }) => {
|
|
218
|
+
const fullScriptUrl = `${scriptDomain}/${theRestUrl}`;
|
|
217
219
|
const findScript = () => {
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
if (script.src.indexOf('zonos-elements.js')) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
return false;
|
|
220
|
+
const script = document.querySelector(`script[src="${fullScriptUrl}"]`);
|
|
221
|
+
return !!script;
|
|
225
222
|
};
|
|
226
|
-
if (findScript())
|
|
223
|
+
if (findScript()) {
|
|
224
|
+
// eslint-disable-next-line no-console
|
|
225
|
+
log(`Zonos script "${fullScriptUrl}" already exists in the document`, 'warn');
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
227
228
|
const headOrBody = document.head || document.body;
|
|
228
229
|
// init zonos elements when the zonosKey is valid
|
|
229
230
|
// inject esmodule cdn for zonos elements
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
const script = document.createElement('script');
|
|
232
|
+
if (!!isModule) {
|
|
233
|
+
script.type = 'module';
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
script.noModule = true;
|
|
237
|
+
}
|
|
238
|
+
script.src = fullScriptUrl;
|
|
239
|
+
script.onerror = () => {
|
|
240
|
+
// only fallback if the stylesheetDomain is versioned. (https://v1.2.3.something.com || https://v1.something.com)
|
|
241
|
+
const isVersioned = /\/\/v\d+\./g.test(scriptDomain);
|
|
242
|
+
if (!isVersioned) {
|
|
243
|
+
log('No need to fallback since this is not a versioned domain', 'warn');
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (fallBackDomain) {
|
|
247
|
+
_a.injectScript({
|
|
248
|
+
isModule,
|
|
249
|
+
scriptDomain: fallBackDomain,
|
|
250
|
+
theRestUrl,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
logError(`Failed to load ${script.src}`);
|
|
254
|
+
};
|
|
255
|
+
headOrBody.appendChild(script);
|
|
256
|
+
};
|
|
257
|
+
Zonos.injectZonosCdn = () => {
|
|
258
|
+
// init zonos elements when the zonosKey is valid
|
|
259
|
+
// inject esmodule cdn for zonos elements
|
|
260
|
+
_a.injectScript({
|
|
261
|
+
fallBackDomain: UNPKG_ZONOS_URL,
|
|
262
|
+
isModule: true,
|
|
263
|
+
scriptDomain: ZONOS_URL,
|
|
264
|
+
theRestUrl: 'dist/zonos-elements/zonos-elements.esm.js',
|
|
265
|
+
});
|
|
234
266
|
// inject non module cdn for zonos elements
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
267
|
+
_a.injectScript({
|
|
268
|
+
fallBackDomain: UNPKG_ZONOS_URL,
|
|
269
|
+
isModule: false,
|
|
270
|
+
scriptDomain: ZONOS_URL,
|
|
271
|
+
theRestUrl: 'dist/zonos-elements/zonos-elements.js',
|
|
272
|
+
});
|
|
239
273
|
// eslint-disable-next-line no-console
|
|
240
274
|
log('Zonos cdn script injected!');
|
|
241
275
|
};
|
|
276
|
+
Zonos.injectStylesheet = ({ fallBackDomain, stylesheetDomain, theRestUrl, }) => {
|
|
277
|
+
const headOrBody = document.head || document.body;
|
|
278
|
+
// inject preconnect css for zonos elements
|
|
279
|
+
const zonosCssPreconnect = document.createElement('link');
|
|
280
|
+
zonosCssPreconnect.rel = 'preconnect';
|
|
281
|
+
zonosCssPreconnect.href = `${ZONOS_URL}/`;
|
|
282
|
+
headOrBody.appendChild(zonosCssPreconnect);
|
|
283
|
+
// inject css for zonos elements
|
|
284
|
+
const zonosCss = document.createElement('link');
|
|
285
|
+
zonosCss.rel = 'stylesheet';
|
|
286
|
+
zonosCss.href = `${stylesheetDomain}/${theRestUrl}`;
|
|
287
|
+
zonosCss.onerror = () => {
|
|
288
|
+
// only fallback if the stylesheetDomain is versioned. (https://v1.2.3.something.com || https://v1.something.com)
|
|
289
|
+
const isVersioned = /\/\/v\d+\./g.test(stylesheetDomain);
|
|
290
|
+
if (!isVersioned) {
|
|
291
|
+
log('No need to fallback since this is not a versioned domain', 'warn');
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (fallBackDomain && isVersioned) {
|
|
295
|
+
_a.injectStylesheet({
|
|
296
|
+
stylesheetDomain: fallBackDomain,
|
|
297
|
+
theRestUrl,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
logError(`Failed to load ${zonosCss.href}`);
|
|
301
|
+
};
|
|
302
|
+
headOrBody.appendChild(zonosCss);
|
|
303
|
+
};
|
|
242
304
|
Zonos.injectZonosCss = () => {
|
|
243
305
|
const findStyleLink = () => {
|
|
244
306
|
return !!document.querySelector(`link[rel="stylesheet"][href^="${ZONOS_URL}/dist/zonos-elements/zonos-elements.css"]`);
|
|
@@ -248,17 +310,12 @@ Zonos.injectZonosCss = () => {
|
|
|
248
310
|
log('Zonos style links already injected', 'warn');
|
|
249
311
|
return;
|
|
250
312
|
}
|
|
251
|
-
const headOrBody = document.head || document.body;
|
|
252
313
|
// inject css for zonos elements
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const zonosCss = document.createElement('link');
|
|
259
|
-
zonosCss.rel = 'stylesheet';
|
|
260
|
-
zonosCss.href = `${ZONOS_URL}/dist/zonos-elements/zonos-elements.css`;
|
|
261
|
-
headOrBody.appendChild(zonosCss);
|
|
314
|
+
_a.injectStylesheet({
|
|
315
|
+
fallBackDomain: UNPKG_ZONOS_URL,
|
|
316
|
+
stylesheetDomain: ZONOS_URL,
|
|
317
|
+
theRestUrl: 'dist/zonos-elements/zonos-elements.css',
|
|
318
|
+
});
|
|
262
319
|
// eslint-disable-next-line no-console
|
|
263
320
|
log('Zonos style css injected!');
|
|
264
321
|
};
|
package/dist/scripts/stripe.js
CHANGED
|
@@ -10,7 +10,7 @@ const logError = (message, ...rest) => {
|
|
|
10
10
|
const V3_URL = 'https://js.stripe.com/v3';
|
|
11
11
|
const V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
12
12
|
const EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
|
|
13
|
-
const
|
|
13
|
+
const zonosStripeFindScript = () => {
|
|
14
14
|
const scripts = document.querySelectorAll(`script[src^="${V3_URL}"]`);
|
|
15
15
|
for (let i = 0; i < scripts.length; i++) {
|
|
16
16
|
const script = scripts[i];
|
|
@@ -37,7 +37,7 @@ const injectScript = (params) => {
|
|
|
37
37
|
headBody.appendChild(script);
|
|
38
38
|
return script;
|
|
39
39
|
};
|
|
40
|
-
const
|
|
40
|
+
const zonosStripeLoadScript = (params) => {
|
|
41
41
|
// Ensure that we only attempt to load Stripe.js at most once
|
|
42
42
|
if (stripePromise !== null) {
|
|
43
43
|
return stripePromise;
|
|
@@ -57,7 +57,7 @@ const loadScript = (params) => {
|
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
try {
|
|
60
|
-
let script =
|
|
60
|
+
let script = zonosStripeFindScript();
|
|
61
61
|
if (script && params) {
|
|
62
62
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
63
63
|
}
|
|
@@ -119,8 +119,8 @@ but received
|
|
|
119
119
|
logError(errorMessage);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
exports.findScript = findScript;
|
|
123
122
|
exports.initStripe = initStripe;
|
|
124
123
|
exports.injectScript = injectScript;
|
|
125
|
-
exports.loadScript = loadScript;
|
|
126
124
|
exports.validateLoadParams = validateLoadParams;
|
|
125
|
+
exports.zonosStripeFindScript = zonosStripeFindScript;
|
|
126
|
+
exports.zonosStripeLoadScript = zonosStripeLoadScript;
|
package/dist/scripts/zonos.js
CHANGED
|
@@ -35,7 +35,7 @@ const logError = (message, ...rest) => {
|
|
|
35
35
|
const V3_URL = 'https://js.stripe.com/v3';
|
|
36
36
|
const V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
37
37
|
const EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
|
|
38
|
-
const
|
|
38
|
+
const zonosStripeFindScript = () => {
|
|
39
39
|
const scripts = document.querySelectorAll(`script[src^="${V3_URL}"]`);
|
|
40
40
|
for (let i = 0; i < scripts.length; i++) {
|
|
41
41
|
const script = scripts[i];
|
|
@@ -62,7 +62,7 @@ const injectScript = (params) => {
|
|
|
62
62
|
headBody.appendChild(script);
|
|
63
63
|
return script;
|
|
64
64
|
};
|
|
65
|
-
const
|
|
65
|
+
const zonosStripeLoadScript = (params) => {
|
|
66
66
|
// Ensure that we only attempt to load Stripe.js at most once
|
|
67
67
|
if (stripePromise$1 !== null) {
|
|
68
68
|
return stripePromise$1;
|
|
@@ -82,7 +82,7 @@ const loadScript = (params) => {
|
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
try {
|
|
85
|
-
let script =
|
|
85
|
+
let script = zonosStripeFindScript();
|
|
86
86
|
if (script && params) {
|
|
87
87
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
88
88
|
}
|
|
@@ -126,7 +126,7 @@ const initStripe = (maybeStripe, args, startTime) => {
|
|
|
126
126
|
|
|
127
127
|
// Execute our own script injection after a tick to give users time to do their
|
|
128
128
|
// own script injection.
|
|
129
|
-
const stripePromise = Promise.resolve().then(() =>
|
|
129
|
+
const stripePromise = Promise.resolve().then(() => zonosStripeLoadScript(null));
|
|
130
130
|
let loadCalled = false;
|
|
131
131
|
stripePromise.catch((err) => {
|
|
132
132
|
if (!loadCalled) {
|
|
@@ -134,14 +134,15 @@ stripePromise.catch((err) => {
|
|
|
134
134
|
console.warn(err);
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
|
-
const
|
|
137
|
+
const zonosLoadStripe = async (...args) => {
|
|
138
138
|
loadCalled = true;
|
|
139
139
|
const startTime = Date.now();
|
|
140
140
|
return stripePromise.then(maybeStripe => initStripe(maybeStripe, args, startTime));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
var _a;
|
|
144
|
-
const ZONOS_URL = "https://
|
|
144
|
+
const ZONOS_URL = "https://v1.1.2.js.zonos.com";
|
|
145
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.1.2";
|
|
145
146
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
146
147
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
147
148
|
class Zonos {
|
|
@@ -155,7 +156,7 @@ Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSett
|
|
|
155
156
|
// do nothing if zonos is already initializeds
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
|
-
log(
|
|
159
|
+
log(`====== ZONOS DEBUG MODE: on (v${"1.1.2"}) ======`);
|
|
159
160
|
if (!zonosApiKey) {
|
|
160
161
|
logError('Missing Zonos API key');
|
|
161
162
|
return;
|
|
@@ -201,7 +202,7 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
201
202
|
zonosController.addEventListener('stripeInitEvent', async (event) => {
|
|
202
203
|
const { detail } = event;
|
|
203
204
|
log('loading Stripe');
|
|
204
|
-
const stripe = await
|
|
205
|
+
const stripe = await zonosLoadStripe(detail.publishableKey);
|
|
205
206
|
if (!stripe) {
|
|
206
207
|
logError('API seems to be invalid or missing. Failed to load Stripe');
|
|
207
208
|
return;
|
|
@@ -213,32 +214,93 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
213
214
|
// eslint-disable-next-line no-console
|
|
214
215
|
log('Zonos controller injected!');
|
|
215
216
|
};
|
|
216
|
-
Zonos.
|
|
217
|
+
Zonos.injectScript = ({ fallBackDomain, isModule, scriptDomain, theRestUrl, }) => {
|
|
218
|
+
const fullScriptUrl = `${scriptDomain}/${theRestUrl}`;
|
|
217
219
|
const findScript = () => {
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
if (script.src.indexOf('zonos-elements.js')) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
return false;
|
|
220
|
+
const script = document.querySelector(`script[src="${fullScriptUrl}"]`);
|
|
221
|
+
return !!script;
|
|
225
222
|
};
|
|
226
|
-
if (findScript())
|
|
223
|
+
if (findScript()) {
|
|
224
|
+
// eslint-disable-next-line no-console
|
|
225
|
+
log(`Zonos script "${fullScriptUrl}" already exists in the document`, 'warn');
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
227
228
|
const headOrBody = document.head || document.body;
|
|
228
229
|
// init zonos elements when the zonosKey is valid
|
|
229
230
|
// inject esmodule cdn for zonos elements
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
const script = document.createElement('script');
|
|
232
|
+
if (!!isModule) {
|
|
233
|
+
script.type = 'module';
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
script.noModule = true;
|
|
237
|
+
}
|
|
238
|
+
script.src = fullScriptUrl;
|
|
239
|
+
script.onerror = () => {
|
|
240
|
+
// only fallback if the stylesheetDomain is versioned. (https://v1.2.3.something.com || https://v1.something.com)
|
|
241
|
+
const isVersioned = /\/\/v\d+\./g.test(scriptDomain);
|
|
242
|
+
if (!isVersioned) {
|
|
243
|
+
log('No need to fallback since this is not a versioned domain', 'warn');
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (fallBackDomain) {
|
|
247
|
+
_a.injectScript({
|
|
248
|
+
isModule,
|
|
249
|
+
scriptDomain: fallBackDomain,
|
|
250
|
+
theRestUrl,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
logError(`Failed to load ${script.src}`);
|
|
254
|
+
};
|
|
255
|
+
headOrBody.appendChild(script);
|
|
256
|
+
};
|
|
257
|
+
Zonos.injectZonosCdn = () => {
|
|
258
|
+
// init zonos elements when the zonosKey is valid
|
|
259
|
+
// inject esmodule cdn for zonos elements
|
|
260
|
+
_a.injectScript({
|
|
261
|
+
fallBackDomain: UNPKG_ZONOS_URL,
|
|
262
|
+
isModule: true,
|
|
263
|
+
scriptDomain: ZONOS_URL,
|
|
264
|
+
theRestUrl: 'dist/zonos-elements/zonos-elements.esm.js',
|
|
265
|
+
});
|
|
234
266
|
// inject non module cdn for zonos elements
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
267
|
+
_a.injectScript({
|
|
268
|
+
fallBackDomain: UNPKG_ZONOS_URL,
|
|
269
|
+
isModule: false,
|
|
270
|
+
scriptDomain: ZONOS_URL,
|
|
271
|
+
theRestUrl: 'dist/zonos-elements/zonos-elements.js',
|
|
272
|
+
});
|
|
239
273
|
// eslint-disable-next-line no-console
|
|
240
274
|
log('Zonos cdn script injected!');
|
|
241
275
|
};
|
|
276
|
+
Zonos.injectStylesheet = ({ fallBackDomain, stylesheetDomain, theRestUrl, }) => {
|
|
277
|
+
const headOrBody = document.head || document.body;
|
|
278
|
+
// inject preconnect css for zonos elements
|
|
279
|
+
const zonosCssPreconnect = document.createElement('link');
|
|
280
|
+
zonosCssPreconnect.rel = 'preconnect';
|
|
281
|
+
zonosCssPreconnect.href = `${ZONOS_URL}/`;
|
|
282
|
+
headOrBody.appendChild(zonosCssPreconnect);
|
|
283
|
+
// inject css for zonos elements
|
|
284
|
+
const zonosCss = document.createElement('link');
|
|
285
|
+
zonosCss.rel = 'stylesheet';
|
|
286
|
+
zonosCss.href = `${stylesheetDomain}/${theRestUrl}`;
|
|
287
|
+
zonosCss.onerror = () => {
|
|
288
|
+
// only fallback if the stylesheetDomain is versioned. (https://v1.2.3.something.com || https://v1.something.com)
|
|
289
|
+
const isVersioned = /\/\/v\d+\./g.test(stylesheetDomain);
|
|
290
|
+
if (!isVersioned) {
|
|
291
|
+
log('No need to fallback since this is not a versioned domain', 'warn');
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (fallBackDomain && isVersioned) {
|
|
295
|
+
_a.injectStylesheet({
|
|
296
|
+
stylesheetDomain: fallBackDomain,
|
|
297
|
+
theRestUrl,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
logError(`Failed to load ${zonosCss.href}`);
|
|
301
|
+
};
|
|
302
|
+
headOrBody.appendChild(zonosCss);
|
|
303
|
+
};
|
|
242
304
|
Zonos.injectZonosCss = () => {
|
|
243
305
|
const findStyleLink = () => {
|
|
244
306
|
return !!document.querySelector(`link[rel="stylesheet"][href^="${ZONOS_URL}/dist/zonos-elements/zonos-elements.css"]`);
|
|
@@ -248,17 +310,12 @@ Zonos.injectZonosCss = () => {
|
|
|
248
310
|
log('Zonos style links already injected', 'warn');
|
|
249
311
|
return;
|
|
250
312
|
}
|
|
251
|
-
const headOrBody = document.head || document.body;
|
|
252
313
|
// inject css for zonos elements
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const zonosCss = document.createElement('link');
|
|
259
|
-
zonosCss.rel = 'stylesheet';
|
|
260
|
-
zonosCss.href = `${ZONOS_URL}/dist/zonos-elements/zonos-elements.css`;
|
|
261
|
-
headOrBody.appendChild(zonosCss);
|
|
314
|
+
_a.injectStylesheet({
|
|
315
|
+
fallBackDomain: UNPKG_ZONOS_URL,
|
|
316
|
+
stylesheetDomain: ZONOS_URL,
|
|
317
|
+
theRestUrl: 'dist/zonos-elements/zonos-elements.css',
|
|
318
|
+
});
|
|
262
319
|
// eslint-disable-next-line no-console
|
|
263
320
|
log('Zonos style css injected!');
|
|
264
321
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type AppearanceConfig } from "../../store/zonosStore";
|
|
2
2
|
import type { HelloMobileLocation } from "../../../types/generated/graphql.customer.types";
|
|
3
|
+
import type { Product } from "../../../types/hello/Product";
|
|
4
|
+
import type { RestrictedItem } from "../../../types/hello/RestrictedItem";
|
|
3
5
|
export declare class ZonosHello {
|
|
4
6
|
private helloRef?;
|
|
5
7
|
/**
|
|
@@ -20,9 +22,30 @@ export declare class ZonosHello {
|
|
|
20
22
|
zonosStoreHelloSettings: import("../../..").HelloConfig;
|
|
21
23
|
showDialog: boolean;
|
|
22
24
|
peekMessage: string | null;
|
|
25
|
+
initialUrl: string;
|
|
26
|
+
/**
|
|
27
|
+
* This array will hold all restricted items handled by Hello thus far
|
|
28
|
+
*/
|
|
29
|
+
allRestrictedItems: RestrictedItem[];
|
|
30
|
+
/**
|
|
31
|
+
* This array will hold all products handled by Hello thus far
|
|
32
|
+
*/
|
|
33
|
+
allFoundProducts: Product[];
|
|
34
|
+
/**
|
|
35
|
+
* This array will hold all products currently on the page
|
|
36
|
+
*/
|
|
37
|
+
productsOnPage: Product[];
|
|
23
38
|
private getHelloPeekMessage;
|
|
24
39
|
private enableShowPeekMessage;
|
|
25
|
-
|
|
40
|
+
private getNewItemRestrictions;
|
|
41
|
+
private triggerShowPeekMessage;
|
|
42
|
+
private disableAddToCartButtons;
|
|
43
|
+
private handleItemRestrictions;
|
|
44
|
+
private reloadHelloData;
|
|
45
|
+
private handleProductCountChange;
|
|
46
|
+
private watchProductCountChange;
|
|
47
|
+
private updateHelloOnPageChange;
|
|
48
|
+
componentWillLoad(): void;
|
|
26
49
|
/**
|
|
27
50
|
* This method will trigger the currency conversion and display the converted value
|
|
28
51
|
* @returns void
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
import type { AppearanceConfig, HelloMobileLocation } from "../../../types/index";
|
|
3
|
+
import type { RestrictedItem } from "../../../types/hello/RestrictedItem";
|
|
3
4
|
export declare class ZonosHelloDialog {
|
|
4
5
|
/**
|
|
5
6
|
* Whether or not the dialog is open
|
|
@@ -24,6 +25,11 @@ export declare class ZonosHelloDialog {
|
|
|
24
25
|
* Override the appearance settings
|
|
25
26
|
*/
|
|
26
27
|
appearanceSettings?: Partial<AppearanceConfig>;
|
|
28
|
+
/**
|
|
29
|
+
* Item restrictions array if any
|
|
30
|
+
* @default []
|
|
31
|
+
*/
|
|
32
|
+
restrictedItems: RestrictedItem[];
|
|
27
33
|
welcomeMessage: string;
|
|
28
34
|
showCountrySelect: boolean;
|
|
29
35
|
/**
|
|
@@ -83,6 +83,12 @@ export declare const stringsArabic: {
|
|
|
83
83
|
'Prepay duties and taxes at checkout': {
|
|
84
84
|
value: string;
|
|
85
85
|
};
|
|
86
|
+
'Restricted item': {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
'Restricted items found': {
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
86
92
|
'See duty and tax thresholds': {
|
|
87
93
|
value: string;
|
|
88
94
|
};
|
|
@@ -131,6 +137,9 @@ export declare const stringsArabic: {
|
|
|
131
137
|
'business days': {
|
|
132
138
|
value: string;
|
|
133
139
|
};
|
|
140
|
+
'click to learn more': {
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
134
143
|
'duty free': {
|
|
135
144
|
value: string;
|
|
136
145
|
};
|
|
@@ -83,6 +83,12 @@ export declare const stringsBase: {
|
|
|
83
83
|
'Prepay duties and taxes at checkout': {
|
|
84
84
|
value: string;
|
|
85
85
|
};
|
|
86
|
+
'Restricted item': {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
'Restricted items found': {
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
86
92
|
'See duty and tax thresholds': {
|
|
87
93
|
value: string;
|
|
88
94
|
};
|
|
@@ -131,6 +137,9 @@ export declare const stringsBase: {
|
|
|
131
137
|
'business days': {
|
|
132
138
|
value: string;
|
|
133
139
|
};
|
|
140
|
+
'click to learn more': {
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
134
143
|
'duty free': {
|
|
135
144
|
value: string;
|
|
136
145
|
};
|
|
@@ -83,6 +83,12 @@ export declare const stringsChinese: {
|
|
|
83
83
|
'Prepay duties and taxes at checkout': {
|
|
84
84
|
value: string;
|
|
85
85
|
};
|
|
86
|
+
'Restricted item': {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
'Restricted items found': {
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
86
92
|
'See duty and tax thresholds': {
|
|
87
93
|
value: string;
|
|
88
94
|
};
|
|
@@ -131,6 +137,9 @@ export declare const stringsChinese: {
|
|
|
131
137
|
'business days': {
|
|
132
138
|
value: string;
|
|
133
139
|
};
|
|
140
|
+
'click to learn more': {
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
134
143
|
'duty free': {
|
|
135
144
|
value: string;
|
|
136
145
|
};
|
|
@@ -83,6 +83,12 @@ export declare const stringsDanish: {
|
|
|
83
83
|
'Prepay duties and taxes at checkout': {
|
|
84
84
|
value: string;
|
|
85
85
|
};
|
|
86
|
+
'Restricted item': {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
'Restricted items found': {
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
86
92
|
'See duty and tax thresholds': {
|
|
87
93
|
value: string;
|
|
88
94
|
};
|
|
@@ -131,6 +137,9 @@ export declare const stringsDanish: {
|
|
|
131
137
|
'business days': {
|
|
132
138
|
value: string;
|
|
133
139
|
};
|
|
140
|
+
'click to learn more': {
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
134
143
|
'duty free': {
|
|
135
144
|
value: string;
|
|
136
145
|
};
|
|
@@ -83,6 +83,12 @@ export declare const stringsDutch: {
|
|
|
83
83
|
'Prepay duties and taxes at checkout': {
|
|
84
84
|
value: string;
|
|
85
85
|
};
|
|
86
|
+
'Restricted item': {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
'Restricted items found': {
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
86
92
|
'See duty and tax thresholds': {
|
|
87
93
|
value: string;
|
|
88
94
|
};
|
|
@@ -131,6 +137,9 @@ export declare const stringsDutch: {
|
|
|
131
137
|
'business days': {
|
|
132
138
|
value: string;
|
|
133
139
|
};
|
|
140
|
+
'click to learn more': {
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
134
143
|
'duty free': {
|
|
135
144
|
value: string;
|
|
136
145
|
};
|
|
@@ -83,6 +83,12 @@ export declare const stringsFrench: {
|
|
|
83
83
|
'Prepay duties and taxes at checkout': {
|
|
84
84
|
value: string;
|
|
85
85
|
};
|
|
86
|
+
'Restricted item': {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
'Restricted items found': {
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
86
92
|
'See duty and tax thresholds': {
|
|
87
93
|
value: string;
|
|
88
94
|
};
|
|
@@ -131,6 +137,9 @@ export declare const stringsFrench: {
|
|
|
131
137
|
'business days': {
|
|
132
138
|
value: string;
|
|
133
139
|
};
|
|
140
|
+
'click to learn more': {
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
134
143
|
'duty free': {
|
|
135
144
|
value: string;
|
|
136
145
|
};
|
|
@@ -83,6 +83,12 @@ export declare const stringsGerman: {
|
|
|
83
83
|
'Prepay duties and taxes at checkout': {
|
|
84
84
|
value: string;
|
|
85
85
|
};
|
|
86
|
+
'Restricted item': {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
'Restricted items found': {
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
86
92
|
'See duty and tax thresholds': {
|
|
87
93
|
value: string;
|
|
88
94
|
};
|
|
@@ -131,6 +137,9 @@ export declare const stringsGerman: {
|
|
|
131
137
|
'business days': {
|
|
132
138
|
value: string;
|
|
133
139
|
};
|
|
140
|
+
'click to learn more': {
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
134
143
|
'duty free': {
|
|
135
144
|
value: string;
|
|
136
145
|
};
|