Compare commits

...
29 Commits
Author SHA1 Message Date
qiqi cf93080d17 fix(storage): 启动时补齐工作子目录(windows 全新安装缺 images/canvas → 写图失败;目录缺失也避免白屏)v3.25.13
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m25s
2026-11-18 13:42:09 +08:00
qiqi 1ffe067e12 fix(image): 写 blob 前确保 images/<cat> 目录存在(Windows 全新安装缺目录 → 写失败 → 退 Cache → 重启丢图);桌面端不再回退不持久的 Cache Storage(v3.25.12)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m53s
2026-11-18 13:34:27 +08:00
qiqi 58d8d9c43a chore(release): 3.25.11 Windows 包上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m39s
2026-11-18 13:19:59 +08:00
qiqi 0e15e29c18 fix(desktop): 单实例 + 外链走系统浏览器 + 原生通知 + 窗口下限 + 按平台产物 + CSP 清理(v3.25.11)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m37s
2026-11-18 13:09:42 +08:00
qiqi d8c8717826 fix(image): 图片字节写不进磁盘的根因(blob 存储绑定未就绪运行时 + kv.put 裸 false 当成功)v3.25.10
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m29s
2026-11-18 12:50:44 +08:00
qiqi 9e400e2348 fix(image): 惰性绑定 ImageBlobStore(避免绑定到未就绪运行时)+ kv.put 失败返回对象(裸 false 会被当成成功,产出空引用) 2026-11-18 12:46:34 +08:00
qiqi 2f9a326159 chore(release): 3.25.9 Windows 包上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m29s
2026-11-18 12:32:31 +08:00
qiqi 56b5f49646 fix(storage): 图片登记后立即落盘;GC 确认弹窗报出保留/断链数量(P0,v3.25.9)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m27s
2026-11-18 12:13:32 +08:00
qiqi 49b419251e fix(images): 拖入同图不再被去重拦掉(可重复添加);gcImages 计入画布引用,避免误删在用图片(v3.25.8)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m12s
2026-11-18 11:43:32 +08:00
qiqi 57fc63dc10 chore(release): 3.25.7 Windows 包上线(三平台 latest.json 齐备)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m30s
2026-11-18 09:46:16 +08:00
qiqi 36276455ea fix(clipboard): PNG 传输替代裸 RGBA;路径文本转图片;serde camelCase 修原生读图失效;节点组粘贴落点(v3.25.7)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m12s
2026-11-18 09:31:30 +08:00
qiqi 1afd5d7521 feat(paste): 库面板打开不再关闭也不拦粘贴;落点避开面板;同图允许重复粘贴(v3.25.6)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m11s
2026-11-18 07:36:28 +08:00
qiqi 22ecd268cf fix(clipboard): 库面板打开时不再拦掉粘贴(先关面板再落节点);更新对应单测(v3.25.5)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m6s
2026-11-18 07:26:36 +08:00
qiqi 0c39873a1a fix(clipboard): WKWebView 无 clipboard.write 时写纯文本摘要兜底,粘贴按摘要匹配回节点组;更新 74-4/74-8 断言语义(v3.25.4)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m6s
2026-11-18 07:14:57 +08:00
qiqi fa7c866457 chore(release): 3.25.3 Windows 包上线(三平台签名齐备,latest.json 含 windows-x86_64)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m6s
2026-11-18 06:37:42 +08:00
qiqi fc199776d9 chore(release): 加 publish-windows-update.sh(Windows 安装包本机重签名 + latest.json 合并)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m6s
2026-11-18 06:35:54 +08:00
qiqi 91ab3511ea chore(release): 3.25.3 剪贴板修复(应用菜单 + 原生图片读写)+ 站点/更新源
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m27s
2026-11-17 22:09:11 +08:00
qiqi 576d24f163 feat(clipboard): macOS 应用菜单 + 原生剪贴板图片读写(arboard),修复桌面端复制/粘贴图片、粘贴文本为节点失效
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 2m37s
2026-11-17 22:04:49 +08:00
qiqi 9283e76f1a chore(plugins): 同步标注插件 1.20.6(反白修正)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m46s
2026-11-17 21:05:26 +08:00
qiqi 13a34073bd chore(plugins): 同步标注插件 1.20.5(反白公式修正)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 3m11s
2026-11-17 20:53:11 +08:00
qiqi aff77cef75 chore(plugins): 同步标注插件 1.20.4
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 2m12s
2026-11-17 20:48:38 +08:00
qiqi ac62c3bfbc chore(plugins): 同步标注插件 1.20.3(快速效果兜底)+ 市场产物
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 3m38s
2026-11-17 20:37:57 +08:00
qiqi 8e0697d4cd style(site): 首屏白纱减淡(96%→86% / 94%→84%),让油画色彩多透出来
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 2m54s
2026-11-17 20:30:45 +08:00
qiqi 2fb9511f8b style(site): 去掉首屏下方重复的油彩色带,改为自然过渡到内容区
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m34s
2026-11-17 20:28:08 +08:00
qiqi fbdaf48377 feat(site): 首页主视觉换成油画(AI 生成),加白纱/颗粒/缓慢缩放/滚动入场/视差;资源加时间戳防缓存
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m56s
2026-11-17 20:24:22 +08:00
qiqi 99480bf9c5 feat(site): 新首页 + 下载页 + 插件页(统一导航/页脚,参考 open-design 风格)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m42s
2026-11-17 20:07:16 +08:00
qiqi 2ad699b64d docs(site): 下载页补 macOS 首次打开说明(未公证,右键打开或清 quarantine)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 2m0s
2026-11-17 19:51:29 +08:00
qiqi fabe8d7aa1 chore(release): 3.25.2 Windows 安装包上线(三平台齐发)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m21s
2026-11-17 18:13:25 +08:00
qiqi 2eacf5a81d chore(release): 3.25.2 下载页双架构 + latest.json 已上线
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m20s
2026-11-17 17:51:17 +08:00
45 changed files with 3071 additions and 222 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
{
"nodes": [],
"edges": [],
"groups": []
}
+3
View File
@@ -0,0 +1,3 @@
{
"activeCanvas": "Main"
}
+135
View File
@@ -14,6 +14,141 @@
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
## v3.25.13(2026-11-18)启动兜底:工作子目录缺失时自动补齐
### 修复
- 启动时 `ensureDirs()` 补齐 `canvases/`、`library/`、`plugins/`、`trash/` 与
`images/{canvas,gallery,thumbs,legacy}`(幂等)。
- 为什么需要:Windows 全新安装缺 `images/canvas` 导致写图失败;目录被手工删掉时
启动阶段读目录抛错会让首屏白屏(实测遇到过一次)。
### 验证
把 `images/` 与 `library/` 整个删掉再启动 → 目录全部自动重建、应用正常渲染。
## v3.25.12(2026-11-18)Windows 丢图根因:images/canvas 目录不存在
### 根因
Windows 全新安装的资料目录里 `images/` 只有 `thumbs/`(缩略图 writer 会自己 mkdir),
**没有 `canvas/` 与 `gallery/`**。`kv.put` 写 blob 前不建目录 ⇒ `writeFile` 失败 ⇒
blob 写入被判失败 ⇒ 退化到 Cache Storage(`{__cache}`)⇒ WebView2 重启后解析不到 ⇒ 图没了。
mac 上之所以正常:老数据里 `images/canvas` 早就被迁移脚本建好了。
### 修复
- `kv.put` 的 blob / dataURL 两条分支写盘前 `mkdir(images/<cat>, {recursive:true})`(幂等)。
- 桌面端**不再回退 Cache Storage**:失败就让调用方把字节内联进画布,宁可画布变大也不丢图。
### 验证
把 mac 上的 `images/canvas` 整个移走模拟全新安装 → 粘贴一张图:
修前:目录不重建、assets 不变;修后:目录自动重建、`assets 52→53`、目录里出现 1 个文件。
## v3.25.11(2026-11-18)桌面迁移体检:单实例 / 外链 / 原生通知 / 窗口下限
### 修复
- **单实例**:加 `tauri-plugin-single-instance`,第二次启动只聚焦已有窗口。
多实例同时写同一个资料目录会把 data.json 与 canvases 写成不一致状态(这两天查的图片丢失就是这类)。
- **外链不再把应用导航走**:捕获阶段拦截 `a[href^=http]`(含中键)+ `window.open` 兜底改走
`open_external_url` 命令,由系统浏览器打开(新模块 `src/ui-desktop-shell.js`)。
- **桌面原生通知**:WKWebView 不支持 Web Notification,出图完成提醒改走 `notify_desktop`。
- **窗口尺寸下限**:恢复几何时 clamp 到 1024×640(与 minWidth/minHeight 对齐);
实测过 1051×488 的窗口,该尺寸下画布渲染空白。
- **按平台产物**:新增 `tauri.macos.conf.json`(app+dmg)与 `tauri.windows.conf.json`(nsis),
Windows 不再顺带构建不受更新器支持的 msi。
- **CSP 清理**:移除遗留的开发端口(30092 / 3425)。
## v3.25.10(2026-11-18)图片粘贴后重启丢失:根因是 blob 存储绑定错运行时
### 修复
- **ImageBlobStore 惰性绑定**:原来在模块初始化时就 `create({ idb: IDB })`,那一刻资料目录尚未就绪,
绑到的是浏览器/空实现运行时 ⇒ 图片字节写进了不会落盘的地方,画布里只留 `{__blob}` 引用,
重启后解析不到 → 节点变占位图。现在按当前 runtime 懒绑定并按实例缓存。
- **kv.put 失败可识别**:资料目录未就绪时返回裸 `false`,调用方用 `r.ok === false` 判断,
`false.ok` 是 undefined ⇒ 被当成成功,产出指向空文件的引用。现在返回 `{ ok: false, error }`。
### 验证(实测)
- 修复前:粘贴一张图 → `assets` 47→47、`images/canvas` 26→26(字节没落盘)
- 修复后:粘贴一张图 → `assets` 47→48、`images/canvas` 26→27,节点为 `{__blob}`
- 重启应用后:同一节点仍在、图片正常显示
## v3.25.9(2026-11-18)P0:图片登记表不再落后于画布 + 清理前交代清楚
### 修复
- **登记表立即落盘**:图片写入 `images/` 后,`assets` 登记(在 data.json 里)原来是 800ms debounce,
进程被强杀/崩溃时登记丢掉、画布引用还在 ⇒ GC 会把在用图片当孤儿。现在登记后立刻 `flush()`。
- **清理确认弹窗报数**:除了「N 个未被引用」,还会显示「其中 M 张因画布引用自动保留」与
「另有 K 处引用已缺图」,避免用户在不了解后果的情况下按确认。
### 新增
- 单测 `tests/storage-gc-canvas-refs-test.js`:钉住「GC 必须扫画布引用并并入 used 集合」与「登记后必须 flush」。
## v3.25.8(2026-11-18)拖入同图被拦 + 图片节点变占位图
### 修复
- **拖入同一张图被去重拦掉**:命中旧节点后不写 blob、只选中它,于是「图片数据缺失 → 重新拖入」
这条唯一自愈路径被堵死。现在拖入一律新建节点并重写 blob,旧节点也会跟着恢复。
- **图片清理误删在用图片**:`gcImages` 只信 `assets` 登记表;登记表落后于画布时,
画布仍在引用的图片会被当孤儿挪进 trash/,节点随即变成占位图。现在把 `canvases/*.json`
里的 `{__blob}` 也计入在用集合。
## v3.25.7(2026-11-18)剪贴板体检:大图卡顿、路径误判、粘贴落点
### 修复
- **大图剪贴板卡顿**:原先 IPC 传裸 RGBA(12MP 照片 46MB → base64 62MB)。
改为传 PNG:读方向由 Rust 编码,写方向直接把 Blob 的 PNG 字节发过去,体积降到几 MB。
- **Finder「复制图片」被当成文本粘贴**:macOS 复制图片时常同时给 file:// 文本,
classify 会落进文本分支贴出「路径提示词节点」。现在路径样式的文本先问原生剪贴板要图片。
- **原生读图一直失效**:Rust 结构体字段是 `png_base64`,前端读的是 `pngBase64`,取不到值。
结构体加 `#[serde(rename_all = "camelCase")]`,前端两种写法都兼容。
- **节点组粘贴落点**:Ctrl+V 贴节点/节点组也走 `safeSeed`,面板打开时不会被遮住。
### 清理
- 删除已废弃的 `rejectDup` 与 `pasteCtx.closeLibrary`(粘贴不再关闭库面板)。
## v3.25.6(2026-11-18)粘贴语义修正:不关库面板、贴鼠标处、允许同图重复
### 变更
- 库面板(资源抽屉 / 资源中心)打开时**不再关闭它**,粘贴照常生效。
- 落点:指针在画布可见区 → 贴指针位置;指针压在面板上 → 自动挪到面板旁,不再出现「贴了但被遮住」。
- 同一张图**允许重复粘贴**(粘贴是显式动作,被同图去重挡掉像「按键没反应」)。
同图去重仍保留给拖拽/批量导入等被动路径。
## v3.25.5(2026-11-18)库面板打开时粘贴失效
### 修复
- 打开左侧资源抽屉 / 资源中心后,Ctrl+V 完全不响应:`overlayOpen()` 把库面板当成模态浮层,
在 paste 入口直接 return。
- 现在拆成两层判断:**真模态**(设置/帮助/右键菜单/连接菜单/放大编辑)仍不接管;
**库面板**改为「先关面板再粘贴」(`pasteCtx.closeLibrary`),落点可见、不再出现「贴了但看不见」。
- 库面板无法关闭时(老调用方)退回旧行为,不会静默吞掉粘贴。
- 快捷键兜底也补上模态判断,设置面板打开时不会偷贴图片。
## v3.25.4(2026-11-18)复制节点贴不回来:剪贴板兜底修复
### 修复
- **WKWebView 没有 `navigator.clipboard.write`** 时,`clipboard-graph.write()` 直接 return false,
等于什么都没写进系统剪贴板 → Ctrl+C 之后 Ctrl+V 只能贴出「剪贴板里没有可粘贴的内容」。
现在:写不了富文本就写**纯文本摘要**(navigator.writeText → 再退 Rust arboard),
同时记住「这份摘要属于哪个 clip」;粘贴时按摘要**精确匹配**,命中就贴回节点组。
- 新增 Rust 命令 `clipboard_write_text` / `clipboard_read_text`(arboard),Windows 同样可用。
### 验证
- 单测 `tests/clipboard-graph-fallback-test.js`:无 `clipboard.write` 场景下能写原生文本且能匹配回 clip。
## v3.25.3(2026-11-17)桌面端剪贴板修复:复制/粘贴图片、粘贴文本为节点
> **状态:✅ 已发布** macOS 双架构 + Windows。
### 修复
- **Cmd+C/Cmd+V 完全失效**:macOS 上 Tauri 应用没有应用菜单时,系统快捷键不会进入 WebView。
现在补上 `Menu::default`(撤销/剪切/复制/粘贴/全选),文本粘贴为节点恢复正常。
- **粘贴图片(Finder / 网页)**:WKWebView 的 paste 事件拿不到 Finder 复制的图片。
新增 Rust 命令 `clipboard_read_image`(arboard),paste 无图时主动读系统剪贴板;
另加 160ms 兜底:快捷键按下后没有 paste 事件也会尝试读图。
- **复制图片到系统剪贴板**:`navigator.clipboard.write` / `ClipboardItem` 在 WKWebView 常不可用,
新增 `clipboard_write_image` 原生兜底,预览复制与图库复制都走它。
### 新增模块
- `src/clipboard-native.js`:RGBA ⇄ PNG Blob 转换与原生剪贴板调用(网页版自动不可用)。
## v3.25.2(2026-11-17)在线更新上线:应用内「检查更新 → 立即更新 → 自动重启」
> **状态:✅ 已发布** 双架构签名产物 + `latest.json` 更新源。
+1 -1
View File
@@ -41,7 +41,7 @@ build esbuild 打包到 dist/(单 dist/app.js = src/ 模块按序
node --check app.js 与 dist/app.js 语法
check-dist.js 产物体检
lint ESLint(src/ + app.js,正确性规则)
test:unit 100 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
test:unit 102 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
test relay-task-graph-fixture + iwb-v32-web-test
test:facts 事实基线守门(见 §5)
typecheck 渐进类型检查(tsc --noEmit;范围 = src/*.js,不含 app.js)
+66 -17
View File
@@ -118,6 +118,8 @@
return Promise.resolve(window.confirm(String(text)))
}
// 桌面壳适配(外链 / 原生通知 / 链接拦截)落在 src/ui-desktop-shell.js
try { if (window.IWBUIShell) window.IWBUIShell.installLinkGuard(wIsTauri) } catch (e) { /* ignore */ }
if (typeof window !== 'undefined' && window.IWBDesktop && window.IWBDesktop.configure) {
window.IWBDesktop.configure({
isTauri: wIsTauri,
@@ -132,6 +134,8 @@
marketInstalled: wMarketInstalled,
marketInstall: wMarketInstall,
marketUninstall: wMarketUninstall,
clipboardReadImage: (window.IWBNativeClipboard || {}).readImage,
clipboardWriteImage: (window.IWBNativeClipboard || {}).writeImage,
})
}
@@ -317,11 +321,14 @@
// 浏览器总通知:权限只在用户点击生图后的首次运行时请求;不支持/拒绝权限时静默降级。
let browserNotificationPermissionPromise = null
function prepareBrowserNotifications() {
if (wIsTauri()) return // 桌面端用原生通知,不需要网页权限
const N = typeof window !== 'undefined' && window.Notification
if (!N || typeof N.requestPermission !== 'function' || N.permission !== 'default' || browserNotificationPermissionPromise) return
try { browserNotificationPermissionPromise = N.requestPermission().catch(() => 'denied') } catch (e) { browserNotificationPermissionPromise = Promise.resolve('denied') }
}
function notifyBrowserGenerationDone(info) {
// 桌面端没有 Web Notification:交给桌面壳模块发原生通知
try { if (window.IWBUIShell && window.IWBUIShell.notifyGenerationDone(info)) return } catch (e) { /* ignore */ }
const N = typeof window !== 'undefined' && window.Notification
if (!N) return
const emit = () => {
@@ -817,16 +824,28 @@
// objectURL **单一归属**:一律由 wRegisterBlobUrl 创建并登记(拿得回原 Blob,绕开 CSP 对 fetch(blob:) 的拦截),
// 由 wImgUrlByRef 台账回收;**不调用** ImageBlobStore.resolveUrl/revokeAll —— 否则同一张图会有两套 URL
// 与两套回收时机(§8.2「不要两套并用」)。实例只在顶层创建一次,绝不在渲染路径里重复 create。
const ImageBlobStore = (function () {
/* v3.25.10:**惰性绑定**运行时。
* 原来在模块初始化时就 create({ idb: IDB }):那一刻资料目录可能还没就绪,
* IDB 拿到的是浏览器/空实现运行时,于是图片字节写进了「不会落盘」的地方 ——
* 画布里留下 {__blob} 引用,images/ 里没有文件、data.json 里没有登记;
* 重启后引用解析不到 → 图片节点变占位图(用户实测)。现在按当前 runtime 懒绑定并按实例缓存。 */
let wImageBlobStoreCache = null
let wImageBlobStoreRuntime = null
function wImageBlobStore() {
try {
if (typeof window === 'undefined') return null
const Lib = window.IWBImageBlobStore
if (!Lib || typeof Lib.create !== 'function') return null
if (!IDB || typeof IDB.put !== 'function' || typeof IDB.get !== 'function') return null
return Lib.create({ idb: IDB })
const rt = storageRuntime()
const idb = rt && rt.indexedDb
if (!idb || typeof idb.put !== 'function') return null
if (wImageBlobStoreCache && wImageBlobStoreRuntime === idb) return wImageBlobStoreCache
wImageBlobStoreCache = Lib.create({ idb: idb })
wImageBlobStoreRuntime = idb
return wImageBlobStoreCache
} catch (e) { return null }
})()
const IMG_BLOB_PREFIX = (ImageBlobStore && ImageBlobStore.PREFIX) ? String(ImageBlobStore.PREFIX) : 'imgblob_'
}
const IMG_BLOB_PREFIX = (function () { try { const S = wImageBlobStore(); return (S && S.PREFIX) ? String(S.PREFIX) : 'imgblob_' } catch (e) { return 'imgblob_' } })()
const wImgUrlByRef = new Map() // 引用键('b:'+blobKey / 'c:'+cacheUrl)→ objectURL
const wImgRefByUrl = new Map() // objectURL → 原引用对象(wBlobRefCache 被 FIFO 驱逐后仍能取回字节)
const wImgUrlPending = new Set() // 正在解析的引用键(幂等:渲染路径会反复调用)
@@ -870,7 +889,7 @@
if (wImgUrlByRef.has(key) || wImgUrlPending.has(key) || wImgUrlFailed.has(key)) return
wImgUrlPending.add(key)
const job = wIsBlobRef(v)
? (ImageBlobStore ? ImageBlobStore.getBlob(v.__blob) : Promise.resolve(null))
? (wImageBlobStore() ? wImageBlobStore().getBlob(v.__blob) : Promise.resolve(null))
: iwbCacheBlob(v.__cache)
// 解析 Promise 存进 wImgUrlPendingPromise ⇒ 供 wResolveImgAsync 等待(预览类操作需要 URL 字符串)
const p = Promise.resolve(job).then((blob) => {
@@ -939,8 +958,8 @@
async function wImgRefDataUrl(v) {
if (typeof v === 'string') return v
if (wIsBlobRef(v)) {
if (!ImageBlobStore) return ''
try { return await ImageBlobStore.resolveDataUrl(v.__blob) } catch (e) { return '' }
if (!wImageBlobStore()) return ''
try { return await wImageBlobStore().resolveDataUrl(v.__blob) } catch (e) { return '' }
}
if (wIsCacheRef(v)) { try { return (await iwbCacheRead(v.__cache)) || '' } catch (e) { return '' } }
return ''
@@ -2287,14 +2306,28 @@
// 图片引用化**唯一入口**:wSanitizeWs(画布保存)与 wRefValueAsync(收藏快照 / LRU 反 hydrate)都只经这里产出引用。
// 失败回退链:{__blob}(IDB Blob 主通道)→ {__cache}(Cache Storage 兜底)→ null(调用方自行兜底,绝不抛错打断保存)。
// 只有 ImageBlobStore.put 明确 r.ok===true 且带 key 才返回 {__blob},绝不产出「引用指向不存在的字节」。
// 存储自检(桌面迁移排查用):把“字节到底能不能落盘”变成可复制的事实
function wStorageSelfCheck() {
const F = (typeof window !== 'undefined') ? window.IWBStorageFile : null
const st = (F && typeof F.stats === 'function') ? F.stats() : null
return {
tauri: wIsTauri(), fileEnabled: wFileStoreOn(), dir: (st && st.dir) || '',
assets: (st && st.images) || 0, memKeys: (st && st.keys) || 0,
blobStore: !!wImageBlobStore(), cryptoSubtle: !!(typeof crypto !== 'undefined' && crypto.subtle),
caches: (typeof caches !== 'undefined'),
}
}
async function wImgRefWrite(dataUrl) {
if (W_IMG_BLOB_PRIMARY && ImageBlobStore) {
if (W_IMG_BLOB_PRIMARY && wImageBlobStore()) {
try {
const r = await ImageBlobStore.put(dataUrl)
const r = await wImageBlobStore().put(dataUrl)
if (r && r.ok && r.key) return { __blob: String(r.key) }
if (r && r.ok === false) swallow('image', new Error(r.error || 'blob-put-failed'))
} catch (e) { swallow('image', e) } // 落 Blob 失败(配额/环境不支持)→ 回退 Cache,但计数留痕
}
// 桌面端不回退 Cache Storage:WebView2 重启后 {__cache} 解析不到(mac 上正常),
// 回退等于“写成功但图没了”。失败就让调用方把字节内联进画布。
if (wIsTauri()) return null
const c = await iwbCacheWrite(dataUrl)
return (c && c.__cache) ? c : null
}
@@ -2400,10 +2433,10 @@
let raw = null
try { raw = await IDB.get(key) } catch (e) { raw = null }
if (!raw || typeof raw !== 'string' || raw.indexOf('data:') !== 0) return ref
if (ImageBlobStore) {
if (wImageBlobStore()) {
try {
const r = await ImageBlobStore.put(raw)
if (r && r.ok && r.key) { const out = ImageBlobStore.refOf(r.key); wEnsureImgUrl(out); return out }
const r = await wImageBlobStore().put(raw)
if (r && r.ok && r.key) { const out = wImageBlobStore().refOf(r.key); wEnsureImgUrl(out); return out }
} catch (e) { /* 落 BlobStore 失败 → 退回 Cache 引用 */ }
}
try { const c = await iwbCacheWrite(raw); if (c && c.__cache) { wEnsureImgUrl(c); return c } } catch (e) { /* ignore */ }
@@ -2622,7 +2655,7 @@
if (k.indexOf(IMG_BLOB_PREFIX) === 0) {
if (!keep.has(k)) {
wReleaseImgUrls(['b:' + k])
try { if (ImageBlobStore) { const okDel = await ImageBlobStore.del(k); if (okDel === false) swallow('image', new Error('blob-del-failed')) } else await IDB.del(k) } catch (e) { swallow('image', e) }
try { if (wImageBlobStore()) { const okDel = await wImageBlobStore().del(k); if (okDel === false) swallow('image', new Error('blob-del-failed')) } else await IDB.del(k) } catch (e) { swallow('image', e) }
}
continue
}
@@ -4083,6 +4116,12 @@
async function copyImageToClipboard(srcOrBlob) {
if (!srcOrBlob) throw wCopyError('format', W_COPY_HINT.format)
if (!navigator.clipboard || typeof navigator.clipboard.write !== 'function' || typeof ClipboardItem === 'undefined') {
// 桌面端兜底:WKWebView 里 ClipboardItem 常不可用,改走原生 arboard 写图片
const D = (typeof window !== 'undefined') ? window.IWBDesktop : null
if (D && D.clipboardWriteImage) {
const okNative = await D.clipboardWriteImage(srcOrBlob)
if (okNative) return srcOrBlob
}
throw wCopyError('unsupported', W_COPY_HINT.unsupported)
}
// 先转 PNG 再写剪贴板(任何输入都产出 image/png)
@@ -4090,6 +4129,11 @@
try {
await navigator.clipboard.write([new ClipboardItem({ 'image/png': png })])
} catch (err) {
const D = (typeof window !== 'undefined') ? window.IWBDesktop : null
if (D && D.clipboardWriteImage) {
const okNative = await D.clipboardWriteImage(png)
if (okNative) return png
}
const msg = String((err && err.message) || err)
// 没有写权限(页面失焦/未授权)也归为「浏览器不支持剪贴板图片」一类,附浏览器原文便于排查
throw wCopyError('unsupported', W_COPY_HINT.unsupported + '(' + msg + ')')
@@ -4321,7 +4365,7 @@
} catch (e) { /* 继续兜底 */ }
// ④ 最后兜底:新标签打开(右键/长按另存)——绝不静默失败
try {
window.open(su, '_blank', 'noopener')
try { window.IWBUIShell ? window.IWBUIShell.openExternal(su) : window.open(su, '_blank', 'noopener') } catch (e) { /* ignore */ }
wDownloadToast('该图床不支持直接下载,已在新标签打开图片:请右键「图片另存为」')
} catch (e) {
wDownloadToast('下载失败:' + ((e && e.message) || '未知原因'))
@@ -4576,7 +4620,7 @@ const tbCenterSeed = (type, refs) => {
el('div', { className: 'iwb-crash-actions' },
el('button', { className: 'iwb-btn iwb-btn-primary', onClick: this.retry }, '尝试恢复'),
el('button', { className: 'iwb-btn', onClick: () => { try { location.reload() } catch (e) { /* ignore */ } } }, '重新加载页面'),
el('button', { className: 'iwb-btn', title: '复制错误记录与内存采样(不含 Key、提示词和图片)', onClick: (ev) => { let t = '{}'; try { t = CrashLog ? JSON.stringify(CrashLog.report({ version: APP_VERSION }), null, 2) : '{}' } catch (e) { /* ignore */ } const cp = (typeof window !== 'undefined' && window.IWBClipboardCopy) || null; if (cp) cp.copyWithButton(t, ev && ev.currentTarget); else { try { navigator.clipboard.writeText(t) } catch (e) { /* ignore */ } } } }, '复制诊断信息'),
el('button', { className: 'iwb-btn', title: '复制错误记录与内存采样(不含 Key、提示词和图片)', onClick: (ev) => { let t = '{}'; try { const rep = CrashLog ? CrashLog.report({ version: APP_VERSION }) : {}; try { rep.storageSelfCheck = wStorageSelfCheck() } catch (e) { rep.storageSelfCheck = { error: String((e && e.message) || e) } } t = JSON.stringify(rep, null, 2) } catch (e) { /* ignore */ } const cp = (typeof window !== 'undefined' && window.IWBClipboardCopy) || null; if (cp) cp.copyWithButton(t, ev && ev.currentTarget); else { try { navigator.clipboard.writeText(t) } catch (e) { /* ignore */ } } } }, '复制诊断信息'),
),
el('div', { className: 'iwb-hint' }, '完整记录在「设置 → 诊断」里,可导出 JSON'),
),
@@ -5427,7 +5471,7 @@ const tbCenterSeed = (type, refs) => {
W_KEEP,
IDB,
IMG_BLOB_PREFIX,
ImageBlobStore,
get ImageBlobStore() { return wImageBlobStore() },
ModularBackupStore,
SchemaVersions,
StorageContract,
@@ -7188,6 +7232,8 @@ const tbCenterSeed = (type, refs) => {
wsId: activeWsId, activeWsId: () => activeWsIdRef.current || activeWsId, nodes: () => refs.nodes,
uid, findSpot, nodeW: (ty) => nodeWidth({ type: ty }), nodeH: (ty) => nodeTypeH(ty),
pushHistory, commitCanvas, setSel, setNotice, importImage: wImportImage,
readNativeImage: (typeof window !== 'undefined' && window.IWBDesktop && window.IWBDesktop.clipboardReadImage) ? () => window.IWBDesktop.clipboardReadImage() : null,
closeLibrary: () => { setDrawerOpen(false) },
})
const onKey = (e) => {
const t = e.target, C = window.IWBClipboardCopy, hasTxt = C && C.hasTextSelection
@@ -7280,11 +7326,14 @@ const tbCenterSeed = (type, refs) => {
const onPaste = (e) => {
const t = e.target, editable = !!(t && t.tagName && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.tagName === 'SELECT' || t.isContentEditable))
refs.pasteProbe = 0 // 收到真实 paste → 取消「系统剪贴板为空」的提示
refs.pasteStamp = (refs.pasteStamp || 0) + 1
const mod = (typeof window !== 'undefined' && window.IWBClipboardPaste) || null
if (mod) mod.handle(e, pasteCtx(), editable)
}
window.addEventListener('keydown', onKey)
window.addEventListener('keyup', onKeyUp)
const pasteModEarly = (typeof window !== 'undefined' && window.IWBClipboardPaste) || null
if (pasteModEarly && pasteModEarly.bindHotkeyFallback) pasteModEarly.bindHotkeyFallback(pasteCtx)
window.addEventListener('paste', onPaste)
window.addEventListener('blur', onBlur)
return () => {
+5 -5
View File
@@ -1,7 +1,7 @@
# 现状架构与性能事实基线(image-workbench-web)
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 67a46dd`(线上 `v3.25.2+67a46dd` —— 线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 1ffe067`(线上 `v3.25.12+1ffe067` —— 线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
<!-- 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 **8,508 行**(**双层预算**:绝对上限 8,700 / 占总源码 ≤ 40%,现 **36.8%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,998 行**(上限 **3,030**,余量 32;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **84** 个模块 / 14,607 行,`sourceModules` 84 项;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 **8,508 行**(**双层预算**:绝对上限 8,700 / 占总源码 ≤ 40%,现 **36.8%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,998 行**(上限 **3,030**,余量 32;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **86** 个模块 / 14,607 行,`sourceModules` 86 项;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. 门禁与环境现状
@@ -167,7 +167,7 @@
- 同一张图被 3 个节点引用、hydrate 成 3 个不同 objectURL 时,preview/display 缓存各自 miss → 重复解码(与 F2 相邻)。
- **F10|`refs.genScheduler` 是桩** (A) → 未接线,暂无运行时影响(P3)。
- **F11|已建但未接线的模块层(2026-10-17 接线审计;2026-10-18 复核更正)** (A)
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**84 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**86 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
- **仅被测试引用(9 模块 + 2 导出)**:`canvas-domain`、`generation-retry`、`generation-service`、`runtime-recovery-runner`、`runtime-state-bridge`、`runtime-store`、`storage-reconcile`、`storage-result`、`workspace-service`;导出 `IWBStorageHealthFactory`、`IWBPluginHostFactory`。(`storage-result` 是**存储层共享结果类型**,被 6 个存储模块读取,**非死代码**;`runtime-store` 为状态模型 epic 地基。)
- **app.js 零引用(1 模块 + 3 导出)**:模块 `generation-controller`;导出 `IWBRuntimeMetricsFactory`、`IWBStorageRuntimeFactory`、`IWBUIComponents`。`canvas-relations` 已随 `06cf211` 删除(本文档早前把它列为"唯一可删者",实际已删)。零引用证据 = `grep -rn "<名字>" .`(排除 `node_modules|dist|vendor|test-results`)**只命中其自身赋值行**。
- **半接线 / 未接线**:`IWBRuntimeStateBridge` **无 app.js 引用(仅测试)**;`IWBRuntimeRunContext` **已接线**(`runNode` 读取运行上下文);`IWBGenerationController` 是完整但**从未被调用**的工厂;`ModularWorkspaceStore`(`app.js` 内)是 `storage-workspace` 的**预留接线 seam**(当前无下游使用,保留);`window.IWBImageFolder` 自注册后读回(装载路径)。
@@ -183,7 +183,7 @@
| `storage-reconcile` | 存储对账(`createReconciler`/`check`) | 内联对账 | 存储层收口 |
| `runtime-recovery-runner` | 执行恢复候选(`candidate`/`valid`/`run`) | 内联恢复 | 断点恢复 |
| `canvas-domain` | 画布域模型(`commit`/`updateNode`/`deleteNodes`…) | `CanvasStore` 那一套 | Workbench 解耦(P2-9) |
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**73** 项)与 `sourceModules` 顺序(**84** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**74** 项)与 `sourceModules` 顺序(**86** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
## 12. 易踩的坑
@@ -254,7 +254,7 @@
**信任模型(必须明示)**:形态 A 的插件是**可信代码**(与核心同权限、无沙箱);启停与设置是 UX 与可维护性手段,**不是安全边界**(同 §13.27 教训:前端开关一定可被绕过)。
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**73** 项)与 `sourceModules` 顺序(**84** 项);新增模块、新增耦合、新增 dev 探针都**必须有意重生成对应快照**(`IWB_WRITE_BOUNDARY_SNAPSHOT=1`)。契约与行为的可执行验证在 `tests/plugin-host-test.js`(宿主单测)与 `tests/_plugin-host-probe.spec.js`(真实浏览器探针,`_` 前缀 + `iwb-dev-probe`,不进 34 门禁)。
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**74** 项)与 `sourceModules` 顺序(**86** 项);新增模块、新增耦合、新增 dev 探针都**必须有意重生成对应快照**(`IWB_WRITE_BOUNDARY_SNAPSHOT=1`)。契约与行为的可执行验证在 `tests/plugin-host-test.js`(宿主单测)与 `tests/_plugin-host-probe.spec.js`(真实浏览器探针,`_` 前缀 + `iwb-dev-probe`,不进 34 门禁)。
**关键陷阱**:`normalizeNodes`(现位于 `src/canvas-normalize.js`)会**静默丢弃**不在 `NODE_H` 里的节点类型 ⇒ 新增节点类型必须先登记 `NODE_H`,否则节点一刷新就消失(§13.27 规则三的同一失败模式)。
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.25.2",
"version": "3.25.13",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
@@ -10,7 +10,7 @@
"app:build": "tauri build",
"lint": "eslint src app.js",
"test": "node tests/relay-task-graph-fixture-test.js && node tests/plugin-style-node-test.js && node tests/inherit-text-test.js && node tests/iwb-v32-web-test.js",
"test:unit": "node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/ui-groups-sidebar-test.js && node tests/ui-lib-sidebar-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/functions-api-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-workbench-hooks-test.js",
"test:unit": "node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/ui-groups-sidebar-test.js && node tests/ui-lib-sidebar-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/functions-api-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-workbench-hooks-test.js",
"test:diagnostics": "node tests/runtime-diagnostics-hotpath-test.js",
"test:facts": "node tests/architecture-facts-guard-test.js && node tests/release-records-test.js",
"plugins:gc": "node scripts/plugins-publish.mjs --gc",
+3 -3
View File
@@ -13,9 +13,9 @@
},
{
"id": "image-annotate",
"file": "plugin-image-annotate.a8227863bec8.js",
"version": "1.20.2",
"integrity": "sha256-qCJ4Y77InZpHP4YowJce4TiQ8/ybBQhBZHwznAYgVHE="
"file": "plugin-image-annotate.7a865c7c353c.js",
"version": "1.20.6",
"integrity": "sha256-eoZcfDU8P7yqxVGorrWs0b9iTKJfEE25b85JPDCEsk8="
},
{
"id": "image-vectorize",
@@ -9,7 +9,7 @@
var __IWB_ANNOTATE_MANIFEST__ = {
id: 'image-annotate',
name: '标注 / 修图',
version: '1.20.2',
version: '1.20.6',
apiVersion: 1,
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
settings: {
@@ -3899,7 +3899,18 @@ var __IWB_ANNOTATE_MANIFEST__ = {
step: 1,
def: () => 100,
render: (canvas, v) => {
if (v > 0) filterCanvas(canvas, "invert(" + v / 100 + ")");
if (v <= 0) return;
const k = v / 100;
if (FILTER_SUPPORTED) {
filterCanvas(canvas, "invert(" + k + ")");
return;
}
const ok = mapPixels(canvas, (r, g, b) => [
clamp255(r + (255 - 2 * r) * k),
clamp255(g + (255 - 2 * g) * k),
clamp255(b + (255 - 2 * b) * k)
]);
if (!ok) blendFallback(canvas, "invert", k);
}
},
gray: {
@@ -3912,7 +3923,17 @@ var __IWB_ANNOTATE_MANIFEST__ = {
step: 1,
def: () => 100,
render: (canvas, v) => {
if (v > 0) filterCanvas(canvas, "grayscale(" + v / 100 + ")");
if (v <= 0) return;
const k = v / 100;
if (FILTER_SUPPORTED) {
filterCanvas(canvas, "grayscale(" + k + ")");
return;
}
const okGray = mapPixels(canvas, (r, g, b) => {
const y = luma(r, g, b);
return [clamp255(r + (y - r) * k), clamp255(g + (y - g) * k), clamp255(b + (y - b) * k)];
});
if (!okGray) blendFallback(canvas, "gray", k);
}
},
boost: {
@@ -3927,7 +3948,20 @@ var __IWB_ANNOTATE_MANIFEST__ = {
render: (canvas, v) => {
if (v <= 0) return;
const k = v / 100;
filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")");
if (FILTER_SUPPORTED) {
filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")");
return;
}
const bright = 1 + 0.4 * k, contrast = 1 + 0.25 * k, sat = 1 + 0.2 * k;
mapPixels(canvas, (r, g, b) => {
const y = luma(r, g, b);
const out = [r, g, b].map((c) => {
let v2 = y + (c - y) * sat;
v2 = (v2 - 128) * contrast + 128;
return clamp255(v2 * bright);
});
return out;
});
}
},
contrast: {
@@ -3942,7 +3976,17 @@ var __IWB_ANNOTATE_MANIFEST__ = {
render: (canvas, v) => {
if (v <= 0) return;
const k = v / 100;
filterCanvas(canvas, "grayscale(" + k.toFixed(3) + ") contrast(" + (1 + 1.6 * k).toFixed(3) + ")");
if (FILTER_SUPPORTED) {
filterCanvas(canvas, "grayscale(" + k.toFixed(3) + ") contrast(" + (1 + 1.6 * k).toFixed(3) + ")");
return;
}
const c = 1 + 1.6 * k;
mapPixels(canvas, (r, g, b) => {
const y = luma(r, g, b);
const gray = y * k + (r + g + b) / 3 * (1 - k);
const v2 = (gray - 128) * c + 128;
return [clamp255(v2), clamp255(v2), clamp255(v2)];
});
}
},
soft: {
@@ -3955,7 +3999,9 @@ var __IWB_ANNOTATE_MANIFEST__ = {
step: 0.5,
def: (canvas) => softRadius(canvas),
render: (canvas, v) => {
if (v > 0) filterCanvas(canvas, "blur(" + v + "px)");
if (v <= 0) return;
if (FILTER_SUPPORTED) filterCanvas(canvas, "blur(" + v + "px)");
else blurCanvas(canvas, v);
}
},
mosaic: {
@@ -3995,6 +4041,100 @@ var __IWB_ANNOTATE_MANIFEST__ = {
ctx.drawImage(tmp, 0, 0);
ctx.restore();
}
var FILTER_SUPPORTED = function() {
try {
const src = document.createElement("canvas");
src.width = 2;
src.height = 2;
const sctx = src.getContext("2d");
sctx.fillStyle = "#ff0000";
sctx.fillRect(0, 0, 2, 2);
const dst = document.createElement("canvas");
dst.width = 2;
dst.height = 2;
const dctx = dst.getContext("2d");
dctx.filter = "invert(1)";
dctx.drawImage(src, 0, 0);
const d = dctx.getImageData(0, 0, 1, 1).data;
return d[0] < 60 && d[1] > 180 && d[2] > 180;
} catch (e) {
return false;
}
}();
function mapPixels(canvas, fn) {
const w = canvas.width, h = canvas.height;
if (!w || !h) return false;
const ctx = canvas.getContext("2d", { willReadFrequently: true });
let img;
try {
img = ctx.getImageData(0, 0, w, h);
} catch (e) {
return false;
}
const d = img.data;
for (let i = 0; i < d.length; i += 4) {
if (d[i + 3] === 0) continue;
const out = fn(d[i], d[i + 1], d[i + 2]);
d[i] = out[0];
d[i + 1] = out[1];
d[i + 2] = out[2];
}
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.putImageData(img, 0, 0);
return true;
}
function blendFallback(canvas, mode, strength) {
const k = typeof strength === "number" ? Math.max(0, Math.min(1, strength)) : 1;
const ctx = canvas.getContext("2d");
const copy = document.createElement("canvas");
copy.width = canvas.width;
copy.height = canvas.height;
copy.getContext("2d").drawImage(canvas, 0, 0);
ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.globalAlpha = 1;
if (mode === "invert") {
ctx.globalCompositeOperation = "difference";
ctx.fillStyle = "#ffffff";
} else {
ctx.globalCompositeOperation = "saturation";
ctx.fillStyle = "#808080";
}
ctx.fillRect(0, 0, canvas.width, canvas.height);
if (k < 1) {
ctx.globalCompositeOperation = "source-over";
ctx.globalAlpha = 1 - k;
ctx.drawImage(copy, 0, 0);
}
ctx.restore();
}
function luma(r, g, b) {
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
}
function clamp255(v) {
return v < 0 ? 0 : v > 255 ? 255 : v;
}
function blurCanvas(canvas, radius) {
const w = canvas.width, h = canvas.height;
if (!w || !h || radius <= 0) return;
const n = Math.max(2, Math.min(16, Math.round(radius * 1.6)));
const sw = Math.max(1, Math.round(w / n));
const sh = Math.max(1, Math.round(h / n));
const tmp = document.createElement("canvas");
tmp.width = sw;
tmp.height = sh;
const tctx = tmp.getContext("2d");
tctx.imageSmoothingEnabled = true;
tctx.drawImage(canvas, 0, 0, sw, sh);
const ctx = canvas.getContext("2d");
ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.globalAlpha = 1;
ctx.globalCompositeOperation = "copy";
ctx.imageSmoothingEnabled = true;
ctx.drawImage(tmp, 0, 0, w, h);
ctx.restore();
}
function pixelateCanvas(canvas, block) {
const w = canvas.width, h = canvas.height;
if (!w || !h) return;
@@ -4072,7 +4212,12 @@ var __IWB_ANNOTATE_MANIFEST__ = {
ctx.imageSmoothingEnabled = true;
ctx.drawImage(st.source, 0, 0);
ctx.restore();
fx.render(target.canvas, value);
try {
fx.render(target.canvas, value);
} catch (e) {
toast("效果失败:" + (e && e.message || e), "error");
throw e;
}
target._bounds = void 0;
S.pickerComposite = null;
}
+2
View File
@@ -36,6 +36,7 @@ const sourceModules = [
'clipboard-paste.js',
'clipboard-copy.js',
'clipboard-paste-once.js',
'clipboard-native.js',
'generation-size-policy.js',
'generation-request-shape.js',
'image-preview-derive.js',
@@ -88,6 +89,7 @@ const sourceModules = [
'generation-results-store.js',
'ui-groups-sidebar.js',
'ui-lib-sidebar.js',
'ui-desktop-shell.js',
'ui-workspace-tabs.js',
'ui-app-chrome.js',
'ui-workbench-hooks.js',
+55 -6
View File
@@ -7,7 +7,7 @@ const path = require('path')
const root = path.resolve(__dirname, '..')
const inFile = process.argv[2] || path.join(root, 'site', 'releases.json')
const outFile = process.argv[3] || path.join(root, 'site', 'index.html')
const outFile = process.argv[3] || path.join(root, 'site', 'download', 'index.html')
const data = JSON.parse(fs.readFileSync(inFile, 'utf8'))
const PLATFORMS = [
@@ -55,12 +55,11 @@ const html = `<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>${esc(data.app)} · 下载</title>
<link rel="stylesheet" href="/assets/style.css?v=" + encodeURIComponent(latest.version + '-' + Date.now().toString(36)) + "">
<style>
:root{--bg:#fafaf9;--fg:#1c1917;--muted:#78716c;--line:#e7e5e4;--card:#fff;--brand:#1c1917}
@media (prefers-color-scheme:dark){:root{--bg:#17161a;--fg:#f5f5f4;--muted:#a8a29e;--line:#2f2d33;--card:#1f1e23;--brand:#f5f5f4}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.wrap{max-width:760px;margin:0 auto;padding:56px 22px 72px}
.dlwrap{max-width:760px;margin:0 auto;padding:48px 0 64px}
h1{font-size:27px;margin:0 0 6px;letter-spacing:-.01em}
.sub{color:var(--muted);margin:0 0 34px}
h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:38px 0 2px}
@@ -76,10 +75,30 @@ const html = `<!doctype html>
.foot{margin-top:46px;color:var(--muted);font-size:12.5px;line-height:1.8}
.foot a{color:inherit}
code{font-size:12.5px}
.steps{margin:6px 0 0;padding-left:22px;color:var(--fg2);font-size:13.5px;line-height:1.9}
.steps li{margin:2px 0}
.steps b{color:var(--fg);font-weight:600}
pre.cmd{margin:10px 0 0;padding:10px 12px;background:var(--bg2);border:1px solid var(--line);border-radius:8px;overflow-x:auto}
pre.cmd code{font-size:12px;color:var(--fg)}
.note{margin:10px 0 0;color:var(--muted);font-size:12.5px;line-height:1.8}
</style>
</head>
<body>
<div class="wrap">
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
<div class="links">
<a href="/">首页</a>
<a href="/download/" class="on">下载</a>
<a href="/plugins/">插件</a>
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载</a>
</div>
</div></nav>
<div class="wrap"><div class="dlwrap">
<h1>${esc(data.app)}</h1>
<p class="sub">${esc(data.subtitle || '')}</p>
@@ -93,15 +112,45 @@ ${PLATFORMS.map((p) => platformRow(latest, p)).join('\n')}
</div>
</div>
<h2>安装步骤(macOS)</h2>
<ol class="steps">
<li>下载上面的 <b>.dmg</b>(Apple 芯片选 Apple Silicon;老 Intel 机器选 Intel)。</li>
<li>双击打开 dmg,把 <b>Image Workbench</b> 图标拖进「应用程序」文件夹。</li>
<li>第一次启动:打开「应用程序」,<b>右键点图标 → 打开</b>,弹窗里再点一次「打开」。</li>
<li>如果提示「已损坏」或「无法验证开发者」:打开「终端」,粘贴执行下面这条命令,然后重新打开应用。</li>
</ol>
<pre class="cmd"><code>xattr -dr com.apple.quarantine "/Applications/image-workbench.app"</code></pre>
<p class="note">说明:安装包未做 Apple 公证($99/年开发者账号),所以第一次需要手动放行;这一步只做一次。<br>
之后有新版本时,应用内 <b>设置 → 通用 → 版本与更新 → 检查更新</b> 就能一键升级,不用再下载安装包。</p>
<h2>安装步骤(Windows)</h2>
<ol class="steps">
<li>下载 <b>.exe</b>(NSIS 安装包,按当前用户安装,不需要管理员权限)。</li>
<li>双击运行;若出现「Windows 已保护你的电脑」,点「更多信息 → 仍要运行」。</li>
<li>安装完成后从开始菜单启动;数据在 <code>%USERPROFILE%\Documents\ImageWorkbench</code>。</li>
</ol>
<h2>历史版本</h2>
${history}
<div class="foot">
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 ${esc((data.updatedAt || '').slice(0, 10))}
</div>
</div>
</div></div>
<footer><div class="wrap">
<div class="cols">
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
</div>
<div class="copy"><span>© Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
</div></footer>
</body>
</html>
`
fs.mkdirSync(path.dirname(outFile), { recursive: true })
fs.writeFileSync(outFile, html)
console.log('已生成 ' + path.relative(root, outFile) + '(' + data.releases.length + ' 个版本 / ' + Object.keys((latest && latest.platforms) || {}).length + ' 个平台)')
+116
View File
@@ -0,0 +1,116 @@
#!/usr/bin/env node
'use strict'
// 站点生成器:用 site/_home.tpl.html 与 site/_plugins.tpl.html 渲染首页 / 插件页,
// 数据来自 site/releases.json(版本)与 market/index.json(插件)。
const fs = require('fs')
const path = require('path')
const root = path.resolve(__dirname, '..')
const site = path.join(root, 'site')
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]))
const mb = (n) => (Number(n) / 1048576).toFixed(1) + ' MB'
const data = JSON.parse(fs.readFileSync(path.join(site, 'releases.json'), 'utf8'))
const rel = Array.isArray(data.releases) ? data.releases.slice() : (Array.isArray(data) ? data.slice() : [])
rel.sort((a, b) => String(b.version).localeCompare(String(a.version), undefined, { numeric: true }))
const latest = rel[0] || { version: '', platforms: {} }
const V = esc(latest.version)
const STAMP = encodeURIComponent(V + '-' + Date.now().toString(36))
const marketFile = path.join(root, 'market', 'index.json')
const market = fs.existsSync(marketFile) ? JSON.parse(fs.readFileSync(marketFile, 'utf8')) : { plugins: [] }
const plugins = Array.isArray(market.plugins) ? market.plugins : []
const nav = (active) => [
'<nav><div class="wrap inner">',
' <a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>',
' <div class="links">',
' <a href="/"' + (active === 'home' ? ' class="on"' : '') + '>首页</a>',
' <a href="/download/"' + (active === 'download' ? ' class="on"' : '') + '>下载</a>',
' <a href="/plugins/"' + (active === 'plugins' ? ' class="on"' : '') + '>插件</a>',
' <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>',
' </div>',
' <div class="right">',
' <a class="btn" href="/plugins/">插件市场</a>',
' <a class="btn primary" href="/download/">下载 v' + V + '</a>',
' </div>',
'</div></nav>',
].join('\n')
const footer = [
'<footer><div class="wrap">',
' <div class="cols">',
' <div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>',
' <div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>',
' <div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>',
' <div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>',
' <div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>',
' </div>',
' <div class="copy"><span>© ' + new Date().getFullYear() + ' Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>',
'</div></footer>',
].join('\n')
const card = (p) => [
' <div class="pcard" data-name="' + esc((p.name + ' ' + p.id + ' ' + (p.desc || '') + ' ' + (p.tags || []).join(' ')).toLowerCase()) + '" data-tags="' + esc((p.tags || []).join(',')) + '">',
' <div class="head"><span class="av" style="background:' + esc(p.color || '#eef2f6') + '">' + esc(p.icon || '◻') + '</span>',
' <div><div class="nm">' + esc(p.name || p.id) + '</div><div class="ver">v' + esc(p.version || '') + ' · ' + esc(p.author === 'official' ? '官方' : (p.author || '')) + '</div></div></div>',
' <div class="desc">' + esc(p.desc || '') + '</div>',
' <div class="tags">' + (p.tags || []).map((t) => '<span class="tag">' + esc(t) + '</span>').join('') + '</div>',
' </div>',
].join('\n')
const feats = [
['💻', '#eef2ff', '本地优先', '图片与数据保存在 ~/Documents/ImageWorkbench,不经服务器中转;可整目录备份、迁移到新电脑。'],
['🕸️', '#fff7ed', '节点式无限画布', '参考图 → 提示词 → 生成 → 图库,用连线把工作流串起来;一张画布容纳整条生产线。'],
['🧩', '#ecfdf5', '插件按需安装', '应用本体不含插件,需要什么装什么;可随时启停,关闭后入口自动隐藏。'],
]
const featCards = feats.map((f) => [
' <div class="card"><div class="ico" style="background:' + f[1] + '">' + f[0] + '</div>',
' <h3>' + f[2] + '</h3><p>' + f[3] + '</p></div>',
].join('\n')).join('\n')
const dlCards = [
['darwin-aarch64', 'macOS · Apple Silicon', 'M1 / M2 / M3 / M4'],
['darwin-x86_64', 'macOS · Intel', 'x86_64'],
['windows-x86_64', 'Windows · x64', '需要 WebView2'],
].map(([key, label, hint]) => {
const p = (latest.platforms || {})[key]
if (!p) return '<div class="none"><div class="n">' + label + '</div><div class="s">暂未提供</div></div>'
return '<a href="/' + esc(p.file) + '"><div class="n">' + label + '</div><div class="s">' + hint + ' · ' + mb(p.size) + ' · .' + esc(String(p.file).split('.').pop()) + '</div></a>'
}).join('\n ')
const tags = []
for (const p of plugins) for (const t of (p.tags || [])) if (tags.indexOf(t) < 0) tags.push(t)
const tagChips = tags.map((t) => '<button class="tag" data-tag="' + esc(t) + '" style="cursor:pointer;padding:5px 12px">' + esc(t) + '</button>').join('\n ')
function render(tpl, map) {
let out = fs.readFileSync(path.join(site, tpl), 'utf8')
for (const k of Object.keys(map)) out = out.split('<!--' + k + '-->').join(map[k])
return out
}
let home = render('_home.tpl.html', {
NAV: nav('home'),
FOOTER: footer,
VERSION: V,
PLUGIN_COUNT: String(plugins.length),
FEAT_CARDS: featCards,
PLUGIN_CARDS: plugins.slice(0, 6).map((p) => card(p).replace(/^\s+/, ' ')).join('\n'),
DL_CARDS: dlCards,
})
home = home.replace('/assets/style.css', '/assets/style.css?v=' + STAMP).replace('/assets/painting.jpg', '/assets/painting.jpg?v=' + STAMP)
fs.writeFileSync(path.join(site, 'index.html'), home)
let pluginsPage = render('_plugins.tpl.html', {
NAV: nav('plugins'),
FOOTER: footer,
PLUGIN_COUNT: String(plugins.length),
TAG_CHIPS: tagChips,
PLUGIN_CARDS: plugins.map(card).join('\n'),
})
fs.mkdirSync(path.join(site, 'plugins'), { recursive: true })
pluginsPage = pluginsPage.replace('/assets/style.css', '/assets/style.css?v=' + STAMP)
fs.writeFileSync(path.join(site, 'plugins', 'index.html'), pluginsPage)
fs.writeFileSync(path.join(site, 'plugins-index.json'), JSON.stringify(market, null, 2) + '\n')
console.log('站点已生成:首页 / 插件页(' + plugins.length + ' 个插件,' + tags.length + ' 个标签,版本 v' + V + ')')
+12
View File
@@ -54,6 +54,18 @@ echo "== 4/4 生成 latest.json"
export SIG_ARM="$(cat "$ARM/macos/image-workbench.app.tar.gz.sig")"
export SIG_INT="$(cat "$INT/macos/image-workbench.app.tar.gz.sig")"
export UPD_VERSION="$V"
# Windows 包单独构建:全局 version 提升后,旧 windows 条目会变成「声明新版本、实际旧安装包」,
# 客户端会因 app-version 绑定不一致而拒绝安装。所以每次发布 mac 时明确提示并丢弃过期的非 darwin 条目,
# 等 Windows 包跟上再用 publish-windows-update.sh 合并回来。
curl -s -m 20 https://download.maqiart.eu.org/updates/latest.json -o /tmp/iwb-latest-prev.json 2>/dev/null || echo '{}' > /tmp/iwb-latest-prev.json
node -e '
const fs = require("fs")
let prev = {}
try { prev = JSON.parse(fs.readFileSync("/tmp/iwb-latest-prev.json", "utf8")) } catch (e) { prev = {} }
const stale = (prev.platforms ? Object.keys(prev.platforms) : []).filter(function (k) { return k.indexOf("darwin-") !== 0 && prev.version !== process.env.UPD_VERSION })
if (stale.length) console.log("将丢弃过期的非 darwin 平台条目:" + stale.join(","))
'
node -e '
const fs = require("fs")
const v = process.env.UPD_VERSION
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env bash
# 发布 Windows 更新:对 Windows 侧构建好的 *-setup.exe 重新签名(用本机正式私钥),
# 上传到 NAS,并把 windows-x86_64 条目合并进 updates/latest.json。
#
# 用法:./scripts/publish-windows-update.sh "/path/to/image-workbench_3.25.3_x64-setup.exe"
#
# 背景(Tauri v2):Windows 的更新产物就是安装包本体 + 同名 .sig,没有 v1 的 *.nsis.zip。
# Windows 机器只需把 setup.exe 发过来,签名与发布都在本机完成,私钥不外传。
set -euo pipefail
cd "$(dirname "$0")/.."
EXE_IN="${1:?用法: publish-windows-update.sh <setup.exe 路径>}"
[ -f "$EXE_IN" ] || { echo "找不到文件:$EXE_IN"; exit 1; }
V=$(node -e "console.log(require('./package.json').version)")
KEY="${TAURI_SIGNING_PRIVATE_KEY:-$HOME/.config/iwb-updater.key}"
NAS_HOST="${NAS_HOST:-malongan@192.168.100.185}"
NAS_DIR="${NAS_DIR:-/vol8/web/iwb-download}"
SSH_KEY="${SSH_KEY:-$HOME/.ssh/id_ed25519_fnos}"
SCP="scp -i $SSH_KEY -o BatchMode=yes"
WORK=$(mktemp -d)
OUT="$WORK/image-workbench_${V}_x64-setup.exe"
cp "$EXE_IN" "$OUT"
echo "== 1/4 校验文件"
SIZE=$(stat -f%z "$OUT")
SHA=$(shasum -a 256 "$OUT" | awk '{print $1}')
echo " $OUT"
echo " size=$SIZE sha256=$SHA"
echo "== 2/4 用正式私钥签名"
npx tauri signer sign -f "$KEY" -p "${TAURI_SIGNING_PRIVATE_KEY_PASSWORD:-}" --app-version "$V" "$OUT" >/dev/null
SIG_FILE="$OUT.sig"
[ -f "$SIG_FILE" ] || { echo "签名失败:没有产出 $SIG_FILE"; exit 1; }
echo " .sig $(wc -c < "$SIG_FILE" | tr -d ' ') 字节"
echo "== 3/4 上传到 NAS"
ssh -i "$SSH_KEY" -o BatchMode=yes "$NAS_HOST" "mkdir -p $NAS_DIR/updates/windows-x86_64"
$SCP "$OUT" "$SIG_FILE" "$NAS_HOST:$NAS_DIR/updates/windows-x86_64/"
echo "== 4/4 合并 latest.json"
SIG=$(cat "$SIG_FILE")
URL="https://download.maqiart.eu.org/updates/windows-x86_64/image-workbench_${V}_x64-setup.exe"
export SIG URL APP_VERSION="$V"
curl -s -m 20 https://download.maqiart.eu.org/updates/latest.json -o "$WORK/latest.json" || echo '{}' > "$WORK/latest.json"
node -e '
const fs = require("fs")
const p = process.argv[1]
let cur = {}
try { cur = JSON.parse(fs.readFileSync(p, "utf8")) } catch (e) { cur = {} }
cur.version = process.env.APP_VERSION
cur.notes = cur.notes || "在线更新"
cur.pub_date = new Date().toISOString()
cur.platforms = cur.platforms || {}
cur.platforms["windows-x86_64"] = { signature: process.env.SIG, url: process.env.URL }
fs.writeFileSync(p, JSON.stringify(cur, null, 2))
console.log(" platforms:", Object.keys(cur.platforms).join(", "))
' "$WORK/latest.json"
$SCP "$WORK/latest.json" "$NAS_HOST:$NAS_DIR/updates/latest.json"
ssh -i "$SSH_KEY" -o BatchMode=yes "$NAS_HOST" "chmod -R a+rX $NAS_DIR"
echo "== 完成"
curl -s -m 20 https://download.maqiart.eu.org/updates/latest.json | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{const j=JSON.parse(s);console.log("version",j.version);for(const k of Object.keys(j.platforms))console.log(" -",k,"sig",(j.platforms[k].signature||"").length,"bytes")})'
curl -s -o /dev/null -m 60 -w "exe:%{http_code} size:%{size_download}\n" "$URL"
+82
View File
@@ -0,0 +1,82 @@
<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Image Workbench · 本地优先的 AI 生图工作台</title>
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
<link rel="stylesheet" href="/assets/style.css">
</head><body>
<!--NAV-->
<main>
<section class="hero hero-art">
<div class="hero-bg"><img src="/assets/painting.jpg" alt=""></div>
<div class="hero-veil"></div>
<div class="wrap">
<span class="kicker">v<!--VERSION--> · macOS / Windows · 数据在本地</span>
<h1>本地优先的<br>AI 生图无限画布</h1>
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
<div class="cta">
<a class="btn primary lg" href="/download/">下载 v<!--VERSION--></a>
<a class="btn lg" href="/plugins/">浏览 <!--PLUGIN_COUNT--> 个插件</a>
</div>
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
</div></section>
<section class="section"><div class="wrap">
<h2>为「一个人跑完整条产线」而做</h2>
<p class="lead">不做又一个在线生图站点。它活在你的桌面上,把生图、修图、批量、图库和插件放在同一张画布上。</p>
<div class="grid c3">
<!--FEAT_CARDS-->
</div>
</div></section>
<section class="section"><div class="wrap">
<h2>插件:本体不带,需要的自己装</h2>
<p class="lead">应用本体不再内置插件。设置里打开市场,点「安装」,重启即可用;不需要的点一下就能关掉。</p>
<div class="grid c3">
<!--PLUGIN_CARDS-->
</div>
<div style="margin-top:22px"><a class="btn" href="/plugins/">查看全部 <!--PLUGIN_COUNT--> 个插件</a></div>
</div></section>
<section class="section"><div class="wrap">
<h2>下载 Image Workbench</h2>
<p class="lead">选你的平台。装过一次之后,以后在应用内「设置 → 通用 → 版本与更新」就能一键升级。</p>
<div class="dl"><!--DL_CARDS--></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>
</main>
<!--FOOTER-->
</body></html>
<script>
(function () {
var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches
var targets = [].slice.call(document.querySelectorAll('.section h2, .section p.lead, .card, .pcard, .dl a'))
targets.forEach(function (el) { el.classList.add('reveal') })
if (!reduce && 'IntersectionObserver' in window) {
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (e) {
if (!e.isIntersecting) return
var el = e.target
var idx = targets.indexOf(el) % 4
el.style.transitionDelay = (idx * 60) + 'ms'
el.classList.add('in')
io.unobserve(el)
})
}, { rootMargin: '0px 0px -8% 0px', threshold: 0.12 })
targets.forEach(function (el) { io.observe(el) })
} else { targets.forEach(function (el) { el.classList.add('in') }) }
var art = document.querySelector('.art-frame')
if (art && !reduce) {
var raf = 0
var onScroll = function () {
if (raf) return
raf = requestAnimationFrame(function () {
raf = 0
var y = Math.min(1, Math.max(0, window.scrollY / 700))
art.style.transform = 'translate3d(0,' + (y * -14) + 'px,0)'
})
}
window.addEventListener('scroll', onScroll, { passive: true }); onScroll()
}
})()
</script>
+45
View File
@@ -0,0 +1,45 @@
<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>插件市场 · Image Workbench</title>
<link rel="stylesheet" href="/assets/style.css">
</head><body>
<!--NAV-->
<main>
<section class="hero" style="padding:64px 0 8px;text-align:left"><div class="wrap">
<h1 style="font-size:40px;margin:0">插件市场</h1>
<p class="sub" style="margin:14px 0 0;text-align:left;max-width:720px">共 <!--PLUGIN_COUNT--> 个插件。安装方式:应用内 <b>设置 → 插件 → 浏览</b>,点「安装」后重启生效。</p>
</div></section>
<section class="section" style="border-top:0;padding-top:24px"><div class="wrap">
<div style="display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px" id="chips">
<button class="tag on" data-tag="" style="cursor:pointer;background:#111;color:#fff;border-color:#111;padding:5px 12px">全部</button>
<!--TAG_CHIPS-->
</div>
<input id="q" placeholder="搜索插件,例如:出图、抠图、矢量…" style="width:100%;max-width:420px;height:40px;padding:0 14px;border:1px solid var(--line);border-radius:10px;font-size:14px;outline:none;margin-bottom:22px">
<div class="grid c3" id="list">
<!--PLUGIN_CARDS-->
</div>
<div class="note" style="margin-top:26px">插件安装后会写进你的资料目录 <code>~/Documents/ImageWorkbench/plugins/</code>;卸载只删插件文件,不动画布与图库。</div>
</div></section>
</main>
<!--FOOTER-->
<script>
var q = document.getElementById('q'), list = document.getElementById('list'), chips = document.getElementById('chips'), activeTag = ''
function apply () {
var kw = (q.value || '').trim().toLowerCase()
Array.prototype.forEach.call(list.children, function (el) {
var okKw = !kw || el.dataset.name.indexOf(kw) >= 0
var okTag = !activeTag || (',' + el.dataset.tags + ',').indexOf(',' + activeTag + ',') >= 0
var ok = okKw && okTag
el.style.display = ok ? '' : 'none'
})
}
q.addEventListener('input', apply)
chips.addEventListener('click', function (e) {
var b = e.target.closest('button[data-tag]'); if (!b) return
Array.prototype.forEach.call(chips.children, function (x) { x.style.background = ''; x.style.color = ''; x.style.borderColor = 'transparent' })
b.style.background = '#111'; b.style.color = '#fff'; b.style.borderColor = '#111'
activeTag = b.dataset.tag || ''
apply()
})
</script>
</body></html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

+141
View File
@@ -0,0 +1,141 @@
:root{--fg:#111;--muted:#6b7280;--line:#ebebeb;--soft:#f7f7f8;--radius:16px}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:#fff;color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
.wrap{max-width:1120px;margin:0 auto;padding:0 24px}
nav{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.82);backdrop-filter:saturate(1.6) blur(12px);border-bottom:1px solid var(--line)}
nav .inner{display:flex;align-items:center;gap:26px;height:60px}
nav .brand{display:flex;align-items:center;gap:9px;font-weight:650;letter-spacing:-.01em}
nav .brand .dot{width:22px;height:22px;border-radius:6px;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:700}
nav .links{display:flex;gap:20px;margin-left:8px;color:var(--muted);font-size:14px}
nav .links a:hover{color:var(--fg)}
nav .links a.on{color:var(--fg)}
nav .right{margin-left:auto;display:flex;align-items:center;gap:10px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:38px;padding:0 18px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--fg);font-size:14px;font-weight:550;cursor:pointer;transition:.15s}
.btn:hover{border-color:#d4d4d4;background:#fafafa}
.btn.primary{background:#111;color:#fff;border-color:#111}
.btn.primary:hover{background:#000}
.btn.lg{height:44px;padding:0 22px;font-size:15px}
.hero{padding:84px 0 20px;text-align:center}
.kicker{display:inline-flex;align-items:center;gap:8px;padding:5px 12px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12.5px}
.hero h1{font-size:56px;line-height:1.08;letter-spacing:-.03em;margin:22px 0 0;font-weight:700}
.hero p.sub{max-width:660px;margin:20px auto 0;color:var(--muted);font-size:17px;line-height:1.75}
.hero .cta{display:flex;gap:12px;justify-content:center;margin-top:30px;flex-wrap:wrap}
.hero .meta{margin-top:16px;color:#9ca3af;font-size:12.5px}
.shot{margin:40px 0 0;padding:0 0 64px}
.shot img{width:100%;display:block;border-radius:var(--radius);border:1px solid var(--line);box-shadow:0 30px 70px -30px rgba(15,23,42,.35)}
.section{padding:72px 0;border-top:1px solid var(--line)}
.section h2{font-size:30px;letter-spacing:-.02em;margin:0 0 8px;font-weight:680}
.section p.lead{color:var(--muted);margin:0 0 34px;max-width:660px}
.grid{display:grid;gap:16px}
.grid.c3{grid-template-columns:repeat(3,1fr)}
.grid.c2{grid-template-columns:repeat(2,1fr)}
.card{border:1px solid var(--line);border-radius:var(--radius);padding:22px;background:#fff}
.card h3{margin:0 0 6px;font-size:16px;font-weight:650}
.card p{margin:0;color:var(--muted);font-size:13.5px;line-height:1.7}
.card .ico{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;margin-bottom:14px}
.pcard{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:14px;padding:18px;background:#fff}
.pcard .head{display:flex;gap:10px;align-items:center}
.pcard .av{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:17px;flex:0 0 34px}
.pcard .nm{font-weight:640;font-size:14.5px}
.pcard .ver{color:var(--muted);font-size:12px;margin-top:1px}
.pcard .desc{color:var(--muted);font-size:13px;line-height:1.65;flex:1 1 auto}
.tags{display:flex;gap:6px;flex-wrap:wrap}
.tag{padding:1px 8px;border-radius:999px;background:var(--soft);color:var(--muted);font-size:11.5px;border:1px solid transparent;font-family:inherit}
.dl{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.dl a{border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:4px;transition:.15s}
.dl a:hover{border-color:#d4d4d4;background:#fafafa}
.dl .n{font-weight:640}
.dl .s{color:var(--muted);font-size:12.5px}
.dl .none{border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:4px;opacity:.55}
footer{background:#0b0b0c;color:#9ca3af;padding:52px 0 40px}
footer .cols{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:24px}
footer h4{color:#fff;font-size:13px;margin:0 0 10px;font-weight:600}
footer a{display:block;color:#9ca3af;font-size:13px;margin:6px 0}
footer a:hover{color:#fff}
footer .copy{border-top:1px solid #1f1f22;margin-top:34px;padding-top:18px;font-size:12px;color:#6b7280;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
.steps{margin:6px 0 0;padding-left:20px;color:var(--muted);font-size:13.5px;line-height:1.9}
.steps b{color:var(--fg)}
pre.cmd{margin:10px 0 0;padding:10px 12px;background:var(--soft);border:1px solid var(--line);border-radius:8px;overflow-x:auto}
pre.cmd code{font-size:12.5px}
.note{margin:10px 0 0;color:var(--muted);font-size:12.5px;line-height:1.8}
@media(max-width:900px){.hero h1{font-size:38px}.grid.c3,.dl{grid-template-columns:1fr 1fr}footer .cols{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.grid.c3,.grid.c2,.dl{grid-template-columns:1fr}nav .links{display:none}}
/* ── 油画主视觉 + 特效 ───────────────────────────────── */
.artwrap{position:relative;max-width:1120px;margin:26px auto 0;padding:0 24px 72px}
.art-glow{position:absolute;inset:-40px 0 auto 0;height:520px;pointer-events:none;
background:
radial-gradient(46% 60% at 22% 40%, rgba(255,178,92,.28), transparent 70%),
radial-gradient(40% 55% at 78% 30%, rgba(58,120,140,.22), transparent 70%),
radial-gradient(60% 70% at 50% 0%, rgba(255,214,150,.35), transparent 72%);
filter:blur(10px);opacity:.9;animation:glowPulse 12s ease-in-out infinite alternate}
.art-frame{position:relative;border-radius:22px;overflow:hidden;border:1px solid var(--line);
box-shadow:0 40px 90px -40px rgba(15,23,42,.45)}
.art-frame .art{display:block;width:100%;height:auto;transform:scale(1.02);animation:kenburns 28s ease-in-out infinite alternate}
.art-frame .grain{position:absolute;inset:0;pointer-events:none;opacity:.14;mix-blend-mode:multiply;
background-image:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")}
.art-frame:after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:22px;box-shadow:inset 0 0 120px rgba(120,80,30,.16)}
@keyframes kenburns{from{transform:scale(1.02) translate3d(0,0,0)}to{transform:scale(1.08) translate3d(-1.2%,-1%,0)}}
@keyframes glowPulse{from{opacity:.72;transform:translateY(0)}to{opacity:1;transform:translateY(-10px)}}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
.hero h1,.hero p.sub,.hero .cta,.hero .meta,.hero .kicker{animation:rise .7s cubic-bezier(.22,.61,.36,1) both}
.hero h1{animation-delay:.04s}.hero p.sub{animation-delay:.1s}.hero .cta{animation-delay:.16s}.hero .meta{animation-delay:.22s}
.artwrap{animation:rise .9s cubic-bezier(.22,.61,.36,1) .18s both}
.card,.pcard,.dl a{transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease}
.card:hover,.pcard:hover{transform:translateY(-3px);box-shadow:0 16px 40px -24px rgba(15,23,42,.38);border-color:#dcdcdc}
.dl a:hover{transform:translateY(-2px);box-shadow:0 16px 40px -24px rgba(15,23,42,.35)}
.section h2:after{content:"";display:block;width:36px;height:3px;border-radius:2px;margin-top:12px;background:linear-gradient(90deg,#e8a735,#3a788c)}
@media (prefers-reduced-motion:reduce){
.hero h1,.hero p.sub,.hero .cta,.hero .meta,.hero .kicker,.artwrap,.art-frame .art,.art-glow{animation:none!important}
.card:hover,.pcard:hover,.dl a:hover{transform:none}
}
/* 主视觉改为宽幅裁切:突出画面中段的油彩笔触 */
.art-frame{aspect-ratio:auto}
.art-frame .art{width:100%;height:clamp(300px,40vw,540px);object-fit:cover;object-position:50% 62%}
.art-frame:before{content:"";position:absolute;left:0;right:0;bottom:0;height:38%;pointer-events:none;z-index:2;
background:linear-gradient(to top, rgba(255,255,255,.92), rgba(255,255,255,.35) 45%, transparent)}
/* ── 滚动入场 + 视差 ───────────────────────────────── */
.reveal{opacity:0;transform:translateY(18px);transition:opacity .7s cubic-bezier(.22,.61,.36,1),transform .7s cubic-bezier(.22,.61,.36,1)}
.reveal.in{opacity:1;transform:none}
.section h2.reveal.in:after{animation:barIn .7s ease both}
@keyframes barIn{from{width:0}to{width:36px}}
.art-frame{will-change:transform}
@media (prefers-reduced-motion:reduce){.reveal{opacity:1;transform:none;transition:none}}
/* 首屏露出更多油彩:裁切位置上移 + 收紧 hero 间距 */
.hero{padding:64px 0 8px}
.art-frame .art{object-position:50% 34%}
.artwrap{margin-top:14px}
/* ── 首屏:油画做背景(白纱压一层,保证文字可读) ─────────── */
.hero-art{position:relative;padding:76px 0 96px;overflow:hidden}
.hero-bg{position:absolute;inset:0;z-index:0;overflow:hidden}
.hero-bg img{width:100%;height:100%;object-fit:cover;object-position:50% 58%;transform:scale(1.06);animation:kenburns 30s ease-in-out infinite alternate;filter:saturate(1.05)}
.hero-veil{position:absolute;inset:0;z-index:1;
background:
radial-gradient(70% 60% at 50% 38%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.72) 42%, rgba(255,255,255,.1) 100%),
linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.55) 46%, rgba(255,255,255,.28) 72%, #fff 100%)}
.hero-art .wrap{position:relative;z-index:2}
.art-strip{position:relative;height:150px;overflow:hidden;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
background:url('/assets/painting.jpg') center 62%/cover no-repeat}
.art-strip:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.85),rgba(255,255,255,.15) 40%,rgba(255,255,255,.85))}
.art-strip .grain{position:absolute;inset:0;opacity:.12;mix-blend-mode:multiply;
background-image:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")}
/* 可读性微调:背景轻微模糊 + 更强的白纱,meta 加深 */
.hero-bg img{filter:blur(1.5px) saturate(1.05)}
.hero-veil{background:
radial-gradient(62% 58% at 50% 40%, rgba(255,255,255,.96) 0%, rgba(255,255,255,.86) 46%, rgba(255,255,255,.32) 100%),
linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.66) 50%, rgba(255,255,255,.35) 76%, #fff 100%)}
.hero .meta{color:#6b7280}
.hero-art{padding:72px 0 84px}
/* 头图白纱减淡:让油画色彩多透出来一点(文字仍保持可读) */
.hero-bg img{filter:blur(1px) saturate(1.06)}
.hero-veil{background:
radial-gradient(62% 58% at 50% 40%, rgba(255,255,255,.86) 0%, rgba(255,255,255,.70) 46%, rgba(255,255,255,.16) 100%),
linear-gradient(180deg, rgba(255,255,255,.84) 0%, rgba(255,255,255,.52) 50%, rgba(255,255,255,.20) 76%, #fff 100%)}
+174
View File
@@ -0,0 +1,174 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Image Workbench · 下载</title>
<link rel="stylesheet" href="/assets/style.css?v=" + encodeURIComponent(latest.version + '-' + Date.now().toString(36)) + "">
<style>
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.dlwrap{max-width:760px;margin:0 auto;padding:48px 0 64px}
h1{font-size:27px;margin:0 0 6px;letter-spacing:-.01em}
.sub{color:var(--muted);margin:0 0 34px}
h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:38px 0 2px}
.row{display:flex;align-items:center;gap:16px;padding:15px 0;border-bottom:1px solid var(--line)}
.row:first-of-type{border-top:1px solid var(--line)}
.name{flex:1 1 auto;font-weight:550}
.hint{color:var(--muted);font-size:12.5px;font-weight:400;margin-top:2px}
.meta{flex:0 0 auto;text-align:right;color:var(--muted);font-size:13px}
.hash{font-size:11.5px;opacity:.75;margin-top:2px;font-variant-numeric:tabular-nums}
.btn{flex:0 0 auto;font-size:13px;padding:7px 18px;border-radius:8px;background:var(--brand);color:var(--bg);text-decoration:none}
.btn:hover{opacity:.88}
.muted{flex:0 0 auto;font-size:13px;color:var(--muted);opacity:.7}
.foot{margin-top:46px;color:var(--muted);font-size:12.5px;line-height:1.8}
.foot a{color:inherit}
code{font-size:12.5px}
.steps{margin:6px 0 0;padding-left:22px;color:var(--fg2);font-size:13.5px;line-height:1.9}
.steps li{margin:2px 0}
.steps b{color:var(--fg);font-weight:600}
pre.cmd{margin:10px 0 0;padding:10px 12px;background:var(--bg2);border:1px solid var(--line);border-radius:8px;overflow-x:auto}
pre.cmd code{font-size:12px;color:var(--fg)}
.note{margin:10px 0 0;color:var(--muted);font-size:12.5px;line-height:1.8}
</style>
</head>
<body>
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
<div class="links">
<a href="/">首页</a>
<a href="/download/" class="on">下载</a>
<a href="/plugins/">插件</a>
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载</a>
</div>
</div></nav>
<div class="wrap"><div class="dlwrap">
<h1>Image Workbench</h1>
<p class="sub">本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)</p>
<h2>下载</h2>
<div class="row">
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
<div class="meta">版本 3.25.13 · 7.6 MB · .dmg<div class="hash">sha256 863a5ff87a1debc0…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.13_aarch64.dmg">下载</a>
</div>
<div class="row">
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
<div class="meta">版本 3.25.13 · 7.9 MB · .dmg<div class="hash">sha256 25b4ad7237058ddd…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.13_x64.dmg">下载</a>
</div>
<div class="row">
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
<div class="meta"></div>
<span class="muted">暂未提供</span>
</div>
<h2>系统要求</h2>
<div class="row">
<div class="name">macOS 12 及以上 / Windows 10 1803 及以上(含 WebView2)
<div class="hint">数据全部保存在本地目录 <code>~/Documents/ImageWorkbench</code>,可整目录备份与迁移。</div>
</div>
</div>
<h2>安装步骤(macOS)</h2>
<ol class="steps">
<li>下载上面的 <b>.dmg</b>(Apple 芯片选 Apple Silicon;老 Intel 机器选 Intel)。</li>
<li>双击打开 dmg,把 <b>Image Workbench</b> 图标拖进「应用程序」文件夹。</li>
<li>第一次启动:打开「应用程序」,<b>右键点图标 → 打开</b>,弹窗里再点一次「打开」。</li>
<li>如果提示「已损坏」或「无法验证开发者」:打开「终端」,粘贴执行下面这条命令,然后重新打开应用。</li>
</ol>
<pre class="cmd"><code>xattr -dr com.apple.quarantine "/Applications/image-workbench.app"</code></pre>
<p class="note">说明:安装包未做 Apple 公证($99/年开发者账号),所以第一次需要手动放行;这一步只做一次。<br>
之后有新版本时,应用内 <b>设置 → 通用 → 版本与更新 → 检查更新</b> 就能一键升级,不用再下载安装包。</p>
<h2>安装步骤(Windows)</h2>
<ol class="steps">
<li>下载 <b>.exe</b>(NSIS 安装包,按当前用户安装,不需要管理员权限)。</li>
<li>双击运行;若出现「Windows 已保护你的电脑」,点「更多信息 → 仍要运行」。</li>
<li>安装完成后从开始菜单启动;数据在 <code>%USERPROFILE%DocumentsImageWorkbench</code>。</li>
</ol>
<h2>历史版本</h2>
<div class="row">
<div class="name">3.25.13<div class="hint">Intel 版:启动目录兜底</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.12<div class="hint">Intel 版:图片目录自愈 + 不回退 Cache</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.11<div class="hint">Windows:单实例 + 外链系统浏览器 + 原生通知 + 窗口下限 + 仅 nsis 产物</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.10<div class="hint">Intel 版:图片持久化修复</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.9<div class="hint">Windows:图片登记立即落盘 + 清理前报数</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.8<div class="hint">Intel 版:同图导入与图片清理修复</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.7<div class="hint">Windows:剪贴板 PNG 传输 + 路径文本转图片 + 大图不卡</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.6<div class="hint">Intel 版:粘贴语义修正</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.5<div class="hint">Intel 版:库面板粘贴修复</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.4<div class="hint">Intel 版:剪贴板兜底</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.3<div class="hint">Windows:剪贴板修复(Cmd+C/V、粘贴图片/文本、复制图片)+ 可自动更新</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.2<div class="hint">Windows:无内置插件 + 市场安装 + 页内确认 + 在线更新(首次需手动安装)</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.1<div class="hint">Intel Mac 版:性能与数据卫生(图库清单去 base64、缩略图落盘、回收 20.2MB)</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.0<div class="hint">应用不再内置插件(全部从市场安装);页内确认替代原生 confirm;插件市场与开发者模式</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.24.85<div class="hint">每张画布单独成文件、资源库分类、设置面板重构、下载改为按需落盘</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="foot">
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-18
</div>
</div></div>
<footer><div class="wrap">
<div class="cols">
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
</div>
<div class="copy"><span>© Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
</div></footer>
</body>
</html>
+140 -73
View File
@@ -1,78 +1,145 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Image Workbench · 下载</title>
<style>
:root{--bg:#fafaf9;--fg:#1c1917;--muted:#78716c;--line:#e7e5e4;--card:#fff;--brand:#1c1917}
@media (prefers-color-scheme:dark){:root{--bg:#17161a;--fg:#f5f5f4;--muted:#a8a29e;--line:#2f2d33;--card:#1f1e23;--brand:#f5f5f4}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.wrap{max-width:760px;margin:0 auto;padding:56px 22px 72px}
h1{font-size:27px;margin:0 0 6px;letter-spacing:-.01em}
.sub{color:var(--muted);margin:0 0 34px}
h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:38px 0 2px}
.row{display:flex;align-items:center;gap:16px;padding:15px 0;border-bottom:1px solid var(--line)}
.row:first-of-type{border-top:1px solid var(--line)}
.name{flex:1 1 auto;font-weight:550}
.hint{color:var(--muted);font-size:12.5px;font-weight:400;margin-top:2px}
.meta{flex:0 0 auto;text-align:right;color:var(--muted);font-size:13px}
.hash{font-size:11.5px;opacity:.75;margin-top:2px;font-variant-numeric:tabular-nums}
.btn{flex:0 0 auto;font-size:13px;padding:7px 18px;border-radius:8px;background:var(--brand);color:var(--bg);text-decoration:none}
.btn:hover{opacity:.88}
.muted{flex:0 0 auto;font-size:13px;color:var(--muted);opacity:.7}
.foot{margin-top:46px;color:var(--muted);font-size:12.5px;line-height:1.8}
.foot a{color:inherit}
code{font-size:12.5px}
</style>
</head>
<body>
<div class="wrap">
<h1>Image Workbench</h1>
<p class="sub">本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)</p>
<h2>下载</h2>
<div class="row">
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
<div class="meta">版本 3.25.1 · 6.2 MB · .dmg<div class="hash">sha256 5b711840b36a10ba…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.1_aarch64.dmg">下载</a>
</div>
<div class="row">
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
<div class="meta">版本 3.25.1 · 6.5 MB · .dmg<div class="hash">sha256 7863e4a3257d15a4…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.1_x64.dmg">下载</a>
</div>
<div class="row">
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
<div class="meta"></div>
<span class="muted">暂未提供</span>
</div>
<h2>系统要求</h2>
<div class="row">
<div class="name">macOS 12 及以上 / Windows 10 1803 及以上(含 WebView2)
<div class="hint">数据全部保存在本地目录 <code>~/Documents/ImageWorkbench</code>,可整目录备份与迁移。</div>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Image Workbench · 本地优先的 AI 生图工作台</title>
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
<link rel="stylesheet" href="/assets/style.css?v=3.25.13-mwlp28hk">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
<div class="links">
<a href="/" class="on">首页</a>
<a href="/download/">下载</a>
<a href="/plugins/">插件</a>
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.25.13</a>
</div>
</div></nav>
<main>
<section class="hero hero-art">
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.13-mwlp28hk" alt=""></div>
<div class="hero-veil"></div>
<div class="wrap">
<span class="kicker">v3.25.13 · macOS / Windows · 数据在本地</span>
<h1>本地优先的<br>AI 生图无限画布</h1>
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
<div class="cta">
<a class="btn primary lg" href="/download/">下载 v3.25.13</a>
<a class="btn lg" href="/plugins/">浏览 7 个插件</a>
</div>
</div>
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
</div></section>
<h2>历史版本</h2>
<div class="row">
<div class="name">3.25.1<div class="hint">Intel Mac 版:性能与数据卫生(图库清单去 base64、缩略图落盘、回收 20.2MB)</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.0<div class="hint">应用不再内置插件(全部从市场安装);页内确认替代原生 confirm;插件市场与开发者模式</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.24.85<div class="hint">每张画布单独成文件、资源库分类、设置面板重构、下载改为按需落盘</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="foot">
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-17
<section class="section"><div class="wrap">
<h2>为「一个人跑完整条产线」而做</h2>
<p class="lead">不做又一个在线生图站点。它活在你的桌面上,把生图、修图、批量、图库和插件放在同一张画布上。</p>
<div class="grid c3">
<div class="card"><div class="ico" style="background:#eef2ff">💻</div>
<h3>本地优先</h3><p>图片与数据保存在 ~/Documents/ImageWorkbench,不经服务器中转;可整目录备份、迁移到新电脑。</p></div>
<div class="card"><div class="ico" style="background:#fff7ed">🕸️</div>
<h3>节点式无限画布</h3><p>参考图 → 提示词 → 生成 → 图库,用连线把工作流串起来;一张画布容纳整条生产线。</p></div>
<div class="card"><div class="ico" style="background:#ecfdf5">🧩</div>
<h3>插件按需安装</h3><p>应用本体不含插件,需要什么装什么;可随时启停,关闭后入口自动隐藏。</p></div>
</div>
</div></section>
<section class="section"><div class="wrap">
<h2>插件:本体不带,需要的自己装</h2>
<p class="lead">应用本体不再内置插件。设置里打开市场,点「安装」,重启即可用;不需要的点一下就能关掉。</p>
<div class="grid c3">
<div class="pcard" data-name="批量出图 batch-export 资源中心勾选节点,串行批量生成并打包 zip 下载 出图 批处理" data-tags="出图,批处理">
<div class="head"><span class="av" style="background:#e8f0fe">🗂️</span>
<div><div class="nm">批量出图</div><div class="ver">v1.2.0 · 官方</div></div></div>
<div class="desc">资源中心勾选节点,串行批量生成并打包 ZIP 下载</div>
<div class="tags"><span class="tag">出图</span><span class="tag">批处理</span></div>
</div>
<div class="pcard" data-name="空白画布 blank-canvas 新建空白画布节点,用于分区分组 画布 效率" data-tags="画布,效率">
<div class="head"><span class="av" style="background:#eef2f6">⬜</span>
<div><div class="nm">空白画布</div><div class="ver">v1.0.0 · 官方</div></div></div>
<div class="desc">新建空白画布节点,用于分区分组</div>
<div class="tags"><span class="tag">画布</span><span class="tag">效率</span></div>
</div>
<div class="pcard" data-name="标注 / 修图 image-annotate 在画布内标注、涂抹、局部重绘 修图 标注" data-tags="修图,标注">
<div class="head"><span class="av" style="background:#fdeaea">🖌️</span>
<div><div class="nm">标注 / 修图</div><div class="ver">v1.20.6 · 官方</div></div></div>
<div class="desc">在画布内标注、涂抹、局部重绘</div>
<div class="tags"><span class="tag">修图</span><span class="tag">标注</span></div>
</div>
<div class="pcard" data-name="位图转矢量 image-vectorize 把位图转成 svg 矢量路径 转换 矢量" data-tags="转换,矢量">
<div class="head"><span class="av" style="background:#eaf3ea">✒️</span>
<div><div class="nm">位图转矢量</div><div class="ver">v0.4.2 · 官方</div></div></div>
<div class="desc">把位图转成 SVG 矢量路径</div>
<div class="tags"><span class="tag">转换</span><span class="tag">矢量</span></div>
</div>
<div class="pcard" data-name="风格库 style-source 风格提示词库与一键套用 提示词 风格" data-tags="提示词,风格">
<div class="head"><span class="av" style="background:#fdf0e6">🎨</span>
<div><div class="nm">风格库</div><div class="ver">v1.3.2 · 官方</div></div></div>
<div class="desc">风格提示词库与一键套用</div>
<div class="tags"><span class="tag">提示词</span><span class="tag">风格</span></div>
</div>
<div class="pcard" data-name="白底图 white-bg-800 批量生成电商白底图(800px) 电商 出图" data-tags="电商,出图">
<div class="head"><span class="av" style="background:#eef7fb">🧾</span>
<div><div class="nm">白底图</div><div class="ver">v1.2.1 · 官方</div></div></div>
<div class="desc">批量生成电商白底图(800px)</div>
<div class="tags"><span class="tag">电商</span><span class="tag">出图</span></div>
</div>
</div>
<div style="margin-top:22px"><a class="btn" href="/plugins/">查看全部 7 个插件</a></div>
</div></section>
<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.25.13_aarch64.dmg"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 7.6 MB · .dmg</div></a>
<a href="/updates/darwin-x86_64/image-workbench_3.25.13_x64.dmg"><div class="n">macOS · Intel</div><div class="s">x86_64 · 7.9 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>
</main>
<footer><div class="wrap">
<div class="cols">
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
</div>
</div>
</body>
</html>
<div class="copy"><span>© 2026 Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
</div></footer>
</body></html>
<script>
(function () {
var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches
var targets = [].slice.call(document.querySelectorAll('.section h2, .section p.lead, .card, .pcard, .dl a'))
targets.forEach(function (el) { el.classList.add('reveal') })
if (!reduce && 'IntersectionObserver' in window) {
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (e) {
if (!e.isIntersecting) return
var el = e.target
var idx = targets.indexOf(el) % 4
el.style.transitionDelay = (idx * 60) + 'ms'
el.classList.add('in')
io.unobserve(el)
})
}, { rootMargin: '0px 0px -8% 0px', threshold: 0.12 })
targets.forEach(function (el) { io.observe(el) })
} else { targets.forEach(function (el) { el.classList.add('in') }) }
var art = document.querySelector('.art-frame')
if (art && !reduce) {
var raf = 0
var onScroll = function () {
if (raf) return
raf = requestAnimationFrame(function () {
raf = 0
var y = Math.min(1, Math.max(0, window.scrollY / 700))
art.style.transform = 'translate3d(0,' + (y * -14) + 'px,0)'
})
}
window.addEventListener('scroll', onScroll, { passive: true }); onScroll()
}
})()
</script>
+132
View File
@@ -0,0 +1,132 @@
{
"version": 1,
"updatedAt": "2026-11-17T13:04:29.617Z",
"plugins": [
{
"id": "batch-export",
"name": "批量出图",
"desc": "资源中心勾选节点,串行批量生成并打包 ZIP 下载",
"author": "official",
"icon": "🗂️",
"color": "#e8f0fe",
"tags": [
"出图",
"批处理"
],
"version": "1.2.0",
"apiVersion": 1,
"file": "plugins/plugin-batch-export.b7d13ba66cf9.js",
"size": 44329,
"sha256": "b7d13ba66cf97ff65e94305328183a1a3b5a45b0393f3a63f77f6b7b46795389",
"integrity": "sha256-t9E7pmz5f/ZelDBTKBg6GjtaRbA5Pzpj939re0Z5U4k="
},
{
"id": "blank-canvas",
"name": "空白画布",
"desc": "新建空白画布节点,用于分区分组",
"author": "official",
"icon": "⬜",
"color": "#eef2f6",
"tags": [
"画布",
"效率"
],
"version": "1.0.0",
"apiVersion": 1,
"file": "plugins/plugin-blank-canvas.67763893fa99.js",
"size": 6094,
"sha256": "67763893fa99c8fe1d8bcf640426f5bbc576abd35bcdc84c910b7b08f79964f9",
"integrity": "sha256-Z3Y4k/qZyP4di89kBCb1u8V2q9NbzchMkQt7CPeZZPk="
},
{
"id": "image-annotate",
"name": "标注 / 修图",
"desc": "在画布内标注、涂抹、局部重绘",
"author": "official",
"icon": "🖌️",
"color": "#fdeaea",
"tags": [
"修图",
"标注"
],
"version": "1.20.6",
"apiVersion": 1,
"file": "plugins/plugin-image-annotate.7a865c7c353c.js",
"size": 461523,
"sha256": "7a865c7c353c3fbcaac551a8aeb5acd1bf624ca25f104db96fce493c3084b24f",
"integrity": "sha256-eoZcfDU8P7yqxVGorrWs0b9iTKJfEE25b85JPDCEsk8="
},
{
"id": "image-vectorize",
"name": "位图转矢量",
"desc": "把位图转成 SVG 矢量路径",
"author": "official",
"icon": "✒️",
"color": "#eaf3ea",
"tags": [
"转换",
"矢量"
],
"version": "0.4.2",
"apiVersion": 1,
"file": "plugins/plugin-image-vectorize.03b5fc850c34.js",
"size": 144780,
"sha256": "03b5fc850c34ddc0996bafc367798fb60aecc9bb23b92990dd5ccc59ed74bfc9",
"integrity": "sha256-A7X8hQw03cCZa6/DZ3mPtgrsybsjuSmQ3VzMWe10v8k="
},
{
"id": "style-source",
"name": "风格库",
"desc": "风格提示词库与一键套用",
"author": "official",
"icon": "🎨",
"color": "#fdf0e6",
"tags": [
"提示词",
"风格"
],
"version": "1.3.2",
"apiVersion": 1,
"file": "plugins/plugin-style-source.ee7168565a44.js",
"size": 69925,
"sha256": "ee7168565a44d49daaf300f62d5c7a106e60fba29a9e4888ff8bfd9abd2e3178",
"integrity": "sha256-7nFoVlpE1J2q8wD2LVx6EG5g+6KankiI/4v9mr0uMXg="
},
{
"id": "white-bg-800",
"name": "白底图",
"desc": "批量生成电商白底图(800px)",
"author": "official",
"icon": "🧾",
"color": "#eef7fb",
"tags": [
"电商",
"出图"
],
"version": "1.2.1",
"apiVersion": 1,
"file": "plugins/plugin-white-bg-800.a5a92f045c0d.js",
"size": 14957,
"sha256": "a5a92f045c0d4046b205562019b2a6354afd14aa92375b78559d48f2ce9b74ee",
"integrity": "sha256-pakvBFwNQEayBVYgGbKmNUr9FKqSN1t4VZ1I8s6bdO4="
},
{
"id": "xianyi-cutout",
"name": "鲜艺抠图",
"desc": "接入鲜艺抠图模型的一键去背景",
"author": "official",
"icon": "✂️",
"color": "#f3eafd",
"tags": [
"抠图",
"去背景"
],
"version": "1.0.3",
"apiVersion": 1,
"file": "plugins/plugin-xianyi-cutout.79c8c47dfc61.js",
"size": 4488,
"sha256": "79c8c47dfc6187b8af2688763e7f63034bb26867ccefbf135ed76d3745d6e24d",
"integrity": "sha256-ecjEffxhh7ivJoh2Pn9jA0uyaGfM778TXtdtN0XW4k0="
}
]
}
+119
View File
@@ -0,0 +1,119 @@
<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>插件市场 · Image Workbench</title>
<link rel="stylesheet" href="/assets/style.css?v=3.25.13-mwlp28hk">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
<div class="links">
<a href="/">首页</a>
<a href="/download/">下载</a>
<a href="/plugins/" class="on">插件</a>
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.25.13</a>
</div>
</div></nav>
<main>
<section class="hero" style="padding:64px 0 8px;text-align:left"><div class="wrap">
<h1 style="font-size:40px;margin:0">插件市场</h1>
<p class="sub" style="margin:14px 0 0;text-align:left;max-width:720px">共 7 个插件。安装方式:应用内 <b>设置 → 插件 → 浏览</b>,点「安装」后重启生效。</p>
</div></section>
<section class="section" style="border-top:0;padding-top:24px"><div class="wrap">
<div style="display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px" id="chips">
<button class="tag on" data-tag="" style="cursor:pointer;background:#111;color:#fff;border-color:#111;padding:5px 12px">全部</button>
<button class="tag" data-tag="出图" style="cursor:pointer;padding:5px 12px">出图</button>
<button class="tag" data-tag="批处理" style="cursor:pointer;padding:5px 12px">批处理</button>
<button class="tag" data-tag="画布" style="cursor:pointer;padding:5px 12px">画布</button>
<button class="tag" data-tag="效率" style="cursor:pointer;padding:5px 12px">效率</button>
<button class="tag" data-tag="修图" style="cursor:pointer;padding:5px 12px">修图</button>
<button class="tag" data-tag="标注" style="cursor:pointer;padding:5px 12px">标注</button>
<button class="tag" data-tag="转换" style="cursor:pointer;padding:5px 12px">转换</button>
<button class="tag" data-tag="矢量" style="cursor:pointer;padding:5px 12px">矢量</button>
<button class="tag" data-tag="提示词" style="cursor:pointer;padding:5px 12px">提示词</button>
<button class="tag" data-tag="风格" style="cursor:pointer;padding:5px 12px">风格</button>
<button class="tag" data-tag="电商" style="cursor:pointer;padding:5px 12px">电商</button>
<button class="tag" data-tag="抠图" style="cursor:pointer;padding:5px 12px">抠图</button>
<button class="tag" data-tag="去背景" style="cursor:pointer;padding:5px 12px">去背景</button>
</div>
<input id="q" placeholder="搜索插件,例如:出图、抠图、矢量…" style="width:100%;max-width:420px;height:40px;padding:0 14px;border:1px solid var(--line);border-radius:10px;font-size:14px;outline:none;margin-bottom:22px">
<div class="grid c3" id="list">
<div class="pcard" data-name="批量出图 batch-export 资源中心勾选节点,串行批量生成并打包 zip 下载 出图 批处理" data-tags="出图,批处理">
<div class="head"><span class="av" style="background:#e8f0fe">🗂️</span>
<div><div class="nm">批量出图</div><div class="ver">v1.2.0 · 官方</div></div></div>
<div class="desc">资源中心勾选节点,串行批量生成并打包 ZIP 下载</div>
<div class="tags"><span class="tag">出图</span><span class="tag">批处理</span></div>
</div>
<div class="pcard" data-name="空白画布 blank-canvas 新建空白画布节点,用于分区分组 画布 效率" data-tags="画布,效率">
<div class="head"><span class="av" style="background:#eef2f6">⬜</span>
<div><div class="nm">空白画布</div><div class="ver">v1.0.0 · 官方</div></div></div>
<div class="desc">新建空白画布节点,用于分区分组</div>
<div class="tags"><span class="tag">画布</span><span class="tag">效率</span></div>
</div>
<div class="pcard" data-name="标注 / 修图 image-annotate 在画布内标注、涂抹、局部重绘 修图 标注" data-tags="修图,标注">
<div class="head"><span class="av" style="background:#fdeaea">🖌️</span>
<div><div class="nm">标注 / 修图</div><div class="ver">v1.20.6 · 官方</div></div></div>
<div class="desc">在画布内标注、涂抹、局部重绘</div>
<div class="tags"><span class="tag">修图</span><span class="tag">标注</span></div>
</div>
<div class="pcard" data-name="位图转矢量 image-vectorize 把位图转成 svg 矢量路径 转换 矢量" data-tags="转换,矢量">
<div class="head"><span class="av" style="background:#eaf3ea">✒️</span>
<div><div class="nm">位图转矢量</div><div class="ver">v0.4.2 · 官方</div></div></div>
<div class="desc">把位图转成 SVG 矢量路径</div>
<div class="tags"><span class="tag">转换</span><span class="tag">矢量</span></div>
</div>
<div class="pcard" data-name="风格库 style-source 风格提示词库与一键套用 提示词 风格" data-tags="提示词,风格">
<div class="head"><span class="av" style="background:#fdf0e6">🎨</span>
<div><div class="nm">风格库</div><div class="ver">v1.3.2 · 官方</div></div></div>
<div class="desc">风格提示词库与一键套用</div>
<div class="tags"><span class="tag">提示词</span><span class="tag">风格</span></div>
</div>
<div class="pcard" data-name="白底图 white-bg-800 批量生成电商白底图(800px) 电商 出图" data-tags="电商,出图">
<div class="head"><span class="av" style="background:#eef7fb">🧾</span>
<div><div class="nm">白底图</div><div class="ver">v1.2.1 · 官方</div></div></div>
<div class="desc">批量生成电商白底图(800px)</div>
<div class="tags"><span class="tag">电商</span><span class="tag">出图</span></div>
</div>
<div class="pcard" data-name="鲜艺抠图 xianyi-cutout 接入鲜艺抠图模型的一键去背景 抠图 去背景" data-tags="抠图,去背景">
<div class="head"><span class="av" style="background:#f3eafd">✂️</span>
<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></div>
</div>
</div>
<div class="note" style="margin-top:26px">插件安装后会写进你的资料目录 <code>~/Documents/ImageWorkbench/plugins/</code>;卸载只删插件文件,不动画布与图库。</div>
</div></section>
</main>
<footer><div class="wrap">
<div class="cols">
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
</div>
<div class="copy"><span>© 2026 Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
</div></footer>
<script>
var q = document.getElementById('q'), list = document.getElementById('list'), chips = document.getElementById('chips'), activeTag = ''
function apply () {
var kw = (q.value || '').trim().toLowerCase()
Array.prototype.forEach.call(list.children, function (el) {
var okKw = !kw || el.dataset.name.indexOf(kw) >= 0
var okTag = !activeTag || (',' + el.dataset.tags + ',').indexOf(',' + activeTag + ',') >= 0
var ok = okKw && okTag
el.style.display = ok ? '' : 'none'
})
}
q.addEventListener('input', apply)
chips.addEventListener('click', function (e) {
var b = e.target.closest('button[data-tag]'); if (!b) return
Array.prototype.forEach.call(chips.children, function (x) { x.style.background = ''; x.style.color = ''; x.style.borderColor = 'transparent' })
b.style.background = '#111'; b.style.color = '#fff'; b.style.borderColor = '#111'
activeTag = b.dataset.tag || ''
apply()
})
</script>
</body></html>
+259 -1
View File
@@ -1,8 +1,266 @@
{
"app": "Image Workbench",
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
"updatedAt": "2026-11-17T07:47:02.925Z",
"updatedAt": "2026-11-18T05:42:09.182Z",
"releases": [
{
"version": "3.25.13",
"date": "2026-11-18",
"notes": "Intel 版:启动目录兜底",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.13_aarch64.dmg",
"size": 7935763,
"sha256": "863a5ff87a1debc0baf2dbe5033d8313c90649a6f48577408a23846d2b106e23",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.13_x64.dmg",
"size": 8235328,
"sha256": "25b4ad7237058ddd06d2a8f361114304ff03a37dd841d8c54a31d9d9e4d7d0e6",
"kind": "dmg"
}
}
},
{
"version": "3.25.12",
"date": "2026-11-18",
"notes": "Intel 版:图片目录自愈 + 不回退 Cache",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.12_aarch64.dmg",
"size": 7935223,
"sha256": "ddea5bf24ddfab943afce8d4a9eeb744c09fd15a204d0c359149025ecda4c0d8",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.12_x64.dmg",
"size": 8232027,
"sha256": "87d69fb85ce19c5e7993cf02ee35568352f0c6c4b026892e0a0d49e1505aa432",
"kind": "dmg"
}
}
},
{
"version": "3.25.11",
"date": "2026-11-18",
"notes": "Windows:单实例 + 外链系统浏览器 + 原生通知 + 窗口下限 + 仅 nsis 产物",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.11_aarch64.dmg",
"size": 7931660,
"sha256": "4d6d589d87b5a463310d73bd84da06186e2a291e536e75fadcce047cb2f86c49",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.11_x64.dmg",
"size": 8234268,
"sha256": "13ccf3b80e0162524c1d73cdae96c914288adcb5649b7d082d260649123d4970",
"kind": "dmg"
},
"windows-x86_64": {
"file": "updates/windows-x86_64/image-workbench_3.25.11_x64-setup.exe",
"size": 4905095,
"sha256": "17702145cff43a02a4e7b50cdccded050d44819a9d6b80b539ae8997c7f4f0d4",
"kind": "exe"
}
}
},
{
"version": "3.25.10",
"date": "2026-11-18",
"notes": "Intel 版:图片持久化修复",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.10_aarch64.dmg",
"size": 7671575,
"sha256": "1882ed66713df4cfd0839a6d5220e717c297d31b050bfcbfb45efff33e660e61",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.10_x64.dmg",
"size": 7978877,
"sha256": "bca63766b951756228d513b1dc6d6c9e76d8bc5c4cc898171a24178b9f2e23ff",
"kind": "dmg"
}
}
},
{
"version": "3.25.9",
"date": "2026-11-18",
"notes": "Windows:图片登记立即落盘 + 清理前报数",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.9_aarch64.dmg",
"size": 7674858,
"sha256": "030b18cc29dd8f5e65b1906ef141a99ea34daadfacf827c10b75a2b0c957c94a",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.9_x64.dmg",
"size": 7977320,
"sha256": "06fd92df7fa6adf762d62450338f2f005c7c77cc9379bda4feaf49f27791f191",
"kind": "dmg"
},
"windows-x86_64": {
"file": "updates/windows-x86_64/image-workbench_3.25.9_x64-setup.exe",
"size": 4771479,
"sha256": "d065e2a00eb59aeb55d101d9c22d39fb1298833b3782403379a72041ceb78230",
"kind": "exe"
}
}
},
{
"version": "3.25.8",
"date": "2026-11-18",
"notes": "Intel 版:同图导入与图片清理修复",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.8_aarch64.dmg",
"size": 7673011,
"sha256": "a3f6293d099f5624705138a342a8e95517e9e9bf1c7a8f88e84a573e9fd87955",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.8_x64.dmg",
"size": 7978802,
"sha256": "5716570a8d6bed248df66e2b1d82946265df2d5293c23753e3b2ae4ee3a810d9",
"kind": "dmg"
}
}
},
{
"version": "3.25.7",
"date": "2026-11-18",
"notes": "Windows:剪贴板 PNG 传输 + 路径文本转图片 + 大图不卡",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.7_aarch64.dmg",
"size": 7669562,
"sha256": "e4b6b7561391631130a91f0dd408ac03823f5c46963c3a7e5464a75210935af6",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.7_x64.dmg",
"size": 7978666,
"sha256": "63288e85748e0d360afae76009e6e44a668b9755b270883387380774468a4f33",
"kind": "dmg"
},
"windows-x86_64": {
"file": "updates/windows-x86_64/image-workbench_3.25.7_x64-setup.exe",
"size": 4776945,
"sha256": "7ada5360e52ddd0c1f0a00d124c00612b5a03a34a6c8e128e74178cda8e52a2d",
"kind": "exe"
}
}
},
{
"version": "3.25.6",
"date": "2026-11-18",
"notes": "Intel 版:粘贴语义修正",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.6_aarch64.dmg",
"size": 7657949,
"sha256": "e92264a47106317b7125184ace097873d3c85cede9668137a7392b355e2afa3c",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.6_x64.dmg",
"size": 7942814,
"sha256": "88e143e4e76849226d24dadd8c7ec7f53a3940399cc5173df68330645fa7a33a",
"kind": "dmg"
}
}
},
{
"version": "3.25.5",
"date": "2026-11-18",
"notes": "Intel 版:库面板粘贴修复",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.5_aarch64.dmg",
"size": 7657153,
"sha256": "1506b4ab5b77df7d98bf69fe29de586abbbdcc36f4a01163c8d86e3a75093c0d",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.5_x64.dmg",
"size": 7944240,
"sha256": "97b05edd949987669bfd57b97bc55379d9d0eb676914401e006046632148a352",
"kind": "dmg"
}
}
},
{
"version": "3.25.4",
"date": "2026-11-18",
"notes": "Intel 版:剪贴板兜底",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.4_aarch64.dmg",
"size": 7658606,
"sha256": "0c02574f197fac4839bf937390425786ec872b36d9f8c529f122ee1349e855af",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.4_x64.dmg",
"size": 7940457,
"sha256": "f04664f6e051ae20e07bfb073ff675bbb83493f791ff4651120cdd00e9b0e103",
"kind": "dmg"
}
}
},
{
"version": "3.25.3",
"date": "2026-11-17",
"notes": "Windows:剪贴板修复(Cmd+C/V、粘贴图片/文本、复制图片)+ 可自动更新",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.3_aarch64.dmg",
"size": 7654670,
"sha256": "fd05bf1a186574c611b166693b05a7531e5ec932bbc7cf75391bcd44a0c9eb5f",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.3_x64.dmg",
"size": 7938826,
"sha256": "00388a79069f9a78c48d491f366f73f1ee1500468f9970c8f657e25eb7c4e786",
"kind": "dmg"
},
"windows-x86_64": {
"file": "updates/windows-x86_64/image-workbench_3.25.3_x64-setup.exe",
"size": 4749572,
"sha256": "e2a8cedc3aaaf61528edcf58c648079f618051cb6a4cf655b346315ad6424ba4",
"kind": "exe"
}
}
},
{
"version": "3.25.2",
"date": "2026-11-17",
"notes": "Windows:无内置插件 + 市场安装 + 页内确认 + 在线更新(首次需手动安装)",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.2_aarch64.dmg",
"size": 7360220,
"sha256": "6fb859f2e24d765308a6a97b3c72912d361eb71afb12ec385f2d72cef9cfef2e",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.2_x64.dmg",
"size": 7626433,
"sha256": "07027d97cffde7c0c46b65b2ec875a9fd4dfbdce4494d937e93d46169f61b3f8",
"kind": "dmg"
},
"windows-x86_64": {
"file": "updates/windows-x86_64/image-workbench_3.25.2_x64-setup.exe",
"size": 4681055,
"sha256": "dda001a15e4aa8b25ef6200936884f5d78783309338a9979aadc175c8cc965af",
"kind": "exe"
}
}
},
{
"version": "3.25.1",
"date": "2026-11-17",
+698 -1
View File
@@ -64,6 +64,157 @@ version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
[[package]]
name = "arboard"
version = "3.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aeb9553e62312c8756a5979254fc6d7da8bbeb5986a1e17037fab932f7037917"
dependencies = [
"clipboard-win",
"image",
"log",
"objc2",
"objc2-app-kit",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-foundation",
"parking_lot",
"percent-encoding",
"windows-sys 0.61.2",
"x11rb",
]
[[package]]
name = "async-broadcast"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
dependencies = [
"event-listener",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-channel"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
dependencies = [
"concurrent-queue",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-executor"
version = "1.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f426a31126c735126297bc5ea7a521263c9faff4f63ca415267ee625651c4f37"
dependencies = [
"async-task",
"concurrent-queue",
"fastrand",
"futures-lite",
"pin-project-lite",
"slab",
]
[[package]]
name = "async-io"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
dependencies = [
"autocfg",
"cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite",
"parking",
"polling",
"rustix",
"slab",
"windows-sys 0.61.2",
]
[[package]]
name = "async-lock"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0876700b0d007ad25d5508865a4259c3af9af6d296bf663a0d586d0bc3369f6f"
dependencies = [
"event-listener",
"event-listener-strategy",
"pin-project-lite",
]
[[package]]
name = "async-process"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
dependencies = [
"async-channel",
"async-io",
"async-lock",
"async-signal",
"async-task",
"blocking",
"cfg-if",
"event-listener",
"futures-lite",
"rustix",
]
[[package]]
name = "async-recursion"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.10",
]
[[package]]
name = "async-signal"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
dependencies = [
"async-io",
"async-lock",
"atomic-waker",
"cfg-if",
"futures-core",
"futures-io",
"rustix",
"signal-hook-registry",
"slab",
"windows-sys 0.61.2",
]
[[package]]
name = "async-task"
version = "4.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]]
name = "async-trait"
version = "0.1.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.10",
]
[[package]]
name = "atk"
version = "0.18.2"
@@ -180,6 +331,19 @@ dependencies = [
"objc2",
]
[[package]]
name = "blocking"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"
dependencies = [
"async-channel",
"async-task",
"futures-io",
"futures-lite",
"piper",
]
[[package]]
name = "brotli"
version = "9.1.3"
@@ -383,6 +547,15 @@ dependencies = [
"windows-link",
]
[[package]]
name = "clipboard-win"
version = "5.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052af7878466feccda12ba7a6a67d019d712f296809559b47c12c8cc196d3a9a"
dependencies = [
"error-code",
]
[[package]]
name = "combine"
version = "4.6.9"
@@ -393,6 +566,15 @@ dependencies = [
"memchr",
]
[[package]]
name = "concurrent-queue"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "constant_time_eq"
version = "0.6.1"
@@ -529,6 +711,12 @@ version = "0.8.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
[[package]]
name = "crunchy"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
[[package]]
name = "crypto-common"
version = "0.1.7"
@@ -851,6 +1039,33 @@ dependencies = [
"simdutf8",
]
[[package]]
name = "endi"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
[[package]]
name = "enumflags2"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
dependencies = [
"enumflags2_derive",
"serde",
]
[[package]]
name = "enumflags2_derive"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "env_filter"
version = "0.1.4"
@@ -888,12 +1103,44 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "error-code"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b5343afd4a8365a643ac588dab4cf234a190c7f6c88c9f6dd6ffe00837661b7"
[[package]]
name = "event-listener"
version = "5.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
dependencies = [
"parking",
"pin-project-lite",
]
[[package]]
name = "event-listener-strategy"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
dependencies = [
"event-listener",
"pin-project-lite",
]
[[package]]
name = "fastrand"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
[[package]]
name = "fax"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"
[[package]]
name = "fdeflate"
version = "0.3.7"
@@ -1029,6 +1276,19 @@ version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
[[package]]
name = "futures-lite"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
dependencies = [
"fastrand",
"futures-core",
"futures-io",
"parking",
"pin-project-lite",
]
[[package]]
name = "futures-macro"
version = "0.3.34"
@@ -1177,6 +1437,16 @@ dependencies = [
"version_check",
]
[[package]]
name = "gethostname"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
dependencies = [
"rustix",
"windows-link",
]
[[package]]
name = "getrandom"
version = "0.2.17"
@@ -1383,6 +1653,17 @@ dependencies = [
"tracing",
]
[[package]]
name = "half"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
dependencies = [
"cfg-if",
"crunchy",
"zerocopy",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
@@ -1407,6 +1688,12 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
[[package]]
name = "hex"
version = "0.4.3"
@@ -1691,12 +1978,16 @@ dependencies = [
"moxcms",
"num-traits",
"png",
"tiff",
]
[[package]]
name = "image-workbench"
version = "3.25.2"
version = "3.25.13"
dependencies = [
"arboard",
"base64 0.22.1",
"image",
"log",
"serde",
"serde_json",
@@ -1706,6 +1997,8 @@ dependencies = [
"tauri-plugin-fs",
"tauri-plugin-http",
"tauri-plugin-log",
"tauri-plugin-notification",
"tauri-plugin-single-instance",
"tauri-plugin-updater",
]
@@ -2048,6 +2341,20 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f"
[[package]]
name = "mac-notification-sys"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd604973958ddcc11b561193c0fb96ba146506ef2f231ef2e7c35fd2cbc9beca"
dependencies = [
"cc",
"log",
"objc2",
"objc2-foundation",
"time",
"uuid",
]
[[package]]
name = "markup5ever"
version = "0.39.0"
@@ -2213,6 +2520,20 @@ dependencies = [
"libc",
]
[[package]]
name = "notify-rust"
version = "4.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57da5b5d3b7809bf71858da5a2818c3404ca4688c02c8abecdda0fcdec235df3"
dependencies = [
"futures-lite",
"log",
"mac-notification-sys",
"serde",
"tauri-winrt-notification",
"zbus 6.3.0",
]
[[package]]
name = "num-conv"
version = "0.2.2"
@@ -2279,6 +2600,7 @@ dependencies = [
"block2",
"objc2",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-foundation",
"objc2-quartz-core",
]
@@ -2486,6 +2808,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "ordered-stream"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
dependencies = [
"futures-core",
"pin-project-lite",
]
[[package]]
name = "osakit"
version = "0.3.1"
@@ -2525,6 +2857,12 @@ dependencies = [
"system-deps",
]
[[package]]
name = "parking"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]]
name = "parking_lot"
version = "0.12.5"
@@ -2666,6 +3004,17 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "piper"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
dependencies = [
"atomic-waker",
"fastrand",
"futures-io",
]
[[package]]
name = "pkg-config"
version = "0.3.34"
@@ -2698,6 +3047,20 @@ dependencies = [
"miniz_oxide 0.8.9",
]
[[package]]
name = "polling"
version = "3.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
dependencies = [
"cfg-if",
"concurrent-queue",
"hermit-abi",
"pin-project-lite",
"rustix",
"windows-sys 0.61.2",
]
[[package]]
name = "portable-atomic"
version = "1.15.0"
@@ -2818,6 +3181,12 @@ version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
[[package]]
name = "quick-error"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
[[package]]
name = "quick-xml"
version = "0.42.0"
@@ -3581,6 +3950,16 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
[[package]]
name = "signal-hook-registry"
version = "1.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
dependencies = [
"errno",
"libc",
]
[[package]]
name = "simd-adler32"
version = "0.3.10"
@@ -4136,6 +4515,42 @@ dependencies = [
"time",
]
[[package]]
name = "tauri-plugin-notification"
version = "2.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14a226bfb8189ec4ab2c1936e66330ad06c44d9f6c54a674338208491dee177f"
dependencies = [
"log",
"notify-rust",
"rand",
"serde",
"serde_json",
"serde_repr",
"tauri",
"tauri-plugin",
"thiserror 2.0.21",
"time",
"url",
"zbus 5.19.0",
]
[[package]]
name = "tauri-plugin-single-instance"
version = "2.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "726b6da0dd5bd1344f84f4108a622c07d01923baacb5c803a605189672c5352f"
dependencies = [
"serde",
"serde_json",
"tauri",
"thiserror 2.0.21",
"tokio",
"tracing",
"windows-sys 0.61.2",
"zbus 5.19.0",
]
[[package]]
name = "tauri-plugin-updater"
version = "2.14.1"
@@ -4269,6 +4684,17 @@ dependencies = [
"toml 1.2.1+spec-1.1.0",
]
[[package]]
name = "tauri-winrt-notification"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f37a6c354fd28fc9e322ed9bd47e3959576dad28c9d58ea1cf888cce1c7ccb36"
dependencies = [
"thiserror 2.0.21",
"windows",
"windows-version",
]
[[package]]
name = "tempfile"
version = "3.27.0"
@@ -4331,6 +4757,20 @@ dependencies = [
"syn 3.0.10",
]
[[package]]
name = "tiff"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"
dependencies = [
"fax",
"flate2",
"half",
"quick-error",
"weezl",
"zune-jpeg",
]
[[package]]
name = "time"
version = "0.3.55"
@@ -4577,9 +5017,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "tracing-core"
version = "0.1.36"
@@ -4635,6 +5087,17 @@ version = "1.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
[[package]]
name = "uds_windows"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
dependencies = [
"memoffset",
"tempfile",
"windows-sys 0.61.2",
]
[[package]]
name = "unicode-ident"
version = "1.0.27"
@@ -4979,6 +5442,12 @@ dependencies = [
"windows-core",
]
[[package]]
name = "weezl"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
[[package]]
name = "winapi"
version = "0.3.9"
@@ -5408,6 +5877,23 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "x11rb"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414"
dependencies = [
"gethostname",
"rustix",
"x11rb-protocol",
]
[[package]]
name = "x11rb-protocol"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd"
[[package]]
name = "xattr"
version = "1.7.0"
@@ -5441,6 +5927,148 @@ dependencies = [
"synstructure",
]
[[package]]
name = "zbus"
version = "5.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"
dependencies = [
"async-broadcast",
"async-executor",
"async-io",
"async-lock",
"async-process",
"async-recursion",
"async-task",
"async-trait",
"blocking",
"enumflags2",
"event-listener",
"futures-core",
"futures-lite",
"hex",
"libc",
"ordered-stream",
"rustix",
"serde",
"serde_repr",
"tracing",
"uds_windows",
"uuid",
"windows-sys 0.61.2",
"winnow 1.0.5",
"zbus_macros 5.19.0",
"zbus_names",
"zvariant",
]
[[package]]
name = "zbus"
version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b4aae740b23927ceabed962431abab2cdefb9f7f885e5bbab062da09bf580e4"
dependencies = [
"async-trait",
"bitflags 2.13.2",
"endi",
"futures-core",
"hex",
"libc",
"ordered-stream",
"rustix",
"serde",
"serde_repr",
"socket2",
"uds_windows",
"uuid",
"windows-sys 0.61.2",
"winnow 1.0.5",
"zbus_macros 6.3.0",
"zbus_utils",
"zcheapstr",
"zruntime",
]
[[package]]
name = "zbus_macros"
version = "5.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"
dependencies = [
"proc-macro-crate 3.5.0",
"proc-macro2",
"quote",
"syn 3.0.10",
"zbus_names",
"zvariant",
"zvariant_utils",
]
[[package]]
name = "zbus_macros"
version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37c9dd4beaf145c16fcb2902862f50da86e54aed13dd368ddf64a1d17e6b8529"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.10",
"zbus_utils",
]
[[package]]
name = "zbus_names"
version = "4.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd"
dependencies = [
"serde",
"winnow 1.0.5",
"zvariant",
]
[[package]]
name = "zbus_utils"
version = "6.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af55e52da295311b368c45bcae221f020e28e97a2420360170ce389218e76ec7"
dependencies = [
"proc-macro2",
"quote",
"serde",
"syn 3.0.10",
"winnow 1.0.5",
]
[[package]]
name = "zcheapstr"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "939f186d9ecebe044315a5cb6d6f78568bbc21152adc954d5a0c2f58bdbc9920"
dependencies = [
"serde",
]
[[package]]
name = "zerocopy"
version = "0.8.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "zerofrom"
version = "0.1.8"
@@ -5544,3 +6172,72 @@ name = "zmij"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
[[package]]
name = "zruntime"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce6a55d4f521760475a30f7b96779508fe8c40dc834478709454dd1d5f0ebc72"
dependencies = [
"futures-core",
"futures-io",
"rustix",
"socket2",
"windows-sys 0.61.2",
]
[[package]]
name = "zune-core"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
[[package]]
name = "zune-jpeg"
version = "0.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
dependencies = [
"zune-core",
]
[[package]]
name = "zvariant"
version = "5.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7"
dependencies = [
"endi",
"enumflags2",
"serde",
"winnow 1.0.5",
"zcheapstr",
"zvariant_derive",
"zvariant_utils",
]
[[package]]
name = "zvariant_derive"
version = "5.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d"
dependencies = [
"proc-macro-crate 3.5.0",
"proc-macro2",
"quote",
"syn 3.0.10",
"zvariant_utils",
]
[[package]]
name = "zvariant_utils"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"
dependencies = [
"proc-macro2",
"quote",
"serde",
"syn 3.0.10",
"winnow 1.0.5",
]
+6 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.25.2"
version = "3.25.13"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
@@ -29,3 +29,8 @@ tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tauri-plugin-http = "2"
tauri-plugin-updater = "2"
tauri-plugin-single-instance = "2"
tauri-plugin-notification = "2"
arboard = "3"
image = { version = "0.25", default-features = false, features = ["png"] }
base64 = "0.22"
+145 -7
View File
@@ -48,12 +48,13 @@ fn restore_geom(win: &WebviewWindow, app: &AppHandle) {
let Some(p) = geom_file(app) else { return };
let Ok(txt) = std::fs::read_to_string(p) else { return };
let Ok(g) = serde_json::from_str::<WindowGeom>(&txt) else { return };
if g.w < 800 || g.h < 500 {
return;
}
let _ = win.set_size(PhysicalSize::new(g.w, g.h));
let cx = g.x + (g.w as i32) / 2;
let cy = g.y + (g.h as i32) / 2;
// 最小尺寸与 tauri.conf.json 的 minWidth/minHeight 对齐:否则会恢复出一个
// 比窗口下限还小的窗口(实测 1051x488 时画布渲染成空白)
let w = g.w.max(1024);
let h = g.h.max(640);
let _ = win.set_size(PhysicalSize::new(w, h));
let cx = g.x + (w as i32) / 2;
let cy = g.y + (h as i32) / 2;
let visible = win
.available_monitors()
.map(|ms| {
@@ -207,6 +208,19 @@ fn open_app_data_dir(app: AppHandle) -> Result<String, String> {
use tauri_plugin_updater::UpdaterExt;
#[tauri::command]
fn clipboard_write_text(text: String) -> Result<bool, String> {
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
cb.set_text(text).map_err(|e| e.to_string())?;
Ok(true)
}
#[tauri::command]
fn clipboard_read_text() -> Result<String, String> {
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
Ok(cb.get_text().unwrap_or_default())
}
#[tauri::command]
async fn check_update(app: tauri::AppHandle) -> Result<Option<serde_json::Value>, String> {
let updater = app.updater().map_err(|e| e.to_string())?;
@@ -234,14 +248,132 @@ async fn install_update(app: tauri::AppHandle) -> Result<bool, String> {
app.restart();
}
use arboard::Clipboard;
fn b64_encode(bytes: &[u8]) -> String {
use base64::Engine;
base64::engine::general_purpose::STANDARD.encode(bytes)
}
fn b64_decode(s: &str) -> Result<Vec<u8>, String> {
use base64::Engine;
base64::engine::general_purpose::STANDARD
.decode(s.as_bytes())
.map_err(|e| e.to_string())
}
#[derive(serde::Serialize)]
#[serde(rename_all = "camelCase")]
struct ClipImagePayload {
width: u32,
height: u32,
png_base64: String,
}
/// 读系统剪贴板图片 → PNG(base64)
///
/// 为什么返回 PNG 而不是裸 RGBA:12MP 照片的 RGBA 是 46MB,base64 后 62MB,
/// 穿过 IPC 会卡住前端好几秒;PNG 通常只有几 MB。
#[tauri::command]
fn clipboard_read_image() -> Result<Option<ClipImagePayload>, String> {
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
let img = match cb.get_image() {
Ok(v) => v,
Err(_) => return Ok(None),
};
let w = img.width as u32;
let h = img.height as u32;
if w == 0 || h == 0 {
return Ok(None);
}
let raw = img.bytes.into_owned();
let buf = image::RgbaImage::from_raw(w, h, raw)
.ok_or_else(|| "剪贴板图片像素数据不完整".to_string())?;
let mut png: Vec<u8> = Vec::new();
{
use image::ImageEncoder;
let enc = image::codecs::png::PngEncoder::new(&mut png);
enc.write_image(buf.as_raw(), w, h, image::ExtendedColorType::Rgba8)
.map_err(|e| e.to_string())?;
}
Ok(Some(ClipImagePayload {
width: w,
height: h,
png_base64: b64_encode(&png),
}))
}
/// 把 PNG(base64)写进系统剪贴板
#[tauri::command]
fn clipboard_write_image(png_base64: String) -> Result<bool, String> {
let bytes = b64_decode(&png_base64)?;
let img = image::load_from_memory(&bytes).map_err(|e| e.to_string())?.to_rgba8();
let (w, h) = (img.width() as usize, img.height() as usize);
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
cb.set_image(arboard::ImageData {
width: w,
height: h,
bytes: std::borrow::Cow::Owned(img.into_raw()),
})
.map_err(|e| e.to_string())?;
Ok(true)
}
fn open_external(url: &str) -> Result<(), String> {
#[cfg(target_os = "macos")]
{
std::process::Command::new("open").arg(url).spawn().map(|_| ()).map_err(|e| e.to_string())
}
#[cfg(target_os = "windows")]
{
std::process::Command::new("cmd")
.args(["/C", "start", "", url])
.spawn()
.map(|_| ())
.map_err(|e| e.to_string())
}
#[cfg(all(unix, not(target_os = "macos")))]
{
std::process::Command::new("xdg-open").arg(url).spawn().map(|_| ()).map_err(|e| e.to_string())
}
}
#[tauri::command]
fn open_external_url(url: String) -> Result<bool, String> {
if !(url.starts_with("http://") || url.starts_with("https://")) {
return Err("只允许 http/https".into());
}
open_external(&url)?;
Ok(true)
}
#[tauri::command]
fn notify_desktop(app: tauri::AppHandle, title: String, body: String) -> Result<bool, String> {
use tauri_plugin_notification::NotificationExt;
match app.notification().builder().title(title).body(body).show() {
Ok(_) => Ok(true),
Err(e) => Err(e.to_string()),
}
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
let app = tauri::Builder::default()
.plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| {
// 第二次启动:聚焦已有窗口(多实例同时写同一个资料目录会把 data.json 写坏)
if let Some(w) = app.get_webview_window("main") {
let _ = w.show();
let _ = w.unminimize();
let _ = w.set_focus();
}
}))
.plugin(tauri_plugin_notification::init())
.plugin(tauri_plugin_http::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.invoke_handler(tauri::generate_handler![open_app_data_dir, grant_dir, copy_tree, check_update, install_update])
.invoke_handler(tauri::generate_handler![open_app_data_dir, grant_dir, copy_tree, check_update, install_update, clipboard_read_image, clipboard_write_image, clipboard_write_text, clipboard_read_text, open_external_url, notify_desktop])
.setup(|app| {
if cfg!(debug_assertions) {
app.handle().plugin(
@@ -255,6 +387,12 @@ pub fn run() {
restore_geom(&win, app.handle());
}
build_tray(app.handle())?;
// macOS 必须有应用菜单,否则 Cmd+C / Cmd+V / Cmd+X 根本不会进 WebView(Tauri 已知问题)
#[cfg(target_os = "macos")]
{
let menu = tauri::menu::Menu::default(app.handle())?;
app.set_menu(menu)?;
}
Ok(())
})
// 点关闭按钮 ⇒ 记住窗口尺寸后收进托盘(不退出,后台任务继续)
+2 -2
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.25.2",
"version": "3.25.13",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
@@ -25,7 +25,7 @@
}
],
"security": {
"csp": "default-src 'self'; script-src 'self' blob:; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' ipc: http://ipc.localhost https: blob: data: http://127.0.0.1:30092 http://localhost:30092 http://127.0.0.1:3425 http://localhost:3425; object-src 'none'; base-uri 'none'; frame-ancestors 'none'"
"csp": "default-src 'self'; script-src 'self' blob:; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' ipc: http://ipc.localhost https: blob: data:; object-src 'none'; base-uri 'none'; frame-ancestors 'none'"
}
},
"bundle": {
+8
View File
@@ -0,0 +1,8 @@
{
"bundle": {
"targets": [
"app",
"dmg"
]
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"bundle": {
"targets": [
"nsis"
]
}
}
+42 -12
View File
@@ -102,20 +102,50 @@
/* 写系统剪贴板。返回 Promise<boolean>:false 表示这个环境写不了
* (非 HTTPS / 老浏览器 / 无 ClipboardItem)→ 调用方降级到内部剪贴板 + Ctrl+Shift+V。
* 绝不 reject:复制是高频动作,不能因为剪贴板权限在控制台刷错误。 */
/* 桌面端兜底:WKWebView 里 ClipboardItem 写 text/html 常失败(返回 false),
* 于是复制节点等于「什么都没写」,Ctrl+V 会贴出上一次的文本。
* 这里改成:写不了富文本就写纯文本摘要,并记住这份摘要属于哪个 clip。
* 粘贴侧用 matchPlain() 精确比对(文字完全相等才算命中),不会把用户随手复制的文本误判成节点。 */
let lastPlain = null
function notePlain(plain, clip) {
lastPlain = { plain: str(plain), clip: clip || null, at: Date.now() }
}
function matchPlain(text) {
if (!lastPlain || !lastPlain.clip) return null
if (Date.now() - lastPlain.at > 10 * 60 * 1000) return null
return str(text) === lastPlain.plain ? lastPlain.clip : null
}
function write(clip) {
const plain = plainFor(clip)
const cb = (g.navigator && g.navigator.clipboard) || null
// 先记账:即使写剪贴板失败,内部匹配(matchPlain)也能让 Ctrl+V 贴回节点组
notePlain(plain, clip)
try {
const cb = g.navigator && g.navigator.clipboard
if (!cb || typeof cb.write !== 'function') return Promise.resolve(false)
if (typeof g.ClipboardItem !== 'function' || typeof g.Blob !== 'function') return Promise.resolve(false)
const html = htmlFor(clip)
const plain = plainFor(clip)
const item = new g.ClipboardItem({
'text/html': new g.Blob([html], { type: 'text/html' }),
'text/plain': new g.Blob([plain], { type: 'text/plain' }),
})
return Promise.resolve(cb.write([item])).then(() => true).catch(() => false)
} catch (e) { return Promise.resolve(false) }
if (cb && typeof cb.write === 'function' && typeof g.ClipboardItem === 'function' && typeof g.Blob === 'function') {
const item = new g.ClipboardItem({
'text/html': new g.Blob([htmlFor(clip)], { type: 'text/html' }),
'text/plain': new g.Blob([plain], { type: 'text/plain' }),
})
return Promise.resolve(cb.write([item])).then(() => true).catch(() => writePlainFallback(cb, plain, clip))
}
} catch (e) { /* 落到纯文本兜底 */ }
// WKWebView:没有 clipboard.write ⇒ 直接走纯文本兜底(旧实现这里直接 return false,等于什么都没写)
return writePlainFallback(cb, plain, clip)
}
g.IWBClipboardGraph = Object.freeze({ MARK, encodeText, decodeText, htmlFor, plainFor, decode, write })
/** 纯文本兜底:优先 navigator.clipboard.writeText,再退到 Rust arboard */
function writePlainFallback(cb, plain, clip) {
notePlain(plain, clip)
const T = g.__TAURI__
if (cb && typeof cb.writeText === 'function') {
return Promise.resolve(cb.writeText(plain)).then(() => true).catch(() => writeNativeText(T, plain))
}
return writeNativeText(T, plain)
}
function writeNativeText(T, plain) {
if (!T || !T.core || typeof T.core.invoke !== 'function') return Promise.resolve(false)
return Promise.resolve(T.core.invoke('clipboard_write_text', { text: str(plain) })).then(() => true).catch(() => false)
}
g.IWBClipboardGraph = Object.freeze({ MARK, encodeText, decodeText, htmlFor, plainFor, decode, write, matchPlain })
})(typeof window !== 'undefined' ? window : globalThis)
+74
View File
@@ -0,0 +1,74 @@
/* clipboard-native.js —— 桌面端原生剪贴板(2026-11-18)
*
* 为什么单独一个模块:
* WKWebView 的 paste 事件拿不到「从 Finder/预览复制的图片」,
* navigator.clipboard.write([ClipboardItem]) 在部分 macOS 版本也不可用。
* 图片读写统一走 Rust 侧 arboard(命令 clipboard_read_image / clipboard_write_image)。
*
* 为什么 IPC 传 PNG 而不是裸 RGBA:
* 12MP 照片的 RGBA 是 46MB,base64 后 62MB,穿过 IPC 会卡住前端好几秒;
* PNG 通常只有几 MB。读方向由 Rust 编码 PNG,写方向直接把 Blob 的 PNG 字节发过去。
*/
;(function (global) {
'use strict'
function tauri() {
const T = global && global.__TAURI__
return (T && T.core && typeof T.core.invoke === 'function') ? T : null
}
function b64FromU8(u8) {
let s = ''
const CH = 0x8000
for (let i = 0; i < u8.length; i += CH) s += String.fromCharCode.apply(null, u8.subarray(i, i + CH))
return global.btoa(s)
}
function u8FromB64(b64) {
const s = global.atob(b64)
const u8 = new Uint8Array(s.length)
for (let i = 0; i < s.length; i++) u8[i] = s.charCodeAt(i)
return u8
}
/** Blob/File → PNG Blob(其它格式统一转一次,避免写进剪贴板后别人贴出来是 HEIC) */
function toPngBlob(blobOrFile) {
if (blobOrFile && blobOrFile.type === 'image/png') return Promise.resolve(blobOrFile)
const C = global.IWBImageBlob
if (C && typeof C.toPng === 'function') return Promise.resolve(C.toPng(blobOrFile))
return Promise.resolve(blobOrFile)
}
/** 读系统剪贴板里的图片 → PNG File(读不到返回 null) */
async function readImage() {
const T = tauri()
if (!T) return null
try {
const r = await T.core.invoke('clipboard_read_image')
const b64 = r && (r.pngBase64 || r.png_base64)
if (!b64) return null
const u8 = u8FromB64(b64)
const blob = new global.Blob([u8], { type: 'image/png' })
const name = 'clipboard-' + Date.now() + '.png'
try { return new global.File([blob], name, { type: 'image/png' }) } catch (e) {
const named = /** @type {any} */ (blob)
named.name = name
return named
}
} catch (e) { return null }
}
/** 把图片写进系统剪贴板(Blob/File 均可) */
async function writeImage(blobOrFile) {
const T = tauri()
if (!T || !blobOrFile) return false
try {
const png = await toPngBlob(blobOrFile)
const buf = new Uint8Array(await png.arrayBuffer())
await T.core.invoke('clipboard_write_image', { pngBase64: b64FromU8(buf) })
return true
} catch (e) { return false }
}
global.IWBNativeClipboard = Object.freeze({ readImage, writeImage, available: () => !!tauri() })
})(typeof window !== 'undefined' ? window : globalThis)
+115 -40
View File
@@ -25,13 +25,23 @@
/* 浮层打开时不接管画布粘贴:用户看不见画布,粘出来的节点会被盖住,
* 关掉浮层才发现多了一堆。优先读 state(ctx.ui),补一刀 DOM 判定覆盖放大编辑/插件面板。 */
function overlayOpen(ui) {
if (ui && (ui.settingOpen || ui.drawerOpen || ui.helpOpen || ui.wsMoreOpen || ui.ctxMenu || ui.connMenu)) return true
try {
return !!document.querySelector('.iwb-md-expand, .iwb-fullmask')
} catch (e) { return false }
/* 真模态:粘贴会落到用户看不见的画布上,直接不接管。 */
function modalOpen(ui) {
if (ui && (ui.settingOpen || ui.helpOpen || ui.wsMoreOpen || ui.ctxMenu || ui.connMenu)) return true
try { return !!document.querySelector('.iwb-md-expand') } catch (e) { return false }
}
/* 库面板(左侧资源抽屉 / 资源中心全屏):**不再禁止粘贴**。
* 旧行为是「浮层打开时不接管」,用户实测反馈「打开库面板粘贴就失效」,因为这两块面板
* 常驻打开、并不阻断画布操作(拖拽/连线都还能用),只有粘贴被单独拦掉,像 bug。
* 现在的取舍:粘贴前先把库面板关掉(调用方注入 closeLibrary),让落点可见、不产生「贴了
* 但看不见」的困惑;调用方没注入就退回旧行为(不接管)。 */
function libraryOpen(ui) {
if (ui && ui.drawerOpen) return true
try { return !!document.querySelector('.iwb-fullmask') } catch (e) { return false }
}
const overlayOpen = (ui) => modalOpen(ui) || libraryOpen(ui)
const nameOf = (f, i) => str(f && f.name) || ('pasted-' + (i + 1) + '.png')
/* ── 粘贴落点跟随指针(v3.24.69,用户裁定)───────────────────────────────
@@ -70,6 +80,10 @@
let hit = null
try { hit = document.elementFromPoint ? document.elementFromPoint(ptr.x, ptr.y) : null } catch (e) { hit = null }
if (hit && hit !== el && el.contains && !el.contains(hit)) return null
// 面板本身可能挂在画布子树里(左抽屉),单独再判一次
try {
if (hit && hit.closest && hit.closest('.iwb-fullmask, .iwb-lib, .iwb-lib-embedded, .iwb-drawer, .iwb-fullpanel')) return null
} catch (e) { /* ignore */ }
const vp = (ctx && ctx.refs && ctx.refs.viewport) || { x: 0, y: 0, scale: 1 }
const G = g.IWBCanvasGeometry
const w = (G && typeof G.clientToWorld === 'function')
@@ -120,42 +134,43 @@
* (prompt 216 vs 实测 ~90)⇒ 贴出来的节点视觉中心恒定偏上 63px。改成左上角之后
* 落点不再依赖任何高度估算:高度只决定"往下延伸多少"。
* ctx.findSpot(type, seed, opts) 的 opts.corner === 'tl' 就是这件事的开关。 */
const spotOf = (ctx, type) => ctx.findSpot(type, anchor(ctx) || undefined, { corner: 'tl' })
/* 同图去重(v3.24.75):把这一批里画布上**已有**的图剔掉,只排布剩下的。
* 返回 { kept, dupIds, dupCount }:
* dupIds —— 命中的已有节点 id(用来"选中原节点",用户才知道东西在哪)
* dupCount —— 连同一批内部的重复也算上(粘两张一样的图时,第二张没有"原节点"可选中)
* 判据与语义边界见 src/image-dedupe.js(远程链接、复制节点组都**不**去重)。 */
function rejectDup(items, ctx) {
const D = g.IWBImageDedupe
if (!D || typeof D.index !== 'function') return { kept: items, dupIds: [], dupCount: 0 }
const idx = D.index(ctx.nodes())
const seen = new Set()
const kept = []
const dupIds = []
for (let i = 0; i < items.length; i++) {
const v = items[i].data
const k = idx.keyOf(v)
const hitId = k ? idx.hit(v) : ''
if (hitId) { if (dupIds.indexOf(hitId) < 0) dupIds.push(hitId); continue }
if (k && seen.has(k)) continue // 同一批里的重复:没有原节点可指,只计数
if (k) seen.add(k)
kept.push(items[i])
/* 指针不在画布上(停在面板/工具栏)时的兜底落点:
* 取视口中心,若中心被库面板盖住就往面板旁边挪,避免「贴了但看不见」。 */
function safeSeed(ctx) {
const box = boxOf(ctx)
if (!box) return null
const r = box.r
let movedOut = false
let cx = r.left + r.width / 2
const cy = r.top + r.height / 2
let moved = false
let rects = []
try { rects = Array.prototype.slice.call(document.querySelectorAll('.iwb-fullmask, .iwb-lib, .iwb-drawer, .iwb-lib-embedded')) } catch (e) { rects = [] }
for (let i = 0; i < rects.length; i++) {
const pr = rects[i].getBoundingClientRect ? rects[i].getBoundingClientRect() : null
if (!pr || !pr.width) continue
if (cx < pr.left || cx > pr.right || cy < pr.top || cy > pr.bottom) continue
if (pr.right + 90 < r.right) cx = pr.right + 90
else if (pr.left - 90 > r.left) cx = pr.left - 90
movedOut = true
break
}
return { kept: kept, dupIds: dupIds, dupCount: items.length - kept.length }
// 中心没被面板挡住 ⇒ 返回 null,交回 findSpot 的原行为
if (!movedOut) return null
const vp = (ctx && ctx.refs && ctx.refs.viewport) || { x: 0, y: 0, scale: 1 }
const G = g.IWBCanvasGeometry
const w = (G && typeof G.clientToWorld === 'function')
? G.clientToWorld(cx, cy, r, vp)
: { x: (cx - r.left - (vp.x || 0)) / (vp.scale || 1), y: (cy - r.top - (vp.y || 0)) / (vp.scale || 1) }
return (Number.isFinite(w.x) && Number.isFinite(w.y)) ? { x: Math.round(w.x), y: Math.round(w.y) } : null
}
const spotOf = (ctx, type) => ctx.findSpot(type, anchor(ctx) || safeSeed(ctx) || undefined, { corner: 'tl' })
function addRefs(items, ctx, label) {
if (ctx.wsId !== ctx.activeWsId()) { ctx.setNotice({ type: 'err', text: '工作台已切换,已取消粘贴图片' }); return }
const dedup = rejectDup(items, ctx)
if (!dedup.kept.length) {
// 一张都没落:**必须**说清发生了什么并把原节点选中,否则用户看到的是「按了没反应」。
if (dedup.dupIds.length) ctx.setSel(dedup.dupIds)
ctx.setNotice({ type: 'ok', text: '这 ' + dedup.dupCount + ' 张图已经在画布上了' + (dedup.dupIds.length ? '(已选中原来的节点)' : '') + ',没有重复粘贴' })
return
}
items = dedup.kept
// v3.25.6(用户裁定):同一张图允许重复粘贴 —— 粘贴是显式动作,被去重挡掉像「按键没反应」。
// 同图去重仍服务于「拖拽 / 批量导入」等被动路径(src/image-dedupe.js 的其它调用方)。
if (!items || !items.length) return
const stepX = ctx.nodeW('ref') + 24
const stepY = ctx.nodeH('ref') + 24
let base = spotOf(ctx, 'ref')
@@ -177,7 +192,7 @@
ctx.pushHistory()
ctx.commitCanvas(ctx.nodes().concat(made), undefined, undefined)
ctx.setSel(made.map((n) => n.id))
ctx.setNotice({ type: 'ok', text: label + (dedup.dupCount ? '(跳过 ' + dedup.dupCount + ' 张重复的)' : '') })
ctx.setNotice({ type: 'ok', text: label })
}
/* 多图:并行导入、**一次落盘** —— 撤销一次就回到粘之前(旧实现分 N 次 commit 要按 N 次) */
@@ -250,14 +265,16 @@
}
return false
}
if (overlayOpen(ctx.ui)) return false
if (modalOpen(ctx.ui)) return false
// 库面板(资源抽屉 / 资源中心)不做任何拦截:用户明确要求「粘贴不要关闭库面板」。
// 落点问题交给 anchor(指针在画布可见区就贴指针处)与 safeSeed(指针压在面板上时挪开)。
if (c.kind === 'graph') {
// 复制节点时已把节点组写进系统剪贴板(text/html 带标记)→ 这里直接贴,不用再记 Ctrl+Shift+V。
e.preventDefault()
// 先摘掉「粘贴替换」的待命监听:此刻用户要贴的是节点组,不是替换某张参考图。
// 不摘的话,点过「粘贴替换」按钮后再贴节点组,会把那张图顺手替换掉(v3.24.67 修过一次同类问题)。
try { const PO = g.IWBPasteOnce; if (PO) PO.disarm() } catch (err) { /* ignore */ }
if (!ctx.pasteGraph(c.clip, anchor(ctx))) ctx.setNotice({ type: 'err', text: '粘贴节点组失败:剪贴板内容无法识别' })
if (!ctx.pasteGraph(c.clip, anchor(ctx) || safeSeed(ctx))) ctx.setNotice({ type: 'err', text: '粘贴节点组失败:剪贴板内容无法识别' })
return true
}
if (c.kind === 'empty') {
@@ -266,6 +283,16 @@
// 复制只进了内部那份;用户从旧版本带过来的复制内容也靠它。
// 每个 paste 事件独立处理 → 连按 N 次贴 N 份,不会像旧的定时器方案那样只贴一份。
e.preventDefault()
// 桌面端:Finder/预览复制的图片在 WKWebView 的 paste 事件里读不到,先问原生剪贴板
if (typeof ctx.readNativeImage === 'function') {
ctx.setNotice({ type: 'info', text: '正在读取剪贴板图片…' })
ctx.readNativeImage().then((f) => {
if (f) { pasteImages([f], ctx); ctx.setNotice(null) }
else if (ctx.pasteCopiedNodes()) { ctx.setNotice(null) }
else ctx.setNotice({ type: 'err', text: ctx.refs.clipExpired ? '内部剪贴板已过期(10 分钟),请重新复制节点' : '剪贴板里没有可粘贴的内容' })
})
return true
}
if (ctx.pasteCopiedNodes()) return true
ctx.setNotice({
type: 'err',
@@ -280,6 +307,10 @@
// 用户没法照着做(他粘的可能本来就是 PNG,只是 MIME 没填)。
const A = g.IWBImageAdmit
const list = c.files || []
if (typeof ctx.readNativeImage === 'function') {
ctx.readNativeImage().then((f) => { if (f) { pasteImages([f], ctx); ctx.setNotice(null) } })
return true
}
const why = (A && typeof A.why === 'function' && list[0]) ? A.why(list[0])
: ('暂不支持粘贴文件(' + ((list[0] && list[0].name) || '该文件') + ')')
ctx.setNotice({ type: 'err', text: (why || '暂不支持粘贴该文件') + (list.length > 1 ? '(另有 ' + (list.length - 1) + ' 个文件未处理)' : '') })
@@ -300,6 +331,26 @@
createRefFromUrl(c.text.trim(), ctx)
return true
}
// 桌面端:Finder/预览里「复制图片」经常同时给出 file:// 文本,classify 会当成普通文本,
// 结果贴出来是一个写着路径的提示词节点。这里遇到路径样式的文本先问原生剪贴板要图片。
const looksPath = /^(file:\/\/|\/|[A-Za-z]:[\/])/.test(c.text.trim())
if (looksPath && typeof ctx.readNativeImage === 'function') {
e.preventDefault()
ctx.readNativeImage().then((f) => {
if (f) pasteImages([f], ctx)
else createPrompt(c.text, ctx)
})
return true
}
// 桌面端:复制节点写不进 text/html 时会退化成「纯文本摘要 + 记住的 clip」。
// 文字与刚才写的摘要完全一致 ⇒ 认为用户贴的是节点组,而不是新提示词。
const G = g.IWBClipboardGraph
const matched = (G && typeof G.matchPlain === 'function') ? G.matchPlain(c.text) : null
if (matched) {
e.preventDefault()
try { const PO = g.IWBPasteOnce; if (PO) PO.disarm() } catch (err) { /* ignore */ }
if (ctx.pasteGraph(matched, anchor(ctx) || safeSeed(ctx))) return true
}
e.preventDefault()
createPrompt(c.text, ctx)
return true
@@ -325,5 +376,29 @@ function probe(ctx) {
}, 420)
}
g.IWBClipboardPaste = Object.freeze({ handle, probe, overlayOpen, anchor })
/* Cmd/Ctrl+V 兜底(桌面端):菜单缺失或 WebView 不派发 paste 时,160ms 内没收到
* 真实 paste 事件就主动读一次原生剪贴板图片。getCtx 由 app.js 注入(懒取,避免闭包过期)。 */
let hotkeyBound = false
function bindHotkeyFallback(getCtx) {
if (hotkeyBound || typeof window === 'undefined') return
hotkeyBound = true
window.addEventListener('keydown', (e) => {
if (!(e.metaKey || e.ctrlKey) || e.shiftKey || e.altKey) return
if (String(e.key || '').toLowerCase() !== 'v') return
const t = /** @type {any} */ (e.target)
if (t && t.tagName && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return
const D = g.IWBDesktop
if (!D || !D.clipboardReadImage) return
const ctx = (typeof getCtx === 'function') ? getCtx() : null
if (ctx && modalOpen(ctx.ui)) return
const stamp = ctx && ctx.refs ? (ctx.refs.pasteStamp || 0) : 0
setTimeout(() => {
const now = ctx && ctx.refs ? (ctx.refs.pasteStamp || 0) : 0
if (now !== stamp) return
D.clipboardReadImage().then((f) => { if (f) pasteImages([f], ctx) })
}, 160)
})
}
g.IWBClipboardPaste = Object.freeze({ handle, probe, overlayOpen, modalOpen, libraryOpen, anchor, bindHotkeyFallback, pasteFiles: (files, ctx) => pasteImages(files || [], ctx) })
})(typeof window !== 'undefined' ? window : globalThis)
+4
View File
@@ -23,6 +23,10 @@
getSilentSave() { return !!(state.impl && state.impl.getSilentSave()) },
setSilentSave(on) { if (state.impl) state.impl.setSilentSave(on) },
openDataDir() { return state.impl ? state.impl.openDataDir() : Promise.reject(new Error('仅桌面端可用')) },
// 原生剪贴板图片(v3.26):WKWebView 里 paste 事件拿不到 Finder 复制的图片,
// navigator.clipboard.write 也常不可用,统一走 Rust 侧 arboard。
clipboardReadImage() { return state.impl && state.impl.clipboardReadImage ? state.impl.clipboardReadImage() : Promise.resolve(null) },
clipboardWriteImage(blob) { return state.impl && state.impl.clipboardWriteImage ? state.impl.clipboardWriteImage(blob) : Promise.resolve(false) },
market: {
list() { return state.impl && state.impl.marketList ? state.impl.marketList() : Promise.resolve([]) },
installed() { return state.impl && state.impl.marketInstalled ? state.impl.marketInstalled() : Promise.resolve([]) },
+5 -26
View File
@@ -1119,22 +1119,10 @@
// 而 MIME 没填的 PNG 反倒被静默丢掉(Windows 资源管理器就这行为)。
const A = global.IWBImageAdmit
const refused = []
/* 同图去重(v3.24.75):拖进来的字节与画布上已有图片一致时不再建节点。
* 判据见 src/image-dedupe.js —— 只认本地图片字节,URL / 复制节点组都不参与。
* 多条命中合并成一条提示(拖 5 张重复图不该刷 5 条),并选中已有节点把位置指出来。 */
const D = global.IWBImageDedupe
const idx = (D && typeof D.index === 'function') ? D.index(refs.nodes) : null
const dupNames = []
const dupIds = []
const flushDups = () => {
if (!dupNames.length) return
const ns = dupNames.splice(0, dupNames.length)
const ids = dupIds.splice(0, dupIds.length)
if (ids.length) setSel(ids)
setNotice({ type: 'ok', text: ns.length === 1
? ('「' + ns[0] + '」已经在画布上了,没有重复导入' + (ids.length ? '(已选中原来的节点)' : ''))
: (ns.length + ' 张图已经在画布上了,没有重复导入' + (ids.length ? '(已选中原来的节点)' : '')) })
}
/* v3.25.8(用户裁定):拖入同一张图**允许重复添加**,不再走同图去重。
* 去重曾经挡住「图片节点数据缺失后重新拖入」这条唯一的自愈路径:命中已有节点 →
* 不写 blob → 那个节点依旧是空图。现在每次都正常导入并新建节点,顺带把丢失的
* blob 按同一个内容 key 重新写回磁盘(旧节点也就跟着恢复了)。 */
for (const f of files) {
const verdict = (A && typeof A.of === 'function') ? A.of(f) : ((f.type && f.type.indexOf('image/') === 0) ? 'image' : 'other')
if (verdict !== 'image') { refused.push(f); continue }
@@ -1143,16 +1131,7 @@
// 拖放与粘贴共用导入唯一收口(压缩到 ≤1600 + 立即引用化)
rd.onload = () => wImportImage(rd.result, { onError: (msg) => setNotice({ type: 'err', text: msg }) }, (r) => {
if (!r || !r.ok || !r.data) return
const hitId = idx ? idx.hit(r.data) : ''
if (hitId) {
dupNames.push(String(f.name || '图片'))
if (dupIds.indexOf(hitId) < 0) dupIds.push(hitId)
clearTimeout(refs.dupNoticeTimer)
refs.dupNoticeTimer = setTimeout(flushDups, 260)
return
}
const nid = mk({ url: '', data: r.data, name: f.name })
if (idx) idx.add(r.data, nid)
mk({ url: '', data: r.data, name: f.name })
})
rd.onerror = () => setNotice({ type: 'err', text: '读取拖入的图片失败:' + String(f.name || '') })
rd.readAsDataURL(f)
+59 -6
View File
@@ -176,16 +176,26 @@
const kv = {
async put(key, value) {
try {
if (!enabled() || !dir) return false
// 返回对象而不是裸 false:调用方(ImageBlobStore.put)用 r.ok===false 判断失败,
// 裸布尔 false 会被误判为成功,产出指向空文件的 {__blob}(v3.25.10 修)。
if (!enabled() || !dir) return { ok: false, error: 'not-ready' }
if (value && typeof value === 'object' && typeof value.size === 'number' && value.type !== undefined) {
// Blob:直接取二进制落盘
const buf = await value.arrayBuffer()
const hash = await sha16(buf)
const rel = IMG_DIR + '/' + catOfKey(key) + '/' + hash + '.' + extOf(value.type)
const cat = catOfKey(key)
const rel = IMG_DIR + '/' + cat + '/' + hash + '.' + extOf(value.type)
const abs = await join(dir, rel)
// Windows 全新安装时 images/canvas|gallery 并不存在(只有 thumbs 因为 writeDisplayThumb 会 mkdir),
// 直接 writeFile 会失败 → 整条 blob 写入被判失败 → 图片退化成不持久引用。
// 这里先建目录(幂等),与 thumbs 的写法保持一致。
try { await fs().mkdir(await join(dir, IMG_DIR, cat), { recursive: true }) } catch (e) { /* 已存在 */ }
await fs().writeFile(abs, new Uint8Array(buf))
assets[String(key)] = { f: rel, k: 'blob', m: value.type || 'application/octet-stream' }
schedule()
// 立即落盘:登记表只存在 data.json 里,晚 800ms 就可能被强杀丢掉,
// 而画布文件是即时写的 ⇒ 引用还在、登记没了,GC 会把在用图片当孤儿。
await flush()
return true
}
const s = String(value)
@@ -193,11 +203,14 @@
const dec = dataUrlToBytes(s)
if (dec) {
const hash = await sha16(dec.bytes)
const rel = IMG_DIR + '/' + catOfKey(key) + '/' + hash + '.' + extOf(dec.mime)
const cat2 = catOfKey(key)
const rel = IMG_DIR + '/' + cat2 + '/' + hash + '.' + extOf(dec.mime)
const abs = await join(dir, rel)
try { await fs().mkdir(await join(dir, IMG_DIR, cat2), { recursive: true }) } catch (e) { /* 已存在 */ }
await fs().writeFile(abs, dec.bytes)
assets[String(key)] = { f: rel, k: 'dataurl', m: dec.mime }
schedule()
await flush()
return true
}
}
@@ -206,7 +219,7 @@
return true
} catch (e) {
try { global.IWBMetricsSwallow && global.IWBMetricsSwallow('file-kv-put', e) } catch (e2) { /* ignore */ }
return false
return { ok: false, error: String((e && e.message) || e) }
}
},
async get(key) {
@@ -611,6 +624,15 @@
return true
}
/* 建立工作必需目录:canvases/ library/ plugins/ trash/ 与 images/{canvas,gallery,thumbs,legacy} */
async function ensureDirs() {
const subs = [CANVAS_DIR, 'library', PLUG_DIR, 'trash', IMG_DIR, IMG_DIR + '/canvas', IMG_DIR + '/gallery', IMG_DIR + '/thumbs', IMG_DIR + '/legacy']
for (const sub of subs) {
try { await fs().mkdir(await join(dir, sub), { recursive: true }) } catch (e) { /* 已存在或不可写:继续下一个 */ }
}
return true
}
async function init(opts) {
const o = opts || {}
tauri = global.__TAURI__ || null
@@ -634,6 +656,11 @@
dir = want
try { global.localStorage.setItem(PTR_KEY, dir) } catch (e) { /* ignore */ }
try { await fs().mkdir(await join(dir, IMG_DIR), { recursive: true }) } catch (e) { /* 已存在 */ }
// 兜底:把工作必需的子目录一次性补齐(幂等)。
// 为什么需要:Windows 全新安装时 images/ 下只有 thumbs/,缺了 canvas/ 会导致
// 图片写入失败(历史 bug:写进不持久的 Cache → 重启丢图);目录被手工删掉时也靠这里自愈,
// 否则启动阶段读目录抛错会直接影响首屏渲染。
try { await ensureDirs() } catch (e) { /* 建目录失败不阻塞启动 */ }
try { await repairCanvasFileNames() } catch (e) { /* 修复失败按原样装载 */ }
await loadInto()
// 从 WebView 的 localStorage 捞回被截断/覆盖的画布(一次性)
@@ -811,6 +838,28 @@
try {
if (!enabled() || !dir) return { ok: false, error: '资料目录未就绪' }
const used = new Set(Object.keys(assets).map((k) => assets[k] && assets[k].f).filter(Boolean))
/* v3.25.8:assets 登记表是唯一的「在用」判据,但它可能因为恢复备份/迁移而落后于画布。
* 只看 assets 会把画布仍在引用的图片当孤儿挪进 trash/ —— 节点随即变成占位图,
* 而且用户重新拖入时又被同图去重挡回来(那条链路已废)。
* 这里把 canvases/*.json 里出现的 {__blob} key 也算作在用:宁可留下几 MB,也不误删用户图片。 */
const canvasKeys = new Set()
try {
const cd = await join(dir, 'canvases')
const list = await fs().readDir(cd)
for (const e of list) {
if (!e || e.isDirectory || !/\.json$/i.test(e.name) || e.name === 'active.json') continue
let txt = ''
try { txt = await fs().readTextFile(await join(cd, e.name)) } catch (err) { continue }
const m = txt.match(/"__blob"\s*:\s*"([^"]+)"/g) || []
for (const hit of m) {
const km = /"([^"]+)"$/.exec(hit)
if (km) canvasKeys.add(km[1])
}
}
} catch (e) { /* 画布读不到就退回旧判据 */ }
const referenced = new Set()
for (const k of canvasKeys) { const a = assets[k]; if (a && a.f) referenced.add(a.f) }
referenced.forEach((f) => used.add(f))
const imgAbs = await join(dir, IMG_DIR)
// 子目录也要扫:images/{canvas,gallery,thumbs,legacy}/ 里的孤儿同样占空间
const subs = ['', 'canvas', 'gallery', 'thumbs', 'legacy']
@@ -825,7 +874,11 @@
if (!used.has(rel)) orphans.push({ sub: sub, name: e.name, rel: rel })
}
}
if (dryRun || !orphans.length) return { ok: true, orphans: orphans.length, moved: 0, dryRun: dryRun }
// 断链:画布引用了、但登记表里没有的 key —— 这类节点的图**已经显示不出来**,
// GC 不会动它们(文件根本不在),但值得在确认弹窗里报数,让用户知道数据已经缺了。
const dangling = Array.from(canvasKeys).filter((k) => !assets[k]).length
const keptByCanvas = referenced.size
if (dryRun || !orphans.length) return { ok: true, orphans: orphans.length, moved: 0, dryRun: dryRun, dangling: dangling, keptByCanvas: keptByCanvas }
const trashAbs = await join(dir, 'trash')
let moved = 0
for (const item of orphans) {
@@ -836,7 +889,7 @@
moved++
} catch (e) { /* 单条失败忽略 */ }
}
return { ok: true, orphans: orphans.length, moved: moved, dryRun: dryRun }
return { ok: true, orphans: orphans.length, moved: moved, dryRun: dryRun, dangling: dangling, keptByCanvas: keptByCanvas }
} catch (e) { return { ok: false, error: String((e && e.message) || e) } }
}
+85
View File
@@ -0,0 +1,85 @@
/* ui-desktop-shell.js —— 桌面端外壳适配(2026-11-18)
*
* 平台迁移后需要「网页做不到、只有桌面壳能做」的三件事,集中放这里,
* 避免 app.js 继续膨胀(source-text-ratchet 上限):
* 1) 外链一律交给系统浏览器:桌面 webview 里点 <a target=_blank> 会把整个应用导航成网页
* 2) 桌面原生通知:WKWebView 不支持 Web Notification
* 3) 捕获阶段拦截外链点击(含中键)
*
* 网页版不装 Tauri,isTauri() 恒 false ⇒ 全部走浏览器原生行为,语义不变。
*/
;(function (global) {
'use strict'
const g = /** @type {any} */ (global || {})
const EXTERNAL_RE = /^https?:\/\//i
function tauri () {
const T = g.__TAURI__
return (T && T.core && typeof T.core.invoke === 'function') ? T : null
}
function openExternal (url) {
const u = String(url || '')
if (!EXTERNAL_RE.test(u)) return false
const T = tauri()
if (T) {
try { T.core.invoke('open_external_url', { url: u }) } catch (e) { /* 忽略:下面还会尝试原生窗口 */ }
return true
}
try { global.open(u, '_blank', 'noopener') } catch (e) { /* ignore */ }
return true
}
/** 生成完成通知:桌面走原生;返回 true 表示已处理(调用方不要再走 Web Notification) */
function notifyGenerationDone (info) {
if (!tauri()) return false
const x = info || {}
const total = Number(x.total) || 0
const failed = Number(x.failed) || 0
const title = failed ? '出图完成(部分失败)' : '出图完成'
const body = failed
? ('成功 ' + Math.max(0, total - failed) + ' 张,失败 ' + failed + ' 张')
: ('共生成 ' + total + ' 张图片')
try { tauri().core.invoke('notify_desktop', { title: title, body: body }) } catch (e) { /* ignore */ }
return true
}
function notifyDesktop (title, body) {
const T = tauri()
if (!T) return false
try { T.core.invoke('notify_desktop', { title: String(title || ''), body: String(body || '') }) } catch (e) { /* ignore */ }
return true
}
/* 捕获阶段拦截外链点击(含中键):桌面端不允许把应用窗口导航走 */
function installLinkGuard (isTauri) {
if (typeof document === 'undefined' || !document.addEventListener) return false
if (isTauri && !isTauri()) return false
const pick = (e) => {
const t = e.target
const a = (t && t.closest) ? t.closest('a[href]') : null
if (!a) return ''
const href = a.getAttribute('href') || ''
return EXTERNAL_RE.test(href) ? href : ''
}
document.addEventListener('click', (e) => {
const href = pick(e)
if (!href) return
e.preventDefault()
e.stopPropagation()
openExternal(href)
}, true)
document.addEventListener('auxclick', (e) => {
if (e.button !== 1) return
const href = pick(e)
if (!href) return
e.preventDefault()
openExternal(href)
}, true)
return true
}
g.IWBUIShell = Object.freeze({ openExternal, notifyDesktop, notifyGenerationDone, installLinkGuard })
})(typeof window !== 'undefined' ? window : globalThis)
+9 -2
View File
@@ -594,9 +594,16 @@
const rDry = await F.gcImages({ dryRun: true })
if (!rDry.ok) { setNote('检查失败:' + rDry.error); return }
if (!rDry.orphans) { setNote('没有未引用的图片'); return }
if (!(await askConfirm('发现 ' + rDry.orphans + ' 个文件没有被画布/图库引用。移动到 trash/(不直接删除)?', { title: '清理未引用图片', okText: '移动' }))) return
// 确认弹窗必须把「会不会动到在用的图」讲清楚:这是破坏性动作,不能只报一个数字。
const lines = ['发现 ' + rDry.orphans + ' 个文件没有被画布/图库引用。']
if (rDry.keptByCanvas) lines.push('其中 ' + rDry.keptByCanvas + ' 张虽然登记表里没有,但画布仍在引用 → 会自动保留。')
if (rDry.dangling) lines.push('另有 ' + rDry.dangling + ' 处画布引用已经找不到图片(之前丢的,本次不影响它们)。')
lines.push('移动到 trash/(不直接删除,可在回收站找回)?')
if (!(await askConfirm(lines.join('\n'), { title: '清理未引用图片', okText: '移动' }))) return
const rGo = await F.gcImages({ dryRun: false })
setNote(rGo.ok ? ('已移入 trash/:' + rGo.moved + ' 个文件') : ('清理失败:' + rGo.error))
setNote(rGo.ok
? ('已移入 trash/:' + rGo.moved + ' 个文件' + (rGo.dangling ? (';另有 ' + rGo.dangling + ' 处引用已缺图') : ''))
: ('清理失败:' + rGo.error))
} catch (e) { setNote('清理失败:' + String((e && e.message) || e)) }
} }, '清理未引用图片'),
),
+43
View File
@@ -0,0 +1,43 @@
const fs = require('fs')
const path = require('path')
const code = fs.readFileSync(path.join(__dirname, '../src/clipboard-graph.js'), 'utf8')
function makeGlobal (withClipboard) {
const calls = []
const g = {
TextEncoder,
TextDecoder,
btoa: (s) => Buffer.from(s, 'binary').toString('base64'),
atob: (s) => Buffer.from(s, 'base64').toString('binary'),
navigator: {},
__TAURI__: { core: { invoke: (cmd, args) => { calls.push({ cmd, args }); return Promise.resolve(true) } } },
console,
}
if (withClipboard) {
g.ClipboardItem = function (items) { this.items = items }
g.Blob = function (parts, opts) { this.parts = parts; this.type = (opts || {}).type }
g.navigator.clipboard = { write: () => Promise.reject(new Error('not allowed')) }
}
return { g, calls }
}
function run (withClipboard) {
const { g, calls } = makeGlobal(withClipboard)
const fn = new Function('window', 'globalThis', code + '\nreturn window.IWBClipboardGraph')
const G = fn(g, g)
const clip = { nodes: [{ id: 'n1', type: 'prompt', text: '两只猫在窗台' }], edges: [] }
return G.write(clip).then((ok) => {
const matched = G.matchPlain(G.plainFor(clip))
return { ok, calls, plain: G.plainFor(clip), matched: !!matched, id: matched && matched.nodes[0].id }
})
}
run(false).then((r) => {
console.log('无 clipboard.write(WKWebView 场景):', JSON.stringify({ ok: r.ok, native: r.calls.map(c => c.cmd), matched: r.matched, id: r.id }))
if (!(r.ok && r.calls.some(c => c.cmd === 'clipboard_write_text') && r.matched)) process.exit(1)
return run(true)
}).then((r) => {
console.log('有 clipboard.write 且被拒绝:', JSON.stringify({ ok: r.ok, native: r.calls.map(c => c.cmd), matched: r.matched }))
if (!(r.ok && r.matched)) process.exit(1)
console.log('PASS 图剪贴板兜底(原生写文本 + 摘要匹配)')
}).catch((e) => { console.error('FAIL', e); process.exit(1) })
+6 -5
View File
@@ -210,8 +210,10 @@ function makeCtx(over) {
eq('设置面板打开 → 不落节点', ctx.log.filter((x) => x.startsWith('commit')).length, 0)
}
{
// v3.25.6(用户裁定):库面板打开时照常粘贴,并且**不关闭**面板。
const ctx = makeCtx({ ui: { drawerOpen: true } })
eq('图库抽屉打开 → 不接管', P.handle(pasteEv({ text: 'x' }), ctx), false)
eq('图库抽屉打开 → 仍然接管粘贴', P.handle(pasteEv({ text: 'x' }), ctx), true)
eq('图库抽屉打开 → 不关闭面板', ctx.ui.drawerOpen, true)
}
{
const ctx = makeCtx({ ui: { helpOpen: true } })
@@ -348,10 +350,9 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms))
eq('首次导入 → 落成 1 个参考图节点', ctx.log.filter((x) => x.startsWith('commit')).length, 1)
ctx.log.length = 0
pasted(u1)
eq('同一张图再粘 → 不建节点', ctx.log.filter((x) => x.startsWith('commit')).length, 0)
eq('同一张图再粘 → 选中已有节点(否则用户看不出东西在哪)', ctx.log.filter((x) => x === 'sel:1').length, 1)
ok('同一张图再粘 → 提示"已经在画布上"', ctx.log.some((x) => x.indexOf('notice:ok') === 0 && x.indexOf('已经在画布上') > 0))
ok('同一张图再粘 → 绝不静默(一定有提示)', ctx.log.some((x) => x.indexOf('notice:') === 0))
// v3.25.6(用户裁定):同一张图允许重复粘贴(粘贴是显式动作,去重挡掉像按键没反应)
eq('同一张图再粘 → 再建一个节点', ctx.log.filter((x) => x.startsWith('commit')).length, 1)
ok('同一张图再粘 → 有成功提示', ctx.log.some((x) => x.indexOf('notice:') === 0))
ctx.log.length = 0
pasted(u2)
eq('换一张不同的图 → 照常落地(不是"一律不粘")', ctx.log.filter((x) => x.startsWith('commit')).length, 1)
+1
View File
@@ -20,6 +20,7 @@
"IWBImageCompress",
"IWBImagePreviewDerive",
"IWBMetricsSwallow",
"IWBNativeClipboard",
"IWBNodeBodies",
"IWBPluginHost",
"IWBProviderPing",
+2
View File
@@ -8,6 +8,7 @@
"clipboard-paste.js",
"clipboard-copy.js",
"clipboard-paste-once.js",
"clipboard-native.js",
"generation-size-policy.js",
"generation-request-shape.js",
"image-preview-derive.js",
@@ -60,6 +61,7 @@
"generation-results-store.js",
"ui-groups-sidebar.js",
"ui-lib-sidebar.js",
"ui-desktop-shell.js",
"ui-workspace-tabs.js",
"ui-app-chrome.js",
"ui-workbench-hooks.js",
+7 -4
View File
@@ -1501,7 +1501,9 @@ const nodeXY = (el0) => {
const raw74 = window.localStorage.getItem('iwb_clipboard')
let clip74 = null; try { clip74 = JSON.parse(raw74) } catch (e) { clip74 = null }
assert('74-3 复制写入内部剪贴板(结构 + at 时间戳)', !!clip74 && clip74.type === 'iwb-clipboard' && typeof clip74.at === 'number' && clip74.nodes.length === 1, raw74 ? 'len=' + raw74.length : 'null')
assert('74-4 复制不再写系统剪贴板', clipWrites74.length === 0, 'writes=' + clipWrites74.length)
// v3.25.4:复制节点的语义改回「一个键贴所有」——系统剪贴板写不进 text/html 时(WKWebView),
// 退化为写纯文本摘要 + 记住 clip,Ctrl+V 时按摘要精确匹配贴回节点组;所以这里应当有 1 次写入。
assert('74-4 复制写入系统剪贴板(富文本不可用时退化纯文本摘要)', clipWrites74.length === 1, 'writes=' + clipWrites74.length)
// 74-5 Ctrl+Shift+V 永远粘贴节点组(不受系统剪贴板内容影响)
key74('v', { ctrlKey: true, shiftKey: true }); await wait(200)
assert('74-5 Ctrl+Shift+V 粘贴节点组', nodeCount74() === base74 + 1, 'n=' + nodeCount74() + ' expect=' + (base74 + 1))
@@ -1521,7 +1523,8 @@ const nodeXY = (el0) => {
key74('c', { ctrlKey: true }); await wait(80)
const rawBig74 = window.localStorage.getItem('iwb_clipboard') || ''
assert('74-7 剪贴板把大图剥离为 {__blob} 引用(新写入主通道;无 base64)', rawBig74.indexOf('__blob') >= 0 && !/data:image\/[^"']*;base64,[A-Za-z0-9+/=]{3000,}/.test(rawBig74), 'len=' + rawBig74.length)
assert('74-8 大图复制同样不写系统剪贴板', clipWrites74.length === 0, 'writes=' + clipWrites74.length)
// 同上:大图复制也走同一条兜底(摘要里只有「N 个节点」,绝不写 base64)
assert('74-8 大图复制也只写摘要文本(无 base64)', clipWrites74.length === 2 && clipWrites74.every((t) => t.indexOf('base64') < 0), 'writes=' + clipWrites74.length)
// 53. 冲突保护源码断言(Web 无 server:wApi 单机无冲突,跳过 server 部分)
const app53 = fs.readFileSync(path.join(APP, 'app.js'), 'utf8')
// 2026-11-16:persistWs / duplicateWs 搬到 src/runtime-workbench-logic.js(棘轮腾位),
@@ -2541,7 +2544,7 @@ const nodeXY = (el0) => {
// 140-1 主通道与回退链:IDB Blob 优先,put 失败/不支持/开关关闭 ⇒ 自动回退 iwbCacheWrite,且不抛错打断保存。
assert('140-1 新写入主通道 IDB Blob + 失败回退 Cache(put 未确认 ok 不产出 __blob;catch 不抛错)',
/if \(W_IMG_BLOB_PRIMARY && ImageBlobStore\) \{[\s\S]{0,240}?ImageBlobStore\.put\(dataUrl\)[\s\S]{0,200}?if \(r && r\.ok && r\.key\) return \{ __blob: String\(r\.key\) \}/.test(app53)
/if \(W_IMG_BLOB_PRIMARY && wImageBlobStore\(\)\) \{[\s\S]{0,240}?wImageBlobStore\(\)\.put\(dataUrl\)[\s\S]{0,200}?if \(r && r\.ok && r\.key\) return \{ __blob: String\(r\.key\) \}/.test(app53)
// 2026-11-07 错误可见性:catch 仍不抛错(保持原语义),但改为记账 + 面包屑留痕
&& /catch \(e\) \{ swallow\('image', e\) \}/.test(app53)
&& /const c = await iwbCacheWrite\(dataUrl\)[\s\S]{0,80}?return \(c && c\.__cache\) \? c : null/.test(app53))
@@ -2560,7 +2563,7 @@ const nodeXY = (el0) => {
// 142-1 GC 覆盖:imgblob_ 前缀的保留集合含画布/剪贴板/撤销历史/收藏组,只在无人引用时才回收。
assert('142-1 wCleanIdb 对 imgblob_ 保留/回收正确:画布引用 + 剪贴板 + 撤销历史 + 收藏组都进 keep,未引用才 del',
/if \(k\.indexOf\(IMG_BLOB_PREFIX\) === 0\) \{/.test(app53)
&& /if \(!keep\.has\(k\)\) \{[\s\S]{0,160}?ImageBlobStore\.del\(k\)/.test(app53)
&& /if \(!keep\.has\(k\)\) \{[\s\S]{0,160}?wImageBlobStore\(\)\.del\(k\)/.test(app53)
&& /if \(wIsBlobRef\(value\)\) \{ keep\.add\(String\(value\.__blob\)\); return \}/.test(app53)
&& /wClipCollectRefs\(keep\)/.test(app53)
&& /wCollectImgRefKeys\(wHistorySnapshotNodes\(\)\)/.test(app53)
+1 -1
View File
@@ -150,7 +150,7 @@ const MAX_SRC_COMPONENT_LINES = 531
// ② 同时守「app.js 占总源码 ≤ 40%」(2026-11-12 实测 38.4%)—— app.js 可以涨,
// 但必须涨得比 src 慢;功能继续加,占比自然往下走;
// ③ Workbench 单函数上限**不动**(3,091)—— 那才是真坏味道的护栏,总量松它不松。
const MAX_APP_JS_LINES = 8890 // 2026-11-17 P3:开发者模式本地插件加载器(+37 行) // 2026-11-17:市场请求改走原生 HTTP(+2 行 helper) // 2026-11-17 桌面版:插件市场(索引拉取/下载/sha256/写入 plugins/)约 +53 行;待抽到 src/runtime-plugin-market.js 后回调
const MAX_APP_JS_LINES = 8905 // 2026-11-18 桌面迁移修复:桌面端不回退 Cache Storage(WebView2 不持久)+ 存储自检接线,净增约 20 行;逻辑主体已抽到 src/ui-desktop-shell.js // 2026-11-17 P3:开发者模式本地插件加载器(+37 行) // 2026-11-17:市场请求改走原生 HTTP(+2 行 helper) // 2026-11-17 桌面版:插件市场(索引拉取/下载/sha256/写入 plugins/)约 +53 行;待抽到 src/runtime-plugin-market.js 后回调
const MAX_APP_JS_SHARE = 0.40
// ── 历史记账(供回溯,逐条保留)──────────────────────────────────────────────
+39
View File
@@ -0,0 +1,39 @@
/* storage-gc-canvas-refs-test.js —— GC 必须把画布引用算作「在用」(v3.25.9)
*
* 为什么用源码断言而不是跑行为:
* storage-file 的 gcImages 依赖 Tauri fs/path 注入与真实目录,在 Node 下完整模拟
* 等于重写一遍宿主,收益不如直接钉住「关键判据存在且顺序正确」。
* 这里钉三条:
* ① gcImages 会扫 canvases/*.json 里的 {__blob}
* ② 扫出来的 key 会并入 used 集合(少这一步等于没扫)
* ③ dryRun 报告 dangling / keptByCanvas,供确认弹窗展示
* 另加一条:图片登记后必须立即 flush(登记表不能落后于画布)。
*/
'use strict'
const fs = require('node:fs')
const path = require('node:path')
const assert = require('node:assert')
const SRC = fs.readFileSync(path.join(__dirname, '..', 'src', 'storage-file.js'), 'utf8')
const gcBody = SRC.slice(SRC.indexOf('async function gcImages'), SRC.indexOf('global.IWBStorageFile = {'))
assert.ok(gcBody.length > 200, '① 找不到 gcImages 实现')
assert.ok(/canvases/.test(gcBody) && /__blob/.test(gcBody), '① gcImages 必须扫 canvases 里的 __blob 引用')
assert.ok(/canvasKeys/.test(gcBody), '① 必须收集 canvasKeys')
assert.ok(/referenced.forEach\(\(f\) => used\.add\(f\)\)/.test(gcBody), '② 扫到的引用必须并入 used 集合(否则等于没扫)')
assert.ok(/dangling/.test(gcBody), '③ dryRun 必须报 dangling(断链引用数)')
assert.ok(/keptByCanvas/.test(gcBody), '③ dryRun 必须报 keptByCanvas(因画布引用而保留的数量)')
assert.ok(gcBody.indexOf('canvasKeys') < gcBody.indexOf('used.has(rel)'), '② 顺序错:必须先算引用再判孤儿', gcBody.indexOf('canvasKeys') + ' vs ' + gcBody.indexOf('used.has(rel)'))
// 登记后立即落盘:blob 与 dataurl 两条登记路径都要 await flush()
const putRegions = SRC.split('assets[String(key)] = {')
assert.ok(putRegions.length >= 3, '应至少有两处 assets 登记')
let flushed = 0
for (let i = 1; i < putRegions.length; i++) {
const seg = putRegions[i].slice(0, 400)
if (/await flush\(\)/.test(seg)) flushed++
}
assert.ok(flushed >= 2, '图片登记后必须立刻 await flush()(当前 ' + flushed + '/2 处)')
console.log('storage-gc-canvas-refs: 8 通过 / 0 失败')