hazo_chat 4.0.1 → 4.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.
Files changed (155) hide show
  1. package/README.md +3 -1
  2. package/SETUP_CHECKLIST.md +4 -2
  3. package/package.json +1 -1
  4. package/dist/api/index.d.ts +0 -41
  5. package/dist/api/index.d.ts.map +0 -1
  6. package/dist/api/index.js +0 -40
  7. package/dist/api/index.js.map +0 -1
  8. package/dist/api/messages.d.ts +0 -85
  9. package/dist/api/messages.d.ts.map +0 -1
  10. package/dist/api/messages.js +0 -626
  11. package/dist/api/messages.js.map +0 -1
  12. package/dist/api/types.d.ts +0 -134
  13. package/dist/api/types.d.ts.map +0 -1
  14. package/dist/api/types.js +0 -8
  15. package/dist/api/types.js.map +0 -1
  16. package/dist/api/unread_count.d.ts +0 -82
  17. package/dist/api/unread_count.d.ts.map +0 -1
  18. package/dist/api/unread_count.js +0 -111
  19. package/dist/api/unread_count.js.map +0 -1
  20. package/dist/components/hazo_chat/hazo_chat.d.ts +0 -28
  21. package/dist/components/hazo_chat/hazo_chat.d.ts.map +0 -1
  22. package/dist/components/hazo_chat/hazo_chat.js +0 -230
  23. package/dist/components/hazo_chat/hazo_chat.js.map +0 -1
  24. package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts +0 -17
  25. package/dist/components/hazo_chat/hazo_chat_attachment_preview.d.ts.map +0 -1
  26. package/dist/components/hazo_chat/hazo_chat_attachment_preview.js +0 -60
  27. package/dist/components/hazo_chat/hazo_chat_attachment_preview.js.map +0 -1
  28. package/dist/components/hazo_chat/hazo_chat_context.d.ts +0 -46
  29. package/dist/components/hazo_chat/hazo_chat_context.d.ts.map +0 -1
  30. package/dist/components/hazo_chat/hazo_chat_context.js +0 -277
  31. package/dist/components/hazo_chat/hazo_chat_context.js.map +0 -1
  32. package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts +0 -15
  33. package/dist/components/hazo_chat/hazo_chat_document_viewer.d.ts.map +0 -1
  34. package/dist/components/hazo_chat/hazo_chat_document_viewer.js +0 -140
  35. package/dist/components/hazo_chat/hazo_chat_document_viewer.js.map +0 -1
  36. package/dist/components/hazo_chat/hazo_chat_header.d.ts +0 -16
  37. package/dist/components/hazo_chat/hazo_chat_header.d.ts.map +0 -1
  38. package/dist/components/hazo_chat/hazo_chat_header.js +0 -45
  39. package/dist/components/hazo_chat/hazo_chat_header.js.map +0 -1
  40. package/dist/components/hazo_chat/hazo_chat_input.d.ts +0 -16
  41. package/dist/components/hazo_chat/hazo_chat_input.d.ts.map +0 -1
  42. package/dist/components/hazo_chat/hazo_chat_input.js +0 -75
  43. package/dist/components/hazo_chat/hazo_chat_input.js.map +0 -1
  44. package/dist/components/hazo_chat/hazo_chat_messages.d.ts +0 -18
  45. package/dist/components/hazo_chat/hazo_chat_messages.d.ts.map +0 -1
  46. package/dist/components/hazo_chat/hazo_chat_messages.js +0 -255
  47. package/dist/components/hazo_chat/hazo_chat_messages.js.map +0 -1
  48. package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts +0 -16
  49. package/dist/components/hazo_chat/hazo_chat_reference_list.d.ts.map +0 -1
  50. package/dist/components/hazo_chat/hazo_chat_reference_list.js +0 -59
  51. package/dist/components/hazo_chat/hazo_chat_reference_list.js.map +0 -1
  52. package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts +0 -18
  53. package/dist/components/hazo_chat/hazo_chat_sidebar.d.ts.map +0 -1
  54. package/dist/components/hazo_chat/hazo_chat_sidebar.js +0 -72
  55. package/dist/components/hazo_chat/hazo_chat_sidebar.js.map +0 -1
  56. package/dist/components/hazo_chat/index.d.ts +0 -16
  57. package/dist/components/hazo_chat/index.d.ts.map +0 -1
  58. package/dist/components/hazo_chat/index.js +0 -19
  59. package/dist/components/hazo_chat/index.js.map +0 -1
  60. package/dist/components/index.d.ts +0 -9
  61. package/dist/components/index.d.ts.map +0 -1
  62. package/dist/components/index.js +0 -11
  63. package/dist/components/index.js.map +0 -1
  64. package/dist/components/ui/avatar.d.ts +0 -13
  65. package/dist/components/ui/avatar.d.ts.map +0 -1
  66. package/dist/components/ui/avatar.js +0 -28
  67. package/dist/components/ui/avatar.js.map +0 -1
  68. package/dist/components/ui/badge.d.ts +0 -16
  69. package/dist/components/ui/badge.d.ts.map +0 -1
  70. package/dist/components/ui/badge.js +0 -36
  71. package/dist/components/ui/badge.js.map +0 -1
  72. package/dist/components/ui/button.d.ts +0 -18
  73. package/dist/components/ui/button.d.ts.map +0 -1
  74. package/dist/components/ui/button.js +0 -47
  75. package/dist/components/ui/button.js.map +0 -1
  76. package/dist/components/ui/chat_bubble.d.ts +0 -18
  77. package/dist/components/ui/chat_bubble.d.ts.map +0 -1
  78. package/dist/components/ui/chat_bubble.js +0 -130
  79. package/dist/components/ui/chat_bubble.js.map +0 -1
  80. package/dist/components/ui/hover-card.d.ts +0 -13
  81. package/dist/components/ui/hover-card.d.ts.map +0 -1
  82. package/dist/components/ui/hover-card.js +0 -17
  83. package/dist/components/ui/hover-card.js.map +0 -1
  84. package/dist/components/ui/index.d.ts +0 -19
  85. package/dist/components/ui/index.d.ts.map +0 -1
  86. package/dist/components/ui/index.js +0 -21
  87. package/dist/components/ui/index.js.map +0 -1
  88. package/dist/components/ui/input.d.ts +0 -11
  89. package/dist/components/ui/input.d.ts.map +0 -1
  90. package/dist/components/ui/input.js +0 -18
  91. package/dist/components/ui/input.js.map +0 -1
  92. package/dist/components/ui/loading_skeleton.d.ts +0 -19
  93. package/dist/components/ui/loading_skeleton.d.ts.map +0 -1
  94. package/dist/components/ui/loading_skeleton.js +0 -30
  95. package/dist/components/ui/loading_skeleton.js.map +0 -1
  96. package/dist/components/ui/scroll-area.d.ts +0 -12
  97. package/dist/components/ui/scroll-area.d.ts.map +0 -1
  98. package/dist/components/ui/scroll-area.js +0 -25
  99. package/dist/components/ui/scroll-area.js.map +0 -1
  100. package/dist/components/ui/separator.d.ts +0 -11
  101. package/dist/components/ui/separator.d.ts.map +0 -1
  102. package/dist/components/ui/separator.js +0 -18
  103. package/dist/components/ui/separator.js.map +0 -1
  104. package/dist/components/ui/skeleton.d.ts +0 -9
  105. package/dist/components/ui/skeleton.d.ts.map +0 -1
  106. package/dist/components/ui/skeleton.js +0 -16
  107. package/dist/components/ui/skeleton.js.map +0 -1
  108. package/dist/components/ui/textarea.d.ts +0 -11
  109. package/dist/components/ui/textarea.d.ts.map +0 -1
  110. package/dist/components/ui/textarea.js +0 -18
  111. package/dist/components/ui/textarea.js.map +0 -1
  112. package/dist/components/ui/tooltip.d.ts +0 -14
  113. package/dist/components/ui/tooltip.d.ts.map +0 -1
  114. package/dist/components/ui/tooltip.js +0 -30
  115. package/dist/components/ui/tooltip.js.map +0 -1
  116. package/dist/hooks/index.d.ts +0 -10
  117. package/dist/hooks/index.d.ts.map +0 -1
  118. package/dist/hooks/index.js +0 -10
  119. package/dist/hooks/index.js.map +0 -1
  120. package/dist/hooks/use_chat_messages.d.ts +0 -38
  121. package/dist/hooks/use_chat_messages.d.ts.map +0 -1
  122. package/dist/hooks/use_chat_messages.js +0 -584
  123. package/dist/hooks/use_chat_messages.js.map +0 -1
  124. package/dist/hooks/use_chat_references.d.ts +0 -17
  125. package/dist/hooks/use_chat_references.d.ts.map +0 -1
  126. package/dist/hooks/use_chat_references.js +0 -133
  127. package/dist/hooks/use_chat_references.js.map +0 -1
  128. package/dist/hooks/use_file_upload.d.ts +0 -26
  129. package/dist/hooks/use_file_upload.d.ts.map +0 -1
  130. package/dist/hooks/use_file_upload.js +0 -216
  131. package/dist/hooks/use_file_upload.js.map +0 -1
  132. package/dist/index.d.ts +0 -13
  133. package/dist/index.d.ts.map +0 -1
  134. package/dist/index.js +0 -17
  135. package/dist/index.js.map +0 -1
  136. package/dist/lib/config.d.ts +0 -41
  137. package/dist/lib/config.d.ts.map +0 -1
  138. package/dist/lib/config.js +0 -93
  139. package/dist/lib/config.js.map +0 -1
  140. package/dist/lib/constants.d.ts +0 -41
  141. package/dist/lib/constants.d.ts.map +0 -1
  142. package/dist/lib/constants.js +0 -72
  143. package/dist/lib/constants.js.map +0 -1
  144. package/dist/lib/index.d.ts +0 -9
  145. package/dist/lib/index.d.ts.map +0 -1
  146. package/dist/lib/index.js +0 -9
  147. package/dist/lib/index.js.map +0 -1
  148. package/dist/lib/utils.d.ts +0 -17
  149. package/dist/lib/utils.d.ts.map +0 -1
  150. package/dist/lib/utils.js +0 -20
  151. package/dist/lib/utils.js.map +0 -1
  152. package/dist/types/index.d.ts +0 -570
  153. package/dist/types/index.d.ts.map +0 -1
  154. package/dist/types/index.js +0 -11
  155. package/dist/types/index.js.map +0 -1
