@linxin666/dsh-client-ui-skin-center 0.3.16 → 0.3.18

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.
@@ -45,7 +45,7 @@
45
45
  | `data-dsh-wallpaper-active` | html + body(body/html 级,另行管理) | WE 壁纸挂载期间置 `true`,卸载 / 禁用清除;供皮肤 CSS 与壁纸中和规则锚定(#734) |
46
46
  | `data-dsh-wallpaper-surface` | 官方 shell 全视口背景元素 + 侧栏工作区淡化条(元素级) | `WallpaperController.markWallpaperSurfaces()` 在 WE 壁纸挂载期间打标(全视口 bg-base 背景 + `data-slot="sidebar.workspaces"` 内渐变淡化条),命中 `html[data-dsh-wallpaper-active] [data-dsh-wallpaper-surface]` 中和;卸载清除,不含哈希类依赖(#734) |
47
47
 
48
- ## part 组(49 行,含各 owner 行)
48
+ ## part 组(70 行,含各 owner 行)
49
49
 
50
50
  shell 区域(owner: shell):
51
51
 
@@ -89,6 +89,7 @@ family / 插件区域:
89
89
  | `card` | skill-explorer | 技能中心模态卡;`[data-dsh-plugin="skill-explorer"] [data-dsh-part="card"]` |
90
90
  | `tab-bar` / `tab` | skill-explorer | 技能中心页签条/页签;`[data-dsh-plugin="skill-explorer"] [data-dsh-part="tab-bar"]` / `[data-dsh-plugin="skill-explorer"] [data-dsh-part="tab"]` |
91
91
  | `skill-row` | skill-explorer | 技能卡行;`[data-dsh-plugin="skill-explorer"] [data-dsh-part="skill-row"]` |
92
+ | `filter-bar` | skill-explorer | 技能列表筛选条(搜索框 + 工作区选择);`[data-dsh-plugin="skill-explorer"] [data-dsh-part="filter-bar"]` |
92
93
  | `header` | doctor | 救助控制台头部;`[data-dsh-plugin="doctor"] [data-dsh-part="header"]` |
93
94
  | `enable` | doctor | 救助模式启用行 |
94
95
  | `status` | doctor | 系统状态卡 |
@@ -118,8 +119,16 @@ family / 插件区域:
118
119
  | `trend-card` / `usage-chart` | usage | 近 30 天卡 / 其中的提供方-模型条形图;`[data-dsh-part="trend-card"]` 内 `[data-dsh-part="usage-chart"]` |
119
120
  | `settings-row` | usage | 插件设置行;`[data-dsh-part="settings-row"]` |
120
121
  | `plan-card` / `plan-window` | usage | 套餐卡 / 套餐窗口行(个人套餐页签);`[data-dsh-part="plan-card"]` 内窗口行 |
122
+ | `panel` | model-capabilities | 提供方卡片能力扩展区根;`[data-dsh-plugin="model-capabilities"][data-dsh-part="panel"]` |
123
+ | `toggle` | model-capabilities | 扩展区折叠头按钮;panel 内 `button[data-dsh-part="toggle"]` |
124
+ | `model-row` / `model-toggle` | model-capabilities | 逐模型能力行与其展开按钮;panel 内 `li[data-dsh-part="model-row"]` 及其中 `button[data-dsh-part="model-toggle"]` |
125
+ | `image-input` / `efforts-mode` | model-capabilities | 图片输入勾选组 / 推理档位三态组;展开行内字段容器 `[data-dsh-part="image-input"]`、`[data-dsh-part="efforts-mode"]` |
126
+ | `wire-input` | model-capabilities | 档位发送值输入行;`[data-dsh-part="wire-input"]` 内含 `input[type="text"]` |
127
+ | `save` / `reset` / `disable` / `enable` / `reload` | model-capabilities | 扩展区动作按钮(保存 / 重置 / 禁用此提供方 / 启用 / 重新读取);panel 内裸值按钮 |
128
+ | `disabled-state` | model-capabilities | 已禁用提供方的卡片提示区(含启用按钮);panel 内 `[data-dsh-part="disabled-state"]` |
129
+ | `disabled-footer` / `disabled-row` | model-capabilities | Models 页底部存档区与其行;`settings.models.footer` 槽内 `section[data-dsh-part="disabled-footer"]` 与其中 `li[data-dsh-part="disabled-row"]` |
121
130
 
122
- ## plugin 组(14 个,含停更 aionui-panel)
131
+ ## plugin 组(15 个,含停更 aionui-panel)
123
132
 
124
133
  | data-dsh-plugin | owner | 锚定方式 |
125
134
  | --- | --- | --- |
@@ -137,6 +146,7 @@ family / 插件区域:
137
146
  | `session-id` | dsh-session-id | footer action slot entry id `session-id`;`[data-dsh-plugin="session-id"]`(面板 overlay 根 + 入口触发器) |
138
147
  | `miku-pet` | dsh-miku-pet | 宠物浮层根 `[data-dsh-plugin="miku-pet"]`;host 路由前缀 `/miku-pet/*`;设置页 settings.section id `miku-pet-config` |
139
148
  | `usage` | dsh-usage | 一级设置分区 settings.section id `dsh-usage`(创意工坊下方);`[data-dsh-plugin="usage"]` |
149
+ | `model-capabilities` | dsh-model-capabilities | Models 页 `settings.models.provider-card` keyed 槽 key `llm-pi-ai`(提供方卡片扩展区)+ `settings.models.footer` 槽 entry id `ui-model-capabilities`(存档区);`[data-dsh-plugin="model-capabilities"]` |
140
150
 
141
151
  ## 已知脆弱点(上游主题缝 PR 诉求)
142
152
 
package/lib/client.js CHANGED
@@ -3365,6 +3365,48 @@ window.__ModuleLoader__.load({
3365
3365
  const extracted = extractSkinBackgroundUserLayer(user);
3366
3366
  return extracted === null ? "" : JSON.stringify(extracted);
3367
3367
  }
3368
+ /** Seed the reconcile state from the scope snapshot visible at construction. */
3369
+ function initialSkinBackgroundReconcileState(snapshot) {
3370
+ return {
3371
+ v2Loaded: false,
3372
+ bootSyncSeen: false,
3373
+ lastRevision: snapshot.revision,
3374
+ lastUserJson: serializeSkinBackgroundUserLayer(snapshot.user)
3375
+ };
3376
+ }
3377
+ /**
3378
+ * Fold one scope publication into the reconcile state and produce the v2-safe
3379
+ * patch to merge into the live background values (null = nothing to apply).
3380
+ *
3381
+ * The boot document never merges, whichever order it lands in:
3382
+ * - a publication seen before the v2 GET completes is only recorded, so the
3383
+ * post-load check reads it as the unchanged boot snapshot, not an edit;
3384
+ * - the first revisioned publication of the plugin's lifetime (the document
3385
+ * resync itself) is consumed as the boot sync even when it lands after the
3386
+ * GET, because a genuine settings-page edit can only follow the document.
3387
+ */
3388
+ function reconcileSkinBackgroundPublication(state, current, snapshot) {
3389
+ const seen = {
3390
+ ...state,
3391
+ lastRevision: snapshot.revision ?? state.lastRevision,
3392
+ lastUserJson: serializeSkinBackgroundUserLayer(snapshot.user)
3393
+ };
3394
+ if (!state.v2Loaded) return {
3395
+ state: seen,
3396
+ patch: null
3397
+ };
3398
+ if (!state.bootSyncSeen) return {
3399
+ state: snapshot.revision === void 0 ? seen : {
3400
+ ...seen,
3401
+ bootSyncSeen: true
3402
+ },
3403
+ patch: null
3404
+ };
3405
+ return {
3406
+ state: seen,
3407
+ patch: reconcileSkinBackgroundScope(current, snapshot, state.lastRevision, state.lastUserJson).patch
3408
+ };
3409
+ }
3368
3410
  /**
3369
3411
  * Accept a scope publication only when its namespace revision is new AND the
3370
3412
  * user layer has actually changed. A revision bump with identical user-layer
@@ -4969,7 +5011,7 @@ window.__ModuleLoader__.load({
4969
5011
  /** The building package's version, when the bundle carries it. */
4970
5012
  function bakedVersion() {
4971
5013
  try {
4972
- return "0.3.16";
5014
+ return "0.3.18";
4973
5015
  } catch {
4974
5016
  return;
4975
5017
  }
@@ -5121,33 +5163,31 @@ window.__ModuleLoader__.load({
5121
5163
  if (value === void 0 || value === null) return null;
5122
5164
  return value;
5123
5165
  };
5124
- let v2Loaded = false;
5125
- let lastScopeRevision = backgroundScope.getSnapshot().revision;
5126
- let lastUserJson = serializeSkinBackgroundUserLayer(backgroundScope.getSnapshot().user);
5127
5166
  const background = new BackgroundController(scopeConfig(), persistBackground);
5167
+ let reconcileState = initialSkinBackgroundReconcileState(backgroundScope.getSnapshot());
5128
5168
  const reconcileScope = () => {
5129
- if (!v2Loaded) return;
5130
- const snapshot = backgroundScope.getSnapshot();
5131
- const result = reconcileSkinBackgroundScope(background.snapshot(), {
5132
- revision: snapshot.revision,
5133
- user: snapshot.user
5134
- }, lastScopeRevision, lastUserJson);
5135
- lastScopeRevision = result.revision;
5136
- lastUserJson = result.lastUserJson;
5137
- if (!result.accepted || result.patch === null) return;
5138
- const current = background.snapshot();
5169
+ const result = reconcileSkinBackgroundPublication(reconcileState, background.snapshot(), backgroundScope.getSnapshot());
5170
+ reconcileState = result.state;
5171
+ if (result.patch === null) return;
5172
+ const currentSnapshot = background.snapshot();
5139
5173
  background.init({
5140
- ...current,
5174
+ ...currentSnapshot,
5141
5175
  ...result.patch
5142
5176
  });
5143
5177
  persistBackground(background.snapshot());
5144
5178
  };
5145
5179
  fetch(V2_ACTIVE_URL).then((res) => res.ok ? res.json() : null).then((body) => {
5146
- v2Loaded = true;
5180
+ reconcileState = {
5181
+ ...reconcileState,
5182
+ v2Loaded: true
5183
+ };
5147
5184
  if (body?.background) background.init(body.background);
5148
5185
  reconcileScope();
5149
5186
  }).catch(() => {
5150
- v2Loaded = true;
5187
+ reconcileState = {
5188
+ ...reconcileState,
5189
+ v2Loaded: true
5190
+ };
5151
5191
  reconcileScope();
5152
5192
  });
5153
5193
  ctx.effect(() => backgroundScope.subscribe(reconcileScope), "ui-skin-center: background scope sync");