dsh-aurorix-agentbook 1.8.2 → 1.8.4
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/lib/view.js +16 -16
- package/lib/web.js +11 -6
- package/lib/words.js +2 -0
- package/package.json +1 -1
package/lib/view.js
CHANGED
|
@@ -126,13 +126,13 @@ export function memoryView(state, caps = {}) {
|
|
|
126
126
|
{ type: 'textField', label: w.writeBody, bind: 'data.draft.body', placeholder: w.writeBodyPlaceholder, multiline: true, maxLines: 6, maxLength: 2000, required: true, minLength: 1 },
|
|
127
127
|
{ type: 'textField', label: w.writeReadWhen, bind: 'data.draft.readWhen', placeholder: w.writeReadWhen, maxLength: 200 },
|
|
128
128
|
] },
|
|
129
|
+
{ type: 'text', text: b('draftNote'), tone: 'muted' },
|
|
129
130
|
] },
|
|
130
|
-
{ type: 'text', text: b('draftNote'), tone: 'muted' },
|
|
131
131
|
|
|
132
132
|
// 四、保险箱:独立平面,列表只带标识与用途,正文点开才解密
|
|
133
133
|
{ type: 'divider', size: 'S' },
|
|
134
|
-
|
|
135
|
-
{ type: 'text', text: w.vaultHint,
|
|
134
|
+
// 标题和说明原来各占一行,说的是同一件事:合成一行标题「保险箱 · 凭据单独存放」
|
|
135
|
+
{ type: 'text', text: `${w.vaultTitle} · ${w.vaultHint}`, style: { size: 'subtitle', weight: 'semibold' } },
|
|
136
136
|
{ type: 'form', submit: 'vault-filter', submitLabel: w.vaultFilterBtn, children: [
|
|
137
137
|
{ type: 'textField', label: w.vaultQueryLabel, bind: 'data.vaultQuery', placeholder: w.vaultQueryPlaceholder, maxLength: 120 },
|
|
138
138
|
] },
|
|
@@ -144,8 +144,8 @@ export function memoryView(state, caps = {}) {
|
|
|
144
144
|
{ type: 'textField', label: w.vaultPurpose, bind: 'data.vaultDraft.purpose', placeholder: w.vaultPurposePlaceholder, maxLength: 400, required: true, minLength: 1 },
|
|
145
145
|
{ type: 'textField', label: w.vaultBody, bind: 'data.vaultDraft.body', placeholder: w.vaultBodyPlaceholder, multiline: true, maxLines: 6, maxLength: 2000, required: true, minLength: 1 },
|
|
146
146
|
] },
|
|
147
|
+
{ type: 'text', text: b('vaultDraftNote'), tone: 'muted' },
|
|
147
148
|
] },
|
|
148
|
-
{ type: 'text', text: b('vaultDraftNote'), tone: 'muted' },
|
|
149
149
|
|
|
150
150
|
{ type: 'actions', items: [
|
|
151
151
|
{ label: w.retry, icon: 'refresh', action: 'reload', style: 'plain' },
|
|
@@ -190,10 +190,9 @@ function detailView(state, caps) {
|
|
|
190
190
|
{ type: 'textField', label: w.editBody, bind: 'data.detailDraft.body', multiline: true, maxLines: 8, maxLength: 2000, value: pageText },
|
|
191
191
|
{ type: 'textField', label: w.editReadWhen, bind: 'data.detailDraft.readWhen', maxLength: 200, value: dft.readWhen ?? '' },
|
|
192
192
|
]
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
193
|
+
// 页码说明并进表单标题;只有一页时不提页码,免得多说一句
|
|
194
|
+
const note = pageTotal > 1 ? w.editPageNoteShort(pageNo + 1, pageTotal) : ''
|
|
195
|
+
const kind = isVault ? w.detailVaultKind : w.detailMemoryKind
|
|
197
196
|
return {
|
|
198
197
|
v: 2,
|
|
199
198
|
type: 'stack',
|
|
@@ -201,9 +200,8 @@ function detailView(state, caps) {
|
|
|
201
200
|
accent: 'teal',
|
|
202
201
|
style: { gap: 'M' },
|
|
203
202
|
children: [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
{ type: 'form', submit: 'detail-save', submitLabel: w.detailSave, children: fields },
|
|
203
|
+
// 页码与说明原来独占一行;并进表单标题,信息不丢、行数少一
|
|
204
|
+
{ type: 'form', label: note === '' ? kind : `${note} · ${kind}`, submit: 'detail-save', submitLabel: w.detailSave, children: fields },
|
|
207
205
|
// 末尾追加:正文继续写长,不受单页字数限制。
|
|
208
206
|
{ type: 'form', label: w.appendTitle, submit: 'detail-append', submitLabel: w.appendBtn, children: [
|
|
209
207
|
{ type: 'textField', label: w.appendBody, bind: 'data.detailDraft.append', multiline: true, maxLines: 6, maxLength: 2000 },
|
|
@@ -221,19 +219,21 @@ function detailView(state, caps) {
|
|
|
221
219
|
// 平面信息已经在下面的元信息表里,这里不再单占一行。
|
|
222
220
|
const children = [
|
|
223
221
|
{ type: 'text', text: clip(d.title === '' ? '—' : d.title, 200), style: { size: 'title', weight: 'semibold' } },
|
|
222
|
+
// 元信息本身是一张卡片,已经和正文分开;再压一条分隔线是重复分隔
|
|
224
223
|
{ type: 'keyValue', items: meta },
|
|
225
|
-
{ type: 'divider', size: 'S' },
|
|
226
224
|
]
|
|
227
225
|
if (shown.text === '') children.push({ type: 'callout', text: w.bodyEmpty, tone: 'warn' })
|
|
228
226
|
else children.push({ type: 'text', text: shown.text })
|
|
227
|
+
|
|
229
228
|
if (shown.pages > 1) {
|
|
230
229
|
children.push({ type: 'text', text: w.detailPageOf(shown.page + 1, shown.pages, shown.total), tone: 'muted' })
|
|
231
|
-
children.push({ type: 'actions', items: [
|
|
232
|
-
{ label: w.prevPage, action: 'detail-page-prev', style: 'plain' },
|
|
233
|
-
{ label: w.nextPage, action: 'detail-page-next', style: 'plain' },
|
|
234
|
-
] })
|
|
235
230
|
}
|
|
231
|
+
// 翻页、返回、编辑、复制并成一组:原来翻页一组、操作一组,两行按钮说的是同一件事。
|
|
236
232
|
children.push({ type: 'actions', items: [
|
|
233
|
+
...(shown.pages > 1 ? [
|
|
234
|
+
{ label: w.prevPage, action: 'detail-page-prev', style: 'plain' },
|
|
235
|
+
{ label: w.nextPage, action: 'detail-page-next', style: 'plain' },
|
|
236
|
+
] : []),
|
|
237
237
|
{ label: w.detailBack, action: 'detail-back', style: 'plain' },
|
|
238
238
|
// 既然已经点进详情页,就该能就地改——不用退回去重写一条。
|
|
239
239
|
...(hasForm ? [{ label: w.detailEdit, icon: 'pencil', action: 'detail-edit', style: 'plain' }] : []),
|
package/lib/web.js
CHANGED
|
@@ -87,6 +87,9 @@ th:last-child,td:last-child{text-align:right}
|
|
|
87
87
|
td{padding:9px 0;border-bottom:1px solid var(--line);color:var(--ink)}
|
|
88
88
|
td:last-child{color:var(--muted);font-variant-numeric:tabular-nums}
|
|
89
89
|
tr:last-child td{border-bottom:0}
|
|
90
|
+
.fieldrow{display:flex;gap:9px;align-items:flex-start;margin-bottom:10px}
|
|
91
|
+
.fieldrow .fieldwrap{flex:1 1 auto;margin-bottom:0}
|
|
92
|
+
.fieldrow button{flex:0 0 auto;padding:9px 20px}
|
|
90
93
|
.fieldwrap{position:relative;margin-bottom:10px}
|
|
91
94
|
input,textarea,select{width:100%;background:var(--field);border:1px solid var(--line);border-radius:11px;padding:9px 12px;color:var(--ink);font:inherit;outline:none}
|
|
92
95
|
input:focus,textarea:focus,select:focus{border-color:var(--accent)}
|
|
@@ -135,9 +138,10 @@ details .inner{padding:4px 0 16px;border-top:1px solid var(--line)}
|
|
|
135
138
|
|
|
136
139
|
<section>
|
|
137
140
|
<div class="sect">${t.recall}</div>
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
<div class="fieldrow">
|
|
142
|
+
<div class="fieldwrap"><input id="q" maxlength="120" placeholder="${t.keywordPh}" autocomplete="off"><span class="cnt" id="qcnt">0/120</span></div>
|
|
143
|
+
<button id="go">${t.go}</button>
|
|
144
|
+
</div>
|
|
141
145
|
<div id="results"><div class="hint">${t.none}</div></div>
|
|
142
146
|
</section>
|
|
143
147
|
|
|
@@ -154,9 +158,10 @@ details .inner{padding:4px 0 16px;border-top:1px solid var(--line)}
|
|
|
154
158
|
<section>
|
|
155
159
|
<div class="sect">${t.vault}</div>
|
|
156
160
|
<p class="sub">${t.vaultSub}</p>
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
<div class="fieldrow">
|
|
162
|
+
<div class="fieldwrap"><input id="vq" maxlength="120" placeholder="${t.filterPh}" autocomplete="off"><span class="cnt" id="vcnt">0/120</span></div>
|
|
163
|
+
<button class="ghost" id="vgo">${t.filterBtn}</button>
|
|
164
|
+
</div>
|
|
160
165
|
<div class="hint" id="vcount"></div>
|
|
161
166
|
<div id="vlist"></div>
|
|
162
167
|
</section>
|
package/lib/words.js
CHANGED
|
@@ -101,6 +101,7 @@ export const WORDS = {
|
|
|
101
101
|
prevPage: '上一页',
|
|
102
102
|
nextPage: '下一页',
|
|
103
103
|
editPageNote: (page, pages) => `第 ${page}/${pages} 页。改完点「保存修改」,有下一页就自动翻过去;每页都会存下来。`,
|
|
104
|
+
editPageNoteShort: (page, pages) => `第 ${page}/${pages} 页`,
|
|
104
105
|
appendNote: (n) => `末尾追加 ${n} 字`,
|
|
105
106
|
appendTitle: '在末尾接着写',
|
|
106
107
|
appendBody: '接着写的内容(会接到正文最后,不限字数)',
|
|
@@ -210,6 +211,7 @@ export const WORDS = {
|
|
|
210
211
|
prevPage: 'Previous',
|
|
211
212
|
nextPage: 'Next',
|
|
212
213
|
editPageNote: (page, pages) => `Page ${page} of ${pages}. Tap Save to store this page and move to the next one.`,
|
|
214
|
+
editPageNoteShort: (page, pages) => `Page ${page}/${pages}`,
|
|
213
215
|
appendNote: (n) => `Append ${n} characters`,
|
|
214
216
|
appendTitle: 'Keep writing at the end',
|
|
215
217
|
appendBody: 'Text to append to the end of the body (no length limit)',
|