@zonos/elements 1.3.15-alpha.3 → 1.3.16-alpha.0
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/RemoveIcon-081ac073.js +5 -0
- package/dist/cjs/{cart-1b1d39af.js → cart-db549f04.js} +976 -138
- package/dist/cjs/containsNonLatinChars-2be5129b.js +24 -0
- package/dist/cjs/{getBorderRadius-c8cc2bb3.js → getBorderRadius-44b3eca1.js} +4 -6
- package/dist/cjs/index-654a6001.js +1361 -0
- package/dist/cjs/isCheckoutMobile-f491ca7c.js +8 -0
- package/dist/cjs/{isColorVariable-fff5e469.js → isColorVariable-6f5a9608.js} +2 -2
- package/dist/cjs/{isDarkColor-f5473002.js → isDarkColor-01f45d3f.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{submitGtag-ab287a34.js → submitGtag-fd8acad5.js} +21 -2
- package/dist/cjs/zonos-address_8.cjs.entry.js +642 -0
- package/dist/cjs/zonos-badge_2.cjs.entry.js +9 -9
- package/dist/cjs/zonos-banner.cjs.entry.js +5 -5
- package/dist/cjs/zonos-button_3.cjs.entry.js +192 -0
- package/dist/cjs/zonos-card_2.cjs.entry.js +12 -12
- package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +150 -124
- package/dist/cjs/zonos-checkout.cjs.entry.js +20 -19
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +16 -16
- package/dist/cjs/zonos-elements.cjs.js +10 -10
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
- package/dist/cjs/zonos-hello.cjs.entry.js +6 -6
- package/dist/cjs/zonos-input.cjs.entry.js +57 -0
- package/dist/cjs/zonos-link.cjs.entry.js +3 -3
- package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
- package/dist/cjs/zonos-notification.cjs.entry.js +5 -5
- package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +7 -7
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +10 -8
- package/dist/cjs/zonos-text.cjs.entry.js +6 -5
- package/dist/cjs/{zonosStore-aee974e0.js → zonosStore-d8bb0bda.js} +1 -1
- package/dist/collection/__mocks__/vercel-app/zonos-hello.entry.js +1 -1
- package/dist/collection/__mocks__/zonos-url/zonos-hello.entry.js +1 -1
- package/dist/collection/collection-manifest.json +5 -1
- package/dist/collection/components/checkout/zonos-checkout/assets/LeftArrow.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/assets/RemoveIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +62 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +80 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.css +59 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +148 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +115 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +429 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/RemoveIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/SuccessIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/chevronDownIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/globe.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/zonosIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +8 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +10 -10
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +135 -20
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronDownIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronUpIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +4 -4
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-badge/zonos-badge.css +30 -30
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-banner/zonos-banner.css +10 -10
- package/dist/collection/components/common/zonos-banner/zonos-banner.js +2 -2
- package/dist/collection/components/common/zonos-button/zonos-button.css +63 -62
- package/dist/collection/components/common/zonos-button/zonos-button.js +17 -8
- package/dist/collection/components/common/zonos-card/zonos-card.css +7 -7
- package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +4 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +26 -8
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +4 -4
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +8 -8
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.css +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +14 -14
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +6 -4
- package/dist/collection/components/common/zonos-icon/zonos-icon.js +1 -1
- package/dist/collection/components/common/zonos-input/zonos-input.css +176 -0
- package/dist/collection/components/common/zonos-input/zonos-input.js +193 -0
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.css +2 -2
- 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-notification/zonos-notification.css +4 -4
- package/dist/collection/components/common/zonos-notification/zonos-notification.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.css +1 -1
- 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.css +7 -7
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +5 -3
- package/dist/collection/components/common/zonos-spinner/zonos-spinner.css +14 -14
- package/dist/collection/components/common/zonos-text/zonos-text.css +7 -7
- package/dist/collection/components/common/zonos-text/zonos-text.js +2 -1
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +3 -3
- 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.css +30 -30
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/chevronDownIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/globe.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/zonosIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +385 -378
- 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.css +11 -11
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +3 -3
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +153 -14
- package/dist/collection/components/store/translationStore/strings.arabic.js +36 -6
- package/dist/collection/components/store/translationStore/strings.base.js +36 -6
- package/dist/collection/components/store/translationStore/strings.chinese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.danish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.dutch.js +36 -6
- package/dist/collection/components/store/translationStore/strings.french.js +36 -6
- package/dist/collection/components/store/translationStore/strings.german.js +36 -6
- package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -6
- package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.italian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.japanese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.korean.js +36 -6
- package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.polish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.russian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.spanish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.swedish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.turkish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -6
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -71
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -5
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/buildTranslateRequestBody.js +98 -0
- package/dist/collection/components/utils/containsNonLatinChars.js +10 -8
- package/dist/collection/components/utils/getBorderRadius.js +3 -5
- package/dist/collection/components/utils/getButtonTheme.js +1 -1
- package/dist/collection/components/utils/isColorVariable.js +2 -2
- package/dist/collection/styles/stripe/defaultVariable.js +2 -2
- package/dist/collection/types/checkout/TranslatedText.js +1 -0
- package/dist/collection/types/checkout/api/ValidateAddressRequest.js +1 -0
- package/dist/components/containsNonLatinChars.js +21 -0
- package/dist/components/getBorderRadius.js +3 -5
- package/dist/components/isColorVariable.js +2 -2
- package/dist/components/stripe.js +255 -4545
- package/dist/components/trackConversionEvent.js +1 -1
- package/dist/components/translationStore.js +5131 -0
- package/dist/components/zonos-address-display.d.ts +11 -0
- package/dist/components/zonos-address-display.js +6 -0
- package/dist/components/zonos-address-display2.js +64 -0
- package/dist/components/zonos-address-form.d.ts +11 -0
- package/dist/components/zonos-address-form.js +6 -0
- package/dist/components/zonos-address-form2.js +84 -0
- package/dist/components/zonos-address-update-dialog.d.ts +11 -0
- package/dist/components/zonos-address-update-dialog.js +6 -0
- package/dist/components/zonos-address-update-dialog2.js +264 -0
- package/dist/components/zonos-address2.js +3 -93
- package/dist/components/zonos-badge2.js +4 -4
- package/dist/components/zonos-banner2.js +3 -3
- package/dist/components/zonos-button2.js +19 -10
- package/dist/components/zonos-card2.js +4 -4
- package/dist/components/zonos-cart-items2.js +2 -2
- package/dist/components/zonos-cart-subtotal2.js +3 -2
- package/dist/components/zonos-checkbox2.js +19 -10
- package/dist/components/zonos-checkout-finish2.js +29 -9
- package/dist/components/zonos-checkout-footer2.js +5 -5
- package/dist/components/zonos-checkout-payment2.js +3 -2
- package/dist/components/zonos-checkout-progress-tabs2.js +6 -5
- package/dist/components/zonos-checkout.js +73 -43
- package/dist/components/zonos-collapse2.js +2 -2
- package/dist/components/zonos-component.js +1 -1
- package/dist/components/zonos-controller.js +2 -2
- package/dist/components/zonos-country-select2.js +3 -3
- package/dist/components/zonos-custom-message2.js +3 -3
- package/dist/components/zonos-customer-info2.js +171 -30
- package/dist/components/zonos-dialog2.js +7 -5
- package/dist/components/zonos-hello-dialog-footer2.js +5 -5
- package/dist/components/zonos-hello-dialog2.js +6 -5
- package/dist/components/zonos-hello.js +3 -2
- package/dist/components/zonos-icon2.js +1 -1
- package/dist/components/zonos-input.d.ts +11 -0
- package/dist/components/zonos-input.js +6 -0
- package/dist/components/zonos-input2.js +78 -0
- package/dist/components/zonos-language-select2.js +5 -4
- package/dist/components/zonos-link-authentication2.js +12 -5
- package/dist/components/zonos-link.js +2 -2
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-notification2.js +3 -3
- package/dist/components/zonos-payment2.js +1 -1
- package/dist/components/zonos-review2.js +5 -4
- package/dist/components/zonos-select-dialog-header2.js +3 -3
- package/dist/components/zonos-shipping-rich-radio2.js +6 -4
- package/dist/components/zonos-shipping2.js +4 -3
- package/dist/components/zonos-spinner2.js +1 -1
- package/dist/components/zonos-text2.js +3 -2
- package/dist/components/zonos-tooltip2.js +3 -3
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/esm/RemoveIcon-9dc5dd1a.js +3 -0
- package/dist/esm/{cart-10bcd2e0.js → cart-462e89a6.js} +976 -139
- package/dist/esm/containsNonLatinChars-2d8810c3.js +21 -0
- package/dist/esm/{getBorderRadius-8129b0cb.js → getBorderRadius-567f1786.js} +4 -6
- package/dist/esm/index-e063389c.js +1328 -0
- package/dist/esm/isCheckoutMobile-8846dccb.js +6 -0
- package/dist/esm/{isColorVariable-fbf2d80d.js → isColorVariable-82457bef.js} +2 -2
- package/dist/esm/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{submitGtag-84886899.js → submitGtag-ac7c3c89.js} +21 -3
- package/dist/esm/zonos-address_8.entry.js +631 -0
- package/dist/esm/zonos-badge_2.entry.js +9 -9
- package/dist/esm/zonos-banner.entry.js +5 -5
- package/dist/esm/zonos-button_3.entry.js +186 -0
- package/dist/esm/zonos-card_2.entry.js +12 -12
- package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +146 -119
- package/dist/esm/zonos-checkout.entry.js +15 -14
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_3.entry.js +16 -16
- package/dist/esm/zonos-elements.js +11 -11
- package/dist/esm/zonos-hello-dialog.entry.js +9 -9
- package/dist/esm/zonos-hello.entry.js +6 -6
- package/dist/esm/zonos-input.entry.js +53 -0
- package/dist/esm/zonos-link.entry.js +3 -3
- package/dist/esm/zonos-logo.entry.js +4 -4
- package/dist/esm/zonos-notification.entry.js +5 -5
- package/dist/esm/zonos-payment.entry.js +6 -6
- package/dist/esm/zonos-select-dialog-header_2.entry.js +7 -7
- package/dist/esm/zonos-shipping-rich-radio.entry.js +10 -8
- package/dist/esm/zonos-text.entry.js +6 -5
- package/dist/esm/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
- package/dist/esm-es5/RemoveIcon-9dc5dd1a.js +1 -0
- package/dist/esm-es5/cart-462e89a6.js +1 -0
- package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
- package/dist/esm-es5/getBorderRadius-567f1786.js +1 -0
- package/dist/esm-es5/index-e063389c.js +2 -0
- package/dist/esm-es5/isCheckoutMobile-8846dccb.js +1 -0
- package/dist/esm-es5/isColorVariable-82457bef.js +1 -0
- package/dist/esm-es5/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-ac7c3c89.js +1 -0
- package/dist/esm-es5/zonos-address_8.entry.js +1 -0
- 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 -0
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -0
- 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-input.entry.js +1 -0
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.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-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
- 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-address-update-dialog/zonos-address-display/zonos-address-display.d.ts +12 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.d.ts +28 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.d.ts +96 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +22 -2
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +0 -3
- package/dist/types/components/common/zonos-input/zonos-input.d.ts +35 -0
- package/dist/types/components/store/checkout/stripe.d.ts +25 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.base.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.danish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.french.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.german.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.italian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.korean.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.polish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.russian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +35 -5
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -10
- package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +4 -0
- package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
- package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
- package/dist/types/components/utils/checkout/buildTranslateRequestBody.d.ts +26 -0
- package/dist/types/components/utils/containsNonLatinChars.d.ts +1 -0
- package/dist/types/components/utils/getBorderRadius.d.ts +7 -1
- package/dist/types/components.d.ts +308 -6
- package/dist/types/types/checkout/TranslatedText.d.ts +23 -0
- package/dist/types/types/checkout/api/ValidateAddressRequest.d.ts +20 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +2 -0
- package/dist/types/types/generated/graphql.customer.types.ts +2 -0
- package/dist/zonos-elements/assets/ChevronDownIcon.svg +1 -1
- package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -1
- package/dist/zonos-elements/assets/LeftArrow.svg +1 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/assets/SuccessIcon.svg +1 -1
- package/dist/zonos-elements/p-04df7975.entry.js +1 -0
- package/dist/zonos-elements/p-08e7107d.js +1 -0
- package/dist/zonos-elements/p-0c64dbbb.js +1 -0
- package/dist/zonos-elements/{p-bc3a0f7c.entry.js → p-11f1b78c.entry.js} +1 -1
- package/dist/zonos-elements/p-13ddaf31.js +2 -0
- package/dist/zonos-elements/p-154aaf95.system.js +1 -0
- package/dist/zonos-elements/p-163ff5b5.system.js +2 -0
- package/dist/zonos-elements/p-17e265c3.system.entry.js +1 -0
- package/dist/zonos-elements/p-2670438c.system.js +1 -0
- package/dist/zonos-elements/p-2770ba48.system.js +1 -0
- package/dist/zonos-elements/p-305f27c7.entry.js +1 -0
- package/dist/zonos-elements/p-34d0ef7a.system.entry.js +1 -0
- package/dist/zonos-elements/p-3638e2ed.entry.js +1 -0
- package/dist/zonos-elements/p-36a461a6.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1a5f8df7.entry.js → p-3d8667a7.entry.js} +1 -1
- package/dist/zonos-elements/p-4a107b6f.system.js +1 -0
- package/dist/zonos-elements/p-4dca5484.system.entry.js +1 -0
- package/dist/zonos-elements/p-5120a57c.entry.js +1 -0
- package/dist/zonos-elements/p-54004793.system.entry.js +1 -0
- package/dist/zonos-elements/p-578f0aad.system.js +1 -0
- package/dist/zonos-elements/p-582d8b27.entry.js +1 -0
- package/dist/zonos-elements/p-5d993965.js +1 -0
- package/dist/zonos-elements/{p-262b8e1e.system.entry.js → p-5f9c066d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-66eb66d1.js +1 -0
- package/dist/zonos-elements/{p-95c864ca.system.entry.js → p-679877b1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6e9b72e4.entry.js +1 -0
- package/dist/zonos-elements/p-726e2268.system.entry.js +1 -0
- package/dist/zonos-elements/{p-fc4da55c.system.js → p-771fbeb3.system.js} +1 -1
- package/dist/zonos-elements/p-79f3c4f5.system.js +1 -0
- package/dist/zonos-elements/p-81a54668.js +1 -0
- package/dist/zonos-elements/p-835c8928.entry.js +1 -0
- package/dist/zonos-elements/p-83cc2936.js +1 -0
- package/dist/zonos-elements/p-83fecb2a.entry.js +1 -0
- package/dist/zonos-elements/{p-520e8e63.system.js → p-87badea9.system.js} +1 -1
- package/dist/zonos-elements/{p-d01576d7.js → p-909a331c.js} +1 -1
- package/dist/zonos-elements/p-94d6af4b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5ee8a685.entry.js → p-9b8ae241.entry.js} +1 -1
- package/dist/zonos-elements/p-9ea84657.system.entry.js +1 -0
- package/dist/zonos-elements/{p-24fee841.entry.js → p-9ec93319.entry.js} +1 -1
- package/dist/zonos-elements/p-a6d7ac46.js +1 -0
- package/dist/zonos-elements/{p-2a99c8b5.system.entry.js → p-a6eeb4bd.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a889c1bc.entry.js +1 -0
- package/dist/zonos-elements/p-ab7ac0db.system.entry.js +1 -0
- package/dist/zonos-elements/p-ad088d46.system.entry.js +1 -0
- package/dist/zonos-elements/p-aed0098c.system.js +1 -0
- package/dist/zonos-elements/p-b98bdbcc.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d3772fd3.entry.js → p-baee62a4.entry.js} +1 -1
- package/dist/zonos-elements/{p-eff12c31.system.entry.js → p-bf32179a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ca71b681.system.entry.js +1 -0
- package/dist/zonos-elements/p-d7acc81c.entry.js +1 -0
- package/dist/zonos-elements/p-dbdebdae.entry.js +1 -0
- package/dist/zonos-elements/p-df192668.system.js +1 -0
- package/dist/zonos-elements/{p-70ede197.system.entry.js → p-df24d548.system.entry.js} +1 -1
- package/dist/zonos-elements/p-df64afdd.entry.js +1 -0
- package/dist/zonos-elements/p-e108e5ed.system.entry.js +1 -0
- package/dist/zonos-elements/p-e1b2b610.entry.js +1 -0
- package/dist/zonos-elements/{p-6743734f.entry.js → p-e7b4b756.entry.js} +1 -1
- package/dist/zonos-elements/{p-d41b5762.js → p-f1962041.js} +1 -1
- package/dist/zonos-elements/p-f71489e5.system.entry.js +1 -0
- package/dist/zonos-elements/p-fd49d864.entry.js +1 -0
- package/dist/zonos-elements/p-fd5d2fc3.system.entry.js +1 -0
- package/dist/zonos-elements/p-fe246229.system.entry.js +1 -0
- package/dist/zonos-elements/p-ff403840.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.css +17 -9
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/index-3b4816ef.js +0 -2088
- package/dist/cjs/sendErrorLog-29e50f7e.js +0 -29
- package/dist/cjs/zonos-address_4.cjs.entry.js +0 -388
- package/dist/cjs/zonos-button_2.cjs.entry.js +0 -152
- package/dist/cjs/zonos-icon.cjs.entry.js +0 -39
- package/dist/components/sendErrorLog.js +0 -21
- package/dist/esm/index-0e31d804.js +0 -2055
- package/dist/esm/sendErrorLog-8642e94a.js +0 -26
- package/dist/esm/zonos-address_4.entry.js +0 -381
- package/dist/esm/zonos-button_2.entry.js +0 -147
- package/dist/esm/zonos-icon.entry.js +0 -35
- package/dist/esm-es5/cart-10bcd2e0.js +0 -1
- package/dist/esm-es5/getBorderRadius-8129b0cb.js +0 -1
- package/dist/esm-es5/index-0e31d804.js +0 -2
- package/dist/esm-es5/isColorVariable-fbf2d80d.js +0 -1
- package/dist/esm-es5/sendErrorLog-8642e94a.js +0 -1
- package/dist/esm-es5/submitGtag-84886899.js +0 -1
- package/dist/esm-es5/zonos-address_4.entry.js +0 -1
- package/dist/esm-es5/zonos-button_2.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
- package/dist/esm-es5/zonos-icon.entry.js +0 -1
- package/dist/scripts/insertTranslations.js +0 -1
- package/dist/zonos-elements/p-0253aeae.entry.js +0 -1
- package/dist/zonos-elements/p-031086ba.system.entry.js +0 -1
- package/dist/zonos-elements/p-1264b362.entry.js +0 -1
- package/dist/zonos-elements/p-1950dda7.entry.js +0 -1
- package/dist/zonos-elements/p-2244534c.js +0 -2
- package/dist/zonos-elements/p-2825570c.system.js +0 -2
- package/dist/zonos-elements/p-33abdb30.js +0 -1
- package/dist/zonos-elements/p-376bdf70.entry.js +0 -1
- package/dist/zonos-elements/p-3e417d7c.entry.js +0 -1
- package/dist/zonos-elements/p-450942a3.system.js +0 -1
- package/dist/zonos-elements/p-46f9c93e.system.entry.js +0 -1
- package/dist/zonos-elements/p-48a2b8b0.entry.js +0 -1
- package/dist/zonos-elements/p-49120f0e.system.entry.js +0 -1
- package/dist/zonos-elements/p-593948b5.system.entry.js +0 -1
- package/dist/zonos-elements/p-5ca09163.entry.js +0 -1
- package/dist/zonos-elements/p-5ff27485.js +0 -1
- package/dist/zonos-elements/p-6d9dbecb.system.entry.js +0 -1
- package/dist/zonos-elements/p-6e8d43de.entry.js +0 -1
- package/dist/zonos-elements/p-6f5761e8.js +0 -1
- package/dist/zonos-elements/p-7891f8d2.entry.js +0 -1
- package/dist/zonos-elements/p-78d22069.system.entry.js +0 -1
- package/dist/zonos-elements/p-8b44e558.system.js +0 -1
- package/dist/zonos-elements/p-8bc0e56a.system.entry.js +0 -1
- package/dist/zonos-elements/p-92446677.entry.js +0 -1
- package/dist/zonos-elements/p-9350d19f.entry.js +0 -1
- package/dist/zonos-elements/p-9768840a.system.entry.js +0 -1
- package/dist/zonos-elements/p-9db2f9d1.system.js +0 -1
- package/dist/zonos-elements/p-9e8f1065.system.entry.js +0 -1
- package/dist/zonos-elements/p-a0abc499.system.entry.js +0 -1
- package/dist/zonos-elements/p-a6bbf6de.system.entry.js +0 -1
- package/dist/zonos-elements/p-ae4a4634.system.entry.js +0 -1
- package/dist/zonos-elements/p-af8391bb.entry.js +0 -1
- package/dist/zonos-elements/p-b8e8330b.system.js +0 -1
- package/dist/zonos-elements/p-be022d8e.entry.js +0 -1
- package/dist/zonos-elements/p-bfa8d9a4.system.entry.js +0 -1
- package/dist/zonos-elements/p-c6170bec.system.js +0 -1
- package/dist/zonos-elements/p-d149bc5d.system.entry.js +0 -1
- package/dist/zonos-elements/p-e1ac5b2a.system.entry.js +0 -1
- package/dist/zonos-elements/p-e28ed57c.js +0 -1
- package/dist/zonos-elements/p-e705c44c.entry.js +0 -1
- package/dist/zonos-elements/p-e9fafda6.entry.js +0 -1
- package/dist/zonos-elements/p-ed2e94d2.js +0 -1
- package/dist/zonos-elements/p-f4c38bfc.system.js +0 -1
- package/dist/zonos-elements/p-fc35d717.system.entry.js +0 -1
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { stripeStore } from "../../store/checkout/stripe";
|
|
3
3
|
import { localizationStore } from "../../store/hello/localization";
|
|
4
|
-
import { translate } from "../../store/translationStore";
|
|
5
|
-
import { zonosStore } from "../../store/zonosStore";
|
|
6
4
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
7
|
-
import { containsNonLatinChars } from "../../utils/containsNonLatinChars";
|
|
8
5
|
import { logError } from "../../utils/logging/logError";
|
|
9
|
-
import { sendErrorLog } from "../../utils/logging/sendErrorLog";
|
|
10
|
-
const mappedFields = {
|
|
11
|
-
city: 'City',
|
|
12
|
-
country: 'Country',
|
|
13
|
-
line1: 'Address line 1',
|
|
14
|
-
line2: 'Address line 2',
|
|
15
|
-
name: 'Name',
|
|
16
|
-
postal_code: 'Postal code',
|
|
17
|
-
state: 'State',
|
|
18
|
-
};
|
|
19
6
|
/**
|
|
20
7
|
* This component is a wrapper for the stripe address element that would render default style object
|
|
21
8
|
*/
|
|
@@ -25,8 +12,6 @@ export class ZonosAddress {
|
|
|
25
12
|
this.titleText = undefined;
|
|
26
13
|
this.defaultAddress = null;
|
|
27
14
|
this.stripe = window.Zonos.stripe;
|
|
28
|
-
this.reportedInvalidCharacters = false;
|
|
29
|
-
this.invalidCharacterList = null;
|
|
30
15
|
this.isDirtyAddress = false;
|
|
31
16
|
}
|
|
32
17
|
getStripeAddressInstance() {
|
|
@@ -52,9 +37,6 @@ export class ZonosAddress {
|
|
|
52
37
|
stripeStore.stripeAddressEventData = event;
|
|
53
38
|
break;
|
|
54
39
|
}
|
|
55
|
-
const invalidCharacterList = this.checkInvalidCharacters(event);
|
|
56
|
-
this.invalidCharacterList = invalidCharacterList;
|
|
57
|
-
this.invalidCharacters.emit(!!invalidCharacterList);
|
|
58
40
|
}
|
|
59
41
|
updateAddressElement({ stripeAddressElement, type, }) {
|
|
60
42
|
if (type === 'shipping') {
|
|
@@ -63,47 +45,6 @@ export class ZonosAddress {
|
|
|
63
45
|
}
|
|
64
46
|
stripeStore.stripeBillingAddressElement = stripeAddressElement;
|
|
65
47
|
}
|
|
66
|
-
checkInvalidCharacters(address) {
|
|
67
|
-
// Do nothing if the allowed character sets is ALL or the address is incomplete
|
|
68
|
-
if (!address.complete ||
|
|
69
|
-
zonosStore.checkoutSettings.allowedCharacterSets === 'ALL') {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
const { address: addressValue, firstName, lastName, name } = address.value;
|
|
73
|
-
const { city, country, line1, line2, postal_code, state } = addressValue;
|
|
74
|
-
const invalidList = containsNonLatinChars({
|
|
75
|
-
city,
|
|
76
|
-
country,
|
|
77
|
-
line1,
|
|
78
|
-
line2: line2 || '',
|
|
79
|
-
name: name || `${firstName} ${lastName}`,
|
|
80
|
-
postal_code,
|
|
81
|
-
state,
|
|
82
|
-
});
|
|
83
|
-
if (!Object.keys(invalidList).length) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
// send error event only once so we know what value is invalid
|
|
87
|
-
if (!this.reportedInvalidCharacters) {
|
|
88
|
-
this.reportedInvalidCharacters = true;
|
|
89
|
-
void sendErrorLog({
|
|
90
|
-
endpoint: 'NonLatinInput',
|
|
91
|
-
errors: Object.keys(invalidList).map(fieldName => {
|
|
92
|
-
var _a;
|
|
93
|
-
if (fieldName !== 'name') {
|
|
94
|
-
// trim all number so we don't send sensitive information
|
|
95
|
-
const trimmedAddress = (_a = addressValue[fieldName]) === null || _a === void 0 ? void 0 : _a.replace(/[\d\w]+/g, '');
|
|
96
|
-
return `Invalid character found ${fieldName}: "${trimmedAddress}"`;
|
|
97
|
-
}
|
|
98
|
-
const customerName = name || `${firstName} ${lastName}`;
|
|
99
|
-
const trimmedName = customerName.replace(/[\d\w]+/g, '');
|
|
100
|
-
return `Invalid character found ${fieldName}: "${trimmedName}"`;
|
|
101
|
-
}),
|
|
102
|
-
metadata: {},
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
return invalidList;
|
|
106
|
-
}
|
|
107
48
|
async watchInitStripe() {
|
|
108
49
|
var _a, _b;
|
|
109
50
|
this.stripe = window.Zonos.stripe;
|
|
@@ -191,17 +132,10 @@ export class ZonosAddress {
|
|
|
191
132
|
stripeAddressEventData.value.address.line1.length > 0;
|
|
192
133
|
// @Watch doesn't get trigger on initial load
|
|
193
134
|
void this.watchInitStripe();
|
|
194
|
-
setTimeout(() => {
|
|
195
|
-
// check if the address contains invalid characters after address is loaded
|
|
196
|
-
const newStripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
197
|
-
if (newStripeAddressEventData) {
|
|
198
|
-
this.checkInvalidCharacters(newStripeAddressEventData);
|
|
199
|
-
}
|
|
200
|
-
}, 500);
|
|
201
135
|
}
|
|
202
136
|
render() {
|
|
203
137
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
204
|
-
return (h(Host, { key: '
|
|
138
|
+
return (h(Host, { key: 'f45a7bbe9d6b5ffac15671a862b3ad4f2eb4a87b', class: "zonos--address zonos--elements" }, h("zonos-text", { key: 'a9119e6e0c4e5c81a7d17ebe4d6bec925404a3dd', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '7dc12043c6e75ebabd646490c390bafdc2cd4a1d', class: "zonos--address-component" })));
|
|
205
139
|
}
|
|
206
140
|
static get is() { return "zonos-address"; }
|
|
207
141
|
static get encapsulation() { return "scoped"; }
|
|
@@ -255,10 +189,10 @@ export class ZonosAddress {
|
|
|
255
189
|
"type": "unknown",
|
|
256
190
|
"mutable": false,
|
|
257
191
|
"complexType": {
|
|
258
|
-
"original": "
|
|
192
|
+
"original": "StripeContactOption | null",
|
|
259
193
|
"resolved": "ContactOption | null",
|
|
260
194
|
"references": {
|
|
261
|
-
"
|
|
195
|
+
"StripeContactOption": {
|
|
262
196
|
"location": "import",
|
|
263
197
|
"path": "@stripe/stripe-js",
|
|
264
198
|
"id": ""
|
|
@@ -278,8 +212,6 @@ export class ZonosAddress {
|
|
|
278
212
|
static get states() {
|
|
279
213
|
return {
|
|
280
214
|
"stripe": {},
|
|
281
|
-
"reportedInvalidCharacters": {},
|
|
282
|
-
"invalidCharacterList": {},
|
|
283
215
|
"isDirtyAddress": {}
|
|
284
216
|
};
|
|
285
217
|
}
|
package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
|
-
import { stripeStore
|
|
3
|
+
import { stripeStore } from "../../store/checkout/stripe";
|
|
4
4
|
import { logError } from "../../utils/logging/logError";
|
|
5
5
|
/**
|
|
6
6
|
* This component is a wrapper for the stripe authentication element that would render default style object
|
|
@@ -8,15 +8,23 @@ import { logError } from "../../utils/logging/logError";
|
|
|
8
8
|
export class ZonosLinkAuthentication {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.titleText = undefined;
|
|
11
|
+
this.defaultEmail = null;
|
|
11
12
|
this.stripe = stripeStore.stripe;
|
|
12
13
|
}
|
|
13
14
|
watchInitStripe() {
|
|
14
15
|
if (!this.stripe || !stripeStore.stripeElements) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
18
|
+
const defaultValues = this.defaultEmail
|
|
19
|
+
? {
|
|
20
|
+
email: this.defaultEmail,
|
|
21
|
+
}
|
|
22
|
+
: undefined;
|
|
17
23
|
// Create and mount the Authentication Element in ${type} mode
|
|
18
24
|
const linkAuthenticationElement = stripeStore.stripeLinkElement ||
|
|
19
|
-
stripeStore.stripeElements.create('linkAuthentication'
|
|
25
|
+
stripeStore.stripeElements.create('linkAuthentication', {
|
|
26
|
+
defaultValues: defaultValues || undefined,
|
|
27
|
+
});
|
|
20
28
|
const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
|
|
21
29
|
if (!linkAuthenticationElementContainer) {
|
|
22
30
|
logError('Cannot find container element for linkAuthenticationElement');
|
|
@@ -25,8 +33,6 @@ export class ZonosLinkAuthentication {
|
|
|
25
33
|
linkAuthenticationElement.mount(linkAuthenticationElementContainer);
|
|
26
34
|
linkAuthenticationElement.on('change', event => {
|
|
27
35
|
stripeStore.stripeLinkEventData = event;
|
|
28
|
-
// run prefetch landed cost when address is changed
|
|
29
|
-
void stripeStorePrefetchLandedCost();
|
|
30
36
|
});
|
|
31
37
|
stripeStore.stripeLinkElement = linkAuthenticationElement;
|
|
32
38
|
}
|
|
@@ -36,7 +42,7 @@ export class ZonosLinkAuthentication {
|
|
|
36
42
|
}
|
|
37
43
|
render() {
|
|
38
44
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
39
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '4a7b9eb534e938f791f70e04756aa9fb1c39f2c7', class: "zonos--link-authentication zonos--elements" }, h("zonos-text", { key: 'cc4fe49ed6d4bd7cec502ef739b9e835e9e26584', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'f04a438d04e6ccd608d7ff61ac300fb09da4f0ce', class: "zonos--link-authentication-component" })));
|
|
40
46
|
}
|
|
41
47
|
static get is() { return "zonos-link-authentication"; }
|
|
42
48
|
static get encapsulation() { return "scoped"; }
|
|
@@ -68,6 +74,24 @@ export class ZonosLinkAuthentication {
|
|
|
68
74
|
},
|
|
69
75
|
"attribute": "title-text",
|
|
70
76
|
"reflect": false
|
|
77
|
+
},
|
|
78
|
+
"defaultEmail": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "string | null",
|
|
83
|
+
"resolved": "null | string",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Default email for stripe"
|
|
91
|
+
},
|
|
92
|
+
"attribute": "default-email",
|
|
93
|
+
"reflect": false,
|
|
94
|
+
"defaultValue": "null"
|
|
71
95
|
}
|
|
72
96
|
};
|
|
73
97
|
}
|
|
@@ -37,7 +37,7 @@ export class ZonosPayment {
|
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
39
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '7967dfeb2c8661201aed74d3d9f4be1df9eb993d', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: '2a3b744c1935f471897ab492efa7d3788907b126', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '7d643ec935dc15339c79237572bd067efa8f23ea', class: "zonos--payment-component" })));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "zonos-payment"; }
|
|
43
43
|
static get encapsulation() { return "scoped"; }
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function generates an object that contains the fields of an address that have invalid characters.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} params - The parameters for the function.
|
|
5
|
+
* @param {Address | null} params.address - The address to check for invalid characters.
|
|
6
|
+
* @param {ReturnType<typeof containsNonLatinChars> | null} params.invalidAdddressList - The list of address fields that contain invalid characters.
|
|
7
|
+
*
|
|
8
|
+
* @returns {Partial<Address> | undefined} - An object that contains the fields of the address that have invalid characters. If no fields have invalid characters, the function returns undefined.
|
|
9
|
+
*/
|
|
10
|
+
const getExcludeAddressFieldsObject = ({ address, invalidAdddressList, }) => {
|
|
11
|
+
if (!address) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// if there are no invalid characters, return an empty object
|
|
15
|
+
if (!invalidAdddressList) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const excludeFields = {};
|
|
19
|
+
if (invalidAdddressList.city) {
|
|
20
|
+
excludeFields.city = address.city;
|
|
21
|
+
}
|
|
22
|
+
if (invalidAdddressList.line1) {
|
|
23
|
+
excludeFields.line1 = address.line1;
|
|
24
|
+
}
|
|
25
|
+
if (invalidAdddressList.line2) {
|
|
26
|
+
excludeFields.line2 = address.line2;
|
|
27
|
+
}
|
|
28
|
+
if (invalidAdddressList.postal_code) {
|
|
29
|
+
excludeFields.postal_code = address.postal_code;
|
|
30
|
+
}
|
|
31
|
+
if (invalidAdddressList.state) {
|
|
32
|
+
excludeFields.state = address.state;
|
|
33
|
+
}
|
|
34
|
+
if (invalidAdddressList.name) {
|
|
35
|
+
excludeFields.name = address.name;
|
|
36
|
+
}
|
|
37
|
+
// return null if there are no fields to exclude
|
|
38
|
+
return Object.keys(excludeFields).length ? excludeFields : undefined;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* This function builds the request body for validating an address. It checks if the address and billing address are ready and if they contain any invalid characters.
|
|
42
|
+
* If there are non-latin character to translate, returns an object with the address fields that have invalid characters, the destination country, and the first and last name.
|
|
43
|
+
* If the conditions are not met, it returns null.
|
|
44
|
+
*
|
|
45
|
+
* @param {Object} params - The parameters for the function.
|
|
46
|
+
* @param {ReturnType<typeof containsNonLatinChars> | null} params.addressInvalidCharactersList - The list of address fields that contain invalid characters.
|
|
47
|
+
* @param {ReturnType<typeof containsNonLatinChars> | null} params.billingAddressInvalidCharactersList - The list of billing address fields that contain invalid characters.
|
|
48
|
+
* @param {StripeAddressEventData} params.stripeAddressEventData - The Stripe event data for the address.
|
|
49
|
+
* @param {StripeAddressEventData} params.stripeBillingAddressEventData - The Stripe event data for the billing address.
|
|
50
|
+
* @param {boolean} params.stripeShippingSameAsBilling - A flag indicating whether the shipping address is the same as the billing address.
|
|
51
|
+
*
|
|
52
|
+
* @returns {ValidateAddressRequestBody | null} - An object that contains the address fields that have invalid characters, the destination country, and the first and last name. If the conditions are not met, the function returns null.
|
|
53
|
+
*/
|
|
54
|
+
export const buildTranslateRequestBody = ({ addressInvalidCharactersList, billingAddressInvalidCharactersList, stripeAddressEventData, stripeBillingAddressEventData, stripeShippingSameAsBilling, }) => {
|
|
55
|
+
var _a, _b, _c, _d;
|
|
56
|
+
const isStripeAddressReady = !!(stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.complete);
|
|
57
|
+
const isStripeBillingAddressReady = stripeShippingSameAsBilling
|
|
58
|
+
? isStripeAddressReady
|
|
59
|
+
: !!(stripeBillingAddressEventData === null || stripeBillingAddressEventData === void 0 ? void 0 : stripeBillingAddressEventData.complete);
|
|
60
|
+
// only translate if both address and billing address are ready
|
|
61
|
+
if (!isStripeAddressReady || !isStripeBillingAddressReady) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
// only translate if there are invalid characters
|
|
65
|
+
if (!addressInvalidCharactersList && !billingAddressInvalidCharactersList) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const stripeAddressValue = stripeAddressEventData.value;
|
|
69
|
+
const stripeBillingAddressValue = (stripeBillingAddressEventData === null || stripeBillingAddressEventData === void 0 ? void 0 : stripeBillingAddressEventData.value) || null;
|
|
70
|
+
// Returns undefined if the name is Latin so it won't be included in the request body
|
|
71
|
+
const firstName = stripeAddressValue.firstName || ((_a = stripeAddressValue.name) === null || _a === void 0 ? void 0 : _a.split(' ')[0]);
|
|
72
|
+
const lastName = stripeAddressValue.lastName || ((_b = stripeAddressValue.name) === null || _b === void 0 ? void 0 : _b.split(' ')[1]);
|
|
73
|
+
const name = `${firstName} ${lastName}`;
|
|
74
|
+
const billingFirstName = stripeAddressValue.firstName ||
|
|
75
|
+
((_c = stripeBillingAddressValue === null || stripeBillingAddressValue === void 0 ? void 0 : stripeBillingAddressValue.name) === null || _c === void 0 ? void 0 : _c.split(' ')[0]);
|
|
76
|
+
const billingLastName = stripeAddressValue.lastName ||
|
|
77
|
+
((_d = stripeBillingAddressValue === null || stripeBillingAddressValue === void 0 ? void 0 : stripeBillingAddressValue.name) === null || _d === void 0 ? void 0 : _d.split(' ')[1]);
|
|
78
|
+
const billingName = billingFirstName && billingLastName
|
|
79
|
+
? `${billingFirstName} ${billingLastName}`
|
|
80
|
+
: '';
|
|
81
|
+
const address = stripeAddressValue.address;
|
|
82
|
+
const billingAddress = stripeBillingAddressValue === null || stripeBillingAddressValue === void 0 ? void 0 : stripeBillingAddressValue.address;
|
|
83
|
+
return {
|
|
84
|
+
address: getExcludeAddressFieldsObject({
|
|
85
|
+
address: Object.assign(Object.assign({}, address), { name }),
|
|
86
|
+
invalidAdddressList: addressInvalidCharactersList,
|
|
87
|
+
}),
|
|
88
|
+
// only include billing address if it's different from the shipping address
|
|
89
|
+
billingAddress: !stripeShippingSameAsBilling
|
|
90
|
+
? getExcludeAddressFieldsObject({
|
|
91
|
+
address: billingAddress
|
|
92
|
+
? Object.assign(Object.assign({}, billingAddress), { name: billingName }) : null,
|
|
93
|
+
invalidAdddressList: billingAddressInvalidCharactersList,
|
|
94
|
+
})
|
|
95
|
+
: undefined,
|
|
96
|
+
destinationCountry: address.country,
|
|
97
|
+
};
|
|
98
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
* Check if the given address object contains non-latin characters
|
|
3
|
-
* @returns an object with the same keys as the input object, and a boolean value indicating if the value contains non-latin characters
|
|
4
|
-
*/
|
|
5
|
-
export const containsNonLatinChars = (params) => {
|
|
1
|
+
export const isTextContainsNonLatinChars = (text) => {
|
|
6
2
|
const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
|
|
7
3
|
/**
|
|
8
4
|
* This regex matches any character that is not a latin character, punctuation, symbol, number, separator, control, or mark
|
|
9
5
|
* I limited the character found to 1 in the regex, so that we can return early if we find any non-latin character
|
|
10
6
|
**/
|
|
11
7
|
const nonLatinRegex = /[^\p{Script=Latin}\p{P}\p{S}\p{N}\p{Z}\p{C}\p{M}]{1}/u;
|
|
12
|
-
|
|
8
|
+
return (nonLatinRegex.test(text) &&
|
|
13
9
|
// allow special characters like web apostrophe and quotation mark
|
|
14
|
-
!specialCharacters.test(
|
|
15
|
-
|
|
10
|
+
!specialCharacters.test(text));
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Check if the given address object contains non-latin characters
|
|
14
|
+
* @returns an object with the same keys as the input object, and a boolean value indicating if the value contains non-latin characters
|
|
15
|
+
*/
|
|
16
|
+
export const containsNonLatinChars = (params) => {
|
|
17
|
+
const nonLatinValueList = Object.entries(params).reduce((prev, [key, value]) => isTextContainsNonLatinChars(value) ? Object.assign(Object.assign({}, prev), { [key]: true }) : prev, {});
|
|
16
18
|
return nonLatinValueList;
|
|
17
19
|
};
|
|
@@ -4,11 +4,9 @@ import { zonosStore } from "../store/zonosStore";
|
|
|
4
4
|
* @param overrideBorderStyle
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
|
-
export const getBorderRadius = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
customRoundRadius = '10px') => {
|
|
7
|
+
export const getBorderRadius = (params) => {
|
|
8
|
+
const customRoundRadius = (params === null || params === void 0 ? void 0 : params.customRoundRadius) || '10px';
|
|
9
|
+
const overrideBorderStyle = params === null || params === void 0 ? void 0 : params.overrideBorderStyle;
|
|
12
10
|
if (overrideBorderStyle) {
|
|
13
11
|
// If the override is set, use that, otherwise use the default radius style
|
|
14
12
|
return overrideBorderStyle === 'SHARP' ? '0px' : customRoundRadius;
|
|
@@ -8,7 +8,7 @@ export const getButtonTheme = (overrideBackground) => {
|
|
|
8
8
|
// use override background if it exists, otherwise use color from setting
|
|
9
9
|
const background = overrideBackground || zonosStore.appearance.colorSecondary;
|
|
10
10
|
const backgroundColor = background && isColorVariable(background)
|
|
11
|
-
? `var(--
|
|
11
|
+
? `var(--zonos-elements-${background})`
|
|
12
12
|
: background;
|
|
13
13
|
// determine theme based on background color (to change button text color if needed)
|
|
14
14
|
const buttonTheme = backgroundColor && isDarkColor(backgroundColor) ? 'DARK' : 'LIGHT';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const isColorVariable = (color) => {
|
|
2
2
|
const isAminoVariable = color &&
|
|
3
|
-
// match --
|
|
4
|
-
(/--
|
|
3
|
+
// match --zonos-elements-<color>
|
|
4
|
+
(/--zonos-elements-/gi.test(color) ||
|
|
5
5
|
// match 'gray-0'
|
|
6
6
|
/(\-*)\w+-\d+/gi.test(color));
|
|
7
7
|
return (!!isAminoVariable &&
|
|
@@ -3,7 +3,7 @@ export const defaultVariable = ({ borderStyle, theme, }) => {
|
|
|
3
3
|
switch (theme) {
|
|
4
4
|
case 'DARK':
|
|
5
5
|
return {
|
|
6
|
-
borderRadius: getBorderRadius(borderStyle),
|
|
6
|
+
borderRadius: getBorderRadius({ overrideBorderStyle: borderStyle }),
|
|
7
7
|
colorBackground: '#101117',
|
|
8
8
|
colorBackgroundText: '#C5C6CA',
|
|
9
9
|
colorText: '#C5C6CA',
|
|
@@ -11,7 +11,7 @@ export const defaultVariable = ({ borderStyle, theme, }) => {
|
|
|
11
11
|
};
|
|
12
12
|
default:
|
|
13
13
|
return {
|
|
14
|
-
borderRadius: getBorderRadius(borderStyle),
|
|
14
|
+
borderRadius: getBorderRadius({ overrideBorderStyle: borderStyle }),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const isTextContainsNonLatinChars = (text) => {
|
|
2
|
+
const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
|
|
3
|
+
/**
|
|
4
|
+
* This regex matches any character that is not a latin character, punctuation, symbol, number, separator, control, or mark
|
|
5
|
+
* I limited the character found to 1 in the regex, so that we can return early if we find any non-latin character
|
|
6
|
+
**/
|
|
7
|
+
const nonLatinRegex = /[^\p{Script=Latin}\p{P}\p{S}\p{N}\p{Z}\p{C}\p{M}]{1}/u;
|
|
8
|
+
return (nonLatinRegex.test(text) &&
|
|
9
|
+
// allow special characters like web apostrophe and quotation mark
|
|
10
|
+
!specialCharacters.test(text));
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Check if the given address object contains non-latin characters
|
|
14
|
+
* @returns an object with the same keys as the input object, and a boolean value indicating if the value contains non-latin characters
|
|
15
|
+
*/
|
|
16
|
+
const containsNonLatinChars = (params) => {
|
|
17
|
+
const nonLatinValueList = Object.entries(params).reduce((prev, [key, value]) => isTextContainsNonLatinChars(value) ? Object.assign(Object.assign({}, prev), { [key]: true }) : prev, {});
|
|
18
|
+
return nonLatinValueList;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { containsNonLatinChars as c, isTextContainsNonLatinChars as i };
|
|
@@ -5,11 +5,9 @@ import { z as zonosStore } from './zonosStore.js';
|
|
|
5
5
|
* @param overrideBorderStyle
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
|
-
const getBorderRadius = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
customRoundRadius = '10px') => {
|
|
8
|
+
const getBorderRadius = (params) => {
|
|
9
|
+
const customRoundRadius = (params === null || params === void 0 ? void 0 : params.customRoundRadius) || '10px';
|
|
10
|
+
const overrideBorderStyle = params === null || params === void 0 ? void 0 : params.overrideBorderStyle;
|
|
13
11
|
if (overrideBorderStyle) {
|
|
14
12
|
// If the override is set, use that, otherwise use the default radius style
|
|
15
13
|
return overrideBorderStyle === 'SHARP' ? '0px' : customRoundRadius;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const isColorVariable = (color) => {
|
|
2
2
|
const isAminoVariable = color &&
|
|
3
|
-
// match --
|
|
4
|
-
(/--
|
|
3
|
+
// match --zonos-elements-<color>
|
|
4
|
+
(/--zonos-elements-/gi.test(color) ||
|
|
5
5
|
// match 'gray-0'
|
|
6
6
|
/(\-*)\w+-\d+/gi.test(color));
|
|
7
7
|
return (!!isAminoVariable &&
|