reflex 0.7.14a6__py3-none-any.whl → 0.8.0a2__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/app/rxconfig.py.jinja2 +4 -1
- reflex/.templates/jinja/web/package.json.jinja2 +1 -1
- reflex/.templates/jinja/web/pages/_app.js.jinja2 +16 -10
- reflex/.templates/jinja/web/pages/_document.js.jinja2 +1 -1
- reflex/.templates/jinja/web/pages/base_page.js.jinja2 +0 -1
- reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +4 -0
- reflex/.templates/jinja/web/utils/context.js.jinja2 +25 -8
- reflex/.templates/web/app/entry.client.js +8 -0
- reflex/.templates/web/app/routes.js +10 -0
- reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +12 -37
- reflex/.templates/web/postcss.config.js +1 -1
- reflex/.templates/web/react-router.config.js +6 -0
- reflex/.templates/web/utils/client_side_routing.js +21 -19
- reflex/.templates/web/utils/react-theme.js +92 -0
- reflex/.templates/web/utils/state.js +160 -67
- reflex/.templates/web/vite.config.js +32 -0
- reflex/__init__.py +1 -6
- reflex/__init__.pyi +0 -4
- reflex/app.py +53 -116
- reflex/base.py +1 -87
- reflex/compiler/compiler.py +41 -8
- reflex/compiler/templates.py +3 -3
- reflex/compiler/utils.py +73 -33
- reflex/components/__init__.py +0 -2
- reflex/components/__init__.pyi +0 -3
- reflex/components/base/__init__.py +1 -5
- reflex/components/base/__init__.pyi +4 -6
- reflex/components/base/app_wrap.pyi +5 -4
- reflex/components/base/body.pyi +5 -4
- reflex/components/base/document.py +18 -14
- reflex/components/base/document.pyi +83 -27
- reflex/components/base/error_boundary.pyi +5 -4
- reflex/components/base/fragment.pyi +5 -4
- reflex/components/base/link.pyi +9 -7
- reflex/components/base/meta.pyi +17 -13
- reflex/components/base/script.py +60 -58
- reflex/components/base/script.pyi +246 -31
- reflex/components/base/strict_mode.pyi +5 -4
- reflex/components/component.py +146 -217
- reflex/components/core/__init__.py +1 -0
- reflex/components/core/__init__.pyi +1 -0
- reflex/components/core/auto_scroll.pyi +5 -4
- reflex/components/core/banner.pyi +25 -19
- reflex/components/core/client_side_routing.py +7 -6
- reflex/components/core/client_side_routing.pyi +6 -56
- reflex/components/core/clipboard.pyi +5 -4
- reflex/components/core/debounce.py +1 -0
- reflex/components/core/debounce.pyi +5 -4
- reflex/components/core/foreach.py +3 -2
- reflex/components/core/helmet.py +14 -0
- reflex/components/{next/base.pyi → core/helmet.pyi} +10 -7
- reflex/components/core/html.pyi +5 -4
- reflex/components/core/sticky.pyi +17 -13
- reflex/components/core/upload.py +2 -1
- reflex/components/core/upload.pyi +21 -16
- reflex/components/datadisplay/code.py +2 -72
- reflex/components/datadisplay/code.pyi +9 -10
- reflex/components/datadisplay/dataeditor.pyi +11 -6
- reflex/components/datadisplay/shiki_code_block.pyi +13 -10
- reflex/components/dynamic.py +5 -5
- reflex/components/el/element.pyi +5 -4
- reflex/components/el/elements/base.pyi +5 -4
- reflex/components/el/elements/forms.pyi +69 -52
- reflex/components/el/elements/inline.pyi +113 -85
- reflex/components/el/elements/media.pyi +105 -79
- reflex/components/el/elements/metadata.pyi +25 -19
- reflex/components/el/elements/other.pyi +29 -22
- reflex/components/el/elements/scripts.pyi +13 -10
- reflex/components/el/elements/sectioning.pyi +61 -46
- reflex/components/el/elements/tables.pyi +41 -31
- reflex/components/el/elements/typography.pyi +61 -46
- reflex/components/field.py +175 -0
- reflex/components/gridjs/datatable.py +2 -2
- reflex/components/gridjs/datatable.pyi +11 -9
- reflex/components/lucide/icon.py +6 -2
- reflex/components/lucide/icon.pyi +15 -10
- reflex/components/markdown/markdown.pyi +5 -4
- reflex/components/moment/moment.pyi +5 -4
- reflex/components/plotly/plotly.pyi +19 -10
- reflex/components/props.py +376 -27
- reflex/components/radix/primitives/accordion.py +8 -1
- reflex/components/radix/primitives/accordion.pyi +29 -22
- reflex/components/radix/primitives/base.pyi +9 -7
- reflex/components/radix/primitives/drawer.pyi +45 -34
- reflex/components/radix/primitives/form.pyi +41 -31
- reflex/components/radix/primitives/progress.pyi +21 -16
- reflex/components/radix/primitives/slider.pyi +21 -16
- reflex/components/radix/themes/base.py +3 -3
- reflex/components/radix/themes/base.pyi +33 -25
- reflex/components/radix/themes/color_mode.pyi +13 -10
- reflex/components/radix/themes/components/alert_dialog.pyi +29 -22
- reflex/components/radix/themes/components/aspect_ratio.pyi +5 -4
- reflex/components/radix/themes/components/avatar.pyi +5 -4
- reflex/components/radix/themes/components/badge.pyi +5 -4
- reflex/components/radix/themes/components/button.pyi +5 -4
- reflex/components/radix/themes/components/callout.pyi +21 -16
- reflex/components/radix/themes/components/card.pyi +5 -4
- reflex/components/radix/themes/components/checkbox.pyi +13 -10
- reflex/components/radix/themes/components/checkbox_cards.pyi +9 -7
- reflex/components/radix/themes/components/checkbox_group.pyi +9 -7
- reflex/components/radix/themes/components/context_menu.pyi +53 -40
- reflex/components/radix/themes/components/data_list.pyi +17 -13
- reflex/components/radix/themes/components/dialog.pyi +29 -22
- reflex/components/radix/themes/components/dropdown_menu.pyi +33 -25
- reflex/components/radix/themes/components/hover_card.pyi +17 -13
- reflex/components/radix/themes/components/icon_button.pyi +5 -4
- reflex/components/radix/themes/components/inset.pyi +5 -4
- reflex/components/radix/themes/components/popover.pyi +17 -13
- reflex/components/radix/themes/components/progress.pyi +5 -4
- reflex/components/radix/themes/components/radio.pyi +5 -4
- reflex/components/radix/themes/components/radio_cards.pyi +9 -7
- reflex/components/radix/themes/components/radio_group.pyi +17 -13
- reflex/components/radix/themes/components/scroll_area.pyi +5 -4
- reflex/components/radix/themes/components/segmented_control.pyi +9 -7
- reflex/components/radix/themes/components/select.pyi +37 -28
- reflex/components/radix/themes/components/separator.pyi +5 -4
- reflex/components/radix/themes/components/skeleton.pyi +5 -4
- reflex/components/radix/themes/components/slider.pyi +5 -4
- reflex/components/radix/themes/components/spinner.pyi +5 -4
- reflex/components/radix/themes/components/switch.pyi +5 -4
- reflex/components/radix/themes/components/table.pyi +29 -22
- reflex/components/radix/themes/components/tabs.pyi +21 -16
- reflex/components/radix/themes/components/text_area.pyi +5 -4
- reflex/components/radix/themes/components/text_field.pyi +13 -10
- reflex/components/radix/themes/components/tooltip.pyi +5 -4
- reflex/components/radix/themes/layout/base.pyi +5 -4
- reflex/components/radix/themes/layout/box.pyi +5 -4
- reflex/components/radix/themes/layout/center.pyi +5 -4
- reflex/components/radix/themes/layout/container.pyi +5 -4
- reflex/components/radix/themes/layout/flex.pyi +5 -4
- reflex/components/radix/themes/layout/grid.pyi +5 -4
- reflex/components/radix/themes/layout/list.pyi +21 -16
- reflex/components/radix/themes/layout/section.pyi +5 -4
- reflex/components/radix/themes/layout/spacer.pyi +5 -4
- reflex/components/radix/themes/layout/stack.pyi +13 -10
- reflex/components/radix/themes/typography/blockquote.pyi +5 -4
- reflex/components/radix/themes/typography/code.pyi +5 -4
- reflex/components/radix/themes/typography/heading.pyi +5 -4
- reflex/components/radix/themes/typography/link.py +46 -11
- reflex/components/radix/themes/typography/link.pyi +311 -6
- reflex/components/radix/themes/typography/text.pyi +29 -22
- reflex/components/react_player/audio.pyi +5 -4
- reflex/components/react_player/react_player.pyi +5 -4
- reflex/components/react_player/video.pyi +5 -4
- reflex/components/recharts/cartesian.py +2 -1
- reflex/components/recharts/cartesian.pyi +65 -46
- reflex/components/recharts/charts.py +4 -2
- reflex/components/recharts/charts.pyi +36 -24
- reflex/components/recharts/general.pyi +24 -18
- reflex/components/recharts/polar.py +8 -4
- reflex/components/recharts/polar.pyi +16 -10
- reflex/components/recharts/recharts.pyi +9 -7
- reflex/components/sonner/toast.py +2 -2
- reflex/components/sonner/toast.pyi +10 -8
- reflex/config.py +3 -77
- reflex/constants/__init__.py +2 -2
- reflex/constants/base.py +28 -11
- reflex/constants/compiler.py +5 -3
- reflex/constants/event.py +1 -0
- reflex/constants/installer.py +22 -16
- reflex/constants/route.py +19 -7
- reflex/constants/state.py +2 -0
- reflex/custom_components/custom_components.py +0 -14
- reflex/environment.py +1 -1
- reflex/event.py +178 -81
- reflex/experimental/__init__.py +0 -30
- reflex/istate/proxy.py +5 -3
- reflex/page.py +0 -27
- reflex/plugins/__init__.py +3 -2
- reflex/plugins/base.py +5 -1
- reflex/plugins/shared_tailwind.py +158 -0
- reflex/plugins/sitemap.py +206 -0
- reflex/plugins/tailwind_v3.py +13 -106
- reflex/plugins/tailwind_v4.py +15 -108
- reflex/reflex.py +1 -0
- reflex/route.py +15 -21
- reflex/state.py +134 -140
- reflex/testing.py +58 -10
- reflex/utils/build.py +38 -82
- reflex/utils/exec.py +59 -161
- reflex/utils/export.py +2 -2
- reflex/utils/imports.py +0 -4
- reflex/utils/misc.py +28 -0
- reflex/utils/prerequisites.py +65 -62
- reflex/utils/processes.py +8 -7
- reflex/utils/pyi_generator.py +21 -9
- reflex/utils/serializers.py +14 -1
- reflex/utils/types.py +196 -61
- reflex/vars/__init__.py +2 -0
- reflex/vars/base.py +367 -134
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/METADATA +12 -5
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/RECORD +195 -202
- reflex/.templates/web/next.config.js +0 -7
- reflex/components/base/head.py +0 -20
- reflex/components/base/head.pyi +0 -116
- reflex/components/next/__init__.py +0 -10
- reflex/components/next/base.py +0 -7
- reflex/components/next/image.py +0 -117
- reflex/components/next/image.pyi +0 -94
- reflex/components/next/link.py +0 -20
- reflex/components/next/link.pyi +0 -67
- reflex/components/next/video.py +0 -38
- reflex/components/next/video.pyi +0 -68
- reflex/components/suneditor/__init__.py +0 -5
- reflex/components/suneditor/editor.py +0 -269
- reflex/components/suneditor/editor.pyi +0 -199
- reflex/experimental/layout.py +0 -254
- reflex/experimental/layout.pyi +0 -814
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/WHEEL +0 -0
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/entry_points.txt +0 -0
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a2.dist-info}/licenses/LICENSE +0 -0
reflex/constants/installer.py
CHANGED
|
@@ -14,7 +14,7 @@ class Bun(SimpleNamespace):
|
|
|
14
14
|
"""Bun constants."""
|
|
15
15
|
|
|
16
16
|
# The Bun version.
|
|
17
|
-
VERSION = "1.2.
|
|
17
|
+
VERSION = "1.2.16"
|
|
18
18
|
|
|
19
19
|
# Min Bun Version
|
|
20
20
|
MIN_VERSION = "1.2.8"
|
|
@@ -63,7 +63,7 @@ class Node(SimpleNamespace):
|
|
|
63
63
|
"""Node/ NPM constants."""
|
|
64
64
|
|
|
65
65
|
# The minimum required node version.
|
|
66
|
-
MIN_VERSION = "
|
|
66
|
+
MIN_VERSION = "20.0.0"
|
|
67
67
|
|
|
68
68
|
# Path of the node config file.
|
|
69
69
|
CONFIG_PATH = ".npmrc"
|
|
@@ -74,13 +74,13 @@ fetch-retries=0
|
|
|
74
74
|
"""
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
def
|
|
78
|
-
default_version = "
|
|
79
|
-
if (version := os.getenv("
|
|
77
|
+
def _determine_react_router_version() -> str:
|
|
78
|
+
default_version = "7.6.2"
|
|
79
|
+
if (version := os.getenv("REACT_ROUTER_VERSION")) and version != default_version:
|
|
80
80
|
from reflex.utils import console
|
|
81
81
|
|
|
82
82
|
console.warn(
|
|
83
|
-
f"You have requested
|
|
83
|
+
f"You have requested react-router@{version} but the supported version is {default_version}, abandon all hope ye who enter here."
|
|
84
84
|
)
|
|
85
85
|
return version
|
|
86
86
|
return default_version
|
|
@@ -104,15 +104,16 @@ class PackageJson(SimpleNamespace):
|
|
|
104
104
|
class Commands(SimpleNamespace):
|
|
105
105
|
"""The commands to define in package.json."""
|
|
106
106
|
|
|
107
|
-
DEV = "
|
|
108
|
-
EXPORT = "
|
|
109
|
-
|
|
110
|
-
PROD = "next start"
|
|
107
|
+
DEV = "react-router dev"
|
|
108
|
+
EXPORT = "react-router build"
|
|
109
|
+
PROD = "serve ./build/client"
|
|
111
110
|
|
|
112
111
|
PATH = "package.json"
|
|
113
112
|
|
|
114
113
|
_react_version = _determine_react_version()
|
|
115
114
|
|
|
115
|
+
_react_router_version = _determine_react_router_version()
|
|
116
|
+
|
|
116
117
|
@classproperty
|
|
117
118
|
@classmethod
|
|
118
119
|
def DEPENDENCIES(cls) -> dict[str, str]:
|
|
@@ -122,25 +123,30 @@ class PackageJson(SimpleNamespace):
|
|
|
122
123
|
A dictionary of dependencies with their versions.
|
|
123
124
|
"""
|
|
124
125
|
return {
|
|
125
|
-
"@emotion/react": "11.14.0",
|
|
126
126
|
"axios": "1.9.0",
|
|
127
127
|
"json5": "2.2.3",
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
128
|
+
"react-router": cls._react_router_version,
|
|
129
|
+
"react-router-dom": cls._react_router_version,
|
|
130
|
+
"@react-router/node": cls._react_router_version,
|
|
131
|
+
"serve": "14.2.4",
|
|
131
132
|
"react": cls._react_version,
|
|
132
133
|
"react-dom": cls._react_version,
|
|
133
|
-
"
|
|
134
|
+
"isbot": "5.1.26",
|
|
134
135
|
"socket.io-client": "4.8.1",
|
|
135
136
|
"universal-cookie": "7.2.2",
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
DEV_DEPENDENCIES = {
|
|
140
|
+
"@emotion/react": "11.14.0",
|
|
139
141
|
"autoprefixer": "10.4.21",
|
|
140
142
|
"postcss": "8.5.4",
|
|
141
143
|
"postcss-import": "16.1.0",
|
|
144
|
+
"@react-router/dev": _react_router_version,
|
|
145
|
+
"@react-router/fs-routes": _react_router_version,
|
|
146
|
+
"rolldown-vite": "6.3.19",
|
|
142
147
|
}
|
|
143
148
|
OVERRIDES = {
|
|
144
149
|
# This should always match the `react` version in DEPENDENCIES for recharts compatibility.
|
|
145
|
-
"react-is": _react_version
|
|
150
|
+
"react-is": _react_version,
|
|
151
|
+
"cookie": "1.0.2",
|
|
146
152
|
}
|
reflex/constants/route.py
CHANGED
|
@@ -36,13 +36,25 @@ ROUTER_DATA_INCLUDE = {RouteVar.PATH, RouteVar.ORIGIN, RouteVar.QUERY}
|
|
|
36
36
|
class RouteRegex(SimpleNamespace):
|
|
37
37
|
"""Regex used for extracting route args in route."""
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
#
|
|
45
|
-
|
|
39
|
+
_DOT_DOT_DOT = r"\.\.\."
|
|
40
|
+
_OPENING_BRACKET = r"\["
|
|
41
|
+
_CLOSING_BRACKET = r"\]"
|
|
42
|
+
_ARG_NAME = r"[a-zA-Z_]\w*"
|
|
43
|
+
|
|
44
|
+
# match a single arg (i.e. "[slug]"), returns the name of the arg
|
|
45
|
+
ARG = re.compile(rf"{_OPENING_BRACKET}({_ARG_NAME}){_CLOSING_BRACKET}")
|
|
46
|
+
# match a single catch-all arg (i.e. "[...slug]" or "[[...slug]]"), returns the name of the arg
|
|
47
|
+
CATCHALL = re.compile(
|
|
48
|
+
rf"({_OPENING_BRACKET}?{_OPENING_BRACKET}{_DOT_DOT_DOT}[^[{_CLOSING_BRACKET}]*{_CLOSING_BRACKET}?{_CLOSING_BRACKET})"
|
|
49
|
+
)
|
|
50
|
+
# match a single non-optional catch-all arg (i.e. "[...slug]"), returns the name of the arg
|
|
51
|
+
STRICT_CATCHALL = re.compile(
|
|
52
|
+
rf"{_OPENING_BRACKET}{_DOT_DOT_DOT}({_ARG_NAME}){_CLOSING_BRACKET}"
|
|
53
|
+
)
|
|
54
|
+
# match a snigle optional catch-all arg (i.e. "[[...slug]]"), returns the name of the arg
|
|
55
|
+
OPT_CATCHALL = re.compile(
|
|
56
|
+
rf"{_OPENING_BRACKET * 2}{_DOT_DOT_DOT}({_ARG_NAME}){_CLOSING_BRACKET * 2}"
|
|
57
|
+
)
|
|
46
58
|
SINGLE_SEGMENT = "__SINGLE_SEGMENT__"
|
|
47
59
|
DOUBLE_SEGMENT = "__DOUBLE_SEGMENT__"
|
|
48
60
|
SINGLE_CATCHALL_SEGMENT = "__SINGLE_CATCHALL_SEGMENT__"
|
reflex/constants/state.py
CHANGED
|
@@ -461,20 +461,6 @@ def build():
|
|
|
461
461
|
_run_build()
|
|
462
462
|
|
|
463
463
|
|
|
464
|
-
@custom_components_cli.command(name="publish", deprecated=True)
|
|
465
|
-
def publish():
|
|
466
|
-
"""Publish a custom component. This command is deprecated and will be removed in future releases.
|
|
467
|
-
|
|
468
|
-
Raises:
|
|
469
|
-
Exit: If the publish command fails.
|
|
470
|
-
"""
|
|
471
|
-
console.error(
|
|
472
|
-
"The publish command is deprecated. You can use `reflex component build` followed by `twine upload` or a similar publishing command to publish your custom component."
|
|
473
|
-
"\nIf you want to share your custom component with the Reflex community, please use `reflex component share`."
|
|
474
|
-
)
|
|
475
|
-
raise click.exceptions.Exit(code=1)
|
|
476
|
-
|
|
477
|
-
|
|
478
464
|
def _collect_details_for_gallery():
|
|
479
465
|
"""Helper to collect details on the custom component to be included in the gallery.
|
|
480
466
|
|
reflex/environment.py
CHANGED
|
@@ -475,7 +475,7 @@ class EnvironmentVariables:
|
|
|
475
475
|
# Whether to use the system installed bun. If set to false, bun will be bundled with the app.
|
|
476
476
|
REFLEX_USE_SYSTEM_BUN: EnvVar[bool] = env_var(False)
|
|
477
477
|
|
|
478
|
-
# The working directory for the
|
|
478
|
+
# The working directory for the frontend directory.
|
|
479
479
|
REFLEX_WEB_WORKDIR: EnvVar[Path] = env_var(Path(constants.Dirs.WEB))
|
|
480
480
|
|
|
481
481
|
# The working directory for the states directory.
|