Compare commits

...
3 Commits
Author SHA1 Message Date
qiqi 85b1d057f4 docs(site): v3.26.68
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 38s
2026-11-25 08:38:15 +08:00
qiqi bebf737724 docs: 锚点对齐 v3.26.68+a62f2ea(publish 自动) 2026-11-25 08:37:39 +08:00
qiqi a62f2ea026 release: v3.26.68 相册体验修复(拼图图标入口/高度稳定/文件夹导入/选中态) 2026-11-25 08:36:26 +08:00
23 changed files with 193 additions and 77 deletions

No files matched your search

+12
View File
@@ -16,6 +16,18 @@
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
## v3.26.68(2026-11-26)相册插件体验修复(图标入口 / 高度稳定 / 文件夹导入 / 选中态)
**宿主**
- 底栏「插件节点」入口改为**拼图图标按钮 + 弹出列表**(此前是文字下拉,用户要求只留图标)
- 插件节点图标:新增 `puzzle` 图标,插件变体可声明 `icon` 使用
**插件 album v1.0.3**
- **插入后不再慢慢变矮**:高度只取「显式 node.h / 变体默认 470」,不再用 measuredH 回写(否则内容变矮→卡片变矮→越量越矮)
- **文件夹导入修好**:之前把 pick 返回的目录路径直接按图片后缀过滤 ⇒ 全被丢掉(点了没反应);现按目录展开图片(递归 1 层、上限 500 张),新增宿主能力 `ctx.images.listImages`
- **选中态刷新修好**:宫格重建签名加入 `on` 状态,点选/取消立刻可见(此前只更新计数、格子样式不动)
- 样式修正:`--iwb-line`/`--iwb-line-weak` 并不存在 ⇒ 边框改用 `--iwb-border`(之前边框实际是无效声明)
## v3.26.67(2026-11-26)插件节点入口:底栏「插件节点」下拉
> 状态:macOS 双架构待发;Windows 待构建
+1 -1
View File
@@ -102,7 +102,7 @@ IWB_WRITE_BOUNDARY_SNAPSHOT=1 node tests/architecture-boundary-guard-test.js #
| 守卫 | 位置 | 现在的上限 |
|---|---|---|
| `app.js` 总行数 | `tests/source-text-ratchet-test.js` `MAX_APP_JS_LINES` | **9,171**(另守「占总源码 ≤ 40%」,见 `MAX_APP_JS_SHARE`) |
| `app.js` 总行数 | `tests/source-text-ratchet-test.js` `MAX_APP_JS_LINES` | **9,173**(另守「占总源码 ≤ 40%」,见 `MAX_APP_JS_SHARE`) |
| `Workbench()` 行数 | 同上 `MAX_WORKBENCH_LINES` | **3,046** |
| 单组件行数(不含 Workbench)| 同上 `MAX_APP_COMPONENT_LINES` | **423** |
+2
View File
@@ -3453,6 +3453,8 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
// SVG 线性图标库(lucide 风格,零依赖内联)
const ICONS = {
// 插件节点通用图标(2026-11-26):底栏「插件节点」入口与插件节点标题共用拼图,避免用文字占位
puzzle: '<path d="M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z"/>',
cut: '<circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M14.8 14.8 20 20"/>',
prompt: '<path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/>',
ref: '<path d="M16 5h6"/><path d="M19 2v6"/><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"/>',
+2 -2
View File
@@ -1,7 +1,7 @@
# 现状架构与性能事实基线(桌面版)
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = ca96707`(线上 `v3.26.67+ca96707` —— 2026-11-24 **图库:出图即入图库 + 插入落本地副本(能标注)**:每张生成完成即归档并通知插件(此前只在整轮结束写一次 ⇒ 生成中图库一直空)、插入取源改本地字节优先并引用化(抓不到才留原链接 + 提示)、`getNodeImage` 补 `data.localRef` 候选(远程缓存命中却仍判「不支持标注」的直接成因)、批量插入改 4 列栅格(旧实现同批全叠一处),逻辑落 `src/gallery-sync.js`,app.js 只装配;上一条 `v3.26.60+cf0e9a0` —— **浮层字号上调一档**:「模型设置」「图像设置」选择项 11→13px、高 22→28、左右内距 6→10、间距 4→6、标题 12→14、面板 328→360,改动全落在 `.iwb-pop` 的 6 个 token(两面板共用一套);上一条 `v3.26.59+e966b34` —— 备份新增 `plugin-files/` 通道,提示词封面换机不再丢;再上一条 2026-11-23 **节点正文文本区修复**:提示词/文本节点正文透明继承卡片底色(白卡片消失)、编辑态三层框(控件 border / 聚焦光晕 / D8 焦点环)全去掉,规范补表面角色三分法与 `node-scope-test` 第 5 条守卫,8 张基线重录;上一条 `v3.26.51+21554b0` —— **M6 延展验证**:插件面板两段六次叠加样式合并重写、133 行新增零裸值;补 `--iwb-font-base`(14px) 第 8 档与亮色状态色调深(对浅页面 2.13 → ≥4.6),对比度守卫 114→138 对;新增 ⑦⑧ 组件夹具基线共 16 张;`batch-export` 1.2.2 状态色走宿主 token、去掉纯蓝主按钮;棘轮基线首次下调。M1–M6 全部完成;上一条 `v3.26.50+cab473c` —— **M5 闸门**:新增 `scripts/token-lint.js`(只查 diff 新增行,CSS 与 JS 内联样式两套判据、四类白名单)+ `tests/design-token-ratchet-test.js`(13 项计数只降不升)+ `tests/theme-contrast-test.js`(亮/暗 × 文字 × 表面 114 对),三条各做一次打红验证后接进 `verify:ci`;顺手把首启动「选择资料目录」弹窗 token 化(全仓最后一个完全未 token 化的界面);上一条 `v3.26.49+1743453` —— **M4-B6 收尾**:`style.css` 剩余 16 处半像素字号全清零(守卫收紧为全文件断言)、`--iwb-control-h` 裁定不扩到全局控件(并排表单 vs 成组紧凑控件);插件主题契约重写,`ALLOW_FILES` 文件级豁免 **6 → 0** —— 改为「私有皮肤 manifest 自声明 `skin` + chroma 强调色判据 + 内容色行内标记」,声明私有皮肤的插件不得引用宿主颜色 token;同步 4 个插件版本,插件侧中性色写死归零;视觉基线 8 张因字号栅格化变化更新,A/B 回退确认非环境噪声;上一条 `v3.26.48+cb9cb9c` —— **M4-B5 节点**:节点卡内部表面统一 `--iwb-field` —— 端口底色从 `#161616`(暗色对卡片差 39 级,一颗黑洞)改 `#494949`(差 12 级),同病灶另 6 处(ref-img/ref-single/upload-link/refmini-empty/task-result-img/node-head:hover)一并改;浮条与任务卡 hover 改 `color-mix(text 10%)`(原来 panel 与 layer2 深色同色,hover 无反馈);字号 12/15/11/13 全归档位、圆角 8/6/5/14 归并、间距 52 处等值 + 13 处 1px 级微调;删 6 个死类名;新增 `tests/node-scope-test.js` 钉「节点内禁用面板表面色」;上一条 `v3.26.47+f5c8174` —— **M4-B4 设置/外观**:新增 `--iwb-control-h`(30px) 修「同行输入框 33px / 按钮 24px」的 9px 落差;设置页正文 14→13、标题 16→15,范围内半像素字号清零;删 21 条死规则(setcell/setgrid/set-row/appear-val 等);新增 `tests/settings-scope-test.js` 钉「控件等高 / 死类名不复现 / 引用的 token 必须存在」;上一条 `v3.26.46+9f29996` —— 2026-11-23 **M4-B3 首页/库**:删 30 条零生产者规则(25 个类名在产物里 0 次)+ 4 条被 specificity 覆盖的死声明,`style.css` 2391→2339 行;首页/库 106 条规则换 token,间距写死 91→5(只剩版心与导航让位的布局值)、字号写死清零,新增 `--iwb-font-display:24px` 第 7 档;验收改为「计算样式逐元素 diff + 12 张基线只首页 2 张变化」;上一条 `v3.26.45+968ff46` —— **M4-B2 浮层层级表 + 阴影四档**:14 档 `--iwb-z-*`(裸 z-index 取值种类 42→31)、`--iwb-elevation-1..4`(浮层 8 种阴影写法→4 档)、`.iwb-pop` 圆角 18→`radius-popover(14)`;修「弹窗里点保存看不到提示」—— 根因不是层级数字而是 `.iwb-overlay` 本身就是堆叠上下文,toast 改为 portal 到 `body`;新增 `tests/overlay-layer-test.js` 钉 9 条顺序约束;上一条 `v3.26.44+846a59b` —— **设计 token 体系重建**:D1–D9 色彩模型改为真正的深色(#121Line truncated
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = a62f2ea`(线上 `v3.26.68+a62f2ea` —— 2026-11-24 **图库:出图即入图库 + 插入落本地副本(能标注)**:每张生成完成即归档并通知插件(此前只在整轮结束写一次 ⇒ 生成中图库一直空)、插入取源改本地字节优先并引用化(抓不到才留原链接 + 提示)、`getNodeImage` 补 `data.localRef` 候选(远程缓存命中却仍判「不支持标注」的直接成因)、批量插入改 4 列栅格(旧实现同批全叠一处),逻辑落 `src/gallery-sync.js`,app.js 只装配;上一条 `v3.26.60+cf0e9a0` —— **浮层字号上调一档**:「模型设置」「图像设置」选择项 11→13px、高 22→28、左右内距 6→10、间距 4→6、标题 12→14、面板 328→360,改动全落在 `.iwb-pop` 的 6 个 token(两面板共用一套);上一条 `v3.26.59+e966b34` —— 备份新增 `plugin-files/` 通道,提示词封面换机不再丢;再上一条 2026-11-23 **节点正文文本区修复**:提示词/文本节点正文透明继承卡片底色(白卡片消失)、编辑态三层框(控件 border / 聚焦光晕 / D8 焦点环)全去掉,规范补表面角色三分法与 `node-scope-test` 第 5 条守卫,8 张基线重录;上一条 `v3.26.51+21554b0` —— **M6 延展验证**:插件面板两段六次叠加样式合并重写、133 行新增零裸值;补 `--iwb-font-base`(14px) 第 8 档与亮色状态色调深(对浅页面 2.13 → ≥4.6),对比度守卫 114→138 对;新增 ⑦⑧ 组件夹具基线共 16 张;`batch-export` 1.2.2 状态色走宿主 token、去掉纯蓝主按钮;棘轮基线首次下调。M1–M6 全部完成;上一条 `v3.26.50+cab473c` —— **M5 闸门**:新增 `scripts/token-lint.js`(只查 diff 新增行,CSS 与 JS 内联样式两套判据、四类白名单)+ `tests/design-token-ratchet-test.js`(13 项计数只降不升)+ `tests/theme-contrast-test.js`(亮/暗 × 文字 × 表面 114 对),三条各做一次打红验证后接进 `verify:ci`;顺手把首启动「选择资料目录」弹窗 token 化(全仓最后一个完全未 token 化的界面);上一条 `v3.26.49+1743453` —— **M4-B6 收尾**:`style.css` 剩余 16 处半像素字号全清零(守卫收紧为全文件断言)、`--iwb-control-h` 裁定不扩到全局控件(并排表单 vs 成组紧凑控件);插件主题契约重写,`ALLOW_FILES` 文件级豁免 **6 → 0** —— 改为「私有皮肤 manifest 自声明 `skin` + chroma 强调色判据 + 内容色行内标记」,声明私有皮肤的插件不得引用宿主颜色 token;同步 4 个插件版本,插件侧中性色写死归零;视觉基线 8 张因字号栅格化变化更新,A/B 回退确认非环境噪声;上一条 `v3.26.48+cb9cb9c` —— **M4-B5 节点**:节点卡内部表面统一 `--iwb-field` —— 端口底色从 `#161616`(暗色对卡片差 39 级,一颗黑洞)改 `#494949`(差 12 级),同病灶另 6 处(ref-img/ref-single/upload-link/refmini-empty/task-result-img/node-head:hover)一并改;浮条与任务卡 hover 改 `color-mix(text 10%)`(原来 panel 与 layer2 深色同色,hover 无反馈);字号 12/15/11/13 全归档位、圆角 8/6/5/14 归并、间距 52 处等值 + 13 处 1px 级微调;删 6 个死类名;新增 `tests/node-scope-test.js` 钉「节点内禁用面板表面色」;上一条 `v3.26.47+f5c8174` —— **M4-B4 设置/外观**:新增 `--iwb-control-h`(30px) 修「同行输入框 33px / 按钮 24px」的 9px 落差;设置页正文 14→13、标题 16→15,范围内半像素字号清零;删 21 条死规则(setcell/setgrid/set-row/appear-val 等);新增 `tests/settings-scope-test.js` 钉「控件等高 / 死类名不复现 / 引用的 token 必须存在」;上一条 `v3.26.46+9f29996` —— 2026-11-23 **M4-B3 首页/库**:删 30 条零生产者规则(25 个类名在产物里 0 次)+ 4 条被 specificity 覆盖的死声明,`style.css` 2391→2339 行;首页/库 106 条规则换 token,间距写死 91→5(只剩版心与导航让位的布局值)、字号写死清零,新增 `--iwb-font-display:24px` 第 7 档;验收改为「计算样式逐元素 diff + 12 张基线只首页 2 张变化」;上一条 `v3.26.45+968ff46` —— **M4-B2 浮层层级表 + 阴影四档**:14 档 `--iwb-z-*`(裸 z-index 取值种类 42→31)、`--iwb-elevation-1..4`(浮层 8 种阴影写法→4 档)、`.iwb-pop` 圆角 18→`radius-popover(14)`;修「弹窗里点保存看不到提示」—— 根因不是层级数字而是 `.iwb-overlay` 本身就是堆叠上下文,toast 改为 portal 到 `body`;新增 `tests/overlay-layer-test.js` 钉 9 条顺序约束;上一条 `v3.26.44+846a59b` —— **设计 token 体系重建**:D1–D9 色彩模型改为真正的深色(#121Line truncated
<!-- 2026-10-28 P1 拆分批 1:新增 src/generation-task-graph.js(5 个任务图纯函数自 app.js 迁出)
⇒ 模块数 60→61、耦合面 51→52、sourceModules 60→61。耦合面只**新增** IWBWTaskGraph,无删除。
2026-10-28 P1 拆分批 2:新增 src/storage-config-shape.js(9 个配置形状纯函数自 app.js 迁出)
@@ -22,7 +22,7 @@
- 图片**新写入主通道 = IndexedDB Blob `{__blob}` / key `imgblob_<hash>_<len>`** (A) `app.js:2143`;`{__cache}`(Cache Storage)为兜底;\`ref_\`(`app.js` 内定义的 `IDB_REF_PREFIX = 'ref_'`)为 legacy 形态 (A)。
- 大图判定:`isBigDataUrl` = `data:` 且 `length > 3000` (A) `app.js:2018`;**画布保存保留阈值** `< 16384` 才原样保留 (A) `app.js:2182`。**两处阈值并存,含义不同**。
- 单测是**源码契约测试**:`tests/` 目录共 **493** 处源码文本钉点(`source.includes` / `source.indexOf` / `/re/.test(source)`),分布在 **20** 个文件(其中 `iwb-v32-web-test.js` 一个就占 **407**)→ **结构性重构会先打红测试**。**该数字已由 `tests/source-text-ratchet-test.js` 的「只减不增」棘轮守门**(2026-10-20 起守卫范围从 1 个文件扩到全目录:新增任何一处源码文本钉点都会打红)。**2026-11-12 复算**(`npm run audit:pins`,v3.24.76):二分 STRUCT **417** / NAME **76**;形态 **POS 403 / NEG 87 / COUNT 3**;难度 **易 62 / 中 316 / 难 115**。钉点减法第一批(v3.24.72)把 **537 → 505**:8 条探针钉点改为「门禁内 spec 是否真的读该计数器」、5 条改为运行时断言(生产态 `window` 上无探针)、10 条改为 DOM 断言(质量档位禁用 / 传输页无三模式按钮 / 模型项 title)、4 条改为运行时对象断言(健康检查两域、策略对象冻结)、其余 9 条有同文件 DOM 等价断言或仅剩 NEG。第二批(v3.24.76)把 **505 → 493**:94-5~7 三条「多标签释放语义」(10 处正则)换成 `tests/iwb-tabs-release.spec.js` 的 3 条真 e2e,剩 1 条「消费方契约」(断言该 spec 在门禁内且 spec 源码真的读两个探针);另 2 条 `wPurgeIntent.add` 钉点改为读 `src/workspace-purge.js`。**这一批一换就查出 3 个真缺陷**(objectURL 从未释放 / 彻底删除留孤儿标签 · session / 刷新后误回收打开标签的图)—— 见 CHANGELOG v3.24.76。
- `app.js` = 单 IIFE **9,171 行**(**双层预算**:绝对上限 9,171 / 占总源码 ≤ 40%,现 **30.4%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **3,046 行**(上限 **3,046**,余量 0;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **110** 个模块 / 21,020 行,`sourceModules` 110 项;v3.24.68 新增 `clipboard-graph.js`,v3.24.74 新增 `image-admit.js`,v3.24.75 新增 `image-dedupe.js`,v3.24.76 新增 `workspace-purge.js`,v3.24.79 新增 `generation-provider-ping.js`,v3.24.80 删除无调用的 `createWBFlushViewport` 17 行)。
- `app.js` = 单 IIFE **9,173 行**(**双层预算**:绝对上限 9,173 / 占总源码 ≤ 40%,现 **30.3%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **3,046 行**(上限 **3,046**,余量 0;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **110** 个模块 / 21,079 行,`sourceModules` 110 项;v3.24.68 新增 `clipboard-graph.js`,v3.24.74 新增 `image-admit.js`,v3.24.75 新增 `image-dedupe.js`,v3.24.76 新增 `workspace-purge.js`,v3.24.79 新增 `generation-provider-ping.js`,v3.24.80 删除无调用的 `createWBFlushViewport` 17 行)。
- 门禁:`npm run verify` = `verify:ci`(`build` → `node --check app.js` → `node --check dist/app.js` → `check-dist.js` → `lint`(ESLint 正确性规则,`src/` + `app.js`,P4-16a)→ `test:unit` → `test` → `test:facts`)+ `test:e2e` (A) `package.json`。
## 2. 门禁与环境现状
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.26.67",
"version": "3.26.68",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
+23 -11
View File
@@ -20,6 +20,7 @@
const TOOLS_H = 27 // 工具条
const PAGER_H = 26 // 分页条 / 一页提示条
const HINT_H = 24 // 批量模式提示行
const DEFAULT_H = 470 // 注册时声明的默认高度(与 height 字段保持一致)
const THUMB_EDGE = 256
const THUMB_Q = 0.8
const IMG_EXT = ['png', 'jpg', 'jpeg', 'webp', 'gif', 'avif', 'bmp', 'svg']
@@ -191,13 +192,15 @@
const items = itemsOf(node)
const density = DENSITY[d.density] ? d.density : 'S'
const mode = d.albumMode === 'batch' ? 'batch' : 'per-image'
// 尺寸来源:节点显式 w/h → 宿主实测高度 → 插件默认值。
// ⚠ 不能用 host.getBoundingClientRect() 当高度:插件节点体是内容撑开的(auto),
// 量到的是「当前内容」而不是「卡片能有多高」⇒ 容量永远算成 1 行。
// 尺寸来源:**只认显式 node.h 或变体默认高度**(2026-11-26 修"插入后慢慢变矮")。
// ⚠ 绝不能用 props.measuredH / 自身 getBoundingClientRect():插件节点体是内容撑开的,
// 我们按它写回高度 ⇒ 卡片变矮 ⇒ 下次量到更矮 ⇒ 一路缩水。
// 拖拽调整尺寸时宿主会把新高度写进 node.h,那才是权威值。
const measured = measure(st.root)
const cardW = Number(node.w) || Number(d.width) || measured.width || 300
const cardH = Number(node.h) || Number(props.measuredH) || 470
st.root.style.height = Math.max(120, Math.round(cardH) - 4) + 'px'
const cardW = Number(node.w) || measured.width || 300
const cardH = Number(node.h) || DEFAULT_H
const wantH = Math.max(120, Math.round(cardH) - 4) + 'px'
if (st.root.style.height !== wantH) st.root.style.height = wantH
const cap = capacityOf(cardW, cardH, density, mode === 'batch')
const pages = Math.max(1, Math.ceil(items.length / cap.capacity))
const page = Math.max(0, Math.min(pages - 1, Number(d.page) || 0))
@@ -260,7 +263,7 @@
// 宫格(签名不变就不重建:避免每帧重排导致闪烁/丢拖拽态)
const sig = [node.id, density, page, cap.capacity, mode, items.length, d.onlyPage === true ? 1 : 0,
items.map((it) => (it && (fileRefOf(it.src) || it.name)) || '').join(','), Array.from(st.missing).join(',')].join('|')
items.map((it) => (it && (fileRefOf(it.src) || it.name) + (it && it.on === false ? ':0' : ':1')) || '').join(','), Array.from(st.missing).join(',')].join('|')
if (sig !== st.sig) {
st.sig = sig
st.grid.innerHTML = ''
@@ -403,10 +406,18 @@
if (ctx.images && ctx.images.canReference()) {
st.busy = '选择中…'; st.sig = ''; sync(ctx, st, st.node, st.props)
try {
const paths = await ctx.images.pick({ multiple: true, directory: !!directory })
const picked = await ctx.images.pick({ multiple: true, directory: !!directory })
st.busy = ''
if (paths.length) await addPaths(ctx, st, paths)
else { st.sig = ''; sync(ctx, st, st.node, st.props) }
if (!picked.length) { st.sig = ''; sync(ctx, st, st.node, st.props); return }
// 目录要展开成图片文件:pick 返回目录路径本身不是图片,之前直接过滤 ⇒ 「文件夹」点了没反应
let paths = []
if (directory) {
for (const dir of picked) {
try { const got = await ctx.images.listImages(dir); for (const f of (got || [])) paths.push(f) } catch (e) { /* 单个目录失败不阻断 */ }
}
} else paths = picked.slice()
if (!paths.length) { st.sig = ''; sync(ctx, st, st.node, st.props); return }
await addPaths(ctx, st, paths)
} catch (e) { st.busy = ''; st.sig = ''; sync(ctx, st, st.node, st.props) }
return
}
@@ -532,7 +543,7 @@
global.IWBPluginHost.register({
id: 'album',
name: '相册',
version: '1.0.0',
version: '1.0.3',
apiVersion: 1,
capabilities: ['nodeTypes', 'images', 'files'],
settings: {
@@ -542,6 +553,7 @@
ctx.nodes.register({
id: 'album',
title: '相册',
icon: 'puzzle',
width: 300,
height: 470,
ports: { in: true, out: true },
+3 -3
View File
@@ -1,7 +1,7 @@
{
"id": "album",
"name": "相册",
"version": "1.0.0",
"version": "1.0.3",
"apiVersion": 1,
"main": "main.js",
"style": "styles.css",
@@ -14,7 +14,7 @@
"出图"
],
"files": {
"main.js": "4dc4589b9d7855ad609ab1ede84cfd5371ef21d4688dffac817f70cfaabd280d",
"styles.css": "0726dcad30cb31874394994b78b67db8977f446e3f2b6d5c53dd11ed80fc03cb"
"main.js": "a00a449d6905e98f6625fb44c062f9e5a7eab2c5f5560035028f1f3b9f6f95a3",
"styles.css": "ada02ea71832d63c8ebe9e07d03dfb7d71f6d1471366f1f4e6c7eeab736dc573"
}
}
+10 -10
View File
@@ -6,23 +6,23 @@
.iwb-album-bar, .iwb-album-tools, .iwb-album-pager, .iwb-album-onepage {
display: flex; align-items: center; gap: var(--iwb-space-6); padding: var(--iwb-space-4) var(--iwb-space-8); flex: 0 0 auto;
}
.iwb-album-bar { border-bottom: 1px solid var(--iwb-line-weak); height: 26px; }
.iwb-album-bar { border-bottom: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent); height: 26px; }
.iwb-album-tools { padding-top: var(--iwb-space-2); padding-bottom: var(--iwb-space-2); }
.iwb-album-toggle { display: inline-flex; align-items: center; gap: var(--iwb-space-4); font-size: var(--iwb-font-2xs); color: var(--iwb-node-text2); white-space: nowrap; cursor: pointer; }
.iwb-album-track { width: 22px; height: 12px; border-radius: 999px; background: var(--iwb-line); position: relative; flex: 0 0 auto; transition: background .15s; }
.iwb-album-track { width: 22px; height: 12px; border-radius: 999px; background: var(--iwb-border); position: relative; flex: 0 0 auto; transition: background .15s; }
.iwb-album-track i { position: absolute; top: 1.5px; left: 1.5px; width: 9px; height: 9px; border-radius: 50%; background: var(--iwb-panel); transition: left .15s; }
.iwb-album-track.on { background: var(--iwb-brand); }
.iwb-album-track.on i { left: 11.5px; }
.iwb-album-count { margin-left: auto; font-size: var(--iwb-font-2xs); color: var(--iwb-node-text2); white-space: nowrap; }
.iwb-album-count b { color: var(--iwb-node-text); font-weight: 600; }
.iwb-album-btn { height: 21px; padding: 0 var(--iwb-space-8); border: 1px solid var(--iwb-line); border-radius: var(--iwb-radius-chip); background: var(--iwb-panel); color: var(--iwb-node-text2); font-size: var(--iwb-font-2xs); display: inline-flex; align-items: center; gap: var(--iwb-space-4); cursor: pointer; white-space: nowrap; }
.iwb-album-btn { height: 21px; padding: 0 var(--iwb-space-8); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-chip); background: var(--iwb-panel); color: var(--iwb-node-text2); font-size: var(--iwb-font-2xs); display: inline-flex; align-items: center; gap: var(--iwb-space-4); cursor: pointer; white-space: nowrap; }
.iwb-album-btn:hover { border-color: var(--iwb-brand); color: var(--iwb-node-text); }
.iwb-album-btn.on { border-color: var(--iwb-brand); color: var(--iwb-node-text); }
.iwb-album-seg { margin-left: auto; display: inline-flex; border: 1px solid var(--iwb-line); border-radius: var(--iwb-radius-chip); overflow: hidden; }
.iwb-album-seg { margin-left: auto; display: inline-flex; border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-chip); overflow: hidden; }
.iwb-album-seg span { width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; font-size: var(--iwb-font-2xs); color: var(--iwb-node-text2); background: var(--iwb-panel); cursor: pointer; }
.iwb-album-seg span.on { background: var(--iwb-brand); color: var(--iwb-on-brand); }
.iwb-album-grid { display: grid; gap: var(--iwb-space-4); padding: var(--iwb-space-2) var(--iwb-space-8) var(--iwb-space-6); overflow: hidden; align-content: start; flex: 1 1 auto; min-height: 0; }
.iwb-album-cell { position: relative; border-radius: var(--iwb-radius-chip); overflow: hidden; background: var(--iwb-line-weak); border: 1px solid var(--iwb-line); cursor: grab; }
.iwb-album-cell { position: relative; border-radius: var(--iwb-radius-chip); overflow: hidden; background: color-mix(in srgb, var(--iwb-border) 55%, transparent); border: 1px solid var(--iwb-border); cursor: grab; }
.iwb-album-cell img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.iwb-album-cell.off img { opacity: .38; }
.iwb-album-cell.sel { outline: 2px solid var(--iwb-brand); outline-offset: -2px; }
@@ -34,16 +34,16 @@
.iwb-album-batch { position: absolute; right: var(--iwb-space-2); top: var(--iwb-space-2); padding: 0 var(--iwb-space-4); height: 14px; border-radius: 999px; background: rgba(107,114,128,.92); color: #fff; font-size: var(--iwb-font-2xs); display: flex; align-items: center; }
.iwb-album-del { position: absolute; right: var(--iwb-space-2); bottom: 3px; 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; }
.iwb-album-add { border: 1px dashed var(--iwb-line); 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 { 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 var(--iwb-line-weak); height: 26px; }
.iwb-album-onepage { border-top: 1px solid var(--iwb-line-weak); height: 26px; color: var(--iwb-node-text2); font-size: var(--iwb-font-2xs); }
.iwb-album-pg { display: inline-flex; align-items: center; border: 1px solid var(--iwb-line); border-radius: var(--iwb-radius-chip); background: var(--iwb-panel); }
.iwb-album-pager { border-top: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent); height: 26px; }
.iwb-album-onepage { border-top: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent); height: 26px; color: var(--iwb-node-text2); font-size: var(--iwb-font-2xs); }
.iwb-album-pg { display: inline-flex; align-items: center; border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-chip); background: var(--iwb-panel); }
.iwb-album-pg span { width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; font-size: var(--iwb-font-2xs); cursor: pointer; color: var(--iwb-node-text2); }
.iwb-album-pg b { font-weight: 600; color: var(--iwb-node-text); padding: 0 2px; font-size: var(--iwb-font-2xs); }
.iwb-album-mini { display: inline-flex; align-items: center; gap: var(--iwb-space-4); margin-left: auto; font-size: var(--iwb-font-2xs); color: var(--iwb-node-text2); white-space: nowrap; }
.iwb-album-hint { margin: 0 8px 4px; padding: 4px 6px; border-radius: var(--iwb-radius-chip); background: rgba(107,114,128,.10); border: 1px solid rgba(107,114,128,.22); color: var(--iwb-node-text2); font-size: var(--iwb-font-2xs); line-height: 1.45; }
.iwb-album-hint b { color: var(--iwb-node-text); }
.iwb-album-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--iwb-space-6); color: var(--iwb-node-text2); font-size: 11px; text-align: center; padding: 0 var(--iwb-space-12); }
.iwb-album-empty .box { width: 66px; height: 50px; border: 1.5px dashed var(--iwb-line); border-radius: var(--iwb-radius-chip); display: flex; align-items: center; justify-content: center; font-size: var(--iwb-font-xl); color: var(--iwb-node-text2); }
.iwb-album-empty .box { width: 66px; height: 50px; border: 1.5px dashed var(--iwb-border); border-radius: var(--iwb-radius-chip); display: flex; align-items: center; justify-content: center; font-size: var(--iwb-font-xl); color: var(--iwb-node-text2); }
+3 -3
View File
@@ -4,10 +4,10 @@
"dir": "album",
"main": "main.js",
"style": "styles.css",
"version": "1.0.0",
"version": "1.0.3",
"files": {
"main.js": "4dc4589b9d7855ad609ab1ede84cfd5371ef21d4688dffac817f70cfaabd280d",
"styles.css": "0726dcad30cb31874394994b78b67db8977f446e3f2b6d5c53dd11ed80fc03cb"
"main.js": "a00a449d6905e98f6625fb44c062f9e5a7eab2c5f5560035028f1f3b9f6f95a3",
"styles.css": "ada02ea71832d63c8ebe9e07d03dfb7d71f6d1471366f1f4e6c7eeab736dc573"
}
},
{
+2 -2
View File
@@ -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.67-mwvdsbkk">
<link rel="stylesheet" href="/assets/style.css?v=3.26.68-mwveac62">
<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}
@@ -33,7 +33,7 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.26.67</a>
<a class="btn primary" href="/download/">下载 v3.26.68</a>
</div>
</div></nav>
<main>
+8 -4
View File
@@ -57,13 +57,13 @@
<h2>下载</h2>
<div class="row">
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
<div class="meta">版本 3.26.67 · 8.4 MB · .dmg<div class="hash">sha256 86a4da63d310e156…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.67_aarch64.dmg?h=86a4da63d310">下载</a>
<div class="meta">版本 3.26.68 · 8.4 MB · .dmg<div class="hash">sha256 e292ea2070a7784a…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.68_aarch64.dmg?h=e292ea2070a7">下载</a>
</div>
<div class="row">
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
<div class="meta">版本 3.26.67 · 8.8 MB · .dmg<div class="hash">sha256 7805bbf8e1f7b925…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.67_x64.dmg?h=7805bbf8e1f7">下载</a>
<div class="meta">版本 3.26.68 · 8.8 MB · .dmg<div class="hash">sha256 3a704502137ba79e…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.68_x64.dmg?h=3a704502137b">下载</a>
</div>
<div class="row">
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
@@ -97,6 +97,10 @@
</ol>
<h2>历史版本</h2>
<div class="row">
<div class="name">3.26.68</div>
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.67</div>
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
+8 -8
View File
@@ -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.67-mwvdsbkk">
<link rel="stylesheet" href="/assets/style.css?v=3.26.68-mwveac62">
</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>
@@ -17,19 +17,19 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.26.67</a>
<a class="btn primary" href="/download/">下载 v3.26.68</a>
</div>
</div></nav>
<main>
<section class="hero hero-art">
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.67-mwvdsbkk" alt=""></div>
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.68-mwveac62" alt=""></div>
<div class="hero-veil"></div>
<div class="wrap">
<span class="kicker">v3.26.67 · macOS / Windows · 数据在本地</span>
<span class="kicker">v3.26.68 · macOS / Windows · 数据在本地</span>
<h1>本地优先的<br>AI 生图无限画布</h1>
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
<div class="cta">
<a class="btn primary lg" href="/download/">下载 v3.26.67</a>
<a class="btn primary lg" href="/download/">下载 v3.26.68</a>
<a class="btn lg" href="/plugins/">浏览 13 个插件</a>
</div>
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
@@ -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.0.1 · 官方</div></div></div>
<div><div class="nm">相册</div><div class="ver">v1.0.3 · 官方</div></div></div>
<div class="desc">一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点</div>
<div class="tags"><span class="tag">图片</span><span class="tag">批量</span><span class="tag">出图</span></div>
</div>
@@ -96,8 +96,8 @@
<section class="section"><div class="wrap">
<h2>下载 Image Workbench</h2>
<p class="lead">选你的平台。装过一次之后,以后在应用内「设置 → 通用 → 版本与更新」就能一键升级。</p>
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.67_aarch64.dmg?h=86a4da63d310"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
<a href="/updates/darwin-x86_64/image-workbench_3.26.67_x64.dmg?h=7805bbf8e1f7"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.68_aarch64.dmg?h=e292ea2070a7"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
<a href="/updates/darwin-x86_64/image-workbench_3.26.68_x64.dmg?h=3a704502137b"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
<div class="none"><div class="n">Windows · x64</div><div class="s">暂未提供</div></div></div>
<div style="margin-top:20px;color:#9ca3af;font-size:12.5px">安装包未做 Apple 公证 / Windows 代码签名,首次打开需手动放行一次,细节见 <a href="/download/" style="text-decoration:underline">下载页</a>。</div>
</div></section>
+10 -10
View File
@@ -1,6 +1,6 @@
{
"version": 2,
"updatedAt": "2026-11-25T00:18:51.660Z",
"updatedAt": "2026-11-25T00:35:21.597Z",
"plugins": [
{
"id": "album",
@@ -14,26 +14,26 @@
"批量",
"出图"
],
"version": "1.0.1",
"version": "1.0.3",
"apiVersion": 1,
"bundle": "plugins/album-1.0.1.zip",
"bundleSize": 39159,
"bundleSha256": "c4e9c95a05bc94b46c2d4ea06e6a881ab69f6e66ed3ad4501b199d7cb19c34f7",
"bundle": "plugins/album-1.0.3.zip",
"bundleSize": 37090,
"bundleSha256": "9c89b039172dc645c8ed3300717d056cfa96eabcaa3d59eb9a6a45d533b51f0d",
"files": [
{
"path": "manifest.json",
"sha256": "2d52a3a96b0200f40df97b9e12e208842262089458994c2b8b84009bf20246ce",
"sha256": "44691b39af54917bb8c892a7801afb364887d70d0723f26b597e1c8a879171b4",
"size": 593
},
{
"path": "main.js",
"sha256": "77a3e3131bb01fa757dce0e139d8db9525e6f4ca9964d1a045673c3f90817ff5",
"size": 30889
"sha256": "a00a449d6905e98f6625fb44c062f9e5a7eab2c5f5560035028f1f3b9f6f95a3",
"size": 29460
},
{
"path": "styles.css",
"sha256": "cd2554be2af284236ceb773789be50528aa55113234129052ac5be8430bd5e49",
"size": 7367
"sha256": "ada02ea71832d63c8ebe9e07d03dfb7d71f6d1471366f1f4e6c7eeab736dc573",
"size": 6727
}
]
},
+3 -3
View File
@@ -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.67-mwvdsbkk">
<link rel="stylesheet" href="/assets/style.css?v=3.26.68-mwveac62">
</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>
@@ -16,7 +16,7 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.26.67</a>
<a class="btn primary" href="/download/">下载 v3.26.68</a>
</div>
</div></nav>
<main>
@@ -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.0.1 · 官方</div></div></div>
<div><div class="nm">相册</div><div class="ver">v1.0.3 · 官方</div></div></div>
<div class="desc">一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点</div>
<div class="tags"><span class="tag">图片</span><span class="tag">批量</span><span class="tag">出图</span></div>
</div>
+22 -1
View File
@@ -1,8 +1,29 @@
{
"app": "Image Workbench",
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
"updatedAt": "2026-11-25T00:24:12.596Z",
"updatedAt": "2026-11-25T00:38:13.185Z",
"releases": [
{
"version": "3.26.68",
"date": "2026-11-25",
"notes": "",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.26.68_aarch64.dmg",
"size": 8794173,
"sha256": "e292ea2070a7784a88c9b352e085d1dbdf53007f03b196e88185030d70d6838e",
"h": "e292ea2070a7",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.26.68_x64.dmg",
"size": 9201527,
"sha256": "3a704502137ba79e7de85cc6caae1e4a494b1ad8598c27ca6847d9a309cc6f73",
"h": "3a704502137b",
"kind": "dmg"
}
}
},
{
"version": "3.26.67",
"date": "2026-11-25",
+1 -1
View File
@@ -1983,7 +1983,7 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.26.67"
version = "3.26.68"
dependencies = [
"arboard",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.26.67"
version = "3.26.68"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.26.67",
"version": "3.26.68",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
+33 -1
View File
@@ -88,6 +88,38 @@
return list.filter((p) => typeof p === 'string' && p)
}
// 列目录里的图片(相册「文件夹」导入用):Tauri fs.readDir 只给名字,这里递归拼回绝对路径。
// 深度限 2 层:相册是「一本相册」,不需要把整个硬盘扫一遍。
async function listImages (dir, depth) {
const t = T(); const f = fsApi()
if (!t || !f || typeof f.readDir !== 'function') return []
const root = String(dir || '')
if (!root) return []
const join = (t.path && typeof t.path.join === 'function') ? t.path.join : null
const out = []
const walk = async (cur, d) => {
let entries = []
try { entries = await f.readDir(cur) } catch (e) { return }
for (const ent of (entries || [])) {
const name = String((ent && ent.name) || '')
if (!name || name.charAt(0) === '.') continue
const child = join ? await join(cur, name) : (cur.replace(/[\\/]+$/, '') + '/' + name)
if (ent && ent.isDirectory) { if (d > 0) await walk(child, d - 1); continue }
if (!isImagePath(child)) continue
out.push(child)
if (out.length >= 500) return
}
}
await walk(root, typeof depth === 'number' ? depth : 1)
return out
}
const isImagePath = (p) => {
const m = /\.([a-z0-9]{1,5})$/i.exec(String(p || ''))
const ext = m ? m[1].toLowerCase() : ''
return ['png', 'jpg', 'jpeg', 'webp', 'gif', 'avif', 'bmp', 'svg'].indexOf(ext) >= 0
}
// 单张引用:读 stat 拿元信息(不读字节)——相册导入时用
async function reference (path) {
const p = String(path || '')
@@ -98,6 +130,6 @@
return { ok: true, path: p, name: nameOf(p), size: st.size, mtime: st.mtime }
}
const API = Object.freeze({ is, available, mimeOf, nameOf, readBytes, readDataUrl, readBlob, stat, grant, pick, reference })
const API = Object.freeze({ is, available, mimeOf, nameOf, isImagePath, listImages, readBytes, readDataUrl, readBlob, stat, grant, pick, reference })
global.IWBImageFileRef = API
})(typeof window !== 'undefined' ? window : globalThis)
+2
View File
@@ -40,6 +40,8 @@
canReference: () => fileRef.available(),
// 系统选择器:返回绝对路径数组(桌面端);网页端返回 []
pick: (opts) => fileRef.pick(opts),
// 目录里的图片列表(相册「文件夹」导入):递归 2 层,最多 500 张
listImages: (dir) => fileRef.listImages(dir, 1),
// 单张引用:只读元信息,不复制字节
reference: async (path) => {
if (!isImagePath(path)) return { ok: false, reason: 'not-image' }
+37 -12
View File
@@ -106,6 +106,40 @@ function Minimap(props) {
)
}
// 底栏「插件节点」入口:拼图图标 + 点开列出所有插件节点(2026-11-26)
function PluginAddButton(props) {
const [open, setOpen] = useState(false)
const boxRef = useRef(null)
useEffect(() => {
if (!open) return undefined
const onDoc = (e) => { if (boxRef.current && !boxRef.current.contains(e.target)) setOpen(false) }
const onKey = (e) => { if (e.key === 'Escape') setOpen(false) }
document.addEventListener('pointerdown', onDoc, true)
document.addEventListener('keydown', onKey)
return () => { document.removeEventListener('pointerdown', onDoc, true); document.removeEventListener('keydown', onKey) }
}, [open])
const list = Array.isArray(props.variants) ? props.variants : []
return el('span', { className: 'iwb-plugin-add-wrap', ref: boxRef },
el('button', {
className: 'iwb-btn iwb-plugin-add' + (open ? ' iwb-btn-on' : ''),
'data-tip': '插件节点(相册 / 网页 / 样式…)',
'aria-label': '插件节点',
'aria-haspopup': 'menu',
'aria-expanded': open ? 'true' : 'false',
onPointerDown: (e) => e.stopPropagation(),
onClick: () => setOpen((x) => !x),
}, I('puzzle')),
open ? el('div', { className: 'iwb-plugin-add-menu', role: 'menu' },
list.map((pv) => el('button', {
key: pv.id,
className: 'iwb-ctx-item',
role: 'menuitem',
onClick: () => { setOpen(false); if (typeof props.onPick === 'function') props.onPick(pv.id) },
}, I('puzzle'), el('span', { className: 'iwb-btn-text' }, pv.title || pv.id))),
) : null,
)
}
function ToolbarBottom(props) {
const { onAdd, onOpenPrompts, onFitView, onZoom, tool, onTool } = props
// 工具组(2026-10-31):互斥「选择 / 抓手」。抓手 = 空格+左键的固化版(不用按住空格),
@@ -134,19 +168,10 @@ function ToolbarBottom(props) {
el('button', { className: 'iwb-btn', 'data-tip': '中继', onClick: () => onAdd('relay') }, I('circle-dot')),
el('button', { className: 'iwb-btn', 'data-tip': '配置', onClick: () => onAdd('gen') }, I('gen')),
el('button', { className: 'iwb-btn', 'data-tip': '输出', onClick: () => onAdd('out') }, I('presentation')),
// 插件节点下拉(2026-11-26):底栏是"加节点"的主入口,插件节点必须也能从这里加。
// 原生 select:键盘可达、不引入弹层状态;没有插件节点时整块不渲染(内置行为零变化)。
// 插件节点入口(2026-11-26):拼图图标按钮 + 弹出列表。
// 不用文字下拉(用户裁定:插件入口只用图标),也不用弹层库:一个按钮 + 一个绝对定位列表即可。
(Array.isArray(props.pluginVariants) && props.pluginVariants.length)
? el('select', {
className: 'iwb-btn iwb-plugin-add',
'data-tip': '插件节点',
title: '添加插件节点',
value: '',
onChange: (e) => { const id = e.target.value; e.target.value = ''; if (id && typeof props.onAddPlugin === 'function') props.onAddPlugin(id) },
},
el('option', { value: '' }, '插件节点'),
props.pluginVariants.map((pv) => el('option', { key: pv.id, value: pv.id }, pv.title || pv.id)),
)
? el(PluginAddButton, { variants: props.pluginVariants, onPick: props.onAddPlugin, I })
: null,
),
// v3.25.82:底栏「资源库」按钮已删(右侧栏/提示词库面板已覆盖该入口,用户裁定)
+6 -1
View File
@@ -2422,4 +2422,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-settings-modal .iwb-backup-embedded .iwb-modal-body{max-height:none;overflow:visible}
/* 底栏「插件节点」下拉(2026-11-26):与相邻 .iwb-btn 同高,只做尺寸/光标微调;颜色沿用工具栏 token */
.iwb-plugin-add { height: 30px; max-width: 120px; padding: 0 var(--iwb-space-6); cursor: pointer; font-size: var(--iwb-font-xs); }
.iwb-plugin-add-wrap { position: relative; display: inline-flex; }
.iwb-plugin-add { position: relative; }
/* 插件节点列表:与工具栏同色系,向上弹出(底栏贴底,向上才有空间) */
.iwb-plugin-add-menu { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); min-width: 168px;
background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-control); box-shadow: var(--iwb-elevation-2);
padding: var(--iwb-space-4); display: flex; flex-direction: column; gap: var(--iwb-space-2); }
+2 -1
View File
@@ -164,9 +164,10 @@ const MAX_SRC_COMPONENT_LINES = 531
// · 导入保留原图(keepOriginal 分支,2 行) +2
// · 本地文件模块惰性取用 wFileRefMod(避免跨文件引用脆弱,8 行) +8
// · 底栏「插件节点」下拉接线(回调 + 传参,2 行) +2
// · 底栏换拼图图标入口(puzzle 图标 + 组件接线,2 行) +2
// 通用件(pick/grant/stat/readDataUrl/readBlob/参数校验)全部在 src/image-file-ref.js
// 与 src/plugin-api-images.js,app.js 只做装配。
const MAX_APP_JS_LINES = 9171
const MAX_APP_JS_LINES = 9173
const MAX_APP_JS_SHARE = 0.40
// ── 历史记账(供回溯,逐条保留)──────────────────────────────────────────────