@taskon/widget-react 0.0.1-beta.2 → 0.0.1-beta.3

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 (43) hide show
  1. package/README.md +55 -16
  2. package/dist/CommunityTaskList.css +432 -628
  3. package/dist/EligibilityInfo.css +944 -431
  4. package/dist/PageBuilder.css +0 -2
  5. package/dist/Quest.css +460 -505
  6. package/dist/TaskOnProvider.css +15 -15
  7. package/dist/UserCenterWidget.css +0 -174
  8. package/dist/UserCenterWidget2.css +870 -102
  9. package/dist/chunks/{CommunityTaskList-BlH1Wdd5.js → CommunityTaskList-C9mPl_31.js} +913 -826
  10. package/dist/chunks/{EligibilityInfo-C7GZ2G5u.js → EligibilityInfo-DGBffKN8.js} +1137 -449
  11. package/dist/chunks/{LeaderboardWidget-CmYfDeHV.js → LeaderboardWidget-DPOQVXkT.js} +15 -10
  12. package/dist/chunks/{PageBuilder-Bw0zSkFh.js → PageBuilder-WCZvxL2j.js} +5 -5
  13. package/dist/chunks/{Quest-DKFZ-pPU.js → Quest-DjGH_8bx.js} +464 -314
  14. package/dist/chunks/{TaskOnProvider-BD6Vp2x8.js → TaskOnProvider-iannERG1.js} +2 -207
  15. package/dist/chunks/{ThemeProvider-wnSXrNQb.js → ThemeProvider-DNJqI2lD.js} +246 -54
  16. package/dist/chunks/UserCenterWidget-B0O-f_xl.js +8344 -0
  17. package/dist/chunks/{UserCenterWidget-Cw6h_5hT.js → UserCenterWidget-CAhgp46j.js} +204 -1001
  18. package/dist/chunks/{WidgetShell-D_5OjvNZ.js → dynamic-import-helper-B2j_dZ4V.js} +607 -40
  19. package/dist/chunks/useToast-CaRkylKe.js +304 -0
  20. package/dist/chunks/{usercenter-ja-uu-XfVF9.js → usercenter-ja-B2465c1O.js} +4 -10
  21. package/dist/chunks/{usercenter-ko-DYgUOVzd.js → usercenter-ko-xAEYxqLg.js} +4 -10
  22. package/dist/community-task.d.ts +34 -3
  23. package/dist/community-task.js +1 -1
  24. package/dist/core.d.ts +40 -3
  25. package/dist/core.js +9 -10
  26. package/dist/dynamic-import-helper.css +186 -0
  27. package/dist/index.d.ts +207 -10
  28. package/dist/index.js +21 -19
  29. package/dist/leaderboard.d.ts +8 -1
  30. package/dist/leaderboard.js +2 -2
  31. package/dist/page-builder.js +1 -1
  32. package/dist/quest.d.ts +8 -2
  33. package/dist/quest.js +1 -1
  34. package/dist/user-center.d.ts +20 -136
  35. package/dist/user-center.js +19 -236
  36. package/package.json +7 -2
  37. package/dist/TipPopover.css +0 -210
  38. package/dist/WidgetShell.css +0 -182
  39. package/dist/chunks/TipPopover-BrW8jo71.js +0 -2926
  40. package/dist/chunks/UserCenterWidget-BE329iS7.js +0 -3546
  41. package/dist/chunks/dynamic-import-helper-DxEFwm31.js +0 -537
  42. package/dist/chunks/useToast-B-wyO5zL.js +0 -93
  43. package/dist/chunks/useWidgetLocale-JDelxtt8.js +0 -74
package/README.md CHANGED
@@ -93,7 +93,7 @@ const YourApp = () => {
93
93
  <div>
94
94
  {userId && <p>TaskOn User ID: {userId}</p>}
95
95
  {/* Theme configured in TaskOn Dashboard */}
96
- <QuestWidget configId="cfg_abc123" />
96
+ <QuestWidget widgetId={123} />
97
97
  </div>
98
98
  );
99
99
  };
