dsh-background-by-model 0.9.0 → 0.9.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- > The full release history lives here; the **Recent optimizations** section of [README.md](./README.md#recent-optimizations) lists only the two most recent releases (v0.9.0 / v0.8.2).
3
+ > The full release history lives here; the **Recent optimizations** section of [README.md](./README.md#recent-optimizations) lists only the two most recent releases (v0.9.1 / v0.9.0).
4
+
5
+ ## v0.9.1
6
+
7
+ - **The wallpaper layer's three sliders are one slider with a picker beside it** — opacity, brightness and blur share the row, the menu reads **Image opacity / Image brightness / Image blur**, and switching swaps the range, unit and written field together.
8
+ - **The picker uses the button fill and size, and the hint under the slider is gone.**
4
9
 
5
10
  ## v0.9.0
6
11
 
package/CHANGELOG.zh.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # 更新日志
2
2
 
3
- > 这里保留完整的历史记录;[README.zh.md](./README.zh.md#近期优化) 的「近期优化」一节只列最近两个版本(v0.9.0 / v0.8.2)。
3
+ > 这里保留完整的历史记录;[README.zh.md](./README.zh.md#近期优化) 的「近期优化」一节只列最近两个版本(v0.9.1 / v0.9.0)。
4
+
5
+ ## v0.9.1
6
+
7
+ - **壁纸层的三条滑块合并成一条,旁边用下拉框切换调节项** —— 透明度、亮度与模糊共用同一行,选项改叫「图片透明度 / 图片亮度 / 图片模糊」,切换时范围、单位与写回的字段一起换。
8
+ - **下拉框沿用按钮的底色与尺寸,滑块下方的说明文字删掉。**
4
9
 
5
10
  ## v0.9.0
6
11
 
package/README.md CHANGED
@@ -116,7 +116,7 @@ One switch on the Config page and nothing else: on 中秋节 and 国庆节 the w
116
116
  - **Theme color** — HSL wheel, numeric input, **Extract from this image** and an eyedropper. It belongs to the **image**, and an image with none follows the system theme rather than inheriting its rule's.
117
117
  - **Layout mode** — fit / fill / stretch / tile / center, stored per image; disabled on a rule that holds no picture, rather than hidden.
118
118
  - **Framing** — drag to pan and scroll to zoom, editable in fit mode only, stored per image and stable across window resizes.
119
- - **Background opacity** `0–100%`, **background brightness** `0–200%` (`100%` is the picture as saved) and **background blur** `0–60 px`, all three per rule. They treat the wallpaper layer only — the Interface tab's opacity treats interface surfaces.
119
+ - **Image opacity** `0–100%`, **image brightness** `0–200%` (`100%` is the picture as saved) and **image blur** `0–60 px`, all three per rule and edited through **one slider with a menu beside it** that picks the effect. They treat the image (wallpaper) layer only — the Interface tab's opacity treats interface surfaces.
120
120
 
121
121
  ### Global settings (Interface tab)
122
122
 
@@ -270,6 +270,10 @@ The effect is **Instant**, or the duration is `0` — an effect and a duration a
270
270
 
271
271
  > Only the two most recent releases are listed here; older ones live in [CHANGELOG.md](./CHANGELOG.md).
272
272
 
273
+ ### v0.9.1
274
+
275
+ - **The three wallpaper sliders are now one slider plus a picker** — the options read Image opacity / Image brightness / Image blur, the picker matches the buttons, and the hint below is gone.
276
+
273
277
  ### v0.9.0
274
278
 
275
279
  - **The RPC channel is the plugin's own prefix route on `webServer`**, so envelope, body cap and the auth fence stay here and `requestRejection` is asked per request.
@@ -277,12 +281,7 @@ The effect is **Instant**, or the duration is `0` — an effect and a duration a
277
281
  - **The browser entry point is wiring again** — skin, watchdogs, rotation, boot, model state, extraction and theme files are their own modules.
278
282
  - **Exporting a theme no longer cancels its own download**, and comments say why the code is what it is rather than what it used to be.
279
283
 
280
- ### v0.8.2
281
-
282
- - **The dsh dependency floor follows the host** — `engines.dsh`, the five `dsh-client-*` peers and `dsh-home-paths` now declare `>=0.2.1-alpha.2` instead of the 0.1.7 generation, so an install cannot be paired with the previous client packages, while `dsh-invariants` and `@deepseek-ai/cordis` stay as they are.
283
-
284
284
  ## Star History
285
-
286
285
  [![Star History Chart](https://api.star-history.com/chart?repos=HarmlessFunny/dsh-background-by-model&type=timeline&legend=bottom-right)](https://www.star-history.com/?repos=HarmlessFunny%2Fdsh-background-by-model&type=timeline&legend=bottom-right)
287
286
 
288
287
  ## License
package/README.zh.md CHANGED
@@ -116,7 +116,7 @@
116
116
  - **主题色** —— HSL 色轮、数值输入、**从本图提取**与吸管。它属于**图片**,没有自己颜色的图跟随系统主题,而不是继承规则色。
117
117
  - **布局模式** —— 适应 / 填充 / 拉伸 / 平铺 / 居中,逐图保存;规则没有图片时这排是禁用而不是隐藏。
118
118
  - **取景** —— 拖动平移、滚轮缩放,只在适应模式下可编辑,逐图保存,窗口缩放后保持一致。
119
- - **背景透明度** `0–100%`、**背景亮度** `0–200%`(`100%` 即原图)与**背景模糊** `0–60 px`,三者都按规则。它们只作用于壁纸层;「界面」页的透明度作用于界面各区域。
119
+ - **图片透明度** `0–100%`、**图片亮度** `0–200%`(`100%` 即原图)与**图片模糊** `0–60 px`,三者都按规则,并通过**同一条滑块 + 旁边的下拉框**切换调节项。它们只作用于图片层;「界面」页的透明度作用于界面各区域。
120
120
 
121
121
  ### 全局设置(「界面」页)
122
122
 
@@ -270,6 +270,10 @@ pnpm test # 构建 lib/、类型检查、跑十道检查
270
270
 
271
271
  > 这里只列最近两个版本;更早的版本见 [CHANGELOG.zh.md](./CHANGELOG.zh.md)。
272
272
 
273
+ ### v0.9.1
274
+
275
+ - **三条壁纸滑块合并成一条,旁边用下拉框切换** —— 选项改叫图片透明度 / 图片亮度 / 图片模糊,下拉框与按钮同色,滑块下的说明文字删掉。
276
+
273
277
  ### v0.9.0
274
278
 
275
279
  - **RPC 通道是插件自己在 `webServer` 上的 prefix 路由** —— envelope、请求上限与鉴权围墙留在插件这侧,每个请求都询问 `requestRejection`。
@@ -277,10 +281,6 @@ pnpm test # 构建 lib/、类型检查、跑十道检查
277
281
  - **浏览器半边入口只剩接线** —— 皮肤、看守、轮换、启动、模型状态、取色与主题文件各自成模块。
278
282
  - **导出主题不再取消自己的下载**,注释也只讲代码为什么是现在这样、不讲它曾经是什么样。
279
283
 
280
- ### v0.8.2
281
-
282
- - **dsh 依赖下界跟着宿主走** —— `engines.dsh`、5 个 `dsh-client-*` peer 与 `dsh-home-paths` 从 0.1.7 那一代改成声明 `>=0.2.1-alpha.2`,装出来的插件不会再被配上上一代客户端包,而 `dsh-invariants` 与 `@deepseek-ai/cordis` 各有理由、保持不动。
283
-
284
284
  ## Star History
285
285
 
286
286
  [![Star History Chart](https://api.star-history.com/chart?repos=HarmlessFunny/dsh-background-by-model&type=timeline&legend=bottom-right)](https://www.star-history.com/?repos=HarmlessFunny%2Fdsh-background-by-model&type=timeline&legend=bottom-right)
package/lib/client.js CHANGED
@@ -1875,6 +1875,16 @@ window.__ModuleLoader__.load({
1875
1875
  .dab-slider:hover::-webkit-slider-thumb,.dab-slider:focus-visible::-webkit-slider-thumb{transform:scale(1.22)}
1876
1876
  .dab-slider:active::-webkit-slider-thumb{transform:scale(1.34)}
1877
1877
  .dab-slider::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:var(--dsw-alias-button-elevated-fill,#fff);border:2px solid var(--dsw-alias-brand-primary)}
1878
+ /* The wallpaper effects share one track and one row: the menu that names the
1879
+ target sits BESIDE the track, not above it, so the merged control is no taller
1880
+ than a single slider used to be. The track takes the remaining width and the
1881
+ menu sizes itself to its longest option (which is what keeps the English
1882
+ "Background brightness" from clipping at a width chosen for Chinese). */
1883
+ .dab-wp-row{display:flex;align-items:center;gap:10px}
1884
+ .dab-wp-row .dab-slider-block{flex:1;min-width:0}
1885
+ .dab-select{flex:none;max-width:50%;height:34px;padding:0 10px;border-radius:10px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-button-elevated-fill);color:var(--dsw-alias-label-primary);font-family:inherit;font-size:12.5px;font-weight:550;outline:none;cursor:pointer;transition:border-color .2s,box-shadow .2s}
1886
+ .dab-select:hover{border-color:var(--dsw-alias-brand-primary)}
1887
+ .dab-select:focus-visible{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-brand-primary) 18%,transparent)}
1878
1888
 
1879
1889
  /* ── interface part cards ────────────────────────────────────────────────── */
1880
1890
  .dab-grid-parts{display:grid;grid-template-columns:repeat(auto-fill,minmax(256px,1fr));gap:13px}
@@ -4683,10 +4693,10 @@ window.__ModuleLoader__.load({
4683
4693
  ruleLayout: "布局模式",
4684
4694
  ruleLayoutNoImage: "添加图片后可分别设置每张图的布局模式",
4685
4695
  ruleFramingEdit: "编辑位置",
4686
- ruleOpacity: "背景透明度",
4687
- ruleBrightness: "背景亮度",
4688
- ruleBlur: "背景模糊",
4689
- ruleBlurHint: "这三条滑块都作用于壁纸层;界面页里的透明度作用于界面各区域,两者互不影响",
4696
+ ruleOpacity: "图片透明度",
4697
+ ruleBrightness: "图片亮度",
4698
+ ruleBlur: "图片模糊",
4699
+ ruleEffectPick: "调节项",
4690
4700
  rotTitle: "多图轮换",
4691
4701
  rotEnable: "轮换这组图",
4692
4702
  rotNeedTwo: "至少两张图才能轮换",
@@ -4854,10 +4864,10 @@ window.__ModuleLoader__.load({
4854
4864
  ruleLayout: "Layout mode",
4855
4865
  ruleLayoutNoImage: "Add an image to give each one its own layout mode",
4856
4866
  ruleFramingEdit: "Edit position",
4857
- ruleOpacity: "Background opacity",
4858
- ruleBrightness: "Background brightness",
4859
- ruleBlur: "Background blur",
4860
- ruleBlurHint: "These three sliders all treat the wallpaper layer; the opacity on the Interface page affects interface surfaces — they are independent",
4867
+ ruleOpacity: "Image opacity",
4868
+ ruleBrightness: "Image brightness",
4869
+ ruleBlur: "Image blur",
4870
+ ruleEffectPick: "Effect",
4861
4871
  rotTitle: "Image rotation",
4862
4872
  rotEnable: "Rotate these images",
4863
4873
  rotNeedTwo: "At least two images are needed to rotate",
@@ -5137,7 +5147,7 @@ window.__ModuleLoader__.load({
5137
5147
  * the canonical default. The track fill is a gradient driven by the --pct
5138
5148
  * custom property, updated imperatively alongside the thumb.
5139
5149
  */
5140
- function LiveSlider({ min, max, step, def, fmt, label, onInput, onChange }) {
5150
+ function LiveSlider({ min, max, step, def, fmt, label, ariaLabel, onInput, onChange }) {
5141
5151
  const inputRef = (0, react.useRef)(null);
5142
5152
  const valRef = (0, react.useRef)(null);
5143
5153
  const paint = (el, v) => {
@@ -5164,6 +5174,7 @@ window.__ModuleLoader__.load({
5164
5174
  onInput?.(v);
5165
5175
  onChange(v);
5166
5176
  };
5177
+ const name = label ?? ariaLabel;
5167
5178
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5168
5179
  className: "dab-slider-block",
5169
5180
  children: [label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -5184,7 +5195,8 @@ window.__ModuleLoader__.load({
5184
5195
  max,
5185
5196
  step,
5186
5197
  defaultValue: def,
5187
- title: label ? `${label} · ${fmt(def)}` : fmt(def),
5198
+ "aria-label": name,
5199
+ title: name !== void 0 ? `${name} · ${fmt(def)}` : fmt(def),
5188
5200
  onDoubleClick: () => apply(def),
5189
5201
  onInput: (e) => {
5190
5202
  const el = e.target;
@@ -6192,6 +6204,7 @@ window.__ModuleLoader__.load({
6192
6204
  ...m,
6193
6205
  [id]: i
6194
6206
  });
6207
+ const [wpField, setWpField] = (0, react.useState)("opacity");
6195
6208
  /** Select a rule as the edited one; keyboard stepping shares this. */
6196
6209
  const selectRule = (id) => {
6197
6210
  pickedRef.current = true;
@@ -6286,6 +6299,8 @@ window.__ModuleLoader__.load({
6286
6299
  notify,
6287
6300
  sel: selIdxOf(rule.id),
6288
6301
  onSel: (i) => setSelIdxOf(rule.id, i),
6302
+ field: wpField,
6303
+ onField: setWpField,
6289
6304
  onRemove: () => removeRule(rule.id)
6290
6305
  }, rule.id);
6291
6306
  })()
@@ -6451,7 +6466,78 @@ window.__ModuleLoader__.load({
6451
6466
  ]
6452
6467
  });
6453
6468
  }
6454
- function RuleCard({ p, rule, index, total, active, liveIndex, notify, sel, onSel, onRemove }) {
6469
+ /**
6470
+ * The rule's three wallpaper effects on ONE row: the menu names the target and a
6471
+ * single track edits it.
6472
+ *
6473
+ * The three ranges are not interchangeable — opacity and brightness are
6474
+ * percentages (brightness ceilings at the shared `WALLPAPER_BRIGHTNESS_MAX`),
6475
+ * blur is pixels — so changing the menu swaps the whole track: limits, formatter
6476
+ * and writer together. It never reinterprets one track under another name. The
6477
+ * `key` remounts the input so `defaultValue` starts at the new field's current
6478
+ * value; LiveSlider's drag-live path then works exactly as it did when the three
6479
+ * tracks were stacked.
6480
+ */
6481
+ function WallpaperEffectRow({ p, rule, field, onField }) {
6482
+ const { t } = p;
6483
+ const spec = field === "opacity" ? {
6484
+ label: t("ruleOpacity"),
6485
+ min: 0,
6486
+ max: 100,
6487
+ step: 1,
6488
+ def: Math.round(rule.wallpaperOpacity * 100),
6489
+ fmt: (v) => `${v}%`,
6490
+ onChange: (v) => p.setRule(rule.id, { wallpaperOpacity: v / 100 })
6491
+ } : field === "brightness" ? {
6492
+ label: t("ruleBrightness"),
6493
+ min: 0,
6494
+ max: 200,
6495
+ step: 1,
6496
+ def: rule.brightness ?? 100,
6497
+ fmt: (v) => `${v}%`,
6498
+ onChange: (v) => p.setRule(rule.id, { brightness: v })
6499
+ } : {
6500
+ label: t("ruleBlur"),
6501
+ min: 0,
6502
+ max: 60,
6503
+ step: 1,
6504
+ def: rule.blur,
6505
+ fmt: (v) => `${v}px`,
6506
+ onChange: (v) => p.setRule(rule.id, { blur: v })
6507
+ };
6508
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6509
+ className: "dab-wp-row",
6510
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
6511
+ className: "dab-select",
6512
+ value: field,
6513
+ "aria-label": t("ruleEffectPick"),
6514
+ onChange: (e) => onField(e.target.value),
6515
+ children: [
6516
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
6517
+ value: "opacity",
6518
+ children: t("ruleOpacity")
6519
+ }),
6520
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
6521
+ value: "brightness",
6522
+ children: t("ruleBrightness")
6523
+ }),
6524
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
6525
+ value: "blur",
6526
+ children: t("ruleBlur")
6527
+ })
6528
+ ]
6529
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LiveSlider, {
6530
+ ariaLabel: spec.label,
6531
+ min: spec.min,
6532
+ max: spec.max,
6533
+ step: spec.step,
6534
+ def: spec.def,
6535
+ fmt: spec.fmt,
6536
+ onChange: spec.onChange
6537
+ }, field)]
6538
+ });
6539
+ }
6540
+ function RuleCard({ p, rule, index, total, active, liveIndex, notify, sel, onSel, field, onField, onRemove }) {
6455
6541
  const { t } = p;
6456
6542
  const [dragOver, setDragOver] = (0, react.useState)(false);
6457
6543
  const pendingDrag = (0, react.useRef)(null);
@@ -7049,42 +7135,14 @@ window.__ModuleLoader__.load({
7049
7135
  })
7050
7136
  ]
7051
7137
  })] }),
7052
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7138
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7053
7139
  style: { marginTop: 16 },
7054
- children: [
7055
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LiveSlider, {
7056
- label: t("ruleOpacity"),
7057
- min: 0,
7058
- max: 100,
7059
- step: 1,
7060
- def: Math.round(rule.wallpaperOpacity * 100),
7061
- fmt: (v) => `${v}%`,
7062
- onChange: (v) => p.setRule(rule.id, { wallpaperOpacity: v / 100 })
7063
- }),
7064
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LiveSlider, {
7065
- label: t("ruleBrightness"),
7066
- min: 0,
7067
- max: 200,
7068
- step: 1,
7069
- def: rule.brightness ?? 100,
7070
- fmt: (v) => `${v}%`,
7071
- onChange: (v) => p.setRule(rule.id, { brightness: v })
7072
- }),
7073
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LiveSlider, {
7074
- label: t("ruleBlur"),
7075
- min: 0,
7076
- max: 60,
7077
- step: 1,
7078
- def: rule.blur,
7079
- fmt: (v) => `${v}px`,
7080
- onChange: (v) => p.setRule(rule.id, { blur: v })
7081
- }),
7082
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7083
- className: "dab-hint",
7084
- style: { marginTop: 10 },
7085
- children: t("ruleBlurHint")
7086
- })
7087
- ]
7140
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WallpaperEffectRow, {
7141
+ p,
7142
+ rule,
7143
+ field,
7144
+ onField
7145
+ })
7088
7146
  }),
7089
7147
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7090
7148
  style: { marginTop: 14 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-background-by-model",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Appearance plugin for DeepSeek Harness: an ordered list of model rules, each carrying its own wallpapers — every image with its own framing and theme color — plus layout mode, opacity, brightness and blur; the background follows the model you switch to, and a rule can rotate through several images on its own rhythm.",
5
5
  "keywords": [
6
6
  "deepseek-harness",