diff --git a/promptlib/package.json b/promptlib/package.json index 65e3ffa..9a18c41 100644 --- a/promptlib/package.json +++ b/promptlib/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/promptlib", "private": true, - "version": "1.4.0", + "version": "1.4.1", "description": "提示词库:右栏提示词列表(搜索/分组/收藏/新建编辑/插入画布/复制/删除),数据由宿主 promptlib 能力提供", "ibwPlugin": { "id": "promptlib", diff --git a/promptlib/src/index.js b/promptlib/src/index.js index b297416..cbca6f8 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -667,7 +667,8 @@ items.forEach(function (p) { var starred = (p.group || '') === '收藏' var coverUrl = coverOf(p) - var card = el('div', { class: 'iwb-plp-card' + (p.cover ? ' has-cover' : ' no-cover'), draggable: 'true', title: '单击查看详情 · 拖到画布插入 · 右键移动到分组' }) + var card = el('div', { class: 'iwb-plp-card' + (p.cover ? ' has-cover' : ' no-cover'), draggable: 'true', tabindex: '0', role: 'button', title: '单击查看详情 · 拖到画布插入 · 右键移动到分组' }) + card.addEventListener('keydown', function (e) { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openDetailModal(p) } }) 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' })) card.appendChild(el('div', { class: 'iwb-plp-t', text: p.name || '未命名' })) @@ -715,7 +716,7 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.4.0', + version: '1.4.1', apiVersion: 1, capabilities: ['panels', 'promptlib'], data: { schemaVersion: 1, maxBytes: 65536 }, diff --git a/promptlib/styles.css b/promptlib/styles.css index 3af7c67..82bacbb 100644 --- a/promptlib/styles.css +++ b/promptlib/styles.css @@ -131,3 +131,9 @@ /* v1.3.5:无封面的提示词也给一个方形占位(否则瀑布流里会塌成一条线) */ .iwb-promptlib .iwb-plp-card.no-cover { aspect-ratio: 1 / 1; } .iwb-promptlib .iwb-plp-card.no-cover .iwb-plp-t { max-height: 60%; } + +/* v1.4.1:键盘可达 —— 卡片可 Tab 聚焦,Enter/Space 打开详情 */ +.iwb-promptlib .iwb-plp-card:focus-visible { + outline: none; + box-shadow: 0 0 0 2px var(--iwb-brand, #6b7280); +}