@libreapps/commerce 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +13 -0
- package/LICENSE.md +21 -0
- package/components/Icons.tsx +35 -0
- package/components/add-to-cart-widget.tsx +183 -0
- package/components/buy/buy-card.tsx +259 -0
- package/components/buy/carousel-buy-card.tsx +242 -0
- package/components/buy/multi-family/all-variants-carousel.tsx +261 -0
- package/components/buy/multi-family/family-carousel/index.tsx +77 -0
- package/components/buy/multi-family/family-carousel/slide.tsx +83 -0
- package/components/buy/multi-family/family-carousel/state.ts +87 -0
- package/components/buy/multi-family/index.ts +2 -0
- package/components/buy/single-family-selector.tsx +90 -0
- package/components/buy/title-and-byline.tsx +25 -0
- package/components/cart/cart-panel/cart-line-item.tsx +76 -0
- package/components/cart/cart-panel/index.tsx +154 -0
- package/components/cart/cart-panel/promo-code.tsx +109 -0
- package/components/cart/cart-panel/total-area.tsx +60 -0
- package/components/checkout/payment-step-form/card-icon-row.tsx +26 -0
- package/components/checkout/payment-step-form/card-icons/amex.tsx +32 -0
- package/components/checkout/payment-step-form/card-icons/diners-club.tsx +13 -0
- package/components/checkout/payment-step-form/card-icons/discover.tsx +25 -0
- package/components/checkout/payment-step-form/card-icons/jcb.tsx +26 -0
- package/components/checkout/payment-step-form/card-icons/mastercard.tsx +27 -0
- package/components/checkout/payment-step-form/card-icons/visa.tsx +25 -0
- package/components/checkout/payment-step-form/cc-button.tsx +17 -0
- package/components/checkout/payment-step-form/contact-form.tsx +50 -0
- package/components/checkout/payment-step-form/crypto-icons/btc.tsx +11 -0
- package/components/checkout/payment-step-form/crypto-icons/eth.tsx +20 -0
- package/components/checkout/payment-step-form/crypto-icons/usdt.tsx +13 -0
- package/components/checkout/payment-step-form/index.tsx +122 -0
- package/components/checkout/payment-step-form/methods/bank-transfer.tsx +79 -0
- package/components/checkout/payment-step-form/methods/card.tsx +232 -0
- package/components/checkout/payment-step-form/methods/crypto.tsx +227 -0
- package/components/checkout/payment-step-form/methods/index.ts +23 -0
- package/components/checkout/shipping-step-form.tsx +175 -0
- package/components/index.ts +11 -0
- package/components/item/product-card.tsx +48 -0
- package/components/item-selector/button.tsx +188 -0
- package/components/item-selector/carousel/index.tsx +197 -0
- package/components/item-selector/carousel/slider.tsx +40 -0
- package/components/item-selector/index.ts +5 -0
- package/components/item-selector/quantity-indicator.tsx +48 -0
- package/components/node-tabs/index.tsx +91 -0
- package/components/node-tabs/node-image.tsx +31 -0
- package/dist/components/Icons.d.ts +18 -0
- package/dist/components/Icons.js +19 -0
- package/dist/components/Icons.js.map +1 -0
- package/dist/components/add-to-cart-widget.d.ts +11 -0
- package/dist/components/add-to-cart-widget.js +85 -0
- package/dist/components/add-to-cart-widget.js.map +1 -0
- package/dist/components/buy/buy-card.d.ts +30 -0
- package/dist/components/buy/buy-card.js +109 -0
- package/dist/components/buy/buy-card.js.map +1 -0
- package/dist/components/buy/carousel-buy-card.d.ts +12 -0
- package/dist/components/buy/carousel-buy-card.js +94 -0
- package/dist/components/buy/carousel-buy-card.js.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.js +115 -0
- package/dist/components/buy/multi-family/all-variants-carousel.js.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.js +27 -0
- package/dist/components/buy/multi-family/family-carousel/index.js.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.js +35 -0
- package/dist/components/buy/multi-family/family-carousel/slide.js.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.js +28 -0
- package/dist/components/buy/single-family-selector.js.map +1 -0
- package/dist/components/buy/title-and-byline.d.ts +8 -0
- package/dist/components/buy/title-and-byline.js +7 -0
- package/dist/components/buy/title-and-byline.js.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.js +25 -0
- package/dist/components/cart/cart-panel/cart-line-item.js.map +1 -0
- package/dist/components/cart/cart-panel/index.d.ts +19 -0
- package/dist/components/cart/cart-panel/index.js +65 -0
- package/dist/components/cart/cart-panel/index.js.map +1 -0
- package/dist/components/cart/cart-panel/promo-code.d.ts +4 -0
- package/dist/components/cart/cart-panel/promo-code.js +62 -0
- package/dist/components/cart/cart-panel/promo-code.js.map +1 -0
- package/dist/components/cart/cart-panel/total-area.d.ts +7 -0
- package/dist/components/cart/cart-panel/total-area.js +14 -0
- package/dist/components/cart/cart-panel/total-area.js.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.js +14 -0
- package/dist/components/checkout/payment-step-form/card-icon-row.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/card-icons/amex.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/card-icons/diners-club.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/card-icons/discover.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/card-icons/jcb.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/card-icons/mastercard.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/card-icons/visa.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/cc-button.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/contact-form.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/btc.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/eth.js.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.js +6 -0
- package/dist/components/checkout/payment-step-form/crypto-icons/usdt.js.map +1 -0
- package/dist/components/checkout/payment-step-form/index.d.ts +4 -0
- package/dist/components/checkout/payment-step-form/index.js +77 -0
- package/dist/components/checkout/payment-step-form/index.js.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.js +24 -0
- package/dist/components/checkout/payment-step-form/methods/bank-transfer.js.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.js +160 -0
- package/dist/components/checkout/payment-step-form/methods/card.js.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.js +137 -0
- package/dist/components/checkout/payment-step-form/methods/crypto.js.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.js +53 -0
- package/dist/components/checkout/shipping-step-form.js.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.js +9 -0
- package/dist/components/item/product-card.js.map +1 -0
- package/dist/components/item-selector/button.d.ts +4 -0
- package/dist/components/item-selector/button.js +47 -0
- package/dist/components/item-selector/button.js.map +1 -0
- package/dist/components/item-selector/carousel/index.d.ts +12 -0
- package/dist/components/item-selector/carousel/index.js +74 -0
- package/dist/components/item-selector/carousel/index.js.map +1 -0
- package/dist/components/item-selector/carousel/slider.d.ts +8 -0
- package/dist/components/item-selector/carousel/slider.js +12 -0
- package/dist/components/item-selector/carousel/slider.js.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.js +16 -0
- package/dist/components/item-selector/quantity-indicator.js.map +1 -0
- package/dist/components/node-tabs/index.d.ts +14 -0
- package/dist/components/node-tabs/index.js +42 -0
- package/dist/components/node-tabs/index.js.map +1 -0
- package/dist/components/node-tabs/node-image.d.ts +6 -0
- package/dist/components/node-tabs/node-image.js +13 -0
- package/dist/components/node-tabs/node-image.js.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.js +19 -0
- package/dist/service/context.js.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/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/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/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 +100 -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 +37 -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/index.ts +13 -0
- package/libreapps-ui.d.ts +108 -0
- package/package.json +67 -0
- package/service/context.tsx +45 -0
- package/service/debug.ts +41 -0
- package/service/impls/standalone/actual-line-item.ts +136 -0
- package/service/impls/standalone/get-instance.ts +64 -0
- package/service/impls/standalone/index.ts +579 -0
- package/service/impls/standalone/order/firebase.ts +14 -0
- package/service/impls/standalone/order/index.ts +129 -0
- package/service/impls/standalone/persistence.ts +33 -0
- package/service/path-utils.ts +26 -0
- package/service/sep.ts +7 -0
- package/tsconfig.json +17 -0
- package/types/README.md +2 -0
- package/types/category-node.ts +50 -0
- package/types/checkout.ts +47 -0
- package/types/commerce-config.ts +13 -0
- package/types/commerce-service.ts +128 -0
- package/types/family.ts +26 -0
- package/types/index.ts +15 -0
- package/types/item-selector.ts +97 -0
- package/types/line-item.ts +29 -0
- package/types/multi-family-selector-props.ts +20 -0
- package/types/product.ts +21 -0
- package/types/promo.ts +10 -0
- package/types/selection-ui-specifier.ts +52 -0
- package/types/string-mutator.ts +14 -0
- package/types/token-separators.ts +7 -0
- package/util/analytics.ts +21 -0
- package/util/countries.ts +196 -0
- package/util/error.ts +34 -0
- package/util/index.ts +71 -0
- package/util/item-selector-options-accessor.ts +35 -0
- package/util/line-item-ref.ts +23 -0
- package/util/multi-family-selector-options-accessor.ts +15 -0
- package/util/obs-string-mutator.ts +22 -0
- package/util/product-media-accessor.ts +58 -0
- package/util/promo-codes.ts +106 -0
- package/util/selection-ui-specifiers.ts +30 -0
- package/util/square-payment.ts +50 -0
- package/util/use-sync-sku-param-w-current-item.ts +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence.js","sourceRoot":"","sources":["../../../../service/impls/standalone/persistence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAkC,MAAM,SAAS,CAAA;AAE3E,MAAM,MAAM,GAAG,UAAU,CAAA;AAEzB,MAAM,YAAY,GAAG,CAAC,GAAW,EAA0C,EAAE;IAC3E,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC/C,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAA8B,CAAC,CAAC,CAAC,SAAS,CAAA;AAC3F,CAAC,CAAA;AAED,MAAM,sBAAsB,GAAG,CAAC,IAAuB,EAAE,GAAW,EAAQ,EAAE;IAE5E,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,QAAQ,CACN,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EACtB,CAAC,KAAK,EAAE,EAAE;YACR,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBACd,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;gBACpC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAE,CAAA;YACtD,CAAC;iBACI,CAAC;gBACJ,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC,CACF,CAAA;IACH,CAAC;AACH,CAAC,CAAA;AAED,OAAO,EACL,YAAY,EACZ,sBAAsB,EACvB,CAAA"}
|
|
@@ -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;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import sep from './sep';
|
|
2
|
+
export const getSelectedPaths = (skuPath) => {
|
|
3
|
+
const toks = skuPath.split(sep.tok);
|
|
4
|
+
const level = toks.length - 1;
|
|
5
|
+
const paths = {};
|
|
6
|
+
for (let l = 1; l <= level; l++) {
|
|
7
|
+
paths[l] = [toks[l]];
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
paths,
|
|
11
|
+
level
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export const getParentPath = (skuPath) => (skuPath.split(sep.tok).slice(0, -1).join(sep.tok));
|
|
15
|
+
export const lastToken = (skuPath) => (skuPath.split(sep.tok).pop());
|
|
16
|
+
//# sourceMappingURL=path-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../service/path-utils.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,OAAO,CAAA;AAEvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,OAAe,EAC0B,EAAE;IAE3C,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;IAC7B,MAAM,KAAK,GAAkB,EAAE,CAAA;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,EAAE,EAAG,CAAC;QACjC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IACD,OAAO;QACL,KAAK;QACL,KAAK;KACN,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,CACxD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAClD,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,CACpD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAC9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sep.js","sourceRoot":"","sources":["../../service/sep.ts"],"names":[],"mappings":"AAEA,eAAe;IACb,GAAG,EAAE,GAAG;IACR,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;CACa,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface CategoryNode {
|
|
3
|
+
skuToken: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/**
|
|
6
|
+
* Explicitly marks this node as a "last user-visible" / "outermost" Category.
|
|
7
|
+
* Normally, a node is "outermost" when it has no subnodes
|
|
8
|
+
* (and thus is a family with products -- "single-family")
|
|
9
|
+
* But if it *has* subnodes, and its subNodes are actually sibling families
|
|
10
|
+
* of a Category, it must be marked as "outermost" ("multi-family")
|
|
11
|
+
* */
|
|
12
|
+
outermost?: boolean;
|
|
13
|
+
img?: string | ReactNode;
|
|
14
|
+
imgAR?: number;
|
|
15
|
+
/**
|
|
16
|
+
* One word prompt that describes the 'meaning' of
|
|
17
|
+
* the subnodes.
|
|
18
|
+
* For example, if a node is 'Lux Credit',
|
|
19
|
+
* it's subNodesLabel might be 'Level', so some UI's
|
|
20
|
+
* might be configured to render 'Level: Black'
|
|
21
|
+
*
|
|
22
|
+
* or something like...
|
|
23
|
+
*
|
|
24
|
+
* <Tabs title={parentNode.label + ': ' + parentNode.subNodesLabel} values={families.map((f) => (f.shortName))} />
|
|
25
|
+
*
|
|
26
|
+
* ...which renders
|
|
27
|
+
*
|
|
28
|
+
* Lux Credit Levels:
|
|
29
|
+
* Black Elite Founder Sovereign
|
|
30
|
+
*/
|
|
31
|
+
subNodesLabel?: string;
|
|
32
|
+
subNodes?: CategoryNode[];
|
|
33
|
+
}
|
|
34
|
+
type CategoryNodeRole = 'single-family' | 'family-in-multi-family' | 'multi-family' | 'non-outermost';
|
|
35
|
+
type SelectedPaths = Record<number, string[]>;
|
|
36
|
+
export type { CategoryNodeRole, CategoryNode, SelectedPaths };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category-node.js","sourceRoot":"","sources":["../../types/category-node.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { UseFormReturn } from 'react-hook-form';
|
|
3
|
+
type TransactionStatus = 'unpaid' | 'paid' | 'confirmed' | 'error';
|
|
4
|
+
interface CheckoutStepComponentProps {
|
|
5
|
+
onDone: () => void;
|
|
6
|
+
orderId: string | undefined;
|
|
7
|
+
setOrderId: (orderId: string | undefined) => void;
|
|
8
|
+
}
|
|
9
|
+
interface CheckoutStep {
|
|
10
|
+
name: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
Comp: ComponentType<CheckoutStepComponentProps>;
|
|
13
|
+
}
|
|
14
|
+
type ContactFormType = UseFormReturn<{
|
|
15
|
+
name: string;
|
|
16
|
+
email: string;
|
|
17
|
+
}, any, {
|
|
18
|
+
name: string;
|
|
19
|
+
email: string;
|
|
20
|
+
}>;
|
|
21
|
+
interface PaymentMethodComponentProps {
|
|
22
|
+
onDone: () => void;
|
|
23
|
+
transactionStatus: TransactionStatus;
|
|
24
|
+
setTransactionStatus: (status: TransactionStatus) => void;
|
|
25
|
+
storePaymentInfo: (paymentInfo: any) => Promise<void>;
|
|
26
|
+
contactForm: ContactFormType;
|
|
27
|
+
}
|
|
28
|
+
interface PaymentMethodDesc {
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
Comp: ComponentType<PaymentMethodComponentProps>;
|
|
32
|
+
}
|
|
33
|
+
export { type TransactionStatus, type CheckoutStepComponentProps, type CheckoutStep, type PaymentMethodComponentProps, type PaymentMethodDesc, type ContactFormType, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../types/checkout.ts"],"names":[],"mappings":"AAuCA,OAAO,EAON,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ServiceOptions } from '..';
|
|
2
|
+
import type { CategoryNode } from './category-node';
|
|
3
|
+
import type { Family } from './family';
|
|
4
|
+
import type { SelectionUISpecifier } from './selection-ui-specifier';
|
|
5
|
+
interface CommerceConfig {
|
|
6
|
+
families: Family[];
|
|
7
|
+
rootNode: CategoryNode;
|
|
8
|
+
options?: ServiceOptions;
|
|
9
|
+
uiSpecifiers?: Record<string, SelectionUISpecifier>;
|
|
10
|
+
}
|
|
11
|
+
export { type CommerceConfig as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce-config.js","sourceRoot":"","sources":["../../types/commerce-config.ts"],"names":[],"mappings":"AAYA,OAAO,EAAkC,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { LineItem, ObsLineItemRef } from './line-item';
|
|
2
|
+
import type { CategoryNode, SelectedPaths, CategoryNodeRole } from './category-node';
|
|
3
|
+
import type { Family, ObsFamilyRef } from './family';
|
|
4
|
+
import type Promo from './promo';
|
|
5
|
+
interface CommerceService extends ObsLineItemRef, ObsFamilyRef {
|
|
6
|
+
/** Items in cart */
|
|
7
|
+
get cartItems(): LineItem[];
|
|
8
|
+
/** Total of all quantities of all items in cart */
|
|
9
|
+
get cartQuantity(): number;
|
|
10
|
+
/** Total of all prices x quantities of items in cart */
|
|
11
|
+
get cartTotal(): number;
|
|
12
|
+
/** cartItem whose quantity was modified most recently
|
|
13
|
+
* item: LineItem
|
|
14
|
+
* modified: number (timestamp)
|
|
15
|
+
* (undefined if cartEmpty)
|
|
16
|
+
*/
|
|
17
|
+
get recentItem(): {
|
|
18
|
+
item: LineItem;
|
|
19
|
+
modified: number;
|
|
20
|
+
} | undefined;
|
|
21
|
+
get promoAppliedCartTotal(): number;
|
|
22
|
+
get cartEmpty(): boolean;
|
|
23
|
+
get appliedPromo(): Promo | null;
|
|
24
|
+
setAppliedPromo(promo: Promo | null): void;
|
|
25
|
+
/** returns the price with promo applied, of undefined if no promo or promo does not apply */
|
|
26
|
+
itemPromoPrice(item: LineItem): number | undefined;
|
|
27
|
+
getFamilySubtotal(familyId: string): number;
|
|
28
|
+
createOrder(email: string, name?: string): Promise<string | undefined>;
|
|
29
|
+
updateOrderShippingInfo(orderId: string, shippingInfo: any): Promise<void>;
|
|
30
|
+
updateOrderPaymentInfo(orderId: string, paymentInfo: any): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Sets the tokens at each level supplied.
|
|
33
|
+
* If a level is selected as [], nothing will be selected.
|
|
34
|
+
* If a level is missing (undefined), everything at that level is selected
|
|
35
|
+
*
|
|
36
|
+
* This selects one or more Family's, and all the LineItem's in them.
|
|
37
|
+
*
|
|
38
|
+
* An empty value object selects all Family's and all LineItem's,
|
|
39
|
+
* */
|
|
40
|
+
selectPaths(value: SelectedPaths): Family[];
|
|
41
|
+
selectPath(skuPath: string): Family[];
|
|
42
|
+
/**
|
|
43
|
+
* With role as ...
|
|
44
|
+
*
|
|
45
|
+
* 'single-family':
|
|
46
|
+
* item: item with skuPath as SKU, otherwise undefined
|
|
47
|
+
* node: node at path (or item's parent node),
|
|
48
|
+
* family: node at path as family (or item's parent node as family),
|
|
49
|
+
* families: undefined
|
|
50
|
+
*
|
|
51
|
+
* 'family-in-multi-family':
|
|
52
|
+
* item: item with skuPath as SKU, otherwise undefined
|
|
53
|
+
* node: parent node of this family (or parent node of item's family)
|
|
54
|
+
* family: this family (or item's family)
|
|
55
|
+
* families: this family (or item's family) and siblings
|
|
56
|
+
*
|
|
57
|
+
* 'multi-family':
|
|
58
|
+
* item: undefined
|
|
59
|
+
* node: node at path
|
|
60
|
+
* family: undefined
|
|
61
|
+
* families: subnodes / families of this node
|
|
62
|
+
*
|
|
63
|
+
* 'non-outermost':
|
|
64
|
+
* item: undefined
|
|
65
|
+
* node: node at path
|
|
66
|
+
* family: undefined
|
|
67
|
+
* families: undefined
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
peek(skuPath: string): {
|
|
71
|
+
role: CategoryNodeRole;
|
|
72
|
+
family: Family | undefined;
|
|
73
|
+
families: Family[] | undefined;
|
|
74
|
+
node: CategoryNode | undefined;
|
|
75
|
+
item: LineItem | undefined;
|
|
76
|
+
} | string;
|
|
77
|
+
/** @deprecated
|
|
78
|
+
* Whether this path defines a Family, or if it has further levels
|
|
79
|
+
* */
|
|
80
|
+
getNodeAtPath(skuPath: string): CategoryNode | undefined;
|
|
81
|
+
get selectedPaths(): SelectedPaths;
|
|
82
|
+
get selectedItems(): LineItem[];
|
|
83
|
+
get selectedFamilies(): Family[];
|
|
84
|
+
get hasSelection(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Who are the subnodes selected at 'level'?
|
|
87
|
+
* If more than one value is selected at 'level',
|
|
88
|
+
* the returned CategoryNode[] may represent multiple sets.
|
|
89
|
+
* */
|
|
90
|
+
getSelectedNodesAtLevel(level: number): CategoryNode[] | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* For convenience, so widgets can share state.
|
|
93
|
+
* "current" is unrelated to what branches and items are
|
|
94
|
+
* "selected" (with CategoryNode's and paths)
|
|
95
|
+
*
|
|
96
|
+
* SEE ALSO: from ObsLineItemRef and ObsFamilyRef, there are also
|
|
97
|
+
* get item(): LineItem | undefined
|
|
98
|
+
* get family(): Family | undefined
|
|
99
|
+
*
|
|
100
|
+
* These simply delegate to these functions
|
|
101
|
+
* */
|
|
102
|
+
setCurrentItem(sku: string | undefined): boolean;
|
|
103
|
+
get currentItem(): LineItem | undefined;
|
|
104
|
+
setCurrentFamily(id: string | undefined): boolean;
|
|
105
|
+
get currentFamily(): Family | undefined;
|
|
106
|
+
getFamilyById(id: string): Family | undefined;
|
|
107
|
+
getItemBySku(sku: string): LineItem | undefined;
|
|
108
|
+
}
|
|
109
|
+
export { type CommerceService as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce-service.js","sourceRoot":"","sources":["../../types/commerce-service.ts"],"names":[],"mappings":"AA6HA,OAAO,EAEN,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ImageDef } from '@libreapps/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 '@libreapps/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 '@libreapps/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 @@
|
|
|
1
|
+
{"version":3,"file":"string-mutator.js","sourceRoot":"","sources":["../../types/string-mutator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-separators.js","sourceRoot":"","sources":["../../types/token-separators.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// https://developers.facebook.com/docs/meta-pixel/reference
|
|
2
|
+
const sendFBEvent = (name, options = {}) => {
|
|
3
|
+
window.fbq('track', name, options);
|
|
4
|
+
};
|
|
5
|
+
// https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag
|
|
6
|
+
const sendGAEvent = (name, options = {}) => {
|
|
7
|
+
window.gtag('event', name, options);
|
|
8
|
+
};
|
|
9
|
+
export { sendFBEvent, sendGAEvent, };
|
|
10
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../util/analytics.ts"],"names":[],"mappings":"AAOA,4DAA4D;AAC5D,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IACjD,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,8FAA8F;AAC9F,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE;IACjD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AACrC,CAAC,CAAA;AAED,OAAO,EACL,WAAW,EACX,WAAW,GACZ,CAAA"}
|