修改完成
This commit is contained in:
@@ -6,17 +6,22 @@ if (-not (Test-Path -LiteralPath $componentPath)) { throw 'Missing shared module
|
||||
$component = Get-Content -LiteralPath $componentPath -Raw -Encoding utf8
|
||||
|
||||
foreach ($anchor in @(
|
||||
"const moduleState = ref(['loading', 'empty', 'success', 'error'].includes(query.state) ? query.state : 'ready')",
|
||||
'const moduleState = ref(',
|
||||
'["loading", "empty", "success", "error"].includes(query.state)',
|
||||
'module-state--${moduleState}',
|
||||
'empty: { eyebrow:',
|
||||
'success: { eyebrow:',
|
||||
'error: { eyebrow:',
|
||||
'empty: {',
|
||||
'success: {',
|
||||
'error: {',
|
||||
'module-content-frame.png',
|
||||
'module-field-frame.png',
|
||||
'<AppLoading',
|
||||
'<AppButton',
|
||||
'<AppToast',
|
||||
'<ModulePageBackground',
|
||||
':style="moduleAssetStyle"',
|
||||
'const moduleAssetStyle = computed(() => ({',
|
||||
'"--module-content-asset": `url(${contentAsset.value})`',
|
||||
'"--module-field-asset": `url(${fieldAsset.value})`',
|
||||
'query.state'
|
||||
)) {
|
||||
if ($component -notmatch [regex]::Escape($anchor)) { throw "ModulePage is missing high-spec anchor: $anchor" }
|
||||
@@ -32,7 +37,7 @@ foreach ($forbidden in @(
|
||||
}
|
||||
|
||||
foreach ($className in @('module-panel', 'form-row', 'list-card', 'detail-card', 'timeline-row', 'settings-row', 'status-card')) {
|
||||
foreach ($property in @('border', 'background', 'border-radius', 'box-shadow', 'background-image')) {
|
||||
foreach ($property in @('border', 'border-radius', 'box-shadow')) {
|
||||
if ($component -match "(?s)\.$className\s*\{[^}]*\b$property\s*:") {
|
||||
throw "ModulePage must not construct .$className with CSS $property"
|
||||
}
|
||||
@@ -40,5 +45,17 @@ foreach ($className in @('module-panel', 'form-row', 'list-card', 'detail-card',
|
||||
}
|
||||
|
||||
if ($component -match '::before|::after') { throw 'ModulePage must not draw visible decorations with CSS pseudo-elements' }
|
||||
if ($component -match '<image\b') { throw 'ModulePage must use approved container backgrounds instead of decorative image layers' }
|
||||
if ($component -match '(?im)(?<![-\w])position\s*:') { throw 'ModulePage ordinary content must not use position declarations' }
|
||||
|
||||
foreach ($rule in @(
|
||||
'(?s)\.module-page\s*\{[^}]*display:\s*flex;[^}]*flex-direction:\s*column;',
|
||||
'(?s)\.module-page__header,\s*\.module-page__content,\s*\.module-page__loading\s*\{[^}]*z-index:\s*1;',
|
||||
'(?s)\.module-lead\s*\{[^}]*background:\s*url\("/static/assets/modules/genealogy/transparent/section-divider\.png"\) center / 100% 100% no-repeat;',
|
||||
'(?s)\.form-row,\s*\.settings-row\s*\{[^}]*background:\s*var\(--module-field-asset\) center / 100% 100% no-repeat;',
|
||||
'(?s)\.list-card,\s*\.detail-card,\s*\.timeline-row,\s*\.status-card\s*\{[^}]*background:\s*var\(--module-content-asset\) center / 100% 100% no-repeat;'
|
||||
)) {
|
||||
if ($component -notmatch $rule) { throw "ModulePage document-flow background rule missing: $rule" }
|
||||
}
|
||||
|
||||
Write-Output 'MODULE-PAGE-VISUAL-CONTRACT PASS'
|
||||
|
||||
Reference in New Issue
Block a user