@tellescope/chat 0.0.90 → 0.0.93

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/chat",
3
- "version": "0.0.90",
3
+ "version": "0.0.93",
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.90",
37
- "@tellescope/react-components": "^0.0.90",
38
- "@tellescope/sdk": "^0.0.90",
39
- "@tellescope/types-client": "^0.0.90",
40
- "@tellescope/types-models": "^0.0.90",
41
- "@tellescope/types-utilities": "^0.0.90",
42
- "@tellescope/utilities": "^0.0.90",
36
+ "@tellescope/constants": "^0.0.93",
37
+ "@tellescope/react-components": "^0.0.93",
38
+ "@tellescope/sdk": "^0.0.93",
39
+ "@tellescope/types-client": "^0.0.93",
40
+ "@tellescope/types-models": "^0.0.93",
41
+ "@tellescope/types-utilities": "^0.0.93",
42
+ "@tellescope/utilities": "^0.0.93",
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": "9aa8e9373e1484523baf8f43a5c3a7e0b6adb929",
53
+ "gitHead": "d3eff2028a37b82f57a7773d1fc3101a79b569c8",
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
- return (
336
- <LoadingLinear data={rooms} render={rooms =>
337
- <List items={rooms.sort((r1, r2) => new Date(r2.updatedAt).getTime() - new Date(r1.updatedAt).getTime() )}
338
- style={style ?? defaultSidebarStyle} onClick={r => onRoomSelect(r.id)}
339
- render={(room, { onClick, index }) =>
340
- <PreviewWithData key={room.id} room={room} onClick={onClick} selected={selectedRoom === room.id}
341
- selectedStyle={selectedItemStyle} style={itemStyle} PreviewComponent={PreviewComponent}
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