analytica-frontend-lib 1.2.52 → 1.2.54

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 (41) hide show
  1. package/dist/ActivitiesHistory/index.css +33 -0
  2. package/dist/ActivitiesHistory/index.css.map +1 -1
  3. package/dist/ActivityCardQuestionBanks/index.css +33 -0
  4. package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
  5. package/dist/ActivityCardQuestionPreview/index.css +33 -0
  6. package/dist/ActivityCardQuestionPreview/index.css.map +1 -1
  7. package/dist/ActivityDetails/index.css +33 -0
  8. package/dist/ActivityDetails/index.css.map +1 -1
  9. package/dist/ActivityFilters/index.css +33 -0
  10. package/dist/ActivityFilters/index.css.map +1 -1
  11. package/dist/ActivityPreview/index.css +33 -0
  12. package/dist/ActivityPreview/index.css.map +1 -1
  13. package/dist/AlertManager/index.css +33 -0
  14. package/dist/AlertManager/index.css.map +1 -1
  15. package/dist/RecommendedLessonsHistory/index.css +33 -0
  16. package/dist/RecommendedLessonsHistory/index.css.map +1 -1
  17. package/dist/SendActivityModal/SendActivityModal.css +33 -0
  18. package/dist/SendActivityModal/SendActivityModal.css.map +1 -1
  19. package/dist/SendActivityModal/index.css +33 -0
  20. package/dist/SendActivityModal/index.css.map +1 -1
  21. package/dist/TableProvider/index.css +33 -0
  22. package/dist/TableProvider/index.css.map +1 -1
  23. package/dist/hooks/useAppContent.d.ts +1 -0
  24. package/dist/hooks/useAppContent.d.ts.map +1 -1
  25. package/dist/hooks/useChat.d.ts +112 -0
  26. package/dist/hooks/useChat.d.ts.map +1 -0
  27. package/dist/hooks/useChatRooms.d.ts +76 -0
  28. package/dist/hooks/useChatRooms.d.ts.map +1 -0
  29. package/dist/index.css +33 -0
  30. package/dist/index.css.map +1 -1
  31. package/dist/index.d.ts +8 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +712 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +709 -1
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/styles.css +33 -0
  38. package/dist/styles.css.map +1 -1
  39. package/dist/types/chat.d.ts +164 -0
  40. package/dist/types/chat.d.ts.map +1 -0
  41. package/package.json +2 -1
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Chat types for real-time messaging functionality
3
+ */
4
+ /**
5
+ * User profile role enumerations
6
+ * Defines all available user roles in the system with hierarchy levels
7
+ * Matches backend PROFILE_ROLES enum
8
+ */
9
+ export declare enum PROFILE_ROLES {
10
+ SUPER_ADMIN = "SUPER_ADMIN",
11
+ GENERAL_MANAGER = "GENERAL_MANAGER",
12
+ REGIONAL_MANAGER = "REGIONAL_MANAGER",
13
+ UNIT_MANAGER = "UNIT_MANAGER",
14
+ TEACHER = "TEACHER",
15
+ STUDENT = "STUDENT"
16
+ }
17
+ /**
18
+ * Message types enum
19
+ */
20
+ export declare const CHAT_MESSAGE_TYPES: {
21
+ readonly TEXT: "text";
22
+ readonly SYSTEM: "system";
23
+ };
24
+ export type ChatMessageType = (typeof CHAT_MESSAGE_TYPES)[keyof typeof CHAT_MESSAGE_TYPES];
25
+ /**
26
+ * User available for chat selection
27
+ */
28
+ export interface ChatUser {
29
+ userInstitutionId: string;
30
+ name: string;
31
+ photo: string | null;
32
+ profileName: string;
33
+ }
34
+ /**
35
+ * Available users grouped by role
36
+ */
37
+ export interface AvailableUsers {
38
+ users: ChatUser[];
39
+ }
40
+ /**
41
+ * Chat room basic info
42
+ */
43
+ export interface ChatRoom {
44
+ id: string;
45
+ name: string;
46
+ classId: string;
47
+ createdById: string;
48
+ active: boolean;
49
+ createdAt: Date | string;
50
+ updatedAt: Date | string;
51
+ }
52
+ /**
53
+ * Chat room with last message and participant count
54
+ */
55
+ export interface ChatRoomWithDetails extends ChatRoom {
56
+ lastMessage: ChatMessage | null;
57
+ participantCount: number;
58
+ }
59
+ /**
60
+ * Chat message
61
+ */
62
+ export interface ChatMessage {
63
+ id: string;
64
+ senderId: string;
65
+ senderName: string;
66
+ senderPhoto: string | null;
67
+ senderRole: string;
68
+ content: string;
69
+ messageType: ChatMessageType;
70
+ createdAt: Date | string;
71
+ }
72
+ /**
73
+ * Chat participant
74
+ */
75
+ export interface ChatParticipant {
76
+ userInstitutionId: string;
77
+ name: string;
78
+ photo: string | null;
79
+ role: string;
80
+ isOnline: boolean;
81
+ }
82
+ /**
83
+ * WebSocket user info
84
+ */
85
+ export interface WSUserInfo {
86
+ userInstitutionId: string;
87
+ name: string;
88
+ photo: string | null;
89
+ role: string;
90
+ }
91
+ /**
92
+ * WebSocket message types - Client to Server
93
+ */
94
+ export type WSClientMessageType = 'message' | 'leave';
95
+ /**
96
+ * WebSocket message types - Server to Client
97
+ */
98
+ export type WSServerMessageType = 'user_joined' | 'user_left' | 'new_message' | 'participants' | 'history' | 'error';
99
+ /**
100
+ * WebSocket client message
101
+ */
102
+ export interface WSClientMessage {
103
+ type: WSClientMessageType;
104
+ payload?: {
105
+ content?: string;
106
+ };
107
+ }
108
+ /**
109
+ * WebSocket server message
110
+ */
111
+ export interface WSServerMessage {
112
+ type: WSServerMessageType;
113
+ payload: {
114
+ user?: WSUserInfo;
115
+ message?: ChatMessage;
116
+ messages?: ChatMessage[];
117
+ participants?: ChatParticipant[];
118
+ message_text?: string;
119
+ };
120
+ }
121
+ /**
122
+ * Chat API client interface
123
+ */
124
+ export interface ChatApiClient {
125
+ get: <T>(url: string) => Promise<{
126
+ data: T;
127
+ }>;
128
+ post: <T>(url: string, data?: unknown) => Promise<{
129
+ data: T;
130
+ }>;
131
+ }
132
+ /**
133
+ * API response types
134
+ */
135
+ export interface AvailableUsersResponse {
136
+ users: ChatUser[];
137
+ }
138
+ export interface CreateRoomResponse {
139
+ room: ChatRoom;
140
+ participants: Array<{
141
+ id: string;
142
+ roomId: string;
143
+ userInstitutionId: string;
144
+ isOnline: boolean;
145
+ lastSeenAt: Date | string | null;
146
+ joinedAt: Date | string;
147
+ }>;
148
+ }
149
+ export interface GetRoomsResponse {
150
+ rooms: ChatRoomWithDetails[];
151
+ }
152
+ export interface GetRoomDetailsResponse {
153
+ room: ChatRoom;
154
+ participants: Array<{
155
+ userInstitutionId: string;
156
+ userName: string;
157
+ userPhoto: string | null;
158
+ userRole: string;
159
+ isOnline: boolean;
160
+ lastSeenAt: Date | string | null;
161
+ }>;
162
+ messages: ChatMessage[];
163
+ }
164
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,oBAAY,aAAa;IACvB,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IACrC,YAAY,iBAAiB;IAC7B,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAo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AC;QAClB,UAAU,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;KAClC,CAAC,CAAC;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analytica-frontend-lib",
3
- "version": "1.2.52",
3
+ "version": "1.2.54",
4
4
  "description": "Repositório público dos componentes utilizados nas plataformas da Analytica Ensino",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -43,6 +43,7 @@
43
43
  "./button": "./dist/Button/index.js",
44
44
  "./calendar": "./dist/Calendar/index.js",
45
45
  "./card": "./dist/Card/index.js",
46
+ "./chat": "./dist/Chat/index.js",
46
47
  "./check-box": "./dist/CheckBox/index.js",
47
48
  "./check-box-group": "./dist/CheckBoxGroup/index.js",
48
49
  "./chips": "./dist/Chips/index.js",