diff --git a/gallery/package.json b/gallery/package.json index 42e0346..3395d4a 100644 --- a/gallery/package.json +++ b/gallery/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/gallery", "private": true, - "version": "1.9.11", + "version": "1.9.12", "description": "图库:右栏图片墙(筛选/多选/预览/插入画布/下载/删除),数据由宿主 gallery 能力提供", "ibwPlugin": { "id": "gallery", diff --git a/gallery/src/index.js b/gallery/src/index.js index 3fe3840..8248b88 100644 --- a/gallery/src/index.js +++ b/gallery/src/index.js @@ -76,6 +76,28 @@ svg.appendChild(p) return p } + // 2026-12-03:卡片下载图标与输出面板同款(同一组 path / 线宽 / 14px)。 + // 之前是文本 '↓',字形随字体渲染,和宿主按钮对不齐。 + function dlGlyph () { + var svg = document.createElementNS(SVG_NS, 'svg') + svg.setAttribute('viewBox', '0 0 24 24') + svg.setAttribute('width', '14') + svg.setAttribute('height', '14') + svg.setAttribute('fill', 'none') + svg.setAttribute('stroke', 'currentColor') + svg.setAttribute('stroke-width', '2') + svg.setAttribute('stroke-linecap', 'round') + svg.setAttribute('stroke-linejoin', 'round') + svg.setAttribute('aria-hidden', 'true') + svgPath(svg, 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4') + var pl = document.createElementNS(SVG_NS, 'polyline') + pl.setAttribute('points', '7 10 12 15 17 10') + svg.appendChild(pl) + var ln = document.createElementNS(SVG_NS, 'line') + ln.setAttribute('x1', '12'); ln.setAttribute('x2', '12'); ln.setAttribute('y1', '15'); ln.setAttribute('y2', '3') + svg.appendChild(ln) + return svg + } function sel (options, value) { var s = el('select', { class: 'iwb-input iwb-select-compact' }) for (var i = 0; i < options.length; i++) { @@ -580,7 +602,7 @@ } // 2026-12-02(用户裁定):卡片上的「下载」胶囊改成右下角圆形图标 —— 矮图不再被横条压住中心; // 只留图标不加文案(title/aria-label 兜底)。插入仍走顶部工具栏与右键菜单。 - var dlBtn = el('button', { class: 'iwb-gal-dl', title: '下载到本地', 'aria-label': '下载', text: '↓' }) + var dlBtn = el('button', { class: 'iwb-gal-dl', title: '下载到本地', 'aria-label': '下载' }, dlGlyph()) dlBtn.addEventListener('click', function (e) { e.stopPropagation(); doDownload([it.name]) }) acts.appendChild(dlBtn) // 不要再改 class:定位样式挂在 .iwb-history-actions 上,改名会让按钮掉出卡片 @@ -853,7 +875,7 @@ global.IWBPluginHost.register({ id: 'gallery', name: '图库', - version: '1.9.11', + version: '1.9.12', apiVersion: 1, capabilities: ['panels', 'gallery'], data: { schemaVersion: 1, maxBytes: 65536 }, diff --git a/gallery/styles.css b/gallery/styles.css index 6f8f493..b21cac0 100644 --- a/gallery/styles.css +++ b/gallery/styles.css @@ -95,16 +95,17 @@ } .iwb-history-embedded .iwb-history-item:hover .iwb-history-actions, .iwb-history-embedded .iwb-history-item:focus-within .iwb-history-actions { opacity: 1; pointer-events: auto; } +/* 2026-12-03:与输出面板的圆钮完全对齐(26px / 无阴影 / SVG 14px / hover 只变底色)。 */ .iwb-gal-dl { - width: var(--iwb-dl-size, 28px); height: var(--iwb-dl-size, 28px); + width: var(--iwb-dl-size, 26px); height: var(--iwb-dl-size, 26px); border-radius: var(--iwb-dl-radius, 999px); border: 1px solid var(--iwb-border2); background: var(--iwb-panel); color: var(--iwb-text); display: grid; place-items: center; padding: 0; cursor: pointer; font-size: var(--iwb-font-xs); line-height: 1; - box-shadow: var(--iwb-elevation-1, 0 1px 2px rgba(0,0,0,.18)); } -.iwb-gal-dl:hover { background: var(--iwb-hover); color: var(--iwb-brand); } +.iwb-gal-dl svg { width: 14px; height: 14px; } +.iwb-gal-dl:hover { background: var(--iwb-hover); color: var(--iwb-text); } @media (prefers-reduced-motion: reduce) { .iwb-history-embedded .iwb-history-item img { transition: none; } .iwb-history-embedded .iwb-history-item:hover img { transform: none; }