reflex 0.4.9a2__py3-none-any.whl → 0.5.0__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/apps/blank/code/blank.py +19 -16
- reflex/.templates/apps/demo/code/demo.py +1 -1
- reflex/.templates/apps/demo/code/pages/datatable.py +4 -4
- reflex/.templates/apps/demo/code/pages/forms.py +2 -2
- reflex/.templates/jinja/web/tailwind.config.js.jinja2 +12 -0
- reflex/.templates/web/utils/helpers/debounce.js +17 -0
- reflex/.templates/web/utils/helpers/throttle.js +22 -0
- reflex/.templates/web/utils/state.js +21 -3
- reflex/__init__.py +6 -1
- reflex/__init__.pyi +4 -1
- reflex/app.py +157 -140
- reflex/app_module_for_backend.py +1 -1
- reflex/base.py +13 -15
- reflex/compiler/compiler.py +10 -1
- reflex/compiler/utils.py +3 -30
- reflex/components/__init__.py +1 -0
- reflex/components/chakra/datadisplay/list.py +1 -3
- reflex/components/chakra/datadisplay/list.pyi +3 -3
- reflex/components/chakra/disclosure/accordion.py +1 -1
- reflex/components/chakra/forms/pininput.pyi +1 -1
- reflex/components/chakra/media/icon.py +2 -2
- reflex/components/component.py +275 -32
- reflex/components/core/__init__.py +2 -2
- reflex/components/core/cond.py +1 -10
- reflex/components/core/debounce.py +5 -2
- reflex/components/core/debounce.pyi +4 -2
- reflex/components/core/foreach.py +60 -49
- reflex/components/core/html.py +6 -0
- reflex/components/core/match.py +2 -17
- reflex/components/core/upload.py +42 -1
- reflex/components/core/upload.pyi +199 -1
- reflex/components/datadisplay/code.py +7 -3
- reflex/components/datadisplay/code.pyi +3 -1
- reflex/components/el/elements/forms.py +1 -1
- reflex/components/el/elements/forms.pyi +1 -1
- reflex/components/lucide/icon.py +5 -13
- reflex/components/lucide/icon.pyi +0 -1
- reflex/components/markdown/markdown.py +5 -23
- reflex/components/markdown/markdown.pyi +1 -4
- reflex/components/radix/primitives/accordion.py +265 -410
- reflex/components/radix/primitives/accordion.pyi +390 -36
- reflex/components/radix/primitives/form.py +33 -29
- reflex/components/radix/primitives/form.pyi +7 -2
- reflex/components/radix/primitives/progress.py +17 -9
- reflex/components/radix/primitives/progress.pyi +2 -0
- reflex/components/radix/primitives/slider.py +30 -18
- reflex/components/radix/primitives/slider.pyi +4 -0
- reflex/components/radix/themes/base.py +8 -1
- reflex/components/radix/themes/base.pyi +79 -1
- reflex/components/radix/themes/color_mode.py +88 -20
- reflex/components/radix/themes/color_mode.pyi +157 -139
- reflex/components/radix/themes/components/__init__.py +17 -0
- reflex/components/radix/themes/components/badge.py +2 -1
- reflex/components/radix/themes/components/badge.pyi +3 -1
- reflex/components/radix/themes/components/button.py +3 -1
- reflex/components/radix/themes/components/button.pyi +4 -1
- reflex/components/radix/themes/components/checkbox_cards.py +48 -0
- reflex/components/radix/themes/components/checkbox_cards.pyi +264 -0
- reflex/components/radix/themes/components/checkbox_group.py +42 -0
- reflex/components/radix/themes/components/checkbox_group.pyi +253 -0
- reflex/components/radix/themes/components/data_list.py +63 -0
- reflex/components/radix/themes/components/data_list.pyi +426 -0
- reflex/components/radix/themes/components/icon_button.py +20 -17
- reflex/components/radix/themes/components/icon_button.pyi +5 -1
- reflex/components/radix/themes/components/progress.py +55 -0
- reflex/components/radix/themes/components/progress.pyi +180 -0
- reflex/components/radix/themes/components/radio.py +31 -0
- reflex/components/radix/themes/components/radio.pyi +169 -0
- reflex/components/radix/themes/components/radio_cards.py +48 -0
- reflex/components/radix/themes/components/radio_cards.pyi +264 -0
- reflex/components/radix/themes/components/radio_group.py +2 -4
- reflex/components/radix/themes/components/segmented_control.py +48 -0
- reflex/components/radix/themes/components/segmented_control.pyi +262 -0
- reflex/components/radix/themes/components/skeleton.py +32 -0
- reflex/components/radix/themes/components/skeleton.pyi +106 -0
- reflex/components/radix/themes/components/spinner.py +26 -0
- reflex/components/radix/themes/components/spinner.pyi +101 -0
- reflex/components/radix/themes/components/tabs.py +26 -1
- reflex/components/radix/themes/components/tabs.pyi +69 -9
- reflex/components/radix/themes/components/text_field.py +101 -71
- reflex/components/radix/themes/components/text_field.pyi +81 -499
- reflex/components/radix/themes/layout/base.py +2 -2
- reflex/components/radix/themes/layout/base.pyi +4 -4
- reflex/components/radix/themes/layout/center.py +8 -3
- reflex/components/radix/themes/layout/center.pyi +2 -1
- reflex/components/radix/themes/layout/container.py +30 -2
- reflex/components/radix/themes/layout/container.pyi +9 -30
- reflex/components/radix/themes/layout/list.py +10 -5
- reflex/components/radix/themes/layout/list.pyi +5 -21
- reflex/components/radix/themes/layout/spacer.py +8 -3
- reflex/components/radix/themes/layout/spacer.pyi +2 -1
- reflex/components/radix/themes/layout/stack.py +7 -1
- reflex/components/radix/themes/layout/stack.pyi +3 -3
- reflex/components/radix/themes/typography/link.py +10 -2
- reflex/components/radix/themes/typography/link.pyi +5 -4
- reflex/components/sonner/__init__.py +3 -0
- reflex/components/sonner/toast.py +267 -0
- reflex/components/sonner/toast.pyi +205 -0
- reflex/components/tags/iter_tag.py +9 -6
- reflex/config.py +30 -54
- reflex/constants/__init__.py +0 -2
- reflex/constants/base.py +0 -5
- reflex/constants/colors.py +2 -0
- reflex/constants/installer.py +5 -1
- reflex/constants/route.py +4 -0
- reflex/custom_components/custom_components.py +24 -2
- reflex/event.py +75 -30
- reflex/experimental/__init__.py +5 -0
- reflex/experimental/layout.py +24 -6
- reflex/model.py +2 -1
- reflex/page.py +7 -4
- reflex/reflex.py +8 -3
- reflex/route.py +39 -0
- reflex/state.py +128 -131
- reflex/style.py +25 -3
- reflex/testing.py +10 -6
- reflex/utils/console.py +3 -1
- reflex/utils/exec.py +20 -7
- reflex/utils/format.py +1 -1
- reflex/utils/imports.py +3 -1
- reflex/utils/prerequisites.py +141 -20
- reflex/utils/processes.py +21 -1
- reflex/utils/pyi_generator.py +95 -5
- reflex/utils/serializers.py +1 -1
- reflex/utils/telemetry.py +26 -4
- reflex/utils/types.py +62 -18
- reflex/vars.py +11 -5
- {reflex-0.4.9a2.dist-info → reflex-0.5.0.dist-info}/METADATA +16 -4
- {reflex-0.4.9a2.dist-info → reflex-0.5.0.dist-info}/RECORD +132 -110
- {reflex-0.4.9a2.dist-info → reflex-0.5.0.dist-info}/WHEEL +1 -1
- reflex/app.pyi +0 -149
- {reflex-0.4.9a2.dist-info → reflex-0.5.0.dist-info}/LICENSE +0 -0
- {reflex-0.4.9a2.dist-info → reflex-0.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -18,8 +18,7 @@ from reflex.components.radix.themes.typography.heading import Heading
|
|
|
18
18
|
from reflex.components.radix.themes.typography.link import Link
|
|
19
19
|
from reflex.components.radix.themes.typography.text import Text
|
|
20
20
|
from reflex.components.tags.tag import Tag
|
|
21
|
-
from reflex.
|
|
22
|
-
from reflex.utils import console, imports, types
|
|
21
|
+
from reflex.utils import imports, types
|
|
23
22
|
from reflex.utils.imports import ImportVar
|
|
24
23
|
from reflex.vars import Var
|
|
25
24
|
|
|
@@ -85,9 +84,6 @@ class Markdown(Component):
|
|
|
85
84
|
# The component map from a tag to a lambda that creates a component.
|
|
86
85
|
component_map: Dict[str, Any] = {}
|
|
87
86
|
|
|
88
|
-
# Custom styles for the markdown (deprecated in v0.2.9).
|
|
89
|
-
custom_styles: Dict[str, Any] = {}
|
|
90
|
-
|
|
91
87
|
# The hash of the component map, generated at create() time.
|
|
92
88
|
component_map_hash: str = ""
|
|
93
89
|
|
|
@@ -102,19 +98,10 @@ class Markdown(Component):
|
|
|
102
98
|
Returns:
|
|
103
99
|
The markdown component.
|
|
104
100
|
"""
|
|
105
|
-
assert
|
|
106
|
-
children[0], Union[str, Var]
|
|
101
|
+
assert (
|
|
102
|
+
len(children) == 1 and types._isinstance(children[0], Union[str, Var])
|
|
107
103
|
), "Markdown component must have exactly one child containing the markdown source."
|
|
108
104
|
|
|
109
|
-
# Custom styles are deprecated.
|
|
110
|
-
if "custom_styles" in props:
|
|
111
|
-
console.deprecate(
|
|
112
|
-
feature_name="rx.markdown custom_styles",
|
|
113
|
-
reason="Use the component_map prop instead.",
|
|
114
|
-
deprecation_version="0.2.9",
|
|
115
|
-
removal_version="0.5.0",
|
|
116
|
-
)
|
|
117
|
-
|
|
118
105
|
# Update the base component map with the custom component map.
|
|
119
106
|
component_map = {**get_base_component_map(), **props.pop("component_map", {})}
|
|
120
107
|
|
|
@@ -230,7 +217,6 @@ class Markdown(Component):
|
|
|
230
217
|
component = self.component_map[tag](*children, **props).set(
|
|
231
218
|
special_props=special_props
|
|
232
219
|
)
|
|
233
|
-
component._add_style(Style(self.custom_styles.get(tag, {})))
|
|
234
220
|
return component
|
|
235
221
|
|
|
236
222
|
def format_component(self, tag: str, **props) -> str:
|
|
@@ -257,9 +243,7 @@ class Markdown(Component):
|
|
|
257
243
|
}
|
|
258
244
|
|
|
259
245
|
# Separate out inline code and code blocks.
|
|
260
|
-
components[
|
|
261
|
-
"code"
|
|
262
|
-
] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
|
|
246
|
+
components["code"] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{
|
|
263
247
|
const match = (className || '').match(/language-(?<lang>.*)/);
|
|
264
248
|
const language = match ? match[1] : '';
|
|
265
249
|
if (language) {{
|
|
@@ -277,9 +261,7 @@ class Markdown(Component):
|
|
|
277
261
|
) : (
|
|
278
262
|
{self.format_component("codeblock", language=Var.create_safe("language", _var_is_local=False))}
|
|
279
263
|
);
|
|
280
|
-
}}}}""".replace(
|
|
281
|
-
"\n", " "
|
|
282
|
-
)
|
|
264
|
+
}}}}""".replace("\n", " ")
|
|
283
265
|
|
|
284
266
|
return components
|
|
285
267
|
|
|
@@ -22,8 +22,7 @@ from reflex.components.radix.themes.typography.heading import Heading
|
|
|
22
22
|
from reflex.components.radix.themes.typography.link import Link
|
|
23
23
|
from reflex.components.radix.themes.typography.text import Text
|
|
24
24
|
from reflex.components.tags.tag import Tag
|
|
25
|
-
from reflex.
|
|
26
|
-
from reflex.utils import console, imports, types
|
|
25
|
+
from reflex.utils import imports, types
|
|
27
26
|
from reflex.utils.imports import ImportVar
|
|
28
27
|
from reflex.vars import Var
|
|
29
28
|
|
|
@@ -49,7 +48,6 @@ class Markdown(Component):
|
|
|
49
48
|
cls,
|
|
50
49
|
*children,
|
|
51
50
|
component_map: Optional[Dict[str, Any]] = None,
|
|
52
|
-
custom_styles: Optional[Dict[str, Any]] = None,
|
|
53
51
|
component_map_hash: Optional[str] = None,
|
|
54
52
|
style: Optional[Style] = None,
|
|
55
53
|
key: Optional[Any] = None,
|
|
@@ -109,7 +107,6 @@ class Markdown(Component):
|
|
|
109
107
|
Args:
|
|
110
108
|
*children: The children of the component.
|
|
111
109
|
component_map: The component map from a tag to a lambda that creates a component.
|
|
112
|
-
custom_styles: Custom styles for the markdown (deprecated in v0.2.9).
|
|
113
110
|
component_map_hash: The hash of the component map, generated at create() time.
|
|
114
111
|
style: The style of the component.
|
|
115
112
|
key: A unique key for the component.
|