@anker-in/campaign-ui 0.3.4 → 0.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js +1 -1
- package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +2 -2
- package/dist/cjs/components/LiveChatWidget/components/MessageList.js +3 -3
- package/dist/cjs/components/LiveChatWidget/components/MessageList.js.map +3 -3
- package/dist/cjs/components/LiveChatWidget/hooks/useChatState.d.ts +2 -1
- package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js +1 -1
- package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js.map +2 -2
- package/dist/cjs/components/LiveChatWidget/types.d.ts +2 -1
- package/dist/cjs/components/LiveChatWidget/types.js.map +1 -1
- package/dist/cjs/components/credits/context/const.d.ts +10 -2
- package/dist/cjs/components/credits/context/const.js +1 -1
- package/dist/cjs/components/credits/context/const.js.map +2 -2
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
- package/dist/cjs/components/credits/context/provider.d.ts +5 -1
- package/dist/cjs/components/credits/context/provider.js +1 -1
- package/dist/cjs/components/credits/context/provider.js.map +3 -3
- package/dist/cjs/components/credits/context/response.d.ts +1 -0
- package/dist/cjs/components/credits/context/response.js.map +1 -1
- package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
- package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
- package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +2 -2
- package/dist/cjs/components/credits/creditsBanner/index.js +2 -2
- package/dist/cjs/components/credits/creditsBanner/index.js.map +2 -2
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js +1 -1
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +2 -2
- package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
- package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
- package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
- package/dist/cjs/components/credits/creditsGoGift/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsGoGift/index.js +2 -0
- package/dist/cjs/components/credits/creditsGoGift/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsGoGift/type.d.ts +22 -0
- package/dist/cjs/components/credits/creditsGoGift/type.js +2 -0
- package/dist/cjs/components/credits/creditsGoGift/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsGofit/CreditsGofit.d.ts +5 -0
- package/dist/cjs/components/credits/creditsGofit/CreditsGofit.js +2 -0
- package/dist/cjs/components/credits/creditsGofit/CreditsGofit.js.map +7 -0
- package/dist/cjs/components/credits/creditsGofit/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsGofit/index.js +2 -0
- package/dist/cjs/components/credits/creditsGofit/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsGofit/type.d.ts +22 -0
- package/dist/cjs/components/credits/creditsGofit/type.js +2 -0
- package/dist/cjs/components/credits/creditsGofit/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +2 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
- package/dist/cjs/components/credits/index.d.ts +2 -1
- package/dist/cjs/components/credits/index.js +1 -1
- package/dist/cjs/components/credits/index.js.map +3 -3
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +16 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/RewardsModal.d.ts +64 -0
- package/dist/cjs/components/credits/modal/RewardsModal.js +2 -0
- package/dist/cjs/components/credits/modal/RewardsModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +1 -1
- package/dist/cjs/components/credits/modal/activitiesModal.js +2 -2
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -2
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
- package/dist/cjs/components/credits/modal/loadingDots.js.map +2 -2
- package/dist/cjs/components/credits/modal/modalContainer.js +2 -2
- package/dist/cjs/components/credits/modal/modalContainer.js.map +4 -4
- package/dist/cjs/components/credits/modal/rulesModal.d.ts +1 -1
- package/dist/cjs/components/credits/modal/rulesModal.js +2 -2
- package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/subscribeModal.d.ts +1 -1
- package/dist/cjs/components/credits/modal/subscribeModal.js +2 -2
- package/dist/cjs/components/credits/modal/subscribeModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/tip.js +1 -1
- package/dist/cjs/components/credits/modal/tip.js.map +2 -2
- package/dist/cjs/components/credits/type.d.ts +67 -5
- package/dist/cjs/components/credits/type.js +1 -1
- package/dist/cjs/components/credits/type.js.map +1 -1
- package/dist/cjs/stories/LiveChatWidget.stories.js +2 -9
- package/dist/cjs/stories/LiveChatWidget.stories.js.map +2 -2
- package/dist/cjs/templates/Credits.d.ts +1 -87
- package/dist/cjs/templates/Credits.js +1 -1
- package/dist/cjs/templates/Credits.js.map +3 -3
- package/dist/cjs/templates/Credits.types.d.ts +96 -0
- package/dist/cjs/templates/Credits.types.js +2 -0
- package/dist/cjs/templates/Credits.types.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/LiveChatWidget.js +1 -1
- package/dist/esm/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
- package/dist/esm/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +2 -2
- package/dist/esm/components/LiveChatWidget/components/MessageList.js +3 -3
- package/dist/esm/components/LiveChatWidget/components/MessageList.js.map +3 -3
- package/dist/esm/components/LiveChatWidget/hooks/useChatState.d.ts +2 -1
- package/dist/esm/components/LiveChatWidget/hooks/useChatState.js +1 -1
- package/dist/esm/components/LiveChatWidget/hooks/useChatState.js.map +2 -2
- package/dist/esm/components/LiveChatWidget/types.d.ts +2 -1
- package/dist/esm/components/credits/context/const.d.ts +10 -2
- package/dist/esm/components/credits/context/const.js +1 -1
- package/dist/esm/components/credits/context/const.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
- package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
- package/dist/esm/components/credits/context/provider.d.ts +5 -1
- package/dist/esm/components/credits/context/provider.js +1 -1
- package/dist/esm/components/credits/context/provider.js.map +3 -3
- package/dist/esm/components/credits/context/response.d.ts +1 -0
- package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
- package/dist/esm/components/credits/context/utils/atobID.js +2 -0
- package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
- package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
- package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
- package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +1 -1
- package/dist/esm/components/credits/creditsBanner/index.js +2 -2
- package/dist/esm/components/credits/creditsBanner/index.js.map +2 -2
- package/dist/esm/components/credits/creditsCash/CreditsCash.js +1 -1
- package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +1 -1
- package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
- package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
- package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
- package/dist/esm/components/credits/creditsGoGift/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsGoGift/index.js +2 -0
- package/dist/esm/components/credits/creditsGoGift/index.js.map +7 -0
- package/dist/esm/components/credits/creditsGoGift/type.d.ts +22 -0
- package/dist/esm/components/credits/creditsGoGift/type.js +1 -0
- package/dist/esm/components/credits/creditsGoGift/type.js.map +7 -0
- package/dist/esm/components/credits/creditsGofit/CreditsGofit.d.ts +5 -0
- package/dist/esm/components/credits/creditsGofit/CreditsGofit.js +2 -0
- package/dist/esm/components/credits/creditsGofit/CreditsGofit.js.map +7 -0
- package/dist/esm/components/credits/creditsGofit/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsGofit/index.js +2 -0
- package/dist/esm/components/credits/creditsGofit/index.js.map +7 -0
- package/dist/esm/components/credits/creditsGofit/type.d.ts +22 -0
- package/dist/esm/components/credits/creditsGofit/type.js +1 -0
- package/dist/esm/components/credits/creditsGofit/type.js.map +7 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +1 -1
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +11 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
- package/dist/esm/components/credits/index.d.ts +2 -1
- package/dist/esm/components/credits/index.js +1 -1
- package/dist/esm/components/credits/index.js.map +3 -3
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +16 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
- package/dist/esm/components/credits/modal/RewardsModal.d.ts +64 -0
- package/dist/esm/components/credits/modal/RewardsModal.js +2 -0
- package/dist/esm/components/credits/modal/RewardsModal.js.map +7 -0
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +1 -1
- package/dist/esm/components/credits/modal/activitiesModal.js +2 -2
- package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -2
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +2 -2
- package/dist/esm/components/credits/modal/loadingDots.js +1 -1
- package/dist/esm/components/credits/modal/loadingDots.js.map +2 -2
- package/dist/esm/components/credits/modal/modalContainer.js +2 -2
- package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
- package/dist/esm/components/credits/modal/rulesModal.d.ts +1 -1
- package/dist/esm/components/credits/modal/rulesModal.js +2 -2
- package/dist/esm/components/credits/modal/rulesModal.js.map +3 -3
- package/dist/esm/components/credits/modal/subscribeModal.d.ts +1 -1
- package/dist/esm/components/credits/modal/subscribeModal.js +2 -2
- package/dist/esm/components/credits/modal/subscribeModal.js.map +2 -2
- package/dist/esm/components/credits/modal/tip.js +1 -1
- package/dist/esm/components/credits/modal/tip.js.map +2 -2
- package/dist/esm/components/credits/type.d.ts +67 -5
- package/dist/esm/stories/LiveChatWidget.stories.js +1 -8
- package/dist/esm/stories/LiveChatWidget.stories.js.map +2 -2
- package/dist/esm/templates/Credits.d.ts +1 -87
- package/dist/esm/templates/Credits.js +1 -1
- package/dist/esm/templates/Credits.js.map +3 -3
- package/dist/esm/templates/Credits.types.d.ts +96 -0
- package/dist/esm/templates/Credits.types.js +2 -0
- package/dist/esm/templates/Credits.types.js.map +7 -0
- package/package.json +2 -2
- package/src/components/LiveChatWidget/LiveChatWidget.tsx +20 -0
- package/src/components/LiveChatWidget/components/MessageContent/PromotionList.tsx +1 -1
- package/src/components/LiveChatWidget/components/MessageList.tsx +39 -44
- package/src/components/LiveChatWidget/hooks/useChatState.ts +4 -3
- package/src/components/LiveChatWidget/types.ts +2 -1
- package/src/components/credits/context/const.ts +8 -0
- package/src/components/credits/context/hooks/useMyRewards.ts +7 -31
- package/src/components/credits/context/hooks/useRedeemGoGift.ts +36 -0
- package/src/components/credits/context/hooks/useRedeemableList.ts +13 -19
- package/src/components/credits/context/provider.tsx +17 -2
- package/src/components/credits/context/response.ts +1 -0
- package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +2 -2
- package/src/components/credits/creditsBanner/index.tsx +5 -5
- package/src/components/credits/creditsCash/CreditsCash.tsx +1 -1
- package/src/components/credits/creditsGoGift/CreditsGoGift.tsx +210 -0
- package/src/components/credits/creditsGoGift/index.ts +2 -0
- package/src/components/credits/creditsGoGift/type.ts +23 -0
- package/src/components/credits/creditsInfoCard/index.tsx +5 -28
- package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +1 -1
- package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +39 -17
- package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.tsx +77 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.tsx +86 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +29 -138
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +5 -6
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +11 -12
- package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +23 -14
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -9
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -5
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +29 -28
- package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.tsx +101 -0
- package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.tsx +65 -0
- package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal.tsx +156 -0
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +1 -1
- package/src/components/credits/creditsRedeemList/type.ts +11 -0
- package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +2 -2
- package/src/components/credits/creditsWaysToGetCredits/type.ts +2 -2
- package/src/components/credits/index.ts +2 -1
- package/src/components/credits/modal/{activitiesModal.tsx → ActivitiesModal.tsx} +2 -2
- package/src/components/credits/modal/{creditsUploadReceiptModal.tsx → CreditsUploadReceiptModal.tsx} +1 -1
- package/src/components/credits/modal/{modalContainer.tsx → ModalContainer.tsx} +1 -1
- package/src/components/credits/modal/{MyRewardsModal.tsx → RewardsModal.tsx} +145 -103
- package/src/components/credits/modal/{rulesModal.tsx → RulesModal.tsx} +1 -1
- package/src/components/credits/modal/{subscribeModal.tsx → SubscribeModal.tsx} +1 -1
- package/src/components/credits/type.ts +68 -5
- package/src/stories/LiveChatWidget.stories.tsx +7 -12
- package/src/styles/livechat.css +29 -0
- package/src/templates/Credits.tsx +110 -142
- package/src/templates/Credits.types.ts +110 -0
- package/dist/index.d.mts +0 -1305
- package/dist/index.d.ts +0 -1305
- package/dist/index.js +0 -26656
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -26641
- package/dist/index.mjs.map +0 -1
- /package/src/components/credits/modal/{loadingDots.tsx → LoadingDots.tsx} +0 -0
- /package/src/components/credits/modal/{tip.tsx → Tip.tsx} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as b,jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as r,Picture as c,Text as m}from"@anker-in/headless-ui";import p from"classnames";import{numberFormat as u}from"../../context/utils";import{NoneProductValue as f}from"../RedeemProductModal/NonProductValue";import{useCreditsContext as g}from"../../context/provider";const w=({item:t,copy:a,loading:i,disabled:d,onConfirm:n})=>{const{pageCommon:l}=g();return o(b,{children:[o("div",{className:p("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[o("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[l?.imageMapping?.[t.config?.type]?.url&&e(c,{source:l.imageMapping[t.config.type].url,className:"h-full [&_img]:h-full"}),e("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value?e(f,{item:t}):e(m,{size:3,html:t.alpc?.title})})]}),o(m,{as:"p",className:p("mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]"),children:[u(t.alpc?.consumeCredits)," ",l?.pointUnit]}),t.config?.rules?.length>0&&o("div",{className:"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]",children:[o("div",{className:"mb-[4px]",children:[l?.ruleLabel,":"]}),e("ul",{className:"ml-4 grid grid-flow-row gap-[4px]",children:t.config?.rules?.map((x,s)=>e("li",{className:"list-disc",children:e(m,{html:x})},s))})]})]}),o("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[e(m,{className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:a.confirmTitle}),e(r,{loading:i,variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:n,disabled:d,children:a.confirmButton})]})]})};export{w as CouponInit};
|
|
2
|
+
//# sourceMappingURL=CouponInit.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type'\nimport { NoneProductValue } from '../RedeemProductModal/NonProductValue'\nimport { useCreditsContext } from '../../context/provider'\n\ntype CouponInitProps = {\n item: RedeemableItemType\n copy: RedeemModalCommon\n loading: boolean\n disabled: boolean\n onConfirm: () => void\n}\n\nexport const CouponInit = ({ item, copy, loading, disabled, onConfirm }: CouponInitProps) => {\n const { pageCommon } = useCreditsContext()\n\n return (\n <>\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {pageCommon?.imageMapping?.[item.config?.type]?.url && (\n <Picture source={pageCommon.imageMapping[item.config.type].url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <NoneProductValue item={item} />\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n <Text\n as=\"p\"\n className={classNames(\n 'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}\n </Text>\n {item.config?.rules?.length > 0 && (\n <div className=\"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]\">\n <div className=\"mb-[4px]\">{pageCommon?.ruleLabel}:</div>\n <ul className=\"ml-4 grid grid-flow-row gap-[4px]\">\n {item.config?.rules?.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text html={text} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n <Text\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={onConfirm}\n disabled={disabled}\n >\n {copy.confirmButton}\n </Button>\n </div>\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAmBI,mBAAAA,EAQQ,OAAAC,EAFJ,QAAAC,MANJ,oBAnBJ,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAOC,MAAgB,aACvB,OAAS,gBAAAC,MAAoB,sBAE7B,OAAS,oBAAAC,MAAwB,wCACjC,OAAS,qBAAAC,MAAyB,yBAU3B,MAAMC,EAAa,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,SAAAC,EAAU,UAAAC,CAAU,IAAuB,CAC3F,KAAM,CAAE,WAAAC,CAAW,EAAIP,EAAkB,EAEzC,OACEP,EAAAF,EAAA,CACE,UAAAE,EAAC,OACC,UAAWI,EACT,8FACF,EAEA,UAAAJ,EAAC,OAAI,UAAU,uCACZ,UAAAc,GAAY,eAAeL,EAAK,QAAQ,IAAI,GAAG,KAC9CV,EAACG,EAAA,CAAQ,OAAQY,EAAW,aAAaL,EAAK,OAAO,IAAI,EAAE,IAAK,UAAU,wBAAwB,EAEpGV,EAAC,OAAI,UAAU,8DACZ,SAAAU,EAAK,OAAO,MACXV,EAACO,EAAA,CAAiB,KAAMG,EAAM,EAE9BV,EAACI,EAAA,CAAK,KAAM,EAAG,KAAMM,EAAK,MAAM,MAAO,EAE3C,GACF,EACAT,EAACG,EAAA,CACC,GAAG,IACH,UAAWC,EACT,wGACF,EAEC,UAAAC,EAAaI,EAAK,MAAM,cAAc,EAAE,IAAEK,GAAY,WACzD,EACCL,EAAK,QAAQ,OAAO,OAAS,GAC5BT,EAAC,OAAI,UAAU,kGACb,UAAAA,EAAC,OAAI,UAAU,WAAY,UAAAc,GAAY,UAAU,KAAC,EAClDf,EAAC,MAAG,UAAU,oCACX,SAAAU,EAAK,QAAQ,OAAO,IAAI,CAACM,EAAMC,IAC9BjB,EAAC,MAAG,UAAU,YACZ,SAAAA,EAACI,EAAA,CAAK,KAAMY,EAAM,GADWC,CAE/B,CACD,EACH,GACF,GAEJ,EACAhB,EAAC,OAAI,UAAU,wDACb,UAAAD,EAACI,EAAA,CACC,UAAU,4EACV,KAAMO,EAAK,aACZ,EACDX,EAACE,EAAA,CACC,QAASU,EACT,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAASE,EACT,SAAUD,EAET,SAAAF,EAAK,cACR,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Button", "Picture", "Text", "classNames", "numberFormat", "NoneProductValue", "useCreditsContext", "CouponInit", "item", "copy", "loading", "disabled", "onConfirm", "pageCommon", "text", "index"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RedeemModalCommon, RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
+
type CouponSuccessProps = {
|
|
3
|
+
item: RedeemableItemType;
|
|
4
|
+
copy: RedeemModalCommon;
|
|
5
|
+
couponCode: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const CouponSuccess: ({ item, copy, couponCode, disabled, onClose }: CouponSuccessProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as N,jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as u,Picture as f,Text as a}from"@anker-in/headless-ui";import n from"classnames";import v from"../../context/hooks/useCopy";import{useCreditsContext as b}from"../../context/provider";import{useHeadlessContext as g}from"@anker-in/lib";import{NoneProductValue as y}from"../RedeemProductModal/NonProductValue";const k=({item:o,copy:s,couponCode:m,disabled:c,onClose:d})=>{const{locale:x}=g(),{pageCommon:p}=b(),{copy:r,copied:i}=v();return t(N,{children:[t("div",{className:n("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[t("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[p?.imageMapping?.[o.config?.type]?.url&&e(f,{source:p.imageMapping[o.config.type].url,className:"h-full [&_img]:h-full"}),e("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:o.config.value?e(y,{item:o}):e(a,{size:3,html:o.alpc?.title})})]}),t("div",{className:"mt-[30px] flex items-center justify-center md:mt-[18px]",children:[e("div",{className:"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]",children:m}),e("div",{className:n("cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]",i?"pointer-events-none":"pointer-events-auto"),onClick:()=>r(m),role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.preventDefault()},children:i?p?.copied:p?.copy})]})]}),t("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[t("div",{className:"flex flex-col",children:[e(a,{className:"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]",html:s.coupon.successTitle}),e(a,{className:"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]",html:s.coupon.successDesc})]}),e(u,{variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:()=>{window.location.href=s.coupon.successButtonUrl||`/${x}`,d()},disabled:c,children:s.coupon.successButton})]})]})};export{k as CouponSuccess};
|
|
2
|
+
//# sourceMappingURL=CouponSuccess.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport useCopy from '../../context/hooks/useCopy'\nimport { useCreditsContext } from '../../context/provider'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport type { RedeemModalCommon, RedeemableItem as RedeemableItemType } from '../../type'\nimport { NoneProductValue } from '../RedeemProductModal/NonProductValue'\n\ntype CouponSuccessProps = {\n item: RedeemableItemType\n copy: RedeemModalCommon\n couponCode: string\n disabled: boolean\n onClose: () => void\n}\n\nexport const CouponSuccess = ({ item, copy, couponCode, disabled, onClose }: CouponSuccessProps) => {\n const { locale } = useHeadlessContext()\n const { pageCommon } = useCreditsContext()\n const { copy: copyText, copied: copiedStatus } = useCopy()\n return (\n <>\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {pageCommon?.imageMapping?.[item.config?.type]?.url && (\n <Picture source={pageCommon.imageMapping[item.config.type].url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <NoneProductValue item={item} />\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n <div className=\"mt-[30px] flex items-center justify-center md:mt-[18px]\">\n <div className=\"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]\">{couponCode}</div>\n <div\n className={classNames(\n 'cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]',\n copiedStatus ? 'pointer-events-none' : 'pointer-events-auto'\n )}\n onClick={() => copyText(couponCode)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copiedStatus ? pageCommon?.copied : pageCommon?.copy}\n </div>\n </div>\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.coupon.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.coupon.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.coupon.successButtonUrl || `/${locale}`\n onClose()\n }}\n disabled={disabled}\n >\n {copy.coupon.successButton}\n </Button>\n </div>\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAqBI,mBAAAA,EAQQ,OAAAC,EAFJ,QAAAC,MANJ,oBArBJ,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAOC,MAAgB,aACvB,OAAOC,MAAa,8BACpB,OAAS,qBAAAC,MAAyB,yBAClC,OAAS,sBAAAC,MAA0B,gBAEnC,OAAS,oBAAAC,MAAwB,wCAU1B,MAAMC,EAAgB,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,WAAAC,EAAY,SAAAC,EAAU,QAAAC,CAAQ,IAA0B,CAClG,KAAM,CAAE,OAAAC,CAAO,EAAIR,EAAmB,EAChC,CAAE,WAAAS,CAAW,EAAIV,EAAkB,EACnC,CAAE,KAAMW,EAAU,OAAQC,CAAa,EAAIb,EAAQ,EACzD,OACEL,EAAAF,EAAA,CACE,UAAAE,EAAC,OACC,UAAWI,EACT,8FACF,EAEA,UAAAJ,EAAC,OAAI,UAAU,uCACZ,UAAAgB,GAAY,eAAeN,EAAK,QAAQ,IAAI,GAAG,KAC9CX,EAACG,EAAA,CAAQ,OAAQc,EAAW,aAAaN,EAAK,OAAO,IAAI,EAAE,IAAK,UAAU,wBAAwB,EAEpGX,EAAC,OAAI,UAAU,8DACZ,SAAAW,EAAK,OAAO,MACXX,EAACS,EAAA,CAAiB,KAAME,EAAM,EAE9BX,EAACI,EAAA,CAAK,KAAM,EAAG,KAAMO,EAAK,MAAM,MAAO,EAE3C,GACF,EACAV,EAAC,OAAI,UAAU,0DACb,UAAAD,EAAC,OAAI,UAAU,iEAAkE,SAAAa,EAAW,EAC5Fb,EAAC,OACC,UAAWK,EACT,8EACAc,EAAe,sBAAwB,qBACzC,EACA,QAAS,IAAMD,EAASL,CAAU,EAClC,KAAK,SACL,SAAU,EACV,UAAWO,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAD,EAAeF,GAAY,OAASA,GAAY,KACnD,GACF,GACF,EACAhB,EAAC,OAAI,UAAU,wDACb,UAAAA,EAAC,OAAI,UAAU,gBACb,UAAAD,EAACI,EAAA,CACC,UAAU,8DACV,KAAMQ,EAAK,OAAO,aACnB,EACDZ,EAACI,EAAA,CACC,UAAU,oEACV,KAAMQ,EAAK,OAAO,YACnB,GACH,EACAZ,EAACE,EAAA,CACC,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAAS,IAAM,CACb,OAAO,SAAS,KAAOU,EAAK,OAAO,kBAAoB,IAAII,CAAM,GACjED,EAAQ,CACV,EACA,SAAUD,EAET,SAAAF,EAAK,OAAO,cACf,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Button", "Picture", "Text", "classNames", "useCopy", "useCreditsContext", "useHeadlessContext", "NoneProductValue", "CouponSuccess", "item", "copy", "couponCode", "disabled", "onClose", "locale", "pageCommon", "copyText", "copiedStatus", "e"]
|
|
7
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ModalContainerProps } from '../modal/
|
|
2
|
-
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
3
|
-
|
|
4
|
-
declare function RedeemCouponModal({ item, copy, onError, ...props }: ModalContainerProps & {
|
|
1
|
+
import type { ModalContainerProps } from '../modal/ModalContainer';
|
|
2
|
+
import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../type';
|
|
3
|
+
declare function RedeemCouponModal({ item, copy, onError, ...props }: Omit<ModalContainerProps, 'isOpen'> & {
|
|
5
4
|
item: RedeemableItemType;
|
|
6
|
-
copy:
|
|
5
|
+
copy: RedeemModalCommon;
|
|
7
6
|
onError: (code: number) => void;
|
|
8
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default RedeemCouponModal;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as s,jsxs as y}from"react/jsx-runtime";import{Text as h}from"@anker-in/headless-ui";import{useCallback as M,useEffect as N,useState as l}from"react";import{useCreditsContext as R}from"../context/provider";import{useRedeemCoupon as I}from"../context/hooks/useRedeemCoupon";import{AlpcErrorCode as n}from"../context/const";import{CreditsModalContainer as F}from"../modal/ModalContainer";import{CouponInit as S}from"./RedeemCouponModal/CouponInit";import{CouponSuccess as _}from"./RedeemCouponModal/CouponSuccess";function v({item:r,copy:o,onError:u,...a}){const[c,p]=l(),[C,t]=l(),[f,d]=l(!1),{profile:m,fetchCreditInfo:x}=R(),{isMutating:b,trigger:g}=I({onSuccess(e){if(!e){t(o.commonError);return}if(e?.data?.success)p(e.data.coupon_code),x(m?.user_id);else{let i;e.code===n.CodeLpcShopifyCouponRuleRedeemLimit?(i=o.redeemLimitError,d(!0)):e.code===n.CodeLpcRuleInventoryNotEnough?(i=o.inventoryNotEnough,d(!0)):e.code===n.CodeLpcNotEnoughCredits?(i=o.creditsNotEnough,d(!0),x(m?.user_id)):e.code===n.CodeCrossSiteError&&(i=o.crossSiteError,d(!0)),t(i||o.commonError||""),u&&u(e.code)}},onError(e){t(e.message||o.commonError)}}),E=M(async()=>{t(""),g({user_id:m?.user_id,rule_id:Number(r.alpc?.id)})},[r,m,g]);return N(()=>()=>{d(!1),t(""),p(void 0)},[]),y(F,{...a,isOpen:!!r,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[c&&!b?s(_,{item:r,copy:o,couponCode:c,disabled:f,onClose:a.onClose}):s(S,{item:r,copy:o,loading:b,disabled:f,onConfirm:E}),C&&s("div",{className:"mx-auto max-w-full bg-white px-[48px] py-[12px] text-center text-[#FF0000] md:px-[16px]",children:s(h,{className:"text-[14px] font-semibold text-[#1F2021]",html:C})})]})}var z=v;export{z as default};
|
|
2
2
|
//# sourceMappingURL=RedeemCouponModal.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemCouponModal.tsx"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/ModalContainer'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemCoupon } from '../context/hooks/useRedeemCoupon'\nimport { AlpcErrorCode } from '../context/const'\nimport { CreditsModalContainer } from '../modal/ModalContainer'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../type'\nimport { CouponInit } from './RedeemCouponModal/CouponInit'\nimport { CouponSuccess } from './RedeemCouponModal/CouponSuccess'\n\nfunction RedeemCouponModal({\n item,\n copy,\n onError,\n ...props\n}: Omit<ModalContainerProps, 'isOpen'> & {\n item: RedeemableItemType\n copy: RedeemModalCommon\n onError: (code: number) => void\n}) {\n const [couponCode, setCouponCode] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n const [disabled, setDisabled] = useState(false)\n\n const { profile, fetchCreditInfo } = useCreditsContext()\n\n const { isMutating: loading, trigger } = useRedeemCoupon({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy.commonError)\n return\n }\n\n if (responseData?.data?.success) {\n setCouponCode(responseData.data.coupon_code)\n fetchCreditInfo(profile?.user_id)\n } else {\n let errorMsg\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.inventoryNotEnough\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.crossSiteError\n setDisabled(true)\n }\n\n setErrorInfo(errorMsg || copy.commonError || '')\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy.commonError)\n },\n })\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n trigger({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n }, [item, profile, trigger])\n\n useEffect(() => {\n return () => {\n setDisabled(false)\n setErrorInfo('')\n setCouponCode(undefined)\n }\n }, [])\n\n return (\n <CreditsModalContainer\n {...props}\n isOpen={!!item}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n {couponCode && !loading ? (\n <CouponSuccess item={item} copy={copy} couponCode={couponCode} disabled={disabled} onClose={props.onClose} />\n ) : (\n <CouponInit item={item} copy={copy} loading={loading} disabled={disabled} onConfirm={handleConfirm} />\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full bg-white px-[48px] py-[12px] text-center text-[#FF0000] md:px-[16px]\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemCouponModal\n"],
|
|
5
|
+
"mappings": "AAgFI,OAQI,OAAAA,EARJ,QAAAC,MAAA,oBAhFJ,OAAS,QAAAC,MAAY,wBACrB,OAAS,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,mBAAAC,MAAuB,mCAChC,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,yBAAAC,MAA6B,0BAEtC,OAAS,cAAAC,MAAkB,iCAC3B,OAAS,iBAAAC,MAAqB,oCAE9B,SAASC,EAAkB,CACzB,KAAAC,EACA,KAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAIG,CACD,KAAM,CAACC,EAAYC,CAAa,EAAIb,EAAiB,EAC/C,CAACc,EAAWC,CAAY,EAAIf,EAAiB,EAC7C,CAACgB,EAAUC,CAAW,EAAIjB,EAAS,EAAK,EAExC,CAAE,QAAAkB,EAAS,gBAAAC,CAAgB,EAAIlB,EAAkB,EAEjD,CAAE,WAAYmB,EAAS,QAAAC,CAAQ,EAAInB,EAAgB,CACvD,UAAUoB,EAAc,CACtB,GAAI,CAACA,EAAc,CACjBP,EAAaN,EAAK,WAAW,EAC7B,MACF,CAEA,GAAIa,GAAc,MAAM,QACtBT,EAAcS,EAAa,KAAK,WAAW,EAC3CH,EAAgBD,GAAS,OAAO,MAC3B,CACL,IAAIK,EACAD,EAAa,OAASnB,EAAc,qCACtCoB,EAAWd,EAAK,iBAChBQ,EAAY,EAAI,GACPK,EAAa,OAASnB,EAAc,+BAC7CoB,EAAWd,EAAK,mBAChBQ,EAAY,EAAI,GACPK,EAAa,OAASnB,EAAc,yBAC7CoB,EAAWd,EAAK,iBAChBQ,EAAY,EAAI,EAChBE,EAAgBD,GAAS,OAAO,GACvBI,EAAa,OAASnB,EAAc,qBAC7CoB,EAAWd,EAAK,eAChBQ,EAAY,EAAI,GAGlBF,EAAaQ,GAAYd,EAAK,aAAe,EAAE,EAC/CC,GAAWA,EAAQY,EAAa,IAAI,CACtC,CACF,EACA,QAAQE,EAAO,CACbT,EAAaS,EAAM,SAAWf,EAAK,WAAW,CAChD,CACF,CAAC,EAEKgB,EAAgB3B,EAAY,SAAY,CAC5CiB,EAAa,EAAE,EACfM,EAAQ,CACN,QAASH,GAAS,QAClB,QAAS,OAAOV,EAAK,MAAM,EAAE,CAC/B,CAAC,CACH,EAAG,CAACA,EAAMU,EAASG,CAAO,CAAC,EAE3B,OAAAtB,EAAU,IACD,IAAM,CACXkB,EAAY,EAAK,EACjBF,EAAa,EAAE,EACfF,EAAc,MAAS,CACzB,EACC,CAAC,CAAC,EAGHjB,EAACQ,EAAA,CACE,GAAGO,EACJ,OAAQ,CAAC,CAACH,EACV,UAAU,sBACV,gBAAgB,yCAChB,eAAe,wBAEd,UAAAI,GAAc,CAACQ,EACdzB,EAACW,EAAA,CAAc,KAAME,EAAM,KAAMC,EAAM,WAAYG,EAAY,SAAUI,EAAU,QAASL,EAAM,QAAS,EAE3GhB,EAACU,EAAA,CAAW,KAAMG,EAAM,KAAMC,EAAM,QAASW,EAAS,SAAUJ,EAAU,UAAWS,EAAe,EAErGX,GACCnB,EAAC,OAAI,UAAU,0FACb,SAAAA,EAACE,EAAA,CAAK,UAAU,2CAA2C,KAAMiB,EAAW,EAC9E,GAEJ,CAEJ,CAEA,IAAOY,EAAQnB",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "useCallback", "useEffect", "useState", "useCreditsContext", "useRedeemCoupon", "AlpcErrorCode", "CreditsModalContainer", "CouponInit", "CouponSuccess", "RedeemCouponModal", "item", "copy", "onError", "props", "couponCode", "setCouponCode", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "profile", "fetchCreditInfo", "loading", "trigger", "responseData", "errorMsg", "error", "handleConfirm", "RedeemCouponModal_default"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type';
|
|
3
2
|
type AddressProps = {
|
|
4
|
-
copy:
|
|
3
|
+
copy: RedeemModalCommon;
|
|
5
4
|
shippingAddress: string;
|
|
6
5
|
setAddress: (address: Record<string, any>) => void;
|
|
7
6
|
validateAddress: (address: Record<string, any>) => boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as N,Text as r}from"@anker-in/headless-ui";import m from"classnames";import{AddressForm as R}from"../AddressForm";import{useHeadlessContext as h}from"@anker-in/lib";import{ProductInfo as A}from"./ProductInfo";import F from"../../context/hooks/useCountries";import{ROUNDED_BRANDS as C}from"../../../../constants";const L=({copy:o,shippingAddress:d,setAddress:a,validateAddress:i,validateErrors:n,shippingProduct:s,loading:l,address:p,disabled:x,handlePayment:c,item:u})=>{const{storeDomain:f,brand:v}=h(),b=C.includes(v),{countries:g=[],isLoading:y}=F({shopifyStoreDomain:f});return t("div",{className:"relative",children:[e("div",{className:m("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:t("div",{children:[d&&e(r,{className:"mb-5 text-[16px] font-bold",html:d}),o?.product?.addressForm&&e(R,{onChange:a,validate:i,errors:n,form:o.product.addressForm,countries:g,countriesLoading:y})]})}),t("div",{className:"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]",children:[t("div",{className:m("flex w-full items-center bg-[#F5F5F7] p-[16px]",!b&&"rounded-none"),children:[s&&e(r,{className:"mb-5 text-[16px] font-bold",html:s}),e(A,{item:u,copy:o})]}),e(N,{loading:l||!p,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:c,disabled:x,children:o.product.paymentButton})]})]})};export{L as Address};
|
|
2
2
|
//# sourceMappingURL=Address.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type'\nimport { ProductInfo } from './ProductInfo'\nimport useCountries from '../../context/hooks/useCountries'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ntype AddressProps = {\n copy: RedeemModalCommon\n shippingAddress: string\n setAddress: (address: Record<string, any>) => void\n validateAddress: (address: Record<string, any>) => boolean\n validateErrors: { key: string; message: string }[]\n item: RedeemableItemType\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n handlePayment: () => void\n shippingProduct: string\n}\n\nexport const Address = ({\n copy,\n shippingAddress,\n setAddress,\n validateAddress,\n validateErrors,\n shippingProduct,\n loading,\n address,\n disabled,\n handlePayment,\n item,\n}: AddressProps) => {\n const { storeDomain, brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n return (\n <div className=\"relative\">\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div>\n {shippingAddress && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingAddress}></Text>}\n {copy?.product?.addressForm && (\n <AddressForm\n onChange={setAddress}\n validate={validateAddress}\n errors={validateErrors}\n form={copy.product.addressForm}\n countries={countries}\n countriesLoading={countriesLoading}\n ></AddressForm>\n )}\n </div>\n </div>\n <div className=\"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]\">\n <div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n <ProductInfo item={item} copy={copy} />\n </div>\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={handlePayment}\n disabled={disabled}\n >\n {copy.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AA2CQ,OACsB,OAAAA,EADtB,QAAAC,MAAA,oBA3CR,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAOC,MAAgB,aACvB,OAAS,eAAAC,MAAmB,iBAC5B,OAAS,sBAAAC,MAA0B,gBAEnC,OAAS,eAAAC,MAAmB,gBAC5B,OAAOC,MAAkB,mCACzB,OAAS,kBAAAC,MAAsB,wBAgBxB,MAAMC,EAAU,CAAC,CACtB,KAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,cAAAC,EACA,KAAAC,CACF,IAAoB,CAClB,KAAM,CAAE,YAAAC,EAAa,MAAAC,CAAM,EAAIjB,EAAmB,EAC5CkB,EAAUf,EAAe,SAASc,CAAK,EACvC,CAAE,UAAAE,EAAY,CAAC,EAAG,UAAWC,CAAiB,EAAIlB,EAAa,CAAE,mBAAoBc,CAAY,CAAC,EAExG,OACErB,EAAC,OAAI,UAAU,WACb,UAAAD,EAAC,OAAI,UAAWI,EAAW,iFAAiF,EAC1G,SAAAH,EAAC,OACE,UAAAW,GAAmBZ,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMS,EAAiB,EACvFD,GAAM,SAAS,aACdX,EAACK,EAAA,CACC,SAAUQ,EACV,SAAUC,EACV,OAAQC,EACR,KAAMJ,EAAK,QAAQ,YACnB,UAAWc,EACX,iBAAkBC,EACnB,GAEL,EACF,EACAzB,EAAC,OAAI,UAAU,qGACb,UAAAA,EAAC,OAAI,UAAWG,EAAW,iDAAkD,CAACoB,GAAW,cAAc,EACpG,UAAAR,GAAmBhB,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMa,EAAiB,EACxFhB,EAACO,EAAA,CAAY,KAAMc,EAAM,KAAMV,EAAM,GACvC,EACAX,EAACE,EAAA,CACC,QAASe,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAR,EAAK,QAAQ,cAChB,GACF,GACF,CAEJ",
|
|
6
6
|
"names": ["jsx", "jsxs", "Button", "Text", "classNames", "AddressForm", "useHeadlessContext", "ProductInfo", "useCountries", "ROUNDED_BRANDS", "Address", "copy", "shippingAddress", "setAddress", "validateAddress", "validateErrors", "shippingProduct", "loading", "address", "disabled", "handlePayment", "item", "storeDomain", "brand", "rounded", "countries", "countriesLoading"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type';
|
|
3
2
|
type InitProps = {
|
|
4
|
-
copy:
|
|
3
|
+
copy: RedeemModalCommon;
|
|
5
4
|
item: RedeemableItemType;
|
|
6
5
|
loading: boolean;
|
|
7
6
|
disabled: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as w,jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as u,Picture as
|
|
1
|
+
import{Fragment as w,jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as u,Picture as i,Text as a}from"@anker-in/headless-ui";import d from"classnames";import{Fragment as f,useMemo as g}from"react";import{numberFormat as v}from"../../context/utils";import{ConsumeType as b}from"../../context/const";import{NoneProductValue as N}from"./NonProductValue";import{useCreditsContext as h}from"../../context/provider";const k=({copy:s,item:t,loading:x,disabled:n,setStatus:c})=>{const{pageCommon:p}=h(),r=g(()=>t.config.rules?.length?t.config.rules:[...t.config.desc?.split("<br>")||[],...s.product.rules||[]],[t.config.rules,t.config.desc,s.product.rules]);return o("div",{className:"flex flex-col",children:[e("div",{className:d("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:o(w,{children:[o("div",{className:"relative mx-auto h-[164px] w-fit",children:[e(i,{source:t.config?.type===b.Product?t.product?.images[0]?.url:p?.imageMapping?.[t.config.type]?.url||t.config.image?.url,className:"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),e("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value&&e(N,{item:t})})]}),o("div",{className:"mt-[30px] md:mt-[18px]",children:[t.config.type==="product"&&e("div",{className:d("mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:t.config.title}),o(a,{as:"p",className:d(" text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:[v(t.alpc?.consumeCredits)," ",p?.pointUnit]})]}),o("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[e("div",{className:"text-[16px] font-bold leading-[1.4]",children:s.product.stepTitle}),e("div",{className:"mt-[4px] flex items-center justify-center",children:s.product.steps?.map((l,m)=>o(f,{children:[o("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[e(i,{source:l.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),e("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:l.title})]}),m!==s.product.steps.length-1&&e(i,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150",className:"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]"})]},m))}),e("div",{className:"overflow-auto",children:r?.length&&e("ul",{className:"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]",children:r.map((l,m)=>e("li",{className:"list-disc",children:e(a,{as:"div",html:l,className:"font-bold"})},m))})})]})]})}),o("div",{className:"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]",children:[e(a,{as:"p",className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:s.confirmTitle}),e(u,{loading:x,disabled:n,variant:"primary",size:"lg",className:"mt-[16px] w-full md:mt-[12px]",onClick:()=>{c("address")},children:s.confirmButton})]})]})};export{k as Init};
|
|
2
2
|
//# sourceMappingURL=Init.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type'\nimport { ConsumeType } from '../../context/const'\nimport { NoneProductValue } from './NonProductValue'\nimport { useCreditsContext } from '../../context/provider'\n\ntype InitProps = {\n copy: RedeemModalCommon\n item: RedeemableItemType\n loading: boolean\n disabled: boolean\n setStatus: (status: 'address' | 'init' | 'success' | 'error') => void\n}\n\nexport const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {\n const { pageCommon } = useCreditsContext()\n const rules = useMemo(() => {\n if (item.config.rules?.length) {\n return item.config.rules\n }\n const descriptions = item.config.desc?.split('<br>') || []\n return [...descriptions, ...(copy.product.rules || [])]\n }, [item.config.rules, item.config.desc, copy.product.rules])\n\n return (\n <div className=\"flex flex-col\">\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <>\n <div className=\"relative mx-auto h-[164px] w-fit\">\n <Picture\n source={\n item.config?.type === ConsumeType.Product\n ? item.product?.images[0]?.url\n : pageCommon?.imageMapping?.[item.config.type]?.url || item.config.image?.url\n }\n className=\"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n {/* \u793C\u54C1\u5361\u5C55\u793A */}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value && <NoneProductValue item={item} />}\n </div>\n </div>\n <div className=\"mt-[30px] md:mt-[18px]\">\n {item.config.type === 'product' && (\n <div\n className={classNames(\n 'mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {item.config.title}\n </div>\n )}\n <Text\n as=\"p\"\n className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}\n >\n {numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}\n </Text>\n </div>\n <div className=\"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{copy.product.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.product.steps?.map((item, index) => (\n <Fragment key={index}>\n <div className=\"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]\">\n <Picture source={item.imageUrl} className=\"mb-[4px] h-[58px] w-[58px]\"></Picture>\n <div className=\"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]\">\n {item.title}\n </div>\n </div>\n {index !== copy.product.steps.length - 1 && (\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150\"\n className=\"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]\"\n ></Picture>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"overflow-auto\">\n {rules?.length && (\n <ul className=\"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]\">\n {rules.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text as=\"div\" html={text} className=\"font-bold\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n </>\n </div>\n <div className=\"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]\">\n <Text\n as=\"p\"\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n disabled={disabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full md:mt-[12px]\"\n onClick={() => {\n setStatus('address')\n }}\n >\n {copy.confirmButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAkCQ,mBAAAA,EAEI,OAAAC,EADF,QAAAC,MADF,oBAlCR,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAOC,MAAgB,aACvB,OAAS,YAAAN,EAAU,WAAAO,MAAe,QAClC,OAAS,gBAAAC,MAAoB,sBAE7B,OAAS,eAAAC,MAAmB,sBAC5B,OAAS,oBAAAC,MAAwB,oBACjC,OAAS,qBAAAC,MAAyB,yBAU3B,MAAMC,EAAO,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,SAAAC,EAAU,UAAAC,CAAU,IAAiB,CAC/E,KAAM,CAAE,WAAAC,CAAW,EAAIP,EAAkB,EACnCQ,EAAQZ,EAAQ,IAChBO,EAAK,OAAO,OAAO,OACdA,EAAK,OAAO,MAGd,CAAC,GADaA,EAAK,OAAO,MAAM,MAAM,MAAM,GAAK,CAAC,EAChC,GAAID,EAAK,QAAQ,OAAS,CAAC,CAAE,EACrD,CAACC,EAAK,OAAO,MAAOA,EAAK,OAAO,KAAMD,EAAK,QAAQ,KAAK,CAAC,EAE5D,OACEX,EAAC,OAAI,UAAU,gBACb,UAAAD,EAAC,OACC,UAAWK,EACT,8FACF,EAEA,SAAAJ,EAAAF,EAAA,CACE,UAAAE,EAAC,OAAI,UAAU,mCACb,UAAAD,EAACG,EAAA,CACC,OACEU,EAAK,QAAQ,OAASL,EAAY,QAC9BK,EAAK,SAAS,OAAO,CAAC,GAAG,IACzBI,GAAY,eAAeJ,EAAK,OAAO,IAAI,GAAG,KAAOA,EAAK,OAAO,OAAO,IAE9E,UAAU,qEACX,EAEDb,EAAC,OAAI,UAAU,8DACZ,SAAAa,EAAK,OAAO,OAASb,EAACS,EAAA,CAAiB,KAAMI,EAAM,EACtD,GACF,EACAZ,EAAC,OAAI,UAAU,yBACZ,UAAAY,EAAK,OAAO,OAAS,WACpBb,EAAC,OACC,UAAWK,EACT,0FACF,EAEC,SAAAQ,EAAK,OAAO,MACf,EAEFZ,EAACG,EAAA,CACC,GAAG,IACH,UAAWC,EAAW,kFAAkF,EAEvG,UAAAE,EAAaM,EAAK,MAAM,cAAc,EAAE,IAAEI,GAAY,WACzD,GACF,EACAhB,EAAC,OAAI,UAAU,sEACb,UAAAD,EAAC,OAAI,UAAU,sCAAuC,SAAAY,EAAK,QAAQ,UAAU,EAC7EZ,EAAC,OAAI,UAAU,4CACZ,SAAAY,EAAK,QAAQ,OAAO,IAAI,CAACC,EAAMM,IAC9BlB,EAACF,EAAA,CACC,UAAAE,EAAC,OAAI,UAAU,8EACb,UAAAD,EAACG,EAAA,CAAQ,OAAQU,EAAK,SAAU,UAAU,6BAA6B,EACvEb,EAAC,OAAI,UAAU,gFACZ,SAAAa,EAAK,MACR,GACF,EACCM,IAAUP,EAAK,QAAQ,MAAM,OAAS,GACrCZ,EAACG,EAAA,CACC,OAAO,qFACP,UAAU,kEACX,IAXUgB,CAaf,CACD,EACH,EACAnB,EAAC,OAAI,UAAU,gBACZ,SAAAkB,GAAO,QACNlB,EAAC,MAAG,UAAU,mHACX,SAAAkB,EAAM,IAAI,CAACE,EAAMD,IAChBnB,EAAC,MAAG,UAAU,YACZ,SAAAA,EAACI,EAAA,CAAK,GAAG,MAAM,KAAMgB,EAAM,UAAU,YAAY,GADpBD,CAE/B,CACD,EACH,EAEJ,GACF,GACF,EACF,EACAlB,EAAC,OAAI,UAAU,+DACb,UAAAD,EAACI,EAAA,CACC,GAAG,IACH,UAAU,4EACV,KAAMQ,EAAK,aACZ,EACDZ,EAACE,EAAA,CACC,QAASY,EACT,SAAUC,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbC,EAAU,SAAS,CACrB,EAEC,SAAAJ,EAAK,cACR,GACF,GACF,CAEJ",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "Button", "Picture", "Text", "classNames", "useMemo", "numberFormat", "ConsumeType", "NoneProductValue", "useCreditsContext", "Init", "copy", "item", "loading", "disabled", "setStatus", "pageCommon", "rules", "index", "text"]
|
|
7
7
|
}
|
package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { RedeemableItem } from '../../type';
|
|
2
|
-
|
|
3
|
-
export declare const NoneProductValue: ({ item, copy }: {
|
|
2
|
+
export declare const NoneProductValue: ({ item }: {
|
|
4
3
|
item: RedeemableItem;
|
|
5
|
-
copy: CreditsRedeemListCopy;
|
|
6
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l,jsxs as i}from"react/jsx-runtime";import{Text as t}from"@anker-in/headless-ui";import{ConsumeType as n}from"../../context/const";import{useCreditsContext as a}from"../../context/provider";const d=({item:e})=>{const{pageCommon:f}=a();if(e.config?.type===n.ShippingCoupon)return l(t,{className:"text-[24px] w-[70%] font-bold leading-none",html:e.config?.value,as:"p"});if(!e.config?.value)return l(t,{className:"text-[24px] w-[70%] font-bold leading-none",html:e.config?.title,as:"p"});let o="";return e.config.type===n.Coupon?o=f?.off||"":e.config.type===n.GoGift?o=f?.goGiftLabel||"":e.config.type===n.GiftCard&&(o=f?.giftCardLabel||""),i("div",{className:"flex items-end gap-[4px]",children:[l(t,{className:"text-[64px] font-extrabold leading-none",html:e.config.value.toString()}),o&&l(t,{className:"text-[24px] font-bold leading-[2]",html:o})]})};export{d as NoneProductValue};
|
|
2
2
|
//# sourceMappingURL=NonProductValue.js.map
|
package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { RedeemableItem } from '../../type'\nimport {
|
|
5
|
-
"mappings": "AAUW,cAAAA,
|
|
6
|
-
"names": ["jsx", "jsxs", "Text", "ConsumeType", "useCreditsContext", "NoneProductValue", "item", "
|
|
4
|
+
"sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { RedeemableItem } from '../../type'\nimport { ConsumeType } from '../../context/const'\nimport { useCreditsContext } from '../../context/provider'\n\nexport const NoneProductValue = ({ item }: { item: RedeemableItem }) => {\n const { pageCommon } = useCreditsContext()\n\n // shipping coupon \u4EC5\u5C55\u793A\u6587\u6848\n if (item.config?.type === ConsumeType.ShippingCoupon) {\n return <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.value} as=\"p\" />\n }\n\n if (!item.config?.value) {\n return <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.title} as=\"p\" />\n }\n\n // \u6839\u636E\u7C7B\u578B\u786E\u5B9A\u540E\u7F00\u6587\u6848\n let suffixLabel = ''\n if (item.config.type === ConsumeType.Coupon) {\n suffixLabel = pageCommon?.off || ''\n } else if (item.config.type === ConsumeType.GoGift) {\n suffixLabel = pageCommon?.goGiftLabel || ''\n } else if (item.config.type === ConsumeType.GiftCard) {\n suffixLabel = pageCommon?.giftCardLabel || ''\n }\n\n return (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-extrabold leading-none\" html={item.config.value.toString()} />\n {suffixLabel && <Text className=\"text-[24px] font-bold leading-[2]\" html={suffixLabel} />}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAUW,cAAAA,EAkBP,QAAAC,MAlBO,oBAVX,OAAS,QAAAC,MAAY,wBAErB,OAAS,eAAAC,MAAmB,sBAC5B,OAAS,qBAAAC,MAAyB,yBAE3B,MAAMC,EAAmB,CAAC,CAAE,KAAAC,CAAK,IAAgC,CACtE,KAAM,CAAE,WAAAC,CAAW,EAAIH,EAAkB,EAGzC,GAAIE,EAAK,QAAQ,OAASH,EAAY,eACpC,OAAOH,EAACE,EAAA,CAAK,UAAU,6CAA6C,KAAMI,EAAK,QAAQ,MAAO,GAAG,IAAI,EAGvG,GAAI,CAACA,EAAK,QAAQ,MAChB,OAAON,EAACE,EAAA,CAAK,UAAU,6CAA6C,KAAMI,EAAK,QAAQ,MAAO,GAAG,IAAI,EAIvG,IAAIE,EAAc,GAClB,OAAIF,EAAK,OAAO,OAASH,EAAY,OACnCK,EAAcD,GAAY,KAAO,GACxBD,EAAK,OAAO,OAASH,EAAY,OAC1CK,EAAcD,GAAY,aAAe,GAChCD,EAAK,OAAO,OAASH,EAAY,WAC1CK,EAAcD,GAAY,eAAiB,IAI3CN,EAAC,OAAI,UAAU,2BACb,UAAAD,EAACE,EAAA,CAAK,UAAU,0CAA0C,KAAMI,EAAK,OAAO,MAAM,SAAS,EAAG,EAC7FE,GAAeR,EAACE,EAAA,CAAK,UAAU,oCAAoC,KAAMM,EAAa,GACzF,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "ConsumeType", "useCreditsContext", "NoneProductValue", "item", "pageCommon", "suffixLabel"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type';
|
|
3
2
|
type ProductInfoProps = {
|
|
4
3
|
item: RedeemableItemType;
|
|
5
|
-
copy:
|
|
4
|
+
copy: RedeemModalCommon;
|
|
6
5
|
};
|
|
7
|
-
export declare const ProductInfo: ({ item, copy }: ProductInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const ProductInfo: ({ item, copy }: ProductInfoProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
7
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as a,jsxs as
|
|
1
|
+
import{jsx as a,jsxs as t}from"react/jsx-runtime";import{Picture as s,Text as i}from"@anker-in/headless-ui";import{formatPrice as r}from"../../context/utils";import{useHeadlessContext as o}from"@anker-in/lib";import{useCreditsContext as n}from"../../context/provider";const f=({item:e,copy:l})=>{const{locale:m}=o(),{pageCommon:d}=n();return!e.product||!e.variant?null:t("div",{className:"flex w-full items-center justify-center md:items-start md:justify-start",children:[a(s,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:e.variant.image?.url||e.product.images[0]?.url,alt:e.product.title}),t("div",{className:"md:flex md:flex-col",children:[t("div",{className:"md:flex md:items-center",children:[a(s,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:e.variant.image?.url||e.product.images[0]?.url,alt:e.product.title}),a("div",{className:"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden",title:e.product.title,children:e.product.title})]}),t("div",{className:"mt-[16px] md:mt-[12px]",children:[a(i,{className:"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden",html:e.product.title,title:e.product.title}),t("div",{className:"flex font-semibold leading-[1.4] md:flex-col",children:[t("div",{className:"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]",children:[e.variant.title&&e.variant.title.toLowerCase()!=="default title"&&t("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[t("span",{children:[l.product.variantLabel,": "]}),a("span",{className:"ml-1",children:e.variant.title})]}),t("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[t("span",{children:[l.product.shippingFeeLabel,": "]}),a("span",{className:"ml-1",children:r({amount:0,currencyCode:e.product.price?.currencyCode,locale:m||"us"})})]})]}),t("div",{className:"text-[15px] font-bold text-[#777] md:text-[12px]",children:[t("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[t("span",{children:[l.product.quantityLabel,": "]}),a("span",{className:"ml-1",children:"1"})]}),t("div",{className:"l:flex l:items-center l:justify-between",children:[t("span",{children:[l.product.totalPriceLabel,": "]}),t("span",{className:"ml-1",children:[e.alpc?.consumeCredits," ",d?.pointUnit]})]})]})]})]})]})]})};export{f as ProductInfo};
|
|
2
2
|
//# sourceMappingURL=ProductInfo.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { useCreditsContext } from '../../context/provider'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: RedeemModalCommon\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useHeadlessContext()\n const { pageCommon } = useCreditsContext()\n\n // ProductInfo \u53EA\u5728 RedeemProductModal \u4E2D\u4F7F\u7528\uFF0C\u6B64\u65F6 product \u548C variant \u5FC5\u5B9A\u5B58\u5728\n if (!item.product || !item.variant) return null\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <Text\n className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\"\n html={item.product.title}\n title={item.product.title}\n ></Text>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n {item.variant.title && item.variant.title.toLowerCase() !== 'default title' && (\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title}</span>\n </div>\n )}\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {pageCommon?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAoBM,cAAAA,EAME,QAAAC,MANF,oBApBN,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC9B,OAAS,eAAAC,MAAmB,sBAE5B,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,qBAAAC,MAAyB,yBAO3B,MAAMC,EAAc,CAAC,CAAE,KAAAC,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,EAAIL,EAAmB,EAChC,CAAE,WAAAM,CAAW,EAAIL,EAAkB,EAGzC,MAAI,CAACE,EAAK,SAAW,CAACA,EAAK,QAAgB,KAGzCP,EAAC,OAAI,UAAU,0EACb,UAAAD,EAACE,EAAA,CACC,UAAU,6HACV,OAAQM,EAAK,QAAQ,OAAO,KAAOA,EAAK,QAAQ,OAAO,CAAC,GAAG,IAC3D,IAAKA,EAAK,QAAQ,MACnB,EACDP,EAAC,OAAI,UAAU,sBACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACE,EAAA,CACC,UAAU,iIACV,OAAQM,EAAK,QAAQ,OAAO,KAAOA,EAAK,QAAQ,OAAO,CAAC,GAAG,IAC3D,IAAKA,EAAK,QAAQ,MACnB,EACDR,EAAC,OAAI,UAAU,2DAA2D,MAAOQ,EAAK,QAAQ,MAC3F,SAAAA,EAAK,QAAQ,MAChB,GACF,EAEAP,EAAC,OAAI,UAAU,yBACb,UAAAD,EAACG,EAAA,CACC,UAAU,yDACV,KAAMK,EAAK,QAAQ,MACnB,MAAOA,EAAK,QAAQ,MACrB,EACDP,EAAC,OAAI,UAAU,+CACb,UAAAA,EAAC,OAAI,UAAU,qEACZ,UAAAO,EAAK,QAAQ,OAASA,EAAK,QAAQ,MAAM,YAAY,IAAM,iBAC1DP,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,QAAQ,aAAa,MAAE,EACnCT,EAAC,QAAK,UAAU,OAAQ,SAAAQ,EAAK,QAAQ,MAAM,GAC7C,EAEFP,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,QAAQ,iBAAiB,MAAE,EACvCT,EAAC,QAAK,UAAU,OACb,SAAAI,EAAY,CACX,OAAQ,EACR,aAAcI,EAAK,QAAQ,OAAO,aAClC,OAAQE,GAAU,IACpB,CAAC,EACH,GACF,GACF,EACAT,EAAC,OAAI,UAAU,mDACb,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,QAAQ,cAAc,MAAE,EACpCT,EAAC,QAAK,UAAU,OAAO,aAAC,GAC1B,EACAC,EAAC,OAAI,UAAU,0CACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,QAAQ,gBAAgB,MAAE,EACtCR,EAAC,QAAK,UAAU,OACb,UAAAO,EAAK,MAAM,eAAe,IAAEG,GAAY,WAC3C,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
|
|
6
6
|
"names": ["jsx", "jsxs", "Picture", "Text", "formatPrice", "useHeadlessContext", "useCreditsContext", "ProductInfo", "item", "copy", "locale", "pageCommon"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type';
|
|
3
2
|
type SuccessProps = {
|
|
4
|
-
copy:
|
|
3
|
+
copy: RedeemModalCommon;
|
|
5
4
|
shippingProduct: string;
|
|
6
5
|
loading: boolean;
|
|
7
6
|
address: Record<string, any> | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as y}from"react/jsx-runtime";import{Button as u,Text as t}from"@anker-in/headless-ui";import d from"classnames";import{ProductInfo as f}from"./ProductInfo";import{useHeadlessContext as b}from"@anker-in/lib";import{ROUNDED_BRANDS as v}from"../../../../constants";const T=({copy:o,shippingProduct:m,loading:s,address:a,disabled:p,onClose:l,item:n})=>{const{brand:r}=b(),i=v.includes(r);return e("div",{className:d("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:y("div",{className:"flex flex-col items-center",children:[e("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:o.product.successDesc.map((x,c)=>e(t,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:x},c))}),m&&e(t,{className:"mb-5 text-[16px] font-bold",html:m}),e("div",{className:d("flex w-full items-center bg-[#F5F5F7] p-[16px]",!i&&"rounded-none"),children:e(f,{item:n,copy:o})}),e(u,{loading:s||!a,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:l,disabled:p,children:o.product.paymentButton})]})})};export{T as Success};
|
|
2
2
|
//# sourceMappingURL=Success.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type'\nimport { ProductInfo } from './ProductInfo'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ntype SuccessProps = {\n copy: RedeemModalCommon\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAsBM,OAGM,OAAAA,EAHN,QAAAC,MAAA,oBAtBN,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAOC,MAAgB,aAEvB,OAAS,eAAAC,MAAmB,gBAC5B,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,kBAAAC,MAAsB,wBAYxB,MAAMC,EAAU,CAAC,CAAE,KAAAC,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAAoB,CAC7G,KAAM,CAAE,MAAAC,CAAM,EAAIV,EAAmB,EAC/BW,EAAUV,EAAe,SAASS,CAAK,EAC7C,OACEhB,EAAC,OAAI,UAAWI,EAAW,iFAAiF,EAC1G,SAAAH,EAAC,OAAI,UAAU,6BACb,UAAAD,EAAC,OAAI,UAAU,wDACZ,SAAAS,EAAK,QAAQ,YAAY,IAAI,CAACS,EAAqBC,IAClDnB,EAACG,EAAA,CAAiB,UAAU,qDAAqD,KAAMe,GAA5EC,CAAyF,CACrG,EACH,EAECT,GAAmBV,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMO,EAAiB,EAExFV,EAAC,OAAI,UAAWI,EAAW,iDAAkD,CAACa,GAAW,cAAc,EACrG,SAAAjB,EAACK,EAAA,CAAY,KAAMU,EAAM,KAAMN,EAAM,EACvC,EAEAT,EAACE,EAAA,CACC,QAASS,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,QAAQ,cAChB,GACF,EACF,CAEJ",
|
|
6
6
|
"names": ["jsx", "jsxs", "Button", "Text", "classNames", "ProductInfo", "useHeadlessContext", "ROUNDED_BRANDS", "Success", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "brand", "rounded", "description", "index"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AlpcErrorCode } from '../../context/const';
|
|
2
|
-
import type { ModalContainerProps } from '../../modal/
|
|
3
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
4
|
-
|
|
5
|
-
type RedeemProductModalProps = ModalContainerProps & {
|
|
2
|
+
import type { ModalContainerProps } from '../../modal/ModalContainer';
|
|
3
|
+
import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type';
|
|
4
|
+
type RedeemProductModalProps = Omit<ModalContainerProps, 'isOpen'> & {
|
|
6
5
|
item: RedeemableItemType;
|
|
7
|
-
copy:
|
|
6
|
+
copy: RedeemModalCommon;
|
|
8
7
|
onError: (code: AlpcErrorCode) => void;
|
|
9
8
|
};
|
|
10
9
|
declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as u,jsxs as
|
|
1
|
+
import{jsx as u,jsxs as W}from"react/jsx-runtime";import A from"classnames";import{useCallback as q,useEffect as w,useMemo as F,useState as m}from"react";import{useCreditsContext as K}from"../../context/provider";import _ from"../../context/hooks/useCountries";import{AlpcErrorCode as l}from"../../context/const";import{useAddressValidate as k}from"../../context/hooks/useAddressValidate";import{useRedeemProduct as T}from"../../context/hooks/useRedeemProduct";import{CreditsModalContainer as B}from"../../modal/ModalContainer";import{useHeadlessContext as G}from"@anker-in/lib";import{Error as H}from"./Error";import{Success as J}from"./Success";import{Address as V}from"./Address";import{Init as z}from"./Init";function Q({item:s,copy:e,onError:h,...E}){const{fetchCreditInfo:I,profile:v,pageCommon:N}=K(),{storeDomain:S}=G(),{shippingAddress:x,shippingProduct:b}=e.product,[t,d]=m("init"),[i,M]=m(),[U,a]=m({code:0,message:"",imageUrl:""}),[c,n]=m(!1),{countries:P=[],isLoading:X}=_({shopifyStoreDomain:S}),{isMutating:f,trigger:R}=T({onSuccess(r){if(!r){d("error"),a({code:0,imageUrl:e.errorImageUrl||"",message:e.commonError||""});return}if(r?.code===0)I(v?.user_id),d("success");else{let o,C;r.code===l.CodeLpcShopifyCouponRuleRedeemLimit?(o=e.redeemLimitError,n(!0)):r.code===l.CodeLpcRuleInventoryNotEnough?(o=e.inventoryNotEnough,n(!0),C=e.inventoryNotEnough):r.code===l.CodeLpcNotEnoughCredits?(o=e.creditsNotEnough,n(!0),I(v?.user_id)):r.code===l.CodeCrossSiteError&&(o=e.crossSiteError,n(!0)),d("error"),a({code:r.code,imageUrl:C||e.errorImageUrl||"",message:o||e.commonError||""}),h&&h(r.code)}},onError(r){d("error"),a({code:0,imageUrl:e.errorImageUrl||"",message:e.commonError||""})}}),p=F(()=>e?.product.form?.flat().find(o=>o.type==="state")?.key,[e?.product.form]),{validate:g,errors:y}=k({address:i,validatorInfo:N?.validatorInfo,formData:e?.product.form?.flat()||[],errorLabel:{require:e.product.required,email:e.product.invalidEmail}}),L=q(async()=>{const r=[];if(p&&((P.find(O=>O.code===i.country)?.provinces||[]).length||r.push(p)),g({force:!0,ignoreKeys:r}))return;let o={...i};o.name&&delete o.name,o.country==="UK"&&(o.country="GB"),R({address:btoa(JSON.stringify(o)),rule_id:Number(s.alpc?.id)})},[s,R,p,g,i,P]);return w(()=>()=>{n(!1),a({code:0,message:"",imageUrl:""}),d("init"),M(void 0)},[]),W(B,{...E,isOpen:!!s,className:A("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",t!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:A("h-[56px]",t==="init"&&"bg-[#F5F5F7]"),title:t==="address"?"Order Confirmation":"",children:[t==="error"&&u(H,{errorInfo:U}),t==="success"&&u(J,{copy:e,shippingProduct:b,loading:f,address:i,disabled:c,onClose:E.onClose,item:s}),t==="address"&&u(V,{copy:e,shippingAddress:x,setAddress:M,validateAddress:g,validateErrors:y,shippingProduct:b,loading:f,address:i,disabled:c,handlePayment:L,item:s}),t==="init"&&u(z,{item:s,copy:e,loading:f,disabled:c,setStatus:d})]})}var ae=Q;export{ae as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|