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.
- package/README.md +6 -0
- package/client.js +22 -8
- package/package.json +1 -1
package/README.md
CHANGED
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:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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)
|
|
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
|
-
|
|
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:
|
|
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.
|
|
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",
|