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/components/base/head.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"""The head component."""
|
|
2
|
-
|
|
3
|
-
from reflex.components.component import Component, MemoizationLeaf
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class NextHeadLib(Component):
|
|
7
|
-
"""Header components."""
|
|
8
|
-
|
|
9
|
-
library = "next/head"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class Head(NextHeadLib, MemoizationLeaf):
|
|
13
|
-
"""Head Component."""
|
|
14
|
-
|
|
15
|
-
tag = "NextHead"
|
|
16
|
-
|
|
17
|
-
is_default = True
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
head = Head.create
|
reflex/components/base/head.pyi
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/components/base/head.py"""
|
|
2
|
-
|
|
3
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
4
|
-
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
|
-
# ------------------------------------------------------
|
|
6
|
-
from collections.abc import Mapping, Sequence
|
|
7
|
-
from typing import Any, overload
|
|
8
|
-
|
|
9
|
-
from reflex.components.component import Component, MemoizationLeaf
|
|
10
|
-
from reflex.components.core.breakpoints import Breakpoints
|
|
11
|
-
from reflex.event import EventType
|
|
12
|
-
from reflex.vars.base import Var
|
|
13
|
-
|
|
14
|
-
class NextHeadLib(Component):
|
|
15
|
-
@overload
|
|
16
|
-
@classmethod
|
|
17
|
-
def create( # type: ignore
|
|
18
|
-
cls,
|
|
19
|
-
*children,
|
|
20
|
-
style: Sequence[Mapping[str, Any]]
|
|
21
|
-
| Mapping[str, Any]
|
|
22
|
-
| Var[Mapping[str, Any]]
|
|
23
|
-
| Breakpoints
|
|
24
|
-
| None = None,
|
|
25
|
-
key: Any | None = None,
|
|
26
|
-
id: Any | None = None,
|
|
27
|
-
ref: Var | None = None,
|
|
28
|
-
class_name: Any | None = None,
|
|
29
|
-
autofocus: bool | None = None,
|
|
30
|
-
custom_attrs: dict[str, Var | Any] | None = None,
|
|
31
|
-
on_blur: EventType[()] | None = None,
|
|
32
|
-
on_click: EventType[()] | None = None,
|
|
33
|
-
on_context_menu: EventType[()] | None = None,
|
|
34
|
-
on_double_click: EventType[()] | None = None,
|
|
35
|
-
on_focus: EventType[()] | None = None,
|
|
36
|
-
on_mount: EventType[()] | None = None,
|
|
37
|
-
on_mouse_down: EventType[()] | None = None,
|
|
38
|
-
on_mouse_enter: EventType[()] | None = None,
|
|
39
|
-
on_mouse_leave: EventType[()] | None = None,
|
|
40
|
-
on_mouse_move: EventType[()] | None = None,
|
|
41
|
-
on_mouse_out: EventType[()] | None = None,
|
|
42
|
-
on_mouse_over: EventType[()] | None = None,
|
|
43
|
-
on_mouse_up: EventType[()] | None = None,
|
|
44
|
-
on_scroll: EventType[()] | None = None,
|
|
45
|
-
on_unmount: EventType[()] | None = None,
|
|
46
|
-
**props,
|
|
47
|
-
) -> NextHeadLib:
|
|
48
|
-
"""Create the component.
|
|
49
|
-
|
|
50
|
-
Args:
|
|
51
|
-
*children: The children of the component.
|
|
52
|
-
style: The style of the component.
|
|
53
|
-
key: A unique key for the component.
|
|
54
|
-
id: The id for the component.
|
|
55
|
-
ref: The Var to pass as the ref to the component.
|
|
56
|
-
class_name: The class name for the component.
|
|
57
|
-
autofocus: Whether the component should take the focus once the page is loaded
|
|
58
|
-
custom_attrs: custom attribute
|
|
59
|
-
**props: The props of the component.
|
|
60
|
-
|
|
61
|
-
Returns:
|
|
62
|
-
The component.
|
|
63
|
-
"""
|
|
64
|
-
|
|
65
|
-
class Head(NextHeadLib, MemoizationLeaf):
|
|
66
|
-
@overload
|
|
67
|
-
@classmethod
|
|
68
|
-
def create( # type: ignore
|
|
69
|
-
cls,
|
|
70
|
-
*children,
|
|
71
|
-
style: Sequence[Mapping[str, Any]]
|
|
72
|
-
| Mapping[str, Any]
|
|
73
|
-
| Var[Mapping[str, Any]]
|
|
74
|
-
| Breakpoints
|
|
75
|
-
| None = None,
|
|
76
|
-
key: Any | None = None,
|
|
77
|
-
id: Any | None = None,
|
|
78
|
-
ref: Var | None = None,
|
|
79
|
-
class_name: Any | None = None,
|
|
80
|
-
autofocus: bool | None = None,
|
|
81
|
-
custom_attrs: dict[str, Var | Any] | None = None,
|
|
82
|
-
on_blur: EventType[()] | None = None,
|
|
83
|
-
on_click: EventType[()] | None = None,
|
|
84
|
-
on_context_menu: EventType[()] | None = None,
|
|
85
|
-
on_double_click: EventType[()] | None = None,
|
|
86
|
-
on_focus: EventType[()] | None = None,
|
|
87
|
-
on_mount: EventType[()] | None = None,
|
|
88
|
-
on_mouse_down: EventType[()] | None = None,
|
|
89
|
-
on_mouse_enter: EventType[()] | None = None,
|
|
90
|
-
on_mouse_leave: EventType[()] | None = None,
|
|
91
|
-
on_mouse_move: EventType[()] | None = None,
|
|
92
|
-
on_mouse_out: EventType[()] | None = None,
|
|
93
|
-
on_mouse_over: EventType[()] | None = None,
|
|
94
|
-
on_mouse_up: EventType[()] | None = None,
|
|
95
|
-
on_scroll: EventType[()] | None = None,
|
|
96
|
-
on_unmount: EventType[()] | None = None,
|
|
97
|
-
**props,
|
|
98
|
-
) -> Head:
|
|
99
|
-
"""Create a new memoization leaf component.
|
|
100
|
-
|
|
101
|
-
Args:
|
|
102
|
-
*children: The children of the component.
|
|
103
|
-
style: The style of the component.
|
|
104
|
-
key: A unique key for the component.
|
|
105
|
-
id: The id for the component.
|
|
106
|
-
ref: The Var to pass as the ref to the component.
|
|
107
|
-
class_name: The class name for the component.
|
|
108
|
-
autofocus: Whether the component should take the focus once the page is loaded
|
|
109
|
-
custom_attrs: custom attribute
|
|
110
|
-
**props: The props of the component.
|
|
111
|
-
|
|
112
|
-
Returns:
|
|
113
|
-
The memoization leaf
|
|
114
|
-
"""
|
|
115
|
-
|
|
116
|
-
head = Head.create
|
reflex/components/next/base.py
DELETED
reflex/components/next/image.py
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"""Image component from next/image."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import Any, Literal
|
|
6
|
-
|
|
7
|
-
from reflex.event import EventHandler, no_args_event_spec
|
|
8
|
-
from reflex.utils import console, types
|
|
9
|
-
from reflex.vars.base import Var
|
|
10
|
-
|
|
11
|
-
from .base import NextComponent
|
|
12
|
-
|
|
13
|
-
DEFAULT_W_H = "100%"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class Image(NextComponent):
|
|
17
|
-
"""Display an image."""
|
|
18
|
-
|
|
19
|
-
tag = "Image"
|
|
20
|
-
library = "next/image"
|
|
21
|
-
is_default = True
|
|
22
|
-
|
|
23
|
-
# This can be either an absolute external URL, or an internal path
|
|
24
|
-
src: Var[Any]
|
|
25
|
-
|
|
26
|
-
# Represents the rendered width in pixels, so it will affect how large the image appears.
|
|
27
|
-
width: Var[Any]
|
|
28
|
-
|
|
29
|
-
# Represents the rendered height in pixels, so it will affect how large the image appears.
|
|
30
|
-
height: Var[Any]
|
|
31
|
-
|
|
32
|
-
# Used to describe the image for screen readers and search engines.
|
|
33
|
-
alt: Var[str]
|
|
34
|
-
|
|
35
|
-
# A custom function used to resolve image URLs.
|
|
36
|
-
loader: Var[Any]
|
|
37
|
-
|
|
38
|
-
# A boolean that causes the image to fill the parent element, which is useful when the width and height are unknown. Default to True
|
|
39
|
-
fill: Var[bool]
|
|
40
|
-
|
|
41
|
-
# A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
|
|
42
|
-
sizes: Var[str]
|
|
43
|
-
|
|
44
|
-
# The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
|
|
45
|
-
quality: Var[int]
|
|
46
|
-
|
|
47
|
-
# When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
|
|
48
|
-
priority: Var[bool]
|
|
49
|
-
|
|
50
|
-
# A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
|
|
51
|
-
placeholder: Var[str]
|
|
52
|
-
|
|
53
|
-
# Allows passing CSS styles to the underlying image element.
|
|
54
|
-
# style: Var[Any] #noqa: ERA001
|
|
55
|
-
|
|
56
|
-
# The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
|
57
|
-
loading: Var[Literal["lazy", "eager"]]
|
|
58
|
-
|
|
59
|
-
# A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
|
|
60
|
-
blur_data_url: Var[str]
|
|
61
|
-
|
|
62
|
-
# Fires when the image has loaded.
|
|
63
|
-
on_load: EventHandler[no_args_event_spec]
|
|
64
|
-
|
|
65
|
-
# Fires when the image has an error.
|
|
66
|
-
on_error: EventHandler[no_args_event_spec]
|
|
67
|
-
|
|
68
|
-
@classmethod
|
|
69
|
-
def create(
|
|
70
|
-
cls,
|
|
71
|
-
*children,
|
|
72
|
-
width: int | str | None = None,
|
|
73
|
-
height: int | str | None = None,
|
|
74
|
-
**props,
|
|
75
|
-
):
|
|
76
|
-
"""Create an Image component from next/image.
|
|
77
|
-
|
|
78
|
-
Args:
|
|
79
|
-
*children: The children of the component.
|
|
80
|
-
width: The width of the image.
|
|
81
|
-
height: The height of the image.
|
|
82
|
-
**props:The props of the component.
|
|
83
|
-
|
|
84
|
-
Returns:
|
|
85
|
-
_type_: _description_
|
|
86
|
-
"""
|
|
87
|
-
if "blurDataURL" in props:
|
|
88
|
-
console.deprecate(
|
|
89
|
-
feature_name="blurDataURL",
|
|
90
|
-
reason="Use blur_data_url instead",
|
|
91
|
-
deprecation_version="0.7.0",
|
|
92
|
-
removal_version="0.8.0",
|
|
93
|
-
)
|
|
94
|
-
props["blur_data_url"] = props.pop("blurDataURL")
|
|
95
|
-
|
|
96
|
-
style = props.get("style", {})
|
|
97
|
-
|
|
98
|
-
def check_prop_type(prop_name: str, prop_value: int | str | None):
|
|
99
|
-
if types.check_prop_in_allowed_types(prop_value, allowed_types=[int]):
|
|
100
|
-
props[prop_name] = prop_value
|
|
101
|
-
|
|
102
|
-
elif types.check_prop_in_allowed_types(prop_value, allowed_types=[str]):
|
|
103
|
-
props[prop_name] = 0
|
|
104
|
-
style[prop_name] = prop_value
|
|
105
|
-
else:
|
|
106
|
-
props[prop_name] = 0
|
|
107
|
-
style[prop_name] = DEFAULT_W_H
|
|
108
|
-
|
|
109
|
-
check_prop_type("width", width)
|
|
110
|
-
check_prop_type("height", height)
|
|
111
|
-
|
|
112
|
-
props["style"] = style
|
|
113
|
-
|
|
114
|
-
# mysteriously, following `sizes` prop is needed to avoid blury images.
|
|
115
|
-
props["sizes"] = "100vw"
|
|
116
|
-
|
|
117
|
-
return super().create(*children, **props)
|
reflex/components/next/image.pyi
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/components/next/image.py"""
|
|
2
|
-
|
|
3
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
4
|
-
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
|
-
# ------------------------------------------------------
|
|
6
|
-
from collections.abc import Mapping, Sequence
|
|
7
|
-
from typing import Any, Literal, overload
|
|
8
|
-
|
|
9
|
-
from reflex.components.core.breakpoints import Breakpoints
|
|
10
|
-
from reflex.event import EventType
|
|
11
|
-
from reflex.vars.base import Var
|
|
12
|
-
|
|
13
|
-
from .base import NextComponent
|
|
14
|
-
|
|
15
|
-
DEFAULT_W_H = "100%"
|
|
16
|
-
|
|
17
|
-
class Image(NextComponent):
|
|
18
|
-
@overload
|
|
19
|
-
@classmethod
|
|
20
|
-
def create( # type: ignore
|
|
21
|
-
cls,
|
|
22
|
-
*children,
|
|
23
|
-
width: int | str | None = None,
|
|
24
|
-
height: int | str | None = None,
|
|
25
|
-
src: Any | Var[Any] | None = None,
|
|
26
|
-
alt: Var[str] | str | None = None,
|
|
27
|
-
loader: Any | Var[Any] | None = None,
|
|
28
|
-
fill: Var[bool] | bool | None = None,
|
|
29
|
-
sizes: Var[str] | str | None = None,
|
|
30
|
-
quality: Var[int] | int | None = None,
|
|
31
|
-
priority: Var[bool] | bool | None = None,
|
|
32
|
-
placeholder: Var[str] | str | None = None,
|
|
33
|
-
loading: Literal["eager", "lazy"] | Var[Literal["eager", "lazy"]] | None = None,
|
|
34
|
-
blur_data_url: Var[str] | str | None = None,
|
|
35
|
-
style: Sequence[Mapping[str, Any]]
|
|
36
|
-
| Mapping[str, Any]
|
|
37
|
-
| Var[Mapping[str, Any]]
|
|
38
|
-
| Breakpoints
|
|
39
|
-
| None = None,
|
|
40
|
-
key: Any | None = None,
|
|
41
|
-
id: Any | None = None,
|
|
42
|
-
ref: Var | None = None,
|
|
43
|
-
class_name: Any | None = None,
|
|
44
|
-
autofocus: bool | None = None,
|
|
45
|
-
custom_attrs: dict[str, Var | Any] | None = None,
|
|
46
|
-
on_blur: EventType[()] | None = None,
|
|
47
|
-
on_click: EventType[()] | None = None,
|
|
48
|
-
on_context_menu: EventType[()] | None = None,
|
|
49
|
-
on_double_click: EventType[()] | None = None,
|
|
50
|
-
on_error: EventType[()] | None = None,
|
|
51
|
-
on_focus: EventType[()] | None = None,
|
|
52
|
-
on_load: EventType[()] | None = None,
|
|
53
|
-
on_mount: EventType[()] | None = None,
|
|
54
|
-
on_mouse_down: EventType[()] | None = None,
|
|
55
|
-
on_mouse_enter: EventType[()] | None = None,
|
|
56
|
-
on_mouse_leave: EventType[()] | None = None,
|
|
57
|
-
on_mouse_move: EventType[()] | None = None,
|
|
58
|
-
on_mouse_out: EventType[()] | None = None,
|
|
59
|
-
on_mouse_over: EventType[()] | None = None,
|
|
60
|
-
on_mouse_up: EventType[()] | None = None,
|
|
61
|
-
on_scroll: EventType[()] | None = None,
|
|
62
|
-
on_unmount: EventType[()] | None = None,
|
|
63
|
-
**props,
|
|
64
|
-
) -> Image:
|
|
65
|
-
"""Create an Image component from next/image.
|
|
66
|
-
|
|
67
|
-
Args:
|
|
68
|
-
*children: The children of the component.
|
|
69
|
-
width: The width of the image.
|
|
70
|
-
height: The height of the image.
|
|
71
|
-
src: This can be either an absolute external URL, or an internal path
|
|
72
|
-
alt: Used to describe the image for screen readers and search engines.
|
|
73
|
-
loader: A custom function used to resolve image URLs.
|
|
74
|
-
fill: A boolean that causes the image to fill the parent element, which is useful when the width and height are unknown. Default to True
|
|
75
|
-
sizes: A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
|
|
76
|
-
quality: The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
|
|
77
|
-
priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
|
|
78
|
-
placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
|
|
79
|
-
loading: The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
|
80
|
-
blur_data_url: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
|
|
81
|
-
on_load: Fires when the image has loaded.
|
|
82
|
-
on_error: Fires when the image has an error.
|
|
83
|
-
style: The style of the component.
|
|
84
|
-
key: A unique key for the component.
|
|
85
|
-
id: The id for the component.
|
|
86
|
-
ref: The Var to pass as the ref to the component.
|
|
87
|
-
class_name: The class name for the component.
|
|
88
|
-
autofocus: Whether the component should take the focus once the page is loaded
|
|
89
|
-
custom_attrs: custom attribute
|
|
90
|
-
**props:The props of the component.
|
|
91
|
-
|
|
92
|
-
Returns:
|
|
93
|
-
_type_: _description_
|
|
94
|
-
"""
|
reflex/components/next/link.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"""A link component."""
|
|
2
|
-
|
|
3
|
-
from reflex.components.component import Component
|
|
4
|
-
from reflex.vars.base import Var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class NextLink(Component):
|
|
8
|
-
"""Links are accessible elements used primarily for navigation. This component is styled to resemble a hyperlink and semantically renders an <a>."""
|
|
9
|
-
|
|
10
|
-
library = "next/link"
|
|
11
|
-
|
|
12
|
-
tag = "NextLink"
|
|
13
|
-
|
|
14
|
-
is_default = True
|
|
15
|
-
|
|
16
|
-
# The page to link to.
|
|
17
|
-
href: Var[str]
|
|
18
|
-
|
|
19
|
-
# Whether to pass the href prop to the child.
|
|
20
|
-
pass_href: Var[bool] = Var.create(True)
|
reflex/components/next/link.pyi
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/components/next/link.py"""
|
|
2
|
-
|
|
3
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
4
|
-
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
|
-
# ------------------------------------------------------
|
|
6
|
-
from collections.abc import Mapping, Sequence
|
|
7
|
-
from typing import Any, overload
|
|
8
|
-
|
|
9
|
-
from reflex.components.component import Component
|
|
10
|
-
from reflex.components.core.breakpoints import Breakpoints
|
|
11
|
-
from reflex.event import EventType
|
|
12
|
-
from reflex.vars.base import Var
|
|
13
|
-
|
|
14
|
-
class NextLink(Component):
|
|
15
|
-
@overload
|
|
16
|
-
@classmethod
|
|
17
|
-
def create( # type: ignore
|
|
18
|
-
cls,
|
|
19
|
-
*children,
|
|
20
|
-
href: Var[str] | str | None = None,
|
|
21
|
-
pass_href: Var[bool] | bool | None = None,
|
|
22
|
-
style: Sequence[Mapping[str, Any]]
|
|
23
|
-
| Mapping[str, Any]
|
|
24
|
-
| Var[Mapping[str, Any]]
|
|
25
|
-
| Breakpoints
|
|
26
|
-
| None = None,
|
|
27
|
-
key: Any | None = None,
|
|
28
|
-
id: Any | None = None,
|
|
29
|
-
ref: Var | None = None,
|
|
30
|
-
class_name: Any | None = None,
|
|
31
|
-
autofocus: bool | None = None,
|
|
32
|
-
custom_attrs: dict[str, Var | Any] | None = None,
|
|
33
|
-
on_blur: EventType[()] | None = None,
|
|
34
|
-
on_click: EventType[()] | None = None,
|
|
35
|
-
on_context_menu: EventType[()] | None = None,
|
|
36
|
-
on_double_click: EventType[()] | None = None,
|
|
37
|
-
on_focus: EventType[()] | None = None,
|
|
38
|
-
on_mount: EventType[()] | None = None,
|
|
39
|
-
on_mouse_down: EventType[()] | None = None,
|
|
40
|
-
on_mouse_enter: EventType[()] | None = None,
|
|
41
|
-
on_mouse_leave: EventType[()] | None = None,
|
|
42
|
-
on_mouse_move: EventType[()] | None = None,
|
|
43
|
-
on_mouse_out: EventType[()] | None = None,
|
|
44
|
-
on_mouse_over: EventType[()] | None = None,
|
|
45
|
-
on_mouse_up: EventType[()] | None = None,
|
|
46
|
-
on_scroll: EventType[()] | None = None,
|
|
47
|
-
on_unmount: EventType[()] | None = None,
|
|
48
|
-
**props,
|
|
49
|
-
) -> NextLink:
|
|
50
|
-
"""Create the component.
|
|
51
|
-
|
|
52
|
-
Args:
|
|
53
|
-
*children: The children of the component.
|
|
54
|
-
href: The page to link to.
|
|
55
|
-
pass_href: Whether to pass the href prop to the child.
|
|
56
|
-
style: The style of the component.
|
|
57
|
-
key: A unique key for the component.
|
|
58
|
-
id: The id for the component.
|
|
59
|
-
ref: The Var to pass as the ref to the component.
|
|
60
|
-
class_name: The class name for the component.
|
|
61
|
-
autofocus: Whether the component should take the focus once the page is loaded
|
|
62
|
-
custom_attrs: custom attribute
|
|
63
|
-
**props: The props of the component.
|
|
64
|
-
|
|
65
|
-
Returns:
|
|
66
|
-
The component.
|
|
67
|
-
"""
|
reflex/components/next/video.py
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"""Wrapping of the next-video component."""
|
|
2
|
-
|
|
3
|
-
from reflex.components.component import Component
|
|
4
|
-
from reflex.utils import console
|
|
5
|
-
from reflex.vars.base import Var
|
|
6
|
-
|
|
7
|
-
from .base import NextComponent
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Video(NextComponent):
|
|
11
|
-
"""A video component from NextJS."""
|
|
12
|
-
|
|
13
|
-
tag = "Video"
|
|
14
|
-
library = "next-video@2.2.0"
|
|
15
|
-
is_default = True
|
|
16
|
-
# the URL
|
|
17
|
-
src: Var[str]
|
|
18
|
-
|
|
19
|
-
as_: Component | None
|
|
20
|
-
|
|
21
|
-
@classmethod
|
|
22
|
-
def create(cls, *children, **props) -> NextComponent:
|
|
23
|
-
"""Create a Video component.
|
|
24
|
-
|
|
25
|
-
Args:
|
|
26
|
-
*children: The children of the component.
|
|
27
|
-
**props: The props of the component.
|
|
28
|
-
|
|
29
|
-
Returns:
|
|
30
|
-
The Video component.
|
|
31
|
-
"""
|
|
32
|
-
console.deprecate(
|
|
33
|
-
"next-video",
|
|
34
|
-
"The next-video component is deprecated. Use `rx.video` instead.",
|
|
35
|
-
deprecation_version="0.7.11",
|
|
36
|
-
removal_version="0.8.0",
|
|
37
|
-
)
|
|
38
|
-
return super().create(*children, **props)
|
reflex/components/next/video.pyi
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/components/next/video.py"""
|
|
2
|
-
|
|
3
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
4
|
-
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
|
-
# ------------------------------------------------------
|
|
6
|
-
from collections.abc import Mapping, Sequence
|
|
7
|
-
from typing import Any, overload
|
|
8
|
-
|
|
9
|
-
from reflex.components.component import Component
|
|
10
|
-
from reflex.components.core.breakpoints import Breakpoints
|
|
11
|
-
from reflex.event import EventType
|
|
12
|
-
from reflex.vars.base import Var
|
|
13
|
-
|
|
14
|
-
from .base import NextComponent
|
|
15
|
-
|
|
16
|
-
class Video(NextComponent):
|
|
17
|
-
@overload
|
|
18
|
-
@classmethod
|
|
19
|
-
def create( # type: ignore
|
|
20
|
-
cls,
|
|
21
|
-
*children,
|
|
22
|
-
src: Var[str] | str | None = None,
|
|
23
|
-
as_: Component | None = None,
|
|
24
|
-
style: Sequence[Mapping[str, Any]]
|
|
25
|
-
| Mapping[str, Any]
|
|
26
|
-
| Var[Mapping[str, Any]]
|
|
27
|
-
| Breakpoints
|
|
28
|
-
| None = None,
|
|
29
|
-
key: Any | None = None,
|
|
30
|
-
id: Any | None = None,
|
|
31
|
-
ref: Var | None = None,
|
|
32
|
-
class_name: Any | None = None,
|
|
33
|
-
autofocus: bool | None = None,
|
|
34
|
-
custom_attrs: dict[str, Var | Any] | None = None,
|
|
35
|
-
on_blur: EventType[()] | None = None,
|
|
36
|
-
on_click: EventType[()] | None = None,
|
|
37
|
-
on_context_menu: EventType[()] | None = None,
|
|
38
|
-
on_double_click: EventType[()] | None = None,
|
|
39
|
-
on_focus: EventType[()] | None = None,
|
|
40
|
-
on_mount: EventType[()] | None = None,
|
|
41
|
-
on_mouse_down: EventType[()] | None = None,
|
|
42
|
-
on_mouse_enter: EventType[()] | None = None,
|
|
43
|
-
on_mouse_leave: EventType[()] | None = None,
|
|
44
|
-
on_mouse_move: EventType[()] | None = None,
|
|
45
|
-
on_mouse_out: EventType[()] | None = None,
|
|
46
|
-
on_mouse_over: EventType[()] | None = None,
|
|
47
|
-
on_mouse_up: EventType[()] | None = None,
|
|
48
|
-
on_scroll: EventType[()] | None = None,
|
|
49
|
-
on_unmount: EventType[()] | None = None,
|
|
50
|
-
**props,
|
|
51
|
-
) -> Video:
|
|
52
|
-
"""Create a Video component.
|
|
53
|
-
|
|
54
|
-
Args:
|
|
55
|
-
*children: The children of the component.
|
|
56
|
-
src: the URL
|
|
57
|
-
style: The style of the component.
|
|
58
|
-
key: A unique key for the component.
|
|
59
|
-
id: The id for the component.
|
|
60
|
-
ref: The Var to pass as the ref to the component.
|
|
61
|
-
class_name: The class name for the component.
|
|
62
|
-
autofocus: Whether the component should take the focus once the page is loaded
|
|
63
|
-
custom_attrs: custom attribute
|
|
64
|
-
**props: The props of the component.
|
|
65
|
-
|
|
66
|
-
Returns:
|
|
67
|
-
The Video component.
|
|
68
|
-
"""
|