@taskon/widget-react 0.0.1-beta.4 → 0.0.1-beta.6
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/README.md +13 -4
- package/dist/CommunityTaskList.css +119 -111
- package/dist/EligibilityInfo.css +114 -110
- package/dist/LeaderboardWidget.css +73 -71
- package/dist/PageBuilder.css +5 -0
- package/dist/Quest.css +259 -255
- package/dist/TaskOnProvider.css +2 -0
- package/dist/UserCenterWidget.css +6 -6
- package/dist/UserCenterWidget2.css +1626 -1601
- package/dist/{dynamic-import-helper.css → WidgetShell.css} +2 -2
- package/dist/chunks/{CommunityTaskList-C9Gv8KOF.js → CommunityTaskList-Hde2OKHH.js} +1070 -580
- package/dist/chunks/{EligibilityInfo-D-Fuy9GE.js → EligibilityInfo-BV0Z2TgY.js} +1972 -1028
- package/dist/chunks/{LeaderboardWidget-BV2D2q1N.js → LeaderboardWidget-BNGRD5Bu.js} +270 -249
- package/dist/chunks/{PageBuilder-DQoU4Mwf.js → PageBuilder-C5DSHiW9.js} +5 -5
- package/dist/chunks/{Quest-B5NyVr3o.js → Quest-DG9zfXJo.js} +723 -513
- package/dist/chunks/{TaskOnProvider-93UxARFo.js → TaskOnProvider-BhamHIyY.js} +98 -68
- package/dist/chunks/{ThemeProvider-CPI_roeh.js → ThemeProvider-mXLdLSkq.js} +107 -20
- package/dist/chunks/{UserCenterWidget-cADBSVg7.js → UserCenterWidget-D5ttw4hO.js} +1328 -1337
- package/dist/chunks/{UserCenterWidget-BRtigY_S.js → UserCenterWidget-jDO5zTN1.js} +358 -254
- package/dist/chunks/{dynamic-import-helper-DwXlQC0S.js → WidgetShell-D7yC894Y.js} +447 -457
- package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
- package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
- package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
- package/dist/chunks/communitytask-ru-CZm2CPoV.js +521 -0
- package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
- package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
- package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
- package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
- package/dist/chunks/quest-es-Dyyy0zaw.js +863 -0
- package/dist/chunks/quest-ja-Depog33y.js +863 -0
- package/dist/chunks/quest-ko-BMu3uRQJ.js +863 -0
- package/dist/chunks/quest-ru-xne814Rw.js +863 -0
- package/dist/chunks/taskwidget-es-Do9b3Mqw.js +245 -0
- package/dist/chunks/taskwidget-ja-CqSu-yWA.js +245 -0
- package/dist/chunks/taskwidget-ko-EHgXFV4B.js +245 -0
- package/dist/chunks/taskwidget-ru-CMbLQDK4.js +245 -0
- package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
- package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
- package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
- package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
- package/dist/community-task.d.ts +0 -390
- package/dist/community-task.js +2 -7
- package/dist/core.d.ts +46 -10
- package/dist/core.js +11 -11
- package/dist/index.d.ts +46 -667
- package/dist/index.js +19 -28
- package/dist/leaderboard.d.ts +0 -498
- package/dist/leaderboard.js +2 -16
- package/dist/page-builder.js +1 -1
- package/dist/quest.d.ts +0 -289
- package/dist/quest.js +2 -5
- package/dist/user-center.d.ts +0 -1608
- package/dist/user-center.js +2 -494
- package/package.json +5 -2
- package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
- package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
- package/dist/chunks/usercenter-ja-B2465c1O.js +0 -326
- package/dist/chunks/usercenter-ko-xAEYxqLg.js +0 -326
package/dist/index.js
CHANGED
|
@@ -1,43 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { T,
|
|
3
|
-
import { C, B as B2, a as a2, T as T2 } from "./chunks/CommunityTaskList-C9Gv8KOF.js";
|
|
1
|
+
import { c } from "./chunks/WidgetShell-D7yC894Y.js";
|
|
2
|
+
import { T, d, e, f, i, g, u, a, c as c2, b } from "./chunks/ThemeProvider-mXLdLSkq.js";
|
|
4
3
|
import { RewardType } from "@taskon/core";
|
|
5
|
-
import { T as
|
|
6
|
-
import { a as
|
|
7
|
-
import { C
|
|
8
|
-
import { L } from "./chunks/LeaderboardWidget-
|
|
9
|
-
import { Q, Q as Q2
|
|
10
|
-
import { U } from "./chunks/UserCenterWidget-
|
|
11
|
-
import { P } from "./chunks/PageBuilder-
|
|
4
|
+
import { T as T2, u as u2 } from "./chunks/TaskOnProvider-BhamHIyY.js";
|
|
5
|
+
import { a as a2, u as u3 } from "./chunks/useToast-CaRkylKe.js";
|
|
6
|
+
import { C } from "./chunks/CommunityTaskList-Hde2OKHH.js";
|
|
7
|
+
import { L } from "./chunks/LeaderboardWidget-BNGRD5Bu.js";
|
|
8
|
+
import { Q, Q as Q2 } from "./chunks/Quest-DG9zfXJo.js";
|
|
9
|
+
import { U } from "./chunks/UserCenterWidget-jDO5zTN1.js";
|
|
10
|
+
import { P } from "./chunks/PageBuilder-C5DSHiW9.js";
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
C as CardSelector,
|
|
15
|
-
B2 as CommunityTask,
|
|
16
|
-
a2 as CommunityTaskList,
|
|
17
|
-
C2 as ConfirmNoticeDialog,
|
|
12
|
+
C as CommunityTaskList,
|
|
18
13
|
L as LeaderboardWidget,
|
|
19
14
|
P as PageBuilder,
|
|
20
15
|
Q as Quest,
|
|
21
16
|
Q2 as QuestWidget,
|
|
22
17
|
RewardType,
|
|
23
|
-
|
|
24
|
-
T2 as TemplateTask,
|
|
18
|
+
T2 as TaskOnProvider,
|
|
25
19
|
T as ThemeProvider,
|
|
26
20
|
U as UserCenterWidget,
|
|
27
|
-
|
|
21
|
+
d as clearLocaleCache,
|
|
28
22
|
c as cloudThemeToReactTheme,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
u4 as useQuestDetail,
|
|
36
|
-
b3 as useQuestStatus,
|
|
37
|
-
a5 as useQuestUserStatus,
|
|
23
|
+
e as createLocaleLoader,
|
|
24
|
+
f as createT,
|
|
25
|
+
i as interpolate,
|
|
26
|
+
g as isSupportedLocale,
|
|
27
|
+
u2 as useCommonLocale,
|
|
28
|
+
a2 as useEvmWallet,
|
|
38
29
|
u as useTaskOnAuth,
|
|
39
30
|
a as useTaskOnTheme,
|
|
40
|
-
|
|
31
|
+
c2 as useTranslation,
|
|
41
32
|
u3 as useWallet,
|
|
42
33
|
b as useWidgetLocale
|
|
43
34
|
};
|
package/dist/leaderboard.d.ts
CHANGED
|
@@ -1,215 +1,5 @@
|
|
|
1
|
-
import { AllTimeRankItem } from '@taskon/core';
|
|
2
|
-
import { CampaignInfo } from '@taskon/core';
|
|
3
|
-
import { CampaignRankItem } from '@taskon/core';
|
|
4
1
|
import { default as default_2 } from 'react';
|
|
5
|
-
import { isAllTimeResponse } from '@taskon/core';
|
|
6
|
-
import { isCampaignResponse } from '@taskon/core';
|
|
7
|
-
import { JSX } from 'react/jsx-runtime';
|
|
8
2
|
import { LeaderboardContentConfig } from '@taskon/core';
|
|
9
|
-
import { LeaderboardData } from '@taskon/core';
|
|
10
|
-
import { LeaderboardItem } from '@taskon/core';
|
|
11
|
-
import { RewardsDistributeType } from '@taskon/core';
|
|
12
|
-
|
|
13
|
-
export { isAllTimeResponse }
|
|
14
|
-
|
|
15
|
-
export { isCampaignResponse }
|
|
16
|
-
|
|
17
|
-
export { LeaderboardData }
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 排行榜头部组件
|
|
21
|
-
*
|
|
22
|
-
* @param props - 组件属性
|
|
23
|
-
* @returns 头部元素
|
|
24
|
-
*/
|
|
25
|
-
export declare function LeaderboardHeader({ tabConfig, showTitle, rewardSummary, participantsCount, messages, onOpenRewardRules, className, }: LeaderboardHeaderProps): JSX.Element | null;
|
|
26
|
-
|
|
27
|
-
export declare interface LeaderboardHeaderProps {
|
|
28
|
-
/** 当前 Tab 配置 */
|
|
29
|
-
tabConfig: LeaderboardItem;
|
|
30
|
-
/** 是否显示标题 */
|
|
31
|
-
showTitle: boolean;
|
|
32
|
-
/** 奖励摘要(仅 Sprint) */
|
|
33
|
-
rewardSummary?: RewardSummary | null;
|
|
34
|
-
/** 参与人数 */
|
|
35
|
-
participantsCount?: number;
|
|
36
|
-
/** 国际化消息 */
|
|
37
|
-
messages: LeaderboardMessages;
|
|
38
|
-
/** 打开奖励规则弹窗回调 */
|
|
39
|
-
onOpenRewardRules?: () => void;
|
|
40
|
-
/** 自定义类名 */
|
|
41
|
-
className?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* LeaderboardWidget messages type definition
|
|
46
|
-
*
|
|
47
|
-
* 定义排行榜 Widget 的国际化消息类型
|
|
48
|
-
* 所有语言文件必须实现此接口
|
|
49
|
-
*/
|
|
50
|
-
export declare interface LeaderboardMessages {
|
|
51
|
-
/** All Time Tab 标签 */
|
|
52
|
-
tabAllTime: string;
|
|
53
|
-
/** Quest Tab 标签 */
|
|
54
|
-
tabQuest: string;
|
|
55
|
-
/** Event Tab 标签 */
|
|
56
|
-
tabEvent: string;
|
|
57
|
-
/** Sprint Tab 标签 */
|
|
58
|
-
tabSprint: string;
|
|
59
|
-
/** 排名列标题 */
|
|
60
|
-
columnRank: string;
|
|
61
|
-
/** 位置列标题(Campaign 使用) */
|
|
62
|
-
columnPosition: string;
|
|
63
|
-
/** 用户列标题 */
|
|
64
|
-
columnUser: string;
|
|
65
|
-
/** 任务数列标题 */
|
|
66
|
-
columnTasks: string;
|
|
67
|
-
/** 邀请用户数列标题 */
|
|
68
|
-
columnInvitedUsers: string;
|
|
69
|
-
/** 当前层级列标题 */
|
|
70
|
-
columnCurrentTier: string;
|
|
71
|
-
/** 积分列标题 */
|
|
72
|
-
columnPoints: string;
|
|
73
|
-
/** 奖励列标题 */
|
|
74
|
-
columnRewards: string;
|
|
75
|
-
/** 进行中状态 */
|
|
76
|
-
statusOngoing: string;
|
|
77
|
-
/** 已结束状态 */
|
|
78
|
-
statusEnded: string;
|
|
79
|
-
/** 即将开始状态 */
|
|
80
|
-
statusUpcoming: string;
|
|
81
|
-
/** 参与人数标签 */
|
|
82
|
-
participants: string;
|
|
83
|
-
/** 奖池标签 */
|
|
84
|
-
prizePool: string;
|
|
85
|
-
/** 总获奖人数标签 */
|
|
86
|
-
totalWinners: string;
|
|
87
|
-
/** 奖励规则标签 */
|
|
88
|
-
rewardRules: string;
|
|
89
|
-
/** 奖励规则弹窗标题 */
|
|
90
|
-
rewardRulesTitle: string;
|
|
91
|
-
/** 奖励规则描述(带插值:{pointsName}) */
|
|
92
|
-
rewardRulesDesc: string;
|
|
93
|
-
/** 活动时间标签 */
|
|
94
|
-
eventPeriod: string;
|
|
95
|
-
/** 奖励详情标签 */
|
|
96
|
-
rewardDetails: string;
|
|
97
|
-
/** 平均分配描述(带插值:{amount}) */
|
|
98
|
-
eachReceives: string;
|
|
99
|
-
/** 随机分配描述(带插值:{amount}) */
|
|
100
|
-
randomlySplit: string;
|
|
101
|
-
/** 空状态标题 */
|
|
102
|
-
emptyTitle: string;
|
|
103
|
-
/** 空状态描述 */
|
|
104
|
-
emptyDesc: string;
|
|
105
|
-
/** 页标签 */
|
|
106
|
-
page: string;
|
|
107
|
-
/** of 标签 */
|
|
108
|
-
of: string;
|
|
109
|
-
/** 上一页按钮 */
|
|
110
|
-
previous: string;
|
|
111
|
-
/** 下一页按钮 */
|
|
112
|
-
next: string;
|
|
113
|
-
/** 加载中 */
|
|
114
|
-
loading: string;
|
|
115
|
-
/** 加载失败 */
|
|
116
|
-
error: string;
|
|
117
|
-
/** 重试按钮 */
|
|
118
|
-
retry: string;
|
|
119
|
-
/** 当前用户标识 */
|
|
120
|
-
you: string;
|
|
121
|
-
/** 未排名 */
|
|
122
|
-
unranked: string;
|
|
123
|
-
/** N/A */
|
|
124
|
-
na: string;
|
|
125
|
-
/** 无数据占位符 */
|
|
126
|
-
noData: string;
|
|
127
|
-
/** 白名单奖励 */
|
|
128
|
-
whitelist?: string;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* 分页组件
|
|
133
|
-
*
|
|
134
|
-
* @param props - 组件属性
|
|
135
|
-
* @returns 分页元素
|
|
136
|
-
*/
|
|
137
|
-
export declare function LeaderboardPagination({ page, totalPages, total, hasPrevious, hasNext, onPrevious, onNext, messages, className, }: LeaderboardPaginationProps): JSX.Element | null;
|
|
138
|
-
|
|
139
|
-
export declare interface LeaderboardPaginationProps {
|
|
140
|
-
/** 当前页码(从 0 开始) */
|
|
141
|
-
page: number;
|
|
142
|
-
/** 总页数 */
|
|
143
|
-
totalPages: number;
|
|
144
|
-
/** 总数据条数 */
|
|
145
|
-
total: number;
|
|
146
|
-
/** 是否有上一页 */
|
|
147
|
-
hasPrevious: boolean;
|
|
148
|
-
/** 是否有下一页 */
|
|
149
|
-
hasNext: boolean;
|
|
150
|
-
/** 上一页回调 */
|
|
151
|
-
onPrevious: () => void;
|
|
152
|
-
/** 下一页回调 */
|
|
153
|
-
onNext: () => void;
|
|
154
|
-
/** 国际化消息 */
|
|
155
|
-
messages: LeaderboardMessages;
|
|
156
|
-
/** 自定义类名 */
|
|
157
|
-
className?: string;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* 排行榜表格组件
|
|
162
|
-
*/
|
|
163
|
-
export declare function LeaderboardTable({ tabConfig, allTimeData, campaignData, currentUserId, messages, onUserClick, rewardTiers, loading, className, }: LeaderboardTableProps): JSX.Element;
|
|
164
|
-
|
|
165
|
-
export declare interface LeaderboardTableProps {
|
|
166
|
-
/** 当前 Tab 配置 */
|
|
167
|
-
tabConfig: LeaderboardItem;
|
|
168
|
-
/** All Time 数据 */
|
|
169
|
-
allTimeData?: AllTimeRankItem[];
|
|
170
|
-
/** Campaign 数据 */
|
|
171
|
-
campaignData?: CampaignRankItem[];
|
|
172
|
-
/** 当前用户 ID */
|
|
173
|
-
currentUserId?: number | null;
|
|
174
|
-
/** 国际化消息 */
|
|
175
|
-
messages: LeaderboardMessages;
|
|
176
|
-
/** 用户点击回调 */
|
|
177
|
-
onUserClick?: (userId: number, userName: string) => void;
|
|
178
|
-
/** 奖励层级详情(用于 Sprint 显示每行对应的奖励) */
|
|
179
|
-
rewardTiers?: RewardTierDetail[];
|
|
180
|
-
/** 加载状态 */
|
|
181
|
-
loading?: boolean;
|
|
182
|
-
/** 自定义类名 */
|
|
183
|
-
className?: string;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Tab 切换组件
|
|
188
|
-
*
|
|
189
|
-
* @param props - 组件属性
|
|
190
|
-
* @returns Tab 列表元素
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* ```tsx
|
|
194
|
-
* <LeaderboardTabs
|
|
195
|
-
* tabs={tabs}
|
|
196
|
-
* activeTabId="all-time"
|
|
197
|
-
* onTabChange={(id) => setActiveTabId(id)}
|
|
198
|
-
* />
|
|
199
|
-
* ```
|
|
200
|
-
*/
|
|
201
|
-
export declare function LeaderboardTabs({ tabs, activeTabId, onTabChange, className, }: LeaderboardTabsProps): JSX.Element | null;
|
|
202
|
-
|
|
203
|
-
export declare interface LeaderboardTabsProps {
|
|
204
|
-
/** Tab 配置列表 */
|
|
205
|
-
tabs: LeaderboardItem[];
|
|
206
|
-
/** 当前激活的 Tab ID */
|
|
207
|
-
activeTabId: string;
|
|
208
|
-
/** Tab 切换回调 */
|
|
209
|
-
onTabChange: (tabId: string) => void;
|
|
210
|
-
/** 自定义类名 */
|
|
211
|
-
className?: string;
|
|
212
|
-
}
|
|
213
3
|
|
|
214
4
|
/**
|
|
215
5
|
* 排行榜 Widget 外层组件
|
|
@@ -263,292 +53,4 @@ export declare interface LeaderboardWidgetProps {
|
|
|
263
53
|
style?: default_2.CSSProperties;
|
|
264
54
|
}
|
|
265
55
|
|
|
266
|
-
/**
|
|
267
|
-
* 分页模式
|
|
268
|
-
*/
|
|
269
|
-
declare type PaginationMode = "pagination" | "infinite";
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* 排名徽章组件
|
|
273
|
-
*
|
|
274
|
-
* @param props - 组件属性
|
|
275
|
-
* @returns 排名徽章元素
|
|
276
|
-
*
|
|
277
|
-
* @example
|
|
278
|
-
* ```tsx
|
|
279
|
-
* <RankBadge rank={1} isAllTime /> // 显示金色六边形
|
|
280
|
-
* <RankBadge rank={1} /> // 显示金色六边形
|
|
281
|
-
* <RankBadge rank={4} /> // 显示数字 4
|
|
282
|
-
* ```
|
|
283
|
-
*/
|
|
284
|
-
export declare function RankBadge({ rank, isAllTime, className }: RankBadgeProps): JSX.Element;
|
|
285
|
-
|
|
286
|
-
export declare interface RankBadgeProps {
|
|
287
|
-
/** 排名(从 1 开始) */
|
|
288
|
-
rank: number;
|
|
289
|
-
/** 是否为 All Time 类型(使用皇冠而不是奖牌) */
|
|
290
|
-
isAllTime?: boolean;
|
|
291
|
-
/** 自定义类名 */
|
|
292
|
-
className?: string;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* 奖励规则弹窗组件
|
|
297
|
-
*/
|
|
298
|
-
export declare function RewardRulesModal({ isOpen, onClose, rewardSummary, messages, className, }: RewardRulesModalProps): JSX.Element | null;
|
|
299
|
-
|
|
300
|
-
export declare interface RewardRulesModalProps {
|
|
301
|
-
/** 是否打开 */
|
|
302
|
-
isOpen: boolean;
|
|
303
|
-
/** 关闭回调 */
|
|
304
|
-
onClose: () => void;
|
|
305
|
-
/** 奖励摘要 */
|
|
306
|
-
rewardSummary: RewardSummary | null;
|
|
307
|
-
/** 国际化消息 */
|
|
308
|
-
messages: LeaderboardMessages;
|
|
309
|
-
/** 自定义类名 */
|
|
310
|
-
className?: string;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* 奖励摘要信息
|
|
315
|
-
*/
|
|
316
|
-
export declare interface RewardSummary {
|
|
317
|
-
/** 总奖池(格式化后的字符串,如 "1,000 USDT") */
|
|
318
|
-
prizePool: string;
|
|
319
|
-
/** 总获奖人数 */
|
|
320
|
-
totalWinners: number;
|
|
321
|
-
/** 各层级奖励详情 */
|
|
322
|
-
tiers: RewardTierDetail[];
|
|
323
|
-
/** 活动开始时间戳 */
|
|
324
|
-
startTime: number;
|
|
325
|
-
/** 活动结束时间戳 */
|
|
326
|
-
endTime: number;
|
|
327
|
-
/** 排名使用的积分名称 */
|
|
328
|
-
pointsName: string;
|
|
329
|
-
/** 是否已结束 */
|
|
330
|
-
isEnded: boolean;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* 奖励层级详情(用于弹窗显示)
|
|
335
|
-
*/
|
|
336
|
-
export declare interface RewardTierDetail {
|
|
337
|
-
/** 层级序号(从 1 开始) */
|
|
338
|
-
tierNo: number;
|
|
339
|
-
/** 排名范围文本(如 "1-10" 或 "Top 10%") */
|
|
340
|
-
rankRangeText: string;
|
|
341
|
-
/** 排名起始 */
|
|
342
|
-
rankFrom: number;
|
|
343
|
-
/** 排名结束 */
|
|
344
|
-
rankTo: number;
|
|
345
|
-
/** 获奖人数 */
|
|
346
|
-
winnerCount: number;
|
|
347
|
-
/** 奖励描述文本 */
|
|
348
|
-
rewardText: string;
|
|
349
|
-
/** 奖励金额 */
|
|
350
|
-
rewardAmount: string;
|
|
351
|
-
/** 奖励符号 */
|
|
352
|
-
rewardSymbol: string;
|
|
353
|
-
/** 奖励图标 URL */
|
|
354
|
-
rewardIcon: string;
|
|
355
|
-
/** 链名称 */
|
|
356
|
-
chainLabel: string;
|
|
357
|
-
/** 分配方式 */
|
|
358
|
-
distributeType: RewardsDistributeType;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Campaign 奖励信息获取 Hook
|
|
363
|
-
*
|
|
364
|
-
* @param campaignId - Campaign ID(undefined 时不获取数据)
|
|
365
|
-
* @returns Campaign 详情、奖励摘要、加载状态等
|
|
366
|
-
*
|
|
367
|
-
* @example
|
|
368
|
-
* ```tsx
|
|
369
|
-
* const { rewardSummary, loading, error } = useCampaignReward(campaignId);
|
|
370
|
-
*
|
|
371
|
-
* if (loading) return <div>Loading...</div>;
|
|
372
|
-
* if (error) return <div>Error: {error.message}</div>;
|
|
373
|
-
*
|
|
374
|
-
* return (
|
|
375
|
-
* <div>
|
|
376
|
-
* <p>Prize Pool: {rewardSummary?.prizePool}</p>
|
|
377
|
-
* <p>Total Winners: {rewardSummary?.totalWinners}</p>
|
|
378
|
-
* </div>
|
|
379
|
-
* );
|
|
380
|
-
* ```
|
|
381
|
-
*/
|
|
382
|
-
export declare function useCampaignReward(campaignId: number | undefined): UseCampaignRewardResult;
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* useCampaignReward Hook 返回值
|
|
386
|
-
*/
|
|
387
|
-
export declare interface UseCampaignRewardResult {
|
|
388
|
-
/** Campaign 详情 */
|
|
389
|
-
campaignInfo: CampaignInfo | null;
|
|
390
|
-
/** 奖励摘要 */
|
|
391
|
-
rewardSummary: RewardSummary | null;
|
|
392
|
-
/** 加载状态 */
|
|
393
|
-
loading: boolean;
|
|
394
|
-
/** 错误信息 */
|
|
395
|
-
error: Error | null;
|
|
396
|
-
/** 刷新数据 */
|
|
397
|
-
refresh: () => void;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* 排行榜数据获取 Hook
|
|
402
|
-
*
|
|
403
|
-
* @param options - 配置选项
|
|
404
|
-
* @returns 排行榜数据、加载状态、错误信息等
|
|
405
|
-
*
|
|
406
|
-
* @example
|
|
407
|
-
* ```tsx
|
|
408
|
-
* const { data, loading, error, refresh, total, totalPages } = useLeaderboard({
|
|
409
|
-
* tabConfig: currentTab,
|
|
410
|
-
* page: 0,
|
|
411
|
-
* pageSize: 20,
|
|
412
|
-
* });
|
|
413
|
-
* ```
|
|
414
|
-
*/
|
|
415
|
-
export declare function useLeaderboard(options: UseLeaderboardOptions): UseLeaderboardResult;
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* useLeaderboard Hook 配置选项
|
|
419
|
-
*/
|
|
420
|
-
export declare interface UseLeaderboardOptions {
|
|
421
|
-
/** 当前 Tab 配置 */
|
|
422
|
-
tabConfig: LeaderboardItem;
|
|
423
|
-
/** 当前页码(从 0 开始) */
|
|
424
|
-
page: number;
|
|
425
|
-
/** 每页数量 */
|
|
426
|
-
pageSize: number;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* useLeaderboard Hook 返回值
|
|
431
|
-
*/
|
|
432
|
-
export declare interface UseLeaderboardResult {
|
|
433
|
-
/** 排行榜数据 */
|
|
434
|
-
data: LeaderboardData | null;
|
|
435
|
-
/** 加载状态 */
|
|
436
|
-
loading: boolean;
|
|
437
|
-
/** 错误信息 */
|
|
438
|
-
error: Error | null;
|
|
439
|
-
/** 总数据条数 */
|
|
440
|
-
total: number;
|
|
441
|
-
/** 总页数 */
|
|
442
|
-
totalPages: number;
|
|
443
|
-
/** 刷新数据 */
|
|
444
|
-
refresh: () => void;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* 分页逻辑 Hook
|
|
449
|
-
*
|
|
450
|
-
* 支持两种模式:
|
|
451
|
-
* - **pagination**: 传统翻页模式,每次显示一页数据
|
|
452
|
-
* - **infinite**: 无限滚动模式,数据累加显示
|
|
453
|
-
*
|
|
454
|
-
* @param options - 配置选项
|
|
455
|
-
* @returns 分页状态和操作方法
|
|
456
|
-
*
|
|
457
|
-
* @example
|
|
458
|
-
* ```tsx
|
|
459
|
-
* // 翻页模式
|
|
460
|
-
* const pagination = usePagination({
|
|
461
|
-
* total: 100,
|
|
462
|
-
* pageSize: 10,
|
|
463
|
-
* mode: 'pagination',
|
|
464
|
-
* });
|
|
465
|
-
*
|
|
466
|
-
* // 无限滚动模式
|
|
467
|
-
* const infinite = usePagination({
|
|
468
|
-
* total: 100,
|
|
469
|
-
* pageSize: 10,
|
|
470
|
-
* mode: 'infinite',
|
|
471
|
-
* });
|
|
472
|
-
*
|
|
473
|
-
* // 在滚动到底部时调用
|
|
474
|
-
* if (infinite.hasMore) {
|
|
475
|
-
* infinite.loadMore();
|
|
476
|
-
* }
|
|
477
|
-
* ```
|
|
478
|
-
*/
|
|
479
|
-
export declare function usePagination(options: UsePaginationOptions): UsePaginationResult;
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* usePagination Hook 配置选项
|
|
483
|
-
*/
|
|
484
|
-
export declare interface UsePaginationOptions {
|
|
485
|
-
/** 总数据条数 */
|
|
486
|
-
total: number;
|
|
487
|
-
/** 每页显示数量 */
|
|
488
|
-
pageSize: number;
|
|
489
|
-
/** 初始页码(从 0 开始),默认 0 */
|
|
490
|
-
initialPage?: number;
|
|
491
|
-
/** 分页模式,默认 pagination */
|
|
492
|
-
mode?: PaginationMode;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* usePagination Hook 返回值
|
|
497
|
-
*/
|
|
498
|
-
export declare interface UsePaginationResult {
|
|
499
|
-
/** 当前页码(从 0 开始) */
|
|
500
|
-
page: number;
|
|
501
|
-
/** 总页数 */
|
|
502
|
-
totalPages: number;
|
|
503
|
-
/** 是否有上一页 */
|
|
504
|
-
hasPrevious: boolean;
|
|
505
|
-
/** 是否有下一页 */
|
|
506
|
-
hasNext: boolean;
|
|
507
|
-
/** 跳转到指定页 */
|
|
508
|
-
goToPage: (page: number) => void;
|
|
509
|
-
/** 上一页 */
|
|
510
|
-
goToPrevious: () => void;
|
|
511
|
-
/** 下一页 */
|
|
512
|
-
goToNext: () => void;
|
|
513
|
-
/** 重置到第一页 */
|
|
514
|
-
reset: () => void;
|
|
515
|
-
/** 当前页显示的起始序号(从 1 开始) */
|
|
516
|
-
startIndex: number;
|
|
517
|
-
/** 当前页显示的结束序号 */
|
|
518
|
-
endIndex: number;
|
|
519
|
-
/** 加载更多(infinite 模式专用) */
|
|
520
|
-
loadMore: () => void;
|
|
521
|
-
/** 是否还有更多数据(infinite 模式专用) */
|
|
522
|
-
hasMore: boolean;
|
|
523
|
-
/** 当前已加载的总条数(infinite 模式专用) */
|
|
524
|
-
loadedCount: number;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
/**
|
|
528
|
-
* 用户信息单元格组件
|
|
529
|
-
*
|
|
530
|
-
* @param props - 组件属性
|
|
531
|
-
* @returns 用户单元格元素
|
|
532
|
-
*/
|
|
533
|
-
export declare function UserCell({ userId, userName, displayName, avatar, isCurrentUser, youLabel, onUserClick, className, }: UserCellProps): JSX.Element;
|
|
534
|
-
|
|
535
|
-
export declare interface UserCellProps {
|
|
536
|
-
/** 用户 ID */
|
|
537
|
-
userId: number;
|
|
538
|
-
/** 用户名 */
|
|
539
|
-
userName: string;
|
|
540
|
-
/** 展示用名称(可用于格式化地址) */
|
|
541
|
-
displayName?: string;
|
|
542
|
-
/** 头像 URL */
|
|
543
|
-
avatar: string;
|
|
544
|
-
/** 是否为当前登录用户 */
|
|
545
|
-
isCurrentUser?: boolean;
|
|
546
|
-
/** 当前用户标识文本 */
|
|
547
|
-
youLabel?: string;
|
|
548
|
-
/** 用户点击回调 */
|
|
549
|
-
onUserClick?: (userId: number, userName: string) => void;
|
|
550
|
-
/** 自定义类名 */
|
|
551
|
-
className?: string;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
56
|
export { }
|
package/dist/leaderboard.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as u2 } from "./chunks/dynamic-import-helper-DwXlQC0S.js";
|
|
3
|
-
import { isAllTimeResponse, isCampaignResponse } from "@taskon/core";
|
|
1
|
+
import { L } from "./chunks/LeaderboardWidget-BNGRD5Bu.js";
|
|
4
2
|
export {
|
|
5
|
-
|
|
6
|
-
e as LeaderboardPagination,
|
|
7
|
-
d as LeaderboardTable,
|
|
8
|
-
b as LeaderboardTabs,
|
|
9
|
-
L as LeaderboardWidget,
|
|
10
|
-
R as RankBadge,
|
|
11
|
-
f as RewardRulesModal,
|
|
12
|
-
U as UserCell,
|
|
13
|
-
isAllTimeResponse,
|
|
14
|
-
isCampaignResponse,
|
|
15
|
-
a as useCampaignReward,
|
|
16
|
-
u as useLeaderboard,
|
|
17
|
-
u2 as usePagination
|
|
3
|
+
L as LeaderboardWidget
|
|
18
4
|
};
|
package/dist/page-builder.js
CHANGED