@cometchat/chat-uikit-react 6.3.7 → 6.3.8

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.
@@ -259,13 +259,13 @@ box-sizing: border-box;
259
259
  .cometchat-conversations__trailing-view {
260
260
  display: flex;
261
261
  flex-direction: column;
262
- gap: var(--cometchat-padding-1,4px);
262
+ gap: var(--cometchat-padding-1, 4px);
263
263
  }
264
264
 
265
265
  .cometchat-conversations__trailing-view-badge {
266
266
  display: flex;
267
267
  justify-content: flex-end;
268
- gap: var(--cometchat-padding-1,4px);
268
+ gap: var(--cometchat-padding-1, 4px);
269
269
  }
270
270
 
271
271
  .cometchat-conversations__trailing-view-badge-count {
@@ -46,12 +46,14 @@
46
46
  font: var(--cometchat-font-body-regular);
47
47
  color: var(--cometchat-text-color-primary);
48
48
  font-style: normal;
49
+ margin: 0;
49
50
  }
50
51
 
51
52
  /*
52
53
  Subtitle text inside the edit preview, containing the actual text being edited.
53
54
  */
54
55
  .cometchat-edit-preview__subtitle {
56
+ margin: 0;
55
57
  font-style: normal;
56
58
  text-align: left;
57
59
  color: var(--cometchat-text-color-secondary);
@@ -164,4 +164,8 @@
164
164
  height: 1px;
165
165
  background: var(--cometchat-border-color-default, #E8E8E8);
166
166
  flex: 1;
167
+ }
168
+
169
+ .cometchat-thread-header__message .cometchat-message-preview {
170
+ cursor: not-allowed;
167
171
  }
@@ -7,6 +7,28 @@
7
7
  gap: 0px;
8
8
  flex-shrink: 0;
9
9
  background: var(--cometchat-background-color-01, #FFF);
10
+ position: relative;
11
+ /* Prevent native text selection highlight when using Shift+Click to select user ranges */
12
+ user-select: none;
13
+ -webkit-user-select: none;
14
+ -moz-user-select: none;
15
+ -ms-user-select: none;
16
+ }
17
+
18
+ /* Allow text selection in input fields */
19
+ .cometchat-users input,
20
+ .cometchat-users .cometchat-search-bar__input {
21
+ user-select: text;
22
+ -webkit-user-select: text;
23
+ -moz-user-select: text;
24
+ -ms-user-select: text;
25
+ }
26
+
27
+ /* Hide selection highlight only for list items (not inputs) */
28
+ .cometchat-users__list-item::selection,
29
+ .cometchat-users__list-item *::selection {
30
+ background: transparent;
31
+ color: inherit;
10
32
  }
11
33
 
12
34
  .cometchat-users__empty-state-view {
@@ -132,6 +154,10 @@
132
154
 
133
155
  .cometchat-users__list-item {
134
156
  cursor: pointer;
157
+ user-select: none;
158
+ -webkit-user-select: none;
159
+ -moz-user-select: none;
160
+ -ms-user-select: none;
135
161
  }
136
162
 
137
163
  .cometchat-users__list-item .cometchat-avatar {
@@ -157,4 +183,131 @@
157
183
  100% {
158
184
  background-position: 468px 0;
159
185
  }
186
+ }
187
+
188
+ .cometchat-users__selected-preview {
189
+ position: absolute;
190
+ bottom: 0;
191
+ left: 0;
192
+ right: 0;
193
+ width: 100%;
194
+ max-height: 30vh;
195
+ padding-top: var(--cometchat-padding-4, 16px);
196
+ padding-left: var(--cometchat-padding-4, 16px);
197
+ padding-right: var(--cometchat-padding-4, 16px);
198
+ padding-bottom: 0;
199
+ background: var(--cometchat-background-color-01, #FFF);
200
+ border-top: 1px solid var(--cometchat-border-color-light, #F5F5F5);
201
+ box-sizing: border-box;
202
+ overflow-y: auto;
203
+ overflow-x: hidden;
204
+ z-index: 10;
205
+ }
206
+
207
+ /* Hide scrollbar when showScrollbar is false */
208
+ .cometchat-users__selected-preview-hide-scrollbar {
209
+ scrollbar-width: none; /* Firefox */
210
+ -ms-overflow-style: none; /* IE and Edge */
211
+ }
212
+
213
+ .cometchat-users__selected-preview-hide-scrollbar::-webkit-scrollbar {
214
+ display: none; /* Chrome, Safari, Opera */
215
+ }
216
+
217
+ .cometchat-users__selected-preview-container {
218
+ display: flex;
219
+ flex-wrap: wrap;
220
+ gap: var(--cometchat-padding-2, 8px);
221
+ max-height: calc(2 * (32px + var(--cometchat-padding-2, 8px)));
222
+ overflow-y: auto;
223
+ overflow-x: hidden;
224
+ }
225
+
226
+ /* Hide scrollbar when showScrollbar is false */
227
+ .cometchat-users__selected-preview-container-hide-scrollbar {
228
+ scrollbar-width: none; /* Firefox */
229
+ -ms-overflow-style: none; /* IE and Edge */
230
+ }
231
+
232
+ .cometchat-users__selected-preview-container-hide-scrollbar::-webkit-scrollbar {
233
+ display: none; /* Chrome, Safari, Opera */
234
+ }
235
+
236
+ .cometchat-users__selected-preview-chip {
237
+ display: flex;
238
+ align-items: center;
239
+ gap: var(--cometchat-padding-2, 8px);
240
+ border: 1px solid var(--cometchat-border-color-default, #E8E8E8);
241
+ padding: var(--cometchat-padding-1, 4px);
242
+ background: var(--cometchat-background-color-03, #F5F5F5);
243
+ border-radius: var(--cometchat-radius-max, 1000px);
244
+ height: 32px;
245
+ box-sizing: border-box;
246
+ flex-shrink: 0;
247
+ }
248
+
249
+ .cometchat-users__selected-preview-chip .cometchat-avatar {
250
+ width: 24px;
251
+ height: 24px;
252
+ flex-shrink: 0;
253
+ }
254
+ .cometchat-users__selected-preview-chip .cometchat-avatar .cometchat-avatar__text {
255
+ font: var( --cometchat-font-caption1-bold);
256
+ }
257
+
258
+ .cometchat-users__selected-preview-chip-name {
259
+ color: var(--cometchat-text-color-primary, #141414);
260
+ font: var(--cometchat-font-body-medium);
261
+ max-width: 48px;
262
+ white-space: nowrap;
263
+ overflow: hidden;
264
+ text-overflow: ellipsis;
265
+ }
266
+
267
+ .cometchat-users__selected-preview-chip-close {
268
+ display: flex;
269
+ align-items: center;
270
+ justify-content: center;
271
+ width: 16px;
272
+ height: 16px;
273
+ padding: 0;
274
+ border: none;
275
+ background: transparent;
276
+ cursor: pointer;
277
+ flex-shrink: 0;
278
+ }
279
+
280
+ .cometchat-users__selected-preview-chip-close img {
281
+ width: 16px;
282
+ height: 16px;
283
+ opacity: 0.6;
284
+ transition: opacity 0.2s;
285
+ }
286
+
287
+ .cometchat-users__selected-preview-chip-close:hover img {
288
+ opacity: 1;
289
+ }
290
+
291
+ .cometchat-users__selected-preview-chip-close-button {
292
+ border: none;
293
+ background: none;
294
+ cursor: pointer;
295
+ user-select: none;
296
+ flex-shrink: 0;
297
+ }
298
+
299
+ .cometchat-users__selected-preview-chip-close-button .cometchat-button {
300
+ background: transparent;
301
+ border: none;
302
+ border-radius: 0;
303
+ padding: 0;
304
+ margin: 0;
305
+ height: fit-content;
306
+ width: fit-content;
307
+ }
308
+
309
+ .cometchat-users__selected-preview-chip-close-button .cometchat-button .cometchat-button__icon {
310
+ height: 24px;
311
+ width: 24px;
312
+ background: var(--cometchat-icon-color-secondary);
160
313
  }
@@ -30,7 +30,7 @@
30
30
 
31
31
 
32
32
  .cometchat-sticker-keyboard__tab{
33
- padding: var(--cometchat-padding-1,4px);
33
+ padding: var(--cometchat-padding-1, 4px);
34
34
  }
35
35
  .cometchat-sticker-keyboard__tab-active{
36
36
  border-bottom: 2px solid var(--cometchat-primary-color, #6852D6);
@@ -259,13 +259,13 @@ box-sizing: border-box;
259
259
  .cometchat-conversations__trailing-view {
260
260
  display: flex;
261
261
  flex-direction: column;
262
- gap: var(--cometchat-padding-1,4px);
262
+ gap: var(--cometchat-padding-1, 4px);
263
263
  }
264
264
 
265
265
  .cometchat-conversations__trailing-view-badge {
266
266
  display: flex;
267
267
  justify-content: flex-end;
268
- gap: var(--cometchat-padding-1,4px);
268
+ gap: var(--cometchat-padding-1, 4px);
269
269
  }
270
270
 
271
271
  .cometchat-conversations__trailing-view-badge-count {
@@ -46,12 +46,14 @@
46
46
  font: var(--cometchat-font-body-regular);
47
47
  color: var(--cometchat-text-color-primary);
48
48
  font-style: normal;
49
+ margin: 0;
49
50
  }
50
51
 
51
52
  /*
52
53
  Subtitle text inside the edit preview, containing the actual text being edited.
53
54
  */
54
55
  .cometchat-edit-preview__subtitle {
56
+ margin: 0;
55
57
  font-style: normal;
56
58
  text-align: left;
57
59
  color: var(--cometchat-text-color-secondary);
@@ -164,4 +164,8 @@
164
164
  height: 1px;
165
165
  background: var(--cometchat-border-color-default, #E8E8E8);
166
166
  flex: 1;
167
+ }
168
+
169
+ .cometchat-thread-header__message .cometchat-message-preview {
170
+ cursor: not-allowed;
167
171
  }
@@ -7,6 +7,28 @@
7
7
  gap: 0px;
8
8
  flex-shrink: 0;
9
9
  background: var(--cometchat-background-color-01, #FFF);
10
+ position: relative;
11
+ /* Prevent native text selection highlight when using Shift+Click to select user ranges */
12
+ user-select: none;
13
+ -webkit-user-select: none;
14
+ -moz-user-select: none;
15
+ -ms-user-select: none;
16
+ }
17
+
18
+ /* Allow text selection in input fields */
19
+ .cometchat-users input,
20
+ .cometchat-users .cometchat-search-bar__input {
21
+ user-select: text;
22
+ -webkit-user-select: text;
23
+ -moz-user-select: text;
24
+ -ms-user-select: text;
25
+ }
26
+
27
+ /* Hide selection highlight only for list items (not inputs) */
28
+ .cometchat-users__list-item::selection,
29
+ .cometchat-users__list-item *::selection {
30
+ background: transparent;
31
+ color: inherit;
10
32
  }
11
33
 
12
34
  .cometchat-users__empty-state-view {
@@ -132,6 +154,10 @@
132
154
 
133
155
  .cometchat-users__list-item {
134
156
  cursor: pointer;
157
+ user-select: none;
158
+ -webkit-user-select: none;
159
+ -moz-user-select: none;
160
+ -ms-user-select: none;
135
161
  }
136
162
 
137
163
  .cometchat-users__list-item .cometchat-avatar {
@@ -157,4 +183,131 @@
157
183
  100% {
158
184
  background-position: 468px 0;
159
185
  }
186
+ }
187
+
188
+ .cometchat-users__selected-preview {
189
+ position: absolute;
190
+ bottom: 0;
191
+ left: 0;
192
+ right: 0;
193
+ width: 100%;
194
+ max-height: 30vh;
195
+ padding-top: var(--cometchat-padding-4, 16px);
196
+ padding-left: var(--cometchat-padding-4, 16px);
197
+ padding-right: var(--cometchat-padding-4, 16px);
198
+ padding-bottom: 0;
199
+ background: var(--cometchat-background-color-01, #FFF);
200
+ border-top: 1px solid var(--cometchat-border-color-light, #F5F5F5);
201
+ box-sizing: border-box;
202
+ overflow-y: auto;
203
+ overflow-x: hidden;
204
+ z-index: 10;
205
+ }
206
+
207
+ /* Hide scrollbar when showScrollbar is false */
208
+ .cometchat-users__selected-preview-hide-scrollbar {
209
+ scrollbar-width: none; /* Firefox */
210
+ -ms-overflow-style: none; /* IE and Edge */
211
+ }
212
+
213
+ .cometchat-users__selected-preview-hide-scrollbar::-webkit-scrollbar {
214
+ display: none; /* Chrome, Safari, Opera */
215
+ }
216
+
217
+ .cometchat-users__selected-preview-container {
218
+ display: flex;
219
+ flex-wrap: wrap;
220
+ gap: var(--cometchat-padding-2, 8px);
221
+ max-height: calc(2 * (32px + var(--cometchat-padding-2, 8px)));
222
+ overflow-y: auto;
223
+ overflow-x: hidden;
224
+ }
225
+
226
+ /* Hide scrollbar when showScrollbar is false */
227
+ .cometchat-users__selected-preview-container-hide-scrollbar {
228
+ scrollbar-width: none; /* Firefox */
229
+ -ms-overflow-style: none; /* IE and Edge */
230
+ }
231
+
232
+ .cometchat-users__selected-preview-container-hide-scrollbar::-webkit-scrollbar {
233
+ display: none; /* Chrome, Safari, Opera */
234
+ }
235
+
236
+ .cometchat-users__selected-preview-chip {
237
+ display: flex;
238
+ align-items: center;
239
+ gap: var(--cometchat-padding-2, 8px);
240
+ border: 1px solid var(--cometchat-border-color-default, #E8E8E8);
241
+ padding: var(--cometchat-padding-1, 4px);
242
+ background: var(--cometchat-background-color-03, #F5F5F5);
243
+ border-radius: var(--cometchat-radius-max, 1000px);
244
+ height: 32px;
245
+ box-sizing: border-box;
246
+ flex-shrink: 0;
247
+ }
248
+
249
+ .cometchat-users__selected-preview-chip .cometchat-avatar {
250
+ width: 24px;
251
+ height: 24px;
252
+ flex-shrink: 0;
253
+ }
254
+ .cometchat-users__selected-preview-chip .cometchat-avatar .cometchat-avatar__text {
255
+ font: var( --cometchat-font-caption1-bold);
256
+ }
257
+
258
+ .cometchat-users__selected-preview-chip-name {
259
+ color: var(--cometchat-text-color-primary, #141414);
260
+ font: var(--cometchat-font-body-medium);
261
+ max-width: 48px;
262
+ white-space: nowrap;
263
+ overflow: hidden;
264
+ text-overflow: ellipsis;
265
+ }
266
+
267
+ .cometchat-users__selected-preview-chip-close {
268
+ display: flex;
269
+ align-items: center;
270
+ justify-content: center;
271
+ width: 16px;
272
+ height: 16px;
273
+ padding: 0;
274
+ border: none;
275
+ background: transparent;
276
+ cursor: pointer;
277
+ flex-shrink: 0;
278
+ }
279
+
280
+ .cometchat-users__selected-preview-chip-close img {
281
+ width: 16px;
282
+ height: 16px;
283
+ opacity: 0.6;
284
+ transition: opacity 0.2s;
285
+ }
286
+
287
+ .cometchat-users__selected-preview-chip-close:hover img {
288
+ opacity: 1;
289
+ }
290
+
291
+ .cometchat-users__selected-preview-chip-close-button {
292
+ border: none;
293
+ background: none;
294
+ cursor: pointer;
295
+ user-select: none;
296
+ flex-shrink: 0;
297
+ }
298
+
299
+ .cometchat-users__selected-preview-chip-close-button .cometchat-button {
300
+ background: transparent;
301
+ border: none;
302
+ border-radius: 0;
303
+ padding: 0;
304
+ margin: 0;
305
+ height: fit-content;
306
+ width: fit-content;
307
+ }
308
+
309
+ .cometchat-users__selected-preview-chip-close-button .cometchat-button .cometchat-button__icon {
310
+ height: 24px;
311
+ width: 24px;
312
+ background: var(--cometchat-icon-color-secondary);
160
313
  }
@@ -30,7 +30,7 @@
30
30
 
31
31
 
32
32
  .cometchat-sticker-keyboard__tab{
33
- padding: var(--cometchat-padding-1,4px);
33
+ padding: var(--cometchat-padding-1, 4px);
34
34
  }
35
35
  .cometchat-sticker-keyboard__tab-active{
36
36
  border-bottom: 2px solid var(--cometchat-primary-color, #6852D6);
@@ -5,6 +5,8 @@ interface CheckboxProps {
5
5
  onCheckBoxValueChanged: (input: {
6
6
  checked: boolean;
7
7
  labelText: string | undefined;
8
+ shiftKey?: boolean;
9
+ metaKey?: boolean;
8
10
  }) => void;
9
11
  }
10
12
  declare const CometChatCheckbox: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,14 @@
1
- import { ChangeEvent } from "react";
1
+ import { ChangeEvent, MouseEvent } from "react";
2
2
  export declare const useCometChatCheckbox: ({ checked, onCheckBoxValueChanged }: {
3
3
  checked?: boolean | undefined;
4
4
  onCheckBoxValueChanged?: ((input: {
5
5
  checked: boolean;
6
6
  labelText: string | undefined;
7
+ shiftKey?: boolean;
8
+ metaKey?: boolean;
7
9
  }) => void) | undefined;
8
10
  }) => {
9
11
  isChecked: boolean;
10
12
  updateCheckbox: (event: ChangeEvent<HTMLInputElement>) => void;
13
+ handleClick: (event: MouseEvent<HTMLInputElement>) => void;
11
14
  };
@@ -6,6 +6,8 @@ interface ListItemProps {
6
6
  title: string;
7
7
  onListItemClicked?: (input: {
8
8
  id?: string;
9
+ shiftKey?: boolean;
10
+ metaKey?: boolean;
9
11
  }) => void;
10
12
  menuView?: ReactNode;
11
13
  subtitleView?: ReactNode;
@@ -3,6 +3,8 @@ interface ICometChatListItem {
3
3
  id?: string;
4
4
  onListItemClicked?: (input: {
5
5
  id: string;
6
+ shiftKey?: boolean;
7
+ metaKey?: boolean;
6
8
  }) => void;
7
9
  menuRef: React.RefObject<HTMLDivElement | null>;
8
10
  }
@@ -161,6 +161,16 @@ export interface UsersProps {
161
161
  * @defaultValue `false`
162
162
  */
163
163
  showScrollbar?: boolean;
164
+ /**
165
+ * Shows a preview of selected users when selectionMode is multiple.
166
+ *
167
+ * @remarks
168
+ * When enabled, displays a preview section with chips showing selected users.
169
+ * Each chip displays avatar, name, and a close button to remove the user.
170
+ *
171
+ * @defaultValue `false`
172
+ */
173
+ showSelectedUsersPreview?: boolean;
164
174
  }
165
175
  type State = {
166
176
  searchText: string;
@@ -46,7 +46,7 @@ export declare class MessageUtils {
46
46
  * @param {MessageBubbleAlignment} alignment - The alignment of the message bubble (left or right).
47
47
  * @returns {JSX.Element} - The message bubble component.
48
48
  */
49
- getMessageBubble(baseMessage: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject, hideReceipts?: boolean, textFormatters?: CometChatTextFormatter[]): any;
49
+ getMessageBubble(baseMessage: CometChat.BaseMessage, template: CometChatMessageTemplate, alignment: MessageBubbleAlignment, messageSentAtDateTimeFormat?: CalendarObject, hideReceipts?: boolean, textFormatters?: CometChatTextFormatter[], replyView?: JSX.Element | null): any;
50
50
  /**
51
51
  *
52
52
  * @param {(CometChat.User | CometChat.GroupMember | any)} user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cometchat/chat-uikit-react",
3
- "version": "6.3.7",
3
+ "version": "6.3.8",
4
4
  "description": "Ready-to-use Chat UI Components for React(Javascript/Web)",
5
5
  "author": "CometChat",
6
6
  "exports": {