fix(plugin): 插件独立底色改为可选,默认关闭(v3.25.92)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m7s

This commit is contained in:
qiqi committed 2026-11-21 16:08:22 +08:00
1 parent ad1bb6016e
commit 22f4d7adb0
13 files changed
+71 -28

No files matched your search

+9 -2
View File
@@ -58,7 +58,7 @@
return out
}
const DEFAULTS = { seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22, pluginTint: 12 }
const DEFAULTS = { seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22, pluginTint: 12, pluginTintOn: false }
function derive (cfg, dark) {
const c = cfg || {}
@@ -106,7 +106,7 @@
return {
err, ok, warn, onBrand,
pluginSurface, pluginCard, pluginInset, pluginHover,
pluginSurface, pluginCard, pluginInset, pluginHover, pluginTintOn: c.pluginTintOn === true,
bg: surface0,
panel: surface1,
layer,
@@ -131,6 +131,13 @@
function applyTo (root, tokens) {
if (!root || !root.style) return
// 插件独立底色开关:挂在 <html> 上,CSS 用 html[data-plugin-tint="1"] 作用域
try {
if (typeof document !== 'undefined' && document.documentElement) {
if (tokens && tokens.pluginTintOn) document.documentElement.setAttribute('data-plugin-tint', '1')
else document.documentElement.removeAttribute('data-plugin-tint')
}
} catch (e) { /* ignore */ }
const s = (k, v) => { if (v) root.style.setProperty(k, v) }
s('--iwb-bg', tokens.bg)
s('--iwb-canvas-bg', tokens.canvasBg)
+6 -2
View File
@@ -16,7 +16,7 @@
canvasBgLight: '#d9dbde', canvasBgDark: '#6f6f6f',
gridDotLight: '#c9ccd6', gridDotDark: '#8f8f8f', gridSize: 1.4, gridGap: 22, gridOn: true, gridStyle: 'dots',
// v3.25.81:自动配色(默认开)——只定 4 个种子,其余由 src/theme-tokens.js 派生
auto: true, seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22, pluginTint: 12,
auto: true, seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22, pluginTint: 12, pluginTintOn: false,
edgeColorLight: '#b9bfca', edgeColorDark: '#7a7a7a',
edgeWidth: 1.8, edgeDash: 'dashed',
edgeHotLight: '#6b7280', edgeHotDark: '#ffffff',
@@ -65,6 +65,7 @@
seedAccent: normHex(c.seedAccent) || DEFAULTS.seedAccent,
depth: clamp(c.depth, 0, 60, DEFAULTS.depth),
pluginTint: clamp(c.pluginTint, 0, 30, DEFAULTS.pluginTint),
pluginTintOn: c.pluginTintOn === true,
nodeBgLight: hex('nodeBgLight'), nodeBgDark: hex('nodeBgDark'),
nodeBorderLight: hex('nodeBorderLight'), nodeBorderDark: hex('nodeBorderDark'),
nodeRadius: clamp(c.nodeRadius, 6, 20, DEFAULTS.nodeRadius),
@@ -400,8 +401,11 @@
], ['auto', 'seedNeutral', 'seedAccent', 'depth'])
const pluginGroup = Group('插件面板', [
Row('独立底色', el('label', { className: 'iwb-check' },
el('input', { type: 'checkbox', checked: value.pluginTintOn, onChange: (e) => set({ pluginTintOn: e.target.checked }) }),
'插件面板用浅灰底(关闭=沿用旧外观)'), '默认关闭:关闭后插件完全按原有配色'),
Row('底色深浅', el('input', { type: 'range', min: 0, max: 30, step: 1, value: value.pluginTint, className: 'iwb-appear-range', onChange: (e) => set({ pluginTint: Number(e.target.value) }) }), String(value.pluginTint)),
], ['pluginTint'])
], ['pluginTint', 'pluginTintOn'])
return el('div', { className: 'iwb-appear' },
autoGroup, themeGroup, pluginGroup, value.auto ? el('div', { className: 'iwb-appear-note-only' }, '自动配色已开启;关闭后可逐项微调(画布 / 连线 / 节点)。') : canvasGroup, value.auto ? null : edgeGroup, value.auto ? null : nodeGroup,
el('div', { className: 'iwb-row', style: { marginTop: 12 } },