dlaoshi-outfit 2.2.0 → 2.2.2
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/CHANGELOG.md +18 -0
- package/client.js +44 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.2 — 2026-10-23
|
|
4
|
+
|
|
5
|
+
立牌隐藏判据补强,设置页也会隐藏了。
|
|
6
|
+
|
|
7
|
+
- 由只认 `[role="dialog"][aria-modal="true"]` 改为认任意 `[role="dialog"]` / `[role="alertdialog"]`
|
|
8
|
+
- 新增遮挡测试:用 `elementFromPoint` 检查会话区中心是否真的位于最上层,
|
|
9
|
+
整页式的设置/插件页面(会话被盖住但仍挂载)也会判定为“不在聊天页”
|
|
10
|
+
- 回到聊天页自动恢复
|
|
11
|
+
|
|
12
|
+
## 2.2.1 — 2026-10-22
|
|
13
|
+
|
|
14
|
+
立牌只出现在聊天页。
|
|
15
|
+
|
|
16
|
+
- 轮询判断当前是否在聊天页:设置/插件等以 `[role="dialog"][aria-modal="true"]` 打开的页面,
|
|
17
|
+
或会话区不可见时,立牌整体隐藏(`display:none`),不再浮在二级页面之上
|
|
18
|
+
- 回到聊天页自动恢复,气泡状态保留
|
|
19
|
+
- 客户端测试新增 `data-on-chat` 断言
|
|
20
|
+
|
|
3
21
|
## 2.2.0 — 2026-10-22
|
|
4
22
|
|
|
5
23
|
重磅功能:**称呼与语气**(默认称呼「主人」)。
|
package/client.js
CHANGED
|
@@ -983,6 +983,46 @@ html.${SKIN_CLASS} body[data-ds-dark-theme] [data-turn-process-answer] {
|
|
|
983
983
|
balanceTimer.current = setTimeout(() => setBalanceOpen(false), ms === undefined ? BUBBLE_HOLD_MS : ms)
|
|
984
984
|
}
|
|
985
985
|
|
|
986
|
+
// The standee belongs to the conversation view only: settings, the plugin
|
|
987
|
+
// manager and other secondary pages are modal dialogs or replace the chat
|
|
988
|
+
// pane, and the standee must not float over them.
|
|
989
|
+
const [onChat, setOnChat] = useState(true)
|
|
990
|
+
useEffect(() => {
|
|
991
|
+
if (typeof document === 'undefined') return undefined
|
|
992
|
+
const check = () => {
|
|
993
|
+
let visible = true
|
|
994
|
+
try {
|
|
995
|
+
// Any dialog counts: settings, plugins and other secondary pages are
|
|
996
|
+
// dialogs, and not all of them carry aria-modal.
|
|
997
|
+
if (document.querySelector('[role="dialog"], [role="alertdialog"]')) visible = false
|
|
998
|
+
if (visible) {
|
|
999
|
+
const content = document.querySelector('[data-conversation-content]')
|
|
1000
|
+
if (content) {
|
|
1001
|
+
const rect = typeof content.getBoundingClientRect === 'function'
|
|
1002
|
+
? content.getBoundingClientRect()
|
|
1003
|
+
: null
|
|
1004
|
+
visible = rect === null || (rect.width > 0 && rect.height > 0)
|
|
1005
|
+
// A full-page settings view can keep the conversation mounted
|
|
1006
|
+
// behind it. Ask the browser what is actually on top at the
|
|
1007
|
+
// chat's own centre; if it is not the conversation, the chat is
|
|
1008
|
+
// covered and the standee has no business floating there.
|
|
1009
|
+
if (visible && rect && typeof document.elementFromPoint === 'function' && typeof window !== 'undefined') {
|
|
1010
|
+
const x = Math.min(window.innerWidth - 4, Math.max(4, rect.left + rect.width / 2))
|
|
1011
|
+
const y = Math.min(window.innerHeight - 4, Math.max(4, rect.top + 60))
|
|
1012
|
+
const hit = document.elementFromPoint(x, y)
|
|
1013
|
+
if (hit && !content.contains(hit)) visible = false
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
} catch (err) { visible = true }
|
|
1018
|
+
setOnChat((prev) => (prev === visible ? prev : visible))
|
|
1019
|
+
}
|
|
1020
|
+
check()
|
|
1021
|
+
const timer = setInterval(check, 600)
|
|
1022
|
+
if (timer && typeof timer.unref === 'function') timer.unref()
|
|
1023
|
+
return () => clearInterval(timer)
|
|
1024
|
+
}, [])
|
|
1025
|
+
|
|
986
1026
|
// Responsive size: the standee must fit the free right margin of the
|
|
987
1027
|
// conversation, so a windowed app gets a smaller standee instead of one
|
|
988
1028
|
// that covers the messages. Falls back to a viewport-proportional width,
|
|
@@ -1080,9 +1120,12 @@ html.${SKIN_CLASS} body[data-ds-dark-theme] [data-turn-process-answer] {
|
|
|
1080
1120
|
|
|
1081
1121
|
return h('div', {
|
|
1082
1122
|
class: `${PREFIX}-stats`,
|
|
1083
|
-
style:
|
|
1123
|
+
style: onChat
|
|
1124
|
+
? { right: STATS_PIN.right + 'px', bottom: STATS_PIN.bottom + 'px' }
|
|
1125
|
+
: { right: STATS_PIN.right + 'px', bottom: STATS_PIN.bottom + 'px', display: 'none' },
|
|
1084
1126
|
title: detail,
|
|
1085
1127
|
'data-popping': popping ? 'true' : 'false',
|
|
1128
|
+
'data-on-chat': onChat ? 'true' : 'false',
|
|
1086
1129
|
},
|
|
1087
1130
|
reportVisible || balanceVisible ? h('div', { class: `${PREFIX}-clouds` },
|
|
1088
1131
|
balanceVisible ? h('div', { key: 'balance', class: `${PREFIX}-cloud`, 'data-kind': 'balance' },
|