Compare commits

..
14 Commits
Author SHA1 Message Date
qiqi 26c5ecff7b docs(site): v3.26.63
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m40s
2026-11-24 21:30:22 +08:00
qiqi 1d571623b0 docs: 锚点对齐 v3.26.63+06e27af(publish 自动) 2026-11-24 21:27:52 +08:00
qiqi 06e27afa1d release: v3.26.63 规则统一 P0 2026-11-24 21:26:20 +08:00
qiqi f520e1a0fd refactor(rules): P0 统一 —— 确认包装 7 份收为 1 份、剪贴板 5 处走门面、棘轮硬数字进 sync-facts + 守卫 2026-11-24 21:26:16 +08:00
qiqi 2a892bce93 docs(site): v3.26.62
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m48s
2026-11-24 20:46:29 +08:00
qiqi 68a9f636ed docs: 锚点对齐 v3.26.62+433b62a(publish 自动) 2026-11-24 20:44:42 +08:00
qiqi 433b62a500 release: v3.26.62 设计 token 收口 2026-11-24 20:41:05 +08:00
qiqi eb1073c175 feat(tokens): A 收紧 + B 补类 + C 收口(状态层/边框/图标/透明度/动效 token,L3 进单一源 + 三方一致性测试) 2026-11-24 20:41:05 +08:00
qiqi 5dd4dd0a74 chore(plugins): 内置 promptlib 同步 1.13.0(正文 {} 里放内容原文、名宽 4 字、内容框 10 行)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 55s
2026-11-24 18:52:56 +08:00
qiqi 5cfda44b46 chore(plugins): 内置 promptlib 同步 1.12.3(变量三字段 + 节点默认空、内容兜底)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m4s
2026-11-24 18:32:33 +08:00
qiqi 7035d8fad2 chore(plugins): 内置 promptlib 同步 1.12.2(搜索框常驻修中文输入 + 变量标签定宽 6 字)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 53s
2026-11-24 18:16:47 +08:00
qiqi 6291d51bcc docs(site): v3.26.61 补 Windows x64 记录
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m20s
2026-11-24 18:08:02 +08:00
qiqi 348bf56c3f chore(plugins): 内置 promptlib 同步 1.12.0(变量四字段 + 节点多行变量框)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 44s
2026-11-24 18:01:13 +08:00
qiqi 205cb81ca9 release: v3.26.61 下载站记录 + 站点页面(双架构 dmg 已上线)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 55s
2026-11-24 17:26:47 +08:00
37 changed files with 1114 additions and 347 deletions

No files matched your search

