hazo_chat 3.2.0 → 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 +6 -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 -623
  11. package/dist/api/messages.js.map +0 -1
  12. package/dist/api/types.d.ts +0 -117
  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 -66
  17. package/dist/api/unread_count.d.ts.map +0 -1
  18. package/dist/api/unread_count.js +0 -110
  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 -228
  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 -42
  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 -273
  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 -33
  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 -23
  129. package/dist/hooks/use_file_upload.d.ts.map +0 -1
  130. package/dist/hooks/use_file_upload.js +0 -212
  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 -560
  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
package/README.md CHANGED
@@ -1320,7 +1320,9 @@ All buttons are sized consistently (`h-10 w-10`) to align properly with the text
1320
1320
 
1321
1321
  ## Configuration
1322
1322
 
1323
- ### hazo_chat_config.ini (Optional)
1323
+ ### config/hazo_chat_config.ini (Optional)
1324
+
1325
+ Configuration files are stored in the `config/` directory. Consuming applications should also use a `config/` directory to store their configuration files for consistency across hazo packages.
1324
1326
 
1325
1327
  ```ini
1326
1328
  [chat]
@@ -1221,9 +1221,11 @@ Ensure all required CSS variables are defined. hazo_chat uses shadcn/ui standard
1221
1221
 
1222
1222
  ## 7. Configuration (Optional)
1223
1223
 
1224
+ Configuration files are stored in the `config/` directory. Consuming applications should also use a `config/` directory to store their configuration files for consistency across hazo packages.
1225
+
1224
1226
  ### hazo_connect Configuration
1225
1227
 
1226
- Create `hazo_connect_config.ini` in project root:
1228
+ Create `config/hazo_connect_config.ini`:
1227
1229
 
1228
1230
  ```ini
1229
1231
  [database]
@@ -1233,7 +1235,7 @@ sqlite_path = ./data/app.db
1233
1235
 
1234
1236
  ### hazo_chat Configuration
1235
1237
 
1236
- Create `hazo_chat_config.ini` in project root (optional):
1238
+ Create `config/hazo_chat_config.ini` (optional):
1237
1239
 
