ai-chat-bot-interface 1.0.9 → 1.1.1

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.
@@ -0,0 +1,5 @@
1
+ node_modules
2
+ dist
3
+ .git
4
+ .idea
5
+ .vscode
@@ -0,0 +1,37 @@
1
+ module.exports = {
2
+ // 一行最多 80 字符
3
+ printWidth: 80,
4
+ // 使用 4 个空格缩进
5
+ tabWidth: 2,
6
+ // 不使用 tab 缩进,而使用空格
7
+ useTabs: false,
8
+ // 行尾需要有分号
9
+ semi: true,
10
+ // 使用单引号代替双引号
11
+ singleQuote: true,
12
+ // 对象的 key 仅在必要时用引号
13
+ quoteProps: 'as-needed',
14
+ // jsx 不使用单引号,而使用双引号
15
+ jsxSingleQuote: false,
16
+ // 末尾使用逗号
17
+ trailingComma: 'all',
18
+ // 大括号内的首尾需要空格 { foo: bar }
19
+ bracketSpacing: true,
20
+ // jsx 标签的反尖括号需要换行
21
+ jsxBracketSameLine: false,
22
+ // 箭头函数,只有一个参数的时候,也需要括号
23
+ arrowParens: 'always',
24
+ // 每个文件格式化的范围是文件的全部内容
25
+ rangeStart: 0,
26
+ rangeEnd: Infinity,
27
+ // 不需要写文件开头的 @prettier
28
+ requirePragma: false,
29
+ // 不需要自动在文件开头插入 @prettier
30
+ insertPragma: false,
31
+ // 使用默认的折行标准
32
+ proseWrap: 'preserve',
33
+ // 根据显示样式决定 html 要不要折行
34
+ htmlWhitespaceSensitivity: 'css',
35
+ // 换行符使用 lf
36
+ endOfLine: 'auto'
37
+ }
package/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + Vue</title>
7
+ <title>Chat ui</title>
8
8
  </head>
9
9
  <body>
10
10
  <div id="app"></div>
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.0.9",
4
+ "version": "1.1.1",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
10
  "build": "vite build",
11
- "preview": "vite preview"
11
+ "preview": "vite preview",
12
+ "prettier:write": "prettier --write src"
12
13
  },
13
14
  "keywords": [
14
15
  "vue3",
@@ -21,7 +22,8 @@
21
22
  "devDependencies": {
22
23
  "@vitejs/plugin-vue": "^5.2.1",
23
24
  "less": "^4.2.2",
24
- "vite": "^6.1.0"
25
+ "vite": "^6.1.0",
26
+ "prettier": "^2.6.2"
25
27
  },
26
28
  "author": "lin_26",
27
29
  "license": "MIT"
package/src/App.vue CHANGED
@@ -1,18 +1,10 @@
1
1
  <script setup>
2
- import ChatUi from './ChatUi.vue'
2
+ import ChatUi from './ChatUi.vue';
3
3
  </script>
4
4
 
5
5
  <template>
6
- <div style="width: 100vw; height: 100vh;">
7
- <chat-ui bot-id="123132132"
8
- token="pat_123"
9
- uid="5555"
10
- />
6
+ <div style="width: 100vw; height: 100vh">
7
+ <chat-ui bot-id="111" token="555" uid="262" />
11
8
  </div>
12
9
  </template>
13
-
14
- <style>
15
- #app {
16
- padding: 0;
17
- }
18
- </style>
10
+ <style></style>
package/src/ChatUi.less CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  @import './assets/styles/public';
3
2
 
4
3
  .btn {
@@ -33,7 +32,7 @@
33
32
  border-radius: 8px;
34
33
  border: 1px solid rgba(68, 83, 130, 0.25);
35
34
  &:hover {
36
- background-color: #EAEAEA;
35
+ background-color: #eaeaea;
37
36
  }
38
37
  }
39
38
  }
@@ -61,10 +60,7 @@
61
60
  }
62
61
 
63
62
  &_header {
64
- display: flex;
65
- flex-direction: row;
66
- justify-content: space-between;
67
- align-items: center;
63
+ .flexrbc();
68
64
  box-sizing: border-box;
69
65
  padding: 0 16px;
70
66
  height: 56px;
@@ -77,18 +73,43 @@
77
73
  .flexrsc();
78
74
 
79
75
  .logo {
80
- width: 24px;
81
- height: 24px;
76
+ width: 32px;
77
+ height: 32px;
78
+ border-radius: 50%;
82
79
  margin-right: 16px;
83
80
  }
81
+ .back {
82
+ .flexrcc();
83
+ cursor: pointer;
84
+ font-size: 24px;
85
+ width: 32px;
86
+ height: 32px;
87
+ gap: 15px;
88
+ }
89
+ .name {
90
+ font-weight: 600;
91
+ font-size: 14px;
92
+ color: #000;
93
+ line-height: 16px;
94
+ &_box {
95
+ }
96
+ &_sub {
97
+ font-weight: 400;
98
+ font-size: 10px;
99
+ color: #666;
100
+ line-height: 12px;
101
+ }
102
+ }
84
103
  }
85
104
 
86
105
  .btn {
87
- font-size: 16px;
106
+ .flexrcc();
107
+ cursor: pointer;
108
+ font-size: 32px;
88
109
  background-color: @bg-color;
89
110
 
90
111
  &_group {
91
- .flexrec()
112
+ .flexrec();
92
113
  }
93
114
  }
94
115
  }
@@ -102,13 +123,15 @@
102
123
  overflow-y: auto;
103
124
 
104
125
  .replay {
105
- .flexrss();
106
126
  margin: 20px 0;
107
127
 
108
128
  .name {
129
+ .flexrsc();
109
130
  width: 100%;
110
131
  text-align: left;
111
- font-size: 14px;
132
+ font-size: 10px;
133
+ padding-bottom: 10px;
134
+ gap: 5px;
112
135
  }
113
136
 
114
137
  .time {
@@ -117,9 +140,9 @@
117
140
  }
118
141
 
119
142
  .avatar {
120
- width: 32px;
121
- height: 32px;
122
- margin: 0 12px 0 0;
143
+ width: 20px;
144
+ height: 20px;
145
+ border-radius: 10px;
123
146
  }
124
147
 
125
148
  .box {
@@ -127,19 +150,20 @@
127
150
  font-size: 14px;
128
151
  font-weight: 400;
129
152
  text-align: left;
130
- background-color: #fff;
153
+ background-color: @sys-bg;
131
154
  padding: 12px 16px;
132
155
  border-radius: @border-radius;
156
+ border-top-left-radius: 2px;
133
157
 
134
158
  /deep/ .text {
135
159
  word-break: break-all;
136
160
  white-space: pre-wrap;
161
+ margin: 0;
137
162
 
138
163
  a {
139
164
  color: #039938;
140
165
  }
141
166
  }
142
-
143
167
  }
144
168
 
145
169
  .recm {
@@ -156,17 +180,14 @@
156
180
 
157
181
  &.role_user {
158
182
  .flexres();
159
-
160
- .avatar {
161
- margin: 0 0 0 12px;
162
- }
163
-
164
183
  .name {
184
+ .flexrec();
165
185
  text-align: right;
166
186
  }
167
-
168
187
  .box {
169
- background-color: #EAEAEA;
188
+ border-radius: @border-radius;
189
+ border-top-right-radius: 2px;
190
+ background-color: @user-bg;
170
191
  }
171
192
  }
172
193
  }