From 5ce8f4a207c920e736989aaa31f9a67355fb7bc6 Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Tue, 3 Nov 2026 14:37:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E7=82=B9=EF=BC=9A=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=B1=82=E8=BF=81=E5=85=A5=20antd=20=E5=8E=9F?= =?UTF-8?q?=E7=94=9F=EF=BC=88Panel/Controls/grid/Input=20+=20app.css=20?= =?UTF-8?q?=E6=B8=85=E7=90=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/UI规范.md | 27 +- frontend/nexprobe.cjs | 113101 +++++++++++++++ frontend/nexprobe.tsx | 20 + frontend/src/components/forms/SecretInput.tsx | 4 +- frontend/src/components/ui/Controls.tsx | 335 +- frontend/src/components/ui/Input.tsx | 19 +- frontend/src/components/ui/Page.tsx | 10 +- frontend/src/components/ui/Panel.tsx | 374 +- frontend/src/components/ui/Status.tsx | 4 +- frontend/src/components/ui/Steps.tsx | 11 +- frontend/src/components/ui/Tile.tsx | 2 +- frontend/src/components/ui/field-labels.ts | 15 - frontend/src/components/ui/grid.tsx | 50 + frontend/src/components/ui/index.ts | 1 + frontend/src/pages/AssetLibrary.tsx | 27 +- frontend/src/pages/Dashboard.tsx | 2 +- frontend/src/pages/Help.tsx | 4 +- frontend/src/pages/ModelCenter.tsx | 10 +- frontend/src/pages/ProjectDetail.tsx | 4 +- frontend/src/pages/UserAdmin.tsx | 2 +- frontend/src/pages/project/AgentConsole.tsx | 12 +- frontend/src/pages/project/Library.tsx | 16 +- frontend/src/pages/project/Review.tsx | 8 +- frontend/src/pages/project/Storyboard.tsx | 14 +- frontend/src/pages/project/Timeline.tsx | 2 +- frontend/src/styles/app.css | 334 +- frontend/src/theme/antd.ts | 91 +- scripts/ui/visualcheck.py | 70 +- 28 files changed, 113881 insertions(+), 688 deletions(-) create mode 100644 frontend/nexprobe.cjs create mode 100644 frontend/nexprobe.tsx delete mode 100644 frontend/src/components/ui/field-labels.ts create mode 100644 frontend/src/components/ui/grid.tsx diff --git a/docs/UI规范.md b/docs/UI规范.md index e315d39..4685106 100644 --- a/docs/UI规范.md +++ b/docs/UI规范.md @@ -48,7 +48,7 @@ | 层 | 唯一来源 | 管什么 | 不管什么 | |---|---|---|---| | **尺子 + 控件皮肤** | **antd 5 默认 token**(`controlHeight` 32 / SM 24 / LG 40;`fontSize` 12 / 14 / 16;`borderRadius` 6 / 8 / 4;`margin*` `padding*`;断点 576/768/992/1200/1600;动效与阴影) | 一切「控件长什么样、多大」 | 业务布局 | -| **主题覆盖** | `theme/antd.ts` 的 `buildAntdTheme(mode)`(全站唯一 `ThemeConfig`) | **只改三类**:① 品牌色(dark `#a0d911` / light `#5b8c00`)② 表面色(layout/container/elevated/描边)③ 少量结构性 ComponentToken(Menu 选中态、Table 表头与分割线、Layout、Drawer 等) | 尺寸档位、圆角、字号——**一个都不覆盖** | +| **主题覆盖** | `theme/antd.ts` 的 `buildAntdTheme(mode)`(全站唯一 `ThemeConfig`) | **只改两类**:① 表面色(layout/container/elevated/描边/外壳三段)② 少量结构性 ComponentToken(Menu 密度与选中态、Table 表头与分割线、Layout、Drawer 等)。**品牌色不改**:`SEED` 里没有 `colorPrimary`,主色就是 antd 出厂蓝(light `#1677ff` / dark `#1668dc`) | 尺寸档位、圆角、字号、主色与它的整条派生梯度——**一个都不覆盖** | | **变量落地** | `theme/antd.ts::applyRootVars()`(`stores/theme.ts` 在切主题时调用) | 把 antd 落不下来的 token 手写到 `` 上:`color*`、`borderRadius*`、`boxShadow*`、`fontFamily/Size/Weight`、`lineHeight*`、`controlHeight*`、`margin*`、`padding*`、`screen*`;末尾追加派生变量 `--nex-bar` | 新增私有数字(它只做转发) | | **布局** | `styles/app.css`(`.nex-*` / `.nf-*` 语义类)+ Tailwind utility | 字段栅格、控件栏、chip 行、标签组、抽屉三段、滚动区、浮层层级;**全站唯一允许出现 `.ant-*` 选择器的地方** | 控件本体 | | **语义** | `components/ui/` `components/forms/` | `Field` `FormRow` `Select` `Check` `Slider` `Button` `Menu` `Drawer` `Modal` `Table` `Tag` `Status`… 这些页面认识的名字(导出名与旧版一致,473 处 import 没动) | 直接 `import 'antd'`(R8) | @@ -142,11 +142,26 @@ CSS 层叠规则是「未分层样式永远赢过分层样式,与选择器特 | 描边 | `border-border` / `border-border-secondary` / `border-split` | `--ant-color-border*` `--ant-color-split` | | 填充(压在表面上的灰) | `bg-fill` `-secondary` `-tertiary` `-quaternary` | `--ant-color-fill*` | -- 明暗两套都只覆盖 `colorPrimary` / `colorLink` / 表面 / 描边 + 少数组件 token; - 状态色、文字四级、填充四级全部交还 antd 算法(`colorInfo` 跟随 `colorPrimary`)。 -- **深色菜单选中态必须显式给**:antd 默认把 `colorPrimaryBg` 压在深底上会变成一大块灰绿、 - 文字只剩 `colorPrimary`,对比度一起塌。两套主题各给一档半透明主色底 - (dark `bg rgba(160,217,17,.14)` / 文字 `#b7e35f`;light `#f0f7e2` / 文字 `#4f7d00`)。 +- **主色不覆盖,而且覆盖不回来**:`SEED` 里写 `colorPrimary: '#1668dc'`(dark 的出厂值) + 量到的却是 `#165bbe`——`darkAlgorithm` 会把手上的 seed 再走一遍色板生成器并取第 5 档, + 所以「填出厂值」≠「不填」。**要出厂蓝就只能删掉覆盖**(`visualcheck.py` 按 + `--ant-color-primary` = `#1677ff` / `#1668dc` 断言,写回任何值都会红)。 + `colorLink` / `colorInfo` / `colorTextLightSolid` 同理全部不写:默认就等于 `colorPrimary` / 白字。 +- **绿只表示状态,不表示可点**:`success` 一族只做「完成 / 合格 / 正常」(`Tag tone="ok"`、 + 流程 `done`、`micOk`);链接、选中态、命中底纹、动作胶囊一律 `primary`。 + 上一版主色是柠檬绿时两者同色,于是 `LINK_CLS`、`Tile` 命中态、`Stat` active、 + 分镜卡片灯带都借了 `text-success` / `border-success-border`——标准蓝之下必须拆开, + 否则浅蓝底纹压绿描边,一块东西两种色相。口径:**一档一色,描边与底纹同族** + (绿边配 `bg-success-bg`、红边配 `bg-error-bg`、琥珀边配 `bg-warning-bg`)。 +- **深色菜单选中态必须显式给,但给的是 antd 自己的那一组**:侧栏两套主题都渲染 + `theme="light"` 的 Menu(见 `AppSider` 注释),深色下拿到的是 light 菜单默认的 + `controlItemBgActive` + `colorPrimary`,实测 `#15325b` 底 + `#1668dc` 字 = **2.2:1**, + 选中项比未选中还弱。这里补上 antd dark 菜单的默认对: + `itemSelectedBg = colorPrimary(#1668dc)` 实心块 + `itemSelectedColor = #fff`(**6.4:1**), + 按下态取 `colorPrimaryActive(#1554ad)`。浅色什么都不写——`#e6f4ff` + `#1677ff` 就是 antd 官网侧栏。 +- 表面色(dark `#0d1117 / #141b23 / #1a232c`、light `#f0f4f8 / #ffffff`)与三个状态色的 + 深浅档保留覆盖:前者是中性冷灰、不是品牌色,深色工作台要靠它分外壳与内容; + 后者取的都是 `@ant-design/colors` 现成色板的档位,只调明度不改语义。 - 字面量 `#hex` / `rgb()` 只允许出现在 `theme/antd.ts` 里;`#fff` / `#000` 作为 `--color-white` / `--color-black` 登记过,可用于压在图片上的描边与角标。 - 旧的 `--c-*` / `--fs-*` / `accent-deep` / `ink-*` / `panel` / `faint` / `line` 全部作废 diff --git a/frontend/nexprobe.cjs b/frontend/nexprobe.cjs new file mode 100644 index 0000000..4a8ae4f --- /dev/null +++ b/frontend/nexprobe.cjs @@ -0,0 +1,113101 @@ +var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); +//#endregion +require("react"); +let react_jsx_runtime = require("react/jsx-runtime"); +//#region node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +/** +* @license React +* react-dom-server-legacy.node.production.min.js +* +* Copyright (c) Facebook, Inc. and its affiliates. +* +* This source code is licensed under the MIT license found in the +* LICENSE file in the root directory of this source tree. +*/ +var require_react_dom_server_legacy_node_production_min = /* @__PURE__ */ __commonJSMin(((exports) => { + var ea = require("react"); + var fa = require("stream"); + var n = Object.prototype.hasOwnProperty; + var ha = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/; + var ia = {}; + var ja = {}; + function ka(a) { + if (n.call(ja, a)) return !0; + if (n.call(ia, a)) return !1; + if (ha.test(a)) return ja[a] = !0; + ia[a] = !0; + return !1; + } + function q(a, b, c, d, f, e, g) { + this.acceptsBooleans = 2 === b || 3 === b || 4 === b; + this.attributeName = d; + this.attributeNamespace = f; + this.mustUseProperty = c; + this.propertyName = a; + this.type = b; + this.sanitizeURL = e; + this.removeEmptyString = g; + } + var r = {}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) { + r[a] = new q(a, 0, !1, a, null, !1, !1); + }); + [ + ["acceptCharset", "accept-charset"], + ["className", "class"], + ["htmlFor", "for"], + ["httpEquiv", "http-equiv"] + ].forEach(function(a) { + var b = a[0]; + r[b] = new q(b, 1, !1, a[1], null, !1, !1); + }); + [ + "contentEditable", + "draggable", + "spellCheck", + "value" + ].forEach(function(a) { + r[a] = new q(a, 2, !1, a.toLowerCase(), null, !1, !1); + }); + [ + "autoReverse", + "externalResourcesRequired", + "focusable", + "preserveAlpha" + ].forEach(function(a) { + r[a] = new q(a, 2, !1, a, null, !1, !1); + }); + "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a) { + r[a] = new q(a, 3, !1, a.toLowerCase(), null, !1, !1); + }); + [ + "checked", + "multiple", + "muted", + "selected" + ].forEach(function(a) { + r[a] = new q(a, 3, !0, a, null, !1, !1); + }); + ["capture", "download"].forEach(function(a) { + r[a] = new q(a, 4, !1, a, null, !1, !1); + }); + [ + "cols", + "rows", + "size", + "span" + ].forEach(function(a) { + r[a] = new q(a, 6, !1, a, null, !1, !1); + }); + ["rowSpan", "start"].forEach(function(a) { + r[a] = new q(a, 5, !1, a.toLowerCase(), null, !1, !1); + }); + var la = /[\-:]([a-z])/g; + function ma(a) { + return a[1].toUpperCase(); + } + "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a) { + var b = a.replace(la, ma); + r[b] = new q(b, 1, !1, a, null, !1, !1); + }); + "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a) { + var b = a.replace(la, ma); + r[b] = new q(b, 1, !1, a, "http://www.w3.org/1999/xlink", !1, !1); + }); + [ + "xml:base", + "xml:lang", + "xml:space" + ].forEach(function(a) { + var b = a.replace(la, ma); + r[b] = new q(b, 1, !1, a, "http://www.w3.org/XML/1998/namespace", !1, !1); + }); + ["tabIndex", "crossOrigin"].forEach(function(a) { + r[a] = new q(a, 1, !1, a.toLowerCase(), null, !1, !1); + }); + r.xlinkHref = new q("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1); + [ + "src", + "href", + "action", + "formAction" + ].forEach(function(a) { + r[a] = new q(a, 1, !1, a.toLowerCase(), null, !0, !0); + }); + var t = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0 + }; + var na = [ + "Webkit", + "ms", + "Moz", + "O" + ]; + Object.keys(t).forEach(function(a) { + na.forEach(function(b) { + b = b + a.charAt(0).toUpperCase() + a.substring(1); + t[b] = t[a]; + }); + }); + var oa = /["'&<>]/; + function u(a) { + if ("boolean" === typeof a || "number" === typeof a) return "" + a; + a = "" + a; + var b = oa.exec(a); + if (b) { + var c = "", d, f = 0; + for (d = b.index; d < a.length; d++) { + switch (a.charCodeAt(d)) { + case 34: + b = """; + break; + case 38: + b = "&"; + break; + case 39: + b = "'"; + break; + case 60: + b = "<"; + break; + case 62: + b = ">"; + break; + default: continue; + } + f !== d && (c += a.substring(f, d)); + f = d + 1; + c += b; + } + a = f !== d ? c + a.substring(f, d) : c; + } + return a; + } + var pa = /([A-Z])/g; + var qa = /^ms-/; + var ra = Array.isArray; + function v(a, b) { + return { + insertionMode: a, + selectedValue: b + }; + } + function sa(a, b, c) { + switch (b) { + case "select": return v(1, null != c.value ? c.value : c.defaultValue); + case "svg": return v(2, null); + case "math": return v(3, null); + case "foreignObject": return v(1, null); + case "table": return v(4, null); + case "thead": + case "tbody": + case "tfoot": return v(5, null); + case "colgroup": return v(7, null); + case "tr": return v(6, null); + } + return 4 <= a.insertionMode || 0 === a.insertionMode ? v(1, null) : a; + } + var ta = /* @__PURE__ */ new Map(); + function ua(a, b, c) { + if ("object" !== typeof c) throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."); + b = !0; + for (var d in c) if (n.call(c, d)) { + var f = c[d]; + if (null != f && "boolean" !== typeof f && "" !== f) { + if (0 === d.indexOf("--")) { + var e = u(d); + f = u(("" + f).trim()); + } else { + e = d; + var g = ta.get(e); + void 0 !== g ? e = g : (g = u(e.replace(pa, "-$1").toLowerCase().replace(qa, "-ms-")), ta.set(e, g), e = g); + f = "number" === typeof f ? 0 === f || n.call(t, d) ? "" + f : f + "px" : u(("" + f).trim()); + } + b ? (b = !1, a.push(" style=\"", e, ":", f)) : a.push(";", e, ":", f); + } + } + b || a.push("\""); + } + function w(a, b, c, d) { + switch (c) { + case "style": + ua(a, b, d); + return; + case "defaultValue": + case "defaultChecked": + case "innerHTML": + case "suppressContentEditableWarning": + case "suppressHydrationWarning": return; + } + if (!(2 < c.length) || "o" !== c[0] && "O" !== c[0] || "n" !== c[1] && "N" !== c[1]) { + if (b = r.hasOwnProperty(c) ? r[c] : null, null !== b) { + switch (typeof d) { + case "function": + case "symbol": return; + case "boolean": if (!b.acceptsBooleans) return; + } + c = b.attributeName; + switch (b.type) { + case 3: + d && a.push(" ", c, "=\"\""); + break; + case 4: + !0 === d ? a.push(" ", c, "=\"\"") : !1 !== d && a.push(" ", c, "=\"", u(d), "\""); + break; + case 5: + isNaN(d) || a.push(" ", c, "=\"", u(d), "\""); + break; + case 6: + !isNaN(d) && 1 <= d && a.push(" ", c, "=\"", u(d), "\""); + break; + default: b.sanitizeURL && (d = "" + d), a.push(" ", c, "=\"", u(d), "\""); + } + } else if (ka(c)) { + switch (typeof d) { + case "function": + case "symbol": return; + case "boolean": if (b = c.toLowerCase().slice(0, 5), "data-" !== b && "aria-" !== b) return; + } + a.push(" ", c, "=\"", u(d), "\""); + } + } + } + function x(a, b, c) { + if (null != b) { + if (null != c) throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); + if ("object" !== typeof b || !("__html" in b)) throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information."); + b = b.__html; + null !== b && void 0 !== b && a.push("" + b); + } + } + function va(a) { + var b = ""; + ea.Children.forEach(a, function(a) { + null != a && (b += a); + }); + return b; + } + function wa(a, b, c, d) { + a.push(z(c)); + var f = c = null, e; + for (e in b) if (n.call(b, e)) { + var g = b[e]; + if (null != g) switch (e) { + case "children": + c = g; + break; + case "dangerouslySetInnerHTML": + f = g; + break; + default: w(a, d, e, g); + } + } + a.push(">"); + x(a, f, c); + return "string" === typeof c ? (a.push(u(c)), null) : c; + } + var xa = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; + var ya = /* @__PURE__ */ new Map(); + function z(a) { + var b = ya.get(a); + if (void 0 === b) { + if (!xa.test(a)) throw Error("Invalid tag: " + a); + b = "<" + a; + ya.set(a, b); + } + return b; + } + function za(a, b, c, d, f) { + switch (b) { + case "select": + a.push(z("select")); + var e = null, g = null; + for (l in c) if (n.call(c, l)) { + var h = c[l]; + if (null != h) switch (l) { + case "children": + e = h; + break; + case "dangerouslySetInnerHTML": + g = h; + break; + case "defaultValue": + case "value": break; + default: w(a, d, l, h); + } + } + a.push(">"); + x(a, g, e); + return e; + case "option": + g = f.selectedValue; + a.push(z("option")); + var k = h = null, m = null; + var l = null; + for (e in c) if (n.call(c, e)) { + var p = c[e]; + if (null != p) switch (e) { + case "children": + h = p; + break; + case "selected": + m = p; + break; + case "dangerouslySetInnerHTML": + l = p; + break; + case "value": k = p; + default: w(a, d, e, p); + } + } + if (null != g) if (c = null !== k ? "" + k : va(h), ra(g)) { + for (d = 0; d < g.length; d++) if ("" + g[d] === c) { + a.push(" selected=\"\""); + break; + } + } else "" + g === c && a.push(" selected=\"\""); + else m && a.push(" selected=\"\""); + a.push(">"); + x(a, l, h); + return h; + case "textarea": + a.push(z("textarea")); + l = g = e = null; + for (h in c) if (n.call(c, h) && (k = c[h], null != k)) switch (h) { + case "children": + l = k; + break; + case "value": + e = k; + break; + case "defaultValue": + g = k; + break; + case "dangerouslySetInnerHTML": throw Error("`dangerouslySetInnerHTML` does not make sense on