From 2495c5bde738c8f99ec283bd5369c33f934644b4 Mon Sep 17 00:00:00 2001 From: qiqi Date: Sat, 21 Nov 2026 18:25:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(grouplib):=201.0.4=20=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E6=80=81/=E7=A9=BA=E6=80=81/=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E5=8F=8D=E9=A6=88=EF=BC=9Bpromptlib=201.0.2=20?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grouplib/package.json | 2 +- grouplib/src/index.js | 11 ++++++++--- grouplib/styles.css | 25 +++++++++++++++++++++++++ promptlib/package.json | 2 +- promptlib/src/index.js | 2 +- promptlib/styles.css | 11 +++++++++++ 6 files changed, 47 insertions(+), 6 deletions(-) diff --git a/grouplib/package.json b/grouplib/package.json index 8a2469b..d67523c 100644 --- a/grouplib/package.json +++ b/grouplib/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/grouplib", "private": true, - "version": "1.0.3", + "version": "1.0.4", "description": "节点组:左栏收藏的节点组列表(分组/改名/删除/拖入画布实例化),数据由宿主 grouplib 能力提供", "ibwPlugin": { "id": "grouplib", diff --git a/grouplib/src/index.js b/grouplib/src/index.js index fc43df7..cce47da 100644 --- a/grouplib/src/index.js +++ b/grouplib/src/index.js @@ -335,12 +335,14 @@ items.forEach(function (g) { var isEditing = editing === g.id var card = el('div', { - class: 'iwb-pcard' + (isEditing ? ' iwb-pcard-editing' : '') + (manage && picked[g.id] ? ' iwb-pcard-selected' : ''), + class: 'iwb-glp-card iwb-pcard' + (isEditing ? ' iwb-pcard-editing' : '') + (manage && picked[g.id] ? ' iwb-pcard-selected' : ''), + 'data-manage': manage ? '1' : '0', draggable: isEditing ? 'false' : 'true', title: manage ? '单击选中 · 右上「移动到分组」' : '双击改名 · 拖到画布实例化 · 右键移动到分组', }) card.addEventListener('dragstart', function (e) { if (isEditing) return + try { card.classList.add('iwb-glp-dragging') } catch (err) { /* ignore */ } try { e.stopPropagation() e.dataTransfer.setData('application/x-iwb-group', JSON.stringify(g.id)) @@ -348,6 +350,9 @@ e.dataTransfer.effectAllowed = 'copy' } catch (err) { /* ignore */ } }) + card.addEventListener('dragend', function () { + try { card.classList.remove('iwb-glp-dragging') } catch (err) { /* ignore */ } + }) card.addEventListener('contextmenu', function (e) { if (manage) { e.preventDefault(); picked[g.id] = picked[g.id] ? 0 : 1; render(); return } openMenu(e, g) @@ -413,7 +418,7 @@ : (list.length ? '当前分组下没有节点组(共 ' + list.length + ' 个,切到「全部」查看)' : '宿主返回 0 个收藏节点组。画布编组后点组右上角「收藏」,或用右键菜单「收藏选中节点」。') - scrollBox.appendChild(el('div', { class: 'iwb-hint', text: hint })) + scrollBox.appendChild(el('div', { class: 'iwb-hint iwb-glp-empty', text: hint })) } } @@ -434,7 +439,7 @@ global.IWBPluginHost.register({ id: 'grouplib', name: '节点组', - version: '1.0.3', + version: '1.0.4', apiVersion: 1, capabilities: ['panels', 'grouplib'], data: { schemaVersion: 1, maxBytes: 65536 }, diff --git a/grouplib/styles.css b/grouplib/styles.css index 1f2b7a1..251670e 100644 --- a/grouplib/styles.css +++ b/grouplib/styles.css @@ -15,3 +15,28 @@ flex: 0 0 auto; margin-left: 2px; } + +/* v1.0.4(2026-11-21):卡片交互态 + 空态 + 拖拽反馈。 + 颜色只走宿主 token(--iwb-plugin-* / --iwb-*),不写死。 */ +.iwb-glp-card { transition: background .12s ease, border-color .12s ease; } +.iwb-glp-card .iwb-pname { font-weight: 600; } +/* 删除按钮:平时隐藏,悬停/键盘聚焦才出现,减少视觉噪音 */ +.iwb-glp-card .iwb-pbtns { opacity: 0; transition: opacity .12s ease; } +.iwb-glp-card:hover .iwb-pbtns, +.iwb-glp-card:focus-within .iwb-pbtns { opacity: 1; } +/* 管理模式的选中标记:右上角圆点 */ +.iwb-glp-card[data-manage="1"]::after { + content: ''; position: absolute; right: 8px; top: 8px; width: 12px; height: 12px; + border-radius: 50%; border: 1.5px solid var(--iwb-border2, #b9bfca); background: transparent; +} +.iwb-glp-card[data-manage="1"].iwb-pcard-selected::after { + background: var(--iwb-brand, #6b7280); border-color: var(--iwb-brand, #6b7280); +} +/* 拖拽中:半透明 + 轻微缩放,明确"正在搬运" */ +.iwb-glp-dragging { opacity: .55; } +/* 空态:虚线框 */ +.iwb-glp-empty { + margin: 4px 0; padding: 14px 12px; border-radius: 10px; text-align: center; + border: 1px dashed var(--iwb-border2, #b9bfca); color: var(--iwb-text2, #4d5668); + font-size: 12px; line-height: 1.7; +} diff --git a/promptlib/package.json b/promptlib/package.json index a66bdef..32c016e 100644 --- a/promptlib/package.json +++ b/promptlib/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/promptlib", "private": true, - "version": "1.0.1", + "version": "1.0.2", "description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供", "ibwPlugin": { "id": "promptlib", diff --git a/promptlib/src/index.js b/promptlib/src/index.js index 5580cc8..43172d5 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -573,7 +573,7 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.0.1', + version: '1.0.2', apiVersion: 1, capabilities: ['panels', 'promptlib'], data: { schemaVersion: 1, maxBytes: 65536 }, diff --git a/promptlib/styles.css b/promptlib/styles.css index 4179f16..e29fa43 100644 --- a/promptlib/styles.css +++ b/promptlib/styles.css @@ -14,3 +14,14 @@ flex: 0 0 auto; margin-left: 2px; } + +/* v1.0.2(2026-11-21):卡片化 —— 白卡 + 悬停 + 文本三行截断。 + 颜色一律走宿主 --iwb-plugin-* / --iwb-* token,不在插件里写死。 */ +.iwb-promptlib .iwb-pcard { transition: background .12s ease, border-color .12s ease; } +.iwb-promptlib .iwb-pcard:hover { border-color: var(--iwb-border2, #b9bfca); } +.iwb-promptlib .iwb-pname { font-weight: 600; } +.iwb-promptlib .iwb-ptext { + display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; + overflow: hidden; color: var(--iwb-text2, #4d5668); +} +.iwb-promptlib .iwb-lib-cards { gap: 8px; } \ No newline at end of file