@nethesis/chat-island 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -10,6 +10,8 @@ import '@nethesis/chat-island/dist/index.css'
10
10
  ```
11
11
 
12
12
  Serve `dist/chat-island-sw.js` from the host for notifications with the tab closed.
13
+ `theme`: `light`, `dark` or `system`; default follows the host's `dark` class on `<html>`.
14
+ `drag={false}` when the host moves its own window (NethLink).
13
15
 
14
16
  ## Events
15
17
 
@@ -21,6 +23,7 @@ Serve `dist/chat-island-sw.js` from the host for notifications with the tab clos
21
23
  | `chat-island-delete` | in | `{ username }` purge a conversation, leave or destroy a group |
22
24
  | `chat-island-contacts` | in | `{ contacts }` names, avatars, presence, number |
23
25
  | `chat-island-conversations-request` | in | ask for the list |
26
+ | `chat-island-theme-change` | in | `{ theme }` light, dark or system, remembered |
24
27
  | `chat-island-conversations` | out | `{ conversations }` newest first |
25
28
  | `chat-island-unread` | out | `{ total }` |
26
29
  | `chat-island-message` | out | every new message |
@@ -1,11 +1,12 @@
1
+ import { type Theme } from './theme';
1
2
  import './index.css';
2
3
  export interface ChatIslandProps {
3
4
  /** Base64 of "<cti_host>:<cti_username>:<cti_token>", the same shape phone-island uses. */
4
5
  dataConfig: string;
5
6
  /** Where the island sits; default bottom-right. */
6
7
  position?: 'bottom-right' | 'bottom-left';
7
- /** Force dark theme; by default follows a `dark` class on <html>. */
8
- dark?: boolean;
8
+ /** 'light', 'dark' or 'system'; default follows the host's `dark` class on <html>. */
9
+ theme?: Theme;
9
10
  /** URL of chat-island-sw.js served by the host app; enables notifications when the tab is closed. */
10
11
  serviceWorker?: string;
11
12
  /** How many chat heads the dock keeps; older ones drop off. Default 5. */
@@ -16,5 +17,7 @@ export interface ChatIslandProps {
16
17
  notifications?: 'auto' | 'click';
17
18
  /** Play a short chime when a message arrives and its window is not in view (default true). */
18
19
  sound?: boolean;
20
+ /** Drag the island around the page (default true); off when the host moves its own window. */
21
+ drag?: boolean;
19
22
  }
20
- export declare function ChatIsland({ dataConfig, position, dark, serviceWorker, maxHeads, newChatButton, notifications, sound }: ChatIslandProps): import("react").JSX.Element | null;
23
+ export declare function ChatIsland({ dataConfig, position, theme, serviceWorker, maxHeads, newChatButton, notifications, sound, drag: draggable }: ChatIslandProps): import("react").JSX.Element | null;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { ChatIsland, type ChatIslandProps } from './ChatIsland';
2
2
  export type { Contact, ConversationSummary, Message, Status } from './types';
3
+ export type { Theme } from './theme';