@ethora/chat-component 26.5.10 → 26.5.12

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.
@@ -16,6 +16,8 @@ interface ProfileImagePlaceholderProps {
16
16
  active?: boolean;
17
17
  placeholderIcon?: React.ReactNode;
18
18
  disableOverlay?: boolean;
19
+ /** Show a green online-status dot on the avatar. */
20
+ online?: boolean;
19
21
  }
20
22
  export declare const ProfileImagePlaceholder: React.FC<ProfileImagePlaceholderProps>;
21
23
  export {};
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { IConfig } from '../../types/types';
3
+ interface NotificationPermissionBannerProps {
4
+ config?: IConfig;
5
+ /** Triggers the browser permission prompt + push registration. */
6
+ requestPermission: () => Promise<void>;
7
+ }
8
+ /**
9
+ * In-app banner nudging the user to enable browser notifications. Fully
10
+ * config-driven (config.pushNotifications.permissionBanner) and self-contained:
11
+ * it reads the live Notification permission, renders the "enable" or "blocked"
12
+ * variant accordingly, and hides itself when notifications are granted /
13
+ * unsupported / disabled. SSR-safe.
14
+ */
15
+ declare const NotificationPermissionBanner: React.FC<NotificationPermissionBannerProps>;
16
+ export default NotificationPermissionBanner;
@@ -8,4 +8,12 @@ export interface CallLogMeta {
8
8
  }
9
9
  export declare const isCallLogMessage: (message: unknown) => boolean;
10
10
  export declare const callStateHasLogData: (attrs: Record<string, any>) => boolean;
11
+ export declare const formatCallDuration: (ms: number) => string;
11
12
  export declare const transformCallLogMessage: (message: IMessage, selfXmppUsername: string) => IMessage;
13
+ export declare const buildLocalCallLogMessage: (params: {
14
+ callId: string;
15
+ direction: "outgoing" | "incoming";
16
+ durationMs: number;
17
+ kind: "audio" | "video";
18
+ selfXmppUsername: string;
19
+ }) => IMessage;
@@ -12,9 +12,11 @@ export declare const resolveIconColor: (config?: Pick<IConfig, "colors"> | null)
12
12
  * Resolve the background colour to use behind the chat's icon "chips" (attach,
13
13
  * send, microphone, file preview, etc.).
14
14
  *
15
- * Priority: explicit `config.colors.iconsBg` → `config.colors.secondary` →
16
- * white. Lets a host theme the icon backgrounds independently from `secondary`
17
- * via `colors.iconsBg`, while keeping the historical white default.
15
+ * Priority: explicit `config.colors.iconsBg` → a soft neutral default. We do
16
+ * NOT fall back to `colors.secondary`: that's a text/heading colour (often
17
+ * near-black), and using it here rendered the icon chips as harsh black
18
+ * squares. `secondary` also drives avatar backgrounds, so keeping it out of
19
+ * this resolver lets hosts theme text without blacking out the icons.
18
20
  */
19
21
  export declare const resolveIconBgColor: (config?: Pick<IConfig, "colors"> | null) => string;
20
22
  /** CSS variable read by the chat's chrome icons as their default colour. */
@@ -0,0 +1,10 @@
1
+ /**
2
+ * xmppUsernames currently ONLINE (available MUC presence) in the given room.
3
+ * Populated from the room's presence stanzas: an available presence marks a
4
+ * user online; a `type='unavailable'` presence marks them offline. When you
5
+ * join a room the server sends the presence of everyone already online, so the
6
+ * list is correct from the first render and updates live as users come/go.
7
+ */
8
+ export declare const useRoomPresence: (roomJID?: string) => string[];
9
+ /** Whether a specific member (by xmppUsername) is currently online in the room. */
10
+ export declare const useIsUserOnline: (roomJID?: string, xmppUsername?: string) => boolean;
package/dist/main.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  export { XmppProvider } from './context/xmppProvider';
5
5
  export { ReduxWrapper as Chat } from './components/MainComponents/ReduxWrapper';
6
6
  export { useUnread } from './hooks/useUnreadMessagesCounter';
7
+ export { useRoomPresence, useIsUserOnline } from './hooks/useRoomPresence';
7
8
  export { logoutService } from './hooks/useLogout';
8
9
  export { useQRCodeChat, handleQRChatId } from './hooks/useQRCodeChatHandler';
9
10
  export { useInAppNotifications } from './hooks/useInAppNotifications';