@@ -1,134 +0,0 @@
1
- /**
2
- * API Handler Types
3
- *
4
- * Shared types for the exportable API route handlers.
5
- * These are used by consumers when setting up their API routes.
6
- */
7
- import type { NextRequest } from 'next/server';
8
- import type { Logger } from 'hazo_logs';
9
- export type { Logger } from 'hazo_logs';
10
- /**
11
- * Standardized error response format for all API endpoints
12
- */
13
- export interface ApiErrorResponse {
14
- success: false;
15
- error: string;
16
- error_code?: string;
17
- details?: Record<string, unknown>;
18
- }
19
- /**
20
- * Standardized success response format for all API endpoints
21
- */
22
- export interface ApiSuccessResponse<T = unknown> {
23
- success: true;
24
- data: T;
25
- }
26
- /**
27
- * Pagination metadata included in list responses
28
- */
29
- export interface PaginationMeta {
30
- limit: number;
31
- has_more: boolean;
32
- next_cursor: string | null;
33
- prev_cursor: string | null;
34
- }
35
- /**
36
- * Options for creating message API handlers
37
- */
38
- export interface MessagesHandlerOptions {
39
- /**
40
- * Function to get the hazo_connect adapter instance.
41
- * Called on each request to get a fresh connection.
42
- *
43
- * @example
44
- * ```typescript
45
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
46
- *
47
- * const options = {
48
- * getHazoConnect: () => getHazoConnectSingleton()
49
- * };
50
- * ```
51
- */
52
- getHazoConnect: () => unknown;
53
- /**
54
- * Function to get the logger instance from hazo_logs.
55
- * Required for structured logging.
56
- *
57
- * @example
58
- * ```typescript
59
- * import { createLogger } from 'hazo_logs';
60
- *
61
- * const logger = createLogger('hazo_chat');
62
- * const options = {
63
- * getLogger: () => logger
64
- * };
65
- * ```
66
- */
67
- getLogger: () => Logger;
68
- /**
69
- * Optional function to extract user ID from the request.
70
- * Defaults to reading from 'hazo_auth_user_id' cookie.
71
- *
72
- * @example
73
- * ```typescript
74
- * // Custom auth extraction
75
- * const options = {
76
- * getUserIdFromRequest: (request) => {
77
- * const token = request.headers.get('Authorization');
78
- * return decodeToken(token)?.userId || null;
79
- * }
80
- * };
81
- * ```
82
- */
83
- getUserIdFromRequest?: (request: NextRequest) => string | null | Promise<string | null>;
84
- }
85
- /**
86
- * Chat message input for creating new messages
87
- */
88
- export interface ChatMessageInput {
89
- chat_group_id: string;
90
- message_text: string;
91
- reference_id?: string;
92
- reference_type?: string;
93
- }
94
- /**
95
- * Chat message database record
96
- */
97
- export interface ChatMessageRecord {
98
- id: string;
99
- reference_id: string;
100
- reference_type: string;
101
- sender_user_id: string;
102
- chat_group_id: string;
103
- message_text: string;
104
- reference_list: string | null;
105
- read_at: string | null;
106
- deleted_at: string | null;
107
- created_at: string;
108
- changed_at: string;
109
- [key: string]: unknown;
110
- }
111
- /**
112
- * Chat group user membership record
113
- */
114
- export interface ChatGroupUserRecord {
115
- chat_group_id: string;
116
- user_id: string;
117
- role: 'client' | 'staff' | 'owner' | 'admin' | 'member';
118
- created_at: string;
119
- changed_at: string | null;
120
- [key: string]: unknown;
121
- }
122
- /**
123
- * Chat group database record
124
- */
125
- export interface ChatGroupRecord {
126
- id: string;
127
- client_user_id: string | null;
128
- group_type: 'support' | 'peer' | 'group' | null;
129
- name: string | null;
130
- created_at: string;
131
- changed_at: string | null;
132
- [key: string]: unknown;
133
- }
134
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAA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AAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAChD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
package/dist/api/types.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * API Handler Types
3
- *
4
- * Shared types for the exportable API route handlers.
5
- * These are used by consumers when setting up their API routes.
6
- */
7
- export {};
8
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -1,82 +0,0 @@
1
- /**
2
- * Unread Count Library Function Factory
3
- *
4
- * Creates a function to get unread message counts grouped by chat_group_id
5
- * for a given user who is a member of those groups.
6
- *
7
- * @example
8
- * ```typescript
9
- * // In your server-side code
10
- * import { createUnreadCountFunction } from 'hazo_chat/api';
11
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
12
- *
13
- * const getUnreadCount = createUnreadCountFunction({
14
- * getHazoConnect: () => getHazoConnectSingleton()
15
- * });
16
- *
17
- * // Use the function
18
- * const unreadCounts = await getUnreadCount({ user_id: 'user-123' });
19
- * // Returns: [{ chat_group_id: 'group-1', count: 5 }, { chat_group_id: 'group-2', count: 3 }]
20
- * ```
21
- */
22
- import type { Logger } from 'hazo_logs';
23
- /**
24
- * Options for creating the unread count function
25
- */
26
- export interface UnreadCountFunctionOptions {
27
- /**
28
- * Function to get the hazo_connect adapter instance.
29
- * Called each time the function is invoked to get a fresh connection.
30
- *
31
- * @example
32
- * ```typescript
33
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
34
- *
35
- * const options = {
36
- * getHazoConnect: () => getHazoConnectSingleton()
37
- * };
38
- * ```
39
- */
40
- getHazoConnect: () => unknown;
41
- /**
42
- * Function to get the logger instance from hazo_logs.
43
- * Required for structured logging.
44
- *
45
- * @example
46
- * ```typescript
47
- * import { createLogger } from 'hazo_logs';
48
- *
49
- * const logger = createLogger('hazo_chat');
50
- * const options = {
51
- * getLogger: () => logger
52
- * };
53
- * ```
54
- */
55
- getLogger: () => Logger;
56
- }
57
- /**
58
- * Parameters for getting unread counts
59
- */
60
- export interface UnreadCountParams {
61
- /** The user ID to get unread counts for */
62
- user_id: string;
63
- /** Optional: Filter by specific chat group IDs. If not provided, returns counts for all groups the user belongs to */
64
- chat_group_ids?: string[];
65
- }
66
- /**
67
- * Result type for unread count function
68
- */
69
- export interface UnreadCountResult {
70
- /** The chat group ID */
71
- chat_group_id: string;
72
- /** Number of unread messages in this group */
73
- count: number;
74
- }
75
- /**
76
- * Creates a function to get unread message counts by chat_group_id
77
- *
78
- * @param options - Configuration options
79
- * @returns Function that takes UnreadCountParams and returns unread counts
80
- */
81
- export declare function createUnreadCountFunction(options: UnreadCountFunctionOptions): (params: UnreadCountParams) => Promise<UnreadCountResult[]>;
82
- //# sourceMappingURL=unread_count.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unread_count.d.ts","sourceRoot":"","sources":["../../src/api/unread_count.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;;;OAYG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC;IAE9B;;;;;;;;;;;;;OAaG;IACH,SAAS,EAAE,MAAM,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,sHAAsH;IACtH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,IAWzE,QAAQ,iBAAiB,KACxB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAsGhC"}
@@ -1,111 +0,0 @@
1
- /**
2
- * Unread Count Library Function Factory
3
- *
4
- * Creates a function to get unread message counts grouped by chat_group_id
5
- * for a given user who is a member of those groups.
6
- *
7
- * @example
8
- * ```typescript
9
- * // In your server-side code
10
- * import { createUnreadCountFunction } from 'hazo_chat/api';
11
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
12
- *
13
- * const getUnreadCount = createUnreadCountFunction({
14
- * getHazoConnect: () => getHazoConnectSingleton()
15
- * });
16
- *
17
- * // Use the function
18
- * const unreadCounts = await getUnreadCount({ user_id: 'user-123' });
19
- * // Returns: [{ chat_group_id: 'group-1', count: 5 }, { chat_group_id: 'group-2', count: 3 }]
20
- * ```
21
- */
22
- import { createCrudService } from 'hazo_connect/server';
23
- /**
24
- * Creates a function to get unread message counts by chat_group_id
25
- *
26
- * @param options - Configuration options
27
- * @returns Function that takes UnreadCountParams and returns unread counts
28
- */
29
- export function createUnreadCountFunction(options) {
30
- const { getHazoConnect, getLogger } = options;
31
- const logger = getLogger();
32
- /**
33
- * Get unread message counts grouped by chat_group_id for a user
34
- *
35
- * @param params - The parameters including user_id and optional chat_group_ids filter
36
- * @returns Array of objects with chat_group_id and count of unread messages
37
- */
38
- return async function hazo_chat_get_unread_count(params) {
39
- try {
40
- const { user_id, chat_group_ids } = params;
41
- if (!user_id || user_id.trim() === '') {
42
- logger.error('[hazo_chat_get_unread_count] Missing user_id');
43
- return [];
44
- }
45
- logger.info('[hazo_chat_get_unread_count] Fetching unread counts for:', {
46
- user_id,
47
- chat_group_ids,
48
- });
49
- // Get hazo_connect instance
50
- const hazoConnect = getHazoConnect();
51
- // First, get all groups the user is a member of
52
- const membershipService = createCrudService(hazoConnect, 'hazo_chat_group_users');
53
- const memberships = await membershipService.list((qb) => qb.select('*').where('user_id', 'eq', user_id));
54
- if (memberships.length === 0) {
55
- logger.info('[hazo_chat_get_unread_count] User is not a member of any groups');
56
- return [];
57
- }
58
- // Get the group IDs to check (either filtered or all)
59
- const user_group_ids = memberships.map((m) => m.chat_group_id);
60
- const groups_to_check = chat_group_ids
61
- ? chat_group_ids.filter((id) => user_group_ids.includes(id))
62
- : user_group_ids;
63
- if (groups_to_check.length === 0) {
64
- logger.info('[hazo_chat_get_unread_count] No matching groups to check');
65
- return [];
66
- }
67
- // Fetch all unread messages from those groups (excluding user's own messages)
68
- const chatService = createCrudService(hazoConnect, 'hazo_chat');
69
- // We need to query each group and aggregate
70
- // Since hazo_connect may not support IN clause directly, fetch all messages and filter
71
- const all_unread_messages = [];
72
- for (const group_id of groups_to_check) {
73
- const group_messages = await chatService.list((qb) => qb
74
- .select('*')
75
- .where('chat_group_id', 'eq', group_id)
76
- .where('read_at', 'is', null)
77
- .where('deleted_at', 'is', null));
78
- // Filter out messages sent by the current user (they don't count as unread for sender)
79
- const unread_for_user = group_messages.filter((msg) => msg.sender_user_id !== user_id);
80
- all_unread_messages.push(...unread_for_user);
81
- }
82
- // Group by chat_group_id and count
83
- const count_map = new Map();
84
- for (const message of all_unread_messages) {
85
- const group_id = message.chat_group_id;
86
- const current_count = count_map.get(group_id) || 0;
87
- count_map.set(group_id, current_count + 1);
88
- }
89
- // Convert map to array of results
90
- const results = Array.from(count_map.entries()).map(([chat_group_id, count]) => ({
91
- chat_group_id,
92
- count,
93
- }));
94
- // Sort by count descending (most unread first)
95
- results.sort((a, b) => b.count - a.count);
96
- logger.info('[hazo_chat_get_unread_count] Found unread counts:', {
97
- user_id,
98
- total_groups: results.length,
99
- total_unread: all_unread_messages.length,
100
- });
101
- return results;
102
- }
103
- catch (error) {
104
- const error_message = error instanceof Error ? error.message : 'Unknown error';
105
- logger.error('[hazo_chat_get_unread_count] Error:', { error_message, error });
106
- // Return empty array on error rather than throwing
107
- return [];
108
- }
109
- };
110
- }
111
- //# sourceMappingURL=unread_count.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unread_count.js","sourceRoot":"","sources":["../../src/api/unread_count.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA6DxD;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAmC;IAC3E,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC9C,MAAM,MAAM,GAAG,S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AC,OAAO,EAAE,CAAC,CAAC,GAAG,CACtE,CAAC,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC3B,aAAa;gBACb,KAAK;aACN,CAAC,CACH,CAAC;YAEF,+CAA+C;YAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;YAE1C,MAAM,CAAC,IAAI,CAAC,mDAAmD,EAAE;gBAC/D,OAAO;gBACP,YAAY,EAAE,OAAO,CAAC,MAAM;gBAC5B,YAAY,EAAE,mBAAmB,CAAC,MAAM;aACzC,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,aAAa,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YAC/E,MAAM,CAAC,KAAK,CAAC,qCAAqC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;YAE9E,mDAAmD;YACnD,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * HazoChat Component
3
- *
4
- * Main chat UI component with:
5
- * - Responsive grid layout (sidebar + chat area)
6
- * - Context provider for shared state
7
- * - Document viewer and reference list
8
- * - Message polling and pagination
9
- *
10
- * Uses API calls internally - no server-side dependencies required.
11
- */
12
- import type { HazoChatProps } from '../../types/index.js';
13
- /**
14
- * HazoChat - Main chat component
15
- *
16
- * Uses API calls internally for all data operations.
17
- * Requires the following API routes to be set up:
18
- * - GET/POST /api/hazo_chat/messages
19
- * - GET /api/hazo_auth/me
20
- * - POST /api/hazo_auth/profiles
21
- *
22
- * See SETUP_CHECKLIST.md for detailed setup instructions.
23
- */
24
- export declare function HazoChat(props: HazoChatProps): import("react/jsx-runtime").JSX.Element;
25
- export declare namespace HazoChat {
26
- var displayName: string;
27
- }
28
- //# sourceMappingURL=hazo_chat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hazo_chat.d.ts","sourceRoot":"","sources":["../../../src/components/hazo_chat/hazo_chat.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,EACV,aAAa,EAId,MAAM,sBAAsB,CAAC;AAqc9B;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA2D5C;yBA3De,QAAQ"}
@@ -1,230 +0,0 @@
1
- /**
2
- * HazoChat Component
3
- *
4
- * Main chat UI component with:
5
- * - Responsive grid layout (sidebar + chat area)
6
- * - Context provider for shared state
7
- * - Document viewer and reference list
8
- * - Message polling and pagination
9
- *
10
- * Uses API calls internally - no server-side dependencies required.
11
- */
12
- 'use client';
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import { useCallback, useMemo, useState, useEffect, useRef } from 'react';
15
- import { IoChevronDown, IoChevronUp, IoChevronBack, IoChevronForward } from 'react-icons/io5';
16
- import { cn } from '../../lib/utils.js';
17
- import { DEFAULT_TIMEZONE, DEFAULT_REALTIME_MODE, DEFAULT_POLLING_INTERVAL, DEFAULT_MESSAGES_PER_PAGE } from '../../lib/constants.js';
18
- // Sub-components
19
- import { HazoChatProvider, useHazoChatContext } from './hazo_chat_context.js';
20
- import { HazoChatHeader } from './hazo_chat_header.js';
21
- import { HazoChatReferenceList } from './hazo_chat_reference_list.js';
22
- import { HazoChatDocumentViewer } from './hazo_chat_document_viewer.js';
23
- import { HazoChatMessages } from './hazo_chat_messages.js';
24
- import { HazoChatInput } from './hazo_chat_input.js';
25
- import { TooltipProvider } from '../ui/tooltip.js';
26
- import { Button } from '../ui/button.js';
27
- // Hooks
28
- import { useChatMessages } from '../../hooks/use_chat_messages.js';
29
- import { useChatReferences } from '../../hooks/use_chat_references.js';
30
- import { useFileUpload } from '../../hooks/use_file_upload.js';
31
- function HazoChatInner({ chat_group_id, reference_id = '', reference_type = 'chat', api_base_url = '/api/hazo_chat', additional_references = [], timezone = DEFAULT_TIMEZONE, title, subtitle, on_close, className, realtime_mode = DEFAULT_REALTIME_MODE, polling_interval = DEFAULT_POLLING_INTERVAL, messages_per_page = DEFAULT_MESSAGES_PER_PAGE, show_sidebar_toggle = false, show_delete_button = true, bubble_radius = 'default' }) {
32
- // Get context
33
- const { current_user, logger, selected_reference, highlighted_message_id, pending_attachments, is_sidebar_open, set_selected_reference, set_highlighted_message_id, add_pending_attachment, remove_pending_attachment, clear_pending_attachments, toggle_sidebar, set_sidebar_open, add_reference } = useHazoChatContext();
34
- // -------------------------------------------------------------------------
35
- // Messages hook (uses API calls)
36
- // -------------------------------------------------------------------------
37
- const { messages, is_loading: is_loading_messages, has_more, load_more, send_message, delete_message, mark_as_read, polling_status, refresh: refresh_messages } = useChatMessages({
38
- chat_group_id,
39
- logger,
40
- reference_id,
41
- reference_type,
42
- api_base_url,
43
- realtime_mode,
44
- polling_interval,
45
- messages_per_page
46
- });
47
- // -------------------------------------------------------------------------
48
- // References hook
49
- // -------------------------------------------------------------------------
50
- const { references, select_reference } = useChatReferences({
51
- messages,
52
- initial_references: additional_references.map((ref) => ({
53
- ...ref,
54
- scope: ref.scope || 'field'
55
- })),
56
- on_selection_change: (ref) => {
57
- set_selected_reference(ref);
58
- // If ref has message_id, highlight it
59
- if (ref?.message_id) {
60
- set_highlighted_message_id(ref.message_id);
61
- // Close sidebar on mobile after selection
62
- set_sidebar_open(false);
63
- }
64
- }
65
- });
66
- // -------------------------------------------------------------------------
67
- // References section collapse state
68
- // -------------------------------------------------------------------------
69
- const [is_references_expanded, set_is_references_expanded] = useState(() => {
70
- // Default to collapsed if no references
71
- return references.length > 0;
72
- });
73
- // Auto-expand when references are added
74
- useEffect(() => {
75
- if (references.length > 0 && !is_references_expanded) {
76
- set_is_references_expanded(true);
77
- }
78
- }, [references.length, is_references_expanded]);
79
- // -------------------------------------------------------------------------
80
- // Document viewer collapse state
81
- // -------------------------------------------------------------------------
82
- const [is_document_viewer_expanded, set_is_document_viewer_expanded] = useState(false);
83
- // -------------------------------------------------------------------------
84
- // Container width detection for narrow width handling
85
- // -------------------------------------------------------------------------
86
- const main_content_ref = useRef(null);
87
- const NARROW_WIDTH_THRESHOLD = 500; // px - below this, open documents in new tab
88
- // -------------------------------------------------------------------------
89
- // File upload hook
90
- // -------------------------------------------------------------------------
91
- const { add_files, remove_file, upload_all, is_uploading } = useFileUpload({
92
- logger,
93
- upload_location: `${api_base_url}/uploads`
94
- });
95
- // -------------------------------------------------------------------------
96
- // Handle send message
97
- // -------------------------------------------------------------------------
98
- const handle_send = useCallback(async (text, attachments) => {
99
- if (!current_user)
100
- return;
101
- // Upload pending files first
102
- const uploaded = await upload_all();
103
- // Build reference list from attachments
104
- const attachment_refs = [
105
- ...attachments,
106
- ...uploaded
107
- ].map((file) => ({
108
- id: file.id,
109
- type: 'document',
110
- scope: 'chat',
111
- name: file.name,
112
- url: file.url,
113
- mime_type: file.mime_type,
114
- file_size: file.file_size
115
- }));
116
- const payload = {
117
- reference_id: reference_id || '',
118
- reference_type,
119
- chat_group_id,
120
- message_text: text,
121
- reference_list: attachment_refs.length > 0 ? attachment_refs : undefined
122
- };
123
- const success = await send_message(payload);
124
- if (success) {
125
- clear_pending_attachments();
126
- // Add new references to the list
127
- attachment_refs.forEach((ref) => add_reference(ref));
128
- }
129
- }, [
130
- current_user,
131
- reference_id,
132
- reference_type,
133
- chat_group_id,
134
- upload_all,
135
- send_message,
136
- clear_pending_attachments,
137
- add_reference
138
- ]);
139
- // -------------------------------------------------------------------------
140
- // Handle add attachment
141
- // -------------------------------------------------------------------------
142
- const handle_add_attachment = useCallback((files) => {
143
- files.forEach((file) => {
144
- add_pending_attachment(file);
145
- });
146
- add_files(files);
147
- }, [add_pending_attachment, add_files]);
148
- // -------------------------------------------------------------------------
149
- // Handle remove attachment
150
- // -------------------------------------------------------------------------
151
- const handle_remove_attachment = useCallback((attachment_id) => {
152
- remove_pending_attachment(attachment_id);
153
- remove_file(attachment_id);
154
- }, [remove_pending_attachment, remove_file]);
155
- // -------------------------------------------------------------------------
156
- // Handle reference selection
157
- // -------------------------------------------------------------------------
158
- const handle_reference_select = useCallback((reference) => {
159
- // Check container width - if narrow, open in new tab instead of showing preview
160
- if (main_content_ref.current) {
161
- const container_width = main_content_ref.current.offsetWidth;
162
- if (container_width < NARROW_WIDTH_THRESHOLD) {
163
- // Open in new tab for narrow containers
164
- window.open(reference.url, '_blank');
165
- return;
166
- }
167
- }
168
- // Normal behavior: select reference and show in preview
169
- select_reference(reference);
170
- // Expand document viewer when selecting a reference in wide containers
171
- if (!is_document_viewer_expanded) {
172
- set_is_document_viewer_expanded(true);
173
- }
174
- }, [select_reference, is_document_viewer_expanded]);
175
- // -------------------------------------------------------------------------
176
- // Render
177
- // -------------------------------------------------------------------------
178
- return (_jsxs("div", { className: cn('cls_hazo_chat', 'flex flex-col h-full w-full', 'bg-background rounded-lg border overflow-hidden', className), children: [_jsx(HazoChatHeader, { title: title, subtitle: subtitle, on_close: on_close, on_refresh: refresh_messages, is_refreshing: is_loading_messages, on_toggle_sidebar: toggle_sidebar, is_sidebar_open: is_sidebar_open, show_sidebar_toggle: show_sidebar_toggle }), _jsx("div", { className: cn('cls_references_row border-b bg-muted/30 transition-all duration-300 ease-in-out overflow-hidden', is_references_expanded ? 'max-h-96' : 'max-h-8'), children: _jsxs("div", { className: "cls_references_container px-3 py-2", children: [_jsxs("button", { type: "button", onClick: (e) => {
179
- e.preventDefault();
180
- e.stopPropagation();
181
- set_is_references_expanded((prev) => !prev);
182
- }, className: "cls_references_header flex items-center justify-between w-full gap-2 mb-1.5 hover:bg-muted/50 rounded px-1 -mx-1 transition-colors cursor-pointer", "aria-label": is_references_expanded ? 'Collapse references' : 'Expand references', "aria-expanded": is_references_expanded, children: [_jsx("h3", { className: "text-[9px] font-medium text-muted-foreground uppercase tracking-wider", children: "References" }), is_references_expanded ? (_jsx(IoChevronUp, { className: "w-3 h-3 text-muted-foreground flex-shrink-0" })) : (_jsx(IoChevronDown, { className: "w-3 h-3 text-muted-foreground flex-shrink-0" }))] }), is_references_expanded && (_jsx("div", { className: "cls_references_content", children: _jsx(HazoChatReferenceList, { references: references, selected_reference_id: selected_reference?.id, on_select: handle_reference_select, className: "flex-wrap" }) }))] }) }), _jsxs("div", { ref: main_content_ref, className: "cls_main_content flex flex-1 overflow-hidden relative h-full min-h-0", children: [_jsx("div", { className: cn('cls_doc_preview_column', 'border-r bg-muted/20', 'flex-shrink-0 flex flex-col', 'transition-all duration-300 ease-in-out overflow-hidden',
183
- // Mobile: hidden by default, shown when sidebar is open
184
- is_sidebar_open ? 'flex' : 'hidden md:flex',
185
- // Collapse/expand based on state
186
- is_document_viewer_expanded
187
- ? 'w-[280px] md:w-[320px] lg:w-[380px]'
188
- : 'w-0 border-r-0'), children: is_document_viewer_expanded && (_jsx(HazoChatDocumentViewer, { reference: selected_reference || undefined })) }), (!is_sidebar_open || is_sidebar_open) && (_jsx(Button, { variant: "outline", size: "icon", type: "button", onClick: (e) => {
189
- e.preventDefault();
190
- e.stopPropagation();
191
- set_is_document_viewer_expanded((prev) => !prev);
192
- }, className: cn('cls_doc_viewer_toggle', 'absolute z-30 pointer-events-auto', 'h-8 w-6 rounded-r-md rounded-l-none border-l-0', 'bg-background hover:bg-accent border', 'shadow-sm', 'transition-all duration-300', 'flex items-center justify-center',
193
- // Center vertically
194
- 'top-1/2', '-translate-y-1/2',
195
- // Hide on mobile when sidebar is closed, show on desktop
196
- (!is_sidebar_open ? 'hidden md:flex' : 'flex'),
197
- // Position based on expanded state - ensure button is always visible
198
- is_document_viewer_expanded
199
- ? 'left-[280px] md:left-[320px] lg:left-[380px]'
200
- : 'left-0'), style: {
201
- transform: 'translateY(-50%)',
202
- }, "aria-label": is_document_viewer_expanded ? 'Collapse document viewer' : 'Expand document viewer', children: is_document_viewer_expanded ? (_jsx(IoChevronBack, { className: "h-4 w-4" })) : (_jsx(IoChevronForward, { className: "h-4 w-4" })) })), _jsx("div", { className: "cls_chat_column flex flex-col flex-1 min-w-0", children: _jsx(HazoChatMessages, { messages: messages, current_user_id: current_user?.id || '', timezone: timezone, is_loading: is_loading_messages, has_more: has_more, on_load_more: load_more, on_delete_message: delete_message, on_mark_as_read: mark_as_read, highlighted_message_id: highlighted_message_id || undefined, show_delete_button: show_delete_button, bubble_radius: bubble_radius }) })] }), _jsx("div", { className: "cls_input_row border-t bg-background", children: _jsx(HazoChatInput, { on_send: handle_send, pending_attachments: pending_attachments, on_add_attachment: handle_add_attachment, on_remove_attachment: handle_remove_attachment, is_disabled: !current_user || is_uploading }) }), polling_status !== 'connected' && (_jsx("div", { className: cn('cls_connection_status', 'absolute bottom-20 left-1/2 -translate-x-1/2', 'px-3 py-1.5 rounded-full text-xs font-medium z-10', polling_status === 'reconnecting'
203
- ? 'bg-yellow-100 text-yellow-800'
204
- : 'bg-red-100 text-red-800'), children: polling_status === 'reconnecting' ? 'Reconnecting...' : 'Connection error' }))] }));
205
- }
206
- // ============================================================================
207
- // Main Component (with Provider)
208
- // ============================================================================
209
- /**
210
- * HazoChat - Main chat component
211
- *
212
- * Uses API calls internally for all data operations.
213
- * Requires the following API routes to be set up:
214
- * - GET/POST /api/hazo_chat/messages
215
- * - GET /api/hazo_auth/me
216
- * - POST /api/hazo_auth/profiles
217
- *
218
- * See SETUP_CHECKLIST.md for detailed setup instructions.
219
- */
220
- export function HazoChat(props) {
221
- const { chat_group_id, logger, reference_id, reference_type = 'chat', api_base_url = '/api/hazo_chat', additional_references = [], timezone = DEFAULT_TIMEZONE, title, subtitle, on_close, realtime_mode, polling_interval, messages_per_page, show_sidebar_toggle, show_delete_button, bubble_radius, className } = props;
222
- // Convert ReferenceItem[] to ChatReferenceItem[]
223
- const initial_refs = useMemo(() => additional_references.map((ref) => ({
224
- ...ref,
225
- scope: ref.scope || 'field'
226
- })), [additional_references]);
227
- return (_jsx(TooltipProvider, { children: _jsx(HazoChatProvider, { logger: logger, api_base_url: api_base_url, initial_references: initial_refs, children: _jsx(HazoChatInner, { chat_group_id: chat_group_id, reference_id: reference_id, reference_type: reference_type, api_base_url: api_base_url, additional_references: initial_refs, timezone: timezone, title: title, subtitle: subtitle, on_close: on_close, realtime_mode: realtime_mode, polling_interval: polling_interval, messages_per_page: messages_per_page, show_sidebar_toggle: show_sidebar_toggle, show_delete_button: show_delete_button, bubble_radius: bubble_radius, className: className }) }) }));
228
- }
229
- HazoChat.displayName = 'HazoChat';
230
- //# sourceMappingURL=hazo_chat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hazo_chat.js","sourceRoot":"","sources":["../../../src/components/hazo_chat/hazo_chat.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,CAAC;;AAEb,OAAc,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAOxC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC,iBAAiB;AACjB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,e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