@anker-in/campaign-ui 0.2.10-beta.1 → 0.2.10-beta.10
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/chat/chat-context.d.ts +101 -0
- package/dist/cjs/components/chat/{chatContext.js → chat-context.js} +1 -1
- package/dist/cjs/components/chat/{chatContext.js.map → chat-context.js.map} +2 -2
- package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
- 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/useRedeemAndBuy.d.ts +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
- 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/hooks/useSendEmailValidation.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
- package/dist/cjs/components/credits/credits-banner/index.d.ts +23 -0
- package/dist/cjs/components/credits/{creditsBanner → credits-banner}/index.js.map +2 -2
- package/dist/cjs/components/credits/credits-benefits/benefitItem.d.ts +19 -0
- package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/benefitItem.js.map +1 -1
- package/dist/cjs/components/credits/credits-benefits/iconInfo.d.ts +2 -0
- package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/iconInfo.js.map +1 -1
- package/dist/cjs/components/credits/credits-benefits/index.d.ts +12 -0
- package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/index.js.map +2 -2
- package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +15 -0
- package/dist/cjs/components/credits/{creditsCash → credits-cash}/RedeemableItem.js.map +1 -1
- package/dist/cjs/components/credits/credits-cash/index.d.ts +13 -0
- package/dist/cjs/components/credits/credits-cash/index.js +2 -0
- package/dist/cjs/components/credits/credits-cash/index.js.map +7 -0
- package/dist/cjs/components/credits/credits-cash/type.d.ts +47 -0
- package/dist/cjs/components/credits/credits-cash/type.js.map +7 -0
- package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +13 -0
- package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +13 -0
- package/dist/cjs/components/credits/{creditsFaq/faqItem/FaqItem.js → credits-faq/faq-item/faq-item.js} +1 -1
- package/dist/cjs/components/credits/{creditsFaq/faqItem/FaqItem.js.map → credits-faq/faq-item/faq-item.js.map} +2 -2
- package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +13 -0
- package/dist/cjs/components/credits/credits-faq/index.d.ts +16 -0
- package/dist/cjs/components/credits/{creditsFaq → credits-faq}/index.js.map +2 -2
- package/dist/cjs/components/credits/credits-info-card/index.d.ts +20 -0
- package/dist/cjs/components/credits/{creditsInfoCard → credits-info-card}/index.js.map +2 -2
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +13 -0
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +14 -0
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +6 -0
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +15 -0
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +26 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +9 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +20 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +8 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +11 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +13 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +11 -0
- package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +9 -0
- package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/RedeemableItem.js.map +1 -1
- package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +13 -0
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/Input.js.map +1 -1
- package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +14 -0
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/CountrySelect.js → credits-redeem-list/address-form/country-select.js} +1 -1
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/CountrySelect.js.map → credits-redeem-list/address-form/country-select.js.map} +2 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +6 -0
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/FormItem.js → credits-redeem-list/address-form/form-item.js} +1 -1
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/FormItem.js.map → credits-redeem-list/address-form/form-item.js.map} +2 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +7 -0
- package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +15 -0
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/StateSelect.js → credits-redeem-list/address-form/state-select.js} +1 -1
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/StateSelect.js.map → credits-redeem-list/address-form/state-select.js.map} +2 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +26 -0
- package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/type.js.map +1 -1
- package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +13 -0
- package/dist/cjs/components/credits/credits-redeem-list/index.js +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/index.js.map +7 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +9 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +7 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +20 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +7 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +8 -0
- package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Error.js.map +1 -1
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +11 -0
- package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Init.js.map +1 -1
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +8 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +7 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +13 -0
- package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Success.js.map +1 -1
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +11 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +2 -0
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +7 -0
- package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +77 -0
- package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/type.js.map +1 -1
- package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +2 -0
- package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/index.js.map +2 -2
- package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +60 -0
- package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/type.js.map +1 -1
- package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +96 -0
- package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +2 -0
- package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/type.d.ts +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +14 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +15 -0
- package/dist/cjs/components/credits/type.d.ts +1 -1
- package/dist/cjs/components/credits/type.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -6
- package/dist/cjs/index.js +726 -1
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/shopify/context/ShopifyProvider.d.ts +1 -1
- package/dist/cjs/shopify/context/index.d.ts +1 -0
- package/dist/cjs/shopify/context/shopify-provider.d.ts +10 -0
- package/dist/cjs/shopify/fetchers/create-cart.d.ts +1 -2
- package/dist/cjs/shopify/hooks/index.d.ts +2 -2
- package/dist/cjs/shopify/hooks/use-create-cart.d.ts +2 -0
- package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +4 -0
- package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +1 -1
- package/dist/cjs/shopify/types/index.d.ts +2 -0
- package/dist/cjs/tsconfig.tsbuildinfo +1 -0
- package/dist/esm/components/chat/chat-context.d.ts +101 -0
- package/dist/esm/components/chat/chat-context.js +2 -0
- package/dist/esm/components/chat/chat-context.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
- package/dist/esm/components/credits/context/hooks/useActivities.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +1 -1
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +1 -1
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +3 -3
- package/dist/esm/components/credits/credits-banner/index.d.ts +23 -0
- package/dist/esm/components/credits/credits-banner/index.js +2 -0
- package/dist/esm/components/credits/credits-banner/index.js.map +7 -0
- package/dist/esm/components/credits/credits-benefits/benefitItem.d.ts +19 -0
- package/dist/esm/components/credits/credits-benefits/benefitItem.js +2 -0
- package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +7 -0
- package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +2 -0
- package/dist/esm/components/credits/credits-benefits/iconInfo.js +2 -0
- package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +7 -0
- package/dist/esm/components/credits/credits-benefits/index.d.ts +12 -0
- package/dist/esm/components/credits/credits-benefits/index.js +4 -0
- package/dist/esm/components/credits/credits-benefits/index.js.map +7 -0
- package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +15 -0
- package/dist/esm/components/credits/credits-cash/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/credits-cash/index.d.ts +13 -0
- package/dist/esm/components/credits/credits-cash/index.js +2 -0
- package/dist/esm/components/credits/credits-cash/index.js.map +7 -0
- package/dist/esm/components/credits/credits-cash/type.d.ts +47 -0
- package/dist/esm/components/credits/credits-cash/type.js +1 -0
- package/dist/esm/components/credits/credits-cash/type.js.map +7 -0
- package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +13 -0
- package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +13 -0
- package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +2 -0
- package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +7 -0
- package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +13 -0
- package/dist/esm/components/credits/credits-faq/index.d.ts +16 -0
- package/dist/esm/components/credits/credits-faq/index.js +2 -0
- package/dist/esm/components/credits/credits-faq/index.js.map +7 -0
- package/dist/esm/components/credits/credits-info-card/index.d.ts +20 -0
- package/dist/esm/components/credits/credits-info-card/index.js +2 -0
- package/dist/esm/components/credits/credits-info-card/index.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +13 -0
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +14 -0
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +6 -0
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +2 -0
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +15 -0
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +26 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +9 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +20 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +8 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +11 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +13 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +11 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +9 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +13 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +14 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +6 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +2 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +15 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +26 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/type.js +1 -0
- package/dist/esm/components/credits/credits-redeem-list/address-form/type.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/index.d.ts +13 -0
- package/dist/esm/components/credits/credits-redeem-list/index.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/index.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +9 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +20 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +8 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +11 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +8 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +13 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +11 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +2 -0
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +7 -0
- package/dist/esm/components/credits/credits-redeem-list/type.d.ts +77 -0
- package/dist/esm/components/credits/credits-redeem-list/type.js +1 -0
- package/dist/esm/components/credits/credits-redeem-list/type.js.map +7 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +2 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +2 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +7 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +60 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +2 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +7 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +96 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +2 -0
- package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
- package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
- package/dist/esm/components/credits/creditsCash/index.js +1 -1
- package/dist/esm/components/credits/creditsCash/index.js.map +2 -2
- package/dist/esm/components/credits/creditsCash/type.d.ts +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +14 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +15 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +2 -2
- 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/ProductInfo.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +2 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.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/type.d.ts +1 -1
- package/dist/esm/debug-env.js +2 -0
- package/dist/esm/debug-env.js.map +7 -0
- package/dist/esm/index.d.ts +1 -6
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/shopify/context/ShopifyProvider.d.ts +1 -1
- package/dist/esm/shopify/context/index.d.ts +1 -0
- package/dist/esm/shopify/context/shopify-provider.d.ts +10 -0
- package/dist/esm/shopify/fetchers/create-cart.d.ts +1 -2
- package/dist/esm/shopify/hooks/index.d.ts +2 -2
- package/dist/esm/shopify/hooks/use-create-cart.d.ts +2 -0
- package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +4 -0
- package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +1 -1
- package/dist/esm/shopify/types/index.d.ts +2 -0
- package/dist/esm/stories/chat.stories.js +2 -0
- package/dist/esm/stories/chat.stories.js.map +7 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/package.json +8 -3
- package/src/components/credits/context/hooks/useActivities.ts +1 -1
- package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
- package/src/components/credits/context/hooks/useAlpcFetch.ts +3 -3
- package/src/components/credits/context/hooks/useCountries.ts +2 -2
- package/src/components/credits/context/hooks/useMyRewards.ts +1 -1
- package/src/components/credits/context/hooks/useRedeemAndBuy.ts +2 -2
- package/src/components/credits/context/hooks/useRedeemCoupon.ts +1 -1
- package/src/components/credits/context/hooks/useRedeemProduct.ts +1 -1
- package/src/components/credits/context/hooks/useRedeemableList.ts +1 -1
- package/src/components/credits/context/hooks/useSendEmailValidation.ts +1 -1
- package/src/components/credits/context/hooks/useSubscribed.ts +1 -1
- package/src/components/credits/context/hooks/useSubscriptions.ts +2 -2
- package/src/components/credits/creditsBenefits/index.tsx +3 -5
- package/src/components/credits/creditsCash/index.tsx +2 -2
- package/src/components/credits/creditsCash/type.ts +1 -1
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +1 -1
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +1 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +1 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +1 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +1 -1
- package/src/components/credits/creditsRedeemList/index.tsx +1 -1
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +1 -1
- package/src/components/credits/modal/loadingDots.tsx +2 -2
- package/src/components/credits/type.ts +1 -1
- package/src/index.ts +2 -21
- package/dist/cjs/components/credits/creditsCash/index.js +0 -2
- package/dist/cjs/components/credits/creditsCash/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsCash/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
- package/src/shopify/MIGRATION_GUIDE.md +0 -156
- package/src/shopify/context/ShopifyProvider.tsx +0 -34
- package/src/shopify/dist/cart-BNkVu3fh.d.ts +0 -220
- package/src/shopify/dist/cart-BcrGTPdx.d.cts +0 -220
- package/src/shopify/dist/fetchers.cjs +0 -7945
- package/src/shopify/dist/fetchers.cjs.map +0 -1
- package/src/shopify/dist/fetchers.d.cts +0 -3
- package/src/shopify/dist/fetchers.d.ts +0 -3
- package/src/shopify/dist/fetchers.js +0 -7942
- package/src/shopify/dist/fetchers.js.map +0 -1
- package/src/shopify/dist/fragments.cjs +0 -731
- package/src/shopify/dist/fragments.cjs.map +0 -1
- package/src/shopify/dist/fragments.d.cts +0 -25
- package/src/shopify/dist/fragments.d.ts +0 -25
- package/src/shopify/dist/fragments.js +0 -705
- package/src/shopify/dist/fragments.js.map +0 -1
- package/src/shopify/dist/graphql-D4M28V-x.d.cts +0 -3558
- package/src/shopify/dist/graphql-D4M28V-x.d.ts +0 -3558
- package/src/shopify/dist/hooks.cjs +0 -9431
- package/src/shopify/dist/hooks.cjs.map +0 -1
- package/src/shopify/dist/hooks.d.cts +0 -14
- package/src/shopify/dist/hooks.d.ts +0 -14
- package/src/shopify/dist/hooks.js +0 -9427
- package/src/shopify/dist/hooks.js.map +0 -1
- package/src/shopify/dist/index-BTtE4HZM.d.ts +0 -42
- package/src/shopify/dist/index-BjNIecYX.d.cts +0 -42
- package/src/shopify/dist/index.cjs +0 -9642
- package/src/shopify/dist/index.cjs.map +0 -1
- package/src/shopify/dist/index.d.cts +0 -11
- package/src/shopify/dist/index.d.ts +0 -11
- package/src/shopify/dist/index.js +0 -9619
- package/src/shopify/dist/index.js.map +0 -1
- package/src/shopify/dist/product-Bqi3sqb9.d.cts +0 -262
- package/src/shopify/dist/product-DNk6jYAP.d.ts +0 -262
- package/src/shopify/dist/queries.cjs +0 -615
- package/src/shopify/dist/queries.cjs.map +0 -1
- package/src/shopify/dist/queries.d.cts +0 -3
- package/src/shopify/dist/queries.d.ts +0 -3
- package/src/shopify/dist/queries.js +0 -601
- package/src/shopify/dist/queries.js.map +0 -1
- package/src/shopify/dist/types.cjs +0 -19
- package/src/shopify/dist/types.cjs.map +0 -1
- package/src/shopify/dist/types.d.cts +0 -282
- package/src/shopify/dist/types.d.ts +0 -282
- package/src/shopify/dist/types.js +0 -1
- package/src/shopify/dist/types.js.map +0 -1
- package/src/shopify/dist/utils.cjs +0 -334
- package/src/shopify/dist/utils.cjs.map +0 -1
- package/src/shopify/dist/utils.d.cts +0 -12
- package/src/shopify/dist/utils.d.ts +0 -12
- package/src/shopify/dist/utils.js +0 -319
- package/src/shopify/dist/utils.js.map +0 -1
- package/src/shopify/fetchers/create-cart.ts +0 -40
- package/src/shopify/fetchers/get-products-by-handles.ts +0 -41
- package/src/shopify/fetchers/index.ts +0 -3
- package/src/shopify/fragments/article.ts +0 -51
- package/src/shopify/fragments/blog.ts +0 -10
- package/src/shopify/fragments/cart.ts +0 -190
- package/src/shopify/fragments/collection.ts +0 -15
- package/src/shopify/fragments/image.ts +0 -8
- package/src/shopify/fragments/index.ts +0 -11
- package/src/shopify/fragments/metafields.ts +0 -17
- package/src/shopify/fragments/page-info.ts +0 -8
- package/src/shopify/fragments/page.ts +0 -12
- package/src/shopify/fragments/product.ts +0 -71
- package/src/shopify/fragments/seo.ts +0 -6
- package/src/shopify/fragments/variant.ts +0 -29
- package/src/shopify/gql/fragment-masking.ts +0 -85
- package/src/shopify/gql/gql.ts +0 -110
- package/src/shopify/gql/graphql.ts +0 -11780
- package/src/shopify/gql/index.ts +0 -4
- package/src/shopify/hooks/index.ts +0 -2
- package/src/shopify/hooks/useCreateCart.ts +0 -24
- package/src/shopify/hooks/useProductsByHandles.ts +0 -25
- package/src/shopify/mutations/create-cart.ts +0 -16
- package/src/shopify/package.json +0 -84
- package/src/shopify/queries/get-product-by-handles.ts +0 -32
- package/src/shopify/queries/index.ts +0 -2
- package/src/shopify/src/index.ts +0 -5
- package/src/shopify/tsconfig.json +0 -25
- package/src/shopify/tsup.config.ts +0 -21
- package/src/shopify/types/article.ts +0 -46
- package/src/shopify/types/cart.ts +0 -202
- package/src/shopify/types/checkout.ts +0 -44
- package/src/shopify/types/collection.ts +0 -104
- package/src/shopify/types/common.ts +0 -53
- package/src/shopify/types/config.ts +0 -14
- package/src/shopify/types/customer.ts +0 -31
- package/src/shopify/types/fetcher.ts +0 -61
- package/src/shopify/types/index.ts +0 -10
- package/src/shopify/types/page.ts +0 -45
- package/src/shopify/types/product.ts +0 -176
- package/src/shopify/types/search.ts +0 -62
- package/src/shopify/types/site.ts +0 -38
- package/src/shopify/types/type-helper.ts +0 -5
- package/src/shopify/utils/colors.ts +0 -206
- package/src/shopify/utils/const.ts +0 -115
- package/src/shopify/utils/cookie.ts +0 -39
- package/src/shopify/utils/errors.ts +0 -65
- package/src/shopify/utils/fetch-graphql-api.ts +0 -67
- package/src/shopify/utils/handle-fetch-response.ts +0 -60
- package/src/shopify/utils/helper.ts +0 -89
- package/src/shopify/utils/normalize/cart.ts +0 -106
- package/src/shopify/utils/normalize/customer.ts +0 -18
- package/src/shopify/utils/normalize/index.ts +0 -2
- package/src/shopify/utils/normalize/metafield.ts +0 -69
- package/src/shopify/utils/normalize/product.ts +0 -193
- package/src/shopify/utils/store.ts +0 -5
- package/src/shopify/utils/type-helper.ts +0 -7
- /package/dist/cjs/components/credits/{creditsBanner → credits-banner}/index.js +0 -0
- /package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/benefitItem.js +0 -0
- /package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/iconInfo.js +0 -0
- /package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/index.js +0 -0
- /package/dist/cjs/components/credits/{creditsCash → credits-cash}/RedeemableItem.js +0 -0
- /package/dist/cjs/components/credits/{creditsCash → credits-cash}/type.js +0 -0
- /package/dist/cjs/components/credits/{creditsFaq → credits-faq}/index.js +0 -0
- /package/dist/cjs/components/credits/{creditsInfoCard → credits-info-card}/index.js +0 -0
- /package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/RedeemableItem.js +0 -0
- /package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/Input.js +0 -0
- /package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/type.js +0 -0
- /package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Error.js +0 -0
- /package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Init.js +0 -0
- /package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Success.js +0 -0
- /package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/type.js +0 -0
- /package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/index.js +0 -0
- /package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/type.js +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CreditsPageCommon } from '../type';
|
|
2
|
+
export type CreditsRedeemListCopy = {
|
|
3
|
+
title: string;
|
|
4
|
+
giftCardLabel: string;
|
|
5
|
+
unlockRewards: string;
|
|
6
|
+
btnRedeem: string;
|
|
7
|
+
list: {
|
|
8
|
+
label: string;
|
|
9
|
+
list: {
|
|
10
|
+
id: string;
|
|
11
|
+
type: string;
|
|
12
|
+
value: string;
|
|
13
|
+
rules: string[];
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
validatorInfo: {
|
|
17
|
+
addressInfo: {
|
|
18
|
+
name: string;
|
|
19
|
+
country: string;
|
|
20
|
+
province: string;
|
|
21
|
+
city: string;
|
|
22
|
+
address: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
redeemModal: {
|
|
26
|
+
confirmTitle: string;
|
|
27
|
+
confirmButton: string;
|
|
28
|
+
commonError: string;
|
|
29
|
+
redeemLimitError: string;
|
|
30
|
+
inventoryNotEnough: string;
|
|
31
|
+
creditsNotEnough: string;
|
|
32
|
+
crossSiteError: string;
|
|
33
|
+
errorImageUrl: string;
|
|
34
|
+
coupon: {
|
|
35
|
+
successDesc: string;
|
|
36
|
+
successTitle: string;
|
|
37
|
+
successButton: string;
|
|
38
|
+
successButtonUrl: string;
|
|
39
|
+
};
|
|
40
|
+
product: {
|
|
41
|
+
required: string;
|
|
42
|
+
invalidEmail: string;
|
|
43
|
+
shippingAddress: string;
|
|
44
|
+
shippingProduct: string;
|
|
45
|
+
addressForm: {
|
|
46
|
+
key: string;
|
|
47
|
+
type: string;
|
|
48
|
+
label: string;
|
|
49
|
+
isSelect: boolean;
|
|
50
|
+
required: boolean;
|
|
51
|
+
placeholder: string;
|
|
52
|
+
}[][];
|
|
53
|
+
form: {
|
|
54
|
+
key: string;
|
|
55
|
+
type: string;
|
|
56
|
+
isSelect: boolean;
|
|
57
|
+
required: boolean;
|
|
58
|
+
placeholder: string;
|
|
59
|
+
}[][];
|
|
60
|
+
successDesc: string[];
|
|
61
|
+
rules: string[];
|
|
62
|
+
steps: {
|
|
63
|
+
imageUrl: string;
|
|
64
|
+
title: string;
|
|
65
|
+
}[];
|
|
66
|
+
quantityLabel: string;
|
|
67
|
+
totalPriceLabel: string;
|
|
68
|
+
variantLabel: string;
|
|
69
|
+
shippingFeeLabel: string;
|
|
70
|
+
paymentButton: string;
|
|
71
|
+
stepTitle: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
copied: string;
|
|
75
|
+
off: string;
|
|
76
|
+
copy: string;
|
|
77
|
+
} & CreditsPageCommon;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/
|
|
3
|
+
"sources": ["../../../../../src/components/credits/credits-redeem-list/type.ts"],
|
|
4
4
|
"sourcesContent": ["import { CreditsPageCommon } from '../type'\n\nexport type CreditsRedeemListCopy = {\n title: string\n giftCardLabel: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n validatorInfo: {\n addressInfo: {\n name: string\n country: string\n province: string\n city: string\n address: string\n }\n }\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n copied: string\n off: string\n copy: string\n} & CreditsPageCommon\n"],
|
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
6
|
"names": ["type_exports", "__toCommonJS"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/
|
|
3
|
+
"sources": ["../../../../../src/components/credits/credits-ways-to-get-credits/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers/index'\n\nexport const CreditsWaysToGetCredits = ({\n copy,\n activate,\n subscribe,\n uploadReceipt,\n classNames,\n}: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const isLogin = !!profile\n\n const { actions } = useActions({ copy, activate, subscribe, uploadReceipt })\n\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n return (\n <Container id=\"ways-to-get-credits\" className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div className=\"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]\">\n <Heading as=\"h2\" size={4} html={copy?.title} className=\"text-center l:pl-[16px] l:text-left\" />\n <div className=\"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]\">\n <div className=\"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]\">\n <Heading size={3} as=\"h3\" html={copy.subtitle} className={classNames?.subtitle} />\n <div className=\"mt-[8px] flex items-center\">\n {copy.creditsIcon?.url && (\n <Picture\n className=\"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand\"\n source={copy.creditsIcon.url}\n alt={copy.creditsIcon.alt || 'credits'}\n />\n )}\n <Heading\n html={copy.equalCredits}\n size={4}\n as=\"h3\"\n className={cn('mt-2 text-white md:text-[24px]', classNames?.equalCreditsText)}\n />\n </div>\n </div>\n <Picture className=\"w-full laptop:w-[50%]\" source={copy.mainImage?.url} />\n </div>\n\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className=\"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]\"\n >\n <div>\n <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && uploadReceipt.isSuccess) &&\n !(item.id === TaskType.Activate && activate.isSuccess) &&\n !(item.id === TaskType.Subscribe && subscribe.isSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n loading={item.id === TaskType.Activate && activate.isSendingActivateEmail}\n size=\"lg\"\n className=\"mt-[24px] w-fit\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button variant=\"primary\" size=\"lg\" className=\"mt-[24px] w-fit\" disabled>\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && (\n <div\n className=\"absolute inset-0 min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}\n ></div>\n )}\n </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n </Container>\n )\n}\n"],
|
|
5
5
|
"mappings": "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",
|
|
6
|
-
"names": ["
|
|
6
|
+
"names": ["credits_ways_to_get_credits_exports", "__export", "CreditsWaysToGetCredits", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_framer_motion", "import_react", "import_type", "import_useActions", "import_provider", "import_helpers", "copy", "activate", "subscribe", "uploadReceipt", "classNames", "showMore", "setShowMore", "profile", "isLogin", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
|
|
2
|
+
export type BenefitItem = {
|
|
3
|
+
title: string;
|
|
4
|
+
credits: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
export type WaysToGetCreditsCopy = {
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle: string;
|
|
10
|
+
equalCredits: string;
|
|
11
|
+
musicIcon: string;
|
|
12
|
+
list: BenefitItem[];
|
|
13
|
+
mainImage: {
|
|
14
|
+
url: string;
|
|
15
|
+
alt: string;
|
|
16
|
+
};
|
|
17
|
+
joinNow: string;
|
|
18
|
+
activate: string;
|
|
19
|
+
completed: string;
|
|
20
|
+
completeProfile: string;
|
|
21
|
+
makeFirstPurchase: string;
|
|
22
|
+
goShopLink: string;
|
|
23
|
+
uploadReceipt: string;
|
|
24
|
+
shopNow: string;
|
|
25
|
+
subscribe: string;
|
|
26
|
+
sendEmailSuccess: string;
|
|
27
|
+
creditsIcon: {
|
|
28
|
+
url: string;
|
|
29
|
+
alt: string;
|
|
30
|
+
};
|
|
31
|
+
receipt: ReceiptCopy;
|
|
32
|
+
};
|
|
33
|
+
export declare enum TaskType {
|
|
34
|
+
Activate = "activate",
|
|
35
|
+
Subscribe = "subscribe",
|
|
36
|
+
CompleteProfile = "completeProfile",
|
|
37
|
+
FirstPurchase = "firstPurchase",
|
|
38
|
+
UploadReceipt = "uploadReceipt",
|
|
39
|
+
Shop = "shop"
|
|
40
|
+
}
|
|
41
|
+
export type CreditsWaysToGetCreditsProps = {
|
|
42
|
+
copy: WaysToGetCreditsCopy;
|
|
43
|
+
classNames?: {
|
|
44
|
+
equalCreditsText?: string;
|
|
45
|
+
subtitle?: string;
|
|
46
|
+
};
|
|
47
|
+
activate: {
|
|
48
|
+
openAuthCodePopup: () => void;
|
|
49
|
+
isSuccess: boolean;
|
|
50
|
+
isSendingActivateEmail: boolean;
|
|
51
|
+
};
|
|
52
|
+
subscribe: {
|
|
53
|
+
openSubscribePopup: () => void;
|
|
54
|
+
isSuccess: boolean;
|
|
55
|
+
};
|
|
56
|
+
uploadReceipt: {
|
|
57
|
+
openUploadReceiptPopup: () => void;
|
|
58
|
+
isSuccess: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/
|
|
3
|
+
"sources": ["../../../../../src/components/credits/credits-ways-to-get-credits/type.ts"],
|
|
4
4
|
"sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type WaysToGetCreditsCopy = {\n title: string\n subtitle: string\n equalCredits: string\n musicIcon: string\n list: BenefitItem[]\n mainImage: {\n url: string\n alt: string\n }\n joinNow: string\n activate: string\n completed: string\n completeProfile: string\n makeFirstPurchase: string\n goShopLink: string\n uploadReceipt: string\n shopNow: string\n subscribe: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n}\n\nexport enum TaskType {\n Activate = 'activate',\n Subscribe = 'subscribe',\n CompleteProfile = 'completeProfile',\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shop = 'shop',\n}\n\nexport type CreditsWaysToGetCreditsProps = {\n copy: WaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n isSendingActivateEmail: boolean\n }\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n}\n"],
|
|
5
5
|
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAmCO,IAAKE,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
|
|
6
6
|
"names": ["type_exports", "__export", "TaskType", "__toCommonJS"]
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { CreditsWaysToGetCreditsProps } from './type';
|
|
2
|
+
export declare const useActions: ({ copy, subscribe, uploadReceipt, activate, gaParameters, }: CreditsWaysToGetCreditsProps & {
|
|
3
|
+
gaParameters?: {
|
|
4
|
+
position: string;
|
|
5
|
+
};
|
|
6
|
+
}) => {
|
|
7
|
+
actions: {
|
|
8
|
+
activate: {
|
|
9
|
+
finished: any;
|
|
10
|
+
notLogin: {
|
|
11
|
+
buttonLabel: string;
|
|
12
|
+
handleClick: () => void;
|
|
13
|
+
};
|
|
14
|
+
notFinished: {
|
|
15
|
+
buttonLabel: string;
|
|
16
|
+
handleClick: () => void;
|
|
17
|
+
};
|
|
18
|
+
completed: {
|
|
19
|
+
buttonLabel: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
subscribe: {
|
|
23
|
+
finished: boolean;
|
|
24
|
+
notLogin: {
|
|
25
|
+
buttonLabel: string;
|
|
26
|
+
handleClick: () => void;
|
|
27
|
+
};
|
|
28
|
+
notFinished: {
|
|
29
|
+
buttonLabel: string;
|
|
30
|
+
handleClick: () => void;
|
|
31
|
+
};
|
|
32
|
+
completed: {
|
|
33
|
+
buttonLabel: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
completeProfile: {
|
|
37
|
+
finished: any;
|
|
38
|
+
notLogin: {
|
|
39
|
+
buttonLabel: string;
|
|
40
|
+
handleClick: () => void;
|
|
41
|
+
};
|
|
42
|
+
notFinished: {
|
|
43
|
+
buttonLabel: string;
|
|
44
|
+
link: string;
|
|
45
|
+
handleClick: () => void;
|
|
46
|
+
};
|
|
47
|
+
completed: {
|
|
48
|
+
buttonLabel: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
firstPurchase: {
|
|
52
|
+
finished: boolean;
|
|
53
|
+
notLogin: {
|
|
54
|
+
buttonLabel: string;
|
|
55
|
+
handleClick: () => void;
|
|
56
|
+
};
|
|
57
|
+
notFinished: {
|
|
58
|
+
buttonLabel: string;
|
|
59
|
+
link: string;
|
|
60
|
+
handleClick: () => void;
|
|
61
|
+
};
|
|
62
|
+
completed: {
|
|
63
|
+
buttonLabel: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
uploadReceipt: {
|
|
67
|
+
finished: boolean;
|
|
68
|
+
notLogin: {
|
|
69
|
+
buttonLabel: string;
|
|
70
|
+
handleClick: () => void;
|
|
71
|
+
};
|
|
72
|
+
notFinished: {
|
|
73
|
+
buttonLabel: string;
|
|
74
|
+
handleClick: () => void;
|
|
75
|
+
};
|
|
76
|
+
completed: {
|
|
77
|
+
buttonLabel: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
shop: {
|
|
81
|
+
finished: boolean;
|
|
82
|
+
notLogin: {
|
|
83
|
+
buttonLabel: string;
|
|
84
|
+
handleClick: () => void;
|
|
85
|
+
};
|
|
86
|
+
notFinished: {
|
|
87
|
+
buttonLabel: string;
|
|
88
|
+
link: string;
|
|
89
|
+
handleClick: () => void;
|
|
90
|
+
};
|
|
91
|
+
completed: {
|
|
92
|
+
buttonLabel: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var j=Object.create;var r=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var A=(e,i)=>{for(var a in i)r(e,a,{get:i[a],enumerable:!0})},h=(e,i,a,b)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of R(i))!U.call(e,n)&&n!==a&&r(e,n,{get:()=>i[n],enumerable:!(b=_(i,n))||b.enumerable});return e};var x=(e,i,a)=>(a=e!=null?j(T(e)):{},h(i||!e||!e.__esModule?r(a,"default",{value:e,enumerable:!0}):a,e)),G=e=>h(r({},"__esModule",{value:!0}),e);var E={};A(E,{useActions:()=>W});module.exports=G(E);var t=require("./type"),k=require("../context/provider"),d=require("react"),f=x(require("../context/hooks/useReceiptUploaded")),N=require("../context/hooks/useFirstPurchaseFinished"),L=require("../context/hooks/useSubscribed"),C=require("@shopify/context"),P=require("../../../helpers/track");const W=({copy:e,subscribe:i,uploadReceipt:a,activate:b,gaParameters:n})=>{const{openSignUpPopup:s,gtm:g,profile:l}=(0,k.useCreditsContext)(),u=(0,L.useSubscribed)(),c=(0,N.useFirstPurchaseFinished)(),m=(0,f.default)(),{appName:v}=(0,C.useShopifyContext)(),p=(0,d.useMemo)(()=>(l?.first_name||l?.last_name)&&l?.phone_number&&l?.dob,[l]);return(0,d.useMemo)(()=>{const o=({buttonName:F,id:w,callback:S})=>{(0,P.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:g.pageGroup,position:n?.position||e.title,button_name:F,info:w}}),S()};return{actions:{[t.TaskType.Activate]:{finished:l?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>o({buttonName:e?.activate,callback:()=>b.openAuthCodePopup(),id:t.TaskType.Activate})},completed:{buttonLabel:e?.completed}},[t.TaskType.Subscribe]:{finished:u,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Subscribe})},notFinished:{buttonLabel:e?.subscribe,handleClick:()=>o({buttonName:e?.subscribe,callback:()=>i.openSubscribePopup(),id:t.TaskType.Subscribe})},completed:{buttonLabel:e?.completed}},[t.TaskType.CompleteProfile]:{finished:p,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`/account/profile?app=${v}`,handleClick:()=>o({buttonName:e?.completeProfile,callback:()=>{},id:t.TaskType.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.TaskType.FirstPurchase]:{finished:c,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>o({buttonName:e?.makeFirstPurchase,callback:s,id:t.TaskType.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>o({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.TaskType.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.TaskType.UploadReceipt]:{finished:m,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>o({buttonName:e?.uploadReceipt,callback:()=>a.openUploadReceiptPopup(),id:t.TaskType.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.TaskType.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>o({buttonName:e?.shopNow,callback:()=>{},id:t.TaskType.Shop})},completed:{buttonLabel:e?.completed}}}}},[l?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,u,p,c,m,n?.position,s])};
|
|
2
|
+
//# sourceMappingURL=useActions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/credits-ways-to-get-credits/useActions.ts"],
|
|
4
|
+
"sourcesContent": ["import { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsProps } from './type'\nimport { useShopifyContext } from '@shopify/context'\nimport { gaTrack } from '../../../helpers/track'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n activate,\n gaParameters,\n}: CreditsWaysToGetCreditsProps & {\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName } = useShopifyContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => activate.openAuthCodePopup(),\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribe,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribe,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["useActions_exports", "__export", "useActions", "__toCommonJS", "import_type", "import_provider", "import_react", "import_useReceiptUploaded", "import_useFirstPurchaseFinished", "import_useSubscribed", "import_context", "import_track", "copy", "subscribe", "uploadReceipt", "activate", "gaParameters", "openSignUpPopup", "gtm", "profile", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "useReceiptUploaded", "appName", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Country {
|
|
2
|
+
id: string;
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
interface CountrySelectProps {
|
|
7
|
+
countries: Country[];
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
onChange: (code: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function CountrySelect({ countries, loading, className, value, onChange }: CountrySelectProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface StateSelectProps {
|
|
2
|
+
states: {
|
|
3
|
+
code: string;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}[];
|
|
7
|
+
className?: string;
|
|
8
|
+
countryId?: string;
|
|
9
|
+
defaultCode?: string;
|
|
10
|
+
stateName?: string;
|
|
11
|
+
stateCode?: string;
|
|
12
|
+
onChange: (code: string, name: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function StateSelect({ states, stateName, stateCode, className, onChange }: StateSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/credits/type.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Product, ProductVariant } from '
|
|
4
|
+
"sourcesContent": ["import type { Product, ProductVariant } from '@shopify/types/product'\nimport type { AlpcConsumeType, ConsumeType } from './context/const'\n\nexport interface Subscription {\n preference: {\n subscribe: boolean\n brand: string\n }[]\n}\n\nexport type RedeemableItem = {\n config: {\n title: string\n desc: string\n rules: string[]\n image: {\n url: string\n }\n type: ConsumeType\n value: string\n }\n alpc: {\n id: string\n consumeCredits: number\n remainingInventory: number\n isLimited: boolean\n consumeType: AlpcConsumeType\n showCredit: boolean\n title: string\n }\n product: Product\n variant: ProductVariant\n}\n\nexport interface ShippingCountry {\n id: string\n name: string\n code: string\n provinces: {\n id: string\n name: string\n code: string\n }[]\n}\n\nexport interface ShippingZone {\n name: string\n countries: ShippingCountry[]\n}\n\nexport type CreditsPageCommon = {\n pointUnit: string\n ruleLabel: string\n soldOut: string\n imageMapping: {\n [key in ConsumeType]: {\n url: string\n }\n }\n}\n"],
|
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
6
|
"names": ["type_exports", "__toCommonJS"]
|
|
7
7
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
export * from './components/index';
|
|
2
|
-
export
|
|
3
|
-
export * from './shopify/fetchers';
|
|
4
|
-
export * from './shopify/hooks';
|
|
5
|
-
export * from './shopify/queries';
|
|
6
|
-
export * from './shopify/fragments';
|
|
7
|
-
export type { Cart, LineItem, Product, ProductVariant, ProductImage, ProductMedia, ProductPrice, VariantCoupon, Discount, } from './shopify/types';
|
|
2
|
+
export * from '@anker-in/shopify';
|