@khorsheed/dsh-client-session-title-edit 0.2.1 → 0.2.2

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,5 +1,14 @@
1
1
  # 变更记录
2
2
 
3
+ ## 0.2.2(2026-09-26)
4
+
5
+ 适配宿主 rc.1 线并实证 0.1.5/0.1.7 双线可用(0.1.5-rc.1 全量 boot 实证,2026-09-25)。
6
+
7
+ - 紧凑编辑器行的取消/保存按钮改 `size="sm"`(28px,与该行输入框同高;宿主 Button 两条线 API 相同)
8
+ - rc.1 的 locale 注入面从 `settingsScope` 迁到 `configForms` 探测
9
+ - 图标自持化:rc.1 图标图样由 `sync-icon-artwork` 生成器摊平进包内 `src/client/icons.tsx`(双线渲染同一份图样)
10
+ - 插件清单展示元数据(`locale/*.json`):rc.1 宿主插件页的卡面标题/描述中文化
11
+
3
12
  ## 0.2.1(2026-09-11)
4
13
 
5
14
  - 无功能变更:开发基线随仓内 pin 对齐官方 `0.1.5-rc.1` / cordis `4.0.2`(消除 4.0.1/4.0.2 双实例图分裂);peer 依赖范围与 minHost(`0.1.2-rc.1`)不变
package/lib/client.js CHANGED
@@ -34,6 +34,25 @@ window.__ModuleLoader__.load({
34
34
  "hint.tooLong": "Title too long: max {max} bytes (about {chars} CJK characters), currently {bytes}"
35
35
  };
36
36
  //#endregion
37
+ //#region src/client/icons.tsx
38
+ const IconEditOutlineMedium = ({ size = 16, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
39
+ width: size,
40
+ height: size,
41
+ className,
42
+ viewBox: "0 0 16 16",
43
+ fill: "none",
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ "aria-hidden": "true",
46
+ strokeWidth: 1.3,
47
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
48
+ d: "M8.85596 2.69971H4.19971C3.37141 2.69971 2.69992 3.37146 2.69971 4.19971V11.8003C2.69992 12.6285 3.37141 13.3003 4.19971 13.3003H11.8003C12.6283 13.2999 13.3001 12.6283 13.3003 11.8003V7.89893H14.3003V11.8003C14.3001 13.1806 13.1806 14.2999 11.8003 14.3003H4.19971C2.81913 14.3003 1.69992 13.1808 1.69971 11.8003V4.19971C1.69992 2.81918 2.81913 1.69971 4.19971 1.69971H8.85596V2.69971Z",
49
+ fill: "currentColor"
50
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
51
+ d: "M7.7849 8.23878L13.888 2.13574",
52
+ stroke: "currentColor"
53
+ })]
54
+ });
55
+ //#endregion
37
56
  //#region src/client/slots.ts
