@connectycube/chat-widget 0.12.0 → 0.13.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.
package/README.md CHANGED
@@ -126,23 +126,33 @@ See chat widget code samples <https://github.com/ConnectyCube/connectycube-chat-
126
126
 
127
127
  ## Props
128
128
 
129
- | Prop Name | Type | Description |
130
- | -------------------- | --------------------- | ------------------------------------------------------------- |
131
- | `appId` | `number \| string` | The ConnectyCube Application ID |
132
- | `authKey` | `string` | The ConnectyCube Authentication Key |
133
- | `config` | `object` | _(Optional)_ Configuration options for ConnectyCube SDK |
134
- | `userId` | `string` | A User Id from your system |
135
- | `userName` | `string` | User name. This is how other users will see your user name |
136
- | `muted` | `boolean` (`false`) | _(Optional)_ Do not play sound on incoming message |
137
- | `splitView` | `boolean` (`false`) | _(Optional)_ Displays the chats in split view or single view |
138
- | `showOnlineUsersTab` | `boolean` (`false`) | _(Optional)_ Displays users tab with the list of online users |
139
- | `buttonTitle` | `string` ("Chat") | _(Optional)_ The text displayed on the chat button |
140
- | `buttonStyle` | `React.CSSProperties` | _(Optional)_ Inline styles for the button |
141
- | `portalStyle` | `React.CSSProperties` | _(Optional)_ Inline styles for the portal |
142
- | `badgeStyle` | `React.CSSProperties` | _(Optional)_ Inline styles for the badge |
143
- | `buttonClassName` | `string` | _(Optional)_ CSS class or Tailwind CSS classes for the button |
144
- | `portalClassName` | `string` | _(Optional)_ CSS class or Tailwind CSS classes for the chat |
145
- | `badgeClassName` | `string` | _(Optional)_ CSS class or Tailwind CSS classes for the badge |
129
+ | Prop Name | Type | Description | Default Value |
130
+ | -------------------- | --------------------- | -------------------------------------------------------------------------------------- | ------------- |
131
+ | `appId` | `number \| string` | The ConnectyCube Application ID | |
132
+ | `authKey` | `string` | The ConnectyCube Authentication Key | |
133
+ | `config` | `object` | _(Optional)_ Configuration options for ConnectyCube SDK | |
134
+ | `userId` | `string` | A User Id from your system | |
135
+ | `userName` | `string` | User name. This is how other users will see your user name | |
136
+ | `userAvatar` | `string` | _(Optional)_ User Avatar URL | |
137
+ | `muted` | `boolean` | _(Optional)_ Do not play sound on incoming message | false |
138
+ | `splitView` | `boolean` | _(Optional)_ Displays the chats in split view or single view | false |
139
+ | `showOnlineUsersTab` | `boolean` | _(Optional)_ Displays users tab with the list of online users | false |
140
+ | `buttonTitle` | `string` | _(Optional)_ The text displayed on the chat button | "Chat" |
141
+ | `buttonStyle` | `React.CSSProperties` | _(Optional)_ Inline styles for the button | |
142
+ | `portalStyle` | `React.CSSProperties` | _(Optional)_ Inline styles for the portal | |
143
+ | `badgeStyle` | `React.CSSProperties` | _(Optional)_ Inline styles for the badge | |
144
+ | `buttonClassName` | `string` | _(Optional)_ CSS class or Tailwind CSS classes for the button | |
145
+ | `portalClassName` | `string` | _(Optional)_ CSS class or Tailwind CSS classes for the chat | |
146
+ | `badgeClassName` | `string` | _(Optional)_ CSS class or Tailwind CSS classes for the badge | |
147
+ | `quickActions` | `object` | _(Optional)_ Configuration for quick actions dialog. See [QuickActions](#quickactions) | |
148
+
149
+ ## QuickActions
150
+
151
+ | Prop Name | Type | Description | Default Value |
152
+ | ------------- | ---------- | ------------------------------------------------ | ------------- |
153
+ | `title` | `string` | _(Optional)_ Title for the quick actions section | |
154
+ | `description` | `string` | _(Optional)_ Description for the quick actions | |
155
+ | `actions` | `string[]` | List of action strings | |
146
156
 
147
157
  ## Recipes
148
158
 
@@ -228,6 +238,10 @@ const props = {
228
238
  };
229
239
  ```
230
240
 
241
+ ## Changelog
242
+
243
+ <https://github.com/ConnectyCube/connectycube-chat-widget-samples/blob/main/CHANGELOG.md>
244
+
231
245
  ## Community and support
232
246
 
233
247
  - [Blog](https://connectycube.com/blog)
@@ -1,13 +1,16 @@
1
1
  import { Config } from '../../../node_modules/connectycube/dist/types/types';
2
+ import { QuickActions } from './redux/slices/quickActions';
2
3
  export type AppProps = {
3
4
  appId: Config.Credentials['appId'];
4
5
  authKey: Config.Credentials['authKey'];
5
6
  userId?: string;
6
7
  userName?: string;
8
+ userAvatar?: string;
7
9
  config?: Config.Options;
8
10
  muted?: boolean;
9
11
  splitView?: boolean;
10
12
  showOnlineUsersTab?: boolean;
13
+ quickActions?: QuickActions;
11
14
  buttonTitle?: string;
12
15
  buttonStyle?: React.CSSProperties;
13
16
  portalStyle?: React.CSSProperties;
@@ -0,0 +1,5 @@
1
+ export interface QuickActionsProps {
2
+ sendMessage: (text: string) => void;
3
+ }
4
+ declare const QuickActions: React.FC<QuickActionsProps>;
5
+ export default QuickActions;
@@ -1,6 +1,7 @@
1
1
  type LoginProps = {
2
2
  login?: string;
3
3
  name?: string;
4
+ avatar?: string;
4
5
  };
5
6
  declare const Login: React.FC<LoginProps>;
6
7
  export default Login;
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export interface AvatarProps {
3
- imageUID?: string;
3
+ imageUIDOrUrl?: string;
4
4
  name: string;
5
5
  className?: string | undefined;
6
6
  }
@@ -1,13 +1,13 @@
1
1
  import { Chat, Users, Auth } from '../../../node_modules/connectycube/dist/types/types';
2
2
  export declare const SESSION_KEY = "@connectycube/chat-widget:session";
3
- export declare const tryReuseSession: (userName?: string, userId?: string) => Promise<boolean>;
3
+ export declare const tryReuseSession: (userName?: string, userId?: string, userAvatar?: string) => Promise<boolean>;
4
4
  export declare const tryRestoreSession: () => Promise<Auth.Session | null>;
5
5
  export declare const createUserSession: (login: string, password: string) => Promise<Auth.Session>;
6
- export declare const createSession: (userId?: string, userName?: string) => Promise<Auth.Session | null>;
6
+ export declare const createSession: (userId?: string, userName?: string, userAvatar?: string) => Promise<Auth.Session | null>;
7
7
  export declare const destroyUserSession: () => Promise<void>;
8
- export declare const userSignup: (login: string, password: string, name?: string, externalId?: string) => Promise<Auth.Session>;
8
+ export declare const userSignup: (login: string, password: string, name?: string, externalId?: string, userAvatar?: string) => Promise<Auth.Session>;
9
9
  export declare const chatCredentials: () => Chat.ConnectionParams | null;
10
- export declare const updateUserProfileIfNeeded: (session: Auth.Session, name?: string, externalId?: string) => Promise<void>;
10
+ export declare const updateUserProfileIfNeeded: (session: Auth.Session, name?: string, externalId?: string, avatar?: string) => Promise<Auth.Session>;
11
11
  export declare const setSessionToLocalStorage: (session: Auth.Session) => void;
12
12
  export declare const getSessionFromLocalStorage: () => Auth.Session | null;
13
13
  export declare const clearSessionInLocalStorage: () => void;