@connectycube/chat-widget 0.33.0 → 0.35.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +64 -283
  2. package/README.md +11 -3
  3. package/dist/index.es.js +3264 -3096
  4. package/dist/index.umd.js +148 -62
  5. package/dist/{react19.es.js → react18.es.js} +3687 -2821
  6. package/dist/types/components/home/main/ai-dropdown-menu/ai-dropdown-change-tone.d.ts +14 -0
  7. package/dist/types/components/home/main/ai-dropdown-menu/ai-dropdown-get-summary.d.ts +11 -0
  8. package/dist/types/components/home/main/chat-ai-button.d.ts +8 -0
  9. package/dist/types/components/home/main/chat-input.d.ts +1 -0
  10. package/dist/types/components/home/main/chat-messages-list.d.ts +1 -0
  11. package/dist/types/components/home/main/message/call-message.d.ts +13 -0
  12. package/dist/types/components/home/main/message/message-text-summary.d.ts +8 -0
  13. package/dist/types/components/home/main/message/message.d.ts +1 -0
  14. package/dist/types/components/shadcn-ui/class-names.d.ts +4 -0
  15. package/dist/types/components/shadcn-ui/skeleton.d.ts +2 -0
  16. package/dist/types/helpers/connectycube.d.ts +1 -1
  17. package/dist/types/helpers/formatters.d.ts +1 -0
  18. package/dist/types/helpers/i18n.d.ts +5 -0
  19. package/dist/types/helpers/widget.d.ts +19 -0
  20. package/dist/types/hooks/index.d.ts +3 -1
  21. package/dist/types/hooks/store/useAppAIStore.d.ts +18 -0
  22. package/dist/types/hooks/useAppPresets.d.ts +6 -1
  23. package/dist/types/hooks/useCallHistory.d.ts +15 -0
  24. package/dist/types/locales/el/translation.json.d.ts +25 -1
  25. package/dist/types/locales/en/translation.json.d.ts +25 -1
  26. package/dist/types/locales/ua/translation.json.d.ts +25 -1
  27. package/dist/types/tests/formatters.test.d.ts +1 -0
  28. package/package.json +54 -43
package/CHANGELOG.md CHANGED
@@ -1,391 +1,172 @@
1
- # CHANGELOG
1
+ <a name="0.35.0"></a>
2
2
 
3
- ## 0.33.0
4
-
5
- ### Features
3
+ ## 0.35.0
6
4
 
7
- - new prop `imgLogoSource` to use custom logo. Default is `'/logo.png'` relative to the site's `index.html`
8
- - login/register screen
9
- - new prop `enableUserLogin` to enable the user login/register feature
10
- - allows user logout if the `enableUserLogin` prop is enabled
11
- - single view mode (support chat)
12
- - new prop `singleView` to enable a support chat feature
13
- - new prop `singleViewChat` to set set chat for the support chat feature. `singleViewChat: { opponentUserIds: string | string[]; name?: string; photo?: string }`
14
- - `singleViewChat`'s property `opponentUserIds: string | string[]` to set opponent(s) ID/IDs for a support chat. Use separators, such as `","`, `", "`, or `" "`, or array of strings to add more IDs to the chat
15
- - `singleViewChat`'s property `name?: string` to set the support chat's name
16
- - `singleViewChat`'s property `photo?: string` to set the support chat's photo. Use a relative path to an image file, a URL, or ConnectyCube file's UID
17
- - new prop `termsAndConditions` to set link for "Terms and conditions"
18
- - new supported variables in `.env`:
19
- - `CHAT_WIDGET_CONNECTYCUBE_SINGLE_VIEW_CHAT_OPPONENTS_IDS` to set default opponent(s) ID/IDs for a support chat
20
- - `CHAT_WIDGET_CONNECTYCUBE_SINGLE_VIEW_CHAT_NAME` to set the displayed default support chat's name
21
- - `CHAT_WIDGET_CONNECTYCUBE_SINGLE_VIEW_CHAT_ICON` to set the default icon source for the support chat's photo
22
- - `CHAT_WIDGET_CONNECTYCUBE_TERMS_AND_CONDITIONS` to set default link for "Terms and conditions"
23
-
24
- ### Updated
25
-
26
- - updated `attachmentsAccept` prop to support `null`, which hides the attachment button
27
-
28
- ### Misc
29
-
30
- - new supported variables in `.env`:
31
- - `CHAT_WIDGET_CONNECTYCUBE_WEB_PUSH_VAPID_PUBLIC_KEY` as default for `webPushVapidPublicKey` prop
32
- - `CHAT_WIDGET_CONNECTYCUBE_WEB_PUSH_SERVICE_WORKER_PATH` as default for `serviceWorkerPath` prop
5
+ ### Bug Fixes
33
6
 
