Compare commits

...
18 Commits
Author SHA1 Message Date
qiqi 0d42ebb9ae style(dock): 选中态淡底 + 去掉下划线 v3.26.15
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m15s
2026-11-21 23:18:35 +08:00
qiqi a26fb2d64d style(dock): 提示词库/节点组底色与图库一致 v3.26.14 / promptlib 1.4.8
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m33s
2026-11-21 23:12:23 +08:00
qiqi 1d0b6d2168 fix(dock): 拖宽实时更新变量 + 默认面板跨侧去重 v3.26.13
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m38s
2026-11-21 23:07:51 +08:00
qiqi 202f7b81de fix(dock): 面板去重(同侧+跨侧),修重复注册残留 v3.26.12
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m52s
2026-11-21 23:01:17 +08:00
qiqi d16f3434dd fix(plugins): promptlib 1.4.7 恢复瀑布流列规则(回退后单列问题)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m33s
2026-11-21 22:52:54 +08:00
qiqi 9c0d3b1221 revert: 回退到 v3.26.5 插件行为(v3.26.10),promptlib 回退 1.4.0 内容
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 53s
2026-11-21 22:50:21 +08:00
qiqi 5f8f4d229f fix: CSP nonce 导致动态 style 全丢(插件样式失效)v3.26.9 / promptlib 1.4.5
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m52s
2026-11-21 22:43:41 +08:00
qiqi a3edc81f55 chore(plugins): promptlib 1.4.2 自带样式(不依赖宿主注入)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 52s
2026-11-21 22:21:13 +08:00
qiqi 774b980f69 feat: 市场缓存回退 + 启动层恢复 + 卡片键盘可达(v3.26.6 / promptlib 1.4.1)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m28s
2026-11-21 22:17:46 +08:00
qiqi a993d44f4e chore: 体检清理(死代码/截图/封面瘦身/测试)(v3.26.5 / promptlib 1.4.0)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m3s
2026-11-21 22:12:01 +08:00
qiqi a8a416fa7a fix(promptlib): 无封面方形占位 + 插件灰压深(v3.26.4 / 1.3.5)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m29s
2026-11-21 22:01:46 +08:00
qiqi 9db4c15e7a feat(promptlib): 瀑布流 + 插件统一灰(v3.26.3 / 1.3.4)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m52s
2026-11-21 21:56:10 +08:00
qiqi 2fb0a6941f feat(promptlib): 封面任意比例(上传/详情/插入)(v3.26.2 / 1.3.3)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m38s
2026-11-21 21:49:07 +08:00
qiqi 0b20c5597c feat(promptlib): 详情插入图片(封面参考图节点)(v3.26.1 / 1.3.2)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m33s
2026-11-21 21:42:30 +08:00
qiqi 9f69f73443 chore(plugins): promptlib 1.3.1 详情插入后自动关闭
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m39s
2026-11-21 21:34:00 +08:00
qiqi f8635d4e19 fix(promptlib): 封面改内联压缩图(3.26.0 / 1.3.0)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m33s
2026-11-21 21:26:16 +08:00
qiqi 8aac499e11 fix(promptlib): 封面即时同步 + 弹窗线框简化(v3.25.99 / 1.2.1)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m48s
2026-11-21 19:45:50 +08:00
qiqi 6ee5a37d68 feat(promptlib): 弹窗化详情/编辑(同宽可拖动可缩放)+ coverUrl 异步(v3.25.98)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m28s
2026-11-21 19:36:53 +08:00
44 changed files with 1006 additions and 238 deletions

No files matched your search

+4
View File
@@ -22,3 +22,7 @@ release/
# 插件市场产物(由 scripts/gen-market.js 生成,发布时 scp 上传)
market/
# 临时截图/调试产物(不入库)
_*.png
_tray-preview/
+123
View File
@@ -14,6 +14,129 @@
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
## 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)提示词封面能力(宿主侧)
### 新增
Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

