pythonnative 0.38.0__tar.gz → 0.40.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pythonnative-0.40.0/MANIFEST.in +11 -0
- {pythonnative-0.38.0/src/pythonnative.egg-info → pythonnative-0.40.0}/PKG-INFO +16 -6
- {pythonnative-0.38.0 → pythonnative-0.40.0}/README.md +15 -5
- {pythonnative-0.38.0 → pythonnative-0.40.0}/pyproject.toml +12 -4
- pythonnative-0.40.0/setup.py +19 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/__init__.py +2 -3
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/alerts.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/animated.py +45 -21
- pythonnative-0.40.0/src/pythonnative/animation_graph.py +78 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/bootstrap.py +22 -12
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/bridge/__init__.py +74 -78
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/bridge/android.py +2 -2
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/bridge/codec.py +7 -1
- pythonnative-0.40.0/src/pythonnative/bridge/commits.py +114 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/bridge/fake.py +20 -13
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/bridge/ios.py +5 -5
- pythonnative-0.40.0/src/pythonnative/bridge/web.py +489 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/cli/pn.py +358 -329
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/component.py +17 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/__init__.py +6 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/_base.py +3 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/controls.py +9 -6
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/lists.py +122 -146
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/text.py +3 -3
- pythonnative-0.40.0/src/pythonnative/devclient.py +824 -0
- pythonnative-0.40.0/src/pythonnative/devserver/__init__.py +34 -0
- pythonnative-0.40.0/src/pythonnative/devserver/server.py +718 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/animation_graph.js +82 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/bridge.js +147 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/colors.js +70 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/host.js +552 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/index.html +60 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/layout.js +85 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/preview.css +415 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/renderer.js +1994 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/shell.js +345 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/LICENSE +21 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/binaries/yoga-wasm-base64-esm.js +75 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/generated/YGEnums.d.ts +189 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/generated/YGEnums.js +211 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/generated/YGEnums.js.map +1 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/index.d.ts +12 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/index.js +16 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/index.js.map +1 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/load.d.ts +11 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/load.js +17 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/load.js.map +1 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/wrapAssembly.d.ts +155 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/wrapAssembly.js +125 -0
- pythonnative-0.40.0/src/pythonnative/devserver/static/yoga/src/wrapAssembly.js.map +1 -0
- pythonnative-0.40.0/src/pythonnative/devserver/watcher.py +267 -0
- pythonnative-0.40.0/src/pythonnative/devserver/ws.py +421 -0
- pythonnative-0.40.0/src/pythonnative/equality.py +19 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/events.py +17 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/gestures.py +31 -9
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/hooks.py +76 -54
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/hosts/__init__.py +20 -19
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/hosts/base.py +46 -115
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/hosts/native.py +24 -70
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/hot_reload.py +227 -287
- pythonnative-0.40.0/src/pythonnative/layout.py +328 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/build.gradle +4 -0
- pythonnative-0.40.0/src/pythonnative/native/android/gradle.properties +3 -0
- pythonnative-0.40.0/src/pythonnative/native/android/settings.gradle +12 -0
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/cpp/CMakeLists.txt +9 -0
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/cpp/yoga_jni.cpp +52 -0
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/generated/NativeModules.kt +5 -0
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/generated/NativeProps.kt +3705 -0
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/generated/PNContracts.kt +129 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/PNBridge.kt +61 -14
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/runtime/animation/AnimationGraph.kt +108 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/animation/PNAnimator.kt +11 -3
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/CommitState.kt +106 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/bridge/MainThread.kt +8 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/bridge/TransactionApplier.kt +3 -1
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/BuiltinComponents.kt +2 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ButtonManager.kt +0 -1
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/DatePickerManager.kt +2 -2
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ImageManager.kt +6 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/PickerManager.kt +0 -1
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ScreenStackManager.kt +110 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/TextInputManager.kt +6 -1
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/VirtualListManager.kt +159 -0
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/runtime/layout/NativeLayout.kt +145 -0
- pythonnative-0.40.0/src/pythonnative/native/android/src/main/java/com/pythonnative/runtime/layout/YogaNode.kt +29 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/HostModule.kt +5 -41
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/NativeModule.kt +26 -3
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/screens/PNScreenFragment.kt +13 -48
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/test/java/com/pythonnative/runtime/PromiseTest.kt +14 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Package.swift +2 -0
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Animation/PNAnimationGraph.swift +199 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Animation/PNAnimator.swift +11 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Bridge/PNBridge.swift +81 -17
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Bridge/PNCommit.swift +104 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Bridge/PNRegistry.swift +2 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Bridge/PNTransaction.swift +5 -4
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNButtonManagers.swift +3 -2
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNControlManagers.swift +7 -7
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNImageManager.swift +1 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNPressableManager.swift +2 -2
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Components/PNScreenStackManager.swift +107 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNTextInputManager.swift +9 -1
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Components/PNVirtualListManager.swift +155 -0
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Generated/NativeModules.swift +1 -0
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Generated/NativeProps.swift +3775 -0
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Generated/PNContracts.swift +46 -0
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Layout/PNLayout.swift +173 -0
- pythonnative-0.40.0/src/pythonnative/native/ios/Sources/PythonNativeKit/Modules/HostModule.swift +80 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Modules/PNNativeModule.swift +44 -1
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Screens/PNViewController.swift +10 -24
- pythonnative-0.40.0/src/pythonnative/native/ios/Tests/PythonNativeKitTests/PNAnimationGraphTests.swift +26 -0
- pythonnative-0.40.0/src/pythonnative/native/ios/Tests/PythonNativeKitTests/PNCommitTests.swift +86 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Tests/PythonNativeKitTests/PNManagerTests.swift +8 -6
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Tests/PythonNativeKitTests/PNModuleTests.swift +13 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/LICENSE +21 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/Package.swift +9 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/VENDORED.md +2 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/PNStyle.h +10 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/module.modulemap +5 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGConfig.h +158 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGEnums.h +142 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGMacros.h +99 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGNode.h +304 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGNodeLayout.h +35 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGNodeStyle.h +130 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGPixelGrid.h +29 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/YGValue.h +84 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/include/yoga/Yoga.h +21 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/python.cpp +16 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/style.cpp +272 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/CMakeLists.txt +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGConfig.cpp +92 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGConfig.h +158 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGEnums.cpp +262 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGEnums.h +142 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGMacros.h +99 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGNode.cpp +366 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGNode.h +304 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGNodeLayout.cpp +92 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGNodeLayout.h +35 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGNodeStyle.cpp +405 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGNodeStyle.h +130 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGPixelGrid.cpp +22 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGPixelGrid.h +29 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGValue.cpp +20 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/YGValue.h +84 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/Yoga.h +21 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/AbsoluteLayout.cpp +563 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/AbsoluteLayout.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/Align.h +72 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/Baseline.cpp +78 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/Baseline.h +21 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/BoundAxis.h +79 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/Cache.cpp +121 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/Cache.h +30 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/CalculateLayout.cpp +2428 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/CalculateLayout.h +38 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/FlexDirection.h +120 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/FlexLine.cpp +124 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/FlexLine.h +75 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/PixelGrid.cpp +132 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/PixelGrid.h +29 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/SizingMode.h +73 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/algorithm/TrailingPosition.h +44 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/config/Config.cpp +135 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/config/Config.h +92 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/debug/AssertFatal.cpp +53 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/debug/AssertFatal.h +29 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/debug/Log.cpp +107 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/debug/Log.h +34 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Align.h +47 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/BoxSizing.h +40 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Dimension.h +40 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Direction.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Display.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Edge.h +47 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Errata.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/ExperimentalFeature.h +39 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/FlexDirection.h +42 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Gutter.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Justify.h +44 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/LogLevel.h +44 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/MeasureMode.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/NodeType.h +40 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Overflow.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/PhysicalEdge.h +21 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/PositionType.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Unit.h +42 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/Wrap.h +41 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/enums/YogaEnums.h +85 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/event/event.cpp +87 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/event/event.h +130 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/module.modulemap +21 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/node/CachedMeasurement.h +53 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/node/LayoutResults.cpp +48 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/node/LayoutResults.h +122 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/node/LayoutableChildren.h +148 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/node/Node.cpp +443 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/node/Node.h +337 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/numeric/Comparison.h +81 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/numeric/FloatOptional.h +93 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/style/SmallValueBuffer.h +133 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/style/Style.h +757 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/style/StyleLength.h +107 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/style/StyleValueHandle.h +98 -0
- pythonnative-0.40.0/src/pythonnative/native/yoga/yoga/style/StyleValuePool.h +127 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/__init__.py +6 -4
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/biometrics.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/camera.py +1 -1
- pythonnative-0.38.0/src/pythonnative/native_modules/desktop.py → pythonnative-0.40.0/src/pythonnative/native_modules/fallback.py +42 -40
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/file_system.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/haptics.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/linking.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/notifications.py +2 -2
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/registry.py +20 -7
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/secure_store.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/share.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_views/__init__.py +18 -23
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_views/base.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_views/bridge_backend.py +95 -82
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/handle.py +3 -36
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/navigators.py +28 -6
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/screen.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/platform.py +21 -20
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/platform_metrics.py +1 -1
- pythonnative-0.40.0/src/pythonnative/preview.py +287 -0
- pythonnative-0.40.0/src/pythonnative/profiling.py +101 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/android.py +20 -5
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/builder.py +116 -7
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/config.py +2 -2
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/deps.py +20 -4
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/doctor.py +0 -20
- pythonnative-0.40.0/src/pythonnative/project/fingerprint.py +171 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/ios.py +6 -0
- pythonnative-0.40.0/src/pythonnative/project/lockfile.py +100 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/plugins.py +155 -2
- pythonnative-0.40.0/src/pythonnative/query.py +153 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/reconciler/boundaries.py +10 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/reconciler/core.py +104 -92
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/reconciler/layout_pass.py +36 -2
- pythonnative-0.40.0/src/pythonnative/refresh.py +55 -0
- pythonnative-0.40.0/src/pythonnative/runtime.py +306 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/sdk/__init__.py +13 -6
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/sdk/_components.py +31 -12
- pythonnative-0.40.0/src/pythonnative/sdk/builtins.py +91 -0
- pythonnative-0.40.0/src/pythonnative/sdk/codegen.py +149 -0
- pythonnative-0.40.0/src/pythonnative/sdk/module_codegen.py +184 -0
- pythonnative-0.40.0/src/pythonnative/sdk/schema.py +224 -0
- pythonnative-0.40.0/src/pythonnative/sdk/templates/contracts.kt +46 -0
- pythonnative-0.40.0/src/pythonnative/sdk/templates/contracts.swift +46 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/storage.py +2 -2
- pythonnative-0.40.0/src/pythonnative/suspense.py +183 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/build.gradle +6 -0
- pythonnative-0.40.0/src/pythonnative/templates/android_template/app/src/debug/AndroidManifest.xml +7 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +5 -2
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +0 -3
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/ViewController.swift +1 -7
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/testing/backend.py +1 -1
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/testing/harness.py +7 -29
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/utils.py +39 -31
- {pythonnative-0.38.0 → pythonnative-0.40.0/src/pythonnative.egg-info}/PKG-INFO +16 -6
- pythonnative-0.40.0/src/pythonnative.egg-info/SOURCES.txt +468 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_bridge.py +47 -59
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_cli.py +130 -61
- pythonnative-0.40.0/tests/test_codegen.py +26 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_components.py +2 -2
- pythonnative-0.40.0/tests/test_devclient.py +333 -0
- pythonnative-0.40.0/tests/test_devserver.py +334 -0
- pythonnative-0.40.0/tests/test_devserver_ws.py +104 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_gestures.py +2 -2
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_hosts.py +6 -5
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_hot_reload.py +171 -169
- pythonnative-0.40.0/tests/test_inbox.py +85 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_layout.py +29 -23
- pythonnative-0.40.0/tests/test_native_lists.py +86 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_native_modules.py +15 -15
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_navigation.py +19 -31
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_runtime.py +5 -5
- pythonnative-0.40.0/tests/test_runtime_contracts.py +297 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_sdk.py +10 -10
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_storage.py +3 -3
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_suspense.py +8 -106
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_utils.py +1 -1
- pythonnative-0.40.0/tests/test_web_transport.py +422 -0
- pythonnative-0.38.0/src/pythonnative/hosts/desktop.py +0 -107
- pythonnative-0.38.0/src/pythonnative/images.py +0 -197
- pythonnative-0.38.0/src/pythonnative/layout.py +0 -1603
- pythonnative-0.38.0/src/pythonnative/native_views/desktop.py +0 -2356
- pythonnative-0.38.0/src/pythonnative/preview.py +0 -540
- pythonnative-0.38.0/src/pythonnative/runtime.py +0 -536
- pythonnative-0.38.0/src/pythonnative/suspense.py +0 -413
- pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/components/VirtualListManager.kt +0 -179
- pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/screens/Navigator.kt +0 -116
- pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative/src/main/java/com/pythonnative/runtime/views/PNVirtualListView.java +0 -169
- pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Components/PNVirtualListManager.swift +0 -257
- pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit/Sources/PythonNativeKit/Modules/HostModule.swift +0 -158
- pythonnative-0.38.0/src/pythonnative/virtual_rows.py +0 -127
- pythonnative-0.38.0/src/pythonnative.egg-info/SOURCES.txt +0 -310
- pythonnative-0.38.0/tests/test_desktop_backend.py +0 -523
- pythonnative-0.38.0/tests/test_images.py +0 -145
- pythonnative-0.38.0/tests/test_native_lists.py +0 -330
- {pythonnative-0.38.0 → pythonnative-0.40.0}/LICENSE +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/setup.cfg +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/_ios_log.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/appearance.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/cli/__init__.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/layout.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/media.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/overlays.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/pressable.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/components/structural.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/diagnostics.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/element.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/mutations.py +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/AndroidManifest.xml +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/PythonHost.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/animation/AnimationSpecs.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/bridge/JsonUtil.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/bridge/PNLog.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/bridge/PNRegistry.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/bridge/PNTransaction.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/bridge/ViewRegistry.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ComponentManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ContainerManagers.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ControlManagers.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ImageLoader.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ModalManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/PNColor.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/PortalManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/PressableManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ScrollViewManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/SegmentedControlManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/StatusBarManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/TabBarManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/TextManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/ViewStyler.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/components/WebViewManager.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/gestures/GestureArbiter.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/gestures/GestureCoordinator.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/gestures/GestureRecognizers.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/BuiltinModules.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/DeviceModules.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/MediaModules.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/NotificationsModule.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/PermissionsModule.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/StorageModules.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/modules/SystemModules.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/plugins/GeneratedPlugins.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/screens/ScreenRegistry.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/views/PNAccessibilityDelegate.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/views/PNBorderDrawable.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/views/PNEditText.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/main/java/com/pythonnative/runtime/views/PNFrameLayout.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/test/java/com/pythonnative/runtime/AnimationSpecsTest.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/test/java/com/pythonnative/runtime/GestureArbiterTest.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/test/java/com/pythonnative/runtime/PNColorTest.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/android_template/pythonnative → pythonnative-0.40.0/src/pythonnative/native/android}/src/test/java/com/pythonnative/runtime/PNTransactionTest.kt +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Bridge/PNViewRegistry.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNColor.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNComponentManager.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNContainerView.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNOverlayManagers.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNScrollViewManager.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNTabBarManager.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNTextManager.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNTransform.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNViewManager.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNViewState.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNViewStyler.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Components/PNWebViewManager.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Gestures/PNGestureCoordinator.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Modules/AlertModule.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Modules/LifecycleModules.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Modules/MediaModules.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Modules/PermissionModules.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Modules/SystemModules.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Plugins/PNPluginRegistration.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Screens/PNScreenRegistry.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Support/PNCompat.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Support/PNJSON.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Support/PNLog.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Sources/PythonNativeKit/Support/PNWindow.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Tests/PythonNativeKitTests/PNColorTests.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Tests/PythonNativeKitTests/PNGestureTests.swift +0 -0
- {pythonnative-0.38.0/src/pythonnative/templates/ios_template/PythonNativeKit → pythonnative-0.40.0/src/pythonnative/native/ios}/Tests/PythonNativeKitTests/PNTransactionTests.swift +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/app_state.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/battery.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/clipboard.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/location.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/net_info.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/native_modules/permissions.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/__init__.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/container.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/hooks.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/host.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/linking.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/navigation/state.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/net.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/__init__.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/devices.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/icons.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/permissions.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/project/runtime_assets.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/py.typed +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/reconciler/__init__.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/reconciler/children.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/reconciler/vnode.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/scheduler.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/style.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/proguard-rules.pro +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/androidTest/java/com/pythonnative/android_template/ExampleInstrumentedTest.kt +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/AndroidManifest.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable/ic_launcher_background.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/layout/activity_main.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/navigation/nav_graph.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/values/colors.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/values/strings.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/values/themes.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/values-night/themes.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/backup_rules.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/data_extraction_rules.xml +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/app/src/test/java/com/pythonnative/android_template/ExampleUnitTest.kt +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/build.gradle +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.jar +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.properties +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/gradle.properties +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/gradlew +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/gradlew.bat +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/android_template/settings.gradle +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/AppDelegate.swift +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AccentColor.colorset/Contents.json +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/Contents.json +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/LaunchScreen.storyboard +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/BridgingHeader.h +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/Info.plist +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/PythonRuntime.swift +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template/SceneDelegate.swift +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.pbxproj +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_templateTests/ios_templateTests.swift +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITests.swift +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunchTests.swift +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative/testing/__init__.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative.egg-info/dependency_links.txt +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative.egg-info/entry_points.txt +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative.egg-info/requires.txt +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/src/pythonnative.egg-info/top_level.txt +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_alert.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_animated.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_animated_graph.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_appearance.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_async_hooks.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_core_semantics.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_element.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_events.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_extended_components.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_gesture_composition.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_hooks.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_incremental_render.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_interaction_props.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_ios_log.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_metric_hooks.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_mutations.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_native_views.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_net.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_new_components.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_platform.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_platform_metrics.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_reconciler.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_ref.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_smoke.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_style.py +0 -0
- {pythonnative-0.38.0 → pythonnative-0.40.0}/tests/test_transitions.py +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
global-exclude *.pyc *.pyo .DS_Store
|
|
2
|
+
recursive-exclude src/pythonnative/native .build/* .gradle/* .cxx/* build/* .swiftpm/* .kotlin/*
|
|
3
|
+
prune src/pythonnative/native/android/build
|
|
4
|
+
prune src/pythonnative/native/android/.gradle
|
|
5
|
+
prune src/pythonnative/native/android/.cxx
|
|
6
|
+
prune src/pythonnative/native/ios/.build
|
|
7
|
+
prune src/pythonnative/native/ios/.swiftpm
|
|
8
|
+
prune src/pythonnative/native/yoga/.build
|
|
9
|
+
prune src/pythonnative/templates/android_template/app/build
|
|
10
|
+
prune src/pythonnative/templates/android_template/.gradle
|
|
11
|
+
prune src/pythonnative/templates/ios_template/build
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonnative
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.40.0
|
|
4
4
|
Summary: Cross-platform native UI toolkit for Android and iOS
|
|
5
5
|
Author: Owen Carey
|
|
6
6
|
License: MIT License
|
|
@@ -82,20 +82,20 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
82
82
|
- **Device APIs:** Cross-platform modules for `Camera`, `Location`, `FileSystem`, `Notifications`, `Clipboard`, `Share`, `Linking`, `Permissions`, `AppState`, `NetInfo`, `SecureStore`, `Battery`, `Haptics` / `Vibration`, and `Biometrics`, plus reactive `use_app_state` and `use_net_info` hooks.
|
|
83
83
|
- **Hooks and function components:** Manage state with `use_state`, side effects with `use_effect` / `use_layout_effect`, refs and imperative handles with `use_ref` / `use_imperative_handle`, and navigation with `use_navigation`, all through one consistent pattern. Components can return a single element, a list of siblings, or `None`, and `Fragment`, `Portal`, and reactive `Provider` context work the way they do in React.
|
|
84
84
|
- **Async-first rendering:** One `asyncio` event loop runs the whole framework on the platform's main thread. Components can be `async def` and `await` data directly in the body; `Suspense` boundaries show declarative loading states while they wait. `use_resource` fetches during render, `use_effect` accepts coroutine callbacks (cancelled automatically on unmount), `lazy` code-splits components, and `use_transition` / `use_deferred_value` keep the UI responsive during expensive updates.
|
|
85
|
-
- **Developer feedback that finds your bugs:** In dev mode (`pn preview`,
|
|
85
|
+
- **Developer feedback that finds your bugs:** In dev mode (`pn start`, `pn preview`, debug builds from `pn run`, or `PN_DEV=1`), uncaught errors from renders, effects, and event handlers show a full-screen RedBox with the traceback; unknown style keys and duplicate list keys print "did you mean" warnings; and conditional hooks raise a `HookOrderError` at the source instead of silently cross-wiring state.
|
|
86
86
|
- **Typed `style` prop and theme:** Pass all visual and layout properties through a single `style` dict, fully described by the `pn.Style` `TypedDict` and the ergonomic `pn.style(...)` helper for IDE autocomplete and static checking. Compose reusable styles with `StyleSheet`, and read design tokens from a typed, immutable `pn.Theme` via `use_theme()` that follows light and dark mode by default.
|
|
87
87
|
- **Cross-platform flexbox engine:** A pure-Python, Yoga-style layout engine computes frames once and applies them to native views, so `flex`, `padding`, `aspect_ratio`, and `position: "absolute"` produce the same geometry on Android and iOS.
|
|
88
88
|
- **Virtual view tree + reconciler:** Element trees are diffed and patched with minimal native mutations, similar to React's reconciliation. Each commit lands as **one batched transaction** of mutation ops, and event callbacks are routed through a tag-based registry so re-renders that only change closures cost zero native calls. State updates re-render **locally**: only the component whose state changed (and its subtree) re-runs, and unchanged leaves reuse cached intrinsic measurements, so deep UIs stay responsive instead of re-rendering the whole app from the root on every tap.
|
|
89
89
|
- **Native-driven animations:** The `Animated` API (timing / spring / decay / loop / stagger, awaitable or fire-and-forget) hands animations to Core Animation and `ViewPropertyAnimator` whenever possible, so no Python code runs per frame; a pure-Python ticker covers the rest. `interpolate`, arithmetic operators on animated nodes, `Animated.event` scroll binding, and `diff_clamp` cover the scroll-driven patterns (collapsing headers, parallax) that define native feel.
|
|
90
|
-
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Fling`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop, backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and
|
|
90
|
+
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Fling`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop, backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and in the browser preview. Compose them with `Race`, `Exclusive`, and `Simultaneous` for cross-gesture arbitration (single vs. double tap, drag vs. long press).
|
|
91
91
|
- **Virtualized lists:** `FlatList` / `SectionList` window their rows in Python over the platform scroll view: uniform, exact, or measured variable heights, grids, headers/footers, infinite scroll, and an imperative scroll controller, identical on every platform.
|
|
92
92
|
- **Native rendering core:** each commit is one serialized transaction applied by Swift and Kotlin component managers, the same shape as React Native's Fabric. Device APIs are native modules registered by name (TurboModules-style), callable from thin Python facades.
|
|
93
93
|
- **Custom-component SDK:** Wrap any platform widget as a first-class element with type-checked props via `pythonnative.sdk` (`Props`, `@native_component`, `element_factory`). Plugins distributed on PyPI auto-register through the `pythonnative.handlers` entry-point group.
|
|
94
|
-
- **
|
|
94
|
+
- **Metro-style dev loop:** `pn start` runs one dev server that serves the browser preview and every connected debug build. Save a file and each client Fast Refreshes in place, keeping component state; their `print` output and tracebacks stream back into the same terminal. `pn run android` / `pn run ios` bakes the server URL into a debug build and rebuilds the native project only when a native input actually changed, so relaunching after a Python edit takes seconds, not minutes.
|
|
95
95
|
- **PyPI packages, binary wheels included:** List requirements in `pythonnative.toml` and the CLI resolves them for the *device* (iOS wheels via PEP 730 and BeeWare's index, Android wheels via PEP 738 and Chaquopy), bundling numpy, Pillow, cryptography, and friends alongside pure-Python packages. `pn deps` reports what each target resolves to before you build, and a weekly-checked compatibility matrix keeps the docs honest.
|
|
96
|
-
- **
|
|
96
|
+
- **Browser preview:** `pn preview` renders your app in a browser tab inside a phone frame (pick a device, rotate, toggle dark mode) with Fast Refresh on every save. The page is a bridge peer exactly like the Swift and Kotlin runtimes, so the reconciler, hooks, layout engine, navigation, and screen host are the same code that ships to the phone; only the leaf widgets are DOM elements.
|
|
97
97
|
- **Native-backed navigation:** Declarative `Stack`, `Tab`, and `Drawer` navigators inspired by React Navigation. The root stack drives the platform's native navigation controller (`UINavigationController` on iOS, AndroidX Navigation Component on Android), so transitions, back gestures, and the hardware back button match what users expect; `use_back_handler` intercepts the back action when a screen needs to.
|
|
98
|
-
- **
|
|
98
|
+
- **Dev client:** Build a shell app once with `pn run ios --dev-client` and point it at any project's dev server from a connect screen, the way Expo Go does; physical phones on the same Wi-Fi get the same Fast Refresh as simulators.
|
|
99
99
|
- **Bundled templates:** Android Gradle and iOS Xcode templates are included, so scaffolding requires no network access.
|
|
100
100
|
|
|
101
101
|
## Quick Start
|
|
@@ -127,6 +127,16 @@ def App():
|
|
|
127
127
|
)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
+
### Develop
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pn init my-app && cd my-app
|
|
134
|
+
pn preview # dev server + browser preview with Fast Refresh
|
|
135
|
+
pn run ios # in another terminal: debug build that connects to the same server
|
|
136
|
+
pn run android
|
|
137
|
+
pn build ios # standalone release artifacts
|
|
138
|
+
```
|
|
139
|
+
|
|
130
140
|
## Documentation
|
|
131
141
|
|
|
132
142
|
Visit [pythonnative.com](https://pythonnative.com/) for the full documentation, including getting started guides, platform-specific instructions for Android and iOS, API reference, and working examples.
|
|
@@ -35,20 +35,20 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
35
35
|
- **Device APIs:** Cross-platform modules for `Camera`, `Location`, `FileSystem`, `Notifications`, `Clipboard`, `Share`, `Linking`, `Permissions`, `AppState`, `NetInfo`, `SecureStore`, `Battery`, `Haptics` / `Vibration`, and `Biometrics`, plus reactive `use_app_state` and `use_net_info` hooks.
|
|
36
36
|
- **Hooks and function components:** Manage state with `use_state`, side effects with `use_effect` / `use_layout_effect`, refs and imperative handles with `use_ref` / `use_imperative_handle`, and navigation with `use_navigation`, all through one consistent pattern. Components can return a single element, a list of siblings, or `None`, and `Fragment`, `Portal`, and reactive `Provider` context work the way they do in React.
|
|
37
37
|
- **Async-first rendering:** One `asyncio` event loop runs the whole framework on the platform's main thread. Components can be `async def` and `await` data directly in the body; `Suspense` boundaries show declarative loading states while they wait. `use_resource` fetches during render, `use_effect` accepts coroutine callbacks (cancelled automatically on unmount), `lazy` code-splits components, and `use_transition` / `use_deferred_value` keep the UI responsive during expensive updates.
|
|
38
|
-
- **Developer feedback that finds your bugs:** In dev mode (`pn preview`,
|
|
38
|
+
- **Developer feedback that finds your bugs:** In dev mode (`pn start`, `pn preview`, debug builds from `pn run`, or `PN_DEV=1`), uncaught errors from renders, effects, and event handlers show a full-screen RedBox with the traceback; unknown style keys and duplicate list keys print "did you mean" warnings; and conditional hooks raise a `HookOrderError` at the source instead of silently cross-wiring state.
|
|
39
39
|
- **Typed `style` prop and theme:** Pass all visual and layout properties through a single `style` dict, fully described by the `pn.Style` `TypedDict` and the ergonomic `pn.style(...)` helper for IDE autocomplete and static checking. Compose reusable styles with `StyleSheet`, and read design tokens from a typed, immutable `pn.Theme` via `use_theme()` that follows light and dark mode by default.
|
|
40
40
|
- **Cross-platform flexbox engine:** A pure-Python, Yoga-style layout engine computes frames once and applies them to native views, so `flex`, `padding`, `aspect_ratio`, and `position: "absolute"` produce the same geometry on Android and iOS.
|
|
41
41
|
- **Virtual view tree + reconciler:** Element trees are diffed and patched with minimal native mutations, similar to React's reconciliation. Each commit lands as **one batched transaction** of mutation ops, and event callbacks are routed through a tag-based registry so re-renders that only change closures cost zero native calls. State updates re-render **locally**: only the component whose state changed (and its subtree) re-runs, and unchanged leaves reuse cached intrinsic measurements, so deep UIs stay responsive instead of re-rendering the whole app from the root on every tap.
|
|
42
42
|
- **Native-driven animations:** The `Animated` API (timing / spring / decay / loop / stagger, awaitable or fire-and-forget) hands animations to Core Animation and `ViewPropertyAnimator` whenever possible, so no Python code runs per frame; a pure-Python ticker covers the rest. `interpolate`, arithmetic operators on animated nodes, `Animated.event` scroll binding, and `diff_clamp` cover the scroll-driven patterns (collapsing headers, parallax) that define native feel.
|
|
43
|
-
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Fling`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop, backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and
|
|
43
|
+
- **Native gesture system:** Attach `Tap`, `LongPress`, `Pan`, `Swipe`, `Fling`, `Pinch`, and `Rotation` recognizers to any view via the `gestures=` prop, backed by `UIGestureRecognizer` on iOS and a unit-testable pure-Python arbiter on Android and in the browser preview. Compose them with `Race`, `Exclusive`, and `Simultaneous` for cross-gesture arbitration (single vs. double tap, drag vs. long press).
|
|
44
44
|
- **Virtualized lists:** `FlatList` / `SectionList` window their rows in Python over the platform scroll view: uniform, exact, or measured variable heights, grids, headers/footers, infinite scroll, and an imperative scroll controller, identical on every platform.
|
|
45
45
|
- **Native rendering core:** each commit is one serialized transaction applied by Swift and Kotlin component managers, the same shape as React Native's Fabric. Device APIs are native modules registered by name (TurboModules-style), callable from thin Python facades.
|
|
46
46
|
- **Custom-component SDK:** Wrap any platform widget as a first-class element with type-checked props via `pythonnative.sdk` (`Props`, `@native_component`, `element_factory`). Plugins distributed on PyPI auto-register through the `pythonnative.handlers` entry-point group.
|
|
47
|
-
- **
|
|
47
|
+
- **Metro-style dev loop:** `pn start` runs one dev server that serves the browser preview and every connected debug build. Save a file and each client Fast Refreshes in place, keeping component state; their `print` output and tracebacks stream back into the same terminal. `pn run android` / `pn run ios` bakes the server URL into a debug build and rebuilds the native project only when a native input actually changed, so relaunching after a Python edit takes seconds, not minutes.
|
|
48
48
|
- **PyPI packages, binary wheels included:** List requirements in `pythonnative.toml` and the CLI resolves them for the *device* (iOS wheels via PEP 730 and BeeWare's index, Android wheels via PEP 738 and Chaquopy), bundling numpy, Pillow, cryptography, and friends alongside pure-Python packages. `pn deps` reports what each target resolves to before you build, and a weekly-checked compatibility matrix keeps the docs honest.
|
|
49
|
-
- **
|
|
49
|
+
- **Browser preview:** `pn preview` renders your app in a browser tab inside a phone frame (pick a device, rotate, toggle dark mode) with Fast Refresh on every save. The page is a bridge peer exactly like the Swift and Kotlin runtimes, so the reconciler, hooks, layout engine, navigation, and screen host are the same code that ships to the phone; only the leaf widgets are DOM elements.
|
|
50
50
|
- **Native-backed navigation:** Declarative `Stack`, `Tab`, and `Drawer` navigators inspired by React Navigation. The root stack drives the platform's native navigation controller (`UINavigationController` on iOS, AndroidX Navigation Component on Android), so transitions, back gestures, and the hardware back button match what users expect; `use_back_handler` intercepts the back action when a screen needs to.
|
|
51
|
-
- **
|
|
51
|
+
- **Dev client:** Build a shell app once with `pn run ios --dev-client` and point it at any project's dev server from a connect screen, the way Expo Go does; physical phones on the same Wi-Fi get the same Fast Refresh as simulators.
|
|
52
52
|
- **Bundled templates:** Android Gradle and iOS Xcode templates are included, so scaffolding requires no network access.
|
|
53
53
|
|
|
54
54
|
## Quick Start
|
|
@@ -80,6 +80,16 @@ def App():
|
|
|
80
80
|
)
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
### Develop
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pn init my-app && cd my-app
|
|
87
|
+
pn preview # dev server + browser preview with Fast Refresh
|
|
88
|
+
pn run ios # in another terminal: debug build that connects to the same server
|
|
89
|
+
pn run android
|
|
90
|
+
pn build ios # standalone release artifacts
|
|
91
|
+
```
|
|
92
|
+
|
|
83
93
|
## Documentation
|
|
84
94
|
|
|
85
95
|
Visit [pythonnative.com](https://pythonnative.com/) for the full documentation, including getting started guides, platform-specific instructions for Android and iOS, API reference, and working examples.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonnative"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.40.0"
|
|
8
8
|
description = "Cross-platform native UI toolkit for Android and iOS"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Owen Carey" }
|
|
@@ -88,11 +88,20 @@ where = ["src"]
|
|
|
88
88
|
[tool.setuptools]
|
|
89
89
|
license-files = ["LICENSE*"]
|
|
90
90
|
|
|
91
|
-
# Include template directories
|
|
91
|
+
# Include template directories and the browser preview's page assets inside
|
|
92
|
+
# the package so importlib.resources can find them
|
|
92
93
|
[tool.setuptools.package-data]
|
|
93
94
|
pythonnative = [
|
|
94
95
|
"py.typed",
|
|
95
|
-
"templates/**",
|
|
96
|
+
"templates/**", "native/**", "sdk/templates/**",
|
|
97
|
+
"devserver/static/**",
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
[tool.setuptools.exclude-package-data]
|
|
101
|
+
pythonnative = [
|
|
102
|
+
"**/build/**", "**/.build/**", "**/.gradle/**",
|
|
103
|
+
"**/.cxx/**", "**/.swiftpm/**", "**/.kotlin/**",
|
|
104
|
+
"**/__pycache__/**", "**/.DS_Store",
|
|
96
105
|
]
|
|
97
106
|
|
|
98
107
|
[tool.ruff]
|
|
@@ -127,7 +136,6 @@ ignore = ["D107", "D105", "D203", "D213"]
|
|
|
127
136
|
# docstrings would only add boilerplate that repeats the ABC.
|
|
128
137
|
"src/pythonnative/native_views/android.py" = ["D101", "D102"]
|
|
129
138
|
"src/pythonnative/native_views/ios.py" = ["D101", "D102"]
|
|
130
|
-
"src/pythonnative/native_views/desktop.py" = ["D101", "D102"]
|
|
131
139
|
# ios.py embeds a LaunchScreen storyboard as an XML string literal whose
|
|
132
140
|
# lines exceed the limit; the XML must stay on single lines for Xcode.
|
|
133
141
|
"src/pythonnative/project/ios.py" = ["E501"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Build the host Yoga binding; mobile hosts compile the vendored core."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from setuptools import Extension, setup
|
|
7
|
+
|
|
8
|
+
root = Path("src/pythonnative/native/yoga")
|
|
9
|
+
setup(
|
|
10
|
+
ext_modules=[
|
|
11
|
+
Extension(
|
|
12
|
+
"pythonnative._yoga",
|
|
13
|
+
sources=[str(root / "python.cpp"), *map(str, sorted((root / "yoga").rglob("*.cpp")))],
|
|
14
|
+
include_dirs=[str(root)],
|
|
15
|
+
language="c++",
|
|
16
|
+
extra_compile_args=["/std:c++20"] if os.name == "nt" else ["-std=c++20"],
|
|
17
|
+
)
|
|
18
|
+
]
|
|
19
|
+
)
|
|
@@ -62,9 +62,9 @@ Example:
|
|
|
62
62
|
```
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
|
-
__version__ = "0.
|
|
65
|
+
__version__ = "0.40.0"
|
|
66
66
|
|
|
67
|
-
from . import appearance, diagnostics, gestures,
|
|
67
|
+
from . import appearance, diagnostics, gestures, runtime, sdk
|
|
68
68
|
from .alerts import Alert
|
|
69
69
|
from .animated import Animated, AnimatedValue, use_animated_value
|
|
70
70
|
from .component import Component, component, memo
|
|
@@ -348,7 +348,6 @@ __all__ = [
|
|
|
348
348
|
# Appearance
|
|
349
349
|
"appearance",
|
|
350
350
|
# Image pipeline
|
|
351
|
-
"images",
|
|
352
351
|
# Animation
|
|
353
352
|
"Animated",
|
|
354
353
|
"AnimatedValue",
|
|
@@ -52,7 +52,7 @@ async def _present(
|
|
|
52
52
|
"default"|"cancel"|"destructive"}`` dicts. The module resolves with
|
|
53
53
|
the index the user picked, or ``-1`` if the dialog was dismissed
|
|
54
54
|
without a selection. Off device the
|
|
55
|
-
[`
|
|
55
|
+
[`FallbackAlert`][pythonnative.native_modules.fallback.FallbackAlert]
|
|
56
56
|
implementation records the call and answers from the queue set by
|
|
57
57
|
[`Alert.set_test_response`][pythonnative.alerts.Alert.set_test_response].
|
|
58
58
|
"""
|
|
@@ -40,7 +40,7 @@ native view the value is attached to
|
|
|
40
40
|
callback when the animation settles, updates the
|
|
41
41
|
[`AnimatedValue`][pythonnative.animated.AnimatedValue], and resolves
|
|
42
42
|
any awaiting tasks.
|
|
43
|
-
- **Declined** (
|
|
43
|
+
- **Declined** (unattached values, callable easings,
|
|
44
44
|
values feeding Python-side listeners or derived nodes): a single
|
|
45
45
|
background thread ticks the animation at ~60 Hz from Python, pushing
|
|
46
46
|
each frame through ``set_animated_property``. Semantics are
|
|
@@ -85,7 +85,7 @@ import weakref
|
|
|
85
85
|
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
|
|
86
86
|
|
|
87
87
|
from .element import Element
|
|
88
|
-
from .hooks import use_effect, use_ref
|
|
88
|
+
from .hooks import Ref, use_effect, use_ref
|
|
89
89
|
from .runtime import resolve_future
|
|
90
90
|
from .style import StyleProp, resolve_style
|
|
91
91
|
|
|
@@ -243,12 +243,17 @@ class AnimatedNode:
|
|
|
243
243
|
except Exception:
|
|
244
244
|
pass
|
|
245
245
|
|
|
246
|
+
from .animation_graph import install
|
|
247
|
+
|
|
248
|
+
install(self)
|
|
249
|
+
|
|
246
250
|
def _detach() -> None:
|
|
247
251
|
with self._lock:
|
|
248
252
|
try:
|
|
249
253
|
self._attachments.remove(binding)
|
|
250
254
|
except ValueError:
|
|
251
255
|
pass
|
|
256
|
+
install(self, detached_tag=tag)
|
|
252
257
|
|
|
253
258
|
return _detach
|
|
254
259
|
|
|
@@ -404,6 +409,12 @@ class AnimatedValue(AnimatedNode):
|
|
|
404
409
|
def set_value(self, new_value: float) -> None:
|
|
405
410
|
"""Set the value immediately, pushing to native views and listeners."""
|
|
406
411
|
self._apply(float(new_value), push_native=True)
|
|
412
|
+
from .animation_graph import install
|
|
413
|
+
|
|
414
|
+
graph = install(self)
|
|
415
|
+
if graph and graph["bindings"]:
|
|
416
|
+
backend = _backend()
|
|
417
|
+
backend.set_animated_property(graph["bindings"][0][0], f"_pn_graph:{id(self)}", float(new_value))
|
|
407
418
|
|
|
408
419
|
def _apply(self, new_value: float, push_native: bool) -> None:
|
|
409
420
|
with self._lock:
|
|
@@ -695,7 +706,12 @@ class AnimatedEvent:
|
|
|
695
706
|
if raw is None:
|
|
696
707
|
continue
|
|
697
708
|
try:
|
|
698
|
-
|
|
709
|
+
if getattr(_backend(), "install_animation_graph", None) is not None:
|
|
710
|
+
# Native already evaluated the graph at the input timestamp.
|
|
711
|
+
# Python observes the sample without echoing an older frame.
|
|
712
|
+
node._value = float(raw)
|
|
713
|
+
else:
|
|
714
|
+
node.set_value(float(raw))
|
|
699
715
|
except (TypeError, ValueError):
|
|
700
716
|
continue
|
|
701
717
|
if self._listener is not None:
|
|
@@ -1041,21 +1057,21 @@ def _start_native(value: AnimatedValue, spec: Dict[str, Any]) -> Optional[_Nativ
|
|
|
1041
1057
|
animation; otherwise rolls back any accepted targets and returns
|
|
1042
1058
|
``None`` so the caller falls back to the Python ticker.
|
|
1043
1059
|
"""
|
|
1044
|
-
targets = value.attachments()
|
|
1045
|
-
if not targets:
|
|
1046
|
-
return None
|
|
1047
|
-
if value.has_listeners():
|
|
1048
|
-
# Python listeners want per-frame values; only the ticker
|
|
1049
|
-
# provides those.
|
|
1050
|
-
return None
|
|
1051
|
-
if value._has_dependents():
|
|
1052
|
-
# Derived nodes (interpolations, arithmetic) need per-frame
|
|
1053
|
-
# Python evaluation to keep their own attachments in sync.
|
|
1054
|
-
return None
|
|
1055
1060
|
try:
|
|
1056
1061
|
backend = _backend()
|
|
1057
1062
|
except Exception:
|
|
1058
1063
|
return None
|
|
1064
|
+
from .animation_graph import install
|
|
1065
|
+
|
|
1066
|
+
graph = install(value)
|
|
1067
|
+
if graph and graph["bindings"]:
|
|
1068
|
+
targets = [(graph["bindings"][0][0], f"_pn_graph:{id(value)}")]
|
|
1069
|
+
else:
|
|
1070
|
+
targets = value.attachments()
|
|
1071
|
+
if value._has_dependents():
|
|
1072
|
+
return None
|
|
1073
|
+
if not targets or value.has_listeners():
|
|
1074
|
+
return None
|
|
1059
1075
|
|
|
1060
1076
|
group = _NativeAnimationGroup(value, _projected_final_value(spec))
|
|
1061
1077
|
accepted: List[Tuple[int, int]] = [] # (anim_id, tag)
|
|
@@ -1368,24 +1384,32 @@ def _make_animated_factory(
|
|
|
1368
1384
|
plain_style, bindings = _resolve_style_with_values(style)
|
|
1369
1385
|
|
|
1370
1386
|
ref = use_ref(None)
|
|
1387
|
+
attached: Ref[List[Callable[[], None]]] = use_ref([])
|
|
1371
1388
|
|
|
1372
|
-
def _attach_bindings() ->
|
|
1389
|
+
def _attach_bindings() -> None:
|
|
1373
1390
|
tag = ref._pn_tag
|
|
1374
1391
|
if tag is None:
|
|
1375
|
-
return
|
|
1392
|
+
return
|
|
1393
|
+
# Derived nodes can be rebuilt on every render. Install their new
|
|
1394
|
+
# bindings before releasing the old ones so a running native graph
|
|
1395
|
+
# never temporarily loses every owner.
|
|
1376
1396
|
detachers = [value.attach(tag, _animated_prop_name(prop)) for prop, value in bindings.items()]
|
|
1397
|
+
previous = attached.current
|
|
1398
|
+
attached.current = detachers
|
|
1399
|
+
for detach in previous:
|
|
1400
|
+
detach()
|
|
1377
1401
|
|
|
1402
|
+
def _unmount_bindings() -> Callable[[], None]:
|
|
1378
1403
|
def _cleanup() -> None:
|
|
1379
|
-
for
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
except Exception:
|
|
1383
|
-
pass
|
|
1404
|
+
for detach in attached.current:
|
|
1405
|
+
detach()
|
|
1406
|
+
attached.current = []
|
|
1384
1407
|
|
|
1385
1408
|
return _cleanup
|
|
1386
1409
|
|
|
1387
1410
|
# Re-attach whenever the binding set changes identity.
|
|
1388
1411
|
use_effect(_attach_bindings, [tuple(sorted((k, id(v)) for k, v in bindings.items()))])
|
|
1412
|
+
use_effect(_unmount_bindings, [])
|
|
1389
1413
|
|
|
1390
1414
|
if element_type == "Text":
|
|
1391
1415
|
text = children[0] if children else kwargs.pop("text", "")
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Portable animation expressions evaluated by the native UI thread."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def serialize(root: Any) -> dict[str, Any]:
|
|
9
|
+
"""Serialize one connected animation graph in dependency order."""
|
|
10
|
+
from .animated import AnimatedInterpolation, AnimatedNode, AnimatedValue, _AnimatedDiffClamp, _AnimatedOperation
|
|
11
|
+
|
|
12
|
+
connected: dict[int, Any] = {}
|
|
13
|
+
|
|
14
|
+
def discover(node: Any) -> None:
|
|
15
|
+
if not isinstance(node, AnimatedNode) or id(node) in connected:
|
|
16
|
+
return
|
|
17
|
+
connected[id(node)] = node
|
|
18
|
+
for child in list(node._children):
|
|
19
|
+
discover(child)
|
|
20
|
+
for parent in getattr(node, "_parents", [getattr(node, "_parent", None)]):
|
|
21
|
+
discover(parent)
|
|
22
|
+
|
|
23
|
+
discover(root)
|
|
24
|
+
encoded: dict[int, dict[str, Any]] = {}
|
|
25
|
+
|
|
26
|
+
def encode(node: Any) -> Any:
|
|
27
|
+
if not isinstance(node, AnimatedNode):
|
|
28
|
+
return {"constant": float(node)}
|
|
29
|
+
identity = id(node)
|
|
30
|
+
if identity not in encoded:
|
|
31
|
+
definition: dict[str, Any] = {"id": identity}
|
|
32
|
+
if isinstance(node, AnimatedValue):
|
|
33
|
+
definition.update(kind="value", value=node.value)
|
|
34
|
+
elif isinstance(node, AnimatedInterpolation):
|
|
35
|
+
definition.update(
|
|
36
|
+
kind="interpolate",
|
|
37
|
+
inputs=[encode(node._parent)],
|
|
38
|
+
ranges=node._inputs,
|
|
39
|
+
outputs=node._outputs,
|
|
40
|
+
color=node._kind == "color",
|
|
41
|
+
left=node._left,
|
|
42
|
+
right=node._right,
|
|
43
|
+
)
|
|
44
|
+
elif isinstance(node, _AnimatedOperation):
|
|
45
|
+
definition.update(kind=node._op, inputs=[encode(parent) for parent in node._parents])
|
|
46
|
+
elif isinstance(node, _AnimatedDiffClamp):
|
|
47
|
+
definition.update(
|
|
48
|
+
kind="diff_clamp",
|
|
49
|
+
inputs=[encode(node._parent)],
|
|
50
|
+
minimum=node._min,
|
|
51
|
+
maximum=node._max,
|
|
52
|
+
previous=node._last_input,
|
|
53
|
+
value=node.value,
|
|
54
|
+
)
|
|
55
|
+
else:
|
|
56
|
+
raise TypeError(f"Unsupported animated node {type(node).__name__}")
|
|
57
|
+
encoded[identity] = definition
|
|
58
|
+
return {"node": identity}
|
|
59
|
+
|
|
60
|
+
for node in connected.values():
|
|
61
|
+
encode(node)
|
|
62
|
+
bindings = [[tag, prop, id(node)] for node in connected.values() for tag, prop in node.attachments()]
|
|
63
|
+
return {"id": min(connected), "nodes": list(encoded.values()), "bindings": bindings}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def install(node: Any, *, detached_tag: int | None = None) -> dict[str, Any] | None:
|
|
67
|
+
"""Synchronize native graph ownership when a binding is attached or removed."""
|
|
68
|
+
from .animated import _backend
|
|
69
|
+
|
|
70
|
+
backend = _backend()
|
|
71
|
+
handler = getattr(backend, "install_animation_graph", None)
|
|
72
|
+
if handler is None:
|
|
73
|
+
return None
|
|
74
|
+
graph = serialize(node)
|
|
75
|
+
tag = graph["bindings"][0][0] if graph["bindings"] else detached_tag
|
|
76
|
+
if tag is not None:
|
|
77
|
+
handler(tag, graph)
|
|
78
|
+
return graph
|
|
@@ -8,9 +8,10 @@ import pythonnative.bootstrap; pythonnative.bootstrap.start()
|
|
|
8
8
|
|
|
9
9
|
[`start`][pythonnative.bootstrap.start] connects the two halves of the
|
|
10
10
|
bridge (installing the native -> Python callback on iOS), verifies the
|
|
11
|
-
protocol version, routes ``print()`` to the console on iOS,
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
protocol version, routes ``print()`` to the console on iOS, warms the
|
|
12
|
+
asyncio runtime, and, in debug builds, starts the dev client that syncs
|
|
13
|
+
sources from ``pn start``. From then on the native runtime drives
|
|
14
|
+
everything through ``callback("host", ...)``; see ``docs/concepts/bridge.md``.
|
|
14
15
|
"""
|
|
15
16
|
|
|
16
17
|
from __future__ import annotations
|
|
@@ -29,14 +30,14 @@ def start(dev: bool = False, strict: bool = False) -> Dict[str, Any]:
|
|
|
29
30
|
"""Connect the bridge and prepare the runtime.
|
|
30
31
|
|
|
31
32
|
Args:
|
|
32
|
-
dev: Enable dev mode (RedBox, validation warnings
|
|
33
|
-
templates pass ``True
|
|
33
|
+
dev: Enable dev mode (RedBox, validation warnings, the dev
|
|
34
|
+
client). Debug templates pass ``True``.
|
|
34
35
|
strict: Re-raise the failure after recording it. The templates
|
|
35
36
|
pass ``True`` so a broken bridge surfaces as a bootstrap
|
|
36
37
|
error screen with the full traceback.
|
|
37
38
|
|
|
38
39
|
Returns:
|
|
39
|
-
A status dict (``{"protocol":
|
|
40
|
+
A status dict (``{"protocol": 2, "platform": "ios"}``) that the
|
|
40
41
|
template logs. Unless ``strict`` is set this never raises:
|
|
41
42
|
failures are printed and reported in the dict under
|
|
42
43
|
``"error"``.
|
|
@@ -56,23 +57,32 @@ def start(dev: bool = False, strict: bool = False) -> Dict[str, Any]:
|
|
|
56
57
|
_ios_log.install()
|
|
57
58
|
except Exception:
|
|
58
59
|
pass
|
|
60
|
+
from .runtime import start as start_runtime
|
|
61
|
+
|
|
62
|
+
start_runtime()
|
|
63
|
+
from .sdk.schema import load_bundled_contracts
|
|
64
|
+
|
|
65
|
+
load_bundled_contracts()
|
|
59
66
|
from . import bridge
|
|
60
67
|
|
|
61
68
|
status_["protocol"] = bridge.handshake()
|
|
62
|
-
|
|
69
|
+
dev_mode = bool(dev or os.environ.get("PN_DEV") in ("1", "true"))
|
|
70
|
+
if dev_mode:
|
|
63
71
|
from . import diagnostics
|
|
64
72
|
|
|
65
73
|
diagnostics.set_dev_mode(True)
|
|
66
|
-
# Create the guest loop now so the first pump request has a
|
|
67
|
-
# loop to drive and effects can schedule work during mount.
|
|
68
|
-
from .runtime import get_loop
|
|
69
|
-
|
|
70
|
-
get_loop()
|
|
71
74
|
# Import the view backend eagerly: on a slow device the first
|
|
72
75
|
# commit shouldn't also pay for importing the reconciler.
|
|
73
76
|
from .native_views import get_registry
|
|
74
77
|
|
|
75
78
|
get_registry()
|
|
79
|
+
if dev_mode:
|
|
80
|
+
# Debug builds are dev clients: connect to `pn start` when
|
|
81
|
+
# the build (or a remembered connection) names a server.
|
|
82
|
+
from . import devclient
|
|
83
|
+
|
|
84
|
+
client = devclient.start_if_configured()
|
|
85
|
+
status_["dev_server"] = client.url if client is not None else None
|
|
76
86
|
except Exception as exc:
|
|
77
87
|
status_["error"] = f"{type(exc).__name__}: {exc}"
|
|
78
88
|
print(f"[pn.bootstrap] start failed: {exc!r}", file=sys.stderr)
|