【本次核心 · S6-P21】 - 族层数据:families.json + 44 份契约注入 family/familyRole/familyParams; data.json / data.js / site/details 同步。13 族 / 44 成员 / 35 独立 → 概念组件 79→48。 - 79 个 slug 全保留、集合逐一不变(铁律 5 对外承诺未破);frameworks 仍 395 文件、薄壳仍 79。 - 归族判据为契约中可核对字段(semanticTypeCandidates 重叠 / anatomy 为同一骨架子集 / 变体维度同构 / doNotInvent 显式从属声明),每族 mergeBasis 写明依据,不按名字猜。 - 实现层合并(导航族端到端切片):tools/gen-family-impl.mjs 从 5 端模板生成 TopMenu / SideMenu / MixedNavigation 共 15 文件,参数 direction=top|side|mixed; 三份 CSS md5 完全相同 = 一份样式表服务三个组件。 - 新增 tools/gen-families.mjs、tools/gen-family-impl.mjs、tools/verify-families.mjs、 tools/lib/family-model.mjs、tools/lib/family-impl/nav-menu/*.tpl。 【同时清掉此前已完成但未提交的批次】 生成物(data.json / data.js / site/sources / site/components 薄壳 / sitemap.xml / tests 报告) 跨阶段交织,无法拆成互相自洽的多个提交,故按既有批量风格合并提交: - Package:三端可 import(S5-P18)+ 发布到私有 npm 源 - Docs site:导航语言改下拉(S5-P19)、详情页代码块默认展开、中英切换完整性 - Security:生产部署链审计修复(2026-09-19)+ 线上部署 - Theme modes 日间/夜间/自动;S1-P4 data.js 瘦身;S2-P5 暗色;S2-P6 跨端一致性; S2-P7 行为断言;S2-P9 FAQ;S3-P8 RTL;S3-P9 契约缺口解释层;S4-P12 发布流程 - 补入 tools/pack-deploy.mjs、run-site-smoke.mjs、verify-*.mjs,.dockerignore、 安全审计修复与待决策项.md 【验收】 - node tools/verify-families.mjs → OK: 族层端到端一致(13 族 / 44 成员 / 79 组件不变 / 395 文件不变) - node tools/verify-cross-platform.mjs → 79/79 identical(HEAD 基线 high 44) - node tools/run-regression.mjs → 100%(79/79 页,1017/1017 断言,N/A 34),连跑 8 次一致,0 超时 - 逐页实测:topmenu / sidemenu / mixednavigation 各 13/13,帧内 direction 参数正确,0 JS 错误 - 零运行时依赖 OK;build-site.ps1 ASCII-only OK 【未纳入】site/components/<slug>/ 平台薄壳 316 个 —— 历史从未跟踪且属构建产物,保持现状。
108 lines
7.1 KiB
HTML
108 lines
7.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>themeswitcher — 测试页</title>
|
|
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css">
|
|
<link rel="stylesheet" href="../site/style.css">
|
|
<style>
|
|
/* 测试页独立样式 */
|
|
body { margin: 0; font-family: var(--au-font-family); color: var(--au-color-text-body); background: var(--au-color-page-bg); }
|
|
.t-shell { max-width: 1200px; margin: 0 auto; padding: 24px; }
|
|
.t-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
|
|
.t-head h1 { margin: 0; font-size: 22px; color: var(--au-color-text-title); }
|
|
.t-head h1 .en { font-family: var(--au-font-family-num); font-size: 14px; color: var(--au-color-text-secondary); margin-left: 8px; }
|
|
.t-nav { display: flex; gap: 8px; }
|
|
.t-btn { height: 30px; padding: 0 12px; border-radius: var(--au-radius-base); border: 1px solid var(--au-color-border); background: var(--au-color-card-bg); color: var(--au-color-text-body); font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
|
|
.t-btn:hover { border-color: var(--au-color-brand); color: var(--au-color-brand); }
|
|
.t-btn.primary { background: var(--au-color-brand); border-color: var(--au-color-brand); color: var(--au-color-text-inverse); }
|
|
.t-btn.primary:hover { background: var(--au-color-brand-hover); color: var(--au-color-text-inverse); }
|
|
.t-section { background: var(--au-color-card-bg); border: 1px solid var(--au-color-border); border-radius: var(--au-radius-large); padding: 20px; margin-bottom: 20px; }
|
|
.t-section h2 { font-size: 16px; margin: 0 0 12px; color: var(--au-color-text-title); }
|
|
.t-section .desc { color: var(--au-color-text-secondary); font-size: 13px; margin: 0 0 12px; }
|
|
.t-summary { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
|
|
.t-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 10px; border-radius: var(--au-radius-small); font-size: 12px; background: var(--au-color-table-header-bg); color: var(--au-color-text-secondary); font-family: var(--au-font-family-num); }
|
|
.t-pill.pass { background: rgba(82,196,26,.12); color: var(--au-color-success); }
|
|
.t-pill.fail { background: rgba(245,34,45,.12); color: var(--au-color-error); }
|
|
.t-pill.skip { background: var(--au-color-table-header-bg); color: var(--au-color-text-placeholder); }
|
|
.t-list { display: flex; flex-direction: column; gap: 6px; }
|
|
.t-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--au-color-border); border-radius: var(--au-radius-base); font-size: 13px; }
|
|
.t-row .id { font-family: var(--au-font-family-num); color: var(--au-color-text-secondary); flex: 1; word-break: break-all; }
|
|
.t-row .ms { font-family: var(--au-font-family-num); color: var(--au-color-text-placeholder); font-size: 12px; }
|
|
.t-row .err { color: var(--au-color-error); font-size: 12px; margin-left: 8px; }
|
|
.t-snap-head { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
|
|
#snapshot { border: 1px solid var(--au-color-border); border-radius: var(--au-radius-medium); overflow: hidden; background: #fff; }
|
|
#snapshot iframe { width: 100%; height: 560px; border: 0; display: block; }
|
|
.t-fab { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
|
|
.t-fab .t-btn { box-shadow: var(--au-shadow-medium); }
|
|
.t-toast { position: fixed; top: 24px; right: 24px; z-index: 200; padding: 8px 14px; background: var(--au-color-text-title); color: var(--au-color-text-inverse); border-radius: var(--au-radius-base); font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; }
|
|
.t-toast.show { opacity: 1; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="t-shell">
|
|
<div class="t-head">
|
|
<h1>主题切换<span class="en">themeswitcher</span></h1>
|
|
<div class="t-nav">
|
|
<a class="t-btn" href="../site/index.html#/component/themeswitcher" target="_blank">← 文档站</a>
|
|
<button id="run-asserts" class="t-btn primary" type="button">运行断言</button>
|
|
<button id="export-log" class="t-btn" type="button">导出日志</button>
|
|
<button id="clear-log" class="t-btn" type="button">清空日志</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="t-section">
|
|
<h2>渲染快照(真实演示页)</h2>
|
|
<p class="desc">iframe 直接加载 <code>frameworks/ThemeSwitcher.html</code>:组件 CSS 与内联脚本真实执行,用例由运行期标注 <code>data-assert="<id>"</code>,断言在帧内运行后写回 <code>data-status</code>(帧内描边可视化)。</p>
|
|
<div class="t-snap-head">
|
|
<a class="t-btn" href="../frameworks/ThemeSwitcher.html" target="_blank">↗ 新窗口打开演示页</a>
|
|
<button id="reload-frame" class="t-btn" type="button">重载演示页</button>
|
|
<span class="t-pill" id="frame-state">加载中…</span>
|
|
</div>
|
|
<div id="snapshot">
|
|
<iframe id="snapshot-frame" src="../frameworks/ThemeSwitcher.html" title="themeswitcher 组件演示页"></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="t-section">
|
|
<h2>断言结果</h2>
|
|
<div class="t-summary">
|
|
<span class="t-pill" id="sum-total">总数 0</span>
|
|
<span class="t-pill pass" id="sum-pass">通过 0</span>
|
|
<span class="t-pill fail" id="sum-fail">失败 0</span>
|
|
<span class="t-pill skip" id="sum-skip">跳过 0</span>
|
|
<span class="t-pill" id="sum-ms">耗时 0 ms</span>
|
|
</div>
|
|
<ul class="t-list" id="result-list" style="margin-top: 12px; list-style: none; padding: 0;"></ul>
|
|
</div>
|
|
|
|
<div class="t-section">
|
|
<h2>通用测试矩阵(自动断言)</h2>
|
|
<p class="desc">以下检查在「运行断言」时于演示页帧内同时跑:默认态、日间 / 夜间 / 自动三态、变体覆盖、状态可达、可见用例、键盘可达、焦点环、ARIA 属性、对比度、token 一致性。</p>
|
|
<ol style="margin: 0; padding-left: 18px; color: var(--au-color-text-body); font-size: 13px; line-height: 22px;">
|
|
<li>默认态渲染:核心节点齐全</li>
|
|
<li>尺寸/类型变体:≥2 尺寸 或 ≥2 类型</li>
|
|
<li>状态覆盖:default / hover / focus / disabled / loading 至少出现 1 个(或 ≥3 个用例)</li>
|
|
<li>可见用例:≥1 个用例在默认态可见(隐藏用例记 skip)</li>
|
|
<li>键盘可达:可聚焦元素具备 tabindex 或原生 button/a</li>
|
|
<li>焦点环可视:focus-visible 描边不被覆盖(脚本检查 stylesheet)</li>
|
|
<li>ARIA 属性:交互节点具备 role 或 aria-*</li>
|
|
<li>对比度:用例区文本颜色与背景对比度 ≥ 4.5:1(页头文档文字不计)</li>
|
|
<li>token 一致性:用例区未出现硬编码 hex 颜色</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="t-fab">
|
|
<button id="export-log-2" class="t-btn" type="button" title="下载 JSON">导出</button>
|
|
</div>
|
|
<div id="toast" class="t-toast">已导出 ✓</div>
|
|
|
|
<script src="../site/logger.js"></script>
|
|
<script>window.__SLUG__ = "themeswitcher";</script>
|
|
<script src="../tests/_behaviors.js"></script>
|
|
<script src="../tests/_runtime.js"></script>
|
|
</body>
|
|
</html>
|