From 64db27155a3ff8578f9886caa415f45a99a5674c Mon Sep 17 00:00:00 2001 From: qiqi Date: Sun, 22 Nov 2026 22:31:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(promptlib):=201.6.22=20=E6=94=BE=E7=BD=AE?= =?UTF-8?q?=E6=8C=87=E7=A4=BA=E6=94=B9=E4=B8=BA=E5=8D=8A=E9=80=8F=E6=98=8E?= =?UTF-8?q?=E7=9F=A9=E5=BD=A2=E6=A1=86=EF=BC=88=E5=B7=A6=E4=B8=8A=E8=A7=92?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E8=90=BD=E7=82=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- promptlib/package.json | 2 +- promptlib/src/index.js | 20 +++++++++++++------- promptlib/styles.css | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/promptlib/package.json b/promptlib/package.json index 9d1c688..4789b1a 100644 --- a/promptlib/package.json +++ b/promptlib/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/promptlib", "private": true, - "version": "1.6.21", + "version": "1.6.22", "description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供", "ibwPlugin": { "id": "promptlib", diff --git a/promptlib/src/index.js b/promptlib/src/index.js index da29964..afcee66 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -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 }, diff --git a/promptlib/styles.css b/promptlib/styles.css index d47b280..d8f1c7a 100644 --- a/promptlib/styles.css +++ b/promptlib/styles.css @@ -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}