From ebf277158b8325f1834eee75516d309e9ff2fd8b Mon Sep 17 00:00:00 2001 From: qiqi Date: Sat, 21 Nov 2026 21:42:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(promptlib):=201.3.2=20=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E5=B0=81=E9=9D=A2=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- promptlib/package.json | 2 +- promptlib/src/index.js | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/promptlib/package.json b/promptlib/package.json index afd5590..bf6cf08 100644 --- a/promptlib/package.json +++ b/promptlib/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/promptlib", "private": true, - "version": "1.3.1", + "version": "1.3.2", "description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供", "ibwPlugin": { "id": "promptlib", diff --git a/promptlib/src/index.js b/promptlib/src/index.js index dee6cc0..b3280a0 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -602,7 +602,20 @@ }) cp.addEventListener('click', function () { Promise.resolve(api.copy(p.text || '')).then(function (r) { if (r && r.ok === false) notify('复制失败', 'err'); else notify('已复制全文') }) }) ins.addEventListener('click', function () { Promise.resolve(api.insert(p.text || '', p.name || '')).then(function () { notify('已插入画布:' + (p.name || '提示词')); dlg.close() }).catch(function () { notify('插入画布失败', 'err') }) }) - footEl.appendChild(del); footEl.appendChild(el('span', { class: 'iwb-drawer-spacer' })); footEl.appendChild(cp); footEl.appendChild(ins) + var insImg = null + if (p.cover) { + insImg = el('button', { class: 'iwb-btn iwb-btn-sm', title: '把这条提示词的封面作为参考图插入画布', text: '插入图片' }) + insImg.addEventListener('click', function () { + Promise.resolve(api.insertImage(p.cover, p.name || '')).then(function (r) { + if (r && r.ok === false) { notify((r && r.error) || '插入封面失败', 'err'); return } + notify('已插入封面图片') + dlg.close() + }).catch(function () { notify('插入封面失败', 'err') }) + }) + } + footEl.appendChild(del); footEl.appendChild(el('span', { class: 'iwb-drawer-spacer' })); footEl.appendChild(cp) + if (insImg) footEl.appendChild(insImg) + footEl.appendChild(ins) }, }) edit.addEventListener('click', function () { dlg.close(); openEditModal(p, false) }) @@ -837,7 +850,7 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.3.1', + version: '1.3.2', apiVersion: 1, capabilities: ['panels', 'promptlib'], data: { schemaVersion: 1, maxBytes: 65536 },