38
57
  /**
39
58
  * Narrow an unknown thrown value to a {@link RenameFailure}.
@@ -93,7 +112,7 @@ window.__ModuleLoader__.load({
93
112
  }
94
113
  //#endregion
95
114
  //#region \0dsh-css:src/client/TitleEditAction.module.css.mjs
96
- const css = ".okd51a_renameButton{width:22px;height:22px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;margin-left:-12px;padding:0;display:inline-flex}.okd51a_renameButton:hover,.okd51a_renameButton:focus-visible{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover)}.okd51a_editor{align-items:center;gap:6px;display:inline-flex}.okd51a_editorInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:220px;height:28px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:6px;outline:none;padding:3px 8px;font-size:12px;line-height:18px}.okd51a_editorInput:focus{border-color:var(--dsw-alias-brand-primary)}.okd51a_editorInput:disabled{color:var(--dsw-alias-label-dimmed)}.okd51a_editorError{color:var(--dsw-alias-state-error-primary);font-size:12px;line-height:18px}.okd51a_editorHint{color:var(--dsw-alias-state-warn-primary);font-size:12px;line-height:18px}.okd51a_inPlaceInput{box-sizing:border-box;z-index:40;color:var(--dsw-alias-label-primary);background:0 0;border:1px solid #0000;border-radius:12px;outline:none;padding:4px 8px;font-size:14px;font-weight:500;line-height:20px;position:fixed}.okd51a_inPlaceInput:focus{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-base)}.okd51a_inPlaceInput:disabled{color:var(--dsw-alias-label-dimmed)}.okd51a_inPlaceMirror{visibility:hidden;white-space:pre;pointer-events:none;font-family:inherit;font-size:14px;font-weight:500;position:absolute;top:-9999px;left:-9999px}.okd51a_inPlaceError{color:var(--dsw-alias-state-error-primary);margin-left:6px;font-size:12px;line-height:18px}.okd51a_inPlaceHint{color:var(--dsw-alias-state-warn-primary);margin-left:6px;font-size:12px;line-height:18px}header nav button[data-ste-inplace]{visibility:hidden!important}";
115
+ const css = ".KqdipW_renameButton{width:22px;height:22px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;margin-left:-12px;padding:0;display:inline-flex}.KqdipW_renameButton:hover,.KqdipW_renameButton:focus-visible{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover)}.KqdipW_editor{align-items:center;gap:6px;display:inline-flex}.KqdipW_editorInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:220px;height:28px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:6px;outline:none;padding:3px 8px;font-size:12px;line-height:18px}.KqdipW_editorInput:focus{border-color:var(--dsw-alias-brand-primary)}.KqdipW_editorInput:disabled{color:var(--dsw-alias-label-dimmed)}.KqdipW_editorError{color:var(--dsw-alias-state-error-primary);font-size:12px;line-height:18px}.KqdipW_editorHint{color:var(--dsw-alias-state-warn-primary);font-size:12px;line-height:18px}.KqdipW_inPlaceInput{box-sizing:border-box;z-index:40;color:var(--dsw-alias-label-primary);background:0 0;border:1px solid #0000;border-radius:12px;outline:none;padding:4px 8px;font-size:14px;font-weight:500;line-height:20px;position:fixed}.KqdipW_inPlaceInput:focus{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-base)}.KqdipW_inPlaceInput:disabled{color:var(--dsw-alias-label-dimmed)}.KqdipW_inPlaceMirror{visibility:hidden;white-space:pre;pointer-events:none;font-family:inherit;font-size:14px;font-weight:500;position:absolute;top:-9999px;left:-9999px}.KqdipW_inPlaceError{color:var(--dsw-alias-state-error-primary);margin-left:6px;font-size:12px;line-height:18px}.KqdipW_inPlaceHint{color:var(--dsw-alias-state-warn-primary);margin-left:6px;font-size:12px;line-height:18px}header nav button[data-ste-inplace]{visibility:hidden!important}";
97
116
  const tagId = "@khorsheed/dsh-client-session-title-edit/TitleEditAction.module.css";
98
117
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
99
118
  const tag = document.createElement("style");
@@ -103,15 +122,15 @@ window.__ModuleLoader__.load({
103
122
  document.head.appendChild(tag);
104
123
  }
105
124
  var TitleEditAction_module_css_default = {
106
- "inPlaceError": "okd51a_inPlaceError",
107
- "editorError": "okd51a_editorError",
108
- "inPlaceMirror": "okd51a_inPlaceMirror",
109
- "inPlaceInput": "okd51a_inPlaceInput",
110
- "editorHint": "okd51a_editorHint",
111
- "inPlaceHint": "okd51a_inPlaceHint",
112
- "editorInput": "okd51a_editorInput",
113
- "editor": "okd51a_editor",
114
- "renameButton": "okd51a_renameButton"
125
+ "editor": "KqdipW_editor",
126
+ "inPlaceInput": "KqdipW_inPlaceInput",
127
+ "renameButton": "KqdipW_renameButton",
128
+ "editorError": "KqdipW_editorError",
129
+ "inPlaceMirror": "KqdipW_inPlaceMirror",
130
+ "inPlaceError": "KqdipW_inPlaceError",
131
+ "editorInput": "KqdipW_editorInput",
132
+ "editorHint": "KqdipW_editorHint",
133
+ "inPlaceHint": "KqdipW_inPlaceHint"
115
134
  };
116
135
  //#endregion
117
136
  //#region src/client/TitleEditAction.tsx
@@ -284,7 +303,7 @@ window.__ModuleLoader__.load({
284
303
  "aria-label": t("action.rename"),
285
304
  title: t("action.rename"),
286
305
  onClick: begin,
287
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 14 })
306
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutlineMedium, { size: 14 })
288
307
  });
289
308
  if (placement !== null) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
290
309
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -354,12 +373,14 @@ window.__ModuleLoader__.load({
354
373
  }),
355
374
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
356
375
  variant: "outline",
376
+ size: "sm",
357
377
  disabled: busy,
358
378
  onClick: cancel,
359
379
  children: t("cancel")
360
380
  }),
361
381
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
362
382
  variant: "primary",
383
+ size: "sm",
363
384
  disabled: busy || trimmed === "" || overLimit,
364
385
  onClick: () => {
365
386
  commit();
@@ -16,7 +16,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
16
16
  * becomes a pure slot consumer and the probe/overlay logic is removed.
17
17
  */
