pythonnative 0.15.0__tar.gz → 0.16.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.15.0/src/pythonnative.egg-info → pythonnative-0.16.0}/PKG-INFO +1 -1
- {pythonnative-0.15.0 → pythonnative-0.16.0}/pyproject.toml +2 -1
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/__init__.py +44 -2
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/animated.py +38 -0
- pythonnative-0.16.0/src/pythonnative/components.py +1515 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/hooks.py +74 -20
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_views/android.py +96 -3
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_views/base.py +3 -92
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_views/ios.py +121 -2
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/reconciler.py +123 -14
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/sdk/__init__.py +1 -2
- {pythonnative-0.15.0 → pythonnative-0.16.0/src/pythonnative.egg-info}/PKG-INFO +1 -1
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_animated.py +78 -1
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_components.py +34 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_hooks.py +113 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_native_views.py +0 -59
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_new_components.py +21 -16
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_reconciler.py +62 -0
- pythonnative-0.15.0/src/pythonnative/components.py +0 -1223
- {pythonnative-0.15.0 → pythonnative-0.16.0}/LICENSE +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/README.md +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/setup.cfg +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/_ios_log.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/alerts.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/cli/__init__.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/cli/pn.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/element.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/hot_reload.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/layout.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_modules/__init__.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_modules/camera.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_modules/file_system.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_modules/location.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_modules/notifications.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/native_views/__init__.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/navigation.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/platform.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/platform_metrics.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/screen.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/sdk/_components.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/style.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/build.gradle +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/proguard-rules.pro +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/androidTest/java/com/pythonnative/android_template/ExampleInstrumentedTest.kt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/AndroidManifest.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/Navigator.kt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/PNVirtualListView.java +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable/ic_launcher_background.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/layout/activity_main.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/navigation/nav_graph.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/values/colors.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/values/strings.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/values/themes.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/values-night/themes.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/backup_rules.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/data_extraction_rules.xml +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/app/src/test/java/com/pythonnative/android_template/ExampleUnitTest.kt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/build.gradle +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.jar +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.properties +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/gradle.properties +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/gradlew +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/gradlew.bat +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/android_template/settings.gradle +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/AppDelegate.swift +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AccentColor.colorset/Contents.json +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/Contents.json +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/LaunchScreen.storyboard +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/Main.storyboard +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/Info.plist +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/SceneDelegate.swift +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template/ViewController.swift +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.pbxproj +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_templateTests/ios_templateTests.swift +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITests.swift +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunchTests.swift +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative/utils.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative.egg-info/SOURCES.txt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative.egg-info/dependency_links.txt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative.egg-info/entry_points.txt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative.egg-info/requires.txt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/src/pythonnative.egg-info/top_level.txt +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_alert.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_cli.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_element.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_hot_reload.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_ios_log.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_layout.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_metric_hooks.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_navigation.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_platform.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_platform_metrics.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_ref.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_screen.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_sdk.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_smoke.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_style.py +0 -0
- {pythonnative-0.15.0 → pythonnative-0.16.0}/tests/test_utils.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonnative"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.16.0"
|
|
8
8
|
description = "Cross-platform native UI toolkit for Android and iOS"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Owen Carey" }
|
|
@@ -65,6 +65,7 @@ Documentation = "https://docs.pythonnative.com/"
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
|
|
68
|
+
|
|
68
69
|
[tool.setuptools.packages.find]
|
|
69
70
|
where = ["src"]
|
|
70
71
|
|
|
@@ -51,36 +51,55 @@ Example:
|
|
|
51
51
|
```
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
__version__ = "0.
|
|
54
|
+
__version__ = "0.16.0"
|
|
55
55
|
|
|
56
56
|
from . import sdk
|
|
57
57
|
from .alerts import Alert
|
|
58
|
-
from .animated import Animated, AnimatedValue
|
|
58
|
+
from .animated import Animated, AnimatedValue, use_animated_value
|
|
59
59
|
from .components import (
|
|
60
60
|
ActivityIndicator,
|
|
61
|
+
ActivityIndicatorProps,
|
|
61
62
|
Button,
|
|
63
|
+
ButtonProps,
|
|
62
64
|
Column,
|
|
63
65
|
ErrorBoundary,
|
|
64
66
|
FlatList,
|
|
67
|
+
Fragment,
|
|
65
68
|
Image,
|
|
69
|
+
ImageProps,
|
|
66
70
|
KeyboardAvoidingView,
|
|
71
|
+
KeyboardAvoidingViewProps,
|
|
67
72
|
Modal,
|
|
73
|
+
ModalProps,
|
|
68
74
|
Picker,
|
|
75
|
+
PickerProps,
|
|
69
76
|
Pressable,
|
|
77
|
+
PressableProps,
|
|
70
78
|
ProgressBar,
|
|
79
|
+
ProgressBarProps,
|
|
71
80
|
RefreshControl,
|
|
72
81
|
Row,
|
|
73
82
|
SafeAreaView,
|
|
83
|
+
SafeAreaViewProps,
|
|
74
84
|
ScrollView,
|
|
85
|
+
ScrollViewProps,
|
|
75
86
|
SectionList,
|
|
76
87
|
Slider,
|
|
88
|
+
SliderProps,
|
|
77
89
|
Spacer,
|
|
90
|
+
SpacerProps,
|
|
78
91
|
StatusBar,
|
|
92
|
+
StatusBarProps,
|
|
79
93
|
Switch,
|
|
94
|
+
SwitchProps,
|
|
80
95
|
Text,
|
|
81
96
|
TextInput,
|
|
97
|
+
TextInputProps,
|
|
98
|
+
TextProps,
|
|
82
99
|
View,
|
|
100
|
+
ViewProps,
|
|
83
101
|
WebView,
|
|
102
|
+
WebViewProps,
|
|
84
103
|
)
|
|
85
104
|
from .element import Element
|
|
86
105
|
from .hooks import (
|
|
@@ -88,6 +107,7 @@ from .hooks import (
|
|
|
88
107
|
batch_updates,
|
|
89
108
|
component,
|
|
90
109
|
create_context,
|
|
110
|
+
memo,
|
|
91
111
|
use_callback,
|
|
92
112
|
use_context,
|
|
93
113
|
use_effect,
|
|
@@ -152,6 +172,7 @@ __all__ = [
|
|
|
152
172
|
"Column",
|
|
153
173
|
"ErrorBoundary",
|
|
154
174
|
"FlatList",
|
|
175
|
+
"Fragment",
|
|
155
176
|
"Image",
|
|
156
177
|
"KeyboardAvoidingView",
|
|
157
178
|
"Modal",
|
|
@@ -171,6 +192,25 @@ __all__ = [
|
|
|
171
192
|
"TextInput",
|
|
172
193
|
"View",
|
|
173
194
|
"WebView",
|
|
195
|
+
# Built-in Props dataclasses
|
|
196
|
+
"ActivityIndicatorProps",
|
|
197
|
+
"ButtonProps",
|
|
198
|
+
"ImageProps",
|
|
199
|
+
"KeyboardAvoidingViewProps",
|
|
200
|
+
"ModalProps",
|
|
201
|
+
"PickerProps",
|
|
202
|
+
"PressableProps",
|
|
203
|
+
"ProgressBarProps",
|
|
204
|
+
"SafeAreaViewProps",
|
|
205
|
+
"ScrollViewProps",
|
|
206
|
+
"SliderProps",
|
|
207
|
+
"SpacerProps",
|
|
208
|
+
"StatusBarProps",
|
|
209
|
+
"SwitchProps",
|
|
210
|
+
"TextInputProps",
|
|
211
|
+
"TextProps",
|
|
212
|
+
"ViewProps",
|
|
213
|
+
"WebViewProps",
|
|
174
214
|
# Core
|
|
175
215
|
"Element",
|
|
176
216
|
"create_screen",
|
|
@@ -178,6 +218,7 @@ __all__ = [
|
|
|
178
218
|
"batch_updates",
|
|
179
219
|
"component",
|
|
180
220
|
"create_context",
|
|
221
|
+
"memo",
|
|
181
222
|
"use_callback",
|
|
182
223
|
"use_context",
|
|
183
224
|
"use_effect",
|
|
@@ -225,6 +266,7 @@ __all__ = [
|
|
|
225
266
|
# Animation
|
|
226
267
|
"Animated",
|
|
227
268
|
"AnimatedValue",
|
|
269
|
+
"use_animated_value",
|
|
228
270
|
# Imperative
|
|
229
271
|
"Alert",
|
|
230
272
|
# Native modules
|
|
@@ -661,7 +661,45 @@ class _AnimatedNamespace:
|
|
|
661
661
|
Animated = _AnimatedNamespace()
|
|
662
662
|
|
|
663
663
|
|
|
664
|
+
def use_animated_value(initial: float = 0.0) -> AnimatedValue:
|
|
665
|
+
"""Return an [`AnimatedValue`][pythonnative.AnimatedValue] with a stable identity across renders.
|
|
666
|
+
|
|
667
|
+
Convenience wrapper for the common pattern
|
|
668
|
+
``pn.use_memo(lambda: AnimatedValue(initial), [])``. The same
|
|
669
|
+
instance is returned on every render of the same component, so
|
|
670
|
+
you can drive it from event handlers without recreating it.
|
|
671
|
+
|
|
672
|
+
Args:
|
|
673
|
+
initial: The starting numeric value.
|
|
674
|
+
|
|
675
|
+
Returns:
|
|
676
|
+
A mount-stable [`AnimatedValue`][pythonnative.AnimatedValue].
|
|
677
|
+
|
|
678
|
+
Example:
|
|
679
|
+
```python
|
|
680
|
+
import pythonnative as pn
|
|
681
|
+
|
|
682
|
+
@pn.component
|
|
683
|
+
def FadeIn():
|
|
684
|
+
opacity = pn.use_animated_value(0.0)
|
|
685
|
+
|
|
686
|
+
def fade_in():
|
|
687
|
+
pn.Animated.timing(opacity, to=1.0, duration=300).start()
|
|
688
|
+
|
|
689
|
+
pn.use_effect(lambda: fade_in(), [])
|
|
690
|
+
return pn.Animated.View(
|
|
691
|
+
pn.Text("Hello"),
|
|
692
|
+
style=pn.style(opacity=opacity),
|
|
693
|
+
)
|
|
694
|
+
```
|
|
695
|
+
"""
|
|
696
|
+
from .hooks import use_memo
|
|
697
|
+
|
|
698
|
+
return use_memo(lambda: AnimatedValue(initial), [])
|
|
699
|
+
|
|
700
|
+
|
|
664
701
|
__all__ = [
|
|
665
702
|
"AnimatedValue",
|
|
666
703
|
"Animated",
|
|
704
|
+
"use_animated_value",
|
|
667
705
|
]
|