@zonos/elements 1.3.6 → 1.3.7-alpha.1
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/{localization-2c9f5765.js → cart-89d9fff4.js} +863 -89
- package/dist/cjs/formatStringWithLinks-52341fc7.js +17 -0
- package/dist/cjs/{getBorderRadius-b252096d.js → getBorderRadius-d8f18958.js} +1 -1
- package/dist/cjs/{isDarkColor-168002d6.js → isDarkColor-57860b44.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/submitGtag-24740560.js +55 -0
- package/dist/cjs/zonos-address_4.cjs.entry.js +36 -18
- package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +8 -8
- package/dist/cjs/zonos-card_2.cjs.entry.js +10 -8
- package/dist/cjs/zonos-cart-items_9.cjs.entry.js +66 -56
- package/dist/cjs/zonos-checkout.cjs.entry.js +170 -34
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +51 -32
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -3
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +21 -12
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +23 -19
- package/dist/cjs/zonos-hello.cjs.entry.js +51 -34
- package/dist/cjs/zonos-link.cjs.entry.js +24 -0
- package/dist/cjs/zonos-logo.cjs.entry.js +3 -3
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -6
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-5d94dabb.js → zonosStore-138c5555.js} +9 -7
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +27 -13
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +39 -18
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +5 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +54 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +97 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +2 -0
- package/dist/collection/components/common/zonos-button/zonos-button.js +4 -4
- package/dist/collection/components/common/zonos-card/zonos-card.js +2 -2
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +26 -6
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +8 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +4 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- 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/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +50 -11
- 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 +5 -3
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +29 -4
- package/dist/collection/components/store/hello/localization.js +34 -7
- package/dist/collection/components/store/zonosStore.js +9 -7
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/api/trackConversionEvent.js +22 -0
- package/dist/collection/components/utils/checkout/isShippableCountry.js +15 -0
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +111 -0
- package/dist/collection/components/utils/formatStringWithLinks.js +13 -0
- package/dist/collection/components/utils/handleFetch.js +1 -1
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +25 -28
- package/dist/collection/components/utils/hello/currencyConversion/getCurrencyElements.js +2 -1
- package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js +8 -6
- package/dist/collection/components/utils/hello/initHello.js +23 -3
- package/dist/collection/components/utils/logging/log.js +20 -9
- package/dist/collection/components/utils/logging/logError.js +2 -1
- package/dist/collection/components/utils/logging/sendErrorLog.js +12 -0
- package/dist/collection/scripts/checkIfLoadVersionDomain.js +35 -0
- package/dist/collection/scripts/zonosBase.js +21 -31
- package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
- package/dist/collection/types/generated/graphql.customer.types.js +7 -4
- package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
- package/dist/components/stripe.js +4097 -7
- package/dist/components/submitGtag.js +1 -1
- package/dist/components/trackConversionEvent.js +24 -0
- package/dist/components/zonos-address2.js +2 -3
- package/dist/components/zonos-badge2.js +3 -3
- package/dist/components/zonos-button2.js +5 -5
- package/dist/components/zonos-card2.js +2 -2
- package/dist/components/zonos-cart-subtotal2.js +2 -8
- package/dist/components/zonos-checkbox2.js +3 -3
- package/dist/components/zonos-checkout-finish2.js +44 -16
- package/dist/components/zonos-checkout-footer2.js +1 -1
- package/dist/components/zonos-checkout-payment2.js +2 -3
- package/dist/components/zonos-checkout.js +157 -19
- package/dist/components/zonos-collapse2.js +26 -6
- package/dist/components/zonos-component.js +1 -1
- package/dist/components/zonos-controller.js +25 -6
- package/dist/components/zonos-country-flag2.js +1 -1
- package/dist/components/zonos-country-select2.js +9 -3
- package/dist/components/zonos-custom-message2.js +18 -3
- package/dist/components/zonos-customer-info2.js +4 -3
- package/dist/components/zonos-dialog2.js +3 -3
- package/dist/components/zonos-hello-dialog-footer2.js +3 -3
- package/dist/components/zonos-hello-dialog2.js +6 -5
- package/dist/components/zonos-hello.js +23 -7
- package/dist/components/zonos-language-select2.js +3 -3
- package/dist/components/zonos-link-authentication2.js +1 -1
- package/dist/components/zonos-link.d.ts +11 -0
- package/dist/components/zonos-link.js +43 -0
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-payment2.js +1 -1
- package/dist/components/zonos-review2.js +2 -8
- package/dist/components/zonos-select-dialog-header2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping2.js +7 -3
- package/dist/components/zonos-tooltip2.js +2 -2
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/components/zonosStore.js +9 -7
- package/dist/esm/{localization-d8f6453b.js → cart-1bbb7662.js} +846 -90
- package/dist/esm/formatStringWithLinks-9e819405.js +15 -0
- package/dist/esm/{getBorderRadius-e9736f7e.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm/{isDarkColor-e982fa09.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/submitGtag-d3d11f1a.js +51 -0
- package/dist/esm/zonos-address_4.entry.js +33 -15
- package/dist/esm/zonos-badge_2.entry.js +6 -6
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +8 -8
- package/dist/esm/zonos-card_2.entry.js +8 -6
- package/dist/esm/zonos-cart-items_9.entry.js +47 -37
- package/dist/esm/zonos-checkout.entry.js +158 -22
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +28 -9
- package/dist/esm/zonos-country-flag.entry.js +4 -2
- package/dist/esm/zonos-country-select_3.entry.js +19 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +9 -5
- package/dist/esm/zonos-hello.entry.js +24 -7
- package/dist/esm/zonos-link.entry.js +20 -0
- package/dist/esm/zonos-logo.entry.js +3 -3
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +5 -6
- package/dist/esm/zonos-select-dialog-header_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-e6c7be3a.js → zonosStore-00bce01b.js} +9 -7
- package/dist/esm-es5/cart-1bbb7662.js +1 -0
- package/dist/esm-es5/formatStringWithLinks-9e819405.js +1 -0
- package/dist/esm-es5/{getBorderRadius-e9736f7e.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm-es5/{isDarkColor-e982fa09.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-d3d11f1a.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.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_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.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_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -0
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e6c7be3a.js → zonosStore-00bce01b.js} +1 -1
- package/dist/scripts/checkIfLoadVersionDomain.js +1 -0
- package/dist/scripts/loadStripe.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/stripe.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -1
- package/dist/types/components/common/component-template/zonos-link/zonos-link.d.ts +19 -0
- package/dist/types/components/common/zonos-collapse/zonos-collapse.d.ts +1 -0
- package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +2 -0
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +9 -3
- package/dist/types/components/store/checkout/cart.d.ts +6 -3
- package/dist/types/components/store/checkout/stripe.d.ts +26 -1
- package/dist/types/components/store/hello/localization.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +2 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/trackConversionEvent.d.ts +3 -0
- package/dist/types/components/utils/checkout/isShippableCountry.d.ts +1 -0
- package/dist/types/components/utils/checkout/watchBigcommerceDomesticCheckout.d.ts +20 -0
- package/dist/types/components/utils/formatStringWithLinks.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/getCurrencyElements.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/getLanguageCode.d.ts +1 -1
- package/dist/types/components/utils/logging/log.d.ts +1 -1
- package/dist/types/components/utils/logging/sendErrorLog.d.ts +7 -0
- package/dist/types/components.d.ts +53 -3
- package/dist/types/scripts/checkIfLoadVersionDomain.d.ts +13 -0
- package/dist/types/scripts/zonosBase.d.ts +2 -0
- package/dist/types/types/ICountryJson.d.ts +2 -1
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +23 -53
- package/dist/types/types/generated/graphql.customer.types.ts +42 -62
- package/dist/types/types/generated/graphql.frontend.types.d.ts +9 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +19 -1
- package/dist/zonos-elements/p-0318632a.entry.js +1 -0
- package/dist/zonos-elements/p-066c5893.system.js +1 -1
- package/dist/zonos-elements/p-07966463.entry.js +1 -0
- package/dist/zonos-elements/p-0c0aa552.js +1 -0
- package/dist/zonos-elements/p-127b480c.entry.js +1 -0
- package/dist/zonos-elements/p-135ab559.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b81a0577.system.entry.js → p-143dc0d9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-32bca9c8.system.entry.js → p-14d27ce1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-15a80c4a.entry.js +1 -0
- package/dist/zonos-elements/p-17e87be1.entry.js +1 -0
- package/dist/zonos-elements/{p-0c7480a5.entry.js → p-1e0dd491.entry.js} +1 -1
- package/dist/zonos-elements/{p-a33745e9.entry.js → p-279d1c5f.entry.js} +1 -1
- package/dist/zonos-elements/p-2d6557ee.system.js +1 -0
- package/dist/zonos-elements/p-314be538.system.entry.js +1 -0
- package/dist/zonos-elements/{p-dd7729fd.system.entry.js → p-328b7f6f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-354603b3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-50287643.system.js → p-49f6a985.system.js} +1 -1
- package/dist/zonos-elements/p-57b65321.system.entry.js +1 -0
- package/dist/zonos-elements/p-58c1ddef.system.js +1 -0
- package/dist/zonos-elements/{p-06652d87.system.entry.js → p-58e2f6a1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5ee03db0.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5a113c3d.system.entry.js → p-61e5cf29.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-49a764e9.system.entry.js → p-799d8a17.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7a32526c.entry.js +1 -0
- package/dist/zonos-elements/p-7b87b82f.js +1 -0
- package/dist/zonos-elements/{p-9cbbf261.system.entry.js → p-7c45ce37.system.entry.js} +1 -1
- package/dist/zonos-elements/p-84f4f00f.entry.js +1 -0
- package/dist/zonos-elements/{p-e8a9bc56.entry.js → p-857cfe35.entry.js} +1 -1
- package/dist/zonos-elements/p-87e9c42f.entry.js +1 -0
- package/dist/zonos-elements/{p-e99d79d9.system.js → p-91797d4e.system.js} +1 -1
- package/dist/zonos-elements/{p-17550a10.js → p-95e0fc06.js} +1 -1
- package/dist/zonos-elements/{p-7a6144b1.entry.js → p-a3cc0f84.entry.js} +1 -1
- package/dist/zonos-elements/p-a5f12396.entry.js +1 -0
- package/dist/zonos-elements/p-a87561b8.js +1 -0
- package/dist/zonos-elements/{p-ba43275e.entry.js → p-ac0a7b8f.entry.js} +1 -1
- package/dist/zonos-elements/p-ae82a9ae.js +1 -0
- package/dist/zonos-elements/p-b0462325.system.entry.js +1 -0
- package/dist/zonos-elements/p-b2c0ec71.system.entry.js +1 -0
- package/dist/zonos-elements/{p-fcc4f140.system.js → p-b4725505.system.js} +1 -1
- package/dist/zonos-elements/p-bef54fb1.entry.js +1 -0
- package/dist/zonos-elements/p-c0d431f6.system.entry.js +1 -0
- package/dist/zonos-elements/p-d054788b.system.js +1 -0
- package/dist/zonos-elements/p-d407c93a.system.entry.js +1 -0
- package/dist/zonos-elements/p-e55dd932.js +1 -0
- package/dist/zonos-elements/p-ec37439e.entry.js +1 -0
- package/dist/zonos-elements/p-edace42b.entry.js +1 -0
- package/dist/zonos-elements/p-f478c814.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7dd8e8ba.system.entry.js → p-f6eaef7b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bd6a2095.entry.js → p-f7c36fcc.entry.js} +1 -1
- package/dist/zonos-elements/p-f862b97f.system.entry.js +1 -0
- package/dist/zonos-elements/p-fd642725.entry.js +1 -0
- package/dist/zonos-elements/p-fdb72530.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a4de3fb2.entry.js → p-ff64ddc5.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/cart-b8bbf22d.js +0 -698
- package/dist/cjs/submitGtag-792fe45d.js +0 -21
- package/dist/collection/scripts/extractZonosQaUrl.js +0 -26
- package/dist/components/localization.js +0 -4016
- package/dist/esm/cart-bc3bb22e.js +0 -682
- package/dist/esm/submitGtag-bebe2cb0.js +0 -19
- package/dist/esm-es5/cart-bc3bb22e.js +0 -1
- package/dist/esm-es5/localization-d8f6453b.js +0 -1
- package/dist/esm-es5/submitGtag-bebe2cb0.js +0 -1
- package/dist/types/scripts/extractZonosQaUrl.d.ts +0 -11
- package/dist/zonos-elements/p-00d63df1.system.entry.js +0 -1
- package/dist/zonos-elements/p-04f63cea.entry.js +0 -1
- package/dist/zonos-elements/p-16b74c31.system.js +0 -1
- package/dist/zonos-elements/p-1d16a6fb.js +0 -1
- package/dist/zonos-elements/p-1ea68e3b.entry.js +0 -1
- package/dist/zonos-elements/p-1ed530cc.entry.js +0 -1
- package/dist/zonos-elements/p-289c8b1a.system.entry.js +0 -1
- package/dist/zonos-elements/p-2a00c270.system.entry.js +0 -1
- package/dist/zonos-elements/p-37f53a79.entry.js +0 -1
- package/dist/zonos-elements/p-394cf1cf.js +0 -1
- package/dist/zonos-elements/p-3ef27745.js +0 -1
- package/dist/zonos-elements/p-458fd100.system.entry.js +0 -1
- package/dist/zonos-elements/p-47fac33f.js +0 -1
- package/dist/zonos-elements/p-4fafb2a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-4fb71a93.js +0 -1
- package/dist/zonos-elements/p-5276c61b.system.entry.js +0 -1
- package/dist/zonos-elements/p-6308b347.entry.js +0 -1
- package/dist/zonos-elements/p-63d1b1fe.entry.js +0 -1
- package/dist/zonos-elements/p-7347ee7c.system.entry.js +0 -1
- package/dist/zonos-elements/p-8c26a080.system.js +0 -1
- package/dist/zonos-elements/p-96aabe02.entry.js +0 -1
- package/dist/zonos-elements/p-a682fd38.system.entry.js +0 -1
- package/dist/zonos-elements/p-ba1a111a.system.entry.js +0 -1
- package/dist/zonos-elements/p-c4321084.system.entry.js +0 -1
- package/dist/zonos-elements/p-cdf114a2.entry.js +0 -1
- package/dist/zonos-elements/p-d5ae3cbb.system.entry.js +0 -1
- package/dist/zonos-elements/p-d5d7c8f5.entry.js +0 -1
- package/dist/zonos-elements/p-de339fb6.entry.js +0 -1
- package/dist/zonos-elements/p-ec25f180.entry.js +0 -1
- package/dist/zonos-elements/p-f49dfd06.system.js +0 -1
- package/dist/zonos-elements/p-f6f5f644.entry.js +0 -1
|
@@ -6,6 +6,7 @@ export class ZonosCollapse {
|
|
|
6
6
|
this.collapsed = false;
|
|
7
7
|
this.collapseSize = 0;
|
|
8
8
|
this.height = this.el.scrollHeight;
|
|
9
|
+
this.iframe = null;
|
|
9
10
|
}
|
|
10
11
|
getElementHeight() {
|
|
11
12
|
const fullHeight = `${this.height}px`;
|
|
@@ -17,16 +18,34 @@ export class ZonosCollapse {
|
|
|
17
18
|
}
|
|
18
19
|
componentDidRender() {
|
|
19
20
|
var _a, _b, _c;
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
this.iframe =
|
|
22
|
+
((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('iframe')) || null;
|
|
23
|
+
(_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.addEventListener('resize', () => {
|
|
24
|
+
if (!this.iframe) {
|
|
25
|
+
// this should never happen since it's inside of resize callback
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
this.height = parseFloat(getComputedStyle(this.iframe).height);
|
|
22
29
|
});
|
|
23
30
|
}
|
|
24
31
|
render() {
|
|
25
|
-
this.
|
|
26
|
-
|
|
32
|
+
if (!this.collapsed) {
|
|
33
|
+
// wait for the collapse animation to finish, then set overflow to visible
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
// if the element collapsed state is still not changed, set overflow to visible
|
|
36
|
+
if (!this.collapsed) {
|
|
37
|
+
this.el.style.overflow = 'visible';
|
|
38
|
+
}
|
|
39
|
+
}, 300);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
// set overflow to hidden to prevent content from showing when collapsed
|
|
43
|
+
this.el.style.overflow = 'hidden';
|
|
44
|
+
}
|
|
45
|
+
return (h(Host, { key: '7ac8b898feadfb4424b3b48a98135cb18994f4e0', class: 'zonos--elements zonos--collapse', style: {
|
|
27
46
|
'--font-family': zonosStoreFontFamily(),
|
|
28
47
|
height: this.getElementHeight(),
|
|
29
|
-
} }, h("div", { key: '
|
|
48
|
+
} }, h("div", { key: '4a527ec319b59041196284d4d9a8f22b943a74e6' }, h("iframe", { key: '2fb51c16e13ca90561b1b1e6cab89d87e4a37a47', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: '6d7849f6c35be611446b0da36d657396e5ca3122' }))));
|
|
30
49
|
}
|
|
31
50
|
static get is() { return "zonos-collapse"; }
|
|
32
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -82,7 +101,8 @@ export class ZonosCollapse {
|
|
|
82
101
|
}
|
|
83
102
|
static get states() {
|
|
84
103
|
return {
|
|
85
|
-
"height": {}
|
|
104
|
+
"height": {},
|
|
105
|
+
"iframe": {}
|
|
86
106
|
};
|
|
87
107
|
}
|
|
88
108
|
static get elementRef() { return "el"; }
|
|
@@ -18,6 +18,11 @@ export class ZonosCountrySelect {
|
|
|
18
18
|
this.handleOnClose = () => { };
|
|
19
19
|
this.inputValue = '';
|
|
20
20
|
}
|
|
21
|
+
componentDidRender() {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
// focus the input on render
|
|
24
|
+
(_b = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-select-input')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
25
|
+
}
|
|
21
26
|
render() {
|
|
22
27
|
const { shippingZoneCountries } = localizationStore;
|
|
23
28
|
const countries = shippingZoneCountries
|
|
@@ -30,9 +35,9 @@ export class ZonosCountrySelect {
|
|
|
30
35
|
const filteredCountries = this.inputValue
|
|
31
36
|
? fuseObject.map(country => country.item)
|
|
32
37
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
33
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: '2b8e15643f92ac489706aff7623b1d1efdebce70', class: "zonos--elements", style: {
|
|
34
39
|
'--font-family': zonosStoreFontFamily(),
|
|
35
|
-
} }, h("div", { key: '
|
|
40
|
+
} }, h("div", { key: '06b0c7765d8144ca102c9033e74cf1edb14743ac', class: "zonos--country-select" }, h("zonos-v-stack", { key: 'f2af99575f518acb753448f7cb1f7aecd790de9d', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '296b92c476439aace00f6817b452a3fd3e1d353d', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, h("input", { key: 'd988b856392f88a66bcc3016ccf55107bda4a411', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), h("div", { key: '4376bec824141dd7d2dbfb84f465ac4a48e1d050', class: "zonos--country-select-content" }, filteredCountries.map(country => (h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === localizationStore.selectedCountryCode && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 })))))))));
|
|
36
41
|
}
|
|
37
42
|
static get is() { return "zonos-country-select"; }
|
|
38
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -74,4 +79,5 @@ export class ZonosCountrySelect {
|
|
|
74
79
|
"inputValue": {}
|
|
75
80
|
};
|
|
76
81
|
}
|
|
82
|
+
static get elementRef() { return "ele"; }
|
|
77
83
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { zonosStoreFontFamily } from "../../store/zonosStore";
|
|
3
|
+
import { formatStringWithLinks } from "../../utils/formatStringWithLinks";
|
|
3
4
|
export class ZonosCustomMessage {
|
|
4
5
|
constructor() {
|
|
5
6
|
this.icon = '';
|
|
6
7
|
this.message = '';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
+
const messageWithLinks = formatStringWithLinks(this.message);
|
|
11
|
+
return (h(Host, { key: '73091a3267f0989e8820800054aebc75168dc5d6', class: "zonos--elements", style: {
|
|
10
12
|
'--font-family': zonosStoreFontFamily(),
|
|
11
|
-
} }, this.message && (h("zonos-card", { class: "zonos--custom-message", spacing: "12px" }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Custom message", content: this.icon }), h("zonos-text",
|
|
13
|
+
} }, this.message && (h("zonos-card", { class: "zonos--custom-message", spacing: "12px" }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { innerHTML: messageWithLinks }))))));
|
|
12
14
|
}
|
|
13
15
|
static get is() { return "zonos-custom-message"; }
|
|
14
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -48,7 +48,7 @@ export class ZonosDialog {
|
|
|
48
48
|
document.body.style.overflow = 'auto';
|
|
49
49
|
}
|
|
50
50
|
const borderStyle = getBorderRadius(this.borderStyle);
|
|
51
|
-
return (h(Host, { key: '
|
|
51
|
+
return (h(Host, { key: '3927d9cf0ebbd8b497a0ec42328c4392925d198a', class: classes([
|
|
52
52
|
'zonos--elements',
|
|
53
53
|
this.open && 'open',
|
|
54
54
|
this.isLoading && 'is-loading',
|
|
@@ -59,10 +59,10 @@ export class ZonosDialog {
|
|
|
59
59
|
'--font-family': zonosStoreFontFamily(),
|
|
60
60
|
'--height': this.height || 'initial',
|
|
61
61
|
'--width': this.width,
|
|
62
|
-
} }, h("div", { key: '
|
|
62
|
+
} }, h("div", { key: 'df93af61bfd856db3a572cdb98f60a8dd5c5bb7d', class: "zonos--backdrop" }), h("div", { key: 'f306feb4858dff642fbfd731e5aad849a8f29941', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: 'b914ea2e54fb2af825008ae28e235c461dce67e9', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: '19219c0c8d167bbacec992ba10b1fe0f31a8b8f6', class: classes([
|
|
63
63
|
'zonos--body',
|
|
64
64
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
65
|
-
]) }, h("slot", { key: '
|
|
65
|
+
]) }, h("slot", { key: '38f9b83418dacd47cc2395f253a32ff0a6723d54' })), this.footerRightAction && (h("div", { class: "zonos--footer" }, h("div", { class: "zonos--footer-right-action" }, this.footerRightAction)))))));
|
|
66
66
|
}
|
|
67
67
|
static get is() { return "zonos-dialog"; }
|
|
68
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -16,9 +16,9 @@ export class ZonosLanguageSelect {
|
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
18
|
const { selectedLocale } = localizationStore;
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: 'd12676d6438941bb8d987826f68c1b72a7e02ccd', class: "zonos--elements", style: {
|
|
20
20
|
'--font-family': zonosStoreFontFamily(),
|
|
21
|
-
} }, h("div", { key: '
|
|
21
|
+
} }, h("div", { key: '259eaa6a8ae682cc96c98eaaab574757285188b9', class: "zonos--language-select" }, h("zonos-select-dialog-header", { key: '88bff024a5f678b00bf4edd7b2497177a986af4c', handleOnClose: () => this.handleOnClose(), label: translate('Select a language') }), h("div", { key: 'be1d87991dec9ac2a3b530a0cf9129b9e191781b', class: "zonos--language-select-content" }, languages.map(language => (h("button", { class: "zonos--language-select-button", onClick: () => this.languageSelected(language.code) }, h("zonos-text", { textColor: "gray-800" }, language.translatedLabel), language.code === selectedLocale && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 16 })))))))));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "zonos-language-select"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,11 +10,11 @@ export class ZonosLogo {
|
|
|
10
10
|
const filterColor = this.theme === 'DARK'
|
|
11
11
|
? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'
|
|
12
12
|
: 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'b93db6ec62ecaacb3ded0ab07dd2f38ed488f8d1', class: classes(['zonos--elements zonos--logo']), style: {
|
|
14
14
|
'--filter-color': filterColor,
|
|
15
15
|
'--font-family': zonosStoreFontFamily(),
|
|
16
16
|
'--width': this.width,
|
|
17
|
-
} }, h("img", { key: '
|
|
17
|
+
} }, h("img", { key: '026162477b24250e4204318fa3018b1cfd383ab5', alt: "Zonos Logo", src: getAssetPath('./assets/ZonosLogo.png') })));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "zonos-logo"; }
|
|
20
20
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js
CHANGED
|
@@ -8,9 +8,9 @@ export class ZonosSelectDialogHeader {
|
|
|
8
8
|
this.label = '';
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: 'd0882c22934d6f9635bd0b31af5703283cd0a1be', class: "zonos--elements", style: {
|
|
12
12
|
'--font-family': zonosStoreFontFamily(),
|
|
13
|
-
} }, h("zonos-v-stack", { key: '
|
|
13
|
+
} }, h("zonos-v-stack", { key: '2e227c5bdeeeb0fa772847267007df5aea2e0824', class: "zonos--select-dialog-header-wrapper", spacing: 8 }, h("div", { key: 'c43b72c938069ff1a99a985b3b388a785f94d100', class: "zonos--select-dialog-header" }, h("zonos-text", { key: 'b1008e43ca022ca1e1b63a60ab5c347d1228396e', type: "boldLabel" }, this.label), h("zonos-button", { key: '4722586c58eac765ded4a7baeeca8eb58d44dd0a', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close select dialog", content: RemoveIcon, size: 20 }), noBackground: true, onClick: () => this.handleOnClose() })), h("slot", { key: '36babf745ea5de00c82823520134b1dfcfc9d16d' }))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-select-dialog-header"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js
CHANGED
|
@@ -34,7 +34,7 @@ export class ZonosShippingRichRadio {
|
|
|
34
34
|
return (h("div", { "aria-hidden": "true", class: classes([
|
|
35
35
|
'zonos--shipping-rich-radio-item',
|
|
36
36
|
selected && 'selected',
|
|
37
|
-
]), onClick: () => this.handleRichRadioSelect(item) }, h("input", { checked: selected, class: "zonos--shipping-rich-radio-input", name: "zonos--shipping-rich-radio", type: "radio", value: item.value }), h("div", { class: "zonos--shipping-info" }, h("div", { class: "zonos--shipping-detail" }, h("zonos-text", { class: "zonos--shipping-label", type: "label" }, item.label), (item.sublabel || item.caption) && (h("div", { class: "zonos--sub-detail" }, item.sublabel && (h("zonos-text", { textColor: "gray-800" }, item.sublabel)), item.caption && (h("zonos-text", { textColor: "gray-
|
|
37
|
+
]), onClick: () => this.handleRichRadioSelect(item) }, h("input", { checked: selected, class: "zonos--shipping-rich-radio-input", name: "zonos--shipping-rich-radio", type: "radio", value: item.value }), h("div", { class: "zonos--shipping-info" }, h("div", { class: "zonos--shipping-detail" }, h("zonos-text", { class: "zonos--shipping-label", type: "label" }, item.label), (item.sublabel || item.caption) && (h("div", { class: "zonos--sub-detail" }, item.sublabel && (h("zonos-text", { textColor: "gray-800" }, item.sublabel)), item.caption && (h("zonos-text", { textColor: "gray-600" }, item.caption))))), h("zonos-text", { type: "semiBoldLabel" }, item.price))));
|
|
38
38
|
})));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "zonos-shipping-rich-radio"; }
|
|
@@ -7,10 +7,10 @@ export class ZonosTooltip {
|
|
|
7
7
|
this.showTooltip = false;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '4864150b0af4119fc7d87aec5af3c258fb27802d', class: "zonos--elements" }, h("div", { key: 'c11d3da431f9c4507bc58ec38d0b1ef21c99b584', class: "zonos--tooltip", onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, h("slot", { key: '0a92efb2e6c17f67c2feacbd17bbddd4fb63f7da' }), h("div", { key: '0ea54bfaf54a2f170044d77c2b555e5da37af8ae', class: classes([
|
|
11
11
|
this.showTooltip && 'zonos--show-tooltip',
|
|
12
12
|
'zonos--tooltip-content',
|
|
13
|
-
]) }, h("zonos-text", { key: '
|
|
13
|
+
]) }, h("zonos-text", { key: '73c55a7318eb36760d2779691f9ea79d2c5bf8c7', size: "s", textColor: "gray-0", type: "boldLabel" }, this.label), h("zonos-text", { key: '1f4106f67fc468121d7fb7fbc0ee69363bb26186', size: "xs", textColor: "gray-0" }, this.subtitle)))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-tooltip"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,9 +7,9 @@ export class VStack {
|
|
|
7
7
|
this.spacing = 24;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'a5d1a84d5b25d1a49abec676731eaf76f703e998', style: {
|
|
11
11
|
'--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: '456c8e1865a752dd258989888c45dfbdfd2c4f66', class: classes(['vstack']), style: { 'grid-row-gap': `${this.spacing}px` } }, h("slot", { key: '2d3260c6b74d3def822acb98733f70a97a79f3fa' }))));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "zonos-v-stack"; }
|
|
15
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,7 +10,7 @@ export class ZonosComponent {
|
|
|
10
10
|
return format(this.first, this.middle, this.last);
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return h("div", { key: '
|
|
13
|
+
return h("div", { key: '3b7429a0c03b00f0a80e15a94bebd08aedaafe51' }, "Hello, World! I'm ", this.getText());
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-component"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -101,7 +101,6 @@ export class ZonosHello {
|
|
|
101
101
|
this.reloadHelloData = async () => {
|
|
102
102
|
await this.handleItemRestrictions();
|
|
103
103
|
this.triggerShowPeekMessage();
|
|
104
|
-
void this.displayCurrency();
|
|
105
104
|
};
|
|
106
105
|
this.handleProductCountChange = debounce(() => {
|
|
107
106
|
const { productTitleElementSelector } = zonosStore.helloSettings;
|
|
@@ -124,6 +123,14 @@ export class ZonosHello {
|
|
|
124
123
|
subtree: true,
|
|
125
124
|
});
|
|
126
125
|
};
|
|
126
|
+
this.watchPriceChange = () => {
|
|
127
|
+
const observer = new MutationObserver(() => void this.displayCurrency());
|
|
128
|
+
observer.observe(document.body, {
|
|
129
|
+
attributes: true,
|
|
130
|
+
childList: true,
|
|
131
|
+
subtree: true,
|
|
132
|
+
});
|
|
133
|
+
};
|
|
127
134
|
this.updateHelloOnPageChange = () => {
|
|
128
135
|
// If the product count changes on the same url (loading more products), update the peek message and item restrictions
|
|
129
136
|
this.watchProductCountChange();
|
|
@@ -195,6 +202,7 @@ export class ZonosHello {
|
|
|
195
202
|
if (zonosStore.loadedConfig) {
|
|
196
203
|
this.helloRef.setAttribute('data-zonos-hello-loaded', '');
|
|
197
204
|
this.updateHelloOnPageChange();
|
|
205
|
+
this.watchPriceChange();
|
|
198
206
|
clearInterval(initInterval);
|
|
199
207
|
}
|
|
200
208
|
}, 100);
|
|
@@ -216,21 +224,28 @@ export class ZonosHello {
|
|
|
216
224
|
* @returns string
|
|
217
225
|
*/
|
|
218
226
|
async convertAndFormat(value) {
|
|
219
|
-
currencyConvertAndFormat(value);
|
|
227
|
+
return currencyConvertAndFormat(value);
|
|
220
228
|
}
|
|
221
229
|
/**
|
|
222
230
|
* This method will convert the currency and return the converted value
|
|
223
231
|
* @returns number
|
|
224
232
|
*/
|
|
225
233
|
async convert(value) {
|
|
226
|
-
currencyConvert(value);
|
|
234
|
+
return currencyConvert(value);
|
|
227
235
|
}
|
|
228
236
|
/**
|
|
229
237
|
* This method will format the currency and return the formatted string
|
|
230
238
|
* @returns number
|
|
231
239
|
*/
|
|
232
240
|
async format(value) {
|
|
233
|
-
currencyFormat(value);
|
|
241
|
+
return currencyFormat(value);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* This method show the hello dialog
|
|
245
|
+
* @returns void
|
|
246
|
+
*/
|
|
247
|
+
async openHelloDialog(value) {
|
|
248
|
+
this.changeShowDialog(value);
|
|
234
249
|
}
|
|
235
250
|
handleResize() {
|
|
236
251
|
debounce(this.render.bind(this), RESIZE_DEBOUNCE_DELAY_MS);
|
|
@@ -267,7 +282,7 @@ export class ZonosHello {
|
|
|
267
282
|
!!this.allRestrictedItems.length &&
|
|
268
283
|
'zonos--hello-has-restrictions',
|
|
269
284
|
]), onClick: () => {
|
|
270
|
-
this.changeShowDialog(!this.showDialog);
|
|
285
|
+
void this.changeShowDialog(!this.showDialog);
|
|
271
286
|
}, onMouseEnter: () => this.enableShowPeekMessage(), onMouseLeave: () => (this.showPeekMessage = false), ref: el => el && (this.helloRef = el) }, h("zonos-text", { class: "zonos--hello-message" }, this.peekMessage), selectedCountryCode && (h("div", { class: "zonos--hello-country-flag-wrapper" }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode })))), h("div", { class: classes([
|
|
272
287
|
'zonos--hello-dialog-wrapper',
|
|
273
288
|
this.mobileLocationOverride &&
|
|
@@ -397,7 +412,7 @@ export class ZonosHello {
|
|
|
397
412
|
},
|
|
398
413
|
"convertAndFormat": {
|
|
399
414
|
"complexType": {
|
|
400
|
-
"signature": "(value: number) => Promise<
|
|
415
|
+
"signature": "(value: number) => Promise<string>",
|
|
401
416
|
"parameters": [{
|
|
402
417
|
"name": "value",
|
|
403
418
|
"type": "number",
|
|
@@ -409,7 +424,7 @@ export class ZonosHello {
|
|
|
409
424
|
"id": "global::Promise"
|
|
410
425
|
}
|
|
411
426
|
},
|
|
412
|
-
"return": "Promise<
|
|
427
|
+
"return": "Promise<string>"
|
|
413
428
|
},
|
|
414
429
|
"docs": {
|
|
415
430
|
"text": "This method will call convert and format, and return the converted and formatted string",
|
|
@@ -421,7 +436,7 @@ export class ZonosHello {
|
|
|
421
436
|
},
|
|
422
437
|
"convert": {
|
|
423
438
|
"complexType": {
|
|
424
|
-
"signature": "(value: number) => Promise<
|
|
439
|
+
"signature": "(value: number) => Promise<number>",
|
|
425
440
|
"parameters": [{
|
|
426
441
|
"name": "value",
|
|
427
442
|
"type": "number",
|
|
@@ -433,7 +448,7 @@ export class ZonosHello {
|
|
|
433
448
|
"id": "global::Promise"
|
|
434
449
|
}
|
|
435
450
|
},
|
|
436
|
-
"return": "Promise<
|
|
451
|
+
"return": "Promise<number>"
|
|
437
452
|
},
|
|
438
453
|
"docs": {
|
|
439
454
|
"text": "This method will convert the currency and return the converted value",
|
|
@@ -445,7 +460,7 @@ export class ZonosHello {
|
|
|
445
460
|
},
|
|
446
461
|
"format": {
|
|
447
462
|
"complexType": {
|
|
448
|
-
"signature": "(value: number) => Promise<
|
|
463
|
+
"signature": "(value: number) => Promise<string>",
|
|
449
464
|
"parameters": [{
|
|
450
465
|
"name": "value",
|
|
451
466
|
"type": "number",
|
|
@@ -457,7 +472,7 @@ export class ZonosHello {
|
|
|
457
472
|
"id": "global::Promise"
|
|
458
473
|
}
|
|
459
474
|
},
|
|
460
|
-
"return": "Promise<
|
|
475
|
+
"return": "Promise<string>"
|
|
461
476
|
},
|
|
462
477
|
"docs": {
|
|
463
478
|
"text": "This method will format the currency and return the formatted string",
|
|
@@ -466,6 +481,30 @@ export class ZonosHello {
|
|
|
466
481
|
"text": "number"
|
|
467
482
|
}]
|
|
468
483
|
}
|
|
484
|
+
},
|
|
485
|
+
"openHelloDialog": {
|
|
486
|
+
"complexType": {
|
|
487
|
+
"signature": "(value: boolean) => Promise<void>",
|
|
488
|
+
"parameters": [{
|
|
489
|
+
"name": "value",
|
|
490
|
+
"type": "boolean",
|
|
491
|
+
"docs": ""
|
|
492
|
+
}],
|
|
493
|
+
"references": {
|
|
494
|
+
"Promise": {
|
|
495
|
+
"location": "global",
|
|
496
|
+
"id": "global::Promise"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"return": "Promise<void>"
|
|
500
|
+
},
|
|
501
|
+
"docs": {
|
|
502
|
+
"text": "This method show the hello dialog",
|
|
503
|
+
"tags": [{
|
|
504
|
+
"name": "returns",
|
|
505
|
+
"text": "void"
|
|
506
|
+
}]
|
|
507
|
+
}
|
|
469
508
|
}
|
|
470
509
|
};
|
|
471
510
|
}
|
|
@@ -17,9 +17,9 @@ export class ZonosHelloDialogFooter {
|
|
|
17
17
|
const primaryColor = (_a = this.appearanceSettings) === null || _a === void 0 ? void 0 : _a.colorPrimary;
|
|
18
18
|
const footerTheme = primaryColor && isDarkColor(primaryColor) ? 'DARK' : 'LIGHT';
|
|
19
19
|
const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: 'f97688788d9f6d1a640f054a2a22dbae6955b83c', class: "zonos--elements" }, h("div", { key: '3539323f9044acef3890fc072bdd981e2495fc18', class: "zonos--hello-dialog-footer", "data-theme": footerTheme, style: {
|
|
21
21
|
'--primary-color': (_c = this.appearanceSettings) === null || _c === void 0 ? void 0 : _c.colorPrimary,
|
|
22
|
-
} }, h("a", { key: '
|
|
22
|
+
} }, h("a", { key: '5e30052240f87211c6f0092ef6a27c217f3ecefb', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: 'c60142bcd26086c2944ac3464885ca1f96e5cfbe', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: "gray-1200", size: 108 })), h("div", { key: '67297b4c557ee5b49a4406a459588f2924183195', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: '9348bff826187730f36d191f7e01f516f2b9785c', buttonColor: "gray-1200", icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: "gray-1200" }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: 'ecf1a8639e8e92a07a0e774abb560de53c19587c', buttonColor: "gray-1200", icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "zonos-hello-dialog-footer"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3,6 +3,7 @@ import { localizationStore } from "../../store/hello/localization";
|
|
|
3
3
|
import { translate } from "../../store/translationStore";
|
|
4
4
|
import { zonosStore } from "../../store/zonosStore";
|
|
5
5
|
import { classes } from "../../utils/classes";
|
|
6
|
+
import { formatStringWithLinks } from "../../utils/formatStringWithLinks";
|
|
6
7
|
import { currencyFormat } from "../../utils/hello/currencyConversion/currencyFormat";
|
|
7
8
|
import { getHasMoreSpaceAbove } from "../../utils/hello/getHasMoreSpaceAbove";
|
|
8
9
|
import { getHasMoreSpaceOnRight } from "../../utils/hello/getHasMoreSpaceOnRight";
|
|
@@ -91,18 +92,19 @@ export class ZonosHelloDialog {
|
|
|
91
92
|
const animateFromBottom = this.dialogRef && getHasMoreSpaceAbove(this.dialogRef);
|
|
92
93
|
const { customMessages } = localizationStore;
|
|
93
94
|
const welcomeMessage = `${translate('Welcome to')} ${zonosStore.organizationName}!`;
|
|
94
|
-
const
|
|
95
|
+
const defaultMessageStr = ((_a = customMessages.find(x => x.pageName === 'hello_default')) === null || _a === void 0 ? void 0 : _a.message) ||
|
|
95
96
|
translate('Know about duties and taxes before you buy. Shop with confidence!');
|
|
97
|
+
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
96
98
|
const currentPage = this.getCurrentPageEnum();
|
|
97
99
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
98
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: 'd5ac86955cf9f9a22e47fe2154dee6e10f6a9361', class: "zonos--elements" }, h("div", { key: 'd34dd3f937330cd5fdd2d7a11dc321c215983146', "aria-hidden": "true", class: classes([
|
|
99
101
|
'zonos--hello-dialog',
|
|
100
102
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
101
103
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
102
104
|
!!this.mobileLocationOverride &&
|
|
103
105
|
'zonos--hello-dialog-mobile-override',
|
|
104
106
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
105
|
-
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", null, h("div", { class: "zonos--hello-dialog-content" }, h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { textColor: "gray-800" }
|
|
107
|
+
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", null, h("div", { class: "zonos--hello-dialog-content" }, h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { spacing: 8 }, this.restrictedItems.map(item => {
|
|
106
108
|
var _a;
|
|
107
109
|
return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
108
110
|
}), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: BagIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", null, h("zonos-country-select", { handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", null, h("zonos-language-select", { handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
@@ -153,7 +153,7 @@ export class ZonosController {
|
|
|
153
153
|
zonosStore.organizationName = organizationName;
|
|
154
154
|
}
|
|
155
155
|
render() {
|
|
156
|
-
return h(Host, { key: '
|
|
156
|
+
return h(Host, { key: 'a220a3ebe75df167eefc892c59efdcaf05a53601', class: "zonos--elements" });
|
|
157
157
|
}
|
|
158
158
|
static get is() { return "zonos-controller"; }
|
|
159
159
|
static get encapsulation() { return "shadow"; }
|
|
@@ -85,14 +85,14 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
|
|
|
85
85
|
logError('Could not update cart total without checkout session id');
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
|
-
const { json } = await stripeStoreUpdateCheckoutSession({
|
|
88
|
+
const { errors, json } = await stripeStoreUpdateCheckoutSession({
|
|
89
89
|
currency,
|
|
90
90
|
id: cartStore.checkoutSessionId,
|
|
91
91
|
itemsAmount,
|
|
92
92
|
landedCostId,
|
|
93
93
|
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
94
94
|
});
|
|
95
|
-
if (!json) {
|
|
95
|
+
if (errors.length > 0 || !json) {
|
|
96
96
|
// do nothing if we can't get checkout session
|
|
97
97
|
logError('Error occurs when updating checkout session');
|
|
98
98
|
cartStoreUpdateToErrorState({
|
|
@@ -6,6 +6,7 @@ import { zonosStore } from "../zonosStore";
|
|
|
6
6
|
import { calculateLandedCost } from "../../utils/api/calculateLandedCost";
|
|
7
7
|
import { handleFetch } from "../../utils/handleFetch";
|
|
8
8
|
import { isDarkColor } from "../../utils/isDarkColor";
|
|
9
|
+
import { jsonParse } from "../../utils/jsonParse";
|
|
9
10
|
import { log } from "../../utils/logging/log";
|
|
10
11
|
import { logError } from "../../utils/logging/logError";
|
|
11
12
|
import { addressRuleStyle } from "../../../styles/stripe/addressRuleStyle";
|
|
@@ -56,6 +57,17 @@ const getStripeOptions = ({ clientSecret, overrideBorderRaidus, overridePrimaryC
|
|
|
56
57
|
locale: localizationStore.selectedLocale,
|
|
57
58
|
};
|
|
58
59
|
};
|
|
60
|
+
const stripeStoreCleanupDomesticShippingSession = () => {
|
|
61
|
+
window.sessionStorage.removeItem('zonos--bigcommerce-domestic-checkout-shipping');
|
|
62
|
+
};
|
|
63
|
+
// Save shipping address to session storage
|
|
64
|
+
const stripeStoreSaveDomesticShippingSession = (props) => {
|
|
65
|
+
window.sessionStorage.setItem('zonos--bigcommerce-domestic-checkout-shipping', JSON.stringify(props));
|
|
66
|
+
};
|
|
67
|
+
const stripeStoreGetDomesticShippingSession = () => {
|
|
68
|
+
const session = window.sessionStorage.getItem('zonos--bigcommerce-domestic-checkout-shipping');
|
|
69
|
+
return jsonParse(session);
|
|
70
|
+
};
|
|
59
71
|
const initStripeElements = async (props) => {
|
|
60
72
|
var _a, _b;
|
|
61
73
|
const clientSecret = stripeStore.clientSecret;
|
|
@@ -157,12 +169,18 @@ const stripeStorePrefetchLandedCost = async () => {
|
|
|
157
169
|
try {
|
|
158
170
|
const abortController = new AbortController();
|
|
159
171
|
stripeStore.fetchingLandedCostAbordController = abortController;
|
|
160
|
-
const { checkoutSessionWorkflow, shipmentRatingCalculateWorkflow } = await calculateLandedCost(abortController);
|
|
172
|
+
const { checkoutSessionWorkflow, landedCostCalculateWorkflow, shipmentRatingCalculateWorkflow, } = await calculateLandedCost(abortController);
|
|
161
173
|
// reset abort controller after we are done
|
|
162
174
|
stripeStore.fetchingLandedCostAbordController = null;
|
|
163
175
|
// update cart store with landed cost info
|
|
164
176
|
cartStore.landedCostData =
|
|
165
|
-
(checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.
|
|
177
|
+
(checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.map(checkoutSession => {
|
|
178
|
+
const foundLandedCost = landedCostCalculateWorkflow === null || landedCostCalculateWorkflow === void 0 ? void 0 : landedCostCalculateWorkflow.find(item => { var _a; return (item === null || item === void 0 ? void 0 : item.id) === ((_a = checkoutSession.landedCost) === null || _a === void 0 ? void 0 : _a.id); });
|
|
179
|
+
if (!foundLandedCost) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
return Object.assign(Object.assign({}, checkoutSession), { landedCost: foundLandedCost });
|
|
183
|
+
}).filter(Boolean)) || null;
|
|
166
184
|
cartStore.shippingData =
|
|
167
185
|
(shipmentRatingCalculateWorkflow === null || shipmentRatingCalculateWorkflow === void 0 ? void 0 : shipmentRatingCalculateWorkflow.filter(Boolean)) || null;
|
|
168
186
|
// apply new subtotal and total, this is mainly to show items in the presentment currency
|
|
@@ -247,7 +265,11 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
|
|
|
247
265
|
const { paymentIntent } = await stripeStore.stripe.retrievePaymentIntent(clientSecret);
|
|
248
266
|
const status = paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status;
|
|
249
267
|
const { isError, messages } = getStripeMessageBasedOnStatus(status);
|
|
250
|
-
return {
|
|
268
|
+
return {
|
|
269
|
+
error: isError,
|
|
270
|
+
messages,
|
|
271
|
+
paymentMethod: paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.payment_method,
|
|
272
|
+
};
|
|
251
273
|
};
|
|
252
274
|
const stripeStoreConfirmPayment = async () => {
|
|
253
275
|
var _a, _b, _c;
|
|
@@ -295,6 +317,9 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
295
317
|
body: {
|
|
296
318
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
297
319
|
itemsAmount: total,
|
|
320
|
+
metadata: [
|
|
321
|
+
{ key: 'language', value: localizationStore.selectedLocale },
|
|
322
|
+
],
|
|
298
323
|
presentmentCountryCode: localizationStore.selectedCountryCode || null,
|
|
299
324
|
},
|
|
300
325
|
method: 'POST',
|
|
@@ -344,4 +369,4 @@ onChange('clientSecret', clientSecret => {
|
|
|
344
369
|
sessionStorage.removeItem('zonos--client-secret');
|
|
345
370
|
}
|
|
346
371
|
});
|
|
347
|
-
export { initStripeElements, stripeStore, stripeStoreConfirmPayment, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, stripeStoreRetrievePayment, stripeStoreUpdateCheckoutSession, };
|
|
372
|
+
export { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetDomesticShippingSession, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, stripeStoreRetrievePayment, stripeStoreSaveDomesticShippingSession, stripeStoreUpdateCheckoutSession, };
|