@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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# HarmonyOS ArkUI, Elixir LiveView Native, Taro, & uni-app
|
|
2
|
+
|
|
3
|
+
Use this reference for **HarmonyOS NEXT (ArkUI / ArkTS)**, **Elixir LiveView Native** (server-driven native SwiftUI / Jetpack Compose), and cross-mini-app/mobile frameworks (**Taro**, **uni-app**). Never collapse distinct platform navigation, safe areas, or input models into lowest-common-denominator web-style markup.
|
|
4
|
+
|
|
5
|
+
## HarmonyOS ArkUI / ArkTS
|
|
6
|
+
|
|
7
|
+
Build HarmonyOS NEXT interfaces with **State Management V2** (`@ComponentV2`, `@Local`, `@Param`, `@Event`, `@Computed`), semantic resource bundles, and multi-device breakpoints (phone, foldable, tablet, 2-in-1):
|
|
8
|
+
|
|
9
|
+
- **State V2**: prefer `@ComponentV2` with `@Local` (internal mutable state), `@Param` (parent-owned read-only input), and `@Event` callbacks over legacy V1 `@State`/`@Prop`/`@Link` where the project targets API 12+.
|
|
10
|
+
- **Tokens & dark mode**: store all semantic colors, dimensions, and localized strings in `resources/base/element/*.json` with matching `resources/dark/element/color.json` overrides and reference them via **`$r('app.color.*')`**, `$r('app.float.*')`, and `$r('app.string.*')`—never hardcode light-only hex values.
|
|
11
|
+
- **Responsive layout**: compose adaptive grids with **`GridRow` / `GridCol`** (`xs`, `sm`, `md`, `lg` breakpoints) and `Navigation` (`NavigationMode.Auto`) so phone single-column flows expand cleanly into split panes on foldables and tablets.
|
|
12
|
+
- **Font scaling, safe areas, & Accessibility Kit**: express text sizes in `fp` (honoring system `fontSizeScale`), avoid clipping by letting horizontal rows wrap or stack under large font scales, apply `.expandSafeArea(...)` deliberately for full-bleed backdrops while keeping primary actions inside safe bounds, and wire HarmonyOS Accessibility Kit attributes (`.accessibilityText(...)`, `.accessibilityDescription(...)`, `.accessibilityGroup(true)`, `.accessibilityLevel('yes' | 'no')`).
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// HarmonyOS ArkTS (API 12+ State V2 + GridRow/GridCol + semantic $r tokens + Accessibility Kit)
|
|
16
|
+
@Entry
|
|
17
|
+
@ComponentV2
|
|
18
|
+
struct InvoiceSummaryPage {
|
|
19
|
+
@Local activeFilter: string = 'unpaid';
|
|
20
|
+
|
|
21
|
+
build() {
|
|
22
|
+
Column({ space: 12 }) {
|
|
23
|
+
GridRow({
|
|
24
|
+
columns: { sm: 4, md: 8, lg: 12 },
|
|
25
|
+
gutter: { x: 12, y: 12 },
|
|
26
|
+
}) {
|
|
27
|
+
GridCol({ span: { sm: 4, md: 4, lg: 6 } }) {
|
|
28
|
+
InvoiceMetricCard({
|
|
29
|
+
label: $r('app.string.overdue_total'),
|
|
30
|
+
amount: '¥18,400',
|
|
31
|
+
onSelect: () => { this.activeFilter = 'overdue'; },
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
.padding({ left: 16, right: 16 })
|
|
36
|
+
}
|
|
37
|
+
.width('100%')
|
|
38
|
+
.height('100%')
|
|
39
|
+
.backgroundColor($r('app.color.semantic_surface'))
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ComponentV2
|
|
44
|
+
struct InvoiceMetricCard {
|
|
45
|
+
@Param @Require label: ResourceStr;
|
|
46
|
+
@Param @Require amount: string;
|
|
47
|
+
@Event onSelect: () => void = () => {};
|
|
48
|
+
|
|
49
|
+
build() {
|
|
50
|
+
Column({ space: 6 }) {
|
|
51
|
+
Text(this.label).fontSize(14).fontColor($r('app.color.semantic_text_muted'))
|
|
52
|
+
Text(this.amount).fontSize(24).fontWeight(FontWeight.SemiBold).fontColor($r('app.color.semantic_text'))
|
|
53
|
+
}
|
|
54
|
+
.width('100%')
|
|
55
|
+
.padding(16)
|
|
56
|
+
.borderRadius(12)
|
|
57
|
+
.backgroundColor($r('app.color.semantic_surface_raised'))
|
|
58
|
+
.accessibilityGroup(true)
|
|
59
|
+
.accessibilityText($r('app.string.overdue_card_a11y'))
|
|
60
|
+
.onClick(() => this.onSelect())
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Elixir LiveView Native
|
|
66
|
+
|
|
67
|
+
**LiveView Native** renders genuine **SwiftUI** (`.swiftui.heex` / `~LVN`) and **Jetpack Compose** (`.jetpack.heex`) native controls driven by Phoenix LiveView server state over WebSockets:
|
|
68
|
+
|
|
69
|
+
- **Platform-idiomatic templates**: keep domain logic in the Phoenix LiveView module, but author distinct `.swiftui.heex` (SwiftUI `List`, `NavigationLink`, `ToolbarItem`, `.sheet`) and `.jetpack.heex` (Material 3 `Scaffold`, `TopAppBar`, `LazyColumn`) templates plus platform `LiveViewNative.Stylesheet` token rules—never force identical web-div markup onto both platforms.
|
|
70
|
+
- **Explicit network & offline boundary**: because events round-trip to the Phoenix server over a WebSocket, design visible reconnecting/offline states, prevent duplicate submits during latency, and **do not choose LiveView Native** for offline-first field apps, continuous 60–120 FPS gesture/canvas tools, or zero-latency local editing (choose native SwiftUI/Compose, KMP, or Flutter instead).
|
|
71
|
+
|
|
72
|
+
```heex
|
|
73
|
+
<%# lib/my_app_web/live/invoices_live.swiftui.heex %>
|
|
74
|
+
<List>
|
|
75
|
+
<Section>
|
|
76
|
+
<Text template="header">Open invoices</Text>
|
|
77
|
+
<%= for invoice <- @invoices do %>
|
|
78
|
+
<HStack class="row-padding">
|
|
79
|
+
<VStack alignment="leading">
|
|
80
|
+
<Text class="row-title"><%= invoice.client %></Text>
|
|
81
|
+
<Text class="row-meta"><%= invoice.due_date %></Text>
|
|
82
|
+
</VStack>
|
|
83
|
+
<Spacer />
|
|
84
|
+
<Text class="row-amount"><%= invoice.total %></Text>
|
|
85
|
+
</HStack>
|
|
86
|
+
<% end %>
|
|
87
|
+
</Section>
|
|
88
|
+
</List>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Taro & uni-app (cross-mini-app & mobile)
|
|
92
|
+
|
|
93
|
+
Use **Taro** (React/Vue/Solid over mini-programs, H5, RN, HarmonyOS) or **uni-app / uni-app x** (Vue/UTS over WeChat/Alipay/ByteDance mini-programs, iOS, Android, HarmonyOS) when multi-super-app distribution is an explicit product requirement:
|
|
94
|
+
|
|
95
|
+
- **Safe areas & mini-program capsule geometry**: query system window/capsule metrics (`Taro.getWindowInfo()` / `Taro.getMenuButtonBoundingClientRect()` or `uni.getWindowInfo()` + `env(safe-area-inset-bottom)`) whenever building a custom navigation bar so titles and action buttons never collide with the host mini-program's floating capsule menu or home indicator.
|
|
96
|
+
- **Platform conditional compilation (no lowest-common-denominator UX)**: branch platform-specific navigation, payment, share sheets, and pickers explicitly—`// #ifdef MP-WEIXIN` / `// #ifdef APP-PLUS` / `// #ifdef HARMONY` in **uni-app**, or `process.env.TARO_ENV` and `.weapp.tsx` / `.rn.tsx` / `.h5.tsx` file extensions in **Taro**.
|
|
97
|
+
- **Mini-program budgets & `setData` discipline**: keep the main package under the host super-app limit (typically 2 MB) using subpackages (`subPackages`), avoid pushing giant arrays through `setData` on scroll/input ticks, and verify accessibility focus/font scaling on real host clients rather than browser H5 preview alone.
|
|
98
|
+
|
|
99
|
+
## Do/don't pairs
|
|
100
|
+
|
|
101
|
+
| Do | Don't |
|
|
102
|
+
|---|---|
|
|
103
|
+
| Use HarmonyOS `@ComponentV2`, `@Local`/`@Param`, `GridRow`/`GridCol`, and `$r('app.color.*')` | Hardcode hex colors and fixed phone widths that clip on HarmonyOS foldables and dark mode |
|
|
104
|
+
| Write separate `.swiftui.heex` and `.jetpack.heex` templates in LiveView Native with explicit offline banners | Treat LiveView Native as an offline-first architecture or force identical layouts across iOS and Android |
|
|
105
|
+
| Compute mini-program capsule bounds (`getMenuButtonBoundingClientRect`) and use `#ifdef` / `.weapp` platform branches in Taro/uni-app | Hardcode a 44px top header that collides with WeChat's capsule button or ship unsplit >2 MB mini-program main packages |
|
|
106
|
+
| Test real DevEco/Xcode/Android/WeChat DevTools builds and label untested hosts `not-checked` | Rely solely on an H5 web browser preview to verify HarmonyOS, LiveView Native, or mini-program behavior |
|
|
107
|
+
|
|
108
|
+
## Verification commands
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
# HarmonyOS ArkTS (DevEco / hvigor):
|
|
112
|
+
hvigorw assembleHap
|
|
113
|
+
|
|
114
|
+
# Elixir LiveView Native:
|
|
115
|
+
mix test
|
|
116
|
+
|
|
117
|
+
# Taro (target-specific build):
|
|
118
|
+
npm run build:weapp
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
CLI builds and `mix test` are `static` / logic evidence. Inspect running apps in HarmonyOS DevEco Previewer/Emulator (dark mode, foldable breakpoints, font scale, ScreenReader), iOS Simulator / Android Emulator (LiveView Native reconnects + native navigation), and WeChat DevTools / physical devices (Taro/uni-app capsule alignment and subpackage size) for `rendered` evidence; label untested hosts `not-checked`.
|
|
@@ -1,55 +1,76 @@
|
|
|
1
1
|
# Ionic / Capacitor
|
|
2
2
|
|
|
3
|
-
## Token mapping
|
|
3
|
+
## Token mapping & Ionic 8 palettes
|
|
4
4
|
|
|
5
|
-
Ionic
|
|
5
|
+
Ionic 8 supports modern CSS **`light-dark()`** and built-in **high-contrast palettes** (`@ionic/core/css/palettes/dark.system.css`, `high-contrast.system.css`, `high-contrast-dark.system.css`). Bridge DTCG semantic CSS custom properties into Ionic's documented `--ion-*` tokens rather than piercing Shadow DOM internals:
|
|
6
6
|
|
|
7
7
|
```css
|
|
8
|
+
@import '@ionic/core/css/palettes/dark.system.css';
|
|
9
|
+
@import '@ionic/core/css/palettes/high-contrast.system.css';
|
|
10
|
+
@import '@ionic/core/css/palettes/high-contrast-dark.system.css';
|
|
11
|
+
|
|
8
12
|
:root {
|
|
9
|
-
|
|
10
|
-
--ion-
|
|
13
|
+
color-scheme: light dark;
|
|
14
|
+
--ion-color-primary: light-dark(var(--semantic-action-light), var(--semantic-action-dark));
|
|
15
|
+
--ion-background-color: var(--semantic-surface);
|
|
16
|
+
--ion-text-color: var(--semantic-on-surface);
|
|
11
17
|
}
|
|
12
18
|
```
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
Use documented `::part(...)` selectors and `--ion-*` variables; never rely on fragile shadow-root traversal hacks.
|
|
21
|
+
|
|
22
|
+
## Capacitor 6–8 Android Edge-to-Edge & layout idioms
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
Android 15/16 enforces edge-to-edge rendering. Configure Capacitor 6–8's **`SystemBars`** plugin / `adjustMarginsForEdgeToEdge` setting (or `@capacitor/status-bar` + explicit safe-area insets) alongside `<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0">` and CSS `env(safe-area-inset-*)` so headers, bottom tabs, and CTAs never collide with cutouts or gesture bars.
|
|
17
25
|
|
|
18
|
-
Use Ionic page
|
|
26
|
+
Use Ionic's `<ion-app>`, `<ion-page>`, `<ion-header>`, `<ion-content>`, `<ion-footer>`, `<ion-split-pane>`, and `<ion-router-outlet>` so swipe-back, hardware back, and scroll-to-top follow host conventions. Choose `mode` (`ios` / `md`) per host platform by default rather than locking Android users into iOS chrome or vice versa.
|
|
19
27
|
|
|
20
|
-
##
|
|
28
|
+
## Capacitor without Ionic (plain web frameworks + Konsta / Tailwind)
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
You do **not** need Ionic Framework to ship a Capacitor app. Teams using React, Vue, Svelte, Solid, or Angular with **Tailwind CSS** (optionally paired with **Konsta UI** for iOS/Material Tailwind primitives) can target Capacitor directly without Ionic's Web Components / Shadow DOM layer. When opting out of Ionic, you explicitly own:
|
|
23
31
|
|
|
24
|
-
|
|
32
|
+
- iOS swipe-back and Android hardware/predictive back handling (`@capacitor/app` `backButton` listener),
|
|
33
|
+
- safe-area and keyboard inset padding (`@capacitor/keyboard` + `env(safe-area-inset-*)`),
|
|
34
|
+
- native-feeling sheet/modal focus traps and scroll-container momentum,
|
|
35
|
+
- 44pt / 48dp touch targets and tap-highlight suppression (`-webkit-tap-highlight-color: transparent` paired with intentional `:active` feedback).
|
|
25
36
|
|
|
26
|
-
|
|
37
|
+
## Forms idiom (Ionic 7/8 `label` / `labelPlacement`)
|
|
27
38
|
|
|
28
|
-
|
|
39
|
+
Legacy standalone `<ion-label>` inside `<ion-item>` around form controls is **deprecated in Ionic 7/8**. Pass **`label`** and **`labelPlacement`** (`"stacked"`, `"floating"`, `"fixed"`, `"start"`) directly on `<ion-input>`, `<ion-textarea>`, `<ion-select>`, `<ion-toggle>`, `<ion-checkbox>`, and `<ion-radio>`, paired with `helper-text` and `error-text`:
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
```html
|
|
42
|
+
<ion-input
|
|
43
|
+
label="Work email"
|
|
44
|
+
label-placement="stacked"
|
|
45
|
+
type="email"
|
|
46
|
+
autocomplete="email"
|
|
47
|
+
inputmode="email"
|
|
48
|
+
helper-text="Receipts are sent here."
|
|
49
|
+
error-text="Enter a valid email address."
|
|
50
|
+
></ion-input>
|
|
51
|
+
```
|
|
31
52
|
|
|
32
|
-
|
|
53
|
+
Prefer `label-placement="stacked"` for dense or localized forms so long labels do not overlap values or clip on narrow screens.
|
|
33
54
|
|
|
34
|
-
|
|
55
|
+
## Typography, motion, accessibility, & states idioms
|
|
35
56
|
|
|
36
|
-
|
|
57
|
+
Bundle fonts locally (offline-ready) with platform fallbacks and ensure text reflows cleanly under WebView / OS text zoom. Honor `@media (prefers-reduced-motion: reduce)` in CSS and disable non-essential Ionic page transitions when requested.
|
|
37
58
|
|
|
38
|
-
|
|
59
|
+
Manage focus explicitly on router navigation and modal/sheet dismissal (WebViews do not automatically restore focus reliably). Model both web data state (loading/empty/error/offline/optimistic) and native shell state (permission denied, `@capacitor/network` offline, `@capacitor/app` background/resume, deep-link cold start, keyboard open/closed).
|
|
39
60
|
|
|
40
61
|
## Do/don't pairs
|
|
41
62
|
|
|
42
63
|
| Do | Don't |
|
|
43
64
|
|---|---|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
65
|
+
| `<ion-input label="Email" label-placement="stacked" error-text="...">` | Deprecated `<ion-item><ion-label>…</ion-label><ion-input /></ion-item>` |
|
|
66
|
+
| Import Ionic 8 `dark.system.css` & `high-contrast.system.css` palettes | Hard-code light-only colors that wash out in high-contrast or dark mode |
|
|
67
|
+
| Configure Capacitor `SystemBars` + `viewport-fit=cover` + `env(safe-area-inset-*)` | Leave Android 15/16 status/gesture bars overlapping app headers or tabs |
|
|
68
|
+
| Documented `--ion-*` custom properties and `::part()` | Fragile selectors attempting to pierce internal Shadow DOM markup |
|
|
69
|
+
| Handle `@capacitor/app` `backButton` and focus restoration explicitly | Assume browser history handles Android hardware back and modal escape |
|
|
49
70
|
|
|
50
71
|
## Known traps
|
|
51
72
|
|
|
52
|
-
WebView
|
|
73
|
+
Android System WebView fragmentation, Android 15/16 edge-to-edge overlap when `SystemBars` / safe-area insets are unconfigured, fixed-bottom CTAs buried under the soft keyboard, stale `npx cap sync` native assets after web builds, permission prompt loops with no denied-state recovery, cold-start deep links dropping route state, Capacitor-without-Ionic apps missing hardware back handlers.
|
|
53
74
|
|
|
54
75
|
## Verification commands
|
|
55
76
|
|
|
@@ -58,8 +79,9 @@ npm run lint
|
|
|
58
79
|
npm run test -- --watch=false
|
|
59
80
|
npm run build
|
|
60
81
|
npx cap sync
|
|
61
|
-
|
|
62
|
-
npx cap run
|
|
82
|
+
# Run on real device/emulator when Xcode or Android SDK is installed:
|
|
83
|
+
npx cap run ios
|
|
84
|
+
npx cap run android
|
|
63
85
|
```
|
|
64
86
|
|
|
65
|
-
|
|
87
|
+
Web build/unit tests provide `static` evidence; desktop browser DevTools verifies inner DOM only. Run real iOS/Android device or emulator builds to verify Android 15/16 edge-to-edge, keyboard insets, hardware/swipe back, native plugin permissions, VoiceOver/TalkBack, and offline recovery (`rendered`; mark unavailable targets `not-checked`).
|
|
@@ -1,61 +1,129 @@
|
|
|
1
1
|
# Jetpack Compose
|
|
2
2
|
|
|
3
|
-
## Token mapping
|
|
3
|
+
## Token mapping & Material 3 Expressive
|
|
4
4
|
|
|
5
|
-
Map
|
|
5
|
+
Map DTCG semantic tokens into `ColorScheme`, `Typography`, `Shapes`, `MotionScheme`, and a typed spacing `CompositionLocal` only when Material theme slots cannot express the role. On Material 3 Expressive (`material3` 1.4+), use **`MaterialExpressiveTheme`** and **`MotionScheme.expressive()`** rather than scattering raw `Color(0xff…)` or ad-hoc spring specs:
|
|
6
6
|
|
|
7
7
|
```kotlin
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
|
9
|
+
@Composable
|
|
10
|
+
fun PixelcraftTheme(
|
|
11
|
+
darkTheme: Boolean = isSystemInDarkTheme(),
|
|
12
|
+
content: @Composable () -> Unit,
|
|
13
|
+
) {
|
|
14
|
+
val colors = if (darkTheme) DarkSemanticColors else LightSemanticColors
|
|
15
|
+
MaterialExpressiveTheme(
|
|
16
|
+
colorScheme = colors,
|
|
17
|
+
motionScheme = MotionScheme.expressive(),
|
|
18
|
+
typography = SemanticTypography,
|
|
19
|
+
content = content,
|
|
20
|
+
)
|
|
21
|
+
}
|
|
10
22
|
```
|
|
11
23
|
|
|
12
|
-
|
|
24
|
+
Adopt Material 3 Expressive components where they clarify action hierarchy: **`FloatingToolbar`** (horizontal/vertical contextual toolbars), **`SplitButtonLayout`** (primary action + attached menu), **`ButtonGroup`** (connected option clusters), and **`LoadingIndicator` / `ContainedLoadingIndicator`** (shape-morphing indeterminate progress).
|
|
13
25
|
|
|
14
|
-
##
|
|
26
|
+
## Edge-to-Edge (Android 15/16) & responsive adaptive layouts
|
|
15
27
|
|
|
16
|
-
|
|
28
|
+
Android 15 (API 35) enforces edge-to-edge by default and Android 16 (API 36) removes the opt-out window flag. Call **`enableEdgeToEdge()`** before `setContent` in `ComponentActivity`, and consume insets deliberately so content never hides behind status bars, display cutouts, gesture navigation bars, or the soft keyboard:
|
|
17
29
|
|
|
18
|
-
|
|
30
|
+
```kotlin
|
|
31
|
+
enableEdgeToEdge()
|
|
32
|
+
setContent {
|
|
33
|
+
PixelcraftTheme {
|
|
34
|
+
Scaffold(
|
|
35
|
+
contentWindowInsets = WindowInsets.safeDrawing,
|
|
36
|
+
bottomBar = { ActionBar(Modifier.imePadding()) },
|
|
37
|
+
) { innerPadding ->
|
|
38
|
+
ContentList(Modifier.padding(innerPadding).consumeWindowInsets(innerPadding))
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For tablets, foldables, and ChromeOS/desktop windows (`sw >= 600dp`), Android 16 (`targetSdk 36`) **ignores fixed `screenOrientation="portrait"` and non-resizable manifest locks**. Never hard-lock portrait on large screens: use **`material3-adaptive`** (`ListDetailPaneScaffold`, `SupportingPaneScaffold`, `NavigationSuiteScaffold`, `currentWindowAdaptiveInfo()`) and survive live fold/unfold posture transitions (`FoldingFeature.State.HALF_OPENED` / `FLAT`) without losing form input, scroll offset, or media playback.
|
|
45
|
+
|
|
46
|
+
## Navigation 3 & Predictive Back
|
|
47
|
+
|
|
48
|
+
- **Predictive Back**: declare `android:enableOnBackInvokedCallback="true"` in `AndroidManifest.xml` and handle custom interruptible back gestures with **`PredictiveBackHandler`** (consuming `progress: Flow<BackEventCompat>`, cleaning up on `CancellationException` when the user aborts the swipe, and committing only on completion):
|
|
49
|
+
|
|
50
|
+
```kotlin
|
|
51
|
+
PredictiveBackHandler(enabled = hasUnsavedDraft) { progress: Flow<BackEventCompat> ->
|
|
52
|
+
try {
|
|
53
|
+
progress.collect { backEvent -> previewDismissProgress = backEvent.progress }
|
|
54
|
+
discardOrPromptDraft()
|
|
55
|
+
} catch (_: CancellationException) {
|
|
56
|
+
previewDismissProgress = 0f
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
19
60
|
|
|
20
|
-
|
|
61
|
+
- **Navigation 3 (`androidx.navigation3`)**: for new Compose-first architectures, prefer Navigation 3's user-owned back stack (`rememberNavBackStack` / `SnapshotStateList`), `NavDisplay`, `entryProvider`, and multi-pane `SceneStrategy` (retaining Navigation 2 where an existing codebase already standardizes on it).
|
|
21
62
|
|
|
22
|
-
##
|
|
63
|
+
## Typography & custom fonts
|
|
23
64
|
|
|
24
|
-
|
|
65
|
+
Use Material typography roles and `sp` scaling. Declare bundled or downloadable font weights and fallbacks explicitly. Test at `200%` font scale and large display size; switch horizontal rows to vertical stacks instead of single-line clipping essential values.
|
|
66
|
+
|
|
67
|
+
## Motion, springs, & reduced motion
|
|
68
|
+
|
|
69
|
+
`MotionScheme` separates **spatial springs** (`defaultSpatialSpec` / `fastSpatialSpec` — position, size, bounds, allowed subtle overshoot) from **effects springs** (`defaultEffectsSpec` — color, alpha, elevation, critically damped with zero overshoot). Seed gesture-driven `Animatable.animateTo(..., initialVelocity = velocity)` with finger release velocity, and use **`SharedTransitionLayout`** (`Modifier.sharedElement` / `Modifier.sharedBounds`) for continuity between list and detail views.
|
|
70
|
+
|
|
71
|
+
Check `Settings.Global.ANIMATOR_DURATION_SCALE` (`0f` = Remove animations enabled) for custom loops, Lottie animations, or shared transitions, falling back to instant/crossfade state changes.
|
|
25
72
|
|
|
26
73
|
## Accessibility specifics
|
|
27
74
|
|
|
28
|
-
Use semantics
|
|
75
|
+
Use `Modifier.semantics` (`contentDescription`, `stateDescription`, `role`, `heading()`, `liveRegion`, `customActions`, `isTraversalGroup`, `traversalIndex`). Pass `contentDescription = null` for purely decorative vectors. Keep touch targets ≥ `48×48 dp` (`minimumInteractiveComponentSize()`). Verify TalkBack focus order on a real device/emulator.
|
|
76
|
+
|
|
77
|
+
## States, process-death restoration, & Forms (`TextFieldState`)
|
|
29
78
|
|
|
30
|
-
|
|
79
|
+
Hoist explicit sealed UI state (`Loading`, `Content`, `Empty`, `Error`, `Offline`) from `ViewModel` via `collectAsStateWithLifecycle()`. Provide stable keys in `LazyColumn`/`LazyRow` (`items(rows, key = { it.id })`) and attach **`Modifier.imeNestedScroll()`** (`WindowInsetsAnimationCompat`) so scrolling interactively drags the soft keyboard open/closed at display refresh rate.
|
|
31
80
|
|
|
32
|
-
|
|
81
|
+
**Strong Skipping Mode** is enabled by default in Kotlin 2.0.20+ Compose compilers, yet stable immutable models, explicit lazy item keys, and **OS process-death restoration** (`rememberSaveable` for UI state + `SavedStateHandle` in `ViewModel` for route IDs/filters/drafts, verified via `adb shell am kill <package>` while backgrounded) remain mandatory.
|
|
82
|
+
|
|
83
|
+
For text input, prefer **`TextFieldState` + `BasicTextField` v2** (and Material `TextField(state = ...)` overloads) over legacy `value`/`onValueChange` to eliminate async IME/cursor race conditions:
|
|
84
|
+
|
|
85
|
+
```kotlin
|
|
86
|
+
val emailState = rememberTextFieldState()
|
|
87
|
+
OutlinedTextField(
|
|
88
|
+
state = emailState,
|
|
89
|
+
label = { Text("Work email") },
|
|
90
|
+
lineLimits = TextFieldLineLimits.SingleLine,
|
|
91
|
+
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email, imeAction = ImeAction.Next),
|
|
92
|
+
inputTransformation = InputTransformation.maxLength(120),
|
|
93
|
+
)
|
|
94
|
+
```
|
|
33
95
|
|
|
34
|
-
##
|
|
96
|
+
## 2026 Google Play submission, 16 KB page alignment & Baseline Profiles
|
|
35
97
|
|
|
36
|
-
|
|
98
|
+
- **`targetSdk 36` & signed `.aab`**: compile and target **API 36 (Android 16)**, ship signed Android App Bundles (`.aab`) with Play App Signing, and upload R8/ProGuard mapping files + native debug symbols on every release to hold **`>= 99.5%` crash-free sessions** and **`0` ANRs**.
|
|
99
|
+
- **Mandatory `16 KB` memory page size native `.so` alignment**: Google Play requires all apps with native code (`.so` from C/C++/Rust/JNI or third-party SDKs) targeting Android 15/16+ to support **16 KB ELF segment alignment**. Build with **NDK r28+** (default 16 KB alignment) + **AGP 8.5.1+** (uncompressed shared libs), or pass `-Wl,-z,max-page-size=16384` on NDK r27, and verify every bundled `.so` before upload (`zipalign -c -P 16 -v 4 app-release.apk`).
|
|
100
|
+
- **Baseline Profiles & `< 800 ms–1.2 s` cold start**: generate Macrobenchmark **Baseline Profiles** (`androidx.profileinstaller`) for startup and critical scroll/navigation journeys, and initialize non-essential SDKs asynchronously via `androidx.startup` / background dispatchers so cold TTID stays `< 1.2 s` (hard ceiling `< 2.0 s`) on mid-tier Android hardware.
|
|
101
|
+
- **Android Keystore encrypted storage & Photo Picker**: store tokens and secrets with **Jetpack Tink (`AndroidKeysetManager`)** + DataStore (or Keystore-backed `EncryptedSharedPreferences` where maintained)—**never** plaintext `SharedPreferences`. Use the system **Android Photo Picker** (`PickVisualMedia`) instead of requesting broad `READ_MEDIA_IMAGES` permissions, and provide in-app + web Account Deletion parity per Google Play Data Safety rules.
|
|
37
102
|
|
|
38
103
|
## Do/don't pairs
|
|
39
104
|
|
|
40
105
|
| Do | Don't |
|
|
41
106
|
|---|---|
|
|
42
|
-
| `
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
| `
|
|
107
|
+
| `enableEdgeToEdge()` + `WindowInsets.safeDrawing` + `Modifier.imePadding()` + `imeNestedScroll()` | Assume system bars reserve space on Android 15/16 or hard-code `24.dp` status-bar padding |
|
|
108
|
+
| `PredictiveBackHandler` handling cancellation gracefully | Intercept `BackHandler` unconditionally and break Android predictive back preview |
|
|
109
|
+
| `ListDetailPaneScaffold` / `NavigationSuiteScaffold` unlocked across postures on `sw >= 600dp` | Hard-lock `android:screenOrientation="portrait"` (ignored on Android 16 large screens) or lose state on unfold |
|
|
110
|
+
| Build native libs with NDK r28+ (`16 KB` ELF alignment), ship Baseline Profiles, and encrypt tokens via Keystore/Tink | Ship `4 KB`-aligned `.so` binaries rejected by Google Play or store JWTs in plaintext `SharedPreferences` |
|
|
111
|
+
| Persist route/draft keys in `SavedStateHandle` + `rememberSaveable` and test `adb shell am kill` | Hold critical screen state only in `remember` or unpersisted `ViewModel` fields |
|
|
112
|
+
| `TextFieldState` + `rememberTextFieldState()` and `items(invoices, key = { it.id })` | Legacy `StateFlow` `value`/`onValueChange` IME cursor loops or index-keyed lazy lists |
|
|
47
113
|
|
|
48
114
|
## Known traps
|
|
49
115
|
|
|
50
|
-
|
|
116
|
+
Double-applying `WindowInsets` padding, uncancelled `PredictiveBackHandler` leaving partial swipe offsets stuck, third-party AARs bundling unaligned `4 KB` `.so` files, state loss on foldable posture change or `adb shell am kill`, plaintext `SharedPreferences` token leaks, custom animations ignoring `ANIMATOR_DURATION_SCALE == 0f`, skipping TalkBack verification on OEM skins.
|
|
51
117
|
|
|
52
118
|
## Verification commands
|
|
53
119
|
|
|
54
120
|
```sh
|
|
55
|
-
./gradlew
|
|
121
|
+
./gradlew assembleRelease
|
|
56
122
|
./gradlew testDebugUnitTest
|
|
57
123
|
./gradlew connectedDebugAndroidTest
|
|
58
124
|
./gradlew lint
|
|
125
|
+
# Verify 16 KB ELF page alignment on release APK extracted from bundle:
|
|
126
|
+
zipalign -c -P 16 -v 4 app/build/outputs/apk/release/app-release.apk
|
|
59
127
|
```
|
|
60
128
|
|
|
61
|
-
|
|
129
|
+
Build/unit tests and `zipalign -c -P 16` provide `static` evidence. Capture real-device/emulator runs (`>= 3` Android devices across Pixel + Samsung One UI / Xiaomi / OPPO OEM skins) with TalkBack, `200%` font scale, Dark Mode, foldable posture changes, `adb shell am kill` background restoration, Android 16 edge-to-edge + predictive back, and Remove animations enabled for `rendered` evidence; label untested hardware `not-checked`.
|
|
@@ -1,59 +1,82 @@
|
|
|
1
|
-
# Kivy
|
|
2
|
-
|
|
3
|
-
## Token mapping
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
|
|
1
|
+
# Kivy & KivyMD
|
|
2
|
+
|
|
3
|
+
## Token mapping & density units (`dp` / `sp`)
|
|
4
|
+
|
|
5
|
+
Encode semantic colors, spacing, and typography scales once in Python and KV rather than scattering raw normalized RGBA tuples `(0.0, 0.455, 0.792, 1)` across screens. Always measure layout dimensions in density-independent **`dp`** and text in scale-independent **`sp`** from `kivy.metrics`:
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from kivy.metrics import dp, sp
|
|
9
|
+
from kivymd.app import MDApp
|
|
10
|
+
from kivymd.uix.button import MDButton, MDButtonText
|
|
11
|
+
from kivymd.uix.boxlayout import MDBoxLayout
|
|
12
|
+
|
|
13
|
+
class PcTokens:
|
|
14
|
+
CONTROL_INLINE = dp(12)
|
|
15
|
+
MIN_TOUCH_TARGET = dp(48)
|
|
16
|
+
BODY_SIZE = sp(16)
|
|
17
|
+
|
|
18
|
+
class InvoiceApp(MDApp):
|
|
19
|
+
def build(self):
|
|
20
|
+
self.theme_cls.theme_style = "Dark" # switchable Light / Dark
|
|
21
|
+
self.theme_cls.primary_palette = "Blue"
|
|
22
|
+
root = MDBoxLayout(orientation="vertical", padding=PcTokens.CONTROL_INLINE, spacing=dp(8))
|
|
23
|
+
root.add_widget(
|
|
24
|
+
MDButton(
|
|
25
|
+
MDButtonText(text="Save invoice"),
|
|
26
|
+
style="filled",
|
|
27
|
+
size_hint=(None, None),
|
|
28
|
+
height=PcTokens.MIN_TOUCH_TARGET,
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
return root
|
|
9
32
|
```
|
|
10
33
|
|
|
11
|
-
|
|
34
|
+
For apps targeting Material Design 3 aesthetics and structured mobile widgets, use **KivyMD 2.x** (`MDApp`, `MDButton`, `MDTextField`, `MDNavigationBar`, `MDTopAppBar`, `theme_cls.theme_style`, `theme_cls.primary_palette`) instead of hand-styling low-level Kivy `Button` canvases.
|
|
12
35
|
|
|
13
36
|
## Layout and responsive idioms
|
|
14
37
|
|
|
15
|
-
Use
|
|
16
|
-
|
|
17
|
-
## Typography/custom fonts
|
|
18
|
-
|
|
19
|
-
Register custom fonts and use sp-based sizing. Verify glyph coverage/fallback because Kivy font behavior differs by platform. Do not fixed-size clip localized or scaled text; measure texture constraints where custom layout matters.
|
|
38
|
+
Use `BoxLayout`, `GridLayout`, `AnchorLayout`, `RecycleView` (for virtualized long lists—never add hundreds of rows directly into a `ScrollView`), `size_hint`, and `dp`/`sp` metrics. Recompute custom `canvas` instructions on `pos`/`size` bindings so resizing, rotation, and foldable transitions never leave stale geometry. Account for system bars and mobile keyboard height (`Window.softinput_mode = "below_target"` or `"pan"`).
|
|
20
39
|
|
|
21
|
-
##
|
|
40
|
+
## Typography, motion, & reduced motion
|
|
22
41
|
|
|
23
|
-
|
|
42
|
+
Register custom TTF/OTF fonts via `LabelBase.register(...)` and verify glyph coverage for every target locale (Kivy does not automatically cascade OS fallback fonts cleanly for CJK/RTL/emoji without explicit shaping/font config—verify HarfBuzz/Pango text provider where RTL or complex scripts matter).
|
|
24
43
|
|
|
25
|
-
|
|
44
|
+
Use `kivy.animation.Animation` sparingly and call `Animation.cancel_all(widget)` on screen exit (`on_leave`). Because Kivy does not automatically mirror OS reduced-motion preferences across all platforms, expose an in-app reduced-motion toggle and never rely on animation as the only status cue.
|
|
26
45
|
|
|
27
|
-
|
|
46
|
+
## Accessibility, states, & forms idioms
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
**Honest accessibility limit**: Kivy's OpenGL/canvas widget tree has minimal built-in screen-reader (TalkBack/VoiceOver/Narrator) integration compared to native SwiftUI, Jetpack Compose, or Flutter. Treat screen-reader compliance as `not-checked` or unsupported until explicitly bridged and verified on device; enforce explicit keyboard focus (`FocusBehavior`), ≥ `48 dp` touch targets, high contrast, and text+icon (non-color-only) state encoding.
|
|
30
49
|
|
|
31
|
-
|
|
50
|
+
Own state via Kivy `Property` bindings (`StringProperty`, `BooleanProperty`, `ListProperty`) so UI updates stay reactive. Cancel `Clock.schedule_*` callbacks on screen leave and marshal background-thread results onto the main thread with `@mainthread` or `Clock.schedule_once`. Preserve form drafts across `ScreenManager` transitions and verify mobile soft-keyboard occlusion and paste behavior on real devices.
|
|
32
51
|
|
|
33
|
-
##
|
|
52
|
+
## Mobile packaging: Buildozer & `kivy-ios`
|
|
34
53
|
|
|
35
|
-
|
|
54
|
+
- **Android (`Buildozer` / `python-for-android`)**: pin `android.api` / `android.minapi` / `android.ndk`, target `arm64-v8a` (required by Google Play), list every pure-Python and compiled recipe explicitly in `buildozer.spec` (`requirements = python3,kivy,kivymd,...`), declare runtime permissions truthfully, and test APK/AAB size and cold-start time on real Android hardware.
|
|
55
|
+
- **iOS (`kivy-ios`)**: compile Python and native recipes via `toolchain build python3 kivy ...`, generate the Xcode project via `toolchain create`, and verify iOS privacy manifests, code signing, safe-area insets, and background audio/network suspension inside Xcode on a real iPhone.
|
|
36
56
|
|
|
37
57
|
## Do/don't pairs
|
|
38
58
|
|
|
39
59
|
| Do | Don't |
|
|
40
60
|
|---|---|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
| cancel
|
|
44
|
-
|
|
|
45
|
-
|
|
|
61
|
+
| Use `dp()` / `sp()` metrics and `RecycleView` for long lists | Hard-code raw pixels or dump 500 widgets into a `ScrollView` |
|
|
62
|
+
| Use KivyMD 2.x `MDApp` / `theme_cls` for Material 3 mobile UI | Hand-draw buttons with raw `canvas` rectangles and touch math |
|
|
63
|
+
| Marshal worker results via `@mainthread` and cancel `Clock` jobs in `on_leave` | Mutate Kivy widgets directly from a Python background thread |
|
|
64
|
+
| Set `Window.softinput_mode` and test keyboard occlusion on device | Assume desktop window layout works when the Android IME opens |
|
|
65
|
+
| Disclose Kivy's screen-reader limitations honestly | Claim VoiceOver/TalkBack compliance from a desktop launch |
|
|
46
66
|
|
|
47
67
|
## Known traps
|
|
48
68
|
|
|
49
|
-
|
|
69
|
+
Missing CJK/RTL/emoji font glyphs without HarfBuzz/Pango text provider, `canvas` instructions not bound to `pos`/`size`, mutating graphics from background threads causing GL crashes, Buildozer NDK/recipe version conflicts for C-extension packages, `kivy-ios` missing iOS privacy manifest or safe-area handling, keyboard hiding `TextInput` fields, uncancelled `Clock` timers leaking screens.
|
|
50
70
|
|
|
51
71
|
## Verification commands
|
|
52
72
|
|
|
53
73
|
```sh
|
|
54
|
-
python main.py
|
|
55
|
-
python -m pytest
|
|
56
74
|
python -m compileall .
|
|
75
|
+
python -m pytest
|
|
76
|
+
python main.py
|
|
77
|
+
# Android / iOS packaging (run on configured Linux/macOS build hosts):
|
|
78
|
+
buildozer android debug
|
|
79
|
+
toolchain build python3 kivy
|
|
57
80
|
```
|
|
58
81
|
|
|
59
|
-
|
|
82
|
+
`compileall` and `pytest` provide `static` / logic evidence. Run the packaged app on actual Android/iOS/desktop targets across resize, soft-keyboard input, dark/light theme, and cold-start packaging checks for `rendered` evidence; mark untested mobile targets and screen-reader parity `not-checked`.
|