@tencent-rtc/mcp 1.0.7 → 1.0.9
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/README.md +4 -4
- package/package.json +1 -1
- package/resource/doc/chatuikit/react/components/chat.md +44 -0
- package/resource/doc/chatuikit/react/components/chatheader.md +189 -0
- package/resource/doc/chatuikit/react/components/conversation-list.md +1017 -0
- package/resource/doc/chatuikit/react/components/message-input.md +950 -0
- package/resource/doc/chatuikit/react/components/message-list.md +485 -0
- package/resource/doc/chatuikit/react/components/tuikit.md +80 -0
- package/resource/doc/chatuikit/react/create-group.md +23 -0
- package/resource/doc/chatuikit/react/login.md +26 -0
- package/resource/doc/chatuikit/vue/components/avatar.md +137 -0
- package/resource/doc/chatuikit/vue/components/chat.md +42 -0
- package/resource/doc/chatuikit/vue/components/chatheader.md +189 -0
- package/resource/doc/chatuikit/vue/components/component-list.md +102 -0
- package/resource/doc/chatuikit/vue/components/conversation-list.md +765 -0
- package/resource/doc/chatuikit/vue/components/message-input.md +1272 -0
- package/resource/doc/chatuikit/vue/components/message-list.md +662 -0
- package/resource/doc/chatuikit/vue/components/tuikit.md +45 -0
- package/resource/doc/chatuikit/vue/components/userpicker.md +315 -0
- package/resource/doc/chatuikit/vue/create-group.md +25 -0
- package/resource/doc/chatuikit/vue/integration.md +256 -0
- package/resource/doc/chatuikit/vue/login.md +31 -0
- package/tools/call/get-native-call-integration.js +35 -0
- package/tools/call/get-native-call-integration.js.map +1 -0
- package/tools/call/get-web-call-integration.js +35 -0
- package/tools/call/get-web-call-integration.js.map +1 -0
- package/tools/chat/create-group.js +30 -0
- package/tools/chat/create-group.js.map +1 -0
- package/tools/chat/get-native-chat-integration.js +34 -0
- package/tools/chat/get-native-chat-integration.js.map +1 -0
- package/tools/chat/get-web-chat-component-detail.js +8 -5
- package/tools/chat/get-web-chat-component-detail.js.map +1 -1
- package/tools/chat/get-web-chat-integration.js +37 -0
- package/tools/chat/get-web-chat-integration.js.map +1 -0
- package/tools/chat/get-web-chat-uikit-login.js +30 -0
- package/tools/chat/get-web-chat-uikit-login.js.map +1 -0
- package/tools/common/present-framework-choice.js +9 -19
- package/tools/common/present-framework-choice.js.map +1 -1
- package/tools/common/record-prompt.js +3 -4
- package/tools/common/record-prompt.js.map +1 -1
- package/tools/common/record-result.js +7 -7
- package/tools/common/record-result.js.map +1 -1
- package/tools/index.js +12 -8
- package/tools/index.js.map +1 -1
- package/utils/handle-component-name.js +12 -0
- package/utils/handle-component-name.js.map +1 -0
- package/utils/handle-framework.js +9 -0
- package/utils/handle-framework.js.map +1 -0
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
# Component Overview
|
|
2
|
+
|
|
3
|
+
The ConversationList component is responsible for rendering the conversation list, including features such as search, create, pin to top, and delete.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Component composition
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
The ConversationList component includes the following content:
|
|
12
|
+
-**Conversation Search**
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
-**ConversationList UI**: Session list container
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
- **ConversationPreview**: Displays a single session.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
- **ConversationActions**: Session operation
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Basic Usage
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
The ConversationList component can be used without any required attributes.
|
|
30
|
+
``` typescript
|
|
31
|
+
<template>
|
|
32
|
+
<UIKitProvider>
|
|
33
|
+
<ConversationList />
|
|
34
|
+
</UIKitProvider>
|
|
35
|
+
</template>
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
import { UIKitProvider, ConversationList } from '@tencentcloud/chat-uikit-vue3';
|
|
38
|
+
</script>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Custom component
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
ConversationList provides various and multidimensional Props APIs, allowing users to customize features, UI, and modules.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
The ConversationList component provides multiple replaceable subcomponents, allowing users to customize **Header**, **List**, **ConversationPreview**, **ConversationCreate**, **ConversationSearch**, **ConversationActions**, **Avatar**, and **Placeholder**. Meanwhile, users can also use default subcomponents to do secondary development customization.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Feature switch
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
By setting the `enableSearch`, `enableCreate`, and `enableActions` parameters, you can flexibly control the display of conversation search, session creation, and conversation action features in **ConversationList**.
|
|
55
|
+
``` typescript
|
|
56
|
+
<ConversationList :enableSearch="false" />
|
|
57
|
+
```
|
|
58
|
+
``` typescript
|
|
59
|
+
<ConversationList :enableCreate="false" />
|
|
60
|
+
```
|
|
61
|
+
``` typescript
|
|
62
|
+
<ConversationList :enableActions="false" />
|
|
63
|
+
```
|
|
64
|
+
<table>
|
|
65
|
+
<tr>
|
|
66
|
+
<td rowspan="1" colSpan="1" >`enableSearch="false"`</td>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<td rowspan="1" colSpan="1" >`enableCreate="false"`</td>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<td rowspan="1" colSpan="1" >`enableActions="false"`</td>
|
|
73
|
+
</tr>
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
<tr>
|
|
77
|
+
<td rowspan="1" colSpan="1" ><br><img src="https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/a6c293a7824a11f0ac3c525400e889b2.png" alt="description" width="50%" style="display: block; margin: 0 auto;"></td>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<td rowspan="1" colSpan="1" ><br><img src="https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/1794aa15824b11f0ac3c525400e889b2.png" alt="description" width="50%" style="display: block; margin: 0 auto;"></td>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<td rowspan="1" colSpan="1" ><br><img src="https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027116646/41d87b22824b11f0b3fe525400bf7822.png" alt="description" width="50%" style="display: block; margin: 0 auto;"></td>
|
|
84
|
+
</tr>
|
|
85
|
+
</table>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Data filtering and sorting
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
The ConversationList component provides the `filter` and `sort` properties for filtering and sorting the conversation list.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Filter Conversations
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
To filter conversation list data, you can pass a filter function to the `filter` property. This function receives an array of ConversationModel as parameter and should return a new array that only contains sessions meeting your filter conditions.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
**Example: Show only sessions with unread messages**
|
|
103
|
+
``` typescript
|
|
104
|
+
<template>
|
|
105
|
+
<UIKitProvider>
|
|
106
|
+
<ConversationList
|
|
107
|
+
:filter="(conversationList: ConversationModel[]) =>
|
|
108
|
+
conversationList.filter(conversation => conversation.unreadCount > 0)" />
|
|
109
|
+
</UIKitProvider>
|
|
110
|
+
</template>
|
|
111
|
+
<script setup lang="ts">
|
|
112
|
+
import { UIKitProvider, ConversationList } from '@tencentcloud/chat-uikit-vue3';
|
|
113
|
+
import type { ConversationModel } from '@tencentcloud/chat-uikit-vue3';
|
|
114
|
+
</script>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Sort Conversations
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
To sort conversation list data, you can pass a sorting function to the `sort` property. This function receives an array of ConversationModel as parameter and should return a new array with sessions sorted by your sorting criteria.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
Sort by latest news time in reverse order
|
|
125
|
+
``` typescript
|
|
126
|
+
<template>
|
|
127
|
+
<UIKitProvider>
|
|
128
|
+
<ConversationList
|
|
129
|
+
:sort="(conversationList: ConversationModel[]) =>
|
|
130
|
+
conversationList.sort(
|
|
131
|
+
(a, b) => (+(b?.lastMessage?.lastTime || 0)) - (+(a?.lastMessage?.lastTime || 0)),
|
|
132
|
+
)" />
|
|
133
|
+
</UIKitProvider>
|
|
134
|
+
</template>
|
|
135
|
+
<script setup lang="ts">
|
|
136
|
+
import { UIKitProvider, ConversationList } from '@tencentcloud/chat-uikit-vue3';
|
|
137
|
+
import type { ConversationModel } from '@tencentcloud/chat-uikit-vue3';
|
|
138
|
+
</script>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### Custom actionsConfig
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
You can customize session menu options via [actionsConfig](https://write.woa.com/document/186960379083898880).
|
|
146
|
+
``` typescript
|
|
147
|
+
<template>
|
|
148
|
+
<UIKitProvider>
|
|
149
|
+
<ConversationList
|
|
150
|
+
:actionsConfig="{
|
|
151
|
+
enablePin: false,
|
|
152
|
+
onConversationDelete: (conversation: ConversationModel) =>
|
|
153
|
+
{ console.log('Delete conversation success'); },
|
|
154
|
+
customConversationActions: {
|
|
155
|
+
'custom-actions-1': {
|
|
156
|
+
label: 'custom-actions',
|
|
157
|
+
onClick: (conversation: ConversationModel) => { console.log(conversation); },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
}"/>
|
|
161
|
+
</UIKitProvider>
|
|
162
|
+
</template>
|
|
163
|
+
<script setup lang="ts">
|
|
164
|
+
import { UIKitProvider, ConversationList } from '@tencentcloud/chat-uikit-vue3';
|
|
165
|
+
import type { ConversationModel } from '@tencentcloud/chat-uikit-vue3';
|
|
166
|
+
</script>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Custom Placeholder
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
`ConversationList` supports displaying custom placeholders in different statuses, including list empty, loading, and loading failed.
|
|
176
|
+
- `PlaceholderEmpty`: Displayed when the list is empty.
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
- `PlaceholderLoading`: Displayed when loading.
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
- `PlaceholderError`: Displayed when loading failed.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
**Example: Custom empty list placeholder**
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
1. Create a custom component **`MyEmptyPlaceholder.vue`**
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
``` typescript
|
|
194
|
+
<template>
|
|
195
|
+
<div>
|
|
196
|
+
Custom PlaceholderEmptyList
|
|
197
|
+
</div>
|
|
198
|
+
</template>
|
|
199
|
+
```
|
|
200
|
+
2. For use in **`ConversationList`**.
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
``` typescript
|
|
204
|
+
<template>
|
|
205
|
+
<UIKitProvider>
|
|
206
|
+
<ConversationList
|
|
207
|
+
:PlaceholderEmptyList="MyEmptyPlaceholder" />
|
|
208
|
+
</UIKitProvider>
|
|
209
|
+
</template>
|
|
210
|
+
<script setup lang="ts">
|
|
211
|
+
import { UIKitProvider, ConversationList } from '@tencentcloud/chat-uikit-vue3';
|
|
212
|
+
import MyEmptyPlaceholder from "./MyEmptyPlaceholder.vue";
|
|
213
|
+
</script>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
### Custom Header
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
**ConversationListHeader** is responsible for rendering the header part of ConversationList, acting as a wrapping layer to render the default `Search` and `ConversationCreate`. You can customize it by importing `left`, `right` and other attributes. Meanwhile, you can also customize the entire component.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
#### Props
|
|
224
|
+
<table>
|
|
225
|
+
<tr>
|
|
226
|
+
<td rowspan="1" colSpan="1" >**Parameter Name**</td>
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
<td rowspan="1" colSpan="1" >**Type**</td>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<td rowspan="1" colSpan="1" >**Default Value**</td>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
<td rowspan="1" colSpan="1" >**Description**</td>
|
|
236
|
+
</tr>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
<tr>
|
|
240
|
+
<td rowspan="1" colSpan="1" >children</td>
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
<td rowspan="1" colSpan="1" >Header center component of the custom session list.<br>Default imports `<Search>` and `<ConversationCreate>`.</td>
|
|
250
|
+
</tr>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
<tr>
|
|
254
|
+
<td rowspan="1" colSpan="1" >left</td>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<td rowspan="1" colSpan="1" >Left-side component of the custom session list header.</td>
|
|
264
|
+
</tr>
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
<tr>
|
|
268
|
+
<td rowspan="1" colSpan="1" >right</td>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
<td rowspan="1" colSpan="1" >Right-side component of the custom session list header.</td>
|
|
278
|
+
</tr>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<tr>
|
|
282
|
+
<td rowspan="1" colSpan="1" >className</td>
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<td rowspan="1" colSpan="1" >Specify the CSS custom name of the root element class.</td>
|
|
292
|
+
</tr>
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
<tr>
|
|
296
|
+
<td rowspan="1" colSpan="1" >style</td>
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
<td rowspan="1" colSpan="1" >CSSProperties</td>
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<td rowspan="1" colSpan="1" >Specify the custom style of the root element.</td>
|
|
306
|
+
</tr>
|
|
307
|
+
</table>
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
Implement a simplified conversation grouping feature
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
Filter conversations by All, unread conversation, one-on-one chat session, and group chat. Click different group buttons to execute different filtering rules.
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
[App.vue]
|
|
323
|
+
``` typescript
|
|
324
|
+
<template>
|
|
325
|
+
<UIKitProvider>
|
|
326
|
+
<ConversationList
|
|
327
|
+
:Header="CustomConversationListHeader"
|
|
328
|
+
:filter="conversationFilter"
|
|
329
|
+
</UIKitProvider>
|
|
330
|
+
</template>
|
|
331
|
+
<script setup lang="ts">
|
|
332
|
+
import { UIKitProvider, ConversationList } from '@tencentcloud/chat-uikit-vue3';
|
|
333
|
+
import type { ConversationModel } from '@tencentcloud/chat-uikit-vue3';
|
|
334
|
+
import CustomConversationListHeader from "./CustomConversationListHeader.vue";
|
|
335
|
+
const conversationFilter = ref<((conversations: ConversationModel[]) => ConversationModel[]) | undefined>(undefined);
|
|
336
|
+
const handleFilterChange = (filter: (conversations: ConversationModel[]) => ConversationModel[]) => {
|
|
337
|
+
conversationFilter.value = filter;
|
|
338
|
+
};
|
|
339
|
+
provide('setConversationFilter', handleFilterChange);
|
|
340
|
+
</script>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
[CustomConversationListHeader.vue]
|
|
345
|
+
``` typescript
|
|
346
|
+
<template>
|
|
347
|
+
<div class="customHeader">
|
|
348
|
+
<div class="filterTabs">
|
|
349
|
+
<button
|
|
350
|
+
v-for="(label, key) in filterLabels"
|
|
351
|
+
:key="key"
|
|
352
|
+
:class="[
|
|
353
|
+
'filterTab',
|
|
354
|
+
{ ['active']: activeFilter === key }
|
|
355
|
+
]"
|
|
356
|
+
@click="handleFilterClick(key as FilterType)"
|
|
357
|
+
>
|
|
358
|
+
{{ label }}
|
|
359
|
+
</button>
|
|
360
|
+
</div>
|
|
361
|
+
</div>
|
|
362
|
+
</template>
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
<script lang="ts" setup>
|
|
366
|
+
import { ref, inject } from 'vue';
|
|
367
|
+
import type { ConversationModel } from '@tencentcloud/chat-uikit-vue3';
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
type FilterType = 'All' | 'Unread' | 'C2C' | 'Group';
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
interface Props {
|
|
374
|
+
children?: any;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
defineProps<Props>();
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
const activeFilter = ref<FilterType>('All');
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
const filterLabels: Record<FilterType, string> = {
|
|
385
|
+
Create and bind policy Query instance Reset instance access password
|
|
386
|
+
Unread
|
|
387
|
+
C2C: 'One-on-one chat'
|
|
388
|
+
Group chat
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
const conversationGroupFilter: Record<string, (conversationList: ConversationModel[]) => ConversationModel[]> = {
|
|
393
|
+
All: (conversationList: ConversationModel[]) => conversationList,
|
|
394
|
+
Unread: (conversationList: ConversationModel[]) => conversationList?.filter((item: ConversationModel) => item.unreadCount > 0),
|
|
395
|
+
C2C: (conversationList: ConversationModel[]) => conversationList?.filter((item: ConversationModel) => item.type === 'C2C'),
|
|
396
|
+
Group: (conversationList: ConversationModel[]) => conversationList?.filter((item: ConversationModel) => item.type === 'GROUP'),
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
const setFilter = inject<(filter: any) => void>('setConversationFilter');
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
const handleFilterClick = (filterType: FilterType) => {
|
|
404
|
+
activeFilter.value = filterType;
|
|
405
|
+
const filterFn = conversationGroupFilter[filterType];
|
|
406
|
+
setFilter?.(filterFn);
|
|
407
|
+
};
|
|
408
|
+
</script>
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
<style lang="scss">
|
|
412
|
+
.customHeader {
|
|
413
|
+
padding: 8px 16px;
|
|
414
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
415
|
+
display: flex;
|
|
416
|
+
flex-direction: column;
|
|
417
|
+
gap: 12px;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
.filterTabs {
|
|
422
|
+
display: flex;
|
|
423
|
+
gap: 4px;
|
|
424
|
+
align-items: center;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
.filterTab {
|
|
429
|
+
position: relative;
|
|
430
|
+
display: flex;
|
|
431
|
+
align-items: center;
|
|
432
|
+
gap: 4px;
|
|
433
|
+
padding: 6px 12px;
|
|
434
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
435
|
+
border-radius: 16px;
|
|
436
|
+
background: transparent;
|
|
437
|
+
cursor: pointer;
|
|
438
|
+
font-size: 12px;
|
|
439
|
+
font-weight: 400;
|
|
440
|
+
color: #3b3d43;
|
|
441
|
+
transition: all 0.2s ease;
|
|
442
|
+
outline: none;
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
&.active {
|
|
446
|
+
border: 1px solid #1c66e5;
|
|
447
|
+
color: #1c66e5;
|
|
448
|
+
font-weight: 500;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
</style>
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
## Props
|
|
458
|
+
<table>
|
|
459
|
+
<tr>
|
|
460
|
+
<td rowspan="1" colSpan="1" >**Parameter Name**</td>
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
<td rowspan="1" colSpan="1" >**Type**</td>
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
<td rowspan="1" colSpan="1" >**Default Value**</td>
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
<td rowspan="1" colSpan="1" >**Description**</td>
|
|
470
|
+
</tr>
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
<tr>
|
|
474
|
+
<td rowspan="1" colSpan="1" >enableSearch</td>
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
<td rowspan="1" colSpan="1" >Boolean</td>
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
<td rowspan="1" colSpan="1" >true</td>
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
<td rowspan="1" colSpan="1" >Control whether to display the Conversation Search feature.</td>
|
|
484
|
+
</tr>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
<tr>
|
|
488
|
+
<td rowspan="1" colSpan="1" >enableCreate</td>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
<td rowspan="1" colSpan="1" >Boolean</td>
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
<td rowspan="1" colSpan="1" >true</td>
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
<td rowspan="1" colSpan="1" >Control whether to display the Create Session feature.</td>
|
|
498
|
+
</tr>
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
<tr>
|
|
502
|
+
<td rowspan="1" colSpan="1" >enableActions</td>
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
<td rowspan="1" colSpan="1" >Boolean</td>
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
<td rowspan="1" colSpan="1" >true</td>
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
<td rowspan="1" colSpan="1" >Control whether to display the conversation operation feature.</td>
|
|
512
|
+
</tr>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
<tr>
|
|
516
|
+
<td rowspan="1" colSpan="1" >actionsConfig</td>
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
<td rowspan="1" colSpan="1" >ConversationActionsConfig</td>
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
<td rowspan="1" colSpan="1" >Used for custom session operation configuration.</td>
|
|
526
|
+
</tr>
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
<tr>
|
|
530
|
+
<td rowspan="1" colSpan="1" >Header</td>
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
<td rowspan="1" colSpan="1" >Header</td>
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
<td rowspan="1" colSpan="1" >Custom Header component.</td>
|
|
540
|
+
</tr>
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
<tr>
|
|
544
|
+
<td rowspan="1" colSpan="1" >List</td>
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
<td rowspan="1" colSpan="1" >List</td>
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
<td rowspan="1" colSpan="1" >Custom session list component.</td>
|
|
554
|
+
</tr>
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
<tr>
|
|
558
|
+
<td rowspan="1" colSpan="1" >Preview</td>
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
<td rowspan="1" colSpan="1" >[ConversationPreview](https://write.woa.com/document/186960335138078720)</td>
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
<td rowspan="1" colSpan="1" >Session preview component.</td>
|
|
568
|
+
</tr>
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
<tr>
|
|
572
|
+
<td rowspan="1" colSpan="1" >ConversationCreate</td>
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
<td rowspan="1" colSpan="1" >ConversationCreate</td>
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
<td rowspan="1" colSpan="1" >Custom conversation component.</td>
|
|
582
|
+
</tr>
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
<tr>
|
|
586
|
+
<td rowspan="1" colSpan="1" >ConversationSearch</td>
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
<td rowspan="1" colSpan="1" >[Search](https://write.woa.com/document/186960410207154176)</td>
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
<td rowspan="1" colSpan="1" >Custom session search component.</td>
|
|
596
|
+
</tr>
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
<tr>
|
|
600
|
+
<td rowspan="1" colSpan="1" >ConversationActions</td>
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<td rowspan="1" colSpan="1" >[ConversationActions](https://write.woa.com/document/186960379083898880)</td>
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
<td rowspan="1" colSpan="1" >Custom Conversation Operation Component.</td>
|
|
610
|
+
</tr>
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
<tr>
|
|
614
|
+
<td rowspan="1" colSpan="1" >Avatar</td>
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
<td rowspan="1" colSpan="1" >Avatar</td>
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
<td rowspan="1" colSpan="1" >Custom avatar component.</td>
|
|
624
|
+
</tr>
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
<tr>
|
|
628
|
+
<td rowspan="1" colSpan="1" >PlaceholderEmptyList</td>
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
<td rowspan="1" colSpan="1" ><PlaceHolder type={PlaceHolderTypes.NO_CONVERSATIONS} /></td>
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
<td rowspan="1" colSpan="1" >Placeholder element when custom session list is empty.</td>
|
|
638
|
+
</tr>
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
<tr>
|
|
642
|
+
<td rowspan="1" colSpan="1" >PlaceholderLoading</td>
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
<td rowspan="1" colSpan="1" ><PlaceHolder type={PlaceHolderTypes.LOADING} /></td>
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
<td rowspan="1" colSpan="1" >Placeholder element during custom session list loading.</td>
|
|
652
|
+
</tr>
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
<tr>
|
|
656
|
+
<td rowspan="1" colSpan="1" >PlaceholderLoadError</td>
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
<td rowspan="1" colSpan="1" >Component</td>
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
<td rowspan="1" colSpan="1" ><PlaceHolder type={PlaceHolderTypes.WRONG} /></td>
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
<td rowspan="1" colSpan="1" >Placeholder element for custom session list load error.</td>
|
|
666
|
+
</tr>
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
<tr>
|
|
670
|
+
<td rowspan="1" colSpan="1" >filter</td>
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
<td rowspan="1" colSpan="1" >(conversationList: ConversationModel[]) => ConversationModel[]</td>
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
<td rowspan="1" colSpan="1" >Functions for filtering session list.</td>
|
|
680
|
+
</tr>
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
<tr>
|
|
684
|
+
<td rowspan="1" colSpan="1" >sort</td>
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
<td rowspan="1" colSpan="1" >(conversationList: ConversationModel[]) => ConversationModel[]</td>
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
<td rowspan="1" colSpan="1" >Functions for sorting session list.</td>
|
|
694
|
+
</tr>
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
<tr>
|
|
698
|
+
<td rowspan="1" colSpan="1" >onConversationSelect</td>
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
<td rowspan="1" colSpan="1" >(conversation: ConversationModel) => void;</td>
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
<td rowspan="1" colSpan="1" >Callback function when clicking a session, with the clicked conversation object as parameter.</td>
|
|
708
|
+
</tr>
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
<tr>
|
|
712
|
+
<td rowspan="1" colSpan="1" >onBeforeCreateConversation</td>
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
<td rowspan="1" colSpan="1" >(params: CreateParams) => CreateParams;</td>
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
<td rowspan="1" colSpan="1" >Custom action executed before session creation, with parameters required for creating a session.</td>
|
|
722
|
+
</tr>
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
<tr>
|
|
726
|
+
<td rowspan="1" colSpan="1" >onConversationCreate</td>
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
<td rowspan="1" colSpan="1" >(conversation: ConversationModel) => void;</td>
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
<td rowspan="1" colSpan="1" >Callback function after session creation, with the created session object as parameter.</td>
|
|
736
|
+
</tr>
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
<tr>
|
|
740
|
+
<td rowspan="1" colSpan="1" >className</td>
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
<td rowspan="1" colSpan="1" >Specify the CSS custom name of the root element class.</td>
|
|
750
|
+
</tr>
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
<tr>
|
|
754
|
+
<td rowspan="1" colSpan="1" >style</td>
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
<td rowspan="1" colSpan="1" >CSSProperties</td>
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
<td rowspan="1" colSpan="1" >Specify the custom style of the root element.</td>
|
|
764
|
+
</tr>
|
|
765
|
+
</table>
|