@academy-sdk/sdk 0.1.1 → 0.2.1
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/dist/academy-sdk-sdk-v1.0.0.zip +0 -0
- package/dist/bundle.js +70 -0
- package/dist/manifest.json +5 -0
- package/dist/styles.css +3307 -0
- package/package.json +41 -46
- package/src/components/atoms/Avatar.tsx +38 -0
- package/src/components/atoms/Badge.tsx +32 -0
- package/src/components/atoms/Button.tsx +48 -0
- package/src/components/atoms/Card.tsx +33 -0
- package/src/components/atoms/Input.tsx +39 -0
- package/src/components/atoms/ProgressBar.tsx +52 -0
- package/src/components/atoms/Tabs.tsx +47 -0
- package/{dist/components/atoms/index.d.ts → src/components/atoms/index.ts} +0 -1
- package/{dist/components/index.d.ts → src/components/index.ts} +7 -1
- package/src/components/molecules/CourseCard.tsx +215 -0
- package/src/components/molecules/EmptyState.tsx +23 -0
- package/src/components/molecules/LoadingSpinner.tsx +27 -0
- package/src/components/molecules/PageHeader.tsx +22 -0
- package/src/components/molecules/Pagination.tsx +82 -0
- package/src/components/molecules/SearchInput.tsx +35 -0
- package/{dist/components/molecules/index.d.ts → src/components/molecules/index.ts} +0 -1
- package/src/components/organisms/CourseSidebar.tsx +276 -0
- package/src/components/organisms/LearnerNavbar.tsx +129 -0
- package/src/components/organisms/LearnerSidebar.tsx +148 -0
- package/src/components/organisms/LessonBookmarks.tsx +128 -0
- package/src/components/organisms/LessonNotes.tsx +153 -0
- package/{dist/components/organisms/index.d.ts → src/components/organisms/index.ts} +0 -1
- package/src/components/pages/BundleDetailPage.tsx +388 -0
- package/src/components/pages/CatalogBundlesPage.tsx +96 -0
- package/src/components/pages/CatalogCoursesPage.tsx +299 -0
- package/src/components/pages/CourseDetailPage.tsx +582 -0
- package/src/components/pages/CoursePlayerPage.tsx +481 -0
- package/src/components/pages/CreatorProfilePage.tsx +161 -0
- package/src/components/pages/LearnerSettingsPage.tsx +58 -0
- package/src/components/pages/ManualReviewDetailPage.tsx +254 -0
- package/src/components/pages/ManualReviewPage.tsx +228 -0
- package/src/components/pages/MessagesPage.tsx +285 -0
- package/src/components/pages/MyLearningPage.tsx +239 -0
- package/src/components/pages/PaymentCancelPage.tsx +74 -0
- package/src/components/pages/PaymentSuccessPage.tsx +73 -0
- package/{dist/components/pages/index.d.ts → src/components/pages/index.ts} +0 -1
- package/src/components/utils.ts +6 -0
- package/src/contracts/components.contract.ts +89 -0
- package/{dist/contracts/index.d.ts → src/contracts/index.ts} +0 -1
- package/src/contracts/layout.contract.ts +36 -0
- package/src/contracts/pages.contract.ts +275 -0
- package/src/contracts/template.contract.ts +100 -0
- package/src/default-template.tsx +52 -0
- package/{dist/hooks/index.d.ts → src/hooks/index.ts} +15 -1
- package/src/hooks/sdk-context.tsx +152 -0
- package/src/hooks/useAiCoach.ts +27 -0
- package/src/hooks/useBookmarks.ts +35 -0
- package/{dist/hooks/useCourseSearch.d.ts → src/hooks/useCourseSearch.ts} +8 -5
- package/{dist/hooks/useDebounce.d.ts → src/hooks/useDebounce.ts} +8 -2
- package/{dist/hooks/useMyBundles.d.ts → src/hooks/useMyBundles.ts} +8 -6
- package/{dist/hooks/useMyCourses.d.ts → src/hooks/useMyCourses.ts} +8 -6
- package/src/hooks/useNotes.ts +35 -0
- package/src/hooks/useNotifications.ts +16 -0
- package/{dist/hooks/useTheme.d.ts → src/hooks/useTheme.ts} +8 -5
- package/src/hooks/useToast.ts +17 -0
- package/{dist/hooks/useUser.d.ts → src/hooks/useUser.ts} +13 -9
- package/src/index.ts +33 -0
- package/src/layouts/DefaultLayout.tsx +58 -0
- package/src/manifest.json +5 -0
- package/src/styles.css +43 -0
- package/src/types/ai-coach.ts +25 -0
- package/src/types/bookmarks.ts +20 -0
- package/src/types/bundle.ts +119 -0
- package/src/types/common.ts +24 -0
- package/src/types/course.ts +135 -0
- package/src/types/enrollment.ts +35 -0
- package/{dist/types/index.d.ts → src/types/index.ts} +0 -1
- package/src/types/lesson.ts +106 -0
- package/src/types/manual-review.ts +116 -0
- package/src/types/messaging.ts +109 -0
- package/src/types/notification.ts +30 -0
- package/src/types/payment.ts +40 -0
- package/src/types/progress.ts +19 -0
- package/src/types/rating.ts +20 -0
- package/src/types/search.ts +31 -0
- package/src/types/user.ts +16 -0
- package/src/utils/formatters.ts +74 -0
- package/src/utils/index.ts +8 -0
- package/dist/components/atoms/Avatar.d.ts +0 -9
- package/dist/components/atoms/Avatar.d.ts.map +0 -1
- package/dist/components/atoms/Badge.d.ts +0 -10
- package/dist/components/atoms/Badge.d.ts.map +0 -1
- package/dist/components/atoms/Button.d.ts +0 -11
- package/dist/components/atoms/Button.d.ts.map +0 -1
- package/dist/components/atoms/Card.d.ts +0 -11
- package/dist/components/atoms/Card.d.ts.map +0 -1
- package/dist/components/atoms/Input.d.ts +0 -7
- package/dist/components/atoms/Input.d.ts.map +0 -1
- package/dist/components/atoms/ProgressBar.d.ts +0 -11
- package/dist/components/atoms/ProgressBar.d.ts.map +0 -1
- package/dist/components/atoms/Tabs.d.ts +0 -16
- package/dist/components/atoms/Tabs.d.ts.map +0 -1
- package/dist/components/atoms/index.cjs +0 -318
- package/dist/components/atoms/index.d.ts.map +0 -1
- package/dist/components/atoms/index.js +0 -288
- package/dist/components/index.cjs +0 -1275
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -1245
- package/dist/components/molecules/CourseCard.d.ts +0 -25
- package/dist/components/molecules/CourseCard.d.ts.map +0 -1
- package/dist/components/molecules/EmptyState.d.ts +0 -10
- package/dist/components/molecules/EmptyState.d.ts.map +0 -1
- package/dist/components/molecules/LoadingSpinner.d.ts +0 -7
- package/dist/components/molecules/LoadingSpinner.d.ts.map +0 -1
- package/dist/components/molecules/PageHeader.d.ts +0 -8
- package/dist/components/molecules/PageHeader.d.ts.map +0 -1
- package/dist/components/molecules/Pagination.d.ts +0 -13
- package/dist/components/molecules/Pagination.d.ts.map +0 -1
- package/dist/components/molecules/SearchInput.d.ts +0 -8
- package/dist/components/molecules/SearchInput.d.ts.map +0 -1
- package/dist/components/molecules/index.cjs +0 -334
- package/dist/components/molecules/index.d.ts.map +0 -1
- package/dist/components/molecules/index.js +0 -311
- package/dist/components/organisms/CourseSidebar.d.ts +0 -37
- package/dist/components/organisms/CourseSidebar.d.ts.map +0 -1
- package/dist/components/organisms/LearnerNavbar.d.ts +0 -8
- package/dist/components/organisms/LearnerNavbar.d.ts.map +0 -1
- package/dist/components/organisms/LearnerSidebar.d.ts +0 -16
- package/dist/components/organisms/LearnerSidebar.d.ts.map +0 -1
- package/dist/components/organisms/LessonBookmarks.d.ts +0 -8
- package/dist/components/organisms/LessonBookmarks.d.ts.map +0 -1
- package/dist/components/organisms/LessonNotes.d.ts +0 -8
- package/dist/components/organisms/LessonNotes.d.ts.map +0 -1
- package/dist/components/organisms/index.cjs +0 -855
- package/dist/components/organisms/index.d.ts.map +0 -1
- package/dist/components/organisms/index.js +0 -825
- package/dist/components/pages/BundleDetailPage.d.ts +0 -3
- package/dist/components/pages/BundleDetailPage.d.ts.map +0 -1
- package/dist/components/pages/CatalogBundlesPage.d.ts +0 -3
- package/dist/components/pages/CatalogBundlesPage.d.ts.map +0 -1
- package/dist/components/pages/CatalogCoursesPage.d.ts +0 -3
- package/dist/components/pages/CatalogCoursesPage.d.ts.map +0 -1
- package/dist/components/pages/CourseDetailPage.d.ts +0 -3
- package/dist/components/pages/CourseDetailPage.d.ts.map +0 -1
- package/dist/components/pages/CoursePlayerPage.d.ts +0 -8
- package/dist/components/pages/CoursePlayerPage.d.ts.map +0 -1
- package/dist/components/pages/CreatorProfilePage.d.ts +0 -3
- package/dist/components/pages/CreatorProfilePage.d.ts.map +0 -1
- package/dist/components/pages/LearnerSettingsPage.d.ts +0 -3
- package/dist/components/pages/LearnerSettingsPage.d.ts.map +0 -1
- package/dist/components/pages/ManualReviewDetailPage.d.ts +0 -3
- package/dist/components/pages/ManualReviewDetailPage.d.ts.map +0 -1
- package/dist/components/pages/ManualReviewPage.d.ts +0 -3
- package/dist/components/pages/ManualReviewPage.d.ts.map +0 -1
- package/dist/components/pages/MessagesPage.d.ts +0 -3
- package/dist/components/pages/MessagesPage.d.ts.map +0 -1
- package/dist/components/pages/MyLearningPage.d.ts +0 -3
- package/dist/components/pages/MyLearningPage.d.ts.map +0 -1
- package/dist/components/pages/PaymentCancelPage.d.ts +0 -3
- package/dist/components/pages/PaymentCancelPage.d.ts.map +0 -1
- package/dist/components/pages/PaymentSuccessPage.d.ts +0 -3
- package/dist/components/pages/PaymentSuccessPage.d.ts.map +0 -1
- package/dist/components/pages/index.cjs +0 -3306
- package/dist/components/pages/index.d.ts.map +0 -1
- package/dist/components/pages/index.js +0 -3315
- package/dist/components/utils.d.ts +0 -3
- package/dist/components/utils.d.ts.map +0 -1
- package/dist/contracts/components.contract.d.ts +0 -87
- package/dist/contracts/components.contract.d.ts.map +0 -1
- package/dist/contracts/index.cjs +0 -52
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js +0 -29
- package/dist/contracts/layout.contract.d.ts +0 -35
- package/dist/contracts/layout.contract.d.ts.map +0 -1
- package/dist/contracts/pages.contract.d.ts +0 -192
- package/dist/contracts/pages.contract.d.ts.map +0 -1
- package/dist/contracts/template.contract.d.ts +0 -49
- package/dist/contracts/template.contract.d.ts.map +0 -1
- package/dist/hooks/index.cjs +0 -165
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -142
- package/dist/hooks/sdk-context.d.ts +0 -125
- package/dist/hooks/sdk-context.d.ts.map +0 -1
- package/dist/hooks/useAiCoach.d.ts +0 -32
- package/dist/hooks/useAiCoach.d.ts.map +0 -1
- package/dist/hooks/useBookmarks.d.ts +0 -31
- package/dist/hooks/useBookmarks.d.ts.map +0 -1
- package/dist/hooks/useCourseSearch.d.ts.map +0 -1
- package/dist/hooks/useDebounce.d.ts.map +0 -1
- package/dist/hooks/useMyBundles.d.ts.map +0 -1
- package/dist/hooks/useMyCourses.d.ts.map +0 -1
- package/dist/hooks/useNotes.d.ts +0 -31
- package/dist/hooks/useNotes.d.ts.map +0 -1
- package/dist/hooks/useNotifications.d.ts +0 -19
- package/dist/hooks/useNotifications.d.ts.map +0 -1
- package/dist/hooks/useTheme.d.ts.map +0 -1
- package/dist/hooks/useToast.d.ts +0 -17
- package/dist/hooks/useToast.d.ts.map +0 -1
- package/dist/hooks/useUser.d.ts.map +0 -1
- package/dist/index.cjs +0 -630
- package/dist/index.d.ts +0 -17
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -600
- package/dist/layouts/DefaultLayout.d.ts +0 -9
- package/dist/layouts/DefaultLayout.d.ts.map +0 -1
- package/dist/types/ai-coach.d.ts +0 -22
- package/dist/types/ai-coach.d.ts.map +0 -1
- package/dist/types/bookmarks.d.ts +0 -19
- package/dist/types/bookmarks.d.ts.map +0 -1
- package/dist/types/bundle.d.ts +0 -114
- package/dist/types/bundle.d.ts.map +0 -1
- package/dist/types/common.d.ts +0 -23
- package/dist/types/common.d.ts.map +0 -1
- package/dist/types/course.d.ts +0 -127
- package/dist/types/course.d.ts.map +0 -1
- package/dist/types/enrollment.d.ts +0 -34
- package/dist/types/enrollment.d.ts.map +0 -1
- package/dist/types/index.cjs +0 -18
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -0
- package/dist/types/lesson.d.ts +0 -105
- package/dist/types/lesson.d.ts.map +0 -1
- package/dist/types/manual-review.d.ts +0 -123
- package/dist/types/manual-review.d.ts.map +0 -1
- package/dist/types/messaging.d.ts +0 -101
- package/dist/types/messaging.d.ts.map +0 -1
- package/dist/types/notification.d.ts +0 -28
- package/dist/types/notification.d.ts.map +0 -1
- package/dist/types/payment.d.ts +0 -38
- package/dist/types/payment.d.ts.map +0 -1
- package/dist/types/progress.d.ts +0 -18
- package/dist/types/progress.d.ts.map +0 -1
- package/dist/types/rating.d.ts +0 -20
- package/dist/types/rating.d.ts.map +0 -1
- package/dist/types/search.d.ts +0 -28
- package/dist/types/search.d.ts.map +0 -1
- package/dist/types/user.d.ts +0 -15
- package/dist/types/user.d.ts.map +0 -1
- package/dist/utils/formatters.d.ts +0 -25
- package/dist/utils/formatters.d.ts.map +0 -1
- package/dist/utils/index.cjs +0 -80
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -57
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export interface MessageParticipant {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
email: string;
|
|
5
|
-
avatar?: string;
|
|
6
|
-
role: 'CREATOR' | 'STUDENT';
|
|
7
|
-
}
|
|
8
|
-
export interface Message {
|
|
9
|
-
id: string;
|
|
10
|
-
conversationId: string;
|
|
11
|
-
senderId: string;
|
|
12
|
-
senderName: string;
|
|
13
|
-
senderRole: 'CREATOR' | 'STUDENT';
|
|
14
|
-
content: string;
|
|
15
|
-
timestamp: string;
|
|
16
|
-
isRead: boolean;
|
|
17
|
-
isDeletedForMe: boolean;
|
|
18
|
-
courseContext?: {
|
|
19
|
-
courseId: string;
|
|
20
|
-
courseName: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface Conversation {
|
|
24
|
-
id: string;
|
|
25
|
-
participant: MessageParticipant;
|
|
26
|
-
lastMessage: {
|
|
27
|
-
content: string;
|
|
28
|
-
timestamp: string;
|
|
29
|
-
senderId: string;
|
|
30
|
-
};
|
|
31
|
-
unreadCount: number;
|
|
32
|
-
isArchived: boolean;
|
|
33
|
-
courseContext?: {
|
|
34
|
-
courseId: string;
|
|
35
|
-
courseName: string;
|
|
36
|
-
moduleName?: string;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export interface ConversationMessageItem {
|
|
40
|
-
id: string;
|
|
41
|
-
senderRole: string;
|
|
42
|
-
content: string;
|
|
43
|
-
isRead: boolean;
|
|
44
|
-
timestamp: string;
|
|
45
|
-
context_label?: string;
|
|
46
|
-
}
|
|
47
|
-
export interface StudentConversationItem {
|
|
48
|
-
conversationId: string;
|
|
49
|
-
creatorName: string;
|
|
50
|
-
creatorEmail: string;
|
|
51
|
-
creatorId: string;
|
|
52
|
-
courseId: string;
|
|
53
|
-
courseTitle: string;
|
|
54
|
-
lastMessageAt: string;
|
|
55
|
-
unreadCount: number;
|
|
56
|
-
msgs?: ConversationMessageItem[];
|
|
57
|
-
}
|
|
58
|
-
export interface StudentConversationsResponse {
|
|
59
|
-
data: StudentConversationItem[];
|
|
60
|
-
meta: {
|
|
61
|
-
page: number;
|
|
62
|
-
limit: number;
|
|
63
|
-
total: number;
|
|
64
|
-
totalPages: number;
|
|
65
|
-
hasNextPage: boolean;
|
|
66
|
-
hasPreviousPage: boolean;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export interface SendCourseMessagePayload {
|
|
70
|
-
content: string;
|
|
71
|
-
conversationId?: string;
|
|
72
|
-
}
|
|
73
|
-
export interface SendCourseMessageResponse {
|
|
74
|
-
conversation: {
|
|
75
|
-
id: string;
|
|
76
|
-
studentId: string;
|
|
77
|
-
creatorId: string;
|
|
78
|
-
courseId: string;
|
|
79
|
-
lastMessageId: string;
|
|
80
|
-
lastMessageAt: string;
|
|
81
|
-
};
|
|
82
|
-
message: {
|
|
83
|
-
id: string;
|
|
84
|
-
conversationId: string;
|
|
85
|
-
senderId: string;
|
|
86
|
-
senderRole: 'CREATOR' | 'STUDENT';
|
|
87
|
-
content: string;
|
|
88
|
-
createdAt: string;
|
|
89
|
-
isRead: boolean;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
export interface UnmessagedCourse {
|
|
93
|
-
id: string;
|
|
94
|
-
title: string;
|
|
95
|
-
creatorId: string;
|
|
96
|
-
}
|
|
97
|
-
export interface UnmessagedCoursesResponse {
|
|
98
|
-
data: UnmessagedCourse[];
|
|
99
|
-
total: number;
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=messaging.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/types/messaging.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAChC,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,OAAO,CAAC;QACrB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;QAClC,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type NotificationType = 'NEW_MESSAGE';
|
|
2
|
-
export type NotificationSenderRole = 'STUDENT' | 'CREATOR';
|
|
3
|
-
export interface NotificationSender {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
userRole: NotificationSenderRole;
|
|
7
|
-
}
|
|
8
|
-
export interface MessageNotification {
|
|
9
|
-
id: string;
|
|
10
|
-
type: NotificationType;
|
|
11
|
-
conversationId: string;
|
|
12
|
-
messageId: string;
|
|
13
|
-
senderId?: string;
|
|
14
|
-
contextLabel: string;
|
|
15
|
-
messageContent?: string;
|
|
16
|
-
readAt?: string | null;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
sender?: NotificationSender;
|
|
19
|
-
}
|
|
20
|
-
export interface NotificationListMeta {
|
|
21
|
-
page: number;
|
|
22
|
-
limit: number;
|
|
23
|
-
total: number;
|
|
24
|
-
totalPages: number;
|
|
25
|
-
hasNextPage: boolean;
|
|
26
|
-
hasPreviousPage: boolean;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/types/notification.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC7C,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,sBAAsB,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B"}
|
package/dist/types/payment.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface PaymentProvider {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
type: string;
|
|
5
|
-
isActive: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface CheckoutConfig {
|
|
8
|
-
courseId?: string;
|
|
9
|
-
bundleId?: string;
|
|
10
|
-
paymentMode: 'ONE_TIME' | 'INSTALLMENT' | 'SUBSCRIPTION';
|
|
11
|
-
successUrl: string;
|
|
12
|
-
cancelUrl: string;
|
|
13
|
-
couponCode?: string;
|
|
14
|
-
paymentProvider?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface Coupon {
|
|
17
|
-
id: string;
|
|
18
|
-
code: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
discountType: 'FIXED' | 'PERCENTAGE';
|
|
21
|
-
discountValue: number;
|
|
22
|
-
maxDiscountAmount?: number;
|
|
23
|
-
minimumPurchase?: number;
|
|
24
|
-
currency?: string;
|
|
25
|
-
courseId?: string;
|
|
26
|
-
bundleId?: string;
|
|
27
|
-
status: 'SCHEDULED' | 'ACTIVE' | 'EXPIRED' | 'EXHAUSTED' | 'DISABLED';
|
|
28
|
-
isActive: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface ValidateCouponResponse {
|
|
31
|
-
valid: boolean;
|
|
32
|
-
coupon?: Coupon;
|
|
33
|
-
message?: string;
|
|
34
|
-
originalAmount?: number;
|
|
35
|
-
discountAmount?: number;
|
|
36
|
-
finalAmount?: number;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=payment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../src/types/payment.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,UAAU,GAAG,aAAa,GAAG,cAAc,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,GAAG,YAAY,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IACtE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/types/progress.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface CreateProgressPayload {
|
|
2
|
-
enrollmentId: string;
|
|
3
|
-
activityId: string;
|
|
4
|
-
}
|
|
5
|
-
export interface UpdateProgressPayload {
|
|
6
|
-
progressSecond: number;
|
|
7
|
-
completed?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface ProgressResponse {
|
|
10
|
-
progressId: string;
|
|
11
|
-
enrollmentId: string;
|
|
12
|
-
activityId: string;
|
|
13
|
-
progressSecond: number;
|
|
14
|
-
completed: boolean;
|
|
15
|
-
createdAt: string;
|
|
16
|
-
updatedAt: string;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/types/progress.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/types/rating.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface Rating {
|
|
2
|
-
id: string;
|
|
3
|
-
userName: string;
|
|
4
|
-
userAvatar?: string;
|
|
5
|
-
rating: number;
|
|
6
|
-
comment: string;
|
|
7
|
-
date: string;
|
|
8
|
-
}
|
|
9
|
-
export interface RatingSummary {
|
|
10
|
-
averageRating: number;
|
|
11
|
-
totalRatings: number;
|
|
12
|
-
starDistribution: {
|
|
13
|
-
5: number;
|
|
14
|
-
4: number;
|
|
15
|
-
3: number;
|
|
16
|
-
2: number;
|
|
17
|
-
1: number;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=rating.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../../src/types/rating.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE;QAChB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH"}
|
package/dist/types/search.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export interface SearchHighlight {
|
|
2
|
-
title?: string;
|
|
3
|
-
}
|
|
4
|
-
export interface SearchActivity {
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
highlight?: SearchHighlight;
|
|
8
|
-
}
|
|
9
|
-
export interface SearchSection {
|
|
10
|
-
id: string;
|
|
11
|
-
title: string;
|
|
12
|
-
highlight?: SearchHighlight;
|
|
13
|
-
activities?: SearchActivity[];
|
|
14
|
-
}
|
|
15
|
-
export interface SearchCourse {
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
enrollmentId: string;
|
|
19
|
-
highlight?: SearchHighlight;
|
|
20
|
-
sections: SearchSection[];
|
|
21
|
-
}
|
|
22
|
-
export interface SearchResponse {
|
|
23
|
-
page: number;
|
|
24
|
-
limit: number;
|
|
25
|
-
total: number;
|
|
26
|
-
data: SearchCourse[];
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/types/search.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB"}
|
package/dist/types/user.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type UserRole = 'CREATOR' | 'ADMIN' | 'STUDENT' | 'PLATFORM_ADMIN';
|
|
2
|
-
export interface User {
|
|
3
|
-
id: string;
|
|
4
|
-
email: string;
|
|
5
|
-
name: string;
|
|
6
|
-
userRole: UserRole;
|
|
7
|
-
profileImage?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface Membership {
|
|
10
|
-
tenantId: string;
|
|
11
|
-
tenantName: string;
|
|
12
|
-
tenantSlug: string;
|
|
13
|
-
role: UserRole;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=user.d.ts.map
|
package/dist/types/user.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAE1E,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;CAChB"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Format seconds into MM:SS or HH:MM:SS string.
|
|
3
|
-
*/
|
|
4
|
-
export declare function formatDuration(seconds: number): string;
|
|
5
|
-
/**
|
|
6
|
-
* Format a price with currency symbol.
|
|
7
|
-
*/
|
|
8
|
-
export declare function formatPrice(amount: number, currency?: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Format a date string to a human-readable format.
|
|
11
|
-
*/
|
|
12
|
-
export declare function formatDate(dateString: string, options?: Intl.DateTimeFormatOptions): string;
|
|
13
|
-
/**
|
|
14
|
-
* Format a relative time (e.g., "2 hours ago").
|
|
15
|
-
*/
|
|
16
|
-
export declare function formatRelativeTime(dateString: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Calculate progress percentage.
|
|
19
|
-
*/
|
|
20
|
-
export declare function calculateProgress(completed: number, total: number): number;
|
|
21
|
-
/**
|
|
22
|
-
* Truncate text to a max length.
|
|
23
|
-
*/
|
|
24
|
-
export declare function truncateText(text: string, maxLength: number): string;
|
|
25
|
-
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWtD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAc,GAAG,MAAM,CAO5E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAO3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAc7D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG1E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAGpE"}
|
package/dist/utils/index.cjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/utils/index.ts
|
|
21
|
-
var utils_exports = {};
|
|
22
|
-
__export(utils_exports, {
|
|
23
|
-
calculateProgress: () => calculateProgress,
|
|
24
|
-
formatDate: () => formatDate,
|
|
25
|
-
formatDuration: () => formatDuration,
|
|
26
|
-
formatPrice: () => formatPrice,
|
|
27
|
-
formatRelativeTime: () => formatRelativeTime,
|
|
28
|
-
truncateText: () => truncateText
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(utils_exports);
|
|
31
|
-
|
|
32
|
-
// src/utils/formatters.ts
|
|
33
|
-
function formatDuration(seconds) {
|
|
34
|
-
if (!seconds || seconds < 0) return "0:00";
|
|
35
|
-
const hours = Math.floor(seconds / 3600);
|
|
36
|
-
const minutes = Math.floor(seconds % 3600 / 60);
|
|
37
|
-
const secs = Math.floor(seconds % 60);
|
|
38
|
-
if (hours > 0) {
|
|
39
|
-
return `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
40
|
-
}
|
|
41
|
-
return `${minutes}:${secs.toString().padStart(2, "0")}`;
|
|
42
|
-
}
|
|
43
|
-
function formatPrice(amount, currency = "USD") {
|
|
44
|
-
return new Intl.NumberFormat("en-US", {
|
|
45
|
-
style: "currency",
|
|
46
|
-
currency,
|
|
47
|
-
minimumFractionDigits: 0,
|
|
48
|
-
maximumFractionDigits: 2
|
|
49
|
-
}).format(amount);
|
|
50
|
-
}
|
|
51
|
-
function formatDate(dateString, options) {
|
|
52
|
-
const date = new Date(dateString);
|
|
53
|
-
return date.toLocaleDateString("en-US", options != null ? options : {
|
|
54
|
-
year: "numeric",
|
|
55
|
-
month: "short",
|
|
56
|
-
day: "numeric"
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function formatRelativeTime(dateString) {
|
|
60
|
-
const date = new Date(dateString);
|
|
61
|
-
const now = /* @__PURE__ */ new Date();
|
|
62
|
-
const diffMs = now.getTime() - date.getTime();
|
|
63
|
-
const diffSecs = Math.floor(diffMs / 1e3);
|
|
64
|
-
const diffMins = Math.floor(diffSecs / 60);
|
|
65
|
-
const diffHours = Math.floor(diffMins / 60);
|
|
66
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
67
|
-
if (diffSecs < 60) return "just now";
|
|
68
|
-
if (diffMins < 60) return `${diffMins}m ago`;
|
|
69
|
-
if (diffHours < 24) return `${diffHours}h ago`;
|
|
70
|
-
if (diffDays < 7) return `${diffDays}d ago`;
|
|
71
|
-
return formatDate(dateString);
|
|
72
|
-
}
|
|
73
|
-
function calculateProgress(completed, total) {
|
|
74
|
-
if (total === 0) return 0;
|
|
75
|
-
return Math.round(completed / total * 100);
|
|
76
|
-
}
|
|
77
|
-
function truncateText(text, maxLength) {
|
|
78
|
-
if (text.length <= maxLength) return text;
|
|
79
|
-
return text.slice(0, maxLength).trimEnd() + "...";
|
|
80
|
-
}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC"}
|
package/dist/utils/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// src/utils/formatters.ts
|
|
2
|
-
function formatDuration(seconds) {
|
|
3
|
-
if (!seconds || seconds < 0) return "0:00";
|
|
4
|
-
const hours = Math.floor(seconds / 3600);
|
|
5
|
-
const minutes = Math.floor(seconds % 3600 / 60);
|
|
6
|
-
const secs = Math.floor(seconds % 60);
|
|
7
|
-
if (hours > 0) {
|
|
8
|
-
return `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
9
|
-
}
|
|
10
|
-
return `${minutes}:${secs.toString().padStart(2, "0")}`;
|
|
11
|
-
}
|
|
12
|
-
function formatPrice(amount, currency = "USD") {
|
|
13
|
-
return new Intl.NumberFormat("en-US", {
|
|
14
|
-
style: "currency",
|
|
15
|
-
currency,
|
|
16
|
-
minimumFractionDigits: 0,
|
|
17
|
-
maximumFractionDigits: 2
|
|
18
|
-
}).format(amount);
|
|
19
|
-
}
|
|
20
|
-
function formatDate(dateString, options) {
|
|
21
|
-
const date = new Date(dateString);
|
|
22
|
-
return date.toLocaleDateString("en-US", options != null ? options : {
|
|
23
|
-
year: "numeric",
|
|
24
|
-
month: "short",
|
|
25
|
-
day: "numeric"
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function formatRelativeTime(dateString) {
|
|
29
|
-
const date = new Date(dateString);
|
|
30
|
-
const now = /* @__PURE__ */ new Date();
|
|
31
|
-
const diffMs = now.getTime() - date.getTime();
|
|
32
|
-
const diffSecs = Math.floor(diffMs / 1e3);
|
|
33
|
-
const diffMins = Math.floor(diffSecs / 60);
|
|
34
|
-
const diffHours = Math.floor(diffMins / 60);
|
|
35
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
36
|
-
if (diffSecs < 60) return "just now";
|
|
37
|
-
if (diffMins < 60) return `${diffMins}m ago`;
|
|
38
|
-
if (diffHours < 24) return `${diffHours}h ago`;
|
|
39
|
-
if (diffDays < 7) return `${diffDays}d ago`;
|
|
40
|
-
return formatDate(dateString);
|
|
41
|
-
}
|
|
42
|
-
function calculateProgress(completed, total) {
|
|
43
|
-
if (total === 0) return 0;
|
|
44
|
-
return Math.round(completed / total * 100);
|
|
45
|
-
}
|
|
46
|
-
function truncateText(text, maxLength) {
|
|
47
|
-
if (text.length <= maxLength) return text;
|
|
48
|
-
return text.slice(0, maxLength).trimEnd() + "...";
|
|
49
|
-
}
|
|
50
|
-
export {
|
|
51
|
-
calculateProgress,
|
|
52
|
-
formatDate,
|
|
53
|
-
formatDuration,
|
|
54
|
-
formatPrice,
|
|
55
|
-
formatRelativeTime,
|
|
56
|
-
truncateText
|
|
57
|
-
};
|