@thanhnguyxn/pixelcraft 0.1.0 → 0.2.0
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/.agents/plugins/marketplace.json +1 -1
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +15 -4
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/README.md +185 -328
- package/SECURITY.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/bin/pixelcraft.mjs +431 -23
- package/docs/ARCHITECTURE.md +40 -37
- package/docs/DESIGN-RATIONALE.md +51 -3
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +16 -6
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/pixelcraft-accessibility.md +17 -0
- package/evals/pixelcraft-craft.md +16 -0
- package/evals/pixelcraft-dataviz.md +3 -3
- package/evals/pixelcraft-direction.md +17 -0
- package/evals/pixelcraft-game-ui.md +3 -3
- package/evals/pixelcraft-mobile.md +3 -3
- package/evals/pixelcraft-patterns.md +16 -0
- package/evals/pixelcraft-plan.md +65 -3
- package/evals/pixelcraft-review.md +3 -3
- package/evals/pixelcraft-visual-qa.md +11 -5
- package/evals/pixelcraft-web.md +21 -3
- package/evals/pixelcraft.md +4 -4
- package/gemini-extension.json +3 -2
- package/install.ps1 +57 -11
- package/install.sh +82 -7
- package/package.json +32 -4
- package/plugin.json +6 -1
- package/scripts/build-adapters.mjs +11 -13
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +14 -1
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +86 -7
- package/scripts/test-export-tokens.mjs +259 -3
- package/scripts/test-finish-gate.mjs +133 -10
- package/scripts/test-installers.mjs +155 -6
- package/scripts/test-shoot.mjs +23 -1
- package/scripts/test-slop-scan.mjs +390 -3
- package/scripts/test-style-inventory.mjs +23 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +82 -4
- package/scripts/validate-skills.mjs +149 -3
- package/skills/pixelcraft/SKILL.md +67 -47
- package/skills/pixelcraft/references/design-brief.md +2 -2
- package/skills/pixelcraft/references/floor.md +36 -19
- package/skills/pixelcraft/references/report-template.md +25 -11
- package/skills/pixelcraft/references/stack-detection.md +138 -67
- package/skills/pixelcraft/references/surface-acceptance.md +33 -21
- package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
- package/skills/pixelcraft-accessibility/SKILL.md +34 -13
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
- package/skills/pixelcraft-accessibility/references/verification.md +15 -10
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
- package/skills/pixelcraft-brandkit/SKILL.md +42 -30
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
- package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
- package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
- package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
- package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
- package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
- package/skills/pixelcraft-constrained/SKILL.md +21 -20
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
- package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
- package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
- package/skills/pixelcraft-craft/SKILL.md +29 -15
- package/skills/pixelcraft-craft/references/color.md +62 -6
- package/skills/pixelcraft-craft/references/layout.md +32 -0
- package/skills/pixelcraft-craft/references/motion.md +99 -12
- package/skills/pixelcraft-craft/references/typography.md +48 -9
- package/skills/pixelcraft-data-apps/SKILL.md +50 -31
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +87 -31
- package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
- package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
- package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
- package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
- package/skills/pixelcraft-data-apps/references/panel.md +69 -23
- package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
- package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
- package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
- package/skills/pixelcraft-dataviz/SKILL.md +21 -24
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
- package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
- package/skills/pixelcraft-desktop/SKILL.md +61 -39
- package/skills/pixelcraft-desktop/references/appkit.md +60 -26
- package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
- package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
- package/skills/pixelcraft-desktop/references/electron.md +68 -26
- package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
- package/skills/pixelcraft-desktop/references/gtk.md +74 -31
- package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
- package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
- package/skills/pixelcraft-desktop/references/tauri.md +80 -24
- package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
- package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
- package/skills/pixelcraft-desktop/references/working-context.md +82 -3
- package/skills/pixelcraft-direction/SKILL.md +48 -82
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +11 -1
- package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +3 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
- package/skills/pixelcraft-document/SKILL.md +27 -23
- package/skills/pixelcraft-document/references/archetypes.md +27 -4
- package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +96 -43
- package/skills/pixelcraft-document/references/slides.md +123 -27
- package/skills/pixelcraft-email/SKILL.md +42 -20
- package/skills/pixelcraft-email/references/client-quirks.md +101 -33
- package/skills/pixelcraft-email/references/html-tables.md +83 -22
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +13 -11
- package/skills/pixelcraft-email/references/react-email.md +76 -34
- package/skills/pixelcraft-extensions/SKILL.md +32 -27
- package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
- package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +90 -11
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
- package/skills/pixelcraft-game-ui/SKILL.md +45 -26
- package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
- package/skills/pixelcraft-game-ui/references/godot.md +100 -27
- package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
- package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
- package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +14 -13
- package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +20 -23
- package/skills/pixelcraft-media/references/banners-video.md +83 -65
- package/skills/pixelcraft-media/references/og-generation.md +110 -63
- package/skills/pixelcraft-media/references/social-cards.md +57 -58
- package/skills/pixelcraft-mobile/SKILL.md +53 -36
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
- package/skills/pixelcraft-mobile/references/flet.md +53 -26
- package/skills/pixelcraft-mobile/references/flutter.md +76 -32
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
- package/skills/pixelcraft-mobile/references/kivy.md +54 -31
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
- package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
- package/skills/pixelcraft-mobile/references/uikit.md +57 -23
- package/skills/pixelcraft-patterns/SKILL.md +30 -13
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +35 -16
- package/skills/pixelcraft-patterns/references/communication.md +34 -15
- package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +31 -19
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/settings.md +40 -12
- package/skills/pixelcraft-plan/SKILL.md +54 -18
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +44 -9
- package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
- package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
- package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
- package/skills/pixelcraft-review/SKILL.md +41 -19
- package/skills/pixelcraft-review/references/audit-report.md +20 -1
- package/skills/pixelcraft-review/references/heuristics.md +63 -18
- package/skills/pixelcraft-review/references/personas.md +41 -14
- package/skills/pixelcraft-review/references/polish.md +66 -26
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
- package/skills/pixelcraft-spatial/SKILL.md +16 -17
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
- package/skills/pixelcraft-spatial/references/platforms.md +123 -53
- package/skills/pixelcraft-tokens/SKILL.md +18 -14
- package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
- package/skills/pixelcraft-tokens/references/format.md +39 -9
- package/skills/pixelcraft-tokens/references/governance.md +1 -1
- package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
- package/skills/pixelcraft-tui/SKILL.md +41 -25
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +77 -28
- package/skills/pixelcraft-tui/references/ratatui.md +70 -30
- package/skills/pixelcraft-tui/references/rich.md +53 -33
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +75 -34
- package/skills/pixelcraft-ux/SKILL.md +22 -12
- package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
- package/skills/pixelcraft-ux/references/forms.md +57 -3
- package/skills/pixelcraft-ux/references/i18n.md +50 -12
- package/skills/pixelcraft-ux/references/laws.md +35 -14
- package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
- package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
- package/skills/pixelcraft-web/SKILL.md +105 -49
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
- package/skills/pixelcraft-web/references/angular.md +63 -16
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +64 -13
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +52 -17
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +144 -12
- package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +27 -18
- package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
- package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
- package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +6 -1
- package/skills/pixelcraft-web/references/qwik.md +51 -11
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +112 -13
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +106 -63
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +67 -16
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -11
- package/skills/pixelcraft-web/references/tailwind.md +40 -14
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -12,25 +12,29 @@ only when already installed; otherwise install guidance is printed and nothing
|
|
|
12
12
|
is captured.
|
|
13
13
|
|
|
14
14
|
Options:
|
|
15
|
-
--out DIR
|
|
16
|
-
--breakpoints LIST
|
|
17
|
-
--project DIR
|
|
18
|
-
--root DIR
|
|
19
|
-
|
|
20
|
-
--
|
|
21
|
-
--
|
|
22
|
-
--wait-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
--
|
|
26
|
-
--
|
|
27
|
-
--
|
|
28
|
-
--
|
|
15
|
+
--out DIR Artifact directory (default: visual-qa)
|
|
16
|
+
--breakpoints LIST Width x height list (default: 390x844,768x1024,1440x900)
|
|
17
|
+
--project DIR Dependency resolution root (default: current directory)
|
|
18
|
+
--root DIR Static server root for local targets (default: the
|
|
19
|
+
file/directory itself; exposes everything beneath it)
|
|
20
|
+
--executable-path FILE Use a specific Chromium/Chrome executable
|
|
21
|
+
--timeout MS Navigation timeout in milliseconds (default: 30000)
|
|
22
|
+
--wait-for SELECTOR Wait for a selector after page load
|
|
23
|
+
--wait-ms MS Maximum post-load selector/network/font settle time
|
|
24
|
+
(default: 5000)
|
|
25
|
+
--forced-colors MODE Emulate forced-colors media feature: none or active
|
|
26
|
+
--locale TAG Emulate browser locale (e.g. de-DE, ar-EG, ja-JP)
|
|
27
|
+
--allow-http-error Capture HTTP 4xx/5xx pages without failing the run
|
|
28
|
+
--keyboard Probe the first eight real Tab stops on a safe fixture
|
|
29
|
+
(including WCAG 2.4.11 focus-not-obscured checks)
|
|
30
|
+
--light-only Skip dark-mode captures
|
|
31
|
+
--no-reduced-motion Skip reduced-motion captures
|
|
32
|
+
--help Show this help
|
|
29
33
|
|
|
30
34
|
Outputs PNG captures plus report.json. Audits are heuristic leads for human
|
|
31
35
|
inspection: overflow, clipping, low contrast, broken images, hidden essential
|
|
32
|
-
content, text occlusion,
|
|
33
|
-
accessibility or visual quality.
|
|
36
|
+
content, text occlusion, target size (<24x24 CSS px), and optional keyboard
|
|
37
|
+
focus. They are not proof of accessibility or visual quality.
|
|
34
38
|
|
|
35
39
|
Install Playwright in the target project when capture is desired, for example:
|
|
36
40
|
npm install --save-dev playwright
|
|
@@ -38,8 +42,36 @@ Install Playwright in the target project when capture is desired, for example:
|
|
|
38
42
|
`;
|
|
39
43
|
}
|
|
40
44
|
|
|
45
|
+
function optionValue(args, index, name) {
|
|
46
|
+
const value = args[index + 1];
|
|
47
|
+
if (value === undefined || value === '') throw new Error(`${name} requires a value`);
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function inlineValue(arg, prefix, name) {
|
|
52
|
+
const value = arg.slice(prefix.length);
|
|
53
|
+
if (value === '') throw new Error(`${name} requires a value`);
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
|
|
41
57
|
function parse(args) {
|
|
42
|
-
const options = {
|
|
58
|
+
const options = {
|
|
59
|
+
out: 'visual-qa',
|
|
60
|
+
breakpoints: '390x844,768x1024,1440x900',
|
|
61
|
+
timeout: 30000,
|
|
62
|
+
waitFor: null,
|
|
63
|
+
waitMs: 5000,
|
|
64
|
+
allowHttpError: false,
|
|
65
|
+
project: process.cwd(),
|
|
66
|
+
root: null,
|
|
67
|
+
executablePath: null,
|
|
68
|
+
forcedColors: null,
|
|
69
|
+
locale: null,
|
|
70
|
+
lightOnly: false,
|
|
71
|
+
reducedMotion: true,
|
|
72
|
+
keyboard: false,
|
|
73
|
+
help: false,
|
|
74
|
+
};
|
|
43
75
|
const positional = [];
|
|
44
76
|
for (let index = 0; index < args.length; index += 1) {
|
|
45
77
|
const arg = args[index];
|
|
@@ -48,24 +80,34 @@ function parse(args) {
|
|
|
48
80
|
else if (arg === '--no-reduced-motion') options.reducedMotion = false;
|
|
49
81
|
else if (arg === '--allow-http-error') options.allowHttpError = true;
|
|
50
82
|
else if (arg === '--keyboard') options.keyboard = true;
|
|
51
|
-
else if (arg === '--out') options.out = args
|
|
52
|
-
else if (arg.startsWith('--out=')) options.out = arg
|
|
53
|
-
else if (arg === '--breakpoints') options.breakpoints = args
|
|
54
|
-
else if (arg.startsWith('--breakpoints=')) options.breakpoints = arg
|
|
55
|
-
else if (arg === '--project') options.project = args
|
|
56
|
-
else if (arg.startsWith('--project=')) options.project = arg
|
|
57
|
-
else if (arg === '--root') options.root = args
|
|
58
|
-
else if (arg.startsWith('--root=')) options.root = arg
|
|
59
|
-
else if (arg === '--
|
|
60
|
-
else if (arg.startsWith('--
|
|
61
|
-
else if (arg === '--
|
|
62
|
-
else if (arg.startsWith('--
|
|
63
|
-
else if (arg === '--
|
|
64
|
-
else if (arg.startsWith('--
|
|
83
|
+
else if (arg === '--out') { options.out = optionValue(args, index, '--out'); index += 1; }
|
|
84
|
+
else if (arg.startsWith('--out=')) options.out = inlineValue(arg, '--out=', '--out');
|
|
85
|
+
else if (arg === '--breakpoints') { options.breakpoints = optionValue(args, index, '--breakpoints'); index += 1; }
|
|
86
|
+
else if (arg.startsWith('--breakpoints=')) options.breakpoints = inlineValue(arg, '--breakpoints=', '--breakpoints');
|
|
87
|
+
else if (arg === '--project') { options.project = optionValue(args, index, '--project'); index += 1; }
|
|
88
|
+
else if (arg.startsWith('--project=')) options.project = inlineValue(arg, '--project=', '--project');
|
|
89
|
+
else if (arg === '--root') { options.root = optionValue(args, index, '--root'); index += 1; }
|
|
90
|
+
else if (arg.startsWith('--root=')) options.root = inlineValue(arg, '--root=', '--root');
|
|
91
|
+
else if (arg === '--executable-path') { options.executablePath = optionValue(args, index, '--executable-path'); index += 1; }
|
|
92
|
+
else if (arg.startsWith('--executable-path=')) options.executablePath = inlineValue(arg, '--executable-path=', '--executable-path');
|
|
93
|
+
else if (arg === '--forced-colors') { options.forcedColors = optionValue(args, index, '--forced-colors'); index += 1; }
|
|
94
|
+
else if (arg.startsWith('--forced-colors=')) options.forcedColors = inlineValue(arg, '--forced-colors=', '--forced-colors');
|
|
95
|
+
else if (arg === '--locale') { options.locale = optionValue(args, index, '--locale'); index += 1; }
|
|
96
|
+
else if (arg.startsWith('--locale=')) options.locale = inlineValue(arg, '--locale=', '--locale');
|
|
97
|
+
else if (arg === '--timeout') { options.timeout = Number(optionValue(args, index, '--timeout')); index += 1; }
|
|
98
|
+
else if (arg.startsWith('--timeout=')) options.timeout = Number(inlineValue(arg, '--timeout=', '--timeout'));
|
|
99
|
+
else if (arg === '--wait-for') { options.waitFor = optionValue(args, index, '--wait-for'); index += 1; }
|
|
100
|
+
else if (arg.startsWith('--wait-for=')) options.waitFor = inlineValue(arg, '--wait-for=', '--wait-for');
|
|
101
|
+
else if (arg === '--wait-ms') { options.waitMs = Number(optionValue(args, index, '--wait-ms')); index += 1; }
|
|
102
|
+
else if (arg.startsWith('--wait-ms=')) options.waitMs = Number(inlineValue(arg, '--wait-ms=', '--wait-ms'));
|
|
65
103
|
else if (arg.startsWith('-')) throw new Error(`unknown option: ${arg}`);
|
|
66
104
|
else positional.push(arg);
|
|
67
105
|
}
|
|
106
|
+
if (!Number.isFinite(options.timeout) || options.timeout <= 0) throw new Error('--timeout must be a positive number');
|
|
68
107
|
if (!Number.isFinite(options.waitMs) || options.waitMs < 0) throw new Error('--wait-ms must be a non-negative number');
|
|
108
|
+
if (options.forcedColors !== null && options.forcedColors !== 'none' && options.forcedColors !== 'active') {
|
|
109
|
+
throw new Error(`--forced-colors must be 'none' or 'active', got '${options.forcedColors}'`);
|
|
110
|
+
}
|
|
69
111
|
return { positional, options };
|
|
70
112
|
}
|
|
71
113
|
|
|
@@ -150,7 +192,7 @@ async function createStaticTarget(target, options) {
|
|
|
150
192
|
};
|
|
151
193
|
}
|
|
152
194
|
|
|
153
|
-
const auditSource = `() => {
|
|
195
|
+
const auditSource = `(auditOptions = {}) => {
|
|
154
196
|
const findings = [];
|
|
155
197
|
const vw = document.documentElement.clientWidth;
|
|
156
198
|
const add = (type, severity, message, element) => {
|
|
@@ -195,7 +237,7 @@ const auditSource = `() => {
|
|
|
195
237
|
const luminance = (color) => {
|
|
196
238
|
const convert = (channel) => {
|
|
197
239
|
const c = channel / 255;
|
|
198
|
-
return c <= 0.
|
|
240
|
+
return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
199
241
|
};
|
|
200
242
|
return 0.2126 * convert(color.r) + 0.7152 * convert(color.g) + 0.0722 * convert(color.b);
|
|
201
243
|
};
|
|
@@ -213,22 +255,38 @@ const auditSource = `() => {
|
|
|
213
255
|
a: alpha,
|
|
214
256
|
};
|
|
215
257
|
};
|
|
216
|
-
const
|
|
217
|
-
|
|
258
|
+
const canvasBackdrop = auditOptions.colorScheme === 'dark'
|
|
259
|
+
? { r: 18, g: 18, b: 18, a: 1 }
|
|
260
|
+
: { r: 255, g: 255, b: 255, a: 1 };
|
|
261
|
+
const effectiveContrastColors = (element, foregroundColor) => {
|
|
262
|
+
const chain = [];
|
|
218
263
|
let node = element;
|
|
219
264
|
while (node && node.nodeType === 1) {
|
|
220
|
-
|
|
221
|
-
const color = parseColor(value);
|
|
222
|
-
if (!color) add('unchecked-contrast', 'medium', 'background color could not be parsed while compositing: ' + value, element);
|
|
223
|
-
if (color && color.a > 0) {
|
|
224
|
-
layers.push(color);
|
|
225
|
-
if (color.a >= 0.999) break;
|
|
226
|
-
}
|
|
265
|
+
chain.push(node);
|
|
227
266
|
node = node.parentElement;
|
|
228
267
|
}
|
|
229
|
-
let
|
|
230
|
-
|
|
231
|
-
|
|
268
|
+
let bg = { r: 0, g: 0, b: 0, a: 0 };
|
|
269
|
+
let fg = foregroundColor;
|
|
270
|
+
let unparsedLogged = false;
|
|
271
|
+
for (const current of chain) {
|
|
272
|
+
const nodeStyle = getComputedStyle(current);
|
|
273
|
+
const parsedBg = parseColor(nodeStyle.backgroundColor);
|
|
274
|
+
if (!parsedBg && !unparsedLogged) {
|
|
275
|
+
add('unchecked-contrast', 'medium', 'background color could not be parsed while compositing: ' + nodeStyle.backgroundColor, element);
|
|
276
|
+
unparsedLogged = true;
|
|
277
|
+
}
|
|
278
|
+
const layerBg = parsedBg || { r: 0, g: 0, b: 0, a: 0 };
|
|
279
|
+
const parsedOpacity = Number.parseFloat(nodeStyle.opacity);
|
|
280
|
+
const opacity = Number.isFinite(parsedOpacity) ? Math.max(0, Math.min(1, parsedOpacity)) : 1;
|
|
281
|
+
const innerBg = layerBg.a > 0 ? alphaBlend(bg, layerBg) : bg;
|
|
282
|
+
const innerFg = layerBg.a > 0 ? alphaBlend(fg, layerBg) : fg;
|
|
283
|
+
bg = opacity < 1 ? { ...innerBg, a: innerBg.a * opacity } : innerBg;
|
|
284
|
+
fg = opacity < 1 ? { ...innerFg, a: innerFg.a * opacity } : innerFg;
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
background: alphaBlend(bg, canvasBackdrop),
|
|
288
|
+
foreground: alphaBlend(fg, canvasBackdrop),
|
|
289
|
+
};
|
|
232
290
|
};
|
|
233
291
|
const documentBounds = {
|
|
234
292
|
right: Math.max(document.documentElement.scrollWidth, vw),
|
|
@@ -248,6 +306,18 @@ const auditSource = `() => {
|
|
|
248
306
|
}
|
|
249
307
|
return false;
|
|
250
308
|
};
|
|
309
|
+
const insideHorizontalScroller = (element) => {
|
|
310
|
+
let node = element.parentElement;
|
|
311
|
+
while (node && node.nodeType === 1 && node !== document.documentElement && node !== document.body) {
|
|
312
|
+
const nodeStyle = getComputedStyle(node);
|
|
313
|
+
if (/^(?:auto|scroll)$/.test(nodeStyle.overflowX)) {
|
|
314
|
+
const scrollerRect = node.getBoundingClientRect();
|
|
315
|
+
if (scrollerRect.left >= -2 && scrollerRect.right <= vw + 2) return true;
|
|
316
|
+
}
|
|
317
|
+
node = node.parentElement;
|
|
318
|
+
}
|
|
319
|
+
return false;
|
|
320
|
+
};
|
|
251
321
|
const renderedTextRects = (node) => {
|
|
252
322
|
const parent = node.parentElement;
|
|
253
323
|
if (!parent) return [];
|
|
@@ -312,9 +382,18 @@ const auditSource = `() => {
|
|
|
312
382
|
return null;
|
|
313
383
|
};
|
|
314
384
|
const closedDisclosures = Array.from(document.querySelectorAll('details:not([open])'));
|
|
385
|
+
const inClosedPopover = (element) => {
|
|
386
|
+
try {
|
|
387
|
+
return Boolean(element.closest('[popover]:not(:popover-open)'));
|
|
388
|
+
} catch {
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
};
|
|
315
392
|
const intentionallyHidden = (element) => element.closest('[hidden], [aria-hidden="true"], [inert], dialog:not([open])')
|
|
393
|
+
|| inClosedPopover(element)
|
|
316
394
|
|| closedDisclosures.some((details) =>
|
|
317
395
|
details.contains(element) && !Array.from(details.children).find((child) => child.tagName === 'SUMMARY')?.contains(element));
|
|
396
|
+
const interactiveSelector = 'button, a[href], input:not([type="hidden"]), select, textarea, summary, [role="button"], [role="link"], [role="checkbox"], [role="radio"], [role="switch"], [role="tab"], [role="menuitem"]';
|
|
318
397
|
for (const element of elements) {
|
|
319
398
|
const rect = element.getBoundingClientRect();
|
|
320
399
|
const style = getComputedStyle(element);
|
|
@@ -330,10 +409,19 @@ const auditSource = `() => {
|
|
|
330
409
|
add('broken-image', 'high', 'visible image finished loading with no intrinsic width', element);
|
|
331
410
|
}
|
|
332
411
|
if (rect.width > 2 && rect.height > 2 && style.visibility !== 'hidden' && style.display !== 'none') {
|
|
333
|
-
if (rect.left < -2 || rect.right > vw + 2)
|
|
412
|
+
if ((rect.left < -2 || rect.right > vw + 2) && !insideHorizontalScroller(element)) {
|
|
413
|
+
add('outside-viewport', 'medium', 'rendered box extends outside horizontal viewport: ' + JSON.stringify({ left: Math.round(rect.left), right: Math.round(rect.right), viewport: vw }), element);
|
|
414
|
+
}
|
|
334
415
|
const clippedX = element.scrollWidth > element.clientWidth + 2 && /hidden|clip/.test(style.overflowX);
|
|
335
416
|
const clippedY = element.scrollHeight > element.clientHeight + 2 && /hidden|clip/.test(style.overflowY);
|
|
336
417
|
if ((clippedX || clippedY) && element.textContent.trim()) add('clipped-text', 'medium', 'text content may be clipped by hidden overflow', element);
|
|
418
|
+
if (element.matches(interactiveSelector) && !intentionallyHidden(element)
|
|
419
|
+
&& element.checkVisibility?.({ opacityProperty: true, visibilityProperty: true }) !== false) {
|
|
420
|
+
const inlineProseLink = element.tagName === 'A' && style.display === 'inline' && Boolean(element.closest('p, li, dd, dt, blockquote, td, th'));
|
|
421
|
+
if (!inlineProseLink && (rect.width < 24 || rect.height < 24)) {
|
|
422
|
+
add('small-touch-target', 'low', 'interactive target is ' + Math.round(rect.width) + 'x' + Math.round(rect.height) + ' CSS px (< 24x24 WCAG 2.5.8 heuristic)', element);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
337
425
|
}
|
|
338
426
|
const textRects = Array.from(element.childNodes).flatMap((node) => node.nodeType === 3 && node.textContent.trim() ? renderedTextRects(node) : []);
|
|
339
427
|
if (textRects.length) {
|
|
@@ -341,8 +429,7 @@ const auditSource = `() => {
|
|
|
341
429
|
if (cover) add('text-occlusion', 'medium', 'visible text range is covered at three sample points by ' + describe(cover), element);
|
|
342
430
|
const fg = parseColor(style.color);
|
|
343
431
|
if (fg) {
|
|
344
|
-
const background =
|
|
345
|
-
const foreground = fg.a < 1 ? alphaBlend(fg, background) : fg;
|
|
432
|
+
const { foreground, background } = effectiveContrastColors(element, fg);
|
|
346
433
|
const ratio = contrast(foreground, background);
|
|
347
434
|
const size = Number.parseFloat(style.fontSize) || 16;
|
|
348
435
|
const weight = Number.parseInt(style.fontWeight, 10) || 400;
|
|
@@ -379,20 +466,75 @@ async function auditKeyboard(page) {
|
|
|
379
466
|
const element = document.activeElement;
|
|
380
467
|
if (!element || element === document.body || element === document.documentElement) return null;
|
|
381
468
|
const name = element.localName + (element.id ? '#' + element.id : '');
|
|
469
|
+
const fixedOrStickyOwner = (node) => {
|
|
470
|
+
let cur = node;
|
|
471
|
+
while (cur && cur.nodeType === 1 && cur !== document.documentElement && cur !== document.body) {
|
|
472
|
+
const st = getComputedStyle(cur);
|
|
473
|
+
if (st.position === 'fixed' || st.position === 'sticky') return cur;
|
|
474
|
+
cur = cur.parentElement;
|
|
475
|
+
}
|
|
476
|
+
return null;
|
|
477
|
+
};
|
|
478
|
+
const checkObscured = () => {
|
|
479
|
+
const rect = element.getBoundingClientRect();
|
|
480
|
+
if (rect.width <= 0 || rect.height <= 0) return null;
|
|
481
|
+
const points = [
|
|
482
|
+
[rect.left + rect.width * 0.5, rect.top + rect.height * 0.5],
|
|
483
|
+
[rect.left + Math.min(rect.width * 0.25, rect.width - 1), rect.top + Math.min(rect.height * 0.25, rect.height - 1)],
|
|
484
|
+
[rect.left + Math.max(rect.width * 0.75, 1), rect.top + Math.max(rect.height * 0.75, 1)],
|
|
485
|
+
].filter(([x, y]) => x >= 0 && x < innerWidth && y >= 0 && y < innerHeight);
|
|
486
|
+
if (!points.length) return null;
|
|
487
|
+
let overlay = null;
|
|
488
|
+
let coveredCount = 0;
|
|
489
|
+
for (const [x, y] of points) {
|
|
490
|
+
const hit = document.elementFromPoint(x, y);
|
|
491
|
+
if (!hit || hit === element || element.contains(hit) || hit.contains(element)) continue;
|
|
492
|
+
const pinned = fixedOrStickyOwner(hit);
|
|
493
|
+
if (pinned && !pinned.contains(element)) {
|
|
494
|
+
coveredCount += 1;
|
|
495
|
+
overlay = pinned;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (!overlay || coveredCount === 0) return null;
|
|
499
|
+
const id = overlay.id ? '#' + overlay.id : '';
|
|
500
|
+
const cls = typeof overlay.className === 'string' && overlay.className.trim()
|
|
501
|
+
? '.' + overlay.className.trim().split(/\s+/).slice(0, 2).join('.')
|
|
502
|
+
: '';
|
|
503
|
+
return { by: (overlay.tagName || 'element').toLowerCase() + id + cls, fully: coveredCount === points.length };
|
|
504
|
+
};
|
|
505
|
+
const obscured = checkObscured();
|
|
382
506
|
if (!baseline.has(element) || element.shadowRoot || element.matches('iframe, :read-write')) {
|
|
383
|
-
return { element: name, indicator: 'not-checked' };
|
|
507
|
+
return { element: name, indicator: 'not-checked', obscured };
|
|
384
508
|
}
|
|
385
509
|
for (let node = element; node; node = node.parentElement) {
|
|
386
|
-
if (!baseline.has(node)) return { element: name, indicator: 'not-checked' };
|
|
387
|
-
if (signature(node) !== baseline.get(node)) return { element: name, indicator: 'style-change' };
|
|
510
|
+
if (!baseline.has(node)) return { element: name, indicator: 'not-checked', obscured };
|
|
511
|
+
if (signature(node) !== baseline.get(node)) return { element: name, indicator: 'style-change', obscured };
|
|
388
512
|
}
|
|
389
513
|
const style = getComputedStyle(element);
|
|
390
|
-
return {
|
|
514
|
+
return {
|
|
515
|
+
element: name,
|
|
516
|
+
indicator: style.outlineStyle === 'none' || parseFloat(style.outlineWidth) === 0 ? 'not-detected' : 'not-checked',
|
|
517
|
+
obscured,
|
|
518
|
+
};
|
|
391
519
|
}, initial);
|
|
392
520
|
if (!stop) break;
|
|
393
|
-
stops.push(stop);
|
|
394
|
-
if (stop.indicator === 'not-detected')
|
|
395
|
-
|
|
521
|
+
stops.push({ element: stop.element, indicator: stop.indicator });
|
|
522
|
+
if (stop.indicator === 'not-detected') {
|
|
523
|
+
findings.push({
|
|
524
|
+
type: 'keyboard-focus-not-detected',
|
|
525
|
+
severity: 'medium',
|
|
526
|
+
element: stop.element,
|
|
527
|
+
message: 'Tab reached this element but no focus style change was detected; inspect the focused state manually',
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
if (stop.obscured) {
|
|
531
|
+
findings.push({
|
|
532
|
+
type: 'focus-obscured',
|
|
533
|
+
severity: stop.obscured.fully ? 'high' : 'medium',
|
|
534
|
+
element: stop.element,
|
|
535
|
+
message: `focused element is ${stop.obscured.fully ? 'fully' : 'partially'} obscured by fixed/sticky overlay ${stop.obscured.by} (WCAG 2.4.11)`,
|
|
536
|
+
});
|
|
537
|
+
}
|
|
396
538
|
}
|
|
397
539
|
} finally {
|
|
398
540
|
await initial.dispose();
|
|
@@ -466,15 +608,28 @@ async function main() {
|
|
|
466
608
|
|
|
467
609
|
const out = path.resolve(options.out);
|
|
468
610
|
fs.mkdirSync(out, { recursive: true });
|
|
469
|
-
const browser = await chromium.launch({ headless: true });
|
|
611
|
+
const browser = await chromium.launch({ headless: true, ...(options.executablePath ? { executablePath: options.executablePath } : {}) });
|
|
470
612
|
const staticTarget = await createStaticTarget(target, options);
|
|
471
|
-
const report = {
|
|
613
|
+
const report = {
|
|
614
|
+
target,
|
|
615
|
+
generatedAt: new Date().toISOString(),
|
|
616
|
+
captures: [],
|
|
617
|
+
heuristic: true,
|
|
618
|
+
...(options.forcedColors ? { forcedColors: options.forcedColors } : {}),
|
|
619
|
+
...(options.locale ? { locale: options.locale } : {}),
|
|
620
|
+
};
|
|
472
621
|
let sawHttpError = false;
|
|
473
622
|
try {
|
|
474
623
|
for (const viewport of breakpoints) {
|
|
475
624
|
for (const colorScheme of options.lightOnly ? ['light'] : ['light', 'dark']) {
|
|
476
625
|
for (const reducedMotion of options.reducedMotion ? ['no-preference', 'reduce'] : ['no-preference']) {
|
|
477
|
-
const page = await browser.newPage({
|
|
626
|
+
const page = await browser.newPage({
|
|
627
|
+
viewport,
|
|
628
|
+
colorScheme,
|
|
629
|
+
reducedMotion,
|
|
630
|
+
...(options.forcedColors ? { forcedColors: options.forcedColors } : {}),
|
|
631
|
+
...(options.locale ? { locale: options.locale } : {}),
|
|
632
|
+
});
|
|
478
633
|
const pendingRequests = trackDataRequests(page);
|
|
479
634
|
const response = await page.goto(staticTarget.url, { waitUntil: 'load', timeout: options.timeout });
|
|
480
635
|
const status = response ? response.status() : null;
|
|
@@ -483,7 +638,7 @@ async function main() {
|
|
|
483
638
|
const name = `${viewport.width}x${viewport.height}-${colorScheme}-${reducedMotion === 'reduce' ? 'reduced-motion' : 'motion'}.png`;
|
|
484
639
|
const file = path.join(out, name);
|
|
485
640
|
await page.screenshot({ path: file, fullPage: true });
|
|
486
|
-
const audit = await page.evaluate(`(${auditSource})()`);
|
|
641
|
+
const audit = await page.evaluate(`(${auditSource})(${JSON.stringify({ colorScheme })})`);
|
|
487
642
|
if (options.keyboard) {
|
|
488
643
|
const keyboard = await auditKeyboard(page);
|
|
489
644
|
audit.keyboard = keyboard.stops;
|