chore(plugins): 同步 album 1.1.1(点放大镜看大图,hover 预览已删)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 46s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 46s
- album 1.1.1:去掉 1.1.0 的节点内 hover 预览层(它盖住放大镜,实测点不到), 只看大图统一走「点放大镜 → 宿主全屏预览」,点图片外空白或 Esc 自动退出。 - 市场/下载站索引与页面同步到 1.1.1。
This commit is contained in:
1 parent
b63e209271
commit
39458969c0
8 files changed
+43
-85
No files matched your search
+16
-54
@@ -149,8 +149,6 @@
|
||||
checkedMissing: false,
|
||||
sig: '',
|
||||
cap: null, // 最近一次容量计算(拖拽排序换算页码要用)
|
||||
lastFull: { key: '', url: '' }, // 原图只保留最近一张(节点内预览用,不做 LRU:多存几张大图就是几十 MB)
|
||||
previewToken: 0,
|
||||
}
|
||||
const bar = el('div', { className: 'iwb-album-bar' })
|
||||
const track = el('span', { className: 'iwb-album-track' }, el('i', null))
|
||||
@@ -191,16 +189,13 @@
|
||||
])
|
||||
const pager = el('div', { className: 'iwb-album-pager' })
|
||||
const onepage = el('div', { className: 'iwb-album-onepage' }, '全部图片一页展示')
|
||||
// 节点内预览层(放大镜 hover 时出现):铺满整个节点框,绝不越界到画布。
|
||||
// pointer-events:none ⇒ 底下的格子仍然能点(点穿 = 切换选中,不会「卡住」在预览里)。
|
||||
const previewImg = el('img', { alt: '', draggable: 'false' })
|
||||
const previewName = el('span', { className: 'iwb-album-preview-name' })
|
||||
const preview = el('div', { className: 'iwb-album-preview' }, [previewImg, previewName])
|
||||
// 节点内 hover 预览层已于 1.1.1 移除(用户实测:鼠标移到放大镜上时预览层盖住图标,反而点不到)。
|
||||
// 现在只看大图走「点击放大镜 → 宿主全屏预览(props.onPreview)」,点图片外或 Esc 自动退出。
|
||||
|
||||
host.textContent = ''
|
||||
const root = el('div', { className: 'iwb-album' }, [bar, tools, hint, grid, empty, pager, onepage, preview])
|
||||
const root = el('div', { className: 'iwb-album' }, [bar, tools, hint, grid, empty, pager, onepage])
|
||||
host.appendChild(root)
|
||||
Object.assign(st, { root, bar, track, count, btnClear, btnAdd, btnDir, btnSettle, segs, grid, empty, pager, onepage, hint, preview, previewImg, previewName })
|
||||
Object.assign(st, { root, bar, track, count, btnClear, btnAdd, btnDir, btnSettle, segs, grid, empty, pager, onepage, hint })
|
||||
|
||||
// 按钮绑定(用闭包里的当前 node/props:每次 sync 会更新 st.node/st.props)
|
||||
btnAdd.addEventListener('pointerdown', (e) => e.stopPropagation())
|
||||
@@ -379,15 +374,13 @@
|
||||
const capNow = st.cap || { capacity: 20 }
|
||||
const pagesNow = Math.max(1, Math.ceil(items.length / capNow.capacity))
|
||||
const pageNow = Math.max(0, Number((st.node.data || {}).page) || 0)
|
||||
hidePreview(st, true)
|
||||
update(st.props, st.node, { items: items, page: Math.min(pageNow, pagesNow - 1) }, true)
|
||||
})
|
||||
btn.appendChild(del)
|
||||
// 放大镜(右下角):hover 在节点框内预览,点一下进宿主全屏预览
|
||||
const zoom = el('span', { className: 'iwb-album-zoom', title: '预览大图(点一下全屏)' }, zoomIcon())
|
||||
// 放大镜(右下角):点击 → 宿主全屏预览。1.1.1 去掉了 hover 预览(会盖住放大镜导致点不到,
|
||||
// 用户实测),只留「点一下看大图」这一条路径:宿主预览点图片外的空白或按 Esc 自动退出。
|
||||
const zoom = el('span', { className: 'iwb-album-zoom', title: '查看大图(点击空白处或按 Esc 关闭)' }, zoomIcon())
|
||||
zoom.addEventListener('pointerdown', (e) => e.stopPropagation())
|
||||
zoom.addEventListener('pointerenter', () => showPreview(ctx, st, it, key))
|
||||
zoom.addEventListener('pointerleave', () => hidePreview(st, false))
|
||||
zoom.addEventListener('click', (e) => { e.stopPropagation(); openFull(ctx, st, it) })
|
||||
btn.appendChild(zoom)
|
||||
btn.addEventListener('pointerdown', (e) => e.stopPropagation())
|
||||
@@ -482,50 +475,21 @@
|
||||
return thumb
|
||||
}
|
||||
|
||||
// ── 节点内预览(放大镜 hover)──────────────────────────────
|
||||
// 用户定的交互:鼠标移到格子右下角放大镜 → 节点框内浮出大图;再点一下 → 宿主全屏预览。
|
||||
// 预览层铺满节点(position:absolute; inset:0),所以「大图」永不出节点框,也不挡画布别处。
|
||||
function hidePreview (st, now) {
|
||||
if (!st || !st.preview) return
|
||||
if (st.hideTimer) { clearTimeout(st.hideTimer); st.hideTimer = null }
|
||||
if (now) { st.preview.classList.remove('on'); st.previewToken++; return }
|
||||
// 140ms 宽限:从放大镜边缘滑出去时不会闪一下就没(也不必让用户精准停在圆点上)
|
||||
st.hideTimer = setTimeout(() => {
|
||||
st.hideTimer = null
|
||||
st.preview.classList.remove('on')
|
||||
st.previewToken++
|
||||
}, 140)
|
||||
}
|
||||
function showPreview (ctx, st, it, key) {
|
||||
if (!st || !st.preview) return
|
||||
if (st.hideTimer) { clearTimeout(st.hideTimer); st.hideTimer = null }
|
||||
const cached = st.thumbs.get(key) || ''
|
||||
if (cached) st.previewImg.src = cached
|
||||
else st.previewImg.removeAttribute('src') // 绝不设 src='':那会向页面 URL 发一次请求
|
||||
st.previewName.textContent = (it && it.name) || ''
|
||||
st.preview.classList.add('on')
|
||||
const token = ++st.previewToken
|
||||
// 原图只留最近一张:节点内预览要看得清(缩略图 256px 拉宽到 600 就糊),但多存几张 4K dataURL
|
||||
// 就是几十 MB 常驻内存。留一张,来回 hover 同一张不重复读盘。
|
||||
if (st.lastFull.key === key && st.lastFull.url) { st.previewImg.src = st.lastFull.url; return }
|
||||
if (!ctx.images || typeof ctx.images.dataUrl !== 'function') return
|
||||
try {
|
||||
Promise.resolve(ctx.images.dataUrl(it && it.src)).then((url) => {
|
||||
if (!url) return
|
||||
st.lastFull = { key: key, url: url }
|
||||
if (token === st.previewToken && st.preview.classList.contains('on')) st.previewImg.src = url
|
||||
}).catch(() => { /* 读盘失败就用缩略图 */ })
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
// 点放大镜 → 宿主全屏预览(props.onPreview 是宿主给的,节点体里拿得到)
|
||||
// ── 看大图:只走宿主全屏预览(1.1.1 定了唯一交互)────────────
|
||||
// 历史:1.1.0 曾做「hover 放大镜 → 节点框内浮大图(pointer-events:none)+ 点击全屏」两套。
|
||||
// 实测否决:hover 一进就把整块节点压暗(预览层 z-index 9),放大镜本身被盖在下面 ⇒
|
||||
// 用户看到的是「滑过去就不能点了」。现在删掉 A,只保留 B:
|
||||
// 点放大镜 → props.onPreview 打开宿主预览层(铺满窗口);
|
||||
// 点图片外的空白 / 按 Esc → 宿主自己 onClose(见 src/ui-canvas-view.js 的 ImagePreview)。
|
||||
// 代价是「看一眼」也要点两下,但少一层状态,点到哪就是哪,不会再互相打架。
|
||||
function openFull (ctx, st, it) {
|
||||
hidePreview(st, true)
|
||||
const props = st.props || {}
|
||||
if (typeof props.onPreview !== 'function') return
|
||||
const fallback = st.thumbs.get(thumbKeyOf(it)) || ''
|
||||
const run = (url) => { try { props.onPreview(url || fallback) } catch (e) { /* ignore */ } }
|
||||
if (!ctx.images || typeof ctx.images.dataUrl !== 'function') { run(fallback); return }
|
||||
try {
|
||||
// 先给缩略图/原图都行,宿主预览层会再按需解析;读盘失败退回缩略图
|
||||
Promise.resolve(ctx.images.dataUrl(it && it.src)).then((u) => run(u)).catch(() => run(''))
|
||||
} catch (e) { run(fallback) }
|
||||
}
|
||||
@@ -535,9 +499,7 @@
|
||||
const items = itemsOf(st.node)
|
||||
if (!items.length) return
|
||||
st.thumbs.clear(); st.pending.clear(); st.missing.clear()
|
||||
st.lastFull = { key: '', url: '' }
|
||||
st.checkedMissing = false // 清空后再导入要重新做一次失联检测
|
||||
hidePreview(st, true)
|
||||
update(st.props, st.node, { items: [], page: 0, pageRange: null }, true)
|
||||
st.sig = ''
|
||||
sync(ctx, st, st.node, st.props)
|
||||
@@ -702,7 +664,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'album',
|
||||
name: '相册',
|
||||
version: '1.1.0',
|
||||
version: '1.1.1',
|
||||
apiVersion: 1,
|
||||
capabilities: ['nodeTypes', 'images', 'files'],
|
||||
settings: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "album",
|
||||
"name": "相册",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -14,7 +14,7 @@
|
||||
"出图"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "7d98527ad1854e72afdea2f36a067402f4a0d7337f2160c5a3bd86966663a735",
|
||||
"styles.css": "7847e742ea27688743b97cb289d373deb44c2cd800f4c1f60f2b5df929b70283"
|
||||
"main.js": "7504415606e494d7f9c3dafc67aff032fb7f5a18b7851ab897fcf303567b04c0",
|
||||
"styles.css": "02ffd5a87281c955aa10f323b0f36487dc8e2a8dd394bc500273cb4e6f5db509"
|
||||
}
|
||||
}
|
||||
@@ -44,17 +44,13 @@
|
||||
.iwb-album-del { position: absolute; right: var(--iwb-space-2); top: var(--iwb-space-2); width: 15px; height: 15px; border-radius: 50%; background: var(--iwb-panel); color: var(--iwb-node-text2); font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center; opacity: 0; cursor: pointer; }
|
||||
.iwb-album-cell:hover .iwb-album-del { opacity: 1; }
|
||||
/* 放大镜:右下角,hover 才出现(静息态不抢视觉,和 × 一致)。
|
||||
18px 圆 / 12px 图标:10px 时镜片只有 5px,缩到小截图里就成一团白点了。 */
|
||||
.iwb-album-zoom { position: absolute; right: var(--iwb-space-2); bottom: var(--iwb-space-2); width: 17px; height: 17px; border-radius: 50%; background: var(--iwb-panel); color: var(--iwb-node-text2); display: flex; align-items: center; justify-content: center; opacity: 0; cursor: zoom-in; transition: opacity .12s; }
|
||||
.iwb-album-cell:hover .iwb-album-zoom { opacity: 1; }
|
||||
17px 圆 / 12px 图标:再小镜片就缩成一团白点。
|
||||
z-index 高于图与角标:1.1.0 时它被节点内预览层(z-index 9)盖住 ⇒ 用户反馈「滑过去就点不到」,
|
||||
那层已在 1.1.1 删除;这里仍显式抬一层,避免以后再加浮层时重犯。 */
|
||||
.iwb-album-zoom { position: absolute; right: var(--iwb-space-2); bottom: var(--iwb-space-2); z-index: 3; width: 17px; height: 17px; border-radius: 50%; background: var(--iwb-panel); color: var(--iwb-node-text2); display: flex; align-items: center; justify-content: center; opacity: 0; cursor: zoom-in; transition: opacity .12s; }
|
||||
.iwb-album-cell:hover .iwb-album-zoom, .iwb-album-cell:focus-within .iwb-album-zoom { opacity: 1; }
|
||||
.iwb-album-zoom:hover { color: var(--iwb-brand); }
|
||||
.iwb-album-zoom svg { width: 12px; height: 12px; display: block; }
|
||||
/* 节点内预览层:铺满节点框(用户要求「大图显示范围控制在节点框内」),绝不溢出到画布。
|
||||
点放大镜后出现的浮层 —— pointer-events:none 所以不会挡住下面格子的点击(点穿到底层格子 = 切换选中,符合预期)。*/
|
||||
.iwb-album-preview { position: absolute; inset: 0; z-index: 9; display: none; align-items: center; justify-content: center; background: rgba(12,16,22,.82); pointer-events: none; }
|
||||
.iwb-album-preview.on { display: flex; }
|
||||
.iwb-album-preview img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
|
||||
.iwb-album-preview-name { position: absolute; left: var(--iwb-space-8); bottom: var(--iwb-space-6); right: var(--iwb-space-8); color: #fff; font-size: var(--iwb-font-2xs); opacity: .82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-album-add { border: 1px dashed var(--iwb-border); background: transparent; color: var(--iwb-node-text2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--iwb-space-2); font-size: var(--iwb-font-2xs); border-radius: var(--iwb-radius-chip); cursor: pointer; }
|
||||
.iwb-album-add b { font-size: 15px; line-height: 1; font-weight: 600; }
|
||||
.iwb-album-pager { border-top: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent); height: 26px; }
|
||||
|
||||
+3
-3
@@ -4,10 +4,10 @@
|
||||
"dir": "album",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"files": {
|
||||
"main.js": "7d98527ad1854e72afdea2f36a067402f4a0d7337f2160c5a3bd86966663a735",
|
||||
"styles.css": "7847e742ea27688743b97cb289d373deb44c2cd800f4c1f60f2b5df929b70283"
|
||||
"main.js": "7504415606e494d7f9c3dafc67aff032fb7f5a18b7851ab897fcf303567b04c0",
|
||||
"styles.css": "02ffd5a87281c955aa10f323b0f36487dc8e2a8dd394bc500273cb4e6f5db509"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<title>插件开发规范 · Image Workbench</title>
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/assets/logo.png">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.69-mwvh2r2v">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.69-mwvhh3pz">
|
||||
<style>
|
||||
.devdoc{max-width:860px;margin:0 auto;padding:40px 0 72px;color:var(--ink,#1b1f24);font-size:15px;line-height:1.75}
|
||||
.devdoc h1{font-size:38px;line-height:1.2;margin:8px 0 18px}
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/assets/logo.png">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.69-mwvh2r2v">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.69-mwvhh3pz">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><img class="logo" src="/assets/logo.png" alt="" width="26" height="26">Image Workbench</a>
|
||||
@@ -22,7 +22,7 @@
|
||||
</div></nav>
|
||||
<main>
|
||||
<section class="hero hero-art">
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.69-mwvh2r2v" alt=""></div>
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.69-mwvhh3pz" alt=""></div>
|
||||
<div class="hero-veil"></div>
|
||||
<div class="wrap">
|
||||
<span class="kicker">v3.26.69 · macOS / Windows · 数据在本地</span>
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="grid c3">
|
||||
<div class="pcard" data-name="相册 album 一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点 图片 批量 出图" data-tags="图片,批量,出图">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.0 · 官方</div></div></div>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.1 · 官方</div></div></div>
|
||||
<div class="desc">一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点</div>
|
||||
<div class="tags"><span class="tag">图片</span><span class="tag">批量</span><span class="tag">出图</span></div>
|
||||
</div>
|
||||
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"updatedAt": "2026-11-25T01:51:45.826Z",
|
||||
"updatedAt": "2026-11-25T02:06:40.846Z",
|
||||
"plugins": [
|
||||
{
|
||||
"id": "album",
|
||||
@@ -14,26 +14,26 @@
|
||||
"批量",
|
||||
"出图"
|
||||
],
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"apiVersion": 1,
|
||||
"bundle": "plugins/album-1.1.0.zip",
|
||||
"bundleSize": 50986,
|
||||
"bundleSha256": "bb2c0b313295e64ea5b06c8e22bf89c83a7fe64b47f3b3f7546785d454def3ac",
|
||||
"bundle": "plugins/album-1.1.1.zip",
|
||||
"bundleSize": 48524,
|
||||
"bundleSha256": "3989b96247c53d37f77d0a34a220a567c6ffb37d953f6877b08b7929dc872bbd",
|
||||
"files": [
|
||||
{
|
||||
"path": "manifest.json",
|
||||
"sha256": "78cdc394717d2b0231a14b534e45de00e26da0dc1d5a98ca926e67419364d159",
|
||||
"sha256": "edd373ce70b2f4a92ea9a7cfe154bae1d7849996ad44ef4c1b19cee1264f8189",
|
||||
"size": 593
|
||||
},
|
||||
{
|
||||
"path": "main.js",
|
||||
"sha256": "7d98527ad1854e72afdea2f36a067402f4a0d7337f2160c5a3bd86966663a735",
|
||||
"size": 40937
|
||||
"sha256": "7504415606e494d7f9c3dafc67aff032fb7f5a18b7851ab897fcf303567b04c0",
|
||||
"size": 39113
|
||||
},
|
||||
{
|
||||
"path": "styles.css",
|
||||
"sha256": "7847e742ea27688743b97cb289d373deb44c2cd800f4c1f60f2b5df929b70283",
|
||||
"size": 9146
|
||||
"sha256": "02ffd5a87281c955aa10f323b0f36487dc8e2a8dd394bc500273cb4e6f5db509",
|
||||
"size": 8508
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<title>插件市场 · Image Workbench</title>
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/assets/logo.png">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.69-mwvh2r2v">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.69-mwvhh3pz">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><img class="logo" src="/assets/logo.png" alt="" width="26" height="26">Image Workbench</a>
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="grid c3" id="list">
|
||||
<div class="pcard" data-name="相册 album 一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点 图片 批量 出图" data-tags="图片,批量,出图">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.0 · 官方</div></div></div>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.1 · 官方</div></div></div>
|
||||
<div class="desc">一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点</div>
|
||||
<div class="tags"><span class="tag">图片</span><span class="tag">批量</span><span class="tag">出图</span></div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user