@college-africa/chat-ui 1.3.1 → 1.3.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.
@@ -8098,13 +8098,15 @@ var po = async (e, t = {}) => {
8098
8098
  }, $ = null, ho = [];
8099
8099
  async function go(e) {
8100
8100
  if ($) return $;
8101
- $ = new Ua(e), await $.connect();
8102
- let t = await $.getMe();
8101
+ e.logger && e.logger;
8102
+ let { logger: t, ...n } = e;
8103
+ $ = new Ua(n), await $.connect();
8104
+ let r = await $.getMe();
8103
8105
  $.ws.on("message", (e) => {
8104
- e.type === "message" && mo(e.data, t.id);
8106
+ e.type === "message" && mo(e.data, r.id);
8105
8107
  });
8106
- let n = $;
8107
- return ho.splice(0).forEach((e) => e(n)), $;
8108
+ let i = $;
8109
+ return ho.splice(0).forEach((e) => e(i)), $;
8108
8110
  }
8109
8111
  function _o(e) {
8110
8112
  return e && ($ ? e($) : ho.push(e)), $;
@@ -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
@@ -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": "1.3.2",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "React chat UI component library for College Africa Chat",
@@ -38,7 +38,7 @@
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": "1.3.1",
42
42
  "@mui/icons-material": "^7.0.0",
43
43
  "dexie": "^4.4.2",
44
44
  "dexie-react-hooks": "^4.4.0",