18
18
  import { useEffect, useLayoutEffect, useRef, useState } from 'react';
19
- import { Button, IconEditOutline16 } from '@deepseek-ai/dsh-client-ui-primitives';
19
+ import { Button } from '@deepseek-ai/dsh-client-ui-primitives';
20
+ import { IconEditOutlineMedium } from './icons.js';
20
21
  import { isRenameFailure } from './slots.js';
21
22
  import { MAX_TITLE_BYTES, normalizedTitleByteLength } from './title-length.js';
22
23
  import css from './TitleEditAction.module.css';
@@ -188,7 +189,7 @@ export function TitleEditAction({ sessionId, useSessions, renameSession, t }) {
188
189
  bytes: draftBytes,
189
190
  });
190
191
  if (!editing) {
191
- return (_jsx("button", { type: "button", className: css.renameButton, "aria-label": t('action.rename'), title: t('action.rename'), onClick: begin, children: _jsx(IconEditOutline16, { size: 14 }) }));
192
+ return (_jsx("button", { type: "button", className: css.renameButton, "aria-label": t('action.rename'), title: t('action.rename'), onClick: begin, children: _jsx(IconEditOutlineMedium, { size: 14 }) }));
192
193
  }
193
194
  if (placement !== null) {
194
195
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: measureRef, className: css.inPlaceMirror, "aria-hidden": "true", children: draft === '' ? ' ' : draft }), _jsx("input", { ref: inputRef, className: css.inPlaceInput, type: "text", value: draft, "aria-label": t('editor.aria'), placeholder: t('editor.placeholder'), disabled: busy, autoFocus: true, style: { left: placement.left, top: placement.top, width: inputWidth, height: placement.height }, onChange: (event) => { setDraft(event.currentTarget.value); }, onKeyDown: onKeyDown, onBlur: onBlur }), error !== null
@@ -197,5 +198,5 @@ export function TitleEditAction({ sessionId, useSessions, renameSession, t }) {
197
198
  }
198
199
  return (_jsxs("span", { className: css.editor, role: "group", "aria-label": t('editor.aria'), children: [_jsx("input", { ref: inputRef, className: css.editorInput, type: "text", value: draft, "aria-label": t('editor.aria'), placeholder: t('editor.placeholder'), disabled: busy, autoFocus: true, onChange: (event) => { setDraft(event.currentTarget.value); }, onKeyDown: onKeyDown }), error !== null
199
200
  ? _jsx("span", { className: css.editorError, role: "alert", children: error })
200
- : overLimit && _jsx("span", { className: css.editorHint, role: "alert", children: overLimitHint }), _jsx(Button, { variant: "outline", disabled: busy, onClick: cancel, children: t('cancel') }), _jsx(Button, { variant: "primary", disabled: busy || trimmed === '' || overLimit, onClick: () => { void commit(); }, children: t('editor.save') })] }));
201
+ : overLimit && _jsx("span", { className: css.editorHint, role: "alert", children: overLimitHint }), _jsx(Button, { variant: "outline", size: "sm", disabled: busy, onClick: cancel, children: t('cancel') }), _jsx(Button, { variant: "primary", size: "sm", disabled: busy || trimmed === '' || overLimit, onClick: () => { void commit(); }, children: t('editor.save') })] }));
201
202
  }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by scripts/sync-icon-artwork.mts from @deepseek-ai/dsh-client-ui-primitives
