Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22f4d7adb0 | ||
|
|
ad1bb6016e | ||
|
|
8dc01708dc | ||
|
|
f4e4ca5649 | ||
|
|
35ac37fb45 | ||
|
|
2a1fa03132 | ||
|
|
78519b56d8 |
No files matched your search
@@ -14,6 +14,68 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## v3.25.92(2026-11-21)插件独立底色改为可选(默认关)
|
||||
|
||||
### 调整
|
||||
- 3.25.89 的插件作用域重映射默认开启,导致风格库/浏览器等插件卡片与网格底色被换掉(用户反馈样式不对)。
|
||||
- 现在改为**可选开关**:外观 → 插件面板 → 「独立底色」,默认关闭 ⇒ 插件完全回到旧外观;需要浅灰面板底时手动打开。
|
||||
|
||||
## v3.25.91(2026-11-21)修浏览器面板空白 + 插件样式跑偏
|
||||
|
||||
### 修复
|
||||
- **浏览器面板空白**:拖停靠栏宽度时会在 `iwb:dock-resizing` 里暂停原生视图;如果松手发生在窗口外,收不到 pointerup ⇒ 一直处于暂停、网页永远不显示。现在:暂停最多 1.2 秒自动恢复,并在全局 pointerup / 窗口失焦时立即恢复。
|
||||
- **插件样式跑偏(风格库等)**:v3.25.89 的作用域重映射把 `--iwb-layer/--iwb-layer2/--iwb-hover` 一起换掉了,插件卡片/网格底色被改成插件层。现在**只重指面板底色** `--iwb-panel`,其余变量保持原值;同时删掉有风险的 `!important` 压平规则。
|
||||
|
||||
## v3.25.90(2026-11-21)首次启动不再纯白屏
|
||||
|
||||
### 问题
|
||||
- 首次启动/重装后,`app.js` 顶部 `await IWBStorageFile.ready()` 会触发 macOS「访问文稿文件夹」授权;在用户点「允许」前 React 没挂载 ⇒ 窗口纯白,看起来像卡死。
|
||||
|
||||
### 修复
|
||||
- `index.html` 加**静态启动层**(纯 HTML+内联 CSS,不依赖 JS):显示「生图工作台 / 正在加载…」并提示「若系统弹出访问文稿请求请点允许」。
|
||||
- 资料目录就绪后淡出移除;网页版同样生效。
|
||||
- **数据目录不变**(仍 `~/Documents/ImageWorkbench`,用户裁定)。
|
||||
|
||||
## v3.25.89(2026-11-21)插件面板配色统一(四层语义)
|
||||
|
||||
### 调查
|
||||
- 停靠栏 `#E2E4E6` 与插件面板 `#FFFFFF` 对比度仅 1.27:1 → 插件把灰栏整块盖成白;插件内 fallback 还互相矛盾(#fff / #f5f6f8 / #2a2a2a)。
|
||||
|
||||
### 规范(docs/standards/plugin-theme.md)
|
||||
- 四层语义:`--iwb-plugin-surface`(面板浅灰)/ `-card`(卡片白)/ `-inset`(内嵌灰)/ `-hover`;全部由 4 个种子派生。
|
||||
- 作用域重映射:`.iwb-dock-body` 等容器内把 `--iwb-panel/--iwb-layer/--iwb-layer2/--iwb-hover` 重指到插件层 ⇒ **插件零改动**自动变淡。
|
||||
- 外观新增「插件面板 → 底色深浅」(0~30,默认 12)。
|
||||
|
||||
### 未做
|
||||
- 插件源码里写死的按钮色(浏览器/批量导出/风格库/位图转矢量)仍在白名单,需插件仓库改用 `--iwb-plugin-*`。
|
||||
|
||||
## v3.25.88(2026-11-21)浏览器面板切页/拖宽延迟(同一根因)
|
||||
|
||||
### 调查结论
|
||||
- 浏览器面板不是 iframe,而是宿主用 Tauri `add_child` 建的原生子 webview,盖在锚点上;位置由 `src/canvas-webview.js` 每 32ms(`TICK_MS`)通过 IPC 同步
|
||||
### 根因
|
||||
- 原生视图永远在主 webview 之上:切页/拖宽时 DOM 已变,但原生层要等下一帧 tick + 一次 IPC 才移动,看起来就是「慢一秒」
|
||||
- 拖宽时每个 `pointermove` 都 `setState` → 整棵停靠栏(含插件 DOM)重渲染 → 每帧一次 IPC + 原生 resize → 卡顿
|
||||
### 修复
|
||||
- 新增 `IWBCanvasWebview.parkAll()` / `setSuspended()`:切页时立刻把原生视图 park 出窗口(不销毁),拖宽期间暂停同步
|
||||
- `ui-dock` 拖宽改为「只改 DOM 宽度 + rAF 合并,松手才 setState」,并派发 `iwb:dock-resizing` 让宿主暂停原生视图
|
||||
- 覆盖层离开 `iwb-view-canvas` 时自动 parkAll(MutationObserver 监听 class)
|
||||
|
||||
## v3.25.87(2026-11-21)面板重启用补回 + 插件页停靠栏立即隐藏
|
||||
|
||||
### 修复
|
||||
- **重新启用插件后面板不回来(节点组/提示词库)**:上一版只在「该侧列表为空」时兜底;实际关插件只剔掉那一个 id,列表非空所以永远补不回。现在清洗时按**默认面板列表逐项补回**(`panels[id]` 存在且未手动移出),插件的 `removed` 记录继续生效。
|
||||
- **插件市场页还会闪出浏览器面板**:除条件渲染外,补 CSS `.iwb-view-plugins/.iwb-view-home/.iwb-view-landing .iwb-dockarea { display:none }` —— 直接不画,不等淡出动画。
|
||||
|
||||
## v3.25.86(2026-11-21)停靠栏作用域 / 插件重启用 / 保存按钮
|
||||
|
||||
### 修复
|
||||
- **浏览器插进插件页**:停靠栏改为只在 `shellView === 'canvas'` 时渲染(插件整页/首页不再带左右栏)。
|
||||
- **重新启用提词库/节点组后左栏不显示**:之前关插件时把面板列表清空了,重新启用只恢复面板对象、列表还是空的。现在列表为空时回落到默认面板列表(`props.defaults`)。
|
||||
|
||||
### 新增
|
||||
- 插件设置页增加「保存设置」按钮:调用 `PluginHost.persist()` 显式落盘并提示(`setSetting` 本身已即时保存,这里是用户要的明确出口)。
|
||||
|
||||
## v3.25.85(2026-11-21)P3 收尾 + P4 插件主题契约
|
||||
|
||||
### P3 收尾(表面色/语义色全部走 token)
|
||||
|
||||
@@ -11,6 +11,14 @@
|
||||
await window.IWBStorageFile.ready()
|
||||
}
|
||||
} catch (e) { console.error('[iwb][file-store] 启动装载失败,回退浏览器存储', e) }
|
||||
// v3.25.90:静态启动层(index.html 的 #iwb-boot)到这里就没用了 —— 淡出后移除
|
||||
try {
|
||||
const boot = document.getElementById('iwb-boot')
|
||||
if (boot) {
|
||||
boot.style.opacity = '0'
|
||||
setTimeout(() => { try { boot.remove() } catch (e) { /* ignore */ } }, 220)
|
||||
}
|
||||
} catch (e) { /* ignore */ }
|
||||
const el = React.createElement
|
||||
const { useState, useEffect, useLayoutEffect, useRef } = React
|
||||
// 生成结果精简/合并模块(src/generation-results-store.js)。⚠️ 必须在 IIFE 最顶部取:
|
||||
@@ -8538,7 +8546,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
measuredT: tick,
|
||||
onJump: mmOnJump,
|
||||
}) : null,
|
||||
DockArea ? el(DockArea, { panels: dockPanels, renderIcon: I, storageKey: 'iwb.dock.v1', PluginHost,
|
||||
(shellView === 'canvas' && DockArea) ? el(DockArea, { panels: dockPanels, renderIcon: I, storageKey: 'iwb.dock.v1', PluginHost,
|
||||
pluginMount: (id) => { const p = wPluginPanels.find((x) => x.pluginId === id || x.id === id + '-panel'); return p ? p.mount : null },
|
||||
rightOpen: drawerOpen, onRightOpen: (v) => setDrawerOpen(v),
|
||||
defaults: { left: { open: true, w: 318, list: ['groups', 'browser', 'styles'], active: 'browser' }, right: { open: true, w: 330, list: ['prompts', 'gallery'], active: 'gallery' } },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 现状架构与性能事实基线(image-workbench-web)
|
||||
|
||||
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
|
||||
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = bbb763c`(线上 `v3.25.85+bbb763c` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
|
||||
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = ad1bb60`(线上 `v3.25.92+ad1bb60` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
|
||||
<!-- 2026-10-28 P1 拆分批 1:新增 src/generation-task-graph.js(5 个任务图纯函数自 app.js 迁出)
|
||||
⇒ 模块数 60→61、耦合面 51→52、sourceModules 60→61。耦合面只**新增** IWBWTaskGraph,无删除。
|
||||
2026-10-28 P1 拆分批 2:新增 src/storage-config-shape.js(9 个配置形状纯函数自 app.js 迁出)
|
||||
@@ -278,3 +278,4 @@
|
||||
**鲜艺抠图插件(2026-10-17 起改为 A2 运行时插件,`dist` 不再内置)**:源码已迁出主仓到独立插件仓(`iwb-plugins`),经 Cloudflare Function `functions/plugins/[[path]].js` + KV(binding `PLUGINS`)**同源运行时加载**(同源 ⇒ CSP 零改动);主包**已不含** `src/plugin-xianyi-cutout.js`。功能:右键命令「抠图:选中节点」→ `POST {apiUrl}/rmbg?crop=`(`application/octet-stream` + 原始字节)→ 结果 PNG 写回为新的参考图节点(`<原名>_cutout.png`)。契约对齐 `iwb-plaus` v3.1.3 的 `background.js`(二进制进 / PNG 字节出;无 token、无 JSON),但**补齐了原版缺失的超时**(`AbortController` + 可配 `timeoutMs`)。设置项:`apiUrl` / `crop` / `timeoutMs`。尚未提供的能力面(若日后需要):插件只读「选中节点」与按 id 取节点图(`canvas` 目前只有 `getNodes` / `listNodeTypes`)。
|
||||
|
||||
**KV 信任锚与治理(2026-10-19 补充,规则见规则库 §13.35)**:A2 运行时插件的信任边界 = **谁能写 `PLUGINS` KV**。`/plugins/index.json`(清单)与插件字节**同源同 KV** ⇒ 客户端 `integrity`(SRI)只防缓存/部分损坏,**不防 KV 被攻陷**(能改 KV 者可同时改插件与清单)。治理要求:`PLUGINS` KV 写权限**仅限发布脚本(`scripts/plugins-publish.mjs`,默认 dry-run)与本人**,不交给 CI 或第三方;第三方插件经 `scripts/plugins-sync.sh` 合入前**必须人工审计**(脚本运行时打印显式提示)。
|
||||
- 插件配色契约:`docs/standards/plugin-theme.md`(v3.25.89 起)
|
||||
@@ -0,0 +1,53 @@
|
||||
# 插件主题契约(plugin-theme)
|
||||
|
||||
> 版本:v3.25.89 起。宿主与插件的**唯一**配色接口。
|
||||
> 目的:插件不再自己决定颜色,改一处(种子/滑块)全部插件跟着变。
|
||||
|
||||
## 1. 四层语义(插件面板必须分层)
|
||||
|
||||
| 语义 | Token | 亮色默认 | 用在哪 |
|
||||
|---|---|---|---|
|
||||
| 结构层 | `--iwb-dock-bg` | `#E2E4E6` | 停靠栏 / 标签条 / 状态栏(宿主自己的层) |
|
||||
| 插件面板 | `--iwb-plugin-surface` | `#FAFAFB` | 面板根容器(**不要用纯白**) |
|
||||
| 卡片 | `--iwb-plugin-card` | `#FFFFFF` | 面板里的卡片 / 列表项 |
|
||||
| 内嵌 | `--iwb-plugin-inset` | `#F6F7F8` | 输入框底 / 分组底 / 斑马纹 |
|
||||
| 悬停 | `--iwb-plugin-hover` | `#EEF1F4` | 行 / 卡片 hover |
|
||||
|
||||
## 2. 规则
|
||||
|
||||
1. **只用变量**:`--iwb-plugin-*` 或 `--iwb-*`,禁止写死 `#hex` / `rgba()`。
|
||||
(守门测试 `tests/plugin-theme-contract-test.js` 会卡)
|
||||
2. **面板根不画底色**:宿主已给 `--iwb-plugin-surface`;插件根容器只写 `background: var(--iwb-plugin-surface)`。
|
||||
3. **卡片才用 card**:列表项/卡片用 `--iwb-plugin-card`,这样「浅灰底 + 白卡片」的层次才成立。
|
||||
4. **文字层级**:主文字 `--iwb-plugin-text`,次要 `--iwb-plugin-text2`,品牌 `--iwb-plugin-brand`(底色上的字用 `--iwb-plugin-on-brand`,宿主按对比度自动黑/白)。
|
||||
5. **语义色**:错误 `--iwb-plugin-err`、成功 `--iwb-plugin-ok`、警告 `--iwb-plugin-warn`。
|
||||
|
||||
## 3. 作用域重映射(为什么插件不用改代码)
|
||||
|
||||
宿主在插件容器内把旧变量重指到插件层:
|
||||
|
||||
```css
|
||||
.iwb-dock-body, .iwb-node-body .iwb-plugin-body, .iwb-cwv-panel-body {
|
||||
--iwb-panel: var(--iwb-plugin-surface);
|
||||
--iwb-layer2: var(--iwb-plugin-card);
|
||||
--iwb-layer: var(--iwb-plugin-inset);
|
||||
--iwb-hover: var(--iwb-plugin-hover);
|
||||
}
|
||||
```
|
||||
|
||||
所以插件里已有的 `background: var(--iwb-layer2, #fff)` 会自动变成「卡片白」,
|
||||
`var(--iwb-layer, #f5f6f8)` 自动变成「内嵌灰」——**不需要重新打包插件**。
|
||||
|
||||
## 4. 批量调节
|
||||
|
||||
- 外观 → **插件面板 → 底色深浅**(0~30,默认 12)
|
||||
- 该值进入 `theme-tokens.js` 的 `pluginTint`,与 4 个种子一起派生
|
||||
- 改这一个滑块 = 所有插件面板同时变化
|
||||
|
||||
## 5. 新增插件时的自查
|
||||
|
||||
- [ ] 面板根:`background: var(--iwb-plugin-surface)`
|
||||
- [ ] 卡片:`background: var(--iwb-plugin-card)`
|
||||
- [ ] 输入框/内嵌块:`background: var(--iwb-plugin-inset)`
|
||||
- [ ] hover:`background: var(--iwb-plugin-hover)`
|
||||
- [ ] 没有任何 `#` 开头的颜色字面量(`var(--x, #hex)` 的兜底除外)
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.25.85",
|
||||
"version": "3.25.92",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
@@ -215,6 +215,18 @@ const html = `<!DOCTYPE html>
|
||||
<link rel="stylesheet" href="style.css?v=${version}">
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
/* v3.25.90:静态启动层 —— app.js 顶部会 await 资料目录(首次会弹 macOS 授权),
|
||||
那段时间 React 还没挂载,这里先给一个可见的启动画面 + 授权提示,避免纯白屏。 */
|
||||
#iwb-boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
|
||||
background: #f4f5f7; color: #1c2333; font: 13px/1.6 -apple-system, "PingFang SC", sans-serif; z-index: 9999; transition: opacity .2s ease; }
|
||||
#iwb-boot .t { font-size: 16px; font-weight: 700; }
|
||||
#iwb-boot .s { font-size: 12px; color: #6b7280; }
|
||||
#iwb-boot .h { margin-top: 6px; font-size: 12px; color: #b45309; max-width: 460px; text-align: center; padding: 0 24px; }
|
||||
</style>
|
||||
|
||||
<div id="iwb-boot"><div class="t">生图工作台</div><div class="s">正在加载…</div><div class="h">若系统弹出「访问文稿文件夹」请求,请点「允许」;点「不允许」会一直停在这里。</div></div>
|
||||
|
||||
<div id="root"></div>
|
||||
<script src="vendor/react.production.min.js"></script>
|
||||
<script src="vendor/react-dom.production.min.js"></script>
|
||||
|
||||
@@ -54,13 +54,13 @@
|
||||
<h2>下载</h2>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
|
||||
<div class="meta">版本 3.25.85 · 8.4 MB · .dmg<div class="hash">sha256 bb22e3d5e08b4d81…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.85_aarch64.dmg?h=bb22e3d5e08b">下载</a>
|
||||
<div class="meta">版本 3.25.92 · 8.4 MB · .dmg<div class="hash">sha256 aba0f0359fde5576…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.92_aarch64.dmg?h=aba0f0359fde">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
|
||||
<div class="meta">版本 3.25.85 · 8.8 MB · .dmg<div class="hash">sha256 51fc2ca757a7637c…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.85_x64.dmg?h=51fc2ca757a7">下载</a>
|
||||
<div class="meta">版本 3.25.92 · 8.8 MB · .dmg<div class="hash">sha256 4bfa07d8ffee2b91…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.92_x64.dmg?h=4bfa07d8ffee">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
|
||||
@@ -94,6 +94,34 @@
|
||||
</ol>
|
||||
|
||||
<h2>历史版本</h2>
|
||||
<div class="row">
|
||||
<div class="name">3.25.92<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.91<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.90<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.89<div class="hint">Intel 版:同一批改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.88<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.87<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.86<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.85<div class="hint">Intel 版:同一批改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
|
||||
+7
-7
@@ -2,7 +2,7 @@
|
||||
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Image Workbench · 本地优先的 AI 生图工作台</title>
|
||||
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.25.85-mwppcpd6">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.25.92-mwq4ltpl">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
|
||||
@@ -14,19 +14,19 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.25.85</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.25.92</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
<section class="hero hero-art">
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.85-mwppcpd6" alt=""></div>
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.92-mwq4ltpl" alt=""></div>
|
||||
<div class="hero-veil"></div>
|
||||
<div class="wrap">
|
||||
<span class="kicker">v3.25.85 · macOS / Windows · 数据在本地</span>
|
||||
<span class="kicker">v3.25.92 · macOS / Windows · 数据在本地</span>
|
||||
<h1>本地优先的<br>AI 生图无限画布</h1>
|
||||
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
|
||||
<div class="cta">
|
||||
<a class="btn primary lg" href="/download/">下载 v3.25.85</a>
|
||||
<a class="btn primary lg" href="/download/">下载 v3.25.92</a>
|
||||
<a class="btn lg" href="/plugins/">浏览 11 个插件</a>
|
||||
</div>
|
||||
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
|
||||
@@ -93,8 +93,8 @@
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>下载 Image Workbench</h2>
|
||||
<p class="lead">选你的平台。装过一次之后,以后在应用内「设置 → 通用 → 版本与更新」就能一键升级。</p>
|
||||
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.25.85_aarch64.dmg?h=bb22e3d5e08b"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
|
||||
<a href="/updates/darwin-x86_64/image-workbench_3.25.85_x64.dmg?h=51fc2ca757a7"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
|
||||
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.25.92_aarch64.dmg?h=aba0f0359fde"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
|
||||
<a href="/updates/darwin-x86_64/image-workbench_3.25.92_x64.dmg?h=4bfa07d8ffee"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
|
||||
<div class="none"><div class="n">Windows · x64</div><div class="s">暂未提供</div></div></div>
|
||||
<div style="margin-top:20px;color:#9ca3af;font-size:12.5px">安装包未做 Apple 公证 / Windows 代码签名,首次打开需手动放行一次,细节见 <a href="/download/" style="text-decoration:underline">下载页</a>。</div>
|
||||
</div></section>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>插件市场 · Image Workbench</title>
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.25.85-mwppcpd6">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.25.92-mwq4ltpl">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.25.85</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.25.92</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
|
||||
+148
-1
@@ -1,8 +1,155 @@
|
||||
{
|
||||
"app": "Image Workbench",
|
||||
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
|
||||
"updatedAt": "2026-11-21T01:01:22.320Z",
|
||||
"updatedAt": "2026-11-21T08:08:22.094Z",
|
||||
"releases": [
|
||||
{
|
||||
"version": "3.25.92",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.92_aarch64.dmg",
|
||||
"size": 8778487,
|
||||
"sha256": "aba0f0359fde5576c9351cdb49cb2f2908c161bf03c63b42c67fb1da859dab93",
|
||||
"h": "aba0f0359fde",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.92_x64.dmg",
|
||||
"size": 9183821,
|
||||
"sha256": "4bfa07d8ffee2b917630f0686b6dca84d38e984377a63cece8991235d61894c9",
|
||||
"h": "4bfa07d8ffee",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.91",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.91_aarch64.dmg",
|
||||
"size": 8779262,
|
||||
"sha256": "96dab793d1f268298b1da7fd713f583c9b4ecdda482f6569752f5d3559f342e4",
|
||||
"h": "96dab793d1f2",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.91_x64.dmg",
|
||||
"size": 9181489,
|
||||
"sha256": "12df17cb047b25d4a70db655886245c2f5b76b3d8827d2070ed2611e3187d1ca",
|
||||
"h": "12df17cb047b",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.90",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.90_aarch64.dmg",
|
||||
"size": 8781259,
|
||||
"sha256": "8b247ecad46709d922ec2fa303bebc4c714c2e889483d0e98338bde3eff69c7a",
|
||||
"h": "8b247ecad467",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.90_x64.dmg",
|
||||
"size": 9180995,
|
||||
"sha256": "4bcc5f1fccdc46893c4dedf751a90043906530ae962e77389a50d38288c56a87",
|
||||
"h": "4bcc5f1fccdc",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.89",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.89_aarch64.dmg",
|
||||
"size": 8781313,
|
||||
"sha256": "3662431943dcec8cfd3f28ab6f58c78abe1e0980f8bcf4b36cb19b2b0cf6bf47",
|
||||
"h": "3662431943dc",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.89_x64.dmg",
|
||||
"size": 9893340,
|
||||
"sha256": "17f1825fb43776cd7513a6cdb03baf358dd76a2d17e93048583c0217f3f6bcd0",
|
||||
"h": "17f1825fb437",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.88",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.88_aarch64.dmg",
|
||||
"size": 8778772,
|
||||
"sha256": "3149a9382f9a77574b0eea2f6739bc545256a1b10f9086d2ed57a9a4aee8a9c2",
|
||||
"h": "3149a9382f9a",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.88_x64.dmg",
|
||||
"size": 9178982,
|
||||
"sha256": "74bf411d718b4cde870437d5be88e618b0f431c0f665caf681736697baf320d5",
|
||||
"h": "74bf411d718b",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.87",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.87_aarch64.dmg",
|
||||
"size": 8779143,
|
||||
"sha256": "39ccffa011021d0a17ebc91a70906b09bbf12494fd011bafbf43d0860cd32418",
|
||||
"h": "39ccffa01102",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.87_x64.dmg",
|
||||
"size": 9178067,
|
||||
"sha256": "aeac43c291221167e38662fb62e21aee83ba04a00dafca57297d70a7d8c89e94",
|
||||
"h": "aeac43c29122",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.86",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.86_aarch64.dmg",
|
||||
"size": 8779162,
|
||||
"sha256": "7676260f74c6215d39fd9fff693c011dc9a7c1d5639f51ead99dc32caf0d4be4",
|
||||
"h": "7676260f74c6",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.86_x64.dmg",
|
||||
"size": 9181203,
|
||||
"sha256": "dd71e38b3893962167faa06641ff12621141c3241a717bd9f4b2415df3976e7d",
|
||||
"h": "dd71e38b3893",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.85",
|
||||
"date": "2026-11-21",
|
||||
|
||||
Generated
+1
-1
@@ -1983,7 +1983,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.25.85"
|
||||
version = "3.25.92"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.25.85"
|
||||
version = "3.25.92"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.25.85",
|
||||
"version": "3.25.92",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -102,6 +102,8 @@
|
||||
}
|
||||
|
||||
var anchors = new Map()
|
||||
var suspended = false // v3.25.88:切页/拖宽时暂停同步,避免原生层盖着旧页 1 秒
|
||||
var suspendTimer = null
|
||||
var pendingClose = new Map()
|
||||
var rafId = 0
|
||||
var lastTick = 0
|
||||
@@ -519,6 +521,7 @@
|
||||
function tick(ts) {
|
||||
rafId = global.requestAnimationFrame(tick)
|
||||
if (!anchors.size) return
|
||||
if (suspended) return
|
||||
if (ts - lastTick < TICK_MS) return
|
||||
lastTick = ts
|
||||
// 偏移还没算出来就不建视图:宁可晚两帧,也不要先闪一下错位
|
||||
@@ -711,6 +714,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 立刻把当前可见的原生 webview 全部 park 出窗口(不做 close:close 要销毁 WKWebView,更慢)
|
||||
function parkAll () {
|
||||
anchors.forEach(function (st) {
|
||||
if (!st.open || st.shown === false) return
|
||||
var x = isFinite(st.px) ? st.px : 0
|
||||
var y = isFinite(st.py) ? st.py : 0
|
||||
var w = isFinite(st.pw) ? st.pw : MIN_EDGE
|
||||
var h = isFinite(st.ph) ? st.ph : MIN_EDGE
|
||||
push(st, x, y, w, h, false, null)
|
||||
})
|
||||
}
|
||||
|
||||
// 暂停/恢复:暂停期间 park 一次并跳过后续 push;恢复后下一帧自动按锚点矩形重新显示
|
||||
function setSuspended (on) {
|
||||
suspended = !!on
|
||||
if (suspended) parkAll()
|
||||
if (suspendTimer) { try { clearTimeout(suspendTimer) } catch (e) { /* ignore */ } suspendTimer = null }
|
||||
// v3.25.91 自愈:拖宽时如果在窗口外松手(收不到 pointerup),会一直 park ⇒ 面板空白。
|
||||
// 这里给一个兜底:暂停最多 1.2 秒,超时自动恢复(拖宽不可能连续超过这么久而没有新的 move)。
|
||||
if (suspended) {
|
||||
suspendTimer = setTimeout(function () { suspended = false; suspendTimer = null }, 1200)
|
||||
}
|
||||
}
|
||||
|
||||
function install() {
|
||||
if (started) return
|
||||
started = true
|
||||
@@ -733,6 +760,20 @@
|
||||
mo.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: [ATTR] })
|
||||
}
|
||||
global.addEventListener('resize', function () { refreshOffsets() })
|
||||
global.addEventListener('pointerup', function () { if (suspended) setSuspended(false) }, true)
|
||||
global.addEventListener('blur', function () { if (suspended) setSuspended(false) })
|
||||
// v3.25.88:拖停靠栏宽度时暂停原生视图同步(否则每帧 IPC + 原生 resize → 卡顿)
|
||||
global.addEventListener('iwb:dock-resizing', function (e) {
|
||||
setSuspended(!!(e && (/** @type {any} */ (e)).detail && (/** @type {any} */ (e)).detail.active))
|
||||
})
|
||||
// 离开画布(插件整页/首页)时立刻 park:原生层盖在 DOM 之上,不 park 会看到旧页面停留 1 秒
|
||||
if (global.MutationObserver) {
|
||||
var viewMo = new MutationObserver(function () {
|
||||
var ov = document.querySelector('.iwb-overlay')
|
||||
if (ov && !ov.classList.contains('iwb-view-canvas')) parkAll()
|
||||
})
|
||||
viewMo.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] })
|
||||
}
|
||||
rafId = global.requestAnimationFrame(tick)
|
||||
global.addEventListener('beforeunload', function () {
|
||||
if (rafId) global.cancelAnimationFrame(rafId)
|
||||
@@ -751,6 +792,8 @@
|
||||
return { anchors: anchors.size, open: open, shown: shown, offset: { x: off.x, y: off.y }, scale: canvasScale() }
|
||||
},
|
||||
closeAll: function () { return call('canvas_webview_close_all', {}) },
|
||||
parkAll: parkAll,
|
||||
setSuspended: setSuspended,
|
||||
}
|
||||
|
||||
// 自启动:invoke 从 __TAURI__ 取,画布与锚点都从 DOM 查,不需要宿主注入依赖
|
||||
|
||||
+4
-1
@@ -300,6 +300,9 @@
|
||||
return { ok: true, id }
|
||||
}
|
||||
|
||||
// v3.25.86:显式保存(设置页「保存设置」按钮用)——setSetting 已即时写盘,这里再兜一次
|
||||
function persist () { try { writeState(); return true } catch (e) { return false } }
|
||||
|
||||
function on(handler) {
|
||||
if (typeof handler !== 'function') return function () {}
|
||||
return subscribe(handler)
|
||||
@@ -320,7 +323,7 @@
|
||||
return { apiVersion: API_VERSION, registered: plugins.size, active, errors, listeners: listeners.length, initialized: Boolean(deps) }
|
||||
}
|
||||
|
||||
return { apiVersion: API_VERSION, capabilities: CAPABILITIES.slice(), register, list, init, setEnabled, isEnabled, activate, deactivate, disposeAll, setSetting, on, emit, snapshot }
|
||||
return { apiVersion: API_VERSION, capabilities: CAPABILITIES.slice(), register, list, init, setEnabled, isEnabled, activate, deactivate, disposeAll, setSetting, persist, on, emit, snapshot }
|
||||
}
|
||||
|
||||
global.IWBPluginHostFactory = createPluginHost
|
||||
|
||||
+24
-2
@@ -58,10 +58,12 @@
|
||||
return out
|
||||
}
|
||||
|
||||
const DEFAULTS = { seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22 }
|
||||
const DEFAULTS = { seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22, pluginTint: 12, pluginTintOn: false }
|
||||
|
||||
function derive (cfg, dark) {
|
||||
const c = cfg || {}
|
||||
const tintRaw = Number(c.pluginTint)
|
||||
const pluginTint = Math.max(0, Math.min(30, Number.isFinite(tintRaw) ? tintRaw : DEFAULTS.pluginTint))
|
||||
const N = normHex(c.seedNeutral) || DEFAULTS.seedNeutral
|
||||
const A = normHex(c.seedAccent) || DEFAULTS.seedAccent
|
||||
const depth = Math.max(0, Math.min(60, Number(c.depth) === undefined ? DEFAULTS.depth : Number(c.depth)))
|
||||
@@ -87,6 +89,14 @@
|
||||
const edgeHot = d ? mix(A, '#ffffff', 0.25) : A
|
||||
const gridDot = mix(N, t, d ? 0.36 : 0.30)
|
||||
|
||||
// 插件面板四层(v3.25.89):面板浅灰 / 卡片白 / 内嵌更灰 / 悬停最灰
|
||||
const dockBg = mix(surface3, canvas, 0.45)
|
||||
const pTint = pluginTint / 100
|
||||
const pluginSurface = mix(surface1, dockBg, pTint)
|
||||
const pluginCard = d ? mix(surface1, '#ffffff', 0.07) : '#ffffff'
|
||||
const pluginInset = mix(surface1, dockBg, Math.min(0.7, pTint + 0.10))
|
||||
const pluginHover = mix(pluginSurface, border2, d ? 0.28 : 0.16)
|
||||
|
||||
// 语义色:色相固定,明度随主题调整(暗色提亮一档,避免发闷)
|
||||
const err = d ? mix('#ef4444', '#ffffff', 0.18) : '#ef4444'
|
||||
const ok = d ? mix('#22c55e', '#ffffff', 0.18) : '#22c55e'
|
||||
@@ -96,6 +106,7 @@
|
||||
|
||||
return {
|
||||
err, ok, warn, onBrand,
|
||||
pluginSurface, pluginCard, pluginInset, pluginHover, pluginTintOn: c.pluginTintOn === true,
|
||||
bg: surface0,
|
||||
panel: surface1,
|
||||
layer,
|
||||
@@ -104,7 +115,7 @@
|
||||
canvasBg: canvas,
|
||||
chrome: mix(surface0, canvas, 0.4),
|
||||
homeBg: mix(surface0, canvas, 0.35),
|
||||
dockBg: mix(surface3, canvas, 0.45),
|
||||
dockBg,
|
||||
dockHeadBg: mix(mix(surface3, canvas, 0.45), '#000000', 0.06),
|
||||
border,
|
||||
border2,
|
||||
@@ -120,6 +131,13 @@
|
||||
|
||||
function applyTo (root, tokens) {
|
||||
if (!root || !root.style) return
|
||||
// 插件独立底色开关:挂在 <html> 上,CSS 用 html[data-plugin-tint="1"] 作用域
|
||||
try {
|
||||
if (typeof document !== 'undefined' && document.documentElement) {
|
||||
if (tokens && tokens.pluginTintOn) document.documentElement.setAttribute('data-plugin-tint', '1')
|
||||
else document.documentElement.removeAttribute('data-plugin-tint')
|
||||
}
|
||||
} catch (e) { /* ignore */ }
|
||||
const s = (k, v) => { if (v) root.style.setProperty(k, v) }
|
||||
s('--iwb-bg', tokens.bg)
|
||||
s('--iwb-canvas-bg', tokens.canvasBg)
|
||||
@@ -143,6 +161,10 @@
|
||||
s('--iwb-ok', tokens.ok)
|
||||
s('--iwb-warn', tokens.warn)
|
||||
s('--iwb-on-brand', tokens.onBrand)
|
||||
s('--iwb-plugin-surface', tokens.pluginSurface)
|
||||
s('--iwb-plugin-card', tokens.pluginCard)
|
||||
s('--iwb-plugin-inset', tokens.pluginInset)
|
||||
s('--iwb-plugin-hover', tokens.pluginHover)
|
||||
}
|
||||
|
||||
global.IWBThemeTokens = { DEFAULTS, derive, applyTo, mix, contrast, clampText }
|
||||
|
||||
+10
-2
@@ -16,7 +16,7 @@
|
||||
canvasBgLight: '#d9dbde', canvasBgDark: '#6f6f6f',
|
||||
gridDotLight: '#c9ccd6', gridDotDark: '#8f8f8f', gridSize: 1.4, gridGap: 22, gridOn: true, gridStyle: 'dots',
|
||||
// v3.25.81:自动配色(默认开)——只定 4 个种子,其余由 src/theme-tokens.js 派生
|
||||
auto: true, seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22,
|
||||
auto: true, seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22, pluginTint: 12, pluginTintOn: false,
|
||||
edgeColorLight: '#b9bfca', edgeColorDark: '#7a7a7a',
|
||||
edgeWidth: 1.8, edgeDash: 'dashed',
|
||||
edgeHotLight: '#6b7280', edgeHotDark: '#ffffff',
|
||||
@@ -64,6 +64,8 @@
|
||||
seedNeutral: normHex(c.seedNeutral) || DEFAULTS.seedNeutral,
|
||||
seedAccent: normHex(c.seedAccent) || DEFAULTS.seedAccent,
|
||||
depth: clamp(c.depth, 0, 60, DEFAULTS.depth),
|
||||
pluginTint: clamp(c.pluginTint, 0, 30, DEFAULTS.pluginTint),
|
||||
pluginTintOn: c.pluginTintOn === true,
|
||||
nodeBgLight: hex('nodeBgLight'), nodeBgDark: hex('nodeBgDark'),
|
||||
nodeBorderLight: hex('nodeBorderLight'), nodeBorderDark: hex('nodeBorderDark'),
|
||||
nodeRadius: clamp(c.nodeRadius, 6, 20, DEFAULTS.nodeRadius),
|
||||
@@ -398,8 +400,14 @@
|
||||
Row('强调色', el(ColorPicker, { value: value.seedAccent, onChange: (v) => set({ seedAccent: v, auto: true }) }), '按钮 / 端口 / 选中框'),
|
||||
], ['auto', 'seedNeutral', 'seedAccent', 'depth'])
|
||||
|
||||
const pluginGroup = Group('插件面板', [
|
||||
Row('独立底色', el('label', { className: 'iwb-check' },
|
||||
el('input', { type: 'checkbox', checked: value.pluginTintOn, onChange: (e) => set({ pluginTintOn: e.target.checked }) }),
|
||||
'插件面板用浅灰底(关闭=沿用旧外观)'), '默认关闭:关闭后插件完全按原有配色'),
|
||||
Row('底色深浅', el('input', { type: 'range', min: 0, max: 30, step: 1, value: value.pluginTint, className: 'iwb-appear-range', onChange: (e) => set({ pluginTint: Number(e.target.value) }) }), String(value.pluginTint)),
|
||||
], ['pluginTint', 'pluginTintOn'])
|
||||
return el('div', { className: 'iwb-appear' },
|
||||
autoGroup, themeGroup, value.auto ? el('div', { className: 'iwb-appear-note-only' }, '自动配色已开启;关闭后可逐项微调(画布 / 连线 / 节点)。') : canvasGroup, value.auto ? null : edgeGroup, value.auto ? null : nodeGroup,
|
||||
autoGroup, themeGroup, pluginGroup, value.auto ? el('div', { className: 'iwb-appear-note-only' }, '自动配色已开启;关闭后可逐项微调(画布 / 连线 / 节点)。') : canvasGroup, value.auto ? null : edgeGroup, value.auto ? null : nodeGroup,
|
||||
el('div', { className: 'iwb-row', style: { marginTop: 12 } },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => set(Object.assign({}, DEFAULTS, { presets: value.presets })) }, '全部恢复默认')))
|
||||
}
|
||||
|
||||
+28
-2
@@ -33,11 +33,13 @@
|
||||
function normalizeSide (side, def) {
|
||||
const s = side && typeof side === 'object' ? side : {}
|
||||
const list = Array.isArray(s.list) && s.list.length ? s.list.map(String) : def.list.slice()
|
||||
const removedIds = Array.isArray(s.removed) ? s.removed.map(String) : []
|
||||
const active = list.indexOf(String(s.active || '')) >= 0 ? String(s.active) : (list.indexOf(def.active) >= 0 ? def.active : list[0])
|
||||
return {
|
||||
open: s.open === undefined ? def.open !== false : !!s.open,
|
||||
w: Math.max(MIN_W, Number(s.w) || def.w || 300),
|
||||
list,
|
||||
removed: removedIds,
|
||||
active,
|
||||
}
|
||||
}
|
||||
@@ -146,7 +148,17 @@
|
||||
const next = Object.assign({}, d)
|
||||
for (const side of ['left', 'right']) {
|
||||
const s0 = d[side]
|
||||
const list = (s0.list || []).filter(function (id) { return !!panels[id] })
|
||||
// v3.25.87:插件关闭时会从 list 里剔除;重新启用后要把默认面板补回来。
|
||||
// 只有「用户手动拖出栏」的(记在 removed 里)不补,尊重手动排序/移除。
|
||||
const removed = Array.isArray(s0.removed) ? s0.removed : []
|
||||
const defList = (props.defaults && props.defaults[side] && props.defaults[side].list) || []
|
||||
let list = (s0.list || []).filter(function (id) { return !!panels[id] })
|
||||
for (const id of defList) {
|
||||
if (!panels[id]) continue
|
||||
if (removed.indexOf(id) >= 0) continue
|
||||
if (list.indexOf(id) >= 0) continue
|
||||
list = list.concat([id])
|
||||
}
|
||||
const active = panels[s0.active] ? s0.active : (list[0] || '')
|
||||
if (list.length !== (s0.list || []).length || active !== s0.active) {
|
||||
next[side] = Object.assign({}, s0, { list: list, active: active })
|
||||
@@ -214,14 +226,28 @@
|
||||
e.stopPropagation()
|
||||
const startX = e.clientX
|
||||
const startW = dock[side].w
|
||||
// v3.25.88: 拖动过程只改 DOM 宽度(不走 React setState),松手才提交
|
||||
const dockEl = (rootRef.current && rootRef.current.querySelector) ? rootRef.current.querySelector('.iwb-dock[data-side="' + side + '"]') : null
|
||||
let pendingW = startW
|
||||
let raf = 0
|
||||
const flush = function () {
|
||||
raf = 0
|
||||
if (dockEl) { try { dockEl.style.width = pendingW + 'px' } catch (err) { /* ignore */ } }
|
||||
}
|
||||
const move = function (ev) {
|
||||
const dx = ev.clientX - startX
|
||||
const w = side === 'left' ? startW + dx : startW - dx
|
||||
setSide(side, { w: Math.max(MIN_W, Math.round(w)) })
|
||||
pendingW = Math.max(MIN_W, Math.round(w))
|
||||
if (!raf) raf = global.requestAnimationFrame(flush)
|
||||
}
|
||||
// v3.25.88:拖宽期间通知宿主暂停原生 webview 同步(消除卡顿)
|
||||
try { global.dispatchEvent(new CustomEvent('iwb:dock-resizing', { detail: { active: true, side: side } })) } catch (err) { /* ignore */ }
|
||||
const up = function () {
|
||||
global.removeEventListener('pointermove', move)
|
||||
global.removeEventListener('pointerup', up)
|
||||
try { global.dispatchEvent(new CustomEvent('iwb:dock-resizing', { detail: { active: false, side: side } })) } catch (err) { /* ignore */ }
|
||||
if (raf) { try { global.cancelAnimationFrame(raf) } catch (err) { /* ignore */ } raf = 0 }
|
||||
setSide(side, { w: pendingW })
|
||||
}
|
||||
global.addEventListener('pointermove', move)
|
||||
global.addEventListener('pointerup', up)
|
||||
|
||||
@@ -758,6 +758,10 @@
|
||||
),
|
||||
el('div', { className: 'iwb-hint' }, activePlugin.id + ' · v' + activePlugin.version),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () {
|
||||
try { if (PluginHost && typeof PluginHost.persist === 'function') PluginHost.persist() } catch (e) { /* ignore */ }
|
||||
if (setMsg) setMsg('已保存插件设置')
|
||||
} }, '保存设置'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () { setTab('plugins') } }, '返回'),
|
||||
),
|
||||
activePlugin.error ? el('div', { className: 'iwb-status-err' }, activePlugin.error) : null,
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
--iwb-plugin-border: var(--iwb-border);
|
||||
--iwb-plugin-text: var(--iwb-text);
|
||||
--iwb-plugin-text2: var(--iwb-text2);
|
||||
/* 插件面板四层(v3.25.89):面板浅灰 / 卡片白 / 内嵌 / 悬停。自动配色会覆盖 */
|
||||
--iwb-plugin-surface: #fafafb;
|
||||
--iwb-plugin-card: #ffffff;
|
||||
--iwb-plugin-inset: #f6f7f8;
|
||||
--iwb-plugin-hover: #eef1f4;
|
||||
--iwb-plugin-brand: var(--iwb-brand);
|
||||
--iwb-plugin-on-brand: var(--iwb-on-brand);
|
||||
--iwb-plugin-err: var(--iwb-err);
|
||||
@@ -2354,3 +2359,26 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
|
||||
/* 自动配色开启时的提示行(v3.25.81) */
|
||||
.iwb-appear-note-only { font-size: 12px; color: var(--iwb-text2); padding: 4px 0 0 2px; }
|
||||
|
||||
/* v3.25.87:插件整页/首页不显示停靠栏(含 iframe 残影,直接 display:none 而不是等淡出) */
|
||||
.iwb-overlay.iwb-view-plugins .iwb-dockarea,
|
||||
.iwb-overlay.iwb-view-home .iwb-dockarea,
|
||||
.iwb-overlay.iwb-view-landing .iwb-dockarea { display: none !important; }
|
||||
|
||||
/* 插件面板作用域重映射(v3.25.89):
|
||||
停靠栏/画布里的插件面板根容器原来直接用 --iwb-panel/--iwb-layer2(亮色下都是纯白),
|
||||
盖在灰色停靠栏上就是"一块白纸"。这里在插件容器内部把旧变量重指到四层插件色:
|
||||
面板根(--iwb-panel)→ surface 浅灰
|
||||
卡片/输入(--iwb-layer2)→ card 纯白
|
||||
内嵌/行(--iwb-layer)→ inset 更灰
|
||||
插件源码写的是 var(--iwb-layer2,#fff),不用改插件即可跟随。 */
|
||||
/* v3.25.92:插件面板「独立底色」改为**可选**(默认关)——
|
||||
之前默认开着,插件卡片/网格底色被换掉,用户反馈"样式不对了"。
|
||||
现在只有外观里打开开关(html[data-plugin-tint="1"])才生效,默认完全回到旧外观。 */
|
||||
html[data-plugin-tint="1"] .iwb-dock-body,
|
||||
html[data-plugin-tint="1"] .iwb-node-body .iwb-plugin-body,
|
||||
html[data-plugin-tint="1"] .iwb-cwv-panel-body {
|
||||
--iwb-panel: var(--iwb-plugin-surface);
|
||||
}
|
||||
/* 兜底:插件面板根若写死了白底,这里压平(只对直接子元素,避免影响卡片) */
|
||||
|
||||
Reference in new issue
Block a user