@zonos/elements 1.3.183 → 1.3.185
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-3d0c0f0b.js → cart-f9df3ac8.js} +3209 -10
- package/dist/cjs/debounce-3eaa4f7e.js +357 -0
- package/dist/cjs/{getBorderRadius-94ef609c.js → getBorderRadius-87f3b69c.js} +1 -1
- package/dist/cjs/getGenericSettingsOverride-c0ca32b9.js +104 -0
- package/dist/cjs/helpers-5bdbb68c.js +100 -0
- package/dist/cjs/{index-2f90486e.js → index-0993f42d.js} +15 -3
- package/dist/cjs/index.cjs.js +41 -9
- package/dist/cjs/{isDarkColor-ec4a4e7d.js → isDarkColor-d0c67c3d.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{paypal-9eaa9196.js → paypal-5e73c8f5.js} +3 -3
- package/dist/cjs/zonos-address_11.cjs.entry.js +7917 -0
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_3.cjs.entry.js +18 -7
- package/dist/cjs/zonos-card.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +113 -21
- package/dist/cjs/zonos-checkout.cjs.entry.js +24 -10
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +233 -8
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +2 -2
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +8 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
- package/dist/cjs/zonos-hello.cjs.entry.js +7 -358
- package/dist/cjs/zonos-input.cjs.entry.js +3 -3
- 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-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +31 -12
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-toggle.cjs.entry.js +4 -4
- package/dist/cjs/zonos-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
- package/dist/cjs/{zonosStore-3812b318.js → zonosStore-adc42868.js} +2 -1
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +11 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +37 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +162 -17
- package/dist/collection/components/common/zonos-button/zonos-button.js +14 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +5 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +2 -2
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +0 -6
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +2 -2
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +2 -3
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +105 -8
- package/dist/collection/components/common/zonos-stripe-phone-input/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.css +222 -0
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +481 -0
- package/dist/collection/components/common/zonos-stripe-select/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/common/zonos-stripe-select/assets/RemoveLineIcon.svg +1 -0
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.css +178 -0
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +455 -0
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- 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 +24 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +24 -7
- package/dist/collection/components/store/translationStore/strings.arabic.js +159 -0
- package/dist/collection/components/store/translationStore/strings.base.js +161 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +159 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +159 -0
- package/dist/collection/components/store/translationStore/strings.french.js +159 -0
- package/dist/collection/components/store/translationStore/strings.german.js +159 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +159 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +159 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +159 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +159 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +159 -0
- package/dist/collection/components/store/zonosStore.js +1 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/assets/RemoveIcon.svg +1 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.css +86 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +192 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +67 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +978 -0
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/api/getGenericSettingsOverride.js +10 -0
- package/dist/collection/components/utils/api/getZonosSettings.js +7 -1
- package/dist/collection/components/utils/checkout/form/helpers.js +95 -0
- package/dist/collection/components/utils/checkout/form/isValidZip.js +18 -0
- package/dist/collection/components/utils/checkout/initCheckout.js +8 -1
- package/dist/collection/components/utils/iframe/CheckoutAddressService.js +193 -0
- package/dist/collection/components/utils/iframe/IframeHelpers.js +86 -0
- package/dist/collection/components/utils/mergeAddress.js +5 -0
- package/dist/collection/constants/phone-formats.js +658 -0
- package/dist/collection/scripts/_getCartInfoById.js +7 -1
- package/dist/collection/scripts/_zonosBase.js +29 -1
- package/dist/collection/types/CountryFields.js +1 -0
- package/dist/collection/types/checkout/form/CustomAddressErrors.js +1 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +11 -0
- package/dist/collection/types/generated/graphql.internal.types.js +129 -0
- package/dist/collection/types/index.js +0 -1
- package/dist/esm/{cart-3fb04f1f.js → cart-4725a63b.js} +3209 -10
- package/dist/esm/debounce-3cf0793c.js +355 -0
- package/dist/esm/{getBorderRadius-ada3ccad.js → getBorderRadius-a9a48f79.js} +1 -1
- package/dist/esm/getGenericSettingsOverride-0bc3e118.js +99 -0
- package/dist/esm/helpers-2f6955b1.js +97 -0
- package/dist/esm/{index-d82f06f2.js → index-a457c60c.js} +15 -3
- package/dist/esm/index.js +41 -9
- package/dist/esm/{isDarkColor-446fccb7.js → isDarkColor-62cbddb5.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{paypal-1f2e863c.js → paypal-a09943f4.js} +3 -3
- package/dist/esm/zonos-address_11.entry.js +7903 -0
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_3.entry.js +18 -7
- package/dist/esm/zonos-card.entry.js +3 -3
- package/dist/esm/zonos-cart-items_13.entry.js +113 -21
- package/dist/esm/zonos-checkout.entry.js +24 -10
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +233 -8
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +3 -3
- package/dist/esm/zonos-empty-state-payment_4.entry.js +8 -8
- package/dist/esm/zonos-hello-dialog.entry.js +9 -9
- package/dist/esm/zonos-hello.entry.js +6 -357
- package/dist/esm/zonos-input.entry.js +3 -3
- 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-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-stripe-input.entry.js +31 -12
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-toggle.entry.js +4 -4
- package/dist/esm/zonos-tooltip.entry.js +3 -3
- package/dist/esm/zonos-v-stack.entry.js +4 -4
- package/dist/esm/{zonosStore-d3c5a0a5.js → zonosStore-1ce34e04.js} +2 -1
- package/dist/esm-es5/cart-4725a63b.js +1 -0
- package/dist/esm-es5/debounce-3cf0793c.js +1 -0
- package/dist/esm-es5/{getBorderRadius-ada3ccad.js → getBorderRadius-a9a48f79.js} +1 -1
- package/dist/esm-es5/getGenericSettingsOverride-0bc3e118.js +1 -0
- package/dist/esm-es5/helpers-2f6955b1.js +1 -0
- package/dist/esm-es5/index-a457c60c.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-446fccb7.js → isDarkColor-62cbddb5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-1f2e863c.js → paypal-a09943f4.js} +1 -1
- package/dist/esm-es5/zonos-address_11.entry.js +1 -0
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- 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-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-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-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-toggle.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/esm-es5/{zonosStore-d3c5a0a5.js → zonosStore-1ce34e04.js} +1 -1
- package/dist/scripts/index.d.ts +3905 -3284
- 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-checkout.d.ts +4 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +28 -1
- package/dist/types/components/common/zonos-button/zonos-button.d.ts +4 -0
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
- package/dist/types/components/common/zonos-stripe-input/zonos-stripe-input.d.ts +22 -0
- package/dist/types/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.d.ts +88 -0
- package/dist/types/components/common/zonos-stripe-select/zonos-stripe-select.d.ts +86 -0
- package/dist/types/components/main/zonos-controller.d.ts +1 -0
- package/dist/types/components/store/checkout/stripe.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +159 -0
- package/dist/types/components/store/zonosStore.d.ts +6 -1
- package/dist/types/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.d.ts +38 -0
- package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +150 -0
- package/dist/types/components/utils/api/getGenericSettingsOverride.d.ts +5 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/getZonosSettings.d.ts +2 -2
- package/dist/types/components/utils/checkout/form/helpers.d.ts +19 -0
- package/dist/types/components/utils/checkout/form/isValidZip.d.ts +5 -0
- package/dist/types/components/utils/iframe/CheckoutAddressService.d.ts +38 -0
- package/dist/types/components/utils/iframe/IframeHelpers.d.ts +81 -0
- package/dist/types/components/utils/mergeAddress.d.ts +4 -0
- package/dist/types/components/utils/resetToSelectedTab.d.ts +1 -1
- package/dist/types/components.d.ts +472 -4
- package/dist/types/constants/phone-formats.d.ts +5 -0
- package/dist/types/environment.d.ts +1 -1
- package/dist/types/scripts/_zonosBase.d.ts +13 -1
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
- package/dist/types/types/CountryFields.d.ts +40 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +7 -0
- package/dist/types/types/checkout/form/CustomAddressErrors.d.ts +13 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +166 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +148 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +180 -8
- package/dist/types/types/generated/graphql.internal.types.ts +218 -8
- package/dist/types/types/global.d.ts +1 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/utils/ZonosSettings.d.ts +17 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-4622cca6.entry.js → p-0104d3ba.entry.js} +1 -1
- package/dist/zonos-elements/{p-7cb87ea7.system.entry.js → p-04303b56.system.entry.js} +1 -1
- package/dist/zonos-elements/p-06f798ee.system.js +1 -0
- package/dist/zonos-elements/{p-739014f8.system.entry.js → p-0fdd7034.system.entry.js} +1 -1
- package/dist/zonos-elements/p-15dd7ea4.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a1cfbd0a.js → p-17299200.js} +1 -1
- package/dist/zonos-elements/{p-58f660d4.system.entry.js → p-1b29bc5f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fe2c27c4.entry.js → p-1e612c29.entry.js} +1 -1
- package/dist/zonos-elements/{p-98aa88b1.js → p-2097fae5.js} +1 -1
- package/dist/zonos-elements/{p-81084be5.system.entry.js → p-240ee490.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2416aaa1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-cedf08f0.entry.js → p-313ef896.entry.js} +1 -1
- package/dist/zonos-elements/{p-fa65b53d.entry.js → p-314fbfe1.entry.js} +1 -1
- package/dist/zonos-elements/{p-5187ba8f.system.js → p-31e90130.system.js} +1 -1
- package/dist/zonos-elements/{p-4ca666ea.system.entry.js → p-341f40c2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d49c6a3e.system.entry.js → p-35f33601.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4160bbc2.system.js +1 -0
- package/dist/zonos-elements/p-43633269.system.js +2 -0
- package/dist/zonos-elements/p-443b5db2.entry.js +1 -0
- package/dist/zonos-elements/p-46d3e378.system.entry.js +1 -0
- package/dist/zonos-elements/{p-3d221556.system.entry.js → p-488ad646.system.entry.js} +1 -1
- package/dist/zonos-elements/p-53ffdb91.js +1 -0
- package/dist/zonos-elements/p-56b56caa.system.entry.js +1 -0
- package/dist/zonos-elements/p-5e15616f.entry.js +1 -0
- package/dist/zonos-elements/{p-3eac4b10.entry.js → p-5f896e9a.entry.js} +1 -1
- package/dist/zonos-elements/{p-e8c70c7d.system.entry.js → p-609c32a3.system.entry.js} +1 -1
- package/dist/zonos-elements/p-64ea232c.system.entry.js +1 -0
- package/dist/zonos-elements/{p-f378b4d3.system.entry.js → p-678ccc3f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8048932d.entry.js → p-67b904c2.entry.js} +1 -1
- package/dist/zonos-elements/p-6b40da70.system.js +1 -0
- package/dist/zonos-elements/p-70d4d436.entry.js +1 -0
- package/dist/zonos-elements/{p-64dbc282.entry.js → p-818d6f17.entry.js} +1 -1
- package/dist/zonos-elements/{p-b5b9aa6c.entry.js → p-81ee1683.entry.js} +1 -1
- package/dist/zonos-elements/{p-236f32c8.system.entry.js → p-89fcd305.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4fa8524.system.entry.js → p-94a80d93.system.entry.js} +1 -1
- package/dist/zonos-elements/p-961620ae.entry.js +1 -0
- package/dist/zonos-elements/{p-4eff2f8a.system.entry.js → p-98e4a965.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5bebcfc2.system.js → p-9913c186.system.js} +1 -1
- package/dist/zonos-elements/{p-29e8c9e8.system.entry.js → p-991c85f1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-995761ea.system.entry.js +1 -0
- package/dist/zonos-elements/p-9a6eb099.entry.js +1 -0
- package/dist/zonos-elements/p-9a7a9b1c.entry.js +1 -0
- package/dist/zonos-elements/{p-d367c9ae.system.entry.js → p-9f7b9d66.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a2dab25e.system.entry.js +1 -0
- package/dist/zonos-elements/{p-587568b5.entry.js → p-aaff5dcc.entry.js} +1 -1
- package/dist/zonos-elements/{p-3731e7f5.entry.js → p-abc66a0b.entry.js} +1 -1
- package/dist/zonos-elements/{p-eb294265.entry.js → p-aca3a2bb.entry.js} +1 -1
- package/dist/zonos-elements/p-afa34aff.system.js +1 -0
- package/dist/zonos-elements/{p-69f84611.entry.js → p-b2241919.entry.js} +1 -1
- package/dist/zonos-elements/p-b5edee66.system.js +1 -0
- package/dist/zonos-elements/p-b610f70c.system.js +1 -0
- package/dist/zonos-elements/{p-69255ed2.system.js → p-bbbaea3a.system.js} +1 -1
- package/dist/zonos-elements/p-c137dc82.js +2 -0
- package/dist/zonos-elements/{p-be9e1818.system.entry.js → p-c140a0bd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-de221545.entry.js → p-cf6ae7dc.entry.js} +1 -1
- package/dist/zonos-elements/{p-90633d63.entry.js → p-d0f4b6c3.entry.js} +1 -1
- package/dist/zonos-elements/{p-112aecac.js → p-de462b9b.js} +2 -2
- package/dist/zonos-elements/{p-107b08c1.entry.js → p-e5d081d8.entry.js} +1 -1
- package/dist/zonos-elements/p-e7b0c156.js +1 -0
- package/dist/zonos-elements/{p-30fdcbee.js → p-e892fb29.js} +1 -1
- package/dist/zonos-elements/p-e90cb997.entry.js +1 -0
- package/dist/zonos-elements/{p-db3f381d.entry.js → p-e91b244c.entry.js} +1 -1
- package/dist/zonos-elements/{p-41dfc828.entry.js → p-e99354d5.entry.js} +1 -1
- package/dist/zonos-elements/p-ea6d87a1.system.js +1 -0
- package/dist/zonos-elements/p-eef5b0cc.js +1 -0
- package/dist/zonos-elements/{p-d0944cc8.system.entry.js → p-f3f27bf2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0e63259c.system.entry.js → p-f4cc688e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cc6d9f7d.entry.js → p-f7d3e48b.entry.js} +1 -1
- package/dist/zonos-elements/p-fa6de0f3.js +1 -0
- package/dist/zonos-elements/{p-c5c8f803.system.entry.js → p-fd348fd4.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +3 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +0 -772
- package/dist/esm/zonos-address_7.entry.js +0 -762
- package/dist/esm-es5/cart-3fb04f1f.js +0 -1
- package/dist/esm-es5/index-d82f06f2.js +0 -2
- package/dist/esm-es5/zonos-address_7.entry.js +0 -1
- package/dist/zonos-elements/p-358043a2.system.entry.js +0 -1
- package/dist/zonos-elements/p-43feb95e.entry.js +0 -1
- package/dist/zonos-elements/p-46f6e5e9.system.js +0 -1
- package/dist/zonos-elements/p-4aca92c5.system.entry.js +0 -1
- package/dist/zonos-elements/p-4caffd96.system.js +0 -2
- package/dist/zonos-elements/p-59e31080.system.js +0 -1
- package/dist/zonos-elements/p-6c0c8722.system.entry.js +0 -1
- package/dist/zonos-elements/p-7decb19b.entry.js +0 -1
- package/dist/zonos-elements/p-829f6a40.entry.js +0 -1
- package/dist/zonos-elements/p-8f640b28.entry.js +0 -1
- package/dist/zonos-elements/p-a69dbe14.js +0 -1
- package/dist/zonos-elements/p-ab68ad11.js +0 -2
- package/dist/zonos-elements/p-ac889f52.entry.js +0 -1
- package/dist/zonos-elements/p-b998494a.entry.js +0 -1
- package/dist/zonos-elements/p-bc0f885e.system.entry.js +0 -1
- package/dist/zonos-elements/p-c6d96a42.system.js +0 -1
- package/dist/zonos-elements/p-ce853f8f.system.entry.js +0 -1
- package/dist/zonos-elements/p-e4f8114a.system.js +0 -1
- package/dist/zonos-elements/p-e99e75dd.system.entry.js +0 -1
- package/dist/zonos-elements/p-f66a5c7c.system.entry.js +0 -1
- package/dist/zonos-elements/p-febb90e0.entry.js +0 -1
|
@@ -58,7 +58,7 @@ export class ZonosPayment {
|
|
|
58
58
|
}
|
|
59
59
|
render() {
|
|
60
60
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
61
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: 'c97f9b800febc678b67643b2020289dc4d382767', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: 'fe8ca21af5fc997831fa5839e26e4de7adb04766', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '863719d3e20a4b63ae2f7dbfe54482c57f3fa393', class: "zonos--payment-component" }), h("div", { key: 'd7c5edc24348ac4c3da4e3b437bd47aaabf45287', class: "zonos--payment-paypal-container" })));
|
|
62
62
|
}
|
|
63
63
|
static get is() { return "zonos-payment"; }
|
|
64
64
|
static get encapsulation() { return "scoped"; }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const getGenericSettingsOverride = () => {
|
|
2
|
+
const params = new URLSearchParams(window.location.search);
|
|
3
|
+
const overrideShouldEnabledCustomAddress = !!window.Zonos
|
|
4
|
+
.overrideUseCustomAddressForm
|
|
5
|
+
? '1'
|
|
6
|
+
: params.get('overrideShouldEnabledCustomAddress');
|
|
7
|
+
return {
|
|
8
|
+
overrideShouldEnabledCustomAddress,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getGenericSettingsOverride } from "./getGenericSettingsOverride";
|
|
1
2
|
import { handleFetch } from "../handleFetch";
|
|
2
3
|
import { logError } from "../logging/logError";
|
|
3
4
|
export const getZonosSettings = async () => {
|
|
@@ -8,7 +9,12 @@ export const getZonosSettings = async () => {
|
|
|
8
9
|
zonosMode: window.Zonos.zonosMode,
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
+
const overrideSettings = getGenericSettingsOverride();
|
|
13
|
+
const params = new URLSearchParams();
|
|
14
|
+
if (overrideSettings.overrideShouldEnabledCustomAddress) {
|
|
15
|
+
params.set('overrideShouldEnabledCustomAddress', overrideSettings.overrideShouldEnabledCustomAddress);
|
|
16
|
+
}
|
|
17
|
+
const { errors, json, zonosMode } = await handleFetch(`/api/zonos-elements/zonos-settings?${params.toString()}`);
|
|
12
18
|
if (errors.length) {
|
|
13
19
|
logError(`Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings`);
|
|
14
20
|
return { errors, json: null, zonosMode };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elements inside of web components sometimes need to inherit global attributes
|
|
3
|
+
* set on the host. For example, the inner input in `ion-input` should inherit
|
|
4
|
+
* the `title` attribute that developers set directly on `ion-input`. This
|
|
5
|
+
* helper function should be called in componentWillLoad and assigned to a variable
|
|
6
|
+
* that is later used in the render function.
|
|
7
|
+
*
|
|
8
|
+
* This does not need to be reactive as changing attributes on the host element
|
|
9
|
+
* does not trigger a re-render.
|
|
10
|
+
*/
|
|
11
|
+
export const inheritAttributes = (el, attributes = []) => {
|
|
12
|
+
const attributeObject = {};
|
|
13
|
+
attributes.forEach(attr => {
|
|
14
|
+
if (el.hasAttribute(attr)) {
|
|
15
|
+
const value = el.getAttribute(attr);
|
|
16
|
+
if (value !== null) {
|
|
17
|
+
attributeObject[attr] = value;
|
|
18
|
+
}
|
|
19
|
+
el.removeAttribute(attr);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return attributeObject;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* List of available ARIA attributes + `role`.
|
|
26
|
+
* Removed deprecated attributes.
|
|
27
|
+
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
|
|
28
|
+
*/
|
|
29
|
+
const ariaAttributes = [
|
|
30
|
+
'role',
|
|
31
|
+
'aria-activedescendant',
|
|
32
|
+
'aria-atomic',
|
|
33
|
+
'aria-autocomplete',
|
|
34
|
+
'aria-braillelabel',
|
|
35
|
+
'aria-brailleroledescription',
|
|
36
|
+
'aria-busy',
|
|
37
|
+
'aria-checked',
|
|
38
|
+
'aria-colcount',
|
|
39
|
+
'aria-colindex',
|
|
40
|
+
'aria-colindextext',
|
|
41
|
+
'aria-colspan',
|
|
42
|
+
'aria-controls',
|
|
43
|
+
'aria-current',
|
|
44
|
+
'aria-describedby',
|
|
45
|
+
'aria-description',
|
|
46
|
+
'aria-details',
|
|
47
|
+
'aria-disabled',
|
|
48
|
+
'aria-errormessage',
|
|
49
|
+
'aria-expanded',
|
|
50
|
+
'aria-flowto',
|
|
51
|
+
'aria-haspopup',
|
|
52
|
+
'aria-hidden',
|
|
53
|
+
'aria-invalid',
|
|
54
|
+
'aria-keyshortcuts',
|
|
55
|
+
'aria-label',
|
|
56
|
+
'aria-labelledby',
|
|
57
|
+
'aria-level',
|
|
58
|
+
'aria-live',
|
|
59
|
+
'aria-multiline',
|
|
60
|
+
'aria-multiselectable',
|
|
61
|
+
'aria-orientation',
|
|
62
|
+
'aria-owns',
|
|
63
|
+
'aria-placeholder',
|
|
64
|
+
'aria-posinset',
|
|
65
|
+
'aria-pressed',
|
|
66
|
+
'aria-readonly',
|
|
67
|
+
'aria-relevant',
|
|
68
|
+
'aria-required',
|
|
69
|
+
'aria-roledescription',
|
|
70
|
+
'aria-rowcount',
|
|
71
|
+
'aria-rowindex',
|
|
72
|
+
'aria-rowindextext',
|
|
73
|
+
'aria-rowspan',
|
|
74
|
+
'aria-selected',
|
|
75
|
+
'aria-setsize',
|
|
76
|
+
'aria-sort',
|
|
77
|
+
'aria-valuemax',
|
|
78
|
+
'aria-valuemin',
|
|
79
|
+
'aria-valuenow',
|
|
80
|
+
'aria-valuetext',
|
|
81
|
+
];
|
|
82
|
+
/**
|
|
83
|
+
* Returns an array of aria attributes that should be copied from
|
|
84
|
+
* the shadow host element to a target within the light DOM.
|
|
85
|
+
* @param el The element that the attributes should be copied from.
|
|
86
|
+
* @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host.
|
|
87
|
+
* Use this in instances where we manually specify aria attributes on the `<Host>` element.
|
|
88
|
+
*/
|
|
89
|
+
export const inheritAriaAttributes = (el, ignoreList) => {
|
|
90
|
+
let attributesToInherit = ariaAttributes;
|
|
91
|
+
if (ignoreList && ignoreList.length > 0) {
|
|
92
|
+
attributesToInherit = attributesToInherit.filter(attr => !ignoreList.includes(attr));
|
|
93
|
+
}
|
|
94
|
+
return inheritAttributes(el, attributesToInherit);
|
|
95
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const isValidZip = ({ countryFields, zip, }) => {
|
|
2
|
+
if (!countryFields) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
if (!countryFields.zipShow) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
// If zip is not required, zip value can be empty
|
|
9
|
+
if (!countryFields.zipRequired) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
// If zip regex is set, it's always required and must be validated
|
|
13
|
+
if (countryFields.zipRegex) {
|
|
14
|
+
return new RegExp(countryFields.zipRegex).test(zip);
|
|
15
|
+
}
|
|
16
|
+
// If zip is required, zip value must be non-empty
|
|
17
|
+
return countryFields.zipRequired && !!zip;
|
|
18
|
+
};
|
|
@@ -10,7 +10,9 @@ const injectCheckoutElement = () => {
|
|
|
10
10
|
};
|
|
11
11
|
export const initCheckout = (config) => {
|
|
12
12
|
// allow to load checkout if cartData is ready (Checkout can be loaded right awaiy if tempCartUUID is in the URL)
|
|
13
|
-
if (!config.placeOrderButtonSelector &&
|
|
13
|
+
if (!config.placeOrderButtonSelector &&
|
|
14
|
+
!config.alwaysTriggerInternationalCheckoutSelector &&
|
|
15
|
+
!window.Zonos.cartData) {
|
|
14
16
|
// do nothing if checkout button anchor is not set
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
@@ -20,5 +22,10 @@ export const initCheckout = (config) => {
|
|
|
20
22
|
logError(`Selector checkoutButtonAnchor "${config.placeOrderButtonSelector}" is not a valid selector`);
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
25
|
+
if (config.alwaysTriggerInternationalCheckoutSelector &&
|
|
26
|
+
!isValidSelector(config.alwaysTriggerInternationalCheckoutSelector)) {
|
|
27
|
+
logError(`Selector alwaysTriggerInternationalCheckoutSelector "${config.alwaysTriggerInternationalCheckoutSelector}" is not a valid selector`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
23
30
|
injectCheckoutElement();
|
|
24
31
|
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { iframeServices, } from "./IframeHelpers";
|
|
2
|
+
import { log } from "../logging/log";
|
|
3
|
+
import { logError } from "../logging/logError";
|
|
4
|
+
/**
|
|
5
|
+
* Base class for iframe communication
|
|
6
|
+
*/
|
|
7
|
+
class IframeCommunicator {
|
|
8
|
+
constructor(targetId, allowedEvents) {
|
|
9
|
+
this.targetId = targetId;
|
|
10
|
+
this.allowedEvents = allowedEvents;
|
|
11
|
+
this.listeners = new Map();
|
|
12
|
+
this.handleMessage = (event) => {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const data = event.data;
|
|
15
|
+
const window = ((_a = this.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow) || ((_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentDocument) === null || _c === void 0 ? void 0 : _c.defaultView);
|
|
16
|
+
// check if the message is from the same src
|
|
17
|
+
if (event.source !== window) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (!this.isValidMessage(data)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const listeners = this.listeners.get(data.type);
|
|
24
|
+
listeners === null || listeners === void 0 ? void 0 : listeners.forEach(listener => {
|
|
25
|
+
try {
|
|
26
|
+
listener(data.payload);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
logError('Error in event listener:', error);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
this.initializeEventListeners();
|
|
34
|
+
// get the iframe element
|
|
35
|
+
this.iframe = document.getElementById(this.targetId);
|
|
36
|
+
}
|
|
37
|
+
initializeEventListeners() {
|
|
38
|
+
window.addEventListener('message', this.handleMessage);
|
|
39
|
+
}
|
|
40
|
+
isValidMessage(message) {
|
|
41
|
+
if (!message || typeof message !== 'object')
|
|
42
|
+
return false;
|
|
43
|
+
const msg = message;
|
|
44
|
+
return (msg.id === this.targetId &&
|
|
45
|
+
typeof msg.type === 'string' &&
|
|
46
|
+
this.allowedEvents.includes(msg.type) &&
|
|
47
|
+
msg.payload !== undefined);
|
|
48
|
+
}
|
|
49
|
+
on(type, callback) {
|
|
50
|
+
if (!this.listeners.has(type)) {
|
|
51
|
+
this.listeners.set(type, new Set());
|
|
52
|
+
}
|
|
53
|
+
log(`[CheckoutAddressService] listening to ${type}`, 'info');
|
|
54
|
+
const _callback = callback;
|
|
55
|
+
const listeners = this.listeners.get(type);
|
|
56
|
+
if (listeners) {
|
|
57
|
+
listeners.add(_callback);
|
|
58
|
+
}
|
|
59
|
+
return () => {
|
|
60
|
+
const currentListeners = this.listeners.get(type);
|
|
61
|
+
if (currentListeners) {
|
|
62
|
+
currentListeners.delete(_callback);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
destroy() {
|
|
67
|
+
window.removeEventListener('message', this.handleMessage);
|
|
68
|
+
this.listeners.clear();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Service for communicating with the Google Places iframe
|
|
73
|
+
*/
|
|
74
|
+
class GooglePlacesService extends IframeCommunicator {
|
|
75
|
+
constructor() {
|
|
76
|
+
log('=== [Google Places Service] Initializing', 'info');
|
|
77
|
+
super(iframeServices.GOOGLE_PLACES, [
|
|
78
|
+
'fetchAutocompleteSuggestions',
|
|
79
|
+
'initializeGooglePlacesService',
|
|
80
|
+
'placeSelected',
|
|
81
|
+
'onFetchAutocompleteSuggestions',
|
|
82
|
+
'onInitializeGooglePlacesService',
|
|
83
|
+
'onPlaceSelected',
|
|
84
|
+
]);
|
|
85
|
+
}
|
|
86
|
+
sendMessage(type, payload) {
|
|
87
|
+
var _a;
|
|
88
|
+
if (!((_a = this.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const message = {
|
|
92
|
+
id: this.targetId,
|
|
93
|
+
logType: window.Zonos.iframeLogType,
|
|
94
|
+
payload,
|
|
95
|
+
type,
|
|
96
|
+
};
|
|
97
|
+
log(`GooglePlacesService] parent --> ${type}`, 'info', payload);
|
|
98
|
+
this.iframe.contentWindow.postMessage(message, '*');
|
|
99
|
+
}
|
|
100
|
+
initialize() {
|
|
101
|
+
this.sendMessage('initializeGooglePlacesService', {});
|
|
102
|
+
}
|
|
103
|
+
fetchSuggestions({ country, query, type, }) {
|
|
104
|
+
if (!country) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.sendMessage('fetchAutocompleteSuggestions', {
|
|
108
|
+
request: {
|
|
109
|
+
includedRegionCodes: [country],
|
|
110
|
+
input: query,
|
|
111
|
+
},
|
|
112
|
+
type,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
selectPlace({ placeId, type, }) {
|
|
116
|
+
this.sendMessage('placeSelected', { placeId, type });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Checkout service for managing address selection and validation
|
|
121
|
+
*/
|
|
122
|
+
export class CheckoutAddressService {
|
|
123
|
+
constructor() {
|
|
124
|
+
this.googlePlaceInitialized = false;
|
|
125
|
+
log('=== [CheckoutAddressService] Initializing', 'info');
|
|
126
|
+
this.googlePlaces = new GooglePlacesService();
|
|
127
|
+
this.googlePlaces.on('onInitializeGooglePlacesService', () => {
|
|
128
|
+
log('=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService', 'info');
|
|
129
|
+
this.googlePlaceInitialized = true;
|
|
130
|
+
});
|
|
131
|
+
this.initialize();
|
|
132
|
+
}
|
|
133
|
+
initialize() {
|
|
134
|
+
this.googlePlaces.initialize();
|
|
135
|
+
}
|
|
136
|
+
onInitializeGooglePlacesService(callback) {
|
|
137
|
+
return this.googlePlaces.on('onInitializeGooglePlacesService', () => {
|
|
138
|
+
log('[CheckoutAddressService] parent <-- onInitializeGooglePlacesService');
|
|
139
|
+
callback();
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
isGooglePlaceInitialized() {
|
|
143
|
+
return this.googlePlaceInitialized;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Set up event listeners for address suggestions
|
|
147
|
+
*/
|
|
148
|
+
onAddressSuggestions(callback) {
|
|
149
|
+
this.suggestionsCallback = callback;
|
|
150
|
+
return this.googlePlaces.on('onFetchAutocompleteSuggestions', (...args) => {
|
|
151
|
+
log(`[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ${args[0].type}`, 'info', ...args);
|
|
152
|
+
callback(...args);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Set up event listeners for selected address
|
|
157
|
+
*/
|
|
158
|
+
onAddressSelected(callback) {
|
|
159
|
+
this.placeSelectedCallback = callback;
|
|
160
|
+
return this.googlePlaces.on('onPlaceSelected', (...args) => {
|
|
161
|
+
log(`[CheckoutAddressService] parent <-- onPlaceSelected ${args[0].type}`, 'info', ...args);
|
|
162
|
+
callback(...args);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Request address suggestions based on user input
|
|
167
|
+
*/
|
|
168
|
+
getAddressSuggestions({ country, query, type, }) {
|
|
169
|
+
if (!this.googlePlaceInitialized) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this.googlePlaces.fetchSuggestions({
|
|
173
|
+
country,
|
|
174
|
+
query,
|
|
175
|
+
type,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Select an address from suggestions
|
|
180
|
+
*/
|
|
181
|
+
selectAddress({ placeId, type, }) {
|
|
182
|
+
this.googlePlaces.selectPlace({ placeId, type });
|
|
183
|
+
}
|
|
184
|
+
destroy() {
|
|
185
|
+
this.googlePlaces.destroy();
|
|
186
|
+
if (this.suggestionsCallback) {
|
|
187
|
+
this.suggestionsCallback = undefined;
|
|
188
|
+
}
|
|
189
|
+
if (this.placeSelectedCallback) {
|
|
190
|
+
this.placeSelectedCallback = undefined;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export const iframeServices = {
|
|
2
|
+
GOOGLE_PLACES: 'zonos--private-iframe-google-places-service-m9bmuh7g',
|
|
3
|
+
};
|
|
4
|
+
const postMessage = ({ id, payload, target, type, }) => {
|
|
5
|
+
var _a;
|
|
6
|
+
if (target instanceof HTMLIFrameElement) {
|
|
7
|
+
(_a = target.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage({
|
|
8
|
+
id,
|
|
9
|
+
payload,
|
|
10
|
+
type,
|
|
11
|
+
}, '*');
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
target.postMessage({
|
|
15
|
+
id,
|
|
16
|
+
payload,
|
|
17
|
+
type,
|
|
18
|
+
}, '*');
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Base class for iframe services, being used for Iframe to communicate back to the parent window
|
|
23
|
+
*/
|
|
24
|
+
export class IframeService {
|
|
25
|
+
constructor(targetElement, targetId) {
|
|
26
|
+
this.targetElement = targetElement;
|
|
27
|
+
this.targetId = targetId;
|
|
28
|
+
this.sendMessage = (type, payload) => {
|
|
29
|
+
postMessage({
|
|
30
|
+
id: this.targetId,
|
|
31
|
+
payload,
|
|
32
|
+
target: this.targetElement,
|
|
33
|
+
type,
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
IframeService.iframeServices = iframeServices;
|
|
39
|
+
IframeService.sendMessage = postMessage;
|
|
40
|
+
IframeService.injectPrivateIframe = ({ id, onload, src, }) => {
|
|
41
|
+
const iframe = document.createElement('iframe');
|
|
42
|
+
iframe.src = src;
|
|
43
|
+
iframe.id = id;
|
|
44
|
+
iframe.style.display = 'none';
|
|
45
|
+
iframe.role = 'presentation';
|
|
46
|
+
iframe.ariaHidden = 'true';
|
|
47
|
+
iframe.tabIndex = -1;
|
|
48
|
+
iframe.style.border = 'none !important';
|
|
49
|
+
iframe.style.margin = '0px !important';
|
|
50
|
+
iframe.style.padding = '0px !important';
|
|
51
|
+
iframe.style.width = '1px !important';
|
|
52
|
+
iframe.style.minWidth = '100% !important';
|
|
53
|
+
iframe.style.overflow = 'hidden !important';
|
|
54
|
+
iframe.style.display = 'block !important';
|
|
55
|
+
iframe.style.visibility = 'hidden !important';
|
|
56
|
+
iframe.style.position = 'fixed !important';
|
|
57
|
+
iframe.style.pointerEvents = 'none !important';
|
|
58
|
+
iframe.style.userSelect = 'none !important';
|
|
59
|
+
iframe.style.height = '1px !important';
|
|
60
|
+
iframe.onload = () => onload(iframe);
|
|
61
|
+
document.body.appendChild(iframe);
|
|
62
|
+
return iframe;
|
|
63
|
+
};
|
|
64
|
+
export const injectPrivateIframe = ({ id, onload, src, }) => {
|
|
65
|
+
const iframe = document.createElement('iframe');
|
|
66
|
+
iframe.src = src;
|
|
67
|
+
iframe.id = id;
|
|
68
|
+
iframe.style.display = 'none';
|
|
69
|
+
iframe.role = 'presentation';
|
|
70
|
+
iframe.ariaHidden = 'true';
|
|
71
|
+
iframe.tabIndex = -1;
|
|
72
|
+
iframe.style.border = 'none !important';
|
|
73
|
+
iframe.style.margin = '0px !important';
|
|
74
|
+
iframe.style.padding = '0px !important';
|
|
75
|
+
iframe.style.width = '1px !important';
|
|
76
|
+
iframe.style.minWidth = '100% !important';
|
|
77
|
+
iframe.style.overflow = 'hidden !important';
|
|
78
|
+
iframe.style.display = 'block !important';
|
|
79
|
+
iframe.style.visibility = 'hidden !important';
|
|
80
|
+
iframe.style.position = 'fixed !important';
|
|
81
|
+
iframe.style.pointerEvents = 'none !important';
|
|
82
|
+
iframe.style.userSelect = 'none !important';
|
|
83
|
+
iframe.style.height = '1px !important';
|
|
84
|
+
iframe.onload = onload;
|
|
85
|
+
document.body.appendChild(iframe);
|
|
86
|
+
};
|