nex_animation/nex.config.yaml

147 lines
8.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# ─────────────────────────────────────────────────────────────────────────────
# Nex Animation Studio · NEX 项目配置
#
# 本文件是「项目现状声明」,不是愿望清单:每个数值都能在前端代码里查到出处。
# NEX Design System 0.1.1 是跨项目通用设计标准,不是本项目的固定布局模板。
# NEX 与本文件冲突时,以本文件 + docs/UI规范.md 为准(判定与例外见
# docs/NEX-对照与例外.md)。
#
# 维护规则:改了 theme/antd.ts、app/layout/AppSider.tsx、app/App.tsx 里任何
# 一个布局尺寸,必须同步本文件,否则本文件就失去了「现状声明」的资格。
# ─────────────────────────────────────────────────────────────────────────────
nex:
system: NEX Design System
version: 0.1.1
compliance: required
# 规范权威顺序(自上而下)。NEX 文档在最下层:它给原则,不给本项目尺寸。
authority:
- docs/UI规范.md # 项目级 UI/UX 权威:尺子、口径、20 条硬规则、§15 探针清单
- docs/工程规范.md # 目录职责、脚本准入、测试与部署
- docs/NEX-对照与例外.md # NEX 逐条判定 + 项目级例外登记(冲突时按此执行)
- frontend/src/theme/antd.ts # 数值的唯一实现
- nex_design_system/docs/ # 跨项目原则层(02–08)与采纳路线(09–10)
project:
name: Nex Animation Studio
type: enterprise-web-app # 长视频编导工作台(流水线型专业工具,非内容站)
language: zh-CN
frontend:
framework: react
framework_version: "18"
language: typescript # 全站 TS,0 个 .jsx/.js 页面
build_tool: vite
ui_library: antd
ui_library_version: "5"
# 注意:NEX 0.1.1 样例写的是 css-variables-and-plain-css,那是另一个产品
# (NexDocus)的现状。本项目是 Tailwind v4 只做布局、视觉全部交还 antd。
styling: tailwind-v4-over-antd-tokens
styling_flow: theme/antd.ts → applyRootVars() → :root{--ant-*} → styles/index.css @theme → Tailwind 语义类
styling_rules:
- 单向:antd token → --ant-* → @theme → Tailwind 语义类;禁止反向在页面里造颜色/字号/圆角档
- 禁止新增与现有局部变量冲突的 --nex-* 变量命名空间(已占用:见 docs/NEX-对照与例外.md §4)
- styles/app.css 是全站唯一允许出现 .ant-* 选择器的文件
- 布局 utility 依赖三层层叠声明,见 docs/UI规范.md R13
router: react-router
router_version: "6"
state_management: zustand
charts: none # 无图表依赖、无图表组件;Dashboard 的「趋势层」不适用
icons: "@ant-design/icons,且只在 components/icons/index.ts 一处 import(R11)"
# 应用外壳:以下是本项目**已验证**的尺寸,NEX 的 64/260/80/16/1280 不适用于本项目
shell:
default: NexAppShell
header_height: 56 # theme/antd.ts:113 HEADER_HEIGHT
sidebar_width: 224 # app/layout/AppSider.tsx:47 SIDER_WIDTH(窄屏抽屉同宽)
sidebar_collapsed_width: 64 # app/layout/AppSider.tsx:49 SIDER_COLLAPSED_WIDTH(仅 ≥768 手工折叠)
sidebar_narrow: drawer # <768 不渲染 Sider:app/App.tsx:187 + AppSider.tsx:145 AppNavDrawer
content_padding: 24 # app/App.tsx:188(窄屏 16 / 12:max-lg:p-4 max-md:p-3)
content_max_width: 1680 # app/App.tsx:189
note: 以上尺寸均已验证;要改先登记例外(docs/NEX-对照与例外.md §3)
# 控件与圆角一律沿用 antd 默认档位;NEX 03 §7/§5 的 34/40 与六档圆角不适用
controls: { sm: 24, md: 32, lg: 40 }
radius: { xs: 2, sm: 4, base: 6, lg: 8, full: 9999 }
font_sizes: { sm: 12, base: 14, lg: 16 }
breakpoints: [576, 768, 992, 1200, 1600] # = antd Grid xs…xxl;禁止私档断点(R9)
# 登记断点(UI规范 §4 / NEX 04 §8.1):一把尺子只服务一个表面,px 由 16 档视口实测得出,不得随意并入主阶梯。
# 这五档 + 主阶梯由 classaudit.mjs 第 9 闸 BP 与 styles/index.css 的 --breakpoint-* 逐档对账。
breakpoints_registered:
insp-lg: 1400 # Storyboard.tsx 检查器宽度第一档
board: 1240 # Storyboard.tsx 看板卡宽 258→224 地板
insp-md: 1080 # Storyboard.tsx 检查器宽度第二档
insp-sm: 720 # Storyboard.tsx 检查器整屏 + 素材列表单列
agent: 620 # AgentConsole.tsx 指令折叠头整行折行
color_primary: antd-default # 不覆盖 colorPrimary:light #1677ff / dark #1668dc 由算法给
z_index: 见 docs/UI规范.md §10 与 frontend/src/lib/layers.ts(阶段 3 建立层级表)
themes:
- light
- dark
theme_mechanism: # 比 NEX 06 §8 的假设更完整,保留现状
- 跟随系统 prefers-color-scheme + 手动覆盖
- localStorage: nex-the
- <html data-theme> + color-scheme + <meta name="theme-color">
- 快捷键 ⌘⇧L
- 自绘区域与控件读同一批 --ant-*(cssVar: true),切主题不重算样式表
# NEX 07 的页面模式在本项目的适用性(不适用 ≠ 不符合,见对照文档 §2)
page_patterns:
applicable: [dashboard-overview, data-list, detail, settings, auth-standalone, canvas-workspace, review-approval]
not_applicable: [document-workspace, conversation-workspace] # 本项目没有文档/PDF/AI Chat 页面
project_specific: [canvas-workspace, review-approval] # NEX 尚无对应模板,需在 NEX 侧补
components:
kit: [frontend/src/components/ui, frontend/src/components/forms] # 25 文件 / 163 导出,NEX 05 §3 已 100% 覆盖
nex_react_package: forbidden # 不引入第二套 NEX 组件包
media_kit: frontend/src/components/media # 灯箱/缩略图/录音/版本面板,专业交互,保留
a11y_focus_owner: frontend/src/styles/app.css 全站 :focus-visible 兜底
# 项目真实存在的检查命令。没有 lint,也没有 test —— 不得虚构。
verification:
npm_scripts: [dev, build, typecheck, preview]
ui_gates:
- node scripts/ui/classaudit.mjs # 静态:9 道子闸(死类名/图标/裸 button/浮层底部/antd import/反馈表面/标题图形/标签皮肤/断点对账)
- .venv/bin/python scripts/ui/visualcheck.py
- .venv/bin/python scripts/ui/tableaudit.py
- .venv/bin/python scripts/ui/gridcheck.py
- .venv/bin/python scripts/ui/rhythmcheck.py
- .venv/bin/python scripts/ui/tagcheck.py
- .venv/bin/python scripts/ui/btnrowcheck.py
- .venv/bin/python scripts/ui/aligncheck.py
- .venv/bin/python scripts/ui/symmetrycheck.py
- .venv/bin/python scripts/ui/footercheck.py
- .venv/bin/python scripts/ui/btnclustercheck.py
- .venv/bin/python scripts/ui/feedbackcheck.py
- .venv/bin/python scripts/ui/semanticcheck.py # 阶段 8.5 第 4 项:辅助技术语义与行为(AX 名称/热区/Tab/焦点环/ARIA/live/六态)
- .venv/bin/python scripts/ui/gateprobe.py # 反向验证:证明闸门真的会红
baseline: 14 路由 × {1440,768,430} × {light,dark} = 84 个状态
flow: docs/UI规范.md §16(十二步改动流程,改尺子必须全量回归含 430/576)
dev_base_url: http://127.0.0.1:5199 # :5173 是陈旧实例;:8000 被别的项目占用
dev_backend_port: 8010
# ── 项目必须达到的设计/体验结果(Agent 视为实施约束,不是参考建议)──────────
requirements:
use_shared_components: true
use_design_tokens: true
maintain_existing_interactions: true
# 本项目追加:成熟资产优先保留,禁止为形式统一重写已验证实现
preserve_validated_design: true
single_token_source: true # antd token 是唯一尺子
light_dark_pair_review: true
rules:
hardcoded_design_values: forbidden
direct_ant_design_usage: allowed_for_low_level_components
direct_ant_design_usage_scope: [theme/, app/providers.tsx, app/, components/ui/, components/forms/]
reusable_patterns_must_use_nex: true # 含义是「走 kit」,不是「装 NEX 包」
require_light_dark_review: true
require_responsive_review: true
require_keyboard_review: true
preserve_existing_stack: true
# 本项目追加
custom_breakpoints: registered_only # R9:禁止裸 max-[Npx];确需时按 UI规范 §4 / NEX 04 §8.1 登记成命名断点(第 9 闸守护)
new_css_variable_namespace: forbidden # 不新增 --nex-* 全局令牌层
nex_component_package: forbidden
chart_library_for_alignment_only: forbidden
batch_css_or_token_rewrite: forbidden