Compare commits

...
278 Commits
Author SHA1 Message Date
qiqi 0bd85f24cc chore(release): 3.26.37 发布记录 + 站点
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m0s
2026-11-22 19:59:19 +08:00
qiqi 7700a4a26a docs: 锚点对齐 v3.26.37 2026-11-22 19:56:54 +08:00
qiqi a40c038785 release: v3.26.37(promptlib 1.6.6 变量/节点/备份/设置) 2026-11-22 19:56:04 +08:00
qiqi 64d40b7ac6 chore(plugins): promptlib 1.6.6 同步(节点封面修复) 2026-11-22 19:54:55 +08:00
qiqi c9c07e340c fix(plugins): 自包含样式去掉写死黑色(主题契约) + 1.6.5 同步 2026-11-22 19:50:52 +08:00
qiqi 3b304b3e3c chore(plugins): promptlib 1.6.5(节点封面 + CSS 自包含)同步 2026-11-22 19:49:39 +08:00
qiqi 8e19e7322f fix(plugins): pluginFilePut 解包 dataURL 取 bytes 字段(封面文件化生效)+ promptlib 1.6.4 2026-11-22 19:40:45 +08:00
qiqi 61597deb2b chore(plugins): promptlib 设置页修复同步 2026-11-22 17:27:46 +08:00
qiqi 35c8e725c4 feat(plugins): promptlib 设置页内嵌到宿主设置 + 1.6.0 同步 2026-11-22 17:26:44 +08:00
qiqi 3cb25875b3 feat(plugins): open_data_subpath 命令 + promptlib 设置页(分组/备份/数据位置)1.5.12 2026-11-22 17:25:10 +08:00
qiqi 404aa08cc6 feat(plugins): 提示词备份文件读写模块 + promptlib 1.5.9 同步 2026-11-22 17:14:47 +08:00
qiqi 4bdf6d0313 fix(plugins): 拖拽模板节点使用 plugin:promptlib:ptpl 类型 + 1.5.8 同步 2026-11-22 17:10:14 +08:00
qiqi 0c11b45af5 feat(plugins): 拖拽提示词按变量分流到模板节点 + promptlib 1.5.7 同步 2026-11-22 17:05:56 +08:00
qiqi 3e28796a15 chore(plugins): promptlib 1.5.6 同步 2026-11-22 16:58:40 +08:00
qiqi 39f123c5f3 chore(plugins): promptlib 1.5.5 同步 2026-11-22 16:53:46 +08:00
qiqi 636582bba6 chore(plugins): promptlib 1.5.3 同步(封面/加载/点击修复) 2026-11-22 16:48:05 +08:00
qiqi 5ccc6c879e fix(plugins): 暂时回退提示词插件到稳定版 1.4.10(1.5.0 点击详情回归待修复) 2026-11-22 16:33:47 +08:00
qiqi a46d874d33 wip(plugins): promptlib 1.5.0 变量/模板节点 + 封面走 promptlib 文件方法 2026-11-22 16:27:57 +08:00
qiqi c9b8bdf27c docs: 锚点对齐 v3.26.36 2026-11-22 16:16:07 +08:00
qiqi be982e4027 feat(plugins): files 能力 + zip 模块 + 提示词插件 1.5.0 数据迁移 v3.26.36 2026-11-22 16:15:29 +08:00
qiqi 412b907126 feat(plugins): zip 打包/解包模块(路径白名单 + 上限 + 重名拒绝)+ 测试 2026-11-22 16:09:56 +08:00
qiqi 0489d94461 feat(plugins): 新增 files 能力(plugin-data/<id>/files 沙箱 + 白名单/配额策略 + 测试) 2026-11-22 16:07:58 +08:00
qiqi d6271cde14 docs(plugins): ai-chat 明确为开发者直装(DEV_ONLY_IDS + README 状态)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 53s
2026-11-22 15:14:35 +08:00
qiqi eda67df9bf chore(plugins): style-source 1.3.3 token 化(深色气泡/警示色走主题 token)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m3s
2026-11-22 15:09:35 +08:00
qiqi f55f9403f5 docs: 发版锚点自动化写入规范(CONTRIBUTING / rulebook) 2026-11-22 15:00:28 +08:00
qiqi 23df59188e chore: 3.26.35 发布记录(release page/releases.json)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 39s
2026-11-22 14:59:35 +08:00
qiqi e5d0b5171b docs: 锚点对齐 v3.26.35+fca7b85(publish 自动) 2026-11-22 14:58:48 +08:00
qiqi fca7b856d4 chore: 发版脚本自动对齐文档锚点 v3.26.35 2026-11-22 14:55:10 +08:00
qiqi df3de3ce91 docs: 锚点对齐 v3.26.34
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m39s
2026-11-22 14:53:18 +08:00
qiqi b3cbfe82f8 perf: 缩略图 640/0.72 + 旧缓存清理;封面逻辑抽离;补 2 条测试 v3.26.34 2026-11-22 14:52:38 +08:00
qiqi 4b70e4029f docs+test: 原生浮层生命周期规范 + 守门测试(防面板切换残留)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 31s
2026-11-22 09:16:52 +08:00
qiqi 5830dda6ad docs: 锚点对齐 v3.26.33
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 32s
2026-11-22 09:04:39 +08:00
qiqi 83d42969f0 fix(webview): 锚点消失时立即 park,消除切换面板后的画面滞留 v3.26.33 2026-11-22 09:04:00 +08:00
qiqi ef7cdf424f docs: 锚点对齐 v3.26.32
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 31s
2026-11-22 08:57:16 +08:00
qiqi 9d6cda9cf4 chore(css): T2 第四批(canvas-topbar/home-grid)v3.26.32 2026-11-22 08:56:37 +08:00
qiqi 7a2199c09f docs: 锚点对齐 v3.26.31
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 25s
2026-11-22 08:45:10 +08:00
qiqi 2f6047d9eb chore(css): T2 第三批合并 v3.26.31 2026-11-22 08:44:31 +08:00
qiqi 77170a987a docs: 锚点对齐 v3.26.30
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 31s
2026-11-22 08:31:58 +08:00
qiqi d4fde0dbb5 chore(css): T2 第二批合并 v3.26.30 2026-11-22 08:31:19 +08:00
qiqi 2e4a7aa720 docs: 锚点对齐 v3.26.29
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 27s
2026-11-22 08:23:13 +08:00
qiqi ebb8467590 chore(css): T2 合并 .iwb-mk-card/.iwb-minimap v3.26.29 2026-11-22 08:22:34 +08:00
qiqi 67b3a6c557 docs: 锚点对齐 v3.26.28
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 26s
2026-11-22 08:11:24 +08:00
qiqi b6865fb703 chore(css): T1 去重(删死声明/空规则/游离括号)v3.26.28 2026-11-22 08:10:45 +08:00
qiqi c3bf8357b0 docs: 锚点对齐 b3bf16f(3.26.27) 2026-11-22 00:51:41 +08:00
qiqi b801198d36 docs: 第二批问题复盘(封面/停靠栏持久化/图库缩略图/市场设计约束) 2026-11-22 00:50:58 +08:00
qiqi b3bf16f52e style(settings): 插件市场/管理页交互只变色 + 移除按钮浅底 v3.26.27
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 58s
2026-11-22 00:48:46 +08:00
qiqi 6b3ba48d08 style(settings): 插件市场补回浮动触感 v3.26.26
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m1s
2026-11-22 00:44:18 +08:00
qiqi 0e69ead075 feat(settings): 插件市场全宽+淡描边+已安装徽标 v3.26.25
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m5s
2026-11-22 00:41:19 +08:00
qiqi dd38d7b663 feat(settings): 插件市场版式重设计 v3.26.24
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 48s
2026-11-22 00:36:05 +08:00
qiqi 72f0bb2aec fix(dock): 保持保存的 active 面板 v3.26.23
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 44s
2026-11-22 00:29:31 +08:00
qiqi dd498a1cf7 fix(dock): 停止用启动瞬间的面板集合重置用户摆放 v3.26.22
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m3s
2026-11-22 00:24:43 +08:00
qiqi 49a91991be chore(plugins): promptlib 1.4.10 迁移阈值修正(不再每次切面板重压)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 42s
2026-11-22 00:19:22 +08:00
qiqi e827f47d04 fix: 封面 PNG→JPEG 兜底 + 停靠栏/小地图补测 + 主题契约扩围 v3.26.21
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m11s
2026-11-22 00:16:30 +08:00
qiqi 9847373964 docs: 锚点回退到版本 bump 提交(4491b71) 2026-11-22 00:09:56 +08:00
qiqi 178cda830a chore(plugins): 同步 gallery 1.6.9 微任务绘制修复
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m32s
2026-11-22 00:09:13 +08:00
qiqi 38ec7465bf docs: 事故复盘锚点对齐发布提交 2026-11-22 00:05:57 +08:00
qiqi 1ddf89d2c3 docs: 插件样式事故复盘 + 回滚/定位/发布纪律 2026-11-22 00:05:12 +08:00
qiqi 4491b71abf fix(theme): 插件灰跟随主题 v3.26.20
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m2s
2026-11-22 00:01:38 +08:00
qiqi b1d8f4e080 docs: 基线锚点更新到 96e8cc2 2026-11-21 23:51:21 +08:00
qiqi 540eed04cc fix(plugins): gallery 1.6.9 缩略图共享/坏图兜底;顶栏更浅 v3.26.19
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m33s
2026-11-21 23:50:36 +08:00
qiqi 96e8cc2d7d fix(plugins): gallery 1.6.9 缩略图缓存共享(重排不重复取图)+ 顶栏更浅
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 43s
2026-11-21 23:48:14 +08:00
qiqi 2082ced720 fix(plugins): gallery 1.6.7 首帧后多次重测宽度(可见即重排)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 46s
2026-11-21 23:44:36 +08:00
qiqi 2c94401d45 feat(canvas): 小地图与工具栏同排 + 挤压自动隐藏 v3.26.18
Verify (Gitea) / gate (build · unit · facts) (push) Canceled after 1m40s
2026-11-21 23:42:55 +08:00
qiqi 93deea4f5e fix(canvas): 小地图缩小并上移,避开底部工具栏 v3.26.17
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m46s
2026-11-21 23:35:19 +08:00
qiqi f35ecb1790 chore(plugins): gallery 1.6.6 列宽铺满 + 外层宽度测量
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m49s
2026-11-21 23:28:11 +08:00
qiqi 6435d9e4c3 style(dock): 选中态 11%/悬停 4%;图库 1.6.4 首屏与边距 v3.26.16
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m8s
2026-11-21 23:23:22 +08:00
qiqi 0d42ebb9ae style(dock): 选中态淡底 + 去掉下划线 v3.26.15
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m15s
2026-11-21 23:18:35 +08:00
qiqi a26fb2d64d style(dock): 提示词库/节点组底色与图库一致 v3.26.14 / promptlib 1.4.8
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m33s
2026-11-21 23:12:23 +08:00
qiqi 1d0b6d2168 fix(dock): 拖宽实时更新变量 + 默认面板跨侧去重 v3.26.13
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m38s
2026-11-21 23:07:51 +08:00
qiqi 202f7b81de fix(dock): 面板去重(同侧+跨侧),修重复注册残留 v3.26.12
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m52s
2026-11-21 23:01:17 +08:00
qiqi d16f3434dd fix(plugins): promptlib 1.4.7 恢复瀑布流列规则(回退后单列问题)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m33s
2026-11-21 22:52:54 +08:00
qiqi 9c0d3b1221 revert: 回退到 v3.26.5 插件行为(v3.26.10),promptlib 回退 1.4.0 内容
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 53s
2026-11-21 22:50:21 +08:00
qiqi 5f8f4d229f fix: CSP nonce 导致动态 style 全丢(插件样式失效)v3.26.9 / promptlib 1.4.5
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m52s
2026-11-21 22:43:41 +08:00
qiqi a3edc81f55 chore(plugins): promptlib 1.4.2 自带样式(不依赖宿主注入)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 52s
2026-11-21 22:21:13 +08:00
qiqi 774b980f69 feat: 市场缓存回退 + 启动层恢复 + 卡片键盘可达(v3.26.6 / promptlib 1.4.1)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m28s
2026-11-21 22:17:46 +08:00
qiqi a993d44f4e chore: 体检清理(死代码/截图/封面瘦身/测试)(v3.26.5 / promptlib 1.4.0)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m3s
2026-11-21 22:12:01 +08:00
qiqi a8a416fa7a fix(promptlib): 无封面方形占位 + 插件灰压深(v3.26.4 / 1.3.5)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m29s
2026-11-21 22:01:46 +08:00
qiqi 9db4c15e7a feat(promptlib): 瀑布流 + 插件统一灰(v3.26.3 / 1.3.4)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m52s
2026-11-21 21:56:10 +08:00
qiqi 2fb0a6941f feat(promptlib): 封面任意比例(上传/详情/插入)(v3.26.2 / 1.3.3)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m38s
2026-11-21 21:49:07 +08:00
qiqi 0b20c5597c feat(promptlib): 详情插入图片(封面参考图节点)(v3.26.1 / 1.3.2)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m33s
2026-11-21 21:42:30 +08:00
qiqi 9f69f73443 chore(plugins): promptlib 1.3.1 详情插入后自动关闭
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m39s
2026-11-21 21:34:00 +08:00
qiqi f8635d4e19 fix(promptlib): 封面改内联压缩图(3.26.0 / 1.3.0)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m33s
2026-11-21 21:26:16 +08:00
qiqi 8aac499e11 fix(promptlib): 封面即时同步 + 弹窗线框简化(v3.25.99 / 1.2.1)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m48s
2026-11-21 19:45:50 +08:00
qiqi 6ee5a37d68 feat(promptlib): 弹窗化详情/编辑(同宽可拖动可缩放)+ coverUrl 异步(v3.25.98)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m28s
2026-11-21 19:36:53 +08:00
qiqi 1342613ab9 feat(promptlib): 封面能力 + 1.1.0 方形网格/长文详情/宽编辑(v3.25.97)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m30s
2026-11-21 19:14:21 +08:00
qiqi 754c0a39da chore(plugins): grouplib 1.0.4 交互态(插件侧,无客户端改动)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m0s
2026-11-21 18:25:23 +08:00
qiqi 97ed57714a feat(plugin-theme): 库面板配色 P1+P2(v3.25.96)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 41s
2026-11-21 18:15:59 +08:00
qiqi 036b2926ed feat(plugin-theme): 库面板配色(提示词库白卡/节点组灰卡)(v3.25.95)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 42s
2026-11-21 17:13:47 +08:00
qiqi 0439e8b743 revert: 回滚到 v3.25.88 插件渲染(v3.25.94)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m9s
2026-11-21 16:18:15 +08:00
qiqi ad4c177e55 fix(theme): 自动配色不覆盖插件表面色(v3.25.93)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m46s
2026-11-21 16:12:03 +08:00
qiqi 22f4d7adb0 fix(plugin): 插件独立底色改为可选,默认关闭(v3.25.92)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m7s
2026-11-21 16:08:22 +08:00
qiqi ad1bb6016e fix(plugin): 浏览器面板暂停自愈 + 插件作用域重映射收窄(v3.25.91)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m7s
2026-11-21 15:59:35 +08:00
qiqi 8dc01708dc feat(boot): 静态启动层 + 授权提示(v3.25.90)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m28s
2026-11-21 15:53:32 +08:00
qiqi f4e4ca5649 feat(plugin-theme): 四层插件配色规范 + 作用域重映射 + 底色深浅(v3.25.89)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 35s
2026-11-21 11:03:57 +08:00
qiqi 35ac37fb45 perf(webview): 切页 parkAll + 拖宽暂停原生视图 + 拖宽只改 DOM(v3.25.88)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 33s
2026-11-21 10:22:55 +08:00
qiqi 2a1fa03132 fix(dock): 面板按默认列表补回 + 插件页立即隐藏停靠栏(v3.25.87)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 30s
2026-11-21 09:40:48 +08:00
qiqi 78519b56d8 fix(dock): 停靠栏仅画布渲染 + 插件重启用恢复默认面板 + 保存设置按钮(v3.25.86)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 28s
2026-11-21 09:21:06 +08:00
qiqi 19c95ef6b1 style(theme): P3 收尾 + P4 插件主题契约(v3.25.85)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 29s
2026-11-21 09:01:22 +08:00
qiqi bbb763c2cf fix(ui): 取色板自动确认 + 停靠栏图标按可用面板过滤(v3.25.84)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 27s
2026-11-21 08:39:35 +08:00
qiqi 611cd8f1b9 style(theme): 语义色收口到 token + on-brand(v3.25.83,P3 第一批)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 30s
2026-11-21 08:24:56 +08:00
qiqi 73a7126e30 fix(ui): 删底栏资源库按钮 + 停靠栏按插件过滤 + 修右侧栏串面板(v3.25.82)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 25s
2026-11-21 08:19:37 +08:00
qiqi 34269f9770 feat(theme): 配色自动适配 P1+P2(4 种子派生 + 外观面板开关,v3.25.81)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 30s
2026-11-21 08:10:09 +08:00
qiqi 7a4204d0a9 perf(images): 合并预览/远程图本地缓存/legacy 清理/图库缩略图回收(v3.25.80)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 31s
2026-11-21 07:55:12 +08:00
qiqi 2860faacbb fix(images): 缩略图 MIME 魔数嗅探 + 取消在用 objectURL 撤销 + 缩略图回收(v3.25.78/79)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 25s
2026-11-21 07:41:18 +08:00
qiqi f02b3dcec2 feat(settings): 设置窗可拖动 + 外观实时预览(v3.25.76)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 32s
2026-11-21 07:24:33 +08:00
qiqi f6d104fd95 feat(shell): 状态栏内存显示 + 修外观网格设置(v3.25.74)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 30s
2026-11-21 07:05:24 +08:00
qiqi 94680fd127 perf(images): 缩略图入库预热 + 稳定 key + Blob/objectURL + 按需切原图(v3.25.73)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 25s
2026-11-21 06:53:32 +08:00
qiqi b37a1ffe78 fix(canvas): 移除遗留 content-visibility,修复节点端口被裁切(v3.25.72)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m44s
2026-11-20 23:28:04 +08:00
qiqi 17fbbd284d feat(settings): 低缩放 LOD 可关闭(v3.25.71)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m6s
2026-11-20 23:20:26 +08:00
qiqi fb3a3f3623 perf(canvas): 网格贴图化 + LOD 滞回(v3.25.70)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 41s
2026-11-20 23:14:01 +08:00
qiqi 7e544b9e10 perf(canvas): 移除低缩放 LOD + 节点去阴影(v3.25.69)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 52s
2026-11-20 23:04:49 +08:00
qiqi e79095e848 perf(canvas): 平移/缩放改走 DOM + 远视距 LOD(v3.25.68,p95 211ms→52ms)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m3s
2026-11-20 22:53:21 +08:00
qiqi 0baeda2abd perf(canvas): 缩略图生成限流 + 空闲启动 + 大图 paint 隔离(v3.25.67)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m7s
2026-11-20 22:40:40 +08:00
qiqi 1b1bcbb2cd feat(shell): 品牌标记移到标签条并改为浅色 IW;插件页保留标签条、去返回按钮(v3.25.65/66)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m12s
2026-11-20 22:21:16 +08:00
qiqi e7de1ab415 fix(shell): 插件页保留标签条 + 去返回按钮 + logo 24px + 导航底色协调(v3.25.63/64)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m34s
2026-11-20 22:13:34 +08:00
qiqi 675239f6d1 fix(shell): 保留导航首页、下掉标签条旧首页按钮、logo 缩到 28px、插件页去掉旧顶栏(v3.25.62)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 47s
2026-11-20 22:07:48 +08:00
qiqi efb885ef91 feat(shell): 去重旧入口 + 插件页重叠修复 + 品牌 W logo + 帮助与快捷键分开(v3.25.60)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m39s
2026-11-20 21:57:29 +08:00
qiqi 7b2f07bdad feat(shell): 一级导航(52px 纯图标)+ 插件整页 + 快捷键弹窗分区罗列(v3.25.59)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m5s
2026-11-20 21:47:27 +08:00
qiqi 6db5a143a8 docs(facts): 基线锚点指向 v3.25.58(c2c208f) 2026-11-20 20:50:35 +08:00
qiqi c2c208f5ce feat(theme): 左右停靠栏配色对齐主色调(进灰阶 ramp + 头部深一档 + 卡片白底)v3.25.58
- 新增 --iwb-dock-bg = color-mix(chrome 55%, canvas 45%):亮 #E2E4E6 / 暗 #717171
  改前栏身 = --iwb-panel(亮 #FFF 比画布 1.39:1;暗 #A5A5A5 比画布 2.04:1),两侧像亮度泄漏
- 新增 --iwb-dock-head-bg = color-mix(dock-bg 94%, #000):亮 #D4D6D8 / 暗 #6A6A6A
  不用「往画布色混」:暗色灰阶只有 #6F–#75,那种混法 ΔL 仅 0.006 看不见
- .iwb-pcard 补 background: var(--iwb-panel):灰栏上卡片浮出(亮 1.28:1 / 暗 1.98:1)
  该类仅 promptlib / grouplib 使用,不影响弹窗、首页、工具栏;--iwb-panel 本身不动(56 处引用)
- 顺带修版本漂移:Cargo.toml/Cargo.lock 停在 3.25.55(56/57 两次 bump 漏改 Rust 侧),
  四处现已 3.25.58;核查无代码读 CARGO_PKG_VERSION、tauri.conf 显式写 version,界面版本一直正确
- 插件零改动(其样式用 token,新栏底下对比自动成立)
2026-11-20 20:50:04 +08:00
qiqi 411a7c9572 feat(plugin): 同步 promptlib 1.0.1(分组胶囊自适应换行)
- plugins/promptlib:转为目录形态(manifest.json + main.js + styles.css),旧单文件产物清理
  (源仓带 styles.css 即自动目录化,样式才能随包分发)
- tests/plugin-promptlib-render-test.js:钉住「无滚动容器 + 全部胶囊为换行容器直接子节点」
- 市场已发布 promptlib 1.0.1(客户端仍 3.25.57,无需重装)
2026-11-20 17:37:40 +08:00
qiqi 1738027da6 feat(plugin): 同步 grouplib 1.0.3(分类胶囊自适应换行)+ 样式随包分发
- plugins/grouplib:转为目录形态(manifest.json + main.js + styles.css),旧单文件产物清理
- scripts/sync-plugins-from-repo.js:源仓存在 <id>/styles.css 的插件自动走目录形态
  (单文件产物带不走样式,否则插件自带样式会被静默忽略)
- tests/plugin-grouplib-render-test.js:钉住「无滚动容器 + 全部胶囊为换行容器直接子节点 + 分组名在同一行」
- 市场已发布 grouplib 1.0.3(客户端仍 3.25.57,无需重装)
2026-11-20 17:29:14 +08:00
qiqi 99496a530e chore(plugin): 同步 gallery 1.6.3(图幅新增极小 64 档)+ 布局回归断言
- plugins/gallery:main.js/manifest.json 升到 1.6.3,index.json 哈希同步
- ux 测试:选「极小」列宽须为 64px 且列数多于默认
- 市场已发布(纯插件,客户端仍 3.25.57,无需重装)
2026-11-20 17:13:41 +08:00
qiqi 318a7a2980 chore(plugin): 同步 gallery 1.6.2(图幅列宽上限)+ 布局回归 2026-11-20 15:02:47 +08:00
qiqi 440c4d6590 chore(plugin): 同步 gallery 1.6.1(移除搜索框) 2026-11-20 14:56:47 +08:00
qiqi f8ecb2cfba feat(plugin): 同步 gallery 1.6.0(搜索/失败统计/右键菜单/多选拖拽)+ 交互回归 2026-11-20 14:20:53 +08:00
qiqi 999dbf7fd9 docs(facts): 基线锚点同步 v3.25.57 / b955812 2026-11-20 13:42:31 +08:00
qiqi b955812658 feat(release): v3.25.57 提示词库插件化(promptlib capability + 删宿主 ui-lib-sidebar) 2026-11-20 13:42:25 +08:00
qiqi bd138b7a7e chore(plugin): 同步 gallery 1.5.1 / grouplib 1.0.2 + 回归(胶囊滚动容器、.iwb-hint 作用域) 2026-11-20 13:32:00 +08:00
qiqi 1d308377a5 fix(plugin): 同步 grouplib 1.0.1(mount 注入 ctx);回归按宿主 mount(node) 契约调用 2026-11-20 13:28:14 +08:00
qiqi cc9b4d8a09 docs(facts): 基线锚点同步 v3.25.56 / 72043e4 2026-11-20 13:14:48 +08:00
qiqi 72043e4df4 chore(release): v3.25.56 节点组库插件化 + 插件自带样式 2026-11-20 13:14:33 +08:00
qiqi d8153f24d2 feat(plugin): 节点组库插件化(grouplib capability + 删宿主侧栏),同步 grouplib 1.0.0 2026-11-20 13:12:14 +08:00
qiqi 23f82dc728 test(gallery): 断言插件样式生效(图标无框无底色、工具组横排) 2026-11-20 12:59:56 +08:00
qiqi a4aaa547a7 feat(plugin): 目录插件支持自带 styles.css(sync 拷贝+manifest.style);gallery 1.5.0 上架 2026-11-20 12:59:09 +08:00
qiqi f02f18863a fix(gallery): 图标按钮去外框 + 底栏信息区防溢出,同步 1.4.2 2026-11-20 12:53:44 +08:00
qiqi 1ddfa7f601 feat(gallery): 图标按钮样式 + 同步 gallery 1.4.1(刷新/设置不占字宽) 2026-11-20 12:50:39 +08:00
qiqi 03c79bf5e8 feat(gallery): 设置浮层样式 + 同步 gallery 1.4.0(下拉不占前台) 2026-11-20 12:45:54 +08:00
qiqi 59a90325a3 docs(facts): 同步单测文件数 106→107(新增 gallery 恢复回归) 2026-11-20 12:21:24 +08:00
qiqi 393d83550c test(gallery): 覆盖坏图不留白块 + 面板可见自动恢复/防抖/手动刷新(1.3.0 回归) 2026-11-20 12:21:19 +08:00
qiqi fb654844bf chore(plugin): 同步 gallery 1.3.0 产物(自动恢复 + 刷新按钮 + 坏图保护) 2026-11-20 12:19:13 +08:00
qiqi c7dd2c3763 docs(facts): 基线锚点指向 v3.25.55(d5449e8) 2026-11-20 12:15:18 +08:00
qiqi d5449e8b71 fix(gallery): 删除后不残留「图片已丢失」格子(deleteOutputs 返回 Promise + 插件本地先摘除)v3.25.55
- deleteOutputs 返回 Promise(删除+refreshOutputs 完成才 resolve)
- capability.remove 等删除完成再返回
- gallery 1.2.1:先本地摘除重排,250ms 后重拉校正
- 回归测试增加删除场景
2026-11-20 12:15:02 +08:00
qiqi 5c378c3d73 docs(facts): 基线锚点指向 v3.25.54(163e62f) 2026-11-20 12:09:12 +08:00
qiqi 163e62f5a3 feat(gallery): 下载重试与失败上报 + 缩略图失败重试(gallery 1.2.0)v3.25.54
- capability.download 每张最多 3 次尝试,返回 failed[];不再恒 ok
- gallery 1.2.0:缩略图 error 自动重试 2 次、可点击重试;alt 置空避免破图文字;底部状态位显示下载结果
- 市场已发布 gallery 1.2.0
2026-11-20 12:09:03 +08:00
qiqi 9d92059aac docs(facts): 基线锚点指向 v3.25.53(9ad6f72) 2026-11-20 12:03:03 +08:00
qiqi 9ad6f7230f feat(gallery-ui): 图库去标题 + 底部横栏(张数左/设定右)+ 下拉收窄 1/3 v3.25.53 2026-11-20 12:02:52 +08:00
qiqi 2e5ac0d144 test(gallery): 新增插件渲染回归(异步缩略图)+ 同步 gallery 1.0.1 产物
- tests/plugin-gallery-render-test.js:jsdom 里挂载插件,断言 2 张图都渲染、缩略图走 thumb()、无「图片已丢失」
- plugins/:gallery 1.0.1(异步缩略图修复)已同步并发布市场
- facts 计数同步
2026-11-20 11:47:55 +08:00
qiqi 744d109da3 docs(facts): 基线锚点指向 v3.25.52(e8d782b)+ 模块数同步 2026-11-20 11:32:29 +08:00
qiqi e8d782b4da feat(gallery): 图库只由插件提供,宿主删除第二份界面 v3.25.52
- 删除 src/ui-gallery-panel.js / ui-gallery-head.js 与 app.js 的图库面板装配(8951→8879 行)
- dock 图库固定 pluginId:'gallery',未安装显示安装提示
- 宿主仅保留 gallery capability(list/thumb/preview/download/insert/remove)+ 索引
- insert 支持插件传入 insertK 档位压缩
- 插件仓新增 gallery 1.0.0 并发布市场(9 个插件)
2026-11-20 11:32:16 +08:00
qiqi 2594623c09 feat(plugin): 宿主 gallery capability + 图库面板 A 方案自动切换/回落 v3.25.51
- 新增 src/plugin-api-gallery.js(list/thumb/preview/download/insert/remove),impl 由 Workbench 渲染时注入
- plugin-host 能力表加 gallery
- 右栏图库:装了插件走插件,未装或挂载失败回落宿主面板(PluginBox 支持 fallback)
- 测试与边界快照同步(能力表含 gallery)
2026-11-20 11:24:27 +08:00
qiqi 502b85d8b1 docs(facts): 基线锚点指向 v3.25.50(9b9ad5c)+ 模块数同步 2026-11-20 11:11:06 +08:00
qiqi 9b9ad5cc37 refactor(gallery): 图库面板抽成 src/ui-gallery-panel.js(M5 第 1 步,行为不变)v3.25.50
- 视图 props 化,app.js 8951→8937,为 gallery capability 腾行数
- 插入画布抽 insertOutputsToCanvas(list),单图/批量共用
- 边界快照同步(IWBUIGalleryPanel / ui-gallery-panel.js)
2026-11-20 11:10:56 +08:00
qiqi 210d6c5290 docs(facts): 基线锚点指向 v3.25.49(4d1d05a) 2026-11-20 10:57:57 +08:00
qiqi 4d1d05aaa0 fix(settings): 插件管理页 TDZ 崩溃(cmpV 改函数声明)v3.25.49
installedRows 在 cmpV 之前执行,const 未初始化 ⇒ 有已装插件时整页崩。改 function 声明(提升)。
2026-11-20 10:57:48 +08:00
qiqi 03347ef7e4 docs(facts): 基线锚点指向 v3.25.48(a21a73b) 2026-11-20 10:39:33 +08:00
qiqi a21a73b370 fix(settings): 插件全部误报「可更新」(对象比字符串)v3.25.48
- 3.25.47 把已安装映射改为 {version,dir,file},但 newer 仍用 m.version !== inst[id] ⇒ 恒 true
- 改比 inst[id].version,并统一用 compareVersions(a,b) > 0(市场回退也不误报)
- 加源文本回归钉点:禁止 m.version !== inst[id]
2026-11-20 10:39:24 +08:00
qiqi fb8d13bf5c docs(facts): 基线锚点指向 v3.25.47(94820d4) 2026-11-20 10:31:02 +08:00
qiqi 94820d4d7f feat(market-ui): 已安装同版本也能「转为新格式」重装(单文件→目录)v3.25.47
- 管理页行内动作拆成 安装/更新/转为新格式/重新安装 + 独立「移除」
- 市场卡片页给已安装插件补「重装」
- 已安装状态区分「旧格式」(index 条目只有 file、没有 dir)
2026-11-20 10:30:54 +08:00
qiqi e4bd818e15 docs(facts): 基线锚点指向 v3.25.46(ac6e599)+ 单测数同步 2026-11-20 10:21:38 +08:00
qiqi ac6e59982c chore(release): 版本号对齐 3.25.46(M3 实际未改 package.json) 2026-11-20 10:21:29 +08:00
qiqi e08fdb6271 feat(market): M3 zip 整包安装 + 逐文件 sha256 + 原子换位 v3.25.46
- gen-market 产出 <id>-<version>.zip(STORE)+ bundle/bundleSize/bundleSha256/files[];保留单文件兼容
- 安装器:下载→整包校验→解包→逐文件 sha256→路径白名单→体积/数量上限→.new→.old→rename→清理(失败回滚)
- storage-file 增 renameDir/existsDir;卸载目录插件保留 plugin-data
- 新增 scripts/plugin-zip.js 与 plugin-bundle / plugin-install 两组测试(含覆盖升级与拒绝路径)
2026-11-20 10:20:09 +08:00
qiqi 56e64decd3 docs(plugin): 补『桌面包不内置插件』前提与 M1 实施状态(目录插件待 M3) 2026-11-20 10:11:11 +08:00
qiqi d98580065f chore(plugin): 纠正『桌面包内置插件』的错误假设;annotate 试点回退单文件;市场发布 browser 1.7.0 2026-11-20 10:10:32 +08:00
qiqi 496e4b8562 docs(facts): 基线锚点指向 v3.25.44(3211beb)+ 单测数 103 2026-11-20 10:00:42 +08:00
qiqi 3211beb706 fix(plugin): 外置旧版本不再盖住内置升级(高版本胜)v3.25.44
真实事故:资料目录 plugins/ 残留 browser 1.6.0,内置已有 1.7.0,但合并规则是外置无条件覆盖
⇒ 设置里永远显示 1.6.0 且无更新入口。

- loader 新增 compareVersions(数字分段、缺段补 0)
- 合并规则:ext / 目录插件 只在版本 >= 当前时覆盖(同版本外置胜,允许本地打补丁)
- 新增 tests/plugin-loader-test.js(1.6<1.7 / 1.10>1.9 / 1.20.6>1.9.0 / 空版本)
2026-11-20 10:00:25 +08:00
qiqi f6e4441504 docs(facts): 基线锚点指向 v3.25.43(f69b7e5) 2026-11-20 09:43:11 +08:00
qiqi f69b7e5a85 feat(plugin): 浏览器插件 1.7.0 接入 ctx.data(最近访问),验证数据层真机写入 v3.25.43 2026-11-20 09:42:53 +08:00
qiqi 14fb0f489a docs(facts): 基线锚点指向 v3.25.42(7b1164f) 2026-11-20 09:28:17 +08:00
qiqi 7b1164febb feat(plugin): 插件数据层 M2 —— ctx.data(原子写 + 串行队列 + 旧数据迁移)v3.25.42
- 新增 src/plugin-data.js:read/write/patch/remove/size;桌面落 plugin-data/<id>.json(tmp+rename),
  同一插件读写串行排队,maxBytes 上限(默认 2MiB/最高 16MiB)超限抛错且不破坏已有数据
- storage-file 增加 pluginData 命名空间(read/write/remove/list)
- stripLegacy:宿主 init 前同步暂存 iwb_plugins[id].data,插件首次 read 时落盘并清暂存
- 备份携带 items.pluginData 并支持恢复;存储体检显示「插件数据 N 个 / X KB」
- 非桌面环境走 IWBStorageLocal 门面 → 内存兜底(仅测试)
- 新增 tests/plugin-data-test.js(串行/上限/迁移/备份)
2026-11-20 09:27:53 +08:00
qiqi 07d1715993 docs(facts): 基线锚点指向 v3.25.41(7ed3ba6) 2026-11-20 09:09:16 +08:00
qiqi 7ed3ba6738 feat(plugin): 插件目录化 M1 —— 目录插件加载 + 旧单文件兼容 v3.25.41
- loader 新增 loadFolder():manifest → main.js(逐文件 sha256,内置信随包 index.json)→ blob 注入;
  样式文本暂存,激活时注入、停用时移除(配合 host 新增 onActivate/onDeactivate 钩子)
- storage-file 增加 plugins.listDirs/readFile/writeFile/writeBinary/mkdir/removeDir(按段校验,禁 ..)
- app.js:三路合并支持目录条目(dir/main/style/files),失败隔离 + 按 id 排序
- 修复:无 iwb_plugins 记录时插件永不激活(首次安装面板显示「未加载」)
- 备份模块兼容目录形态;市场暂时跳过目录插件(M3 zip 后恢复)
- 试点:image-annotate 转为 plugins/image-annotate/{manifest.json,main.js}
- 方案文档 docs/PLUGIN-ARCHITECTURE-PLAN.md 一并入库
2026-11-20 09:08:56 +08:00
qiqi 8dbc0c0603 docs(facts): 基线锚点指向 v3.25.40(8fe29f2) 2026-11-20 07:42:26 +08:00
qiqi 8fe29f21c4 style(gallery): 设定行去掉三个文字标签,只留窄下拉(title/aria-label 承载语义)v3.25.40 2026-11-20 07:42:15 +08:00
qiqi 64d42d1a56 style(gallery): 设定行三个下拉再收窄(46-51px),260px 面板仍单行 2026-11-20 07:24:37 +08:00
qiqi de5c175c5e docs(facts): 基线锚点指向 v3.25.39(7b34a1c)+ 模块数 90→91 / 耦合面 75→76 2026-11-20 07:16:06 +08:00
qiqi 7b34a1c0f6 feat(gallery): 图库头部重排为 标题/操作/设定 三行,补齐批量插入 v3.25.39
- 标题独占一行;操作行 全选/反选/下载/插入/删除;设定行 插入尺寸/显示大小/时间筛选
- 去掉语义重复的「清除」与底部「自动清理」文案(连带删除 retentionText 死代码)
- 批量插入走 refSrcOf + 压缩档 + 引用化,与单图插入同一入口
- 下拉带 2 字标签并限宽 48-72px;头部抽到 src/ui-gallery-head.js(app.js 8947→8936)
- 边界快照同步新增模块与耦合面(IWBUIGalleryHead / ui-gallery-head.js)
2026-11-20 07:15:48 +08:00
qiqi cbafd38780 fix(gallery): 三个下拉收成一组(窄栏整组换行);快捷键分支合并为单行 2026-11-20 06:46:13 +08:00
qiqi db066f8769 docs(facts): 基线锚点指向 v3.25.38(540da6d,本地测试中) 2026-11-20 06:44:32 +08:00
qiqi 540da6deba fix(dock/gallery): 图库图幅自适应重做 + 左右栏快捷键 n/t + 面板层级与滚轮修正 v3.25.38
- 图库列数改为按「面板宽 / 图幅」计算(图幅可选 110/130/170/220,默认 130,持久化),
  同一图幅下列宽稳定、只靠增减列数适应面板宽度;去掉 460px 上下限(竖图不再被 letterbox 缩成小图)
- 图库头部 flex-wrap:窄面板自动两行,按钮不被挤压
- n = 右栏开合、t = 左栏开合;顶栏「图库」按钮与其快捷键一并下线(帮助/设置文案同步)
- 左右栏从标签条下方开始(top:36px),标签条恢复满宽并压在面板之上;首页/落地页隐藏停靠栏
  (原生子 webview 因 rect 归零被 park,不再盖住首页)
- 停靠栏在 .iwb-canvas 内 ⇒ 面板根节点吞掉 wheel/pointerdown/contextmenu,画布 wheel 白名单补
  .iwb-dock;图库网格 overscroll-behavior:contain
- 图库宽度测量改为可重挂(面板延迟挂载时不再固定按 300 计算列宽)
2026-11-20 06:44:16 +08:00
qiqi 1d44e04d96 docs(facts): 基线锚点指向 v3.25.37(6d66b26) 2026-11-19 22:59:52 +08:00
qiqi 6d66b260e0 fix(layout): 去掉折叠竖条,左右开关移到画布顶栏,功能图标回到顶栏右上 v3.25.37 2026-11-19 22:59:34 +08:00
qiqi 3cfe9cb128 docs(facts): 基线锚点指向 v3.25.36(9425c74),同步耦合面计数 2026-11-19 22:46:58 +08:00
qiqi 9425c74b2f fix(layout): 停靠栏置顶、折叠按钮归位、顶部功能图标上移 v3.25.36
- 左右栏 top:0 贴顶(去掉上方缺口);标签条/画布状态行按 --iwb-dock-* 内缩,标题跟随缩进
- 左栏折叠图标移到头部最右;右栏保持在最右;折叠后边缘 14px 窄条 + 展开图标
- 画布状态行右侧功能图标(主题/设置/图库/更多)上移到标签条最右;保存按钮去掉
- 更新 shell-render / single-canvas / page-chrome / left-resource 断言与 boundary 快照
2026-11-19 22:46:20 +08:00
qiqi d42752c0f4 docs(facts): 基线锚点指向 v3.25.35 的 bump 提交 6e7c221(未上线,本地测试中) 2026-11-19 22:33:27 +08:00
qiqi 6e7c22123d feat(layout): 左右停靠栏(P1 布局 + P2 图标拖拽)v3.25.35
- 新增 src/ui-dock.js(IWBDockArea):左=节点组/浏览器/风格库,右=提示词库/图库;
  默认左浏览器、右图库;独立开合、宽度自由拖动(最小 100px、无上限)、状态持久化。
- 图标横排:点击切换 / 拖动排序 / 拖到另一栏按位置插入;每栏至少保留一个面板。
- 画布不动;工具栏/小地图/提示按 --iwb-dock-l/--iwb-dock-r 让位;停靠栏从顶栏下方开始。
- 顶部资源中心按钮与 Esc 继续控制右栏;右栏默认图库。
- 更新 boundary 快照、架构文档计数与 3 个外壳结构测试。
2026-11-19 22:32:56 +08:00
qiqi 640591fda3 release(desktop): v3.25.34 Windows 包签名上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 45s
- win setup.exe 4988641B sha256 62f9e1a8…,mac 正式私钥签名(keyid f1159facd057ae17 == 公钥 17AE57D0AC9F15F1)
- latest.json / latest-windows.json 均为 3.25.34;latest.json 已合并 windows-x86_64
- releases.json 3.25.34 三平台齐平,下载页三行均可下载
2026-11-19 17:51:54 +08:00
qiqi fe34a881fa docs(facts): 基线锚点指向 v3.25.34 的 bump 提交 b4a3e94,并标注三平台已上线 2026-11-19 17:51:54 +08:00
qiqi b4a3e947b1 perf(download): awaitArchive 仅在自动下载开启时生效 + autoSaveImages 标注废弃(v3.25.34)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 49s
2026-11-19 17:06:41 +08:00
qiqi 7b8d755cac fix(download): 出图不再弹「另存为」;自动下载改为从图库原图复制 v3.25.33
① 删除 runtime-workbench-logic 里遗留的逐张自动下载(默认开、无 UI 开关),
   它走交互式 downloadUrl:写失败回退 dialog.save(默认路径是旧目录)→ 每张都弹框;
   四级兜底最后一级 openExternal → 弹出浏览器、落到浏览器下载目录。
② wSaveBlobNative 弹框只由「有没有导出目录」决定:有目录静默写,失败先 grant_dir
   重授权重试,仍失败只 toast;没目录才弹一次选位置。
③ archiveGenerationResults 改为「归档 → 刷新 → 自动下载」串行;wAddOutputs 新增
   awaitArchive 等本批原图落盘;resolveSrc 按 url 回查图库索引取 out_orig_ 原图,
   本地命中不碰图床;dataURL 直接解码 Blob。
④ 删除死代码 wSaveGenImageToDir。

app.js 行数 8947(守门上限内)。verify: build/check-dist/lint/typecheck/test:unit 全过。
2026-11-19 16:46:35 +08:00
qiqi 92370c9254 chore(plugins): 同步 image-vectorize 0.6.0(关闭按钮主色调 + 全屏源码同步)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 50s
2026-11-19 15:01:54 +08:00
qiqi 7b18451022 release(desktop): v3.25.32 Windows 包上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m13s
win 同事打包 v3.25.32 setup.exe 放 _inbox → mac 正式私钥签名(publish-windows-update.sh,sig keyid 与公钥 17AE57D0AC9F15F1 配对)→ 上传 updates/windows-x86_64/ + 写 latest-windows.json → 合并 win 进 latest.json(同批 3.25.32)→ 登记 releases.json。

最终线上:
- latest.json v3.25.32:darwin-aarch64 / darwin-x86_64 / windows-x86_64(应用内更新三平台齐平)
- releases.json v3.25.32:windows 4982485B / sha b348f012...,与本地一致
- win setup.exe 公网 HTTP 200 字节一致
- 下载页三平台均「下载」

win 用户现在可在程序里「检查更新」升级到 v3.25.32。
2026-11-19 14:38:54 +08:00
qiqi 5d0a838ded docs(win-handoff): 补「Windows 应用内更新链路 + 前提」章节 + 修正 latest.json 合并已修
新增第 6 节:win 应用内更新走 latest.json 的 windows-x86_64 条目;完整链路(win 放 _inbox → mac publish-windows-update.sh 签名 → 重跑 publish-update.sh 合并 win);前提(win 别自签、win/mac 同批同版本、NSIS 非静默、win 不改码不 push)。
第 5 节坑 2 从「长期修待办」更新为「已修(v3.25.32):publish-update.sh 从 latest-windows.json 合并 win,仅同批才合并」。原 6/7 节顺延 7/8。
2026-11-19 14:32:55 +08:00
qiqi b4bc52b177 chore(plugins): 同步 image-vectorize 0.5.0(编辑器全屏铺满)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 52s
2026-11-19 14:14:20 +08:00
qiqi 41ed7f5e0b release(desktop): v3.25.32 mac 两平台上线(2B 遮挡修复 + win 托盘图标修复)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 53s
- latest.json → v3.25.32(darwin-aarch64 + darwin-x86_64 签名产物,应用内更新可拉)
- releases.json v3.25.32:arm64 8759873B/sha aedb5abf...、intel 9161128B/sha e0e9ff07...,与本地 dmg 一致
- 下载页 mac 两平台可下载;Windows 暂未提供(win 同事打包 v3.25.32 后同批补登)
- publish-update.sh 已按版本校验拒绝把旧 win(3.25.31) 塞进 3.25.32 latest.json,避免 updater 版本错配
- 含:2B 全屏工具遮挡修复(矢量孙级递归)+ win 托盘实心主图标修复深色任务栏看不见
2026-11-19 14:13:21 +08:00
qiqi 2db8123dc2 fix(tray): win/linux 托盘用实心主图标,修深色任务栏图标看不见
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m6s
icon_as_template(true) 只在 macOS 生效(菜单栏自动反色),Windows 是 no-op → 直接渲染像素。
旧代码全平台共用 tray-template.png(黑底 + IW 镂空),Windows 深色任务栏上黑底融入背景、镂空透出背景 ⇒ 图标看不见。

build_tray 按 cfg 分平台:
- macOS:保持 tray-template.png + icon_as_template(true)(自动反色)。
- Windows/Linux:用 default_window_icon(黑底白 IW 实心主图标),不设 template;深色靠白 IW、浅色靠黑底方块,两种背景都清晰。无描边(按用户定稿)。

mac cargo check 通过;win 分支语法对称、均为现有 API,最终以 win 端构建验证。
2026-11-19 14:06:16 +08:00
qiqi 13c741e460 chore(plugins): 同步 browser 1.6.0(库面板默认缩放可配置)
从 iwb-plugins-desktop 同步 browser 插件产物(sync-plugins-from-repo.js):
- 旧 plugin-browser.91399c13d011.js → 新 plugin-browser.9e9fa4cdb25d.js(内容寻址)
- index.json:browser 1.5.0→1.6.0,integrity 更新
- 功能:库面板浏览器默认缩放可配置(panelZoom,默认 60%),宿主零改动
market/ 由 gen-market.js 重新生成(gitignore,发布时 scp 上传 NAS)。
2026-11-19 13:27:20 +08:00
qiqi ddf06fd9dc fix(canvas-webview): 2B 递归 body 子树,修矢量遮罩孙级漏检仍遮挡
实测:标注(.iwb-editor-overlay 直接挂 body)生效,但矢量(.vz-root)仍挡。
根因:vz-root 是 body→裸div(root)→.vz-root 的孙级,root 无 class/非 fixed;
旧 2B 只扫 document.body.children 第一层 → 命中裸 root(非全屏 fixed)判 false → 漏掉第二层 vz-root。

修法:慢路径从「只扫 body 直接子级」改为「递归 body 子树(限深3、命中即停)找全屏 fixed 遮罩」,
跳过 #root 子树(app 根,画布节点都在里面,递归进去既慢又误判)。vectorize 的 root 是 body 直接子级、
非 #root,递归会进它命中孙级 vz-root。标注/抠图/批量导出也一并覆盖(无论挂第几层)。

node --check / eslint / npm run build 全过;版本仍 3.25.32(未发布测试包迭代),test:facts 锚点不变。
2026-11-19 13:00:34 +08:00
qiqi c81f83edf0 docs(facts): 基线锚点指向 v3.25.32 的 bump 提交 ce44a40 2026-11-19 12:52:29 +08:00
qiqi ce44a40f5f release: v3.25.32 全屏工具打开时浏览器网页不再盖住工具(方案 2B)
症状:画布网页节点开着时,打开标注/抠图/矢量/批量导出放大预览等全屏工具,浏览器内容盖在工具上、点不到。

根因:画布网页是原生子 webview(Window::add_child),原生层永远压在 DOM 之上(z-index 无效),只能靠宿主 park。但 canvas-webview.js 的 blocked() 只认宿主三类遮罩(modal-mask/imgpreview/prompt-modal),插件全屏遮罩命名无规律(iwb-editor-overlay/iwb-cutout-overlay/vz-root/iwb-bx-zoom)且源码在独立仓库,穷举不到 → 不 park。

修法(方案 2B,插件零改动):blocked() 增加按「几何+定位」自动检测 body 直接子级里 position:fixed 且覆盖视口≥90% 且可见的浮层,命中即整体 park;保留 BLOCK_SELECTOR 快路径、跳过 #root、扫描 120ms 节流+缓存(rAF ~31fps 不掉帧)。仅改 src/canvas-webview.js(+49/−11),tick() 与下游 park 不动。

验证:node --check / eslint 0 错 / npm run build / cargo check 全过。
未验证:canvas-webview 无单测(本次未补);正确性靠手动测试矩阵;「遮罩是 body 直接子级」已静态确认三插件都有 document.body.appendChild,运行时以实测为准。
本版本暂为 mac arm64 本地测试包,未发布(未 publish-update/release.sh/push/出 win 包),测过再三平台同批上线。
2026-11-19 12:51:21 +08:00
qiqi 0851c22574 fix(release): publish-update.sh 合并 windows 条目进 latest.json + 新增 win AI 协作说明
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 45s
根因:win 应用 endpoints 只配 latest.json,但 publish-update.sh 旧逻辑硬编码只写 darwin 两平台、丢弃 windows 条目 → 每次 mac 发版都抹掉 windows,win 用户「检查更新」找不到自己平台、卡「正在检查…」(v3.25.31 实测踩过,当时手工合并救火)。

修法:写 latest.json 时从 latest-windows.json 读 windows 条目,【仅当 win 清单 version == 本次 mac version(三平台同批)】才合并;版本不一致则拒绝合并并提示「待 win 同批后重跑本脚本」,避免顶层 version 新、win 包旧导致 updater 反复提示同一旧包的死循环。
单测:UPD_VERSION=3.25.31 同批→三平台齐平;=3.25.32 win 没跟上→拒绝合并+警告。bash -n 语法通过。

另:docs/AI-HANDOFF-WINDOWS.md 给 win 端 AI 的认知/边界说明(架构根因、发布链路、职责边界、踩坑记录),配套 WIN_BUILD_SPEC.md(操作清单)。
2026-11-19 11:55:17 +08:00
qiqi 79201e6166 docs: 新增 Windows 打包与交付规范 (WIN_BUILD_SPEC.md)
面向 win 构建机:只构建、不签名(私钥不外传)、产物命名 image-workbench_<version>_x64-setup.exe、交付到 NAS _inbox、自测矩阵 5 项(重点画布网页不死锁)、红线(不改源码/不格式化/不 add -A/不 push)。
含 v3.25.31 踩坑记录:win 自签 .sig keyid 与项目公钥不配对被忽略重签;v3.25.30 旧包 updater 卡「正在检查」需手动网页升级。
2026-11-19 11:40:17 +08:00
qiqi e13ed7490a release(desktop): v3.25.31 Windows 包上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 44s
win 同事构建 setup.exe 放到 NAS _inbox/,mac 本机用正式私钥重签(win 那边给的临时 sig key ID 与项目正式 pubkey 不配对,已忽略)。

publish-windows-update.sh 完成:
- 本机签名 → .sig 452 B(key ID 17AE57D0AC9F15F1,与 tauri.conf pubkey 一致)
- 上传 setup.exe + .sig 到 NAS updates/windows-x86_64/
- 写 latest-windows.json v3.25.31

手工 update-releases.js 登记 windows-x86_64:
- file: updates/windows-x86_64/image-workbench_3.25.31_x64-setup.exe
- size: 4982545
- sha256: 1c5ae3a911f16d9481313839a4f71c51a67dbe44e4c993ba43a3c474ca6ac5e3

gen-release-page.js + gen-site.js 重生成下载页/首页/插件页 → 三平台齐平。

公网校验:
- releases.json v3.25.31 三平台 ✓
- 下载页 windows 行:版本 3.25.31 · 4.8 MB · .exe ✓
- latest.json v3.25.31(mac 两平台)✓
- latest-windows.json v3.25.31 ✓
- setup.exe 公网 HTTP 200 + 字节 + sha256 与本地一致 ✓

_inbox 中转 setup.exe 已 mv 到 _archive/(rename 不删,留作审计)。
2026-11-19 11:24:31 +08:00
qiqi cf9a8fe801 release(desktop): v3.25.31 签名产物发布 + dmg 重封对齐(应用内检查更新可用)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 47s
补做 publish-update.sh:本机签名 arm64/intel .app.tar.gz + .sig + 上传 NAS + 写 latest.json。
该脚本用 hdiutil 重封 dmg,字节与之前 release.sh 用 tauri bundle_dmg.sh 封的不同,所以重跑 release.sh --skip-build 两次让 releases.json 里的 sha256/size 对齐新 dmg,避免「网页下载校验失败」。

最终状态:
- latest.json v3.25.31(arm64/intel 两平台签名 URL)→ 应用内「检查更新」可拉新版
- releases.json v3.25.31:
  - darwin-aarch64: 8763294 B / sha=a6f40a01...
  - darwin-x86_64:  9159468 B / sha=aee258f2...
- 公网 dmg 实际字节 sha256 = 本地 = releases.json 登记(三方一致)
- 下载页:Apple Silicon v3.25.31 ✓、Intel v3.25.31 ✓、Windows「暂未提供」(待 win 同事补)
2026-11-19 11:15:16 +08:00
qiqi 297050cddf release(desktop): v3.25.31 mac 两平台上线(arm64 + intel 同批)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 42s
代码侧 commit dd0e604(async fn 修 Windows deadlock)+ 锚点 b08cb00 已 push 到 gitea/main,win 同事拉代码即可构建 v3.25.31 win 包。

本 commit 登记 mac 两平台发布产物:
- darwin-aarch64: image-workbench_3.25.31_aarch64.dmg  7912231 B
- darwin-x86_64: image-workbench_3.25.31_x64.dmg     8184387 B
两次构建同 HEAD(b08cb00),esbuild 确定性输出,dist 一致。

Windows 下载页 v3.25.31 那行目前显示「暂未提供」,等 win 同事拉代码构建 + ./scripts/publish-windows-update.sh 上传 + 手工 update-releases.js 登记后再齐平。

公网校验:两包 HTTP 200 + 字节一致;releases.json / 下载页 / 首页 / 插件页三平台状态正确。
2026-11-19 11:08:12 +08:00
qiqi b08cb00072 docs(facts): 基线锚点指向 v3.25.31 的 bump 提交 dd0e604
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 46s
PUBLISHING.md §2 红线:bump 后必须同步事实基线锚点,否则 npm run test:facts 第 7 组打红。

main = e1120ec → dd0e604,线上 v = v3.25.30 → v3.25.31。
线上状态加「未上线」标注:mac 已 cargo check 通过,但 win 包 + 三平台同批构建尚未做(Tauri 不支持 macos 交叉编译 win 产物),所以这条只是锚定本地 bump,不代表部署。

test:facts 第 7 组 全过;release-records 30/70 一致。
2026-11-19 10:58:33 +08:00
qiqi dd0e604d80 release: v3.25.31 修复画布内嵌网页在 Windows 同步命令里 deadlock
按 Tauri 2 官方文档 Window::add_child Known issues:「On Windows, this function deadlocks when used in a synchronous command」。项目里 canvas_webview_ensure 是同步 fn,第一个触发 add_child 即死锁,导致 Windows 用户开画布网页节点完全无反应。

把 8 个相关 command 改成 async fn(同 open_browser_window 模式,命令内部无 await,但走 async runtime 不占 IPC 主线程):

必改:
- canvas_webview_ensure(唯一 add_child 调用点)

防御性对齐 doc.rs 推荐(操作子 webview 主线程 API):
- canvas_webview_metrics / bounds / navigate / action / close_all

约定统一(操作独立 webview window):
- browser_control / browser_state

canvas_webview_state 仅读 url(),保留同步。

JS 层 src/canvas-webview.js 用 Promise 调用,IPC 协议透明,零改动。
未补:cwv_round 非 mac 分支是空 stub,Windows 上画布网页节点无圆角,cosmetic 另排。
未验证:Windows 实测未做(这台 mac arm64 不能交叉编译 win 产物,见 DESKTOP_BUILD.md 第四章)。修完需 win 拉代码构建 v3.25.31 包并跑测试矩阵,三平台同批齐平发布才能上线。

cargo check --release 通过(mac 侧,0 错 0 警)。
2026-11-19 10:57:34 +08:00
qiqi bff5ccd3e9 chore(release): 3.25.30 Windows 包上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 43s
2026-11-19 10:23:29 +08:00
qiqi 98bde5f0c5 release(v3.25.30): 下载页/首页/插件页同步 + releases.json + Cargo.lock 版本号
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 46s
2026-11-19 10:11:58 +08:00
qiqi 2b1ad60e39 docs(facts): 基线锚点指向 v3.25.30 的 bump 提交 e1120ec
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 45s
2026-11-19 10:05:48 +08:00
qiqi e1120ec52b release: v3.25.30(浏览器插件 1.5.0 配套客户端 + 库面板浮窗可框选)
- bump 3.25.30(package.json / tauri.conf.json / Cargo.toml)
- 同步插件源仓产物:browser 1.5.0(plugin-browser.91399c13d011.js),清掉 4 个旧 hash 产物
- CHANGELOG + 事实基线锚点
2026-11-19 10:05:33 +08:00
qiqi c60ecc7366 fix(canvas): 库面板浮窗开着时画布仍可框选;补 globe 图标给浏览器插件 tab
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 51s
- 模态层守卫收窄:只有真模态(.iwb-modal-mask/.iwb-ctxmask)才整体拦画布按下;
  库面板 .iwb-fullmask 是可拖可连的浮窗,画布露在它外面必须能框选(v3.25.21 引入的回归)
- 手势进行中(框选/平移/拖节点/连线/缩放)时 onMove/onUp 不再按 target 断流:
  否则指针划过库面板,框选卡住、在面板上松手收不了尾
- ICONS 补 globe(lucide):浏览器插件面板/网页节点此前声明 'globe' 但库里没有,tab 上渲染成空白
- e2e:新增「库面板开着仍能框选」回归测试;⑤⑦⑨ 三条右键菜单测试改到「该节点▸」二级结构
2026-11-19 09:56:36 +08:00
qiqi 3c58e2b07f fix(canvas-webview): 面板只 park 与它重叠的画布节点,不再整体 park
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 41s
原来「只要面板浏览器可见,所有画布网页节点就 park」——保守,但把面板里点
「↗ 放到画布」这个动作废掉了:新节点已经建出来,网页内容却被藏到窗口外,
用户看到的是一个空白框,像是没生效。

改成按矩形相交判断:面板锚点在左侧栏、多数画布节点在右侧,互不重叠就正常显示;
真正压在面板下面的节点仍然 park(原生层没法做部分遮挡,整块让位是对的)。

代价是 park 前的早退没了,每帧多算一次锚点 rect + contentOf —— 节点数量级很小,
相比「点了没反应」这个体验问题可以接受。
2026-11-19 09:38:45 +08:00
qiqi 1851f6cf04 feat(plugin-canvas): canvasWrite.createNode 支持插件节点变体;addPluginNode 可带初值
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 42s
浏览器面板的「↗」要从「开独立窗口」改成「在画布上建一个网页节点」。插件能拿到
canvasWrite.createNode,但它只认内置 NODE_TYPES,插件节点(plugin:<插件>:<变体>)
一律返回 null。

- createNode 的守卫改成:type 不在内置表里就交给 addPluginNode(它负责拼 plugin:xxx
  并处理 data)。变体 id 传错时 addPluginNode 返回 null,不会留下没有渲染器的空壳节点。
- addPluginNode 增加第 4 个参数 extra(初值合并进 data)并返回 node.id —— 面板要把
  当前网址、标题、zoom/paused 一起带过去,调用方也需要拿到 id 做后续操作。

为什么绕这一圈而不是给 canvasWrite 加个 createPluginNode:PluginHost.init 在 IIFE 层,
拿不到 Workbench 内的 addPluginNode,加一个方法就等于在桥对象和 canvasWrite 各加一行,
app.js 会超出 8947 行棘轮(改守卫只动 0 行,只多一行注释)。

verify:ci 全绿;app.js 8946 / 8947。
2026-11-19 09:36:26 +08:00
qiqi b736389d1c feat(settings): 插件设置支持 custom 渲染,文本控件改成左对齐上下布局
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 42s
浏览器的「书签」从一条「每行一个 名称|网址」的文本框升级成分组管理器,
通用设置行撑不住(需要分组条、多行、拖动排序),所以给 settingsSchema 加一种
type:'custom':

- 插件在 settings[key].render({value, commit, spec, pluginId}) 里返回**原生 DOM**,
  宿主用 PluginCustomSetting 组件挂载。不给 React 元素是因为插件是运行时下载的
  独立脚本,拿不到宿主 React 实例。
- effect 依赖 [value, pluginId, spec]:commit 后带新值重建;同值重渲染(改别的
  设置项、开关插件)不重建,否则正在输入的框会被冲掉。
- 插件渲染抛异常时就地降级成一行说明,不把整页设置拖白。

顺带调整布局:text/number 也改成「说明在上、控件在下」左对齐(.iwb-mk-setrow-col),
输入框 260 → 520px。原来 label 在左、控件挤在右侧窄框里,地址这类内容看不全也
改不动。boolean 仍留行末(那是开关,不是填写内容)。

app.js 未改动(行数棘轮无影响);verify:ci 全绿。
2026-11-19 09:14:48 +08:00
qiqi 9321356f59 feat(ctxmenu): 右键菜单「选中操作 / 该节点」收进二级菜单
一级原来 18 项、678px 高,屏幕下半区右键要内部滚动。现在一级只留
「添加节点 / 插件节点 / 选中操作 ▸ / 该节点 ▸」,高度 678 → 388px(无选中 355px)。

- 纯 CSS 展开(.iwb-ctx-subwrap:hover > .iwb-ctx-sub + :focus-within),
  不引入 React 状态;button 获得焦点也会展开,键盘 Tab 可用。
- 坑 1:一级菜单有 overflow-y:auto,会把绝对定位的子菜单裁掉 ⇒ 加 .iwb-ctx-noclip。
- 坑 2:子菜单自身也继承了 overflow-y:auto,把跨 6px 缝隙的 ::before 桥接裁没了,
  鼠标一滑就收起来 ⇒ 子菜单必须 overflow:visible。
- 定位:底对齐入口向上展开(两组都在菜单下半区,向下会顶出视口);
  右侧留 6px + 伪元素桥接,一级菜单 left 夹取保证右边恒有 ≥210px,200px 子菜单放得下。
- 粘贴/清空仍在同一个子菜单里,canPaste 仍只读一次 readClipboardGraph。

app.js 8946 → 8945 行(上限 8947)。verify:ci 全绿;Playwright 实测:
一级 388px、无选中 355px、跨缝隙悬停不收起、子菜单「复制选中」执行后节点数 +1。
2026-11-19 08:59:23 +08:00
qiqi 0d14728224 feat(canvas-webview): 网页节点圆角跟外观设置、长时离屏自动释放、右键菜单按选区折叠
1. 圆角跟随「外观设置 → 节点圆角」
   - cwv_round 增加 base 参数(渲染层读 --iwb-node-radius 后随 bounds 下发),
     ensure / bounds 各加一个 radius: Option<f64>,默认 14。
   - 未选中的节点位置尺寸都不动时,圆角改设置原本要等下一次拖动才生效:
     tick 里每帧用一次 radiusNow() 与 st.pr 比对,变化就主动重推一条 bounds。
   - 半径按 zoom 同比缩放,只在半径/缩放真的变了时投递,正常拖动不增加 IPC。

2. 网页节点长时不可见自动释放(省内存)
   - 每个网页节点是一个独立 WebKit 进程。持续不可见超过 5 分钟(SLEEP_MS)
     就 close 掉视图并保留 URL,回到可见时按原地址 ensure 重建。
   - 释放后不再推 bounds,不留下「已 close 还在 park」的空转。

3. 右键菜单按选区折叠
   - 没有选中节点时整组从「选中操作」变成「画布操作」,只留粘贴/清空剪贴板,
     复制/导出/收藏/删除不渲染(原来 6 项全是灰的,菜单高 678px)。
   - 无选中时菜单高 412px,屏幕下半区右键不再需要内部滚动。

顺带把「该节点」的分隔线+标题合并成一个数组展开,app.js 净减 2 行(8948 → 8946,上限 8947)。

门禁:npm run verify:ci 全绿;Playwright 实测 radius 14→20→8 联动、拖动不重推、
离屏 6 分钟后 close=1 且回屏按原 url 重建、菜单 412/678px。
2026-11-19 08:50:40 +08:00
qiqi 67472f3019 chore(release): 3.25.29 发布产物 + browser 1.4.0 市场索引
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 39s
2026-11-19 07:18:22 +08:00
qiqi 0a3c3188fc docs(facts): 基线锚点同步到 v3.25.29 的 bump 提交 596d5fd
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 39s
2026-11-19 07:13:59 +08:00
qiqi 596d5fdf82 fix(canvas-webview): 网页压住地址栏(原生/ DOM 坐标原点差)、内容跟随画布缩放
用户反馈:地址栏和前进/后退/刷新按钮被网页盖住,只剩左上角一小块;
缩小画布后网页内容不跟着缩,反而按原宽度重排。

根因一:坐标原点差
  add_child / set_bounds 的 LogicalPosition 以**窗口边框**左上角为原点,
  而 getBoundingClientRect() 以**内容视图**左上角为原点 —— macOS 标准标题栏下差 32pt。
  于是每个画布网页整体上浮 32px,正好压住 34px 高的工具栏。
  最小 Tauri 工程实测:窗口 frame=1000x760、DOM innerHeight=728;子视图 y 传 200
  实际落在 168;把 y 改成 232 后红框精确落在内容原点+(300,200)。
  修法:新增 canvas_webview_metrics 回报窗口边框尺寸,渲染层用它减 window.innerHeight
  得到补偿值,推 rect 时加上(全屏时标题栏消失,差值自动回 0)。

根因二:页面 zoom 恒为 1
  rect 跟着画布缩,但页面缩放没变 ⇒ 视口变窄后网页重排,看起来「内容没缩小」。
  现在 zoom = 画布缩放 × 节点缩放(新命令参数 + Webview::set_zoom),
  网页像图片一样跟着画布一起缩放。

其它:
- 引擎把原生视图裁到「节点 ∩ 画布」,且上边界不越过工具栏底 —— 布局再变也压不住按钮
- 取消「选中时内缩 12px」:缩放手柄在节点外侧,本来就不用让位;点选不再让网页重排
- 尺寸推送从「只等静止」改为「静止优先 + 连续变化时每 120ms 跟一次」,缩放过程不脱节
- 暂停语义:插件写 data-iwb-cwv-paused,宿主关掉视图并保持关闭(✕ 才真的能关)
- 诊断:ensure/bounds 日志带上 off/zoom;page:started/finished 回传加载态与真实地址

版本 3.25.29
2026-11-19 07:13:51 +08:00
qiqi dc7c1cc65a chore(plugins): 收进 browser 1.3.0 运行时产物
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 42s
2026-11-19 06:49:11 +08:00
qiqi 158ce77ad8 chore(site): 发布产物同步到 v3.25.28(含 browser 1.3.0 插件清单)
Verify (Gitea) / gate (build · unit · facts) (push) Canceled after 33s
2026-11-19 06:48:38 +08:00
qiqi eca46fee54 docs(facts): 基线锚点同步到 v3.25.28 的 bump 提交 383b28c(模块数 88→89)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 38s
2026-11-19 06:45:02 +08:00
qiqi 383b28cc77 fix(canvas-webview)!: 恢复画布内网页,修好「一动就白 / 只有某个缩放比例能看」
推翻 v3.25.27 的「下线」判断。用户补充的现象是决定性的:
不动时有内容,移动/缩放节点/缩放画布之后就没了,只有某个缩放区间能看。
这不是平台随机失效,而是我们两个策略的必然结果:

1) 「动就藏」——单帧位移/尺寸变化 > 18px 就判定拖动并隐藏,停 140ms 再显示。
   缩放画布与拖缩放手柄都在阈值之上 ⇒ 一动就藏。
2) 「< 64x48 就隐藏」——画布缩小后节点必然变小 ⇒ 只有某个缩放比例能看见
   (正是用户说的「某一个画布缩放大小时显示」)。

最小 Tauri 工程逐帧截图证明平台是安全的:子 webview 连续 60 帧改尺寸、
1x1 极值、连续移动、移出窗口再移回,全都不白。问题全在调度策略。

改动:
- 取消「动就藏」:移动/拖动/缩放全程可见;只有画布切走、模态遮罩、
  交集 < 2px 三种情况才隐藏
- 取消尺寸门槛:交集 >= 2px 就显示
- 位置+尺寸用一次 set_bounds 推送(替代 set_size + set_position 两条消息,
  两条之间有「新尺寸+旧位置」的中间态,是白屏的另一个来源)
- 仍永不 show()/hide()(macOS 上 hide 后 show 静默失效),隐藏 = 停到窗口外
- 位置随时跟(节流 40ms),尺寸静止 120ms 后再推
- 保留自诊断:Err 原文写进节点 + 重试、15s 加载超时提示、_cwv.log

本机真实应用实测:三个节点(baidu/huaban×2)全部出页面,窗口从 3228x2418
缩到 1180x760 后仍在且正常重排。

版本 3.25.28
2026-11-19 06:44:53 +08:00
qiqi 63a48047a3 chore(site): 发布产物同步到 v3.25.27(releases.json / 首页 / 下载页 / 插件页 browser 1.2.0)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m9s
2026-11-19 00:14:45 +08:00
qiqi a3417e9315 docs(facts): 基线锚点同步到 v3.25.27 的 bump 提交 dce8aac(模块数 89→88)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m24s
2026-11-19 00:11:54 +08:00
qiqi dce8aac1f3 refactor!: 下线画布内网页节点(原生子 webview 路线的维护成本远超收益)
背景:画布内网页用 Window::add_child 挂原生子 webview,连续踩到三个平台坑且修不干净:
- hide() 之后 show() 静默失效(都返回 Ok,网页永久不再绘制);
- get_webview_window("main") 在出现任何子 webview 后永久返回 None;
- 子 webview 抢指针事件,拖动只能靠标题栏。
剩下的日常操作(换工作区、LOD 降级、快速拖拽、被遮挡)全靠每帧推 bounds / 挪出窗口 /
延迟 900ms 回收这类脆弱补偿兜底 ⇒ 撤掉,不留半成品。独立窗口浏览器不受影响。

删除:
- Rust:canvas_webview_ensure/bounds/navigate/action/state/close_all 六个命令 + _cwv.log 诊断(约 250 行)
- 前端:src/canvas-webview.js(463 行)+ build.js 模块登记(89 → 88)
- 插件 browser:节点类型 web 与 nodeTypes 能力(1.1.1 → 1.2.0,市场已更新)

保留(与本功能无关的独立修复):save_geom/restore_geom/托盘/单实例改用 get_window。

版本 3.25.27
2026-11-19 00:11:47 +08:00
qiqi a642e7f286 docs(facts): 基线锚点同步到 v3.25.26 的 bump 提交 f9c7003
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m9s
2026-11-19 00:06:59 +08:00
qiqi f9c700304b fix(canvas-webview): get_webview_window 在有了子 webview 之后永久返回 None
现象:第一个网页节点正常,从第二个开始一律「画布网页启动失败:主窗口不存在」。

根因:tauri 的 get_webview_window 内部要求 is_webview_window()——该窗口下所有
webview 的 label 都必须等于窗口 label。add_child 建出 cwv-xxx 之后这个条件立刻为假,
get_webview_window("main") 从此永远返回 None(最小工程实测:建完子 webview 后
get_webview_window(main)=None、get_window(main)=Some("main"))。

- canvas_webview_ensure 改用 get_window("main"),直接拿 add_child 的宿主 Window
- 同一个坑还悄悄弄坏了窗口几何记忆:save_geom/restore_geom 也用 get_webview_window,
  只要画布上有网页节点,关窗口时尺寸就存不下来 —— 一并改 get_window
- 托盘「显示主窗口」/「隐藏到托盘」/单实例聚焦同样改成 get_window
- ensure 取不到窗口时写 _cwv.log

版本 3.25.26
2026-11-19 00:06:21 +08:00
qiqi e6645f6e29 docs(facts): 基线锚点同步到 v3.25.25 的 bump 提交 42435a0
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m46s
2026-11-18 23:55:45 +08:00
qiqi 42435a0d39 fix(canvas-webview): 子 webview 的 hide/show 静默失效,改用移出窗口替代隐藏
现象:画布内网页节点建得起来,但画布一动网页就永久消失,用户看到一直是一块空白。

根因(最小 Tauri 工程实测):macOS 上对 Window::add_child 创建的子 webview
调 hide() 之后再 show(),两个调用都返回 Ok,网页却再也不出现。而位置同步引擎
在每次快速平移/缩放/拖动时都会先隐藏,所以拖一次画布就再也回不来。

- bounds 改为把视图挪到窗口外(-20000,-20000)代替 hide:NSView 在父视图外
  不绘制也不接收事件,效果等价,且移回原位有效(同一工程验证)
- ensure 失败回滚 open 并 1.5s 重试;bounds 返回找不到 webview 时同样回滚重建
  (原实现先置 open=true 再请求,一次失败就永久卡在「已创建」)
- 新增 _cwv.log 诊断日志 + page:started/finished 事件;创建失败/加载超时才
  把原因写进节点,不再让用户面对无法解释的空白
- 模态遮罩只认真正可见的(尺寸>=8x8),避免常驻 display:none 的遮罩让网页永不显示

版本 3.25.25
2026-11-18 23:55:21 +08:00
qiqi 77574b00b9 fix(build): strip-plugins 改用 rename,避免撞执行环境的批量删除上限
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 59s
build.js 开头已递归删过 dist(50+ 文件),紧接着再 rmSync dist/plugins 会触发
「单轮批量删除」阈值(50)而整个构建失败(v3.25.24 首发两次卡在这里)。
rename 不产生删除操作,效果等同;跨设备时退回逐个 unlink。

同步 site/ 生成物(首页 v3.25.24 / 下载页 26 个版本)。
2026-11-18 23:37:04 +08:00
qiqi 0b7c1b30f0 fix(canvas-webview): 网页裁到「节点 ∩ 画布」而不是整个隐藏;插件补旧客户端提示
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m35s
实测问题:画布不够大时节点必然溢出,原逻辑「不完全在画布内就隐藏」会让画布节点
永远是一片白,用户以为功能坏了。改成交集裁切:既不越界盖住侧边栏(原生层不受
overflow:hidden 约束),又保证只要节点露得出来就能看到网页。裁切只在 settle 后
推一次 bounds,不会随拖动逐帧重排。

插件 1.1.1:节点体检测宿主有没有 IWBCanvasWebview 引擎,旧客户端直接提示
「需要 v3.25.24 及以上」—— 上一轮插件先上架、客户端没升级,用户只看到白屏。
2026-11-18 23:32:49 +08:00
qiqi 92dad3abad docs(facts): 基线锚点同步到 v3.25.24 的 bump 提交 48052c9
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m32s
2026-11-18 23:29:38 +08:00
qiqi 48052c96fb release: v3.25.24 画布内嵌网页节点 2026-11-18 23:29:21 +08:00
qiqi 05dd343155 feat(canvas-webview): 画布内嵌网页节点(原生子 webview)
- lib.rs:新增 canvas_webview_ensure/bounds/navigate/action/state/close_all,
  用 Window::add_child 建 label=cwv-<节点id> 的子 webview(tauri 启用 unstable feature)。
  子 webview 不在 capabilities ⇒ 外部页面拿不到宿主 IPC。
- 新增 src/canvas-webview.js:锚点扫描 + 每帧位置同步。自启动、对 app.js 零侵入
  (app.js 总行数棘轮只剩 1 行余量)。快速平移缩放拖拽时先隐藏避免拖影;
  节点必须完整落在画布内才显示(原生层不受 overflow:hidden 约束,溢出会盖住侧边栏);
  选中时内缩 12px 露出缩放手柄;锚点消失 900ms 后才回收(LOD 降级不重载页面)。
- 插件节点可声明初始宽度:nodes.register 的 width 经 addPluginNode 生效。
- browser 插件 1.1.0:新增「网页」节点(地址栏 + 后退/前进/刷新/关闭)。
- 同步模块顺序快照与架构文档计数(89 个模块)。
2026-11-18 23:29:17 +08:00
qiqi c078626a5c fix(release): 更新源 latest.json 断链 + 五个发布链坑
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m27s
- publish-update.sh:只让 tauri 打 .app(含 .app.tar.gz + .sig),dmg 改 hdiutil 封
  —— create-dmg 的 bundle_dmg.sh 在 macOS 26.6.2 上必失败(grep: bad regex)。
- update-releases.js 记录内容指纹 h,gen-site / gen-release-page 的下载链接带 ?h=<sha12>:
  Cloudflare 对 updates/*.dmg 强缓存 4 小时,同名重传会返回旧字节(本次实测哈希对不上)。
- release.sh 校验按指纹回读;说明用数组传参(不再被空格拆词)。
- CHANGELOG 记入本次发布链路修复。

发布结果:latest.json 3.25.23,双架构 tar.gz + minisign 签名就位,
aarch64 dmg 8,696,185 B / sha256 774a56bb… 与 releases.json 一致。
2026-11-18 22:58:34 +08:00
qiqi 69da8059fc fix(release): release.sh 四个坑 + 重新生成站点
- --notes 用数组传参:原来 EXTRA="--notes $NOTES" 展开按空格拆词,说明被腰斩(线上只剩「…(插件」)。
- 下载页上传到 $NAS_DIR/download/:原来和首页同目录 scp,两个 index.html 互相覆盖,首页被下载页顶掉。
- 发布时跑 gen-site.js 并上传首页/插件页/plugins-index.json:否则包已新版、首页还写着「下载 v3.25.22」。
- 校验步骤超时 20s→120s 且失败显式报错:8.7MB 包走隧道回读会超时,set -e 下无声退出,看起来像发布成功。

同步重新生成 site/(首页 v3.25.23 / 8.3 MB、插件页 8 个含 browser)。
2026-11-18 22:51:49 +08:00
qiqi 642a42c242 chore(release): Cargo 包版本对齐 v3.25.23(此前只有 package.json 与 tauri.conf.json 跟着 bump) 2026-11-18 22:45:54 +08:00
qiqi 318d320ded docs(facts): 基线锚点同步到 v3.25.23 的 bump 提交 1961488 2026-11-18 22:42:47 +08:00
qiqi 1961488b57 release: v3.25.23 应用内浏览器(独立窗口 + 控制命令)+ 插件上架市场 2026-11-18 22:42:38 +08:00
qiqi 82885a7733 docs(plugin): 补市场发布第 4 步的实际命令(ssh/scp/chmod/回读核验)与只读位、旧二进制两个坑 2026-11-18 22:41:29 +08:00
qiqi a4a899f424 feat(browser): 应用内浏览器插件 + 独立浏览器窗口命令
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m8s
- lib.rs:新增 open_browser_window(label=browser 单窗口复用,原生 navigate 导航,
  只放行 http/https),以及 browser_control(back/forward/reload/close)、
  browser_state(open/url)两个主窗口发起的控制命令。
- 窗口几何按 label 存取:主窗口沿用 window-geom.json,浏览器窗口用 browser-geom.json
  (下限 800x600,换显示器只恢复尺寸)。
- 修 CloseRequested 对非 main 窗口也 prevent_close 的问题:此前浏览器窗口点 ✕ 只是被隐藏,
  页面/音频在后台继续跑且再也关不掉。现在非 main 窗口正常销毁。
- 同步源仓新增 browser 插件(上架白名单 + meta 展示信息 + 产物 plugin-browser.1bcb58.js)。
2026-11-18 22:40:29 +08:00
qiqi 9891e819b4 fix(facts): 架构文档基线锚点补到 v3.25.22 的 bump 提交 017a71f
上一版发布时漏同步锚点,test:facts 第 7 组打红(守卫要求文档锚点 = 最近一次 bump 版本提交)。
2026-11-18 22:40:24 +08:00
qiqi 017a71f43b feat(appearance): 连线/画布/节点全面可自定义 + 四套预设 + 导入导出(v3.25.22)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m21s
2026-11-18 21:53:56 +08:00
qiqi 759e097971 fix(ui): 设置面板操作不再穿透到画布(模态层指针守卫)+ 自动下载命名改回 gen_<时间戳>_<随机>(v3.25.21)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m47s
2026-11-18 21:32:55 +08:00
qiqi a742fea2db feat(download): 导出目录三态逻辑(自动下载=出图即落盘/目录决定是否弹框/不覆盖同名)+ 取色器按钮修复(v3.25.20)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m1s
2026-11-18 21:18:58 +08:00
qiqi cad17e0aef chore(release): 3.25.19 Windows 包上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m11s
2026-11-18 18:44:00 +08:00
qiqi 0bf83c96b2 style(gallery): 图库顶部两个下拉紧凑化,省横向空间(v3.25.19)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 54s
2026-11-18 18:24:56 +08:00
qiqi 6f3eb0a06c docs: 同步事实基线锚点(v3.25.18) 2026-11-18 18:02:42 +08:00
qiqi 1f833c5222 feat(ui): 工单#3 六项(连线默认灰/备份瘦身/下载统一+重名保护/主题迁入外观/图库插入尺寸档/输出下载走本地)v3.25.18
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 56s
2026-11-18 18:01:57 +08:00
qiqi f136601869 docs: 同步事实基线锚点(v3.25.17) 2026-11-18 17:24:44 +08:00
qiqi 3ecd07ef3c fix(icon): macOS 26 灰底(改不透明满幅源)+ 托盘换新 IW 挖空符号(v3.25.17)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 46s
2026-11-18 17:23:59 +08:00
qiqi 3eed42d43d docs: 同步事实基线锚点(v3.25.16) 2026-11-18 17:08:21 +08:00
qiqi dbbd558160 feat(icon): 更换应用图标为黑底圆角 + 白色 W(满幅 1024 源,mac/win 全套重生成)v3.25.16
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 58s
2026-11-18 17:07:39 +08:00
qiqi eec99144f3 chore(release): 3.25.15 Windows 包上线(三平台齐平,清单解耦生效)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 54s
2026-11-18 16:09:14 +08:00
qiqi 3a4ebc2eb3 docs: 更新 Windows 构建提示词到 v3.25.15(桌面客户端口径 + 16 条自测) 2026-11-18 15:41:02 +08:00
qiqi 84c2c10c0c docs: 同步事实基线锚点(v3.25.15) 2026-11-18 15:36:07 +08:00
qiqi cb6dcd1813 chore: 彻底转桌面客户端,删除网页版部署面(_headers/functions/wrangler + 相关 spec);更新清单平台解耦(v3.25.15)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m33s
2026-11-18 15:35:13 +08:00
qiqi 3fcc003738 test(csp): 桌面 CSP 守卫只断言桌面配置,不与网页 _headers 挂钩(本项目是桌面客户端)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m43s
2026-11-18 15:10:41 +08:00
qiqi 856e34a3f0 fix(csp): 桌面版重新放行 30092(修鲜艺抠图/批量导出)+ 门禁测试;feat(ui): 外观 tab(画布底色/主题色)(v3.25.14)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 10s
2026-11-18 14:56:23 +08:00
qiqi 1a0998b1d4 chore(release): 3.25.13 Windows 包上线(三平台齐平)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m27s
2026-11-18 13:48:35 +08:00
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
217 changed files with 19345 additions and 6449 deletions

No files matched your search

+4
View File
@@ -22,3 +22,7 @@ release/
# 插件市场产物(由 scripts/gen-market.js 生成,发布时 scp 上传)
market/
# 临时截图/调试产物(不入库)
_*.png
_tray-preview/
+5
View File
@@ -0,0 +1,5 @@
{
"nodes": [],
"edges": [],
"groups": []
}
+3
View File
@@ -0,0 +1,3 @@
{
"activeCanvas": "Main"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

+1 -1
View File
@@ -447,7 +447,7 @@
| 拆 `app.js` 但不处理钉点 | 一次红几百条,无法定位问题 |
| 重排 529 个 tag | 代价大、收益小;已用 CHANGELOG 说明缓解 |
| 用 `c8` / `nyc` 量本仓覆盖率 | **实测不可用**:src 模块用 `window.eval()` 加载(无脚本名),V8 无从归属。见规则库 §13.42 |
| 删除生产 CSP 里的 `127.0.0.1:30092` | **不是残留**,是 2026-10-17 有意为「本地服务插件」做的安全边界调整(`CHANGELOG:226`、事实基线 §265-267) |
| 删除生产 CSP 里的 `127.0.0.1:30092` | **不是残留**,是 2026-10-17 有意为「本地服务插件」做的安全边界调整(`CHANGELOG:226`、事实基线 §265-267)。**桌面客户端的 CSP 以 `tauri.conf.json` 为准**(本项目是桌面客户端,`_headers` 属旧网页部署、不约束桌面);v3.25.11 误删导致插件挂,见 `tests/desktop-csp-loopback-test.js` |
---
+1413
View File
File diff suppressed because it is too large. Load diff
+3 -3
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 116 个单测文件(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)
@@ -137,7 +137,7 @@ IWB_WRITE_BOUNDARY_SNAPSHOT=1 node tests/architecture-boundary-guard-test.js #
| **新增模块必须登记** `scripts/build.js` 的 `sourceModules`(顺序即加载序,别排序) | `tests/architecture-boundary-guard-test.js` | 打红 |
| **`src/` 不得反向依赖 app.js 的 window 全局** | 同上 | 打红 |
| **改动计数类事实**(模块数 / 耦合面项数 / spec 数)**必须同步**事实基线文档 | `tests/architecture-facts-guard-test.js` | 打红 |
| **发版后必须同步事实基线锚点**(第 4 行的 `main = <SHA>`) | 同上 | 打红。查 SHA 的正确方法见 `PUBLISHING.md` 第 1 步 |
| **事实基线锚点**(第 4 行 `main = <SHA>`)由 `publish-update.sh` **自动对齐并提交**(`scripts/set-doc-anchor.js`);手工改仍可用 | 同上 | 打红(若 bump 未提交,脚本会 WARN 跳过) |
| **新增测试文件必须真的进门禁**(否则是「孤儿测试」= 假覆盖率) | `tests/architecture-facts-guard-test.js` 第 9 组 | 打红。确需手工探针请登记 `ALLOW_ORPHAN` 并写原因 |
| **插件运行时完整性 fail-closed**:缺 `integrity` 即拒绝加载 | `tests/plugin-integrity-test.js` | 打红 |
| **新增节点类型必须先登记 `NODE_H`** | `tests/architecture-boundary-guard-test.js` | 节点**刷新即消失**(静默!) |
@@ -190,7 +190,7 @@ release: vX.Y.Z 发版
**手动发布**,CI 只验证不部署。详见 [`PUBLISHING.md`](PUBLISHING.md)。要点:
1. bump `package.json` 版本 → **同步事实基线锚点**(否则 `test:facts` 打红)
1. bump `package.json` 版本并**提交**(锚点由随后的 `publish-update.sh` 自动写并提交;bump 未提交时脚本会 WARN 跳过)
2. `npm run verify`(含全量 e2e)
3. 提交 + 推送 + 打标签(`vX.Y.Z` / `stable-vX.Y.Z` / `stable` / `stable-verified-<日期>`)
4. `npm run deploy:test` → 测试站实测 → `npm run deploy` → 正式站
+13 -19
View File
@@ -1,9 +1,6 @@
# 🎨 生图工作台 Web 版(Cloudflare Pages 免费部署)
# 🎨 生图工作台(桌面客户端)
**在线访问:https://iwb.maqiart.eu.org**(自定义域名,Cloudflare 免费 HTTPS)
基于 **OpenAI 兼容生图 API** 的节点式图形化生图工作台,纯前端实现(Cloudflare Pages 免费托管)。
基于 **OpenAI 兼容生图 API** 的节点式图形化生图工作台。**Tauri v2 桌面客户端**(macOS / Windows),数据全部落在本机资料目录。
- **零后端**:数据保存在浏览器(localStorage + IndexedDB),图片生成直连兼容 API;Tuzi 生图固定使用 generations、要求 URL 响应,参考图允许公网 URL 与本地 Base64,且不自动重试
- 与独立版功能一致:无限画布、节点连线、文生图/图生图、参数设置(比例/分辨率对齐接口)、提示词库、节点组收藏、图库、右键菜单、双击聚焦/适应视图、标注节点等
@@ -13,7 +10,7 @@
- 稳定性边界:保存失败会保留恢复快照并支持重试,离页前执行本地兜底;启动时检查 localStorage/IndexedDB 可用性并显示异常。
- 构建:`npm run build` 用 **esbuild 压缩打包**(单 `dist/app.js` = `src/` 模块按序拼接 + `app.js`,另有压缩 `style.css`;`dist/` 不再有 `src/`),并生成带 Git commit 元数据的 `dist/version.json`。
- 测试:`npm test` 运行 jsdom 契约测试,`npm run test:e2e` 构建后启动本地静态服务器并运行 Playwright Chromium 测试;`npm run verify` 执行完整验证。
- 发布:`npm run deploy` 仅在完整验证通过后,将 `dist/` 上传到 Cloudflare Pages。
- 发布:`./scripts/publish-update.sh <版本>` 构建 macOS 双架构并写更新清单;Windows 用 `./scripts/publish-windows-update.sh <setup.exe>` 重签并写独立清单(`latest-windows.json`)。
## 第三方许可
@@ -29,27 +26,24 @@
**想知道「这个项目还有什么待办」** → [`BACKLOG.md`](BACKLOG.md)(唯一入口:优先级 + 证据链接 + 明确不做的项)。
## 部署到 Cloudflare Pages(免费)
## 构建与发布(桌面客户端)
### 本地手动发布(本仓库方式)
> 已从网页版迁移为桌面客户端,**不再部署 Cloudflare Pages**(`_headers` / `functions/` / `wrangler.toml` 已删除)。
```bash
npm ci
npm run deploy # 正式站(--branch main)
npm run deploy:test # 测试站(--branch test)
npm run build # 前端产物 dist/(esbuild 压缩)
npx tauri build # 桌面安装包(macOS: .app + dmg / Windows: nsis)
```
`npm run deploy` 会先跑完整 `verify`,通过后再把 `dist/` 上传到 Cloudflare Pages。
| 平台 | 命令 | 产物 |
| --- | --- | --- |
| macOS | `./scripts/publish-update.sh <版本>` | `updates/latest.json` + 双架构 dmg / app.tar.gz |
| Windows | `./scripts/publish-windows-update.sh <setup.exe>` | `updates/latest-windows.json`(平台独立) |
### CI(只验证,不部署)
两个平台的更新清单**完全解耦**:mac 发版不影响 Windows 版本号,反之亦然。
`.github/workflows/verify.yml` 在**推送到 `main` 与向 `main` 开 PR** 时执行验证门禁,分两个 job:`gate`(`npm ci` + `npm run verify:ci` = 构建 + 校验 + lint + 单测 + 事实守卫)与 `e2e`(Playwright + `npm run test:e2e`),**不自动部署**。
发布配置位于 `wrangler.toml`,Cloudflare Pages 输出目录固定为 `dist/`。部署前生成的 `version.json` 可用于确认线上版本和 Git commit。
### 绑定自定义域名(可选)
Pages 项目 → **Custom domains** → 添加域名(免费 HTTPS 自动签发)。
CI:`.github/workflows/verify.yml` 在推送 `main` 与向 `main` 开 PR 时执行 `npm run verify:ci`。
## 使用前配置
-9
View File
@@ -1,9 +0,0 @@
/*
X-Content-Type-Options: nosniff
Referrer-Policy: no-referrer
Permissions-Policy: camera=(), microphone=(), geolocation=()
Content-Security-Policy: default-src 'self'; script-src 'self'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' https: data: blob:; connect-src 'self' https: 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'
/sw.js
Cache-Control: no-cache, no-store, must-revalidate
Service-Worker-Allowed: /
+668 -457
View File
File diff suppressed because it is too large. Load diff
+122
View File
@@ -0,0 +1,122 @@
# 给 Windows 端 AI 的协作说明(Image Workbench 桌面版)
> 这份文档是给 **Windows 构建端的 AI agent** 读的。读完你应理解:项目架构、为什么 Windows 之前开不了网页、发布链路、你的职责边界、这次踩过的坑。
> 详细打包步骤见仓库 `docs/WIN_BUILD_SPEC.md`(gitea/main)。本文是「认知 + 边界」,那份是「操作清单」。
---
## 1. 项目是什么
- Image Workbench:Tauri v2 桌面应用(本地优先的 AI 生图无限画布)。
- 仓库:`/Users/qiqi/open/github/image-workbench-desktop`(mac 端),git remote 名为 `gitea`。
- 分发:自建 NAS,公网 `https://download.maqiart.eu.org`,根目录 `/vol8/web/iwb-download`。
- 版本线:现行 `3.25.x`。**注意**:仓库里最高的 git tag `v3.87.65` 是历史遗留线,semver 更大但**不是**最新——判断最新版看 `package.json` / `CHANGELOG.md` 顶条 / `tauri.conf.json`,永远别按最高 tag。
---
## 2. 为什么 Windows 之前「开网页没反应」(核心技术根因)
应用里有**两条**开网页的路,实现完全不同:
| 路径 | Rust API | 平台 | 之前 Windows |
|---|---|---|---|
| 独立浏览器窗口 `open_browser_window` | `WebviewWindowBuilder` + `WebviewUrl::External`,**`async fn`** | 跨平台 | 正常 |
| 画布内嵌网页节点 `canvas_webview_*` | `Window::add_child`(子 webview,需 tauri `unstable` feature),**原来是同步 `fn`** | — | **死锁** |
**根因**(Tauri 2 官方文档 Known issues 原文):
> `Window::add_child` / `Window::builder` / `Webview::cookies` 在 **Windows 同步 command 里会 deadlock**(WebView2 限制),必须用 `async` command。
全工程 `add_child` 只有 1 处调用(`canvas_webview_ensure`),原来是同步 `fn` → 一点画布网页整个 IPC 主线程卡死。
**修法(v3.25.31 已做)**:把 8 个相关 command 签名 `fn` → `async fn`。这是**跨平台**修法,**不需要任何 `#[cfg(target_os)]` 分支**。JS 端本来就用 Promise 调用,IPC 协议透明,前端零改动。
**给你的关键认知**:以后看到「Windows 上某个原生能力没反应/卡死,mac 正常」,先怀疑是不是同步 command 里调了 Tauri 的 Windows 限制 API(add_child / cookies 等),而不是 win 环境坏了。
---
## 3. 发布链路(mac ↔ win 协作契约)
```
mac 改源码 → mac commit → mac `RELEASE=1 git push gitea main`
→ win `git fetch gitea && git reset --hard gitea/main`
→ win 构建 setup.exe(npm ci && npm run app:build)
→ win 自测矩阵通过
→ win 把 setup.exe 放到 NAS `_inbox/`(权限700,公网403)
→ 通知 mac:版本 + size + sha256
→ mac 签名 + 上传 + 登记 releases.json + 合并 latest.json + push
→ win 用户可更新
```
**铁律:源码只在 mac 改,win 只负责构建 + 实测 + 交付。** 不要反向(win 改 → mac 拉),会引入 CRLF 整文件 diff、rustfmt 风格 diff、win-only 死分支。
---
## 4. 你的职责边界(AI 必须遵守)
✅ 你该做:
- `git reset --hard gitea\main` 到最新
- 核对三处版本一致(package.json / tauri.conf.json / Cargo.toml)+ 确认 lib.rs 里 6 个 `async fn canvas_webview_*` 都在
- `npm ci && npm run app:build`
- 跑自测矩阵(尤其第 2 项:画布网页节点能打开、不卡死)
- 把 `image-workbench_<version>_x64-setup.exe` 放 NAS `_inbox/`
- 记录 size + SHA256,通知 mac 端
❌ 你绝不能做:
- **自己签名 / 生成 .sig** —— 更新私钥只在 mac(`~/.config/iwb-updater.key`),win 签出来的 key ID 与项目公钥 `17ae57d0ac9f15f1` 不配对,客户端会拒绝安装(这次 win 放上来的临时 .sig 就被 mac 忽略重签了)
- 改 `src-tauri\src\lib.rs` / `Cargo.toml` / `tauri.conf.json` 等任何源码
- 跑 `cargo fmt` 或让 IDE 保存即格式化
- `git add -A` / `git push gitea main`(push 是 mac 端 `RELEASE=1` 的单独动作)
- 把 `target\`、`node_modules\`、`.msi`、`.sig` 提交进 git
---
## 5. 这次踩过的坑(让你少走弯路)
1. **win 自签 .sig 无效**:win 端没有正式私钥,签出来的 sig keyid 对不上,白签。只交 setup.exe,签名交给 mac。
2. **`latest.json` 平台解耦 bug**:项目想做 mac/win 独立更新清单(mac→`latest.json`,win→`latest-windows.json`),但**应用的 `tauri.conf.json` endpoints 只配了 `latest.json`**,且 mac 发布脚本 `publish-update.sh` 写清单时**只硬编码 darwin 两平台、丢弃 windows 条目**。结果:win 用户的应用拉 `latest.json` 找不到 `windows-x86_64` → 更新无结果。**临时修**:mac 端把 windows 条目合并回 `latest.json`。**已修(v3.25.32)**:`publish-update.sh` 现从 `latest-windows.json` 合并 windows 条目,且**仅当 win version == 本次 mac version(同批)才合并**,否则拒绝并警告(防"声明新版、实际旧包"导致 updater 反复提示同一旧包的死循环)。
3. **v3.25.30 旧 win 包 updater 卡「正在检查…」**:那是旧包的 updater 行为/网络,不是发布错。诊断法:浏览器打开 `https://download.maqiart.eu.org/updates/latest.json`,能看到 `windows-x86_64` 即发布侧没问题;旧包用户**直接用网页下载 setup.exe 手动升级**最稳,装上 v3.25.31 后以后就能应用内更新。
4. **Windows 画布网页节点无圆角**:`cwv_round` 非 macOS 分支是空 stub,网页节点直角贴卡片。cosmetic,已知缺失,另排 backlog,不影响交付。
---
## 6. Windows 应用内更新链路 + 前提
**结论**:win 客户端**支持在程序里「检查更新」自动升级**,机制和 mac 一样,但**依赖 mac 端配合签名 + 合并更新清单**,win 端自己做不到完整闭环。
**更新怎么触发**
- win 客户端 `tauri.conf.json` 的更新源写死指向 `https://download.maqiart.eu.org/updates/latest.json`(和 mac 共用一个源,**不是** `latest-windows.json`)。
- 点「检查更新」→ 读 `latest.json` → 找 **`windows-x86_64`** 条目 → 下载它指向的 `setup.exe` → 用项目公钥校验签名 → 通过则运行安装、重启。
- 能否更新取决于两点:① `latest.json` 里有没有 `windows-x86_64` 条目;② 那个包是不是 mac 正式私钥签的。
**每次 win 发版的完整链路**
1. win 端:拉最新 main → `npm ci && npm run app:build` → 得 `image-workbench_<版本>_x64-setup.exe` → 自测矩阵 → 放 NAS `_inbox/`(**只放 setup.exe,不放 .sig**)。
2. mac 端:`publish-windows-update.sh <setup.exe>`(正式私钥签名 + 上传 `updates/windows-x86_64/` + 写 `latest-windows.json`)。
3. mac 端:重跑 `publish-update.sh`,把 win 条目合并进 `latest.json`(合并条件:win 版本 == mac 本次版本)。
4. 完成后 win 用户即可在程序里检查更新到新版。
**硬性前提 / 规则**
- **win 端绝不自己签名**:私钥只在 mac,win 自签 sig keyid 与公钥 `17AE57D0AC9F15F1` 不配对 → 客户端拒装。
- **win 与 mac 同批同版本**:版本不一致时 mac 的 `publish-update.sh` 会拒绝合并落后的 win 条目(防 updater 死循环)。
- **更新不是完全静默**:Windows 是 NSIS `setup.exe`,点更新会弹安装进度、装完自动重启(Tauri 在 win 的正常行为,非 bug)。
- **win 只构建、不改源码、不 push**。
**win 端一句话**:把 setup.exe 放进 NAS `_inbox/`、通知 mac 端;剩下签名 + 合并由 mac 完成,之后 win 用户就能在程序里更新。
---
## 7. 验证发布是否到位(win 用户/你都能查)
```
浏览器打开 https://download.maqiart.eu.org/updates/latest.json
→ version 应是目标版本,platforms 应含 darwin-aarch64 / darwin-x86_64 / windows-x86_64
浏览器打开 https://download.maqiart.eu.org/
→ 三平台都应是「下载」按钮,不是「暂未提供」
```
`latest.json` 是 `cf-cache-status: DYNAMIC`(CF 不缓存),改完即时生效,不用等。
---
## 8. 一句话给 win AI
> 你是构建机,不是发布机。拉最新 main → 核对版本和 async 修复 → 构建 → 自测 → 把 setup.exe 丢进 `_inbox` → 报 size/sha256 给 mac。**不签名、不改码、不格式化、不 push。** 网页下载能打开 latest.json 就说明发布没问题,剩下的是 mac 端的事。
+364
View File
@@ -0,0 +1,364 @@
# 插件目录化 + 三个库插件化 · 完整方案
> v2(2026-11-20)· 已并入「桌面端定位」「展示页例外」「不做分类」三项裁定
> 范围:插件从「单文件」改为「文件夹」;随后把 **图库 / 提示词库 / 节点组库** 改为插件
> 非目标:分类插件(画布分类维持现状);插件安全沙箱;画布内核重构
>
> **重要前提(2026-11-20 实测纠正)**:桌面包**不随包发布任何插件** —— `beforeBuildCommand` 里的
> `scripts/strip-plugins.js` 会在打包前把 `dist/plugins` 移走,插件一律从市场装到 `<资料目录>/plugins/`。
> 因此本仓的 `plugins/`(index.json + runtime + 目录插件)是**市场构建输入**,不是应用内置资源;
> 「内置插件」在桌面上并不存在。目录插件要真正可用,必须先有 M3 的 zip 安装能力。
---
## 0. 决策摘要(本方案按这 10 条执行)
| # | 决策 | 状态 |
|---|---|---|
| 1 | 应用本体 = 独立桌面端(Tauri);产品代码不加浏览器降级分支 | 已定 |
| 2 | **例外**:插件展示页 / 市场页 / 下载页仍是静态网页,继续维护 | 已定 |
| 3 | 插件格式 = 目录(`manifest.json + main.js + styles.css + data.json + assets/`) | 本方案 |
| 4 | 插件数据落 `<资料目录>/plugin-data/<id>.json`(与代码目录分离,卸载默认保留) | 建议默认 |
| 5 | 市场安装 = zip 整包 + 逐文件 sha256;安装仅桌面 | 建议默认 |
| 6 | 旧单文件插件保留一个版本周期的双轨兼容 | 本方案 |
| 7 | **不做**分类插件(`iwb_home_cats` + `workspace.category` 维持现状) | 已定 |
| 8 | 插件不得直接改画布:插入/实例化一律走宿主 capability | 本方案 |
| 9 | 市场包用 **ZIP STORE(不压缩)**,绕开旧 WebView 无 `DecompressionStream` 的兼容坑 | 复查新增 |
| 10 | 图库/提示词/节点组插件化后,**保留宿主面板一个版本周期**可一键退回(`iwb_panels_mode`) | 复查新增 |
---
## 1. 现状(代码核对过的事实)
| 环节 | 现状 | 位置 |
|---|---|---|
| 插件产物 | 单个 IIFE `<id>.<hash>.js`,内容寻址 | `plugins/runtime/` |
| 清单 | `index.json`:`{id,file,version,integrity}`;展示信息在 `meta.json` | `plugins/index.json` |
| 注册契约 | 插件自注册 `IWBPluginHost.register(manifest, factory)` | 各插件末尾 |
| 内置加载 | `<script src="/plugins/x.js" integrity=…>`(SRI) | `runtime-plugin-loader.js:54` |
| 外部加载 | 读文本 → sha256 → blob 注入 | `:71` |
| 开发模式 | **已是目录**:`<资料目录>/plugins/local/<id>/plugin.js` | `storage-file.js:441` |
| 市场安装 | 下载单文件 → sha256 → 写盘 → 重启 | `runtime-plugin-market.js:65` |
| 插件数据 | `ctx.storage.namespace(ns)` → 全量落 `localStorage['iwb_plugins']`(≈5MB) | `plugin-host.js:100` |
| 能力面 | panels/commands/nodeTypes/generationHooks/providers/canvas/canvasWrite/nodeActions | `plugin-host.js:8` |
| CSP | `script-src 'self' blob:`;`style-src 'self' 'unsafe-inline'` | `tauri.conf.json` |
| 图库规模 | 上限 500 张 | `runtime-constants.js:6` |
| 展示页 | `site/plugins/index.html` ← `gen-site.js` ← `market/index.json` | 静态站 |
三条判断:
1. **目录形态已有先例**(dev 模式),只是没推广到正式插件 → 改动可控。
2. **瓶颈是数据不是形态**:所有插件共用一个 localStorage 键,图库/提示词一大就爆。
3. **展示页与桌面端共享 `market/index.json`**:新字段只能加、不能改,原有 `name/desc/tags/version/icon/author` 必须保留。
---
## 2. 目标形态
### 2.1 目录结构
```
<插件根>/<id>/
manifest.json 唯一真源
main.js IIFE,自注册(沿用现有 register)
styles.css 可选,注入 <style data-plugin="<id>">
data.json 可选,插件数据(由宿主代理读写,见 2.3)
assets/ 可选,图标/图片(ctx.asset → data URL)
```
与 Obsidian 完全同构(`manifest.json/main.js/styles.css/data.json`),差异只有 `minAppVersion→apiVersion` 与可选 `assets/`。
### 2.2 manifest 字段
```jsonc
{
"id": "gallery", "name": "图库", "version": "1.0.0", "apiVersion": 1,
"main": "main.js", "style": "styles.css",
"description": "…", "author": "official", "icon": "🖼️", "tags": ["资源"],
"capabilities": ["panels", "gallery"],
"permissions": ["gallery.read", "gallery.delete", "canvas.insertRef"],
"settings": {},
"data": { "schemaVersion": 1, "maxBytes": 2097152 }
}
```
- `description/author/icon/tags` 接管原 `meta.json`,展示页从构建期汇总读取。
- 旧单文件插件的内嵌清单继续有效;同 id 时**目录优先**。
### 2.3 数据层(核心)
| 层 | 用途 | 落点 | API |
|---|---|---|---|
| settings | 少量配置 | `localStorage['iwb_plugins'][id].settings`(现状) | `ctx.settings`(同步,不变) |
| **data** | 业务数据 | `<资料目录>/plugin-data/<id>.json` | **`ctx.data`(异步,新增)** |
| assets | 图标/图片 | `<插件目录>/assets/` | `ctx.asset(name)` → data URL |
```js
ctx.data.read() // → object(不存在返回 {})
ctx.data.write(obj) // 全量覆盖;原子写:<id>.json.tmp → rename
ctx.data.patch(fn|obj) // 读-改-写,内部串行队列
ctx.data.remove() // 清空
ctx.data.size() // 字节数(设置页展示占用)
ctx.data.schemaVersion
```
约束:单文件上限 `maxBytes`(默认 2MiB,最高 16MiB),超限写失败并提示,不静默截断;同一插件的写串行化;**图片字节不进 data.json**(图库图仍在宿主 `images/`,data.json 只存元数据)。
三件必须同时做的事(复查补充):
- **备份/还原**:`plugin-data/` 纳入备份(新增 `items.pluginData`,体积小、默认勾选);同时改造 `runtime-plugin-backup.js`——它现在只备份单文件插件的 `code`,目录插件会丢。
- **存储审计**:`wStorageAudit` 增加「插件数据」占用,设置页可见、可清空。
- **双写禁令**:`ctx.storage`(同步、落 localStorage)从 M2 起只允许存 settings 级小值;业务数据一律 `ctx.data`。迁移后把 `iwb_plugins[id].data` 清空只留 `migratedAt`,避免两份真源。
> 唯一例外:jsdom / playwright 测试在非 Tauri 环境跑应用,`ctx.data` 保留内存兜底,标注"仅供测试",不得据此在产品代码加浏览器分支。
### 2.4 加载流程
```
内置: /plugins/index.json(构建生成的目录索引,含逐文件 sha256) + /plugins/<id>/manifest.json
外部: <资料目录>/plugins/index.json + <资料目录>/plugins/<id>/manifest.json
扫描: 桌面额外扫描 <资料目录>/plugins/*/manifest.json(手工放入、无索引也能识别)
开发: <资料目录>/plugins/local/<id>/plugin.js(免签名)
```
`loadFolder(record)`:读 manifest → 校验(apiVersion/capabilities/permissions)→ 读 main.js 并校验 hash → 注入 `__IWB_PLUGIN_MANIFEST__` → blob 注入 → 注入 styles.css → 等自注册。
> Tauri 资源协议**不能列目录** ⇒ 内置索引必须构建期生成;外部目录才可扫描。
复查补充的 4 条硬规则:
1. **信任模型**:内置插件只信**随包的** `plugins/index.json`(里面的逐文件 sha256 写死在包里);manifest 里的 hash 只用于"外部/市场安装"校验,不能拿它自证。
2. **确定性顺序**:两路合并后按 `id` 升序加载;不依赖文件系统返回顺序。
3. **失败隔离**:单个插件 manifest 损坏 / 脚本抛错 → 记 `record.error` 并跳过,**不得中断整轮加载**。
4. **注册去重**:`registerPanel/registerNodeType` 按 `pluginId + 自身 id` 去重,防止热启停导致面板重复。
### 2.5 安装(仅桌面)
市场条目:
```jsonc
{ "id":"gallery","version":"1.0.0","minApiVersion":1,
"bundle":"gallery-1.0.0.zip",
"files":[{"path":"manifest.json","sha256":"…","size":812}, …] }
```
流程:下载 zip(30s 超时)→ `wZipParseEntries` 解析 → 校验 path(禁 `../`/绝对路径)+ sha256 + size → 解到 `plugins/.staging/<id>/` → 校验 manifest 可解析且 id 匹配 → 替换目录 → 更新 index.json → 提示重启。
复查补充:
- **压缩方式固定 STORE**:`wZipReadEntry` 对 DEFLATE 依赖 `DecompressionStream('deflate-raw')`,而项目未设 `minimumSystemVersion`(默认 10.13),旧 macOS 的 WKWebView 没有该 API ⇒ 安装直接失败。插件包只有几十 KB,用 STORE 不压缩,顺带消除这个依赖。
- **Windows 覆盖替换**:`fs().rename` 在 Windows 对"已存在的目标目录"会报错。改为 `<id>.new` 就位 → 旧目录改名 `<id>.old` → rename `<id>.new` → 成功后删 `<id>.old`;失败则把 `<id>.old` 改回,保证可回滚。
- **安装限额**:解压后 ≤ 10MB、文件数 ≤ 200、单文件 ≤ 2MB;超限拒装(防 zip 炸弹与超大 assets)。
卸载:删目录 + **询问是否连数据一起删**(默认保留 `plugin-data/<id>.json`)。
### 2.6 展示页(唯一保留的网页)
`site/plugins/index.html` 与 `site/plugins-index.json` 由 `gen-site.js` 从 `market/index.json` 生成,部署在 `download.maqiart.eu.org/plugins/`。
- 页面只渲染卡片(图标/名称/版本/作者/描述/标签)+ 安装说明,**不直接读插件目录**(静态站没有文件系统)。
- 目录化后无需改页面结构;只需保证 `market/index.json` 字段可加性。
### 2.7 权限(advisory)
`permissions` 在 manifest 声明,宿主按声明放行 capability(无 `gallery.read` 就拿不到 `ctx.gallery`)。
诚实边界:插件仍运行在主页面上下文,**不是安全沙箱**;权限只是 API 门禁 + 安装时展示。
---
## 3. 里程碑
每阶段可独立发布/回滚。
### M1 目录插件加载(兼容旧单文件)
> 实施状态(2026-11-20):加载器与数据层已完成并入库;但**生产插件暂不目录化** ——
> 桌面包不内置插件、市场只支持单文件,目录插件无处可装。`image-annotate` 试点已回退为单文件,
> 等 M3 落地后再切回目录。
| 改动 | 文件 | 关键点 |
|---|---|---|
| 目录读写 API | `src/storage-file.js` | `listDirs/readFile/writeFile/writeBinary/mkdir/removeDir`;路径按段校验,禁 `..` |
| `loadFolder()` | `src/runtime-plugin-loader.js` | 见 2.4 |
| 三路合并 | `app.js` `wLoadRuntimePlugins` | 索引 + 扫描 + dev;目录优先 |
| 清单校验 | `src/plugin-host.js` `validate()` | 增 `main/style/permissions/data` |
| 构建产物 | `scripts/sync-plugins-from-repo.js` | 产出 `plugins/<id>/` + 升级版 index.json;单文件产物保留一版用于回滚 |
**验收**:`image-annotate` 转目录形态后台可加载、面板正常;其余 7 个单文件插件行为零变化。
### M2 数据层 `ctx.data`
| 改动 | 文件 |
|---|---|
| 数据适配器(Tauri 文件;非桌面内存兜底) | 新 `src/plugin-data.js` |
| `ctx.data` 注入 + 串行队列 | `src/plugin-host.js` |
| `iwb_plugins[id].data` 一次性迁移 | `app.js`(幂等,带 migrated 标记) |
| 设置页显示占用 + 清空 | `src/ui-settings-sections.js` |
**验收**:annotate 记住笔刷/颜色,重启仍在;旧数据迁移后保留一版原值。
### M3 市场 zip 安装
| 改动 | 文件 |
|---|---|
| 安装/卸载/校验/原子替换 | `src/runtime-plugin-market.js` |
| zip 读取复用 | `src/storage-zip.js`(现有 `wZipParseEntries`) |
| 市场索引生成(bundle + files)+ **Node 侧 STORE zip 打包** | `scripts/gen-market.js` + 发布脚本(复用 STORE 写法,勿引入压缩) |
**验收**:装到 `<资料目录>/plugins/<id>/` 且逐文件 hash 全对;改坏一个文件即拒装、旧版本不受影响;**Windows 上覆盖升级成功**、旧 macOS(无 DecompressionStream)也能装(因为包是 STORE)。
### M4 插件源仓构建目录化
| 改动 | 文件(iwb-plugins-desktop) |
|---|---|
| 产物改为目录(`manifest.json` + `main.js`),**CSS 仍内联** | `scripts/build-plugin.mjs` |
| 校验 manifest 完整性 | `scripts/validate.mjs` |
| 脚手架 | `template/` |
**验收**:任一插件 build + validate 后产出的目录可被 M1 直接消费;8 个插件迁移后功能一致。
> 复查修正:现有 8 个插件都是**运行时 `createElement('style')` 注入 CSS**(已实测 annotate),
> 因此 `styles.css` 只作为「手写插件」的可选项,**不改 esbuild 的 CSS 处理**,省掉一轮构建改造。
### M5 图库插件(第一个业务插件)
宿主新增 `gallery` capability(新 `src/plugin-api-gallery.js`):
```js
ctx.gallery = {
list({query, range, limit, offset}), thumb(name), original(name),
remove(names), download(names), insertToCanvas(names, {sizeK}),
on('changed', fn)
}
```
插件侧搬迁:`src/ui-gallery-head.js` + 图库网格 JSX(约 200 行)→ `gallery/main.js`;`app.js` 只留 `dockPanels` 一行注册。
**验收**:滚动/选中/全选反选/下载/插入/删除/双击预览/拖入画布 全一致;宿主删掉图库 JSX(app.js 行数下降)。
### M6 提示词库插件
宿主新增 `ctx.library.prompts`:
```js
list(), save({prompts, groups}), canvasPrompts(), insert(text, name)
```
数据搬进 `plugins/prompts/data.json`;插入画布走 `canvas.insertPrompt`(宿主实现,插件不碰画布状态)。
**验收**:增删改/分组/搜索/插入/导入导出全通;迁移前备份 `iwb_prompts`。
### M7 节点组库插件
宿主补齐 `canvasWrite`:
```js
saveSelectionAsGroup(name), instantiateGroup(snapshot), previewGroup(id)
```
**验收**:保存/应用/预览/删除全通;应用后位置不重叠、连线正确、可撤销。
---
## 4. 三个库的边界(插件化后)
| 关注点 | 归属 |
|---|---|
| 面板 UI、列表/筛选/按钮 | 插件 |
| 提示词/分组/节点组快照数据 | 插件 `data.json` |
| 图片字节 | **宿主** `images/`(不搬) |
| 图库索引 | 宿主(`out_*` + IDB),插件只读 |
| 画布插入/实例化 | 宿主 capability |
好处:卸载「图库插件」不删用户图片;卸载「提示词插件」可选连带数据。
---
## 5. 迁移与兼容
| 对象 | 策略 |
|---|---|
| 旧单文件插件 | 继续加载,给一个版本周期的双轨期 |
| 老市场单文件包 | 仍可安装(索引同时保留 `file` 与 `bundle`) |
| `localStorage['iwb_plugins']` | 一次性迁到新数据层,原值保留一版 |
| 提示词/分组 | 迁到插件 data.json,先写 `iwb_prompts_backup_<date>` |
| 图库 | **不迁移**,仍走宿主存储 |
| 测试快照 | 插件顺序/边界守门/市场测试同步;快照重生成须写理由 |
---
## 6. 回归清单(每个里程碑都跑)
1. 8 个内置插件全部加载,面板/节点/命令可用;设置页开关生效。
2. 开发者模式 `local/<id>/plugin.js` 仍可覆盖内置。
3. 同 id 的目录插件与单文件插件共存时,目录优先且只有一个实例。
4. 卸载后:面板/命令/节点类型/CSS 全部消失,无残留。
5. 数据:写→重启→读一致;并发两次写不丢(串行队列)。
6. 非桌面测试环境:插件可加载、`ctx.data` 内存兜底不抛错。
7. 桌面手工放 `<资料目录>/plugins/<id>/` 可被识别(无索引)。
8. `lint / typecheck / test:unit / test:facts` 全绿。
---
## 7. 风险
| 风险 | 缓解 |
|---|---|
| 插件无沙箱,权限只是门禁 | 安装时展示 permissions;只从官方市场安装;文档明确声明 |
| 目录形态失去 SRI | 逐文件 sha256 写进 index/manifest,加载前校验,不符拒载 |
| **桌面包无内置插件** | 删掉资料目录 `plugins/` 后所有插件消失(2026-11-20 真实反馈);目录化必须等 M3 | 文档/设置页文案明确「插件来自市场」;M3 前不发布目录插件 |
| 双后端(文件/内存兜底)行为差异 | 同一套契约测试跑两遍;兜底只在无 Tauri 时启用 |
| UI 搬迁期宿主与插件双份代码 | 每个里程碑"搬完即删",不留双轨 |
| 画布写入 API 设计不当 | capability 内部复用 `commitCanvas` + 历史栈,插件只提交声明式快照 |
| 展示页与安装器共用索引,字段冲突 | 新字段可加性;`gen-site.js` 只读已知字段 |
---
## 8. 顺序
```
M1 目录加载 ──┬─→ M2 数据层 ──→ M5 图库插件 ──→ M6 提示词插件 ──→ M7 节点组插件
└─→ M4 源仓构建
M3 市场 zip ←(依赖 M1 的文件写入)
```
M1 与 M4 可并行;M3 与 M2 可并行;M5 之后每步都复用同一种 capability 模式。
---
## 9. 复查修订(2026-11-20 · 逐项核对代码后)
复查方法:把方案里每个"技术依赖"回到代码验证(zip 解压、fs 能力、备份范围、插件 CSS 注入方式、CSP、系统版本)。
| # | 复查发现 | 影响 | 处置 | 落点 |
|---|---|---|---|---|
| R1 | `wZipReadEntry` 的 DEFLATE 依赖 `DecompressionStream`,而 `tauri.conf` 未设 `minimumSystemVersion`(默认 10.13) | 旧 macOS 市场安装直接失败 | 市场包固定 **ZIP STORE** | M3 |
| R2 | `fs().rename` 在 Windows 覆盖已存在目录会报错 | 升级安装失败、无法回滚 | `<id>.new` → 旧目录改 `<id>.old` → rename → 删 old;失败回滚 | M3 |
| R3 | `runtime-plugin-backup.js` 只 collect 单文件 `code` | 目录插件**备份后恢复不回来** | collect/restore 改为按目录收集(不含 `data.json`) | M2/M3 |
| R4 | 备份 `items` 与 `wStorageAudit` 都不含插件数据 | 换机丢插件数据、占用看不见 | 备份加 `pluginData`;审计加「插件数据」项 | M2 |
| R5 | `ctx.storage`(localStorage)与 `ctx.data` 并存 → 双真源 | 迁移后同一数据两份、互相覆盖 | storage 只留 settings;迁移后清空 `iwb_plugins[id].data` 只留 `migratedAt` | M2 |
| R6 | 方案原要求构建产出 `styles.css`,但现有插件是运行时 `createElement('style')` 注入(annotate 实测) | 白改一轮 esbuild 管线 | `styles.css` 降为**手写插件可选项**,不改 CSS 构建 | M4 |
| R7 | 注入的 `<style>` 是全局的,停用/卸载不清理 | 插件 CSS 污染宿主 UI | 注入打 `data-plugin`,deactivate 时移除;手写插件强制 `.iwb-p-<id>-` 前缀(validate 校验) | M1 |
| R8 | 目录插件若只靠 manifest 自带的 hash 校验,等于自证 | 篡改可绕过 | 内置只信随包 `index.json`;manifest hash 只用于外部/市场 | 2.4 |
| R9 | 目录扫描顺序由文件系统决定;单插件异常可能中断整轮 | 加载不稳定 | 按 id 排序 + 单插件失败隔离 | M1 |
| R10 | 每次启动对 8 个插件做 sha256 + 读盘 | 冷启动变慢 | 内置按 `mtime+size` 缓存校验结果;外部每次校验 | M1 |
| R11 | 无解压体积/文件数限制 | zip 炸弹、超大 assets | 解压后 ≤10MB、≤200 文件、单文件 ≤2MB | M3 |
| R12 | 热启停可能重复注册面板/节点类型 | 面板出现两份 | `pluginId + id` 去重 | M1 |
| R13 | `ctx.asset` 每次读字节转 data URL | 图标频繁 IO | 内置走 `/plugins/<id>/assets/…` URL;外部读一次进缓存,停用清空 | M1 |
| R14 | 图库 500 张每次全量 `list` | 面板卡顿 | 分页 + `on('changed')` 节流 + 宿主侧索引缓存 | M5 |
| R15 | 插件化后若出问题只能发版回退 | 风险高 | 保留宿主面板一版,`iwb_panels_mode = legacy \| plugin` 开关 | M5–M7 |
| R16 | 第三方缺开发文档 | 只有你能写插件 | 产出 `docs/PLUGIN-DEV-GUIDE.md`(manifest/ctx/样式前缀/调试) | M4 |
### 顺带的 4 个优化(不改结构,但省事)
1. **先空跑**:M1 只把 annotate 转目录、行为零变化,用来验证加载链;不动任何业务面板。
2. **内置不扫描**:内置只读随包索引(快且安全),只有外部目录才扫描——省掉每次启动的文件系统遍历。
3. **图库插件首版只读**:先做「列表 + 预览 + 下载 + 插入」,删除/批量操作放到第二版,缩小首个业务插件的爆炸半径。
4. **双轨只保留一个版本**:目录插件稳定后,一次性删掉单文件产物与旧市场包,避免长期两套产物。
---
## 10. 明确不做
- 分类插件(画布分类维持 `iwb_home_cats` + `workspace.category`)。
- 插件沙箱、跨插件依赖声明、热重载(安装后仍要求重启)。
- 网页版应用:只有展示页/市场页/下载页是网页。
+17 -1
View File
@@ -65,7 +65,23 @@
1. 把插件文件放进插件源仓 `iwb-plugins-desktop/<id>/src/index.js`
2. 在桌面仓跑同步:`node scripts/sync-plugins-from-repo.js`
3. 生成市场:`node scripts/gen-market.js`
4. 把 `market/` 上传到 NAS `/vol8/web/iwb-market/`
4. 把 `market/` 上传到 NAS `/vol8/web/iwb-market/`(`market.maqiart.eu.org` 的站点根目录)
```bash
# 只有索引和新增的插件文件会变;index.html 是手写页面,没改动就不用传
ssh [email protected] "rm -f /vol8/web/iwb-market/index.json"
scp market/index.json [email protected]:/vol8/web/iwb-market/index.json
scp market/plugins/plugin-<id>.<sha12>.js [email protected]:/vol8/web/iwb-market/plugins/
ssh [email protected] "chmod -R a+rX /vol8/web/iwb-market"
# 回读核验(不能只看命令退出码):索引条数 + 下载字节 sha256 与索引一致
curl -s "https://market.maqiart.eu.org/index.json?t=$(date +%s)" | head -c 200
```
> 上传前先 `ls /vol8/web/iwb-market/plugins` 对比本地:内容寻址命名下,同名文件必然同内容,只传新增的那个即可。
> NAS 上的文件是只读位(`-r-xr-xr-x`),覆盖前要先 `rm`,否则 `scp` 会报 Permission denied。
> **客户端二进制不含新命令时**(旧版本安装包):`open_browser_window` 等命令 invoke 会失败,
> 插件降级 `window.open` —— 表现为"点了跳系统浏览器"。新增宿主命令必须重新打包客户端才生效。
## 6. 注意事项
+67 -110
View File
@@ -1,151 +1,108 @@
# 任务:在 Windows 上为 image-workbench-desktop 产出安装包
# 任务:在 Windows 上为 image-workbench-desktop 构建 v3.25.15 安装包
你是这台 Windows 机器上的打包执行者。目标是把已拉取到本地的 Tauri v2 项目**构建出 Windows x64 安装包**,自测通过后交付产物信息。**只做打包相关的事,不改业务代码。**
你是这台 Windows 机器上的打包执行者。只做打包与自测,**不改业务代码**。
## 背景
> ⚠️ v3.25.15 起的变化:项目已**彻底转桌面客户端**(`_headers` / `functions/` / `wrangler.toml` 已删除,`npm run deploy` 脚本已移除);
> 更新清单**平台解耦**(Windows 用 `updates/latest-windows.json`,**由 Mac 侧用正式私钥生成,你不写**)。
- 项目:Image Workbench 桌面版(Tauri v2 + 原生 JS,前端产物在 dist/)
- 仓库目录:本机已 clone(先自己确认路径,通常在当前目录或其子目录,含 `src-tauri/tauri.conf.json`)
- 应用标识:`com.malongan.imageworkbench`
- 数据目录(运行时):`%USERPROFILE%\Documents\ImageWorkbench`
- 参考文档(仓库内):`docs/DESKTOP_WINDOWS.md`(本次任务的权威说明)
## 硬性约束
## 硬性约束(违反即失败)
1. 不改 `app.js` / `src/**` / `src-tauri/src/**` / `style.css` 的业务逻辑
2. 不绕过 lint 门禁;报错就停下报告
3. 不用 `npm install`,只用 `npm ci`;版本已定 **3.25.15**,不要改
4. 不 commit / 不 push / 不打 tag / 不跑任何 `scripts/publish-*.sh`
5. 不改 `src-tauri/tauri.windows.conf.json`(产物已锁 `nsis`,不要 msi)
1. **不修改** `app.js`、`src/**`、`src-tauri/src/**` 的任何业务逻辑
2. **不绕过** 构建前的 lint 门禁(`beforeBuildCommand` 已含 `npm run lint`);lint 报错就停下来报告,不要改成跳过
3. **不改** `package.json` 里的 scripts 语义;唯一允许改版本号的地方是 `node scripts/set-version.js <版本>`
4. 不用 `npm install`,只用 `npm ci`
5. 不安装/升级全局工具版本(Node/Rust)除非环境检查明确缺失,且每次安装前先向我确认
6. 不把任何密钥、token、代理密码写进文件或提交
7. 不提交 git commit、不推送、不打 tag(除非我明确要求)
## 第一步:环境检查(先做,结果先给我看)
## 第零步:拉代码
```powershell
node -v # 期望 v22.x
npm -v
rustc -V # 必须含 "msvc"
rustup show active-toolchain
git --version
git fetch --all --tags; git checkout main; git pull --ff-only
git rev-parse --short HEAD # 必须是 84c2c10 或其后代
node -e "console.log(require('./package.json').version)" # 必须 3.25.15
```
然后跑仓库自带检查脚本:
## 第一步:环境检查
```powershell
node -v; npm -v; rustc -V; rustup show active-toolchain
powershell -ExecutionPolicy Bypass -File scripts\windows-check.ps1
```
**判定**:
- 全部 `[OK]` → 继续
- 出现 `[缺失]` → 停止,把缺失项和提示原文发我(不要自行安装)
全部 `[OK]` 才继续;出现 `[缺失]` 停止报告(不要自行安装)。
## 第二步:装依赖
## 第二步:依赖
```powershell
npm ci
```
- 失败先看是不是网络/代理问题(npm 可临时设 `npm config set proxy http://127.0.0.1:10808`,装完删掉)
- 成功后报告:`node_modules` 是否存在、耗时
本次新增两个 Rust 插件依赖(single-instance / notification),首次构建会多拉一些 crate。
## 第三步:定版本号
**本次版本已定:3.25.1**(仓库里 package.json / tauri.conf.json / Cargo.toml 都是这个号)。
不要自行改版本号;只有我明确要求时才用 `node scripts/set-version.js <新版本>`。
## 第三步:构建(用一次性临时密钥签名)
```powershell
node -e "console.log(require('./package.json').version)" # 应输出 3.25.1
npx tauri signer generate -w "$env:TEMP\iwb-tmp.key" --password ""
$env:TAURI_SIGNING_PRIVATE_KEY = Get-Content "$env:TEMP\iwb-tmp.key" -Raw
$env:TAURI_SIGNING_PRIVATE_KEY_PASSWORD = ""
npx tauri build
Remove-Item "$env:TEMP\iwb-tmp.key" -Force
```
确认三处一致:
> 产出的 `.sig` 是临时密钥签的,**我会在 Mac 上用正式私钥重签**,你附上即可。
## 第四步:确认产物
```powershell
node -e "console.log(require('./package.json').version, require('./src-tauri/tauri.conf.json').version)"
Select-String -Path src-tauri\Cargo.toml -Pattern '^version'
Get-ChildItem src-tauri\target\release\bundle -Recurse -Include *.exe,*.sig | Select FullName,Length
Get-FileHash "src-tauri\target\release\bundle\nsis\image-workbench_3.25.15_x64-setup.exe" -Algorithm SHA256
Test-Path dist\plugins # 期望 False
Test-Path _headers # 期望 False
Test-Path functions # 期望 False
```
## 第四步:构建
## 第五步:自测清单(逐条报通过/失败)
```powershell
npm run app:build
```
**基础**
1. 安装并启动;数据目录 `%USERPROFILE%\Documents\ImageWorkbench` 生成 `data.json`/`canvases`/`library`/`images`
2. **`images\` 下必须有 `canvas` 文件夹**(v3.25.12 之前只有 `thumbs`,这是丢图根因)
3. 设置 → 通用:数据库目录正确;「打开」能弹资源管理器
4. 关窗口进程仍在托盘;左键唤出;右键有菜单
预期内部顺序:`lint → build(含剥离内置插件)→ tauri build`。
首次 5~15 分钟(Rust 依赖编译),之后 1~2 分钟。
**图片持久化(历史 bug 复现点)**
5. `Ctrl+V` 粘贴新图 → 出现图片节点
6. **正常退出**(托盘右键退出,非强杀)→ 重开 → 图仍在、显示正常
7. 从资源管理器拖图进画布 → 退出重开 → 图还在
**失败处理**:
| 报错 | 处理 |
|---|---|
| `link.exe not found` / `LNK` | 缺 VS Build Tools C++ 工作负载 → 停止并报告 |
| rustc 显示 `gnu` | `rustup default stable-x86_64-pc-windows-msvc`(可自行执行) |
| `Windows SDK is not installed` | 停止并报告 |
| npm/网络超时 | 检查代理,重试一次;仍失败则报告 |
| lint 报错 | **停止**,把报错原文发我 |
**桌面壳(本次新增)**
8. 单实例:连续双击两次 → 只有一个窗口,第二次聚焦已有
9. 外链:点「项目主页」→ 用系统浏览器打开,应用不变(不能被导航成网页)
10. 跑一次生图,完成后弹系统通知
## 第五步:确认产物
**插件与 CSP(本次修复)**
11. 设置 → 插件:无内置插件;市场能列 7 个;装一个 → 重启后可用
12. **鲜艺抠图**:启用后对图片节点执行抠图 → **不应出现 `Failed to fetch`**(3.25.11 回归,3.25.14 已修)
13. 若本机有 `XianyiAiRmbg` 监听 `0.0.0.0:30092` → 抠图出透明底;没装则注明跳过
```powershell
Get-ChildItem src-tauri\target\release\bundle -Recurse -Include *.exe,*.msi | Select-Object FullName,Length
```
**外观(本次新增)**
14. 设置 → 外观:改画布底色(亮/暗)与主题色 → 立即生效,重启保持
15. 亮暗切换时画布底色分别用两套值
必须找到(名字里带版本号与 `x64`):
任何一条失败:记录现象 + 截图后停止报告,**不要改代码**。
- `src-tauri\target\release\bundle\nsis\image-workbench_<版本>_x64-setup.exe` ← **主交付物**
- `src-tauri\target\release\bundle\msi\image-workbench_<版本>_x64_en-US.msi` ← 有则附带,没有不算失败(WiX 可能被网络挡)
并计算哈希:
```powershell
Get-FileHash "src-tauri\target\release\bundle\nsis\image-workbench_<版本>_x64-setup.exe" -Algorithm SHA256
```
另外确认**插件没有被塞进包**:
```powershell
Test-Path dist\plugins # 期望 False
```
## 第六步:安装自测(必须做,逐条报告 通过/失败)
1. 运行 `*-setup.exe` 安装并启动
2. 数据目录生成 `%USERPROFILE%\Documents\ImageWorkbench`,内含 `data.json`、`canvases`、`library`、`images`
3. 设置 → 通用:「数据库目录」显示上述路径;点「打开」能弹出资源管理器
4. 关闭窗口后进程仍在托盘;左键托盘图标能唤出窗口;右键有菜单
5. 设置 → 插件:**没有任何内置插件**;「插件市场」能列出 7 个插件;任选一个安装 → 提示重启 → 重启后该插件可用
6. 新建画布、拖拽/缩放节点正常;导入一张本地图片正常
7. 点一次「下载」:文件直接落到导出目录,**不弹另存为对话框**
任何一条失败:记录现象 + 截图,然后停下来报告,不要尝试改代码。
## 第七步:交付
把下面信息整理成表格发我:
- 版本号
- 安装包绝对路径、文件大小(MB)、SHA256
- MSI 是否存在
- 环境检查结论(node/rust/VS/WebView2)
- 六步自测逐条结果
- 构建总耗时
产物先**留在本机**,等我确认后再决定上传方式(scp 到 NAS `/vol8/web/iwb-download/updates/windows-x86_64/`,或我另行安排)。
## 停止条件(遇到即停,不要自行发挥)
- 环境缺件(VS Build Tools / WebView2 / MSVC 工具链)
- lint 或构建报错且一次重试无效
- 自测有任意一条失败
- 需要修改业务代码才能继续
停止时请给出:**卡在哪一步、完整报错、你已经尝试过什么**。
## 最终回复格式
## 第六步:交付格式
```
结论:成功 / 失败(卡在第 N 步)
版本:
版本:3.25.15 commit=<sha>
安装包:<路径> <大小> SHA256=<hex>
自测:1✅ 2✅ 3✅ 4✅ 5✅ 6✅ 7✅(失败的写 ❌ + 现象)
备注:
环境:node= rust= VS= WebView2=
自测:1✅ … 15✅(失败写 ❌ + 现象)
耗时:
```
产物留在本机;**不要**上传 NAS、**不要**写 `latest-windows.json`(我在 Mac 侧做)。
## 停止条件
commit 不对 / 环境缺件 / 构建报错一次重试无效 / 自测有失败 / 需要改业务代码 —— 遇到即停,
报告「卡在哪一步 + 完整报错 + 已尝试过什么」。
+2 -2
View File
@@ -278,7 +278,7 @@ npm run deploy # 部署到正式站
IWB_VERIFY_STRICT=1 node scripts/verify-release.js
```
> ⚠️ `npm run deploy` = `verify` + `wrangler pages deploy`,**不含 git push**。
> ⚠️ 本项目已转桌面客户端:**不再用 `wrangler pages deploy`**,发版走 `./scripts/publish-update.sh`(macOS)/ `./scripts/publish-windows-update.sh`(Windows)。
> 回滚时**不要**把旧代码 push 到 main(会污染历史);用 `checkout` 部署即可,
> 部署完 `git checkout main` 回到主干。
@@ -408,7 +408,7 @@ git checkout refactor-step-3
git checkout stable-v3.24.5 && npm ci && npm run verify:ci && npm run deploy
# 层 4:看部署历史,用 dashboard 或 API 切回旧 deployment
npx wrangler pages deployment list --project-name image-workbench-web
# 桌面端没有「线上部署列表」:版本清单在 NAS 的 /vol8/web/iwb-download/updates/
```
### 7.2 铁律
+169
View File
@@ -0,0 +1,169 @@
# Image Workbench 桌面版 · Windows 打包与交付规范
> 适用:Windows 构建机。本规范只负责「构建 + 自测 + 交付安装包」,**签名与发布在 mac 端完成**(更新私钥不外传)。
> 对应版本:v3.25.31 及以后。
---
## 0. 一句话流程
win 构建 setup.exe → win 自测通过 → 把 setup.exe 放到 NAS `_inbox/` → 通知 mac 端 → mac 签名 + 上传 + 登记 → win 用户可更新。
**win 端永远不要自己签名。** 私钥只在 mac 的 `~/.config/iwb-updater.key`。win 自己签出来的 `.sig` key ID 与项目公钥不配对,客户端会拒绝安装(v3.25.31 发布时已踩过一次,win 放上来的临时 `.sig` 被 mac 端忽略重签)。
---
## 1. 环境(一次性,DESKTOP_BUILD.md 第四章)
```powershell
# 有 winget 的话
winget install OpenJS.NodeJS.LTS
winget install Rustlang.Rustup
winget install Microsoft.VisualStudio.2022.BuildTools --override "--quiet --add Microsoft.VisualStudio.Workload.VCTools"
winget install Microsoft.EdgeWebView2Runtime
# 确认 Rust 走 MSVC(不是 GNU)
rustup default stable-msvc
rustc -V # 期望 >= 1.90
```
要点:
- 仓库放**纯英文、无空格**路径(例:`C:\work\image-workbench-desktop`),否则 NSIS 打包易失败。
- Windows 10 需装 WebView2 Runtime;Win11 自带。
---
## 2. 取代码(必须是最新 main)
```powershell
git fetch gitea
git checkout main
git reset --hard gitea\main
```
**校验基线**(构建前必查,缺一不可):
```powershell
# 2.1 三处版本号必须完全一致,且 = 目标版本(如 3.25.31)
node -e "console.log(require('./package.json').version)"
node -e "console.log(require('./src-tauri/tauri.conf.json').version)"
node -e "console.log(require('./src-tauri/Cargo.toml').version)"
# 2.2 确认含 Windows 死锁修复(v3.25.31 的关键改动)
# 这 6 个命令必须是 async fn,不是同步 fn
findstr /C:"async fn canvas_webview_ensure" src-tauri\src\lib.rs
findstr /C:"async fn canvas_webview_bounds" src-tauri\src\lib.rs
findstr /C:"async fn canvas_webview_navigate" src-tauri\src\lib.rs
findstr /C:"async fn canvas_webview_action" src-tauri\src\lib.rs
findstr /C:"async fn canvas_webview_metrics" src-tauri\src\lib.rs
findstr /C:"async fn canvas_webview_close_all" src-tauri\src\lib.rs
```
任何一处对不上 → **不要构建**,先找 mac 端确认 main 是否已包含修复。
---
## 3. 构建
```powershell
npm ci
npm run app:build
```
- 首次会编译约 250 个 crate,2–5 分钟;之后增量很快。
- 产物:
- `src-tauri\target\release\bundle\nsis\image-workbench_<version>_x64-setup.exe` ← **交付这个**
- `src-tauri\target\release\bundle\msi\*.msi`(可选,备用)
---
## 4. 产物命名规范(硬性)
交付文件名必须是:
```
image-workbench_<version>_x64-setup.exe
```
例:`image-workbench_3.25.31_x64-setup.exe`
- `<version>` 必须与 `package.json` 一致。
- 后缀必须是 `-setup.exe`(NSIS),不是 `.msi`。
- mac 端 `publish-windows-update.sh` 会按 `package.json` 的版本重命名并签名,所以**文件名里的版本号要和 mac 端 `package.json` 对齐**,否则签名产物与登记名不符。
记录交付信息(发给 mac 端):
```powershell
# 文件大小 + SHA256(mac 端登记 releases.json 要用)
certutil -hashfile src-tauri\target\release\bundle\nsis\image-workbench_3.25.31_x64-setup.exe SHA256
```
---
## 5. 自测矩阵(全过才能交付)
装 setup.exe 后逐项验证:
| # | 项目 | 期望 |
|---|---|---|
| 1 | 主窗口启动 + 渲染 | 正常出界面,能生图(回归 async 改动没破坏通用功能)|
| 2 | **画布网页节点**(浏览器插件「网页」节点 / ↗ 放到画布)| 输入 URL 回车 → **能加载、不卡死、不阻塞整个应用**(这是 v3.25.31 要修的,修前一点就没反应)|
| 3 | 画布网页节点交互 | 拖动 / 缩放 / 平移 / 框选 → 跟手、不白屏 |
| 4 | 节点 ✕ / 切工作区 / 退出应用 | cwv-* 子 webview 正常回收,不留残余进程 |
| 5 | 独立浏览器窗口(插件「↗ 独立窗口」)| 能打开(这条本来就跨平台可用)|
第 2 项不过 → 别交付,把 `_%APPDATA%\com.malongan.imageworkbench\_cwv.log` 发回 mac 端排查。
已知缺失(不影响交付,但告知用户):Windows 画布网页节点**没有圆角**(直角贴卡片),属 cosmetic,另排 backlog。
---
## 6. 交付到 NAS _inbox
```powershell
# 用 scp(或任意 SFTP 客户端)把 setup.exe 放到 mac 端约定的中转目录
scp src-tauri\target\release\bundle\nsis\image-workbench_3.25.31_x64-setup.exe `
malongan@192.168.100.185:/vol8/web/iwb-download/_inbox/
```
- `_inbox/` 权限 700、公网 403,放这里不会被外部下载。
- **只放 setup.exe,不要放 .sig**(签名 mac 端做)。
- 放好后通知 mac 端:「v3.25.31 win 包已放 _inbox,sha256=…,size=…」。
---
## 7. mac 端会做的事(win 同事了解即可,不用操作)
mac 端收到通知后执行:
1. 从 `_inbox` 拉回 setup.exe
2. `./scripts/publish-windows-update.sh <setup.exe>` —— 本机正式私钥签名 + 上传 `updates/windows-x86_64/` + 写 `latest-windows.json`
3. `node scripts/update-releases.js --platform windows-x86_64 …` 登记网页下载
4. `gen-release-page.js` + `gen-site.js` 重生成页面 + scp 元数据
5. 合并 windows 条目进 `latest.json`(应用内更新源)
6. commit + `RELEASE=1 git push gitea main`
---
## 8. 红线(禁止)
- ❌ win 端自己签名 / 生成 .sig(私钥不外传,签了也不配对)
- ❌ 改 `src-tauri\src\lib.rs`、`Cargo.toml`、`tauri.conf.json` 等源码(源码只在 mac 改,win 只构建)
- ❌ 在 win 上跑 `cargo fmt` / IDE 保存即格式化(会引入整文件 diff,污染 mac 端同步)
- ❌ 把 `target\`、`node_modules\`、`.cargo`、`.msi` 提交进 git
- ❌ 用 `git add -A`(只精确提交需要入库的文件)
- ❌ 直接 `git push gitea main`(push 需 mac 端 `RELEASE=1` 口令,win 端不 push)
---
## 9. 快速核对清单(交付前打勾)
- [ ] `git reset --hard gitea\main` 到最新
- [ ] package.json / tauri.conf / Cargo.toml 三处版本一致 = 目标版本
- [ ] lib.rs 里 6 个 `async fn canvas_webview_*` 都在
- [ ] `npm ci && npm run app:build` 成功
- [ ] 产物名 = `image-workbench_<version>_x64-setup.exe`
- [ ] 记下 size + SHA256
- [ ] 自测矩阵 5 项全过(尤其第 2 项画布网页不卡死)
- [ ] setup.exe 放 `_inbox/`(**不放 .sig**)
- [ ] 通知 mac 端:版本 + size + sha256
+12 -8
View File
@@ -1,7 +1,7 @@
# 现状架构与性能事实基线(image-workbench-web)
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 576d24f`(线上 `v3.25.3+576d24f` —— 线上实际运行提交是 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 = a40c038`(线上 `v3.26.37+a40c038` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 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`(现 **85** 个模块 / 14,607 行,`sourceModules` 85 项;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`(现 **108** 个模块 / 14,607 行,`sourceModules` 108 项;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. 门禁与环境现状
@@ -30,8 +30,8 @@
| 项 | 现值 | 依据 |
|---|---|---|
| 单测基线 | **658 通过 / 0 新增失败 / 2 已知环境差异**(2026-11-12 v3.24.76 实测;660 −2 = 94-5~7 三条钉点换成一条消费方契约) | (A) `npm test` 实测(`tests/iwb-v32-web-test.js`) |
| e2e | spec 文件 **59** 个(**55** 个进门禁 + 4 个 dev 探针 `_perf-baseline` / `_plugin-host-probe` / `_probe-drag` / `_probe-tab-switch`) | (A) `tests/` 计数 + `scripts/list-e2e-specs.js` |
| e2e 用例数 | **200 条**(2026-11-16 实测:55 个进门禁 spec 内 `test()` 总数)(历史:115 → v3.24.18 **143** → v3.24.19 **147** → v3.24.21 **151** → F2 改名 1 条 **152** → 抓手工具 2 条 **154** → v3.24.44 输出顺序 2 条 **166** → v3.24.47 同步去重 `iwb-sync-dedupe` 1 条 **167** → v3.24.67 **179** → v3.24.68 **183** → v3.24.69 **184** → v3.24.70 **186** → v3.24.74 **187**(新增「拖入 PDF 给提示 + MIME 空 PNG 仍能导入」)→ v3.24.75 **188**(新增「同一张图连粘两次只建一个节点」)→ v3.24.76 **191**(新增 `iwb-tabs-release` 3 条:回首页不降级 / 关标签先保存再关 / 彻底删除连带关标签)→ v3.24.77 **194**(新增 `iwb-lod` 3 条:fit 大画布必须全 LOD / 放大后必须恢复 / 常规画布不 LOD)→ v3.24.78 **196**(`iwb-lod` 3 → 5 条:新增「lite 档必须画出代表图/首行文字」与「缩到 15% 以下才退成 plain」)→ v3.24.82 **197**(新增 `iwb-inherit-text` 1 条:提示词/文本节点显示上游继承文本、改字接管、恢复跟随)→ v3.24.83 **198**(新增 `iwb-plugin-node-coldstart` 1 条:插件脚本晚到 1.2s,存档里的插件节点必须自动切回插件节点体,且类型不被降级成 `plugin`)→ v3.24.79 **196 不变**(测速修复的守门落在 jsdom 单测 `provider-ping-test.js`,e2e 无新增)→ v3.24.85 **200**(新增 `iwb-multi-tab` 2 条:A 页 flush 落盘后 B 页必须靠 rev 轮询看到改动;B 页持锁期间 A 页图库归档必须挂起);早期 99 → 115 的逐版链条见 `docs/history/coverage-baseline-2026-10-27.md`) | (A) `tests/*.spec.js` 计数 + `scripts/list-e2e-specs.js` |
| e2e | spec 文件 **58** 个(**52** 个进门禁 + 4 个 dev 探针 `_perf-baseline` / `_plugin-host-probe` / `_probe-drag` / `_probe-tab-switch`) | (A) `tests/` 计数 + `scripts/list-e2e-specs.js` |
| e2e 用例数 | **200 条**(2026-11-16 实测:55 个进门禁 spec 内 `test()` 总数;v3.25.15 删除网页版部署面后为 **53** 个进门禁;v3.25.56 节点组库改插件 `grouplib`(宿主侧栏组件删除)后为 **52** 个进门禁 —— `iwb-csp-gate` / `iwb-functions-headers` 随 `_headers`、`functions/` 一起移除)(历史:115 → v3.24.18 **143** → v3.24.19 **147** → v3.24.21 **151** → F2 改名 1 条 **152** → 抓手工具 2 条 **154** → v3.24.44 输出顺序 2 条 **166** → v3.24.47 同步去重 `iwb-sync-dedupe` 1 条 **167** → v3.24.67 **179** → v3.24.68 **183** → v3.24.69 **184** → v3.24.70 **186** → v3.24.74 **187**(新增「拖入 PDF 给提示 + MIME 空 PNG 仍能导入」)→ v3.24.75 **188**(新增「同一张图连粘两次只建一个节点」)→ v3.24.76 **191**(新增 `iwb-tabs-release` 3 条:回首页不降级 / 关标签先保存再关 / 彻底删除连带关标签)→ v3.24.77 **194**(新增 `iwb-lod` 3 条:fit 大画布必须全 LOD / 放大后必须恢复 / 常规画布不 LOD)→ v3.24.78 **196**(`iwb-lod` 3 → 5 条:新增「lite 档必须画出代表图/首行文字」与「缩到 15% 以下才退成 plain」)→ v3.24.82 **197**(新增 `iwb-inherit-text` 1 条:提示词/文本节点显示上游继承文本、改字接管、恢复跟随)→ v3.24.83 **198**(新增 `iwb-plugin-node-coldstart` 1 条:插件脚本晚到 1.2s,存档里的插件节点必须自动切回插件节点体,且类型不被降级成 `plugin`)→ v3.24.79 **196 不变**(测速修复的守门落在 jsdom 单测 `provider-ping-test.js`,e2e 无新增)→ v3.24.85 **200**(新增 `iwb-multi-tab` 2 条:A 页 flush 落盘后 B 页必须靠 rev 轮询看到改动;B 页持锁期间 A 页图库归档必须挂起);早期 99 → 115 的逐版链条见 `docs/history/coverage-baseline-2026-10-27.md`) | (A) `tests/*.spec.js` 计数 + `scripts/list-e2e-specs.js` |
| CI | `.github/workflows/verify.yml`:**push(main) + PR(→main) + 手动** 触发,两个 job(`gate` = `verify:ci`;`e2e` = `test:e2e`),只验证不部署 | (A) |
| 部署 | `npm run deploy` = `verify` + `wrangler pages deploy dist --branch main`;**内含全量 verify,不得绕过** | (A) `package.json:16` |
| 部署环境 | 本机 wrangler 为 OAuth 登录 → **不能设 `CI=true`**(用 `unset CI` + `WRANGLER_SEND_METRICS=false`) | (A) 本轮发布实测 |
@@ -58,7 +58,7 @@
|---|---|---|
| objectURL 缓存 | `W_OBJURL_MAX = 50`(FIFO,驱逐即 revoke) | (A) `app.js:4105` |
| blob 引用缓存 | `W_BLOBREF_MAX = 50` | (A) `app.js:4111` |
| 显示缩略图缓存 | `DISPLAY_THUMB_CACHE_MAX = 300`;`DISPLAY_THUMB_MAX = 768` | (A) `app.js:4573 / 4572` |
| 显示缩略图缓存 | `DISPLAY_THUMB_CACHE_MAX = 300`;`DISPLAY_THUMB_MAX = 640` | (A) `app.js:4573 / 4572` |
| 预览派生缓存 | `PREVIEW_CACHE_MAX = 200`(FIFO,**淘汰即 revoke**);`PREVIEW_MAX_EDGE = 1024` | (A) `app.js:4592 / 4591`;淘汰 revoke `4595-4599` |
| 图库缩略图缓存 | `outThumbCacheMax = 400` | (A) `app.js:1980` |
| Blob 仓库内存 LRU | `DEFAULT_BLOB_CACHE_MAX = 200` | (A) `src/image-blob-store.js:51` |
@@ -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` 不引用模块全局)。**85 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**108 个模块中 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 耦合面(**74** 项)与 `sourceModules` 顺序(**85** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**86** 项)与 `sourceModules` 顺序(**108** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
## 12. 易踩的坑
@@ -254,7 +254,7 @@
**信任模型(必须明示)**:形态 A 的插件是**可信代码**(与核心同权限、无沙箱);启停与设置是 UX 与可维护性手段,**不是安全边界**(同 §13.27 教训:前端开关一定可被绕过)。
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**74** 项)与 `sourceModules` 顺序(**85** 项);新增模块、新增耦合、新增 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 耦合面」(**86** 项)与 `sourceModules` 顺序(**108** 项);新增模块、新增耦合、新增 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 规则三的同一失败模式)。
@@ -270,6 +270,10 @@
**CSP 最小放宽(2026-10-17,为本地服务插件)**:`_headers` 的 `connect-src` 由 `'self' https:` 扩为 `'self' https: http://127.0.0.1:30092 http://localhost:30092`。
- **动机**:页面内插件(非浏览器扩展)受页面 CSP 约束;调用本机服务必须放行 loopback。**只放行这一个固定端口**,不放宽到任意 `http:`、不放开脚本域、不引入 `unsafe-eval`。
- **边界**:插件若把服务地址改到别的 host/端口会被 CSP 拦(属预期)。页面因此可以向本机 30092 发请求 —— 这是**有意的安全边界调整**,与"插件是可信代码"的模型一致。
- **桌面客户端 CSP 的唯一定义处是 `src-tauri/tauri.conf.json` 的 `app.security.csp`**(v3.25.14 补记)。
本项目是桌面客户端,`_headers` 属于旧的网页部署、不参与桌面行为,**两者不做一致性约束**。
v3.25.11 的「CSP 清理」误判 30092 为遗留端口删掉 ⇒ 桌面版鲜艺抠图插件 `Failed to fetch`。
现由 `tests/desktop-csp-loopback-test.js` 钉住(只断言桌面 CSP 的运行时值,避免源码钉点棘轮)。
**鲜艺抠图插件(2026-10-17 起改为 A2 运行时插件,`dist` 不再内置)**:源码已迁出主仓到独立插件仓(`iwb-plugins`),经 Cloudflare Function `functions/plugins/[[path]].js` + KV(binding `PLUGINS`)**同源运行时加载**(同源 ⇒ CSP 零改动);主包**已不含** `src/plugin-xianyi-cutout.js`。功能:右键命令「抠图:选中节点」→ `POST {apiUrl}/rmbg?crop=`(`application/octet-stream` + 原始字节)→ 结果 PNG 写回为新的参考图节点(`<原名>_cutout.png`)。契约对齐 `iwb-plaus` v3.1.3 的 `background.js`(二进制进 / PNG 字节出;无 token、无 JSON),但**补齐了原版缺失的超时**(`AbortController` + 可配 `timeoutMs`)。设置项:`apiUrl` / `crop` / `timeoutMs`。尚未提供的能力面(若日后需要):插件只读「选中节点」与按 id 取节点图(`canvas` 目前只有 `getNodes` / `listNodeTypes`)。
+2
View File
@@ -644,6 +644,8 @@ B-② 撤销/重做后图片真能解码显示,`naturalWidth=768`)· e2e `te
5. **守门若依赖 git 历史(父提交 / 多提交比对),CI 必须用 `fetch-depth: 0`**。GitHub Actions 默认 `depth=1`(浅克隆)⇒ 父提交不可读 ⇒ 门禁要么崩、要么给出**错误的期望值**(实测踩过:`git show HEAD^` 报 `invalid object name`,守门误报失败)。本仓 CI 两个 job 均已设 `fetch-depth: 0`(仓库打包后仅 ~3MB,取全历史成本可忽略)。
另:门禁自身**仍要做浅克隆检测**(`git rev-parse --is-shallow-repository`)并**降级为只校验版本**、打印 SKIP 而非打红 —— 这样在别处的浅克隆环境不会产生「无法解释的红」。(2026-10-20 实测:守门上线后 CI 首次运行即因浅克隆失败,改用 `fetch-depth: 0` + 降级判据后恢复。)
6. **锚点同步已自动化(2026-11-22)**:`scripts/publish-update.sh` 收尾调用 `scripts/set-doc-anchor.js`,把锚点写成「最近一次 bump 版本的提交」并**本地提交**(`docs: 锚点对齐 vX.Y.Z+<sha>(publish 自动)`)。护栏:`git show HEAD:package.json` 的版本与本地不一致(bump 未提交)时打印 WARN 并跳过,避免写错提交。手工改锚点仍然有效。
**验证方式**:`tests/architecture-facts-guard-test.js` 第 7 组(`npm run test:facts`)· 负例:把锚点改回旧 SHA ⇒ 打红并给出应填的 SHA。
## §13.37 源码文本钉点:全目录只减不增(2026-10-20)
@@ -0,0 +1,54 @@
# 原生浮层(子 WebView)的生命周期规范
> 适用:`src/canvas-webview.js` 以及任何“原生层永远在 DOM 之上”的视图(面板内嵌浏览器、画布网页节点、未来的原生覆盖层)。
> 触发这份规范的事故:v3.26.33 —— 切换停靠栏面板后,旧网页画面滞留约 1 秒,盖住新面板。
## 1. 事故根因(一句话)
**DOM 锚点被移除后,宿主只安排了“900ms 后 close”,却没有先把原生层隐藏**;原生层始终在 DOM 之上,于是旧画面继续可见,直到 close 生效。
## 2. 三条硬规则
### R1 可见性跟着锚点走,当帧生效
- 锚点从 DOM 消失(组件卸载、面板切换、React 重建)⇒ **立即 park**(`visible:false`),不等任何定时器。
- 锚点仍在但落在视口/画布/面板之外 ⇒ 同样 park(现有 tick 已覆盖)。
### R2 先隐藏,再延迟销毁
```
锚点消失 → ① 立即 park(≤1 帧)
→ ② 900ms 宽限后 close(仅在锚点确实没回来时)
```
**禁止**把 ① 也放进定时器里。宽限期只用于避免“节点体短暂重建导致网页重载/丢滚动位置”,不能用于可见性。
### R3 视图/面板切换要整体 park
离开画布、切停靠栏面板、隐藏停靠栏、打开全屏遮罩时,都应对**所有**已打开视图调用 `parkAll()`。
## 3. 新增原生层时的检查清单
| 检查项 | 说明 |
|---|---|
| park on detach | 锚点移除路径里有**同步** park(不是 setTimeout 内) |
| park on view change | 视图/面板切换时有整体 park |
| park on overlay | 全屏遮罩/弹窗打开时 park |
| close on unload | `beforeunload` 调 `close_all` |
| 恢复不重载 | 宽限期内的重建复用同一视图 |
| 坐标裁剪 | 面板/画布 overflow 对原生层无效,必须按矩形裁剪 |
## 4. 守门测试
`tests/native-overlay-park-test.js` 静态校验:
1. `detach()` 在 `setTimeout(... close ...)` **之前**存在 `push(..., false, ...)`;
2. `setSuspended(true)` 会调用 `parkAll()`;
3. 视图变化(离开 canvas)的 MutationObserver 里调用 `parkAll()`。
任何一条被破坏,`npm run verify:ci` 直接失败。
## 5. 自检话术(review 时问自己)
> “如果此刻锚点被移除,下一帧用户看到的会是什么?”
> 答案必须是“立刻看不到”。
@@ -0,0 +1,151 @@
# 插件样式 / 停靠栏 / 图库:2026-11-21 事故复盘与经验
> 适用版本:v3.25.9x → v3.26.20;涉及插件:promptlib / gallery / grouplib / style-source。
> 这份文档记录「为什么会坏、怎么定位、怎么修、回滚要注意什么」,下次遇到同类现象先读它。
## 1. 事故时间线(浓缩)
| 版本 | 做了什么 | 结果 |
|---|---|---|
| 3.25.97 | 提示词封面改用 `{__blob}` 引用 | 编辑里能看到、列表看不到,重启可能丢 |
| 3.26.0 | 封面改为内联压缩 dataURL | 封面可见了,`prompts.json` 涨到 1.7MB |
| 3.26.5 | 清理死代码 + 删失效 CSS | 误删 `.iwb-lib-cards` 瀑布流列规则(单列化) |
| 3.26.6~3.26.9 | 市场缓存、启动层、键盘可达、CSP nonce 兜底 | **插件样式全丢**(提示词库/风格库/图库变裸 HTML) |
| 3.26.10 | **整体回滚到 v3.26.5** + promptlib 回 1.4.0 内容(版本号 1.4.6) | 功能恢复,但回滚带回了 1.4.0 的单列 bug |
| 3.26.11~3.26.14 | 面板去重、拖宽跟手、底色调平、图库铺满 | 逐步收敛 |
| 3.26.15~3.26.20 | 选中态收敛、小地图避让、图库缩略图缓存、插件灰跟随主题 | 稳定 |
## 2. 五个真实根因(都验证过)
### 2.1 CSP nonce 会整段丢弃动态 `<style>`
- 桌面端 CSP 带 nonce;CSP3 下 `unsafe-inline` 被忽略。
- 宿主/插件用 `document.createElement('style')` 注入样式时**没有 nonce** → `style.sheet === null`,`document.styleSheets` 里也没有它。
- 症状极具迷惑性:插件 DOM 正常、宿主外链 CSS 正常,唯独插件样式全丢(卡片塌成色条、图片按原始尺寸铺满)。
- 判定方法:页面里执行
```js
const s = document.createElement('style'); s.textContent = '.x{color:red}'; document.head.appendChild(s);
s.sheet === null // true ⇒ 被 CSP 丢弃
```
- 修复:给动态 `<style>` 复制页面上已有 nonce:`node.setAttribute('nonce', document.querySelector('style[nonce],link[nonce]').nonce)`。
- **注意**:后来 3.26.10 回滚后,用 v3.26.5 那套样式注入在 1.4.7 插件下显示正常——说明**并非所有注入路径都会触发**,与注入时机/上下文有关。结论:不要依赖单一假设,先用上面的判定法验证。
### 2.2 插件样式注入与激活存在竞态
- 宿主在 load 时把 CSS 暂存到 `pendingStyles[id]`,**激活插件时**才 `applyStyleFor(id)`。
- 若插件已处于激活状态(热更新、切面板、拖拽重载),`applyStyleFor` 不会再执行 → 有 DOM 无样式。
- 修复方向(二选一,最终都用了):
1. 插件**自带样式**(把 CSS 内联进 bundle,脚本执行时注入);
2. 宿主在激活时若 `pendingStyles` 为空,从磁盘补读一次再注入。
### 2.3 `registerPanel` 只 push 不替换 → 面板图标越拖越多
- 插件每次重新加载都会注册一次面板,宿主直接 `wPluginPanels.push(entry)`。
- 重复 id 进入停靠栏状态 `iwb.dock.v1` 后,**重启也还在**;把右侧那份拖到左侧只会移动其中一份,所以“右边的不会消失”。
- 修复(两层都要做,缺一不可):
- 注册层:同 `pluginId + id` 先删除旧条目再插入;
- 持久层:打开时同侧去重;同一 id 同时出现在左右两侧时只保留左侧;默认面板回填时跳过另一侧已存在的 id。
### 2.4 图库“要拖一下窗口才显示图片”
- 图库列宽由测得的面板宽度算出,而 `grid` 自身宽度又由列宽决定(`flex-start` + 内容宽度)。
- 于是 `grid.clientWidth` 首帧为 0,之后**永远不会变化** → `ResizeObserver` 不触发 → 一直空白。
- 修复:量**会随面板拉伸的外层容器**(`wrap` / 父节点),并加三重兜底:
- 挂载后 rAF 连续重试(最多 40 帧);
- 可见后(IntersectionObserver 命中)重测重排;
- 120/400/900ms 各补一次。
- 副作用:重排会重建 DOM,导致缩略图重复请求(每张图请求 N 次、部分一直“加载中”)。**必须配缩略图缓存 + 进行中 Promise 共享**(gallery 1.6.9)。
### 2.5 封面:引用 vs 内联
- `{__blob}`(IndexedDB 引用)跨会话/跨解析时序不可靠:编辑弹窗能看到(自己刚写的),列表与重启后丢失。
- 内联 dataURL 可靠但撑大 `prompts.json`(33 条 1.7MB)。
- 取舍:先用内联(≤448px WebP)保证“任何时候都看得见”,体积问题单独做迁移/文件型 ref 解决——**不要一次改动同时解决“可靠性 + 体积”**。
## 3. 回滚细节(最容易踩)
这次最终靠“回滚到 v3.26.5”才恢复,过程中有 4 个坑:
1. `git checkout v3.26.5 -- .` **只覆盖已存在的文件,不会删除新增文件**。必须补:
```bash
comm -13 <(git ls-tree -r --name-only v3.26.5 | sort) <(git ls-tree -r --name-only HEAD | sort) | xargs rm -f
```
2. **插件版本号必须大于线上版本**,否则市场“检查更新”不会降级。做法:内容回退到 1.4.0,但版本号标 **1.4.6**。
3. **回滚会带回旧 bug**:1.4.0 清理 CSS 时误删过 `.iwb-lib-cards` 瀑布流规则,回滚后列表变单列。回滚后必须跑一遍 UI 冒烟(列表/图库/面板图标)。
4. **回滚也要走完整发布仪式**:CHANGELOG 条目、`docs/standards/architecture-current-state.md` 的 `main = <sha>` 与 `线上 vX.Y.Z+<sha>` 锚点,否则 `verify:ci` 直接挂。
## 4. 定位工具(可复用)
宿主写一行探针,外部用 sqlite 读,不依赖 devtools:
```js
// app.js 临时 effect(排查完必须删)
localStorage.setItem('iwb_dbg', JSON.stringify({
cards: document.querySelectorAll('.iwb-plp-card').length,
sheets: document.styleSheets.length,
styles: [...document.querySelectorAll('style')].map(n => (n.getAttribute('data-plugin') || 'host') + '|sheet=' + !!n.sheet),
computed: (() => { const el = document.querySelector('.iwb-plp-card'); const st = el && getComputedStyle(el)
return st ? { display: st.display, aspect: st.aspectRatio, border: st.borderTopWidth, w: el.getBoundingClientRect().width } : null })(),
}))
```
```bash
python3 - <<'PY'
import sqlite3, glob
for d in glob.glob('/Users/qiqi/Library/WebKit/com.malongan.imageworkbench/WebsiteData/Default/*/*/LocalStorage/localstorage.sqlite3'):
con = sqlite3.connect(d)
for k, v in con.execute("select key,value from ItemTable where key='iwb_dbg'"):
print(bytes(v).decode('utf-16-le','ignore'))
PY
```
关键判据:`sheet=false` ⇒ 样式没参与计算;`computed` 里 `display/aspect/border` 与预期不符 ⇒ 规则未命中;`w` 为 0 或明显大于容器 ⇒ 宽度测量问题。
## 5. 发布纪律(这次最大的教训)
| 规则 | 原因 |
|---|---|
| **一次发布只改一件事** | 3.26.6~3.26.9 把 5 个改动塞进连续 4 个版本,坏掉后无法二分定位,只能整体回滚 |
| 改插件样式/布局后**先本机截图自检**,再请用户确认 | 很多问题在截图里一眼可见(单列、色条、白块) |
| 改完跑 `npm run verify:ci`(exit 0 才算完) | ratchet / 耦合快照 / 文档锚点 / 插件主题契约都在里面 |
| 保底手段是“小步回滚”,不是“继续叠加修复” | 连续 2 次猜错就停手回滚,别再加变量 |
## 6. 守门与快照清单(新增代码时容易忘)
- `MAX_APP_JS_LINES`:app.js 行数棘轮,新逻辑放 `src/<domain>-*.js`;确需增长要同步上调并写明理由。
- `MAX_WORKBENCH_LINES`:`Workbench()` 行数上限。
- 耦合面快照:新增 `window.IWB*` 导出后要 `IWB_WRITE_BOUNDARY_SNAPSHOT=1 node tests/architecture-boundary-guard-test.js`,并同步文档里的“耦合面 N 项”。
- 插件主题契约:插件里禁止写死颜色;`color: #fff`(压在图片/渐变上的白字)已列入例外。
- 文档锚点:每次 bump 版本后更新 `main = <sha>` 与 `线上 vX.Y.Z+<sha>`。
## 7. 一句话结论
> 插件样式出问题,先分清「CSS 没生效」还是「规则写错了」——用 `style.sheet` + `getComputedStyle` 两个判据,一次就能定位;
> 发布时一次只动一件事,坏了好回滚;回滚后必须跑 UI 冒烟,因为回滚会带回旧 bug。
## 8. 第二批问题(3.26.21 – 3.26.27)
| # | 现象 | 根因 | 修法 |
|---|---|---|---|
| 1 | 封面单张 300KB,`prompts.json` 1.1MB | WebP 编码不可用时回退成 448px PNG | putCover 增加 JPEG 兜底(webp→jpeg→原图取小);实测 261KB |
| 2 | 每次切面板都弹「已压缩 N 张封面」 | 迁移阈值按体积 60KB,JPEG 封面 75KB 永远命中 | 条件改为 PNG 或 >150KB,且只有内容变化才保存/提示 |
| 3 | 更新/重启后左右栏摆放被打回默认 | 启动瞬间 panels 为空,整理逻辑删掉未注册 id 并写盘 | 不丢未注册 id;active 在 list 内则保持;面板为空不写盘 |
| 4 | 重启后当前面板从提示词库变浏览器 | active 在未加载时被回退成 list[0] | 同上(保持 active) |
| 5 | 图库部分格子永远“加载中…” | 重测会重建 DOM,缩略图被重复请求 | 缓存 URL + 共享 Promise + 微任务绘制 + 700ms 坏图快速失败 |
| 6 | 插件主题契约“看起来全,实际只查 2 个文件” | 只扫 .js 且只统计含颜色声明的文件 | 扫 .js + .css 全量(8 个),补白字例外 |
### 8.1 停靠栏持久化的通用教训
持久化状态 + 异步依赖(插件/面板注册)组合时:
1. 清理只作用于渲染,不回写存储;未注册的 id 必须保留,等它加载。
2. 写盘要有「依赖就绪」守卫,否则会用空集合覆盖用户数据。
3. 变更检测用内容比较而不是长度比较——去重(-1) 与回填(+1) 同时发生时长度不变,旧实现会漏检。
### 8.2 插件市场设计约束(用户裁定)
- 卡片:淡描边可,不要位移/上浮;只允许颜色变化。
- 已安装:名字后徽标;不要绿底、不要绿点。
- 按钮:浅色底;已安装只保留移除,不要重装。
- 管理页:横线分隔,不要块面卡片与浮动。
- 设置页不要限宽,网格随窗口自适应。
+64
View File
@@ -0,0 +1,64 @@
# 插件主题契约(plugin-theme)
> 版本:v3.25.89 起。宿主与插件的**唯一**配色接口。
> 目的:插件不再自己决定颜色,改一处(种子/滑块)全部插件跟着变。
## 1. 四层语义(插件面板必须分层)
| 语义 | Token | 亮色默认 | 用在哪 |
|---|---|---|---|
| 结构层 | `--iwb-dock-bg` | `#E2E4E6` | 停靠栏 / 标签条 / 状态栏(宿主自己的层) |
| 插件面板 | `--iwb-plugin-surface` | `#FAFAFB` | 面板根容器(**不要用纯白**) |
| 卡片 | `--iwb-plugin-card` | `#FFFFFF` | 面板里的卡片 / 列表项 |
| 内嵌 | `--iwb-plugin-inset` | `#F6F7F8` | 输入框底 / 分组底 / 斑马纹 |
| 悬停 | `--iwb-plugin-hover` | `#EEF1F4` | 行 / 卡片 hover |
## 2. 规则
1. **只用变量**:`--iwb-plugin-*` 或 `--iwb-*`,禁止写死 `#hex` / `rgba()`。
(守门测试 `tests/plugin-theme-contract-test.js` 会卡)
2. **面板根不画底色**:宿主已给 `--iwb-plugin-surface`;插件根容器只写 `background: var(--iwb-plugin-surface)`。
3. **卡片才用 card**:列表项/卡片用 `--iwb-plugin-card`,这样「浅灰底 + 白卡片」的层次才成立。
4. **文字层级**:主文字 `--iwb-plugin-text`,次要 `--iwb-plugin-text2`,品牌 `--iwb-plugin-brand`(底色上的字用 `--iwb-plugin-on-brand`,宿主按对比度自动黑/白)。
5. **语义色**:错误 `--iwb-plugin-err`、成功 `--iwb-plugin-ok`、警告 `--iwb-plugin-warn`。
## 3. 作用域重映射(为什么插件不用改代码)
宿主在插件容器内把旧变量重指到插件层:
```css
.iwb-dock-body, .iwb-node-body .iwb-plugin-body, .iwb-cwv-panel-body {
--iwb-panel: var(--iwb-plugin-surface);
--iwb-layer2: var(--iwb-plugin-card);
--iwb-layer: var(--iwb-plugin-inset);
--iwb-hover: var(--iwb-plugin-hover);
}
```
所以插件里已有的 `background: var(--iwb-layer2, #fff)` 会自动变成「卡片白」,
`var(--iwb-layer, #f5f6f8)` 自动变成「内嵌灰」——**不需要重新打包插件**。
## 4. 批量调节
- 外观 → **插件面板 → 底色深浅**(0~30,默认 12)
- 该值进入 `theme-tokens.js` 的 `pluginTint`,与 4 个种子一起派生
- 改这一个滑块 = 所有插件面板同时变化
## 5. 新增插件时的自查
- [ ] 面板根:`background: var(--iwb-plugin-surface)`
- [ ] 卡片:`background: var(--iwb-plugin-card)`
- [ ] 输入框/内嵌块:`background: var(--iwb-plugin-inset)`
- [ ] hover:`background: var(--iwb-plugin-hover)`
- [ ] 没有任何 `#` 开头的颜色字面量(`var(--x, #hex)` 的兜底除外)
## 事故复盘(必读)
插件“有 DOM 没样式”、面板重复、图库首屏空白这一类问题的完整根因与定位方法见:`docs/standards/plugin-dock-incident-2026-11.md`。
- 先判断「CSS 没生效」还是「规则写错」:`style.sheet === null` ⇒ 没生效(CSP nonce / 注入时机)。
- 插件只引用 `--iwb-plugin-*`,这些 token 由 `theme-tokens` 按主题派生(亮/暗自动切换)。
## 相关规范
- 原生浮层(面板内嵌浏览器 / 画布网页节点)的生命周期见 `docs/standards/native-overlay-lifecycle.md`(先 park 再 close,禁止把隐藏放进定时器)。
-108
View File
@@ -1,108 +0,0 @@
// Cloudflare Pages Function:**第一方**图片代理(同源 /api/img)。
// 目的:豆包(火山 TOS)等图床**不返回 CORS 头**,浏览器无法 fetch ⇒ 下载、缩略图归档、
// 本地原图备份全部拿不到字节。经本站代理转发后由本站给出 CORS 头,前端即可正常读取。
// 用法:GET /api/img?url=<encodeURIComponent(https 图片地址)>
//
// 安全边界(H2 加固):
// - 仅接受**同源**调用:若请求带 Origin 头,其 host 必须与本站一致。
// - 仅 https、仅允许常见图片/对象存储域名(避免成为开放代理/SSRF),仅透传 image/* 响应。
// - **手动跟随重定向**:每一跳都对目标 host 重新做白名单校验(原实现 redirect:'follow' 只校验初始
// host,可被 302 逃逸到任意主机),并限制跳数。
// - **响应大小上限**:先看 content-length,超限即拒;无 content-length 时按流裁剪(防超大响应耗尽配额)。
// - 不再返回 Access-Control-Allow-Origin: *(同源调用本就不需要 CORS)。
export function onRequest(context) {
return handle(context.request)
}
const ALLOW_HOSTS = [
/(^|\.)volces\.com$/i, // 火山引擎 / TOS(豆包 Seedream 图床)
/(^|\.)aliyuncs\.com$/i, // 阿里云 OSS(tuzi 文档示例图床)
/(^|\.)myqcloud\.com$/i, // 腾讯云 COS
/(^|\.)qiniucdn\.com$/i,
/(^|\.)cloudfront\.net$/i,
/(^|\.)googleusercontent\.com$/i,
/(^|\.)openai\.org$/i,
/(^|\.)oaistatic\.com$/i,
/(^|\.)blob\.core\.windows\.net$/i,
]
const MAX_BYTES = 25 * 1024 * 1024 // 单张图片上限 25MB(生成图远小于此;防超大响应)
const MAX_REDIRECTS = 3
// 安全头(2026-10-20 加,H1):Cloudflare Pages 的 `_headers` **不作用于 Functions 响应**
// (https://developers.cloudflare.com/pages/configuration/headers/)⇒ 静态资源有 CSP/nosniff,
// 而本函数(及 plugins 函数)原本**一个安全头都没有**。这不是可利用漏洞(每个响应都显式
// 设了 Content-Type),但属于纵深防御缺口:将来若有端点返回用户影响的内容且漏设 Content-Type,
// 浏览器会自行嗅探类型 ⇒ 可能演变成 XSS。故在**每个** Response 显式补齐 nosniff + Referrer-Policy。
const SECURITY_HEADERS = {
'X-Content-Type-Options': 'nosniff',
'Referrer-Policy': 'no-referrer',
}
function hdr() {
return Object.assign({ 'Content-Type': 'text/plain; charset=utf-8' }, SECURITY_HEADERS)
}
function plain(msg, status) {
return new Response(msg, { status, headers: hdr() })
}
function sameOrigin(request) {
const origin = request.headers.get('Origin')
if (!origin || origin === 'null') return true
try { return new URL(origin).host === new URL(request.url).host } catch (e) { return false }
}
function hostAllowed(u) {
return ALLOW_HOSTS.some((re) => re.test(u.hostname))
}
function capStream(stream, max) {
let seen = 0
return stream.pipeThrough(new TransformStream({
transform(chunk, controller) {
seen += chunk && chunk.byteLength ? chunk.byteLength : 0
if (seen > max) { controller.error(new Error('response too large')); return }
controller.enqueue(chunk)
},
}))
}
async function handle(request) {
if (request.method === 'OPTIONS') return new Response(null, { status: 204, headers: hdr() })
if (request.method !== 'GET') return plain('仅支持 GET', 405)
if (!sameOrigin(request)) return plain('仅允许同源调用', 403)
let target
try {
const raw = String(new URL(request.url).searchParams.get('url') || '')
target = new URL(raw)
} catch (e) { return plain('缺少或非法的 url 参数', 400) }
if (target.protocol !== 'https:') return plain('仅支持 https 图片地址', 400)
if (!hostAllowed(target)) return plain('该图床未在允许列表中:' + target.hostname, 403)
try {
// 手动跟随重定向:每一跳都对 host 重新校验,逃逸即拒。
let upstream = null
for (let hop = 0; hop <= MAX_REDIRECTS; hop++) {
upstream = await fetch(target.toString(), { headers: { Accept: 'image/*' }, redirect: 'manual' })
const status = upstream.status
const isRedirect = status >= 300 && status < 400
if (!isRedirect) break
const location = upstream.headers.get('Location')
if (!location) return plain('上游重定向缺少 Location', 502)
if (hop === MAX_REDIRECTS) return plain('重定向次数过多', 508)
let next
try { next = new URL(location, target) } catch (e) { return plain('上游重定向地址非法', 502) }
if (next.protocol !== 'https:') return plain('重定向目标非 https', 403)
if (!hostAllowed(next)) return plain('重定向目标未在允许列表中:' + next.hostname, 403)
target = next
}
if (!upstream || !upstream.ok) return plain('上游返回 ' + (upstream ? upstream.status : '0'), 502)
const ct = String(upstream.headers.get('content-type') || '')
if (ct && ct.toLowerCase().indexOf('image/') !== 0) return plain('上游不是图片(' + ct + ')', 415)
const len = Number(upstream.headers.get('content-length'))
if (Number.isFinite(len) && len > MAX_BYTES) return plain('图片过大(超过 ' + MAX_BYTES + ' 字节)', 413)
const headers = new Headers()
headers.set('Content-Type', ct || 'image/png')
headers.set('Cache-Control', 'private, max-age=600')
for (const [k, v] of Object.entries(SECURITY_HEADERS)) headers.set(k, v)
const body = upstream.body && !(Number.isFinite(len) && len <= MAX_BYTES) ? capStream(upstream.body, MAX_BYTES) : upstream.body
return new Response(body, { status: 200, headers })
} catch (e) {
return plain('代理失败:' + ((e && e.message) || 'unknown'), 502)
}
}
-74
View File
@@ -1,74 +0,0 @@
// /plugins/* → 从 KV(binding: PLUGINS)以**同源**方式提供插件文件。
// 同源脚本本就被页面 CSP(script-src 'self')允许 ⇒ 无需放宽 CSP、无需 unsafe-eval、无需重新部署 app.js。
// KV 键约定:plugins/index.json(清单)+ plugins/<file>(每个插件一个文件)。
//
// 缓存策略(按 basename 分流):
// - plugin-<id>.<hash12>.js(内容寻址,发布脚本生成)→ public, max-age=31536000, immutable(字节永不变 ⇒ 可永久缓存)
// - 其他 .js(历史遗留未哈希文件)→ no-cache + ETag(安全网:绝不许被永久缓存)
// - .json(清单)→ no-cache + ETag;if-none-match 命中 → 304 空 body
// - 其他扩展名 / 404 / 500 → no-store
// ETag 为 (value, basename) 的确定性纯函数:FNV-1a 32bit(同步、廉价),hex 后加双引号。
const JS_CT = 'application/javascript; charset=utf-8'
const JSON_CT = 'application/json; charset=utf-8'
// 安全头(2026-10-20 加,H1):Cloudflare Pages 的 `_headers` **不作用于 Functions 响应**
// (https://developers.cloudflare.com/pages/configuration/headers/)⇒ 静态资源有 CSP/nosniff,
// 而本函数原本**一个安全头都没有**。插件字节虽同源且有 SRI 校验,但缺 nosniff 意味着
// 万一将来 KV 里的内容类型异常,浏览器可能自行嗅探 ⇒ 补齐纵深防御。
const SECURITY_HEADERS = { 'x-content-type-options': 'nosniff', 'referrer-policy': 'no-referrer' }
const ERROR_HEADERS = Object.assign({ 'content-type': JSON_CT, 'cache-control': 'no-store' }, SECURITY_HEADERS)
const NO_STORE_HEADERS = Object.assign({ 'content-type': JS_CT, 'cache-control': 'no-store' }, SECURITY_HEADERS)
const IMMUTABLE_JS_RE = /^plugin-[a-z0-9-]+\.[0-9a-f]{12}\.js$/
// FNV-1a 32-bit(对 UTF-16 code unit 序列):同步、确定、够用于 ETag 指纹
const fnv1a32 = (s) => {
let h = 0x811c9dc5
for (let i = 0; i < s.length; i++) {
h ^= s.charCodeAt(i)
h = Math.imul(h, 0x01000193)
}
return (h >>> 0).toString(16).padStart(8, '0')
}
const etagOf = (value, base) => '"' + fnv1a32(base + '\n' + value) + '"'
export async function onRequestGet(context) {
const { params, env } = context
const parts = Array.isArray(params.path) ? params.path : [params.path].filter(Boolean)
const tail = parts.join('/') || 'index.json'
const key = 'plugins/' + tail
const base = tail.slice(tail.lastIndexOf('/') + 1)
if (!env || !env.PLUGINS) {
return new Response(JSON.stringify({ error: 'PLUGINS KV 未绑定' }), { status: 500, headers: ERROR_HEADERS })
}
const value = await env.PLUGINS.get(key)
if (value === null) return new Response('not found', { status: 404, headers: Object.assign({ 'cache-control': 'no-store' }, SECURITY_HEADERS) })
// A) 内容寻址的插件 JS:内容变 ⇒ 文件名变 ⇒ 可 immutable 永久缓存
if (IMMUTABLE_JS_RE.test(base)) {
return new Response(value, {
headers: Object.assign({ 'content-type': JS_CT, 'cache-control': 'public, max-age=31536000, immutable' }, SECURITY_HEADERS),
})
}
// B) 未哈希 .js 与 .json(清单):no-cache + ETag,每次回源校验,命中即 304
if (base.endsWith('.js') || base.endsWith('.json')) {
const etag = etagOf(value, base)
const headers = Object.assign({
'content-type': base.endsWith('.json') ? JSON_CT : JS_CT,
'cache-control': 'no-cache',
etag,
}, SECURITY_HEADERS)
const inm = context.request && context.request.headers && context.request.headers.get('if-none-match')
if (inm === etag) return new Response(null, { status: 304, headers })
return new Response(value, { headers })
}
// 其他扩展名:保持 no-store
return new Response(value, { headers: NO_STORE_HEADERS })
}
+3 -5
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.25.3",
"version": "3.26.37",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
@@ -9,8 +9,8 @@
"app:dev": "tauri dev",
"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": "node tests/relay-task-graph-fixture-test.js && node tests/plugin-style-node-test.js && node tests/inherit-text-test.js",
"test:unit": "node tests/plugin-archive-test.js && node tests/plugin-files-policy-test.js && node tests/theme-plugin-tokens-test.js && node tests/image-prompt-cover-test.js && 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/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/plugin-data-test.js && node tests/plugin-loader-test.js && node tests/plugin-bundle-test.js && node tests/plugin-install-test.js && node tests/plugin-gallery-render-test.js && node tests/plugin-gallery-recovery-test.js && node tests/plugin-gallery-ux-test.js && node tests/plugin-grouplib-render-test.js && node tests/plugin-promptlib-render-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/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/plugin-theme-contract-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/native-overlay-park-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-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",
@@ -20,8 +20,6 @@
"test:e2e:local": "node scripts/serve-test.js",
"verify:ci": "npm run build && node --check app.js && node --check dist/app.js && node scripts/check-dist.js && npm run lint && npm run typecheck && npm run test:unit && npm test && npm run test:facts",
"verify": "npm run verify:ci && npm run test:e2e",
"deploy": "npm run verify && npx --yes wrangler@4 pages deploy dist --project-name image-workbench-web --branch main",
"deploy:test": "npm run verify && npx --yes wrangler@4 pages deploy dist --project-name image-workbench-web --branch test",
"verify:release": "node scripts/verify-release.js",
"coverage:e2e": "node scripts/coverage-e2e.js",
"sync:facts": "node scripts/sync-facts.js",
+554
View File
@@ -0,0 +1,554 @@
// iwb-plugin: 图库 —— 右栏「图库」面板(宿主只提供 ctx.gallery 数据能力,界面全部在插件里)
//
// 依赖客户端能力:gallery(list/thumb/preview/download/insert/remove)+ panels。
// 数据:插件自己的配置(插入尺寸/图幅/时间筛选)存 ctx.data,不塞 settings。
// 视觉:复用宿主的 .iwb-gal-* / .iwb-history-* 类名(宿主 style.css 保留这些样式)。
;(function (global) {
'use strict'
if (!global.IWBPluginHost) return
var PANEL_ID = 'gallery-panel'
var DEF = { insertK: '1k', tile: 110, range: '' }
// v1.6.2:图幅=**实际显示宽度上限**(此前只当「算列数」用,独列时会被拉到撑满面板,选「小」也很大)
// v1.6.3:新增「极小」64px 档(面板窄时想一行看更多图)
var TILES = [[64, '极小'], [80, '小'], [110, '中'], [150, '大'], [200, '特大']]
var KS = [['orig', '原图'], ['2k', '2K'], ['1k', '1K'], ['0.5k', '0.5K']]
var RANGES = [['', '全部'], ['today', '今天'], ['7d', '7 天'], ['30d', '30 天']]
function el (tag, attrs) {
var node = document.createElement(tag)
if (attrs) {
for (var k in attrs) {
if (!Object.prototype.hasOwnProperty.call(attrs, k)) continue
var v = attrs[k]
if (v === null || v === undefined) continue
if (k === 'class') node.className = v
else if (k === 'text') node.textContent = v
else if (k === 'style') node.setAttribute('style', v)
else node.setAttribute(k, v)
}
}
// 变参子节点(第三位起),支持数组与字符串
for (var i = 2; i < arguments.length; i++) append(node, arguments[i])
return node
}
function append (node, v) {
if (v === null || v === undefined || v === false) return
if (Array.isArray(v)) { for (var i = 0; i < v.length; i++) append(node, v[i]); return }
node.appendChild(typeof v === 'string' ? document.createTextNode(v) : v)
}
function clear (node) { while (node.firstChild) node.removeChild(node.firstChild) }
// v1.4.1:底栏按钮改用图标(窄栏里「刷新/设置」会被挤成竖排两行)
var SVG_NS = 'http://www.w3.org/2000/svg'
function iconBtn (label, build, title) {
var b = el('button', { class: 'iwb-btn iwb-btn-sm iwb-gal-icobtn', title: title || label, 'aria-label': label })
var svg = document.createElementNS(SVG_NS, 'svg')
svg.setAttribute('viewBox', '0 0 16 16')
svg.setAttribute('width', '14')
svg.setAttribute('height', '14')
svg.setAttribute('fill', 'none')
svg.setAttribute('stroke', 'currentColor')
svg.setAttribute('stroke-width', '1.5')
svg.setAttribute('stroke-linecap', 'round')
svg.setAttribute('stroke-linejoin', 'round')
svg.setAttribute('aria-hidden', 'true')
build(svg)
b.appendChild(svg)
return b
}
function svgPath (svg, d) {
var p = document.createElementNS(SVG_NS, 'path')
p.setAttribute('d', d)
svg.appendChild(p)
return p
}
function sel (options, value) {
var s = el('select', { class: 'iwb-input iwb-select-compact' })
for (var i = 0; i < options.length; i++) {
var o = el('option', { value: String(options[i][0]), text: options[i][1] })
if (String(options[i][0]) === String(value)) o.selected = true
s.appendChild(o)
}
return s
}
function mount (host, ctx) {
clear(host)
host.classList.add('iwb-plugin-node-body')
host.style.minHeight = '0'
var cfg = Object.assign({}, DEF)
var items = []
var thumbCache = {}
var thumbPending = {} // 进行中的缩略图请求(v1.6.9)
var total = 0
var limit = 100
var picked = {}
var gridW = 320
var raf = 0
var failed = {} // v1.6.0:缩略图仍失败的 name 集合(据此显示「N 张失败」+ 全部重试)
var head = el('div', { class: 'iwb-gal-head' })
var actions = el('div', { class: 'iwb-gal-actions' })
head.appendChild(actions)
var grid = el('div', { class: 'iwb-history-grid' })
var empty = el('div', { class: 'iwb-hint', text: '暂无图片 · 运行生图后会出现在这里' })
var more = el('div', { class: 'iwb-history-more' })
// v1.1.0:底部横栏 —— 左边张数/已选,右边三个设定(右对齐)
var countEl = el('span', { class: 'iwb-gal-count', text: '0 / 0 张' })
var pickedEl = el('span', { class: 'iwb-gal-sel', text: '' })
var statusEl = el('span', { class: 'iwb-gal-status', text: '' })
var failEl = el('span', { class: 'iwb-gal-fail', text: '' })
failEl.style.display = 'none'
failEl.addEventListener('click', function () { retryAll() })
var refreshBtn = iconBtn('刷新', function (svg) {
svgPath(svg, 'M13.2 6.4A5.4 5.4 0 1 0 13.4 9.4')
svgPath(svg, 'M13.2 2.6v3.8H9.4')
}, '刷新:重新向宿主拉取图库(图床恢复/外部改动后点这里)')
refreshBtn.addEventListener('click', function () { load(true) })
// v1.4.0:三个下拉不再占用前台(窄栏放不下、也显乱)——收进「设置」浮层,点按钮才展开。
var setBtn = iconBtn('设置', function (svg) {
var c1 = document.createElementNS(SVG_NS, 'circle')
c1.setAttribute('cx', '8'); c1.setAttribute('cy', '8'); c1.setAttribute('r', '4.2')
svg.appendChild(c1)
var c2 = document.createElementNS(SVG_NS, 'circle')
c2.setAttribute('cx', '8'); c2.setAttribute('cy', '8'); c2.setAttribute('r', '1.6')
svg.appendChild(c2)
for (var i = 0; i < 8; i++) {
var a = i * Math.PI / 4
var x1 = (8 + Math.cos(a) * 4.2).toFixed(2)
var y1 = (8 + Math.sin(a) * 4.2).toFixed(2)
var x2 = (8 + Math.cos(a) * 5.6).toFixed(2)
var y2 = (8 + Math.sin(a) * 5.6).toFixed(2)
svgPath(svg, 'M' + x1 + ' ' + y1 + 'L' + x2 + ' ' + y2)
}
}, '图库设置:插入尺寸 / 图幅 / 时间范围')
setBtn.classList.add('iwb-gal-setbtn')
setBtn.setAttribute('aria-expanded', 'false')
var settings = el('div', { class: 'iwb-gal-settings', role: 'dialog', 'aria-label': '图库设置' })
settings.style.display = 'none'
// v1.4.2:刷新与设置同放右侧工具组(此前刷新在左侧信息区,空间不足时会向右溢出、压住设置图标)
var tools = el('div', { class: 'iwb-gal-tools' }, refreshBtn, setBtn)
var foot = el('div', { class: 'iwb-gal-foot' },
el('div', { class: 'iwb-gal-foot-left' }, countEl, pickedEl, failEl, statusEl), tools)
var wrap = el('div', { class: 'iwb-history-embedded' }, [head, grid, more, empty, foot, settings])
function setOpen (open) {
settings.style.display = open ? '' : 'none'
setBtn.setAttribute('aria-expanded', open ? 'true' : 'false')
setBtn.classList.toggle('iwb-gal-setbtn-on', !!open)
if (open) document.addEventListener('pointerdown', onDocDown, true)
else document.removeEventListener('pointerdown', onDocDown, true)
}
function onDocDown (e) {
if (settings.contains(e.target) || setBtn.contains(e.target)) return
setOpen(false)
}
setBtn.addEventListener('click', function (e) { e.stopPropagation(); setOpen(settings.style.display === 'none') })
host.appendChild(wrap)
function count () { return Object.keys(picked).length }
// ---- v1.6.0 右键菜单:单张操作(插入 / 下载 / 预览 / 复制文件名 / 删除)----
var menuEl = null
function closeMenu () {
if (menuEl && menuEl.parentNode) menuEl.parentNode.removeChild(menuEl)
menuEl = null
document.removeEventListener('pointerdown', onMenuDown, true)
document.removeEventListener('keydown', onMenuKey, true)
}
function onMenuDown (e) { if (menuEl && !menuEl.contains(e.target)) closeMenu() }
function onMenuKey (e) { if (e.key === 'Escape') closeMenu() }
function openMenu (e, it) {
e.preventDefault(); e.stopPropagation()
closeMenu()
var menu = el('div', { class: 'iwb-ctxmenu iwb-gal-menu', style: 'left:' + e.clientX + 'px;top:' + e.clientY + 'px' })
menu.appendChild(el('div', { class: 'iwb-ctx-title', text: it.name }))
function item (label, fn) {
var b = el('button', { class: 'iwb-ctx-item', text: label })
b.addEventListener('click', function (ev) { ev.stopPropagation(); closeMenu(); fn() })
menu.appendChild(b)
}
item('插入画布', function () {
Promise.resolve(ctx.gallery.insert([it.name], { insertK: cfg.insertK || '1k' }))
.then(function () { setStatus('已插入:' + it.name) })
.catch(function () { setStatus('插入失败') })
})
item('下载', function () { doDownload([it.name]) })
item('预览大图', function () { try { ctx.gallery.preview(it.name) } catch (err) { /* ignore */ } })
item('复制文件名', function () {
try {
var p = global.navigator && global.navigator.clipboard && global.navigator.clipboard.writeText(it.name)
if (p && p.then) p.then(function () { setStatus('已复制文件名') }).catch(function () { setStatus('复制失败(剪贴板不可用)') })
else setStatus('复制失败(剪贴板不可用)')
} catch (err) { setStatus('复制失败(剪贴板不可用)') }
})
item('删除这张', function () {
var C = global.IWBUIConfirm
var ask = (C && C.askOrNative) ? C.askOrNative('删除「' + it.name + '」?不可恢复。', { title: '删除图片', okText: '删除' }) : Promise.resolve(global.confirm('删除「' + it.name + '」?'))
ask.then(function (ok) {
if (!ok) return
items = items.filter(function (x) { return x.name !== it.name })
total = Math.max(0, total - 1)
delete picked[it.name]
render()
Promise.resolve(ctx.gallery.remove([it.name])).then(function () { setTimeout(load, 250) }).catch(function () {})
}).catch(function () {})
})
document.body.appendChild(menu)
menuEl = menu
setTimeout(function () {
document.addEventListener('pointerdown', onMenuDown, true)
document.addEventListener('keydown', onMenuKey, true)
}, 0)
}
// ---- v1.6.0 多选拖入画布:宿主 drop 只认单张,这里在捕获阶段接管整批 ----
// 仅当 dataTransfer 带 application/x-iwb-gallery-batch 时生效,其余拖放行为完全不变。
function onDocDrop (e) {
var raw = ''
try { raw = (e.dataTransfer && e.dataTransfer.getData('application/x-iwb-gallery-batch')) || '' } catch (err) { return }
if (!raw) return
var names = []
try { names = JSON.parse(raw) } catch (err) { return }
if (!names || names.length < 2) return
e.preventDefault(); e.stopPropagation()
Promise.resolve(ctx.gallery.insert(names, { insertK: cfg.insertK || '1k' })).then(function (r) {
if (r && r.ok === false) { setStatus('批量插入失败'); return }
setStatus('已插入 ' + names.length + ' 张')
}).catch(function () { setStatus('批量插入失败') })
}
document.addEventListener('drop', onDocDrop, true)
// v1.6.0:失败计数集中在底栏;点它 = 全部重试(整墙重挂,重新向宿主取缩略图)
function updateFail () {
var n = Object.keys(failed).length
if (!n) { failEl.style.display = 'none'; failEl.textContent = ''; return }
failEl.style.display = ''
failEl.textContent = n + ' 张失败 · 重试'
failEl.title = '点击重新加载这 ' + n + ' 张的缩略图'
}
function retryAll () {
failed = {}
updateFail()
setStatus('重试中…')
render()
}
function pickedNames () { return Object.keys(picked) }
function renderHead () {
clear(actions)
countEl.textContent = items.length + ' / ' + total + ' 张'
pickedEl.textContent = count() ? ('已选 ' + count()) : ''
var n = count()
function btn (label, title0, fn, need, danger) {
var b = el('button', { class: 'iwb-btn iwb-btn-sm' + (danger ? ' iwb-btn-danger' : '') + (need && !n ? ' iwb-gal-off' : ''), text: label, title: need && !n ? '先选中图片' : title0 })
b.addEventListener('click', function () { if (need && !n) return; fn() })
return b
}
actions.appendChild(btn('全选', '全选当前筛选结果', function () { for (var i = 0; i < items.length; i++) picked[items[i].name] = 1; render() }))
actions.appendChild(btn('反选', '反选当前筛选结果', function () { for (var i = 0; i < items.length; i++) { var k = items[i].name; if (picked[k]) delete picked[k]; else picked[k] = 1 } render() }))
actions.appendChild(btn('插入', '把选中的图片插入画布(尺寸按「设置 → 插入尺寸」)', function () {
var names = pickedNames()
var k = cfg.insertK || '1k'
Promise.resolve(ctx.gallery.insert(names, { insertK: k })).then(function (r) {
if (r && r.ok === false) { setStatus('插入失败'); return }
setStatus('已插入 ' + names.length + ' 张(' + String(k).toUpperCase() + ')')
}).catch(function () { setStatus('插入失败') })
}, true))
actions.appendChild(btn('下载', '下载选中的图片', function () { doDownload(pickedNames()) }, true))
actions.appendChild(btn('删除', '删除选中的图片(不可恢复)', function () {
var C = global.IWBUIConfirm
var ask = C && C.askOrNative ? C.askOrNative('删除选中的 ' + n + ' 张图片?不可恢复。', { title: '删除图片', okText: '删除' }) : Promise.resolve(global.confirm('删除选中的 ' + n + ' 张图片?'))
var names = pickedNames()
ask.then(function (ok) {
if (!ok) return
// 先本地摘掉,避免删除后还渲染一格「图片已丢失」;随后再向宿主重拉(等它删完+刷新)
items = items.filter(function (x) { return names.indexOf(x.name) < 0 })
total = Math.max(0, total - names.length)
picked = {}
render()
return Promise.resolve(ctx.gallery.remove(names)).then(function () {
setTimeout(load, 250)
})
}).catch(function () {})
}, true, true))
}
// 设置浮层内容只建一次(不随每次 render 重建,避免下拉被重置)
function buildSettings () {
clear(settings)
settings.appendChild(el('div', { class: 'iwb-gal-settings-title', text: '图库设置' }))
function row (key, options, label, hint) {
var s = sel(options, cfg[key])
s.title = hint || label
s.setAttribute('aria-label', label)
s.addEventListener('change', function () {
cfg[key] = s.value
saveCfg()
if (key === 'range') { limit = 100; load() } else if (key === 'tile') render()
})
return el('label', { class: 'iwb-gal-setrow' }, el('span', { class: 'iwb-gal-setlabel', text: label }), s)
}
settings.appendChild(row('insertK', KS, '插入尺寸', '插入画布时的图片尺寸'))
settings.appendChild(row('tile', TILES, '图幅', '图库图片显示宽度'))
settings.appendChild(row('range', RANGES, '时间范围', '按生成时间筛选'))
}
function renderGrid () {
clear(grid)
var gap = 6
var tileW = Math.max(40, Number(cfg.tile) || 110)
var n = Math.max(1, Math.floor((gridW + gap) / (tileW + gap)))
// v1.6.6:列宽 = 均分宽度(铺满面板),图幅只决定「列数」——
// 以前 min(图幅, 均分) 会留下右侧空白,看起来像没补齐。
var colW = Math.max(40, (gridW - gap * (n - 1)) / n)
var cols = []
var heights = []
for (var c = 0; c < n; c++) { cols.push([]); heights.push(0) }
for (var i = 0; i < items.length; i++) {
var it = items[i]
var ratio = (it.w && it.h) ? (it.h / it.w) : 1
var min = 0
for (var j = 1; j < n; j++) if (heights[j] < heights[min]) min = j
cols[min].push(it)
heights[min] += colW * ratio + gap
}
for (var ci = 0; ci < cols.length; ci++) {
var col = el('div', { class: 'iwb-history-col', style: 'width:' + Math.round(colW) + 'px;flex:0 0 auto' })
for (var k = 0; k < cols[ci].length; k++) col.appendChild(itemNode(cols[ci][k]))
grid.appendChild(col)
}
empty.style.display = items.length ? 'none' : ''
clear(more)
if (total > items.length) {
var b = el('button', { class: 'iwb-btn iwb-btn-sm', text: '显示更多(' + (total - items.length) + ' 张)' })
b.addEventListener('click', function () { limit += 100; load() })
more.appendChild(b)
}
}
function itemNode (it) {
var on = !!picked[it.name]
var box = el('div', { class: 'iwb-history-item' + (count() ? ' iwb-history-managed' : '') + (on ? ' iwb-history-selected' : '') })
// 缩略图是**异步**的(ctx.gallery.thumb 返回 Promise):先占位,拿到地址再挂 img。
// v1.2.0:加载失败自动重试 2 次(图片还没落盘/临时不可读),仍失败才显示可点击重试的占位。
box.title = it.name + '(单击单选 · Shift+单击多选 · 双击放大 · 拖到画布=参考图节点)'
var holder = el('div', { class: 'iwb-history-missing', text: '加载中…' })
box.appendChild(holder)
var tries = 0
function fail (text) {
tries = 999
holder.textContent = text || '缩略图加载失败(点击重试)'
holder.style.cursor = 'pointer'
holder.onclick = function () { failed[it.name] = 1; tries = 0; boot() }
failed[it.name] = 1
updateFail()
}
function boot () {
if (tries >= 999) return
holder.style.cursor = ''
holder.onclick = null
holder.textContent = '加载中…'
// v1.6.9:缩略图地址按名字缓存,且进行中的请求共享同一 Promise ——
// 重排/重测会重建 DOM,不共享就会对同一张图重复取 N 次。
var key = it.name
if (thumbCache[key]) { var u0 = thumbCache[key]; Promise.resolve().then(function () { paint(u0) }).catch(function () { /* ignore */ }); return }
if (!thumbPending[key]) {
thumbPending[key] = Promise.resolve(ctx.gallery.thumb(key)).then(function (url) {
if (url && typeof url === 'string') thumbCache[key] = url
delete thumbPending[key]
return url
}, function (e) { delete thumbPending[key]; throw e })
}
thumbPending[key].then(paint).catch(function () { fail('缩略图加载失败(点击重试)') })
}
function paint (url) {
if (!url || typeof url !== 'string') { fail('图片已丢失'); return }
if (!box.isConnected) return
var img = el('img', { src: url, alt: '', loading: 'lazy', draggable: 'true' })
if (it.w && it.h) img.setAttribute('style', 'aspect-ratio:' + it.w + ' / ' + it.h)
img.addEventListener('load', function () {
// naturalWidth=0 说明拿到的是坏图(空 data URL / 截断文件):按失败处理,别留白块
if (!img.naturalWidth) { tries++; if (tries <= 2) { setTimeout(boot, 400 * tries); return } if (img.parentNode === box) box.replaceChild(holder, img); fail('缩略图加载失败(点击重试)'); return }
if (holder.parentNode === box) box.replaceChild(img, holder)
if (failed[it.name]) { delete failed[it.name]; updateFail() }
})
img.addEventListener('error', function () {
tries++
if (tries <= 2) { setTimeout(boot, 400 * tries); return }
if (img.parentNode === box) box.replaceChild(holder, img)
fail('缩略图加载失败(点击重试)')
})
img.addEventListener('click', function (e) { pick(it.name, !!(e && e.shiftKey)) })
img.addEventListener('dblclick', function () { ctx.gallery.preview(it.name) })
img.addEventListener('dragstart', function (e) {
try {
var names = (picked[it.name] && count() > 1) ? pickedNames() : [it.name]
e.dataTransfer.setData('application/x-iwb-localref', names[0])
e.dataTransfer.setData('application/x-iwb-gallery-orig', names[0])
// 多选:额外带一批名字,由本插件在 document 捕获阶段接管(宿主 drop 只认单张)
if (names.length > 1) {
e.dataTransfer.setData('application/x-iwb-gallery-batch', JSON.stringify(names))
setStatus('拖动 ' + names.length + ' 张')
}
e.dataTransfer.effectAllowed = 'copy'
} catch (err) { /* ignore */ }
})
img.style.display = 'none'
box.appendChild(img)
// v1.6.9:坏图/超时兜底 —— 某些坏字节既不触发 load 也不触发 error,700ms 后直接判定失败(可点击重试)
setTimeout(function () {
try {
if (!img.parentNode) return
if (img.naturalWidth > 0) return
if (img.parentNode === box) box.replaceChild(holder, img)
fail('缩略图加载失败(点击重试)')
} catch (e) { /* ignore */ }
}, 700)
// 加载成功后再替换占位(避免破图标 + 长 title 占满格子)
if (img.complete && img.naturalWidth > 0) { img.style.display = ''; if (holder.parentNode === box) box.replaceChild(img, holder) }
else if (img.complete && !img.naturalWidth) { /* 立即失败(坏图)*/ tries++; if (tries <= 2) setTimeout(boot, 400 * tries); else { if (img.parentNode === box) box.replaceChild(holder, img); fail('缩略图加载失败(点击重试)') } }
}
boot()
box.addEventListener('contextmenu', function (e) { openMenu(e, it) })
var acts = el('div', { class: 'iwb-history-actions' })
function act (label, title, fn) {
var b = el('button', { class: 'iwb-btn iwb-btn-sm', text: label, title: title })
b.addEventListener('click', function (e) { e.stopPropagation(); fn() })
return b
}
acts.appendChild(act('插入', '插入到画布(参考图节点)', function () { ctx.gallery.insert([it.name]).catch(function () {}) }))
acts.appendChild(act('下载', '下载到本地', function () { doDownload([it.name]) }))
box.appendChild(acts)
return box
}
var statusTimer = 0
function setStatus (text) {
statusEl.textContent = text || ''
clearTimeout(statusTimer)
if (text) statusTimer = setTimeout(function () { statusEl.textContent = '' }, 4000)
}
function doDownload (names) {
setStatus('下载中…')
return Promise.resolve(ctx.gallery.download(names)).then(function (r) {
var failed = (r && r.failed) || []
var ok = (r && r.count) || 0
if (failed.length) setStatus(failed.length + ' 张下载失败,可再点一次重试')
else setStatus(ok ? ('已下载 ' + ok + ' 张') : '没有可下载的图片')
}).catch(function () { setStatus('下载失败,可再点一次重试') })
}
function pick (name, shift) {
if (shift) { if (picked[name]) delete picked[name]; else picked[name] = 1 } else { picked = {}; picked[name] = 1 }
render()
}
function render () { renderHead(); renderGrid() }
function load (force) {
if (force) setStatus('刷新中…')
return Promise.resolve(ctx.gallery.list({ range: cfg.range, limit: limit })).then(function (r) {
items = (r && r.items) || []
total = (r && r.total) || items.length
lastLoadAt = Date.now()
failed = {}
render()
}).catch(function () { items = []; total = 0; render() })
}
var saveTimer = 0
function saveCfg () {
clearTimeout(saveTimer)
saveTimer = setTimeout(function () {
try { var p = ctx.data && ctx.data.patch({ cfg: cfg }); if (p && p.catch) p.catch(function () {}) } catch (e) { /* 配置存不下不影响使用 */ }
}, 200)
}
// 宽度测量:列数只由「面板宽 / 图幅」决定
// v1.6.5:面板刚挂载时 grid 宽度可能是 0,而 grid 宽度又取决于列宽 → RO 不会触发,图库一直空白。
function availableW () {
// v1.6.6:优先量「会随面板拉伸的外层容器」,而不是 grid 自身
// (grid 现在是 flex-start + 内容宽度,面板变宽它不会变宽 → RO 不触发 → 列数永不补齐)
var w = wrap ? wrap.clientWidth : 0
if (!w && wrap && wrap.parentNode) w = wrap.parentNode.clientWidth
if (!w) w = grid.clientWidth
return w || 0
}
function measure () {
var w = availableW()
if (w > 0 && Math.abs(w - gridW) > 1) { gridW = w; renderGrid() }
}
var ro = typeof ResizeObserver === 'function' ? new ResizeObserver(function () { measure() }) : null
if (ro) { if (wrap) ro.observe(wrap); if (wrap && wrap.parentNode) ro.observe(wrap.parentNode); ro.observe(grid) }
measure()
var tries = 0
function retry () {
if (gridW > 0 || tries++ > 40) { if (gridW <= 0) { gridW = Math.max(160, Number(cfg.tile) || 110) * 2; renderGrid() } return }
measure()
if (gridW <= 0) global.requestAnimationFrame(retry)
}
global.requestAnimationFrame(retry)
// v1.6.7:再补几次延时重测(停靠栏展开动画、首帧布局未完成时能在 1s 内自愈)
;[120, 400, 900].forEach(function (ms) { setTimeout(function () { try { measure(); if (gridW > 0) renderGrid() } catch (e) { /* ignore */ } }, ms) })
// v1.3.0:自动恢复 —— 面板重新可见(切回 tab / 窗口聚焦 / 后台回来)且距上次拉取 >5s 时重拉一次,
// 这样图床恢复、后台补图后不必手动刷新;同时保留底部「刷新」按钮做即时重试。
var lastLoadAt = 0
var autoRefresh = function () {
if (Date.now() - lastLoadAt < 5000) return
load()
}
try {
if (typeof IntersectionObserver === 'function') {
var io = new IntersectionObserver(function (entries) {
for (var i = 0; i < entries.length; i++) {
if (entries[i].isIntersecting) {
// v1.6.7:面板真正可见后再量一次宽度并重排(首帧可能还是 0 宽)
try { measure(); renderGrid() } catch (e) { /* ignore */ }
autoRefresh()
}
}
}, { threshold: 0.15 })
io.observe(wrap)
}
document.addEventListener('visibilitychange', function () { if (!document.hidden) autoRefresh() })
window.addEventListener('focus', autoRefresh)
} catch (e) { /* 环境不支持则只保留手动刷新 */ }
// 先读配置,再拉列表
Promise.resolve(ctx.data && ctx.data.read ? ctx.data.read() : {}).then(function (d) {
if (d && d.cfg) cfg = Object.assign({}, DEF, d.cfg)
buildSettings() // 设置浮层里的下拉要反映读到的配置
return load()
}).catch(function () { buildSettings(); load() })
return function dispose () {
if (ro) { try { ro.disconnect() } catch (e) { /* ignore */ } }
try { document.removeEventListener('pointerdown', onMenuDown, true) } catch (e) { /* ignore */ }
try { document.removeEventListener('keydown', onMenuKey, true) } catch (e) { /* ignore */ }
try { document.removeEventListener('drop', onDocDrop, true) } catch (e) { /* ignore */ }
closeMenu()
}
}
global.IWBPluginHost.register({
id: 'gallery',
name: '图库',
version: '1.6.9',
apiVersion: 1,
capabilities: ['panels', 'gallery'],
data: { schemaVersion: 1, maxBytes: 65536 },
}, function (ctx) {
ctx.ui.registerPanel({
id: PANEL_ID,
title: '图库',
icon: 'ref',
mount: function (host) { return mount(host, ctx) },
})
return {}
})
})(typeof window !== 'undefined' ? window : globalThis)
+19
View File
@@ -0,0 +1,19 @@
{
"id": "gallery",
"name": "图库",
"version": "1.6.9",
"apiVersion": 1,
"main": "main.js",
"style": "styles.css",
"description": "右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)",
"author": "official",
"icon": "🖼️",
"tags": [
"资源",
"图库"
],
"files": {
"main.js": "26c7e64b3a0021c6b9514dfb84d4d2580276698222b4791cfa99f22ead66ff52",
"styles.css": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0"
}
}
+79
View File
@@ -0,0 +1,79 @@
/* 图库插件样式(v1.5.0)
* 为什么放插件里:宿主 style.css 只在客户端发版时更新,而这里是「设置浮层/图标按钮/紧凑间距」这类
* 高频视觉调整——随插件更新即可生效,不必重发桌面端。选择器均带 .iwb-gal-* / .iwb-history-* 前缀,
* 且比宿主同名规则更具体(.iwb-gal-foot .iwb-gal-icobtn),宿主旧样式不会盖回来。
*/
/* ---- 面板留白:边缘收小,避免窄栏里浪费空间 ---- */
.iwb-history-embedded { padding: 6px 6px 4px; gap: 6px; }
.iwb-history-embedded .iwb-history-grid { gap: 6px; padding: 0 0 2px; justify-content: flex-start; }
/* 列宽由插件按「图幅」写死(style width),这里禁用宿主的 flex:1 拉伸 */
.iwb-history-embedded .iwb-history-col { flex: 0 0 auto; gap: 6px; }
/* ---- 顶栏 ---- */
.iwb-gal-head { display: flex; align-items: center; gap: 6px; min-height: 0; }
.iwb-gal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.iwb-gal-actions .iwb-btn-sm { padding: 2px 7px; }
/* ---- 底栏:左信息 / 右工具组 ---- */
.iwb-gal-foot {
display: flex; align-items: center; justify-content: space-between; gap: 6px;
min-width: 0; padding-top: 6px; border-top: 1px solid var(--iwb-border);
}
.iwb-gal-foot-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.iwb-gal-count { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; }
.iwb-gal-sel { font-size: 11px; color: var(--iwb-brand); white-space: nowrap; }
.iwb-gal-status { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: none; }
.iwb-gal-tools { display: flex; align-items: center; gap: 0; flex: 0 0 auto; margin-left: auto; }
/* ---- 图标按钮:无外框、无底色,只在悬停时给一点反馈 ---- */
.iwb-gal-foot .iwb-gal-icobtn,
.iwb-gal-foot .iwb-gal-icobtn:hover,
.iwb-gal-foot .iwb-gal-icobtn:active {
width: 20px; height: 20px; min-width: 20px; padding: 0; box-sizing: border-box;
display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
border: 0; box-shadow: none; background: transparent; border-radius: 4px;
color: var(--iwb-text2); line-height: 1; transform: none;
}
.iwb-gal-foot .iwb-gal-icobtn svg { display: block; pointer-events: none; }
.iwb-gal-foot .iwb-gal-icobtn:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
.iwb-gal-foot .iwb-gal-icobtn:focus-visible { outline: 2px solid color-mix(in srgb, var(--iwb-brand) 60%, transparent); outline-offset: 1px; }
.iwb-gal-setbtn-on { color: var(--iwb-brand); background: var(--iwb-layer2); }
/* ---- 设置浮层(三个下拉不占前台) ---- */
.iwb-gal-settings {
position: absolute; right: 8px; bottom: 34px; z-index: 30; width: 176px; max-width: calc(100% - 16px);
display: flex; flex-direction: column; gap: 8px; padding: 9px 10px;
background: var(--iwb-layer); border: 1px solid var(--iwb-border); border-radius: 8px;
box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}
.iwb-gal-settings-title { font-size: 11px; font-weight: 600; color: var(--iwb-text2); }
.iwb-gal-setrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--iwb-text2); }
.iwb-gal-setlabel { flex: 0 0 auto; }
.iwb-gal-setrow select { flex: 1 1 auto; width: auto; min-width: 58px; max-width: 92px; height: 22px; font-size: 11px; padding: 0 2px 0 4px; }
/* ---- 图片墙 ---- */
.iwb-history-grid { overscroll-behavior: contain; }
.iwb-history-embedded .iwb-history-item { position: relative; flex: none; width: 100%; }
.iwb-history-embedded .iwb-history-item img {
width: 100%; height: auto; display: block; object-fit: contain; margin: 0 auto;
border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: pointer;
}
.iwb-history-missing {
display: flex; align-items: center; justify-content: center; text-align: center;
min-height: 84px; padding: 8px; border-radius: 6px; border: 1px dashed var(--iwb-border);
font-size: 11px; color: var(--iwb-text2); background: var(--iwb-layer2); word-break: break-all;
}
.iwb-history-actions { display: flex; gap: 4px; padding: 4px 2px 0; }
.iwb-history-actions .iwb-btn-sm { padding: 1px 6px; font-size: 10px; }
.iwb-history-more { display: flex; justify-content: center; padding: 4px 0 2px; }
/* 只作用于图库自己的空态提示:不加前缀会泄漏到设置页等使用 .iwb-hint 的地方(文字被居中) */
.iwb-history-embedded .iwb-hint { font-size: 11px; color: var(--iwb-text2); text-align: center; padding: 12px 6px; }
/* ---- v1.6.0:失败统计 / 右键菜单标题(v1.6.1 去掉搜索框)---- */
.iwb-gal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.iwb-gal-fail {
font-size: 11px; color: var(--iwb-err); cursor: pointer; white-space: nowrap;
text-decoration: underline dotted; text-underline-offset: 2px;
}
.iwb-gal-fail:hover { color: var(--iwb-err); opacity: .85; }
.iwb-gal-menu .iwb-ctx-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+455
View File
@@ -0,0 +1,455 @@
// iwb-plugin: 节点组库 —— 左侧「节点组」面板(宿主只提供 ctx.grouplib 数据能力,界面全部在插件里)
//
// 依赖客户端能力:grouplib(list/save/remove/instantiate/notify/onChanged)+ panels。
// 数据仍在宿主持有(收藏的节点组快照 + 分组),插件不存副本,避免两份真相。
// 视觉:复用宿主 .iwb-lib-* / .iwb-pcard / .iwb-chip / .iwb-gmgr-* 类名(style.css 已有)。
;(function (global) {
'use strict'
if (!global.IWBPluginHost) return
var PANEL_ID = 'grouplib-panel'
function el (tag, attrs) {
var node = document.createElement(tag)
if (attrs) {
for (var k in attrs) {
if (!Object.prototype.hasOwnProperty.call(attrs, k)) continue
var v = attrs[k]
if (v === null || v === undefined) continue
if (k === 'class') node.className = v
else if (k === 'text') node.textContent = v
else if (k === 'style') node.setAttribute('style', v)
else node.setAttribute(k, v)
}
}
for (var i = 2; i < arguments.length; i++) append(node, arguments[i])
return node
}
function append (node, v) {
if (v === null || v === undefined || v === false) return
if (Array.isArray(v)) { for (var i = 0; i < v.length; i++) append(node, v[i]); return }
node.appendChild(typeof v === 'string' ? document.createTextNode(v) : v)
}
function clear (node) { while (node.firstChild) node.removeChild(node.firstChild) }
function ask (text, opts) {
var C = global.IWBUIConfirm
if (C && typeof C.askOrNative === 'function') return C.askOrNative(text, opts)
return Promise.resolve(global.confirm(String(text)))
}
function mount (host, ctx) {
clear(host)
host.classList.add('iwb-plugin-node-body')
host.style.minHeight = '0'
var list = [] // [{id, name, group, ...snapshot}]
var ggroups = [] // [{id, name}]
var filter = 'all'
var manage = false
var picked = {} // id -> 1(管理模式多选)
var editing = '' // 正在改名的 id
var newOpen = false
var managerOpen = false
var api = ctx.grouplib || {}
function notify (text, type) { try { api.notify && api.notify(text, type || 'ok') } catch (e) { /* ignore */ } }
function groupsOf () {
if (ggroups && ggroups.length) return ggroups
var seen = []
for (var i = 0; i < list.length; i++) {
var g = String((list[i] && list[i].group) || '').trim()
if (g && !seen.some(function (x) { return x.name === g })) seen.push({ id: g, name: g })
}
return seen
}
function save (next, nextGroups) {
var groups = next || list
var gs = nextGroups || groupsOf()
list = groups
ggroups = gs
render()
return Promise.resolve(api.save({ groups: groups, groupGroups: gs })).then(function (r) {
if (r && r.ok === false) { notify(r.error || '节点组保存失败,请重试', 'err'); return r }
return r || { ok: true }
}).catch(function () { notify('节点组保存失败,请重试', 'err') })
}
var body = el('div', { class: 'iwb-lib-body' })
var fixed = el('div', { class: 'iwb-lib-fixed' })
var scrollBox = el('div', { class: 'iwb-lib-scroll' })
var wrap = el('div', { class: 'iwb-groups-embedded' }, body)
body.appendChild(fixed)
body.appendChild(scrollBox)
host.appendChild(wrap)
var loadError = '' // '' = 正常;否则是给用户看的原因(据此区分「真没收藏」和「能力没拿到」)
function load () {
if (typeof api.list !== 'function') {
loadError = '节点组能力未就绪(客户端需 ≥ 3.25.56)'
list = []; ggroups = []
render()
return Promise.resolve(false)
}
return Promise.resolve(api.list()).then(function (r) {
loadError = ''
list = (r && r.groups) || []
ggroups = (r && r.groupGroups) || []
render()
return true
}).catch(function (e) {
loadError = '读取失败:' + ((e && e.message) || e || '未知错误')
list = []; ggroups = []
render()
return false
})
}
function countOf (name) {
if (name === 'all') return list.length
if (name === '__none__') return list.filter(function (g) { return !String((g && g.group) || '').trim() }).length
return list.filter(function (g) { return (g && g.group) === name }).length
}
function visible () {
if (filter === '__none__') return list.filter(function (g) { return !String((g && g.group) || '').trim() })
if (filter !== 'all') return list.filter(function (g) { return (g && g.group) === filter })
return list.slice()
}
function assignGroup (ids, group) {
return save(list.map(function (x) { return ids.indexOf(x.id) >= 0 ? Object.assign({}, x, { group: group || '' }) : x }))
.then(function () { notify('已移动到' + (group || '未分组')) })
}
function openMenu (e, g) {
e.preventDefault(); e.stopPropagation()
closeMenu()
var menu = el('div', { class: 'iwb-ctxmenu iwb-lib-group-menu', style: 'left:' + e.clientX + 'px;top:' + e.clientY + 'px' })
menu.appendChild(el('div', { class: 'iwb-ctx-title', text: '移动到分组' }))
var mk = function (label, value) {
var b = el('button', { class: 'iwb-ctx-item', text: label })
b.addEventListener('click', function () { closeMenu(); assignGroup([g.id], value) })
menu.appendChild(b)
}
mk('未分组', '')
groupsOf().forEach(function (gr) { mk(gr.name, gr.name) })
document.body.appendChild(menu)
menu._iwbOwner = wrap
setTimeout(function () { document.addEventListener('pointerdown', onDocDown, true) }, 0)
}
var openMenuEl = null
function closeMenu () {
if (openMenuEl && openMenuEl.parentNode) openMenuEl.parentNode.removeChild(openMenuEl)
openMenuEl = null
document.removeEventListener('pointerdown', onDocDown, true)
var old = document.querySelector('.iwb-lib-group-menu')
if (old && old.parentNode) old.parentNode.removeChild(old)
}
function onDocDown (e) {
var m = document.querySelector('.iwb-lib-group-menu')
if (m && m.contains(e.target)) return
closeMenu()
}
// ---- 分组管理弹窗 ----
var modalHost = null
function openManager () {
closeManager()
managerOpen = true
var mask = el('div', { class: 'iwb-modal-mask' })
var modal = el('div', { class: 'iwb-modal iwb-modal-sm' })
var head = el('div', { class: 'iwb-modal-head' })
var title = el('span', { class: 'iwb-toolbar-title' })
var closeBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '关闭', text: '✕' })
closeBtn.addEventListener('click', closeManager)
head.appendChild(title); head.appendChild(closeBtn)
var bodyEl = el('div', { class: 'iwb-modal-body' })
modal.appendChild(head); modal.appendChild(bodyEl)
mask.appendChild(modal)
mask.addEventListener('wheel', function (e) { e.stopPropagation() })
mask.addEventListener('pointerdown', function (e) { if (e.target === mask) closeManager() })
document.body.appendChild(mask)
modalHost = mask
renderManager(title, bodyEl)
}
function closeManager () {
managerOpen = false
if (modalHost && modalHost.parentNode) modalHost.parentNode.removeChild(modalHost)
modalHost = null
render()
}
function renderManager (title, bodyEl) {
var gs = groupsOf()
title.textContent = '管理节点组分组(' + gs.length + ')'
clear(bodyEl)
if (!gs.length) bodyEl.appendChild(el('div', { class: 'iwb-hint', text: '暂无分组。可在下方新建。' }))
gs.forEach(function (g, i) {
var row = el('div', { class: 'iwb-gmgr-row' })
var nameEl = el('span', { class: 'iwb-gmgr-name', text: g.name })
row.appendChild(nameEl)
row.appendChild(el('span', { class: 'iwb-gmgr-count', text: countOf(g.name) + ' 组' }))
var rn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '重命名', text: '重命名' })
rn.addEventListener('click', function () {
var input = el('input', { class: 'iwb-input iwb-grow', value: g.name })
row.replaceChild(input, nameEl)
input.focus(); input.select()
var commit = function () {
var n = String(input.value || '').trim()
if (!n || n === g.name) { renderManager(title, bodyEl); return }
if (groupsOf().some(function (x) { return x.name === n })) { renderManager(title, bodyEl); return }
var ng = groupsOf().map(function (x) { return x.name === g.name ? { id: n, name: n } : x })
var nl = list.map(function (x) { return x.group === g.name ? Object.assign({}, x, { group: n }) : x })
if (filter === g.name) filter = n
save(nl, ng).then(function () { if (managerOpen) openManager() })
}
input.addEventListener('keydown', function (e) {
if (e.key === 'Enter') { e.preventDefault(); commit() }
if (e.key === 'Escape') renderManager(title, bodyEl)
})
input.addEventListener('blur', commit)
})
row.appendChild(rn)
var up = el('button', { class: 'iwb-btn iwb-btn-sm', title: '上移', text: '↑' })
up.disabled = i === 0
up.addEventListener('click', function () { swap(i, -1) })
row.appendChild(up)
var down = el('button', { class: 'iwb-btn iwb-btn-sm', title: '下移', text: '↓' })
down.disabled = i === gs.length - 1
down.addEventListener('click', function () { swap(i, 1) })
row.appendChild(down)
var del = el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-danger', title: '删除分组(组内节点组移至未分组)', text: '删除' })
del.addEventListener('click', function () {
ask('删除节点组分组「' + g.name + '」?组内节点组将移至「未分组」(不删除节点组)。', { title: '删除分组', okText: '删除' }).then(function (ok) {
if (!ok) return
var ng = groupsOf().filter(function (x) { return x.name !== g.name })
var nl = list.map(function (x) { return x.group === g.name ? Object.assign({}, x, { group: '' }) : x })
if (filter === g.name) filter = 'all'
save(nl, ng).then(function () { if (managerOpen) openManager() })
})
})
row.appendChild(del)
bodyEl.appendChild(row)
})
var addRow = el('div', { class: 'iwb-row' })
var input = el('input', { class: 'iwb-input iwb-grow', placeholder: '新分组名称' })
var addBtn = el('button', { class: 'iwb-btn', text: '+ 添加' })
var doAdd = function () {
var n = String(input.value || '').trim()
if (!n) return
if (groupsOf().some(function (x) { return x.name === n })) { input.value = ''; return }
input.value = ''
save(list, groupsOf().concat([{ id: n, name: n }])).then(function () { if (managerOpen) openManager() })
}
input.addEventListener('keydown', function (e) { if (e.key === 'Enter') doAdd() })
addBtn.addEventListener('click', doAdd)
addRow.appendChild(input); addRow.appendChild(addBtn)
bodyEl.appendChild(addRow)
}
function swap (i, dir) {
var gs = groupsOf().slice()
var ni = i + dir
if (ni < 0 || ni >= gs.length) return
var t = gs[i]; gs[i] = gs[ni]; gs[ni] = t
save(list, gs).then(function () { if (managerOpen) openManager() })
}
// ---- 渲染 ----
function render () {
clear(fixed); clear(scrollBox)
var gs = groupsOf()
var topRow = el('div', { class: 'iwb-row' })
var mgBtn = el('button', { class: 'iwb-btn iwb-btn-sm' + (manage ? ' iwb-btn-primary' : ''), text: manage ? '退出管理' : '管理' })
mgBtn.addEventListener('click', function () { manage = !manage; picked = {}; render() })
topRow.appendChild(mgBtn)
var refresh = el('button', { class: 'iwb-btn iwb-btn-sm', title: '重新向宿主拉取节点组', text: '↻' })
refresh.addEventListener('click', function () { load() })
topRow.appendChild(refresh)
if (manage && Object.keys(picked).length) {
var mv = el('select', { class: 'iwb-input' })
mv.appendChild(el('option', { value: '__move__', text: '移动到分组…' }))
mv.appendChild(el('option', { value: '', text: '未分组' }))
gs.forEach(function (g) { mv.appendChild(el('option', { value: g.name, text: g.name })) })
mv.addEventListener('change', function () {
if (mv.value === '__move__') return
var ids = Object.keys(picked)
picked = {}
assignGroup(ids, mv.value)
})
topRow.appendChild(mv)
}
fixed.appendChild(topRow)
// 分类胶囊:宿主 .iwb-lib-chips 是 nowrap(配 .iwb-lib-chips-scroll 才单行滚动),
// 分组多时右侧胶囊会被面板宽度裁掉看不见 ⇒ 这里改成「适应面板宽度自动换行」,
// 换行规则在插件自带 styles.css 的 .iwb-glp-chips 里(样式随插件发,不用等客户端发版)
var chips = el('div', { class: 'iwb-lib-chips iwb-glp-chips' })
function chip (label, value, count, extra) {
var b = el('button', { class: 'iwb-chip' + (filter === value ? ' iwb-chip-active' : '') + (extra || ''), title: value === '__none__' ? '未分组;拖拽节点组卡片到此 = 移出分组' : (value === 'all' ? '' : '拖拽节点组卡片到此 = 移动到该分组') })
b.appendChild(document.createTextNode(label))
b.appendChild(el('span', { class: 'iwb-chip-count', text: String(count) }))
b.addEventListener('click', function () { newOpen = false; filter = value; render() })
b.addEventListener('dragover', function (e) { e.preventDefault(); e.stopPropagation() })
b.addEventListener('drop', function (e) {
e.preventDefault(); e.stopPropagation()
var gid = e.dataTransfer && e.dataTransfer.getData('application/x-iwb-groupid')
if (!gid) return
assignGroup([gid], value === 'all' || value === '__none__' ? '' : value)
})
return b
}
chips.appendChild(chip('全部', 'all', list.length))
chips.appendChild(chip('未分组', '__none__', countOf('__none__'), ' iwb-chip-drop'))
gs.forEach(function (g) { chips.appendChild(chip(g.name, g.name, countOf(g.name), ' iwb-chip-drop')) })
var addChip = el('button', { class: 'iwb-chip iwb-glp-add iwb-chip-add', title: '新建分组', text: '+' })
addChip.addEventListener('click', function () { newOpen = !newOpen; render() })
chips.appendChild(addChip)
var mgChip = el('button', { class: 'iwb-chip iwb-glp-add iwb-chip-add', title: '管理分组(重命名 / 排序 / 删除)', text: '⚙' })
mgChip.addEventListener('click', openManager)
chips.appendChild(mgChip)
fixed.appendChild(chips)
if (newOpen) {
var row = el('div', { class: 'iwb-row' })
var inp = el('input', { class: 'iwb-input iwb-grow', placeholder: '新分组名称' })
var ok = el('button', { class: 'iwb-btn iwb-btn-primary', text: '确定' })
var no = el('button', { class: 'iwb-btn', text: '取消' })
ok.addEventListener('click', function () {
var n = String(inp.value || '').trim()
if (n && !groupsOf().some(function (x) { return x.name === n })) save(list, groupsOf().concat([{ id: n, name: n }]))
filter = n || filter
newOpen = false
render()
})
no.addEventListener('click', function () { newOpen = false; render() })
inp.addEventListener('keydown', function (e) { if (e.key === 'Enter') ok.click() })
row.appendChild(inp); row.appendChild(ok); row.appendChild(no)
fixed.appendChild(row)
setTimeout(function () { try { inp.focus() } catch (e) { /* ignore */ } }, 0)
}
// 卡片
var cards = el('div', { class: 'iwb-lib-cards' })
var items = visible()
items.forEach(function (g) {
var isEditing = editing === g.id
var card = el('div', {
class: 'iwb-glp-card iwb-pcard' + (isEditing ? ' iwb-pcard-editing' : '') + (manage && picked[g.id] ? ' iwb-pcard-selected' : ''),
'data-manage': manage ? '1' : '0',
draggable: isEditing ? 'false' : 'true',
title: manage ? '单击选中 · 右上「移动到分组」' : '双击改名 · 拖到画布实例化 · 右键移动到分组',
})
card.addEventListener('dragstart', function (e) {
if (isEditing) return
try { card.classList.add('iwb-glp-dragging') } catch (err) { /* ignore */ }
try {
e.stopPropagation()
e.dataTransfer.setData('application/x-iwb-group', JSON.stringify(g.id))
e.dataTransfer.setData('application/x-iwb-groupid', g.id)
e.dataTransfer.effectAllowed = 'copy'
} catch (err) { /* ignore */ }
})
card.addEventListener('dragend', function () {
try { card.classList.remove('iwb-glp-dragging') } catch (err) { /* ignore */ }
})
card.addEventListener('contextmenu', function (e) {
if (manage) { e.preventDefault(); picked[g.id] = picked[g.id] ? 0 : 1; render(); return }
openMenu(e, g)
})
card.addEventListener('dblclick', function (e) {
e.stopPropagation()
if (manage) return
editing = g.id
render()
})
var rowEl = el('div', { class: 'iwb-row' })
if (isEditing) {
var input = el('input', { class: 'iwb-input iwb-grow iwb-pname-input', value: g.name || '', placeholder: '组名' })
var cancel = false
var commit = function () {
if (cancel) return
editing = ''
var n = String(input.value || '').trim() || g.name
if (n !== g.name) save(list.map(function (x) { return x.id === g.id ? Object.assign({}, x, { name: n }) : x }))
else render()
}
input.addEventListener('keydown', function (e) {
if (e.key === 'Enter') { e.stopPropagation(); commit() }
if (e.key === 'Escape') { e.stopPropagation(); cancel = true; editing = ''; render() }
})
input.addEventListener('blur', commit)
rowEl.appendChild(input)
setTimeout(function () { try { input.focus(); input.select() } catch (e) { /* ignore */ } }, 0)
} else {
var nameEl = el('span', { class: 'iwb-pname', title: '双击改名', text: g.name || '分组' })
rowEl.appendChild(nameEl)
var btns = el('span', { class: 'iwb-pbtns' })
var del = el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-danger', title: '删除节点组', text: '✕' })
del.addEventListener('click', function (e) {
e.stopPropagation()
ask('删除节点组「' + (g.name || '') + '」?', { title: '删除节点组', okText: '删除' }).then(function (ok) {
if (!ok) return
list = list.filter(function (x) { return x.id !== g.id })
render()
Promise.resolve(api.remove(g.id)).catch(function () {})
})
})
btns.appendChild(del)
rowEl.appendChild(btns)
}
card.appendChild(rowEl)
if (manage) {
card.addEventListener('click', function () {
picked[g.id] = picked[g.id] ? 0 : 1
if (!picked[g.id]) delete picked[g.id]
render()
})
} else {
card.addEventListener('click', function (e) { e.stopPropagation() })
}
cards.appendChild(card)
})
scrollBox.appendChild(cards)
if (!items.length) {
var hint = loadError
? loadError
: (list.length
? '当前分组下没有节点组(共 ' + list.length + ' 个,切到「全部」查看)'
: '宿主返回 0 个收藏节点组。画布编组后点组右上角「收藏」,或用右键菜单「收藏选中节点」。')
scrollBox.appendChild(el('div', { class: 'iwb-hint iwb-glp-empty', text: hint }))
}
}
// 宿主侧变化(画布收藏节点组 / 其它标签页同步)→ 重拉
var off = null
try { off = api.onChanged && api.onChanged(function () { load() }) } catch (e) { /* ignore */ }
load()
return function dispose () {
try { if (typeof off === 'function') off() } catch (e) { /* ignore */ }
closeMenu()
if (modalHost && modalHost.parentNode) modalHost.parentNode.removeChild(modalHost)
modalHost = null
}
}
global.IWBPluginHost.register({
id: 'grouplib',
name: '节点组',
version: '1.0.4',
apiVersion: 1,
capabilities: ['panels', 'grouplib'],
data: { schemaVersion: 1, maxBytes: 65536 },
}, function (ctx) {
ctx.ui.registerPanel({
id: PANEL_ID,
title: '节点组',
icon: 'group',
// 宿主只调用 mount(node)(一个参数):必须在这里把工厂 ctx 注入,否则面板里 ctx 是 undefined ⇒ 首渲染抛异常 ⇒ 整块空白
mount: function (host) { return mount(host, ctx) },
})
})
})(typeof window !== 'undefined' ? window : globalThis)
+19
View File
@@ -0,0 +1,19 @@
{
"id": "grouplib",
"name": "节点组",
"version": "1.0.4",
"apiVersion": 1,
"main": "main.js",
"style": "styles.css",
"description": "左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供)",
"author": "official",
"icon": "📦",
"tags": [
"资源",
"节点组"
],
"files": {
"main.js": "8cb2e39f9880d49c9b9c15a1f7d62d9772170c8d0eac0faaa237bb7056af34ff",
"styles.css": "ee6e292ffebdcc1351651bf7937399128ae06e0b364624792f34111866f9355b"
}
}
+42
View File
@@ -0,0 +1,42 @@
/* grouplib(节点组)自带样式
作用域全部带 .iwb-glp-*,不影响宿主与其他插件;样式随插件发布,不必等客户端发版。 */
/* 分类胶囊「适应面板宽度」自动换行。
宿主的 .iwb-lib-chips 是 flex-wrap: nowrap(配合 .iwb-lib-chips-scroll 才做单行横向滚动),
分组多时右侧胶囊会被面板宽度裁掉、看不见也用不了。
这里用双类选择器提高优先级(不依赖样式注入顺序),让它按宽度折行。 */
.iwb-lib-chips.iwb-glp-chips {
flex-wrap: wrap;
row-gap: 6px;
}
/* + / ⚙ 是动作按钮,不是分组名:不参与压缩,并与最后一个分组稍作分隔 */
.iwb-glp-chips .iwb-glp-add {
flex: 0 0 auto;
margin-left: 2px;
}
/* v1.0.4(2026-11-21):卡片交互态 + 空态 + 拖拽反馈。
颜色只走宿主 token(--iwb-plugin-* / --iwb-*),不写死。 */
.iwb-glp-card { transition: background .12s ease, border-color .12s ease; }
.iwb-glp-card .iwb-pname { font-weight: 600; }
/* 删除按钮:平时隐藏,悬停/键盘聚焦才出现,减少视觉噪音 */
.iwb-glp-card .iwb-pbtns { opacity: 0; transition: opacity .12s ease; }
.iwb-glp-card:hover .iwb-pbtns,
.iwb-glp-card:focus-within .iwb-pbtns { opacity: 1; }
/* 管理模式的选中标记:右上角圆点 */
.iwb-glp-card[data-manage="1"]::after {
content: ''; position: absolute; right: 8px; top: 8px; width: 12px; height: 12px;
border-radius: 50%; border: 1.5px solid var(--iwb-border2, #b9bfca); background: transparent;
}
.iwb-glp-card[data-manage="1"].iwb-pcard-selected::after {
background: var(--iwb-brand, #6b7280); border-color: var(--iwb-brand, #6b7280);
}
/* 拖拽中:半透明 + 轻微缩放,明确"正在搬运" */
.iwb-glp-dragging { opacity: .55; }
/* 空态:虚线框 */
.iwb-glp-empty {
margin: 4px 0; padding: 14px 12px; border-radius: 10px; text-align: center;
border: 1px dashed var(--iwb-border2, #b9bfca); color: var(--iwb-text2, #4d5668);
font-size: 12px; line-height: 1.7;
}
+45 -6
View File
@@ -11,6 +11,45 @@
"version": "1.0.0",
"integrity": "sha256-Z3Y4k/qZyP4di89kBCb1u8V2q9NbzchMkQt7CPeZZPk="
},
{
"id": "browser",
"file": "plugin-browser.8161a82890d9.js",
"version": "1.7.0",
"integrity": "sha256-gWGoKJDZZyTZCirpyJSdN6+S+UuUTNUlrcB7ZbXqtPQ="
},
{
"id": "gallery",
"dir": "gallery",
"main": "main.js",
"style": "styles.css",
"version": "1.6.9",
"files": {
"main.js": "26c7e64b3a0021c6b9514dfb84d4d2580276698222b4791cfa99f22ead66ff52",
"styles.css": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0"
}
},
{
"id": "grouplib",
"dir": "grouplib",
"main": "main.js",
"style": "styles.css",
"version": "1.0.4",
"files": {
"main.js": "8cb2e39f9880d49c9b9c15a1f7d62d9772170c8d0eac0faaa237bb7056af34ff",
"styles.css": "ee6e292ffebdcc1351651bf7937399128ae06e0b364624792f34111866f9355b"
}
},
{
"id": "promptlib",
"dir": "promptlib",
"main": "main.js",
"style": "styles.css",
"version": "1.6.6",
"files": {
"main.js": "530b4bc021e0730f14505f666203c8c9c165bf9ea6bef9765ec7e9ebcda95c54",
"styles.css": "872ceeded7eb67599dfa159c86be1b1e1724f7cd1e04cae1d79d939bb0e1ebdf"
}
},
{
"id": "image-annotate",
"file": "plugin-image-annotate.7a865c7c353c.js",
@@ -19,15 +58,15 @@
},
{
"id": "image-vectorize",
"file": "plugin-image-vectorize.03b5fc850c34.js",
"version": "0.4.2",
"integrity": "sha256-A7X8hQw03cCZa6/DZ3mPtgrsybsjuSmQ3VzMWe10v8k="
"file": "plugin-image-vectorize.7014982f60e6.js",
"version": "0.6.0",
"integrity": "sha256-cBSYL2DmBeNJCZhqwMNyGV5hMBKeKakn1tQaFAVXnp8="
},
{
"id": "style-source",
"file": "plugin-style-source.ee7168565a44.js",
"version": "1.3.2",
"integrity": "sha256-7nFoVlpE1J2q8wD2LVx6EG5g+6KankiI/4v9mr0uMXg="
"file": "plugin-style-source.05c108f8a63c.js",
"version": "1.3.3",
"integrity": "sha256-BcEI+KY8wcXrscHRi0reEOlxoO50+xNUgtt1l+ZzH4Q="
},
{
"id": "white-bg-800",
+42
View File
@@ -75,5 +75,47 @@
"抠图",
"去背景"
]
},
"browser": {
"name": "应用内浏览器",
"desc": "库面板内置真实浏览器:书签按分组管理、拖动排序;地址栏 ↗ 可把当前页放到画布节点",
"author": "official",
"icon": "🌐",
"color": "#eaf1fb",
"tags": [
"浏览器",
"效率"
]
},
"gallery": {
"name": "图库",
"desc": "右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)",
"author": "official",
"icon": "🖼️",
"color": "#eef2f6",
"tags": [
"资源",
"图库"
]
},
"grouplib": {
"name": "节点组",
"desc": "左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供)",
"author": "official",
"icon": "📦",
"tags": [
"资源",
"节点组"
]
},
"promptlib": {
"name": "提示词库",
"desc": "右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)",
"author": "official",
"icon": "📖",
"tags": [
"资源",
"提示词"
]
}
}
File diff suppressed because it is too large. Load diff
+19
View File
@@ -0,0 +1,19 @@
{
"id": "promptlib",
"name": "提示词库",
"version": "1.6.6",
"apiVersion": 1,
"main": "main.js",
"style": "styles.css",
"description": "右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)",
"author": "official",
"icon": "📖",
"tags": [
"资源",
"提示词"
],
"files": {
"main.js": "530b4bc021e0730f14505f666203c8c9c165bf9ea6bef9765ec7e9ebcda95c54",
"styles.css": "872ceeded7eb67599dfa159c86be1b1e1724f7cd1e04cae1d79d939bb0e1ebdf"
}
}
+353
View File
@@ -0,0 +1,353 @@
/* promptlib(提示词库)自带样式
作用域全部带 .iwb-plp-*,不影响宿主与其他插件;样式随插件发布,不必等客户端发版。 */
/* 分组胶囊「适应面板宽度」自动换行。
宿主的 .iwb-lib-chips 是 flex-wrap: nowrap(配 .iwb-lib-chips-scroll 做单行横向滚动 + 右侧渐隐),
分组多时靠后的分类看不见也点不到。双类选择器提高优先级(不依赖样式注入顺序)。 */
.iwb-lib-chips.iwb-plp-chips {
flex-wrap: wrap;
row-gap: 6px;
}
/* + / ⚙ 是动作按钮,不是分组名:不参与压缩,并与最后一个分组稍作分隔 */
.iwb-plp-chips .iwb-plp-add {
flex: 0 0 auto;
margin-left: 2px;
}
/* v1.0.2(2026-11-21):卡片化 —— 白卡 + 悬停 + 文本三行截断。
颜色一律走宿主 --iwb-plugin-* / --iwb-* token,不在插件里写死。 */
.iwb-promptlib .iwb-pname { font-weight: 600; }
.iwb-promptlib .iwb-ptext {
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
overflow: hidden; color: var(--iwb-text2, #4d5668);
}
.iwb-promptlib .iwb-lib-cards { gap: 8px; }
/* v1.1.0(2026-11-21):封面网格 + 长文详情 + 宽编辑弹窗。
颜色全部走宿主 token,不写死。 */
.iwb-plp-card {
position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
aspect-ratio: 1 / 1; border: 1px solid var(--iwb-border, #d5d9e0);
transition: border-color .12s ease, transform .12s ease;
}
.iwb-plp-card:hover { border-color: var(--iwb-border2, #b9bfca); }
.iwb-plp-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.iwb-plp-t {
position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 7px 6px;
background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.66));
color: #fff; font-size: 10.5px; line-height: 1.35; max-height: 48%;
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
/* 详情:长文阅读 */
.iwb-plp-dhead { display: flex; align-items: center; gap: 6px; padding: 2px 0 8px; position: sticky; top: 0; z-index: 2; background: var(--iwb-plugin-surface, #fafafb); }
.iwb-plp-dtop { align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.iwb-plp-dthumb { flex: 0 0 84px; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--iwb-border, #d5d9e0); }
.iwb-plp-dmeta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.iwb-plp-dtitle { font-size: 13px; font-weight: 600; color: var(--iwb-text, #1c2333); line-height: 1.45; }
.iwb-plp-dtext {
font-size: 12px; line-height: 1.75; color: var(--iwb-text2, #4d5668);
white-space: pre-wrap; word-break: break-word; padding: 4px 0 12px;
}
.iwb-plp-dfoot { display: flex; align-items: center; gap: 6px; padding: 8px 0 2px; position: sticky; bottom: 0; background: var(--iwb-plugin-surface, #fafafb); }
/* 编辑弹窗:760 宽 + 大文本框 */
.iwb-promptlib-editor { width: 760px; max-width: 94vw; }
.iwb-promptlib-editor .iwb-modal-body { max-height: 78vh; }
.iwb-promptlib-text { min-height: 360px; height: 44vh; font-size: 12.5px; line-height: 1.9; resize: vertical; }
.iwb-plp-editor-cover { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.iwb-plp-editor-thumb { flex: 0 0 96px; width: 96px; height: 128px; border-radius: 8px; overflow: hidden; border: 1px solid var(--iwb-border, #d5d9e0); }
.iwb-plp-editor-coverops { display: flex; flex-direction: column; gap: 8px; }
/* v1.2.0:可拖动 / 可缩放的详情与编辑弹窗(同宽 880×640,最小 640×420) */
.iwb-plp-mask { background: transparent; display: block; }
.iwb-plp-dialog { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px;
box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.iwb-plp-dhead { display: flex; align-items: center; gap: 6px; padding: 10px 14px;
border-bottom: 1px solid var(--iwb-border, #d5d9e0); cursor: move; user-select: none; }
.iwb-plp-grip { display: grid; grid-template-columns: repeat(3, 3px); gap: 2px; margin-right: 6px; }
.iwb-plp-grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--iwb-border2, #b9bfca); display: block; }
.iwb-plp-dbody { flex: 1 1 auto; min-height: 0; display: flex; gap: 14px; padding: 14px; }
.iwb-plp-dcov { flex: 0 0 210px; width: 210px; height: 280px; border-radius: 10px; overflow: hidden;
border: 1px solid var(--iwb-border, #d5d9e0); background: var(--iwb-plugin-inset, #f5f6f7); }
.iwb-plp-dright { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.iwb-plp-dtext { flex: 1 1 auto; min-height: 0; overflow: auto; white-space: pre-wrap; word-break: break-word;
font-size: 12px; line-height: 1.9; color: var(--iwb-text2, #4d5668); }
.iwb-plp-dfooter { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
border-top: 1px solid var(--iwb-border, #d5d9e0); }
.iwb-plp-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
background: linear-gradient(135deg, transparent 0 45%, var(--iwb-border2, #b9bfca) 45% 50%, transparent 50% 62%, var(--iwb-border2, #b9bfca) 62% 67%, transparent 67%); }
/* 编辑:左栏固定 240,右栏大文本框 */
.iwb-plp-eleft { flex: 0 0 240px; width: 240px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.iwb-plp-ecov { width: 240px; height: 300px; border-radius: 10px; overflow: hidden;
border: 1px solid var(--iwb-border, #d5d9e0); background: var(--iwb-plugin-inset, #f5f6f7); }
.iwb-plp-lrow { display: flex; flex-direction: column; gap: 4px; font-size: 10px; color: var(--iwb-text2, #4d5668); }
.iwb-plp-etext { flex: 1 1 auto; min-height: 0; height: auto; resize: none; font-size: 12px; line-height: 1.9; }
/* 输入框边框柔化(用户反馈现在的边框太深) */
.iwb-plp-dialog .iwb-input { border-color: color-mix(in srgb, var(--iwb-border, #d5d9e0) 72%, transparent); }
.iwb-plp-dialog .iwb-input:focus { border-color: var(--iwb-brand, #6b7280); box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand, #6b7280) 14%, transparent); }
/* v1.2.1:去掉弹窗里多余的线框(用户反馈“线框太多、太明显”) */
.iwb-plp-dialog .iwb-plp-dcov,
.iwb-plp-dialog .iwb-plp-ecov { border-color: transparent; }
.iwb-plp-dialog .iwb-plp-dhead { border-bottom-color: color-mix(in srgb, var(--iwb-border, #d5d9e0) 45%, transparent); }
.iwb-plp-dialog .iwb-plp-dfooter { border-top-color: color-mix(in srgb, var(--iwb-border, #d5d9e0) 45%, transparent); }
/* 输入框:默认无边框,用浅底区分;聚焦才出现细描边 */
.iwb-plp-dialog .iwb-input {
border-color: transparent;
background: var(--iwb-plugin-inset, #f5f6f7);
box-shadow: none;
}
.iwb-plp-dialog .iwb-input:hover { background: var(--iwb-plugin-hover, #eef1f4); }
.iwb-plp-dialog .iwb-input:focus {
background: var(--iwb-panel, #fff);
border-color: color-mix(in srgb, var(--iwb-brand, #6b7280) 55%, transparent);
box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand, #6b7280) 12%, transparent);
}
/* 正文编辑区:无边框、无底色,像一张纸 */
.iwb-plp-dialog .iwb-plp-etext { border-color: transparent; background: transparent; box-shadow: none; }
.iwb-plp-dialog .iwb-plp-etext:focus { border-color: transparent; box-shadow: none; background: transparent; }
/* 左侧封面区的两个按钮:去掉按钮描边,弱化成文字按钮 */
.iwb-plp-dialog .iwb-plp-eleft .iwb-btn { border-color: transparent; background: var(--iwb-plugin-inset, #f5f6f7); }
.iwb-plp-dialog .iwb-plp-eleft .iwb-btn:hover { background: var(--iwb-plugin-hover, #eef1f4); }
/* v1.3.3:封面比例不定 —— 详情/编辑里完整显示(contain,不裁切);列表保持方形裁切(网格整齐) */
.iwb-plp-dialog .iwb-plp-dcov img,
.iwb-plp-dialog .iwb-plp-ecov img { object-fit: contain; background: var(--iwb-plugin-inset, #f5f6f7); }
.iwb-plp-dialog .iwb-plp-dcov,
.iwb-plp-dialog .iwb-plp-ecov { background: var(--iwb-plugin-inset, #f5f6f7); }
.iwb-plp-card .iwb-plp-cover { object-fit: cover; object-position: center; }
/* v1.3.4:瀑布流(列式)+ 卡片定宽不随面板拉伸;面板底色统一走 --iwb-plugin-surface */
.iwb-promptlib .iwb-plp-card {
display: inline-block; width: 100%; margin: 0 0 8px;
break-inside: avoid; -webkit-column-break-inside: avoid;
aspect-ratio: auto; /* 高度交给图片原始比例 */
}
.iwb-promptlib .iwb-plp-cover { width: 100%; height: auto; object-fit: contain; }
/* 统一插件灰:面板底(宿主会给 --iwb-plugin-surface,这里只留兜底) */
.iwb-promptlib { background: transparent; }
/* v1.3.5:无封面的提示词也给一个方形占位(否则瀑布流里会塌成一条线) */
.iwb-promptlib .iwb-plp-card.no-cover { aspect-ratio: 1 / 1; }
.iwb-promptlib .iwb-plp-card.no-cover .iwb-plp-t { max-height: 60%; }
/* v1.4.7:恢复瀑布流列规则(1.4.0 清理 CSS 时把这组规则一起删掉了,列表退化成单列、卡片被拉满宽) */
.iwb-promptlib .iwb-lib-cards { display: block; column-width: 122px; column-gap: 8px; grid-template-columns: none; }
.iwb-promptlib .iwb-plp-card { display: inline-block; width: 100%; margin: 0 0 8px; break-inside: avoid; -webkit-column-break-inside: avoid; aspect-ratio: auto; }
.iwb-promptlib .iwb-plp-cover { width: 100%; height: auto; object-fit: contain; }
.iwb-promptlib .iwb-plp-card.no-cover { aspect-ratio: 1 / 1; }
/* v1.5.0:模板节点 + 变量标记 */
.iwb-plp-vdot{position:absolute;right:8px;top:8px;width:7px;height:7px;border-radius:50%;background:var(--iwb-plp-accent, #7c4dff);box-shadow:0 0 0 2px var(--iwb-plp-dot-ring, rgba(255,255,255,.75))}
.iwb-plp-node{display:flex;flex-direction:column;gap:6px;padding:8px 10px;font-size:12px;color:var(--iwb-text,#1c2333)}
.iwb-plp-nhead{display:flex;align-items:center;gap:8px}
.iwb-plp-nthumb{width:44px;height:44px;border-radius:8px;object-fit:cover;flex:0 0 auto}
.iwb-plp-ntitle{font-weight:600;font-size:12.5px;line-height:1.3;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.iwb-plp-nvars{display:flex;flex-direction:column;gap:4px}
.iwb-plp-nrow{display:flex;align-items:center;gap:6px;height:26px}
.iwb-plp-nk{width:64px;flex:0 0 64px;color:var(--iwb-text2,#5b6472);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iwb-plp-nin{flex:1;height:24px;font-size:11.5px}
.iwb-plp-nref{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--iwb-text2,#5b6472);border-top:1px dashed var(--iwb-border,#e3e5e9);padding-top:6px}
.iwb-plp-nref em{font-style:normal;color:var(--iwb-text2,#8b929c)}
.iwb-plp-nprev{margin-top:2px;border-top:1px dashed var(--iwb-border,#e3e5e9);padding-top:6px;color:var(--iwb-text2,#5b6472);font-size:11.5px;line-height:1.6;max-height:88px;overflow:hidden}
/* v1.5.0:变量编辑器 / 详情变量 */
.iwb-plp-emid{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.iwb-plp-vars{border:1px solid var(--iwb-border,#e3e5e9);border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;gap:6px;background:var(--iwb-plugin-surface,#fff)}
.iwb-plp-vhead{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--iwb-text2,#5b6472)}
.iwb-plp-vhint{color:var(--iwb-text2,#8b929c);font-size:11px}
.iwb-plp-vchips{display:flex;flex-wrap:wrap;gap:6px}
.iwb-plp-vchip{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;border-radius:6px;background:color-mix(in srgb, var(--iwb-plp-accent, #7c4dff) 10%, transparent);color:var(--iwb-plp-accent, #5a4bd0);font-size:11.5px}
.iwb-plp-vx{font-style:normal;cursor:pointer;color:var(--iwb-plp-accent, #8b7ff0);font-weight:700}
.iwb-plp-vrows{display:flex;flex-direction:column;gap:5px}
.iwb-plp-vrow{display:flex;align-items:center;gap:8px}
.iwb-plp-vk{width:92px;flex:0 0 92px;font-size:11.5px;color:var(--iwb-text2,#5b6472);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iwb-plp-vin{flex:1;height:26px;font-size:11.5px}
.iwb-plp-vprev{margin-top:2px;border-top:1px dashed var(--iwb-border,#e3e5e9);padding-top:6px;font-size:11.5px;line-height:1.6;color:var(--iwb-text2,#5b6472);max-height:72px;overflow:auto;white-space:pre-wrap}
.iwb-plp-dvars{display:flex;flex-direction:column;gap:5px;border:1px solid var(--iwb-border,#e3e5e9);border-radius:10px;padding:8px 10px}
/* v1.5.6:模板节点参照风格节点 —— 封面 + 名称 + 变量,正文不再铺开 */
.iwb-plp-nthumb{width:56px;height:56px;border-radius:8px;object-fit:cover;flex:0 0 auto}
.iwb-plp-ntitlebox{min-width:0;display:flex;flex-direction:column;gap:2px}
.iwb-plp-ntitle{font-weight:600;font-size:12.5px;line-height:1.3;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.iwb-plp-nmeta{font-size:10.5px;color:var(--iwb-text2,#8b929c)}
.iwb-plp-nempty{font-size:11px;color:var(--iwb-text2,#8b929c);padding:2px 0}
.iwb-plp-nwarn{font-size:11px;line-height:1.5;color:var(--iwb-warn,#d97706)}
/* v1.5.10:设置页 */
.iwb-plp-settings{display:flex;flex-direction:column;gap:18px}
.iwb-plp-ssec{border:1px solid var(--iwb-border,#e3e5e9);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:8px}
.iwb-plp-stitle{font-weight:600;font-size:12.5px}
.iwb-plp-sgroups{display:flex;flex-direction:column;border:1px solid var(--iwb-border,#eef0f2);border-radius:10px;overflow:hidden}
.iwb-plp-sgrow{display:flex;align-items:center;gap:8px;padding:7px 10px;border-top:1px solid var(--iwb-border,#f1f3f5)}
.iwb-plp-sgrow:first-child{border-top:0}
.iwb-plp-sgrip{width:12px;height:12px;background:radial-gradient(var(--iwb-text2,#c2c7cf) 1px,transparent 1px);background-size:4px 4px;border-radius:3px;flex:0 0 auto}
.iwb-plp-sgname{width:170px;height:26px;font-size:12px}
.iwb-plp-sgcount{font-size:11.5px;color:var(--iwb-text2,#8b929c);width:56px}
.iwb-plp-sadd{display:flex;gap:8px;align-items:center}
.iwb-plp-sbtns{display:flex;gap:8px;align-items:center}
.iwb-plp-sopt{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--iwb-text2,#4d5668)}
.iwb-plp-settings{max-height:calc(100vh - 230px);overflow:auto;padding-right:4px}
/* v1.6.2:正文上方工具行 */
.iwb-plp-etool{display:flex;align-items:center;gap:8px}
.iwb-plp-insvar{border:1px solid var(--iwb-plp-accent,#d9d3ff);background:color-mix(in srgb,var(--iwb-plp-accent,#7c4dff) 8%,transparent);color:var(--iwb-plp-accent,#5a4bd0);font-weight:600}
/* v1.6.5:宿主基础样式的插件作用域副本 —— 宿主改全局样式不再影响插件 */
.iwb-promptlib .iwb-grow {
flex: 1;
}
.iwb-promptlib .iwb-row {
display: flex; gap: 6px; align-items: center;
}
.iwb-promptlib .iwb-hint {
font-size: 10px; color: var(--iwb-text2); margin-top: 4px;
}
.iwb-promptlib .iwb-toolbar-title {
font-weight: 700; font-size: 13px; margin-right: 2px;
}
.iwb-plp-mask {
position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 300; display: flex; align-items: center; justify-content: center;
}
.iwb-plp-dialog {
width: 680px; max-width: calc(100vw - 60px); max-height: 82vh; background: var(--iwb-panel); border: 1px solid var(--iwb-border2); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden;
}
.iwb-plp-dialog-head {
display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--iwb-border);
}
.iwb-plp-dialog-body {
padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 10px; max-height: 62vh;
}
.iwb-promptlib .iwb-lib-body {
flex: 1; overflow: hidden; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
}
.iwb-promptlib .iwb-lib-fixed {
flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px;
}
.iwb-promptlib .iwb-lib-scroll {
flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px;
}
.iwb-promptlib .iwb-lib-chips-scroll::-webkit-scrollbar {
display: none;
}
.iwb-promptlib .iwb-lib-chips-scroll > .iwb-chip:last-child {
margin-right: 18px;
}
.iwb-promptlib .iwb-lib-searchscope-back {
display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; padding: 0; border: none; border-radius: 999px; background: transparent; color: var(--iwb-text2); font-size: 13px; line-height: 1; cursor: pointer;
}
.iwb-promptlib .iwb-lib-searchscope-back:hover {
background: color-mix(in srgb, var(--iwb-text) 12%, transparent); color: var(--iwb-text);
}
.iwb-promptlib .iwb-chip {
flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--iwb-text2); cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.iwb-promptlib .iwb-chip:hover {
color: var(--iwb-text); border-color: var(--iwb-border2);
}
.iwb-promptlib .iwb-chip-active {
background: var(--iwb-panel); border-color: var(--iwb-border2); color: var(--iwb-text); font-weight: 600;
}
.iwb-promptlib .iwb-chip-active:hover {
color: var(--iwb-text);
}
.iwb-promptlib .iwb-chip-count {
font-size: 10px; opacity: 0.8;
}
.iwb-promptlib .iwb-chip-add {
font-weight: 700;
}
.iwb-promptlib .iwb-pcard .iwb-btn:hover {
opacity: 1; color: var(--iwb-text); background: transparent;
}
.iwb-promptlib .iwb-pcard .iwb-btn-starred {
color: var(--iwb-text); opacity: 1;
}
.iwb-promptlib .iwb-pcard {
border: 1px solid var(--iwb-border); border-radius: 8px; padding: 8px 10px; background: var(--iwb-panel);
}
.iwb-promptlib .iwb-tag {
display: inline-block; background: color-mix(in srgb, var(--iwb-text) 7%, transparent); color: var(--iwb-text2); border-radius: 4px; font-size: 10px; padding: 1px 6px; margin: 3px 4px 0 0;
}
.iwb-plp-dialog-sm {
width: 460px;
}
.iwb-promptlib .iwb-pcard {
cursor: grab;
}
.iwb-promptlib .iwb-pcard:active {
cursor: grabbing;
}
.iwb-promptlib .iwb-btn-primary .iwb-ic {
width: 15px; height: 15px;
}
.iwb-promptlib .iwb-btn:hover {
border-color: var(--iwb-brand); color: var(--iwb-brand);
}
.iwb-promptlib .iwb-btn:active {
transform: translateY(1px);
}
.iwb-promptlib .iwb-btn:focus-visible {
outline: 2px solid color-mix(in srgb, var(--iwb-brand) 60%, transparent); outline-offset: 1px;
}
.iwb-promptlib .iwb-btn:disabled {
opacity: 0.45; cursor: not-allowed; transform: none;
}
.iwb-promptlib .iwb-btn-primary {
background: var(--iwb-brand); border-color: var(--iwb-brand); color: var(--iwb-on-brand);
}
.iwb-promptlib .iwb-btn-primary:hover {
background: color-mix(in srgb, var(--iwb-brand) 85%, var(--iwb-text)); border-color: var(--iwb-brand); color: var(--iwb-on-brand);
}
.iwb-promptlib .iwb-btn-sm {
padding: 3px 7px; font-size: 11px;
}
.iwb-promptlib .iwb-btn-danger {
color: var(--iwb-err);
}
.iwb-promptlib .iwb-btn-danger:hover {
border-color: var(--iwb-err); color: var(--iwb-err);
}
.iwb-promptlib .iwb-ctxmenu {
position: fixed; min-width: 196px; max-width: 240px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 6px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.16); z-index: 91; display: flex; flex-direction: column; gap: 2px;
}
.iwb-promptlib .iwb-ctx-title {
font-size: 10px; font-weight: 700; color: var(--iwb-text2); letter-spacing: 1px; padding: 6px 10px 2px; text-transform: uppercase;
}
.iwb-promptlib .iwb-ctx-item {
display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: none; border-radius: 8px; background: transparent; color: var(--iwb-text); font-size: 12.5px; cursor: pointer; text-align: left;
}
.iwb-promptlib .iwb-ctx-item .iwb-ic {
width: 14px; height: 14px; flex: 0 0 auto; color: var(--iwb-text2);
}
.iwb-promptlib .iwb-ctx-item:hover:not(:disabled) {
background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); color: var(--iwb-text);
}
.iwb-promptlib .iwb-ctx-item:hover:not(:disabled) .iwb-ic {
color: var(--iwb-brand);
}
.iwb-promptlib .iwb-ctx-item:disabled {
opacity: 0.38; cursor: default;
}
.iwb-promptlib .iwb-ctx-item.iwb-ctx-danger {
color: var(--iwb-err);
}
.iwb-promptlib .iwb-ctx-item.iwb-ctx-danger .iwb-ic {
color: var(--iwb-err);
}
.iwb-promptlib .iwb-ctx-item.iwb-ctx-danger:hover:not(:disabled) {
background: color-mix(in srgb, var(--iwb-err) 10%, transparent); color: var(--iwb-err);
}
.iwb-promptlib .iwb-ctx-sep {
height: 1px; margin: 4px 6px; background: var(--iwb-border); flex: 0 0 auto;
}
.iwb-promptlib .iwb-drawer-spacer {
flex: 1 1 auto;
}
.iwb-plp-dialog .iwb-section-sub {
margin-top: 2px;
}
.iwb-plp-mask.iwb-mask-ghost .iwb-settings-modal {
box-shadow: 0 24px 60px rgba(0,0,0,.32);
}
File diff suppressed because it is too large. Load diff
@@ -9,7 +9,7 @@
var __IWB_VECTORIZE_MANIFEST__ = {
id: 'image-vectorize',
name: '位图转矢量',
version: '0.4.2',
version: '0.6.0',
apiVersion: 1,
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
settings: {
@@ -2023,15 +2023,15 @@ var __IWB_VECTORIZE_MANIFEST__ = {
.vz-modal {
display: flex;
flex-direction: column;
width: 92vw;
height: 88vh;
min-width: 760px;
min-height: 520px;
max-width: 1680px;
width: 100vw;
height: 100vh;
min-width: 0;
min-height: 0;
max-width: none;
background: #1b1b22;
border: 1px solid #33333f;
border-radius: 12px;
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
border: 0;
border-radius: 0;
box-shadow: none;
overflow: hidden;
}
@@ -2082,8 +2082,16 @@ var __IWB_VECTORIZE_MANIFEST__ = {
.vz-btn:hover { background: #34343f; border-color: #4a4a5c; }
.vz-btn:active { background: #2f2f3a; }
.vz-btn:disabled { opacity: 0.45; cursor: default; }
/* 顶栏四颗按钮统一走上面这套描边配色(曾经有一颗 .vz-btn-primary 绿色主按钮,
2026-11-09 用户要求「颜色都用取消按钮的配色」,已去掉)。 */
/* 顶栏「保存为节点 / 复制 SVG / 下载 SVG」三颗走上面这套灰色描边配色。
「关闭」单独用编辑器主色调(.vz-seg 选中态同款 #33566f)填充,与产出操作区分、防误点。
2026-11-19:原「取消」改名「关闭」并按主色调取色(行为不变,仍是 data-act="cancel" 退出编辑器)。 */
.vz-btn-close {
background: #33566f;
border-color: #33566f;
color: #eaf6ff;
}
.vz-btn-close:hover { background: #3d6480; border-color: #4a7394; }
.vz-btn-close:active { background: #2c4a60; }
/* ---------- 主体 ---------- */
.vz-body {
@@ -2519,7 +2527,7 @@ var __IWB_VECTORIZE_MANIFEST__ = {
/* 窄屏:面板转到底部 */
@media (max-width: 900px) {
.vz-modal { width: 96vw; height: 92vh; min-width: 0; }
.vz-modal { width: 100vw; height: 100vh; min-width: 0; }
.vz-body { flex-direction: column; }
.vz-panel { width: auto; max-height: 46%; border-left: 0; border-top: 1px solid #2e2e3a; }
}
@@ -3016,7 +3024,7 @@ var __IWB_VECTORIZE_MANIFEST__ = {
}).join("") + '</div></div><div class="vz-row vz-row-switch"><div class="vz-row-text">按孤岛拆分<span>每个连通块一个图层,粘到 Figma 可单独选中;笔画不连的汉字会分成几块</span></div><label class="vz-switch"><input type="checkbox" data-check="splitIslands"' + (params.splitIslands ? " checked" : "") + '><i></i></label></div></div><div class="vz-group"><div class="vz-stats"><span><b data-stat="elements">–</b> 元素</span><span><b data-stat="levels">–</b> 层</span><span><b data-stat="bytes">–</b></span><span><b data-stat="ms">–</b></span></div></div><div class="vz-group"><button type="button" class="vz-adv-toggle" data-act="adv" aria-expanded="' + (advOpen ? "true" : "false") + '">高级参数<span data-adv-caret>' + (advOpen ? "▴" : "▾") + '</span></button><div class="vz-adv" data-adv' + (advOpen ? "" : " hidden") + '><div class="vz-row"><div class="vz-row-label">阈值<span>自动按直方图取,手动可救极端图</span></div><div class="vz-seg" data-seg-group="thrMode"><button type="button" data-seg="thrMode" data-value="auto">自动</button><button type="button" data-seg="thrMode" data-value="manual">手动</button></div></div><div data-thr-row hidden>' + rangeHTML("threshold", "阈值取值", 0, 255, 1, params.threshold >= 0 ? params.threshold : 128, "") + '</div><div class="vz-row"><div class="vz-row-label">反相<span>黑底白字时打开</span></div><div class="vz-seg" data-seg-group="invert">' + segHTML("invert", [["0", "正片"], ["1", "负片"]], params.invert ? 1 : 0) + '</div></div><div class="vz-row"><div class="vz-row-label">填充 / 背景<span>填充仅「纯单色」生效 · 背景作预览底</span></div><div class="vz-swatches"><input type="color" class="vz-color" data-color="color" value="' + esc(params.color) + '" title="填充色(纯单色生效)"><input type="color" class="vz-color" data-color="bg" value="' + esc(params.bg) + '" title="背景色(预览底;勾「带底」写入导出)"><label class="vz-mini" title="导出 / 复制时把背景色一起写进 SVG(默认不带,粘到 Figma 是透明底)"><input type="checkbox" data-check="bgExport"' + (params.bgExport ? " checked" : "") + "><span>带底</span></label></div></div></div></div>";
}
function viewHTML(name) {
return '<div class="vz-root"><div class="vz-modal" role="dialog" aria-modal="true" aria-label="位图转矢量"><header class="vz-header"><span class="vz-title">位图转矢量<em data-meta>' + esc(name) + '</em></span><div class="vz-spacer"></div><button type="button" class="vz-btn" data-act="save">保存为节点</button><button type="button" class="vz-btn" data-act="copy">复制 SVG</button><button type="button" class="vz-btn" data-act="svg">下载 SVG</button><button type="button" class="vz-btn" data-act="cancel">取消</button></header><div class="vz-body"><div class="vz-preview" data-preview><img class="vz-stage" data-stage="vector" alt="矢量预览" draggable="false"><img class="vz-stage" data-stage="original" alt="原图" draggable="false" hidden><div class="vz-badge" data-badge>矢量预览</div><div class="vz-status" data-status hidden><i class="vz-dot"></i><span data-status-text></span></div><div class="vz-hint">空格 对比原图 · 滚轮缩放 · 拖动平移 · 双击复位</div><div class="vz-zoom" data-zoom-chip hidden title="点击回到 100%"><b data-zoom-val>100%</b><span>复位</span></div></div><aside class="vz-panel" data-panel></aside></div></div></div>';
return '<div class="vz-root"><div class="vz-modal" role="dialog" aria-modal="true" aria-label="位图转矢量"><header class="vz-header"><span class="vz-title">位图转矢量<em data-meta>' + esc(name) + '</em></span><div class="vz-spacer"></div><button type="button" class="vz-btn" data-act="save">保存为节点</button><button type="button" class="vz-btn" data-act="copy">复制 SVG</button><button type="button" class="vz-btn" data-act="svg">下载 SVG</button><button type="button" class="vz-btn vz-btn-close" data-act="cancel">关闭</button></header><div class="vz-body"><div class="vz-preview" data-preview><img class="vz-stage" data-stage="vector" alt="矢量预览" draggable="false"><img class="vz-stage" data-stage="original" alt="原图" draggable="false" hidden><div class="vz-badge" data-badge>矢量预览</div><div class="vz-status" data-status hidden><i class="vz-dot"></i><span data-status-text></span></div><div class="vz-hint">空格 对比原图 · 滚轮缩放 · 拖动平移 · 双击复位</div><div class="vz-zoom" data-zoom-chip hidden title="点击回到 100%"><b data-zoom-val>100%</b><span>复位</span></div></div><aside class="vz-panel" data-panel></aside></div></div></div>';
}
var ALPHA_TONE = { hard: 0.4, normal: 1, round: 1.2 };
var toneOf = (alphaMax) => alphaMax <= 0.6 ? "hard" : alphaMax >= 1.1 ? "round" : "normal";
@@ -138,7 +138,7 @@
position: fixed; z-index: 2147483000; left: 0; top: 0; pointer-events: none;
padding: 5px 10px; border-radius: 6px; font-size: 12px; line-height: 1.2;
font-family: inherit; white-space: nowrap;
background: rgba(22, 26, 34, .88); color: #fff;
background: color-mix(in srgb, var(--iwb-text, #1c2333) 88%, transparent); color: var(--iwb-on-brand, #fff);
border: 1px dashed rgba(255, 255, 255, .55);
transform: translate(-2px, -2px);
}
@@ -283,7 +283,7 @@
position: absolute; left: 50%; bottom: 46px; z-index: 20;
transform: translateX(-50%) translateY(6px);
max-width: 88%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
background: rgba(22, 26, 34, .9); color: #fff;
background: color-mix(in srgb, var(--iwb-text, #1c2333) 90%, transparent); color: var(--iwb-on-brand, #fff);
font-size: var(--fs-md, 12px); padding: 6px 12px; border-radius: 14px;
opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
@@ -338,7 +338,7 @@
.iwb-ssn-row > input:focus { outline: none; border-color: var(--iwb-brand, #1677ff); }
.iwb-ssn-row > input::placeholder { color: var(--iwb-text2, #6b7280); opacity: .6; }
.iwb-ssn-foot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--iwb-text2, #6b7280); }
.iwb-ssn-warn { color: #d97706; }
.iwb-ssn-warn { color: var(--iwb-warn, #d97706); }
.iwb-ssn-empty { padding: 6px 2px; font-size: 11px; color: var(--iwb-text2, #6b7280); line-height: 1.6; }
`
@@ -1384,7 +1384,7 @@
global.IWBPluginHost.register({
id: 'style-source',
name: '风格库',
version: '1.3.2',
version: '1.3.3',
apiVersion: 1,
capabilities: ['panels', 'canvas', 'canvasWrite', 'nodeTypes'],
settings: {
+27 -3
View File
@@ -69,6 +69,8 @@ const sourceModules = [
'storage-outputs.js',
'storage-backup.js',
'storage-zip.js',
'plugin-archive.js',
'plugin-promptlib-backup.js',
'runtime-constants.js',
'canvas-store.js',
'generation-scheduler.js',
@@ -77,6 +79,10 @@ const sourceModules = [
'gallery-query.js',
'gallery-hydration.js',
'ui-components.js',
'plugin-data.js',
'plugin-api-gallery.js',
'plugin-api-grouplib.js',
'plugin-api-promptlib.js',
'plugin-host.js',
'image-compress.js',
'storage-fallback-indexeddb.js',
@@ -87,8 +93,22 @@ const sourceModules = [
'canvas-text.js',
'generation-task-graph.js',
'generation-results-store.js',
'ui-groups-sidebar.js',
'ui-lib-sidebar.js',
'ui-dock-sanitize.js',
'ui-dock.js',
'ui-minimap-fit.js',
'ui-dock-panels.js',
'theme-tokens.js',
'canvas-grid.js',
'image-display-thumb.js',
'image-remote-cache.js',
'image-thumb-pick.js',
'ui-modal-drag.js',
'ui-nav-rail.js',
'ui-plugin-page.js',
'ui-hotkey-help.js',
'ui-desktop-shell.js',
'ui-appearance.js',
'runtime-download-auto.js',
'ui-workspace-tabs.js',
'ui-app-chrome.js',
'ui-workbench-hooks.js',
@@ -112,6 +132,9 @@ const sourceModules = [
'ui-backup-modal.js',
'ui-connect-menu.js',
'ui-gen-config-panel.js',
'canvas-webview.js',
'plugin-files-policy.js',
'image-prompt-cover.js',
]
// 插件自动发现(2026-10-17):src/plugin-*.js 中**未被上面显式登记**的,按文件名排序追加到末尾。
@@ -168,7 +191,6 @@ const minifiedCss = transformSync(fs.readFileSync(path.join(root, 'style.css'),
fs.writeFileSync(path.join(dist, 'style.css'), minifiedCss)
fs.copyFileSync(path.join(root, 'favicon.svg'), path.join(dist, 'favicon.svg'))
fs.copyFileSync(path.join(root, '_headers'), path.join(dist, '_headers'))
// PWA(2026-11-07):可安装 —— manifest + 图标(iOS 额外要 apple-touch-icon 的 PNG)
for (const f of ['manifest.webmanifest', 'icon-192.png', 'icon-512.png', 'apple-touch-icon.png']) {
fs.copyFileSync(path.join(root, f), path.join(dist, f))
@@ -208,6 +230,8 @@ const html = `<!DOCTYPE html>
`
fs.writeFileSync(path.join(dist, 'index.html'), html)
fs.writeFileSync(path.join(dist, 'version.json'), JSON.stringify({ version, packageVersion: pkg.version, commit: gitSha }, null, 2) + '\n')
// 导航 logo 用真实应用图标(v3.25.61;缺失不阻塞构建)
try { fs.copyFileSync(path.join(root, 'src-tauri', 'icons', 'icon.png'), path.join(dist, 'nav-logo.png')) } catch (e) { /* ignore */ }
const appBytes = fs.statSync(path.join(dist, 'app.js')).size
const cssBytes = fs.statSync(path.join(dist, 'style.css')).size
+13 -2
View File
@@ -21,6 +21,17 @@ for (const name of fs.readdirSync(src)) {
fs.copyFileSync(path.join(src, name), path.join(dst, name))
count++
}
// 索引与插件文件必须同源同包:应用按 index.json 里的 filename 去 /plugins/ 取
// v3.25.41(M1):目录插件 <plugins>/<id>/{manifest.json,main.js} 一并进包(应用按 /plugins/<id>/… 取)
let folders = 0
const pluginsRoot = path.join(root, 'plugins')
for (const name of fs.readdirSync(pluginsRoot)) {
const abs = path.join(pluginsRoot, name)
if (!fs.statSync(abs).isDirectory()) continue
if (name === 'runtime' || name === 'local') continue
if (!fs.existsSync(path.join(abs, 'manifest.json'))) continue
fs.cpSync(abs, path.join(dst, name), { recursive: true })
folders++
}
// 索引与插件文件必须同源同包:应用按 index.json 里的 filename / dir 去 /plugins/ 取
fs.copyFileSync(path.join(root, 'plugins', 'index.json'), path.join(dst, 'index.json'))
console.log('[copy-plugins] 已拷入 ' + count + ' 个插件 → dist/plugins/')
console.log('[copy-plugins] 已拷入 ' + count + ' 个文件 + ' + folders + ' 个目录插件 → dist/plugins/')
+95 -20
View File
@@ -1,33 +1,108 @@
#!/usr/bin/env node
'use strict'
// 生成插件市场索引:plugins/index.json + plugins/meta.json → market/index.json + market/plugins/*
// 产物用于 market.maqiart.eu.org(纯静态)。
// 生成插件市场索引(M3):plugins/index.json + plugins/meta.json(+ 目录插件)→ market/
//
// 产物(纯静态,供 market.maqiart.eu.org 与桌面端安装器共用):
// market/index.json 市场条目:bundle(zip) + files[逐文件 sha256] + 兼容字段 file
// market/plugins/<id>-<version>.zip 目录插件包:manifest.json + main.js [+ styles.css / assets]
// market/plugins/plugin-<id>.<hash>.js 单文件产物(旧客户端仍可安装,保持向后兼容)
//
// 包里统一用 STORE(不压缩):客户端 src/storage-zip.js 对 DEFLATE 依赖 DecompressionStream,
// 旧 macOS 的 WKWebView 没有该 API;插件包只有几十 KB,不压缩没有实际损失。
const fs = require('fs')
const path = require('path')
const crypto = require('crypto')
const { zipStore } = require('./plugin-zip')
const root = path.resolve(__dirname, '..')
const man = JSON.parse(fs.readFileSync(path.join(root, 'plugins', 'index.json'), 'utf8'))
const meta = JSON.parse(fs.readFileSync(path.join(root, 'plugins', 'meta.json'), 'utf8'))
const out = path.join(root, 'market')
fs.mkdirSync(path.join(out, 'plugins'), { recursive: true })
const sha = (buf) => crypto.createHash('sha256').update(buf)
const plugins = []
for (const e of man) {
const src = path.join(root, 'plugins', 'runtime', e.file)
if (!fs.existsSync(src)) { console.warn('缺少产物:' + e.file); continue }
const buf = fs.readFileSync(src)
fs.writeFileSync(path.join(out, 'plugins', e.file), buf)
const m = meta[e.id] || {}
plugins.push({
id: e.id, name: m.name || e.id, desc: m.desc || '', author: m.author || 'official', icon: m.icon || '', color: m.color || '', tags: Array.isArray(m.tags) ? m.tags : [],
version: e.version, apiVersion: 1,
file: 'plugins/' + e.file,
size: buf.length,
sha256: sha(buf).digest('hex'),
integrity: 'sha256-' + sha(buf).digest('base64'),
})
const shaHex = (buf) => sha(buf).digest('hex')
function readFolderFiles (id) {
// 目录插件:manifest.json + main.js + 可选 styles.css + assets/**(限两级)
const dir = path.join(root, 'plugins', id)
const files = []
const manifestPath = path.join(dir, 'manifest.json')
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
files.push({ name: 'manifest.json', data: fs.readFileSync(manifestPath) })
const main = String(manifest.main || 'main.js')
files.push({ name: main, data: fs.readFileSync(path.join(dir, main)) })
if (manifest.style && fs.existsSync(path.join(dir, manifest.style))) files.push({ name: String(manifest.style), data: fs.readFileSync(path.join(dir, String(manifest.style))) })
const assetsDir = path.join(dir, 'assets')
if (fs.existsSync(assetsDir)) {
for (const name of fs.readdirSync(assetsDir)) {
const abs = path.join(assetsDir, name)
if (fs.statSync(abs).isFile()) files.push({ name: 'assets/' + name, data: fs.readFileSync(abs) })
}
}
return { files, manifest }
}
const index = { version: 1, updatedAt: new Date().toISOString(), plugins: plugins }
const plugins = []
let zipped = 0
for (const e of man) {
const m = meta[e.id] || {}
const base = {
id: e.id, name: m.name || e.id, desc: m.desc || '', author: m.author || 'official',
icon: m.icon || '', color: m.color || '', tags: Array.isArray(m.tags) ? m.tags : [],
version: e.version, apiVersion: 1,
}
// ---- 目录形态:打包 manifest + main(+style/assets) ----
let files = null
if (e.dir) {
const got = readFolderFiles(e.dir)
files = got.files
} else {
const src = path.join(root, 'plugins', 'runtime', e.file)
if (!fs.existsSync(src)) { console.warn('缺少产物:' + e.file); continue }
const js = fs.readFileSync(src)
// 单文件插件也打成目录包:manifest.json 由市场索引生成,main.js 就是原产物
// manifest 里带 files(main.js 的 sha256):手工把 zip 解到 <plugins>/<id>/ 时,
// 加载器扫描目录也能校验入口文件(manifest 自身不参与,避免自引用)。
const manifestJson = {
id: e.id, name: base.name, version: e.version, apiVersion: 1, main: 'main.js',
description: base.desc, author: base.author, icon: base.icon, tags: base.tags,
files: { 'main.js': shaHex(js) },
}
files = [
{ name: 'manifest.json', data: Buffer.from(JSON.stringify(manifestJson, null, 2) + '\n', 'utf8') },
{ name: 'main.js', data: js },
]
}
const fileList = files.map((f) => ({ path: f.name, sha256: shaHex(f.data), size: f.data.length }))
const zip = zipStore(files)
const zipName = e.id + '-' + e.version + '.zip'
fs.writeFileSync(path.join(out, 'plugins', zipName), zip)
zipped++
const item = Object.assign({}, base, {
bundle: 'plugins/' + zipName,
bundleSize: zip.length,
bundleSha256: shaHex(zip),
files: fileList,
})
// 兼容:单文件插件继续提供裸 .js(旧客户端 install 只认 file/integrity)
if (!e.dir) {
const src = path.join(root, 'plugins', 'runtime', e.file)
const buf = fs.readFileSync(src)
fs.writeFileSync(path.join(out, 'plugins', e.file), buf)
item.file = 'plugins/' + e.file
item.size = buf.length
item.sha256 = shaHex(buf)
item.integrity = 'sha256-' + sha(buf).digest('base64')
}
plugins.push(item)
}
const index = { version: 2, updatedAt: new Date().toISOString(), plugins: plugins }
fs.writeFileSync(path.join(out, 'index.json'), JSON.stringify(index, null, 2) + '\n')
console.log('market/index.json:' + plugins.length + ' 个插件')
for (const p of plugins) console.log(' ' + p.id.padEnd(16) + p.version.padEnd(8) + (p.size + ' B'))
console.log('market/index.json:' + plugins.length + ' 个插件 / ' + zipped + ' 个 zip 包')
for (const p of plugins) console.log(' ' + p.id.padEnd(16) + String(p.version).padEnd(8) + (p.bundleSize + ' B zip'))
+1 -1
View File
@@ -25,7 +25,7 @@ function platformRow (rel, p) {
? '版本 ' + esc(rel.version) + ' · ' + fmtSize(item.size) + ' · .' + esc(item.kind || 'dmg')
: ''
const action = item
? '<a class="btn" href="/' + esc(item.file) + '">下载</a>'
? '<a class="btn" href="/' + esc(item.file) + (item.h ? '?h=' + esc(item.h) : '') + '">下载</a>'
: '<span class="muted">暂未提供</span>'
const hash = item && item.sha256
? '<div class="hash">sha256 ' + esc(item.sha256.slice(0, 16)) + '…</div>'
+1 -1
View File
@@ -76,7 +76,7 @@ const dlCards = [
].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>'
return '<a href="/' + esc(p.file) + (p.h ? '?h=' + esc(p.h) : '') + '"><div class="n">' + label + '</div><div class="s">' + hint + ' · ' + mb(p.size) + ' · .' + esc(String(p.file).split('.').pop()) + '</div></a>'
}).join('\n ')
const tags = []
+89
View File
@@ -0,0 +1,89 @@
#!/usr/bin/env node
'use strict'
// 插件包 ZIP 写入器(M3,2026-11-20)
//
// 为什么自己写:插件包很小(几十 KB),只需要 STORE(不压缩);
// 而客户端解包走 src/storage-zip.js —— 它对 DEFLATE 依赖 DecompressionStream,
// 旧 macOS(<13)的 WKWebView 没有该 API。用 STORE 可以彻底绕开这个兼容坑。
//
// 输出:标准 ZIP(local header + central directory + EOCD),UTF-8 文件名(flag 0x0800)。
const CRC_TABLE = (() => {
const t = new Uint32Array(256)
for (let i = 0; i < 256; i++) {
let c = i
for (let k = 0; k < 8; k++) c = (c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)
t[i] = c >>> 0
}
return t
})()
function crc32 (buf) {
let c = 0xFFFFFFFF
for (let i = 0; i < buf.length; i++) c = (CRC_TABLE[(c ^ buf[i]) & 0xFF] ^ (c >>> 8)) >>> 0
return (c ^ 0xFFFFFFFF) >>> 0
}
// files: [{ name: string, data: Buffer|string }]
function zipStore (files) {
const locals = []
const centrals = []
let offset = 0
const DOS_TIME = 0
const DOS_DATE = 0x21 // 1980-01-01
for (const f of files || []) {
const name = String(f.name || '')
if (!name || name.indexOf('..') >= 0 || name.charAt(0) === '/') throw new Error('非法文件名:' + name)
const nameBuf = Buffer.from(name, 'utf8')
const data = Buffer.isBuffer(f.data) ? f.data : Buffer.from(String(f.data == null ? '' : f.data), 'utf8')
const crc = crc32(data)
const local = Buffer.alloc(30)
local.writeUInt32LE(0x04034b50, 0)
local.writeUInt16LE(20, 4) // version needed
local.writeUInt16LE(0x0800, 6) // UTF-8 文件名
local.writeUInt16LE(0, 8) // method = STORE
local.writeUInt16LE(DOS_TIME, 10)
local.writeUInt16LE(DOS_DATE, 12)
local.writeUInt32LE(crc, 14)
local.writeUInt32LE(data.length, 18)
local.writeUInt32LE(data.length, 22)
local.writeUInt16LE(nameBuf.length, 26)
local.writeUInt16LE(0, 28)
locals.push(local, nameBuf, data)
const cd = Buffer.alloc(46)
cd.writeUInt32LE(0x02014b50, 0)
cd.writeUInt16LE(20, 4) // made by
cd.writeUInt16LE(20, 6) // version needed
cd.writeUInt16LE(0x0800, 8)
cd.writeUInt16LE(0, 10) // method
cd.writeUInt16LE(DOS_TIME, 12)
cd.writeUInt16LE(DOS_DATE, 14)
cd.writeUInt32LE(crc, 16)
cd.writeUInt32LE(data.length, 20)
cd.writeUInt32LE(data.length, 24)
cd.writeUInt16LE(nameBuf.length, 28)
cd.writeUInt16LE(0, 30) // extra len
cd.writeUInt16LE(0, 32) // comment len
cd.writeUInt16LE(0, 34) // disk start
cd.writeUInt16LE(0, 36) // internal attrs
cd.writeUInt32LE(0, 38) // external attrs
cd.writeUInt32LE(offset, 42) // local header offset
centrals.push(cd, nameBuf)
offset += local.length + nameBuf.length + data.length
}
const cdBuf = Buffer.concat(centrals)
const end = Buffer.alloc(22)
end.writeUInt32LE(0x06054b50, 0)
end.writeUInt16LE(0, 4)
end.writeUInt16LE(0, 6)
end.writeUInt16LE(files.length, 8)
end.writeUInt16LE(files.length, 10)
end.writeUInt32LE(cdBuf.length, 12)
end.writeUInt32LE(offset, 16)
end.writeUInt16LE(0, 20)
return Buffer.concat(locals.concat([cdBuf, end]))
}
module.exports = { zipStore, crc32 }
+64 -5
View File
@@ -29,14 +29,32 @@ 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"
echo "== 1/4 构建 arm64(app + dmg,含签名)"
npx tauri build --bundles app,dmg >/dev/null
# macOS 26(26.6.2 实测)上 tauri 自带的 create-dmg / bundle_dmg.sh 会在
# "Searching for mounted interstitial disk image" 处报 `grep: bad regex` 并中止,
# 整条发布链因此断在 dmg 上(而 .app 与签名产物其实已经生成)。
# 所以:只让 tauri 打 app(含 .app.tar.gz + .sig),dmg 用 hdiutil 自己封。
make_dmg() { # $1=app 路径 $2=输出 dmg
local app="$1" out="$2" stage
stage=$(mktemp -d)
cp -R "$app" "$stage/"
ln -s /Applications "$stage/Applications"
rm -f "$out"
hdiutil create -volname "image-workbench" -srcfolder "$stage" -ov -format UDZO -quiet "$out"
rm -rf "$stage"
}
echo "== 2/4 构建 x86_64(app + dmg,含签名)"
npx tauri build --target x86_64-apple-darwin --bundles app,dmg >/dev/null
echo "== 1/4 构建 arm64(app + 签名产物)"
npx tauri build --bundles app >/dev/null
echo "== 2/4 构建 x86_64(app + 签名产物)"
npx tauri build --target x86_64-apple-darwin --bundles app >/dev/null
ARM="src-tauri/target/release/bundle"
INT="src-tauri/target/x86_64-apple-darwin/release/bundle"
mkdir -p "$ARM/dmg" "$INT/dmg"
echo "== 封装 dmg"
make_dmg "$ARM/macos/image-workbench.app" "$ARM/dmg/image-workbench_${V}_aarch64.dmg"
make_dmg "$INT/macos/image-workbench.app" "$INT/dmg/image-workbench_${V}_x64.dmg"
echo "== 3/4 上传产物"
TMP=$(mktemp -d)
@@ -54,9 +72,21 @@ 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 包由 win 端构建、mac 端 publish-windows-update.sh 签名发布,写独立的 latest-windows.json。
# 但应用 endpoints 只配了 latest.json(mac/win 共用同一份 tauri.conf.json,无法按平台分 endpoint),
# 所以 mac 发布【必须】把 windows 条目合并进 latest.json,否则 win 用户「检查更新」找不到自己平台、
# 会卡在「正在检查…」(v3.25.31 实测踩过:旧逻辑硬编码只写 darwin,每次 mac 发版都抹掉 windows 条目)。
# 合并条件:latest-windows.json 的 version == 本次 mac version(三平台同批)。
# 若 win 还没跟上本次版本,【不合并】——避免「顶层 version 新、win 包旧」让 updater 反复提示同一旧包;
# 等 win 同批发布后重跑本脚本即自动齐平。
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
curl -s -m 20 https://download.maqiart.eu.org/updates/latest-windows.json -o /tmp/iwb-latest-win.json 2>/dev/null || echo '{}' > /tmp/iwb-latest-win.json
node -e '
const fs = require("fs")
const v = process.env.UPD_VERSION
let win = {}
try { win = JSON.parse(fs.readFileSync("/tmp/iwb-latest-win.json", "utf8")) } catch (e) { win = {} }
const j = {
version: v,
notes: process.env.UPD_NOTES || "",
@@ -66,11 +96,40 @@ const j = {
"darwin-x86_64": { signature: process.env.SIG_INT, url: "https://download.maqiart.eu.org/updates/darwin-x86_64/image-workbench_" + v + "_x64.app.tar.gz" },
},
}
if (win.platforms && win.platforms["windows-x86_64"]) {
if (win.version === v) {
j.platforms["windows-x86_64"] = win.platforms["windows-x86_64"]
console.log("已合并 windows-x86_64 条目(v" + v + ",三平台齐平)")
} else {
console.log("⚠ latest-windows.json 仍是 v" + win.version + ",本次 mac 发 v" + v + ":latest.json 暂不含 windows 条目。win 用户停留旧版,待 win 同批发布后【重跑本脚本】即自动齐平(切勿手工塞旧 win 包,会触发 updater 版本错配死循环)。")
}
}
fs.writeFileSync("/tmp/iwb-latest.json", JSON.stringify(j, null, 2))
console.log("latest.json -> v" + v)
console.log("latest.json -> v" + v + " platforms: " + Object.keys(j.platforms).join(","))
'
$SCP /tmp/iwb-latest.json "$NAS_HOST:$NAS_DIR/updates/latest.json"
ssh -i "$SSH_KEY" -o BatchMode=yes "$NAS_HOST" "chmod -R a+rX $NAS_DIR"
# == 自动对齐文档锚点 ==
# 规则:main = <sha> 必须是「最近一次 bump 版本的提交」。以前每次发版要手工改两次锚点,
# 现在由发布脚本收尾:写锚点 + 同步 facts + 本地提交(推送仍随版本一起做)。
if git rev-parse --git-dir >/dev/null 2>&1; then
HEAD_V=$(git show HEAD:package.json 2>/dev/null | node -e 'let t="";process.stdin.on("data",d=>t+=d).on("end",()=>{try{console.log(JSON.parse(t).version)}catch(e){console.log("")}})') || true
if [ "$HEAD_V" != "$V" ]; then
echo "WARN 版本号尚未提交(HEAD=${HEAD_V} 本地=${V}):跳过锚点自动对齐,请先提交再发布"
else
BUMP_SHA=$(git log -1 --format=%h -- package.json || true)
if [ -n "$BUMP_SHA" ]; then
node scripts/set-doc-anchor.js "$V" "$BUMP_SHA" || true
node scripts/sync-facts.js --write >/dev/null 2>&1 || true
if ! git diff --quiet -- docs/standards/architecture-current-state.md CONTRIBUTING.md 2>/dev/null; then
git add docs/standards/architecture-current-state.md CONTRIBUTING.md 2>/dev/null || true
GIT_AUTHOR_NAME=qiqi GIT_AUTHOR_EMAIL=qiqi@local GIT_COMMITTER_NAME=qiqi GIT_COMMITTER_EMAIL=qiqi@local git commit -q -m "docs: 锚点对齐 v${V}+${BUMP_SHA}(publish 自动)" || true
echo "== 文档锚点已自动对齐并本地提交:${BUMP_SHA}(随版本一起 push)"
fi
fi
fi
fi
echo "== 完成:https://download.maqiart.eu.org/updates/latest.json"
curl -s -m 15 https://download.maqiart.eu.org/updates/latest.json | head -c 200; echo
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# 发布 Windows 更新:对 Windows 侧构建好的 *-setup.exe 重新签名(用本机正式私钥),
# 上传到 NAS,并写入 **独立** 的 updates/latest-windows.json(v3.25.15 起平台解耦:
# mac 的 latest.json 与 Windows 的 latest-windows.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-windows.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"
node -e '
const fs = require("fs")
const p = process.argv[1]
const doc = {
version: process.env.APP_VERSION,
notes: process.env.NOTES || "在线更新",
pub_date: new Date().toISOString(),
platforms: { "windows-x86_64": { signature: process.env.SIG, url: process.env.URL } },
}
fs.writeFileSync(p, JSON.stringify(doc, null, 2))
console.log(" version", doc.version)
' "$WORK/latest-windows.json"
$SCP "$WORK/latest-windows.json" "$NAS_HOST:$NAS_DIR/updates/latest-windows.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-windows.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"
+24 -9
View File
@@ -35,21 +35,36 @@ SHA=$(shasum -a 256 "$DMG" | awk '{print $1}')
BASE=$(basename "$DMG")
REMOTE_REL="updates/$PLATFORM/$BASE"
EXTRA=""
if [ -n "$NOTES" ]; then EXTRA="--notes $NOTES"; fi
# 注意:必须用数组传参。旧写法 `EXTRA="--notes $NOTES"` 在 `$EXTRA` 展开时按空格拆词,
# 带空格的说明会被腰斩(v3.25.23 真实发生:线上 notes 只剩「…(插件」)。
NOTES_ARG=()
if [ -n "$NOTES" ]; then NOTES_ARG=(--notes "$NOTES"); fi
node scripts/update-releases.js --version "$VERSION" --platform "$PLATFORM" \
--file "$REMOTE_REL" --size "$SIZE" --sha256 "$SHA" $EXTRA
--file "$REMOTE_REL" --size "$SIZE" --sha256 "$SHA" ${NOTES_ARG[@]+"${NOTES_ARG[@]}"}
node scripts/gen-release-page.js
# 首页 / 插件页也带版本号与插件数(gen-site.js 渲染)——不重跑就会出现
# 「包已经是新版、首页还写着下载 v3.25.22」(v3.25.23 真实发生)。
node scripts/gen-site.js
echo "→ 上传到 ${NAS_USER}@${NAS_HOST}:$NAS_DIR"
ssh -i "$SSH_KEY" -o BatchMode=yes "${NAS_USER}@${NAS_HOST}" "mkdir -p $NAS_DIR/updates/$PLATFORM"
ssh -i "$SSH_KEY" -o BatchMode=yes "${NAS_USER}@${NAS_HOST}" "mkdir -p $NAS_DIR/updates/$PLATFORM $NAS_DIR/download $NAS_DIR/plugins"
scp -i "$SSH_KEY" -o BatchMode=yes "$DMG" "${NAS_USER}@${NAS_HOST}:$NAS_DIR/updates/$PLATFORM/" >/dev/null
scp -i "$SSH_KEY" -o BatchMode=yes site/releases.json site/index.html "${NAS_USER}@${NAS_HOST}:$NAS_DIR/" >/dev/null
# 下载页要落在 $NAS_DIR/download/,**不能**和首页一起 scp —— 两个文件都叫 index.html,
# 同目录展开时后者覆盖前者(v3.25.23 真实发生:首页被下载页顶掉)。
scp -i "$SSH_KEY" -o BatchMode=yes site/releases.json site/index.html site/plugins-index.json "${NAS_USER}@${NAS_HOST}:$NAS_DIR/" >/dev/null
scp -i "$SSH_KEY" -o BatchMode=yes site/download/index.html "${NAS_USER}@${NAS_HOST}:$NAS_DIR/download/" >/dev/null
scp -i "$SSH_KEY" -o BatchMode=yes site/plugins/index.html "${NAS_USER}@${NAS_HOST}:$NAS_DIR/plugins/" >/dev/null
ssh -i "$SSH_KEY" -o BatchMode=yes "${NAS_USER}@${NAS_HOST}" "chmod -R a+rX $NAS_DIR"
echo "→ 校验公网"
CODE=$(curl -s -o /dev/null -m 20 -w '%{http_code}' "https://download.maqiart.eu.org/$REMOTE_REL")
SIZE2=$(curl -s -o /dev/null -m 40 -w '%{size_download}' "https://download.maqiart.eu.org/$REMOTE_REL")
echo " 页面 $(curl -s -o /dev/null -m 12 -w '%{http_code}' https://download.maqiart.eu.org/) 包 $CODE 远端 $SIZE2 B / 本地 $SIZE B"
[ "$CODE" = "200" ] && [ "$SIZE2" = "$SIZE" ] || { echo "✗ 校验失败"; exit 1; }
# 包是 8~9 MB,走隧道回读要几十秒:超时给短了 curl 直接非零退出,
# set -e 下会「无声退出」,看起来像发布成功(v3.25.23 真实发生)。
# 必须带 ?h=<sha12> 回读:CF 对同名 dmg 有 4 小时强缓存,不带指纹会验到旧字节。
SHA12=$(printf '%s' "$SHA" | cut -c1-12)
PKG_URL="https://download.maqiart.eu.org/$REMOTE_REL?h=$SHA12"
CODE=$(curl -s -o /dev/null -m 120 -w '%{http_code}' "$PKG_URL") || CODE=000
SIZE2=$(curl -s -o /dev/null -m 120 -w '%{size_download}' "$PKG_URL") || SIZE2=0
PAGE_CODE=$(curl -s -o /dev/null -m 20 -w '%{http_code}' https://download.maqiart.eu.org/) || PAGE_CODE=000
echo " 页面 $PAGE_CODE 包 $CODE 远端 $SIZE2 B / 本地 $SIZE B"
if [ "$CODE" != "200" ] || [ "$SIZE2" != "$SIZE" ]; then echo "✗ 校验失败"; exit 1; fi
echo "✓ 发布完成:https://download.maqiart.eu.org/"
+52 -225
View File
@@ -1,238 +1,65 @@
/* serve-test.js —— e2e 用的本地静态服务器(v3.25.15 起脱离网页部署)
*
* 历史:本项目早期同时发布网页版(Cloudflare Pages),这个脚本会解析 `_headers` 下发 CSP、
* 并模拟 Pages Functions(/api/img、/plugins/*)。**现在是桌面客户端项目**,那些部署面已删除,
* 因此这里只保留「能跑 e2e」的最小职责:把 dist/ 当静态目录伺服。
*
* 桌面端的 CSP 由 src-tauri/tauri.conf.json 决定,e2e 不模拟 webview 的 CSP(要验就装真包)。
* 用法:node scripts/serve-test.js(IWB_LOCAL_PORT 可改端口,默认 8787)
*/
'use strict'
const http = require('http')
const fs = require('fs')
const path = require('path')
const cp = require('child_process')
const http = require('node:http')
const fs = require('node:fs')
const path = require('node:path')
const root = path.resolve(__dirname, '..')
const dist = path.join(root, 'dist')
const port = Number(process.env.IWB_LOCAL_PORT || 8787)
const mime = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8', '.json': 'application/json; charset=utf-8', '.png': 'image/png', '.svg': 'image/svg+xml' }
// ---------- _headers → 响应头(本地 e2e 与 Cloudflare Pages 保持一致) ----------
// 动机:线上 CSP 是 connect-src 'self' https:,会拦掉 fetch(data:...) / CDN <script> / blob: Worker。
// 本地服务器原先不解析 _headers,这类「本地过、线上挂」的缺陷永远抓不到。这里把 _headers 的
// 路径分组按 Cloudflare Pages 语义应用到响应头(/* 组作用于所有响应,其它组按前缀/通配匹配)。
// 健壮性:_headers 缺失或解析不出任何分组时**不注入**并打印一行提示,绝不让服务器启动失败。
function parseHeaderGroups(text) {
const groups = []
let current = null
for (const raw of String(text == null ? '' : text).split(/\r?\n/)) {
const line = raw.replace(/\s+$/, '')
if (!line.trim() || /^\s*#/.test(line)) continue
if (/^\s/.test(line)) {
if (!current) continue // 缩进行但没有归属路径 → 忽略
const i = line.indexOf(':')
if (i <= 0) continue
const name = line.slice(0, i).trim()
const value = line.slice(i + 1).trim().replace(/[\r\n]+/g, ' ') // 防响应头注入
if (name) current.headers.push([name, value])
continue
}
current = { path: line.trim(), headers: [] }
groups.push(current)
}
return groups
}
// Cloudflare Pages 匹配规则(够用即可):/* 与 * 全局;/a/* 前缀;其余精确匹配。
function headerGroupMatches(pattern, pathname) {
const p = String(pattern || '').trim()
if (!p || p === '*' || p === '/*') return true
if (p.endsWith('*')) return pathname.indexOf(p.slice(0, -1)) === 0
return p === pathname
}
function loadHeaderGroups() {
const candidates = [path.join(root, '_headers'), path.join(dist, '_headers')]
for (const file of candidates) {
try {
if (!fs.existsSync(file)) continue
const groups = parseHeaderGroups(fs.readFileSync(file, 'utf8')).filter((g) => g.headers.length)
if (groups.length) return { groups, file }
} catch (e) { /* 换下一个候选 */ }
}
return null
}
const loaded = loadHeaderGroups()
const headerGroups = loaded ? loaded.groups : []
const cspApplied = headerGroups.some((g) => g.headers.some(([n]) => n.toLowerCase() === 'content-security-policy'))
if (loaded) {
console.log(`[serve-test] 已从 ${path.relative(root, loaded.file) || '_headers'} 注入响应头分组 ${headerGroups.length} 个${cspApplied ? '(含 Content-Security-Policy,本地与线上 CSP 一致)' : '(未解析到 CSP)'}`)
} else {
console.log('[serve-test] 未找到/无法解析 _headers:本次不注入任何安全响应头(本地环境与线上不一致,CSP 类缺陷不会被拦住)')
}
function securityHeadersFor(pathname, base) {
const out = Object.assign({}, base)
for (const group of headerGroups) {
if (!headerGroupMatches(group.path, pathname)) continue
for (const [name, value] of group.headers) out[name] = value // 后匹配的覆盖先匹配的(与 Pages 的后者优先一致)
}
return out
}
// ---------- Pages Functions 本地模拟(2026-10-20 加,审计 H1 的护栏) ----------
//
// 动机:Cloudflare Pages 的 `_headers` **不作用于 Functions 响应**
// (https://developers.cloudflare.com/pages/configuration/headers/)—— 静态资源有 CSP/nosniff,
// 而 `/api/*` 与 `/plugins/*`(Pages Functions)**一个安全头都没有**,此前线上与本地都测不到。
// 本文件原先只服务 dist/ 静态资源 ⇒ 「本地过、线上挂」这一类缺陷**无法被 e2e 发现**。
//
// 忠实度原则(重要):Function 响应**只带 Function 自己返回的 header**,
// **绝不叠加 `_headers`** —— 线上就是这样,本地若"好心"加上 CSP 就永远测不出真实差异。
// 测试 tests/iwb-functions-headers.spec.js 用反向断言把这一点钉死。
//
// 模拟范围刻意最小:只做「Cloudflare context 形状」+「Response → Node 响应」两件事,
// 不模拟 Pages 的路由匹配、缓存、边缘网络等 —— 那些不属于本项目能控的范围。
const FUNCTION_ROUTES = [
{ prefix: '/api/img', file: 'functions/api/img.js', entry: 'onRequest' },
{ prefix: '/plugins', file: 'functions/plugins/[[path]].js', entry: 'onRequestGet' },
]
// 上游 mock(默认开):/api/img 会真的去请求外部图床(豆包/阿里云…),
// 那会让 e2e 变慢且依赖外部可达性 ⇒ 默认把上游 fetch 换成本地假图片。
// 关闭:IWB_MOCK_UPSTREAM=0(需要真连上游时用)。
const MOCK_UPSTREAM = process.env.IWB_MOCK_UPSTREAM !== '0'
// 插件 KV 的本地替身:内存 Map,内容寻址的插件文件用可预测的假字节。
const MOCK_PLUGIN_BYTES = '/* mock plugin */\n'
function mockKv() {
const store = new Map([
['plugins/index.json', JSON.stringify([{ id: 'mock-plugin', file: 'plugin-mock-plugin.0123456789ab.js', version: '1.0.0', integrity: 'sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=' }])],
['plugins/plugin-mock-plugin.0123456789ab.js', MOCK_PLUGIN_BYTES],
])
return { get: async (key) => (store.has(key) ? store.get(key) : null) }
}
async function readRequestBody(req) {
if (req.method === 'GET' || req.method === 'HEAD') return undefined
const chunks = []
for await (const c of req) chunks.push(c)
return Buffer.concat(chunks)
}
const functionModules = new Map()
async function loadFunctionModule(file) {
if (functionModules.has(file)) return functionModules.get(file)
const mod = await import(path.join(root, file))
functionModules.set(file, mod)
return mod
}
// Function 响应 → Node 响应:**只透传 Function 自己的 header**(不叠加 _headers,见上方忠实度原则)
async function sendFunctionResponse(res, fnRes) {
const headers = {}
for (const [name, value] of fnRes.headers.entries()) headers[name] = value
const body = fnRes.status === 204 || fnRes.status === 304 ? Buffer.alloc(0) : Buffer.from(await fnRes.arrayBuffer())
res.writeHead(fnRes.status, headers)
res.end(body)
}
async function handleFunction(req, res, pathname) {
const route = FUNCTION_ROUTES.find((r) => pathname === r.prefix || pathname.indexOf(r.prefix + '/') === 0)
if (!route) return false
try {
const mod = await loadFunctionModule(route.file)
const fn = mod[route.entry]
if (typeof fn !== 'function') throw new Error('入口未导出: ' + route.entry)
// 构造 Request(POST 需要 body)
const url = new URL(req.url, 'http://127.0.0.1')
const body = await readRequestBody(req)
const request = new Request(url.toString(), {
method: req.method,
headers: Object.entries(req.headers).reduce((acc, [k, v]) => { if (typeof v === 'string') acc[k] = v; return acc }, {}),
body: body && body.length ? body : undefined,
})
const ctx = {
params: { path: pathname.slice(route.prefix.length).split('/').filter(Boolean) },
env: { PLUGINS: mockKv() },
request,
}
// 上游 mock:把 Function 内部的 fetch 换成本地假响应(仅 /api/img 会用到)
const fnRes = await withMockedUpstream(async () => {
return await fn(ctx)
})
await sendFunctionResponse(res, fnRes)
} catch (e) {
res.writeHead(500, { 'content-type': 'text/plain; charset=utf-8' })
res.end('function error: ' + String((e && e.message) || e))
}
return true
}
// 上游 mock 实现:把 fetch 指向白名单图床的请求替换为一张 1x1 PNG。
// 仅在 MOCK_UPSTREAM 开启时生效;不影响真实部署(线上跑的是 Cloudflare Functions)。
async function withMockedUpstream(fn) {
if (!MOCK_UPSTREAM) return fn()
const realFetch = globalThis.fetch
const PNG = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64')
globalThis.fetch = async (input, init) => {
const u = String(typeof input === 'string' ? input : (input && input.url) || input)
// 非上游请求(如本地自取)放行
if (!/^https?:\/\//i.test(u)) return realFetch(input, init)
return new Response(PNG, { status: 200, headers: { 'Content-Type': 'image/png', 'Content-Length': String(PNG.length) } })
}
try {
return await fn()
} finally {
globalThis.fetch = realFetch
}
const mime = {
'.html': 'text/html; charset=utf-8',
'.js': 'text/javascript; charset=utf-8',
'.css': 'text/css; charset=utf-8',
'.json': 'application/json; charset=utf-8',
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.webp': 'image/webp',
'.gif': 'image/gif',
'.svg': 'image/svg+xml',
'.ico': 'image/x-icon',
'.woff2': 'font/woff2',
'.map': 'application/json; charset=utf-8',
}
const server = http.createServer((req, res) => {
const clean = decodeURIComponent((req.url || '/').split('?')[0])
// Pages Functions 优先(/api/* 与 /plugins/*):它们**不套用 _headers**,与线上一致
handleFunction(req, res, clean).then((handled) => {
if (handled) return
const file = path.resolve(dist, clean === '/' ? 'index.html' : '.' + clean)
if (!file.startsWith(dist + path.sep)) { res.writeHead(403, securityHeadersFor(clean, {})); return res.end('forbidden') }
fs.readFile(file, (err, data) => {
if (err) { res.writeHead(404, securityHeadersFor(clean, {})); return res.end('not found') }
const headers = securityHeadersFor(clean, { 'content-type': mime[path.extname(file)] || 'application/octet-stream' })
res.writeHead(200, headers)
res.end(data)
})
}).catch(() => {
if (!res.headersSent) { res.writeHead(500, { 'content-type': 'text/plain; charset=utf-8' }) }
res.end('server error')
})
})
server.listen(port, '127.0.0.1', () => {
const cli = require.resolve('@playwright/test/cli')
// iwb-csp-gate.spec.js 是 CSP 门禁:它依赖本服务器下发的 _headers(尤其 Content-Security-Policy),
// 覆盖「blob: 源复制」与「大图压缩落库」两条真实链路,必须留在门禁里。
// 默认跑全部门禁 spec;调试时可用 IWB_E2E_SPECS(逗号分隔)只跑指定文件,避免每次都全量。
// iwb-import-4k.spec.js = 「导入图片(粘贴/拖放/上传)」路径契约(4K 导入 ⇒ 立即引用化 + 压缩到显示尺寸),
// 用户实测的真实缺陷驱动,必须留在门禁里(否则该路径会再次退化成"原图 base64 直入节点")。
// iwb-backup-config.spec.js = 「备份/还原里的设置完整性与往返一致」契约(用户实测:设置还原不回来),
// 覆盖导出源必须是真实设置、withKeys 两个方向、__KEEP__ 语义与未知字段保留,必须留在门禁里。
// iwb-duplicate-ws.spec.js = 「创建副本不丢连线 + 副本名唯一」契约(用户实测:复制画布丢连线、连续复制同名),
// 覆盖 画布→连线→回库→复制→打开副本 的真实链路,必须留在门禁里。
// iwb-resume-reload.spec.js = 「生图中刷新不丢需求」契约(用户实测:刷新后续跑横幅不出现),
// 覆盖 在途请求→刷新被标 failed→启动过滤 failed→recoverable→横幅→点继续重新发起 的链路,必须留在门禁里。
// iwb-tab-dot.spec.js = 「标签条圆点状态色」契约(用户需求:生成完成=绿、失败=红、切到画布清除)。
// iwb-resume-scope.spec.js = 「续跑范围不放大」契约(用户实测:单任务中断刷新后其他未启动任务也被新建→计划外计费)。
// iwb-resume-variants.spec.js = 「多变体只补缺张」契约(用户实测:4 变体完成 2 张后整任务被跳过,缺张永不补;继续只补缺失变体)。
const specOverride = String(process.env.IWB_E2E_SPECS || '').split(',').map((x) => x.trim()).filter(Boolean)
// 门禁 spec 不再手工维护:交给 scripts/list-e2e-specs.js 自动发现 tests/*.spec.js。
// 排除规则只有一条——下划线前缀(_*.spec.js = dev 探针),且该探针必须自带 iwb-dev-probe 标记,
// 否则 discoverSpecs 会抛错。"忘了把新 spec 加进清单"这种静默漏跑从此不可能发生。
let specs = specOverride
if (specs.length) {
console.log(`[serve-test] 使用 IWB_E2E_SPECS 覆盖:${specs.length} 个 spec`)
} else {
const discovered = require('./list-e2e-specs').discoverSpecs(path.join(root, 'tests'))
specs = discovered.specs
console.log(`[serve-test] 自动发现门禁 spec ${specs.length} 个${discovered.excluded.length ? `(排除 dev 探针 ${discovered.excluded.length}:${discovered.excluded.map((f) => path.basename(f)).join('、')})` : ''}`)
let pathname = '/'
try { pathname = decodeURIComponent(new URL(req.url, 'http://127.0.0.1').pathname) } catch (e) { pathname = '/' }
if (pathname.endsWith('/')) pathname += 'index.html'
let file = path.join(dist, pathname)
// 目录穿越防护:只允许 servicedir 内的文件
if (!file.startsWith(dist + path.sep)) {
res.writeHead(403, { 'content-type': 'text/plain; charset=utf-8' })
res.end('forbidden')
return
}
const child = cp.spawn(process.execPath, [cli, 'test'].concat(specs), {
cwd: root,
stdio: 'inherit',
env: { ...process.env, IWB_BASE_URL: `http://127.0.0.1:${port}` },
fs.stat(file, (err, st) => {
if (err || !st.isFile()) {
res.writeHead(404, { 'content-type': 'text/plain; charset=utf-8' })
res.end('not found')
return
}
res.writeHead(200, {
'content-type': mime[path.extname(file)] || 'application/octet-stream',
'cache-control': 'no-store',
})
fs.createReadStream(file).pipe(res)
})
child.on('exit', (code) => { server.close(() => process.exit(code == null ? 1 : code)) })
})
server.listen(port, () => {
console.log('[serve-test] serving ' + path.relative(process.cwd(), dist) + ' at http://127.0.0.1:' + port)
console.log('[serve-test] 纯静态:不再注入 _headers / 不再模拟 Pages Functions(项目已转为桌面客户端)')
})
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env node
/* set-doc-anchor.js —— 把架构文档的基线锚点写成「最近一次 bump 版本的提交」
*
* 用法:node scripts/set-doc-anchor.js <version> <sha>
* 只改 docs/standards/architecture-current-state.md 的两处:
* main = <sha>
* 线上 `vX.Y.Z+<sha>`
* 返回:0=已更新 / 2=没有变化 / 1=文件缺失
*/
const fs = require('fs')
const path = require('path')
const ver = String(process.argv[2] || '')
const sha = String(process.argv[3] || '')
const file = path.join(__dirname, '..', 'docs', 'standards', 'architecture-current-state.md')
if (!ver || !sha) { console.error('用法: set-doc-anchor.js <version> <sha>'); process.exit(1) }
if (!fs.existsSync(file)) { console.error('缺少 ' + file); process.exit(1) }
const bt = String.fromCharCode(96)
const before = fs.readFileSync(file, 'utf8')
let after = before.replace(
new RegExp(bt + 'main = [0-9a-f]+' + bt),
bt + 'main = ' + sha + bt,
)
after = after.replace(
new RegExp('线上 ' + bt + 'v[0-9.]+[^' + bt + ']*' + bt),
'线上 ' + bt + 'v' + ver + '+' + sha + bt,
)
if (after === before) { console.log('anchor unchanged (' + sha + ')'); process.exit(2) }
fs.writeFileSync(file, after)
console.log('anchor -> ' + sha + ' (v' + ver + ')')
+18 -3
View File
@@ -2,12 +2,27 @@
'use strict'
// 桌面版打包前清掉 dist/plugins/:插件不再随应用发布,全部从市场安装到 <资料目录>/plugins/。
// 保留 plugins/ 目录本身是给 scripts/gen-market.js(市场产物)用的,不进安装包。
//
// 为什么用 rename 而不是 rmSync:build.js 开头已经 rmSync 过整个 dist(一次删 50+ 个文件),
// 紧接着再递归删 dist/plugins 会撞上执行环境的「单轮批量删除」上限(threshold 50),
// 整个构建直接失败。rename 不产生删除操作,同样能让这个目录从打包路径里消失。
const fs = require('fs')
const os = require('os')
const path = require('path')
const dir = path.resolve(__dirname, '..', 'dist', 'plugins')
if (fs.existsSync(dir)) {
fs.rmSync(dir, { recursive: true, force: true })
console.log('[strip-plugins] 已移除 dist/plugins(插件改由市场安装)')
const trash = path.join(os.tmpdir(), 'iwb-plugin-strip-' + Date.now())
try {
fs.renameSync(dir, trash)
console.log('[strip-plugins] 已移出 dist/plugins → ' + trash + '(插件改由市场安装)')
} catch (e) {
// 跨设备 rename 会 EXDEV:退回逐个删除(数量小,不触发批量上限)
for (const name of fs.readdirSync(dir)) {
try { fs.unlinkSync(path.join(dir, name)) } catch (e2) { /* 单个失败不影响打包 */ }
}
try { fs.rmdirSync(dir) } catch (e2) { /* 同上 */ }
console.log('[strip-plugins] 已逐个清空 dist/plugins(插件改由市场安装)')
}
} else {
console.log('[strip-plugins] dist/plugins 不存在,跳过')
}
}
+58 -2
View File
@@ -10,7 +10,19 @@ const crypto = require('crypto')
const root = path.resolve(__dirname, '..')
const srcRoot = process.argv[2] ? path.resolve(process.argv[2]) : path.resolve(root, '..', 'iwb-plugins-desktop')
const outDir = path.join(root, 'plugins', 'runtime')
const IDS = ['batch-export', 'blank-canvas', 'image-annotate', 'image-vectorize', 'style-source', 'white-bg-800', 'xianyi-cutout']
const IDS = ['batch-export', 'blank-canvas', 'browser', 'gallery', 'grouplib', 'promptlib', 'image-annotate', 'image-vectorize', 'style-source', 'white-bg-800', 'xianyi-cutout']
// v3.25.41(M1):目录化插件试点 —— 这些 id 产出 <id>/{manifest.json,main.js},其余仍是单文件(双轨兼容)
// ⚠️ 2026-11-20 修正:桌面包不随包发插件(scripts/strip-plugins.js),插件只能从市场装,
// 而市场目前只支持单文件 ⇒ 目录形态暂不用于生产插件,等 M3(zip 安装)落地再启用。
// 目录形态(plugins/<id>/{manifest.json,main.js[,styles.css]})的手写插件。
// 注意:源仓里存在 <id>/styles.css 的插件会**自动**走目录形态 —— 单文件产物带不走样式,
// 若不同步成目录,插件自带样式会被静默忽略(v1.0.3 grouplib 换行样式的坑)。
const FOLDER_IDS = ['gallery']
// 刻意不随客户端/市场发布的插件(开发者直装):
// ai-chat —— 依赖本机 Magpie(3425) + 需宿主 CSP 放行,上架会让多数用户装上连不上。
// 详见 ../iwb-plugins-desktop/ai-chat/README.md「状态」一节。
const DEV_ONLY_IDS = ['ai-chat']
const sha = (buf) => crypto.createHash('sha256').update(buf).digest()
const shaHex = (buf) => sha(buf).toString('hex')
@@ -21,12 +33,56 @@ fs.mkdirSync(outDir, { recursive: true })
const manifest = []
let copied = 0, changed = 0
const metaAll = (() => { try { return JSON.parse(fs.readFileSync(path.join(root, 'plugins', 'meta.json'), 'utf8')) } catch (e) { return {} } })()
for (const id of IDS) {
const artifact = path.join(srcRoot, id, 'src', 'index.js')
if (!fs.existsSync(artifact)) { console.warn('跳过 ' + id + '(无 ' + artifact + ')'); continue }
const buf = fs.readFileSync(artifact)
const name = 'plugin-' + id + '.' + shaHex(buf).slice(0, 12) + '.js'
const pkg = JSON.parse(fs.readFileSync(path.join(srcRoot, id, 'package.json'), 'utf8'))
const folderMode = FOLDER_IDS.indexOf(id) >= 0 || fs.existsSync(path.join(srcRoot, id, 'styles.css'))
if (folderMode) {
// 目录形态:plugins/<id>/{manifest.json,main.js}
const dir = path.join(root, 'plugins', id)
fs.mkdirSync(dir, { recursive: true })
const mainPath = path.join(dir, 'main.js')
if (!fs.existsSync(mainPath) || shaHex(fs.readFileSync(mainPath)) !== shaHex(buf)) { fs.writeFileSync(mainPath, buf); copied++ }
const meta = metaAll[id] || {}
// 可选 styles.css:插件自带样式(宿主 CSS 只在客户端发版时更新,视觉调整走插件更灵活)
const files = { 'main.js': shaHex(buf) }
let styleName = ''
const styleSrc = path.join(srcRoot, id, 'styles.css')
if (fs.existsSync(styleSrc)) {
const sbuf = fs.readFileSync(styleSrc)
const styleDest = path.join(dir, 'styles.css')
if (!fs.existsSync(styleDest) || shaHex(fs.readFileSync(styleDest)) !== shaHex(sbuf)) { fs.writeFileSync(styleDest, sbuf); copied++ }
styleName = 'styles.css'
files['styles.css'] = shaHex(sbuf)
}
const manifestJson = {
id: id,
name: meta.name || id,
version: pkg.version,
apiVersion: Number((pkg.ibwPlugin && pkg.ibwPlugin.apiVersion) || 1),
main: 'main.js',
...(styleName ? { style: styleName } : {}),
description: meta.desc || '',
author: meta.author || 'official',
icon: meta.icon || '',
tags: Array.isArray(meta.tags) ? meta.tags : [],
files: files,
}
fs.writeFileSync(path.join(dir, 'manifest.json'), JSON.stringify(manifestJson, null, 2) + '\n')
// 同 id 的旧单文件产物清理(目录优先,留着会造成两份)
for (const old of fs.readdirSync(outDir)) {
if (old.indexOf('plugin-' + id + '.') === 0) { fs.unlinkSync(path.join(outDir, old)); changed++ }
}
manifest.push({ id: id, dir: id, main: 'main.js', style: manifestJson.style || '', version: pkg.version, files: manifestJson.files })
console.log(id.padEnd(16), pkg.version.padEnd(8), 'dir/' + id + '/main.js')
continue
}
const name = 'plugin-' + id + '.' + shaHex(buf).slice(0, 12) + '.js'
for (const old of fs.readdirSync(outDir)) {
if (old.indexOf('plugin-' + id + '.') === 0 && old !== name) { fs.unlinkSync(path.join(outDir, old)); changed++ }
}
+5
View File
@@ -26,6 +26,11 @@ rel.platforms[args.platform] = {
file: args.file,
size: Number(args.size),
sha256: args.sha256,
// 内容指纹(sha256 前 12 位)。站点生成器会把它拼成 `?h=<指纹>` 加在下载链接上:
// Cloudflare 对 /updates/*.dmg 是 max-age=14400 的强缓存,同名文件重新上传后
// 4 小时内仍返回旧字节 —— 2026-11-18 真实发生:包已换、下载页 sha256 与实际不符。
// 版本号不变而字节变了(重封包/热修)时,指纹变 ⇒ URL 变 ⇒ 必然回源。
h: String(args.sha256 || '').slice(0, 12),
kind: path.extname(args.file).replace('.', '') || 'bin',
}
data.updatedAt = new Date().toISOString()
+367 -7
View File
@@ -54,13 +54,13 @@
<h2>下载</h2>
<div class="row">
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
<div class="meta">版本 3.25.3 · 7.3 MB · .dmg<div class="hash">sha256 fd05bf1a186574c6…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.3_aarch64.dmg">下载</a>
<div class="meta">版本 3.26.37 · 8.4 MB · .dmg<div class="hash">sha256 66abb4cfd7714ac3…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.37_aarch64.dmg?h=66abb4cfd771">下载</a>
</div>
<div class="row">
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
<div class="meta">版本 3.25.3 · 7.6 MB · .dmg<div class="hash">sha256 00388a79069f9a78…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.3_x64.dmg">下载</a>
<div class="meta">版本 3.26.37 · 8.8 MB · .dmg<div class="hash">sha256 c560d101175247d3…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.37_x64.dmg?h=c560d1011752">下载</a>
</div>
<div class="row">
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
@@ -95,8 +95,368 @@
<h2>历史版本</h2>
<div class="row">
<div class="name">3.25.3<div class="hint">Intel 版:剪贴板修复</div></div>
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
<div class="name">3.26.37<div class="hint">Intel 版:同一版本</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.35<div class="hint">Intel 版:同一改进</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.34<div class="hint">Intel 版:同一优化</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.33<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.32<div class="hint">Intel 版:同一合并</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.31<div class="hint">Intel 版:同一合并</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.30<div class="hint">Intel 版:同一合并</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.29<div class="hint">Intel 版:同一合并</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.28<div class="hint">Intel 版:同一清理</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.27<div class="hint">Intel 版:同一交互</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.26<div class="hint">Intel 版:同一交互</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.25<div class="hint">Intel 版:同一优化</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.24<div class="hint">Intel 版:同一设计</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.23<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.22<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.21<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.20<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.18<div class="hint">Intel 版:同一布局逻辑</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.17<div class="hint">Intel 版:同一布局修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.16<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.15<div class="hint">Intel 版:同一调整</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.14<div class="hint">Intel 版:同一调整</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.13<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.12<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.10<div class="hint">Intel 版:同一回退</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.5<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.4<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.3<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.2<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.1<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.0<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.99<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.98<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.97<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.96<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.94<div class="hint">Intel 版:同一回滚</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.88<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.87<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.86<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.85<div class="hint">Intel 版:同一批改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.84<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.83<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.82<div class="hint">Intel 版:同一批调整</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.81<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.80<div class="hint">Intel 版:同一批改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.79<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.76<div class="hint">Intel 版:同一批改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.74<div class="hint">Intel 版:同一批改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.73<div class="hint">Intel 版:同一批缩略图改造</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.72<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.71<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.70<div class="hint">Intel 版:同一批优化</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.69<div class="hint">Intel 版:同一批调整</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.68<div class="hint">Intel 版:同一批交互性能优化</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.67<div class="hint">Intel 版:同一批性能优化</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.66<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.64<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.62<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.60<div class="hint">Intel 版:去重 + 插件页修复 + 品牌 logo</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.59<div class="hint">Intel 版:一级导航 + 插件页 + 快捷键弹窗</div></div>
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.34<div class="hint">v3.25.34:自动下载仅在开启时才等待图库归档(未开启不拖慢出图);清理废弃字段。</div></div>
<div class="meta">2026-11-19<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.32<div class="hint">v3.25.32:修全屏工具打开时浏览器网页遮挡;win 托盘图标深色任务栏可见;三平台齐平</div></div>
<div class="meta">2026-11-19<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.31<div class="hint">v3.25.31:修 Windows 画布内嵌网页死锁;签名产物已发布,应用内检查更新可拉新版</div></div>
<div class="meta">2026-11-19<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.30<div class="hint">Windows:浏览器插件 1.5.0 配套 + 库面板浮窗可框选</div></div>
<div class="meta">2026-11-19<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.25.29<div class="hint">修画布网页压住地址栏(原生层与 DOM 的坐标原点差 32px)、内容跟随画布缩放;工具栏重做为可输入百分比的缩放设定框</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.25.28<div class="hint">恢复画布内网页节点并修好「一动就白」:取消动就藏与尺寸门槛,位置尺寸一次 set_bounds 推送</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.25.27<div class="hint">下线画布内网页节点:原生子 webview 在画布上修不干净,撤掉该功能;独立窗口浏览器不受影响</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.25.26<div class="hint">修第二个网页节点报「主窗口不存在」:get_webview_window 在有了子 webview 之后永久失效,改用 get_window</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.25.25<div class="hint">修画布内网页节点:子 webview 的 hide/show 静默失效导致一动画布网页就永久消失,改用移出窗口隐藏</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.25.24<div class="hint">画布内网页节点:网页长在画布上(原生子 webview),可拖动缩放、和参考图并排对照;browser 插件 1.1.1</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.25.23<div class="hint">应用内浏览器:独立窗口打开网页(插件 browser 1.0.0 上架市场),并修复浏览器窗口关不掉</div></div>
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon</div></div>
</div>
<div class="row">
<div class="name">3.25.22<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.21<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.20<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.19<div class="hint">Windows:工单#3 六项 + 图库下拉紧凑化</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.18<div class="hint">Intel 版:工单#3 六项</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.17<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.16<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.15<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.14<div class="hint">Intel 版:CSP 修复 + 外观 tab</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.13<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.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>
@@ -116,7 +476,7 @@
</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
本页由 <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-22
</div>
</div></div>
+29 -29
View File
@@ -2,7 +2,7 @@
<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.3-mwkrnrby">
<link rel="stylesheet" href="/assets/style.css?v=3.26.37-mwrsao55">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
@@ -14,20 +14,20 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.25.3</a>
<a class="btn primary" href="/download/">下载 v3.26.37</a>
</div>
</div></nav>
<main>
<section class="hero hero-art">
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.3-mwkrnrby" alt=""></div>
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.37-mwrsao55" alt=""></div>
<div class="hero-veil"></div>
<div class="wrap">
<span class="kicker">v3.25.3 · macOS / Windows · 数据在本地</span>
<span class="kicker">v3.26.37 · macOS / Windows · 数据在本地</span>
<h1>本地优先的<br>AI 生图无限画布</h1>
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
<div class="cta">
<a class="btn primary lg" href="/download/">下载 v3.25.3</a>
<a class="btn lg" href="/plugins/">浏览 7 个插件</a>
<a class="btn primary lg" href="/download/">下载 v3.26.37</a>
<a class="btn lg" href="/plugins/">浏览 11 个插件</a>
</div>
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
</div></section>
@@ -62,39 +62,39 @@
<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 class="pcard" data-name="应用内浏览器 browser 库面板内置真实浏览器:书签按分组管理、拖动排序;地址栏 ↗ 可把当前页放到画布节点 浏览器 效率" data-tags="浏览器,效率">
<div class="head"><span class="av" style="background:#eaf1fb">🌐</span>
<div><div class="nm">应用内浏览器</div><div class="ver">v1.7.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-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 class="pcard" data-name="图库 gallery 右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供) 资源 图库" data-tags="资源,图库">
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
<div><div class="nm">图库</div><div class="ver">v1.6.9 · 官方</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="风格库 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 class="pcard" data-name="节点组 grouplib 左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供) 资源 节点组" data-tags="资源,节点组">
<div class="head"><span class="av" style="background:#eef2f6">📦</span>
<div><div class="nm">节点组</div><div class="ver">v1.0.4 · 官方</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 class="pcard" data-name="提示词库 promptlib 右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供) 资源 提示词" data-tags="资源,提示词">
<div class="head"><span class="av" style="background:#eef2f6">📖</span>
<div><div class="nm">提示词库</div><div class="ver">v1.6.6 · 官方</div></div></div>
<div class="desc">右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)</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 style="margin-top:22px"><a class="btn" href="/plugins/">查看全部 11 个插件</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.3_aarch64.dmg"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 7.3 MB · .dmg</div></a>
<a href="/updates/darwin-x86_64/image-workbench_3.25.3_x64.dmg"><div class="n">macOS · Intel</div><div class="s">x86_64 · 7.6 MB · .dmg</div></a>
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.37_aarch64.dmg?h=66abb4cfd771"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
<a href="/updates/darwin-x86_64/image-workbench_3.26.37_x64.dmg?h=c560d1011752"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
<div class="none"><div class="n">Windows · x64</div><div class="s">暂未提供</div></div></div>
<div style="margin-top:20px;color:#9ca3af;font-size:12.5px">安装包未做 Apple 公证 / Windows 代码签名,首次打开需手动放行一次,细节见 <a href="/download/" style="text-decoration:underline">下载页</a>。</div>
</div></section>
+252 -12
View File
@@ -1,6 +1,6 @@
{
"version": 1,
"updatedAt": "2026-11-17T13:04:29.617Z",
"version": 2,
"updatedAt": "2026-11-22T11:55:55.306Z",
"plugins": [
{
"id": "batch-export",
@@ -15,6 +15,21 @@
],
"version": "1.2.0",
"apiVersion": 1,
"bundle": "plugins/batch-export-1.2.0.zip",
"bundleSize": 44936,
"bundleSha256": "338cfbe8fe00e92771f60f996d6a4baeb3c3b4954dfe774cfe83879639234552",
"files": [
{
"path": "manifest.json",
"sha256": "163e5de559a6907982749cdf5fbf7372b492ab30096a5bb935315e002fb1c7a5",
"size": 393
},
{
"path": "main.js",
"sha256": "b7d13ba66cf97ff65e94305328183a1a3b5a45b0393f3a63f77f6b7b46795389",
"size": 44329
}
],
"file": "plugins/plugin-batch-export.b7d13ba66cf9.js",
"size": 44329,
"sha256": "b7d13ba66cf97ff65e94305328183a1a3b5a45b0393f3a63f77f6b7b46795389",
@@ -33,11 +48,161 @@
],
"version": "1.0.0",
"apiVersion": 1,
"bundle": "plugins/blank-canvas-1.0.0.zip",
"bundleSize": 6674,
"bundleSha256": "b6bb7f37d7ae1ed5c0e19dacbae0050cf42b88dcdb6151385fd799443176ed7d",
"files": [
{
"path": "manifest.json",
"sha256": "4ce80b37f07f900efaeddd68ef5379b755433555e4bdab222adbac509c2a21a6",
"size": 366
},
{
"path": "main.js",
"sha256": "67763893fa99c8fe1d8bcf640426f5bbc576abd35bcdc84c910b7b08f79964f9",
"size": 6094
}
],
"file": "plugins/plugin-blank-canvas.67763893fa99.js",
"size": 6094,
"sha256": "67763893fa99c8fe1d8bcf640426f5bbc576abd35bcdc84c910b7b08f79964f9",
"integrity": "sha256-Z3Y4k/qZyP4di89kBCb1u8V2q9NbzchMkQt7CPeZZPk="
},
{
"id": "browser",
"name": "应用内浏览器",
"desc": "库面板内置真实浏览器:书签按分组管理、拖动排序;地址栏 ↗ 可把当前页放到画布节点",
"author": "official",
"icon": "🌐",
"color": "#eaf1fb",
"tags": [
"浏览器",
"效率"
],
"version": "1.7.0",
"apiVersion": 1,
"bundle": "plugins/browser-1.7.0.zip",
"bundleSize": 60839,
"bundleSha256": "8a802986f075774c941a7309eeb0f36e870c318aa9535d263da523c12f37d975",
"files": [
{
"path": "manifest.json",
"sha256": "4dc8e8d883e900779932310c74947bcb2e505ac91167275becbf9f1685afdc48",
"size": 445
},
{
"path": "main.js",
"sha256": "8161a82890d96724d90a2ae9c8949d37af92f94b944cd525adc07b65b5eab4f4",
"size": 60180
}
],
"file": "plugins/plugin-browser.8161a82890d9.js",
"size": 60180,
"sha256": "8161a82890d96724d90a2ae9c8949d37af92f94b944cd525adc07b65b5eab4f4",
"integrity": "sha256-gWGoKJDZZyTZCirpyJSdN6+S+UuUTNUlrcB7ZbXqtPQ="
},
{
"id": "gallery",
"name": "图库",
"desc": "右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)",
"author": "official",
"icon": "🖼️",
"color": "#eef2f6",
"tags": [
"资源",
"图库"
],
"version": "1.6.9",
"apiVersion": 1,
"bundle": "plugins/gallery-1.6.9.zip",
"bundleSize": 34272,
"bundleSha256": "9588b28fd2b2b3cc0f38ecd06fee05873474ca98867ce5b2dc5d6cc5948cf383",
"files": [
{
"path": "manifest.json",
"sha256": "0523a370d28132dcca912894929e402e9e7bac4a611be146ee075d073f26276c",
"size": 526
},
{
"path": "main.js",
"sha256": "26c7e64b3a0021c6b9514dfb84d4d2580276698222b4791cfa99f22ead66ff52",
"size": 28241
},
{
"path": "styles.css",
"sha256": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0",
"size": 5195
}
]
},
{
"id": "grouplib",
"name": "节点组",
"desc": "左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供)",
"author": "official",
"icon": "📦",
"color": "",
"tags": [
"资源",
"节点组"
],
"version": "1.0.4",
"apiVersion": 1,
"bundle": "plugins/grouplib-1.0.4.zip",
"bundleSize": 24479,
"bundleSha256": "842fd7d519bf8378b205c1c35894b8b2925e40595792fed99b1d456a2563404d",
"files": [
{
"path": "manifest.json",
"sha256": "b35b748d9e76380f8c02d04ca10e93e280d1b6386c6e0a3b55f5be2448a3c65f",
"size": 530
},
{
"path": "main.js",
"sha256": "8cb2e39f9880d49c9b9c15a1f7d62d9772170c8d0eac0faaa237bb7056af34ff",
"size": 21601
},
{
"path": "styles.css",
"sha256": "ee6e292ffebdcc1351651bf7937399128ae06e0b364624792f34111866f9355b",
"size": 2038
}
]
},
{
"id": "promptlib",
"name": "提示词库",
"desc": "右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)",
"author": "official",
"icon": "📖",
"color": "",
"tags": [
"资源",
"提示词"
],
"version": "1.6.6",
"apiVersion": 1,
"bundle": "plugins/promptlib-1.6.6.zip",
"bundleSize": 114275,
"bundleSha256": "ee3db5da55e1eeafc9795bb5cd8333063693e5d8a565e3c8eeb32bf01deea596",
"files": [
{
"path": "manifest.json",
"sha256": "7e6d1c7258901b4b9b419480ca6490cd5ad22c2efb8e9c5482302b2f6ebbd480",
"size": 540
},
{
"path": "main.js",
"sha256": "530b4bc021e0730f14505f666203c8c9c165bf9ea6bef9765ec7e9ebcda95c54",
"size": 92685
},
{
"path": "styles.css",
"sha256": "872ceeded7eb67599dfa159c86be1b1e1724f7cd1e04cae1d79d939bb0e1ebdf",
"size": 20740
}
]
},
{
"id": "image-annotate",
"name": "标注 / 修图",
@@ -51,6 +216,21 @@
],
"version": "1.20.6",
"apiVersion": 1,
"bundle": "plugins/image-annotate-1.20.6.zip",
"bundleSize": 462110,
"bundleSha256": "2653d2219d036342bc6768beb0936101e44a99d6635822d376cba3a6d663a28e",
"files": [
{
"path": "manifest.json",
"sha256": "8bdba81a4d5c5aea085699679bb7f8be8fee81cbe07ac9a7b83cdb47fc05fff0",
"size": 373
},
{
"path": "main.js",
"sha256": "7a865c7c353c3fbcaac551a8aeb5acd1bf624ca25f104db96fce493c3084b24f",
"size": 461523
}
],
"file": "plugins/plugin-image-annotate.7a865c7c353c.js",
"size": 461523,
"sha256": "7a865c7c353c3fbcaac551a8aeb5acd1bf624ca25f104db96fce493c3084b24f",
@@ -67,12 +247,27 @@
"转换",
"矢量"
],
"version": "0.4.2",
"version": "0.6.0",
"apiVersion": 1,
"file": "plugins/plugin-image-vectorize.03b5fc850c34.js",
"size": 144780,
"sha256": "03b5fc850c34ddc0996bafc367798fb60aecc9bb23b92990dd5ccc59ed74bfc9",
"integrity": "sha256-A7X8hQw03cCZa6/DZ3mPtgrsybsjuSmQ3VzMWe10v8k="
"bundle": "plugins/image-vectorize-0.6.0.zip",
"bundleSize": 145682,
"bundleSha256": "c6c36bbc56b36f19e4b91b2e8d9db62046804490a790a01b09a052adc6dec096",
"files": [
{
"path": "manifest.json",
"sha256": "4378b397d8954e3f4522c53bfff970b4d4d29ba8234501ac998bb552af03b30d",
"size": 362
},
{
"path": "main.js",
"sha256": "7014982f60e605e34909986ac0c372195e6130129e29a927d6d41a1405579e9f",
"size": 145106
}
],
"file": "plugins/plugin-image-vectorize.7014982f60e6.js",
"size": 145106,
"sha256": "7014982f60e605e34909986ac0c372195e6130129e29a927d6d41a1405579e9f",
"integrity": "sha256-cBSYL2DmBeNJCZhqwMNyGV5hMBKeKakn1tQaFAVXnp8="
},
{
"id": "style-source",
@@ -85,12 +280,27 @@
"提示词",
"风格"
],
"version": "1.3.2",
"version": "1.3.3",
"apiVersion": 1,
"file": "plugins/plugin-style-source.ee7168565a44.js",
"size": 69925,
"sha256": "ee7168565a44d49daaf300f62d5c7a106e60fba29a9e4888ff8bfd9abd2e3178",
"integrity": "sha256-7nFoVlpE1J2q8wD2LVx6EG5g+6KankiI/4v9mr0uMXg="
"bundle": "plugins/style-source-1.3.3.zip",
"bundleSize": 70634,
"bundleSha256": "a727fa70f7b195f11a4daed2febb3c5ad073da016ed292856b24127b2ba4d8c6",
"files": [
{
"path": "manifest.json",
"sha256": "d864e4943ae14764a0dcca27ebe89d877f90ff0350663a86f4d91470ed1cf2e2",
"size": 355
},
{
"path": "main.js",
"sha256": "05c108f8a63cc1c5ebb1c1d18b4ade10e971a0ee74fb135482db7597e6731f84",
"size": 70065
}
],
"file": "plugins/plugin-style-source.05c108f8a63c.js",
"size": 70065,
"sha256": "05c108f8a63cc1c5ebb1c1d18b4ade10e971a0ee74fb135482db7597e6731f84",
"integrity": "sha256-BcEI+KY8wcXrscHRi0reEOlxoO50+xNUgtt1l+ZzH4Q="
},
{
"id": "white-bg-800",
@@ -105,6 +315,21 @@
],
"version": "1.2.1",
"apiVersion": 1,
"bundle": "plugins/white-bg-800-1.2.1.zip",
"bundleSize": 15528,
"bundleSha256": "cf1c8223b0361fd362cca21af373dc0d8de95d1c58345438a3f795b0912935d1",
"files": [
{
"path": "manifest.json",
"sha256": "8347db72950a686bdb3a205906858f6f9d3f7ede6aa7c98f5cc4c159d580df06",
"size": 357
},
{
"path": "main.js",
"sha256": "a5a92f045c0d4046b205562019b2a6354afd14aa92375b78559d48f2ce9b74ee",
"size": 14957
}
],
"file": "plugins/plugin-white-bg-800.a5a92f045c0d.js",
"size": 14957,
"sha256": "a5a92f045c0d4046b205562019b2a6354afd14aa92375b78559d48f2ce9b74ee",
@@ -123,6 +348,21 @@
],
"version": "1.0.3",
"apiVersion": 1,
"bundle": "plugins/xianyi-cutout-1.0.3.zip",
"bundleSize": 5072,
"bundleSha256": "381383fdeda9a2e72f09489ecc319b7facd6236d32f82b9544fc0cd29ae0f5c1",
"files": [
{
"path": "manifest.json",
"sha256": "0bffc47c33e058b614882cb7fce41c201a5340c0f05c4f58ba28eb26dfbbc627",
"size": 370
},
{
"path": "main.js",
"sha256": "79c8c47dfc6187b8af2688763e7f63034bb26867ccefbf135ed76d3745d6e24d",
"size": 4488
}
],
"file": "plugins/plugin-xianyi-cutout.79c8c47dfc61.js",
"size": 4488,
"sha256": "79c8c47dfc6187b8af2688763e7f63034bb26867ccefbf135ed76d3745d6e24d",
+34 -6
View File
@@ -1,7 +1,7 @@
<!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.3-mwkrnrby">
<link rel="stylesheet" href="/assets/style.css?v=3.26.37-mwrsao55">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
@@ -13,13 +13,13 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.25.3</a>
<a class="btn primary" href="/download/">下载 v3.26.37</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>
<p class="sub" style="margin:14px 0 0;text-align:left;max-width:720px">共 11 个插件。安装方式:应用内 <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">
@@ -28,11 +28,15 @@
<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>
<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>
@@ -52,6 +56,30 @@
<div class="desc">新建空白画布节点,用于分区分组</div>
<div class="tags"><span class="tag">画布</span><span class="tag">效率</span></div>
</div>
<div class="pcard" data-name="应用内浏览器 browser 库面板内置真实浏览器:书签按分组管理、拖动排序;地址栏 ↗ 可把当前页放到画布节点 浏览器 效率" data-tags="浏览器,效率">
<div class="head"><span class="av" style="background:#eaf1fb">🌐</span>
<div><div class="nm">应用内浏览器</div><div class="ver">v1.7.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="图库 gallery 右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供) 资源 图库" data-tags="资源,图库">
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
<div><div class="nm">图库</div><div class="ver">v1.6.9 · 官方</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="节点组 grouplib 左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供) 资源 节点组" data-tags="资源,节点组">
<div class="head"><span class="av" style="background:#eef2f6">📦</span>
<div><div class="nm">节点组</div><div class="ver">v1.0.4 · 官方</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="提示词库 promptlib 右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供) 资源 提示词" data-tags="资源,提示词">
<div class="head"><span class="av" style="background:#eef2f6">📖</span>
<div><div class="nm">提示词库</div><div class="ver">v1.6.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-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>
@@ -60,13 +88,13 @@
</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><div class="nm">位图转矢量</div><div class="ver">v0.6.0 · 官方</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><div class="nm">风格库</div><div class="ver">v1.3.3 · 官方</div></div></div>
<div class="desc">风格提示词库与一键套用</div>
<div class="tags"><span class="tag">提示词</span><span class="tag">风格</span></div>
</div>
+1875 -2
View File
File diff suppressed because it is too large. Load diff
+550 -1
View File
@@ -84,6 +84,137 @@ dependencies = [
"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"
@@ -200,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"
@@ -422,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"
@@ -886,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"
@@ -929,6 +1109,26 @@ 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"
@@ -1076,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"
@@ -1475,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"
@@ -1764,11 +1983,13 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.25.3"
version = "3.26.37"
dependencies = [
"arboard",
"base64 0.22.1",
"image",
"log",
"objc2",
"serde",
"serde_json",
"tauri",
@@ -1777,7 +1998,10 @@ dependencies = [
"tauri-plugin-fs",
"tauri-plugin-http",
"tauri-plugin-log",
"tauri-plugin-notification",
"tauri-plugin-single-instance",
"tauri-plugin-updater",
"url",
]
[[package]]
@@ -2119,6 +2343,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"
@@ -2284,6 +2522,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"
@@ -2558,6 +2810,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"
@@ -2597,6 +2859,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"
@@ -2738,6 +3006,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"
@@ -2770,6 +3049,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"
@@ -3659,6 +3952,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"
@@ -4214,6 +4517,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"
@@ -4347,6 +4686,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"
@@ -4669,9 +5019,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"
@@ -4727,6 +5089,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"
@@ -5556,6 +5929,128 @@ 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"
@@ -5680,6 +6175,19 @@ 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"
@@ -5694,3 +6202,44 @@ 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",
]
+15 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.25.3"
version = "3.26.37"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
@@ -23,11 +23,24 @@ serde = { version = "1.0", features = ["derive"] }
log = "0.4"
# tray-icon:系统托盘(关闭窗口收进托盘而不是退出)
# tray-icon:系统托盘;image-png:托盘用单色 PNG 模板图标
tauri = { version = "2.12.5", features = ["tray-icon", "image-png"] }
# unstable:`Manager::get_window`(窗口级句柄,不受子 webview 影响)与 Window::add_child 都在它下面。
# 画布内嵌网页已下线(v3.25.27),但 get_window 仍要留着 —— save_geom/托盘/单实例都靠它,
# 且它比 get_webview_window 更稳(后者一旦窗口里有非同名 webview 就返回 None,见 v3.25.26)。
tauri = { version = "2.12.5", features = ["tray-icon", "image-png", "unstable"] }
url = "2"
tauri-plugin-log = "2"
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"
# 画布内嵌网页的圆角(2026-11-19):WKWebView 是矩形,要给它 backing layer 设
# cornerRadius/masksToBounds 只能走 Objective-C 消息。objc2 0.6 已由 tauri/wry 引入
# (Cargo.lock 里是同一个 0.6.x),这里显式依赖不会多编译一份。
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Loaded 100 of 217 files, more files were not shown because too many files have changed in this diff. Show more