@taskon/widget-react 0.0.1-beta.5 → 0.0.1-beta.7

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.
Files changed (65) hide show
  1. package/README.md +61 -47
  2. package/dist/CommunityTaskList.css +9 -1
  3. package/dist/EligibilityInfo.css +48 -75
  4. package/dist/LeaderboardWidget.css +73 -71
  5. package/dist/PageBuilder.css +5 -0
  6. package/dist/Quest.css +18 -14
  7. package/dist/TaskOnProvider.css +289 -0
  8. package/dist/ThemeProvider.css +227 -0
  9. package/dist/UserCenterWidget.css +6 -6
  10. package/dist/UserCenterWidget2.css +1388 -1621
  11. package/dist/{dynamic-import-helper.css → WidgetShell.css} +0 -227
  12. package/dist/chunks/{CommunityTaskList-CrMvOB8w.js → CommunityTaskList-D0uVD8wD.js} +393 -208
  13. package/dist/chunks/{EligibilityInfo-Beww12QX.js → EligibilityInfo-Cf6hx9-a.js} +459 -679
  14. package/dist/chunks/{LeaderboardWidget-DwuSpVl0.js → LeaderboardWidget-DyoiiNS6.js} +274 -252
  15. package/dist/chunks/{PageBuilder-DsX6Tv0N.js → PageBuilder-DoAFPm6-.js} +5 -5
  16. package/dist/chunks/{Quest-CuD2LElS.js → Quest-ySZlYd4u.js} +74 -57
  17. package/dist/chunks/TaskOnProvider-CxtFIs3n.js +2072 -0
  18. package/dist/chunks/{dynamic-import-helper-WmIF58Sb.js → ThemeProvider-CulHkqqY.js} +1282 -555
  19. package/dist/chunks/UserCenterWidget-BJsc_GSZ.js +3246 -0
  20. package/dist/chunks/{UserCenterWidget-CvU6K4AC.js → UserCenterWidget-STq8kpV4.js} +1174 -1386
  21. package/dist/chunks/WidgetShell-8xn-Jivw.js +659 -0
  22. package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
  23. package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
  24. package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
  25. package/dist/chunks/{communitytask-ru-DhySaZL8.js → communitytask-ru-CZm2CPoV.js} +211 -1
  26. package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
  27. package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
  28. package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
  29. package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
  30. package/dist/chunks/{quest-es-D-b5xcme.js → quest-es-Dyyy0zaw.js} +8 -93
  31. package/dist/chunks/{quest-ja-Dxd2vqBF.js → quest-ja-Depog33y.js} +8 -93
  32. package/dist/chunks/{quest-ko-CSmRWgK_.js → quest-ko-BMu3uRQJ.js} +8 -93
  33. package/dist/chunks/{quest-ru-CkEKv1_F.js → quest-ru-xne814Rw.js} +8 -93
  34. package/dist/chunks/useIsMobile-D6Ybur-6.js +30 -0
  35. package/dist/chunks/useToast-BGJhd3BX.js +93 -0
  36. package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
  37. package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
  38. package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
  39. package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
  40. package/dist/community-task.d.ts +0 -390
  41. package/dist/community-task.js +2 -7
  42. package/dist/core.d.ts +38 -20
  43. package/dist/core.js +9 -10
  44. package/dist/index.d.ts +86 -709
  45. package/dist/index.js +22 -28
  46. package/dist/leaderboard.d.ts +0 -498
  47. package/dist/leaderboard.js +2 -16
  48. package/dist/page-builder.js +1 -1
  49. package/dist/quest.d.ts +0 -971
  50. package/dist/quest.js +2 -7
  51. package/dist/user-center.d.ts +0 -1610
  52. package/dist/user-center.js +2 -494
  53. package/package.json +2 -2
  54. package/dist/chunks/TaskOnProvider-xUeP2Nro.js +0 -1243
  55. package/dist/chunks/ThemeProvider-Bt4UZ33y.js +0 -1334
  56. package/dist/chunks/UserCenterWidget-CB0hnj-L.js +0 -3230
  57. package/dist/chunks/communitytask-es-1zawvXEX.js +0 -311
  58. package/dist/chunks/communitytask-ja-CmW6nP-L.js +0 -311
  59. package/dist/chunks/communitytask-ko-BD0hzQSi.js +0 -311
  60. package/dist/chunks/createLocaleLoader-BameiEhU.js +0 -65
  61. package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
  62. package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
  63. package/dist/chunks/useToast-CaRkylKe.js +0 -304
  64. package/dist/chunks/usercenter-ja-B2465c1O.js +0 -326
  65. package/dist/chunks/usercenter-ko-xAEYxqLg.js +0 -326
