@dsh-plugin/dsh-ui-experience 1.0.0-dev.43490289639 → 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 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` 的是效果。查不到名字(定义在跨源样式表里)时按效果处理。
@@ -166,6 +172,7 @@ M3 那侧的分离要说明白:Material 3 的 `emphasized` 整体是两段首
166
172
 
167
173
  - 覆盖页面上的全部样式表,包括其他插件注入的。首次应用时全量扫描,之后用 `MutationObserver` 监视 `head` 与 `body`;只有当新增节点本身是 `<style>` / `<link>`,或子树里含有时才补扫——聊天流式输出每帧都在改 DOM,无条件补扫会把一次性开销变成每帧开销。
168
174
  - 通过 `document.adoptedStyleSheets` 挂载的构造式样式表不是 DOM 变更,观察者看不到它,只能在下一次全量扫描(切换曲线族、解除减弱动效、重新应用设置)时被读到。
175
+ - 同理,对已挂载 `<style>` 再改 `textContent`、或在它的 `sheet` 上 `insertRule`/`replaceSync`,都不产生新增节点,也要等下一次全量扫描。DSH 自身与插件加载器都是「建 `<style>` → 设文本 → 挂载」,不受影响。
169
176
  - 跨源样式表读不到 `cssRules`,会在浏览器控制台记录一行并跳过——这类表的规则无法改写,静默跳过会让部分界面停留在原生曲线而无迹可循。(这条诊断走控制台而非 `~/.dsh/ui-experience.log`:后者由宿主半写入,浏览器半够不到文件系统。)
170
177
  - 状态会写在 `<html data-dsh-uix-motion="m3|m3e">` 上,便于区分曲线来源。
171
178
 
@@ -183,6 +190,7 @@ M3 那侧的分离要说明白:Material 3 的 `emphasized` 整体是两段首
183
190
  - M3 动效的「位移 / 效果」判定依据属性名与关键帧内容,不分析属性的实际取值变化;判定不出来的情况(例如只由 `all` 声明的过渡)按效果处理,宁可不给过冲。
184
191
  - 跨源样式表里的规则无法改写,只会在日志中记录。
185
192
  - 本层只改写曲线与时长,不新增、不改写关键帧本身;DSH 没定义的动效不会因此出现。
193
+ - **滚动本身不归本层管**。三种机制各走各的:`scroll-behavior: smooth`(全仓一处,dock 标签条)不是 transition/animation,本层不碰,只有减弱动效时随压制表置为 `auto`;脚本调用的 `scrollTo({behavior:'smooth'})`(聊天跟随、轨迹表定位、插件页高亮)由浏览器决定时长与曲线,CSS 与 JS 都读不到也改不了;第三条即上面说的滚动驱动动画,本层显式跳过。
186
194
  - 浏览器半在刷新页面时重载,宿主半只在进程重启时重载。两者版本不一致时(刚升级插件但没重启 DSH),M3 动效行会保持无操作并在控制台记录一行原因,配色功能不受影响。
187
195
 
188
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
- if (selector === "none") {
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;
@@ -295,6 +299,7 @@
295
299
  return changed;
296
300
  }
297
301
  function scan() {
302
+ if (wantsReduced()) return;
298
303
  const active = settings;
299
304
  if (active === void 0 || active.mode === "off") return;
300
305
  const sheets = readableSheets();
@@ -432,11 +437,7 @@
432
437
  document.documentElement.setAttribute(MOTION_ATTRIBUTE, next.mode);
433
438
  realize();
434
439
  },
435
- refresh,
436
- restore,
437
- dispose() {
438
- restore();
439
- }
440
+ restore
440
441
  };
441
442
  }
442
443
 
@@ -1243,7 +1244,7 @@
1243
1244
  return () => {
1244
1245
  disposed = true;
1245
1246
  teardown();
1246
- motion.dispose();
1247
+ motion.restore();
1247
1248
  };
1248
1249
  }, "ui-experience: page-level layers");
1249
1250
  void poll();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plugin/dsh-ui-experience",
3
- "version": "1.0.0-dev.43490289639",
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",