@dsh-plugin/dsh-ui-experience 1.0.0-dev.43491051069 → 1.0.0-dev.43491412024
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/README.md +7 -0
- package/lib/client.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,6 +141,12 @@ M3 那侧的分离要说明白:Material 3 的 `emphasized` 整体是两段首
|
|
|
141
141
|
- 无需随 DSH 更新维护:新增或改名的组件自动被覆盖。
|
|
142
142
|
- 精确还原:写入前整块记录 `cssText`,关闭时原样写回;若期间被第三方改过则在日志中说明后仍然还原。
|
|
143
143
|
|
|
144
|
+
### 滚动驱动动画不动
|
|
145
|
+
|
|
146
|
+
`scroll-timeline` / `animation-timeline` 驱动的动画,进度来自滚动容器而不是时钟。这类动画的 `animation-timing-function` 不是「一条随时间推进的曲线」,而是把滚动位置映射到迭代进度——给它套缓动,等于让遮罩在滚动前段就淡完然后定住,改的是效果本身而非手感。因此只要某条规则的 `animation-timeline` 不是 `auto` / `none`,本层就整条跳过。
|
|
147
|
+
|
|
148
|
+
DSH 目前只有一处用到(提问卡片标题的溢出遮罩 `--question-copy`)。
|
|
149
|
+
|
|
144
150
|
### 关键帧感知
|
|
145
151
|
|
|
146
152
|
动画该用哪条曲线,取决于它的 `@keyframes` 到底在动什么。扫描时先建立「关键帧名 → 它改动的属性集合」,再据此判定:同时含 `transform` 的是位移,纯 `opacity` 的是效果。查不到名字(定义在跨源样式表里)时按效果处理。
|
|
@@ -184,6 +190,7 @@ M3 那侧的分离要说明白:Material 3 的 `emphasized` 整体是两段首
|
|
|
184
190
|
- M3 动效的「位移 / 效果」判定依据属性名与关键帧内容,不分析属性的实际取值变化;判定不出来的情况(例如只由 `all` 声明的过渡)按效果处理,宁可不给过冲。
|
|
185
191
|
- 跨源样式表里的规则无法改写,只会在日志中记录。
|
|
186
192
|
- 本层只改写曲线与时长,不新增、不改写关键帧本身;DSH 没定义的动效不会因此出现。
|
|
193
|
+
- **滚动本身不归本层管**。三种机制各走各的:`scroll-behavior: smooth`(全仓一处,dock 标签条)不是 transition/animation,本层不碰,只有减弱动效时随压制表置为 `auto`;脚本调用的 `scrollTo({behavior:'smooth'})`(聊天跟随、轨迹表定位、插件页高亮)由浏览器决定时长与曲线,CSS 与 JS 都读不到也改不了;第三条即上面说的滚动驱动动画,本层显式跳过。
|
|
187
194
|
- 浏览器半在刷新页面时重载,宿主半只在进程重启时重载。两者版本不一致时(刚升级插件但没重启 DSH),M3 动效行会保持无操作并在控制台记录一行原因,配色功能不受影响。
|
|
188
195
|
|
|
189
196
|
## 样式基线
|
package/lib/client.js
CHANGED
|
@@ -186,7 +186,8 @@
|
|
|
186
186
|
selector: "animation-name",
|
|
187
187
|
duration: "animation-duration",
|
|
188
188
|
timing: "animation-timing-function",
|
|
189
|
-
iterations: "animation-iteration-count"
|
|
189
|
+
iterations: "animation-iteration-count",
|
|
190
|
+
timeline: "animation-timeline"
|
|
190
191
|
};
|
|
191
192
|
var DURATION_TOKENS = [
|
|
192
193
|
"--ds-transition-duration",
|
|
@@ -256,8 +257,9 @@
|
|
|
256
257
|
const durations = splitList(declaration.getPropertyValue(family.duration));
|
|
257
258
|
const timings = splitList(declaration.getPropertyValue(family.timing));
|
|
258
259
|
const iterations = family.iterations === void 0 ? [] : splitList(declaration.getPropertyValue(family.iterations));
|
|
260
|
+
const timelines = family.timeline === void 0 ? [] : splitList(declaration.getPropertyValue(family.timeline));
|
|
259
261
|
if (selectors.length === 0 && durations.length === 0 && timings.length === 0) return false;
|
|
260
|
-
const count = Math.max(selectors.length, durations.length, timings.length, 1);
|
|
262
|
+
const count = Math.max(selectors.length, durations.length, timings.length, timelines.length, 1);
|
|
261
263
|
const nextTimings = [];
|
|
262
264
|
const nextDurations = [];
|
|
263
265
|
let timingChanged = false;
|
|
@@ -268,7 +270,9 @@
|
|
|
268
270
|
const originalDuration = entryAt(durations, index);
|
|
269
271
|
const originalMs = originalDuration === void 0 ? void 0 : parseDurationMs(originalDuration);
|
|
270
272
|
const infinite = entryAt(iterations, index) === "infinite";
|
|
271
|
-
|
|
273
|
+
const timeline = entryAt(timelines, index);
|
|
274
|
+
const scrollDriven = timeline !== void 0 && timeline !== "auto" && timeline !== "none";
|
|
275
|
+
if (selector === "none" || scrollDriven) {
|
|
272
276
|
if (originalTiming !== void 0) nextTimings.push(originalTiming);
|
|
273
277
|
if (originalDuration !== void 0) nextDurations.push(originalDuration);
|
|
274
278
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plugin/dsh-ui-experience",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.43491412024",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "UI experience enhancements for DeepSeek Harness: follow the system matugen Material You palette as the interface theme, and rewrite interface motion onto Material 3 / Material 3 Expressive curves.",
|
|
6
6
|
"license": "MIT",
|