@taskon/widget-react 0.0.1-beta.5 → 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.
Files changed (58) hide show
  1. package/README.md +13 -4
  2. package/dist/CommunityTaskList.css +9 -1
  3. package/dist/EligibilityInfo.css +46 -42
  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 +2 -0
  8. package/dist/UserCenterWidget.css +6 -6
  9. package/dist/UserCenterWidget2.css +1626 -1601
  10. package/dist/{dynamic-import-helper.css → WidgetShell.css} +2 -2
  11. package/dist/chunks/{CommunityTaskList-CrMvOB8w.js → CommunityTaskList-Hde2OKHH.js} +360 -154
  12. package/dist/chunks/{EligibilityInfo-Beww12QX.js → EligibilityInfo-BV0Z2TgY.js} +533 -561
  13. package/dist/chunks/{LeaderboardWidget-DwuSpVl0.js → LeaderboardWidget-BNGRD5Bu.js} +270 -249
  14. package/dist/chunks/{PageBuilder-DsX6Tv0N.js → PageBuilder-C5DSHiW9.js} +5 -5
  15. package/dist/chunks/{Quest-CuD2LElS.js → Quest-DG9zfXJo.js} +72 -50
  16. package/dist/chunks/{TaskOnProvider-xUeP2Nro.js → TaskOnProvider-BhamHIyY.js} +34 -17
  17. package/dist/chunks/{ThemeProvider-Bt4UZ33y.js → ThemeProvider-mXLdLSkq.js} +81 -18
  18. package/dist/chunks/{UserCenterWidget-CvU6K4AC.js → UserCenterWidget-D5ttw4hO.js} +1328 -1337
  19. package/dist/chunks/{UserCenterWidget-CB0hnj-L.js → UserCenterWidget-jDO5zTN1.js} +298 -231
  20. package/dist/chunks/{dynamic-import-helper-WmIF58Sb.js → WidgetShell-D7yC894Y.js} +447 -457
  21. package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
  22. package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
  23. package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
  24. package/dist/chunks/{communitytask-ru-DhySaZL8.js → communitytask-ru-CZm2CPoV.js} +211 -1
  25. package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
  26. package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
  27. package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
  28. package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
  29. package/dist/chunks/{quest-es-D-b5xcme.js → quest-es-Dyyy0zaw.js} +8 -93
  30. package/dist/chunks/{quest-ja-Dxd2vqBF.js → quest-ja-Depog33y.js} +8 -93
  31. package/dist/chunks/{quest-ko-CSmRWgK_.js → quest-ko-BMu3uRQJ.js} +8 -93
  32. package/dist/chunks/{quest-ru-CkEKv1_F.js → quest-ru-xne814Rw.js} +8 -93
  33. package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
  34. package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
  35. package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
  36. package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
  37. package/dist/community-task.d.ts +0 -390
  38. package/dist/community-task.js +2 -7
  39. package/dist/core.d.ts +29 -5
  40. package/dist/core.js +8 -9
  41. package/dist/index.d.ts +29 -701
  42. package/dist/index.js +18 -29
  43. package/dist/leaderboard.d.ts +0 -498
  44. package/dist/leaderboard.js +2 -16
  45. package/dist/page-builder.js +1 -1
  46. package/dist/quest.d.ts +0 -971
  47. package/dist/quest.js +2 -7
  48. package/dist/user-center.d.ts +0 -1610
  49. package/dist/user-center.js +2 -494
  50. package/package.json +2 -2
  51. package/dist/chunks/communitytask-es-1zawvXEX.js +0 -311
  52. package/dist/chunks/communitytask-ja-CmW6nP-L.js +0 -311
  53. package/dist/chunks/communitytask-ko-BD0hzQSi.js +0 -311
  54. package/dist/chunks/createLocaleLoader-BameiEhU.js +0 -65
  55. package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
  56. package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
  57. package/dist/chunks/usercenter-ja-B2465c1O.js +0 -326
  58. package/dist/chunks/usercenter-ko-xAEYxqLg.js +0 -326
package/dist/index.d.ts CHANGED
@@ -1,180 +1,24 @@
1
- import { CampaignStatusInfo } from '@taskon/core';
2
1
  import { CampaignWinnerReward } from '@taskon/core';
3
2
  import { ChainInfo } from '@taskon/core';
4
3
  import { ChainType } from '@taskon/core';
5
4
  import { CloudThemeConfig } from '@taskon/core';
6
5
  import { CommunityInfo } from '@taskon/core';
