@tencentcloud/ai-desk-customer-vue 1.5.3 → 1.5.4

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/assets/language_arrow_down.svg +3 -0
  3. package/assets/language_check.svg +3 -0
  4. package/components/CustomerServiceChat/chat-header/index-web.vue +215 -13
  5. package/components/CustomerServiceChat/index-web.vue +86 -25
  6. package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +14 -4
  7. package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +19 -16
  8. package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +4 -4
  9. package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +10 -3
  10. package/components/CustomerServiceChat/message-list/index-web.vue +27 -14
  11. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +6 -1
  12. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/branch-pc.vue +20 -13
  13. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch/index.vue +1 -0
  14. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-robot-welcome.vue +73 -29
  15. package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-transfer-with-desc.vue +51 -0
  16. package/components/CustomerServiceChat/message-toolbar-button/index.vue +13 -2
  17. package/components/CustomerServiceChat/style/web.scss +2 -0
  18. package/constant.ts +21 -1
  19. package/interface.ts +15 -2
  20. package/locales/en/aidesk.ts +4 -4
  21. package/locales/en/index.ts +2 -2
  22. package/locales/en/time.ts +2 -2
  23. package/locales/fil/index.ts +2 -2
  24. package/locales/fil/time.ts +2 -2
  25. package/locales/id/index.ts +2 -2
  26. package/locales/id/time.ts +2 -2
  27. package/locales/ja/index.ts +2 -2
  28. package/locales/ja/time.ts +2 -2
  29. package/locales/ms/index.ts +2 -2
  30. package/locales/ms/time.ts +2 -2
  31. package/locales/ru/index.ts +2 -2
  32. package/locales/ru/time.ts +2 -2
  33. package/locales/th/index.ts +2 -2
  34. package/locales/th/time.ts +2 -2
  35. package/locales/vi/index.ts +2 -2
  36. package/locales/vi/time.ts +2 -2
  37. package/locales/zh_cn/aidesk.ts +1 -1
  38. package/locales/zh_cn/index.ts +2 -2
  39. package/locales/zh_cn/time.ts +2 -2
  40. package/locales/zh_tw/aidesk.ts +1 -1
  41. package/locales/zh_tw/index.ts +2 -2
  42. package/locales/zh_tw/time.ts +2 -2
  43. package/package.json +2 -1
  44. package/server.ts +21 -3
  45. package/utils/index.ts +6 -13
  46. package/utils/utils.ts +44 -3
@@ -10,7 +10,7 @@
10
10
  <div :class="['video-upload', !isPC && 'video-upload-h5']">
11
11
  <input
12
12
  ref="inputRef"
13
- :title="TUITranslateService.t('视频')"
13
+ :title="props.title || TUITranslateService.t('视频')"
14
14
  type="file"
15
15
  data-type="video"
16
16
  accept="video/*"
@@ -47,6 +47,9 @@ const props = defineProps({
47
47
  type: String,
48
48
  default: 'album',
49
49
  },
50
+ title: {
51
+ type: String,
52
+ },
50
53
  });
51
54
 
52
55
  const inputRef = ref();
@@ -63,7 +66,7 @@ const handleIcon = (): string => {
63
66
  };
64
67
 
65
68
  const handleTitle = (): string => {
66
- return TUITranslateService.t('视频');
69
+ return props.title || TUITranslateService.t('视频');
67
70
  };
68
71
 
