dsh-codinput 0.1.1 → 0.3.0
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 +48 -0
- package/README.en.md +32 -26
- package/README.md +34 -28
- package/TESTING.md +10 -2
- package/assets/icon-white.svg +11 -0
- package/assets/icon.png +0 -0
- package/assets/icon.svg +11 -1
- package/assets/preview-ball-detail.png +0 -0
- package/assets/preview-float.png +0 -0
- package/assets/preview-normal.png +0 -0
- package/assets/preview-side.png +0 -0
- package/assets/preview-split.png +0 -0
- package/lib/client.js +67 -37
- package/package.json +1 -1
- package/src/client/attachments.ts +34 -0
- package/src/client/command.ts +52 -12
- package/src/client/components/AttachmentRail.tsx +20 -1
- package/src/client/components/CodinputBar.tsx +13 -35
- package/src/client/components/CodinputSurface.tsx +42 -8
- package/src/client/components/ImageLightbox.tsx +61 -0
- package/src/client/components/StatsRow.tsx +76 -43
- package/src/client/components/Toolbar.tsx +36 -42
- package/src/client/components/VoiceActivity.tsx +172 -0
- package/src/client/host-types.ts +24 -1
- package/src/client/i18n.ts +37 -2
- package/src/client/icons.tsx +33 -27
- package/src/client/services.ts +5 -0
- package/src/client/sidebar.tsx +66 -7
- package/src/client/sideinput.ts +33 -7
- package/src/client/stats.ts +156 -53
- package/src/client/styles.ts +37 -7
package/src/client/styles.ts
CHANGED
|
@@ -21,8 +21,13 @@ const CSS = `
|
|
|
21
21
|
会话态(无包裹约束)不再被拉满,左右居中;拖边调节后由内联 max-width 接管。 */
|
|
22
22
|
.dci-card { box-sizing: border-box; width: 100%; max-width: var(--dsh-composer-card-max-width, 760px); margin-inline: auto;
|
|
23
23
|
background: var(--dsw-specific-input-major, color-mix(in srgb, currentColor 4%, transparent));
|
|
24
|
-
box-shadow: var(--dsw-elevation-soft, none); font-size:
|
|
25
|
-
|
|
24
|
+
box-shadow: var(--dsw-elevation-soft, none); font-size: var(--dsh-content-font-size, 14px);
|
|
25
|
+
line-height: calc(24px + var(--dsh-content-font-delta, 0px));
|
|
26
|
+
border: 0; border-radius: var(--dsw-radius-panel, 22px); flex-direction: column; gap: 0; padding-top: 4px; display: flex; position: relative; min-width: 0; }
|
|
27
|
+
/* 主模式 surface 复刻官方 composer root:侧向 clearance 内缩 + 底部 4px,
|
|
28
|
+
卡片与数据行由数据行自身 padding-top 定距(官方 root 无 gap,dock 上边距 4px)。
|
|
29
|
+
side/float 形态自带铺满布局,不参与。 */
|
|
30
|
+
.dci-surface:not([data-side]):not([data-float]) { padding: 0 var(--dsh-composer-side-clearance, 0px) 4px; align-items: center; gap: 0; }
|
|
26
31
|
/* 卡片边缘调节把手:左右调宽、上下调高(对称灵敏度),悬停显形。 */
|
|
27
32
|
.dci-rip { position: absolute; z-index: 60; touch-action: none; }
|
|
28
33
|
.dci-rip[data-axis="y"] { left: 12px; right: 12px; height: 9px; cursor: ns-resize; }
|
|
@@ -74,6 +79,16 @@ const CSS = `
|
|
|
74
79
|
.dci-tools { align-items: center; min-width: 0; gap: 12px; display: flex; }
|
|
75
80
|
.dci-trailing { align-items: center; flex: none; min-width: 0; gap: 12px; margin-left: auto; display: flex; }
|
|
76
81
|
|
|
82
|
+
/* ===== 语音输入座位(官方 .standardControls / .activity / .activityExpanded)=====
|
|
83
|
+
按钮本体是官方 activity 槽位条目组件(Gyyz9a_* 样式由语音插件自带注入);
|
|
84
|
+
这里只负责座位:展开时 capture 行接管整行、左侧工具与模型控件让位。 */
|
|
85
|
+
.dci-standard-controls { align-items: center; min-width: 0; gap: 12px; display: flex; }
|
|
86
|
+
.dci-voice-seat { flex: none; align-items: center; display: flex; }
|
|
87
|
+
.dci-voice-seat:empty { display: none; }
|
|
88
|
+
.dci-row[data-voice-active] .dci-tools, .dci-row[data-voice-active] .dci-standard-controls { display: none; }
|
|
89
|
+
.dci-row[data-voice-active] .dci-trailing { flex: 1; margin-left: 0; }
|
|
90
|
+
.dci-row[data-voice-active] .dci-voice-seat { flex: 1; min-width: 0; }
|
|
91
|
+
|
|
77
92
|
/* 圆形图标按钮(官方 .add)*/
|
|
78
93
|
.dci-add { background: var(--dsw-specific-selector, color-mix(in srgb, currentColor 8%, transparent));
|
|
79
94
|
width: 28px; height: 28px; color: var(--dsw-alias-label-primary, currentColor); cursor: pointer; border: none;
|
|
@@ -388,10 +403,25 @@ button.dci-attach-body { color: inherit; font: inherit; text-align: left; backgr
|
|
|
388
403
|
background: var(--dsw-alias-label-primary-foreground, #fff); transition: transform 120ms ease; }
|
|
389
404
|
.dci-switch[aria-checked="true"]::after { transform: translateX(16px); }
|
|
390
405
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
406
|
+
|
|
407
|
+
/* ===== 原图预览(官方 primitives ImageLightbox 逐值复刻)===== */
|
|
408
|
+
.dci-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 40px; }
|
|
409
|
+
.dci-lightbox-mask { position: absolute; inset: 0; background: var(--dsw-alias-bg-mask-1, rgba(0, 0, 0, 0.55));
|
|
410
|
+
backdrop-filter: var(--dsw-mask-blur, blur(4px)); }
|
|
411
|
+
.dci-lightbox-image { position: relative; max-width: min(100%, 1600px); max-height: calc(100vh - 80px);
|
|
412
|
+
object-fit: contain; border-radius: var(--dsw-radius-lg, 16px); background: var(--dsw-specific-input-major);
|
|
413
|
+
border: 0; box-shadow: var(--dsw-elevation-prominent, 0 10px 34px rgba(0, 0, 0, 0.35)); }
|
|
414
|
+
.dci-lightbox-close { position: fixed; top: 20px; right: 20px; z-index: 1; display: grid; place-items: center;
|
|
415
|
+
width: 36px; height: 36px; border: 0.5px solid var(--dsw-alias-border-l2-darkmode-thin, var(--dsw-alias-border-l2, transparent));
|
|
416
|
+
border-radius: 999px; corner-shape: round; background: var(--dsw-specific-input-major);
|
|
417
|
+
color: var(--dsw-alias-label-primary, currentColor); cursor: pointer; }
|
|
418
|
+
.dci-lightbox-close:focus-visible { outline: var(--dsw-focus-ring-width, 2px) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary, currentColor)); outline-offset: 3px; }
|
|
419
|
+
|
|
420
|
+
/* ===== 数据行(官方 uV2eYG_dock 复刻:root 内居中、无横向 padding)===== */
|
|
421
|
+
.dci-stat-root { max-width: 100%; box-sizing: border-box; width: 100%;
|
|
422
|
+
padding: 4px 0 0; font-size: calc(var(--dsh-content-font-size-secondary, 13px) - 1px);
|
|
423
|
+
line-height: calc(20px + var(--dsh-content-font-delta-secondary, 0px));
|
|
424
|
+
justify-content: center; gap: 12px; display: flex; }
|
|
395
425
|
.dci-stat-anchor { min-width: 0; display: inline-flex; position: relative; }
|
|
396
426
|
|
|
397
427
|
/* 数据行详情面板(官方 bRhRbq 复刻:锚点上方弹出) */
|
|
@@ -411,7 +441,7 @@ button.dci-attach-body { color: inherit; font: inherit; text-align: left; backgr
|
|
|
411
441
|
gap: 6px 16px; margin: 0; display: grid; }
|
|
412
442
|
.dci-stat-details dt, .dci-stat-details dd { min-width: 0; margin: 0; }
|
|
413
443
|
.dci-stat-details dd { color: var(--dsw-alias-label-secondary, inherit); font-variant-numeric: tabular-nums; text-align: right; }
|
|
414
|
-
.dci-stat-pill { box-sizing: border-box; max-width: 100%; color: var(--dsw-alias-label-tertiary, currentColor);
|
|
444
|
+
.dci-stat-pill { font: inherit; box-sizing: border-box; max-width: 100%; color: var(--dsw-alias-label-tertiary, currentColor);
|
|
415
445
|
white-space: nowrap; background: transparent; border: none; border-radius: 24px; align-items: center; gap: 6px;
|
|
416
446
|
padding: 1px 8px; display: inline-flex; cursor: pointer; font-variant-numeric: tabular-nums; }
|
|
417
447
|
.dci-stat-pill svg { flex: none; width: 14px; height: 14px; }
|