7
- import { CommunityTaskInfo } from '@taskon/core';
8
- import { ComponentPropsWithoutRef } from 'react';
9
6
  import { default as default_2 } from 'react';
10
- import { ElementType } from 'react';
11
- import { ForwardRefExoticComponent } from 'react';
12
- import { GtcUserTaskStatus } from '@taskon/core';
13
7
  import { LeaderboardContentConfig } from '@taskon/core';
14
8
  import { LoginResult } from '@taskon/core';
15
- import { MeetCondition } from '@taskon/core';
16
9
  import { PageBuilderConfig } from '@taskon/core';
17
- import { QuestApi } from '@taskon/core';
18
10
  import { QuestCampaignInfo } from '@taskon/core';
19
11
  import { ReactNode } from 'react';
20
- import { RecurrenceType } from '@taskon/core';
21
- import { RefAttributes } from 'react';
22
12
  import { RewardDisplayMode } from '@taskon/core';
23
13
  import { RewardType } from '@taskon/core';
24
14
  import { RewardValueInfo } from '@taskon/core';
25
15
  import { SnsType } from '@taskon/core';
26
16
  import { TaskOnClient } from '@taskon/core';
27
- import { TaskReviewResult } from '@taskon/core';
28
- import { UserCampaignStatusInfo } from '@taskon/core';
29
17
  import { UserCenterConfig } from '@taskon/core';
30
18
  import { UserCenterRewardCardType } from '@taskon/core';
31
19
  import { UserCenterTabType } from '@taskon/core';
32
20
  import { UserInfo } from '@taskon/core';
33
21
 
