ai-chat-bot-interface 1.2.1 → 1.2.2

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,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.2.1",
4
+ "version": "1.2.2",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/App.vue CHANGED
@@ -4,7 +4,7 @@ import ChatUi from './ChatUi.vue';
4
4
 
5
5
  <template>
6
6
  <div style="width: 100vw; height: 100vh">
7
- <chat-ui bot-id="000" token="pat_8888" uid="262598" :show-header="true" />
7
+ <chat-ui bot-id="000" token="pat_88888" uid="262598" :show-header="true" />
8
8
  </div>
9
9
  </template>
10
10
  <style></style>
package/src/ChatUi.vue CHANGED
@@ -576,8 +576,15 @@ const handleCardTap = ({ type }, info) => {
576
576
  }
577
577
  };
578
578
  const handleCall = (data) => {
579
- console.log(data);
580
- Emits('call', data);
579
+ switch (data.type) {
580
+ case 'new_chat':
581
+ createConv();
582
+ break;
583
+ default:
584
+ Emits('call', data);
585
+
586
+ break;
587
+ }
581
588
  };
582
589
 
583
590
  const handlePlanParse = (list) => {
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  </div>
14
14
  <div class="om_operate_box">
15
- <div v-if="newChat" class="new_chat">
15
+ <div v-if="newChat" class="new_chat" @click.stop="newChatFunc">
16
16
  <new-chat />
17
17
  </div>
18
18
  <div class="om_operate_wrap">
@@ -196,6 +196,7 @@ const sendMsg = () => {
196
196
  ) {
197
197
  Emits('call', {
198
198
  message: '文件正在上傳,請稍候...',
199
+ reason: 'is_uploading',
199
200
  value: 'toast',
200
201
  type: 'call',
201
202
  });
@@ -301,6 +302,12 @@ const clearFile = (idx) => {
301
302
  uploadInput.value ? (uploadInput.value.value = '') : '';
302
303
  };
303
304
 
305
+ const newChatFunc = () => {
306
+ Emits('call', {
307
+ type: 'new_chat',
308
+ });
309
+ };
310
+
304
311
  const resizeTextarea = () => {
305
312
  nextTick(() => {
306
313
  if (txtEle.value) {