@zonos/elements 1.2.4-alpha.8 → 1.3.3-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/README.md +80 -1
- package/dist/cjs/{cart-90f7c8c0.js → cart-cfa5d5fd.js} +4 -4
- package/dist/cjs/{getBorderRadius-bf4a4276.js → getBorderRadius-c3c63ee6.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{isDarkColor-ff6ff183.js → isDarkColor-fc8c294a.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-9caf3397.js → localization-4746acf7.js} +2 -2
- package/dist/cjs/{submitGtag-b141b45d.js → submitGtag-ca175427.js} +2 -2
- package/dist/cjs/zonos-address_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +45 -16
- package/dist/cjs/zonos-checkout.cjs.entry.js +14 -9
- package/dist/cjs/zonos-controller.cjs.entry.js +14 -54
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +8 -5
- package/dist/cjs/zonos-icon.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-b43ef5db.js → zonosStore-10d1d6ff.js} +0 -8
- package/dist/collection/__tests__/build-utils/urlCheckOne.js +4 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +43 -10
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +8 -3
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +4 -4
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +6 -3
- package/dist/collection/components/main/zonos-controller.js +35 -54
- package/dist/collection/components/store/zonosStore.js +0 -8
- package/dist/collection/components/utils/api/{getZonosSetting.js → getZonosSettings.js} +2 -2
- package/dist/collection/components/utils/handleFetch.js +1 -1
- package/dist/collection/environment.js +14 -3
- package/dist/collection/scripts/{zonos.js → zonosBase.js} +23 -19
- package/dist/collection/types/generated/graphql.customer.types.js +65 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
- package/dist/components/localization.js +1 -1
- package/dist/components/zonos-checkout-finish2.js +40 -10
- package/dist/components/zonos-checkout.js +8 -3
- package/dist/components/zonos-controller.js +11 -50
- package/dist/components/zonos-dialog2.js +1 -1
- package/dist/components/zonos-hello.js +6 -3
- package/dist/components/zonosStore.js +0 -8
- package/dist/esm/{cart-b439be00.js → cart-d81b92ea.js} +4 -4
- package/dist/esm/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-a51ccbc2.js → localization-0c5b29fd.js} +2 -2
- package/dist/esm/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +2 -2
- package/dist/esm/zonos-address_2.entry.js +5 -5
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_2.entry.js +3 -3
- package/dist/esm/zonos-card_2.entry.js +1 -1
- package/dist/esm/zonos-cart-items_10.entry.js +45 -16
- package/dist/esm/zonos-checkout.entry.js +14 -9
- package/dist/esm/zonos-controller.entry.js +14 -54
- package/dist/esm/zonos-country-flag_4.entry.js +3 -3
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +8 -5
- package/dist/esm/zonos-icon.entry.js +1 -1
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +0 -8
- package/dist/esm-es5/{cart-b439be00.js → cart-d81b92ea.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{localization-a51ccbc2.js → localization-0c5b29fd.js} +1 -1
- package/dist/esm-es5/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +1 -1
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-icon.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-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +1 -1
- package/dist/scripts/extractZonosQaUrl.js +1 -30
- package/dist/scripts/loadStripe.js +1 -118
- package/dist/scripts/loadZonos.js +1 -565
- package/dist/scripts/stripe.js +1 -126
- package/dist/scripts/zonos.js +1 -565
- package/dist/scripts/zonosBase.js +1 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +3 -3
- package/dist/types/components/main/zonos-controller.d.ts +5 -2
- package/dist/types/components/store/zonosStore.d.ts +1 -3
- package/dist/types/components/utils/api/{getZonosSetting.d.ts → getZonosSettings.d.ts} +1 -1
- package/dist/types/components.d.ts +6 -2
- package/dist/types/scripts/{zonos.d.ts → zonosBase.d.ts} +6 -3
- package/dist/types/types/LogErrorRequestBody.d.ts +5 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -2
- package/dist/types/types/generated/graphql.customer.types.d.ts +80 -0
- package/dist/types/types/generated/graphql.customer.types.ts +114 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +33 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +68 -0
- package/dist/types/types/global.d.ts +10 -2
- package/dist/types/types/hello/HelloConfig.d.ts +0 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-02175f85.entry.js +1 -0
- package/dist/zonos-elements/{p-1685c8df.js → p-06a332cd.js} +1 -1
- package/dist/zonos-elements/{p-4ed71bd7.entry.js → p-124857ae.entry.js} +1 -1
- package/dist/zonos-elements/p-17ef815f.entry.js +1 -0
- package/dist/zonos-elements/{p-e98be2d0.system.entry.js → p-1f494581.system.entry.js} +1 -1
- package/dist/zonos-elements/p-24fbe845.system.js +1 -1
- package/dist/zonos-elements/{p-4846796a.js → p-2b41549a.js} +1 -1
- package/dist/zonos-elements/p-2e1e9074.js +1 -0
- package/dist/zonos-elements/{p-2801d868.entry.js → p-3509ffaa.entry.js} +1 -1
- package/dist/zonos-elements/{p-1d4a970b.entry.js → p-3c8763a7.entry.js} +1 -1
- package/dist/zonos-elements/{p-49f09b91.entry.js → p-3e7444c6.entry.js} +1 -1
- package/dist/zonos-elements/{p-55f49f1e.js → p-4b3baf99.js} +1 -1
- package/dist/zonos-elements/{p-a504f64f.system.js → p-5066955b.system.js} +1 -1
- package/dist/zonos-elements/{p-e5ae22a9.system.entry.js → p-53ea93c2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f367f2fe.system.entry.js → p-5bada106.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f141519c.system.entry.js → p-72cfaee2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b85be1ab.system.js → p-7730250d.system.js} +1 -1
- package/dist/zonos-elements/p-80748529.system.entry.js +1 -0
- package/dist/zonos-elements/{p-089ba905.js → p-86f22026.js} +1 -1
- package/dist/zonos-elements/{p-a0e36ed3.entry.js → p-88600956.entry.js} +1 -1
- package/dist/zonos-elements/{p-89c210d6.entry.js → p-8b1cb8a4.entry.js} +1 -1
- package/dist/zonos-elements/p-8bd04aaa.entry.js +1 -0
- package/dist/zonos-elements/{p-47390db7.system.entry.js → p-935fa685.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-639396bb.entry.js → p-9c1f19b6.entry.js} +1 -1
- package/dist/zonos-elements/{p-4d93275c.entry.js → p-a063c4b7.entry.js} +1 -1
- package/dist/zonos-elements/p-a174d834.system.js +1 -0
- package/dist/zonos-elements/{p-3c6988d7.js → p-a244579e.js} +1 -1
- package/dist/zonos-elements/{p-24eed2a8.system.js → p-a54d8db3.system.js} +1 -1
- package/dist/zonos-elements/{p-e1f6ab97.entry.js → p-ab00288a.entry.js} +1 -1
- package/dist/zonos-elements/{p-b51de536.system.js → p-ab179c88.system.js} +1 -1
- package/dist/zonos-elements/{p-4bee0bff.system.entry.js → p-b3a71ae4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d856a200.system.entry.js → p-b3e034bb.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3cea383b.system.entry.js → p-bb7de2c4.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c0494ed6.entry.js +1 -0
- package/dist/zonos-elements/{p-da060b1c.system.js → p-c1665c4f.system.js} +1 -1
- package/dist/zonos-elements/{p-2f43da39.system.entry.js → p-c1e298d5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8c5595d9.system.entry.js → p-c520d819.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c9348bb0.system.entry.js → p-ca875e60.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b4601210.system.entry.js → p-ccd1794a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e2c7adaa.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b6148206.entry.js → p-e3bca405.entry.js} +1 -1
- package/dist/zonos-elements/{p-a376a37f.entry.js → p-e58cc024.entry.js} +1 -1
- package/dist/zonos-elements/{p-938803f4.entry.js → p-e6556b0d.entry.js} +1 -1
- package/dist/zonos-elements/{p-d2217f09.system.js → p-ed074fbf.system.js} +1 -1
- package/dist/zonos-elements/{p-560aa686.system.entry.js → p-f1e9b431.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4a15c5c7.system.entry.js → p-fbc09dae.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +9 -6
- package/dist/types/types/online-store/OnlineStoreConfig.d.ts +0 -3
- package/dist/zonos-elements/p-06fb9d1f.system.entry.js +0 -1
- package/dist/zonos-elements/p-19942abb.system.entry.js +0 -1
- package/dist/zonos-elements/p-494c77a7.entry.js +0 -1
- package/dist/zonos-elements/p-8c48b75e.system.js +0 -1
- package/dist/zonos-elements/p-a3a8b5e7.entry.js +0 -1
- package/dist/zonos-elements/p-afe26069.entry.js +0 -1
- package/dist/zonos-elements/p-e9b832c5.entry.js +0 -1
- package/dist/zonos-elements/p-ff95f098.js +0 -1
- /package/dist/collection/types/{online-store/OnlineStoreConfig.js → LogErrorRequestBody.js} +0 -0
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello.cjs",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog.cjs",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10.cjs",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"order":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello.cjs",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog.cjs",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10.cjs",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"order":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0dcccc22.js');
|
|
6
|
-
const localization = require('./localization-
|
|
7
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const localization = require('./localization-4746acf7.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-10d1d6ff.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
10
10
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0dcccc22.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
7
|
-
const localization = require('./localization-
|
|
6
|
+
const zonosStore = require('./zonosStore-10d1d6ff.js');
|
|
7
|
+
const localization = require('./localization-4746acf7.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
10
10
|
|
|
@@ -459,7 +459,7 @@ const RESIZE_DEBOUNCE_DELAY_MS = 500;
|
|
|
459
459
|
const ZonosHello = class {
|
|
460
460
|
constructor(hostRef) {
|
|
461
461
|
index.registerInstance(this, hostRef);
|
|
462
|
-
this.getHelloPeekMessage = () => {
|
|
462
|
+
this.getHelloPeekMessage = (organizationName) => {
|
|
463
463
|
const isRestrictionPage = zonosStore.zonosStore.currentHelloPage === 'productDetail' ||
|
|
464
464
|
zonosStore.zonosStore.currentHelloPage === 'productList';
|
|
465
465
|
if (isRestrictionPage && this.allRestrictedItems.length) {
|
|
@@ -476,7 +476,7 @@ const ZonosHello = class {
|
|
|
476
476
|
case 'productDetail':
|
|
477
477
|
return localization.translate(`See duty and tax thresholds`);
|
|
478
478
|
default:
|
|
479
|
-
return `${localization.translate('Welcome to')} ${
|
|
479
|
+
return `${localization.translate('Welcome to')} ${organizationName}`;
|
|
480
480
|
}
|
|
481
481
|
};
|
|
482
482
|
this.enableShowPeekMessage = () => {
|
|
@@ -496,7 +496,7 @@ const ZonosHello = class {
|
|
|
496
496
|
return newRestrictions;
|
|
497
497
|
};
|
|
498
498
|
this.triggerShowPeekMessage = () => {
|
|
499
|
-
this.peekMessage = this.getHelloPeekMessage();
|
|
499
|
+
this.peekMessage = this.getHelloPeekMessage(zonosStore.zonosStore.organizationName);
|
|
500
500
|
const { peekMessageBehavior, peekMessageDelay } = zonosStore.zonosStore.helloSettings;
|
|
501
501
|
// peek message delay is passed in seconds, but setTimeout expects milliseconds
|
|
502
502
|
const peekMessageDelayToUse = peekMessageDelay * 1000;
|
|
@@ -692,6 +692,9 @@ const ZonosHello = class {
|
|
|
692
692
|
const appearanceSettings = zonosStore.mergeConfig(zonosStore.zonosStore.appearance, this.appearanceSettingsOverride);
|
|
693
693
|
const { theme } = appearanceSettings;
|
|
694
694
|
const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
|
|
695
|
+
// The organization name can be changed after init with the updateOrganizationName method.
|
|
696
|
+
// This will cause the element to rerender with the new org name when it changes. (used for preview on dashboard)
|
|
697
|
+
this.peekMessage = this.getHelloPeekMessage(zonosStore.zonosStore.organizationName);
|
|
695
698
|
const showHello = this.isShippableCountry() && !!selectedCountryCode;
|
|
696
699
|
return (index.h(index.Host, { class: "zonos--hello zonos--elements", "data-theme": theme }, showHello && (index.h("div", { class: "zonos--hello-wrapper" }, index.h("button", { class: classes.classes([
|
|
697
700
|
'zonos--hello-widget',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0dcccc22.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-10d1d6ff.js');
|
|
7
7
|
|
|
8
8
|
const zonosIconCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--width);height:var(--height);fill:var(--color);color:var(--color)}";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0dcccc22.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-10d1d6ff.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosNotificationCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999;bottom:var(--amino-space-24);gap:var(--amino-space-8);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:var(--amino-space-8);border-radius:var(--border-radius, var(--amino-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--amino-green-700)}:host .zonos--notification-item.error{background-color:var(--amino-red-700)}:host .zonos--notification-item.warning{background-color:var(--amino-orange-700)}";
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0dcccc22.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
require('./zonosStore-
|
|
8
|
-
require('./localization-
|
|
9
|
-
require('./isDarkColor-
|
|
10
|
-
require('./getBorderRadius-
|
|
6
|
+
const cart = require('./cart-cfa5d5fd.js');
|
|
7
|
+
require('./zonosStore-10d1d6ff.js');
|
|
8
|
+
require('./localization-4746acf7.js');
|
|
9
|
+
require('./isDarkColor-fc8c294a.js');
|
|
10
|
+
require('./getBorderRadius-c3c63ee6.js');
|
|
11
11
|
|
|
12
12
|
const zonosPaymentCss = ".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:var(--amino-space-16)}";
|
|
13
13
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0dcccc22.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-10d1d6ff.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
8
|
+
const getBorderRadius = require('./getBorderRadius-c3c63ee6.js');
|
|
9
9
|
const isColorVariable = require('./isColorVariable-41cacd82.js');
|
|
10
10
|
|
|
11
11
|
const zonosShippingRichRadioCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--border-radius, var(--amino-radius-10));border-bottom-left-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--selected-border-color, var(--amino-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0dcccc22.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-10d1d6ff.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const textOptions = {
|
|
@@ -2529,7 +2529,6 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
2529
2529
|
zonosAttribution: 'DISABLED',
|
|
2530
2530
|
},
|
|
2531
2531
|
checkoutSettings: {
|
|
2532
|
-
allowedDomains: [],
|
|
2533
2532
|
analyticsProviders: [],
|
|
2534
2533
|
orderNotifications: {
|
|
2535
2534
|
abandonedCart: {
|
|
@@ -2563,7 +2562,6 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
2563
2562
|
},
|
|
2564
2563
|
currentHelloPage: '',
|
|
2565
2564
|
helloSettings: {
|
|
2566
|
-
allowedDomains: [],
|
|
2567
2565
|
anchorElementSelector: '',
|
|
2568
2566
|
cartUrlPattern: '',
|
|
2569
2567
|
currencyBehavior: 'ENABLED',
|
|
@@ -2585,9 +2583,6 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
2585
2583
|
restrictionBehavior: 'DISABLED',
|
|
2586
2584
|
},
|
|
2587
2585
|
loadedConfig: false,
|
|
2588
|
-
onlineStoreSettings: {
|
|
2589
|
-
allowedDomains: [],
|
|
2590
|
-
},
|
|
2591
2586
|
organizationName: '',
|
|
2592
2587
|
sourceCurrency: 'USD',
|
|
2593
2588
|
storeId: null,
|
|
@@ -2613,9 +2608,6 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
|
|
|
2613
2608
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
|
|
2614
2609
|
null, overrideSettings.checkoutSettings);
|
|
2615
2610
|
zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings.helloSettings);
|
|
2616
|
-
zonosStore.onlineStoreSettings = mergeConfig(zonosStore.onlineStoreSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.onlineStoreSettings) ||
|
|
2617
|
-
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.onlineStoreSettings) ||
|
|
2618
|
-
null, overrideSettings.onlineStoreSettings);
|
|
2619
2611
|
// set flag to true to indicate that config is ready
|
|
2620
2612
|
zonosStore.loadedConfig = true;
|
|
2621
2613
|
zonosStore.organizationName = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
@@ -15,9 +15,12 @@ export const urlCheckOne = async ({ branch, filePath, packageVersion, }) => {
|
|
|
15
15
|
// no need to check for debug.js.zonos.com since it will not be versioned and be used only for live QA
|
|
16
16
|
'debug.js.zonos.com',
|
|
17
17
|
];
|
|
18
|
+
// these files are load file, no need to check version url here
|
|
19
|
+
const excludeFiles = ['zonosBase', 'zonos', 'loadZonos'];
|
|
18
20
|
result.forEach(([fullUrl]) => {
|
|
19
21
|
if (fullUrl.includes('.js.zonos.com') &&
|
|
20
|
-
!excludeDomainPattern.includes(fullUrl)
|
|
22
|
+
!excludeDomainPattern.includes(fullUrl) &&
|
|
23
|
+
!excludeFiles.some(file => filePath.includes(file))) {
|
|
21
24
|
// match: v1.2.3-alpha.0.qa.js.zonos.com | v1.2.3.qa.js.zonos.com | v1.qa.js.zonos.com
|
|
22
25
|
const versioned = /(v(?<major>\d+)(?<patch>\.\d+(\-alpha\.\d+)*)*)\.*(.*?js\.zonos\.com)/g.exec(fullUrl);
|
|
23
26
|
if (!versioned) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
2
|
import { stripeStore, stripeStoreReset, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
|
|
3
3
|
import { translate } from "../../../store/translationStore";
|
|
4
|
+
import { zonosStore } from "../../../store/zonosStore";
|
|
4
5
|
import { getBorderRadius } from "../../../utils/getBorderRadius";
|
|
5
6
|
import { handleFetch } from "../../../utils/handleFetch";
|
|
6
|
-
import { logError } from "../../../utils/logging/logError";
|
|
7
7
|
import { submitGtag } from "../../../utils/submitGtag";
|
|
8
8
|
import { cartStore } from "../../../../types/index";
|
|
9
9
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
@@ -21,27 +21,59 @@ export class ZonosCheckoutFinish {
|
|
|
21
21
|
if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
const orderId = json === null || json === void 0 ? void 0 : json.id;
|
|
27
|
-
const storeHash = (_b = (_a = json === null || json === void 0 ? void 0 : json.metadata) === null || _a === void 0 ? void 0 : _a.find(x => (x === null || x === void 0 ? void 0 : x.key) === 'storeHash')) === null || _b === void 0 ? void 0 : _b.value;
|
|
28
|
-
if (!orderId || !storeHash) {
|
|
29
|
-
return logError('Unable to trigger BigCommerce /success: Missing orderId or storeHash');
|
|
30
|
-
}
|
|
31
|
-
void handleFetch(`${baseUrl}/api/bigcommerce/success?orderId=${orderId}&storeHash=${storeHash}`);
|
|
32
|
-
}
|
|
24
|
+
// onOrderSuccess callback may be provided on Zonos.init
|
|
25
|
+
await ((_b = (_a = zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, json));
|
|
33
26
|
return json;
|
|
34
27
|
};
|
|
28
|
+
this.handleSuccessBehavior = (orderId) => {
|
|
29
|
+
const { successBehavior } = zonosStore.checkoutSettings;
|
|
30
|
+
switch (successBehavior) {
|
|
31
|
+
case 'REDIRECT_TO_SUCCESS_PAGE':
|
|
32
|
+
const redirectUrl = zonosStore.checkoutSettings.successRedirectUrl;
|
|
33
|
+
if (redirectUrl) {
|
|
34
|
+
window.location.href = `${redirectUrl}?zOrderNumber=${orderId}`;
|
|
35
|
+
}
|
|
36
|
+
// If no redirect URL, break and display Zonos success page
|
|
37
|
+
break;
|
|
38
|
+
case 'CLOSE_MODAL':
|
|
39
|
+
this.closeClickHandler();
|
|
40
|
+
break;
|
|
41
|
+
case 'ZONOS_SUCCESS_PAGE':
|
|
42
|
+
default:
|
|
43
|
+
// Do nothing, display Zonos success page
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
// TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
|
|
35
48
|
this.getPullOrder = async (attempts = 0) => {
|
|
36
49
|
const order = await this.pullOrder();
|
|
37
50
|
if (order) {
|
|
38
51
|
this.order = order;
|
|
52
|
+
this.handleSuccessBehavior(order.id);
|
|
53
|
+
this.isLoading = false;
|
|
39
54
|
}
|
|
40
55
|
else if (!order && attempts < 5) {
|
|
41
56
|
// Wait for 1 second before the next attempt
|
|
42
57
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
43
58
|
await this.getPullOrder(attempts + 1);
|
|
44
59
|
}
|
|
60
|
+
else {
|
|
61
|
+
// Set loading to false to display generic success page and log error
|
|
62
|
+
this.isLoading = false;
|
|
63
|
+
const errorObject = {
|
|
64
|
+
endpoint: `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/get-order`,
|
|
65
|
+
errors: ['Order not found after multiple attempts'],
|
|
66
|
+
metadata: {
|
|
67
|
+
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
68
|
+
domain: window.location.hostname,
|
|
69
|
+
storeId: zonosStore.storeId,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
void handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/log-error`, {
|
|
73
|
+
body: errorObject,
|
|
74
|
+
method: 'POST',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
45
77
|
};
|
|
46
78
|
this.checkPaymentStatus = async () => {
|
|
47
79
|
this.isLoading = true;
|
|
@@ -70,6 +102,7 @@ export class ZonosCheckoutFinish {
|
|
|
70
102
|
}
|
|
71
103
|
// Attempt to pull the order details from the graph every second on 5 attempts
|
|
72
104
|
if (this.notificationType === 'success') {
|
|
105
|
+
this.isLoading = true;
|
|
73
106
|
void this.getPullOrder();
|
|
74
107
|
}
|
|
75
108
|
}
|
|
@@ -152,6 +152,7 @@ export class ZonosCheckout {
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
|
+
button.removeAttribute('disabled');
|
|
155
156
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
156
157
|
});
|
|
157
158
|
}
|
|
@@ -215,10 +216,14 @@ export class ZonosCheckout {
|
|
|
215
216
|
}
|
|
216
217
|
else {
|
|
217
218
|
this.attachCheckout();
|
|
218
|
-
//
|
|
219
|
-
|
|
219
|
+
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
220
|
+
const observer = new MutationObserver(() => {
|
|
220
221
|
this.attachCheckout();
|
|
221
|
-
}
|
|
222
|
+
});
|
|
223
|
+
observer.observe(document.body, {
|
|
224
|
+
childList: true,
|
|
225
|
+
subtree: true,
|
|
226
|
+
});
|
|
222
227
|
}
|
|
223
228
|
clearInterval(interval);
|
|
224
229
|
}, 50);
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
display: flex;
|
|
59
59
|
align-items: center;
|
|
60
60
|
justify-content: center;
|
|
61
|
-
z-index:
|
|
61
|
+
z-index: 10002;
|
|
62
62
|
background: white;
|
|
63
63
|
}
|
|
64
64
|
:host .zonos--dialog-layout {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
:host .zonos--dialog {
|
|
77
77
|
position: relative;
|
|
78
|
-
z-index:
|
|
78
|
+
z-index: 10001;
|
|
79
79
|
background: var(--amino-gray-0);
|
|
80
80
|
max-width: 90vw;
|
|
81
81
|
max-height: 90vh;
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
visibility: visible;
|
|
131
131
|
}
|
|
132
132
|
:host(.open) .zonos--backdrop {
|
|
133
|
-
z-index:
|
|
133
|
+
z-index: 10001;
|
|
134
134
|
opacity: 0.65;
|
|
135
135
|
}
|
|
136
136
|
:host(.open) .zonos--dialog-layout {
|
|
137
137
|
opacity: 1;
|
|
138
|
-
z-index:
|
|
138
|
+
z-index: 10002;
|
|
139
139
|
transform: scale(1);
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -20,7 +20,7 @@ const PEEK_MESSAGE_CLOSE_DELAY_MS = 3000;
|
|
|
20
20
|
const RESIZE_DEBOUNCE_DELAY_MS = 500;
|
|
21
21
|
export class ZonosHello {
|
|
22
22
|
constructor() {
|
|
23
|
-
this.getHelloPeekMessage = () => {
|
|
23
|
+
this.getHelloPeekMessage = (organizationName) => {
|
|
24
24
|
const isRestrictionPage = zonosStore.currentHelloPage === 'productDetail' ||
|
|
25
25
|
zonosStore.currentHelloPage === 'productList';
|
|
26
26
|
if (isRestrictionPage && this.allRestrictedItems.length) {
|
|
@@ -37,7 +37,7 @@ export class ZonosHello {
|
|
|
37
37
|
case 'productDetail':
|
|
38
38
|
return translate(`See duty and tax thresholds`);
|
|
39
39
|
default:
|
|
40
|
-
return `${translate('Welcome to')} ${
|
|
40
|
+
return `${translate('Welcome to')} ${organizationName}`;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
this.enableShowPeekMessage = () => {
|
|
@@ -57,7 +57,7 @@ export class ZonosHello {
|
|
|
57
57
|
return newRestrictions;
|
|
58
58
|
};
|
|
59
59
|
this.triggerShowPeekMessage = () => {
|
|
60
|
-
this.peekMessage = this.getHelloPeekMessage();
|
|
60
|
+
this.peekMessage = this.getHelloPeekMessage(zonosStore.organizationName);
|
|
61
61
|
const { peekMessageBehavior, peekMessageDelay } = zonosStore.helloSettings;
|
|
62
62
|
// peek message delay is passed in seconds, but setTimeout expects milliseconds
|
|
63
63
|
const peekMessageDelayToUse = peekMessageDelay * 1000;
|
|
@@ -253,6 +253,9 @@ export class ZonosHello {
|
|
|
253
253
|
const appearanceSettings = mergeConfig(zonosStore.appearance, this.appearanceSettingsOverride);
|
|
254
254
|
const { theme } = appearanceSettings;
|
|
255
255
|
const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
|
|
256
|
+
// The organization name can be changed after init with the updateOrganizationName method.
|
|
257
|
+
// This will cause the element to rerender with the new org name when it changes. (used for preview on dashboard)
|
|
258
|
+
this.peekMessage = this.getHelloPeekMessage(zonosStore.organizationName);
|
|
256
259
|
const showHello = this.isShippableCountry() && !!selectedCountryCode;
|
|
257
260
|
return (h(Host, { class: "zonos--hello zonos--elements", "data-theme": theme }, showHello && (h("div", { class: "zonos--hello-wrapper" }, h("button", { class: classes([
|
|
258
261
|
'zonos--hello-widget',
|
|
@@ -2,51 +2,13 @@ import { h, Host, } from "@stencil/core";
|
|
|
2
2
|
import { stripeStore } from "../store/checkout/stripe";
|
|
3
3
|
import { initLocalizationStore, localizationStoreUpdateSelectedCountryCode, } from "../store/hello/localization";
|
|
4
4
|
import { zonosStore, zonosStoreFontFamily, zonosStoreInitSetting, } from "../store/zonosStore";
|
|
5
|
-
import {
|
|
5
|
+
import { getZonosSettings } from "../utils/api/getZonosSettings";
|
|
6
6
|
import { initCheckout } from "../utils/checkout/initCheckout";
|
|
7
7
|
import { handleFetch } from "../utils/handleFetch";
|
|
8
8
|
import { initHello } from "../utils/hello/initHello";
|
|
9
9
|
import { log } from "../utils/logging/log";
|
|
10
10
|
export class ZonosController {
|
|
11
11
|
constructor() {
|
|
12
|
-
this.disablePlaceOrderButtons = ({ disable }) => {
|
|
13
|
-
const placeOrderButtonSelector = zonosStore.checkoutSettings.placeOrderButtonSelector;
|
|
14
|
-
if (!placeOrderButtonSelector) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const disableEvent = (e) => {
|
|
18
|
-
const target = e.target;
|
|
19
|
-
// prevent default and propagation when the item has disabled attribute
|
|
20
|
-
if (target.getAttribute('disabled')) {
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
e.stopPropagation();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const placeOrderButton = document.querySelectorAll(placeOrderButtonSelector);
|
|
26
|
-
placeOrderButton.forEach(button => {
|
|
27
|
-
if (disable) {
|
|
28
|
-
button.setAttribute('disabled', 'true');
|
|
29
|
-
// prevent the selector to perform default action when it's disabled
|
|
30
|
-
button.addEventListener('click', disableEvent);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
button.removeAttribute('disabled');
|
|
34
|
-
// clean up the event listener
|
|
35
|
-
button.removeEventListener('click', disableEvent);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
// only auto enable if autoEnable is true and the state is enable
|
|
39
|
-
if (disable) {
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
// release it if zonos is not initialized after 5 seconds (this is to prevent the place order button from being disabled forever due to api)
|
|
42
|
-
placeOrderButton.forEach(button => {
|
|
43
|
-
button.removeAttribute('disabled');
|
|
44
|
-
// clean up the event listener if exists
|
|
45
|
-
button.removeEventListener('click', disableEvent);
|
|
46
|
-
});
|
|
47
|
-
}, 5000);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
12
|
this.config = undefined;
|
|
51
13
|
this.zonosApiKey = undefined;
|
|
52
14
|
}
|
|
@@ -62,10 +24,6 @@ export class ZonosController {
|
|
|
62
24
|
stripeStore.stripe = stripe;
|
|
63
25
|
void initCheckout(zonosStore.checkoutSettings);
|
|
64
26
|
log('init checkout element');
|
|
65
|
-
// enable place order button after checkout is loaded
|
|
66
|
-
this.disablePlaceOrderButtons({
|
|
67
|
-
disable: false,
|
|
68
|
-
});
|
|
69
27
|
}
|
|
70
28
|
/**
|
|
71
29
|
* Init zonos notification
|
|
@@ -113,15 +71,11 @@ export class ZonosController {
|
|
|
113
71
|
// running with scope async function to avoid blocking the main thread
|
|
114
72
|
(async () => {
|
|
115
73
|
var _a, _b;
|
|
116
|
-
const { errors, json } = await
|
|
74
|
+
const { errors, json } = await getZonosSettings();
|
|
117
75
|
if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
|
|
118
76
|
log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
119
77
|
return;
|
|
120
78
|
}
|
|
121
|
-
// disable place order button until checkout is loaded
|
|
122
|
-
this.disablePlaceOrderButtons({
|
|
123
|
-
disable: true,
|
|
124
|
-
});
|
|
125
79
|
// init zonos notification
|
|
126
80
|
this.initZonosNotification();
|
|
127
81
|
// load default setting if fail to load user setting
|
|
@@ -192,6 +146,12 @@ export class ZonosController {
|
|
|
192
146
|
async getAppearanceSetting() {
|
|
193
147
|
return zonosStore.appearance;
|
|
194
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Update the organizationName
|
|
151
|
+
*/
|
|
152
|
+
async updateOrganizationName(organizationName) {
|
|
153
|
+
zonosStore.organizationName = organizationName;
|
|
154
|
+
}
|
|
195
155
|
render() {
|
|
196
156
|
return h(Host, { class: "zonos--elements" });
|
|
197
157
|
}
|
|
@@ -214,12 +174,12 @@ export class ZonosController {
|
|
|
214
174
|
"mutable": false,
|
|
215
175
|
"complexType": {
|
|
216
176
|
"original": "LoadZonosParamsConfig",
|
|
217
|
-
"resolved": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined;
|
|
177
|
+
"resolved": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; }",
|
|
218
178
|
"references": {
|
|
219
179
|
"LoadZonosParamsConfig": {
|
|
220
180
|
"location": "import",
|
|
221
|
-
"path": "src/scripts/
|
|
222
|
-
"id": "src/scripts/
|
|
181
|
+
"path": "src/scripts/zonosBase",
|
|
182
|
+
"id": "src/scripts/zonosBase.ts::LoadZonosParamsConfig"
|
|
223
183
|
}
|
|
224
184
|
}
|
|
225
185
|
},
|
|
@@ -347,7 +307,7 @@ export class ZonosController {
|
|
|
347
307
|
"signature": "(config: LoadZonosParamsConfig) => Promise<void>",
|
|
348
308
|
"parameters": [{
|
|
349
309
|
"name": "config",
|
|
350
|
-
"type": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined;
|
|
310
|
+
"type": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; }",
|
|
351
311
|
"docs": "config that need to override the default setting"
|
|
352
312
|
}],
|
|
353
313
|
"references": {
|
|
@@ -357,8 +317,8 @@ export class ZonosController {
|
|
|
357
317
|
},
|
|
358
318
|
"LoadZonosParamsConfig": {
|
|
359
319
|
"location": "import",
|
|
360
|
-
"path": "src/scripts/
|
|
361
|
-
"id": "src/scripts/
|
|
320
|
+
"path": "src/scripts/zonosBase",
|
|
321
|
+
"id": "src/scripts/zonosBase.ts::LoadZonosParamsConfig"
|
|
362
322
|
}
|
|
363
323
|
},
|
|
364
324
|
"return": "Promise<void>"
|
|
@@ -418,6 +378,27 @@ export class ZonosController {
|
|
|
418
378
|
"text": "Get appearance from setting",
|
|
419
379
|
"tags": []
|
|
420
380
|
}
|
|
381
|
+
},
|
|
382
|
+
"updateOrganizationName": {
|
|
383
|
+
"complexType": {
|
|
384
|
+
"signature": "(organizationName: string) => Promise<void>",
|
|
385
|
+
"parameters": [{
|
|
386
|
+
"name": "organizationName",
|
|
387
|
+
"type": "string",
|
|
388
|
+
"docs": ""
|
|
389
|
+
}],
|
|
390
|
+
"references": {
|
|
391
|
+
"Promise": {
|
|
392
|
+
"location": "global",
|
|
393
|
+
"id": "global::Promise"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
"return": "Promise<void>"
|
|
397
|
+
},
|
|
398
|
+
"docs": {
|
|
399
|
+
"text": "Update the organizationName",
|
|
400
|
+
"tags": []
|
|
401
|
+
}
|
|
421
402
|
}
|
|
422
403
|
};
|
|
423
404
|
}
|
|
@@ -10,7 +10,6 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
10
10
|
zonosAttribution: 'DISABLED',
|
|
11
11
|
},
|
|
12
12
|
checkoutSettings: {
|
|
13
|
-
allowedDomains: [],
|
|
14
13
|
analyticsProviders: [],
|
|
15
14
|
orderNotifications: {
|
|
16
15
|
abandonedCart: {
|
|
@@ -44,7 +43,6 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
44
43
|
},
|
|
45
44
|
currentHelloPage: '',
|
|
46
45
|
helloSettings: {
|
|
47
|
-
allowedDomains: [],
|
|
48
46
|
anchorElementSelector: '',
|
|
49
47
|
cartUrlPattern: '',
|
|
50
48
|
currencyBehavior: 'ENABLED',
|
|
@@ -66,9 +64,6 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
66
64
|
restrictionBehavior: 'DISABLED',
|
|
67
65
|
},
|
|
68
66
|
loadedConfig: false,
|
|
69
|
-
onlineStoreSettings: {
|
|
70
|
-
allowedDomains: [],
|
|
71
|
-
},
|
|
72
67
|
organizationName: '',
|
|
73
68
|
sourceCurrency: 'USD',
|
|
74
69
|
storeId: null,
|
|
@@ -94,9 +89,6 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
|
|
|
94
89
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
|
|
95
90
|
null, overrideSettings.checkoutSettings);
|
|
96
91
|
zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings.helloSettings);
|
|
97
|
-
zonosStore.onlineStoreSettings = mergeConfig(zonosStore.onlineStoreSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.onlineStoreSettings) ||
|
|
98
|
-
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.onlineStoreSettings) ||
|
|
99
|
-
null, overrideSettings.onlineStoreSettings);
|
|
100
92
|
// set flag to true to indicate that config is ready
|
|
101
93
|
zonosStore.loadedConfig = true;
|
|
102
94
|
zonosStore.organizationName = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { handleFetch } from "../handleFetch";
|
|
2
2
|
import { logError } from "../logging/logError";
|
|
3
|
-
export const
|
|
3
|
+
export const getZonosSettings = async () => {
|
|
4
4
|
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/zonos-settings`;
|
|
5
5
|
const { errors, json } = await handleFetch(url);
|
|
6
6
|
if (errors.length) {
|
|
7
|
-
logError(`Error
|
|
7
|
+
logError(`Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings`);
|
|
8
8
|
return { errors, json: null };
|
|
9
9
|
}
|
|
10
10
|
return { errors: [], json };
|
|
@@ -107,7 +107,7 @@ export const handleFetch = async (url, _opts) => {
|
|
|
107
107
|
const opts = __rest(_opts || {}, []);
|
|
108
108
|
const body = opts.body ? JSON.stringify(opts.body) : undefined;
|
|
109
109
|
const method = opts.method || 'GET';
|
|
110
|
-
// adding
|
|
110
|
+
// adding random encoded token to the url so that the request will be cached differently for each store
|
|
111
111
|
const modifiedUrl = new URL(url);
|
|
112
112
|
modifiedUrl.searchParams.set('zToken', encodeString(window.location.hostname));
|
|
113
113
|
// headers content type
|