dsh-lifi-adapters 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +66 -2
- package/client.js +144 -0
- package/cordis.patch.yml +3 -0
- package/icon.svg +11 -0
- package/index.js +2 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +48 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Liue
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Liue 玻璃适配(dsh-lifi-adapters)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
把第三方 DSH 插件的页面与卡片接入 Liue 的玻璃体系,并**由本包提供**对外的玻璃表面契约(`.lifi-glass` 类、`--lifi-*` 变量、`window.dshLifiGlass`)。Liue 主包不再包含这部分内容。
|
|
4
|
+
|
|
5
|
+
- 纯客户端 CSS + 少量 JS,无 Host 端口、无网络请求、无数据读写。
|
|
6
|
+
- 独立安装/卸载,不内置在 Liue 包体中。
|
|
7
|
+
- 版本绑定:**本包 0.1.0 只兼容 Liue 0.2.7**。检测不到 `0.2.7` 时完全不注入样式(页面保持原样),并在控制台给出一条提示。
|
|
8
|
+
|
|
9
|
+
## 版本矩阵
|
|
10
|
+
|
|
11
|
+
| dsh-lifi-adapters | 兼容的 dsh-lifiwallpaper | 说明 |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| 0.1.0 | 0.2.7 | 首个公开契约版本;Liue 只提供 `data-dsh-ap-version` 标记 |
|
|
14
|
+
|
|
15
|
+
Liue 升级到新协议时,需要同步发布新的 adapter 版本并在 `client.js` 里修改 `REQUIRED_LIFI`。
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
在 DSH 的「插件」页安装本包(或使用 `plugin_manager install_bundle`),启用后刷新页面。只有 Liue 同时启用且玻璃模式不是「无」时才会生效。
|
|
20
|
+
|
|
21
|
+
## 对第三方开发者的契约
|
|
22
|
+
|
|
23
|
+
安装本包后,其他插件只需给容器加一个类:
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="lifi-glass">…</div>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
即可获得与 Liue 一致的玻璃:背景色、模糊、边框、圆角都会跟随用户的 Liue 设置。
|
|
30
|
+
|
|
31
|
+
可用变量(由本包定义在 `<html>` 上):
|
|
32
|
+
|
|
33
|
+
| 变量 | 含义 |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `--lifi-surface-bg` | 玻璃背景色(浅色/深色自动切换) |
|
|
36
|
+
| `--lifi-surface-border` | 玻璃边框色 |
|
|
37
|
+
| `--lifi-blur` | 背景模糊半径 |
|
|
38
|
+
| `--lifi-radius` | 圆角半径 |
|
|
39
|
+
|
|
40
|
+
检测:
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
if (window.dshLifiGlass?.protocol === 'lifi-appearance/0.2.7') {
|
|
44
|
+
// 可以使用 .lifi-glass
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
当 Liue 玻璃模式为「无」或本适配包被禁用时,`window.dshLifiGlass` 不存在,`.lifi-glass` 不产生任何样式,插件应回退到自己的默认背景。
|
|
49
|
+
|
|
50
|
+
## 已适配的第三方页面
|
|
51
|
+
|
|
52
|
+
| 插件 | 处理 |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `dsh-memory-evolve`(记忆 / 技能 / 待办 / Memory Evolve) | 页面根透明;顶层卡片玻璃;嵌套条目透明 |
|
|
55
|
+
| `billion-context`(上下文) | 仅 iframe 外框圆角与阴影;内部为跨源文档,无法注入样式 |
|
|
56
|
+
|
|
57
|
+
具体选择器见 `client.js` 顶部 CSS。
|
|
58
|
+
|
|
59
|
+
## 已知边界
|
|
60
|
+
|
|
61
|
+
- `billion-context` 的「上下文」是**跨源 iframe**(`/__bili/?embed=1&theme=…`)。浏览器同源策略禁止父页面修改其内部样式,只能处理外框;要统一内部背景需要 bili 侧支持透明背景或主题参数。
|
|
62
|
+
- 若第三方页面将来改用 Shadow DOM,需要单独适配。
|
|
63
|
+
- 本包只在 Liue 0.2.7 上验证;其他版本会主动禁用。
|
|
64
|
+
|
|
65
|
+
## 许可
|
|
66
|
+
|
|
67
|
+
MIT © 2026 Liue
|
package/client.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// dsh-lifi-adapters — glass surface bridge and third-party page adapters.
|
|
2
|
+
//
|
|
3
|
+
// Liue (dsh-lifiwallpaper) 0.2.7 deliberately does NOT ship the public glass
|
|
4
|
+
// API anymore. This adapter is the single owner of that contract:
|
|
5
|
+
//
|
|
6
|
+
// * it defines the `.lifi-glass` class and the --lifi-* variables,
|
|
7
|
+
// * it adapts dsh-memory-evolve / billion-context pages,
|
|
8
|
+
// * it exposes `window.dshLifiGlass` for feature detection,
|
|
9
|
+
// * and it stays completely inert unless the exact compatible Liue version
|
|
10
|
+
// is present (adapter 0.1.0 -> Liue 0.2.7).
|
|
11
|
+
window.__ModuleLoader__.load({
|
|
12
|
+
id: 'dsh-lifi-adapters',
|
|
13
|
+
factory: () => {
|
|
14
|
+
const ADAPTER_VERSION = '0.1.0'
|
|
15
|
+
const REQUIRED_LIFI = '0.2.7'
|
|
16
|
+
const STYLE_ID = 'dsh-lifi-adapters/glass'
|
|
17
|
+
|
|
18
|
+
const CSS = `
|
|
19
|
+
/* -- public Liue surface contract, defined here, not in Liue --------- */
|
|
20
|
+
html[data-lifi-adapters='1'] {
|
|
21
|
+
--lifi-radius: var(--dsh-ap-radius, 14px);
|
|
22
|
+
--lifi-blur: var(--dsh-ap-blur, 0px);
|
|
23
|
+
--lifi-surface-bg: rgba(255, 255, 255, var(--dsh-ap-alpha, 0.55));
|
|
24
|
+
--lifi-surface-border: rgba(255, 255, 255, 0.30);
|
|
25
|
+
}
|
|
26
|
+
html[data-lifi-adapters='1'][data-dsh-ap-scheme='dark'] {
|
|
27
|
+
--lifi-surface-bg: rgba(18, 20, 26, var(--dsh-ap-alpha, 0.55));
|
|
28
|
+
--lifi-surface-border: rgba(255, 255, 255, 0.12);
|
|
29
|
+
}
|
|
30
|
+
html[data-lifi-adapters='1'] .lifi-glass {
|
|
31
|
+
background-color: var(--lifi-surface-bg) !important;
|
|
32
|
+
-webkit-backdrop-filter: blur(var(--lifi-blur)) saturate(1.18) !important;
|
|
33
|
+
backdrop-filter: blur(var(--lifi-blur)) saturate(1.18) !important;
|
|
34
|
+
border: 1px solid var(--lifi-surface-border) !important;
|
|
35
|
+
border-radius: var(--lifi-radius) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* -- page roots: let the wallpaper through ------------------------- */
|
|
39
|
+
html[data-lifi-adapters='1'] .mt-panel,
|
|
40
|
+
html[data-lifi-adapters='1'] .me-panel,
|
|
41
|
+
html[data-lifi-adapters='1'] .coi-root,
|
|
42
|
+
html[data-lifi-adapters='1'] .sb-root,
|
|
43
|
+
html[data-lifi-adapters='1'] .pm-root,
|
|
44
|
+
html[data-lifi-adapters='1'] .bm-panel,
|
|
45
|
+
html[data-lifi-adapters='1'] .bb-pane {
|
|
46
|
+
background-color: transparent !important;
|
|
47
|
+
background-image: none !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* -- top-level cards: Liue glass ----------------------------------- */
|
|
51
|
+
html[data-lifi-adapters='1'] .me-block,
|
|
52
|
+
html[data-lifi-adapters='1'] .me-todo-quad,
|
|
53
|
+
html[data-lifi-adapters='1'] .me-guide-row,
|
|
54
|
+
html[data-lifi-adapters='1'] .me-archive-content,
|
|
55
|
+
html[data-lifi-adapters='1'] .mt-card,
|
|
56
|
+
html[data-lifi-adapters='1'] .mt-scope,
|
|
57
|
+
html[data-lifi-adapters='1'] .mt-key-add,
|
|
58
|
+
html[data-lifi-adapters='1'] .bb-card,
|
|
59
|
+
html[data-lifi-adapters='1'] .bb-session-line,
|
|
60
|
+
html[data-lifi-adapters='1'] .bb-members,
|
|
61
|
+
html[data-lifi-adapters='1'] .bb-room-msgs {
|
|
62
|
+
background-color: var(--lifi-surface-bg) !important;
|
|
63
|
+
-webkit-backdrop-filter: blur(var(--lifi-blur)) saturate(1.18) !important;
|
|
64
|
+
backdrop-filter: blur(var(--lifi-blur)) saturate(1.18) !important;
|
|
65
|
+
border-color: var(--lifi-surface-border) !important;
|
|
66
|
+
border-radius: var(--lifi-radius) !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* -- nested rows: transparent, the parent card carries the glass --- */
|
|
70
|
+
html[data-lifi-adapters='1'] .me-item,
|
|
71
|
+
html[data-lifi-adapters='1'] .me-todo-card,
|
|
72
|
+
html[data-lifi-adapters='1'] .mt-entry,
|
|
73
|
+
html[data-lifi-adapters='1'] .bb-member,
|
|
74
|
+
html[data-lifi-adapters='1'] .bm-item {
|
|
75
|
+
background-color: transparent !important;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* -- billion-context 上下文 is a cross-origin iframe: frame only ---- */
|
|
79
|
+
html[data-lifi-adapters='1'] iframe[src*='__bili'] {
|
|
80
|
+
border-radius: var(--lifi-radius, 14px);
|
|
81
|
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
|
|
82
|
+
}
|
|
83
|
+
`
|
|
84
|
+
|
|
85
|
+
let dispose = null
|
|
86
|
+
let observer = null
|
|
87
|
+
|
|
88
|
+
function liueVersion() {
|
|
89
|
+
return document.documentElement.getAttribute('data-dsh-ap-version')
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function install() {
|
|
93
|
+
if (document.querySelector(`style[data-plugin-css="${STYLE_ID}"]`)) return () => {}
|
|
94
|
+
const tag = document.createElement('style')
|
|
95
|
+
tag.dataset.plugin = 'dsh-lifi-adapters'
|
|
96
|
+
tag.dataset.pluginCss = STYLE_ID
|
|
97
|
+
tag.textContent = CSS
|
|
98
|
+
document.head.appendChild(tag)
|
|
99
|
+
document.documentElement.setAttribute('data-lifi-adapters', '1')
|
|
100
|
+
window.dshLifiGlass = Object.freeze({
|
|
101
|
+
version: ADAPTER_VERSION,
|
|
102
|
+
protocol: `lifi-appearance/${REQUIRED_LIFI}`,
|
|
103
|
+
surfaceClass: 'lifi-glass',
|
|
104
|
+
variables: ['--lifi-surface-bg', '--lifi-surface-border', '--lifi-blur', '--lifi-radius'],
|
|
105
|
+
})
|
|
106
|
+
return () => {
|
|
107
|
+
if (tag.parentNode) tag.parentNode.removeChild(tag)
|
|
108
|
+
document.documentElement.removeAttribute('data-lifi-adapters')
|
|
109
|
+
delete window.dshLifiGlass
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function sync() {
|
|
114
|
+
const compatible = liueVersion() === REQUIRED_LIFI
|
|
115
|
+
if (compatible && !dispose) {
|
|
116
|
+
dispose = install()
|
|
117
|
+
} else if (!compatible && dispose) {
|
|
118
|
+
dispose()
|
|
119
|
+
dispose = null
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function apply(ctx) {
|
|
124
|
+
ctx.effect(() => {
|
|
125
|
+
sync()
|
|
126
|
+
observer = new MutationObserver(sync)
|
|
127
|
+
observer.observe(document.documentElement, {
|
|
128
|
+
attributes: true,
|
|
129
|
+
attributeFilter: ['data-dsh-ap-version'],
|
|
130
|
+
})
|
|
131
|
+
return () => {
|
|
132
|
+
if (observer) observer.disconnect()
|
|
133
|
+
observer = null
|
|
134
|
+
if (dispose) {
|
|
135
|
+
dispose()
|
|
136
|
+
dispose = null
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}, 'dsh-lifi-adapters: glass styles')
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return { apply, inject: [] }
|
|
143
|
+
},
|
|
144
|
+
})
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="a" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#8fb7ff"/>
|
|
5
|
+
<stop offset="1" stop-color="#c58cff"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="64" height="64" rx="14" fill="#1b2030"/>
|
|
9
|
+
<rect x="10" y="14" width="44" height="16" rx="6" fill="url(#a)" opacity=".9"/>
|
|
10
|
+
<rect x="10" y="36" width="44" height="16" rx="6" fill="none" stroke="url(#a)" stroke-width="2" opacity=".9"/>
|
|
11
|
+
</svg>
|
package/index.js
ADDED
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-lifi-adapters",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Glass-surface contract and third-party page adapters for Liue (dsh-lifiwallpaper). Adapter 0.1.0 requires Liue 0.2.7.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./client": "./client.js",
|
|
11
|
+
"./package.json": "./package.json",
|
|
12
|
+
"./icon": "./icon.svg",
|
|
13
|
+
"./locale/*.json": "./locale/*.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"client.js",
|
|
18
|
+
"cordis.patch.yml",
|
|
19
|
+
"icon.svg",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"locale/*.json",
|
|
23
|
+
"package.json"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"dsh",
|
|
27
|
+
"dsh-plugin",
|
|
28
|
+
"deepseek-harness",
|
|
29
|
+
"lifi",
|
|
30
|
+
"glassmorphism",
|
|
31
|
+
"theme"
|
|
32
|
+
],
|
|
33
|
+
"dsh": {
|
|
34
|
+
"bundle": {
|
|
35
|
+
"patch": "./cordis.patch.yml"
|
|
36
|
+
},
|
|
37
|
+
"client": {
|
|
38
|
+
"platform": "web",
|
|
39
|
+
"immediately": true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/LiueCreater/dsh-lifi-adapters.git"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/LiueCreater/dsh-lifi-adapters#readme",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/LiueCreater/dsh-lifi-adapters/issues"
|
|
49
|
+
}
|
|
50
|
+
}
|