34
- /**
35
- * Button 通用按钮组件
36
- *
37
- * 基于 Radix UI Slot 实现,支持 asChild 模式
38
- *
39
- * @example
40
- * ```tsx
41
- * // 基础用法
42
- * <Button>点击我</Button>
43
- *
44
- * // 不同变体
45
- * <Button variant="primary">主要按钮</Button>
46
- * <Button variant="secondary">次要按钮</Button>
47
- * <Button variant="outline">描边按钮</Button>
48
- * <Button variant="ghost">幽灵按钮</Button>
49
- * <Button variant="danger">危险按钮</Button>
50
- *
51
- * // 不同尺寸
52
- * <Button size="small">小按钮</Button>
53
- * <Button size="medium">中等按钮</Button>
54
- * <Button size="large">大按钮</Button>
55
- *
56
- * // 加载状态
57
- * <Button loading>加载中</Button>
58
- *
59
- * // 带图标
60
- * <Button leftIcon={<Icon />}>左侧图标</Button>
61
- * <Button rightIcon={<Icon />}>右侧图标</Button>
62
- *
63
- * // 禁用状态
64
- * <Button disabled>禁用按钮</Button>
65
- *
66
- * // asChild 模式(将 Button 样式应用到子元素)
67
- * <Button asChild>
68
- * <a href="/about">链接按钮</a>
69
- * </Button>
70
- * ```
71
- */
72
- export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
73
-
74
- /**
75
- * Button 组件属性
76
- */
77
- export declare interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
78
- /**
79
- * 按钮尺寸
80
- * @default "medium"
81
- */
82
- size?: ButtonSize;
83
- /**
84
- * 按钮变体
85
- * @default "primary"
86
- */
87
- variant?: ButtonVariant;
88
- /**
89
- * 是否为加载状态
90
- * @default false
91
- */
92
- loading?: boolean;
93
- /**
94
- * 图标位置
95
- */
96
- iconPosition?: "left" | "right" | "only";
97
- /**
98
- * 左侧图标
99
- */
100
- leftIcon?: ReactNode;
101
- /**
102
- * 右侧图标
103
- */
104
- rightIcon?: ReactNode;
105
- /**
106
- * 是否作为子元素渲染(使用 Radix Slot)
107
- * 当为 true 时,Button 会将所有属性传递给第一个子元素
108
- * @default false
109
- */
110
- asChild?: boolean;
111
- /**
112
- * 按钮内容
113
- */
114
- children?: ReactNode;
115
- }
116
-
117
- /**
118
- * Button 尺寸类型
119
- */
120
- export declare type ButtonSize = "small" | "medium" | "large";
121
-
122
- /**
123
- * Button 变体类型
124
- */
125
- export declare type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger";
126
-
127
- /**
128
- * CardSelector 组件
129
- *
130
- * @example
131
- * ```tsx
132
- * const options = [
133
- * { value: 'all', label: 'All Tasks' },
134
- * { value: 1, label: 'Daily Tasks' },
135
- * { value: 2, label: 'Weekly Tasks' },
136
- * ];
137
- *
138
- * <CardSelector
139
- * options={options}
140
- * value={selectedValue}
141
- * onChange={setSelectedValue}
142
- * allowDeselect
143
- * />
144
- * ```
145
- */
146
- export declare function CardSelector<T extends string | number = string | number>({ options, value, onChange, allowDeselect, className, itemClassName, }: CardSelectorProps<T>): default_2.ReactElement;
147
-
148
- /**
149
- * 选项配置
150
- */
151
- export declare interface CardSelectorOption<T = string | number> {
152
- /** 选项的值 */
153
- value: T;
154
- /** 选项的显示文本 */
155
- label: string;
156
- }
157
-
158
- /**
159
- * CardSelector 组件属性
160
- */
161
- export declare interface CardSelectorProps<T = string | number> {
162
- /** 选项列表 */
163
- options: CardSelectorOption<T>[];
164
- /** 当前选中的值 */
165
- value?: T;
166
- /** 值变化回调 */
167
- onChange?: (value: T | undefined) => void;
168
- /** 是否允许取消选择(点击已选中项取消选择)
169
- * @default true
170
- */
171
- allowDeselect?: boolean;
172
- /** 自定义根容器类名 */
173
- className?: string;
174
- /** 自定义选项类名 */
175
- itemClassName?: string;
176
- }
177
-
178
22
  /**
179
23
  * Clear the locale cache
180
24
  * Useful for testing or when you need to force reload locales
@@ -235,37 +79,6 @@ export declare interface CommonMessages {
235
79
  confirm: string;
236
80
  }
237
81
 
238
- /**
239
- * BaseTask 组件
240
- * @description 基础任务卡片,职责:
241
- * - 卡片布局(flex 容器)
242
- * - 周期标签显示
243
- * - 任务标题显示
244
- * - 有效时间显示
245
- * - 按钮区域管理
246
- * - 完成状态样式
247
- *
248
- * @example
249
- * ```tsx
250
- * <BaseTask
251
- * title="Follow @TaskOn_xyz"
252
- * isWon={false}
253
- * isCompleted={false}
254
- * isPeriodic={true}
255
- * recurrenceLabel="Daily"
256
- * taskId={123}
257
- * actionLabel="Follow"
258
- * actionLink="https://twitter.com/TaskOn_xyz"
259
- * reward={{ type: 'points', amount: 100, name: 'Points', icon: '/icon.png' }}
260
- * onClick={() => console.log('卡片被点击')}
261
- * onClaim={() => console.log('Claim 按钮被点击')}
262
- * >
263
- * <div>额外的任务描述内容</div>
264
- * </BaseTask>
265
- * ```
266
- */
267
- export declare function CommunityTask(props: CommunityTaskProps): default_2.ReactElement;
268
-
269
82
  /**
270
83
  * CommunityTaskList outer wrapper
271
84
  *
@@ -354,292 +167,6 @@ export declare interface CommunityTaskListProps {
354
167
  rewardRedirectUrl?: string;
355
168
  }
356
169
 
357
- /**
358
- * 任务卡片基础 Props(最小知识原则)
359
- * BaseTask 只需要知道这些信息
360
- */
361
- export declare interface CommunityTaskProps {
362
- /** 任务名称/标题(字符串或自定义渲染节点) */
363
- title: string | React.ReactNode;
364
- /** 是否已中奖/完成 */
365
- isWon: boolean;
366
- /** 是否已提交(可能未中奖) */
367
- isCompleted: boolean;
368
- /** 是否是周期任务 */
369
- isPeriodic: boolean;
370
- /** 操作按钮文案(如 "Follow"、"Join") */
371
- actionLabel?: string;
372
- /** 操作按钮链接(默认在新标签页打开) */
373
- actionLink?: string;
374
- /** 点击操作按钮后是否自动验证 */
375
- actionAutoVerify?: boolean;
376
- /**
377
- * 点击 Action 按钮时自动打开弹窗
378
- * 用于 PowTask、InviteFriends 等需要在弹窗中填写内容的任务
379
- */
380
- actionAutoDialog?: boolean;
381
- /** 是否总是显示操作按钮(即使已完成) */
382
- alwaysShowAction?: boolean;
383
- /**
384
- * 标题跳转链接
385
- * 如果提供,标题将变成可点击的链接,在新标签页打开
386
- */
387
- targetLink?: string;
388
- /** 是否隐藏 Claim 按钮 */
389
- noClaim?: boolean;
390
- /**
391
- * 是否需要验证后才能 Claim
392
- * - true: 显示 "Verify & Claim"
393
- * - false: 显示 "Claim"
394
- */
395
- verifyClaim?: boolean;
396
- /**
397
- * 点击 Claim 仅打开弹窗(不提交)
398
- * 用于 QuizTask、SurveyTask 等需要在弹窗中选择答案的任务
399
- */
400
- claimDialog?: boolean;
401
- /**
402
- * 社交账号类型(用于 OAuth 绑定)
403
- * 决定 Claim 时需要绑定哪种社交账号
404
- */
405
- snsType?: SnsType;
406
- /**
407
- * 链类型(用于钱包绑定)
408
- * 决定 Claim 时需要绑定哪种链的钱包
409
- */
410
- chainType?: ChainType;
411
- /** 周期标签文本(如 "Daily"、"Weekly") */
412
- recurrenceLabel?: string;
413
- /** 任务重复类型(用于 Claim 按钮文案逻辑) */
414
- recurrence?: RecurrenceType;
415
- /** 是否隐藏周期标签 */
416
- noRecurrence?: boolean;
417
- /**
418
- * Unlimited 任务是否显示大的 Claim 按钮
419
- * - true: 显示正常大小的 Claim 按钮
420
- * - false: 显示小的 Update 按钮(已有积分)
421
- * @default true
422
- */
423
- showUnlimitedClaim?: boolean;
424
- /** 任务 ID */
425
- taskId: number;
426
- /** 有效时间相关 */
427
- validTime?: {
428
- /** 开始时间(格式化字符串) */
429
- startTime?: string;
430
- /** 结束时间(格式化字符串) */
431
- endTime?: string;
432
- /** 是否已过期 */
433
- isExpired?: boolean;
434
- };
435
- /**
436
- * 验证时间范围(OnChain 任务专用)
437
- * 显示 "This task only verify action during {start} - {end}(UTC)"
438
- */
439
- validationTimeFrame?: {
440
- /** 开始时间(毫秒或秒时间戳) */
441
- start_time: number;
442
- /** 结束时间(毫秒或秒时间戳) */
443
- end_time: number;
444
- };
445
- /** 奖励信息 */
446
- reward?: {
447
- /** 奖励类型 */
448
- type: "points" | "token" | "none";
449
- /** 积分数量(points 类型,单次奖励) */
450
- amount?: number;
451
- /** 积分名称(points 类型) */
452
- name?: string;
453
- /** 积分图标(points 类型) */
454
- icon?: string;
455
- /** 累计积分(周期任务完成时显示) */
456
- totalAmount?: number;
457
- /** Token 信息(token 类型) */
458
- token?: {
459
- /** Token 名称 */
460
- name: string;
461
- /** 每次奖励数量 */
462
- amount: string;
463
- /** Token 图标 */
464
- icon?: string;
465
- /** 链名称 */
466
- chain?: string;
467
- /** 链图标 */
468
- chainIcon?: string;
469
- /** 总奖励单位数 */
470
- totalUnit?: number;
471
- /** 可用单位数 */
472
- availableUnit?: number;
473
- };
474
- };
475
- /** 卡片内容(由具体任务组件提供,用于展示任务特定内容) */
476
- children?: React.ReactNode;
477
- /**
478
- * 自定义 Action 按钮区域
479
- * 如果提供,将替换默认的 Action 按钮
480
- * @example
481
- * ```tsx
482
- * <BaseTask
483
- * actionSlot={<CustomActionButton onClick={handleAction} />}
484
- * />
485
- * ```
486
- */
487
- actionSlot?: React.ReactNode;
488
- /**
489
- * 自定义奖励展示(已完成状态)
490
- * 如果提供,将替换默认的 Won 奖励显示
491
- * @example
492
- * ```tsx
493
- * <BaseTask
494
- * rewardSlot={<CustomRewardDisplay amount={100} />}
495
- * />
496
- * ```
497
- */
498
- rewardSlot?: React.ReactNode;
499
- /**
500
- * 是否已登录
501
- * - true: 正常显示卡片
502
- * - false/undefined: 显示登录遮层,点击触发 onLogin
503
- * @default true
504
- */
505
- isLoggedIn?: boolean;
506
- /** 点击卡片回调(用于打开弹窗) */
507
- onClick?: () => void;
508
- /**
509
- * 点击 Claim 按钮回调
510
- * @param token - 可选的 OAuth token(reAuth 成功后传入)
511
- * @returns 可选返回 Promise,包含结果信息用于 reAuth 判断和 coolDown 更新
512
- */
513
- onClaim?: (token?: string) => void | Promise<{
514
- successful: boolean;
515
- errorCode?: string;
516
- cool_down?: number;
517
- }>;
518
- /**
519
- * 点击登录遮层回调
520
- * 未登录时(isLoggedIn=false)点击卡片会触发此回调
521
- */
522
- onLogin?: () => void;
523
- /** 是否正在提交 */
524
- isSubmitting?: boolean;
525
- /** 冷却时间(毫秒) */
526
- coolDown?: number;
527
- /** 冷却结束回调(用于重置 coolDown 状态) */
528
- onCoolDownComplete?: () => void;
529
- /**
530
- * 周期任务倒计时结束回调
531
- * 用于在 next_time 到期后刷新单个任务卡片状态
532
- */
533
- onDoneCountdownComplete?: (taskId: number) => void | Promise<void>;
534
- /** 是否禁用交互 */
535
- disabled?: boolean;
536
- /**
537
- * 审核结果状态
538
- * - Passed: 审核通过
539
- * - Failed: 审核失败(显示 "Oops! Failed")
540
- * - UnReviewed: 审核中(显示 "Under Review")
541
- */
542
- reviewResult?: TaskReviewResult;
543
- /**
544
- * CheckProgressTip 需要的社区信息
545
- * 用于显示 "Contact {name} to check your progress"
546
- */
547
- communityInfo?: {
548
- /** 社区名称 */
549
- name?: string;
550
- /** 社区联系链接(Discord/Telegram/Twitter) */
551
- contactLink?: string;
552
- };
553
- /**
554
- * 周期任务:当前周期是否已完成
555
- * 配合 nextTime 用于显示 DoneCountdown
556
- */
557
- currentCompleted?: boolean;
558
- /**
559
- * 周期任务:下次可完成的时间戳(毫秒)
560
- * 用于显示 DoneCountdown 倒计时
561
- */
562
- nextTime?: number;
563
- }
564
-
565
- /**
566
- * ConfirmNoticeDialog component
567
- *
568
- * @description
569
- * - Replicates the original ConfirmNotice content structure
570
- * - Supports default two-button mode and custom action slot
571
- * - Reuses Dialog for accessibility / portal / keyboard interactions
572
- * - Intentionally removes glow background layer
573
- */
574
- export declare function ConfirmNoticeDialog({ open, onOpenChange, type, title, desc, col, cancelButton, confirmButton, onCancel, onConfirm, onClose, closeOnCancel, closeOnConfirm, cancelDisabled, confirmDisabled, showCloseButton, closeOnOverlayClick, closeOnEscapeKey, maxWidth, className, contentClassName, children, actions, footer, accessibilityTitle, accessibilityDescription, }: ConfirmNoticeDialogProps): default_2.ReactElement;
575
-
576
- /**
577
- * ConfirmNoticeDialog props
578
- */
579
- export declare interface ConfirmNoticeDialogProps {
580
- /** Whether the dialog is open (controlled) */
581
- open: boolean;
582
- /** Controlled open state callback */
583
- onOpenChange: (open: boolean) => void;
584
- /** Notice visual type */
585
- type?: ConfirmNoticeType;
586
- /** Title rendered below the icon */
587
- title?: default_2.ReactNode;
588
- /** Description rendered below the title */
589
- desc?: default_2.ReactNode;
590
- /** Allow action area wrapping on desktop */
591
- col?: boolean;
592
- /** Cancel button label. Hidden if omitted */
593
- cancelButton?: default_2.ReactNode;
594
- /** Confirm button label. Hidden if omitted */
595
- confirmButton?: default_2.ReactNode;
596
- /** Cancel button click callback */
597
- onCancel?: () => void;
598
- /** Confirm button click callback */
599
- onConfirm?: () => void;
600
- /** Called when dialog closes via overlay / ESC / close button / programmatic close */
601
- onClose?: () => void;
602
- /** Auto close after cancel click, defaults to true */
603
- closeOnCancel?: boolean;
604
- /** Auto close after confirm click, defaults to true */
605
- closeOnConfirm?: boolean;
606
- /** Disable cancel button */
607
- cancelDisabled?: boolean;
608
- /** Disable confirm button */
609
- confirmDisabled?: boolean;
610
- /** Show top-right close button, defaults to false (closer to original ConfirmNotice) */
611
- showCloseButton?: boolean;
612
- /** Allow closing by overlay click, defaults to true */
613
- closeOnOverlayClick?: boolean;
614
- /** Allow closing by ESC key, defaults to true */
615
- closeOnEscapeKey?: boolean;
616
- /** Dialog max width, defaults to 470 (same as original) */
617
- maxWidth?: string | number;
618
- /** Additional class on content root */
619
- className?: string;
620
- /** Additional class on Dialog.Content */
621
- contentClassName?: string;
622
- /** Custom body content between description and actions */
623
- children?: default_2.ReactNode;
624
- /** Custom action area. Overrides default cancel/confirm buttons */
625
- actions?: default_2.ReactNode;
626
- /** Extra content rendered after actions */
627
- footer?: default_2.ReactNode;
628
- /**
629
- * Accessible dialog title
630
- * - Falls back to string `title`
631
- * - Uses default value when title is not a string
632
- */
633
- accessibilityTitle?: string;
634
- /** Accessible dialog description */
635
- accessibilityDescription?: string;
636
- }
637
-
638
- /**
639
- * ConfirmNotice visual style type
640
- */
641
- export declare type ConfirmNoticeType = "default" | "success" | "warn";
642
-
643
170
  /**
644
171
  * Create a locale loader function for a widget
645
172
  *
@@ -686,44 +213,6 @@ export declare function createLocaleLoader<T>(defaultMessages: T, imports: Local
686
213
  */
