This commit is contained in:
1 parent
e02b5f4345
commit
64db27155a
3 files changed
+16
-8
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@iwb-plugin/promptlib",
|
||||
"private": true,
|
||||
"version": "1.6.21",
|
||||
"version": "1.6.22",
|
||||
"description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供",
|
||||
"ibwPlugin": {
|
||||
"id": "promptlib",
|
||||
|
||||
+13
-7
@@ -804,17 +804,23 @@
|
||||
if (st.ghost && st.ghost.parentNode) st.ghost.parentNode.removeChild(st.ghost)
|
||||
try { document.body.style.cursor = '' } catch (e) { /* ignore */ }
|
||||
}
|
||||
// v1.6.22:放置指示改成半透明矩形框(跟手、左上角对齐落点),不再用卡片式幽灵。
|
||||
function makePlaceGhost (kind) {
|
||||
var dims = kind === 'ptpl' ? { w: 420, h: 260 } : (kind === 'img' ? { w: 280, h: 180 } : { w: 280, h: 120 })
|
||||
var box = el('div', { class: 'iwb-plp-placebox' })
|
||||
box.style.width = dims.w + 'px'
|
||||
box.style.height = dims.h + 'px'
|
||||
box.appendChild(el('div', { class: 'iwb-plp-placebox-t', text: '点击放置' }))
|
||||
return box
|
||||
}
|
||||
function beginPlacement (kind, payload) {
|
||||
cancelPlacement()
|
||||
var ghost = makeDragGhost(payload)
|
||||
ghost.classList.add('iwb-plp-placeghost')
|
||||
var hint = kind === 'img' ? '点击画布放置封面图片 · Esc 取消' : (kind === 'ptpl' ? '点击画布放置模板节点 · Esc 取消' : '点击画布放置提示词 · Esc 取消')
|
||||
ghost.appendChild(el('div', { class: 'iwb-plp-placehint', text: hint }))
|
||||
var ghost = makePlaceGhost(kind)
|
||||
document.body.appendChild(ghost)
|
||||
var st = { ghost: ghost, kind: kind, payload: payload }
|
||||
st.move = function (e) {
|
||||
ghost.style.left = (e.clientX + 14) + 'px'
|
||||
ghost.style.top = (e.clientY + 14) + 'px'
|
||||
ghost.style.left = e.clientX + 'px'
|
||||
ghost.style.top = e.clientY + 'px'
|
||||
}
|
||||
st.down = function (e) {
|
||||
var c = document.querySelector('.iwb-canvas')
|
||||
@@ -1650,7 +1656,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'promptlib',
|
||||
name: '提示词库',
|
||||
version: '1.6.21',
|
||||
version: '1.6.22',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'promptlib', 'nodeTypes', 'canvas', 'canvasWrite'],
|
||||
data: { schemaVersion: 3, maxBytes: 4 * 1024 * 1024 },
|
||||
|
||||
@@ -391,3 +391,5 @@ box-shadow: 0 24px 60px rgba(0,0,0,.32);
|
||||
body.iwb-plp-dragging, body.iwb-plp-dragging *{user-select:none!important;-webkit-user-select:none!important}
|
||||
.iwb-plp-placeghost{border-style:dashed!important;pointer-events:none}
|
||||
.iwb-plp-placehint{font-size:10.5px;color:var(--iwb-plp-accent,#5a4bd0);margin-top:2px}
|
||||
.iwb-plp-placebox{position:fixed;left:-9999px;top:0;z-index:99999;pointer-events:none;border:2px dashed var(--iwb-plp-accent,#6b4dff);border-radius:12px;background:color-mix(in srgb,var(--iwb-plp-accent,#6b4dff) 9%,transparent);display:flex;align-items:center;justify-content:center;box-shadow:0 10px 26px rgba(30,20,80,.10)}
|
||||
.iwb-plp-placebox-t{font-size:12px;color:var(--iwb-plp-accent,#5a3fd0);background:rgba(255,255,255,.82);border-radius:999px;padding:3px 10px}
|
||||
Reference in new issue
Block a user