@tellescope/chat 0.0.90 → 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.map +1 -1
- package/lib/cjs/chat.js +10 -1
- package/lib/cjs/chat.js.map +1 -1
- package/lib/esm/chat.d.ts.map +1 -1
- package/lib/esm/chat.js +10 -1
- package/lib/esm/chat.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/chat.tsx +14 -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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
51
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
|
|
@@ -446,8 +444,8 @@ export const SplitChat = ({ session, type, style=defaultSplitChatStyle } : Split
|
|
|
446
444
|
<Flex row style={style} flex={1}>
|
|
447
445
|
<Flex column flex={1}>
|
|
448
446
|
{type === 'user'
|
|
449
|
-
? <UsersConversations userId={session.userInfo.id} selectedRoom={selectedRoom} onRoomSelect={setSelectedRoom}/>
|
|
450
|
-
: <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} />
|
|
451
449
|
}
|
|
452
450
|
</Flex>
|
|
453
451
|
|