@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
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
  *
@@ -687,41 +214,27 @@ export declare function createLocaleLoader<T>(defaultMessages: T, imports: Local
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
216
  /**
690
- * Rich text translation component.
217
+ * Ethereum Provider Interface (EIP-1193)
691
218
  *
692
- * It first translates text with temporary markers, then replaces markers
693
- * with provided React nodes.
219
+ * Exported for scenarios where caller already owns a specific provider
220
+ * instance (e.g. wallet selection dialog) and needs to build an adapter
221
+ * around it.
694
222
  */
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;
223
+ declare interface EthereumProvider {
224
+ request: (args: {
225
+ method: string;
226
+ params?: unknown[];
227
+ }) => Promise<unknown>;
228
+ on?: (event: string, callback: (...args: unknown[]) => void) => void;
229
+ removeListener?: (event: string, callback: (...args: unknown[]) => void) => void;
230
+ }
696
231
 
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>;
232
+ export declare class EvmWalletSelectionCanceledError extends Error {
233
+ constructor(message?: string);
234
+ }
703
235
 
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;
236
+ export declare class EvmWalletSelectionInProgressError extends Error {
237
+ constructor(message?: string);
725
238
  }
726
239
 
727
240
  /**
@@ -1092,6 +605,19 @@ export declare interface SeedToken {
1092
605
  spacingChangeUnit?: number;
1093
606
  }
1094
607
 
608
+ export declare function selectEvmWallet(options?: SelectEvmWalletOptions): Promise<SelectEvmWalletResult>;
609
+
610
+ export declare interface SelectEvmWalletOptions {
611
+ signal?: AbortSignal;
612
+ }
613
+
614
+ export declare interface SelectEvmWalletResult {
615
+ walletId: string;
616
+ walletName: string;
617
+ address: string;
618
+ provider: EthereumProvider;
619
+ }
620
+
1095
621
  /**
1096
622
  * Locales recognized by the widget i18n runtime.
1097
623
  *
@@ -1114,9 +640,21 @@ export declare interface TaskOnContextValue {
1114
640
  */
1115
641
  client: TaskOnClient | null;
1116
642
  /**
1117
- * Whether the provider is initializing
643
+ * Whether the provider is in full initialization flow.
644
+ *
645
+ * Notes:
646
+ * - Includes session restore and token validation.
647
+ * - When a stored token exists, this stays true until user info validation completes.
1118
648
  */
1119
649
  isInitializing: boolean;
650
+ /**
651
+ * Whether session prerequisites are ready for data requests.
652
+ * True means client is created and auth token has been loaded
653
+ * (or no token exists, anonymous mode).
654
+ *
655
+ * This can become true earlier than `isInitializing === false`.
656
+ */
657
+ isSessionReady: boolean;
1120
658
  /**
1121
659
  * Resolved locale
1122
660
  */
@@ -1161,7 +699,7 @@ export declare interface TaskOnContextValue {
1161
699
  */
1162
700
  chains: ChainInfo[];
1163
701
  /**
1164
- * Community info (auto-loaded on init based on apiKey)
702
+ * Community info (auto-loaded on init based on clientId)
1165
703
  * Used for displaying community logo and name in reward cards
1166
704
  */
1167
705
  communityInfo: CommunityInfo | null;
@@ -1174,7 +712,7 @@ export declare interface TaskOnContextValue {
1174
712
  * - TaskOn client management (based on @taskon/core)
1175
713
  * - User authentication (login/logout)
1176
714
  * - Locale configuration
1177
- * - Wallet management (uses window.ethereum adapter)
715
+ * - Wallet management (host adapter or built-in wallet picker)
1178
716
  * - Widget locale preloading (optional)
1179
717
  * - Toast notifications (internal, user-transparent)
1180
718
  */
@@ -1185,10 +723,10 @@ export declare function TaskOnProvider({ config, children, preloadLocales, }: Ta
1185
723
  */
1186
724
  export declare interface TaskOnProviderConfig {
1187
725
  /**
1188
- * API Key for authentication (X-API-Key header)
1189
- * Note: apiKey already contains community info, no need to configure communityId/communityKey separately
726
+ * Client ID for authentication (X-API-Key header)
727
+ * Note: clientId already contains community info, no need to configure communityId/communityKey separately
1190
728
  */
1191
- apiKey: string;
729
+ clientId: string;
1192
730
  /**
1193
731
  * API base URL (optional)
1194
732
  * @default https://white-label-api.taskon.xyz
@@ -1202,8 +740,8 @@ export declare interface TaskOnProviderConfig {
1202
740
  /**
1203
741
  * Wallet configuration for blockchain interactions
1204
742
  *
1205
- * When not provided, TaskOn will use built-in window.ethereum adapter
1206
- * for EVM wallet connections (MetaMask, etc.)
743
+ * When not provided, TaskOn will use SDK built-in wallet picker adapter
744
+ * for EVM wallet connections.
1207
745
  */
1208
746
  walletConfig?: WalletConfig;
1209
747
  /**
@@ -1216,7 +754,7 @@ export declare interface TaskOnProviderConfig {
1216
754
  * ```tsx
1217
755
  * <TaskOnProvider
1218
756
  * config={{
1219
- * apiKey: 'your-api-key',
757
+ * clientId: 'your-client-id',
1220
758
  * onRequestLogin: () => {
1221
759
  * setShowLoginModal(true);
1222
760
  * },
@@ -1239,10 +777,13 @@ export declare interface TaskOnProviderConfig {
1239
777
  /**
1240
778
  * WalletConnect Project ID
1241
779
  *
1242
- * Required for WalletConnect functionality.
1243
- * Get your project ID at https://cloud.walletconnect.com
780
+ * Only needed when you design Web3 wallet login or wallet-based reward flows.
781
+ * (e.g. wallet binding, on-chain verification, NFT/token claiming)
782
+ *
783
+ * Optional. If not provided, SDK built-in default project ID will be used.
784
+ * For production, it is strongly recommended to set your own project ID.
1244
785
  *
1245
- * If not provided, WalletConnect option will be disabled in the wallet dialog.
786
+ * Get your project ID at https://cloud.walletconnect.com
1246
787
  */
1247
788
  walletConnectProjectId?: string;
1248
789
  }
@@ -1298,67 +839,6 @@ export declare interface TaskOnThemeConfig {
1298
839
  dark?: ModeThemeConfig;
1299
840
  }
1300
841
 
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
842
  /**
1363
843
  * Translation function type
1364
844
  */
@@ -1430,130 +910,6 @@ export declare function useEvmWallet(): {
1430
910
  signMessage: (message: string) => Promise<string | null>;
1431
911
  };
1432
912
 
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
913
  /**
1558
914
  * UserCenterWidget 外层组件
1559
915
  *
@@ -1611,7 +967,15 @@ export { UserInfo }
1611
967
  *
1612
968
  * @example
1613
969
  * ```tsx
1614
- * const { login, logout, userId, isLoggedIn, requestLogin } = useTaskOnAuth();
970
+ * const {
971
+ * login,
972
+ * logout,
973
+ * userId,
974
+ * isLoggedIn,
975
+ * isInitializing,
976
+ * isSessionReady,
977
+ * requestLogin,
978
+ * } = useTaskOnAuth();
1615
979
  *
1616
980
  * // EVM wallet login
1617
981
  * await login({ method: 'evm_wallet', value: '0x...', sign, timestamp });
@@ -1630,6 +994,7 @@ export declare function useTaskOnAuth(): {
1630
994
  userId: number | null;
1631
995
  isLoggedIn: boolean;
1632
996
  isInitializing: boolean;
997
+ isSessionReady: boolean;
1633
998
  login: (params: LoginParams) => Promise<void>;
1634
999
  logout: () => void;
1635
1000
  requestLogin: () => void;
@@ -1869,15 +1234,9 @@ export declare interface WalletAdapter {
1869
1234
  export declare interface WalletConfig {
1870
1235
  /**
1871
1236
  * Custom EVM wallet adapter
1872
- * If not provided, uses built-in window.ethereum adapter
1237
+ * If not provided, uses SDK built-in wallet picker adapter
1873
1238
  */
1874
1239
  evmAdapter?: WalletAdapter;
1875
- /**
1876
- * Disable auto-detection of wallet providers
1877
- * When true, only uses adapter explicitly provided above
1878
- * @default false
1879
- */
1880
- disableAutoDetect?: boolean;
1881
1240
  }
1882
1241
 
1883
1242
  /**
@@ -1889,6 +1248,24 @@ declare interface WalletContextValue extends WalletState {
1889
1248
  signEvmMessage: (message: string) => Promise<string | null>;
1890
1249
  }
1891
1250
 
1251
+ export declare function WalletPickerDialog({ open, onOpenChange, onSelect, onError, }: WalletPickerDialogProps): default_2.ReactElement;
1252
+
1253
+ export declare function WalletPickerDialogHost(): default_2.ReactElement;
1254
+
1255
+ export declare interface WalletPickerDialogProps {
1256
+ open: boolean;
1257
+ onOpenChange: (open: boolean) => void;
1258
+ onSelect?: (selection: WalletPickerSelection) => Promise<void>;
1259
+ onError?: (error: string) => void;
1260
+ }
1261
+
1262
+ export declare interface WalletPickerSelection {
1263
+ walletId: string;
1264
+ walletName: string;
1265
+ address: string;
1266
+ provider: any;
1267
+ }
1268
+
1892
1269
  /**
1893
1270
  * Wallet state exposed through context
1894
1271
  */