dlaoshi-outfit 2.2.0 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.1 — 2026-10-22
4
+
5
+ 立牌只出现在聊天页。
6
+
7
+ - 轮询判断当前是否在聊天页:设置/插件等以 `[role="dialog"][aria-modal="true"]` 打开的页面,
8
+ 或会话区不可见时,立牌整体隐藏(`display:none`),不再浮在二级页面之上
9
+ - 回到聊天页自动恢复,气泡状态保留
10
+ - 客户端测试新增 `data-on-chat` 断言
11
+
3
12
  ## 2.2.0 — 2026-10-22
4
13
 
5
14
  重磅功能:**称呼与语气**(默认称呼「主人」)。
package/client.js CHANGED
@@ -983,6 +983,34 @@ 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
+ if (document.querySelector('[role="dialog"][aria-modal="true"]')) visible = false
996
+ if (visible) {
997
+ const content = document.querySelector('[data-conversation-content]')
998
+ if (content) {
999
+ const rect = typeof content.getBoundingClientRect === 'function'
1000
+ ? content.getBoundingClientRect()
1001
+ : null
1002
+ visible = rect === null || (rect.width > 0 && rect.height > 0)
1003
+ }
1004
+ }
1005
+ } catch (err) { visible = true }
1006
+ setOnChat((prev) => (prev === visible ? prev : visible))
1007
+ }
1008
+ check()
1009
+ const timer = setInterval(check, 600)
1010
+ if (timer && typeof timer.unref === 'function') timer.unref()
1011
+ return () => clearInterval(timer)
1012
+ }, [])
1013
+
986
1014
  // Responsive size: the standee must fit the free right margin of the
987
1015
  // conversation, so a windowed app gets a smaller standee instead of one
988
1016
  // that covers the messages. Falls back to a viewport-proportional width,
@@ -1080,9 +1108,12 @@ html.${SKIN_CLASS} body[data-ds-dark-theme] [data-turn-process-answer] {
1080
1108
 
1081
1109
  return h('div', {
1082
1110
  class: `${PREFIX}-stats`,
1083
- style: { right: STATS_PIN.right + 'px', bottom: STATS_PIN.bottom + 'px' },
1111
+ style: onChat
1112
+ ? { right: STATS_PIN.right + 'px', bottom: STATS_PIN.bottom + 'px' }
1113
+ : { right: STATS_PIN.right + 'px', bottom: STATS_PIN.bottom + 'px', display: 'none' },
1084
1114
  title: detail,
1085
1115
  'data-popping': popping ? 'true' : 'false',
1116
+ 'data-on-chat': onChat ? 'true' : 'false',
1086
1117
  },
1087
1118
  reportVisible || balanceVisible ? h('div', { class: `${PREFIX}-clouds` },
1088
1119
  balanceVisible ? h('div', { key: 'balance', class: `${PREFIX}-cloud`, 'data-kind': 'balance' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlaoshi-outfit",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "description": "Anime whale-boy maid-outfit desktop pet, token/think-time standee and liquid-glass theme for DeepSeek Harness",
6
6
  "exports": {