@anker-in/campaign-ui 0.2.10-beta.23 → 0.2.10-beta.24
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/action.d.ts +25 -0
- package/dist/cjs/components/chat/button.d.ts +3 -0
- package/dist/cjs/components/chat/chatContext.d.ts +101 -0
- package/dist/cjs/components/chat/index.d.ts +71 -0
- package/dist/cjs/components/chat/markdown.d.ts +5 -0
- package/dist/cjs/components/chat/messages.d.ts +3 -0
- package/dist/cjs/components/chat/props.d.ts +43 -0
- package/dist/cjs/components/chat/response.d.ts +4 -0
- package/dist/cjs/components/chat/suggestions.d.ts +3 -0
- package/dist/cjs/components/chat/utils.d.ts +3 -0
- package/dist/cjs/components/credits/context/const.d.ts +81 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/cjs/components/credits/context/provider.d.ts +49 -0
- package/dist/cjs/components/credits/context/response.d.ts +63 -0
- package/dist/cjs/components/credits/context/utils.d.ts +25 -0
- package/dist/cjs/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
- package/dist/cjs/components/credits/creditsCash/index.d.ts +13 -0
- package/dist/cjs/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/cjs/components/credits/index.d.ts +10 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/cjs/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/cjs/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/cjs/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/cjs/components/credits/modal/tip.d.ts +5 -0
- package/dist/cjs/components/credits/type.d.ts +55 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/debug-env.d.ts +7 -0
- package/dist/cjs/helpers/fetchResponse.d.ts +14 -0
- package/dist/cjs/helpers/fetcher.d.ts +2 -0
- package/dist/cjs/helpers/index.d.ts +2 -0
- package/dist/cjs/helpers/track.d.ts +19 -0
- package/dist/cjs/helpers/utils.d.ts +3 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/stories/chat.stories.d.ts +7 -0
- package/dist/esm/components/chat/action.d.ts +25 -0
- package/dist/esm/components/chat/button.d.ts +3 -0
- package/dist/esm/components/chat/chatContext.d.ts +101 -0
- package/dist/esm/components/chat/index.d.ts +71 -0
- package/dist/esm/components/chat/markdown.d.ts +5 -0
- package/dist/esm/components/chat/messages.d.ts +3 -0
- package/dist/esm/components/chat/props.d.ts +43 -0
- package/dist/esm/components/chat/response.d.ts +4 -0
- package/dist/esm/components/chat/suggestions.d.ts +3 -0
- package/dist/esm/components/chat/utils.d.ts +3 -0
- package/dist/esm/components/credits/context/const.d.ts +81 -0
- package/dist/esm/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/esm/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/esm/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/esm/components/credits/context/provider.d.ts +49 -0
- package/dist/esm/components/credits/context/response.d.ts +63 -0
- package/dist/esm/components/credits/context/utils.d.ts +25 -0
- package/dist/esm/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
- package/dist/esm/components/credits/creditsCash/index.d.ts +13 -0
- package/dist/esm/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/esm/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/esm/components/credits/index.d.ts +10 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/esm/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/esm/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/esm/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/esm/components/credits/modal/tip.d.ts +5 -0
- package/dist/esm/components/credits/type.d.ts +55 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/debug-env.d.ts +7 -0
- package/dist/esm/helpers/fetchResponse.d.ts +14 -0
- package/dist/esm/helpers/fetcher.d.ts +2 -0
- package/dist/esm/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/track.d.ts +19 -0
- package/dist/esm/helpers/utils.d.ts +3 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/stories/chat.stories.d.ts +7 -0
- package/package.json +10 -9
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
+
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
+
type InitProps = {
|
|
4
|
+
copy: CreditsRedeemListCopy;
|
|
5
|
+
item: RedeemableItemType;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
setStatus: (status: 'address' | 'init' | 'success' | 'error') => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const Init: ({ copy, item, loading, disabled, setStatus }: InitProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
+
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
+
type ProductInfoProps = {
|
|
4
|
+
item: RedeemableItemType;
|
|
5
|
+
copy: CreditsRedeemListCopy;
|
|
6
|
+
};
|
|
7
|
+
export declare const ProductInfo: ({ item, copy }: ProductInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
+
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
+
type SuccessProps = {
|
|
4
|
+
copy: CreditsRedeemListCopy;
|
|
5
|
+
shippingProduct: string;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
address: Record<string, any> | undefined;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
item: RedeemableItemType;
|
|
11
|
+
};
|
|
12
|
+
export declare const Success: ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AlpcErrorCode } from '../../context/const';
|
|
2
|
+
import type { ModalContainerProps } from '../../modal/modalContainer';
|
|
3
|
+
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
4
|
+
import { CreditsRedeemListCopy } from '../type';
|
|
5
|
+
type RedeemProductModalProps = ModalContainerProps & {
|
|
6
|
+
item: RedeemableItemType;
|
|
7
|
+
copy: CreditsRedeemListCopy;
|
|
8
|
+
onError: (code: AlpcErrorCode) => void;
|
|
9
|
+
};
|
|
10
|
+
declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default RedeemProductModal;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
2
|
+
import type { CreditsRedeemListCopy } from './type';
|
|
3
|
+
export declare function RedeemableItem({ copy, className, item, onRulesOpen, onRedeem, }: {
|
|
4
|
+
copy: CreditsRedeemListCopy;
|
|
5
|
+
className?: string;
|
|
6
|
+
item: RedeemableItemType;
|
|
7
|
+
onRulesOpen: (rules: string[]) => void;
|
|
8
|
+
onRedeem: (item: RedeemableItemType) => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CreditsRedeemListCopy } from './type';
|
|
2
|
+
export declare function CreditsRedeemList({ copy, className, tabClassName, hideTitle, cardClassName, activate, }: {
|
|
3
|
+
copy: CreditsRedeemListCopy;
|
|
4
|
+
className?: string;
|
|
5
|
+
tabClassName?: string;
|
|
6
|
+
hideTitle?: boolean;
|
|
7
|
+
cardClassName?: string;
|
|
8
|
+
activate: {
|
|
9
|
+
openAuthCodePopup: () => void;
|
|
10
|
+
isSuccess: boolean;
|
|
11
|
+
setOnSuccess: (callback: Function) => void;
|
|
12
|
+
};
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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;
|
|
@@ -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
|
+
};
|
|
@@ -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,10 @@
|
|
|
1
|
+
export { CreditsProvider, useCreditsContext } from './context/provider';
|
|
2
|
+
export { useUploadReceipt as useCreditsUploadReceipt } from './context/hooks/useUploadReceipt';
|
|
3
|
+
export { CreditsUploadReceiptModal } from './modal/creditsUploadReceiptModal';
|
|
4
|
+
export { CreditsBanner } from './creditsBanner';
|
|
5
|
+
export { CreditsBenefits } from './creditsBenefits';
|
|
6
|
+
export { CreditsInfoCard } from './creditsInfoCard';
|
|
7
|
+
export { CreditsWaysToGetCredits } from './creditsWaysToGetCredits';
|
|
8
|
+
export { CreditsFaq } from './creditsFaq';
|
|
9
|
+
export { CreditsCash } from './creditsCash';
|
|
10
|
+
export { CreditsRedeemList } from './creditsRedeemList';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ModalContainerProps } from './modalContainer';
|
|
2
|
+
export interface MyRewardsMetafields {
|
|
3
|
+
title: string;
|
|
4
|
+
orderNumberLabel: string;
|
|
5
|
+
valueLabel: string;
|
|
6
|
+
receivedLabel: string;
|
|
7
|
+
failedLabel: string;
|
|
8
|
+
approveSuccessLabel: string;
|
|
9
|
+
couponTab: string;
|
|
10
|
+
productTab: string;
|
|
11
|
+
pendingLabel: string;
|
|
12
|
+
unfulfilledLabel: string;
|
|
13
|
+
fulfilledLabel: string;
|
|
14
|
+
confirmedTip: string;
|
|
15
|
+
pendingTip: string;
|
|
16
|
+
processingTip: string;
|
|
17
|
+
ShippedTip: string;
|
|
18
|
+
emptyListLabel: string;
|
|
19
|
+
pointUnit: string;
|
|
20
|
+
code: string;
|
|
21
|
+
copied: string;
|
|
22
|
+
copy: string;
|
|
23
|
+
emptyListImage: {
|
|
24
|
+
url: string;
|
|
25
|
+
alt?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
interface MyRewardsModalProps extends ModalContainerProps {
|
|
29
|
+
data: MyRewardsMetafields;
|
|
30
|
+
}
|
|
31
|
+
declare function MyRewardsModal({ data, ...props }: MyRewardsModalProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export default MyRewardsModal;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ModalContainerProps } from './modalContainer';
|
|
2
|
+
export interface MyActivitiesMetafields {
|
|
3
|
+
title: string;
|
|
4
|
+
tips: string;
|
|
5
|
+
allTab: string;
|
|
6
|
+
earnedTab: string;
|
|
7
|
+
deductedTab: string;
|
|
8
|
+
expiredTab: string;
|
|
9
|
+
activationTask: string;
|
|
10
|
+
updateNameTask: string;
|
|
11
|
+
updatePhoneTask: string;
|
|
12
|
+
updateBirthdayTask: string;
|
|
13
|
+
updateAppNameTask: string;
|
|
14
|
+
subscriptionTask: string;
|
|
15
|
+
refundTask: string;
|
|
16
|
+
productUnApprovedTask: string;
|
|
17
|
+
pendingTips?: string;
|
|
18
|
+
pendingTips2?: string;
|
|
19
|
+
firstPurchaseTask: string;
|
|
20
|
+
uploadReceiptTask: string;
|
|
21
|
+
shoppingTask: string;
|
|
22
|
+
emptyListImage: {
|
|
23
|
+
url: string;
|
|
24
|
+
alt?: string;
|
|
25
|
+
};
|
|
26
|
+
emptyListLabel: string;
|
|
27
|
+
}
|
|
28
|
+
interface ActivitiesModalProps extends ModalContainerProps {
|
|
29
|
+
data: MyActivitiesMetafields;
|
|
30
|
+
}
|
|
31
|
+
declare function ActivitiesModal({ data, ...props }: ActivitiesModalProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export default ActivitiesModal;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ReceiptCopy = {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
note: string;
|
|
6
|
+
submit: string;
|
|
7
|
+
successTitle: string;
|
|
8
|
+
successDescription: string;
|
|
9
|
+
gotIt: string;
|
|
10
|
+
failedTitle: string;
|
|
11
|
+
successIcon: string;
|
|
12
|
+
failedIcon: string;
|
|
13
|
+
failedReasons: {
|
|
14
|
+
code: string;
|
|
15
|
+
id: string;
|
|
16
|
+
description: string;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
export declare function CreditsUploadReceiptModal({ isOpen, onClose, copy, onSuccess, }: {
|
|
20
|
+
isOpen: boolean;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
copy: ReceiptCopy;
|
|
23
|
+
onSuccess: () => void;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UIEvent } from 'react';
|
|
2
|
+
export type ModalContainerProps = {
|
|
3
|
+
overlayClassName?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
scrollClassName?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
titleClassName?: string;
|
|
8
|
+
useAnimation?: boolean;
|
|
9
|
+
animationClassName?: string;
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
children?: any;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onScrollEnd?: (event: UIEvent<HTMLDivElement>) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const CreditsModalContainer: ({ isOpen, title, className, overlayClassName, scrollClassName, onClose, onScrollEnd, children, useAnimation, animationClassName, titleClassName, ...props }: ModalContainerProps) => React.ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ModalContainerProps } from './modalContainer';
|
|
2
|
+
declare function RulesModal({ rules, className, ruleClassName, ...props }: {
|
|
3
|
+
rules: string | string[];
|
|
4
|
+
ruleClassName?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & ModalContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default RulesModal;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Product, ProductVariant } from '@anker-in/lib';
|
|
2
|
+
import type { AlpcConsumeType, ConsumeType } from './context/const';
|
|
3
|
+
export interface Subscription {
|
|
4
|
+
preference: {
|
|
5
|
+
subscribe: boolean;
|
|
6
|
+
brand: string;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
export type RedeemableItem = {
|
|
10
|
+
config: {
|
|
11
|
+
title: string;
|
|
12
|
+
desc: string;
|
|
13
|
+
rules: string[];
|
|
14
|
+
image: {
|
|
15
|
+
url: string;
|
|
16
|
+
};
|
|
17
|
+
type: ConsumeType;
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
alpc: {
|
|
21
|
+
id: string;
|
|
22
|
+
consumeCredits: number;
|
|
23
|
+
remainingInventory: number;
|
|
24
|
+
isLimited: boolean;
|
|
25
|
+
consumeType: AlpcConsumeType;
|
|
26
|
+
showCredit: boolean;
|
|
27
|
+
title: string;
|
|
28
|
+
};
|
|
29
|
+
product: Product;
|
|
30
|
+
variant: ProductVariant;
|
|
31
|
+
};
|
|
32
|
+
export interface ShippingCountry {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
code: string;
|
|
36
|
+
provinces: {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
code: string;
|
|
40
|
+
}[];
|
|
41
|
+
}
|
|
42
|
+
export interface ShippingZone {
|
|
43
|
+
name: string;
|
|
44
|
+
countries: ShippingCountry[];
|
|
45
|
+
}
|
|
46
|
+
export type CreditsPageCommon = {
|
|
47
|
+
pointUnit: string;
|
|
48
|
+
ruleLabel: string;
|
|
49
|
+
soldOut: string;
|
|
50
|
+
imageMapping: {
|
|
51
|
+
[key in ConsumeType]: {
|
|
52
|
+
url: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function getAsyncError(res: {
|
|
2
|
+
json: () => any;
|
|
3
|
+
status: any;
|
|
4
|
+
statusText: any;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
status: any;
|
|
7
|
+
statusText: any;
|
|
8
|
+
errors: any;
|
|
9
|
+
type: any;
|
|
10
|
+
data: any;
|
|
11
|
+
message: any;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
declare const handleFetchResponse: (res: Response) => Promise<any>;
|
|
14
|
+
export default handleFetchResponse;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
dataLayer?: Array<any>;
|
|
4
|
+
fbq?: (...args: any[]) => void;
|
|
5
|
+
klaviyo?: any;
|
|
6
|
+
gtag?: any;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare const gaTrack: (data: any) => "" | undefined;
|
|
10
|
+
export declare function gaNormalClick({ position, label }: {
|
|
11
|
+
position: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}): void;
|
|
14
|
+
export declare const fbq: (...args: any[]) => "" | undefined;
|
|
15
|
+
export declare const gtag: (...args: any[]) => "" | undefined;
|
|
16
|
+
export declare const getGtmGroup: ({ query, asPath }: {
|
|
17
|
+
query: any;
|
|
18
|
+
asPath: string;
|
|
19
|
+
}) => any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Chat } from '../components/index';
|
|
3
|
+
import '../styles/chat.css';
|
|
4
|
+
type Story = StoryObj<typeof meta>;
|
|
5
|
+
declare const meta: Meta<typeof Chat>;
|
|
6
|
+
export default meta;
|
|
7
|
+
export declare const Default: Story;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anker-in/campaign-ui",
|
|
3
|
-
"version": "0.2.10-beta.
|
|
3
|
+
"version": "0.2.10-beta.24",
|
|
4
4
|
"description": "Campaign UI components and utilities for Anker projects",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.js",
|
|
7
|
+
"types": "./dist/esm/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": {
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"swiper": "^11.1.3",
|
|
90
90
|
"tailwind-merge": "^2.3.0",
|
|
91
91
|
"tailwindcss": "^3.4.3",
|
|
92
|
-
"@anker-in/
|
|
93
|
-
"@anker-in/
|
|
92
|
+
"@anker-in/lib": "0.0.0-beta.1",
|
|
93
|
+
"@anker-in/headless-ui": "1.0.19"
|
|
94
94
|
},
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"access": "public",
|
|
@@ -102,11 +102,12 @@
|
|
|
102
102
|
"scripts": {
|
|
103
103
|
"dev": "pnpm run dev:css & tsup --watch",
|
|
104
104
|
"dev:css": "postcss src/styles/global.css -o style.css --watch",
|
|
105
|
-
"build": "pnpm run build:css & pnpm run build:js:esm & pnpm run build:js:cjs & pnpm run build:types",
|
|
106
|
-
"build:css": "postcss src/styles/global.css -o style.css",
|
|
105
|
+
"build": "pnpm run build:css & pnpm run build:js:esm & pnpm run build:js:cjs & pnpm run build:js:esm:types & pnpm run build:js:cjs:types",
|
|
107
106
|
"build:js:cjs": "node esbuild-cjs.mjs",
|
|
107
|
+
"build:js:cjs:types": "tsc --outdir dist/cjs",
|
|
108
108
|
"build:js:esm": "node esbuild-esm.mjs",
|
|
109
|
-
"build:types": "tsc --outdir dist",
|
|
109
|
+
"build:js:esm:types": "tsc --outdir dist/esm",
|
|
110
|
+
"build:css": "postcss src/styles/global.css -o style.css",
|
|
110
111
|
"lint": "eslint \"src/**/*.ts*\"",
|
|
111
112
|
"test": "echo run @anker-in/campaign-ui tests",
|
|
112
113
|
"type-check": "tsc --noEmit",
|