687
214
  export declare function createT<T extends Record<string, string>>(messages: T): <K extends keyof T>(key: K, params?: InterpolationParams) => string;
688
215
 
689
- /**
690
- * Rich text translation component.
691
- *
692
- * It first translates text with temporary markers, then replaces markers
693
- * with provided React nodes.
694
- */
695
- export declare function I18nT<T extends Record<string, string>, K extends keyof T>({ t, i18nKey, values, components, textClassName, as: Wrapper, className, }: I18nTProps<T, K>): default_2.ReactElement;
696
-
697
- /**
698
- * Slot component map for rich placeholders.
699
- *
700
- * Key is the interpolation name in message template, e.g. {community}
701
- */
702
- export declare type I18nTComponents = Record<string, ReactNode>;
703
-
704
- /**
705
- * I18nT component props
706
- *
707
- * @template T - Locale messages object type
708
- * @template K - Message key type
709
- */
710
- export declare interface I18nTProps<T extends Record<string, string>, K extends keyof T> {
711
- /** Translation function returned by useTranslation/useXxxLocale */
712
- t: TFunction<T>;
713
- /** Translation key */
714
- i18nKey: K;
715
- /** Plain interpolation values */
716
- values?: InterpolationParams;
717
- /** Rich component slots */
718
- components?: I18nTComponents;
719
- /** Optional className for plain text fragments between rich slots */
720
- textClassName?: string;
721
- /** Optional wrapper element type (default: Fragment) */
722
- as?: ElementType;
723
- /** Optional wrapper className (only applied when `as` is provided) */
724
- className?: string;
725
- }
726
-
727
216
  /**
728
217
  * Interpolate a string with parameters
729
218
  *
@@ -1114,9 +603,21 @@ export declare interface TaskOnContextValue {
1114
603
  */
