├── .github └── workflows │ └── rust.yml ├── .gitignore ├── .gitmodules ├── .helix ├── config.toml └── languages.toml ├── .idea ├── .gitignore ├── .idea │ ├── .gitignore │ ├── modules.xml │ ├── pax-lang.iml │ ├── pax.iml │ └── vcs.xml ├── deployment.xml ├── inspectionProfiles │ └── Project_Default.xml ├── modules.xml ├── pax.iml └── vcs.xml ├── .python-version ├── CONTRIBUTING.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── ROADMAP.md ├── backlog-archive.md ├── compiler-sequence.png ├── examples ├── calculator.rs ├── color-picker.rs ├── create-example.sh ├── fireworks.rs ├── game-of-life.rs ├── increment.rs ├── llm-interface.rs ├── marketing-site.rs ├── mouse-animation.rs ├── particles.rs ├── perf-testbed.rs ├── scripts │ └── mod.rs ├── slot-particles.rs ├── space-game.rs ├── src │ ├── breakout │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── lib.pax │ │ │ └── lib.rs │ ├── calculator │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── lib.pax │ │ │ └── lib.rs │ ├── color-picker │ │ ├── Cargo.toml │ │ ├── assets │ │ │ └── color_picker │ │ │ │ └── transparency_grid.png │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── color_picker.pax │ │ │ └── lib.rs │ ├── fireworks │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── fireworks.pax │ │ │ └── lib.rs │ ├── game-of-life │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── lib.rs │ │ │ └── templates │ │ │ ├── cell.pax │ │ │ ├── color_control.pax │ │ │ ├── lib.pax │ │ │ └── speed_control.pax │ ├── increment │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── lib.pax │ │ │ └── lib.rs │ ├── llm-interface │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── card.pax │ │ │ ├── card.rs │ │ │ ├── lib.pax │ │ │ └── lib.rs │ ├── marketing-site │ │ ├── Cargo.toml │ │ ├── assets │ │ │ └── placeholder.jpg │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── animation.rs │ │ │ ├── calculator.pax │ │ │ ├── calculator.rs │ │ │ ├── color_picker.pax │ │ │ ├── color_picker.rs │ │ │ ├── fireworks.pax │ │ │ ├── fireworks.rs │ │ │ ├── lib.pax │ │ │ ├── lib.rs │ │ │ ├── space_game.pax │ │ │ └── space_game.rs │ ├── mouse-animation │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── lib.pax │ │ │ ├── lib.rs │ │ │ ├── path_animation.pax │ │ │ └── path_animation.rs │ ├── particles │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── ball.pax │ │ │ ├── ball.rs │ │ │ ├── lib.pax │ │ │ └── lib.rs │ ├── perf-testbed │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── lib.pax │ │ │ ├── lib.rs │ │ │ └── virtual_elements │ │ │ ├── mod.pax │ │ │ └── mod.rs │ ├── slot-particles │ │ ├── Cargo.toml │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── lib.pax │ │ │ ├── lib.rs │ │ │ ├── slot_particles.pax │ │ │ └── slot_particles │ │ │ ├── mod.pax │ │ │ └── mod.rs │ ├── space-game │ │ ├── Cargo.toml │ │ ├── assets │ │ │ ├── asteroid0.png │ │ │ ├── asteroid1.png │ │ │ ├── asteroid2.png │ │ │ ├── bullet.png │ │ │ ├── spaceship.png │ │ │ └── starfield0.png │ │ ├── bin │ │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ │ ├── animation.rs │ │ │ ├── lib.pax │ │ │ └── lib.rs │ └── starter-project │ │ ├── Cargo.toml │ │ ├── assets │ │ ├── Frame 1.png │ │ ├── Frame 2.png │ │ ├── Frame 3.png │ │ └── pax-logo-white-on-black.png │ │ ├── bin │ │ └── run.rs │ │ ├── pax │ │ └── src │ │ ├── calculator.pax │ │ ├── calculator.rs │ │ ├── lib.pax │ │ └── lib.rs └── test.html ├── lab-journal-ss.md ├── lab-journal-zb-2024.md ├── lab-journal-zb.md ├── pax-chassis-common ├── Cargo.toml └── src │ ├── core_graphics_c_bridge.rs │ └── lib.rs ├── pax-chassis-ios ├── Cargo.toml └── src │ └── lib.rs ├── pax-chassis-macos ├── Cargo.toml ├── README.md └── src │ └── lib.rs ├── pax-chassis-web ├── Cargo.toml ├── package-lock.json ├── package.json └── src │ ├── lib.rs │ └── web_render_contexts.rs ├── pax-cli ├── Cargo.toml └── src │ ├── http.rs │ └── main.rs ├── pax-compiler ├── .gitignore ├── Cargo.toml ├── README.md ├── files │ ├── interfaces │ │ ├── ios │ │ │ └── pax-app-ios │ │ │ │ ├── pax-app-ios.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ └── project.xcworkspace │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ └── pax-app-ios │ │ │ │ ├── Assets.xcassets │ │ │ │ ├── AccentColor.colorset │ │ │ │ │ └── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ │ ├── ContentView.swift │ │ │ │ ├── Main.swift │ │ │ │ ├── PaxViewIos.swift │ │ │ │ └── Preview Content │ │ │ │ └── Preview Assets.xcassets │ │ │ │ └── Contents.json │ │ ├── macos │ │ │ ├── README.md │ │ │ └── pax-app-macos │ │ │ │ ├── pax-app-macos.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ └── project.xcworkspace │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ │ └── pax-app-macos │ │ │ │ ├── Assets.xcassets │ │ │ │ ├── AccentColor.colorset │ │ │ │ │ └── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── pax-logo-1024.png │ │ │ │ │ ├── pax-logo-128.png │ │ │ │ │ ├── pax-logo-16.png │ │ │ │ │ ├── pax-logo-256 1.png │ │ │ │ │ ├── pax-logo-256.png │ │ │ │ │ ├── pax-logo-32 1.png │ │ │ │ │ ├── pax-logo-32.png │ │ │ │ │ ├── pax-logo-512 1.png │ │ │ │ │ ├── pax-logo-512.png │ │ │ │ │ └── pax-logo-64.png │ │ │ │ └── Contents.json │ │ │ │ ├── Main.swift │ │ │ │ ├── PaxViewMacos.swift │ │ │ │ ├── Preview Content │ │ │ │ └── Preview Assets.xcassets │ │ │ │ │ └── Contents.json │ │ │ │ └── pax_app_macos.entitlements │ │ └── web │ │ │ ├── README.md │ │ │ ├── build-interface.sh │ │ │ ├── package.json │ │ │ ├── public │ │ │ └── index.html │ │ │ ├── run-web.sh │ │ │ ├── src │ │ │ ├── classes │ │ │ │ ├── layer.ts │ │ │ │ ├── messages │ │ │ │ │ ├── any-create-patch.ts │ │ │ │ │ ├── button-update-patch.ts │ │ │ │ │ ├── checkbox-update-patch.ts │ │ │ │ │ ├── dropdown-update-patch.ts │ │ │ │ │ ├── event-blocker-update-patch.ts │ │ │ │ │ ├── frame-update-patch.ts │ │ │ │ │ ├── image-load-patch.ts │ │ │ │ │ ├── native-image-update-patch.ts │ │ │ │ │ ├── navigation-patch.ts │ │ │ │ │ ├── occlusion-update-patch.ts │ │ │ │ │ ├── radio-set-update-patch.ts │ │ │ │ │ ├── screenshot-patch.ts │ │ │ │ │ ├── scroller-update-patch.ts │ │ │ │ │ ├── set-cursor-patch.ts │ │ │ │ │ ├── slider-update-patch.ts │ │ │ │ │ ├── text-update-patch.ts │ │ │ │ │ ├── textbox-update-patch.ts │ │ │ │ │ └── youtube-video-update-patch.ts │ │ │ │ ├── native-element-pool.ts │ │ │ │ ├── occlusion-context.ts │ │ │ │ └── text.ts │ │ │ ├── events │ │ │ │ └── listeners.ts │ │ │ ├── index.ts │ │ │ ├── pools │ │ │ │ ├── object-manager.ts │ │ │ │ ├── object-pool.ts │ │ │ │ └── supported-objects.ts │ │ │ ├── styles │ │ │ │ └── pax-web.css │ │ │ ├── types │ │ │ │ ├── pax-cartridge.d.ts │ │ │ │ ├── pax-cartridge_bg.wasm.d.ts │ │ │ │ ├── pax-chassis-web.d.ts │ │ │ │ └── stats-js.d.ts │ │ │ └── utils │ │ │ │ ├── constants.ts │ │ │ │ └── helpers.ts │ │ │ └── tsconfig.json │ ├── new-project │ │ ├── new-libdev-project-template │ │ │ ├── Cargo.toml.template │ │ │ ├── bin │ │ │ │ └── run.rs │ │ │ ├── pax │ │ │ └── src │ │ │ │ ├── animation.rs │ │ │ │ ├── calculator.pax │ │ │ │ ├── calculator.rs │ │ │ │ ├── color_picker.pax │ │ │ │ ├── color_picker.rs │ │ │ │ ├── fireworks.pax │ │ │ │ ├── fireworks.rs │ │ │ │ ├── lib.pax │ │ │ │ ├── lib.rs │ │ │ │ ├── space_game.pax │ │ │ │ └── space_game.rs │ │ └── new-project-template │ │ │ ├── .gitignore │ │ │ ├── Cargo.toml.template │ │ │ ├── assets │ │ │ ├── pax-logo-white-on-black.png │ │ │ └── placeholder.png │ │ │ ├── bin │ │ │ └── run.rs │ │ │ └── src │ │ │ ├── lib.pax │ │ │ └── lib.rs │ └── swift │ │ ├── pax-swift-cartridge │ │ ├── Package.swift │ │ ├── PaxCartridge.xcframework │ │ │ ├── Info.plist │ │ │ ├── ios-arm64 │ │ │ │ └── PaxCartridge.framework │ │ │ │ │ ├── Headers │ │ │ │ │ └── PaxCartridge.h │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── Modules │ │ │ │ │ └── module.modulemap │ │ │ │ │ └── PaxCartridge │ │ │ ├── ios-arm64_x86_64-simulator │ │ │ │ └── PaxCartridge.framework │ │ │ │ │ ├── Headers │ │ │ │ │ └── PaxCartridge.h │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── Modules │ │ │ │ │ └── module.modulemap │ │ │ │ │ └── PaxCartridge │ │ │ └── macos-arm64_x86_64 │ │ │ │ └── PaxCartridge.framework │ │ │ │ ├── Headers │ │ │ │ └── PaxCartridge.h │ │ │ │ ├── Info.plist │ │ │ │ ├── Modules │ │ │ │ └── module.modulemap │ │ │ │ └── PaxCartridge │ │ ├── README.md │ │ ├── Sources │ │ │ └── PaxCartridgeAssets │ │ │ │ ├── Empty.swift │ │ │ │ └── Resources │ │ │ │ └── assets │ │ │ │ └── images │ │ │ │ ├── pax-logo-light.png │ │ │ │ └── pax-logo.png │ │ ├── copy-dylibs-from-pax-example-build.sh │ │ └── rebuild-xcframework.sh │ │ └── pax-swift-common │ │ ├── .gitignore │ │ ├── Package.swift │ │ ├── README.md │ │ ├── Sources │ │ ├── FlexBuffers │ │ │ ├── FlexBufferBuilder.swift │ │ │ ├── FlexBuffers.h │ │ │ └── FlexBuffers.swift │ │ ├── Messages │ │ │ └── Messages.swift │ │ └── Rendering │ │ │ └── Rendering.swift │ │ └── Tests │ │ └── PaxSwiftCommonTests │ │ └── PaxSwiftCommonTests.swift ├── src │ ├── building │ │ ├── apple.rs │ │ ├── mod.rs │ │ └── web.rs │ ├── cartridge_generation │ │ ├── mod.rs │ │ └── templating.rs │ ├── design_server │ │ ├── llm │ │ │ ├── future_training_data │ │ │ │ ├── 1709874916891 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1709874945533 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710097285464 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710097310800 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710097327512 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710097353478 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710097361307 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710097376419 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710097401997 │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710101683173 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710190771713 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710190786499 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710190803315 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710190828173 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710306736452 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710306964046 │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710613439352 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710613456867 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710614429434 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739257719 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739276260 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739293112 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739310443 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739351426 │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739398400 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739433303 │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739517748 │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710739549370 │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710986402014 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710986607062 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710986627664 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710986923069 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710986939548 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710987147257 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710987159804 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ ├── 1710987187152 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ │ └── 1710987370558 │ │ │ │ │ ├── after.pax │ │ │ │ │ ├── before.pax │ │ │ │ │ └── request.txt │ │ │ ├── mod.rs │ │ │ └── simple.rs │ │ ├── mod.rs │ │ ├── static_server.rs │ │ ├── tests │ │ │ ├── data │ │ │ │ └── code_serialization │ │ │ │ │ └── serialization_test_project │ │ │ │ │ └── src │ │ │ │ │ └── lib.rs │ │ │ ├── designtime_integration_test.rs │ │ │ └── manifest_serialization_test.rs │ │ ├── websocket.rs │ │ └── websocket │ │ │ └── socket_message_accumulator.rs │ ├── errors │ │ └── source_map.rs │ ├── helpers.rs │ └── lib.rs ├── templates │ └── cartridge_generation │ │ ├── cartridge.tera │ │ └── macros.tera └── tests │ ├── data │ ├── code_serialization │ │ └── serialization_test_project │ │ │ ├── .gitignore │ │ │ ├── Cargo.toml │ │ │ ├── bin │ │ │ └── run.rs │ │ │ ├── pax │ │ │ └── src │ │ │ ├── generated_lib.rs │ │ │ └── lib.rs │ ├── designtime_integration_test.pax │ └── manifest_serialization_test.pax │ ├── designtime_integration_test.rs │ ├── file_changed_notification_test.rs │ ├── manifest_serialization_test.rs │ └── test_code_serialization.rs ├── pax-designer ├── .gitignore ├── Cargo.toml ├── assets │ ├── color_picker │ │ └── transparency_grid.png │ ├── icons │ │ ├── chevron-down.png │ │ ├── icon-align-center.png │ │ ├── icon-align-left.png │ │ ├── icon-align-right.png │ │ ├── icon-brush.png │ │ ├── icon-button.png │ │ ├── icon-checkbox.png │ │ ├── icon-component.png │ │ ├── icon-console.png │ │ ├── icon-dropdown.png │ │ ├── icon-ellipse.png │ │ ├── icon-for.png │ │ ├── icon-frame.png │ │ ├── icon-fx-off.png │ │ ├── icon-fx-on.png │ │ ├── icon-group.png │ │ ├── icon-if.png │ │ ├── icon-image.png │ │ ├── icon-path.png │ │ ├── icon-pointer-percent.png │ │ ├── icon-pointer-px.png │ │ ├── icon-radio.png │ │ ├── icon-rectangle.png │ │ ├── icon-robot.png │ │ ├── icon-scroller.png │ │ ├── icon-slider.png │ │ ├── icon-speech.png │ │ ├── icon-stacker.png │ │ ├── icon-text.png │ │ ├── icon-textbox.png │ │ ├── icon-valign-bottom.png │ │ ├── icon-valign-middle.png │ │ ├── icon-valign-top.png │ │ ├── placeholder.png │ │ ├── tree │ │ │ ├── collapse_arrow.png │ │ │ ├── collapse_arrow_collapsed.png │ │ │ ├── tree-icon-01-frame.png │ │ │ ├── tree-icon-02-group.png │ │ │ ├── tree-icon-03-ellipse.png │ │ │ ├── tree-icon-04-text.png │ │ │ ├── tree-icon-05-stacker.png │ │ │ ├── tree-icon-06-rectangle.png │ │ │ ├── tree-icon-07-path.png │ │ │ ├── tree-icon-08-component.png │ │ │ ├── tree-icon-09-textbox.png │ │ │ ├── tree-icon-10-checkbox.png │ │ │ ├── tree-icon-11-scroller.png │ │ │ ├── tree-icon-12-button.png │ │ │ ├── tree-icon-13-image.png │ │ │ ├── tree-icon-14-slider.png │ │ │ └── tree-icon-15-dropdown.png │ │ ├── triangle-down.png │ │ ├── triangle-right.png │ │ └── x.png │ ├── images │ │ ├── pax-logo-black-on-white.png │ │ └── pax-logo-white-on-black.png │ └── pax-logo-white-on-black.png └── src │ ├── console │ ├── card.pax │ ├── card.rs │ ├── mod.pax │ └── mod.rs │ ├── context_menu │ ├── mod.pax │ └── mod.rs │ ├── controls │ ├── class_settings_editor.pax │ ├── class_settings_editor.rs │ ├── file_and_component_picker │ │ ├── component_library_item.pax │ │ ├── component_library_item.rs │ │ ├── mod.pax │ │ └── mod.rs │ ├── logobar.pax │ ├── logobar.rs │ ├── mod.pax │ ├── mod.rs │ ├── settings │ │ ├── class_selector.pax │ │ ├── class_selector.rs │ │ ├── color_picker.pax │ │ ├── color_picker.rs │ │ ├── control_flow_for_editor.pax │ │ ├── control_flow_for_editor.rs │ │ ├── control_flow_if_editor.pax │ │ ├── control_flow_if_editor.rs │ │ ├── mod.pax │ │ ├── mod.rs │ │ └── property_editor │ │ │ ├── border_radius_property_editor.pax │ │ │ ├── border_radius_property_editor.rs │ │ │ ├── color_property_editor.pax │ │ │ ├── color_property_editor.rs │ │ │ ├── corner_radii_property_editor.pax │ │ │ ├── corner_radii_property_editor.rs │ │ │ ├── direction_property_editor.pax │ │ │ ├── direction_property_editor.rs │ │ │ ├── fill_property_editor.pax │ │ │ ├── fill_property_editor.rs │ │ │ ├── mod.pax │ │ │ ├── mod.rs │ │ │ ├── stroke_property_editor.pax │ │ │ ├── stroke_property_editor.rs │ │ │ ├── text_property_editor.pax │ │ │ ├── text_property_editor.rs │ │ │ ├── text_style_property_editor.pax │ │ │ ├── text_style_property_editor.rs │ │ │ └── text_style_property_editor │ │ │ └── font_options.rs │ ├── tool_settings_views.rs │ ├── tool_settings_views │ │ ├── paintbrush_settings_view.pax │ │ └── paintbrush_settings_view.rs │ ├── toolbar │ │ ├── mod.pax │ │ ├── mod.rs │ │ ├── toolbar_item.pax │ │ └── toolbar_item.rs │ └── tree │ │ ├── mod.pax │ │ ├── mod.rs │ │ ├── treeobj.pax │ │ └── treeobj.rs │ ├── designer_node_type.rs │ ├── designer_node_type │ ├── designer_behavior_extensions.rs │ └── designer_behavior_extensions │ │ └── designer_slot_component_behavior.rs │ ├── glass │ ├── control_point.pax │ ├── control_point.rs │ ├── intent.pax │ ├── intent.rs │ ├── mod.pax │ ├── mod.rs │ ├── outline.rs │ ├── tool_editors.rs │ ├── wireframe_editor.pax │ ├── wireframe_editor.rs │ └── wireframe_editor │ │ ├── editor_generation.rs │ │ └── editor_generation │ │ ├── anchor_control.rs │ │ ├── resize_control.rs │ │ ├── rotate_control.rs │ │ ├── slot_control.rs │ │ └── stacker_control.rs │ ├── granular_change_store.rs │ ├── lib.pax │ ├── lib.rs │ ├── llm_interface │ ├── mod.pax │ └── mod.rs │ ├── math.rs │ ├── math │ ├── approx.rs │ ├── boolean_path_operations.rs │ ├── boolean_path_operations │ │ ├── bezier_rs_modifications.rs │ │ └── circular_range.rs │ ├── intent_snapper.rs │ └── transform_inversion_tests.rs │ ├── message_log_display.pax │ ├── message_log_display.rs │ ├── model │ ├── action │ │ ├── init.rs │ │ ├── meta.rs │ │ ├── mod.rs │ │ ├── orm.rs │ │ ├── orm │ │ │ ├── copy_paste.rs │ │ │ ├── group_ungroup.rs │ │ │ ├── other.rs │ │ │ ├── space_movement.rs │ │ │ ├── space_movement_primitives.rs │ │ │ └── tree_movement.rs │ │ ├── pointer.rs │ │ ├── tool.rs │ │ └── world.rs │ ├── app_state.rs │ ├── derived_state.rs │ ├── input.rs │ ├── mod.rs │ ├── selection_state.rs │ ├── tools.rs │ └── tools │ │ ├── create_component_tool.rs │ │ ├── moving_tool.rs │ │ ├── multi_select_tool.rs │ │ ├── paintbrush_tool.rs │ │ ├── tool_plugins.rs │ │ ├── tool_plugins │ │ └── drop_intent_handler.rs │ │ └── zoom_to_fit_tool.rs │ ├── project_mode_toggle │ ├── mod.pax │ └── mod.rs │ ├── project_publish_button │ ├── mod.pax │ └── mod.rs │ ├── utils.rs │ └── utils │ ├── designer_cursor.rs │ └── filter_with_last.rs ├── pax-designtime ├── .gitignore ├── Cargo.toml ├── initial_manifest.json └── src │ ├── lib.rs │ ├── messages.rs │ ├── orm │ ├── manifest_modification_data.rs │ ├── mod.rs │ ├── template │ │ ├── class_builder.rs │ │ ├── class_builder_commands.rs │ │ ├── mod.rs │ │ ├── node_builder.rs │ │ └── node_builder_commands.rs │ └── tests.rs │ ├── privileged_agent.rs │ ├── serde_pax │ ├── error.rs │ ├── mod.rs │ └── se │ │ ├── mod.rs │ │ └── tests.rs │ └── undo.rs ├── pax-engine ├── Cargo.toml ├── README.md └── src │ └── lib.rs ├── pax-generation ├── .env.example ├── .gitignore ├── Cargo.toml ├── generated_project │ ├── Cargo.toml │ ├── bin │ │ └── run.rs │ └── pax ├── prompt-app.html ├── src │ ├── lib.rs │ └── main.rs ├── system_prompt.txt ├── system_prompt_v2.txt ├── system_prompt_v3.txt └── working-generated-projects │ ├── bouncing-growing-rects │ ├── Cargo.toml │ ├── bin │ │ └── run.rs │ ├── pax │ └── src │ │ ├── lib.pax │ │ └── lib.rs │ ├── calculator │ ├── Cargo.toml │ ├── bin │ │ └── run.rs │ ├── pax │ └── src │ │ ├── lib.pax │ │ └── lib.rs │ ├── katamari │ ├── Cargo.toml │ ├── bin │ │ └── run.rs │ ├── pax │ └── src │ │ ├── lib.pax │ │ └── lib.rs │ ├── scientific_calculator │ ├── Cargo.toml │ ├── bin │ │ └── run.rs │ ├── pax │ └── src │ │ ├── lib.pax │ │ └── lib.rs │ └── unbeatable-pong │ ├── Cargo.toml │ ├── bin │ └── run.rs │ ├── pax │ └── src │ ├── lib.pax │ └── lib.rs ├── pax-kit ├── Cargo.toml └── src │ └── lib.rs ├── pax-lang ├── Cargo.toml └── src │ ├── deserializer │ ├── error.rs │ ├── helpers.rs │ ├── mod.rs │ └── tests.rs │ ├── formatting │ ├── mod.rs │ └── rules.rs │ ├── helpers.rs │ ├── interpreter │ ├── computable.rs │ ├── mod.rs │ ├── property_resolution.rs │ └── tests.rs │ ├── lib.rs │ ├── parsing.rs │ └── pax.pest ├── pax-language-server ├── Cargo.toml └── src │ ├── completion.rs │ ├── index.rs │ ├── lib.rs │ └── positional.rs ├── pax-macro ├── Cargo.toml ├── src │ ├── lib.rs │ ├── parsing.rs │ └── templating.rs └── templates │ └── derive_pax.stpl ├── pax-manifest ├── Cargo.toml ├── src │ ├── cartridge_generation │ │ └── mod.rs │ ├── code_serialization │ │ └── mod.rs │ ├── constants.rs │ ├── lib.rs │ ├── parsing.rs │ ├── server.rs │ └── utils.rs ├── templates │ └── code_serialization │ │ ├── macros.tera │ │ ├── manifest-code-serialization.tera │ │ └── rust-file-serialization.tera └── tests │ └── tests.rs ├── pax-message ├── Cargo.toml └── src │ ├── lib.rs │ ├── refcell_debug.rs │ └── reflection.rs ├── pax-pixels ├── .gitignore ├── Cargo.toml └── src │ ├── lib.rs │ ├── render_backend │ ├── data.rs │ ├── geometry.wgsl │ ├── gpu_resources.rs │ ├── mod.rs │ ├── stencil.rs │ ├── stencil.wgsl │ ├── texture.rs │ ├── textures.wgsl │ └── web_backend.rs │ └── render_context.rs ├── pax-runtime-api ├── Cargo.toml └── src │ ├── constants.rs │ ├── cursor.rs │ ├── lib.rs │ ├── math.rs │ ├── math │ ├── point.rs │ ├── transform.rs │ └── vector.rs │ ├── pax_value │ ├── arithmetic.rs │ ├── coercion_impls.rs │ ├── functions.rs │ ├── macros.rs │ ├── mod.rs │ ├── numeric.rs │ └── to_from_impls.rs │ └── properties │ ├── graph_operations.rs │ ├── mod.rs │ ├── properties_table.rs │ ├── tests.rs │ └── untyped_property.rs ├── pax-runtime ├── Cargo.toml ├── src │ ├── api.rs │ ├── cartridge.rs │ ├── component.rs │ ├── conditional.rs │ ├── constants.rs │ ├── engine │ │ ├── expanded_node.rs │ │ ├── mod.rs │ │ ├── node_interface.rs │ │ ├── occlusion.rs │ │ ├── pax_pixels_render_context.rs │ │ └── piet_render_context.rs │ ├── form_event.rs │ ├── layout.rs │ ├── lib.rs │ ├── math.rs │ ├── properties.rs │ ├── rendering.rs │ ├── repeat.rs │ └── slot.rs └── tests │ ├── any_properties_tests.rs │ └── declarative_macro_tests.rs ├── pax-std ├── Cargo.toml └── src │ ├── common.rs │ ├── core │ ├── blank.rs │ ├── combo_box.rs │ ├── event_blocker.rs │ ├── frame.rs │ ├── group.rs │ ├── inline_frame.rs │ ├── link.rs │ ├── mod.rs │ ├── native_image.rs │ ├── scrollbar.rs │ ├── scroller.rs │ ├── text.rs │ ├── tooltip.rs │ └── youtube_video.rs │ ├── drawing │ ├── ellipse.rs │ ├── image.rs │ ├── mod.rs │ ├── path.rs │ └── rectangle.rs │ ├── forms │ ├── button.rs │ ├── checkbox.rs │ ├── dialogs.rs │ ├── dropdown.rs │ ├── mod.rs │ ├── radio_set.rs │ ├── slider.rs │ ├── tabs.rs │ ├── textbox.rs │ └── toast.rs │ ├── layout │ ├── carousel.pax │ ├── carousel.rs │ ├── mod.rs │ ├── resizable.rs │ ├── stacker.rs │ └── table.rs │ └── lib.rs ├── runtime-arch.png ├── scripts ├── create-and-run-template.sh ├── ga-snippet.partial.html ├── local_github_actions.sh ├── paxgen │ ├── README.md │ ├── paxgen │ │ ├── __init__.py │ │ └── generate.py │ ├── poetry.lock │ ├── pyproject.toml │ └── static-prompts │ │ └── prompt-v1.0.0.txt ├── print-dag.py └── release.py └── tests ├── create-test.sh └── src ├── contextual-components ├── Cargo.toml ├── bin │ └── run.rs ├── pax └── src │ ├── contextual.rs │ ├── lib.pax │ └── lib.rs ├── custom-events ├── Cargo.toml ├── bin │ └── run.rs ├── pax └── src │ ├── inner_comp.pax │ ├── inner_comp.rs │ ├── lib.pax │ └── lib.rs ├── path-test ├── Cargo.toml ├── bin │ └── run.rs ├── pax └── src │ ├── lib.pax │ └── lib.rs └── playground ├── Cargo.toml ├── bin └── run.rs ├── pax └── src ├── lib.pax └── lib.rs /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | pax-compiler/files/interfaces/web/public/pax-interface-web.js 3 | pax-compiler/files/interfaces/web/package-lock.json 4 | target/ 5 | vendor/ 6 | 7 | .swiftpm 8 | .build 9 | pax_macro_writeln.txt 10 | 11 | xcuserdata 12 | 13 | examples/src/*/.pax/ 14 | tests/src/*/.pax/ 15 | 16 | pax-compiler/files/interfaces/web/public/pax-interface-web.css 17 | pax-compiler/files/interfaces/web/public/pax-interface-web.js 18 | pax-compiler/files/interfaces/designer/manifest.json 19 | 20 | **/*.rs.bk 21 | Cargo.lock 22 | .DS_Store 23 | */.DS_Store 24 | .cargo 25 | 26 | ## VScode project configuration files 27 | .vscode/ 28 | 29 | pax-chassis-web/interface/ 30 | pax-chassis-web/interface/ 31 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "docs"] 2 | path = docs 3 | url = git@github.com:paxproject/docs.git 4 | -------------------------------------------------------------------------------- /.helix/config.toml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.helix/languages.toml: -------------------------------------------------------------------------------- 1 | [[language]] 2 | name = "rust" 3 | [language-server.rust-analyzer.config.cargo] 4 | features = [ "designtime"] 5 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | # GitHub Copilot persisted chat sessions 10 | /copilot/chatSessions 11 | -------------------------------------------------------------------------------- /.idea/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /.idea/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/deployment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 2.7.18 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # CONTRIBUTING 2 | 3 | We warmly welcome contributions! Pax is free and open source software, licensed MIT / Apache 2.0. 4 | 5 | ### Running the monorepo 6 | Follow the *workstation* (e.g. macOS, Linux) and *target* (e.g. WebAssembly, macOS app) setup instructions here: https://docs.pax.dev/start-creating-a-project.html 7 | 8 | The examples are an appropriate testbed for developing the monorepo. Any pending changes to e.g. `pax-runtime` will be reflected 9 | when running examples. You can run any of the examples with the root monorepo command `cargo run --example fireworks`, or from inside one of the example directories you can use the bash script CLI surrogate: `cd examples/src/fireworks && ./pax run --target=web` 10 | 11 | ### Communicating with our team 12 | We strongly recommend re aching out to our team on [Discord](https://discord.gg/Eq8KWAUc6b) before embarking on any substantial contributions, in 13 | case your work overlaps or conflicts with our roadmap. 14 | 15 | -------------------------------------------------------------------------------- /compiler-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/compiler-sequence.png -------------------------------------------------------------------------------- /examples/calculator.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/color-picker.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/create-example.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | read -p "Enter a name for the example: " NAME 4 | 5 | # 2) Create proxy script to run example 6 | cat < "${NAME}.rs" 7 | mod scripts; 8 | use scripts::run_example; 9 | 10 | fn main() { 11 | if let Err(error) = run_example() { 12 | eprintln!("Error: {}", error); 13 | } 14 | } 15 | EOL 16 | 17 | current_dir=$(pwd) 18 | 19 | pushd ../pax-cli > /dev/null 20 | 21 | cargo build > /dev/null 22 | 23 | ../target/debug/pax-cli create "$current_dir/src/$NAME" --libdev > /dev/null 24 | 25 | popd > /dev/null 26 | 27 | echo "$NAME example created successfully in src/$NAME!" 28 | -------------------------------------------------------------------------------- /examples/fireworks.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/game-of-life.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/increment.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/llm-interface.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/marketing-site.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/mouse-animation.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/particles.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/perf-testbed.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/slot-particles.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/space-game.rs: -------------------------------------------------------------------------------- 1 | mod scripts; 2 | use scripts::run_example; 3 | 4 | fn main() { 5 | if let Err(error) = run_example() { 6 | eprintln!("Error: {}", error); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/src/breakout/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } 23 | -------------------------------------------------------------------------------- /examples/src/breakout/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev --verbose 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/calculator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "calculator" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 9 | 10 | [lib] 11 | crate-type = ["cdylib", "rlib"] 12 | name = "paxcartridge" 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | designer = ["pax-kit/designer"] 25 | parser = ["pax-kit/parser"] 26 | web = ["pax-kit/web"] 27 | macos = ["pax-kit/macos"] 28 | ios = ["pax-kit/ios"] 29 | 30 | [profile.parser] 31 | inherits = "dev" 32 | opt-level = 0 33 | 34 | [profile.parser.package."*"] 35 | inherits = "dev" 36 | opt-level = 0 37 | 38 | [profile.dev] 39 | opt-level = 0 40 | debug = false 41 | 42 | [profile.dev.package."*"] 43 | opt-level = 2 44 | debug = false 45 | -------------------------------------------------------------------------------- /examples/src/calculator/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/calculator/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/color-picker/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "color-picker" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 9 | 10 | [lib] 11 | crate-type = ["cdylib", "rlib"] 12 | name = "paxcartridge" 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | designer = ["pax-kit/designer"] 25 | parser = ["pax-kit/parser"] 26 | web = ["pax-kit/web"] 27 | macos = ["pax-kit/macos"] 28 | ios = ["pax-kit/ios"] 29 | 30 | [profile.parser] 31 | inherits = "dev" 32 | opt-level = 0 33 | 34 | [profile.parser.package."*"] 35 | inherits = "dev" 36 | opt-level = 0 37 | 38 | [profile.dev] 39 | opt-level = 0 40 | debug = false 41 | 42 | [profile.dev.package."*"] 43 | opt-level = 2 44 | debug = false 45 | -------------------------------------------------------------------------------- /examples/src/color-picker/assets/color_picker/transparency_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/color-picker/assets/color_picker/transparency_grid.png -------------------------------------------------------------------------------- /examples/src/color-picker/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/color-picker/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/fireworks/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fireworks" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 9 | 10 | [lib] 11 | crate-type = ["cdylib", "rlib"] 12 | name = "paxcartridge" 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | designer = ["pax-kit/designer"] 25 | parser = ["pax-kit/parser"] 26 | web = ["pax-kit/web"] 27 | macos = ["pax-kit/macos"] 28 | ios = ["pax-kit/ios"] 29 | 30 | [profile.parser] 31 | inherits = "dev" 32 | opt-level = 0 33 | 34 | [profile.parser.package."*"] 35 | inherits = "dev" 36 | opt-level = 0 37 | 38 | [profile.dev] 39 | opt-level = 0 40 | debug = false 41 | 42 | [profile.dev.package."*"] 43 | opt-level = 2 44 | debug = false -------------------------------------------------------------------------------- /examples/src/fireworks/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::process::Command; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } 23 | -------------------------------------------------------------------------------- /examples/src/fireworks/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PUB_PAX_SERVER=http://localhost:9090 PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev --verbose 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/fireworks/src/lib.rs: -------------------------------------------------------------------------------- 1 | use pax_kit::*; 2 | 3 | #[pax] 4 | #[main] 5 | #[file("fireworks.pax")] 6 | pub struct Fireworks { 7 | pub rotation: Property, 8 | pub ticks: Property, 9 | } 10 | 11 | const ROTATION_COEFFICIENT: f64 = 0.00010; 12 | 13 | impl Fireworks { 14 | pub fn handle_wheel(&mut self, _ctx: &NodeContext, args: Event) { 15 | let old_t = self.rotation.get(); 16 | let new_t = old_t - args.delta_y * ROTATION_COEFFICIENT; 17 | self.rotation.set(f64::max(0.0, new_t)); 18 | } 19 | 20 | pub fn handle_tick(&mut self, _ctx: &NodeContext) { 21 | let old_ticks = self.ticks.get(); 22 | self.ticks.set(old_ticks + 1); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/src/game-of-life/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "game-of-life" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 9 | 10 | [lib] 11 | crate-type = ["cdylib", "rlib"] 12 | name = "paxcartridge" 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | designer = ["pax-kit/designer"] 25 | parser = ["pax-kit/parser"] 26 | web = ["pax-kit/web"] 27 | macos = ["pax-kit/macos"] 28 | ios = ["pax-kit/ios"] 29 | 30 | [profile.parser] 31 | inherits = "dev" 32 | opt-level = 0 33 | 34 | [profile.parser.package."*"] 35 | inherits = "dev" 36 | opt-level = 0 37 | 38 | [profile.dev] 39 | opt-level = 0 40 | debug = false 41 | 42 | [profile.dev.package."*"] 43 | opt-level = 2 44 | debug = false -------------------------------------------------------------------------------- /examples/src/game-of-life/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/game-of-life/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/game-of-life/src/templates/cell.pax: -------------------------------------------------------------------------------- 1 | 2 | if self.on { 3 | 4 | } 5 | if !self.on { 6 | 7 | } 8 | 9 | 10 | @settings { 11 | @mount: mount, 12 | } -------------------------------------------------------------------------------- /examples/src/game-of-life/src/templates/color_control.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @settings { 7 | @mount: mount, 8 | .text { 9 | style: { 10 | font: Font::Web("Times New Roman", "", FontStyle::Normal, FontWeight::Bold), 11 | font_size: 28px, 12 | fill: BLACK, 13 | align_vertical: TextAlignVertical::Center, 14 | align_horizontal: TextAlignHorizontal::Center, 15 | align_multiline: TextAlignHorizontal::Center 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/src/game-of-life/src/templates/speed_control.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @settings { 7 | .text { 8 | style: { 9 | font: Font::Web("Times New Roman", "", FontStyle::Normal, FontWeight::Bold), 10 | font_size: 28px, 11 | fill: BLACK, 12 | align_vertical: TextAlignVertical::Center, 13 | align_horizontal: TextAlignHorizontal::Center, 14 | align_multiline: TextAlignHorizontal::Center 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/src/increment/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "increment" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 9 | 10 | [lib] 11 | crate-type = ["cdylib", "rlib"] 12 | name = "paxcartridge" 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | designer = ["pax-kit/designer"] 25 | parser = ["pax-kit/parser"] 26 | web = ["pax-kit/web"] 27 | macos = ["pax-kit/macos"] 28 | ios = ["pax-kit/ios"] 29 | 30 | [profile.parser] 31 | inherits = "dev" 32 | opt-level = 0 33 | 34 | [profile.parser.package."*"] 35 | inherits = "dev" 36 | opt-level = 0 37 | 38 | [profile.dev] 39 | opt-level = 0 40 | debug = false 41 | 42 | [profile.dev.package."*"] 43 | opt-level = 2 44 | debug = false -------------------------------------------------------------------------------- /examples/src/increment/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/increment/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/increment/src/lib.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @settings { 7 | @pre_render: handle_pre_render 8 | #text { 9 | style: { 10 | font: Font::Web("Roboto", "", FontStyle::Normal, FontWeight::Light) 11 | font_size: 26px 12 | fill: WHITE 13 | align_vertical: TextAlignVertical::Center 14 | align_horizontal: TextAlignHorizontal::Center 15 | align_multiline: TextAlignHorizontal::Center 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /examples/src/increment/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_kit::*; 4 | 5 | #[pax] 6 | #[main] 7 | #[file("lib.pax")] 8 | pub struct Example { 9 | pub ticks: Property, 10 | pub num_clicks: Property, 11 | pub current_rotation: Property, 12 | } 13 | 14 | const ROTATION_INCREMENT_DEGREES: f64 = 90.0; 15 | const ROTATION_EASING_DURATION_FRAMES: u64 = 120; 16 | 17 | impl Example { 18 | pub fn handle_pre_render(&mut self, _ctx: &NodeContext) { 19 | let old_ticks = self.ticks.get(); 20 | self.ticks.set((old_ticks + 1) % 255); 21 | } 22 | 23 | pub fn increment(&mut self, _ctx: &NodeContext, _args: Event) { 24 | let old_num_clicks = self.num_clicks.get(); 25 | let new_val = old_num_clicks + 1; 26 | self.num_clicks.set(new_val); 27 | self.current_rotation.ease_to(new_val as f64 * ROTATION_INCREMENT_DEGREES, ROTATION_EASING_DURATION_FRAMES, EasingCurve::OutQuad); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/src/llm-interface/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/llm-interface/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/llm-interface/src/card.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_kit::*; 4 | 5 | #[pax] 6 | #[file("card.pax")] 7 | pub struct BasicCard { 8 | pub is_ai: Property, 9 | pub text: Property, 10 | } -------------------------------------------------------------------------------- /examples/src/marketing-site/assets/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/marketing-site/assets/placeholder.jpg -------------------------------------------------------------------------------- /examples/src/marketing-site/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/marketing-site/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/marketing-site/src/fireworks.rs: -------------------------------------------------------------------------------- 1 | use pax_kit::*; 2 | 3 | #[pax] 4 | #[file("fireworks.pax")] 5 | pub struct Fireworks { 6 | pub rotation: Property, 7 | pub ticks: Property, 8 | } 9 | 10 | const ROTATION_COEFFICIENT: f64 = 0.00010; 11 | 12 | impl Fireworks { 13 | pub fn handle_wheel(&mut self, _ctx: &NodeContext, args: Event) { 14 | let old_t = self.rotation.get(); 15 | let new_t = old_t - args.delta_y * ROTATION_COEFFICIENT; 16 | self.rotation.set(f64::max(0.0, new_t)); 17 | } 18 | 19 | pub fn handle_tick(&mut self, _ctx: &NodeContext) { 20 | let old_ticks = self.ticks.get(); 21 | self.ticks.set(old_ticks + 1); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/src/marketing-site/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_kit::*; 4 | 5 | pub mod calculator; 6 | pub use calculator::*; 7 | 8 | pub mod fireworks; 9 | pub use fireworks::*; 10 | 11 | pub mod space_game; 12 | pub use space_game::*; 13 | 14 | pub mod color_picker; 15 | pub use color_picker::*; 16 | 17 | mod animation; 18 | 19 | 20 | #[pax] 21 | #[main] 22 | #[file("lib.pax")] 23 | pub struct Example { 24 | pub ticks: Property, 25 | pub num_clicks: Property, 26 | } 27 | 28 | impl Example { 29 | pub fn handle_pre_render(&mut self, _ctx: &NodeContext) { 30 | } 31 | 32 | pub fn increment(&mut self, _ctx: &NodeContext, _args: Event) { 33 | let old_num_clicks = self.num_clicks.get(); 34 | self.num_clicks.set(old_num_clicks + 1); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/src/mouse-animation/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mouse-animation" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 9 | 10 | [lib] 11 | crate-type = ["cdylib", "rlib"] 12 | name = "paxcartridge" 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | designer = ["pax-kit/designer"] 25 | parser = ["pax-kit/parser"] 26 | web = ["pax-kit/web"] 27 | macos = ["pax-kit/macos"] 28 | ios = ["pax-kit/ios"] 29 | 30 | [profile.parser] 31 | inherits = "dev" 32 | opt-level = 0 33 | 34 | [profile.parser.package."*"] 35 | inherits = "dev" 36 | opt-level = 0 37 | 38 | [profile.dev] 39 | opt-level = 0 40 | debug = false 41 | 42 | [profile.dev.package."*"] 43 | opt-level = 2 44 | debug = false -------------------------------------------------------------------------------- /examples/src/mouse-animation/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/mouse-animation/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/mouse-animation/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | pub mod path_animation; 4 | use path_animation::PathAnimation; 5 | 6 | use pax_kit::*; 7 | 8 | use pax_kit::pax_engine::math::Generic; 9 | use pax_kit::pax_engine::math::Point2; 10 | 11 | #[pax] 12 | #[main] 13 | #[file("lib.pax")] 14 | pub struct Example { 15 | pub scroll: Property, 16 | } 17 | 18 | impl Example { 19 | pub fn on_mount(&mut self, ctx: &NodeContext) {} 20 | pub fn on_mouse_move(&mut self, ctx: &NodeContext, event: Event) { 21 | let (_, h) = ctx.bounds_self.get(); 22 | let part = event.mouse.y / h; 23 | self.scroll.set(part); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/src/mouse-animation/src/path_animation.pax: -------------------------------------------------------------------------------- 1 | 5 | 6 | @settings { 7 | @mount: on_mount 8 | } 9 | -------------------------------------------------------------------------------- /examples/src/particles/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "particles" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | rand = { version = "0.8.5" } 9 | getrandom = { version = "0.2.15", features = ["js"] } 10 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 11 | 12 | [lib] 13 | crate-type = ["cdylib", "rlib"] 14 | name = "paxcartridge" 15 | 16 | [[bin]] 17 | name = "parser" 18 | path = "src/lib.rs" 19 | required-features = ["parser"] 20 | 21 | [[bin]] 22 | name = "run" 23 | path = "bin/run.rs" 24 | 25 | [features] 26 | designer = ["pax-kit/designer"] 27 | parser = ["pax-kit/parser"] 28 | web = ["pax-kit/web"] 29 | macos = ["pax-kit/macos"] 30 | ios = ["pax-kit/ios"] 31 | 32 | [profile.parser] 33 | inherits = "dev" 34 | opt-level = 0 35 | 36 | [profile.parser.package."*"] 37 | inherits = "dev" 38 | opt-level = 0 39 | 40 | [profile.dev] 41 | opt-level = 0 42 | debug = false 43 | 44 | [profile.dev.package."*"] 45 | opt-level = 2 46 | debug = false -------------------------------------------------------------------------------- /examples/src/particles/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/particles/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/particles/src/ball.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | @settings { 4 | @mount: handle_mount, 5 | @tick: handle_tick, 6 | 7 | .ball { 8 | anchor_x:50% 9 | anchor_y:50% 10 | fill: { hsla(hue, 85%, 50%, 55%) } 11 | stroke: WHITE, 12 | width: { (diameter)px } 13 | height: { (diameter)px } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/src/particles/src/lib.pax: -------------------------------------------------------------------------------- 1 | 2 | for (p,i) in self.particles { 3 | 4 | } 5 | 6 | 7 | @settings { 8 | @mount: handle_mount 9 | @tick: handle_tick 10 | } 11 | -------------------------------------------------------------------------------- /examples/src/perf-testbed/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "perf-testbed" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path = "../../../pax-kit" } 9 | rand = { version = "0.8.5" } 10 | getrandom = { version = "0.2.15", features = ["js"] } 11 | 12 | [lib] 13 | crate-type = ["cdylib", "rlib"] 14 | name = "paxcartridge" 15 | 16 | [[bin]] 17 | name = "parser" 18 | path = "src/lib.rs" 19 | required-features = ["parser"] 20 | 21 | [[bin]] 22 | name = "run" 23 | path = "bin/run.rs" 24 | 25 | [features] 26 | parser = ["pax-kit/parser"] 27 | web = ["pax-kit/web"] 28 | macos = ["pax-kit/macos"] 29 | ios = ["pax-kit/ios"] 30 | 31 | [profile.parser] 32 | inherits = "dev" 33 | opt-level = 0 34 | 35 | [profile.parser.package."*"] 36 | inherits = "dev" 37 | opt-level = 0 38 | 39 | [profile.dev] 40 | opt-level = 3 41 | debug = false 42 | 43 | [profile.dev.package."*"] 44 | opt-level = 3 45 | debug = false 46 | -------------------------------------------------------------------------------- /examples/src/perf-testbed/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/perf-testbed/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev --no-designer 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/perf-testbed/src/lib.pax: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/src/perf-testbed/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_kit::*; 4 | 5 | pub mod virtual_elements; 6 | pub use virtual_elements::*; 7 | 8 | 9 | #[pax] 10 | #[main] 11 | #[file("lib.pax")] 12 | pub struct Example { 13 | } 14 | 15 | impl Example { 16 | } 17 | -------------------------------------------------------------------------------- /examples/src/perf-testbed/src/virtual_elements/mod.pax: -------------------------------------------------------------------------------- 1 | for i in 0..2000 { 2 | 3 | } -------------------------------------------------------------------------------- /examples/src/perf-testbed/src/virtual_elements/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_kit::*; 4 | 5 | #[pax] 6 | #[file("virtual_elements/mod.pax")] 7 | pub struct VirtualElementTest { 8 | } -------------------------------------------------------------------------------- /examples/src/slot-particles/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/slot-particles/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/slot-particles/src/lib.pax: -------------------------------------------------------------------------------- 1 | 7 | for i in 0..10 { 8 | 9 | 10 | 11 | 12 | 13 | 14 | } 15 | 16 | @settings { 17 | .centered { 18 | x: 50% 19 | y: 50% 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/src/slot-particles/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | pub mod slot_particles; 3 | use crate::slot_particles::SlotParticles; 4 | use pax_kit::*; 5 | use fireworks::*; 6 | 7 | #[pax] 8 | #[main] 9 | #[file("lib.pax")] 10 | pub struct Example {} 11 | 12 | impl Example {} 13 | -------------------------------------------------------------------------------- /examples/src/slot-particles/src/slot_particles.pax: -------------------------------------------------------------------------------- 1 | for (data, i) in self.particles { 2 | 11 | slot(i) 12 | 13 | } 14 | 15 | @settings { 16 | @mount: on_mount 17 | } 18 | -------------------------------------------------------------------------------- /examples/src/slot-particles/src/slot_particles/mod.pax: -------------------------------------------------------------------------------- 1 | for (data, i) in self.particles { 2 | 11 | slot(i) 12 | 13 | } 14 | 15 | @settings { 16 | @mount: on_mount 17 | } 18 | -------------------------------------------------------------------------------- /examples/src/space-game/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "space-game" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | rand = { version = "0.8.5" } 9 | getrandom = { version = "0.2.15", features = ["js"] } 10 | pax-kit = { version = "0.38.3", path="../../../pax-kit" } 11 | 12 | [lib] 13 | crate-type = ["cdylib", "rlib"] 14 | name = "paxcartridge" 15 | 16 | [[bin]] 17 | name = "parser" 18 | path = "src/lib.rs" 19 | required-features = ["parser"] 20 | 21 | [[bin]] 22 | name = "run" 23 | path = "bin/run.rs" 24 | 25 | [features] 26 | designer = ["pax-kit/designer"] 27 | parser = ["pax-kit/parser"] 28 | web = ["pax-kit/web"] 29 | macos = ["pax-kit/macos"] 30 | ios = ["pax-kit/ios"] 31 | 32 | [profile.parser] 33 | inherits = "dev" 34 | opt-level = 0 35 | 36 | [profile.parser.package."*"] 37 | inherits = "dev" 38 | opt-level = 0 39 | 40 | [profile.dev] 41 | opt-level = 0 42 | debug = false 43 | 44 | [profile.dev.package."*"] 45 | opt-level = 2 46 | debug = false -------------------------------------------------------------------------------- /examples/src/space-game/assets/asteroid0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/space-game/assets/asteroid0.png -------------------------------------------------------------------------------- /examples/src/space-game/assets/asteroid1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/space-game/assets/asteroid1.png -------------------------------------------------------------------------------- /examples/src/space-game/assets/asteroid2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/space-game/assets/asteroid2.png -------------------------------------------------------------------------------- /examples/src/space-game/assets/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/space-game/assets/bullet.png -------------------------------------------------------------------------------- /examples/src/space-game/assets/spaceship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/space-game/assets/spaceship.png -------------------------------------------------------------------------------- /examples/src/space-game/assets/starfield0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/space-game/assets/starfield0.png -------------------------------------------------------------------------------- /examples/src/space-game/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /examples/src/space-game/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/starter-project/assets/Frame 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/starter-project/assets/Frame 1.png -------------------------------------------------------------------------------- /examples/src/starter-project/assets/Frame 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/starter-project/assets/Frame 2.png -------------------------------------------------------------------------------- /examples/src/starter-project/assets/Frame 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/starter-project/assets/Frame 3.png -------------------------------------------------------------------------------- /examples/src/starter-project/assets/pax-logo-white-on-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/examples/src/starter-project/assets/pax-logo-white-on-black.png -------------------------------------------------------------------------------- /examples/src/starter-project/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::process::Command; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } 23 | -------------------------------------------------------------------------------- /examples/src/starter-project/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /examples/src/starter-project/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use breakout::*; 4 | use color_picker::*; 5 | use fireworks::*; 6 | use pax_kit::*; 7 | use space_game::*; 8 | 9 | pub mod calculator; 10 | pub use calculator::Calculator; 11 | 12 | #[pax] 13 | #[main] 14 | #[file("lib.pax")] 15 | pub struct Example { 16 | pub ticks: Property, 17 | pub num_clicks: Property, 18 | } 19 | 20 | impl Example { 21 | pub fn handle_pre_render(&mut self, _ctx: &NodeContext) { 22 | let old_ticks = self.ticks.get(); 23 | self.ticks.set((old_ticks + 1) % 255); 24 | } 25 | 26 | pub fn increment(&mut self, ctx: &NodeContext, _args: Event) { 27 | pax_designer::model::perform_action( 28 | &pax_designer::ProjectMsg(pax_designer::model::app_state::ProjectMode::Edit), 29 | ctx, 30 | ); 31 | let old_num_clicks = self.num_clicks.get(); 32 | self.num_clicks.set(old_num_clicks + 1); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pax-chassis-common/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod core_graphics_c_bridge; 2 | pub use env_logger; 3 | -------------------------------------------------------------------------------- /pax-chassis-ios/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-chassis-ios" 3 | edition = "2021" 4 | version = "0.38.3" 5 | authors = ["Zack Brown "] 6 | license = "MIT OR Apache-2.0" 7 | homepage = "https://pax.dev/" 8 | repository = "https://www.github.com/paxproject/pax" 9 | description = "Platform-specific chassis allowing Pax cartridges to be executed as native iOS apps" 10 | 11 | [lib] 12 | name = "paxchassisios" 13 | crate-type = ["cdylib", "rlib"] 14 | 15 | [dependencies] 16 | pax-chassis-common = {version = "0.38.3", path="../pax-chassis-common"} 17 | 18 | [features] 19 | designtime = [] -------------------------------------------------------------------------------- /pax-chassis-ios/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub use pax_chassis_common::core_graphics_c_bridge::*; 2 | -------------------------------------------------------------------------------- /pax-chassis-macos/README.md: -------------------------------------------------------------------------------- 1 | # pax-chassis-macos 2 | 3 | Handles: 4 | - 2D rendering on macOS via CoreGraphics 5 | - passing tick events (a la rAF; see NSViewRepresentable) 6 | - Managing native user input (e.g. mouse, keyboard, camera, microphone, also form control events like 'click' on a button) 7 | - Rendering native text based off of commands from engine 8 | - Rendering native form controls based off of commands from engine 9 | 10 | This directory also includes: 11 | 12 | ## interface 13 | 14 | Simple macOS app for developing Pax projects. 15 | Also usable as a template for packaging full-window Pax apps for macOS 16 | 17 | Handles: 18 | - Mounting pax-chassis-macos + cartridge to a simple Mac app, delegating full window rendering to Pax. 19 | - Debug mode + LLDB support for debugging Pax projects on macOS 20 | - Production mode, suitable for packaging full-window Pax apps for end-users 21 | -------------------------------------------------------------------------------- /pax-chassis-macos/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub use pax_chassis_common::core_graphics_c_bridge::*; 2 | -------------------------------------------------------------------------------- /pax-chassis-web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "esbuild": "0.19.8" 4 | }, 5 | "dependencies": { 6 | "snarkdown": "^2.0.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /pax-cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-cli" 3 | version = "0.38.3" 4 | authors = ["Zack Brown "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | homepage = "https://pax.dev/" 8 | repository = "https://www.github.com/paxproject/pax" 9 | description = "Command line interface tool for developing, packaging, and managing Pax projects" 10 | 11 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 12 | 13 | [features] 14 | 15 | [dependencies] 16 | clap = "2.33.3" 17 | color-eyre = "0.6.2" 18 | colored = "2.0.0" 19 | ctrlc = { version = "3.4.4", features = ["termination"] } 20 | nix = "0.20.2" 21 | pax-compiler = {path = "../pax-compiler", version = "0.38.3"} 22 | pax-lang = {path = "../pax-lang", version = "0.38.3"} 23 | pax-language-server = {path = "../pax-language-server", version = "0.38.3"} 24 | reqwest = "0.11.18" 25 | rustc_version = "0.4.0" 26 | tokio = { version = "1", features = ["full"] } -------------------------------------------------------------------------------- /pax-compiler/.gitignore: -------------------------------------------------------------------------------- 1 | files/interfaces/macos/pax-app-macos/pax-app-macos.xcodeproj/xcuserdata 2 | files/interfaces/web/node_modules 3 | files/interfaces/web/pax-interface-web.js 4 | files/interfaces/web/pax-interface-web.css 5 | src/.DS_Store 6 | files/interfaces/web/package-lock.json 7 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // pax-app-ios 4 | // 5 | // Created by Zack Brown on 10/5/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | var body: some View { 12 | VStack { 13 | Image(systemName: "globe") 14 | .imageScale(.large) 15 | .foregroundStyle(.tint) 16 | Text("Hello, world!") 17 | } 18 | .padding() 19 | } 20 | } 21 | 22 | #Preview { 23 | ContentView() 24 | } 25 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios/Main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Main.swift 3 | // pax-app-macos 4 | // 5 | // Created by Zack Brown on 10/3/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct pax_app_iosApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | PaxViewIos().edgesIgnoringSafeArea(.all) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/ios/pax-app-ios/pax-app-ios/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/README.md: -------------------------------------------------------------------------------- 1 | # pax-chassis-macos/interface 2 | 3 | Much of the interface for macOS is described in `pax-chassis-common`, and is common across iOS and macOS. 4 | 5 | Thus, the interface for pax-chassis-macos includes only the relative complement of (`macOS \ iOS`), namely: a macOS full-app wrapper for a Pax component. 6 | 7 | This is useful for local development on a Mac or for publishing full-app Pax-mac projects. 8 | 9 | If you wish to use a Pax project as a SwiftUI view inside e.g. an existing Swift project, 10 | look to the SPM package created inside `pax-chassis-common/pax-swift-cartridge`. That same SPM package 11 | is consumed by pax-app-macos. -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-1024.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-128.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-16.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-256 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-256 1.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-256.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-32 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-32 1.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-32.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-512 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-512 1.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-512.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/AppIcon.appiconset/pax-logo-64.png -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Main.swift 3 | // pax-app-macos 4 | // 5 | // Created by Zack Brown on 10/3/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct pax_app_macosApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | PaxViewMacos() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/macos/pax-app-macos/pax-app-macos/pax_app_macos.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/README.md: -------------------------------------------------------------------------------- 1 | # pax-chassis-web/interface 2 | 3 | This project acts as the interface between the Pax engine, via the chassis, and a native platform, in this case 4 | the Web browser. 5 | 6 | Written in TypeScript, this project handles receiving and unpacking messages from the engine via the chassis, as well 7 | as exposing APIs for initializing the chassis+engine, for attaching requestAnimationFrame to drive the engine's tick, 8 | and exposing an index.html that works as a host for the static site built with Pax, as well as an index.js and 9 | other wrappers (e.g. React, Angular, Vue, WebComponents) for other consumption patterns. 10 | 11 | Output artifacts are built into `.pax/build` for a given project. -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/build-interface.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | npm install -g esbuild 4 | npm install --only=production 5 | esbuild --bundle src/index.ts --global-name=Pax --outfile=public/pax-interface-web.js -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "(MIT OR Apache-2.0)", 3 | "scripts": { 4 | "build": "webpack --config ./webpack.prod.js", 5 | "serve": "webpack-dev-server --config ./webpack.config.js" 6 | }, 7 | "devDependencies": { 8 | "@types/web": "^0.0.99", 9 | "copy-webpack-plugin": "^11.0.0", 10 | "css-loader": "^6.8.1", 11 | "esbuild": "0.23.0", 12 | "html-webpack-plugin": "^5.5.3", 13 | "style-loader": "^3.3.3", 14 | "ts-loader": "^9.4.4", 15 | "typescript": "^5.1.6", 16 | "webpack": "^5.88.1", 17 | "webpack-cli": "^5.1.4", 18 | "webpack-dev-server": "^4.15.1" 19 | }, 20 | "dependencies": { 21 | "html2canvas": "^1.4.1", 22 | "snarkdown": "^2.0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Pax Web 7 | 8 | 9 | 10 |
11 |
12 | 13 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/run-web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | SHOULD_ALSO_RUN=$1 3 | OUTPUT_PATH=$2 4 | 5 | assets_dir="../../../../assets" 6 | new_dir="./public/assets" 7 | mkdir -p "$new_dir" 8 | 9 | if [ -d "$assets_dir" ]; then 10 | cp -r "$assets_dir"/* "$new_dir" 11 | fi 12 | 13 | if [ "$SHOULD_ALSO_RUN" = "true" ]; then 14 | # Run, which doesn't require a previous build step due to webpack dev server 15 | set -ex 16 | npm i && npm run serve 17 | else 18 | # Build, with production webpack config 19 | npm i && npm run build 20 | 21 | # Clear old build and move to output directory 22 | rm -rf "$OUTPUT_PATH" 23 | mkdir -p "$OUTPUT_PATH" 24 | cp -r dist "$OUTPUT_PATH" 25 | fi 26 | 27 | 28 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/any-create-patch.ts: -------------------------------------------------------------------------------- 1 | export class AnyCreatePatch { 2 | public id?: number; 3 | public parentFrame?: number; 4 | public occlusionLayerId?: number; 5 | 6 | fromPatch(jsonMessage: any) { 7 | this.id = jsonMessage["id"]; 8 | this.parentFrame = jsonMessage["parent_frame"]; 9 | this.occlusionLayerId = jsonMessage["occlusion_layer_id"]; 10 | } 11 | 12 | cleanUp(){ 13 | this.id = undefined; 14 | this.parentFrame = undefined; 15 | this.occlusionLayerId = -1; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/event-blocker-update-patch.ts: -------------------------------------------------------------------------------- 1 | export class EventBlockerUpdatePatch { 2 | public id?: number; 3 | public sizeX?: number; 4 | public sizeY?: number; 5 | public transform?: number[]; 6 | fromPatch(jsonMessage: any) { 7 | if(jsonMessage != null) { 8 | this.id = jsonMessage["id"]; 9 | this.sizeX = jsonMessage["size_x"]; 10 | this.sizeY = jsonMessage["size_y"]; 11 | this.transform = jsonMessage["transform"]; 12 | } 13 | } 14 | 15 | cleanUp(){ 16 | this.id = undefined; 17 | this.sizeX = 0; 18 | this.sizeX = 0; 19 | this.transform = []; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/frame-update-patch.ts: -------------------------------------------------------------------------------- 1 | export class FrameUpdatePatch { 2 | public id?: number; 3 | public sizeX?: number; 4 | public sizeY?: number; 5 | public transform?: number[]; 6 | public clipContent?: boolean; 7 | 8 | fromPatch(jsonMessage: any) { 9 | if(jsonMessage != null) { 10 | this.id = jsonMessage["id"]; 11 | this.sizeX = jsonMessage["size_x"]; 12 | this.sizeY = jsonMessage["size_y"]; 13 | this.transform = jsonMessage["transform"]; 14 | this.clipContent = jsonMessage["clip_content"]; 15 | } 16 | } 17 | 18 | cleanUp(){ 19 | this.id = undefined; 20 | this.sizeX = 0; 21 | this.sizeX = 0; 22 | this.transform = []; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/image-load-patch.ts: -------------------------------------------------------------------------------- 1 | export class ImageLoadPatch { 2 | public id?: number; 3 | public path?: string; 4 | 5 | fromPatch(jsonMessage: any) { 6 | this.id = jsonMessage["id"]; 7 | this.path = jsonMessage["path"]; 8 | } 9 | 10 | cleanUp(){ 11 | this.id = undefined; 12 | this.path = ''; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/native-image-update-patch.ts: -------------------------------------------------------------------------------- 1 | export class NativeImageUpdatePatch { 2 | public id?: number; 3 | public url?: string; 4 | public fit?: string; 5 | public size_x?: number; 6 | public size_y?: number; 7 | public transform?: number[]; 8 | 9 | fromPatch(jsonMessage: any) { 10 | this.id = jsonMessage["id"]; 11 | this.url = jsonMessage["url"]; 12 | this.fit = jsonMessage["fit"]; 13 | this.size_x = jsonMessage["size_x"]; 14 | this.size_y = jsonMessage["size_y"]; 15 | this.transform = jsonMessage["transform"]; 16 | } 17 | 18 | cleanUp(){ 19 | this.id = undefined; 20 | this.url = ''; 21 | this.fit = ''; 22 | this.size_x = 0; 23 | this.size_y = 0; 24 | this.transform = []; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/navigation-patch.ts: -------------------------------------------------------------------------------- 1 | export class NavigationPatch { 2 | public url?: string; 3 | public target?: string; 4 | 5 | fromPatch(jsonMessage: any) { 6 | this.url = jsonMessage["url"]; 7 | this.target = jsonMessage["target"]; 8 | } 9 | 10 | cleanUp(){ 11 | this.url = undefined; 12 | this.target = undefined; 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/occlusion-update-patch.ts: -------------------------------------------------------------------------------- 1 | export class OcclusionUpdatePatch { 2 | public id?: number; 3 | public occlusionLayerId?: number; 4 | public zIndex?: number; 5 | public parentFrame?: number; 6 | 7 | fromPatch(jsonMessage: any) { 8 | this.id = jsonMessage["id"]; 9 | this.occlusionLayerId = jsonMessage["occlusion_layer_id"]; 10 | this.zIndex = jsonMessage["z_index"]; 11 | this.parentFrame = jsonMessage["parent_frame"]; 12 | } 13 | cleanUp(){ 14 | this.id = undefined; 15 | this.occlusionLayerId = -1; 16 | this.zIndex = -1; 17 | this.parentFrame = undefined; 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/screenshot-patch.ts: -------------------------------------------------------------------------------- 1 | export class ScreenshotPatch { 2 | public id?: number; 3 | 4 | fromPatch(jsonMessage: any) { 5 | this.id = jsonMessage["id"]; 6 | } 7 | 8 | cleanUp(){ 9 | this.id = undefined; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/set-cursor-patch.ts: -------------------------------------------------------------------------------- 1 | export class SetCursorPatch { 2 | public cursor?: string; 3 | 4 | fromPatch(jsonMessage: any) { 5 | this.cursor = jsonMessage["cursor"]; 6 | } 7 | 8 | cleanUp(){ 9 | this.cursor = undefined; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/classes/messages/youtube-video-update-patch.ts: -------------------------------------------------------------------------------- 1 | export class YoutubeVideoUpdatePatch { 2 | public id?: number; 3 | public url?: string; 4 | public size_x?: number; 5 | public size_y?: number; 6 | public transform?: number[]; 7 | 8 | fromPatch(jsonMessage: any) { 9 | this.id = jsonMessage["id"]; 10 | this.url = jsonMessage["url"]; 11 | this.size_x = jsonMessage["size_x"]; 12 | this.size_y = jsonMessage["size_y"]; 13 | this.transform = jsonMessage["transform"]; 14 | } 15 | 16 | cleanUp(){ 17 | this.id = undefined; 18 | this.url = ''; 19 | this.size_x = 0; 20 | this.size_y = 0; 21 | this.transform = []; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/pools/object-pool.ts: -------------------------------------------------------------------------------- 1 | export class ObjectPool { 2 | private pool: T[] = []; 3 | private readonly factory: (args?: any) => T; 4 | private readonly cleanUp: (item: T) => void; 5 | 6 | constructor(factory: (args?: any) => T, cleanUp: (item: T) => void) { 7 | this.factory = factory; 8 | this.cleanUp = cleanUp; 9 | } 10 | 11 | get(args?: any): T { 12 | if (this.pool.length > 0) { 13 | return this.pool.pop() as T; 14 | } 15 | return this.factory(args); 16 | } 17 | 18 | put(item: T) { 19 | this.cleanUp(item); 20 | this.pool.push(item); 21 | } 22 | } -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/types/pax-cartridge_bg.wasm.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export const memory: WebAssembly.Memory; 4 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/types/stats-js.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'src/types/stats-js'; -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/src/utils/constants.ts: -------------------------------------------------------------------------------- 1 | export const NATIVE_OVERLAY_CLASS = "native-overlay"; 2 | export const CANVAS_CLASS = "canvas"; 3 | export const SCROLLER_CONTAINER = "scroller-container" 4 | export const INNER_PANE = "inner-pane" 5 | export const NATIVE_LEAF_CLASS = "native-leaf"; 6 | export const NATIVE_CLIPPING_CLASS = "native-clipping"; 7 | export const BUTTON_CLASS = "button-styles"; 8 | export const CHECKBOX_CLASS = "checkbox-styles"; 9 | export const RADIO_SET_CLASS = "radio-set-style"; 10 | export const CLIPPING_CONTAINER = "clipping-container"; 11 | export const BUTTON_TEXT_CONTAINER_CLASS = "button-text-container"; 12 | -------------------------------------------------------------------------------- /pax-compiler/files/interfaces/web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "moduleResolution": "node", 5 | "module": "esNext", 6 | "lib": ["dom", "es2015"], 7 | "strict": true, 8 | "esModuleInterop": true, 9 | "sourceMap": true, 10 | "skipLibCheck": true, 11 | } 12 | } -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-libdev-project-template/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-libdev-project-template/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-libdev-project-template/src/fireworks.rs: -------------------------------------------------------------------------------- 1 | use pax_kit::*; 2 | 3 | #[pax] 4 | #[file("fireworks.pax")] 5 | pub struct Fireworks { 6 | pub rotation: Property, 7 | pub ticks: Property, 8 | } 9 | 10 | const ROTATION_COEFFICIENT: f64 = 0.00010; 11 | 12 | impl Fireworks { 13 | pub fn handle_wheel(&mut self, _ctx: &NodeContext, args: Event) { 14 | let old_t = self.rotation.get(); 15 | let new_t = old_t - args.delta_y * ROTATION_COEFFICIENT; 16 | self.rotation.set(f64::max(0.0, new_t)); 17 | } 18 | 19 | pub fn handle_tick(&mut self, _ctx: &NodeContext) { 20 | let old_ticks = self.ticks.get(); 21 | self.ticks.set(old_ticks + 1); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-libdev-project-template/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_kit::*; 4 | 5 | pub mod calculator; 6 | pub use calculator::*; 7 | 8 | pub mod fireworks; 9 | pub use fireworks::*; 10 | 11 | pub mod space_game; 12 | pub use space_game::*; 13 | 14 | pub mod color_picker; 15 | pub use color_picker::*; 16 | 17 | mod animation; 18 | 19 | 20 | #[pax] 21 | #[main] 22 | #[file("lib.pax")] 23 | pub struct Example { 24 | pub ticks: Property, 25 | pub num_clicks: Property, 26 | } 27 | 28 | impl Example { 29 | pub fn handle_pre_render(&mut self, _ctx: &NodeContext) { 30 | let old_ticks = self.ticks.get(); 31 | self.ticks.set((old_ticks + 1) % 255); 32 | } 33 | 34 | pub fn increment(&mut self, _ctx: &NodeContext, _args: Event) { 35 | let old_num_clicks = self.num_clicks.get(); 36 | self.num_clicks.set(old_num_clicks + 1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-project-template/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .pax -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-project-template/assets/pax-logo-white-on-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/new-project/new-project-template/assets/pax-logo-white-on-black.png -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-project-template/assets/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/new-project/new-project-template/assets/placeholder.png -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-project-template/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("pax-cli") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-project-template/src/lib.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @settings { 7 | @pre_render: handle_pre_render 8 | #text { 9 | style: { 10 | font: Font::Web("Roboto", "", FontStyle::Normal, FontWeight::Light) 11 | font_size: 26px 12 | fill: WHITE 13 | align_vertical: TextAlignVertical::Center 14 | align_horizontal: TextAlignHorizontal::Center 15 | align_multiline: TextAlignHorizontal::Center 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /pax-compiler/files/new-project/new-project-template/src/lib.rs: -------------------------------------------------------------------------------- 1 | use pax_kit::*; 2 | 3 | #[pax] 4 | #[main] 5 | #[file("lib.pax")] 6 | pub struct Example { 7 | pub ticks: Property, 8 | pub num_clicks: Property, 9 | pub current_rotation: Property, 10 | } 11 | 12 | const ROTATION_INCREMENT_DEGREES: f64 = 90.0; 13 | const ROTATION_EASING_DURATION_FRAMES: u64 = 120; 14 | 15 | impl Example { 16 | pub fn handle_pre_render(&mut self, _ctx: &NodeContext) { 17 | let old_ticks = self.ticks.get(); 18 | self.ticks.set((old_ticks + 1) % 255); 19 | } 20 | 21 | pub fn increment(&mut self, _ctx: &NodeContext, _args: Event) { 22 | let old_num_clicks = self.num_clicks.get(); 23 | let new_val = old_num_clicks + 1; 24 | self.num_clicks.set(new_val); 25 | self.current_rotation.ease_to(new_val as f64 * ROTATION_INCREMENT_DEGREES, ROTATION_EASING_DURATION_FRAMES, EasingCurve::OutQuad); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.9 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "PaxSwiftCartridge", 8 | platforms: [ 9 | .macOS(.v12), 10 | .iOS(.v13) 11 | ], 12 | products: [ 13 | .library( 14 | name: "PaxCartridge", 15 | targets: ["PaxCartridge", "PaxCartridgeAssets"] 16 | ), 17 | .library( 18 | name: "PaxCartridgeAssets", 19 | targets: ["PaxCartridgeAssets"] 20 | ), 21 | ], 22 | targets: [ 23 | .binaryTarget( 24 | name: "PaxCartridge", 25 | path: "PaxCartridge.xcframework" 26 | ), 27 | .target( 28 | name: "PaxCartridgeAssets", 29 | resources: [.process("Resources")] 30 | ) 31 | ] 32 | ) 33 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/ios-arm64/PaxCartridge.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module PaxCartridge { 2 | umbrella header "../Headers/PaxCartridge.h" 3 | export * 4 | module * { export * } 5 | } 6 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/ios-arm64/PaxCartridge.framework/PaxCartridge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/ios-arm64/PaxCartridge.framework/PaxCartridge -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/ios-arm64_x86_64-simulator/PaxCartridge.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module PaxCartridge { 2 | umbrella header "../Headers/PaxCartridge.h" 3 | export * 4 | module * { export * } 5 | } 6 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/ios-arm64_x86_64-simulator/PaxCartridge.framework/PaxCartridge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/ios-arm64_x86_64-simulator/PaxCartridge.framework/PaxCartridge -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/macos-arm64_x86_64/PaxCartridge.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module PaxCartridge { 2 | umbrella header "../Headers/PaxCartridge.h" 3 | export * 4 | module * { export * } 5 | } 6 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/macos-arm64_x86_64/PaxCartridge.framework/PaxCartridge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/swift/pax-swift-cartridge/PaxCartridge.xcframework/macos-arm64_x86_64/PaxCartridge.framework/PaxCartridge -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/README.md: -------------------------------------------------------------------------------- 1 | # pax-swift-cartridge 2 | 3 | Holds the Swift Package Manager package + configuration for a Pax cartridge. 4 | 5 | This is used by both macOS and iOS builds. 6 | 7 | 1. Configures dylib dependency (built Pax+Rust cartridge) 8 | 2. Exposes a SwiftUI View for consumption by developers or full-app chassis 9 | 10 | This directory is used as a codegen template — the final built and dylib-patched version of this Swift package will 11 | sit inside userland `.pax/pkg/pax-chassis-common/pax-swift-cartridge` -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/Sources/PaxCartridgeAssets/Empty.swift: -------------------------------------------------------------------------------- 1 | public class PaxCartridgeBundleLocator {} -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/Sources/PaxCartridgeAssets/Resources/assets/images/pax-logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/swift/pax-swift-cartridge/Sources/PaxCartridgeAssets/Resources/assets/images/pax-logo-light.png -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/Sources/PaxCartridgeAssets/Resources/assets/images/pax-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/files/swift/pax-swift-cartridge/Sources/PaxCartridgeAssets/Resources/assets/images/pax-logo.png -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-cartridge/copy-dylibs-from-pax-example-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Extracts .frameworks from xcframework, rebuilds xcframework. 4 | # Used to rely on xcodebuild's sanitary bundling process for the fragile xcframework structure 5 | 6 | set -e 7 | 8 | cp -r ../../pax-example/.pax/pkg/pax-chassis-common/pax-swift-cartridge/PaxCartridge.xcframework/ ./PaxCartridge.xcframework/ -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-common/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-common/README.md: -------------------------------------------------------------------------------- 1 | # pax-swift-common 2 | 3 | Common swift logic, packaged as an SPM package, shared by both iOS and macOS (e.g. FlexBuffers and Message structs) 4 | 5 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-common/Sources/FlexBuffers/FlexBuffers.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlexBuffers.h 3 | // FlexBuffers 4 | // 5 | // Created by Maxim Zaks on 27.12.16. 6 | // Copyright © 2016 Maxim Zaks. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for FlexBuffers. 12 | FOUNDATION_EXPORT double FlexBuffersVersionNumber; 13 | 14 | //! Project version string for FlexBuffers. 15 | FOUNDATION_EXPORT const unsigned char FlexBuffersVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /pax-compiler/files/swift/pax-swift-common/Tests/PaxSwiftCommonTests/PaxSwiftCommonTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import PaxSwiftCommon 3 | 4 | final class PaxSwiftCommonTests: XCTestCase { 5 | func testExample() throws { 6 | // XCTest Documenation 7 | // https://developer.apple.com/documentation/xctest 8 | 9 | // Defining Test Cases and Test Methods 10 | // https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1709874916891/after.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 7 | } 8 | 9 | // OBS: here to add it to the project (otherwise not included in manifest) 10 | 11 | 12 | @settings { 13 | @mount: on_mount, 14 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1709874916891/before.pax: -------------------------------------------------------------------------------- 1 | for stop in self.stop_statistics { 2 | 3 | 6 | } 7 | 8 | // OBS: here to add it to the project (otherwise not included in manifest) 9 | 10 | 11 | @settings { 12 | @mount: on_mount, 13 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1709874916891/request.txt: -------------------------------------------------------------------------------- 1 | add two rectangles rotated 45 degrees and 200 pixels -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1709874945533/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 10 | } 11 | 12 | // OBS: here to add it to the project (otherwise not included in manifest) 13 | 14 | 15 | @settings { 16 | @mount: on_mount, 17 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1709874945533/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 7 | } 8 | 9 | // OBS: here to add it to the project (otherwise not included in manifest) 10 | 11 | 12 | @settings { 13 | @mount: on_mount, 14 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1709874945533/request.txt: -------------------------------------------------------------------------------- 1 | add 3 rectangles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097285464/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097285464/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 6 | } 7 | 8 | 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097285464/request.txt: -------------------------------------------------------------------------------- 1 | add a bunch of colorful rectangles scattered across the screen -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097310800/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097310800/before.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097310800/request.txt: -------------------------------------------------------------------------------- 1 | line them up vertically in the center of the screen -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097327512/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097327512/before.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097327512/request.txt: -------------------------------------------------------------------------------- 1 | lie all of the rectangles vertically -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097353478/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | for stop in self.stop_statistics { 5 | 6 | 8 | } 9 | 10 | 11 | 12 | // OBS: here to add it to the project (otherwise not included in manifest) 13 | 14 | 15 | @settings { 16 | @pre_render: pre_render, 17 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097353478/before.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097353478/request.txt: -------------------------------------------------------------------------------- 1 | delete the blue rectangle -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097361307/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | for stop in self.stop_statistics { 4 | 5 | 7 | } 8 | 9 | 10 | 11 | // OBS: here to add it to the project (otherwise not included in manifest) 12 | 13 | 14 | @settings { 15 | @pre_render: pre_render, 16 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097361307/before.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | for stop in self.stop_statistics { 5 | 6 | 8 | } 9 | 10 | 11 | 12 | // OBS: here to add it to the project (otherwise not included in manifest) 13 | 14 | 15 | @settings { 16 | @pre_render: pre_render, 17 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097361307/request.txt: -------------------------------------------------------------------------------- 1 | delete the red rectangle -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097376419/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097376419/before.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | for stop in self.stop_statistics { 4 | 5 | 7 | } 8 | 9 | 10 | 11 | // OBS: here to add it to the project (otherwise not included in manifest) 12 | 13 | 14 | @settings { 15 | @pre_render: pre_render, 16 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097376419/request.txt: -------------------------------------------------------------------------------- 1 | add some text in the green rectangle -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097401997/before.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | for stop in self.stop_statistics { 6 | 7 | 9 | } 10 | 11 | 12 | 13 | // OBS: here to add it to the project (otherwise not included in manifest) 14 | 15 | 16 | @settings { 17 | @pre_render: pre_render, 18 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710097401997/request.txt: -------------------------------------------------------------------------------- 1 | no it cannot be in the rectangle make it at the root level -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710101683173/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | for stop in self.stop_statistics { 4 | 5 | 7 | } 8 | 9 | 10 | 11 | // OBS: here to add it to the project (otherwise not included in manifest) 12 | 13 | 14 | @settings { 15 | @pre_render: pre_render, 16 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710101683173/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 6 | } 7 | 8 | 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710101683173/request.txt: -------------------------------------------------------------------------------- 1 | build me a navbar -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190771713/after.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 6 | } 7 | 8 | 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190771713/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 6 | } 7 | 8 | 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190771713/request.txt: -------------------------------------------------------------------------------- 1 | make the map a 10th of the size -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190786499/after.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 6 | } 7 | 8 | 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190786499/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 6 | } 7 | 8 | 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190786499/request.txt: -------------------------------------------------------------------------------- 1 | make the image a 10th of the size -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190803315/after.pax: -------------------------------------------------------------------------------- 1 | @settings { 2 | @pre_render: pre_render, 3 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190803315/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 6 | } 7 | 8 | 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190803315/request.txt: -------------------------------------------------------------------------------- 1 | delete all the other nodes -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190828173/after.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | @settings { 4 | @pre_render: pre_render, 5 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190828173/before.pax: -------------------------------------------------------------------------------- 1 | @settings { 2 | @pre_render: pre_render, 3 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710190828173/request.txt: -------------------------------------------------------------------------------- 1 | create 4 rectangles with different colors and align them vertically and horizontally -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710306736452/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 8 | } 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710306736452/request.txt: -------------------------------------------------------------------------------- 1 | create 10 rectangles that are all colored -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710306964046/before.pax: -------------------------------------------------------------------------------- 1 | 2 | for stop in self.stop_statistics { 3 | 4 | 8 | } 9 | 10 | // OBS: here to add it to the project (otherwise not included in manifest) 11 | 12 | 13 | @settings { 14 | @pre_render: pre_render, 15 | } -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710306964046/request.txt: -------------------------------------------------------------------------------- 1 | create a tooltip -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710613439352/request.txt: -------------------------------------------------------------------------------- 1 | add 3 rectangles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710613456867/request.txt: -------------------------------------------------------------------------------- 1 | add a circle -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710614429434/request.txt: -------------------------------------------------------------------------------- 1 | add a red circle -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739257719/request.txt: -------------------------------------------------------------------------------- 1 | a red circle -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739276260/request.txt: -------------------------------------------------------------------------------- 1 | create 3 red circles at the root -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739293112/request.txt: -------------------------------------------------------------------------------- 1 | delete the red circles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739310443/request.txt: -------------------------------------------------------------------------------- 1 | create 5 different colored rectangles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739351426/request.txt: -------------------------------------------------------------------------------- 1 | create 100 different colored rectangles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739398400/request.txt: -------------------------------------------------------------------------------- 1 | create 100 rectangles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739433303/request.txt: -------------------------------------------------------------------------------- 1 | create 100 rectangles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739517748/request.txt: -------------------------------------------------------------------------------- 1 | create 10000 rectangles -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710739549370/request.txt: -------------------------------------------------------------------------------- 1 | create 10 different colored rectangles with each one spaced apart equally -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710986402014/request.txt: -------------------------------------------------------------------------------- 1 | remove the black rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710986607062/request.txt: -------------------------------------------------------------------------------- 1 | remove black rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710986627664/request.txt: -------------------------------------------------------------------------------- 1 | add a blue rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710986923069/request.txt: -------------------------------------------------------------------------------- 1 | remove black rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710986939548/request.txt: -------------------------------------------------------------------------------- 1 | add a black circle -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710987147257/request.txt: -------------------------------------------------------------------------------- 1 | add a blue rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710987159804/request.txt: -------------------------------------------------------------------------------- 1 | remove blue rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710987187152/request.txt: -------------------------------------------------------------------------------- 1 | remove black rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/future_training_data/1710987370558/request.txt: -------------------------------------------------------------------------------- 1 | add a rect -------------------------------------------------------------------------------- /pax-compiler/src/design_server/llm/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod simple; 2 | -------------------------------------------------------------------------------- /pax-compiler/src/design_server/tests/data/code_serialization/serialization_test_project/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/src/design_server/tests/data/code_serialization/serialization_test_project/src/lib.rs -------------------------------------------------------------------------------- /pax-compiler/src/design_server/tests/designtime_integration_test.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/src/design_server/tests/designtime_integration_test.rs -------------------------------------------------------------------------------- /pax-compiler/src/design_server/tests/manifest_serialization_test.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/src/design_server/tests/manifest_serialization_test.rs -------------------------------------------------------------------------------- /pax-compiler/src/errors/source_map.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-compiler/src/errors/source_map.rs -------------------------------------------------------------------------------- /pax-compiler/tests/data/code_serialization/serialization_test_project/.gitignore: -------------------------------------------------------------------------------- 1 | .pax 2 | -------------------------------------------------------------------------------- /pax-compiler/tests/data/code_serialization/serialization_test_project/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "serialization_test_project" 3 | version = "0.38.3" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-kit = { version = "0.38.3", path="../../../../../pax-kit" } 9 | 10 | [lib] 11 | crate-type = ["cdylib", "rlib"] 12 | name = "paxcartridge" 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | designer = ["pax-kit/designer"] 25 | parser = ["pax-kit/parser"] 26 | web = ["pax-kit/web"] 27 | macos = ["pax-kit/macos"] 28 | ios = ["pax-kit/ios"] 29 | 30 | [profile.parser] 31 | inherits = "dev" 32 | opt-level = 0 33 | 34 | [profile.parser.package."*"] 35 | inherits = "dev" 36 | opt-level = 0 37 | 38 | [profile.dev] 39 | opt-level = 0 40 | debug = false 41 | 42 | [profile.dev.package."*"] 43 | opt-level = 2 44 | debug = false 45 | 46 | [workspace] 47 | -------------------------------------------------------------------------------- /pax-compiler/tests/data/code_serialization/serialization_test_project/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-compiler/tests/data/code_serialization/serialization_test_project/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | set -e 10 | 11 | # Set the PAX_WORKSPACE_ROOT environment variable 12 | export PAX_WORKSPACE_ROOT=$(realpath "../../../../../../pax") 13 | 14 | current_dir=$(pwd) 15 | pushd ../../../../../../pax/pax-cli 16 | cargo build 17 | ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 18 | popd 19 | -------------------------------------------------------------------------------- /pax-compiler/tests/data/code_serialization/serialization_test_project/src/generated_lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | use pax_kit::*; 3 | 4 | #[pax] 5 | #[main] 6 | #[inlined()] 7 | pub struct Example { 8 | pub ticks: Property, 9 | pub num_clicks: Property, 10 | pub message: Property, 11 | } 12 | 13 | impl Example { 14 | pub fn handle_mount(&mut self, ctx: &NodeContext) { 15 | self.message.set("Click me".to_string()); 16 | } 17 | pub fn handle_pre_render(&mut self, ctx: &NodeContext) { 18 | let old_ticks = self.ticks.get(); 19 | self.ticks.set(old_ticks + 1); 20 | } 21 | 22 | pub fn increment(&mut self, ctx: &NodeContext, args: Event){ 23 | let old_num_clicks = self.num_clicks.get(); 24 | self.num_clicks.set(old_num_clicks + 1); 25 | self.message.set(format!("{} clicks", self.num_clicks.get())); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pax-compiler/tests/data/designtime_integration_test.pax: -------------------------------------------------------------------------------- 1 | FILE HAS NOT BEEN UPDATED BY DESIGNTIME -------------------------------------------------------------------------------- /pax-compiler/tests/data/manifest_serialization_test.pax: -------------------------------------------------------------------------------- 1 | // Hello world 2 | 3 | 4 | @settings { 5 | @existing_handler: handler_action, 6 | #existing_selector { 7 | 8 | } 9 | } -------------------------------------------------------------------------------- /pax-designer/.gitignore: -------------------------------------------------------------------------------- 1 | .pax 2 | target -------------------------------------------------------------------------------- /pax-designer/assets/color_picker/transparency_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/color_picker/transparency_grid.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/chevron-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/chevron-down.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-align-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-align-center.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-align-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-align-left.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-align-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-align-right.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-brush.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-button.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-checkbox.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-component.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-console.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-dropdown.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-ellipse.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-for.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-for.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-frame.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-fx-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-fx-off.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-fx-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-fx-on.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-group.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-if.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-if.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-image.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-path.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-pointer-percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-pointer-percent.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-pointer-px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-pointer-px.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-radio.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-rectangle.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-robot.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-scroller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-scroller.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-slider.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-speech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-speech.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-stacker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-stacker.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-text.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-textbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-textbox.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-valign-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-valign-bottom.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-valign-middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-valign-middle.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/icon-valign-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/icon-valign-top.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/placeholder.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/collapse_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/collapse_arrow.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/collapse_arrow_collapsed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/collapse_arrow_collapsed.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-01-frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-01-frame.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-02-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-02-group.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-03-ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-03-ellipse.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-04-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-04-text.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-05-stacker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-05-stacker.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-06-rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-06-rectangle.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-07-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-07-path.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-08-component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-08-component.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-09-textbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-09-textbox.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-10-checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-10-checkbox.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-11-scroller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-11-scroller.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-12-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-12-button.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-13-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-13-image.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-14-slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-14-slider.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/tree/tree-icon-15-dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/tree/tree-icon-15-dropdown.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/triangle-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/triangle-down.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/triangle-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/triangle-right.png -------------------------------------------------------------------------------- /pax-designer/assets/icons/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/icons/x.png -------------------------------------------------------------------------------- /pax-designer/assets/images/pax-logo-black-on-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/images/pax-logo-black-on-white.png -------------------------------------------------------------------------------- /pax-designer/assets/images/pax-logo-white-on-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/images/pax-logo-white-on-black.png -------------------------------------------------------------------------------- /pax-designer/assets/pax-logo-white-on-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/pax-designer/assets/pax-logo-white-on-black.png -------------------------------------------------------------------------------- /pax-designer/src/console/card.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | use pax_engine::{api::*, *}; 3 | use pax_std::*; 4 | 5 | use super::MessageType; 6 | 7 | #[pax] 8 | #[engine_import_path("pax_engine")] 9 | #[file("console/card.pax")] 10 | pub struct Card { 11 | pub message_type: Property, 12 | pub text: Property, 13 | } 14 | -------------------------------------------------------------------------------- /pax-designer/src/controls/file_and_component_picker/component_library_item.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @settings { 5 | @mouse_down: on_down 6 | .component_text { 7 | style: { 8 | font_size: 20px, 9 | font: {Font::Web( 10 | "ff-real-headline-pro", 11 | "https://use.typekit.net/ivu7epf.css", 12 | FontStyle::Normal, 13 | FontWeight::ExtraLight, 14 | )}, 15 | fill: WHITE, 16 | align_vertical: TextAlignVertical::Center, 17 | align_horizontal: TextAlignHorizontal::Left, 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /pax-designer/src/controls/logobar.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | @settings { 4 | #logo { 5 | width: 65px, 6 | height: 65px, 7 | x: 16px, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /pax-designer/src/controls/logobar.rs: -------------------------------------------------------------------------------- 1 | use pax_engine::api::*; 2 | use pax_engine::*; 3 | 4 | use pax_std::*; 5 | 6 | use crate::model; 7 | use crate::model::action::orm::SerializeRequested; 8 | 9 | #[pax] 10 | #[engine_import_path("pax_engine")] 11 | #[file("controls/logobar.pax")] 12 | pub struct Logobar {} 13 | 14 | impl Logobar { 15 | pub fn handle_logo_click(&mut self, ctx: &NodeContext, _args: Event) { 16 | model::perform_action(&SerializeRequested {}, ctx); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pax-designer/src/controls/settings/property_editor/color_property_editor.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | @settings { 4 | @mount: on_mount 5 | @pre_render: pre_render 6 | } 7 | -------------------------------------------------------------------------------- /pax-designer/src/controls/settings/property_editor/fill_property_editor.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | @settings { 4 | @mount: on_mount 5 | @pre_render: pre_render 6 | } 7 | -------------------------------------------------------------------------------- /pax-designer/src/controls/settings/property_editor/stroke_property_editor.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @settings { 5 | @mount: on_mount 6 | @pre_render: pre_render 7 | 8 | .input { 9 | height: 30px, 10 | background: rgb(12.5%, 12.5%, 12.5%), 11 | stroke: { 12 | color: rgb(48, 56, 62), 13 | width: 1px, 14 | }, 15 | border_radius: 5, 16 | style: { 17 | font: {Font::Web( 18 | "ff-real-headline-pro", 19 | "https://use.typekit.net/ivu7epf.css", 20 | FontStyle::Normal, 21 | FontWeight::Light, 22 | )}, 23 | font_size: 14px, 24 | fill: WHITE, 25 | } 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /pax-designer/src/controls/tool_settings_views.rs: -------------------------------------------------------------------------------- 1 | pub mod paintbrush_settings_view; 2 | -------------------------------------------------------------------------------- /pax-designer/src/controls/toolbar/mod.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | for (view, i) in self.dropdown_entries { 4 | 5 | } 6 | 7 | for (view, i) in self.entries { 8 | 9 | } 10 | 11 | 16 | 17 | @settings { 18 | @mount: on_mount 19 | @unmount: on_unmount 20 | } 21 | -------------------------------------------------------------------------------- /pax-designer/src/controls/toolbar/toolbar_item.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | if self.data.more_than_one_item { 4 | 5 | } 6 | 7 | 8 | 9 | if self.data.fill_background { 10 | 13 | } 14 | 15 | 16 | @settings { 17 | .icon { 18 | anchor_x: 50%, 19 | anchor_y: 50%, 20 | x: 50%, 21 | y: 50%, 22 | scale_x: 60%, 23 | scale_y: 60%, 24 | } 25 | 26 | .arrow { 27 | anchor_x: 50%, 28 | anchor_y: 50%, 29 | x: 90%, 30 | y: 50%, 31 | scale_x: 20%, 32 | scale_y: 20%, 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pax-designer/src/glass/intent.pax: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /pax-designer/src/glass/outline.rs: -------------------------------------------------------------------------------- 1 | use pax_engine::api::{PathElement, Size}; 2 | use pax_engine::{node_layout::TransformAndBounds, NodeLocal, Property}; 3 | 4 | use crate::{math::coordinate_spaces::Glass, model::action::RaycastMode}; 5 | 6 | pub struct PathOutline {} 7 | 8 | impl PathOutline { 9 | pub fn from_bounds(t_and_b: TransformAndBounds) -> Vec { 10 | let [p1, p4, p3, p2] = t_and_b.corners(); 11 | vec![ 12 | PathElement::Point(Size::Pixels(p1.x.into()), Size::Pixels(p1.y.into())), 13 | PathElement::Line, 14 | PathElement::Point(Size::Pixels(p2.x.into()), Size::Pixels(p2.y.into())), 15 | PathElement::Line, 16 | PathElement::Point(Size::Pixels(p3.x.into()), Size::Pixels(p3.y.into())), 17 | PathElement::Line, 18 | PathElement::Point(Size::Pixels(p4.x.into()), Size::Pixels(p4.y.into())), 19 | PathElement::Close, 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pax-designer/src/glass/wireframe_editor.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | for (data, i) in self.control_points { 4 | 10 | } 11 | 12 | for segment in self.bounding_segments { 13 | 14 | } 15 | 16 | 17 | @settings { 18 | @mount: on_mount, 19 | @pre_render: pre_render, 20 | .bounding_segment { 21 | elements: {[ 22 | PathElement::Point((segment.x0)px, (segment.y0)px), 23 | PathElement::Line, 24 | PathElement::Point((segment.x1)px, (segment.y1)px) 25 | ]}, 26 | stroke: { 27 | color: BLUE 28 | width: 1px 29 | }, 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pax-designer/src/message_log_display.pax: -------------------------------------------------------------------------------- 1 | if self.message_visible { 2 | 3 | 4 | 7 | 8 | } 9 | 10 | @settings { 11 | @mount: on_mount 12 | @pre_render: pre_render 13 | 14 | .message { 15 | style: { 16 | font: Font::Web( 17 | "ff-real-headline-pro", 18 | "", 19 | FontStyle::Normal, 20 | FontWeight::Light 21 | ), 22 | font_size: 12px, 23 | fill: {rgba(255, 255, 255, self.opacity)}, 24 | align_vertical: TextAlignVertical::Center, 25 | align_horizontal: TextAlignHorizontal::Center, 26 | align_multiline: TextAlignHorizontal::Center 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /pax-designer/src/model/action/tool.rs: -------------------------------------------------------------------------------- 1 | use std::{cell::RefCell, rc::Rc}; 2 | 3 | use pax_engine::log; 4 | 5 | use crate::model::ToolBehavior; 6 | 7 | use super::Action; 8 | 9 | pub struct SetToolBehaviour(pub Option>>); 10 | 11 | impl Action for SetToolBehaviour { 12 | fn perform(&self, ctx: &mut super::ActionContext) -> anyhow::Result<()> { 13 | let current = ctx.app_state.tool_behavior.get(); 14 | if let Some(current) = current { 15 | if let Err(e) = current.borrow_mut().finish(ctx) { 16 | log::warn!("tool finish failed: {e}"); 17 | } 18 | } 19 | ctx.app_state 20 | .tool_behavior 21 | .set(self.0.as_ref().map(Rc::clone)); 22 | Ok(()) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /pax-designer/src/model/derived_state.rs: -------------------------------------------------------------------------------- 1 | use super::SelectionState; 2 | use crate::math::coordinate_spaces::Glass; 3 | use pax_engine::{ 4 | api::Window, math::Transform2, pax_manifest::UniqueTemplateNodeIdentifier, NodeInterface, 5 | Property, 6 | }; 7 | 8 | // This represents values that can be deterministically produced from the app 9 | // state and the projects manifest 10 | pub struct DerivedAppState { 11 | pub to_glass_transform: Property>>, 12 | pub selected_nodes: Property>, 13 | pub selection_state: Property, 14 | /// The currently open containers, example: the parent group of the rectangle currently selected, and the scroller this group is inside 15 | pub open_containers: Property>, 16 | } 17 | -------------------------------------------------------------------------------- /pax-designer/src/model/tools/tool_plugins.rs: -------------------------------------------------------------------------------- 1 | pub mod drop_intent_handler; 2 | -------------------------------------------------------------------------------- /pax-designer/src/utils.rs: -------------------------------------------------------------------------------- 1 | pub mod designer_cursor; 2 | pub mod filter_with_last; 3 | -------------------------------------------------------------------------------- /pax-designtime/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | target/ 3 | 4 | **/*.rs.bk 5 | Cargo.lock 6 | .DS_Store 7 | .cargo 8 | 9 | ## VScode project configuration files 10 | .vscode/ 11 | 12 | pax-chassis-macos/interface/interface.xcodeproj/project.xcworkspace/xcuserdata/**/* 13 | pax-chassis-macos/interface/interface.xcodeproj/xcuserdata/**/* 14 | -------------------------------------------------------------------------------- /pax-designtime/src/orm/manifest_modification_data.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashSet; 2 | 3 | use serde::{Deserialize, Serialize}; 4 | 5 | // Used to expose more granular updates to the designer 6 | #[derive(Default, Serialize, Deserialize)] 7 | pub struct ManifestModificationData { 8 | pub modified_properties: HashSet, 9 | pub tree_modified: bool, 10 | } 11 | -------------------------------------------------------------------------------- /pax-designtime/src/orm/template/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod class_builder; 2 | pub mod class_builder_commands; 3 | pub use class_builder_commands::*; 4 | pub mod node_builder; 5 | pub mod node_builder_commands; 6 | pub use node_builder_commands::*; 7 | -------------------------------------------------------------------------------- /pax-designtime/src/serde_pax/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod error; 2 | pub mod se; 3 | 4 | const NUMERIC: &str = "Numeric"; 5 | const SIZE: &str = "Size"; 6 | const ROTATION: &str = "Rotation"; 7 | const DEGREES: &str = "Degrees"; 8 | const RADIANS: &str = "Radians"; 9 | const PIXELS: &str = "Pixels"; 10 | const PERCENT: &str = "Percent"; 11 | const TRUE: &str = "true"; 12 | const FALSE: &str = "false"; 13 | -------------------------------------------------------------------------------- /pax-designtime/src/undo.rs: -------------------------------------------------------------------------------- 1 | pub struct PaxUndoManager {} 2 | 3 | impl Default for PaxUndoManager { 4 | fn default() -> Self { 5 | Self::new() 6 | } 7 | } 8 | 9 | impl PaxUndoManager { 10 | pub fn new() -> Self { 11 | PaxUndoManager {} 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pax-engine/README.md: -------------------------------------------------------------------------------- 1 | # pax-engine 2 | 3 | Entry crate for using & developing an application with Pax. 4 | -------------------------------------------------------------------------------- /pax-generation/.env.example: -------------------------------------------------------------------------------- 1 | ANTHROPIC_API_KEY=your-api-key 2 | OPENAI_API_KEY=your-api-key -------------------------------------------------------------------------------- /pax-generation/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | .pax 3 | generated_project/src/* -------------------------------------------------------------------------------- /pax-generation/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-generation" 3 | version = "0.38.3" 4 | edition = "2021" 5 | description = "Tools for generating Pax with LLMs" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [lib] 9 | 10 | [dependencies] 11 | reqwest = { version = "0.11", features = ["json"] } 12 | tokio = { version = "1", features = ["full"] } 13 | serde_json = "1.0" 14 | regex = "1.5" 15 | dotenv = "0.15" 16 | pax-lang = {version = "0.38.3", path="../pax-lang"} 17 | pax-message = {version = "0.38.3", path="../pax-message"} 18 | futures = "0.3.30" 19 | image = "0.24" 20 | serde = { version = "1.0", features = ["derive"] } 21 | base64 = "0.13" -------------------------------------------------------------------------------- /pax-generation/generated_project/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-generation/generated_project/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/bouncing-growing-rects/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/bouncing-growing-rects/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/bouncing-growing-rects/src/lib.pax: -------------------------------------------------------------------------------- 1 | 2 | for rect in self.rectangles { 3 | 10 | } 11 | 12 | 13 | 14 | @settings { 15 | @mount: handle_mount, 16 | @tick: handle_tick, 17 | @wheel: handle_wheel, 18 | #instructions { 19 | style: { 20 | font: {Font::system("Arial", FontStyle::Normal, FontWeight::Bold)}, 21 | font_size: 24px, 22 | fill: BLACK, 23 | align_vertical: TextAlignVertical::Center, 24 | align_horizontal: TextAlignHorizontal::Center, 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/calculator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "generated_project" 3 | version = "0.15.5" 4 | edition = "2021" 5 | default-run = "run" 6 | [workspace] 7 | 8 | exclude = [ 9 | ".pax", 10 | ] 11 | 12 | [dependencies] 13 | pax-engine = { version = "0.15.5" , path = ".pax/pkg/pax-engine" } 14 | pax-std = { version = "0.15.5" , path = ".pax/pkg/pax-std" } 15 | pax-compiler = { version = "0.15.5", optional = true, path = ".pax/pkg/pax-compiler" } 16 | pax-manifest = { version = "0.15.5", optional = true, path = ".pax/pkg/pax-manifest" } 17 | serde_json = {version = "1.0.95", optional = true} 18 | rand = {version = "0.8.5"} 19 | getrandom = { version = "0.2.14", features = ["js"] } 20 | 21 | [[bin]] 22 | name = "parser" 23 | path = "src/lib.rs" 24 | required-features = ["parser"] 25 | 26 | [[bin]] 27 | name = "run" 28 | path = "bin/run.rs" 29 | 30 | [features] 31 | parser = ["pax-std/parser", "pax-engine/parser", "dep:serde_json", "dep:pax-compiler", "dep:pax-manifest"] 32 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/calculator/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/calculator/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/katamari/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "generated_project" 3 | version = "0.15.5" 4 | edition = "2021" 5 | default-run = "run" 6 | [workspace] 7 | 8 | exclude = [ 9 | ".pax", 10 | ] 11 | 12 | [dependencies] 13 | pax-engine = { version = "0.15.5" , path = ".pax/pkg/pax-engine" } 14 | pax-std = { version = "0.15.5" , path = ".pax/pkg/pax-std" } 15 | pax-compiler = { version = "0.15.5", optional = true, path = ".pax/pkg/pax-compiler" } 16 | pax-manifest = { version = "0.15.5", optional = true, path = ".pax/pkg/pax-manifest" } 17 | serde_json = {version = "1.0.95", optional = true} 18 | rand = {version = "0.8.5"} 19 | getrandom = { version = "0.2.14", features = ["js"] } 20 | 21 | [[bin]] 22 | name = "parser" 23 | path = "src/lib.rs" 24 | required-features = ["parser"] 25 | 26 | [[bin]] 27 | name = "run" 28 | path = "bin/run.rs" 29 | 30 | [features] 31 | parser = ["pax-std/parser", "pax-engine/parser", "dep:serde_json", "dep:pax-compiler", "dep:pax-manifest"] 32 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/katamari/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/katamari/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/scientific_calculator/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/scientific_calculator/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/unbeatable-pong/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "generated_project" 3 | version = "0.15.5" 4 | edition = "2021" 5 | default-run = "run" 6 | [workspace] 7 | 8 | exclude = [ 9 | ".pax", 10 | ] 11 | 12 | [dependencies] 13 | pax-engine = { version = "0.15.5" , path = ".pax/pkg/pax-engine" } 14 | pax-std = { version = "0.15.5" , path = ".pax/pkg/pax-std" } 15 | pax-compiler = { version = "0.15.5", optional = true, path = ".pax/pkg/pax-compiler" } 16 | pax-manifest = { version = "0.15.5", optional = true, path = ".pax/pkg/pax-manifest" } 17 | serde_json = {version = "1.0.95", optional = true} 18 | rand = {version = "0.8.5"} 19 | getrandom = { version = "0.2.14", features = ["js"] } 20 | 21 | [[bin]] 22 | name = "parser" 23 | path = "src/lib.rs" 24 | required-features = ["parser"] 25 | 26 | [[bin]] 27 | name = "run" 28 | path = "bin/run.rs" 29 | 30 | [features] 31 | parser = ["pax-std/parser", "pax-engine/parser", "dep:serde_json", "dep:pax-compiler", "dep:pax-manifest"] 32 | -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/unbeatable-pong/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /pax-generation/working-generated-projects/unbeatable-pong/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /pax-kit/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-kit" 3 | version = "0.38.3" 4 | edition = "2021" 5 | authors = ["Zack Brown ","Warfa Jibril ", "Samuel Selleck "] 6 | license = "MIT OR Apache-2.0" 7 | homepage = "https://pax.dev/" 8 | repository = "https://www.github.com/paxproject/pax" 9 | description = "Main entrypoint for building with Pax" 10 | 11 | [dependencies] 12 | pax-engine = { path = "../pax-engine", version = "0.38.3"} 13 | pax-designer = { path = "../pax-designer", version = "0.38.3", optional=true } 14 | pax-std = { path = "../pax-std", version = "0.38.3" } 15 | 16 | [features] 17 | gpu = ["pax-engine/gpu"] 18 | designer = ["dep:pax-designer", "pax-engine/designtime", "pax-designer?/designtime", "pax-std/designtime"] 19 | parser = ["pax-std/parser", "pax-designer?/parser"] 20 | web = ["pax-engine/web"] 21 | ios = ["pax-engine/ios"] 22 | macos = ["pax-engine/macos"] 23 | 24 | [profile.release] 25 | lto = true 26 | opt-level = "z" 27 | -------------------------------------------------------------------------------- /pax-kit/src/lib.rs: -------------------------------------------------------------------------------- 1 | //Reexport primary modules 2 | #[cfg(feature = "designer")] 3 | pub use pax_designer; 4 | pub use pax_engine; 5 | pub use pax_std; 6 | 7 | //Splat-export certain curated modules, for ergo 8 | pub use pax_engine::api::*; 9 | pub use pax_engine::*; 10 | pub use pax_std::*; 11 | -------------------------------------------------------------------------------- /pax-lang/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-lang" 3 | version = "0.38.3" 4 | authors = ["Zack Brown "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | homepage = "https://pax.dev/" 8 | repository = "https://www.github.com/paxproject/pax" 9 | description = "Pax language parser" 10 | 11 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 12 | 13 | [dependencies] 14 | pest = {version = "2.7.10", features = ["std"]} 15 | pest_derive = {version = "2.7.10", features = ["std"]} 16 | serde = { version="1.0.95", features=["derive"]} 17 | pax-runtime-api = {path="../pax-runtime-api", version="0.38.3"} 18 | log = "0.4.20" 19 | syn = { version = "1.0", features = ["full", "parsing", "visit"] } 20 | color-eyre = "0.6.2" 21 | proc-macro2 = { version = "1.0", features = ["span-locations"] } 22 | 23 | [profile.dev] 24 | debug = false 25 | -------------------------------------------------------------------------------- /pax-lang/src/deserializer/error.rs: -------------------------------------------------------------------------------- 1 | use std; 2 | use std::fmt::{self, Display}; 3 | 4 | use serde::{de, ser}; 5 | 6 | pub type Result = std::result::Result; 7 | 8 | #[derive(Debug, Clone)] 9 | pub enum Error { 10 | Message(String), 11 | UnsupportedType(String), 12 | } 13 | 14 | impl ser::Error for Error { 15 | fn custom(msg: T) -> Self { 16 | Error::Message(msg.to_string()) 17 | } 18 | } 19 | 20 | impl de::Error for Error { 21 | fn custom(msg: T) -> Self { 22 | Error::Message(msg.to_string()) 23 | } 24 | } 25 | 26 | impl Display for Error { 27 | fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 28 | match self { 29 | Error::Message(msg) => formatter.write_str(msg), 30 | Error::UnsupportedType(t) => { 31 | formatter.write_str(format!("unsupported type: {}", t).as_str()) 32 | } 33 | } 34 | } 35 | } 36 | 37 | impl std::error::Error for Error {} 38 | -------------------------------------------------------------------------------- /pax-manifest/src/constants.rs: -------------------------------------------------------------------------------- 1 | pub use pax_runtime_api::constants::*; 2 | pub const CARTRIDGE_PARTIAL_STRUCT_ID: &'static str = "Cartridge"; 3 | pub const DEFINITION_TO_INSTANCE_TRAVERSER_PARTIAL_STRUCT_ID: &'static str = 4 | "DefinitionToInstanceTraverser"; 5 | -------------------------------------------------------------------------------- /pax-manifest/templates/code_serialization/rust-file-serialization.tera: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_kit::*; 4 | 5 | #[pax] 6 | #[file("{{pax_path}}")] 7 | pub struct {{pascal_identifier}} {} -------------------------------------------------------------------------------- /pax-message/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-message" 3 | version = "0.38.3" 4 | edition = "2021" 5 | authors = ["Zack Brown "] 6 | license = "MIT OR Apache-2.0" 7 | homepage = "https://pax.dev/" 8 | repository = "https://www.github.com/paxproject/pax" 9 | description = "Shared message structs used by Pax runtimes" 10 | 11 | 12 | 13 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 14 | 15 | [dependencies] 16 | serde = {version = "1.0.159", features=["derive"] } 17 | wasm-bindgen = {version = "0.2.93", features=["serde-serialize"]} 18 | cfg-if = "1.0.0" -------------------------------------------------------------------------------- /pax-message/src/reflection.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pax-pixels/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /pax-pixels/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-pixels" 3 | version = "0.38.3" 4 | edition = "2021" 5 | authors = ["Samuel Selleck "] 6 | license = "MIT OR Apache-2.0" 7 | homepage = "https://pax.dev/" 8 | repository = "https://www.github.com/pax-lang/pax" 9 | description = "WGPU rendering library for the pax framework" 10 | 11 | [dependencies] 12 | pax-runtime-api = {path = "../pax-runtime-api", version="0.38.3"} 13 | log = "0.4.20" 14 | bytemuck = { version = "1.14", features = ["derive"] } 15 | anyhow = "1.0" 16 | lyon = "1.0.1" 17 | winit = "0.27.5" 18 | web-sys = "0.3.64" 19 | js-sys = "0.3.64" 20 | wasm-bindgen-futures = "0.4.38" 21 | 22 | [dependencies.wgpu] 23 | version = "22.1.0" 24 | features = [ 25 | "webgpu", # Required for WebGPU support 26 | # "webgl", # Optional: for WebGL fallback 27 | ] 28 | -------------------------------------------------------------------------------- /pax-pixels/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod render_backend; 2 | pub mod render_context; 3 | pub type Transform2D = lyon::geom::euclid::default::Transform2D; 4 | pub type Point2D = lyon::geom::euclid::default::Point2D; 5 | pub type Vector2D = lyon::geom::euclid::default::Vector2D; 6 | pub type Box2D = lyon::geom::Box2D; 7 | pub use lyon::geom::{point, Angle}; 8 | pub use lyon::path::builder::BorderRadii; 9 | pub use lyon::path::Path; 10 | pub use lyon::path::Winding; 11 | pub use render_backend::Image; 12 | pub use render_context::Color; 13 | pub use render_context::Fill; 14 | pub use render_context::GradientStop; 15 | pub use render_context::GradientType; 16 | pub use render_context::Stroke; 17 | pub use render_context::WgpuRenderer; 18 | -------------------------------------------------------------------------------- /pax-pixels/src/render_backend/gpu_resources.rs: -------------------------------------------------------------------------------- 1 | fn _create_multisampled_framebuffer( 2 | device: &wgpu::Device, 3 | desc: &wgpu::SurfaceConfiguration, 4 | sample_count: u32, 5 | ) -> wgpu::TextureView { 6 | let multisampled_frame_descriptor = &wgpu::TextureDescriptor { 7 | label: Some("Multisampled frame descriptor"), 8 | size: wgpu::Extent3d { 9 | width: desc.width, 10 | height: desc.height, 11 | depth_or_array_layers: 1, 12 | }, 13 | mip_level_count: 1, 14 | sample_count, 15 | dimension: wgpu::TextureDimension::D2, 16 | format: desc.format, 17 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT, 18 | view_formats: &[desc.format], 19 | }; 20 | 21 | device 22 | .create_texture(multisampled_frame_descriptor) 23 | .create_view(&wgpu::TextureViewDescriptor::default()) 24 | } 25 | -------------------------------------------------------------------------------- /pax-pixels/src/render_backend/stencil.wgsl: -------------------------------------------------------------------------------- 1 | struct Globals { 2 | resolution: vec2, 3 | dpr: u32, 4 | _pad2: u32, 5 | }; 6 | 7 | 8 | @group(0) @binding(0) var globals: Globals; 9 | 10 | struct VertexOutput { 11 | @builtin(position) clip_position: vec4, 12 | } 13 | 14 | @vertex 15 | fn vs_main( 16 | @location(0) position: vec2, 17 | ) -> VertexOutput { 18 | var out: VertexOutput; 19 | var pos = position; 20 | pos /= globals.resolution; 21 | pos *= 2.0; 22 | pos -= 1.0; 23 | pos.y *= -1.0; 24 | out.clip_position = vec4(pos, 0.0, 1.0); 25 | return out; 26 | } 27 | 28 | @fragment 29 | fn fs_main() -> @location(0) vec4 { 30 | return vec4(1.0, 1.0, 1.0, 1.0); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /pax-pixels/src/render_backend/web_backend.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pax-runtime-api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pax-runtime-api" 3 | version = "0.38.3" 4 | edition = "2021" 5 | authors = ["Zack Brown ", "Warfa Jibril ", "Samuel Selleck "] 6 | license = "MIT OR Apache-2.0" 7 | homepage = "https://pax.dev/" 8 | repository = "https://www.github.com/paxproject/pax" 9 | description = "Userland constructs used at the runtime API boundary of Pax Engine" 10 | 11 | 12 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 13 | 14 | [dependencies] 15 | serde = {version = "1.0.159", features=["derive"] } 16 | wasm-bindgen = {version = "0.2.93", features=["serde-serialize"]} 17 | kurbo = "0.11.1" 18 | piet = "0.7.0" 19 | slotmap = "1.0.7" 20 | pax-message = {version="0.38.3", path="../pax-message"} 21 | log = "0.4.20" 22 | paste = "1.0.15" 23 | once_cell = "1.19.0" 24 | -------------------------------------------------------------------------------- /pax-runtime-api/src/math.rs: -------------------------------------------------------------------------------- 1 | use std::ops::Mul; 2 | 3 | use kurbo::Affine; 4 | 5 | mod point; 6 | mod transform; 7 | mod vector; 8 | 9 | pub use point::Point2; 10 | pub use transform::Transform2; 11 | pub use transform::TransformParts; 12 | pub use vector::Vector2; 13 | 14 | pub trait Space: 'static {} 15 | 16 | pub struct Generic; 17 | 18 | impl Space for Generic {} 19 | 20 | // TODO remove after Affine not used 21 | impl Mul> for Affine { 22 | type Output = Point2; 23 | 24 | #[inline] 25 | fn mul(self, other: Point2) -> Point2 { 26 | let coeffs = self.as_coeffs(); 27 | Self::Output::new( 28 | coeffs[0] * other.x + coeffs[2] * other.y + coeffs[4], 29 | coeffs[1] * other.x + coeffs[3] * other.y + coeffs[5], 30 | ) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pax-runtime/src/form_event.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(debug_assertions, derive(Debug))] 2 | pub enum FormEvent { 3 | Toggle { state: bool }, 4 | } 5 | -------------------------------------------------------------------------------- /pax-runtime/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod api; 2 | pub mod cartridge; 3 | pub mod component; 4 | pub mod conditional; 5 | pub mod constants; 6 | pub mod engine; 7 | pub mod form_event; 8 | pub mod layout; 9 | pub mod properties; 10 | pub mod rendering; 11 | pub mod repeat; 12 | pub mod slot; 13 | 14 | pub use crate::cartridge::*; 15 | pub use crate::component::*; 16 | pub use crate::conditional::*; 17 | pub use crate::engine::*; 18 | pub use crate::layout::*; 19 | pub use crate::properties::*; 20 | pub use crate::rendering::*; 21 | pub use crate::repeat::*; 22 | pub use crate::slot::*; 23 | 24 | #[allow(unused)] 25 | pub static DEBUG_TEXT_GREEN_BACKGROUND: bool = false; 26 | -------------------------------------------------------------------------------- /pax-runtime/src/math.rs: -------------------------------------------------------------------------------- 1 | pub use pax_runtime_api::math::*; -------------------------------------------------------------------------------- /pax-runtime/tests/declarative_macro_tests.rs: -------------------------------------------------------------------------------- 1 | #[derive(Default, Debug, PartialEq)] 2 | struct Color { 3 | fill: String, 4 | } 5 | -------------------------------------------------------------------------------- /pax-std/src/common.rs: -------------------------------------------------------------------------------- 1 | pub use pax_engine::api::Size; 2 | use pax_engine::*; 3 | 4 | #[pax] 5 | #[engine_import_path("pax_engine")] 6 | #[derive(Copy)] 7 | pub struct Point { 8 | pub x: Size, 9 | pub y: Size, 10 | } 11 | 12 | impl Point { 13 | pub fn new(x: Size, y: Size) -> Self { 14 | Self { x, y } 15 | } 16 | 17 | pub fn to_kurbo_point(self, bounds: (f64, f64)) -> kurbo::Point { 18 | let x = self.x.evaluate(bounds, api::Axis::X); 19 | let y = self.y.evaluate(bounds, api::Axis::Y); 20 | kurbo::Point { x, y } 21 | } 22 | } 23 | 24 | pub fn patch_if_needed( 25 | old_state: &mut Option, 26 | patch: &mut Option, 27 | new_value: T, 28 | ) -> bool { 29 | if !old_state.as_ref().is_some_and(|v| v == &new_value) { 30 | *patch = Some(new_value.clone()); 31 | *old_state = Some(new_value); 32 | true 33 | } else { 34 | false 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /pax-std/src/core/blank.rs: -------------------------------------------------------------------------------- 1 | #[allow(unused)] 2 | use crate::*; 3 | use pax_engine::pax; 4 | /// A blank component, roughly an alias for , used in cases where 5 | /// a dummy or placeholder is needed (e.g. within designer) 6 | #[pax] 7 | #[engine_import_path("pax_engine")] 8 | #[inlined()] 9 | pub struct BlankComponent {} 10 | -------------------------------------------------------------------------------- /pax-std/src/core/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod blank; 2 | pub mod combo_box; 3 | pub mod event_blocker; 4 | pub mod frame; 5 | pub mod group; 6 | pub mod link; 7 | pub mod native_image; 8 | pub mod scrollbar; 9 | pub mod scroller; 10 | pub mod text; 11 | pub mod tooltip; 12 | 13 | pub mod youtube_video; 14 | 15 | //Only exposing inline_frame when designtime feature is enabled, 16 | //mostly as a safety measure to prevent it from being used in userland 17 | //(unless or until we want to support a specific use-case) 18 | #[cfg(feature = "designtime")] 19 | pub mod inline_frame; 20 | 21 | pub use blank::*; 22 | pub use combo_box::*; 23 | pub use event_blocker::*; 24 | pub use frame::*; 25 | pub use group::*; 26 | pub use link::*; 27 | pub use native_image::*; 28 | pub use scrollbar::*; 29 | pub use scroller::*; 30 | pub use text::*; 31 | pub use tooltip::*; 32 | pub use youtube_video::*; 33 | -------------------------------------------------------------------------------- /pax-std/src/drawing/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod ellipse; 2 | pub mod image; 3 | pub mod path; 4 | pub mod rectangle; 5 | 6 | pub use ellipse::*; 7 | pub use image::*; 8 | pub use path::*; 9 | pub use rectangle::*; 10 | -------------------------------------------------------------------------------- /pax-std/src/forms/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod button; 2 | pub mod checkbox; 3 | pub mod dialogs; 4 | pub mod dropdown; 5 | pub mod radio_set; 6 | pub mod slider; 7 | pub mod tabs; 8 | pub mod textbox; 9 | pub mod toast; 10 | 11 | pub use button::*; 12 | pub use checkbox::*; 13 | pub use dialogs::*; 14 | pub use dropdown::*; 15 | pub use radio_set::*; 16 | pub use slider::*; 17 | pub use tabs::*; 18 | pub use textbox::*; 19 | pub use toast::*; 20 | -------------------------------------------------------------------------------- /pax-std/src/layout/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod carousel; 2 | pub mod resizable; 3 | pub mod stacker; 4 | pub mod table; 5 | 6 | pub use carousel::*; 7 | pub use resizable::*; 8 | pub use stacker::*; 9 | pub use table::*; 10 | -------------------------------------------------------------------------------- /pax-std/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod common; 2 | pub mod core; 3 | pub mod drawing; 4 | pub mod forms; 5 | pub mod layout; 6 | 7 | pub use common::*; 8 | pub use core::*; 9 | pub use drawing::*; 10 | pub use forms::*; 11 | pub use layout::*; 12 | -------------------------------------------------------------------------------- /runtime-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/runtime-arch.png -------------------------------------------------------------------------------- /scripts/create-and-run-template.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | # Usage: this script will use the `pax create` command in `pax-cli` to 4 | # generate the template project (pax-compiler/new-project-template) into 5 | # the monorepo sandbox (pax-create-sandbox, which is .gitingored) and then 6 | # run the CLI's `pax run` in that repo. 7 | # This is intended to test the `pax create` flow, e.g. for iterating on the template project. 8 | 9 | # Expected current working directory: pax monorepo root 10 | set -e 11 | rm -rf ./pax-create-sandbox 12 | cargo build --manifest-path=pax-cli/Cargo.toml 13 | target/debug/pax-cli create ./pax-create-sandbox --libdev 14 | target/debug/pax-cli run --target=web --path=./pax-create-sandbox --libdev -------------------------------------------------------------------------------- /scripts/ga-snippet.partial.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | -------------------------------------------------------------------------------- /scripts/local_github_actions.sh: -------------------------------------------------------------------------------- 1 | cargo test --verbose --workspace --exclude pax-chassis-macos --exclude pax-chassis-common --exclude pax-chassis-ios 2 | cargo fmt -- --check 3 | cargo clippy -- -D warnings 4 | -------------------------------------------------------------------------------- /scripts/paxgen/README.md: -------------------------------------------------------------------------------- 1 | # Paxgen 2 | 3 | LLM prompt generator to create Pax UIs. 4 | 5 | This works by embedding parts of the Pax documentation into the 6 | prompt as one concatenated string, as well as examples in order 7 | to perform in-context learning. 8 | 9 | The way the parts of the documentation and examples are identified 10 | is by substring matching; this is obviously very brittle and would 11 | scale better if those were refactored to be LLM-native. It could be 12 | the case that we could just dump all docs and examples into context 13 | and it would work just as well. 14 | 15 | This last seemed to work well at the following commit on `pax-docs`: 16 | 17 | ``` 18 | commit c1cec6a3fa3b665d30cb9afafac7ac019aca84d9 19 | Author: Warfa Jibril 20 | Date: Wed May 22 17:53:57 2024 -0700 21 | 22 | added pax-cli to critical path 23 | ``` -------------------------------------------------------------------------------- /scripts/paxgen/paxgen/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paxdotdev/pax/ac2bc7296e1ec77e40ef8d026afcb524a0ccd930/scripts/paxgen/paxgen/__init__.py -------------------------------------------------------------------------------- /scripts/paxgen/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "paxgen" 3 | version = "0.1.0" 4 | description = "LLM prompt generator from the Pax documentation." 5 | authors = ["Your Name "] 6 | readme = "README.md" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.12" 10 | rich = "^13.7.1" 11 | tiktoken = "^0.7.0" 12 | 13 | [tool.poetry.scripts] 14 | generate = "paxgen.generate:main" 15 | 16 | [build-system] 17 | requires = ["poetry-core"] 18 | build-backend = "poetry.core.masonry.api" -------------------------------------------------------------------------------- /tests/create-test.sh: -------------------------------------------------------------------------------- 1 | read -p "Enter a name for the test: " NAME 2 | ../target/debug/pax-cli create "src/$NAME" --libdev 3 | -------------------------------------------------------------------------------- /tests/src/contextual-components/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "contextual-components" 3 | version = "0.15.2" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-engine = { version = "0.15.2" , path = ".pax/pkg/pax-engine" } 9 | pax-std = { version = "0.15.2" , path = ".pax/pkg/pax-std" } 10 | pax-compiler = { version = "0.15.2", optional = true, path = ".pax/pkg/pax-compiler" } 11 | pax-manifest = { version = "0.15.2", optional = true, path = ".pax/pkg/pax-manifest" } 12 | serde_json = {version = "1.0.95", optional = true} 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | parser = ["pax-std/parser", "pax-engine/parser", "dep:serde_json", "dep:pax-compiler", "dep:pax-manifest"] 25 | -------------------------------------------------------------------------------- /tests/src/contextual-components/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /tests/src/contextual-components/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /tests/src/contextual-components/src/lib.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | for i in 0..self.num { 4 | 5 | } 6 | 7 | 8 | @settings { 9 | @mount: on_mount 10 | @click: click 11 | } 12 | -------------------------------------------------------------------------------- /tests/src/contextual-components/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_engine::api::*; 4 | use pax_engine::*; 5 | use pax_std::*; 6 | pub mod contextual; 7 | pub use contextual::{ContextualChild, ContextualParent}; 8 | 9 | #[pax] 10 | #[main] 11 | #[file("lib.pax")] 12 | pub struct Example { 13 | pub num: Property, 14 | pub text: Property, 15 | } 16 | 17 | impl Example { 18 | pub fn on_mount(&mut self, ctx: &NodeContext) { 19 | self.num.set(1); 20 | self.text.set("hello".to_string()); 21 | } 22 | 23 | pub fn click(&mut self, ctx: &NodeContext, event: Event) { 24 | if event.mouse.x > 100.0 { 25 | log::info!("incrementing num"); 26 | self.num.set(self.num.get() + 1); 27 | } else { 28 | log::info!("adding to text"); 29 | self.text.set(self.text.get() + "O"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/src/custom-events/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "custom-events" 3 | version = "0.15.2" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-engine = { version = "0.15.2" , path = ".pax/pkg/pax-engine" } 9 | pax-std = { version = "0.15.2" , path = ".pax/pkg/pax-std" } 10 | pax-compiler = { version = "0.15.2", optional = true, path = ".pax/pkg/pax-compiler" } 11 | pax-manifest = { version = "0.15.2", optional = true, path = ".pax/pkg/pax-manifest" } 12 | serde_json = {version = "1.0.95", optional = true} 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | parser = ["pax-std/parser", "pax-engine/parser", "dep:serde_json", "dep:pax-compiler", "dep:pax-manifest"] 25 | -------------------------------------------------------------------------------- /tests/src/custom-events/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /tests/src/custom-events/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /tests/src/custom-events/src/inner_comp.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | @settings { 4 | @unmount: on_unmount 5 | } 6 | -------------------------------------------------------------------------------- /tests/src/custom-events/src/inner_comp.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use super::StoreExample; 4 | use pax_engine::api::*; 5 | use pax_engine::*; 6 | use pax_std::*; 7 | 8 | #[pax] 9 | #[main] 10 | #[file("inner_comp.pax")] 11 | pub struct InnerComp {} 12 | 13 | impl InnerComp { 14 | pub fn clicked(&mut self, ctx: &NodeContext, event: Event) { 15 | ctx.dispatch_event("custom_event").unwrap(); 16 | } 17 | 18 | pub fn on_unmount(&mut self, ctx: &NodeContext) { 19 | log::info!("unmounted!"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/src/custom-events/src/lib.pax: -------------------------------------------------------------------------------- 1 | if self.visible { 2 | 5 | } 6 | 7 | @settings { 8 | @mount: on_mount 9 | } 10 | -------------------------------------------------------------------------------- /tests/src/custom-events/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_engine::api::*; 4 | use pax_engine::*; 5 | use pax_std::*; 6 | pub mod inner_comp; 7 | pub use inner_comp::InnerComp; 8 | 9 | #[pax] 10 | #[main] 11 | #[file("lib.pax")] 12 | pub struct Example { 13 | pub visible: Property, 14 | } 15 | 16 | pub struct StoreExample { 17 | pub i: i32, 18 | } 19 | 20 | impl Store for StoreExample {} 21 | 22 | impl Example { 23 | pub fn on_mount(&mut self, ctx: &NodeContext) { 24 | self.visible.set(true); 25 | ctx.push_local_store(StoreExample { i: 42 }); 26 | } 27 | 28 | pub fn custom_event_trigger(&mut self, ctx: &NodeContext) { 29 | log::info!("custom event was triggered!"); 30 | self.visible.set(false); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/src/path-test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "playground" 3 | version = "0.15.1" 4 | edition = "2021" 5 | default-run = "run" 6 | 7 | [dependencies] 8 | pax-engine = { version = "0.15.1" , path = ".pax/pkg/pax-engine" } 9 | pax-std = { version = "0.15.1" , path = ".pax/pkg/pax-std" } 10 | pax-compiler = { version = "0.15.1", optional = true, path = ".pax/pkg/pax-compiler" } 11 | pax-manifest = { version = "0.15.1", optional = true, path = ".pax/pkg/pax-manifest" } 12 | serde_json = {version = "1.0.95", optional = true} 13 | 14 | [[bin]] 15 | name = "parser" 16 | path = "src/lib.rs" 17 | required-features = ["parser"] 18 | 19 | [[bin]] 20 | name = "run" 21 | path = "bin/run.rs" 22 | 23 | [features] 24 | parser = ["pax-std/parser", "pax-engine/parser", "dep:serde_json", "dep:pax-compiler", "dep:pax-manifest"] 25 | -------------------------------------------------------------------------------- /tests/src/path-test/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /tests/src/path-test/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /tests/src/path-test/src/lib.pax: -------------------------------------------------------------------------------- 1 | 2 | 3 | if self.jump { 4 | 5 | 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | @settings { 15 | @click: self.toggle 16 | } 17 | -------------------------------------------------------------------------------- /tests/src/path-test/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | use pax_engine::api::*; 4 | use pax_engine::*; 5 | use pax_std::*; 6 | 7 | #[pax] 8 | #[main] 9 | #[file("lib.pax")] 10 | pub struct Example { 11 | pub jump: Property, 12 | } 13 | 14 | impl Example { 15 | pub fn toggle(&mut self, ctx: &NodeContext, _event: Event) { 16 | log::info!("toggle skip"); 17 | self.jump.set(!self.jump.get()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/src/playground/bin/run.rs: -------------------------------------------------------------------------------- 1 | use std::process::Command; 2 | use std::env; 3 | 4 | fn main() { 5 | let args: Vec = env::args().skip(1).collect(); 6 | 7 | let pax_args = { 8 | let mut extended_args = vec!["run"]; 9 | extended_args.extend(args.iter().map(|arg| arg.as_str())); 10 | extended_args 11 | }; 12 | 13 | let current_dir = env::current_dir().expect("Failed to get current directory"); 14 | 15 | let status = Command::new("./pax") 16 | .args(&pax_args) 17 | .current_dir(current_dir) 18 | .status() 19 | .expect("Failed to execute pax-cli"); 20 | 21 | std::process::exit(status.code().unwrap_or(1)); 22 | } -------------------------------------------------------------------------------- /tests/src/playground/pax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Helper script for pax libdev, allowing pax-cli-like ergonomics inside the pax-example directory 4 | ### 5 | ### For example, from @/pax root: 6 | ### `cd pax-example && ./pax run --target=macos` 7 | ### `cd pax-example && ./pax parse` 8 | ### `cd pax-example && ./pax libdev build-chassis` 9 | 10 | set -e 11 | current_dir=$(pwd) 12 | pushd ../../../pax-cli 13 | cargo build 14 | PAX_WORKSPACE_ROOT=.. ../target/debug/pax-cli "$@" --path="$current_dir" --libdev 15 | popd 16 | -------------------------------------------------------------------------------- /tests/src/playground/src/lib.pax: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------