@liquidcommerce/elements-sdk 2.6.0-beta.13 → 2.6.0-beta.130
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 +102 -2518
- package/dist/index.checkout.esm.js +22267 -0
- package/dist/index.esm.js +30400 -20620
- package/dist/ssr-stub.checkout.esm.js +17 -0
- package/dist/ssr-stub.esm.js +281 -0
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +51 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +16 -2
- package/dist/types/clients/builder.d.ts +3 -0
- package/dist/types/clients/checkout.d.ts +6 -0
- package/dist/types/clients/helpers.d.ts +8 -0
- package/dist/types/clients/main.d.ts +3 -0
- package/dist/types/constants/core.constant.d.ts +13 -18
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/constants/prop65.constant.d.ts +8 -0
- package/dist/types/core/a11y/announcer.service.d.ts +16 -0
- package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
- package/dist/types/core/a11y/focusable.d.ts +5 -0
- package/dist/types/core/a11y/glyph-button.d.ts +8 -0
- package/dist/types/core/a11y/index.d.ts +6 -0
- package/dist/types/core/a11y/required.d.ts +1 -0
- package/dist/types/core/a11y/single-select.d.ts +20 -0
- package/dist/types/core/api/api-client.service.d.ts +23 -18
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +37 -13
- package/dist/types/core/api/http-client.service.d.ts +0 -8
- package/dist/types/core/base-component.service.d.ts +4 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-analytics-action.service.d.ts +35 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +81 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
- package/dist/types/core/client/client-action.service.d.ts +7 -74
- package/dist/types/core/client/client-config.service.d.ts +12 -5
- package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
- package/dist/types/core/google-tag-manager.service.d.ts +13 -3
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +6 -1
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +54 -48
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +18 -7
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +39 -107
- package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
- package/dist/types/core/store/store.constant.d.ts +5 -0
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +51 -2
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +11 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +9 -3
- package/dist/types/interfaces/analytics.interface.d.ts +41 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
- package/dist/types/interfaces/api/checkout.interface.d.ts +275 -0
- package/dist/types/interfaces/api/delivery.interface.d.ts +24 -0
- package/dist/types/interfaces/api/index.d.ts +6 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +15 -6
- package/dist/types/interfaces/api/product.interface.d.ts +10 -4
- package/dist/types/interfaces/client.interface.d.ts +79 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +45 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/cart.interface.d.ts +2 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +3 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +7 -1
- package/dist/types/interfaces/injection.interface.d.ts +56 -0
- package/dist/types/modules/address/address-display.component.d.ts +3 -1
- package/dist/types/modules/address/address-input.component.d.ts +11 -1
- package/dist/types/modules/address/address.command.d.ts +3 -2
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +11 -5
- package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +1 -1
- package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
- package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +128 -12
- package/dist/types/modules/checkout/checkout.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +5 -2
- package/dist/types/modules/checkout/components/checkout-buyer.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +7 -0
- package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-delivery-method.component.d.ts +22 -0
- package/dist/types/modules/checkout/components/checkout-delivery-scheduling.component.d.ts +51 -0
- package/dist/types/modules/checkout/components/checkout-express-checkout.component.d.ts +63 -0
- package/dist/types/modules/checkout/components/checkout-express-completion.component.d.ts +21 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-item.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +8 -1
- package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +1 -5
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-prop65-warning.component.d.ts +8 -0
- package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +7 -3
- package/dist/types/modules/checkout/components/checkout-stripe-handler.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +4 -2
- package/dist/types/modules/checkout/components/index.d.ts +5 -0
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/components/required-fields-legend.d.ts +1 -0
- package/dist/types/modules/checkout/constant.d.ts +15 -0
- package/dist/types/modules/checkout/customer-prefill.d.ts +5 -0
- package/dist/types/modules/checkout/express-wallet.d.ts +12 -0
- package/dist/types/modules/checkout/payment-session-error.d.ts +4 -0
- package/dist/types/modules/checkout/stripe-js.d.ts +2 -0
- package/dist/types/modules/checkout/styles/delivery-method.style.d.ts +1 -0
- package/dist/types/modules/checkout/styles/express-checkout.style.d.ts +1 -0
- package/dist/types/modules/checkout/styles/express-completion.style.d.ts +1 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/components/components.d.ts +26 -2
- package/dist/types/modules/product/components/index.d.ts +1 -0
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +8 -1
- package/dist/types/modules/product/components/product-delivery-estimate.component.d.ts +11 -0
- package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
- package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
- package/dist/types/modules/product/components/product-prop65-warning.d.ts +1 -0
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +12 -2
- package/dist/types/modules/product/components/product-retailers-popup.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-retailers.component.d.ts +1 -0
- package/dist/types/modules/product/product.commands.d.ts +5 -5
- package/dist/types/modules/product/product.component.d.ts +3 -0
- package/dist/types/modules/product/styles/prop65-warning.style.d.ts +1 -0
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-fulfillment-text.d.ts +2 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +2 -1
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -2
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +39 -31
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -36
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +54 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
- package/dist/types/modules/product-list/product-list-filter.registry.d.ts +42 -0
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +7 -0
- package/dist/types/modules/product-list/product-list-order.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +27 -7
- package/dist/types/modules/product-list/product-list.component.d.ts +23 -47
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +17 -28
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +10 -10
- package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +9 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +15 -2
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
- package/dist/types/ssr/stub.checkout.d.ts +8 -0
- package/dist/types/ssr/stub.d.ts +12 -0
- package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
- package/dist/types/static/icon/bag.icon.d.ts +1 -1
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
- package/dist/types/static/icon/close.icon.d.ts +1 -1
- package/dist/types/static/icon/error-info.icon.d.ts +1 -1
- package/dist/types/static/icon/filter.icon.d.ts +1 -1
- package/dist/types/static/icon/icon.a11y.d.ts +1 -0
- package/dist/types/static/icon/icon.types.d.ts +1 -0
- package/dist/types/static/icon/index.d.ts +2 -0
- package/dist/types/static/icon/info.icon.d.ts +1 -1
- package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
- package/dist/types/static/icon/search.icon.d.ts +1 -1
- package/dist/types/static/icon/success.icon.d.ts +1 -1
- package/dist/types/static/icon/trash.icon.d.ts +1 -1
- package/dist/types/static/icon/warning.icon.d.ts +1 -1
- package/dist/types/utils/delivery-scheduling.d.ts +43 -0
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +9 -14
- package/dist/types/utils/image-bg-removal.d.ts +3 -0
- package/dist/types/utils/places-session-token.d.ts +1 -0
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +21 -0
- package/dist/types/utils/timezone.d.ts +6 -0
- package/docs/v1/README.md +214 -0
- package/docs/v1/api/actions/address-actions.md +290 -0
- package/docs/v1/api/actions/analytics-actions.md +326 -0
- package/docs/v1/api/actions/cart-actions.md +364 -0
- package/docs/v1/api/actions/checkout-actions.md +629 -0
- package/docs/v1/api/actions/product-actions.md +204 -0
- package/docs/v1/api/client.md +671 -0
- package/docs/v1/api/configuration.md +587 -0
- package/docs/v1/api/injection-methods.md +331 -0
- package/docs/v1/api/typescript-types.md +610 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +199 -0
- package/docs/v1/examples/checkout-flow.md +90 -0
- package/docs/v1/examples/custom-theming.md +76 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +521 -0
- package/docs/v1/getting-started/installation.md +351 -0
- package/docs/v1/getting-started/quick-start.md +410 -0
- package/docs/v1/guides/accessibility.md +295 -0
- package/docs/v1/guides/address-component.md +441 -0
- package/docs/v1/guides/best-practices.md +365 -0
- package/docs/v1/guides/cart-component.md +800 -0
- package/docs/v1/guides/checkout-component.md +916 -0
- package/docs/v1/guides/events.md +1061 -0
- package/docs/v1/guides/product-component.md +761 -0
- package/docs/v1/guides/product-list-component.md +730 -0
- package/docs/v1/guides/theming.md +243 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +69 -0
- package/docs/v1/integration/proxy-setup.md +106 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +58 -0
- package/docs/v1/reference/analytics.md +176 -0
- package/docs/v1/reference/browser-support.md +47 -0
- package/docs/v1/reference/error-handling.md +83 -0
- package/docs/v1/reference/performance.md +52 -0
- package/docs/v1/reference/telemetry.md +85 -0
- package/docs/v1/reference/troubleshooting.md +135 -0
- package/package.json +75 -45
- package/dist/types/elements-builder-client.d.ts +0 -2
- package/dist/types/elements-client-helper.d.ts +0 -4
- package/dist/types/elements-client.d.ts +0 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -97
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -3
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/interfaces/core.interface.d.ts +0 -111
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/dist/types/utils/helper.d.ts +0 -28
- package/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -592
- package/docs/TROUBLESHOOTING.md +0 -793
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -1,25 +1,64 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ICheckoutAmounts, ICheckoutItem } from '@/interfaces/api/checkout.interface';
|
|
2
|
+
import type { CheckoutDeliveryScheduling } from '@/interfaces/api/delivery.interface';
|
|
3
3
|
export interface IBaseCheckoutEventData {
|
|
4
|
+
token: string;
|
|
4
5
|
cartId: string;
|
|
6
|
+
isGift: boolean;
|
|
7
|
+
billingSameAsShipping: boolean;
|
|
8
|
+
marketingPreferences: {
|
|
9
|
+
canEmail: boolean;
|
|
10
|
+
canSms: boolean;
|
|
11
|
+
};
|
|
12
|
+
hasPromoCode: boolean;
|
|
13
|
+
hasGiftCards: boolean;
|
|
14
|
+
amounts: ICheckoutAmounts;
|
|
15
|
+
itemCount: number;
|
|
16
|
+
deliveryScheduling: Record<string, CheckoutDeliveryScheduling>;
|
|
17
|
+
items: Record<string, ICheckoutItem>;
|
|
5
18
|
}
|
|
6
19
|
export interface ICheckoutLoadedEventData extends IBaseCheckoutEventData {
|
|
7
20
|
}
|
|
21
|
+
export interface ICheckoutDetailsEventData extends IBaseCheckoutEventData {
|
|
22
|
+
}
|
|
23
|
+
export interface ICheckoutCustomerInformationUpdatedEventData {
|
|
24
|
+
cartId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ICheckoutGiftInformationUpdatedEventData {
|
|
27
|
+
cartId: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ICheckoutBillingInformationUpdatedEventData {
|
|
30
|
+
cartId: string;
|
|
31
|
+
}
|
|
8
32
|
export interface ICheckoutTipUpdatedEventData {
|
|
33
|
+
cartId: string;
|
|
9
34
|
deliveryTips: Array<{
|
|
10
|
-
fulfillmentId
|
|
11
|
-
|
|
35
|
+
fulfillmentId: string;
|
|
36
|
+
tip: number;
|
|
12
37
|
}>;
|
|
38
|
+
previousDeliveryTips: Array<{
|
|
39
|
+
fulfillmentId: string;
|
|
40
|
+
tip: number;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export interface ICheckoutDeliveryMethodUpdatedEventData {
|
|
44
|
+
cartId: string;
|
|
45
|
+
fulfillmentType: string;
|
|
46
|
+
previousFulfillmentType: string;
|
|
47
|
+
fulfillmentId: string;
|
|
13
48
|
}
|
|
14
49
|
export interface ICheckoutFailedEventData {
|
|
15
50
|
message: string;
|
|
16
51
|
}
|
|
17
52
|
export interface ICheckoutToggleEventData {
|
|
53
|
+
cartId: string;
|
|
18
54
|
isActive: boolean;
|
|
55
|
+
previousIsActive: boolean;
|
|
19
56
|
}
|
|
20
57
|
export interface ICheckoutMarketingPreferencesToggleEventData {
|
|
58
|
+
cartId: string;
|
|
21
59
|
fieldName: 'canEmail' | 'canSms';
|
|
22
60
|
isActive: boolean;
|
|
61
|
+
previousIsActive: boolean;
|
|
23
62
|
}
|
|
24
63
|
export interface ICheckoutSubmitStartedEventData {
|
|
25
64
|
started: boolean;
|
|
@@ -49,7 +88,7 @@ export interface ICheckoutItemEngravingUpdatedEventData {
|
|
|
49
88
|
}
|
|
50
89
|
export interface ICheckoutPromoCodeEventData {
|
|
51
90
|
cartId: string;
|
|
52
|
-
|
|
91
|
+
discount?: number;
|
|
53
92
|
newTotal?: number;
|
|
54
93
|
}
|
|
55
94
|
export interface ICheckoutPromoCodeFailedEventData {
|
|
@@ -76,49 +115,16 @@ export interface ICheckoutProductAddFailedEventData {
|
|
|
76
115
|
error: string;
|
|
77
116
|
isPresale?: boolean;
|
|
78
117
|
}
|
|
79
|
-
export interface
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
retailerId: string;
|
|
84
|
-
fulfillmentId: string;
|
|
85
|
-
salsifyGrouping: string;
|
|
86
|
-
name: string;
|
|
87
|
-
catPath: string;
|
|
88
|
-
volume: string;
|
|
89
|
-
uom: string;
|
|
90
|
-
proof: string;
|
|
91
|
-
abv: string;
|
|
92
|
-
containerType: string;
|
|
93
|
-
container: string;
|
|
94
|
-
size: string;
|
|
95
|
-
pack: boolean;
|
|
96
|
-
packDesc: string;
|
|
97
|
-
mainImage: string;
|
|
98
|
-
brand: string;
|
|
99
|
-
partNumber: string;
|
|
100
|
-
upc: string;
|
|
101
|
-
sku: string;
|
|
102
|
-
price: number;
|
|
103
|
-
unitPrice: number;
|
|
104
|
-
quantity: number;
|
|
105
|
-
unitTax: number;
|
|
106
|
-
bottleDeposits: number;
|
|
107
|
-
attributes: ICartItemAttributes;
|
|
108
|
-
retailerName: string;
|
|
109
|
-
expectationDetail: string;
|
|
118
|
+
export interface ICheckoutExpressCheckoutAvailabilityEventData {
|
|
119
|
+
cartId: string;
|
|
120
|
+
available: boolean;
|
|
121
|
+
wallets: string[];
|
|
110
122
|
}
|
|
111
|
-
export interface
|
|
123
|
+
export interface ICheckoutExpressCheckoutStartedEventData {
|
|
112
124
|
cartId: string;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
};
|
|
119
|
-
hasPromoCode: boolean;
|
|
120
|
-
hasGiftCards: boolean;
|
|
121
|
-
amounts: ICheckoutTotalAmounts;
|
|
122
|
-
itemCount: number;
|
|
123
|
-
items: Record<string, ICheckoutItemEventData>;
|
|
125
|
+
wallet: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ICheckoutPaymentFormFailedEventData {
|
|
128
|
+
cartId: string;
|
|
129
|
+
reason: 'blocked' | 'timeout' | 'error';
|
|
124
130
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IAddressActionEventData } from '@/core/pubsub/interfaces/address.interface';
|
|
2
|
-
import type { ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartUpdatedEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
|
-
import type { ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
1
|
+
import type { IAddressActionEventData, IAddressFailedEventData } from '@/core/pubsub/interfaces/address.interface';
|
|
2
|
+
import type { ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartShopRetailerEventData, ICartUpdatedEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
|
+
import type { ICheckoutBillingInformationUpdatedEventData, ICheckoutCustomerInformationUpdatedEventData, ICheckoutDeliveryMethodUpdatedEventData, ICheckoutDetailsEventData, ICheckoutExpressCheckoutAvailabilityEventData, ICheckoutExpressCheckoutStartedEventData, ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutGiftInformationUpdatedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutPaymentFormFailedEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
4
4
|
import type { IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
5
5
|
import { ELEMENTS_ACTIONS_EVENT } from '@/enums';
|
|
6
6
|
export interface IElementsClientIsReadyEventData {
|
|
@@ -16,6 +16,10 @@ export interface IEventMetadata {
|
|
|
16
16
|
originalEvent: string;
|
|
17
17
|
actionNamespace?: 'address' | 'product' | 'cart' | 'checkout' | 'other';
|
|
18
18
|
timestamp: number;
|
|
19
|
+
sdkVersion: string;
|
|
20
|
+
env: string;
|
|
21
|
+
tenantName: string;
|
|
22
|
+
tenantCode: string;
|
|
19
23
|
}
|
|
20
24
|
export interface IEnhancedEventData<T> {
|
|
21
25
|
data: T;
|
|
@@ -25,7 +29,7 @@ export interface IElementsActionsEventsMap {
|
|
|
25
29
|
[ELEMENTS_ACTIONS_EVENT.CLIENT_READY]: IElementsClientIsReadyEventData;
|
|
26
30
|
[ELEMENTS_ACTIONS_EVENT.ADDRESS_UPDATED]: IAddressActionEventData;
|
|
27
31
|
[ELEMENTS_ACTIONS_EVENT.ADDRESS_CLEARED]: boolean;
|
|
28
|
-
[ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]:
|
|
32
|
+
[ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]: IAddressFailedEventData;
|
|
29
33
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_LOADED]: IProductLoadedEventData;
|
|
30
34
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_DECREASE]: IProductQuantityChangedEventData;
|
|
31
35
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_INCREASE]: IProductQuantityChangedEventData;
|
|
@@ -33,6 +37,7 @@ export interface IElementsActionsEventsMap {
|
|
|
33
37
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_SIZE_CHANGED]: IProductSizeChangedEventData;
|
|
34
38
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_FULFILLMENT_TYPE_CHANGED]: IProductFulfillmentTypeChangedEventData;
|
|
35
39
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_FULFILLMENT_CHANGED]: IProductFulfillmentChangedEventData;
|
|
40
|
+
[ELEMENTS_ACTIONS_EVENT.CART_SHOP_RETAILER]: ICartShopRetailerEventData;
|
|
36
41
|
[ELEMENTS_ACTIONS_EVENT.CART_CLOSED]: boolean;
|
|
37
42
|
[ELEMENTS_ACTIONS_EVENT.CART_OPENED]: boolean;
|
|
38
43
|
[ELEMENTS_ACTIONS_EVENT.CART_UPDATED]: ICartUpdatedEventData;
|
|
@@ -49,20 +54,23 @@ export interface IElementsActionsEventsMap {
|
|
|
49
54
|
[ELEMENTS_ACTIONS_EVENT.CART_PROMO_CODE_FAILED]: ICartPromoCodeFailedEventData;
|
|
50
55
|
[ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_SUCCESS]: ICartProductAddEventData;
|
|
51
56
|
[ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_FAILED]: ICartProductAddFailedEventData;
|
|
57
|
+
[ELEMENTS_ACTIONS_EVENT.INTERNAL_CART_TO_CHECKOUT]: object;
|
|
52
58
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_OPENED]: boolean;
|
|
53
59
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CLOSED]: boolean;
|
|
54
60
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_LOADED]: ICheckoutLoadedEventData;
|
|
61
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_DELIVERY_SELECTION_UPDATED]: ICheckoutDetailsEventData;
|
|
55
62
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_FAILED]: ICheckoutFailedEventData;
|
|
56
63
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_IS_GIFT_TOGGLED]: ICheckoutToggleEventData;
|
|
57
64
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED]: ICheckoutToggleEventData;
|
|
58
65
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_MARKETING_PREFERENCES_TOGGLED]: ICheckoutMarketingPreferencesToggleEventData;
|
|
59
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]:
|
|
60
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]:
|
|
61
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]:
|
|
66
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]: ICheckoutCustomerInformationUpdatedEventData;
|
|
67
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]: ICheckoutGiftInformationUpdatedEventData;
|
|
68
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]: ICheckoutBillingInformationUpdatedEventData;
|
|
62
69
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_REMOVED]: ICheckoutItemRemovedEventData;
|
|
63
70
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_INCREASE]: ICheckoutItemQuantityChangedEventData;
|
|
64
71
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_DECREASE]: ICheckoutItemQuantityChangedEventData;
|
|
65
72
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_ENGRAVING_UPDATED]: ICheckoutItemEngravingUpdatedEventData;
|
|
73
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_DELIVERY_METHOD_UPDATED]: ICheckoutDeliveryMethodUpdatedEventData;
|
|
66
74
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_TIP_UPDATED]: ICheckoutTipUpdatedEventData;
|
|
67
75
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_SUBMIT_STARTED]: ICheckoutSubmitStartedEventData;
|
|
68
76
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_SUBMIT_COMPLETED]: ICheckoutSubmitCompletedEventData;
|
|
@@ -75,6 +83,9 @@ export interface IElementsActionsEventsMap {
|
|
|
75
83
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_CARD_FAILED]: ICheckoutGiftCardFailedEventData;
|
|
76
84
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PRODUCT_ADD_SUCCESS]: ICheckoutProductAddEventData;
|
|
77
85
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PRODUCT_ADD_FAILED]: ICheckoutProductAddFailedEventData;
|
|
86
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_EXPRESS_CHECKOUT_AVAILABILITY]: ICheckoutExpressCheckoutAvailabilityEventData;
|
|
87
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_EXPRESS_CHECKOUT_STARTED]: ICheckoutExpressCheckoutStartedEventData;
|
|
88
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PAYMENT_FORM_FAILED]: ICheckoutPaymentFormFailedEventData;
|
|
78
89
|
}
|
|
79
90
|
export type SpecificActionEvent = keyof IElementsActionsEventsMap;
|
|
80
91
|
export interface IFormEventData {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IElementsActionsEventsMap, IElementsFormsEventsMap, SpecificActionEvent, SpecificFormEvent } from '@/core/pubsub/interfaces/core.interface';
|
|
2
2
|
export declare class PubSubService {
|
|
3
3
|
private readonly logger;
|
|
4
|
-
private
|
|
4
|
+
private readonly clientConfig;
|
|
5
5
|
constructor();
|
|
6
6
|
private readonly eventPrefix;
|
|
7
7
|
static getInstance(): PubSubService;
|
|
@@ -9,5 +9,4 @@ export declare class PubSubService {
|
|
|
9
9
|
publishForm<K extends SpecificFormEvent>(eventType: K, data: IElementsFormsEventsMap[K]): void;
|
|
10
10
|
private publishSpecific;
|
|
11
11
|
private dispatchNativeEvents;
|
|
12
|
-
private setupClientReadyBuffering;
|
|
13
12
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
2
|
-
import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/
|
|
2
|
+
import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsCheckoutClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/client.interface';
|
|
3
|
+
type ClientConstructor = LiquidCommerceElementsClientConstructor | LiquidCommerceElementsBuilderClientConstructor | LiquidCommerceElementsCheckoutClientConstructor;
|
|
4
|
+
export type SDKContext = 'regular' | 'builder' | 'checkout';
|
|
3
5
|
export declare class SingletonManager {
|
|
4
6
|
private static clientConstructor;
|
|
5
|
-
private static
|
|
6
|
-
private static builderClientInstances;
|
|
7
|
+
private static contexts;
|
|
7
8
|
private static currentContext;
|
|
9
|
+
private static initializationInProgress;
|
|
8
10
|
private static getInstances;
|
|
9
11
|
private constructor();
|
|
10
|
-
static setContext(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
static
|
|
14
|
-
static
|
|
12
|
+
static setContext(context: SDKContext): void;
|
|
13
|
+
static finalizeInitialization(): void;
|
|
14
|
+
static hasContext(context: SDKContext): boolean;
|
|
15
|
+
static destroyContext(context: SDKContext): void;
|
|
16
|
+
static setClientConstructor(lceConstructor: ClientConstructor): void;
|
|
17
|
+
static getClientConstructor(): ClientConstructor | null;
|
|
15
18
|
static getClassInstance<T>(className: string, instanceCreator: () => T): T;
|
|
16
19
|
static getClient<T>(clientConfigs: IClientConfigs): Promise<T>;
|
|
17
20
|
}
|
|
21
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
1
|
+
import type { ICartEvent, ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
3
2
|
export interface ICartItemStore {
|
|
4
3
|
id: string;
|
|
5
4
|
variantId: string;
|
|
@@ -48,7 +47,7 @@ export interface ICartStore {
|
|
|
48
47
|
fulfillments: Record<string, ICartFulfillmentStore>;
|
|
49
48
|
retailers: Record<string, ICartRetailerStore>;
|
|
50
49
|
promoCode: ICartPromoCode | null;
|
|
51
|
-
events:
|
|
50
|
+
events: ICartEvent[];
|
|
52
51
|
loading: boolean;
|
|
53
52
|
error: string | null;
|
|
54
53
|
rerender: boolean;
|
|
@@ -1,142 +1,75 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export interface
|
|
4
|
-
canEmail: boolean;
|
|
5
|
-
canSms: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface ICheckoutPromoCodeStore {
|
|
8
|
-
code: string;
|
|
9
|
-
discountAmount: number;
|
|
10
|
-
}
|
|
11
|
-
export interface ICheckoutGiftCardStore {
|
|
12
|
-
code: string;
|
|
13
|
-
discountAmount: number;
|
|
14
|
-
}
|
|
15
|
-
export interface ICheckoutItemStore {
|
|
16
|
-
liquidId: string;
|
|
17
|
-
variantId: string;
|
|
18
|
-
cartItemId: string;
|
|
19
|
-
retailerId: string;
|
|
20
|
-
fulfillmentId: string;
|
|
21
|
-
salsifyGrouping: string;
|
|
22
|
-
name: string;
|
|
23
|
-
catPath: string;
|
|
24
|
-
volume: string;
|
|
25
|
-
uom: string;
|
|
26
|
-
proof: string;
|
|
27
|
-
abv: string;
|
|
28
|
-
containerType: string;
|
|
29
|
-
container: string;
|
|
30
|
-
size: string;
|
|
31
|
-
pack: boolean;
|
|
32
|
-
packDesc: string;
|
|
33
|
-
mainImage: string;
|
|
34
|
-
brand: string;
|
|
35
|
-
partNumber: string;
|
|
36
|
-
upc: string;
|
|
37
|
-
sku: string;
|
|
38
|
-
price: number;
|
|
39
|
-
unitPrice: number;
|
|
40
|
-
quantity: number;
|
|
41
|
-
unitTax: number;
|
|
42
|
-
bottleDeposits: number;
|
|
43
|
-
attributes: ICartItemAttributes;
|
|
44
|
-
retailerName: string;
|
|
45
|
-
expectationDetail: string;
|
|
1
|
+
import type { ICheckoutAmounts, ICheckoutBilling, ICheckoutCustomer, ICheckoutEvent, ICheckoutFulfillment, ICheckoutFulfillmentMethod, ICheckoutGiftCard, ICheckoutGiftRecipient, ICheckoutItem, ICheckoutMarketingPreferences, ICheckoutPaymentConfirm, ICheckoutPaymentSession, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer, ICheckoutShippingAddress } from '@/interfaces/api/checkout.interface';
|
|
2
|
+
export type DeliveryWindowLapse = 'expired' | 'unavailable';
|
|
3
|
+
export interface ICheckoutItemStore extends ICheckoutItem {
|
|
46
4
|
loading: boolean;
|
|
47
5
|
updating: boolean;
|
|
48
6
|
error: string | null;
|
|
49
7
|
}
|
|
50
|
-
export interface IOnDemandFulfillmentTipInfo {
|
|
51
|
-
fulfillmentId: string;
|
|
52
|
-
retailerId: string;
|
|
53
|
-
retailerName: string;
|
|
54
|
-
subtotal: number;
|
|
55
|
-
tip: number;
|
|
56
|
-
}
|
|
57
|
-
export interface ICheckoutPresaleStore {
|
|
58
|
-
isLocked: boolean;
|
|
59
|
-
expiresAt: string | null;
|
|
60
|
-
}
|
|
61
|
-
export interface ICheckoutCustomerStore {
|
|
62
|
-
id?: string;
|
|
63
|
-
firstName: string;
|
|
64
|
-
lastName: string;
|
|
65
|
-
email: string;
|
|
66
|
-
phone: string;
|
|
67
|
-
birthDate: string;
|
|
68
|
-
company: string;
|
|
69
|
-
}
|
|
70
8
|
export interface ICheckoutCustomerFormStore {
|
|
71
|
-
data:
|
|
9
|
+
data: ICheckoutCustomer;
|
|
72
10
|
isEditing: boolean;
|
|
73
11
|
isValid: boolean;
|
|
74
12
|
isSaving: boolean;
|
|
75
13
|
}
|
|
76
|
-
export interface ICheckoutGiftRecipientStore {
|
|
77
|
-
firstName: string;
|
|
78
|
-
lastName: string;
|
|
79
|
-
email: string;
|
|
80
|
-
phone: string;
|
|
81
|
-
message: string;
|
|
82
|
-
}
|
|
83
14
|
export interface ICheckoutGiftRecipientFormStore {
|
|
84
|
-
data:
|
|
15
|
+
data: ICheckoutGiftRecipient;
|
|
85
16
|
isEditing: boolean;
|
|
86
17
|
isValid: boolean;
|
|
87
18
|
isSaving: boolean;
|
|
88
19
|
}
|
|
89
|
-
export interface
|
|
90
|
-
firstName: string;
|
|
91
|
-
lastName: string;
|
|
92
|
-
email: string;
|
|
93
|
-
phone: string;
|
|
94
|
-
company: string;
|
|
95
|
-
addressOne: string;
|
|
96
|
-
addressTwo: string;
|
|
97
|
-
city: string;
|
|
98
|
-
state: string;
|
|
99
|
-
zipCode: string;
|
|
100
|
-
}
|
|
101
|
-
export interface ICheckoutPaymentCardStore {
|
|
102
|
-
brand: string;
|
|
103
|
-
last4: string;
|
|
104
|
-
expMonth: string;
|
|
105
|
-
expYear: string;
|
|
20
|
+
export interface ICheckoutPaymentMethodStore extends ICheckoutPaymentConfirm {
|
|
106
21
|
}
|
|
107
|
-
export interface
|
|
108
|
-
id: string;
|
|
109
|
-
card: ICheckoutPaymentCardStore;
|
|
22
|
+
export interface ICheckoutPaymentSessionStore extends ICheckoutPaymentSession {
|
|
110
23
|
}
|
|
111
|
-
export
|
|
112
|
-
|
|
113
|
-
|
|
24
|
+
export type CheckoutExpressStatus = 'idle' | 'preparing' | 'birthDate' | 'completing' | 'failed';
|
|
25
|
+
export interface ICheckoutExpressStore {
|
|
26
|
+
status: CheckoutExpressStatus;
|
|
27
|
+
wallet: string | null;
|
|
28
|
+
intentId: string | null;
|
|
29
|
+
approvedTotal: number | null;
|
|
30
|
+
error: string | null;
|
|
114
31
|
}
|
|
115
32
|
export interface ICheckoutPaymentFormStore {
|
|
116
33
|
paymentSession: ICheckoutPaymentSessionStore | null;
|
|
117
34
|
paymentMethod: ICheckoutPaymentMethodStore | null;
|
|
118
|
-
data:
|
|
35
|
+
data: ICheckoutBilling | null;
|
|
119
36
|
billingSameAsShipping: boolean;
|
|
120
37
|
isEditing: boolean;
|
|
121
38
|
isValid: boolean;
|
|
122
39
|
isSaving: boolean;
|
|
123
40
|
}
|
|
41
|
+
export interface ICheckoutDeliveryMethodStore {
|
|
42
|
+
methods: ICheckoutFulfillmentMethod[];
|
|
43
|
+
isExpanded: boolean;
|
|
44
|
+
isLoading: boolean;
|
|
45
|
+
isSwitching: boolean;
|
|
46
|
+
error: string | null;
|
|
47
|
+
}
|
|
124
48
|
export interface ICheckoutStore {
|
|
49
|
+
initialized: boolean;
|
|
125
50
|
token: string;
|
|
126
51
|
cartId: string;
|
|
127
|
-
presale:
|
|
52
|
+
presale: ICheckoutPresale | null;
|
|
128
53
|
isGift: boolean;
|
|
129
|
-
marketingPreferences:
|
|
54
|
+
marketingPreferences: ICheckoutMarketingPreferences;
|
|
55
|
+
appliedSavedMarketingPreferences: Partial<ICheckoutMarketingPreferences>;
|
|
56
|
+
deliveryMethod: ICheckoutDeliveryMethodStore;
|
|
130
57
|
customerForm: ICheckoutCustomerFormStore;
|
|
131
58
|
giftRecipientForm: ICheckoutGiftRecipientFormStore;
|
|
132
59
|
paymentForm: ICheckoutPaymentFormStore;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
60
|
+
injectedPaymentMethod: ICheckoutPaymentMethodStore | null;
|
|
61
|
+
express: ICheckoutExpressStore;
|
|
62
|
+
shippingAddress: ICheckoutShippingAddress;
|
|
63
|
+
promoCode: ICheckoutPromoCode | null;
|
|
64
|
+
giftCards: ICheckoutGiftCard[];
|
|
65
|
+
itemsQuantity: number;
|
|
136
66
|
items: Record<string, ICheckoutItemStore>;
|
|
137
|
-
|
|
67
|
+
fulfillments: Record<string, ICheckoutFulfillment>;
|
|
68
|
+
deliveryWindowLapses: Record<string, DeliveryWindowLapse>;
|
|
69
|
+
deliveryScheduleNotice: string | null;
|
|
70
|
+
retailers: Record<string, ICheckoutRetailer>;
|
|
71
|
+
amounts: ICheckoutAmounts;
|
|
138
72
|
orderNumber: string | null;
|
|
139
|
-
onDemandFulfillmentTipInfo: Record<string, IOnDemandFulfillmentTipInfo>;
|
|
140
73
|
tipSelection: number;
|
|
141
74
|
deliveryInstructions: string;
|
|
142
75
|
giftCardError: string | null;
|
|
@@ -145,6 +78,5 @@ export interface ICheckoutStore {
|
|
|
145
78
|
loading: boolean;
|
|
146
79
|
updating: boolean;
|
|
147
80
|
error: string | null;
|
|
148
|
-
|
|
149
|
-
events: IElementsCheckoutEvents[];
|
|
81
|
+
events: ICheckoutEvent[];
|
|
150
82
|
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
2
|
import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
3
|
-
import type { ICheckoutCustomerFormStore,
|
|
3
|
+
import type { ICheckoutCustomerFormStore, ICheckoutDeliveryMethodStore, ICheckoutExpressStore, ICheckoutGiftRecipientFormStore, ICheckoutItemStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
|
+
import type { ICheckoutInjection, ICheckoutMetadata, IElementsMetadataStore } from '@/core/store/interfaces/metadata.interface';
|
|
4
5
|
import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
|
+
import type { IPLProductStore, IProductListStore } from '@/core/store/interfaces/product-list.interface';
|
|
5
7
|
import type { ComponentType } from '@/enums';
|
|
6
8
|
import type { ICartPromoCode } from '@/interfaces/api/cart.interface';
|
|
9
|
+
import type { ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer } from '@/interfaces/api/checkout.interface';
|
|
7
10
|
export interface IDrawerContentConfig {
|
|
8
11
|
type: ComponentType;
|
|
9
12
|
data?: Record<string, any>;
|
|
10
13
|
}
|
|
14
|
+
export type UIDrawerMode = 'drawer' | 'modal';
|
|
11
15
|
export interface IDrawerStore {
|
|
12
16
|
isOpen: boolean;
|
|
13
17
|
contentConfig: IDrawerContentConfig | null;
|
|
18
|
+
mode: UIDrawerMode;
|
|
14
19
|
}
|
|
15
20
|
export interface IUIStore {
|
|
16
21
|
drawer: IDrawerStore;
|
|
@@ -20,13 +25,18 @@ export interface IGlobalStore {
|
|
|
20
25
|
products: Record<string, IProductStore>;
|
|
21
26
|
cart: ICartStore;
|
|
22
27
|
checkout: ICheckoutStore;
|
|
28
|
+
productsList: Record<string, IProductListStore>;
|
|
23
29
|
ui: IUIStore;
|
|
30
|
+
metadata: IElementsMetadataStore;
|
|
24
31
|
}
|
|
25
32
|
export interface IPersistedStore {
|
|
26
33
|
p?: string;
|
|
27
34
|
c?: string;
|
|
28
35
|
}
|
|
29
|
-
export
|
|
36
|
+
export interface IPersistedStoreAction {
|
|
37
|
+
success: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof ICartRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof ICartFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCode}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.deliveryMethod.${keyof ICheckoutDeliveryMethodStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.paymentSession.${keyof ICheckoutPaymentSessionStore}` | `checkout.paymentForm.paymentMethod.${keyof ICheckoutPaymentMethodStore}` | `checkout.express.${keyof ICheckoutExpressStore}` | `checkout.presale.${keyof ICheckoutPresale}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferences}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipient}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCode}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.retailers.${string}` | `checkout.retailers.${string}.${keyof ICheckoutRetailer}` | `checkout.fulfillments.${string}` | `productsList.${string}` | `productsList.${string}.${keyof IProductListStore}` | `productsList.${string}.products.${string}` | `productsList.${string}.products.${string}.${keyof IPLProductStore}` | `metadata.${keyof IElementsMetadataStore}` | `metadata.checkout.${keyof ICheckoutMetadata}` | `metadata.checkout.injection.${keyof ICheckoutInjection}`;
|
|
30
40
|
interface MiddlewareContext {
|
|
31
41
|
action: string;
|
|
32
42
|
payload: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ICheckoutInjection {
|
|
2
|
+
containerId: string;
|
|
3
|
+
injectedAt: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ICheckoutMetadata {
|
|
6
|
+
injection: ICheckoutInjection | null;
|
|
7
|
+
returnUrl: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface IElementsMetadataStore {
|
|
10
|
+
checkout: ICheckoutMetadata;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FulfillmentType } from '@/enums';
|
|
2
|
+
import type { IProduct } from '@/interfaces/api/product.interface';
|
|
3
|
+
import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
|
|
4
|
+
import type { IPagination } from '@/modules/product-list/product-list.interface';
|
|
5
|
+
import type { IProductFulfillmentStore, IProductSizeStore } from './product.interface';
|
|
6
|
+
export interface IPLProductStore extends Omit<IProduct, 'sizes'> {
|
|
7
|
+
id: string;
|
|
8
|
+
sizes: Record<string, IProductSizeStore>;
|
|
9
|
+
quantity: number;
|
|
10
|
+
selectedSizeId: string | null;
|
|
11
|
+
selectedFulfillmentType: FulfillmentType;
|
|
12
|
+
selectedFulfillmentId: string | null;
|
|
13
|
+
selectedFulfillment: IProductFulfillmentStore | null;
|
|
14
|
+
engravingLines: string[];
|
|
15
|
+
productHasAvailability: boolean;
|
|
16
|
+
fulfillmentHasAvailability: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
updating: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface IProductListStore {
|
|
21
|
+
products: Record<string, IPLProductStore>;
|
|
22
|
+
appliedFilters: Record<string, string[]>;
|
|
23
|
+
filters: IFilterSchema[];
|
|
24
|
+
pagination: IPagination;
|
|
25
|
+
searchTerm: string;
|
|
26
|
+
rows: number;
|
|
27
|
+
columns: number;
|
|
28
|
+
loading: boolean;
|
|
29
|
+
rerender: boolean;
|
|
30
|
+
}
|
|
@@ -13,6 +13,7 @@ export type IProductFulfillmentStore = IFulfillment & {
|
|
|
13
13
|
retailerAddress: IRetailerAddress;
|
|
14
14
|
retailerAddressFormatted: string;
|
|
15
15
|
variant: IProductVariant;
|
|
16
|
+
image?: string;
|
|
16
17
|
};
|
|
17
18
|
export interface IProductSizeStore extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
18
19
|
onDemandFulfillments: Record<string, IProductFulfillmentStore>;
|
|
@@ -2,11 +2,16 @@ import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
|
2
2
|
import type { ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
3
3
|
import type { ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
4
|
import type { IGlobalStore, IUIStore } from '@/core/store/interfaces/core.interface';
|
|
5
|
+
import type { IElementsMetadataStore } from '@/core/store/interfaces/metadata.interface';
|
|
5
6
|
import type { IProductStore } from '@/core/store/interfaces/product.interface';
|
|
7
|
+
import type { IProductListStore } from './interfaces/product-list.interface';
|
|
6
8
|
export declare const LOCAL_STORAGE_PREFIX = "lce";
|
|
7
9
|
export declare const initialAddressState: IAddressStore;
|
|
8
10
|
export declare const initialProductState: IProductStore;
|
|
9
11
|
export declare const initialCartState: ICartStore;
|
|
10
12
|
export declare const initialCheckoutState: ICheckoutStore;
|
|
11
13
|
export declare const initialUIState: IUIStore;
|
|
14
|
+
export declare const initialMetadataState: IElementsMetadataStore;
|
|
15
|
+
export declare const initialProductsListState: Record<string, IProductListStore>;
|
|
16
|
+
export declare function createInitialProductListState(): IProductListStore;
|
|
12
17
|
export declare const initialStoreState: IGlobalStore;
|
|
@@ -28,6 +28,7 @@ export declare class StoreService {
|
|
|
28
28
|
createProductInstance(productId: string): boolean;
|
|
29
29
|
removeProductInstance(productId: string): boolean;
|
|
30
30
|
getProductInstances(): Record<string, IProductStore>;
|
|
31
|
+
destroy(): void;
|
|
31
32
|
getState(): IGlobalStore;
|
|
32
33
|
private setupMiddleware;
|
|
33
34
|
private loggingMiddleware;
|
|
@@ -10,6 +10,7 @@ export declare class TelemetryService {
|
|
|
10
10
|
constructor();
|
|
11
11
|
static getInstance(): TelemetryService;
|
|
12
12
|
isEnabled(): boolean;
|
|
13
|
+
destroy(): void;
|
|
13
14
|
captureEvent(level: TelemetryLevel, message: string, options?: ITelemetryEventOptions): void;
|
|
14
15
|
private buildErrorContext;
|
|
15
16
|
private buildSDKContext;
|