1115
604
  client: TaskOnClient | null;
1116
605
  /**
1117
- * Whether the provider is initializing
606
+ * Whether the provider is in full initialization flow.
607
+ *
608
+ * Notes:
609
+ * - Includes session restore and token validation.
610
+ * - When a stored token exists, this stays true until user info validation completes.
1118
611
  */
1119
612
  isInitializing: boolean;
613
+ /**
614
+ * Whether session prerequisites are ready for data requests.
615
+ * True means client is created and auth token has been loaded
616
+ * (or no token exists, anonymous mode).
617
+ *
618
+ * This can become true earlier than `isInitializing === false`.
619
+ */
620
+ isSessionReady: boolean;
1120
621
  /**
1121
622
  * Resolved locale
1122
623
  */
@@ -1239,10 +740,13 @@ export declare interface TaskOnProviderConfig {
1239
740
  /**
1240
741
  * WalletConnect Project ID
1241
742
  *
1242
- * Required for WalletConnect functionality.
1243
- * Get your project ID at https://cloud.walletconnect.com
743
+ * Only needed when you design Web3 wallet login or wallet-based reward flows.
744
+ * (e.g. wallet binding, on-chain verification, NFT/token claiming)
1244
745
  *
1245
- * If not provided, WalletConnect option will be disabled in the wallet dialog.
746
+ * Optional. If not provided, SDK built-in default project ID will be used.
747
+ * For production, it is strongly recommended to set your own project ID.
748
+ *
749
+ * Get your project ID at https://cloud.walletconnect.com
1246
750
  */
1247
751
  walletConnectProjectId?: string;
1248
752
  }
