dsh-plugin-core 0.35.8 → 0.35.10
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/dist/adv/explorer/FileBrowser.js +2 -2
- package/dist/adv/explorer/FileBrowser.js.map +1 -1
- package/dist/adv/explorer/explorer-css.generated.d.ts +1 -1
- package/dist/adv/explorer/explorer-css.generated.d.ts.map +1 -1
- package/dist/adv/explorer/explorer-css.generated.js +1 -1
- package/dist/adv/explorer/explorer-css.generated.js.map +1 -1
- package/dist/adv/explorer/landing.js +1 -1
- package/dist/adv/explorer/landing.js.map +1 -1
- package/dist/adv/session/mirror/ChangedFilesCard.js +2 -2
- package/dist/adv/session/mirror/ChangedFilesCard.js.map +1 -1
- package/dist/adv/session/mirror/Deliverables.js +1 -1
- package/dist/adv/session/mirror/Deliverables.js.map +1 -1
- package/dist/ui/display/Card.d.ts +12 -4
- package/dist/ui/display/Card.d.ts.map +1 -1
- package/dist/ui/display/Card.js +37 -5
- package/dist/ui/display/Card.js.map +1 -1
- package/dist/ui/display/card-css.generated.d.ts +1 -1
- package/dist/ui/display/card-css.generated.d.ts.map +1 -1
- package/dist/ui/display/card-css.generated.js +1 -1
- package/dist/ui/display/card-css.generated.js.map +1 -1
- package/dist/ui/display/code-viewer-css.generated.d.ts +1 -1
- package/dist/ui/display/code-viewer-css.generated.d.ts.map +1 -1
- package/dist/ui/display/code-viewer-css.generated.js +1 -1
- package/dist/ui/display/code-viewer-css.generated.js.map +1 -1
- package/dist/ui/infra/chevron.d.ts +2 -1
- package/dist/ui/infra/chevron.d.ts.map +1 -1
- package/dist/ui/infra/chevron.js +2 -1
- package/dist/ui/infra/chevron.js.map +1 -1
- package/dist/ui/infra/overlay-css.generated.d.ts +1 -1
- package/dist/ui/infra/overlay-css.generated.d.ts.map +1 -1
- package/dist/ui/infra/overlay-css.generated.js +1 -1
- package/dist/ui/infra/overlay-css.generated.js.map +1 -1
- package/dist/ui/layout/QuickToolbar.js +1 -1
- package/dist/ui/layout/QuickToolbar.js.map +1 -1
- package/dist/ui/layout/panel-dock-css.generated.d.ts +1 -1
- package/dist/ui/layout/panel-dock-css.generated.d.ts.map +1 -1
- package/dist/ui/layout/panel-dock-css.generated.js +1 -1
- package/dist/ui/layout/panel-dock-css.generated.js.map +1 -1
- package/dist/ui/layout/quick-toolbar-css.generated.d.ts +1 -1
- package/dist/ui/layout/quick-toolbar-css.generated.d.ts.map +1 -1
- package/dist/ui/layout/quick-toolbar-css.generated.js +1 -1
- package/dist/ui/layout/quick-toolbar-css.generated.js.map +1 -1
- package/docs/.docwriter.json +4 -0
- package/docs/README.md +30 -1
- package/docs/design/architecture.md +4 -0
- package/docs/design/copywriting.md +4 -0
- package/docs/design/doc-format.md +4 -0
- package/docs/design/external/dsh-host.md +5 -1
- package/docs/design/features.md +4 -0
- package/docs/design/methods.md +4 -0
- package/docs/design/structure.md +4 -0
- package/docs/design/style.md +23 -0
- package/docs/help/methods.md +4 -0
- package/docs/help/style.md +4 -0
- package/docs/help/ui.doc.ts +17 -11
- package/docs/help/ui.md +17 -11
- package/docs/requirements.md +4 -0
- package/package.json +1 -1
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
|
|
284
284
|
| 项 | 值 |
|
|
285
285
|
|---|---|
|
|
286
|
-
| 端点 | `GET
|
|
286
|
+
| 端点 | `GET {path}?op=list\|read\|readBytes\|roots&path=<绝对路径>&offset&limit` |
|
|
287
287
|
| 只读 | 只有这 4 个 op,没有任何写/删/改入口 |
|
|
288
288
|
| 鉴权 | 不加 token:宿主 HTTP 面本来就能调 `remote.workspaceFiles.read`(允许工作区外绝对路径),本路由不引入新暴露面;静态 token 写在同一个 bundle 里是装饰 |
|
|
289
289
|
| 每层上限 | 500 条(`FS_PAGE_LIMIT`),服务端先按名排序再切片,翻页不重复/不漏 |
|
|
@@ -404,3 +404,7 @@
|
|
|
404
404
|
`official-classes.ts` 的前缀表补 `@deepseek-ai/dsh-client-ui-attachment/`;
|
|
405
405
|
用户消息与助手内联图片都改为真图,loader 缺席时才退回「[图片]」文本占位。
|
|
406
406
|
未接:`tool.call.images`(`read_image` 工具卡内的图片区,官方 = `imageBody` + 槽 + `imageMeta` 路径/尺寸)。
|
|
407
|
+
|
|
408
|
+
## 更新日志
|
|
409
|
+
|
|
410
|
+
- 2026-11-08 23:34:50:按文档库规范建立版本元数据与统一目录索引
|
package/docs/design/features.md
CHANGED
package/docs/design/methods.md
CHANGED
|
@@ -20,3 +20,7 @@ only what you must honour when **adding a helper to `utils`**.
|
|
|
20
20
|
EN: Failure path has a clear, overridable fallback; edge cases (empty / 0 / negative / NaN) covered by tests;
|
|
21
21
|
exported from `src/utils/index.ts`; text goes through `t()` + `translate`; registered as a row in the
|
|
22
22
|
matching parameter table under `docs/help/`.
|
|
23
|
+
|
|
24
|
+
## 更新日志
|
|
25
|
+
|
|
26
|
+
- 2026-11-08 23:34:49:按文档库规范建立版本元数据与统一目录索引
|
package/docs/design/structure.md
CHANGED
package/docs/design/style.md
CHANGED
|
@@ -296,6 +296,25 @@ EN: `Surface` is a pure frame and deliberately inherits typography, but any cont
|
|
|
296
296
|
own default `font-size` / `line-height` from tokens (same tier as `Table` / `Input md`). Do not make every consumer
|
|
297
297
|
repeat it; callers can still override that tier inline.
|
|
298
298
|
|
|
299
|
+
## 图标尺寸:一条基线、一个放大档
|
|
300
|
+
|
|
301
|
+
> EN: Icon sizing — one baseline, one enlargement tier
|
|
302
|
+
|
|
303
|
+
2026-11-08 用户拍板:**图标尺寸只有一个真源** —— `button.css` 的 `svg{width:1em;height:1em}`
|
|
304
|
+
(`.dshpc-iconbtn` / `.dshpc-btn__icon`),跟随各档 `--dshpc-font-*` token。调用方给图标组件传
|
|
305
|
+
`size={N}`、组件局部 CSS 写 `font-size:16px` 或 `svg{width:16px}`,都不许再决定图标大小。
|
|
306
|
+
非按钮的图标容器(`overlay__lead` / `quick-toolbar__item` / `fb__row-icon`)补同一条 `1em` 后代规则,
|
|
307
|
+
让 `size` 传参自动失效。**要放大只走 `dense`**:`1.25em`(`button.css` 两处),由 `Button` /
|
|
308
|
+
`IconButton` 的 `dense` prop 开启,正方形盒与高度档都不动,不新增第二套皮肤。
|
|
309
|
+
曾经 `code-viewer.css` 给复制钮写死 `svg{16px}`、`panel-dock.css` 给箭头写死 `font-size:16px`,
|
|
310
|
+
都是在核心之外另立一套尺寸,真机上就是「同一个界面里图标忽大忽小」。
|
|
311
|
+
|
|
312
|
+
EN: Icon size has a single source — `button.css`'s `svg{width:1em;height:1em}` following the control's
|
|
313
|
+
font token. Callers must not pass `size={N}` and component CSS must not hard-code `font-size:16px` or
|
|
314
|
+
`svg{width:16px}`. Non-button icon containers repeat the same `1em` descendant rule so caller-supplied
|
|
315
|
+
sizes stop taking effect. Enlargement exists only as `dense` (`1.25em`, via the `dense` prop); the box
|
|
316
|
+
and height tier never change.
|
|
317
|
+
|
|
299
318
|
## 行控件的两槽居中
|
|
300
319
|
|
|
301
320
|
> EN: Symmetric alignment for row slots
|
|
@@ -383,3 +402,7 @@ area stay symmetric. The StripCard rail is absolutely positioned against the roo
|
|
|
383
402
|
(`top:0` / `bottom:0`), so it stays full-height across the expanded area too. `:has()` and "paint a resting-fill snapshot over the
|
|
384
403
|
expanded area" are forbidden — semi-transparent tokens stacked twice render darker. Callers must put
|
|
385
404
|
expandable content in `panel`; `children` belongs to the header block.
|
|
405
|
+
|
|
406
|
+
## 更新日志
|
|
407
|
+
|
|
408
|
+
- 2026-11-08 23:34:50:按文档库规范建立版本元数据与统一目录索引
|
package/docs/help/methods.md
CHANGED
|
@@ -56,3 +56,7 @@ negatives. HTTP: 10s timeout, `AbortError` on timeout, `HttpError` with `status`
|
|
|
56
56
|
|
|
57
57
|
EN: Built-in prompts ship with zh/en (`setLocale` to switch); any API that renders text takes
|
|
58
58
|
`translate: Translate` to override; your plugin’s own UI copy is yours to manage.
|
|
59
|
+
|
|
60
|
+
## 更新日志
|
|
61
|
+
|
|
62
|
+
- 2026-11-08 23:34:50:按文档库规范建立版本元数据与统一目录索引
|
package/docs/help/style.md
CHANGED
|
@@ -113,3 +113,7 @@ optional.
|
|
|
113
113
|
EN: (1) Never namespace-import or `require` the barrel − it defeats tree-shaking (62.3 KB difference); use named
|
|
114
114
|
imports. (2) Do not concatenate several CSS constants into one domain − that rebuilds full injection. (3) Never
|
|
115
115
|
rely on injection order; override with higher specificity. (4) Never go back to `import './x.css'`.
|
|
116
|
+
|
|
117
|
+
## 更新日志
|
|
118
|
+
|
|
119
|
+
- 2026-11-08 23:34:50:按文档库规范建立版本元数据与统一目录索引
|
package/docs/help/ui.doc.ts
CHANGED
|
@@ -28,7 +28,8 @@ const cardExample = `import { Card, Chip, StripCard } from 'dsh-plugin-core/ui'
|
|
|
28
28
|
h(Card, {
|
|
29
29
|
accent: 'warning',
|
|
30
30
|
bar: { side: 'left', inset: 12, gap: 12 }, // 色条可放 left / right / top / bottom
|
|
31
|
-
|
|
31
|
+
// 传 onClick 才让卡片可点;hover 默认跟着它开,不用再手写光标与 :hover
|
|
32
|
+
onClick: () => openTask(id),
|
|
32
33
|
action: h(Button, { size: 'sm', variant: 'ghost' }, '跳过'),
|
|
33
34
|
},
|
|
34
35
|
h('div', null, '标题'),
|
|
@@ -151,8 +152,8 @@ h(InputGroup, {
|
|
|
151
152
|
h(InputGroup, {
|
|
152
153
|
size: 'md', value: kw, onChange: setKw,
|
|
153
154
|
actions: [
|
|
154
|
-
{ icon: h(IconRefreshOutlineRegular,
|
|
155
|
-
{ icon: h(IconSearchOutlineRegular,
|
|
155
|
+
{ icon: h(IconRefreshOutlineRegular, null), ariaLabel: '重置', onClick: reset },
|
|
156
|
+
{ icon: h(IconSearchOutlineRegular, null), label: '搜索', onClick: search },
|
|
156
157
|
],
|
|
157
158
|
})
|
|
158
159
|
|
|
@@ -371,8 +372,8 @@ const doc: DocTopic = {
|
|
|
371
372
|
rows: [
|
|
372
373
|
{ name: 'variant', type: "上表 18 档(primary/secondary/danger/success/warning/info/outline/danger-outline/ghost/link + 扩展 purple/pink/cyan/teal/orange/indigo/rose/slate)", def: "'outline'", desc: { zh: '外观档', en: 'Appearance tier' } },
|
|
373
374
|
{ name: 'size', type: "'sm' | 'md' | 'lg'", def: "'lg'", desc: { zh: '高度档(24 / 28 / 32,有边无边同高)', en: 'Height tier (24 / 28 / 32, same height with or without border)' } },
|
|
374
|
-
{ name: 'dense', type: 'boolean', def: 'false', desc: { zh: '
|
|
375
|
-
{ name: 'icon', type: 'ReactNode', def: '—', desc: { zh: '前置图标(官方图标组件 /
|
|
375
|
+
{ name: 'dense', type: 'boolean', def: 'false', desc: { zh: '**唯一放大档**:高度不变,图标放大、内距收紧(Button / IconButton 同名同义);不要改成给图标传 size', en: '**Only enlargement tier**: same height, larger icon and tighter padding (same prop on Button and IconButton); do not pass size to the icon instead' } },
|
|
376
|
+
{ name: 'icon', type: 'ReactNode', def: '—', desc: { zh: '前置图标(官方图标组件 / 字符串均可);尺寸由核心 CSS 的 1em 接管,不要传 size,要放大用 dense', en: 'Leading icon (official icon component or string); size is owned by the core 1em rule — do not pass size, use dense to enlarge' } },
|
|
376
377
|
{ name: 'iconRight', type: 'ReactNode', def: '—', desc: { zh: '后置图标(展开箭头、外链)', en: 'Trailing icon (expand arrow, external link)' } },
|
|
377
378
|
{ name: 'color', type: 'string', def: '—', desc: { zh: '自定义主色:实心档作底色,线框 / 无底档作主色', en: 'Custom main color: background for solid tiers, main color for outline/bare' } },
|
|
378
379
|
{ name: 'loading', type: 'boolean', def: "'false'", desc: { zh: '受控 loading:文案前显示同色小圈并自动 disabled(别处刷新也能点亮它);与「点击自动 loading」取或', en: 'Controlled loading: same-color spinner before the label plus auto-disable (an external refresh can light it up too); OR-ed with automatic click loading' } },
|
|
@@ -639,12 +640,16 @@ const doc: DocTopic = {
|
|
|
639
640
|
en: 'The header centers vertically as a whole; drop a bare element into `action` and it centers. Colors come from tokens, so light/dark follows the host.',
|
|
640
641
|
},
|
|
641
642
|
{
|
|
642
|
-
zh: '`hoverable` 开启后悬停变色、同时把光标改成 `pointer`,统一吃 `--dshpc-card-hover`(亮 7% 蓝 / 暗 13%
|
|
643
|
-
en:
|
|
643
|
+
zh: '`hoverable` 开启后悬停变色、同时把光标改成 `pointer`,统一吃 `--dshpc-card-hover`(亮 7% 蓝 / 暗 13% 蓝);默认跟随 `onClick`(给了点击回调即自动开),可显式传 `false` 关掉;`filled` 切底色,默认有底(Card = surface-1,StripCard = accent 浅底),`false` 时底透明但边框仍在。两根轴都只改 `--surface-bg`,插件不用再自己写 `:hover` 规则。',
|
|
644
|
+
en: "`hoverable` changes the fill on hover and switches the cursor to `pointer`, using `--dshpc-card-hover` (7% blue light / 13% blue dark). It defaults to on when `onClick` is provided, and can be turned off explicitly. `filled` (default on) controls the background — Card uses surface-1, StripCard the accent tint; `false` makes it transparent but keeps the border. Both axes only rewrite `--surface-bg`, so plugins no longer need their own `:hover` rules.",
|
|
644
645
|
},
|
|
645
646
|
{
|
|
646
|
-
zh: '展开的卡片用 `hoverScope` 选作用域,默认 `\'head\'`:根节点零内距并统一裁圆角,`__body` 作为「上面那一整块」独立承担内距、边到边变色;展开态不改内距,上下两圈留白对称,两块之间的间隔也属于头部区、跟着一起变色;`__panel` 是它的兄弟节点,不铺背景、不画分隔线、不参与 hover
|
|
647
|
-
en: 'For expandable cards, `hoverScope` selects the scope. The default `\'head\'` gives the root zero padding and clips the radius, while `__body` — the header block owning all padding — changes color edge to edge; expanding keeps its top and bottom padding symmetric, so the gap between the two blocks changes color too. `__panel` is a sibling with no background, no divider and no hover, so operating inside the expanded area triggers
|
|
647
|
+
zh: '展开的卡片用 `hoverScope` 选作用域,默认 `\'head\'`:根节点零内距并统一裁圆角,`__body` 作为「上面那一整块」独立承担内距、边到边变色;展开态不改内距,上下两圈留白对称,两块之间的间隔也属于头部区、跟着一起变色;`__panel` 是它的兄弟节点,不铺背景、不画分隔线、不参与 hover;默认作用域下鼠标在展开区里操作既不变色也不触发点击(点击契约见下段);需要分隔线时由调用方在 `panel` 内容里自绘。展开区的 `margin-top` 与 `padding-top` 都是 0,自绘线紧贴头部区下沿、中间不夹不变色的带子;四根 `--card-pad-t/r/b/l` 是内距唯一真源,`style.padding` 会摊成这四根轴,头部区与展开区左右始终对称。StripCard 的通高色条相对根节点定位,展开后仍贯穿整卡(包括展开区)。想要整卡含展开区一起变色,才显式传 `\'card\'`。**展开内容必须放进 `panel`**(`children` 属于头部区),核心才有分区信号。',
|
|
648
|
+
en: 'For expandable cards, `hoverScope` selects the scope. The default `\'head\'` gives the root zero padding and clips the radius, while `__body` — the header block owning all padding — changes color edge to edge; expanding keeps its top and bottom padding symmetric, so the gap between the two blocks changes color too. `__panel` is a sibling with no background, no divider and no hover, so in the default scope operating inside the expanded area neither changes color nor triggers a click (see the click contract below); draw a divider inside `panel` content yourself when you need one. Both `margin-top` and `padding-top` on the expanded area are 0, so a caller-drawn line sits flush against the header with no uncoloured strip between them. The four `--card-pad-t/r/b/l` axes are the single source of padding truth: `style.padding` expands into them, keeping the header and expanded area symmetric. The StripCard rail is positioned against the root and stays full-height across the expanded area. Pass `\'card\'` explicitly to include it. **Expandable content must go into `panel`**; `children` belongs to the header block.',
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
zh: '`onClick` 让整块卡片可点,命中范围与 `hoverScope` 完全一致:默认 `head` 时点击层是 `__body`(内距圈四边都在里面),展开区 `__panel` 是它的兄弟节点、不绑任何事件,里面拖选复制也不受影响;显式 `card` 时点击层上提到根节点,整卡含展开区都响应。点击层拿 `role="button"`、`tabIndex=0` 与 Enter / Space,并有键盘焦点环;刻意不渲染成 `<button>`,因为调用方要在里面放按钮。`action` 与 `onToggle` 折叠箭头同在右侧槽,一层挡住冒泡,不会连带触发。不传 `onClick` 时外观与行为完全不变。',
|
|
652
|
+
en: '`onClick` makes the whole card clickable over exactly the same area as `hoverScope`: with the default `head`, the hit layer is `__body` (all four padding edges included), while `__panel` is its sibling with no handlers at all, so text selection inside the expanded area is untouched. With explicit `card`, the hit layer moves up to the root and the expanded area responds too. The hit layer gets `role="button"`, `tabIndex=0`, Enter / Space and a keyboard focus ring. It is deliberately not a `<button>`, because callers put buttons inside. `action` and the `onToggle` arrow share the right-hand slot, which stops propagation so they never trigger the card. Without `onClick`, appearance and behaviour are unchanged.',
|
|
648
653
|
},
|
|
649
654
|
],
|
|
650
655
|
api: [
|
|
@@ -658,8 +663,9 @@ const doc: DocTopic = {
|
|
|
658
663
|
{ name: 'action', type: 'ReactNode', def: '—', desc: { zh: '右上角操作区', en: 'Top-right action area' } },
|
|
659
664
|
{ name: 'children', type: 'ReactNode', def: '—', desc: { zh: '主内容,排版随你', en: 'Main content, layout is yours' } },
|
|
660
665
|
{ name: 'panel', type: 'ReactNode', def: '—', desc: { zh: '展开后才显示的额外内容;必须放这里,核心才能把展开区与头部区分开', en: 'Extra content shown only when expanded; must live here so the core can separate it from the header' } },
|
|
661
|
-
{ name: '
|
|
662
|
-
{ name: '
|
|
666
|
+
{ name: 'onClick', type: '() => void', def: '—', desc: { zh: '传了才让卡片可点:命中范围同 hoverScope,点击层挂 role=button / tabIndex / Enter·Space;action 与折叠箭头不连带触发;hover 默认跟着开', en: 'Makes the card clickable. Hit area follows hoverScope; the hit layer gets role=button, tabIndex and Enter/Space; action and the collapse arrow never bubble into it; hover turns on by default' } },
|
|
667
|
+
{ name: 'hoverable', type: 'boolean', def: '跟随 onClick', desc: { zh: '悬停变色 + 光标变 pointer,统一 --dshpc-card-hover;可显式传 false 关掉', en: 'Hover color plus a pointer cursor, using --dshpc-card-hover; defaults to on when onClick is set, pass false to disable' } },
|
|
668
|
+
{ name: 'hoverScope', type: "'head' | 'card'", def: "'head'", desc: { zh: "'head'(默认)只有头部区变色并可点、展开区完全不受影响;'card' 整卡含展开区一起变色、一起可点。变色只在 hover 开时生效", en: "'head' (default) limits both color and clicks to the header block, leaving the expanded area untouched; 'card' includes it in both. Color applies only when hover is on" } },
|
|
663
669
|
{ name: 'filled', type: 'boolean', def: "'true'", desc: { zh: '是否带底色;false 时底透明、边框仍在。默认有底(Card = surface-1 / StripCard = accent 浅底)', en: 'Background fill; false makes it transparent while keeping the border. Default on (Card = surface-1 / StripCard = accent tint)' } },
|
|
664
670
|
{ name: 'className / style', type: '—', def: '—', desc: { zh: '追加类 / 样式;`style.padding` 摊成四根内距轴,同步头部区与展开区', en: 'Append class / style; `style.padding` expands into the four padding axes so the header and expanded area stay aligned' } },
|
|
665
671
|
],
|
package/docs/help/ui.md
CHANGED
|
@@ -67,8 +67,8 @@ Segmented:`items`(必填)支持单选 / 多选,`size`(默认 lg;三
|
|
|
67
67
|
|---|---|---|---|---|
|
|
68
68
|
| `variant` | `上表 18 档(primary/secondary/danger/success/warning/info/outline/danger-outline/ghost/link + 扩展 purple/pink/cyan/teal/orange/indigo/rose/slate)` | 'outline' | 外观档 | Appearance tier |
|
|
69
69
|
| `size` | `'sm' \| 'md' \| 'lg'` | 'lg' | 高度档(24 / 28 / 32,有边无边同高) | Height tier (24 / 28 / 32, same height with or without border) |
|
|
70
|
-
| `dense` | `boolean` | false |
|
|
71
|
-
| `icon` | `ReactNode` | — | 前置图标(官方图标组件 /
|
|
70
|
+
| `dense` | `boolean` | false | **唯一放大档**:高度不变,图标放大、内距收紧(Button / IconButton 同名同义);不要改成给图标传 size | **Only enlargement tier**: same height, larger icon and tighter padding (same prop on Button and IconButton); do not pass size to the icon instead |
|
|
71
|
+
| `icon` | `ReactNode` | — | 前置图标(官方图标组件 / 字符串均可);尺寸由核心 CSS 的 1em 接管,不要传 size,要放大用 dense | Leading icon (official icon component or string); size is owned by the core 1em rule — do not pass size, use dense to enlarge |
|
|
72
72
|
| `iconRight` | `ReactNode` | — | 后置图标(展开箭头、外链) | Trailing icon (expand arrow, external link) |
|
|
73
73
|
| `color` | `string` | — | 自定义主色:实心档作底色,线框 / 无底档作主色 | Custom main color: background for solid tiers, main color for outline/bare |
|
|
74
74
|
| `loading` | `boolean` | 'false' | 受控 loading:文案前显示同色小圈并自动 disabled(别处刷新也能点亮它);与「点击自动 loading」取或 | Controlled loading: same-color spinner before the label plus auto-disable (an external refresh can light it up too); OR-ed with automatic click loading |
|
|
@@ -250,8 +250,8 @@ h(InputGroup, {
|
|
|
250
250
|
h(InputGroup, {
|
|
251
251
|
size: 'md', value: kw, onChange: setKw,
|
|
252
252
|
actions: [
|
|
253
|
-
{ icon: h(IconRefreshOutlineRegular,
|
|
254
|
-
{ icon: h(IconSearchOutlineRegular,
|
|
253
|
+
{ icon: h(IconRefreshOutlineRegular, null), ariaLabel: '重置', onClick: reset },
|
|
254
|
+
{ icon: h(IconSearchOutlineRegular, null), label: '搜索', onClick: search },
|
|
255
255
|
],
|
|
256
256
|
})
|
|
257
257
|
|
|
@@ -369,13 +369,17 @@ h(Surface, { tone: 'sunken', border: 'dashed', padding: 'lg' }, '还没做的东
|
|
|
369
369
|
|
|
370
370
|
> EN: The header centers vertically as a whole; drop a bare element into `action` and it centers. Colors come from tokens, so light/dark follows the host.
|
|
371
371
|
|
|
372
|
-
`hoverable` 开启后悬停变色、同时把光标改成 `pointer`,统一吃 `--dshpc-card-hover`(亮 7% 蓝 / 暗 13%
|
|
372
|
+
`hoverable` 开启后悬停变色、同时把光标改成 `pointer`,统一吃 `--dshpc-card-hover`(亮 7% 蓝 / 暗 13% 蓝);默认跟随 `onClick`(给了点击回调即自动开),可显式传 `false` 关掉;`filled` 切底色,默认有底(Card = surface-1,StripCard = accent 浅底),`false` 时底透明但边框仍在。两根轴都只改 `--surface-bg`,插件不用再自己写 `:hover` 规则。
|
|
373
373
|
|
|
374
|
-
> EN: `hoverable`
|
|
374
|
+
> EN: `hoverable` changes the fill on hover and switches the cursor to `pointer`, using `--dshpc-card-hover` (7% blue light / 13% blue dark). It defaults to on when `onClick` is provided, and can be turned off explicitly. `filled` (default on) controls the background — Card uses surface-1, StripCard the accent tint; `false` makes it transparent but keeps the border. Both axes only rewrite `--surface-bg`, so plugins no longer need their own `:hover` rules.
|
|
375
375
|
|
|
376
|
-
展开的卡片用 `hoverScope` 选作用域,默认 `'head'`:根节点零内距并统一裁圆角,`__body` 作为「上面那一整块」独立承担内距、边到边变色;展开态不改内距,上下两圈留白对称,两块之间的间隔也属于头部区、跟着一起变色;`__panel` 是它的兄弟节点,不铺背景、不画分隔线、不参与 hover
|
|
376
|
+
展开的卡片用 `hoverScope` 选作用域,默认 `'head'`:根节点零内距并统一裁圆角,`__body` 作为「上面那一整块」独立承担内距、边到边变色;展开态不改内距,上下两圈留白对称,两块之间的间隔也属于头部区、跟着一起变色;`__panel` 是它的兄弟节点,不铺背景、不画分隔线、不参与 hover;默认作用域下鼠标在展开区里操作既不变色也不触发点击(点击契约见下段);需要分隔线时由调用方在 `panel` 内容里自绘。展开区的 `margin-top` 与 `padding-top` 都是 0,自绘线紧贴头部区下沿、中间不夹不变色的带子;四根 `--card-pad-t/r/b/l` 是内距唯一真源,`style.padding` 会摊成这四根轴,头部区与展开区左右始终对称。StripCard 的通高色条相对根节点定位,展开后仍贯穿整卡(包括展开区)。想要整卡含展开区一起变色,才显式传 `'card'`。**展开内容必须放进 `panel`**(`children` 属于头部区),核心才有分区信号。
|
|
377
377
|
|
|
378
|
-
> EN: For expandable cards, `hoverScope` selects the scope. The default `'head'` gives the root zero padding and clips the radius, while `__body` — the header block owning all padding — changes color edge to edge; expanding keeps its top and bottom padding symmetric, so the gap between the two blocks changes color too. `__panel` is a sibling with no background, no divider and no hover, so operating inside the expanded area triggers
|
|
378
|
+
> EN: For expandable cards, `hoverScope` selects the scope. The default `'head'` gives the root zero padding and clips the radius, while `__body` — the header block owning all padding — changes color edge to edge; expanding keeps its top and bottom padding symmetric, so the gap between the two blocks changes color too. `__panel` is a sibling with no background, no divider and no hover, so in the default scope operating inside the expanded area neither changes color nor triggers a click (see the click contract below); draw a divider inside `panel` content yourself when you need one. Both `margin-top` and `padding-top` on the expanded area are 0, so a caller-drawn line sits flush against the header with no uncoloured strip between them. The four `--card-pad-t/r/b/l` axes are the single source of padding truth: `style.padding` expands into them, keeping the header and expanded area symmetric. The StripCard rail is positioned against the root and stays full-height across the expanded area. Pass `'card'` explicitly to include it. **Expandable content must go into `panel`**; `children` belongs to the header block.
|
|
379
|
+
|
|
380
|
+
`onClick` 让整块卡片可点,命中范围与 `hoverScope` 完全一致:默认 `head` 时点击层是 `__body`(内距圈四边都在里面),展开区 `__panel` 是它的兄弟节点、不绑任何事件,里面拖选复制也不受影响;显式 `card` 时点击层上提到根节点,整卡含展开区都响应。点击层拿 `role="button"`、`tabIndex=0` 与 Enter / Space,并有键盘焦点环;刻意不渲染成 `<button>`,因为调用方要在里面放按钮。`action` 与 `onToggle` 折叠箭头同在右侧槽,一层挡住冒泡,不会连带触发。不传 `onClick` 时外观与行为完全不变。
|
|
381
|
+
|
|
382
|
+
> EN: `onClick` makes the whole card clickable over exactly the same area as `hoverScope`: with the default `head`, the hit layer is `__body` (all four padding edges included), while `__panel` is its sibling with no handlers at all, so text selection inside the expanded area is untouched. With explicit `card`, the hit layer moves up to the root and the expanded area responds too. The hit layer gets `role="button"`, `tabIndex=0`, Enter / Space and a keyboard focus ring. It is deliberately not a `<button>`, because callers put buttons inside. `action` and the `onToggle` arrow share the right-hand slot, which stops propagation so they never trigger the card. Without `onClick`, appearance and behaviour are unchanged.
|
|
379
383
|
|
|
380
384
|
| 参数 | 类型 | 默认 | 说明(zh) | 说明(en) |
|
|
381
385
|
|---|---|---|---|---|
|
|
@@ -386,8 +390,9 @@ h(Surface, { tone: 'sunken', border: 'dashed', padding: 'lg' }, '还没做的东
|
|
|
386
390
|
| `action` | `ReactNode` | — | 右上角操作区 | Top-right action area |
|
|
387
391
|
| `children` | `ReactNode` | — | 主内容,排版随你 | Main content, layout is yours |
|
|
388
392
|
| `panel` | `ReactNode` | — | 展开后才显示的额外内容;必须放这里,核心才能把展开区与头部区分开 | Extra content shown only when expanded; must live here so the core can separate it from the header |
|
|
389
|
-
| `
|
|
390
|
-
| `
|
|
393
|
+
| `onClick` | `() => void` | — | 传了才让卡片可点:命中范围同 hoverScope,点击层挂 role=button / tabIndex / Enter·Space;action 与折叠箭头不连带触发;hover 默认跟着开 | Makes the card clickable. Hit area follows hoverScope; the hit layer gets role=button, tabIndex and Enter/Space; action and the collapse arrow never bubble into it; hover turns on by default |
|
|
394
|
+
| `hoverable` | `boolean` | 跟随 onClick | 悬停变色 + 光标变 pointer,统一 --dshpc-card-hover;可显式传 false 关掉 | Hover color plus a pointer cursor, using --dshpc-card-hover; defaults to on when onClick is set, pass false to disable |
|
|
395
|
+
| `hoverScope` | `'head' \| 'card'` | 'head' | 'head'(默认)只有头部区变色并可点、展开区完全不受影响;'card' 整卡含展开区一起变色、一起可点。变色只在 hover 开时生效 | 'head' (default) limits both color and clicks to the header block, leaving the expanded area untouched; 'card' includes it in both. Color applies only when hover is on |
|
|
391
396
|
| `filled` | `boolean` | 'true' | 是否带底色;false 时底透明、边框仍在。默认有底(Card = surface-1 / StripCard = accent 浅底) | Background fill; false makes it transparent while keeping the border. Default on (Card = surface-1 / StripCard = accent tint) |
|
|
392
397
|
| `className / style` | `—` | — | 追加类 / 样式;`style.padding` 摊成四根内距轴,同步头部区与展开区 | Append class / style; `style.padding` expands into the four padding axes so the header and expanded area stay aligned |
|
|
393
398
|
|
|
@@ -397,7 +402,8 @@ import { Card, Chip, StripCard } from 'dsh-plugin-core/ui'
|
|
|
397
402
|
h(Card, {
|
|
398
403
|
accent: 'warning',
|
|
399
404
|
bar: { side: 'left', inset: 12, gap: 12 }, // 色条可放 left / right / top / bottom
|
|
400
|
-
|
|
405
|
+
// 传 onClick 才让卡片可点;hover 默认跟着它开,不用再手写光标与 :hover
|
|
406
|
+
onClick: () => openTask(id),
|
|
401
407
|
action: h(Button, { size: 'sm', variant: 'ghost' }, '跳过'),
|
|
402
408
|
},
|
|
403
409
|
h('div', null, '标题'),
|
package/docs/requirements.md
CHANGED
package/package.json
CHANGED