@taskon/widget-react 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -64
- package/dist/CommunityTaskList.css +2694 -2951
- package/dist/EligibilityInfo.css +2221 -1332
- package/dist/LeaderboardWidget.css +403 -198
- package/dist/PageBuilder.css +57 -0
- package/dist/Quest.css +1347 -1477
- package/dist/TaskOnProvider.css +337 -29
- package/dist/ThemeProvider.css +228 -0
- package/dist/UserCenterWidget.css +168 -0
- package/dist/UserCenterWidget2.css +4917 -0
- package/dist/WidgetShell.css +417 -130
- package/dist/chunks/{CommunityTaskList-CrH6r4Av.js → CommunityTaskList-2nFy6l6m.js} +2612 -2074
- package/dist/chunks/{EligibilityInfo-DesW9-k9.js → EligibilityInfo-CKTl_cdU.js} +2714 -4077
- package/dist/chunks/{LeaderboardWidget-BSGpHKTk.js → LeaderboardWidget-DyoiiNS6.js} +288 -349
- package/dist/chunks/PageBuilder-DHM3Il6f.js +150 -0
- package/dist/chunks/{Quest-uSIVq78I.js → Quest-Dqx4OCat.js} +1380 -726
- package/dist/chunks/TaskOnProvider-CxtFIs3n.js +2072 -0
- package/dist/chunks/{WidgetShell-NlOgn1x5.js → ThemeProvider-CulHkqqY.js} +1397 -103
- package/dist/chunks/UserCenterWidget-SE5hqpnZ.js +8335 -0
- package/dist/chunks/UserCenterWidget-XL6LZRZM.js +3259 -0
- package/dist/chunks/{Table-CWGf2FKV.js → WidgetShell-8xn-Jivw.js} +237 -27
- package/dist/chunks/communitytask-es-CBNnS4o2.js +521 -0
- package/dist/chunks/communitytask-ja-GRf9cbdx.js +521 -0
- package/dist/chunks/communitytask-ko-Bf24PQKI.js +521 -0
- package/dist/chunks/communitytask-ru-CZm2CPoV.js +521 -0
- package/dist/chunks/leaderboardwidget-es-vKjrjQaz.js +146 -0
- package/dist/chunks/leaderboardwidget-ja-Q6u0HxKG.js +146 -0
- package/dist/chunks/leaderboardwidget-ko-CG6SWgxf.js +146 -0
- package/dist/chunks/leaderboardwidget-ru-DCcHcJGz.js +146 -0
- package/dist/chunks/quest-es-Dyyy0zaw.js +863 -0
- package/dist/chunks/quest-ja-Depog33y.js +863 -0
- package/dist/chunks/quest-ko-BMu3uRQJ.js +863 -0
- package/dist/chunks/quest-ru-xne814Rw.js +863 -0
- package/dist/chunks/taskwidget-es-Do9b3Mqw.js +245 -0
- package/dist/chunks/taskwidget-ja-CqSu-yWA.js +245 -0
- package/dist/chunks/taskwidget-ko-EHgXFV4B.js +245 -0
- package/dist/chunks/taskwidget-ru-CMbLQDK4.js +245 -0
- package/dist/chunks/useIsMobile-D6Ybur-6.js +30 -0
- package/dist/chunks/usercenter-es-Dz3Wp2vV.js +512 -0
- package/dist/chunks/usercenter-ja-CKE4DJC6.js +512 -0
- package/dist/chunks/usercenter-ko-Dtpkn2qb.js +512 -0
- package/dist/chunks/usercenter-ru-DnBGee45.js +512 -0
- package/dist/community-task.d.ts +29 -388
- package/dist/community-task.js +2 -7
- package/dist/core.d.ts +95 -28
- package/dist/core.js +11 -12
- package/dist/index.d.ts +260 -602
- package/dist/index.js +28 -7361
- package/dist/leaderboard.d.ts +5 -496
- package/dist/leaderboard.js +2 -15
- package/dist/page-builder.d.ts +20 -0
- package/dist/page-builder.js +4 -0
- package/dist/quest.d.ts +20 -292
- package/dist/quest.js +2 -5
- package/dist/user-center.d.ts +56 -0
- package/dist/user-center.js +4 -0
- package/package.json +22 -3
- package/dist/Table.css +0 -389
- package/dist/chunks/TaskOnProvider-QMwxGL44.js +0 -1435
- package/dist/chunks/ThemeProvider-Cs8IUVQj.js +0 -1118
- package/dist/chunks/leaderboardwidget-ja-Bj6gz6y1.js +0 -119
- package/dist/chunks/leaderboardwidget-ko-f1cLO9ic.js +0 -119
- package/dist/chunks/useWidgetLocale-BVcopbZS.js +0 -74
- package/dist/chunks/usercenter-ja-DBj_dtuz.js +0 -329
- package/dist/chunks/usercenter-ko-DYTkHAld.js +0 -329
- package/dist/index.css +0 -3662
package/dist/core.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export declare interface CommonMessages {
|
|
|
48
48
|
* const loadMessages = createLocaleLoader(enMessages, {
|
|
49
49
|
* ko: () => import('./locales/ko'),
|
|
50
50
|
* ja: () => import('./locales/ja'),
|
|
51
|
+
* ru: () => import('./locales/ru'),
|
|
52
|
+
* es: () => import('./locales/es'),
|
|
51
53
|
* });
|
|
52
54
|
* ```
|
|
53
55
|
*/
|
|
@@ -137,7 +139,11 @@ export declare type Locale = "en" | "ko" | "ja" | "ru" | "es";
|
|
|
137
139
|
|
|
138
140
|
/**
|
|
139
141
|
* Locale import map type
|
|
140
|
-
* Maps supported locales to their dynamic import functions
|
|
142
|
+
* Maps supported non-English locales to their dynamic import functions.
|
|
143
|
+
*
|
|
144
|
+
* Notes:
|
|
145
|
+
* - Keys are optional so widgets can incrementally adopt locales.
|
|
146
|
+
* - Missing locale imports safely fall back to inlined English messages.
|
|
141
147
|
*/
|
|
142
148
|
export declare type LocaleImportMap<T> = {
|
|
143
149
|
[K in Exclude<SupportedLocale, "en">]?: () => Promise<{
|
|
@@ -178,13 +184,32 @@ export declare interface MapToken {
|
|
|
178
184
|
colorSuccess?: string;
|
|
179
185
|
colorWarning?: string;
|
|
180
186
|
colorError?: string;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
/** Page/canvas base background */
|
|
188
|
+
colorBgCanvas?: string;
|
|
189
|
+
/** Main surface background (cards, panels) */
|
|
190
|
+
colorBgSurface?: string;
|
|
191
|
+
/** Subtle surface background (low-contrast cards) */
|
|
192
|
+
colorBgSurfaceSubtle?: string;
|
|
193
|
+
/** Strong surface background (section headers, tracks) */
|
|
194
|
+
colorBgSurfaceStrong?: string;
|
|
195
|
+
/** Floating layer background (tooltip, dropdown, popover) */
|
|
196
|
+
colorBgFloating?: string;
|
|
197
|
+
/** Overlay mask background */
|
|
198
|
+
colorBgMask?: string;
|
|
199
|
+
/** Inset background (inner slots/containers) */
|
|
200
|
+
colorBgInset?: string;
|
|
201
|
+
colorSuccessBg?: string;
|
|
202
|
+
colorWarningBg?: string;
|
|
203
|
+
colorErrorBg?: string;
|
|
204
|
+
colorSecondaryBg?: string;
|
|
184
205
|
colorText?: string;
|
|
185
206
|
colorTextSecondary?: string;
|
|
186
207
|
colorTextTertiary?: string;
|
|
187
208
|
colorTextDisabled?: string;
|
|
209
|
+
/** Link color */
|
|
210
|
+
colorLink?: string;
|
|
211
|
+
/** Text color on primary background elements (e.g. primary button text) */
|
|
212
|
+
colorTextOnPrimary?: string;
|
|
188
213
|
colorBorder?: string;
|
|
189
214
|
colorBorderSecondary?: string;
|
|
190
215
|
borderRadius?: number;
|
|
@@ -193,6 +218,9 @@ export declare interface MapToken {
|
|
|
193
218
|
fontSize?: number;
|
|
194
219
|
fontSizeSm?: number;
|
|
195
220
|
fontSizeLg?: number;
|
|
221
|
+
fontSizeXl?: number;
|
|
222
|
+
fontSizeXxl?: number;
|
|
223
|
+
fontSizeXxxl?: number;
|
|
196
224
|
spacing?: number;
|
|
197
225
|
spacingXs?: number;
|
|
198
226
|
spacingSm?: number;
|
|
@@ -225,17 +253,32 @@ export declare interface SeedToken {
|
|
|
225
253
|
colorWarning?: string;
|
|
226
254
|
/** Error color */
|
|
227
255
|
colorError?: string;
|
|
256
|
+
/** Link color */
|
|
257
|
+
colorLink?: string;
|
|
258
|
+
/** Base text color */
|
|
259
|
+
colorText?: string;
|
|
260
|
+
/** Text color on primary buttons */
|
|
261
|
+
colorTextOnPrimary?: string;
|
|
262
|
+
/** Base page background color (used to derive background layers) */
|
|
263
|
+
colorBgBase?: string;
|
|
228
264
|
/** Base border radius */
|
|
229
265
|
borderRadius?: number;
|
|
230
266
|
/** Base font size */
|
|
231
267
|
fontSize?: number;
|
|
268
|
+
/** Spacing base step from cloud config */
|
|
269
|
+
spacingBaseStep?: number;
|
|
270
|
+
/** Spacing change unit from cloud config */
|
|
271
|
+
spacingChangeUnit?: number;
|
|
232
272
|
}
|
|
233
273
|
|
|
234
274
|
/**
|
|
235
|
-
* Locales
|
|
236
|
-
*
|
|
275
|
+
* Locales recognized by the widget i18n runtime.
|
|
276
|
+
*
|
|
277
|
+
* Notes:
|
|
278
|
+
* - A widget can choose to provide only part of these locale files.
|
|
279
|
+
* - Missing locale modules still fall back to inlined English messages.
|
|
237
280
|
*/
|
|
238
|
-
export declare type SupportedLocale = "en" | "ko" | "ja";
|
|
281
|
+
export declare type SupportedLocale = "en" | "ko" | "ja" | "ru" | "es";
|
|
239
282
|
|
|
240
283
|
/**
|
|
241
284
|
* TaskOn Context value
|
|
@@ -250,9 +293,21 @@ export declare interface TaskOnContextValue {
|
|
|
250
293
|
*/
|
|
251
294
|
client: TaskOnClient | null;
|
|
252
295
|
/**
|
|
253
|
-
* Whether the provider is
|
|
296
|
+
* Whether the provider is in full initialization flow.
|
|
297
|
+
*
|
|
298
|
+
* Notes:
|
|
299
|
+
* - Includes session restore and token validation.
|
|
300
|
+
* - When a stored token exists, this stays true until user info validation completes.
|
|
254
301
|
*/
|
|
255
302
|
isInitializing: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Whether session prerequisites are ready for data requests.
|
|
305
|
+
* True means client is created and auth token has been loaded
|
|
306
|
+
* (or no token exists, anonymous mode).
|
|
307
|
+
*
|
|
308
|
+
* This can become true earlier than `isInitializing === false`.
|
|
309
|
+
*/
|
|
310
|
+
isSessionReady: boolean;
|
|
256
311
|
/**
|
|
257
312
|
* Resolved locale
|
|
258
313
|
*/
|
|
@@ -297,7 +352,7 @@ export declare interface TaskOnContextValue {
|
|
|
297
352
|
*/
|
|
298
353
|
chains: ChainInfo[];
|
|
299
354
|
/**
|
|
300
|
-
* Community info (auto-loaded on init based on
|
|
355
|
+
* Community info (auto-loaded on init based on clientId)
|
|
301
356
|
* Used for displaying community logo and name in reward cards
|
|
302
357
|
*/
|
|
303
358
|
communityInfo: CommunityInfo | null;
|
|
@@ -310,7 +365,7 @@ export declare interface TaskOnContextValue {
|
|
|
310
365
|
* - TaskOn client management (based on @taskon/core)
|
|
311
366
|
* - User authentication (login/logout)
|
|
312
367
|
* - Locale configuration
|
|
313
|
-
* - Wallet management (
|
|
368
|
+
* - Wallet management (host adapter or built-in wallet picker)
|
|
314
369
|
* - Widget locale preloading (optional)
|
|
315
370
|
* - Toast notifications (internal, user-transparent)
|
|
316
371
|
*/
|
|
@@ -321,10 +376,10 @@ export declare function TaskOnProvider({ config, children, preloadLocales, }: Ta
|
|
|
321
376
|
*/
|
|
322
377
|
export declare interface TaskOnProviderConfig {
|
|
323
378
|
/**
|
|
324
|
-
*
|
|
325
|
-
* Note:
|
|
379
|
+
* Client ID for authentication (X-API-Key header)
|
|
380
|
+
* Note: clientId already contains community info, no need to configure communityId/communityKey separately
|
|
326
381
|
*/
|
|
327
|
-
|
|
382
|
+
clientId: string;
|
|
328
383
|
/**
|
|
329
384
|
* API base URL (optional)
|
|
330
385
|
* @default https://white-label-api.taskon.xyz
|
|
@@ -338,8 +393,8 @@ export declare interface TaskOnProviderConfig {
|
|
|
338
393
|
/**
|
|
339
394
|
* Wallet configuration for blockchain interactions
|
|
340
395
|
*
|
|
341
|
-
* When not provided, TaskOn will use built-in
|
|
342
|
-
* for EVM wallet connections
|
|
396
|
+
* When not provided, TaskOn will use SDK built-in wallet picker adapter
|
|
397
|
+
* for EVM wallet connections.
|
|
343
398
|
*/
|
|
344
399
|
walletConfig?: WalletConfig;
|
|
345
400
|
/**
|
|
@@ -352,7 +407,7 @@ export declare interface TaskOnProviderConfig {
|
|
|
352
407
|
* ```tsx
|
|
353
408
|
* <TaskOnProvider
|
|
354
409
|
* config={{
|
|
355
|
-
*
|
|
410
|
+
* clientId: 'your-client-id',
|
|
356
411
|
* onRequestLogin: () => {
|
|
357
412
|
* setShowLoginModal(true);
|
|
358
413
|
* },
|
|
@@ -375,10 +430,13 @@ export declare interface TaskOnProviderConfig {
|
|
|
375
430
|
/**
|
|
376
431
|
* WalletConnect Project ID
|
|
377
432
|
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
433
|
+
* Only needed when you design Web3 wallet login or wallet-based reward flows.
|
|
434
|
+
* (e.g. wallet binding, on-chain verification, NFT/token claiming)
|
|
435
|
+
*
|
|
436
|
+
* Optional. If not provided, SDK built-in default project ID will be used.
|
|
437
|
+
* For production, it is strongly recommended to set your own project ID.
|
|
380
438
|
*
|
|
381
|
-
*
|
|
439
|
+
* Get your project ID at https://cloud.walletconnect.com
|
|
382
440
|
*/
|
|
383
441
|
walletConnectProjectId?: string;
|
|
384
442
|
}
|
|
@@ -416,6 +474,12 @@ export declare interface TaskOnTheme {
|
|
|
416
474
|
export declare interface TaskOnThemeConfig {
|
|
417
475
|
/** Theme mode */
|
|
418
476
|
mode?: ThemeMode;
|
|
477
|
+
/**
|
|
478
|
+
* Theme mode strategy.
|
|
479
|
+
* - auto: mode selection follows standard mode behavior
|
|
480
|
+
* - toggle: SDK/host controls mode manually (typically used with dual+toggle from cloud config)
|
|
481
|
+
*/
|
|
482
|
+
modeStrategy?: "auto" | "toggle";
|
|
419
483
|
/** Compact mode */
|
|
420
484
|
compact?: boolean;
|
|
421
485
|
/** Seed tokens */
|
|
@@ -506,7 +570,15 @@ export { UserInfo }
|
|
|
506
570
|
*
|
|
507
571
|
* @example
|
|
508
572
|
* ```tsx
|
|
509
|
-
* const {
|
|
573
|
+
* const {
|
|
574
|
+
* login,
|
|
575
|
+
* logout,
|
|
576
|
+
* userId,
|
|
577
|
+
* isLoggedIn,
|
|
578
|
+
* isInitializing,
|
|
579
|
+
* isSessionReady,
|
|
580
|
+
* requestLogin,
|
|
581
|
+
* } = useTaskOnAuth();
|
|
510
582
|
*
|
|
511
583
|
* // EVM wallet login
|
|
512
584
|
* await login({ method: 'evm_wallet', value: '0x...', sign, timestamp });
|
|
@@ -525,6 +597,7 @@ export declare function useTaskOnAuth(): {
|
|
|
525
597
|
userId: number | null;
|
|
526
598
|
isLoggedIn: boolean;
|
|
527
599
|
isInitializing: boolean;
|
|
600
|
+
isSessionReady: boolean;
|
|
528
601
|
login: (params: LoginParams) => Promise<void>;
|
|
529
602
|
logout: () => void;
|
|
530
603
|
requestLogin: () => void;
|
|
@@ -764,15 +837,9 @@ export declare interface WalletAdapter {
|
|
|
764
837
|
export declare interface WalletConfig {
|
|
765
838
|
/**
|
|
766
839
|
* Custom EVM wallet adapter
|
|
767
|
-
* If not provided, uses built-in
|
|
840
|
+
* If not provided, uses SDK built-in wallet picker adapter
|
|
768
841
|
*/
|
|
769
842
|
evmAdapter?: WalletAdapter;
|
|
770
|
-
/**
|
|
771
|
-
* Disable auto-detection of wallet providers
|
|
772
|
-
* When true, only uses adapter explicitly provided above
|
|
773
|
-
* @default false
|
|
774
|
-
*/
|
|
775
|
-
disableAutoDetect?: boolean;
|
|
776
843
|
}
|
|
777
844
|
|
|
778
845
|
/**
|
|
@@ -798,6 +865,6 @@ export declare interface WalletState {
|
|
|
798
865
|
/**
|
|
799
866
|
* Supported widget names for preloading
|
|
800
867
|
*/
|
|
801
|
-
export declare type WidgetName = "CommunityTask";
|
|
868
|
+
export declare type WidgetName = "CommunityTask" | "Quest" | "TaskWidget" | "LeaderboardWidget" | "UserCenterWidget";
|
|
802
869
|
|
|
803
870
|
export { }
|
package/dist/core.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { T, u, a } from "./chunks/ThemeProvider-
|
|
1
|
+
import { T, d, e, f, i, g, u, a, c, b } from "./chunks/ThemeProvider-CulHkqqY.js";
|
|
2
2
|
import { RewardType } from "@taskon/core";
|
|
3
|
-
import { T as T2,
|
|
4
|
-
import { a as
|
|
5
|
-
import { c as c2, i as i2, u as u4 } from "./chunks/useWidgetLocale-BVcopbZS.js";
|
|
3
|
+
import { T as T2, u as u2 } from "./chunks/TaskOnProvider-CxtFIs3n.js";
|
|
4
|
+
import { a as a2, u as u3 } from "./chunks/useToast-BGJhd3BX.js";
|
|
6
5
|
export {
|
|
7
6
|
RewardType,
|
|
8
7
|
T2 as TaskOnProvider,
|
|
9
8
|
T as ThemeProvider,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
d as clearLocaleCache,
|
|
10
|
+
e as createLocaleLoader,
|
|
11
|
+
f as createT,
|
|
13
12
|
i as interpolate,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
g as isSupportedLocale,
|
|
14
|
+
u2 as useCommonLocale,
|
|
15
|
+
a2 as useEvmWallet,
|
|
17
16
|
u as useTaskOnAuth,
|
|
18
17
|
a as useTaskOnTheme,
|
|
19
|
-
|
|
18
|
+
c as useTranslation,
|
|
20
19
|
u3 as useWallet,
|
|
21
|
-
|
|
20
|
+
b as useWidgetLocale
|
|
22
21
|
};
|