Skip to content

Commit

Permalink
#122 九月累积更新
Browse files Browse the repository at this point in the history
✨ 支持群 poke 消息以及相关动画/窗口动画
✨ 新增一个没什么用的 bot 状态功能,仅限于开启了 ws 心跳功能的 bot
✨ 追加了之前遗漏的收藏表情多页加载的功能
✨ 支持显示群戳一戳信息
✨ 脚本页面增加一些内置脚本
✨ 对自己发送的表情回应进行了显示
✨ 置顶窗口支持
✨ 脚本功能支持在通知消息类型触发
🎨 优化消息处理分发代码,去除大量 switch
🎨 优化了断开清理的逻辑,现在只会在连接不同的地址/不同的账号的情况下才会清空
🎨 优化了多种分页方式的兼容
🐛 修正消息列表在窄布局下的错误,由 3a5483e 损坏
:bug: 修正在 iOS 浏览器下由于通知功能缺失导致通知下游功能损坏的问题 <- #123
🐛 修正初次打开由于存储的商城表情未初始化导致的页面卡死问题
🐛 修正初次打开由于存储的代码未初始导致的页面卡死问题
🐛 修正由于消息解析器调整公告解析出现错误导致的页面卡死问题,由 c64592d 损坏
:bug: 在某些 bot 下 at 全体文本显示不正确
:bug: 修正了一个 Tab 焦点导致页面布局混乱的问题
:bug: 后端连接模式多重试了一次
:lipstick: 将全局字体限制为非衬线字体,防止在某些浏览器以及 linux 下出现默认为衬线字体的情况
:lipstick: 新增一组常见状态色便于使用
:heavy_plus_sign: 新增依赖:animejs
:green_heart: 发布版本现在会构建一个用于 root 的 web 包便于使用
:egg: 全透明样式:界面 -> 窗口透明模式(仅供娱乐)
:poop: 移除历史遗留的分阶段获取视频消息的功能
  • Loading branch information
Stapxs authored Sep 5, 2024
2 parents 84d6b5e + 6508e31 commit 2bf3d6d
Show file tree
Hide file tree
Showing 38 changed files with 1,473 additions and 808 deletions.
57 changes: 37 additions & 20 deletions .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,50 @@ jobs:
- name: Init Env
id: step_init
run: |
# 判断是否需要构建 web 版本,检查 push message 中最后一行是否不包含 [not-build-web](默认构建)
if [[ $(git log -1 --pretty=%B) != *"[not-build-web]"* ]]; then
echo 'BUILD_WEB=true'
echo 'BUILD_WEB=true' >> $GITHUB_OUTPUT
else
echo 'BUILD_WEB=false'
echo 'BUILD_WEB=false' >> $GITHUB_OUTPUT
fi
# 判断是否需要构建 electron 版本,检查 push message 中最后一行是否包含 [build-electron]
if [[ $(git log -1 --pretty=%B) == *"[build-electron]"* ]]; then
echo 'BUILD_ELECTRON=true'
echo 'BUILD_ELECTRON=true' >> $GITHUB_OUTPUT
else
echo 'BUILD_ELECTRON=false'
echo 'BUILD_ELECTRON=false' >> $GITHUB_OUTPUT
fi
# 获取版本号
echo VERSION=$(node -p "require('./package.json').version") >> $GITHUB_OUTPUT
# ========================= 构建 Web 版本 =========================
# ========================= 构建 Web 版本 =========================

build-root-web:
name: 构建 Web 版本(根目录)
runs-on: ubuntu-latest
needs: init
steps:
# 拉取代码
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
# 设置 Node.js 版本
- name: Load Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
# 更新依赖
- name: Install
run: yarn
# 构建
- name: Build
run: yarn build

# 将 dist 目录压缩为 zip
- name: Zip
run: zip -r Stapxs.QQ.Lite-${{ needs.init.outputs.version }}-web.zip dist

# 上传构建结果
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ needs.init.outputs.version }}-web
path: Stapxs.QQ.Lite-${{ needs.init.outputs.version }}-web.zip

# ==================== 构建 Github Pages 版本 =====================
build-pages:
name: 构建 Github Pages 版本
runs-on: ubuntu-latest
needs: init
if: needs.init.outputs.build_web == 'true'
steps:
# 拉取代码
- name: Checkout
Expand Down Expand Up @@ -90,10 +109,8 @@ jobs:
version: ${{ needs.init.outputs.version }}

needs: init
if: needs.init.outputs.build_electron == 'true'

steps:

