@hanzo/commerce 7.3.5 → 7.3.7
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/components/checkout/payment-step-form/methods/card.tsx +11 -11
- package/dist/components/Icons.d.ts +18 -0
- package/dist/components/Icons.jsx +19 -0
- package/dist/components/Icons.jsx.map +1 -0
- package/dist/components/add-to-cart-widget.d.ts +11 -0
- package/dist/components/add-to-cart-widget.jsx +99 -0
- package/dist/components/add-to-cart-widget.jsx.map +1 -0
- package/dist/components/buy/buy-card.d.ts +30 -0
- package/dist/components/buy/buy-card.jsx +123 -0
- package/dist/components/buy/buy-card.jsx.map +1 -0
- package/dist/components/buy/carousel-buy-card.d.ts +12 -0
- package/dist/components/buy/carousel-buy-card.jsx +99 -0
- package/dist/components/buy/carousel-buy-card.jsx.map +1 -0
- package/dist/components/buy/multi-family/all-variants-carousel.d.ts +4 -0
- package/dist/components/buy/multi-family/all-variants-carousel.jsx +147 -0
- package/dist/components/buy/multi-family/all-variants-carousel.jsx.map +1 -0
- package/dist/components/buy/multi-family/family-carousel/index.d.ts +4 -0
- package/dist/components/buy/multi-family/family-carousel/index.jsx +34 -0
- package/dist/components/buy/multi-family/family-carousel/index.jsx.map +1 -0
- package/dist/components/buy/multi-family/family-carousel/slide.d.ts +11 -0
- package/dist/components/buy/multi-family/family-carousel/slide.jsx +41 -0
- package/dist/components/buy/multi-family/family-carousel/slide.jsx.map +1 -0
- package/dist/components/buy/multi-family/family-carousel/state.d.ts +20 -0
- package/dist/components/buy/multi-family/family-carousel/state.js +59 -0
- package/dist/components/buy/multi-family/family-carousel/state.js.map +1 -0
- package/dist/components/buy/multi-family/index.d.ts +2 -0
- package/dist/components/buy/multi-family/index.js +3 -0
- package/dist/components/buy/multi-family/index.js.map +1 -0
- package/dist/components/buy/single-family-selector.d.ts +15 -0
- package/dist/components/buy/single-family-selector.jsx +31 -0
- package/dist/components/buy/single-family-selector.jsx.map +1 -0
- package/dist/components/buy/title-and-byline.d.ts +8 -0
- package/dist/components/buy/title-and-byline.jsx +9 -0
- package/dist/components/buy/title-and-byline.jsx.map +1 -0
- package/dist/components/cart/cart-panel/cart-line-item.d.ts +11 -0
- package/dist/components/cart/cart-panel/cart-line-item.jsx +39 -0
- package/dist/components/cart/cart-panel/cart-line-item.jsx.map +1 -0
- package/dist/components/cart/cart-panel/index.d.ts +19 -0
- package/dist/components/cart/cart-panel/index.jsx +79 -0
- package/dist/components/cart/cart-panel/index.jsx.map +1 -0
- package/dist/components/cart/cart-panel/promo-code.d.ts +4 -0
- package/dist/components/cart/cart-panel/promo-code.jsx +73 -0
- package/dist/components/cart/cart-panel/promo-code.jsx.map +1 -0
- package/dist/components/cart/cart-panel/total-area.d.ts +7 -0
- package/dist/components/cart/cart-panel/total-area.jsx +37 -0
- package/dist/components/cart/cart-panel/total-area.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/card-icon-row.d.ts +2 -0
- package/dist/components/checkout/payment-step-form/card-icon-row.jsx +22 -0
- package/dist/components/checkout/payment-step-form/card-icon-row.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/card-icons/amex.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/card-icons/amex.jsx +12 -0
- package/dist/components/checkout/payment-step-form/card-icons/amex.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/card-icons/diners-club.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/card-icons/diners-club.jsx +10 -0
- package/dist/components/checkout/payment-step-form/card-icons/diners-club.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/card-icons/discover.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/card-icons/discover.jsx +12 -0
- package/dist/components/checkout/payment-step-form/card-icons/discover.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/card-icons/jcb.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/card-icons/jcb.jsx +23 -0
- package/dist/components/checkout/payment-step-form/card-icons/jcb.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/card-icons/mastercard.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/card-icons/mastercard.jsx +12 -0
- package/dist/components/checkout/payment-step-form/card-icons/mastercard.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/card-icons/visa.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/card-icons/visa.jsx +10 -0
- package/dist/components/checkout/payment-step-form/card-icons/visa.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/cc-button.d.ts +3 -0
- package/dist/components/checkout/payment-step-form/cc-button.jsx +9 -0
- package/dist/components/checkout/payment-step-form/cc-button.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/contact-form.d.ts +5 -0
- package/dist/components/checkout/payment-step-form/contact-form.jsx +21 -0
- package/dist/components/checkout/payment-step-form/contact-form.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/btc.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/btc.jsx +8 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/btc.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/eth.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/eth.jsx +17 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/eth.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/usdt.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/usdt.jsx +10 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/usdt.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/index.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/index.jsx +85 -0
- package/dist/components/checkout/payment-step-form/index.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/methods/bank-transfer.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/methods/bank-transfer.jsx +44 -0
- package/dist/components/checkout/payment-step-form/methods/bank-transfer.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/methods/card.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/methods/card.jsx +182 -0
- package/dist/components/checkout/payment-step-form/methods/card.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/methods/crypto.d.ts +9 -0
- package/dist/components/checkout/payment-step-form/methods/crypto.jsx +167 -0
- package/dist/components/checkout/payment-step-form/methods/crypto.jsx.map +1 -0
- package/dist/components/checkout/payment-step-form/methods/index.d.ts +6 -0
- package/dist/components/checkout/payment-step-form/methods/index.js +21 -0
- package/dist/components/checkout/payment-step-form/methods/index.js.map +1 -0
- package/dist/components/checkout/shipping-step-form.d.ts +3 -0
- package/dist/components/checkout/shipping-step-form.jsx +105 -0
- package/dist/components/checkout/shipping-step-form.jsx.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/item/product-card.d.ts +7 -0
- package/dist/components/item/product-card.jsx +21 -0
- package/dist/components/item/product-card.jsx.map +1 -0
- package/dist/components/item-selector/button.d.ts +4 -0
- package/dist/components/item-selector/button.jsx +65 -0
- package/dist/components/item-selector/button.jsx.map +1 -0
- package/dist/components/item-selector/carousel/index.d.ts +12 -0
- package/dist/components/item-selector/carousel/index.jsx +101 -0
- package/dist/components/item-selector/carousel/index.jsx.map +1 -0
- package/dist/components/item-selector/carousel/slider.d.ts +8 -0
- package/dist/components/item-selector/carousel/slider.jsx +11 -0
- package/dist/components/item-selector/carousel/slider.jsx.map +1 -0
- package/dist/components/item-selector/index.d.ts +2 -0
- package/dist/components/item-selector/index.js +3 -0
- package/dist/components/item-selector/index.js.map +1 -0
- package/dist/components/item-selector/quantity-indicator.d.ts +9 -0
- package/dist/components/item-selector/quantity-indicator.jsx +23 -0
- package/dist/components/item-selector/quantity-indicator.jsx.map +1 -0
- package/dist/components/node-tabs/index.d.ts +14 -0
- package/dist/components/node-tabs/index.jsx +48 -0
- package/dist/components/node-tabs/index.jsx.map +1 -0
- package/dist/components/node-tabs/node-image.d.ts +6 -0
- package/dist/components/node-tabs/node-image.jsx +12 -0
- package/dist/components/node-tabs/node-image.jsx.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/service/context.d.ts +8 -0
- package/dist/service/context.jsx +20 -0
- package/dist/service/context.jsx.map +1 -0
- package/dist/service/debug.d.ts +10 -0
- package/dist/service/debug.js +30 -0
- package/dist/service/debug.js.map +1 -0
- package/dist/service/impls/standalone/actual-line-item.d.ts +40 -0
- package/dist/service/impls/standalone/actual-line-item.js +84 -0
- package/dist/service/impls/standalone/actual-line-item.js.map +1 -0
- package/dist/service/impls/standalone/get-instance.d.ts +2 -0
- package/dist/service/impls/standalone/get-instance.js +39 -0
- package/dist/service/impls/standalone/get-instance.js.map +1 -0
- package/dist/service/impls/standalone/index.d.ts +67 -0
- package/dist/service/impls/standalone/index.js +416 -0
- package/dist/service/impls/standalone/index.js.map +1 -0
- package/dist/service/impls/standalone/order/firebase.d.ts +2 -0
- package/dist/service/impls/standalone/order/firebase.js +13 -0
- package/dist/service/impls/standalone/order/firebase.js.map +1 -0
- package/dist/service/impls/standalone/order/index.d.ts +24 -0
- package/dist/service/impls/standalone/order/index.js +61 -0
- package/dist/service/impls/standalone/order/index.js.map +1 -0
- package/dist/service/impls/standalone/persistence.d.ts +4 -0
- package/dist/service/impls/standalone/persistence.js +22 -0
- package/dist/service/impls/standalone/persistence.js.map +1 -0
- package/dist/service/path-utils.d.ts +7 -0
- package/dist/service/path-utils.js +16 -0
- package/dist/service/path-utils.js.map +1 -0
- package/dist/service/sep.d.ts +6 -0
- package/dist/service/sep.js +6 -0
- package/dist/service/sep.js.map +1 -0
- package/dist/types/category-node.d.ts +36 -0
- package/dist/types/category-node.js +2 -0
- package/dist/types/category-node.js.map +1 -0
- package/dist/types/checkout.d.ts +33 -0
- package/dist/types/checkout.js +2 -0
- package/dist/types/checkout.js.map +1 -0
- package/dist/types/commerce-config.d.ts +11 -0
- package/dist/types/commerce-config.js +2 -0
- package/dist/types/commerce-config.js.map +1 -0
- package/dist/types/commerce-service.d.ts +109 -0
- package/dist/types/commerce-service.js +2 -0
- package/dist/types/commerce-service.js.map +1 -0
- package/dist/types/components/Icons.d.ts +18 -0
- package/dist/types/components/add-to-cart-widget.d.ts +11 -0
- package/dist/types/components/buy/buy-card.d.ts +30 -0
- package/dist/types/components/buy/carousel-buy-card.d.ts +12 -0
- package/dist/types/components/buy/multi-family/all-variants-carousel.d.ts +4 -0
- package/dist/types/components/buy/multi-family/family-carousel/index.d.ts +4 -0
- package/dist/types/components/buy/multi-family/family-carousel/slide.d.ts +11 -0
- package/dist/types/components/buy/multi-family/family-carousel/state.d.ts +20 -0
- package/dist/types/components/buy/multi-family/index.d.ts +2 -0
- package/dist/types/components/buy/single-family-selector.d.ts +15 -0
- package/dist/types/components/buy/title-and-byline.d.ts +8 -0
- package/dist/types/components/cart/cart-panel/cart-line-item.d.ts +11 -0
- package/dist/types/components/cart/cart-panel/index.d.ts +19 -0
- package/dist/types/components/cart/cart-panel/promo-code.d.ts +4 -0
- package/dist/types/components/cart/cart-panel/total-area.d.ts +7 -0
- package/dist/types/components/checkout/payment-step-form/card-icon-row.d.ts +2 -0
- package/dist/types/components/checkout/payment-step-form/card-icons/amex.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/card-icons/diners-club.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/card-icons/discover.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/card-icons/jcb.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/card-icons/mastercard.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/card-icons/visa.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/cc-button.d.ts +3 -0
- package/dist/types/components/checkout/payment-step-form/contact-form.d.ts +5 -0
- package/dist/types/components/checkout/payment-step-form/crypto-icons/btc.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/crypto-icons/eth.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/crypto-icons/usdt.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/index.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/methods/bank-transfer.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/methods/card.d.ts +4 -0
- package/dist/types/components/checkout/payment-step-form/methods/crypto.d.ts +9 -0
- package/dist/types/components/checkout/payment-step-form/methods/index.d.ts +6 -0
- package/dist/types/components/checkout/shipping-step-form.d.ts +3 -0
- package/dist/types/components/index.d.ts +8 -0
- package/dist/types/components/item/product-card.d.ts +7 -0
- package/dist/types/components/item-selector/button.d.ts +4 -0
- package/dist/types/components/item-selector/carousel/index.d.ts +12 -0
- package/dist/types/components/item-selector/carousel/slider.d.ts +8 -0
- package/dist/types/components/item-selector/index.d.ts +2 -0
- package/dist/types/components/item-selector/quantity-indicator.d.ts +9 -0
- package/dist/types/components/node-tabs/index.d.ts +14 -0
- package/dist/types/components/node-tabs/node-image.d.ts +6 -0
- package/dist/types/family.d.ts +16 -0
- package/dist/types/family.js +2 -0
- package/dist/types/family.js.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/item-selector.d.ts +72 -0
- package/dist/types/item-selector.js +2 -0
- package/dist/types/item-selector.js.map +1 -0
- package/dist/types/line-item.d.ts +14 -0
- package/dist/types/line-item.js +2 -0
- package/dist/types/line-item.js.map +1 -0
- package/dist/types/multi-family-selector-props.d.ts +16 -0
- package/dist/types/multi-family-selector-props.js +2 -0
- package/dist/types/multi-family-selector-props.js.map +1 -0
- package/dist/types/product.d.ts +15 -0
- package/dist/types/product.js +2 -0
- package/dist/types/product.js.map +1 -0
- package/dist/types/promo.d.ts +7 -0
- package/dist/types/promo.js +2 -0
- package/dist/types/promo.js.map +1 -0
- package/dist/types/selection-ui-specifier.d.ts +40 -0
- package/dist/types/selection-ui-specifier.js +2 -0
- package/dist/types/selection-ui-specifier.js.map +1 -0
- package/dist/types/service/context.d.ts +8 -0
- package/dist/types/service/debug.d.ts +10 -0
- package/dist/types/service/impls/standalone/actual-line-item.d.ts +40 -0
- package/dist/types/service/impls/standalone/get-instance.d.ts +2 -0
- package/dist/types/service/impls/standalone/index.d.ts +67 -0
- package/dist/types/service/impls/standalone/order/firebase.d.ts +2 -0
- package/dist/types/service/impls/standalone/order/index.d.ts +24 -0
- package/dist/types/service/impls/standalone/persistence.d.ts +4 -0
- package/dist/types/service/path-utils.d.ts +7 -0
- package/dist/types/service/sep.d.ts +6 -0
- package/dist/types/string-mutator.d.ts +9 -0
- package/dist/types/string-mutator.js +2 -0
- package/dist/types/string-mutator.js.map +1 -0
- package/dist/types/token-separators.d.ts +6 -0
- package/dist/types/token-separators.js +2 -0
- package/dist/types/token-separators.js.map +1 -0
- package/dist/types/types/category-node.d.ts +36 -0
- package/dist/types/types/checkout.d.ts +33 -0
- package/dist/types/types/commerce-config.d.ts +11 -0
- package/dist/types/types/commerce-service.d.ts +109 -0
- package/dist/types/types/family.d.ts +16 -0
- package/dist/types/types/index.d.ts +13 -0
- package/dist/types/types/item-selector.d.ts +72 -0
- package/dist/types/types/line-item.d.ts +14 -0
- package/dist/types/types/multi-family-selector-props.d.ts +16 -0
- package/dist/types/types/product.d.ts +15 -0
- package/dist/types/types/promo.d.ts +7 -0
- package/dist/types/types/selection-ui-specifier.d.ts +40 -0
- package/dist/types/types/string-mutator.d.ts +9 -0
- package/dist/types/types/token-separators.d.ts +6 -0
- package/dist/types/util/analytics.d.ts +9 -0
- package/dist/types/util/countries.d.ts +7 -0
- package/dist/types/util/error.d.ts +1 -0
- package/dist/types/util/index.d.ts +15 -0
- package/dist/types/util/item-selector-options-accessor.d.ts +3 -0
- package/dist/types/util/line-item-ref.d.ts +8 -0
- package/dist/types/util/multi-family-selector-options-accessor.d.ts +3 -0
- package/dist/types/util/obs-string-mutator.d.ts +8 -0
- package/dist/types/util/product-media-accessor.d.ts +29 -0
- package/dist/types/util/promo-codes.d.ts +3 -0
- package/dist/types/util/selection-ui-specifiers.d.ts +3 -0
- package/dist/types/util/square-payment.d.ts +7 -0
- package/dist/types/util/use-sync-sku-param-w-current-item.d.ts +2 -0
- package/dist/util/analytics.d.ts +9 -0
- package/dist/util/analytics.js +10 -0
- package/dist/util/analytics.js.map +1 -0
- package/dist/util/countries.d.ts +7 -0
- package/dist/util/countries.js +197 -0
- package/dist/util/countries.js.map +1 -0
- package/dist/util/error.d.ts +1 -0
- package/dist/util/error.js +22 -0
- package/dist/util/error.js.map +1 -0
- package/dist/util/index.d.ts +15 -0
- package/dist/util/index.js +54 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/item-selector-options-accessor.d.ts +3 -0
- package/dist/util/item-selector-options-accessor.js +27 -0
- package/dist/util/item-selector-options-accessor.js.map +1 -0
- package/dist/util/line-item-ref.d.ts +8 -0
- package/dist/util/line-item-ref.js +15 -0
- package/dist/util/line-item-ref.js.map +1 -0
- package/dist/util/multi-family-selector-options-accessor.d.ts +3 -0
- package/dist/util/multi-family-selector-options-accessor.js +11 -0
- package/dist/util/multi-family-selector-options-accessor.js.map +1 -0
- package/dist/util/obs-string-mutator.d.ts +8 -0
- package/dist/util/obs-string-mutator.js +15 -0
- package/dist/util/obs-string-mutator.js.map +1 -0
- package/dist/util/product-media-accessor.d.ts +29 -0
- package/dist/util/product-media-accessor.js +22 -0
- package/dist/util/product-media-accessor.js.map +1 -0
- package/dist/util/promo-codes.d.ts +3 -0
- package/dist/util/promo-codes.js +101 -0
- package/dist/util/promo-codes.js.map +1 -0
- package/dist/util/selection-ui-specifiers.d.ts +3 -0
- package/dist/util/selection-ui-specifiers.js +24 -0
- package/dist/util/selection-ui-specifiers.js.map +1 -0
- package/dist/util/square-payment.d.ts +7 -0
- package/dist/util/square-payment.js +30 -0
- package/dist/util/square-payment.js.map +1 -0
- package/dist/util/use-sync-sku-param-w-current-item.d.ts +2 -0
- package/dist/util/use-sync-sku-param-w-current-item.js +61 -0
- package/dist/util/use-sync-sku-param-w-current-item.js.map +1 -0
- package/package.json +13 -12
- package/tsconfig.json +6 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PaymentMethodComponentProps } from '../../../../types';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
ethereum?: any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
declare const PayWithCrypto: React.FC<PaymentMethodComponentProps>;
|
|
9
|
+
export default PayWithCrypto;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as AddToCartWidget } from './add-to-cart-widget';
|
|
2
|
+
export { default as CarouselBuyCard } from './buy/carousel-buy-card';
|
|
3
|
+
export { default as CartPanel } from './cart/cart-panel';
|
|
4
|
+
export { default as Icons } from './Icons';
|
|
5
|
+
export { default as PaymentStepForm } from './checkout/payment-step-form';
|
|
6
|
+
export { default as ProductCard } from './item/product-card';
|
|
7
|
+
export { default as ShippingStepForm } from './checkout/shipping-step-form';
|
|
8
|
+
export * from './item-selector';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Dimensions } from '@hanzo/ui/types';
|
|
3
|
+
import { type CarouselOptions } from '@hanzo/ui/primitives';
|
|
4
|
+
import type { ItemSelectorProps } from '../../../types';
|
|
5
|
+
interface CarouselItemSelectorPropsExt {
|
|
6
|
+
constrainTo: Dimensions;
|
|
7
|
+
options?: CarouselOptions;
|
|
8
|
+
/** Do not show Family and / or Item title and Price */
|
|
9
|
+
imageOnly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const CarouselItemSelector: React.FC<ItemSelectorProps>;
|
|
12
|
+
export { type CarouselItemSelectorPropsExt, CarouselItemSelector as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CategoryNode, StringMutator, StringArrayMutator } from '../../types';
|
|
3
|
+
declare const NodeTabs: React.FC<{
|
|
4
|
+
levelNodes: CategoryNode[];
|
|
5
|
+
mutator: StringMutator | StringArrayMutator;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
buttonClx?: string;
|
|
9
|
+
itemClx?: string;
|
|
10
|
+
mobile?: boolean;
|
|
11
|
+
tabSize?: string;
|
|
12
|
+
show?: 'image' | 'label' | 'image-and-label';
|
|
13
|
+
}>;
|
|
14
|
+
export default NodeTabs;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ImageDef } from '@hanzo/ui/types';
|
|
2
|
+
import type Product from './product';
|
|
3
|
+
interface Family {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
titleShort?: string;
|
|
7
|
+
parentTitle?: string;
|
|
8
|
+
byline?: string;
|
|
9
|
+
desc?: string;
|
|
10
|
+
img?: ImageDef;
|
|
11
|
+
products: Product[];
|
|
12
|
+
}
|
|
13
|
+
interface ObsFamilyRef {
|
|
14
|
+
get family(): Family | undefined;
|
|
15
|
+
}
|
|
16
|
+
export { type Family, type ObsFamilyRef };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"family.js","sourceRoot":"","sources":["../../types/family.ts"],"names":[],"mappings":"AAsBA,OAAO,EAGN,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { default as CommerceService } from './commerce-service';
|
|
2
|
+
export type { default as CommerceConfig } from './commerce-config';
|
|
3
|
+
export type { default as MultiFamilySelectorProps } from './multi-family-selector-props';
|
|
4
|
+
export type { default as Product } from './product';
|
|
5
|
+
export type { default as Promo } from './promo';
|
|
6
|
+
export type { default as TokenSeparators } from './token-separators';
|
|
7
|
+
export * from './category-node';
|
|
8
|
+
export * from './checkout';
|
|
9
|
+
export * from './family';
|
|
10
|
+
export * from './item-selector';
|
|
11
|
+
export * from './line-item';
|
|
12
|
+
export * from './selection-ui-specifier';
|
|
13
|
+
export * from './string-mutator';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './category-node';
|
|
2
|
+
export * from './checkout';
|
|
3
|
+
export * from './family';
|
|
4
|
+
export * from './item-selector';
|
|
5
|
+
export * from './line-item';
|
|
6
|
+
export * from './selection-ui-specifier';
|
|
7
|
+
export * from './string-mutator';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { LineItem, ObsLineItemRef } from './line-item';
|
|
2
|
+
interface ItemSelector {
|
|
3
|
+
items: LineItem[];
|
|
4
|
+
selectedItemRef: ObsLineItemRef;
|
|
5
|
+
selectSku: (sku: string) => void;
|
|
6
|
+
}
|
|
7
|
+
/** default: 'text' */
|
|
8
|
+
type ItemButton = 'text' | 'image-and-text' | 'image';
|
|
9
|
+
type ItemSelectorOptions = {
|
|
10
|
+
/**
|
|
11
|
+
* default: short
|
|
12
|
+
* 'short': product.shortTitle if defined
|
|
13
|
+
* 'long': always us product.title, even if .shortTitle is defined
|
|
14
|
+
* 'none': do not show title AND BYLINE
|
|
15
|
+
*
|
|
16
|
+
* (NOTE: *not* the same as buttonType = 'none')
|
|
17
|
+
*/
|
|
18
|
+
familyTitle?: 'none' | 'long' | 'short';
|
|
19
|
+
/** only if title shown
|
|
20
|
+
* default: false */
|
|
21
|
+
showFamilyByline?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the item label includes the Family name.
|
|
24
|
+
* eg, 'Minted Bar, 1oz' vs '1oz'
|
|
25
|
+
* default: false.
|
|
26
|
+
*/
|
|
27
|
+
showFamilyInOption?: boolean;
|
|
28
|
+
/** default: true if it exists */
|
|
29
|
+
showByline?: boolean;
|
|
30
|
+
/** default: true */
|
|
31
|
+
showPrice?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Show the current item quantity along with title and price.
|
|
34
|
+
* default: false
|
|
35
|
+
*/
|
|
36
|
+
showQuantity?: boolean;
|
|
37
|
+
buttonType?: ItemButton;
|
|
38
|
+
/** (button selector only) default: false */
|
|
39
|
+
horizButtons?: boolean;
|
|
40
|
+
/** (carousel selector only)
|
|
41
|
+
* affects sort. See below.
|
|
42
|
+
* default: false */
|
|
43
|
+
showSlider?: boolean;
|
|
44
|
+
/** default true */
|
|
45
|
+
showButtonIfOnlyOne?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Sort by cost.
|
|
48
|
+
* If it's a carousel selector and 'showSlider' is true,
|
|
49
|
+
* defaults to 'asc', unless another value is explicitly specified.
|
|
50
|
+
* Otherwise, defaults to 'none'
|
|
51
|
+
* */
|
|
52
|
+
sort?: 'none' | 'asc' | 'desc';
|
|
53
|
+
};
|
|
54
|
+
interface _ItemSelectorCompProps {
|
|
55
|
+
clx?: string;
|
|
56
|
+
itemClx?: string;
|
|
57
|
+
soleItemClx?: string;
|
|
58
|
+
/** type-specific props for ItemSelector's.
|
|
59
|
+
* eg, Carousel options.
|
|
60
|
+
*/
|
|
61
|
+
ext?: any;
|
|
62
|
+
/** List selectors will scroll.
|
|
63
|
+
* Used internally
|
|
64
|
+
* default: false */
|
|
65
|
+
scrollable?: boolean;
|
|
66
|
+
options?: ItemSelectorOptions;
|
|
67
|
+
mobile?: boolean;
|
|
68
|
+
}
|
|
69
|
+
type ItemSelectorCompProps = Omit<_ItemSelectorCompProps, 'scrollable'>;
|
|
70
|
+
interface ItemSelectorProps extends ItemSelector, _ItemSelectorCompProps {
|
|
71
|
+
}
|
|
72
|
+
export { type ItemSelector, type ItemSelectorCompProps, type ItemSelectorOptions, type ItemSelectorProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-selector.js","sourceRoot":"","sources":["../../types/item-selector.ts"],"names":[],"mappings":"AA2FA,OAAO,EAKN,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type Product from './product';
|
|
2
|
+
interface LineItem extends Product {
|
|
3
|
+
/** all observable */
|
|
4
|
+
get quantity(): number;
|
|
5
|
+
get canDecrement(): boolean;
|
|
6
|
+
get isInCart(): boolean;
|
|
7
|
+
increment(): void;
|
|
8
|
+
decrement(): void;
|
|
9
|
+
get title(): string;
|
|
10
|
+
}
|
|
11
|
+
interface ObsLineItemRef {
|
|
12
|
+
get item(): LineItem | undefined;
|
|
13
|
+
}
|
|
14
|
+
export type { LineItem, ObsLineItemRef };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-item.js","sourceRoot":"","sources":["../../types/line-item.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Dimensions } from '@hanzo/ui/types';
|
|
2
|
+
import type { Family } from './family';
|
|
3
|
+
import type { ItemSelectorOptions } from './item-selector';
|
|
4
|
+
import type { MultiFamilySelectorOptions } from './selection-ui-specifier';
|
|
5
|
+
import type { CategoryNode } from './category-node';
|
|
6
|
+
interface MultiFamilySelectorProps {
|
|
7
|
+
families: Family[];
|
|
8
|
+
parent: CategoryNode;
|
|
9
|
+
clx?: string;
|
|
10
|
+
itemClx?: string;
|
|
11
|
+
itemOptions?: ItemSelectorOptions;
|
|
12
|
+
selectorOptions?: MultiFamilySelectorOptions;
|
|
13
|
+
mediaConstraint?: Dimensions;
|
|
14
|
+
mobile?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export { type MultiFamilySelectorProps as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-family-selector-props.js","sourceRoot":"","sources":["../../types/multi-family-selector-props.ts"],"names":[],"mappings":"AAmBA,OAAO,EAA4C,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ImageDef, MediaStackDef } from '@hanzo/ui/types';
|
|
2
|
+
interface Product extends MediaStackDef {
|
|
3
|
+
id: string;
|
|
4
|
+
sku: string;
|
|
5
|
+
fullTitle?: string;
|
|
6
|
+
optionLabel: string;
|
|
7
|
+
optionLabelShort?: string;
|
|
8
|
+
familyId: string;
|
|
9
|
+
familyTitle: string;
|
|
10
|
+
byline?: string;
|
|
11
|
+
desc?: string;
|
|
12
|
+
price: number;
|
|
13
|
+
optionImg?: ImageDef;
|
|
14
|
+
}
|
|
15
|
+
export { type Product as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../types/product.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEN,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promo.js","sourceRoot":"","sources":["../../types/promo.ts"],"names":[],"mappings":"AAOA,OAAO,EAEN,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ItemSelectorOptions } from './item-selector';
|
|
2
|
+
type SingleFamilySelector = 'buttons' | 'carousel';
|
|
3
|
+
type MultiFamilySelector = 'family-carousel' | 'all-variants-carousel';
|
|
4
|
+
type MultiFamilySelectorOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Show title of parent node of families.
|
|
7
|
+
* eg,
|
|
8
|
+
* Lux Credit
|
|
9
|
+
* Black Card
|
|
10
|
+
*
|
|
11
|
+
* vs just Black Card
|
|
12
|
+
*
|
|
13
|
+
* ( parent CategoryNode.label)
|
|
14
|
+
*
|
|
15
|
+
* (goes to one line if only one family)
|
|
16
|
+
* default: true
|
|
17
|
+
* */
|
|
18
|
+
showParentTitle?: boolean;
|
|
19
|
+
/** parent CategoryNode.subNodesLabel
|
|
20
|
+
*
|
|
21
|
+
* default: 'none'
|
|
22
|
+
*/
|
|
23
|
+
parentByline?: 'none' | 'own-line' | 'comma-sep' | 'colon-sep';
|
|
24
|
+
/** show horiz image buttons of
|
|
25
|
+
* all sibling items below item info
|
|
26
|
+
* default: true*/
|
|
27
|
+
showItemSwatches?: boolean;
|
|
28
|
+
};
|
|
29
|
+
interface SelectionUISpecifier {
|
|
30
|
+
multiFamily?: {
|
|
31
|
+
type: MultiFamilySelector;
|
|
32
|
+
selectorOptions?: MultiFamilySelectorOptions;
|
|
33
|
+
itemOptions?: ItemSelectorOptions;
|
|
34
|
+
};
|
|
35
|
+
singleFamily?: {
|
|
36
|
+
type: SingleFamilySelector;
|
|
37
|
+
options?: ItemSelectorOptions;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export { type SelectionUISpecifier, type ItemSelectorOptions, type SingleFamilySelector, type MultiFamilySelector, type MultiFamilySelectorOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-ui-specifier.js","sourceRoot":"","sources":["../../types/selection-ui-specifier.ts"],"names":[],"mappings":"AA6CA,OAAO,EAMN,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import type CommerceService from '../types/commerce-service';
|
|
3
|
+
import type { CommerceConfig } from '../types';
|
|
4
|
+
declare const useCommerce: () => CommerceService;
|
|
5
|
+
declare const CommerceProvider: React.FC<PropsWithChildren & {
|
|
6
|
+
config: CommerceConfig;
|
|
7
|
+
}>;
|
|
8
|
+
export { useCommerce, CommerceProvider };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CategoryNode, CategoryNodeRole, Family, LineItem } from '../types';
|
|
2
|
+
export declare const categoryNodeDump: (node: CategoryNode, level?: number) => void;
|
|
3
|
+
export declare const selectedFamiliesDump: (result: Family[]) => string;
|
|
4
|
+
export declare const peekDump: (result: {
|
|
5
|
+
role: CategoryNodeRole;
|
|
6
|
+
family: Family | undefined;
|
|
7
|
+
families: Family[] | undefined;
|
|
8
|
+
node: CategoryNode | undefined;
|
|
9
|
+
item: LineItem | undefined;
|
|
10
|
+
} | string) => string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ImageDef, MediaTransform, VideoDef } from '@hanzo/ui/types';
|
|
2
|
+
import type { Product, LineItem, CommerceService } from '../../../types';
|
|
3
|
+
interface ActualLineItemSnapshot {
|
|
4
|
+
sku: string;
|
|
5
|
+
familyId: string;
|
|
6
|
+
title: string;
|
|
7
|
+
price: number;
|
|
8
|
+
quantity: number;
|
|
9
|
+
timeAdded: number;
|
|
10
|
+
timeModified: number;
|
|
11
|
+
}
|
|
12
|
+
declare class ActualLineItem implements LineItem {
|
|
13
|
+
qu: number;
|
|
14
|
+
id: string;
|
|
15
|
+
sku: string;
|
|
16
|
+
fullTitle?: string;
|
|
17
|
+
optionLabel: string;
|
|
18
|
+
optionLabelShort?: string;
|
|
19
|
+
familyTitle: string;
|
|
20
|
+
familyId: string;
|
|
21
|
+
byline?: string;
|
|
22
|
+
desc?: string;
|
|
23
|
+
price: number;
|
|
24
|
+
img?: ImageDef;
|
|
25
|
+
video?: VideoDef;
|
|
26
|
+
animation?: string;
|
|
27
|
+
mediaTransform?: MediaTransform;
|
|
28
|
+
optionImg?: ImageDef;
|
|
29
|
+
timeAdded: number;
|
|
30
|
+
timeModified: number;
|
|
31
|
+
constructor(prod: Product, snap?: ActualLineItemSnapshot);
|
|
32
|
+
get title(): string;
|
|
33
|
+
takeSnapshot: (cmmc: CommerceService) => ActualLineItemSnapshot;
|
|
34
|
+
get canDecrement(): boolean;
|
|
35
|
+
get quantity(): number;
|
|
36
|
+
get isInCart(): boolean;
|
|
37
|
+
increment(): void;
|
|
38
|
+
decrement(): void;
|
|
39
|
+
}
|
|
40
|
+
export { type ActualLineItemSnapshot, ActualLineItem as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { CommerceService, Family, LineItem, SelectedPaths, CategoryNode, CategoryNodeRole, Promo } from '../../../types';
|
|
2
|
+
import { type ActualLineItemSnapshot } from './actual-line-item';
|
|
3
|
+
import { getInstance } from './get-instance';
|
|
4
|
+
type StandaloneServiceOptions = {
|
|
5
|
+
dbName: string;
|
|
6
|
+
ordersTable: string;
|
|
7
|
+
localStorageKey: string;
|
|
8
|
+
};
|
|
9
|
+
interface StandaloneServiceSnapshot {
|
|
10
|
+
items: ActualLineItemSnapshot[];
|
|
11
|
+
}
|
|
12
|
+
declare class StandaloneService implements CommerceService {
|
|
13
|
+
private _familyMap;
|
|
14
|
+
private _rootNode;
|
|
15
|
+
private _selectedPaths;
|
|
16
|
+
private _promo;
|
|
17
|
+
private _options;
|
|
18
|
+
private _currentFamily;
|
|
19
|
+
private _currentItem;
|
|
20
|
+
constructor(families: Family[], rootNode: CategoryNode, options: StandaloneServiceOptions, serviceSnapshot?: StandaloneServiceSnapshot);
|
|
21
|
+
getFamilyById(id: string): Family | undefined;
|
|
22
|
+
getNodeAtPath(skuPath: string): CategoryNode | undefined;
|
|
23
|
+
peek(skuPath: string): {
|
|
24
|
+
role: CategoryNodeRole;
|
|
25
|
+
family: Family | undefined;
|
|
26
|
+
families: Family[] | undefined;
|
|
27
|
+
node: CategoryNode | undefined;
|
|
28
|
+
item: LineItem | undefined;
|
|
29
|
+
} | string;
|
|
30
|
+
getSelectedNodesAtLevel: (level: number) => CategoryNode[] | undefined;
|
|
31
|
+
get options(): StandaloneServiceOptions;
|
|
32
|
+
createOrder(email: string, name?: string): Promise<string | undefined>;
|
|
33
|
+
updateOrderShippingInfo(orderId: string, shippingInfo: any): Promise<void>;
|
|
34
|
+
updateOrderPaymentInfo(orderId: string, paymentInfo: any): Promise<void>;
|
|
35
|
+
takeSnapshot: () => StandaloneServiceSnapshot;
|
|
36
|
+
get recentItem(): {
|
|
37
|
+
item: LineItem;
|
|
38
|
+
modified: number;
|
|
39
|
+
} | undefined;
|
|
40
|
+
private get _cartItems();
|
|
41
|
+
get cartItems(): LineItem[];
|
|
42
|
+
get cartEmpty(): boolean;
|
|
43
|
+
get cartTotal(): number;
|
|
44
|
+
_promoValue_unsafe(value: number): number;
|
|
45
|
+
get promoAppliedCartTotal(): number;
|
|
46
|
+
itemPromoPrice(item: LineItem): number | undefined;
|
|
47
|
+
get cartQuantity(): number;
|
|
48
|
+
get appliedPromo(): Promo | null;
|
|
49
|
+
setAppliedPromo(promo: Promo | null): void;
|
|
50
|
+
getItemBySku: (skuToFind: string | undefined) => LineItem | undefined;
|
|
51
|
+
setCurrentItem: (skuToFind: string | undefined) => boolean;
|
|
52
|
+
get item(): LineItem | undefined;
|
|
53
|
+
get currentItem(): LineItem | undefined;
|
|
54
|
+
setCurrentFamily(id: string | undefined): boolean;
|
|
55
|
+
get currentFamily(): Family | undefined;
|
|
56
|
+
get family(): Family | undefined;
|
|
57
|
+
selectPaths(sel: SelectedPaths): Family[];
|
|
58
|
+
selectPath(skuPath: string): Family[];
|
|
59
|
+
get selectedPaths(): SelectedPaths;
|
|
60
|
+
get selectedFamilies(): Family[];
|
|
61
|
+
private _reduceNode;
|
|
62
|
+
private _processAndValidate;
|
|
63
|
+
get selectedItems(): LineItem[];
|
|
64
|
+
get hasSelection(): boolean;
|
|
65
|
+
getFamilySubtotal(familyId: string): number;
|
|
66
|
+
}
|
|
67
|
+
export { type StandaloneServiceOptions, type StandaloneServiceSnapshot, StandaloneService, getInstance };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ActualLineItemSnapshot } from '../actual-line-item';
|
|
2
|
+
declare const createOrder: (email: string, items: ActualLineItemSnapshot[], options: {
|
|
3
|
+
dbName: string;
|
|
4
|
+
ordersTable: string;
|
|
5
|
+
}, name?: string) => Promise<{
|
|
6
|
+
success: boolean;
|
|
7
|
+
error: any;
|
|
8
|
+
id?: string;
|
|
9
|
+
}>;
|
|
10
|
+
declare const updateOrderShippingInfo: (orderId: string, shippingInfo: any, options: {
|
|
11
|
+
dbName: string;
|
|
12
|
+
ordersTable: string;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
error: any;
|
|
16
|
+
}>;
|
|
17
|
+
declare const updateOrderPaymentInfo: (orderId: string, paymentInfo: any, options: {
|
|
18
|
+
dbName: string;
|
|
19
|
+
ordersTable: string;
|
|
20
|
+
}) => Promise<{
|
|
21
|
+
success: boolean;
|
|
22
|
+
error: any;
|
|
23
|
+
}>;
|
|
24
|
+
export { createOrder, updateOrderShippingInfo, updateOrderPaymentInfo };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { StandaloneService, type StandaloneServiceSnapshot } from './index';
|
|
2
|
+
declare const readSnapshot: (key: string) => StandaloneServiceSnapshot | undefined;
|
|
3
|
+
declare const writeSnapshotsOnChange: (cmmc: StandaloneService, key: string) => void;
|
|
4
|
+
export { readSnapshot, writeSnapshotsOnChange };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SelectedPaths } from '../types';
|
|
2
|
+
export declare const getSelectedPaths: (skuPath: string) => {
|
|
3
|
+
paths: SelectedPaths;
|
|
4
|
+
level: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const getParentPath: (skuPath: string) => string;
|
|
7
|
+
export declare const lastToken: (skuPath: string) => string;
|