+40
View File
@@ -16,6 +16,46 @@
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
## v3.26.63(2026-11-24)规则统一 P0:确认入口 / 剪贴板门面 / 文档硬数字守卫
> 状态:代码完成(macOS 双架构待发;Windows 待构建)
**① 确认入口收成 1 份**
- 同一个 5 行 `askConfirm`/`wConfirm` 包装此前复制 **7 份**(app.js + 6 个 src),两种写法;现全部删除,统一调 `IWBUIConfirm.askOrNative`(`src/ui-confirm.js` 唯一实现)
- `window.confirm` 现在只存在于 `src/ui-confirm.js`(网页端行为不变:非 Tauri 仍走原生)
- `src/ui-backup-modal.js` 里「是否有原生 confirm」的判断改为判断门面是否存在
**② 文档硬数字纳入自动校验**
- 新增 `scripts/ratchet-metrics.js`:唯一测量实现(app.js 行数 / Workbench 行数 / src 模块数与行数 / 占比)+ 文档改写规则
- `scripts/sync-facts.js` 新增一步:自动改写 `CONTRIBUTING.md` 与 `docs/standards/architecture-current-state.md` 里的 4 类数字
- `tests/architecture-facts-guard-test.js` 新增 6b:文档数字与代码不一致即红
- **首次运行就修正了 6 处长期漂移**:CONTRIBUTING 的 `MAX_APP_JS_LINES` 写 8,700(真实 9,115,差 415 行)、架构文档 6 项(9,112 行 / 29.9% / Workbench 3,045 / 上限 3,046 / src 21,334 行等)
**③ 剪贴板统一走门面**
- 5 处绕过 `IWBClipboardCopy` 的直连改走门面:诊断页复制、设置页「复制诊断」(原先自带一份 textarea 兜底 = 真重复)、节点 Markdown 编辑器复制、插件 copy 能力、结果图复制链接
- `navigator.clipboard.writeText` 现在只存在于门面自身
**棘轮**:`MAX_APP_JS_LINES` 9115 → **9,105**(实测 9,104,删掉的 8 行不留给下次随便涨)
## v3.26.62(2026-11-24)设计 token 收口:补类别 + L3 进单一源 + 三方一致性守卫
> 状态:代码完成(macOS 双架构已发;Windows 待构建)
**A 收紧**
- 棘轮基线下调到实测(字号写死 159→120、圆角 95→74、间距 377→353,字号取值种数 13→12、圆角 17→14)
- 新 token:`--iwb-font-2xs(10px)`、`--iwb-bw / -strong`、`--iwb-icon-sm/md/lg`、`--iwb-opacity-disabled/muted`、`--iwb-ease-out/in-out`、`--iwb-motion-fast/base/slow`
- 承认 10px:29 处裸写归入 `2xs`,并写死「不得用于可读正文」
**B 补类**
- 状态层 6 个:`--iwb-err/ok/warn` 的 `-bg` / `-bd`,由 derive() 派生(亮浅底+深字 / 暗深底+亮字),替换样式里 16 处内联 color-mix
- `tokens.json` 从「跳过关系式」变为 0 跳过:补齐 27 个此前缺失项(插件别名、focus-ring、hr、edge-dash、grid-on、anim*、chrome/home/dock 等)
- 动效 token 落地(旧文档的 `--iwb-dur-*` / `--iwb-ease-standard` 从未存在,已更正)
**C 收口**
- L3 组件 token(`--iwb-set-*` 18 个 + `--iwb-pop-*` 11 个)从 style.css 手写改为 `COMPONENT_SCOPED` 单一源,生成进 design-tokens.css;style.css 只留布局属性
- 新增 `tests/design-tokens-component-doc-test.js`:文档表格 ↔ tokens.json ↔ 生成产物三方双向断言(29 项),并禁止 style.css 再声明
- 顺带修正解析器缺陷:`.theme-dark .iwb-pop {…}` 会被当成整块暗色主题,覆盖真正的暗色值
## v3.26.61(2026-11-24)图库:出图即见 + 插入落地本地副本(能标注)
> 状态:代码完成(宿主 + gallery 1.7.0)
+3 -3
View File
@@ -40,7 +40,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 125 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
test:unit 126 个单测文件(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)
@@ -102,8 +102,8 @@ IWB_WRITE_BOUNDARY_SNAPSHOT=1 node tests/architecture-boundary-guard-test.js #
| 守卫 | 位置 | 现在的上限 |
|---|---|---|
| `app.js` 总行数 | `tests/source-text-ratchet-test.js` `MAX_APP_JS_LINES` | **8,700**(另守「占总源码 ≤ 40%」,见 `MAX_APP_JS_SHARE`) |
| `Workbench()` 行数 | 同上 `MAX_WORKBENCH_LINES` | **3,997** |
| `app.js` 总行数 | `tests/source-text-ratchet-test.js` `MAX_APP_JS_LINES` | **9,105**(另守「占总源码 ≤ 40%」,见 `MAX_APP_JS_SHARE`) |
| `Workbench()` 行数 | 同上 `MAX_WORKBENCH_LINES` | **3,046** |
| 单组件行数(不含 Workbench)| 同上 `MAX_APP_COMPONENT_LINES` | **423** |
三条都是**只减不增**。确需在 app.js 增长时,必须**同步上调上限并在 commit 里写理由**(等于显式记账,不会悄悄发生)。
+11 -18
View File
@@ -125,12 +125,6 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
}
// 把桌面端能力登记到 src/desktop-bridge.js(src 不得反向引用 app.js 的 window 全局,
// architecture-boundary-guard 会红;这里只做注入,设置面板/导出逻辑统一走 IWBDesktop)
// 桌面端统一确认入口:页内确认(window.confirm 会阻塞 WKWebView 主线程);网页端保持原生
function wConfirm (text, opts) {
const C = (typeof window !== 'undefined') ? window.IWBUIConfirm : null
if (C && typeof C.askOrNative === 'function') return C.askOrNative(text, opts)
return Promise.resolve(window.confirm(String(text)))
}
// 桌面壳适配(外链 / 原生通知 / 链接拦截)落在 src/ui-desktop-shell.js
try { if (window.IWBUIShell) window.IWBUIShell.installLinkGuard(wIsTauri) } catch (e) { /* ignore */ }
@@ -4777,7 +4771,7 @@ const tbCenterSeed = (type, refs) => {
el('div', { className: 'iwb-crash-actions' },
el('button', { className: 'iwb-btn iwb-btn-primary', onClick: this.retry }, '尝试恢复'),
el('button', { className: 'iwb-btn', onClick: () => { try { location.reload() } catch (e) { /* ignore */ } } }, '重新加载页面'),
el('button', { className: 'iwb-btn', title: '复制错误记录与内存采样(不含 Key、提示词和图片)', onClick: (ev) => { let t = '{}'; try { const rep = CrashLog ? CrashLog.report({ version: APP_VERSION }) : {}; try { rep.storageSelfCheck = wStorageSelfCheck() } catch (e) { rep.storageSelfCheck = { error: String((e && e.message) || e) } } t = JSON.stringify(rep, null, 2) } catch (e) { /* ignore */ } const cp = (typeof window !== 'undefined' && window.IWBClipboardCopy) || null; if (cp) cp.copyWithButton(t, ev && ev.currentTarget); else { try { navigator.clipboard.writeText(t) } catch (e) { /* ignore */ } } } }, '复制诊断信息'),
el('button', { className: 'iwb-btn', title: '复制错误记录与内存采样(不含 Key、提示词和图片)', onClick: (ev) => { let t = '{}'; try { const rep = CrashLog ? CrashLog.report({ version: APP_VERSION }) : {}; try { rep.storageSelfCheck = wStorageSelfCheck() } catch (e) { rep.storageSelfCheck = { error: String((e && e.message) || e) } } t = JSON.stringify(rep, null, 2) } catch (e) { /* ignore */ } const cp = (typeof window !== 'undefined' && window.IWBClipboardCopy) || null; if (cp) cp.copyWithButton(t, ev && ev.currentTarget) } }, '复制诊断信息'),
),
el('div', { className: 'iwb-hint' }, '完整记录在「设置 → 诊断」里,可导出 JSON'),
),
@@ -5990,7 +5984,7 @@ const tbCenterSeed = (type, refs) => {
const sess = sessionsStore.get(wsId)
const nm = (((refs.workspaces || workspaces).find((w) => w.id === wsId)) || {}).name || '未命名画布'
if (sess && sess.dirty) { // S13:有未保存修改 → 确认后先保存再关
if (!(await wConfirm('「' + nm + '」有未保存修改,关闭前将先保存。确定关闭?', { title: '关闭画布', okText: '关闭并保存' }))) return
if (!(await window.IWBUIConfirm.askOrNative('「' + nm + '」有未保存修改,关闭前将先保存。确定关闭?', { title: '关闭画布', okText: '关闭并保存' }))) return
try {
const list = (refs.workspaces || workspaces).map((w) => (w.id === wsId ? { ...w, nodes: sess.nodes, edges: sess.edges, groups: sess.groups, lastUsed: Date.now() } : w))
refs.workspaces = list; setWorkspaces(list); persistWs(list, activeWsId); sess.dirty = false
@@ -7637,8 +7631,8 @@ const tbCenterSeed = (type, refs) => {
const convertCanvasLocalRefs = async () => {
const targets = refs.nodes.filter((n) => n.type === 'ref' && n.data && n.data.data && !n.data.url)
if (!targets.length) { setNotice({ type: 'ok', text: '当前画布没有需要转换的本地图片' }); return }
if (!(await wConfirm('将转换当前画布中的 ' + targets.length + ' 张本地图片(输出节点生成结果不会处理),继续吗?', { title: '批量转在线链接' }))) return
if (!(await wConfirm('确认开始批量上传吗?上传后这些图片会替换为在线链接,通常无法自动撤回。', { title: '确认上传', okText: '开始上传' }))) return
if (!(await window.IWBUIConfirm.askOrNative('将转换当前画布中的 ' + targets.length + ' 张本地图片(输出节点生成结果不会处理),继续吗?', { title: '批量转在线链接' }))) return
if (!(await window.IWBUIConfirm.askOrNative('确认开始批量上传吗?上传后这些图片会替换为在线链接,通常无法自动撤回。', { title: '确认上传', okText: '开始上传' }))) return
let ok = 0; const errors = []
for (const n of targets) {
try {
@@ -8255,11 +8249,10 @@ const tbCenterSeed = (type, refs) => {
},
}, cover, name),
copy: (text) => {
try {
const p = navigator.clipboard && navigator.clipboard.writeText(String(text || ''))
if (p && typeof p.then === 'function') return p.then(() => ({ ok: true })).catch(() => ({ ok: false, error: '浏览器拒绝了剪贴板写入(需窗口有焦点)' }))
return { ok: false, error: '剪贴板不可用' }
} catch (e) { return { ok: false, error: '剪贴板不可用' } }
// 统一走 IWBClipboardCopy(2026-11-24):插件拿到的失败原因由门面归一
const C = (typeof window !== 'undefined') ? window.IWBClipboardCopy : null
if (!C || typeof C.copyText !== 'function') return { ok: false, error: '剪贴板不可用' }
return C.copyText(String(text || '')).then((ok) => ok ? { ok: true } : { ok: false, error: '浏览器拒绝了剪贴板写入(需窗口有焦点)' })
},
notify: (text, type) => { setNotice({ type: type === 'err' ? 'err' : 'ok', text: String(text || '') }); showToast(String(text || ''), type) }, paste: () => window.IWBDesktopHelpers.clipboardReadText(),
// v3.25.97:提示词封面 —— 图片走宿主内容寻址存储(images/plugin/prompt/),条目只存 ref。
@@ -8357,8 +8350,8 @@ const tbCenterSeed = (type, refs) => {
el('div', { className: 'iwb-home-actions' },
el('button', { className: 'iwb-btn' + (homeManage ? ' iwb-btn-primary' : ''), onClick: () => { setHomeManage((v) => !v); if (homeManage) setHomeSelectedWs([]) } }, homeManage ? '退出批量' : '批量管理'),
el('button', { className: 'iwb-btn', disabled: !homeSelectedWs.length, onClick: () => { const old = activeWsId; Promise.all(homeSelectedWs.map((id) => hydrateBoardInto(id))).then(() => { homeSelectedWs.forEach((id) => { setActiveWsId(id); loadWsInto(workspaces.find((w) => w.id === id), true); exportCanvas(); setActiveWsId(old) }) }).catch((e) => { setActiveWsId(old); setNotice({ type: 'err', text: '导出选中失败:' + ((e && e.message) || e) }) }) } }, I('download'), '导出选中'),
homeView === 'trash' ? el('button', { className: 'iwb-btn', onClick: async () => { if (!(await wConfirm('确定清空回收站?将彻底删除回收站中的全部画布。', { title: '清空回收站', okText: '清空' }))) return; emptyTrash() } }, I('trash'), '清空回收站') : null,
homeSelectedWs.length ? el('button', { className: 'iwb-btn', onClick: async () => { if (!(await wConfirm(homeView === 'trash' ? '确定彻底删除选中的画布?此操作不可恢复。' : '确定删除选中的画布?(移入回收站)', { title: '删除画布', okText: '删除' }))) return; homeSelectedWs.forEach((id) => (homeView === 'trash' ? purgeWs(id) : trashWs(id))); setHomeSelectedWs([]) } }, I('trash'), '删除选中') : null,
homeView === 'trash' ? el('button', { className: 'iwb-btn', onClick: async () => { if (!(await window.IWBUIConfirm.askOrNative('确定清空回收站?将彻底删除回收站中的全部画布。', { title: '清空回收站', okText: '清空' }))) return; emptyTrash() } }, I('trash'), '清空回收站') : null,
homeSelectedWs.length ? el('button', { className: 'iwb-btn', onClick: async () => { if (!(await window.IWBUIConfirm.askOrNative(homeView === 'trash' ? '确定彻底删除选中的画布?此操作不可恢复。' : '确定删除选中的画布?(移入回收站)', { title: '删除画布', okText: '删除' }))) return; homeSelectedWs.forEach((id) => (homeView === 'trash' ? purgeWs(id) : trashWs(id))); setHomeSelectedWs([]) } }, I('trash'), '删除选中') : null,
homeSelectedWs.length ? el('button', { className: 'iwb-btn', onClick: () => setCatPick({ mode: 'batch' }) }, I('tag'), '批量分类') : null,
catPick && catPick.mode === 'batch' ? el('select', { className: 'iwb-home-cat-select', value: '', onChange: (e) => { const v = e.target.value; if (v === '__new') { td.open({ title: '新建分类', placeholder: '新分类名称', onSubmit: (nm) => batchAssignCategory(homeSelectedWs, nm) }) } else batchAssignCategory(homeSelectedWs, v); setCatPick(null); setHomeSelectedWs([]) } }, el('option', { value: '' }, '选择分类…'), wsCategories.map((c) => el('option', { key: c, value: c }, c)), el('option', { value: '__new' }, '+ 新建分类…')) : null,
el('label', { className: 'iwb-btn' }, el('input', { type: 'file', accept: '.json,application/json', style: { display: 'none' }, onChange: (e) => { importCanvasFile(e.target.files && e.target.files[0]); e.target.value = '' } }), I('download'), '导入画布'),
@@ -8382,7 +8375,7 @@ const tbCenterSeed = (type, refs) => {
homeView === 'trash'
? [
el('button', { title: '恢复画布', onClick: (e) => { e.stopPropagation(); restoreWs(w.id) } }, I('refresh')),
el('button', { title: '彻底删除', onClick: async (e) => { e.stopPropagation(); if (!(await wConfirm('确定彻底删除画布「' + (w.name || '未命名画布') + '」?此操作不可恢复。', { title: '彻底删除', okText: '删除' }))) return; purgeWs(w.id) } }, I('trash')),
el('button', { title: '彻底删除', onClick: async (e) => { e.stopPropagation(); if (!(await window.IWBUIConfirm.askOrNative('确定彻底删除画布「' + (w.name || '未命名画布') + '」?此操作不可恢复。', { title: '彻底删除', okText: '删除' }))) return; purgeWs(w.id) } }, I('trash')),
]
: [
el('button', { title: '创建副本', onClick: (e) => { e.stopPropagation(); duplicateWs(w.id) } }, I('copy')),
+2 -2
View File
@@ -1,7 +1,7 @@
# 现状架构与性能事实基线(桌面版)
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 9b78535`(线上 `v3.26.61+9b78535` —— 2026-11-24 **图库:出图即入图库 + 插入落本地副本(能标注)**:每张生成完成即归档并通知插件(此前只在整轮结束写一次 ⇒ 生成中图库一直空)、插入取源改本地字节优先并引用化(抓不到才留原链接 + 提示)、`getNodeImage` 补 `data.localRef` 候选(远程缓存命中却仍判「不支持标注」的直接成因)、批量插入改 4 列栅格(旧实现同批全叠一处),逻辑落 `src/gallery-sync.js`,app.js 只装配;上一条 `v3.26.60+cf0e9a0` —— **浮层字号上调一档**:「模型设置」「图像设置」选择项 11→13px、高 22→28、左右内距 6→10、间距 4→6、标题 12→14、面板 328→360,改动全落在 `.iwb-pop` 的 6 个 token(两面板共用一套);上一条 `v3.26.59+e966b34` —— 备份新增 `plugin-files/` 通道,提示词封面换机不再丢;再上一条 2026-11-23 **节点正文文本区修复**:提示词/文本节点正文透明继承卡片底色(白卡片消失)、编辑态三层框(控件 border / 聚焦光晕 / D8 焦点环)全去掉,规范补表面角色三分法与 `node-scope-test` 第 5 条守卫,8 张基线重录;上一条 `v3.26.51+21554b0` —— **M6 延展验证**:插件面板两段六次叠加样式合并重写、133 行新增零裸值;补 `--iwb-font-base`(14px) 第 8 档与亮色状态色调深(对浅页面 2.13 → ≥4.6),对比度守卫 114→138 对;新增 ⑦⑧ 组件夹具基线共 16 张;`batch-export` 1.2.2 状态色走宿主 token、去掉纯蓝主按钮;棘轮基线首次下调。M1–M6 全部完成;上一条 `v3.26.50+cab473c` —— **M5 闸门**:新增 `scripts/token-lint.js`(只查 diff 新增行,CSS 与 JS 内联样式两套判据、四类白名单)+ `tests/design-token-ratchet-test.js`(13 项计数只降不升)+ `tests/theme-contrast-test.js`(亮/暗 × 文字 × 表面 114 对),三条各做一次打红验证后接进 `verify:ci`;顺手把首启动「选择资料目录」弹窗 token 化(全仓最后一个完全未 token 化的界面);上一条 `v3.26.49+1743453` —— **M4-B6 收尾**:`style.css` 剩余 16 处半像素字号全清零(守卫收紧为全文件断言)、`--iwb-control-h` 裁定不扩到全局控件(并排表单 vs 成组紧凑控件);插件主题契约重写,`ALLOW_FILES` 文件级豁免 **6 → 0** —— 改为「私有皮肤 manifest 自声明 `skin` + chroma 强调色判据 + 内容色行内标记」,声明私有皮肤的插件不得引用宿主颜色 token;同步 4 个插件版本,插件侧中性色写死归零;视觉基线 8 张因字号栅格化变化更新,A/B 回退确认非环境噪声;上一条 `v3.26.48+cb9cb9c` —— **M4-B5 节点**:节点卡内部表面统一 `--iwb-field` —— 端口底色从 `#161616`(暗色对卡片差 39 级,一颗黑洞)改 `#494949`(差 12 级),同病灶另 6 处(ref-img/ref-single/upload-link/refmini-empty/task-result-img/node-head:hover)一并改;浮条与任务卡 hover 改 `color-mix(text 10%)`(原来 panel 与 layer2 深色同色,hover 无反馈);字号 12/15/11/13 全归档位、圆角 8/6/5/14 归并、间距 52 处等值 + 13 处 1px 级微调;删 6 个死类名;新增 `tests/node-scope-test.js` 钉「节点内禁用面板表面色」;上一条 `v3.26.47+f5c8174` —— **M4-B4 设置/外观**:新增 `--iwb-control-h`(30px) 修「同行输入框 33px / 按钮 24px」的 9px 落差;设置页正文 14→13、标题 16→15,范围内半像素字号清零;删 21 条死规则(setcell/setgrid/set-row/appear-val 等);新增 `tests/settings-scope-test.js` 钉「控件等高 / 死类名不复现 / 引用的 token 必须存在」;上一条 `v3.26.46+9f29996` —— 2026-11-23 **M4-B3 首页/库**:删 30 条零生产者规则(25 个类名在产物里 0 次)+ 4 条被 specificity 覆盖的死声明,`style.css` 2391→2339 行;首页/库 106 条规则换 token,间距写死 91→5(只剩版心与导航让位的布局值)、字号写死清零,新增 `--iwb-font-display:24px` 第 7 档;验收改为「计算样式逐元素 diff + 12 张基线只首页 2 张变化」;上一条 `v3.26.45+968ff46` —— **M4-B2 浮层层级表 + 阴影四档**:14 档 `--iwb-z-*`(裸 z-index 取值种类 42→31)、`--iwb-elevation-1..4`(浮层 8 种阴影写法→4 档)、`.iwb-pop` 圆角 18→`radius-popover(14)`;修「弹窗里点保存看不到提示」—— 根因不是层级数字而是 `.iwb-overlay` 本身就是堆叠上下文,toast 改为 portal 到 `body`;新增 `tests/overlay-layer-test.js` 钉 9 条顺序约束;上一条 `v3.26.44+846a59b` —— **设计 token 体系重建**:D1–D9 色彩模型改为真正的深色(#121Line truncated
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 06e27af`(线上 `v3.26.63+06e27af` —— 2026-11-24 **图库:出图即入图库 + 插入落本地副本(能标注)**:每张生成完成即归档并通知插件(此前只在整轮结束写一次 ⇒ 生成中图库一直空)、插入取源改本地字节优先并引用化(抓不到才留原链接 + 提示)、`getNodeImage` 补 `data.localRef` 候选(远程缓存命中却仍判「不支持标注」的直接成因)、批量插入改 4 列栅格(旧实现同批全叠一处),逻辑落 `src/gallery-sync.js`,app.js 只装配;上一条 `v3.26.60+cf0e9a0` —— **浮层字号上调一档**:「模型设置」「图像设置」选择项 11→13px、高 22→28、左右内距 6→10、间距 4→6、标题 12→14、面板 328→360,改动全落在 `.iwb-pop` 的 6 个 token(两面板共用一套);上一条 `v3.26.59+e966b34` —— 备份新增 `plugin-files/` 通道,提示词封面换机不再丢;再上一条 2026-11-23 **节点正文文本区修复**:提示词/文本节点正文透明继承卡片底色(白卡片消失)、编辑态三层框(控件 border / 聚焦光晕 / D8 焦点环)全去掉,规范补表面角色三分法与 `node-scope-test` 第 5 条守卫,8 张基线重录;上一条 `v3.26.51+21554b0` —— **M6 延展验证**:插件面板两段六次叠加样式合并重写、133 行新增零裸值;补 `--iwb-font-base`(14px) 第 8 档与亮色状态色调深(对浅页面 2.13 → ≥4.6),对比度守卫 114→138 对;新增 ⑦⑧ 组件夹具基线共 16 张;`batch-export` 1.2.2 状态色走宿主 token、去掉纯蓝主按钮;棘轮基线首次下调。M1–M6 全部完成;上一条 `v3.26.50+cab473c` —— **M5 闸门**:新增 `scripts/token-lint.js`(只查 diff 新增行,CSS 与 JS 内联样式两套判据、四类白名单)+ `tests/design-token-ratchet-test.js`(13 项计数只降不升)+ `tests/theme-contrast-test.js`(亮/暗 × 文字 × 表面 114 对),三条各做一次打红验证后接进 `verify:ci`;顺手把首启动「选择资料目录」弹窗 token 化(全仓最后一个完全未 token 化的界面);上一条 `v3.26.49+1743453` —— **M4-B6 收尾**:`style.css` 剩余 16 处半像素字号全清零(守卫收紧为全文件断言)、`--iwb-control-h` 裁定不扩到全局控件(并排表单 vs 成组紧凑控件);插件主题契约重写,`ALLOW_FILES` 文件级豁免 **6 → 0** —— 改为「私有皮肤 manifest 自声明 `skin` + chroma 强调色判据 + 内容色行内标记」,声明私有皮肤的插件不得引用宿主颜色 token;同步 4 个插件版本,插件侧中性色写死归零;视觉基线 8 张因字号栅格化变化更新,A/B 回退确认非环境噪声;上一条 `v3.26.48+cb9cb9c` —— **M4-B5 节点**:节点卡内部表面统一 `--iwb-field` —— 端口底色从 `#161616`(暗色对卡片差 39 级,一颗黑洞)改 `#494949`(差 12 级),同病灶另 6 处(ref-img/ref-single/upload-link/refmini-empty/task-result-img/node-head:hover)一并改;浮条与任务卡 hover 改 `color-mix(text 10%)`(原来 panel 与 layer2 深色同色,hover 无反馈);字号 12/15/11/13 全归档位、圆角 8/6/5/14 归并、间距 52 处等值 + 13 处 1px 级微调;删 6 个死类名;新增 `tests/node-scope-test.js` 钉「节点内禁用面板表面色」;上一条 `v3.26.47+f5c8174` —— **M4-B4 设置/外观**:新增 `--iwb-control-h`(30px) 修「同行输入框 33px / 按钮 24px」的 9px 落差;设置页正文 14→13、标题 16→15,范围内半像素字号清零;删 21 条死规则(setcell/setgrid/set-row/appear-val 等);新增 `tests/settings-scope-test.js` 钉「控件等高 / 死类名不复现 / 引用的 token 必须存在」;上一条 `v3.26.46+9f29996` —— 2026-11-23 **M4-B3 首页/库**:删 30 条零生产者规则(25 个类名在产物里 0 次)+ 4 条被 specificity 覆盖的死声明,`style.css` 2391→2339 行;首页/库 106 条规则换 token,间距写死 91→5(只剩版心与导航让位的布局值)、字号写死清零,新增 `--iwb-font-display:24px` 第 7 档;验收改为「计算样式逐元素 diff + 12 张基线只首页 2 张变化」;上一条 `v3.26.45+968ff46` —— **M4-B2 浮层层级表 + 阴影四档**:14 档 `--iwb-z-*`(裸 z-index 取值种类 42→31)、`--iwb-elevation-1..4`(浮层 8 种阴影写法→4 档)、`.iwb-pop` 圆角 18→`radius-popover(14)`;修「弹窗里点保存看不到提示」—— 根因不是层级数字而是 `.iwb-overlay` 本身就是堆叠上下文,toast 改为 portal 到 `body`;新增 `tests/overlay-layer-test.js` 钉 9 条顺序约束;上一条 `v3.26.44+846a59b` —— **设计 token 体系重建**:D1–D9 色彩模型改为真正的深色(#121Line truncated
<!-- 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`(现 **109** 个模块 / 14,607 行,`sourceModules` 109 项;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 **9,105 行**(**双层预算**:绝对上限 9,105 / 占总源码 ≤ 40%,现 **30.0%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **3,044 行**(上限 **3,046**,余量 2;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **109** 个模块 / 21,290 行,`sourceModules` 109 项;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. 门禁与环境现状
+58 -10
View File
@@ -495,6 +495,26 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
- 正文对所在表面 ≥ **4.5:1**;次要文字 ≥ **3.2:1**;非文字元素(边框/图标)≥ **3:1**
- 品牌底上的字由 `contrast()` 自动选黑/白,**禁止手工指定**
#### 3.1.2 状态层(2026-11-24)
状态色只有前景色是不够的:背景与描边此前散落在样式里做 **16 处内联 `color-mix`**,暗色下各自为政。
现在由 `derive()` 统一派生(亮色浅底+深字 / 暗色深底+亮字),样式只引用:
| token | 亮色来源 | 用途 |
|---|---|---|
| `--iwb-err-bg` | `err` 与 `surface0` 混 90% | 错误提示底、危险按钮 hover 底 |
| `--iwb-err-bd` | 混 62% | 错误描边、连接失败外环 |
| `--iwb-ok-bg` | `ok` 混 90% | 成功/可用提示底 |
| `--iwb-ok-bd` | 混 62% | 成功描边、连接成功外环 |
| `--iwb-warn-bg` | `warn` 混 90% | 警告提示底 |
| `--iwb-warn-bd` | 混 62% | 警告描边 |
规则:
- 状态**底色**一律用 `*-bg`,不要再写 `color-mix(in srgb, var(--iwb-err) 12%, transparent)`
- 状态**描边/外环**一律用 `*-bd`
- `--iwb-err/ok/warn` 本身只作**文字色与图标色**(对比度已在 `derive()` 里夹到 4.5:1)
#### 3.1.1 单一源与产物(M3)
颜色只有一个源:`src/theme-tokens.js` 的 `derive()`。它派生出两份产物,**都不许手改**:
@@ -565,10 +585,11 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
### 3.3 字号 / 行高 / 字重
**已落地(v3.26.44,M4-B1)**:6 档。**v3.26.46(M4-B3)补第 7 档 `display`**;
**v3.26.51(M6)补第 8 档 `base`**。
**v3.26.51(M6)补第 8 档 `base`**;**v3.26.62 补 `2xs`(承认 10px)**。
| token | 值 | 归并掉 | 用途 |
|---|---|---|---|
| `--iwb-font-2xs` | 10px | 9, 10 | 极小标注:缩略图角标、画布坐标、比例徽标(**v3.26.62 承认**) |
| `--iwb-font-xs` | 11px | 10, 11.5 | 状态栏、徽标、辅助信息 |
| `--iwb-font-sm` | 12px | 12.5 | **默认正文 / 标签**(UI 里出现最多) |
| `--iwb-font-md` | 13px | 13.5 | **紧凑**正文、列表项、工具栏标题 |
@@ -576,6 +597,10 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
| `--iwb-font-lg` | 15px | 15.5, **16** | 小标题、节点标题、卡片标题 |
| `--iwb-font-xl` | 17px | 17.5, **18** | 面板标题、侧栏标题、图标字形 |
| `--iwb-font-2xl` | 20px | 19, 22 | 页面大标题 |
> **为什么承认 10px(v3.26.62)**:全站 29 处写死 `font-size:10px`,全是「极小标注」一个角色(缩略图角标、
> 画布坐标、比例徽标)。闭集最小是 11px,这 29 处长期在闭集外,lint 只能靠例外标记绕过 ——
> 与其装作没有,不如给它一个名字。**约束:`2xs` 不许用于可读正文,只用于附注/角标类信息。**
| `--iwb-font-display` | 24px | **26, 28, 30** | 展示级标题:页面/视图主标题(全仓 ≤5 处) |
> **为什么补第 8 档(M6 重做插件面板时定的)**:B1 的表里 14px 同时挂在 `md(13)` 和 `lg(15)`
@@ -678,20 +703,35 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
### 3.7 动效
**已落地(v3.26.62)**:数值定义在 `SCALE` 表(`--iwb-motion-*` / `--iwb-ease-*`)。
| token | 值 | 用途 |
|---|---|---|
| `--iwb-dur-fast` | 100ms | hover、颜色 |
| `--iwb-dur-base` | 150ms | 展开、位移 |
| `--iwb-dur-slow` | 200ms | 面板进出 |
| `--iwb-dur-xslow` | 300ms | 模态、大位移 |
| `--iwb-ease-standard` | `cubic-bezier(.2,0,0,1)` | 默认 |
| `--iwb-ease-out` | `cubic-bezier(0,0,.2,1)` | 进入 |
| `--iwb-motion-fast` | `0.12s` | 悬停、开关、小位移(全站最高频) |
| `--iwb-motion-base` | `0.15s` | 展开、位移、尺寸变化 |
| `--iwb-motion-slow` | `0.3s` | 整屏过渡、抽屉进出 |
| `--iwb-ease-out` | `cubic-bezier(0.16, 1, 0.3, 1)` | 进入/展开:快出慢停 |
| `--iwb-ease-in-out` | `cubic-bezier(0.4, 0, 0.2, 1)` | 状态切换 |
必须包 `@media (prefers-reduced-motion: reduce)` 关闭(现状已有部分,未统一)。
写法:`transition: <prop> var(--iwb-motion-fast) var(--iwb-ease-out)`。
> 历史遗留:`--tr-fast/-base/-slow`(`0.1s/0.2s/0.3s ease-out`)仍保留给旧代码,新代码不再使用。
> 旧文档里的 `--iwb-dur-*` / `--iwb-ease-standard` **从未落地**(v3.26.62 更正)。
必须包 `@media (prefers-reduced-motion: reduce)` 关闭动效。
### 3.7.1 透明度 / 描边宽度
| token | 值 | 用途 |
|---|---|---|
| `--iwb-opacity-disabled` | `0.45` | 禁用态(此前 0.45 / 0.55 混用) |
| `--iwb-opacity-muted` | `0.7` | 次要/未激活元素 |
| `--iwb-bw` | `1px` | 常规描边(分隔线、控件边框) |
| `--iwb-bw-strong` | `2px` | 强调描边:选中、危险操作、拖拽手柄 |
### 3.8 图标与命中区
- 尺寸闭集:12 / 14 / 16 / 20(现状 13/15 归并到 14/16)
- 尺寸闭集(v3.26.62 起有 token):`--iwb-icon-sm` 14 / `--iwb-icon-md` 16 / `--iwb-icon-lg` 18;12 与 20 只允许出现在
非图标图形(圆点、拖拽手柄、头像)上,不再新增裸写
- 描边:`stroke-width: 1.6`,`stroke-linecap: round`
- 命中区:**≥28×28**(现状气泡按钮 30×28 合规;`--iwb-tab-new` 等 28 高合规)
@@ -748,7 +788,11 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
### 3.11 设置面板(L3 组件 token,v3.26.53)
设置页采用 Obsidian 式布局:**组标题在页面底色上,组内容放在浅灰圆角容器里**。以下 token 定义在 `.iwb-settings-modal` 作用域内。
设置页采用 Obsidian 式布局:**组标题在页面底色上,组内容放在浅灰圆角容器里**。
> **v3.26.62 起这 18 个 token 的值在 `COMPONENT_SCOPED`(`scripts/gen-tokens.js`)里只写一次**,生成到
> `src/design-tokens.css` 的 `.iwb-settings-modal` 作用域;`style.css` 不再声明它们。本表 ↔ `tokens.json` 的
> `component.settings` 由 `tests/design-tokens-component-doc-test.js` 双向断言(文档有代码没有、代码有文档没写,都会红)。
| token | 值 | 用途 |
|---|---|---|
@@ -785,6 +829,7 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
| `--iwb-set-check-size` | `16px` | 复选框边长(全设置页统一) |
| `--iwb-set-check-radius` | `4px` | 复选框圆角(自定义皮肤时用) |
| `--iwb-set-btn-gap` | `var(--iwb-space-8)` | 一组操作按钮之间的间距 |
| `--iwb-set-input-border` | `color-mix(in srgb, var(--iwb-border) 40%, var(--iwb-panel))` | 输入框描边(比常规更淡,避免设置页满屏黑框) |
规则:
@@ -793,6 +838,9 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
- 备份/外观等页的操作按钮不再单独写高度或间距
### 3.13 浮层弹窗(popover,L3,v3.26.58)
> **v3.26.62 起这 11 个 token 由 `COMPONENT_SCOPED` 生成**(与 §3.11 同一机制),`style.css` 只留布局属性;
> 文档、`tokens.json` 的 `component.popover`、生成产物三方由同一个测试断言。
画布节点上的「模型设置」「图像设置」等贴节点浮层,统一用 `.iwb-pop` 这套 shell;
token 定义在 `.iwb-pop` 作用域内,**同类浮层只允许引用它们 + L2 尺度 token**。
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.26.61",
"version": "3.26.63",
"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/plugin-archive-test.js && node tests/plugin-files-policy-test.js && node tests/theme-plugin-tokens-test.js && node tests/theme-static-snapshot-test.js && node tests/overlay-layer-test.js && node tests/settings-scope-test.js && node tests/node-scope-test.js && node tests/appearance-v2-test.js && node tests/image-prompt-cover-test.js && node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/gallery-sync-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/plugin-data-test.js && node tests/plugin-loader-test.js && node tests/plugin-bundle-test.js && node tests/plugin-install-test.js && node tests/plugin-gallery-render-test.js && node tests/plugin-gallery-recovery-test.js && node tests/plugin-gallery-ux-test.js && node tests/plugin-grouplib-render-test.js && node tests/plugin-promptlib-render-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/plugin-theme-contract-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/native-overlay-park-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-test.js && node tests/ui-workbench-hooks-test.js && node tests/plugin-scale-contract-test.js && node tests/design-token-ratchet-test.js && node tests/theme-contrast-test.js",
"test:unit": "node tests/plugin-archive-test.js && node tests/plugin-files-policy-test.js && node tests/theme-plugin-tokens-test.js && node tests/design-tokens-component-doc-test.js && node tests/theme-static-snapshot-test.js && node tests/overlay-layer-test.js && node tests/settings-scope-test.js && node tests/node-scope-test.js && node tests/appearance-v2-test.js && node tests/image-prompt-cover-test.js && node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/storage-config-shape-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/gallery-sync-test.js && node tests/image-blob-store-test.js && node tests/image-preview-derive-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/plugin-data-test.js && node tests/plugin-loader-test.js && node tests/plugin-bundle-test.js && node tests/plugin-install-test.js && node tests/plugin-gallery-render-test.js && node tests/plugin-gallery-recovery-test.js && node tests/plugin-gallery-ux-test.js && node tests/plugin-grouplib-render-test.js && node tests/plugin-promptlib-render-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/plugin-theme-contract-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/native-overlay-park-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-test.js && node tests/ui-workbench-hooks-test.js && node tests/plugin-scale-contract-test.js && node tests/design-token-ratchet-test.js && node tests/theme-contrast-test.js",
"test:diagnostics": "node tests/runtime-diagnostics-hotpath-test.js",
"test:facts": "node tests/architecture-facts-guard-test.js && node tests/release-records-test.js",
"plugins:gc": "node scripts/plugins-publish.mjs --gc",
+3 -3
View File
@@ -44,10 +44,10 @@
"dir": "promptlib",
"main": "main.js",
"style": "styles.css",
"version": "1.11.0",
"version": "1.13.0",
"files": {
"main.js": "0e1bd0f235b05b3edbdccd19ffe24791f0ce82bb5180ebe5a60dcaa6b2ed3ce8",
"styles.css": "23fd4beb4f5b89be1f763ee7221e3dbdafced85afc378cd5cc1a9e03b14d7046"
"main.js": "2108d09bd7cd1d96dfeb8499dac7adacbda659b222606f7d072a2bf8cbf5361a",
"styles.css": "e2ba84f2e4251f461e77c78ca39fc2b5022f169cb1a4eae0aa7ef786f28b6863"
}
},
{
+317 -71
View File
@@ -85,7 +85,7 @@
// 看不到 mount() 内部的函数(曾导致 "Can't find variable: fillTpl")。
function detectVars (text) {
var out = [], seen = {}
var re = /\{([^{}\n]{1,24})\}/g, m
var re = /\{([^{}\n]{1,60})\}/g, m
var str = String(text || '')
while ((m = re.exec(str))) {
var k = String(m[1] || '').trim()
@@ -96,17 +96,56 @@
return out
}
function fillTpl (tpl, vals) {
return String(tpl || '').replace(/\{([^{}\n]{1,24})\}/g, function (all, k) {
return String(tpl || '').replace(/\{([^{}\n]{1,60})\}/g, function (all, k) {
var key = String(k || '').trim()
var v = (vals && Object.prototype.hasOwnProperty.call(vals, key)) ? String(vals[key] == null ? '' : vals[key]) : ''
return v ? v : all
})
}
// v1.12.0:文本域自适应高度(节点变量行与编辑面板共用)。
// 必须先 height='auto' 再读 scrollHeight —— 否则读到的是上一次写死的固定高度,永远长不高。
// rows=1 由调用方显式设置:浏览器默认 rows=2,单行内容会被算成两行高。
function autoGrowArea (ta, maxPx) {
if (!ta || !ta.style) return
var max = maxPx || 96
// v1.12.3:空值 + 有 placeholder 时,placeholder 的折行也要占高度。
// 否则「默认展示内容文案」的第二行会被单行高裁掉(24 字的内容提示需要 40px,实高只有 30px)。
// 测量要临时把 placeholder 塞进 value —— 焦点在框内时不做,免得打断输入法组合与光标。
var restore = false
try {
var focused = (typeof document !== 'undefined' && document.activeElement === ta)
var ph = (typeof ta.getAttribute === 'function') ? String(ta.getAttribute('placeholder') || '') : ''
if (!ta.value && ph && !focused) { ta.value = ph; restore = true }
} catch (e) { restore = false }
ta.style.height = 'auto'
var h = Number(ta.scrollHeight) || 0
if (restore) { ta.value = ''; try { ta.scrollTop = 0 } catch (e) { /* ignore */ } }
ta.style.height = Math.min(h, max) + 'px'
ta.style.overflowY = h > max + 1 ? 'auto' : 'hidden'
}
// `{…}` 里能放多少字:v1.13.0 起占位符里放的是「内容」原文(用户裁定),所以这条上限
// 按「一句内容」定,不再按短变量名定。**必须与下面所有正则里的 {1,60} 保持一致**:
// 识别用 60、替换用更小的值,就会出现「识别到了但替换不到」⇒ 变量那段被 outputText 整段删掉。
var KEY_MAX = 60
// 变量「内容」框的最大高度(约 10 行后框内滚动)。下限由 rows=3 + CSS min-height 保证。
// v1.13.0:用户要求「默认最高行数多加 4 行」⇒ 6 行(132px)→ 10 行(212px,行高 1.65×12px≈19.8)。
var VDEF_MAX = 212
// 内容 → 正文里的占位符键:`{…}` 只能单行、不超过 KEY_MAX 字、不含花括号。
// 不满足就返回空串 ⇒ 调用方保留原键(正文不跟随),绝不硬塞进 `{}` —— 塞进去会让变量
// 直接识别不到,下次 sync 就把它从变量列表里清掉,用户刚写的内容当场丢失。
function contentKeyOf (s) {
var t = String(s || '').trim()
if (!t || t.length > KEY_MAX) return ''
if (/[{}\n\r]/.test(t)) return ''
return t
}
// 提交给下游/生图的文本:填完变量后,把未填的 {占位} 从输出里剔除(只在编辑器里展示)。
function outputText (tpl, vals) {
var s = fillTpl(tpl, vals)
return s.replace(/[{][^{}]{1,24}[}]/g, ' ').replace(/[ ]{2,}/g, ' ').trim()
return s.replace(/[{][^{}]{1,60}[}]/g, ' ').replace(/[ ]{2,}/g, ' ').trim()
}
function varsOf (p) {
@@ -119,6 +158,15 @@
return detectVars(p.text)
}
// v1.12.3:变量的「内容(def)」只作为**兜底值**参与文本计算,不再预填进节点输入框。
// 用户裁定:节点输入框默认为空,内容以灰字提示展示;输入框留空时下游仍然用这段内容
// (否则 outputText 会把没值的 {key} 整段删掉,用户填的内容永远进不了提示词)。
function defValsOf (defs) {
var m = {}
;(Array.isArray(defs) ? defs : []).forEach(function (v) { if (v && v.key && v.def) m[v.key] = String(v.def) })
return m
}
// ===== v1.6.0:插件设置页(宿主「设置 → 插件 → 提示词库」内嵌渲染)=====
// 宿主约定:manifest.settings[key] = { type:'custom', render(ctx) -> DOM 节点 }。
// render 在 setup 之后调用,因此这里用 module 级 PLP_CTX 拿插件能力(data/promptlib)。
@@ -901,7 +949,7 @@
if (!w) return
var vd = varsOf(st.p)
if (vd.length) {
api2.createNode('ptpl', w.x, w.y, { promptId: '', name: st.p.name || '提示词模板', tpl: st.p.text || '', vdefs: vd, vars: {}, cover: st.p.cover || '', refOn: false, text: outputText(st.p.text || '', {}), outKind: 'prompt' })
api2.createNode('ptpl', w.x, w.y, { promptId: '', name: st.p.name || '提示词模板', tpl: st.p.text || '', vdefs: vd, vars: {}, cover: st.p.cover || '', refOn: false, text: outputText(st.p.text || '', defValsOf(vd)), outKind: 'prompt' })
notify('已插入模板节点:' + (st.p.name || ''))
} else {
api2.createNode('prompt', w.x, w.y, { text: st.p.text || '', title: st.p.name || '' })
@@ -978,7 +1026,9 @@
notify('已插入封面图片')
} else if (kind === 'ptpl') {
var p = payload
var id2 = cw.createNode('ptpl', sw.x, sw.y, { promptId: p.id, name: p.name || '提示词模板', tpl: p.text || '', vdefs: varsOf(p), vars: {}, outKind: 'prompt', cover: p.cover || coverNameOf(p), refOn: false, text: outputText(p.text || '', {}) })
var vd2 = varsOf(p)
var dv2 = defValsOf(vd2)
var id2 = cw.createNode('ptpl', sw.x, sw.y, { promptId: p.id, name: p.name || '提示词模板', tpl: p.text || '', vdefs: vd2, vars: {}, outKind: 'prompt', cover: p.cover || coverNameOf(p), refOn: false, text: outputText(p.text || '', dv2) })
if (!id2) { notify('插入失败', 'err'); cancelPlacement(); return }
notify('已插入模板节点')
} else {
@@ -1096,73 +1146,173 @@
return { close: close, card: card, body: bodyEl, foot: footEl }
}
// ===== v1.5.0:变量编辑器(新建/编辑弹窗用)=====
// 变量来自正文的 {名字}:自动检测、可改标签/默认值/说明;留空时渲染保留 {原名}。
function makeVarsEditor (text, initial, onTextChange) {
// ===== v1.5.0:变量编辑器(新建/编辑弹窗用)· v1.13.0 内容与正文联动 =====
// 字段分工(v1.13.0 用户裁定:正文 `{…}` 里放的就是「内容」原文):
// key = 正文里 `{…}` 里的字,**等于内容**。改内容 ⇒ 正文里那个 `{…}` 跟着改(真联动)。
// label = 变量名称:只影响节点左栏显示(最多 4 字,超出省略),空则显示 key
// def = 内容:正文里 `{}` 里的那段字,也是节点输入框留空时真正传给下游的值
// desc = 说明:可选,填了就优先于内容作为节点输入框的灰字提示
// 约束:`{}` 里不能换行、不能超过 KEY_MAX(60) 字。不满足时正文保留原键并在摘要里提示,
// 绝不硬塞 —— 塞进去变量就识别不到了,下次 sync 会把它从列表里清掉,内容当场丢失。
// 收起态只留一行「名称 + 内容字数」,展开出现名称/内容/说明;允许多个同时展开。
function makeVarsEditor (text, initial, onTextChange, opts) {
var host = opts || {}
// 正文当前值必须实时取:sync 有 200ms 防抖,改内容时 text 可能还是旧的。
function curText () {
if (typeof host.getText === 'function') { try { return String(host.getText() || '') } catch (e) { /* ignore */ } }
return text
}
var box = el('div', { class: 'iwb-plp-vars' })
var head = el('div', { class: 'iwb-plp-vhead' },
el('span', { text: '变量' }),
el('span', { class: 'iwb-plp-vhint', text: '与正文双向同步 · 点 i 写说明' }))
// 用户裁定(v1.12.3):变量区的功能性说明文案一律不要,只留「变量」标签
var head = el('div', { class: 'iwb-plp-vhead' }, el('span', { text: '变量' }))
var rows = el('div', { class: 'iwb-plp-vrows' })
box.appendChild(head); box.appendChild(rows)
var list = []
var open = {}
var norm = function (v) { return { key: String(v.key || ''), desc: String(v.desc || ''), def: String(v.def || '') } }
var focusKey = ''
var norm = function (v) {
return {
key: String((v && v.key) || ''),
label: String((v && v.label) || ''),
desc: String((v && v.desc) || ''),
def: String((v && v.def) || ''),
}
}
if (Array.isArray(initial) && initial.length) list = initial.filter(function (v) { return v && v.key }).map(norm)
function values () {
var m = {}
list.forEach(function (v) { if (v.def) m[v.key] = v.def })
return m
}
// 内容框显示值 = 内容;内容为空时退回正文里的键(它就是这段变量在正文里的字,空着更让人困惑)。
function bodyOf (v) { return v.def || v.key }
// 摘要:内容字数 + 说明 + 「正文未同步」告警(内容塞不进 `{}` 时才会出现)。
function summaryOf (v) {
var body = bodyOf(v)
var base = (body ? '内容 ' + body.length + ' 字' : '未填内容') + (v.desc ? ' · 有说明' : '')
if (v.def && !contentKeyOf(v.def)) base += ' · 正文未同步(需单行 ≤' + KEY_MAX + ' 字)'
return base
}
function field (labelText, ctrl) {
return el('div', { class: 'iwb-plp-vfield' },
el('span', { class: 'iwb-plp-vflabel', text: labelText }),
el('div', { class: 'iwb-plp-vbody' }, ctrl))
}
function paint () {
clear(rows)
list.forEach(function (v) {
var item = el('div', { class: 'iwb-plp-vitem' })
var isOpen = !!open[v.key]
var item = el('div', { class: 'iwb-plp-vitem' + (isOpen ? ' is-open' : '') })
var row = el('div', { class: 'iwb-plp-vrow2' })
var nameIn = el('input', { class: 'iwb-input iwb-plp-vname', placeholder: '变量名' })
nameIn.value = v.key
var iBtn = el('button', { class: 'iwb-plp-vi' + (open[v.key] ? ' is-open' : ''), type: 'button', title: '说明', text: 'i' })
iBtn.addEventListener('click', function () { open[v.key] = !open[v.key]; paint() })
nameIn.addEventListener('blur', function () { renameTo(v, nameIn.value) })
nameIn.addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); nameIn.blur() } })
row.appendChild(nameIn); row.appendChild(iBtn)
var caret = el('span', { class: 'iwb-plp-vcaret', text: isOpen ? '▾' : '▸' })
var title = el('span', {
class: 'iwb-plp-vlabelx' + (v.label ? '' : ' is-empty'),
text: v.label || v.key,
})
title.title = v.label || v.key
var sum = el('span', { class: 'iwb-plp-vsum', text: summaryOf(v) })
var iBtn = el('button', { class: 'iwb-plp-vi' + (isOpen ? ' is-open' : ''), type: 'button', title: '说明', text: 'i' })
var refreshSum = function () { sum.textContent = summaryOf(v) }
row.appendChild(caret); row.appendChild(title); row.appendChild(sum); row.appendChild(iBtn)
row.addEventListener('click', function () { open[v.key] = !isOpen; paint() })
iBtn.addEventListener('click', function (e) { e.stopPropagation(); open[v.key] = true; paint() })
item.appendChild(row)
if (open[v.key]) {
var d = el('input', { class: 'iwb-input iwb-plp-vdesc', placeholder: '说明(会作为节点输入框的占位提示)' })
if (isOpen) {
var nameIn = el('input', { class: 'iwb-input iwb-plp-vname', placeholder: '变量名称(节点上最多显示 4 字)' })
nameIn.value = v.label || ''
// 名称只写 label:它决定节点左栏显示,**不动正文**(用户裁定:正文跟着内容走)。
nameIn.addEventListener('input', function () {
v.label = nameIn.value
title.textContent = v.label || v.key
title.title = v.label || v.key
})
item.appendChild(field('名称', nameIn))
if (focusKey === v.key) {
focusKey = ''
setTimeout(function () { try { nameIn.focus() } catch (e) { /* ignore */ } }, 0)
}
// v1.12.3:内容固定从 3 行起步(rows=3),可继续长到 VDEF_MAX 后框内滚动。
// 上一版 rows=1 且「append 之前」就 autoGrowArea ⇒ 元素不在文档里时 scrollHeight 读不到,
// 高度被 CSS min-height 兜成一行,长文案在框里被裁切(用户截图里就是这个现象)。
var area = el('textarea', { class: 'iwb-input iwb-plp-vdef', rows: '3', placeholder: '内容(单行 ≤' + KEY_MAX + ' 字)' })
area.value = bodyOf(v)
area.addEventListener('input', function () {
v.def = area.value
autoGrowArea(area, VDEF_MAX)
// v1.13.0 联动:内容就是正文 `{}` 里的字 ⇒ 改内容,正文立刻跟着改。
// 不重绘整行(重绘会销毁正在输入的 textarea,光标与输入法组合都会断),只改标题与摘要。
var next = contentKeyOf(area.value)
if (next && next !== v.key) {
var cur = curText()
var old = v.key
if (!list.some(function (x) { return x !== v && x.key === next })) {
var nt = cur.split('{' + old + '}').join('{' + next + '}')
v.key = next
if (old in open) { open[next] = open[old]; delete open[old] }
text = nt
title.textContent = v.label || next
title.title = v.label || next
if (nt !== cur) onTextChange(nt)
}
}
refreshSum()
})
item.appendChild(field('内容', area))
autoGrowArea(area, VDEF_MAX)
setTimeout(function () { autoGrowArea(area, VDEF_MAX) }, 0)
var d = el('input', { class: 'iwb-input iwb-plp-vdesc', placeholder: '说明(可选)' })
d.value = v.desc || ''
d.addEventListener('input', function () { v.desc = d.value })
item.appendChild(d)
d.addEventListener('input', function () { v.desc = d.value; refreshSum() })
item.appendChild(field('说明', d))
}
rows.appendChild(item)
})
if (!list.length) rows.appendChild(el('div', { class: 'iwb-hint', text: '正文里没有 {变量};输入 {产品名} 即会被识别。' }))
}
function renameTo (v, raw) {
var next = String(raw || '').replace(/[{}]/g, '').trim()
if (!next || next === v.key) { paint(); return }
if (list.some(function (x) { return x !== v && x.key === next })) { notify('变量名重复:' + next, 'err'); paint(); return }
var old = v.key
v.key = next
if (open[old] !== undefined) { open[next] = open[old]; delete open[old] }
var nt = String(text || '').split('{' + old + '}').join('{' + next + '}')
text = nt
if (typeof onTextChange === 'function') onTextChange(nt)
paint()
}
function sync (nextText) {
text = String(nextText || '')
var found = detectVars(text)
var old = {}
list.forEach(function (v) { old[v.key] = v })
var kept = {}
found.forEach(function (v) { if (old[v.key]) kept[v.key] = 1 })
var gone = list.filter(function (v) { return !kept[v.key] })
var fresh = found.filter(function (v) { return !old[v.key] })
// v1.13.0:正文 `{}` 里就是内容,用户很可能直接在正文里改这段字。
// 只有一个变量消失、同时只有一个新增 ⇒ 当成「改了这段占位符」,把名称/说明继承过来,
// 内容就是新的键。多个同时变则无法判断对应关系,按原规则当成新变量(名称留空)。
var carry = (gone.length === 1 && fresh.length === 1) ? gone[0] : null
if (carry) {
if (open[carry.key]) { open[fresh[0].key] = open[carry.key]; delete open[carry.key] }
if (focusKey === carry.key) focusKey = fresh[0].key
}
list = found.map(function (v) {
var prev = old[v.key]
return { key: v.key, desc: prev ? prev.desc : v.desc, def: prev ? prev.def : '' }
// 必须带上 label / def:旧实现只搬 key / desc,用户填的名称与内容每次 sync 都被吃掉。
if (prev) return { key: v.key, label: prev.label, desc: prev.desc, def: prev.def }
if (carry && v.key === fresh[0].key) return { key: v.key, label: carry.label, desc: carry.desc, def: v.key }
return { key: v.key, label: '', desc: '', def: '' }
})
paint()
}
// 插入变量用:sync 刚建出来的条目 def 为空,把「选中的原文」补进内容框,
// 并展开它、把焦点送到「名称」框(名称一律手填,不自动截句)。
function preset (key, patch) {
var it = null
list.forEach(function (v) { if (v.key === key) it = v })
if (!it || !patch) return
if (!it.def && patch.def) it.def = String(patch.def)
if (!it.label && patch.label) it.label = String(patch.label)
open[key] = true
focusKey = key
paint()
}
if (!list.length) list = detectVars(text).map(norm)
// v1.13.0:不再在打开时改写正文。正文 `{}` 里的字**就是内容**(用户裁定),
// 老数据(占位符本来就是一句正文)保持原样,用户改内容时正文会跟着改。
paint()
return { node: box, sync: sync, list: function () { return list }, values: values }
return { node: box, sync: sync, preset: preset, list: function () { return list }, values: values }
}
// ===== v1.5.10:设置页(分组管理 / 数据备份 / 数据位置)=====
@@ -1582,7 +1732,7 @@
var txt = el('div', { class: 'iwb-plp-dtext' })
;(function paintText () {
var str = String(p.text || '')
var re = /[{]([^{}]{1,24})[}]/g, last = 0, m
var re = /[{]([^{}]{1,60})[}]/g, last = 0, m
while ((m = re.exec(str))) {
if (m.index > last) txt.appendChild(document.createTextNode(str.slice(last, m.index)))
txt.appendChild(el('span', { class: 'iwb-plp-dvar', text: m[0] }))
@@ -1736,7 +1886,7 @@
function paintHl () {
var v = textIn.value || ''
hl.textContent = ''
var re = /[{]([^{}]{1,24})[}]/g, last = 0, m
var re = /[{]([^{}]{1,60})[}]/g, last = 0, m
while ((m = re.exec(v))) {
if (m.index > last) hl.appendChild(document.createTextNode(v.slice(last, m.index)))
hl.appendChild(el('span', { class: 'iwb-plp-hlvar', text: m[0] }))
@@ -1749,7 +1899,10 @@
textIn.addEventListener('scroll', function () { hl.scrollTop = textIn.scrollTop; hl.scrollLeft = textIn.scrollLeft })
textIn.value = draft.text || ''
paintHl()
var varEd = makeVarsEditor(draft.text || '', draft.vars || [], function (nt) { textIn.value = nt; dirty = true; paintHl() })
// 第四个参数供编辑器实时取正文(改名称时要改 {…},防抖中的 text 可能还是旧的)
var varEd = makeVarsEditor(draft.text || '', draft.vars || [], function (nt) { textIn.value = nt; dirty = true; paintHl() }, {
getText: function () { return textIn.value },
})
var syncTimer = 0
textIn.addEventListener('input', function () {
dirty = true
@@ -1771,19 +1924,33 @@
var v = textIn.value
var s = Math.min(Math.max(lastSel.s || 0, 0), v.length)
var e = Math.min(Math.max(lastSel.e == null ? s : lastSel.e, s), v.length)
var name = s !== e ? String(v.slice(s, e)).replace(/\s+/g, '').slice(0, 24) : '新变量'
if (!name) name = '新变量'
var picked = s !== e ? String(v.slice(s, e)).trim() : ''
// v1.13.0(用户裁定):`{}` 里放的就是内容原文 ⇒ 选中的原文直接当占位符。
// 塞不进 `{}` 时才退到「变量N」:没选中、含换行、或超过 KEY_MAX 字。
// (1.12.0 曾把长句一律改成变量N + 原文进内容,用户否掉了:正文该跟着内容走。)
var embed = contentKeyOf(picked)
var used = {}
varEd.list().forEach(function (x) { used[x.key] = 1 })
var name = embed
if (!name) {
var n = 1
while (used['变量' + n]) n++
name = '变量' + n
}
var ins = '{' + name + '}'
textIn.focus()
textIn.value = v.slice(0, s) + ins + v.slice(e)
textIn.setSelectionRange(s + 1, s + 1 + name.length)
lastSel = { s: s + 1, e: s + 1 + name.length }
// 光标落在 `{}` 后面:占位符里就是一整句,再全选它容易误删
textIn.setSelectionRange(s + ins.length, s + ins.length)
lastSel = { s: s + ins.length, e: s + ins.length }
dirty = true
paintHl()
varEd.sync(textIn.value)
// 展开该变量(名称留空等用户填 4 字短名),并让内容框跟上这段原文
if (picked) varEd.preset(name, { def: picked })
})
var mid = el('div', { class: 'iwb-plp-emid' })
mid.appendChild(el('div', { class: 'iwb-plp-etool' }, insVarBtn, el('span', { class: 'iwb-hint', text: '在光标处插入 {变量},并自动聚焦变量名' })))
mid.appendChild(el('div', { class: 'iwb-plp-etool' }, insVarBtn, el('span', { class: 'iwb-hint', text: '选中文字直接作内容' })))
mid.appendChild(textWrap)
var split = el('div', { class: 'iwb-plp-esplit', title: '拖动调整变量列宽度' })
var right = el('div', { class: 'iwb-plp-eright' })
@@ -1856,19 +2023,39 @@
},
})
}
function render () {
clear(fixed); clear(scrollBox)
var gs = groupsOf()
// 搜索行
var top = el('div', { class: 'iwb-row' })
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 */ } } })
// ---- v1.12.2:搜索框常驻 ----
// 旧实现把搜索框写在 render() 里,而 render() 第一件事是 clear(fixed) —— 每敲一个键都把
// 搜索框自身销毁重建。英文/数字勉强能用(重建后重新 focus、光标扔到末尾),但中文输入法
// 在组合态(compositionstart → compositionend)被打断 ⇒ 拼音打不出字、候选词消失。
// 现在:搜索框只创建一次;render() 只重建其余节点;组合态期间不重排,只记 query。
var searchRow = null
var searchEl = null
var composing = false
var searchTimer = 0
function scheduleResults () {
if (searchTimer) clearTimeout(searchTimer)
searchTimer = setTimeout(function () { searchTimer = 0; render() }, 120)
}
function ensureSearchRow () {
if (searchRow) return searchRow
searchRow = el('div', { class: 'iwb-row' })
searchEl = el('input', { class: 'iwb-input iwb-grow', placeholder: '搜索名称 / 内容 / 标签…' })
searchEl.addEventListener('compositionstart', function () { composing = true })
searchEl.addEventListener('compositionend', function () {
composing = false
query = searchEl.value
scheduleResults()
})
searchEl.addEventListener('input', function (e) {
query = searchEl.value
// 组合中的拼音不是搜索词:不重排,等上屏后由 compositionend 触发一次
if (composing || (e && e.isComposing)) return
scheduleResults()
})
// v1.10.0:顶部三入口 = 文件(从分享文件导入)/ 文本(从剪贴板导入)/ 新建。
var fileBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '从分享文件导入词例', text: '文件' })
var textBtn = el('button', { class: 'iwb-btn iwb-btn-sm', title: '从剪贴板导入词例', text: '文本' })
var newBtn = el('button', { class: 'iwb-btn iwb-btn-sm iwb-btn-primary', title: '新建词例', text: '新建' })
fileBtn.addEventListener('click', function () {
fileBtn.disabled = true
importShareFromFile().then(function (r) {
@@ -1886,14 +2073,29 @@
}).catch(function (e) { textBtn.disabled = false; notify('导入失败:' + ((e && e.message) || e), 'err') })
})
newBtn.addEventListener('click', function () { openEditModal(null, true) })
top.appendChild(search); top.appendChild(fileBtn); top.appendChild(textBtn); top.appendChild(newBtn)
fixed.appendChild(top)
searchRow.appendChild(searchEl); searchRow.appendChild(fileBtn)
searchRow.appendChild(textBtn); searchRow.appendChild(newBtn)
return searchRow
}
function render () {
// 搜索行必须留下:清掉它会让输入法组合中断、光标丢失(中文打不进字的直接原因)
var row = ensureSearchRow()
Array.prototype.slice.call(fixed.children).forEach(function (c) { if (c !== row) fixed.removeChild(c) })
if (fixed.firstChild !== row) fixed.insertBefore(row, fixed.firstChild)
if (searchEl && !composing && searchEl.value !== query) searchEl.value = query
clear(scrollBox)
var gs = groupsOf()
if (words().length) {
var scope = el('div', { class: 'iwb-lib-searchscope-line' },
el('span', { class: 'iwb-lib-searchscope', title: '搜索会跨全部分组进行' }, '在全部中搜索'),
el('button', { class: 'iwb-lib-searchscope-back', title: '清空搜索,回到分组筛选', text: '×' }))
scope.querySelector('.iwb-lib-searchscope-back').addEventListener('click', function () { query = ''; render() })
scope.querySelector('.iwb-lib-searchscope-back').addEventListener('click', function () {
query = ''; render()
if (searchEl) { try { searchEl.focus() } catch (e) { /* ignore */ } }
})
fixed.appendChild(scope)
}
@@ -1992,6 +2194,7 @@
load()
return function dispose () {
if (searchTimer) { clearTimeout(searchTimer); searchTimer = 0 }
document.removeEventListener('keydown', onKey, true)
try { if (typeof off === 'function') off() } catch (e) { /* ignore */ }
closeMenu(); closeEditor(); closeManager()
@@ -2001,7 +2204,7 @@
global.IWBPluginHost.register({
id: 'promptlib',
name: '提示词库',
version: '1.11.0',
version: '1.13.0',
apiVersion: 1,
capabilities: ['panels', 'promptlib', 'nodeTypes', 'canvas', 'canvasWrite'],
data: { schemaVersion: 3, maxBytes: 4 * 1024 * 1024 },
@@ -2115,7 +2318,7 @@
if (st.title.textContent !== name) st.title.textContent = name
var tpl = String(d.tpl || '')
var defs = Array.isArray(d.vdefs) && d.vdefs.length ? d.vdefs : (function () {
var out = [], seen = {}, re = /\{([^{}\n]{1,24})\}/g, m
var out = [], seen = {}, re = /\{([^{}\n]{1,60})\}/g, m
while ((m = re.exec(tpl))) {
var k = String(m[1] || '').trim()
if (!k || seen[k]) continue
@@ -2125,6 +2328,13 @@
return out
})()
st.meta.textContent = defs.length ? (defs.length + ' 个变量') : '无变量'
// 输入框留空时用它兜底(值来自变量「内容」)。挂在 st 上而不是函数内局部:
// scheduleUpdate 是另一个函数,局部声明在那边看不到(会直接 ReferenceError)。
st.defs = defs
st.defOf = function (k) {
for (var i = 0; i < defs.length; i++) { if (defs[i] && defs[i].key === k) return String(defs[i].def || '') }
return ''
}
var key = tpl + '|' + defs.map(function (v) { return v.key }).join(',')
if (st.key !== key) {
st.key = key
@@ -2132,22 +2342,52 @@
clear(st.vars)
defs.forEach(function (v) {
var row = el('div', { class: 'iwb-plp-nrow' })
row.appendChild(el('span', { class: 'iwb-plp-nk', text: v.label || v.key }))
var inp = el('input', { class: 'iwb-input iwb-plp-nin', placeholder: v.desc || v.def || ('填写 ' + (v.label || v.key)) })
inp.value = String((d.vars && d.vars[v.key]) || v.def || '')
inp.addEventListener('input', function () { scheduleUpdate(st, d) })
var nk = el('span', { class: 'iwb-plp-nk', text: v.label || v.key })
nk.title = v.label || v.key
row.appendChild(nk)
// v1.12.0:单行 input → 自适应 textarea(rows=1 起,最多约 5 行后框内滚动)。
// 以前长文案挤在 24px 单行框里,只能左右拖动看末尾。
// v1.12.3:值默认为空(用户裁定);不填说明时用「内容」当灰字提示,与说明同一样式。
var inp = el('textarea', { class: 'iwb-input iwb-plp-nin', rows: '1', placeholder: v.desc || v.def || ('填写 ' + (v.label || v.key)) })
inp.value = String((d.vars && d.vars[v.key]) || '')
inp.addEventListener('input', function () { autoGrowArea(inp, 96); scheduleUpdate(st, d) })
// 失焦后重测:清空输入框时焦点在框内,placeholder 高度没量到,blur 时补一次
inp.addEventListener('blur', function () { autoGrowArea(inp, 96) })
// 宿主的可交互控件白名单是 input/select/button…(src/ui-node-card.js:281,不含 textarea)⇒
// 不拦的话按住文本框拖选文字会把整个节点拖走。
inp.addEventListener('pointerdown', function (e) {
e.stopPropagation()
try { if (st.props && st.props.onSelect) st.props.onSelect(st.node.id) } catch (e2) { /* ignore */ }
})
// 宿主画布滚轮一律缩放(src/runtime-workbench-logic.js:1244 只排除面板类容器)。
// 只有内容真的溢出时才拦,否则保留「滚轮缩放画布」的原有习惯。
inp.addEventListener('wheel', function (e) {
if (inp.scrollHeight > inp.clientHeight + 1) e.stopPropagation()
}, { passive: true })
st.inputs[v.key] = inp
row.appendChild(inp)
st.vars.appendChild(row)
// 必须 append 之后再量:脱离文档的元素 scrollHeight 不可靠(会量不到 placeholder 的折行)
autoGrowArea(inp, 96)
setTimeout(function () { autoGrowArea(inp, 96) }, 0)
})
if (!defs.length) st.vars.appendChild(el('div', { class: 'iwb-plp-nempty', text: '正文里没有 {变量}' }))
try {
var vv = {}
Object.keys(st.inputs).forEach(function (k) { vv[k] = st.inputs[k].value })
Object.keys(st.inputs).forEach(function (k) { vv[k] = st.inputs[k].value || st.defOf(k) })
var clean = outputText(String(d.tpl || ''), vv)
if (d.text !== clean && props && typeof props.onUpdate === 'function') props.onUpdate(node.id, { text: clean })
} catch (e) { /* ignore */ }
}
// 变量集合没变时不重建输入框(重建会丢焦点),但 placeholder(说明/内容)可能在面板里改过:
// 就地同步文案并重测高度,否则节点上还显示改之前的提示。
defs.forEach(function (v) {
var inp = st.inputs[v.key]
if (!inp) return
var ph = v.desc || v.def || ('填写 ' + (v.label || v.key))
if (inp.placeholder !== ph) { inp.placeholder = ph; autoGrowArea(inp, 96) }
})
// 缩略图:封面可能是 dataURL,也可能是插件文件引用
var cover = d.cover
var coverKey = typeof cover === 'string' ? cover : (cover && cover.img) ? String(cover.img) : ''
@@ -2164,18 +2404,24 @@
var refOn = d.refOn === true
if (st.refChk.checked !== refOn) st.refChk.checked = refOn
st.refNum.textContent = refOn ? '1 张' : '0'
// 未填变量提示(与风格节点一致:留空的保留 {原名})
// 未填提示(v1.12.3 语义变了):输入框空但「内容」有值 ⇒ 用内容兜底,不算缺;
// 只有既没填、内容也空,这段占位才会在提示词里被去掉 —— 那才值得提醒。
var missing = 0
Object.keys(st.inputs).forEach(function (k) { if (!String(st.inputs[k].value || '').trim()) missing++ })
if (missing) { st.warn.style.display = ''; st.warn.textContent = '还有 ' + missing + ' 个变量没填(留空的保留 {原样})' }
Object.keys(st.inputs).forEach(function (k) { if (!String(st.inputs[k].value || '').trim() && !st.defOf(k).trim()) missing++ })
if (missing) { st.warn.style.display = ''; st.warn.textContent = '还有 ' + missing + ' 个变量既没填写也没内容(提示词里会去掉这段)' }
else st.warn.style.display = 'none'
}
function scheduleUpdate (st, d) {
if (st.timer) clearTimeout(st.timer)
st.timer = setTimeout(function () {
var vals = {}
Object.keys(st.inputs).forEach(function (k) { vals[k] = st.inputs[k].value })
var patch = { vars: vals, text: outputText(String(d.tpl || ''), vals) }
// vars 存**原始输入**(空就是空,输入框下次仍是空的);text 用「输入 || 内容」算,
// 这样用户不填也能得到模板预设的内容,而不是把那段话从提示词里删掉。
var defOf = (typeof st.defOf === 'function') ? st.defOf : function () { return '' }
var raw = {}
Object.keys(st.inputs).forEach(function (k) { raw[k] = st.inputs[k].value })
var eff = {}
Object.keys(raw).forEach(function (k) { eff[k] = String(raw[k] || '') || defOf(k) })
var patch = { vars: raw, text: outputText(String(d.tpl || ''), eff) }
try { st.props.onUpdate(st.node.id, patch) } catch (e) { /* ignore */ }
}, 300)
}
+3 -3
View File
@@ -1,7 +1,7 @@
{
"id": "promptlib",
"name": "提示词库",
"version": "1.11.0",
"version": "1.13.0",
"apiVersion": 1,
"main": "main.js",
"style": "styles.css",
@@ -13,7 +13,7 @@
"提示词"
],
"files": {
"main.js": "0e1bd0f235b05b3edbdccd19ffe24791f0ce82bb5180ebe5a60dcaa6b2ed3ce8",
"styles.css": "23fd4beb4f5b89be1f763ee7221e3dbdafced85afc378cd5cc1a9e03b14d7046"
"main.js": "2108d09bd7cd1d96dfeb8499dac7adacbda659b222606f7d072a2bf8cbf5361a",
"styles.css": "e2ba84f2e4251f461e77c78ca39fc2b5022f169cb1a4eae0aa7ef786f28b6863"
}
}
+19 -4
View File
@@ -146,9 +146,11 @@
.iwb-plp-nthumb{width:44px;height:44px;border-radius:8px;object-fit:cover;flex:0 0 auto}
.iwb-plp-ntitle{font-weight:600;font-size: 13px;line-height:1.3;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.iwb-plp-nvars{display:flex;flex-direction:column;gap:4px}
.iwb-plp-nrow{display:flex;align-items:center;gap:6px;height:26px}
.iwb-plp-nk{width:64px;flex:0 0 64px;color:var(--iwb-text2,#5b6472);font-size: 12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iwb-plp-nin{flex:1;height:24px;font-size: 12px}
/* v1.12.1:标签列定宽(此前是 flex:0 0 auto,宽度跟着名称长短变 ⇒ 每个变量输入框左边缘错位)。
v1.13.0:用户要求按 4 字定宽 ⇒ 56px(12px 字号 × 4 + 8px 余量)。超过 4 字的名称省略号截断,完整名称在 title 里。 */
.iwb-plp-nrow{display:flex;align-items:flex-start;gap:6px;min-height:26px}
.iwb-plp-nk{flex:0 0 56px;width:56px;max-width:56px;padding-top:4px;color:var(--iwb-text2,#5b6472);font-size: 12px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iwb-plp-nin{flex:1 1 auto;min-width:0;height:auto;min-height:24px;padding:2px 8px;line-height:1.5;font-size: 12px;resize:none;overflow-y:hidden}
.iwb-plp-nref{display:flex;align-items:center;gap:6px;font-size: 12px;color:var(--iwb-text2,#5b6472);border-top:1px dashed var(--iwb-border,#e3e5e9);padding-top:6px}
.iwb-plp-nref em{font-style:normal;color:var(--iwb-text2,#8b929c)}
.iwb-plp-nprev{margin-top:2px;border-top:1px dashed var(--iwb-border,#e3e5e9);padding-top:6px;color:var(--iwb-text2,#5b6472);font-size: 12px;line-height:1.6;max-height:88px;overflow:hidden}
@@ -157,7 +159,6 @@
.iwb-plp-emid{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.iwb-plp-vars{border:1px solid var(--iwb-border,#e3e5e9);border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;gap:6px;background:var(--iwb-plugin-surface,#fff)}
.iwb-plp-vhead{display:flex;align-items:center;gap:8px;font-size: 12px;color:var(--iwb-text2,#5b6472)}
.iwb-plp-vhint{color:var(--iwb-text2,#8b929c);font-size:11px}
.iwb-plp-vchips{display:flex;flex-wrap:wrap;gap:6px}
.iwb-plp-vchip{display:inline-flex;align-items:center;gap:4px;padding: 2px 6px;border-radius:6px;background:color-mix(in srgb, var(--iwb-plp-accent, #7c4dff) 10%, transparent);color:var(--iwb-plp-accent, #5a4bd0);font-size: 12px}
.iwb-plp-vx{font-style:normal;cursor:pointer;color:var(--iwb-plp-accent, #8b7ff0);font-weight:700}
@@ -195,6 +196,8 @@
/* v1.6.2:正文上方工具行 */
.iwb-plp-etool{display:flex;align-items:center;gap:8px}
/* v1.13.0:中列变窄时按钮文字会被挤成「+ 插入变 / 量」,按钮不参与收缩,让右边的灰字提示去换行 */
.iwb-plp-insvar{flex:0 0 auto;white-space:nowrap}
.iwb-plp-insvar{border:1px solid var(--iwb-plp-accent,#d9d3ff);background:color-mix(in srgb,var(--iwb-plp-accent,#7c4dff) 8%,transparent);color:var(--iwb-plp-accent,#5a4bd0);font-weight:600}
/* v1.6.5:宿主基础样式的插件作用域副本 —— 宿主改全局样式不再影响插件 */
@@ -419,6 +422,18 @@ body.iwb-plp-dragging, body.iwb-plp-dragging *{user-select:none!important;-webki
.iwb-plp-vi{flex:0 0 auto;width:24px;height:24px;padding:0;border-radius:50%;border:1px solid var(--iwb-border,#dfe3e9);background: var(--iwb-plugin-card, #fff);color: var(--iwb-text-dim, #9aa1ac);font-size:11px;line-height:22px;text-align:center}
.iwb-plp-vi.is-open{background: var(--iwb-plp-accent-soft, #f1ecff);border-color: var(--iwb-plp-accent-border, #d8cbff);color: var(--iwb-plp-accent, #5a3fd0)}
.iwb-plp-vdesc{width:100%;height:28px;margin-top: 6px;border-style:dashed;background: var(--iwb-field, #fbfcfd);font-size: 12px;color: var(--plp-c3, #6b7280)}
/* v1.12.0:变量编辑器折叠两态(收起一行名称+摘要,展开四字段)与内容多行框 */
.iwb-plp-vrow2{cursor:pointer}
.iwb-plp-vcaret{flex:0 0 12px;width:12px;text-align:center;font-size:11px;line-height:32px;color:var(--iwb-text2,#8b929c)}
.iwb-plp-vlabelx{flex:1 1 auto;min-width:0;font-size:13px;line-height:32px;color:var(--iwb-text,#2a2f36);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iwb-plp-vlabelx.is-empty{color:var(--iwb-text2,#8b929c)}
.iwb-plp-vsum{flex:0 0 auto;font-size:11px;line-height:32px;white-space:nowrap;color:var(--iwb-text2,#8b929c)}
.iwb-plp-vfield{display:flex;align-items:flex-start;gap:8px;margin-top:6px}
.iwb-plp-vflabel{flex:0 0 40px;padding-top:8px;font-size:12px;color:var(--iwb-text2,#8b929c)}
.iwb-plp-vbody{flex:1 1 auto;min-width:0}
.iwb-plp-vbody .iwb-input{width:100%}
.iwb-plp-vbody .iwb-plp-vdesc{margin-top:0}
.iwb-plp-vdef{height:auto;min-height:66px;padding:4px 10px;line-height:1.65;font-size:12px;resize:none;overflow-y:hidden}
.iwb-plp-dcov{flex:0 0 auto;width:180px;height:180px;border-radius:12px;overflow:hidden}
.iwb-plp-dvar{background: var(--iwb-plp-accent-soft, #f1ecff);color: var(--iwb-plp-accent, #5a3fd0);border-radius: 6px;padding:0 4px;font-weight:500}
/* v1.7.1:编辑面板视觉精修——输入框比底色更亮、去多余边框、细分隔线 */
+136 -11
View File
@@ -68,6 +68,7 @@ const COLOR_ORDER = [
'surface', 'hover', 'menuBg',
'pluginSurface', 'pluginCard', 'pluginInset', 'pluginHover',
'err', 'ok', 'warn',
'errBg', 'errBd', 'okBg', 'okBd', 'warnBg', 'warnBd',
]
/* 尺度层(L1):只在这里定义一次。@deprecated 的名字保留到 M4 迁移结束。 */
@@ -115,6 +116,7 @@ const SCALE = [
['--iwb-radius-panel', '12px', '面板/工具栏'],
['--iwb-radius-popover', '14px', '浮层/菜单/右键'],
['--iwb-radius-full', '999px', '圆形/药丸'],
['--iwb-font-2xs', '10px', '极小标注:徽标角标/画布坐标/缩略图角标(2026-11-24 承认它,此前 29 处裸写)'],
['--iwb-font-xs', '11px', 'M4 字号:状态栏/徽标'],
['--iwb-font-sm', '12px', '标签/次要正文'],
['--iwb-font-md', '13px', '紧凑正文/工具栏标题'],
@@ -130,6 +132,18 @@ const SCALE = [
['--iwb-tab-h', '28px', '标签高度'],
['--iwb-tab-radius', '7px', '标签圆角'],
['--iwb-control-h', '30px', '表单控件高度:同一行里的输入框与默认按钮必须等高(设置页实测曾是 33 vs 24)'],
['--iwb-bw', '1px', '描边宽度(2026-11-24):常规分隔/控件边框'],
['--iwb-bw-strong', '2px', '强调描边:选中/焦点/危险操作(不要再用 2px 裸值)'],
['--iwb-icon-sm', '14px', '小图标:行内/按钮内'],
['--iwb-icon-md', '16px', '标准图标:工具栏/菜单'],
['--iwb-icon-lg', '18px', '大图标:导航/空态'],
['--iwb-opacity-disabled', '0.45', '禁用态透明度(此前 0.45/0.55 混用)'],
['--iwb-opacity-muted', '0.7', '次要/未激活元素透明度'],
['--iwb-ease-out', 'cubic-bezier(0.16, 1, 0.3, 1)', '入场/展开缓动:快出慢停'],
['--iwb-ease-in-out', 'cubic-bezier(0.4, 0, 0.2, 1)', '状态切换缓动'],
['--iwb-motion-fast', '0.12s', 'M6 动效:悬停/开关/小位移'],
['--iwb-motion-base', '0.15s', 'M6 动效:面板展开/尺寸变化'],
['--iwb-motion-slow', '0.3s', 'M6 动效:整屏过渡/抽屉'],
/* ── 层级表(M4-B2)───────────────────────────────────────────────
* 迁移前 z-index 有 42 种取值,其中「谁盖谁」全靠散落在各处的数字对撞,出过两次真 bug:
@@ -189,6 +203,61 @@ const LIGHT_ONLY = [
['--iwb-nav-w', '52px', '一级导航宽度:左停靠栏/工具栏让位都以它为基准'],
]
/* ── L3 组件作用域(2026-11-24,M6)───────────────────────────────
* 为什么放这里:这 30 个 token 原先手写在 style.css 的 `.iwb-settings-modal` / `.iwb-pop`
* 作用域里 —— 文档有表格、代码有值,但没有单一源、也没有任何断言,已经漂过一次
* (--iwb-pop-w 从 328 被改到 360,文档同步晚了一步)。
* 现在值只在这张表里写,生成进 design-tokens.css;style.css 只留布局属性。
* 一致性断言:tests/design-tokens-component-doc-test.js(文档表格 ↔ tokens.json ↔ CSS)。
*/
const COMPONENT_SCOPED = [
{
selector: '.iwb-settings-modal',
group: 'component.settings',
vars: [
['--iwb-set-label-w', '180px', '标签列宽'],
['--iwb-set-col-gap', 'var(--iwb-space-16)', '标签列与控件列间距'],
['--iwb-set-row-h', '40px', '设置行高'],
['--iwb-set-row-pad-y', 'var(--iwb-space-8)', '行上下内边距'],
['--iwb-set-group-gap', 'var(--iwb-space-32)', '分组之间(规范 §3.11:32px)'],
['--iwb-set-title-gap', 'var(--iwb-space-8)', '分组标题与分组体间距'],
['--iwb-set-group-bg', 'hsl(0 0% 97.6%)', '分组体底色:设计值 #F9F9F9(用 hsl 表达以过 hex 闸门)'],
['--iwb-set-group-radius', 'var(--iwb-radius-card)', '分组体圆角'],
['--iwb-set-group-pad-x', 'var(--iwb-space-20)', '分组体左右内边距'],
['--iwb-set-group-pad-y', 'var(--iwb-space-12)', '分组体上下内边距'],
['--iwb-set-divider', 'color-mix(in srgb, var(--iwb-border) 55%, transparent)', '行分隔线'],
['--iwb-set-hint-color', 'var(--iwb-text-dim)', '说明文字色'],
['--iwb-set-hint-size', 'var(--iwb-font-xs)', '说明文字字号'],
['--iwb-set-hint-gap', 'var(--iwb-space-2)', '说明文字上间距'],
['--iwb-set-input-border', 'color-mix(in srgb, var(--iwb-border) 40%, var(--iwb-panel))', '输入框描边'],
['--iwb-set-check-size', '16px', '复选项尺寸'],
['--iwb-set-check-radius', '4px', '复选项圆角'],
['--iwb-set-btn-gap', 'var(--iwb-space-8)', '操作按钮间距'],
],
dark: [
['--iwb-set-group-bg', 'color-mix(in srgb, var(--iwb-text) 8%, var(--iwb-panel))', '暗色分组体:文字色 8% 混面板'],
],
},
{
selector: '.iwb-pop',
group: 'component.popover',
vars: [
['--iwb-pop-w', '360px', '面板宽度(窄屏靠 max-width 兜底)'],
['--iwb-pop-pad-y', 'var(--iwb-space-10)', '面板上下内边距'],
['--iwb-pop-pad-x', 'var(--iwb-space-12)', '面板左右内边距'],
['--iwb-pop-gap', 'var(--iwb-space-8)', '分组之间'],
['--iwb-pop-radius', 'var(--iwb-radius-popover)', '面板圆角'],
['--iwb-pop-title-size', 'var(--iwb-font-base)', '面板标题字号'],
['--iwb-pop-chip-h', '28px', '选择项/下拉/数字框高度'],
['--iwb-pop-chip-pad-x', 'var(--iwb-space-10)', '选择项左右内边距'],
['--iwb-pop-chip-radius', '6px', '选择项圆角'],
['--iwb-pop-chip-gap', 'var(--iwb-space-6)', '选择项间距'],
['--iwb-pop-chip-size', 'var(--iwb-font-md)', '选择项字号'],
],
dark: [],
},
]
/* 暗色独有的动效:亮色用品牌色,暗色必须用「亮色元素 + 深色轨道」 */
const DARK_ANIM = [
['--iwb-anim', '#ffffff'],
@@ -268,6 +337,7 @@ function buildCss () {
L.push(...colorDecls(LIGHT, ['pluginSurface', 'pluginCard', 'pluginInset', 'pluginHover', 'surface', 'hover', 'menuBg']))
L.push(' /* —— 语义色 —— */')
L.push(...colorDecls(LIGHT, ['err', 'ok', 'warn']))
L.push(...colorDecls(LIGHT, ['errBg', 'errBd', 'okBg', 'okBd', 'warnBg', 'warnBd']))
L.push(' /* —— 尺度层(L1)—— */')
L.push(...SCALE.map(decl))
L.push(' /* —— 阴影 —— */')
@@ -295,30 +365,66 @@ function buildCss () {
L.push(...LIGHT_ANIM.map(decl))
L.push('}')
L.push('')
/* —— L3 组件作用域(见 COMPONENT_SCOPED) —— */
for (const c of COMPONENT_SCOPED) {
L.push('')
L.push('/* ' + c.group + ':由 gen-tokens 生成,勿手改;布局属性仍在 style.css */')
L.push(c.selector + ' {')
for (const [name, value, desc] of c.vars) L.push(' ' + name + ': ' + value + ';' + (desc ? ' /* ' + desc + ' */' : ''))
L.push('}')
if (c.dark && c.dark.length) {
L.push('')
L.push('/* ' + c.group + ' · 暗色覆盖 */')
L.push('.theme-dark ' + c.selector + ' {')
for (const [name, value, desc] of c.dark) L.push(' ' + name + ': ' + value + ';' + (desc ? ' /* ' + desc + ' */' : ''))
L.push('}')
}
}
return L.join('\n')
}
/* ── DTCG 导出 ──────────────────────────────────────────────
* 解析生成好的 CSS(而不是再 derive 一遍):保证「导出的 JSON == 实际生效的 CSS」。
* 关系式(color-mix / var)不是值,跳过 —— 它们在 Figma/Penpot 里没有对应概念。 */
function parseDeclBody (body) {
const d = {}
const dre = /(--[a-z0-9-]+)\s*:\s*([^;]+);/g
let x
while ((x = dre.exec(body.replace(/\/\*[\s\S]*?\*\//g, '')))) d[x[1]] = x[2].trim()
return d
}
function parseBlocks (css) {
const out = {}
const comp = {}
// 先摘出 L3 组件作用域(亮色 + .theme-dark 覆盖)。必须在主循环之前:
// 主循环的 .theme-dark 分支会把 `.theme-dark .iwb-pop {…}` 当成整块暗色主题,把真正的暗色值覆盖掉。
const compRe = /(\.theme-dark\s+)?(\.iwb-settings-modal|\.iwb-pop)\s*\{([\s\S]*?)\n\}/g
let cm
while ((cm = compRe.exec(css))) comp[(cm[1] ? 'dark:' : '') + cm[2]] = parseDeclBody(cm[3])
css = css.replace(compRe, '')
const re = /(:root:not\(\.theme-dark\)|:root|\.theme-dark)\s*\{([\s\S]*?)\n\}/g
let m
while ((m = re.exec(css))) {
const body = m[2].replace(/\/\*[\s\S]*?\*\//g, '')
const d = {}
const dre = /(--[a-z0-9-]+)\s*:\s*([^;]+);/g
let x
while ((x = dre.exec(body))) d[x[1]] = x[2].trim()
out[m[1]] = d
}
return out
while ((m = re.exec(css))) out[m[1]] = parseDeclBody(m[2])
return { blocks: out, comp: comp }
}
// 这些值推断不出类型(关系式 / 复合值 / 纯数字),但对外的 DTCG 清单必须覆盖到
const TYPE_HINT = {
'--iwb-focus-ring': 'border',
'--iwb-edge-dash': 'string',
'--iwb-grid-on': 'number',
}
function inferType (value, name) {
if (TYPE_HINT[name]) return TYPE_HINT[name]
if (/^#[0-9a-f]{3,8}$/i.test(value)) return 'color'
if (/^rgba?\(/i.test(value)) return 'color'
if (/^cubic-bezier\(/.test(value)) return 'cubicBezier'
// 组件作用域里的几何值:纯 px / var() 别名 / color-mix 关系式
if (/^var\(--iwb-[a-z0-9-]+\)$/.test(value)) return /(?:-bg|-border|-text|-color|^--iwb-(?:err|ok|warn|chrome|home|dock|hr|edge))/i.test(name) ? 'color' : 'dimension'
if (/^color-mix\(/.test(value) || /^hsl\(/.test(value)) return 'color'
if (/-bg$|-bd$|-border$/.test(name) && /^[^;]+$/.test(value)) return null
if (/^--iwb-opacity-/.test(name) && /^[\d.]+$/.test(value)) return 'number'
if (/^-?[\d.]+px$/.test(value)) return 'dimension'
if (/^-?[\d.]+m?s$/.test(value)) return 'duration'
if (/\d+px [\d.]+px/.test(value)) return 'shadow'
@@ -339,12 +445,19 @@ function groupOf (name) {
if (/^fs-/.test(n)) return 'legacy.font'
if (/^font-/.test(n)) return 'font.size'
if (/^tr-/.test(n)) return 'motion'
if (/^motion-/.test(n)) return 'motion'
if (/^elevation-/.test(n)) return 'shadow.elevation'
if (/^sh-/.test(n)) return 'shadow'
if (/^z-/.test(n)) return 'z'
if (n === 'grid-dot') return 'color'
if (/^(grid-|nav-|node-radius|node-sel-w|edge-w|edge-dash|chrome-h|tab-h|tab-radius|control-h)/.test(n)) return 'layout'
if (/^plugin-/.test(n)) return 'color.plugin'
if (/^set-/.test(n)) return 'component.settings'
if (/^pop-/.test(n)) return 'component.popover'
if (/^opacity-/.test(n)) return 'opacity'
if (/^ease-/.test(n)) return 'motion.ease'
if (/^icon-/.test(n)) return 'icon'
if (/^bw(-|$)/.test(n)) return 'border.width'
return 'color'
}
@@ -359,10 +472,18 @@ function dtcgKey (name) {
if (/^fs-/.test(n)) return n.slice(3)
if (/^font-/.test(n)) return n.slice(5)
if (/^tr-/.test(n)) return n.slice(3)
if (/^motion-/.test(n)) return 'ms-' + n.slice(7)
if (/^elevation-/.test(n)) return n.slice(10)
if (/^sh-/.test(n)) return n.slice(3)
if (/^z-/.test(n)) return n.slice(2)
if (/^plugin-/.test(n)) return n.slice(7)
if (/^set-/.test(n)) return n.slice(4)
if (/^pop-/.test(n)) return n.slice(4)
if (/^opacity-/.test(n)) return n.slice(8)
if (/^ease-/.test(n)) return n.slice(5)
if (/^icon-/.test(n)) return n.slice(5)
if (n === 'bw') return 'base'
if (/^bw-/.test(n)) return n.slice(3)
return n
}
@@ -377,9 +498,12 @@ function put (root, groupPath, key, node) {
}
function buildJson (css) {
const blocks = parseBlocks(css)
const parsed = parseBlocks(css)
const blocks = parsed.blocks
const light = Object.assign({}, blocks[':root'] || {}, blocks[':root:not(.theme-dark)'] || {})
const dark = blocks['.theme-dark'] || {}
// L3 组件作用域:亮色并进同一张表(靠 groupOf 的 component.* 分支分到独立组),暗色作为 $extensions
Object.assign(light, parsed.comp['.iwb-settings-modal'] || {}, parsed.comp['.iwb-pop'] || {})
const root = {}
const skipped = []
for (const name of Object.keys(light)) {
@@ -393,7 +517,8 @@ function buildJson (css) {
} else {
node = { $value: value, $type: type }
}
if (dark[name]) node.$extensions = { 'com.image-workbench.dark': { $value: dark[name], $type: type } }
const darkVal = dark[name] || (parsed.comp['dark:.iwb-settings-modal'] || {})[name] || (parsed.comp['dark:.iwb-pop'] || {})[name]
if (darkVal) node.$extensions = { 'com.image-workbench.dark': { $value: darkVal, $type: type } }
put(root, groupOf(name), dtcgKey(name), node)
}
return { root, skipped }
+99
View File
@@ -0,0 +1,99 @@
'use strict'
/* 行数棘轮指标的**唯一测量实现** + 文档硬数字的**唯一改写/校验规则**(2026-11-24,P0-②)
*
* 为什么需要:MAX_APP_JS_LINES 等上限被抄进 CONTRIBUTING.md 与 architecture-current-state.md,
* 此前**没有任何校验**,实际已漂 415 行(文档写 8,700,真实上限 9,115)。
* sync-facts(改写)与 architecture-facts-guard(断言)若各写一套正则,会出现
* 「同步器说改了、守卫说没改」—— 所以规则只放在这里。
*
* 口径与 tests/source-text-ratchet-test.js 一致(那边是权威断言方)。
*/
const fs = require('fs')
const path = require('path')
const root = path.resolve(__dirname, '..')
const NL = String.fromCharCode(10)
const fmtInt = (n) => Number(n).toLocaleString('en-US')
function readCaps () {
const src = fs.readFileSync(path.join(root, 'tests', 'source-text-ratchet-test.js'), 'utf8')
const num = (name) => {
const m = new RegExp('MAX_' + name + ' = ([0-9.]+)').exec(src)
if (!m) throw new Error('未找到 MAX_' + name + '(棘轮测试改名了?)')
return Number(m[1])
}
return {
appJsLines: num('APP_JS_LINES'),
workbenchLines: num('WORKBENCH_LINES'),
appComponentLines: num('APP_COMPONENT_LINES'),
appJsShare: num('APP_JS_SHARE')
}
}
function measure () {
const appSrc = fs.readFileSync(path.join(root, 'app.js'), 'utf8')
const appLines = appSrc.split(NL).length
const srcDir = path.join(root, 'src')
const srcFiles = fs.readdirSync(srcDir).filter((n) => n.endsWith('.js'))
let srcLines = 0
for (const f of srcFiles) srcLines += fs.readFileSync(path.join(srcDir, f), 'utf8').split(NL).length
// Workbench():按大括号深度找函数结尾(与棘轮测试同一算法)
const lines = appSrc.split(NL)
const start = lines.findIndex((l) => l.startsWith(' function Workbench('))
let wbLines = 0
if (start >= 0) {
let depth = 0, started = false
for (let j = start; j < lines.length; j++) {
for (const ch of lines[j]) {
if (ch === '{') { depth++; started = true } else if (ch === '}') depth--
}
if (started && depth === 0) { wbLines = j - start + 1; break }
}
}
const share = appLines / (appLines + srcLines)
return {
appLines,
srcFiles: srcFiles.length,
srcLines,
workbenchLines: wbLines,
share,
sharePct: (share * 100).toFixed(1),
caps: readCaps()
}
}
/* ── 文档规则:build(m, ...captures) 返回整段替换文本 ── */
const RULES = {
contributing: [
{ key: 'MAX_APP_JS_LINES', re: /`MAX_APP_JS_LINES` \| \*\*[\d,]+\*\*/g, build: (m) => '`MAX_APP_JS_LINES` | **' + fmtInt(m.caps.appJsLines) + '**' },
{ key: 'MAX_WORKBENCH_LINES', re: /`MAX_WORKBENCH_LINES` \| \*\*[\d,]+\*\*/g, build: (m) => '`MAX_WORKBENCH_LINES` | **' + fmtInt(m.caps.workbenchLines) + '**' },
{ key: 'MAX_APP_COMPONENT_LINES', re: /`MAX_APP_COMPONENT_LINES` \| \*\*[\d,]+\*\*/g, build: (m) => '`MAX_APP_COMPONENT_LINES` | **' + fmtInt(m.caps.appComponentLines) + '**' }
],
arch: [
{ key: 'appLines', re: /(`app\.js` = 单 IIFE )\*\*[\d,]+ 行\*\*/g, build: (m, p1) => p1 + '**' + fmtInt(m.appLines) + ' 行**' },
{ key: 'appJsCap', re: /(绝对上限 )[\d,]+/g, build: (m, p1) => p1 + fmtInt(m.caps.appJsLines) },
{ key: 'workbenchLines', re: /(`Workbench\(\)` = )\*\*[\d,]+ 行\*\*/g, build: (m, p1) => p1 + '**' + fmtInt(m.workbenchLines) + ' 行**' },
{ key: 'workbenchCap', re: /((上限 )\*\*[\d,]+\*\*(,余量 )\d+/g, build: (m, p1, p2) => p1 + '**' + fmtInt(m.caps.workbenchLines) + '**' + p2 + String(Math.max(0, m.caps.workbenchLines - m.workbenchLines)) },
{ key: 'sharePct', re: /(现 )\*\*[\d.]+%\*\*(,2026-11-12 起)/g, build: (m, p1, p2) => p1 + '**' + m.sharePct + '%**' + p2 },
{ key: 'srcFiles', re: /(现 )\*\*[\d,]+\*\* 个模块/g, build: (m, p1) => p1 + '**' + fmtInt(m.srcFiles) + '** 个模块' },
{ key: 'srcLines', re: /(个模块 \/ )[\d,]+ 行/g, build: (m, p1) => p1 + fmtInt(m.srcLines) + ' 行' }
]
}
/** 改写文档里的硬数字;返回 { text, changed: [key] }。changed 为空 = 已经一致。 */
function rewriteDoc (kind, text, m) {
const rules = RULES[kind] || []
let out = text
const changed = []
for (const rule of rules) {
const before = out
out = out.replace(rule.re, (all, ...caps) => rule.build(m, ...caps.slice(0, -2)))
if (out !== before) changed.push(rule.key)
}
return { text: out, changed }
}
module.exports = { measure, readCaps, rewriteDoc, RULES, fmtInt }
+25 -3
View File
@@ -85,10 +85,21 @@ for (const [re, rep] of archWant) {
arch = arch.replace(re, rep)
if (arch !== before) archChanged = true
}
// ── ④b 行数棘轮硬数字(2026-11-24,P0-②)──
// 为什么单列一步:CONTRIBUTING / 架构文档里抄着 MAX_APP_JS_LINES 等上限,
// 此前无人校验,实测已漂 415 行。测量与改写规则在 scripts/ratchet-metrics.js
// (守卫 tests/architecture-facts-guard-test.js 用同一份规则断言,口径不会分叉)。
const rm = require('./ratchet-metrics')
const metrics = rm.measure()
const archRatchet = rm.rewriteDoc('arch', arch, metrics)
arch = archRatchet.text
if (archRatchet.changed.length) archChanged = true
if (archChanged) {
diffs.push(' ✗ 架构文档计数过时(可 --write 自动修 4 处)')
diffs.push(' ✗ 架构文档计数/棘轮数字过时(可 --write 自动修;棘轮项:' + (archRatchet.changed.join(', ') || '无') + ')')
if (WRITE) write(archPath, arch)
} else report.push(' · 架构文档计数(一致)')
} else report.push(' · 架构文档计数与棘轮数字(一致)')
// 单测文件数:test:unit 里 node tests/*.js 的个数
const pkg = JSON.parse(read('package.json'))
@@ -98,13 +109,24 @@ const contribPath = 'CONTRIBUTING.md'
let contrib = read(contribPath)
const contribRe = /test:unit {2,}\d+ 个单测文件/
const m = contrib.match(contribRe)
let contribChanged = false
if (m) {
const cur = Number(m[0].match(/(\d+) 个/)[1])
if (cur !== unitCount) {
contribChanged = true
diffs.push(' ✗ CONTRIBUTING 单测文件数: ' + cur + ' → ' + unitCount)
if (WRITE) { write(contribPath, contrib.replace(contribRe, 'test:unit ' + unitCount + ' 个单测文件')); }
contrib = contrib.replace(contribRe, 'test:unit ' + unitCount + ' 个单测文件')
} else report.push(' · CONTRIBUTING 单测文件数: ' + unitCount + '(一致)')
}
// 棘轮上限三个数字(同一份规则,见 scripts/ratchet-metrics.js)
const contribRatchet = rm.rewriteDoc('contributing', contrib, metrics)
if (contribRatchet.changed.length) {
contribChanged = true
diffs.push(' ✗ CONTRIBUTING 棘轮上限过时:' + contribRatchet.changed.join(', '))
}
contrib = contribRatchet.text
if (contribChanged) { if (WRITE) write(contribPath, contrib) }
else report.push(' · CONTRIBUTING 棘轮上限(一致)')
// ── 输出 ──
console.log('\n事实同步器(' + (WRITE ? '写入模式' : 'dry-run') + ')\n')
+2 -2
View File
@@ -3,7 +3,7 @@
<title>插件开发规范 · Image Workbench</title>
<link rel="icon" href="/assets/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/assets/logo.png">
<link rel="stylesheet" href="/assets/style.css?v=3.26.60-mwuecf3f">
<link rel="stylesheet" href="/assets/style.css?v=3.26.63-mwuqcxox">
<style>
.devdoc{max-width:860px;margin:0 auto;padding:40px 0 72px;color:var(--ink,#1b1f24);font-size:15px;line-height:1.75}
.devdoc h1{font-size:38px;line-height:1.2;margin:8px 0 18px}
@@ -33,7 +33,7 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.26.60</a>
<a class="btn primary" href="/download/">下载 v3.26.63</a>
</div>
</div></nav>
<main>
+18 -6
View File
@@ -57,18 +57,18 @@
<h2>下载</h2>
<div class="row">
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
<div class="meta">版本 3.26.60 · 8.4 MB · .dmg<div class="hash">sha256 e3cd2adff23b1d2b…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.60_aarch64.dmg?h=e3cd2adff23b">下载</a>
<div class="meta">版本 3.26.63 · 8.4 MB · .dmg<div class="hash">sha256 f120d77388000a6c…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.63_aarch64.dmg?h=f120d7738800">下载</a>
</div>
<div class="row">
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
<div class="meta">版本 3.26.60 · 8.8 MB · .dmg<div class="hash">sha256 1dd4ce4fa5b47a09…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.60_x64.dmg?h=1dd4ce4fa5b4">下载</a>
<div class="meta">版本 3.26.63 · 8.8 MB · .dmg<div class="hash">sha256 45b39f572b643cff…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.63_x64.dmg?h=45b39f572b64">下载</a>
</div>
<div class="row">
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
<div class="meta">版本 3.26.60 · 4.8 MB · .exe<div class="hash">sha256 9c41e7a6f438b6a3…</div></div>
<a class="btn" href="/updates/windows-x86_64/image-workbench_3.26.60_x64-setup.exe?h=9c41e7a6f438">下载</a>
<div class="meta"></div>
<span class="muted">暂未提供</span>
</div>
<h2>系统要求</h2>
@@ -97,6 +97,18 @@
</ol>
<h2>历史版本</h2>
<div class="row">
<div class="name">3.26.63</div>
<div class="meta">2026-11-24<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.62</div>
<div class="meta">2026-11-24<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.26.61<div class="hint">图库修复:出图即入图库、插入落地本地副本(画布可标注)、批量插入不再叠图</div></div>
<div class="meta">2026-11-24<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
</div>
<div class="row">
<div class="name">3.26.60<div class="hint">浮层字号上调一档:模型设置/图像设置的选择项 11→13px、高 28px,面板 360px</div></div>
<div class="meta">2026-11-24<div class="hint">macOS · Apple Silicon / macOS · Intel / Windows · x64</div></div>
+10 -10
View File
@@ -4,7 +4,7 @@
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
<link rel="icon" href="/assets/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/assets/logo.png">
<link rel="stylesheet" href="/assets/style.css?v=3.26.60-mwuecf3f">
<link rel="stylesheet" href="/assets/style.css?v=3.26.63-mwuqcxox">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><img class="logo" src="/assets/logo.png" alt="" width="26" height="26">Image Workbench</a>
@@ -17,19 +17,19 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.26.60</a>
<a class="btn primary" href="/download/">下载 v3.26.63</a>
</div>
</div></nav>
<main>
<section class="hero hero-art">
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.60-mwuecf3f" alt=""></div>
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.63-mwuqcxox" alt=""></div>
<div class="hero-veil"></div>
<div class="wrap">
<span class="kicker">v3.26.60 · macOS / Windows · 数据在本地</span>
<span class="kicker">v3.26.63 · macOS / Windows · 数据在本地</span>
<h1>本地优先的<br>AI 生图无限画布</h1>
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
<div class="cta">
<a class="btn primary lg" href="/download/">下载 v3.26.60</a>
<a class="btn primary lg" href="/download/">下载 v3.26.63</a>
<a class="btn lg" href="/plugins/">浏览 12 个插件</a>
</div>
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
@@ -73,7 +73,7 @@
</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.12 · 官方</div></div></div>
<div><div class="nm">图库</div><div class="ver">v1.7.0 · 官方</div></div></div>
<div class="desc">右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)</div>
<div class="tags"><span class="tag">资源</span><span class="tag">图库</span></div>
</div>
@@ -85,7 +85,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.11.0 · 官方</div></div></div>
<div><div class="nm">提示词库</div><div class="ver">v1.13.0 · 官方</div></div></div>
<div class="desc">右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)</div>
<div class="tags"><span class="tag">资源</span><span class="tag">提示词</span></div>
</div>
@@ -96,9 +96,9 @@
<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.26.60_aarch64.dmg?h=e3cd2adff23b"><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.60_x64.dmg?h=1dd4ce4fa5b4"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
<a href="/updates/windows-x86_64/image-workbench_3.26.60_x64-setup.exe?h=9c41e7a6f438"><div class="n">Windows · x64</div><div class="s">需要 WebView2 · 4.8 MB · .exe</div></a></div>
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.63_aarch64.dmg?h=f120d7738800"><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.63_x64.dmg?h=45b39f572b64"><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>
</main>
+18 -18
View File
@@ -1,6 +1,6 @@
{
"version": 2,
"updatedAt": "2026-11-24T07:15:05.519Z",
"updatedAt": "2026-11-24T10:52:45.289Z",
"plugins": [
{
"id": "batch-export",
@@ -112,21 +112,21 @@
"资源",
"图库"
],
"version": "1.6.12",
"version": "1.7.0",
"apiVersion": 1,
"bundle": "plugins/gallery-1.6.12.zip",
"bundleSize": 35709,
"bundleSha256": "66f1a6006dec90d39db398f72311d638903a8a56c31928891d596bb5ed19a846",
"bundle": "plugins/gallery-1.7.0.zip",
"bundleSize": 38168,
"bundleSha256": "0289819359794af974f9ac7ac5bb4b1b483cfe8ebb54af4e9bb09325a5292fc0",
"files": [
{
"path": "manifest.json",
"sha256": "98a3d7ea8c82c674db22c95c055f4358bb31772a64bf2bf6f9af19e9570cd1c1",
"size": 527
"sha256": "923879db7a998af026a1c7d61969ed8dc3045ef9704739365c411baead7520bd",
"size": 526
},
{
"path": "main.js",
"sha256": "a5fb039684937de44d1033c75d9872b9e6d1c8c2c9582cd5feee948562e9b7d1",
"size": 29677
"sha256": "77b8e95c06c6811fdee3a832195e2b76bc6197d8bfdf9df0a47a52b6b4dfb38f",
"size": 32137
},
{
"path": "styles.css",
@@ -180,26 +180,26 @@
"资源",
"提示词"
],
"version": "1.11.0",
"version": "1.13.0",
"apiVersion": 1,
"bundle": "plugins/promptlib-1.11.0.zip",
"bundleSize": 167890,
"bundleSha256": "66fca4b8c06b2e399383d095c92604c5c23b520238379bbf8bfa89c4c86a08ad",
"bundle": "plugins/promptlib-1.13.0.zip",
"bundleSize": 184934,
"bundleSha256": "af0116e04312e98d2915dd67a6610082c3593e425e29732004b40dfc0bf8b676",
"files": [
{
"path": "manifest.json",
"sha256": "15212a82a8ad8bf1195598740077125dbee8f3f210d7426ec38a7bdf2abe07bc",
"sha256": "9b801ebab1896dd2032a802389b616794632f56846521574225e23e2681600db",
"size": 541
},
{
"path": "main.js",
"sha256": "0e1bd0f235b05b3edbdccd19ffe24791f0ce82bb5180ebe5a60dcaa6b2ed3ce8",
"size": 122957
"sha256": "2108d09bd7cd1d96dfeb8499dac7adacbda659b222606f7d072a2bf8cbf5361a",
"size": 138415
},
{
"path": "styles.css",
"sha256": "23fd4beb4f5b89be1f763ee7221e3dbdafced85afc378cd5cc1a9e03b14d7046",
"size": 44082
"sha256": "e2ba84f2e4251f461e77c78ca39fc2b5022f169cb1a4eae0aa7ef786f28b6863",
"size": 45668
}
]
},
+4 -4
View File
@@ -3,7 +3,7 @@
<title>插件市场 · Image Workbench</title>
<link rel="icon" href="/assets/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/assets/logo.png">
<link rel="stylesheet" href="/assets/style.css?v=3.26.60-mwuecf3f">
<link rel="stylesheet" href="/assets/style.css?v=3.26.63-mwuqcxox">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><img class="logo" src="/assets/logo.png" alt="" width="26" height="26">Image Workbench</a>
@@ -16,7 +16,7 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.26.60</a>
<a class="btn primary" href="/download/">下载 v3.26.63</a>
</div>
</div></nav>
<main>
@@ -68,7 +68,7 @@
</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.12 · 官方</div></div></div>
<div><div class="nm">图库</div><div class="ver">v1.7.0 · 官方</div></div></div>
<div class="desc">右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)</div>
<div class="tags"><span class="tag">资源</span><span class="tag">图库</span></div>
</div>
@@ -80,7 +80,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.11.0 · 官方</div></div></div>
<div><div class="nm">提示词库</div><div class="ver">v1.13.0 · 官方</div></div></div>
<div class="desc">右栏提示词列表:搜索/分组/收藏/新建编辑/插入画布/复制(数据由客户端提供)</div>
<div class="tags"><span class="tag">资源</span><span class="tag">提示词</span></div>
</div>
+71 -1
View File
@@ -1,8 +1,78 @@
{
"app": "Image Workbench",
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
"updatedAt": "2026-11-24T07:52:04.104Z",
"updatedAt": "2026-11-24T13:28:23.598Z",
"releases": [
{
"version": "3.26.63",
"date": "2026-11-24",
"notes": "",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.26.63_aarch64.dmg",
"size": 8804160,
"sha256": "f120d77388000a6c98d64937c575cca98965e2b64475563a7e40970d083238fe",
"h": "f120d7738800",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.26.63_x64.dmg",
"size": 9193234,
"sha256": "45b39f572b643cff2b6e9a560887b4747c1e817a701bee982700a405bc0e4fe2",
"h": "45b39f572b64",
"kind": "dmg"
}
}
},
{
"version": "3.26.62",
"date": "2026-11-24",
"notes": "",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.26.62_aarch64.dmg",
"size": 8800819,
"sha256": "5a611553eff11552d4468dad12d28b4942e16d7d52faf6568a2e248d5f4682d1",
"h": "5a611553eff1",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.26.62_x64.dmg",
"size": 9194494,
"sha256": "4e240818ab18dfb21c51d79dbd714e7bcfd11aab1e7760cbc53ce72685006816",
"h": "4e240818ab18",
"kind": "dmg"
}
}
},
{
"version": "3.26.61",
"date": "2026-11-24",
"notes": "图库修复:出图即入图库、插入落地本地副本(画布可标注)、批量插入不再叠图",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.26.61_aarch64.dmg",
"size": 8799439,
"sha256": "d8921e905130268fbec91d18991c8836d75c634e354baa30987300e832df1a1d",
"h": "d8921e905130",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.26.61_x64.dmg",
"size": 9191382,
"sha256": "840302aa03c17b38fdd8e2b66e246588536a5e4fb7ef0006f69b87aae2605712",
"h": "840302aa03c1",
"kind": "dmg"
},
"windows-x86_64": {
"file": "updates/windows-x86_64/image-workbench_3.26.61_x64-setup.exe",
"size": 5014656,
"sha256": "93ff30f82f1b936847bfc69a89af48531472502ed420714bb071e5c2844bce6c",
"h": "93ff30f82f1b",
"kind": "exe"
}
}
},
{
"version": "3.26.60",
"date": "2026-11-24",
+1 -1
View File
@@ -1983,7 +1983,7 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.26.60"
version = "3.26.63"
dependencies = [
"arboard",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.26.61"
version = "3.26.63"
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.26.61",
"version": "3.26.63",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
+62
View File
@@ -72,6 +72,12 @@
--iwb-err: #b91c1c;
--iwb-ok: #15803d;
--iwb-warn: #b45309;
--iwb-err-bg: #f1e1e1;
--iwb-err-bd: #dfa4a4;
--iwb-ok-bg: #e0ebe4;
--iwb-ok-bd: #a1cab0;
--iwb-warn-bg: #f0e7df;
--iwb-warn-bd: #deb99d;
/* —— 尺度层(L1)—— */
--sp-1: 4px; /* @deprecated 全部 5 个 → M3 的 --iwb-space-4/8/12/16/24 */
--sp-2: 8px;
@@ -109,6 +115,7 @@
--iwb-radius-panel: 12px; /* 面板/工具栏 */
--iwb-radius-popover: 14px; /* 浮层/菜单/右键 */
--iwb-radius-full: 999px; /* 圆形/药丸 */
--iwb-font-2xs: 10px; /* 极小标注:徽标角标/画布坐标/缩略图角标(2026-11-24 承认它,此前 29 处裸写) */
--iwb-font-xs: 11px; /* M4 字号:状态栏/徽标 */
--iwb-font-sm: 12px; /* 标签/次要正文 */
--iwb-font-md: 13px; /* 紧凑正文/工具栏标题 */
@@ -121,6 +128,18 @@
--iwb-tab-h: 28px; /* 标签高度 */
--iwb-tab-radius: 7px; /* 标签圆角 */
--iwb-control-h: 30px; /* 表单控件高度:同一行里的输入框与默认按钮必须等高(设置页实测曾是 33 vs 24) */
--iwb-bw: 1px; /* 描边宽度(2026-11-24):常规分隔/控件边框 */
--iwb-bw-strong: 2px; /* 强调描边:选中/焦点/危险操作(不要再用 2px 裸值) */
--iwb-icon-sm: 14px; /* 小图标:行内/按钮内 */
--iwb-icon-md: 16px; /* 标准图标:工具栏/菜单 */
--iwb-icon-lg: 18px; /* 大图标:导航/空态 */
--iwb-opacity-disabled: 0.45; /* 禁用态透明度(此前 0.45/0.55 混用) */
--iwb-opacity-muted: 0.7; /* 次要/未激活元素透明度 */
--iwb-ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* 入场/展开缓动:快出慢停 */
--iwb-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); /* 状态切换缓动 */
--iwb-motion-fast: 0.12s; /* M6 动效:悬停/开关/小位移 */
--iwb-motion-base: 0.15s; /* M6 动效:面板展开/尺寸变化 */
--iwb-motion-slow: 0.3s; /* M6 动效:整屏过渡/抽屉 */
--iwb-z-ctx: 90; /* 右键遮罩 */
--iwb-z-ctx-menu: 91; /* 右键菜单 */
--iwb-z-curtain: 100; /* 应用遮罩 / 图片预览底 */
@@ -208,3 +227,46 @@
--iwb-anim-flow-a: color-mix(in srgb, var(--iwb-brand) 16%, var(--iwb-layer));
--iwb-anim-flow-b: color-mix(in srgb, var(--iwb-brand) 46%, var(--iwb-layer));
}
/* component.settings:由 gen-tokens 生成,勿手改;布局属性仍在 style.css */
.iwb-settings-modal {
--iwb-set-label-w: 180px; /* 标签列宽 */
--iwb-set-col-gap: var(--iwb-space-16); /* 标签列与控件列间距 */
--iwb-set-row-h: 40px; /* 设置行高 */
--iwb-set-row-pad-y: var(--iwb-space-8); /* 行上下内边距 */
--iwb-set-group-gap: var(--iwb-space-32); /* 分组之间(规范 §3.11:32px) */
--iwb-set-title-gap: var(--iwb-space-8); /* 分组标题与分组体间距 */
--iwb-set-group-bg: hsl(0 0% 97.6%); /* 分组体底色:设计值 #F9F9F9(用 hsl 表达以过 hex 闸门) */
--iwb-set-group-radius: var(--iwb-radius-card); /* 分组体圆角 */
--iwb-set-group-pad-x: var(--iwb-space-20); /* 分组体左右内边距 */
--iwb-set-group-pad-y: var(--iwb-space-12); /* 分组体上下内边距 */
--iwb-set-divider: color-mix(in srgb, var(--iwb-border) 55%, transparent); /* 行分隔线 */
--iwb-set-hint-color: var(--iwb-text-dim); /* 说明文字色 */
--iwb-set-hint-size: var(--iwb-font-xs); /* 说明文字字号 */
--iwb-set-hint-gap: var(--iwb-space-2); /* 说明文字上间距 */
--iwb-set-input-border: color-mix(in srgb, var(--iwb-border) 40%, var(--iwb-panel)); /* 输入框描边 */
--iwb-set-check-size: 16px; /* 复选项尺寸 */
--iwb-set-check-radius: 4px; /* 复选项圆角 */
--iwb-set-btn-gap: var(--iwb-space-8); /* 操作按钮间距 */
}
/* component.settings · 暗色覆盖 */
.theme-dark .iwb-settings-modal {
--iwb-set-group-bg: color-mix(in srgb, var(--iwb-text) 8%, var(--iwb-panel)); /* 暗色分组体:文字色 8% 混面板 */
}
/* component.popover:由 gen-tokens 生成,勿手改;布局属性仍在 style.css */
.iwb-pop {
--iwb-pop-w: 360px; /* 面板宽度(窄屏靠 max-width 兜底) */
--iwb-pop-pad-y: var(--iwb-space-10); /* 面板上下内边距 */
--iwb-pop-pad-x: var(--iwb-space-12); /* 面板左右内边距 */
--iwb-pop-gap: var(--iwb-space-8); /* 分组之间 */
--iwb-pop-radius: var(--iwb-radius-popover); /* 面板圆角 */
--iwb-pop-title-size: var(--iwb-font-base); /* 面板标题字号 */
--iwb-pop-chip-h: 28px; /* 选择项/下拉/数字框高度 */
--iwb-pop-chip-pad-x: var(--iwb-space-10); /* 选择项左右内边距 */
--iwb-pop-chip-radius: 6px; /* 选择项圆角 */
--iwb-pop-chip-gap: var(--iwb-space-6); /* 选择项间距 */
--iwb-pop-chip-size: var(--iwb-font-md); /* 选择项字号 */
}
+1 -7
View File
@@ -1,10 +1,4 @@
// 确认统一走页内确认(桌面端),网页端保持原生 confirm
function askConfirm (text, opts) {
const C = (typeof window !== 'undefined') ? window.IWBUIConfirm : null
if (C && typeof C.askOrNative === 'function') return C.askOrNative(text, opts)
return Promise.resolve(window.confirm(String(text)))
}
;(function (global) {
'use strict'
const _lstore = () => (typeof global !== 'undefined' && global.IWBStorageLocal && typeof global.IWBStorageLocal.getStore === 'function') ? global.IWBStorageLocal.getStore() : null
@@ -857,7 +851,7 @@
if (!migrated.ok) throw new Error(migrated.error || '画布版本不受支持')
const obj = migrated.value
if (!obj || obj.app !== 'image-workbench' || !Array.isArray(obj.nodes)) throw new Error('文件格式不正确(应为 .iwb.json)')
if (refs.nodes.length && !fromDrop && !(await askConfirm('导入将替换当前画布(' + refs.nodes.length + ' 个节点),确定继续?', { title: '导入画布', okText: '替换' }))) return
if (refs.nodes.length && !fromDrop && !(await window.IWBUIConfirm.askOrNative('导入将替换当前画布(' + refs.nodes.length + ' 个节点),确定继续?', { title: '导入画布', okText: '替换' }))) return
const idMap = {}
const ns = obj.nodes.filter((n) => n && NODE_TYPES.has(n.type)).map((n) => {
const nid = uid('n')
+10
View File
@@ -183,8 +183,18 @@
// 品牌色上的文字:按对比度自动选黑/白
const onBrand = contrast('#ffffff', brand) >= RATIO.onBrand ? '#ffffff' : '#1c2333'
// 状态层(2026-11-24,§3.1.2):背景/描边各一套,取代散落在样式里的 16 处 color-mix。
// 亮色下「浅底 + 深字」,暗色下「深底 + 亮字」;描边取原状态色的 55% 混底,保证不刺眼又能分辨。
const errBg = mix(err, surface0, d ? 0.82 : 0.90)
const errBd = mix(err, surface0, d ? 0.55 : 0.62)
const okBg = mix(ok, surface0, d ? 0.82 : 0.90)
const okBd = mix(ok, surface0, d ? 0.55 : 0.62)
const warnBg = mix(warn, surface0, d ? 0.82 : 0.90)
const warnBd = mix(warn, surface0, d ? 0.55 : 0.62)
return {
err, ok, warn, onBrand,
errBg, errBd, okBg, okBd, warnBg, warnBd,
bg: surface0,
panel: surface1,
layer: inset,
+4 -12
View File
@@ -12,14 +12,6 @@
;(function (global) {
'use strict'
function askConfirm (text, opts) {
const D = (typeof window !== 'undefined') ? window.IWBDesktop : null
const native = !!(D && D.isTauri && D.isTauri())
const C = (typeof window !== 'undefined') ? window.IWBUIConfirm : null
if (native && C && typeof C.ask === 'function') return C.ask(Object.assign({ text: text }, opts || {}))
return Promise.resolve(window.confirm(text))
}
// 存储入口收敛(2026-11-06):统一走 IWBStorageLocal 门面,配额/异常集中处理
const _lstore = () => (typeof window !== 'undefined' && window.IWBStorageLocal && typeof window.IWBStorageLocal.getStore === 'function') ? window.IWBStorageLocal.getStore() : null
const React = global.React || {}
@@ -198,8 +190,8 @@ function BackupModal(props) {
const needConfirm = estMB >= 20 || (imgMeta.length + pluginFileMeta.length) >= 20
const sizeText = estMB >= 1 ? ('约 ' + estMB.toFixed(0) + ' MB') : '未记录(按张数估算偏大)'
const countText = imgMeta.length + ' 张图片' + (pluginFileMeta.length ? '(另含 ' + pluginFileMeta.length + ' 个插件文件)' : '')
if (needConfirm && typeof window !== 'undefined' && typeof window.confirm === 'function') {
const okGo = await askConfirm('本次备份包含 ' + countText + ',预计体积 ' + sizeText + '。\n导出期间内存占用会明显上升,图库很大时页面会变慢。\n确定继续导出吗?', { title: '导出备份', okText: '继续导出' })
if (needConfirm && typeof window !== 'undefined' && window.IWBUIConfirm) {
const okGo = await window.IWBUIConfirm.askOrNative('本次备份包含 ' + countText + ',预计体积 ' + sizeText + '。\n导出期间内存占用会明显上升,图库很大时页面会变慢。\n确定继续导出吗?', { title: '导出备份', okText: '继续导出' })
if (!okGo) {
setBkMsg({ type: 'err', text: '已取消导出(' + countText + ' / ' + sizeText + ')' })
return
@@ -385,7 +377,7 @@ function BackupModal(props) {
const items = restoreData.items
const want = Object.keys(restoreSel).filter((k) => restoreSel[k])
if (!want.length) { setRstMsg({ type: 'err', text: '请至少勾选一项要恢复的数据' }); return }
if (!(await askConfirm((restoreMerge ? '将以「合并」方式导入(追加去重,不覆盖已有):' : '将用备份覆盖当前数据:') + want.map((k) => ({ config: '设置', prompts: '提示词库', nodeGroups: '节点组', workspaces: '画布工作台', outputs: '图库(含缩略图+原图)' })[k]).join('、') + '。确定恢复?', { title: '恢复备份', okText: '开始恢复' }))) return
if (!(await window.IWBUIConfirm.askOrNative((restoreMerge ? '将以「合并」方式导入(追加去重,不覆盖已有):' : '将用备份覆盖当前数据:') + want.map((k) => ({ config: '设置', prompts: '提示词库', nodeGroups: '节点组', workspaces: '画布工作台', outputs: '图库(含缩略图+原图)' })[k]).join('、') + '。确定恢复?', { title: '恢复备份', okText: '开始恢复' }))) return
setRstBusy(true); setRstMsg(null)
try {
props.onSaveNow && props.onSaveNow() // 导入前保存当前画布(避免导入后丢失未保存改动)
@@ -482,7 +474,7 @@ function BackupModal(props) {
for (const m of keepMiss) { const t = (m && (m.label || m.path)) || '密钥'; if (uniqLabel.indexOf(t) === -1) uniqLabel.push(t) }
keepWarn = '⚠︎ 有 ' + keepMiss.length + ' 个密钥字段在备份里是「保留本机原值」(__KEEP__),但本机没有对应值,已保持为空:' + uniqLabel.slice(0, 3).join('、') + (uniqLabel.length > 3 ? ' 等 ' + uniqLabel.length + ' 类' : '') + '。请到「服务与 Key 设置」里补填。'
wLog('restore', 'KEEP-MISS:' + keepMiss.map((m) => m && m.path).join(', '))
try { await askConfirm(keepWarn + '\n\n点「确定」继续(恢复已完成,随后刷新页面生效)。', { title: '恢复提示', okText: '知道了', cancelText: '关闭' }) } catch (e) { /* ignore */ }
try { await window.IWBUIConfirm.askOrNative(keepWarn + '\n\n点「确定」继续(恢复已完成,随后刷新页面生效)。', { title: '恢复提示', okText: '知道了', cancelText: '关闭' }) } catch (e) { /* ignore */ }
}
setRstMsg({
type: (imgBad.length || keepWarn) ? 'err' : 'ok',
+2 -1
View File
@@ -9,7 +9,8 @@
const item = props.item || {}
const doCopyRef = () => { props.onCopyRef && props.onCopyRef(item.url) }
const doCopyLink = () => {
try { if (global.navigator && global.navigator.clipboard) global.navigator.clipboard.writeText(item.url) } catch (e) { /* ignore */ }
// 统一走 IWBClipboardCopy(2026-11-24)
try { if (global.IWBClipboardCopy) global.IWBClipboardCopy.copyText(item.url) } catch (e) { /* ignore */ }
}
return el('div', {
className: 'iwb-rimg',
+3 -10
View File
@@ -1,10 +1,4 @@
// 确认统一走页内确认(桌面端),网页端保持原生 confirm
function askConfirm (text, opts) {
const C = (typeof window !== 'undefined') ? window.IWBUIConfirm : null
if (C && typeof C.askOrNative === 'function') return C.askOrNative(text, opts)
return Promise.resolve(window.confirm(String(text)))
}
;(function (global) {
'use strict'
@@ -273,9 +267,8 @@
}
const copy = async () => {
const v = readMd()
try { await navigator.clipboard.writeText(v) } catch (e) {
try { const r = editorRef.current; if (r) { const rg = document.createRange(); rg.selectNodeContents(r); const sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(rg); document.execCommand('copy') } } catch (e2) { /* ignore */ }
}
// 复制统一走 IWBClipboardCopy(2026-11-24):降级链在里面,这里不再自造选区+execCommand 兜底
try { await (window.IWBClipboardCopy ? window.IWBClipboardCopy.copyText(v) : Promise.resolve(false)) } catch (e) { /* ignore */ }
setCopied(true)
setTimeout(() => setCopied(false), 1200)
}
@@ -1062,7 +1055,7 @@
title: (taskQueued ? '已排队,等待提交…' : '已提交,正在等待服务商返回(点击可提前结束,需确认)'),
onClick: async () => {
if (!props.onCancel) return
if (!(await askConfirm('该任务仍在等待服务商返回' + (taskQueued ? '(尚未提交)' : '(已 ' + fmtDur(stallMs) + ' 无新进展)') + '。\n\n确定要提前结束这个任务吗?只会停止本任务的等待,不影响同批其他任务;服务商侧可能已生成,是否重试由你决定。', { title: '提前结束任务', okText: '结束' }))) return
if (!(await window.IWBUIConfirm.askOrNative('该任务仍在等待服务商返回' + (taskQueued ? '(尚未提交)' : '(已 ' + fmtDur(stallMs) + ' 无新进展)') + '。\n\n确定要提前结束这个任务吗?只会停止本任务的等待,不影响同批其他任务;服务商侧可能已生成,是否重试由你决定。', { title: '提前结束任务', okText: '结束' }))) return
props.onCancel(node.id, t.id)
},
onPointerDown: stop,
+3 -10
View File
@@ -9,13 +9,6 @@
*
* ⚠️ 依赖清单是用 ESLint 的 no-undef 反推出来的(不是人肉枚举),漏项会被 CI 直接抓到。
*/
// 确认统一走页内确认(桌面端),网页端保持原生 confirm
function askConfirm (text, opts) {
const C = (typeof window !== 'undefined') ? window.IWBUIConfirm : null
if (C && typeof C.askOrNative === 'function') return C.askOrNative(text, opts)
return Promise.resolve(window.confirm(String(text)))
}
;(function (global) {
'use strict'
// 存储入口收敛(2026-11-06):统一走 IWBStorageLocal 门面,配额/异常集中处理
@@ -311,7 +304,7 @@ function SettingsModal(props) {
if (!cur.some((m) => m && m.name === name)) return
const usedBy = (props.nodes || []).filter((n) => n && n.type === 'layer' && n.data && n.data.model === name && !(n.data && n.data.enabled === false)).length
const warning = usedBy ? '该模型正在被 ' + usedBy + ' 个分层节点使用。删除后这些节点会显示模型不可用。\n\n确定删除「' + name + '」吗?' : '确定删除分层模型「' + name + '」吗?'
if (!(await askConfirm(warning, { title: '删除分层模型', okText: '删除' }))) return
if (!(await window.IWBUIConfirm.askOrNative(warning, { title: '删除分层模型', okText: '删除' }))) return
setProv(pi, { layerModels: wNormalizeLayerModels(cur.filter((m) => !(m && m.name === name))) })
}
const delModel = async (pi, name) => {
@@ -324,7 +317,7 @@ function SettingsModal(props) {
}
const usedBy = (props.nodes || []).filter((n) => n && n.type === 'gen' && n.data && n.data.model === name && !(n.data && n.data.enabled === false)).length
const warning = usedBy ? '该模型正在被 ' + usedBy + ' 个生图节点使用。删除后这些节点将显示模型不可用,需要重新选择。\n\n确定删除「' + name + '」吗?' : '确定删除模型「' + name + '」吗?'
if (!(await askConfirm(warning, { title: '删除模型', okText: '删除' }))) return
if (!(await window.IWBUIConfirm.askOrNative(warning, { title: '删除模型', okText: '删除' }))) return
const models = (p.models || []).filter((m) => m && m.name !== name)
const patch = { models }
if (p.defaultModel === name) {
@@ -560,7 +553,7 @@ function SettingsModal(props) {
try {
const before = storageAudit || ((typeof props.onStorageAudit === 'function') ? await props.onStorageAudit() : null)
const cnt = before ? ('IDB 图片键 ' + before.total + ' 个;悬空输出索引 ' + before.danglingOutputIndex + ';孤儿输出字节 ' + before.orphanOutputBytes + ' 个') : '(未体检)'
if (!(await askConfirm('将执行一次安全孤儿回收:只删除未被任何画板 / 剪贴板 / 收藏组 / 历史 / 图库引用的图片字节(绝不删活引用)。\n\n当前:' + cnt + '\n\n继续?', { title: '孤儿回收', okText: '开始回收' }))) return
if (!(await window.IWBUIConfirm.askOrNative('将执行一次安全孤儿回收:只删除未被任何画板 / 剪贴板 / 收藏组 / 历史 / 图库引用的图片字节(绝不删活引用)。\n\n当前:' + cnt + '\n\n继续?', { title: '孤儿回收', okText: '开始回收' }))) return
const after = (typeof props.onReclaimOrphans === 'function') ? await props.onReclaimOrphans() : null
if (after) setStorageAudit(after)
setMsg({ type: 'ok', text: '已回收孤儿图片字节' + (after ? ('(现存 ' + after.total + ' 个图片键)') : '') })
+7 -16
View File
@@ -100,15 +100,6 @@
)
}
// 桌面端用页内确认(window.confirm 会阻塞 WKWebView 主线程 ⇒ 界面像死机)
function askConfirm (text, opts) {
const D = (typeof window !== 'undefined') ? window.IWBDesktop : null
const native = !!(D && D.isTauri && D.isTauri())
const C = (typeof window !== 'undefined') ? window.IWBUIConfirm : null
if (native && C && typeof C.ask === 'function') return C.ask(Object.assign({ text: text }, opts || {}))
return Promise.resolve(window.confirm(text))
}
// 开发者模式开关(走统一存储门面,src 不得直调 localStorage)
function pluginDevStore () {
const L = (typeof window !== 'undefined') ? window.IWBStorageLocal : null
@@ -310,8 +301,8 @@
registered: (pluginItems || []).map(function (p) { return { id: p.id, enabled: p.enabled, compatible: p.compatible } }),
}
const text = JSON.stringify(payload, null, 2)
try { await navigator.clipboard.writeText(text) } catch (e) { try { const ta = document.createElement('textarea'); ta.value = text; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); ta.remove() } catch (e2) { /* ignore */ } }
setMsg('诊断已复制到剪贴板')
const okCopy = await (window.IWBClipboardCopy ? window.IWBClipboardCopy.copyText(text) : Promise.resolve(false))
setMsg(okCopy ? '诊断已复制到剪贴板' : '复制失败(权限被拒或非安全上下文);可用「导出 JSON」')
} catch (e) { setMsg('诊断生成失败:' + String((e && e.message) || e)) }
},
}, '复制诊断'),
@@ -595,7 +586,7 @@ function GSetGroup (props) {
try {
const d = await F.pickDir()
if (!d || d === dataDir) return
if (!(await askConfirm('切换资料目录?\n\n当前数据会先保存到当前目录,然后窗口重载并从新目录装载。\n新目录:' + d, { title: '切换资料目录', okText: '切换' }))) return
if (!(await window.IWBUIConfirm.askOrNative('切换资料目录?\n\n当前数据会先保存到当前目录,然后窗口重载并从新目录装载。\n新目录:' + d, { title: '切换资料目录', okText: '切换' }))) return
await F.switchTo(d)
setDataDir(d); setNote('已切换,正在重载…')
} catch (e) { setNote('切换失败:' + String((e && e.message) || e)) }
@@ -608,7 +599,7 @@ function GSetGroup (props) {
try {
const d = await F.pickDir()
if (!d || d === dataDir) return
if (!(await askConfirm('把整个数据库复制到:\n' + d + '\n\n复制完成后自动切换并重载;原目录会保留,确认无误后可手动删除。\n(图片较多时会花几十秒)', { title: '转移数据库', okText: '开始复制' }))) return
if (!(await window.IWBUIConfirm.askOrNative('把整个数据库复制到:\n' + d + '\n\n复制完成后自动切换并重载;原目录会保留,确认无误后可手动删除。\n(图片较多时会花几十秒)', { title: '转移数据库', okText: '开始复制' }))) return
setNote('正在复制,请稍候…')
await F.migrateTo(d)
} catch (e) { setNote('转移失败:' + String((e && e.message) || e)) }
@@ -641,7 +632,7 @@ function GSetGroup (props) {
if (rDry.keptByCanvas) lines.push('其中 ' + rDry.keptByCanvas + ' 张虽然登记表里没有,但画布仍在引用 → 会自动保留。')
if (rDry.dangling) lines.push('另有 ' + rDry.dangling + ' 处画布引用已经找不到图片(之前丢的,本次不影响它们)。')
lines.push('移动到 trash/(不直接删除,可在回收站找回)?')
if (!(await askConfirm(lines.join('\n'), { title: '清理未引用图片', okText: '移动' }))) return
if (!(await window.IWBUIConfirm.askOrNative(lines.join('\n'), { title: '清理未引用图片', okText: '移动' }))) return
const rGo = await F.gcImages({ dryRun: false })
setNote(rGo.ok
? ('已移入 trash/:' + rGo.moved + ' 个文件' + (rGo.dangling ? (';另有 ' + rGo.dangling + ' 处引用已缺图') : ''))
@@ -881,11 +872,11 @@ function GSetGroup (props) {
el('button', {
className: 'iwb-btn iwb-btn-sm',
onClick: async () => {
const okGo = await askConfirm('用这份备份覆盖当前本机数据?\n\n覆盖后会' + (isDesk() ? '自动重载窗口' : '立即刷新页面') + '。当前数据不会保留,建议先「导出备份」。', { title: '还原自动备份', okText: '还原' })
const okGo = await window.IWBUIConfirm.askOrNative('用这份备份覆盖当前本机数据?\n\n覆盖后会' + (isDesk() ? '自动重载窗口' : '立即刷新页面') + '。当前数据不会保留,建议先「导出备份」。', { title: '还原自动备份', okText: '还原' })
if (!okGo) return
Promise.resolve(props.autoBackupRestore && props.autoBackupRestore(row.name)).then((r) => {
if (r && r.ok) location.reload()
else askConfirm('还原失败:' + ((r && r.error) || '未知错误'), { title: '还原失败', okText: '知道了', cancelText: '关闭' })
else window.IWBUIConfirm.askOrNative('还原失败:' + ((r && r.error) || '未知错误'), { title: '还原失败', okText: '知道了', cancelText: '关闭' })
})
},
}, '还原此份'),
+8 -16
View File
@@ -10,13 +10,6 @@
* ctx.storageAudit / ctx.storageAuditBusy —— 体检结果与忙碌态
* ctx.props —— SettingsModal 的 props(diagStats/diagText/onExportDiag)
*/
// 确认统一走页内确认(桌面端),网页端保持原生 confirm
function askConfirm (text, opts) {
const C = (typeof window !== 'undefined') ? window.IWBUIConfirm : null
if (C && typeof C.askOrNative === 'function') return C.askOrNative(text, opts)
return Promise.resolve(window.confirm(String(text)))
}
;(function (global) {
'use strict'
const React = global.React || {}
@@ -40,13 +33,12 @@
try {
text = (typeof props.diagText === 'function') ? props.diagText() : JSON.stringify(CrashLog ? CrashLog.report({ version: APP_VERSION }) : {}, null, 2)
} catch (e) { setMsg({ type: 'err', text: '生成诊断信息失败:' + String((e && e.message) || e) }); return }
if (!(navigator.clipboard && navigator.clipboard.writeText)) { setMsg({ type: 'err', text: '当前环境不支持复制,请用「导出 JSON」' }); return }
try {
await navigator.clipboard.writeText(text)
setMsg({ type: 'ok', text: '诊断信息已复制到剪贴板' })
} catch (e) {
setMsg({ type: 'err', text: '复制失败:' + String((e && e.message) || e) + ';请改用「导出 JSON」' })
}
// 复制统一走 IWBClipboardCopy(2026-11-24):内含 navigator → textarea+execCommand 的降级链,
// 不再各处自己判断 clipboard 是否可用(那样每处都要复述一份兜底逻辑)。
const C = (typeof window !== 'undefined') ? window.IWBClipboardCopy : null
if (!C || typeof C.copyText !== 'function') { setMsg({ type: 'err', text: '当前环境不支持复制,请用「导出 JSON」' }); return }
const ok = await C.copyText(text)
setMsg(ok ? { type: 'ok', text: '诊断信息已复制到剪贴板' } : { type: 'err', text: '复制失败(权限被拒或非安全上下文);请改用「导出 JSON」' })
}
// ── 孤儿画板找回(v3.87.8)──
// 症状:崩溃/异常返回后某块画板"从列表里消失"(其它画板还在)。索引条目可能丢了,
@@ -68,7 +60,7 @@
} catch (e) { orphanRows = [] }
const restoreOrphan = async (row) => {
try {
if (!(await askConfirm('把「' + row.name + '」(' + row.nodes + ' 个节点)补回画布列表?恢复后会重新加载页面。', { title: '找回画布', okText: '补回' }))) return
if (!(await window.IWBUIConfirm.askOrNative('把「' + row.name + '」(' + row.nodes + ' 个节点)补回画布列表?恢复后会重新加载页面。', { title: '找回画布', okText: '补回' }))) return
const st = _lstore()
const idx = (st ? st.get('iwb_web_workspaces', null) : null) || { workspaces: [], activeId: '', rev: 0 }
const board = st ? st.get(row.key, null) : null
@@ -90,7 +82,7 @@
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => { setDiagRev((v) => v + 1) } }, '刷新'),
el('button', { className: 'iwb-btn iwb-btn-sm', title: '复制完整诊断 JSON(含崩溃记录与内存采样)', onClick: copyDiag }, '复制诊断 JSON'),
el('button', { className: 'iwb-btn iwb-btn-sm', title: '导出完整诊断 JSON(下载文件)', onClick: () => { if (typeof props.onExportDiag === 'function') props.onExportDiag(); else setMsg({ type: 'err', text: '当前环境不支持诊断导出' }) } }, '导出 JSON'),
el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-danger', title: '清空本机的崩溃记录、内存采样与操作面包屑', onClick: async () => { if (await askConfirm('清空本机诊断记录?', { title: '清空诊断记录', okText: '清空' })) { if (CrashLog && CrashLog.clear) CrashLog.clear(); reload() } } }, '清空记录'),
el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-danger', title: '清空本机的崩溃记录、内存采样与操作面包屑', onClick: async () => { if (await window.IWBUIConfirm.askOrNative('清空本机诊断记录?', { title: '清空诊断记录', okText: '清空' })) { if (CrashLog && CrashLog.clear) CrashLog.clear(); reload() } } }, '清空记录'),
),
el('div', { className: 'iwb-row' },
el('span', { className: 'iwb-diag-kv' }, '版本 ' + APP_VERSION),
+89 -92
View File
@@ -79,7 +79,7 @@ button { font-family: inherit; }
方案 B:静态态与其它气泡按钮完全一致(灰图标、透明底),只有 hover 才亮红 ——
不做红底常驻,避免把删除变成常驻视觉焦点;误删由 Ctrl+Z(deleteNodes 会 pushHistory)兜底。
红色复用既有 token --iwb-err(与右键菜单「删除」同语义),不新增变量。 */
.iwb-node-floatbar button.iwb-fb-del:hover { color: var(--iwb-err); background: color-mix(in srgb, var(--iwb-err) 12%, transparent); }
.iwb-node-floatbar button.iwb-fb-del:hover { color: var(--iwb-err); background: var(--iwb-err-bg); }
.iwb-node-headbtns { display: flex; gap: var(--iwb-space-2); }
.iwb-node-del { background: none; border: none; color: var(--iwb-text2); cursor: pointer; font-size: var(--iwb-font-sm); padding: 0 var(--iwb-space-2); display: inline-flex; align-items: center; justify-content: center; }
.iwb-node-del:hover { color: var(--iwb-brand-text, var(--iwb-brand)); }
@@ -141,7 +141,7 @@ button { font-family: inherit; }
.iwb-node-selected .iwb-port-linked::before { opacity: 0; }
/* 鼠标靠近端点:**再放大一档**,且**已连线的端口也显示**(节点可多连)。
选择器带上 .iwb-node-selected 前缀,保证优先级压过上面的选中规则。 */
.iwb-port:hover, .iwb-node-selected .iwb-port:hover { width: 24px; height: 24px; transition: width .1s, height .1s; }
.iwb-port:hover, .iwb-node-selected .iwb-port:hover { width: 24px; height: 24px; transition: width .12s, height .12s; }
.iwb-port:hover::before,
.iwb-node-selected .iwb-port:hover::before,
.iwb-node-selected .iwb-port-linked:hover::before { opacity: 1; inset: var(--iwb-space-4); }
@@ -154,31 +154,31 @@ 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: var(--iwb-radius-chip); font-size: var(--iwb-font-sm); }
.iwb-ref-images { display: flex; flex-direction: column; gap: var(--iwb-space-6); }
.iwb-ref-imgrow { display: flex; align-items: center; gap: var(--iwb-space-6); }
.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-idx { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--iwb-brand); color: var(--iwb-on-brand); font-size: var(--iwb-font-2xs); display: flex; align-items: center; justify-content: center; }
.iwb-ref-img { flex: 1; max-height: 90px; object-fit: contain; border-radius: var(--iwb-radius-chip); border: 1px solid var(--iwb-border); background: var(--iwb-field); cursor: move; min-width: 0; }
.iwb-ref-imgactions { flex: 0 0 auto; display: flex; flex-direction: column; gap: var(--iwb-space-2); }
.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); }
.iwb-file:hover { border-color: var(--iwb-brand); color: var(--iwb-brand-text, var(--iwb-brand)); }
.iwb-hint { font-size: 10px; color: var(--iwb-text2); margin-top: 4px; }
.iwb-hint { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); margin-top: var(--iwb-space-4); }
.iwb-results { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.iwb-rgroup { width: 100%; }
.iwb-rlabel { font-size: 10px; color: var(--iwb-text2); margin: 4px 0 3px; }
.iwb-rlabel { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); margin: 4px 0 3px; } /*iwb:raw-until=3.28.0*/
.iwb-result-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; border: 1px solid var(--iwb-border); }
.iwb-rimg { position: relative; }
.iwb-rimg-actions { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; gap: 4px; justify-content: center; }
.iwb-rimg-actions .iwb-btn { font-size: 10px; padding: 1px 5px; background: var(--iwb-panel); }
.iwb-rimg-actions .iwb-btn { font-size: var(--iwb-font-2xs); padding: 1px 5px; background: var(--iwb-panel); } /*iwb:raw-until=3.28.0*/
.iwb-err { font-size: 11px; color: var(--iwb-err); margin-top: 4px; word-break: break-all; }
.iwb-out-item { margin-bottom: 8px; }
.iwb-out-block { border-top: 1px dashed var(--iwb-border2); padding-top: 6px; margin-top: 6px; }
.iwb-out-block:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.iwb-out-imgwrap { margin-top: 4px; }
.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-out-meta { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); margin-top: 3px; } /*iwb:raw-until=3.28.0*/
.iwb-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.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: var(--iwb-radius-panel); 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: var(--iwb-font-md); margin-right: 2px; }
.iwb-toolbar-sep { width: 1px; height: 18px; background: var(--iwb-border2); margin: 0 2px; }
.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: var(--iwb-radius-card); padding: 6px 12px; z-index: 10; font-size: var(--iwb-font-xs); 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: var(--iwb-radius-card); padding: 6px 12px; z-index: 10; font-size: var(--iwb-font-xs); color: var(--iwb-text2); box-shadow: 0 4px 16px rgba(0,0,0,0.12); transition: right .15s; } /*iwb:raw-until=3.28.0*/
.iwb-status-err { color: var(--iwb-err); }
.iwb-status-ok { color: var(--iwb-ok); }
/* 生成中状态:直接附着在顶部计时/状态背景,确保不依赖画布节点可见性 */
@@ -189,7 +189,7 @@ 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; 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: var(--iwb-font-2xs); color: var(--iwb-text2); background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-control); padding: 3px 10px; z-index: 9; opacity: 0.8; white-space: nowrap; } /*iwb:raw-until=3.28.0*/
.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; }
/* v3.26.18:右栏挤压到工具栏时自动隐藏(避免两者重叠) */
.iwb-minimap.iwb-minimap-tight { opacity: 0; transform: translateY(6px); pointer-events: none; }
@@ -220,11 +220,11 @@ button { font-family: inherit; }
.iwb-lib-searchscope { display: inline-flex; align-items: center; gap: var(--iwb-space-4); flex: 0 0 auto; font-size: var(--iwb-font-xs); color: var(--iwb-text2); background: color-mix(in srgb, var(--iwb-brand) 10%, transparent); border: 1px solid color-mix(in srgb, var(--iwb-brand) 28%, transparent); border-radius: 999px; padding: var(--iwb-space-2) var(--iwb-space-4) var(--iwb-space-2) var(--iwb-space-8); white-space: nowrap; }
.iwb-lib-searchscope-back { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; padding: 0; border: none; border-radius: 999px; background: transparent; color: var(--iwb-text2); font-size: var(--iwb-font-md); line-height: 1; cursor: pointer; }
.iwb-lib-searchscope-back:hover { background: color-mix(in srgb, var(--iwb-tint) 12%, transparent); color: var(--iwb-text); }
.iwb-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--iwb-text2); cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.iwb-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--iwb-space-4); background: var(--iwb-layer); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-full); padding: 3px 10px; font-size: var(--iwb-font-sm); color: var(--iwb-text2); cursor: pointer; white-space: nowrap; transition: all .15s; } /*iwb:raw-until=3.28.0*/
.iwb-chip:hover { color: var(--iwb-text); border-color: var(--iwb-border2); }
.iwb-chip-active { background: var(--iwb-panel); border-color: var(--iwb-border2); color: var(--iwb-text); font-weight: 600; }
.iwb-chip-active:hover { color: var(--iwb-text); }
.iwb-chip-count { font-size: 10px; opacity: 0.8; }
.iwb-chip-count { font-size: var(--iwb-font-2xs); opacity: 0.8; }
.iwb-chip-add { font-weight: 700; }
.iwb-gmgr-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--iwb-border); }
.iwb-gmgr-name { flex: 1 1 auto; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@@ -274,11 +274,11 @@ button { font-family: inherit; }
.iwb-full-left .iwb-full-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; padding-right: 2px; }
.iwb-full-collapsed { flex: 0 0 26px; border-left: 1px solid var(--iwb-border); background: var(--iwb-layer); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--iwb-text2); font-size: 12px; writing-mode: vertical-rl; }
.iwb-full-collapsed:hover { color: var(--iwb-text); }
.iwb-pcard-full { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.iwb-pcard-full:hover { border-color: var(--iwb-border2); }
.iwb-pcard-full { cursor: pointer; transition: border-color var(--iwb-motion-base) var(--iwb-ease-out), box-shadow var(--iwb-motion-base) var(--iwb-ease-out); }
.iwb-pcard-full:hover { border-color: var(--iwb-border2); transition-duration: var(--iwb-motion-fast); }
.iwb-pcard-selected { border-color: var(--iwb-border2); box-shadow: 0 0 0 1px var(--iwb-border2); }
.iwb-pcard-check { accent-color: var(--iwb-text); margin-right: 4px; }
.iwb-full-split { flex: 0 0 4px; cursor: col-resize; background: var(--iwb-border); transition: background 0.15s; }
.iwb-full-split { flex: 0 0 4px; cursor: col-resize; background: var(--iwb-border); transition: background .15s; }
.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; }
@@ -289,7 +289,7 @@ button { font-family: inherit; }
.iwb-full-editor-empty { color: var(--iwb-text2); font-size: 12px; justify-content: center; align-items: center; height: 100%; text-align: center; }
.iwb-btn-starred { color: var(--iwb-text); }
/* 提示词卡片按钮:无底色、浅灰图标 */
.iwb-pcard .iwb-btn { background: transparent; border: none; padding: 2px 4px; color: var(--iwb-text2); opacity: 0.7; box-shadow: none; }
.iwb-pcard .iwb-btn { background: transparent; border: none; padding: 2px 4px; color: var(--iwb-text2); opacity: var(--iwb-opacity-muted); box-shadow: none; } /*iwb:raw-until=3.28.0*/
.iwb-pcard .iwb-btn:hover { opacity: 1; color: var(--iwb-text); background: transparent; }
.iwb-pcard .iwb-btn-starred { color: var(--iwb-text); opacity: 1; }
/* 搜索高亮 */
@@ -304,7 +304,7 @@ button { font-family: inherit; }
.iwb-pname { font-weight: 600; font-size: 12px; }
.iwb-pbtns { margin-left: auto; display: flex; gap: 4px; }
.iwb-ptext { font-size: 11px; color: var(--iwb-text2); margin-top: 4px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.iwb-tag { display: inline-block; background: color-mix(in srgb, var(--iwb-tint) 7%, transparent); color: var(--iwb-text2); border-radius: 4px; font-size: 10px; padding: 1px 6px; margin: 3px 4px 0 0; }
.iwb-tag { display: inline-block; background: color-mix(in srgb, var(--iwb-tint) 7%, transparent); color: var(--iwb-text2); border-radius: var(--iwb-radius-chip); font-size: var(--iwb-font-2xs); padding: 1px 6px; margin: 3px 4px 0 0; } /*iwb:raw-until=3.28.0*/
.iwb-pedit { border: 1px solid var(--iwb-border); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.iwb-tasks { margin-top: var(--iwb-space-8); display: flex; flex-direction: column; gap: var(--iwb-space-8); }
.iwb-gen-head { display: flex; align-items: center; justify-content: space-between; gap: var(--iwb-space-6); }
@@ -326,9 +326,9 @@ button { font-family: inherit; }
.iwb-history-grid { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px; flex: 1; }
.iwb-history-item { position: relative; flex: 0 0 110px; }
.iwb-history-item img { width: 110px; height: 82px; object-fit: contain; border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: pointer; }
.iwb-history-actions { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; gap: 4px; justify-content: center; opacity: 0; transition: opacity 0.15s; }
.iwb-history-actions { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; gap: var(--iwb-space-4); justify-content: center; opacity: 0; transition: opacity .15s; }
.iwb-history-item:hover .iwb-history-actions { opacity: 1; }
.iwb-history-actions .iwb-btn { font-size: 10px; padding: 1px 5px; background: var(--iwb-panel); text-decoration: none; }
.iwb-history-actions .iwb-btn { font-size: var(--iwb-font-2xs); padding: 1px 5px; background: var(--iwb-panel); text-decoration: none; } /*iwb:raw-until=3.28.0*/
.iwb-modal-sm { width: 460px; }
.iwb-pickrow { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; cursor: pointer; font-size: 12px; }
.iwb-picktext { color: var(--iwb-text); line-height: 1.4; word-break: break-all; }
@@ -340,9 +340,9 @@ button { font-family: inherit; }
.iwb-ref-url-row .iwb-ref-upload-link { background: var(--iwb-field); border-color: var(--iwb-border); color: var(--iwb-text2); }
.iwb-ref-upload-link:hover { background: color-mix(in srgb, var(--iwb-brand) 10%, var(--iwb-field)); border-color: var(--iwb-border2); color: var(--iwb-text); }
.iwb-ref-url-input { min-width: 0; flex: 1 1 auto; font-size: var(--iwb-font-xs); }
.iwb-ref-url-current { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--iwb-text2); font-size: 10px; }
.iwb-ref-url-current { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--iwb-text2); font-size: var(--iwb-font-2xs); }
.iwb-ref-show { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.iwb-ref-miniactions .iwb-btn { font-size: 10px; padding: var(--iwb-space-2) var(--iwb-space-6); text-decoration: none; }
.iwb-ref-miniactions .iwb-btn { font-size: var(--iwb-font-2xs); padding: var(--iwb-space-2) var(--iwb-space-6); text-decoration: none; }
.iwb-task-ref { width: 28px; height: 28px; }
.iwb-refmini { position: relative; }
.iwb-refmini-empty { width: 28px; height: 28px; border-radius: var(--iwb-radius-chip); border: 1px solid var(--iwb-border); background: var(--iwb-field); display: flex; align-items: center; justify-content: center; color: #9aa1ad; }
@@ -380,7 +380,7 @@ button { font-family: inherit; }
.iwb-group:hover { border-color: color-mix(in srgb, var(--iwb-tint) 64%, transparent); background: color-mix(in srgb, var(--iwb-brand) 6%, transparent); }
.iwb-group-sel { border-color: color-mix(in srgb, var(--iwb-tint) 78%, transparent); background: color-mix(in srgb, var(--iwb-brand) 7%, transparent); }
/* 缩放手柄:默认隐藏,hover 或整组选中时显示(触屏靠"点一下框 = 选中整组"进入选中态) */
.iwb-group-handle { position: absolute; width: 9px; height: 9px; background: var(--iwb-panel); border: 2px solid var(--iwb-brand); border-radius: 2px; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 6; }
.iwb-group-handle { position: absolute; width: 9px; height: 9px; background: var(--iwb-panel); border: var(--iwb-bw-strong) solid var(--iwb-brand); border-radius: 2px; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 6; } /*iwb:raw-until=3.28.0*/
.iwb-group:hover .iwb-group-handle, .iwb-group-sel .iwb-group-handle { pointer-events: auto; opacity: 1; }
.iwb-gh-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.iwb-gh-n { left: 50%; top: -6px; margin-left: -4.5px; cursor: ns-resize; }
@@ -397,7 +397,7 @@ button { font-family: inherit; }
.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; }
.iwb-group-name .iwb-ic { width: 18px; height: 18px; flex: 0 0 auto; color: var(--iwb-text2); }
.iwb-group-name .iwb-ic { width: var(--iwb-icon-lg); height: var(--iwb-icon-lg); flex: 0 0 auto; color: var(--iwb-text2); }
/* 节点数:比组名小两档并偏灰,且与组名之间多留 2px(总 10px)—— 否则 16px 名字 + 14px 数字会读成「分组 1 2 节点」一整串 */
.iwb-group-count { font-size: 13px; font-weight: 400; color: var(--iwb-text2); margin-left: 2px; }
/* 组名就地编辑框(双击组名进入) */
@@ -464,7 +464,7 @@ button { font-family: inherit; }
@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: var(--iwb-chrome-h); 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 { position: absolute; left: 0; top: var(--iwb-chrome-h); 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 .15s; } /*iwb:raw-until=3.28.0*/
.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-hover); }
/* 展开态标题行右侧 ⋯ 三点菜单(Portal 挂 body + fixed 定位:右侧展开不切割、层级高于画布) */
@@ -477,7 +477,7 @@ button { font-family: inherit; }
/* 展开状态下顶部标题字号翻倍(含内部文字 span,覆盖 .iwb-btn-text 固定 12px) */
.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-label { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); font-weight: 700; letter-spacing: 1px; margin: 2px 2px 4px; user-select: none; } /*iwb:raw-until=3.28.0*/
.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; }
@@ -497,13 +497,13 @@ button { font-family: inherit; }
/* 节点停用(M 键):不参与执行,半透明 + 灰色虚线边 */
.iwb-node-disabled { opacity: 0.55; filter: grayscale(0.35); }
.iwb-node-disabled .iwb-node-head { background: color-mix(in srgb, var(--iwb-field) 60%, transparent); }
.iwb-node-disabled .iwb-port { opacity: 0.45; }
.iwb-canvas { transition: left 0.15s; }
.iwb-node-disabled .iwb-port { opacity: var(--iwb-opacity-disabled); }
.iwb-canvas { transition: left var(--iwb-motion-slow) var(--iwb-ease-in-out); }
.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; }
/* ---- v3:工具栏分组 ---- */
.iwb-tgroup { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 8px; background: var(--iwb-layer); font-size: 10px; color: var(--iwb-text2); }
.iwb-tgroup { display: inline-flex; align-items: center; gap: var(--iwb-space-4); padding: 3px 6px; border-radius: var(--iwb-radius-control); background: var(--iwb-layer); font-size: var(--iwb-font-2xs); color: var(--iwb-text2); } /*iwb:raw-until=3.28.0*/
.iwb-tgroup:empty { display: none; }
.iwb-task-count { display: inline-flex; align-items: center; }
.iwb-toolbar { gap: 6px; }
@@ -548,17 +548,17 @@ button { font-family: inherit; }
.iwb-history-embedded .iwb-history-item img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: pointer; }
/* ---- SVG 图标 / 底部工具栏 ---- */
.iwb-ic { width: 16px; height: 16px; flex: 0 0 auto; }
.iwb-ic { width: var(--iwb-icon-md); height: var(--iwb-icon-md); flex: 0 0 auto; }
.iwb-btn-primary .iwb-ic { width: 15px; height: 15px; }
.iwb-btn-text { font-size: 12px; }
.iwb-wsrail-foot .iwb-btn .iwb-ic { width: 14px; height: 14px; }
.iwb-wsrail-foot .iwb-btn .iwb-ic { width: var(--iwb-icon-sm); height: var(--iwb-icon-sm); }
/* ---- 图库管理操作(点选后出现) ---- */
.iwb-history-manage-tools { display: inline-flex; align-items: center; gap: 4px; }
/* 工具栏放大 */
.iwb-toolbar-bottom { position: static; padding: 10px 14px; gap: 8px; width: auto; max-width: 100%; pointer-events: auto; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-panel); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.iwb-toolbar-bottom .iwb-btn { padding: 7px 10px; background: transparent !important; border: none !important; color: var(--iwb-text2); opacity: 0.75; transition: opacity 0.12s, color 0.12s; }
.iwb-toolbar-bottom .iwb-btn { padding: 7px 10px; background: transparent !important; border: none !important; color: var(--iwb-text2); opacity: 0.75; transition: opacity .12s, color .12s; } /*iwb:raw-until=3.28.0*/
.iwb-toolbar-bottom .iwb-btn:hover { opacity: 1; color: var(--iwb-text); }
.iwb-toolbar-bottom .iwb-btn:active { opacity: 1; color: var(--iwb-text); }
.iwb-toolbar-bottom .iwb-btn:disabled { opacity: 0.32; }
@@ -566,7 +566,7 @@ button { font-family: inherit; }
复核结论比原判断更彻底 —— `.iwb-btn-active` 与 `.iwb-layout-lock-state` 这两个类
**从 fork 快照起就没有任何 JS 生产者**(git log -S 可查),是上游遗留的死选择器,
所以不是「按钮高亮失效的 bug」,而是「永不生效的规则」。要真做工具栏选中态请显式加类并走 token。 */
.iwb-toolbar-bottom .iwb-ic { width: 18px; height: 18px; }
.iwb-toolbar-bottom .iwb-ic { width: var(--iwb-icon-lg); height: var(--iwb-icon-lg); }
.iwb-toolbar-bottom .iwb-tgroup { padding: 4px 8px; font-size: var(--iwb-font-xs); background: transparent !important; color: var(--iwb-text2); }
/* ---- 统一悬停说明(data-tip 自定义 tooltip) ---- */
@@ -589,7 +589,7 @@ button { font-family: inherit; }
pointer-events: none;
opacity: 0;
visibility: hidden;
transition: opacity 0.12s, visibility 0.12s;
transition: opacity .12s, visibility .12s;
box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}
[data-tip]:hover::after { opacity: 1; visibility: visible; }
@@ -633,7 +633,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-dock-btn:focus-visible,
.iwb-nav-item:focus-visible,
.iwb-wsrail-title:focus-visible { outline: var(--iwb-focus-ring); outline-offset: -2px; }
.iwb-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.iwb-btn:disabled { opacity: var(--iwb-opacity-disabled); cursor: not-allowed; transform: none; }
.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); }
/* 常驻选中态(画布工具组的「当前工具」):底栏按钮本身是「无边框 + 透明底」,所以这里用淡填充药丸表示
@@ -704,7 +704,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-toolbar-bottom { padding: 6px 8px; gap: 4px; }
.iwb-toolbar-bottom .iwb-btn { padding: 4px 6px; }
.iwb-toolbar-bottom .iwb-ic { width: 15px; height: 15px; }
.iwb-toolbar-bottom .iwb-tgroup { padding: 2px 4px; font-size: 10px; }
.iwb-toolbar-bottom .iwb-tgroup { padding: 2px 4px; font-size: var(--iwb-font-2xs); } /*iwb:raw-until=3.28.0*/
}
/* ---- 右侧竖向面板栏(与左侧栏统一:无阴影) ---- */
@@ -712,18 +712,18 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--iwb-border); flex: 0 0 auto; }
.iwb-drawer-toggle { display: none; }
.iwb-ws-headicon { flex: 0 0 26px; width: 26px; height: 24px; padding: 0; justify-content: center; background: transparent !important; border: none !important; color: var(--iwb-text2); opacity: 0.75; transition: opacity 0.12s, color 0.12s; }
.iwb-ws-headicon { flex: 0 0 26px; width: 26px; height: 24px; padding: 0; justify-content: center; background: transparent !important; border: none !important; color: var(--iwb-text2); opacity: 0.75; transition: opacity .12s, color .12s; }
.iwb-ws-headicon:hover { opacity: 1; color: var(--iwb-text); }
.iwb-ws-headicon:active { opacity: 1; color: var(--iwb-text); }
.iwb-ws-headicon.iwb-btn-primary { background: transparent !important; border: none !important; color: var(--iwb-brand-text, var(--iwb-brand)); opacity: 1; }
.iwb-ws-headicon .iwb-ic { width: 14px; height: 14px; }
.iwb-ws-headicon .iwb-ic { width: var(--iwb-icon-sm); height: var(--iwb-icon-sm); }
.iwb-toolbar-bottom .iwb-btn-fit .iwb-ic { width: 15px; height: 15px; }
.iwb-toolbar-bottom .iwb-btn-fit { padding: 7px 7px; }
/* ---- 连线拖拽反馈:可连接绿框 / 不可连接红框 ---- */
.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), var(--iwb-elevation-2) !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), var(--iwb-elevation-2) !important; }
.iwb-node.iwb-conn-ok { border-color: var(--iwb-ok) !important; box-shadow: 0 0 0 2px var(--iwb-ok-bd), var(--iwb-elevation-2) !important; }
.iwb-node.iwb-conn-bad { border-color: var(--iwb-err) !important; box-shadow: 0 0 0 2px var(--iwb-err-bd), var(--iwb-elevation-2) !important; }
.iwb-conn-hint { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 6; padding: var(--iwb-space-4) var(--iwb-space-6); border-radius: var(--iwb-radius-chip); color: var(--iwb-err); background: rgba(254, 226, 226, 0.96); border: 1px solid rgba(239, 68, 68, 0.35); font-size: var(--iwb-font-xs); line-height: 1.25; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-command-mask { position: fixed; inset: 0; z-index: var(--iwb-z-command); 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: var(--iwb-radius-panel); box-shadow: var(--iwb-elevation-3); display: flex; flex-direction: column; }
@@ -731,19 +731,19 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-command-icon { color: var(--iwb-brand-text, var(--iwb-brand)); font-size: 11px; font-weight: 800; }
.iwb-command-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--iwb-text); font-size: 14px; }
.iwb-command-list { overflow-y: auto; padding: 6px; }
.iwb-command-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--iwb-text); text-align: left; cursor: pointer; font-size: 13px; }
.iwb-command-item { width: 100%; display: flex; align-items: center; gap: var(--iwb-space-10); padding: 9px 10px; border: 0; border-radius: var(--iwb-radius-chip); background: transparent; color: var(--iwb-text); text-align: left; cursor: pointer; font-size: var(--iwb-font-md); } /*iwb:raw-until=3.28.0*/
.iwb-command-item:hover, .iwb-command-item:focus { outline: 0; background: var(--iwb-layer2); color: var(--iwb-brand-text, var(--iwb-brand)); }
.iwb-command-item-active { outline: 0; background: var(--iwb-layer2); color: var(--iwb-brand-text, var(--iwb-brand)); }
.iwb-command-item .iwb-ic { width: 16px; height: 16px; flex: 0 0 auto; }
.iwb-command-item .iwb-ic { width: var(--iwb-icon-md); height: var(--iwb-icon-md); 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: 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: var(--iwb-space-6); font-size: var(--iwb-font-xs); 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: var(--iwb-radius-chip); cursor: pointer; padding: var(--iwb-space-4) var(--iwb-space-6); }
.iwb-task-err-toggle:hover { background: color-mix(in srgb, var(--iwb-err) 14%, transparent); }
.iwb-task-err { margin-top: var(--iwb-space-6); border: 1px solid color-mix(in srgb, var(--iwb-err) 40%, transparent); border-radius: var(--iwb-radius-chip); background: color-mix(in srgb, var(--iwb-err) 6%, transparent); padding: var(--iwb-space-6) var(--iwb-space-8); }
.iwb-task-err-toggle { display: block; width: 100%; text-align: left; margin-top: var(--iwb-space-6); font-size: var(--iwb-font-xs); color: var(--iwb-err); background: var(--iwb-err-bg); border: 1px solid var(--iwb-err-bd); border-radius: var(--iwb-radius-chip); cursor: pointer; padding: var(--iwb-space-4) var(--iwb-space-6); }
.iwb-task-err-toggle:hover { background: var(--iwb-err-bg); }
.iwb-task-err { margin-top: var(--iwb-space-6); border: 1px solid var(--iwb-err-bd); border-radius: var(--iwb-radius-chip); background: var(--iwb-err-bg); padding: var(--iwb-space-6) var(--iwb-space-8); }
.iwb-task-errline { font-size: var(--iwb-font-xs); color: var(--iwb-err); word-break: break-all; line-height: 1.6; padding: var(--iwb-space-2) 0; }
/* 失败分类颜色:连接=红、资源/额度=橙、密钥=紫、服务商=红棕、其他=灰 */
.iwb-err-conn { color: var(--iwb-err); }
@@ -779,15 +779,15 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-ctxmenu { position: fixed; min-width: 196px; max-width: 240px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 6px; background: var(--iwb-bg-menu); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-panel); box-shadow: var(--iwb-elevation-2); z-index: var(--iwb-z-ctx-menu); display: flex; flex-direction: column; gap: 2px; }
/* 提示词/节点组的右键「移动到分组」菜单已 portal 到 body:需高于 .iwb-overlay(z-index:100),否则被应用层盖住 */
.iwb-ctxmenu.iwb-lib-group-menu { z-index: var(--iwb-z-sheet-menu); /* 面板内的 portal 菜单:> sheet、< modal,见 tokens 层级表 */ }
.iwb-ctx-title { font-size: 10px; font-weight: 700; color: var(--iwb-text2); letter-spacing: 1px; padding: 6px 10px 2px; text-transform: uppercase; }
.iwb-ctx-title { font-size: var(--iwb-font-2xs); font-weight: 700; color: var(--iwb-text2); letter-spacing: 1px; padding: 6px 10px 2px; text-transform: uppercase; } /*iwb:raw-until=3.28.0*/
.iwb-ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: none; border-radius: 8px; background: transparent; color: var(--iwb-text); font-size: var(--iwb-font-sm); cursor: pointer; text-align: left; }
.iwb-ctx-item .iwb-ic { width: 14px; height: 14px; flex: 0 0 auto; color: var(--iwb-text2); }
.iwb-ctx-item .iwb-ic { width: var(--iwb-icon-sm); height: var(--iwb-icon-sm); flex: 0 0 auto; color: var(--iwb-text2); }
.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-text, var(--iwb-brand)); }
.iwb-ctx-item:disabled { opacity: 0.38; cursor: default; }
.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-item.iwb-ctx-danger:hover:not(:disabled) { background: var(--iwb-err-bg); 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),
@@ -795,7 +795,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
* 定位:默认贴父项右侧(一级菜单永远离视口右边 ≥210px,见 app.js 的 left 夹取,放得下 200px 子菜单);
* 最后一项「该节点」用 .iwb-ctx-sub-up 改为底对齐,避免向下溢出视口。 */
.iwb-ctx-subwrap { position: relative; display: flex; flex-direction: column; }
.iwb-ctx-arrow { margin-left: auto; padding-left: 10px; font-style: normal; font-size: 10px; line-height: 1; color: var(--iwb-text2); opacity: 0.7; }
.iwb-ctx-arrow { margin-left: auto; padding-left: var(--iwb-space-10); font-style: normal; font-size: var(--iwb-font-2xs); line-height: 1; color: var(--iwb-text2); opacity: var(--iwb-opacity-muted); }
.iwb-ctx-sub { position: absolute; left: calc(100% + 6px); bottom: -6px; display: none; min-width: 200px; overflow: visible; max-height: none; }
/* 6px 缝隙也要能滑过去,否则鼠标一移就收起来了。注意子菜单必须 overflow:visible,
* 否则这条桥接用的伪元素会被 .iwb-ctxmenu 继承来的 overflow-y:auto 裁掉,等于没加。 */
@@ -825,14 +825,14 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-task-btns { display: inline-flex; align-items: center; gap: var(--iwb-space-4); flex: 0 0 auto; }
/* 任务卡左侧有 1px 描边 + 8px 内边距,批量管理行没有 ⇒ 补 9px 让两处复选框落在同一条竖线上(2026-11-01) */
.iwb-task-bulkbar { padding-left: var(--iwb-space-8); }
.iwb-task-check { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; cursor: pointer; border-radius: var(--iwb-radius-chip); margin-right: var(--iwb-space-2); transition: background 0.12s; }
.iwb-task-check { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; cursor: pointer; border-radius: var(--iwb-radius-chip); margin-right: var(--iwb-space-2); transition: background .12s; }
.iwb-task-check:hover { background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); }
.iwb-task-check input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--iwb-text); }
.iwb-task-title { flex: 1 1 auto; min-width: 0; }
.iwb-task-inactive { opacity: 0.55; border-left-color: var(--iwb-border2); }
.iwb-task-inactive .iwb-task-title { text-decoration: line-through; }
.iwb-task { position: relative; overflow: hidden; }
.iwb-task-refinfo { font-size: 10px; font-weight: 400; color: var(--iwb-text-dim); margin-left: var(--iwb-space-2); white-space: nowrap; }
.iwb-task-refinfo { font-size: var(--iwb-font-2xs); font-weight: 400; color: var(--iwb-text-dim); margin-left: var(--iwb-space-2); white-space: nowrap; }
.iwb-generation-spinner { position: relative; z-index: 2; display: inline-block; width: 12px; height: 12px; flex: 0 0 12px; border: 2px solid var(--iwb-anim-track); border-top-color: var(--iwb-anim); border-right-color: var(--iwb-anim); border-radius: 50%; animation: iwb-generation-spinner-spin 0.9s linear infinite; }
.iwb-task-count-sel { min-width: 56px; border: none; background-color: transparent; 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 3px center; appearance: none; -webkit-appearance: none; -moz-appearance: none; }
@keyframes iwb-generation-spinner-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@@ -866,10 +866,10 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 任务卡结果图(与提示词一一对应) */
.iwb-task-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--iwb-space-6); margin-top: var(--iwb-space-8); }
.iwb-task-result { position: relative; }
.iwb-task-result-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--iwb-radius-control); border: 1px solid var(--iwb-border); cursor: zoom-in; background: var(--iwb-field); display: block; transition: border-color 0.12s; }
.iwb-task-result-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--iwb-radius-control); border: 1px solid var(--iwb-border); cursor: zoom-in; background: var(--iwb-field); display: block; transition: border-color .12s; }
.iwb-task-result-img:hover { border-color: var(--iwb-brand); }
.iwb-task-result-meta { font-size: 10px; color: var(--iwb-text2); text-align: center; margin-top: var(--iwb-space-2); }
.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-meta { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); text-align: center; margin-top: var(--iwb-space-2); }
.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 .15s; } /*iwb:raw-until=3.28.0*/
.iwb-task-result:hover .iwb-task-result-dl { opacity: 1; }
.iwb-task-result-dl .iwb-ic { width: 16px; height: 16px; color: var(--iwb-on-brand); }
@@ -877,14 +877,14 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-combine-srcs { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.iwb-combine-src { font-size: 11px; color: var(--iwb-text2); background: var(--iwb-field); border: 1px solid var(--iwb-border); border-radius: 6px; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 组合来源行里的「样式名」标签(2026-11-14):只给插件提示词类节点打标,帮用户认出这一行来自哪条风格 */
.iwb-combine-src-tag { display: inline-block; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; margin-right: 4px; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--iwb-brand) 16%, transparent); color: var(--iwb-brand-text, var(--iwb-brand)); font-size: 10px; line-height: 15px; }
.iwb-combine-src-tag { display: inline-block; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; margin-right: var(--iwb-space-4); padding: 0 5px; border-radius: var(--iwb-radius-chip); background: color-mix(in srgb, var(--iwb-brand) 16%, transparent); color: var(--iwb-brand-text, var(--iwb-brand)); font-size: var(--iwb-font-2xs); line-height: 15px; } /*iwb:raw-until=3.28.0*/
.iwb-batch-srcs { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.iwb-batch-src { font-size: 11px; color: var(--iwb-text2); background: var(--iwb-field); border: 1px solid var(--iwb-border); border-radius: 6px; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iwb-combine-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.iwb-combine-row .iwb-plabel { flex: 0 0 48px; font-size: 11px; color: var(--iwb-text2); }
.iwb-combine-row .iwb-input { flex: 1 1 auto; font-size: 11px; padding: 3px 5px; }
.iwb-combine-out { margin-top: 6px; border: 1px solid color-mix(in srgb, var(--iwb-brand) 35%, transparent); border-radius: 7px; background: color-mix(in srgb, var(--iwb-brand) 8%, transparent); padding: 6px 8px; }
.iwb-combine-out-label { font-size: 10px; font-weight: 700; color: var(--iwb-brand-text, var(--iwb-brand)); margin-bottom: 3px; }
.iwb-combine-out { margin-top: var(--iwb-space-6); border: 1px solid color-mix(in srgb, var(--iwb-brand) 35%, transparent); border-radius: var(--iwb-radius-chip); background: color-mix(in srgb, var(--iwb-brand) 8%, transparent); padding: 6px 8px; } /*iwb:raw-until=3.28.0*/
.iwb-combine-out-label { font-size: var(--iwb-font-2xs); font-weight: 700; color: var(--iwb-brand-text, var(--iwb-brand)); margin-bottom: 3px; } /*iwb:raw-until=3.28.0*/
.iwb-combine-out-text { font-size: 11px; color: var(--iwb-text); white-space: pre-wrap; word-break: break-all; max-height: 90px; overflow-y: auto; }
/* 输出节点:田字格/瀑布流 + 批量下载 */
@@ -900,10 +900,10 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.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-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 { width: 100%; height: auto; display: block; border-radius: var(--iwb-radius-control); border: 1px solid var(--iwb-border); cursor: zoom-in; background: var(--iwb-layer2); transition: border-color .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-meta { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); text-align: center; margin-top: var(--iwb-space-2); }
.iwb-out-cell-actions { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: center; justify-content: center; gap: var(--iwb-space-10); opacity: 0; transition: opacity .15s; border-radius: 0 0 8px 8px; background: rgba(0,0,0,0.45); } /*iwb:raw-until=3.28.0*/
.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: var(--iwb-panel); color: var(--iwb-brand-text, var(--iwb-brand)); }
@@ -956,7 +956,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-update-bar {
top: 100px; bottom: auto; z-index: 130;
max-width: calc(100vw - 32px); justify-content: center;
animation: iwb-update-in .18s ease-out 1 both;
animation: iwb-update-in .15s ease-out 1 both;
}
@keyframes iwb-update-in {
from { opacity: 0; transform: translate(-50%, -6px); }
@@ -1015,7 +1015,7 @@ 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 { 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 { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: var(--iwb-radius-chip); padding: 7px 10px; background: transparent; color: var(--iwb-text2); cursor: pointer; } /*iwb:raw-until=3.28.0*/
.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; overflow: auto; background: var(--iwb-home-bg); }
@@ -1161,7 +1161,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
* 激活态只有一条规则:品牌淡底 + 品牌字 + 600。此前 5 套变体里的抽屉 / 右竖栏 / 资源中心
* 三套已被新 UI 取代且无任何生产者(dist 里搜不到类名),规则连同父容器一并删除;
* 设置侧栏原先单独写了一份激活态,现在直接继承这一条。 */
.iwb-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: var(--iwb-tab-h); padding: 0 var(--iwb-space-12); border: 0; border-radius: var(--iwb-tab-radius); background: transparent; color: var(--iwb-text2); font-size: var(--iwb-font-sm); cursor: pointer; white-space: nowrap; max-width: 190px; transition: background .15s ease, color .15s ease; }
.iwb-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: var(--iwb-tab-h); padding: 0 var(--iwb-space-12); border: 0; border-radius: var(--iwb-tab-radius); background: transparent; color: var(--iwb-text2); font-size: var(--iwb-font-sm); cursor: pointer; white-space: nowrap; max-width: 190px; transition: background .15s ease, color .15s ease; } /*iwb:raw-until=3.28.0*/
.iwb-tab:hover { background: var(--iwb-hover); color: var(--iwb-text); }
/* 文字用主文字色而不是 brand-text:brand-text 的语义是「品牌色当文字」(链接/按钮),
* 压在品牌淡底上亮色只有 4.42:1(低于 4.5),且比未激活标签的 text2 还弱 —— 选中项不该最不清楚。
@@ -1181,7 +1181,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-tab-dot-err { background: var(--iwb-err); }
.iwb-tab-new { color: var(--iwb-text2); font-weight: 700; padding: 0 var(--iwb-space-8); font-size: var(--iwb-font-lg); line-height: 1; }
.iwb-tab-new:hover { background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); color: var(--iwb-brand-text, var(--iwb-brand)); }
.iwb-tab-close { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 31px; /* 与标签名留约 3 个字的间距(gap 5px + 31px ≈ 36px) */ border: 0; border-radius: var(--iwb-radius-chip); background: transparent; color: var(--iwb-text2); cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; }
.iwb-tab-close { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 31px; /* 与标签名留约 3 个字的间距(gap 5px + 31px ≈ 36px) */ border: 0; border-radius: var(--iwb-radius-chip); background: transparent; color: var(--iwb-text2); cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; } /*iwb:raw-until=3.28.0*/
.iwb-tab:hover .iwb-tab-close { opacity: 1; }
.iwb-tab-close:hover { background: color-mix(in srgb, var(--iwb-text2) 16%, transparent); color: var(--iwb-text); }
.iwb-tab-close .iwb-ic { width: 12px; height: 12px; }
@@ -1482,7 +1482,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* v3.26.60:字号整体上调一档(用户反馈 11px 太小)——胶囊 11→13px、高 22→28px、左右内距 6→10、
间距 4→6、标题 12→14,面板同步 328→360px 抵消放大后的换行。仍是「所有选项同一套数值」,
模型名永不省略的契约不变(靠 min-width: max-content + 面板横向滚动兜底)。 */
.iwb-pop { --iwb-pop-w: 360px; --iwb-pop-pad-y: var(--iwb-space-10); --iwb-pop-pad-x: var(--iwb-space-12); --iwb-pop-gap: var(--iwb-space-8); --iwb-pop-radius: var(--iwb-radius-popover); --iwb-pop-title-size: var(--iwb-font-base); --iwb-pop-chip-h: 28px; --iwb-pop-chip-pad-x: var(--iwb-space-10); --iwb-pop-chip-radius: 6px; --iwb-pop-chip-gap: var(--iwb-space-6); --iwb-pop-chip-size: var(--iwb-font-md); width: var(--iwb-pop-w); max-width: calc(100vw - 16px); background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: var(--iwb-pop-radius); box-shadow: var(--iwb-elevation-3); padding: var(--iwb-pop-pad-y) var(--iwb-pop-pad-x); display: flex; flex-direction: column; gap: var(--iwb-pop-gap); max-height: calc(100vh - 32px); overflow-y: auto; }
.iwb-pop { width: var(--iwb-pop-w); max-width: calc(100vw - 16px); background: var(--iwb-panel); border: var(--iwb-bw) solid var(--iwb-border); border-radius: var(--iwb-pop-radius); box-shadow: var(--iwb-elevation-3); padding: var(--iwb-pop-pad-y) var(--iwb-pop-pad-x); display: flex; flex-direction: column; gap: var(--iwb-pop-gap); 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-weight: 700; color: var(--iwb-text); font-size: var(--iwb-pop-title-size); }
.iwb-pop-body { display: flex; flex-direction: column; gap: var(--iwb-pop-gap); }
@@ -1547,7 +1547,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-layer-prefix { font-size: 11px; color: var(--iwb-text2); background: var(--iwb-layer); border: 1px dashed var(--iwb-border); border-radius: 6px; padding: 3px 6px; word-break: break-all; }
.iwb-layer-rows { display: flex; flex-direction: column; gap: 4px; }
.iwb-layer-row { display: flex; align-items: center; gap: 4px; }
.iwb-layer-idx { flex: 0 0 auto; width: 16px; text-align: center; font-size: 10px; color: var(--iwb-text2); background: var(--iwb-layer); border-radius: 4px; padding: 1px 0; }
.iwb-layer-idx { flex: 0 0 auto; width: 16px; text-align: center; font-size: var(--iwb-font-2xs); color: var(--iwb-text2); background: var(--iwb-layer); border-radius: var(--iwb-radius-chip); padding: 1px 0; } /*iwb:raw-until=3.28.0*/
.iwb-layer-name { flex: 1 1 46%; min-width: 0; height: 24px; font-size: 11px; }
.iwb-layer-bbox { flex: 1 1 40%; min-width: 0; height: 24px; font-size: 11px; }
.iwb-layer-del { flex: 0 0 auto; padding: 2px 6px; line-height: 1; }
@@ -1561,11 +1561,11 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-layer-results { display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--iwb-border2); padding-top: 6px; }
.iwb-layer-resulttitle { font-size: 11px; color: var(--iwb-text2); }
.iwb-layer-item { display: flex; align-items: center; gap: 6px; }
.iwb-layer-thumb { flex: 0 0 auto; width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--iwb-border); border-radius: 4px; background: repeating-conic-gradient(#e9ebef 0% 25%, #fff 0% 50%) 50% / 8px 8px; cursor: zoom-in; }
.iwb-layer-thumb { flex: 0 0 auto; width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-chip); background: repeating-conic-gradient(#e9ebef 0% 25%, #fff 0% 50%) 50% / 8px 8px; cursor: zoom-in; } /*iwb:raw-until=3.28.0*/
.iwb-layer-meta { flex: 1 1 auto; min-width: 0; }
.iwb-layer-itemname { font-size: 11px; color: var(--iwb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-layer-sub { font-size: 10px; color: var(--iwb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-layer-itemsub { font-size: 10px; color: var(--iwb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-layer-sub { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-layer-itemsub { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ── v3.87.6 崩溃可观测性:错误边界兜底 UI + 设置里的「诊断」页 ── */
.iwb-crash-retry { margin-top: 6px; }
@@ -1596,7 +1596,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-shape-box .iwb-textarea { width: 100%; box-sizing: border-box; min-height: 68px; }
.iwb-modal .iwb-section-sub { margin-top: 2px; }
/* v3.87.30 设置弹窗放大(内容多:厂商分类 / 模型清单 / 请求体模板 / 规则) */
.iwb-settings-modal { --iwb-set-label-w: 180px; --iwb-set-col-gap: var(--iwb-space-16); --iwb-set-row-h: 40px; --iwb-set-row-pad-y: var(--iwb-space-6); --iwb-set-title-gap: var(--iwb-space-8); --iwb-set-hint-color: var(--iwb-text-dim); --iwb-set-hint-size: var(--iwb-font-xs); --iwb-set-hint-gap: var(--iwb-space-2); --iwb-set-divider: color-mix(in srgb, var(--iwb-border) 55%, transparent); --iwb-set-group-gap: var(--iwb-space-24); width: min(1180px, 96vw); max-width: 96vw; height: min(92vh, 1040px); max-height: 92vh; }
.iwb-settings-modal { width: min(1180px, 96vw); max-width: 96vw; height: min(92vh, 1040px); max-height: 92vh; }
.iwb-settings-modal .iwb-modal-body { max-height: none; flex: 1 1 auto; min-height: 0; }
/* v3.87.31 模型清单:名称占位更宽 + 「质量」胶囊开关(与"启用"复选框区分) */
.iwb-modelrow { flex: 1 1 460px; }
@@ -1763,7 +1763,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 节点背景色色板(2026-11-01):6 个预设色块 + 「无」。
纯静态 CSS,无动画/滤镜 ⇒ 不改色时开销为 0;改色只重绘该节点区域。 */
.iwb-pop.iwb-bg-palette { display: flex; flex-direction: row; align-items: center; gap: 8px; width: auto; max-width: none; padding: 8px 10px; border-radius: var(--iwb-radius-panel); }
.iwb-bg-swatch { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--iwb-border); cursor: pointer; padding: 0; flex: 0 0 auto; transition: transform .12s, box-shadow .12s; }
.iwb-bg-swatch { width: 26px; height: 26px; border-radius: var(--iwb-radius-control); border: 1px solid var(--iwb-border); cursor: pointer; padding: 0; flex: 0 0 auto; transition: transform .12s, box-shadow .12s; }
.iwb-bg-swatch[data-bg="white"] { background: #fdfdfd; }
.iwb-bg-swatch[data-bg="cyan"] { background: #e1eef0; }
.iwb-bg-swatch[data-bg="purple"] { background: #e7e6f4; }
@@ -1783,7 +1783,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-bg-swatch-none { position: relative; background: transparent !important; }
.iwb-bg-swatch-none::after { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; height: 1px; background: var(--iwb-text2); opacity: .5; transform: rotate(-45deg); }
/* 气泡上的「背景色」按钮:直接显示**当前背景色**的小色块(不再用调色板图标) */
.iwb-bg-dot { width: 16px; height: 16px; border-radius: 5px; padding: 0; pointer-events: none; flex: 0 0 auto; }
.iwb-bg-dot { width: 16px; height: 16px; border-radius: var(--iwb-radius-chip); padding: 0; pointer-events: none; flex: 0 0 auto; }
.iwb-bg-dot.iwb-bg-swatch:hover { transform: none; }
.iwb-bg-palette-host { position: fixed; inset: 0; pointer-events: none; z-index: var(--iwb-z-palette); }
.iwb-bg-palette-host .iwb-pop-anchor { pointer-events: auto; }
@@ -1815,7 +1815,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
* 现在自己没写字时直接把上游文本显示出来(.is-inherited 只改字色,零布局位移),
* 状态条说明「继承 / 已固定」并给出「恢复跟随」。 */
.iwb-inherit-bar { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: var(--iwb-font-xs); line-height: 16px; color: var(--iwb-text2); min-width: 0; }
.iwb-inherit-tag { flex: 0 0 auto; padding: 0 5px; border-radius: 999px; font-size: 10px; color: var(--iwb-brand-text, var(--iwb-brand)); background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); }
.iwb-inherit-tag { flex: 0 0 auto; padding: 0 5px; border-radius: var(--iwb-radius-full); font-size: var(--iwb-font-2xs); color: var(--iwb-brand-text, var(--iwb-brand)); background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); } /*iwb:raw-until=3.28.0*/
.iwb-inherit-tag.is-taken { color: var(--iwb-text); background: color-mix(in srgb, var(--iwb-tint) 10%, transparent); }
.iwb-inherit-src { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iwb-inherit-more { flex: 0 0 auto; opacity: .78; }
@@ -1894,7 +1894,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
background: var(--iwb-panel);
border: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent);
border-radius: var(--iwb-radius-card);
transition: background .14s ease, border-color .14s ease;
transition: background .12s ease, border-color .12s ease;
}
.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); }
@@ -1912,9 +1912,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
padding: 0 var(--iwb-space-6);
border-radius: var(--iwb-radius-full);
font-size: var(--iwb-font-xs); line-height: 17px;
background: color-mix(in srgb, var(--iwb-ok) 14%, transparent);
color: color-mix(in srgb, var(--iwb-ok) 82%, var(--iwb-text));
border: 1px solid color-mix(in srgb, var(--iwb-ok) 32%, transparent);
background: var(--iwb-ok-bg);
color: var(--iwb-ok);
border: 1px solid var(--iwb-ok-bd);
}
.iwb-mk-desc {
flex: 1 1 auto; font-size: var(--iwb-font-sm); line-height: 1.55; color: var(--iwb-text2);
@@ -2001,7 +2001,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.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 { 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::after { content: '▾'; margin-left: var(--iwb-space-6); opacity: .7; font-size: var(--iwb-font-2xs); } /* 提示可点开取色 */
.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: var(--iwb-radius-card); background: var(--iwb-panel); border: 1px solid var(--iwb-border); box-shadow: var(--iwb-elevation-2); }
.iwb-cpick-box { position: relative; height: 132px; border-radius: 6px; cursor: crosshair; }
@@ -2009,8 +2009,8 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.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: 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; }
.iwb-cpick-chan { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: var(--iwb-space-2); font-size: var(--iwb-font-2xs); color: var(--iwb-text2); }
.iwb-cpick-chan input { width: 100%; height: 26px; padding: 0 4px; text-align: center; border-radius: var(--iwb-radius-chip); border: 1px solid var(--iwb-border); background: var(--iwb-layer2); color: var(--iwb-text); font-size: var(--iwb-font-xs); } /*iwb:raw-until=3.28.0*/
.iwb-cpick-foot { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
/* 十六进制输入框可缩到 0(min-width:0 才能被 flex 压窄),「完成」按钮固定不换行 */
.iwb-cpick-input { flex: 1 1 0; min-width: 0; width: auto; height: 26px; font-size: 11px; }
@@ -2048,7 +2048,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-history-embedded { position: relative; }
.iwb-gal-opt { display: inline-flex; align-items: center; gap: 3px; }
/* 三个下拉尽量窄:只留内容 + 箭头的最小宽度(0.5K / 特大 / 全部 都放得下) */
.iwb-gal-opt select, .iwb-gal-opts select { width: auto; min-width: 34px; max-width: 44px; height: 20px; padding: 0 0 0 3px; font-size: 10px; }
.iwb-gal-opt select, .iwb-gal-opts select { width: auto; min-width: 34px; max-width: 44px; height: 20px; padding: 0 0 0 3px; font-size: var(--iwb-font-2xs); } /*iwb:raw-until=3.28.0*/
.iwb-history-grid { overscroll-behavior: contain; }
.iwb-history-head .iwb-btn-sm { padding-left: 6px; padding-right: 6px; }
@@ -2119,7 +2119,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 其它浮层让位(画布不动) */
.iwb-toolbar-wrap { left: var(--iwb-dock-l, 0px); right: calc(60px + var(--iwb-dock-r, 0px)); }
.iwb-minimap {
transition: opacity .16s ease, transform .16s ease;
transition: opacity .15s ease, transform .15s ease;
position: absolute;
width: 132px;
height: 88px;
@@ -2189,7 +2189,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-hotkey-name { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--iwb-text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iwb-hotkey-key {
flex: 0 0 auto; display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
padding: 2px 8px; border-radius: 5px; border: 1px solid var(--iwb-border);
padding: 2px 8px; border-radius: var(--iwb-radius-chip); border: 1px solid var(--iwb-border); /*iwb:raw-until=3.28.0*/
background: var(--iwb-layer); color: var(--iwb-text); font-size: 11px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@@ -2264,13 +2264,13 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-appear-sw i { width: 14px; height: 14px; border-radius: var(--iwb-radius-chip); border: 1px solid var(--iwb-border); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--iwb-text) 28%, transparent); }
.iwb-appear-revert { border: 1px solid var(--iwb-border); background: var(--iwb-layer); color: var(--iwb-text2); font-size: var(--iwb-font-xs); border-radius: var(--iwb-radius-full); padding: 1px var(--iwb-space-6); cursor: pointer; }
.iwb-appear-revert:hover { color: var(--iwb-text); border-color: var(--iwb-border2); }
.iwb-ratio { margin-left: 6px; font-size: 10px; padding: 1px 5px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.iwb-ratio.ok { color: var(--iwb-ok); background: color-mix(in srgb, var(--iwb-ok) 14%, transparent); }
.iwb-ratio.warn { color: var(--iwb-warn); background: color-mix(in srgb, var(--iwb-warn) 16%, transparent); }
.iwb-ratio.bad { color: var(--iwb-err); background: color-mix(in srgb, var(--iwb-err) 16%, transparent); }
.iwb-ratio { margin-left: var(--iwb-space-6); font-size: var(--iwb-font-2xs); padding: 1px 5px; border-radius: var(--iwb-radius-full); border: var(--iwb-bw) solid transparent; font-variant-numeric: tabular-nums; } /*iwb:raw-until=3.28.0*/
.iwb-ratio.ok { color: var(--iwb-ok); background: var(--iwb-ok-bg); }
.iwb-ratio.warn { color: var(--iwb-warn); background: var(--iwb-warn-bg); border-color: var(--iwb-warn-bd); }
.iwb-ratio.bad { color: var(--iwb-err); background: var(--iwb-err-bg); }
.iwb-appear-preset { display: inline-flex; align-items: center; gap: var(--iwb-space-2); }
.iwb-appear-del { border: none; background: transparent; color: var(--iwb-text2); cursor: pointer; font-size: var(--iwb-font-xs); padding: var(--iwb-space-2) var(--iwb-space-4); border-radius: var(--iwb-radius-chip); }
.iwb-appear-del:hover { color: var(--iwb-err); background: color-mix(in srgb, var(--iwb-err) 12%, transparent); }
.iwb-appear-del:hover { color: var(--iwb-err); background: var(--iwb-err-bg); }
@media (max-width: 720px) { .iwb-appear-swaches { padding-left: 92px; } }
/* v3.25.87:插件整页/首页不显示停靠栏(含 iframe 残影,直接 display:none 而不是等淡出) */
@@ -2285,7 +2285,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.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="groups"] .iwb-pcard { border-radius: var(--iwb-radius-card); 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,
@@ -2351,7 +2351,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 设置分组(Obsidian 式):标题在页面底,内容浅灰圆角容器 */
.iwb-settings-modal{--iwb-set-group-bg:color-mix(in srgb, var(--iwb-layer) 60%, var(--iwb-panel));--iwb-set-group-radius:var(--iwb-radius-card);--iwb-set-group-pad-x:var(--iwb-space-20);--iwb-set-group-pad-y:var(--iwb-space-12);--iwb-set-group-gap:var(--iwb-space-32);--iwb-set-row-pad-y:var(--iwb-space-8);--iwb-set-divider:color-mix(in srgb, var(--iwb-border) 55%, transparent)}
/* L3 组件 token 已上移到 src/theme-tokens.js 的 COMPONENT_SCOPED(生成到 design-tokens.css) */
.iwb-gset-page,.iwb-gset-stack{display:flex;flex-direction:column;gap:var(--iwb-set-group-gap)}
.iwb-gset-group{display:flex;flex-direction:column;margin:0}
.iwb-gset-group-h{font-size:var(--iwb-font-lg);font-weight:600;margin:0 0 var(--iwb-set-title-gap,var(--iwb-space-8))}
@@ -2376,7 +2376,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-provider-card .iwb-gset-group-body > .iwb-row .iwb-addr-tag{min-width:42px}
/* 设置页控件描边:比常规 border 更淡,避免框线抢视线 */
.iwb-settings-modal{--iwb-set-input-border:color-mix(in srgb, var(--iwb-border) 40%, var(--iwb-panel))}
.iwb-settings-modal .iwb-input,.iwb-settings-modal .iwb-textarea{border-color:var(--iwb-set-input-border)}
.iwb-settings-modal .iwb-input:focus,.iwb-settings-modal .iwb-textarea:focus{border-color:var(--iwb-brand)}
@@ -2413,12 +2412,10 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-settings-modal .iwb-modellist{margin:0}
/* 分组容器:上下内边距与左右同样由 token 控制;底色取 4% 文字色,保证可见但不抢 */
.iwb-settings-modal{--iwb-set-group-bg:hsl(0 0% 97.6%)}
.theme-dark .iwb-settings-modal{--iwb-set-group-bg:color-mix(in srgb, var(--iwb-text) 8%, var(--iwb-panel))}
/* 分组体底色:见 COMPONENT_SCOPED(亮 hsl(0 0% 97.6%) / 暗 文字色 8%) */
.iwb-gset-group-body{background:var(--iwb-set-group-bg);padding:var(--iwb-set-group-pad-y) var(--iwb-set-group-pad-x)}
/* 设置页控件统一:复选框尺寸/品牌色、按钮组间距 */
.iwb-settings-modal{--iwb-set-check-size:16px;--iwb-set-btn-gap:var(--iwb-space-8);--iwb-set-check-radius:4px}
.iwb-settings-modal input[type="checkbox"]{width:var(--iwb-set-check-size);height:var(--iwb-set-check-size);accent-color:var(--iwb-brand);border-radius:var(--iwb-set-check-radius)}
.iwb-settings-modal .iwb-backup-item{padding:var(--iwb-space-6) 0;gap:var(--iwb-space-8)}
.iwb-settings-modal .iwb-backup-actions{gap:var(--iwb-set-btn-gap)}
+14
View File
@@ -122,6 +122,20 @@ assert('文档 sourceModules 项数 == 快照长度 ' + orderSnapshot.length, fa
assert('文档门禁 spec 数 == 实际 ' + gateSpecCount, factsDoc.includes('**' + gateSpecCount + '** 个进门禁'))
assert('文档门禁链含 test:facts', factsDoc.includes('test:facts'))
// ── 6b. 行数棘轮硬数字(2026-11-24,P0-②)────────────────────────────────────
// 动机:MAX_APP_JS_LINES 等上限被抄进 CONTRIBUTING 与本文档,此前**无人校验**,
// 实测已漂 415 行(文档 8,700 vs 真实 9,115)。规则与测量都在 scripts/ratchet-metrics.js,
// 与 sync-facts 共用一份 —— 避免「同步器说改了、守卫说没改」。
console.log('6b) 棘轮硬数字(文档 == 代码)')
const ratchetMetrics = require(path.join(root, 'scripts', 'ratchet-metrics'))
const measured = ratchetMetrics.measure()
for (const [kind, file] of [['contributing', 'CONTRIBUTING.md'], ['arch', 'docs/standards/architecture-current-state.md']]) {
const text = fs.readFileSync(path.join(root, file), 'utf8')
const res = ratchetMetrics.rewriteDoc(kind, text, measured)
assert(file + ' 的棘轮数字与代码一致', res.changed.length === 0,
'以下数字过时:' + res.changed.join(', ') + ' —— 跑 `node scripts/sync-facts.js --write` 自动修')
}
// ── 7. 基线锚点:文档记录的「基线 SHA + 线上版本」必须与实际一致 ──────────────
// 动机:本文档第 4 行的锚点写着「每次 main 有新提交或线上发版后必须同步」,但此前
// **没有任何机制强制它** —— 事实上它长期停在 `e40d8b4`/v3.20.0(而实际已是 v3.21.0),
+58
View File
@@ -0,0 +1,58 @@
'use strict'
// 组件级 token(L3)三方一致性守卫(v3.26.62,M6)
//
// 为什么需要:--iwb-set-* / --iwb-pop-* 原先手写在 style.css,文档有表格、代码有值,
// 但没有任何断言 —— 实际漂过一次(--iwb-pop-w 从 328 被改到 360,文档晚了一步)。
// 现在值只在 scripts/gen-tokens.js 的 COMPONENT_SCOPED 里写一次,本测试守住三件事:
// A. tokens.json 的 component.<group> 与文档表格里的 token 名双向一致;
// B. style.css 不再重复声明这些 token(否则单一源失效,改一处不生效);
// C. design-tokens.css 里确实生成了这些声明(生成器没漏块)。
const assert = require('assert')
const fs = require('fs')
const path = require('path')
const root = path.resolve(__dirname, '..')
const tokens = JSON.parse(fs.readFileSync(path.join(root, 'dist', 'tokens.json'), 'utf8'))
const css = fs.readFileSync(path.join(root, 'style.css'), 'utf8')
const gen = fs.readFileSync(path.join(root, 'src', 'design-tokens.css'), 'utf8')
const doc = fs.readFileSync(path.join(root, 'docs', 'standards', 'design-tokens.md'), 'utf8')
const GROUPS = {
// 容器级在 §3.11,控件级在 §3.12 —— 同属 component.settings,文档也分两节
settings: { prefix: '--iwb-set-', section: ['### 3.11', '### 3.12'] },
popover: { prefix: '--iwb-pop-', section: ['### 3.13'] }
}
function sectionBody (marker) {
const i = doc.indexOf(marker)
assert.ok(i >= 0, '文档缺少小节:' + marker)
const j = doc.indexOf('### ', i + marker.length)
return doc.slice(i, j > 0 ? j : doc.length)
}
let checked = 0
for (const [group, meta] of Object.entries(GROUPS)) {
const g = (tokens.component || {})[group]
assert.ok(g && typeof g === 'object', 'tokens.json 缺少 component.' + group + '(gen-tokens 的分组映射或 COMPONENT_SCOPED 漏了)')
const codeNames = Object.keys(g).map((k) => meta.prefix + k)
assert.ok(codeNames.length > 0, 'component.' + group + ' 为空')
const body = [].concat(meta.section).map(sectionBody).join('\n')
const docNames = [...new Set([...body.matchAll(/\|\s*`(--iwb-[a-z0-9-]+)`\s*\|/g)].map((m) => m[1]))]
assert.ok(docNames.length > 0, [].concat(meta.section).join('+') + ' 表格里没解析到 token 名(表格格式变了?)')
const missingInDoc = codeNames.filter((n) => !docNames.includes(n))
const missingInCode = docNames.filter((n) => !codeNames.includes(n))
assert.deepStrictEqual(missingInDoc, [], '代码有、文档没写:' + missingInDoc.join(', '))
assert.deepStrictEqual(missingInCode, [], '文档有、代码没定义:' + missingInCode.join(', '))
// B. style.css 不许再声明(单一源)
const inStyle = [...css.matchAll(new RegExp('(' + meta.prefix + '[a-z0-9-]+)\\s*:', 'g'))].map((m) => m[1])
assert.deepStrictEqual(inStyle, [], 'style.css 仍在声明组件 token(应删掉,值只在 COMPONENT_SCOPED):' + inStyle.join(', '))
// C. 生成产物里有值
for (const n of codeNames) assert.ok(gen.includes(n + ':'), 'design-tokens.css 缺少生成项:' + n)
checked += codeNames.length
}
console.log('design-tokens component guard: ' + checked + ' 个组件 token 三方一致(文档 ↔ tokens.json ↔ 生成产物)')
+7 -7
View File
@@ -1,18 +1,18 @@
{
"_comment": "设计 token 棘轮基线(M5-T5.2)。数字只允许下降,不允许上升 —— 涨了就说明新代码写了裸值,改用 token 或(确有必要时)在 PR 里说明并下调别的项把总数补回来。口径来源:node scripts/token-audit.js --json",
"measuredAt": "2026-11-23",
"measuredVersion": "3.26.51",
"measuredAt": "2026-11-24",
"measuredVersion": "3.26.62",
"counts": {
"undefinedRefs": 0,
"deadTokens": 32,
"hex": 79,
"rgb": 55,
"fontSize": 159,
"radius": 95,
"spacing": 377,
"fontSize": 120,
"radius": 74,
"spacing": 353,
"zIndexDecl": 71,
"fontSizeDistinct": 13,
"radiusDistinct": 17,
"fontSizeDistinct": 12,
"radiusDistinct": 14,
"spacingDistinct": 26,
"zIndexDistinct": 31,
"shadowDistinct": 44
+1 -1
View File
@@ -85,7 +85,7 @@ const wait = (ms) => new Promise((r) => setTimeout(r, ms))
const search = host.querySelector('input.iwb-input')
search.value = '收藏'
search.dispatchEvent(new window.Event('input', { bubbles: true }))
await wait(40)
await wait(200) // v1.12.2:搜索重排改为 120ms 防抖(打字不再逐键全量重建,中文输入法组合态才不被打断)
assert.ok(host.querySelector('.iwb-lib-searchscope'), '搜索时应显示「在全部中搜索」范围提示')
assert.ok(cards().length >= 1, '搜索应跨分组命中(实际 ' + cards().length + ')')
const active = host.querySelector('.iwb-chip-active')
+1 -1
View File
@@ -157,7 +157,7 @@ const MAX_SRC_COMPONENT_LINES = 531
// ② 纠正过时的存储口径注释(用户要求:旧的不准确描述要改掉):图库/缩略图/原图档在桌面端是
// images/thumbs、images/gallery 文件,不是 IndexedDB;「1K 插入档降的是长边像素不是体积」。
// 共 6 行注释,属于事实纠错而非功能代码。
const MAX_APP_JS_LINES = 9115 // 2026-11-24 v3.26.61:图库同步边界抽到 src/gallery-sync.js + 纠错存储口径注释
const MAX_APP_JS_LINES = 9105 // 2026-11-24 v3.26.63:收敛确认包装(7 份 → 1 份)+ 剪贴板 5 处改走门面,实测 9104 → 上限 9105
const MAX_APP_JS_SHARE = 0.40
// ── 历史记账(供回溯,逐条保留)──────────────────────────────────────────────