34
- ## 0.32.1
7
+ - “Unknown“ user name and login issue on first open
35
8
 
36
- ### Misc
9
+ ### Chores
37
10
 
38
- - upgraded `connectycube` to version `4.7.1`
39
- - upgraded `@connectycube/use-chat` to version `0.26.2`
11
+ - imports build of the Chat Widget for react@19 as default for ESM. Use `import ChatWidget from "@connectycube/chat-widget/react18"` to import the build for react@18
40
12
 
41
- ## 0.32.0
13
+ <a name="0.34.0"></a>
42
14
 
43
- ### Misc
15
+ ## 0.34.0
44
16
 
45
- - SSR (Server-Side Rendering) support
46
- - implemented `localStorage` and `document` guards
47
- - updated authentication logic
17
+ ### Chores
48
18
 
49
- ### Fixed
19
+ - new commands in `package.json` to bump major/minor/patch versions
50
20
 
51
- - removed unnecessary text from `README.md`
52
- - word "Messed" changed to "Missed" in `en/translation.json` file
53
- - resets specific store data to prevent displaying the useless toast about a missed call
21
+ ### Features
54
22
 
55
- ## 0.31.0
23
+ - call history
24
+ - implemented auto-grow text input for typing message
25
+ - ability to change tone of message for typed text via AI
26
+ - AI text summarization in chat
27
+ - new prop `ai` to configure AI options. `ai: { apiKey: string; textSummarization?: boolean; changeMessageTone?: boolean; }`
28
+ - supported new variable `CHAT_WIDGET_CONNECTYCUBE_GOOGLE_GENERATIVE_AI_API_KEY` in `.env` to set `ai.apiKey` for "gemini-2.5-flash" model
56
29
 
57
- ### Misc
30
+ <a name="0.33.0"></a>
58
31
 
59
- - Uses the `<VList/>` component from the `virtua` scroll library
60
- - Added infinite scroll to load and prepend earlier messages in chat history
61
- - Added infinite scroll to load and append more dialogs in the chat list
62
- - Updated messages styles and alignment
63
- - Updated dialog list styles
64
- - Can open the widget by clicking on the push notification
32
+ ## 0.33.0
65
33
 
66
- ### Fixed
34
+ <a name="0.32.1"></a>
67
35
 
68
- - Playing stop call audio on app start
36
+ ## 0.32.1
69
37
 
70
- ## 0.30.2
38
+ <a name="0.32.0"></a>
71
39
 
72
- ### Fixed
40
+ ## 0.32.0
73
41
 
74
- - Unknown caller name
42
+ <a name="0.31.0"></a>
75
43
 
76
- ## 0.30.1
44
+ ## 0.31.0
77
45
 
78
- ### Fixed
46
+ <a name="0.30.2"></a>
79
47
 
80
- - Establishes stream-management after reconnecting to the chat
48
+ ## 0.30.2
81
49
 
82
- ## 0.30.0
50
+ <a name="0.30.1"></a>
83
51
 
84
- ### Misc
52
+ ## 0.30.1
85
53
 
86
- - Ability to establish the chat connection with new parameters after restoring an expired API session
54
+ <a name="0.30.0"></a>
87
55
 
88
- ### Bug fixed
56
+ ## 0.30.0
89
57
 
90
- - mobile view styles
91
- - chat & messages styles
58
+ <a name="0.29.0"></a>
92
59
 
93
60
  ## 0.29.0
94
61
 
95
- ### Features
62
+ <a name="0.28.0"></a>
96
63
 
97
- - p2p video and audio calls
98
- - new prop `enableCalls` to enable the calls feature
99
- - mute/unmute video and audio tracks
100
- - fullscreen view option for remote stream
101
- - screen-sharing
64
+ ## 0.28.0
102
65
 
103
- ### Misc
104
-
105
- - Can restore expired API session
106
-
107
- ### Bug fixed
108
-
109
- - Display typing status in chat header
66
+ <a name="0.27.0"></a>
110
67
 
111
68
  ## 0.27.0
112
69
 
