@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
|
@@ -3,6 +3,10 @@ interface AiuiContextType {
|
|
|
3
3
|
trackingData: Record<string, any>;
|
|
4
4
|
locale?: string;
|
|
5
5
|
copyWriting?: Record<string, string>;
|
|
6
|
+
pathname?: string;
|
|
7
|
+
storeDomain?: string;
|
|
8
|
+
isLogin?: boolean;
|
|
9
|
+
currencyCode?: string;
|
|
6
10
|
}
|
|
7
11
|
export declare const AiuiContext: React.Context<AiuiContextType>;
|
|
8
12
|
export declare const useAiuiContext: () => AiuiContextType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var k=(n,e)=>{for(var o in e)p(n,o,{get:e[o],enumerable:!0})},x=(n,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of v(e))!A.call(n,t)&&t!==o&&p(n,t,{get:()=>e[t],enumerable:!(s=f(e,t))||s.enumerable});return n};var C=n=>x(p({},"__esModule",{value:!0}),n);var T={};k(T,{AiuiContext:()=>c,default:()=>P,useAiuiContext:()=>_});module.exports=C(T);var h=require("react/jsx-runtime"),g=require("../../shared/track.js"),r=require("react");const c=(0,r.createContext)({trackingData:{},locale:void 0,copyWriting:{}}),_=()=>{if(!(0,r.useContext)(c))throw new Error("useAiui must be used in <AiuiProvider>");return(0,r.useContext)(c)},E=({children:n,...e})=>((0,r.useEffect)(()=>{const o=(t,a)=>{const i={};if(!a||!a.attributes)return i;for(const y of Array.from(a.attributes)){const u=y?.name;u?.startsWith("data-headless-")&&(i[u]=a.getAttribute(u))}const b=i?.["data-headless-sku"],l=i?.["data-headless-type-name"]?.split?.("#"),d=i?.["data-headless-title-desc-button"]?.split?.("#"),m=i?.["data-headless-nav-postion"]?.split?.("#");(0,g.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:e?.trackingData?.pageGroup||"Home Page",component_type:l?.[0]||"",component_name:l?.[1]||"",position:m?.[1]||"",navigation:m?.[0]||"",button_name:d?.[2]||"",SKU:b||"",component_title:d?.[0]||"",component_description:d?.[1]||""}})},s=new MutationObserver(()=>{document.querySelectorAll("[data-headless-type-name]").forEach(t=>{t.hasAttribute("data-headless-track-bound")||(t.addEventListener("click",a=>o(a,t)),t.setAttribute("data-headless-track-bound","true"))})});return s.observe(document.body,{childList:!0,subtree:!0}),document.querySelectorAll("[data-headless-type-name]").forEach(t=>{t.hasAttribute("data-headless-track-bound")||(t.addEventListener("click",a=>o(a,t)),t.setAttribute("data-headless-track-bound","true"))}),()=>s.disconnect()},[]),(0,h.jsx)(c.Provider,{value:e,children:n}));var P=E;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/AiuiProvider/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { gaTrack } from '../../shared/track.js'\nimport React, { createContext, useContext, useEffect } from 'react'\n\ninterface AiuiContextType {\n trackingData: Record<string, any>\n locale?: string\n copyWriting?: Record<string, string>\n}\n\nexport const AiuiContext = createContext<AiuiContextType>({\n trackingData: {},\n locale: undefined,\n copyWriting: {},\n})\n\nexport const useAiuiContext = () => {\n const context = useContext(AiuiContext)\n if (!context) {\n throw new Error('useAiui must be used in <AiuiProvider>')\n }\n return useContext(AiuiContext)\n}\n\nconst AiuiProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & AiuiContextType) => {\n useEffect(() => {\n const handleTrackClick = (e: any, el: any) => {\n // e?.stopPropagation?.()\n const out: any = {}\n if (!el || !el.attributes) return out\n for (const attr of Array.from(el.attributes)) {\n const name = (attr as any)?.name\n if (name?.startsWith('data-headless-')) {\n out[name] = el.getAttribute(name)\n }\n }\n const sku = out?.['data-headless-sku']\n const nameType = out?.['data-headless-type-name']?.split?.('#')\n const titleDesc = out?.['data-headless-title-desc-button']?.split?.('#')\n const navPosition = out?.['data-headless-nav-postion']?.split?.('#')\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: rest?.trackingData?.pageGroup || 'Home Page',\n component_type: nameType?.[0] || '',\n component_name: nameType?.[1] || '',\n position: navPosition?.[1] || '',\n navigation: navPosition?.[0] || '',\n button_name: titleDesc?.[2] || '',\n SKU: sku || '',\n component_title: titleDesc?.[0] || '',\n component_description: titleDesc?.[1] || '',\n },\n })\n }\n const observer = new MutationObserver(() => {\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true') // \u907F\u514D\u91CD\u590D\u7ED1\u5B9A\n }\n })\n })\n observer.observe(document.body, { childList: true, subtree: true })\n // \u521D\u59CB\u5316\u4E00\u6B21\u73B0\u6709\u8282\u70B9\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true')\n }\n })\n return () => observer.disconnect()\n }, [])\n\n return <AiuiContext.Provider value={rest}>{children}</AiuiContext.Provider>\n}\n\nexport default AiuiProvider\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,YAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,
|
|
4
|
+
"sourcesContent": ["import { gaTrack } from '../../shared/track.js'\nimport React, { createContext, useContext, useEffect } from 'react'\n\ninterface AiuiContextType {\n trackingData: Record<string, any>\n locale?: string\n copyWriting?: Record<string, string>\n pathname?: string\n storeDomain?: string\n isLogin?: boolean\n currencyCode?: string\n}\n\nexport const AiuiContext = createContext<AiuiContextType>({\n trackingData: {},\n locale: undefined,\n copyWriting: {},\n})\n\nexport const useAiuiContext = () => {\n const context = useContext(AiuiContext)\n if (!context) {\n throw new Error('useAiui must be used in <AiuiProvider>')\n }\n return useContext(AiuiContext)\n}\n\nconst AiuiProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & AiuiContextType) => {\n useEffect(() => {\n const handleTrackClick = (e: any, el: any) => {\n // e?.stopPropagation?.()\n const out: any = {}\n if (!el || !el.attributes) return out\n for (const attr of Array.from(el.attributes)) {\n const name = (attr as any)?.name\n if (name?.startsWith('data-headless-')) {\n out[name] = el.getAttribute(name)\n }\n }\n const sku = out?.['data-headless-sku']\n const nameType = out?.['data-headless-type-name']?.split?.('#')\n const titleDesc = out?.['data-headless-title-desc-button']?.split?.('#')\n const navPosition = out?.['data-headless-nav-postion']?.split?.('#')\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: rest?.trackingData?.pageGroup || 'Home Page',\n component_type: nameType?.[0] || '',\n component_name: nameType?.[1] || '',\n position: navPosition?.[1] || '',\n navigation: navPosition?.[0] || '',\n button_name: titleDesc?.[2] || '',\n SKU: sku || '',\n component_title: titleDesc?.[0] || '',\n component_description: titleDesc?.[1] || '',\n },\n })\n }\n const observer = new MutationObserver(() => {\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true') // \u907F\u514D\u91CD\u590D\u7ED1\u5B9A\n }\n })\n })\n observer.observe(document.body, { childList: true, subtree: true })\n // \u521D\u59CB\u5316\u4E00\u6B21\u73B0\u6709\u8282\u70B9\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true')\n }\n })\n return () => observer.disconnect()\n }, [])\n\n return <AiuiContext.Provider value={rest}>{children}</AiuiContext.Provider>\n}\n\nexport default AiuiProvider\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,YAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,GAmFS,IAAAM,EAAA,6BAnFTC,EAAwB,iCACxBC,EAA4D,iBAYrD,MAAMN,KAAc,iBAA+B,CACxD,aAAc,CAAC,EACf,OAAQ,OACR,YAAa,CAAC,CAChB,CAAC,EAEYE,EAAiB,IAAM,CAElC,GAAI,IADY,cAAWF,CAAW,EAEpC,MAAM,IAAI,MAAM,wCAAwC,EAE1D,SAAO,cAAWA,CAAW,CAC/B,EAEMO,EAAe,CAAC,CACpB,SAAAC,EACA,GAAGC,CACL,QAGE,aAAU,IAAM,CACd,MAAMC,EAAmB,CAACC,EAAQC,IAAY,CAE5C,MAAMC,EAAW,CAAC,EAClB,GAAI,CAACD,GAAM,CAACA,EAAG,WAAY,OAAOC,EAClC,UAAWC,KAAQ,MAAM,KAAKF,EAAG,UAAU,EAAG,CAC5C,MAAMG,EAAQD,GAAc,KACxBC,GAAM,WAAW,gBAAgB,IACnCF,EAAIE,CAAI,EAAIH,EAAG,aAAaG,CAAI,EAEpC,CACA,MAAMC,EAAMH,IAAM,mBAAmB,EAC/BI,EAAWJ,IAAM,yBAAyB,GAAG,QAAQ,GAAG,EACxDK,EAAYL,IAAM,iCAAiC,GAAG,QAAQ,GAAG,EACjEM,EAAcN,IAAM,2BAA2B,GAAG,QAAQ,GAAG,KACnE,WAAQ,CACN,MAAO,WACP,WAAY,kBACZ,iBAAkB,CAChB,WAAYJ,GAAM,cAAc,WAAa,YAC7C,eAAgBQ,IAAW,CAAC,GAAK,GACjC,eAAgBA,IAAW,CAAC,GAAK,GACjC,SAAUE,IAAc,CAAC,GAAK,GAC9B,WAAYA,IAAc,CAAC,GAAK,GAChC,YAAaD,IAAY,CAAC,GAAK,GAC/B,IAAKF,GAAO,GACZ,gBAAiBE,IAAY,CAAC,GAAK,GACnC,sBAAuBA,IAAY,CAAC,GAAK,EAC3C,CACF,CAAC,CACH,EACME,EAAW,IAAI,iBAAiB,IAAM,CAC1C,SAAS,iBAAiB,2BAA2B,EAAE,QAAQR,GAAM,CAC9DA,EAAG,aAAa,2BAA2B,IAC9CA,EAAG,iBAAiB,QAASD,GAAKD,EAAiBC,EAAGC,CAAE,CAAC,EACzDA,EAAG,aAAa,4BAA6B,MAAM,EAEvD,CAAC,CACH,CAAC,EACD,OAAAQ,EAAS,QAAQ,SAAS,KAAM,CAAE,UAAW,GAAM,QAAS,EAAK,CAAC,EAElE,SAAS,iBAAiB,2BAA2B,EAAE,QAAQR,GAAM,CAC9DA,EAAG,aAAa,2BAA2B,IAC9CA,EAAG,iBAAiB,QAASD,GAAKD,EAAiBC,EAAGC,CAAE,CAAC,EACzDA,EAAG,aAAa,4BAA6B,MAAM,EAEvD,CAAC,EACM,IAAMQ,EAAS,WAAW,CACnC,EAAG,CAAC,CAAC,KAEE,OAACpB,EAAY,SAAZ,CAAqB,MAAOS,EAAO,SAAAD,EAAS,GAGtD,IAAOP,EAAQM",
|
|
6
6
|
"names": ["AiuiProvider_exports", "__export", "AiuiContext", "AiuiProvider_default", "useAiuiContext", "__toCommonJS", "import_jsx_runtime", "import_track", "import_react", "AiuiProvider", "children", "rest", "handleTrackClick", "e", "el", "out", "attr", "name", "sku", "nameType", "titleDesc", "navPosition", "observer"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React, { type Dispatch, type SetStateAction, type PropsWithChildren } from 'react';
|
|
2
|
+
import type { Product, ProductPrice, ProductVariant, VariantCoupon, Options, FreeGift, BundleListItem, Bundle } from './types/product';
|
|
3
|
+
import type { CompareData, DiscountData } from './types.js';
|
|
4
|
+
type Country = {
|
|
5
|
+
id?: number;
|
|
6
|
+
name?: string;
|
|
7
|
+
code?: string;
|
|
8
|
+
};
|
|
9
|
+
export type UserProfile = {
|
|
10
|
+
user_id: string;
|
|
11
|
+
email: string;
|
|
12
|
+
nick_name?: string;
|
|
13
|
+
full_name?: string;
|
|
14
|
+
first_name?: string;
|
|
15
|
+
last_name?: string;
|
|
16
|
+
dob?: string;
|
|
17
|
+
gender?: string;
|
|
18
|
+
phone_number?: string;
|
|
19
|
+
phone_account?: string;
|
|
20
|
+
country?: Country;
|
|
21
|
+
is_subscribe?: boolean;
|
|
22
|
+
avatar?: string;
|
|
23
|
+
can_change_password?: boolean;
|
|
24
|
+
invitation_code?: string;
|
|
25
|
+
phone_carrier?: string;
|
|
26
|
+
dob_programmed?: boolean;
|
|
27
|
+
activated?: boolean;
|
|
28
|
+
registed_at?: number;
|
|
29
|
+
activated_at?: number;
|
|
30
|
+
token?: string;
|
|
31
|
+
};
|
|
32
|
+
export type SavingDetail = {
|
|
33
|
+
coupon: number;
|
|
34
|
+
bundle: number;
|
|
35
|
+
member: number;
|
|
36
|
+
freeGift: number;
|
|
37
|
+
compare: number;
|
|
38
|
+
exchangePurchase: number;
|
|
39
|
+
};
|
|
40
|
+
type variantWithFinalPrice = ProductVariant & {
|
|
41
|
+
finalPrice?: ProductPrice;
|
|
42
|
+
};
|
|
43
|
+
export type FunctionMemberPriceResult = {
|
|
44
|
+
hasMemberPrice: boolean;
|
|
45
|
+
originalPrice: number;
|
|
46
|
+
withCouponMemberTotalSave: number;
|
|
47
|
+
withoutCouponMaxMemberTotalSave?: number;
|
|
48
|
+
labels: {
|
|
49
|
+
key: string;
|
|
50
|
+
value: string;
|
|
51
|
+
desc: string;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
export type ModalData = {
|
|
55
|
+
needClickAway?: boolean;
|
|
56
|
+
className?: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
content?: string;
|
|
59
|
+
domContent?: React.ReactNode;
|
|
60
|
+
};
|
|
61
|
+
export interface ProductContextType {
|
|
62
|
+
isLogin?: boolean;
|
|
63
|
+
isMobile?: boolean;
|
|
64
|
+
isDesktop?: boolean;
|
|
65
|
+
product: Product;
|
|
66
|
+
profile?: UserProfile;
|
|
67
|
+
variant: ProductVariant;
|
|
68
|
+
selectedVariants: Array<variantWithFinalPrice>;
|
|
69
|
+
renderRating?: React.ReactNode;
|
|
70
|
+
coupon?: VariantCoupon;
|
|
71
|
+
savingDetail: SavingDetail;
|
|
72
|
+
setSavingDetail: Dispatch<SetStateAction<SavingDetail>>;
|
|
73
|
+
finalPrice: number;
|
|
74
|
+
comparePrice: number;
|
|
75
|
+
totalSavings: number;
|
|
76
|
+
selectedOptions: Options;
|
|
77
|
+
setSelectedOptions: Dispatch<SetStateAction<Options>>;
|
|
78
|
+
freeGift?: FreeGift;
|
|
79
|
+
checkedGift?: ProductVariant;
|
|
80
|
+
setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>;
|
|
81
|
+
exchangePurchase?: FreeGift;
|
|
82
|
+
checkedExchangePurchase?: ProductVariant;
|
|
83
|
+
setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>;
|
|
84
|
+
checkedBundle?: BundleListItem;
|
|
85
|
+
setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>;
|
|
86
|
+
joinedRecommendBuyProducts: {
|
|
87
|
+
bundle?: BundleListItem;
|
|
88
|
+
gift?: ProductVariant;
|
|
89
|
+
exchange?: ProductVariant;
|
|
90
|
+
};
|
|
91
|
+
setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<{
|
|
92
|
+
bundle?: BundleListItem;
|
|
93
|
+
gift?: ProductVariant;
|
|
94
|
+
exchange?: ProductVariant;
|
|
95
|
+
}>>;
|
|
96
|
+
checkedCareBundle?: ProductVariant;
|
|
97
|
+
setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>;
|
|
98
|
+
bundle?: Bundle;
|
|
99
|
+
compareData?: CompareData['data'];
|
|
100
|
+
onAddToCart?: () => void;
|
|
101
|
+
onBuyNow?: () => void;
|
|
102
|
+
creditsRedemptionAmount?: number;
|
|
103
|
+
memberFunctionResult?: FunctionMemberPriceResult;
|
|
104
|
+
openModal: ({ title, content, domContent }: ModalData) => void;
|
|
105
|
+
openSignInPopup?: () => void;
|
|
106
|
+
openAuthCodePopup?: () => void;
|
|
107
|
+
openSignUpPopup?: () => void;
|
|
108
|
+
renderAffirm?: React.ReactNode;
|
|
109
|
+
renderKlarna?: React.ReactNode;
|
|
110
|
+
renderPaypal?: React.ReactNode;
|
|
111
|
+
onUseCouponChange?: (couponSaving: number) => void;
|
|
112
|
+
onUseMemberDiscountChange?: (memberSaving: number) => void;
|
|
113
|
+
discount?: DiscountData;
|
|
114
|
+
}
|
|
115
|
+
export declare const BizProductContext: React.Context<ProductContextType>;
|
|
116
|
+
export declare const useBizProductContext: () => ProductContextType;
|
|
117
|
+
declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemptionAmount, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderAffirm, renderKlarna, renderPaypal, onUseCouponChange, onUseMemberDiscountChange, discount, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts">>) => import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
export default ProductProvider;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var X=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},Y=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of H(e))!Q.call(t,n)&&n!==r&&c(t,n,{get:()=>e[n],enumerable:!(i=q(e,n))||i.enumerable});return t};var Z=t=>Y(c({},"__esModule",{value:!0}),t);var ne={};X(ne,{BizProductContext:()=>a,default:()=>te,useBizProductContext:()=>$});module.exports=Z(ne);var d=require("react/jsx-runtime"),o=require("react");const a=(0,o.createContext)({}),$=()=>{if(!(0,o.useContext)(a))throw new Error("useProductContext must be used in <ProductProvider>");return(0,o.useContext)(a)},ee=({product:t,isLogin:e,profile:r,isMobile:i,isDesktop:n,children:u,renderRating:s,freeGift:p,exchangePurchase:m,bundle:l,checkedBundle:P,checkedGift:b,setCheckedBundle:g,setCheckedGift:h,checkedExchangePurchase:C,setCheckedExchangePurchase:f,variant:v,selectedOptions:y,setSelectedOptions:S,compareData:x,coupon:D,finalPrice:B,comparePrice:R,totalSavings:V,savingDetail:_,setSavingDetail:k,selectedVariants:A,onAddToCart:M,onBuyNow:F,creditsRedemptionAmount:w,memberFunctionResult:G,openModal:I,openSignInPopup:L,openAuthCodePopup:N,openSignUpPopup:T,renderAffirm:O,renderKlarna:U,renderPaypal:W,onUseCouponChange:j,onUseMemberDiscountChange:z,discount:E})=>{const[J,K]=(0,o.useState)({bundle:void 0,gift:void 0});return(0,d.jsx)(a.Provider,{value:{product:t,variant:v,isMobile:i,isDesktop:n,isLogin:e,profile:r,coupon:D,renderRating:s,finalPrice:B,comparePrice:R,savingDetail:_,setSavingDetail:k,totalSavings:V,selectedOptions:y,setSelectedOptions:S,freeGift:p,exchangePurchase:m,checkedGift:b,setCheckedGift:h,checkedBundle:P,setCheckedBundle:g,bundle:l,compareData:x,selectedVariants:A,onAddToCart:M,onBuyNow:F,joinedRecommendBuyProducts:J,setJoinedRecommendBuyProducts:K,checkedExchangePurchase:C,setCheckedExchangePurchase:f,creditsRedemptionAmount:w,memberFunctionResult:G,openModal:I,openSignInPopup:L,openAuthCodePopup:N,openSignUpPopup:T,renderAffirm:O,renderKlarna:U,renderPaypal:W,onUseCouponChange:j,onUseMemberDiscountChange:z,discount:E},children:u})};var te=ee;
|
|
2
|
+
//# sourceMappingURL=BizProductProvider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/Listing/BizProductProvider.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = { coupon: number; bundle: number; member: number; freeGift: number; compare: number; exchangePurchase: number }\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: { bundle?: BundleListItem; gift?: ProductVariant; exchange?: ProductVariant }\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<{ bundle?: BundleListItem; gift?: ProductVariant, exchange?: ProductVariant }>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemptionAmount?: number\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderAffirm?: React.ReactNode\n renderKlarna?: React.ReactNode\n renderPaypal?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n}: PropsWithChildren<\n Omit<\n ProductContextType,\n | 'joinedRecommendBuyProducts'\n | 'setJoinedRecommendBuyProducts'\n >\n>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n }>({\n bundle: undefined,\n gift: undefined,\n })\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,EAAA,YAAAC,GAAA,yBAAAC,IAAA,eAAAC,EAAAL,IAiNI,IAAAM,EAAA,6BAjNJC,EAQO,iBAqIA,MAAML,KAAoB,iBAAkC,CAAC,CAAuB,EAE9EE,EAAuB,IAAM,CAExC,GAAI,IADY,cAAWF,CAAiB,EAE1C,MAAM,IAAI,MAAM,qDAAqD,EAEvE,SAAO,cAAWA,CAAiB,CACrC,EAEMM,GAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,wBAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,CACF,IAMM,CACJ,KAAM,CAACC,EAA4BC,CAA6B,KAAI,YAGjE,CACD,OAAQ,OACR,KAAM,MACR,CAAC,EAED,SACE,OAACjD,EAAkB,SAAlB,CACC,MAAO,CACL,QAAAO,EACA,QAAAgB,EACA,SAAAb,EACA,UAAAC,EACA,QAAAH,EACA,QAAAC,EACA,OAAAkB,EACA,aAAAd,EACA,WAAAe,EACA,aAAAC,EACA,aAAAE,EACA,gBAAAC,EACA,aAAAF,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAX,EACA,iBAAAC,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAU,EACA,iBAAAO,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAa,EACA,8BAAAC,EACA,wBAAA5B,EACA,2BAAAC,EACA,wBAAAc,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,CACF,EAEC,SAAAnC,EACH,CAEJ,EAEA,IAAOX,GAAQK",
|
|
6
|
+
"names": ["BizProductProvider_exports", "__export", "BizProductContext", "BizProductProvider_default", "useBizProductContext", "__toCommonJS", "import_jsx_runtime", "import_react", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemptionAmount", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderAffirm", "renderKlarna", "renderPaypal", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var a in e)n(t,a,{get:e[a],enumerable:!0})},g=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of c(e))!m.call(t,p)&&p!==a&&n(t,p,{get:()=>e[p],enumerable:!(i=d(e,p))||i.enumerable});return t};var u=t=>g(n({},"__esModule",{value:!0}),t);var h={};f(h,{default:()=>N});module.exports=u(h);var o=require("react/jsx-runtime"),l=require("../../../../components/index.js"),r=require("../../../AiuiProvider/index.js"),x=require("../../../../helpers/index.js");const v=t=>{const{className:e,setOpenShippingPolicyModal:a,metafields:i}=t,{trackingData:p}=(0,r.useAiuiContext)(),s=p?.common?.copywriting;return(0,o.jsxs)("div",{tabIndex:-1,className:(0,x.cn)("from-4.29% to-101.05% relative items-start gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl bg-gradient-to-r from-[rgba(215,245,254,0.24)] to-[rgba(215,245,254,0.80)] p-4 laptop:py-3 text-[#1F2021] md:py-[16px]","flex flex-col",e),children:[(0,o.jsxs)("div",{className:"flex w-full items-start justify-between",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-3 laptop:gap-2 lg-desktop:gap-4",children:[(0,o.jsx)(l.Text,{size:2,className:"text-[14px] laptop:text-[16px] lg-desktop:text-[18px]",children:"Learn about Express Shipping Policy"}),(0,o.jsx)(l.Text,{size:1,as:"p",className:"text-[12px] text-[#6D6D6F] laptop:text-[14px]",children:i?.loginBeforeCheckoutNote})]}),(0,o.jsx)(l.Button,{variant:"link",className:"hidden !p-0 whitespace-nowrap laptop:inline-flex",onClick:()=>{a(!0)},children:s?.learnMore})]}),(0,o.jsx)(l.Button,{variant:"link",className:"inline-flex p-0 laptop:hidden",onClick:()=>{a(!0)},children:s?.learnMore})]})};var N=v;
|
|
2
|
+
//# sourceMappingURL=LearnMore.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/LearnMore.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Text } from '../../../../components/index.js'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { cn } from '../../../../helpers/index.js'\n\nconst LearnMore = (props: any) => {\n const { className, setOpenShippingPolicyModal, metafields } = props\n const { trackingData } = useAiuiContext()\n const shopCommon = trackingData?.common?.copywriting\n\n return (\n <div\n tabIndex={-1}\n className={cn(\n 'from-4.29% to-101.05% relative items-start gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl bg-gradient-to-r from-[rgba(215,245,254,0.24)] to-[rgba(215,245,254,0.80)] p-4 laptop:py-3 text-[#1F2021] md:py-[16px]',\n 'flex flex-col',\n className\n )}\n >\n <div className=\"flex w-full items-start justify-between\">\n <div className=\"flex flex-col gap-3 laptop:gap-2 lg-desktop:gap-4\">\n <Text size={2} className=\"text-[14px] laptop:text-[16px] lg-desktop:text-[18px]\">\n Learn about Express Shipping Policy\n </Text>\n <Text size={1} as=\"p\" className=\"text-[12px] text-[#6D6D6F] laptop:text-[14px]\">\n {metafields?.loginBeforeCheckoutNote}\n </Text>\n </div>\n <Button\n variant=\"link\"\n className=\"hidden !p-0 whitespace-nowrap laptop:inline-flex\"\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n >\n {shopCommon?.learnMore}\n </Button>\n </div>\n\n <Button\n variant=\"link\"\n className=\"inline-flex p-0 laptop:hidden\"\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n >\n {shopCommon?.learnMore}\n </Button>\n </div>\n )\n}\n\nexport default LearnMore\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBQ,IAAAI,EAAA,6BAnBRC,EAA6B,2CAC7BC,EAA+B,0CAC/BC,EAAmB,wCAEnB,MAAMC,EAAaC,GAAe,CAChC,KAAM,CAAE,UAAAC,EAAW,2BAAAC,EAA4B,WAAAC,CAAW,EAAIH,EACxD,CAAE,aAAAI,CAAa,KAAI,kBAAe,EAClCC,EAAaD,GAAc,QAAQ,YAEzC,SACE,QAAC,OACC,SAAU,GACV,aAAW,MACT,6NACA,gBACAH,CACF,EAEA,qBAAC,OAAI,UAAU,0CACb,qBAAC,OAAI,UAAU,oDACb,oBAAC,QAAK,KAAM,EAAG,UAAU,wDAAwD,+CAEjF,KACA,OAAC,QAAK,KAAM,EAAG,GAAG,IAAI,UAAU,gDAC7B,SAAAE,GAAY,wBACf,GACF,KACA,OAAC,UACC,QAAQ,OACR,UAAU,mDACV,QAAS,IAAM,CACbD,EAA2B,EAAI,CACjC,EAEC,SAAAG,GAAY,UACf,GACF,KAEA,OAAC,UACC,QAAQ,OACR,UAAU,gCACV,QAAS,IAAM,CACbH,EAA2B,EAAI,CACjC,EAEC,SAAAG,GAAY,UACf,GACF,CAEJ,EAEA,IAAOZ,EAAQM",
|
|
6
|
+
"names": ["LearnMore_exports", "__export", "LearnMore_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_helpers", "LearnMore", "props", "className", "setOpenShippingPolicyModal", "metafields", "trackingData", "shopCommon"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const ShippingMethod: ({ item, index, active, toggleShipping, currencyCode, metafields, className, }: {
|
|
2
|
+
item: any;
|
|
3
|
+
index: number;
|
|
4
|
+
active: boolean;
|
|
5
|
+
toggleShipping: (item: any, index: number) => void;
|
|
6
|
+
currencyCode: string;
|
|
7
|
+
metafields: any;
|
|
8
|
+
className?: string;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default ShippingMethod;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var p in t)d(e,p,{get:t[p],enumerable:!0})},E=(e,t,p,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of y(t))!h.call(e,r)&&r!==p&&d(e,r,{get:()=>t[r],enumerable:!(n=v(t,r))||n.enumerable});return e};var k=e=>E(d({},"__esModule",{value:!0}),e);var D={};N(D,{default:()=>C});module.exports=k(D);var o=require("react/jsx-runtime"),x=require("../../utils/index.js"),s=require("../../../AiuiProvider/index.js"),l=require("../../../../components/index.js"),a=require("../../../../helpers/index.js"),m=require("./type.js");const w=({item:e,index:t,active:p,toggleShipping:n,currencyCode:r,metafields:c,className:b=""})=>{const{trackingData:u,locale:f="us"}=(0,s.useAiuiContext)(),g=u?.common?.copywriting;return(0,o.jsxs)("div",{role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&n(e,t)},className:(0,a.cn)("relative flex cursor-pointer items-center gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl border-[2px] border-[#E8E8E8] p-4 laptop:py-3 text-[#1F2021]",{"cursor-not-allowed opacity-60":e.disabled,"border-brand":p},b),onClick:()=>n(e,t),children:[(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(l.Text,{className:(0,a.cn)("text-[14px] font-bold leading-[1.4] laptop:text-[16px] lg-desktop:text-[18px]",{}),as:"p",html:e.title}),(0,o.jsx)(l.Text,{className:(0,a.cn)("mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F] laptop:text-[14px]",{}),as:"p",html:e.subtitle})]}),(0,o.jsx)(l.Text,{className:(0,a.cn)("relative text-xl font-bold",{}),as:"p",html:e.price?(0,x.formatPrice)({amount:e.price,currencyCode:r,locale:f,removeTrailingZeros:!0}):g?.free}),e.mode!==m.ShippingMethodMode.FREE&&(0,o.jsx)("div",{className:(0,a.cn)("absolute -right-[1px] -top-[1px] rounded-bl-[8px] rounded-tr-[8px] bg-brand px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white"),children:c?.memberOnly})]})};var C=w;
|
|
2
|
+
//# sourceMappingURL=ShippingMethod.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/ShippingMethod.tsx"],
|
|
4
|
+
"sourcesContent": ["import { formatPrice } from '../../utils/index.js'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { Text } from '../../../../components/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ShippingMethodMode } from './type.js'\n\nconst ShippingMethod = ({\n item,\n index,\n active,\n toggleShipping,\n currencyCode,\n metafields,\n className = '',\n}: {\n item: any\n index: number\n active: boolean\n toggleShipping: (item: any, index: number) => void\n currencyCode: string\n metafields: any\n className?: string\n}) => {\n const { trackingData, locale = 'us' } = useAiuiContext()\n const shopCommon = trackingData?.common?.copywriting\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n toggleShipping(item, index)\n }\n }}\n className={cn(\n 'relative flex cursor-pointer items-center gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl border-[2px] border-[#E8E8E8] p-4 laptop:py-3 text-[#1F2021]',\n {\n 'cursor-not-allowed opacity-60': item.disabled,\n 'border-brand': active,\n },\n className\n )}\n onClick={() => toggleShipping(item, index)}\n >\n <div className=\"relative\">\n <Text\n className={cn('text-[14px] font-bold leading-[1.4] laptop:text-[16px] lg-desktop:text-[18px]', {})}\n as=\"p\"\n html={item.title}\n />\n <Text\n className={cn('mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F] laptop:text-[14px]', {})}\n as=\"p\"\n html={item.subtitle}\n />\n </div>\n\n <Text\n className={cn('relative text-xl font-bold', {})}\n as=\"p\"\n html={\n item.price\n ? formatPrice({\n amount: item.price,\n currencyCode,\n locale,\n removeTrailingZeros: true,\n })\n : shopCommon?.free\n }\n />\n {item.mode !== ShippingMethodMode.FREE && (\n <div\n className={cn(\n 'absolute -right-[1px] -top-[1px] rounded-bl-[8px] rounded-tr-[8px] bg-brand px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white'\n )}\n >\n {metafields?.memberOnly}\n </div>\n )}\n </div>\n )\n}\n\nexport default ShippingMethod"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6CM,IAAAI,EAAA,6BA7CNC,EAA4B,gCAC5BC,EAA+B,0CAC/BC,EAAqB,2CACrBC,EAAmB,wCACnBC,EAAmC,qBAEnC,MAAMC,EAAiB,CAAC,CACtB,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,eAAAC,EACA,aAAAC,EACA,WAAAC,EACA,UAAAC,EAAY,EACd,IAQM,CACJ,KAAM,CAAE,aAAAC,EAAc,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACjDC,EAAaF,GAAc,QAAQ,YAEzC,SACE,QAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWG,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCP,EAAeH,EAAMC,CAAK,CAE9B,EACA,aAAW,MACT,kKACA,CACE,gCAAiCD,EAAK,SACtC,eAAgBE,CAClB,EACAI,CACF,EACA,QAAS,IAAMH,EAAeH,EAAMC,CAAK,EAEzC,qBAAC,OAAI,UAAU,WACb,oBAAC,QACC,aAAW,MAAG,gFAAiF,CAAC,CAAC,EACjG,GAAG,IACH,KAAMD,EAAK,MACb,KACA,OAAC,QACC,aAAW,MAAG,iFAAkF,CAAC,CAAC,EAClG,GAAG,IACH,KAAMA,EAAK,SACb,GACF,KAEA,OAAC,QACC,aAAW,MAAG,6BAA8B,CAAC,CAAC,EAC9C,GAAG,IACH,KACEA,EAAK,SACD,eAAY,CACV,OAAQA,EAAK,MACb,aAAAI,EACA,OAAAI,EACA,oBAAqB,EACvB,CAAC,EACDC,GAAY,KAEpB,EACCT,EAAK,OAAS,qBAAmB,SAChC,OAAC,OACC,aAAW,MACT,8IACF,EAEC,SAAAK,GAAY,WACf,GAEJ,CAEJ,EAEA,IAAOd,EAAQQ",
|
|
6
|
+
"names": ["ShippingMethod_exports", "__export", "ShippingMethod_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_AiuiProvider", "import_components", "import_helpers", "import_type", "ShippingMethod", "item", "index", "active", "toggleShipping", "currencyCode", "metafields", "className", "trackingData", "locale", "shopCommon", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface Terms {
|
|
2
|
+
text: string;
|
|
3
|
+
url: string;
|
|
4
|
+
}
|
|
5
|
+
interface List {
|
|
6
|
+
title: string;
|
|
7
|
+
list: string[];
|
|
8
|
+
}
|
|
9
|
+
interface ShippingService {
|
|
10
|
+
title: string;
|
|
11
|
+
list: List[];
|
|
12
|
+
}
|
|
13
|
+
interface Data {
|
|
14
|
+
title: string;
|
|
15
|
+
shippingCoupon: List;
|
|
16
|
+
shippingService: ShippingService;
|
|
17
|
+
terms: Terms;
|
|
18
|
+
}
|
|
19
|
+
interface Props {
|
|
20
|
+
data: Data;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
open: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const ShippingPolicyModal: ({ data, onClose, open }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var u=(t,i)=>{for(var p in i)m(t,p,{get:i[p],enumerable:!0})},N=(t,i,p,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of v(i))!h.call(t,s)&&s!==p&&m(t,s,{get:()=>i[s],enumerable:!(o=f(i,s))||o.enumerable});return t};var b=t=>N(m({},"__esModule",{value:!0}),t);var D={};u(D,{ShippingPolicyModal:()=>w});module.exports=b(D);var e=require("react/jsx-runtime"),l=require("../../../../components/index.js"),r=require("../../../../components/dialog"),g=require("next/router"),x=require("react");const w=({data:t,onClose:i,open:p})=>{const{asPath:o}=(0,g.useRouter)(),s=(0,x.useMemo)(()=>o?.split("?")?.[0]?.substring(1)?.replace(/\//g,"_"),[o]);return(0,e.jsx)(r.Dialog,{open:p,onOpenChange:i,children:(0,e.jsxs)(r.DialogContent,{overlayClassName:"z-[70]",className:"tablet:max-w-[729px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden",children:[(0,e.jsx)(l.Text,{className:"text-[32px] font-bold leading-[1.2] md:text-[20px]",html:t?.title}),(0,e.jsxs)("div",{className:"mt-[16px]",children:[(0,e.jsx)(l.Text,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:t?.shippingCoupon?.title}),(0,e.jsx)("ul",{className:"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]",children:t?.shippingCoupon?.list.map((a,n)=>(0,e.jsxs)("li",{className:"text-[16px]",children:[(0,e.jsxs)("span",{children:[n+1,"."]}),(0,e.jsx)("span",{className:"ml-[4px]",children:a})]},n))}),(0,e.jsxs)("div",{className:"mt-[24px] md:mt-[16px]",children:[(0,e.jsx)(l.Text,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:t?.shippingService?.title}),(0,e.jsx)("div",{className:"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1",children:t?.shippingService?.list.map((a,n)=>(0,e.jsxs)("div",{className:"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]",children:[(0,e.jsx)(l.Text,{as:"p",className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:a.title}),(0,e.jsx)("div",{className:"mt-[12px] grid grid-flow-row gap-[4px]",children:a.list.map((d,c)=>(0,e.jsx)(l.Text,{as:"p",className:"text-[16px] font-semibold leading-[1.2]",children:d},c))})]},n))})]}),(0,e.jsx)(l.Link,{className:"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline",href:`${t?.terms?.url}?ref=${s}`,children:t?.terms?.text})]})]})})};
|
|
2
|
+
//# sourceMappingURL=ShippingPolicyModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Link } from '../../../../components/index.js'\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../../../../components/dialog'\nimport { useRouter } from 'next/router'\nimport { useMemo } from 'react'\n\ninterface Terms {\n text: string\n url: string\n}\n\ninterface List {\n title: string\n list: string[]\n}\n\ninterface ShippingService {\n title: string\n list: List[]\n}\n\ninterface Data {\n title: string\n shippingCoupon: List\n shippingService: ShippingService\n terms: Terms\n}\n\ninterface Props {\n data: Data\n onClose: () => void\n open: boolean\n}\n\nexport const ShippingPolicyModal = ({ data, onClose, open }: Props) => {\n const { asPath } = useRouter()\n const ref = useMemo(() => {\n return asPath?.split('?')?.[0]?.substring(1)?.replace(/\\//g, '_')\n }, [asPath])\n return (\n <Dialog open={open} onOpenChange={onClose}>\n <DialogContent overlayClassName=\"z-[70]\" className=\"tablet:max-w-[729px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden\">\n <Text className=\"text-[32px] font-bold leading-[1.2] md:text-[20px]\" html={data?.title} />\n <div className=\"mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingCoupon?.title} />\n <ul className=\"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]\">\n {data?.shippingCoupon?.list.map((item, index) => (\n <li className=\"text-[16px]\" key={index}>\n <span>{index + 1}.</span>\n <span className=\"ml-[4px]\">{item}</span>\n </li>\n ))}\n </ul>\n <div className=\"mt-[24px] md:mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingService?.title} />\n <div className=\"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1\">\n {data?.shippingService?.list.map((item, index) => (\n <div className=\"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]\" key={index}>\n <Text as=\"p\" className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={item.title} />\n <div className=\"mt-[12px] grid grid-flow-row gap-[4px]\">\n {item.list.map((subItem, subIndex) => (\n <Text as=\"p\" className=\"text-[16px] font-semibold leading-[1.2]\" key={subIndex}>\n {subItem}\n </Text>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n\n <Link\n className=\"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline\"\n href={`${data?.terms?.url}?ref=${ref}`}\n >\n {data?.terms?.text}\n </Link>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAyCQ,IAAAI,EAAA,6BAzCRC,EAA2B,2CAC3BC,EAAgF,yCAChFC,EAA0B,uBAC1BC,EAAwB,iBA8BjB,MAAMN,EAAsB,CAAC,CAAE,KAAAO,EAAM,QAAAC,EAAS,KAAAC,CAAK,IAAa,CACrE,KAAM,CAAE,OAAAC,CAAO,KAAI,aAAU,EACvBC,KAAM,WAAQ,IACXD,GAAQ,MAAM,GAAG,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,QAAQ,MAAO,GAAG,EAC/D,CAACA,CAAM,CAAC,EACX,SACE,OAAC,UAAO,KAAMD,EAAM,aAAcD,EAChC,oBAAC,iBAAc,iBAAiB,SAAS,UAAU,uFACjD,oBAAC,QAAK,UAAU,qDAAqD,KAAMD,GAAM,MAAO,KACxF,QAAC,OAAI,UAAU,YACb,oBAAC,QAAK,UAAU,qDAAqD,KAAMA,GAAM,gBAAgB,MAAO,KACxG,OAAC,MAAG,UAAU,gEACX,SAAAA,GAAM,gBAAgB,KAAK,IAAI,CAACK,EAAMC,OACrC,QAAC,MAAG,UAAU,cACZ,qBAAC,QAAM,UAAAA,EAAQ,EAAE,KAAC,KAClB,OAAC,QAAK,UAAU,WAAY,SAAAD,EAAK,IAFFC,CAGjC,CACD,EACH,KACA,QAAC,OAAI,UAAU,yBACb,oBAAC,QAAK,UAAU,qDAAqD,KAAMN,GAAM,iBAAiB,MAAO,KACzG,OAAC,OAAI,UAAU,8DACZ,SAAAA,GAAM,iBAAiB,KAAK,IAAI,CAACK,EAAMC,OACtC,QAAC,OAAI,UAAU,mDACb,oBAAC,QAAK,GAAG,IAAI,UAAU,qDAAqD,KAAMD,EAAK,MAAO,KAC9F,OAAC,OAAI,UAAU,yCACZ,SAAAA,EAAK,KAAK,IAAI,CAACE,EAASC,OACvB,OAAC,QAAK,GAAG,IAAI,UAAU,0CACpB,SAAAD,GADmEC,CAEtE,CACD,EACH,IARqEF,CASvE,CACD,EACH,GACF,KAEA,OAAC,QACC,UAAU,oEACV,KAAM,GAAGN,GAAM,OAAO,GAAG,QAAQI,CAAG,GAEnC,SAAAJ,GAAM,OAAO,KAChB,GACF,GACF,EACF,CAEJ",
|
|
6
|
+
"names": ["ShippingPolicyModal_exports", "__export", "ShippingPolicyModal", "__toCommonJS", "import_jsx_runtime", "import_components", "import_dialog", "import_router", "import_react", "data", "onClose", "open", "asPath", "ref", "item", "index", "subItem", "subIndex"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Product, ProductVariant } from '../../types/product';
|
|
2
|
+
import type { DeliveryCustom } from './type';
|
|
3
|
+
declare const PaidShipping: ({ metafields, productList, onShippingInfoChange, variant, className, }: {
|
|
4
|
+
metafields: any;
|
|
5
|
+
productList: Array<Product & {
|
|
6
|
+
variant: ProductVariant;
|
|
7
|
+
}>;
|
|
8
|
+
variant: ProductVariant;
|
|
9
|
+
onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default PaidShipping;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var L=Object.create;var y=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var B=(i,p)=>{for(var n in p)y(i,n,{get:p[n],enumerable:!0})},T=(i,p,n,d)=>{if(p&&typeof p=="object"||typeof p=="function")for(let l of W(p))!$.call(i,l)&&l!==n&&y(i,l,{get:()=>p[l],enumerable:!(d=V(p,l))||d.enumerable});return i};var P=(i,p,n)=>(n=i!=null?L(F(i)):{},T(p||!i||!i.__esModule?y(n,"default",{value:i,enumerable:!0}):n,i)),j=i=>T(y({},"__esModule",{value:!0}),i);var H={};B(H,{default:()=>G});module.exports=j(H);var r=require("react/jsx-runtime"),x=require("../../../../components/index.js"),o=require("react"),_=require("../../../../helpers"),w=P(require("./ShippingMethod")),C=require("./ShippingPolicyModal"),M=require("./utils"),k=P(require("./LearnMore")),N=require("../../BizProductProvider.js");const q=({metafields:i,productList:p,onShippingInfoChange:n,variant:d,className:l})=>{const{isLogin:A,openSignInPopup:O}=(0,N.useBizProductContext)(),[z,S]=(0,o.useState)(!1),[f,D]=(0,o.useState)(!1),[E,b]=(0,o.useState)(null),v=(0,o.useMemo)(()=>p.reduce((e,t)=>e+(t?.variant?.weight||0),0),[p]),c=(0,o.useCallback)((e,t,s)=>({id:`${e.__code}__${e.price}`,code:e.__code,mode:e.__mode,title:e.title,disabled:!(0,M.isWeightAvailable)(t,e),price:e.price,subtitle:e.subtitle,tag:s!==0?i?.memberOnly:"",error:(0,M.isWeightAvailable)(t,e)?"":i.overWeightError}),[i?.memberOnly,i.overWeightError]),h=(0,o.useMemo)(()=>{const e=i?.list?.map((t,s)=>c(t,v,s));return e?.reduce((t,s)=>{const m=e.filter(a=>a.code==s.code);let u;return m.every(a=>a.disabled)?u=m[m.length-1]:u=m.find(a=>!a.disabled),t.find(a=>u.id===a.id)?t:[...t,u]},[])},[c,i?.list,v]),g=(0,o.useCallback)(e=>{n({selected_delivery_code:e.code,selected_delivery_mode:e.mode})},[n]);(0,o.useEffect)(()=>{if(i?.list?.length>0&&!f){const e=c(i?.list[0],0,0);b(e),g(e),D(!0)}},[c,i?.list,g,f]);const I=(0,o.useCallback)(e=>{e.disabled||(b(e),g(e))},[A,h,d.sku,g,O]);return(0,r.jsxs)("div",{id:"ipc-product-paid-shipping",className:(0,_.cn)(" mt-8 desktop:mt-16 px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0",l),children:[(0,r.jsx)("div",{className:"flex flex-wrap justify-between space-x-2 md:space-x-1",children:(0,r.jsx)(x.Text,{className:"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]",html:i?.title})}),(0,r.jsxs)("div",{className:"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap",children:[h.map((e,t)=>(0,r.jsx)(w.default,{index:t,item:e,active:E?.code===e.code,toggleShipping:()=>I(e),currencyCode:d.price.currencyCode,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:flex-1"},t)),(0,r.jsx)(k.default,{setOpenShippingPolicyModal:S,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]"})]}),h.find(e=>e?.error)&&(0,r.jsx)(x.Text,{className:"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]",html:h.find(e=>e.error)?.error,as:"p"}),i?.seeAvailableArea&&(0,r.jsx)(x.Text,{as:"div",className:"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline",html:i?.seeAvailableArea}),i?.shippingPolicy&&(0,r.jsx)(C.ShippingPolicyModal,{data:i?.shippingPolicy,onClose:()=>S(!1),open:z})]})};var G=q;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Container, Text } from '../../../../components/index.js'\nimport type { Product, ProductVariant } from '../../types/product'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { cn } from '../../../../helpers'\n\nimport ShippingMethod from './ShippingMethod'\nimport { ShippingPolicyModal } from './ShippingPolicyModal'\nimport type { DeliveryCustom, shippingMetafields, ShippingMethodType } from './type'\nimport { isWeightAvailable } from './utils'\nimport LearnMore from './LearnMore'\nimport { useBizProductContext } from '../../BizProductProvider.js'\n\nconst PaidShipping = ({\n metafields,\n productList,\n onShippingInfoChange,\n variant,\n className,\n}: {\n metafields: any\n productList: Array<Product & { variant: ProductVariant }>\n variant: ProductVariant\n onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void\n className?: string\n}) => {\n const { isLogin, openSignInPopup } = useBizProductContext()\n const [openShippingPolicyModal, setOpenShippingPolicyModal] = useState(false)\n const [init, setInit] = useState(false)\n\n const [selectedMethod, setSelectedMethod] = useState<ShippingMethodType | null>(null)\n\n const weight = useMemo(() => {\n return productList.reduce((acc, product) => acc + (product?.variant?.weight || 0), 0)\n }, [productList])\n\n const normalizedMethod = useCallback(\n (method: shippingMetafields, weight: number, index: number) => {\n return {\n id: `${method.__code}__${method.price}`,\n code: method.__code,\n mode: method.__mode,\n title: method.title,\n disabled: !isWeightAvailable(weight, method),\n price: method.price,\n subtitle: method.subtitle,\n tag: index !== 0 ? metafields?.memberOnly : '',\n error: !isWeightAvailable(weight, method) ? metafields.overWeightError : '',\n }\n },\n [metafields?.memberOnly, metafields.overWeightError],\n )\n\n const list = useMemo(() => {\n const normalizedList: ShippingMethodType[] = metafields?.list?.map((method: shippingMetafields, index: number) => normalizedMethod(method, weight, index))\n\n return normalizedList?.reduce((prev: ShippingMethodType[], method: ShippingMethodType) => {\n // \u5982\u679C\u8D85\u91CD\uFF0C\u540C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\u7C7B\u578B\u4E0B\uFF0C\u5C55\u793A\u5176\u4E2D\u4E00\u4E2A\u4E14\u4E0D\u53EF\u9009\n const sameTypeMethod = normalizedList.filter((m: ShippingMethodType) => m.code == method.code)\n let availableMethod: ShippingMethodType\n // \u6240\u6709\u7269\u6D41\u9009\u9879\u90FD\u4E0D\u53EF\u9009\n if (sameTypeMethod.every((m: ShippingMethodType) => m.disabled)) {\n availableMethod = sameTypeMethod[sameTypeMethod.length - 1]\n } else {\n // \u53EF\u9009\u7269\u6D41\u9009\u9879\n availableMethod = sameTypeMethod.find((m: ShippingMethodType) => !m.disabled)!\n }\n // \u5F53\u524D\u7269\u6D41\u9009\u9879\u5DF2\u5B58\u5728\n const hasSameMethod = prev.find((m: ShippingMethodType) => availableMethod.id === m.id)\n if (!hasSameMethod) {\n return [...prev, availableMethod]\n } else {\n return prev\n }\n }, [] as ShippingMethodType[])\n }, [normalizedMethod, metafields?.list, weight])\n\n const handleChangeShippingInfo = useCallback(\n (selectedMethod: ShippingMethodType) => {\n onShippingInfoChange({\n selected_delivery_code: selectedMethod.code,\n selected_delivery_mode: selectedMethod.mode,\n })\n },\n [onShippingInfoChange],\n )\n\n useEffect(() => {\n // \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\n if (metafields?.list?.length > 0 && !init) {\n const standardShippingMethod = normalizedMethod(metafields?.list[0], 0, 0)\n setSelectedMethod(standardShippingMethod)\n handleChangeShippingInfo(standardShippingMethod)\n setInit(true)\n }\n }, [normalizedMethod, metafields?.list, handleChangeShippingInfo, init])\n\n const toggleShipping = useCallback(\n (method: ShippingMethodType) => {\n if (method.disabled) {\n return\n }\n setSelectedMethod(method)\n handleChangeShippingInfo(method)\n // gaTrack({\n // event: 'ga4Event',\n // event_name: 'lp_button',\n // member_active_status: isLogin ? 'active' : 'not active', //\u7528\u4E8E\u8F93\u5165code\u6FC0\u6D3B\u4F1A\u5458\u5F39'\u7A97\u7684\u6309\u94AE\uFF0C\u533A\u5206\u4F1A\u5458\u6FC0\u6D3B\u72B6\u6001\uFF0C\u4F20active\u6216not active\n // event_parameters: {\n // page_group: 'Product Detail Page' + variant.sku, //\u5982\u679C\u662F\u9996\u9875\uFF0C\u5219\u4F20\"Home Page\";\u5982\u679C\u662Flisting\u7684\u9996\u5C4F\u6309\u94AE\uFF0C\u4F20Product Detail Page+$SKU\n // position: 'masterbanner1', //\u4F4D\u7F6E\u6807\u8BB0\u3002\u9996\u9875\u9996\u5C4F\u8F6E\u64AD\u4F4D\u7F6E\u4F20masterbanner1\u3001masterbanner2\u3001masterbanner3\uFF0C\u7B2C\u4E8C\u5C4F\u4F202nd_banner\uFF0C\u7B2C\u4E09\u5C4F\u4F203rd_banner\uFF0C\u6216\u8005\u53D6\u8BE5\u6A21\u5757\u5C0F\u6807\u9898\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6A21\u5757\u4F4D\u7F6E\u7684\u6587\u6848\uFF0C\u5F39\u7A97\u4F20pop;\u5982\u679C\u662F\u8D2D\u7269\u8F66\u4FA7\u8FB9\u680F\uFF0C\u5219\u4F20\"Cart Pop Up\"\n // button_name: method.title, //\u53D6\u6309\u94AE\u6587\u6848\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6309\u94AE\u7684\u6587\u6848,\u6BD4\u5982\u53F3\u4E0A\u89D2\u5173\u95ED\u4F20close,\u793E\u5A92\u5206\u4EAB\u56FE\u6807\u4F20\u5BF9\u5E94\u5E73\u53F0\u540D\u5B57\u5982Facebook,\u56FE\u7247\u5207\u6362\u5219\u4F20\u5BF9\u5E94\u5C55\u793A\u56FE\u7247\u7684\u540D\u5B57\n // info: '', //\u9ED8\u8BA4\u7A7A\u503C\uFF0C\u4E00\u822C\u4F20\u590D\u9009\u6846\u7684\u6587\u6848\u5185\u5BB9\uFF0C\u7279\u6B8A\u60C5\u51B5\u53EF\u6307\u5B9Ainfo\u503C\n // },\n // })\n },\n\n [isLogin, list, variant.sku, handleChangeShippingInfo, openSignInPopup],\n )\n\n return (\n <div\n id=\"ipc-product-paid-shipping\"\n className={cn(' mt-8 desktop:mt-16 px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0', className)}\n >\n <div className=\"flex flex-wrap justify-between space-x-2 md:space-x-1\">\n <Text\n className=\"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]\"\n html={metafields?.title}\n ></Text>\n {/* <button\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n className='text-brand-color text-[16px] font-semibold text-[#595959] underline md:text-[14px]'\n >\n {metafields?.policy}\n </button> */}\n </div>\n <div className=\"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap\">\n {list.map((method: ShippingMethodType, index: number) => (\n <ShippingMethod\n key={index}\n index={index}\n item={method}\n active={selectedMethod?.code === method.code}\n toggleShipping={() => toggleShipping(method)}\n currencyCode={variant.price.currencyCode}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:flex-1\"\n />\n ))}\n {/* learn more \u5361\u7247 */}\n <LearnMore\n setOpenShippingPolicyModal={setOpenShippingPolicyModal}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]\"\n />\n </div>\n {list.find((method: ShippingMethodType) => method?.error) && (\n <Text\n className=\"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]\"\n html={list.find((method: ShippingMethodType) => method.error)?.error as string}\n as=\"p\"\n />\n )}\n\n {metafields?.seeAvailableArea && (\n <Text\n as=\"div\"\n className=\"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline\"\n html={metafields?.seeAvailableArea}\n />\n )}\n {metafields?.shippingPolicy && (\n <ShippingPolicyModal\n data={metafields?.shippingPolicy}\n onClose={() => setOpenShippingPolicyModal(false)}\n open={openShippingPolicyModal}\n />\n )}\n </div>\n )\n}\n\nexport default PaidShipping"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6HQ,IAAAI,EAAA,6BA7HRC,EAAgC,2CAEhCC,EAA0D,iBAC1DC,EAAmB,+BAEnBC,EAA2B,+BAC3BC,EAAoC,iCAEpCC,EAAkC,mBAClCC,EAAsB,0BACtBC,EAAqC,uCAErC,MAAMC,EAAe,CAAC,CACpB,WAAAC,EACA,YAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,UAAAC,CACF,IAMM,CACJ,KAAM,CAAE,QAAAC,EAAS,gBAAAC,CAAgB,KAAI,wBAAqB,EACpD,CAACC,EAAyBC,CAA0B,KAAI,YAAS,EAAK,EACtE,CAACC,EAAMC,CAAO,KAAI,YAAS,EAAK,EAEhC,CAACC,EAAgBC,CAAiB,KAAI,YAAoC,IAAI,EAE9EC,KAAS,WAAQ,IACdZ,EAAY,OAAO,CAACa,EAAKC,IAAYD,GAAOC,GAAS,SAAS,QAAU,GAAI,CAAC,EACnF,CAACd,CAAW,CAAC,EAEVe,KAAmB,eACvB,CAACC,EAA4BJ,EAAgBK,KACpC,CACL,GAAI,GAAGD,EAAO,MAAM,KAAKA,EAAO,KAAK,GACrC,KAAMA,EAAO,OACb,KAAMA,EAAO,OACb,MAAOA,EAAO,MACd,SAAU,IAAC,qBAAkBJ,EAAQI,CAAM,EAC3C,MAAOA,EAAO,MACd,SAAUA,EAAO,SACjB,IAAKC,IAAU,EAAIlB,GAAY,WAAa,GAC5C,SAAQ,qBAAkBa,EAAQI,CAAM,EAAiC,GAA7BjB,EAAW,eACzD,GAEF,CAACA,GAAY,WAAYA,EAAW,eAAe,CACrD,EAEMmB,KAAO,WAAQ,IAAM,CACzB,MAAMC,EAAuCpB,GAAY,MAAM,IAAI,CAACiB,EAA4BC,IAAkBF,EAAiBC,EAAQJ,EAAQK,CAAK,CAAC,EAEzJ,OAAOE,GAAgB,OAAO,CAACC,EAA4BJ,IAA+B,CAExF,MAAMK,EAAiBF,EAAe,OAAQG,GAA0BA,EAAE,MAAQN,EAAO,IAAI,EAC7F,IAAIO,EAUJ,OARIF,EAAe,MAAOC,GAA0BA,EAAE,QAAQ,EAC5DC,EAAkBF,EAAeA,EAAe,OAAS,CAAC,EAG1DE,EAAkBF,EAAe,KAAMC,GAA0B,CAACA,EAAE,QAAQ,EAGxDF,EAAK,KAAME,GAA0BC,EAAgB,KAAOD,EAAE,EAAE,EAI7EF,EAFA,CAAC,GAAGA,EAAMG,CAAe,CAIpC,EAAG,CAAC,CAAyB,CAC/B,EAAG,CAACR,EAAkBhB,GAAY,KAAMa,CAAM,CAAC,EAEzCY,KAA2B,eAC9Bd,GAAuC,CACtCT,EAAqB,CACnB,uBAAwBS,EAAe,KACvC,uBAAwBA,EAAe,IACzC,CAAC,CACH,EACA,CAACT,CAAoB,CACvB,KAEA,aAAU,IAAM,CAEd,GAAIF,GAAY,MAAM,OAAS,GAAK,CAACS,EAAM,CACzC,MAAMiB,EAAyBV,EAAiBhB,GAAY,KAAK,CAAC,EAAG,EAAG,CAAC,EACzEY,EAAkBc,CAAsB,EACxCD,EAAyBC,CAAsB,EAC/ChB,EAAQ,EAAI,CACd,CACF,EAAG,CAACM,EAAkBhB,GAAY,KAAMyB,EAA0BhB,CAAI,CAAC,EAEvE,MAAMkB,KAAiB,eACpBV,GAA+B,CAC1BA,EAAO,WAGXL,EAAkBK,CAAM,EACxBQ,EAAyBR,CAAM,EAYjC,EAEA,CAACZ,EAASc,EAAMhB,EAAQ,IAAKsB,EAA0BnB,CAAe,CACxE,EAEA,SACE,QAAC,OACC,GAAG,4BACH,aAAW,MAAG,6EAA8EF,CAAS,EAErG,oBAAC,OAAI,UAAU,wDACb,mBAAC,QACC,UAAU,oEACV,KAAMJ,GAAY,MACnB,EASH,KACA,QAAC,OAAI,UAAU,uFACZ,UAAAmB,EAAK,IAAI,CAACF,EAA4BC,OACrC,OAAC,EAAAU,QAAA,CAEC,MAAOV,EACP,KAAMD,EACN,OAAQN,GAAgB,OAASM,EAAO,KACxC,eAAgB,IAAMU,EAAeV,CAAM,EAC3C,aAAcd,EAAQ,MAAM,aAC5B,WAAYH,EACZ,UAAU,kDAPLkB,CAQP,CACD,KAED,OAAC,EAAAW,QAAA,CACC,2BAA4BrB,EAC5B,WAAYR,EACZ,UAAU,iGACZ,GACF,EACCmB,EAAK,KAAMF,GAA+BA,GAAQ,KAAK,MACtD,OAAC,QACC,UAAU,gEACV,KAAME,EAAK,KAAMF,GAA+BA,EAAO,KAAK,GAAG,MAC/D,GAAG,IACL,EAGDjB,GAAY,qBACX,OAAC,QACC,GAAG,MACH,UAAU,wFACV,KAAMA,GAAY,iBACpB,EAEDA,GAAY,mBACX,OAAC,uBACC,KAAMA,GAAY,eAClB,QAAS,IAAMQ,EAA2B,EAAK,EAC/C,KAAMD,EACR,GAEJ,CAEJ,EAEA,IAAOnB,EAAQW",
|
|
6
|
+
"names": ["PaidShipping_exports", "__export", "PaidShipping_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "import_helpers", "import_ShippingMethod", "import_ShippingPolicyModal", "import_utils", "import_LearnMore", "import_BizProductProvider", "PaidShipping", "metafields", "productList", "onShippingInfoChange", "variant", "className", "isLogin", "openSignInPopup", "openShippingPolicyModal", "setOpenShippingPolicyModal", "init", "setInit", "selectedMethod", "setSelectedMethod", "weight", "acc", "product", "normalizedMethod", "method", "index", "list", "normalizedList", "prev", "sameTypeMethod", "m", "availableMethod", "handleChangeShippingInfo", "standardShippingMethod", "toggleShipping", "ShippingMethod", "LearnMore"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum ShippingMethodMode {
|
|
2
|
+
FREE = "free",
|
|
3
|
+
TDD = "tdd",
|
|
4
|
+
NDD = "ndd"
|
|
5
|
+
}
|
|
6
|
+
export type shippingMetafields = {
|
|
7
|
+
__mode: ShippingMethodMode;
|
|
8
|
+
__code: string;
|
|
9
|
+
title: string;
|
|
10
|
+
subtitle: string;
|
|
11
|
+
price: number;
|
|
12
|
+
weight_low?: number | null;
|
|
13
|
+
weight_high?: number | null;
|
|
14
|
+
__plus?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type ShippingMethodType = {
|
|
17
|
+
error: unknown;
|
|
18
|
+
code: string;
|
|
19
|
+
mode: ShippingMethodMode;
|
|
20
|
+
title: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
tag: string;
|
|
23
|
+
price: number;
|
|
24
|
+
subtitle: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
export type DeliveryCustom = {
|
|
28
|
+
selected_delivery_code?: string;
|
|
29
|
+
selected_delivery_mode?: ShippingMethodMode;
|
|
30
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)d(t,n,{get:e[n],enumerable:!0})},u=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!g.call(t,r)&&r!==n&&d(t,r,{get:()=>e[r],enumerable:!(i=o(e,r))||i.enumerable});return t};var _=t=>u(d({},"__esModule",{value:!0}),t);var b={};p(b,{ShippingMethodMode:()=>l});module.exports=_(b);var l=(i=>(i.FREE="free",i.TDD="tdd",i.NDD="ndd",i))(l||{});
|
|
2
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/type.ts"],
|
|
4
|
+
"sourcesContent": ["export enum ShippingMethodMode {\n FREE = 'free',\n TDD = 'tdd',\n NDD = 'ndd',\n}\n\nexport type shippingMetafields = {\n __mode: ShippingMethodMode\n __code: string\n title: string\n subtitle: string\n price: number\n weight_low?: number | null\n weight_high?: number | null\n __plus?: boolean\n}\n\nexport type ShippingMethodType = {\n error: unknown\n code: string\n mode: ShippingMethodMode\n title: string\n disabled: boolean\n tag: string\n price: number\n subtitle: string\n id: string\n}\n\nexport type DeliveryCustom = {\n selected_delivery_code?: string\n selected_delivery_mode?: ShippingMethodMode\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAO,IAAKE,OACVA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,IAAM,MAHIA,OAAA",
|
|
6
|
+
"names": ["type_exports", "__export", "ShippingMethodMode", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var l=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var _=(e,i)=>{for(var r in i)l(e,r,{get:i[r],enumerable:!0})},n=(e,i,r,w)=>{if(i&&typeof i=="object"||typeof i=="function")for(let g of t(i))!s.call(e,g)&&g!==r&&l(e,g,{get:()=>i[g],enumerable:!(w=h(i,g))||w.enumerable});return e};var p=e=>n(l({},"__esModule",{value:!0}),e);var u={};_(u,{isWeightAvailable:()=>f});module.exports=p(u);const f=(e,i)=>i.weight_high&&i.weight_low?e>=i.weight_low&&e<=i.weight_high:i.weight_high&&!i.weight_low?e<=i.weight_high:i.weight_low&&!i.weight_high?e>=i.weight_low:!0;
|
|
2
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/utils.ts"],
|
|
4
|
+
"sourcesContent": ["import type { shippingMetafields } from './type.js'\n\nexport const isWeightAvailable = (weight: number, method: shippingMetafields) => {\n if (method.weight_high && method.weight_low) {\n return weight >= method.weight_low && weight <= method.weight_high\n } else if (method.weight_high && !method.weight_low) {\n return weight <= method.weight_high\n } else if (method.weight_low && !method.weight_high) {\n return weight >= method.weight_low\n } else {\n return true\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAEO,MAAME,EAAoB,CAACE,EAAgBC,IAC5CA,EAAO,aAAeA,EAAO,WACxBD,GAAUC,EAAO,YAAcD,GAAUC,EAAO,YAC9CA,EAAO,aAAe,CAACA,EAAO,WAChCD,GAAUC,EAAO,YACfA,EAAO,YAAc,CAACA,EAAO,YAC/BD,GAAUC,EAAO,WAEjB",
|
|
6
|
+
"names": ["utils_exports", "__export", "isWeightAvailable", "__toCommonJS", "weight", "method"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BenefitsTabTextConfig {
|
|
3
|
+
couponCode?: string;
|
|
4
|
+
copyCode?: string;
|
|
5
|
+
copied?: string;
|
|
6
|
+
expired?: string;
|
|
7
|
+
offCoupon?: string;
|
|
8
|
+
offMemberOnly?: string;
|
|
9
|
+
loginNow?: string;
|
|
10
|
+
selectFreeGift?: string;
|
|
11
|
+
bundleSaveUpTo?: string;
|
|
12
|
+
bundleOffer?: string;
|
|
13
|
+
creditsTitle?: string;
|
|
14
|
+
creditsDesc?: string;
|
|
15
|
+
yourBenefits?: string;
|
|
16
|
+
off?: string;
|
|
17
|
+
memberBenefits?: string;
|
|
18
|
+
memberBenefitsNotLogin?: string;
|
|
19
|
+
installment?: string;
|
|
20
|
+
forNewMember?: string;
|
|
21
|
+
expressShipping?: string;
|
|
22
|
+
creditsAfterActivation?: string;
|
|
23
|
+
active?: string;
|
|
24
|
+
flexibleInstallment?: string;
|
|
25
|
+
}
|
|
26
|
+
export type ModalData = {
|
|
27
|
+
needClickAway?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
content?: string;
|
|
31
|
+
domContent?: React.ReactNode;
|
|
32
|
+
};
|
|
33
|
+
interface BenefitsTabProps {
|
|
34
|
+
textConfig?: BenefitsTabTextConfig;
|
|
35
|
+
}
|
|
36
|
+
declare const BenefitsTab: ({ textConfig }: BenefitsTabProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
37
|
+
export default BenefitsTab;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";var oe=Object.create;var v=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var le=(t,o)=>{for(var r in o)v(t,r,{get:o[r],enumerable:!0})},E=(t,o,r,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of ie(o))!re.call(t,a)&&a!==r&&v(t,a,{get:()=>o[a],enumerable:!(l=ne(o,a))||l.enumerable});return t};var y=(t,o,r)=>(r=t!=null?oe(se(t)):{},E(o||!t||!t.__esModule?v(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>E(v({},"__esModule",{value:!0}),t);var ge={};le(ge,{default:()=>fe});module.exports=ae(ge);var e=require("react/jsx-runtime"),s=require("../../../../../components/index.js"),d=y(require("./ProductBenefitsTabs/index.js")),_=require("../../../BizProductProvider.js"),z=require("../../../hooks/useBenefits"),g=require("../../../utils/index.js"),N=require("../../../utils/textFormat"),U=y(require("classnames")),w=require("react"),Z=require("../../../../AiuiProvider/index.js"),O=y(require("../../../../../hooks/useCountDown.js")),G=y(require("../../../hooks/useCopy")),T=require("../../../../../helpers/index.js");const ce={couponCode:"Code",copyCode:"Copy Code",copied:"Copied",expired:"Expired",offCoupon:"{discount} off coupon",offMemberOnly:"{amount} off Member Only",loginNow:"Login now",selectFreeGift:"You can select the free gift below.",bundleSaveUpTo:"Bundle purchases save extra up to",bundleOffer:"We offer {count} bundle for you",creditsTitle:"Soundcore credits for cash",creditsDesc:"100 Soundcore credits=$1",yourBenefits:"Your Benefits",off:" off",memberBenefits:"Member Benefits",memberBenefitsNotLogin:"You will enjoy a {amount} member discount after logging in.",installment:"Installment",forNewMember:"{amount} for New Member",expressShipping:"Express Shipping Method",creditsAfterActivation:"You will get soundcoreCredits after activation. ",active:"Active",flexibleInstallment:"Flexible installment payment "},pe=({item:t,textConfig:o})=>{const{trackingData:r}=(0,Z.useAiuiContext)(),{copied:l,copy:a}=(0,G.default)(),c=r?.common?.coupon,{days:b,hours:B,minutes:k,seconds:L}=(0,O.default)({endTime:t?.ends_at||""}),{openModal:D,isLogin:R}=(0,_.useBizProductContext)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("style",{jsx:!0,children:`
|
|
2
|
+
.coupon-card {
|
|
3
|
+
/* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */
|
|
4
|
+
mask:
|
|
5
|
+
radial-gradient(circle at 0 0, transparent 12px, white 12px),
|
|
6
|
+
radial-gradient(circle at 100% 0, transparent 12px, white 12px),
|
|
7
|
+
radial-gradient(circle at 100% 100%, transparent 12px, white 12px),
|
|
8
|
+
radial-gradient(circle at 0 100%, transparent 12px, white 12px);
|
|
9
|
+
mask-size: 50% 50%;
|
|
10
|
+
mask-position:
|
|
11
|
+
top left,
|
|
12
|
+
top right,
|
|
13
|
+
bottom right,
|
|
14
|
+
bottom left;
|
|
15
|
+
mask-repeat: no-repeat;
|
|
16
|
+
}
|
|
17
|
+
`}),(0,e.jsxs)("div",{style:{background:t.couponBgColor||"white"},className:(0,U.default)("relative h-[100px] overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]",t.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),children:[t?.bgImage?.url&&(0,e.jsx)(s.Picture,{source:t.bgImage.url,alt:t.bgImage.alt,className:"absolute bottom-0 right-0 w-auto",imgClassName:"object-contain"}),(0,e.jsxs)("div",{className:"relative z-1 p-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-start",children:[t.useAble&&(0,e.jsx)(s.Checkbox,{size:"lg",className:"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary",checked:t?.isAutoUse,onCheckedChange:C=>{t?.onUseChange?.(C)}}),(0,e.jsx)(s.Text,{html:t.title,className:"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]"})]}),(0,e.jsx)(s.Text,{...typeof t.description=="string"?{html:t.description}:{},as:"p",className:"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]",children:t.description}),t.code&&(0,e.jsxs)("div",{className:"last:mt-2 flex items-center gap-2",children:[(0,e.jsx)(s.Text,{html:`${o.couponCode}: ${t.code}`,className:"text-base font-bold text-[#3D3D3F]"}),(0,e.jsx)("button",{className:"text-base font-bold underline",onClick:()=>a(t.code??""),children:l?c?.copied||o.copied:c?.copy||o.copyCode})]}),t.ends_at&&(0,e.jsx)("button",{onClick:()=>{c?.modal&&D(c?.modal)},className:"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden",children:Number(b)<Number(c?.hurry?.daysLeft)?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:c?.ends}),(0,e.jsx)("span",{className:"font-bold",children:` ${b} ${c?.days} ${B.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`})]}):c?.hurry?.label||o.expired})]})]})]})},de=({coupons:t,className:o,textConfig:r})=>(0,e.jsx)("div",{className:(0,U.default)("flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1",o),children:t?.map((l,a)=>(0,e.jsx)(pe,{item:l,textConfig:r},a))}),ue=({textConfig:t})=>{const{isLogin:o,profile:r,variant:l,renderAffirm:a,renderKlarna:c,renderPaypal:b,onUseCouponChange:B,onUseMemberDiscountChange:k,discount:L,savingDetail:D,openModal:R,openSignInPopup:C,openAuthCodePopup:j,openSignUpPopup:W}=(0,_.useBizProductContext)(),Y=(0,z.useBenefits)({variant:l}),[M,q]=(0,w.useState)("coupon"),{trackingData:$,locale:m="us",copyWriting:K}=(0,Z.useAiuiContext)(),S=(0,w.useRef)(null),n={...ce,...t},{activated:J=!1}=r||{},{memberDiscount:u,commonCoupon:f,creditsRedemption:x,freeGift:V,bundle:F,paidShipping:Q,fullGift:P,levelDiscount:H}=Y,X=$?.product?.support??{},{thirdParty:me={}}=$?.common||{},h=[f?.enable?{...f.config,isAutoUse:D?.coupon>0,useAble:!0,borderStyle:"rounded",code:f?.config?.title??"",description:f?.config?.desc??"",onUseChange:i=>{const p=i?L?.codeSavings??0:0;B?.(p)},title:(0,N.replaceTemplate)(n.offCoupon,{discount:f?.config?.value_type=="percentage"?Math.abs(Number(f?.config?.value||0))+"%":(0,g.formatPrice)({amount:Math.abs(Number(f?.config?.fixed_value||0)),currencyCode:l.price.currencyCode,locale:m})})}:null,u.enable?{useAble:!0,isAutoUse:o,title:(0,N.replaceTemplate)(n.offMemberOnly,{amount:(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})}),description:(0,e.jsxs)(e.Fragment,{children:[o?u?.config?.description??"":n.memberBenefitsNotLogin.replace("{amount}",(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m}))??""," ",o?"":(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>C?.(),className:"underline",children:n.loginNow})]}),borderStyle:"rounded",onUseChange:i=>{if(o){const p=i?u?.config?.amount??0:0;k?.(p)}else C?.()}}:null,H.enable?{title:H?.config?.title??"",description:H?.config?.tag??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385"}}:null,V.enable?{title:V?.config?.title??"",description:n.selectFreeGift,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,F.enable?{title:`${n.bundleSaveUpTo} ${(0,g.formatPrice)({amount:Math.max(...F?.config?.bundleList?.map(i=>i.savings??0)??[]),currencyCode:l.price.currencyCode,locale:m})}`,borderStyle:"inset",description:n.bundleOffer.replace("{count}",F?.config?.bundleList?.length?.toString()??""),bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,P.enable?{title:P?.config?.title??"",description:P?.config?.desc??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,x.enable?{title:n.creditsTitle,description:n.creditsDesc,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null].filter(Boolean),ee=()=>{j?.()};if(!d.default)return null;const A=i=>{if(S.current){const p=S.current,I=i.currentTarget;console.log("button",I.offsetLeft);const te=I.offsetLeft-p.offsetWidth/2+I.offsetWidth/2;p.scrollTo({left:te,behavior:"smooth"})}};return(0,e.jsxs)(d.default,{onValueChange:i=>q(i),defaultValue:h?.length?"coupon":"membership",children:[(0,e.jsxs)(d.default.List,{ref:S,children:[h?.length?(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(M==="coupon"&&"text-[#1D1D1F]"),value:"coupon",onClick:A,children:n.yourBenefits}):null,(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(M==="membership"&&"text-[#1D1D1F]"),value:"membership",onClick:A,children:n.memberBenefits}),(0,e.jsx)(d.default.Trigger,{className:(0,T.cn)(M==="installment"&&"text-[#1D1D1F]"),value:"installment",onClick:A,children:n.installment})]}),(0,e.jsx)("style",{global:!0,jsx:!0,children:`
|
|
18
|
+
.coupon-container::-webkit-scrollbar {
|
|
19
|
+
width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */
|
|
20
|
+
height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.coupon-container::-webkit-scrollbar-track {
|
|
24
|
+
background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.coupon-container::-webkit-scrollbar-thumb {
|
|
28
|
+
background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */
|
|
29
|
+
border-radius: 9999px; /* \u5706\u89D2 */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.coupon-container::-webkit-scrollbar-thumb:hover {
|
|
33
|
+
background-color: rgba(100, 100, 100, 0.6);
|
|
34
|
+
}
|
|
35
|
+
`}),h?.length?(0,e.jsx)(d.default.Content,{value:"coupon",className:"",children:(0,e.jsx)("div",{className:"coupon-container h-[240px] overflow-y-auto p-3 lg-desktop:p-4",children:(0,e.jsx)(de,{coupons:h,className:"",textConfig:n})})}):null,(0,e.jsxs)(d.default.Content,{value:"membership",className:"",children:[(0,e.jsx)("h3",{className:"mx-4 mb-2 text-left text-lg font-bold",children:n.memberBenefits}),(0,e.jsx)("div",{className:`overflow-y-auto rounded-[16px] px-4 ${o?"max-h-[240px]":"max-h-[160px]"}`,children:(0,e.jsxs)("ul",{className:`list-none [&_li:first-child]:rounded-t-[16px]
|
|
36
|
+
[&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2
|
|
37
|
+
[&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4
|
|
38
|
+
[&_li]:py-4
|
|
39
|
+
[&_li]:text-left`,children:[u.enable&&(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z",fill:"#1D1D1F"})}),(0,e.jsx)(s.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:(0,N.replaceTemplate)(n.forNewMember,{amount:(0,g.formatPrice)({amount:u?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})})})]}),X.items?.map((i,p)=>i.modalText?(0,e.jsx)("li",{children:(0,e.jsxs)("button",{onClick:()=>R?.({title:i.text,content:i.modalText}),className:"flex",children:[(0,e.jsx)(s.Picture,{source:i.icon,alt:i.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(s.Text,{className:"text-left text-[16px] font-medium x:text-[14px]",children:i.text})]},p)},p):(0,e.jsxs)("li",{className:"flex",children:[(0,e.jsx)(s.Picture,{source:i.icon,alt:i.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(s.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:i.text})]},p)),Q.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z",fill:"#1D1D1F"})}),(0,e.jsx)(s.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:n.expressShipping})]}):null,x.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z",fill:"#1D1D1F"})}),(0,e.jsx)(s.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:J?x?.config?.label?.replace("{{amount}}",(0,g.formatPrice)({amount:x?.config?.amount??0,currencyCode:l.price.currencyCode,locale:m})):(0,e.jsxs)(e.Fragment,{children:[n.creditsAfterActivation,(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>ee(),className:"underline",children:n.active})]})})]}):null]})}),!o&&(0,e.jsx)("div",{className:"px-4 pt-4",children:(0,e.jsx)(s.Button,{variant:"primary",className:"w-full",onClick:()=>W?.(),children:K?.signUp})})]}),(0,e.jsxs)(d.default.Content,{value:"installment",className:"px-4",children:[(0,e.jsx)(s.Heading,{size:2,className:"mb-2 text-left text-lg font-bold",children:n.flexibleInstallment}),(0,e.jsxs)("div",{className:"overflow-hidden rounded-[16px] bg-white",children:[a,c,b&&(0,e.jsx)("div",{className:"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0",children:b})]})]})]})};var fe=ue;
|
|
40
|
+
//# sourceMappingURL=BenefitsTab.js.map
|