@@ -1298,67 +802,6 @@ export declare interface TaskOnThemeConfig {
1298
802
  dark?: ModeThemeConfig;
1299
803
  }
1300
804
 
1301
- /**
1302
- * TemplateTask 组件
1303
- *
1304
- * @description 通用模版任务组件,负责:
1305
- * - 解析 task.template.params 获取任务参数
1306
- * - 使用 BaseTask 展示任务卡片
1307
- * - 渲染描述字段(desc、desc_fields)
1308
- * - 处理 Action 按钮(action_label、action_link)
1309
- *
1310
- * @example
1311
- * ```tsx
1312
- * <TemplateTask
1313
- * task={taskInfo}
1314
- * userStatus={userStatus}
1315
- * onClick={() => console.log('卡片点击')}
1316
- * onClaim={() => console.log('Claim 点击')}
1317
- * />
1318
- * ```
1319
- */
1320
- export declare function TemplateTask({ task, userStatus, meetConditions, communityInfo, disabled, onClick, onClaim, onUpdate, onEligTaskClick, coolDown: sharedCoolDown, onCoolDownComplete: sharedOnCoolDownComplete, onDoneCountdownComplete, }: TemplateTaskProps): default_2.ReactElement;
1321
-
1322
- /**
1323
- * TemplateTask 组件属性
1324
- */
1325
- export declare interface TemplateTaskProps {
1326
- /** 任务信息 */
1327
- task: CommunityTaskInfo;
1328
- /** 用户状态 */
1329
- userStatus?: GtcUserTaskStatus;
1330
- /** 资格条件列表(有值时显示遮罩) */
1331
- meetConditions?: MeetCondition[];
1332
- /** 社区信息(用于前置任务链接跳转) */
1333
- communityInfo?: {
1334
- community_key?: string;
1335
- dapp_domain?: string;
1336
- };
1337
- /** 是否禁用交互 */
1338
- disabled?: boolean;
1339
- /** 点击卡片回调 */
1340
- onClick?: () => void;
1341
- /**
1342
- * 点击 Claim 回调
1343
- * @param token 可选的 OAuth token(reAuth 成功后传入)
1344
- */
1345
- onClaim?: (token?: string) => void | Promise<{
1346
- successful: boolean;
1347
- errorCode?: string;
1348
- cool_down?: number;
1349
- }>;
1350
- /** 任务更新回调(完成/验证成功后) */
1351
- onUpdate?: (taskId: number) => void | Promise<void>;
1352
- /** 点击资格条件中的前置任务回调(用于打开任务弹窗) */
1353
- onEligTaskClick?: (taskId: number) => void;
1354
- /** 共享的 coolDown 值(来自父组件) */
1355
- coolDown?: number;
1356
- /** coolDown 倒计时结束回调 */
1357
- onCoolDownComplete?: () => void;
1358
- /** 周期任务倒计时结束回调(用于刷新单任务状态) */
1359
- onDoneCountdownComplete?: (taskId: number) => void | Promise<void>;
1360
- }
1361
-
1362
805
  /**
1363
806
  * Translation function type
1364
807
  */
