@tellescope/chat 0.0.96 → 1.0.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.
- package/lib/cjs/chat.d.ts +1 -2
- package/lib/cjs/chat.d.ts.map +1 -1
- package/lib/cjs/chat.js +32 -28
- package/lib/cjs/chat.js.map +1 -1
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/index.native.js +5 -1
- package/lib/cjs/index.native.js.map +1 -1
- package/lib/esm/chat.d.ts +1 -2
- package/lib/esm/chat.d.ts.map +1 -1
- package/lib/esm/chat.js +8 -8
- package/lib/esm/chat.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/chat.tsx +8 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/chat",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
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": "^1.0.0",
|
|
37
|
+
"@tellescope/react-components": "^1.0.0",
|
|
38
|
+
"@tellescope/sdk": "^1.0.0",
|
|
39
|
+
"@tellescope/types-client": "^1.0.0",
|
|
40
|
+
"@tellescope/types-models": "^1.0.0",
|
|
41
|
+
"@tellescope/types-utilities": "^1.0.0",
|
|
42
|
+
"@tellescope/utilities": "^1.0.0",
|
|
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": "24789617c7194a1c315d209a8e5f71d63e1c2665",
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
}
|
package/src/chat.tsx
CHANGED
|
@@ -134,7 +134,7 @@ export const Message = ({
|
|
|
134
134
|
const session = useResolvedSession()
|
|
135
135
|
const chatUserId = session.userInfo.id
|
|
136
136
|
|
|
137
|
-
const [displayInfo] = useChatRoomDisplayInfo(message.roomId
|
|
137
|
+
const [displayInfo] = useChatRoomDisplayInfo(message.roomId)
|
|
138
138
|
const displayInfoLookup = value_is_loaded(displayInfo) ? displayInfo.value : {} as ChatRoomDisplayInfo
|
|
139
139
|
|
|
140
140
|
// deep copy so that the override of background color doesn't affect other messages
|
|
@@ -319,7 +319,7 @@ const ConversationPreview = ({ onClick, selected, room, style, displayInfo, sele
|
|
|
319
319
|
|
|
320
320
|
const PreviewWithData = ({ PreviewComponent=ConversationPreview, ...props }: Omit<ConversationPreviewProps, 'displayInfo'> & Pick<SidebarInfo, 'PreviewComponent'>) => {
|
|
321
321
|
const session = useResolvedSession()
|
|
322
|
-
const [displayInfo] = useChatRoomDisplayInfo(props.room.id
|
|
322
|
+
const [displayInfo] = useChatRoomDisplayInfo(props.room.id)
|
|
323
323
|
|
|
324
324
|
return (
|
|
325
325
|
<PreviewComponent displayInfo={value_is_loaded(displayInfo) ? displayInfo.value : {} }
|
|
@@ -346,13 +346,12 @@ export const Conversations = ({ rooms, selectedRoom, onRoomSelect, PreviewCompon
|
|
|
346
346
|
|
|
347
347
|
|
|
348
348
|
// deprecated while Conversations relies on useResolvedSession
|
|
349
|
-
export const EndusersConversations = ({ enduserId, ...p } : SidebarInfo & { enduserId: string }) => <Conversations {...p} rooms={useChatRooms(
|
|
349
|
+
export const EndusersConversations = ({ enduserId, ...p } : SidebarInfo & { enduserId: string }) => <Conversations {...p} rooms={useChatRooms()[0]} />
|
|
350
350
|
|
|
351
351
|
// deprecated while Conversations relies on useResolvedSession
|
|
352
|
-
export const UsersConversations = ({ userId, ...p } : SidebarInfo & { userId: string }) => <Conversations {...p} rooms={useChatRooms(
|
|
352
|
+
export const UsersConversations = ({ userId, ...p } : SidebarInfo & { userId: string }) => <Conversations {...p} rooms={useChatRooms()[0]}/>
|
|
353
353
|
|
|
354
354
|
interface SendMessage_T {
|
|
355
|
-
type: SessionType,
|
|
356
355
|
roomId: string,
|
|
357
356
|
onNewMessage?: (m: ChatMessage) => void;
|
|
358
357
|
placeholderText?: string;
|
|
@@ -366,7 +365,6 @@ interface SendMessage_T {
|
|
|
366
365
|
}
|
|
367
366
|
export const SendMessage = ({
|
|
368
367
|
roomId,
|
|
369
|
-
type,
|
|
370
368
|
Icon=SendIcon,
|
|
371
369
|
onNewMessage,
|
|
372
370
|
placeholderText="Enter a message",
|
|
@@ -381,7 +379,7 @@ export const SendMessage = ({
|
|
|
381
379
|
const [disabled, setDisabled] = useState(false)
|
|
382
380
|
const [chatFocused, setChatFocused] = React.useState(false)
|
|
383
381
|
|
|
384
|
-
const [, { createElement: createMessage }] = useChats(roomId
|
|
382
|
+
const [, { createElement: createMessage }] = useChats(roomId)
|
|
385
383
|
|
|
386
384
|
useEffect(() => {
|
|
387
385
|
if (!chatFocused) return
|
|
@@ -438,7 +436,7 @@ interface SplitChat_T {
|
|
|
438
436
|
}
|
|
439
437
|
export const SplitChat = ({ session, type, style=defaultSplitChatStyle } : SplitChat_T & Styled) => {
|
|
440
438
|
const [selectedRoom, setSelectedRoom] = useState('')
|
|
441
|
-
const [messages] = useChats(selectedRoom
|
|
439
|
+
const [messages] = useChats(selectedRoom)
|
|
442
440
|
|
|
443
441
|
return (
|
|
444
442
|
<Flex row style={style} flex={1}>
|
|
@@ -453,15 +451,11 @@ export const SplitChat = ({ session, type, style=defaultSplitChatStyle } : Split
|
|
|
453
451
|
{selectedRoom &&
|
|
454
452
|
<>
|
|
455
453
|
<Flex row flex={8}>
|
|
456
|
-
<Messages messages={messages} chatUserId={session.userInfo.id}
|
|
457
|
-
headerProps={{
|
|
458
|
-
|
|
459
|
-
}}
|
|
460
|
-
/>
|
|
454
|
+
<Messages messages={messages} chatUserId={session.userInfo.id} />
|
|
461
455
|
</Flex>
|
|
462
456
|
|
|
463
457
|
<Flex row flex={1} style={{ marginLeft: 10, marginRight: 10 }}>
|
|
464
|
-
<SendMessage
|
|
458
|
+
<SendMessage roomId={selectedRoom} />
|
|
465
459
|
</Flex>
|
|
466
460
|
</>
|
|
467
461
|
}
|