dsh-colophon 0.2.5 → 0.2.6

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.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/client.js +22 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.2.6(入口按钮更明显)
2
+
3
+ - 输入框上方的入口改成实心感按钮:主题强调色文字与描边、浅色填充、圆角 10px、悬停加深并带投影。
4
+ - 左侧加 ✎ 图标、右侧加 ▾ 指示,明确「可点击展开」。
5
+ - 无摘要时显示「生成卷末摘要」,有摘要时显示「卷末摘要」。
6
+
1
7
  ## 0.2.5(摘要面板排版精修)
2
8
 
3
9
  - 区块标题加大到 15px 并使用主题强调色,标题前带强调竖条。
package/client.js CHANGED
@@ -253,15 +253,22 @@ window.__ModuleLoader__.load({
253
253
 
254
254
  const styles = {
255
255
  chip: {
256
- display: 'inline-flex', alignItems: 'center', gap: 6, padding: '0 12px', height: 28,
257
- border: '1px solid var(--dsw-alias-border-l2, rgba(0,0,0,0.14))', borderRadius: 8,
258
- background: 'var(--dsw-alias-bg-layer-2, #f2f3f5)',
259
- color: 'var(--dsw-alias-label-primary, #1f2329)', cursor: 'pointer', fontSize: 13, fontWeight: 500,
256
+ display: 'inline-flex', alignItems: 'center', gap: 7, padding: '0 14px', height: 32,
257
+ borderRadius: 10, cursor: 'pointer', fontSize: 13, fontWeight: 600, letterSpacing: '0.01em',
258
+ color: 'var(--dsw-alias-button-primary-fill, #4d6bfe)',
259
+ border: '1px solid color-mix(in srgb, var(--dsw-alias-button-primary-fill, #4d6bfe) 55%, transparent)',
260
+ background: 'color-mix(in srgb, var(--dsw-alias-button-primary-fill, #4d6bfe) 12%, transparent)',
261
+ boxShadow: '0 1px 2px rgba(0,0,0,0.06)', transition: 'background 120ms ease, box-shadow 120ms ease',
262
+ },
263
+ chipHover: {
264
+ background: 'color-mix(in srgb, var(--dsw-alias-button-primary-fill, #4d6bfe) 22%, transparent)',
265
+ boxShadow: '0 2px 10px rgba(0,0,0,0.18)',
260
266
  },
261
267
  chipOn: {
262
268
  border: '1px solid var(--dsw-alias-button-primary-fill, #4d6bfe)',
263
- background: 'color-mix(in srgb, var(--dsw-alias-button-primary-fill, #4d6bfe) 12%, transparent)',
269
+ background: 'color-mix(in srgb, var(--dsw-alias-button-primary-fill, #4d6bfe) 20%, transparent)',
264
270
  },
271
+ chipIcon: { display: 'inline-flex', width: 14, height: 14, alignItems: 'center', justifyContent: 'center', fontSize: 13, lineHeight: 1 },
265
272
  dot: { width: 7, height: 7, borderRadius: 999, background: '#4cc38a', display: 'inline-block' },
266
273
  dotEmpty: { width: 7, height: 7, borderRadius: 999, background: 'rgba(255,255,255,0.35)', display: 'inline-block' },
267
274
  panel: {
@@ -523,6 +530,7 @@ window.__ModuleLoader__.load({
523
530
  const sessionId = props.sessionId
524
531
  const variant = props.variant
525
532
  const [open, setOpen] = useState(false)
533
+ const [hovered, setHovered] = useState(false)
526
534
  const [loading, setLoading] = useState(false)
527
535
  const [digest, setDigest] = useState(null)
528
536
  const [error, setError] = useState('')
@@ -583,13 +591,19 @@ window.__ModuleLoader__.load({
583
591
  // The hero (new session) has no history yet; keep it clean.
584
592
  if (variant === 'hero' || !sessionId) return null
585
593
 
594
+ const chipStyle = { ...styles.chip, ...(digest ? styles.chipOn : null), ...(hovered ? styles.chipHover : null) }
586
595
  const chip = h('button', {
587
- style: digest ? { ...styles.chip, ...styles.chipOn } : styles.chip,
596
+ type: 'button',
597
+ style: chipStyle,
588
598
  title: tr('panelTitle'),
599
+ 'aria-expanded': open,
600
+ onMouseEnter: () => setHovered(true),
601
+ onMouseLeave: () => setHovered(false),
589
602
  onClick: () => setOpen(current => !current),
590
603
  },
591
- h('span', { style: digest ? styles.dot : styles.dotEmpty }),
592
- h('span', null, digest ? tr('chipReady') : tr('chipEmpty')))
604
+ h('span', { style: styles.chipIcon, 'aria-hidden': true }, '✎'),
605
+ h('span', null, digest ? tr('chipReady') : tr('chipEmpty')),
606
+ h('span', { style: { opacity: 0.6, marginLeft: 2, fontSize: 11 } }, '▾'))
593
607
 
594
608
  const blocks = digest?.markdown ? parseDigestBlocks(digest.markdown) : []
595
609
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-colophon",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Colophon(卷末)— keep a local, token-free conclusion digest for every conversation, so reopening an old session starts from its final state instead of its full history.",
5
5
  "documentation": "README.md",
6
6
  "license": "MIT",