dsh-remote-plugin 0.5.3 → 0.5.5

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.
@@ -0,0 +1,57 @@
1
+ /* DSH Remote 皮肤系统 · 零依赖
2
+ * html[data-theme] = default(默认深空) | dark(落日) | light(易北爱乐厅) | neutral(草原孤塔)
3
+ * 优先级: localStorage dshTheme > prefers-color-scheme(浅→light, 深→default)
4
+ * set() 写入用户显式选择; applyCurrent() 只应用不写, 用于跟随系统变化。 */
5
+ 'use strict'
6
+ ;(function () {
7
+ const KEY = 'dshTheme'
8
+ const VALID = ['default', 'dark', 'light', 'neutral']
9
+ const mq = window.matchMedia('(prefers-color-scheme: light)')
10
+ const store = {
11
+ get(k) { try { return localStorage.getItem(k) } catch { return null } },
12
+ set(k, v) { try { localStorage.setItem(k, v) } catch {} }
13
+ }
14
+
15
+ function system() {
16
+ return mq.matches ? 'light' : 'default'
17
+ }
18
+
19
+ function get() {
20
+ const saved = store.get(KEY)
21
+ return VALID.includes(saved) ? saved : system()
22
+ }
23
+
24
+ function syncMeta() {
25
+ const bg = getComputedStyle(document.documentElement).getPropertyValue('--dsr-bg').trim()
26
+ const meta = document.querySelector('meta[name="theme-color"]')
27
+ if (meta && bg) meta.setAttribute('content', bg)
28
+ }
29
+
30
+ function applyAttr(t) {
31
+ document.documentElement.setAttribute('data-theme', t)
32
+ syncMeta()
33
+ }
34
+
35
+ function applyCurrent() {
36
+ applyAttr(get())
37
+ return get()
38
+ }
39
+
40
+ function set(t) {
41
+ if (!VALID.includes(t)) t = get()
42
+ document.documentElement.setAttribute('data-theme', t)
43
+ store.set(KEY, t)
44
+ syncMeta()
45
+ return t
46
+ }
47
+
48
+ // 未手动选择时跟随系统变化
49
+ if (mq.addEventListener) {
50
+ mq.addEventListener('change', () => { if (!store.get(KEY)) applyCurrent() })
51
+ } else if (mq.addListener) {
52
+ mq.addListener(() => { if (!store.get(KEY)) applyCurrent() })
53
+ }
54
+
55
+ applyCurrent()
56
+ window.DSHTheme = { KEY, VALID, system, get, set, applyCurrent }
57
+ })()
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.5.3",
2
+ "version": "0.5.5",
3
3
  "apkUrl": "dsh-remote.apk",
4
- "releasedAt": "2026-08-16T08:04:08.551Z",
5
- "notes": "界面中英双语(App/管理页,跟随系统语言,可手动切换);抽屉 UI 优化:token 独占一行、设备列表窄屏卡片式、标题徽章不换行;修复扫码配对误报与二维码生成失败;修复未设 token 时反复重连导致的认证失败计数增长"
4
+ "releasedAt": "2026-08-16T15:15:39.748Z",
5
+ "notes": "修复:APK 内置版本文件滞后导致“已装新版本仍提示更新”;检查更新弹窗只显示版本号,完整说明在设置页展开查看"
6
6
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.5.3"
2
+ "version": "0.5.5"
3
3
  }