reflex 0.6.5a2__py3-none-any.whl → 0.6.6__py3-none-any.whl
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.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/web/utils/state.js +39 -14
- reflex/__init__.py +3 -1
- reflex/__init__.pyi +3 -0
- reflex/app.py +24 -4
- reflex/assets.py +95 -0
- reflex/base.py +2 -2
- reflex/components/base/error_boundary.py +99 -36
- reflex/components/base/error_boundary.pyi +3 -4
- reflex/components/component.py +29 -7
- reflex/components/core/cond.py +8 -0
- reflex/components/core/upload.py +8 -5
- reflex/components/datadisplay/code.py +1 -1
- reflex/components/datadisplay/logo.py +26 -13
- reflex/components/el/__init__.pyi +2 -0
- reflex/components/el/elements/__init__.py +1 -0
- reflex/components/el/elements/__init__.pyi +3 -0
- reflex/components/el/elements/forms.py +1 -0
- reflex/components/el/elements/forms.pyi +1 -0
- reflex/components/moment/moment.py +4 -3
- reflex/components/moment/moment.pyi +12 -2
- reflex/components/plotly/plotly.py +1 -1
- reflex/components/radix/primitives/drawer.py +5 -23
- reflex/components/radix/themes/base.py +3 -0
- reflex/components/radix/themes/components/segmented_control.py +3 -1
- reflex/components/radix/themes/components/segmented_control.pyi +7 -2
- reflex/components/radix/themes/components/text_field.py +3 -0
- reflex/components/radix/themes/components/text_field.pyi +4 -0
- reflex/components/recharts/recharts.py +2 -14
- reflex/components/recharts/recharts.pyi +0 -1
- reflex/components/sonner/toast.py +23 -12
- reflex/components/sonner/toast.pyi +6 -6
- reflex/config.py +60 -9
- reflex/constants/base.py +12 -0
- reflex/constants/installer.py +3 -3
- reflex/constants/style.py +1 -1
- reflex/event.py +22 -5
- reflex/experimental/assets.py +14 -36
- reflex/reflex.py +16 -35
- reflex/state.py +99 -28
- reflex/utils/exceptions.py +4 -0
- reflex/utils/prerequisites.py +174 -40
- reflex/utils/redir.py +13 -4
- reflex/utils/serializers.py +52 -1
- reflex/utils/telemetry.py +2 -1
- reflex/utils/types.py +52 -1
- reflex/vars/base.py +18 -4
- reflex/vars/function.py +283 -37
- {reflex-0.6.5a2.dist-info → reflex-0.6.6.dist-info}/METADATA +3 -2
- {reflex-0.6.5a2.dist-info → reflex-0.6.6.dist-info}/RECORD +52 -51
- {reflex-0.6.5a2.dist-info → reflex-0.6.6.dist-info}/LICENSE +0 -0
- {reflex-0.6.5a2.dist-info → reflex-0.6.6.dist-info}/WHEEL +0 -0
- {reflex-0.6.5a2.dist-info → reflex-0.6.6.dist-info}/entry_points.txt +0 -0
reflex/vars/function.py
CHANGED
|
@@ -4,32 +4,177 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import dataclasses
|
|
6
6
|
import sys
|
|
7
|
-
from typing import Any, Callable, Optional, Sequence, Tuple, Type, Union
|
|
7
|
+
from typing import Any, Callable, Optional, Sequence, Tuple, Type, Union, overload
|
|
8
|
+
|
|
9
|
+
from typing_extensions import Concatenate, Generic, ParamSpec, Protocol, TypeVar
|
|
8
10
|
|
|
9
11
|
from reflex.utils import format
|
|
10
12
|
from reflex.utils.types import GenericType
|
|
11
13
|
|
|
12
14
|
from .base import CachedVarOperation, LiteralVar, Var, VarData, cached_property_no_lock
|
|
13
15
|
|
|
16
|
+
P = ParamSpec("P")
|
|
17
|
+
V1 = TypeVar("V1")
|
|
18
|
+
V2 = TypeVar("V2")
|
|
19
|
+
V3 = TypeVar("V3")
|
|
20
|
+
V4 = TypeVar("V4")
|
|
21
|
+
V5 = TypeVar("V5")
|
|
22
|
+
V6 = TypeVar("V6")
|
|
23
|
+
R = TypeVar("R")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ReflexCallable(Protocol[P, R]):
|
|
27
|
+
"""Protocol for a callable."""
|
|
28
|
+
|
|
29
|
+
__call__: Callable[P, R]
|
|
30
|
+
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
CALLABLE_TYPE = TypeVar("CALLABLE_TYPE", bound=ReflexCallable, infer_variance=True)
|
|
33
|
+
OTHER_CALLABLE_TYPE = TypeVar(
|
|
34
|
+
"OTHER_CALLABLE_TYPE", bound=ReflexCallable, infer_variance=True
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class FunctionVar(Var[CALLABLE_TYPE], default_type=ReflexCallable[Any, Any]):
|
|
16
39
|
"""Base class for immutable function vars."""
|
|
17
40
|
|
|
18
|
-
|
|
19
|
-
|
|
41
|
+
@overload
|
|
42
|
+
def partial(self) -> FunctionVar[CALLABLE_TYPE]: ...
|
|
43
|
+
|
|
44
|
+
@overload
|
|
45
|
+
def partial(
|
|
46
|
+
self: FunctionVar[ReflexCallable[Concatenate[V1, P], R]],
|
|
47
|
+
arg1: Union[V1, Var[V1]],
|
|
48
|
+
) -> FunctionVar[ReflexCallable[P, R]]: ...
|
|
49
|
+
|
|
50
|
+
@overload
|
|
51
|
+
def partial(
|
|
52
|
+
self: FunctionVar[ReflexCallable[Concatenate[V1, V2, P], R]],
|
|
53
|
+
arg1: Union[V1, Var[V1]],
|
|
54
|
+
arg2: Union[V2, Var[V2]],
|
|
55
|
+
) -> FunctionVar[ReflexCallable[P, R]]: ...
|
|
56
|
+
|
|
57
|
+
@overload
|
|
58
|
+
def partial(
|
|
59
|
+
self: FunctionVar[ReflexCallable[Concatenate[V1, V2, V3, P], R]],
|
|
60
|
+
arg1: Union[V1, Var[V1]],
|
|
61
|
+
arg2: Union[V2, Var[V2]],
|
|
62
|
+
arg3: Union[V3, Var[V3]],
|
|
63
|
+
) -> FunctionVar[ReflexCallable[P, R]]: ...
|
|
64
|
+
|
|
65
|
+
@overload
|
|
66
|
+
def partial(
|
|
67
|
+
self: FunctionVar[ReflexCallable[Concatenate[V1, V2, V3, V4, P], R]],
|
|
68
|
+
arg1: Union[V1, Var[V1]],
|
|
69
|
+
arg2: Union[V2, Var[V2]],
|
|
70
|
+
arg3: Union[V3, Var[V3]],
|
|
71
|
+
arg4: Union[V4, Var[V4]],
|
|
72
|
+
) -> FunctionVar[ReflexCallable[P, R]]: ...
|
|
73
|
+
|
|
74
|
+
@overload
|
|
75
|
+
def partial(
|
|
76
|
+
self: FunctionVar[ReflexCallable[Concatenate[V1, V2, V3, V4, V5, P], R]],
|
|
77
|
+
arg1: Union[V1, Var[V1]],
|
|
78
|
+
arg2: Union[V2, Var[V2]],
|
|
79
|
+
arg3: Union[V3, Var[V3]],
|
|
80
|
+
arg4: Union[V4, Var[V4]],
|
|
81
|
+
arg5: Union[V5, Var[V5]],
|
|
82
|
+
) -> FunctionVar[ReflexCallable[P, R]]: ...
|
|
83
|
+
|
|
84
|
+
@overload
|
|
85
|
+
def partial(
|
|
86
|
+
self: FunctionVar[ReflexCallable[Concatenate[V1, V2, V3, V4, V5, V6, P], R]],
|
|
87
|
+
arg1: Union[V1, Var[V1]],
|
|
88
|
+
arg2: Union[V2, Var[V2]],
|
|
89
|
+
arg3: Union[V3, Var[V3]],
|
|
90
|
+
arg4: Union[V4, Var[V4]],
|
|
91
|
+
arg5: Union[V5, Var[V5]],
|
|
92
|
+
arg6: Union[V6, Var[V6]],
|
|
93
|
+
) -> FunctionVar[ReflexCallable[P, R]]: ...
|
|
94
|
+
|
|
95
|
+
@overload
|
|
96
|
+
def partial(
|
|
97
|
+
self: FunctionVar[ReflexCallable[P, R]], *args: Var | Any
|
|
98
|
+
) -> FunctionVar[ReflexCallable[P, R]]: ...
|
|
99
|
+
|
|
100
|
+
@overload
|
|
101
|
+
def partial(self, *args: Var | Any) -> FunctionVar: ...
|
|
102
|
+
|
|
103
|
+
def partial(self, *args: Var | Any) -> FunctionVar: # type: ignore
|
|
104
|
+
"""Partially apply the function with the given arguments.
|
|
20
105
|
|
|
21
106
|
Args:
|
|
22
|
-
*args: The arguments to
|
|
107
|
+
*args: The arguments to partially apply the function with.
|
|
23
108
|
|
|
24
109
|
Returns:
|
|
25
|
-
The
|
|
110
|
+
The partially applied function.
|
|
26
111
|
"""
|
|
112
|
+
if not args:
|
|
113
|
+
return ArgsFunctionOperation.create((), self)
|
|
27
114
|
return ArgsFunctionOperation.create(
|
|
28
115
|
("...args",),
|
|
29
116
|
VarOperationCall.create(self, *args, Var(_js_expr="...args")),
|
|
30
117
|
)
|
|
31
118
|
|
|
32
|
-
|
|
119
|
+
@overload
|
|
120
|
+
def call(
|
|
121
|
+
self: FunctionVar[ReflexCallable[[V1], R]], arg1: Union[V1, Var[V1]]
|
|
122
|
+
) -> VarOperationCall[[V1], R]: ...
|
|
123
|
+
|
|
124
|
+
@overload
|
|
125
|
+
def call(
|
|
126
|
+
self: FunctionVar[ReflexCallable[[V1, V2], R]],
|
|
127
|
+
arg1: Union[V1, Var[V1]],
|
|
128
|
+
arg2: Union[V2, Var[V2]],
|
|
129
|
+
) -> VarOperationCall[[V1, V2], R]: ...
|
|
130
|
+
|
|
131
|
+
@overload
|
|
132
|
+
def call(
|
|
133
|
+
self: FunctionVar[ReflexCallable[[V1, V2, V3], R]],
|
|
134
|
+
arg1: Union[V1, Var[V1]],
|
|
135
|
+
arg2: Union[V2, Var[V2]],
|
|
136
|
+
arg3: Union[V3, Var[V3]],
|
|
137
|
+
) -> VarOperationCall[[V1, V2, V3], R]: ...
|
|
138
|
+
|
|
139
|
+
@overload
|
|
140
|
+
def call(
|
|
141
|
+
self: FunctionVar[ReflexCallable[[V1, V2, V3, V4], R]],
|
|
142
|
+
arg1: Union[V1, Var[V1]],
|
|
143
|
+
arg2: Union[V2, Var[V2]],
|
|
144
|
+
arg3: Union[V3, Var[V3]],
|
|
145
|
+
arg4: Union[V4, Var[V4]],
|
|
146
|
+
) -> VarOperationCall[[V1, V2, V3, V4], R]: ...
|
|
147
|
+
|
|
148
|
+
@overload
|
|
149
|
+
def call(
|
|
150
|
+
self: FunctionVar[ReflexCallable[[V1, V2, V3, V4, V5], R]],
|
|
151
|
+
arg1: Union[V1, Var[V1]],
|
|
152
|
+
arg2: Union[V2, Var[V2]],
|
|
153
|
+
arg3: Union[V3, Var[V3]],
|
|
154
|
+
arg4: Union[V4, Var[V4]],
|
|
155
|
+
arg5: Union[V5, Var[V5]],
|
|
156
|
+
) -> VarOperationCall[[V1, V2, V3, V4, V5], R]: ...
|
|
157
|
+
|
|
158
|
+
@overload
|
|
159
|
+
def call(
|
|
160
|
+
self: FunctionVar[ReflexCallable[[V1, V2, V3, V4, V5, V6], R]],
|
|
161
|
+
arg1: Union[V1, Var[V1]],
|
|
162
|
+
arg2: Union[V2, Var[V2]],
|
|
163
|
+
arg3: Union[V3, Var[V3]],
|
|
164
|
+
arg4: Union[V4, Var[V4]],
|
|
165
|
+
arg5: Union[V5, Var[V5]],
|
|
166
|
+
arg6: Union[V6, Var[V6]],
|
|
167
|
+
) -> VarOperationCall[[V1, V2, V3, V4, V5, V6], R]: ...
|
|
168
|
+
|
|
169
|
+
@overload
|
|
170
|
+
def call(
|
|
171
|
+
self: FunctionVar[ReflexCallable[P, R]], *args: Var | Any
|
|
172
|
+
) -> VarOperationCall[P, R]: ...
|
|
173
|
+
|
|
174
|
+
@overload
|
|
175
|
+
def call(self, *args: Var | Any) -> Var: ...
|
|
176
|
+
|
|
177
|
+
def call(self, *args: Var | Any) -> Var: # type: ignore
|
|
33
178
|
"""Call the function with the given arguments.
|
|
34
179
|
|
|
35
180
|
Args:
|
|
@@ -38,19 +183,29 @@ class FunctionVar(Var[Callable], python_types=Callable):
|
|
|
38
183
|
Returns:
|
|
39
184
|
The function call operation.
|
|
40
185
|
"""
|
|
41
|
-
return VarOperationCall.create(self, *args)
|
|
186
|
+
return VarOperationCall.create(self, *args).guess_type()
|
|
187
|
+
|
|
188
|
+
__call__ = call
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class BuilderFunctionVar(
|
|
192
|
+
FunctionVar[CALLABLE_TYPE], default_type=ReflexCallable[Any, Any]
|
|
193
|
+
):
|
|
194
|
+
"""Base class for immutable function vars with the builder pattern."""
|
|
195
|
+
|
|
196
|
+
__call__ = FunctionVar.partial
|
|
42
197
|
|
|
43
198
|
|
|
44
|
-
class FunctionStringVar(FunctionVar):
|
|
199
|
+
class FunctionStringVar(FunctionVar[CALLABLE_TYPE]):
|
|
45
200
|
"""Base class for immutable function vars from a string."""
|
|
46
201
|
|
|
47
202
|
@classmethod
|
|
48
203
|
def create(
|
|
49
204
|
cls,
|
|
50
205
|
func: str,
|
|
51
|
-
_var_type: Type[
|
|
206
|
+
_var_type: Type[OTHER_CALLABLE_TYPE] = ReflexCallable[Any, Any],
|
|
52
207
|
_var_data: VarData | None = None,
|
|
53
|
-
) -> FunctionStringVar:
|
|
208
|
+
) -> FunctionStringVar[OTHER_CALLABLE_TYPE]:
|
|
54
209
|
"""Create a new function var from a string.
|
|
55
210
|
|
|
56
211
|
Args:
|
|
@@ -60,7 +215,7 @@ class FunctionStringVar(FunctionVar):
|
|
|
60
215
|
Returns:
|
|
61
216
|
The function var.
|
|
62
217
|
"""
|
|
63
|
-
return
|
|
218
|
+
return FunctionStringVar(
|
|
64
219
|
_js_expr=func,
|
|
65
220
|
_var_type=_var_type,
|
|
66
221
|
_var_data=_var_data,
|
|
@@ -72,10 +227,10 @@ class FunctionStringVar(FunctionVar):
|
|
|
72
227
|
frozen=True,
|
|
73
228
|
**{"slots": True} if sys.version_info >= (3, 10) else {},
|
|
74
229
|
)
|
|
75
|
-
class VarOperationCall(CachedVarOperation, Var):
|
|
230
|
+
class VarOperationCall(Generic[P, R], CachedVarOperation, Var[R]):
|
|
76
231
|
"""Base class for immutable vars that are the result of a function call."""
|
|
77
232
|
|
|
78
|
-
_func: Optional[FunctionVar] = dataclasses.field(default=None)
|
|
233
|
+
_func: Optional[FunctionVar[ReflexCallable[P, R]]] = dataclasses.field(default=None)
|
|
79
234
|
_args: Tuple[Union[Var, Any], ...] = dataclasses.field(default_factory=tuple)
|
|
80
235
|
|
|
81
236
|
@cached_property_no_lock
|
|
@@ -103,7 +258,7 @@ class VarOperationCall(CachedVarOperation, Var):
|
|
|
103
258
|
@classmethod
|
|
104
259
|
def create(
|
|
105
260
|
cls,
|
|
106
|
-
func: FunctionVar,
|
|
261
|
+
func: FunctionVar[ReflexCallable[P, R]],
|
|
107
262
|
*args: Var | Any,
|
|
108
263
|
_var_type: GenericType = Any,
|
|
109
264
|
_var_data: VarData | None = None,
|
|
@@ -118,9 +273,15 @@ class VarOperationCall(CachedVarOperation, Var):
|
|
|
118
273
|
Returns:
|
|
119
274
|
The function call var.
|
|
120
275
|
"""
|
|
276
|
+
function_return_type = (
|
|
277
|
+
func._var_type.__args__[1]
|
|
278
|
+
if getattr(func._var_type, "__args__", None)
|
|
279
|
+
else Any
|
|
280
|
+
)
|
|
281
|
+
var_type = _var_type if _var_type is not Any else function_return_type
|
|
121
282
|
return cls(
|
|
122
283
|
_js_expr="",
|
|
123
|
-
_var_type=
|
|
284
|
+
_var_type=var_type,
|
|
124
285
|
_var_data=_var_data,
|
|
125
286
|
_func=func,
|
|
126
287
|
_args=args,
|
|
@@ -157,6 +318,33 @@ class FunctionArgs:
|
|
|
157
318
|
rest: Optional[str] = None
|
|
158
319
|
|
|
159
320
|
|
|
321
|
+
def format_args_function_operation(
|
|
322
|
+
args: FunctionArgs, return_expr: Var | Any, explicit_return: bool
|
|
323
|
+
) -> str:
|
|
324
|
+
"""Format an args function operation.
|
|
325
|
+
|
|
326
|
+
Args:
|
|
327
|
+
args: The function arguments.
|
|
328
|
+
return_expr: The return expression.
|
|
329
|
+
explicit_return: Whether to use explicit return syntax.
|
|
330
|
+
|
|
331
|
+
Returns:
|
|
332
|
+
The formatted args function operation.
|
|
333
|
+
"""
|
|
334
|
+
arg_names_str = ", ".join(
|
|
335
|
+
[arg if isinstance(arg, str) else arg.to_javascript() for arg in args.args]
|
|
336
|
+
) + (f", ...{args.rest}" if args.rest else "")
|
|
337
|
+
|
|
338
|
+
return_expr_str = str(LiteralVar.create(return_expr))
|
|
339
|
+
|
|
340
|
+
# Wrap return expression in curly braces if explicit return syntax is used.
|
|
341
|
+
return_expr_str_wrapped = (
|
|
342
|
+
format.wrap(return_expr_str, "{", "}") if explicit_return else return_expr_str
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
return f"(({arg_names_str}) => {return_expr_str_wrapped})"
|
|
346
|
+
|
|
347
|
+
|
|
160
348
|
@dataclasses.dataclass(
|
|
161
349
|
eq=False,
|
|
162
350
|
frozen=True,
|
|
@@ -176,24 +364,10 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
|
|
|
176
364
|
Returns:
|
|
177
365
|
The name of the var.
|
|
178
366
|
"""
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
arg if isinstance(arg, str) else arg.to_javascript()
|
|
182
|
-
for arg in self._args.args
|
|
183
|
-
]
|
|
184
|
-
) + (f", ...{self._args.rest}" if self._args.rest else "")
|
|
185
|
-
|
|
186
|
-
return_expr_str = str(LiteralVar.create(self._return_expr))
|
|
187
|
-
|
|
188
|
-
# Wrap return expression in curly braces if explicit return syntax is used.
|
|
189
|
-
return_expr_str_wrapped = (
|
|
190
|
-
format.wrap(return_expr_str, "{", "}")
|
|
191
|
-
if self._explicit_return
|
|
192
|
-
else return_expr_str
|
|
367
|
+
return format_args_function_operation(
|
|
368
|
+
self._args, self._return_expr, self._explicit_return
|
|
193
369
|
)
|
|
194
370
|
|
|
195
|
-
return f"(({arg_names_str}) => {return_expr_str_wrapped})"
|
|
196
|
-
|
|
197
371
|
@classmethod
|
|
198
372
|
def create(
|
|
199
373
|
cls,
|
|
@@ -203,7 +377,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
|
|
|
203
377
|
explicit_return: bool = False,
|
|
204
378
|
_var_type: GenericType = Callable,
|
|
205
379
|
_var_data: VarData | None = None,
|
|
206
|
-
)
|
|
380
|
+
):
|
|
207
381
|
"""Create a new function var.
|
|
208
382
|
|
|
209
383
|
Args:
|
|
@@ -226,8 +400,80 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
|
|
|
226
400
|
)
|
|
227
401
|
|
|
228
402
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
"
|
|
403
|
+
@dataclasses.dataclass(
|
|
404
|
+
eq=False,
|
|
405
|
+
frozen=True,
|
|
406
|
+
**{"slots": True} if sys.version_info >= (3, 10) else {},
|
|
233
407
|
)
|
|
408
|
+
class ArgsFunctionOperationBuilder(CachedVarOperation, BuilderFunctionVar):
|
|
409
|
+
"""Base class for immutable function defined via arguments and return expression with the builder pattern."""
|
|
410
|
+
|
|
411
|
+
_args: FunctionArgs = dataclasses.field(default_factory=FunctionArgs)
|
|
412
|
+
_return_expr: Union[Var, Any] = dataclasses.field(default=None)
|
|
413
|
+
_explicit_return: bool = dataclasses.field(default=False)
|
|
414
|
+
|
|
415
|
+
@cached_property_no_lock
|
|
416
|
+
def _cached_var_name(self) -> str:
|
|
417
|
+
"""The name of the var.
|
|
418
|
+
|
|
419
|
+
Returns:
|
|
420
|
+
The name of the var.
|
|
421
|
+
"""
|
|
422
|
+
return format_args_function_operation(
|
|
423
|
+
self._args, self._return_expr, self._explicit_return
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
@classmethod
|
|
427
|
+
def create(
|
|
428
|
+
cls,
|
|
429
|
+
args_names: Sequence[Union[str, DestructuredArg]],
|
|
430
|
+
return_expr: Var | Any,
|
|
431
|
+
rest: str | None = None,
|
|
432
|
+
explicit_return: bool = False,
|
|
433
|
+
_var_type: GenericType = Callable,
|
|
434
|
+
_var_data: VarData | None = None,
|
|
435
|
+
):
|
|
436
|
+
"""Create a new function var.
|
|
437
|
+
|
|
438
|
+
Args:
|
|
439
|
+
args_names: The names of the arguments.
|
|
440
|
+
return_expr: The return expression of the function.
|
|
441
|
+
rest: The name of the rest argument.
|
|
442
|
+
explicit_return: Whether to use explicit return syntax.
|
|
443
|
+
_var_data: Additional hooks and imports associated with the Var.
|
|
444
|
+
|
|
445
|
+
Returns:
|
|
446
|
+
The function var.
|
|
447
|
+
"""
|
|
448
|
+
return cls(
|
|
449
|
+
_js_expr="",
|
|
450
|
+
_var_type=_var_type,
|
|
451
|
+
_var_data=_var_data,
|
|
452
|
+
_args=FunctionArgs(args=tuple(args_names), rest=rest),
|
|
453
|
+
_return_expr=return_expr,
|
|
454
|
+
_explicit_return=explicit_return,
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
if python_version := sys.version_info[:2] >= (3, 10):
|
|
459
|
+
JSON_STRINGIFY = FunctionStringVar.create(
|
|
460
|
+
"JSON.stringify", _var_type=ReflexCallable[[Any], str]
|
|
461
|
+
)
|
|
462
|
+
ARRAY_ISARRAY = FunctionStringVar.create(
|
|
463
|
+
"Array.isArray", _var_type=ReflexCallable[[Any], bool]
|
|
464
|
+
)
|
|
465
|
+
PROTOTYPE_TO_STRING = FunctionStringVar.create(
|
|
466
|
+
"((__to_string) => __to_string.toString())",
|
|
467
|
+
_var_type=ReflexCallable[[Any], str],
|
|
468
|
+
)
|
|
469
|
+
else:
|
|
470
|
+
JSON_STRINGIFY = FunctionStringVar.create(
|
|
471
|
+
"JSON.stringify", _var_type=ReflexCallable[Any, str]
|
|
472
|
+
)
|
|
473
|
+
ARRAY_ISARRAY = FunctionStringVar.create(
|
|
474
|
+
"Array.isArray", _var_type=ReflexCallable[Any, bool]
|
|
475
|
+
)
|
|
476
|
+
PROTOTYPE_TO_STRING = FunctionStringVar.create(
|
|
477
|
+
"((__to_string) => __to_string.toString())",
|
|
478
|
+
_var_type=ReflexCallable[Any, str],
|
|
479
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: reflex
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.6
|
|
4
4
|
Summary: Web apps in pure Python.
|
|
5
5
|
Home-page: https://reflex.dev
|
|
6
6
|
License: Apache-2.0
|
|
@@ -33,7 +33,7 @@ Requires-Dist: python-multipart (>=0.0.5,<0.1)
|
|
|
33
33
|
Requires-Dist: python-socketio (>=5.7.0,<6.0)
|
|
34
34
|
Requires-Dist: redis (>=4.3.5,<6.0)
|
|
35
35
|
Requires-Dist: reflex-chakra (>=0.6.0)
|
|
36
|
-
Requires-Dist: reflex-hosting-cli (>=0.1.
|
|
36
|
+
Requires-Dist: reflex-hosting-cli (>=0.1.17,<2.0)
|
|
37
37
|
Requires-Dist: rich (>=13.0.0,<14.0)
|
|
38
38
|
Requires-Dist: setuptools (>=75.0)
|
|
39
39
|
Requires-Dist: sqlmodel (>=0.0.14,<0.1)
|
|
@@ -41,6 +41,7 @@ Requires-Dist: starlette-admin (>=0.11.0,<1.0)
|
|
|
41
41
|
Requires-Dist: tomlkit (>=0.12.4,<1.0)
|
|
42
42
|
Requires-Dist: twine (>=4.0.0,<6.0)
|
|
43
43
|
Requires-Dist: typer (>=0.4.2,<1.0)
|
|
44
|
+
Requires-Dist: typing_extensions (>=4.6.0)
|
|
44
45
|
Requires-Dist: uvicorn (>=0.20.0)
|
|
45
46
|
Requires-Dist: wheel (>=0.42.0,<1.0)
|
|
46
47
|
Requires-Dist: wrapt (>=1.11.0,<2.0) ; python_version < "3.11"
|