@agile-team/wl-skills-ui 1.12.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -33
- package/README.md +79 -74
- package/SKILL.md +6 -1
- package/bin/wl-ui.js +361 -350
- package/docs/ag-grid-empty-state.md +1 -1
- package/docs/compat-matrix.md +2 -2
- package/docs/split-grid-resize.md +1 -1
- package/docs/table-overflow-tooltip.md +2 -0
- package/docs/version-history.md +17 -2
- package/es/auto.js +2 -2
- package/es/{chunk-45TG53SI.js → chunk-GPDL5QNR.js} +62 -16
- package/es/{chunk-Q62CGYZA.js → chunk-KH5UJQLR.js} +4 -4
- package/es/{chunk-ZZXLRRGF.js → chunk-ZDMBAIBJ.js} +31 -31
- package/es/common-preset.d.ts +2 -2
- package/es/common-preset.js +4 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +4 -4
- package/es/presets/security.js +2 -2
- package/es/profiles/legacy-jh-ag.js +2 -2
- package/es/profiles/legacy-jh-element.js +2 -2
- package/es/profiles/native-element.js +2 -2
- package/es/profiles/native-jh-ag.d.ts +2 -0
- package/es/profiles/native-jh-ag.js +5 -0
- package/es/{profiles-7TD466QR.d.ts → profiles-DNF5Zsu3.d.ts} +1 -1
- package/mcp/server.js +20 -16
- package/package.json +175 -172
- package/reference/ag-cell-renders.ts +22 -22
- package/scanner/coverage.mjs +2 -0
- package/scanner/engine.mjs +5 -1
- package/scanner/fix.mjs +12 -31
- package/scanner/index.mjs +204 -187
- package/scanner/integration.mjs +219 -207
- package/scanner/report.mjs +24 -11
- package/scanner/rules/_shared.mjs +10 -0
- package/scanner/rules/button.mjs +2 -8
- package/scanner/rules/form.mjs +10 -9
- package/scanner/ui-contract.mjs +1 -1
- package/skills/element/el-form/SKILL.md +4 -3
- package/standards/profiles-loader.mjs +121 -76
- package/standards/profiles.json +38 -30
- package/standards/rules.json +47 -47
- package/standards/ui/03-form.md +4 -2
- package/styles/vendors/_ag-grid.scss +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,35 +4,75 @@ All notable changes to **@agile-team/wl-skills-ui** will be documented in this f
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
-
## [Unreleased]
|
|
8
|
-
|
|
9
|
-
## [1.
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- `
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [1.13.1] - 2026-09-30
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- R008 不再漏检 `BaseForm` / `BaseQuery` 的 `label-width`:覆盖原生与封装表单的静态宽度写法,仍为 `info` 且不自动修改;动态宽度及无关节点不误报。
|
|
14
|
+
|
|
15
|
+
### Docs
|
|
16
|
+
|
|
17
|
+
- 明确 150px 只是预警下限。长标签须测量实际文本并与列数、至少 160px 的输入区共同核对;禁止为解决局部截断而全局取消 jh/Base 标签省略。补充宽/窄屏浏览器几何验收。
|
|
18
|
+
|
|
19
|
+
## [1.13.0] - 2026-09-30
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- 新增 `native-jh-ag` 能力 Profile,覆盖平台子应用终态形态:native 运行时(`defineColumns`/`renderOps` + common preset)叠加 jh/Base/C 封装组件,AG Grid 经 npm 依赖或 Module Federation 远程提供。样式入口为 `styles/presets/full`(包根 `styles` 全量写法等价认可),runtime guard 与 `legacy-jh-ag` 同集(分屏 resize + AG 空态),`runtime/auto` 作为等价 runtime 引用被 I003 接受。
|
|
24
|
+
- Profile 解析新增 `explicit` 语义:`.wl-skills-ui-manifest.json` 的 `profile` 字段与 `.wl-ui-profile.json`、`--profile` 参数同为显式声明来源。
|
|
25
|
+
- 依赖识别支持 Module Federation AG 形态:存在 `@originjs/vite-plugin-federation` 依赖时按 AG 形态给出建议(平台子应用的 AG Grid 经 `agGridApp` 远程提供,npm 依赖不可见)。
|
|
26
|
+
- MCP 工具的 `profile` 枚举改由 `profiles.json` 事实源动态生成(此前硬编码三处,新增 profile 后 MCP 客户端会被 schema 拒绝)。
|
|
27
|
+
|
|
28
|
+
### 性能与内存(运行时 guard)
|
|
29
|
+
|
|
30
|
+
- `theme-lock`:mutation 回调改为仅 html/body 自身 style 改写或 body 整替时重新落锁——原先任意 DOM 批量变更都执行 62 token × 2 元素的 CSSOM 读写(繁忙页面每帧必付),并顺带消除 childList 场景的重复双写。
|
|
31
|
+
- `ag-grid-empty-state`:属性记录(class/aria-hidden/hidden)不再走 `scanElement` 的 DOM 查询(AG Grid 每帧改写 style/class 的高频路径从全文档查询降为 O(1),可见性与布局由 rAF 刷新统一计量);grid 断连时同步退订其独占的 root/host/body resize 监听(共享宿主有引用保护),消除微前端反复挂载/卸载的游离 DOM 强引用泄漏。
|
|
32
|
+
- `split-grid-resize`:支持换 document 重绑(与其余 guard 对齐,微前端销毁重建不再残留旧 document 监听);pane 断连后即时退订 resize 监听。
|
|
33
|
+
- `renderers`:`autoTagType` 哈希循环外提 `String(value)`(原 O(n²) 字符串分配);`warnUnknownOpType` 的 NODE_ENV 探测提到模块顶层只做一次。
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- 修复 fixer 与规则判定复制导致的漂移风险:`CREATE_ACTION_LABEL`、`hasTrueBooleanAttr` 收敛为单一实现(`rules/_shared.mjs` / `button.mjs` 导出),fixer 直接复用,杜绝"扫描报问题但 fix 不修"。
|
|
38
|
+
- 修复两份 `walkVue` 语义分叉:fixer 改用 engine 的稳定排序实现(支持单文件、目标不存在时显式报错),并从共享包默认排除清单中移除业务目录名 `SelectPopupCom`。
|
|
39
|
+
- 修复 Markdown 报告"按规则统计"严重度列的 R01x 序号启发式失真:改读 `rules.json` 真实 severity;`summary` 的 `bySeverity` 补齐 `suggestion`/`review` 契约键。
|
|
40
|
+
- 修复 AG loading 动画 SVG data-URI 中 URL 编码的旧亮蓝色(`%232254F4`/`%237A98F8`)绕过禁色门禁的问题:改用品牌 token 色阶(primary/light-3/light-8/light-9),禁色正则补 `%23` 编码变体。
|
|
41
|
+
- 修复 `--wk-rating-lv*` token 前缀拼写漂移:统一为 `--wl-rating-lv*`(UI 契约扫描同时容忍新旧前缀);`coverage` 的 `el-pagination → element/el-dialog` 映射补充意图注释(R011 弹窗分页路由,非错误)。
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- **兼容承诺:严格校验只认显式声明的 Profile。** `wl-ui check` / `wl-ui all` 在未显式声明 profile 时按 1.11 兼容口径校验(全量 `styles` 入口 + 任意 runtime 引用即通过),依赖自动识别仅用于 Skill 过滤与建议输出,不再作为执法依据——修复 1.12 把存量绿灯项目判红的问题。
|
|
46
|
+
- `wl-ui init` 仅在显式 `--profile` 时写入/更新 `.wl-ui-profile.json` 与安装清单的 `profile` 字段;自动识别结果只打印建议(`npx wl-ui init --profile <id>`),不再落盘固化猜测。
|
|
47
|
+
- `R003`、`R021` 等 Base/AG 专属规则同步对 `native-jh-ag` 启用。
|
|
48
|
+
|
|
49
|
+
## [1.12.0] - 2026-08-30
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- 新增 `native-element`、`legacy-jh-element`、`legacy-jh-ag` 三个能力 Profile,统一声明 adapter、扫描规则、SCSS preset 与 runtime guard;提供 `.wl-ui-profile.json`、`wl-ui profiles` 和自动依赖识别。
|
|
54
|
+
- 新增 `wl-ui-scan.summary.v1` 与可分页的 `compact.v2` 低 token 协议;规则公共字段集中在 `ruleCatalog`,CLI/MCP 支持 `limit/cursor/nextCursor`。
|
|
55
|
+
- 新增 R043 静态已知按钮文案到语义 icon 的确定性规则,并加入 pass/fail fixture、fixer 与一致性门禁。
|
|
56
|
+
- Fixer 新增 `profile/only/skip` 范围约束、逐规则改动统计和 SHA-256 `planHash`;支持预览后以 `--plan-hash` 拒绝漂移计划。
|
|
57
|
+
- 新增共享 `scanner/engine.mjs`,CLI 与 MCP 使用同一扫描实现;MCP 不再为每次 scan/check/fix preview 创建 Node 子进程。
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
|
|
61
|
+
- `standards/rules.json` 成为 category、severity、layer、vendor、Profile 和 fixability 的运行期事实源;39 条元数据与 39 个实现一一对应,14 条可修规则与 fixer 集合一致。
|
|
62
|
+
- AG Grid 改为显式可选 adapter:R021、AG 样式、分屏/空态 observers 只在 `legacy-jh-ag` 启用。两个非 AG Profile 的编译产物由门禁保证零 `.ag-*` 选择器。
|
|
63
|
+
- `installCommonPreset()` 默认使用 `native-element`;旧 `runtime/auto` 与 `styles/skin` 保留 full legacy 兼容。
|
|
64
|
+
- MCP scan 默认从 `compact` 改为更小的 `summary`;changed-only 范围失败默认终止,显式 `--changed-fallback full` 才允许全量。
|
|
65
|
+
- 单文件编辑器安装改为托管 Skill 路由块,不再拼接全量 Skill;update/clean 保留项目自有 `AGENTS.md`、`CLAUDE.md`、`.clinerules` 内容和其他 MCP server。
|
|
66
|
+
- CI 增加 scanner/scripts lint、TypeScript 检查、覆盖率阈值、全部 Profile SCSS 编译、非 AG 隔离、规则/Skill 引用、生成 token 同步、包内容和浏览器契约门禁,并移除安装阶段重复 build。
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
|
|
70
|
+
- 修复 `verify-package` 的 `Buffer.compare` 条件恒不成立,`dist/tokens.css` 漂移现在会阻止发布。
|
|
71
|
+
- 修复 fixer 忽略 `--only/--skip/mode` 并无条件把 BaseTable 切到 AG Grid 的问题。
|
|
72
|
+
- 修复 R013 脱离规则注册表、规则实现字段与元数据不一致、coverage/MCP 推荐不存在的 Skill 路径,以及 JSON fix 输出混入文本复检日志。
|
|
73
|
+
- 修复单文件安装覆盖用户规则、clean 删除整份用户文件、`.mcp.json` 清理误删其他 server 的风险。
|
|
74
|
+
- 修复扫描路径以 target 而非项目根为基准,导致单文件报告文件名为空、标准 `src/**` 豁免无法命中的问题。
|
|
75
|
+
- MCP target/exempt/project 现在受 `WL_PROJECT_ROOT` 边界约束;无效 changed fallback 与无法解析的用户 `.mcp.json` 均失败关闭,不再静默扩大扫描或覆盖配置。
|
|
36
76
|
|
|
37
77
|
## [1.11.1] - 2026-08-26
|
|
38
78
|
|
|
@@ -41,10 +81,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
41
81
|
- AG Grid 空态守护导致上下分栏(`jh-drag-row`)手柄失去拖动行程:旧逻辑对分栏内所有 pane 按首次观测高度做快照并以 `min-height` 钉死,两侧地板相加约等于容器高度,分栏内任意一侧表格为空时手柄即拖不动,直到空态消失才解钉(wl-ui-produce 计划下达页实测复盘)。现只给持有空态表格的 pane 设置内容需求地板(pane 内非表格内容实测高度 + 160px 空态最小数据区),未持有空态表格的 pane 不钉死;空态提示保护、分屏根滚动、左右分栏同高语义与清理逻辑均不变。左右分栏(`drag-col`)路径零改动。
|
|
42
82
|
|
|
43
83
|
## [1.11.0] - 2026-08-24
|
|
44
|
-
|
|
45
|
-
### Fixed
|
|
46
|
-
|
|
47
|
-
- AG Grid 选择列表头/行复选框横向错轴:平台定制版行 cell 不携带 `ag-checkbox-cell` 结构类,补充 `:has(.ag-selection-checkbox)` 反选兜底并清默认 widget 间距;全选框为表头 cell 直接子节点时改绝对定位居中,不强制 display、不压缩 comp-wrapper,普通表头隐藏的 select-all 节点保持不可见(produce 事故复盘,新增 5 项几何回归测试 ag-grid-selection-alignment)。
|
|
84
|
+
|
|
85
|
+
### Fixed
|
|
86
|
+
|
|
87
|
+
- AG Grid 选择列表头/行复选框横向错轴:平台定制版行 cell 不携带 `ag-checkbox-cell` 结构类,补充 `:has(.ag-selection-checkbox)` 反选兜底并清默认 widget 间距;全选框为表头 cell 直接子节点时改绝对定位居中,不强制 display、不压缩 comp-wrapper,普通表头隐藏的 select-all 节点保持不可见(produce 事故复盘,新增 5 项几何回归测试 ag-grid-selection-alignment)。
|
|
48
88
|
|
|
49
89
|
### Added
|
|
50
90
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @agile-team/wl-skills-ui
|
|
2
2
|
|
|
3
|
-
**企业级 UI 一致性与 AI 精确治理工具包 v1.
|
|
3
|
+
**企业级 UI 一致性与 AI 精确治理工具包 v1.13.1** — 面向 Vue 3 + Element Plus 的设计令牌、能力 Profile、样式皮肤、页面骨架、运行时能力、静态扫描、确定性修复、AI Skill、MCP 与脱敏 UI 模板契约。
|
|
4
4
|
|
|
5
5
|
它把“视觉统一、问题识别、机械修复、项目适配和样例沉淀”拆成可验证、可组合的工程能力。脚本、规则和 MCP 先完成确定性工作,AI 只处理业务语义与人工决策,从而减少重复读源码、上下文 token 和误修改。
|
|
6
6
|
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
| --- | --- | --- |
|
|
14
14
|
| 统一新项目视觉 | Design Tokens、Element Plus 原子样式、页面 Layout、Runtime Preset | 颜色、尺寸、间距、圆角、表格和业务状态从同一事实源产生 |
|
|
15
15
|
| 低成本治理老项目 | Skin 模式、Base*/jh-*/C_*/AG Grid 兼容层、定制页豁免 | 不改封装源码也能统一大部分视觉,避免一次性重构风险 |
|
|
16
|
-
| 阻止 UI 回归 | 39 条 R-rule、接入检查、漂移基线、Git 增量扫描、CI 门禁 | 表头/内容不共轴、按钮无图标、日期弹层全屏等问题在提交前暴露 |
|
|
17
|
-
| 安全机械修复 | Profile、only/skip、dry-run 计划哈希、快照、复检与回滚 | 自动化只处理可证明安全且已批准的动作,不让 AI 猜测批改 |
|
|
18
|
-
| 降低 AI token | summary、compact-v2 分页、changed-only、Skill 路由、13 个 MCP Tool | AI 先读总览和结构化事实,只在必要时获取有界明细或局部源码 |
|
|
16
|
+
| 阻止 UI 回归 | 39 条 R-rule、接入检查、漂移基线、Git 增量扫描、CI 门禁 | 表头/内容不共轴、按钮无图标、日期弹层全屏等问题在提交前暴露 |
|
|
17
|
+
| 安全机械修复 | Profile、only/skip、dry-run 计划哈希、快照、复检与回滚 | 自动化只处理可证明安全且已批准的动作,不让 AI 猜测批改 |
|
|
18
|
+
| 降低 AI token | summary、compact-v2 分页、changed-only、Skill 路由、13 个 MCP Tool | AI 先读总览和结构化事实,只在必要时获取有界明细或局部源码 |
|
|
19
19
|
| 沉淀领域样例 | `ui-contract` extract / validate / match | 页面转为脱敏语义 JSON,不复制整页代码、接口、字段值或原始文案 |
|
|
20
20
|
| 兼容多代项目 | EP 2.2+jh-ui 与原生 EP 2.7+ DOM 契约、Vite/doctor 检查 | 支持声明有 fixture 和真实浏览器证据,不靠文档口头约定 |
|
|
21
21
|
| 降低运行时开销 | Shared Observer Hub、可选 guard、幂等安装与完整卸载 | 全部 guard 共用 1 个 MutationObserver + 1 个 ResizeObserver |
|
|
@@ -31,36 +31,39 @@ pnpm add @agile-team/wl-skills-ui
|
|
|
31
31
|
# npm i @agile-team/wl-skills-ui
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
### 2. 选择能力 Profile
|
|
34
|
+
### 2. 选择能力 Profile
|
|
35
35
|
|
|
36
|
-
Profile 同时决定 vendor adapter、扫描规则、样式入口和 runtime guard。AG Grid 是可选 adapter,不再由 `BaseTable` 隐式推断。
|
|
37
|
-
|
|
38
|
-
| Profile | 样式入口 | Runtime 入口 | AG Grid |
|
|
39
|
-
| --- | --- | --- | --- |
|
|
40
|
-
| `native-element` | `styles/presets/native-element` | `runtime/profiles/native-element` | 关闭 |
|
|
41
|
-
| `legacy-jh-element` | `styles/presets/legacy-jh-element` | `runtime/profiles/legacy-jh-element` | 关闭 |
|
|
42
|
-
| `legacy-jh-ag` | `styles/presets/legacy-jh-ag` | `runtime/profiles/legacy-jh-ag` | 开启 |
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
Profile 同时决定 vendor adapter、扫描规则、样式入口和 runtime guard。AG Grid 是可选 adapter,不再由 `BaseTable` 隐式推断。
|
|
37
|
+
|
|
38
|
+
| Profile | 样式入口 | Runtime 入口 | AG Grid |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| `native-element` | `styles/presets/native-element` | `runtime/profiles/native-element` | 关闭 |
|
|
41
|
+
| `legacy-jh-element` | `styles/presets/legacy-jh-element` | `runtime/profiles/legacy-jh-element` | 关闭 |
|
|
42
|
+
| `legacy-jh-ag` | `styles/presets/legacy-jh-ag` | `runtime/profiles/legacy-jh-ag` | 开启 |
|
|
43
|
+
| `native-jh-ag` | `styles/presets/full`(等价包根 `styles` 全量入口) | `runtime/profiles/native-jh-ag`(`runtime/auto` 同集别名) | 开启 |
|
|
44
|
+
|
|
45
|
+
> **兼容承诺(1.13 起)**:只有显式声明(`--profile` / `.wl-ui-profile.json` / 安装清单)的 profile 才驱动严格校验;依赖自动识别仅用于 Skill 过滤与建议。未声明 profile 的项目按 1.11 兼容口径校验(全量 `styles` 入口 + 任意 runtime 引用即通过),升级不会把存量绿灯判红。
|
|
46
|
+
|
|
47
|
+
Native 项目:
|
|
45
48
|
|
|
46
49
|
```scss
|
|
47
50
|
// src/assets/styles/index.scss
|
|
48
|
-
@use "@agile-team/wl-skills-ui/styles/presets/native-element" as *;
|
|
51
|
+
@use "@agile-team/wl-skills-ui/styles/presets/native-element" as *;
|
|
49
52
|
```
|
|
50
53
|
|
|
51
54
|
```ts
|
|
52
55
|
// src/main.ts
|
|
53
|
-
import "@agile-team/wl-skills-ui/runtime/profiles/native-element";
|
|
56
|
+
import "@agile-team/wl-skills-ui/runtime/profiles/native-element";
|
|
54
57
|
```
|
|
55
58
|
|
|
56
|
-
不使用 AG Grid 的老项目:
|
|
59
|
+
不使用 AG Grid 的老项目:
|
|
57
60
|
|
|
58
61
|
```scss
|
|
59
|
-
@use "@agile-team/wl-skills-ui/styles/presets/legacy-jh-element" as *;
|
|
62
|
+
@use "@agile-team/wl-skills-ui/styles/presets/legacy-jh-element" as *;
|
|
60
63
|
```
|
|
61
64
|
|
|
62
65
|
```ts
|
|
63
|
-
import "@agile-team/wl-skills-ui/runtime/profiles/legacy-jh-element";
|
|
66
|
+
import "@agile-team/wl-skills-ui/runtime/profiles/legacy-jh-element";
|
|
64
67
|
```
|
|
65
68
|
|
|
66
69
|
如需最早稳定 CSS 变量,可在 `index.html` 的 `<head>` 先加载:
|
|
@@ -75,12 +78,12 @@ import "@agile-team/wl-skills-ui/runtime/profiles/legacy-jh-element";
|
|
|
75
78
|
### 3. 安装 AI Skill 并验证
|
|
76
79
|
|
|
77
80
|
```bash
|
|
78
|
-
npx wl-ui init --project . --profile native-element
|
|
79
|
-
npx wl-ui check --project .
|
|
80
|
-
npx wl-ui scan --target src --output summary
|
|
81
|
+
npx wl-ui init --project . --profile native-element
|
|
82
|
+
npx wl-ui check --project .
|
|
83
|
+
npx wl-ui scan --target src --output summary
|
|
81
84
|
```
|
|
82
85
|
|
|
83
|
-
老项目选择 `legacy-jh-element` 或 `legacy-jh-ag`。`init`
|
|
86
|
+
老项目选择 `legacy-jh-element` 或 `legacy-jh-ag`;平台子应用(native 运行时 + jh/Base 封装 + 联邦 AG Grid)选择 `native-jh-ag`。`init` 仅在显式 `--profile` 时写入 `.wl-ui-profile.json`,自动识别只打印建议;单文件编辑器只维护带边界标记的轻量 Skill 路由块,不覆盖项目自有 `AGENTS.md / CLAUDE.md / .clinerules` 内容。`update`、`diff`、`doctor` 和 `clean --dry-run` 负责后续生命周期。
|
|
84
87
|
|
|
85
88
|
## 能力地图
|
|
86
89
|
|
|
@@ -94,13 +97,14 @@ npx wl-ui scan --target src --output summary
|
|
|
94
97
|
|
|
95
98
|
Vendor 覆盖顺序是:`Base* > jh-* > C_*/c_* > AG Grid > custom wrappers`。越靠前越接近项目事实源,通用兜底不得覆盖已识别的专用结构。
|
|
96
99
|
|
|
97
|
-
旧 `native/skin` 参数仍作为兼容别名;新接入应使用 Profile:
|
|
100
|
+
旧 `native/skin` 参数仍作为兼容别名;新接入应使用 Profile:
|
|
98
101
|
|
|
99
|
-
| Profile | 层级 | 适用场景 | 边界 |
|
|
102
|
+
| Profile | 层级 | 适用场景 | 边界 |
|
|
100
103
|
| --- | --- | --- | --- |
|
|
101
|
-
| `native-element` | L0/L1/L3/L4 | 新项目、可渐进重构项目 | 不加载 legacy vendor 与 AG Grid |
|
|
102
|
-
| `legacy-jh-element` | L0-L2 | Base/jh/C 老项目,Element 表格 | 编译产物不含 `.ag-*` 选择器,不启动 AG observer |
|
|
103
|
-
| `legacy-jh-ag` | L0-L2 | 明确使用 AG Grid 的老项目 | 启用 AG 样式、R021、分屏和空态 guard |
|
|
104
|
+
| `native-element` | L0/L1/L3/L4 | 新项目、可渐进重构项目 | 不加载 legacy vendor 与 AG Grid |
|
|
105
|
+
| `legacy-jh-element` | L0-L2 | Base/jh/C 老项目,Element 表格 | 编译产物不含 `.ag-*` 选择器,不启动 AG observer |
|
|
106
|
+
| `legacy-jh-ag` | L0-L2 | 明确使用 AG Grid 的老项目 | 启用 AG 样式、R021、分屏和空态 guard |
|
|
107
|
+
| `native-jh-ag` | L0-L4 | 平台子应用终态:native 运行时叠 jh/Base 封装,AG 经联邦或 npm | full 样式全集 + Base/AG 规则(R003/R021)+ 分屏与空态 guard |
|
|
104
108
|
|
|
105
109
|
## 分别使用各项能力
|
|
106
110
|
|
|
@@ -109,10 +113,10 @@ Vendor 覆盖顺序是:`Base* > jh-* > C_*/c_* > AG Grid > custom wrappers`。
|
|
|
109
113
|
按控制范围选择一个入口,不要重复导入:
|
|
110
114
|
|
|
111
115
|
```scss
|
|
112
|
-
@use "@agile-team/wl-skills-ui/styles" as *; // 完整 L0-L3
|
|
113
|
-
@use "@agile-team/wl-skills-ui/styles/presets/native-element" as *; // 无 legacy/AG
|
|
114
|
-
@use "@agile-team/wl-skills-ui/styles/presets/legacy-jh-element" as *; // legacy,无 AG
|
|
115
|
-
@use "@agile-team/wl-skills-ui/styles/presets/legacy-jh-ag" as *; // legacy + AG
|
|
116
|
+
@use "@agile-team/wl-skills-ui/styles" as *; // 完整 L0-L3
|
|
117
|
+
@use "@agile-team/wl-skills-ui/styles/presets/native-element" as *; // 无 legacy/AG
|
|
118
|
+
@use "@agile-team/wl-skills-ui/styles/presets/legacy-jh-element" as *; // legacy,无 AG
|
|
119
|
+
@use "@agile-team/wl-skills-ui/styles/presets/legacy-jh-ag" as *; // legacy + AG
|
|
116
120
|
@use "@agile-team/wl-skills-ui/styles/presets/skin" as *; // 老项目 L0-L2
|
|
117
121
|
@use "@agile-team/wl-skills-ui/styles/presets/element-only" as *; // L0-L1
|
|
118
122
|
@use "@agile-team/wl-skills-ui/styles/presets/tokens-only" as *; // 仅 L0
|
|
@@ -132,6 +136,7 @@ Vendor 覆盖顺序是:`Base* > jh-* > C_*/c_* > AG Grid > custom wrappers`。
|
|
|
132
136
|
- `defineColumns()` 默认补齐叶子列和表头居中,并合并业务已有 `cellStyle/cellClass/headerClass`;传 `defaultAlign: null` 可退出。
|
|
133
137
|
- 普通按钮默认要求 `size="small"` 且带语义图标;已声明动态尺寸、link/text 或操作列图标按钮不会被误改。
|
|
134
138
|
- 表单输入、Select、Date/Time Picker 默认 small,日期时间输入根使用 `style="width:100%"`。
|
|
139
|
+
- 长标签布局按实际文本、字体和容器宽度确定:R008 对 `el-form`、`BaseForm`、`BaseQuery` 的静态 `labelWidth` / `label-width` 小于 150px 给出人工复核提示;150px 不是统一修复值。加宽标签时同步保证输入区至少 160px,必要时减少列数;不全局取消 jh/Base 标签省略。详见[表单规范](standards/ui/03-form.md)。
|
|
135
140
|
- 原生 `el-date-picker` / `el-time-picker` 的面板通过 Teleport 渲染,面板同样带 `.el-date-picker` 类。包内 `_picker.scss`、R042 与浏览器契约共同阻止裸几何样式把弹层放大为全屏;输入宽度只作用于 `.el-date-editor` 或组件 style,弹层规则必须从 `.el-picker__popper` 限定。
|
|
136
141
|
|
|
137
142
|
```ts
|
|
@@ -153,17 +158,17 @@ const columns = defineColumns([
|
|
|
153
158
|
|
|
154
159
|
### Runtime Guard 与共享观察器
|
|
155
160
|
|
|
156
|
-
`installUiRuntimeGuards()` 与旧 `runtime/auto` 为兼容入口,仍开启全部保护;新项目应使用显式 Profile。`installCommonPreset()` 默认使用 `native-element`,不会启动 AG Grid observer:
|
|
161
|
+
`installUiRuntimeGuards()` 与旧 `runtime/auto` 为兼容入口,仍开启全部保护;新项目应使用显式 Profile。`installCommonPreset()` 默认使用 `native-element`,不会启动 AG Grid observer:
|
|
157
162
|
|
|
158
163
|
```ts
|
|
159
|
-
import {
|
|
160
|
-
getObserverHubStats,
|
|
161
|
-
installUiRuntimeGuards,
|
|
162
|
-
installUiRuntimeProfile,
|
|
164
|
+
import {
|
|
165
|
+
getObserverHubStats,
|
|
166
|
+
installUiRuntimeGuards,
|
|
167
|
+
installUiRuntimeProfile,
|
|
163
168
|
uninstallUiRuntimeGuards,
|
|
164
169
|
} from "@agile-team/wl-skills-ui/runtime";
|
|
165
170
|
|
|
166
|
-
installUiRuntimeProfile("native-element");
|
|
171
|
+
installUiRuntimeProfile("native-element");
|
|
167
172
|
console.log(getObserverHubStats(document));
|
|
168
173
|
|
|
169
174
|
// 微前端或轻量页面可只启用需要的保护
|
|
@@ -186,22 +191,22 @@ Observer Hub 按 Document/Window 隔离:全部 guard 开启时仍只有一个
|
|
|
186
191
|
# 人工阅读
|
|
187
192
|
npx wl-ui scan --target src --output markdown --outFile report.md
|
|
188
193
|
|
|
189
|
-
# AI/MCP 默认先取总览,不包含逐条问题
|
|
190
|
-
npx wl-ui scan --target src --output summary
|
|
191
|
-
|
|
192
|
-
# 按需取有界明细:规则公共字段只出现一次,可用 nextCursor 翻页
|
|
193
|
-
npx wl-ui scan --target src --output compact-v2 --limit 50 --cursor 0
|
|
194
|
+
# AI/MCP 默认先取总览,不包含逐条问题
|
|
195
|
+
npx wl-ui scan --target src --output summary
|
|
196
|
+
|
|
197
|
+
# 按需取有界明细:规则公共字段只出现一次,可用 nextCursor 翻页
|
|
198
|
+
npx wl-ui scan --target src --output compact-v2 --limit 50 --cursor 0
|
|
194
199
|
|
|
195
|
-
# PR 只扫 Git 变更;范围失败默认终止,避免意外全量输出
|
|
196
|
-
npx wl-ui scan --target src --changed --base origin/main --output summary
|
|
197
|
-
# 只有明确接受全量时才加:--changed-fallback full
|
|
200
|
+
# PR 只扫 Git 变更;范围失败默认终止,避免意外全量输出
|
|
201
|
+
npx wl-ui scan --target src --changed --base origin/main --output summary
|
|
202
|
+
# 只有明确接受全量时才加:--changed-fallback full
|
|
198
203
|
|
|
199
204
|
# 只看指定层、vendor 或规则
|
|
200
205
|
npx wl-ui scan --target src --mode skin --layer L0,L1,L2
|
|
201
206
|
npx wl-ui scan --target src --vendor "jh-*,AG Grid"
|
|
202
207
|
npx wl-ui scan --target src --only R001,R005,R041,R042
|
|
203
|
-
npx wl-ui scan --target src --skip R031-R037
|
|
204
|
-
npx wl-ui rules describe R043
|
|
208
|
+
npx wl-ui scan --target src --skip R031-R037
|
|
209
|
+
npx wl-ui rules describe R043
|
|
205
210
|
```
|
|
206
211
|
|
|
207
212
|
SFC 解析器有三种模式:
|
|
@@ -217,11 +222,11 @@ SFC 解析器有三种模式:
|
|
|
217
222
|
### Fix、快照与漂移
|
|
218
223
|
|
|
219
224
|
```bash
|
|
220
|
-
# 一定先预览
|
|
221
|
-
npx wl-ui fix --target src --profile native-element --only R001,R006,R043 --dry-run --output json
|
|
222
|
-
|
|
223
|
-
# 使用预览返回的 planHash 执行同一计划;默认先创建 .wl-snapshot
|
|
224
|
-
npx wl-ui fix --target src --profile native-element --only R001,R006,R043 --plan-hash <hash>
|
|
225
|
+
# 一定先预览
|
|
226
|
+
npx wl-ui fix --target src --profile native-element --only R001,R006,R043 --dry-run --output json
|
|
227
|
+
|
|
228
|
+
# 使用预览返回的 planHash 执行同一计划;默认先创建 .wl-snapshot
|
|
229
|
+
npx wl-ui fix --target src --profile native-element --only R001,R006,R043 --plan-hash <hash>
|
|
225
230
|
|
|
226
231
|
# 复检与回滚
|
|
227
232
|
npx wl-ui scan --target src --fail-on-error
|
|
@@ -234,7 +239,7 @@ npx wl-ui audit --target src --output json --refresh-baseline
|
|
|
234
239
|
npx wl-ui drift --baseline .wl-baseline.json --current current.json --fail-on-error
|
|
235
240
|
```
|
|
236
241
|
|
|
237
|
-
Fixer 只处理规则目录中声明 `autoFixable` 且已实现的机械变换,并让 `profile / only / skip` 同时约束预览、写入和复检。静态已知按钮文案由 R043 的确定映射修复;动态或未知语义仍归 R005 人工确认。计划哈希不一致时拒绝写入。
|
|
242
|
+
Fixer 只处理规则目录中声明 `autoFixable` 且已实现的机械变换,并让 `profile / only / skip` 同时约束预览、写入和复检。静态已知按钮文案由 R043 的确定映射修复;动态或未知语义仍归 R005 人工确认。计划哈希不一致时拒绝写入。
|
|
238
243
|
|
|
239
244
|
### AI Skill
|
|
240
245
|
|
|
@@ -242,7 +247,7 @@ Fixer 只处理规则目录中声明 `autoFixable` 且已实现的机械变换
|
|
|
242
247
|
|
|
243
248
|
```text
|
|
244
249
|
用 wl-ui 的 legacy-skin-align 流程统一这个老项目,只处理 L0-L2。
|
|
245
|
-
扫描当前 PR 的 UI 变更,先给 summary,不修改代码。
|
|
250
|
+
扫描当前 PR 的 UI 变更,先给 summary,不修改代码。
|
|
246
251
|
检查这个列表页的表格中心轴、small 图标按钮和日期弹层边界。
|
|
247
252
|
把这个成熟页面提取为 produce 领域的脱敏 ui-contract,并匹配已有模板。
|
|
248
253
|
```
|
|
@@ -250,7 +255,7 @@ Fixer 只处理规则目录中声明 `autoFixable` 且已实现的机械变换
|
|
|
250
255
|
生命周期命令:
|
|
251
256
|
|
|
252
257
|
```bash
|
|
253
|
-
npx wl-ui init --project . --editor all --profile native-element
|
|
258
|
+
npx wl-ui init --project . --editor all --profile native-element
|
|
254
259
|
npx wl-ui update --project . --force
|
|
255
260
|
npx wl-ui diff --project .
|
|
256
261
|
npx wl-ui doctor --project . --print-overrides
|
|
@@ -356,8 +361,8 @@ Schema 见 [`standards/ui-contract.schema.json`](standards/ui-contract.schema.js
|
|
|
356
361
|
### 新项目从零接入
|
|
357
362
|
|
|
358
363
|
```text
|
|
359
|
-
wl-ui init --profile native-element
|
|
360
|
-
→ 导入 native-element styles/runtime
|
|
364
|
+
wl-ui init --profile native-element
|
|
365
|
+
→ 导入 native-element styles/runtime
|
|
361
366
|
→ defineColumns + renderOps
|
|
362
367
|
→ wl-ui check
|
|
363
368
|
→ wl-ui scan --parser sfc
|
|
@@ -367,10 +372,10 @@ wl-ui init --profile native-element
|
|
|
367
372
|
### 老项目低风险化妆
|
|
368
373
|
|
|
369
374
|
```text
|
|
370
|
-
wl_ui_detect_skin / wl-ui doctor
|
|
371
|
-
→ wl-ui init --profile legacy-jh-element(或 legacy-jh-ag)
|
|
372
|
-
→ 导入对应 profile styles/runtime
|
|
373
|
-
→ scan --profile <id> --output summary
|
|
375
|
+
wl_ui_detect_skin / wl-ui doctor
|
|
376
|
+
→ wl-ui init --profile legacy-jh-element(或 legacy-jh-ag)
|
|
377
|
+
→ 导入对应 profile styles/runtime
|
|
378
|
+
→ scan --profile <id> --output summary
|
|
374
379
|
→ fix --dry-run
|
|
375
380
|
→ 用户确认后 fix
|
|
376
381
|
→ 浏览器契约复查 Picker、Table、AG Grid
|
|
@@ -380,15 +385,15 @@ wl_ui_detect_skin / wl-ui doctor
|
|
|
380
385
|
|
|
381
386
|
```text
|
|
382
387
|
wl_ui_route_intent
|
|
383
|
-
→ wl_ui_scan(changedOnly=true, output=summary, parser=auto)
|
|
384
|
-
→ wl_ui_recommend_flow
|
|
385
|
-
→ wl_ui_scan(output=compact-v2, limit=50) 获取有界明细
|
|
386
|
-
→ AI 只读取命中的局部文件与 Skill
|
|
388
|
+
→ wl_ui_scan(changedOnly=true, output=summary, parser=auto)
|
|
389
|
+
→ wl_ui_recommend_flow
|
|
390
|
+
→ wl_ui_scan(output=compact-v2, limit=50) 获取有界明细
|
|
391
|
+
→ AI 只读取命中的局部文件与 Skill
|
|
387
392
|
→ wl_ui_fix_dry_run
|
|
388
393
|
→ 用户确认后 CLI 修复与复扫
|
|
389
394
|
```
|
|
390
395
|
|
|
391
|
-
`summary` 不携带逐条描述;`compact-v2` 把 severity/category/suggestion 收进一次性的 `ruleCatalog`,并用 cursor/limit 控制明细上限。单文件编辑器的安装产物也从全量 Skill 拼接改成按需路由。三者共同避免 AI 默认读取整份报告、整套 Skill 或整项目源码。
|
|
396
|
+
`summary` 不携带逐条描述;`compact-v2` 把 severity/category/suggestion 收进一次性的 `ruleCatalog`,并用 cursor/limit 控制明细上限。单文件编辑器的安装产物也从全量 Skill 拼接改成按需路由。三者共同避免 AI 默认读取整份报告、整套 Skill 或整项目源码。
|
|
392
397
|
|
|
393
398
|
### 成熟页面沉淀与复用
|
|
394
399
|
|
|
@@ -423,9 +428,9 @@ npx wl-ui check --project .
|
|
|
423
428
|
npx wl-ui doctor --project . --print-overrides
|
|
424
429
|
```
|
|
425
430
|
|
|
426
|
-
完整矩阵见 [`docs/compat-matrix.md`](docs/compat-matrix.md)。不要在未升级 jh-ui 的情况下单独把集团 EP 2.2 组合升级到社区新版;DOM 假设不同,尤其会影响 input wrapper、表单状态和复合控件。
|
|
427
|
-
|
|
428
|
-
本轮的分类模型、门禁、token 预算与 AG Grid 替换路径见 [`docs/optimization-plan-1.12.md`](docs/optimization-plan-1.12.md),长期分层边界见 [`standards/architecture/01-layer-boundaries.md`](standards/architecture/01-layer-boundaries.md)。
|
|
431
|
+
完整矩阵见 [`docs/compat-matrix.md`](docs/compat-matrix.md)。不要在未升级 jh-ui 的情况下单独把集团 EP 2.2 组合升级到社区新版;DOM 假设不同,尤其会影响 input wrapper、表单状态和复合控件。
|
|
432
|
+
|
|
433
|
+
本轮的分类模型、门禁、token 预算与 AG Grid 替换路径见 [`docs/optimization-plan-1.12.md`](docs/optimization-plan-1.12.md),长期分层边界见 [`standards/architecture/01-layer-boundaries.md`](standards/architecture/01-layer-boundaries.md)。
|
|
429
434
|
|
|
430
435
|
## CLI 速查
|
|
431
436
|
|
|
@@ -439,9 +444,9 @@ npx wl-ui doctor --project . --print-overrides
|
|
|
439
444
|
| `wl-ui snapshot` | list/diff/rollback/clean |
|
|
440
445
|
| `wl-ui drift` | 基线与当前问题漂移 |
|
|
441
446
|
| `wl-ui exempt init` | 生成定制页豁免候选,需人工审核 |
|
|
442
|
-
| `wl-ui contract` | extract/validate/match 脱敏 UI 契约 |
|
|
443
|
-
| `wl-ui rules list/describe` | 查询规则事实源,不读取整份规则文档 |
|
|
444
|
-
| `wl-ui profiles` | 列出 adapter/style/runtime 组合 |
|
|
447
|
+
| `wl-ui contract` | extract/validate/match 脱敏 UI 契约 |
|
|
448
|
+
| `wl-ui rules list/describe` | 查询规则事实源,不读取整份规则文档 |
|
|
449
|
+
| `wl-ui profiles` | 列出 adapter/style/runtime 组合 |
|
|
445
450
|
| `wl-ui add-preset/add-vendor` | 在消费项目脚手架扩展文件 |
|
|
446
451
|
| `wl-ui-mcp` | 启动 stdio MCP Server |
|
|
447
452
|
|
|
@@ -468,7 +473,7 @@ npx wl-ui doctor --project . --print-overrides
|
|
|
468
473
|
|
|
469
474
|
## 版本与进一步阅读
|
|
470
475
|
|
|
471
|
-
当前 v1.
|
|
476
|
+
当前 v1.13.1:R008 覆盖 jh/Base 表单静态标签宽度,补充长标签与输入区的布局预算和浏览器验收口径,保持只提示、不自动改样式。v1.13.0:新增 `native-jh-ag` 混合形态 Profile、显式 Profile 兼容承诺与联邦 AG 依赖识别。v1.12.0:显式 UI Profile、规则/修复器一致性门禁、共享 CLI/MCP 扫描引擎与 dry-run 计划哈希。
|
|
472
477
|
|
|
473
478
|
- [版本摘要](docs/version-history.md)
|
|
474
479
|
- [完整 Changelog](CHANGELOG.md)
|
package/SKILL.md
CHANGED
|
@@ -41,9 +41,14 @@ Profiles compose capabilities and vendor adapters. Prefer an explicit project
|
|
|
41
41
|
| `native-element` | Native Element Plus projects without legacy vendor adapters |
|
|
42
42
|
| `legacy-jh-element` | jh/Base legacy projects that do not use AG Grid |
|
|
43
43
|
| `legacy-jh-ag` | jh/Base legacy projects that intentionally use AG Grid |
|
|
44
|
+
| `native-jh-ag` | Platform sub-apps: native runtime on jh/Base vendors, AG Grid via npm or federation remote |
|
|
44
45
|
|
|
45
46
|
AG Grid is an optional adapter. Rules such as R021 and AG-specific runtime guards
|
|
46
|
-
must not run outside `legacy-jh-ag
|
|
47
|
+
must not run outside the AG profiles (`legacy-jh-ag`, `native-jh-ag`).
|
|
48
|
+
|
|
49
|
+
Strict profile checks only apply to explicitly declared profiles (`--profile`,
|
|
50
|
+
`.wl-ui-profile.json`, or the install manifest); dependency detection is a
|
|
51
|
+
suggestion and never turns a previously green project red.
|
|
47
52
|
|
|
48
53
|
## Decision boundary
|
|
49
54
|
|