3
+ * (v0.1.7-rc.1, harness 46a7f68b09) — do not edit by hand. The 0.1.5 and rc.1 host lines
4
+ * share no icon export name, so the rc.1 artwork is inlined here: pure SVG,
5
+ * no host runtime identity, identical on every line. Re-run the generator
6
+ * after adding an icon import or bumping the harness checkout.
7
+ *
8
+ * @module @khorsheed/dsh-client-session-title-edit/client
9
+ */
10
+ /** Shared props for every product icon component (mirrors the upstream IconProps). */
11
+ export interface IconProps {
12
+ /** Square edge in px; defaults to the glyph's own drawn size. */
13
+ size?: number | undefined;
14
+ /** Extra class for layout placement; color rides currentColor. */
15
+ className?: string | undefined;
16
+ }
17
+ export declare const IconEditOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
18
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const IconEditOutlineMedium = ({ size = 16, className }) => (_jsxs("svg", { width: size, height: size, className: className, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", strokeWidth: 1.3, children: [_jsx("path", { d: "M8.85596 2.69971H4.19971C3.37141 2.69971 2.69992 3.37146 2.69971 4.19971V11.8003C2.69992 12.6285 3.37141 13.3003 4.19971 13.3003H11.8003C12.6283 13.2999 13.3001 12.6283 13.3003 11.8003V7.89893H14.3003V11.8003C14.3001 13.1806 13.1806 14.2999 11.8003 14.3003H4.19971C2.81913 14.3003 1.69992 13.1808 1.69971 11.8003V4.19971C1.69992 2.81918 2.81913 1.69971 4.19971 1.69971H8.85596V2.69971Z", fill: "currentColor" }), _jsx("path", { d: "M7.7849 8.23878L13.888 2.13574", stroke: "currentColor" })] }));
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Title Edit",
4
+ "description": "Rename the current session inline from the chat header"
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "标题编辑",
4
+ "description": "在聊天标题旁就地重命名当前会话。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "session",
9
9
  "title"
10
10
  ],
11
- "version": "0.2.1",
11
+ "version": "0.2.2",
12
12
  "type": "module",
13
13
  "main": "lib/index.js",
14
14
  "types": "lib/types/index.d.ts",
@@ -25,6 +25,7 @@
25
25
  "types": "./lib/types/client/index.d.ts",
26
26
  "default": "./lib/client.js"
27
27
  },
28
+ "./locale/*.json": "./locale/*.json",
28
29
  "./src/*": "./src/*",
29
30
  "./package.json": "./package.json"
30
31
  },
@@ -55,22 +56,8 @@
55
56
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
56
57
  "react": "^18.2.0"
57
58
  },
58
- "devDependencies": {
59
- "@deepseek-ai/cordis": "^4.0.1",
60
- "@deepseek-ai/dsh-api-session-controller": "^0.1.5-rc.1",
61
- "@deepseek-ai/dsh-client-locale": "^0.1.5-rc.1",
62
- "@deepseek-ai/dsh-client-test-runtime": "^0.1.5-rc.1",
63
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.1",
64
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.1",
65
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.1",
66
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.1",
67
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
68
- "@deepseek-ai/dsh-session": "^0.1.5-rc.1",
69
- "@types/react": "~18.3.1",
70
- "react": "^18.2.0",
71
- "react-dom": "^18.2.0"
72
- },
73
59
  "files": [
60
+ "locale/*.json",
74
61
  "lib",
75
62
  "cordis.patch.yml",
76
63
  "LICENSE",