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

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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/CommunityTaskList.css +1340 -1292
  3. package/dist/EligibilityInfo.css +512 -332
  4. package/dist/LeaderboardWidget.css +355 -152
  5. package/dist/Quest.css +911 -629
  6. package/dist/TaskOnProvider.css +35 -16
  7. package/dist/UserCenterWidget.css +116 -71
  8. package/dist/UserCenterWidget2.css +1285 -748
  9. package/dist/chunks/{CommunityTaskList-C9mPl_31.js → CommunityTaskList-CrMvOB8w.js} +784 -452
  10. package/dist/chunks/{EligibilityInfo-DGBffKN8.js → EligibilityInfo-Beww12QX.js} +1569 -597
  11. package/dist/chunks/{LeaderboardWidget-DPOQVXkT.js → LeaderboardWidget-DwuSpVl0.js} +2 -2
  12. package/dist/chunks/{PageBuilder-WCZvxL2j.js → PageBuilder-DsX6Tv0N.js} +5 -5
  13. package/dist/chunks/{Quest-DjGH_8bx.js → Quest-CuD2LElS.js} +713 -484
  14. package/dist/chunks/{TaskOnProvider-iannERG1.js → TaskOnProvider-xUeP2Nro.js} +78 -65
  15. package/dist/chunks/{ThemeProvider-DNJqI2lD.js → ThemeProvider-Bt4UZ33y.js} +33 -9
  16. package/dist/chunks/{UserCenterWidget-CAhgp46j.js → UserCenterWidget-CB0hnj-L.js} +69 -31
  17. package/dist/chunks/{UserCenterWidget-B0O-f_xl.js → UserCenterWidget-CvU6K4AC.js} +21 -7
  18. package/dist/chunks/communitytask-es-1zawvXEX.js +311 -0
  19. package/dist/chunks/communitytask-ja-CmW6nP-L.js +311 -0
  20. package/dist/chunks/communitytask-ko-BD0hzQSi.js +311 -0
  21. package/dist/chunks/communitytask-ru-DhySaZL8.js +311 -0
  22. package/dist/chunks/createLocaleLoader-BameiEhU.js +65 -0
  23. package/dist/chunks/{dynamic-import-helper-B2j_dZ4V.js → dynamic-import-helper-WmIF58Sb.js} +1 -1
  24. package/dist/chunks/quest-es-D-b5xcme.js +948 -0
  25. package/dist/chunks/quest-ja-Dxd2vqBF.js +948 -0
  26. package/dist/chunks/quest-ko-CSmRWgK_.js +948 -0
  27. package/dist/chunks/quest-ru-CkEKv1_F.js +948 -0
  28. package/dist/chunks/taskwidget-es-Do9b3Mqw.js +245 -0
  29. package/dist/chunks/taskwidget-ja-CqSu-yWA.js +245 -0
  30. package/dist/chunks/taskwidget-ko-EHgXFV4B.js +245 -0
  31. package/dist/chunks/taskwidget-ru-CMbLQDK4.js +245 -0
  32. package/dist/community-task.js +1 -1
  33. package/dist/core.d.ts +17 -5
  34. package/dist/core.js +8 -7
  35. package/dist/dynamic-import-helper.css +424 -303
  36. package/dist/index.d.ts +56 -5
  37. package/dist/index.js +18 -16
  38. package/dist/leaderboard.js +2 -2
  39. package/dist/page-builder.js +1 -1
  40. package/dist/quest.d.ts +682 -0
  41. package/dist/quest.js +3 -1
  42. package/dist/user-center.d.ts +3 -1
  43. package/dist/user-center.js +5 -5
  44. package/package.json +7 -1
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import { CommunityInfo } from '@taskon/core';
7
7
  import { CommunityTaskInfo } from '@taskon/core';
8
8
  import { ComponentPropsWithoutRef } from 'react';
9
9
  import { default as default_2 } from 'react';
10
+ import { ElementType } from 'react';
10
11
  import { ForwardRefExoticComponent } from 'react';
