@mars-sea/dsh-commandcode-provider 0.16.0 → 0.16.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
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.16.1] - 2026-10-30
8
+
9
+ ### Changed
10
+
11
+ - **设置页开关改用宿主 `Switch` 组件(#108)。** 五个布尔设置(按套餐过滤模型、零数据保留、网页搜索、侧边栏额度、缓存图片卸载)原先是 `appearance:none` 的 checkbox 加伪元素画出的开关,现在是宿主 primitives 的 `Switch`(`<button role="switch" aria-checked>`),与宿主其他设置页开关同源,读屏读到的状态与画面不会再不一致。尺寸与颜色、圆角、焦点环、禁用态沿用宿主原语(36×20 轨道、16px 滑块),与宿主自带开关同尺寸;底色与滑块改为 160ms 同步过渡,按下时轻微缩小。点开关行的标题文字不再切换开关,需点开关本身。
12
+
7
13
  ## [0.16.0] - 2026-10-30
8
14
 
9
15
  ### Changed
package/lib/client.js CHANGED
@@ -3864,7 +3864,7 @@ window.__ModuleLoader__.load({
3864
3864
  }
3865
3865
  //#endregion
3866
3866
  //#region package.json
3867
- var version = "0.16.0";
3867
+ var version = "0.16.1";
3868
3868
  var repository = {
3869
3869
  "type": "git",
3870
3870
  "url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
@@ -4810,12 +4810,19 @@ window.__ModuleLoader__.load({
4810
4810
  * One boolean field row rendered as a switch. The staged text is `'true'` /
4811
4811
  * `'false'` / `''` (unset → `defaultChecked`); toggling stages the string the
4812
4812
  * boolean field spec parses back into a real boolean on save.
4813
+ *
4814
+ * The control is the harness's own `Switch` primitive (issue #108), not a
4815
+ * restyled checkbox: a `<button role="switch" aria-checked>` whose drawing keys
4816
+ * off `aria-checked`, so what it shows cannot drift from what assistive tech
4817
+ * reads, and it matches the host's other settings switches. It takes no `id`,
4818
+ * so the row title is plain text and the switch carries the label as its
4819
+ * accessible name instead of through `<label htmlFor>`.
4813
4820
  */
4814
4821
  function ToggleField({ id, label, hint, state, disabled, defaultChecked, onEdit, onReset, t }) {
4815
4822
  const checked = state.text === "" ? defaultChecked : state.text === "true";
4816
4823
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingRow, {
4817
4824
  title: label,
4818
- titleFor: id,
4825
+ titleId: id,
4819
4826
  tag: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverrideTag, {
4820
4827
  label,
4821
4828
  state,
@@ -4824,15 +4831,13 @@ window.__ModuleLoader__.load({
4824
4831
  onReset
4825
4832
  }),
4826
4833
  description: hint,
4827
- control: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4828
- id,
4829
- className: "cc-toggle",
4830
- type: "checkbox",
4831
- role: "switch",
4834
+ control: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
4835
+ className: "cc-switch",
4832
4836
  checked,
4837
+ label,
4833
4838
  disabled,
4834
- onChange: (event) => onEdit(event.target.checked ? "true" : "false")
4835
- }) })
4839
+ onChange: (next) => onEdit(next ? "true" : "false")
4840
+ })
4836
4841
  });
4837
4842
  }
4838
4843
  /** One stat tile in the account card's summary grid. */
