koishi-plugin-chat-patch 2.2.0 → 2.4.0
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/client/icons/activity.vue +9 -9
- package/client/icons/index.ts +4 -4
- package/client/index.scss +90 -90
- package/client/index.ts +25 -25
- package/client/vue/composables/useChatActions.ts +1 -1
- package/client/vue/composables/useChatData.ts +1 -1
- package/client/vue/composables/useImageCache.ts +1 -1
- package/client/vue/types.ts +1 -1
- package/dist/index.js +2 -2
- package/lib/file-manager.d.ts +32 -0
- package/lib/index.js +417 -197
- package/lib/message-handler.d.ts +7 -5
- package/package.json +1 -1
- package/readme.md +25 -25
- package/src/api-handlers.ts +19 -65
- package/src/config.ts +45 -46
- package/src/file-manager.ts +367 -169
- package/src/index.ts +58 -31
- package/src/message-handler.ts +161 -134
- package/src/types.ts +62 -62
- package/src/utils.ts +4 -16
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
|
3
|
-
<path d="M8 10.5H16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
4
|
-
<path d="M8 14H13.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
5
|
-
<path
|
|
6
|
-
d="M17 3.33782C15.5291 2.48697 13.8214 2 12 2C6.47715 2 2 6.47715 2 12C2 13.5997 2.37562 15.1116 3.04346 16.4525C3.22094 16.8088 3.28001 17.2161 3.17712 17.6006L2.58151 19.8267C2.32295 20.793 3.20701 21.677 4.17335 21.4185L6.39939 20.8229C6.78393 20.72 7.19121 20.7791 7.54753 20.9565C8.88837 21.6244 10.4003 22 12 22C17.5228 22 22 17.5228 22 12C22 10.1786 21.513 8.47087 20.6622 7"
|
|
7
|
-
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
8
|
-
</svg>
|
|
9
|
-
</template>
|
|
1
|
+
<template>
|
|
2
|
+
<svg class="k-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
|
3
|
+
<path d="M8 10.5H16" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
4
|
+
<path d="M8 14H13.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
5
|
+
<path
|
|
6
|
+
d="M17 3.33782C15.5291 2.48697 13.8214 2 12 2C6.47715 2 2 6.47715 2 12C2 13.5997 2.37562 15.1116 3.04346 16.4525C3.22094 16.8088 3.28001 17.2161 3.17712 17.6006L2.58151 19.8267C2.32295 20.793 3.20701 21.677 4.17335 21.4185L6.39939 20.8229C6.78393 20.72 7.19121 20.7791 7.54753 20.9565C8.88837 21.6244 10.4003 22 12 22C17.5228 22 22 17.5228 22 12C22 10.1786 21.513 8.47087 20.6622 7"
|
|
7
|
+
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
8
|
+
</svg>
|
|
9
|
+
</template>
|
package/client/icons/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { icons } from '@koishijs/client'
|
|
2
|
-
import Activity from './activity.vue'
|
|
3
|
-
|
|
4
|
-
icons.register('activity:chat', Activity)
|
|
1
|
+
import { icons } from '@koishijs/client'
|
|
2
|
+
import Activity from './activity.vue'
|
|
3
|
+
|
|
4
|
+
icons.register('activity:chat', Activity)
|
package/client/index.scss
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
@tailwind components;
|
|
2
|
-
@tailwind utilities;
|
|
3
|
-
|
|
4
|
-
:root {
|
|
5
|
-
--chat-bg: var(--k-page-bg);
|
|
6
|
-
--chat-panel-bg: var(--k-card-bg);
|
|
7
|
-
--chat-border: var(--k-border-color);
|
|
8
|
-
--chat-text: var(--k-text-color);
|
|
9
|
-
--chat-text-sub: var(--k-text-color-secondary);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.chat-patch-wrapper {
|
|
13
|
-
/* 完全隐藏滚动条 - 增强版 */
|
|
14
|
-
.mobile-scrollbar-fix {
|
|
15
|
-
/* 隐藏 Element Plus 滚动条组件 */
|
|
16
|
-
.el-scrollbar__bar {
|
|
17
|
-
display: none !important;
|
|
18
|
-
opacity: 0 !important;
|
|
19
|
-
width: 0 !important;
|
|
20
|
-
height: 0 !important;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.el-scrollbar__thumb {
|
|
24
|
-
display: none !important;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.el-scrollbar__wrap {
|
|
28
|
-
overflow-x: hidden !important;
|
|
29
|
-
|
|
30
|
-
/* 隐藏原生滚动条 - 所有浏览器 */
|
|
31
|
-
scrollbar-width: none !important; /* Firefox */
|
|
32
|
-
-ms-overflow-style: none !important; /* IE/Edge */
|
|
33
|
-
|
|
34
|
-
&::-webkit-scrollbar {
|
|
35
|
-
display: none !important; /* Chrome/Safari */
|
|
36
|
-
width: 0 !important;
|
|
37
|
-
height: 0 !important;
|
|
38
|
-
background: transparent !important;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&::-webkit-scrollbar-track {
|
|
42
|
-
display: none !important;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&::-webkit-scrollbar-thumb {
|
|
46
|
-
display: none !important;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
color: var(--chat-text);
|
|
52
|
-
background-color: var(--chat-bg);
|
|
53
|
-
|
|
54
|
-
.el-aside, .el-main, .el-header, .el-footer {
|
|
55
|
-
background-color: transparent !important;
|
|
56
|
-
color: inherit !important;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.el-scrollbar {
|
|
60
|
-
background-color: transparent !important;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.el-input__wrapper, .el-textarea__inner {
|
|
64
|
-
background-color: var(--k-input-bg) !important;
|
|
65
|
-
color: var(--chat-text) !important;
|
|
66
|
-
box-shadow: 0 0 0 1px var(--chat-border) inset !important;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.el-empty {
|
|
70
|
-
background-color: transparent !important;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.layout-iframe {
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: 100%;
|
|
77
|
-
border: none;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.message-highlight {
|
|
81
|
-
animation: highlight-fade 1.5s ease-in-out;
|
|
82
|
-
border-radius: 8px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@keyframes highlight-fade {
|
|
86
|
-
0% { background-color: transparent; }
|
|
87
|
-
10% { background-color: rgba(64, 158, 255, 0.4); filter: brightness(1.2); }
|
|
88
|
-
30% { background-color: rgba(64, 158, 255, 0.4); filter: brightness(1.2); }
|
|
89
|
-
100% { background-color: transparent; }
|
|
90
|
-
}
|
|
1
|
+
@tailwind components;
|
|
2
|
+
@tailwind utilities;
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--chat-bg: var(--k-page-bg);
|
|
6
|
+
--chat-panel-bg: var(--k-card-bg);
|
|
7
|
+
--chat-border: var(--k-border-color);
|
|
8
|
+
--chat-text: var(--k-text-color);
|
|
9
|
+
--chat-text-sub: var(--k-text-color-secondary);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.chat-patch-wrapper {
|
|
13
|
+
/* 完全隐藏滚动条 - 增强版 */
|
|
14
|
+
.mobile-scrollbar-fix {
|
|
15
|
+
/* 隐藏 Element Plus 滚动条组件 */
|
|
16
|
+
.el-scrollbar__bar {
|
|
17
|
+
display: none !important;
|
|
18
|
+
opacity: 0 !important;
|
|
19
|
+
width: 0 !important;
|
|
20
|
+
height: 0 !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.el-scrollbar__thumb {
|
|
24
|
+
display: none !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.el-scrollbar__wrap {
|
|
28
|
+
overflow-x: hidden !important;
|
|
29
|
+
|
|
30
|
+
/* 隐藏原生滚动条 - 所有浏览器 */
|
|
31
|
+
scrollbar-width: none !important; /* Firefox */
|
|
32
|
+
-ms-overflow-style: none !important; /* IE/Edge */
|
|
33
|
+
|
|
34
|
+
&::-webkit-scrollbar {
|
|
35
|
+
display: none !important; /* Chrome/Safari */
|
|
36
|
+
width: 0 !important;
|
|
37
|
+
height: 0 !important;
|
|
38
|
+
background: transparent !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&::-webkit-scrollbar-track {
|
|
42
|
+
display: none !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&::-webkit-scrollbar-thumb {
|
|
46
|
+
display: none !important;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
color: var(--chat-text);
|
|
52
|
+
background-color: var(--chat-bg);
|
|
53
|
+
|
|
54
|
+
.el-aside, .el-main, .el-header, .el-footer {
|
|
55
|
+
background-color: transparent !important;
|
|
56
|
+
color: inherit !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.el-scrollbar {
|
|
60
|
+
background-color: transparent !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.el-input__wrapper, .el-textarea__inner {
|
|
64
|
+
background-color: var(--k-input-bg) !important;
|
|
65
|
+
color: var(--chat-text) !important;
|
|
66
|
+
box-shadow: 0 0 0 1px var(--chat-border) inset !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.el-empty {
|
|
70
|
+
background-color: transparent !important;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.layout-iframe {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
border: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.message-highlight {
|
|
81
|
+
animation: highlight-fade 1.5s ease-in-out;
|
|
82
|
+
border-radius: 8px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@keyframes highlight-fade {
|
|
86
|
+
0% { background-color: transparent; }
|
|
87
|
+
10% { background-color: rgba(64, 158, 255, 0.4); filter: brightness(1.2); }
|
|
88
|
+
30% { background-color: rgba(64, 158, 255, 0.4); filter: brightness(1.2); }
|
|
89
|
+
100% { background-color: transparent; }
|
|
90
|
+
}
|
package/client/index.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineComponent, h, resolveComponent } from 'vue'
|
|
3
|
-
import { Context } from '@koishijs/client'
|
|
4
|
-
import Chat from './vue/index.vue'
|
|
5
|
-
// 不导入 Element Plus CSS,Koishi 已经包含了
|
|
6
|
-
// import 'element-plus/dist/index.css'
|
|
7
|
-
import './index.scss'
|
|
8
|
-
import './icons'
|
|
9
|
-
|
|
10
|
-
export default (ctx: Context) => {
|
|
11
|
-
ctx.page({
|
|
12
|
-
name: '聊天室',
|
|
13
|
-
path: '/chat-patch',
|
|
14
|
-
desc: "",
|
|
15
|
-
authority: 4,
|
|
16
|
-
icon: 'activity:chat',
|
|
17
|
-
component: defineComponent({
|
|
18
|
-
setup() {
|
|
19
|
-
return () => h(resolveComponent('k-layout'), {}, {
|
|
20
|
-
default: () => h(Chat)
|
|
21
|
-
})
|
|
22
|
-
},
|
|
23
|
-
}),
|
|
24
|
-
})
|
|
25
|
-
}
|
|
1
|
+
|
|
2
|
+
import { defineComponent, h, resolveComponent } from 'vue'
|
|
3
|
+
import { Context } from '@koishijs/client'
|
|
4
|
+
import Chat from './vue/index.vue'
|
|
5
|
+
// 不导入 Element Plus CSS,Koishi 已经包含了
|
|
6
|
+
// import 'element-plus/dist/index.css'
|
|
7
|
+
import './index.scss'
|
|
8
|
+
import './icons'
|
|
9
|
+
|
|
10
|
+
export default (ctx: Context) => {
|
|
11
|
+
ctx.page({
|
|
12
|
+
name: '聊天室',
|
|
13
|
+
path: '/chat-patch',
|
|
14
|
+
desc: "",
|
|
15
|
+
authority: 4,
|
|
16
|
+
icon: 'activity:chat',
|
|
17
|
+
component: defineComponent({
|
|
18
|
+
setup() {
|
|
19
|
+
return () => h(resolveComponent('k-layout'), {}, {
|
|
20
|
+
default: () => h(Chat)
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
})
|
|
25
|
+
}
|
package/client/vue/types.ts
CHANGED