reflex 0.7.4a2__py3-none-any.whl → 0.7.5__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/__init__.py +1 -0
- reflex/__init__.pyi +1 -0
- reflex/app.py +10 -8
- reflex/app_mixins/middleware.py +13 -20
- reflex/compiler/compiler.py +10 -3
- reflex/compiler/utils.py +4 -4
- reflex/components/base/app_wrap.pyi +7 -3
- reflex/components/base/body.pyi +7 -3
- reflex/components/base/document.pyi +27 -7
- reflex/components/base/error_boundary.pyi +7 -3
- reflex/components/base/fragment.pyi +7 -3
- reflex/components/base/head.pyi +12 -4
- reflex/components/base/link.pyi +12 -4
- reflex/components/base/meta.pyi +22 -6
- reflex/components/base/script.pyi +7 -3
- reflex/components/base/strict_mode.pyi +7 -3
- reflex/components/component.py +64 -23
- reflex/components/core/auto_scroll.pyi +7 -3
- reflex/components/core/banner.py +6 -2
- reflex/components/core/banner.pyi +32 -8
- reflex/components/core/client_side_routing.pyi +12 -4
- reflex/components/core/clipboard.pyi +7 -3
- reflex/components/core/debounce.pyi +7 -3
- reflex/components/core/foreach.py +5 -1
- reflex/components/core/html.pyi +7 -3
- reflex/components/core/match.py +5 -5
- reflex/components/core/sticky.pyi +21 -6
- reflex/components/core/upload.pyi +27 -7
- reflex/components/datadisplay/code.pyi +12 -4
- reflex/components/datadisplay/dataeditor.py +2 -2
- reflex/components/datadisplay/dataeditor.pyi +17 -3
- reflex/components/datadisplay/shiki_code_block.pyi +17 -4
- reflex/components/el/__init__.pyi +1 -1
- reflex/components/el/element.pyi +7 -3
- reflex/components/el/elements/__init__.py +3 -1
- reflex/components/el/elements/__init__.pyi +3 -2
- reflex/components/el/elements/base.pyi +7 -3
- reflex/components/el/elements/forms.py +1 -1
- reflex/components/el/elements/forms.pyi +72 -16
- reflex/components/el/elements/inline.pyi +142 -30
- reflex/components/el/elements/media.pyi +127 -27
- reflex/components/el/elements/metadata.pyi +32 -8
- reflex/components/el/elements/other.pyi +37 -9
- reflex/components/el/elements/scripts.pyi +17 -5
- reflex/components/el/elements/sectioning.pyi +77 -17
- reflex/components/el/elements/tables.pyi +52 -12
- reflex/components/el/elements/typography.pyi +77 -17
- reflex/components/gridjs/datatable.py +2 -2
- reflex/components/gridjs/datatable.pyi +12 -4
- reflex/components/lucide/icon.py +7 -6
- reflex/components/lucide/icon.pyi +22 -7
- reflex/components/markdown/markdown.py +1 -1
- reflex/components/markdown/markdown.pyi +7 -3
- reflex/components/moment/moment.pyi +7 -3
- reflex/components/next/base.pyi +7 -3
- reflex/components/next/image.pyi +7 -3
- reflex/components/next/link.pyi +7 -3
- reflex/components/next/video.pyi +7 -3
- reflex/components/plotly/plotly.pyi +47 -11
- reflex/components/radix/primitives/accordion.pyi +37 -9
- reflex/components/radix/primitives/base.pyi +12 -4
- reflex/components/radix/primitives/drawer.pyi +57 -13
- reflex/components/radix/primitives/form.pyi +52 -12
- reflex/components/radix/primitives/progress.pyi +27 -7
- reflex/components/radix/primitives/slider.pyi +27 -7
- reflex/components/radix/themes/base.pyi +41 -10
- reflex/components/radix/themes/color_mode.py +2 -2
- reflex/components/radix/themes/color_mode.pyi +17 -5
- reflex/components/radix/themes/components/alert_dialog.pyi +36 -9
- reflex/components/radix/themes/components/aspect_ratio.pyi +7 -3
- reflex/components/radix/themes/components/avatar.pyi +6 -3
- reflex/components/radix/themes/components/badge.pyi +6 -3
- reflex/components/radix/themes/components/button.pyi +6 -3
- reflex/components/radix/themes/components/callout.pyi +26 -7
- reflex/components/radix/themes/components/card.pyi +6 -3
- reflex/components/radix/themes/components/checkbox.pyi +16 -5
- reflex/components/radix/themes/components/checkbox_cards.pyi +11 -4
- reflex/components/radix/themes/components/checkbox_group.pyi +11 -4
- reflex/components/radix/themes/components/context_menu.pyi +66 -15
- reflex/components/radix/themes/components/data_list.pyi +21 -6
- reflex/components/radix/themes/components/dialog.pyi +36 -9
- reflex/components/radix/themes/components/dropdown_menu.pyi +41 -10
- reflex/components/radix/themes/components/hover_card.pyi +21 -6
- reflex/components/radix/themes/components/icon_button.pyi +6 -3
- reflex/components/radix/themes/components/inset.pyi +6 -3
- reflex/components/radix/themes/components/popover.pyi +21 -6
- reflex/components/radix/themes/components/progress.pyi +6 -3
- reflex/components/radix/themes/components/radio.pyi +6 -3
- reflex/components/radix/themes/components/radio_cards.pyi +11 -4
- reflex/components/radix/themes/components/radio_group.py +6 -1
- reflex/components/radix/themes/components/radio_group.pyi +21 -6
- reflex/components/radix/themes/components/scroll_area.pyi +7 -3
- reflex/components/radix/themes/components/segmented_control.pyi +11 -4
- reflex/components/radix/themes/components/select.pyi +46 -11
- reflex/components/radix/themes/components/separator.pyi +6 -3
- reflex/components/radix/themes/components/skeleton.pyi +6 -3
- reflex/components/radix/themes/components/slider.pyi +6 -3
- reflex/components/radix/themes/components/spinner.pyi +6 -3
- reflex/components/radix/themes/components/switch.pyi +6 -3
- reflex/components/radix/themes/components/table.pyi +36 -9
- reflex/components/radix/themes/components/tabs.pyi +26 -7
- reflex/components/radix/themes/components/text_area.pyi +6 -3
- reflex/components/radix/themes/components/text_field.py +3 -2
- reflex/components/radix/themes/components/text_field.pyi +16 -5
- reflex/components/radix/themes/components/tooltip.pyi +7 -3
- reflex/components/radix/themes/layout/base.pyi +6 -3
- reflex/components/radix/themes/layout/box.pyi +7 -3
- reflex/components/radix/themes/layout/center.pyi +6 -3
- reflex/components/radix/themes/layout/container.pyi +6 -3
- reflex/components/radix/themes/layout/flex.pyi +6 -3
- reflex/components/radix/themes/layout/grid.pyi +6 -3
- reflex/components/radix/themes/layout/list.pyi +27 -7
- reflex/components/radix/themes/layout/section.pyi +6 -3
- reflex/components/radix/themes/layout/spacer.pyi +6 -3
- reflex/components/radix/themes/layout/stack.pyi +16 -5
- reflex/components/radix/themes/typography/blockquote.pyi +6 -3
- reflex/components/radix/themes/typography/code.pyi +6 -3
- reflex/components/radix/themes/typography/heading.pyi +6 -3
- reflex/components/radix/themes/typography/link.pyi +6 -3
- reflex/components/radix/themes/typography/text.pyi +36 -9
- reflex/components/react_player/audio.pyi +7 -3
- reflex/components/react_player/react_player.pyi +7 -3
- reflex/components/react_player/video.pyi +7 -3
- reflex/components/recharts/cartesian.pyi +97 -21
- reflex/components/recharts/charts.pyi +62 -14
- reflex/components/recharts/general.pyi +32 -8
- reflex/components/recharts/polar.py +1 -1
- reflex/components/recharts/polar.pyi +33 -9
- reflex/components/recharts/recharts.pyi +12 -4
- reflex/components/sonner/toast.pyi +7 -2
- reflex/components/suneditor/editor.pyi +7 -3
- reflex/config.py +18 -1
- reflex/constants/installer.py +22 -1
- reflex/custom_components/custom_components.py +12 -7
- reflex/event.py +26 -10
- reflex/experimental/__init__.py +17 -6
- reflex/experimental/layout.pyi +27 -7
- reflex/model.py +3 -3
- reflex/reflex.py +33 -18
- reflex/state.py +4 -4
- reflex/style.py +2 -2
- reflex/testing.py +17 -5
- reflex/utils/console.py +2 -3
- reflex/utils/exec.py +4 -0
- reflex/utils/imports.py +14 -7
- reflex/utils/net.py +107 -18
- reflex/utils/prerequisites.py +92 -13
- reflex/utils/processes.py +52 -19
- reflex/utils/pyi_generator.py +66 -53
- reflex/utils/redir.py +3 -1
- reflex/utils/registry.py +15 -5
- reflex/utils/serializers.py +1 -2
- reflex/utils/types.py +4 -4
- reflex/vars/base.py +58 -22
- reflex/vars/number.py +23 -6
- reflex/vars/sequence.py +2 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/METADATA +2 -2
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/RECORD +162 -162
- /reflex/{experimental → utils}/misc.py +0 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/WHEEL +0 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/entry_points.txt +0 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, Sequence, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import MemoizationLeaf
|
|
9
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
9
10
|
from reflex.constants.colors import Color
|
|
10
11
|
from reflex.event import EventType
|
|
11
|
-
from reflex.style import Style
|
|
12
12
|
from reflex.vars.base import Var
|
|
13
13
|
|
|
14
14
|
from .recharts import Recharts
|
|
@@ -25,7 +25,11 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
|
|
|
25
25
|
min_width: Var[int | str] | int | str | None = None,
|
|
26
26
|
min_height: Var[int | str] | int | str | None = None,
|
|
27
27
|
debounce: Var[int] | int | None = None,
|
|
28
|
-
style:
|
|
28
|
+
style: Sequence[Mapping[str, Any]]
|
|
29
|
+
| Mapping[str, Any]
|
|
30
|
+
| Var[Mapping[str, Any]]
|
|
31
|
+
| Breakpoints
|
|
32
|
+
| None = None,
|
|
29
33
|
key: Any | None = None,
|
|
30
34
|
id: Any | None = None,
|
|
31
35
|
class_name: Any | None = None,
|
|
@@ -122,7 +126,11 @@ class Legend(Recharts):
|
|
|
122
126
|
chart_width: Var[int] | int | None = None,
|
|
123
127
|
chart_height: Var[int] | int | None = None,
|
|
124
128
|
margin: Var[dict[str, Any]] | dict[str, Any] | None = None,
|
|
125
|
-
style:
|
|
129
|
+
style: Sequence[Mapping[str, Any]]
|
|
130
|
+
| Mapping[str, Any]
|
|
131
|
+
| Var[Mapping[str, Any]]
|
|
132
|
+
| Breakpoints
|
|
133
|
+
| None = None,
|
|
126
134
|
key: Any | None = None,
|
|
127
135
|
id: Any | None = None,
|
|
128
136
|
class_name: Any | None = None,
|
|
@@ -207,7 +215,11 @@ class GraphingTooltip(Recharts):
|
|
|
207
215
|
]
|
|
208
216
|
| Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]]
|
|
209
217
|
| None = None,
|
|
210
|
-
style:
|
|
218
|
+
style: Sequence[Mapping[str, Any]]
|
|
219
|
+
| Mapping[str, Any]
|
|
220
|
+
| Var[Mapping[str, Any]]
|
|
221
|
+
| Breakpoints
|
|
222
|
+
| None = None,
|
|
211
223
|
key: Any | None = None,
|
|
212
224
|
id: Any | None = None,
|
|
213
225
|
class_name: Any | None = None,
|
|
@@ -315,7 +327,11 @@ class Label(Recharts):
|
|
|
315
327
|
]
|
|
316
328
|
]
|
|
317
329
|
| None = None,
|
|
318
|
-
style:
|
|
330
|
+
style: Sequence[Mapping[str, Any]]
|
|
331
|
+
| Mapping[str, Any]
|
|
332
|
+
| Var[Mapping[str, Any]]
|
|
333
|
+
| Breakpoints
|
|
334
|
+
| None = None,
|
|
319
335
|
key: Any | None = None,
|
|
320
336
|
id: Any | None = None,
|
|
321
337
|
class_name: Any | None = None,
|
|
@@ -412,7 +428,11 @@ class LabelList(Recharts):
|
|
|
412
428
|
offset: Var[int] | int | None = None,
|
|
413
429
|
fill: Color | Var[Color | str] | str | None = None,
|
|
414
430
|
stroke: Color | Var[Color | str] | str | None = None,
|
|
415
|
-
style:
|
|
431
|
+
style: Sequence[Mapping[str, Any]]
|
|
432
|
+
| Mapping[str, Any]
|
|
433
|
+
| Var[Mapping[str, Any]]
|
|
434
|
+
| Breakpoints
|
|
435
|
+
| None = None,
|
|
416
436
|
key: Any | None = None,
|
|
417
437
|
id: Any | None = None,
|
|
418
438
|
class_name: Any | None = None,
|
|
@@ -465,7 +485,11 @@ class Cell(Recharts):
|
|
|
465
485
|
*children,
|
|
466
486
|
fill: Color | Var[Color | str] | str | None = None,
|
|
467
487
|
stroke: Color | Var[Color | str] | str | None = None,
|
|
468
|
-
style:
|
|
488
|
+
style: Sequence[Mapping[str, Any]]
|
|
489
|
+
| Mapping[str, Any]
|
|
490
|
+
| Var[Mapping[str, Any]]
|
|
491
|
+
| Breakpoints
|
|
492
|
+
| None = None,
|
|
469
493
|
key: Any | None = None,
|
|
470
494
|
id: Any | None = None,
|
|
471
495
|
class_name: Any | None = None,
|
|
@@ -131,7 +131,7 @@ class Radar(Recharts):
|
|
|
131
131
|
stroke: Var[str | Color] = LiteralVar.create(Color("accent", 9))
|
|
132
132
|
|
|
133
133
|
# Fill color. Default: rx.color("accent", 3)
|
|
134
|
-
fill: Var[str] = LiteralVar.create(Color("accent", 3))
|
|
134
|
+
fill: Var[str | Color] = LiteralVar.create(Color("accent", 3))
|
|
135
135
|
|
|
136
136
|
# The opacity to fill the chart. Default: 0.6
|
|
137
137
|
fill_opacity: Var[float] = LiteralVar.create(0.6)
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, Sequence, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
8
9
|
from reflex.constants.colors import Color
|
|
9
10
|
from reflex.event import EventType
|
|
10
|
-
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
13
13
|
from .recharts import Recharts
|
|
@@ -72,7 +72,11 @@ class Pie(Recharts):
|
|
|
72
72
|
| Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]]
|
|
73
73
|
| None = None,
|
|
74
74
|
root_tab_index: Var[int] | int | None = None,
|
|
75
|
-
style:
|
|
75
|
+
style: Sequence[Mapping[str, Any]]
|
|
76
|
+
| Mapping[str, Any]
|
|
77
|
+
| Var[Mapping[str, Any]]
|
|
78
|
+
| Breakpoints
|
|
79
|
+
| None = None,
|
|
76
80
|
key: Any | None = None,
|
|
77
81
|
id: Any | None = None,
|
|
78
82
|
class_name: Any | None = None,
|
|
@@ -137,7 +141,7 @@ class Radar(Recharts):
|
|
|
137
141
|
points: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
|
|
138
142
|
dot: Var[bool] | bool | None = None,
|
|
139
143
|
stroke: Color | Var[Color | str] | str | None = None,
|
|
140
|
-
fill: Var[str] | str | None = None,
|
|
144
|
+
fill: Color | Var[Color | str] | str | None = None,
|
|
141
145
|
fill_opacity: Var[float] | float | None = None,
|
|
142
146
|
legend_type: Literal[
|
|
143
147
|
"circle",
|
|
@@ -177,7 +181,11 @@ class Radar(Recharts):
|
|
|
177
181
|
]
|
|
178
182
|
| Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]]
|
|
179
183
|
| None = None,
|
|
180
|
-
style:
|
|
184
|
+
style: Sequence[Mapping[str, Any]]
|
|
185
|
+
| Mapping[str, Any]
|
|
186
|
+
| Var[Mapping[str, Any]]
|
|
187
|
+
| Breakpoints
|
|
188
|
+
| None = None,
|
|
181
189
|
key: Any | None = None,
|
|
182
190
|
id: Any | None = None,
|
|
183
191
|
class_name: Any | None = None,
|
|
@@ -265,7 +273,11 @@ class RadialBar(Recharts):
|
|
|
265
273
|
]
|
|
266
274
|
| Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]]
|
|
267
275
|
| None = None,
|
|
268
|
-
style:
|
|
276
|
+
style: Sequence[Mapping[str, Any]]
|
|
277
|
+
| Mapping[str, Any]
|
|
278
|
+
| Var[Mapping[str, Any]]
|
|
279
|
+
| Breakpoints
|
|
280
|
+
| None = None,
|
|
269
281
|
key: Any | None = None,
|
|
270
282
|
id: Any | None = None,
|
|
271
283
|
class_name: Any | None = None,
|
|
@@ -328,7 +340,11 @@ class PolarAngleAxis(Recharts):
|
|
|
328
340
|
orientation: Var[str] | str | None = None,
|
|
329
341
|
stroke: Color | Var[Color | str] | str | None = None,
|
|
330
342
|
allow_duplicated_category: Var[bool] | bool | None = None,
|
|
331
|
-
style:
|
|
343
|
+
style: Sequence[Mapping[str, Any]]
|
|
344
|
+
| Mapping[str, Any]
|
|
345
|
+
| Var[Mapping[str, Any]]
|
|
346
|
+
| Breakpoints
|
|
347
|
+
| None = None,
|
|
332
348
|
key: Any | None = None,
|
|
333
349
|
id: Any | None = None,
|
|
334
350
|
class_name: Any | None = None,
|
|
@@ -404,7 +420,11 @@ class PolarGrid(Recharts):
|
|
|
404
420
|
| Var[Literal["circle", "polygon"]]
|
|
405
421
|
| None = None,
|
|
406
422
|
stroke: Color | Var[Color | str] | str | None = None,
|
|
407
|
-
style:
|
|
423
|
+
style: Sequence[Mapping[str, Any]]
|
|
424
|
+
| Mapping[str, Any]
|
|
425
|
+
| Var[Mapping[str, Any]]
|
|
426
|
+
| Breakpoints
|
|
427
|
+
| None = None,
|
|
408
428
|
key: Any | None = None,
|
|
409
429
|
id: Any | None = None,
|
|
410
430
|
class_name: Any | None = None,
|
|
@@ -512,7 +532,11 @@ class PolarRadiusAxis(Recharts):
|
|
|
512
532
|
| None = None,
|
|
513
533
|
domain: Sequence[int | str] | Var[Sequence[int | str]] | None = None,
|
|
514
534
|
stroke: Color | Var[Color | str] | str | None = None,
|
|
515
|
-
style:
|
|
535
|
+
style: Sequence[Mapping[str, Any]]
|
|
536
|
+
| Mapping[str, Any]
|
|
537
|
+
| Var[Mapping[str, Any]]
|
|
538
|
+
| Breakpoints
|
|
539
|
+
| None = None,
|
|
516
540
|
key: Any | None = None,
|
|
517
541
|
id: Any | None = None,
|
|
518
542
|
class_name: Any | None = None,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent
|
|
9
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
9
10
|
from reflex.event import EventType
|
|
10
|
-
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
13
13
|
class Recharts(Component):
|
|
@@ -16,7 +16,11 @@ class Recharts(Component):
|
|
|
16
16
|
def create( # type: ignore
|
|
17
17
|
cls,
|
|
18
18
|
*children,
|
|
19
|
-
style:
|
|
19
|
+
style: Sequence[Mapping[str, Any]]
|
|
20
|
+
| Mapping[str, Any]
|
|
21
|
+
| Var[Mapping[str, Any]]
|
|
22
|
+
| Breakpoints
|
|
23
|
+
| None = None,
|
|
20
24
|
key: Any | None = None,
|
|
21
25
|
id: Any | None = None,
|
|
22
26
|
class_name: Any | None = None,
|
|
@@ -62,7 +66,11 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf):
|
|
|
62
66
|
def create( # type: ignore
|
|
63
67
|
cls,
|
|
64
68
|
*children,
|
|
65
|
-
style:
|
|
69
|
+
style: Sequence[Mapping[str, Any]]
|
|
70
|
+
| Mapping[str, Any]
|
|
71
|
+
| Var[Mapping[str, Any]]
|
|
72
|
+
| Breakpoints
|
|
73
|
+
| None = None,
|
|
66
74
|
key: Any | None = None,
|
|
67
75
|
id: Any | None = None,
|
|
68
76
|
class_name: Any | None = None,
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex.base import Base
|
|
9
9
|
from reflex.components.component import Component, ComponentNamespace
|
|
10
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
10
11
|
from reflex.components.lucide.icon import Icon
|
|
11
12
|
from reflex.components.props import NoExtrasAllowedProps, PropsBase
|
|
12
13
|
from reflex.constants.base import Dirs
|
|
@@ -117,7 +118,11 @@ class Toaster(Component):
|
|
|
117
118
|
gap: Var[int] | int | None = None,
|
|
118
119
|
loading_icon: Icon | Var[Icon] | None = None,
|
|
119
120
|
pause_when_page_is_hidden: Var[bool] | bool | None = None,
|
|
120
|
-
style:
|
|
121
|
+
style: Sequence[Mapping[str, Any]]
|
|
122
|
+
| Mapping[str, Any]
|
|
123
|
+
| Var[Mapping[str, Any]]
|
|
124
|
+
| Breakpoints
|
|
125
|
+
| None = None,
|
|
121
126
|
key: Any | None = None,
|
|
122
127
|
id: Any | None = None,
|
|
123
128
|
class_name: Any | None = None,
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
6
|
import enum
|
|
7
|
-
from typing import Any, Dict, Literal, Optional, overload
|
|
7
|
+
from typing import Any, Dict, Literal, Mapping, Optional, Sequence, overload
|
|
8
8
|
|
|
9
9
|
from reflex.base import Base
|
|
10
10
|
from reflex.components.component import NoSSRComponent
|
|
11
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
11
12
|
from reflex.event import EventType
|
|
12
|
-
from reflex.style import Style
|
|
13
13
|
from reflex.utils.imports import ImportDict
|
|
14
14
|
from reflex.vars.base import Var
|
|
15
15
|
|
|
@@ -116,7 +116,11 @@ class Editor(NoSSRComponent):
|
|
|
116
116
|
hide: Var[bool] | bool | None = None,
|
|
117
117
|
hide_toolbar: Var[bool] | bool | None = None,
|
|
118
118
|
disable_toolbar: Var[bool] | bool | None = None,
|
|
119
|
-
style:
|
|
119
|
+
style: Sequence[Mapping[str, Any]]
|
|
120
|
+
| Mapping[str, Any]
|
|
121
|
+
| Var[Mapping[str, Any]]
|
|
122
|
+
| Breakpoints
|
|
123
|
+
| None = None,
|
|
120
124
|
key: Any | None = None,
|
|
121
125
|
id: Any | None = None,
|
|
122
126
|
class_name: Any | None = None,
|
reflex/config.py
CHANGED
|
@@ -703,7 +703,7 @@ class EnvironmentVariables:
|
|
|
703
703
|
REFLEX_STATE_SIZE_LIMIT: EnvVar[int] = env_var(1000)
|
|
704
704
|
|
|
705
705
|
# Whether to use the turbopack bundler.
|
|
706
|
-
REFLEX_USE_TURBOPACK: EnvVar[bool] = env_var(
|
|
706
|
+
REFLEX_USE_TURBOPACK: EnvVar[bool] = env_var(False)
|
|
707
707
|
|
|
708
708
|
# Additional paths to include in the hot reload. Separated by a colon.
|
|
709
709
|
REFLEX_HOT_RELOAD_INCLUDE_PATHS: EnvVar[list[Path]] = env_var([])
|
|
@@ -720,6 +720,20 @@ class EnvironmentVariables:
|
|
|
720
720
|
# Used by flexgen to enumerate the pages.
|
|
721
721
|
REFLEX_ADD_ALL_ROUTES_ENDPOINT: EnvVar[bool] = env_var(False)
|
|
722
722
|
|
|
723
|
+
# The address to bind the HTTP client to. You can set this to "::" to enable IPv6.
|
|
724
|
+
REFLEX_HTTP_CLIENT_BIND_ADDRESS: EnvVar[str | None] = env_var(None)
|
|
725
|
+
|
|
726
|
+
# Maximum size of the message in the websocket server in bytes.
|
|
727
|
+
REFLEX_SOCKET_MAX_HTTP_BUFFER_SIZE: EnvVar[int] = env_var(
|
|
728
|
+
constants.POLLING_MAX_HTTP_BUFFER_SIZE
|
|
729
|
+
)
|
|
730
|
+
|
|
731
|
+
# The interval to send a ping to the websocket server in seconds.
|
|
732
|
+
REFLEX_SOCKET_INTERVAL: EnvVar[int] = env_var(constants.Ping.INTERVAL)
|
|
733
|
+
|
|
734
|
+
# The timeout to wait for a pong from the websocket server in seconds.
|
|
735
|
+
REFLEX_SOCKET_TIMEOUT: EnvVar[int] = env_var(constants.Ping.TIMEOUT)
|
|
736
|
+
|
|
723
737
|
|
|
724
738
|
environment = EnvironmentVariables()
|
|
725
739
|
|
|
@@ -812,6 +826,9 @@ class Config(Base):
|
|
|
812
826
|
# Whether to enable or disable nextJS gzip compression.
|
|
813
827
|
next_compression: bool = True
|
|
814
828
|
|
|
829
|
+
# Whether to enable or disable NextJS dev indicator.
|
|
830
|
+
next_dev_indicators: bool = False
|
|
831
|
+
|
|
815
832
|
# Whether to use React strict mode in nextJS
|
|
816
833
|
react_strict_mode: bool = True
|
|
817
834
|
|
reflex/constants/installer.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import os
|
|
5
6
|
from types import SimpleNamespace
|
|
6
7
|
|
|
7
8
|
from .base import IS_WINDOWS
|
|
@@ -66,6 +67,26 @@ class Node(SimpleNamespace):
|
|
|
66
67
|
# The minimum required node version.
|
|
67
68
|
MIN_VERSION = "18.18.0"
|
|
68
69
|
|
|
70
|
+
# Path of the node config file.
|
|
71
|
+
CONFIG_PATH = ".npmrc"
|
|
72
|
+
|
|
73
|
+
DEFAULT_CONFIG = """
|
|
74
|
+
registry={registry}
|
|
75
|
+
fetch-retries=0
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _determine_nextjs_version() -> str:
|
|
80
|
+
default_version = "15.2.4"
|
|
81
|
+
if (version := os.getenv("NEXTJS_VERSION")) and version != default_version:
|
|
82
|
+
from reflex.utils import console
|
|
83
|
+
|
|
84
|
+
console.warn(
|
|
85
|
+
f"You have requested next@{version} but the supported version is {default_version}, abandon all hope ye who enter here."
|
|
86
|
+
)
|
|
87
|
+
return version
|
|
88
|
+
return default_version
|
|
89
|
+
|
|
69
90
|
|
|
70
91
|
class PackageJson(SimpleNamespace):
|
|
71
92
|
"""Constants used to build the package.json file."""
|
|
@@ -84,7 +105,7 @@ class PackageJson(SimpleNamespace):
|
|
|
84
105
|
"@emotion/react": "11.14.0",
|
|
85
106
|
"axios": "1.8.3",
|
|
86
107
|
"json5": "2.2.3",
|
|
87
|
-
"next":
|
|
108
|
+
"next": _determine_nextjs_version(),
|
|
88
109
|
"next-sitemap": "4.2.3",
|
|
89
110
|
"next-themes": "0.4.6",
|
|
90
111
|
"react": "19.0.0",
|
|
@@ -826,7 +826,6 @@ def _collect_details_for_gallery():
|
|
|
826
826
|
Raises:
|
|
827
827
|
Exit: If pyproject.toml file is ill-formed or the request to the backend services fails.
|
|
828
828
|
"""
|
|
829
|
-
import reflex_cli.constants
|
|
830
829
|
from reflex_cli.utils import hosting
|
|
831
830
|
|
|
832
831
|
console.rule("[bold]Authentication with Reflex Services")
|
|
@@ -853,7 +852,7 @@ def _collect_details_for_gallery():
|
|
|
853
852
|
params["package_name"] = package_name
|
|
854
853
|
|
|
855
854
|
post_custom_components_gallery_endpoint = (
|
|
856
|
-
|
|
855
|
+
"https://gallery-backend.reflex.dev/custom-components/gallery"
|
|
857
856
|
)
|
|
858
857
|
|
|
859
858
|
# Check the backend services if the user is allowed to update information of this package is already shared.
|
|
@@ -932,14 +931,20 @@ def _validate_url_with_protocol_prefix(url: str | None) -> bool:
|
|
|
932
931
|
def _get_file_from_prompt_in_loop() -> tuple[bytes, str] | None:
|
|
933
932
|
image_file = file_extension = None
|
|
934
933
|
while image_file is None:
|
|
935
|
-
|
|
936
|
-
|
|
934
|
+
image_path_str = console.ask(
|
|
935
|
+
"Upload a preview image of your demo app (enter to skip)"
|
|
937
936
|
)
|
|
938
|
-
if not
|
|
937
|
+
if not image_path_str:
|
|
939
938
|
break
|
|
940
|
-
|
|
939
|
+
image_file_path = Path(image_path_str)
|
|
940
|
+
if not image_file_path:
|
|
941
|
+
break
|
|
942
|
+
if not image_file_path.exists():
|
|
943
|
+
console.error(f"File {image_file_path} does not exist.")
|
|
944
|
+
continue
|
|
945
|
+
file_extension = image_file_path.suffix
|
|
941
946
|
try:
|
|
942
|
-
image_file =
|
|
947
|
+
image_file = image_file_path.read_bytes()
|
|
943
948
|
except OSError as ose:
|
|
944
949
|
console.error(f"Unable to read the {file_extension} file due to {ose}")
|
|
945
950
|
raise typer.Exit(code=1) from ose
|
reflex/event.py
CHANGED
|
@@ -14,7 +14,6 @@ from typing import (
|
|
|
14
14
|
Any,
|
|
15
15
|
Callable,
|
|
16
16
|
Generic,
|
|
17
|
-
List,
|
|
18
17
|
Protocol,
|
|
19
18
|
Sequence,
|
|
20
19
|
Type,
|
|
@@ -32,6 +31,7 @@ from reflex import constants
|
|
|
32
31
|
from reflex.constants.compiler import CompileVars, Hooks, Imports
|
|
33
32
|
from reflex.constants.state import FRONTEND_EVENT_STATE
|
|
34
33
|
from reflex.utils import console, format
|
|
34
|
+
from reflex.utils.decorator import once
|
|
35
35
|
from reflex.utils.exceptions import (
|
|
36
36
|
EventFnArgMismatchError,
|
|
37
37
|
EventHandlerArgTypeMismatchError,
|
|
@@ -449,7 +449,7 @@ class EventChain(EventActionsMixin):
|
|
|
449
449
|
value = [value]
|
|
450
450
|
|
|
451
451
|
# If the input is a list of event handlers, create an event chain.
|
|
452
|
-
if isinstance(value,
|
|
452
|
+
if isinstance(value, list):
|
|
453
453
|
events: list[EventSpec | EventVar] = []
|
|
454
454
|
for v in value:
|
|
455
455
|
if isinstance(v, (EventHandler, EventSpec)):
|
|
@@ -585,11 +585,6 @@ def no_args_event_spec() -> tuple[()]:
|
|
|
585
585
|
return ()
|
|
586
586
|
|
|
587
587
|
|
|
588
|
-
# These chains can be used for their side effects when no other events are desired.
|
|
589
|
-
stop_propagation = EventChain(events=[], args_spec=no_args_event_spec).stop_propagation
|
|
590
|
-
prevent_default = EventChain(events=[], args_spec=no_args_event_spec).prevent_default
|
|
591
|
-
|
|
592
|
-
|
|
593
588
|
T = TypeVar("T")
|
|
594
589
|
U = TypeVar("U")
|
|
595
590
|
|
|
@@ -819,6 +814,7 @@ def console_log(message: str | Var[str]) -> EventSpec:
|
|
|
819
814
|
return run_script(Var("console").to(dict).log.to(FunctionVar).call(message))
|
|
820
815
|
|
|
821
816
|
|
|
817
|
+
@once
|
|
822
818
|
def noop() -> EventSpec:
|
|
823
819
|
"""Do nothing.
|
|
824
820
|
|
|
@@ -1552,7 +1548,7 @@ def fix_events(
|
|
|
1552
1548
|
return []
|
|
1553
1549
|
|
|
1554
1550
|
# If the handler returns a single event, wrap it in a list.
|
|
1555
|
-
if not isinstance(events,
|
|
1551
|
+
if not isinstance(events, list):
|
|
1556
1552
|
events = [events]
|
|
1557
1553
|
|
|
1558
1554
|
# Fix the events created by the handler.
|
|
@@ -1607,7 +1603,12 @@ def get_fn_signature(fn: Callable) -> inspect.Signature:
|
|
|
1607
1603
|
return signature.replace(parameters=(new_param, *signature.parameters.values()))
|
|
1608
1604
|
|
|
1609
1605
|
|
|
1610
|
-
|
|
1606
|
+
# These chains can be used for their side effects when no other events are desired.
|
|
1607
|
+
stop_propagation = noop().stop_propagation
|
|
1608
|
+
prevent_default = noop().prevent_default
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
class EventVar(ObjectVar, python_types=(EventSpec, EventHandler)):
|
|
1611
1612
|
"""Base class for event vars."""
|
|
1612
1613
|
|
|
1613
1614
|
|
|
@@ -1632,7 +1633,7 @@ class LiteralEventVar(VarOperationCall, LiteralVar, EventVar):
|
|
|
1632
1633
|
@classmethod
|
|
1633
1634
|
def create(
|
|
1634
1635
|
cls,
|
|
1635
|
-
value: EventSpec,
|
|
1636
|
+
value: EventSpec | EventHandler,
|
|
1636
1637
|
_var_data: VarData | None = None,
|
|
1637
1638
|
) -> LiteralEventVar:
|
|
1638
1639
|
"""Create a new LiteralEventVar instance.
|
|
@@ -1643,7 +1644,22 @@ class LiteralEventVar(VarOperationCall, LiteralVar, EventVar):
|
|
|
1643
1644
|
|
|
1644
1645
|
Returns:
|
|
1645
1646
|
The created LiteralEventVar instance.
|
|
1647
|
+
|
|
1648
|
+
Raises:
|
|
1649
|
+
EventFnArgMismatchError: If the event handler takes arguments.
|
|
1646
1650
|
"""
|
|
1651
|
+
if isinstance(value, EventHandler):
|
|
1652
|
+
|
|
1653
|
+
def no_args():
|
|
1654
|
+
return ()
|
|
1655
|
+
|
|
1656
|
+
try:
|
|
1657
|
+
value = call_event_handler(value, no_args)
|
|
1658
|
+
except EventFnArgMismatchError:
|
|
1659
|
+
raise EventFnArgMismatchError(
|
|
1660
|
+
f"Event handler {value.fn.__qualname__} used inside of a rx.cond() must not take any arguments."
|
|
1661
|
+
) from None
|
|
1662
|
+
|
|
1647
1663
|
return cls(
|
|
1648
1664
|
_js_expr="",
|
|
1649
1665
|
_var_type=EventSpec,
|
reflex/experimental/__init__.py
CHANGED
|
@@ -8,10 +8,10 @@ from reflex.components.radix.themes.components.progress import progress as progr
|
|
|
8
8
|
from reflex.components.sonner.toast import toast as toast
|
|
9
9
|
|
|
10
10
|
from ..utils.console import warn
|
|
11
|
+
from ..utils.misc import run_in_thread
|
|
11
12
|
from . import hooks as hooks
|
|
12
13
|
from .client_state import ClientStateVar as ClientStateVar
|
|
13
14
|
from .layout import layout as layout
|
|
14
|
-
from .misc import run_in_thread as run_in_thread
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class ExperimentalNamespace(SimpleNamespace):
|
|
@@ -46,23 +46,35 @@ class ExperimentalNamespace(SimpleNamespace):
|
|
|
46
46
|
|
|
47
47
|
@property
|
|
48
48
|
def progress(self):
|
|
49
|
-
"""Temporary property returning the
|
|
49
|
+
"""Temporary property returning the progress component.
|
|
50
50
|
|
|
51
|
-
Remove this property when
|
|
51
|
+
Remove this property when progress is fully promoted.
|
|
52
52
|
|
|
53
53
|
Returns:
|
|
54
|
-
The
|
|
54
|
+
The progress component.
|
|
55
55
|
"""
|
|
56
56
|
self.register_component_warning("progress")
|
|
57
57
|
return progress
|
|
58
58
|
|
|
59
|
+
@property
|
|
60
|
+
def run_in_thread(self):
|
|
61
|
+
"""Temporary property returning the run_in_thread helper function.
|
|
62
|
+
|
|
63
|
+
Remove this property when run_in_thread is fully promoted.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
The run_in_thread helper function.
|
|
67
|
+
"""
|
|
68
|
+
self.register_component_warning("run_in_thread")
|
|
69
|
+
return run_in_thread
|
|
70
|
+
|
|
59
71
|
@staticmethod
|
|
60
72
|
def register_component_warning(component_name: str):
|
|
61
73
|
"""Add component to emitted warnings and throw a warning if it
|
|
62
74
|
doesn't exist.
|
|
63
75
|
|
|
64
76
|
Args:
|
|
65
|
-
|
|
77
|
+
component_name: name of the component.
|
|
66
78
|
"""
|
|
67
79
|
warn(
|
|
68
80
|
f"`rx._x.{component_name}` was promoted to `rx.{component_name}`.",
|
|
@@ -75,6 +87,5 @@ _x = ExperimentalNamespace(
|
|
|
75
87
|
hooks=hooks,
|
|
76
88
|
layout=layout,
|
|
77
89
|
PropsBase=PropsBase,
|
|
78
|
-
run_in_thread=run_in_thread,
|
|
79
90
|
code_block=code_block,
|
|
80
91
|
)
|
reflex/experimental/layout.pyi
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, Sequence, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex import color
|
|
9
9
|
from reflex.components.base.fragment import Fragment
|
|
10
10
|
from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
|
|
11
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
11
12
|
from reflex.components.radix.primitives.drawer import DrawerRoot
|
|
12
13
|
from reflex.components.radix.themes.layout.box import Box
|
|
13
14
|
from reflex.event import EventType
|
|
14
15
|
from reflex.state import ComponentState
|
|
15
|
-
from reflex.style import Style
|
|
16
16
|
from reflex.vars.base import Var
|
|
17
17
|
|
|
18
18
|
class Sidebar(Box, MemoizationLeaf):
|
|
@@ -199,7 +199,11 @@ class Sidebar(Box, MemoizationLeaf):
|
|
|
199
199
|
spell_check: Var[bool] | bool | None = None,
|
|
200
200
|
tab_index: Var[int] | int | None = None,
|
|
201
201
|
title: Var[str] | str | None = None,
|
|
202
|
-
style:
|
|
202
|
+
style: Sequence[Mapping[str, Any]]
|
|
203
|
+
| Mapping[str, Any]
|
|
204
|
+
| Var[Mapping[str, Any]]
|
|
205
|
+
| Breakpoints
|
|
206
|
+
| None = None,
|
|
203
207
|
key: Any | None = None,
|
|
204
208
|
id: Any | None = None,
|
|
205
209
|
class_name: Any | None = None,
|
|
@@ -264,7 +268,11 @@ class DrawerSidebar(DrawerRoot):
|
|
|
264
268
|
should_scale_background: Var[bool] | bool | None = None,
|
|
265
269
|
close_threshold: Var[float] | float | None = None,
|
|
266
270
|
as_child: Var[bool] | bool | None = None,
|
|
267
|
-
style:
|
|
271
|
+
style: Sequence[Mapping[str, Any]]
|
|
272
|
+
| Mapping[str, Any]
|
|
273
|
+
| Var[Mapping[str, Any]]
|
|
274
|
+
| Breakpoints
|
|
275
|
+
| None = None,
|
|
268
276
|
key: Any | None = None,
|
|
269
277
|
id: Any | None = None,
|
|
270
278
|
class_name: Any | None = None,
|
|
@@ -314,7 +322,11 @@ class SidebarTrigger(Fragment):
|
|
|
314
322
|
def create( # type: ignore
|
|
315
323
|
cls,
|
|
316
324
|
*children,
|
|
317
|
-
style:
|
|
325
|
+
style: Sequence[Mapping[str, Any]]
|
|
326
|
+
| Mapping[str, Any]
|
|
327
|
+
| Var[Mapping[str, Any]]
|
|
328
|
+
| Breakpoints
|
|
329
|
+
| None = None,
|
|
318
330
|
key: Any | None = None,
|
|
319
331
|
id: Any | None = None,
|
|
320
332
|
class_name: Any | None = None,
|
|
@@ -533,7 +545,11 @@ class Layout(Box):
|
|
|
533
545
|
spell_check: Var[bool] | bool | None = None,
|
|
534
546
|
tab_index: Var[int] | int | None = None,
|
|
535
547
|
title: Var[str] | str | None = None,
|
|
536
|
-
style:
|
|
548
|
+
style: Sequence[Mapping[str, Any]]
|
|
549
|
+
| Mapping[str, Any]
|
|
550
|
+
| Var[Mapping[str, Any]]
|
|
551
|
+
| Breakpoints
|
|
552
|
+
| None = None,
|
|
537
553
|
key: Any | None = None,
|
|
538
554
|
id: Any | None = None,
|
|
539
555
|
class_name: Any | None = None,
|
|
@@ -755,7 +771,11 @@ class LayoutNamespace(ComponentNamespace):
|
|
|
755
771
|
spell_check: Var[bool] | bool | None = None,
|
|
756
772
|
tab_index: Var[int] | int | None = None,
|
|
757
773
|
title: Var[str] | str | None = None,
|
|
758
|
-
style:
|
|
774
|
+
style: Sequence[Mapping[str, Any]]
|
|
775
|
+
| Mapping[str, Any]
|
|
776
|
+
| Var[Mapping[str, Any]]
|
|
777
|
+
| Breakpoints
|
|
778
|
+
| None = None,
|
|
759
779
|
key: Any | None = None,
|
|
760
780
|
id: Any | None = None,
|
|
761
781
|
class_name: Any | None = None,
|
reflex/model.py
CHANGED
|
@@ -320,9 +320,9 @@ class Model(Base, sqlmodel.SQLModel): # pyright: ignore [reportGeneralTypeIssue
|
|
|
320
320
|
tuple of (config, script_directory)
|
|
321
321
|
"""
|
|
322
322
|
config = alembic.config.Config(environment.ALEMBIC_CONFIG.get())
|
|
323
|
-
|
|
324
|
-
config.
|
|
325
|
-
)
|
|
323
|
+
if not config.get_main_option("script_location"):
|
|
324
|
+
config.set_main_option("script_location", "version")
|
|
325
|
+
return config, alembic.script.ScriptDirectory.from_config(config)
|
|
326
326
|
|
|
327
327
|
@staticmethod
|
|
328
328
|
def _alembic_render_item(
|