reflex 0.4.5a1__py3-none-any.whl → 0.4.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/jinja/custom_components/pyproject.toml.jinja2 +5 -15
- reflex/.templates/jinja/web/pages/index.js.jinja2 +4 -0
- reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +4 -0
- reflex/.templates/web/utils/state.js +3 -0
- reflex/__init__.py +12 -2
- reflex/__init__.pyi +4 -0
- reflex/app.py +23 -3
- reflex/base.py +16 -4
- reflex/compiler/compiler.py +1 -0
- reflex/compiler/utils.py +11 -2
- reflex/components/base/app_wrap.pyi +1 -1
- reflex/components/base/bare.py +3 -4
- reflex/components/base/body.pyi +1 -1
- reflex/components/base/document.pyi +1 -1
- reflex/components/base/fragment.pyi +1 -1
- reflex/components/base/head.pyi +1 -1
- reflex/components/base/link.pyi +1 -1
- reflex/components/base/meta.pyi +1 -1
- reflex/components/base/script.pyi +1 -1
- reflex/components/chakra/base.pyi +1 -1
- reflex/components/chakra/datadisplay/badge.pyi +1 -1
- reflex/components/chakra/datadisplay/code.pyi +1 -1
- reflex/components/chakra/datadisplay/divider.pyi +1 -1
- reflex/components/chakra/datadisplay/keyboard_key.pyi +1 -1
- reflex/components/chakra/datadisplay/list.pyi +1 -1
- reflex/components/chakra/datadisplay/stat.pyi +1 -1
- reflex/components/chakra/datadisplay/table.pyi +1 -1
- reflex/components/chakra/datadisplay/tag.pyi +1 -1
- reflex/components/chakra/disclosure/accordion.pyi +1 -1
- reflex/components/chakra/disclosure/tabs.pyi +1 -1
- reflex/components/chakra/disclosure/transition.pyi +1 -1
- reflex/components/chakra/disclosure/visuallyhidden.pyi +1 -1
- reflex/components/chakra/feedback/alert.pyi +1 -1
- reflex/components/chakra/feedback/circularprogress.pyi +1 -1
- reflex/components/chakra/feedback/progress.pyi +1 -1
- reflex/components/chakra/feedback/skeleton.pyi +1 -1
- reflex/components/chakra/feedback/spinner.pyi +1 -1
- reflex/components/chakra/forms/button.pyi +1 -1
- reflex/components/chakra/forms/checkbox.pyi +1 -1
- reflex/components/chakra/forms/colormodeswitch.pyi +1 -1
- reflex/components/chakra/forms/date_picker.pyi +1 -1
- reflex/components/chakra/forms/date_time_picker.pyi +1 -1
- reflex/components/chakra/forms/editable.pyi +1 -1
- reflex/components/chakra/forms/email.pyi +1 -1
- reflex/components/chakra/forms/form.pyi +1 -1
- reflex/components/chakra/forms/iconbutton.pyi +1 -1
- reflex/components/chakra/forms/input.pyi +1 -1
- reflex/components/chakra/forms/numberinput.pyi +1 -1
- reflex/components/chakra/forms/password.pyi +1 -1
- reflex/components/chakra/forms/pininput.pyi +1 -1
- reflex/components/chakra/forms/radio.pyi +1 -1
- reflex/components/chakra/forms/rangeslider.pyi +1 -1
- reflex/components/chakra/forms/select.pyi +1 -1
- reflex/components/chakra/forms/slider.pyi +1 -1
- reflex/components/chakra/forms/switch.pyi +1 -1
- reflex/components/chakra/forms/textarea.pyi +1 -1
- reflex/components/chakra/forms/time_picker.pyi +1 -1
- reflex/components/chakra/layout/aspect_ratio.pyi +1 -1
- reflex/components/chakra/layout/box.pyi +1 -1
- reflex/components/chakra/layout/card.pyi +1 -1
- reflex/components/chakra/layout/center.pyi +1 -1
- reflex/components/chakra/layout/container.pyi +1 -1
- reflex/components/chakra/layout/flex.pyi +1 -1
- reflex/components/chakra/layout/grid.pyi +1 -1
- reflex/components/chakra/layout/spacer.pyi +1 -1
- reflex/components/chakra/layout/stack.pyi +1 -1
- reflex/components/chakra/layout/wrap.pyi +1 -1
- reflex/components/chakra/media/avatar.pyi +1 -1
- reflex/components/chakra/media/icon.pyi +1 -1
- reflex/components/chakra/media/image.pyi +1 -1
- reflex/components/chakra/navigation/breadcrumb.pyi +1 -1
- reflex/components/chakra/navigation/link.pyi +1 -1
- reflex/components/chakra/navigation/linkoverlay.pyi +1 -1
- reflex/components/chakra/navigation/stepper.pyi +1 -1
- reflex/components/chakra/overlay/alertdialog.pyi +1 -1
- reflex/components/chakra/overlay/drawer.pyi +1 -1
- reflex/components/chakra/overlay/menu.pyi +1 -1
- reflex/components/chakra/overlay/modal.pyi +1 -1
- reflex/components/chakra/overlay/popover.pyi +1 -1
- reflex/components/chakra/overlay/tooltip.pyi +1 -1
- reflex/components/chakra/typography/heading.pyi +1 -1
- reflex/components/chakra/typography/highlight.pyi +1 -1
- reflex/components/chakra/typography/span.pyi +1 -1
- reflex/components/chakra/typography/text.pyi +1 -1
- reflex/components/component.py +82 -30
- reflex/components/core/banner.py +1 -2
- reflex/components/core/banner.pyi +1 -2
- reflex/components/core/client_side_routing.pyi +1 -1
- reflex/components/core/cond.py +1 -1
- reflex/components/core/debounce.pyi +1 -1
- reflex/components/core/html.pyi +1 -1
- reflex/components/core/responsive.py +1 -1
- reflex/components/core/upload.pyi +1 -1
- reflex/components/datadisplay/code.py +17 -9
- reflex/components/datadisplay/code.pyi +3 -1
- reflex/components/datadisplay/dataeditor.pyi +1 -1
- reflex/components/el/element.pyi +1 -1
- reflex/components/el/elements/base.pyi +1 -1
- reflex/components/el/elements/forms.py +78 -1
- reflex/components/el/elements/forms.pyi +10 -2
- reflex/components/el/elements/inline.pyi +1 -1
- reflex/components/el/elements/media.pyi +1 -1
- reflex/components/el/elements/metadata.pyi +1 -1
- reflex/components/el/elements/other.pyi +1 -1
- reflex/components/el/elements/scripts.pyi +1 -1
- reflex/components/el/elements/sectioning.pyi +1 -1
- reflex/components/el/elements/tables.pyi +1 -1
- reflex/components/el/elements/typography.pyi +1 -1
- reflex/components/gridjs/datatable.pyi +1 -1
- reflex/components/lucide/icon.py +275 -115
- reflex/components/lucide/icon.pyi +259 -114
- reflex/components/markdown/markdown.pyi +1 -1
- reflex/components/moment/moment.pyi +1 -1
- reflex/components/next/base.pyi +1 -1
- reflex/components/next/image.pyi +1 -1
- reflex/components/next/link.pyi +1 -1
- reflex/components/next/video.pyi +1 -1
- reflex/components/plotly/plotly.pyi +1 -1
- reflex/components/radix/primitives/accordion.pyi +1 -1
- reflex/components/radix/primitives/base.pyi +1 -1
- reflex/components/radix/primitives/drawer.pyi +1 -1
- reflex/components/radix/primitives/form.pyi +1 -1
- reflex/components/radix/primitives/progress.pyi +1 -1
- reflex/components/radix/primitives/slider.pyi +1 -1
- reflex/components/radix/themes/base.pyi +1 -1
- reflex/components/radix/themes/color_mode.pyi +1 -1
- reflex/components/radix/themes/components/alert_dialog.pyi +1 -1
- reflex/components/radix/themes/components/aspect_ratio.pyi +1 -1
- reflex/components/radix/themes/components/avatar.pyi +1 -1
- reflex/components/radix/themes/components/badge.pyi +1 -1
- reflex/components/radix/themes/components/button.pyi +1 -1
- reflex/components/radix/themes/components/callout.pyi +1 -1
- reflex/components/radix/themes/components/card.pyi +1 -1
- reflex/components/radix/themes/components/checkbox.pyi +1 -1
- reflex/components/radix/themes/components/context_menu.pyi +1 -1
- reflex/components/radix/themes/components/dialog.pyi +1 -1
- reflex/components/radix/themes/components/dropdown_menu.pyi +1 -1
- reflex/components/radix/themes/components/hover_card.pyi +1 -1
- reflex/components/radix/themes/components/icon_button.pyi +1 -1
- reflex/components/radix/themes/components/inset.pyi +1 -1
- reflex/components/radix/themes/components/popover.pyi +1 -1
- reflex/components/radix/themes/components/radio_group.pyi +1 -1
- reflex/components/radix/themes/components/scroll_area.pyi +1 -1
- reflex/components/radix/themes/components/select.py +4 -1
- reflex/components/radix/themes/components/select.pyi +5 -1
- reflex/components/radix/themes/components/separator.pyi +1 -1
- reflex/components/radix/themes/components/slider.pyi +1 -1
- reflex/components/radix/themes/components/switch.pyi +1 -1
- reflex/components/radix/themes/components/table.pyi +1 -1
- reflex/components/radix/themes/components/tabs.pyi +1 -1
- reflex/components/radix/themes/components/text_area.pyi +5 -1
- reflex/components/radix/themes/components/text_field.pyi +1 -1
- reflex/components/radix/themes/components/tooltip.pyi +1 -1
- reflex/components/radix/themes/layout/__init__.py +5 -4
- reflex/components/radix/themes/layout/base.pyi +1 -1
- reflex/components/radix/themes/layout/box.pyi +1 -1
- reflex/components/radix/themes/layout/center.pyi +1 -1
- reflex/components/radix/themes/layout/container.pyi +1 -1
- reflex/components/radix/themes/layout/flex.pyi +1 -1
- reflex/components/radix/themes/layout/grid.pyi +1 -1
- reflex/components/radix/themes/layout/list.py +21 -13
- reflex/components/radix/themes/layout/list.pyi +139 -481
- reflex/components/radix/themes/layout/section.pyi +1 -1
- reflex/components/radix/themes/layout/spacer.pyi +1 -1
- reflex/components/radix/themes/layout/stack.pyi +1 -1
- reflex/components/radix/themes/typography/blockquote.pyi +1 -1
- reflex/components/radix/themes/typography/code.pyi +1 -1
- reflex/components/radix/themes/typography/heading.pyi +1 -1
- reflex/components/radix/themes/typography/link.pyi +1 -1
- reflex/components/radix/themes/typography/text.pyi +1 -1
- reflex/components/react_player/audio.pyi +1 -1
- reflex/components/react_player/react_player.pyi +1 -1
- reflex/components/react_player/video.pyi +1 -1
- reflex/components/recharts/cartesian.pyi +1 -1
- reflex/components/recharts/charts.pyi +1 -1
- reflex/components/recharts/general.pyi +1 -1
- reflex/components/recharts/polar.pyi +1 -1
- reflex/components/recharts/recharts.pyi +1 -1
- reflex/components/suneditor/editor.pyi +1 -1
- reflex/config.py +12 -2
- reflex/custom_components/custom_components.py +305 -21
- reflex/event.py +36 -46
- reflex/reflex.py +19 -13
- reflex/state.py +184 -39
- reflex/testing.py +15 -11
- reflex/utils/console.py +15 -7
- reflex/utils/exec.py +9 -0
- reflex/utils/prerequisites.py +12 -1
- reflex/utils/processes.py +8 -25
- reflex/utils/pyi_generator.py +842 -0
- reflex/utils/telemetry.py +18 -1
- reflex/utils/types.py +14 -2
- reflex/vars.py +33 -3
- {reflex-0.4.5a1.dist-info → reflex-0.4.6.dist-info}/METADATA +31 -29
- {reflex-0.4.5a1.dist-info → reflex-0.4.6.dist-info}/RECORD +198 -198
- reflex/page.pyi +0 -17
- {reflex-0.4.5a1.dist-info → reflex-0.4.6.dist-info}/LICENSE +0 -0
- {reflex-0.4.5a1.dist-info → reflex-0.4.6.dist-info}/WHEEL +0 -0
- {reflex-0.4.5a1.dist-info → reflex-0.4.6.dist-info}/entry_points.txt +0 -0
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = [
|
|
3
|
-
"setuptools",
|
|
4
|
-
"wheel",
|
|
5
|
-
]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
6
3
|
build-backend = "setuptools.build_meta"
|
|
7
4
|
|
|
8
5
|
[project]
|
|
@@ -12,21 +9,14 @@ description = "Reflex custom component {{ module_name }}"
|
|
|
12
9
|
readme = "README.md"
|
|
13
10
|
license = { text = "Apache-2.0" }
|
|
14
11
|
requires-python = ">=3.8"
|
|
15
|
-
authors = [{ name = "
|
|
16
|
-
keywords = [
|
|
17
|
-
"reflex",
|
|
18
|
-
"reflex-custom-components"]
|
|
12
|
+
authors = [{ name = "", email = "YOUREMAIL@domain.com" }]
|
|
13
|
+
keywords = ["reflex", "reflex-custom-components"]
|
|
19
14
|
|
|
20
|
-
dependencies = [
|
|
21
|
-
"reflex>=0.4.2"
|
|
22
|
-
]
|
|
15
|
+
dependencies = ["reflex>=0.4.2"]
|
|
23
16
|
|
|
24
|
-
classifiers = [
|
|
25
|
-
"Development Status :: 4 - Beta",
|
|
26
|
-
]
|
|
17
|
+
classifiers = ["Development Status :: 4 - Beta"]
|
|
27
18
|
|
|
28
19
|
[project.urls]
|
|
29
|
-
Homepage = "https://github.com"
|
|
30
20
|
|
|
31
21
|
[project.optional-dependencies]
|
|
32
22
|
dev = ["build", "twine"]
|
|
@@ -646,9 +646,12 @@ export const useEventLoop = (
|
|
|
646
646
|
|
|
647
647
|
// Route after the initial page hydration.
|
|
648
648
|
useEffect(() => {
|
|
649
|
+
const change_start = () => dispatch["state"]({is_hydrated: false})
|
|
649
650
|
const change_complete = () => addEvents(onLoadInternalEvent());
|
|
651
|
+
router.events.on("routeChangeStart", change_start);
|
|
650
652
|
router.events.on("routeChangeComplete", change_complete);
|
|
651
653
|
return () => {
|
|
654
|
+
router.events.off("routeChangeStart", change_start);
|
|
652
655
|
router.events.off("routeChangeComplete", change_complete);
|
|
653
656
|
};
|
|
654
657
|
}, [router]);
|
reflex/__init__.py
CHANGED
|
@@ -104,6 +104,7 @@ _ALL_COMPONENTS = [
|
|
|
104
104
|
"EditorOptions",
|
|
105
105
|
"icon",
|
|
106
106
|
"markdown",
|
|
107
|
+
"list",
|
|
107
108
|
"list_item",
|
|
108
109
|
"unordered_list",
|
|
109
110
|
"ordered_list",
|
|
@@ -130,6 +131,7 @@ _MAPPING = {
|
|
|
130
131
|
"reflex.event": [
|
|
131
132
|
"event",
|
|
132
133
|
"EventChain",
|
|
134
|
+
"EventHandler",
|
|
133
135
|
"background",
|
|
134
136
|
"call_script",
|
|
135
137
|
"clear_local_storage",
|
|
@@ -141,6 +143,7 @@ _MAPPING = {
|
|
|
141
143
|
"remove_local_storage",
|
|
142
144
|
"set_clipboard",
|
|
143
145
|
"set_focus",
|
|
146
|
+
"scroll_to",
|
|
144
147
|
"set_value",
|
|
145
148
|
"stop_propagation",
|
|
146
149
|
"upload_files",
|
|
@@ -150,7 +153,14 @@ _MAPPING = {
|
|
|
150
153
|
"reflex.model": ["model", "session", "Model"],
|
|
151
154
|
"reflex.page": ["page"],
|
|
152
155
|
"reflex.route": ["route"],
|
|
153
|
-
"reflex.state": [
|
|
156
|
+
"reflex.state": [
|
|
157
|
+
"state",
|
|
158
|
+
"var",
|
|
159
|
+
"Cookie",
|
|
160
|
+
"LocalStorage",
|
|
161
|
+
"ComponentState",
|
|
162
|
+
"State",
|
|
163
|
+
],
|
|
154
164
|
"reflex.style": ["style", "toggle_color_mode"],
|
|
155
165
|
"reflex.testing": ["testing"],
|
|
156
166
|
"reflex.utils": ["utils"],
|
|
@@ -187,7 +197,7 @@ def _removeprefix(text, prefix):
|
|
|
187
197
|
return text[text.startswith(prefix) and len(prefix) :]
|
|
188
198
|
|
|
189
199
|
|
|
190
|
-
__all__ =
|
|
200
|
+
__all__ = (_removeprefix(mod, "reflex.") for mod in _MAPPING)
|
|
191
201
|
|
|
192
202
|
|
|
193
203
|
def __getattr__(name: str) -> Type:
|
reflex/__init__.pyi
CHANGED
|
@@ -90,6 +90,7 @@ from reflex.components import EditorButtonList as EditorButtonList
|
|
|
90
90
|
from reflex.components import EditorOptions as EditorOptions
|
|
91
91
|
from reflex.components import icon as icon
|
|
92
92
|
from reflex.components import markdown as markdown
|
|
93
|
+
from reflex.components import list as list
|
|
93
94
|
from reflex.components import list_item as list_item
|
|
94
95
|
from reflex.components import unordered_list as unordered_list
|
|
95
96
|
from reflex.components import ordered_list as ordered_list
|
|
@@ -112,6 +113,7 @@ from reflex import constants as constants
|
|
|
112
113
|
from reflex.constants import Env as Env
|
|
113
114
|
from reflex import event as event
|
|
114
115
|
from reflex.event import EventChain as EventChain
|
|
116
|
+
from reflex.event import EventHandler as EventHandler
|
|
115
117
|
from reflex.event import background as background
|
|
116
118
|
from reflex.event import call_script as call_script
|
|
117
119
|
from reflex.event import clear_local_storage as clear_local_storage
|
|
@@ -123,6 +125,7 @@ from reflex.event import remove_cookie as remove_cookie
|
|
|
123
125
|
from reflex.event import remove_local_storage as remove_local_storage
|
|
124
126
|
from reflex.event import set_clipboard as set_clipboard
|
|
125
127
|
from reflex.event import set_focus as set_focus
|
|
128
|
+
from reflex.event import scroll_to as scroll_to
|
|
126
129
|
from reflex.event import set_value as set_value
|
|
127
130
|
from reflex.event import stop_propagation as stop_propagation
|
|
128
131
|
from reflex.event import upload_files as upload_files
|
|
@@ -138,6 +141,7 @@ from reflex import state as state
|
|
|
138
141
|
from reflex.state import var as var
|
|
139
142
|
from reflex.state import Cookie as Cookie
|
|
140
143
|
from reflex.state import LocalStorage as LocalStorage
|
|
144
|
+
from reflex.state import ComponentState as ComponentState
|
|
141
145
|
from reflex.state import State as State
|
|
142
146
|
from reflex import style as style
|
|
143
147
|
from reflex.style import toggle_color_mode as toggle_color_mode
|
reflex/app.py
CHANGED
|
@@ -7,6 +7,7 @@ import concurrent.futures
|
|
|
7
7
|
import contextlib
|
|
8
8
|
import copy
|
|
9
9
|
import functools
|
|
10
|
+
import io
|
|
10
11
|
import multiprocessing
|
|
11
12
|
import os
|
|
12
13
|
import platform
|
|
@@ -77,7 +78,7 @@ from reflex.state import (
|
|
|
77
78
|
code_uses_state_contexts,
|
|
78
79
|
)
|
|
79
80
|
from reflex.utils import console, exceptions, format, prerequisites, types
|
|
80
|
-
from reflex.utils.exec import is_testing_env
|
|
81
|
+
from reflex.utils.exec import is_testing_env, should_skip_compile
|
|
81
82
|
from reflex.utils.imports import ImportVar
|
|
82
83
|
|
|
83
84
|
# Define custom types.
|
|
@@ -672,7 +673,7 @@ class App(Base):
|
|
|
672
673
|
Whether the app should be compiled.
|
|
673
674
|
"""
|
|
674
675
|
# Check the environment variable.
|
|
675
|
-
if
|
|
676
|
+
if should_skip_compile():
|
|
676
677
|
return False
|
|
677
678
|
|
|
678
679
|
# Check the nocompile file.
|
|
@@ -1155,10 +1156,29 @@ def upload(app: App):
|
|
|
1155
1156
|
"List[rx.UploadFile]"
|
|
1156
1157
|
)
|
|
1157
1158
|
|
|
1159
|
+
# Make a copy of the files as they are closed after the request.
|
|
1160
|
+
# This behaviour changed from fastapi 0.103.0 to 0.103.1 as the
|
|
1161
|
+
# AsyncExitStack was removed from the request scope and is now
|
|
1162
|
+
# part of the routing function which closes this before the
|
|
1163
|
+
# event is handled.
|
|
1164
|
+
file_copies = []
|
|
1165
|
+
for file in files:
|
|
1166
|
+
content_copy = io.BytesIO()
|
|
1167
|
+
content_copy.write(await file.read())
|
|
1168
|
+
content_copy.seek(0)
|
|
1169
|
+
file_copies.append(
|
|
1170
|
+
UploadFile(
|
|
1171
|
+
file=content_copy,
|
|
1172
|
+
filename=file.filename,
|
|
1173
|
+
size=file.size,
|
|
1174
|
+
headers=file.headers,
|
|
1175
|
+
)
|
|
1176
|
+
)
|
|
1177
|
+
|
|
1158
1178
|
event = Event(
|
|
1159
1179
|
token=token,
|
|
1160
1180
|
name=handler,
|
|
1161
|
-
payload={handler_upload_param[0]:
|
|
1181
|
+
payload={handler_upload_param[0]: file_copies},
|
|
1162
1182
|
)
|
|
1163
1183
|
|
|
1164
1184
|
async def _ndjson_updates():
|
reflex/base.py
CHANGED
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
4
|
import os
|
|
5
|
-
from typing import Any, List, Type
|
|
5
|
+
from typing import TYPE_CHECKING, Any, List, Type
|
|
6
|
+
|
|
7
|
+
try:
|
|
8
|
+
# TODO The type checking guard can be removed once
|
|
9
|
+
# reflex-hosting-cli tools are compatible with pydantic v2
|
|
10
|
+
|
|
11
|
+
if not TYPE_CHECKING:
|
|
12
|
+
import pydantic.v1 as pydantic
|
|
13
|
+
from pydantic.v1 import BaseModel
|
|
14
|
+
from pydantic.v1.fields import ModelField
|
|
15
|
+
else:
|
|
16
|
+
raise ModuleNotFoundError
|
|
17
|
+
except ModuleNotFoundError:
|
|
18
|
+
import pydantic
|
|
19
|
+
from pydantic import BaseModel
|
|
20
|
+
from pydantic.fields import ModelField
|
|
6
21
|
|
|
7
|
-
import pydantic
|
|
8
|
-
from pydantic import BaseModel
|
|
9
|
-
from pydantic.fields import ModelField
|
|
10
22
|
|
|
11
23
|
from reflex import constants
|
|
12
24
|
|
reflex/compiler/compiler.py
CHANGED
|
@@ -119,6 +119,7 @@ def _compile_page(
|
|
|
119
119
|
imports=imports,
|
|
120
120
|
dynamic_imports=component.get_dynamic_imports(),
|
|
121
121
|
custom_codes=component.get_custom_code(),
|
|
122
|
+
ref_hooks=component.get_ref_hooks(),
|
|
122
123
|
hooks=component.get_hooks_internal() | component.get_hooks(),
|
|
123
124
|
render=component.render(),
|
|
124
125
|
**kwargs,
|
reflex/compiler/utils.py
CHANGED
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
from typing import Any, Callable, Dict, Optional, Type, Union
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Type, Union
|
|
7
7
|
from urllib.parse import urlparse
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
try:
|
|
10
|
+
# TODO The type checking guard can be removed once
|
|
11
|
+
# reflex-hosting-cli tools are compatible with pydantic v2
|
|
12
|
+
|
|
13
|
+
if not TYPE_CHECKING:
|
|
14
|
+
import pydantic.v1.fields as ModelField
|
|
15
|
+
else:
|
|
16
|
+
raise ModuleNotFoundError
|
|
17
|
+
except ModuleNotFoundError:
|
|
18
|
+
from pydantic.fields import ModelField
|
|
10
19
|
|
|
11
20
|
from reflex import constants
|
|
12
21
|
from reflex.components.base import (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/app_wrap.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
reflex/components/base/bare.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""A bare component."""
|
|
2
|
+
|
|
2
3
|
from __future__ import annotations
|
|
3
4
|
|
|
4
5
|
from typing import Any, Iterator
|
|
@@ -27,7 +28,7 @@ class Bare(Component):
|
|
|
27
28
|
if isinstance(contents, Var) and contents._var_data:
|
|
28
29
|
contents = contents.to(str)
|
|
29
30
|
else:
|
|
30
|
-
contents = str(contents)
|
|
31
|
+
contents = str(contents) if contents is not None else ""
|
|
31
32
|
return cls(contents=contents) # type: ignore
|
|
32
33
|
|
|
33
34
|
def _render(self) -> Tag:
|
|
@@ -42,6 +43,4 @@ class Bare(Component):
|
|
|
42
43
|
Yields:
|
|
43
44
|
The contents if it is a Var, otherwise nothing.
|
|
44
45
|
"""
|
|
45
|
-
|
|
46
|
-
# Fast path for Bare text components.
|
|
47
|
-
yield self.contents
|
|
46
|
+
yield self.contents
|
reflex/components/base/body.pyi
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/body.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/document.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/fragment.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
reflex/components/base/head.pyi
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/head.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
reflex/components/base/link.pyi
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/link.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
reflex/components/base/meta.pyi
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/meta.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/base/script.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/base.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/badge.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/code.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/divider.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/keyboard_key.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/list.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/stat.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/table.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/datadisplay/tag.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/disclosure/accordion.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/disclosure/tabs.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/disclosure/transition.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/disclosure/visuallyhidden.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/feedback/alert.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/feedback/circularprogress.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/feedback/progress.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/feedback/skeleton.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/feedback/spinner.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/button.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/checkbox.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/colormodeswitch.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/date_picker.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/date_time_picker.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/editable.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/email.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/form.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/iconbutton.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/input.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub file for reflex/components/chakra/forms/numberinput.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `
|
|
3
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|