Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

九月累积更新 #122

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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