feat(plugins): 拖拽提示词按变量分流到模板节点 + promptlib 1.5.7 同步

This commit is contained in:
qiqi committed 2026-11-22 17:05:56 +08:00
1 parent 3e28796a15
commit 0c11b45af5
4 files changed
+22 -7

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@
"style": "styles.css",
"version": "1.5.0",
"files": {
"main.js": "25f3b26f3727f7378db15ff6ac05cf548e77fdfc1accb8ae738f0187d0e8e71a",
"main.js": "5482e49e99329f368c7e63e30ec64989439ac999b684c7dbafc5916807184c61",
"styles.css": "28a267866d81708fc51aa61a40f922decd917c9ea907c52c8c916fe6398cad68"
}
},
+7 -3
View File
@@ -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'
+1 -1
View File
@@ -13,7 +13,7 @@
"提示词"
],
"files": {
"main.js": "25f3b26f3727f7378db15ff6ac05cf548e77fdfc1accb8ae738f0187d0e8e71a",
"main.js": "5482e49e99329f368c7e63e30ec64989439ac999b684c7dbafc5916807184c61",
"styles.css": "28a267866d81708fc51aa61a40f922decd917c9ea907c52c8c916fe6398cad68"
}
}