# 拉取代码
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stapxs-qq-lite",
"version": "2.8.5",
"version": "2.8.6",
"private": false,
"author": "Stapx Steve [林槐]",
"description": "一个兼容 OneBot 的非官方网页版 QQ 客户端,使用 Vue 重制的全新版本。",
Expand All @@ -19,6 +19,7 @@
"@jakejarrett/gtk-theme": "^2.0.1",
"@stapxs/umami-logger-typescript": "^1.0.12",
"@types/prismjs": "^1.26.4",
"animejs": "^3.2.2",
"axios": "^1.7.2",
"browser-image-compression": "^2.0.0",
"core-js": "^3.8.3",
Expand Down Expand Up @@ -50,6 +51,7 @@
"xss": "^1.0.14"
},
"devDependencies": {
"@types/animejs": "^3.1.12",
"@types/css": "^0.0.33",
"@types/electron-devtools-installer": "^2.2.0",
"@types/jsonpath": "^0.2.3",
Expand Down
11 changes: 11 additions & 0 deletions public/css/append-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:root {
--color-blue: #316cf4;
--color-green: #408558;
--color-red: #cb444a;
--color-yellow: #f6c344;

--color-bg-blue: #393e47;
--color-bg-green: #3f544a;
--color-bg-red: #523a3c;
--color-bg-yellow: #504b3d;
}
11 changes: 11 additions & 0 deletions public/css/append-light.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:root {
--color-blue: #316cf4;
--color-green: #408558;
--color-red: #cb444a;
--color-yellow: #f6c344;

--color-bg-blue: #d3e1fc;
--color-bg-green: #d5e6de;
--color-bg-red: #f3d8da;
--color-bg-yellow: #fdf3d1;
}
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<title>Stapxs QQ Lite</title>
<link rel="stylesheet" href="bcui/css/style.css">
<link rel="stylesheet" href="bcui/css/color-light.css">
<link rel="stylesheet" href="css/append-light.css">
</head>
<body>
<noscript>
Expand Down
22 changes: 12 additions & 10 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
</div>
<div class="opt-main-tab">
<Options
:show="tags.page == 'Options'"
:class="tags.page == 'Options' ? 'active' : ''"
:config="runtimeData.sysConfig"
:info="runtimeData.loginInfo"
Expand All @@ -111,15 +112,15 @@
</div>
</div>
<component
ref="chat"
v-if="loginInfo.status && runtimeData.chatInfo && runtimeData.chatInfo.show.id != 0"
v-show="tags.showChat"
:is="runtimeData.pageView.chatView"
:mumberInfo="runtimeData.chatInfo.info.now_member_info == undefined ? {} : runtimeData.chatInfo.info.now_member_info"
:mergeList="runtimeData.mergeMessageList"
:list= "runtimeData.messageList"
:chat="runtimeData.chatInfo"
@userClick="changeChat">
ref="chat"
v-if="loginInfo.status && runtimeData.chatInfo && runtimeData.chatInfo.show.id != 0"
v-show="tags.showChat"
:is="runtimeData.pageView.chatView"
:mumberInfo="runtimeData.chatInfo.info.now_member_info == undefined ? {} : runtimeData.chatInfo.info.now_member_info"
:mergeList="runtimeData.mergeMessageList"
:list= "runtimeData.messageList"
:chat="runtimeData.chatInfo"
@userClick="changeChat">
</component>
<TransitionGroup class="app-msg" name="appmsg" tag="div">
<div v-for="msg in appMsgs" :key="'appmsg-' + msg.id">
Expand Down Expand Up @@ -458,7 +459,6 @@ export default defineComponent({
// 初始化功能
App.createMenu() // Electron:创建菜单
App.createIpc() // Electron:创建 IPC 通信
App.loadAppendStyle() // 加载额外样式
// 加载开发者相关功能
if (process.env.NODE_ENV == 'development') {
document.title = 'Stapxs QQ Lite (Dev)'
Expand All @@ -477,6 +477,8 @@ export default defineComponent({
if(app) app.classList.add('withBar')
}
Option.runAS('opt_auto_gtk', Option.get('opt_auto_gtk'))
// 加载额外样式
App.loadAppendStyle()
// 加载密码保存和自动连接
loginInfo.address = runtimeData.sysConfig.address
if(runtimeData.sysConfig.save_password && runtimeData.sysConfig.save_password != true) {
Expand Down
18 changes: 18 additions & 0 deletions src/assets/css/append/append_full_transparent.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.home-body,
.main-body > ul,
.friend-list,
.friend-list-space,
.chat-pan,
.chat-pan > div.bg,
.editor-main,
.opt-main,
.script-view,
.opt-main > div:last-child {
background-color: transparent !important;
background: transparent !important;
box-shadow: unset !important;
}

#app {
background: rgba(var(--color-bg-rgb), 0.1) !important;
}
5 changes: 4 additions & 1 deletion src/assets/css/append/append_vibrancy.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
html, body {
background: transparent;
}

.home-body {
background: rgba(var(--color-card-rgb), 0.6);
}
Expand Down Expand Up @@ -94,7 +98,6 @@
}
.script-view .list > header > span,
.script-view .list-body > div {
background: transparent;
backdrop-filter: blur(10px);
}

Expand Down
18 changes: 18 additions & 0 deletions src/assets/css/msg.css
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,24 @@
margin: 0 5px;
}

.note-notify {
transition: border .5s;
border: 1px solid transparent;
}
.note-notify img {
display: inline-block;
width: 1rem;
margin: 0 3px;
}
.note-notify span {
margin: 0 3px;
color: var(--color-main);
font-weight: bold;
}
.note.poking > div.note-notify {
border: 1px solid var(--color-main);
}

@media (max-width: 992px) {
/* 消息体 */
.message > img {
Expand Down
35 changes: 35 additions & 0 deletions src/assets/css/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,41 @@
margin-left: 40px;
}

.bot-status {
background: var(--color-card-1);
transition: background .3s;
padding: 10px;
margin-top: -10px;
margin-bottom: 10px;
border-radius: 7px;
display: flex;
flex-direction: row;
align-items: center;
}
.bot-status.normal {
background: var(--color-bg-green);
}
.bot-status.slow {
background: var(--color-bg-yellow);
}
.bot-status > div {
transition: background .3s;
background: var(--color-main);
width: 0.5rem;
height: 0.5rem;
border-radius: 100%;
margin-right: 10px;
}
.bot-status.normal > div {
background: var(--color-green);
}
.bot-status.slow > div {
background: var(--color-yellow);
}
.bot-status > span {
font-size: 0.85rem;
}

.theme-color-col {
flex-direction: row-reverse !important;
margin-right: 0 !important;
Expand Down
4 changes: 2 additions & 2 deletions src/assets/css/view.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
html, body {
background: var(--color-main);
font-family: 'Arial', 'Helvetica', 'sans-serif';
user-select: none;
overflow: hidden;
height: 100%;
Expand Down Expand Up @@ -384,7 +386,6 @@ textarea:focus {
border-radius: 7px;
transform: translate(0, 0);
transition: background .2s, color .2s, transform .2s;
align-items: center;
}
.friend-body.active {
background: var(--color-main);
Expand Down Expand Up @@ -424,7 +425,6 @@ textarea:focus {
overflow: hidden;
}
.friend-body > div:nth-child(1) {
height: 54px;
flex: unset;
width: 4px;
background: var(--color-main);
Expand Down
15 changes: 15 additions & 0 deletions src/assets/l10n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,21 @@
"sys_notice_message": "留言",
"sys_notice_new_friend": "请求加为好友",
"sys_notice_invite_group": "邀请你加入群聊",
"chat_at_all": "全体成员",
"scripts_run_newNotice": "新通知",
"option_view_always_top": "置顶窗口",
"option_view_always_top_tip": "你也不想想让你的对象知道你不在看 ta 的消息吧 ~",
"option_default": "默认",
"option_vibrancy_mode_vibrancy": "完整模糊",
"option_vibrancy_mode_transparent": "完整透明",
"option_view_vibrancy_mode": "窗口透明模式",
"option_view_vibrancy_mode_tip": "怎么看光还要挑三拣四的",
"option_dev_restart_tip1": "此操作将在重启应用后生效,现在就要重启吗?",
"option_dev_restart_tip2": "此操作仅供娱乐,将会在下次关闭时恢复。",
"a_inner_script": "这是个内嵌示例脚本,你可以修改它并保存使用。",
"opt_bot_status_normal": "连接正常({timeout} - {step} s)",
"opt_bot_status_slow": "连接延迟({timeout} - {step} s)",
"opt_bot_status_loading": "正在收集连接信息……",

"menu_about": "关于",
"menu_update": "检查更新…",
Expand Down
4 changes: 2 additions & 2 deletions src/assets/pathMap/NapCat.Onebot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ message_list:
name: get_group_msg_history
private_name: get_friend_msg_history
source: $.data.messages[*]
pageed: false # 是否支持分页(id + count 获取)
pagerType: full # 分页类型:全量 full / 增量 incremental / 无分页 none
type: $.data
message_type:
user: private
Expand Down Expand Up @@ -137,7 +137,7 @@ leave_group:
# 获取收藏表情
roaming_stamp:
name: fetch_custom_face
pageed: true
pagerType: full
# 获取历史会话
recent_contact:
name: get_recent_contact
Expand Down
12 changes: 12 additions & 0 deletions src/assets/scripts/_scriptList.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"title": "自动回应",
"name": "autoResponse",
"condition": "message"
},
{
"title": "刷新特别关心",
"name": "createSpecialCare",
"condition": "userFlush"
}
]
11 changes: 11 additions & 0 deletions src/assets/scripts/autoResponse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
title: 自动回应
*/

const id = this.msgInfo.group_id ?? this.msgInfo.private_id
const blacklist = []

if (this.isMe && blacklist.indexOf(id) === -1) {
this.sendMsg('set_msg_emoji_like',
{ 'message_id': this.message.message_id, 'emoji_id': '66' })
}
Loading

0 comments on commit 2bf3d6d

Please sign in to comment.