@anker-in/headless-ui 1.0.26-alpha.1762236947129 → 1.0.26-alpha.1762243303200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +4 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +118 -0
- package/dist/cjs/biz-components/Listing/BizProductProvider.js +2 -0
- package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +37 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +37 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/const.d.ts +29 -0
- package/dist/cjs/biz-components/Listing/const.js +2 -0
- package/dist/cjs/biz-components/Listing/const.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/cjs/biz-components/Listing/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/index.js +2 -0
- package/dist/cjs/biz-components/Listing/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/graphql.d.ts +7473 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/product.d.ts +141 -0
- package/dist/cjs/biz-components/Listing/types/product.js +2 -0
- package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types.d.ts +28 -0
- package/dist/cjs/biz-components/Listing/types.js +2 -0
- package/dist/cjs/biz-components/Listing/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/helper.d.ts +36 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/index.d.ts +37 -0
- package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.d.ts +73 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.js.map +7 -0
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js +1 -1
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js.map +2 -2
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +17 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/checkbox.d.ts +1 -0
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +3 -3
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +4 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +118 -0
- package/dist/esm/biz-components/Listing/BizProductProvider.js +2 -0
- package/dist/esm/biz-components/Listing/BizProductProvider.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +37 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +37 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/const.d.ts +29 -0
- package/dist/esm/biz-components/Listing/const.js +2 -0
- package/dist/esm/biz-components/Listing/const.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.d.ts +3 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.d.ts +5 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.d.ts +5 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/esm/biz-components/Listing/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/index.js +2 -0
- package/dist/esm/biz-components/Listing/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/graphql.d.ts +7473 -0
- package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
- package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/product.d.ts +141 -0
- package/dist/esm/biz-components/Listing/types/product.js +2 -0
- package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/type-helper.d.ts +5 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/types.d.ts +28 -0
- package/dist/esm/biz-components/Listing/types.js +1 -0
- package/dist/esm/biz-components/Listing/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/helper.d.ts +36 -0
- package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
- package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/index.d.ts +37 -0
- package/dist/esm/biz-components/Listing/utils/index.js +2 -0
- package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.d.ts +73 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.js +2 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.js.map +7 -0
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js +1 -1
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js.map +2 -2
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +17 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +2 -2
- package/dist/esm/components/checkbox.d.ts +1 -0
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +3 -3
- package/dist/tokens/base.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as p}from"react/jsx-runtime";import{Grid as d,GridItem as o}from"../../../../components";import r from"./ProductGallery/index.js";import s from"./ProductDetail/index.js";import a from"./ProductSummary/index.js";const e=()=>p("div",{id:"ipc-product-card",className:"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]",children:[p(d,{className:"laptop:gap-6",children:[t(o,{className:"col-span-12 tablet:px-8 laptop:px-16 desktop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit",children:t(r,{})}),t(o,{className:"col-span-12 desktop:col-start-9 desktop:col-span-4",children:t(s,{})})]}),t(a,{})]});var k=e;export{k as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/ProductCard/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Grid, GridItem } from '../../../../components'\nimport ProductGallery from './ProductGallery/index.js'\nimport ProductDetail from './ProductDetail/index.js'\nimport ProductSummary from './ProductSummary/index.js'\n\n\n\nconst ProductCard = () => {\n return (\n <div id=\"ipc-product-card\" className=\"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]\">\n <Grid className=\"laptop:gap-6\">\n <GridItem className=\"col-span-12 tablet:px-8 laptop:px-16 desktop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit\">\n <ProductGallery />\n </GridItem>\n <GridItem className=\"col-span-12 desktop:col-start-9 desktop:col-span-4\">\n <ProductDetail />\n </GridItem>\n </Grid>\n <ProductSummary />\n </div>\n )\n}\n\nexport default ProductCard\n"],
|
|
5
|
+
"mappings": "AAUM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAVN,OAAS,QAAAC,EAAM,YAAAC,MAAgB,yBAC/B,OAAOC,MAAoB,4BAC3B,OAAOC,MAAmB,2BAC1B,OAAOC,MAAoB,4BAI3B,MAAMC,EAAc,IAEhBN,EAAC,OAAI,GAAG,mBAAmB,UAAU,6DACnC,UAAAA,EAACC,EAAA,CAAK,UAAU,eACd,UAAAF,EAACG,EAAA,CAAS,UAAU,oIAClB,SAAAH,EAACI,EAAA,EAAe,EAClB,EACAJ,EAACG,EAAA,CAAS,UAAU,qDAClB,SAAAH,EAACK,EAAA,EAAe,EAClB,GACF,EACAL,EAACM,EAAA,EAAe,GAClB,EAIJ,IAAOE,EAAQD",
|
|
6
|
+
"names": ["jsx", "jsxs", "Grid", "GridItem", "ProductGallery", "ProductDetail", "ProductSummary", "ProductCard", "ProductCard_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as l}from"react/jsx-runtime";import{Text as a,Button as x}from"../../../../../components";import{useAiuiContext as C}from"../../../../AiuiProvider/index.js";import{useBizProductContext as N}from"../../../BizProductProvider.js";import{useMemo as y}from"react";import{formatPrice as m}from"../../../utils";import p from"decimal.js";const w=()=>{const{copyWriting:o,locale:i="us"}=C(),{variant:e,finalPrice:b,totalSavings:r,memberFunctionResult:c,isLogin:d,comparePrice:u,onAddToCart:f,onBuyNow:v,savingDetail:n,coupon:h}=N(),g=y(()=>new p(u).minus(n.freeGift).toNumber(),[u,n]),s=Math.max(c?.withCouponMemberTotalSave??0,c?.withoutCouponMaxMemberTotalSave??0);return l("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[e.availableForSale?l("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[l("div",{className:"flex items-center gap-1",children:[t(a,{className:"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:b,currencyCode:e.price.currencyCode,locale:i})}),r>0&&t(a,{className:"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:g,currencyCode:e.price.currencyCode,locale:i})})]}),r>0&&t(a,{className:"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl",html:`${s>0&&d?o?.memberSaving:o?.totalSavings} ${m({amount:s>0&&d?s:new p(r).minus(n?.freeGift).toNumber(),currencyCode:e.price.currencyCode,locale:i})}`})]}):t(a,{className:"text-[20px] font-bold text-[#999999]",html:o?.soldOut??"Sold Out"}),l("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[t(x,{variant:"secondary",disabled:!e.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>f?.(),children:o?.addToCart??"Add to Cart"}),t(x,{variant:"primary",disabled:!e.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>v?.(),children:o?.buyNow??"Buy Now"})]})]})};var T=w;export{T as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ProductActions/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Button } from '../../../../../components'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils'\nimport Decimal from 'decimal.js'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n memberFunctionResult,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n coupon,\n } = useBizProductContext()\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n const memberPriceSave = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n return (\n <div className=\"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4\">\n {variant.availableForSale ? (\n <div className=\"flex items-center justify-between tablet:flex-col desktop:items-end\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {totalSavings > 0 && (\n <Text\n className=\"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n {totalSavings > 0 && (\n <Text\n className=\"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl\"\n html={`${memberPriceSave > 0 && isLogin ? copyWriting?.memberSaving : copyWriting?.totalSavings} ${formatPrice({ amount: memberPriceSave > 0 && isLogin ? memberPriceSave : new Decimal(totalSavings).minus(savingDetail?.freeGift).toNumber(), currencyCode: variant.price.currencyCode, locale })}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"flex items-center gap-2 mt-2 tablet:mt-0\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductActions\n"],
|
|
5
|
+
"mappings": "AAoCU,OACE,OAAAA,EADF,QAAAC,MAAA,oBApCV,OAAS,QAAAC,EAAM,UAAAC,MAAc,4BAC7B,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,WAAAC,MAAe,QACxB,OAAS,eAAAC,MAAmB,iBAC5B,OAAOC,MAAa,aAEpB,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,EAAIP,EAAe,EAChD,CACJ,QAAAQ,EACA,WAAAC,EACA,aAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,OAAAC,CACF,EAAIhB,EAAqB,EAEnBiB,EAA8BhB,EAClC,IAAM,IAAIE,EAAQS,CAAY,EAAE,MAAMG,EAAa,QAAQ,EAAE,SAAS,EACtE,CAACH,EAAcG,CAAY,CAC7B,EAEMG,EAAkB,KAAK,IAC3BR,GAAsB,2BAA6B,EACnDA,GAAsB,iCAAmC,CAC3D,EAEA,OACEd,EAAC,OAAI,UAAU,6EACZ,UAAAW,EAAQ,iBACPX,EAAC,OAAI,UAAU,sEACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACE,EAAA,CACC,UAAU,uEACV,KAAMK,EAAY,CAAE,OAAQM,EAAY,aAAcD,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,EAC5F,EACCG,EAAe,GACdd,EAACE,EAAA,CACC,UAAU,gGACV,KAAMK,EAAY,CAChB,OAAQe,EACR,aAAcV,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,GAEJ,EACCG,EAAe,GACdd,EAACE,EAAA,CACC,UAAU,sFACV,KAAM,GAAGqB,EAAkB,GAAKP,EAAUN,GAAa,aAAeA,GAAa,YAAY,IAAIH,EAAY,CAAE,OAAQgB,EAAkB,GAAKP,EAAUO,EAAkB,IAAIf,EAAQM,CAAY,EAAE,MAAMM,GAAc,QAAQ,EAAE,SAAS,EAAG,aAAcR,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,CAAC,GACrS,GAEJ,EAEAX,EAACE,EAAA,CAAK,UAAU,uCAAuC,KAAMQ,GAAa,SAAW,WAAY,EAEnGT,EAAC,OAAI,UAAU,2CACb,UAAAD,EAACG,EAAA,CACC,QAAQ,YACR,SAAU,CAACS,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMM,IAAc,EAE5B,SAAAR,GAAa,WAAa,cAC7B,EACAV,EAACG,EAAA,CACC,QAAQ,UACR,SAAU,CAACS,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMO,IAAW,EAEzB,SAAAT,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOc,EAAQf",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "Button", "useAiuiContext", "useBizProductContext", "useMemo", "formatPrice", "Decimal", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "memberFunctionResult", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "coupon", "comparePriceRemovedFreeGift", "memberPriceSave", "ProductActions_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ScrollSpyNavProps } from './types.js';
|
|
2
|
+
declare const MobileScrollSpyNav: ({ tabs, purchaseBarHeight, onSpyNavItemClick }: ScrollSpyNavProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const DesktopScrollSpyNav: ({ tabs, onSpyNavItemClick }: ScrollSpyNavProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { MobileScrollSpyNav, DesktopScrollSpyNav };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o,jsxs as s}from"react/jsx-runtime";import"../../../../AiuiProvider/index.js";import{cn as m}from"../../../../../helpers/index.js";import{useState as c,useCallback as p,useRef as x}from"react";import{gsap as S}from"gsap";import{useBizProductContext as h}from"../../../BizProductProvider.js";const g=t=>o("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:o("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"#1D1D1F",strokeLinecap:"round",strokeLinejoin:"round"})}),w=({tabs:t,purchaseBarHeight:a,onSpyNavItemClick:i})=>{const[n,r]=c(!1),[e,f]=c(t?.[0]),d=x(null),{renderRating:u}=h(),v=p(l=>{f(l),i?.(l),r(!1)},[]),b=p(()=>{r(!n),S.fromTo(d?.current,{height:0},{height:"auto",duration:.5,ease:"power2.inOut"})},[n]);return s("div",{children:[s("button",{className:"text-sm h-[28px] font-bold flex gap-1 items-center leading-[28px] px-[10px] border rounded-full border-black",onClick:b,children:[e?.label,o(g,{className:"size-3"})]}),s("div",{className:m("absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0",{hidden:!n}),style:{height:`calc(100dvh - ${a}px)`},children:[s("div",{ref:d,className:"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white",children:[t?.map(l=>o("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",onClick:()=>v(l),children:l.label},l.id)),o("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",children:u})]}),o("div",{className:"flex-1",onClick:()=>r(!1)})]})]})},N=({tabs:t,onSpyNavItemClick:a})=>{const[i,n]=c(t?.[0]),r=p(e=>{n(e),a?.(e)},[]);return o("div",{className:"flex gap-8",children:t?.map(e=>s("button",{className:"text-sm relative py-[10px] font-bold",onClick:()=>r(e),children:[e.label,o("div",{className:m("absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0",{"w-full":i?.id===e.id})})]},e.id))})};export{N as DesktopScrollSpyNav,w as MobileScrollSpyNav};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport { useState, useCallback, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport type { ScrollSpyNavItem, ScrollSpyNavProps } from './types.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\n\nconst ArrowDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M3 4.5L6 7.5L9 4.5\" stroke=\"#1D1D1F\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )\n}\n\nconst MobileScrollSpyNav = ({ tabs, purchaseBarHeight, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [dropdownOpen, setDropdownOpen] = useState(false)\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n const dropdownRef = useRef<HTMLDivElement>(null)\n const { renderRating } = useBizProductContext()\n \n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n setDropdownOpen(false)\n }, [])\n\n const onDropdownOpen = useCallback(() => {\n setDropdownOpen(!dropdownOpen)\n gsap.fromTo(dropdownRef?.current, { height: 0 }, { height: 'auto', duration: 0.5, ease: 'power2.inOut' })\n }, [dropdownOpen])\n\n return (\n <div>\n <button\n className=\"text-sm h-[28px] font-bold flex gap-1 items-center leading-[28px] px-[10px] border rounded-full border-black\"\n onClick={onDropdownOpen}\n >\n {activeTab?.label}<ArrowDownIcon className='size-3'/>\n </button>\n <div\n className={cn('absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0', {\n ['hidden']: !dropdownOpen,\n })}\n style={{\n height: `calc(100dvh - ${purchaseBarHeight}px)`,\n }}\n >\n <div ref={dropdownRef} className=\"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white\">\n {tabs?.map(tab => (\n <button\n className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\"\n key={tab.id}\n onClick={() => onTabClick(tab)}\n >\n {tab.label}\n </button>\n ))}\n <button className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\">{renderRating}</button>\n </div>\n <div className=\"flex-1\" onClick={() => setDropdownOpen(false)} />\n </div>\n </div>\n )\n}\n\nconst DesktopScrollSpyNav = ({ tabs, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n\n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n }, [])\n\n return (\n <div className=\"flex gap-8\">\n {tabs?.map(tab => (\n <button className=\"text-sm relative py-[10px] font-bold\" key={tab.id} onClick={() => onTabClick(tab)}>\n {tab.label}\n <div\n className={cn('absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0', {\n 'w-full': activeTab?.id === tab.id,\n })}\n />\n </button>\n ))}\n </div>\n )\n}\n\nexport { MobileScrollSpyNav, DesktopScrollSpyNav }\n"],
|
|
5
|
+
"mappings": "AAUM,cAAAA,EAwBA,QAAAC,MAxBA,oBAVN,MAA+B,oCAC/B,OAAS,MAAAC,MAAU,kCACnB,OAAS,YAAAC,EAAU,eAAAC,EAAa,UAAAC,MAAc,QAC9C,OAAS,QAAAC,MAAY,OAErB,OAAS,wBAAAC,MAA4B,iCAErC,MAAMC,EAAiBC,GAEnBT,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGS,EACjG,SAAAT,EAAC,QAAK,EAAE,qBAAqB,OAAO,UAAU,cAAc,QAAQ,eAAe,QAAQ,EAC7F,EAIEU,EAAqB,CAAC,CAAE,KAAAC,EAAM,kBAAAC,EAAmB,kBAAAC,CAAkB,IAAyB,CAChG,KAAM,CAACC,EAAcC,CAAe,EAAIZ,EAAS,EAAK,EAChD,CAACa,EAAWC,CAAY,EAAId,EAASQ,IAAO,CAAC,CAAC,EAC9CO,EAAcb,EAAuB,IAAI,EACzC,CAAE,aAAAc,CAAa,EAAIZ,EAAqB,EAExCa,EAAahB,EAAaiB,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,EACvBN,EAAgB,EAAK,CACvB,EAAG,CAAC,CAAC,EAECO,EAAiBlB,EAAY,IAAM,CACvCW,EAAgB,CAACD,CAAY,EAC7BR,EAAK,OAAOY,GAAa,QAAS,CAAE,OAAQ,CAAE,EAAG,CAAE,OAAQ,OAAQ,SAAU,GAAK,KAAM,cAAe,CAAC,CAC1G,EAAG,CAACJ,CAAY,CAAC,EAEjB,OACEb,EAAC,OACC,UAAAA,EAAC,UACC,UAAU,+GACV,QAASqB,EAER,UAAAN,GAAW,MAAMhB,EAACQ,EAAA,CAAc,UAAU,SAAQ,GACrD,EACAP,EAAC,OACC,UAAWC,EAAG,mEAAoE,CAC/E,OAAW,CAACY,CACf,CAAC,EACD,MAAO,CACL,OAAQ,iBAAiBF,CAAiB,KAC5C,EAEA,UAAAX,EAAC,OAAI,IAAKiB,EAAa,UAAU,mEAC9B,UAAAP,GAAM,IAAIU,GACTrB,EAAC,UACC,UAAU,qDAEV,QAAS,IAAMoB,EAAWC,CAAG,EAE5B,SAAAA,EAAI,OAHAA,EAAI,EAIX,CACD,EACDrB,EAAC,UAAO,UAAU,qDAAsD,SAAAmB,EAAa,GACvF,EACAnB,EAAC,OAAI,UAAU,SAAS,QAAS,IAAMe,EAAgB,EAAK,EAAG,GACjE,GACF,CAEJ,EAEMQ,EAAsB,CAAC,CAAE,KAAAZ,EAAM,kBAAAE,CAAkB,IAAyB,CAC9E,KAAM,CAACG,EAAWC,CAAY,EAAId,EAASQ,IAAO,CAAC,CAAC,EAE9CS,EAAahB,EAAaiB,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,CACzB,EAAG,CAAC,CAAC,EAEL,OACErB,EAAC,OAAI,UAAU,aACZ,SAAAW,GAAM,IAAIU,GACTpB,EAAC,UAAO,UAAU,uCAAoD,QAAS,IAAMmB,EAAWC,CAAG,EAChG,UAAAA,EAAI,MACLrB,EAAC,OACC,UAAWE,EAAG,0FAA2F,CACvG,SAAUc,GAAW,KAAOK,EAAI,EAClC,CAAC,EACH,IAN4DA,EAAI,EAOlE,CACD,EACH,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "cn", "useState", "useCallback", "useRef", "gsap", "useBizProductContext", "ArrowDownIcon", "props", "MobileScrollSpyNav", "tabs", "purchaseBarHeight", "onSpyNavItemClick", "dropdownOpen", "setDropdownOpen", "activeTab", "setActiveTab", "dropdownRef", "renderRating", "onTabClick", "tab", "onDropdownOpen", "DesktopScrollSpyNav"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useState as n,useMemo as u}from"react";import{Heading as d,Container as f}from"../../../../components";import"gsap";import"../../../AiuiProvider/index.js";import"../../../../helpers/index.js";import{ProductActions as b}from"../index.js";import{useBizProductContext as h}from"../../BizProductProvider.js";import{MobileScrollSpyNav as y,DesktopScrollSpyNav as x}from"./ScrollSpyNav/index.js";const v=({onSpyNavItemClick:r})=>{const[p,i]=n(0),{isMobile:g,product:t,renderRating:l,isDesktop:o}=h(),s=u(()=>t?.payload?.components?.find(c=>c.componentKey==="PurchaseBar")?.data||[],[t?.payload]);return m(()=>{i(document.querySelector("#purchase-bar")?.clientHeight||0)},[]),e("div",{id:"purchase-bar",className:"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]",children:e(f,{children:a("div",{className:"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full",children:[a("div",{className:"flex-1 py-3 desktop:pt-6 desktop:pb-0 tablet:flex-none",children:[e(d,{size:2,className:"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]",html:t?.title}),o&&a("div",{className:"flex justify-between gap-8 items-center mt-3",children:[e(x,{tabs:s,onSpyNavItemClick:r}),l]})]}),o?e(b,{}):e(y,{tabs:s,purchaseBarHeight:p,onSpyNavItemClick:r})]})})})};var R=v;export{R as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PurchaseBar/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useRef, useState, useMemo } from 'react'\nimport { Text, Heading, Button, Container } from '../../../../components'\nimport type { PurchaseBarProps, ScrollSpyNavProps, ScrollSpyNavItem } from './types.js'\nimport { gsap } from 'gsap'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { MobileScrollSpyNav, DesktopScrollSpyNav } from './ScrollSpyNav/index.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick }: PurchaseBarProps) => {\n const [purchaseBarHeight, setPurchaseBarHeight] = useState(0)\n const { isMobile, product, renderRating, isDesktop } = useBizProductContext()\n\n const PurchaseBarData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'PurchaseBar')?.data || []\n }, [product?.payload])\n\n useEffect(() => {\n setPurchaseBarHeight(document.querySelector('#purchase-bar')?.clientHeight || 0)\n }, [])\n\n return (\n <div id=\"purchase-bar\" className=\"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]\">\n <Container>\n {/* // py-3 desktop:pt-6 desktop:pb-0 */}\n <div className=\"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full\">\n <div className=\"flex-1 py-3 desktop:pt-6 desktop:pb-0 tablet:flex-none\">\n <Heading\n size={2}\n className=\"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]\"\n html={product?.title}\n />\n {isDesktop && (\n <div className=\"flex justify-between gap-8 items-center mt-3\">\n <DesktopScrollSpyNav tabs={PurchaseBarData} onSpyNavItemClick={onSpyNavItemClick} />\n {renderRating}\n </div>\n )}\n </div>\n {!isDesktop ? (\n <MobileScrollSpyNav\n tabs={PurchaseBarData}\n purchaseBarHeight={purchaseBarHeight}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n ) : (\n <ProductActions />\n )}\n </div>\n </Container>\n </div>\n )\n}\n\nexport default PurchaseBar\n"],
|
|
5
|
+
"mappings": "AA4BY,cAAAA,EAME,QAAAC,MANF,oBA5BZ,OAAsB,aAAAC,EAAmB,YAAAC,EAAU,WAAAC,MAAe,QAClE,OAAe,WAAAC,EAAiB,aAAAC,MAAiB,yBAEjD,MAAqB,OACrB,MAA+B,iCAC/B,MAAmB,+BACnB,OAAS,kBAAAC,MAAsB,cAC/B,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,sBAAAC,EAAoB,uBAAAC,MAA2B,0BAExD,MAAMC,EAAc,CAAC,CAAE,kBAAAC,CAAkB,IAAwB,CAC/D,KAAM,CAACC,EAAmBC,CAAoB,EAAIX,EAAS,CAAC,EACtD,CAAE,SAAAY,EAAU,QAAAC,EAAS,aAAAC,EAAc,UAAAC,CAAU,EAAIV,EAAqB,EAEtEW,EAAkBf,EAAQ,IACvBY,GAAS,SAAS,YAAY,KAAMI,GAAcA,EAAK,eAAiB,aAAa,GAAG,MAAQ,CAAC,EACvG,CAACJ,GAAS,OAAO,CAAC,EAErB,OAAAd,EAAU,IAAM,CACdY,EAAqB,SAAS,cAAc,eAAe,GAAG,cAAgB,CAAC,CACjF,EAAG,CAAC,CAAC,EAGHd,EAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,SAAAA,EAACM,EAAA,CAEC,SAAAL,EAAC,OAAI,UAAU,iFACb,UAAAA,EAAC,OAAI,UAAU,yDACb,UAAAD,EAACK,EAAA,CACC,KAAM,EACN,UAAU,mFACV,KAAMW,GAAS,MACjB,EACCE,GACCjB,EAAC,OAAI,UAAU,+CACb,UAAAD,EAACU,EAAA,CAAoB,KAAMS,EAAiB,kBAAmBP,EAAmB,EACjFK,GACH,GAEJ,EACEC,EAOAlB,EAACO,EAAA,EAAe,EANhBP,EAACS,EAAA,CACC,KAAMU,EACN,kBAAmBN,EACnB,kBAAmBD,EACrB,GAIJ,EACF,EACF,CAEJ,EAEA,IAAOS,EAAQV",
|
|
6
|
+
"names": ["jsx", "jsxs", "useEffect", "useState", "useMemo", "Heading", "Container", "ProductActions", "useBizProductContext", "MobileScrollSpyNav", "DesktopScrollSpyNav", "PurchaseBar", "onSpyNavItemClick", "purchaseBarHeight", "setPurchaseBarHeight", "isMobile", "product", "renderRating", "isDesktop", "PurchaseBarData", "item", "PurchaseBar_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PurchaseBarProps {
|
|
2
|
+
onSpyNavItemClick?: (tab: ScrollSpyNavItem) => void;
|
|
3
|
+
}
|
|
4
|
+
export interface ScrollSpyNavItem {
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ScrollSpyNavProps extends Pick<PurchaseBarProps, 'onSpyNavItemClick'> {
|
|
10
|
+
tabs: ScrollSpyNavItem[];
|
|
11
|
+
purchaseBarHeight: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/Listing/components/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default as PurchaseBar } from './PurchaseBar/index.js'\nexport { default as ProductActions } from './PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './ProductCard/index.js'"],
|
|
5
|
+
"mappings": "AAAA,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAAiC,wCAC1C,OAAoB,WAAXA,MAA8B",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare enum DiscountType {
|
|
2
|
+
fixedAmount = "fixed_amount",
|
|
3
|
+
percentage = "percentage",
|
|
4
|
+
fixedDiscountAmount = "fix_discount_amount"
|
|
5
|
+
}
|
|
6
|
+
export declare enum CouponChannel {
|
|
7
|
+
LIGHTNING_DEAL = "LIGHTNING_DEAL",
|
|
8
|
+
DEAL = "LIGHTNING_DEAL",
|
|
9
|
+
COUPON = "COUPON",
|
|
10
|
+
PED = "PED",
|
|
11
|
+
WS24 = "WS24",
|
|
12
|
+
WSTD = "WSTD",
|
|
13
|
+
WSCH = "WSCH"
|
|
14
|
+
}
|
|
15
|
+
export declare const PRICE_SYMBOL: {
|
|
16
|
+
us: string;
|
|
17
|
+
uk: string;
|
|
18
|
+
ca: string;
|
|
19
|
+
eu: string;
|
|
20
|
+
pl: string;
|
|
21
|
+
fr: string;
|
|
22
|
+
de: string;
|
|
23
|
+
vn: string;
|
|
24
|
+
cl: string;
|
|
25
|
+
sg: string;
|
|
26
|
+
ae: string;
|
|
27
|
+
es: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const COLOR_LABEL: string[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=(e=>(e.fixedAmount="fixed_amount",e.percentage="percentage",e.fixedDiscountAmount="fix_discount_amount",e))(t||{}),L=(r=>(r.LIGHTNING_DEAL="LIGHTNING_DEAL",r.DEAL="LIGHTNING_DEAL",r.COUPON="COUPON",r.PED="PED",r.WS24="WS24",r.WSTD="WSTD",r.WSCH="WSCH",r))(L||{});const c={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",pl:"z\u0142",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED",es:"\u20AC"},E=["color","colour","couleur","cor","colore","farbe","\uC0C9","\u8272","\u30AB\u30E9\u30FC","f\xE4rg","farve"];export{E as COLOR_LABEL,L as CouponChannel,t as DiscountType,c as PRICE_SYMBOL};
|
|
2
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/Listing/const.ts"],
|
|
4
|
+
"sourcesContent": ["export enum DiscountType {\n fixedAmount = 'fixed_amount',\n percentage = 'percentage',\n fixedDiscountAmount = 'fix_discount_amount',\n}\n\nexport enum CouponChannel {\n LIGHTNING_DEAL = 'LIGHTNING_DEAL',\n DEAL = 'LIGHTNING_DEAL',\n COUPON = 'COUPON',\n PED = 'PED',\n WS24 = 'WS24',\n WSTD = 'WSTD',\n WSCH = 'WSCH',\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n\nexport const COLOR_LABEL = [\n 'color',\n 'colour',\n 'couleur',\n 'cor',\n 'colore',\n 'farbe',\n '\uC0C9',\n '\u8272',\n '\u30AB\u30E9\u30FC',\n 'f\u00E4rg',\n 'farve',\n]"],
|
|
5
|
+
"mappings": "AAAO,IAAKA,OACVA,EAAA,YAAc,eACdA,EAAA,WAAa,aACbA,EAAA,oBAAsB,sBAHZA,OAAA,IAMAC,OACVA,EAAA,eAAiB,iBACjBA,EAAA,KAAO,iBACPA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IAUL,MAAMC,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,MACJ,GAAI,QACN,EAEaC,EAAc,CACzB,QACA,SACA,UACA,MACA,SACA,QACA,SACA,SACA,qBACA,UACA,OACF",
|
|
6
|
+
"names": ["DiscountType", "CouponChannel", "PRICE_SYMBOL", "COLOR_LABEL"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{btoaID as f,isObjEmpty as m}from"../utils/helper";import{parse as u}from"query-string";import{useEffect as d,useState as O}from"react";import{optionsConstructor as v}from"../utils";function l(t,o){const[p,i]=O({});return d(()=>{const n=u(window.location.search);let r=t.variants[0];if(n.variant){const c=f(n.variant),a=t.variants.find(e=>o?e.sku===o:e.id===c);a&&(r=a)}const s=v(r.options);m(s)||i(s)},[t,o]),[p,i]}export{l as useSelectedOptions};
|
|
2
|
+
//# sourceMappingURL=use-options.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/Listing/hooks/use-options.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Options, Product, ProductVariant } from '../types/product'\nimport { btoaID, isObjEmpty } from '../utils/helper'\nimport { parse } from 'query-string'\nimport { type Dispatch, type SetStateAction, useEffect, useState } from 'react'\n\nimport { optionsConstructor } from '../utils'\n\nexport function useSelectedOptions(product: Product, sku?: string) {\n /**\n * \u6839\u636E query string \u521D\u59CB\u5316 selectedOptions\n * \u5982\u679C\u4F20\u5165 sku \u5219\u6839\u636E sku \u83B7\u53D6 variant\uFF0C\u5426\u5219\u9ED8\u8BA4\u6839\u636E query \u7684 variant \u83B7\u53D6\n */\n const [options, setOptions] = useState<Options>({})\n\n useEffect(() => {\n const query = parse(window.location.search) as { variant?: string }\n // \u9875\u9762\u521D\u59CB\u5316\u8BFB\u53D6 query \u4E2D\u7684 variant, \u5982\u679C\u6CA1\u6709\u627E\u5230\u5BF9\u5E94 query \u4E2D id \u7684 variant\uFF0C\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n let variant = product.variants[0]\n if (query.variant) {\n const variantId = btoaID(query.variant)\n\n const foundVariant = product.variants.find((variant: ProductVariant) =>\n sku ? variant.sku === sku : variant.id === variantId,\n )\n if (foundVariant) {\n variant = foundVariant\n }\n }\n\n // \u66F4\u65B0\u5F53\u524D variant \u5BF9\u5E94\u7684 options\n const options = optionsConstructor(variant.options)\n\n if (!isObjEmpty(options)) {\n setOptions(options)\n }\n }, [product, sku])\n\n return [options, setOptions] as [Options, Dispatch<SetStateAction<Options>>]\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,kBACnC,OAAS,SAAAC,MAAa,eACtB,OAA6C,aAAAC,EAAW,YAAAC,MAAgB,QAExE,OAAS,sBAAAC,MAA0B,WAE5B,SAASC,EAAmBC,EAAkBC,EAAc,CAKjE,KAAM,CAACC,EAASC,CAAU,EAAIN,EAAkB,CAAC,CAAC,EAElD,OAAAD,EAAU,IAAM,CACd,MAAMQ,EAAQT,EAAM,OAAO,SAAS,MAAM,EAE1C,IAAIU,EAAUL,EAAQ,SAAS,CAAC,EAChC,GAAII,EAAM,QAAS,CACjB,MAAME,EAAYb,EAAOW,EAAM,OAAO,EAEhCG,EAAeP,EAAQ,SAAS,KAAMK,GAC1CJ,EAAMI,EAAQ,MAAQJ,EAAMI,EAAQ,KAAOC,CAC7C,EACIC,IACFF,EAAUE,EAEd,CAGA,MAAML,EAAUJ,EAAmBO,EAAQ,OAAO,EAE7CX,EAAWQ,CAAO,GACrBC,EAAWD,CAAO,CAEtB,EAAG,CAACF,EAASC,CAAG,CAAC,EAEV,CAACC,EAASC,CAAU,CAC7B",
|
|
6
|
+
"names": ["btoaID", "isObjEmpty", "parse", "useEffect", "useState", "optionsConstructor", "useSelectedOptions", "product", "sku", "options", "setOptions", "query", "variant", "variantId", "foundVariant"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MediaContentType } from '../types/graphql';
|
|
2
|
+
import type { Replace } from '../types/type-helper';
|
|
3
|
+
import type { Product, ProductMedia, ProductVariant } from '../types/product';
|
|
4
|
+
export type ImageMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Image>;
|
|
5
|
+
export type VideoMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Video>;
|
|
6
|
+
export declare function useVariantMedia({ product, variant }: {
|
|
7
|
+
product: Product;
|
|
8
|
+
variant: ProductVariant;
|
|
9
|
+
}): {
|
|
10
|
+
productList: ImageMedia[];
|
|
11
|
+
sceneList: ImageMedia[];
|
|
12
|
+
keyFeaturesList: ImageMedia[];
|
|
13
|
+
videoList: VideoMedia[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{MediaContentType as a}from"../types/graphql";import{getVariantMediaList as f}from"../utils/helper";import{useEffect as C,useState as s}from"react";function v({product:t,variant:m}){const d=t?.media?.filter(e=>e.mediaContentType===a.Image),o=[d?.[0]],r=d?.slice(1,o.length),c=d?.slice(2,o.length),p=t?.media?.filter(e=>e.mediaContentType===a.Video),[M,g]=s(o||[]),[y,L]=s(r||[]),[u,I]=s(p||[]),[l,V]=s(c||[]);return C(()=>{const e=f({product:t,variant:m}),i=e?.filter(n=>n.mediaContentType===a.Image);g(i?.[0]?[i[0]]:[]),L(i?.slice(1,i?.length)||[]),V([]),I(e?.filter(n=>n.mediaContentType===a.Video)||[])},[t,m]),{productList:M,sceneList:y,videoList:u,keyFeaturesList:l}}export{v as useVariantMedia};
|
|
2
|
+
//# sourceMappingURL=use-variant-media.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/Listing/hooks/use-variant-media.ts"],
|
|
4
|
+
"sourcesContent": ["import { MediaContentType } from '../types/graphql'\nimport { getVariantMediaList } from '../utils/helper'\nimport type { Replace } from '../types/type-helper'\nimport type { Product, ProductMedia, ProductVariant } from '../types/product'\nimport { useEffect, useState } from 'react'\n\nexport type ImageMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Image>\nexport type VideoMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Video>\n\nexport function useVariantMedia({ product, variant }: { product: Product; variant: ProductVariant }): {\n productList: ImageMedia[]\n sceneList: ImageMedia[]\n keyFeaturesList: ImageMedia[]\n videoList: VideoMedia[]\n} {\n const mediaList = product?.media?.filter((media) => media.mediaContentType === MediaContentType.Image)\n const productImageList = [mediaList?.[0]] as ImageMedia[]\n const scenes = mediaList?.slice(1, productImageList.length) as ImageMedia[]\n const keyFeatures = mediaList?.slice(2, productImageList.length) as ImageMedia[]\n const videos = product?.media?.filter((media) => media.mediaContentType === MediaContentType.Video) as VideoMedia[]\n const [imageList, setImageList] = useState<ImageMedia[]>(productImageList || [])\n const [sceneList, setSeneList] = useState<ImageMedia[]>(scenes || [])\n const [videoList, setVideoList] = useState<VideoMedia[]>(videos || [])\n const [keyFeaturesList, setKeyFeaturesList] = useState<ImageMedia[]>(keyFeatures || [])\n useEffect(() => {\n const mediaList = getVariantMediaList({ product, variant })\n\n const imageList = mediaList?.filter((media) => media.mediaContentType === MediaContentType.Image) as ImageMedia[]\n setImageList(imageList?.[0] ? [imageList[0]] : [])\n setSeneList(imageList?.slice(1, imageList?.length) || [])\n setKeyFeaturesList([])\n setVideoList(\n (mediaList?.filter((media) => media.mediaContentType === MediaContentType.Video) as VideoMedia[]) || [],\n )\n }, [product, variant])\n\n return { productList: imageList, sceneList, videoList: videoList, keyFeaturesList }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,mBACjC,OAAS,uBAAAC,MAA2B,kBAGpC,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QAK7B,SAASC,EAAgB,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAKjD,CACA,MAAMC,EAAYF,GAAS,OAAO,OAAQG,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAC/FS,EAAmB,CAACF,IAAY,CAAC,CAAC,EAClCG,EAASH,GAAW,MAAM,EAAGE,EAAiB,MAAM,EACpDE,EAAcJ,GAAW,MAAM,EAAGE,EAAiB,MAAM,EACzDG,EAASP,GAAS,OAAO,OAAQG,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAC5F,CAACa,EAAWC,CAAY,EAAIX,EAAuBM,GAAoB,CAAC,CAAC,EACzE,CAACM,EAAWC,CAAW,EAAIb,EAAuBO,GAAU,CAAC,CAAC,EAC9D,CAACO,EAAWC,CAAY,EAAIf,EAAuBS,GAAU,CAAC,CAAC,EAC/D,CAACO,EAAiBC,CAAkB,EAAIjB,EAAuBQ,GAAe,CAAC,CAAC,EACtF,OAAAT,EAAU,IAAM,CACd,MAAMK,EAAYN,EAAoB,CAAE,QAAAI,EAAS,QAAAC,CAAQ,CAAC,EAEpDO,EAAYN,GAAW,OAAQC,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAChGc,EAAaD,IAAY,CAAC,EAAI,CAACA,EAAU,CAAC,CAAC,EAAI,CAAC,CAAC,EACjDG,EAAYH,GAAW,MAAM,EAAGA,GAAW,MAAM,GAAK,CAAC,CAAC,EACxDO,EAAmB,CAAC,CAAC,EACrBF,EACGX,GAAW,OAAQC,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,GAAsB,CAAC,CACxG,CACF,EAAG,CAACK,EAASC,CAAO,CAAC,EAEd,CAAE,YAAaO,EAAW,UAAAE,EAAW,UAAWE,EAAW,gBAAAE,CAAgB,CACpF",
|
|
6
|
+
"names": ["MediaContentType", "getVariantMediaList", "useEffect", "useState", "useVariantMedia", "product", "variant", "mediaList", "media", "productImageList", "scenes", "keyFeatures", "videos", "imageList", "setImageList", "sceneList", "setSeneList", "videoList", "setVideoList", "keyFeaturesList", "setKeyFeaturesList"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useEffect as e,useState as n}from"react";import{getFirstAvailableVariant as s,getVariantFromSelectedOptions as c}from"../utils/index";function f({product:t,selectedOptions:a}){const[r,o]=n(s(t));return e(()=>{const i=c({product:t,selectedOptions:a});i&&i.id!==r.id&&o(i)},[a,t.variants,r,t]),r}export{f as useVariant};
|
|
2
|
+
//# sourceMappingURL=use-variant.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/Listing/hooks/use-variant.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Options, Product, ProductVariant } from '../types/product'\nimport { useEffect, useState } from 'react'\n\nimport { getFirstAvailableVariant, getVariantFromSelectedOptions } from '../utils/index'\n\nexport function useVariant({\n product,\n selectedOptions,\n}: {\n product: Product\n selectedOptions: Options\n}): ProductVariant {\n const [variant, setVariant] = useState(getFirstAvailableVariant(product))\n\n // \u6839\u636E\u5DF2\u9009\u7684 option \u83B7\u53D6\u5F53\u524D\u7684 variant\n useEffect(() => {\n const v = getVariantFromSelectedOptions({ product, selectedOptions })\n if (v && v.id !== variant.id) {\n setVariant(v)\n }\n }, [selectedOptions, product.variants, variant, product])\n\n return variant\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,aAAAA,EAAW,YAAAC,MAAgB,QAEpC,OAAS,4BAAAC,EAA0B,iCAAAC,MAAqC,iBAEjE,SAASC,EAAW,CACzB,QAAAC,EACA,gBAAAC,CACF,EAGmB,CACjB,KAAM,CAACC,EAASC,CAAU,EAAIP,EAASC,EAAyBG,CAAO,CAAC,EAGxE,OAAAL,EAAU,IAAM,CACd,MAAMS,EAAIN,EAA8B,CAAE,QAAAE,EAAS,gBAAAC,CAAgB,CAAC,EAChEG,GAAKA,EAAE,KAAOF,EAAQ,IACxBC,EAAWC,CAAC,CAEhB,EAAG,CAACH,EAAiBD,EAAQ,SAAUE,EAASF,CAAO,CAAC,EAEjDE,CACT",
|
|
6
|
+
"names": ["useEffect", "useState", "getFirstAvailableVariant", "getVariantFromSelectedOptions", "useVariant", "product", "selectedOptions", "variant", "setVariant", "v"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ProductVariant, FreeGift, Bundle } from '../types/product';
|
|
2
|
+
interface BenefitsParams {
|
|
3
|
+
variant: ProductVariant;
|
|
4
|
+
}
|
|
5
|
+
interface BenefitItemConfig<T extends Record<string, any> = Record<string, any>> {
|
|
6
|
+
enable: boolean;
|
|
7
|
+
config?: T;
|
|
8
|
+
}
|
|
9
|
+
interface BenefitsResult {
|
|
10
|
+
/**
|
|
11
|
+
* 通用优惠券
|
|
12
|
+
*/
|
|
13
|
+
commonCoupon?: BenefitItemConfig;
|
|
14
|
+
/**
|
|
15
|
+
* 买赠
|
|
16
|
+
*/
|
|
17
|
+
freeGift: BenefitItemConfig<FreeGift>;
|
|
18
|
+
/**
|
|
19
|
+
* 捆绑折扣
|
|
20
|
+
*/
|
|
21
|
+
bundle: BenefitItemConfig<Bundle>;
|
|
22
|
+
/**
|
|
23
|
+
* 会员价
|
|
24
|
+
*/
|
|
25
|
+
memberDiscount: BenefitItemConfig;
|
|
26
|
+
/**
|
|
27
|
+
* 积分抵现
|
|
28
|
+
*/
|
|
29
|
+
creditsRedemption: BenefitItemConfig;
|
|
30
|
+
/**
|
|
31
|
+
* 高标物流
|
|
32
|
+
*/
|
|
33
|
+
paidShipping: BenefitItemConfig;
|
|
34
|
+
/**
|
|
35
|
+
* 满赠
|
|
36
|
+
*/
|
|
37
|
+
fullGift: BenefitItemConfig;
|
|
38
|
+
/**
|
|
39
|
+
* 满减折扣
|
|
40
|
+
*/
|
|
41
|
+
levelDiscount: BenefitItemConfig;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 商品权益
|
|
45
|
+
* 获取当前sku 所有的权益
|
|
46
|
+
* 包括 通用优惠券,会员价,满减,捆绑折扣,买赠 ,满赠 ,积分抵现
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare const useBenefits: ({ variant }: BenefitsParams) => BenefitsResult;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useBizProductContext as h}from"../BizProductProvider";import{checkItemAvailableForProduct as C}from"../utils/helper";import{useAiuiContext as v}from"../../AiuiProvider/index.js";const x=({variant:t})=>{const{coupon:f,product:c,bundle:o,isLogin:u,freeGift:l,memberFunctionResult:i,creditsRedemptionAmount:s,discount:r}=h(),{codeSavings:m}=r||{},{trackingData:n}=v(),d=Math.max(i?.withCouponMemberTotalSave??0,i?.withoutCouponMaxMemberTotalSave??0),p=!!(n?.paidShipping&&t.requiresShipping&&!t?.metafields?.global?.presell&&!t?.metafields?.global?.HideShipping),a=n?.freeGift,g=a?.excludeProducts?.map(e=>typeof e=="object"&&"sku"in e?e.sku:e)??[],b=n?.levelDiscount&&C({product:c,variant:t,item:n?.levelDiscount}),B=!u&&(m||0)<(i?.withCouponMemberTotalSave||0);return{commonCoupon:{enable:!!f,config:f??{}},freeGift:{enable:!!l&&!!l?.giftList?.length,config:l},bundle:{enable:!!o&&!!o?.bundleList?.length&&Math.max(...o?.bundleList?.map(e=>e.savings??0))>0,config:o},memberDiscount:{enable:B,config:{amount:d,description:i?.labels?.find(e=>e.key==="benefit_tab_string")?.value}},creditsRedemption:{enable:!!s&&s>0,config:{amount:s,label:n?.creditsRedemptionLabel}},paidShipping:{enable:p,config:{}},fullGift:{enable:!!(a&&!g.includes(t.sku)),config:a??{}},levelDiscount:{enable:!!b,config:n?.levelDiscount??{}}}};export{x as useBenefits};
|
|
2
|
+
//# sourceMappingURL=useBenefits.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/Listing/hooks/useBenefits.ts"],
|
|
4
|
+
"sourcesContent": ["import { useBizProductContext } from '../BizProductProvider'\nimport type { ProductVariant, FreeGift, Bundle } from '../types/product'\nimport { checkItemAvailableForProduct } from '../utils/helper'\n\nimport { useAiuiContext } from '../../AiuiProvider/index.js'\n\ninterface BenefitsParams {\n variant: ProductVariant\n}\n\ninterface BenefitItemConfig<T extends Record<string, any> = Record<string, any>> {\n enable: boolean\n config?: T // \u539F\u59CB\u914D\u7F6E\n}\n\ninterface BenefitsResult {\n /**\n * \u901A\u7528\u4F18\u60E0\u5238\n */\n commonCoupon?: BenefitItemConfig\n /**\n * \u4E70\u8D60\n */\n freeGift: BenefitItemConfig<FreeGift>\n /**\n * \u6346\u7ED1\u6298\u6263\n */\n bundle: BenefitItemConfig<Bundle>\n /**\n * \u4F1A\u5458\u4EF7\n */\n memberDiscount: BenefitItemConfig\n /**\n * \u79EF\u5206\u62B5\u73B0\n */\n creditsRedemption: BenefitItemConfig\n /**\n * \u9AD8\u6807\u7269\u6D41\n */\n paidShipping: BenefitItemConfig\n\n /**\n * \u6EE1\u8D60\n */\n fullGift: BenefitItemConfig\n\n /**\n * \u6EE1\u51CF\u6298\u6263\n */\n levelDiscount: BenefitItemConfig\n}\n\n/**\n * \u5546\u54C1\u6743\u76CA\n * \u83B7\u53D6\u5F53\u524Dsku \u6240\u6709\u7684\u6743\u76CA\n * \u5305\u62EC \u901A\u7528\u4F18\u60E0\u5238\uFF0C\u4F1A\u5458\u4EF7\uFF0C\u6EE1\u51CF\uFF0C\u6346\u7ED1\u6298\u6263\uFF0C\u4E70\u8D60 \uFF0C\u6EE1\u8D60 \uFF0C\u79EF\u5206\u62B5\u73B0\n * @returns\n */\nexport const useBenefits = ({ variant }: BenefitsParams): BenefitsResult => {\n const { coupon, product, bundle, isLogin, freeGift, memberFunctionResult, creditsRedemptionAmount, discount } =\n useBizProductContext()\n const { codeSavings } = discount || {}\n\n const { trackingData } = useAiuiContext()\n\n const total = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n // \u9AD8\u6807\u7269\u6D41\n const showPaidShipping = Boolean(\n trackingData?.paidShipping &&\n variant.requiresShipping &&\n !variant?.metafields?.global?.presell &&\n !variant?.metafields?.global?.HideShipping\n )\n\n // \u811A\u672C\u6EE1\u8D60\n const fullGift = trackingData?.freeGift\n const excludeProducts =\n fullGift?.excludeProducts?.map((item: any) => (typeof item === 'object' && 'sku' in item ? item.sku : item)) ?? []\n\n const showLevelDiscount =\n trackingData?.levelDiscount && checkItemAvailableForProduct({ product, variant, item: trackingData?.levelDiscount })\n\n // \u672A\u767B\u5F55\u4E14code\u4F18\u60E0\u5C0F\u4E8E\u4F1A\u5458\u4EF7\u4F18\u60E0\u65F6\uFF0C\u5C55\u793A\u4F1A\u5458\u4EF7\u4F18\u60E0\n const showMemberDiscount = !isLogin && (codeSavings || 0) < (memberFunctionResult?.withCouponMemberTotalSave || 0)\n\n return {\n commonCoupon: {\n enable: Boolean(coupon),\n config: coupon ?? {},\n },\n freeGift: {\n enable: Boolean(freeGift) && !!freeGift?.giftList?.length,\n config: freeGift,\n },\n bundle: {\n enable:\n Boolean(bundle) &&\n !!bundle?.bundleList?.length &&\n Math.max(...bundle?.bundleList?.map(item => item.savings ?? 0)) > 0, // \u6709\u4F18\u60E0\u624D\u5C55\u793A\n config: bundle,\n },\n memberDiscount: {\n enable: showMemberDiscount,\n // enable: total > 0,\n config: {\n amount: total,\n description: memberFunctionResult?.labels?.find((item: any) => item.key === 'benefit_tab_string')?.value,\n },\n },\n creditsRedemption: {\n enable: Boolean(creditsRedemptionAmount) && creditsRedemptionAmount! > 0,\n config: { amount: creditsRedemptionAmount, label: trackingData?.creditsRedemptionLabel },\n },\n paidShipping: {\n enable: showPaidShipping,\n config: {},\n },\n fullGift: {\n enable: Boolean(fullGift && !excludeProducts.includes(variant.sku)),\n config: fullGift ?? {},\n },\n levelDiscount: {\n enable: Boolean(showLevelDiscount),\n config: trackingData?.levelDiscount ?? {},\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,wBAAAA,MAA4B,wBAErC,OAAS,gCAAAC,MAAoC,kBAE7C,OAAS,kBAAAC,MAAsB,8BAsDxB,MAAMC,EAAc,CAAC,CAAE,QAAAC,CAAQ,IAAsC,CAC1E,KAAM,CAAE,OAAAC,EAAQ,QAAAC,EAAS,OAAAC,EAAQ,QAAAC,EAAS,SAAAC,EAAU,qBAAAC,EAAsB,wBAAAC,EAAyB,SAAAC,CAAS,EAC1GZ,EAAqB,EACjB,CAAE,YAAAa,CAAY,EAAID,GAAY,CAAC,EAE/B,CAAE,aAAAE,CAAa,EAAIZ,EAAe,EAElCa,EAAQ,KAAK,IACjBL,GAAsB,2BAA6B,EACnDA,GAAsB,iCAAmC,CAC3D,EAGMM,EAAmB,GACvBF,GAAc,cACZV,EAAQ,kBACR,CAACA,GAAS,YAAY,QAAQ,SAC9B,CAACA,GAAS,YAAY,QAAQ,cAI5Ba,EAAWH,GAAc,SACzBI,EACJD,GAAU,iBAAiB,IAAKE,GAAe,OAAOA,GAAS,UAAY,QAASA,EAAOA,EAAK,IAAMA,CAAK,GAAK,CAAC,EAE7GC,EACJN,GAAc,eAAiBb,EAA6B,CAAE,QAAAK,EAAS,QAAAF,EAAS,KAAMU,GAAc,aAAc,CAAC,EAG/GO,EAAqB,CAACb,IAAYK,GAAe,IAAMH,GAAsB,2BAA6B,GAEhH,MAAO,CACL,aAAc,CACZ,OAAQ,EAAQL,EAChB,OAAQA,GAAU,CAAC,CACrB,EACA,SAAU,CACR,OAAQ,EAAQI,GAAa,CAAC,CAACA,GAAU,UAAU,OACnD,OAAQA,CACV,EACA,OAAQ,CACN,OACE,EAAQF,GACR,CAAC,CAACA,GAAQ,YAAY,QACtB,KAAK,IAAI,GAAGA,GAAQ,YAAY,IAAIY,GAAQA,EAAK,SAAW,CAAC,CAAC,EAAI,EACpE,OAAQZ,CACV,EACA,eAAgB,CACd,OAAQc,EAER,OAAQ,CACN,OAAQN,EACR,YAAaL,GAAsB,QAAQ,KAAMS,GAAcA,EAAK,MAAQ,oBAAoB,GAAG,KACrG,CACF,EACA,kBAAmB,CACjB,OAAQ,EAAQR,GAA4BA,EAA2B,EACvE,OAAQ,CAAE,OAAQA,EAAyB,MAAOG,GAAc,sBAAuB,CACzF,EACA,aAAc,CACZ,OAAQE,EACR,OAAQ,CAAC,CACX,EACA,SAAU,CACR,OAAQ,GAAQC,GAAY,CAACC,EAAgB,SAASd,EAAQ,GAAG,GACjE,OAAQa,GAAY,CAAC,CACvB,EACA,cAAe,CACb,OAAQ,EAAQG,EAChB,OAAQN,GAAc,eAAiB,CAAC,CAC1C,CACF,CACF",
|
|
6
|
+
"names": ["useBizProductContext", "checkItemAvailableForProduct", "useAiuiContext", "useBenefits", "variant", "coupon", "product", "bundle", "isLogin", "freeGift", "memberFunctionResult", "creditsRedemptionAmount", "discount", "codeSavings", "trackingData", "total", "showPaidShipping", "fullGift", "excludeProducts", "item", "showLevelDiscount", "showMemberDiscount"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import u from"copy-to-clipboard";import{useCallback as s,useEffect as n,useRef as i,useState as a}from"react";const f=()=>{const e=i(),[t,r]=a(!1),o=s(c=>{u(c),e.current&&clearTimeout(e.current),r(!0),e.current=setTimeout(()=>{r(!1)},2e3)},[]);return n(()=>()=>{e.current&&clearTimeout(e.current)},[]),{copy:o,copied:t}};var m=f;export{m as default};
|
|
2
|
+
//# sourceMappingURL=useCopy.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/Listing/hooks/useCopy.ts"],
|
|
4
|
+
"sourcesContent": ["import clipboard from 'copy-to-clipboard'\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\nconst useCopy = () => {\n const copyTimer = useRef<any>()\n const [copied, setCopied] = useState(false)\n\n const copy = useCallback((val: string) => {\n clipboard(val)\n\n if (copyTimer.current) {\n clearTimeout(copyTimer.current)\n }\n\n setCopied(true)\n copyTimer.current = setTimeout(() => {\n setCopied(false)\n }, 2000)\n }, [])\n\n useEffect(() => {\n return () => {\n if (copyTimer.current) {\n clearTimeout(copyTimer.current)\n }\n }\n }, [])\n\n return {\n copy,\n copied,\n }\n}\n\nexport default useCopy\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAe,oBACtB,OAAS,eAAAC,EAAa,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAEzD,MAAMC,EAAU,IAAM,CACpB,MAAMC,EAAYH,EAAY,EACxB,CAACI,EAAQC,CAAS,EAAIJ,EAAS,EAAK,EAEpCK,EAAOR,EAAaS,GAAgB,CACxCV,EAAUU,CAAG,EAETJ,EAAU,SACZ,aAAaA,EAAU,OAAO,EAGhCE,EAAU,EAAI,EACdF,EAAU,QAAU,WAAW,IAAM,CACnCE,EAAU,EAAK,CACjB,EAAG,GAAI,CACT,EAAG,CAAC,CAAC,EAEL,OAAAN,EAAU,IACD,IAAM,CACPI,EAAU,SACZ,aAAaA,EAAU,OAAO,CAElC,EACC,CAAC,CAAC,EAEE,CACL,KAAAG,EACA,OAAAF,CACF,CACF,EAEA,IAAOI,EAAQN",
|
|
6
|
+
"names": ["clipboard", "useCallback", "useEffect", "useRef", "useState", "useCopy", "copyTimer", "copied", "setCopied", "copy", "val", "useCopy_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as q}from"react/jsx-runtime";import{useAiuiContext as z}from"../AiuiProvider/index.js";import{PurchaseBar as G,ProductActions as L}from"./components/index.js";import O from"./BizProductProvider.js";import{ProductCard as T}from"./components/index.js";import{useMediaQuery as t}from"react-responsive";const i=({product:r,renderRating:n,variant:d,selectedOptions:c,setSelectedOptions:a,isLogin:j,finalPrice:s,coupon:p,comparePrice:l,totalSavings:m,savingDetail:u,freeGift:y,bundle:f,checkedBundle:P,checkedGift:v,setCheckedBundle:C,setCheckedGift:S,compareData:g,selectedVariants:h,onAddToCart:k,onBuyNow:B,openModal:N,setSavingDetail:x,openSignInPopup:I,openAuthCodePopup:A,renderAffirm:D,renderKlarna:b,renderPaypal:w})=>{const{locale:F}=z(),o=t({query:"(max-width: 768px)"}),M=t({query:"(min-width: 1440px)"});return e(O,{product:r,isMobile:o,isDesktop:M,freeGift:y,renderRating:n,finalPrice:s,comparePrice:l,totalSavings:m,savingDetail:u,variant:d,selectedOptions:c,setSelectedOptions:a,bundle:f,coupon:p,checkedBundle:P,checkedGift:v,setCheckedBundle:C,setCheckedGift:S,compareData:g,selectedVariants:h,onAddToCart:k,onBuyNow:B,openModal:N,setSavingDetail:x,openSignInPopup:I,openAuthCodePopup:A,renderAffirm:D,renderKlarna:b,renderPaypal:w,children:q("div",{id:"ipc-listing",children:[e(G,{onSpyNavItemClick:R=>{console.log(R)}}),o&&e("div",{className:"fixed bottom-0 left-0 w-full z-[60]",children:e(L,{})}),e(T,{})]})})};i.displayName="Listing";var U=i;export{U as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/Listing/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { PurchaseBar, ProductActions } from './components/index.js'\nimport type { ScrollSpyNavItem } from './components/PurchaseBar/types.js'\nimport BizProductProvider, { type ProductContextType } from './BizProductProvider.js'\nimport { ProductCard } from './components/index.js'\n\nimport { useMediaQuery } from 'react-responsive'\n\nconst Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>> = ({\n product,\n renderRating,\n variant,\n selectedOptions,\n setSelectedOptions,\n isLogin,\n finalPrice,\n coupon,\n comparePrice,\n totalSavings,\n savingDetail,\n freeGift,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n openModal,\n setSavingDetail,\n openSignInPopup,\n openAuthCodePopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n}) => {\n const { locale } = useAiuiContext()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isDesktop = useMediaQuery({ query: '(min-width: 1440px)' })\n\n const onSpyNavItemClick = (tab: ScrollSpyNavItem) => {\n console.log(tab)\n }\n\n return (\n <BizProductProvider\n product={product}\n isMobile={isMobile}\n isDesktop={isDesktop}\n freeGift={freeGift}\n renderRating={renderRating}\n finalPrice={finalPrice}\n comparePrice={comparePrice}\n totalSavings={totalSavings}\n savingDetail={savingDetail}\n variant={variant}\n selectedOptions={selectedOptions}\n setSelectedOptions={setSelectedOptions}\n bundle={bundle}\n coupon={coupon}\n checkedBundle={checkedBundle}\n checkedGift={checkedGift}\n setCheckedBundle={setCheckedBundle}\n setCheckedGift={setCheckedGift}\n compareData={compareData}\n selectedVariants={selectedVariants}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n openModal={openModal}\n setSavingDetail={setSavingDetail}\n openSignInPopup={openSignInPopup}\n openAuthCodePopup={openAuthCodePopup}\n renderAffirm={renderAffirm}\n renderKlarna={renderKlarna}\n renderPaypal={renderPaypal}\n >\n <div id=\"ipc-listing\">\n <PurchaseBar onSpyNavItemClick={onSpyNavItemClick} />\n {isMobile && (\n <div className=\"fixed bottom-0 left-0 w-full z-[60]\">\n <ProductActions />\n </div>\n )}\n <ProductCard />\n </div>\n </BizProductProvider>\n )\n}\n\nListing.displayName = 'Listing'\n\nexport default Listing\n"],
|
|
5
|
+
"mappings": "AA+EM,OACE,OAAAA,EADF,QAAAC,MAAA,oBA/EN,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,eAAAC,EAAa,kBAAAC,MAAsB,wBAE5C,OAAOC,MAAqD,0BAC5D,OAAS,eAAAC,MAAmB,wBAE5B,OAAS,iBAAAC,MAAqB,mBAE9B,MAAMC,EAA8G,CAAC,CACnH,QAAAC,EACA,aAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAO,EAAInC,EAAe,EAE5BoC,EAAW/B,EAAc,CAAE,MAAO,oBAAqB,CAAC,EACxDgC,EAAYhC,EAAc,CAAE,MAAO,qBAAsB,CAAC,EAMhE,OACEP,EAACK,EAAA,CACC,QAASI,EACT,SAAU6B,EACV,UAAWC,EACX,SAAUnB,EACV,aAAcV,EACd,WAAYK,EACZ,aAAcE,EACd,aAAcC,EACd,aAAcC,EACd,QAASR,EACT,gBAAiBC,EACjB,mBAAoBC,EACpB,OAAQQ,EACR,OAAQL,EACR,cAAeM,EACf,YAAaC,EACb,iBAAkBC,EAClB,eAAgBC,EAChB,YAAaC,EACb,iBAAkBC,EAClB,YAAaC,EACb,SAAUC,EACV,UAAWC,EACX,gBAAiBC,EACjB,gBAAiBC,EACjB,kBAAmBC,EACnB,aAAcC,EACd,aAAcC,EACd,aAAcC,EAEd,SAAAnC,EAAC,OAAI,GAAG,cACN,UAAAD,EAACG,EAAA,CAAY,kBArCQqC,GAA0B,CACnD,QAAQ,IAAIA,CAAG,CACjB,EAmCyD,EAClDF,GACCtC,EAAC,OAAI,UAAU,sCACb,SAAAA,EAACI,EAAA,EAAe,EAClB,EAEFJ,EAACM,EAAA,EAAY,GACf,EACF,CAEJ,EAEAE,EAAQ,YAAc,UAEtB,IAAOiC,EAAQjC",
|
|
6
|
+
"names": ["jsx", "jsxs", "useAiuiContext", "PurchaseBar", "ProductActions", "BizProductProvider", "ProductCard", "useMediaQuery", "Listing", "product", "renderRating", "variant", "selectedOptions", "setSelectedOptions", "isLogin", "finalPrice", "coupon", "comparePrice", "totalSavings", "savingDetail", "freeGift", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "compareData", "selectedVariants", "onAddToCart", "onBuyNow", "openModal", "setSavingDetail", "openSignInPopup", "openAuthCodePopup", "renderAffirm", "renderKlarna", "renderPaypal", "locale", "isMobile", "isDesktop", "tab", "Listing_default"]
|
|
7
|
+
}
|