reflex 0.7.14a6__py3-none-any.whl → 0.8.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.

Files changed (237) hide show
  1. reflex/.templates/jinja/app/rxconfig.py.jinja2 +4 -1
  2. reflex/.templates/jinja/web/package.json.jinja2 +1 -1
  3. reflex/.templates/jinja/web/pages/_app.js.jinja2 +21 -11
  4. reflex/.templates/jinja/web/pages/_document.js.jinja2 +1 -1
  5. reflex/.templates/jinja/web/pages/base_page.js.jinja2 +0 -1
  6. reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +4 -0
  7. reflex/.templates/jinja/web/styles/styles.css.jinja2 +1 -0
  8. reflex/.templates/jinja/web/utils/context.js.jinja2 +25 -8
  9. reflex/.templates/web/app/entry.client.js +8 -0
  10. reflex/.templates/web/app/routes.js +10 -0
  11. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +12 -37
  12. reflex/.templates/web/postcss.config.js +1 -1
  13. reflex/.templates/web/react-router.config.js +6 -0
  14. reflex/.templates/web/styles/__reflex_style_reset.css +399 -0
  15. reflex/.templates/web/utils/client_side_routing.js +21 -19
  16. reflex/.templates/web/utils/react-theme.js +92 -0
  17. reflex/.templates/web/utils/state.js +251 -100
  18. reflex/.templates/web/vite-plugin-safari-cachebust.js +160 -0
  19. reflex/.templates/web/vite.config.js +39 -0
  20. reflex/__init__.py +1 -6
  21. reflex/__init__.pyi +327 -192
  22. reflex/app.py +86 -135
  23. reflex/base.py +1 -87
  24. reflex/compiler/compiler.py +70 -19
  25. reflex/compiler/templates.py +3 -3
  26. reflex/compiler/utils.py +91 -33
  27. reflex/components/__init__.py +0 -2
  28. reflex/components/__init__.pyi +34 -18
  29. reflex/components/base/__init__.py +1 -5
  30. reflex/components/base/__init__.pyi +30 -21
  31. reflex/components/base/app_wrap.pyi +7 -7
  32. reflex/components/base/body.pyi +7 -7
  33. reflex/components/base/document.py +18 -14
  34. reflex/components/base/document.pyi +88 -38
  35. reflex/components/base/error_boundary.pyi +7 -7
  36. reflex/components/base/fragment.pyi +7 -7
  37. reflex/components/base/link.pyi +12 -12
  38. reflex/components/base/meta.py +4 -15
  39. reflex/components/base/meta.pyi +31 -31
  40. reflex/components/base/script.py +60 -58
  41. reflex/components/base/script.pyi +248 -34
  42. reflex/components/base/strict_mode.pyi +7 -7
  43. reflex/components/component.py +146 -217
  44. reflex/components/core/__init__.py +1 -0
  45. reflex/components/core/__init__.pyi +77 -37
  46. reflex/components/core/auto_scroll.pyi +7 -7
  47. reflex/components/core/banner.pyi +33 -33
  48. reflex/components/core/client_side_routing.py +7 -6
  49. reflex/components/core/client_side_routing.pyi +8 -59
  50. reflex/components/core/clipboard.pyi +7 -7
  51. reflex/components/core/debounce.py +1 -0
  52. reflex/components/core/debounce.pyi +7 -7
  53. reflex/components/core/foreach.py +5 -4
  54. reflex/components/core/helmet.py +14 -0
  55. reflex/components/{next/base.pyi → core/helmet.pyi} +12 -10
  56. reflex/components/core/html.pyi +7 -7
  57. reflex/components/core/match.py +3 -3
  58. reflex/components/core/sticky.pyi +21 -20
  59. reflex/components/core/upload.py +4 -2
  60. reflex/components/core/upload.pyi +26 -25
  61. reflex/components/datadisplay/__init__.pyi +13 -7
  62. reflex/components/datadisplay/code.py +14 -79
  63. reflex/components/datadisplay/code.pyi +11 -13
  64. reflex/components/datadisplay/dataeditor.pyi +38 -15
  65. reflex/components/datadisplay/shiki_code_block.py +5 -3
  66. reflex/components/datadisplay/shiki_code_block.pyi +16 -15
  67. reflex/components/dynamic.py +5 -5
  68. reflex/components/el/__init__.pyi +506 -246
  69. reflex/components/el/element.pyi +7 -7
  70. reflex/components/el/elements/__init__.pyi +504 -245
  71. reflex/components/el/elements/base.pyi +7 -7
  72. reflex/components/el/elements/forms.pyi +146 -101
  73. reflex/components/el/elements/inline.pyi +142 -142
  74. reflex/components/el/elements/media.pyi +131 -130
  75. reflex/components/el/elements/metadata.pyi +32 -32
  76. reflex/components/el/elements/other.pyi +37 -37
  77. reflex/components/el/elements/scripts.pyi +17 -17
  78. reflex/components/el/elements/sectioning.pyi +77 -77
  79. reflex/components/el/elements/tables.pyi +52 -52
  80. reflex/components/el/elements/typography.pyi +77 -77
  81. reflex/components/field.py +175 -0
  82. reflex/components/gridjs/datatable.py +2 -2
  83. reflex/components/gridjs/datatable.pyi +14 -14
  84. reflex/components/lucide/icon.py +6 -2
  85. reflex/components/lucide/icon.pyi +19 -17
  86. reflex/components/markdown/markdown.py +5 -3
  87. reflex/components/markdown/markdown.pyi +7 -7
  88. reflex/components/moment/moment.py +1 -1
  89. reflex/components/moment/moment.pyi +7 -7
  90. reflex/components/plotly/plotly.py +12 -6
  91. reflex/components/plotly/plotly.pyi +50 -49
  92. reflex/components/props.py +376 -27
  93. reflex/components/radix/__init__.pyi +123 -65
  94. reflex/components/radix/primitives/__init__.pyi +6 -4
  95. reflex/components/radix/primitives/accordion.py +8 -1
  96. reflex/components/radix/primitives/accordion.pyi +37 -37
  97. reflex/components/radix/primitives/base.pyi +12 -12
  98. reflex/components/radix/primitives/drawer.pyi +56 -55
  99. reflex/components/radix/primitives/form.pyi +63 -53
  100. reflex/components/radix/primitives/progress.pyi +26 -25
  101. reflex/components/radix/primitives/slider.pyi +27 -27
  102. reflex/components/radix/themes/__init__.pyi +5 -6
  103. reflex/components/radix/themes/base.py +3 -3
  104. reflex/components/radix/themes/base.pyi +42 -42
  105. reflex/components/radix/themes/color_mode.py +5 -6
  106. reflex/components/radix/themes/color_mode.pyi +17 -17
  107. reflex/components/radix/themes/components/__init__.pyi +75 -38
  108. reflex/components/radix/themes/components/alert_dialog.pyi +37 -37
  109. reflex/components/radix/themes/components/aspect_ratio.pyi +7 -7
  110. reflex/components/radix/themes/components/avatar.pyi +7 -7
  111. reflex/components/radix/themes/components/badge.pyi +7 -7
  112. reflex/components/radix/themes/components/button.pyi +7 -7
  113. reflex/components/radix/themes/components/callout.pyi +26 -25
  114. reflex/components/radix/themes/components/card.pyi +7 -7
  115. reflex/components/radix/themes/components/checkbox.pyi +16 -15
  116. reflex/components/radix/themes/components/checkbox_cards.pyi +12 -12
  117. reflex/components/radix/themes/components/checkbox_group.pyi +12 -12
  118. reflex/components/radix/themes/components/context_menu.pyi +67 -67
  119. reflex/components/radix/themes/components/data_list.pyi +22 -22
  120. reflex/components/radix/themes/components/dialog.pyi +36 -35
  121. reflex/components/radix/themes/components/dropdown_menu.pyi +42 -42
  122. reflex/components/radix/themes/components/hover_card.pyi +21 -20
  123. reflex/components/radix/themes/components/icon_button.pyi +7 -7
  124. reflex/components/radix/themes/components/inset.pyi +7 -7
  125. reflex/components/radix/themes/components/popover.pyi +22 -22
  126. reflex/components/radix/themes/components/progress.pyi +7 -7
  127. reflex/components/radix/themes/components/radio.pyi +7 -7
  128. reflex/components/radix/themes/components/radio_cards.pyi +12 -12
  129. reflex/components/radix/themes/components/radio_group.pyi +21 -20
  130. reflex/components/radix/themes/components/scroll_area.pyi +7 -7
  131. reflex/components/radix/themes/components/segmented_control.pyi +12 -12
  132. reflex/components/radix/themes/components/select.pyi +46 -45
  133. reflex/components/radix/themes/components/separator.pyi +7 -7
  134. reflex/components/radix/themes/components/skeleton.pyi +7 -7
  135. reflex/components/radix/themes/components/slider.pyi +17 -9
  136. reflex/components/radix/themes/components/spinner.pyi +7 -7
  137. reflex/components/radix/themes/components/switch.pyi +7 -7
  138. reflex/components/radix/themes/components/table.pyi +37 -37
  139. reflex/components/radix/themes/components/tabs.pyi +26 -25
  140. reflex/components/radix/themes/components/text_area.pyi +15 -9
  141. reflex/components/radix/themes/components/text_field.pyi +32 -19
  142. reflex/components/radix/themes/components/tooltip.pyi +7 -7
  143. reflex/components/radix/themes/layout/__init__.pyi +27 -14
  144. reflex/components/radix/themes/layout/base.pyi +7 -7
  145. reflex/components/radix/themes/layout/box.pyi +7 -7
  146. reflex/components/radix/themes/layout/center.pyi +7 -7
  147. reflex/components/radix/themes/layout/container.pyi +7 -7
  148. reflex/components/radix/themes/layout/flex.pyi +7 -7
  149. reflex/components/radix/themes/layout/grid.pyi +7 -7
  150. reflex/components/radix/themes/layout/list.pyi +26 -25
  151. reflex/components/radix/themes/layout/section.pyi +7 -7
  152. reflex/components/radix/themes/layout/spacer.pyi +7 -7
  153. reflex/components/radix/themes/layout/stack.pyi +17 -17
  154. reflex/components/radix/themes/typography/__init__.pyi +7 -5
  155. reflex/components/radix/themes/typography/blockquote.pyi +7 -7
  156. reflex/components/radix/themes/typography/code.pyi +7 -7
  157. reflex/components/radix/themes/typography/heading.pyi +7 -7
  158. reflex/components/radix/themes/typography/link.py +46 -11
  159. reflex/components/radix/themes/typography/link.pyi +312 -9
  160. reflex/components/radix/themes/typography/text.pyi +36 -35
  161. reflex/components/react_player/audio.pyi +10 -8
  162. reflex/components/react_player/react_player.pyi +7 -7
  163. reflex/components/react_player/video.pyi +10 -8
  164. reflex/components/recharts/__init__.pyi +208 -100
  165. reflex/components/recharts/cartesian.py +10 -8
  166. reflex/components/recharts/cartesian.pyi +90 -94
  167. reflex/components/recharts/charts.py +4 -2
  168. reflex/components/recharts/charts.pyi +49 -49
  169. reflex/components/recharts/general.pyi +31 -31
  170. reflex/components/recharts/polar.py +8 -4
  171. reflex/components/recharts/polar.pyi +23 -23
  172. reflex/components/recharts/recharts.py +2 -2
  173. reflex/components/recharts/recharts.pyi +12 -12
  174. reflex/components/sonner/toast.py +3 -3
  175. reflex/components/sonner/toast.pyi +9 -9
  176. reflex/config.py +10 -113
  177. reflex/constants/__init__.py +2 -2
  178. reflex/constants/base.py +28 -11
  179. reflex/constants/compiler.py +12 -3
  180. reflex/constants/event.py +1 -0
  181. reflex/constants/installer.py +26 -20
  182. reflex/constants/route.py +27 -8
  183. reflex/constants/state.py +2 -0
  184. reflex/custom_components/custom_components.py +0 -14
  185. reflex/environment.py +77 -5
  186. reflex/event.py +178 -81
  187. reflex/experimental/__init__.py +0 -30
  188. reflex/istate/__init__.py +69 -0
  189. reflex/istate/manager.py +1 -0
  190. reflex/istate/proxy.py +5 -3
  191. reflex/page.py +0 -27
  192. reflex/plugins/__init__.py +3 -2
  193. reflex/plugins/base.py +5 -1
  194. reflex/plugins/shared_tailwind.py +215 -0
  195. reflex/plugins/sitemap.py +206 -0
  196. reflex/plugins/tailwind_v3.py +15 -108
  197. reflex/plugins/tailwind_v4.py +18 -110
  198. reflex/reflex.py +1 -0
  199. reflex/route.py +157 -75
  200. reflex/state.py +171 -155
  201. reflex/testing.py +86 -16
  202. reflex/utils/build.py +38 -82
  203. reflex/utils/exec.py +83 -175
  204. reflex/utils/export.py +2 -2
  205. reflex/utils/format.py +1 -5
  206. reflex/utils/imports.py +5 -16
  207. reflex/utils/misc.py +67 -0
  208. reflex/utils/prerequisites.py +66 -68
  209. reflex/utils/processes.py +24 -47
  210. reflex/utils/pyi_generator.py +44 -49
  211. reflex/utils/serializers.py +14 -1
  212. reflex/utils/telemetry.py +0 -15
  213. reflex/utils/types.py +197 -62
  214. reflex/vars/__init__.py +2 -0
  215. reflex/vars/base.py +367 -134
  216. {reflex-0.7.14a6.dist-info → reflex-0.8.0.dist-info}/METADATA +15 -8
  217. reflex-0.8.0.dist-info/RECORD +403 -0
  218. reflex/.templates/web/next.config.js +0 -7
  219. reflex/components/base/head.py +0 -20
  220. reflex/components/base/head.pyi +0 -116
  221. reflex/components/next/__init__.py +0 -10
  222. reflex/components/next/base.py +0 -7
  223. reflex/components/next/image.py +0 -117
  224. reflex/components/next/image.pyi +0 -94
  225. reflex/components/next/link.py +0 -20
  226. reflex/components/next/link.pyi +0 -67
  227. reflex/components/next/video.py +0 -38
  228. reflex/components/next/video.pyi +0 -68
  229. reflex/components/suneditor/__init__.py +0 -5
  230. reflex/components/suneditor/editor.py +0 -269
  231. reflex/components/suneditor/editor.pyi +0 -199
  232. reflex/experimental/layout.py +0 -254
  233. reflex/experimental/layout.pyi +0 -814
  234. reflex-0.7.14a6.dist-info/RECORD +0 -408
  235. {reflex-0.7.14a6.dist-info → reflex-0.8.0.dist-info}/WHEEL +0 -0
  236. {reflex-0.7.14a6.dist-info → reflex-0.8.0.dist-info}/entry_points.txt +0 -0
  237. {reflex-0.7.14a6.dist-info → reflex-0.8.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,10 +0,0 @@
1
- """Namespace for components provided by next packages."""
2
-
3
- from .base import NextComponent
4
- from .image import Image
5
- from .link import NextLink
6
- from .video import Video
7
-
8
- image = Image.create
9
- video = Video.create
10
- next_link = NextLink.create
@@ -1,7 +0,0 @@
1
- """Base for NextJS components."""
2
-
3
- from reflex.components.component import Component
4
-
5
-
6
- class NextComponent(Component):
7
- """A Component used as based for any NextJS component."""
@@ -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)
@@ -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
- """
@@ -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)
@@ -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
- """
@@ -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)
@@ -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
- """
@@ -1,5 +0,0 @@
1
- """Editor component."""
2
-
3
- from .editor import Editor, EditorButtonList, EditorOptions
4
-
5
- editor = Editor.create