Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6865fb703 | ||
|
|
c3bf8357b0 | ||
|
|
b801198d36 | ||
|
|
b3bf16f52e | ||
|
|
6b3ba48d08 | ||
|
|
0e69ead075 | ||
|
|
dd38d7b663 | ||
|
|
72f0bb2aec | ||
|
|
dd498a1cf7 | ||
|
|
49a91991be | ||
|
|
e827f47d04 | ||
|
|
9847373964 | ||
|
|
178cda830a | ||
|
|
38ec7465bf | ||
|
|
1ddf89d2c3 | ||
|
|
4491b71abf | ||
|
|
b1d8f4e080 | ||
|
|
540eed04cc | ||
|
|
96e8cc2d7d | ||
|
|
2082ced720 | ||
|
|
2c94401d45 | ||
|
|
93deea4f5e | ||
|
|
f35ecb1790 | ||
|
|
6435d9e4c3 | ||
|
|
0d42ebb9ae | ||
|
|
a26fb2d64d | ||
|
|
1d0b6d2168 | ||
|
|
202f7b81de | ||
|
|
d16f3434dd | ||
|
|
9c0d3b1221 | ||
|
|
5f8f4d229f | ||
|
|
a3edc81f55 | ||
|
|
774b980f69 | ||
|
|
a993d44f4e | ||
|
|
a8a416fa7a | ||
|
|
9db4c15e7a | ||
|
|
2fb0a6941f | ||
|
|
0b20c5597c | ||
|
|
9f69f73443 | ||
|
|
f8635d4e19 | ||
|
|
8aac499e11 | ||
|
|
6ee5a37d68 | ||
|
|
1342613ab9 | ||
|
|
754c0a39da | ||
|
|
97ed57714a | ||
|
|
036b2926ed | ||
|
|
0439e8b743 | ||
|
|
ad4c177e55 | ||
|
|
22f4d7adb0 | ||
|
|
ad1bb6016e | ||
|
|
8dc01708dc | ||
|
|
f4e4ca5649 | ||
|
|
35ac37fb45 | ||
|
|
2a1fa03132 | ||
|
|
78519b56d8 | ||
|
|
19c95ef6b1 | ||
|
|
bbb763c2cf | ||
|
|
611cd8f1b9 | ||
|
|
73a7126e30 | ||
|
|
34269f9770 | ||
|
|
7a4204d0a9 | ||
|
|
2860faacbb | ||
|
|
f02b3dcec2 | ||
|
|
f6d104fd95 | ||
|
|
94680fd127 | ||
|
|
b37a1ffe78 |
No files matched your search
@@ -22,3 +22,7 @@ release/
|
||||
|
||||
# 插件市场产物(由 scripts/gen-market.js 生成,发布时 scp 上传)
|
||||
market/
|
||||
|
||||
# 临时截图/调试产物(不入库)
|
||||
_*.png
|
||||
_tray-preview/
|
||||
@@ -14,6 +14,438 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## v3.26.28(2026-11-22)CSS 去重(T1):删除死声明 + 修一处游离括号
|
||||
|
||||
### 清理
|
||||
- 按「选择器 + 媒体上下文」解析 style.css:删除 **242 条已被后续同选择器覆盖的死声明**(逐条校验:后者非 !important 才删;同一规则多选择器时要求每个选择器都被覆盖才删)。
|
||||
- 修复一处**游离 `}`** 与它的孤立声明块(`.iwb-picklist` 已无任何 JS 引用,属历史残留)。
|
||||
- 等价性校验:清理前后「生效声明集合」完全一致(5630 条,0 处值差异)。
|
||||
|
||||
### 结果
|
||||
- style.css 2504 → 2431 行(-73);删除死声明 **242 条**、空规则 **58 条**、游离声明块 1 处。
|
||||
- 等价性校验:清理前后生效声明集合完全一致(0 处值差异);仅把 `interface-hierarchy` 测试里“钉住已死文本”的断言改为钉住最终生效的 0 偏移。
|
||||
|
||||
## v3.26.27(2026-11-22)插件市场交互回退为「只变色」
|
||||
|
||||
### 交互
|
||||
- 卡片、标签、管理页行**取消上浮/阴影**,只保留背景与描边颜色变化。
|
||||
- 卡片上的「移除/安装」按钮加**浅灰底**,不再只有文字;悬停略深、按下更深(安装仍是深色主按钮)。
|
||||
- 管理页改回**横线分隔**行,悬停只轻微变色。
|
||||
|
||||
## v3.26.26(2026-11-22)插件市场补回悬停浮动触感
|
||||
|
||||
### 交互
|
||||
- 卡片悬停上浮 3px(按下回落 1px),带阴影过渡。
|
||||
- 操作按钮悬停上浮 1px + 投影;主按钮(安装)阴影更深;按下回到原位。
|
||||
- 标签胶囊、管理页行也补了相同的轻浮动反馈。
|
||||
|
||||
## v3.26.25(2026-11-22)插件市场二次优化:全宽自适应 + 淡描边 + 已安装徽标
|
||||
|
||||
### 版式
|
||||
- 去掉页面 1180px 限宽,卡片网格随窗口自适应(多出空间就多排卡片)。
|
||||
- 卡片恢复**很淡的描边**(55% 边框色)+ 轻投影,悬停加深;不再是纯色块。
|
||||
- 已安装不再用绿色底,改为名字后的 **「已安装」小徽标**(淡绿描边胶囊);绿点方案取消。
|
||||
- 管理页列表改为块面行(圆角浅底、间距 8px),操作列仍右对齐。
|
||||
|
||||
## v3.26.24(2026-11-22)插件市场版式重设计
|
||||
|
||||
### 版式
|
||||
- 顶部合并为一块「工具条」(搜索 + 标签)浅底块面,去掉逐行线框。
|
||||
- 卡片:无描边,改浅色块面;悬停提亮;已安装卡片带极淡的成功色底。
|
||||
- 页脚一行:左侧标签、右侧操作按钮;安装=深色主按钮,移除=无边框浅底按钮。
|
||||
|
||||
### 交互收敛
|
||||
- 去掉「重装」按钮(无实际意义),已安装只保留「移除」。
|
||||
- 「已安装」文字标签改为 **绿色圆点**(带 title 提示)。
|
||||
|
||||
## v3.26.23(2026-11-22)停靠栏“当前面板”重启后被切走
|
||||
|
||||
### 修复
|
||||
- 保存的 `active` 只要还在列表里就保持;插件尚未加载完时不再回退到别的面板(之前重启会把当前面板从提示词库切到浏览器)。
|
||||
|
||||
## v3.26.22(2026-11-22)停靠栏摆放会被重置的根因修复
|
||||
|
||||
### 修复
|
||||
- **根因**:应用启动瞬间插件面板还没注册,停靠栏整理逻辑把「当前不存在的 id」从列表里删掉,然后 180ms 后的节流写盘把**空/默认列表覆盖了用户的摆放** → 每次更新/重启后要重新拖。
|
||||
- 整理逻辑不再丢弃未知 id(渲染层本来就过滤,不会出现幽灵图标);`active` 仅在原值不可用时回退到“当前可用”的面板。
|
||||
- 写盘加守卫:插件面板集合为空时**不写**。
|
||||
|
||||
### 测试
|
||||
- `ui-dock-sanitize-test` 增加/更新断言:未注册 id 必须保留、active 回退到可用面板。
|
||||
|
||||
## v3.26.21(2026-11-22)封面体积修复 + 停靠栏/小地图补测 + 主题契约扩围
|
||||
|
||||
### 修复
|
||||
- **封面 300KB 的根因**:WebP 编码不可用时 `compressDataUrl` 回退成 **448px PNG**,照片仍 300KB+(3 张共 1.1MB)→ `putCover` 增加 JPEG 兜底(webp → jpeg → 原图,取更小者)。
|
||||
- promptlib 1.4.9:瘦身迁移范围扩到「PNG 封面」(不只看 >60KB),老封面会自动重压并保存一次。
|
||||
|
||||
### 测试
|
||||
- 新增 `tests/ui-dock-sanitize-test.js`:同侧去重 / 跨侧只保留左侧 / 未注册剔除 / 默认回填规则 / 幂等。
|
||||
- 新增 `tests/ui-minimap-fit-test.js`:不重叠显示 / 临界隐藏 / 回位恢复。
|
||||
- 停靠栏整理逻辑抽到 `src/ui-dock-sanitize.js`(纯函数,可单测)。
|
||||
|
||||
### 守门
|
||||
- 插件主题契约测试**扩围**:以前只扫 `.js` 且只统计“含颜色声明”的文件(实际 2 个),现在扫 `.js + .css` 全量(实际 8 个);补回“白字压在图上”例外。
|
||||
|
||||
## v3.26.20(2026-11-21)插件灰跟随主题(修暗色下节点组发白)
|
||||
|
||||
### 修复
|
||||
- `--iwb-plugin-surface/card/inset/hover` 改为由 `theme-tokens` **按当前主题派生**(亮色=中性灰、暗色=深灰),不再固定浅色。
|
||||
- 亮色下去掉蓝调:以灰阶混合生成(`mix(panel,#000,3.5%~11%)`)。
|
||||
- 效果:暗色模式下节点组卡片条、插件内嵌块不再是白块。
|
||||
|
||||
## v3.26.19(2026-11-21)停靠栏顶栏底色更浅
|
||||
|
||||
### 样式
|
||||
- 左右插件顶栏(图标条)底色由「停靠栏压暗 6%」改为「向面板白靠 55%」:比原来浅一档,与面板层次更连贯。
|
||||
- 自动配色(theme-tokens)同步该规则。
|
||||
|
||||
## v3.26.18(2026-11-21)小地图回到工具栏一排,挤压时自动隐藏
|
||||
|
||||
### 布局
|
||||
- 小地图恢复 `bottom: 14`(与悬浮工具栏同一排),尺寸保持 132×88。
|
||||
- 新增 `src/ui-minimap-fit.js`:右栏拉宽把工具栏往左挤,二者横向将要重叠(间距 < 8px)时,小地图**淡出隐藏**;腾出空间后自动恢复。
|
||||
- 监听窗口 resize、工具栏/小地图尺寸变化、停靠栏拖宽事件,拖动过程中实时判断。
|
||||
|
||||
## v3.26.17(2026-11-21)小地图缩小并上移,避免与底部工具栏重叠
|
||||
|
||||
### 布局
|
||||
- 小地图 168×112 → **132×88**(内部点阵同步缩放)。
|
||||
- 位置从 `bottom: 14` → **`bottom: 76`**:整体移到悬浮工具栏上方,窄窗口下不再压住工具按钮。
|
||||
|
||||
## v3.26.16(2026-11-21)停靠栏选中态加深 + 图库首屏空白/边距
|
||||
|
||||
### 样式
|
||||
- 面板图标:选中底 7%→**11%**,悬停底从实心白降到 **4%**(不再发白)。
|
||||
|
||||
### 插件
|
||||
- 图库 1.6.4:面板刚挂载时量不到宽度导致**首屏空白**(只有改窗口大小才出图)→ 改为读取外层可用宽度 + rAF 重试;列表内边距 8→6,去掉居中留白。
|
||||
|
||||
## v3.26.15(2026-11-21)停靠栏选中态收敛
|
||||
|
||||
### 样式
|
||||
- 面板图标选中态不再用实心白底:改为 7% 文字色淡底 + 图标提亮;去掉下方 2px 品牌色横线。
|
||||
|
||||
## v3.26.14(2026-11-21)提示词库/节点组底色与图库一致
|
||||
|
||||
### 调整
|
||||
- 提示词库、节点组面板不再铺 `--iwb-plugin-surface` 灰底,改为透明(与图库一致,直接显示停靠栏底色)。
|
||||
|
||||
### 插件
|
||||
- promptlib 1.4.8。
|
||||
|
||||
## v3.26.13(2026-11-21)停靠栏拖宽实时跟手 + 幽灵图标
|
||||
|
||||
### 修复
|
||||
- 拖宽过程中同步更新 `--iwb-dock-l` / `--iwb-dock-r`:工具栏、小地图等随之实时让位,不再松手才"飘"过去。
|
||||
- 默认面板回填时跳过另一侧已存在的 id:右侧栏不再偶尔冒出一个没有实际窗口的提示词库图标。
|
||||
|
||||
## v3.26.12(2026-11-21)停靠栏面板去重(左右各自 + 跨侧)
|
||||
|
||||
### 修复
|
||||
- 老数据里同一插件面板 id 重复出现(历史注册残留)→ 打开时**同侧去重**;同一 id 同时出现在左右两侧时**只保留左侧**,右侧那一个自动消失。
|
||||
|
||||
## v3.26.11(2026-11-21)修插件面板重复注册
|
||||
|
||||
### 修复
|
||||
- 插件 `registerPanel` 同一插件重复注册同一 id 时**替换**旧条目,而不是追加(以前每重载/每拖拽一次就多一个停靠栏图标,且旧的不消失)。
|
||||
|
||||
## v3.26.10(2026-11-21)回退:恢复到 v3.26.5 的插件样式行为
|
||||
|
||||
### 回退
|
||||
- 代码整体回退到 **v3.26.5**(客户端),插件 promptlib 回退到 **1.4.0** 的内容(市场版本号 1.4.6)。
|
||||
- 移除 v3.26.6~3.26.9 期间的改动:市场缓存回退、启动层、卡片键盘可达、CSP nonce 兜底(`src/runtime-style-nonce.js`)、封面 448/瘦身迁移、封面内联存 dataURL 等。
|
||||
- 目的:先让左右栏插件恢复正常可用,后续再逐项、单独验证地重做。
|
||||
|
||||
## v3.26.5(2026-11-21)代码体检后的清理与瘦身
|
||||
|
||||
### 清理
|
||||
- promptlib 删除死代码(旧 openEditor / renderDetail / view / expanded 与失效 CSS):866 → 702 行。
|
||||
- 仓库根目录 8 张临时截图 + `_tray-preview/` 移出并加入 `.gitignore`(约 1MB)。
|
||||
|
||||
### 瘦身
|
||||
- 封面上限 768 → **448px**(WebP 0.8)。
|
||||
- 新增一次性迁移:插件启动时把 >60KB 的老封面重新压缩并保存一次(`prompts.json` 1.7MB → 明显下降)。
|
||||
|
||||
### 测试
|
||||
- 新增 3 组覆盖:封面渲染、插入封面图片(并关闭弹窗)、弹窗拖动/缩放(含最小宽度)。
|
||||
|
||||
### 插件
|
||||
- promptlib 1.4.0。
|
||||
|
||||
## v3.26.4(2026-11-21)插件灰再压一档 + 无封面方形占位
|
||||
|
||||
### 调整
|
||||
- 插件统一灰再压一档:`--iwb-plugin-surface: #ECEFF2`(面板)、`--iwb-plugin-inset: #E3E7EA`、`--iwb-plugin-hover: #DDE2E6`。
|
||||
- promptlib 1.3.5:**无封面的提示词也给 1:1 方形占位**(渐变 + 压图标题),瀑布流里不再塌成一条线。
|
||||
|
||||
## v3.26.3(2026-11-21)插件统一灰 + 提示词瀑布流
|
||||
|
||||
### 统一定义
|
||||
- 新增/明确「插件灰」单一来源:`--iwb-plugin-surface: #F2F4F6`(面板底)、`--iwb-plugin-inset: #E9ECEF`(内嵌)、`--iwb-plugin-hover: #E4E8EC`。所有插件面板只引用这三个值,不再各自定灰。
|
||||
|
||||
### 插件
|
||||
- promptlib 1.3.4:列表改**瀑布流**(`column-width: 122px`)—— 卡片定宽、图片按原始比例排布;面板拉宽 → 列数自动变多(不是把卡片拉大)。
|
||||
|
||||
## v3.26.2(2026-11-21)封面支持任意比例
|
||||
|
||||
### 改动
|
||||
- 上传封面:最长边 512 → **768**(WebP 0.85),保持原图比例(不裁切)。
|
||||
- 详情 / 编辑弹窗里的封面改为 `object-fit: contain`:**完整显示**,长图/宽图不再被裁。
|
||||
- 列表仍按方形裁切(网格整齐)。
|
||||
- 「插入图片」按**原图长宽比**给节点宽度(宽图 340~420、竖图 200~230),不再统一 264 宽。
|
||||
|
||||
### 插件
|
||||
- promptlib 1.3.3。
|
||||
|
||||
## v3.26.1(2026-11-21)提示词详情加「插入图片」
|
||||
|
||||
### 新增
|
||||
- 详情弹窗底部在「插入画布(节点)」前增加 **「插入图片」**:把该提示词的封面作为参考图节点插入画布(无封面时不显示该按钮)。
|
||||
- 宿主 `promptlib` 能力新增 `insertImage(cover, name)`:dataURL 先转引用再建 ref 节点,落在视口附近空位。
|
||||
|
||||
### 插件
|
||||
- promptlib 1.3.2:插入成功后自动关闭详情。
|
||||
|
||||
## v3.26.0(2026-11-21)提示词封面改为内联压缩图(彻底修“上传不显示”)
|
||||
|
||||
### 根因
|
||||
- 3.25.97 起封面走 `wImgRefWrite` → 存成 `{__blob}` 引用(IndexedDB)。提示词条目写进 `library/prompts.json`,而引用要等 IDB 解析;实测表现为“编辑弹窗能看到、列表不显示/重启后丢失”。
|
||||
- 另外 `putCover` 返回的是**对象**,条目里存成了 `{__blob:...}` 而不是字符串,缓存键也被拼成 `[object Object]`。
|
||||
|
||||
### 修复
|
||||
- `putCover` 改为**压缩后内联 dataURL**(≤512px WebP 0.82,约 20~60KB),随 `prompts.json` 落盘,跨会话必可见;不再依赖 IDB 解析时序。
|
||||
- `coverUrl` 对 dataURL 直接返回;对老数据里的 `{__blob}` 引用继续异步解析(兼容)。
|
||||
- 插件缓存键改用 `id|s:<尾部32位>`,上传后立即写入临时 URL 并重绘(编辑弹窗 + 列表同时更新)。
|
||||
|
||||
### 插件
|
||||
- promptlib 1.3.0。
|
||||
|
||||
## v3.25.99(2026-11-21)提示词封面即时同步 + 弹窗线框简化
|
||||
|
||||
### 修复
|
||||
- **列表不同步封面**:`coverOf` 只缓存成功结果(之前把「未解析到」的空串也缓存了,之后永远不再重试);编辑里上传后按 `id|ref` 写缓存,列表下一次渲染就能拿到。
|
||||
|
||||
### 样式
|
||||
- 弹窗内去掉多余线框:封面框无描边、头/尾分隔线降到 45% 透明度、输入框改「无边框 + 浅底,聚焦才描边」、正文区无边框无底色、左栏按钮弱化为浅底文字按钮。
|
||||
|
||||
### 插件
|
||||
- promptlib 1.2.1。
|
||||
|
||||
## v3.25.98(2026-11-21)提示词弹窗化(详情/编辑同宽可拖动可缩放)
|
||||
|
||||
### 插件 promptlib 1.2.0
|
||||
- 卡片点击 → **详情弹窗**(不再面板内翻页);编辑也在弹窗;两窗默认 880×640,同宽同高。
|
||||
- 标题栏拖动移动、右下角拖拽缩放(最小 640×420,无上限),位置/尺寸本地记忆。
|
||||
- 透明遮罩:点外部关闭,画布可见;Esc 关闭,编辑 Cmd/Ctrl+Enter 保存。
|
||||
- 编辑弹窗左栏 240:封面 + 名称/分组/标签;右侧大文本框吃满剩余高度。
|
||||
- 输入框边框柔化(用户反馈过深)。
|
||||
|
||||
### 宿主
|
||||
- `coverUrl` 改为异步解析(`wResolveImgAsync`):新写入的封面首帧就能显示,不用退出重进。
|
||||
|
||||
## v3.25.97(2026-11-21)提示词封面能力(宿主侧)
|
||||
|
||||
### 新增
|
||||
- `promptlib` 能力新增 `putCover(dataUrl) → ref`、`coverUrl(ref)`、`removeCover(ref)`:封面进宿主内容寻址图片库(`images/plugin/prompt/`),提示词条目只存 ref。
|
||||
- 图片由宿主缩略管线出图(`wImgSrcForNode`),插件不需要自己解码/存文件。
|
||||
|
||||
### 配套插件
|
||||
- promptlib 1.1.0:3 列方形封面网格(标题压图)、长文详情页、760px 宽编辑弹窗(大文本框 + 封面选择器)。
|
||||
|
||||
## v3.25.96(2026-11-21)库面板配色(P1+P2 重做,顺序修正)
|
||||
|
||||
### 宿主(P1)
|
||||
- 新增 `--iwb-plugin-surface/card/inset/hover`(**只加默认值,不重指任何旧变量**)。
|
||||
- `.iwb-dock-body` 带 `data-panel`;样式只作用于 `[data-panel=prompts|groups]`。
|
||||
- 提示词库:浅灰面板底 + 白卡
|
||||
- 节点组:浅灰面板底 + 灰卡 + hover/选中态
|
||||
|
||||
### 插件(P2)
|
||||
- promptlib 1.0.2:卡片 hover、名称加粗、摘要三行截断、间距。
|
||||
|
||||
### 流程修正
|
||||
- 这次严格按「改插件 → 插件仓 validate → 桌面仓 sync → gen-market → 再构建客户端 → 先发客户端再传市场」执行,避免上版插件清单与市场不一致。
|
||||
|
||||
## v3.25.94(2026-11-21)回滚到 3.25.88 的插件渲染
|
||||
|
||||
### 说明
|
||||
- 3.25.89~3.25.93 的配色改造导致风格库/浏览器面板渲染异常,用户裁定回滚。
|
||||
- 本版代码整体回到 v3.25.88(已知良好状态),仅版本号前进以便覆盖安装。
|
||||
- 不含:启动静态层(3.25.90)、插件独立底色(3.25.89+)、自动配色覆盖表面色。
|
||||
|
||||
## 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)
|
||||
- `#b91c1c` → `var(--iwb-err)`;设置面板的紫色开关(`#6b5ce7`)→ `var(--iwb-brand)`;`#d9dbde`/`#d5d9e0` → `--iwb-canvas-bg`/`--iwb-border`。
|
||||
- 品牌/深色底上的白字统一 `var(--iwb-on-brand)`(自动配色按对比度选黑/白)。
|
||||
- `background: #fff/#ffffff` 批量收口到 `var(--iwb-panel)`。
|
||||
- style.css 硬编码 hex:165 → 117(剩余为 token 定义、暗色 ramp、节点自定义色卡、阴影/蒙版纯黑)。
|
||||
|
||||
### P4 插件主题契约
|
||||
- 新增别名 `--iwb-plugin-{bg,panel,layer,border,text,text2,brand,on-brand,err,ok,warn}`(`:root` 里全部指向 `--iwb-*`),插件跟随主题/自动配色只需用别名。
|
||||
- 新增 `tests/plugin-theme-contract-test.js`:扫描 `plugins/**`,样式里写死颜色即失败;5 个历史插件(浏览器/批量导出/风格库/位图转矢量/白底画布)以白名单 + 原因暂留,待插件源码仓库改造。
|
||||
|
||||
## v3.25.84(2026-11-21)取色板自动确认 + 停靠栏图标残留
|
||||
|
||||
### 调整
|
||||
- **取色板不再需要点「完成」**:在色板/色相条上松手后 120ms 自动收起并生效;点面板外部也会关闭;正在输入 hex/RGB 时不自动关。
|
||||
|
||||
### 修复
|
||||
- **插件关闭后停靠栏仍有图标残留**:头部图标列表改为只画「当前可用面板」(`panels[id]` 存在);同时新增状态清洗 —— 插件启停后自动剔除已不存在的 id,active 失效回退到第一个可用面板。
|
||||
|
||||
## v3.25.83(2026-11-21)P3 第一批:语义色收口到 token
|
||||
|
||||
### 改动
|
||||
- 语义色错误/成功/警告 收口:`#ef4444`/`#dc2626` → `var(--iwb-err)`;`#22c55e` → `var(--iwb-ok)`;`#d97706`/`#b45309` → `var(--iwb-warn)`;`#6b7280` → `var(--iwb-text2)`(共 30 处)。
|
||||
- 新增 `--iwb-on-brand`:自动配色按对比度选黑/白,替换品牌底上的写死 `#fff`。
|
||||
- theme-tokens 同步派生 err/ok/warn(暗色自动提亮一档)+ onBrand。
|
||||
|
||||
### 结果
|
||||
- style.css 硬编码 hex 165 → 132(剩余为 token 定义、暗色 ramp、节点自定义底色、阴影/蒙版用黑)。
|
||||
|
||||
## v3.25.82(2026-11-21)底栏/停靠栏与插件开关联动
|
||||
|
||||
### 调整
|
||||
- 底栏「资源库」按钮(archive 图标)删除:右侧栏/提示词库面板已覆盖该入口(用户裁定)。
|
||||
- 停靠栏面板清单抽到 `src/ui-dock-panels.js` 并按**插件启用状态**过滤:插件关掉后左右栏不再出现该面板;某侧一个可用面板都没有时**整侧不渲染**(连折叠窄条也不画)。
|
||||
- 插件宿主未就绪(空列表,jsdom/首次启动)时不做过滤,避免误藏全部面板。
|
||||
|
||||
### 修复
|
||||
- 右侧栏「图库旁边偶尔冒出提示词库」:之前宿主用 `drawerTab` 强行指定 active(`history→gallery` 否则 `prompts`)。现在改为:右侧栏自己记住 active,仅在显式切换 tab 时派发 `iwb:dock-activate` 事件。
|
||||
|
||||
## v3.25.81(2026-11-21)配色自动适配 P1+P2
|
||||
|
||||
### 新增
|
||||
- 新增 src/theme-tokens.js:只定 4 个种子(中性基调 / 画布深浅 / 强调色 / 模式),派生 18 个语义色并写入现有 --iwb-* 变量;文本对表面自动做 4.5:1 对比度夹紧。
|
||||
- 外观面板新增「自动配色」(默认开启):改中性基调或画布深浅,整机配色实时跟着变;关闭后才显示原来的逐项手动调节(老配置自动视为手动)。
|
||||
|
||||
### 待办
|
||||
- P3:把 style.css 里 165 个 hex + 84 个 rgba 收口到 token;P4:插件只允许用 --iwb-*。
|
||||
|
||||
## v3.25.80(2026-11-21)图片链路收口 1-4
|
||||
|
||||
### 1 合并两套预览
|
||||
- 删除 1024 派生预览(`IWBImagePreviewDerive` 链路),统一用 768 显示缩略图;`wPreviewUrlOf` 改为直通(调用点不变)。
|
||||
|
||||
### 2 远程参考图本地缓存
|
||||
- 新增 `src/image-remote-cache.js`:空闲时下载远程参考图一次,写入本地引用存储,节点只加 `data.localRef`(仅显示)。
|
||||
- **`data.url` 原样保留**:提交生成仍然用链接(用户约束)。
|
||||
|
||||
### 3 legacy 目录清理
|
||||
- `cleanupLegacy(keep)`:只删除「未被任何画布引用 + 超过 7 天」的 `images/legacy/*`,引用中的永不删。
|
||||
|
||||
### 4 图库缩略图纳入回收
|
||||
- `pruneThumbs(300MB)` 的匹配范围扩到 `images/thumbs/<hash>.jpg`(图库缩略图),超限删最老 20%。
|
||||
|
||||
## v3.25.79(2026-11-21)修缩略图 MIME 错配导致的黑块
|
||||
|
||||
### 根因
|
||||
- 3.25.73 起的缩略图写盘把 **WebP 字节写进 `_768.jpg`**,读回时按扩展名声明成 `image/jpeg`。WebKit 对 MIME 与内容不符的 blob 有时直接渲染成黑块,双击看原图又正常。
|
||||
|
||||
### 修复
|
||||
- 读缩略图时用**魔数**判断真实格式(JPEG/PNG/WebP/GIF),不再只看扩展名;写盘按真实类型选择 `.webp` / `.jpg`。
|
||||
- 缩略图 objectURL 的 LRU 不再 `revoke`(可能正在被画布上的 `<img>` 使用,撤销即黑块)。
|
||||
|
||||
## v3.25.78(2026-11-21)修图片节点偶发黑块
|
||||
|
||||
### 问题
|
||||
- 画布上部分图片节点显示为**黑块**,双击后才出现图片。
|
||||
|
||||
### 根因
|
||||
- 参考图/出图格用了 `loading="lazy"`。画布是 transform 缩放的超大图层,WebKit 对容器内「懒加载」图片的触发条件不稳定 ⇒ 图片一直没发起加载,节点只剩占位底色;双击触发重渲染/滚动后才加载。
|
||||
|
||||
### 修复
|
||||
- 画布内图片改为**立即加载**(节点本身已有视口裁剪,不需要浏览器级懒加载);保留 `decoding="async"`。
|
||||
- 参考图 `<img>` 增加 `onError` 回退原图(缩略图坏了不至于空白)。
|
||||
|
||||
## v3.25.77(2026-11-21)修外观实时预览 + 设置遮罩透明
|
||||
|
||||
### 修复
|
||||
- **实时预览没生效**:预览调用 `A.apply(appearance)`,但 `normalize()` 只认整份配置(`config.canvas.appearance`)⇒ 每次改控件实际应用的是**默认外观**。现改为传整份 draft。
|
||||
- **设置遮罩挡住画布**:设置面板的遮罩改为透明(`.iwb-mask-ghost`),调外观能直接看到画布变化;点空白处仍可关闭。
|
||||
|
||||
## v3.25.76(2026-11-21)设置窗口可拖动 + 外观实时预览
|
||||
|
||||
### 新增
|
||||
- 设置窗口支持**拖动标题栏移动**(不脱出屏幕),不再固定居中挡住画布。
|
||||
- 外观页调整**实时反映到画布**:改颜色/网格样式/间距/圆角等立刻可见;关闭未保存会自动回滚到已保存外观。
|
||||
|
||||
### 说明
|
||||
- 实时预览只写 CSS 变量 + 通知画布重渲染(网格贴图按新参数重建),不改配置文件;点「保存配置」才落盘。
|
||||
|
||||
## v3.25.75(2026-11-21)外观面板重构 + 网格线样式
|
||||
|
||||
### 新增
|
||||
- 背景网格支持**点 / 线 / 空白**三选一(参考 infinite-canvas 的「网格样式」);线型下颜色/粗细标签自动改名。
|
||||
- 主题下拉合并了配色模式与全部预设(默认 / 护眼深色 / 高对比 / 纸质 / 自定义),一处切换。
|
||||
|
||||
### 重构(用户裁定:保留节点组、合并主题、恢复按钮放组头)
|
||||
- 外观分成 4 组:主题 / 画布 / 连线 / 节点;每组组头右侧「恢复本组默认」。
|
||||
- 统一两栏网格:标签 120px 右对齐 + 控件左对齐,行高 40px、组间距 22px。
|
||||
- 颜色行统一为「色块 + hex + ▾」,对比度警告收进行尾(不再整行黄字)。
|
||||
- 配置新增 `canvas.appearance.gridStyle`(dots/lines/blank,老配置 gridOn=false 自动视为 blank)。
|
||||
|
||||
## v3.25.74(2026-11-21)状态栏内存显示 + 网格设置修复
|
||||
|
||||
### 新增
|
||||
- 画布顶栏状态区显示**当前进程内存**(`内存 xxxMB`,4s 轮询;窗口隐藏时降到 8s)。Rust 新增命令 `app_memory_mb`(macOS/Linux 读 ps RSS,Windows 读 WorkingSet64)。
|
||||
|
||||
### 修复
|
||||
- **外观设置里的网格三项失效**:网格点大小 / 网格间距 / 显示网格 之前不生效(3.25.70 改贴图网格时把参数写死成 28px/1.2)。现在网格每次渲染读取 CSS 变量(`--iwb-grid-gap/-size/-dot/-on`),与外观面板联动。
|
||||
|
||||
## v3.25.73(2026-11-21)缩略图三改(参考 basketikun/infinite-canvas)
|
||||
|
||||
### 背景
|
||||
- 读了对标项目源码:它把「预览图」当一等公民:入库时生成 768 WebP、存 Blob、按屏幕像素需求切原图。
|
||||
|
||||
### 改动
|
||||
- **稳定 key**:引用图缩略图 key 改为 `ref:<b:sha|c:key>`(blob URL 反查引用)。原来 key 是每次启动都变的 objectURL ⇒ **跨会话永远不命中**,所以每次打开画布都在重新解码原图。
|
||||
- **入库预热**:图片写入引用存储(blob/cache)时立即排队生成缩略图(字节还在内存),渲染期不再触发解码。
|
||||
- **Blob + objectURL**:缩略图生成改用 `createImageBitmap` → canvas → `toBlob(webp 0.86)`,产物是 objectURL(不进 JS 堆);落盘走 `writeDisplayThumbBlob`,读回用 `readDisplayThumbUrl`(objectURL 缓存 + 回收)。老 dataURL 文件仍兼容读取。
|
||||
- **按需切原图** `wImgSrcForNode`:屏幕需要长边 = 渲染长边 × 缩放 × dpr,超过 768 才用原图(原来有缩略图就一直用 → 放大糊;低缩放首帧又用原图 → 卡)。
|
||||
|
||||
### 新增模块
|
||||
- `src/image-thumb-pick.js`(key/选择/预热规则,依赖注入)
|
||||
|
||||
## v3.25.72(2026-11-20)修节点端口被裁切
|
||||
|
||||
### 问题
|
||||
- 节点左右端口的连接点显示不全(只剩半个圆)。
|
||||
|
||||
### 根因
|
||||
- 3.25.69 的试验样式 `.iwb-node { content-visibility: auto }` 没删干净:content-visibility 隐含 **paint 包含**,而端口是 `position:absolute` + `translate(-50%,-50%)` 逸出节点边框的,于是被浏览器裁掉。
|
||||
|
||||
### 修复
|
||||
- 彻底移除该规则,并在原处写明原因,防止以后再加回。
|
||||
|
||||
## v3.25.71(2026-11-20)低缩放 LOD 可关闭
|
||||
|
||||
### 新增
|
||||
|
||||
@@ -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 108 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
|
||||
test:unit 111 个单测文件(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)
|
||||
|
||||
|
Before Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 279 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 593 B |
|
Before Width: | Height: | Size: 507 B |
|
Before Width: | Height: | Size: 717 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 53 KiB |
@@ -11,6 +11,9 @@
|
||||
await window.IWBStorageFile.ready()
|
||||
}
|
||||
} catch (e) { console.error('[iwb][file-store] 启动装载失败,回退浏览器存储', e) }
|
||||
|
||||
// v3.26.18:小地图与底部工具栏避让(右栏挤压时自动隐藏,实现在 src/ui-minimap-fit.js)
|
||||
try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'function') window.IWBMiniMapFit.install() } catch (e) { /* ignore */ }
|
||||
const el = React.createElement
|
||||
const { useState, useEffect, useLayoutEffect, useRef } = React
|
||||
// 生成结果精简/合并模块(src/generation-results-store.js)。⚠️ 必须在 IIFE 最顶部取:
|
||||
@@ -1208,6 +1211,19 @@
|
||||
// 保证可见;只在**首次**失败时提示一次,不打扰日常。
|
||||
try { wLogNotice('诊断日志暂时无法写入(浏览器存储不可用),本次操作记录不会保存。', 'err') } catch (e) { /* ignore */ }
|
||||
}
|
||||
// v3.25.80:收集所有画布引用到的图片文件名(给 legacy 清理用;放在 Workbench 外,避免组件行数上涨)
|
||||
function wCollectRefImageNames (workspaces) {
|
||||
const keep = []
|
||||
try {
|
||||
for (const ws of (workspaces || [])) {
|
||||
const txt = JSON.stringify(ws && ws.nodes ? ws.nodes : [])
|
||||
const m = txt.match(/[0-9a-f]{8,32}\.(?:png|jpe?g|webp|gif)/g)
|
||||
if (m) for (const x of m) keep.push(x)
|
||||
}
|
||||
} catch (e) { /* ignore */ }
|
||||
return keep
|
||||
}
|
||||
|
||||
function wLog(kind, msg, detail) {
|
||||
try {
|
||||
const now = Date.now()
|
||||
@@ -2383,7 +2399,11 @@
|
||||
if (W_IMG_BLOB_PRIMARY && wImageBlobStore()) {
|
||||
try {
|
||||
const r = await wImageBlobStore().put(dataUrl)
|
||||
if (r && r.ok && r.key) return { __blob: String(r.key) }
|
||||
if (r && r.ok && r.key) {
|
||||
const ref = { __blob: String(r.key) }
|
||||
try { wPrimeDisplayThumbForRef(ref, dataUrl) } catch (e) { /* ignore */ }
|
||||
return ref
|
||||
}
|
||||
if (r && r.ok === false) swallow('image', new Error(r.error || 'blob-put-failed'))
|
||||
} catch (e) { swallow('image', e) } // 落 Blob 失败(配额/环境不支持)→ 回退 Cache,但计数留痕
|
||||
}
|
||||
@@ -2391,7 +2411,80 @@
|
||||
// 回退等于“写成功但图没了”。失败就让调用方把字节内联进画布。
|
||||
if (wIsTauri()) return null
|
||||
const c = await iwbCacheWrite(dataUrl)
|
||||
return (c && c.__cache) ? c : null
|
||||
if (c && c.__cache) { try { wPrimeDisplayThumbForRef(c, dataUrl) } catch (e) { /* ignore */ } ; return c }
|
||||
return null
|
||||
}
|
||||
|
||||
// v3.25.97:提示词封面(宿主图片库)—— 放在 Workbench 外,避免组件行数上涨
|
||||
// v3.26.0:提示词封面 —— 直接存「压缩后的 dataURL」(≤512 WebP),随 prompts.json 落盘。
|
||||
// 为什么不用引用({__blob}):封面是**跨会话必须可见**的小图,引用要依赖 IDB + 解析时序,
|
||||
// 实测会出现“编辑里能看到、列表看不到/重启后丢失”。512px WebP 约 20~60KB,几十条完全可以接受。
|
||||
async function wPromptCoverPut (dataUrl) {
|
||||
try {
|
||||
const src = String(dataUrl || '')
|
||||
if (src.indexOf('data:') !== 0) return { ok: false, error: '封面上传失败' }
|
||||
const enc = (fmt, q) => new Promise((resolve) => {
|
||||
try {
|
||||
compressDataUrl(src, { enabled: true, force: true, maxMB: 0, maxEdge: 448, quality: q, format: fmt }, (o) => resolve(o || ''))
|
||||
} catch (e) { resolve('') }
|
||||
})
|
||||
// v3.26.21:优先 WebP;编码器不可用时 compressDataUrl 会退回 PNG,
|
||||
// 448px 照片的 PNG 仍有 300KB+(实测 3 张共 1.1MB)→ 再兜一次 JPEG。
|
||||
let final = await enc('webp', 0.8)
|
||||
if (!final) final = await enc('jpeg', 0.82)
|
||||
if (!final) final = src
|
||||
if (final.indexOf('data:image/webp') !== 0 && final.indexOf('data:image/jpeg') !== 0) {
|
||||
const j = await enc('jpeg', 0.82)
|
||||
if (j && j.length < final.length) final = j
|
||||
}
|
||||
if (String(final).indexOf('data:') !== 0) return { ok: false, error: '封面上传失败' }
|
||||
return { ok: true, ref: final }
|
||||
} catch (e) { return { ok: false, error: '封面上传失败' } }
|
||||
}
|
||||
// v3.26.1:把提示词封面插入画布 —— 返回 { ok, error }
|
||||
// v3.26.2:封面比例不定 —— 按原图长宽比给节点宽度,避免统一 264 宽把长图/宽图都压成一条
|
||||
function wDataUrlAspect (dataUrl) {
|
||||
return new Promise((resolve) => {
|
||||
try {
|
||||
const img = new Image()
|
||||
img.onload = () => resolve((img.naturalWidth || 1) / (img.naturalHeight || 1) || 1)
|
||||
img.onerror = () => resolve(1)
|
||||
img.src = String(dataUrl || '')
|
||||
} catch (e) { resolve(1) }
|
||||
})
|
||||
}
|
||||
function wNodeWidthForAspect (ratio) {
|
||||
const r = Number(ratio) || 1
|
||||
if (r >= 2) return 420
|
||||
if (r >= 1.5) return 340
|
||||
if (r <= 0.5) return 200
|
||||
if (r <= 0.75) return 230
|
||||
return 280
|
||||
}
|
||||
async function wPromptInsertImage (host, cover, name) {
|
||||
try {
|
||||
let data = cover
|
||||
let ratio = 1
|
||||
if (typeof cover === 'string' && cover.indexOf('data:') === 0) {
|
||||
ratio = await wDataUrlAspect(cover)
|
||||
const ref = await wImgRefWrite(cover)
|
||||
if (ref) data = ref
|
||||
} else if (cover && typeof cover === 'object') {
|
||||
const url = await wResolveImgAsync(cover)
|
||||
if (url) ratio = await wDataUrlAspect(url)
|
||||
}
|
||||
if (!data) return { ok: false, error: '这条提示词没有封面' }
|
||||
host.insertRefNode(data, name || '封面图片', wNodeWidthForAspect(ratio))
|
||||
return { ok: true }
|
||||
} catch (e) { return { ok: false, error: '插入封面失败' } }
|
||||
}
|
||||
// 兼容:老数据里可能是 {__blob}/{__cache} 引用对象(v3.25.97/98 写入),继续异步解析
|
||||
async function wPromptCoverUrl (ref) {
|
||||
try {
|
||||
if (typeof ref === 'string' && ref.indexOf('data:') === 0) return { ok: true, url: ref }
|
||||
const url = await wResolveImgAsync(ref)
|
||||
return { ok: !!url, url: url || '' }
|
||||
} catch (e) { return { ok: false, url: '' } }
|
||||
}
|
||||
// 一次性迁移(桌面版):把历史画布里内联的 dataURL 图转成 {__blob} 引用。
|
||||
// 只在资料目录生效时跑,跑完打标记;之后保存画布本就会走同一规则。
|
||||
@@ -4712,54 +4805,35 @@ const tbCenterSeed = (type, refs) => {
|
||||
if (v.indexOf('/__iwb_cache__/') >= 0 || /^https?:/i.test(v) || v.indexOf('blob:') === 0) return v
|
||||
return ''
|
||||
}
|
||||
// ==== v3.87.54(丙方案 C2 · 第 1 步):画布小预览 URL 解析器 ====
|
||||
// 设计(详见 docs/archive/plans/opentu-parity-image-memory.md §8):复用 wDisplayThumbOf 已验证的模式
|
||||
// —— 同步返回原值(首帧不闪空)→ 异步用 IWBImagePreviewDerive **解码即缩放**(≤1024)→ wThumbBump 触发一次重渲染换小图。
|
||||
// 本步**只新增、不接入渲染**(零行为变更),下一步再逐个接入 4 个渲染点。
|
||||
const previewUrls = new Map()
|
||||
const previewPending = new Set()
|
||||
const PREVIEW_MAX_EDGE = 1024
|
||||
const PREVIEW_CACHE_MAX = 200
|
||||
function wPreviewRevoke(url) { try { if (typeof url === 'string' && url.indexOf('blob:') === 0) URL.revokeObjectURL(url) } catch (e) { /* ignore */ } }
|
||||
function wPreviewPick(key, val) {
|
||||
if (previewUrls.size >= PREVIEW_CACHE_MAX) {
|
||||
const first = previewUrls.keys().next().value
|
||||
if (first !== undefined) { wPreviewRevoke(previewUrls.get(first)); previewUrls.delete(first) }
|
||||
}
|
||||
previewUrls.set(key, val)
|
||||
}
|
||||
function wPreviewUrlOf(v) {
|
||||
// v3.24.64:SVG 不做光栅化派生 —— 浏览器 <img> 原生渲染矢量,且原图通常只有几十 KB,
|
||||
// 光栅化反而把矢量变成 ≤1024 的位图(放大糊),还要多一次跨域代理请求。
|
||||
if (ImageFormat && ImageFormat.isSvg && ImageFormat.isSvg(v)) return v
|
||||
const key = wDisplayThumbKey(v)
|
||||
if (!key) return v
|
||||
const hit = previewUrls.get(key)
|
||||
if (hit) return hit
|
||||
if (previewPending.has(key)) return v
|
||||
const Derive = (typeof window !== 'undefined') ? window.IWBImagePreviewDerive : null
|
||||
if (!Derive || typeof Derive.create !== 'function' || typeof document === 'undefined') return v
|
||||
previewPending.add(key)
|
||||
// 桌面客户端没有同源代理(旧的 functions/api/img.js 已随网页版删除)⇒ 派生器直连;
|
||||
// 跨域失败即负缓存并回退原图,不影响显示。
|
||||
const viaUrl = undefined
|
||||
let inst = null
|
||||
try { inst = Derive.create({ maxEdge: PREVIEW_MAX_EDGE, quality: 0.82 }) } catch (e) { inst = null }
|
||||
if (!inst || typeof inst.deriveUrl !== 'function') { previewPending.delete(key); wPreviewPick(key, v); return v }
|
||||
// ── v3.25.73:缩略图 key / 按需切原图 / 入库预热(逻辑在 src/image-thumb-pick.js)──
|
||||
// 说明见模块头:引用图用 ref:<b:sha|c:key> 作稳定 key(跨会话命中),
|
||||
// 并按「屏幕需要的像素」决定用缩略图还是原图(参考 infinite-canvas 的 pickImageSource)。
|
||||
const ThumbPick = (function () {
|
||||
const M = (typeof window !== 'undefined') ? window.IWBImageThumbPick : null
|
||||
if (!M || typeof M.create !== 'function') return null
|
||||
try {
|
||||
inst.deriveUrl(v, { viaUrl: viaUrl }).then((r) => {
|
||||
previewPending.delete(key)
|
||||
if (!r || !r.ok || !r.url) { wPreviewPick(key, v); return } // 负缓存:失败不再重试
|
||||
wPreviewPick(key, r.url)
|
||||
if (typeof wThumbBump === 'function') { try { wThumbBump() } catch (e) { /* ignore */ } }
|
||||
}).catch(() => { previewPending.delete(key); wPreviewPick(key, v) })
|
||||
} catch (e) { previewPending.delete(key); wPreviewPick(key, v) }
|
||||
return v // 首帧:原值
|
||||
}
|
||||
function wPreviewRevokeAll() {
|
||||
try { for (const u of previewUrls.values()) wPreviewRevoke(u) } catch (e) { /* ignore */ }
|
||||
previewUrls.clear(); previewPending.clear()
|
||||
}
|
||||
return M.create({
|
||||
cache: displayThumbs,
|
||||
max: DISPLAY_THUMB_MAX,
|
||||
refKeyOf: wImgRefKey,
|
||||
refByUrl: wImgRefByUrl,
|
||||
rawKeyOf: wDisplayThumbKey,
|
||||
resolveImg: wResolveImg,
|
||||
queue: (key, v) => { if (ThumbGen) ThumbGen.queue(key, v) },
|
||||
})
|
||||
} catch (e) { return null }
|
||||
})()
|
||||
let wScaleNow = 1
|
||||
function wSetScaleNow (v) { const n = Number(v); if (Number.isFinite(n) && n > 0) wScaleNow = n }
|
||||
function wDisplayThumbKeyOf (v) { return ThumbPick ? ThumbPick.keyOf(v) : '' }
|
||||
function wImgSrcForNode (v, renderedLongEdge) { return ThumbPick ? ThumbPick.srcForNode(v, renderedLongEdge, wScaleNow) : ((v && typeof v === 'object') ? (wResolveImg(v) || '') : String(v || '')) }
|
||||
function wPrimeDisplayThumbForRef (ref, dataUrl) { return ThumbPick ? ThumbPick.prime(ref, dataUrl) : false }
|
||||
|
||||
|
||||
// v3.25.80:旧的「1024 预览派生」已并入 768 显示缩略图(两套解码=两份内存)。
|
||||
// 保留同名入口做直通,调用点不改;真正的缩略由 image-display-thumb + ThumbPick 负责。
|
||||
function wPreviewUrlOf (v) { return v }
|
||||
function wPreviewRevokeAll () { /* 直通后没有独立 objectURL 需要回收 */ }
|
||||
|
||||
// 显示缩略图落盘(768px):下次启动直接读文件,不用再解码原图
|
||||
const DISPLAY_THUMB_HASH_MAX = 512
|
||||
@@ -4771,13 +4845,21 @@ const tbCenterSeed = (type, refs) => {
|
||||
|
||||
// 缩略图生成队列已抽到 src/image-display-thumb.js(并发上限 + 空闲启动),下面装配。
|
||||
|
||||
function wSaveDisplayThumb (key, dataUrl) {
|
||||
function wSaveDisplayThumb (key, payload) {
|
||||
const F = wStoreMod()
|
||||
if (!F || !key || !dataUrl) return
|
||||
if (!F || !key || !payload) return
|
||||
if (displayThumbSaved.has(key) || displayThumbSaved.size > 2000) return
|
||||
displayThumbSaved.add(key)
|
||||
wSha256(String(key)).then(function (hex) {
|
||||
try { F.writeDisplayThumb(hex.slice(0, 16), dataUrl) } catch (e) { /* ignore */ }
|
||||
const h = hex.slice(0, 16)
|
||||
try {
|
||||
// v3.25.73:Blob(WebP)走二进制写盘;老路径的 dataURL 仍兼容
|
||||
if (typeof Blob !== 'undefined' && payload instanceof Blob) {
|
||||
if (typeof F.writeDisplayThumbBlob === 'function') F.writeDisplayThumbBlob(h, payload)
|
||||
} else if (typeof F.writeDisplayThumb === 'function') {
|
||||
F.writeDisplayThumb(h, payload)
|
||||
}
|
||||
} catch (e) { /* ignore */ }
|
||||
}).catch(function () { /* ignore */ })
|
||||
}
|
||||
async function wPreloadDisplayThumbs (nodes) {
|
||||
@@ -4787,9 +4869,10 @@ const tbCenterSeed = (type, refs) => {
|
||||
for (const n of nodes) {
|
||||
const d = n && n.data
|
||||
if (!d) continue
|
||||
const stable = wDisplayThumbKeyOf(d.data)
|
||||
const v = wResolveImg(d.data) || d.url
|
||||
if (!v || typeof v !== 'string' || v.indexOf('data:') === 0) continue
|
||||
const key = wDisplayThumbKey(v)
|
||||
const key = stable || wDisplayThumbKey(v)
|
||||
if (!key || displayThumbs.has(key) || keys.indexOf(key) >= 0) continue
|
||||
keys.push(key)
|
||||
if (keys.length >= DISPLAY_THUMB_HASH_MAX) break
|
||||
@@ -4798,8 +4881,13 @@ const tbCenterSeed = (type, refs) => {
|
||||
for (const key of keys) {
|
||||
try {
|
||||
const hex = await wSha256(String(key))
|
||||
const dataUrl = await F.readDisplayThumb(hex.slice(0, 16))
|
||||
if (dataUrl) { displayThumbs.set(key, dataUrl); displayThumbSaved.add(key); n++ }
|
||||
const h16 = hex.slice(0, 16)
|
||||
let url = ''
|
||||
if (typeof F.readDisplayThumbUrl === 'function') {
|
||||
try { url = await F.readDisplayThumbUrl(h16) } catch (e) { url = '' }
|
||||
}
|
||||
if (!url) url = await F.readDisplayThumb(h16)
|
||||
if (url) { displayThumbs.set(key, url); displayThumbSaved.add(key); n++ }
|
||||
} catch (e) { /* 单张失败忽略 */ }
|
||||
}
|
||||
if (n && typeof wThumbBump === 'function') { try { wThumbBump() } catch (e) { /* ignore */ } }
|
||||
@@ -4826,11 +4914,12 @@ const tbCenterSeed = (type, refs) => {
|
||||
|
||||
function wDisplayThumbOf(v) {
|
||||
// C3:结果项 / 图片节点的 data 可能是引用对象(hydrate 直出)→ 先解析成显示 URL
|
||||
const stableKey = wDisplayThumbKeyOf(v)
|
||||
if (v && typeof v === 'object') v = wResolveImg(v)
|
||||
// v3.24.64:SVG 直接透传原地址(<img> 原生渲染矢量,绝不 innerHTML 内联脚本)。
|
||||
// 既省掉必失败的跨域代理解码,也避免把矢量压成 ≤768 的 JPEG(小字/线条发糊)。
|
||||
if (ImageFormat && ImageFormat.isSvg && ImageFormat.isSvg(v)) return v
|
||||
const key = wDisplayThumbKey(v)
|
||||
const key = stableKey || wDisplayThumbKey(v)
|
||||
// v3.87.62(丙方案§13③):空值返回 null(React 省略属性),避免 <img src=""> 空请求 ✗
|
||||
if (!key) return (v === '' || v === null || v === undefined) ? null : v
|
||||
const hit = displayThumbs.get(key)
|
||||
@@ -5091,7 +5180,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
if (!IWNodeBodies || IWNodeBodies.__iwbInjected) return
|
||||
try {
|
||||
IWNodeBodies.inject({ el, I, LocalTextField, autoGrow, nodePreviewRefsV2, nodeInheritOf, combineSourcePairs, isPluginTypeId,
|
||||
orderedUniqueRefNodes, uploadRefToImageHost, wDisplayThumbOf, wImportImage, wPreviewUrlOf, wRawCfg, wResolveImg,
|
||||
orderedUniqueRefNodes, uploadRefToImageHost, wDisplayThumbOf, wImgSrcForNode, wImportImage, wPreviewUrlOf, wRawCfg, wResolveImg,
|
||||
wThumbSrc, downloadUrl, wResolveOutputSrc, isImageProducer, outProgUI, outThumbCache,
|
||||
wPluginNodeVariants, wPluginVariantMeta, isBatchSrc, batchSrcText, compareCanvasTextOrder,
|
||||
GenParams, RATIOS, RES_KEYS, RES_MAP, cachedGenerationTasks, classifyErr, fmtDur, presetDisplayName,
|
||||
@@ -5665,7 +5754,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
return () => { clearTimeout(t1); clearTimeout(t2) }
|
||||
}, [])
|
||||
const [drawerOpen, setDrawerOpenRaw] = useState(() => { try { return lsRawGet('iwb_drawer_open', null) !== '0' } catch (e) { return true } }); const setDrawerOpen = (v) => { setDrawerOpenRaw(v); try { lsRawSet('iwb_drawer_open', v ? '1' : '0') } catch (e) { /* ignore */ } } // 库面板开合状态持久化:刷新后保持上次开关(2026-11-03);读写失败回退「关闭」,不阻断启动
|
||||
const [drawerTab, setDrawerTabRaw] = useState(() => { try { return lsRawGet('iwb_drawer_tab', '') || 'history' } catch (e) { return 'prompts' } }); const setDrawerTab = (v) => { setDrawerTabRaw(v); try { lsRawSet('iwb_drawer_tab', String(v)) } catch (e) { /* ignore */ } } // 库面板当前标签持久化:刷新后停在上次的 tab(2026-11-03)
|
||||
const [drawerTab, setDrawerTabRaw] = useState(() => { try { return lsRawGet('iwb_drawer_tab', '') || 'history' } catch (e) { return 'prompts' } }); const setDrawerTab = (v) => { setDrawerTabRaw(v); try { lsRawSet('iwb_drawer_tab', String(v)) } catch (e) { /* ignore */ } ; try { window.dispatchEvent(new CustomEvent('iwb:dock-activate', { detail: { side: 'right', id: v === 'history' ? 'gallery' : 'prompts' } })) } catch (e) { /* ignore */ } } // 库面板当前标签持久化:刷新后停在上次的 tab(2026-11-03)
|
||||
const [enteringWs, setEnteringWs] = useState(false) // 进入画布编辑器的加载动画
|
||||
const [outputs, setOutputs] = useState([])
|
||||
const [outputsInfo, setOutputsInfo] = useState(null)
|
||||
@@ -5805,6 +5894,24 @@ const tbCenterSeed = (type, refs) => {
|
||||
}, [])
|
||||
const [thumbRev, setThumbRev] = React.useState(0) // v3.87.7:显示缩略图就绪后触发一次 re-render(必须在 Workbench 内)
|
||||
useEffect(() => { wThumbBump = () => setThumbRev((v) => v + 1); return () => { wThumbBump = null } }, [])
|
||||
// 启动维护(v3.25.80):8 秒后做缩略图封顶 + legacy 未引用清理;同时启动远程参考图本地缓存。
|
||||
useEffect(() => {
|
||||
const RC = (typeof window !== 'undefined') ? window.IWBImageRemoteCache : null
|
||||
const stop = (RC && typeof RC.attach === 'function')
|
||||
? RC.attach({ getState: () => ({ enabled: !!(loaded && shellView === 'canvas'), nodes: (refs && refs.nodes) || [] }), writeRef: (u) => wImgRefWrite(u), updateNode: (id, patch) => updateNode(id, patch) })
|
||||
: null
|
||||
const timer = setTimeout(() => {
|
||||
try { const F = wStoreMod(); if (F && typeof F.maintain === 'function') F.maintain({ maxMB: 300, keep: wCollectRefImageNames(workspaces) }).catch(() => { /* ignore */ }) } catch (e) { /* ignore */ }
|
||||
}, 8000)
|
||||
return () => { if (timer) clearTimeout(timer); if (typeof stop === 'function') stop() }
|
||||
}, [])
|
||||
// 外观实时预览(v3.25.76):设置面板每改一个外观项都会派发该事件,
|
||||
// 这里只 bump 一次渲染,让网格贴图按新的间距/颜色/样式重新生成。
|
||||
useEffect(() => {
|
||||
const onAppearance = () => { try { setThumbRev((v) => v + 1) } catch (e) { /* ignore */ } }
|
||||
window.addEventListener('iwb:appearance', onAppearance)
|
||||
return () => window.removeEventListener('iwb:appearance', onAppearance)
|
||||
}, [])
|
||||
// 2026-11-14:插件节点体(render)异步注册完成后重画一次 —— 否则存档里的插件节点会一直停在
|
||||
// 首帧的兜底体(hint + 纯文本),看起来像「样式节点只剩一段文本」。
|
||||
const [typesRev, setTypesRev] = React.useState(0)
|
||||
@@ -7573,13 +7680,28 @@ const tbCenterSeed = (type, refs) => {
|
||||
const importCanvasFile = (file, fromDrop, dropX, dropY) => IWWorkbenchLogic.importCanvasFile({ canvasSize, commitCanvas, pushHistory, refs, setNotice, setSel }, file, fromDrop, dropX, dropY)
|
||||
|
||||
// 网格样式:优先用 src/canvas-grid.js 的贴图(平移只走 transform,不重绘点阵)
|
||||
// v3.25.74:改为读取外观设置(网格点大小/间距/颜色/开关)—— 之前硬编码 28/1.2,
|
||||
// 导致设置里的「网格点大小 / 网格间距 / 显示网格」全部失效(用户反馈)。
|
||||
const readGridOpts = () => {
|
||||
if (typeof getComputedStyle !== 'function' || typeof document === 'undefined') return { base: 22, dot: 1.4, color: 'rgba(120,128,140,0.55)', on: true }
|
||||
try {
|
||||
const cs = getComputedStyle(document.documentElement)
|
||||
const gap = parseFloat(cs.getPropertyValue('--iwb-grid-gap')) || 22
|
||||
const dot = parseFloat(cs.getPropertyValue('--iwb-grid-size')) || 1.4
|
||||
const col = (cs.getPropertyValue('--iwb-grid-dot') || '').trim() || 'rgba(120,128,140,0.55)'
|
||||
const onv = parseFloat(cs.getPropertyValue('--iwb-grid-on'))
|
||||
const style = (document.documentElement.getAttribute('data-iwb-grid') || 'dots')
|
||||
return { base: Math.max(8, gap), dot: Math.max(0.5, dot), color: col, on: !(onv === 0) && style !== 'blank', style }
|
||||
} catch (e) { return { base: 22, dot: 1.4, color: 'rgba(120,128,140,0.55)', on: true } }
|
||||
}
|
||||
refs.gridOpts = readGridOpts()
|
||||
const gridStyleOf = (x, y, scale) => {
|
||||
const o = refs.gridOpts || { base: 22, dot: 1.4, color: 'rgba(120,128,140,0.55)', on: true }
|
||||
if (!o.on) return { display: 'none' }
|
||||
const G = (typeof window !== 'undefined') ? window.IWBCanvasGrid : null
|
||||
const st = G && typeof G.styleOf === 'function'
|
||||
? G.styleOf(x, y, scale, { base: 28, dot: 1.2, color: 'rgba(120,128,140,0.55)' })
|
||||
: null
|
||||
const st = G && typeof G.styleOf === 'function' ? G.styleOf(x, y, scale, o) : null
|
||||
if (st) return st
|
||||
return { backgroundSize: (28 * scale) + 'px ' + (28 * scale) + 'px', backgroundPosition: x + 'px ' + y + 'px' }
|
||||
return { backgroundSize: (o.base * scale) + 'px ' + (o.base * scale) + 'px', backgroundPosition: x + 'px ' + y + 'px' }
|
||||
}
|
||||
|
||||
// v3.25.68(借鉴 tldraw 的相机机制):手势期间只改 .iwb-world 的 transform,
|
||||
@@ -7593,7 +7715,8 @@ const tbCenterSeed = (type, refs) => {
|
||||
const grid = root.querySelector('.iwb-grid')
|
||||
const G = (typeof window !== 'undefined') ? window.IWBCanvasGrid : null
|
||||
if (grid && G && typeof G.applyTo === 'function') {
|
||||
G.applyTo(grid, x, y, scale, { base: 28, dot: 1.2, color: 'rgba(120,128,140,0.55)' })
|
||||
const o = refs.gridOpts || { base: 22, dot: 1.4, color: 'rgba(120,128,140,0.55)', on: true }
|
||||
if (!o.on) { grid.style.display = 'none' } else { grid.style.display = '' ; G.applyTo(grid, x, y, scale, o) }
|
||||
} else if (grid) {
|
||||
grid.style.backgroundSize = (28 * scale) + 'px ' + (28 * scale) + 'px'
|
||||
grid.style.backgroundPosition = x + 'px ' + y + 'px'
|
||||
@@ -7734,6 +7857,25 @@ const tbCenterSeed = (type, refs) => {
|
||||
}
|
||||
const visibleIds = new Set(nodes.filter(nodeVisible).map((n) => n.id))
|
||||
|
||||
try { wSetScaleNow(viewport.scale) } catch (e) { /* ignore */ }
|
||||
// 进程内存(v3.25.74):状态栏显示,便于对比优化前后的内存占用(4s 轮询,窗口隐藏时不拉)
|
||||
const [memMb, setMemMb] = React.useState(0)
|
||||
useEffect(() => {
|
||||
let alive = true
|
||||
let timer = null
|
||||
const tick = () => {
|
||||
if (!alive) return
|
||||
if (typeof document !== 'undefined' && document.hidden) { timer = setTimeout(tick, 8000); return }
|
||||
Promise.resolve().then(() => {
|
||||
const T = (typeof window !== 'undefined') ? window.__TAURI__ : null
|
||||
const inv = T && T.core && T.core.invoke
|
||||
if (typeof inv !== 'function') return 0
|
||||
return inv('app_memory_mb').catch(() => 0)
|
||||
}).then((v) => { if (!alive) return; const n = Number(v) || 0; if (n > 0) setMemMb(n) }).catch(() => {}).then(() => { if (alive) timer = setTimeout(tick, 4000) })
|
||||
}
|
||||
timer = setTimeout(tick, 1200)
|
||||
return () => { alive = false; if (timer) clearTimeout(timer) }
|
||||
}, [])
|
||||
const scaleText = Math.round(viewport.scale * 100) + '%'
|
||||
const saveText = saveState === 'saving' ? '正在保存' : saveState === 'saved' ? '保存成功' : saveState === 'error' ? '保存失败' : ''
|
||||
const connecting = !!conn
|
||||
@@ -8049,6 +8191,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
setSettingOpen,
|
||||
saveState,
|
||||
saveText,
|
||||
memMb,
|
||||
notice,
|
||||
busy,
|
||||
progress,
|
||||
@@ -8101,6 +8244,17 @@ const tbCenterSeed = (type, refs) => {
|
||||
setNotice({ type: 'ok', text: '已插入提示词:' + (name || '') })
|
||||
return { ok: true }
|
||||
},
|
||||
// v3.26.1:把提示词封面插入画布(逻辑在 wPromptInsertImage,Workbench 只做装配)
|
||||
insertImage: (cover, name) => wPromptInsertImage({
|
||||
insertRefNode: (data, nm, w) => {
|
||||
const id = uid('n')
|
||||
const spot = findSpot('ref')
|
||||
commitCanvas(refs.nodes.concat([{ id, type: 'ref', x: spot.x, y: spot.y, w: w || 280, data: { data: data, name: nm } }]), undefined, undefined)
|
||||
setSel([id])
|
||||
setNotice({ type: 'ok', text: '已插入封面图片' })
|
||||
showToast('已插入封面图片')
|
||||
},
|
||||
}, cover, name),
|
||||
copy: (text) => {
|
||||
try {
|
||||
const p = navigator.clipboard && navigator.clipboard.writeText(String(text || ''))
|
||||
@@ -8109,6 +8263,10 @@ const tbCenterSeed = (type, refs) => {
|
||||
} catch (e) { return { ok: false, error: '剪贴板不可用' } }
|
||||
},
|
||||
notify: (text, type) => { setNotice({ type: type === 'err' ? 'err' : 'ok', text: String(text || '') }); showToast(String(text || ''), type) },
|
||||
// v3.25.97:提示词封面 —— 图片走宿主内容寻址存储(images/plugin/prompt/),条目只存 ref。
|
||||
putCover: (u) => wPromptCoverPut(u),
|
||||
coverUrl: (r) => wPromptCoverUrl(r),
|
||||
removeCover: () => ({ ok: true }),
|
||||
})
|
||||
}
|
||||
if (window.IWBPluginGallery) window.IWBPluginGallery.setImpl({
|
||||
@@ -8159,13 +8317,10 @@ const tbCenterSeed = (type, refs) => {
|
||||
notify: (text, type) => { setNotice({ type: type === 'err' ? 'err' : 'ok', text: String(text || '') }); showToast(String(text || ''), type) },
|
||||
})
|
||||
}
|
||||
const dockPanels = {
|
||||
groups: { title: '节点组', icon: 'group', pluginId: 'grouplib', hint: '节点组插件未安装 · 设置 → 插件 → 市场安装' },
|
||||
browser: { title: '浏览器', icon: 'globe', pluginId: 'browser' },
|
||||
styles: { title: '风格库', icon: 'palette', pluginId: 'style-source' },
|
||||
prompts: { title: '提示词库', icon: 'book', pluginId: 'promptlib', hint: '提示词库插件未安装 · 设置 → 插件 → 市场安装' },
|
||||
gallery: { title: '图库', icon: 'ref', pluginId: 'gallery', hint: '图库插件未安装 · 设置 → 插件 → 市场安装' },
|
||||
}
|
||||
// v3.25.82:停靠栏面板清单(按插件启用过滤)在 src/ui-dock-panels.js
|
||||
const dockPanels = (typeof window !== 'undefined' && window.IWBUIDockPanels)
|
||||
? window.IWBUIDockPanels.build(PluginHost)
|
||||
: {}
|
||||
return el('div', { className: 'iwb-overlay' + (shellView === 'landing' ? ' iwb-view-landing' : shellView === 'home' ? ' iwb-view-home' : (shellView === 'plugins' ? ' iwb-view-plugins' : ' iwb-view-canvas')) + (drawerOpen ? ' drawer-open' : '') + ((nodes.length && loaded) ? ' has-minimap' : '') },
|
||||
// 页面加载动画(加载完成后淡出)
|
||||
!splashDone ? el('div', { className: 'iwb-splash' + (loaded ? ' iwb-splash-fade' : '') },
|
||||
@@ -8473,9 +8628,9 @@ 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), rightActive: drawerTab === 'history' ? 'gallery' : 'prompts',
|
||||
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' } },
|
||||
onReject: (msg) => showToast(msg, 'err') }) : null,
|
||||
settingOpen ? ReactDOM.createPortal(el(SettingsModal, {
|
||||
@@ -8795,6 +8950,11 @@ items.push(el('button', { key: 'bgc', className: 'iwb-ctx-item', onClick: (e) =>
|
||||
return {
|
||||
registerPanel: (panel) => {
|
||||
if (!panel || !panel.id || !panel.title || typeof panel.mount !== 'function') return false
|
||||
// v3.26.11:同一插件重复注册同一 id 时**替换**而不是追加(否则停靠栏会越点越多)
|
||||
for (let i = wPluginPanels.length - 1; i >= 0; i--) {
|
||||
const e = wPluginPanels[i]
|
||||
if (e && e.pluginId === ctx.id && e.id === String(panel.id)) wPluginPanels.splice(i, 1)
|
||||
}
|
||||
const entry = { id: String(panel.id), title: String(panel.title), icon: pluginIconOf(ctx.id) || panel.icon, mount: panel.mount, pluginId: ctx.id }
|
||||
wPluginPanels.push(entry)
|
||||
owned.push(entry)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 现状架构与性能事实基线(image-workbench-web)
|
||||
|
||||
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
|
||||
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = fb3a3f3`(线上 `v3.25.71+fb3a3f3` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--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 = c3bf835`(线上 `v3.26.28+c3bf835` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
|
||||
<!-- 2026-10-28 P1 拆分批 1:新增 src/generation-task-graph.js(5 个任务图纯函数自 app.js 迁出)
|
||||
⇒ 模块数 60→61、耦合面 51→52、sourceModules 60→61。耦合面只**新增** IWBWTaskGraph,无删除。
|
||||
2026-10-28 P1 拆分批 2:新增 src/storage-config-shape.js(9 个配置形状纯函数自 app.js 迁出)
|
||||
@@ -22,7 +22,7 @@
|
||||
- 图片**新写入主通道 = IndexedDB Blob `{__blob}` / key `imgblob_<hash>_<len>`** (A) `app.js:2143`;`{__cache}`(Cache Storage)为兜底;\`ref_\`(`app.js` 内定义的 `IDB_REF_PREFIX = 'ref_'`)为 legacy 形态 (A)。
|
||||
- 大图判定:`isBigDataUrl` = `data:` 且 `length > 3000` (A) `app.js:2018`;**画布保存保留阈值** `< 16384` 才原样保留 (A) `app.js:2182`。**两处阈值并存,含义不同**。
|
||||
- 单测是**源码契约测试**:`tests/` 目录共 **493** 处源码文本钉点(`source.includes` / `source.indexOf` / `/re/.test(source)`),分布在 **20** 个文件(其中 `iwb-v32-web-test.js` 一个就占 **407**)→ **结构性重构会先打红测试**。**该数字已由 `tests/source-text-ratchet-test.js` 的「只减不增」棘轮守门**(2026-10-20 起守卫范围从 1 个文件扩到全目录:新增任何一处源码文本钉点都会打红)。**2026-11-12 复算**(`npm run audit:pins`,v3.24.76):二分 STRUCT **417** / NAME **76**;形态 **POS 403 / NEG 87 / COUNT 3**;难度 **易 62 / 中 316 / 难 115**。钉点减法第一批(v3.24.72)把 **537 → 505**:8 条探针钉点改为「门禁内 spec 是否真的读该计数器」、5 条改为运行时断言(生产态 `window` 上无探针)、10 条改为 DOM 断言(质量档位禁用 / 传输页无三模式按钮 / 模型项 title)、4 条改为运行时对象断言(健康检查两域、策略对象冻结)、其余 9 条有同文件 DOM 等价断言或仅剩 NEG。第二批(v3.24.76)把 **505 → 493**:94-5~7 三条「多标签释放语义」(10 处正则)换成 `tests/iwb-tabs-release.spec.js` 的 3 条真 e2e,剩 1 条「消费方契约」(断言该 spec 在门禁内且 spec 源码真的读两个探针);另 2 条 `wPurgeIntent.add` 钉点改为读 `src/workspace-purge.js`。**这一批一换就查出 3 个真缺陷**(objectURL 从未释放 / 彻底删除留孤儿标签 · session / 刷新后误回收打开标签的图)—— 见 CHANGELOG v3.24.76。
|
||||
- `app.js` = 单 IIFE **8,508 行**(**双层预算**:绝对上限 8,700 / 占总源码 ≤ 40%,现 **36.8%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,998 行**(上限 **3,030**,余量 32;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **97** 个模块 / 14,607 行,`sourceModules` 97 项;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`(现 **104** 个模块 / 14,607 行,`sourceModules` 104 项;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` 不引用模块全局)。**97 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
|
||||
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**104 个模块中 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 耦合面(**82** 项)与 `sourceModules` 顺序(**97** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
|
||||
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**85** 项)与 `sourceModules` 顺序(**104** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
|
||||
|
||||
## 12. 易踩的坑
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
**信任模型(必须明示)**:形态 A 的插件是**可信代码**(与核心同权限、无沙箱);启停与设置是 UX 与可维护性手段,**不是安全边界**(同 §13.27 教训:前端开关一定可被绕过)。
|
||||
|
||||
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**82** 项)与 `sourceModules` 顺序(**97** 项);新增模块、新增耦合、新增 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 耦合面」(**85** 项)与 `sourceModules` 顺序(**104** 项);新增模块、新增耦合、新增 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 规则三的同一失败模式)。
|
||||
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
# 插件样式 / 停靠栏 / 图库:2026-11-21 事故复盘与经验
|
||||
|
||||
> 适用版本:v3.25.9x → v3.26.20;涉及插件:promptlib / gallery / grouplib / style-source。
|
||||
> 这份文档记录「为什么会坏、怎么定位、怎么修、回滚要注意什么」,下次遇到同类现象先读它。
|
||||
|
||||
## 1. 事故时间线(浓缩)
|
||||
|
||||
| 版本 | 做了什么 | 结果 |
|
||||
|---|---|---|
|
||||
| 3.25.97 | 提示词封面改用 `{__blob}` 引用 | 编辑里能看到、列表看不到,重启可能丢 |
|
||||
| 3.26.0 | 封面改为内联压缩 dataURL | 封面可见了,`prompts.json` 涨到 1.7MB |
|
||||
| 3.26.5 | 清理死代码 + 删失效 CSS | 误删 `.iwb-lib-cards` 瀑布流列规则(单列化) |
|
||||
| 3.26.6~3.26.9 | 市场缓存、启动层、键盘可达、CSP nonce 兜底 | **插件样式全丢**(提示词库/风格库/图库变裸 HTML) |
|
||||
| 3.26.10 | **整体回滚到 v3.26.5** + promptlib 回 1.4.0 内容(版本号 1.4.6) | 功能恢复,但回滚带回了 1.4.0 的单列 bug |
|
||||
| 3.26.11~3.26.14 | 面板去重、拖宽跟手、底色调平、图库铺满 | 逐步收敛 |
|
||||
| 3.26.15~3.26.20 | 选中态收敛、小地图避让、图库缩略图缓存、插件灰跟随主题 | 稳定 |
|
||||
|
||||
## 2. 五个真实根因(都验证过)
|
||||
|
||||
### 2.1 CSP nonce 会整段丢弃动态 `<style>`
|
||||
|
||||
- 桌面端 CSP 带 nonce;CSP3 下 `unsafe-inline` 被忽略。
|
||||
- 宿主/插件用 `document.createElement('style')` 注入样式时**没有 nonce** → `style.sheet === null`,`document.styleSheets` 里也没有它。
|
||||
- 症状极具迷惑性:插件 DOM 正常、宿主外链 CSS 正常,唯独插件样式全丢(卡片塌成色条、图片按原始尺寸铺满)。
|
||||
- 判定方法:页面里执行
|
||||
```js
|
||||
const s = document.createElement('style'); s.textContent = '.x{color:red}'; document.head.appendChild(s);
|
||||
s.sheet === null // true ⇒ 被 CSP 丢弃
|
||||
```
|
||||
- 修复:给动态 `<style>` 复制页面上已有 nonce:`node.setAttribute('nonce', document.querySelector('style[nonce],link[nonce]').nonce)`。
|
||||
- **注意**:后来 3.26.10 回滚后,用 v3.26.5 那套样式注入在 1.4.7 插件下显示正常——说明**并非所有注入路径都会触发**,与注入时机/上下文有关。结论:不要依赖单一假设,先用上面的判定法验证。
|
||||
|
||||
### 2.2 插件样式注入与激活存在竞态
|
||||
|
||||
- 宿主在 load 时把 CSS 暂存到 `pendingStyles[id]`,**激活插件时**才 `applyStyleFor(id)`。
|
||||
- 若插件已处于激活状态(热更新、切面板、拖拽重载),`applyStyleFor` 不会再执行 → 有 DOM 无样式。
|
||||
- 修复方向(二选一,最终都用了):
|
||||
1. 插件**自带样式**(把 CSS 内联进 bundle,脚本执行时注入);
|
||||
2. 宿主在激活时若 `pendingStyles` 为空,从磁盘补读一次再注入。
|
||||
|
||||
### 2.3 `registerPanel` 只 push 不替换 → 面板图标越拖越多
|
||||
|
||||
- 插件每次重新加载都会注册一次面板,宿主直接 `wPluginPanels.push(entry)`。
|
||||
- 重复 id 进入停靠栏状态 `iwb.dock.v1` 后,**重启也还在**;把右侧那份拖到左侧只会移动其中一份,所以“右边的不会消失”。
|
||||
- 修复(两层都要做,缺一不可):
|
||||
- 注册层:同 `pluginId + id` 先删除旧条目再插入;
|
||||
- 持久层:打开时同侧去重;同一 id 同时出现在左右两侧时只保留左侧;默认面板回填时跳过另一侧已存在的 id。
|
||||
|
||||
### 2.4 图库“要拖一下窗口才显示图片”
|
||||
|
||||
- 图库列宽由测得的面板宽度算出,而 `grid` 自身宽度又由列宽决定(`flex-start` + 内容宽度)。
|
||||
- 于是 `grid.clientWidth` 首帧为 0,之后**永远不会变化** → `ResizeObserver` 不触发 → 一直空白。
|
||||
- 修复:量**会随面板拉伸的外层容器**(`wrap` / 父节点),并加三重兜底:
|
||||
- 挂载后 rAF 连续重试(最多 40 帧);
|
||||
- 可见后(IntersectionObserver 命中)重测重排;
|
||||
- 120/400/900ms 各补一次。
|
||||
- 副作用:重排会重建 DOM,导致缩略图重复请求(每张图请求 N 次、部分一直“加载中”)。**必须配缩略图缓存 + 进行中 Promise 共享**(gallery 1.6.9)。
|
||||
|
||||
### 2.5 封面:引用 vs 内联
|
||||
|
||||
- `{__blob}`(IndexedDB 引用)跨会话/跨解析时序不可靠:编辑弹窗能看到(自己刚写的),列表与重启后丢失。
|
||||
- 内联 dataURL 可靠但撑大 `prompts.json`(33 条 1.7MB)。
|
||||
- 取舍:先用内联(≤448px WebP)保证“任何时候都看得见”,体积问题单独做迁移/文件型 ref 解决——**不要一次改动同时解决“可靠性 + 体积”**。
|
||||
|
||||
## 3. 回滚细节(最容易踩)
|
||||
|
||||
这次最终靠“回滚到 v3.26.5”才恢复,过程中有 4 个坑:
|
||||
|
||||
1. `git checkout v3.26.5 -- .` **只覆盖已存在的文件,不会删除新增文件**。必须补:
|
||||
```bash
|
||||
comm -13 <(git ls-tree -r --name-only v3.26.5 | sort) <(git ls-tree -r --name-only HEAD | sort) | xargs rm -f
|
||||
```
|
||||
2. **插件版本号必须大于线上版本**,否则市场“检查更新”不会降级。做法:内容回退到 1.4.0,但版本号标 **1.4.6**。
|
||||
3. **回滚会带回旧 bug**:1.4.0 清理 CSS 时误删过 `.iwb-lib-cards` 瀑布流规则,回滚后列表变单列。回滚后必须跑一遍 UI 冒烟(列表/图库/面板图标)。
|
||||
4. **回滚也要走完整发布仪式**:CHANGELOG 条目、`docs/standards/architecture-current-state.md` 的 `main = <sha>` 与 `线上 vX.Y.Z+<sha>` 锚点,否则 `verify:ci` 直接挂。
|
||||
|
||||
## 4. 定位工具(可复用)
|
||||
|
||||
宿主写一行探针,外部用 sqlite 读,不依赖 devtools:
|
||||
|
||||
```js
|
||||
// app.js 临时 effect(排查完必须删)
|
||||
localStorage.setItem('iwb_dbg', JSON.stringify({
|
||||
cards: document.querySelectorAll('.iwb-plp-card').length,
|
||||
sheets: document.styleSheets.length,
|
||||
styles: [...document.querySelectorAll('style')].map(n => (n.getAttribute('data-plugin') || 'host') + '|sheet=' + !!n.sheet),
|
||||
computed: (() => { const el = document.querySelector('.iwb-plp-card'); const st = el && getComputedStyle(el)
|
||||
return st ? { display: st.display, aspect: st.aspectRatio, border: st.borderTopWidth, w: el.getBoundingClientRect().width } : null })(),
|
||||
}))
|
||||
```
|
||||
|
||||
```bash
|
||||
python3 - <<'PY'
|
||||
import sqlite3, glob
|
||||
for d in glob.glob('/Users/qiqi/Library/WebKit/com.malongan.imageworkbench/WebsiteData/Default/*/*/LocalStorage/localstorage.sqlite3'):
|
||||
con = sqlite3.connect(d)
|
||||
for k, v in con.execute("select key,value from ItemTable where key='iwb_dbg'"):
|
||||
print(bytes(v).decode('utf-16-le','ignore'))
|
||||
PY
|
||||
```
|
||||
|
||||
关键判据:`sheet=false` ⇒ 样式没参与计算;`computed` 里 `display/aspect/border` 与预期不符 ⇒ 规则未命中;`w` 为 0 或明显大于容器 ⇒ 宽度测量问题。
|
||||
|
||||
## 5. 发布纪律(这次最大的教训)
|
||||
|
||||
| 规则 | 原因 |
|
||||
|---|---|
|
||||
| **一次发布只改一件事** | 3.26.6~3.26.9 把 5 个改动塞进连续 4 个版本,坏掉后无法二分定位,只能整体回滚 |
|
||||
| 改插件样式/布局后**先本机截图自检**,再请用户确认 | 很多问题在截图里一眼可见(单列、色条、白块) |
|
||||
| 改完跑 `npm run verify:ci`(exit 0 才算完) | ratchet / 耦合快照 / 文档锚点 / 插件主题契约都在里面 |
|
||||
| 保底手段是“小步回滚”,不是“继续叠加修复” | 连续 2 次猜错就停手回滚,别再加变量 |
|
||||
|
||||
## 6. 守门与快照清单(新增代码时容易忘)
|
||||
|
||||
- `MAX_APP_JS_LINES`:app.js 行数棘轮,新逻辑放 `src/<domain>-*.js`;确需增长要同步上调并写明理由。
|
||||
- `MAX_WORKBENCH_LINES`:`Workbench()` 行数上限。
|
||||
- 耦合面快照:新增 `window.IWB*` 导出后要 `IWB_WRITE_BOUNDARY_SNAPSHOT=1 node tests/architecture-boundary-guard-test.js`,并同步文档里的“耦合面 N 项”。
|
||||
- 插件主题契约:插件里禁止写死颜色;`color: #fff`(压在图片/渐变上的白字)已列入例外。
|
||||
- 文档锚点:每次 bump 版本后更新 `main = <sha>` 与 `线上 vX.Y.Z+<sha>`。
|
||||
|
||||
## 7. 一句话结论
|
||||
|
||||
> 插件样式出问题,先分清「CSS 没生效」还是「规则写错了」——用 `style.sheet` + `getComputedStyle` 两个判据,一次就能定位;
|
||||
> 发布时一次只动一件事,坏了好回滚;回滚后必须跑 UI 冒烟,因为回滚会带回旧 bug。
|
||||
|
||||
## 8. 第二批问题(3.26.21 – 3.26.27)
|
||||
|
||||
| # | 现象 | 根因 | 修法 |
|
||||
|---|---|---|---|
|
||||
| 1 | 封面单张 300KB,`prompts.json` 1.1MB | WebP 编码不可用时回退成 448px PNG | putCover 增加 JPEG 兜底(webp→jpeg→原图取小);实测 261KB |
|
||||
| 2 | 每次切面板都弹「已压缩 N 张封面」 | 迁移阈值按体积 60KB,JPEG 封面 75KB 永远命中 | 条件改为 PNG 或 >150KB,且只有内容变化才保存/提示 |
|
||||
| 3 | 更新/重启后左右栏摆放被打回默认 | 启动瞬间 panels 为空,整理逻辑删掉未注册 id 并写盘 | 不丢未注册 id;active 在 list 内则保持;面板为空不写盘 |
|
||||
| 4 | 重启后当前面板从提示词库变浏览器 | active 在未加载时被回退成 list[0] | 同上(保持 active) |
|
||||
| 5 | 图库部分格子永远“加载中…” | 重测会重建 DOM,缩略图被重复请求 | 缓存 URL + 共享 Promise + 微任务绘制 + 700ms 坏图快速失败 |
|
||||
| 6 | 插件主题契约“看起来全,实际只查 2 个文件” | 只扫 .js 且只统计含颜色声明的文件 | 扫 .js + .css 全量(8 个),补白字例外 |
|
||||
|
||||
### 8.1 停靠栏持久化的通用教训
|
||||
|
||||
持久化状态 + 异步依赖(插件/面板注册)组合时:
|
||||
|
||||
1. 清理只作用于渲染,不回写存储;未注册的 id 必须保留,等它加载。
|
||||
2. 写盘要有「依赖就绪」守卫,否则会用空集合覆盖用户数据。
|
||||
3. 变更检测用内容比较而不是长度比较——去重(-1) 与回填(+1) 同时发生时长度不变,旧实现会漏检。
|
||||
|
||||
### 8.2 插件市场设计约束(用户裁定)
|
||||
|
||||
- 卡片:淡描边可,不要位移/上浮;只允许颜色变化。
|
||||
- 已安装:名字后徽标;不要绿底、不要绿点。
|
||||
- 按钮:浅色底;已安装只保留移除,不要重装。
|
||||
- 管理页:横线分隔,不要块面卡片与浮动。
|
||||
- 设置页不要限宽,网格随窗口自适应。
|
||||
@@ -0,0 +1,60 @@
|
||||
# 插件主题契约(plugin-theme)
|
||||
|
||||
> 版本:v3.25.89 起。宿主与插件的**唯一**配色接口。
|
||||
> 目的:插件不再自己决定颜色,改一处(种子/滑块)全部插件跟着变。
|
||||
|
||||
## 1. 四层语义(插件面板必须分层)
|
||||
|
||||
| 语义 | Token | 亮色默认 | 用在哪 |
|
||||
|---|---|---|---|
|
||||
| 结构层 | `--iwb-dock-bg` | `#E2E4E6` | 停靠栏 / 标签条 / 状态栏(宿主自己的层) |
|
||||
| 插件面板 | `--iwb-plugin-surface` | `#FAFAFB` | 面板根容器(**不要用纯白**) |
|
||||
| 卡片 | `--iwb-plugin-card` | `#FFFFFF` | 面板里的卡片 / 列表项 |
|
||||
| 内嵌 | `--iwb-plugin-inset` | `#F6F7F8` | 输入框底 / 分组底 / 斑马纹 |
|
||||
| 悬停 | `--iwb-plugin-hover` | `#EEF1F4` | 行 / 卡片 hover |
|
||||
|
||||
## 2. 规则
|
||||
|
||||
1. **只用变量**:`--iwb-plugin-*` 或 `--iwb-*`,禁止写死 `#hex` / `rgba()`。
|
||||
(守门测试 `tests/plugin-theme-contract-test.js` 会卡)
|
||||
2. **面板根不画底色**:宿主已给 `--iwb-plugin-surface`;插件根容器只写 `background: var(--iwb-plugin-surface)`。
|
||||
3. **卡片才用 card**:列表项/卡片用 `--iwb-plugin-card`,这样「浅灰底 + 白卡片」的层次才成立。
|
||||
4. **文字层级**:主文字 `--iwb-plugin-text`,次要 `--iwb-plugin-text2`,品牌 `--iwb-plugin-brand`(底色上的字用 `--iwb-plugin-on-brand`,宿主按对比度自动黑/白)。
|
||||
5. **语义色**:错误 `--iwb-plugin-err`、成功 `--iwb-plugin-ok`、警告 `--iwb-plugin-warn`。
|
||||
|
||||
## 3. 作用域重映射(为什么插件不用改代码)
|
||||
|
||||
宿主在插件容器内把旧变量重指到插件层:
|
||||
|
||||
```css
|
||||
.iwb-dock-body, .iwb-node-body .iwb-plugin-body, .iwb-cwv-panel-body {
|
||||
--iwb-panel: var(--iwb-plugin-surface);
|
||||
--iwb-layer2: var(--iwb-plugin-card);
|
||||
--iwb-layer: var(--iwb-plugin-inset);
|
||||
--iwb-hover: var(--iwb-plugin-hover);
|
||||
}
|
||||
```
|
||||
|
||||
所以插件里已有的 `background: var(--iwb-layer2, #fff)` 会自动变成「卡片白」,
|
||||
`var(--iwb-layer, #f5f6f8)` 自动变成「内嵌灰」——**不需要重新打包插件**。
|
||||
|
||||
## 4. 批量调节
|
||||
|
||||
- 外观 → **插件面板 → 底色深浅**(0~30,默认 12)
|
||||
- 该值进入 `theme-tokens.js` 的 `pluginTint`,与 4 个种子一起派生
|
||||
- 改这一个滑块 = 所有插件面板同时变化
|
||||
|
||||
## 5. 新增插件时的自查
|
||||
|
||||
- [ ] 面板根:`background: var(--iwb-plugin-surface)`
|
||||
- [ ] 卡片:`background: var(--iwb-plugin-card)`
|
||||
- [ ] 输入框/内嵌块:`background: var(--iwb-plugin-inset)`
|
||||
- [ ] hover:`background: var(--iwb-plugin-hover)`
|
||||
- [ ] 没有任何 `#` 开头的颜色字面量(`var(--x, #hex)` 的兜底除外)
|
||||
|
||||
## 事故复盘(必读)
|
||||
|
||||
插件“有 DOM 没样式”、面板重复、图库首屏空白这一类问题的完整根因与定位方法见:`docs/standards/plugin-dock-incident-2026-11.md`。
|
||||
|
||||
- 先判断「CSS 没生效」还是「规则写错」:`style.sheet === null` ⇒ 没生效(CSP nonce / 注入时机)。
|
||||
- 插件只引用 `--iwb-plugin-*`,这些 token 由 `theme-tokens` 按主题派生(亮/暗自动切换)。
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.25.71",
|
||||
"version": "3.26.28",
|
||||
"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",
|
||||
"test:unit": "node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/plugin-data-test.js && node tests/plugin-loader-test.js && node tests/plugin-bundle-test.js && node tests/plugin-install-test.js && node tests/plugin-gallery-render-test.js && node tests/plugin-gallery-recovery-test.js && node tests/plugin-gallery-ux-test.js && node tests/plugin-grouplib-render-test.js && node tests/plugin-promptlib-render-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-workbench-hooks-test.js",
|
||||
"test:unit": "node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/plugin-data-test.js && node tests/plugin-loader-test.js && node tests/plugin-bundle-test.js && node tests/plugin-install-test.js && node tests/plugin-gallery-render-test.js && node tests/plugin-gallery-recovery-test.js && node tests/plugin-gallery-ux-test.js && node tests/plugin-grouplib-render-test.js && node tests/plugin-promptlib-render-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/plugin-theme-contract-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-test.js && node tests/ui-workbench-hooks-test.js",
|
||||
"test:diagnostics": "node tests/runtime-diagnostics-hotpath-test.js",
|
||||
"test:facts": "node tests/architecture-facts-guard-test.js && node tests/release-records-test.js",
|
||||
"plugins:gc": "node scripts/plugins-publish.mjs --gc",
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
|
||||
var cfg = Object.assign({}, DEF)
|
||||
var items = []
|
||||
var thumbCache = {}
|
||||
var thumbPending = {} // 进行中的缩略图请求(v1.6.9)
|
||||
var total = 0
|
||||
var limit = 100
|
||||
var picked = {}
|
||||
@@ -300,8 +302,9 @@
|
||||
var gap = 6
|
||||
var tileW = Math.max(40, Number(cfg.tile) || 110)
|
||||
var n = Math.max(1, Math.floor((gridW + gap) / (tileW + gap)))
|
||||
// 列宽 = min(图幅, 均分宽度):图幅是「显示宽度上限」,不再把单列拉满面板
|
||||
var colW = Math.min(tileW, (gridW - gap * (n - 1)) / n)
|
||||
// v1.6.6:列宽 = 均分宽度(铺满面板),图幅只决定「列数」——
|
||||
// 以前 min(图幅, 均分) 会留下右侧空白,看起来像没补齐。
|
||||
var colW = Math.max(40, (gridW - gap * (n - 1)) / n)
|
||||
var cols = []
|
||||
var heights = []
|
||||
for (var c = 0; c < n; c++) { cols.push([]); heights.push(0) }
|
||||
@@ -337,6 +340,7 @@
|
||||
box.appendChild(holder)
|
||||
var tries = 0
|
||||
function fail (text) {
|
||||
tries = 999
|
||||
holder.textContent = text || '缩略图加载失败(点击重试)'
|
||||
holder.style.cursor = 'pointer'
|
||||
holder.onclick = function () { failed[it.name] = 1; tries = 0; boot() }
|
||||
@@ -344,10 +348,24 @@
|
||||
updateFail()
|
||||
}
|
||||
function boot () {
|
||||
if (tries >= 999) return
|
||||
holder.style.cursor = ''
|
||||
holder.onclick = null
|
||||
holder.textContent = '加载中…'
|
||||
Promise.resolve(ctx.gallery.thumb(it.name)).then(function (url) {
|
||||
// v1.6.9:缩略图地址按名字缓存,且进行中的请求共享同一 Promise ——
|
||||
// 重排/重测会重建 DOM,不共享就会对同一张图重复取 N 次。
|
||||
var key = it.name
|
||||
if (thumbCache[key]) { var u0 = thumbCache[key]; Promise.resolve().then(function () { paint(u0) }).catch(function () { /* ignore */ }); return }
|
||||
if (!thumbPending[key]) {
|
||||
thumbPending[key] = Promise.resolve(ctx.gallery.thumb(key)).then(function (url) {
|
||||
if (url && typeof url === 'string') thumbCache[key] = url
|
||||
delete thumbPending[key]
|
||||
return url
|
||||
}, function (e) { delete thumbPending[key]; throw e })
|
||||
}
|
||||
thumbPending[key].then(paint).catch(function () { fail('缩略图加载失败(点击重试)') })
|
||||
}
|
||||
function paint (url) {
|
||||
if (!url || typeof url !== 'string') { fail('图片已丢失'); return }
|
||||
if (!box.isConnected) return
|
||||
var img = el('img', { src: url, alt: '', loading: 'lazy', draggable: 'true' })
|
||||
@@ -381,10 +399,18 @@
|
||||
})
|
||||
img.style.display = 'none'
|
||||
box.appendChild(img)
|
||||
// v1.6.9:坏图/超时兜底 —— 某些坏字节既不触发 load 也不触发 error,700ms 后直接判定失败(可点击重试)
|
||||
setTimeout(function () {
|
||||
try {
|
||||
if (!img.parentNode) return
|
||||
if (img.naturalWidth > 0) return
|
||||
if (img.parentNode === box) box.replaceChild(holder, img)
|
||||
fail('缩略图加载失败(点击重试)')
|
||||
} catch (e) { /* ignore */ }
|
||||
}, 700)
|
||||
// 加载成功后再替换占位(避免破图标 + 长 title 占满格子)
|
||||
if (img.complete && img.naturalWidth > 0) { img.style.display = ''; if (holder.parentNode === box) box.replaceChild(img, holder) }
|
||||
else if (img.complete && !img.naturalWidth) { /* 立即失败(坏图)*/ tries++; if (tries <= 2) setTimeout(boot, 400 * tries); else { if (img.parentNode === box) box.replaceChild(holder, img); fail('缩略图加载失败(点击重试)') } }
|
||||
}).catch(function () { fail('缩略图加载失败(点击重试)') })
|
||||
}
|
||||
boot()
|
||||
box.addEventListener('contextmenu', function (e) { openMenu(e, it) })
|
||||
@@ -443,13 +469,31 @@
|
||||
}
|
||||
|
||||
// 宽度测量:列数只由「面板宽 / 图幅」决定
|
||||
// v1.6.5:面板刚挂载时 grid 宽度可能是 0,而 grid 宽度又取决于列宽 → RO 不会触发,图库一直空白。
|
||||
function availableW () {
|
||||
// v1.6.6:优先量「会随面板拉伸的外层容器」,而不是 grid 自身
|
||||
// (grid 现在是 flex-start + 内容宽度,面板变宽它不会变宽 → RO 不触发 → 列数永不补齐)
|
||||
var w = wrap ? wrap.clientWidth : 0
|
||||
if (!w && wrap && wrap.parentNode) w = wrap.parentNode.clientWidth
|
||||
if (!w) w = grid.clientWidth
|
||||
return w || 0
|
||||
}
|
||||
function measure () {
|
||||
var w = grid.clientWidth
|
||||
var w = availableW()
|
||||
if (w > 0 && Math.abs(w - gridW) > 1) { gridW = w; renderGrid() }
|
||||
}
|
||||
var ro = typeof ResizeObserver === 'function' ? new ResizeObserver(function () { measure() }) : null
|
||||
if (ro) ro.observe(grid)
|
||||
if (ro) { if (wrap) ro.observe(wrap); if (wrap && wrap.parentNode) ro.observe(wrap.parentNode); ro.observe(grid) }
|
||||
measure()
|
||||
var tries = 0
|
||||
function retry () {
|
||||
if (gridW > 0 || tries++ > 40) { if (gridW <= 0) { gridW = Math.max(160, Number(cfg.tile) || 110) * 2; renderGrid() } return }
|
||||
measure()
|
||||
if (gridW <= 0) global.requestAnimationFrame(retry)
|
||||
}
|
||||
global.requestAnimationFrame(retry)
|
||||
// v1.6.7:再补几次延时重测(停靠栏展开动画、首帧布局未完成时能在 1s 内自愈)
|
||||
;[120, 400, 900].forEach(function (ms) { setTimeout(function () { try { measure(); if (gridW > 0) renderGrid() } catch (e) { /* ignore */ } }, ms) })
|
||||
|
||||
// v1.3.0:自动恢复 —— 面板重新可见(切回 tab / 窗口聚焦 / 后台回来)且距上次拉取 >5s 时重拉一次,
|
||||
// 这样图床恢复、后台补图后不必手动刷新;同时保留底部「刷新」按钮做即时重试。
|
||||
@@ -461,7 +505,13 @@
|
||||
try {
|
||||
if (typeof IntersectionObserver === 'function') {
|
||||
var io = new IntersectionObserver(function (entries) {
|
||||
for (var i = 0; i < entries.length; i++) if (entries[i].isIntersecting) autoRefresh()
|
||||
for (var i = 0; i < entries.length; i++) {
|
||||
if (entries[i].isIntersecting) {
|
||||
// v1.6.7:面板真正可见后再量一次宽度并重排(首帧可能还是 0 宽)
|
||||
try { measure(); renderGrid() } catch (e) { /* ignore */ }
|
||||
autoRefresh()
|
||||
}
|
||||
}
|
||||
}, { threshold: 0.15 })
|
||||
io.observe(wrap)
|
||||
}
|
||||
@@ -488,7 +538,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'gallery',
|
||||
name: '图库',
|
||||
version: '1.6.3',
|
||||
version: '1.6.9',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'gallery'],
|
||||
data: { schemaVersion: 1, maxBytes: 65536 },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "gallery",
|
||||
"name": "图库",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.9",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -13,7 +13,7 @@
|
||||
"图库"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "6628f9aa5be68e0ed798244a1fd4405e50801181e6c0779b22a0723f84309865",
|
||||
"styles.css": "81b23c43b0308c678bf95e00d6663abcb8b300242ab952ca56b1390fd74bb53e"
|
||||
"main.js": "26c7e64b3a0021c6b9514dfb84d4d2580276698222b4791cfa99f22ead66ff52",
|
||||
"styles.css": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0"
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@
|
||||
*/
|
||||
|
||||
/* ---- 面板留白:边缘收小,避免窄栏里浪费空间 ---- */
|
||||
.iwb-history-embedded { padding: 8px 8px 6px; gap: 6px; }
|
||||
.iwb-history-embedded .iwb-history-grid { gap: 6px; padding: 0 0 4px; justify-content: center; }
|
||||
.iwb-history-embedded { padding: 6px 6px 4px; gap: 6px; }
|
||||
.iwb-history-embedded .iwb-history-grid { gap: 6px; padding: 0 0 2px; justify-content: flex-start; }
|
||||
/* 列宽由插件按「图幅」写死(style width),这里禁用宿主的 flex:1 拉伸 */
|
||||
.iwb-history-embedded .iwb-history-col { flex: 0 0 auto; gap: 6px; }
|
||||
|
||||
|
||||
@@ -335,12 +335,14 @@
|
||||
items.forEach(function (g) {
|
||||
var isEditing = editing === g.id
|
||||
var card = el('div', {
|
||||
class: 'iwb-pcard' + (isEditing ? ' iwb-pcard-editing' : '') + (manage && picked[g.id] ? ' iwb-pcard-selected' : ''),
|
||||
class: 'iwb-glp-card iwb-pcard' + (isEditing ? ' iwb-pcard-editing' : '') + (manage && picked[g.id] ? ' iwb-pcard-selected' : ''),
|
||||
'data-manage': manage ? '1' : '0',
|
||||
draggable: isEditing ? 'false' : 'true',
|
||||
title: manage ? '单击选中 · 右上「移动到分组」' : '双击改名 · 拖到画布实例化 · 右键移动到分组',
|
||||
})
|
||||
card.addEventListener('dragstart', function (e) {
|
||||
if (isEditing) return
|
||||
try { card.classList.add('iwb-glp-dragging') } catch (err) { /* ignore */ }
|
||||
try {
|
||||
e.stopPropagation()
|
||||
e.dataTransfer.setData('application/x-iwb-group', JSON.stringify(g.id))
|
||||
@@ -348,6 +350,9 @@
|
||||
e.dataTransfer.effectAllowed = 'copy'
|
||||
} catch (err) { /* ignore */ }
|
||||
})
|
||||
card.addEventListener('dragend', function () {
|
||||
try { card.classList.remove('iwb-glp-dragging') } catch (err) { /* ignore */ }
|
||||
})
|
||||
card.addEventListener('contextmenu', function (e) {
|
||||
if (manage) { e.preventDefault(); picked[g.id] = picked[g.id] ? 0 : 1; render(); return }
|
||||
openMenu(e, g)
|
||||
@@ -413,7 +418,7 @@
|
||||
: (list.length
|
||||
? '当前分组下没有节点组(共 ' + list.length + ' 个,切到「全部」查看)'
|
||||
: '宿主返回 0 个收藏节点组。画布编组后点组右上角「收藏」,或用右键菜单「收藏选中节点」。')
|
||||
scrollBox.appendChild(el('div', { class: 'iwb-hint', text: hint }))
|
||||
scrollBox.appendChild(el('div', { class: 'iwb-hint iwb-glp-empty', text: hint }))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +439,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'grouplib',
|
||||
name: '节点组',
|
||||
version: '1.0.3',
|
||||
version: '1.0.4',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'grouplib'],
|
||||
data: { schemaVersion: 1, maxBytes: 65536 },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "grouplib",
|
||||
"name": "节点组",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -13,7 +13,7 @@
|
||||
"节点组"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "748b23798c5a0a3ffc0d124f2904439f41345e5064b043ffd7980cd14a6f05ee",
|
||||
"styles.css": "932dbf2723bd0c6bab274786784e92a1acd1dd6b4d5246c06d2240efa25d2507"
|
||||
"main.js": "8cb2e39f9880d49c9b9c15a1f7d62d9772170c8d0eac0faaa237bb7056af34ff",
|
||||
"styles.css": "ee6e292ffebdcc1351651bf7937399128ae06e0b364624792f34111866f9355b"
|
||||
}
|
||||
}
|
||||
@@ -15,3 +15,28 @@
|
||||
flex: 0 0 auto;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
/* v1.0.4(2026-11-21):卡片交互态 + 空态 + 拖拽反馈。
|
||||
颜色只走宿主 token(--iwb-plugin-* / --iwb-*),不写死。 */
|
||||
.iwb-glp-card { transition: background .12s ease, border-color .12s ease; }
|
||||
.iwb-glp-card .iwb-pname { font-weight: 600; }
|
||||
/* 删除按钮:平时隐藏,悬停/键盘聚焦才出现,减少视觉噪音 */
|
||||
.iwb-glp-card .iwb-pbtns { opacity: 0; transition: opacity .12s ease; }
|
||||
.iwb-glp-card:hover .iwb-pbtns,
|
||||
.iwb-glp-card:focus-within .iwb-pbtns { opacity: 1; }
|
||||
/* 管理模式的选中标记:右上角圆点 */
|
||||
.iwb-glp-card[data-manage="1"]::after {
|
||||
content: ''; position: absolute; right: 8px; top: 8px; width: 12px; height: 12px;
|
||||
border-radius: 50%; border: 1.5px solid var(--iwb-border2, #b9bfca); background: transparent;
|
||||
}
|
||||
.iwb-glp-card[data-manage="1"].iwb-pcard-selected::after {
|
||||
background: var(--iwb-brand, #6b7280); border-color: var(--iwb-brand, #6b7280);
|
||||
}
|
||||
/* 拖拽中:半透明 + 轻微缩放,明确"正在搬运" */
|
||||
.iwb-glp-dragging { opacity: .55; }
|
||||
/* 空态:虚线框 */
|
||||
.iwb-glp-empty {
|
||||
margin: 4px 0; padding: 14px 12px; border-radius: 10px; text-align: center;
|
||||
border: 1px dashed var(--iwb-border2, #b9bfca); color: var(--iwb-text2, #4d5668);
|
||||
font-size: 12px; line-height: 1.7;
|
||||
}
|
||||
@@ -22,10 +22,10 @@
|
||||
"dir": "gallery",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.9",
|
||||
"files": {
|
||||
"main.js": "6628f9aa5be68e0ed798244a1fd4405e50801181e6c0779b22a0723f84309865",
|
||||
"styles.css": "81b23c43b0308c678bf95e00d6663abcb8b300242ab952ca56b1390fd74bb53e"
|
||||
"main.js": "26c7e64b3a0021c6b9514dfb84d4d2580276698222b4791cfa99f22ead66ff52",
|
||||
"styles.css": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -33,10 +33,10 @@
|
||||
"dir": "grouplib",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"files": {
|
||||
"main.js": "748b23798c5a0a3ffc0d124f2904439f41345e5064b043ffd7980cd14a6f05ee",
|
||||
"styles.css": "932dbf2723bd0c6bab274786784e92a1acd1dd6b4d5246c06d2240efa25d2507"
|
||||
"main.js": "8cb2e39f9880d49c9b9c15a1f7d62d9772170c8d0eac0faaa237bb7056af34ff",
|
||||
"styles.css": "ee6e292ffebdcc1351651bf7937399128ae06e0b364624792f34111866f9355b"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -44,10 +44,10 @@
|
||||
"dir": "promptlib",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.0.1",
|
||||
"version": "1.4.10",
|
||||
"files": {
|
||||
"main.js": "ce2d1347b8b61a75f16a54a96f16861066c6ca70add314216c33ba95b2eb2d60",
|
||||
"styles.css": "2bce24d4fde9014b674397d94bbf5cdc6825ca600e3e942c057efa6b47f350ad"
|
||||
"main.js": "75dc31dc6270aa10e73c90eeb09bb349a949d17c39940574e28f12c5e463ceaf",
|
||||
"styles.css": "cc71e071379c84131e525afeaa5757674f499da195ccb42536c019a3ef5d8473"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
var groups = []
|
||||
var query = ''
|
||||
var filter = 'all'
|
||||
var expanded = {}
|
||||
var coverCache = {}
|
||||
var managerOpen = false
|
||||
var modalHost = null
|
||||
var loadError = ''
|
||||
@@ -101,10 +101,45 @@
|
||||
prompts = (r && r.prompts) || []
|
||||
groups = (r && r.groups) || []
|
||||
render()
|
||||
slimCovers()
|
||||
return true
|
||||
}).catch(function (e) { loadError = '读取失败:' + ((e && e.message) || e); prompts = []; render(); return false })
|
||||
}
|
||||
|
||||
// v1.4.0:一次性瘦身 —— 老版本把封面存成 768px(≈50KB/张)。
|
||||
// 现在上限 448px,检测到超大封面就重新压一遍并保存一次(每个会话最多一次)。
|
||||
var slimDone = false
|
||||
function slimCovers () {
|
||||
if (slimDone) return
|
||||
slimDone = true
|
||||
// v1.4.9:除了 >60KB 的,也把老版本存成 PNG 的封面重压一次(448px PNG 仍有 300KB+)
|
||||
var big = prompts.filter(function (p) {
|
||||
var c = p && p.cover
|
||||
if (typeof c !== 'string' || c.indexOf('data:') !== 0) return false
|
||||
// v1.4.10:阈值提到 150KB,且只在 PNG(体积虚高)时迁移 —— 否则 JPEG 封面每次挂载都会被再压一次
|
||||
return c.length > 150000 || c.indexOf('data:image/png') === 0
|
||||
})
|
||||
if (!big.length) return
|
||||
var next = prompts.slice()
|
||||
var i = 0
|
||||
var changed = false
|
||||
function step () {
|
||||
if (i >= big.length) {
|
||||
if (changed) save(next).then(function () { notify('已压缩 ' + big.length + ' 张封面') }).catch(function () { /* ignore */ })
|
||||
return
|
||||
}
|
||||
var p = big[i++]
|
||||
Promise.resolve(api.putCover(p.cover)).then(function (r) {
|
||||
if (r && r.ok && r.ref && String(r.ref).length < p.cover.length) {
|
||||
next = next.map(function (x) { return x.id === p.id ? Object.assign({}, x, { cover: r.ref }) : x })
|
||||
changed = true
|
||||
}
|
||||
step()
|
||||
}).catch(function () { step() })
|
||||
}
|
||||
step()
|
||||
}
|
||||
|
||||
// ---- 搜索 / 过滤 ----
|
||||
function words () { return query.trim().toLowerCase().split(/\s+/).filter(Boolean) }
|
||||
function matches (p) {
|
||||
@@ -147,100 +182,7 @@
|
||||
|
||||
// ---- 编辑面板(窄栏用浮层,宽栏并排无必要;统一浮层,行为可预测) ----
|
||||
var editor = null
|
||||
function openEditor (p) {
|
||||
closeEditor()
|
||||
var isNew = !p
|
||||
var draft = p ? Object.assign({}, p) : { id: uid('q'), name: '', text: '', tags: [], group: (filter === 'all' || filter === '__none__') ? '' : filter }
|
||||
var mask = el('div', { class: 'iwb-modal-mask iwb-promptlib-editor-mask' })
|
||||
var card = el('div', { class: 'iwb-modal iwb-promptlib-editor' })
|
||||
var head = el('div', { class: 'iwb-modal-head' })
|
||||
head.appendChild(el('span', { class: 'iwb-toolbar-title', text: isNew ? '新建提示词' : '编辑提示词' }))
|
||||
var x = el('button', { class: 'iwb-btn iwb-btn-sm', title: '关闭', text: '✕' })
|
||||
x.addEventListener('click', closeEditor)
|
||||
head.appendChild(x)
|
||||
var bodyEl = el('div', { class: 'iwb-modal-body' })
|
||||
|
||||
var nameIn = el('input', { class: 'iwb-input', placeholder: '名称(留空自动取正文前 8 字)', value: draft.name || '' })
|
||||
var dlId = 'iwb-pl-groups-' + Math.random().toString(36).slice(2, 7)
|
||||
var groupIn = el('input', { class: 'iwb-input', placeholder: '分组(可留空)', value: draft.group || '' })
|
||||
groupIn.setAttribute('list', dlId)
|
||||
var tagsIn = el('input', { class: 'iwb-input', placeholder: '标签,逗号分隔', value: (draft.tags || []).join(', ') })
|
||||
var textIn = el('textarea', { class: 'iwb-input iwb-promptlib-text', placeholder: '提示词正文' })
|
||||
textIn.value = draft.text || ''
|
||||
var dl = el('datalist')
|
||||
dl.setAttribute('id', dlId)
|
||||
groupsOf().forEach(function (g) { dl.appendChild(el('option', { value: g.name })) })
|
||||
|
||||
bodyEl.appendChild(el('label', { class: 'iwb-promptlib-row' }, el('span', { text: '名称' }), nameIn))
|
||||
bodyEl.appendChild(el('label', { class: 'iwb-promptlib-row' }, el('span', { text: '分组' }), groupIn))
|
||||
bodyEl.appendChild(el('label', { class: 'iwb-promptlib-row' }, el('span', { text: '标签' }), tagsIn))
|
||||
bodyEl.appendChild(textIn)
|
||||
bodyEl.appendChild(dl)
|
||||
|
||||
var foot = el('div', { class: 'iwb-row iwb-promptlib-foot' })
|
||||
var delBtn = isNew ? null : el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-danger', title: '删除这条提示词', text: '删除' })
|
||||
var dupBtn = isNew ? null : el('button', { class: 'iwb-btn iwb-btn-sm', title: '以当前内容另存一条', text: '另存副本' })
|
||||
var insertBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '插入到画布', text: '插入画布' })
|
||||
var saveBtn = el('button', { class: 'iwb-btn iwb-btn-primary', text: isNew ? '创建' : '保存' })
|
||||
if (delBtn) {
|
||||
delBtn.addEventListener('click', function () {
|
||||
ask('删除提示词「' + (draft.name || '未命名') + '」?', { title: '删除提示词', okText: '删除' }).then(function (ok) {
|
||||
if (!ok) return
|
||||
closeEditor()
|
||||
var list = prompts.filter(function (x) { return x.id !== draft.id })
|
||||
save(list).then(function () { notify('已删除') })
|
||||
})
|
||||
})
|
||||
foot.appendChild(delBtn)
|
||||
}
|
||||
if (dupBtn) {
|
||||
dupBtn.addEventListener('click', function () {
|
||||
var copy = Object.assign({}, collect(), { id: uid('q'), name: ((nameIn.value || draft.name || '提示词').trim()) + ' 副本' })
|
||||
closeEditor()
|
||||
save(prompts.concat([copy])).then(function () { notify('已另存副本') })
|
||||
})
|
||||
foot.appendChild(dupBtn)
|
||||
}
|
||||
insertBtn.addEventListener('click', function () {
|
||||
var c = collect()
|
||||
var text = String(c.text || '').trim()
|
||||
if (!text) { notify('提示词内容不能为空', 'err'); return }
|
||||
Promise.resolve(api.insert(text, c.name)).then(function () { notify('已插入画布:' + (c.name || '提示词')) }).catch(function () { notify('插入画布失败', 'err') })
|
||||
})
|
||||
saveBtn.addEventListener('click', function () {
|
||||
var c = collect()
|
||||
var text = String(c.text || '').trim()
|
||||
if (!text) { notify('提示词内容不能为空', 'err'); return }
|
||||
var name = String(c.name || '').trim() || ('提示词 ' + text.slice(0, 8) + '…')
|
||||
var item = { id: c.id, name: name, text: text, tags: c.tags, group: String(c.group || '').trim() }
|
||||
var list = isNew ? prompts.concat([item]) : prompts.map(function (x) { return x.id === item.id ? item : x })
|
||||
var gs = groupsOf().slice()
|
||||
if (item.group && !gs.some(function (g) { return g.name === item.group })) gs.push({ id: item.group, name: item.group })
|
||||
closeEditor()
|
||||
save(list, gs).then(function () { notify(isNew ? '已创建' : '已保存') })
|
||||
})
|
||||
foot.appendChild(el('span', { class: 'iwb-drawer-spacer' }))
|
||||
foot.appendChild(insertBtn)
|
||||
foot.appendChild(saveBtn)
|
||||
bodyEl.appendChild(foot)
|
||||
|
||||
function collect () {
|
||||
return {
|
||||
id: draft.id,
|
||||
name: nameIn.value,
|
||||
group: groupIn.value,
|
||||
tags: String(tagsIn.value || '').split(',').map(function (s) { return s.trim() }).filter(Boolean),
|
||||
text: textIn.value,
|
||||
}
|
||||
}
|
||||
mask.addEventListener('pointerdown', function (e) { if (e.target === mask) closeEditor() })
|
||||
mask.addEventListener('wheel', function (e) { e.stopPropagation() })
|
||||
card.appendChild(head); card.appendChild(bodyEl)
|
||||
mask.appendChild(card)
|
||||
document.body.appendChild(mask)
|
||||
editor = { mask: mask }
|
||||
setTimeout(function () { try { (isNew ? textIn : nameIn).focus() } catch (e) { /* ignore */ } }, 0)
|
||||
}
|
||||
function closeEditor () {
|
||||
if (editor && editor.mask && editor.mask.parentNode) editor.mask.parentNode.removeChild(editor.mask)
|
||||
editor = null
|
||||
@@ -374,7 +316,7 @@
|
||||
var sep = el('div', { class: 'iwb-ctx-sep' })
|
||||
menu.appendChild(sep)
|
||||
var ed = el('button', { class: 'iwb-ctx-item', text: '编辑…' })
|
||||
ed.addEventListener('click', function () { closeMenu(); openEditor(p) })
|
||||
ed.addEventListener('click', function () { closeMenu(); openEditModal(p, false) })
|
||||
menu.appendChild(ed)
|
||||
document.body.appendChild(menu)
|
||||
menuEl = menu
|
||||
@@ -389,6 +331,264 @@
|
||||
var wrap = el('div', { class: 'iwb-lib-embedded iwb-promptlib' }, body)
|
||||
host.appendChild(wrap)
|
||||
|
||||
|
||||
// ---- v1.1.0:封面 + 详情 ----
|
||||
var coverPending = {}
|
||||
function coverOf (p) {
|
||||
if (!p || !p.cover) return ''
|
||||
var ck = (p.cover && typeof p.cover === 'object') ? ('b:' + String(p.cover.__blob || p.cover.__cache || 'obj')) : ('s:' + String(p.cover).slice(-32))
|
||||
var key = p.id + '|' + ck
|
||||
var hit = coverCache[key]
|
||||
if (hit) return hit
|
||||
// 只缓存成功结果;失败/未解析的下一帧会再试(之前缓存空串导致封面永远不刷新)
|
||||
if (!coverPending[key]) {
|
||||
coverPending[key] = 1
|
||||
try {
|
||||
Promise.resolve(api.coverUrl(p.cover)).then(function (r) {
|
||||
delete coverPending[key]
|
||||
if (r && r.ok && r.url) { coverCache[key] = r.url; render() }
|
||||
}).catch(function () { delete coverPending[key] })
|
||||
} catch (e) { delete coverPending[key] }
|
||||
}
|
||||
return ''
|
||||
}
|
||||
function gradOf (p) {
|
||||
var str = String((p && (p.group || p.name)) || 'x')
|
||||
var h = 0
|
||||
for (var i = 0; i < str.length; i++) h = (h * 31 + str.charCodeAt(i)) % 360
|
||||
return 'linear-gradient(135deg, hsl(' + h + ' 52% 66%), hsl(' + ((h + 36) % 360) + ' 52% 44%))'
|
||||
}
|
||||
function openDetail (id) { view.mode = 'detail'; view.id = String(id || ''); render(); try { scrollBox.scrollTop = 0 } catch (e) { /* ignore */ } }
|
||||
function backToList () { view.mode = 'list'; view.id = ''; render() }
|
||||
|
||||
|
||||
|
||||
// ===== v1.2.0:可拖动 / 可缩放弹窗(详情 & 编辑)=====
|
||||
function readDlg (key, w, h) {
|
||||
try {
|
||||
var raw = global.localStorage.getItem('iwb_plp_dlg_' + key)
|
||||
if (raw) { var o = JSON.parse(raw); if (o && o.w && o.h) return o }
|
||||
} catch (e) { /* ignore */ }
|
||||
var vw = global.innerWidth || 1440
|
||||
var vh = global.innerHeight || 900
|
||||
var W = Math.min(w, vw - 80), H = Math.min(h, vh - 80)
|
||||
return { x: Math.round((vw - W) / 2), y: Math.round((vh - H) / 2), w: W, h: H }
|
||||
}
|
||||
function saveDlg (key, o) { try { global.localStorage.setItem('iwb_plp_dlg_' + key, JSON.stringify(o)) } catch (e) { /* ignore */ } }
|
||||
|
||||
function openDialog (opts) {
|
||||
var key = opts.key
|
||||
var box = readDlg(key, opts.width || 880, opts.height || 640)
|
||||
var mask = el('div', { class: 'iwb-modal-mask iwb-plp-mask' })
|
||||
var card = el('div', { class: 'iwb-modal iwb-plp-dialog iwb-plp-dialog-' + key })
|
||||
card.style.position = 'fixed'; card.style.margin = '0'
|
||||
var head = el('div', { class: 'iwb-plp-dhead iwb-plp-dragh' })
|
||||
var grip = el('span', { class: 'iwb-plp-grip', title: '按住拖动' })
|
||||
for (var gi = 0; gi < 6; gi++) grip.appendChild(el('i'))
|
||||
head.appendChild(grip)
|
||||
head.appendChild(el('span', { class: 'iwb-toolbar-title', text: opts.title || '' }))
|
||||
head.appendChild(el('span', { class: 'iwb-drawer-spacer' }))
|
||||
;(opts.actions || []).forEach(function (b) { head.appendChild(b) })
|
||||
var bodyEl = el('div', { class: 'iwb-plp-dbody' })
|
||||
var footEl = el('div', { class: 'iwb-plp-dfooter' })
|
||||
var grip2 = el('div', { class: 'iwb-plp-resize', title: '拖动调整大小' })
|
||||
card.appendChild(head); card.appendChild(bodyEl); card.appendChild(footEl); card.appendChild(grip2)
|
||||
mask.appendChild(card)
|
||||
document.body.appendChild(mask)
|
||||
var live = { x: box.x, y: box.y, w: box.w, h: box.h }
|
||||
function apply () {
|
||||
card.style.left = live.x + 'px'; card.style.top = live.y + 'px'
|
||||
card.style.width = live.w + 'px'; card.style.height = live.h + 'px'
|
||||
}
|
||||
head.addEventListener('pointerdown', function (e) {
|
||||
if (e.target && e.target.tagName === 'BUTTON') return
|
||||
e.preventDefault(); e.stopPropagation()
|
||||
var sx = e.clientX, sy = e.clientY, ox = live.x, oy = live.y
|
||||
function mv (ev) {
|
||||
var vw = global.innerWidth || 1440, vh = global.innerHeight || 900
|
||||
live.x = Math.max(-live.w + 120, Math.min(vw - 120, ox + ev.clientX - sx))
|
||||
live.y = Math.max(0, Math.min(vh - 60, oy + ev.clientY - sy))
|
||||
apply()
|
||||
}
|
||||
function up () { global.removeEventListener('pointermove', mv); global.removeEventListener('pointerup', up); saveDlg(key, live) }
|
||||
global.addEventListener('pointermove', mv); global.addEventListener('pointerup', up)
|
||||
})
|
||||
grip2.addEventListener('pointerdown', function (e) {
|
||||
e.preventDefault(); e.stopPropagation()
|
||||
var sx = e.clientX, sy = e.clientY, ow = live.w, oh = live.h
|
||||
function mv (ev) {
|
||||
live.w = Math.max(640, Math.min((global.innerWidth || 1440) - 40, ow + ev.clientX - sx))
|
||||
live.h = Math.max(420, Math.min((global.innerHeight || 900) - 40, oh + ev.clientY - sy))
|
||||
apply()
|
||||
}
|
||||
function up () { global.removeEventListener('pointermove', mv); global.removeEventListener('pointerup', up); saveDlg(key, live) }
|
||||
global.addEventListener('pointermove', mv); global.addEventListener('pointerup', up)
|
||||
})
|
||||
mask.addEventListener('pointerdown', function (e) { if (e.target === mask) close() })
|
||||
function onKey (e) {
|
||||
if (e.key === 'Escape') { e.stopPropagation(); close() } else if ((e.metaKey || e.ctrlKey) && e.key === 'Enter' && opts.onSaveKey) { e.preventDefault(); opts.onSaveKey() }
|
||||
}
|
||||
function close () {
|
||||
saveDlg(key, live)
|
||||
if (mask.parentNode) mask.parentNode.removeChild(mask)
|
||||
document.removeEventListener('keydown', onKey, true)
|
||||
}
|
||||
document.addEventListener('keydown', onKey, true)
|
||||
opts.build(bodyEl, footEl, close)
|
||||
apply()
|
||||
return { close: close, card: card, body: bodyEl, foot: footEl }
|
||||
}
|
||||
|
||||
function paintCoverInto (node, p) {
|
||||
node.textContent = ''
|
||||
var url = p && p._coverUrl ? p._coverUrl : coverOf(p)
|
||||
node.style.background = url ? 'var(--iwb-plugin-inset)' : gradOf(p)
|
||||
if (url) node.appendChild(el('img', { class: 'iwb-plp-cover', src: url, alt: '' }))
|
||||
}
|
||||
|
||||
function openDetailModal (p) {
|
||||
var edit = el('button', { class: 'iwb-btn iwb-btn-sm', text: '编辑' })
|
||||
var closeBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '关闭', text: '✕' })
|
||||
var dlg = openDialog({
|
||||
key: 'detail',
|
||||
title: p.name || '未命名',
|
||||
width: 880, height: 640,
|
||||
actions: [edit, closeBtn],
|
||||
build: function (bodyEl, footEl) {
|
||||
var cov = el('div', { class: 'iwb-plp-dcov' })
|
||||
paintCoverInto(cov, p)
|
||||
var right = el('div', { class: 'iwb-plp-dright' })
|
||||
right.appendChild(el('div', { class: 'iwb-hint', text: [p.group || '未分组'].concat(p.tags || []).join(' · ') + ' · ' + String(p.text || '').length + ' 字' }))
|
||||
var txt = el('div', { class: 'iwb-plp-dtext', text: p.text || '' })
|
||||
right.appendChild(txt)
|
||||
bodyEl.appendChild(cov); bodyEl.appendChild(right)
|
||||
var del = el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-danger', text: '删除' })
|
||||
var cp = el('button', { class: 'iwb-btn iwb-btn-sm', text: '复制全文' })
|
||||
var ins = el('button', { class: 'iwb-btn iwb-btn-sm', text: '插入画布' })
|
||||
del.addEventListener('click', function () {
|
||||
ask('删除提示词「' + (p.name || '未命名') + '」?', { title: '删除提示词', okText: '删除' }).then(function (ok) {
|
||||
if (!ok) return
|
||||
dlg.close()
|
||||
save(prompts.filter(function (x) { return x.id !== p.id })).then(function () { notify('已删除') })
|
||||
})
|
||||
})
|
||||
cp.addEventListener('click', function () { Promise.resolve(api.copy(p.text || '')).then(function (r) { if (r && r.ok === false) notify('复制失败', 'err'); else notify('已复制全文') }) })
|
||||
ins.addEventListener('click', function () { Promise.resolve(api.insert(p.text || '', p.name || '')).then(function () { notify('已插入画布:' + (p.name || '提示词')); dlg.close() }).catch(function () { notify('插入画布失败', 'err') }) })
|
||||
var insImg = null
|
||||
if (p.cover) {
|
||||
insImg = el('button', { class: 'iwb-btn iwb-btn-sm', title: '把这条提示词的封面作为参考图插入画布', text: '插入图片' })
|
||||
insImg.addEventListener('click', function () {
|
||||
Promise.resolve(api.insertImage(p.cover, p.name || '')).then(function (r) {
|
||||
if (r && r.ok === false) { notify((r && r.error) || '插入封面失败', 'err'); return }
|
||||
notify('已插入封面图片')
|
||||
dlg.close()
|
||||
}).catch(function () { notify('插入封面失败', 'err') })
|
||||
})
|
||||
}
|
||||
footEl.appendChild(del); footEl.appendChild(el('span', { class: 'iwb-drawer-spacer' })); footEl.appendChild(cp)
|
||||
if (insImg) footEl.appendChild(insImg)
|
||||
footEl.appendChild(ins)
|
||||
},
|
||||
})
|
||||
edit.addEventListener('click', function () { dlg.close(); openEditModal(p, false) })
|
||||
closeBtn.addEventListener('click', function () { dlg.close() })
|
||||
}
|
||||
|
||||
function openEditModal (p, isNew) {
|
||||
var draft = p ? Object.assign({}, p) : { id: uid('q'), name: '', text: '', tags: [], group: (filter === 'all' || filter === '__none__') ? '' : filter, cover: '' }
|
||||
var cancelBtn = el('button', { class: 'iwb-btn iwb-btn-sm', text: '取消' })
|
||||
var saveBtn = el('button', { class: 'iwb-btn iwb-btn-primary iwb-btn-sm', text: isNew ? '创建' : '保存' })
|
||||
var dirty = false
|
||||
openDialog({
|
||||
key: 'edit',
|
||||
title: isNew ? '新建提示词' : '编辑提示词',
|
||||
width: 880, height: 640,
|
||||
actions: [cancelBtn, saveBtn],
|
||||
onSaveKey: function () { doSave() },
|
||||
build: function (bodyEl, footEl, close) {
|
||||
var left = el('div', { class: 'iwb-plp-eleft' })
|
||||
var cov = el('div', { class: 'iwb-plp-ecov' })
|
||||
var fileIn = el('input', { type: 'file', accept: 'image/*', style: 'display:none' })
|
||||
var upBtn = el('button', { class: 'iwb-btn iwb-btn-sm', text: '上传图片' })
|
||||
var delCover = el('button', { class: 'iwb-btn iwb-btn-sm', text: '删除封面' })
|
||||
function repaint () { paintCoverInto(cov, { id: draft.id, cover: draft.cover, group: draft.group }) }
|
||||
upBtn.addEventListener('click', function () { try { fileIn.click() } catch (e) { /* ignore */ } })
|
||||
fileIn.addEventListener('change', function () {
|
||||
var f = fileIn.files && fileIn.files[0]
|
||||
if (!f) return
|
||||
var rd = new FileReader()
|
||||
rd.onload = function () {
|
||||
Promise.resolve(api.putCover(String(rd.result || ''))).then(function (r) {
|
||||
if (!(r && r.ok && r.ref)) { notify('封面上传失败', 'err'); return }
|
||||
draft.cover = r.ref
|
||||
dirty = true
|
||||
Object.keys(coverCache).forEach(function (k) { if (k.indexOf(draft.id + '|') === 0) delete coverCache[k] })
|
||||
Promise.resolve(api.coverUrl(r.ref)).then(function (u) {
|
||||
if (u && u.url) {
|
||||
draft._coverUrl = u.url
|
||||
coverCache[draft.id + '|s:' + String(r.ref).slice(-32)] = u.url
|
||||
}
|
||||
repaint(); render(); notify('封面已更新')
|
||||
})
|
||||
}).catch(function () { notify('封面上传失败', 'err') })
|
||||
}
|
||||
rd.readAsDataURL(f)
|
||||
})
|
||||
delCover.addEventListener('click', function () { draft.cover = ''; dirty = true; Object.keys(coverCache).forEach(function (k) { if (k.indexOf(draft.id + '|') === 0) delete coverCache[k] }); repaint() })
|
||||
left.appendChild(cov); left.appendChild(el('div', { class: 'iwb-row' }, upBtn, delCover)); left.appendChild(fileIn)
|
||||
var nameIn = el('input', { class: 'iwb-input', placeholder: '名称', value: draft.name || '' })
|
||||
var groupIn = el('input', { class: 'iwb-input', placeholder: '分组', value: draft.group || '' })
|
||||
var tagsIn = el('input', { class: 'iwb-input', placeholder: '标签,逗号分隔', value: (draft.tags || []).join(', ') })
|
||||
;[nameIn, groupIn, tagsIn].forEach(function (i) { i.addEventListener('input', function () { dirty = true }) })
|
||||
left.appendChild(el('label', { class: 'iwb-plp-lrow' }, el('span', { text: '名称' }), nameIn))
|
||||
left.appendChild(el('label', { class: 'iwb-plp-lrow' }, el('span', { text: '分组' }), groupIn))
|
||||
left.appendChild(el('label', { class: 'iwb-plp-lrow' }, el('span', { text: '标签' }), tagsIn))
|
||||
var textIn = el('textarea', { class: 'iwb-input iwb-plp-etext', placeholder: '提示词正文' })
|
||||
textIn.value = draft.text || ''
|
||||
textIn.addEventListener('input', function () { dirty = true })
|
||||
bodyEl.appendChild(left); bodyEl.appendChild(textIn)
|
||||
var dupBtn = el('button', { class: 'iwb-btn iwb-btn-sm', text: '另存副本' })
|
||||
var insBtn = el('button', { class: 'iwb-btn iwb-btn-sm', text: '插入画布' })
|
||||
footEl.appendChild(dupBtn); footEl.appendChild(el('span', { class: 'iwb-drawer-spacer' })); footEl.appendChild(insBtn)
|
||||
function collect () {
|
||||
return {
|
||||
id: draft.id,
|
||||
name: nameIn.value,
|
||||
group: groupIn.value,
|
||||
tags: String(tagsIn.value || '').split(',').map(function (s) { return s.trim() }).filter(Boolean),
|
||||
text: textIn.value,
|
||||
cover: draft.cover || '',
|
||||
}
|
||||
}
|
||||
function doSave () {
|
||||
var c = collect()
|
||||
var text = String(c.text || '').trim()
|
||||
if (!text) { notify('提示词内容不能为空', 'err'); return }
|
||||
var name = String(c.name || '').trim() || ('提示词 ' + text.slice(0, 8) + '…')
|
||||
var item = { id: c.id, name: name, text: text, tags: c.tags, group: String(c.group || '').trim(), cover: c.cover }
|
||||
var list = isNew ? prompts.concat([item]) : prompts.map(function (x) { return x.id === item.id ? item : x })
|
||||
var gs = groupsOf().slice()
|
||||
if (item.group && !gs.some(function (g) { return g.name === item.group })) gs.push(groupRef(item.group))
|
||||
close()
|
||||
save(list, gs).then(function () { notify(isNew ? '已创建' : '已保存') })
|
||||
}
|
||||
saveBtn.addEventListener('click', doSave)
|
||||
cancelBtn.addEventListener('click', function () { close() })
|
||||
dupBtn.addEventListener('click', function () {
|
||||
var c = collect()
|
||||
var copy = Object.assign({}, c, { id: uid('q'), name: (String(c.name || '提示词').trim()) + ' 副本' })
|
||||
close()
|
||||
save(prompts.concat([copy])).then(function () { notify('已另存副本') })
|
||||
})
|
||||
insBtn.addEventListener('click', function () {
|
||||
var c = collect()
|
||||
var t = String(c.text || '').trim()
|
||||
if (!t) { notify('提示词内容不能为空', 'err'); return }
|
||||
Promise.resolve(api.insert(t, c.name)).then(function () { notify('已插入画布:' + (c.name || '提示词')) }).catch(function () { notify('插入画布失败', 'err') })
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
function render () {
|
||||
clear(fixed); clear(scrollBox)
|
||||
var gs = groupsOf()
|
||||
@@ -398,7 +598,7 @@
|
||||
var search = el('input', { class: 'iwb-input iwb-grow', placeholder: '搜索名称 / 内容 / 标签…', value: query })
|
||||
search.addEventListener('input', function () { query = search.value; render(); var n = wrap.querySelector('input.iwb-input'); if (n) { n.focus(); try { n.setSelectionRange(n.value.length, n.value.length) } catch (e) { /* ignore */ } } })
|
||||
var newBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '新建提示词', text: '+ 新建' })
|
||||
newBtn.addEventListener('click', function () { openEditor(null) })
|
||||
newBtn.addEventListener('click', function () { openEditModal(null, true) })
|
||||
top.appendChild(search); top.appendChild(newBtn)
|
||||
fixed.appendChild(top)
|
||||
|
||||
@@ -472,7 +672,11 @@
|
||||
var items = visible()
|
||||
items.forEach(function (p) {
|
||||
var starred = (p.group || '') === '收藏'
|
||||
var card = el('div', { class: 'iwb-pcard', draggable: 'true', title: '单击编辑 · 拖到画布插入 · 右键移动到分组' })
|
||||
var coverUrl = coverOf(p)
|
||||
var card = el('div', { class: 'iwb-plp-card' + (p.cover ? ' has-cover' : ' no-cover'), draggable: 'true', title: '单击查看详情 · 拖到画布插入 · 右键移动到分组' })
|
||||
card.style.background = coverUrl ? 'var(--iwb-plugin-inset)' : gradOf(p)
|
||||
if (coverUrl) card.appendChild(el('img', { class: 'iwb-plp-cover', src: coverUrl, alt: '', draggable: 'false' }))
|
||||
card.appendChild(el('div', { class: 'iwb-plp-t', text: p.name || '未命名' }))
|
||||
card.addEventListener('dragstart', function (e) {
|
||||
try {
|
||||
e.stopPropagation()
|
||||
@@ -482,64 +686,8 @@
|
||||
e.dataTransfer.effectAllowed = 'copy'
|
||||
} catch (err) { /* ignore */ }
|
||||
})
|
||||
card.addEventListener('click', function (e) { e.stopPropagation(); openEditor(p) })
|
||||
card.addEventListener('click', function (e) { e.stopPropagation(); openDetailModal(p) })
|
||||
card.addEventListener('contextmenu', function (e) { openMenu(e, p) })
|
||||
|
||||
var row = el('div', { class: 'iwb-row' })
|
||||
var nameEl = el('span', { class: 'iwb-pname' })
|
||||
appendParts(nameEl, hl(p.name || '未命名'))
|
||||
row.appendChild(nameEl)
|
||||
var btns = el('span', { class: 'iwb-pbtns' })
|
||||
var ins = el('button', { class: 'iwb-btn iwb-btn-sm', title: '插入到画布(可多次,不关闭面板)' })
|
||||
ins.appendChild(svgIcon('M8 3v10', ['M3 8h10']))
|
||||
ins.addEventListener('click', function (e) {
|
||||
e.stopPropagation()
|
||||
Promise.resolve(api.insert(p.text || '', p.name || '')).then(function () { notify('已插入画布:' + (p.name || '提示词')) }).catch(function () { notify('插入画布失败', 'err') })
|
||||
})
|
||||
btns.appendChild(ins)
|
||||
var star = el('button', { class: 'iwb-btn iwb-btn-sm' + (starred ? ' iwb-btn-starred' : ''), title: starred ? '取消收藏(移出「收藏」分组)' : '收藏到「收藏」分组' })
|
||||
star.appendChild(svgIcon('M8 2.6l1.7 3.5 3.8.5-2.8 2.7.7 3.8-3.4-1.8-3.4 1.8.7-3.8L2.5 6.6l3.8-.5z'))
|
||||
star.addEventListener('click', function (e) {
|
||||
e.stopPropagation()
|
||||
var ng = groupsOf().slice()
|
||||
if (!starred && !ng.some(function (g) { return g.name === '收藏' })) ng.push(groupRef('收藏'))
|
||||
save(prompts.map(function (x) { return x.id === p.id ? Object.assign({}, x, { group: starred ? '' : '收藏' }) : x }), ng)
|
||||
.then(function () { notify(starred ? '已取消收藏' : '已收藏到收藏栏') })
|
||||
})
|
||||
btns.appendChild(star)
|
||||
row.appendChild(btns)
|
||||
card.appendChild(row)
|
||||
|
||||
var tagRow = el('div', { class: 'iwb-pcard-tags' })
|
||||
;(p.tags || []).forEach(function (t) { tagRow.appendChild(el('span', { class: 'iwb-tag', text: t })) })
|
||||
if ((p.group || '').trim()) tagRow.appendChild(el('span', { class: 'iwb-tag iwb-tag-group', text: p.group }))
|
||||
if (tagRow.childNodes.length) card.appendChild(tagRow)
|
||||
|
||||
var textEl = el('div', { class: 'iwb-ptext iwb-ptext-clickable' + (expanded[p.id] ? ' iwb-ptext-open' : ''), title: expanded[p.id] ? '点击收起' : '点击展开全文' })
|
||||
appendParts(textEl, hl(p.text || ''))
|
||||
textEl.addEventListener('click', function (e) {
|
||||
e.stopPropagation()
|
||||
if (expanded[p.id]) delete expanded[p.id]; else expanded[p.id] = 1
|
||||
render()
|
||||
})
|
||||
card.appendChild(textEl)
|
||||
if (expanded[p.id]) {
|
||||
var foot = el('div', { class: 'iwb-row iwb-pcard-foot' },
|
||||
el('span', { class: 'iwb-hint', text: (p.text || '').length + ' 字' }),
|
||||
el('span', { class: 'iwb-drawer-spacer' }))
|
||||
var copyBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '复制全文', text: '复制全文' })
|
||||
copyBtn.addEventListener('click', function (e) {
|
||||
e.stopPropagation()
|
||||
Promise.resolve(api.copy(p.text || '')).then(function (r) {
|
||||
if (r && r.ok === false) notify('复制失败:' + ((r && r.error) || '剪贴板不可用'), 'err')
|
||||
else notify('已复制全文')
|
||||
}).catch(function () { notify('复制失败', 'err') })
|
||||
})
|
||||
var foldBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '收起', text: '收起' })
|
||||
foldBtn.addEventListener('click', function (e) { e.stopPropagation(); delete expanded[p.id]; render() })
|
||||
foot.appendChild(copyBtn); foot.appendChild(foldBtn)
|
||||
card.appendChild(foot)
|
||||
}
|
||||
cards.appendChild(card)
|
||||
})
|
||||
scrollBox.appendChild(cards)
|
||||
@@ -573,7 +721,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'promptlib',
|
||||
name: '提示词库',
|
||||
version: '1.0.1',
|
||||
version: '1.4.10',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'promptlib'],
|
||||
data: { schemaVersion: 1, maxBytes: 65536 },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "promptlib",
|
||||
"name": "提示词库",
|
||||
"version": "1.0.1",
|
||||
"version": "1.4.10",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -13,7 +13,7 @@
|
||||
"提示词"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "ce2d1347b8b61a75f16a54a96f16861066c6ca70add314216c33ba95b2eb2d60",
|
||||
"styles.css": "2bce24d4fde9014b674397d94bbf5cdc6825ca600e3e942c057efa6b47f350ad"
|
||||
"main.js": "75dc31dc6270aa10e73c90eeb09bb349a949d17c39940574e28f12c5e463ceaf",
|
||||
"styles.css": "cc71e071379c84131e525afeaa5757674f499da195ccb42536c019a3ef5d8473"
|
||||
}
|
||||
}
|
||||
@@ -14,3 +14,126 @@
|
||||
flex: 0 0 auto;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
/* v1.0.2(2026-11-21):卡片化 —— 白卡 + 悬停 + 文本三行截断。
|
||||
颜色一律走宿主 --iwb-plugin-* / --iwb-* token,不在插件里写死。 */
|
||||
.iwb-promptlib .iwb-pname { font-weight: 600; }
|
||||
.iwb-promptlib .iwb-ptext {
|
||||
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
|
||||
overflow: hidden; color: var(--iwb-text2, #4d5668);
|
||||
}
|
||||
.iwb-promptlib .iwb-lib-cards { gap: 8px; }
|
||||
|
||||
/* v1.1.0(2026-11-21):封面网格 + 长文详情 + 宽编辑弹窗。
|
||||
颜色全部走宿主 token,不写死。 */
|
||||
.iwb-plp-card {
|
||||
position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
|
||||
aspect-ratio: 1 / 1; border: 1px solid var(--iwb-border, #d5d9e0);
|
||||
transition: border-color .12s ease, transform .12s ease;
|
||||
}
|
||||
.iwb-plp-card:hover { border-color: var(--iwb-border2, #b9bfca); }
|
||||
.iwb-plp-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||
.iwb-plp-t {
|
||||
position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 7px 6px;
|
||||
background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.66));
|
||||
color: #fff; font-size: 10.5px; line-height: 1.35; max-height: 48%;
|
||||
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
|
||||
text-shadow: 0 1px 2px rgba(0,0,0,.35);
|
||||
}
|
||||
/* 详情:长文阅读 */
|
||||
.iwb-plp-dhead { display: flex; align-items: center; gap: 6px; padding: 2px 0 8px; position: sticky; top: 0; z-index: 2; background: var(--iwb-plugin-surface, #fafafb); }
|
||||
.iwb-plp-dtop { align-items: flex-start; gap: 10px; margin-bottom: 8px; }
|
||||
.iwb-plp-dthumb { flex: 0 0 84px; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--iwb-border, #d5d9e0); }
|
||||
.iwb-plp-dmeta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
|
||||
.iwb-plp-dtitle { font-size: 13px; font-weight: 600; color: var(--iwb-text, #1c2333); line-height: 1.45; }
|
||||
.iwb-plp-dtext {
|
||||
font-size: 12px; line-height: 1.75; color: var(--iwb-text2, #4d5668);
|
||||
white-space: pre-wrap; word-break: break-word; padding: 4px 0 12px;
|
||||
}
|
||||
.iwb-plp-dfoot { display: flex; align-items: center; gap: 6px; padding: 8px 0 2px; position: sticky; bottom: 0; background: var(--iwb-plugin-surface, #fafafb); }
|
||||
/* 编辑弹窗:760 宽 + 大文本框 */
|
||||
.iwb-promptlib-editor { width: 760px; max-width: 94vw; }
|
||||
.iwb-promptlib-editor .iwb-modal-body { max-height: 78vh; }
|
||||
.iwb-promptlib-text { min-height: 360px; height: 44vh; font-size: 12.5px; line-height: 1.9; resize: vertical; }
|
||||
.iwb-plp-editor-cover { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
|
||||
.iwb-plp-editor-thumb { flex: 0 0 96px; width: 96px; height: 128px; border-radius: 8px; overflow: hidden; border: 1px solid var(--iwb-border, #d5d9e0); }
|
||||
.iwb-plp-editor-coverops { display: flex; flex-direction: column; gap: 8px; }
|
||||
|
||||
/* v1.2.0:可拖动 / 可缩放的详情与编辑弹窗(同宽 880×640,最小 640×420) */
|
||||
.iwb-plp-mask { background: transparent; display: block; }
|
||||
.iwb-plp-dialog { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px;
|
||||
box-shadow: 0 24px 60px rgba(0,0,0,.28); }
|
||||
.iwb-plp-dhead { display: flex; align-items: center; gap: 6px; padding: 10px 14px;
|
||||
border-bottom: 1px solid var(--iwb-border, #d5d9e0); cursor: move; user-select: none; }
|
||||
.iwb-plp-grip { display: grid; grid-template-columns: repeat(3, 3px); gap: 2px; margin-right: 6px; }
|
||||
.iwb-plp-grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--iwb-border2, #b9bfca); display: block; }
|
||||
.iwb-plp-dbody { flex: 1 1 auto; min-height: 0; display: flex; gap: 14px; padding: 14px; }
|
||||
.iwb-plp-dcov { flex: 0 0 210px; width: 210px; height: 280px; border-radius: 10px; overflow: hidden;
|
||||
border: 1px solid var(--iwb-border, #d5d9e0); background: var(--iwb-plugin-inset, #f5f6f7); }
|
||||
.iwb-plp-dright { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
|
||||
.iwb-plp-dtext { flex: 1 1 auto; min-height: 0; overflow: auto; white-space: pre-wrap; word-break: break-word;
|
||||
font-size: 12px; line-height: 1.9; color: var(--iwb-text2, #4d5668); }
|
||||
.iwb-plp-dfooter { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
|
||||
border-top: 1px solid var(--iwb-border, #d5d9e0); }
|
||||
.iwb-plp-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
|
||||
background: linear-gradient(135deg, transparent 0 45%, var(--iwb-border2, #b9bfca) 45% 50%, transparent 50% 62%, var(--iwb-border2, #b9bfca) 62% 67%, transparent 67%); }
|
||||
/* 编辑:左栏固定 240,右栏大文本框 */
|
||||
.iwb-plp-eleft { flex: 0 0 240px; width: 240px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
|
||||
.iwb-plp-ecov { width: 240px; height: 300px; border-radius: 10px; overflow: hidden;
|
||||
border: 1px solid var(--iwb-border, #d5d9e0); background: var(--iwb-plugin-inset, #f5f6f7); }
|
||||
.iwb-plp-lrow { display: flex; flex-direction: column; gap: 4px; font-size: 10px; color: var(--iwb-text2, #4d5668); }
|
||||
.iwb-plp-etext { flex: 1 1 auto; min-height: 0; height: auto; resize: none; font-size: 12px; line-height: 1.9; }
|
||||
/* 输入框边框柔化(用户反馈现在的边框太深) */
|
||||
.iwb-plp-dialog .iwb-input { border-color: color-mix(in srgb, var(--iwb-border, #d5d9e0) 72%, transparent); }
|
||||
.iwb-plp-dialog .iwb-input:focus { border-color: var(--iwb-brand, #6b7280); box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand, #6b7280) 14%, transparent); }
|
||||
|
||||
/* v1.2.1:去掉弹窗里多余的线框(用户反馈“线框太多、太明显”) */
|
||||
.iwb-plp-dialog .iwb-plp-dcov,
|
||||
.iwb-plp-dialog .iwb-plp-ecov { border-color: transparent; }
|
||||
.iwb-plp-dialog .iwb-plp-dhead { border-bottom-color: color-mix(in srgb, var(--iwb-border, #d5d9e0) 45%, transparent); }
|
||||
.iwb-plp-dialog .iwb-plp-dfooter { border-top-color: color-mix(in srgb, var(--iwb-border, #d5d9e0) 45%, transparent); }
|
||||
/* 输入框:默认无边框,用浅底区分;聚焦才出现细描边 */
|
||||
.iwb-plp-dialog .iwb-input {
|
||||
border-color: transparent;
|
||||
background: var(--iwb-plugin-inset, #f5f6f7);
|
||||
box-shadow: none;
|
||||
}
|
||||
.iwb-plp-dialog .iwb-input:hover { background: var(--iwb-plugin-hover, #eef1f4); }
|
||||
.iwb-plp-dialog .iwb-input:focus {
|
||||
background: var(--iwb-panel, #fff);
|
||||
border-color: color-mix(in srgb, var(--iwb-brand, #6b7280) 55%, transparent);
|
||||
box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand, #6b7280) 12%, transparent);
|
||||
}
|
||||
/* 正文编辑区:无边框、无底色,像一张纸 */
|
||||
.iwb-plp-dialog .iwb-plp-etext { border-color: transparent; background: transparent; box-shadow: none; }
|
||||
.iwb-plp-dialog .iwb-plp-etext:focus { border-color: transparent; box-shadow: none; background: transparent; }
|
||||
/* 左侧封面区的两个按钮:去掉按钮描边,弱化成文字按钮 */
|
||||
.iwb-plp-dialog .iwb-plp-eleft .iwb-btn { border-color: transparent; background: var(--iwb-plugin-inset, #f5f6f7); }
|
||||
.iwb-plp-dialog .iwb-plp-eleft .iwb-btn:hover { background: var(--iwb-plugin-hover, #eef1f4); }
|
||||
|
||||
/* v1.3.3:封面比例不定 —— 详情/编辑里完整显示(contain,不裁切);列表保持方形裁切(网格整齐) */
|
||||
.iwb-plp-dialog .iwb-plp-dcov img,
|
||||
.iwb-plp-dialog .iwb-plp-ecov img { object-fit: contain; background: var(--iwb-plugin-inset, #f5f6f7); }
|
||||
.iwb-plp-dialog .iwb-plp-dcov,
|
||||
.iwb-plp-dialog .iwb-plp-ecov { background: var(--iwb-plugin-inset, #f5f6f7); }
|
||||
.iwb-plp-card .iwb-plp-cover { object-fit: cover; object-position: center; }
|
||||
|
||||
/* v1.3.4:瀑布流(列式)+ 卡片定宽不随面板拉伸;面板底色统一走 --iwb-plugin-surface */
|
||||
.iwb-promptlib .iwb-plp-card {
|
||||
display: inline-block; width: 100%; margin: 0 0 8px;
|
||||
break-inside: avoid; -webkit-column-break-inside: avoid;
|
||||
aspect-ratio: auto; /* 高度交给图片原始比例 */
|
||||
}
|
||||
.iwb-promptlib .iwb-plp-cover { width: 100%; height: auto; object-fit: contain; }
|
||||
/* 统一插件灰:面板底(宿主会给 --iwb-plugin-surface,这里只留兜底) */
|
||||
.iwb-promptlib { background: transparent; }
|
||||
|
||||
/* v1.3.5:无封面的提示词也给一个方形占位(否则瀑布流里会塌成一条线) */
|
||||
.iwb-promptlib .iwb-plp-card.no-cover { aspect-ratio: 1 / 1; }
|
||||
.iwb-promptlib .iwb-plp-card.no-cover .iwb-plp-t { max-height: 60%; }
|
||||
|
||||
/* v1.4.7:恢复瀑布流列规则(1.4.0 清理 CSS 时把这组规则一起删掉了,列表退化成单列、卡片被拉满宽) */
|
||||
.iwb-promptlib .iwb-lib-cards { display: block; column-width: 122px; column-gap: 8px; grid-template-columns: none; }
|
||||
.iwb-promptlib .iwb-plp-card { display: inline-block; width: 100%; margin: 0 0 8px; break-inside: avoid; -webkit-column-break-inside: avoid; aspect-ratio: auto; }
|
||||
.iwb-promptlib .iwb-plp-cover { width: 100%; height: auto; object-fit: contain; }
|
||||
.iwb-promptlib .iwb-plp-card.no-cover { aspect-ratio: 1 / 1; }
|
||||
@@ -91,9 +91,16 @@ const sourceModules = [
|
||||
'canvas-text.js',
|
||||
'generation-task-graph.js',
|
||||
'generation-results-store.js',
|
||||
'ui-dock-sanitize.js',
|
||||
'ui-dock.js',
|
||||
'ui-minimap-fit.js',
|
||||
'ui-dock-panels.js',
|
||||
'theme-tokens.js',
|
||||
'canvas-grid.js',
|
||||
'image-display-thumb.js',
|
||||
'image-remote-cache.js',
|
||||
'image-thumb-pick.js',
|
||||
'ui-modal-drag.js',
|
||||
'ui-nav-rail.js',
|
||||
'ui-plugin-page.js',
|
||||
'ui-hotkey-help.js',
|
||||
|
||||
@@ -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.71 · 8.4 MB · .dmg<div class="hash">sha256 00df681f2b62da25…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.71_aarch64.dmg?h=00df681f2b62">下载</a>
|
||||
<div class="meta">版本 3.26.28 · 8.4 MB · .dmg<div class="hash">sha256 917f9c435a4bd80e…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.28_aarch64.dmg?h=917f9c435a4b">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
|
||||
<div class="meta">版本 3.25.71 · 8.7 MB · .dmg<div class="hash">sha256 ae06ea6bebfe1e8b…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.71_x64.dmg?h=ae06ea6bebfe">下载</a>
|
||||
<div class="meta">版本 3.26.28 · 8.8 MB · .dmg<div class="hash">sha256 9daa6522269953a0…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.28_x64.dmg?h=9daa65222699">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
|
||||
@@ -94,6 +94,174 @@
|
||||
</ol>
|
||||
|
||||
<h2>历史版本</h2>
|
||||
<div class="row">
|
||||
<div class="name">3.26.28<div class="hint">Intel 版:同一清理</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.27<div class="hint">Intel 版:同一交互</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.26<div class="hint">Intel 版:同一交互</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.25<div class="hint">Intel 版:同一优化</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.24<div class="hint">Intel 版:同一设计</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.23<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.22<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.21<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.20<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-22<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.18<div class="hint">Intel 版:同一布局逻辑</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.17<div class="hint">Intel 版:同一布局修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.16<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.15<div class="hint">Intel 版:同一调整</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.14<div class="hint">Intel 版:同一调整</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.13<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.12<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.10<div class="hint">Intel 版:同一回退</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.5<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.4<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.3<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.2<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.1<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.0<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.99<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.98<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.97<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.96<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.94<div class="hint">Intel 版:同一回滚</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.88<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.87<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.86<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.85<div class="hint">Intel 版:同一批改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.84<div class="hint">Intel 版:同一批修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.83<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.82<div class="hint">Intel 版:同一批调整</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.81<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.80<div class="hint">Intel 版:同一批改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.79<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.76<div class="hint">Intel 版:同一批改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.74<div class="hint">Intel 版:同一批改动</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.73<div class="hint">Intel 版:同一批缩略图改造</div></div>
|
||||
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.72<div class="hint">Intel 版:同一修复</div></div>
|
||||
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.25.71<div class="hint">Intel 版:同一改动</div></div>
|
||||
<div class="meta">2026-11-20<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
@@ -276,7 +444,7 @@
|
||||
</div>
|
||||
|
||||
<div class="foot">
|
||||
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-20
|
||||
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-22
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
|
||||
@@ -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.71-mwp4lma6">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.28-mwr2zgj5">
|
||||
</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.71</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.28</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
<section class="hero hero-art">
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.71-mwp4lma6" alt=""></div>
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.28-mwr2zgj5" alt=""></div>
|
||||
<div class="hero-veil"></div>
|
||||
<div class="wrap">
|
||||
<span class="kicker">v3.25.71 · macOS / Windows · 数据在本地</span>
|
||||
<span class="kicker">v3.26.28 · macOS / Windows · 数据在本地</span>
|
||||
<h1>本地优先的<br>AI 生图无限画布</h1>
|
||||
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
|
||||
<div class="cta">
|
||||
<a class="btn primary lg" href="/download/">下载 v3.25.71</a>
|
||||
<a class="btn primary lg" href="/download/">下载 v3.26.28</a>
|
||||
<a class="btn lg" href="/plugins/">浏览 11 个插件</a>
|
||||
</div>
|
||||
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
|
||||
@@ -70,19 +70,19 @@
|
||||
</div>
|
||||
<div class="pcard" data-name="图库 gallery 右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供) 资源 图库" data-tags="资源,图库">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.6.3 · 官方</div></div></div>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.6.9 · 官方</div></div></div>
|
||||
<div class="desc">右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">图库</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="节点组 grouplib 左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供) 资源 节点组" data-tags="资源,节点组">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">📦</span>
|
||||
<div><div class="nm">节点组</div><div class="ver">v1.0.3 · 官方</div></div></div>
|
||||
<div><div class="nm">节点组</div><div class="ver">v1.0.4 · 官方</div></div></div>
|
||||
<div class="desc">左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">节点组</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="提示词库 promptlib 右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供) 资源 提示词" data-tags="资源,提示词">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">📖</span>
|
||||
<div><div class="nm">提示词库</div><div class="ver">v1.0.1 · 官方</div></div></div>
|
||||
<div><div class="nm">提示词库</div><div class="ver">v1.4.10 · 官方</div></div></div>
|
||||
<div class="desc">右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">提示词</span></div>
|
||||
</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.71_aarch64.dmg?h=00df681f2b62"><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.71_x64.dmg?h=ae06ea6bebfe"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.7 MB · .dmg</div></a>
|
||||
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.28_aarch64.dmg?h=917f9c435a4b"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
|
||||
<a href="/updates/darwin-x86_64/image-workbench_3.26.28_x64.dmg?h=9daa65222699"><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,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"updatedAt": "2026-11-20T09:36:40.399Z",
|
||||
"updatedAt": "2026-11-21T16:18:40.867Z",
|
||||
"plugins": [
|
||||
{
|
||||
"id": "batch-export",
|
||||
@@ -112,26 +112,26 @@
|
||||
"资源",
|
||||
"图库"
|
||||
],
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.9",
|
||||
"apiVersion": 1,
|
||||
"bundle": "plugins/gallery-1.6.3.zip",
|
||||
"bundleSize": 31433,
|
||||
"bundleSha256": "3ed53c236f48b945b514db42980383eb10f6f8a78f83d1abd64f0dc5807317c1",
|
||||
"bundle": "plugins/gallery-1.6.9.zip",
|
||||
"bundleSize": 34272,
|
||||
"bundleSha256": "9588b28fd2b2b3cc0f38ecd06fee05873474ca98867ce5b2dc5d6cc5948cf383",
|
||||
"files": [
|
||||
{
|
||||
"path": "manifest.json",
|
||||
"sha256": "8800f1270ac20625b9837752c0b45c1a3a48ebdaeb633245a313209b97dc9937",
|
||||
"sha256": "0523a370d28132dcca912894929e402e9e7bac4a611be146ee075d073f26276c",
|
||||
"size": 526
|
||||
},
|
||||
{
|
||||
"path": "main.js",
|
||||
"sha256": "6628f9aa5be68e0ed798244a1fd4405e50801181e6c0779b22a0723f84309865",
|
||||
"size": 25406
|
||||
"sha256": "26c7e64b3a0021c6b9514dfb84d4d2580276698222b4791cfa99f22ead66ff52",
|
||||
"size": 28241
|
||||
},
|
||||
{
|
||||
"path": "styles.css",
|
||||
"sha256": "81b23c43b0308c678bf95e00d6663abcb8b300242ab952ca56b1390fd74bb53e",
|
||||
"size": 5191
|
||||
"sha256": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0",
|
||||
"size": 5195
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -146,26 +146,26 @@
|
||||
"资源",
|
||||
"节点组"
|
||||
],
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"apiVersion": 1,
|
||||
"bundle": "plugins/grouplib-1.0.3.zip",
|
||||
"bundleSize": 22889,
|
||||
"bundleSha256": "8ecfa3bc39f08301c239ca3c8d33c73e92d4507d15f8df43272aca4acb26bb5c",
|
||||
"bundle": "plugins/grouplib-1.0.4.zip",
|
||||
"bundleSize": 24479,
|
||||
"bundleSha256": "842fd7d519bf8378b205c1c35894b8b2925e40595792fed99b1d456a2563404d",
|
||||
"files": [
|
||||
{
|
||||
"path": "manifest.json",
|
||||
"sha256": "a46aa5e4d1ad6cbfa96865baffb5293e2d4aed0f881e28854379a2c290762ec8",
|
||||
"sha256": "b35b748d9e76380f8c02d04ca10e93e280d1b6386c6e0a3b55f5be2448a3c65f",
|
||||
"size": 530
|
||||
},
|
||||
{
|
||||
"path": "main.js",
|
||||
"sha256": "748b23798c5a0a3ffc0d124f2904439f41345e5064b043ffd7980cd14a6f05ee",
|
||||
"size": 21288
|
||||
"sha256": "8cb2e39f9880d49c9b9c15a1f7d62d9772170c8d0eac0faaa237bb7056af34ff",
|
||||
"size": 21601
|
||||
},
|
||||
{
|
||||
"path": "styles.css",
|
||||
"sha256": "932dbf2723bd0c6bab274786784e92a1acd1dd6b4d5246c06d2240efa25d2507",
|
||||
"size": 761
|
||||
"sha256": "ee6e292ffebdcc1351651bf7937399128ae06e0b364624792f34111866f9355b",
|
||||
"size": 2038
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -180,26 +180,26 @@
|
||||
"资源",
|
||||
"提示词"
|
||||
],
|
||||
"version": "1.0.1",
|
||||
"version": "1.4.10",
|
||||
"apiVersion": 1,
|
||||
"bundle": "plugins/promptlib-1.0.1.zip",
|
||||
"bundleSize": 32749,
|
||||
"bundleSha256": "54d7539a477a5fbcc0e0af8a5b1bba511f22d639d6009a571a2d827702da5d7e",
|
||||
"bundle": "plugins/promptlib-1.4.10.zip",
|
||||
"bundleSize": 49682,
|
||||
"bundleSha256": "d5ffef4a9c6b5efe359e071476b76f015d6ae2e5a5982dfca461069c21cf0d96",
|
||||
"files": [
|
||||
{
|
||||
"path": "manifest.json",
|
||||
"sha256": "081362c4ddc5e38a6d3ecdf1ff68c4d1012afd3d8b90047a9077ea230b288763",
|
||||
"size": 540
|
||||
"sha256": "4b8375d1b21bc2ffc29ea93959e7f990751351362f71ae37e1b46ed2e040d99b",
|
||||
"size": 541
|
||||
},
|
||||
{
|
||||
"path": "main.js",
|
||||
"sha256": "ce2d1347b8b61a75f16a54a96f16861066c6ca70add314216c33ba95b2eb2d60",
|
||||
"size": 31186
|
||||
"sha256": "75dc31dc6270aa10e73c90eeb09bb349a949d17c39940574e28f12c5e463ceaf",
|
||||
"size": 39307
|
||||
},
|
||||
{
|
||||
"path": "styles.css",
|
||||
"sha256": "2bce24d4fde9014b674397d94bbf5cdc6825ca600e3e942c057efa6b47f350ad",
|
||||
"size": 713
|
||||
"sha256": "cc71e071379c84131e525afeaa5757674f499da195ccb42536c019a3ef5d8473",
|
||||
"size": 9524
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -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.71-mwp4lma6">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.28-mwr2zgj5">
|
||||
</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.71</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.28</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
@@ -64,19 +64,19 @@
|
||||
</div>
|
||||
<div class="pcard" data-name="图库 gallery 右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供) 资源 图库" data-tags="资源,图库">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.6.3 · 官方</div></div></div>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.6.9 · 官方</div></div></div>
|
||||
<div class="desc">右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">图库</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="节点组 grouplib 左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供) 资源 节点组" data-tags="资源,节点组">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">📦</span>
|
||||
<div><div class="nm">节点组</div><div class="ver">v1.0.3 · 官方</div></div></div>
|
||||
<div><div class="nm">节点组</div><div class="ver">v1.0.4 · 官方</div></div></div>
|
||||
<div class="desc">左栏收藏的节点组:分组/改名/删除,拖到画布实例化(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">节点组</span></div>
|
||||
</div>
|
||||
<div class="pcard" data-name="提示词库 promptlib 右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供) 资源 提示词" data-tags="资源,提示词">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">📖</span>
|
||||
<div><div class="nm">提示词库</div><div class="ver">v1.0.1 · 官方</div></div></div>
|
||||
<div><div class="nm">提示词库</div><div class="ver">v1.4.10 · 官方</div></div></div>
|
||||
<div class="desc">右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">提示词</span></div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,890 @@
|
||||
{
|
||||
"app": "Image Workbench",
|
||||
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
|
||||
"updatedAt": "2026-11-20T15:20:26.293Z",
|
||||
"updatedAt": "2026-11-22T00:10:45.147Z",
|
||||
"releases": [
|
||||
{
|
||||
"version": "3.26.28",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一清理",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.28_aarch64.dmg",
|
||||
"size": 8780175,
|
||||
"sha256": "917f9c435a4bd80e0cec37d469c60ae90474944f3a88a4a545f530d590a385d1",
|
||||
"h": "917f9c435a4b",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.28_x64.dmg",
|
||||
"size": 9183561,
|
||||
"sha256": "9daa6522269953a038d9f46a006bcbf6e3d03f304ff7c4c6ef334905eeb7662e",
|
||||
"h": "9daa65222699",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.27",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一交互",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.27_aarch64.dmg",
|
||||
"size": 8782227,
|
||||
"sha256": "2c3d2d2ca6c9fc86e361bc1506f39bbc407e5011545c95b187c2ff2489dd740e",
|
||||
"h": "2c3d2d2ca6c9",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.27_x64.dmg",
|
||||
"size": 9187975,
|
||||
"sha256": "ed0c8ba2f9c69a2ff17b9cefe9f469fd8adc201d10e188a2bd6e58a92e55e717",
|
||||
"h": "ed0c8ba2f9c6",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.26",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一交互",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.26_aarch64.dmg",
|
||||
"size": 8782545,
|
||||
"sha256": "bc50a4d1bd5ef8c2f68fc5f10cf05d11dcd56c9feccdbcc4bb2308ef3bae2318",
|
||||
"h": "bc50a4d1bd5e",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.26_x64.dmg",
|
||||
"size": 9180404,
|
||||
"sha256": "3149451c46d07ad89d17399bbda6e2520931707ad1ea90f873705d7b5efa7e61",
|
||||
"h": "3149451c46d0",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.25",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一优化",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.25_aarch64.dmg",
|
||||
"size": 8779187,
|
||||
"sha256": "952072aa7209a5561a34e070e29c90022f15b99dcdc8d9f340d7ef46e2981f37",
|
||||
"h": "952072aa7209",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.25_x64.dmg",
|
||||
"size": 9182258,
|
||||
"sha256": "b439bf90f80e3048f127b73a63f121222472833cde044335ca561532a40293b8",
|
||||
"h": "b439bf90f80e",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.24",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一设计",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.24_aarch64.dmg",
|
||||
"size": 8783850,
|
||||
"sha256": "dfe5550e8d71095a1f079897691b65b580a1a873564a0659c1c611ca39fef5d9",
|
||||
"h": "dfe5550e8d71",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.24_x64.dmg",
|
||||
"size": 9183734,
|
||||
"sha256": "e5d960bde2388ebd2215a0441fd88ed4391fdd6756657ffbf4e6d7ad9e78c57f",
|
||||
"h": "e5d960bde238",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.23",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.23_aarch64.dmg",
|
||||
"size": 8779370,
|
||||
"sha256": "beb45e0df21d1449074ef2bd3a1b62e6b679923ec9952ec44875fbf626653955",
|
||||
"h": "beb45e0df21d",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.23_x64.dmg",
|
||||
"size": 9184309,
|
||||
"sha256": "2a83fbad20717ba734b5cf67584c8514f2f57912dc00daa7f254c7a038d21019",
|
||||
"h": "2a83fbad2071",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.22",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.22_aarch64.dmg",
|
||||
"size": 8781652,
|
||||
"sha256": "1f7154c7dfb5b80d95bf40e80bac29e7d65df0627f95e02b6cf7a3f64d009342",
|
||||
"h": "1f7154c7dfb5",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.22_x64.dmg",
|
||||
"size": 9183092,
|
||||
"sha256": "44671ffdb82b23f53ceb8815ace39f7e8c2c4dc07dd9ab025682c92c2baf9a4e",
|
||||
"h": "44671ffdb82b",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.21",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.21_aarch64.dmg",
|
||||
"size": 8779485,
|
||||
"sha256": "b90b44339a2c14ae48a73cbbd4db67c6cb973f680f2d88ec6372eb712515598d",
|
||||
"h": "b90b44339a2c",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.21_x64.dmg",
|
||||
"size": 9180736,
|
||||
"sha256": "11a84de069e7b89b662d5ae8e8d4fe11928abd168b5c09cdd614f29ceddb7906",
|
||||
"h": "11a84de069e7",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.20",
|
||||
"date": "2026-11-22",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.20_aarch64.dmg",
|
||||
"size": 8779972,
|
||||
"sha256": "d55587aa75ed700145ca0ccbbe5bb9ed9232e9d01223e3cec895d7a3f8b0b895",
|
||||
"h": "d55587aa75ed",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.20_x64.dmg",
|
||||
"size": 9180611,
|
||||
"sha256": "b6a5d3e5e6ea2b46bbe2012deeeda7af7e284ce38ef731dac15d1ad881873c9c",
|
||||
"h": "b6a5d3e5e6ea",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.18",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一布局逻辑",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.18_aarch64.dmg",
|
||||
"size": 8777308,
|
||||
"sha256": "d15a3c51d94965f1fd60e7fbbfd58fffa6720d29b93cb56530e6475043dc0c09",
|
||||
"h": "d15a3c51d949",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.18_x64.dmg",
|
||||
"size": 9184474,
|
||||
"sha256": "8bc4116c6306935afbc94908db19e7dfe863eda7a7c1a1a028f5a49f062aa703",
|
||||
"h": "8bc4116c6306",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.17",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一布局修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.17_aarch64.dmg",
|
||||
"size": 8779085,
|
||||
"sha256": "8a0ce45f5d3e77338ef15ef58ba848b23bc0027fed0a017a4c041050d894a25c",
|
||||
"h": "8a0ce45f5d3e",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.17_x64.dmg",
|
||||
"size": 9180521,
|
||||
"sha256": "a8cff28cbc428cc5ef25c4c520ca38cfce6d3c8661e5d7e46ab20cc146452437",
|
||||
"h": "a8cff28cbc42",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.16",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.16_aarch64.dmg",
|
||||
"size": 8777222,
|
||||
"sha256": "5f6e15bb854e48b8f7fbe3d640bfc9add72fc519c1ffecfcbf4638188874a620",
|
||||
"h": "5f6e15bb854e",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.16_x64.dmg",
|
||||
"size": 9183580,
|
||||
"sha256": "a00bd308e3e2fab4ca5634ebc10e7ae957beed0ebdc54bd77732a917828a7108",
|
||||
"h": "a00bd308e3e2",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.15",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一调整",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.15_aarch64.dmg",
|
||||
"size": 8776641,
|
||||
"sha256": "2e1e9e31e186194d2482c33df585daeb6762cd9d98a5fe5ac57ed3ccaf2cec22",
|
||||
"h": "2e1e9e31e186",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.15_x64.dmg",
|
||||
"size": 9181353,
|
||||
"sha256": "b9263c7a72b27d0ebdcc4c955a6cd9e3254951a173228e49100bc6d2c9b0ed54",
|
||||
"h": "b9263c7a72b2",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.14",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一调整",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.14_aarch64.dmg",
|
||||
"size": 8779158,
|
||||
"sha256": "8f1cd52d58485a42012b7b1ca3272f281dd45d07ec49d22280ab902d4483f52b",
|
||||
"h": "8f1cd52d5848",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.14_x64.dmg",
|
||||
"size": 9185158,
|
||||
"sha256": "3d8cffd282742df80dfc27ae7770090d7cf8217fabe70e378954e7795eb03449",
|
||||
"h": "3d8cffd28274",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.13",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.13_aarch64.dmg",
|
||||
"size": 8777257,
|
||||
"sha256": "f16f3701e26a78a8952439d22588e461904690d124e8d146f7d8d382364f6315",
|
||||
"h": "f16f3701e26a",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.13_x64.dmg",
|
||||
"size": 9182535,
|
||||
"sha256": "aeae23a2725fbfaeda12372faf6ec2b1eb016d5f19ad2c8d595471c6e70cfeaa",
|
||||
"h": "aeae23a2725f",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.12",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.12_aarch64.dmg",
|
||||
"size": 8782148,
|
||||
"sha256": "92804727934e9d7dc4ba4e555db0e70d77fc537b2d8fa9504679802eef3a5c10",
|
||||
"h": "92804727934e",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.12_x64.dmg",
|
||||
"size": 9183379,
|
||||
"sha256": "ecbc56ca38ad0ac6577f4901d4fd025d5b659f70745efe94c0ec8e0203d47b17",
|
||||
"h": "ecbc56ca38ad",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.10",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一回退",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.10_aarch64.dmg",
|
||||
"size": 8780299,
|
||||
"sha256": "e4599b96a640734b4703870ff475cc6b1ffff307b89732b3db57dbf286e31260",
|
||||
"h": "e4599b96a640",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.10_x64.dmg",
|
||||
"size": 9181870,
|
||||
"sha256": "fee997f2042cc237a442408926674c40ad09f24bd475c6959ba3456b22479f10",
|
||||
"h": "fee997f2042c",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.5",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.5_aarch64.dmg",
|
||||
"size": 8780166,
|
||||
"sha256": "3a92b0ab330a4fff72c2c20654010e7f250b0d2dc3f383bfec9eeb8e00017f9d",
|
||||
"h": "3a92b0ab330a",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.5_x64.dmg",
|
||||
"size": 9182578,
|
||||
"sha256": "86322e874c0d92e68926989f80f7c71cc500404fc8392c20846f86b2da6fe4e8",
|
||||
"h": "86322e874c0d",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.4",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.4_aarch64.dmg",
|
||||
"size": 8782739,
|
||||
"sha256": "b3a19df4a178f94f7b8638112bff434584f0ba85eb1ad67325cad5d0112e0bbf",
|
||||
"h": "b3a19df4a178",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.4_x64.dmg",
|
||||
"size": 9181135,
|
||||
"sha256": "21ecb123ed6f9e8d66fc7a5706e3a98ee7b9eb311a614cdd87b2c68e68cf0d56",
|
||||
"h": "21ecb123ed6f",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.3",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.3_aarch64.dmg",
|
||||
"size": 8782079,
|
||||
"sha256": "dcec1ddac76fc38567647db35fd23a7f22ffeb7773873e8673e0abcd68246311",
|
||||
"h": "dcec1ddac76f",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.3_x64.dmg",
|
||||
"size": 9179724,
|
||||
"sha256": "c52378ed1f6732c625eae6d42417f872a93025176785bc85ed8f78e3af7094df",
|
||||
"h": "c52378ed1f67",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.2",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.2_aarch64.dmg",
|
||||
"size": 8779404,
|
||||
"sha256": "7a44dfc8758ae5b9ccd7274d3bdf302de50703b7c654fe33794c94c9df7f3941",
|
||||
"h": "7a44dfc8758a",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.2_x64.dmg",
|
||||
"size": 9182709,
|
||||
"sha256": "45bb36681dc94471dfcad2632a599945dd3d687f12bfa9cd56d5201445ad2bb3",
|
||||
"h": "45bb36681dc9",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.1",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.1_aarch64.dmg",
|
||||
"size": 8781358,
|
||||
"sha256": "2d81ec8d20c8e4491939b18bb8bae7242c30f9ffd2aa1bccf53bdb75e8127a3f",
|
||||
"h": "2d81ec8d20c8",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.1_x64.dmg",
|
||||
"size": 9177163,
|
||||
"sha256": "17a8dbe940b42cd795223ddd208e8e6140d7c79935e8870c972014547591f3ed",
|
||||
"h": "17a8dbe940b4",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.0",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.0_aarch64.dmg",
|
||||
"size": 8778182,
|
||||
"sha256": "c9faea93de51ced5b8ebfb543375c05c56bf600b39341876e8b85d672a7f1f36",
|
||||
"h": "c9faea93de51",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.0_x64.dmg",
|
||||
"size": 9182493,
|
||||
"sha256": "d46e8e135911a230018943e2ded129ccdc80b8f735ff56911b48839b9170cf34",
|
||||
"h": "d46e8e135911",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.99",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.99_aarch64.dmg",
|
||||
"size": 8779519,
|
||||
"sha256": "cff18db03c8ca874a15d77df3981c6bf64e37d8f756181a56e0a8fb32d19952d",
|
||||
"h": "cff18db03c8c",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.99_x64.dmg",
|
||||
"size": 9180407,
|
||||
"sha256": "75337959ada44ecfd450874c7f93730fee6ea714408ce5314b6df2dc1ab0e4d7",
|
||||
"h": "75337959ada4",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.98",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.98_aarch64.dmg",
|
||||
"size": 8782412,
|
||||
"sha256": "ee8add89933b29a4cc868d6ac96ffa8db696955843404c365db5ee90c88fc6e8",
|
||||
"h": "ee8add89933b",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.98_x64.dmg",
|
||||
"size": 9180331,
|
||||
"sha256": "1168850d0cd13b808b9191743d19ff1d65005f0c66723acd7931d935561762e0",
|
||||
"h": "1168850d0cd1",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.97",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.97_aarch64.dmg",
|
||||
"size": 8780378,
|
||||
"sha256": "d2be87a7f7160978bf179d2c02dc3f0e4754cf3ae748341d7e4b48c9c98d53a6",
|
||||
"h": "d2be87a7f716",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.97_x64.dmg",
|
||||
"size": 9179560,
|
||||
"sha256": "745681f7c188962aaccf92932d140bcc5cc908fb395be7cd1fbe61a5ed1bc1e4",
|
||||
"h": "745681f7c188",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.96",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.96_aarch64.dmg",
|
||||
"size": 8777894,
|
||||
"sha256": "e66f339b6ed52ba68fbe5f88b3907ddbfd192750d3a89d58d881ebd8f08cb070",
|
||||
"h": "e66f339b6ed5",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.96_x64.dmg",
|
||||
"size": 9182486,
|
||||
"sha256": "5b5610543b04ad884d89464cf06a2eacd515cdd0b3b0286051a12691ac59b542",
|
||||
"h": "5b5610543b04",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.94",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一回滚",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.94_aarch64.dmg",
|
||||
"size": 8779410,
|
||||
"sha256": "6a3b0c061ccb1cb5e50ba4d203185d10872b1445f39a13f1cf80f22495b7408d",
|
||||
"h": "6a3b0c061ccb",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.94_x64.dmg",
|
||||
"size": 9176912,
|
||||
"sha256": "0c290a436b7315c530ce805cd6fc9b5ed3c7e50342c98be322260946874f62cd",
|
||||
"h": "0c290a436b73",
|
||||
"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",
|
||||
"notes": "Intel 版:同一批改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.85_aarch64.dmg",
|
||||
"size": 8777718,
|
||||
"sha256": "bb22e3d5e08b4d817a81ff5c282a0b3355dd6e7dc2e6f7adb1c467b1df38e599",
|
||||
"h": "bb22e3d5e08b",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.85_x64.dmg",
|
||||
"size": 9177291,
|
||||
"sha256": "51fc2ca757a7637cf1380279c4a72b02b634562e7d968feff0e9a526deeb36b5",
|
||||
"h": "51fc2ca757a7",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.84",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.84_aarch64.dmg",
|
||||
"size": 8777183,
|
||||
"sha256": "de10987c03ab0dc821397fee2aaf5a36848e5010bb5691bd6c884768ccdf4e30",
|
||||
"h": "de10987c03ab",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.84_x64.dmg",
|
||||
"size": 9182579,
|
||||
"sha256": "1177a9c43816f422b32923efb355337f86ec11d751155f6b18a92a36ee58adcd",
|
||||
"h": "1177a9c43816",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.83",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.83_aarch64.dmg",
|
||||
"size": 8778610,
|
||||
"sha256": "5b11d2d6a9d1814b82011bedfb44edb5d10d096dac6a68095f61709f2c48eb53",
|
||||
"h": "5b11d2d6a9d1",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.83_x64.dmg",
|
||||
"size": 9180517,
|
||||
"sha256": "71fd4ece02baceff0be2052bd1fb049d6d65042a9ba12a55d7ff28ee40ec8f79",
|
||||
"h": "71fd4ece02ba",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.82",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批调整",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.82_aarch64.dmg",
|
||||
"size": 8778844,
|
||||
"sha256": "c7424a1170039506e7d8695125991980e8da8a4df5bb3c45b115571683bb4b2a",
|
||||
"h": "c7424a117003",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.82_x64.dmg",
|
||||
"size": 9178078,
|
||||
"sha256": "7a8273b96ecb2bc8c60b70bad40209347b69e033c0e2d8c77819192d00606597",
|
||||
"h": "7a8273b96ecb",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.81",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.81_aarch64.dmg",
|
||||
"size": 8778368,
|
||||
"sha256": "40d3caf64d557fff89694bbc22bc963371b595fd806804102ec4db9e0ad339f1",
|
||||
"h": "40d3caf64d55",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.81_x64.dmg",
|
||||
"size": 9179991,
|
||||
"sha256": "22a4ee0511f695f999244a67a3c654c7e8cbfd9272c085d2d59be45d85835109",
|
||||
"h": "22a4ee0511f6",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.80",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.80_aarch64.dmg",
|
||||
"size": 8779800,
|
||||
"sha256": "c70868ef9ea1862e4f3d845bad27a60e259597ddec83c1eab0dcf37f9217ee75",
|
||||
"h": "c70868ef9ea1",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.80_x64.dmg",
|
||||
"size": 9175793,
|
||||
"sha256": "395a23fbde5a36ab1e0319331cc8303020f42a0a3ec3030575991afa5d1bc9f7",
|
||||
"h": "395a23fbde5a",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.79",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.79_aarch64.dmg",
|
||||
"size": 8779601,
|
||||
"sha256": "c812625edf06724a75d73c19f7d7ed34dfd1b1a8593c6348dc1be441b3443548",
|
||||
"h": "c812625edf06",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.79_x64.dmg",
|
||||
"size": 9176984,
|
||||
"sha256": "770f63ee92ba992cfa02de415ffec6bb91413a148c22a5bfc14ba6032e3e4422",
|
||||
"h": "770f63ee92ba",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.76",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.76_aarch64.dmg",
|
||||
"size": 8774580,
|
||||
"sha256": "33d667a2a7d9a59655ba56d426b6bfa79810d9654f4dba61c3b9ab6101b5bbdf",
|
||||
"h": "33d667a2a7d9",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.76_x64.dmg",
|
||||
"size": 9176270,
|
||||
"sha256": "983f4219909e5a6071bb09f3b78d1f751dc67a7b01ffbc99ccabfd741d7018d0",
|
||||
"h": "983f4219909e",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.74",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批改动",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.74_aarch64.dmg",
|
||||
"size": 8772912,
|
||||
"sha256": "9ce709ca908c0b52fe060d5624aa9a414fc3764779006742a7accaea645d4e11",
|
||||
"h": "9ce709ca908c",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.74_x64.dmg",
|
||||
"size": 9175077,
|
||||
"sha256": "01b7d26aa36fa308543758bcadcde1ed2fdc874391d529df0e51138279785ce3",
|
||||
"h": "01b7d26aa36f",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.73",
|
||||
"date": "2026-11-21",
|
||||
"notes": "Intel 版:同一批缩略图改造",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.73_aarch64.dmg",
|
||||
"size": 8780258,
|
||||
"sha256": "33aec504660626e6dc6492cbc52d8ba2e0053b7baaac0c3dbcb711eb50846fea",
|
||||
"h": "33aec5046606",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.73_x64.dmg",
|
||||
"size": 9175400,
|
||||
"sha256": "bac66718c4e192333df1d6aba29cc05e6868ab5ccdaf9b6556ad9a6fc93a38e8",
|
||||
"h": "bac66718c4e1",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.72",
|
||||
"date": "2026-11-20",
|
||||
"notes": "Intel 版:同一修复",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.25.72_aarch64.dmg",
|
||||
"size": 8779238,
|
||||
"sha256": "a347a6e76eaf90ad9d03fd45e00c2a0d9f018b152e88aa6eeb5aea5b8ec1c306",
|
||||
"h": "a347a6e76eaf",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.25.72_x64.dmg",
|
||||
"size": 9173174,
|
||||
"sha256": "77f9cbedc0e3329f8aec16cd8d6b8d400ae96340d01759f0d8e0153f9f668256",
|
||||
"h": "77f9cbedc0e3",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.25.71",
|
||||
"date": "2026-11-20",
|
||||
|
||||
@@ -1983,7 +1983,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.25.71"
|
||||
version = "3.26.28"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.25.71"
|
||||
version = "3.26.28"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -149,6 +149,48 @@ fn build_tray(app: &AppHandle) -> tauri::Result<()> {
|
||||
// 把「资料目录」加进本次运行的 fs scope。
|
||||
// 为什么需要它:tauri-plugin-fs 的路径白名单是**运行时**的,重启就没了;而资料目录是用户
|
||||
// 在设置里选的、存在应用配置里 ⇒ 启动时由这里重新授权一次,之后 fs 插件的读写才允许。
|
||||
/// 当前进程的常驻内存(MB)。用于状态栏显示,方便对比性能改动前后的内存占用。
|
||||
/// macOS/Linux 用 ps 读 RSS;Windows 用 PowerShell 读 WorkingSet64(作为兜底,轮询间隔 4s 可接受)。
|
||||
#[tauri::command]
|
||||
fn app_memory_mb() -> u64 {
|
||||
let pid = std::process::id();
|
||||
#[cfg(unix)]
|
||||
{
|
||||
let out = std::process::Command::new("ps")
|
||||
.args(["-o", "rss=", "-p", &pid.to_string()])
|
||||
.output();
|
||||
if let Ok(o) = out {
|
||||
if o.status.success() {
|
||||
let txt = String::from_utf8_lossy(&o.stdout);
|
||||
if let Ok(kb) = txt.trim().parse::<u64>() {
|
||||
return kb / 1024;
|
||||
}
|
||||
}
|
||||
}
|
||||
0
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let script = format!("(Get-Process -Id {}).WorkingSet64", pid);
|
||||
let out = std::process::Command::new("powershell")
|
||||
.args(["-NoProfile", "-NonInteractive", "-Command", &script])
|
||||
.output();
|
||||
if let Ok(o) = out {
|
||||
if o.status.success() {
|
||||
let txt = String::from_utf8_lossy(&o.stdout);
|
||||
if let Ok(bytes) = txt.trim().parse::<u64>() {
|
||||
return bytes / (1024 * 1024);
|
||||
}
|
||||
}
|
||||
}
|
||||
0
|
||||
}
|
||||
#[cfg(not(any(unix, windows)))]
|
||||
{
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn grant_dir(app: AppHandle, dir: String, record: Option<bool>) -> Result<String, String> {
|
||||
let p = std::path::PathBuf::from(&dir);
|
||||
@@ -847,7 +889,8 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||
.invoke_handler(tauri::generate_handler![open_app_data_dir, grant_dir, copy_tree, check_update, install_update, clipboard_read_image, clipboard_write_image, clipboard_write_text, clipboard_read_text, open_external_url, open_browser_window, browser_control, browser_state, canvas_webview_ensure, canvas_webview_bounds, canvas_webview_navigate, canvas_webview_action, canvas_webview_state, canvas_webview_close_all, canvas_webview_metrics, notify_desktop])
|
||||
.invoke_handler(tauri::generate_handler![open_app_data_dir, grant_dir, copy_tree, check_update, install_update, clipboard_read_image, clipboard_write_image, clipboard_write_text, clipboard_read_text, open_external_url, open_browser_window, browser_control, browser_state, canvas_webview_ensure, canvas_webview_bounds, canvas_webview_navigate, canvas_webview_action, canvas_webview_state, canvas_webview_close_all, canvas_webview_metrics, notify_desktop,
|
||||
app_memory_mb])
|
||||
.setup(|app| {
|
||||
if cfg!(debug_assertions) {
|
||||
app.handle().plugin(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.25.71",
|
||||
"version": "3.26.28",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
|
||||
const cache = new Map() // key: gap|dot|color → dataURL
|
||||
|
||||
function createTile (gap, dot, color) {
|
||||
function createTile (gap, dot, color, style) {
|
||||
if (typeof document === 'undefined') return null
|
||||
const g = Math.max(4, Math.round(gap))
|
||||
const key = g + '|' + dot + '|' + color
|
||||
const st = (style === 'lines') ? 'lines' : 'dots'
|
||||
const key = g + '|' + dot + '|' + color + '|' + st
|
||||
const hit = cache.get(key)
|
||||
if (hit) return hit
|
||||
try {
|
||||
@@ -29,9 +30,16 @@
|
||||
const ctx = cv.getContext('2d')
|
||||
if (!ctx) return null
|
||||
ctx.fillStyle = color
|
||||
ctx.beginPath()
|
||||
ctx.arc(g / 2, g / 2, Math.max(0.5, dot), 0, Math.PI * 2)
|
||||
ctx.fill()
|
||||
if (st === 'lines') {
|
||||
// 网格线:画右/下两条 1px 线,平铺后即连续网格(v3.25.75)
|
||||
const w = Math.max(1, Math.round(Math.min(2, dot * 0.6)))
|
||||
ctx.fillRect(g - w, 0, w, g)
|
||||
ctx.fillRect(0, g - w, g, w)
|
||||
} else {
|
||||
ctx.beginPath()
|
||||
ctx.arc(g / 2, g / 2, Math.max(0.5, dot), 0, Math.PI * 2)
|
||||
ctx.fill()
|
||||
}
|
||||
const url = cv.toDataURL('image/png')
|
||||
if (cache.size > 24) cache.clear()
|
||||
cache.set(key, url)
|
||||
@@ -44,7 +52,7 @@
|
||||
const o = opts || {}
|
||||
const base = Math.max(4, Number(o.base) || 28)
|
||||
const gap = Math.max(4, base * (Number(scale) > 0 ? Number(scale) : 1))
|
||||
const url = createTile(gap, o.dot || 1.2, o.color || 'rgba(120,128,140,0.55)')
|
||||
const url = createTile(gap, o.dot || 1.2, o.color || 'rgba(120,128,140,0.55)', o.style)
|
||||
if (!url) return null
|
||||
return {
|
||||
backgroundImage: 'url(' + url + ')',
|
||||
@@ -59,12 +67,13 @@
|
||||
const o = opts || {}
|
||||
const base = Math.max(4, Number(o.base) || 28)
|
||||
const gap = Math.max(4, base * (Number(scale) > 0 ? Number(scale) : 1))
|
||||
const url = createTile(gap, o.dot || 1.2, o.color || 'rgba(120,128,140,0.55)')
|
||||
const url = createTile(gap, o.dot || 1.2, o.color || 'rgba(120,128,140,0.55)', o.style)
|
||||
if (url) {
|
||||
if (el.dataset.gap !== String(gap)) {
|
||||
if (el.dataset.gap !== String(gap) || el.dataset.style !== String(o.style || 'dots')) {
|
||||
el.style.backgroundImage = 'url(' + url + ')'
|
||||
el.style.backgroundSize = gap + 'px ' + gap + 'px'
|
||||
el.dataset.gap = String(gap)
|
||||
el.dataset.style = String(o.style || 'dots')
|
||||
}
|
||||
el.style.transform = 'translate(' + (x % gap) + 'px, ' + (y % gap) + 'px)'
|
||||
}
|
||||
|
||||
@@ -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,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 立刻把当前可见的原生 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 }
|
||||
}
|
||||
|
||||
function install() {
|
||||
if (started) return
|
||||
started = true
|
||||
@@ -733,6 +755,18 @@
|
||||
mo.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: [ATTR] })
|
||||
}
|
||||
global.addEventListener('resize', function () { refreshOffsets() })
|
||||
// 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 +785,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 查,不需要宿主注入依赖
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
/* image-display-thumb.js —— 画布内大图的显示缩略图生成队列(v3.25.67)
|
||||
/* image-display-thumb.js —— 画布内大图的显示缩略图生成队列(v3.25.67 起,v3.25.73 重写)
|
||||
*
|
||||
* 为什么单独成模块:
|
||||
* 1) 规则要求 app.js 只做装配(行数棘轮),生成逻辑必须落到 src/<domain>-*.js;
|
||||
* 2) 这段逻辑与 React 无关,纯 DOM/canvas,便于单测。
|
||||
* 职责:把一张原图(blob:/http/dataURL)变成 ≤768 的显示缩略图,并交给宿主缓存/落盘。
|
||||
*
|
||||
* 背景(实测数据):某画布 27 张参考图是 2160×2880 的远程 PNG(单张约 2MB,解码后约 25MB 位图)。
|
||||
* 旧实现每张图在渲染时立刻 new Image() 解码整图 —— 27 张并发 ≈ 670MB 位图,
|
||||
* 主线程被解码 + canvas 缩放占满,表现就是「打开这个画布很卡」。
|
||||
*
|
||||
* 本模块做三件事:
|
||||
* ① 并发上限(默认 2):排队生成,不再一次性解码几十张;
|
||||
* ② 空闲启动:requestIdleCallback(有则用),首帧渲染优先;
|
||||
* ③ 结果写回宿主的缓存 Map,并落盘(宿主注入 save),下次打开直接读盘。
|
||||
* v3.25.73(参考 basketikun/infinite-canvas 的 image-thumbnail.ts):
|
||||
* ① 优先 createImageBitmap(blob) → canvas → toBlob('image/webp', 0.86) → **objectURL**
|
||||
* —— 解码在目标尺寸完成,产物是 Blob(objectURL)而不是 dataURL,不常驻 JS 堆;
|
||||
* ② 拿不到字节(跨域等)才回落到 <img> + canvas + dataURL(老路径);
|
||||
* ③ 并发上限 2 + requestIdleCallback 空闲启动,避免打开画布时同时解码几十张;
|
||||
* ④ 宿主注入 save(key, blobOrDataUrl):负责落盘(文件存储)。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
@@ -35,8 +31,48 @@
|
||||
}
|
||||
cache.set(key, val)
|
||||
}
|
||||
const bump = () => { try { if (typeof o.bump === 'function') o.bump() } catch (e) { /* ignore */ } }
|
||||
const save = (key, payload) => { try { if (typeof o.save === 'function') o.save(key, payload) } catch (e) { /* ignore */ } }
|
||||
|
||||
const run = (key, v) => new Promise((resolve) => {
|
||||
// ① 优先路径:字节 → bitmap → 缩放 → WebP Blob → objectURL
|
||||
const runBitmap = async (key, v) => {
|
||||
if (typeof fetch !== 'function' || typeof createImageBitmap !== 'function') return false
|
||||
const resp = await fetch(v)
|
||||
if (!resp || !resp.ok) return false
|
||||
const blob = await resp.blob()
|
||||
const bitmap = await createImageBitmap(blob)
|
||||
const iw = bitmap.width || 0
|
||||
const ih = bitmap.height || 0
|
||||
try {
|
||||
if (!iw || !ih) return false
|
||||
if (iw <= max && ih <= max) {
|
||||
remember(key, v)
|
||||
return true
|
||||
}
|
||||
const scale = Math.min(max / Math.max(1, iw), max / Math.max(1, ih))
|
||||
const cw = Math.max(1, Math.round(iw * scale))
|
||||
const ch = Math.max(1, Math.round(ih * scale))
|
||||
const cv = document.createElement('canvas')
|
||||
cv.width = cw
|
||||
cv.height = ch
|
||||
const ctx = cv.getContext('2d')
|
||||
if (!ctx) return false
|
||||
ctx.drawImage(bitmap, 0, 0, cw, ch)
|
||||
const small = await new Promise((res) => {
|
||||
try { cv.toBlob((b) => res(b || null), 'image/webp', 0.86) } catch (e) { res(null) }
|
||||
})
|
||||
if (!small) return false
|
||||
const url = URL.createObjectURL(small)
|
||||
remember(key, url)
|
||||
save(key, small)
|
||||
return true
|
||||
} finally {
|
||||
try { bitmap.close() } catch (e) { /* ignore */ }
|
||||
}
|
||||
}
|
||||
|
||||
// ② 回落路径:<img> + canvas → dataURL(跨域时 fetch 会失败)
|
||||
const runImg = (key, v) => new Promise((resolve) => {
|
||||
if (typeof document === 'undefined' || typeof Image !== 'function') { resolve(false); return }
|
||||
const img = new Image()
|
||||
try { img.decoding = 'async' } catch (e) { /* ignore */ }
|
||||
@@ -56,19 +92,25 @@
|
||||
ctx.drawImage(img, 0, 0, cw, ch)
|
||||
const small = cv.toDataURL('image/jpeg', 0.78)
|
||||
remember(key, small)
|
||||
try { if (typeof o.save === 'function') o.save(key, small) } catch (e) { /* ignore */ }
|
||||
save(key, small)
|
||||
resolve(true)
|
||||
} catch (e) { remember(key, v); resolve(false) }
|
||||
try { if (typeof o.bump === 'function') o.bump() } catch (e) { /* ignore */ }
|
||||
}
|
||||
img.onerror = () => {
|
||||
// Cache 虚拟路径 404 属于 SW 未接管,不可负缓存(否则恢复后仍空白)
|
||||
try { if (!(typeof o.isTransient === 'function' && o.isTransient(v))) remember(key, v) } catch (e) { /* ignore */ }
|
||||
resolve(false)
|
||||
}
|
||||
img.src = v
|
||||
})
|
||||
|
||||
const run = async (key, v) => {
|
||||
let ok = false
|
||||
try { ok = await runBitmap(key, v) } catch (e) { ok = false }
|
||||
if (!ok) { try { ok = await runImg(key, v) } catch (e2) { ok = false } }
|
||||
if (ok) bump()
|
||||
return ok
|
||||
}
|
||||
|
||||
const pump = () => {
|
||||
while (running < concurrency && queue.length) {
|
||||
const job = queue.shift()
|
||||
@@ -92,7 +134,6 @@
|
||||
}
|
||||
|
||||
return {
|
||||
/** 入队生成;已有缓存/已在队列则忽略 */
|
||||
queue: function (key, v) {
|
||||
if (!key || cache.has(key) || pending.has(key)) return false
|
||||
pending.add(key)
|
||||
@@ -100,8 +141,7 @@
|
||||
schedule()
|
||||
return true
|
||||
},
|
||||
/** 队列/运行中任务数(诊断用) */
|
||||
stats: function () { return { queued: queue.length, running: running } },
|
||||
stats: function () { return { queued: queue.length, running: running } }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/* image-remote-cache.js —— 远程参考图本地缓存(v3.25.80)
|
||||
*
|
||||
* 目的:远程参考图(如 ibb.co)每次打开画布都重新下载,慢且耗流量。
|
||||
* 做法:空闲时下载一次,写入本地引用存储,节点上只记 data.localRef(显示用)。
|
||||
*
|
||||
* 约束(用户裁定):节点 data.url 保持原样 ⇒ **提交生成时仍然用链接**。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
const React = global.React || {}
|
||||
|
||||
function useRemoteRefCache (opts) {
|
||||
const o = opts || {}
|
||||
const tried = React.useRef(new Set())
|
||||
React.useEffect(() => {
|
||||
if (!o.enabled) return undefined
|
||||
const pend = (o.nodes || []).filter((n) => n && n.type === 'ref' && n.data && !n.data.data && !n.data.localRef &&
|
||||
/^https?:\/\//i.test(String(n.data.url || '')) && !tried.current.has(n.id))
|
||||
if (!pend.length) return undefined
|
||||
const timer = setTimeout(() => {
|
||||
(async () => {
|
||||
for (const n of pend) {
|
||||
tried.current.add(n.id)
|
||||
try {
|
||||
const url = String((n.data && n.data.url) || '')
|
||||
if (!url) continue
|
||||
const resp = await fetch(url, { credentials: 'omit' })
|
||||
if (!resp || !resp.ok) continue
|
||||
const blob = await resp.blob()
|
||||
if (!blob || !blob.size) continue
|
||||
const dataUrl = await new Promise((res, rej) => {
|
||||
const rd = new FileReader()
|
||||
rd.onload = () => res(String(rd.result || ''))
|
||||
rd.onerror = () => rej(new Error('read-failed'))
|
||||
rd.readAsDataURL(blob)
|
||||
})
|
||||
if (!dataUrl) continue
|
||||
const ref = await o.writeRef(dataUrl)
|
||||
if (ref) { o.updateNode(n.id, { localRef: ref }); break }
|
||||
} catch (e) { /* 跨域/离线:保留 url 显示,不重试 */ }
|
||||
}
|
||||
})()
|
||||
}, 2500)
|
||||
return () => clearTimeout(timer)
|
||||
}, [o.enabled, o.activeWsId, o.nodes])
|
||||
}
|
||||
|
||||
// 非 Hook 版本:宿主在自己的 effect 里调用,返回 stop()。
|
||||
function startRemoteRefCache (opts) {
|
||||
const o = opts || {}
|
||||
const tried = new Set()
|
||||
const timer = setInterval(() => {
|
||||
let st = null
|
||||
try { st = typeof o.getState === 'function' ? o.getState() : null } catch (e) { st = null }
|
||||
if (!st || !st.enabled || !Array.isArray(st.nodes)) return
|
||||
const next = st.nodes.find((n) => n && n.type === 'ref' && n.data && !n.data.data && !n.data.localRef &&
|
||||
/^https?:\/\//i.test(String(n.data.url || '')) && !tried.has(n.id))
|
||||
if (!next) return
|
||||
tried.add(next.id)
|
||||
const url = String((next.data && next.data.url) || '')
|
||||
if (!url) return
|
||||
;(async () => {
|
||||
try {
|
||||
const resp = await fetch(url, { credentials: 'omit' })
|
||||
if (!resp || !resp.ok) return
|
||||
const blob = await resp.blob()
|
||||
if (!blob || !blob.size) return
|
||||
const dataUrl = await new Promise((res, rej) => {
|
||||
const rd = new FileReader()
|
||||
rd.onload = () => res(String(rd.result || ''))
|
||||
rd.onerror = () => rej(new Error('read-failed'))
|
||||
rd.readAsDataURL(blob)
|
||||
})
|
||||
if (!dataUrl) return
|
||||
const ref = await o.writeRef(dataUrl)
|
||||
if (ref && typeof o.updateNode === 'function') o.updateNode(next.id, { localRef: ref })
|
||||
} catch (e) { /* 跨域/离线:保留 url 显示,不重试 */ }
|
||||
})()
|
||||
}, 4000)
|
||||
return () => clearInterval(timer)
|
||||
}
|
||||
|
||||
function attach (opts) { return startRemoteRefCache(opts) }
|
||||
|
||||
global.IWBImageRemoteCache = { useRemoteRefCache, startRemoteRefCache, attach }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -0,0 +1,63 @@
|
||||
/* image-thumb-pick.js —— 缩略图 key / 按需切原图 / 入库预热(v3.25.73)
|
||||
*
|
||||
* 拆出来的原因:逻辑需要画布侧的映射(引用表、缓存 Map、引用解析函数),
|
||||
* 但规则要求 app.js 只做装配(行数棘轮),所以这里只放纯逻辑,依赖全部注入。
|
||||
*
|
||||
* 参考实现:basketikun/infinite-canvas 的 lib/image-thumbnail.ts#pickImageSource
|
||||
* —— 用「屏幕需要的像素」决定用缩略图还是原图,而不是「有缩略图就一直用」。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
|
||||
function create (deps) {
|
||||
const d = deps || {}
|
||||
const cache = d.cache // Map<stableKey, url>
|
||||
const max = Math.max(64, Number(d.max) || 768)
|
||||
|
||||
// 稳定 key:引用图用 ref:<b:sha|c:key>(跨会话不变);blob URL 反查引用;其余走原规则
|
||||
function keyOf (v) {
|
||||
if (v && typeof v === 'object') {
|
||||
const k = typeof d.refKeyOf === 'function' ? d.refKeyOf(v) : ''
|
||||
return k ? ('ref:' + k) : ''
|
||||
}
|
||||
const str = String(v || '')
|
||||
if (str.indexOf('blob:') === 0) {
|
||||
try {
|
||||
const ref = d.refByUrl instanceof Map ? d.refByUrl.get(str) : null
|
||||
const rk = ref && typeof d.refKeyOf === 'function' ? d.refKeyOf(ref) : ''
|
||||
if (rk) return 'ref:' + rk
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
return typeof d.rawKeyOf === 'function' ? d.rawKeyOf(str) : ''
|
||||
}
|
||||
|
||||
// 屏幕上需要的长边 = 渲染长边 × 缩放 × dpr;超过缩略图长边才用原图
|
||||
function srcForNode (v, renderedLongEdge, scale) {
|
||||
const key = keyOf(v)
|
||||
const thumb = key && cache ? cache.get(key) : ''
|
||||
const dpr = (typeof global.devicePixelRatio === 'number' && global.devicePixelRatio > 0) ? global.devicePixelRatio : 1
|
||||
const s = Number(scale)
|
||||
const need = Math.max(1, Number(renderedLongEdge) || 0) * (Number.isFinite(s) && s > 0 ? s : 1) * dpr
|
||||
if (thumb && need <= max) return thumb
|
||||
const orig = (v && typeof v === 'object')
|
||||
? ((typeof d.resolveImg === 'function' ? d.resolveImg(v) : '') || '')
|
||||
: String(v || '')
|
||||
if (!thumb && key && orig && typeof d.queue === 'function') d.queue(key, orig)
|
||||
return orig
|
||||
}
|
||||
|
||||
// 入库预热:字节还在内存里,此时生成缩略图最便宜
|
||||
function prime (ref, dataUrl) {
|
||||
try {
|
||||
if (!ref || typeof dataUrl !== 'string' || dataUrl.indexOf('data:') !== 0) return false
|
||||
const key = keyOf(ref)
|
||||
if (!key || (cache && cache.has(key)) || typeof d.queue !== 'function') return false
|
||||
return d.queue(key, dataUrl)
|
||||
} catch (e) { return false }
|
||||
}
|
||||
|
||||
return { keyOf: keyOf, srcForNode: srcForNode, prime: prime }
|
||||
}
|
||||
|
||||
global.IWBImageThumbPick = { create: create }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -5,7 +5,11 @@
|
||||
* save({prompts, groups}) → 落盘(宿主仍持有数据:iwb_web_prompts + 分组缓存)
|
||||
* insert(text, name) → 在画布视口中心插入提示词节点(插件不碰画布状态)
|
||||
* copy(text) → 走宿主剪贴板(失败有可见提示)
|
||||
* insertImage(cover, name) → 把封面作为参考图节点插入画布
|
||||
* notify(text, type) → 宿主 toast / 提示条
|
||||
* putCover(dataUrl) → 封面入宿主图片库(返回 ref)
|
||||
* coverUrl(ref) → 封面展示地址
|
||||
* removeCover(ref) → 解引用(图片由 GC 回收)
|
||||
* onChanged(fn) → 数据变化(收藏/其它标签页同步/插件自己保存)
|
||||
*
|
||||
* 与 gallery / grouplib 同一套「impl 桥」:capability 在 PluginHost.init 时创建(早于 Workbench 渲染),
|
||||
@@ -40,7 +44,11 @@
|
||||
save: call('save'),
|
||||
insert: call('insert'),
|
||||
copy: call('copy'),
|
||||
insertImage: call('insertImage'),
|
||||
notify: call('notify'),
|
||||
putCover: call('putCover'),
|
||||
coverUrl: call('coverUrl'),
|
||||
removeCover: call('removeCover'),
|
||||
onChanged: function (fn) {
|
||||
if (typeof fn !== 'function') return function () {}
|
||||
listeners.push(fn)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -897,16 +897,143 @@
|
||||
}
|
||||
|
||||
// 画布显示缩略图(768px)落盘:重启后直接命中,不用重新解码 4K 原图
|
||||
// v3.25.78:缩略图可能是 webp(新)或 jpg(老),按扩展名决定 MIME。
|
||||
// 旧代码把 WebP 字节写进 _768.jpg 名字里 ⇒ dataURL 声明成 image/jpeg,属于格式错配。
|
||||
// v3.25.78:缩略图文件名曾把 WebP 写成 .jpg(老 bug),所以 MIME 必须按**魔数**判断,
|
||||
// 不能只看扩展名,否则 <img> 拿到错 MIME 的 blob 可能渲染成黑块。
|
||||
function sniffMime (u8) {
|
||||
try {
|
||||
if (!u8 || u8.length < 12) return ''
|
||||
if (u8[0] === 0xFF && u8[1] === 0xD8 && u8[2] === 0xFF) return 'image/jpeg'
|
||||
if (u8[0] === 0x89 && u8[1] === 0x50 && u8[2] === 0x4E && u8[3] === 0x47) return 'image/png'
|
||||
if (u8[0] === 0x52 && u8[1] === 0x49 && u8[2] === 0x46 && u8[3] === 0x46 &&
|
||||
u8[8] === 0x57 && u8[9] === 0x45 && u8[10] === 0x42 && u8[11] === 0x50) return 'image/webp'
|
||||
if (u8[0] === 0x47 && u8[1] === 0x49 && u8[2] === 0x46) return 'image/gif'
|
||||
} catch (e) { /* ignore */ }
|
||||
return ''
|
||||
}
|
||||
|
||||
async function thumbFileOf (hash) {
|
||||
const base = await join(dir, IMG_DIR, 'thumbs', String(hash) + '_768')
|
||||
for (const ext of ['.webp', '.jpg']) {
|
||||
try { if (await fs().exists(base + ext)) return { path: base + ext, mime: ext === '.webp' ? 'image/webp' : 'image/jpeg' } } catch (e) { /* ignore */ }
|
||||
}
|
||||
return null
|
||||
}
|
||||
async function readDisplayThumb(hash) {
|
||||
try {
|
||||
if (!enabled() || !dir || !hash) return ''
|
||||
const abs = await join(dir, IMG_DIR, 'thumbs', String(hash) + '_768.jpg')
|
||||
if (!(await fs().exists(abs))) return ''
|
||||
const u8 = await fs().readFile(abs)
|
||||
const f = await thumbFileOf(hash)
|
||||
if (!f) return ''
|
||||
const u8 = await fs().readFile(f.path)
|
||||
if (!u8 || !u8.length) return ''
|
||||
return bytesToDataUrl('image/jpeg', u8)
|
||||
return bytesToDataUrl(sniffMime(u8) || f.mime, u8)
|
||||
} catch (e) { return '' }
|
||||
}
|
||||
// v3.25.73:缩略图以 Blob + objectURL 交给显示层(避免 dataURL 常驻 JS 堆)
|
||||
const thumbUrlCache = new Map() // hash → objectURL
|
||||
async function readDisplayThumbUrl(hash) {
|
||||
try {
|
||||
if (!enabled() || !dir || !hash) return ''
|
||||
const hit = thumbUrlCache.get(String(hash))
|
||||
if (hit) return hit
|
||||
const f = await thumbFileOf(hash)
|
||||
if (!f) return ''
|
||||
const u8 = await fs().readFile(f.path)
|
||||
if (!u8 || !u8.length) return ''
|
||||
const url = URL.createObjectURL(new Blob([u8], { type: sniffMime(u8) || f.mime }))
|
||||
thumbUrlCache.set(String(hash), url)
|
||||
// 不 revoke:这个 URL 可能正在被画布上的 <img> 使用,撤销会变成黑块/破图。
|
||||
if (thumbUrlCache.size > 600) { const k = thumbUrlCache.keys().next().value; try { thumbUrlCache.delete(k) } catch (e) { /* ignore */ } }
|
||||
return url
|
||||
} catch (e) { return '' }
|
||||
}
|
||||
// v3.25.78:缩略图没有回收机制,历史上会无限增长(实测 470 个 / 67MB)。
|
||||
// 这里按总大小封顶(默认 300MB,超了删最老的 20%),缩略图可再生,删掉不影响数据。
|
||||
async function pruneThumbs (maxMB) {
|
||||
try {
|
||||
if (!enabled() || !dir) return 0
|
||||
const cap = Math.max(50, Number(maxMB) || 300) * 1024 * 1024
|
||||
const tdir = await join(dir, IMG_DIR, 'thumbs')
|
||||
if (!(await fs().exists(tdir))) return 0
|
||||
const names = await fs().readDir(tdir)
|
||||
const files = []
|
||||
let total = 0
|
||||
for (const e of names) {
|
||||
const name = e && (e.name || e)
|
||||
if (!name || !/(_768\.(webp|jpg)|^[0-9a-f]{16}\.(webp|jpg|jpeg|png))$/i.test(String(name))) continue
|
||||
const abs = await join(tdir, String(name))
|
||||
try {
|
||||
const st = await fs().stat(abs)
|
||||
const size = (st && st.size) || 0
|
||||
total += size
|
||||
files.push({ abs, size, mtime: (st && st.mtime) ? new Date(st.mtime).getTime() : 0 })
|
||||
} catch (err) { /* ignore */ }
|
||||
}
|
||||
if (total <= cap) return 0
|
||||
files.sort((a, b) => a.mtime - b.mtime)
|
||||
const target = cap * 0.8
|
||||
let removed = 0
|
||||
for (const f of files) {
|
||||
if (total <= target) break
|
||||
try { await fs().remove(f.abs); total -= f.size; removed++ } catch (e) { /* ignore */ }
|
||||
}
|
||||
return removed
|
||||
} catch (e) { return 0 }
|
||||
}
|
||||
|
||||
// v3.25.80:images/legacy 是旧版迁移残留。只删**未被任何画布/图库清单引用**且超过 7 天的文件,
|
||||
// 引用中的文件永远不动;返回删除数量。
|
||||
async function cleanupLegacy (referencedNames) {
|
||||
try {
|
||||
if (!enabled() || !dir) return 0
|
||||
const ldir = await join(dir, IMG_DIR, 'legacy')
|
||||
if (!(await fs().exists(ldir))) return 0
|
||||
const keep = new Set((referencedNames || []).map((x) => String(x)))
|
||||
const names = await fs().readDir(ldir)
|
||||
const now = Date.now()
|
||||
let removed = 0
|
||||
for (const e of names) {
|
||||
const name = e && (e.name || e)
|
||||
if (!name || keep.has(String(name))) continue
|
||||
const abs = await join(ldir, String(name))
|
||||
try {
|
||||
const st = await fs().stat(abs)
|
||||
const mtime = (st && st.mtime) ? new Date(st.mtime).getTime() : 0
|
||||
if (now - mtime < 7 * 86400e3) continue
|
||||
await fs().remove(abs)
|
||||
removed++
|
||||
} catch (err) { /* ignore */ }
|
||||
}
|
||||
return removed
|
||||
} catch (e) { return 0 }
|
||||
}
|
||||
|
||||
// v3.25.80:启动维护入口(缩略图封顶 + legacy 未引用清理),宿主只调这一个
|
||||
async function maintain (opts) {
|
||||
const o = opts || {}
|
||||
const a = await pruneThumbs(o.maxMB).catch(() => 0)
|
||||
const b = await cleanupLegacy(o.keep).catch(() => 0)
|
||||
return { thumbs: a, legacy: b }
|
||||
}
|
||||
|
||||
async function writeDisplayThumbBlob(hash, blob) {
|
||||
try {
|
||||
if (!enabled() || !dir || !hash || !blob) return false
|
||||
const isWebp = String(blob.type || '').indexOf('webp') >= 0
|
||||
const abs = await join(dir, IMG_DIR, 'thumbs', String(hash) + '_768' + (isWebp ? '.webp' : '.jpg'))
|
||||
if (await fs().exists(abs)) return true
|
||||
try {
|
||||
const other = await join(dir, IMG_DIR, 'thumbs', String(hash) + '_768' + (isWebp ? '.jpg' : '.webp'))
|
||||
if (await fs().exists(other)) return true
|
||||
} catch (e) { /* ignore */ }
|
||||
await fs().mkdir(await join(dir, IMG_DIR, 'thumbs'), { recursive: true })
|
||||
const buf = new Uint8Array(await blob.arrayBuffer())
|
||||
await fs().writeFile(abs, buf)
|
||||
return true
|
||||
} catch (e) { return false }
|
||||
}
|
||||
|
||||
async function writeDisplayThumb(hash, dataUrl) {
|
||||
try {
|
||||
if (!enabled() || !dir || !hash || !dataUrl) return false
|
||||
@@ -1005,7 +1132,7 @@
|
||||
}
|
||||
|
||||
global.IWBStorageFile = {
|
||||
enabled, ready: init, flush, runtime, pickDir, switchTo, migrateTo, gcImages, rotateTrash, galleryThumb, readDisplayThumb, writeDisplayThumb,
|
||||
enabled, ready: init, flush, runtime, pickDir, switchTo, migrateTo, gcImages, rotateTrash, galleryThumb, readDisplayThumb, readDisplayThumbUrl, writeDisplayThumb, writeDisplayThumbBlob, pruneThumbs, cleanupLegacy, maintain,
|
||||
plugins: { manifest: pluginManifest, read: pluginRead, write: pluginWrite, remove: pluginRemove, dir: pluginDir, listLocal: pluginListLocal, listDirs: pluginListDirs, readFile: pluginReadFile, writeFile: pluginWriteFile, writeBinary: pluginWriteBinary, mkdir: pluginMkdir, removeDir: pluginRemoveDir, renameDir: pluginRenameDir, existsDir: pluginExistsDir },
|
||||
pluginData: { read: pluginDataRead, write: pluginDataWrite, remove: pluginDataRemove, list: pluginDataList },
|
||||
storage: () => storage,
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
/* theme-tokens.js —— 配色自动适配(v3.25.81,P1)
|
||||
*
|
||||
* 用户裁定:只定 4 个「种子」,其余颜色由函数派生:
|
||||
* ① 中性基调 seedNeutral(一个中灰)
|
||||
* ② 画布深浅 depth(0~60:画布相对 UI 底色的明暗差)
|
||||
* ③ 强调色 seedAccent(按钮/端口/选中框)
|
||||
* ④ 模式(亮 / 暗,跟随系统在调用方决定)
|
||||
*
|
||||
* 派生规则:
|
||||
* · 亮色:往白里 mix(越靠表面越白),画布往灰里 mix
|
||||
* · 暗色:往黑里 mix(同一套语义名,方向相反)
|
||||
* · 文本对表面做 4.5:1 对比度夹紧(不够就自动加深/提亮)
|
||||
* 产出沿用现有 --iwb-* 变量名,CSS 不需要重写。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
|
||||
function normHex (v) {
|
||||
const s = String(v || '').trim()
|
||||
if (!/^#[0-9a-fA-F]{3,8}$/.test(s)) return ''
|
||||
if (s.length === 4) return ('#' + s[1] + s[1] + s[2] + s[2] + s[3] + s[3]).toLowerCase()
|
||||
return s.slice(0, 7).toLowerCase()
|
||||
}
|
||||
function hexToRgb (h) {
|
||||
const s = normHex(h) || '#808080'
|
||||
return { r: parseInt(s.slice(1, 3), 16), g: parseInt(s.slice(3, 5), 16), b: parseInt(s.slice(5, 7), 16) }
|
||||
}
|
||||
function toHex (c) {
|
||||
const p = (n) => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, '0')
|
||||
return '#' + p(c.r) + p(c.g) + p(c.b)
|
||||
}
|
||||
// t=0 → a,t=1 → b
|
||||
function mix (a, b, t) {
|
||||
const A = hexToRgb(a)
|
||||
const B = hexToRgb(b)
|
||||
const k = Math.max(0, Math.min(1, Number(t) || 0))
|
||||
return toHex({ r: A.r + (B.r - A.r) * k, g: A.g + (B.g - A.g) * k, b: A.b + (B.b - A.b) * k })
|
||||
}
|
||||
function lum (h) {
|
||||
const c = hexToRgb(h)
|
||||
const f = (v) => { const x = v / 255; return x <= 0.03928 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4) }
|
||||
return 0.2126 * f(c.r) + 0.7152 * f(c.g) + 0.0722 * f(c.b)
|
||||
}
|
||||
function contrast (a, b) {
|
||||
const l1 = Math.max(lum(a), lum(b))
|
||||
const l2 = Math.min(lum(a), lum(b))
|
||||
return (l1 + 0.05) / (l2 + 0.05)
|
||||
}
|
||||
// 文本对表面做对比度夹紧:不够就朝「远离表面」的方向继续 mix
|
||||
function clampText (fg, bg, minRatio) {
|
||||
const min = Number(minRatio) || 4.5
|
||||
let out = fg
|
||||
const away = lum(bg) > 0.5 ? '#000000' : '#ffffff'
|
||||
for (let i = 0; i < 12; i++) {
|
||||
if (contrast(out, bg) >= min) break
|
||||
out = mix(out, away, 0.12)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
const DEFAULTS = { seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22 }
|
||||
|
||||
function derive (cfg, dark) {
|
||||
const c = cfg || {}
|
||||
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)))
|
||||
const d = !!dark
|
||||
const t = d ? '#000000' : '#ffffff'
|
||||
|
||||
// 表面阶:亮色往白、暗色往黑
|
||||
const surface0 = mix(N, t, d ? 0.86 : 0.94)
|
||||
const surface1 = mix(N, t, d ? 0.78 : 0.99)
|
||||
const surface2 = mix(N, t, d ? 0.70 : 0.90)
|
||||
const surface3 = mix(N, t, d ? 0.64 : 0.84)
|
||||
// 画布:亮色更深、暗色略亮(与 UI 拉开层次)
|
||||
const canvas = d ? mix(surface0, '#ffffff', depth / 100 * 0.6) : mix(surface0, '#000000', depth / 100 * 0.9)
|
||||
const border = mix(N, t, d ? 0.52 : 0.52)
|
||||
const border2 = mix(N, t, d ? 0.40 : 0.34)
|
||||
const layer = mix(N, t, d ? 0.66 : 0.92)
|
||||
const nodeBg = mix(N, t, d ? 0.72 : 0.88)
|
||||
const textBase = mix(N, t, d ? 0.06 : 0.06)
|
||||
const text = clampText(textBase, surface0, 4.5)
|
||||
const text2 = clampText(mix(N, t, d ? 0.30 : 0.34), surface0, 3.2)
|
||||
const brand = A
|
||||
const brandHover = mix(A, d ? '#ffffff' : '#000000', 0.14)
|
||||
const edgeHot = d ? mix(A, '#ffffff', 0.25) : A
|
||||
const gridDot = mix(N, t, d ? 0.36 : 0.30)
|
||||
|
||||
// 语义色:色相固定,明度随主题调整(暗色提亮一档,避免发闷)
|
||||
const err = d ? mix('#ef4444', '#ffffff', 0.18) : '#ef4444'
|
||||
const ok = d ? mix('#22c55e', '#ffffff', 0.18) : '#22c55e'
|
||||
const warn = d ? mix('#d97706', '#ffffff', 0.22) : '#d97706'
|
||||
// 品牌色上的文字:按对比度自动选黑/白
|
||||
const onBrand = contrast('#ffffff', brand) >= 4.5 ? '#ffffff' : '#1c2333'
|
||||
|
||||
return {
|
||||
err, ok, warn, onBrand,
|
||||
bg: surface0,
|
||||
panel: surface1,
|
||||
layer,
|
||||
layer2: d ? surface1 : '#ffffff',
|
||||
nodeBg,
|
||||
canvasBg: canvas,
|
||||
chrome: mix(surface0, canvas, 0.4),
|
||||
homeBg: mix(surface0, canvas, 0.35),
|
||||
dockBg: mix(surface3, canvas, 0.45),
|
||||
// v3.26.19:顶栏比停靠栏更浅(向面板色靠 55%),不再压暗
|
||||
dockHeadBg: mix(mix(surface3, canvas, 0.45), surface0, 0.55),
|
||||
border,
|
||||
border2,
|
||||
text,
|
||||
text2,
|
||||
brand,
|
||||
brandHover,
|
||||
edge: border2,
|
||||
edgeHot,
|
||||
gridDot,
|
||||
// v3.26.20:插件通用灰(中性灰,不带蓝调;暗色模式跟随主题,不再固定浅色)
|
||||
pluginSurface: d ? mix(surface0, '#ffffff', 0.07) : mix(surface1, '#000000', 0.035),
|
||||
pluginCard: d ? mix(surface0, '#ffffff', 0.11) : surface1,
|
||||
pluginInset: d ? mix(surface0, '#000000', 0.12) : mix(surface1, '#000000', 0.075),
|
||||
pluginHover: d ? mix(surface0, '#ffffff', 0.16) : mix(surface1, '#000000', 0.11),
|
||||
}
|
||||
}
|
||||
|
||||
function applyTo (root, tokens) {
|
||||
if (!root || !root.style) return
|
||||
const s = (k, v) => { if (v) root.style.setProperty(k, v) }
|
||||
s('--iwb-bg', tokens.bg)
|
||||
s('--iwb-canvas-bg', tokens.canvasBg)
|
||||
s('--iwb-chrome', tokens.chrome)
|
||||
s('--iwb-home-bg', tokens.homeBg)
|
||||
s('--iwb-dock-bg', tokens.dockBg)
|
||||
s('--iwb-dock-head-bg', tokens.dockHeadBg)
|
||||
s('--iwb-panel', tokens.panel)
|
||||
s('--iwb-layer', tokens.layer)
|
||||
s('--iwb-layer2', tokens.layer2)
|
||||
s('--iwb-node-bg', tokens.nodeBg)
|
||||
s('--iwb-plugin-surface', tokens.pluginSurface)
|
||||
s('--iwb-plugin-card', tokens.pluginCard)
|
||||
s('--iwb-plugin-inset', tokens.pluginInset)
|
||||
s('--iwb-plugin-hover', tokens.pluginHover)
|
||||
s('--iwb-border', tokens.border)
|
||||
s('--iwb-border2', tokens.border2)
|
||||
s('--iwb-text', tokens.text)
|
||||
s('--iwb-text2', tokens.text2)
|
||||
s('--iwb-brand', tokens.brand)
|
||||
s('--iwb-edge', tokens.edge)
|
||||
s('--iwb-edge-hot', tokens.edgeHot)
|
||||
s('--iwb-grid-dot', tokens.gridDot)
|
||||
s('--iwb-err', tokens.err)
|
||||
s('--iwb-ok', tokens.ok)
|
||||
s('--iwb-warn', tokens.warn)
|
||||
s('--iwb-on-brand', tokens.onBrand)
|
||||
}
|
||||
|
||||
global.IWBThemeTokens = { DEFAULTS, derive, applyTo, mix, contrast, clampText }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -62,6 +62,7 @@
|
||||
onClick: () => { setSettingTabReq('diag'); setSettingOpen(true) },
|
||||
}, '内存 ' + memUi.usedMB + '/' + memUi.limitMB + 'MB ' + Math.round((memUi.ratio || 0) * 100) + '%') : null,
|
||||
saveState !== 'idle' ? el('span', { className: 'iwb-status-item iwb-status-save iwb-status-' + (saveState === 'error' ? 'err' : 'ok') }, saveState === 'saving' ? el('span', { className: 'iwb-save-spinner' }, null) : null, saveText) : null,
|
||||
(props.memMb && props.memMb > 0) ? el('span', { className: 'iwb-status-item iwb-status-mem', title: '当前进程常驻内存(含画布图片缓存)' }, '内存 ' + props.memMb + 'MB') : null,
|
||||
notice ? el('span', { className: 'iwb-status-item iwb-status-' + (notice.type === 'err' ? 'err' : 'ok') }, notice.text) : null,
|
||||
(() => {
|
||||
const activeKeys = Object.keys(busy).filter((k) => busy[k])
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
|
||||
const DEFAULTS = Object.freeze({
|
||||
canvasBgLight: '#d9dbde', canvasBgDark: '#6f6f6f',
|
||||
gridDotLight: '#c9ccd6', gridDotDark: '#8f8f8f', gridSize: 1.4, gridGap: 22, gridOn: true,
|
||||
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,
|
||||
edgeColorLight: '#b9bfca', edgeColorDark: '#7a7a7a',
|
||||
edgeWidth: 1.8, edgeDash: 'dashed',
|
||||
edgeHotLight: '#6b7280', edgeHotDark: '#ffffff',
|
||||
@@ -49,10 +51,19 @@
|
||||
gridSize: clamp(c.gridSize, 0.8, 2.6, DEFAULTS.gridSize),
|
||||
gridGap: clamp(c.gridGap, 16, 40, DEFAULTS.gridGap),
|
||||
gridOn: c.gridOn !== false,
|
||||
gridStyle: (function () {
|
||||
const st = String(c.gridStyle || '')
|
||||
if (st === 'dots' || st === 'lines' || st === 'blank') return st
|
||||
return (c.gridOn === false) ? 'blank' : 'dots'
|
||||
})(),
|
||||
edgeColorLight: hex('edgeColorLight'), edgeColorDark: hex('edgeColorDark'),
|
||||
edgeWidth: clamp(c.edgeWidth, 1, 4, DEFAULTS.edgeWidth),
|
||||
edgeDash: DASH[c.edgeDash] ? c.edgeDash : DEFAULTS.edgeDash,
|
||||
edgeHotLight: hex('edgeHotLight'), edgeHotDark: hex('edgeHotDark'),
|
||||
auto: c.auto !== false,
|
||||
seedNeutral: normHex(c.seedNeutral) || DEFAULTS.seedNeutral,
|
||||
seedAccent: normHex(c.seedAccent) || DEFAULTS.seedAccent,
|
||||
depth: clamp(c.depth, 0, 60, DEFAULTS.depth),
|
||||
nodeBgLight: hex('nodeBgLight'), nodeBgDark: hex('nodeBgDark'),
|
||||
nodeBorderLight: hex('nodeBorderLight'), nodeBorderDark: hex('nodeBorderDark'),
|
||||
nodeRadius: clamp(c.nodeRadius, 6, 20, DEFAULTS.nodeRadius),
|
||||
@@ -73,7 +84,9 @@
|
||||
set('--iwb-grid-dot', dark ? a.gridDotDark : a.gridDotLight)
|
||||
set('--iwb-grid-size', a.gridSize + 'px')
|
||||
set('--iwb-grid-gap', a.gridGap + 'px')
|
||||
set('--iwb-grid-on', a.gridOn ? '1' : '0')
|
||||
const gs = a.gridStyle || 'dots'
|
||||
set('--iwb-grid-on', (gs !== 'blank' && a.gridOn !== false) ? '1' : '0')
|
||||
try { root.setAttribute('data-iwb-grid', gs) } catch (e) { /* ignore */ }
|
||||
set('--iwb-edge', dark ? a.edgeColorDark : a.edgeColorLight)
|
||||
set('--iwb-edge-w', a.edgeWidth + 'px')
|
||||
set('--iwb-edge-dash', DASH[a.edgeDash] || DASH.dashed)
|
||||
@@ -82,6 +95,13 @@
|
||||
set('--iwb-border', dark ? a.nodeBorderDark : a.nodeBorderLight)
|
||||
set('--iwb-node-radius', a.nodeRadius + 'px')
|
||||
set('--iwb-node-sel-w', a.nodeSelWidth + 'px')
|
||||
// v3.25.81:自动配色 —— 由 4 个种子派生整套语义色并覆盖上面的手写值
|
||||
if (a.auto) {
|
||||
const T = g.IWBThemeTokens
|
||||
if (T && typeof T.derive === 'function') {
|
||||
try { T.applyTo(root, T.derive(a, !!dark)) } catch (e) { /* 派生失败保留手写值 */ }
|
||||
}
|
||||
}
|
||||
} catch (e) { /* 样式写失败不影响功能 */ }
|
||||
}
|
||||
|
||||
@@ -132,6 +152,7 @@
|
||||
const [open, setOpen] = React.useState(false)
|
||||
const [hsv, setHsv] = React.useState(() => { const c = hexToRgb(value); return rgbToHsv(c.r, c.g, c.b) })
|
||||
const boxRef = React.useRef(null)
|
||||
const popRef = React.useRef(null)
|
||||
|
||||
React.useEffect(() => {
|
||||
const c = hexToRgb(value)
|
||||
@@ -159,6 +180,27 @@
|
||||
onChange(rgbToHex(c.r, c.g, c.b))
|
||||
}
|
||||
const hueColor = 'hsl(' + Math.round(hsv.h) + ',100%,50%)'
|
||||
// v3.25.84:拖完自动确认 —— 松手 120ms 后自动收起取色板(不需要点「完成」);
|
||||
// 正在输入 hex/RGB 时不自动收(输入过程中松手会误关)。
|
||||
const closeTimer = React.useRef(null)
|
||||
const armAutoClose = () => {
|
||||
try { if (closeTimer.current) clearTimeout(closeTimer.current) } catch (e) { /* ignore */ }
|
||||
closeTimer.current = setTimeout(() => { setOpen(false) }, 120)
|
||||
}
|
||||
const cancelAutoClose = () => { try { if (closeTimer.current) clearTimeout(closeTimer.current) } catch (e) { /* ignore */ } }
|
||||
React.useEffect(() => {
|
||||
if (!open) return undefined
|
||||
const onDocDown = (e) => {
|
||||
try {
|
||||
const host = popRef.current
|
||||
if (host && host.contains(e.target)) return
|
||||
setOpen(false)
|
||||
} catch (err) { /* ignore */ }
|
||||
}
|
||||
document.addEventListener('pointerdown', onDocDown, true)
|
||||
return () => document.removeEventListener('pointerdown', onDocDown, true)
|
||||
}, [open])
|
||||
React.useEffect(() => () => cancelAutoClose(), [])
|
||||
|
||||
return el('div', { className: 'iwb-cpick' },
|
||||
el('button', {
|
||||
@@ -166,19 +208,20 @@
|
||||
onClick: () => setOpen((v) => !v),
|
||||
style: { background: value, color: readableOn(value) },
|
||||
}, el('span', { className: 'iwb-cpick-hex' }, value.toUpperCase())),
|
||||
open ? el('div', { className: 'iwb-cpick-pop', onPointerDown: (e) => e.stopPropagation() },
|
||||
open ? el('div', { className: 'iwb-cpick-pop', ref: popRef, onPointerDown: (e) => e.stopPropagation(), onKeyDown: cancelAutoClose },
|
||||
el('div', {
|
||||
className: 'iwb-cpick-box', ref: boxRef,
|
||||
onPointerDown: (e) => { e.currentTarget.setPointerCapture && e.currentTarget.setPointerCapture(e.pointerId); pick(e) },
|
||||
onPointerDown: (e) => { cancelAutoClose(); e.currentTarget.setPointerCapture && e.currentTarget.setPointerCapture(e.pointerId); pick(e) },
|
||||
onPointerMove: (e) => { if (e.buttons === 1) pick(e) },
|
||||
onPointerUp: () => armAutoClose(),
|
||||
style: { background: 'linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, ' + hueColor + ')' },
|
||||
}, el('div', { className: 'iwb-cpick-dot', style: { left: (hsv.s * 100) + '%', top: ((1 - hsv.v) * 100) + '%', background: value } })),
|
||||
el('input', { type: 'range', min: 0, max: 360, value: Math.round(hsv.h), onChange: hue, className: 'iwb-cpick-hue', style: { background: 'linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)' } }),
|
||||
el('input', { type: 'range', min: 0, max: 360, value: Math.round(hsv.h), onChange: (e) => { hue(e); armAutoClose() }, onPointerDown: cancelAutoClose, className: 'iwb-cpick-hue', style: { background: 'linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)' } }),
|
||||
el('div', { className: 'iwb-cpick-rgb' }, ['r', 'g', 'b'].map((k) => el('label', { key: k, className: 'iwb-cpick-chan' },
|
||||
el('input', { type: 'number', min: 0, max: 255, value: rgb[k], onChange: setChannel(k) }),
|
||||
el('span', null, k.toUpperCase())))),
|
||||
el('div', { className: 'iwb-cpick-foot' },
|
||||
el('input', { className: 'iwb-input iwb-cpick-input', value: value, onChange: (e) => { const v = normHex(e.target.value); if (v) onChange(v) }, title: '支持 #rgb / #rrggbb' }),
|
||||
el('input', { className: 'iwb-input iwb-cpick-input', value: value, onFocus: cancelAutoClose, onChange: (e) => { cancelAutoClose(); const v = normHex(e.target.value); if (v) onChange(v) }, title: '支持 #rgb / #rrggbb' }),
|
||||
g.EyeDropper ? el('button', { type: 'button', className: 'iwb-btn iwb-btn-sm', title: '从屏幕取色', onClick: () => { try { new g.EyeDropper().open().then((r) => { const v = normHex(r && r.sRGBHex); if (v) onChange(v) }).catch(() => {}) } catch (e) { /* ignore */ } } }, '吸管') : null,
|
||||
el('button', { type: 'button', className: 'iwb-btn iwb-btn-sm', onClick: () => setOpen(false) }, '完成')),
|
||||
) : null,
|
||||
@@ -201,6 +244,10 @@
|
||||
{ name: '纸质', values: { canvasBgLight: '#efe7d7', canvasBgDark: '#3b3227', gridDotLight: '#d8cbb4', gridDotDark: '#5a4c3d', edgeColorLight: '#b9a88c', edgeColorDark: '#a2917a', edgeDash: 'solid', accent: '#8a6f4a', edgeHotLight: '#8a6f4a', edgeHotDark: '#e0c9a0', nodeBgLight: '#faf6ee', nodeBgDark: '#4a4034', nodeBorderLight: '#ddd0b8', nodeBorderDark: '#6b5c49' } },
|
||||
]
|
||||
|
||||
// ── 外观面板(v3.25.75 重构)───────────────────────────────────────────────
|
||||
// 用户反馈:分组混乱、颜色字段看不出可点、网格三项无效、对比度警告刷屏。
|
||||
// 现在:4 个分组(主题 / 画布 / 连线 / 节点),统一两栏网格(标签 120px + 控件),
|
||||
// 每组组头右侧「恢复本组默认」;颜色统一为「色块 + hex + ▾」;警告收进行尾。
|
||||
function AppearanceTab (props) {
|
||||
const draft = (props && props.draft) || {}
|
||||
const setDraft = (props && props.setDraft) || function () {}
|
||||
@@ -211,14 +258,56 @@
|
||||
const set = (patch) => setDraft((d) => Object.assign({}, d, {
|
||||
canvas: Object.assign({}, d.canvas, { appearance: Object.assign({}, normalize(d), patch) }),
|
||||
}))
|
||||
const setMany = (patch) => set(patch)
|
||||
const resetGroup = (keys) => { const p = {}; for (const k of keys) p[k] = DEFAULTS[k]; set(p) }
|
||||
|
||||
const warnEdge = (edge, bg) => {
|
||||
const r = contrast(edge, bg)
|
||||
return r < 1.5 ? el('div', { className: 'iwb-hint iwb-hint-warn' }, '连线与画布底色对比度仅 ' + r.toFixed(1) + ':1,可能看不清') : null
|
||||
}
|
||||
const importRef = React.useRef(null)
|
||||
|
||||
const Row = function (label, control, note) {
|
||||
return el('div', { className: 'iwb-appear-row' + (note ? ' iwb-appear-row-note' : '') },
|
||||
el('span', { className: 'iwb-appear-label', title: label }, label),
|
||||
el('div', { className: 'iwb-appear-ctrl' }, control),
|
||||
note ? el('span', { className: 'iwb-appear-note' }, note) : null)
|
||||
}
|
||||
const Group = function (title, rows, keys) {
|
||||
return el('section', { className: 'iwb-appear-group' },
|
||||
el('div', { className: 'iwb-appear-ghead' },
|
||||
el('span', { className: 'iwb-appear-gtitle' }, title),
|
||||
keys ? el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => resetGroup(keys) }, '恢复本组默认') : null),
|
||||
rows)
|
||||
}
|
||||
const Seg = function (val, onChange, items) {
|
||||
return el('div', { className: 'iwb-seg' }, (items || []).map((item) => el('button', {
|
||||
key: item.value,
|
||||
type: 'button',
|
||||
className: 'iwb-seg-item' + (val === item.value ? ' on' : ''),
|
||||
onClick: () => onChange(item.value),
|
||||
}, item.label)))
|
||||
}
|
||||
const warnOf = function (edge, bg) {
|
||||
const r = contrast(edge, bg)
|
||||
return r < 1.5 ? ('⚠ 对比度 ' + r.toFixed(1) + ':1,可能看不清') : ''
|
||||
}
|
||||
|
||||
// 主题下拉:配色模式 + 全部预设合并(用户裁定:合并)
|
||||
const themeOptions = [{ value: 'theme:light', label: '亮色(节点灰底 + 内容白)' }, { value: 'theme:dark', label: '暗色' }, { value: 'theme:system', label: '跟随系统' }]
|
||||
const presetOptions = PRESETS.map((p) => ({ value: 'preset:' + p.name, label: '预设 · ' + p.name }))
|
||||
.concat(value.presets.map((p, i) => ({ value: 'preset-c:' + i, label: '预设 · ' + p.name })))
|
||||
const onThemePick = (raw) => {
|
||||
if (raw.indexOf('theme:') === 0) {
|
||||
const t = raw.slice(6)
|
||||
const v = (t === 'dark' || t === 'system') ? t : 'light'
|
||||
setTheme(v); applyTheme(v); return
|
||||
}
|
||||
if (raw.indexOf('preset-c:') === 0) {
|
||||
const p = value.presets[Number(raw.slice(9)) || 0]
|
||||
if (p && p.values) set(normalize({ canvas: { appearance: p.values } }))
|
||||
return
|
||||
}
|
||||
if (raw.indexOf('preset:') === 0) {
|
||||
const name = raw.slice(7)
|
||||
const p = PRESETS.find((x) => x.name === name)
|
||||
if (p) set(Object.assign({}, DEFAULTS, p.values))
|
||||
}
|
||||
}
|
||||
const exportPresets = () => {
|
||||
try {
|
||||
const doc = { version: 1, appearance: Object.assign({}, value, { presets: undefined }) }
|
||||
@@ -245,25 +334,14 @@
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
|
||||
return el('div', null,
|
||||
el('div', { className: 'iwb-section-sub' }, '界面主题'),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('span', { className: 'iwb-label' }, '配色模式'),
|
||||
el('select', {
|
||||
className: 'iwb-input', title: '界面配色(亮色保证文字清晰)', value: theme,
|
||||
onChange: (e) => { const t = e.target.value; const v = (t === 'dark' || t === 'system') ? t : 'light'; setTheme(v); applyTheme(v) },
|
||||
},
|
||||
el('option', { value: 'light' }, '亮色(默认:节点灰底 + 内容白)'),
|
||||
el('option', { value: 'dark' }, '暗色'),
|
||||
el('option', { value: 'system' }, '跟随系统'),
|
||||
)),
|
||||
|
||||
el('div', { className: 'iwb-section-sub' }, '预设'),
|
||||
el('div', { className: 'iwb-appear-presets' },
|
||||
PRESETS.map((p) => el('button', { key: p.name, className: 'iwb-btn iwb-btn-sm', onClick: () => setMany(Object.assign({}, DEFAULTS, p.values)), title: '套用「' + p.name + '」' }, p.name)),
|
||||
value.presets.map((p, i) => el('button', { key: 'c' + i, className: 'iwb-btn iwb-btn-sm', onClick: () => set(normalize({ canvas: { appearance: p.values } })), title: '套用自定义预设' }, p.name || ('自定义 ' + (i + 1)))),
|
||||
),
|
||||
el('div', { className: 'iwb-row' },
|
||||
const themeGroup = Group('主题', [
|
||||
Row('主题', el('select', {
|
||||
className: 'iwb-input iwb-appear-select', value: 'theme:' + theme,
|
||||
onChange: (e) => onThemePick(e.target.value),
|
||||
}, themeOptions.concat(presetOptions).map((o) => el('option', { key: o.value, value: o.value }, o.label))),
|
||||
'切换配色模式或直接套用预设'),
|
||||
Row('主题色', el(ColorPicker, { value: value.accent, onChange: (v) => set({ accent: v }) }), '按钮 / 端口 / 选中框'),
|
||||
Row('预设', el('div', { className: 'iwb-appear-btns' },
|
||||
el('button', {
|
||||
className: 'iwb-btn iwb-btn-sm',
|
||||
onClick: () => {
|
||||
@@ -273,55 +351,57 @@
|
||||
set({ presets: value.presets.concat([{ name: String(name).slice(0, 20), values: snap }]).slice(0, 12) })
|
||||
},
|
||||
}, '保存当前为预设'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: exportPresets }, '导出外观'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => importRef.current && importRef.current.click() }, '导入外观'),
|
||||
el('input', { ref: importRef, type: 'file', accept: 'application/json', style: { display: 'none' }, onChange: (e) => { const f = e.target.files && e.target.files[0]; if (f) importFile(f); e.target.value = '' } }),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: exportPresets }, '导出'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => importRef.current && importRef.current.click() }, '导入'),
|
||||
el('input', { ref: importRef, type: 'file', accept: 'application/json', style: { display: 'none' }, onChange: (e) => { const f = e.target.files && e.target.files[0]; if (f) importFile(f) } }))),
|
||||
], null)
|
||||
|
||||
el('div', { className: 'iwb-section-sub' }, '画布'),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '底色(亮)'), el(ColorPicker, { value: value.canvasBgLight, onChange: (v) => set({ canvasBgLight: v }) })),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '底色(暗)'), el(ColorPicker, { value: value.canvasBgDark, onChange: (v) => set({ canvasBgDark: v }) })),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '网格点(亮)'), el(ColorPicker, { value: value.gridDotLight, onChange: (v) => set({ gridDotLight: v }) })),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '网格点(暗)'), el(ColorPicker, { value: value.gridDotDark, onChange: (v) => set({ gridDotDark: v }) })),
|
||||
el(NumberRow, { label: '网格点大小', value: value.gridSize, min: 0.8, max: 2.6, step: 0.1, unit: 'px', onChange: (v) => set({ gridSize: v }) }),
|
||||
el(NumberRow, { label: '网格间距', value: value.gridGap, min: 16, max: 40, step: 1, unit: 'px', onChange: (v) => set({ gridGap: v }) }),
|
||||
el('label', { className: 'iwb-check' }, el('input', { type: 'checkbox', checked: value.gridOn, onChange: (e) => set({ gridOn: e.target.checked }) }, null), ' 显示网格'),
|
||||
el('div', { className: 'iwb-row' }, el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => resetGroup(['canvasBgLight', 'canvasBgDark', 'gridDotLight', 'gridDotDark', 'gridSize', 'gridGap', 'gridOn']) }, '恢复本组默认')),
|
||||
const canvasGroup = Group('画布', [
|
||||
Row('网格样式', Seg(value.gridStyle, (v) => set({ gridStyle: v, gridOn: v !== 'blank' }), [
|
||||
{ value: 'dots', label: '点' }, { value: 'lines', label: '线' }, { value: 'blank', label: '空白' },
|
||||
]), '空白 = 不显示背景网格'),
|
||||
Row('底色(亮)', el(ColorPicker, { value: value.canvasBgLight, onChange: (v) => set({ canvasBgLight: v }) })),
|
||||
Row('底色(暗)', el(ColorPicker, { value: value.canvasBgDark, onChange: (v) => set({ canvasBgDark: v }) })),
|
||||
Row(value.gridStyle === 'lines' ? '网格线色(亮)' : '网格点(亮)', el(ColorPicker, { value: value.gridDotLight, onChange: (v) => set({ gridDotLight: v }) })),
|
||||
Row(value.gridStyle === 'lines' ? '网格线色(暗)' : '网格点(暗)', el(ColorPicker, { value: value.gridDotDark, onChange: (v) => set({ gridDotDark: v }) })),
|
||||
Row(value.gridStyle === 'lines' ? '网格线粗细' : '网格点大小', el('input', { type: 'range', min: 0.8, max: 2.6, step: 0.1, value: value.gridSize, className: 'iwb-appear-range', onChange: (e) => set({ gridSize: Number(e.target.value) }) }),
|
||||
String(value.gridSize) + 'px'),
|
||||
Row('网格间距', el('input', { type: 'range', min: 16, max: 40, step: 1, value: value.gridGap, className: 'iwb-appear-range', onChange: (e) => set({ gridGap: Number(e.target.value) }) }),
|
||||
String(value.gridGap) + 'px'),
|
||||
], ['canvasBgLight', 'canvasBgDark', 'gridDotLight', 'gridDotDark', 'gridSize', 'gridGap', 'gridOn', 'gridStyle'])
|
||||
|
||||
el('div', { className: 'iwb-section-sub' }, '连线'),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '默认色(亮)'), el(ColorPicker, { value: value.edgeColorLight, onChange: (v) => set({ edgeColorLight: v }) })),
|
||||
warnEdge(value.edgeColorLight, value.canvasBgLight),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '默认色(暗)'), el(ColorPicker, { value: value.edgeColorDark, onChange: (v) => set({ edgeColorDark: v }) })),
|
||||
warnEdge(value.edgeColorDark, value.canvasBgDark),
|
||||
el(NumberRow, { label: '默认粗细', value: value.edgeWidth, min: 1, max: 4, step: 0.1, unit: 'px', onChange: (v) => set({ edgeWidth: v }) }),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('span', { className: 'iwb-label' }, '线型'),
|
||||
el('select', { className: 'iwb-input', value: value.edgeDash, onChange: (e) => set({ edgeDash: e.target.value }) },
|
||||
el('option', { value: 'solid' }, '实线'),
|
||||
el('option', { value: 'dashed' }, '虚线'),
|
||||
el('option', { value: 'dotted' }, '点线'),
|
||||
)),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '高亮色(亮)'), el(ColorPicker, { value: value.edgeHotLight, onChange: (v) => set({ edgeHotLight: v }) })),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '高亮色(暗)'), el(ColorPicker, { value: value.edgeHotDark, onChange: (v) => set({ edgeHotDark: v }) })),
|
||||
el('div', { className: 'iwb-hint' }, '高亮色只用于选中节点的上下游连线、悬停连线与临时连线;默认连线永远用上面的「默认色」。'),
|
||||
el('div', { className: 'iwb-row' }, el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => resetGroup(['edgeColorLight', 'edgeColorDark', 'edgeWidth', 'edgeDash', 'edgeHotLight', 'edgeHotDark']) }, '恢复本组默认')),
|
||||
const edgeGroup = Group('连线', [
|
||||
Row('默认色(亮)', el(ColorPicker, { value: value.edgeColorLight, onChange: (v) => set({ edgeColorLight: v }) }), warnOf(value.edgeColorLight, value.canvasBgLight)),
|
||||
Row('默认色(暗)', el(ColorPicker, { value: value.edgeColorDark, onChange: (v) => set({ edgeColorDark: v }) }), warnOf(value.edgeColorDark, value.canvasBgDark)),
|
||||
Row('粗细', el('input', { type: 'range', min: 1, max: 4, step: 0.1, value: value.edgeWidth, className: 'iwb-appear-range', onChange: (e) => set({ edgeWidth: Number(e.target.value) }) }), String(value.edgeWidth) + 'px'),
|
||||
Row('线型', el('select', { className: 'iwb-input iwb-appear-select', value: value.edgeDash, onChange: (e) => set({ edgeDash: e.target.value }) },
|
||||
el('option', { value: 'solid' }, '实线'), el('option', { value: 'dashed' }, '虚线'), el('option', { value: 'dotted' }, '点线'))),
|
||||
Row('高亮色(亮)', el(ColorPicker, { value: value.edgeHotLight, onChange: (v) => set({ edgeHotLight: v }) }), '仅选中/悬停/临时连线'),
|
||||
Row('高亮色(暗)', el(ColorPicker, { value: value.edgeHotDark, onChange: (v) => set({ edgeHotDark: v }) })),
|
||||
], ['edgeColorLight', 'edgeColorDark', 'edgeWidth', 'edgeDash', 'edgeHotLight', 'edgeHotDark'])
|
||||
|
||||
el('div', { className: 'iwb-section-sub' }, '节点'),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '节点底色(亮)'), el(ColorPicker, { value: value.nodeBgLight, onChange: (v) => set({ nodeBgLight: v }) })),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '节点底色(暗)'), el(ColorPicker, { value: value.nodeBgDark, onChange: (v) => set({ nodeBgDark: v }) })),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '边框色(亮)'), el(ColorPicker, { value: value.nodeBorderLight, onChange: (v) => set({ nodeBorderLight: v }) })),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '边框色(暗)'), el(ColorPicker, { value: value.nodeBorderDark, onChange: (v) => set({ nodeBorderDark: v }) })),
|
||||
el(NumberRow, { label: '节点圆角', value: value.nodeRadius, min: 6, max: 20, step: 1, unit: 'px', onChange: (v) => set({ nodeRadius: v }) }),
|
||||
el(NumberRow, { label: '选中描边', value: value.nodeSelWidth, min: 1, max: 4, step: 0.5, unit: 'px', onChange: (v) => set({ nodeSelWidth: v }) }),
|
||||
el('div', { className: 'iwb-row' }, el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => resetGroup(['nodeBgLight', 'nodeBgDark', 'nodeBorderLight', 'nodeBorderDark', 'nodeRadius', 'nodeSelWidth']) }, '恢复本组默认')),
|
||||
const nodeGroup = Group('节点', [
|
||||
Row('节点底色(亮)', el(ColorPicker, { value: value.nodeBgLight, onChange: (v) => set({ nodeBgLight: v }) })),
|
||||
Row('节点底色(暗)', el(ColorPicker, { value: value.nodeBgDark, onChange: (v) => set({ nodeBgDark: v }) })),
|
||||
Row('边框色(亮)', el(ColorPicker, { value: value.nodeBorderLight, onChange: (v) => set({ nodeBorderLight: v }) })),
|
||||
Row('边框色(暗)', el(ColorPicker, { value: value.nodeBorderDark, onChange: (v) => set({ nodeBorderDark: v }) })),
|
||||
Row('节点圆角', el('input', { type: 'range', min: 6, max: 20, step: 1, value: value.nodeRadius, className: 'iwb-appear-range', onChange: (e) => set({ nodeRadius: Number(e.target.value) }) }), String(value.nodeRadius) + 'px'),
|
||||
Row('选中描边', el('input', { type: 'range', min: 1, max: 4, step: 0.5, value: value.nodeSelWidth, className: 'iwb-appear-range', onChange: (e) => set({ nodeSelWidth: Number(e.target.value) }) }), String(value.nodeSelWidth) + 'px'),
|
||||
], ['nodeBgLight', 'nodeBgDark', 'nodeBorderLight', 'nodeBorderDark', 'nodeRadius', 'nodeSelWidth'])
|
||||
|
||||
el('div', { className: 'iwb-section-sub' }, '主题色'),
|
||||
el('div', { className: 'iwb-row' }, el('span', { className: 'iwb-label' }, '按钮 / 端口 / 选中框'), el(ColorPicker, { value: value.accent, onChange: (v) => set({ accent: v }) })),
|
||||
el('div', { className: 'iwb-hint' }, '主题色同时用于亮色与暗色主题;作用在按钮、端口、选中框与进度动画上。连线用上面的「连线」分组。'),
|
||||
const autoGroup = Group('自动配色', [
|
||||
Row('自动配色', el('label', { className: 'iwb-check' },
|
||||
el('input', { type: 'checkbox', checked: value.auto, onChange: (e) => set({ auto: e.target.checked }) }),
|
||||
'按 4 个种子自动派生整套配色'), '关闭后可逐项手动调节'),
|
||||
Row('中性基调', el(ColorPicker, { value: value.seedNeutral, onChange: (v) => set({ seedNeutral: v, auto: true }) }), '整机灰阶的基准'),
|
||||
Row('画布深浅', el('input', { type: 'range', min: 0, max: 60, step: 1, value: value.depth, className: 'iwb-appear-range', onChange: (e) => set({ depth: Number(e.target.value), auto: true }) }), String(value.depth)),
|
||||
Row('强调色', el(ColorPicker, { value: value.seedAccent, onChange: (v) => set({ seedAccent: v, auto: true }) }), '按钮 / 端口 / 选中框'),
|
||||
], ['auto', 'seedNeutral', 'seedAccent', 'depth'])
|
||||
|
||||
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,
|
||||
el('div', { className: 'iwb-row', style: { marginTop: 12 } },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => setMany(Object.assign({}, DEFAULTS, { presets: value.presets })) }, '全部恢复默认')),
|
||||
)
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => set(Object.assign({}, DEFAULTS, { presets: value.presets })) }, '全部恢复默认')))
|
||||
}
|
||||
|
||||
g.IWBUIApearance = Object.freeze({ DEFAULTS, PRESETS, DASH, normalize, apply, contrast, ColorPicker, AppearanceTab })
|
||||
|
||||
@@ -44,7 +44,8 @@ function I(name, cls) {
|
||||
function Minimap(props) {
|
||||
const { nodes, viewport, canvasSize, measuredH, measuredT, onJump } = props
|
||||
const hOf = (n) => (measuredH && measuredH[n.id]) || n.h || nodeTypeH(n.type)
|
||||
const MW = 168, MH = 112, PAD = 6
|
||||
// v3.26.17:小地图缩小一档(132×88),并整体上移到工具栏之上
|
||||
const MW = 132, MH = 88, PAD = 5
|
||||
let minX = 0, minY = 0, maxX = 1, maxY = 1
|
||||
for (const n of nodes) {
|
||||
minX = Math.min(minX, n.x); minY = Math.min(minY, n.y)
|
||||
@@ -134,10 +135,7 @@ function ToolbarBottom(props) {
|
||||
el('button', { className: 'iwb-btn', 'data-tip': '配置', onClick: () => onAdd('gen') }, I('gen')),
|
||||
el('button', { className: 'iwb-btn', 'data-tip': '输出', onClick: () => onAdd('out') }, I('presentation')),
|
||||
),
|
||||
el('span', { className: 'iwb-toolbar-sep' }, null),
|
||||
el('span', { className: 'iwb-tgroup' },
|
||||
el('button', { className: 'iwb-btn', 'data-tip': '资源库', onClick: onOpenPrompts }, I('archive')),
|
||||
),
|
||||
// v3.25.82:底栏「资源库」按钮已删(右侧栏/提示词库面板已覆盖该入口,用户裁定)
|
||||
// 最右侧独立一格:缩放(−/+)+ 适应视图(显示全部节点)。适应与快捷键 Shift+F 等价。
|
||||
el('span', { className: 'iwb-toolbar-sep' }, null),
|
||||
el('span', { className: 'iwb-tgroup' },
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* ui-dock-panels.js —— 停靠栏面板清单(v3.25.82)
|
||||
*
|
||||
* 职责:给出「当前可用」的左右栏面板表。
|
||||
* 规则(用户裁定):插件被关闭/未安装时,该面板不出现在左右栏;
|
||||
* 若某侧一个可用面板都没有,ui-dock 会整侧不渲染。
|
||||
* 兜底:插件宿主尚未就绪(list 为空,jsdom/首次启动)时不过滤,避免把面板全藏掉。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
|
||||
const ALL = {
|
||||
groups: { title: '节点组', icon: 'group', pluginId: 'grouplib', hint: '节点组插件未安装 · 设置 → 插件 → 市场安装' },
|
||||
browser: { title: '浏览器', icon: 'globe', pluginId: 'browser' },
|
||||
styles: { title: '风格库', icon: 'palette', pluginId: 'style-source' },
|
||||
prompts: { title: '提示词库', icon: 'book', pluginId: 'promptlib', hint: '提示词库插件未安装 · 设置 → 插件 → 市场安装' },
|
||||
gallery: { title: '图库', icon: 'ref', pluginId: 'gallery', hint: '图库插件未安装 · 设置 → 插件 → 市场安装' },
|
||||
}
|
||||
|
||||
function build (PluginHost) {
|
||||
let list = []
|
||||
try { list = (PluginHost && typeof PluginHost.list === 'function') ? (PluginHost.list() || []) : [] } catch (e) { list = [] }
|
||||
const ready = list.length > 0
|
||||
const out = {}
|
||||
for (const k of Object.keys(ALL)) {
|
||||
const p = ALL[k]
|
||||
if (ready && p.pluginId) {
|
||||
const hit = list.find((x) => x && x.id === p.pluginId)
|
||||
if (!hit || !hit.enabled) continue
|
||||
}
|
||||
out[k] = p
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
global.IWBUIDockPanels = { build, ALL }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -0,0 +1,50 @@
|
||||
/* ui-dock-sanitize.js —— 停靠栏状态的纯函数整理(v3.26.21)
|
||||
*
|
||||
* 从 ui-dock.js 抽出来,便于单测(jsdom 里跑 React + 拖拽太重)。规则:
|
||||
* 1. 只保留当前存在(plugins 有注册)的面板;
|
||||
* 2. 同侧去重(历史重复注册残留);
|
||||
* 3. 默认面板回填:removed 里的不补、另一侧已有的不补;
|
||||
* 4. 同一面板同时出现在左右两侧 → 只保留左侧。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
function sanitize (dock, panels, defaults) {
|
||||
if (!dock || !panels) return dock
|
||||
var changed = false
|
||||
var next = { left: Object.assign({}, dock.left), right: Object.assign({}, dock.right) }
|
||||
;['left', 'right'].forEach(function (side) {
|
||||
var s0 = dock[side] || {}
|
||||
var removed = Array.isArray(s0.removed) ? s0.removed : []
|
||||
var defList = (defaults && defaults[side] && defaults[side].list) || []
|
||||
// v3.26.22:不再丢弃“当前没注册”的面板 id(启动瞬间插件未加载完,清掉会覆盖用户摆放)
|
||||
var list = (s0.list || []).slice()
|
||||
list = list.filter(function (id, i) { return list.indexOf(id) === i })
|
||||
defList.forEach(function (id) {
|
||||
if (!panels[id]) return
|
||||
if (removed.indexOf(id) >= 0) return
|
||||
var other = side === 'left' ? 'right' : 'left'
|
||||
var otherList = (dock[other] && dock[other].list) || []
|
||||
if (otherList.indexOf(id) >= 0) return
|
||||
if (list.indexOf(id) >= 0) return
|
||||
list.push(id)
|
||||
})
|
||||
var usable = list.filter(function (id) { return !!panels[id] })
|
||||
// v3.26.23:保存的 active 只要还在 list 里就保持 —— 插件还没加载完时不要切走(否则重启后当前面板会变)
|
||||
var keepActive = !!s0.active && list.indexOf(s0.active) >= 0
|
||||
var active = keepActive ? s0.active : (usable[0] || list[0] || '')
|
||||
// 用内容比较而不是长度:去重(减 1) + 默认回填(加 1) 时长度可能不变,但内容已不同
|
||||
if (list.join('|') !== (s0.list || []).join('|') || active !== s0.active) {
|
||||
next[side] = Object.assign({}, s0, { list: list, active: active })
|
||||
changed = true
|
||||
}
|
||||
})
|
||||
var dup = (next.left.list || []).filter(function (id) { return (next.right.list || []).indexOf(id) >= 0 })
|
||||
if (dup.length) {
|
||||
next.right = Object.assign({}, next.right, { list: next.right.list.filter(function (id) { return dup.indexOf(id) < 0 }) })
|
||||
if (dup.indexOf(next.right.active) >= 0) next.right.active = next.right.list[0] || ''
|
||||
changed = true
|
||||
}
|
||||
return changed ? next : dock
|
||||
}
|
||||
global.IWBUiDockSanitize = { sanitize: sanitize }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
@@ -127,17 +129,34 @@
|
||||
if (first) { s.active = first; changed = true }
|
||||
}
|
||||
})
|
||||
return changed ? next : d
|
||||
// v3.26.12:同一面板同时出现在左右两侧 → 只保留左侧(老数据重复注册的残留)
|
||||
const dup = next.left.list.filter(function (id) { return next.right.list.indexOf(id) >= 0 })
|
||||
if (dup.length) {
|
||||
next.right = Object.assign({}, next.right, { list: next.right.list.filter(function (id) { return dup.indexOf(id) < 0 }) })
|
||||
if (dup.indexOf(next.right.active) >= 0) next.right.active = next.right.list[0] || ''
|
||||
changed = true
|
||||
}
|
||||
return changed ? next : d
|
||||
})
|
||||
}, 1200)
|
||||
return function () { clearTimeout(t) }
|
||||
}, [rev, panels])
|
||||
|
||||
useEffect(function () {
|
||||
// v3.26.22:插件面板还没注册时不要写盘 —— 否则会把用户的面板摆放覆盖成空/默认
|
||||
if (!Object.keys(panels || {}).length) return undefined
|
||||
// 拖宽时每帧都会变:节流写盘,避免 localStorage 同步写造成卡顿
|
||||
const t = setTimeout(function () { saveState(key, dock) }, 180)
|
||||
return function () { clearTimeout(t) }
|
||||
}, [dock])
|
||||
}, [dock, panels])
|
||||
|
||||
// v3.26.21:整理逻辑抽到 src/ui-dock-sanitize.js(纯函数,带单测)
|
||||
useEffect(function () {
|
||||
setDock(function (d) {
|
||||
const S = global.IWBUiDockSanitize
|
||||
return (S && typeof S.sanitize === 'function') ? S.sanitize(d, panels, props.defaults) : d
|
||||
})
|
||||
}, [panels])
|
||||
|
||||
// 把两侧实际占位宽度写给 CSS(画布不动,只让其它浮层让位)
|
||||
useEffect(function () {
|
||||
@@ -174,7 +193,20 @@
|
||||
if (side === 'right') { const next = !dock.right.open; setSide('right', { open: next }); if (typeof props.onRightOpen === 'function') props.onRightOpen(next) }
|
||||
}
|
||||
global.addEventListener('iwb:dock-toggle', onToggle)
|
||||
return function () { global.removeEventListener('iwb:dock-toggle', onToggle) }
|
||||
// v3.25.82:显式激活某侧面板(右侧栏不再由宿主强行指定 active,避免「图库旁边冒出提示词库」)
|
||||
const onActivate = function (e) {
|
||||
const det = e && e.detail
|
||||
if (!det || (det.side !== 'left' && det.side !== 'right') || !det.id || !panels[det.id]) return
|
||||
setDock(function (d) {
|
||||
const side = d[det.side]
|
||||
if (side.active === det.id) return d
|
||||
const next = Object.assign({}, d)
|
||||
next[det.side] = Object.assign({}, side, { active: det.id })
|
||||
return next
|
||||
})
|
||||
}
|
||||
global.addEventListener('iwb:dock-activate', onActivate)
|
||||
return function () { global.removeEventListener('iwb:dock-toggle', onToggle); global.removeEventListener('iwb:dock-activate', onActivate) }
|
||||
}, [dock.left.open, dock.right.open, props.onRightOpen])
|
||||
|
||||
// ---- 拖宽(内缘手柄) ----
|
||||
@@ -183,14 +215,37 @@
|
||||
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 NAV_W = 52
|
||||
const flush = function () {
|
||||
raf = 0
|
||||
if (dockEl) { try { dockEl.style.width = pendingW + 'px' } catch (err) { /* ignore */ } }
|
||||
// v3.26.13:拖动过程中同步 --iwb-dock-l/r,工具栏/小地图实时跟着让位(以前只在松手时提交,图标会"飘"过去)
|
||||
try {
|
||||
const r = global.document && global.document.documentElement
|
||||
if (r) {
|
||||
if (side === 'left') r.style.setProperty('--iwb-dock-l', (NAV_W + pendingW) + 'px')
|
||||
else r.style.setProperty('--iwb-dock-r', 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)
|
||||
@@ -281,7 +336,8 @@
|
||||
const renderHead = function (side) {
|
||||
const s = dock[side]
|
||||
const isLeft = side === 'left'
|
||||
const icons = s.list.map(function (id) {
|
||||
// v3.25.84:只画「当前可用」的面板(插件关掉后不再残留图标)
|
||||
const icons = s.list.filter(function (id) { return !!panels[id] }).map(function (id) {
|
||||
const p = panels[id]
|
||||
return el('button', {
|
||||
key: id,
|
||||
@@ -310,6 +366,9 @@
|
||||
|
||||
const renderDock = function (side) {
|
||||
const s = dock[side]
|
||||
// v3.25.82:插件被关掉后该侧没有可用面板 → 整侧不渲染(连折叠窄条都不画)
|
||||
const usable = (s.list || []).filter(function (id) { return !!panels[id] })
|
||||
if (!usable.length) return null
|
||||
if (!s.open) return null
|
||||
return el('div', {
|
||||
key: side,
|
||||
@@ -321,7 +380,7 @@
|
||||
onContextMenu: function (e) { e.stopPropagation() },
|
||||
},
|
||||
renderHead(side),
|
||||
el('div', { className: 'iwb-dock-body' }, renderBody(side)),
|
||||
el('div', { className: 'iwb-dock-body', 'data-panel': s.active }, renderBody(side)),
|
||||
el('div', { className: 'iwb-dock-resize', onPointerDown: function (e) { startResize(side, e) } }),
|
||||
(dropInfo && dropInfo.side === side) ? el('div', {
|
||||
className: 'iwb-dock-drop',
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/* ui-minimap-fit.js —— 小地图与底部工具栏的避让(v3.26.18)
|
||||
*
|
||||
* 小地图与悬浮工具栏同一排(都在底部)。右栏拉宽会压缩画布可用宽度,
|
||||
* 当两者横向重叠时,把小地图淡出隐藏(而不是硬挤或改布局)。
|
||||
* 触发:窗口 resize / 工具栏或小地图尺寸变化 / 停靠栏拖宽(iwb:dock-resizing)。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
var GAP = 8
|
||||
function install () {
|
||||
try {
|
||||
var doc = global.document
|
||||
if (!doc || global.IWBMiniMapFitInstalled) return
|
||||
global.IWBMiniMapFitInstalled = true
|
||||
var raf = 0
|
||||
function fit () {
|
||||
raf = 0
|
||||
try {
|
||||
var bar = doc.querySelector('.iwb-toolbar-wrap .iwb-toolbar')
|
||||
var mm = doc.querySelector('.iwb-minimap')
|
||||
if (!bar || !mm) return
|
||||
var a = bar.getBoundingClientRect()
|
||||
var b = mm.getBoundingClientRect()
|
||||
var tight = b.left < a.right + GAP
|
||||
if (mm.classList.contains('iwb-minimap-tight') !== tight) mm.classList.toggle('iwb-minimap-tight', tight)
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
function schedule () { if (!raf) raf = global.requestAnimationFrame(fit) }
|
||||
var ro = null
|
||||
try {
|
||||
if (typeof global.ResizeObserver === 'function') {
|
||||
ro = new global.ResizeObserver(schedule)
|
||||
var observe = function () {
|
||||
try {
|
||||
var nodes = doc.querySelectorAll('.iwb-toolbar-wrap, .iwb-toolbar, .iwb-minimap')
|
||||
for (var i = 0; i < nodes.length; i++) ro.observe(nodes[i])
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
observe()
|
||||
try {
|
||||
new global.MutationObserver(function () { observe(); schedule() }).observe(doc.body, { childList: true, subtree: true })
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
} catch (e) { /* ignore */ }
|
||||
global.addEventListener('resize', schedule)
|
||||
global.addEventListener('iwb:dock-resizing', schedule)
|
||||
schedule()
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
global.IWBMiniMapFit = { install: install }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -0,0 +1,64 @@
|
||||
/* ui-modal-drag.js —— 弹窗拖动 + 外观实时预览(v3.25.76)
|
||||
*
|
||||
* 为什么单独成模块:src 里单组件行数有上限(SettingsModal 已接近上限),
|
||||
* 这两个都是与具体弹窗无关的通用行为,抽出来也便于别处复用。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
const React = global.React || {}
|
||||
const el = (t, p, ...c) => React.createElement(t, p, ...c)
|
||||
|
||||
// 拖动标题栏移动弹窗;位置限制在视口内(至少留 120×60 可见)
|
||||
function useDraggableModal () {
|
||||
const [pos, setPos] = React.useState(null)
|
||||
const dragRef = React.useRef(null)
|
||||
const onHeadPointerDown = (e) => {
|
||||
if (e.button !== 0) return
|
||||
const host = e.currentTarget && e.currentTarget.closest ? e.currentTarget.closest('.iwb-modal') : null
|
||||
if (!host) return
|
||||
const r = host.getBoundingClientRect()
|
||||
dragRef.current = { x: e.clientX, y: e.clientY, left: r.left, top: r.top }
|
||||
const move = (ev) => {
|
||||
const d = dragRef.current
|
||||
if (!d) return
|
||||
const left = Math.max(8, Math.min((global.innerWidth || 1200) - 120, d.left + (ev.clientX - d.x)))
|
||||
const top = Math.max(8, Math.min((global.innerHeight || 800) - 60, d.top + (ev.clientY - d.y)))
|
||||
setPos({ left, top })
|
||||
}
|
||||
const up = () => {
|
||||
dragRef.current = null
|
||||
global.removeEventListener('pointermove', move)
|
||||
global.removeEventListener('pointerup', up)
|
||||
}
|
||||
global.addEventListener('pointermove', move)
|
||||
global.addEventListener('pointerup', up)
|
||||
e.preventDefault()
|
||||
}
|
||||
const style = pos ? { position: 'fixed', left: pos.left + 'px', top: pos.top + 'px', margin: 0, transform: 'none' } : undefined
|
||||
return { pos, style, onHeadPointerDown }
|
||||
}
|
||||
|
||||
// 外观实时预览:draft 变化 → 立刻写 CSS 变量 + 通知画布重渲染;关闭未保存则回滚
|
||||
function useAppearancePreview (opts) {
|
||||
const o = opts || {}
|
||||
const savedRef = React.useRef(o.savedConfig || o.config || null)
|
||||
const themeRef = React.useRef(o.dark ? 'dark' : 'light')
|
||||
React.useEffect(() => { themeRef.current = o.dark ? 'dark' : 'light' }, [o.dark])
|
||||
React.useEffect(() => {
|
||||
if (!o.enabled) return
|
||||
const A = global.IWBUIApearance
|
||||
if (!A || typeof A.apply !== 'function') return
|
||||
try { A.apply(o.config, !!(o.dark)) } catch (e) { /* ignore */ }
|
||||
try { global.dispatchEvent(new Event('iwb:appearance')) } catch (e) { /* ignore */ }
|
||||
}, [o.enabled, o.dark, o.config])
|
||||
React.useEffect(() => () => {
|
||||
const A = global.IWBUIApearance
|
||||
if (!A || typeof A.apply !== 'function') return
|
||||
try { A.apply(savedRef.current, themeRef.current === 'dark') } catch (e) { /* ignore */ }
|
||||
try { global.dispatchEvent(new Event('iwb:appearance')) } catch (e) { /* ignore */ }
|
||||
}, [])
|
||||
return { markSaved: () => { savedRef.current = o.config || null } }
|
||||
}
|
||||
|
||||
global.IWBUIModalDrag = { useDraggableModal, useAppearancePreview }
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -17,7 +17,7 @@
|
||||
// · ctx = { onUpdate, busy, progress, h, stop, refMini },由调用方 renderBodyInner 组装。
|
||||
|
||||
// ── 注入依赖(app.js 在首次渲染时调用 inject 注入)─────────────────────────
|
||||
let I, LocalTextField, autoGrow, React, ReactDOM, combineSourcePairs, downloadUrl, wResolveOutSrc, isImageProducer, nodePreviewRefsV2, nodeInheritOf, orderedUniqueRefNodes, outProgUI, outThumbCache, uploadRefToImageHost, wDisplayThumbOf, wImportImage, wPreviewUrlOf, wRawCfg, wResolveImg, wThumbSrc, el, wPluginNodeVariants, wPluginVariantMeta, isBatchSrc, batchSrcText, compareCanvasTextOrder, GenParams, RATIOS, RES_KEYS, RES_MAP, cachedGenerationTasks, classifyErr, fmtDur, presetDisplayName, ratioOfSize, resOfSize, taskStallEndMs, wDedupeTaskIds
|
||||
let I, LocalTextField, autoGrow, React, ReactDOM, combineSourcePairs, downloadUrl, wResolveOutSrc, isImageProducer, nodePreviewRefsV2, nodeInheritOf, orderedUniqueRefNodes, outProgUI, outThumbCache, uploadRefToImageHost, wDisplayThumbOf, wImgSrcForNode, wImportImage, wPreviewUrlOf, wRawCfg, wResolveImg, wThumbSrc, el, wPluginNodeVariants, wPluginVariantMeta, isBatchSrc, batchSrcText, compareCanvasTextOrder, GenParams, RATIOS, RES_KEYS, RES_MAP, cachedGenerationTasks, classifyErr, fmtDur, presetDisplayName, ratioOfSize, resOfSize, taskStallEndMs, wDedupeTaskIds
|
||||
function inject(d) {
|
||||
const D = d || {}
|
||||
I = D.I
|
||||
@@ -39,6 +39,7 @@
|
||||
outThumbCache = D.outThumbCache
|
||||
uploadRefToImageHost = D.uploadRefToImageHost
|
||||
wDisplayThumbOf = D.wDisplayThumbOf
|
||||
wImgSrcForNode = D.wImgSrcForNode
|
||||
wImportImage = D.wImportImage
|
||||
wPreviewUrlOf = D.wPreviewUrlOf
|
||||
wRawCfg = D.wRawCfg
|
||||
@@ -652,7 +653,7 @@
|
||||
function renderRefBody(node, props, ctx) {
|
||||
const { onUpdate, stop } = ctx
|
||||
const d = node.data || {}
|
||||
const src = wResolveImg(d.data) || d.url
|
||||
const src = wResolveImg(d.localRef) || wResolveImg(d.data) || d.url
|
||||
const hasImg = !!src
|
||||
const commitRefUrl = (event) => {
|
||||
const root = event && event.currentTarget && event.currentTarget.closest ? event.currentTarget.closest('.iwb-ref-body') : null
|
||||
@@ -691,7 +692,7 @@
|
||||
return el('div', { className: 'iwb-node-body iwb-ref-body' },
|
||||
hasImg
|
||||
? el('div', { className: 'iwb-ref-show' },
|
||||
el('img', { className: 'iwb-ref-single', loading: 'lazy', decoding: 'async', fetchPriority: 'low', src: wPreviewUrlOf(wDisplayThumbOf(wThumbSrc(src))), alt: '图片', draggable: false, title: '双击放大 · 单击可拖动' }),
|
||||
el('img', { className: 'iwb-ref-single', decoding: 'async', fetchPriority: 'low', src: wPreviewUrlOf((typeof wImgSrcForNode === 'function' ? wImgSrcForNode : wDisplayThumbOf)(wThumbSrc(src), Math.min(320, (props.node && props.node.w) || 280))), alt: '图片', draggable: false, onError: (e) => { try { const ov = wThumbSrc(src); if (ov && e.currentTarget && e.currentTarget.src !== ov) e.currentTarget.src = ov } catch (err) { /* ignore */ } }, title: '双击放大 · 单击可拖动' }),
|
||||
(typeof d.url === 'string' && d.url) ? el('div', { className: 'iwb-ref-url-current', title: d.url }, 'URL 图片') : null,
|
||||
)
|
||||
: el('div', { className: 'iwb-ref-emptybox', title: '单击选中 · 双击上传图片', onDoubleClick: (e) => { e.stopPropagation(); if (refFileInput) refFileInput.click() } },
|
||||
@@ -829,7 +830,7 @@
|
||||
// React 会按下标复用同一个 DOM 节点,先显示上一张、再等新图解码 ⇒ 肉眼看到「闪一下旧图/空图」。
|
||||
// url 稳定 ⇒ 节点复用(不重建、不重新解码);url 变了才新建,内容永远对得上。
|
||||
return el('div', { key: String(r.url || '') + '|' + ri, className: 'iwb-out-cell' },
|
||||
el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', loading: 'lazy', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', src: wPreviewUrlOf(wDisplayThumbOf(thumbOf(r))), draggable: false, style: { aspectRatio: (r.width && r.height) ? String(r.width) + ' / ' + String(r.height) : undefined }, title: r.idb && r.data ? '缩略图 · 点击查看原图' : '点击放大(可左右切换)', onError: (e) => { if (e.currentTarget && e.currentTarget.src !== r.url) e.currentTarget.src = r.url }, onClick: () => openPreviewAt(cur) }),
|
||||
el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', src: wPreviewUrlOf((typeof wImgSrcForNode === 'function' ? wImgSrcForNode : wDisplayThumbOf)(thumbOf(r), Math.max(120, Math.min(360, (node && node.w ? node.w - 40 : 240))))), draggable: false, style: { aspectRatio: (r.width && r.height) ? String(r.width) + ' / ' + String(r.height) : undefined }, title: r.idb && r.data ? '缩略图 · 点击查看原图' : '点击放大(可左右切换)', onError: (e) => { if (e.currentTarget && e.currentTarget.src !== r.url) e.currentTarget.src = r.url }, onClick: () => openPreviewAt(cur) }),
|
||||
el('div', { className: 'iwb-out-cell-meta' }, (r.width || '?') + '×' + (r.height || '?')),
|
||||
el('div', { className: 'iwb-out-cell-actions' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '插入为参考图节点', onClick: () => props.onCopyRef && props.onCopyRef(r.url), onPointerDown: stop }, I('copy')),
|
||||
@@ -1151,7 +1152,7 @@
|
||||
if (src) {
|
||||
return el('div', { className: 'iwb-node-body iwb-node-body-lod iwb-lod-lite iwb-lod-img' },
|
||||
// 缩略图不参与点击(节点本体负责选中/拖动),所以不挂事件;alt 留空由 CSS 兜底尺寸
|
||||
el('img', { className: 'iwb-lod-thumb', src: wDisplayThumbOf(src), loading: 'lazy', decoding: 'async', draggable: false, alt: '' }),
|
||||
el('img', { className: 'iwb-lod-thumb', src: wDisplayThumbOf(src), decoding: 'async', draggable: false, alt: '' }),
|
||||
)
|
||||
}
|
||||
return el('div', { className: 'iwb-node-body iwb-node-body-lod iwb-lod-lite iwb-lod-img' }, null)
|
||||
|
||||
@@ -559,11 +559,17 @@ function SettingsModal(props) {
|
||||
isDesk() ? null : autoBackupSection,
|
||||
)
|
||||
|
||||
// 可拖动窗口 + 外观实时预览(实现见 src/ui-modal-drag.js)
|
||||
const MD = (typeof window !== 'undefined') ? window.IWBUIModalDrag : null
|
||||
const dragKit = (MD && MD.useDraggableModal) ? MD.useDraggableModal() : null
|
||||
const appearanceKit = (MD && MD.useAppearancePreview) ? MD.useAppearancePreview({ enabled: tab === 'appearance', config: draft, dark: theme === 'dark', savedConfig: props.config || null }) : null
|
||||
const winStyle = dragKit ? dragKit.style : undefined
|
||||
const onHeadPointerDown = dragKit ? dragKit.onHeadPointerDown : null
|
||||
// 顺序:通用放最前(最常用:目录/外观/图片图库/生成),其它按使用频率排
|
||||
const tabs = [['general', '通用'], ['appearance', '外观'], ['gen', '生图服务'], ['llm', 'LLM 服务'], ['img', '图片传输'], ['sizes', '尺寸预设'], ['hotkeys', '快捷键'], ['backup', '备份与还原'], ['diag', '诊断'], ['plugins', '插件']]
|
||||
return el('div', { className: 'iwb-modal-mask', onWheel: (e) => e.stopPropagation(), onPointerDown: (e) => { if (e.target === e.currentTarget) props.onClose() } },
|
||||
el('div', { className: 'iwb-modal iwb-settings-modal' },
|
||||
el('div', { className: 'iwb-modal-head' },
|
||||
return el('div', { className: 'iwb-modal-mask iwb-mask-ghost', onWheel: (e) => e.stopPropagation(), onPointerDown: (e) => { if (e.target === e.currentTarget) props.onClose() } },
|
||||
el('div', { className: 'iwb-modal iwb-settings-modal' + ((dragKit && dragKit.pos) ? ' iwb-modal-floating' : ''), style: winStyle },
|
||||
el('div', { className: 'iwb-modal-head iwb-modal-draghead', onPointerDown: onHeadPointerDown, title: '按住拖动窗口' },
|
||||
el('span', { className: 'iwb-toolbar-title' }, '⚙️ 设置'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '关闭', onClick: props.onClose }, I('x')),
|
||||
),
|
||||
@@ -584,7 +590,7 @@ function SettingsModal(props) {
|
||||
),
|
||||
),
|
||||
el('div', { className: 'iwb-modal-foot' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-primary', disabled: saving, onClick: save }, saving ? '保存中…' : '保存配置'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-primary', disabled: saving, onClick: () => { try { if (appearanceKit) appearanceKit.markSaved() } catch (e) { /* ignore */ } ; if (save) save() } }, saving ? '保存中…' : '保存配置'),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -364,17 +364,17 @@
|
||||
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('div', { className: 'iwb-mk-subtitle' }, '共 ' + mList.length + ' 个插件 · ' + dirHint),
|
||||
el('div', { className: 'iwb-mk-toolbar' },
|
||||
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 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) {
|
||||
@@ -397,22 +397,23 @@
|
||||
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('span', { className: 'iwb-mk-avatar', style: { background: m.color || 'var(--iwb-layer2)' } }, 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,
|
||||
((m.id in inst) || regById[m.id]) ? el('span', { className: 'iwb-mk-badge' }, '已安装') : 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('install', m.id) } }, busy === m.id ? '处理中…' : '重装') : null,
|
||||
((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-mk-foot' },
|
||||
el('div', { className: 'iwb-mk-tags' }, (m.tags || []).slice(0, 3).map(function (t) { return el('span', { key: t, className: 'iwb-mk-tag' }, t) })),
|
||||
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 ? '安装中…' : '安装'),
|
||||
),
|
||||
),
|
||||
)
|
||||
})) : el('div', { className: 'iwb-hint' }, mList.length ? '没有匹配的插件' : '市场加载中…'),
|
||||
)
|
||||
@@ -758,6 +759,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,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 亮色配色:节点背景灰、内容区(输入框/标题栏/参数区)白,保证文字清晰阅读 */
|
||||
:root {
|
||||
--iwb-bg: #f4f5f7;
|
||||
--iwb-canvas-bg: #d9dbde;
|
||||
--iwb-canvas-bg: var(--iwb-canvas-bg);
|
||||
/* 顶部 chrome 色:页面底与画布之间的过渡层(标签条用)。
|
||||
比 --iwb-bg 深一号、比画布浅 → 顶部亮带贴画布的对比减弱(v3.1.0 顶栏配色);
|
||||
调深浅改下面 60/40 两个百分比即可(越往画布色靠,对比越弱) */
|
||||
@@ -21,14 +21,33 @@
|
||||
头部再深一档用「栏身 + 6% 黑」而不是往画布色混:暗色整条灰阶只有 #6F–#75,
|
||||
混画布色实测 ΔL 仅 0.006(看不见),黑色叠加在亮/暗下都能看出头部带(1.14:1 / 1.11:1)。 */
|
||||
--iwb-dock-bg: color-mix(in srgb, var(--iwb-chrome) 55%, var(--iwb-canvas-bg) 45%);
|
||||
--iwb-dock-head-bg: color-mix(in srgb, var(--iwb-dock-bg) 94%, #000);
|
||||
/* v3.26.19:顶栏底色比停靠栏更浅一档(原来是压暗 6%,现在向面板色靠 55%) */
|
||||
--iwb-dock-head-bg: color-mix(in srgb, var(--iwb-panel) 55%, var(--iwb-dock-bg));
|
||||
--iwb-panel: #ffffff;
|
||||
--iwb-layer: #f0f1f4;
|
||||
--iwb-layer2: #ffffff;
|
||||
--iwb-node-bg: #f1f3f6;
|
||||
--iwb-border: #d5d9e0;
|
||||
--iwb-border: var(--iwb-border);
|
||||
--iwb-border2: #b9bfca;
|
||||
--iwb-brand: #6b7280; /* v3.1.0 全灰阶:原品牌蓝 → 同亮度中性灰(白字对比仍 ≥4.5:1) */
|
||||
--iwb-brand: var(--iwb-text2); /* v3.1.0 全灰阶:原品牌蓝 → 同亮度中性灰(白字对比仍 ≥4.5:1) */
|
||||
--iwb-on-brand: #ffffff; /* v3.25.83:自动配色会按对比度改写为黑/白 */
|
||||
/* v3.25.85 插件主题契约:插件只能用这组别名(宿主负责让它们跟随主题/自动配色) */
|
||||
--iwb-plugin-bg: var(--iwb-bg);
|
||||
--iwb-plugin-panel: var(--iwb-panel);
|
||||
--iwb-plugin-layer: var(--iwb-layer);
|
||||
--iwb-plugin-border: var(--iwb-border);
|
||||
--iwb-plugin-text: var(--iwb-text);
|
||||
--iwb-plugin-text2: var(--iwb-text2);
|
||||
/* 插件面板四层(v3.25.96):只提供取值,不做任何变量重指(3.25.89 的事故不再重演) */
|
||||
--iwb-plugin-surface: #f1f1f1;
|
||||
--iwb-plugin-card: #ffffff;
|
||||
--iwb-plugin-inset: #e9e9e9;
|
||||
--iwb-plugin-hover: #dfdfdf;
|
||||
--iwb-plugin-brand: var(--iwb-brand);
|
||||
--iwb-plugin-on-brand: var(--iwb-on-brand);
|
||||
--iwb-plugin-err: var(--iwb-err);
|
||||
--iwb-plugin-ok: var(--iwb-ok);
|
||||
--iwb-plugin-warn: var(--iwb-warn);
|
||||
/* 连线默认色:跟随边框灰(亮/暗自适应)。主题色只用于选中/悬停/上下游高亮(v3.25.18 用户裁定) */
|
||||
--iwb-edge: var(--iwb-border2);
|
||||
/* 外观自定义(v3.25.22):以下变量都由 src/ui-appearance.js 按配置写入,这里只给兜底默认值 */
|
||||
@@ -47,7 +66,7 @@
|
||||
--iwb-text2: #4d5668;
|
||||
--iwb-err: #e5484d;
|
||||
--iwb-ok: #2f9e5f;
|
||||
--iwb-warn: #d97706;
|
||||
--iwb-warn: var(--iwb-warn);
|
||||
/* —— 设计 token(v3.1.0-stability2 起):间距 / 圆角 / 字号 / 阴影 / 过渡 —— */
|
||||
--sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
|
||||
--rd-sm: 6px; --rd: 8px; --rd-md: 10px; --rd-lg: 12px;
|
||||
@@ -152,7 +171,7 @@ button { font-family: inherit; }
|
||||
/* 选中时顶部浮动气泡操作条(复刻 infinite-canvas/opentu) */
|
||||
/* --iwb-fb-k:气泡尺寸随视口缩放(见 app.js floatbarScale)。transform-origin 取贴边中点,
|
||||
保证缩放后 bottom-center 仍精确落在 left/top 锚点上 → 位置公式无需随 k 改变。 */
|
||||
.iwb-node-floatbar { position: absolute; z-index: 70; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: #fff; border: 1px solid var(--iwb-border); box-shadow: 0 8px 28px rgba(15,23,42,.12); transform: translate(-50%, -100%) scale(var(--iwb-fb-k, 1)); transform-origin: 50% 100%; pointer-events: auto; left: 50%; top: -6px; }
|
||||
.iwb-node-floatbar { position: absolute; z-index: 70; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--iwb-panel); border: 1px solid var(--iwb-border); box-shadow: 0 8px 28px rgba(15,23,42,.12); transform: translate(-50%, -100%) scale(var(--iwb-fb-k, 1)); transform-origin: 50% 100%; pointer-events: auto; left: 50%; top: -6px; }
|
||||
/* 上方放不下时改挂节点下方(避免被 .iwb-canvas 的 overflow:hidden 裁掉):origin 改为上边中点 */
|
||||
.iwb-node-floatbar.iwb-node-floatbar-below { transform: translate(-50%, 0) scale(var(--iwb-fb-k, 1)); transform-origin: 50% 0; }
|
||||
.iwb-node-floatbar button { width: 30px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--iwb-text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
|
||||
@@ -237,7 +256,7 @@ button { font-family: inherit; }
|
||||
.iwb-ref-empty { height: 84px; display: flex; align-items: center; justify-content: center; color: var(--iwb-text2); border: 1px dashed var(--iwb-border2); border-radius: 6px; font-size: 12px; }
|
||||
.iwb-ref-images { display: flex; flex-direction: column; gap: 6px; }
|
||||
.iwb-ref-imgrow { display: flex; align-items: center; gap: 6px; }
|
||||
.iwb-ref-idx { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--iwb-brand); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
|
||||
.iwb-ref-idx { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--iwb-brand); color: var(--iwb-on-brand); font-size: 10px; display: flex; align-items: center; justify-content: center; }
|
||||
.iwb-ref-img { flex: 1; max-height: 90px; object-fit: contain; border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: move; min-width: 0; }
|
||||
.iwb-ref-imgactions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; }
|
||||
.iwb-file { display: inline-block; margin-top: 6px; padding: 4px 10px; border: 1px dashed var(--iwb-border2); border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--iwb-text2); }
|
||||
@@ -258,10 +277,10 @@ button { font-family: inherit; }
|
||||
.iwb-out-img { width: 100%; border-radius: 8px; border: 1px solid var(--iwb-border); }
|
||||
.iwb-out-meta { font-size: 10px; color: var(--iwb-text2); margin-top: 3px; }
|
||||
.iwb-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
|
||||
.iwb-toolbar { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 12px; padding: 8px 10px; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
|
||||
.iwb-toolbar { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; flex-wrap: wrap; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 12px; padding: 8px 10px; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
|
||||
.iwb-toolbar-title { font-weight: 700; font-size: 13px; margin-right: 2px; }
|
||||
.iwb-toolbar-sep { width: 1px; height: 18px; background: var(--iwb-border2); margin: 0 2px; }
|
||||
.iwb-statusbar { position: absolute; right: 62px; top: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 60px); justify-content: flex-end; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 10px; padding: 6px 12px; z-index: 10; font-size: 11px; color: var(--iwb-text2); box-shadow: 0 4px 16px rgba(0,0,0,0.12); transition: right 0.15s; }
|
||||
.iwb-statusbar { position: absolute; top: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 60px); justify-content: flex-end; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 10px; padding: 6px 12px; z-index: 10; font-size: 11px; color: var(--iwb-text2); box-shadow: 0 4px 16px rgba(0,0,0,0.12); transition: right 0.15s; }
|
||||
.iwb-status-err { color: var(--iwb-err); }
|
||||
.iwb-status-ok { color: var(--iwb-ok); }
|
||||
/* 生成中状态:直接附着在顶部计时/状态背景,确保不依赖画布节点可见性 */
|
||||
@@ -272,9 +291,11 @@ button { font-family: inherit; }
|
||||
.iwb-save-saving { animation: iwb-pulse 1.2s ease-in-out infinite; }
|
||||
@keyframes iwb-spin { to { transform: rotate(360deg); } }
|
||||
@keyframes iwb-pulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
|
||||
.iwb-hint-bottom { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 10px; color: var(--iwb-text2); background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 8px; padding: 3px 10px; z-index: 9; opacity: 0.8; white-space: nowrap; }
|
||||
.iwb-hint-bottom { position: absolute; bottom: 10px; transform: translateX(-50%); font-size: 10px; color: var(--iwb-text2); background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 8px; padding: 3px 10px; z-index: 9; opacity: 0.8; white-space: nowrap; }
|
||||
.iwb-boxsel { position: absolute; border: 1px dashed var(--iwb-brand); background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); z-index: 3; pointer-events: none; }
|
||||
.iwb-minimap { position: absolute; right: 62px; bottom: 14px; width: 168px; height: 112px; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 8px; z-index: 11; cursor: crosshair; overflow: hidden; touch-action: none; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
|
||||
/* v3.26.18:右栏挤压到工具栏时自动隐藏(避免两者重叠) */
|
||||
.iwb-minimap.iwb-minimap-tight { opacity: 0; transform: translateY(6px); pointer-events: none; }
|
||||
.iwb-minimap { transition: opacity .16s ease, transform .16s ease; position: absolute; width: 132px; height: 88px; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 8px; z-index: 11; cursor: crosshair; overflow: hidden; touch-action: none; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
|
||||
.iwb-mini-node { position: absolute; border-radius: 2px; opacity: 0.85; }
|
||||
.iwb-mini-view { position: absolute; border: 1px solid var(--iwb-brand); border-radius: 2px; pointer-events: none; }
|
||||
.iwb-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 300; display: flex; align-items: center; justify-content: center; }
|
||||
@@ -284,7 +305,6 @@ button { font-family: inherit; }
|
||||
.iwb-modal-foot { padding: 12px 16px; border-top: 1px solid var(--iwb-border); display: flex; justify-content: flex-end; }
|
||||
.iwb-provider-card { border: 1px solid var(--iwb-border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
|
||||
.iwb-keyrow { display: flex; gap: 6px; align-items: center; }
|
||||
.iwb-keyname { flex: 0 0 110px; }
|
||||
.iwb-lib { position: absolute; top: 0; right: 0; bottom: 0; background: var(--iwb-panel); border-left: 1px solid var(--iwb-border2); z-index: 20; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,0.15); }
|
||||
.iwb-lib-handle { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 3; }
|
||||
.iwb-lib-handle:hover { background: color-mix(in srgb, var(--iwb-text) 14%, transparent); }
|
||||
@@ -366,7 +386,7 @@ button { font-family: inherit; }
|
||||
.iwb-full-split:hover { background: var(--iwb-text2); }
|
||||
.iwb-full-edit { flex: 0 0 auto; border-left: 1px solid var(--iwb-border); background: var(--iwb-layer); display: flex; flex-direction: column; min-height: 0; }
|
||||
.iwb-full-edit-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--iwb-border); flex: 0 0 auto; }
|
||||
.iwb-full-editor { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
|
||||
.iwb-full-editor { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
|
||||
.iwb-full-editor { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
|
||||
.iwb-full-editor-title { font-size: 13px; font-weight: 700; color: var(--iwb-text); }
|
||||
.iwb-full-editor-text { min-height: 220px; resize: vertical; }
|
||||
@@ -402,7 +422,7 @@ button { font-family: inherit; }
|
||||
.iwb-task-title { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--iwb-text); }
|
||||
.iwb-task-title-text { font-size: 11px; font-weight: 400; color: var(--iwb-text2); margin-left: 3px; }
|
||||
.iwb-task-refs { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
|
||||
.iwb-task-ref { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid var(--iwb-border); cursor: zoom-in; }
|
||||
.iwb-task-ref { object-fit: cover; border-radius: 5px; border: 1px solid var(--iwb-border); cursor: zoom-in; }
|
||||
|
||||
.iwb-ref-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
|
||||
.iwb-ref-single { width: 100%; min-height: 60px; max-height: 340px; object-fit: contain; object-position: center; border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: move; }
|
||||
@@ -431,7 +451,7 @@ button { font-family: inherit; }
|
||||
.iwb-refmini { position: relative; }
|
||||
.iwb-refmini-empty { width: 28px; height: 28px; border-radius: 5px; border: 1px solid var(--iwb-border); background: var(--iwb-layer); display: flex; align-items: center; justify-content: center; color: #9aa1ad; }
|
||||
.iwb-refmini-empty .iwb-refmini-warn { display: inline-flex; }
|
||||
.iwb-refmini .iwb-refmini-idx { position: absolute; left: -3px; top: -3px; background: var(--iwb-brand); color: #fff; font-size: 8px; min-width: 12px; height: 12px; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 0 2px; z-index: 2; }
|
||||
.iwb-refmini .iwb-refmini-idx { position: absolute; left: -3px; top: -3px; background: var(--iwb-brand); color: var(--iwb-on-brand); font-size: 8px; min-width: 12px; height: 12px; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 0 2px; z-index: 2; }
|
||||
|
||||
/* ---- v2 P2:图片传输设置 + 出图清理 ---- */
|
||||
.iwb-section { border-top: 1px solid var(--iwb-border); margin-top: 16px; padding-top: 12px; }
|
||||
@@ -439,16 +459,13 @@ button { font-family: inherit; }
|
||||
.iwb-section-sub { font-weight: 600; font-size: 12px; margin: 10px 0 6px; color: var(--iwb-text2); }
|
||||
.iwb-mode-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
|
||||
.iwb-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--iwb-text); }
|
||||
.iwb-num { width: 76px; flex: none; }
|
||||
.iwb-hdrbox { min-height: 54px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; resize: vertical; }
|
||||
|
||||
/* ---- v2 P3:4-Tab 设置 ---- */
|
||||
.iwb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--iwb-border); padding: 8px 12px 0; }
|
||||
.iwb-tab { background: transparent; border: 1px solid transparent; border-bottom: none; padding: 7px 14px; border-radius: 8px 8px 0 0; font-size: 12px; color: var(--iwb-text2); cursor: pointer; }
|
||||
.iwb-tab:hover { color: var(--iwb-text); }
|
||||
.iwb-tab-active { background: var(--iwb-panel); border-color: var(--iwb-border); color: var(--iwb-brand); font-weight: 700; }
|
||||
.iwb-tab { border-bottom: none; }
|
||||
.iwb-tab-active { border-color: var(--iwb-border); }
|
||||
.iwb-addrrow { gap: 6px; margin-bottom: 6px; }
|
||||
.iwb-addr-tag { flex: 0 0 26px; text-align: right; }
|
||||
.iwb-speed { border: 1px solid var(--iwb-border); border-radius: 8px; padding: 6px 8px; margin: 6px 0; background: var(--iwb-layer); }
|
||||
.iwb-speed-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 11px; }
|
||||
.iwb-speed-ms { flex: 0 0 74px; font-weight: 600; }
|
||||
@@ -484,7 +501,7 @@ button { font-family: inherit; }
|
||||
/* 操作栏:高度固定 40px(与 app.js 的 GROUP_BAR_H 同步);整条栏(含图标周围留白)都是整组拖拽热区。
|
||||
v3.24.25 改白底黑字(原 --iwb-brand 深灰底白字在浅色画布上一块深色很跳);
|
||||
v3.24.26 整体再放大一档(36→40 / 组名 14→16)+ 描边提到 --iwb-border2:
|
||||
原来 1px --iwb-border(#d5d9e0) 与画布底色(#d9dbde)几乎同色,白药丸等于没有边。 */
|
||||
原来 1px --iwb-border(var(--iwb-border)) 与画布底色(var(--iwb-canvas-bg))几乎同色,白药丸等于没有边。 */
|
||||
.iwb-group-bar { position: absolute; top: -10px; left: 10px; display: flex; align-items: center; gap: 8px; height: 40px; box-sizing: border-box; background: var(--iwb-panel); color: var(--iwb-text); border: 1px solid var(--iwb-border2); border-radius: 11px; padding: 0 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.12); pointer-events: auto; cursor: move; z-index: 5; }
|
||||
/* 组名:图标 18px + 名称 16px/600 + 节点数 14px 灰(主次分明,原来全塞在一串 12px 加粗里) */
|
||||
.iwb-group-name { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--iwb-text); white-space: nowrap; user-select: none; }
|
||||
@@ -538,10 +555,10 @@ button { font-family: inherit; }
|
||||
.iwb-backup-actions .iwb-btn { font-size: 13px; }
|
||||
.iwb-backup-file { font-size: 12.5px; color: var(--iwb-text2); padding: 2px 0 4px; }
|
||||
.iwb-backup-note { font-size: 12px; color: var(--iwb-text2); line-height: 1.6; }
|
||||
.iwb-settings-modal .iwb-hint { font-size: 13.5px; line-height: 1.7; }
|
||||
.iwb-settings-modal .iwb-hint { font-size: 13.5px; }
|
||||
.iwb-settings-modal .iwb-btn { font-size: 13.5px; }
|
||||
.iwb-settings-modal .iwb-section-title { font-size: 15px; margin: 6px 0 8px; }
|
||||
.iwb-settings-modal .iwb-section-sub { font-size: 13.5px; margin: 10px 0 4px; }
|
||||
.iwb-settings-modal .iwb-section-sub { font-size: 13.5px; }
|
||||
.iwb-settings-modal .iwb-provider-card { padding: 12px 14px; gap: 8px; }
|
||||
.iwb-settings-modal .iwb-row { gap: 8px; }
|
||||
.iwb-settings-modal .iwb-keyrow, .iwb-settings-modal .iwb-speed-row, .iwb-settings-modal .iwb-mode-row { padding: 5px 0; gap: 8px; }
|
||||
@@ -554,12 +571,12 @@ button { font-family: inherit; }
|
||||
/* ---- v3:toast 提示 ---- */
|
||||
.iwb-toast { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 200; background: var(--iwb-panel); border: 1px solid var(--iwb-border2); border-radius: 10px; padding: 10px 18px; box-shadow: 0 8px 30px rgba(0,0,0,0.3); font-size: 13px; font-weight: 600; animation: iwb-fadein 0.18s ease; }
|
||||
.iwb-toast-ok { border-left: 3px solid var(--iwb-brand); }
|
||||
.iwb-toast-err { border-left: 3px solid #ef4444; }
|
||||
.iwb-toast-err { border-left: 3px solid var(--iwb-err); }
|
||||
@keyframes iwb-fadein { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
|
||||
|
||||
/* ---- v3:左侧多工作台 ---- */
|
||||
.iwb-wsrail { position: absolute; left: 0; top: 36px; bottom: 0; width: 52px; background: var(--iwb-panel); border-right: 1px solid var(--iwb-border); z-index: 25; display: flex; flex-direction: column; align-items: stretch; transition: width 0.15s; }
|
||||
.iwb-wsrail-title { display: flex; align-items: center; gap: 4px; padding: 14px 12px; font-weight: 800; font-size: 18px; color: var(--iwb-text); border-bottom: 1px solid var(--iwb-border); cursor: default; user-select: none; white-space: nowrap; flex: 0 0 auto; justify-content: center; }
|
||||
.iwb-wsrail-title { align-items: center; gap: 4px; padding: 14px 12px; font-weight: 800; font-size: 18px; color: var(--iwb-text); border-bottom: 1px solid var(--iwb-border); cursor: default; user-select: none; white-space: nowrap; flex: 0 0 auto; justify-content: center; }
|
||||
.iwb-wsrail-title:hover { background: var(--iwb-layer); }
|
||||
/* 展开态标题行右侧 ⋯ 三点菜单(Portal 挂 body + fixed 定位:右侧展开不切割、层级高于画布) */
|
||||
.iwb-wsrail-title-more-wrap { position: relative; margin-left: auto; display: inline-flex; align-items: center; }
|
||||
@@ -572,7 +589,7 @@ button { font-family: inherit; }
|
||||
.ws-expanded .iwb-wsrail-title { font-size: 18px; }
|
||||
.ws-expanded .iwb-wsrail-title .iwb-btn-text { font-size: inherit; }
|
||||
.iwb-wsrail-label { font-size: 10px; color: var(--iwb-text2); font-weight: 700; letter-spacing: 1px; margin: 2px 2px 4px; user-select: none; }
|
||||
.iwb-wsrail-foot { flex: 0 0 auto; border-top: 1px solid var(--iwb-border); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
|
||||
.iwb-wsrail-foot { flex: 0 0 auto; border-top: 1px solid var(--iwb-border); padding: 10px; flex-direction: column; gap: 8px; }
|
||||
.iwb-wsrail-footrow { display: flex; gap: 6px; }
|
||||
.iwb-wsrail-footrow .iwb-btn { flex: 1 1 auto; justify-content: center; font-size: 11px; }
|
||||
/* 组合来源停用标记 */
|
||||
@@ -592,13 +609,10 @@ button { font-family: inherit; }
|
||||
.iwb-node-disabled { opacity: 0.55; filter: grayscale(0.35); }
|
||||
.iwb-node-disabled .iwb-node-head { background: color-mix(in srgb, var(--iwb-layer2) 60%, transparent); }
|
||||
.iwb-node-disabled .iwb-port { opacity: 0.45; }
|
||||
.iwb-canvas { left: 52px; transition: left 0.15s; }
|
||||
.iwb-canvas { transition: left 0.15s; }
|
||||
.iwb-toolbar-wrap { position: absolute; left: 0; right: 60px; bottom: 14px; display: flex; justify-content: center; pointer-events: none; z-index: 10; }
|
||||
.iwb-overlay.has-minimap .iwb-toolbar-wrap { right: 244px; }
|
||||
|
||||
.ws-expanded .iwb-wsrail { width: 200px; }
|
||||
.ws-expanded .iwb-canvas { left: 200px; }
|
||||
|
||||
|
||||
|
||||
/* ---- v3:工具栏分组 ---- */
|
||||
@@ -628,9 +642,8 @@ button { font-family: inherit; }
|
||||
.iwb-drawer-tab { background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--iwb-text2); cursor: pointer; white-space: nowrap; }
|
||||
.iwb-drawer-tab:hover { color: var(--iwb-text); }
|
||||
.iwb-drawer-tab-active { background: var(--iwb-layer); border-color: var(--iwb-border); color: var(--iwb-brand); font-weight: 700; }
|
||||
.iwb-drawer-spacer { flex: 1 1 auto; }
|
||||
.iwb-drawer-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
|
||||
.iwb-drawer-toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 21; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-right: none; border-radius: 8px 0 0 8px; padding: 12px 5px; cursor: pointer; font-size: 12px; color: var(--iwb-text2); box-shadow: -4px 0 12px rgba(0,0,0,0.1); writing-mode: vertical-lr; letter-spacing: 2px; }
|
||||
.iwb-drawer-toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 21; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-right: none; border-radius: 8px 0 0 8px; padding: 12px 5px; cursor: pointer; font-size: 12px; color: var(--iwb-text2); box-shadow: -4px 0 12px rgba(0,0,0,0.1); letter-spacing: 2px; }
|
||||
.iwb-drawer-toggle:hover { color: var(--iwb-brand); }
|
||||
/* 嵌入抽屉时面板填满 */
|
||||
.iwb-lib-embedded, .iwb-groups-embedded { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
||||
@@ -730,8 +743,8 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-btn:active { transform: translateY(1px); }
|
||||
.iwb-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--iwb-brand) 60%, transparent); outline-offset: 1px; }
|
||||
.iwb-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
|
||||
.iwb-btn-primary { background: var(--iwb-brand); border-color: var(--iwb-brand); color: #fff; }
|
||||
.iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-brand) 85%, #000); border-color: var(--iwb-brand); color: #fff; }
|
||||
.iwb-btn-primary { background: var(--iwb-brand); border-color: var(--iwb-brand); color: var(--iwb-on-brand); }
|
||||
.iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-brand) 85%, #000); border-color: var(--iwb-brand); color: var(--iwb-on-brand); }
|
||||
/* 常驻选中态(画布工具组的「当前工具」):底栏按钮本身是「无边框 + 透明底」,所以这里用淡填充药丸表示
|
||||
「当前工具」,与 :hover 的瞬时反馈区分开。!important 是必须的——上面 .iwb-btn 的 background/border 就是 !important。 */
|
||||
.iwb-toolbar-bottom .iwb-btn-on { background: color-mix(in srgb, var(--iwb-text) 12%, transparent) !important; border-radius: 8px; color: var(--iwb-text) !important; opacity: 1 !important; }
|
||||
@@ -768,7 +781,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-wsrail-title .iwb-ic { width: 20px; height: 20px; }
|
||||
.iwb-wsrail-label { display: flex; align-items: center; gap: 5px; }
|
||||
.iwb-wsrail-foot .iwb-btn { border-radius: 8px; background: color-mix(in srgb, var(--iwb-layer) 42%, transparent); border-color: color-mix(in srgb, var(--iwb-border2) 40%, transparent); }
|
||||
.iwb-drawer-toggle { display: flex; align-items: center; gap: 4px; writing-mode: initial; }
|
||||
.iwb-drawer-toggle { align-items: center; gap: 4px; writing-mode: initial; }
|
||||
|
||||
/* 窄屏时压缩工具栏避免换行 */
|
||||
@media (max-width: 760px) {
|
||||
@@ -798,9 +811,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-toolbar-bottom .iwb-btn-fit { padding: 7px 7px; }
|
||||
|
||||
/* ---- 连线拖拽反馈:可连接绿框 / 不可连接红框 ---- */
|
||||
.iwb-node.iwb-conn-ok { border-color: #22c55e !important; box-shadow: 0 0 0 2px rgba(34,197,94,0.45), 0 6px 20px rgba(0,0,0,0.25) !important; }
|
||||
.iwb-node.iwb-conn-bad { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.55), 0 6px 20px rgba(0,0,0,0.25) !important; }
|
||||
.iwb-conn-hint { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 6; padding: 4px 6px; border-radius: 5px; color: #b91c1c; background: rgba(254, 226, 226, 0.96); border: 1px solid rgba(239, 68, 68, 0.35); font-size: 11px; line-height: 1.25; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.iwb-node.iwb-conn-ok { border-color: var(--iwb-ok) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-ok) 45%, transparent), 0 6px 20px rgba(0,0,0,0.25) !important; }
|
||||
.iwb-node.iwb-conn-bad { border-color: var(--iwb-err) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-err) 55%, transparent), 0 6px 20px rgba(0,0,0,0.25) !important; }
|
||||
.iwb-conn-hint { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 6; padding: 4px 6px; border-radius: 5px; color: var(--iwb-err); background: rgba(254, 226, 226, 0.96); border: 1px solid rgba(239, 68, 68, 0.35); font-size: 11px; line-height: 1.25; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.iwb-command-mask { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding-top: 13vh; background: rgba(10, 12, 18, 0.32); }
|
||||
.iwb-command { width: min(560px, calc(100vw - 32px)); max-height: min(560px, 72vh); overflow: hidden; background: var(--iwb-panel); border: 1px solid var(--iwb-border2); border-radius: 12px; box-shadow: 0 18px 60px rgba(0,0,0,.32); display: flex; flex-direction: column; }
|
||||
.iwb-command-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--iwb-border); }
|
||||
@@ -813,22 +826,22 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-command-item .iwb-ic { width: 16px; height: 16px; flex: 0 0 auto; }
|
||||
.iwb-command-empty { padding: 22px 12px; text-align: center; color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-command-foot { padding: 8px 14px; border-top: 1px solid var(--iwb-border); color: var(--iwb-text2); font-size: 11px; }
|
||||
.iwb-edge-temp.iwb-edge-ok { stroke: #22c55e !important; }
|
||||
.iwb-edge-temp.iwb-edge-bad { stroke: #ef4444 !important; }
|
||||
.iwb-edge-temp.iwb-edge-ok { stroke: var(--iwb-ok) !important; }
|
||||
.iwb-edge-temp.iwb-edge-bad { stroke: var(--iwb-err) !important; }
|
||||
|
||||
/* 任务失败详情 */
|
||||
.iwb-task-err-toggle { display: block; width: 100%; text-align: left; margin-top: 6px; font-size: 11px; color: #ef4444; background: color-mix(in srgb, #ef4444 8%, transparent); border: 1px solid color-mix(in srgb, #ef4444 35%, transparent); border-radius: 5px; cursor: pointer; padding: 4px 6px; }
|
||||
.iwb-task-err-toggle:hover { background: color-mix(in srgb, #ef4444 14%, transparent); }
|
||||
.iwb-task-err { margin-top: 6px; border: 1px solid color-mix(in srgb, #ef4444 40%, transparent); border-radius: 6px; background: color-mix(in srgb, #ef4444 6%, transparent); padding: 6px 8px; }
|
||||
.iwb-task-errline { font-size: 11px; color: #ef4444; word-break: break-all; line-height: 1.6; padding: 1px 0; }
|
||||
.iwb-task-err-toggle { display: block; width: 100%; text-align: left; margin-top: 6px; font-size: 11px; color: var(--iwb-err); background: color-mix(in srgb, var(--iwb-err) 8%, transparent); border: 1px solid color-mix(in srgb, var(--iwb-err) 35%, transparent); border-radius: 5px; cursor: pointer; padding: 4px 6px; }
|
||||
.iwb-task-err-toggle:hover { background: color-mix(in srgb, var(--iwb-err) 14%, transparent); }
|
||||
.iwb-task-err { margin-top: 6px; border: 1px solid color-mix(in srgb, var(--iwb-err) 40%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--iwb-err) 6%, transparent); padding: 6px 8px; }
|
||||
.iwb-task-errline { font-size: 11px; color: var(--iwb-err); word-break: break-all; line-height: 1.6; padding: 1px 0; }
|
||||
/* 失败分类颜色:连接=红、资源/额度=橙、密钥=紫、服务商=红棕、其他=灰 */
|
||||
.iwb-err-conn { color: #ef4444; }
|
||||
.iwb-err-quota { color: #d97706; }
|
||||
.iwb-err-conn { color: var(--iwb-err); }
|
||||
.iwb-err-quota { color: var(--iwb-warn); }
|
||||
.iwb-err-auth { color: var(--iwb-err); } /* 鉴权失败=错误语义,紫改红 */
|
||||
.iwb-err-srv { color: #dc2626; }
|
||||
.iwb-err-other { color: #6b7280; }
|
||||
.iwb-err-unknown { color: #b45309; font-weight: 600; }
|
||||
.iwb-err-cancelled { color: #6b7280; font-weight: 600; }
|
||||
.iwb-err-srv { color: var(--iwb-err); }
|
||||
.iwb-err-other { color: var(--iwb-text2); }
|
||||
.iwb-err-unknown { color: var(--iwb-warn); font-weight: 600; }
|
||||
.iwb-err-cancelled { color: var(--iwb-text2); font-weight: 600; }
|
||||
|
||||
/* ---- 窄屏适配(轻量) ---- */
|
||||
@media (max-width: 860px) {
|
||||
@@ -861,9 +874,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-ctx-item:hover:not(:disabled) { background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); color: var(--iwb-text); }
|
||||
.iwb-ctx-item:hover:not(:disabled) .iwb-ic { color: var(--iwb-brand); }
|
||||
.iwb-ctx-item:disabled { opacity: 0.38; cursor: default; }
|
||||
.iwb-ctx-item.iwb-ctx-danger { color: #ef4444; }
|
||||
.iwb-ctx-item.iwb-ctx-danger .iwb-ic { color: #ef4444; }
|
||||
.iwb-ctx-item.iwb-ctx-danger:hover:not(:disabled) { background: color-mix(in srgb, #ef4444 10%, transparent); color: #ef4444; }
|
||||
.iwb-ctx-item.iwb-ctx-danger { color: var(--iwb-err); }
|
||||
.iwb-ctx-item.iwb-ctx-danger .iwb-ic { color: var(--iwb-err); }
|
||||
.iwb-ctx-item.iwb-ctx-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--iwb-err) 10%, transparent); color: var(--iwb-err); }
|
||||
.iwb-ctx-sep { height: 1px; margin: 4px 6px; background: var(--iwb-border); flex: 0 0 auto; }
|
||||
/* ---- 二级菜单(2026-11-19 用户要求:一级太长了)----
|
||||
* 「选中操作」「该节点」两组收进子菜单,一级只留入口。纯 CSS 展开(:hover + :focus-within),
|
||||
@@ -894,7 +907,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
/* ---- 生图节点:参数设置(横向一行,无标题无分类) ---- */
|
||||
.iwb-gen-row { display: flex; gap: 4px; align-items: center; }
|
||||
.iwb-gen-cell { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; }
|
||||
.iwb-gen-cell .iwb-input { width: auto; max-width: 100%; font-size: 15px; padding: 3px 18px 3px 5px; background-color: var(--iwb-panel); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23c8cdd6' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 5px center; border: none; appearance: none; -webkit-appearance: none; -moz-appearance: none; }
|
||||
.iwb-gen-cell .iwb-input { width: auto; max-width: 100%; font-size: 15px; background-color: var(--iwb-panel); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23c8cdd6' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 5px center; border: none; appearance: none; -webkit-appearance: none; -moz-appearance: none; }
|
||||
.iwb-gen-cell .iwb-input:focus { outline: none; background-color: color-mix(in srgb, var(--iwb-brand) 6%, var(--iwb-panel)); }
|
||||
|
||||
/* ---- 任务卡:张数下拉移到右下角(状态在左) ---- */
|
||||
@@ -928,7 +941,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
|
||||
/* 左侧栏底部:收起态图标列 + 链接按钮 */
|
||||
.iwb-wsrail-foot-collapsed { padding-top: 6px; border-top: 1px solid var(--iwb-border); }
|
||||
.iwb-wsrail-iconcol { display: flex; flex-direction: column; align-items: center; gap: 6px; }
|
||||
.iwb-wsrail-iconcol { display: flex; flex-direction: column; align-items: center; }
|
||||
.iwb-wsrail-iconcol .iwb-ws-headicon { width: 32px; height: 30px; }
|
||||
.iwb-wsrail-foot a.iwb-btn, a.iwb-btn { text-decoration: none; }
|
||||
.iwb-wsrail-foot .iwb-ws-headicon .iwb-ic { width: 15px; height: 15px; }
|
||||
@@ -947,7 +960,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-task-result-meta { font-size: 10px; color: var(--iwb-text2); text-align: center; margin-top: 2px; }
|
||||
.iwb-task-result-dl { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; border-radius: 0 0 8px 8px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); opacity: 0; transition: opacity 0.15s; }
|
||||
.iwb-task-result:hover .iwb-task-result-dl { opacity: 1; }
|
||||
.iwb-task-result-dl .iwb-ic { width: 16px; height: 16px; color: #fff; }
|
||||
.iwb-task-result-dl .iwb-ic { width: 16px; height: 16px; color: var(--iwb-on-brand); }
|
||||
|
||||
/* 文案组合节点 */
|
||||
.iwb-combine-srcs { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
|
||||
@@ -967,20 +980,19 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-out-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
|
||||
.iwb-out-run { width: 100%; justify-content: center; margin-bottom: 8px; }
|
||||
/* 画布节点内的主操作按钮统一「近黑底 + 白字」(用户要求;--iwb-text 亮色 #1c2333、暗色 #111) */
|
||||
.iwb-node .iwb-btn-primary { background: var(--iwb-text); border-color: var(--iwb-text); color: #fff; }
|
||||
.iwb-node .iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-text) 86%, #fff); border-color: var(--iwb-text); color: #fff; }
|
||||
.iwb-node .iwb-btn-primary { background: var(--iwb-text); border-color: var(--iwb-text); color: var(--iwb-on-brand); }
|
||||
.iwb-node .iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-text) 86%, var(--iwb-panel)); border-color: var(--iwb-text); color: var(--iwb-on-brand); }
|
||||
.iwb-node .iwb-btn-primary:disabled { opacity: .45; }
|
||||
.iwb-out-head .iwb-label { flex: 0 0 auto; }
|
||||
.iwb-out-tools { flex: 1 1 auto; display: flex; gap: 4px; justify-content: flex-end; }
|
||||
.iwb-out-tools .iwb-btn { padding: 2px 8px; font-size: 11px; }
|
||||
.iwb-out-cell { position: relative; }
|
||||
.iwb-out-cell-img { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--iwb-border); cursor: zoom-in; background: var(--iwb-layer2); transition: border-color 0.12s; }
|
||||
.iwb-out-cell-img:hover { border-color: var(--iwb-brand); }
|
||||
.iwb-out-cell-meta { font-size: 10px; color: var(--iwb-text2); text-align: center; margin-top: 2px; }
|
||||
.iwb-out-cell-actions { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; opacity: 0; transition: opacity 0.15s; border-radius: 0 0 8px 8px; background: rgba(0,0,0,0.45); }
|
||||
.iwb-out-cell:hover .iwb-out-cell-actions { opacity: 1; }
|
||||
.iwb-out-cell-actions .iwb-btn { width: 18px; height: 18px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.9); color: #333; border: none; cursor: pointer; }
|
||||
.iwb-out-cell-actions .iwb-btn:hover { background: #fff; color: var(--iwb-brand); }
|
||||
.iwb-out-cell-actions .iwb-btn:hover { background: var(--iwb-panel); color: var(--iwb-brand); }
|
||||
.iwb-out-cell-actions .iwb-ic { width: 11px; height: 11px; }
|
||||
|
||||
/* 输出节点:原比例自适应流式(组内横向排列,随节点宽度自动换行) */
|
||||
@@ -1023,7 +1035,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
top: 50%; bottom: auto; transform: translate(-50%, -50%);
|
||||
width: min(460px, calc(100vw - 48px)); padding: 18px 22px; text-align: left;
|
||||
}
|
||||
.iwb-resume-warning { font-size: var(--fs-12, 12px); line-height: 1.6; color: var(--iwb-err, #dc2626); }
|
||||
.iwb-resume-warning { font-size: var(--fs-12, 12px); line-height: 1.6; color: var(--iwb-err, var(--iwb-err)); }
|
||||
.iwb-resume-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
|
||||
/* 版本更新提示(v3.24.42):原来和「保存失败」等低频异常挤在底部 34px 处,存在感弱到错过。
|
||||
现在贴在编辑器顶栏(标签条 36 + 顶栏 56)正下方居中 —— 一进画布就在视线内,又完全不挡画布内容。
|
||||
@@ -1040,19 +1052,19 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
@media (prefers-reduced-motion: reduce) { .iwb-update-bar { animation: none; } }
|
||||
|
||||
/* 待润色标记(文本节点为空但有 LLM 上游) */
|
||||
.iwb-task-pending { color: #b45309; font-weight: 600; }
|
||||
.iwb-task-pending { color: var(--iwb-warn); font-weight: 600; }
|
||||
|
||||
/* 生图/LLM 服务设置:模型列表 + 行内删除操作 */
|
||||
.iwb-modelrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border: 1px solid var(--iwb-border); border-radius: 8px; margin-bottom: 4px; background: var(--iwb-layer); }
|
||||
.iwb-modelrow-main { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
|
||||
.iwb-modelrow-main { display: flex; align-items: center; gap: 4px; }
|
||||
.iwb-modelrow-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-modelrow .iwb-btn-danger { color: #b91c1c; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
|
||||
.iwb-modelrow .iwb-btn-danger { color: var(--iwb-err); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
|
||||
.iwb-modelrow:hover .iwb-btn-danger, .iwb-modelrow:focus-within .iwb-btn-danger { opacity: 1; pointer-events: auto; }
|
||||
.iwb-modelrow-main { cursor: default; }
|
||||
.iwb-modelrow-main span { cursor: default; }
|
||||
.iwb-modelrow-active { border-color: var(--iwb-border2); background: color-mix(in srgb, var(--iwb-text) 6%, transparent); }
|
||||
.iwb-modelrow-name { flex: 1 1 auto; cursor: pointer; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-input-err { border-color: #ef4444 !important; box-shadow: 0 0 0 1px rgba(239,68,68,0.35); }
|
||||
.iwb-modelrow-name { flex: 1 1 auto; cursor: pointer; font-size: 12px; }
|
||||
.iwb-input-err { border-color: var(--iwb-err) !important; box-shadow: 0 0 0 1px rgba(239,68,68,0.35); }
|
||||
|
||||
/* LLM 多渠道设置卡片 */
|
||||
.iwb-llm-card { border: 1px solid var(--iwb-border); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--iwb-layer); }
|
||||
@@ -1090,63 +1102,53 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
|
||||
.iwb-size-preset-grid-edit { grid-template-columns: minmax(120px, 1fr) repeat(3, minmax(108px, 1fr)) 38px; }
|
||||
.iwb-size-preset-grid-edit .iwb-btn { width: 34px; min-width: 34px; padding: 0; justify-content: center; justify-self: center; }
|
||||
.iwb-shell-nav { position: absolute; left: 12px; top: 12px; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 5px; border: 1px solid var(--iwb-border); border-radius: 10px; background: color-mix(in srgb, var(--iwb-panel) 92%, transparent); box-shadow: 0 4px 16px rgba(0,0,0,.12); }
|
||||
.iwb-shell-nav { left: 12px; top: 12px; z-index: 30; align-items: center; }
|
||||
.iwb-shell-nav-item { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 7px; padding: 7px 10px; background: transparent; color: var(--iwb-text2); cursor: pointer; }
|
||||
.iwb-shell-nav-item:hover, .iwb-shell-nav-active { background: var(--iwb-layer2); color: var(--iwb-text); }
|
||||
.iwb-shell-nav-caption { padding: 0 8px; font-size: 11px; color: var(--iwb-text2); }
|
||||
.iwb-home-panel { position: absolute; inset: 0; z-index: 20; padding: 110px 9vw 40px; overflow: auto; background: var(--iwb-home-bg); }
|
||||
.iwb-home-title { font-size: 30px; font-weight: 700; color: var(--iwb-text); }
|
||||
.iwb-home-panel { position: absolute; inset: 0; z-index: 20; overflow: auto; background: var(--iwb-home-bg); }
|
||||
.iwb-home-title { font-weight: 700; color: var(--iwb-text); }
|
||||
.iwb-home-subtitle { margin-top: 8px; color: var(--iwb-text2); }
|
||||
.iwb-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 30px; max-width: 1100px; }
|
||||
.iwb-home-grid { display: grid; }
|
||||
.iwb-home-sec-head { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--iwb-text2); letter-spacing: .5px; margin: 6px 0 2px; padding-top: 8px; border-top: 1px solid var(--iwb-hr); }
|
||||
.iwb-home-sec-head:first-child { border-top: none; padding-top: 0; }
|
||||
.iwb-home-card { min-height: 130px; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; border: 1px solid var(--iwb-border); border-radius: 14px; background: color-mix(in srgb, var(--iwb-panel) 52%, var(--iwb-home-bg) 48%); color: var(--iwb-text); text-align: left; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
|
||||
.iwb-home-card:hover { border-color: var(--iwb-border2); background: color-mix(in srgb, var(--iwb-panel) 76%, var(--iwb-home-bg) 24%); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
|
||||
.iwb-home-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; color: var(--iwb-text); text-align: left; cursor: pointer; }
|
||||
.iwb-home-card span { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-home-new { align-items: center; justify-content: center; color: var(--iwb-brand); }
|
||||
.iwb-canvas-hidden { visibility: hidden; pointer-events: none; }
|
||||
.iwb-shell-nav { position: static; display: flex; flex-direction: column; gap: 3px; padding: 8px; border: 0; border-bottom: 1px solid var(--iwb-border); border-radius: 0; background: transparent; box-shadow: none; }
|
||||
.iwb-shell-nav { position: static; flex-direction: column; gap: 3px; padding: 8px; border: 0; border-bottom: 1px solid var(--iwb-border); border-radius: 0; background: transparent; box-shadow: none; }
|
||||
.iwb-shell-nav-item { width: 100%; justify-content: flex-start; min-height: 34px; }
|
||||
.iwb-wsrail-current { flex: 1 1 auto; min-height: 0; padding: 14px 10px; color: var(--iwb-text); }
|
||||
.iwb-wsrail-current .iwb-wsrail-label { margin: 0 0 8px; }
|
||||
.iwb-wsrail-current-name { padding: 10px; border: 1px solid var(--iwb-border); border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
|
||||
.iwb-wsrail-current .iwb-btn { margin-top: 8px; width: 100%; justify-content: center; }
|
||||
.iwb-home-panel { padding-left: max(9vw, 240px); }
|
||||
/* 顶部应用导航:不覆盖左栏,统一承载页面级入口与当前工作台 */
|
||||
.iwb-top-nav { position: absolute; left: 0; right: 0; top: 0; height: 54px; z-index: 35; display: flex; align-items: center; gap: 6px; padding: 0 14px; background: color-mix(in srgb, var(--iwb-panel) 94%, transparent); border-bottom: 1px solid var(--iwb-border); box-shadow: 0 2px 12px rgba(0,0,0,.08); }
|
||||
.iwb-top-nav-brand { display: inline-flex; align-items: center; gap: 7px; margin-right: 12px; font-weight: 800; color: var(--iwb-text); white-space: nowrap; }
|
||||
.iwb-top-nav-item, .iwb-top-nav-workspace, .iwb-top-nav-icon { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border: 1px solid transparent; border-radius: 8px; padding: 0 10px; background: transparent; color: var(--iwb-text2); cursor: pointer; }
|
||||
.iwb-top-nav-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; color: var(--iwb-text); white-space: nowrap; }
|
||||
.iwb-top-nav-item, .iwb-top-nav-workspace, .iwb-top-nav-icon { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 0 10px; background: transparent; color: var(--iwb-text2); cursor: pointer; }
|
||||
.iwb-top-nav-item:hover, .iwb-top-nav-active, .iwb-top-nav-workspace:hover, .iwb-top-nav-icon:hover { background: var(--iwb-layer2); color: var(--iwb-text); border-color: var(--iwb-border); }
|
||||
.iwb-top-nav-workspace { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-top-nav-workspace .iwb-ic { width: 13px; height: 13px; }
|
||||
.iwb-top-nav-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--iwb-border); }
|
||||
.iwb-top-nav-spacer { flex: 1 1 auto; }
|
||||
.iwb-top-nav-icon { width: 34px; justify-content: center; padding: 0; }
|
||||
.iwb-top-nav-icon { padding: 0; }
|
||||
.iwb-top-nav-icon .iwb-ic { width: 16px; height: 16px; }
|
||||
.iwb-wsrail { top: 54px; }
|
||||
.iwb-wsrail-title, .iwb-wsrail-current, .iwb-wsrail-foot { display: none; }
|
||||
.iwb-shell-nav { display: none; }
|
||||
.iwb-wsrail { width: 52px; }
|
||||
.ws-expanded .iwb-wsrail { width: 52px; }
|
||||
.iwb-canvas, .ws-expanded .iwb-canvas { left: 52px; }
|
||||
.iwb-home-panel { padding-left: max(9vw, 100px); padding-top: 90px; }
|
||||
.iwb-home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--iwb-hr); padding-bottom: 24px; }
|
||||
.iwb-home-kicker { color: var(--iwb-text2); font-size: 12px; margin-bottom: 8px; }
|
||||
.iwb-home-panel { padding-top: 90px; }
|
||||
.iwb-home-head { display: flex; justify-content: space-between; gap: 20px; }
|
||||
.iwb-home-kicker { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-home-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
|
||||
/* 仅首页用「深底浅字」;画布内的主按钮(生成 / 批量出图)保持品牌底 + 白字,避免暗色下发灰看不清 */
|
||||
.iwb-home-panel .iwb-btn-primary { background: var(--iwb-text); color: var(--iwb-bg); }
|
||||
.iwb-home-card { position: relative; padding: 18px 18px 14px; min-height: 174px; }
|
||||
.iwb-home-card { position: relative; padding: 18px 18px 14px; }
|
||||
.iwb-home-card > input { position: absolute; left: 18px; top: 20px; width: 17px; height: 17px; accent-color: var(--iwb-text); z-index: 2; }
|
||||
.iwb-home-card-main { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 10px; width: 100%; min-height: 105px; padding: 26px 0 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
|
||||
.iwb-home-card-main strong { padding-left: 30px; font-size: 18px; }
|
||||
.iwb-home-card-main span, .iwb-home-card-main small { color: var(--iwb-text2); }
|
||||
.iwb-home-card-actions { display: flex; justify-content: flex-end; gap: 8px; width: 100%; }
|
||||
.iwb-home-card-actions button { width: 30px; height: 28px; border: 0; background: transparent; color: var(--iwb-text2); cursor: pointer; border-radius: 6px; }
|
||||
.iwb-home-card-actions button:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
|
||||
/* 资源工具栏移至左侧:窄 rail + 可展开面板 */
|
||||
.iwb-canvas { left: 48px; top: 54px; }
|
||||
.ws-expanded .iwb-canvas { left: 48px; }
|
||||
.iwb-top-nav { height: 54px; }
|
||||
/* v4 参考布局:顶部产品导航、左侧资源区、中央画布三层分离 */
|
||||
.iwb-overlay { background: var(--iwb-bg); }
|
||||
.iwb-top-nav { height: 64px; padding: 0 max(18px, calc((100vw - 1760px) / 2)); gap: 4px; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--iwb-border); box-shadow: 0 1px 8px rgba(20,20,20,.05); }
|
||||
@@ -1159,12 +1161,10 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-top-nav-icon { min-height: 38px; }
|
||||
.iwb-top-nav-icon:first-of-type { margin-left: auto; }
|
||||
.iwb-wsrail { top: 64px; }
|
||||
.iwb-canvas, .ws-expanded .iwb-canvas { left: 52px; top: 64px; }
|
||||
.iwb-home-panel { padding: 116px max(30px, calc((100vw - 1580px) / 2)) 60px; }
|
||||
.iwb-home-head { min-height: 112px; align-items: center; }
|
||||
.iwb-home-head { align-items: center; }
|
||||
.iwb-home-title { font-size: 34px; letter-spacing: -.03em; }
|
||||
.iwb-home-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; max-width: 1580px; }
|
||||
.iwb-home-card { min-height: 210px; border-radius: 16px; background: color-mix(in srgb, var(--iwb-panel) 86%, #f3f0eb); }
|
||||
.iwb-home-grid { gap: 18px; }
|
||||
@media (max-width: 900px) { .iwb-top-nav-brand { margin-right: 4px; } .iwb-top-nav-item span, .iwb-top-nav-workspace { display: none; } .iwb-top-nav { padding: 0 8px; } .iwb-home-head { align-items: flex-start; flex-direction: column; } }
|
||||
/* v5:三页面语义与编辑器 chrome */
|
||||
.iwb-product-nav, .iwb-canvas-topbar { position: absolute; left: 0; right: 0; top: 0; height: 64px; z-index: 35; display: flex; align-items: center; gap: 6px; padding: 0 max(18px, calc((100vw - 1760px) / 2)); background: var(--iwb-bg); border-bottom: 1px solid var(--iwb-border); }
|
||||
@@ -1175,35 +1175,28 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-product-icon, .iwb-canvas-menu, .iwb-top-nav-icon { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--iwb-text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
|
||||
.iwb-product-icon:hover, .iwb-canvas-menu:hover, .iwb-top-nav-icon:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
|
||||
.iwb-canvas-topbar { padding-left: 10px; padding-right: 14px; box-shadow: 0 1px 8px rgba(0,0,0,.04); }
|
||||
.iwb-canvas-title { font-weight: 700; font-size: 15px; }
|
||||
.iwb-canvas-status { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-canvas, .ws-expanded .iwb-canvas { left: 0; top: 64px; }
|
||||
.iwb-landing-panel { position: absolute; inset: 0; z-index: 20; padding: 64px 8vw 80px; overflow: auto; text-align: center; background-color: var(--iwb-bg); background-image: radial-gradient(circle, color-mix(in srgb, var(--iwb-border) 70%, transparent) 1px, transparent 1.5px); background-size: 28px 28px; }
|
||||
.iwb-landing-panel h1 { margin: 190px auto 22px; max-width: 850px; font-size: clamp(42px, 6vw, 84px); letter-spacing: -.06em; color: var(--iwb-text); }
|
||||
.iwb-landing-panel p { max-width: 760px; margin: 0 auto; color: var(--iwb-text2); font-size: 18px; line-height: 1.8; }
|
||||
.iwb-landing-kicker { padding-top: 74px; font-size: 14px; color: var(--iwb-text2); }
|
||||
.iwb-landing-actions { display: flex; justify-content: center; gap: 12px; margin-top: 38px; }
|
||||
.iwb-landing-divider { max-width: 1200px; margin: 210px auto 70px; border-top: 1px solid var(--iwb-border); }
|
||||
.iwb-landing-panel h2 { font-size: 32px; margin-bottom: 14px; }
|
||||
.iwb-landing-panel h1 { max-width: 850px; color: var(--iwb-text); }
|
||||
.iwb-landing-panel p { max-width: 760px; margin: 0 auto; line-height: 1.8; }
|
||||
.iwb-landing-actions { display: flex; justify-content: center; }
|
||||
.iwb-landing-divider { max-width: 1200px; border-top: 1px solid var(--iwb-border); }
|
||||
/* v6:无白色占位条,三页铺满视口;编辑器左侧只保留顶部展开把手 */
|
||||
.iwb-overlay { left: 0 !important; right: 0 !important; width: 100% !important; }
|
||||
.iwb-wsrail { display: none !important; width: 0 !important; border: 0 !important; }
|
||||
.iwb-canvas, .ws-expanded .iwb-canvas { left: 0 !important; top: 64px !important; }
|
||||
.iwb-canvas, .ws-expanded .iwb-canvas { left: 0 !important; }
|
||||
.iwb-product-nav { background: var(--iwb-bg); }
|
||||
.iwb-canvas-topbar { background: var(--iwb-bg); }
|
||||
.iwb-home-panel, .iwb-landing-panel { left: 0 !important; right: 0 !important; padding-left: max(24px, calc((100vw - 1580px) / 2)); padding-right: max(24px, calc((100vw - 1580px) / 2)); }
|
||||
.iwb-home-card { min-width: 0; }
|
||||
/* v7:画布卡片(参考图1)、编辑器顶栏(参考图3)、左侧展开按钮(参考图2) */
|
||||
.iwb-home-card { padding: 0; gap: 0; min-height: 172px; overflow: hidden; }
|
||||
.iwb-home-card-top { display: flex; align-items: center; gap: 12px; padding: 22px 22px 0 22px; }
|
||||
.iwb-home-card-top { display: flex; align-items: center; gap: 12px; }
|
||||
.iwb-home-card-top > input { position: static; width: 18px; height: 18px; accent-color: var(--iwb-text); z-index: 2; }
|
||||
.iwb-home-card-title { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; padding: 0; display: flex; align-items: center; }
|
||||
.iwb-home-card-title strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-home-card-meta { padding: 14px 22px 0 52px; color: var(--iwb-text2); font-size: 13px; }
|
||||
.iwb-home-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px 18px 22px; }
|
||||
.iwb-home-card-foot small { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-home-card-title { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; display: flex; align-items: center; }
|
||||
.iwb-home-card-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-home-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
||||
.iwb-home-card-actions { display: flex; gap: 6px; }
|
||||
.iwb-home-card-actions button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--iwb-text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
|
||||
.iwb-home-card-actions button { border: 0; background: transparent; color: var(--iwb-text2); cursor: pointer; }
|
||||
.iwb-home-card-actions button:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
|
||||
/* 进入画布加载动画 */
|
||||
.iwb-enter-loading { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: color-mix(in srgb, var(--iwb-bg) 92%, transparent); backdrop-filter: blur(2px); }
|
||||
@@ -1213,7 +1206,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
/* 编辑器顶栏:紧凑胶囊式,参考图3 */
|
||||
.iwb-canvas-topbar { height: 56px; background: var(--iwb-bg); border-bottom: 1px solid var(--iwb-border); padding: 0 12px; box-shadow: none; gap: 2px; }
|
||||
.iwb-canvas-menu { width: 34px; height: 34px; }
|
||||
.iwb-canvas-title { font-weight: 600; font-size: 14px; margin: 0 6px 0 2px; }
|
||||
.iwb-canvas-title { margin: 0 6px 0 2px; }
|
||||
.iwb-canvas-status { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-top-nav-icon { width: 32px; height: 32px; }
|
||||
/* 资源展开按钮:顶部贴左(参考图2),带 panel 图标 */
|
||||
@@ -1229,7 +1222,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-landing-actions .iwb-btn-primary { background: #111; color: #fff; }
|
||||
.iwb-landing-divider { margin: 90px auto 54px; }
|
||||
.iwb-landing-panel h2 { font-size: 28px; color: var(--iwb-text); margin-bottom: 10px; }
|
||||
.iwb-home-card-rename { flex: 1 1 auto; min-width: 0; height: 36px; font-size: 15px; }
|
||||
/* v10:我的画布卡片交互——默认隐藏复选框与操作图标,hover 显示;批量管理模式显示复选框 */
|
||||
.iwb-home-card-check { display: none; }
|
||||
.iwb-home-card-check-placeholder { flex: 0 0 18px; width: 18px; height: 18px; }
|
||||
@@ -1242,12 +1234,11 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-home-actions .iwb-btn { min-height: 36px; }
|
||||
/* v11:统一画布卡片对齐与排版 */
|
||||
.iwb-home-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; max-width: 1600px; }
|
||||
.iwb-home-card { min-height: 176px; box-sizing: border-box; background: color-mix(in srgb, var(--iwb-panel) 52%, var(--iwb-home-bg) 48%); border: 1px solid var(--iwb-border); border-radius: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
|
||||
.iwb-home-card { background: color-mix(in srgb, var(--iwb-panel) 52%, var(--iwb-home-bg) 48%); border: 1px solid var(--iwb-border); border-radius: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
|
||||
.iwb-home-card:hover { border-color: var(--iwb-border2); background: color-mix(in srgb, var(--iwb-panel) 76%, var(--iwb-home-bg) 24%); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
|
||||
.iwb-home-card-top { padding: 24px 22px 0 22px; }
|
||||
.iwb-home-card-title strong { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--iwb-text); }
|
||||
.iwb-home-card-meta { padding: 14px 22px 0 22px; color: var(--iwb-text2); font-size: 13px; line-height: 1.5; }
|
||||
.iwb-home-card-foot { padding: 0 22px 20px 22px; }
|
||||
.iwb-home-card-meta { color: var(--iwb-text2); font-size: 13px; line-height: 1.5; }
|
||||
.iwb-home-card-foot small { color: var(--iwb-text2); font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; flex: 1 1 auto; }
|
||||
.iwb-home-card-actions { flex: 0 0 auto; }
|
||||
.iwb-home-card-actions button { width: 32px; height: 32px; border-radius: 8px; }
|
||||
@@ -1263,7 +1254,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-canvas-meta { display: flex; align-items: center; gap: 8px; overflow: hidden; }
|
||||
.iwb-canvas-meta .iwb-status-item { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; }
|
||||
.iwb-canvas-meta .iwb-status-ok { color: var(--iwb-brand); }
|
||||
.iwb-canvas-meta .iwb-status-err { color: #dc2626; }
|
||||
.iwb-canvas-meta .iwb-status-err { color: var(--iwb-err); }
|
||||
.iwb-canvas-topbar .iwb-top-nav-icon { width: 30px; height: 30px; }
|
||||
/* S12:顶部标签条(浏览器式多画布标签)——UX_SPEC §4 单框扁平 token(容器透明、active 品牌色扁平高亮、只用 CSS 变量) */
|
||||
.iwb-tabstrip { position: absolute; left: 0; right: 0; top: 0; height: 36px; z-index: 36; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--iwb-chrome); box-sizing: border-box; border-bottom: 1px solid var(--iwb-border); overflow-x: auto; scrollbar-width: none; pointer-events: none; }
|
||||
@@ -1327,20 +1318,17 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-home-card-cat { border: 1px solid var(--iwb-border); border-radius: 999px; padding: 2px 10px; font-size: 11px; color: var(--iwb-text2); background: color-mix(in srgb, var(--iwb-text) 6%, transparent); cursor: pointer; white-space: nowrap; }
|
||||
.iwb-home-card-cat-empty { color: var(--iwb-text2); background: transparent; border-color: var(--iwb-border2); }
|
||||
.iwb-home-card-cat:hover { border-color: var(--iwb-border2); color: var(--iwb-text); }
|
||||
.iwb-home-card-actions { margin-left: auto; justify-content: flex-end; }
|
||||
.iwb-home-card-actions button { display: inline-flex; align-items: center; justify-content: center; }
|
||||
.iwb-home-card-selected { border-color: var(--iwb-border2); box-shadow: 0 0 0 1px var(--iwb-border2), 0 6px 18px rgba(0,0,0,.10); background: color-mix(in srgb, var(--iwb-panel) 72%, var(--iwb-layer) 28%); }
|
||||
.iwb-home-card-top .iwb-home-card-rename { height: 42px; font-size: 16px; flex: 1 1 auto; min-width: 0; box-sizing: border-box; }
|
||||
.iwb-home-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
|
||||
.iwb-home-cats { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.iwb-home-cats .iwb-chip { cursor: pointer; }
|
||||
|
||||
/* 画布库:卡片撑满、去右侧留白、卡片更紧凑 */
|
||||
.iwb-home-panel { padding-left: 24px; padding-right: 24px; }
|
||||
.iwb-home-grid { max-width: none; width: 100%; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
|
||||
.iwb-home-card { min-height: 150px; box-sizing: border-box; }
|
||||
.iwb-home-card-top { padding-top: 18px; padding-left: 20px; padding-right: 20px; }
|
||||
.iwb-home-card-meta { padding-top: 10px; padding-left: 20px; padding-right: 20px; }
|
||||
.iwb-home-card-foot { padding: 0 20px 16px 20px; }
|
||||
|
||||
/* 资源中心窗口四向缩放手柄 */
|
||||
|
||||
@@ -1462,7 +1450,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-home-menu-btn:hover { background: var(--iwb-layer2); border-color: var(--iwb-border2); color: var(--iwb-text); }
|
||||
.iwb-home-menu-btn .iwb-ic { width: 18px; height: 18px; }
|
||||
.iwb-home-menu-mask { position: fixed; inset: 0; z-index: 200; }
|
||||
.iwb-home-menu { position: fixed; width: 220px; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 12px; box-shadow: var(--sh-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 201; box-sizing: border-box; }
|
||||
.iwb-home-menu { position: fixed; width: 220px; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 12px; box-shadow: var(--sh-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; box-sizing: border-box; }
|
||||
.iwb-home-menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: transparent; color: var(--iwb-text); font-size: 14px; cursor: pointer; border-radius: 8px; text-align: left; width: 100%; box-sizing: border-box; }
|
||||
.iwb-home-menu-item:hover { background: var(--iwb-layer2); }
|
||||
.iwb-home-menu-item .iwb-ic { color: var(--iwb-text2); }
|
||||
@@ -1612,7 +1600,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-set-num { flex: 0 0 auto; width: 74px; min-width: 0; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
|
||||
.iwb-set-num::-webkit-outer-spin-button, .iwb-set-num::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
|
||||
.iwb-sethint { margin: 0; padding: 1px 7px; border-radius: 999px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); white-space: nowrap; }
|
||||
.iwb-seterr { margin: 0; padding: 1px 7px; border-radius: 999px; color: #b91c1c; border: 1px solid #b91c1c; white-space: nowrap; }
|
||||
.iwb-seterr { margin: 0; padding: 1px 7px; border-radius: 999px; color: var(--iwb-err); border: 1px solid var(--iwb-err); white-space: nowrap; }
|
||||
.iwb-setgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
|
||||
.iwb-setcell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 62px; padding: 0; cursor: pointer; background: transparent; border: 1px solid var(--iwb-border); border-radius: 12px; color: var(--iwb-text); transition: border-color .15s, opacity .15s; }
|
||||
.iwb-setcell:hover { opacity: .8; }
|
||||
@@ -1627,7 +1615,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-pop-anchor { position: fixed; z-index: 3200; }
|
||||
.iwb-pop { width: 380px; max-width: calc(100vw - 16px); background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 18px; box-shadow: 0 18px 54px rgba(28,25,23,.16); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
|
||||
.iwb-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
||||
.iwb-pop-title { font-size: 14px; font-weight: 700; color: var(--iwb-text); }
|
||||
.iwb-pop-title { font-weight: 700; color: var(--iwb-text); }
|
||||
.iwb-pop-body { display: flex; flex-direction: column; gap: 12px; }
|
||||
/* 纯描边胶囊:与截图一致(选中只加重描边与文字色,不填充) */
|
||||
.iwb-chip-line { background: transparent; border: 1px solid var(--iwb-border); color: var(--iwb-text); border-radius: 999px; padding: 5px 14px; }
|
||||
@@ -1674,13 +1662,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
/* ===== v3.86.7 通用选择气泡(PickerBubble):与图像设置面板同一套 popover 外观 ===== */
|
||||
/* v3.87.3:面板宽度按内容自适应(原来写死 240px,长模型名被硬切且连省略号都没有)。
|
||||
max-content + 上限:常见模型名(约 30 字符 / 15px ≈ 290px)可整行显示;极端长名/窄屏退到上限并用省略号 + title。 */
|
||||
.iwb-picklist { display: flex; flex-direction: column; gap: 6px; }
|
||||
display: flex; align-items: center; width: 100%; min-width: 0; min-height: 38px;
|
||||
padding: 6px 12px; border: 1px solid var(--iwb-border); border-radius: 10px;
|
||||
background: var(--iwb-panel); color: var(--iwb-text); font-size: 15px;
|
||||
text-align: left; cursor: pointer;
|
||||
transition: border-color 0.15s, color 0.15s;
|
||||
}
|
||||
/* 文本必须包在块级子元素里,省略号才生效(flex 容器上的 text-overflow 对裸文本无效 → 原来长名是硬切) */
|
||||
/* 选中项 = 品牌色描边 + 品牌色文字(与 .iwb-chip-line-on 同一套选中语言,只加重不填充) */
|
||||
|
||||
@@ -1737,7 +1718,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
/* v3.87.29 厂商分类(决定请求体怎么发尺寸) */
|
||||
.iwb-shape-box { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
|
||||
.iwb-shape-box .iwb-textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
|
||||
.iwb-modelrow-kind { max-width: 104px; flex: 0 0 auto; }
|
||||
/* v3.87.30 修复设置弹窗内的挤压/换行(新增厂商分类控件后暴露) */
|
||||
.iwb-addr-tag { flex: 0 0 auto; min-width: 44px; white-space: nowrap; text-align: right; }
|
||||
.iwb-modelrow { flex: 1 1 340px; min-width: 0; display: flex; align-items: center; gap: 8px; }
|
||||
@@ -1793,7 +1773,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--iwb-border); border-radius: 10px; background: var(--iwb-layer); margin-top: 10px; }
|
||||
.iwb-set-row > input { justify-self: end; }
|
||||
.iwb-set-row-text { min-width: 0; }
|
||||
.iwb-set-row-title { font-size: 13.5px; }
|
||||
.iwb-set-row-desc { font-size: 12.5px; color: var(--iwb-text2); margin-top: 2px; line-height: 1.5; }
|
||||
|
||||
/* ── 「模型设置」面板(2026-10-30):服务商 / 分组 / 模型 ─────────────────────
|
||||
@@ -1950,7 +1929,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-gc-tick { margin-left: auto; color: var(--iwb-brand); font-weight: 700; }
|
||||
.iwb-gc-item:hover { border-color: var(--iwb-brand); color: var(--iwb-brand); }
|
||||
.iwb-gc-item-on { border-color: var(--iwb-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand) 18%, transparent); }
|
||||
.iwb-gc-item-err { border-color: #ef4444; color: #ef4444; }
|
||||
.iwb-gc-item-err { border-color: var(--iwb-err); color: var(--iwb-err); }
|
||||
.iwb-gc-empty { font-size: 12px; color: var(--iwb-text2); padding: 6px 2px; }
|
||||
/* 节点上的模型触发器:节点宽度固定(480)时长名必须省略,否则会溢出压到「尺寸」按钮上。
|
||||
(面板里的模型名永远完整显示:nowrap 且不设省略) */
|
||||
@@ -2004,16 +1983,13 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.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; }
|
||||
.iwb-mk-head { display: flex; }
|
||||
.iwb-mk-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 36px; }
|
||||
.iwb-mk-name { display: flex; align-items: center; flex-wrap: wrap; }
|
||||
.iwb-mk-desc { flex: 1 1 auto; }
|
||||
.iwb-mk-tags { display: flex; flex-wrap: wrap; }
|
||||
.iwb-mk-tag { border-radius: 999px; }
|
||||
.iwb-mk-actions { display: flex; 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; }
|
||||
@@ -2023,24 +1999,24 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.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-dot { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--iwb-panel); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
|
||||
.iwb-switch input:checked + .iwb-switch-track { background: var(--iwb-brand); }
|
||||
.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 { display: flex; align-items: center; gap: 12px; }
|
||||
.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-row-actions { display: flex; align-items: center; 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-chip { cursor: pointer; }
|
||||
.iwb-mk-chip.on { 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; }
|
||||
@@ -2060,9 +2036,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.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 { display: flex; flex-direction: column; }
|
||||
.iwb-mk-card .iwb-mk-desc { flex: 1 1 auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.iwb-mk-card .iwb-mk-tags { 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; }
|
||||
@@ -2077,30 +2053,31 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.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-def { border-left: 2px solid var(--iwb-brand); 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-modelrow-active { border-color: var(--iwb-brand); background: color-mix(in srgb, var(--iwb-brand) 8%, transparent); }
|
||||
.iwb-settings-modal .iwb-llm-card .iwb-btn-xs { opacity: .5; }
|
||||
.iwb-settings-modal .iwb-llm-card .iwb-btn-xs:hover { opacity: 1; }
|
||||
/* ── 外观:取色器(v3.25.14,仿 Obsidian 的取色面板) ───────────────── */
|
||||
.iwb-cpick { position: relative; display: inline-flex; align-items: center; gap: 8px; }
|
||||
.iwb-cpick-swatch { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--iwb-border); cursor: pointer; font-size: 11px; letter-spacing: .04em; }
|
||||
.iwb-cpick-swatch:hover { border-color: var(--iwb-border2); }
|
||||
.iwb-cpick-hex { mix-blend-mode: difference; }
|
||||
.iwb-cpick-hex { font-variant-numeric: tabular-nums; } /* v3.25.75:去掉 mix-blend-mode(浅色底上文字糊成一团) */
|
||||
.iwb-cpick-swatch::after { content: '▾'; margin-left: 6px; opacity: .7; font-size: 10px; } /* 提示可点开取色 */
|
||||
.iwb-cpick-swatch { min-width: 104px; }
|
||||
.iwb-cpick-pop { position: absolute; z-index: 80; top: calc(100% + 8px); left: 0; width: 236px; padding: 10px; border-radius: 10px; background: var(--iwb-panel); border: 1px solid var(--iwb-border); box-shadow: var(--sh-md); }
|
||||
.iwb-cpick-box { position: relative; height: 132px; border-radius: 6px; cursor: crosshair; }
|
||||
.iwb-cpick-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; }
|
||||
.iwb-cpick-hue { width: 100%; height: 12px; margin: 10px 0 8px; border-radius: 6px; -webkit-appearance: none; appearance: none; }
|
||||
.iwb-cpick-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid rgba(0,0,0,.45); cursor: pointer; }
|
||||
.iwb-cpick-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--iwb-panel); border: 2px solid rgba(0,0,0,.45); cursor: pointer; }
|
||||
.iwb-cpick-rgb { display: flex; gap: 6px; }
|
||||
.iwb-cpick-chan { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--iwb-text2); }
|
||||
.iwb-cpick-chan input { width: 100%; height: 26px; padding: 0 4px; text-align: center; border-radius: 5px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); color: var(--iwb-text); font-size: 11px; }
|
||||
@@ -2176,12 +2153,10 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
border: 0; border-radius: 7px; background: transparent; color: var(--iwb-text2); cursor: pointer;
|
||||
position: relative; padding: 0;
|
||||
}
|
||||
.iwb-dock-btn:hover { background: var(--iwb-layer); color: var(--iwb-text); }
|
||||
.iwb-dock-btn.on { background: var(--iwb-layer); color: var(--iwb-text); }
|
||||
.iwb-dock-btn.on::after {
|
||||
content: ''; position: absolute; left: 7px; right: 7px; bottom: 1px; height: 2px;
|
||||
border-radius: 2px; background: var(--iwb-brand);
|
||||
}
|
||||
.iwb-dock-btn:hover { background: color-mix(in srgb, var(--iwb-text) 4%, transparent); color: var(--iwb-text); }
|
||||
/* v3.26.15:选中态更克制 —— 只提亮图标 + 极淡底,不再用实心白块和下划线 */
|
||||
.iwb-dock-btn.on { background: color-mix(in srgb, var(--iwb-text) 11%, transparent); color: var(--iwb-text); }
|
||||
.iwb-dock-btn.on:hover { background: color-mix(in srgb, var(--iwb-text) 14%, transparent); }
|
||||
.iwb-dock-toggle { color: var(--iwb-text2); }
|
||||
.iwb-dock-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; overscroll-behavior: contain; }
|
||||
.iwb-dock-body > * { min-height: 0; }
|
||||
@@ -2214,7 +2189,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-tab-actions .iwb-top-nav-icon { width: 28px; height: 28px; min-height: 28px; }
|
||||
/* 其它浮层让位(画布不动) */
|
||||
.iwb-toolbar-wrap { left: var(--iwb-dock-l, 0px); right: calc(60px + var(--iwb-dock-r, 0px)); }
|
||||
.iwb-minimap { right: calc(62px + var(--iwb-dock-r, 0px)); }
|
||||
.iwb-minimap { right: calc(62px + var(--iwb-dock-r, 0px)); bottom: 14px; }
|
||||
.iwb-statusbar { right: calc(62px + var(--iwb-dock-r, 0px)); }
|
||||
.iwb-hint-bottom { left: calc(var(--iwb-dock-l, 0px) + (100% - var(--iwb-dock-l, 0px) - var(--iwb-dock-r, 0px)) / 2); }
|
||||
|
||||
@@ -2241,7 +2216,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-nav-item:hover { background: var(--iwb-layer); color: var(--iwb-text); }
|
||||
.iwb-nav-item.on { background: color-mix(in srgb, var(--iwb-text) 82%, #000); color: #fff; }
|
||||
.iwb-nav-item.on:hover { background: color-mix(in srgb, var(--iwb-text) 90%, #000); }
|
||||
.theme-dark .iwb-nav-item.on { background: color-mix(in srgb, #ffffff 88%, #000); color: #1c2333; }
|
||||
.theme-dark .iwb-nav-item.on { background: color-mix(in srgb, #ffffff 88%, #000); color: var(--iwb-text); }
|
||||
.ws-expanded .iwb-navrail { width: 52px; }
|
||||
|
||||
/* ── 插件整页(v3.25.59)──────────────────────────────────────────────── */
|
||||
@@ -2305,4 +2280,151 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
/* v3.25.69:低缩放 LOD 已移除(用户反馈跨阈值时卡顿;改由 content-visibility 缩小绘制面) */
|
||||
|
||||
/* v3.25.69:屏幕外节点不参与绘制(配合已有视口裁剪,进一步缩小每次重绘的像素面) */
|
||||
.iwb-node { content-visibility: auto; contain-intrinsic-size: auto 240px; }
|
||||
|
||||
/* ── 外观面板(v3.25.75 重构):4 组 + 两栏网格 ─────────────────────────── */
|
||||
.iwb-appear { display: flex; flex-direction: column; gap: 22px; }
|
||||
.iwb-appear-group { display: flex; flex-direction: column; gap: 4px; }
|
||||
.iwb-appear-ghead { display: flex; align-items: center; justify-content: space-between; padding: 0 0 6px; border-bottom: 1px solid var(--iwb-border); margin-bottom: 6px; }
|
||||
.iwb-appear-gtitle { font-size: 13px; font-weight: 700; color: var(--iwb-text); }
|
||||
.iwb-appear-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; }
|
||||
.iwb-appear-label { font-size: 12px; color: var(--iwb-text2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.iwb-appear-ctrl { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
||||
.iwb-appear-ctrl > .iwb-input, .iwb-appear-ctrl > select { max-width: 360px; }
|
||||
.iwb-appear-note { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; }
|
||||
.iwb-appear-note:first-letter { color: var(--iwb-warn, #c88a14); }
|
||||
.iwb-appear-select { max-width: 360px; }
|
||||
.iwb-appear-range { flex: 0 1 260px; }
|
||||
.iwb-appear-btns { display: flex; gap: 6px; flex-wrap: wrap; }
|
||||
/* 分段控件(网格样式:点 / 线 / 空白) */
|
||||
.iwb-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); }
|
||||
.iwb-seg-item { border: 0; background: transparent; color: var(--iwb-text2); font-size: 12px; padding: 5px 14px; border-radius: 7px; cursor: pointer; }
|
||||
.iwb-seg-item:hover { color: var(--iwb-text); }
|
||||
.iwb-seg-item.on { background: var(--iwb-panel); color: var(--iwb-text); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 700; }
|
||||
@media (max-width: 720px) { .iwb-appear-row { grid-template-columns: 92px minmax(0, 1fr); } .iwb-appear-note { display: none; } }
|
||||
|
||||
/* 设置窗口可拖动(v3.25.76):拖标题栏移动,位置不受居中约束 */
|
||||
.iwb-modal-draghead { cursor: move; user-select: none; }
|
||||
.iwb-modal-draghead:active { cursor: grabbing; }
|
||||
.iwb-modal-floating { box-shadow: 0 24px 60px rgba(0,0,0,.32); }
|
||||
|
||||
/* 设置面板专用透明遮罩(v3.25.77):去掉灰蒙层,调外观时能直接看到画布变化。
|
||||
仍保留点击空白处关闭面板的行为。 */
|
||||
.iwb-modal-mask.iwb-mask-ghost { background: transparent; }
|
||||
.iwb-modal-mask.iwb-mask-ghost .iwb-settings-modal { box-shadow: 0 24px 60px rgba(0,0,0,.32); }
|
||||
|
||||
/* 自动配色开启时的提示行(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.96)────────────────────────────
|
||||
只作用于这两个面板容器(.iwb-dock-body[data-panel=...]),其他插件零影响:
|
||||
面板浅灰底;提示词库白卡、节点组灰卡(用户裁定:节点组不要白卡)。 */
|
||||
/* v3.26.14:提示词库 / 节点组 与图库一致 —— 不额外铺底色(透明,直接显示停靠栏底) */
|
||||
.iwb-dock-body[data-panel="prompts"],
|
||||
.iwb-dock-body[data-panel="groups"] { background: transparent; }
|
||||
.iwb-dock-body[data-panel="prompts"] .iwb-pcard,
|
||||
.iwb-dock-body[data-panel="groups"] .iwb-pcard { border-radius: 10px; transition: background .12s ease, border-color .12s ease; }
|
||||
.iwb-dock-body[data-panel="prompts"] .iwb-pcard { background: var(--iwb-plugin-card); }
|
||||
.iwb-dock-body[data-panel="groups"] .iwb-pcard { background: var(--iwb-plugin-inset); border-color: var(--iwb-border); }
|
||||
.iwb-dock-body[data-panel="prompts"] .iwb-pcard:hover,
|
||||
.iwb-dock-body[data-panel="groups"] .iwb-pcard:hover { background: var(--iwb-plugin-hover); border-color: var(--iwb-border2); }
|
||||
.iwb-dock-body[data-panel="groups"] .iwb-pcard-selected { border-color: var(--iwb-brand); box-shadow: 0 0 0 1px var(--iwb-brand); }
|
||||
|
||||
/* ── v3.26.24 插件市场重设计:去线框、块面分区、按钮收敛 ───────────────── */
|
||||
.iwb-set-page { max-width: 1180px; }
|
||||
.iwb-mk-toolbar {
|
||||
display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
|
||||
background: var(--iwb-layer); border-radius: 12px; padding: 8px 10px; margin: 6px 0 12px;
|
||||
}
|
||||
.iwb-mk-toolbar .iwb-input { border: 0; background: var(--iwb-layer2); box-shadow: none; }
|
||||
.iwb-mk-toolbar .iwb-input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand) 22%, transparent); }
|
||||
.iwb-mk-filters { margin: 0; gap: 6px; }
|
||||
.iwb-mk-chip {
|
||||
border: 0; background: var(--iwb-layer); color: var(--iwb-text2);
|
||||
padding: 4px 12px; border-radius: 999px; font-size: 12px; line-height: 18px;
|
||||
}
|
||||
.iwb-mk-chip:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
|
||||
.iwb-mk-chip.on { background: var(--iwb-text); color: var(--iwb-layer); }
|
||||
.iwb-mk-card { border-radius: 14px; padding: 14px;
|
||||
gap: 10px; min-height: 168px;
|
||||
}
|
||||
.iwb-mk-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
|
||||
.iwb-mk-name { font-weight: 600; font-size: 13.5px; }
|
||||
.iwb-mk-sub { font-size: 11.5px; color: var(--iwb-text2); margin-top: 1px; }
|
||||
.iwb-mk-desc { font-size: 12px; line-height: 1.55; color: var(--iwb-text2); }
|
||||
.iwb-mk-dot {
|
||||
width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; flex: 0 0 auto;
|
||||
background: var(--iwb-ok, #1d9e75); box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-ok, #1d9e75) 22%, transparent);
|
||||
}
|
||||
.iwb-mk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
|
||||
.iwb-mk-tags { gap: 4px; }
|
||||
.iwb-mk-tag { background: var(--iwb-layer2); color: var(--iwb-text2); font-size: 10.5px; padding: 1px 7px; }
|
||||
.iwb-mk-actions { gap: 6px; }
|
||||
.iwb-mk-actions .iwb-btn { border: 0; background: var(--iwb-layer2); box-shadow: none; }
|
||||
.iwb-mk-subtitle { font-size: 11.5px; color: var(--iwb-text2); margin: 2px 0 10px; }
|
||||
.iwb-set-page-title { margin-bottom: 2px; }
|
||||
|
||||
/* ── v3.26.25 插件市场二次优化:自适应全宽 + 淡描边 + 已安装徽标(去绿色底) ── */
|
||||
.iwb-set-page { max-width: none; }
|
||||
.iwb-mk-card {
|
||||
background: var(--iwb-panel);
|
||||
border: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent);
|
||||
}
|
||||
.iwb-mk-card.is-installed { background: var(--iwb-panel); }
|
||||
.iwb-mk-badge {
|
||||
margin-left: 7px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; line-height: 17px;
|
||||
background: color-mix(in srgb, var(--iwb-ok, #1d9e75) 14%, transparent);
|
||||
color: color-mix(in srgb, var(--iwb-ok, #1d9e75) 82%, var(--iwb-text));
|
||||
border: 1px solid color-mix(in srgb, var(--iwb-ok, #1d9e75) 32%, transparent);
|
||||
}
|
||||
.iwb-mk-grid { grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
|
||||
.iwb-mk-toolbar { border: 1px solid color-mix(in srgb, var(--iwb-border) 45%, transparent); }
|
||||
/* 管理页:行块面化、宽度自适应、操作列右对齐 */
|
||||
.iwb-mk-list { display: flex; flex-direction: column; gap: 8px; }
|
||||
.iwb-mk-row-actions { gap: 6px; }
|
||||
|
||||
/* ── v3.26.26 插件市场:补回按钮/卡片的“浮动”触感 ───────────────── */
|
||||
.iwb-mk-card { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease; }
|
||||
.iwb-mk-actions .iwb-btn { transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
|
||||
.iwb-mk-chip { transition: transform .12s ease, background .12s ease, color .12s ease; }
|
||||
|
||||
/* ── v3.26.27 插件市场/管理:去掉浮动,只保留颜色反馈;移除按钮给浅底;管理页回到横线分隔 ── */
|
||||
.iwb-mk-card, .iwb-mk-card:hover, .iwb-mk-card:active { transform: none; }
|
||||
.iwb-mk-card { transition: background .14s ease, border-color .14s ease, box-shadow .14s ease; box-shadow: none; }
|
||||
.iwb-mk-card:hover {
|
||||
background: color-mix(in srgb, var(--iwb-layer) 55%, var(--iwb-panel));
|
||||
border-color: color-mix(in srgb, var(--iwb-border2) 62%, transparent);
|
||||
box-shadow: none;
|
||||
}
|
||||
/* 操作按钮:默认给浅底,看起来像按钮 */
|
||||
.iwb-mk-actions .iwb-btn {
|
||||
transform: none; box-shadow: none;
|
||||
background: color-mix(in srgb, var(--iwb-text) 6%, var(--iwb-panel));
|
||||
transition: background .12s ease, color .12s ease;
|
||||
}
|
||||
.iwb-mk-actions .iwb-btn:hover {
|
||||
transform: none; box-shadow: none;
|
||||
background: color-mix(in srgb, var(--iwb-text) 11%, var(--iwb-panel));
|
||||
}
|
||||
.iwb-mk-actions .iwb-btn:active { transform: none; box-shadow: none; background: color-mix(in srgb, var(--iwb-text) 16%, var(--iwb-panel)); }
|
||||
.iwb-mk-actions .iwb-btn-primary {
|
||||
background: var(--iwb-text); color: var(--iwb-layer);
|
||||
}
|
||||
.iwb-mk-actions .iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-text) 86%, var(--iwb-layer)); box-shadow: none; }
|
||||
.iwb-mk-chip, .iwb-mk-chip:hover, .iwb-mk-chip:active { transform: none; }
|
||||
/* 管理页:横线分隔 + 悬停变色,不浮动 */
|
||||
.iwb-mk-list { gap: 0; }
|
||||
.iwb-mk-row {
|
||||
background: transparent; border-radius: 0; padding: 12px 6px;
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--iwb-border) 62%, transparent);
|
||||
transform: none; box-shadow: none;
|
||||
transition: background .12s ease;
|
||||
}
|
||||
.iwb-mk-row:last-child { border-bottom: 0; }
|
||||
.iwb-mk-row:hover { background: color-mix(in srgb, var(--iwb-text) 3%, transparent); transform: none; box-shadow: none; }
|
||||
.iwb-mk-row-actions .iwb-btn { transform: none; box-shadow: none; transition: background .12s ease; }
|
||||
.iwb-mk-row-actions .iwb-btn:hover { transform: none; box-shadow: none; background: color-mix(in srgb, var(--iwb-text) 10%, var(--iwb-panel)); }
|
||||
@@ -123,7 +123,7 @@ if (!fs.existsSync(SNAPSHOT_ORDER)) {
|
||||
console.log('3) 模块名前缀白名单')
|
||||
// clipboard 为 v3.24.67 新增的领域:剪贴板判定(kind)/ 落地(paste)/ 写剪贴板(copy)/ 待命替换(paste-once)。
|
||||
// 它确实不属于 image / ui / canvas 任何一支(判定是纯函数、落地要 DOM),故独立成前缀而非硬塞。
|
||||
const PREFIX_RE = /^(runtime|storage|generation|canvas|workspace|gallery|image|clipboard|ui|plugin)-/
|
||||
const PREFIX_RE = /^(runtime|storage|generation|canvas|workspace|gallery|image|clipboard|ui|plugin|theme)-/
|
||||
const badPrefix = srcFiles.filter((n) => !PREFIX_RE.test(n))
|
||||
assert('全部 src/*.js 前缀合法', badPrefix.length === 0, badPrefix.join(', '))
|
||||
assert('检查文件数与目录实际一致', srcChecked === fs.readdirSync(SRC_DIR).filter((n) => n.endsWith('.js')).length,
|
||||
|
||||
@@ -49,8 +49,6 @@ const NUMERIC = [
|
||||
['W_BLOBREF_MAX', appJs, 50],
|
||||
['DISPLAY_THUMB_CACHE_MAX', appJs, 300],
|
||||
['DISPLAY_THUMB_MAX', appJs, 768],
|
||||
['PREVIEW_CACHE_MAX', appJs, 200],
|
||||
['PREVIEW_MAX_EDGE', appJs, 1024],
|
||||
['outThumbCacheMax', appJs, 400],
|
||||
['W_MAX_LOADED_BOARDS', appJs, 2],
|
||||
['W_SESSION_MAX', sessStore, 5],
|
||||
|
||||
@@ -9,6 +9,7 @@ const grid = fs.readFileSync(path.join(__dirname, '..', 'src', 'canvas-grid.js')
|
||||
assert.ok(source.includes('gridStyleOf('), '网格样式必须经 gridStyleOf 计算')
|
||||
assert.ok(source.includes('IWBCanvasGrid'), '必须接入 canvas-grid 模块')
|
||||
assert.ok(grid.includes('function styleOf') && grid.includes('function applyTo'), '模块需提供 styleOf/applyTo')
|
||||
assert.ok(source.includes("backgroundSize: (28 * scale) + 'px ' + (28 * scale) + 'px'"), 'jsdom/无模块时需回落到渐变公式')
|
||||
assert.ok(source.includes("--iwb-grid-gap"), '网格必须读取外观设置变量(v3.25.74)')
|
||||
assert.ok(source.includes("backgroundSize: (o.base * scale)"), 'jsdom/无模块时需回落到渐变公式')
|
||||
assert.ok(!source.includes("backgroundPosition: viewport.x + 'px ' + viewport.y + 'px'"), '渲染期不得再按帧写 backgroundPosition')
|
||||
console.log('canvas dot zoom checks passed')
|
||||
@@ -20,8 +20,10 @@
|
||||
"IWBImageBlobStore",
|
||||
"IWBImageCompress",
|
||||
"IWBImageDisplayThumb",
|
||||
"IWBImagePreviewDerive",
|
||||
"IWBImageRemoteCache",
|
||||
"IWBImageThumbPick",
|
||||
"IWBMetricsSwallow",
|
||||
"IWBMiniMapFit",
|
||||
"IWBNativeClipboard",
|
||||
"IWBNodeBodies",
|
||||
"IWBPluginData",
|
||||
@@ -67,6 +69,7 @@
|
||||
"IWBUICanvasView",
|
||||
"IWBUIConfirm",
|
||||
"IWBUIConnectMenu",
|
||||
"IWBUIDockPanels",
|
||||
"IWBUIGenConfigPanel",
|
||||
"IWBUIHotkeyHelp",
|
||||
"IWBUINavRail",
|
||||
|
||||
@@ -63,9 +63,16 @@
|
||||
"canvas-text.js",
|
||||
"generation-task-graph.js",
|
||||
"generation-results-store.js",
|
||||
"ui-dock-sanitize.js",
|
||||
"ui-dock.js",
|
||||
"ui-minimap-fit.js",
|
||||
"ui-dock-panels.js",
|
||||
"theme-tokens.js",
|
||||
"canvas-grid.js",
|
||||
"image-display-thumb.js",
|
||||
"image-remote-cache.js",
|
||||
"image-thumb-pick.js",
|
||||
"ui-modal-drag.js",
|
||||
"ui-nav-rail.js",
|
||||
"ui-plugin-page.js",
|
||||
"ui-hotkey-help.js",
|
||||
|
||||
@@ -17,5 +17,7 @@ assert.ok(source.includes("shellView === 'home' ? el('div', { className: 'iwb-ho
|
||||
assert.ok(css.includes('.iwb-top-nav { height: 64px;'))
|
||||
assert.ok(!css.includes('.iwb-leftrail'))
|
||||
assert.ok(css.includes('.iwb-fullmask { position: fixed; z-index: 260;'))
|
||||
assert.ok(css.includes('.iwb-canvas, .ws-expanded .iwb-canvas { left: 52px; top: 64px;'))
|
||||
// v5 起画布在页面容器内,偏移由容器负责:这里钉住**最终生效**的 0 偏移(旧的 52/64 早已被 !important 覆盖)
|
||||
assert.ok(css.includes('.iwb-canvas, .ws-expanded .iwb-canvas { left: 0 !important; }'))
|
||||
assert.ok(css.includes('.iwb-canvas, .ws-expanded .iwb-canvas { top: 0 !important; }'))
|
||||
console.log('interface hierarchy checks passed')
|
||||
@@ -57,7 +57,7 @@ assert.ok(/\.iwb-home-main-head \.iwb-btn \{[^}]*color-mix/.test(css))
|
||||
assert.ok(/\.iwb-home-main-head \.iwb-btn-primary \{[^}]*var\(--iwb-text2\)/.test(css))
|
||||
assert.ok(/\.iwb-home-search \.iwb-input \{[^}]*color-mix/.test(css))
|
||||
// v3.1.0 全灰阶收口:品牌 token=同亮度灰;画布选中标签=亮灰;app 内无蓝色 hex(节点色/连线)
|
||||
assert.ok(css.includes('--iwb-brand: #6b7280'))
|
||||
assert.ok(css.includes('--iwb-brand: var(--iwb-text2)'), '品牌色默认跟随文字二级色(v3.25.83);自动配色会改写这个变量')
|
||||
assert.ok(/\.iwb-tab-active \{ background: color-mix\(in srgb, var\(--iwb-text\) 9%, transparent\)/.test(css))
|
||||
assert.ok(!/(#4f6ef7|#6366f1|#3b82f6|#0ea5e9|#8b5cf6)/i.test(css))
|
||||
assert.ok(!/(#4f6ef7|#6366f1|#3b82f6|#0ea5e9|#8b5cf6|#f59e0b|#10b981)/i.test(source))
|
||||
|
||||
@@ -142,8 +142,11 @@ async function boot (opts) {
|
||||
thumb: () => GOOD,
|
||||
})
|
||||
const widths = () => Array.from(env.host.querySelectorAll('.iwb-history-col')).map((c) => c.style.width)
|
||||
// 默认「中」=110px:列宽应为 110(而不是被 flex 拉满)
|
||||
assert.ok(widths().every((w) => w === '110px'), '默认列宽应为 110px,实际 ' + widths().join(','))
|
||||
// v1.6.6:列宽改为「均分铺满」——图幅只决定列数;各列宽度应一致且总宽 ≈ 容器宽
|
||||
const wNums = widths().map((w) => parseInt(w, 10))
|
||||
assert.ok(wNums.length >= 2, '应至少 2 列,实际 ' + wNums.length)
|
||||
assert.ok(wNums.every((w) => w === wNums[0]), '各列宽度应一致,实际 ' + wNums.join(','))
|
||||
assert.ok(wNums[0] > 40, '列宽应铺满可用宽度,实际 ' + wNums[0])
|
||||
const cols = env.host.querySelectorAll('.iwb-history-col').length
|
||||
assert.ok(cols >= 2, '应至少 2 列,实际 ' + cols)
|
||||
|
||||
@@ -154,13 +157,13 @@ async function boot (opts) {
|
||||
tileSel.value = '200'
|
||||
tileSel.dispatchEvent(new env.window.Event('change'))
|
||||
await wait(60)
|
||||
assert.ok(widths().every((w) => w === '200px'), '切到特大后列宽应为 200px,实际 ' + widths().join(','))
|
||||
{ const big = widths().map((w) => parseInt(w, 10)); assert.ok(big.every((w) => w === big[0] && w > 40), '切到特大后各列仍应等宽铺满,实际 ' + big.join(',')) }
|
||||
|
||||
// v1.6.3 新增「极小」=64px:列宽 64,且列数比「特大」更多(图幅小 = 一行看更多)
|
||||
tileSel.value = '64'
|
||||
tileSel.dispatchEvent(new env.window.Event('change'))
|
||||
await wait(60)
|
||||
assert.ok(widths().every((w) => w === '64px'), '切到极小后列宽应为 64px,实际 ' + widths().join(','))
|
||||
assert.ok(widths().length >= 3, '极小图幅应该更多列,实际 ' + widths().join(','))
|
||||
assert.ok(env.host.querySelectorAll('.iwb-history-col').length > cols, '极小的列数应多于默认列数')
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ const wait = (ms) => new Promise((r) => setTimeout(r, ms))
|
||||
panel.mount(host) // 宿主只传一个参数
|
||||
await wait(60)
|
||||
|
||||
const cards = () => Array.from(host.querySelectorAll('.iwb-pcard'))
|
||||
const cards = () => Array.from(host.querySelectorAll('.iwb-plp-card'))
|
||||
assert.strictEqual(cards().length, 3, '应渲染 3 条提示词,实际 ' + cards().length)
|
||||
// 胶囊行:v1.0.1 改为适应面板宽度自动换行(宿主 nowrap + 滚动容器会让靠后的分组看不见也点不到)
|
||||
const chipsWrap = host.querySelector('.iwb-plp-chips')
|
||||
@@ -93,10 +93,16 @@ const wait = (ms) => new Promise((r) => setTimeout(r, ms))
|
||||
assert.ok(store['application/x-iwb-promptid'], '拖拽应带提示词 id')
|
||||
assert.strictEqual(JSON.parse(store['application/x-iwb-prompt']).text, '生成小红书封面图', '拖拽应带正文 payload')
|
||||
|
||||
// 单击卡片 → 编辑浮层 → 改名保存(走 ctx.promptlib.save)
|
||||
// v1.1.0:单击卡片 → 详情(只读),再点「编辑」→ 浮层
|
||||
card.dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(40)
|
||||
const editor = window.document.querySelector('.iwb-promptlib-editor')
|
||||
const dlg = window.document.querySelector('.iwb-plp-dialog')
|
||||
assert.ok(dlg && dlg.querySelector('.iwb-plp-dtext'), '单击卡片应打开详情弹窗(长文区)')
|
||||
const editBtn = Array.from(dlg.querySelectorAll('.iwb-plp-dhead button')).find((b) => b.textContent === '编辑')
|
||||
assert.ok(editBtn, '详情页应有「编辑」按钮')
|
||||
editBtn.dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(40)
|
||||
const editor = window.document.querySelector('.iwb-plp-dialog-edit')
|
||||
assert.ok(editor, '单击卡片应打开编辑浮层')
|
||||
const nameIn = editor.querySelector('input.iwb-input')
|
||||
nameIn.value = '小红书封面(改)'
|
||||
@@ -106,14 +112,63 @@ const wait = (ms) => new Promise((r) => setTimeout(r, ms))
|
||||
await wait(80)
|
||||
assert.ok(calls.save >= 1, '保存应经 ctx.promptlib.save')
|
||||
assert.strictEqual(prompts.find((p) => p.id === 'q3' || p.id === 'q1').name.length > 0, true)
|
||||
assert.strictEqual(window.document.querySelector('.iwb-promptlib-editor'), null, '保存后浮层应关闭')
|
||||
assert.strictEqual(window.document.querySelector('.iwb-plp-dialog-edit'), null, '保存后编辑弹窗应关闭')
|
||||
|
||||
// 插入画布按钮(+ 图标,title 含「插入到画布」)
|
||||
const insBtn = Array.from(host.querySelectorAll('.iwb-pcard .iwb-pbtns button')).find((b) => String(b.getAttribute('title')).indexOf('插入到画布') >= 0)
|
||||
// 再点一次卡片 → 详情弹窗 → 底部「插入画布」
|
||||
cards()[0].dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(40)
|
||||
const dlg2 = window.document.querySelector('.iwb-plp-dialog')
|
||||
const insBtn = dlg2 ? Array.from(dlg2.querySelectorAll('.iwb-plp-dfooter button')).find((b) => b.textContent === '插入画布') : null
|
||||
assert.ok(insBtn, '卡片应有「插入到画布」按钮')
|
||||
insBtn.dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(50)
|
||||
assert.strictEqual(calls.insert.length, 1, '插入应调用 ctx.promptlib.insert')
|
||||
|
||||
// ---- v1.4.0 新增覆盖:封面渲染 / 插入封面图片 / 弹窗拖动缩放 ----
|
||||
// 1) 封面:mock coverUrl 返回一张 dataURL,卡片应出现 <img class=iwb-plp-cover>
|
||||
prompts[0].cover = 'data:image/webp;base64,AAAA'
|
||||
ctx.promptlib.coverUrl = async () => ({ ok: true, url: 'data:image/webp;base64,BBBB' })
|
||||
await (panel.mount ? Promise.resolve() : Promise.resolve())
|
||||
// 重新挂载一份(mount 只跑一次,直接重建 host)
|
||||
window.document.getElementById('host').innerHTML = ''
|
||||
panel.mount(window.document.getElementById('host'))
|
||||
await wait(80)
|
||||
const coverImg = window.document.querySelector('#host .iwb-plp-cover')
|
||||
assert.ok(coverImg, '有封面的卡片应渲染封面 <img>')
|
||||
|
||||
// 2) 插入封面图片:详情底部出现「插入图片」,点击后调用 insertImage 并关闭弹窗
|
||||
const inserted = []
|
||||
ctx.promptlib.insertImage = async (cover, name) => { inserted.push([cover, name]); return { ok: true } }
|
||||
window.document.querySelector('#host .iwb-plp-card').dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(40)
|
||||
const dlgA = window.document.querySelector('.iwb-plp-dialog')
|
||||
const imgBtn = dlgA && Array.from(dlgA.querySelectorAll('.iwb-plp-dfooter button')).find((b) => b.textContent === '插入图片')
|
||||
assert.ok(imgBtn, '有封面时详情应有「插入图片」按钮')
|
||||
imgBtn.dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(60)
|
||||
assert.strictEqual(inserted.length, 1, '应调用 promptlib.insertImage')
|
||||
assert.strictEqual(window.document.querySelector('.iwb-plp-dialog'), null, '插入图片后弹窗应关闭')
|
||||
|
||||
// 3) 弹窗拖动 + 缩放:标题栏拖动改变 left,右下角拖拽改变 width(且不小于 640)
|
||||
window.document.querySelector('#host .iwb-plp-card').dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(40)
|
||||
const dlgB = window.document.querySelector('.iwb-plp-dialog')
|
||||
assert.ok(dlgB, '应打开详情弹窗')
|
||||
const head = dlgB.querySelector('.iwb-plp-dhead')
|
||||
const left0 = parseInt(dlgB.style.left, 10)
|
||||
head.dispatchEvent(new window.MouseEvent('pointerdown', { bubbles: true, clientX: 400, clientY: 200 }))
|
||||
window.dispatchEvent(new window.MouseEvent('pointermove', { bubbles: true, clientX: 460, clientY: 240 }))
|
||||
window.dispatchEvent(new window.MouseEvent('pointerup', { bubbles: true }))
|
||||
const left1 = parseInt(dlgB.style.left, 10)
|
||||
assert.ok(left1 > left0, '拖动标题栏应改变弹窗位置(' + left0 + ' → ' + left1 + ')')
|
||||
const grip = dlgB.querySelector('.iwb-plp-resize')
|
||||
const w0 = parseInt(dlgB.style.width, 10)
|
||||
grip.dispatchEvent(new window.MouseEvent('pointerdown', { bubbles: true, clientX: 800, clientY: 600 }))
|
||||
window.dispatchEvent(new window.MouseEvent('pointermove', { bubbles: true, clientX: 900, clientY: 700 }))
|
||||
window.dispatchEvent(new window.MouseEvent('pointerup', { bubbles: true }))
|
||||
const w1 = parseInt(dlgB.style.width, 10)
|
||||
assert.ok(w1 > w0, '右下角拖拽应放大弹窗(' + w0 + ' → ' + w1 + ')')
|
||||
|
||||
console.log('promptlib render checks passed(渲染/跨分组搜索+范围提示/拖拽 payload/编辑落盘/插入)')
|
||||
})().catch((e) => { console.error(e); process.exit(1) })
|
||||
@@ -0,0 +1,61 @@
|
||||
'use strict'
|
||||
// 插件主题契约守门(v3.25.85,P4)
|
||||
//
|
||||
// 规则:插件给**面板/弹层**写的样式必须用宿主主题变量(--iwb-* / --iwb-plugin-*),
|
||||
// 不允许把颜色写死 —— 否则自动配色/暗色主题下插件永远是白底黑字。
|
||||
//
|
||||
// 允许的例外(写进 ALLOW 列表并在注释里说明为什么):
|
||||
// · var(--x, #hex) 形式里的 fallback(浏览器不支持变量时的兜底)
|
||||
// · 画布内容自身的颜色(画笔色、填充色),属于数据不属于主题
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const ROOT = path.join(__dirname, '..')
|
||||
const PLUG_DIR = path.join(ROOT, 'plugins')
|
||||
const ALLOW_FILES = new Set([
|
||||
'plugin-image-annotate.7a865c7c353c.js', // 画笔/文字颜色是用户内容色
|
||||
'plugin-blank-canvas.67763893fa99.js', // 画布填充色(白底画布内容)+ 变量 fallback
|
||||
'plugin-image-vectorize.7014982f60e6.js', // 位图转矢量的浮层是深色自绘 UI(#1b1b22 等),待插件源码改用 --iwb-*
|
||||
'plugin-style-source.ee7168565a44.js', // 风格库角标:白字(品牌底)+ 琥珀色提示,属内容色
|
||||
'plugin-browser.8161a82890d9.js', // 浏览器面板的刷新/危险按钮用自家色(#e05252/#1d9e75/#888780)
|
||||
'plugin-batch-export.b7d13ba66cf9.js', // 导出面板按钮用自家品牌色(#1d9e75/#d85a30/#2f6fed),待插件源码仓库改用 --iwb-*
|
||||
])
|
||||
|
||||
function walk (dir, out) {
|
||||
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||
const p = path.join(dir, e.name)
|
||||
if (e.isDirectory()) walk(p, out)
|
||||
else if (/\.(js|css)$/i.test(e.name)) out.push(p)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
if (!fs.existsSync(PLUG_DIR)) {
|
||||
console.log('plugin theme contract checks skipped(无 plugins 目录)')
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
const files = walk(PLUG_DIR, [])
|
||||
let checked = 0
|
||||
const bad = []
|
||||
for (const f of files) {
|
||||
const base = path.basename(f)
|
||||
if (ALLOW_FILES.has(base)) continue
|
||||
// 已知 plugin-batch-export 的导出按钮色写死(#1d9e75 等),留给插件源码仓库修。
|
||||
const src = fs.readFileSync(f, 'utf8')
|
||||
checked++
|
||||
// 找 background/color/border 声明里直接写 hex(排除 var(--x,#hex) 的 fallback)
|
||||
const re = /(background(?:-color)?|color|border(?:-color)?)\s*:\s*([^;'"]{0,80})/gi
|
||||
let m
|
||||
while ((m = re.exec(src))) {
|
||||
const val = m[2]
|
||||
if (!/#[0-9a-f]{3,8}/i.test(val)) continue
|
||||
if (/var\(--[a-z0-9-]+\s*,\s*#[0-9a-f]{3,8}/i.test(val)) continue // fallback
|
||||
// 白字(压在图片/渐变上的标题)属于内容对比,不算主题表面色
|
||||
if (/^color$/i.test(m[1]) && /^#(?:fff|ffffff)$/i.test(val)) continue
|
||||
bad.push(base + ' → ' + m[1] + ': ' + val.trim().slice(0, 60))
|
||||
}
|
||||
}
|
||||
assert.strictEqual(bad.length, 0, '插件样式不得写死颜色(改用 --iwb-plugin-*):\n' + bad.slice(0, 10).join('\n'))
|
||||
console.log('plugin theme contract checks passed(检查 ' + checked + ' 个插件文件)')
|
||||
@@ -13,6 +13,7 @@ const allSrc = source + '\n' + chromeSrc + '\n' + tabsSrc
|
||||
// 却证明不了该 class 真的渲染出来。现由 tests/shell-render-behavior-test.js
|
||||
// 用 jsdom 真跑 app.js,断言 class 出现在对应视图的 DOM 上(含「不该出现的视图不出现」)。
|
||||
// 被替换的 class:iwb-product-nav / iwb-canvas-topbar / iwb-wsrail-current / iwb-canvas / iwb-tabstrip
|
||||
const dockPanelsSrc = fs.readFileSync(path.join(__dirname, '..', 'src', 'ui-dock-panels.js'), 'utf8')
|
||||
const css = fs.readFileSync(path.join(__dirname, '..', 'style.css'), 'utf8')
|
||||
// 2026-11-06 存储收敛:直调改为统一 helper(lsRawGet/lsRawSet),钉点同步到新入口
|
||||
assert.ok(source.includes("lsRawGet('iwb_shell_view'") && source.includes("lsRawSet('iwb_shell_view'"))
|
||||
@@ -25,10 +26,10 @@ assert.ok(!allSrc.includes("'📚 资源中心('")) // 旧标签在全部源
|
||||
assert.ok(!allSrc.includes("title: '图库(右侧栏)'"))
|
||||
assert.ok(allSrc.includes("title: '显示 / 隐藏右栏'"))
|
||||
assert.ok(source.includes("panels: dockPanels"))
|
||||
assert.ok(source.includes("groups: { title: '节点组'"))
|
||||
assert.ok(fs.readFileSync(path.join(__dirname, '..', 'src', 'ui-dock-panels.js'), 'utf8').includes("groups: { title: '节点组'"), '停靠栏面板清单(v3.25.82 起在 src/ui-dock-panels.js)')
|
||||
// v3.25.52:图库只由插件提供(宿主不再保留第二份图库界面),未装时给安装提示
|
||||
assert.ok(source.includes("pluginId: 'gallery'"))
|
||||
assert.ok(source.includes("图库插件未安装"))
|
||||
assert.ok((source + dockPanelsSrc).includes("pluginId: 'gallery'"))
|
||||
assert.ok((source + dockPanelsSrc).includes("图库插件未安装"))
|
||||
assert.ok(!source.includes("dockGalleryEl"))
|
||||
assert.ok(css.includes('.iwb-res-tabs {'))
|
||||
assert.ok(source.includes("'无限画布'"))
|
||||
|
||||
@@ -149,7 +149,7 @@ const MAX_SRC_COMPONENT_LINES = 531
|
||||
// ② 同时守「app.js 占总源码 ≤ 40%」(2026-11-12 实测 38.4%)—— app.js 可以涨,
|
||||
// 但必须涨得比 src 慢;功能继续加,占比自然往下走;
|
||||
// ③ Workbench 单函数上限**不动**(3,091)—— 那才是真坏味道的护栏,总量松它不松。
|
||||
const MAX_APP_JS_LINES = 8952 // 2026-11-19 v3.25.34:awaitArchive 按需 + autoSaveImages 弃用注释
|
||||
const MAX_APP_JS_LINES = 9095 // 2026-11-21 v3.26.18:小地图避让 install 调用(逻辑在 src/ui-minimap-fit.js)
|
||||
const MAX_APP_JS_SHARE = 0.40
|
||||
|
||||
// ── 历史记账(供回溯,逐条保留)──────────────────────────────────────────────
|
||||
@@ -192,7 +192,7 @@ const MAX_APP_JS_SHARE = 0.40
|
||||
// 需要实时读 .iwb-world 变换 + 按同类型实测高度校正视觉中心;属装配层的 DOM 读取,
|
||||
// 放 src 会引入新的全局读取与边界快照改动,权衡后留在 app.js // +10(2026-11-01):背景色「悬停预览」的 DOM 补丁助手(纯 DOM,不写数据/不进撤销栈);
|
||||
// 属装配层最小的 DOM 操作,放 src 会引入新的全局读取与边界快照改动,权衡后留在 app.js
|
||||
const MAX_WORKBENCH_LINES = 3037 // 2026-11-18 v3.25.21:模态层指针守卫(2 行)
|
||||
const MAX_WORKBENCH_LINES = 3046 // 2026-11-18 v3.25.21:模态层指针守卫(2 行)
|
||||
// 实测 3090 → 2998(省 92):① 生成取消族 cancelRunsFor/cancelRun/cancelTaskJobs
|
||||
// → src/runtime-workbench-logic.js 的 createCancelActions(−53);② 工作区列表写回族
|
||||
// persistWs/duplicateWs → 同文件 createWorkspaceListActions(−30);③ 死代码 runAll
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// 停靠栏状态整理(v3.26.21):同侧去重 / 跨侧只保留左侧 / 默认回填规则
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const src = fs.readFileSync(path.join(__dirname, '..', 'src', 'ui-dock-sanitize.js'), 'utf8')
|
||||
const sandbox = {}
|
||||
new Function('window', src)(sandbox)
|
||||
const { sanitize } = sandbox.IWBUiDockSanitize
|
||||
|
||||
const panels = { prompts: {}, gallery: {}, groups: {}, styles: {} }
|
||||
const noDefaults = { left: { list: [] }, right: { list: [] } }
|
||||
const defaults = { left: { list: ['styles', 'groups'] }, right: { list: ['gallery', 'prompts'] } }
|
||||
const mk = (l, r) => ({ left: { list: l, active: l[0] || '', open: true, w: 300, removed: [] }, right: { list: r, active: r[0] || '', open: true, w: 300, removed: [] } })
|
||||
|
||||
// 1) 同侧重复 → 去重(关掉默认回填,单独验证去重)
|
||||
let d = sanitize(mk(['prompts', 'prompts', 'groups'], ['gallery']), panels, noDefaults)
|
||||
assert.deepStrictEqual(d.left.list, ['prompts', 'groups'], '同侧应去重,实际 ' + JSON.stringify(d.left.list))
|
||||
|
||||
// 2) 同一 id 同时出现在两侧 → 只保留左侧
|
||||
d = sanitize(mk(['prompts'], ['gallery', 'prompts']), panels, noDefaults)
|
||||
assert.deepStrictEqual(d.right.list, ['gallery'], '右侧重复 id 应移除,实际 ' + JSON.stringify(d.right.list))
|
||||
assert.strictEqual(d.left.list.indexOf('prompts') >= 0, true, '左侧应保留')
|
||||
|
||||
// 3) 未注册的面板 → 保留 id(插件可能还没加载完),active 回退到可用面板
|
||||
d = sanitize(mk(['ghost', 'groups'], ['gallery']), panels, noDefaults)
|
||||
assert.deepStrictEqual(d.left.list, ['ghost', 'groups'], '未注册 id 应保留(等插件加载),实际 ' + JSON.stringify(d.left.list))
|
||||
assert.strictEqual(d.left.active, 'ghost', 'active 若仍在 list 中应保持(等插件加载)')
|
||||
|
||||
// 4) 默认回填:另一侧已有的不补;removed 里的不补
|
||||
d = sanitize({ left: { list: ['prompts'], active: 'prompts', removed: ['styles'] }, right: { list: ['gallery'], active: 'gallery', removed: [] } }, panels, defaults)
|
||||
assert.ok(d.left.list.indexOf('styles') < 0, 'removed 的 styles 不该被回填,实际 ' + JSON.stringify(d.left.list))
|
||||
assert.deepStrictEqual(d.left.list, ['prompts', 'groups'], '其余默认面板应回填,实际 ' + JSON.stringify(d.left.list))
|
||||
assert.ok(d.right.list.indexOf('prompts') < 0, '左侧已有的 prompts 不该回填到右侧,实际 ' + JSON.stringify(d.right.list))
|
||||
|
||||
// 5) 已干净的状态 → 原样返回(引用相等,避免无谓重渲染)
|
||||
const clean = mk(['prompts'], ['gallery'])
|
||||
assert.strictEqual(sanitize(clean, panels, noDefaults), clean, '干净状态应返回原对象')
|
||||
|
||||
console.log('ui-dock-sanitize checks passed(同侧去重 / 跨侧保留左侧 / 未注册剔除 / 默认回填规则 / 幂等)')
|
||||
@@ -0,0 +1,39 @@
|
||||
// 小地图与底部工具栏避让(v3.26.21):重叠时加 iwb-minimap-tight,腾出空间后移除
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const { JSDOM } = require('jsdom')
|
||||
|
||||
const dom = new JSDOM('<!doctype html><html><body><div class="iwb-toolbar-wrap"><div class="iwb-toolbar"></div></div><div class="iwb-minimap"></div></body></html>')
|
||||
const { window } = dom
|
||||
window.requestAnimationFrame = (fn) => setTimeout(() => fn(Date.now()), 0)
|
||||
window.cancelAnimationFrame = (id) => clearTimeout(id)
|
||||
|
||||
const bar = window.document.querySelector('.iwb-toolbar')
|
||||
const mm = window.document.querySelector('.iwb-minimap')
|
||||
let barRight = 900
|
||||
let mmLeft = 950
|
||||
bar.getBoundingClientRect = () => ({ left: 300, right: barRight, top: 800, bottom: 860, width: barRight - 300, height: 60 })
|
||||
mm.getBoundingClientRect = () => ({ left: mmLeft, right: mmLeft + 132, top: 800, bottom: 888, width: 132, height: 88 })
|
||||
|
||||
const src = fs.readFileSync(path.join(__dirname, '..', 'src', 'ui-minimap-fit.js'), 'utf8')
|
||||
new Function('window', src)(window)
|
||||
window.IWBMiniMapFit.install()
|
||||
|
||||
const wait = (ms) => new Promise((r) => setTimeout(r, ms))
|
||||
|
||||
async function check (label, expectTight) {
|
||||
window.dispatchEvent(new window.Event('resize'))
|
||||
await wait(30)
|
||||
const tight = mm.classList.contains('iwb-minimap-tight')
|
||||
assert.strictEqual(tight, expectTight, label + ':期望 tight=' + expectTight + ',实际 ' + tight)
|
||||
}
|
||||
|
||||
;(async () => {
|
||||
await check('间距充足(950 > 900+8)不应隐藏', false)
|
||||
mmLeft = 890
|
||||
await check('即将重叠(890 < 908)应隐藏', true)
|
||||
mmLeft = 1200
|
||||
await check('空间回来(1200 > 908)应恢复', false)
|
||||
console.log('ui-minimap-fit checks passed(不重叠显示 / 临界隐藏 / 回位恢复)')
|
||||
})()
|
||||
@@ -10,6 +10,8 @@ interface Window {
|
||||
// 桌面壳 / 外观(v3.25.14)
|
||||
IWBUIShell?: any
|
||||
IWBUIApearance?: any
|
||||
IWBThemeTokens?: any
|
||||
IWBUIModalDrag?: any
|
||||
// 存储
|
||||
IWBStorageLocal?: any
|
||||
IWBStorageRuntime?: any
|
||||
|
||||