113
- ### Misc
114
-
115
- - Responsive styles based on a prop `portalStyle: { fontSize: ...px }`
70
+ <a name="0.26.1"></a>
116
71
 
117
72
  ## 0.26.1
118
73
 
119
- ### Misc
120
-
121
- - Set `max-width: 360px` for sidebar
122
- - Opponent messages in group chats are now grouped
123
- - User status is only shown to online users
124
- - Show's a notification about total unread messages count after the chat was reconnected
125
-
126
- ### Bug fixes
127
-
128
- - Now refreshes chat list after reconnecting
74
+ <a name="0.26.0"></a>
129
75
 
130
76
  ## 0.26.0
131
77
 
132
- ### Features
133
-
134
- - Shows overlay while the chat widget is open
135
- - new prop `disableEscKeyPress` to disable closing the chat widget by pressing "esc" button. Default is **false**
136
- - new prop `overlayStyle` to customize the overlay
137
-
138
- ### Bug fixes
139
-
140
- - `defaultChat`: error happens if open chat widget quickly after page refresh
141
- - Fixed embedded mode
142
- - Prevent click-outside and lock-scroll in embedded mode
143
- - The attachment button "cursor-pointer" style is broken
144
- - The `window.ConnectyCubeChatWidget.toggle()` function was fixed for UMD build (Vanilla JS)
78
+ <a name="0.25.0"></a>
145
79
 
146
80
  ## 0.25.0
147
81
 