11
12
  import { GtcUserTaskStatus } from '@taskon/core';
12
13
  import { LeaderboardContentConfig } from '@taskon/core';
@@ -654,6 +655,8 @@ export declare type ConfirmNoticeType = "default" | "success" | "warn";
654
655
  * const loadMessages = createLocaleLoader(enMessages, {
655
656
  * ko: () => import('./locales/ko'),
656
657
  * ja: () => import('./locales/ja'),
658
+ * ru: () => import('./locales/ru'),
659
+ * es: () => import('./locales/es'),
657
660
  * });
658
661
  * ```
659
662
  */
@@ -683,6 +686,44 @@ export declare function createLocaleLoader<T>(defaultMessages: T, imports: Local
683
686
  */
684
687
  export declare function createT<T extends Record<string, string>>(messages: T): <K extends keyof T>(key: K, params?: InterpolationParams) => string;
685
688
 
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
+
686
727
  /**
687
728
  * Interpolate a string with parameters
688
729
  *
@@ -795,7 +836,11 @@ export declare type Locale = "en" | "ko" | "ja" | "ru" | "es";
795
836
 
796
837
  /**
797
838
  * Locale import map type
798
- * Maps supported locales to their dynamic import functions
839
+ * Maps supported non-English locales to their dynamic import functions.
840
+ *
841
+ * Notes:
842
+ * - Keys are optional so widgets can incrementally adopt locales.
843
+ * - Missing locale imports safely fall back to inlined English messages.
799
844
  */
800
845
  export declare type LocaleImportMap<T> = {
801
846
  [K in Exclude<SupportedLocale, "en">]?: () => Promise<{
@@ -870,6 +915,9 @@ export declare interface MapToken {
870
915
  fontSize?: number;
871
916
  fontSizeSm?: number;
872
917
  fontSizeLg?: number;
918
+ fontSizeXl?: number;
919
+ fontSizeXxl?: number;
920
+ fontSizeXxxl?: number;
873
921
  spacing?: number;
874
922
  spacingXs?: number;
875
923
  spacingSm?: number;
@@ -1045,10 +1093,13 @@ export declare interface SeedToken {
1045
1093
  }
1046
1094
 
1047
1095
  /**
1048
- * Locales that have full translation support in all widgets
1049
- * Other locales in the Locale type will fallback to English
1096
+ * Locales recognized by the widget i18n runtime.
1097
+ *
1098
+ * Notes:
1099
+ * - A widget can choose to provide only part of these locale files.
1100
+ * - Missing locale modules still fall back to inlined English messages.
1050
1101
  */
1051
- export declare type SupportedLocale = "en" | "ko" | "ja";
1102
+ export declare type SupportedLocale = "en" | "ko" | "ja" | "ru" | "es";
1052
1103
 
1053
1104
  /**
1054
1105
  * TaskOn Context value
@@ -1852,6 +1903,6 @@ export declare interface WalletState {
1852
1903
  /**
1853
1904
  * Supported widget names for preloading
1854
1905
  */
1855
- export declare type WidgetName = "CommunityTask";
1906
+ export declare type WidgetName = "CommunityTask" | "Quest" | "TaskWidget" | "LeaderboardWidget" | "UserCenterWidget";
1856
1907
 
1857
1908
  export { }
package/dist/index.js CHANGED
@@ -1,20 +1,22 @@
1
- import { B, c } from "./chunks/dynamic-import-helper-B2j_dZ4V.js";
2
- import { T, c as c2, i, u, a, b } from "./chunks/ThemeProvider-DNJqI2lD.js";
3
- import { C, B as B2, a as a2, T as T2 } from "./chunks/CommunityTaskList-C9mPl_31.js";
1
+ import { B, c } from "./chunks/dynamic-import-helper-WmIF58Sb.js";
2
+ import { T, c as c2, i, u, a, b } from "./chunks/ThemeProvider-Bt4UZ33y.js";
3
+ import { C, B as B2, a as a2, T as T2 } from "./chunks/CommunityTaskList-CrMvOB8w.js";
4
4
  import { RewardType } from "@taskon/core";
5
- import { T as T3, c as c3, b as b2, i as i2, a as a3, u as u2 } from "./chunks/TaskOnProvider-iannERG1.js";
6
- import { a as a4, u as u3 } from "./chunks/useToast-CaRkylKe.js";
7
- import { C as C2 } from "./chunks/EligibilityInfo-DGBffKN8.js";
8
- import { L } from "./chunks/LeaderboardWidget-DPOQVXkT.js";
9
- import { Q, Q as Q2, u as u4, b as b3, a as a5 } from "./chunks/Quest-DjGH_8bx.js";
10
- import { U } from "./chunks/UserCenterWidget-CAhgp46j.js";
11
- import { P } from "./chunks/PageBuilder-WCZvxL2j.js";
5
+ import { T as T3, u as u2 } from "./chunks/TaskOnProvider-xUeP2Nro.js";
6
+ import { a as a3, u as u3 } from "./chunks/useToast-CaRkylKe.js";
7
+ import { c as c3, a as a4, i as i2, u as u4 } from "./chunks/createLocaleLoader-BameiEhU.js";
8
+ import { C as C2, I } from "./chunks/EligibilityInfo-Beww12QX.js";
9
+ import { L } from "./chunks/LeaderboardWidget-DwuSpVl0.js";
10
+ import { Q, Q as Q2, u as u5, b as b2, a as a5 } from "./chunks/Quest-CuD2LElS.js";
11
+ import { U } from "./chunks/UserCenterWidget-CB0hnj-L.js";
12
+ import { P } from "./chunks/PageBuilder-DsX6Tv0N.js";
12
13
  export {
13
14
  B as Button,
14
15
  C as CardSelector,
15
16
  B2 as CommunityTask,
16
17
  a2 as CommunityTaskList,
17
18
  C2 as ConfirmNoticeDialog,
19
+ I as I18nT,
18
20
  L as LeaderboardWidget,
19
21
  P as PageBuilder,
20
22
  Q as Quest,
@@ -27,17 +29,17 @@ export {
27
29
  c2 as clearLocaleCache,
28
30
  c as cloudThemeToReactTheme,
29
31
  c3 as createLocaleLoader,
30
- b2 as createT,
32
+ a4 as createT,
31
33
  i2 as interpolate,
32
34
  i as isSupportedLocale,
33
- a3 as useCommonLocale,
34
- a4 as useEvmWallet,
35
- u4 as useQuestDetail,
36
- b3 as useQuestStatus,
35
+ u2 as useCommonLocale,
36
+ a3 as useEvmWallet,
37
+ u5 as useQuestDetail,
38
+ b2 as useQuestStatus,
37
39
  a5 as useQuestUserStatus,
38
40
  u as useTaskOnAuth,
39
41
  a as useTaskOnTheme,
40
- u2 as useTranslation,
42
+ u4 as useTranslation,
41
43
  u3 as useWallet,
42
44
  b as useWidgetLocale
43
45
  };
@@ -1,5 +1,5 @@
1
- import { c, e, d, b, L, R, f, U, a, u } from "./chunks/LeaderboardWidget-DPOQVXkT.js";
2
- import { u as u2 } from "./chunks/dynamic-import-helper-B2j_dZ4V.js";
1
+ import { c, e, d, b, L, R, f, U, a, u } from "./chunks/LeaderboardWidget-DwuSpVl0.js";
2
+ import { u as u2 } from "./chunks/dynamic-import-helper-WmIF58Sb.js";
3
3
  import { isAllTimeResponse, isCampaignResponse } from "@taskon/core";
4
4
  export {
5
5
  c as LeaderboardHeader,
@@ -1,4 +1,4 @@
1
- import { P } from "./chunks/PageBuilder-WCZvxL2j.js";
1
+ import { P } from "./chunks/PageBuilder-DsX6Tv0N.js";
2
2
  export {
3
3
  P as PageBuilder
4
4
  };