@tellescope/chat 0.0.88 → 0.0.91
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/lib/cjs/chat.d.ts +3 -1
- package/lib/cjs/chat.d.ts.map +1 -1
- package/lib/cjs/chat.js +12 -3
- package/lib/cjs/chat.js.map +1 -1
- package/lib/esm/chat.d.ts +3 -1
- package/lib/esm/chat.d.ts.map +1 -1
- package/lib/esm/chat.js +12 -3
- package/lib/esm/chat.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/chat.tsx +19 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/chat",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.91",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"@fontsource/roboto": "^4.5.1",
|
|
34
34
|
"@mui/icons-material": "^5.0.1",
|
|
35
35
|
"@mui/material": "^5.0.2",
|
|
36
|
-
"@tellescope/constants": "^0.0.
|
|
37
|
-
"@tellescope/react-components": "^0.0.
|
|
38
|
-
"@tellescope/sdk": "^0.0.
|
|
39
|
-
"@tellescope/types-client": "^0.0.
|
|
40
|
-
"@tellescope/types-models": "^0.0.
|
|
41
|
-
"@tellescope/types-utilities": "^0.0.
|
|
42
|
-
"@tellescope/utilities": "^0.0.
|
|
36
|
+
"@tellescope/constants": "^0.0.91",
|
|
37
|
+
"@tellescope/react-components": "^0.0.91",
|
|
38
|
+
"@tellescope/sdk": "^0.0.91",
|
|
39
|
+
"@tellescope/types-client": "^0.0.91",
|
|
40
|
+
"@tellescope/types-models": "^0.0.91",
|
|
41
|
+
"@tellescope/types-utilities": "^0.0.91",
|
|
42
|
+
"@tellescope/utilities": "^0.0.91",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
44
44
|
"@typescript-eslint/parser": "^4.33.0",
|
|
45
45
|
"eslint": "^7.32.0",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"nodemon": "^2.0.13"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"react": "^17.0.
|
|
51
|
-
"react-dom": "^17.0.
|
|
50
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
51
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "35b6fe203cdcc4914fbc423ef1743d1bf6bf3f5f",
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
}
|
package/src/chat.tsx
CHANGED
|
@@ -331,20 +331,18 @@ const PreviewWithData = ({ PreviewComponent=ConversationPreview, ...props }: Omi
|
|
|
331
331
|
interface ConversationsProps extends SidebarInfo {
|
|
332
332
|
rooms: LoadedData<ChatRoom[]>;
|
|
333
333
|
}
|
|
334
|
-
export const Conversations = ({ rooms, selectedRoom, onRoomSelect, PreviewComponent=ConversationPreview, style, selectedItemStyle, itemStyle } : ConversationsProps) =>
|
|
335
|
-
|
|
336
|
-
<
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
)
|
|
347
|
-
}
|
|
334
|
+
export const Conversations = ({ rooms, selectedRoom, onRoomSelect, PreviewComponent=ConversationPreview, style, selectedItemStyle, itemStyle } : ConversationsProps) => (
|
|
335
|
+
<LoadingLinear data={rooms} render={rooms =>
|
|
336
|
+
<List items={[...rooms].sort((r1, r2) => new Date(r2.updatedAt).getTime() - new Date(r1.updatedAt).getTime() )}
|
|
337
|
+
style={style ?? defaultSidebarStyle} onClick={r => onRoomSelect(r.id)}
|
|
338
|
+
render={(room, { onClick, index }) =>
|
|
339
|
+
<PreviewWithData key={room.id} room={room} onClick={onClick} selected={selectedRoom === room.id}
|
|
340
|
+
selectedStyle={selectedItemStyle} style={itemStyle} PreviewComponent={PreviewComponent}
|
|
341
|
+
/>
|
|
342
|
+
}
|
|
343
|
+
/>
|
|
344
|
+
}/>
|
|
345
|
+
)
|
|
348
346
|
|
|
349
347
|
|
|
350
348
|
// deprecated while Conversations relies on useResolvedSession
|
|
@@ -363,6 +361,8 @@ interface SendMessage_T {
|
|
|
363
361
|
|
|
364
362
|
// web only
|
|
365
363
|
sendOnEnterPress?: boolean,
|
|
364
|
+
multiline?: boolean,
|
|
365
|
+
maxRows?: number,
|
|
366
366
|
}
|
|
367
367
|
export const SendMessage = ({
|
|
368
368
|
roomId,
|
|
@@ -372,6 +372,8 @@ export const SendMessage = ({
|
|
|
372
372
|
placeholderText="Enter a message",
|
|
373
373
|
style={},
|
|
374
374
|
sendOnEnterPress,
|
|
375
|
+
multiline,
|
|
376
|
+
maxRows,
|
|
375
377
|
}: SendMessage_T) => {
|
|
376
378
|
const [message, setMessage] = useState('')
|
|
377
379
|
const [sending, setSending] = useState(false)
|
|
@@ -408,6 +410,7 @@ export const SendMessage = ({
|
|
|
408
410
|
<Flex column flex={1}>
|
|
409
411
|
<TextField variant="outlined" value={message} onChange={setMessage} disabled={sending}
|
|
410
412
|
aria-label="Enter a message"
|
|
413
|
+
multiline={multiline} maxRows={maxRows}
|
|
411
414
|
placeholder={placeholderText}
|
|
412
415
|
onFocus={() => setChatFocused(true)}
|
|
413
416
|
onBlur={() => setChatFocused(false)}
|
|
@@ -441,8 +444,8 @@ export const SplitChat = ({ session, type, style=defaultSplitChatStyle } : Split
|
|
|
441
444
|
<Flex row style={style} flex={1}>
|
|
442
445
|
<Flex column flex={1}>
|
|
443
446
|
{type === 'user'
|
|
444
|
-
? <UsersConversations userId={session.userInfo.id} selectedRoom={selectedRoom} onRoomSelect={setSelectedRoom}/>
|
|
445
|
-
: <EndusersConversations selectedRoom={selectedRoom} enduserId={session.userInfo.id} onRoomSelect={setSelectedRoom}/>
|
|
447
|
+
? <UsersConversations userId={session.userInfo.id} selectedRoom={selectedRoom} onRoomSelect={setSelectedRoom} />
|
|
448
|
+
: <EndusersConversations selectedRoom={selectedRoom} enduserId={session.userInfo.id} onRoomSelect={setSelectedRoom} />
|
|
446
449
|
}
|
|
447
450
|
</Flex>
|
|
448
451
|
|