diff --git a/plugins/index.json b/plugins/index.json index c077d77..0716963 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -44,9 +44,9 @@ "dir": "promptlib", "main": "main.js", "style": "styles.css", - "version": "1.6.11", + "version": "1.6.12", "files": { - "main.js": "89c7ba2d4eb814b391c7c1f41aaed101ce264bb511d9dc3414ee888267a1bef8", + "main.js": "d91005c1e6fabf3434cf39f82a4ded5ad91f30893415a169ca77524178bf6611", "styles.css": "95ff9b134b23278ca4f61d68b8bfc3ccc9046fba9d458f50aced84481eb16512" } }, diff --git a/plugins/promptlib/main.js b/plugins/promptlib/main.js index f83f03d..70b8aec 100644 --- a/plugins/promptlib/main.js +++ b/plugins/promptlib/main.js @@ -1364,7 +1364,10 @@ var gs = groupsOf().slice() if (item.group && !gs.some(function (g) { return g.name === item.group })) gs.push(groupRef(item.group)) close() - save(list, gs).then(function () { notify(isNew ? '已创建' : '已保存') }) + save(list, gs).then(function () { + notify(isNew ? '已创建' : '已保存') + if (!isNew) { try { openDetailModal(item) } catch (e) { /* ignore */ } } + }) } saveBtn.addEventListener('click', doSave) cancelBtn.addEventListener('click', function () { close() }) @@ -1467,7 +1470,7 @@ items.forEach(function (p) { var starred = (p.group || '') === '收藏' var coverUrl = coverOf(p) - var card = el('div', { class: 'iwb-plp-card' + (p.cover ? ' has-cover' : ' no-cover'), draggable: 'true', title: '单击查看详情 · 拖到画布插入 · 右键移动到分组' }) + var card = el('div', { class: 'iwb-plp-card' + (p.cover ? ' has-cover' : ' no-cover'), draggable: 'true', title: '双击查看详情 · 拖到画布插入 · 右键移动到分组' }) var bg = el('div', { class: 'iwb-plp-bg' }) bg.style.background = coverUrl ? 'var(--iwb-plugin-inset)' : gradOf(p) if (coverUrl) bg.appendChild(el('img', { class: 'iwb-plp-cover', src: coverUrl, alt: '', draggable: 'false' })) @@ -1496,7 +1499,7 @@ e.dataTransfer.effectAllowed = 'copy' } catch (err) { /* ignore */ } }) - card.addEventListener('click', function (e) { e.stopPropagation(); try { openDetailModal(p) } catch (err) { notify('详情打开失败:' + ((err && err.message) || err), 'err'); console.error('[promptlib] detail failed', err) } }) + card.addEventListener('dblclick', function (e) { e.stopPropagation(); try { openDetailModal(p) } catch (err) { notify('详情打开失败:' + ((err && err.message) || err), 'err') } }) card.addEventListener('dragend', function () { card.classList.remove('is-dragging'); card.classList.remove('is-pressed') }) @@ -1535,7 +1538,7 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.6.11', + version: '1.6.12', apiVersion: 1, capabilities: ['panels', 'promptlib', 'nodeTypes', 'canvasWrite'], data: { schemaVersion: 3, maxBytes: 4 * 1024 * 1024 }, diff --git a/plugins/promptlib/manifest.json b/plugins/promptlib/manifest.json index 9bfa521..595be94 100644 --- a/plugins/promptlib/manifest.json +++ b/plugins/promptlib/manifest.json @@ -1,7 +1,7 @@ { "id": "promptlib", "name": "提示词库", - "version": "1.6.11", + "version": "1.6.12", "apiVersion": 1, "main": "main.js", "style": "styles.css", @@ -13,7 +13,7 @@ "提示词" ], "files": { - "main.js": "89c7ba2d4eb814b391c7c1f41aaed101ce264bb511d9dc3414ee888267a1bef8", + "main.js": "d91005c1e6fabf3434cf39f82a4ded5ad91f30893415a169ca77524178bf6611", "styles.css": "95ff9b134b23278ca4f61d68b8bfc3ccc9046fba9d458f50aced84481eb16512" } } diff --git a/src/runtime-workbench-logic.js b/src/runtime-workbench-logic.js index 7b004a9..c3075cf 100644 --- a/src/runtime-workbench-logic.js +++ b/src/runtime-workbench-logic.js @@ -1103,8 +1103,8 @@ : { id, type: 'prompt', x: Math.round(wx - 132), y: Math.round(wy - 20), data: { text: obj.text || '', title: obj.name || '' } } pushHistory() // 拖拽入画布新增节点:入撤销历史(鼠标落点保留) commitCanvas(refs.nodes.concat([node]), undefined, undefined) - // 模板节点插入后不选中:选中态下变量输入框可编辑,点它就无法拖节点 - setSel(hasVars ? [] : [id]) + // 插入后不选中:选中态下模板节点的变量输入框可编辑,点它就无法拖节点 + setSel([]) setNotice({ type: 'ok', text: (hasVars ? '已插入提示词模板:' : '已插入提示词:') + (obj.name || '') }) return } catch (err) { /* 非本应用拖入 */ }