1238
1240
  ```ini
1239
1241
  [chat]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_chat",
3
- "version": "3.2.0",
3
+ "version": "4.0.2",
4
4
  "description": "Chat interface for group-based communication with API-first architecture",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -84,11 +84,13 @@
84
84
  "@types/node": "^20.10.0",
85
85
  "@types/react": "^18.2.0",
86
86
  "@types/react-dom": "^18.2.0",
87
+ "hazo_logs": "^1.0.0",
87
88
  "next": "^14.2.33",
88
89
  "typescript": "^5.3.0"
89
90
  },
90
91
  "peerDependencies": {
91
92
  "hazo_connect": "^2.3.1",
93
+ "hazo_logs": "^1.0.0",
92
94
  "next": ">=14.0.0",
93
95
  "react": "^18.0.0",
94
96
  "react-dom": "^18.0.0",
@@ -98,6 +100,9 @@
98
100
  "hazo_connect": {
99
101
  "optional": true
100
102
  },
103
+ "hazo_logs": {
104
+ "optional": true
105
+ },
101
106
  "next": {
102
107
  "optional": false
103
108
  }
@@ -1,41 +0,0 @@
1
- /**
2
- * hazo_chat API Module
3
- *
4
- * Provides exportable API route handlers for Next.js applications.
5
- * These handlers can be imported and re-exported in your API routes.
6
- *
7
- * @example
8
- * ```typescript
9
- * // app/api/hazo_chat/messages/route.ts
10
- * import { createMessagesHandler } from 'hazo_chat/api';
11
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
12
- *
13
- * export const dynamic = 'force-dynamic';
14
- *
15
- * const { GET, POST } = createMessagesHandler({
16
- * getHazoConnect: () => getHazoConnectSingleton()
17
- * });
18
- *
19
- * export { GET, POST };
20
- * ```
21
- *
22
- * @example
23
- * ```typescript
24
- * // app/api/hazo_chat/messages/[id]/route.ts
25
- * import { createDeleteHandler } from 'hazo_chat/api';
26
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
27
- *
28
- * export const dynamic = 'force-dynamic';
29
- *
30
- * const { DELETE } = createDeleteHandler({
31
- * getHazoConnect: () => getHazoConnectSingleton()
32
- * });
33
- *
34
- * export { DELETE };
35
- * ```
36
- */
37
- export { createMessagesHandler, createMarkAsReadHandler, createDeleteHandler, } from './messages.js';
38
- export { createUnreadCountFunction } from './unread_count.js';
39
- export type { MessagesHandlerOptions, ChatMessageInput, ChatMessageRecord, ApiErrorResponse, ApiSuccessResponse, PaginationMeta, } from './types.js';
40
- export type { UnreadCountFunctionOptions, UnreadCountResult } from './unread_count.js';
41
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAG9D,YAAY,EACV,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/api/index.js DELETED
@@ -1,40 +0,0 @@
1
- /**
2
- * hazo_chat API Module
3
- *
4
- * Provides exportable API route handlers for Next.js applications.
5
- * These handlers can be imported and re-exported in your API routes.
6
- *
7
- * @example
8
- * ```typescript
9
- * // app/api/hazo_chat/messages/route.ts
10
- * import { createMessagesHandler } from 'hazo_chat/api';
11
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
12
- *
13
- * export const dynamic = 'force-dynamic';
14
- *
15
- * const { GET, POST } = createMessagesHandler({
16
- * getHazoConnect: () => getHazoConnectSingleton()
17
- * });
18
- *
19
- * export { GET, POST };
20
- * ```
21
- *
22
- * @example
23
- * ```typescript
24
- * // app/api/hazo_chat/messages/[id]/route.ts
25
- * import { createDeleteHandler } from 'hazo_chat/api';
26
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
27
- *
28
- * export const dynamic = 'force-dynamic';
29
- *
30
- * const { DELETE } = createDeleteHandler({
31
- * getHazoConnect: () => getHazoConnectSingleton()
32
- * });
33
- *
34
- * export { DELETE };
35
- * ```
36
- */
37
- // Export handler factories
38
- export { createMessagesHandler, createMarkAsReadHandler, createDeleteHandler, } from './messages.js';
39
- export { createUnreadCountFunction } from './unread_count.js';
40
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,2BAA2B;AAC3B,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,85 +0,0 @@
1
- /**
2
- * Messages API Handler Factory
3
- *
4
- * Creates GET, POST, and DELETE handlers for the /api/hazo_chat/messages endpoint.
5
- * These handlers should be used in a Next.js API route.
6
- *
7
- * @example
8
- * ```typescript
9
- * // app/api/hazo_chat/messages/route.ts
10
- * import { createMessagesHandler } from 'hazo_chat/api';
11
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
12
- *
13
- * export const dynamic = 'force-dynamic';
14
- *
15
- * const { GET, POST } = createMessagesHandler({
16
- * getHazoConnect: () => getHazoConnectSingleton()
17
- * });
18
- *
19
- * export { GET, POST };
20
- * ```
21
- */
22
- import { NextRequest, NextResponse } from 'next/server';
23
- import type { MessagesHandlerOptions } from './types.js';
24
- /**
25
- * Creates GET and POST handlers for chat messages
26
- *
27
- * @param options - Configuration options
28
- * @returns Object with GET and POST handlers
29
- */
30
- export declare function createMessagesHandler(options: MessagesHandlerOptions): {
31
- GET: (request: NextRequest) => Promise<NextResponse>;
32
- POST: (request: NextRequest) => Promise<NextResponse>;
33
- };
34
- /**
35
- * Creates a PATCH handler for marking a message as read
36
- *
37
- * This handler should be used in a Next.js API route like:
38
- * /api/hazo_chat/messages/[id]/read/route.ts
39
- *
40
- * @param options - Configuration options
41
- * @returns PATCH handler function
42
- */
43
- export declare function createMarkAsReadHandler(options: MessagesHandlerOptions): {
44
- PATCH: (request: NextRequest, context: {
45
- params: {
46
- id: string;
47
- } | Promise<{
48
- id: string;
49
- }>;
50
- }) => Promise<NextResponse>;
51
- };
52
- /**
53
- * Creates a DELETE handler for soft-deleting a message
54
- *
55
- * This handler should be used in a Next.js API route like:
56
- * /api/hazo_chat/messages/[id]/route.ts
57
- *
58
- * @example
59
- * ```typescript
60
- * // app/api/hazo_chat/messages/[id]/route.ts
61
- * import { createDeleteHandler } from 'hazo_chat/api';
62
- * import { getHazoConnectSingleton } from 'hazo_connect/nextjs/setup';
63
- *
64
- * export const dynamic = 'force-dynamic';
65
- *
66
- * const { DELETE } = createDeleteHandler({
67
- * getHazoConnect: () => getHazoConnectSingleton()
68
- * });
69
- *
70
- * export { DELETE };
71
- * ```
72
- *
73
- * @param options - Configuration options
74
- * @returns DELETE handler function
75
- */
76
- export declare function createDeleteHandler(options: MessagesHandlerOptions): {
77
- DELETE: (request: NextRequest, context: {
78
- params: {
79
- id: string;
80
- } | Promise<{
81
- id: string;
82
- }>;
83
- }) => Promise<NextResponse>;
84
- };
85
- //# sourceMappingURL=messages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/api/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIxD,OAAO,KAAK,EAAE,sBAAsB,EAAkG,MAAM,YAAY,CAAC;AA0FzJ;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB;mBAcvC,WAAW,KAAG,OAAO,CAAC,YAAY,CAAC;oBA2KlC,WAAW,KAAG,OAAO,CAAC,YAAY,CAAC;EAiJjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,sBAAsB;qBAY1D,WAAW,WACX;QAAE,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,KAC5D,OAAO,CAAC,YAAY,CAAC;EA2IzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,sBAAsB;sBAatD,WAAW,WACX;QAAE,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,KAC5D,OAAO,CAAC,YAAY,CAAC;EAuIzB"}