@@ -1430,130 +873,6 @@ export declare function useEvmWallet(): {
1430
873
  signMessage: (message: string) => Promise<string | null>;
1431
874
  };
1432
875
 
1433
- /**
1434
- * 获取 Quest 详情 Hook
1435
- *
1436
- * @param options Hook 配置(包含从根组件传入的 api 实例)
1437
- * @returns Quest 详情、加载状态、错误信息、重新加载方法
1438
- */
1439
- export declare function useQuestDetail(options: UseQuestDetailOptions): UseQuestDetailReturn;
1440
-
1441
- /**
1442
- * useQuestDetail Hook 参数
1443
- */
1444
- declare interface UseQuestDetailOptions {
1445
- /** Quest API 实例(从根组件传入) */
1446
- api: QuestApi | null;
1447
- /** Campaign ID */
1448
- campaignId: number;
1449
- /** 渠道标识(可选) */
1450
- channel?: string;
1451
- /** KOL 标识(可选) */
1452
- kolHandle?: string;
1453
- /** 邀请码(可选) */
1454
- inviteCode?: string;
1455
- /** Boost ID(可选) */
1456
- boostId?: number;
1457
- /** 是否启用(默认 true) */
1458
- enabled?: boolean;
1459
- }
1460
-
1461
- /**
1462
- * useQuestDetail Hook 返回值
1463
- */
1464
- declare interface UseQuestDetailReturn {
1465
- /** Campaign 详情数据 */
1466
- data: QuestCampaignInfo | null;
1467
- /** 是否加载中 */
1468
- isLoading: boolean;
1469
- /** 错误信息 */
1470
- error: string | null;
1471
- /** 重新加载 */
1472
- refetch: () => void;
1473
- }
1474
-
1475
- /**
1476
- * 获取 Quest 状态信息 Hook
1477
- *
1478
- * @param options Hook 配置(包含从根组件传入的 api 实例)
1479
- * @returns Quest 状态、加载状态、错误信息、重新加载方法
1480
- */
1481
- export declare function useQuestStatus(options: UseQuestStatusOptions): UseQuestStatusReturn;
1482
-
1483
- /**
1484
- * useQuestStatus Hook 参数
1485
- */
1486
- declare interface UseQuestStatusOptions {
1487
- /** Quest API 实例(从根组件传入) */
1488
- api: QuestApi | null;
1489
- /** Campaign ID */
1490
- campaignId: number;
1491
- /** 渠道标识 */
1492
- channel?: string;
1493
- /** KOL 句柄 */
1494
- kolHandle?: string;
1495
- /** 是否启用(默认 true) */
1496
- enabled?: boolean;
1497
- }
1498
-
1499
- /**
1500
- * useQuestStatus Hook 返回值
1501
- */
1502
- declare interface UseQuestStatusReturn {
1503
- /** Campaign 状态数据 */
1504
- data: CampaignStatusInfo | null;
1505
- /** 是否加载中 */
1506
- isLoading: boolean;
1507
- /** 错误信息 */
1508
- error: string | null;
1509
- /** 重新加载 */
1510
- refetch: () => void;
1511
- }
1512
-
1513
- /**
1514
- * 获取用户 Quest 状态 Hook
1515
- *
1516
- * @param options Hook 配置(包含从根组件传入的 api 实例)
1517
- * @returns 用户状态、加载状态、错误信息、重新加载方法
1518
- */
1519
- export declare function useQuestUserStatus(options: UseQuestUserStatusOptions): UseQuestUserStatusReturn;
1520
-
1521
- /**
1522
- * useQuestUserStatus Hook 参数
1523
- */
1524
- declare interface UseQuestUserStatusOptions {
1525
- /** Quest API 实例(从根组件传入) */
1526
- api: QuestApi | null;
1527
- /** Campaign ID */
1528
- campaignId: number;
1529
- /** 渠道标识(可选) */
1530
- channel?: string;
1531
- /** KOL 标识(可选) */
1532
- kolHandle?: string;
1533
- /** 是否启用(默认 true) */
1534
- enabled?: boolean;
1535
- }
1536
-
1537
- /**
1538
- * useQuestUserStatus Hook 返回值
1539
- */
1540
- declare interface UseQuestUserStatusReturn {
1541
- /** 用户状态数据 */
1542
- data: UserCampaignStatusInfo | null;
1543
- /** 是否加载中 */
1544
- isLoading: boolean;
1545
- /** 错误信息 */
1546
- error: string | null;
1547
- /** 重新加载 */
1548
- refetch: () => void;
1549
- /**
1550
- * 立即更新指定任务的本地状态(乐观更新)
1551
- * @param taskId 任务 ID
1552
- * @param isAsync 是否为异步任务(异步任务只更新 is_submitter)
1553
- */
1554
- updateTaskStatus: (taskId: number, isAsync?: boolean) => void;
1555
- }
1556
-
1557
876
  /**
1558
877
  * UserCenterWidget 外层组件
1559
878
  *
@@ -1611,7 +930,15 @@ export { UserInfo }
1611
930
  *
1612
931
  * @example
1613
932
  * ```tsx
1614
- * const { login, logout, userId, isLoggedIn, requestLogin } = useTaskOnAuth();
933
+ * const {
934
+ * login,
935
+ * logout,
936
+ * userId,
937
+ * isLoggedIn,
938
+ * isInitializing,
939
+ * isSessionReady,
940
+ * requestLogin,
941
+ * } = useTaskOnAuth();
1615
942
  *
1616
943
  * // EVM wallet login
1617
944
  * await login({ method: 'evm_wallet', value: '0x...', sign, timestamp });
@@ -1630,6 +957,7 @@ export declare function useTaskOnAuth(): {
1630
957
  userId: number | null;
1631
958
  isLoggedIn: boolean;
1632
959
  isInitializing: boolean;
960
+ isSessionReady: boolean;
1633
961
  login: (params: LoginParams) => Promise<void>;
1634
962
  logout: () => void;
1635
963
  requestLogin: () => void;