64 lines
2.5 KiB
PowerShell
64 lines
2.5 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
$source = Get-Content 'pages/notification/n01-message-center.vue' -Raw -Encoding UTF8
|
|
$profiles = Get-Content 'styles/adaptive-frame-profiles.scss' -Raw -Encoding UTF8
|
|
$unread = [string]([char]0x672A) + [char]0x8BFB
|
|
$read = [string]([char]0x5DF2) + [char]0x8BFB
|
|
$markAllRead = [string]([char]0x5168) + [char]0x90E8 + $read
|
|
$goToReview = [string]([char]0x524D) + [char]0x5F80 + [char]0x5165 + [char]0x8C31 + [char]0x5BA1 + [char]0x6838
|
|
$required = @(
|
|
'@include adaptive-notification-content;',
|
|
'AppLoading',
|
|
'AppToast',
|
|
'notice-state--loading',
|
|
'notice-state--list',
|
|
'notice-state--empty',
|
|
'notice-state--error',
|
|
$unread,
|
|
$read,
|
|
$markAllRead,
|
|
$goToReview
|
|
)
|
|
|
|
foreach ($token in $required) {
|
|
if (-not $source.Contains($token)) {
|
|
throw "N01 missing contract token: $token"
|
|
}
|
|
}
|
|
|
|
if ($source.Contains('application-status-card.png')) {
|
|
throw 'N01 must not reuse the genealogy application card'
|
|
}
|
|
|
|
if ($source -match '<image\s+(?:[^>]*\s)?class="notice-(?:card|state-card)__skin"') {
|
|
throw 'N01 decorative frames must be container backgrounds instead of positioned image layers'
|
|
}
|
|
if ($source -match 'position\s*:') {
|
|
throw 'N01 must keep ordinary content in document flow'
|
|
}
|
|
if ($profiles -notmatch '(?s)@mixin\s+adaptive-notification-content\s*\{.*?n01-notice-card\.png') {
|
|
throw 'The adaptive profile owner must retain the N01 notice-card artwork'
|
|
}
|
|
if ($source -match '100%\s+100%\s+no-repeat|border-image-slice\s*:') {
|
|
throw 'N01 must consume adaptive frame geometry without page-local stretching or slicing'
|
|
}
|
|
|
|
# N01 的可读性与块级操作由本页面基线合同持有,不再依赖浏览器截图状态助手。
|
|
foreach ($ruleContract in @(
|
|
@{ Selector = 'notice-card__status'; Expected = 'font-size:\s*clamp\(13px, 21rpx, 16px\);' }
|
|
@{ Selector = 'notice-card__summary'; Expected = 'font-size:\s*clamp\(14px, 23rpx, 17px\);' }
|
|
)) {
|
|
$selector = [regex]::Escape($ruleContract.Selector)
|
|
if ($source -notmatch "(?s)\.$selector\s*\{[^}]*$($ruleContract.Expected)") {
|
|
throw "N01 readable style rule missing: $($ruleContract.Selector) $($ruleContract.Expected)"
|
|
}
|
|
}
|
|
if ($source -notmatch '(?s)<AppButton\s+class="notice-review-action"\s+block\s+type="secondary"') {
|
|
throw 'N01 review action must remain a block-level secondary button'
|
|
}
|
|
if ($source -notmatch '(?s)<AppButton\s+block\s+:type="noticeState === ''error'' \? ''secondary'' : ''primary''"') {
|
|
throw 'N01 empty and error recovery action must remain block-level and state-aware'
|
|
}
|
|
|
|
Write-Output 'N01-MODULE-BASELINE-CONTRACT PASS'
|