@anker-in/campaign-ui 0.2.10-beta.20 → 0.2.10-beta.22
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/components/chat/action.d.ts +25 -0
- package/dist/components/chat/button.d.ts +3 -0
- package/dist/components/chat/chatContext.d.ts +101 -0
- package/dist/components/chat/index.d.ts +71 -0
- package/dist/components/chat/markdown.d.ts +5 -0
- package/dist/components/chat/messages.d.ts +3 -0
- package/dist/components/chat/props.d.ts +43 -0
- package/dist/components/chat/response.d.ts +4 -0
- package/dist/components/chat/suggestions.d.ts +3 -0
- package/dist/components/chat/utils.d.ts +3 -0
- package/dist/components/credits/context/const.d.ts +81 -0
- package/dist/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
- package/dist/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
- package/dist/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/components/credits/context/provider.d.ts +49 -0
- package/dist/components/credits/context/response.d.ts +63 -0
- package/dist/components/credits/context/utils.d.ts +25 -0
- package/dist/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- package/dist/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
- package/dist/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
- package/dist/components/credits/creditsCash/index.d.ts +13 -0
- package/dist/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/components/credits/creditsRedeemList/index.d.ts +13 -0
- package/dist/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
- package/dist/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/components/credits/index.d.ts +10 -0
- package/dist/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/components/credits/modal/tip.d.ts +5 -0
- package/dist/components/credits/type.d.ts +55 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/debug-env.d.ts +7 -0
- package/dist/helpers/fetchResponse.d.ts +14 -0
- package/dist/helpers/fetcher.d.ts +2 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/track.d.ts +19 -0
- package/dist/helpers/utils.d.ts +3 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +2 -494
- package/dist/index.js +1318 -4377
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1294 -4330
- package/dist/index.mjs.map +1 -1
- package/dist/stories/chat.stories.d.ts +7 -0
- package/package.json +14 -9
- package/src/components/credits/context/hooks/useActivities.ts +1 -1
- package/src/components/credits/context/hooks/useAddressValidate.ts +1 -1
- package/src/components/credits/context/hooks/useAlpcFetch.ts +1 -1
- package/src/components/credits/context/hooks/useCountries.ts +1 -1
- 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 +1 -1
- 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/type.ts +1 -1
- package/src/index.ts +1 -1
- package/src/styles/global.css +15 -0
- package/style.css +1 -0
|
@@ -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;
|
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export { useCopilotAction, useCopilotChat, useCopilotReadable } from '@copilotkit/react-core';
|
|
4
4
|
export { ActionExecutionMessage, Role, TextMessage } from '@copilotkit/runtime-client-gql';
|
|
5
|
-
import * as
|
|
6
|
-
export * from '@anker-in/
|
|
5
|
+
import * as swr_dist_mutation from 'swr/dist/mutation';
|
|
6
|
+
export * from '@anker-in/lib';
|
|
7
7
|
|
|
8
8
|
interface ChatProps {
|
|
9
9
|
title: string;
|
|
@@ -131,7 +131,7 @@ declare function useCreditsContext(): {
|
|
|
131
131
|
};
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
-
declare const useUploadReceipt: () =>
|
|
134
|
+
declare const useUploadReceipt: () => swr_dist_mutation.SWRMutationResponse<{
|
|
135
135
|
ok: boolean;
|
|
136
136
|
code: number;
|
|
137
137
|
}, any, "/api/multipass/mktsrv/v1/credit/upload_third_party_order", {
|