+76 -2
View File
@@ -2413,10 +2413,68 @@
}
// v3.25.97:提示词封面(宿主图片库)—— 放在 Workbench 外,避免组件行数上涨
// v3.26.0:提示词封面 —— 直接存「压缩后的 dataURL」(≤512 WebP),随 prompts.json 落盘。
// 为什么不用引用({__blob}):封面是**跨会话必须可见**的小图,引用要依赖 IDB + 解析时序,
// 实测会出现“编辑里能看到、列表看不到/重启后丢失”。512px WebP 约 20~60KB,几十条完全可以接受。
async function wPromptCoverPut (dataUrl) {
try { const ref = await wImgRefWrite(String(dataUrl || '')); return ref ? { ok: true, ref: ref } : { ok: false, error: '封面保存失败' } } catch (e) { return { ok: false, error: '封面保存失败' } }
try {
const src = String(dataUrl || '')
if (src.indexOf('data:') !== 0) return { ok: false, error: '封面上传失败' }
const out = await new Promise((resolve) => {
try {
compressDataUrl(src, { enabled: true, force: true, maxMB: 0, maxEdge: 448, quality: 0.8, format: 'webp' }, (o) => resolve(o || ''))
} catch (e) { resolve('') }
})
const final = out || src
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: '' } }
}
function wPromptCoverUrl (ref) { try { return { ok: true, url: wImgSrcForNode(ref, 720) } } catch (e) { return { ok: false, url: '' } } }
// 一次性迁移(桌面版):把历史画布里内联的 dataURL 图转成 {__blob} 引用。
// 只在资料目录生效时跑,跑完打标记;之后保存画布本就会走同一规则。
async function wMigrateInlineImages() {
@@ -8175,6 +8233,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 || ''))
@@ -8870,6 +8939,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 -1
View File
@@ -1,7 +1,7 @@
# 现状架构与性能事实基线(image-workbench-web)
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 754c0a3`(线上 `v3.25.97+754c0a3` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--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 = a26fb2d`(线上 `v3.26.15+a26fb2d` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--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 迁出)
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.25.97",
"version": "3.26.15",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
+3 -3
View File
@@ -44,10 +44,10 @@
"dir": "promptlib",
"main": "main.js",
"style": "styles.css",
"version": "1.1.0",
"version": "1.4.8",
"files": {
"main.js": "d8ed74524383c5502787b8517958fa0e9645cc79fbdb71bc1c2fc1caa3342612",
"styles.css": "afbc6e2818e012fc9c53629bd315481c96d6807dae825a43da7efdf618000a05"
"main.js": "c42277852f9f315705e0cece510c124d703e35ef248641fcb9bddf47b8f199c8",
"styles.css": "cc71e071379c84131e525afeaa5757674f499da195ccb42536c019a3ef5d8473"
}
},
{
+274 -175
View File
@@ -66,8 +66,6 @@
var groups = []
var query = ''
var filter = 'all'
var expanded = {}
var view = { mode: 'list', id: '' } // v1.1.0:列表 / 详情两态
var coverCache = {}
var managerOpen = false
var modalHost = null
@@ -103,10 +101,39 @@
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
var big = prompts.filter(function (p) { return typeof p.cover === 'string' && p.cover.indexOf('data:') === 0 && p.cover.length > 60000 })
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) {
@@ -149,134 +176,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' })
// v1.1.0:封面(3:4,自动裁切;图片走宿主图片库,条目只存 ref)
var coverBox = el('div', { class: 'iwb-plp-editor-thumb' })
var coverRow = el('div', { class: 'iwb-plp-editor-cover' })
var paintCover = function () {
var url = draft.cover ? coverOf({ id: draft.id, cover: draft.cover, group: draft.group }) : ''
coverBox.textContent = ''
coverBox.style.background = url ? 'var(--iwb-plugin-inset)' : gradOf(draft)
if (url) coverBox.appendChild(el('img', { class: 'iwb-plp-cover', src: url, alt: '' }))
}
paintCover()
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: '删除封面' })
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) { draft.cover = r.ref; delete coverCache[draft.id]; render(); paintCover(); notify('封面已更新') }
else notify('封面上传失败', 'err')
}).catch(function () { notify('封面上传失败', 'err') })
}
rd.readAsDataURL(f)
})
delCover.addEventListener('click', function () { draft.cover = ''; delete coverCache[draft.id]; render(); paintCover() })
coverRow.appendChild(coverBox)
coverRow.appendChild(el('div', { class: 'iwb-plp-editor-coverops' },
el('div', { class: 'iwb-hint', text: '封面 3:4(自动裁切)' }),
el('div', { class: 'iwb-row' }, upBtn, delCover), fileIn))
bodyEl.appendChild(coverRow)
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(), 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({ 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,
cover: draft.cover || '',
}
}
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
@@ -410,7 +310,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
@@ -427,16 +327,23 @@
// ---- v1.1.0:封面 + 详情 ----
var coverPending = {}
function coverOf (p) {
if (!p || !p.cover) return ''
var hit = coverCache[p.id]
if (hit !== undefined) return hit
coverCache[p.id] = ''
try {
Promise.resolve(api.coverUrl(p.cover)).then(function (r) {
if (r && r.ok && r.url) { coverCache[p.id] = r.url; render() }
}).catch(function () { /* 宿主无封面能力时不显示封面 */ })
} catch (e) { /* ignore */ }
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) {
@@ -447,45 +354,237 @@
}
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() }
function renderDetail () {
var p = null
for (var i = 0; i < prompts.length; i++) if (prompts[i].id === view.id) { p = prompts[i]; break }
if (!p) { view.mode = 'list'; return }
var url = coverOf(p)
var thumb = el('div', { class: 'iwb-plp-dthumb' })
thumb.style.background = url ? 'var(--iwb-plugin-inset)' : gradOf(p)
if (url) thumb.appendChild(el('img', { class: 'iwb-plp-cover', src: url, alt: '' }))
var meta = el('div', { class: 'iwb-plp-dmeta' },
el('div', { class: 'iwb-plp-dtitle', text: p.name || '未命名' }),
el('div', { class: 'iwb-hint', text: [p.group || '未分组'].concat(p.tags || []).join(' · ') + ' · ' + String(p.text || '').length + ' 字' }))
var textEl = el('div', { class: 'iwb-plp-dtext' })
textEl.appendChild(document.createTextNode(p.text || ''))
var head = el('div', { class: 'iwb-plp-dhead' })
var back = el('button', { class: 'iwb-btn iwb-btn-sm', text: '‹ 返回' })
back.addEventListener('click', backToList)
var edit = el('button', { class: 'iwb-btn iwb-btn-sm', text: '编辑' })
edit.addEventListener('click', function () { openEditor(p) })
head.appendChild(back); head.appendChild(el('span', { class: 'iwb-drawer-spacer' })); head.appendChild(edit)
var foot = el('div', { class: 'iwb-plp-dfoot' })
var ins = el('button', { class: 'iwb-btn iwb-btn-sm', text: '插入画布' })
ins.addEventListener('click', function () { Promise.resolve(api.insert(p.text || '', p.name || '')).then(function () { notify('已插入画布:' + (p.name || '提示词')) }).catch(function () { notify('插入画布失败', 'err') }) })
var cp = el('button', { class: 'iwb-btn iwb-btn-sm', text: '复制全文' })
cp.addEventListener('click', function () { Promise.resolve(api.copy(p.text || '')).then(function (r) { if (r && r.ok === false) notify('复制失败', 'err'); else notify('已复制全文') }) })
var del = el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-danger', text: '删除' })
del.addEventListener('click', function () {
ask('删除提示词「' + (p.name || '未命名') + '」?', { title: '删除提示词', okText: '删除' }).then(function (ok) {
if (!ok) return
backToList()
save(prompts.filter(function (x) { return x.id !== p.id })).then(function () { notify('已删除') })
})
// ===== 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)
})
foot.appendChild(ins); foot.appendChild(cp); foot.appendChild(el('span', { class: 'iwb-drawer-spacer' })); foot.appendChild(del)
scrollBox.appendChild(head); scrollBox.appendChild(el('div', { class: 'iwb-row iwb-plp-dtop' }, thumb, meta)); scrollBox.appendChild(textEl); scrollBox.appendChild(foot)
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)
if (view.mode === 'detail') { renderDetail(); return }
var gs = groupsOf()
// 搜索行
@@ -493,7 +592,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)
@@ -581,7 +680,7 @@
e.dataTransfer.effectAllowed = 'copy'
} catch (err) { /* ignore */ }
})
card.addEventListener('click', function (e) { e.stopPropagation(); openDetail(p.id) })
card.addEventListener('click', function (e) { e.stopPropagation(); openDetailModal(p) })
card.addEventListener('contextmenu', function (e) { openMenu(e, p) })
cards.appendChild(card)
})
@@ -616,7 +715,7 @@
global.IWBPluginHost.register({
id: 'promptlib',
name: '提示词库',
version: '1.1.0',
version: '1.4.8',
apiVersion: 1,
capabilities: ['panels', 'promptlib'],
data: { schemaVersion: 1, maxBytes: 65536 },
+3 -3
View File
@@ -1,7 +1,7 @@
{
"id": "promptlib",
"name": "提示词库",
"version": "1.1.0",
"version": "1.4.8",
"apiVersion": 1,
"main": "main.js",
"style": "styles.css",
@@ -13,7 +13,7 @@
"提示词"
],
"files": {
"main.js": "d8ed74524383c5502787b8517958fa0e9645cc79fbdb71bc1c2fc1caa3342612",
"styles.css": "afbc6e2818e012fc9c53629bd315481c96d6807dae825a43da7efdf618000a05"
"main.js": "c42277852f9f315705e0cece510c124d703e35ef248641fcb9bddf47b8f199c8",
"styles.css": "cc71e071379c84131e525afeaa5757674f499da195ccb42536c019a3ef5d8473"
}
}
+79 -6
View File
@@ -17,8 +17,6 @@
/* v1.0.2(2026-11-21):卡片化 —— 白卡 + 悬停 + 文本三行截断。
颜色一律走宿主 --iwb-plugin-* / --iwb-* token,不在插件里写死。 */
.iwb-promptlib .iwb-pcard { transition: background .12s ease, border-color .12s ease; }
.iwb-promptlib .iwb-pcard:hover { border-color: var(--iwb-border2, #b9bfca); }
.iwb-promptlib .iwb-pname { font-weight: 600; }
.iwb-promptlib .iwb-ptext {
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
@@ -28,10 +26,6 @@
/* v1.1.0(2026-11-21):封面网格 + 长文详情 + 宽编辑弹窗。
颜色全部走宿主 token,不写死。 */
.iwb-promptlib .iwb-lib-cards {
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
}
.iwb-plp-card {
position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
aspect-ratio: 1 / 1; border: 1px solid var(--iwb-border, #d5d9e0);
@@ -64,3 +58,82 @@
.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; }
+56 -4
View File
@@ -54,13 +54,13 @@
<h2>下载</h2>
<div class="row">
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
<div class="meta">版本 3.25.97 · 8.4 MB · .dmg<div class="hash">sha256 d2be87a7f7160978…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.97_aarch64.dmg?h=d2be87a7f716">下载</a>
<div class="meta">版本 3.26.15 · 8.4 MB · .dmg<div class="hash">sha256 2e1e9e31e186194d…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.15_aarch64.dmg?h=2e1e9e31e186">下载</a>
</div>
<div class="row">
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
<div class="meta">版本 3.25.97 · 8.8 MB · .dmg<div class="hash">sha256 745681f7c188962a…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.97_x64.dmg?h=745681f7c188">下载</a>
<div class="meta">版本 3.26.15 · 8.8 MB · .dmg<div class="hash">sha256 b9263c7a72b27d0e…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.15_x64.dmg?h=b9263c7a72b2">下载</a>
</div>
<div class="row">
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
@@ -94,6 +94,58 @@
</ol>
<h2>历史版本</h2>
<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>
+8 -8
View File
@@ -2,7 +2,7 @@
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Image Workbench · 本地优先的 AI 生图工作台</title>
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
<link rel="stylesheet" href="/assets/style.css?v=3.25.97-mwqb8zfg">
<link rel="stylesheet" href="/assets/style.css?v=3.26.15-mwqjz34l">
</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.97</a>
<a class="btn primary" href="/download/">下载 v3.26.15</a>
</div>
</div></nav>
<main>
<section class="hero hero-art">
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.97-mwqb8zfg" alt=""></div>
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.15-mwqjz34l" alt=""></div>
<div class="hero-veil"></div>
<div class="wrap">
<span class="kicker">v3.25.97 · macOS / Windows · 数据在本地</span>
<span class="kicker">v3.26.15 · macOS / Windows · 数据在本地</span>
<h1>本地优先的<br>AI 生图无限画布</h1>
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
<div class="cta">
<a class="btn primary lg" href="/download/">下载 v3.25.97</a>
<a class="btn primary lg" href="/download/">下载 v3.26.15</a>
<a class="btn lg" href="/plugins/">浏览 11 个插件</a>
</div>
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
@@ -82,7 +82,7 @@
</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.1.0 · 官方</div></div></div>
<div><div class="nm">提示词库</div><div class="ver">v1.4.8 · 官方</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.97_aarch64.dmg?h=d2be87a7f716"><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.97_x64.dmg?h=745681f7c188"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.15_aarch64.dmg?h=2e1e9e31e186"><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.15_x64.dmg?h=b9263c7a72b2"><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>
+10 -10
View File
@@ -1,6 +1,6 @@
{
"version": 2,
"updatedAt": "2026-11-21T11:09:11.605Z",
"updatedAt": "2026-11-21T15:08:57.838Z",
"plugins": [
{
"id": "batch-export",
@@ -180,26 +180,26 @@
"资源",
"提示词"
],
"version": "1.1.0",
"version": "1.4.8",
"apiVersion": 1,
"bundle": "plugins/promptlib-1.1.0.zip",
"bundleSize": 38687,
"bundleSha256": "16b35077c9af0af9405b79ed319bd295671671ab55372429f2a61bf7da4beea4",
"bundle": "plugins/promptlib-1.4.8.zip",
"bundleSize": 49338,
"bundleSha256": "d51f2f00b66c4eb5f6304a447ba927f467d8acced909ea37daff645f0805aa8c",
"files": [
{
"path": "manifest.json",
"sha256": "0f5d7b34a17353af802b79b6cdf97b768cf3d60ff3e301a1f4bcb5eadcdcc66f",
"sha256": "a90ecd8985ccb5b7ce7c4829ce4b8eca39b0cc3f8e611d7e8d66ae039787d822",
"size": 540
},
{
"path": "main.js",
"sha256": "d8ed74524383c5502787b8517958fa0e9645cc79fbdb71bc1c2fc1caa3342612",
"size": 34029
"sha256": "c42277852f9f315705e0cece510c124d703e35ef248641fcb9bddf47b8f199c8",
"size": 38964
},
{
"path": "styles.css",
"sha256": "afbc6e2818e012fc9c53629bd315481c96d6807dae825a43da7efdf618000a05",
"size": 3808
"sha256": "cc71e071379c84131e525afeaa5757674f499da195ccb42536c019a3ef5d8473",
"size": 9524
}
]
},
+3 -3
View File
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>插件市场 · Image Workbench</title>
<link rel="stylesheet" href="/assets/style.css?v=3.25.97-mwqb8zfg">
<link rel="stylesheet" href="/assets/style.css?v=3.26.15-mwqjz34l">
</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.97</a>
<a class="btn primary" href="/download/">下载 v3.26.15</a>
</div>
</div></nav>
<main>
@@ -76,7 +76,7 @@
</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.1.0 · 官方</div></div></div>
<div><div class="nm">提示词库</div><div class="ver">v1.4.8 · 官方</div></div></div>
<div class="desc">右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)</div>
<div class="tags"><span class="tag">资源</span><span class="tag">提示词</span></div>
</div>
+274 -1
View File
@@ -1,8 +1,281 @@
{
"app": "Image Workbench",
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
"updatedAt": "2026-11-21T11:14:20.281Z",
"updatedAt": "2026-11-21T15:18:35.042Z",
"releases": [
{
"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",
+1 -1
View File
@@ -1983,7 +1983,7 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.25.97"
version = "3.26.15"
dependencies = [
"arboard",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.25.97"
version = "3.26.15"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.25.97",
"version": "3.26.15",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
+2
View File
@@ -5,6 +5,7 @@
* save({prompts, groups}) → 落盘(宿主仍持有数据:iwb_web_prompts + 分组缓存)
* insert(text, name) → 在画布视口中心插入提示词节点(插件不碰画布状态)
* copy(text) → 走宿主剪贴板(失败有可见提示)
* insertImage(cover, name) → 把封面作为参考图节点插入画布
* notify(text, type) → 宿主 toast / 提示条
* putCover(dataUrl) → 封面入宿主图片库(返回 ref)
* coverUrl(ref) → 封面展示地址
@@ -43,6 +44,7 @@
save: call('save'),
insert: call('insert'),
copy: call('copy'),
insertImage: call('insertImage'),
notify: call('notify'),
putCover: call('putCover'),
coverUrl: call('coverUrl'),
+21 -2
View File
@@ -129,7 +129,14 @@
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) }
@@ -152,10 +159,13 @@
// 只有「用户手动拖出栏」的(记在 removed 里)不补,尊重手动排序/移除。
const removed = Array.isArray(s0.removed) ? s0.removed : []
const defList = (props.defaults && props.defaults[side] && props.defaults[side].list) || []
let list = (s0.list || []).filter(function (id) { return !!panels[id] })
// v3.26.12:老数据里可能存了重复面板 id(同一插件重复注册的历史残留)→ 去重
let list = (s0.list || []).filter(function (id) { return !!panels[id] }).filter(function (id, i, arr) { return arr.indexOf(id) === i })
for (const id of defList) {
if (!panels[id]) continue
if (removed.indexOf(id) >= 0) continue
const other = side === 'left' ? 'right' : 'left'
if ((d[other] && d[other].list || []).indexOf(id) >= 0) continue
if (list.indexOf(id) >= 0) continue
list = list.concat([id])
}
@@ -230,9 +240,18 @@
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
+8 -9
View File
@@ -38,10 +38,10 @@
--iwb-plugin-text: var(--iwb-text);
--iwb-plugin-text2: var(--iwb-text2);
/* 插件面板四层(v3.25.96):只提供取值,不做任何变量重指(3.25.89 的事故不再重演) */
--iwb-plugin-surface: #fafafb;
--iwb-plugin-surface: #eceff2;
--iwb-plugin-card: #ffffff;
--iwb-plugin-inset: #f5f6f7;
--iwb-plugin-hover: #eef1f4;
--iwb-plugin-inset: #e3e7ea;
--iwb-plugin-hover: #dde2e6;
--iwb-plugin-brand: var(--iwb-brand);
--iwb-plugin-on-brand: var(--iwb-on-brand);
--iwb-plugin-err: var(--iwb-err);
@@ -2197,11 +2197,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
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);
}
/* v3.26.15:选中态更克制 —— 只提亮图标 + 极淡底,不再用实心白块和下划线 */
.iwb-dock-btn.on { background: color-mix(in srgb, var(--iwb-text) 7%, transparent); color: var(--iwb-text); }
.iwb-dock-btn.on:hover { background: color-mix(in srgb, var(--iwb-text) 11%, 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; }
@@ -2368,8 +2366,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* ── 库面板(提示词库 / 节点组)视觉层(v3.25.96)────────────────────────────
只作用于这两个面板容器(.iwb-dock-body[data-panel=...]),其他插件零影响:
面板浅灰底;提示词库白卡、节点组灰卡(用户裁定:节点组不要白卡)。 */
/* v3.26.14:提示词库 / 节点组 与图库一致 —— 不额外铺底色(透明,直接显示停靠栏底) */
.iwb-dock-body[data-panel="prompts"],
.iwb-dock-body[data-panel="groups"] { background: var(--iwb-plugin-surface); }
.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); }
+55 -5
View File
@@ -96,12 +96,13 @@ const wait = (ms) => new Promise((r) => setTimeout(r, ms))
// v1.1.0:单击卡片 → 详情(只读),再点「编辑」→ 浮层
card.dispatchEvent(new window.MouseEvent('click', { bubbles: true }))
await wait(40)
assert.ok(host.querySelector('.iwb-plp-dtext'), '单击卡片应进入详情页(长文区)')
const editBtn = Array.from(host.querySelectorAll('.iwb-plp-dhead button')).find((b) => b.textContent === '编辑')
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-promptlib-editor')
const editor = window.document.querySelector('.iwb-plp-dialog-edit')
assert.ok(editor, '单击卡片应打开编辑浮层')
const nameIn = editor.querySelector('input.iwb-input')
nameIn.value = '小红书封面(改)'
@@ -111,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-plp-dfoot button')).find((b) => b.textContent === '插入画布')
// 再点一次卡片 → 详情弹窗 → 底部「插入画布」
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) })
+2 -2
View File
@@ -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 = 9025 // 2026-11-21 v3.25.82:停靠栏面板按插件启用过滤(装配留在 app.js)
const MAX_APP_JS_LINES = 9085 // 2026-11-21 v3.26.2:封面比例探测/节点宽度映射(模块级 helper)
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