@college-africa/chat-ui 1.3.1 → 2.0.0

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.
@@ -17,6 +17,11 @@ export declare function formatMessageTime(date: string | Date): string;
17
17
  * @returns Formatted date and time string
18
18
  */
19
19
  export declare function formatFullDateTime(date: string | Date): string;
20
+ /**
21
+ * Format a date for use in a day separator in the message list.
22
+ * Today → "Today", Yesterday → "Yesterday", this week → "Mon", same year → "Jun 30", older → "Jun 30, 2024"
23
+ */
24
+ export declare function formatMessageDate(date: string | Date): string;
20
25
  /**
21
26
  * Check if a timestamp is recent (within TTL)
22
27
  * @param timestamp - Timestamp in milliseconds
@@ -0,0 +1 @@
1
+ export declare function resizeImage(file: File | Blob, maxPx: number, compress?: number, fileType?: "image/webp" | "image/jpeg"): Promise<Blob>;
@@ -1,10 +1,13 @@
1
- import { ChatSDK, ChatClientConfig } from '@college-africa/chat-sdk';
1
+ import { ChatSDK, ChatClientConfig, Logger } from '@college-africa/chat-sdk';
2
+ export interface InitSDKConfig extends ChatClientConfig {
3
+ logger?: Logger;
4
+ }
2
5
  /**
3
6
  * Initialize the SDK singleton
4
7
  * @param config - Chat client configuration (contains authToken and/or getAuthToken)
5
8
  * @returns Promise that resolves with the initialized SDK instance
6
9
  */
7
- export declare function initSDK(config: ChatClientConfig): Promise<ChatSDK>;
10
+ export declare function initSDK(config: InitSDKConfig): Promise<ChatSDK>;
8
11
  /**
9
12
  * Get the current SDK instance, or null if not yet initialized.
10
13
  * Pass an optional callback to be called once the SDK becomes ready —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@college-africa/chat-ui",
3
- "version": "1.3.1",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "React chat UI component library for College Africa Chat",
@@ -38,8 +38,9 @@
38
38
  "react-dom": "^17.0.0||^18.0.0||^19.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@college-africa/chat-sdk": "1.3.0",
41
+ "@college-africa/chat-sdk": "2.0.0",
42
42
  "@mui/icons-material": "^7.0.0",
43
+ "browser-image-compression": "^2.0.2",
43
44
  "dexie": "^4.4.2",
44
45
  "dexie-react-hooks": "^4.4.0",
45
46
  "formik": "^2.4.9",