@@ -1,496 +1,4 @@
1
- import { A, a, b, U, u, g, h, d, e, f, c } from "./chunks/UserCenterWidget-CB0hnj-L.js";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { L as LoadingState, E as EmptyState, P as Pagination } from "./chunks/UserCenterWidget-CvU6K4AC.js";
4
- import { F, T, d as d2, f as f2, t, c as c2, u as u2, a as a2, b as b2 } from "./chunks/UserCenterWidget-CvU6K4AC.js";
5
- import { formatLocalDate, formatTokenAmount as formatTokenAmount$1, RewardType, createUserCenterApi } from "@taskon/core";
6
- import { getChainIcon, getChainName, getSocialIcon, toWei, truncateAddress } from "@taskon/core";
7
- import { D as Dialog, B as Button } from "./chunks/dynamic-import-helper-WmIF58Sb.js";
8
- import { useState, useMemo, useCallback, useEffect } from "react";
9
- import { d as useTaskOnContext } from "./chunks/ThemeProvider-Bt4UZ33y.js";
10
- function getTabLabel(tab, messages) {
11
- switch (tab) {
12
- case "MyRewards":
13
- return messages.tabMyRewards;
14
- case "Identity":
15
- return messages.tabIdentity;
16
- case "ActivityHistory":
17
- return messages.tabActivityHistory;
18
- default:
19
- return tab;
20
- }
21
- }
22
- function TabBar({
23
- activeTab,
24
- tabs,
25
- onTabChange,
26
- messages,
27
- className = ""
28
- }) {
29
- return /* @__PURE__ */ jsx("div", { className: `taskon-user-center-tabs ${className}`, children: tabs.map((tab) => /* @__PURE__ */ jsx(
30
- "button",
31
- {
32
- type: "button",
33
- className: `taskon-user-center-tabs__tab ${activeTab === tab ? "taskon-user-center-tabs__tab--active" : ""}`,
34
- onClick: () => onTabChange(tab),
35
- children: getTabLabel(tab, messages)
36
- },
37
- tab
38
- )) });
39
- }
40
- function formatTime(timestamp) {
41
- return formatLocalDate(timestamp);
42
- }
43
- function formatTokenAmount(amount) {
44
- return formatTokenAmount$1(amount, {
45
- showCurrency: false,
46
- useAbbreviation: false,
47
- decimals: 4,
48
- minValue: 1e-4,
49
- zeroText: "0"
50
- });
51
- }
52
- function getEmptyMessage(rewardType, messages) {
53
- switch (rewardType) {
54
- case "Token":
55
- return messages.emptyToken;
56
- case "Nft":
57
- return messages.emptyNft;
58
- default:
59
- return messages.noData;
60
- }
61
- }
62
- function TokenRow({ item, onClick }) {
63
- const tokenValue = item.reward_value;
64
- return /* @__PURE__ */ jsxs(
65
- "div",
66
- {
67
- className: "taskon-reward-detail__row",
68
- onClick,
69
- role: onClick ? "button" : void 0,
70
- tabIndex: onClick ? 0 : void 0,
71
- children: [
72
- /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--icon", children: tokenValue.token_logo && /* @__PURE__ */ jsx(
73
- "img",
74
- {
75
- src: tokenValue.token_logo,
76
- alt: tokenValue.token_name,
77
- className: "taskon-reward-detail__token-icon"
78
- }
79
- ) }),
80
- /* @__PURE__ */ jsxs("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--main", children: [
81
- /* @__PURE__ */ jsxs("span", { className: "taskon-reward-detail__primary", children: [
82
- "+",
83
- formatTokenAmount(tokenValue.amount),
84
- " ",
85
- tokenValue.token_name
86
- ] }),
87
- /* @__PURE__ */ jsx("span", { className: "taskon-reward-detail__secondary", children: item.campaign_name })
88
- ] }),
89
- /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--time", children: formatTime(item.reward_time) })
90
- ]
91
- }
92
- );
93
- }
94
- function NftRow({
95
- item,
96
- onClick,
97
- onClaim,
98
- onTxClick,
99
- messages
100
- }) {
101
- const nftValue = item.reward_value;
102
- const renderNftAction = () => {
103
- if (nftValue.tx_hash) {
104
- return /* @__PURE__ */ jsx(
105
- "button",
106
- {
107
- type: "button",
108
- className: "taskon-reward-detail__claimed-link",
109
- onClick: (e2) => {
110
- e2.stopPropagation();
111
- onTxClick == null ? void 0 : onTxClick();
112
- },
113
- title: nftValue.tx_hash,
114
- children: messages.claimedTxn
115
- }
116
- );
117
- }
118
- if (nftValue.claimable) {
119
- return /* @__PURE__ */ jsx(
120
- "button",
121
- {
122
- type: "button",
123
- className: "taskon-reward-detail__claim-btn",
124
- onClick: (e2) => {
125
- e2.stopPropagation();
126
- onClaim == null ? void 0 : onClaim();
127
- },
128
- children: messages.claim
129
- }
130
- );
131
- }
132
- return /* @__PURE__ */ jsx("span", { className: "taskon-reward-detail__manual-drop", children: messages.manualDrop });
133
- };
134
- return /* @__PURE__ */ jsxs(
135
- "div",
136
- {
137
- className: "taskon-reward-detail__row taskon-reward-detail__row--nft",
138
- onClick,
139
- role: onClick ? "button" : void 0,
140
- tabIndex: onClick ? 0 : void 0,
141
- children: [
142
- /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--nft-image", children: nftValue.collection_image && /* @__PURE__ */ jsx(
143
- "img",
144
- {
145
- src: nftValue.collection_image,
146
- alt: nftValue.collection_name,
147
- className: "taskon-reward-detail__nft-image"
148
- }
149
- ) }),
150
- /* @__PURE__ */ jsxs("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--main", children: [
151
- /* @__PURE__ */ jsx("span", { className: "taskon-reward-detail__primary", children: nftValue.collection_name }),
152
- /* @__PURE__ */ jsx("span", { className: "taskon-reward-detail__secondary", children: item.campaign_name })
153
- ] }),
154
- /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--time", children: formatTime(item.reward_time) }),
155
- /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--action", children: renderNftAction() })
156
- ]
157
- }
158
- );
159
- }
160
- function SimpleRow({ item, onClick }) {
161
- return /* @__PURE__ */ jsxs(
162
- "div",
163
- {
164
- className: "taskon-reward-detail__row",
165
- onClick,
166
- role: onClick ? "button" : void 0,
167
- tabIndex: onClick ? 0 : void 0,
168
- children: [
169
- /* @__PURE__ */ jsxs("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--main", children: [
170
- /* @__PURE__ */ jsx("span", { className: "taskon-reward-detail__primary", children: item.campaign_name }),
171
- /* @__PURE__ */ jsx("span", { className: "taskon-reward-detail__secondary", children: item.campaign_type })
172
- ] }),
173
- /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__cell taskon-reward-detail__cell--time", children: formatTime(item.reward_time) })
174
- ]
175
- }
176
- );
177
- }
178
- function RewardDetailList({
179
- rewardType,
180
- data,
181
- loading,
182
- error,
183
- pagination,
184
- messages,
185
- onItemClick,
186
- onClaim,
187
- onTxClick
188
- }) {
189
- if (loading && data.length === 0) {
190
- return /* @__PURE__ */ jsx(LoadingState, { message: messages.loading });
191
- }
192
- if (error && data.length === 0) {
193
- return /* @__PURE__ */ jsx("div", { className: "taskon-user-center-error", children: /* @__PURE__ */ jsx("p", { className: "taskon-user-center-error__message", children: error.message }) });
194
- }
195
- if (!loading && data.length === 0) {
196
- return /* @__PURE__ */ jsx(EmptyState, { message: getEmptyMessage(rewardType, messages) });
197
- }
198
- const renderRow = (item, index) => {
199
- const handleClick = onItemClick ? () => onItemClick(item) : void 0;
200
- const itemKey = `${item.campaign_id}-${item.reward_time}-${index}`;
201
- switch (rewardType) {
202
- case RewardType.Token:
203
- return /* @__PURE__ */ jsx(TokenRow, { item, onClick: handleClick }, itemKey);
204
- case RewardType.Nft:
205
- return /* @__PURE__ */ jsx(
206
- NftRow,
207
- {
208
- item,
209
- onClick: handleClick,
210
- onClaim: onClaim ? () => onClaim(item) : void 0,
211
- onTxClick: onTxClick ? () => onTxClick(item) : void 0,
212
- messages
213
- },
214
- itemKey
215
- );
216
- default:
217
- return /* @__PURE__ */ jsx(SimpleRow, { item, onClick: handleClick }, itemKey);
218
- }
219
- };
220
- return /* @__PURE__ */ jsxs("div", { className: "taskon-reward-detail", children: [
221
- /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__list", children: data.map((item, index) => renderRow(item, index)) }),
222
- pagination.totalPages > 1 && /* @__PURE__ */ jsx(
223
- Pagination,
224
- {
225
- page: pagination.page,
226
- totalPages: pagination.totalPages,
227
- onPrevious: pagination.goToPrevious,
228
- onNext: pagination.goToNext,
229
- hasPrevious: pagination.hasPrevious,
230
- hasNext: pagination.hasNext,
231
- messages
232
- }
233
- ),
234
- loading && data.length > 0 && /* @__PURE__ */ jsx("div", { className: "taskon-reward-detail__loading-more", children: /* @__PURE__ */ jsx("div", { className: "taskon-user-center-loading__spinner" }) })
235
- ] });
236
- }
237
- function formatAmount(amount) {
238
- const num = parseFloat(amount);
239
- if (isNaN(num) || num === 0) return "0";
240
- return num.toLocaleString(void 0, { maximumFractionDigits: 6 });
241
- }
242
- function WarningIcon() {
243
- return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "48", height: "48", children: /* @__PURE__ */ jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) });
244
- }
245
- function SuccessIcon() {
246
- return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "48", height: "48", children: /* @__PURE__ */ jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) });
247
- }
248
- function WithdrawModal({
249
- open,
250
- status,
251
- tokens,
252
- messages,
253
- error,
254
- txHash,
255
- isGasInsufficient,
256
- onConfirm,
257
- onCancel,
258
- onClose
259
- }) {
260
- if (!open) {
261
- return null;
262
- }
263
- if (status === "noEnough" || isGasInsufficient) {
264
- return /* @__PURE__ */ jsxs(
265
- Dialog,
266
- {
267
- open,
268
- onOpenChange: (isOpen) => {
269
- if (!isOpen) onClose();
270
- },
271
- title: messages.gasNotEnough,
272
- showCloseButton: true,
273
- contentClassName: "taskon-withdraw-modal__content",
274
- maxWidth: 400,
275
- children: [
276
- /* @__PURE__ */ jsxs("div", { className: "taskon-withdraw-modal__body", children: [
277
- /* @__PURE__ */ jsx("div", { className: "taskon-withdraw-modal__icon taskon-withdraw-modal__icon--warning", children: /* @__PURE__ */ jsx(WarningIcon, {}) }),
278
- /* @__PURE__ */ jsx("p", { className: "taskon-withdraw-modal__message", children: messages.gasNotEnough })
279
- ] }),
280
- /* @__PURE__ */ jsx("div", { className: "taskon-withdraw-modal__footer", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onClose, children: messages.ok ?? "OK" }) })
281
- ]
282
- }
283
- );
284
- }
285
- if (status === "success") {
286
- return /* @__PURE__ */ jsxs(
287
- Dialog,
288
- {
289
- open,
290
- onOpenChange: (isOpen) => {
291
- if (!isOpen) onClose();
292
- },
293
- title: messages.withdrawSuccess,
294
- showCloseButton: true,
295
- contentClassName: "taskon-withdraw-modal__content",
296
- maxWidth: 400,
297
- children: [
298
- /* @__PURE__ */ jsxs("div", { className: "taskon-withdraw-modal__body", children: [
299
- /* @__PURE__ */ jsx("div", { className: "taskon-withdraw-modal__icon taskon-withdraw-modal__icon--success", children: /* @__PURE__ */ jsx(SuccessIcon, {}) }),
300
- /* @__PURE__ */ jsx("p", { className: "taskon-withdraw-modal__message", children: messages.withdrawSuccess }),
301
- txHash && /* @__PURE__ */ jsxs("p", { className: "taskon-withdraw-modal__tx-hash", children: [
302
- "TX: ",
303
- txHash.slice(0, 10),
304
- "...",
305
- txHash.slice(-8)
306
- ] })
307
- ] }),
308
- /* @__PURE__ */ jsx("div", { className: "taskon-withdraw-modal__footer", children: /* @__PURE__ */ jsx(Button, { variant: "primary", onClick: onClose, children: messages.ok ?? "OK" }) })
309
- ]
310
- }
311
- );
312
- }
313
- return /* @__PURE__ */ jsxs(
314
- Dialog,
315
- {
316
- open,
317
- onOpenChange: (isOpen) => {
318
- if (!isOpen) onCancel();
319
- },
320
- title: messages.withdrawConfirm,
321
- showCloseButton: true,
322
- contentClassName: "taskon-withdraw-modal__content",
323
- maxWidth: 400,
324
- children: [
325
- /* @__PURE__ */ jsx("h3", { className: "taskon-withdraw-modal__title", children: messages.withdrawConfirm }),
326
- /* @__PURE__ */ jsxs("div", { className: "taskon-withdraw-modal__body", children: [
327
- /* @__PURE__ */ jsx("div", { className: "taskon-withdraw-modal__tokens", children: tokens.map((token) => /* @__PURE__ */ jsxs(
328
- "div",
329
- {
330
- className: "taskon-withdraw-modal__token-item",
331
- children: [
332
- /* @__PURE__ */ jsxs("div", { className: "taskon-withdraw-modal__token-info", children: [
333
- /* @__PURE__ */ jsx(
334
- "img",
335
- {
336
- src: token.tokenIcon,
337
- alt: token.tokenSymbol,
338
- className: "taskon-withdraw-modal__token-icon"
339
- }
340
- ),
341
- /* @__PURE__ */ jsxs("div", { className: "taskon-withdraw-modal__token-details", children: [
342
- /* @__PURE__ */ jsx("span", { className: "taskon-withdraw-modal__token-symbol", children: token.tokenSymbol }),
343
- /* @__PURE__ */ jsx("span", { className: "taskon-withdraw-modal__token-chain", children: token.chainLabel })
344
- ] })
345
- ] }),
346
- /* @__PURE__ */ jsx("span", { className: "taskon-withdraw-modal__token-amount", children: formatAmount(token.amount) })
347
- ]
348
- },
349
- token.tokenId
350
- )) }),
351
- error && /* @__PURE__ */ jsx("div", { className: "taskon-withdraw-modal__error", children: error.message })
352
- ] }),
353
- /* @__PURE__ */ jsxs("div", { className: "taskon-withdraw-modal__footer", children: [
354
- /* @__PURE__ */ jsx(
355
- Button,
356
- {
357
- variant: "secondary",
358
- onClick: onCancel,
359
- disabled: status === "loading",
360
- children: messages.cancel
361
- }
362
- ),
363
- /* @__PURE__ */ jsx(
364
- Button,
365
- {
366
- variant: "primary",
367
- onClick: onConfirm,
368
- disabled: status === "loading",
369
- loading: status === "loading",
370
- children: status === "loading" ? messages.loading : messages.withdraw
371
- }
372
- )
373
- ] })
374
- ]
375
- }
376
- );
377
- }
378
- function calculateXpLevelData(userInfo) {
379
- const xpPointsInfo = userInfo.points_list[0];
380
- if (!xpPointsInfo) return null;
381
- const currentXp = xpPointsInfo.amount;
382
- const nextLevelXp = userInfo.next_level_limit;
383
- let percent = 0;
384
- if (nextLevelXp > 0) {
385
- if (currentXp >= nextLevelXp) {
386
- percent = 100;
387
- } else {
388
- percent = Number((currentXp / nextLevelXp * 100).toFixed(2));
389
- }
390
- }
391
- const xpToNextLevel = currentXp >= nextLevelXp ? 0 : nextLevelXp - currentXp;
392
- return {
393
- level: userInfo.level,
394
- currentXp,
395
- nextLevelXp,
396
- totalXp: currentXp,
397
- percent,
398
- xpToNextLevel,
399
- xpPointsId: xpPointsInfo.points_info.points_id,
400
- xpPointsName: xpPointsInfo.points_info.points_name,
401
- xpPointsIcon: xpPointsInfo.points_info.points_icon
402
- };
403
- }
404
- function useXpLevel(options = {}) {
405
- const { autoLoad = true } = options;
406
- const { client } = useTaskOnContext();
407
- const [userInfo, setUserInfo] = useState(null);
408
- const [loading, setLoading] = useState(false);
409
- const [error, setError] = useState(null);
410
- const api = useMemo(() => {
411
- if (!client) return null;
412
- return createUserCenterApi(client);
413
- }, [client]);
414
- const xpData = useMemo(() => {
415
- if (!userInfo) return null;
416
- return calculateXpLevelData(userInfo);
417
- }, [userInfo]);
418
- const xpPointsInfo = useMemo(() => {
419
- if (!userInfo || !userInfo.points_list.length) return null;
420
- const firstPoints = userInfo.points_list[0];
421
- return firstPoints ?? null;
422
- }, [userInfo]);
423
- const otherPointsList = useMemo(() => {
424
- if (!userInfo || userInfo.points_list.length <= 1) return [];
425
- return userInfo.points_list.slice(1);
426
- }, [userInfo]);
427
- const fetchData = useCallback(async () => {
428
- if (!api) {
429
- setError(new Error("TaskOn client not initialized"));
430
- return;
431
- }
432
- setLoading(true);
433
- setError(null);
434
- try {
435
- const response = await api.getCUserInfo({});
436
- setUserInfo(response);
437
- } catch (err) {
438
- setError(
439
- err instanceof Error ? err : new Error("Failed to fetch user info")
440
- );
441
- } finally {
442
- setLoading(false);
443
- }
444
- }, [api]);
445
- const refresh = useCallback(async () => {
446
- await fetchData();
447
- }, [fetchData]);
448
- useEffect(() => {
449
- if (autoLoad) {
450
- fetchData();
451
- }
452
- }, [autoLoad, fetchData]);
453
- return {
454
- userInfo,
455
- xpData,
456
- xpPointsInfo,
457
- otherPointsList,
458
- loading,
459
- error,
460
- refresh
461
- };
462
- }
1
+ import { U } from "./chunks/UserCenterWidget-BJsc_GSZ.js";
463
2
  export {
464
- A as ActivityHistoryList,
465
- a as AssetCard,
466
- b as AssetCarousel,
467
- EmptyState,
468
- F as FrozenAssetList,
469
- LoadingState,
470
- Pagination,
471
- RewardDetailList,
472
- TabBar,
473
- T as TokenAssetList,
474
- U as UserCenterWidget,
475
- WithdrawModal,
476
- d2 as buildRewardCards,
477
- f2 as formatTokenAmount,
478
- getChainIcon,
479
- getChainName,
480
- getSocialIcon,
481
- toWei,
482
- t as toWithdrawItem,
483
- truncateAddress,
484
- u as useActivityHistory,
485
- g as useBindWallet,
486
- h as useDisableUnlink,
487
- d as useFrozenAssets,
488
- e as useIdentityData,
489
- c2 as usePointsHistory,
490
- u2 as useRewardDetails,
491
- a2 as useTokenAssets,
492
- b2 as useTokenWithdraw,
493
- f as useUnbindSocial,
494
- c as useUserRewards,
495
- useXpLevel
3
+ U as UserCenterWidget
496
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskon/widget-react",
3
- "version": "0.0.1-beta.5",
3
+ "version": "0.0.1-beta.7",
4
4
  "description": "TaskOn React Widget Library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -81,7 +81,7 @@
81
81
  "postcss-mixins": "^12.1.2",
82
82
  "react": "^19.2.0",
83
83
  "react-dom": "^19.2.0",
84
- "typescript": "5.9.2",
84
+ "typescript": "5.8.2",
85
85
  "vite": "^6.3.5",
86
86
  "vite-plugin-dts": "^4.5.4",
87
87
  "vite-plugin-lib-inject-css": "^2.2.2",