Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c39873a1a | ||
|
|
fa7c866457 | ||
|
|
fc199776d9 | ||
|
|
91ab3511ea | ||
|
|
576d24f163 | ||
|
|
9283e76f1a | ||
|
|
13a34073bd | ||
|
|
aff77cef75 | ||
|
|
ac62c3bfbc | ||
|
|
8e0697d4cd | ||
|
|
2fb9511f8b | ||
|
|
fbdaf48377 | ||
|
|
99480bf9c5 | ||
|
|
2ad699b64d | ||
|
|
fabe8d7aa1 | ||
|
|
2eacf5a81d | ||
|
|
fb20c97996 | ||
|
|
67a46dd03d | ||
|
|
fe4a64f98b | ||
|
|
78f8057384 | ||
|
|
ea5aa77b9c | ||
|
|
f2c634ff38 | ||
|
|
9623d932f7 | ||
|
|
b7eb9f8c28 | ||
|
|
5dba56363a | ||
|
|
d83f7f5eef | ||
|
|
9b24749481 | ||
|
|
371f114d69 | ||
|
|
06d8551107 | ||
|
|
0bc49d4eab | ||
|
|
39d7c9e086 | ||
|
|
5aeb354043 | ||
|
|
9fa45ff7b0 | ||
|
|
1ac0877f30 | ||
|
|
398500b952 | ||
|
|
e2253e56c2 | ||
|
|
67c6128d61 | ||
|
|
3bd6b4d9ff |
No files matched your search
@@ -14,6 +14,48 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## v3.25.4(2026-11-18)复制节点贴不回来:剪贴板兜底修复
|
||||
|
||||
### 修复
|
||||
- **WKWebView 没有 `navigator.clipboard.write`** 时,`clipboard-graph.write()` 直接 return false,
|
||||
等于什么都没写进系统剪贴板 → Ctrl+C 之后 Ctrl+V 只能贴出「剪贴板里没有可粘贴的内容」。
|
||||
现在:写不了富文本就写**纯文本摘要**(navigator.writeText → 再退 Rust arboard),
|
||||
同时记住「这份摘要属于哪个 clip」;粘贴时按摘要**精确匹配**,命中就贴回节点组。
|
||||
- 新增 Rust 命令 `clipboard_write_text` / `clipboard_read_text`(arboard),Windows 同样可用。
|
||||
|
||||
### 验证
|
||||
- 单测 `tests/clipboard-graph-fallback-test.js`:无 `clipboard.write` 场景下能写原生文本且能匹配回 clip。
|
||||
|
||||
## v3.25.3(2026-11-17)桌面端剪贴板修复:复制/粘贴图片、粘贴文本为节点
|
||||
|
||||
> **状态:✅ 已发布** macOS 双架构 + Windows。
|
||||
|
||||
### 修复
|
||||
- **Cmd+C/Cmd+V 完全失效**:macOS 上 Tauri 应用没有应用菜单时,系统快捷键不会进入 WebView。
|
||||
现在补上 `Menu::default`(撤销/剪切/复制/粘贴/全选),文本粘贴为节点恢复正常。
|
||||
- **粘贴图片(Finder / 网页)**:WKWebView 的 paste 事件拿不到 Finder 复制的图片。
|
||||
新增 Rust 命令 `clipboard_read_image`(arboard),paste 无图时主动读系统剪贴板;
|
||||
另加 160ms 兜底:快捷键按下后没有 paste 事件也会尝试读图。
|
||||
- **复制图片到系统剪贴板**:`navigator.clipboard.write` / `ClipboardItem` 在 WKWebView 常不可用,
|
||||
新增 `clipboard_write_image` 原生兜底,预览复制与图库复制都走它。
|
||||
|
||||
### 新增模块
|
||||
- `src/clipboard-native.js`:RGBA ⇄ PNG Blob 转换与原生剪贴板调用(网页版自动不可用)。
|
||||
|
||||
## v3.25.2(2026-11-17)在线更新上线:应用内「检查更新 → 立即更新 → 自动重启」
|
||||
|
||||
> **状态:✅ 已发布** 双架构签名产物 + `latest.json` 更新源。
|
||||
|
||||
### 新增
|
||||
- **Tauri Updater 接入**:`tauri-plugin-updater` + `check_update`/`install_update` 两条 Rust 命令;
|
||||
设置 → 通用 → 版本与更新 里可检查、下载、安装并自动重启。
|
||||
- **签名发布**:`bundle.createUpdaterArtifacts` + minisign 密钥;`.app.tar.gz` 与 `.sig` 由
|
||||
`scripts/publish-update.sh` 一键产出并上传,同时生成双平台 `latest.json`。
|
||||
- **文档**:`docs/DESKTOP_UPDATE.md`(发布流程、密钥管理、故障排查)。
|
||||
|
||||
### 修复
|
||||
- 标注插件 v1.20.2:丢失 `mouseup` 后自动收笔 + 失焦/指针取消复位,修「画一次后画布不响应」。
|
||||
|
||||
## v3.25.1(2026-11-17)性能与数据卫生:回收 20.2MB 垃圾图片 + 图库清单去 base64(223 倍)+ 备份含插件
|
||||
|
||||
> **状态:代码已合并** 分支 `main`。Windows 安装包基于本版本构建。
|
||||
|
||||
+1
-1
@@ -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 101 个单测文件(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)
|
||||
|
||||
@@ -132,6 +132,8 @@
|
||||
marketInstalled: wMarketInstalled,
|
||||
marketInstall: wMarketInstall,
|
||||
marketUninstall: wMarketUninstall,
|
||||
clipboardReadImage: (window.IWBNativeClipboard || {}).readImage,
|
||||
clipboardWriteImage: (window.IWBNativeClipboard || {}).writeImage,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3488,9 +3490,16 @@
|
||||
// 为空 = 跟随上游,节点体把上游文本显示出来(改一个字就落进自己的 data.text)。
|
||||
function nodeInheritOf(node, nodesArr, edgesArr) {
|
||||
const own = String((node && node.data && node.data.text) || '').trim()
|
||||
if (own) return { text: '', sourceNodeId: '', more: 0, own: true }
|
||||
const info = inheritedTextOf(node && node.id, nodesArr, edgesArr)
|
||||
return { text: String(info.text || ''), sourceNodeId: String(info.sourceNodeId || ''), more: Number(info.more) || 0, own: false }
|
||||
// 关键:先查上游。没有上游就根本没有「继承/已固定」这回事(用户是纯手写)
|
||||
const info = inheritedTextOf(node && node.id, nodesArr, edgesArr) || {}
|
||||
const hasUpstream = !!(info.sourceNodeId || String(info.text || '').trim())
|
||||
const base = {
|
||||
sourceNodeId: String(info.sourceNodeId || ''),
|
||||
more: Number(info.more) || 0,
|
||||
hasUpstream: hasUpstream,
|
||||
}
|
||||
if (own) return Object.assign({ text: '', own: true }, base)
|
||||
return Object.assign({ text: String(info.text || ''), own: false }, base)
|
||||
}
|
||||
|
||||
// 纯任务构建器:只根据节点图构造 prompt/参考图任务,不修改 state、不发送请求。
|
||||
@@ -4076,6 +4085,12 @@
|
||||
async function copyImageToClipboard(srcOrBlob) {
|
||||
if (!srcOrBlob) throw wCopyError('format', W_COPY_HINT.format)
|
||||
if (!navigator.clipboard || typeof navigator.clipboard.write !== 'function' || typeof ClipboardItem === 'undefined') {
|
||||
// 桌面端兜底:WKWebView 里 ClipboardItem 常不可用,改走原生 arboard 写图片
|
||||
const D = (typeof window !== 'undefined') ? window.IWBDesktop : null
|
||||
if (D && D.clipboardWriteImage) {
|
||||
const okNative = await D.clipboardWriteImage(srcOrBlob)
|
||||
if (okNative) return srcOrBlob
|
||||
}
|
||||
throw wCopyError('unsupported', W_COPY_HINT.unsupported)
|
||||
}
|
||||
// 先转 PNG 再写剪贴板(任何输入都产出 image/png)
|
||||
@@ -4083,6 +4098,11 @@
|
||||
try {
|
||||
await navigator.clipboard.write([new ClipboardItem({ 'image/png': png })])
|
||||
} catch (err) {
|
||||
const D = (typeof window !== 'undefined') ? window.IWBDesktop : null
|
||||
if (D && D.clipboardWriteImage) {
|
||||
const okNative = await D.clipboardWriteImage(png)
|
||||
if (okNative) return png
|
||||
}
|
||||
const msg = String((err && err.message) || err)
|
||||
// 没有写权限(页面失焦/未授权)也归为「浏览器不支持剪贴板图片」一类,附浏览器原文便于排查
|
||||
throw wCopyError('unsupported', W_COPY_HINT.unsupported + '(' + msg + ')')
|
||||
@@ -7181,6 +7201,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
wsId: activeWsId, activeWsId: () => activeWsIdRef.current || activeWsId, nodes: () => refs.nodes,
|
||||
uid, findSpot, nodeW: (ty) => nodeWidth({ type: ty }), nodeH: (ty) => nodeTypeH(ty),
|
||||
pushHistory, commitCanvas, setSel, setNotice, importImage: wImportImage,
|
||||
readNativeImage: (typeof window !== 'undefined' && window.IWBDesktop && window.IWBDesktop.clipboardReadImage) ? () => window.IWBDesktop.clipboardReadImage() : null,
|
||||
})
|
||||
const onKey = (e) => {
|
||||
const t = e.target, C = window.IWBClipboardCopy, hasTxt = C && C.hasTextSelection
|
||||
@@ -7273,11 +7294,14 @@ const tbCenterSeed = (type, refs) => {
|
||||
const onPaste = (e) => {
|
||||
const t = e.target, editable = !!(t && t.tagName && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.tagName === 'SELECT' || t.isContentEditable))
|
||||
refs.pasteProbe = 0 // 收到真实 paste → 取消「系统剪贴板为空」的提示
|
||||
refs.pasteStamp = (refs.pasteStamp || 0) + 1
|
||||
const mod = (typeof window !== 'undefined' && window.IWBClipboardPaste) || null
|
||||
if (mod) mod.handle(e, pasteCtx(), editable)
|
||||
}
|
||||
window.addEventListener('keydown', onKey)
|
||||
window.addEventListener('keyup', onKeyUp)
|
||||
const pasteModEarly = (typeof window !== 'undefined' && window.IWBClipboardPaste) || null
|
||||
if (pasteModEarly && pasteModEarly.bindHotkeyFallback) pasteModEarly.bindHotkeyFallback(pasteCtx)
|
||||
window.addEventListener('paste', onPaste)
|
||||
window.addEventListener('blur', onBlur)
|
||||
return () => {
|
||||
@@ -8550,6 +8574,15 @@ items.push(el('button', { key: 'bgc', className: 'iwb-ctx-item', onClick: (e) =>
|
||||
const r = PluginHost && typeof PluginHost.setEnabled === 'function' ? PluginHost.setEnabled(id, true) : null
|
||||
return r && r.ok ? { ok: true } : { ok: false, error: (r && r.error) || '启用失败' }
|
||||
}
|
||||
// 后台预热市场索引:设置页打开时直接命中缓存(网络慢也不影响首屏)
|
||||
function wWarmMarketCache() {
|
||||
try {
|
||||
setTimeout(function () {
|
||||
try { const p = wMarketList(); if (p && typeof p.catch === 'function') p.catch(function () { /* 离线也正常 */ }) } catch (e) { /* ignore */ }
|
||||
}, 2500)
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
|
||||
async function wLoadRuntimePlugins() {
|
||||
if (typeof fetch !== 'function' || typeof document === 'undefined') return
|
||||
// 内置清单(随包)先读;外部清单(<资料目录>/plugins/)只覆盖同 id 的条目 —— 合并而非替换
|
||||
@@ -8579,6 +8612,14 @@ items.push(el('button', { key: 'bgc', className: 'iwb-ctx-item', onClick: (e) =>
|
||||
}
|
||||
} catch (e) { /* 开发者模式读取失败不影响启动 */ }
|
||||
for (const e of ext) { const id = String((e && e.id) || ''); if (id) byId.set(id, Object.assign({}, e, { source: 'external' })) }
|
||||
// 关键:加载前先快照「用户关掉过哪些插件」,加载过程绝不能覆盖这个状态
|
||||
let persistedState = {}
|
||||
try {
|
||||
const F = (typeof window !== 'undefined') ? window.IWBStorageFile : null
|
||||
if (F && typeof F.ready === 'function') { try { await F.ready({ wizard: false }) } catch (e) { /* 已就绪 */ } }
|
||||
const v = lsGet('iwb_plugins', {})
|
||||
persistedState = (v && typeof v === 'object') ? v : {}
|
||||
} catch (e) { persistedState = {} }
|
||||
const manifest = Array.from(byId.values())
|
||||
if (!manifest.length) return
|
||||
const list = Array.isArray(manifest) ? manifest : (manifest && Array.isArray(manifest.plugins) ? manifest.plugins : [])
|
||||
@@ -8600,10 +8641,28 @@ items.push(el('button', { key: 'bgc', className: 'iwb-ctx-item', onClick: (e) =>
|
||||
// 只下载已启用的;未启用记 idle(不注入脚本),插件管理里勾选时经 wEnsurePluginLoaded 按需下载
|
||||
// 收进 pending 而非逐个 await:wLoadPluginEntry 在首个 await 前已 append ⇒ 并发抓取;async=false 保证执行顺序不变(冷启动 3 RTT → 1)
|
||||
// 本地开发插件默认启用(没有持久化状态,不应被当作已关闭的插件)
|
||||
if (PluginHost && typeof PluginHost.isEnabled === 'function' && (isLocalEntry || PluginHost.isEnabled(id))) pending.push(isLocalEntry ? wLoadLocalPluginEntry(record) : (isExt ? wLoadExternalPluginEntry(record) : wLoadPluginEntry(record)))
|
||||
// 一律加载脚本(注册 ≠ 启用):脚本注册后才能被开关随时启停;
|
||||
// 之前按 enabled 预筛,导致状态里残留 false 的插件永远进不了注册表,开关也打不开。
|
||||
if (PluginHost) pending.push(isLocalEntry ? wLoadLocalPluginEntry(record) : (isExt ? wLoadExternalPluginEntry(record) : wLoadPluginEntry(record)))
|
||||
else record.status = 'idle'
|
||||
}
|
||||
await Promise.all(pending)
|
||||
// 脚本都注册了:把持久化里明确关掉的插件停用(其余保持启用)
|
||||
try {
|
||||
const st = persistedState || {}
|
||||
for (const r of (wRuntimePlugins || [])) {
|
||||
if (!r || r.status !== 'loaded') continue
|
||||
const rec = st[r.id]
|
||||
if (!rec) continue
|
||||
const want = rec.enabled !== false
|
||||
if (!PluginHost || typeof PluginHost.setEnabled !== 'function') continue
|
||||
// 注意:插件是在 init() 之后才注册的,init 的"激活已启用项"覆盖不到它们。
|
||||
// 所以这里对 want=true 一律再 setEnabled(true)(activate 幂等:已激活会返回 already),
|
||||
// 否则会出现"开关显示已启用、实际没跑工厂函数"的假启用状态。
|
||||
if (want) PluginHost.setEnabled(r.id, true)
|
||||
else if (typeof PluginHost.isEnabled === 'function' && PluginHost.isEnabled(r.id)) PluginHost.setEnabled(r.id, false)
|
||||
}
|
||||
} catch (e) { /* 状态应用失败不影响加载 */ }
|
||||
try { lsSet('iwb_plugin_load_status', JSON.stringify(wRuntimePlugins.map((r) => ({ id: r.id, status: r.status, source: r.source, error: r.error || '' })))) } catch (e2) { /* probe */ }
|
||||
try { if (PluginHost && typeof PluginHost.emit === 'function') PluginHost.emit('runtime-plugins-loaded') } catch (e) { /* 通知失败不影响启动 */ }
|
||||
}
|
||||
@@ -8790,6 +8849,7 @@ items.push(el('button', { key: 'bgc', className: 'iwb-ctx-item', onClick: (e) =>
|
||||
}
|
||||
} catch (e) { /* 预注册失败不影响启动 */ }
|
||||
wLoadRuntimePlugins()
|
||||
wWarmMarketCache()
|
||||
}
|
||||
// 桌面端关闭图库定时清理(设置里已去掉该项):0 = 不限,避免老图被静默删掉
|
||||
try {
|
||||
|
||||
+46
-62
@@ -1,82 +1,66 @@
|
||||
# 桌面版在线更新:方案与落地清单(2026-11-17)
|
||||
# 在线更新(Tauri Updater)
|
||||
|
||||
> 现状:设置 → 通用 已有「版本与更新」区块(版本号 + 「检查更新」按钮)。
|
||||
> 按钮会检测 `window.__TAURI__.updater`;插件装上并配好更新源后自动生效,现在点它只会提示"尚未启用"。
|
||||
> 目标:用户装过一次之后,以后新版本在应用内点「检查更新」即可升级,不用再手动下载 dmg。
|
||||
|
||||
## 一、三种方案
|
||||
## 一、已经配好的东西
|
||||
|
||||
| 方案 | 用户体验 | 需要什么 | 适合 |
|
||||
|---|---|---|---|
|
||||
| **A. Tauri 官方 updater** | 应用内检查→下载→自动替换→重启 | 更新源(HTTPS 静态) + 一对签名密钥 + 发布流程 | 要发给别人 |
|
||||
| B. 手动下载 | 去网盘/Release 下新包替换 | 一个能放包的地方 | 自用、低频 |
|
||||
| C. 只提示(自研检查) | 提示"有新版本"+下载链接,不自动装 | 一个 version.json | 轻量折中 |
|
||||
| 组件 | 位置 | 说明 |
|
||||
|---|---|---|
|
||||
| 更新插件 | `src-tauri/Cargo.toml` → `tauri-plugin-updater` | Rust 侧用 `UpdaterExt` |
|
||||
| 更新源 | `src-tauri/tauri.conf.json` → `plugins.updater.endpoints` | `https://download.maqiart.eu.org/updates/latest.json` |
|
||||
| 签名公钥 | 同上 `plugins.updater.pubkey` | 私钥在 `~/.config/iwb-updater.key`(**务必备份**) |
|
||||
| 产物开关 | `bundle.createUpdaterArtifacts: true` | 构建 app 时额外产出 `.app.tar.gz` + `.sig` |
|
||||
| Rust 命令 | `check_update` / `install_update` | 前端通过 `__TAURI__.core.invoke` 调用 |
|
||||
| 前端入口 | 设置 → 通用 → 版本与更新 | 「检查更新」→「立即更新」→ 自动重启 |
|
||||
|
||||
**建议**:现在自用 → 先做 **C**(零密钥、能及时知道);要发给别人再升 A。
|
||||
## 二、发新版本(一条命令)
|
||||
|
||||
## 二、A 方案要素
|
||||
|
||||
### 1. 依赖
|
||||
```bash
|
||||
# Cargo.toml: tauri-plugin-updater = "2"
|
||||
npm i @tauri-apps/plugin-updater
|
||||
./scripts/publish-update.sh 3.25.3 # 改版本 + 双架构签名构建 + 上传 + 生成 latest.json
|
||||
```
|
||||
lib.rs: `.plugin(tauri_plugin_updater::Builder::new().build())`;capabilities 加 `"updater:default"`
|
||||
|
||||
### 2. 签名密钥(一次生成,永久保管)
|
||||
```bash
|
||||
npx tauri signer generate -w ~/.tauri/image-workbench.key
|
||||
```
|
||||
私钥绝不进仓库;公钥写进 `plugins.updater.pubkey`。
|
||||
**丢了私钥 = 老用户永远收不到更新。**
|
||||
脚本会做四件事:
|
||||
|
||||
1. `npx tauri build --bundles app,dmg`(arm64,带签名)
|
||||
2. `npx tauri build --target x86_64-apple-darwin --bundles app,dmg`(Intel,带签名)
|
||||
3. 上传 `*.app.tar.gz` / `.sig` / `.dmg` 到 NAS `updates/darwin-{aarch64,x86_64}/`
|
||||
4. 生成并上传 `updates/latest.json`(两个平台各自带 signature + url)
|
||||
|
||||
## 三、latest.json 格式(脚本自动生成)
|
||||
|
||||
### 3. 配置
|
||||
```json
|
||||
{
|
||||
"plugins": { "updater": {
|
||||
"pubkey": "<公钥>",
|
||||
"endpoints": ["https://<域名>/image-workbench/latest.json"]
|
||||
} },
|
||||
"bundle": { "createUpdaterArtifacts": true }
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 清单 latest.json
|
||||
```json
|
||||
{
|
||||
"version": "3.25.0",
|
||||
"notes": "…",
|
||||
"pub_date": "2026-11-17T10:00:00Z",
|
||||
"version": "3.25.2",
|
||||
"notes": "更新说明",
|
||||
"pub_date": "2026-11-17T09:43:08.117Z",
|
||||
"platforms": {
|
||||
"darwin-aarch64": { "signature": "<sig>", "url": "…app.tar.gz" },
|
||||
"windows-x86_64": { "signature": "<sig>", "url": "…nsis.zip" }
|
||||
"darwin-aarch64": { "signature": "<.sig 内容>", "url": "https://.../image-workbench_3.25.2_aarch64.app.tar.gz" },
|
||||
"darwin-x86_64": { "signature": "<.sig 内容>", "url": "https://.../image-workbench_3.25.2_x64.app.tar.gz" }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 5. 构建带签名
|
||||
```bash
|
||||
TAURI_SIGNING_PRIVATE_KEY=... TAURI_SIGNING_PRIVATE_KEY_PASSWORD=... npm run app:build
|
||||
```
|
||||
产出 `*.app.tar.gz(.sig)` / `*.nsis.zip(.sig)`,与清单一起上传。
|
||||
⚠️ **两个平台都要有**:缺哪个平台,那个平台的用户就永远「已是最新」。
|
||||
|
||||
### 6. 托管选择
|
||||
| 位置 | 可行 | 注意 |
|
||||
|---|---|---|
|
||||
| GitHub Releases | ✅ | 私有库资产需匿名可读 |
|
||||
| Cloudflare R2/Pages | ✅ | 公开读 + HTTPS |
|
||||
| 飞牛 NAS / Gitea | ⚠️ | 必须公网 HTTPS 且免鉴权;私有库要 token ⇒ 不可用 |
|
||||
## 四、用户侧流程
|
||||
|
||||
## 三、现在就该定的事
|
||||
1. 版本号三处一致(tauri.conf / Cargo / package.json),每次发布递增
|
||||
2. macOS 要出 aarch64 + x64 两套;Windows 出 x64
|
||||
3. 私钥本机签还是 CI 签
|
||||
1. 装过任一 3.25.2+ 版本(这是第一个带更新器的版本)
|
||||
2. 设置 → 通用 → 版本与更新 → **检查更新**
|
||||
3. 有新版本 → 显示版本号与说明 → 点「立即更新」
|
||||
4. 自动下载、校验签名、替换、重启(数据目录不受影响)
|
||||
|
||||
## 四、C 方案(建议先做)
|
||||
1. 静态放 `version.json`:`{version, notes, url}`
|
||||
2. 「检查更新」改成 HTTP GET 比对版本,有新版给下载链接
|
||||
3. 零密钥、零签名、不影响安装包
|
||||
## 五、注意
|
||||
|
||||
## 五、现状
|
||||
- ✅ 通用页已显示版本号 + 检查更新按钮
|
||||
- ⬜ 待你定:A 还是 C
|
||||
- 提醒:未签名的 macOS 应用即使更新成功,首次打开仍有 Gatekeeper 提示;要消除需 Apple Developer ID($99/年),不影响自用。
|
||||
- **私钥丢了就不能再发更新**(签名对不上,所有旧客户端会拒绝安装)。备份 `~/.config/iwb-updater.key`
|
||||
- 公钥写在 `tauri.conf.json` 里进了仓库;私钥**绝不能**进仓库
|
||||
- macOS 未做 notarization:更新替换后仍是未签名 app,首次打开可能仍要右键→打开
|
||||
- Windows 将来出包时,在 latest.json 里加 `windows-x86_64`,并在 `bundle.targets` 里用 `nsis`(msi 不支持 updater)
|
||||
- Cloudflare 会缓存 404:新文件名第一次访问可能短暂 404,换文件名(内容变即哈希变)即可绕过
|
||||
|
||||
## 六、首次接入清单(已完成 2026-11-17)
|
||||
|
||||
- [x] 生成密钥对(`tauri signer generate`),公钥进 config,私钥留本机
|
||||
- [x] 加 `tauri-plugin-updater`,注册 `check_update` / `install_update`
|
||||
- [x] `createUpdaterArtifacts: true`
|
||||
- [x] 构建 3.25.2(arm + Intel)并发布 latest.json
|
||||
- [ ] 用户实测:装 3.25.2 后,3.25.3 发布时能一键更新(待验证)
|
||||
@@ -1,7 +1,7 @@
|
||||
# 现状架构与性能事实基线(image-workbench-web)
|
||||
|
||||
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
|
||||
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 3f2eb03`(线上 `v3.25.1+3f2eb03` —— 线上实际运行提交是 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 = 91ab351`(线上 `v3.25.3+91ab351` —— 线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
|
||||
<!-- 2026-10-28 P1 拆分批 1:新增 src/generation-task-graph.js(5 个任务图纯函数自 app.js 迁出)
|
||||
⇒ 模块数 60→61、耦合面 51→52、sourceModules 60→61。耦合面只**新增** IWBWTaskGraph,无删除。
|
||||
2026-10-28 P1 拆分批 2:新增 src/storage-config-shape.js(9 个配置形状纯函数自 app.js 迁出)
|
||||
@@ -22,7 +22,7 @@
|
||||
- 图片**新写入主通道 = IndexedDB Blob `{__blob}` / key `imgblob_<hash>_<len>`** (A) `app.js:2143`;`{__cache}`(Cache Storage)为兜底;\`ref_\`(`app.js` 内定义的 `IDB_REF_PREFIX = 'ref_'`)为 legacy 形态 (A)。
|
||||
- 大图判定:`isBigDataUrl` = `data:` 且 `length > 3000` (A) `app.js:2018`;**画布保存保留阈值** `< 16384` 才原样保留 (A) `app.js:2182`。**两处阈值并存,含义不同**。
|
||||
- 单测是**源码契约测试**:`tests/` 目录共 **493** 处源码文本钉点(`source.includes` / `source.indexOf` / `/re/.test(source)`),分布在 **20** 个文件(其中 `iwb-v32-web-test.js` 一个就占 **407**)→ **结构性重构会先打红测试**。**该数字已由 `tests/source-text-ratchet-test.js` 的「只减不增」棘轮守门**(2026-10-20 起守卫范围从 1 个文件扩到全目录:新增任何一处源码文本钉点都会打红)。**2026-11-12 复算**(`npm run audit:pins`,v3.24.76):二分 STRUCT **417** / NAME **76**;形态 **POS 403 / NEG 87 / COUNT 3**;难度 **易 62 / 中 316 / 难 115**。钉点减法第一批(v3.24.72)把 **537 → 505**:8 条探针钉点改为「门禁内 spec 是否真的读该计数器」、5 条改为运行时断言(生产态 `window` 上无探针)、10 条改为 DOM 断言(质量档位禁用 / 传输页无三模式按钮 / 模型项 title)、4 条改为运行时对象断言(健康检查两域、策略对象冻结)、其余 9 条有同文件 DOM 等价断言或仅剩 NEG。第二批(v3.24.76)把 **505 → 493**:94-5~7 三条「多标签释放语义」(10 处正则)换成 `tests/iwb-tabs-release.spec.js` 的 3 条真 e2e,剩 1 条「消费方契约」(断言该 spec 在门禁内且 spec 源码真的读两个探针);另 2 条 `wPurgeIntent.add` 钉点改为读 `src/workspace-purge.js`。**这一批一换就查出 3 个真缺陷**(objectURL 从未释放 / 彻底删除留孤儿标签 · session / 刷新后误回收打开标签的图)—— 见 CHANGELOG v3.24.76。
|
||||
- `app.js` = 单 IIFE **8,508 行**(**双层预算**:绝对上限 8,700 / 占总源码 ≤ 40%,现 **36.8%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,998 行**(上限 **3,030**,余量 32;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **84** 个模块 / 14,607 行,`sourceModules` 84 项;v3.24.68 新增 `clipboard-graph.js`,v3.24.74 新增 `image-admit.js`,v3.24.75 新增 `image-dedupe.js`,v3.24.76 新增 `workspace-purge.js`,v3.24.79 新增 `generation-provider-ping.js`,v3.24.80 删除无调用的 `createWBFlushViewport` 17 行)。
|
||||
- `app.js` = 单 IIFE **8,508 行**(**双层预算**:绝对上限 8,700 / 占总源码 ≤ 40%,现 **36.8%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,998 行**(上限 **3,030**,余量 32;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **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 行)。
|
||||
- 门禁:`npm run verify` = `verify:ci`(`build` → `node --check app.js` → `node --check dist/app.js` → `check-dist.js` → `lint`(ESLint 正确性规则,`src/` + `app.js`,P4-16a)→ `test:unit` → `test` → `test:facts`)+ `test:e2e` (A) `package.json`。
|
||||
|
||||
## 2. 门禁与环境现状
|
||||
@@ -167,7 +167,7 @@
|
||||
- 同一张图被 3 个节点引用、hydrate 成 3 个不同 objectURL 时,preview/display 缓存各自 miss → 重复解码(与 F2 相邻)。
|
||||
- **F10|`refs.genScheduler` 是桩** (A) → 未接线,暂无运行时影响(P3)。
|
||||
- **F11|已建但未接线的模块层(2026-10-17 接线审计;2026-10-18 复核更正)** (A)
|
||||
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**84 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
|
||||
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**85 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
|
||||
- **仅被测试引用(9 模块 + 2 导出)**:`canvas-domain`、`generation-retry`、`generation-service`、`runtime-recovery-runner`、`runtime-state-bridge`、`runtime-store`、`storage-reconcile`、`storage-result`、`workspace-service`;导出 `IWBStorageHealthFactory`、`IWBPluginHostFactory`。(`storage-result` 是**存储层共享结果类型**,被 6 个存储模块读取,**非死代码**;`runtime-store` 为状态模型 epic 地基。)
|
||||
- **app.js 零引用(1 模块 + 3 导出)**:模块 `generation-controller`;导出 `IWBRuntimeMetricsFactory`、`IWBStorageRuntimeFactory`、`IWBUIComponents`。`canvas-relations` 已随 `06cf211` 删除(本文档早前把它列为"唯一可删者",实际已删)。零引用证据 = `grep -rn "<名字>" .`(排除 `node_modules|dist|vendor|test-results`)**只命中其自身赋值行**。
|
||||
- **半接线 / 未接线**:`IWBRuntimeStateBridge` **无 app.js 引用(仅测试)**;`IWBRuntimeRunContext` **已接线**(`runNode` 读取运行上下文);`IWBGenerationController` 是完整但**从未被调用**的工厂;`ModularWorkspaceStore`(`app.js` 内)是 `storage-workspace` 的**预留接线 seam**(当前无下游使用,保留);`window.IWBImageFolder` 自注册后读回(装载路径)。
|
||||
@@ -183,7 +183,7 @@
|
||||
| `storage-reconcile` | 存储对账(`createReconciler`/`check`) | 内联对账 | 存储层收口 |
|
||||
| `runtime-recovery-runner` | 执行恢复候选(`candidate`/`valid`/`run`) | 内联恢复 | 断点恢复 |
|
||||
| `canvas-domain` | 画布域模型(`commit`/`updateNode`/`deleteNodes`…) | `CanvasStore` 那一套 | Workbench 解耦(P2-9) |
|
||||
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**73** 项)与 `sourceModules` 顺序(**84** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
|
||||
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**74** 项)与 `sourceModules` 顺序(**85** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
|
||||
|
||||
## 12. 易踩的坑
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
**信任模型(必须明示)**:形态 A 的插件是**可信代码**(与核心同权限、无沙箱);启停与设置是 UX 与可维护性手段,**不是安全边界**(同 §13.27 教训:前端开关一定可被绕过)。
|
||||
|
||||
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**73** 项)与 `sourceModules` 顺序(**84** 项);新增模块、新增耦合、新增 dev 探针都**必须有意重生成对应快照**(`IWB_WRITE_BOUNDARY_SNAPSHOT=1`)。契约与行为的可执行验证在 `tests/plugin-host-test.js`(宿主单测)与 `tests/_plugin-host-probe.spec.js`(真实浏览器探针,`_` 前缀 + `iwb-dev-probe`,不进 34 门禁)。
|
||||
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**74** 项)与 `sourceModules` 顺序(**85** 项);新增模块、新增耦合、新增 dev 探针都**必须有意重生成对应快照**(`IWB_WRITE_BOUNDARY_SNAPSHOT=1`)。契约与行为的可执行验证在 `tests/plugin-host-test.js`(宿主单测)与 `tests/_plugin-host-probe.spec.js`(真实浏览器探针,`_` 前缀 + `iwb-dev-probe`,不进 34 门禁)。
|
||||
|
||||
**关键陷阱**:`normalizeNodes`(现位于 `src/canvas-normalize.js`)会**静默丢弃**不在 `NODE_H` 里的节点类型 ⇒ 新增节点类型必须先登记 `NODE_H`,否则节点一刷新就消失(§13.27 规则三的同一失败模式)。
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.25.1",
|
||||
"version": "3.25.4",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
@@ -10,7 +10,7 @@
|
||||
"app:build": "tauri build",
|
||||
"lint": "eslint src app.js",
|
||||
"test": "node tests/relay-task-graph-fixture-test.js && node tests/plugin-style-node-test.js && node tests/inherit-text-test.js && node tests/iwb-v32-web-test.js",
|
||||
"test:unit": "node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/ui-groups-sidebar-test.js && node tests/ui-lib-sidebar-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/functions-api-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-workbench-hooks-test.js",
|
||||
"test:unit": "node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/ui-groups-sidebar-test.js && node tests/ui-lib-sidebar-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/functions-api-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-workbench-hooks-test.js",
|
||||
"test:diagnostics": "node tests/runtime-diagnostics-hotpath-test.js",
|
||||
"test:facts": "node tests/architecture-facts-guard-test.js && node tests/release-records-test.js",
|
||||
"plugins:gc": "node scripts/plugins-publish.mjs --gc",
|
||||
|
||||
+3
-3
@@ -13,9 +13,9 @@
|
||||
},
|
||||
{
|
||||
"id": "image-annotate",
|
||||
"file": "plugin-image-annotate.86ccc161901c.js",
|
||||
"version": "1.20.1",
|
||||
"integrity": "sha256-hszBYZAc1qcloGHrWhXG9Z3Zc/qq0emOnlMNPUar3Pc="
|
||||
"file": "plugin-image-annotate.7a865c7c353c.js",
|
||||
"version": "1.20.6",
|
||||
"integrity": "sha256-eoZcfDU8P7yqxVGorrWs0b9iTKJfEE25b85JPDCEsk8="
|
||||
},
|
||||
{
|
||||
"id": "image-vectorize",
|
||||
|
||||
+49
-7
@@ -2,36 +2,78 @@
|
||||
"batch-export": {
|
||||
"name": "批量出图",
|
||||
"desc": "资源中心勾选节点,串行批量生成并打包 ZIP 下载",
|
||||
"author": "official"
|
||||
"author": "official",
|
||||
"icon": "🗂️",
|
||||
"color": "#e8f0fe",
|
||||
"tags": [
|
||||
"出图",
|
||||
"批处理"
|
||||
]
|
||||
},
|
||||
"blank-canvas": {
|
||||
"name": "空白画布",
|
||||
"desc": "新建空白画布节点,用于分区分组",
|
||||
"author": "official"
|
||||
"author": "official",
|
||||
"icon": "⬜",
|
||||
"color": "#eef2f6",
|
||||
"tags": [
|
||||
"画布",
|
||||
"效率"
|
||||
]
|
||||
},
|
||||
"image-annotate": {
|
||||
"name": "标注 / 修图",
|
||||
"desc": "在画布内标注、涂抹、局部重绘",
|
||||
"author": "official"
|
||||
"author": "official",
|
||||
"icon": "🖌️",
|
||||
"color": "#fdeaea",
|
||||
"tags": [
|
||||
"修图",
|
||||
"标注"
|
||||
]
|
||||
},
|
||||
"image-vectorize": {
|
||||
"name": "位图转矢量",
|
||||
"desc": "把位图转成 SVG 矢量路径",
|
||||
"author": "official"
|
||||
"author": "official",
|
||||
"icon": "✒️",
|
||||
"color": "#eaf3ea",
|
||||
"tags": [
|
||||
"转换",
|
||||
"矢量"
|
||||
]
|
||||
},
|
||||
"style-source": {
|
||||
"name": "风格库",
|
||||
"desc": "风格提示词库与一键套用",
|
||||
"author": "official"
|
||||
"author": "official",
|
||||
"icon": "🎨",
|
||||
"color": "#fdf0e6",
|
||||
"tags": [
|
||||
"提示词",
|
||||
"风格"
|
||||
]
|
||||
},
|
||||
"white-bg-800": {
|
||||
"name": "白底图",
|
||||
"desc": "批量生成电商白底图(800px)",
|
||||
"author": "official"
|
||||
"author": "official",
|
||||
"icon": "🧾",
|
||||
"color": "#eef7fb",
|
||||
"tags": [
|
||||
"电商",
|
||||
"出图"
|
||||
]
|
||||
},
|
||||
"xianyi-cutout": {
|
||||
"name": "鲜艺抠图",
|
||||
"desc": "接入鲜艺抠图模型的一键去背景",
|
||||
"author": "official"
|
||||
"author": "official",
|
||||
"icon": "✂️",
|
||||
"color": "#f3eafd",
|
||||
"tags": [
|
||||
"抠图",
|
||||
"去背景"
|
||||
]
|
||||
}
|
||||
}
|
||||
+187
-7
@@ -9,7 +9,7 @@
|
||||
var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
id: 'image-annotate',
|
||||
name: '标注 / 修图',
|
||||
version: '1.20.1',
|
||||
version: '1.20.6',
|
||||
apiVersion: 1,
|
||||
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
|
||||
settings: {
|
||||
@@ -3899,7 +3899,18 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
step: 1,
|
||||
def: () => 100,
|
||||
render: (canvas, v) => {
|
||||
if (v > 0) filterCanvas(canvas, "invert(" + v / 100 + ")");
|
||||
if (v <= 0) return;
|
||||
const k = v / 100;
|
||||
if (FILTER_SUPPORTED) {
|
||||
filterCanvas(canvas, "invert(" + k + ")");
|
||||
return;
|
||||
}
|
||||
const ok = mapPixels(canvas, (r, g, b) => [
|
||||
clamp255(r + (255 - 2 * r) * k),
|
||||
clamp255(g + (255 - 2 * g) * k),
|
||||
clamp255(b + (255 - 2 * b) * k)
|
||||
]);
|
||||
if (!ok) blendFallback(canvas, "invert", k);
|
||||
}
|
||||
},
|
||||
gray: {
|
||||
@@ -3912,7 +3923,17 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
step: 1,
|
||||
def: () => 100,
|
||||
render: (canvas, v) => {
|
||||
if (v > 0) filterCanvas(canvas, "grayscale(" + v / 100 + ")");
|
||||
if (v <= 0) return;
|
||||
const k = v / 100;
|
||||
if (FILTER_SUPPORTED) {
|
||||
filterCanvas(canvas, "grayscale(" + k + ")");
|
||||
return;
|
||||
}
|
||||
const okGray = mapPixels(canvas, (r, g, b) => {
|
||||
const y = luma(r, g, b);
|
||||
return [clamp255(r + (y - r) * k), clamp255(g + (y - g) * k), clamp255(b + (y - b) * k)];
|
||||
});
|
||||
if (!okGray) blendFallback(canvas, "gray", k);
|
||||
}
|
||||
},
|
||||
boost: {
|
||||
@@ -3927,7 +3948,20 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
render: (canvas, v) => {
|
||||
if (v <= 0) return;
|
||||
const k = v / 100;
|
||||
filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")");
|
||||
if (FILTER_SUPPORTED) {
|
||||
filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")");
|
||||
return;
|
||||
}
|
||||
const bright = 1 + 0.4 * k, contrast = 1 + 0.25 * k, sat = 1 + 0.2 * k;
|
||||
mapPixels(canvas, (r, g, b) => {
|
||||
const y = luma(r, g, b);
|
||||
const out = [r, g, b].map((c) => {
|
||||
let v2 = y + (c - y) * sat;
|
||||
v2 = (v2 - 128) * contrast + 128;
|
||||
return clamp255(v2 * bright);
|
||||
});
|
||||
return out;
|
||||
});
|
||||
}
|
||||
},
|
||||
contrast: {
|
||||
@@ -3942,7 +3976,17 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
render: (canvas, v) => {
|
||||
if (v <= 0) return;
|
||||
const k = v / 100;
|
||||
filterCanvas(canvas, "grayscale(" + k.toFixed(3) + ") contrast(" + (1 + 1.6 * k).toFixed(3) + ")");
|
||||
if (FILTER_SUPPORTED) {
|
||||
filterCanvas(canvas, "grayscale(" + k.toFixed(3) + ") contrast(" + (1 + 1.6 * k).toFixed(3) + ")");
|
||||
return;
|
||||
}
|
||||
const c = 1 + 1.6 * k;
|
||||
mapPixels(canvas, (r, g, b) => {
|
||||
const y = luma(r, g, b);
|
||||
const gray = y * k + (r + g + b) / 3 * (1 - k);
|
||||
const v2 = (gray - 128) * c + 128;
|
||||
return [clamp255(v2), clamp255(v2), clamp255(v2)];
|
||||
});
|
||||
}
|
||||
},
|
||||
soft: {
|
||||
@@ -3955,7 +3999,9 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
step: 0.5,
|
||||
def: (canvas) => softRadius(canvas),
|
||||
render: (canvas, v) => {
|
||||
if (v > 0) filterCanvas(canvas, "blur(" + v + "px)");
|
||||
if (v <= 0) return;
|
||||
if (FILTER_SUPPORTED) filterCanvas(canvas, "blur(" + v + "px)");
|
||||
else blurCanvas(canvas, v);
|
||||
}
|
||||
},
|
||||
mosaic: {
|
||||
@@ -3995,6 +4041,100 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
ctx.drawImage(tmp, 0, 0);
|
||||
ctx.restore();
|
||||
}
|
||||
var FILTER_SUPPORTED = function() {
|
||||
try {
|
||||
const src = document.createElement("canvas");
|
||||
src.width = 2;
|
||||
src.height = 2;
|
||||
const sctx = src.getContext("2d");
|
||||
sctx.fillStyle = "#ff0000";
|
||||
sctx.fillRect(0, 0, 2, 2);
|
||||
const dst = document.createElement("canvas");
|
||||
dst.width = 2;
|
||||
dst.height = 2;
|
||||
const dctx = dst.getContext("2d");
|
||||
dctx.filter = "invert(1)";
|
||||
dctx.drawImage(src, 0, 0);
|
||||
const d = dctx.getImageData(0, 0, 1, 1).data;
|
||||
return d[0] < 60 && d[1] > 180 && d[2] > 180;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}();
|
||||
function mapPixels(canvas, fn) {
|
||||
const w = canvas.width, h = canvas.height;
|
||||
if (!w || !h) return false;
|
||||
const ctx = canvas.getContext("2d", { willReadFrequently: true });
|
||||
let img;
|
||||
try {
|
||||
img = ctx.getImageData(0, 0, w, h);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
const d = img.data;
|
||||
for (let i = 0; i < d.length; i += 4) {
|
||||
if (d[i + 3] === 0) continue;
|
||||
const out = fn(d[i], d[i + 1], d[i + 2]);
|
||||
d[i] = out[0];
|
||||
d[i + 1] = out[1];
|
||||
d[i + 2] = out[2];
|
||||
}
|
||||
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
ctx.putImageData(img, 0, 0);
|
||||
return true;
|
||||
}
|
||||
function blendFallback(canvas, mode, strength) {
|
||||
const k = typeof strength === "number" ? Math.max(0, Math.min(1, strength)) : 1;
|
||||
const ctx = canvas.getContext("2d");
|
||||
const copy = document.createElement("canvas");
|
||||
copy.width = canvas.width;
|
||||
copy.height = canvas.height;
|
||||
copy.getContext("2d").drawImage(canvas, 0, 0);
|
||||
ctx.save();
|
||||
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
ctx.globalAlpha = 1;
|
||||
if (mode === "invert") {
|
||||
ctx.globalCompositeOperation = "difference";
|
||||
ctx.fillStyle = "#ffffff";
|
||||
} else {
|
||||
ctx.globalCompositeOperation = "saturation";
|
||||
ctx.fillStyle = "#808080";
|
||||
}
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
if (k < 1) {
|
||||
ctx.globalCompositeOperation = "source-over";
|
||||
ctx.globalAlpha = 1 - k;
|
||||
ctx.drawImage(copy, 0, 0);
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
function luma(r, g, b) {
|
||||
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||
}
|
||||
function clamp255(v) {
|
||||
return v < 0 ? 0 : v > 255 ? 255 : v;
|
||||
}
|
||||
function blurCanvas(canvas, radius) {
|
||||
const w = canvas.width, h = canvas.height;
|
||||
if (!w || !h || radius <= 0) return;
|
||||
const n = Math.max(2, Math.min(16, Math.round(radius * 1.6)));
|
||||
const sw = Math.max(1, Math.round(w / n));
|
||||
const sh = Math.max(1, Math.round(h / n));
|
||||
const tmp = document.createElement("canvas");
|
||||
tmp.width = sw;
|
||||
tmp.height = sh;
|
||||
const tctx = tmp.getContext("2d");
|
||||
tctx.imageSmoothingEnabled = true;
|
||||
tctx.drawImage(canvas, 0, 0, sw, sh);
|
||||
const ctx = canvas.getContext("2d");
|
||||
ctx.save();
|
||||
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
ctx.globalAlpha = 1;
|
||||
ctx.globalCompositeOperation = "copy";
|
||||
ctx.imageSmoothingEnabled = true;
|
||||
ctx.drawImage(tmp, 0, 0, w, h);
|
||||
ctx.restore();
|
||||
}
|
||||
function pixelateCanvas(canvas, block) {
|
||||
const w = canvas.width, h = canvas.height;
|
||||
if (!w || !h) return;
|
||||
@@ -4072,7 +4212,12 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
ctx.imageSmoothingEnabled = true;
|
||||
ctx.drawImage(st.source, 0, 0);
|
||||
ctx.restore();
|
||||
fx.render(target.canvas, value);
|
||||
try {
|
||||
fx.render(target.canvas, value);
|
||||
} catch (e) {
|
||||
toast("效果失败:" + (e && e.message || e), "error");
|
||||
throw e;
|
||||
}
|
||||
target._bounds = void 0;
|
||||
S.pickerComposite = null;
|
||||
}
|
||||
@@ -4847,6 +4992,14 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
};
|
||||
function onMouseMove(e) {
|
||||
S._altDown = !!e.altKey;
|
||||
if (S.isDrawing && e.buttons === 0) {
|
||||
S.isDrawing = false;
|
||||
const up = Object.prototype.hasOwnProperty.call(DRAW_UP_HANDLERS, S.tool) ? DRAW_UP_HANDLERS[S.tool] : null;
|
||||
try {
|
||||
if (up) up(getPos(e));
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
if (S.placingImage && S.placingHandle && S.placingStart) {
|
||||
onPlacementDragMove(e);
|
||||
return;
|
||||
@@ -6875,6 +7028,26 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
renderLayerPanel();
|
||||
finishCreateTool("shape", shape.id);
|
||||
}
|
||||
function resetPointerState() {
|
||||
S.isDrawing = false;
|
||||
S.marquee = null;
|
||||
S.lassoPts = null;
|
||||
S.textDrag = null;
|
||||
S.bitmapDrag = null;
|
||||
S.shapeDrag = null;
|
||||
S.penDragPt = -1;
|
||||
S.penDragPending = null;
|
||||
S.placingHandle = null;
|
||||
S.panning = false;
|
||||
S.interaction = "idle";
|
||||
if (S.strokeCanvas) S.strokeCanvas.style.display = "none";
|
||||
document.body.style.cursor = "";
|
||||
document.body.style.userSelect = "";
|
||||
try {
|
||||
renderObjects();
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
function bindCanvasEvents() {
|
||||
if (S._canvasEventsBound) return;
|
||||
S._canvasEventsBound = true;
|
||||
@@ -6882,6 +7055,11 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
S.canvasStack.addEventListener("mousemove", onMouseMove);
|
||||
S.canvasStack.addEventListener("mousemove", onCanvasHover);
|
||||
window.addEventListener("mouseup", onMouseUp);
|
||||
window.addEventListener("blur", resetPointerState);
|
||||
document.addEventListener("pointercancel", resetPointerState);
|
||||
document.addEventListener("visibilitychange", () => {
|
||||
if (document.hidden) resetPointerState();
|
||||
});
|
||||
S.canvasStack.addEventListener("contextmenu", (e) => {
|
||||
e.preventDefault();
|
||||
if (S.open && !S.placingImage) showSelectionContext(e);
|
||||
@@ -9130,3 +9308,5 @@ var __IWB_ANNOTATE_MANIFEST__ = {
|
||||
})
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
|
||||
// build-rev: 2026-11-17T17 (pointer-self-heal)
|
||||
|
||||
@@ -36,6 +36,7 @@ const sourceModules = [
|
||||
'clipboard-paste.js',
|
||||
'clipboard-copy.js',
|
||||
'clipboard-paste-once.js',
|
||||
'clipboard-native.js',
|
||||
'generation-size-policy.js',
|
||||
'generation-request-shape.js',
|
||||
'image-preview-derive.js',
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict'
|
||||
// 生成插件市场展示页:market/index.json → market.html(纯静态,无后端)
|
||||
// 设计目标:与下载页同一套视觉;卡片墙 + 搜索 + 标签筛选;「安装」只在应用内做,这里只展示。
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const root = path.resolve(__dirname, '..')
|
||||
const index = JSON.parse(fs.readFileSync(path.join(root, 'market', 'index.json'), 'utf8'))
|
||||
const list = Array.isArray(index.plugins) ? index.plugins : []
|
||||
|
||||
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]))
|
||||
const tags = []
|
||||
for (const p of list) for (const t of (p.tags || [])) if (tags.indexOf(t) < 0) tags.push(t)
|
||||
|
||||
const kb = (n) => n >= 1024 * 1024 ? (n / 1048576).toFixed(1) + ' MB' : Math.max(1, Math.round(n / 1024)) + ' KB'
|
||||
|
||||
const card = (p) => `
|
||||
<article class="card" data-name="${esc((p.name + ' ' + p.id + ' ' + p.desc + ' ' + (p.tags || []).join(' ')).toLowerCase())}" data-tags="${esc((p.tags || []).join(','))}">
|
||||
<div class="card-head">
|
||||
<span class="avatar" style="background:${esc(p.color || '#eef2f6')}">${esc(p.icon || '◻')}</span>
|
||||
<div class="card-title">
|
||||
<h3>${esc(p.name)}</h3>
|
||||
<div class="sub">${esc(p.author === 'official' ? '官方' : p.author)} · v${esc(p.version)} · ${kb(p.size || 0)}</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="desc">${esc(p.desc)}</p>
|
||||
<div class="tags">${(p.tags || []).map((t) => `<span class="tag">${esc(t)}</span>`).join('')}</div>
|
||||
</article>`
|
||||
|
||||
const html = `<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>插件市场 · Image Workbench</title>
|
||||
<style>
|
||||
:root { --fg:#1a1a1a; --fg2:#6b6b6b; --line:#ececec; --bg:#fff; --chip:#f4f4f4; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root { --fg:#f2f2f2; --fg2:#9a9a9a; --line:#2a2a2a; --bg:#111; --chip:#1d1d1d; }
|
||||
}
|
||||
* { box-sizing:border-box; }
|
||||
body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
|
||||
.wrap { max-width:1080px; margin:0 auto; padding:56px 24px 80px; }
|
||||
header h1 { font-size:28px; margin:0 0 6px; letter-spacing:-.02em; }
|
||||
header p { margin:0; color:var(--fg2); font-size:14px; }
|
||||
.toolbar { display:flex; gap:12px; margin:28px 0 18px; flex-wrap:wrap; align-items:center; }
|
||||
input[type=search] { flex:1 1 260px; min-width:220px; padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--fg); font-size:14px; outline:none; }
|
||||
input[type=search]:focus { border-color:#111; }
|
||||
.chips { display:flex; gap:8px; flex-wrap:wrap; }
|
||||
.chip { padding:6px 12px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--fg2); font-size:13px; cursor:pointer; }
|
||||
.chip.on { background:#111; color:#fff; border-color:#111; }
|
||||
@media (prefers-color-scheme: dark) { .chip.on { background:#f2f2f2; color:#111; border-color:#f2f2f2; } }
|
||||
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
|
||||
.card { border:1px solid var(--line); border-radius:14px; padding:18px; display:flex; flex-direction:column; gap:12px; }
|
||||
.card-head { display:flex; gap:12px; align-items:center; }
|
||||
.avatar { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; flex:0 0 44px; }
|
||||
.card-title h3 { margin:0; font-size:16px; font-weight:600; }
|
||||
.card-title .sub { color:var(--fg2); font-size:12.5px; margin-top:2px; }
|
||||
.desc { margin:0; color:var(--fg2); font-size:13.5px; min-height:42px; }
|
||||
.tags { display:flex; gap:6px; flex-wrap:wrap; margin-top:auto; }
|
||||
.tag { padding:2px 9px; border-radius:999px; background:var(--chip); color:var(--fg2); font-size:12px; }
|
||||
.empty { color:var(--fg2); padding:40px 0; text-align:center; }
|
||||
footer { margin-top:40px; color:var(--fg2); font-size:13px; border-top:1px solid var(--line); padding-top:18px; }
|
||||
code { background:var(--chip); padding:1px 6px; border-radius:6px; font-size:12.5px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<header>
|
||||
<h1>插件市场</h1>
|
||||
<p>Image Workbench 插件 · 共 <b>${list.length}</b> 个 · 在应用内「设置 → 插件」安装</p>
|
||||
</header>
|
||||
|
||||
<div class="toolbar">
|
||||
<input id="q" type="search" placeholder="搜索插件,例如:出图、抠图、矢量…" autocomplete="off">
|
||||
<div class="chips" id="chips">
|
||||
<button class="chip on" data-tag="">全部</button>
|
||||
${tags.map((t) => `<button class="chip" data-tag="${esc(t)}">${esc(t)}</button>`).join('')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid" id="grid">${list.map(card).join('')}</div>
|
||||
<div class="empty" id="empty" hidden>没有匹配的插件</div>
|
||||
|
||||
<footer>
|
||||
安装方式:应用内 <code>设置 → 插件 → 可安装(市场)</code> 点「安装」,重启后生效。<br>
|
||||
插件目录:<code>~/Documents/ImageWorkbench/plugins/</code>(Windows:<code>%USERPROFILE%\\Documents\\ImageWorkbench\\plugins\\</code>)
|
||||
</footer>
|
||||
</div>
|
||||
<script>
|
||||
var q = document.getElementById('q')
|
||||
var grid = document.getElementById('grid')
|
||||
var empty = document.getElementById('empty')
|
||||
var chips = document.getElementById('chips')
|
||||
var activeTag = ''
|
||||
function apply () {
|
||||
var kw = (q.value || '').trim().toLowerCase()
|
||||
var shown = 0
|
||||
Array.prototype.forEach.call(grid.children, function (el) {
|
||||
var okKw = !kw || el.dataset.name.indexOf(kw) >= 0
|
||||
var okTag = !activeTag || (',' + el.dataset.tags + ',').indexOf(',' + activeTag + ',') >= 0
|
||||
var ok = okKw && okTag
|
||||
el.hidden = !ok
|
||||
if (ok) shown++
|
||||
})
|
||||
empty.hidden = shown > 0
|
||||
}
|
||||
q.addEventListener('input', apply)
|
||||
chips.addEventListener('click', function (e) {
|
||||
var b = e.target.closest('.chip')
|
||||
if (!b) return
|
||||
Array.prototype.forEach.call(chips.children, function (x) { x.classList.remove('on') })
|
||||
b.classList.add('on')
|
||||
activeTag = b.dataset.tag || ''
|
||||
apply()
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
fs.writeFileSync(path.join(root, 'market', 'index.html'), html)
|
||||
console.log('market/index.html 已生成(' + list.length + ' 个插件 / ' + tags.length + ' 个标签)')
|
||||
@@ -19,7 +19,7 @@ for (const e of man) {
|
||||
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',
|
||||
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,
|
||||
|
||||
@@ -7,12 +7,12 @@ const path = require('path')
|
||||
|
||||
const root = path.resolve(__dirname, '..')
|
||||
const inFile = process.argv[2] || path.join(root, 'site', 'releases.json')
|
||||
const outFile = process.argv[3] || path.join(root, 'site', 'index.html')
|
||||
const outFile = process.argv[3] || path.join(root, 'site', 'download', 'index.html')
|
||||
const data = JSON.parse(fs.readFileSync(inFile, 'utf8'))
|
||||
|
||||
const PLATFORMS = [
|
||||
{ key: 'darwin-aarch64', label: 'macOS · Apple Silicon', hint: 'M1 / M2 / M3 / M4' },
|
||||
{ key: 'darwin-x64', label: 'macOS · Intel', hint: 'x86_64' },
|
||||
{ key: 'darwin-x86_64', label: 'macOS · Intel', hint: 'x86_64' },
|
||||
{ key: 'windows-x86_64', label: 'Windows · x64', hint: '需要 WebView2' },
|
||||
]
|
||||
|
||||
@@ -55,12 +55,11 @@ const html = `<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>${esc(data.app)} · 下载</title>
|
||||
<link rel="stylesheet" href="/assets/style.css?v=" + encodeURIComponent(latest.version + '-' + Date.now().toString(36)) + "">
|
||||
<style>
|
||||
:root{--bg:#fafaf9;--fg:#1c1917;--muted:#78716c;--line:#e7e5e4;--card:#fff;--brand:#1c1917}
|
||||
@media (prefers-color-scheme:dark){:root{--bg:#17161a;--fg:#f5f5f4;--muted:#a8a29e;--line:#2f2d33;--card:#1f1e23;--brand:#f5f5f4}}
|
||||
*{box-sizing:border-box}
|
||||
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
|
||||
.wrap{max-width:760px;margin:0 auto;padding:56px 22px 72px}
|
||||
.dlwrap{max-width:760px;margin:0 auto;padding:48px 0 64px}
|
||||
h1{font-size:27px;margin:0 0 6px;letter-spacing:-.01em}
|
||||
.sub{color:var(--muted);margin:0 0 34px}
|
||||
h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:38px 0 2px}
|
||||
@@ -76,10 +75,30 @@ const html = `<!doctype html>
|
||||
.foot{margin-top:46px;color:var(--muted);font-size:12.5px;line-height:1.8}
|
||||
.foot a{color:inherit}
|
||||
code{font-size:12.5px}
|
||||
.steps{margin:6px 0 0;padding-left:22px;color:var(--fg2);font-size:13.5px;line-height:1.9}
|
||||
.steps li{margin:2px 0}
|
||||
.steps b{color:var(--fg);font-weight:600}
|
||||
pre.cmd{margin:10px 0 0;padding:10px 12px;background:var(--bg2);border:1px solid var(--line);border-radius:8px;overflow-x:auto}
|
||||
pre.cmd code{font-size:12px;color:var(--fg)}
|
||||
.note{margin:10px 0 0;color:var(--muted);font-size:12.5px;line-height:1.8}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
|
||||
<div class="links">
|
||||
<a href="/">首页</a>
|
||||
<a href="/download/" class="on">下载</a>
|
||||
<a href="/plugins/">插件</a>
|
||||
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
|
||||
<div class="wrap"><div class="dlwrap">
|
||||
<h1>${esc(data.app)}</h1>
|
||||
<p class="sub">${esc(data.subtitle || '')}</p>
|
||||
|
||||
@@ -93,15 +112,45 @@ ${PLATFORMS.map((p) => platformRow(latest, p)).join('\n')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>安装步骤(macOS)</h2>
|
||||
<ol class="steps">
|
||||
<li>下载上面的 <b>.dmg</b>(Apple 芯片选 Apple Silicon;老 Intel 机器选 Intel)。</li>
|
||||
<li>双击打开 dmg,把 <b>Image Workbench</b> 图标拖进「应用程序」文件夹。</li>
|
||||
<li>第一次启动:打开「应用程序」,<b>右键点图标 → 打开</b>,弹窗里再点一次「打开」。</li>
|
||||
<li>如果提示「已损坏」或「无法验证开发者」:打开「终端」,粘贴执行下面这条命令,然后重新打开应用。</li>
|
||||
</ol>
|
||||
<pre class="cmd"><code>xattr -dr com.apple.quarantine "/Applications/image-workbench.app"</code></pre>
|
||||
<p class="note">说明:安装包未做 Apple 公证($99/年开发者账号),所以第一次需要手动放行;这一步只做一次。<br>
|
||||
之后有新版本时,应用内 <b>设置 → 通用 → 版本与更新 → 检查更新</b> 就能一键升级,不用再下载安装包。</p>
|
||||
|
||||
<h2>安装步骤(Windows)</h2>
|
||||
<ol class="steps">
|
||||
<li>下载 <b>.exe</b>(NSIS 安装包,按当前用户安装,不需要管理员权限)。</li>
|
||||
<li>双击运行;若出现「Windows 已保护你的电脑」,点「更多信息 → 仍要运行」。</li>
|
||||
<li>安装完成后从开始菜单启动;数据在 <code>%USERPROFILE%\Documents\ImageWorkbench</code>。</li>
|
||||
</ol>
|
||||
|
||||
<h2>历史版本</h2>
|
||||
${history}
|
||||
|
||||
<div class="foot">
|
||||
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 ${esc((data.updatedAt || '').slice(0, 10))}
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<footer><div class="wrap">
|
||||
<div class="cols">
|
||||
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
|
||||
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
|
||||
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
|
||||
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
|
||||
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
|
||||
</div>
|
||||
<div class="copy"><span>© Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
|
||||
</div></footer>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
fs.mkdirSync(path.dirname(outFile), { recursive: true })
|
||||
fs.writeFileSync(outFile, html)
|
||||
console.log('已生成 ' + path.relative(root, outFile) + '(' + data.releases.length + ' 个版本 / ' + Object.keys((latest && latest.platforms) || {}).length + ' 个平台)')
|
||||
@@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict'
|
||||
// 站点生成器:用 site/_home.tpl.html 与 site/_plugins.tpl.html 渲染首页 / 插件页,
|
||||
// 数据来自 site/releases.json(版本)与 market/index.json(插件)。
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const root = path.resolve(__dirname, '..')
|
||||
const site = path.join(root, 'site')
|
||||
|
||||
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]))
|
||||
const mb = (n) => (Number(n) / 1048576).toFixed(1) + ' MB'
|
||||
|
||||
const data = JSON.parse(fs.readFileSync(path.join(site, 'releases.json'), 'utf8'))
|
||||
const rel = Array.isArray(data.releases) ? data.releases.slice() : (Array.isArray(data) ? data.slice() : [])
|
||||
rel.sort((a, b) => String(b.version).localeCompare(String(a.version), undefined, { numeric: true }))
|
||||
const latest = rel[0] || { version: '', platforms: {} }
|
||||
const V = esc(latest.version)
|
||||
const STAMP = encodeURIComponent(V + '-' + Date.now().toString(36))
|
||||
|
||||
const marketFile = path.join(root, 'market', 'index.json')
|
||||
const market = fs.existsSync(marketFile) ? JSON.parse(fs.readFileSync(marketFile, 'utf8')) : { plugins: [] }
|
||||
const plugins = Array.isArray(market.plugins) ? market.plugins : []
|
||||
|
||||
const nav = (active) => [
|
||||
'<nav><div class="wrap inner">',
|
||||
' <a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>',
|
||||
' <div class="links">',
|
||||
' <a href="/"' + (active === 'home' ? ' class="on"' : '') + '>首页</a>',
|
||||
' <a href="/download/"' + (active === 'download' ? ' class="on"' : '') + '>下载</a>',
|
||||
' <a href="/plugins/"' + (active === 'plugins' ? ' class="on"' : '') + '>插件</a>',
|
||||
' <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>',
|
||||
' </div>',
|
||||
' <div class="right">',
|
||||
' <a class="btn" href="/plugins/">插件市场</a>',
|
||||
' <a class="btn primary" href="/download/">下载 v' + V + '</a>',
|
||||
' </div>',
|
||||
'</div></nav>',
|
||||
].join('\n')
|
||||
|
||||
const footer = [
|
||||
'<footer><div class="wrap">',
|
||||
' <div class="cols">',
|
||||
' <div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>',
|
||||
' <div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>',
|
||||
' <div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>',
|
||||
' <div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>',
|
||||
' <div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>',
|
||||
' </div>',
|
||||
' <div class="copy"><span>© ' + new Date().getFullYear() + ' Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>',
|
||||
'</div></footer>',
|
||||
].join('\n')
|
||||
|
||||
const card = (p) => [
|
||||
' <div class="pcard" data-name="' + esc((p.name + ' ' + p.id + ' ' + (p.desc || '') + ' ' + (p.tags || []).join(' ')).toLowerCase()) + '" data-tags="' + esc((p.tags || []).join(',')) + '">',
|
||||
' <div class="head"><span class="av" style="background:' + esc(p.color || '#eef2f6') + '">' + esc(p.icon || '◻') + '</span>',
|
||||
' <div><div class="nm">' + esc(p.name || p.id) + '</div><div class="ver">v' + esc(p.version || '') + ' · ' + esc(p.author === 'official' ? '官方' : (p.author || '')) + '</div></div></div>',
|
||||
' <div class="desc">' + esc(p.desc || '') + '</div>',
|
||||
' <div class="tags">' + (p.tags || []).map((t) => '<span class="tag">' + esc(t) + '</span>').join('') + '</div>',
|
||||
' </div>',
|
||||
].join('\n')
|
||||
|
||||
const feats = [
|
||||
['💻', '#eef2ff', '本地优先', '图片与数据保存在 ~/Documents/ImageWorkbench,不经服务器中转;可整目录备份、迁移到新电脑。'],
|
||||
['🕸️', '#fff7ed', '节点式无限画布', '参考图 → 提示词 → 生成 → 图库,用连线把工作流串起来;一张画布容纳整条生产线。'],
|
||||
['🧩', '#ecfdf5', '插件按需安装', '应用本体不含插件,需要什么装什么;可随时启停,关闭后入口自动隐藏。'],
|
||||
]
|
||||
const featCards = feats.map((f) => [
|
||||
' <div class="card"><div class="ico" style="background:' + f[1] + '">' + f[0] + '</div>',
|
||||
' <h3>' + f[2] + '</h3><p>' + f[3] + '</p></div>',
|
||||
].join('\n')).join('\n')
|
||||
|
||||
const dlCards = [
|
||||
['darwin-aarch64', 'macOS · Apple Silicon', 'M1 / M2 / M3 / M4'],
|
||||
['darwin-x86_64', 'macOS · Intel', 'x86_64'],
|
||||
['windows-x86_64', 'Windows · x64', '需要 WebView2'],
|
||||
].map(([key, label, hint]) => {
|
||||
const p = (latest.platforms || {})[key]
|
||||
if (!p) return '<div class="none"><div class="n">' + label + '</div><div class="s">暂未提供</div></div>'
|
||||
return '<a href="/' + esc(p.file) + '"><div class="n">' + label + '</div><div class="s">' + hint + ' · ' + mb(p.size) + ' · .' + esc(String(p.file).split('.').pop()) + '</div></a>'
|
||||
}).join('\n ')
|
||||
|
||||
const tags = []
|
||||
for (const p of plugins) for (const t of (p.tags || [])) if (tags.indexOf(t) < 0) tags.push(t)
|
||||
const tagChips = tags.map((t) => '<button class="tag" data-tag="' + esc(t) + '" style="cursor:pointer;padding:5px 12px">' + esc(t) + '</button>').join('\n ')
|
||||
|
||||
function render(tpl, map) {
|
||||
let out = fs.readFileSync(path.join(site, tpl), 'utf8')
|
||||
for (const k of Object.keys(map)) out = out.split('<!--' + k + '-->').join(map[k])
|
||||
return out
|
||||
}
|
||||
|
||||
let home = render('_home.tpl.html', {
|
||||
NAV: nav('home'),
|
||||
FOOTER: footer,
|
||||
VERSION: V,
|
||||
PLUGIN_COUNT: String(plugins.length),
|
||||
FEAT_CARDS: featCards,
|
||||
PLUGIN_CARDS: plugins.slice(0, 6).map((p) => card(p).replace(/^\s+/, ' ')).join('\n'),
|
||||
DL_CARDS: dlCards,
|
||||
})
|
||||
home = home.replace('/assets/style.css', '/assets/style.css?v=' + STAMP).replace('/assets/painting.jpg', '/assets/painting.jpg?v=' + STAMP)
|
||||
fs.writeFileSync(path.join(site, 'index.html'), home)
|
||||
|
||||
let pluginsPage = render('_plugins.tpl.html', {
|
||||
NAV: nav('plugins'),
|
||||
FOOTER: footer,
|
||||
PLUGIN_COUNT: String(plugins.length),
|
||||
TAG_CHIPS: tagChips,
|
||||
PLUGIN_CARDS: plugins.map(card).join('\n'),
|
||||
})
|
||||
fs.mkdirSync(path.join(site, 'plugins'), { recursive: true })
|
||||
pluginsPage = pluginsPage.replace('/assets/style.css', '/assets/style.css?v=' + STAMP)
|
||||
fs.writeFileSync(path.join(site, 'plugins', 'index.html'), pluginsPage)
|
||||
fs.writeFileSync(path.join(site, 'plugins-index.json'), JSON.stringify(market, null, 2) + '\n')
|
||||
|
||||
console.log('站点已生成:首页 / 插件页(' + plugins.length + ' 个插件,' + tags.length + ' 个标签,版本 v' + V + ')')
|
||||
Executable
+76
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
# 发布在线更新:签名构建(双架构)+ 上传产物 + 生成 latest.json
|
||||
#
|
||||
# 用法:
|
||||
# ./scripts/publish-update.sh # 用 package.json 的版本
|
||||
# ./scripts/publish-update.sh 3.25.3 # 先改版本再发布(等价于 set-version + 本脚本)
|
||||
#
|
||||
# 依赖:
|
||||
# · 签名私钥:~/.config/iwb-updater.key(TAURI_SIGNING_PRIVATE_KEY)
|
||||
# · 公钥已写进 src-tauri/tauri.conf.json → plugins.updater.pubkey
|
||||
# · NAS 可 ssh(~/.ssh/id_ed25519_fnos)
|
||||
#
|
||||
# 产物:
|
||||
# <target>/bundle/macos/image-workbench.app.tar.gz(.sig) ← 更新器用
|
||||
# <target>/bundle/dmg/*.dmg ← 官网下载用
|
||||
# https://download.maqiart.eu.org/updates/latest.json ← 更新源
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
[ $# -ge 1 ] && node scripts/set-version.js "$1"
|
||||
V=$(node -e "console.log(require('./package.json').version)")
|
||||
KEY="${TAURI_SIGNING_PRIVATE_KEY:-$HOME/.config/iwb-updater.key}"
|
||||
export TAURI_SIGNING_PRIVATE_KEY="$KEY"
|
||||
export TAURI_SIGNING_PRIVATE_KEY_PASSWORD="${TAURI_SIGNING_PRIVATE_KEY_PASSWORD:-}"
|
||||
export CARGO_HOME="${CARGO_HOME:-$PWD/.cargo-home}"
|
||||
|
||||
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"
|
||||
|
||||
echo "== 1/4 构建 arm64(app + dmg,含签名)"
|
||||
npx tauri build --bundles app,dmg >/dev/null
|
||||
|
||||
echo "== 2/4 构建 x86_64(app + dmg,含签名)"
|
||||
npx tauri build --target x86_64-apple-darwin --bundles app,dmg >/dev/null
|
||||
|
||||
ARM="src-tauri/target/release/bundle"
|
||||
INT="src-tauri/target/x86_64-apple-darwin/release/bundle"
|
||||
|
||||
echo "== 3/4 上传产物"
|
||||
TMP=$(mktemp -d)
|
||||
cp "$ARM/macos/image-workbench.app.tar.gz" "$TMP/image-workbench_${V}_aarch64.app.tar.gz"
|
||||
cp "$ARM/macos/image-workbench.app.tar.gz.sig" "$TMP/image-workbench_${V}_aarch64.app.tar.gz.sig"
|
||||
cp "$INT/macos/image-workbench.app.tar.gz" "$TMP/image-workbench_${V}_x64.app.tar.gz"
|
||||
cp "$INT/macos/image-workbench.app.tar.gz.sig" "$TMP/image-workbench_${V}_x64.app.tar.gz.sig"
|
||||
$SCP "$TMP"/*.app.tar.gz* "$NAS_HOST:$NAS_DIR/updates/darwin-aarch64/" 2>/dev/null || true
|
||||
$SCP "$TMP/image-workbench_${V}_aarch64.app.tar.gz" "$TMP/image-workbench_${V}_aarch64.app.tar.gz.sig" "$NAS_HOST:$NAS_DIR/updates/darwin-aarch64/"
|
||||
$SCP "$TMP/image-workbench_${V}_x64.app.tar.gz" "$TMP/image-workbench_${V}_x64.app.tar.gz.sig" "$NAS_HOST:$NAS_DIR/updates/darwin-x86_64/"
|
||||
$SCP "$ARM/dmg/image-workbench_${V}_aarch64.dmg" "$NAS_HOST:$NAS_DIR/updates/darwin-aarch64/"
|
||||
$SCP "$INT/dmg/image-workbench_${V}_x64.dmg" "$NAS_HOST:$NAS_DIR/updates/darwin-x86_64/"
|
||||
|
||||
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"
|
||||
node -e '
|
||||
const fs = require("fs")
|
||||
const v = process.env.UPD_VERSION
|
||||
const j = {
|
||||
version: v,
|
||||
notes: process.env.UPD_NOTES || "",
|
||||
pub_date: new Date().toISOString(),
|
||||
platforms: {
|
||||
"darwin-aarch64": { signature: process.env.SIG_ARM, url: "https://download.maqiart.eu.org/updates/darwin-aarch64/image-workbench_" + v + "_aarch64.app.tar.gz" },
|
||||
"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" },
|
||||
},
|
||||
}
|
||||
fs.writeFileSync("/tmp/iwb-latest.json", JSON.stringify(j, null, 2))
|
||||
console.log("latest.json -> v" + v)
|
||||
'
|
||||
$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"
|
||||
|
||||
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
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
# 发布 Windows 更新:对 Windows 侧构建好的 *-setup.exe 重新签名(用本机正式私钥),
|
||||
# 上传到 NAS,并把 windows-x86_64 条目合并进 updates/latest.json。
|
||||
#
|
||||
# 用法:./scripts/publish-windows-update.sh "/path/to/image-workbench_3.25.3_x64-setup.exe"
|
||||
#
|
||||
# 背景(Tauri v2):Windows 的更新产物就是安装包本体 + 同名 .sig,没有 v1 的 *.nsis.zip。
|
||||
# Windows 机器只需把 setup.exe 发过来,签名与发布都在本机完成,私钥不外传。
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
EXE_IN="${1:?用法: publish-windows-update.sh <setup.exe 路径>}"
|
||||
[ -f "$EXE_IN" ] || { echo "找不到文件:$EXE_IN"; exit 1; }
|
||||
|
||||
V=$(node -e "console.log(require('./package.json').version)")
|
||||
KEY="${TAURI_SIGNING_PRIVATE_KEY:-$HOME/.config/iwb-updater.key}"
|
||||
NAS_HOST="${NAS_HOST:-malongan@192.168.100.185}"
|
||||
NAS_DIR="${NAS_DIR:-/vol8/web/iwb-download}"
|
||||
SSH_KEY="${SSH_KEY:-$HOME/.ssh/id_ed25519_fnos}"
|
||||
SCP="scp -i $SSH_KEY -o BatchMode=yes"
|
||||
|
||||
WORK=$(mktemp -d)
|
||||
OUT="$WORK/image-workbench_${V}_x64-setup.exe"
|
||||
cp "$EXE_IN" "$OUT"
|
||||
echo "== 1/4 校验文件"
|
||||
SIZE=$(stat -f%z "$OUT")
|
||||
SHA=$(shasum -a 256 "$OUT" | awk '{print $1}')
|
||||
echo " $OUT"
|
||||
echo " size=$SIZE sha256=$SHA"
|
||||
|
||||
echo "== 2/4 用正式私钥签名"
|
||||
npx tauri signer sign -f "$KEY" -p "${TAURI_SIGNING_PRIVATE_KEY_PASSWORD:-}" --app-version "$V" "$OUT" >/dev/null
|
||||
SIG_FILE="$OUT.sig"
|
||||
[ -f "$SIG_FILE" ] || { echo "签名失败:没有产出 $SIG_FILE"; exit 1; }
|
||||
echo " .sig $(wc -c < "$SIG_FILE" | tr -d ' ') 字节"
|
||||
|
||||
echo "== 3/4 上传到 NAS"
|
||||
ssh -i "$SSH_KEY" -o BatchMode=yes "$NAS_HOST" "mkdir -p $NAS_DIR/updates/windows-x86_64"
|
||||
$SCP "$OUT" "$SIG_FILE" "$NAS_HOST:$NAS_DIR/updates/windows-x86_64/"
|
||||
|
||||
echo "== 4/4 合并 latest.json"
|
||||
SIG=$(cat "$SIG_FILE")
|
||||
URL="https://download.maqiart.eu.org/updates/windows-x86_64/image-workbench_${V}_x64-setup.exe"
|
||||
export SIG URL APP_VERSION="$V"
|
||||
curl -s -m 20 https://download.maqiart.eu.org/updates/latest.json -o "$WORK/latest.json" || echo '{}' > "$WORK/latest.json"
|
||||
node -e '
|
||||
const fs = require("fs")
|
||||
const p = process.argv[1]
|
||||
let cur = {}
|
||||
try { cur = JSON.parse(fs.readFileSync(p, "utf8")) } catch (e) { cur = {} }
|
||||
cur.version = process.env.APP_VERSION
|
||||
cur.notes = cur.notes || "在线更新"
|
||||
cur.pub_date = new Date().toISOString()
|
||||
cur.platforms = cur.platforms || {}
|
||||
cur.platforms["windows-x86_64"] = { signature: process.env.SIG, url: process.env.URL }
|
||||
fs.writeFileSync(p, JSON.stringify(cur, null, 2))
|
||||
console.log(" platforms:", Object.keys(cur.platforms).join(", "))
|
||||
' "$WORK/latest.json"
|
||||
$SCP "$WORK/latest.json" "$NAS_HOST:$NAS_DIR/updates/latest.json"
|
||||
ssh -i "$SSH_KEY" -o BatchMode=yes "$NAS_HOST" "chmod -R a+rX $NAS_DIR"
|
||||
|
||||
echo "== 完成"
|
||||
curl -s -m 20 https://download.maqiart.eu.org/updates/latest.json | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{const j=JSON.parse(s);console.log("version",j.version);for(const k of Object.keys(j.platforms))console.log(" -",k,"sig",(j.platforms[k].signature||"").length,"bytes")})'
|
||||
curl -s -o /dev/null -m 60 -w "exe:%{http_code} size:%{size_download}\n" "$URL"
|
||||
@@ -0,0 +1,82 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Image Workbench · 本地优先的 AI 生图工作台</title>
|
||||
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
</head><body>
|
||||
<!--NAV-->
|
||||
<main>
|
||||
<section class="hero hero-art">
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg" alt=""></div>
|
||||
<div class="hero-veil"></div>
|
||||
<div class="wrap">
|
||||
<span class="kicker">v<!--VERSION--> · macOS / Windows · 数据在本地</span>
|
||||
<h1>本地优先的<br>AI 生图无限画布</h1>
|
||||
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
|
||||
<div class="cta">
|
||||
<a class="btn primary lg" href="/download/">下载 v<!--VERSION--></a>
|
||||
<a class="btn lg" href="/plugins/">浏览 <!--PLUGIN_COUNT--> 个插件</a>
|
||||
</div>
|
||||
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
|
||||
</div></section>
|
||||
|
||||
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>为「一个人跑完整条产线」而做</h2>
|
||||
<p class="lead">不做又一个在线生图站点。它活在你的桌面上,把生图、修图、批量、图库和插件放在同一张画布上。</p>
|
||||
<div class="grid c3">
|
||||
<!--FEAT_CARDS-->
|
||||
</div>
|
||||
</div></section>
|
||||
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>插件:本体不带,需要的自己装</h2>
|
||||
<p class="lead">应用本体不再内置插件。设置里打开市场,点「安装」,重启即可用;不需要的点一下就能关掉。</p>
|
||||
<div class="grid c3">
|
||||
<!--PLUGIN_CARDS-->
|
||||
</div>
|
||||
<div style="margin-top:22px"><a class="btn" href="/plugins/">查看全部 <!--PLUGIN_COUNT--> 个插件</a></div>
|
||||
</div></section>
|
||||
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>下载 Image Workbench</h2>
|
||||
<p class="lead">选你的平台。装过一次之后,以后在应用内「设置 → 通用 → 版本与更新」就能一键升级。</p>
|
||||
<div class="dl"><!--DL_CARDS--></div>
|
||||
<div style="margin-top:20px;color:#9ca3af;font-size:12.5px">安装包未做 Apple 公证 / Windows 代码签名,首次打开需手动放行一次,细节见 <a href="/download/" style="text-decoration:underline">下载页</a>。</div>
|
||||
</div></section>
|
||||
</main>
|
||||
<!--FOOTER-->
|
||||
</body></html>
|
||||
<script>
|
||||
(function () {
|
||||
var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||
var targets = [].slice.call(document.querySelectorAll('.section h2, .section p.lead, .card, .pcard, .dl a'))
|
||||
targets.forEach(function (el) { el.classList.add('reveal') })
|
||||
if (!reduce && 'IntersectionObserver' in window) {
|
||||
var io = new IntersectionObserver(function (entries) {
|
||||
entries.forEach(function (e) {
|
||||
if (!e.isIntersecting) return
|
||||
var el = e.target
|
||||
var idx = targets.indexOf(el) % 4
|
||||
el.style.transitionDelay = (idx * 60) + 'ms'
|
||||
el.classList.add('in')
|
||||
io.unobserve(el)
|
||||
})
|
||||
}, { rootMargin: '0px 0px -8% 0px', threshold: 0.12 })
|
||||
targets.forEach(function (el) { io.observe(el) })
|
||||
} else { targets.forEach(function (el) { el.classList.add('in') }) }
|
||||
var art = document.querySelector('.art-frame')
|
||||
if (art && !reduce) {
|
||||
var raf = 0
|
||||
var onScroll = function () {
|
||||
if (raf) return
|
||||
raf = requestAnimationFrame(function () {
|
||||
raf = 0
|
||||
var y = Math.min(1, Math.max(0, window.scrollY / 700))
|
||||
art.style.transform = 'translate3d(0,' + (y * -14) + 'px,0)'
|
||||
})
|
||||
}
|
||||
window.addEventListener('scroll', onScroll, { passive: true }); onScroll()
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
@@ -0,0 +1,45 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>插件市场 · Image Workbench</title>
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
</head><body>
|
||||
<!--NAV-->
|
||||
<main>
|
||||
<section class="hero" style="padding:64px 0 8px;text-align:left"><div class="wrap">
|
||||
<h1 style="font-size:40px;margin:0">插件市场</h1>
|
||||
<p class="sub" style="margin:14px 0 0;text-align:left;max-width:720px">共 <!--PLUGIN_COUNT--> 个插件。安装方式:应用内 <b>设置 → 插件 → 浏览</b>,点「安装」后重启生效。</p>
|
||||
</div></section>
|
||||
<section class="section" style="border-top:0;padding-top:24px"><div class="wrap">
|
||||
<div style="display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px" id="chips">
|
||||
<button class="tag on" data-tag="" style="cursor:pointer;background:#111;color:#fff;border-color:#111;padding:5px 12px">全部</button>
|
||||
<!--TAG_CHIPS-->
|
||||
</div>
|
||||
<input id="q" placeholder="搜索插件,例如:出图、抠图、矢量…" style="width:100%;max-width:420px;height:40px;padding:0 14px;border:1px solid var(--line);border-radius:10px;font-size:14px;outline:none;margin-bottom:22px">
|
||||
<div class="grid c3" id="list">
|
||||
<!--PLUGIN_CARDS-->
|
||||
</div>
|
||||
<div class="note" style="margin-top:26px">插件安装后会写进你的资料目录 <code>~/Documents/ImageWorkbench/plugins/</code>;卸载只删插件文件,不动画布与图库。</div>
|
||||
</div></section>
|
||||
</main>
|
||||
<!--FOOTER-->
|
||||
<script>
|
||||
var q = document.getElementById('q'), list = document.getElementById('list'), chips = document.getElementById('chips'), activeTag = ''
|
||||
function apply () {
|
||||
var kw = (q.value || '').trim().toLowerCase()
|
||||
Array.prototype.forEach.call(list.children, function (el) {
|
||||
var okKw = !kw || el.dataset.name.indexOf(kw) >= 0
|
||||
var okTag = !activeTag || (',' + el.dataset.tags + ',').indexOf(',' + activeTag + ',') >= 0
|
||||
var ok = okKw && okTag
|
||||
el.style.display = ok ? '' : 'none'
|
||||
})
|
||||
}
|
||||
q.addEventListener('input', apply)
|
||||
chips.addEventListener('click', function (e) {
|
||||
var b = e.target.closest('button[data-tag]'); if (!b) return
|
||||
Array.prototype.forEach.call(chips.children, function (x) { x.style.background = ''; x.style.color = ''; x.style.borderColor = 'transparent' })
|
||||
b.style.background = '#111'; b.style.color = '#fff'; b.style.borderColor = '#111'
|
||||
activeTag = b.dataset.tag || ''
|
||||
apply()
|
||||
})
|
||||
</script>
|
||||
</body></html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 382 KiB |
@@ -0,0 +1,141 @@
|
||||
:root{--fg:#111;--muted:#6b7280;--line:#ebebeb;--soft:#f7f7f8;--radius:16px}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;padding:0}
|
||||
body{background:#fff;color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}
|
||||
a{color:inherit;text-decoration:none}
|
||||
.wrap{max-width:1120px;margin:0 auto;padding:0 24px}
|
||||
nav{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.82);backdrop-filter:saturate(1.6) blur(12px);border-bottom:1px solid var(--line)}
|
||||
nav .inner{display:flex;align-items:center;gap:26px;height:60px}
|
||||
nav .brand{display:flex;align-items:center;gap:9px;font-weight:650;letter-spacing:-.01em}
|
||||
nav .brand .dot{width:22px;height:22px;border-radius:6px;background:#111;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:700}
|
||||
nav .links{display:flex;gap:20px;margin-left:8px;color:var(--muted);font-size:14px}
|
||||
nav .links a:hover{color:var(--fg)}
|
||||
nav .links a.on{color:var(--fg)}
|
||||
nav .right{margin-left:auto;display:flex;align-items:center;gap:10px}
|
||||
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:38px;padding:0 18px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--fg);font-size:14px;font-weight:550;cursor:pointer;transition:.15s}
|
||||
.btn:hover{border-color:#d4d4d4;background:#fafafa}
|
||||
.btn.primary{background:#111;color:#fff;border-color:#111}
|
||||
.btn.primary:hover{background:#000}
|
||||
.btn.lg{height:44px;padding:0 22px;font-size:15px}
|
||||
.hero{padding:84px 0 20px;text-align:center}
|
||||
.kicker{display:inline-flex;align-items:center;gap:8px;padding:5px 12px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12.5px}
|
||||
.hero h1{font-size:56px;line-height:1.08;letter-spacing:-.03em;margin:22px 0 0;font-weight:700}
|
||||
.hero p.sub{max-width:660px;margin:20px auto 0;color:var(--muted);font-size:17px;line-height:1.75}
|
||||
.hero .cta{display:flex;gap:12px;justify-content:center;margin-top:30px;flex-wrap:wrap}
|
||||
.hero .meta{margin-top:16px;color:#9ca3af;font-size:12.5px}
|
||||
.shot{margin:40px 0 0;padding:0 0 64px}
|
||||
.shot img{width:100%;display:block;border-radius:var(--radius);border:1px solid var(--line);box-shadow:0 30px 70px -30px rgba(15,23,42,.35)}
|
||||
.section{padding:72px 0;border-top:1px solid var(--line)}
|
||||
.section h2{font-size:30px;letter-spacing:-.02em;margin:0 0 8px;font-weight:680}
|
||||
.section p.lead{color:var(--muted);margin:0 0 34px;max-width:660px}
|
||||
.grid{display:grid;gap:16px}
|
||||
.grid.c3{grid-template-columns:repeat(3,1fr)}
|
||||
.grid.c2{grid-template-columns:repeat(2,1fr)}
|
||||
.card{border:1px solid var(--line);border-radius:var(--radius);padding:22px;background:#fff}
|
||||
.card h3{margin:0 0 6px;font-size:16px;font-weight:650}
|
||||
.card p{margin:0;color:var(--muted);font-size:13.5px;line-height:1.7}
|
||||
.card .ico{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;margin-bottom:14px}
|
||||
.pcard{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:14px;padding:18px;background:#fff}
|
||||
.pcard .head{display:flex;gap:10px;align-items:center}
|
||||
.pcard .av{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:17px;flex:0 0 34px}
|
||||
.pcard .nm{font-weight:640;font-size:14.5px}
|
||||
.pcard .ver{color:var(--muted);font-size:12px;margin-top:1px}
|
||||
.pcard .desc{color:var(--muted);font-size:13px;line-height:1.65;flex:1 1 auto}
|
||||
.tags{display:flex;gap:6px;flex-wrap:wrap}
|
||||
.tag{padding:1px 8px;border-radius:999px;background:var(--soft);color:var(--muted);font-size:11.5px;border:1px solid transparent;font-family:inherit}
|
||||
.dl{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
|
||||
.dl a{border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:4px;transition:.15s}
|
||||
.dl a:hover{border-color:#d4d4d4;background:#fafafa}
|
||||
.dl .n{font-weight:640}
|
||||
.dl .s{color:var(--muted);font-size:12.5px}
|
||||
.dl .none{border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:4px;opacity:.55}
|
||||
footer{background:#0b0b0c;color:#9ca3af;padding:52px 0 40px}
|
||||
footer .cols{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:24px}
|
||||
footer h4{color:#fff;font-size:13px;margin:0 0 10px;font-weight:600}
|
||||
footer a{display:block;color:#9ca3af;font-size:13px;margin:6px 0}
|
||||
footer a:hover{color:#fff}
|
||||
footer .copy{border-top:1px solid #1f1f22;margin-top:34px;padding-top:18px;font-size:12px;color:#6b7280;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
|
||||
.steps{margin:6px 0 0;padding-left:20px;color:var(--muted);font-size:13.5px;line-height:1.9}
|
||||
.steps b{color:var(--fg)}
|
||||
pre.cmd{margin:10px 0 0;padding:10px 12px;background:var(--soft);border:1px solid var(--line);border-radius:8px;overflow-x:auto}
|
||||
pre.cmd code{font-size:12.5px}
|
||||
.note{margin:10px 0 0;color:var(--muted);font-size:12.5px;line-height:1.8}
|
||||
@media(max-width:900px){.hero h1{font-size:38px}.grid.c3,.dl{grid-template-columns:1fr 1fr}footer .cols{grid-template-columns:1fr 1fr}}
|
||||
@media(max-width:600px){.grid.c3,.grid.c2,.dl{grid-template-columns:1fr}nav .links{display:none}}
|
||||
|
||||
/* ── 油画主视觉 + 特效 ───────────────────────────────── */
|
||||
.artwrap{position:relative;max-width:1120px;margin:26px auto 0;padding:0 24px 72px}
|
||||
.art-glow{position:absolute;inset:-40px 0 auto 0;height:520px;pointer-events:none;
|
||||
background:
|
||||
radial-gradient(46% 60% at 22% 40%, rgba(255,178,92,.28), transparent 70%),
|
||||
radial-gradient(40% 55% at 78% 30%, rgba(58,120,140,.22), transparent 70%),
|
||||
radial-gradient(60% 70% at 50% 0%, rgba(255,214,150,.35), transparent 72%);
|
||||
filter:blur(10px);opacity:.9;animation:glowPulse 12s ease-in-out infinite alternate}
|
||||
.art-frame{position:relative;border-radius:22px;overflow:hidden;border:1px solid var(--line);
|
||||
box-shadow:0 40px 90px -40px rgba(15,23,42,.45)}
|
||||
.art-frame .art{display:block;width:100%;height:auto;transform:scale(1.02);animation:kenburns 28s ease-in-out infinite alternate}
|
||||
.art-frame .grain{position:absolute;inset:0;pointer-events:none;opacity:.14;mix-blend-mode:multiply;
|
||||
background-image:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")}
|
||||
.art-frame:after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:22px;box-shadow:inset 0 0 120px rgba(120,80,30,.16)}
|
||||
@keyframes kenburns{from{transform:scale(1.02) translate3d(0,0,0)}to{transform:scale(1.08) translate3d(-1.2%,-1%,0)}}
|
||||
@keyframes glowPulse{from{opacity:.72;transform:translateY(0)}to{opacity:1;transform:translateY(-10px)}}
|
||||
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
|
||||
.hero h1,.hero p.sub,.hero .cta,.hero .meta,.hero .kicker{animation:rise .7s cubic-bezier(.22,.61,.36,1) both}
|
||||
.hero h1{animation-delay:.04s}.hero p.sub{animation-delay:.1s}.hero .cta{animation-delay:.16s}.hero .meta{animation-delay:.22s}
|
||||
.artwrap{animation:rise .9s cubic-bezier(.22,.61,.36,1) .18s both}
|
||||
.card,.pcard,.dl a{transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease}
|
||||
.card:hover,.pcard:hover{transform:translateY(-3px);box-shadow:0 16px 40px -24px rgba(15,23,42,.38);border-color:#dcdcdc}
|
||||
.dl a:hover{transform:translateY(-2px);box-shadow:0 16px 40px -24px rgba(15,23,42,.35)}
|
||||
.section h2:after{content:"";display:block;width:36px;height:3px;border-radius:2px;margin-top:12px;background:linear-gradient(90deg,#e8a735,#3a788c)}
|
||||
@media (prefers-reduced-motion:reduce){
|
||||
.hero h1,.hero p.sub,.hero .cta,.hero .meta,.hero .kicker,.artwrap,.art-frame .art,.art-glow{animation:none!important}
|
||||
.card:hover,.pcard:hover,.dl a:hover{transform:none}
|
||||
}
|
||||
|
||||
/* 主视觉改为宽幅裁切:突出画面中段的油彩笔触 */
|
||||
.art-frame{aspect-ratio:auto}
|
||||
.art-frame .art{width:100%;height:clamp(300px,40vw,540px);object-fit:cover;object-position:50% 62%}
|
||||
.art-frame:before{content:"";position:absolute;left:0;right:0;bottom:0;height:38%;pointer-events:none;z-index:2;
|
||||
background:linear-gradient(to top, rgba(255,255,255,.92), rgba(255,255,255,.35) 45%, transparent)}
|
||||
|
||||
/* ── 滚动入场 + 视差 ───────────────────────────────── */
|
||||
.reveal{opacity:0;transform:translateY(18px);transition:opacity .7s cubic-bezier(.22,.61,.36,1),transform .7s cubic-bezier(.22,.61,.36,1)}
|
||||
.reveal.in{opacity:1;transform:none}
|
||||
.section h2.reveal.in:after{animation:barIn .7s ease both}
|
||||
@keyframes barIn{from{width:0}to{width:36px}}
|
||||
.art-frame{will-change:transform}
|
||||
@media (prefers-reduced-motion:reduce){.reveal{opacity:1;transform:none;transition:none}}
|
||||
|
||||
/* 首屏露出更多油彩:裁切位置上移 + 收紧 hero 间距 */
|
||||
.hero{padding:64px 0 8px}
|
||||
.art-frame .art{object-position:50% 34%}
|
||||
.artwrap{margin-top:14px}
|
||||
|
||||
/* ── 首屏:油画做背景(白纱压一层,保证文字可读) ─────────── */
|
||||
.hero-art{position:relative;padding:76px 0 96px;overflow:hidden}
|
||||
.hero-bg{position:absolute;inset:0;z-index:0;overflow:hidden}
|
||||
.hero-bg img{width:100%;height:100%;object-fit:cover;object-position:50% 58%;transform:scale(1.06);animation:kenburns 30s ease-in-out infinite alternate;filter:saturate(1.05)}
|
||||
.hero-veil{position:absolute;inset:0;z-index:1;
|
||||
background:
|
||||
radial-gradient(70% 60% at 50% 38%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.72) 42%, rgba(255,255,255,.1) 100%),
|
||||
linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.55) 46%, rgba(255,255,255,.28) 72%, #fff 100%)}
|
||||
.hero-art .wrap{position:relative;z-index:2}
|
||||
.art-strip{position:relative;height:150px;overflow:hidden;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
|
||||
background:url('/assets/painting.jpg') center 62%/cover no-repeat}
|
||||
.art-strip:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.85),rgba(255,255,255,.15) 40%,rgba(255,255,255,.85))}
|
||||
.art-strip .grain{position:absolute;inset:0;opacity:.12;mix-blend-mode:multiply;
|
||||
background-image:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")}
|
||||
|
||||
/* 可读性微调:背景轻微模糊 + 更强的白纱,meta 加深 */
|
||||
.hero-bg img{filter:blur(1.5px) saturate(1.05)}
|
||||
.hero-veil{background:
|
||||
radial-gradient(62% 58% at 50% 40%, rgba(255,255,255,.96) 0%, rgba(255,255,255,.86) 46%, rgba(255,255,255,.32) 100%),
|
||||
linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.66) 50%, rgba(255,255,255,.35) 76%, #fff 100%)}
|
||||
.hero .meta{color:#6b7280}
|
||||
.hero-art{padding:72px 0 84px}
|
||||
|
||||
/* 头图白纱减淡:让油画色彩多透出来一点(文字仍保持可读) */
|
||||
.hero-bg img{filter:blur(1px) saturate(1.06)}
|
||||
.hero-veil{background:
|
||||
radial-gradient(62% 58% at 50% 40%, rgba(255,255,255,.86) 0%, rgba(255,255,255,.70) 46%, rgba(255,255,255,.16) 100%),
|
||||
linear-gradient(180deg, rgba(255,255,255,.84) 0%, rgba(255,255,255,.52) 50%, rgba(255,255,255,.20) 76%, #fff 100%)}
|
||||
@@ -0,0 +1,138 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Image Workbench · 下载</title>
|
||||
<link rel="stylesheet" href="/assets/style.css?v=" + encodeURIComponent(latest.version + '-' + Date.now().toString(36)) + "">
|
||||
<style>
|
||||
*{box-sizing:border-box}
|
||||
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
|
||||
.dlwrap{max-width:760px;margin:0 auto;padding:48px 0 64px}
|
||||
h1{font-size:27px;margin:0 0 6px;letter-spacing:-.01em}
|
||||
.sub{color:var(--muted);margin:0 0 34px}
|
||||
h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:38px 0 2px}
|
||||
.row{display:flex;align-items:center;gap:16px;padding:15px 0;border-bottom:1px solid var(--line)}
|
||||
.row:first-of-type{border-top:1px solid var(--line)}
|
||||
.name{flex:1 1 auto;font-weight:550}
|
||||
.hint{color:var(--muted);font-size:12.5px;font-weight:400;margin-top:2px}
|
||||
.meta{flex:0 0 auto;text-align:right;color:var(--muted);font-size:13px}
|
||||
.hash{font-size:11.5px;opacity:.75;margin-top:2px;font-variant-numeric:tabular-nums}
|
||||
.btn{flex:0 0 auto;font-size:13px;padding:7px 18px;border-radius:8px;background:var(--brand);color:var(--bg);text-decoration:none}
|
||||
.btn:hover{opacity:.88}
|
||||
.muted{flex:0 0 auto;font-size:13px;color:var(--muted);opacity:.7}
|
||||
.foot{margin-top:46px;color:var(--muted);font-size:12.5px;line-height:1.8}
|
||||
.foot a{color:inherit}
|
||||
code{font-size:12.5px}
|
||||
.steps{margin:6px 0 0;padding-left:22px;color:var(--fg2);font-size:13.5px;line-height:1.9}
|
||||
.steps li{margin:2px 0}
|
||||
.steps b{color:var(--fg);font-weight:600}
|
||||
pre.cmd{margin:10px 0 0;padding:10px 12px;background:var(--bg2);border:1px solid var(--line);border-radius:8px;overflow-x:auto}
|
||||
pre.cmd code{font-size:12px;color:var(--fg)}
|
||||
.note{margin:10px 0 0;color:var(--muted);font-size:12.5px;line-height:1.8}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
|
||||
<div class="links">
|
||||
<a href="/">首页</a>
|
||||
<a href="/download/" class="on">下载</a>
|
||||
<a href="/plugins/">插件</a>
|
||||
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
|
||||
<div class="wrap"><div class="dlwrap">
|
||||
<h1>Image Workbench</h1>
|
||||
<p class="sub">本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)</p>
|
||||
|
||||
<h2>下载</h2>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
|
||||
<div class="meta">版本 3.25.4 · 7.3 MB · .dmg<div class="hash">sha256 0c02574f197fac48…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.4_aarch64.dmg">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
|
||||
<div class="meta">版本 3.25.4 · 7.6 MB · .dmg<div class="hash">sha256 f04664f6e051ae20…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.4_x64.dmg">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
|
||||
<div class="meta"></div>
|
||||
<span class="muted">暂未提供</span>
|
||||
</div>
|
||||
|
||||
<h2>系统要求</h2>
|
||||
<div class="row">
|
||||
<div class="name">macOS 12 及以上 / Windows 10 1803 及以上(含 WebView2)
|
||||
<div class="hint">数据全部保存在本地目录 <code>~/Documents/ImageWorkbench</code>,可整目录备份与迁移。</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>安装步骤(macOS)</h2>
|
||||
<ol class="steps">
|
||||
<li>下载上面的 <b>.dmg</b>(Apple 芯片选 Apple Silicon;老 Intel 机器选 Intel)。</li>
|
||||
<li>双击打开 dmg,把 <b>Image Workbench</b> 图标拖进「应用程序」文件夹。</li>
|
||||
<li>第一次启动:打开「应用程序」,<b>右键点图标 → 打开</b>,弹窗里再点一次「打开」。</li>
|
||||
<li>如果提示「已损坏」或「无法验证开发者」:打开「终端」,粘贴执行下面这条命令,然后重新打开应用。</li>
|
||||
</ol>
|
||||
<pre class="cmd"><code>xattr -dr com.apple.quarantine "/Applications/image-workbench.app"</code></pre>
|
||||
<p class="note">说明:安装包未做 Apple 公证($99/年开发者账号),所以第一次需要手动放行;这一步只做一次。<br>
|
||||
之后有新版本时,应用内 <b>设置 → 通用 → 版本与更新 → 检查更新</b> 就能一键升级,不用再下载安装包。</p>
|
||||
|
||||
<h2>安装步骤(Windows)</h2>
|
||||
<ol class="steps">
|
||||
<li>下载 <b>.exe</b>(NSIS 安装包,按当前用户安装,不需要管理员权限)。</li>
|
||||
<li>双击运行;若出现「Windows 已保护你的电脑」,点「更多信息 → 仍要运行」。</li>
|
||||
<li>安装完成后从开始菜单启动;数据在 <code>%USERPROFILE%DocumentsImageWorkbench</code>。</li>
|
||||
</ol>
|
||||
|
||||
<h2>历史版本</h2>
|
||||
<div class="row">
|
||||
<div class="name">3.25.4<div class="hint">Intel 版:剪贴板兜底</div></div>
|
||||
<div class="meta">2026-11-18<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.3<div class="hint">Windows:剪贴板修复(Cmd+C/V、粘贴图片/文本、复制图片)+ 可自动更新</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.2<div class="hint">Windows:无内置插件 + 市场安装 + 页内确认 + 在线更新(首次需手动安装)</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.1<div class="hint">Intel Mac 版:性能与数据卫生(图库清单去 base64、缩略图落盘、回收 20.2MB)</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.0<div class="hint">应用不再内置插件(全部从市场安装);页内确认替代原生 confirm;插件市场与开发者模式</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.24.85<div class="hint">每张画布单独成文件、资源库分类、设置面板重构、下载改为按需落盘</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
|
||||
</div>
|
||||
|
||||
<div class="foot">
|
||||
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-17
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<footer><div class="wrap">
|
||||
<div class="cols">
|
||||
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
|
||||
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
|
||||
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
|
||||
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
|
||||
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
|
||||
</div>
|
||||
<div class="copy"><span>© Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
|
||||
</div></footer>
|
||||
</body>
|
||||
</html>
|
||||
+140
-73
@@ -1,78 +1,145 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Image Workbench · 下载</title>
|
||||
<style>
|
||||
:root{--bg:#fafaf9;--fg:#1c1917;--muted:#78716c;--line:#e7e5e4;--card:#fff;--brand:#1c1917}
|
||||
@media (prefers-color-scheme:dark){:root{--bg:#17161a;--fg:#f5f5f4;--muted:#a8a29e;--line:#2f2d33;--card:#1f1e23;--brand:#f5f5f4}}
|
||||
*{box-sizing:border-box}
|
||||
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
|
||||
.wrap{max-width:760px;margin:0 auto;padding:56px 22px 72px}
|
||||
h1{font-size:27px;margin:0 0 6px;letter-spacing:-.01em}
|
||||
.sub{color:var(--muted);margin:0 0 34px}
|
||||
h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:38px 0 2px}
|
||||
.row{display:flex;align-items:center;gap:16px;padding:15px 0;border-bottom:1px solid var(--line)}
|
||||
.row:first-of-type{border-top:1px solid var(--line)}
|
||||
.name{flex:1 1 auto;font-weight:550}
|
||||
.hint{color:var(--muted);font-size:12.5px;font-weight:400;margin-top:2px}
|
||||
.meta{flex:0 0 auto;text-align:right;color:var(--muted);font-size:13px}
|
||||
.hash{font-size:11.5px;opacity:.75;margin-top:2px;font-variant-numeric:tabular-nums}
|
||||
.btn{flex:0 0 auto;font-size:13px;padding:7px 18px;border-radius:8px;background:var(--brand);color:var(--bg);text-decoration:none}
|
||||
.btn:hover{opacity:.88}
|
||||
.muted{flex:0 0 auto;font-size:13px;color:var(--muted);opacity:.7}
|
||||
.foot{margin-top:46px;color:var(--muted);font-size:12.5px;line-height:1.8}
|
||||
.foot a{color:inherit}
|
||||
code{font-size:12.5px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<h1>Image Workbench</h1>
|
||||
<p class="sub">本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)</p>
|
||||
|
||||
<h2>下载</h2>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
|
||||
<div class="meta">版本 3.25.1 · 6.2 MB · .dmg<div class="hash">sha256 5b711840b36a10ba…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.1_aarch64.dmg">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
|
||||
<div class="meta"></div>
|
||||
<span class="muted">暂未提供</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
|
||||
<div class="meta"></div>
|
||||
<span class="muted">暂未提供</span>
|
||||
</div>
|
||||
|
||||
<h2>系统要求</h2>
|
||||
<div class="row">
|
||||
<div class="name">macOS 12 及以上 / Windows 10 1803 及以上(含 WebView2)
|
||||
<div class="hint">数据全部保存在本地目录 <code>~/Documents/ImageWorkbench</code>,可整目录备份与迁移。</div>
|
||||
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Image Workbench · 本地优先的 AI 生图工作台</title>
|
||||
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.25.4-mwlb87vw">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
|
||||
<div class="links">
|
||||
<a href="/" class="on">首页</a>
|
||||
<a href="/download/">下载</a>
|
||||
<a href="/plugins/">插件</a>
|
||||
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.25.4</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
<section class="hero hero-art">
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.4-mwlb87vw" alt=""></div>
|
||||
<div class="hero-veil"></div>
|
||||
<div class="wrap">
|
||||
<span class="kicker">v3.25.4 · macOS / Windows · 数据在本地</span>
|
||||
<h1>本地优先的<br>AI 生图无限画布</h1>
|
||||
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
|
||||
<div class="cta">
|
||||
<a class="btn primary lg" href="/download/">下载 v3.25.4</a>
|
||||
<a class="btn lg" href="/plugins/">浏览 7 个插件</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
|
||||
</div></section>
|
||||
|
||||
<h2>历史版本</h2>
|
||||
<div class="row">
|
||||
<div class="name">3.25.1<div class="hint">性能与数据卫生:图库清单去 base64(223 倍)、画布缩略图落盘、回收 20.2MB 垃圾图、备份含插件</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.0<div class="hint">应用不再内置插件(全部从市场安装);页内确认替代原生 confirm;插件市场与开发者模式</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.24.85<div class="hint">每张画布单独成文件、资源库分类、设置面板重构、下载改为按需落盘</div></div>
|
||||
<div class="meta">2026-11-17<div class="hint">macOS · Apple Silicon</div></div>
|
||||
</div>
|
||||
|
||||
<div class="foot">
|
||||
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-17
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>为「一个人跑完整条产线」而做</h2>
|
||||
<p class="lead">不做又一个在线生图站点。它活在你的桌面上,把生图、修图、批量、图库和插件放在同一张画布上。</p>
|
||||
<div class="grid c3">
|
||||
<div class="card"><div class="ico" style="background:#eef2ff">💻</div>
|
||||
<h3>本地优先</h3><p>图片与数据保存在 ~/Documents/ImageWorkbench,不经服务器中转;可整目录备份、迁移到新电脑。</p></div>
|
||||
<div class="card"><div class="ico" style="background:#fff7ed">🕸️</div>
|
||||
<h3>节点式无限画布</h3><p>参考图 → 提示词 → 生成 → 图库,用连线把工作流串起来;一张画布容纳整条生产线。</p></div>
|
||||
<div class="card"><div class="ico" style="background:#ecfdf5">🧩</div>
|
||||
<h3>插件按需安装</h3><p>应用本体不含插件,需要什么装什么;可随时启停,关闭后入口自动隐藏。</p></div>
|
||||
</div>
|
||||
</div></section>
|
||||
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>插件:本体不带,需要的自己装</h2>
|
||||
<p class="lead">应用本体不再内置插件。设置里打开市场,点「安装」,重启即可用;不需要的点一下就能关掉。</p>
|
||||
<div class="grid c3">
|
||||
<div class="pcard" data-name="批量出图 batch-export 资源中心勾选节点,串行批量生成并打包 zip 下载 出图 批处理" data-tags="出图,批处理">
|
||||
<div class="head"><span class="av" style="background:#e8f0fe">🗂️</span>
|
||||
<div><div class="nm">批量出图</div><div class="ver">v1.2.0 · 官方</div></div></div>
|
||||
<div class="desc">资源中心勾选节点,串行批量生成并打包 ZIP 下载</div>
|
||||
<div class="tags"><span class="tag">出图</span><span class="tag">批处理</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="空白画布 blank-canvas 新建空白画布节点,用于分区分组 画布 效率" data-tags="画布,效率">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">⬜</span>
|
||||
<div><div class="nm">空白画布</div><div class="ver">v1.0.0 · 官方</div></div></div>
|
||||
<div class="desc">新建空白画布节点,用于分区分组</div>
|
||||
<div class="tags"><span class="tag">画布</span><span class="tag">效率</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="标注 / 修图 image-annotate 在画布内标注、涂抹、局部重绘 修图 标注" data-tags="修图,标注">
|
||||
<div class="head"><span class="av" style="background:#fdeaea">🖌️</span>
|
||||
<div><div class="nm">标注 / 修图</div><div class="ver">v1.20.6 · 官方</div></div></div>
|
||||
<div class="desc">在画布内标注、涂抹、局部重绘</div>
|
||||
<div class="tags"><span class="tag">修图</span><span class="tag">标注</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="位图转矢量 image-vectorize 把位图转成 svg 矢量路径 转换 矢量" data-tags="转换,矢量">
|
||||
<div class="head"><span class="av" style="background:#eaf3ea">✒️</span>
|
||||
<div><div class="nm">位图转矢量</div><div class="ver">v0.4.2 · 官方</div></div></div>
|
||||
<div class="desc">把位图转成 SVG 矢量路径</div>
|
||||
<div class="tags"><span class="tag">转换</span><span class="tag">矢量</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="风格库 style-source 风格提示词库与一键套用 提示词 风格" data-tags="提示词,风格">
|
||||
<div class="head"><span class="av" style="background:#fdf0e6">🎨</span>
|
||||
<div><div class="nm">风格库</div><div class="ver">v1.3.2 · 官方</div></div></div>
|
||||
<div class="desc">风格提示词库与一键套用</div>
|
||||
<div class="tags"><span class="tag">提示词</span><span class="tag">风格</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="白底图 white-bg-800 批量生成电商白底图(800px) 电商 出图" data-tags="电商,出图">
|
||||
<div class="head"><span class="av" style="background:#eef7fb">🧾</span>
|
||||
<div><div class="nm">白底图</div><div class="ver">v1.2.1 · 官方</div></div></div>
|
||||
<div class="desc">批量生成电商白底图(800px)</div>
|
||||
<div class="tags"><span class="tag">电商</span><span class="tag">出图</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top:22px"><a class="btn" href="/plugins/">查看全部 7 个插件</a></div>
|
||||
</div></section>
|
||||
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>下载 Image Workbench</h2>
|
||||
<p class="lead">选你的平台。装过一次之后,以后在应用内「设置 → 通用 → 版本与更新」就能一键升级。</p>
|
||||
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.25.4_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.4_x64.dmg"><div class="n">macOS · Intel</div><div class="s">x86_64 · 7.6 MB · .dmg</div></a>
|
||||
<div class="none"><div class="n">Windows · x64</div><div class="s">暂未提供</div></div></div>
|
||||
<div style="margin-top:20px;color:#9ca3af;font-size:12.5px">安装包未做 Apple 公证 / Windows 代码签名,首次打开需手动放行一次,细节见 <a href="/download/" style="text-decoration:underline">下载页</a>。</div>
|
||||
</div></section>
|
||||
</main>
|
||||
<footer><div class="wrap">
|
||||
<div class="cols">
|
||||
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
|
||||
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
|
||||
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
|
||||
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
|
||||
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<div class="copy"><span>© 2026 Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
|
||||
</div></footer>
|
||||
</body></html>
|
||||
<script>
|
||||
(function () {
|
||||
var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||
var targets = [].slice.call(document.querySelectorAll('.section h2, .section p.lead, .card, .pcard, .dl a'))
|
||||
targets.forEach(function (el) { el.classList.add('reveal') })
|
||||
if (!reduce && 'IntersectionObserver' in window) {
|
||||
var io = new IntersectionObserver(function (entries) {
|
||||
entries.forEach(function (e) {
|
||||
if (!e.isIntersecting) return
|
||||
var el = e.target
|
||||
var idx = targets.indexOf(el) % 4
|
||||
el.style.transitionDelay = (idx * 60) + 'ms'
|
||||
el.classList.add('in')
|
||||
io.unobserve(el)
|
||||
})
|
||||
}, { rootMargin: '0px 0px -8% 0px', threshold: 0.12 })
|
||||
targets.forEach(function (el) { io.observe(el) })
|
||||
} else { targets.forEach(function (el) { el.classList.add('in') }) }
|
||||
var art = document.querySelector('.art-frame')
|
||||
if (art && !reduce) {
|
||||
var raf = 0
|
||||
var onScroll = function () {
|
||||
if (raf) return
|
||||
raf = requestAnimationFrame(function () {
|
||||
raf = 0
|
||||
var y = Math.min(1, Math.max(0, window.scrollY / 700))
|
||||
art.style.transform = 'translate3d(0,' + (y * -14) + 'px,0)'
|
||||
})
|
||||
}
|
||||
window.addEventListener('scroll', onScroll, { passive: true }); onScroll()
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
@@ -0,0 +1,132 @@
|
||||
{
|
||||
"version": 1,
|
||||
"updatedAt": "2026-11-17T13:04:29.617Z",
|
||||
"plugins": [
|
||||
{
|
||||
"id": "batch-export",
|
||||
"name": "批量出图",
|
||||
"desc": "资源中心勾选节点,串行批量生成并打包 ZIP 下载",
|
||||
"author": "official",
|
||||
"icon": "🗂️",
|
||||
"color": "#e8f0fe",
|
||||
"tags": [
|
||||
"出图",
|
||||
"批处理"
|
||||
],
|
||||
"version": "1.2.0",
|
||||
"apiVersion": 1,
|
||||
"file": "plugins/plugin-batch-export.b7d13ba66cf9.js",
|
||||
"size": 44329,
|
||||
"sha256": "b7d13ba66cf97ff65e94305328183a1a3b5a45b0393f3a63f77f6b7b46795389",
|
||||
"integrity": "sha256-t9E7pmz5f/ZelDBTKBg6GjtaRbA5Pzpj939re0Z5U4k="
|
||||
},
|
||||
{
|
||||
"id": "blank-canvas",
|
||||
"name": "空白画布",
|
||||
"desc": "新建空白画布节点,用于分区分组",
|
||||
"author": "official",
|
||||
"icon": "⬜",
|
||||
"color": "#eef2f6",
|
||||
"tags": [
|
||||
"画布",
|
||||
"效率"
|
||||
],
|
||||
"version": "1.0.0",
|
||||
"apiVersion": 1,
|
||||
"file": "plugins/plugin-blank-canvas.67763893fa99.js",
|
||||
"size": 6094,
|
||||
"sha256": "67763893fa99c8fe1d8bcf640426f5bbc576abd35bcdc84c910b7b08f79964f9",
|
||||
"integrity": "sha256-Z3Y4k/qZyP4di89kBCb1u8V2q9NbzchMkQt7CPeZZPk="
|
||||
},
|
||||
{
|
||||
"id": "image-annotate",
|
||||
"name": "标注 / 修图",
|
||||
"desc": "在画布内标注、涂抹、局部重绘",
|
||||
"author": "official",
|
||||
"icon": "🖌️",
|
||||
"color": "#fdeaea",
|
||||
"tags": [
|
||||
"修图",
|
||||
"标注"
|
||||
],
|
||||
"version": "1.20.6",
|
||||
"apiVersion": 1,
|
||||
"file": "plugins/plugin-image-annotate.7a865c7c353c.js",
|
||||
"size": 461523,
|
||||
"sha256": "7a865c7c353c3fbcaac551a8aeb5acd1bf624ca25f104db96fce493c3084b24f",
|
||||
"integrity": "sha256-eoZcfDU8P7yqxVGorrWs0b9iTKJfEE25b85JPDCEsk8="
|
||||
},
|
||||
{
|
||||
"id": "image-vectorize",
|
||||
"name": "位图转矢量",
|
||||
"desc": "把位图转成 SVG 矢量路径",
|
||||
"author": "official",
|
||||
"icon": "✒️",
|
||||
"color": "#eaf3ea",
|
||||
"tags": [
|
||||
"转换",
|
||||
"矢量"
|
||||
],
|
||||
"version": "0.4.2",
|
||||
"apiVersion": 1,
|
||||
"file": "plugins/plugin-image-vectorize.03b5fc850c34.js",
|
||||
"size": 144780,
|
||||
"sha256": "03b5fc850c34ddc0996bafc367798fb60aecc9bb23b92990dd5ccc59ed74bfc9",
|
||||
"integrity": "sha256-A7X8hQw03cCZa6/DZ3mPtgrsybsjuSmQ3VzMWe10v8k="
|
||||
},
|
||||
{
|
||||
"id": "style-source",
|
||||
"name": "风格库",
|
||||
"desc": "风格提示词库与一键套用",
|
||||
"author": "official",
|
||||
"icon": "🎨",
|
||||
"color": "#fdf0e6",
|
||||
"tags": [
|
||||
"提示词",
|
||||
"风格"
|
||||
],
|
||||
"version": "1.3.2",
|
||||
"apiVersion": 1,
|
||||
"file": "plugins/plugin-style-source.ee7168565a44.js",
|
||||
"size": 69925,
|
||||
"sha256": "ee7168565a44d49daaf300f62d5c7a106e60fba29a9e4888ff8bfd9abd2e3178",
|
||||
"integrity": "sha256-7nFoVlpE1J2q8wD2LVx6EG5g+6KankiI/4v9mr0uMXg="
|
||||
},
|
||||
{
|
||||
"id": "white-bg-800",
|
||||
"name": "白底图",
|
||||
"desc": "批量生成电商白底图(800px)",
|
||||
"author": "official",
|
||||
"icon": "🧾",
|
||||
"color": "#eef7fb",
|
||||
"tags": [
|
||||
"电商",
|
||||
"出图"
|
||||
],
|
||||
"version": "1.2.1",
|
||||
"apiVersion": 1,
|
||||
"file": "plugins/plugin-white-bg-800.a5a92f045c0d.js",
|
||||
"size": 14957,
|
||||
"sha256": "a5a92f045c0d4046b205562019b2a6354afd14aa92375b78559d48f2ce9b74ee",
|
||||
"integrity": "sha256-pakvBFwNQEayBVYgGbKmNUr9FKqSN1t4VZ1I8s6bdO4="
|
||||
},
|
||||
{
|
||||
"id": "xianyi-cutout",
|
||||
"name": "鲜艺抠图",
|
||||
"desc": "接入鲜艺抠图模型的一键去背景",
|
||||
"author": "official",
|
||||
"icon": "✂️",
|
||||
"color": "#f3eafd",
|
||||
"tags": [
|
||||
"抠图",
|
||||
"去背景"
|
||||
],
|
||||
"version": "1.0.3",
|
||||
"apiVersion": 1,
|
||||
"file": "plugins/plugin-xianyi-cutout.79c8c47dfc61.js",
|
||||
"size": 4488,
|
||||
"sha256": "79c8c47dfc6187b8af2688763e7f63034bb26867ccefbf135ed76d3745d6e24d",
|
||||
"integrity": "sha256-ecjEffxhh7ivJoh2Pn9jA0uyaGfM778TXtdtN0XW4k0="
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>插件市场 · Image Workbench</title>
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.25.4-mwlb87vw">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
|
||||
<div class="links">
|
||||
<a href="/">首页</a>
|
||||
<a href="/download/">下载</a>
|
||||
<a href="/plugins/" class="on">插件</a>
|
||||
<a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.25.4</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
<section class="hero" style="padding:64px 0 8px;text-align:left"><div class="wrap">
|
||||
<h1 style="font-size:40px;margin:0">插件市场</h1>
|
||||
<p class="sub" style="margin:14px 0 0;text-align:left;max-width:720px">共 7 个插件。安装方式:应用内 <b>设置 → 插件 → 浏览</b>,点「安装」后重启生效。</p>
|
||||
</div></section>
|
||||
<section class="section" style="border-top:0;padding-top:24px"><div class="wrap">
|
||||
<div style="display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px" id="chips">
|
||||
<button class="tag on" data-tag="" style="cursor:pointer;background:#111;color:#fff;border-color:#111;padding:5px 12px">全部</button>
|
||||
<button class="tag" data-tag="出图" style="cursor:pointer;padding:5px 12px">出图</button>
|
||||
<button class="tag" data-tag="批处理" style="cursor:pointer;padding:5px 12px">批处理</button>
|
||||
<button class="tag" data-tag="画布" style="cursor:pointer;padding:5px 12px">画布</button>
|
||||
<button class="tag" data-tag="效率" style="cursor:pointer;padding:5px 12px">效率</button>
|
||||
<button class="tag" data-tag="修图" style="cursor:pointer;padding:5px 12px">修图</button>
|
||||
<button class="tag" data-tag="标注" style="cursor:pointer;padding:5px 12px">标注</button>
|
||||
<button class="tag" data-tag="转换" style="cursor:pointer;padding:5px 12px">转换</button>
|
||||
<button class="tag" data-tag="矢量" style="cursor:pointer;padding:5px 12px">矢量</button>
|
||||
<button class="tag" data-tag="提示词" style="cursor:pointer;padding:5px 12px">提示词</button>
|
||||
<button class="tag" data-tag="风格" style="cursor:pointer;padding:5px 12px">风格</button>
|
||||
<button class="tag" data-tag="电商" style="cursor:pointer;padding:5px 12px">电商</button>
|
||||
<button class="tag" data-tag="抠图" style="cursor:pointer;padding:5px 12px">抠图</button>
|
||||
<button class="tag" data-tag="去背景" style="cursor:pointer;padding:5px 12px">去背景</button>
|
||||
</div>
|
||||
<input id="q" placeholder="搜索插件,例如:出图、抠图、矢量…" style="width:100%;max-width:420px;height:40px;padding:0 14px;border:1px solid var(--line);border-radius:10px;font-size:14px;outline:none;margin-bottom:22px">
|
||||
<div class="grid c3" id="list">
|
||||
<div class="pcard" data-name="批量出图 batch-export 资源中心勾选节点,串行批量生成并打包 zip 下载 出图 批处理" data-tags="出图,批处理">
|
||||
<div class="head"><span class="av" style="background:#e8f0fe">🗂️</span>
|
||||
<div><div class="nm">批量出图</div><div class="ver">v1.2.0 · 官方</div></div></div>
|
||||
<div class="desc">资源中心勾选节点,串行批量生成并打包 ZIP 下载</div>
|
||||
<div class="tags"><span class="tag">出图</span><span class="tag">批处理</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="空白画布 blank-canvas 新建空白画布节点,用于分区分组 画布 效率" data-tags="画布,效率">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">⬜</span>
|
||||
<div><div class="nm">空白画布</div><div class="ver">v1.0.0 · 官方</div></div></div>
|
||||
<div class="desc">新建空白画布节点,用于分区分组</div>
|
||||
<div class="tags"><span class="tag">画布</span><span class="tag">效率</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="标注 / 修图 image-annotate 在画布内标注、涂抹、局部重绘 修图 标注" data-tags="修图,标注">
|
||||
<div class="head"><span class="av" style="background:#fdeaea">🖌️</span>
|
||||
<div><div class="nm">标注 / 修图</div><div class="ver">v1.20.6 · 官方</div></div></div>
|
||||
<div class="desc">在画布内标注、涂抹、局部重绘</div>
|
||||
<div class="tags"><span class="tag">修图</span><span class="tag">标注</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="位图转矢量 image-vectorize 把位图转成 svg 矢量路径 转换 矢量" data-tags="转换,矢量">
|
||||
<div class="head"><span class="av" style="background:#eaf3ea">✒️</span>
|
||||
<div><div class="nm">位图转矢量</div><div class="ver">v0.4.2 · 官方</div></div></div>
|
||||
<div class="desc">把位图转成 SVG 矢量路径</div>
|
||||
<div class="tags"><span class="tag">转换</span><span class="tag">矢量</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="风格库 style-source 风格提示词库与一键套用 提示词 风格" data-tags="提示词,风格">
|
||||
<div class="head"><span class="av" style="background:#fdf0e6">🎨</span>
|
||||
<div><div class="nm">风格库</div><div class="ver">v1.3.2 · 官方</div></div></div>
|
||||
<div class="desc">风格提示词库与一键套用</div>
|
||||
<div class="tags"><span class="tag">提示词</span><span class="tag">风格</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="白底图 white-bg-800 批量生成电商白底图(800px) 电商 出图" data-tags="电商,出图">
|
||||
<div class="head"><span class="av" style="background:#eef7fb">🧾</span>
|
||||
<div><div class="nm">白底图</div><div class="ver">v1.2.1 · 官方</div></div></div>
|
||||
<div class="desc">批量生成电商白底图(800px)</div>
|
||||
<div class="tags"><span class="tag">电商</span><span class="tag">出图</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="鲜艺抠图 xianyi-cutout 接入鲜艺抠图模型的一键去背景 抠图 去背景" data-tags="抠图,去背景">
|
||||
<div class="head"><span class="av" style="background:#f3eafd">✂️</span>
|
||||
<div><div class="nm">鲜艺抠图</div><div class="ver">v1.0.3 · 官方</div></div></div>
|
||||
<div class="desc">接入鲜艺抠图模型的一键去背景</div>
|
||||
<div class="tags"><span class="tag">抠图</span><span class="tag">去背景</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="note" style="margin-top:26px">插件安装后会写进你的资料目录 <code>~/Documents/ImageWorkbench/plugins/</code>;卸载只删插件文件,不动画布与图库。</div>
|
||||
</div></section>
|
||||
</main>
|
||||
<footer><div class="wrap">
|
||||
<div class="cols">
|
||||
<div><div style="color:#fff;font-weight:640;margin-bottom:8px">Image Workbench</div>
|
||||
<div style="font-size:13px;line-height:1.8">本地优先的 AI 生图无限画布。图片、提示词与模型配置全部留在你自己的电脑里。</div></div>
|
||||
<div><h4>产品</h4><a href="/">首页</a><a href="/download/">下载</a><a href="/plugins/">插件市场</a></div>
|
||||
<div><h4>资源</h4><a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop" target="_blank" rel="noopener">源码仓库</a><a href="https://git.maqiart.eu.org/malongan/iwb-plugins-desktop" target="_blank" rel="noopener">插件仓库</a><a href="/updates/latest.json" target="_blank" rel="noopener">更新源</a></div>
|
||||
<div><h4>说明</h4><a href="/download/">安装步骤</a><a href="/plugins/">插件安装</a></div>
|
||||
</div>
|
||||
<div class="copy"><span>© 2026 Image Workbench</span><span>数据保存在本地 · 不上传任何图片</span></div>
|
||||
</div></footer>
|
||||
<script>
|
||||
var q = document.getElementById('q'), list = document.getElementById('list'), chips = document.getElementById('chips'), activeTag = ''
|
||||
function apply () {
|
||||
var kw = (q.value || '').trim().toLowerCase()
|
||||
Array.prototype.forEach.call(list.children, function (el) {
|
||||
var okKw = !kw || el.dataset.name.indexOf(kw) >= 0
|
||||
var okTag = !activeTag || (',' + el.dataset.tags + ',').indexOf(',' + activeTag + ',') >= 0
|
||||
var ok = okKw && okTag
|
||||
el.style.display = ok ? '' : 'none'
|
||||
})
|
||||
}
|
||||
q.addEventListener('input', apply)
|
||||
chips.addEventListener('click', function (e) {
|
||||
var b = e.target.closest('button[data-tag]'); if (!b) return
|
||||
Array.prototype.forEach.call(chips.children, function (x) { x.style.background = ''; x.style.color = ''; x.style.borderColor = 'transparent' })
|
||||
b.style.background = '#111'; b.style.color = '#fff'; b.style.borderColor = '#111'
|
||||
activeTag = b.dataset.tag || ''
|
||||
apply()
|
||||
})
|
||||
</script>
|
||||
</body></html>
|
||||
+77
-2
@@ -1,18 +1,93 @@
|
||||
{
|
||||
"app": "Image Workbench",
|
||||
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
|
||||
"updatedAt": "2026-11-17T07:41:57.912Z",
|
||||
"updatedAt": "2026-11-17T23:14:53.709Z",
|
||||
"releases": [
|
||||
{
|
||||
"version": "3.25.4",
|
||||
"date": "2026-11-18",
|
||||
"notes": "Intel 版:剪贴板兜底",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.4_aarch64.dmg",
|
||||
"size": 7658606,
|
||||
"sha256": "0c02574f197fac4839bf937390425786ec872b36d9f8c529f122ee1349e855af",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.4_x64.dmg",
|
||||
"size": 7940457,
|
||||
"sha256": "f04664f6e051ae20e07bfb073ff675bbb83493f791ff4651120cdd00e9b0e103",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.3",
|
||||
"date": "2026-11-17",
|
||||
"notes": "Windows:剪贴板修复(Cmd+C/V、粘贴图片/文本、复制图片)+ 可自动更新",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.3_aarch64.dmg",
|
||||
"size": 7654670,
|
||||
"sha256": "fd05bf1a186574c611b166693b05a7531e5ec932bbc7cf75391bcd44a0c9eb5f",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.3_x64.dmg",
|
||||
"size": 7938826,
|
||||
"sha256": "00388a79069f9a78c48d491f366f73f1ee1500468f9970c8f657e25eb7c4e786",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"file": "updates/windows-x86_64/image-workbench_3.25.3_x64-setup.exe",
|
||||
"size": 4749572,
|
||||
"sha256": "e2a8cedc3aaaf61528edcf58c648079f618051cb6a4cf655b346315ad6424ba4",
|
||||
"kind": "exe"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.2",
|
||||
"date": "2026-11-17",
|
||||
"notes": "Windows:无内置插件 + 市场安装 + 页内确认 + 在线更新(首次需手动安装)",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.2_aarch64.dmg",
|
||||
"size": 7360220,
|
||||
"sha256": "6fb859f2e24d765308a6a97b3c72912d361eb71afb12ec385f2d72cef9cfef2e",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.2_x64.dmg",
|
||||
"size": 7626433,
|
||||
"sha256": "07027d97cffde7c0c46b65b2ec875a9fd4dfbdce4494d937e93d46169f61b3f8",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"file": "updates/windows-x86_64/image-workbench_3.25.2_x64-setup.exe",
|
||||
"size": 4681055,
|
||||
"sha256": "dda001a15e4aa8b25ef6200936884f5d78783309338a9979aadc175c8cc965af",
|
||||
"kind": "exe"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.1",
|
||||
"date": "2026-11-17",
|
||||
"notes": "性能与数据卫生:图库清单去 base64(223 倍)、画布缩略图落盘、回收 20.2MB 垃圾图、备份含插件",
|
||||
"notes": "Intel Mac 版:性能与数据卫生(图库清单去 base64、缩略图落盘、回收 20.2MB)",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.1_aarch64.dmg",
|
||||
"size": 6545041,
|
||||
"sha256": "5b711840b36a10ba2983ad48923c662897d25e55ea30de9fb7ea944694648124",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.1_x64.dmg",
|
||||
"size": 6772292,
|
||||
"sha256": "7863e4a3257d15a42d698ca79d0edbfb86496f20e67be7389c1de498c01f471b",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Generated
+486
-6
@@ -64,6 +64,26 @@ version = "1.0.104"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
||||
|
||||
[[package]]
|
||||
name = "arboard"
|
||||
version = "3.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aeb9553e62312c8756a5979254fc6d7da8bbeb5986a1e17037fab932f7037917"
|
||||
dependencies = [
|
||||
"clipboard-win",
|
||||
"image",
|
||||
"log",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-graphics",
|
||||
"objc2-foundation",
|
||||
"parking_lot",
|
||||
"percent-encoding",
|
||||
"windows-sys 0.61.2",
|
||||
"x11rb",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atk"
|
||||
version = "0.18.2"
|
||||
@@ -383,6 +403,15 @@ dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clipboard-win"
|
||||
version = "5.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "052af7878466feccda12ba7a6a67d019d712f296809559b47c12c8cc196d3a9a"
|
||||
dependencies = [
|
||||
"error-code",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "combine"
|
||||
version = "4.6.9"
|
||||
@@ -393,6 +422,15 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "constant_time_eq"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9eb6feb175df65d0a3ccd3e73484e940d0ac664e8034f0519fd49a93db3071d9"
|
||||
dependencies = [
|
||||
"rustversion",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cookie"
|
||||
version = "0.18.2"
|
||||
@@ -520,6 +558,12 @@ version = "0.8.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
|
||||
|
||||
[[package]]
|
||||
name = "crunchy"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.7"
|
||||
@@ -869,12 +913,34 @@ dependencies = [
|
||||
"typeid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "error-code"
|
||||
version = "3.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b5343afd4a8365a643ac588dab4cf234a190c7f6c88c9f6dd6ffe00837661b7"
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
|
||||
|
||||
[[package]]
|
||||
name = "fax"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"
|
||||
|
||||
[[package]]
|
||||
name = "fdeflate"
|
||||
version = "0.3.7"
|
||||
@@ -903,6 +969,16 @@ dependencies = [
|
||||
"rustc_version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "filetime"
|
||||
version = "0.2.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1255e7a9f1902190d4c10a75f2f7f495d3d3ce13e9ba26e6c48683a0f4dbed7"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "find-msvc-tools"
|
||||
version = "0.1.15"
|
||||
@@ -1148,6 +1224,16 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gethostname"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
|
||||
dependencies = [
|
||||
"rustix",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.17"
|
||||
@@ -1354,6 +1440,17 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "half"
|
||||
version = "2.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crunchy",
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.12.3"
|
||||
@@ -1662,12 +1759,15 @@ dependencies = [
|
||||
"moxcms",
|
||||
"num-traits",
|
||||
"png",
|
||||
"tiff",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.25.1"
|
||||
version = "3.25.4"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -1677,6 +1777,7 @@ dependencies = [
|
||||
"tauri-plugin-fs",
|
||||
"tauri-plugin-http",
|
||||
"tauri-plugin-log",
|
||||
"tauri-plugin-updater",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1814,6 +1915,36 @@ dependencies = [
|
||||
"windows-sys 0.45.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni"
|
||||
version = "0.22.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"combine",
|
||||
"jni-macros",
|
||||
"jni-sys 0.4.1",
|
||||
"log",
|
||||
"simd_cesu8",
|
||||
"thiserror 2.0.21",
|
||||
"walkdir",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni-macros"
|
||||
version = "0.22.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustc_version",
|
||||
"simd_cesu8",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni-sys"
|
||||
version = "0.3.1"
|
||||
@@ -1949,6 +2080,12 @@ version = "0.19.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d9aae57673c1a235149777a74d152f3210ebd3e3b13346d2cdb6809e566bd3c"
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
|
||||
|
||||
[[package]]
|
||||
name = "litemap"
|
||||
version = "0.8.3"
|
||||
@@ -2025,6 +2162,12 @@ version = "0.3.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5848f5a9e8117cf94f2f90faac24a87ff81600ff8628c1e3deaab572e76bfa1"
|
||||
|
||||
[[package]]
|
||||
name = "minisign-verify"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "871285dc19d8d0ebe0eef3d0e99a205f2a71363b122632cbbfa4a6c370a960ce"
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.8.9"
|
||||
@@ -2129,6 +2272,18 @@ version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77730ed34f01f4990cb2ea67fec715ecebc6fab9a6396cf83c5529b13f581bdc"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"cfg-if",
|
||||
"cfg_aliases",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-conv"
|
||||
version = "0.2.2"
|
||||
@@ -2195,6 +2350,7 @@ dependencies = [
|
||||
"block2",
|
||||
"objc2",
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-graphics",
|
||||
"objc2-foundation",
|
||||
"objc2-quartz-core",
|
||||
]
|
||||
@@ -2315,6 +2471,18 @@ dependencies = [
|
||||
"objc2-core-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-osa-kit"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-quartz-core"
|
||||
version = "0.3.2"
|
||||
@@ -2378,12 +2546,32 @@ version = "1.21.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
||||
|
||||
[[package]]
|
||||
name = "openssl-probe"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1"
|
||||
|
||||
[[package]]
|
||||
name = "option-ext"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
|
||||
|
||||
[[package]]
|
||||
name = "osakit"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
"objc2-osa-kit",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pango"
|
||||
version = "0.18.3"
|
||||
@@ -2702,6 +2890,12 @@ version = "0.1.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
|
||||
|
||||
[[package]]
|
||||
name = "quick-error"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
|
||||
|
||||
[[package]]
|
||||
name = "quick-xml"
|
||||
version = "0.42.0"
|
||||
@@ -2945,15 +3139,20 @@ dependencies = [
|
||||
"http-body",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-rustls",
|
||||
"hyper-util",
|
||||
"js-sys",
|
||||
"log",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"rustls-platform-verifier",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sync_wrapper",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tokio-util",
|
||||
"tower",
|
||||
"tower-http",
|
||||
@@ -3020,6 +3219,19 @@ dependencies = [
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "1.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.46"
|
||||
@@ -3034,6 +3246,18 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-native-certs"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4"
|
||||
dependencies = [
|
||||
"openssl-probe",
|
||||
"rustls-pki-types",
|
||||
"schannel",
|
||||
"security-framework",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pki-types"
|
||||
version = "1.16.0"
|
||||
@@ -3044,6 +3268,33 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-platform-verifier"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98"
|
||||
dependencies = [
|
||||
"core-foundation 0.10.1",
|
||||
"core-foundation-sys",
|
||||
"jni 0.22.4",
|
||||
"log",
|
||||
"once_cell",
|
||||
"rustls",
|
||||
"rustls-native-certs",
|
||||
"rustls-platform-verifier-android",
|
||||
"rustls-webpki",
|
||||
"security-framework",
|
||||
"security-framework-sys",
|
||||
"webpki-root-certs",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-platform-verifier-android"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f"
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.103.17"
|
||||
@@ -3076,6 +3327,15 @@ dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
version = "0.1.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "0.8.22"
|
||||
@@ -3133,6 +3393,29 @@ version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "3.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"core-foundation 0.10.1",
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
"security-framework-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework-sys"
|
||||
version = "2.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"
|
||||
dependencies = [
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "selectors"
|
||||
version = "0.38.0"
|
||||
@@ -3382,6 +3665,16 @@ version = "0.3.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
|
||||
|
||||
[[package]]
|
||||
name = "simd_cesu8"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520"
|
||||
dependencies = [
|
||||
"rustc_version",
|
||||
"simdutf8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simdutf8"
|
||||
version = "0.1.5"
|
||||
@@ -3651,7 +3944,7 @@ dependencies = [
|
||||
"gdkwayland-sys",
|
||||
"gdkx11-sys",
|
||||
"gtk",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"libc",
|
||||
"log",
|
||||
"ndk",
|
||||
@@ -3684,6 +3977,17 @@ dependencies = [
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tar"
|
||||
version = "0.4.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840"
|
||||
dependencies = [
|
||||
"filetime",
|
||||
"libc",
|
||||
"xattr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "target-lexicon"
|
||||
version = "0.12.16"
|
||||
@@ -3708,7 +4012,7 @@ dependencies = [
|
||||
"heck 0.5.0",
|
||||
"http",
|
||||
"image",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"libc",
|
||||
"log",
|
||||
"mime",
|
||||
@@ -3910,6 +4214,40 @@ dependencies = [
|
||||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-updater"
|
||||
version = "2.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"dirs",
|
||||
"flate2",
|
||||
"futures-util",
|
||||
"http",
|
||||
"infer",
|
||||
"libc",
|
||||
"log",
|
||||
"minisign-verify",
|
||||
"osakit",
|
||||
"percent-encoding",
|
||||
"reqwest 0.13.5",
|
||||
"rustls",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tar",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"tempfile",
|
||||
"thiserror 2.0.21",
|
||||
"time",
|
||||
"tokio",
|
||||
"url",
|
||||
"windows-sys 0.61.2",
|
||||
"zip",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.12.2"
|
||||
@@ -3920,7 +4258,7 @@ dependencies = [
|
||||
"dpi",
|
||||
"gtk",
|
||||
"http",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"objc2",
|
||||
"objc2-ui-kit",
|
||||
"objc2-web-kit",
|
||||
@@ -3943,7 +4281,7 @@ checksum = "e1aa9d8b7a120f879f44fdc1053f7b7dbf416bf0bbc6a72b714dec46b782b52f"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"log",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
@@ -4009,6 +4347,19 @@ dependencies = [
|
||||
"toml 1.2.1+spec-1.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.4.3",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tendril"
|
||||
version = "0.5.1"
|
||||
@@ -4058,6 +4409,20 @@ dependencies = [
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tiff"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"
|
||||
dependencies = [
|
||||
"fax",
|
||||
"flate2",
|
||||
"half",
|
||||
"quick-error",
|
||||
"weezl",
|
||||
"zune-jpeg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.55"
|
||||
@@ -4344,6 +4709,12 @@ version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||
|
||||
[[package]]
|
||||
name = "typed-path"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e"
|
||||
|
||||
[[package]]
|
||||
name = "typeid"
|
||||
version = "1.0.3"
|
||||
@@ -4648,6 +5019,15 @@ dependencies = [
|
||||
"system-deps",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-root-certs"
|
||||
version = "1.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "293198dcebfb821155b5092ab94b5a82ff180eddd7241df3bd6e66a4ffd1a585"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "1.0.12"
|
||||
@@ -4691,6 +5071,12 @@ dependencies = [
|
||||
"windows-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "weezl"
|
||||
version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
@@ -5074,7 +5460,7 @@ dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
"javascriptcore-rs",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"libc",
|
||||
"ndk",
|
||||
"objc2",
|
||||
@@ -5120,6 +5506,33 @@ dependencies = [
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "x11rb"
|
||||
version = "0.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414"
|
||||
dependencies = [
|
||||
"gethostname",
|
||||
"rustix",
|
||||
"x11rb-protocol",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "x11rb-protocol"
|
||||
version = "0.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd"
|
||||
|
||||
[[package]]
|
||||
name = "xattr"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "963d6fab92d5504b971dc8bd90ca743c2575e590bc8071ea5bc571598667ae08"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rustix",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yoke"
|
||||
version = "0.8.4"
|
||||
@@ -5143,6 +5556,26 @@ dependencies = [
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.63"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.63"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerofrom"
|
||||
version = "0.1.8"
|
||||
@@ -5169,6 +5602,20 @@ name = "zeroize"
|
||||
version = "1.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"
|
||||
dependencies = [
|
||||
"zeroize_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize_derive"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerotrie"
|
||||
@@ -5203,6 +5650,24 @@ dependencies = [
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "9.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "953a376f4930ed5af88e1e65948385f76866b45e7f75b21ac275327d0eeb9b46"
|
||||
dependencies = [
|
||||
"constant_time_eq",
|
||||
"crc32fast",
|
||||
"getrandom 0.4.3",
|
||||
"indexmap 2.14.2",
|
||||
"libc",
|
||||
"memchr",
|
||||
"nix",
|
||||
"typed-path",
|
||||
"windows-sys 0.61.2",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zlib-rs"
|
||||
version = "0.6.8"
|
||||
@@ -5214,3 +5679,18 @@ name = "zmij"
|
||||
version = "1.0.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
||||
|
||||
[[package]]
|
||||
name = "zune-core"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
|
||||
|
||||
[[package]]
|
||||
name = "zune-jpeg"
|
||||
version = "0.5.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
|
||||
dependencies = [
|
||||
"zune-core",
|
||||
]
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.25.1"
|
||||
version = "3.25.4"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
@@ -28,3 +28,6 @@ tauri-plugin-log = "2"
|
||||
tauri-plugin-dialog = "2"
|
||||
tauri-plugin-fs = "2"
|
||||
tauri-plugin-http = "2"
|
||||
tauri-plugin-updater = "2"
|
||||
arboard = "3"
|
||||
base64 = "0.22"
|
||||
+98
-1
@@ -205,13 +205,104 @@ fn open_app_data_dir(app: AppHandle) -> Result<String, String> {
|
||||
Ok(path)
|
||||
}
|
||||
|
||||
use tauri_plugin_updater::UpdaterExt;
|
||||
|
||||
#[tauri::command]
|
||||
fn clipboard_write_text(text: String) -> Result<bool, String> {
|
||||
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
|
||||
cb.set_text(text).map_err(|e| e.to_string())?;
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn clipboard_read_text() -> Result<String, String> {
|
||||
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
|
||||
Ok(cb.get_text().unwrap_or_default())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn check_update(app: tauri::AppHandle) -> Result<Option<serde_json::Value>, String> {
|
||||
let updater = app.updater().map_err(|e| e.to_string())?;
|
||||
match updater.check().await {
|
||||
Ok(Some(update)) => Ok(Some(serde_json::json!({
|
||||
"version": update.version,
|
||||
"currentVersion": update.current_version,
|
||||
"notes": update.body.unwrap_or_default(),
|
||||
"date": update.date.map(|d| d.to_string()).unwrap_or_default()
|
||||
}))),
|
||||
Ok(None) => Ok(None),
|
||||
Err(e) => Err(e.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn install_update(app: tauri::AppHandle) -> Result<bool, String> {
|
||||
let updater = app.updater().map_err(|e| e.to_string())?;
|
||||
let found = updater.check().await.map_err(|e| e.to_string())?;
|
||||
let Some(update) = found else { return Ok(false) };
|
||||
update
|
||||
.download_and_install(|_chunk, _total| {}, || {})
|
||||
.await
|
||||
.map_err(|e| e.to_string())?;
|
||||
app.restart();
|
||||
}
|
||||
|
||||
use arboard::Clipboard;
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct ClipImagePayload {
|
||||
width: u32,
|
||||
height: u32,
|
||||
rgba_base64: String,
|
||||
}
|
||||
|
||||
fn b64_encode(bytes: &[u8]) -> String {
|
||||
use base64::Engine;
|
||||
base64::engine::general_purpose::STANDARD.encode(bytes)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn clipboard_read_image() -> Result<Option<ClipImagePayload>, String> {
|
||||
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
|
||||
let img = match cb.get_image() {
|
||||
Ok(v) => v,
|
||||
Err(_) => return Ok(None),
|
||||
};
|
||||
Ok(Some(ClipImagePayload {
|
||||
width: img.width as u32,
|
||||
height: img.height as u32,
|
||||
rgba_base64: b64_encode(&img.bytes),
|
||||
}))
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn clipboard_write_image(width: u32, height: u32, rgba_base64: String) -> Result<bool, String> {
|
||||
use base64::Engine;
|
||||
let bytes = base64::engine::general_purpose::STANDARD
|
||||
.decode(rgba_base64.as_bytes())
|
||||
.map_err(|e| e.to_string())?;
|
||||
let expect = (width as usize) * (height as usize) * 4;
|
||||
if width == 0 || height == 0 || bytes.len() < expect {
|
||||
return Err("图片像素数据不完整".into());
|
||||
}
|
||||
let mut cb = Clipboard::new().map_err(|e| e.to_string())?;
|
||||
cb.set_image(arboard::ImageData {
|
||||
width: width as usize,
|
||||
height: height as usize,
|
||||
bytes: std::borrow::Cow::Owned(bytes),
|
||||
})
|
||||
.map_err(|e| e.to_string())?;
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
let app = tauri::Builder::default()
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.invoke_handler(tauri::generate_handler![open_app_data_dir, grant_dir, copy_tree])
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||
.invoke_handler(tauri::generate_handler![open_app_data_dir, grant_dir, copy_tree, check_update, install_update, clipboard_read_image, clipboard_write_image, clipboard_write_text, clipboard_read_text])
|
||||
.setup(|app| {
|
||||
if cfg!(debug_assertions) {
|
||||
app.handle().plugin(
|
||||
@@ -225,6 +316,12 @@ pub fn run() {
|
||||
restore_geom(&win, app.handle());
|
||||
}
|
||||
build_tray(app.handle())?;
|
||||
// macOS 必须有应用菜单,否则 Cmd+C / Cmd+V / Cmd+X 根本不会进 WebView(Tauri 已知问题)
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let menu = tauri::menu::Menu::default(app.handle())?;
|
||||
app.set_menu(menu)?;
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
// 点关闭按钮 ⇒ 记住窗口尺寸后收进托盘(不退出,后台任务继续)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.25.1",
|
||||
"version": "3.25.4",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
@@ -40,6 +40,15 @@
|
||||
"icons/[email protected]",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
],
|
||||
"createUpdaterArtifacts": true
|
||||
},
|
||||
"plugins": {
|
||||
"updater": {
|
||||
"endpoints": [
|
||||
"https://download.maqiart.eu.org/updates/latest.json"
|
||||
],
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE3QUU1N0QwQUM5RjE1RjEKUldUeEZaK3MwRmV1RnhjNVhhSlhaSHkvbVRXNDdscHpOa0s0VHF4NHBBQVJBdDQ0dEVlck5FeEsK"
|
||||
}
|
||||
}
|
||||
}
|
||||
+42
-12
@@ -102,20 +102,50 @@
|
||||
/* 写系统剪贴板。返回 Promise<boolean>:false 表示这个环境写不了
|
||||
* (非 HTTPS / 老浏览器 / 无 ClipboardItem)→ 调用方降级到内部剪贴板 + Ctrl+Shift+V。
|
||||
* 绝不 reject:复制是高频动作,不能因为剪贴板权限在控制台刷错误。 */
|
||||
/* 桌面端兜底:WKWebView 里 ClipboardItem 写 text/html 常失败(返回 false),
|
||||
* 于是复制节点等于「什么都没写」,Ctrl+V 会贴出上一次的文本。
|
||||
* 这里改成:写不了富文本就写纯文本摘要,并记住这份摘要属于哪个 clip。
|
||||
* 粘贴侧用 matchPlain() 精确比对(文字完全相等才算命中),不会把用户随手复制的文本误判成节点。 */
|
||||
let lastPlain = null
|
||||
function notePlain(plain, clip) {
|
||||
lastPlain = { plain: str(plain), clip: clip || null, at: Date.now() }
|
||||
}
|
||||
function matchPlain(text) {
|
||||
if (!lastPlain || !lastPlain.clip) return null
|
||||
if (Date.now() - lastPlain.at > 10 * 60 * 1000) return null
|
||||
return str(text) === lastPlain.plain ? lastPlain.clip : null
|
||||
}
|
||||
function write(clip) {
|
||||
const plain = plainFor(clip)
|
||||
const cb = (g.navigator && g.navigator.clipboard) || null
|
||||
// 先记账:即使写剪贴板失败,内部匹配(matchPlain)也能让 Ctrl+V 贴回节点组
|
||||
notePlain(plain, clip)
|
||||
try {
|
||||
const cb = g.navigator && g.navigator.clipboard
|
||||
if (!cb || typeof cb.write !== 'function') return Promise.resolve(false)
|
||||
if (typeof g.ClipboardItem !== 'function' || typeof g.Blob !== 'function') return Promise.resolve(false)
|
||||
const html = htmlFor(clip)
|
||||
const plain = plainFor(clip)
|
||||
const item = new g.ClipboardItem({
|
||||
'text/html': new g.Blob([html], { type: 'text/html' }),
|
||||
'text/plain': new g.Blob([plain], { type: 'text/plain' }),
|
||||
})
|
||||
return Promise.resolve(cb.write([item])).then(() => true).catch(() => false)
|
||||
} catch (e) { return Promise.resolve(false) }
|
||||
if (cb && typeof cb.write === 'function' && typeof g.ClipboardItem === 'function' && typeof g.Blob === 'function') {
|
||||
const item = new g.ClipboardItem({
|
||||
'text/html': new g.Blob([htmlFor(clip)], { type: 'text/html' }),
|
||||
'text/plain': new g.Blob([plain], { type: 'text/plain' }),
|
||||
})
|
||||
return Promise.resolve(cb.write([item])).then(() => true).catch(() => writePlainFallback(cb, plain, clip))
|
||||
}
|
||||
} catch (e) { /* 落到纯文本兜底 */ }
|
||||
// WKWebView:没有 clipboard.write ⇒ 直接走纯文本兜底(旧实现这里直接 return false,等于什么都没写)
|
||||
return writePlainFallback(cb, plain, clip)
|
||||
}
|
||||
|
||||
g.IWBClipboardGraph = Object.freeze({ MARK, encodeText, decodeText, htmlFor, plainFor, decode, write })
|
||||
/** 纯文本兜底:优先 navigator.clipboard.writeText,再退到 Rust arboard */
|
||||
function writePlainFallback(cb, plain, clip) {
|
||||
notePlain(plain, clip)
|
||||
const T = g.__TAURI__
|
||||
if (cb && typeof cb.writeText === 'function') {
|
||||
return Promise.resolve(cb.writeText(plain)).then(() => true).catch(() => writeNativeText(T, plain))
|
||||
}
|
||||
return writeNativeText(T, plain)
|
||||
}
|
||||
function writeNativeText(T, plain) {
|
||||
if (!T || !T.core || typeof T.core.invoke !== 'function') return Promise.resolve(false)
|
||||
return Promise.resolve(T.core.invoke('clipboard_write_text', { text: str(plain) })).then(() => true).catch(() => false)
|
||||
}
|
||||
|
||||
g.IWBClipboardGraph = Object.freeze({ MARK, encodeText, decodeText, htmlFor, plainFor, decode, write, matchPlain })
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -0,0 +1,82 @@
|
||||
/* native-clipboard.js —— 桌面端原生剪贴板图片(2026-11-17)
|
||||
*
|
||||
* 为什么单独一个模块:
|
||||
* WKWebView 的 paste 事件拿不到「从 Finder/预览复制的图片」,
|
||||
* navigator.clipboard.write([ClipboardItem]) 在部分 macOS 版本也不可用。
|
||||
* 图片读写统一走 Rust 侧 arboard(命令 clipboard_read_image / clipboard_write_image),
|
||||
* 这里只做 RGBA ⇄ PNG Blob 的转换与调用封装。
|
||||
*
|
||||
* 网页版:IWBDesktop 不会把这两个函数注入进来,模块静默不可用,行为与原来一致。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
|
||||
function tauri() {
|
||||
const T = global && global.__TAURI__
|
||||
return (T && T.core && typeof T.core.invoke === 'function') ? T : null
|
||||
}
|
||||
|
||||
function b64FromU8(u8) {
|
||||
let s = ''
|
||||
const CH = 0x8000
|
||||
for (let i = 0; i < u8.length; i += CH) s += String.fromCharCode.apply(null, u8.subarray(i, i + CH))
|
||||
return global.btoa(s)
|
||||
}
|
||||
|
||||
function u8FromB64(b64) {
|
||||
const s = global.atob(b64)
|
||||
const u8 = new Uint8Array(s.length)
|
||||
for (let i = 0; i < s.length; i++) u8[i] = s.charCodeAt(i)
|
||||
return u8
|
||||
}
|
||||
|
||||
/** 读系统剪贴板里的图片 → PNG File(读不到返回 null) */
|
||||
async function readImage() {
|
||||
const T = tauri()
|
||||
if (!T) return null
|
||||
try {
|
||||
const r = await T.core.invoke('clipboard_read_image')
|
||||
if (!r || !r.width || !r.height || !r.rgbaBase64) return null
|
||||
const u8 = u8FromB64(r.rgbaBase64)
|
||||
const canvas = global.document.createElement('canvas')
|
||||
canvas.width = r.width
|
||||
canvas.height = r.height
|
||||
const ctx = canvas.getContext('2d')
|
||||
const imgData = ctx.createImageData(r.width, r.height)
|
||||
imgData.data.set(u8.subarray(0, r.width * r.height * 4))
|
||||
ctx.putImageData(imgData, 0, 0)
|
||||
const blob = await new Promise((resolve) => canvas.toBlob((b) => resolve(b), 'image/png'))
|
||||
if (!blob) return null
|
||||
const name = 'clipboard-' + Date.now() + '.png'
|
||||
try { return new File([blob], name, { type: 'image/png' }) } catch (e) {
|
||||
blob.name = name
|
||||
return blob
|
||||
}
|
||||
} catch (e) { return null }
|
||||
}
|
||||
|
||||
/** 把图片写进系统剪贴板(Blob/File 均可) */
|
||||
async function writeImage(blobOrFile) {
|
||||
const T = tauri()
|
||||
if (!T || !blobOrFile) return false
|
||||
try {
|
||||
const C = global.IWBImageBlob
|
||||
const png = (C && typeof C.toPng === 'function') ? await C.toPng(blobOrFile) : blobOrFile
|
||||
const bmp = await global.createImageBitmap(png)
|
||||
const canvas = global.document.createElement('canvas')
|
||||
canvas.width = bmp.width
|
||||
canvas.height = bmp.height
|
||||
const ctx = canvas.getContext('2d')
|
||||
ctx.drawImage(bmp, 0, 0)
|
||||
const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data
|
||||
await T.core.invoke('clipboard_write_image', {
|
||||
width: canvas.width,
|
||||
height: canvas.height,
|
||||
rgbaBase64: b64FromU8(new Uint8Array(data.buffer, data.byteOffset, data.byteLength)),
|
||||
})
|
||||
return true
|
||||
} catch (e) { return false }
|
||||
}
|
||||
|
||||
global.IWBNativeClipboard = Object.freeze({ readImage, writeImage, available: () => !!tauri() })
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
+47
-1
@@ -266,6 +266,16 @@
|
||||
// 复制只进了内部那份;用户从旧版本带过来的复制内容也靠它。
|
||||
// 每个 paste 事件独立处理 → 连按 N 次贴 N 份,不会像旧的定时器方案那样只贴一份。
|
||||
e.preventDefault()
|
||||
// 桌面端:Finder/预览复制的图片在 WKWebView 的 paste 事件里读不到,先问原生剪贴板
|
||||
if (typeof ctx.readNativeImage === 'function') {
|
||||
ctx.setNotice({ type: 'info', text: '正在读取剪贴板图片…' })
|
||||
ctx.readNativeImage().then((f) => {
|
||||
if (f) { pasteImages([f], ctx); ctx.setNotice(null) }
|
||||
else if (ctx.pasteCopiedNodes()) { ctx.setNotice(null) }
|
||||
else ctx.setNotice({ type: 'err', text: ctx.refs.clipExpired ? '内部剪贴板已过期(10 分钟),请重新复制节点' : '剪贴板里没有可粘贴的内容' })
|
||||
})
|
||||
return true
|
||||
}
|
||||
if (ctx.pasteCopiedNodes()) return true
|
||||
ctx.setNotice({
|
||||
type: 'err',
|
||||
@@ -280,6 +290,10 @@
|
||||
// 用户没法照着做(他粘的可能本来就是 PNG,只是 MIME 没填)。
|
||||
const A = g.IWBImageAdmit
|
||||
const list = c.files || []
|
||||
if (typeof ctx.readNativeImage === 'function') {
|
||||
ctx.readNativeImage().then((f) => { if (f) { pasteImages([f], ctx); ctx.setNotice(null) } })
|
||||
return true
|
||||
}
|
||||
const why = (A && typeof A.why === 'function' && list[0]) ? A.why(list[0])
|
||||
: ('暂不支持粘贴文件(' + ((list[0] && list[0].name) || '该文件') + ')')
|
||||
ctx.setNotice({ type: 'err', text: (why || '暂不支持粘贴该文件') + (list.length > 1 ? '(另有 ' + (list.length - 1) + ' 个文件未处理)' : '') })
|
||||
@@ -300,6 +314,15 @@
|
||||
createRefFromUrl(c.text.trim(), ctx)
|
||||
return true
|
||||
}
|
||||
// 桌面端:复制节点写不进 text/html 时会退化成「纯文本摘要 + 记住的 clip」。
|
||||
// 文字与刚才写的摘要完全一致 ⇒ 认为用户贴的是节点组,而不是新提示词。
|
||||
const G = g.IWBClipboardGraph
|
||||
const matched = (G && typeof G.matchPlain === 'function') ? G.matchPlain(c.text) : null
|
||||
if (matched) {
|
||||
e.preventDefault()
|
||||
try { const PO = g.IWBPasteOnce; if (PO) PO.disarm() } catch (err) { /* ignore */ }
|
||||
if (ctx.pasteGraph(matched, anchor(ctx))) return true
|
||||
}
|
||||
e.preventDefault()
|
||||
createPrompt(c.text, ctx)
|
||||
return true
|
||||
@@ -325,5 +348,28 @@ function probe(ctx) {
|
||||
}, 420)
|
||||
}
|
||||
|
||||
g.IWBClipboardPaste = Object.freeze({ handle, probe, overlayOpen, anchor })
|
||||
/* Cmd/Ctrl+V 兜底(桌面端):菜单缺失或 WebView 不派发 paste 时,160ms 内没收到
|
||||
* 真实 paste 事件就主动读一次原生剪贴板图片。getCtx 由 app.js 注入(懒取,避免闭包过期)。 */
|
||||
let hotkeyBound = false
|
||||
function bindHotkeyFallback(getCtx) {
|
||||
if (hotkeyBound || typeof window === 'undefined') return
|
||||
hotkeyBound = true
|
||||
window.addEventListener('keydown', (e) => {
|
||||
if (!(e.metaKey || e.ctrlKey) || e.shiftKey || e.altKey) return
|
||||
if (String(e.key || '').toLowerCase() !== 'v') return
|
||||
const t = /** @type {any} */ (e.target)
|
||||
if (t && t.tagName && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return
|
||||
const D = g.IWBDesktop
|
||||
if (!D || !D.clipboardReadImage) return
|
||||
const ctx = (typeof getCtx === 'function') ? getCtx() : null
|
||||
const stamp = ctx && ctx.refs ? (ctx.refs.pasteStamp || 0) : 0
|
||||
setTimeout(() => {
|
||||
const now = ctx && ctx.refs ? (ctx.refs.pasteStamp || 0) : 0
|
||||
if (now !== stamp) return
|
||||
D.clipboardReadImage().then((f) => { if (f) pasteImages([f], ctx) })
|
||||
}, 160)
|
||||
})
|
||||
}
|
||||
|
||||
g.IWBClipboardPaste = Object.freeze({ handle, probe, overlayOpen, anchor, bindHotkeyFallback, pasteFiles: (files, ctx) => pasteImages(files || [], ctx) })
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
+5
-2
@@ -229,8 +229,11 @@
|
||||
|
||||
function isEnabled(id) {
|
||||
if (plugins.has(id)) return Boolean(recordOf(id).enabled)
|
||||
// 未注册:直接读持久化开关(不得走 recordOf——那会为陌生 id 创建 state 条目)
|
||||
return Boolean(state[id] && state[id].enabled)
|
||||
// 未注册:有持久化记录就按记录;**没有记录 ⇒ 默认启用**
|
||||
// (否则启动早期 state 还没读到时,所有插件都会被判成「已停用」而进 idle)
|
||||
const rec = state[id]
|
||||
if (!rec) return true
|
||||
return Boolean(rec.enabled)
|
||||
}
|
||||
|
||||
function init(nextDeps) {
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
getSilentSave() { return !!(state.impl && state.impl.getSilentSave()) },
|
||||
setSilentSave(on) { if (state.impl) state.impl.setSilentSave(on) },
|
||||
openDataDir() { return state.impl ? state.impl.openDataDir() : Promise.reject(new Error('仅桌面端可用')) },
|
||||
// 原生剪贴板图片(v3.26):WKWebView 里 paste 事件拿不到 Finder 复制的图片,
|
||||
// navigator.clipboard.write 也常不可用,统一走 Rust 侧 arboard。
|
||||
clipboardReadImage() { return state.impl && state.impl.clipboardReadImage ? state.impl.clipboardReadImage() : Promise.resolve(null) },
|
||||
clipboardWriteImage(blob) { return state.impl && state.impl.clipboardWriteImage ? state.impl.clipboardWriteImage(blob) : Promise.resolve(false) },
|
||||
market: {
|
||||
list() { return state.impl && state.impl.marketList ? state.impl.marketList() : Promise.resolve([]) },
|
||||
installed() { return state.impl && state.impl.marketInstalled ? state.impl.marketInstalled() : Promise.resolve([]) },
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
const H = host()
|
||||
const registered = !!(H && typeof H.list === 'function' && H.list().some(function (p) { return p.id === record.id }))
|
||||
record.status = registered ? 'loaded' : 'not-registered'
|
||||
if (registered && typeof H.isEnabled === 'function' && H.isEnabled(record.id)) H.setEnabled(record.id, true)
|
||||
// 不在加载阶段写启用状态:否则会把用户关掉的插件又打开
|
||||
// (启用/停用由 app.js 加载完成后按持久化状态统一应用)
|
||||
return record.status === 'loaded'
|
||||
}
|
||||
|
||||
|
||||
@@ -13,18 +13,47 @@
|
||||
return (F && F.plugins) ? F.plugins : null
|
||||
}
|
||||
|
||||
// 桌面端优先走 Tauri 原生 HTTP(WKWebView 在代理/fake-IP 环境下 fetch 会 Load failed)
|
||||
function marketFetch (url) {
|
||||
// 桌面端优先走 Tauri 原生 HTTP(WKWebView 在代理/fake-IP 环境下 fetch 会 Load failed);
|
||||
// 原生失败时再退回 WebView fetch(有些 Windows 公司网络/代理只放行后者),两个错误都带上,便于定位。
|
||||
async function marketFetch (url) {
|
||||
const T = (global.__TAURI__ && global.__TAURI__.http) ? global.__TAURI__.http : null
|
||||
if (T && typeof T.fetch === 'function') return T.fetch(url)
|
||||
return global.fetch(url, { cache: 'no-store' })
|
||||
let nativeErr = ''
|
||||
if (T && typeof T.fetch === 'function') {
|
||||
try { return await T.fetch(url) } catch (e) { nativeErr = String((e && e.message) || e) }
|
||||
}
|
||||
try {
|
||||
return await global.fetch(url, { cache: 'no-store' })
|
||||
} catch (e2) {
|
||||
const webErr = String((e2 && e2.message) || e2)
|
||||
throw new Error('无法访问 ' + url + (nativeErr ? ('(原生 HTTP:' + nativeErr + ')') : '') + '(网页请求:' + webErr + ')')
|
||||
}
|
||||
}
|
||||
|
||||
// 本地缓存:上次成功拉到的市场列表(毫秒级出图,后台再刷新)
|
||||
const CACHE_KEY = 'iwb_market_cache'
|
||||
function localStore () {
|
||||
const L = global.IWBStorageLocal || null
|
||||
return (L && typeof L.getStore === 'function') ? L.getStore() : null
|
||||
}
|
||||
function cached () {
|
||||
try {
|
||||
const st = localStore()
|
||||
if (!st) return null
|
||||
const v = st.get(CACHE_KEY)
|
||||
return (Array.isArray(v) && v.length) ? v : null
|
||||
} catch (e) { return null }
|
||||
}
|
||||
function saveCache (list) {
|
||||
try { const st = localStore(); if (st && Array.isArray(list) && list.length) st.set(CACHE_KEY, list) } catch (e) { /* ignore */ }
|
||||
}
|
||||
|
||||
async function list () {
|
||||
const resp = await marketFetch(MARKET_URL)
|
||||
if (!resp.ok) throw new Error('市场不可达:HTTP ' + resp.status)
|
||||
const j = await resp.json()
|
||||
return Array.isArray(j && j.plugins) ? j.plugins : []
|
||||
const items = Array.isArray(j && j.plugins) ? j.plugins : []
|
||||
saveCache(items)
|
||||
return items
|
||||
}
|
||||
|
||||
async function installed () {
|
||||
@@ -69,5 +98,5 @@
|
||||
} catch (e) { return { ok: false, error: String((e && e.message) || e) } }
|
||||
}
|
||||
|
||||
global.IWBRuntimePluginMarket = { list: list, installed: installed, install: install, uninstall: uninstall }
|
||||
global.IWBRuntimePluginMarket = { list: list, cached: cached, installed: installed, install: install, uninstall: uninstall }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -370,6 +370,9 @@
|
||||
function inheritBar(info, opts) {
|
||||
const o = opts || {}
|
||||
const own = !!info.own
|
||||
// 没有上游节点(纯手写提示词)就不要显示「已固定 / 恢复跟随」,
|
||||
// 否则点「恢复跟随」会把用户手写的文案清空。
|
||||
if (!info.hasUpstream) return null
|
||||
if (!own && !info.text) return null
|
||||
const srcName = nodeLabelOf(info.sourceNodeId, o.nodes)
|
||||
const parts = [
|
||||
|
||||
@@ -566,7 +566,7 @@ function SettingsModal(props) {
|
||||
}, I(SET_NAV_ICONS[t[0]] || 'settings'), el('span', null, t[1]))),
|
||||
el('div', { className: 'iwb-set-nav-group' }, '插件'),
|
||||
el('button', { key: 'nav-plugins', className: 'iwb-tab iwb-set-nav-item' + (tab === 'plugins' ? ' iwb-tab-active' : ''), onClick: () => setTab('plugins') }, I('panel'), el('span', null, '插件管理')),
|
||||
pluginItems.map((p) => el('button', { key: 'nav-plugin:' + p.id, className: 'iwb-tab iwb-set-nav-item' + (tab === 'plugin:' + p.id ? ' iwb-tab-active' : ''), onClick: () => setTab('plugin:' + p.id) }, I('star'), el('span', null, p.name))),
|
||||
pluginItems.filter((p) => p && p.enabled).map((p) => el('button', { key: 'nav-plugin:' + p.id, className: 'iwb-tab iwb-set-nav-item' + (tab === 'plugin:' + p.id ? ' iwb-tab-active' : ''), onClick: () => setTab('plugin:' + p.id) }, I('star'), el('span', null, p.name))),
|
||||
),
|
||||
el('div', { className: 'iwb-modal-body' },
|
||||
tab === 'gen' ? genTab : tab === 'llm' ? llmTab : tab === 'img' ? imgTab : tab === 'backup' ? backupTab : tab === 'hotkeys' ? hotkeyTab : tab === 'sizes' ? sizePresetTab : tab === 'plugins' ? pluginsTab : (typeof tab === 'string' && tab.indexOf('plugin:') === 0) ? pluginSettingsPage : tab === 'diag' ? diagTab : generalTab,
|
||||
|
||||
+300
-139
@@ -123,54 +123,85 @@
|
||||
try { const st = pluginDevStore(); if (st) st.set('iwb_plugin_dev', !!on) } catch (e) { /* ignore */ }
|
||||
}
|
||||
|
||||
// 桌面端插件管理(参考 Obsidian):搜索 + 已安装(开关/设置)+ 可安装(市场)
|
||||
// 桌面端插件管理:两页 —— 管理页(横向列表 + 开关)/ 市场页(卡片墙 + 安装)
|
||||
function DesktopPluginsTab (props) {
|
||||
const { PluginHost, pluginItems, setPluginsRev, setTab, wRuntimePlugins } = props
|
||||
const [market, setMarket] = React.useState(null)
|
||||
const [view, setView] = React.useState('manage')
|
||||
const [market, setMarket] = React.useState(function () {
|
||||
try { const M = (typeof window !== 'undefined') ? window.IWBRuntimePluginMarket : null; return M && M.cached ? M.cached() : null } catch (e) { return null }
|
||||
})
|
||||
const [inst, setInst] = React.useState({})
|
||||
const [q, setQ] = React.useState('')
|
||||
const [msg, setMsg] = React.useState('')
|
||||
const [busy, setBusy] = React.useState('')
|
||||
const [restart, setRestart] = React.useState(false)
|
||||
const [devMode, setDevMode] = React.useState(function () {
|
||||
return pluginDevGet()
|
||||
})
|
||||
const [devMode, setDevMode] = React.useState(function () { return pluginDevGet() })
|
||||
const [mf, setMf] = React.useState('all') // 市场页筛选:all / installed / available
|
||||
const [mt, setMt] = React.useState('') // 市场页标签筛选(空=全部标签)
|
||||
const D = (typeof window !== 'undefined') ? window.IWBDesktop : null
|
||||
const refresh = React.useCallback(async () => {
|
||||
if (!D || !D.market) { setMarket([]); return }
|
||||
// 先读本地清单(毫秒级)→ 立刻把「已安装」渲染出来;市场列表(网络)随后补上
|
||||
try {
|
||||
const list = await D.market.list()
|
||||
const cur = await D.market.installed()
|
||||
const map = {}
|
||||
for (const p of (cur || [])) if (p && p.id) map[p.id] = p.version || ''
|
||||
setMarket(list); setInst(map); setMsg('')
|
||||
} catch (e) { setMarket([]); setMsg('市场加载失败:' + String((e && e.message) || e)) }
|
||||
setInst(map)
|
||||
} catch (e) { /* 本地清单失败不阻塞市场请求 */ }
|
||||
try {
|
||||
const list = await D.market.list()
|
||||
setMarket(list); setMsg('')
|
||||
} catch (e) { setMsg('市场加载失败:' + String((e && e.message) || e)) }
|
||||
}, [D])
|
||||
React.useEffect(() => { refresh() }, [refresh])
|
||||
const act = async (kind, id) => {
|
||||
React.useEffect(function () { refresh() }, [refresh])
|
||||
const act = async function (kind, id) {
|
||||
if (!D || !D.market) return
|
||||
setBusy(id)
|
||||
try {
|
||||
const r = kind === 'install' ? await D.market.install(id) : await D.market.uninstall(id)
|
||||
if (!r || !r.ok) { setMsg((r && r.error) || '操作失败'); return }
|
||||
setMsg(kind === 'install' ? '已安装,重启应用后生效' : '已移除外部副本,重启后回退内置')
|
||||
setMsg(kind === 'install' ? '已安装,重启应用后生效' : '已移除')
|
||||
await refresh()
|
||||
setRestart(true)
|
||||
if (kind === 'install') setRestart(true)
|
||||
} finally { setBusy('') }
|
||||
}
|
||||
const toggle = (p, on) => {
|
||||
const r = PluginHost.setEnabled(p.id, on)
|
||||
setPluginsRev((v) => v + 1)
|
||||
if (!r.ok) setMsg(p.name + ':' + r.error)
|
||||
// 用 src 模块加载脚本(不引 app.js 全局),成功后再写启用状态
|
||||
const loadRuntimePlugin = async function (id) {
|
||||
const rec = (wRuntimePlugins || []).find(function (r) { return r && r.id === id })
|
||||
const L = (typeof window !== 'undefined') ? window.IWBRuntimePluginLoader : null
|
||||
if (!rec || !L) { setMsg('插件清单里没有该 id'); return false }
|
||||
let ok = false
|
||||
try {
|
||||
if (rec.source === 'local') ok = await L.loadLocal(rec)
|
||||
else if (rec.source === 'external') ok = await L.loadExternal(rec)
|
||||
else ok = await L.loadBuiltin(rec)
|
||||
} catch (e) { setMsg('加载失败:' + String((e && e.message) || e)); return false }
|
||||
if (!ok) { setMsg('加载失败:' + (rec.error || '脚本已加载但插件未注册')); return false }
|
||||
return true
|
||||
}
|
||||
const toggle = async function (id, on, registered) {
|
||||
setBusy(id)
|
||||
try {
|
||||
// 打开一个「未加载」的插件:先加载脚本,再写启用状态(否则只是记了个开关,插件依然不生效)
|
||||
if (on && !registered) {
|
||||
const okLoad = await loadRuntimePlugin(id)
|
||||
if (!okLoad) return
|
||||
}
|
||||
const r = PluginHost.setEnabled(id, on)
|
||||
if (!r.ok) setMsg('切换失败:' + r.error)
|
||||
else setMsg(on ? '已启用' : '已停用(重启后保持关闭)')
|
||||
} finally {
|
||||
setPluginsRev(function (v) { return v + 1 })
|
||||
setBusy('')
|
||||
}
|
||||
}
|
||||
const kw = q.trim().toLowerCase()
|
||||
const hit = (name, desc) => !kw || (String(name) + ' ' + String(desc || '')).toLowerCase().indexOf(kw) >= 0
|
||||
const hit = function (name, desc) { return !kw || (String(name) + ' ' + String(desc || '')).toLowerCase().indexOf(kw) >= 0 }
|
||||
const mList = market || []
|
||||
const findM = (id) => mList.find((m) => m && m.id === id) || {}
|
||||
const findM = function (id) { return mList.find(function (m) { return m && m.id === id }) || {} }
|
||||
const regById = {}
|
||||
for (const p of (pluginItems || [])) regById[p.id] = p
|
||||
// 已安装:以资料目录 plugins/ 清单为准(装了就列出来,哪怕加载失败也能看到/移除)
|
||||
const installedRows = Object.keys(inst).map((id) => {
|
||||
const installedRows = Object.keys(inst).map(function (id) {
|
||||
const m = findM(id)
|
||||
const reg = regById[id]
|
||||
return {
|
||||
@@ -178,94 +209,220 @@
|
||||
name: m.name || (reg && reg.name) || id,
|
||||
version: m.version || inst[id] || (reg && reg.version) || '',
|
||||
desc: m.desc || '',
|
||||
author: m.author || '',
|
||||
icon: m.icon || '◻',
|
||||
color: m.color || '#eef2f6',
|
||||
tags: m.tags || [],
|
||||
enabled: reg ? !!reg.enabled : true,
|
||||
compatible: reg ? !!reg.compatible : true,
|
||||
registered: !!reg,
|
||||
newer: !!(m.version && inst[id] && m.version !== inst[id]),
|
||||
}
|
||||
}).filter((row) => hit(row.name, row.desc))
|
||||
const availRows = mList.filter((m) => !(m.id in inst) && !regById[m.id] && hit(m.name, m.desc))
|
||||
const updatable = Object.keys(inst).filter((id) => findM(id).version && findM(id).version !== inst[id]).length
|
||||
const dirHint = (() => {
|
||||
}).filter(function (row) { return hit(row.name, row.desc) })
|
||||
const availRows = mList.filter(function (m) { return !(m.id in inst) && !regById[m.id] && hit(m.name, m.desc) })
|
||||
const updatable = Object.keys(inst).filter(function (id) { const m = findM(id); return m.version && m.version !== inst[id] }).length
|
||||
const dirHint = (function () {
|
||||
const F = (typeof window !== 'undefined') ? window.IWBStorageFile : null
|
||||
return (F && F.dir && F.dir()) ? (F.dir() + '/plugins/') : '资料目录/plugins/'
|
||||
})()
|
||||
return el('div', { className: 'iwb-set-page' },
|
||||
el('div', { className: 'iwb-set-page-title' }, '插件'),
|
||||
el('div', { className: 'iwb-hint' }, '插件从市场安装到:' + dirHint + '(应用本体不再自带插件)'),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('label', { className: 'iwb-check', title: '本地开发用:把插件放到 plugins/local/<id>/plugin.js' },
|
||||
el('input', {
|
||||
type: 'checkbox',
|
||||
checked: devMode,
|
||||
onChange: function (e) {
|
||||
const on = e.target.checked
|
||||
setDevMode(on)
|
||||
pluginDevSet(on)
|
||||
setMsg(on ? '已开启开发者模式,重启后加载 plugins/local/ 下的插件' : '已关闭开发者模式,重启后只加载市场安装的插件')
|
||||
const kb = function (n) { return !n ? '' : (n >= 1048576 ? (n / 1048576).toFixed(1) + ' MB' : Math.max(1, Math.round(n / 1024)) + ' KB') }
|
||||
|
||||
// ── 管理页:横向列表(名称/版本/作者 + 描述 + 操作 + 开关),像 Obsidian「第三方插件」 ──
|
||||
const manageView = function () {
|
||||
return el('div', { className: 'iwb-set-page' },
|
||||
el('div', { className: 'iwb-set-page-title' }, '插件'),
|
||||
el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, '插件市场'),
|
||||
el('div', { className: 'iwb-hint' }, '浏览并安装由官方 / 社区制作的插件'),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () { setView('market'); setMsg('') } }, '浏览'),
|
||||
),
|
||||
el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, '插件安装情况'),
|
||||
el('div', { className: 'iwb-hint' }, (installedRows.length ? ('你目前已经安装了 ' + installedRows.length + ' 个插件') : '还没有安装插件') + (updatable ? (',其中 ' + updatable + ' 个可更新') : '')),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: refresh }, '检查更新'),
|
||||
),
|
||||
el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, '开发者模式'),
|
||||
el('div', { className: 'iwb-hint' }, '加载 plugins/local/<id>/plugin.js(未签名,仅本地调试)'),
|
||||
),
|
||||
el('label', { className: 'iwb-switch' },
|
||||
el('input', {
|
||||
type: 'checkbox', checked: devMode,
|
||||
onChange: function (e) {
|
||||
const on = e.target.checked
|
||||
setDevMode(on); pluginDevSet(on)
|
||||
setMsg(on ? '已开启开发者模式,重启后加载 plugins/local/ 下的插件' : '已关闭开发者模式')
|
||||
},
|
||||
}),
|
||||
el('span', { className: 'iwb-switch-track' }, el('span', { className: 'iwb-switch-dot' })),
|
||||
),
|
||||
),
|
||||
el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, '插件诊断'),
|
||||
el('div', { className: 'iwb-hint' }, '加载失败时点这里复制诊断 JSON(含清单、运行时状态、错误原因)'),
|
||||
),
|
||||
el('button', {
|
||||
className: 'iwb-btn iwb-btn-sm',
|
||||
onClick: async function () {
|
||||
try {
|
||||
const F = (typeof window !== 'undefined') ? window.IWBStorageFile : null
|
||||
let manifest = /** @type {any} */ ([])
|
||||
try { manifest = await F.plugins.manifest() } catch (e) { manifest = String(e && e.message) }
|
||||
let marketInfo = null
|
||||
try { const mm = await D.market.list(); marketInfo = { ok: true, count: (mm || []).length } } catch (e) { marketInfo = { ok: false, error: String((e && e.message) || e) } }
|
||||
const payload = {
|
||||
market: marketInfo,
|
||||
dir: (F && F.dir) ? F.dir() : '',
|
||||
devMode: pluginDevGet(),
|
||||
manifest: manifest,
|
||||
runtime: (wRuntimePlugins || []).map(function (r) { return { id: r.id, status: r.status, source: r.source, error: r.error || '', file: r.file, version: r.version } }),
|
||||
registered: (pluginItems || []).map(function (p) { return { id: p.id, enabled: p.enabled, compatible: p.compatible } }),
|
||||
}
|
||||
const text = JSON.stringify(payload, null, 2)
|
||||
try { await navigator.clipboard.writeText(text) } catch (e) { try { const ta = document.createElement('textarea'); ta.value = text; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); ta.remove() } catch (e2) { /* ignore */ } }
|
||||
setMsg('诊断已复制到剪贴板')
|
||||
} catch (e) { setMsg('诊断生成失败:' + String((e && e.message) || e)) }
|
||||
},
|
||||
}),
|
||||
' 开发者模式(加载 plugins/local/<id>/plugin.js,未签名)'),
|
||||
),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('label', { className: 'iwb-check', title: '用于本地开发:把插件放到 plugins/local/<id>/plugin.js' },
|
||||
el('input', {
|
||||
type: 'checkbox', checked: devMode,
|
||||
onChange: (e) => {
|
||||
const on = e.target.checked
|
||||
setDevMode(on)
|
||||
pluginDevSet(on)
|
||||
setMsg(on ? '已开启开发者模式,重启后加载 plugins/local/ 下的插件' : '已关闭开发者模式,重启后只加载市场安装的插件')
|
||||
},
|
||||
}),
|
||||
' 开发者模式(加载 plugins/local/<id>/plugin.js,未签名)'),
|
||||
),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('input', { className: 'iwb-input iwb-grow', placeholder: '搜索已安装的插件…', value: q, onChange: (e) => setQ(e.target.value) }),
|
||||
),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('span', { className: 'iwb-hint', style: { flex: '1 1 auto' } },
|
||||
'已安装 ' + installedRows.length + ' 个' + (mList.length ? (' · 市场 ' + mList.length + ' 个 · 可安装 ' + availRows.length + ' 个') : '') + (updatable ? (' · 可更新 ' + updatable + ' 个') : '')),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: refresh }, '检查更新'),
|
||||
),
|
||||
el('div', { className: 'iwb-section-sub' }, '已安装插件'),
|
||||
installedRows.length ? installedRows.map((p) => {
|
||||
const rt = (wRuntimePlugins || []).find((r) => r && r.id === p.id)
|
||||
const status = !p.registered ? '未加载' : (rt && rt.status === 'error' ? '加载失败' : '已加载')
|
||||
const tagWarn = status !== '已加载'
|
||||
return el('div', { key: p.id, className: 'iwb-plugin-item' },
|
||||
el('div', { className: 'iwb-plugin-main' },
|
||||
el('label', { className: 'iwb-plugin-title' },
|
||||
el('input', { type: 'checkbox', checked: p.enabled, disabled: !p.registered || !p.compatible, onChange: (e) => p.registered && toggle(regById[p.id], e.target.checked) }),
|
||||
el('span', null, p.name + ' v' + p.version),
|
||||
el('span', { className: 'iwb-plugin-tag' + (tagWarn ? ' iwb-plugin-tag-warn' : ''), title: (rt && rt.error) || '' }, status),
|
||||
p.newer ? el('span', { className: 'iwb-plugin-tag' }, '可更新') : null,
|
||||
}, '复制诊断'),
|
||||
),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('span', { className: 'iwb-hint', style: { flex: '1 1 auto' } }, '开关灰色或显示「未加载」时,点右侧按钮会当场加载并启用'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: async function () {
|
||||
const list = installedRows.filter(function (p) { return !p.registered })
|
||||
if (!list.length) { setMsg('已安装的插件都已加载'); return }
|
||||
setBusy('__all__')
|
||||
let ok = 0
|
||||
for (const p of list) {
|
||||
try { const good = await loadRuntimePlugin(p.id); if (good) { PluginHost.setEnabled(p.id, true); ok++ } } catch (e) { /* ignore */ }
|
||||
}
|
||||
setBusy('')
|
||||
setPluginsRev(function (v) { return v + 1 })
|
||||
setMsg('已启用 ' + ok + '/' + list.length + ' 个插件')
|
||||
} }, busy === '__all__' ? '处理中…' : '全部启用'),
|
||||
),
|
||||
el('div', { className: 'iwb-section-sub' }, '已安装插件'),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('input', { className: 'iwb-input iwb-grow', placeholder: '搜索已安装的插件…', value: q, onChange: function (e) { setQ(e.target.value) } }),
|
||||
),
|
||||
installedRows.length ? el('div', { className: 'iwb-mk-list' }, installedRows.map(function (p) {
|
||||
const rt = (wRuntimePlugins || []).find(function (r) { return r && r.id === p.id })
|
||||
const statusText = !p.registered ? '未加载' : (rt && rt.status === 'error' ? '加载失败' : '')
|
||||
const warn = !!statusText
|
||||
return el('div', { key: p.id, className: 'iwb-mk-row' },
|
||||
el('span', { className: 'iwb-mk-avatar', style: { background: p.color } }, p.icon),
|
||||
el('div', { className: 'iwb-mk-row-main' },
|
||||
el('div', { className: 'iwb-mk-row-title' },
|
||||
el('span', { className: 'iwb-mk-row-name' }, p.name),
|
||||
el('span', { className: 'iwb-mk-row-ver' }, 'v' + p.version),
|
||||
p.author ? el('span', { className: 'iwb-mk-row-author' }, p.author === 'official' ? '官方' : p.author) : null,
|
||||
statusText ? el('span', { className: 'iwb-plugin-tag' + (warn ? ' iwb-plugin-tag-warn' : ''), title: (rt && rt.error) || '' }, statusText) : null,
|
||||
p.newer ? el('span', { className: 'iwb-plugin-tag' }, '可更新') : null,
|
||||
),
|
||||
el('div', { className: 'iwb-mk-row-desc' }, p.desc || ''),
|
||||
(rt && rt.error) ? el('div', { className: 'iwb-hint', style: { color: 'var(--iwb-err)' } }, '错误:' + rt.error) : null,
|
||||
),
|
||||
p.desc ? el('div', { className: 'iwb-plugin-desc' }, p.desc) : null,
|
||||
el('div', { className: 'iwb-mk-row-actions' },
|
||||
p.newer ? el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: function () { act('install', p.id) } }, '更新') : null,
|
||||
p.registered ? el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () { setTab('plugin:' + p.id) } }, '设置') : null,
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: function () { act('uninstall', p.id) } }, '移除'),
|
||||
el('label', { className: 'iwb-switch', title: p.registered ? '启用 / 停用' : '未加载,无法启用' },
|
||||
el('input', {
|
||||
type: 'checkbox', checked: p.enabled, disabled: !p.compatible,
|
||||
onChange: function (e) { toggle(p.id, e.target.checked, p.registered) },
|
||||
}),
|
||||
el('span', { className: 'iwb-switch-track' }, el('span', { className: 'iwb-switch-dot' })),
|
||||
),
|
||||
),
|
||||
)
|
||||
})) : el('div', { className: 'iwb-hint' }, kw ? '没有匹配的插件' : (market === null ? '读取插件清单中…' : '还没有安装插件——点上面的「浏览」进入市场')),
|
||||
restart ? el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, '需要重启应用才能生效'),
|
||||
el('div', { className: 'iwb-hint' }, '新装的插件在重启后加载'),
|
||||
),
|
||||
el('div', { className: 'iwb-plugin-actions' },
|
||||
p.registered ? el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => setTab('plugin:' + p.id) }, '设置') : null,
|
||||
p.newer ? el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act('install', p.id) }, '更新') : null,
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act('uninstall', p.id) }, '移除'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () { window.location.reload() } }, '立即重启'),
|
||||
) : null,
|
||||
msg ? el('div', { className: 'iwb-hint' }, msg) : null,
|
||||
)
|
||||
}
|
||||
|
||||
// ── 市场页:卡片墙 + 安装(与 market.maqiart.eu.org 同一套数据/视觉)──
|
||||
const marketView = function () {
|
||||
return el('div', { className: 'iwb-set-page' },
|
||||
el('div', { className: 'iwb-set-page-title' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', style: { marginRight: 10 }, onClick: function () { setView('manage') } }, '返回'),
|
||||
'插件市场',
|
||||
),
|
||||
el('div', { className: 'iwb-hint' }, '共 ' + mList.length + ' 个插件 · 安装在 ' + dirHint),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('input', { className: 'iwb-input iwb-grow', placeholder: '搜索插件,例如:出图、抠图、矢量…', value: q, onChange: function (e) { setQ(e.target.value) } }),
|
||||
),
|
||||
(function () {
|
||||
const tags = []
|
||||
for (const m of mList) for (const t of (m.tags || [])) if (tags.indexOf(t) < 0) tags.push(t)
|
||||
return el('div', { className: 'iwb-mk-filters' }, tags.map(function (t) {
|
||||
return el('button', { key: t, className: 'iwb-mk-chip' + (mt === t ? ' on' : ''), onClick: function () { setMt(mt === t ? '' : t) } }, t)
|
||||
}))
|
||||
})(),
|
||||
(function () {
|
||||
const all = mList.filter(function (m) { return hit(m.name, m.desc) })
|
||||
const shown = all.filter(function (m) {
|
||||
if (mt && (m.tags || []).indexOf(mt) < 0) return false
|
||||
const isInst = (m.id in inst) || !!regById[m.id]
|
||||
if (mf === 'installed') return isInst
|
||||
if (mf === 'available') return !isInst
|
||||
return true
|
||||
})
|
||||
return el('div', null,
|
||||
el('div', { className: 'iwb-mk-filters' },
|
||||
el('button', { className: 'iwb-mk-chip' + (mf === 'all' ? ' on' : ''), onClick: function () { setMf('all') } }, '全部 ' + all.length),
|
||||
el('button', { className: 'iwb-mk-chip' + (mf === 'installed' ? ' on' : ''), onClick: function () { setMf('installed') } }, '已安装 ' + all.filter(function (m) { return (m.id in inst) || !!regById[m.id] }).length),
|
||||
el('button', { className: 'iwb-mk-chip' + (mf === 'available' ? ' on' : ''), onClick: function () { setMf('available') } }, '未安装 ' + all.filter(function (m) { return !((m.id in inst) || !!regById[m.id]) }).length),
|
||||
),
|
||||
shown.length ? el('div', { className: 'iwb-mk-grid' }, shown.map(function (m) {
|
||||
const bits = []
|
||||
if (m.author) bits.push(m.author === 'official' ? '官方' : m.author)
|
||||
if (m.version) bits.push('v' + m.version)
|
||||
if (m.size) bits.push(kb(m.size))
|
||||
return el('div', { key: m.id, className: 'iwb-mk-card' },
|
||||
el('div', { className: 'iwb-mk-head' },
|
||||
el('span', { className: 'iwb-mk-avatar', style: { background: m.color || '#eef2f6' } }, m.icon || '◻'),
|
||||
el('div', { className: 'iwb-mk-titles' },
|
||||
el('div', { className: 'iwb-mk-name' }, m.name || m.id,
|
||||
((m.id in inst) || regById[m.id]) ? el('span', { className: 'iwb-plugin-tag', style: { marginLeft: 6 } }, '已安装') : null,
|
||||
),
|
||||
el('div', { className: 'iwb-mk-sub' }, bits.join(' · ')),
|
||||
),
|
||||
el('div', { className: 'iwb-mk-actions' },
|
||||
((m.id in inst) || regById[m.id])
|
||||
? el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: function () { act('uninstall', m.id) } }, '移除')
|
||||
: el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-primary', disabled: !!busy, onClick: function () { act('install', m.id) } }, busy === m.id ? '处理中…' : '安装'),
|
||||
),
|
||||
),
|
||||
m.desc ? el('div', { className: 'iwb-mk-desc' }, m.desc) : null,
|
||||
(m.tags && m.tags.length) ? el('div', { className: 'iwb-mk-tags' }, m.tags.map(function (t) { return el('span', { key: t, className: 'iwb-mk-tag' }, t) })) : null,
|
||||
)
|
||||
})) : el('div', { className: 'iwb-hint' }, mList.length ? '没有匹配的插件' : '市场加载中…'),
|
||||
)
|
||||
})(),
|
||||
restart ? el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, '需要重启应用才能生效'),
|
||||
el('div', { className: 'iwb-hint' }, '安装完成后重启即可在「管理」页看到'),
|
||||
),
|
||||
)
|
||||
}) : el('div', { className: 'iwb-hint' }, kw ? '没有匹配的插件' : '还没有安装插件——从下面的市场里挑一个'),
|
||||
availRows.length ? el('div', { className: 'iwb-section-sub' }, '可安装(市场)') : null,
|
||||
availRows.map((m) => el('div', { key: m.id, className: 'iwb-plugin-item' },
|
||||
el('div', { className: 'iwb-plugin-main' },
|
||||
el('div', { className: 'iwb-plugin-title' }, el('span', null, (m.name || m.id) + ' v' + m.version)),
|
||||
m.desc ? el('div', { className: 'iwb-plugin-desc' }, m.desc) : null,
|
||||
),
|
||||
el('div', { className: 'iwb-plugin-actions' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act('install', m.id) }, busy === m.id ? '处理中…' : '安装'),
|
||||
),
|
||||
)),
|
||||
restart ? el('div', { className: 'iwb-row' },
|
||||
el('span', { className: 'iwb-hint', style: { flex: '1 1 auto' } }, '需要重启应用才能生效'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => window.location.reload() }, '立即重启'),
|
||||
) : null,
|
||||
msg ? el('div', { className: 'iwb-hint' }, msg) : null,
|
||||
)
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () { window.location.reload() } }, '立即重启'),
|
||||
) : null,
|
||||
msg ? el('div', { className: 'iwb-hint' }, msg) : null,
|
||||
)
|
||||
}
|
||||
|
||||
return view === 'market' ? marketView() : manageView()
|
||||
}
|
||||
|
||||
function renderPluginsTab (ctx) {
|
||||
@@ -348,27 +505,26 @@
|
||||
function VersionBlock (props) {
|
||||
const version = props && props.version ? String(props.version) : ''
|
||||
const [msg, setMsg] = React.useState('')
|
||||
const [found, setFound] = React.useState(null)
|
||||
const invoke = (cmd) => {
|
||||
const T = (typeof window !== 'undefined') ? window.__TAURI__ : null
|
||||
if (!T || !T.core || typeof T.core.invoke !== 'function') return Promise.reject(new Error('Tauri 未就绪'))
|
||||
return T.core.invoke(cmd)
|
||||
}
|
||||
const check = async () => {
|
||||
try {
|
||||
const U = (typeof window !== 'undefined' && window.__TAURI__ && window.__TAURI__.updater) ? window.__TAURI__.updater : null
|
||||
if (!U || typeof U.check !== 'function') {
|
||||
setMsg('在线更新尚未启用:需要配置更新源地址与签名公钥(见 docs/DESKTOP_UPDATE.md)')
|
||||
return
|
||||
}
|
||||
setMsg('正在检查…')
|
||||
const u = await U.check()
|
||||
if (!u) { setMsg('已是最新版本'); return }
|
||||
setMsg('发现新版本 ' + (u.version || '') + ',点「立即更新」下载安装')
|
||||
window.__IWB_UPDATE__ = u
|
||||
} catch (e) { setMsg('检查失败:' + String((e && e.message) || e)) }
|
||||
const r = await invoke('check_update')
|
||||
if (!r) { setFound(null); setMsg('已是最新版本(v' + version + ')'); return }
|
||||
setFound(r)
|
||||
setMsg('发现新版本 v' + (r.version || '') + (r.notes ? ':' + r.notes : ''))
|
||||
} catch (e) { setFound(null); setMsg('检查失败:' + String((e && e.message) || e)) }
|
||||
}
|
||||
const install = async () => {
|
||||
try {
|
||||
const u = window.__IWB_UPDATE__
|
||||
if (!u || typeof u.downloadAndInstall !== 'function') { setMsg('没有可安装的更新'); return }
|
||||
setMsg('正在下载安装…')
|
||||
await u.downloadAndInstall()
|
||||
setMsg('安装完成,请重启应用')
|
||||
setMsg('正在下载并安装,完成后会自动重启…')
|
||||
await invoke('install_update')
|
||||
setMsg('安装完成,正在重启…')
|
||||
} catch (e) { setMsg('更新失败:' + String((e && e.message) || e)) }
|
||||
}
|
||||
return el('div', null,
|
||||
@@ -377,9 +533,9 @@
|
||||
el('span', { className: 'iwb-label' }, '版本'),
|
||||
el('span', { className: 'iwb-hint', style: { flex: '1 1 auto' } }, version || '未知'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: check }, '检查更新'),
|
||||
window.__IWB_UPDATE__ ? el('button', { className: 'iwb-btn iwb-btn-sm', onClick: install }, '立即更新') : null,
|
||||
found ? el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-primary', onClick: install }, '立即更新') : null,
|
||||
),
|
||||
el('div', { className: 'iwb-hint' }, '当前为本地目录版;在线更新需要「更新源 + 签名密钥」两样东西配好才会生效。'),
|
||||
el('div', { className: 'iwb-hint' }, '更新源:download.maqiart.eu.org/updates/latest.json(签名校验通过才会安装)'),
|
||||
msg ? el('div', { className: 'iwb-hint' }, msg) : null,
|
||||
)
|
||||
}
|
||||
@@ -551,35 +707,40 @@
|
||||
function renderPluginSettingsPage (ctx) {
|
||||
const { PluginHost, activePlugin, setMsg, setPluginsRev, setTab } = ctx
|
||||
const pluginSettingsPage = activePlugin ? el('div', { className: 'iwb-set-page' },
|
||||
el('div', { className: 'iwb-set-page-head' },
|
||||
el('div', { className: 'iwb-set-page-headtext' },
|
||||
el('div', { className: 'iwb-set-page-title' }, activePlugin.name),
|
||||
el('div', { className: 'iwb-hint' }, activePlugin.id + ' · v' + activePlugin.version + (activePlugin.compatible ? '' : ' · apiVersion 不兼容') + (activePlugin.enabled ? ' · 已启用' : ' · 未启用')),
|
||||
el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, activePlugin.name,
|
||||
el('span', { className: 'iwb-plugin-tag' + (activePlugin.enabled ? '' : ' iwb-plugin-tag-warn'), style: { marginLeft: 8 } }, activePlugin.enabled ? '已启用' : '未启用'),
|
||||
activePlugin.compatible ? null : el('span', { className: 'iwb-plugin-tag iwb-plugin-tag-warn', style: { marginLeft: 4 } }, 'apiVersion 不兼容'),
|
||||
),
|
||||
el('div', { className: 'iwb-hint' }, activePlugin.id + ' · v' + activePlugin.version),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !activePlugin.compatible, onClick: () => { const r = PluginHost.setEnabled(activePlugin.id, !activePlugin.enabled); setPluginsRev((v) => v + 1); if (!r.ok) setMsg({ type: 'err', text: r.error }) } }, activePlugin.enabled ? '停用' : '启用'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () { setTab('plugins') } }, '返回'),
|
||||
),
|
||||
activePlugin.error ? el('div', { className: 'iwb-status-err' }, activePlugin.error) : null,
|
||||
Object.keys(activePlugin.settingsSchema || {}).length ? Object.keys(activePlugin.settingsSchema).map((key) => {
|
||||
el('div', { className: 'iwb-section-sub' }, '设置'),
|
||||
Object.keys(activePlugin.settingsSchema || {}).length ? Object.keys(activePlugin.settingsSchema).map(function (key) {
|
||||
const spec = activePlugin.settingsSchema[key] || {}
|
||||
const value = activePlugin.settings && activePlugin.settings[key] !== undefined ? activePlugin.settings[key] : spec.default
|
||||
const commit = (next) => { PluginHost.setSetting(activePlugin.id, key, next); setPluginsRev((v) => v + 1) }
|
||||
return el('div', { key, className: 'iwb-set-row' },
|
||||
el('div', { className: 'iwb-set-row-text' },
|
||||
el('div', { className: 'iwb-set-row-title' }, spec.label || key),
|
||||
spec.desc ? el('div', { className: 'iwb-set-row-desc' }, spec.desc) : null,
|
||||
const commit = function (next) { PluginHost.setSetting(activePlugin.id, key, next); setPluginsRev(function (v) { return v + 1 }) }
|
||||
return el('div', { key: key, className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
el('div', { className: 'iwb-mk-setrow-title' }, spec.label || key),
|
||||
spec.desc ? el('div', { className: 'iwb-hint' }, spec.desc) : null,
|
||||
),
|
||||
spec.type === 'boolean'
|
||||
? el('input', { type: 'checkbox', checked: Boolean(value), onChange: (e) => commit(e.target.checked) })
|
||||
? el('label', { className: 'iwb-switch' },
|
||||
el('input', { type: 'checkbox', checked: Boolean(value), onChange: function (e) { commit(e.target.checked) } }),
|
||||
el('span', { className: 'iwb-switch-track' }, el('span', { className: 'iwb-switch-dot' })),
|
||||
)
|
||||
: el('input', {
|
||||
className: 'iwb-input', type: spec.type === 'number' ? 'number' : 'text',
|
||||
value: value === undefined ? '' : String(value),
|
||||
onChange: (e) => commit(spec.type === 'number' ? Number(e.target.value) : e.target.value),
|
||||
}),
|
||||
className: 'iwb-input', type: spec.type === 'number' ? 'number' : 'text',
|
||||
style: { maxWidth: '260px' },
|
||||
value: value === undefined ? '' : String(value),
|
||||
onChange: function (e) { commit(spec.type === 'number' ? Number(e.target.value) : e.target.value) },
|
||||
}),
|
||||
)
|
||||
}) : el('div', { className: 'iwb-hint' }, '该插件没有可配置项。'),
|
||||
el('div', { className: 'iwb-row', style: { marginTop: '12px' } },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => setTab('plugins') }, '← 返回插件列表'),
|
||||
),
|
||||
) : el('div', { className: 'iwb-hint' }, '插件不存在或已卸载。')
|
||||
return pluginSettingsPage
|
||||
}
|
||||
@@ -622,7 +783,7 @@
|
||||
const { addLlmAddr, addLlmKey, addLlmModel, addLlmProvider, api, delLlmAddr, delLlmKey, delLlmModel, delLlmProvider, draft, llmAddrInput, llmAddrRes, llmAddrTesting, llmKeyInput, llmModelInput, llmTestMsg, llmTestSel, llmTesting, llmWarn, msg, setLlm, setLlmAddr, setLlmAddrDefault, setLlmAddrInput, setLlmDefaultModel, setLlmKey, setLlmKeyInput, setLlmModelInput, setLlmProv, setLlmTestSel, testLlm, testLlmAddrs } = ctx
|
||||
const llmTab = el('div', { className: 'iwb-section' },
|
||||
el('div', { className: 'iwb-section-title' }, 'LLM 渠道(可选,用于提示词润色)'),
|
||||
el('div', { className: 'iwb-hint' }, '支持多个渠道:每个渠道独立 Base URL / 多个 Key / 多个模型,可分别测试;润色使用「默认渠道」。已保存的 Key 也能直接选择测试。'),
|
||||
el('div', { className: 'iwb-hint' }, '可选 · 用于提示词润色;润色使用「默认渠道」。'),
|
||||
(draft.llm.providers || []).length
|
||||
? draft.llm.providers.map((p, pi) => {
|
||||
const isDef = p.id === draft.llm.defaultProviderId
|
||||
@@ -639,19 +800,19 @@
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm' + (isDef ? ' iwb-btn-primary' : ''), title: isDef ? '当前默认渠道(润色用)' : '设为默认渠道', onClick: () => setLlm({ defaultProviderId: p.id }) }, isDef ? '✓ 默认' : '设为默认'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '删除该渠道', onClick: () => delLlmProvider(pi) }, '删除'),
|
||||
),
|
||||
el('div', { className: 'iwb-label' }, '地址(可多个,第一行为主地址;填到 /v1 为止,不要带 /chat/completions —— 应用会自动拼接口路径)'),
|
||||
el('div', { className: 'iwb-label', title: '可填多个;第一行是主地址。地址填到 /v1 为止,不要带 /chat/completions —— 应用会自动拼接口路径' }, '地址'),
|
||||
[p.baseUrl || ''].concat(p.fallbacks || []).map((a, ai) => el('div', { key: ai, className: 'iwb-row' },
|
||||
el('input', { className: 'iwb-input iwb-grow', value: a || '', placeholder: ai === 0 ? '主地址,如 https://api.example.com/v1' : '备用地址,如 https://api2.example.com/v1', onChange: (e) => setLlmAddr(pi, ai, e.target.value) }),
|
||||
ai === 0 ? el('span', { className: 'iwb-hint iwb-llm-main' }, '主') : el('button', { className: 'iwb-btn iwb-btn-sm', title: '设为主地址(润色优先使用)', onClick: () => setLlmAddrDefault(pi, ai) }, '设为主'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-xs', title: '删除该地址', onClick: () => delLlmAddr(pi, ai) }, '×'),
|
||||
)),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('input', { className: 'iwb-input iwb-grow', value: llmAddrInput[pi] || '', placeholder: '备用地址,回车添加(填到 /v1 为止,不要带 /chat/completions)', onChange: (e) => setLlmAddrInput((m) => ({ ...m, [pi]: e.target.value })), onKeyDown: (e) => { if (e.key === 'Enter') { e.preventDefault(); addLlmAddr(pi) } } }),
|
||||
el('input', { className: 'iwb-input iwb-grow', value: llmAddrInput[pi] || '', placeholder: '备用地址(可选),回车添加', onChange: (e) => setLlmAddrInput((m) => ({ ...m, [pi]: e.target.value })), onKeyDown: (e) => { if (e.key === 'Enter') { e.preventDefault(); addLlmAddr(pi) } } }),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => addLlmAddr(pi) }, '+ 地址'),
|
||||
el('button', { className: 'iwb-btn', disabled: !!llmAddrTesting[pi], onClick: () => testLlmAddrs(pi) }, llmAddrTesting[pi] ? '测试中…' : '测全部地址'),
|
||||
),
|
||||
(llmAddrRes[pi] && llmAddrRes[pi].length) ? el('div', { className: 'iwb-llm-addrres' }, llmAddrRes[pi].map((r, ri) => el('div', { key: ri, className: 'iwb-hint', style: { color: r.ok ? '#15803d' : '#b91c1c', whiteSpace: 'pre-wrap' } }, (r.ok ? '✓ ' : '✗ ') + (r.url || '') + ' · ' + r.ms + 'ms' + (r.ok ? (' · ' + r.models + ' 模型') : (' · ' + (r.error || '')))))) : null,
|
||||
el('div', { className: 'iwb-label' }, 'Key(可多个;名称框窄、密钥框占满;测试时选择用哪个 Key)'),
|
||||
el('div', { className: 'iwb-label', title: '可填多个 Key;测试时可选择用哪个' }, 'Key'),
|
||||
pKeys.map((k) => el('div', { key: k.id, className: 'iwb-row' },
|
||||
el('input', { className: 'iwb-input iwb-llm-keyname', value: k.name || '', placeholder: '名称', title: 'Key 名称', onChange: (e) => setLlmKey(pi, k.id, { name: e.target.value }) }),
|
||||
el('input', { className: 'iwb-input iwb-grow', value: k.value || '', placeholder: k.masked ? ('已保存 ' + k.masked + '(留空保持不变,重新输入覆盖)') : 'API Key', onChange: (e) => setLlmKey(pi, k.id, { value: e.target.value }) }),
|
||||
@@ -662,7 +823,7 @@
|
||||
el('input', { className: 'iwb-input iwb-grow', value: keyInp.value || '', placeholder: '新 API Key', onChange: (e) => setLlmKeyInput((m) => ({ ...m, [pi]: Object.assign({}, m[pi] || {}, { value: e.target.value }) })) }),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => addLlmKey(pi) }, '+ Key'),
|
||||
),
|
||||
el('div', { className: 'iwb-label' }, '模型(「✓」为默认模型,润色用;点击名称切换默认)'),
|
||||
el('div', { className: 'iwb-label', title: '点模型名切换默认(✓);润色用默认模型' }, '模型'),
|
||||
pModels.length ? el('div', { className: 'iwb-modellist' }, pModels.map((m, mi) => {
|
||||
const active = (p.defaultModel || '') === m.name
|
||||
return el('div', { key: mi, className: 'iwb-modelrow' + (active ? ' iwb-modelrow-active' : '') },
|
||||
@@ -690,10 +851,10 @@
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('button', { className: 'iwb-btn', onClick: addLlmProvider }, '+ 添加渠道'),
|
||||
),
|
||||
el('div', { className: 'iwb-label' }, '默认润色指令(全局模板,LLM 节点内可覆盖;最多两行,可滚动)'),
|
||||
el('div', { className: 'iwb-label', title: '全局模板;LLM 节点内可覆盖' }, '默认润色指令'),
|
||||
el('textarea', { className: 'iwb-input iwb-hdrbox', style: { minHeight: '40px', maxHeight: '64px', overflowY: 'auto' }, value: draft.llm.defaultInstruction || '', onChange: (e) => setLlm({ defaultInstruction: e.target.value }) }, null),
|
||||
llmWarn ? el('div', { className: 'iwb-hint', style: { color: '#b91c1c' } }, llmWarn) : null,
|
||||
el('div', { className: 'iwb-hint' }, '流程可不经过 LLM(直接连 生图)。LLM 节点未填指令时使用此模板。默认渠道缺失时使用第一个渠道。'),
|
||||
el('div', { className: 'iwb-hint' }, '流程可不经过 LLM(直接连生图);节点未填指令时用此模板。'),
|
||||
)
|
||||
return llmTab
|
||||
}
|
||||
|
||||
@@ -1965,4 +1965,86 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-confirm-box { width: min(460px, calc(100vw - 48px)); background: var(--iwb-layer); color: var(--iwb-text); border-radius: 12px; padding: 18px 20px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
|
||||
.iwb-confirm-title { font-weight: 650; font-size: 15px; margin-bottom: 8px; }
|
||||
.iwb-confirm-text { font-size: 13.5px; line-height: 1.65; color: var(--iwb-text2); white-space: pre-wrap; word-break: break-word; }
|
||||
.iwb-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
|
||||
.iwb-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
|
||||
/* 插件市场卡片(设置 → 插件 / 与 market.maqiart.eu.org 同一套视觉) */
|
||||
.iwb-mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 4px 0 6px; }
|
||||
.iwb-mk-card { border: 1px solid var(--iwb-border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 132px; }
|
||||
.iwb-mk-head { display: flex; gap: 10px; align-items: center; }
|
||||
.iwb-mk-avatar { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 36px; }
|
||||
.iwb-mk-titles { min-width: 0; }
|
||||
.iwb-mk-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; }
|
||||
.iwb-mk-sub { color: var(--iwb-text2); font-size: 12px; margin-top: 2px; }
|
||||
.iwb-mk-desc { color: var(--iwb-text2); font-size: 12.5px; line-height: 1.5; flex: 1 1 auto; }
|
||||
.iwb-mk-tags { display: flex; gap: 6px; flex-wrap: wrap; }
|
||||
.iwb-mk-tag { padding: 1px 8px; border-radius: 999px; background: var(--iwb-layer2); color: var(--iwb-text2); font-size: 11px; }
|
||||
.iwb-mk-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
|
||||
/* 设置行(Obsidian 风格:标题 + 说明 + 右侧控件) */
|
||||
.iwb-set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--iwb-border); }
|
||||
.iwb-set-row-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-set-row-title { font-weight: 600; font-size: 14px; }
|
||||
|
||||
/* 开关 */
|
||||
.iwb-switch { display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
|
||||
.iwb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
|
||||
.iwb-switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--iwb-border); position: relative; transition: background .15s; }
|
||||
.iwb-switch-dot { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
|
||||
.iwb-switch input:checked + .iwb-switch-track { background: #6b5ce7; }
|
||||
.iwb-switch input:checked + .iwb-switch-track .iwb-switch-dot { transform: translateX(16px); }
|
||||
.iwb-switch input:disabled + .iwb-switch-track { opacity: .45; }
|
||||
|
||||
/* 已安装插件:横向列表 */
|
||||
.iwb-mk-list { display: flex; flex-direction: column; }
|
||||
.iwb-mk-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--iwb-border); }
|
||||
.iwb-mk-row-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
||||
.iwb-mk-row-name { font-weight: 600; font-size: 14px; }
|
||||
.iwb-mk-row-ver { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-mk-row-author { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-mk-row-desc { color: var(--iwb-text2); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-mk-row-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
|
||||
.iwb-mk-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
|
||||
.iwb-mk-chip { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--iwb-border); background: transparent; color: var(--iwb-text2); font-size: 12px; cursor: pointer; }
|
||||
.iwb-mk-chip.on { background: var(--iwb-text); color: var(--iwb-layer); border-color: var(--iwb-text); }
|
||||
/* 插件设置:行(无边框盒子,只有细分隔线) */
|
||||
.iwb-mk-setrow { display: flex; align-items: center; gap: 16px; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--iwb-border); background: transparent; border-radius: 0; margin: 0; }
|
||||
.iwb-mk-setrow:last-of-type { border-bottom: 0; }
|
||||
.iwb-mk-setrow-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-setrow-title { font-weight: 600; font-size: 14px; line-height: 1.4; }
|
||||
.iwb-mk-setrow .iwb-hint { margin-top: 3px; line-height: 1.55; }
|
||||
|
||||
/* 市场页筛选条 */
|
||||
.iwb-mk-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; align-items: center; }
|
||||
.iwb-mk-filters .iwb-mk-sep { width: 1px; height: 16px; background: var(--iwb-border); margin: 0 4px; }
|
||||
/* 市场卡片:等高、底部按钮对齐 */
|
||||
.iwb-mk-grid { align-items: stretch; }
|
||||
.iwb-mk-card { min-height: 178px; display: flex; flex-direction: column; gap: 8px; }
|
||||
.iwb-mk-card .iwb-mk-desc { flex: 1 1 auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
|
||||
.iwb-mk-card .iwb-mk-tags { min-height: 20px; align-items: center; }
|
||||
.iwb-mk-card .iwb-mk-actions { margin-top: auto; display: flex; align-items: center; justify-content: flex-end; min-height: 30px; }
|
||||
.iwb-mk-card .iwb-mk-name { line-height: 1.35; }
|
||||
.iwb-mk-card .iwb-plugin-tag { font-size: 11px; padding: 0 6px; line-height: 16px; }
|
||||
/* 市场卡片:紧凑版(按钮在右上角,去掉底部空档) */
|
||||
.iwb-mk-card { min-height: 0; padding: 10px 12px; gap: 6px; border-radius: 10px; }
|
||||
.iwb-mk-head { align-items: flex-start; gap: 8px; }
|
||||
.iwb-mk-titles { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-head .iwb-mk-actions { flex: 0 0 auto; margin: 0; padding: 0; min-height: 0; }
|
||||
.iwb-mk-card .iwb-mk-avatar { width: 32px; height: 32px; flex: 0 0 32px; font-size: 17px; border-radius: 9px; }
|
||||
.iwb-mk-card .iwb-mk-name { font-size: 13.5px; }
|
||||
.iwb-mk-card .iwb-mk-sub { font-size: 11.5px; margin-top: 1px; }
|
||||
.iwb-mk-card .iwb-mk-desc { font-size: 12px; line-height: 1.45; min-height: 0; margin-top: 2px; }
|
||||
.iwb-mk-card .iwb-mk-tags { min-height: 0; margin-top: 2px; gap: 5px; }
|
||||
.iwb-mk-card .iwb-mk-tag { font-size: 10.5px; padding: 0 7px; line-height: 16px; }
|
||||
.iwb-mk-grid { gap: 10px; }
|
||||
.iwb-mk-card .iwb-btn-sm { padding: 3px 10px; font-size: 12px; }
|
||||
/* LLM 渠道:去掉外框,改成分区 + 细分隔线;默认渠道用左侧色条标记 */
|
||||
.iwb-settings-modal .iwb-llm-card { border: 0; border-top: 1px solid var(--iwb-border); border-radius: 0; background: transparent; padding: 12px 0 8px; margin: 0; }
|
||||
.iwb-settings-modal .iwb-llm-card:first-of-type { border-top: 0; }
|
||||
.iwb-settings-modal .iwb-llm-card-def { border-left: 2px solid #6b5ce7; padding-left: 12px; }
|
||||
.iwb-settings-modal .iwb-llm-card .iwb-label { font-size: 12px; color: var(--iwb-text2); font-weight: 600; margin: 10px 0 4px; }
|
||||
.iwb-settings-modal .iwb-llm-card .iwb-row { margin: 4px 0; gap: 8px; }
|
||||
.iwb-settings-modal .iwb-llm-card .iwb-input { padding: 6px 10px; font-size: 13px; }
|
||||
.iwb-settings-modal .iwb-modellist { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
|
||||
.iwb-settings-modal .iwb-modelrow { padding: 2px 8px; border-radius: 999px; background: var(--iwb-layer2); border: 1px solid transparent; margin: 0; font-size: 12.5px; }
|
||||
.iwb-settings-modal .iwb-modelrow-active { border-color: #6b5ce7; background: rgba(107,92,231,.08); }
|
||||
.iwb-settings-modal .iwb-llm-card .iwb-btn-xs { opacity: .5; }
|
||||
.iwb-settings-modal .iwb-llm-card .iwb-btn-xs:hover { opacity: 1; }
|
||||
@@ -0,0 +1,43 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const code = fs.readFileSync(path.join(__dirname, '../src/clipboard-graph.js'), 'utf8')
|
||||
|
||||
function makeGlobal (withClipboard) {
|
||||
const calls = []
|
||||
const g = {
|
||||
TextEncoder,
|
||||
TextDecoder,
|
||||
btoa: (s) => Buffer.from(s, 'binary').toString('base64'),
|
||||
atob: (s) => Buffer.from(s, 'base64').toString('binary'),
|
||||
navigator: {},
|
||||
__TAURI__: { core: { invoke: (cmd, args) => { calls.push({ cmd, args }); return Promise.resolve(true) } } },
|
||||
console,
|
||||
}
|
||||
if (withClipboard) {
|
||||
g.ClipboardItem = function (items) { this.items = items }
|
||||
g.Blob = function (parts, opts) { this.parts = parts; this.type = (opts || {}).type }
|
||||
g.navigator.clipboard = { write: () => Promise.reject(new Error('not allowed')) }
|
||||
}
|
||||
return { g, calls }
|
||||
}
|
||||
|
||||
function run (withClipboard) {
|
||||
const { g, calls } = makeGlobal(withClipboard)
|
||||
const fn = new Function('window', 'globalThis', code + '\nreturn window.IWBClipboardGraph')
|
||||
const G = fn(g, g)
|
||||
const clip = { nodes: [{ id: 'n1', type: 'prompt', text: '两只猫在窗台' }], edges: [] }
|
||||
return G.write(clip).then((ok) => {
|
||||
const matched = G.matchPlain(G.plainFor(clip))
|
||||
return { ok, calls, plain: G.plainFor(clip), matched: !!matched, id: matched && matched.nodes[0].id }
|
||||
})
|
||||
}
|
||||
|
||||
run(false).then((r) => {
|
||||
console.log('无 clipboard.write(WKWebView 场景):', JSON.stringify({ ok: r.ok, native: r.calls.map(c => c.cmd), matched: r.matched, id: r.id }))
|
||||
if (!(r.ok && r.calls.some(c => c.cmd === 'clipboard_write_text') && r.matched)) process.exit(1)
|
||||
return run(true)
|
||||
}).then((r) => {
|
||||
console.log('有 clipboard.write 且被拒绝:', JSON.stringify({ ok: r.ok, native: r.calls.map(c => c.cmd), matched: r.matched }))
|
||||
if (!(r.ok && r.matched)) process.exit(1)
|
||||
console.log('PASS 图剪贴板兜底(原生写文本 + 摘要匹配)')
|
||||
}).catch((e) => { console.error('FAIL', e); process.exit(1) })
|
||||
+1
@@ -20,6 +20,7 @@
|
||||
"IWBImageCompress",
|
||||
"IWBImagePreviewDerive",
|
||||
"IWBMetricsSwallow",
|
||||
"IWBNativeClipboard",
|
||||
"IWBNodeBodies",
|
||||
"IWBPluginHost",
|
||||
"IWBProviderPing",
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"clipboard-paste.js",
|
||||
"clipboard-copy.js",
|
||||
"clipboard-paste-once.js",
|
||||
"clipboard-native.js",
|
||||
"generation-size-policy.js",
|
||||
"generation-request-shape.js",
|
||||
"image-preview-derive.js",
|
||||
|
||||
@@ -1501,7 +1501,9 @@ const nodeXY = (el0) => {
|
||||
const raw74 = window.localStorage.getItem('iwb_clipboard')
|
||||
let clip74 = null; try { clip74 = JSON.parse(raw74) } catch (e) { clip74 = null }
|
||||
assert('74-3 复制写入内部剪贴板(结构 + at 时间戳)', !!clip74 && clip74.type === 'iwb-clipboard' && typeof clip74.at === 'number' && clip74.nodes.length === 1, raw74 ? 'len=' + raw74.length : 'null')
|
||||
assert('74-4 复制不再写系统剪贴板', clipWrites74.length === 0, 'writes=' + clipWrites74.length)
|
||||
// v3.25.4:复制节点的语义改回「一个键贴所有」——系统剪贴板写不进 text/html 时(WKWebView),
|
||||
// 退化为写纯文本摘要 + 记住 clip,Ctrl+V 时按摘要精确匹配贴回节点组;所以这里应当有 1 次写入。
|
||||
assert('74-4 复制写入系统剪贴板(富文本不可用时退化纯文本摘要)', clipWrites74.length === 1, 'writes=' + clipWrites74.length)
|
||||
// 74-5 Ctrl+Shift+V 永远粘贴节点组(不受系统剪贴板内容影响)
|
||||
key74('v', { ctrlKey: true, shiftKey: true }); await wait(200)
|
||||
assert('74-5 Ctrl+Shift+V 粘贴节点组', nodeCount74() === base74 + 1, 'n=' + nodeCount74() + ' expect=' + (base74 + 1))
|
||||
@@ -1521,7 +1523,8 @@ const nodeXY = (el0) => {
|
||||
key74('c', { ctrlKey: true }); await wait(80)
|
||||
const rawBig74 = window.localStorage.getItem('iwb_clipboard') || ''
|
||||
assert('74-7 剪贴板把大图剥离为 {__blob} 引用(新写入主通道;无 base64)', rawBig74.indexOf('__blob') >= 0 && !/data:image\/[^"']*;base64,[A-Za-z0-9+/=]{3000,}/.test(rawBig74), 'len=' + rawBig74.length)
|
||||
assert('74-8 大图复制同样不写系统剪贴板', clipWrites74.length === 0, 'writes=' + clipWrites74.length)
|
||||
// 同上:大图复制也走同一条兜底(摘要里只有「N 个节点」,绝不写 base64)
|
||||
assert('74-8 大图复制也只写摘要文本(无 base64)', clipWrites74.length === 2 && clipWrites74.every((t) => t.indexOf('base64') < 0), 'writes=' + clipWrites74.length)
|
||||
// 53. 冲突保护源码断言(Web 无 server:wApi 单机无冲突,跳过 server 部分)
|
||||
const app53 = fs.readFileSync(path.join(APP, 'app.js'), 'utf8')
|
||||
// 2026-11-16:persistWs / duplicateWs 搬到 src/runtime-workbench-logic.js(棘轮腾位),
|
||||
|
||||
@@ -227,7 +227,8 @@ const lazyHost = sandbox.IWBPluginHostFactory()
|
||||
const lazyState = { 'lazy-plugin': { enabled: true, settings: {}, data: {} } }
|
||||
lazyHost.init({ readState: () => lazyState, writeState: () => {}, log: () => {} })
|
||||
assert.strictEqual(lazyHost.isEnabled('lazy-plugin'), true, '未注册插件也应读出持久化的启用开关')
|
||||
assert.strictEqual(lazyHost.isEnabled('never-heard'), false, '持久化里没有的未注册插件应为 false')
|
||||
// 2026-11-17:改为默认 true —— 启动早期持久化还没读到时,若按 false 处理会把所有插件判成"已停用"而进 idle
|
||||
assert.strictEqual(lazyHost.isEnabled('never-heard'), true, '持久化里没有记录的未注册插件按默认启用(true)')
|
||||
assert.strictEqual(Object.keys(lazyState).join(','), 'lazy-plugin', 'isEnabled 查询不得为未注册插件创建 state 条目')
|
||||
|
||||
console.log('plugin host checks passed')
|
||||
Vendored
+1
@@ -29,6 +29,7 @@ interface Window {
|
||||
IWBRuntimePluginLoader?: any
|
||||
IWBRuntimePluginMarket?: any
|
||||
IWBRuntimePluginBackup?: any
|
||||
IWBPluginRuntime?: any
|
||||
IWBDesktop?: any
|
||||
IWBStorageFallbackIndexedDb?: any
|
||||
// 画布 / 工作台
|
||||
|
||||
Reference in new issue
Block a user