@restregular/dsh-memory 0.6.6 → 0.6.7
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 +1 -0
- package/lib/client.js +24 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -310,6 +310,7 @@ tools/build-single-package.mjs 构建(产物契约检查 + 可选加载验证)
|
|
|
310
310
|
|
|
311
311
|
## 版本
|
|
312
312
|
|
|
313
|
+
- **0.6.7** —— 记录卡展开后显示**完整 id**(等宽字体,点击复制)与**标签**;折叠时只保留预览与徽标,列表更安静。
|
|
313
314
|
- **0.6.6** —— 记录卡显示**标签气泡**(之前标签只存不显示,新建后看不到,容易误以为没保存);“修正”关系双向标注:修正版显示「修正自 <旧 id 前 8 位>」,被覆盖的旧记录显示「已被修正」(旧记录仍可检索,只是排序降权 0.3×);面板 `/records` 补齐 `supersededBy` 反查;新建表单的标签输入加了标签名与示例。
|
|
314
315
|
- **0.6.5** —— 统计卡从「服务」移到「**记录**」页顶部(和记忆列表放在一起),滚动容器高度相应扣掉统计卡那一档。
|
|
315
316
|
- **0.6.4** —— 标签命名对齐:概览页改名「**服务**」,记忆列表页改名「**记录**」(默认打开);从侧栏入口打开时,记录列表的滚动容器跟着窗口高度长高,不再停在设置面板那档 62vh。
|
package/lib/client.js
CHANGED
|
@@ -82,6 +82,10 @@ window.__ModuleLoader__.load({
|
|
|
82
82
|
'.memp .badge.corrected{color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}',
|
|
83
83
|
'.memp .tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}',
|
|
84
84
|
'.memp .tag{font-size:11px;line-height:1.7;padding:0 6px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}',
|
|
85
|
+
'.memp .meta{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:12px;color:var(--dsw-alias-label-secondary)}',
|
|
86
|
+
'.memp .meta-id{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11.5px;padding:1px 6px;border-radius:5px;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);cursor:pointer;user-select:all}',
|
|
87
|
+
'.memp .meta-id:hover{color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}',
|
|
88
|
+
'.memp .meta-done{color:var(--dsw-alias-brand-primary);font-size:11.5px}',
|
|
85
89
|
'.memp .pending{flex:none}',
|
|
86
90
|
'.memp .time{margin-left:auto;flex:none}',
|
|
87
91
|
'.memp .preview{margin-top:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--dsw-alias-label-secondary);line-height:1.5}',
|
|
@@ -223,6 +227,15 @@ window.__ModuleLoader__.load({
|
|
|
223
227
|
const [importance, setImportance] = React.useState(rec.importance)
|
|
224
228
|
const [busy, setBusy] = React.useState(false)
|
|
225
229
|
const [error, setError] = React.useState('')
|
|
230
|
+
const [copied, setCopied] = React.useState(false)
|
|
231
|
+
|
|
232
|
+
const copyId = () => {
|
|
233
|
+
try {
|
|
234
|
+
if (navigator?.clipboard?.writeText) void navigator.clipboard.writeText(rec.id)
|
|
235
|
+
setCopied(true)
|
|
236
|
+
setTimeout(() => setCopied(false), 1200)
|
|
237
|
+
} catch { /* 剪贴板不可用时忽略 */ }
|
|
238
|
+
}
|
|
226
239
|
|
|
227
240
|
// editing implies expanded: the editor replaces the body
|
|
228
241
|
const open = expanded || editing
|
|
@@ -287,9 +300,6 @@ window.__ModuleLoader__.load({
|
|
|
287
300
|
h('span', { className: 'time', title: `更新于 ${fmtTime(rec.updatedAt)}` }, fmtTime(rec.updatedAt)),
|
|
288
301
|
),
|
|
289
302
|
!open ? h('div', { className: 'preview' }, rec.content) : null,
|
|
290
|
-
rec.tags && rec.tags.length > 0
|
|
291
|
-
? h('div', { className: 'tags' }, rec.tags.map((tag) => h('span', { className: 'tag', key: tag }, tag)))
|
|
292
|
-
: null,
|
|
293
303
|
open
|
|
294
304
|
? h('div', { className: 'rec-body' },
|
|
295
305
|
editing
|
|
@@ -312,7 +322,17 @@ window.__ModuleLoader__.load({
|
|
|
312
322
|
h('button', { disabled: busy, onClick: cancelEdit }, '取消'),
|
|
313
323
|
),
|
|
314
324
|
)
|
|
315
|
-
: h('div',
|
|
325
|
+
: h('div', null,
|
|
326
|
+
h('div', { className: 'content' }, rec.content),
|
|
327
|
+
h('div', { className: 'meta' },
|
|
328
|
+
h('span', { className: 'meta-label' }, 'id'),
|
|
329
|
+
h('code', { className: 'meta-id', title: '点击复制完整 id', onClick: copyId }, rec.id),
|
|
330
|
+
copied ? h('span', { className: 'meta-done' }, '已复制') : null,
|
|
331
|
+
),
|
|
332
|
+
rec.tags && rec.tags.length > 0
|
|
333
|
+
? h('div', { className: 'tags' }, rec.tags.map((tag) => h('span', { className: 'tag', key: tag }, tag)))
|
|
334
|
+
: null,
|
|
335
|
+
),
|
|
316
336
|
)
|
|
317
337
|
: null,
|
|
318
338
|
error ? h('div', { className: 'err' }, error) : null,
|