From 59588ef4ccfde503bd22020b38bc75feabca20fe Mon Sep 17 00:00:00 2001 From: qiqi Date: Sat, 21 Nov 2026 21:26:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(promptlib):=201.3.0=20=E5=B0=81=E9=9D=A2?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=94=AE=20+=20=E4=B8=8A=E4=BC=A0=E5=8D=B3?= =?UTF-8?q?=E6=97=B6=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- promptlib/package.json | 2 +- promptlib/src/index.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/promptlib/package.json b/promptlib/package.json index 96773ce..30e3cff 100644 --- a/promptlib/package.json +++ b/promptlib/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/promptlib", "private": true, - "version": "1.2.1", + "version": "1.3.0", "description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供", "ibwPlugin": { "id": "promptlib", diff --git a/promptlib/src/index.js b/promptlib/src/index.js index a714cd5..f03cfcf 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -430,7 +430,8 @@ var coverPending = {} function coverOf (p) { if (!p || !p.cover) return '' - var key = p.id + '|' + p.cover + var ck = (p.cover && typeof p.cover === 'object') ? ('b:' + String(p.cover.__blob || p.cover.__cache || 'obj')) : ('s:' + String(p.cover).slice(-32)) + var key = p.id + '|' + ck var hit = coverCache[key] if (hit) return hit // 只缓存成功结果;失败/未解析的下一帧会再试(之前缓存空串导致封面永远不刷新) @@ -568,7 +569,7 @@ function paintCoverInto (node, p) { node.textContent = '' - var url = coverOf(p) + var url = p && p._coverUrl ? p._coverUrl : coverOf(p) node.style.background = url ? 'var(--iwb-plugin-inset)' : gradOf(p) if (url) node.appendChild(el('img', { class: 'iwb-plp-cover', src: url, alt: '' })) } @@ -638,8 +639,11 @@ dirty = true Object.keys(coverCache).forEach(function (k) { if (k.indexOf(draft.id + '|') === 0) delete coverCache[k] }) Promise.resolve(api.coverUrl(r.ref)).then(function (u) { - if (u && u.url) coverCache[draft.id + '|' + r.ref] = u.url - repaint(); notify('封面已更新') + if (u && u.url) { + draft._coverUrl = u.url + coverCache[draft.id + '|s:' + String(r.ref).slice(-32)] = u.url + } + repaint(); render(); notify('封面已更新') }) }).catch(function () { notify('封面上传失败', 'err') }) } @@ -833,7 +837,7 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.2.1', + version: '1.3.0', apiVersion: 1, capabilities: ['panels', 'promptlib'], data: { schemaVersion: 1, maxBytes: 65536 },