ai-chat-bot-interface 1.4.3 → 1.4.5

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.4.3",
4
+ "version": "1.4.5",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/App.vue CHANGED
@@ -5,8 +5,8 @@ import ChatUi from './ChatUi.vue';
5
5
  <template>
6
6
  <div style="width: 100vw; height: 100vh">
7
7
  <chat-ui
8
- bot-id="5555"
9
- token="pat_88888"
8
+ bot-id="555"
9
+ token="pat_28888"
10
10
  uid="262598"
11
11
  :def-msg="{ placeholder: '发消息...' }"
12
12
  :show-header="true"
@@ -55,6 +55,8 @@
55
55
  :placeholder="defMsg.placeholder"
56
56
  @input="handleInput"
57
57
  @keyup.enter="sendMsg"
58
+ @focus="handleFocus"
59
+ @blur="handleBlur"
58
60
  />
59
61
  <div class="btn_group">
60
62
  <div class="btn" @click.stop="sendMsg">
@@ -193,6 +195,9 @@ const handleTag = (info) => {
193
195
  }
194
196
  };
195
197
  const sendMsg = () => {
198
+ if (!textValue.value) {
199
+ return;
200
+ }
196
201
  if (
197
202
  uFileList.value.length &&
198
203
  uFileList.value.findIndex((f) => f.percent < 100) > -1
@@ -320,6 +325,18 @@ const resizeTextarea = () => {
320
325
  }
321
326
  });
322
327
  };
328
+
329
+ const handleFocus = () => {
330
+ nextTick(() => {
331
+ window.scrollTo({
332
+ top: Math.round(
333
+ 0.7 * window.innerHeight + 0.5476 * window.innerWidth - 416.4,
334
+ ), // 滚动到页面的总高度
335
+ behavior: 'smooth', // 平滑滚动效果
336
+ });
337
+ });
338
+ };
339
+ const handleBlur = () => {};
323
340
  </script>
324
341
 
325
342
  <style scoped lang="less">