@@ -10605,23 +10610,21 @@ window.__ModuleLoader__.load({
10605
10610
  .cc-check:checked{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}
10606
10611
  .cc-check:checked::after{content:'';position:absolute;top:3px;left:5px;width:3px;height:7px;border:solid var(--dsw-alias-label-primary-foreground,#fff);border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}
10607
10612
  .cc-checkName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
10608
- /* Modelled on the platform's own Switch primitive (ui-primitives
10609
- * Switch.module.css): a 40x24 capsule padding its track by 2px and sliding a
10610
- * 20px thumb across the 36px content box. Three things are load-bearing.
10611
- * (1) corner-shape:round on BOTH track and thumb — the theme sets a global
10612
- * superellipse corner shape, which squares a capsule's ends off around a round
10613
- * thumb. (2) No literal colours: brand-primary INVERTS between the modes, so a
10614
- * hardcoded white thumb vanishes on the checked track in dark mode; the brand
10615
- * foreground is what the platform paints on that fill. (3) border-l3 as the
10616
- * off track — border-l2 leaves it indistinguishable from the page. The track
10617
- * and thumb share one duration so the switch reads as one object. */
10618
- .cc-toggle{box-sizing:border-box;appearance:none;flex-shrink:0;width:40px;height:24px;margin:0;padding:2px;border:0;border-radius:12px;corner-shape:round;background:var(--dsw-alias-border-l3);cursor:pointer;position:relative;transition:background-color .12s ease}
10619
- .cc-toggle:checked{background:var(--dsw-alias-brand-primary)}
10620
- .cc-toggle::after{content:'';display:block;width:20px;height:20px;border-radius:50%;corner-shape:round;background:var(--dsw-alias-label-primary-foreground);transition:transform .12s ease}
10621
- .cc-toggle:checked::after{transform:translateX(16px)}
10622
- .cc-toggle:not(:checked)::after{background:var(--dsw-alias-switch-thumb,var(--dsw-alias-label-primary-foreground))}
10623
- .cc-toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}
10624
- .cc-toggle:disabled{cursor:default;opacity:.5}
10613
+ /* The settings switches are the platform's Switch primitive (issue #108); its
10614
+ * module CSS owns the box (36x20 track, 16px thumb, 16px travel), the colours,
10615
+ * capsule shape, focus ring and disabled look. This layer only joins the page's
10616
+ * motion: the primitive slides the thumb over 120ms ease and snaps the track
10617
+ * colour, so here the thumb and track share one 160ms strong ease-out and read
10618
+ * as one object, and the switch scales to .95 on press like the other small
10619
+ * pressables. The design canvas's 40x24 track is deliberately NOT re-applied
10620
+ * (2026-10-30: it made every switch read fatter than the host's own settings
10621
+ * switches, so the primitive's box is the single source of truth). The
10622
+ * cc-rowControl> qualifier lifts these above the module's single-class rules
10623
+ * whatever order the two sheets load in. The thumb is targeted as the button's
10624
+ * only child because its module class name is hashed. */
10625
+ .cc-rowControl>.cc-switch{transition:background-color .16s var(--cc-ease-out),transform .16s var(--cc-ease-out)}
10626
+ .cc-rowControl>.cc-switch>span{transition:transform .16s var(--cc-ease-out)}
10627
+ .cc-switch:active:not(:disabled){transform:scale(.95)}
10625
10628
  .cc-accountMode{align-items:center;gap:8px;display:flex;margin:12px 16px 0;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}
10626
10629
  .cc-accountList{flex-direction:column;gap:8px;display:flex}
10627
10630
  .cc-accountList+.cc-panel{margin:8px 16px 16px}
@@ -10818,9 +10821,10 @@ window.__ModuleLoader__.load({
10818
10821
  * changes, which carry meaning without motion. Card entrance keeps its fade
10819
10822
  * (the transform is neutralised), and the fold is already instant. */
10820
10823
  @media (prefers-reduced-motion:reduce){
10821
- .cc-foldChevron,.cc-toggle::after,.cc-usageBarFill,.cc-miniMeterFill{transition:none}
10824
+ .cc-foldChevron,.cc-rowControl>.cc-switch>span,.cc-usageBarFill,.cc-miniMeterFill{transition:none}
10822
10825
  .cc-btn,.cc-iconButton,.cc-resetInline,.cc-segItem{transition:background-color .15s ease,color .15s ease}
10823
- .cc-btn:active:not(:disabled),.cc-iconButton:active:not(:disabled),.cc-resetInline:active:not(:disabled),.cc-segItem:active:not(:disabled):not(.cc-segOn){transform:none}
10826
+ .cc-rowControl>.cc-switch{transition:background-color .15s ease}
10827
+ .cc-btn:active:not(:disabled),.cc-iconButton:active:not(:disabled),.cc-resetInline:active:not(:disabled),.cc-segItem:active:not(:disabled):not(.cc-segOn),.cc-switch:active:not(:disabled){transform:none}
10824
10828
  .cc-notice{transition:opacity .2s ease}
10825
10829
  .cc-group{transition:opacity .2s ease;transform:none!important}
10826
10830
  .cc-saveBar{transition:opacity .16s ease,visibility 0s linear .16s}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mars-sea/dsh-commandcode-provider",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Unofficial DeepSeek Harness LLM provider plugin for Command Code, ported from pi-commandcode-provider (MIT). Registers the 'commandcode' provider route with a Models-page card and live model catalog.",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",