@nethesis/chat-island 0.1.0 → 0.1.1
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 +2 -0
- package/dist/ChatIsland.d.ts +4 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +623 -582
- package/dist/theme.d.ts +3 -0
- package/dist-widget/index.widget.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ 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>`.
|
|
13
14
|
|
|
14
15
|
## Events
|
|
15
16
|
|
|
@@ -21,6 +22,7 @@ Serve `dist/chat-island-sw.js` from the host for notifications with the tab clos
|
|
|
21
22
|
| `chat-island-delete` | in | `{ username }` purge a conversation, leave or destroy a group |
|
|
22
23
|
| `chat-island-contacts` | in | `{ contacts }` names, avatars, presence, number |
|
|
23
24
|
| `chat-island-conversations-request` | in | ask for the list |
|
|
25
|
+
| `chat-island-theme-change` | in | `{ theme }` light, dark or system, remembered |
|
|
24
26
|
| `chat-island-conversations` | out | `{ conversations }` newest first |
|
|
25
27
|
| `chat-island-unread` | out | `{ total }` |
|
|
26
28
|
| `chat-island-message` | out | every new message |
|
package/dist/ChatIsland.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
8
|
-
|
|
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. */
|
|
@@ -17,4 +18,4 @@ export interface ChatIslandProps {
|
|
|
17
18
|
/** Play a short chime when a message arrives and its window is not in view (default true). */
|
|
18
19
|
sound?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare function ChatIsland({ dataConfig, position,
|
|
21
|
+
export declare function ChatIsland({ dataConfig, position, theme, serviceWorker, maxHeads, newChatButton, notifications, sound }: ChatIslandProps): import("react").JSX.Element | null;
|
package/dist/index.d.ts
CHANGED