69
72
  const onIconClick = () => {
@@ -74,7 +77,11 @@ const sendVideoInWeb = (e: any) => {
74
77
  if (e?.target?.files?.length <= 0) {
75
78
  return;
76
79
  }
77
- sendVideoMessage(e?.target);
80
+ const file = e?.target?.files[0];
81
+ if (!file || !file.size) {
82
+ return;
83
+ }
84
+ sendVideoMessage(e.target);
78
85
  e.target.value = '';
79
86
  };
80
87
 
@@ -227,7 +227,7 @@ import {
227
227
  deepCopy,
228
228
  isNonEmptyObject,
229
229
  } from '../../../utils/utils';
230
- import { isMessageInvisible, isThinkingMessage, isThinkingMessageOverTime, JSONToObject } from '../../../utils/index';
230
+ import { isMessageInvisible, isThinkingMessage, isThinkingMessageOverTime, JSONToObject, isTransferMessageWithoutDesc } from '../../../utils/index';
231
231
  import { isCustomerConversation } from '../../../index';
232
232
  import { CUSTOM_MESSAGE_SRC } from '../../../constant';
233
233
  import { QuickOrderModel } from '../../../interface';
@@ -352,21 +352,31 @@ onUnmounted(() => {
352
352
 
353
353
  function onNewMessageList(list: IMessageModel[]) {
354
354
  list.forEach((message:IMessageModel) => {
355
- if (message?.type === TUIChatEngine.TYPES.MSG_CUSTOM) {
356
- const data = JSONToObject(message?.payload?.data);
357
- if (data?.src === CUSTOM_MESSAGE_SRC.SEAT_STATUS) {
358
- if (data?.content.command === "updateSeatStatus") {
359
- if (data.content.content === 'inSeat') {
360
- TUIStore.update(StoreName.CUSTOM, "isInHumanService", true);
361
- } else if (data.content.content === 'outSeat') {
355
+ if (message.type === TUIChatEngine.TYPES.MSG_CUSTOM) {
356
+ const data = JSONToObject(message.payload.data);
357
+ if (data) {
358
+ if (data.src === CUSTOM_MESSAGE_SRC.BOT_STATUS) {
359
+ if (data.content.content === 'inBot') {
362
360
  TUIStore.update(StoreName.CUSTOM, "isInHumanService", false);
363
361
  }
364
- }
365
- } else if (data?.src === CUSTOM_MESSAGE_SRC.TYPING_STATE) {
366
- if (data?.typingStatus === 1) {
367
- TUIStore.update(StoreName.CUSTOM, 'isTyping', true);
368
- } else {
369
- TUIStore.update(StoreName.CUSTOM, 'isTyping', false);
362
+ } else if (data.src === CUSTOM_MESSAGE_SRC.SEAT_STATUS) {
363
+ if (data.content.command === "updateSeatStatus") {
364
+ if (data.content.content === 'inSeat') {
365
+ TUIStore.update(StoreName.CUSTOM, "isInHumanService", true);
366
+ } else if (data.content.content === 'outSeat') {
367
+ TUIStore.update(StoreName.CUSTOM, "isInHumanService", false);
368
+ }
369
+ }
370
+ } else if (data.src === CUSTOM_MESSAGE_SRC.TYPING_STATE) {
371
+ if (data.typingStatus === 1) {
372
+ TUIStore.update(StoreName.CUSTOM, 'isTyping', true);
373
+ } else {
374
+ TUIStore.update(StoreName.CUSTOM, 'isTyping', false);
375
+ }
376
+ } else if (data.src === CUSTOM_MESSAGE_SRC.NO_SEAT_ONLINE || data.src === CUSTOM_MESSAGE_SRC.TIMEOUT || data.src === CUSTOM_MESSAGE_SRC.END) {
377
+ TUIStore.update(StoreName.CUSTOM, "isInSession", false);
378
+ } else if (data.src === CUSTOM_MESSAGE_SRC.SESSION_RESTARTED) {
379
+ TUIStore.update(StoreName.CUSTOM, "isInSession", true);
370
380
  }
371
381
  }
372
382
  }
@@ -391,6 +401,9 @@ async function onMessageListUpdated(list: IMessageModel[]) {
391
401
  if (isThinkingMessage(message)) {
392
402
  return isThinkingMessageOverTime(message);
393
403
  }
404
+ if (isTransferMessageWithoutDesc(message)) {
405
+ return false;
406
+ }
394
407
  return !message.isDeleted && !isMessageInvisible(message as any);
395
408
  });
396
409
 
@@ -71,7 +71,10 @@
71
71
  <div v-if="payload.src === CUSTOM_MESSAGE_SRC.ORDER">
72
72
  <MessageOrder :payload="payload" />
73
73
  </div>
74
- </div>
74
+ <div v-if="payload.src === CUSTOM_MESSAGE_SRC.TRANSFER_TO_HUMAN || payload.src === CUSTOM_MESSAGE_SRC.TRANSFER_TO_TASK_FLOW">
75
+ <MessageTransferWithDesc :payload="payload" />
76
+ </div>
77
+ </div>
75
78
  </div>
76
79
  </template>
77
80
  <script lang="ts">
@@ -91,6 +94,7 @@ import MessageMultiBranch from './message-multi-branch/index.vue';
91
94
  import MessageMultiForm from './message-multi-form/index.vue';
92
95
  import MessageConcurrencyLimit from "./message-concurrency-limit.vue";
93
96
  import MessageOrder from './message-order.vue';
97
+ import MessageTransferWithDesc from './message-transfer-with-desc.vue';
94
98
  import {
95
99
  IMessageModel,
96
100
  TUIChatService,
@@ -112,6 +116,7 @@ export default {
112
116
  MessageRating,
113
117
  MessageConcurrencyLimit,
114
118
  MessageOrder,
119
+ MessageTransferWithDesc
115
120
  },
116
121
  props: {
117
122
  message: {
@@ -23,10 +23,12 @@ import vue from '../../../../../../../adapter-vue';
23
23
  import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
24
24
  import { customerServicePayloadType } from '../../../../../../../interface';
25
25
  import { isPC } from '../../../../../../../utils/env'
26
+ import { openSafeUrl } from '../../../../../../../utils/utils';
26
27
  const { ref } = vue;
27
28
  interface branchItem {
28
29
  content: string;
29
30
  desc: string;
31
+ url?: string;
30
32
  }
31
33
 
32
34
  interface Props {
@@ -47,20 +49,25 @@ export default {
47
49
  if (!branch.content) {
48
50
  return;
49
51
  }
50
- let cloudCustomData;
51
- if (props.payload.optionType === 0) {
52
- cloudCustomData = '';
53
- canSelect.value = false;
54
- } else if (props.payload.optionType === 1) {
55
- cloudCustomData = JSON.stringify({
56
- BranchOptionInfo: {
57
- taskID: props.payload.taskInfo?.taskID,
58
- nodeID: props.payload.taskInfo?.nodeID,
59
- env: props.payload.taskInfo?.env,
60
- }
61
- });
52
+ if (branch.url) {
53
+ openSafeUrl(branch.url);
54
+ } else {
55
+ let cloudCustomData;
56
+ if (props.payload.optionType === 0) {
57
+ cloudCustomData = '';
58
+ canSelect.value = false;
59
+ } else if (props.payload.optionType === 1) {
60
+ cloudCustomData = JSON.stringify({
61
+ BranchOptionInfo: {
62
+ taskID: props.payload.taskInfo?.taskID,
63
+ nodeID: props.payload.taskInfo?.nodeID,
64
+ env: props.payload.taskInfo?.env,
65
+ }
66
+ });
67
+ }
68
+ emit('input-click', branch, cloudCustomData);
62
69
  }
63
- emit('input-click', branch, cloudCustomData);
70
+
64
71
  };
65
72
 
66
73
  return {
@@ -16,6 +16,7 @@ const { computed} = vue;
16
16
  interface branchItem {
17
17
  content: string;
18
18
  desc: string;
19
+ url?: string;
19
20
  }
20
21
 
21
22
  interface Props {
@@ -17,13 +17,18 @@
17
17
  <Icon :src="iconRefresh" />
18
18
  </div>
19
19
  </div>
20
- <div
21
- v-for="(item, index) in showList"
22
- :key="index"
23
- class="welcome-item"
24
- @click="handleContentListItemClick(item)"
25
- >
26
- <div>{{ item.content }}</div>
20
+ <div class="welcome-items-container">
21
+ <div
22
+ v-for="(item, index) in showList"
23
+ :key="index"
24
+ class="welcome-item"
25
+ @click="handleContentListItemClick(item)"
26
+ >
27
+ <div class="item-content">{{ item.content }}</div>
28
+ </div>
29
+ <div class="welcome-item welcome-item-hidden">
30
+ {{ longestContent }}
31
+ </div>
27
32
  </div>
28
33
  </div>
29
34
  </template>
@@ -37,7 +42,7 @@ import Icon from './customer-icon.vue';
37
42
  import iconQuestion from '../../../../../../assets/icon_question.png';
38
43
  import iconRefresh from '../../../../../../assets/icon_refresh.png';
39
44
  import { customerServicePayloadType } from '../../../../../../interface';
40
- const { reactive, toRefs } = vue;
45
+ const { reactive, toRefs, computed } = vue;
41
46
 
42
47
  interface Props {
43
48
  payload: customerServicePayloadType;
@@ -56,7 +61,7 @@ export default {
56
61
  props: {
57
62
  payload: {
58
63
  type: Object as () => customerServicePayloadType,
59
- default: () => ({ content: { title: '', items: [] } }),
64
+ default: () => ({ content: { title: '', items: [] }}),
60
65
  },
61
66
  },
62
67
  emits: ['sendMessage'],
@@ -86,6 +91,19 @@ export default {
86
91
  );
87
92
  data.pageNumber += 1;
88
93
  };
94
+
95
+ const longestContent = computed(() => {
96
+ if (!data.list) {
97
+ return '';
98
+ }
99
+ let longestContent = '';
100
+ data.list.forEach((item) => {
101
+ if (item.content.length > longestContent.length) {
102
+ longestContent = item.content;
103
+ }
104
+ });
105
+ return longestContent;
106
+ });
89
107
 
90
108
  return {
91
109
  ...toRefs(data),
@@ -96,6 +114,7 @@ export default {
96
114
  changeBranchList,
97
115
  iconQuestion,
98
116
  iconRefresh,
117
+ longestContent
99
118
  };
100
119
  },
101
120
  };
@@ -104,6 +123,9 @@ export default {
104
123
  <style lang="scss">
105
124
  .welcome-card {
106
125
  max-width: 400px;
126
+ display: flex;
127
+ flex-direction: column;
128
+ align-items: center;
107
129
 
108
130
  .welcome-title {
109
131
  display: flex;
@@ -111,6 +133,7 @@ export default {
111
133
  margin-bottom: 10px;
112
134
  justify-content: space-between;
113
135
  align-items: center;
136
+ width: 100%;
114
137
  }
115
138
 
116
139
  .welcome-title-left-container {
@@ -151,28 +174,49 @@ export default {
151
174
  cursor: pointer;
152
175
  }
153
176
 
154
- .welcome-item {
155
- padding: 6px;
177
+ .welcome-items-container {
178
+ width: 100%;
156
179
  display: flex;
157
- justify-content: center;
180
+ flex-direction: column;
158
181
  align-items: center;
159
- cursor: pointer;
160
- background-color: #ffffff;
161
- margin-bottom: 10px;
162
- border:1px solid #adcfff;
163
- border-radius: 20px;
164
- font-weight: 500;
165
- color: #1c66e5;
166
- gap: 10px;
167
- word-break: break-word;
168
- }
169
-
170
- .welcome-item:hover {
171
- background: #f2f7ff;
172
- }
173
-
174
- .welcome-item:last-child {
175
- margin-bottom: 0;
182
+ .welcome-item {
183
+ width: 100%;
184
+ padding: 6px 10px;
185
+ display: flex;
186
+ justify-content: center;
187
+ align-items: center;
188
+ cursor: pointer;
189
+ background-color: #ffffff;
190
+ margin-bottom: 10px;
191
+ border:1px solid #adcfff;
192
+ border-radius: 20px;
193
+ font-weight: 500;
194
+ color: #1c66e5;
195
+ gap: 10px;
196
+ box-sizing: border-box;
197
+ .item-content {
198
+ text-align: center;
199
+ overflow-wrap: break-word;
200
+ word-break: normal;
201
+ width: 100%;
202
+ padding: 0 10px;
203
+ }
204
+ }
205
+
206
+ .welcome-item:hover {
207
+ background: #f2f7ff;
208
+ }
209
+
210
+ .welcome-item:last-child {
211
+ margin-bottom: 0;
212
+ }
213
+
214
+ .welcome-item-hidden {
215
+ visibility: hidden;
216
+ padding: 0;
217
+ margin: 0;
218
+ height: 0;
219
+ }
176
220
  }
177
221
  }
178
222
  </style>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div :class="['text', isPC && 'text-select']">
3
+ {{ props.payload.description }}
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts">
8
+ import vue from '../../../../../../adapter-vue';
9
+ import { customerServicePayloadType } from '../../../../../../interface';
10
+ import { isPC } from '../../../../../../utils/env';
11
+ const { computed } = vue;
12
+
13
+ interface Props {
14
+ payload: customerServicePayloadType;
15
+ }
16
+
17
+ export default {
18
+ props: {
19
+ payload: {
20
+ type: Object as () => customerServicePayloadType,
21
+ default: () => ({}),
22
+ },
23
+ },
24
+ setup(props: Props) {
25
+ const payload = computed<customerServicePayloadType>(() => {
26
+ return props.payload;
27
+ });
28
+ return {
29
+ props,
30
+ isPC,
31
+ };
32
+ },
33
+ };
34
+ </script>
35
+ <style lang="scss" scoped>
36
+ .text-select {
37
+ -webkit-user-select: text;
38
+ -moz-user-select: text;
39
+ -ms-user-select: text;
40
+ user-select: text;
41
+ }
42
+
43
+ .text {
44
+ white-space: pre-wrap;
45
+ font-size: 14px;
46
+ text-size-adjust: none;
47
+ font-family: PingFangSC-Regular;
48
+ overflow-wrap: break-word;
49
+ word-break: normal;
50
+ }
51
+ </style>
@@ -3,7 +3,7 @@
3
3
  <template v-for="(item, index) in props.toolbarButtonList">
4
4
  <ToolbarButtonHumanService v-if="item.presetId === TOOLBAR_BUTTON_TYPE.HUMAN_SERVICE && shouldRender(item) && !isInHumanService" :title="item.title" :icon="item.icon"/>
5
5
  <ToolbarButtonServiceRating v-else-if="item.presetId === TOOLBAR_BUTTON_TYPE.SERVICE_RATING && shouldRender(item) && isInHumanService" :title="item.title" :icon="item.icon"/>
6
- <ToolbarButtonEndHumanService v-else-if="item.presetId === TOOLBAR_BUTTON_TYPE.END_HUMAN_SERVICE && shouldRender(item) && isInHumanService" :title="item.title" :icon="item.icon"/>
6
+ <ToolbarButtonEndHumanService v-else-if="item.presetId === TOOLBAR_BUTTON_TYPE.END_HUMAN_SERVICE && shouldRender(item) && ((item.displayFlag === 1 && isInSession) || isInHumanService)" :title="item.title" :icon="item.icon"/>
7
7
  <div v-else-if="shouldRender(item) && !item.presetId" :key="index"
8
8
  :class="['toolbar-button', isH5 ? 'toolbar-button-h5' : '']" @click="onClick(item, index)">
9
9
  <Icon v-if="item.icon" class="toolbar-button-icon" :file="item.icon" width="18px" height="18px"/>
@@ -27,7 +27,7 @@ import { isH5 } from '../../../utils/env';
27
27
  import { ToolbarButtonModel } from '../../../interface';
28
28
  import Icon from '../../common/Icon.vue';
29
29
  import { TOOLBAR_BUTTON_TYPE } from '../../../constant';
30
- import { isEnabledMessageReadReceiptGlobal, openSafeUrl, getTo } from '../../../utils/utils';
30
+ import { isEnabledMessageReadReceiptGlobal, openSafeUrl, getTo, isNonEmptyObject, transferToTaskFlow, transferToHuman } from '../../../utils/utils';
31
31
  import ToolbarButtonHumanService from './toolbar-button-human-service.vue';
32
32
  import ToolbarButtonServiceRating from './toolbar-button-service-rating.vue';
33
33
  import ToolbarButtonEndHumanService from './toolbar-button-end-human-service.vue';
@@ -39,6 +39,7 @@ const props = withDefaults(defineProps<IProps>(), {});
39
39
 
40
40
  const isInHumanService = ref(false);
41
41
  const currentConversation = ref<IConversationModel>();
42
+ const isInSession = ref(true);
42
43
 
43
44
  onMounted(() => {
44
45
  TUIStore.watch(StoreName.CONV, {
@@ -46,6 +47,7 @@ onMounted(() => {
46
47
  });
47
48
  TUIStore.watch(StoreName.CUSTOM, {
48
49
  isInHumanService: onInHumanServiceUpdate,
50
+ isInSession: onInSessionUpdate
49
51
  });
50
52
  });
51
53
 
@@ -55,6 +57,7 @@ onUnmounted(() => {
55
57
  });
56
58
  TUIStore.unwatch(StoreName.CUSTOM, {
57
59
  isInHumanService: onInHumanServiceUpdate,
60
+ isInSession: onInSessionUpdate
58
61
  });
59
62
  });
60
63
 
@@ -66,6 +69,10 @@ const onInHumanServiceUpdate = (value: boolean) => {
66
69
  isInHumanService.value = value;
67
70
  };
68
71
 
72
+ const onInSessionUpdate = (value: boolean) => {
73
+ isInSession.value = value;
74
+ }
75
+
69
76
  function onClick(item:ToolbarButtonModel, index: number) {
70
77
  if (item.type === 1 && item.content) {
71
78
  TUIChatService.sendTextMessage({
@@ -78,6 +85,10 @@ function onClick(item:ToolbarButtonModel, index: number) {
78
85
  });
79
86
  } else if (item.type === 2 && item.content) {
80
87
  openSafeUrl(item.content);
88
+ } else if (item.type === 3 && isNonEmptyObject(item.content)) {
89
+ transferToTaskFlow(getTo(currentConversation.value), item.content.taskFlowID, item.content.description);
90
+ } else if (item.type === 4 && isNonEmptyObject(item.content)) {
91
+ transferToHuman(getTo(currentConversation.value), item.content.groupID, item.content.specificMemberList, item.content.description);
81
92
  } else if (props.toolbarButtonList !== undefined && typeof props.toolbarButtonList[index].clickEvent === 'function') {
82
93
  props.toolbarButtonList[index].clickEvent();
83
94
  }
@@ -19,6 +19,8 @@
19
19
  padding: 10px;
20
20
  box-sizing: border-box;
21
21
  display: flex;
22
+ justify-content: space-between;
23
+ width: 100%;
22
24
  }
23
25
 
24
26
  &-message-list {
package/constant.ts CHANGED
@@ -23,6 +23,7 @@ export const CUSTOM_MESSAGE_SRC = {
23
23
  PRODUCT_CARD: '22',
24
24
  SATISFACTION_CON: '23',
25
25
  USER_SATISFACTION: '24',
26
+ BOT_STATUS: '25',
26
27
  SEAT_STATUS: '26',
27
28
  USER_END_SESSION: '27',
28
29
  ORDER:'28',
@@ -31,9 +32,12 @@ export const CUSTOM_MESSAGE_SRC = {
31
32
  STREAM_TEXT: '31',
32
33
  MULTI_BRANCH: '32',
33
34
  MULTI_FORM: '33',
35
+ TRANSFER_TO_TASK_FLOW: '34',
34
36
  THINKING: '35',
35
37
  CONCURRENCY_LIMIT: '36',
36
38
  TIMEOUT_WARNING: '37',
39
+ TRANSFER_TO_HUMAN: '39',
40
+ SESSION_RESTARTED: '40',
37
41
  };
38
42
 
39
43
  // im message extra type
@@ -142,6 +146,8 @@ export const WHITE_LIST = [
142
146
  CUSTOM_MESSAGE_SRC.CONCURRENCY_LIMIT,
143
147
  CUSTOM_MESSAGE_SRC.ORDER,
144
148
  CUSTOM_MESSAGE_SRC.TIMEOUT_WARNING,
149
+ CUSTOM_MESSAGE_SRC.TRANSFER_TO_TASK_FLOW,
150
+ CUSTOM_MESSAGE_SRC.TRANSFER_TO_HUMAN,
145
151
  ];
146
152
 
147
153
  export const TOOLBAR_BUTTON_TYPE = {
@@ -165,4 +171,18 @@ export enum ReadState {
165
171
  AllRead,
166
172
  NotShow,
167
173
  PartiallyRead,
168
- };
174
+ };
175
+
176
+
177
+ export const SUPPORTED_LANGUAGES = {
178
+ en: {name: 'English', codeForShow: 'En'},
179
+ fil: {name: 'Filipino', codeForShow: 'Fil'},
180
+ id: {name: 'Bahasa Indonesia', codeForShow: 'Id'},
181
+ ja: {name: '日本語', codeForShow: 'Ja'},
182
+ ms: {name: 'Bahasa Melayu', codeForShow: 'Ms'},
183
+ th: {name: 'ภาษาไทย', codeForShow: 'Th'},
184
+ vi: {name: 'Tiếng Việt', codeForShow: 'Vi'},
185
+ zh: {name: '中文简体', codeForShow: 'Zh'},
186
+ zh_tw: {name: '中文繁體', codeForShow: 'Zh-TW'},
187
+ ru: {name:'Русский', codeForShow: 'Ru'}
188
+ }
package/interface.ts CHANGED
@@ -3,7 +3,7 @@ export interface customerServicePayloadType {
3
3
  chatbotPlugin?: number | string;
4
4
  customerServicePlugin?: number | string;
5
5
  src: string | number;
6
- content: any;
6
+ content?: any;
7
7
  subtype?: string;
8
8
  isFinished?: number;
9
9
  chunks?: string[];
@@ -16,6 +16,7 @@ export interface customerServicePayloadType {
16
16
  nodeID?: string;
17
17
  env?: string;
18
18
  }
19
+ description?: string,
19
20
  }
20
21
 
21
22
  interface IMenuItem {
@@ -190,12 +191,13 @@ export interface ToolbarButtonModel {
190
191
  title: string, // 名称
191
192
  icon?: string, // 图标
192
193
  type?: number, // 类型 1:关键词回复 2:跳转链接
193
- content?: string, // 发送的文本或跳转的链接
194
+ content?: string | ITransferToTaskFlowModel | ITransferToHumanModel, // 发送的文本或跳转的链接
194
195
  presetId?: ToolbarButtonPresetType, // 若要显示已有功能,填写相关type
195
196
  isPreset?: number, // 是否是预置功能 0:非预置 1:预置类型
196
197
  isEnabled?: number, // 是否显示
197
198
  renderCondition?: () => {}, // [UIKit] 是否显示
198
199
  clickEvent?: () => void, // [UIKit] 点击事件
200
+ displayFlag?: number,
199
201
  }
200
202
 
201
203
  // 输入框功能 已有功能
@@ -225,4 +227,15 @@ export interface QuickOrderModel {
225
227
  pic?: string,
226
228
  url: string,
227
229
  customField?: QuickOrderCustomFieldModel[],
230
+ }
231
+
232
+ export interface ITransferToTaskFlowModel {
233
+ taskFlowID: number;
234
+ description?: string;
235
+ }
236
+
237
+ export interface ITransferToHumanModel {
238
+ groupID?: string;
239
+ specificMemberList?: Array<string>;
240
+ description?: string;
228
241
  }
@@ -1,6 +1,6 @@
1
1
  const AIDesk = {
2
- "结束人工会话": "End human service",
3
- "转人工服务": "Human service",
2
+ "结束人工会话": "End Conversation",
3
+ "转人工服务": "Agent Transfer",
4
4
  "跳转": "Open",
5
5
  "立即填写": "Fill now",
6
6
  "已提交": "Submitted",
@@ -11,10 +11,10 @@ const AIDesk = {
11
11
  "请输入内容":"Please enter the content",
12
12
  "如果满意请给好评哦~":"If you're satisfied, please give a good review~",
13
13
  "请对本次服务进行评价": "Please rate this service",
14
- "提交评价": "Feedback",
14
+ "提交评价": "Service Rating",
15
15
  "并发限制": "There are currently too many users accessing the service. Please try again later",
16
16
  "分支选项异常": "Content is abnormal, please check the task flow configuration",
17
- "服务评价": "Feedback",
17
+ "服务评价": "Service Rating",
18
18
  "满意":"Satisfied",
19
19
  "不满意":"Dissatisfied",
20
20
  "感谢您的反馈,我们会持续优化改进":"Thank you for your feedback, we will continue to improve",
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
3
+ import time from './time';
4
4
  import AIDesk from './aidesk';
5
5
 
6
6
  const messages = {
@@ -19,7 +19,7 @@ const messages = {
19
19
  AIDesk,
20
20
  TUIChat,
21
21
  Component,
22
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "week(s) ",
3
3
  "天": "day(s)",
4
4
  "小时": "hour(s) ",
@@ -34,4 +34,4 @@ const Time = {
34
34
  "日": "Sun",
35
35
  }
36
36
 
37
- export default Time;
37
+ export default time;
@@ -1,7 +1,7 @@
1
1
  import AIDesk from './aidesk';
2
2
  import TUIChat from './TUIChat';
3
3
  import Component from './component';
4
- import Time from './time';
4
+ import time from './time';
5
5
  const messages = {
6
6
  fil: {
7
7
  "取消": 'Kanselahin',
@@ -18,7 +18,7 @@ const messages = {
18
18
  AIDesk,
19
19
  TUIChat,
20
20
  Component,
21
- Time,
21
+ time,
22
22
  },
23
23
  };
24
24
 
@@ -1,4 +1,4 @@
1
- const Time = {
1
+ const time = {
2
2
  "周": "linggo/linggo ",
3
3
  "天": "araw",
4
4
  "小时": "oras/oras ",
@@ -15,4 +15,4 @@ const Time = {
15
15
  "星期日": "Linggo",
16
16
  }
17
17
 
18
- export default Time;
18
+ export default time;
@@ -1,6 +1,6 @@
1
1
  import TUIChat from './TUIChat';
2
2
  import Component from './component';
3
- import Time from './time';
3
+ import time from './time';
4
4
  import AIDesk from './aidesk';
5
5
 
6
6
  const messages = {
@@ -19,7 +19,7 @@ const messages = {
19
19
  AIDesk,
20
20
  TUIChat,
21
21
  Component,
22
- Time,
22
+ time,
23
23
  },
24
24
  };
25
25