From 8b72967381aa4d0b40a3fd42be48a84bf0e67efd Mon Sep 17 00:00:00 2001 From: qiqi Date: Sun, 22 Nov 2026 17:05:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(promptlib):=201.5.7=20=E6=8B=96=E6=8B=BD?= =?UTF-8?q?=E6=8C=89=E5=8F=98=E9=87=8F=E5=88=86=E6=B5=81=EF=BC=88=E6=9C=89?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E2=86=92=E6=A8=A1=E6=9D=BF=E8=8A=82=E7=82=B9?= =?UTF-8?q?=EF=BC=89+=20=E5=8E=BB=E6=8E=89=E7=B4=AB=E8=89=B2=E8=A7=92?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- promptlib/src/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/promptlib/src/index.js b/promptlib/src/index.js index 6231b9f..efb65b5 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -931,13 +931,17 @@ var card = el('div', { class: 'iwb-plp-card' + (p.cover ? ' has-cover' : ' no-cover'), draggable: 'true', title: '单击查看详情 · 拖到画布插入 · 右键移动到分组' }) card.style.background = coverUrl ? 'var(--iwb-plugin-inset)' : gradOf(p) if (coverUrl) card.appendChild(el('img', { class: 'iwb-plp-cover', src: coverUrl, alt: '', draggable: 'false' })) - // 紫色小点:表示这条是带变量的模板(不喧宾夺主,鼠标悬停看数量) - if (varsOf(p).length) card.appendChild(el('i', { class: 'iwb-plp-vdot', title: varsOf(p).length + ' 个变量' })) card.appendChild(el('div', { class: 'iwb-plp-t', text: p.name || '未命名' })) card.addEventListener('dragstart', function (e) { try { e.stopPropagation() - e.dataTransfer.setData('application/x-iwb-prompt', JSON.stringify({ text: p.text || '', name: p.name || '' })) + var vd = varsOf(p) + e.dataTransfer.setData('application/x-iwb-prompt', JSON.stringify({ + text: p.text || '', name: p.name || '', + vars: vd.map(function (v) { return v.key }), + vdefs: vd, + cover: p.cover || '', + })) e.dataTransfer.setData('application/x-iwb-promptid', p.id) e.dataTransfer.setData('text/plain', (p.text || '').slice(0, 200)) e.dataTransfer.effectAllowed = 'copy'