$ErrorActionPreference = 'Stop' $root = Split-Path -Parent $PSScriptRoot function Read-Utf8([string]$path) { Get-Content -LiteralPath (Join-Path $root $path) -Raw -Encoding UTF8 } $button = Read-Utf8 'components/AppButton.vue' foreach ($token in @(']*class="app-button"') { throw 'AppButton must use a native button root' } $header = Read-Utf8 'components/PageHeader.vue' foreach ($pattern in @( '(?s)]+class="header-back"[^>]+aria-label=', '(?s)]+class="header-icon-button header-notice"[^>]+aria-label=', '(?s)]+class="header-icon-button"[^>]+aria-label=' )) { if ($header -notmatch $pattern) { throw "PageHeader accessibility contract missing: $pattern" } } if (-not $header.Contains('fallbackUrl')) { throw 'PageHeader must expose a deep-link fallback route' } foreach ($token in @( 'customBack: { type: Boolean, default: false }', 'const emit = defineEmits(["brand", "notice", "action", "back"]);', 'if (props.customBack) {', 'emit("back");', 'uni.navigateBack();', 'uni.reLaunch({ url: props.fallbackUrl });' )) { if (-not $header.Contains($token)) { throw "PageHeader back contract missing: $token" } } $dialog = Read-Utf8 'components/AppDialog.vue' foreach ($token in @('role="dialog"', 'aria-modal="true"', 'tabindex="-1"', '@keydown.esc.stop="cancel"', 'max-height: calc(var(--app-viewport-height, 100vh) - 160rpx)', 'overflow-y: auto')) { if (-not $dialog.Contains($token)) { throw "AppDialog accessibility contract missing: $token" } } $toast = Read-Utf8 'components/AppToast.vue' foreach ($token in @('v-show="visible"', 'role="status"', 'aria-live="polite"', 'aria-atomic="true"')) { if (-not $toast.Contains($token)) { throw "AppToast accessibility contract missing: $token" } } $loading = Read-Utf8 'components/AppLoading.vue' foreach ($token in @('role="status"', 'aria-live="polite"', 'aria-busy="true"', 'animation: none')) { if (-not $loading.Contains($token)) { throw "AppLoading accessibility contract missing: $token" } } Write-Output 'SHARED-INTERACTION-ACCESSIBILITY-CONTRACT PASS'