148
- ### Features
149
-
150
- - User can select status "Available", "Busy" and "Away"
151
- - new prop `enableUserStatuses` to enable the feature. Default is **false**
152
- - New message statuses "wait" and "lost", along with existing "sent" and "read"
153
- - Hide chat widget by click or touch, or press "Escape" outside widget's containers
154
- - new prop `disableClickOutside` to disable the feature. Default is **false**
155
- - Chat connection statuses "disconnected", "connecting" and "connected"
156
- - new prop `showChatStatus` to enable the feature. Default is **false**
157
- - Improved chat/internet automatic reconnection flow to prevent messages missing
158
- - Updated **defaultChat.opponentUserId** prop to behave like **userId** prop (from user's own system) and have type **string**
159
- - Added the ability to embed chat-widget in a parent block. It will open by default, and the widget's button will be hidden
160
- - new prop `embedView` to enable the feature. Default is **false**. If enabled, `open` and `hideWidgetButton` will not react
161
-
162
- ### Misc
163
-
164
- - Implemented scrollbar styles to prevent inheritance in widget's #shadow-root
165
- - Added an overlay for modals (Dialog and AlertDialog)
166
- - Props `portalClassName`, `buttonClassName`, `buttonClassName` and `onlineBadgeClassName` were removed. Use `portalStyle`, `buttonStyle`, `badgeStyle` and `onlineBadgeStyle` instead
167
-
168
- ### Bug fixes
169
-
170
- - Light text on a white background
171
- - Document's scroll locks on mobile
172
- - Scroll by wheel is broken in modals
173
- - Message status "read" does not react in real-time
82
+ <a name="0.24.0"></a>
174
83
 
175
84
  ## 0.24.0
176
85
 
177
- ### Bug fixes
178
-
179
- - UI fixes for when `enableUrlPreview=false`
86
+ <a name="0.23.0"></a>
180
87
 
181
88
  ## 0.23.0
182
89
 
183
- ### Features
184
-
185
- - The chat widget is now fully rendered inside a Shadow DOM, preventing style conflicts and external interference
186
- - Supports React 19. Import the dedicated ESM-only build instead: `import ConnectyCubeChatWidget from '@connectycube/chat-widget/react19'`
187
-
188
- ### Bug fixes
189
-
190
- - Fix message text line break behavior
191
- - Online users badge: hide if count = 0
192
- - Do not request online users if `enableOnlineUsersBadge=false`
193
-
194
- ### Misc
195
-
196
- - Users tab: remove arrow icon from user cell
197
- - Removed dependency on the libraries "react-router", "react-router-dom" and "react-scroll"
90
+ <a name="0.22.0"></a>
198
91
 
199
92
  ## 0.22.0
200
93
 
201
- ### Features
202
-
203
- - URL preview - unfurl a link once posted in chat
204
- - new prop `enableUrlPreview` to enable the feature
205
- - new prop `limitUrlsPreviews` to set maximum displayed URLs preview in single message. Default is 1 and max is 5
206
- - Display user last activity
207
- - new prop `enableLastSeen` to show green dot on user avatar in chats list when user is online and last seen information on chat header
208
- - Display online users badge on chat widget button
209
- - new prop `enableOnlineUsersBadge` to enable the feature
210
- - new prop `getOnlineUsersInterval` to set how frequently the badge should be updated, in seconds. Default is 300 (5 minutes), min is 30 seconds
211
- - new prop `onOnlineUsersCountChange` to receive updates on the online users counter change
212
- - new props `onlineBadgeStyle` and `onlineBadgeClassName` to customize the badge
213
- - User typing feature
94
+ <a name="0.21.1"></a>
214
95
 
215
96
  ## 0.21.1
216
97
 
217
- ### Bug fixes
218
-
219
- - removed unnecessary/obsessive alerts
98
+ <a name="0.21.0"></a>
220
99
 
221
100
  ## 0.21.0
222
101
 
223
- ### Features
224
-
225
- - Video-preview for video attachment in chat
226
-
227
- ### Misc
228
-
229
- - Added support for node 22
230
- - Upgraded `connectycube` to 4.2.2 and `@connectycube/use-chat` to 0.18.0 to use import types and enums from "connectycube/types"
231
-
232
- ### Bug fixes
233
-
234
- - Web Push Notifications init and fetch with user setting
102
+ <a name="0.20.0"></a>
235
103
 
236
104
  ## 0.20.0
237
105
 
238
- ### Features
239
-
240
- - Push Notifications support (receive notifications when browser tab is closed). New props: `webPushNotifications`, `webPushVapidPublicKey`, `serviceWorkerPath`
241
- - Allow users search from 3 characters min (was 4)
242
- - New props - `hideNewUserChatOption`, `hideNewGroupChatOption` - To hide 'New group' / 'New message' options in Create Chat dropdown menu
106
+ ### Reverts
243
107
 
244
- ### Bug fixes
108
+ - bump connectycube[@4](https://github.com/4).1.4
245
109
 
246
- - [mobile] can't access own profile page
247
- - `attachmetsAccept` prop: block sending unsupported attachments when select All Files in file picker
248
- - Improved block list flow
110
+ <a name="0.19.0"></a>
249
111
 
250
112
  ## 0.19.0
251
113
 
252
- ### Bug fixes
253
-
254
- - fix user session restore
114
+ <a name="0.18.0"></a>
255
115
 
256
116
  ## 0.18.0
257
117
 
258
- ### Misc
259
-
260
- - update styles for chat item for not to interfere with host site styles
118
+ <a name="0.17.0"></a>
261
119
 
262
120
  ## 0.17.0
263
121
 
264
- ### Features
265
-
266
- - added `My Profile`
267
- - display blocked users list in `My Profile`
268
- - added Notification Settings in `My Profile` (can on/off notifications and notification sound)
269
- - shows a toast message when a blocked user tries to send a message;
270
- - added `attachmentsAccept` prop to specify supported attachments types
271
- - added `defaultChat` prop to force widget open particular chat
122
+ <a name="0.16.0"></a>
272
123
 
273
124
  ## 0.16.0
274
125
 
275
- ### Features
276
-
277
- - report user feature (via `enableContentReporting` prop)
278
- - block user feature (via `enableBlockList` prop)
279
- - notification on new message (via `showNotifications`, `playSound` and `muted` props)
280
-
281
- ### Bug fixes
282
-
283
- - change `break-all` to `break-word` for chat messages text
284
- - chats list: last item is not visible
285
-
286
- ### Misc
287
-
288
- - redux store was replaced by [zustand](https://github.com/pmndrs/zustand);
126
+ <a name="0.15.2"></a>
289
127
 
290
128
  ## 0.15.2
291
129
 
292
- ### Misc
293
-
294
- - update styles for chat item for not to interfere with host site styles
130
+ <a name="0.15.1"></a>
295
131
 
296
132
  ## 0.15.1
297
133
 
298
- ### Bug fixes
299
-
300
- - User profile link not displayed when open user profile from Users tab
301
-
302
- ### Misc
303
-
304
- - set static height for user profile header
305
- - set overflow-hidden for user profile container
134
+ <a name="0.15.0"></a>
306
135
 
307
136
  ## 0.15.0
308
137
 
309
- ### Features
310
-
311
- - highlight links in chat messages;
312
- - updated attachments to support uploading any file;
313
- - create 1-1 chat on send 1st message, not when click on a user
314
- - encapsulated chat widget styles to prevent global styling effects;
315
- - implemented `open` prop to manage chat widget visibility state;
316
- - implemented `window.ConnectyCubeChatWidget.toggle()` function to manage chat widget visibility state when used as UMD;
317
- - implemented `onOpenChange` and `onUnreadCountChange` props as callbacks to receive updates on the visibility of the chat widget and the unread message counter, respectively;
318
- - implemented `hideWidgetButton` prop to hide the chat widget button and use a custom one;
319
- - implemented browser notifications and `showNotifications` prop to enable the feature;
320
-
321
- ### Bug fixes
322
-
323
- - blocked sending files as attachments if they do not have `type` or `size` properties.
324
- - fixed z-index for Chat button and widget view
325
-
326
- ### Misc
327
-
328
- - upgraded tailwindcss to version 4;
329
- - upgraded ShadCN-UI components to support TailwindCSS version 4;
138
+ <a name="0.14.4"></a>
330
139
 
331
140
  ## 0.14.4
332
141
 
333
- ### Bug fixes
334
-
335
- - fix avatar crash when chat name is empty
142
+ <a name="0.14.3"></a>
336
143
 
337
144
  ## 0.14.3
338
145
 
339
- ### Bug fixes
146
+ ### Reverts
340
147
 
341
- - fix missing typings declaration
148
+ - [JS-59] update attachments
342
149
 
343
- ## 0.14.2
150
+ <a name="0.14.2"></a>
344
151
 
345
- ### Bug fixes
152
+ ## 0.14.2
346
153
 
347
- - fix README
154
+ <a name="0.14.0"></a>
348
155
 
349
156
  ## 0.14.0
350
157
 
351
- ### Features
352
-
353
- - introduce user profile link via `userProfileLink` prop
354
- - hide new chat button via `hideNewChatButton` prop
355
- - English, Greek, Ukrainian languages supported via `translation` prop
158
+ <a name="0.13.0"></a>
356
159
 
357
160
  ## 0.13.0
358
161
 
359
- ### Features
360
-
361
- - user avatar
362
- - suggested messages
162
+ <a name="0.12.0"></a>
363
163
 
364
164
  ## 0.12.0
365
165
 
366
- ### Features
367
-
368
- - message drafts
369
- - allow to change `userId` prop on the flight
370
-
371
- ### Bug fixes
372
-
373
- - fix mobile UI styles
166
+ <a name="0.11.0"></a>
374
167
 
375
168
  ## 0.11.0
376
169
 
377
- ### Features
378
-
379
- - displays total unread messages counter;
380
- - placeholders for empty lists;
381
-
382
- ### Bug fixes
383
-
384
- - can restore expired session;
385
- - can retrieve messages while the widget is collapsed;
386
- - incoming notification sound;
387
- - UI styles;
170
+ <a name="0.10.0"></a>
388
171
 
389
172
  ## 0.10.0
390
-
391
- Initial release.
package/README.md CHANGED
@@ -87,12 +87,20 @@ import ConnectyCubeChatWidget from "@connectycube/chat-widget";
87
87
 
88
88
  See chat widget code samples <https://github.com/ConnectyCube/connectycube-chat-widget-samples> as a reference for faster integration.
89
89
 
90
- #### React 19
90
+ #### React version support
91
91
 
92
- By default, the widget uses the React 18-compatible build. To use it with React 19, import the dedicated ESM-only build instead:
92
+ Since v0.35.0, the default build of the widget targets React 19 and is provided as an ESM module.
93
+ For React 18 projects, use the dedicated ESM-only build:
93
94
 
94
95
  ```js
95
- import ConnectyCubeChatWidget from '@connectycube/chat-widget/react19';
96
+ // v0.35.0 and later:
97
+ import ConnectyCubeChatWidget from '@connectycube/chat-widget'; // default: React 19
98
+ import ConnectyCubeChatWidget from '@connectycube/chat-widget/react19'; // explicit React 19 build
99
+ import ConnectyCubeChatWidget from '@connectycube/chat-widget/react18'; // dedicated React 18 build
100
+
101
+ // v0.34.0 and earlier:
102
+ import ConnectyCubeChatWidget from '@connectycube/chat-widget'; // default: React 18
103
+ import ConnectyCubeChatWidget from '@connectycube/chat-widget/react19'; // React 19 build
96
104
  ```
97
105
 
98
106
  #### Vanilla JS