From 9ed18827a8e4eb1dc3cf7e06dac10d2884457f6d Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 24 Nov 2026 11:16:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(promptlib):=201.9.1=20=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=E5=8A=A0=E3=80=8C=E5=AF=BC=E5=85=A5=E8=AF=8D?= =?UTF-8?q?=E4=BE=8B=E3=80=8D=E4=B8=8E=E3=80=8C=EF=BC=8B=20=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E8=AF=8D=E4=BE=8B=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- promptlib/package.json | 2 +- promptlib/src/index.js | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/promptlib/package.json b/promptlib/package.json index d988eb7..066658a 100644 --- a/promptlib/package.json +++ b/promptlib/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/promptlib", "private": true, - "version": "1.9.0", + "version": "1.9.1", "description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供", "ibwPlugin": { "id": "promptlib", diff --git a/promptlib/src/index.js b/promptlib/src/index.js index d06dcf7..11e8302 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -1538,7 +1538,7 @@ var dirty = false openDialog({ key: 'edit', - title: isNew ? '新建提示词' : '编辑提示词', + title: isNew ? '新建词例' : '编辑词例', width: 880, height: 640, actions: [cancelBtn, saveBtn], onSaveKey: function () { doSave() }, @@ -1742,10 +1742,20 @@ var top = el('div', { class: 'iwb-row' }) var search = el('input', { class: 'iwb-input iwb-grow', placeholder: '搜索名称 / 内容 / 标签…', value: query }) search.addEventListener('input', function () { query = search.value; render(); var n = wrap.querySelector('input.iwb-input'); if (n) { n.focus(); try { n.setSelectionRange(n.value.length, n.value.length) } catch (e) { /* ignore */ } } }) - var newBtn = el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-primary', title: '新建提示词', text: '+ 新建提示词' }) + // 2026-11-24:导入/新建都放搜索行,避免「导入分享」藏在设置里(用户反馈多绕一层)。 + var importBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '从剪贴板导入别人分享的词例', text: '导入词例' }) + var newBtn = el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-primary', title: '新建词例', text: '+ 新建词例' }) + importBtn.addEventListener('click', function () { + importBtn.disabled = true + doImportShare().then(function (r) { + importBtn.disabled = false + if (r && r.ok === false && r.error === 'no-share') notify('剪贴板里没有可识别的词例分享', 'err') + else if (r && r.ok === false) notify('导入失败', 'err') + }).catch(function (e) { importBtn.disabled = false; notify('导入失败:' + ((e && e.message) || e), 'err') }) + }) newBtn.addEventListener('click', function () { openEditModal(null, true) }) - top.appendChild(search); top.appendChild(newBtn) + top.appendChild(search); top.appendChild(importBtn); top.appendChild(newBtn) fixed.appendChild(top) if (words().length) { @@ -1860,7 +1870,7 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.9.0', + version: '1.9.1', apiVersion: 1, capabilities: ['panels', 'promptlib', 'nodeTypes', 'canvas', 'canvasWrite'], data: { schemaVersion: 3, maxBytes: 4 * 1024 * 1024 },