@@ -107,13 +107,13 @@ const YourApp = () => {
107
107
  │ Purpose: Authentication only │
108
108
  │ │
109
109
  │ ┌─ Mode A: Cloud Config ──────────────────────────────┐ │
110
- │ │ <QuestWidget configId="cfg_abc123" /> │ │
110
+ │ │ <QuestWidget widgetId={123} /> │ │
111
111
  │ │ → Theme from TaskOn cloud │ │
112
112
  │ └─────────────────────────────────────────────────────┘ │
113
113
  │ │
114
114
  │ ┌─ Mode B: Local Theme ───────────────────────────────┐ │
115
115
  │ │ <ThemeProvider theme={{ mode: 'dark' }}> │ │
116
- │ │ <QuestWidget /> /* no configId */ │ │
116
+ │ │ <QuestWidget /> /* no widgetId */ │ │
117
117
  │ │ </ThemeProvider> │ │
118
118
  │ └─────────────────────────────────────────────────────┘ │
119
119
  └──────────────────────────────────────────────────────────┘
@@ -123,8 +123,8 @@ const YourApp = () => {
123
123
 
124
124
  | Mode | Theme Source |
125
125
  | --------------------- | ------------------------------------ |
126
- | `configId` provided | Cloud config (ThemeProvider ignored) |
127
- | No `configId` | ThemeProvider or default theme |
126
+ | `widgetId` provided | Cloud config (ThemeProvider ignored) |
127
+ | No `widgetId` | ThemeProvider or default theme |
128
128
 
129
129
  ## Security
130
130
 
@@ -239,7 +239,7 @@ const App = () => {
239
239
  <option value="ko">한국어</option>
240
240
  <option value="ja">日本語</option>
241
241
  </select>
242
- <QuestWidget configId="cfg_abc123" />
242
+ <QuestWidget widgetId={123} />
243
243
  </TaskOnProvider>
244
244
  );
245
245
  };
@@ -268,6 +268,9 @@ interface TaskOnThemeConfig {
268
268
  // Theme mode
269
269
  mode?: "light" | "dark" | "auto"; // default: 'light'
270
270
 
271
+ // Theme mode strategy (mainly for cloud dual mode)
272
+ modeStrategy?: "auto" | "toggle"; // default: 'auto'
273
+
271
274
  // Compact mode
272
275
  compact?: boolean; // default: false
273
276
 
@@ -316,6 +319,8 @@ interface MapToken {
316
319
  colorTextSecondary?: string;
317
320
  colorTextTertiary?: string;
318
321
  colorTextDisabled?: string;
322
+ colorLink?: string;
323
+ colorTextOnPrimary?: string;
319
324
 
320
325
  // Border
321
326
  colorBorder?: string;
@@ -341,6 +346,28 @@ interface MapToken {
341
346
  }
342
347
  ```
343
348
 
349
+ ### themeMode Override
350
+
351
+ SDK can control theme mode per widget using `themeMode`:
352
+
353
+ ```tsx
354
+ <QuestWidget widgetId={123} themeMode="light" />
355
+ <QuestWidget widgetId={123} themeMode="dark" />
356
+ <QuestWidget widgetId={123} themeMode="auto" />
357
+ ```
358
+
359
+ `themeMode` is supported by:
360
+
361
+ - `QuestWidget`
362
+ - `CommunityTaskList`
363
+ - `LeaderboardWidget`
364
+ - `UserCenterWidget`
365
+
366
+ Priority rule:
367
+
368
+ - `themeMode` (widget prop) has the highest priority when provided.
369
+ - Recommended usage: `dual + toggle` in B-end for clearer mode ownership.
370
+
344
371
  ### Token Priority
345
372
 
346
373
  ```
@@ -417,19 +444,23 @@ Use `inherit={false}` for completely independent themes:
417
444
 
418
445
  ### Cloud Configuration
419
446
 
420
- Widgets support cloud configuration via `configId`. Configure in TaskOn Dashboard and load at runtime:
447
+ Widgets support cloud configuration via `widgetId`. Configure in TaskOn Dashboard and load at runtime:
421
448
 
422
449
  ```tsx
423
450
  // Cloud config includes: theme, feature flags, custom texts
424
- <QuestWidget configId="cfg_abc123" />
451
+ <QuestWidget widgetId={123} />
425
452
  ```
426
453
 
427
454
  ### Widget Props
428
455
 
429
456
  ```typescript
430
457
  interface WidgetProps {
431
- // Cloud config ID from TaskOn Dashboard
432
- configId?: string;
458
+ // Cloud widget ID from TaskOn Dashboard
459
+ widgetId?: number;
460
+
461
+ // Manual theme mode override (highest priority when provided)
462
+ // Recommended usage: pair with cloud dual+toggle for clearer ownership
463
+ themeMode?: "light" | "dark" | "auto";
433
464
 
434
465
  // Custom class names for widget parts
435
466
  classNames?: {
@@ -458,7 +489,7 @@ Widgets support fine-grained styling via `classNames` and `styles` props:
458
489
  ```tsx
459
490
  // Using classNames
460
491
  <QuestWidget
461
- configId="cfg_abc123"
492
+ widgetId={123}
462
493
  classNames={{
463
494
  root: 'my-quest-widget',
464
495
  header: 'my-quest-header',
@@ -468,7 +499,7 @@ Widgets support fine-grained styling via `classNames` and `styles` props:
468
499
 
469
500
  // Using inline styles
470
501
  <QuestWidget
471
- configId="cfg_abc123"
502
+ widgetId={123}
472
503
  styles={{
473
504
  root: { maxWidth: 400 },
474
505
  header: { borderBottom: '1px solid #eee' },
@@ -478,7 +509,7 @@ Widgets support fine-grained styling via `classNames` and `styles` props:
478
509
 
479
510
  // Combining both
480
511
  <QuestWidget
481
- configId="cfg_abc123"
512
+ widgetId={123}
482
513
  classNames={{ root: 'custom-widget' }}
483
514
  styles={{ header: { backgroundColor: 'transparent' } }}
484
515
  />
@@ -491,8 +522,8 @@ Each widget documents its available parts in its own API reference.
491
522
  ```tsx
492
523
  // Example 1: Using cloud config (theme from Dashboard)
493
524
  <TaskOnProvider config={{ apiKey: 'your-api-key' }}>
494
- <QuestWidget configId="cfg_abc123" />
495
- <TaskWidget configId="cfg_xyz789" />
525
+ <QuestWidget widgetId={123} />
526
+ <TaskWidget widgetId={456} />
496
527
  </TaskOnProvider>
497
528
 
498
529
  // Example 2: Using local theme (no cloud config)
@@ -517,7 +548,7 @@ Each widget documents its available parts in its own API reference.
517
548
  // Example 4: Mixed - some with cloud config, some with local theme
518
549
  <TaskOnProvider config={{ apiKey: 'your-api-key' }}>
519
550
  {/* Cloud config */}
520
- <QuestWidget configId="cfg_abc123" />
551
+ <QuestWidget widgetId={123} />
521
552
 
522
553
  {/* Local theme */}
523
554
  <ThemeProvider theme={{ mode: 'dark' }}>
@@ -1060,6 +1091,14 @@ Get your WalletConnect Project ID at https://cloud.walletconnect.com
1060
1091
 
1061
1092
  If not configured, the WalletConnect option will be disabled in the wallet binding dialog.
1062
1093
 
1094
+ ## Limitations
1095
+
1096
+ - Quest Widget does not support opening pre-task targets from `CommunityPreTask` eligibility.
1097
+ - In eligibility rows, pre-task names are displayed as plain text (non-clickable).
1098
+ - Community names are hidden for `CommunityPreTask`, `CommunityUserPoints`, and `CommunityUserLevel` rows.
1099
+ - `DiscordRole` keeps original `in {community}` display and uses `server_url` as link when available.
1100
+ - CommunityTask eligibility `CommunityPreTask` supports clicking task names to switch task dialogs.
1101
+
1063
1102
  ## License
1064
1103
 
1065
1104
  MIT