diff --git a/plugins/gallery/main.js b/plugins/gallery/main.js index 84980b4..c75ae50 100644 --- a/plugins/gallery/main.js +++ b/plugins/gallery/main.js @@ -47,16 +47,20 @@ function clear (node) { while (node.firstChild) node.removeChild(node.firstChild) } // v1.4.1:底栏按钮改用图标(窄栏里「刷新/设置」会被挤成竖排两行) + // v1.7.1:14px 在底栏里太小(齿轮细节几乎看不清)。按宿主 design-tokens.md §3.8 + // 图标尺寸闭集 14/16/18 取最大档 --iwb-icon-lg(18),描边按规范 1.6; + // 命中区 ≥28×28 由 styles.css 的按钮尺寸兜住(图形放大不等于点击区变大)。 var SVG_NS = 'http://www.w3.org/2000/svg' + var ICON_PX = 18 function iconBtn (label, build, title) { var b = el('button', { class: 'iwb-btn iwb-btn-sm iwb-gal-icobtn', title: title || label, 'aria-label': label }) var svg = document.createElementNS(SVG_NS, 'svg') svg.setAttribute('viewBox', '0 0 16 16') - svg.setAttribute('width', '14') - svg.setAttribute('height', '14') + svg.setAttribute('width', String(ICON_PX)) + svg.setAttribute('height', String(ICON_PX)) svg.setAttribute('fill', 'none') svg.setAttribute('stroke', 'currentColor') - svg.setAttribute('stroke-width', '1.5') + svg.setAttribute('stroke-width', '1.6') svg.setAttribute('stroke-linecap', 'round') svg.setAttribute('stroke-linejoin', 'round') svg.setAttribute('aria-hidden', 'true') @@ -590,7 +594,7 @@ global.IWBPluginHost.register({ id: 'gallery', name: '图库', - version: '1.7.0', + version: '1.7.1', apiVersion: 1, capabilities: ['panels', 'gallery'], data: { schemaVersion: 1, maxBytes: 65536 }, diff --git a/plugins/gallery/manifest.json b/plugins/gallery/manifest.json index e06c681..864f633 100644 --- a/plugins/gallery/manifest.json +++ b/plugins/gallery/manifest.json @@ -1,7 +1,7 @@ { "id": "gallery", "name": "图库", - "version": "1.7.0", + "version": "1.7.1", "apiVersion": 1, "main": "main.js", "style": "styles.css", @@ -13,7 +13,7 @@ "图库" ], "files": { - "main.js": "77b8e95c06c6811fdee3a832195e2b76bc6197d8bfdf9df0a47a52b6b4dfb38f", - "styles.css": "35ae17de8b0f3bddab9cbef6270cd8bbf5153c9ecf6ed2b4f06216f6fef45b8b" + "main.js": "c4f27a759742720804280a009a802d6955b742b5cc4b81cb29e3c533830e867c", + "styles.css": "1dfd72b60bcaea9c43e103ba9758113efec02b6241d08fa0ab9c75d7848afb55" } } diff --git a/plugins/gallery/styles.css b/plugins/gallery/styles.css index cefd2a7..549a89b 100644 --- a/plugins/gallery/styles.css +++ b/plugins/gallery/styles.css @@ -24,25 +24,36 @@ .iwb-gal-count { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; } .iwb-gal-sel { font-size: 11px; color: var(--iwb-brand); white-space: nowrap; } .iwb-gal-status { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: none; } -.iwb-gal-tools { display: flex; align-items: center; gap: 0; flex: 0 0 auto; margin-left: auto; } +/* v1.7.1:图标放大后三个按钮不再紧贴(4px 是 spacing 闭集值) */ +.iwb-gal-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-left: auto; } -/* ---- 图标按钮:无外框、无底色,只在悬停时给一点反馈 ---- */ +/* ---- 图标按钮:无外框、无底色,只在悬停时给一点反馈 ---- + v1.7.1:命中区 20×20 → 28×28(design-tokens.md §3.8「≥28×28」), + 图形 14 → var(--iwb-icon-lg) 18;CSS 尺寸覆盖 SVG 的 presentation attribute, + 属性里的 18 只作宿主 token 缺失时的兜底。 */ .iwb-gal-foot .iwb-gal-icobtn, .iwb-gal-foot .iwb-gal-icobtn:hover, .iwb-gal-foot .iwb-gal-icobtn:active { - width: 20px; height: 20px; min-width: 20px; padding: 0; box-sizing: border-box; + width: 28px; height: 28px; min-width: 28px; padding: 0; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 0; box-shadow: none; background: transparent; border-radius: 6px; color: var(--iwb-text2); line-height: 1; transform: none; } -.iwb-gal-foot .iwb-gal-icobtn svg { display: block; pointer-events: none; } +.iwb-gal-foot .iwb-gal-icobtn svg { + display: block; pointer-events: none; + width: var(--iwb-icon-lg, 18px); height: var(--iwb-icon-lg, 18px); +} .iwb-gal-foot .iwb-gal-icobtn:hover { background: var(--iwb-layer2); color: var(--iwb-text); } .iwb-gal-foot .iwb-gal-icobtn:focus-visible { outline: 2px solid color-mix(in srgb, var(--iwb-brand) 60%, transparent); outline-offset: 1px; } .iwb-gal-setbtn-on { color: var(--iwb-brand); background: var(--iwb-layer2); } -/* ---- 设置浮层(三个下拉不占前台) ---- */ +/* ---- 设置浮层(三个下拉不占前台) ---- + bottom 随底栏高度走:底栏 = padding-top 6 + border 1 + 按钮 28,再加容器底 4 → 39, + 取 40 让浮层正好停在底栏上沿之外;仍用 34 会被放大后的图标压住。 + z-index 按 §3.6 层级表走 --iwb-z-ctx-menu(面板内菜单浮层):原先裸写 30, + 这行一改动就被 token-lint 当成新增裸值拦下;91 仍低于 curtain(100)/command(120)。 */ .iwb-gal-settings { - position: absolute; right: 8px; bottom: 34px; z-index: 30; width: 176px; max-width: calc(100% - 16px); + position: absolute; right: 8px; bottom: 40px; z-index: var(--iwb-z-ctx-menu, 91); width: 176px; max-width: calc(100% - 16px); display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); diff --git a/plugins/index.json b/plugins/index.json index e9f5a9a..67f6bf1 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -33,10 +33,10 @@ "dir": "gallery", "main": "main.js", "style": "styles.css", - "version": "1.7.0", + "version": "1.7.1", "files": { - "main.js": "77b8e95c06c6811fdee3a832195e2b76bc6197d8bfdf9df0a47a52b6b4dfb38f", - "styles.css": "35ae17de8b0f3bddab9cbef6270cd8bbf5153c9ecf6ed2b4f06216f6fef45b8b" + "main.js": "c4f27a759742720804280a009a802d6955b742b5cc4b81cb29e3c533830e867c", + "styles.css": "1dfd72b60bcaea9c43e103ba9758113efec02b6241d08fa0ab9c75d7848afb55" } }, { diff --git a/site/dev/index.html b/site/dev/index.html index 46e0c83..469bbfc 100644 --- a/site/dev/index.html +++ b/site/dev/index.html @@ -3,7 +3,7 @@ 插件开发规范 · Image Workbench - +