reflex 0.7.1a4__py3-none-any.whl → 0.7.2a2__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/jinja/web/utils/context.js.jinja2 +8 -8
- reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +3 -3
- reflex/.templates/web/utils/state.js +18 -18
- reflex/admin.py +1 -2
- reflex/app.py +46 -49
- reflex/app_mixins/lifespan.py +2 -2
- reflex/app_mixins/middleware.py +1 -2
- reflex/assets.py +1 -2
- reflex/base.py +2 -2
- reflex/compiler/compiler.py +51 -16
- reflex/compiler/utils.py +4 -13
- reflex/components/base/app_wrap.pyi +7 -7
- reflex/components/base/bare.py +3 -3
- reflex/components/base/body.pyi +7 -7
- reflex/components/base/document.py +1 -3
- reflex/components/base/document.pyi +32 -32
- reflex/components/base/error_boundary.py +2 -4
- reflex/components/base/error_boundary.pyi +11 -13
- reflex/components/base/fragment.pyi +7 -7
- reflex/components/base/head.pyi +13 -13
- reflex/components/base/link.pyi +22 -22
- reflex/components/base/meta.py +5 -7
- reflex/components/base/meta.pyi +40 -40
- reflex/components/base/script.pyi +11 -14
- reflex/components/base/strict_mode.pyi +7 -7
- reflex/components/component.py +188 -113
- reflex/components/core/auto_scroll.py +8 -1
- reflex/components/core/auto_scroll.pyi +183 -210
- reflex/components/core/banner.py +2 -4
- reflex/components/core/banner.pyi +390 -444
- reflex/components/core/breakpoints.py +5 -5
- reflex/components/core/client_side_routing.pyi +14 -14
- reflex/components/core/clipboard.py +4 -4
- reflex/components/core/clipboard.pyi +12 -14
- reflex/components/core/cond.py +17 -25
- reflex/components/core/debounce.py +3 -3
- reflex/components/core/debounce.pyi +14 -14
- reflex/components/core/foreach.py +7 -2
- reflex/components/core/html.py +1 -3
- reflex/components/core/html.pyi +184 -213
- reflex/components/core/match.py +15 -19
- reflex/components/core/sticky.pyi +930 -1078
- reflex/components/core/upload.py +4 -4
- reflex/components/core/upload.pyi +62 -62
- reflex/components/datadisplay/code.py +6 -6
- reflex/components/datadisplay/code.pyi +1159 -1165
- reflex/components/datadisplay/dataeditor.py +49 -49
- reflex/components/datadisplay/dataeditor.pyi +95 -123
- reflex/components/datadisplay/logo.py +1 -3
- reflex/components/datadisplay/shiki_code_block.py +8 -10
- reflex/components/datadisplay/shiki_code_block.pyi +1678 -1720
- reflex/components/el/element.pyi +7 -7
- reflex/components/el/elements/base.pyi +183 -210
- reflex/components/el/elements/forms.py +24 -24
- reflex/components/el/elements/forms.pyi +2572 -2934
- reflex/components/el/elements/inline.py +4 -4
- reflex/components/el/elements/inline.pyi +5191 -5953
- reflex/components/el/elements/media.py +47 -47
- reflex/components/el/elements/media.pyi +4802 -5500
- reflex/components/el/elements/metadata.py +1 -3
- reflex/components/el/elements/metadata.pyi +782 -896
- reflex/components/el/elements/other.pyi +1278 -1467
- reflex/components/el/elements/scripts.pyi +580 -667
- reflex/components/el/elements/sectioning.pyi +2761 -3166
- reflex/components/el/elements/tables.pyi +1840 -2119
- reflex/components/el/elements/typography.pyi +2772 -3179
- reflex/components/gridjs/datatable.py +7 -7
- reflex/components/gridjs/datatable.pyi +19 -19
- reflex/components/lucide/icon.pyi +21 -21
- reflex/components/markdown/markdown.py +2 -2
- reflex/components/markdown/markdown.pyi +9 -9
- reflex/components/moment/moment.py +11 -12
- reflex/components/moment/moment.pyi +44 -47
- reflex/components/next/base.pyi +7 -7
- reflex/components/next/image.py +3 -3
- reflex/components/next/image.pyi +19 -21
- reflex/components/next/link.pyi +9 -9
- reflex/components/next/video.py +1 -3
- reflex/components/next/video.pyi +9 -9
- reflex/components/plotly/plotly.py +22 -45
- reflex/components/plotly/plotly.pyi +164 -164
- reflex/components/radix/primitives/accordion.py +14 -14
- reflex/components/radix/primitives/accordion.pyi +439 -487
- reflex/components/radix/primitives/base.py +1 -3
- reflex/components/radix/primitives/base.pyi +15 -15
- reflex/components/radix/primitives/drawer.py +3 -3
- reflex/components/radix/primitives/drawer.pyi +110 -116
- reflex/components/radix/primitives/form.py +1 -1
- reflex/components/radix/primitives/form.pyi +668 -752
- reflex/components/radix/primitives/progress.py +6 -6
- reflex/components/radix/primitives/progress.pyi +225 -243
- reflex/components/radix/primitives/slider.py +6 -6
- reflex/components/radix/primitives/slider.pyi +52 -55
- reflex/components/radix/themes/base.py +3 -6
- reflex/components/radix/themes/base.pyi +197 -303
- reflex/components/radix/themes/color_mode.py +5 -5
- reflex/components/radix/themes/color_mode.pyi +366 -436
- reflex/components/radix/themes/components/alert_dialog.pyi +229 -262
- reflex/components/radix/themes/components/aspect_ratio.py +1 -3
- reflex/components/radix/themes/components/aspect_ratio.pyi +8 -8
- reflex/components/radix/themes/components/avatar.pyi +79 -94
- reflex/components/radix/themes/components/badge.pyi +252 -295
- reflex/components/radix/themes/components/button.pyi +269 -314
- reflex/components/radix/themes/components/callout.py +2 -2
- reflex/components/radix/themes/components/callout.pyi +1116 -1290
- reflex/components/radix/themes/components/card.pyi +194 -229
- reflex/components/radix/themes/components/checkbox.pyi +243 -278
- reflex/components/radix/themes/components/checkbox_cards.py +3 -7
- reflex/components/radix/themes/components/checkbox_cards.pyi +101 -135
- reflex/components/radix/themes/components/checkbox_group.py +2 -2
- reflex/components/radix/themes/components/checkbox_group.pyi +83 -96
- reflex/components/radix/themes/components/context_menu.py +18 -15
- reflex/components/radix/themes/components/context_menu.pyi +408 -458
- reflex/components/radix/themes/components/data_list.pyi +122 -147
- reflex/components/radix/themes/components/dialog.pyi +231 -264
- reflex/components/radix/themes/components/dropdown_menu.py +16 -13
- reflex/components/radix/themes/components/dropdown_menu.pyi +223 -246
- reflex/components/radix/themes/components/hover_card.py +2 -2
- reflex/components/radix/themes/components/hover_card.pyi +237 -282
- reflex/components/radix/themes/components/icon_button.pyi +269 -314
- reflex/components/radix/themes/components/inset.py +8 -8
- reflex/components/radix/themes/components/inset.pyi +232 -292
- reflex/components/radix/themes/components/popover.py +2 -2
- reflex/components/radix/themes/components/popover.pyi +229 -271
- reflex/components/radix/themes/components/progress.pyi +80 -96
- reflex/components/radix/themes/components/radio.pyi +73 -86
- reflex/components/radix/themes/components/radio_cards.py +4 -8
- reflex/components/radix/themes/components/radio_cards.pyi +117 -154
- reflex/components/radix/themes/components/radio_group.py +3 -3
- reflex/components/radix/themes/components/radio_group.pyi +250 -291
- reflex/components/radix/themes/components/scroll_area.pyi +14 -20
- reflex/components/radix/themes/components/segmented_control.py +6 -6
- reflex/components/radix/themes/components/segmented_control.pyi +89 -108
- reflex/components/radix/themes/components/select.py +7 -7
- reflex/components/radix/themes/components/select.pyi +376 -444
- reflex/components/radix/themes/components/separator.pyi +79 -93
- reflex/components/radix/themes/components/skeleton.pyi +32 -26
- reflex/components/radix/themes/components/slider.py +8 -8
- reflex/components/radix/themes/components/slider.pyi +99 -122
- reflex/components/radix/themes/components/spinner.pyi +12 -19
- reflex/components/radix/themes/components/switch.pyi +84 -99
- reflex/components/radix/themes/components/table.py +9 -9
- reflex/components/radix/themes/components/table.pyi +1440 -1794
- reflex/components/radix/themes/components/tabs.py +4 -4
- reflex/components/radix/themes/components/tabs.pyi +120 -132
- reflex/components/radix/themes/components/text_area.pyi +281 -331
- reflex/components/radix/themes/components/text_field.py +2 -2
- reflex/components/radix/themes/components/text_field.pyi +639 -734
- reflex/components/radix/themes/components/tooltip.py +6 -6
- reflex/components/radix/themes/components/tooltip.pyi +34 -43
- reflex/components/radix/themes/layout/base.pyi +85 -182
- reflex/components/radix/themes/layout/box.pyi +183 -210
- reflex/components/radix/themes/layout/center.pyi +225 -286
- reflex/components/radix/themes/layout/container.pyi +191 -224
- reflex/components/radix/themes/layout/flex.py +2 -2
- reflex/components/radix/themes/layout/flex.pyi +225 -286
- reflex/components/radix/themes/layout/grid.py +2 -2
- reflex/components/radix/themes/layout/grid.pyi +245 -315
- reflex/components/radix/themes/layout/list.py +2 -2
- reflex/components/radix/themes/layout/list.pyi +712 -815
- reflex/components/radix/themes/layout/section.pyi +187 -221
- reflex/components/radix/themes/layout/spacer.pyi +225 -286
- reflex/components/radix/themes/layout/stack.pyi +625 -768
- reflex/components/radix/themes/typography/blockquote.pyi +257 -299
- reflex/components/radix/themes/typography/code.pyi +259 -304
- reflex/components/radix/themes/typography/heading.pyi +272 -324
- reflex/components/radix/themes/typography/link.pyi +302 -358
- reflex/components/radix/themes/typography/text.pyi +1669 -1945
- reflex/components/react_player/audio.pyi +20 -22
- reflex/components/react_player/react_player.pyi +19 -19
- reflex/components/react_player/video.pyi +20 -22
- reflex/components/recharts/cartesian.py +100 -97
- reflex/components/recharts/cartesian.pyi +891 -1007
- reflex/components/recharts/charts.py +42 -42
- reflex/components/recharts/charts.pyi +212 -249
- reflex/components/recharts/general.py +22 -21
- reflex/components/recharts/general.pyi +198 -223
- reflex/components/recharts/polar.py +42 -45
- reflex/components/recharts/polar.pyi +254 -288
- reflex/components/recharts/recharts.pyi +13 -13
- reflex/components/sonner/toast.py +20 -20
- reflex/components/sonner/toast.pyi +58 -61
- reflex/components/suneditor/editor.py +9 -9
- reflex/components/suneditor/editor.pyi +78 -83
- reflex/components/tags/cond_tag.py +2 -2
- reflex/components/tags/iter_tag.py +10 -14
- reflex/components/tags/match_tag.py +2 -2
- reflex/components/tags/tag.py +10 -10
- reflex/config.py +36 -35
- reflex/constants/__init__.py +56 -53
- reflex/custom_components/custom_components.py +6 -7
- reflex/event.py +38 -42
- reflex/experimental/client_state.py +2 -4
- reflex/experimental/layout.py +2 -2
- reflex/experimental/layout.pyi +579 -663
- reflex/istate/data.py +4 -5
- reflex/middleware/hydrate_middleware.py +2 -2
- reflex/middleware/middleware.py +2 -2
- reflex/model.py +3 -5
- reflex/page.py +2 -2
- reflex/reflex.py +9 -10
- reflex/state.py +77 -49
- reflex/style.py +9 -3
- reflex/testing.py +21 -24
- reflex/utils/console.py +1 -1
- reflex/utils/decorator.py +26 -1
- reflex/utils/exec.py +6 -11
- reflex/utils/export.py +2 -3
- reflex/utils/format.py +4 -4
- reflex/utils/imports.py +12 -12
- reflex/utils/prerequisites.py +35 -84
- reflex/utils/processes.py +5 -5
- reflex/utils/pyi_generator.py +33 -22
- reflex/utils/serializers.py +60 -15
- reflex/utils/types.py +237 -56
- reflex/vars/base.py +122 -72
- reflex/vars/datetime.py +2 -2
- reflex/vars/function.py +52 -55
- reflex/vars/number.py +59 -5
- reflex/vars/object.py +57 -26
- reflex/vars/sequence.py +983 -958
- {reflex-0.7.1a4.dist-info → reflex-0.7.2a2.dist-info}/METADATA +3 -6
- reflex-0.7.2a2.dist-info/RECORD +405 -0
- {reflex-0.7.1a4.dist-info → reflex-0.7.2a2.dist-info}/WHEEL +1 -1
- reflex-0.7.1a4.dist-info/RECORD +0 -405
- {reflex-0.7.1a4.dist-info → reflex-0.7.2a2.dist-info}/LICENSE +0 -0
- {reflex-0.7.1a4.dist-info → reflex-0.7.2a2.dist-info}/entry_points.txt +0 -0
reflex/compiler/compiler.py
CHANGED
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from datetime import datetime
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from typing import TYPE_CHECKING,
|
|
7
|
+
from typing import TYPE_CHECKING, Iterable, Sequence, Type
|
|
8
8
|
|
|
9
9
|
from reflex import constants
|
|
10
10
|
from reflex.compiler import templates, utils
|
|
@@ -94,7 +94,7 @@ def _compile_theme(theme: str) -> str:
|
|
|
94
94
|
return templates.THEME.render(theme=theme)
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
def _compile_contexts(state:
|
|
97
|
+
def _compile_contexts(state: Type[BaseState] | None, theme: Component | None) -> str:
|
|
98
98
|
"""Compile the initial state and contexts.
|
|
99
99
|
|
|
100
100
|
Args:
|
|
@@ -219,7 +219,7 @@ def _compile_component(component: Component | StatefulComponent) -> str:
|
|
|
219
219
|
|
|
220
220
|
def _compile_components(
|
|
221
221
|
components: set[CustomComponent],
|
|
222
|
-
) -> tuple[str,
|
|
222
|
+
) -> tuple[str, dict[str, list[ImportVar]]]:
|
|
223
223
|
"""Compile the components.
|
|
224
224
|
|
|
225
225
|
Args:
|
|
@@ -352,8 +352,8 @@ def _compile_tailwind(
|
|
|
352
352
|
|
|
353
353
|
def compile_document_root(
|
|
354
354
|
head_components: list[Component],
|
|
355
|
-
html_lang:
|
|
356
|
-
html_custom_attrs:
|
|
355
|
+
html_lang: str | None = None,
|
|
356
|
+
html_custom_attrs: dict[str, Var | str] | None = None,
|
|
357
357
|
) -> tuple[str, str]:
|
|
358
358
|
"""Compile the document root.
|
|
359
359
|
|
|
@@ -415,7 +415,7 @@ def compile_theme(style: ComponentStyle) -> tuple[str, str]:
|
|
|
415
415
|
|
|
416
416
|
|
|
417
417
|
def compile_contexts(
|
|
418
|
-
state:
|
|
418
|
+
state: Type[BaseState] | None,
|
|
419
419
|
theme: Component | None,
|
|
420
420
|
) -> tuple[str, str]:
|
|
421
421
|
"""Compile the initial state / context.
|
|
@@ -456,7 +456,7 @@ def compile_page(
|
|
|
456
456
|
|
|
457
457
|
def compile_components(
|
|
458
458
|
components: set[CustomComponent],
|
|
459
|
-
) -> tuple[str, str,
|
|
459
|
+
) -> tuple[str, str, dict[str, list[ImportVar]]]:
|
|
460
460
|
"""Compile the custom components.
|
|
461
461
|
|
|
462
462
|
Args:
|
|
@@ -577,14 +577,49 @@ def into_component(component: Component | ComponentCallable) -> Component:
|
|
|
577
577
|
|
|
578
578
|
Raises:
|
|
579
579
|
TypeError: If the component is not a Component.
|
|
580
|
+
|
|
581
|
+
# noqa: DAR401
|
|
580
582
|
"""
|
|
581
583
|
if (converted := _into_component_once(component)) is not None:
|
|
582
584
|
return converted
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
585
|
+
try:
|
|
586
|
+
if (
|
|
587
|
+
callable(component)
|
|
588
|
+
and (converted := _into_component_once(component())) is not None
|
|
589
|
+
):
|
|
590
|
+
return converted
|
|
591
|
+
except KeyError as e:
|
|
592
|
+
key = e.args[0] if e.args else None
|
|
593
|
+
if key is not None and isinstance(key, Var):
|
|
594
|
+
raise TypeError(
|
|
595
|
+
"Cannot access a primitive map with a Var. Consider calling rx.Var.create() on the map."
|
|
596
|
+
).with_traceback(e.__traceback__) from None
|
|
597
|
+
raise
|
|
598
|
+
except TypeError as e:
|
|
599
|
+
message = e.args[0] if e.args else None
|
|
600
|
+
if message and isinstance(message, str):
|
|
601
|
+
if message.endswith("has no len()") and (
|
|
602
|
+
"ArrayCastedVar" in message
|
|
603
|
+
or "ObjectCastedVar" in message
|
|
604
|
+
or "StringCastedVar" in message
|
|
605
|
+
):
|
|
606
|
+
raise TypeError(
|
|
607
|
+
"Cannot pass a Var to a built-in function. Consider using .length() for accessing the length of an iterable Var."
|
|
608
|
+
).with_traceback(e.__traceback__) from None
|
|
609
|
+
if message.endswith(
|
|
610
|
+
"indices must be integers or slices, not NumberCastedVar"
|
|
611
|
+
) or message.endswith(
|
|
612
|
+
"indices must be integers or slices, not BooleanCastedVar"
|
|
613
|
+
):
|
|
614
|
+
raise TypeError(
|
|
615
|
+
"Cannot index into a primitive sequence with a Var. Consider calling rx.Var.create() on the sequence."
|
|
616
|
+
).with_traceback(e.__traceback__) from None
|
|
617
|
+
if "CastedVar" in str(e):
|
|
618
|
+
raise TypeError(
|
|
619
|
+
"Cannot pass a Var to a built-in function. Consider moving the operation to the backend, using existing Var operations, or defining a custom Var operation."
|
|
620
|
+
).with_traceback(e.__traceback__) from None
|
|
621
|
+
raise
|
|
622
|
+
|
|
588
623
|
raise TypeError(f"Expected a Component, got {type(component)}")
|
|
589
624
|
|
|
590
625
|
|
|
@@ -594,7 +629,7 @@ def compile_unevaluated_page(
|
|
|
594
629
|
state: Type[BaseState] | None = None,
|
|
595
630
|
style: ComponentStyle | None = None,
|
|
596
631
|
theme: Component | None = None,
|
|
597
|
-
) ->
|
|
632
|
+
) -> tuple[Component, bool]:
|
|
598
633
|
"""Compiles an uncompiled page into a component and adds meta information.
|
|
599
634
|
|
|
600
635
|
Args:
|
|
@@ -679,9 +714,9 @@ class ExecutorSafeFunctions:
|
|
|
679
714
|
|
|
680
715
|
"""
|
|
681
716
|
|
|
682
|
-
COMPONENTS:
|
|
683
|
-
UNCOMPILED_PAGES:
|
|
684
|
-
STATE:
|
|
717
|
+
COMPONENTS: dict[str, BaseComponent] = {}
|
|
718
|
+
UNCOMPILED_PAGES: dict[str, UnevaluatedPage] = {}
|
|
719
|
+
STATE: Type[BaseState] | None = None
|
|
685
720
|
|
|
686
721
|
@classmethod
|
|
687
722
|
def compile_page(cls, route: str) -> tuple[str, str]:
|
reflex/compiler/utils.py
CHANGED
|
@@ -7,7 +7,7 @@ import concurrent.futures
|
|
|
7
7
|
import traceback
|
|
8
8
|
from datetime import datetime
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
from typing import Any, Callable,
|
|
10
|
+
from typing import Any, Callable, Type
|
|
11
11
|
from urllib.parse import urlparse
|
|
12
12
|
|
|
13
13
|
from pydantic.v1.fields import ModelField
|
|
@@ -187,16 +187,7 @@ def compile_state(state: Type[BaseState]) -> dict:
|
|
|
187
187
|
Returns:
|
|
188
188
|
A dictionary of the compiled state.
|
|
189
189
|
"""
|
|
190
|
-
|
|
191
|
-
initial_state = state(_reflex_internal_init=True).dict(initial=True)
|
|
192
|
-
except Exception as e:
|
|
193
|
-
log_path = save_error(e)
|
|
194
|
-
console.warn(
|
|
195
|
-
f"Failed to compile initial state with computed vars. Error log saved to {log_path}"
|
|
196
|
-
)
|
|
197
|
-
initial_state = state(_reflex_internal_init=True).dict(
|
|
198
|
-
initial=True, include_computed=False
|
|
199
|
-
)
|
|
190
|
+
initial_state = state(_reflex_internal_init=True).dict(initial=True)
|
|
200
191
|
try:
|
|
201
192
|
_ = asyncio.get_running_loop()
|
|
202
193
|
except RuntimeError:
|
|
@@ -345,8 +336,8 @@ def compile_custom_component(
|
|
|
345
336
|
|
|
346
337
|
def create_document_root(
|
|
347
338
|
head_components: list[Component] | None = None,
|
|
348
|
-
html_lang:
|
|
349
|
-
html_custom_attrs:
|
|
339
|
+
html_lang: str | None = None,
|
|
340
|
+
html_custom_attrs: dict[str, Var | str] | None = None,
|
|
350
341
|
) -> Component:
|
|
351
342
|
"""Create the document root.
|
|
352
343
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.base.fragment import Fragment
|
|
9
9
|
from reflex.event import EventType
|
|
@@ -16,12 +16,12 @@ class AppWrap(Fragment):
|
|
|
16
16
|
def create( # type: ignore
|
|
17
17
|
cls,
|
|
18
18
|
*children,
|
|
19
|
-
style:
|
|
20
|
-
key:
|
|
21
|
-
id:
|
|
22
|
-
class_name:
|
|
23
|
-
autofocus:
|
|
24
|
-
custom_attrs:
|
|
19
|
+
style: Style | None = None,
|
|
20
|
+
key: Any | None = None,
|
|
21
|
+
id: Any | None = None,
|
|
22
|
+
class_name: Any | None = None,
|
|
23
|
+
autofocus: bool | None = None,
|
|
24
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
25
25
|
on_blur: Optional[EventType[()]] = None,
|
|
26
26
|
on_click: Optional[EventType[()]] = None,
|
|
27
27
|
on_context_menu: Optional[EventType[()]] = None,
|
reflex/components/base/bare.py
CHANGED
|
@@ -70,13 +70,13 @@ class Bare(Component):
|
|
|
70
70
|
if isinstance(contents, Var):
|
|
71
71
|
if isinstance(contents, LiteralStringVar):
|
|
72
72
|
validate_str(contents._var_value)
|
|
73
|
-
return cls(contents=contents)
|
|
73
|
+
return cls._unsafe_create(children=[], contents=contents)
|
|
74
74
|
else:
|
|
75
75
|
if isinstance(contents, str):
|
|
76
76
|
validate_str(contents)
|
|
77
|
-
contents =
|
|
77
|
+
contents = Var.create(contents if contents is not None else "")
|
|
78
78
|
|
|
79
|
-
return cls(contents=contents)
|
|
79
|
+
return cls._unsafe_create(children=[], contents=contents)
|
|
80
80
|
|
|
81
81
|
def _get_all_hooks_internal(self) -> dict[str, VarData | None]:
|
|
82
82
|
"""Include the hooks for the component.
|
reflex/components/base/body.pyi
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
9
|
from reflex.event import EventType
|
|
@@ -16,12 +16,12 @@ class Body(Component):
|
|
|
16
16
|
def create( # type: ignore
|
|
17
17
|
cls,
|
|
18
18
|
*children,
|
|
19
|
-
style:
|
|
20
|
-
key:
|
|
21
|
-
id:
|
|
22
|
-
class_name:
|
|
23
|
-
autofocus:
|
|
24
|
-
custom_attrs:
|
|
19
|
+
style: Style | None = None,
|
|
20
|
+
key: Any | None = None,
|
|
21
|
+
id: Any | None = None,
|
|
22
|
+
class_name: Any | None = None,
|
|
23
|
+
autofocus: bool | None = None,
|
|
24
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
25
25
|
on_blur: Optional[EventType[()]] = None,
|
|
26
26
|
on_click: Optional[EventType[()]] = None,
|
|
27
27
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"""Document components."""
|
|
2
2
|
|
|
3
|
-
from typing import Optional
|
|
4
|
-
|
|
5
3
|
from reflex.components.component import Component
|
|
6
4
|
|
|
7
5
|
|
|
@@ -16,7 +14,7 @@ class Html(NextDocumentLib):
|
|
|
16
14
|
|
|
17
15
|
tag = "Html"
|
|
18
16
|
|
|
19
|
-
lang:
|
|
17
|
+
lang: str | None
|
|
20
18
|
|
|
21
19
|
|
|
22
20
|
class DocumentHead(NextDocumentLib):
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
9
|
from reflex.event import EventType
|
|
@@ -16,12 +16,12 @@ class NextDocumentLib(Component):
|
|
|
16
16
|
def create( # type: ignore
|
|
17
17
|
cls,
|
|
18
18
|
*children,
|
|
19
|
-
style:
|
|
20
|
-
key:
|
|
21
|
-
id:
|
|
22
|
-
class_name:
|
|
23
|
-
autofocus:
|
|
24
|
-
custom_attrs:
|
|
19
|
+
style: Style | None = None,
|
|
20
|
+
key: Any | None = None,
|
|
21
|
+
id: Any | None = None,
|
|
22
|
+
class_name: Any | None = None,
|
|
23
|
+
autofocus: bool | None = None,
|
|
24
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
25
25
|
on_blur: Optional[EventType[()]] = None,
|
|
26
26
|
on_click: Optional[EventType[()]] = None,
|
|
27
27
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -62,13 +62,13 @@ class Html(NextDocumentLib):
|
|
|
62
62
|
def create( # type: ignore
|
|
63
63
|
cls,
|
|
64
64
|
*children,
|
|
65
|
-
lang:
|
|
66
|
-
style:
|
|
67
|
-
key:
|
|
68
|
-
id:
|
|
69
|
-
class_name:
|
|
70
|
-
autofocus:
|
|
71
|
-
custom_attrs:
|
|
65
|
+
lang: str | None = None,
|
|
66
|
+
style: Style | None = None,
|
|
67
|
+
key: Any | None = None,
|
|
68
|
+
id: Any | None = None,
|
|
69
|
+
class_name: Any | None = None,
|
|
70
|
+
autofocus: bool | None = None,
|
|
71
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
72
72
|
on_blur: Optional[EventType[()]] = None,
|
|
73
73
|
on_click: Optional[EventType[()]] = None,
|
|
74
74
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -109,12 +109,12 @@ class DocumentHead(NextDocumentLib):
|
|
|
109
109
|
def create( # type: ignore
|
|
110
110
|
cls,
|
|
111
111
|
*children,
|
|
112
|
-
style:
|
|
113
|
-
key:
|
|
114
|
-
id:
|
|
115
|
-
class_name:
|
|
116
|
-
autofocus:
|
|
117
|
-
custom_attrs:
|
|
112
|
+
style: Style | None = None,
|
|
113
|
+
key: Any | None = None,
|
|
114
|
+
id: Any | None = None,
|
|
115
|
+
class_name: Any | None = None,
|
|
116
|
+
autofocus: bool | None = None,
|
|
117
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
118
118
|
on_blur: Optional[EventType[()]] = None,
|
|
119
119
|
on_click: Optional[EventType[()]] = None,
|
|
120
120
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -155,12 +155,12 @@ class Main(NextDocumentLib):
|
|
|
155
155
|
def create( # type: ignore
|
|
156
156
|
cls,
|
|
157
157
|
*children,
|
|
158
|
-
style:
|
|
159
|
-
key:
|
|
160
|
-
id:
|
|
161
|
-
class_name:
|
|
162
|
-
autofocus:
|
|
163
|
-
custom_attrs:
|
|
158
|
+
style: Style | None = None,
|
|
159
|
+
key: Any | None = None,
|
|
160
|
+
id: Any | None = None,
|
|
161
|
+
class_name: Any | None = None,
|
|
162
|
+
autofocus: bool | None = None,
|
|
163
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
164
164
|
on_blur: Optional[EventType[()]] = None,
|
|
165
165
|
on_click: Optional[EventType[()]] = None,
|
|
166
166
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -201,12 +201,12 @@ class NextScript(NextDocumentLib):
|
|
|
201
201
|
def create( # type: ignore
|
|
202
202
|
cls,
|
|
203
203
|
*children,
|
|
204
|
-
style:
|
|
205
|
-
key:
|
|
206
|
-
id:
|
|
207
|
-
class_name:
|
|
208
|
-
autofocus:
|
|
209
|
-
custom_attrs:
|
|
204
|
+
style: Style | None = None,
|
|
205
|
+
key: Any | None = None,
|
|
206
|
+
id: Any | None = None,
|
|
207
|
+
class_name: Any | None = None,
|
|
208
|
+
autofocus: bool | None = None,
|
|
209
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
210
210
|
on_blur: Optional[EventType[()]] = None,
|
|
211
211
|
on_click: Optional[EventType[()]] = None,
|
|
212
212
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Tuple
|
|
6
|
-
|
|
7
5
|
from reflex.components.component import Component
|
|
8
6
|
from reflex.components.datadisplay.logo import svg_logo
|
|
9
7
|
from reflex.components.el import a, button, details, div, h2, hr, p, pre, summary
|
|
@@ -15,8 +13,8 @@ from reflex.vars.object import ObjectVar
|
|
|
15
13
|
|
|
16
14
|
|
|
17
15
|
def on_error_spec(
|
|
18
|
-
error: ObjectVar[
|
|
19
|
-
) ->
|
|
16
|
+
error: ObjectVar[dict[str, str]], info: ObjectVar[dict[str, str]]
|
|
17
|
+
) -> tuple[Var[str], Var[str]]:
|
|
20
18
|
"""The spec for the on_error event handler.
|
|
21
19
|
|
|
22
20
|
Args:
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
9
|
from reflex.event import EventType
|
|
@@ -12,8 +12,8 @@ from reflex.vars.base import Var
|
|
|
12
12
|
from reflex.vars.object import ObjectVar
|
|
13
13
|
|
|
14
14
|
def on_error_spec(
|
|
15
|
-
error: ObjectVar[
|
|
16
|
-
) ->
|
|
15
|
+
error: ObjectVar[dict[str, str]], info: ObjectVar[dict[str, str]]
|
|
16
|
+
) -> tuple[Var[str], Var[str]]: ...
|
|
17
17
|
|
|
18
18
|
class ErrorBoundary(Component):
|
|
19
19
|
@overload
|
|
@@ -21,20 +21,18 @@ class ErrorBoundary(Component):
|
|
|
21
21
|
def create( # type: ignore
|
|
22
22
|
cls,
|
|
23
23
|
*children,
|
|
24
|
-
fallback_render:
|
|
25
|
-
style:
|
|
26
|
-
key:
|
|
27
|
-
id:
|
|
28
|
-
class_name:
|
|
29
|
-
autofocus:
|
|
30
|
-
custom_attrs:
|
|
24
|
+
fallback_render: Component | Var[Component] | None = None,
|
|
25
|
+
style: Style | None = None,
|
|
26
|
+
key: Any | None = None,
|
|
27
|
+
id: Any | None = None,
|
|
28
|
+
class_name: Any | None = None,
|
|
29
|
+
autofocus: bool | None = None,
|
|
30
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
31
31
|
on_blur: Optional[EventType[()]] = None,
|
|
32
32
|
on_click: Optional[EventType[()]] = None,
|
|
33
33
|
on_context_menu: Optional[EventType[()]] = None,
|
|
34
34
|
on_double_click: Optional[EventType[()]] = None,
|
|
35
|
-
on_error: Optional[
|
|
36
|
-
Union[EventType[()], EventType[str], EventType[str, str]]
|
|
37
|
-
] = None,
|
|
35
|
+
on_error: Optional[EventType[()] | EventType[str] | EventType[str, str]] = None,
|
|
38
36
|
on_focus: Optional[EventType[()]] = None,
|
|
39
37
|
on_mount: Optional[EventType[()]] = None,
|
|
40
38
|
on_mouse_down: Optional[EventType[()]] = None,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
9
|
from reflex.event import EventType
|
|
@@ -16,12 +16,12 @@ class Fragment(Component):
|
|
|
16
16
|
def create( # type: ignore
|
|
17
17
|
cls,
|
|
18
18
|
*children,
|
|
19
|
-
style:
|
|
20
|
-
key:
|
|
21
|
-
id:
|
|
22
|
-
class_name:
|
|
23
|
-
autofocus:
|
|
24
|
-
custom_attrs:
|
|
19
|
+
style: Style | None = None,
|
|
20
|
+
key: Any | None = None,
|
|
21
|
+
id: Any | None = None,
|
|
22
|
+
class_name: Any | None = None,
|
|
23
|
+
autofocus: bool | None = None,
|
|
24
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
25
25
|
on_blur: Optional[EventType[()]] = None,
|
|
26
26
|
on_click: Optional[EventType[()]] = None,
|
|
27
27
|
on_context_menu: Optional[EventType[()]] = None,
|
reflex/components/base/head.pyi
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component, MemoizationLeaf
|
|
9
9
|
from reflex.event import EventType
|
|
@@ -16,12 +16,12 @@ class NextHeadLib(Component):
|
|
|
16
16
|
def create( # type: ignore
|
|
17
17
|
cls,
|
|
18
18
|
*children,
|
|
19
|
-
style:
|
|
20
|
-
key:
|
|
21
|
-
id:
|
|
22
|
-
class_name:
|
|
23
|
-
autofocus:
|
|
24
|
-
custom_attrs:
|
|
19
|
+
style: Style | None = None,
|
|
20
|
+
key: Any | None = None,
|
|
21
|
+
id: Any | None = None,
|
|
22
|
+
class_name: Any | None = None,
|
|
23
|
+
autofocus: bool | None = None,
|
|
24
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
25
25
|
on_blur: Optional[EventType[()]] = None,
|
|
26
26
|
on_click: Optional[EventType[()]] = None,
|
|
27
27
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -62,12 +62,12 @@ class Head(NextHeadLib, MemoizationLeaf):
|
|
|
62
62
|
def create( # type: ignore
|
|
63
63
|
cls,
|
|
64
64
|
*children,
|
|
65
|
-
style:
|
|
66
|
-
key:
|
|
67
|
-
id:
|
|
68
|
-
class_name:
|
|
69
|
-
autofocus:
|
|
70
|
-
custom_attrs:
|
|
65
|
+
style: Style | None = None,
|
|
66
|
+
key: Any | None = None,
|
|
67
|
+
id: Any | None = None,
|
|
68
|
+
class_name: Any | None = None,
|
|
69
|
+
autofocus: bool | None = None,
|
|
70
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
71
71
|
on_blur: Optional[EventType[()]] = None,
|
|
72
72
|
on_click: Optional[EventType[()]] = None,
|
|
73
73
|
on_context_menu: Optional[EventType[()]] = None,
|
reflex/components/base/link.pyi
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
9
|
from reflex.event import EventType
|
|
@@ -16,14 +16,14 @@ class RawLink(Component):
|
|
|
16
16
|
def create( # type: ignore
|
|
17
17
|
cls,
|
|
18
18
|
*children,
|
|
19
|
-
href:
|
|
20
|
-
rel:
|
|
21
|
-
style:
|
|
22
|
-
key:
|
|
23
|
-
id:
|
|
24
|
-
class_name:
|
|
25
|
-
autofocus:
|
|
26
|
-
custom_attrs:
|
|
19
|
+
href: Var[str] | str | None = None,
|
|
20
|
+
rel: Var[str] | str | None = None,
|
|
21
|
+
style: Style | None = None,
|
|
22
|
+
key: Any | None = None,
|
|
23
|
+
id: Any | None = None,
|
|
24
|
+
class_name: Any | None = None,
|
|
25
|
+
autofocus: bool | None = None,
|
|
26
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
27
27
|
on_blur: Optional[EventType[()]] = None,
|
|
28
28
|
on_click: Optional[EventType[()]] = None,
|
|
29
29
|
on_context_menu: Optional[EventType[()]] = None,
|
|
@@ -66,19 +66,19 @@ class ScriptTag(Component):
|
|
|
66
66
|
def create( # type: ignore
|
|
67
67
|
cls,
|
|
68
68
|
*children,
|
|
69
|
-
type_:
|
|
70
|
-
source:
|
|
71
|
-
integrity:
|
|
72
|
-
crossorigin:
|
|
73
|
-
referrer_policy:
|
|
74
|
-
is_async:
|
|
75
|
-
defer:
|
|
76
|
-
style:
|
|
77
|
-
key:
|
|
78
|
-
id:
|
|
79
|
-
class_name:
|
|
80
|
-
autofocus:
|
|
81
|
-
custom_attrs:
|
|
69
|
+
type_: Var[str] | str | None = None,
|
|
70
|
+
source: Var[str] | str | None = None,
|
|
71
|
+
integrity: Var[str] | str | None = None,
|
|
72
|
+
crossorigin: Var[str] | str | None = None,
|
|
73
|
+
referrer_policy: Var[str] | str | None = None,
|
|
74
|
+
is_async: Var[bool] | bool | None = None,
|
|
75
|
+
defer: Var[bool] | bool | None = None,
|
|
76
|
+
style: Style | None = None,
|
|
77
|
+
key: Any | None = None,
|
|
78
|
+
id: Any | None = None,
|
|
79
|
+
class_name: Any | None = None,
|
|
80
|
+
autofocus: bool | None = None,
|
|
81
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
82
82
|
on_blur: Optional[EventType[()]] = None,
|
|
83
83
|
on_click: Optional[EventType[()]] = None,
|
|
84
84
|
on_context_menu: Optional[EventType[()]] = None,
|
reflex/components/base/meta.py
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Optional
|
|
6
|
-
|
|
7
5
|
from reflex.components.base.bare import Bare
|
|
8
6
|
from reflex.components.component import Component
|
|
9
7
|
|
|
@@ -34,19 +32,19 @@ class Meta(Component):
|
|
|
34
32
|
tag = "meta"
|
|
35
33
|
|
|
36
34
|
# The description of character encoding.
|
|
37
|
-
char_set:
|
|
35
|
+
char_set: str | None = None
|
|
38
36
|
|
|
39
37
|
# The value of meta.
|
|
40
|
-
content:
|
|
38
|
+
content: str | None = None
|
|
41
39
|
|
|
42
40
|
# The name of metadata.
|
|
43
|
-
name:
|
|
41
|
+
name: str | None = None
|
|
44
42
|
|
|
45
43
|
# The type of metadata value.
|
|
46
|
-
property:
|
|
44
|
+
property: str | None = None
|
|
47
45
|
|
|
48
46
|
# The type of metadata value.
|
|
49
|
-
http_equiv:
|
|
47
|
+
http_equiv: str | None = None
|
|
50
48
|
|
|
51
49
|
|
|
52
50
|
class Description(Meta):
|