dsh-remote-panel 0.4.0 → 0.4.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.
Files changed (2) hide show
  1. package/lib/client.js +13 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -1214,9 +1214,10 @@ window.__ModuleLoader__.load({
1214
1214
  background: #000 !important;
1215
1215
  }
1216
1216
 
1217
- /* 会话里的输入条座位:底部要让开手势条(WebView 里 env() 常为 0,由壳注入) */
1217
+ /* 会话里的输入条座位:像浮岛一样离底边留一段,同时让开手势条
1218
+ (WebView 里 env() 常为 0,安全区由壳注入 --dsh-safe-bottom) */
1218
1219
  .wSkVaW_composerSeat {
1219
- padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--dsh-safe-bottom, 0px)) !important;
1220
+ padding-bottom: calc(12px + max(env(safe-area-inset-bottom, 0px), var(--dsh-safe-bottom, 0px))) !important;
1220
1221
  }
1221
1222
 
1222
1223
  .wSkVaW_composerHero .uV2eYG_root {
@@ -1706,6 +1707,8 @@ window.__ModuleLoader__.load({
1706
1707
  tray.append(left, right)
1707
1708
  document.body.appendChild(tray)
1708
1709
 
1710
+ // 只在手机宽度下出现:桌面端这套样式本来就没注入,元素留着会变成一个裸 div 掉到页面底部
1711
+ const narrow = window.matchMedia?.('(max-width: 1023px)')
1709
1712
  let frame = 0
1710
1713
  let shown = ''
1711
1714
  const format = (text) => {
@@ -1720,6 +1723,11 @@ window.__ModuleLoader__.load({
1720
1723
  }
1721
1724
  const sync = () => {
1722
1725
  frame = 0
1726
+ if (narrow !== undefined && !narrow.matches) {
1727
+ tray.style.display = 'none'
1728
+ shown = ''
1729
+ return
1730
+ }
1723
1731
  const dock = document.querySelector('.uV2eYG_dock')
1724
1732
  const raw = dock?.textContent ?? ''
1725
1733
  const branch = dock?.querySelector('[data-composer-stat="git-branch"]')?.textContent?.trim() ?? ''
@@ -1737,9 +1745,12 @@ window.__ModuleLoader__.load({
1737
1745
  }
1738
1746
  const observer = new MutationObserver(schedule)
1739
1747
  observer.observe(document.body, { subtree: true, childList: true, characterData: true })
1748
+ const onViewport = () => schedule()
1749
+ narrow?.addEventListener?.('change', onViewport)
1740
1750
  sync()
1741
1751
  return () => {
1742
1752
  observer.disconnect()
1753
+ narrow?.removeEventListener?.('change', onViewport)
1743
1754
  if (frame !== 0) cancelAnimationFrame(frame)
1744
1755
  tray.remove()
1745
1756
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-remote-panel",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "DSH 远程访问控制面:部署向导、状态面板与一键配对(EasyTier + Caddy),数据面保持进程外。",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",