dsh-colophon 0.2.4 → 0.2.5
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 +7 -0
- package/client.js +65 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## 0.2.5(摘要面板排版精修)
|
|
2
|
+
|
|
3
|
+
- 区块标题加大到 15px 并使用主题强调色,标题前带强调竖条。
|
|
4
|
+
- 面板右上角新增 ✕ 关闭按钮。
|
|
5
|
+
- 底部操作区与正文用分隔线分开。
|
|
6
|
+
- 区块内的条目改为有序编号(1. 2. 3.),不再使用短横线。
|
|
7
|
+
|
|
1
8
|
## 0.2.4(摘要区块可配置 + 明亮摘要面板)
|
|
2
9
|
|
|
3
10
|
- 摘要内容改为**区块制**,可在设置页逐项开关:目标 / 结论 / 决策 / 涉及文件 / 完成情况 / 下一步 / 风险与注意 / 关键词 / 待确认问题(默认只开目标、结论、决策、下一步、风险与注意,不再输出中间的已完成动作)。
|
package/client.js
CHANGED
|
@@ -274,14 +274,30 @@ window.__ModuleLoader__.load({
|
|
|
274
274
|
},
|
|
275
275
|
panelHead: { display: 'flex', alignItems: 'center', gap: 8, marginBottom: 10 },
|
|
276
276
|
title: { fontSize: 15, fontWeight: 600, color: 'var(--dsw-alias-label-primary, #1f2329)' },
|
|
277
|
-
digestTitle: {
|
|
278
|
-
|
|
277
|
+
digestTitle: {
|
|
278
|
+
fontSize: 15, fontWeight: 650, letterSpacing: '-0.01em',
|
|
279
|
+
color: 'var(--dsw-alias-state-business-primary, #4d6bfe)', marginBottom: 6,
|
|
280
|
+
display: 'flex', alignItems: 'center', gap: 7,
|
|
281
|
+
},
|
|
282
|
+
digestTitleBar: { width: 3, height: 14, borderRadius: 2, background: 'currentColor', display: 'inline-block' },
|
|
283
|
+
digestBlock: { marginTop: 6, paddingTop: 14, borderTop: '1px solid var(--dsw-alias-border-l1, rgba(0,0,0,0.07))' },
|
|
284
|
+
digestPara: { margin: '0 0 6px', fontSize: 13, lineHeight: 1.65, color: 'var(--dsw-alias-label-primary, #1f2329)' },
|
|
285
|
+
digestList: { margin: '4px 0 6px', paddingLeft: 20, fontSize: 13, lineHeight: 1.7, color: 'var(--dsw-alias-label-primary, #1f2329)' },
|
|
286
|
+
digestItem: { marginBottom: 2, paddingLeft: 2 },
|
|
279
287
|
digestBody: {
|
|
280
288
|
whiteSpace: 'pre-wrap', wordBreak: 'break-word', margin: 0, fontFamily: 'inherit',
|
|
281
289
|
fontSize: 13, lineHeight: 1.65, color: 'var(--dsw-alias-label-primary, #1f2329)',
|
|
282
290
|
},
|
|
283
291
|
pre: { whiteSpace: 'pre-wrap', wordBreak: 'break-word', margin: 0, fontFamily: 'var(--dsh-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)', fontSize: 11, lineHeight: 1.6 },
|
|
284
|
-
actions: {
|
|
292
|
+
actions: {
|
|
293
|
+
display: 'flex', gap: 8, marginTop: 14, paddingTop: 12, flexWrap: 'wrap',
|
|
294
|
+
borderTop: '1px solid var(--dsw-alias-border-l1, rgba(0,0,0,0.07))',
|
|
295
|
+
},
|
|
296
|
+
closeIcon: {
|
|
297
|
+
appearance: 'none', border: 0, background: 'transparent', cursor: 'pointer', marginLeft: 4,
|
|
298
|
+
width: 26, height: 26, borderRadius: 6, display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
|
299
|
+
color: 'var(--dsw-alias-label-tertiary, #8b93a1)', fontSize: 14, lineHeight: 1,
|
|
300
|
+
},
|
|
285
301
|
button: {
|
|
286
302
|
padding: '4px 10px', borderRadius: 8, border: '1px solid rgba(255,255,255,0.2)',
|
|
287
303
|
background: 'rgba(255,255,255,0.08)', color: 'inherit', cursor: 'pointer', fontSize: 12,
|
|
@@ -463,6 +479,45 @@ window.__ModuleLoader__.load({
|
|
|
463
479
|
.filter(block => block.body !== '' || /^(卷末|Colophon)/i.test(block.heading) === false)
|
|
464
480
|
}
|
|
465
481
|
|
|
482
|
+
/** Render one digest block: paragraphs plus a numbered list for bullet lines. */
|
|
483
|
+
function renderDigestBlock(block, key) {
|
|
484
|
+
const nodes = []
|
|
485
|
+
let paragraphs = []
|
|
486
|
+
let items = []
|
|
487
|
+
const flushParagraph = () => {
|
|
488
|
+
if (paragraphs.length > 0) {
|
|
489
|
+
nodes.push(h('p', { key: `p${nodes.length}`, style: styles.digestPara }, paragraphs.join('\n')))
|
|
490
|
+
paragraphs = []
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
const flushItems = () => {
|
|
494
|
+
if (items.length > 0) {
|
|
495
|
+
nodes.push(h('ol', { key: `l${nodes.length}`, style: styles.digestList },
|
|
496
|
+
items.map((item, index) => h('li', { key: index, style: styles.digestItem }, item))))
|
|
497
|
+
items = []
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
for (const raw of block.body.split('\n')) {
|
|
501
|
+
const line = raw.trim()
|
|
502
|
+
const bullet = line.match(/^[-*•]\s+(.*)$/)
|
|
503
|
+
if (bullet) {
|
|
504
|
+
flushParagraph()
|
|
505
|
+
items.push(bullet[1])
|
|
506
|
+
} else if (line === '') {
|
|
507
|
+
flushParagraph()
|
|
508
|
+
flushItems()
|
|
509
|
+
} else {
|
|
510
|
+
flushItems()
|
|
511
|
+
paragraphs.push(line)
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
flushItems()
|
|
515
|
+
flushParagraph()
|
|
516
|
+
return h('div', { key, style: styles.digestBlock },
|
|
517
|
+
h('div', { style: styles.digestTitle }, h('span', { style: styles.digestTitleBar }), block.heading),
|
|
518
|
+
nodes)
|
|
519
|
+
}
|
|
520
|
+
|
|
466
521
|
/** The chip + floating digest panel above the composer. */
|
|
467
522
|
function ColophonDock(props) {
|
|
468
523
|
const sessionId = props.sessionId
|
|
@@ -542,14 +597,16 @@ window.__ModuleLoader__.load({
|
|
|
542
597
|
h('div', { style: styles.panelHead },
|
|
543
598
|
h('span', { style: styles.title }, tr('panelTitle')),
|
|
544
599
|
h('span', { style: { ...styles.muted, marginRight: 'auto' } }, digest?.updatedAt ? new Date(digest.updatedAt).toLocaleString() : ''),
|
|
545
|
-
h('button', { style: { ...styles.buttonPrimary, minWidth: 92 }, onClick: () => void generate(), disabled: loading },
|
|
546
|
-
digest ? tr('regenerate') : tr('generate'))
|
|
600
|
+
h('button', { style: { ...styles.buttonPrimary, minWidth: 92, height: 30 }, onClick: () => void generate(), disabled: loading },
|
|
601
|
+
digest ? tr('regenerate') : tr('generate')),
|
|
602
|
+
h('button', {
|
|
603
|
+
style: styles.closeIcon, title: tr('close'), 'aria-label': tr('close'),
|
|
604
|
+
onClick: () => setOpen(false),
|
|
605
|
+
}, '✕')),
|
|
547
606
|
loading ? h('div', { style: styles.muted }, tr('loading'))
|
|
548
607
|
: error ? h('div', { style: styles.warn }, tr('failed', { message: error }))
|
|
549
608
|
: blocks.length > 0
|
|
550
|
-
? h('div', null, blocks.map((block, index) =>
|
|
551
|
-
h('div', { style: styles.digestTitle }, block.heading),
|
|
552
|
-
h('div', { style: styles.digestBody }, block.body))))
|
|
609
|
+
? h('div', null, blocks.map((block, index) => renderDigestBlock(block, index)))
|
|
553
610
|
: h('div', { style: styles.muted }, tr('empty')),
|
|
554
611
|
h('div', { style: styles.actions },
|
|
555
612
|
digest?.markdown ? h('button', { style: styles.buttonSecondary, onClick: () => void copy() }, copied ? tr('copied') : tr('copy')) : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-colophon",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
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",
|