reflex 0.7.14a5__py3-none-any.whl → 0.8.0a1__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 (205) 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 +16 -10
  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/utils/context.js.jinja2 +25 -6
  7. reflex/.templates/web/app/entry.client.js +8 -0
  8. reflex/.templates/web/app/routes.js +10 -0
  9. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +12 -32
  10. reflex/.templates/web/postcss.config.js +1 -1
  11. reflex/.templates/web/react-router.config.js +6 -0
  12. reflex/.templates/web/utils/client_side_routing.js +21 -19
  13. reflex/.templates/web/utils/react-theme.js +89 -0
  14. reflex/.templates/web/utils/state.js +155 -67
  15. reflex/.templates/web/vite.config.js +32 -0
  16. reflex/__init__.py +1 -6
  17. reflex/__init__.pyi +0 -4
  18. reflex/app.py +69 -132
  19. reflex/base.py +1 -87
  20. reflex/compiler/compiler.py +40 -3
  21. reflex/compiler/utils.py +54 -28
  22. reflex/components/__init__.py +0 -2
  23. reflex/components/__init__.pyi +0 -3
  24. reflex/components/base/__init__.py +1 -5
  25. reflex/components/base/__init__.pyi +4 -6
  26. reflex/components/base/app_wrap.pyi +5 -4
  27. reflex/components/base/body.pyi +5 -4
  28. reflex/components/base/document.py +18 -14
  29. reflex/components/base/document.pyi +83 -27
  30. reflex/components/base/error_boundary.pyi +5 -4
  31. reflex/components/base/fragment.pyi +5 -4
  32. reflex/components/base/link.pyi +9 -7
  33. reflex/components/base/meta.pyi +17 -13
  34. reflex/components/base/script.py +60 -58
  35. reflex/components/base/script.pyi +246 -31
  36. reflex/components/base/strict_mode.pyi +5 -4
  37. reflex/components/component.py +109 -194
  38. reflex/components/core/__init__.py +1 -0
  39. reflex/components/core/__init__.pyi +1 -0
  40. reflex/components/core/auto_scroll.pyi +5 -4
  41. reflex/components/core/banner.pyi +25 -19
  42. reflex/components/core/client_side_routing.py +7 -6
  43. reflex/components/core/client_side_routing.pyi +6 -56
  44. reflex/components/core/clipboard.pyi +5 -4
  45. reflex/components/core/debounce.py +1 -0
  46. reflex/components/core/debounce.pyi +5 -4
  47. reflex/components/core/foreach.py +3 -2
  48. reflex/components/core/helmet.py +14 -0
  49. reflex/components/{next/base.pyi → core/helmet.pyi} +10 -7
  50. reflex/components/core/html.pyi +5 -4
  51. reflex/components/core/sticky.pyi +17 -13
  52. reflex/components/core/upload.py +2 -1
  53. reflex/components/core/upload.pyi +21 -16
  54. reflex/components/datadisplay/code.pyi +9 -7
  55. reflex/components/datadisplay/dataeditor.pyi +5 -4
  56. reflex/components/datadisplay/shiki_code_block.pyi +13 -10
  57. reflex/components/dynamic.py +4 -5
  58. reflex/components/el/element.pyi +5 -4
  59. reflex/components/el/elements/base.pyi +5 -4
  60. reflex/components/el/elements/forms.pyi +69 -52
  61. reflex/components/el/elements/inline.pyi +113 -85
  62. reflex/components/el/elements/media.pyi +105 -79
  63. reflex/components/el/elements/metadata.pyi +25 -19
  64. reflex/components/el/elements/other.pyi +29 -22
  65. reflex/components/el/elements/scripts.pyi +13 -10
  66. reflex/components/el/elements/sectioning.pyi +61 -46
  67. reflex/components/el/elements/tables.pyi +41 -31
  68. reflex/components/el/elements/typography.pyi +61 -46
  69. reflex/components/field.py +175 -0
  70. reflex/components/gridjs/datatable.py +2 -2
  71. reflex/components/gridjs/datatable.pyi +11 -9
  72. reflex/components/lucide/icon.py +6 -2
  73. reflex/components/lucide/icon.pyi +15 -10
  74. reflex/components/markdown/markdown.pyi +5 -4
  75. reflex/components/moment/moment.pyi +5 -4
  76. reflex/components/plotly/plotly.pyi +19 -10
  77. reflex/components/props.py +376 -27
  78. reflex/components/radix/primitives/accordion.py +8 -1
  79. reflex/components/radix/primitives/accordion.pyi +29 -22
  80. reflex/components/radix/primitives/base.pyi +9 -7
  81. reflex/components/radix/primitives/drawer.pyi +45 -34
  82. reflex/components/radix/primitives/form.pyi +41 -31
  83. reflex/components/radix/primitives/progress.pyi +21 -16
  84. reflex/components/radix/primitives/slider.pyi +21 -16
  85. reflex/components/radix/themes/base.py +3 -3
  86. reflex/components/radix/themes/base.pyi +33 -25
  87. reflex/components/radix/themes/color_mode.pyi +13 -10
  88. reflex/components/radix/themes/components/alert_dialog.pyi +29 -22
  89. reflex/components/radix/themes/components/aspect_ratio.pyi +5 -4
  90. reflex/components/radix/themes/components/avatar.pyi +5 -4
  91. reflex/components/radix/themes/components/badge.pyi +5 -4
  92. reflex/components/radix/themes/components/button.pyi +5 -4
  93. reflex/components/radix/themes/components/callout.pyi +21 -16
  94. reflex/components/radix/themes/components/card.pyi +5 -4
  95. reflex/components/radix/themes/components/checkbox.pyi +13 -10
  96. reflex/components/radix/themes/components/checkbox_cards.pyi +9 -7
  97. reflex/components/radix/themes/components/checkbox_group.pyi +9 -7
  98. reflex/components/radix/themes/components/context_menu.pyi +53 -40
  99. reflex/components/radix/themes/components/data_list.pyi +17 -13
  100. reflex/components/radix/themes/components/dialog.pyi +29 -22
  101. reflex/components/radix/themes/components/dropdown_menu.pyi +33 -25
  102. reflex/components/radix/themes/components/hover_card.pyi +17 -13
  103. reflex/components/radix/themes/components/icon_button.pyi +5 -4
  104. reflex/components/radix/themes/components/inset.pyi +5 -4
  105. reflex/components/radix/themes/components/popover.pyi +17 -13
  106. reflex/components/radix/themes/components/progress.pyi +5 -4
  107. reflex/components/radix/themes/components/radio.pyi +5 -4
  108. reflex/components/radix/themes/components/radio_cards.pyi +9 -7
  109. reflex/components/radix/themes/components/radio_group.pyi +17 -13
  110. reflex/components/radix/themes/components/scroll_area.pyi +5 -4
  111. reflex/components/radix/themes/components/segmented_control.pyi +9 -7
  112. reflex/components/radix/themes/components/select.pyi +37 -28
  113. reflex/components/radix/themes/components/separator.pyi +5 -4
  114. reflex/components/radix/themes/components/skeleton.pyi +5 -4
  115. reflex/components/radix/themes/components/slider.pyi +5 -4
  116. reflex/components/radix/themes/components/spinner.pyi +5 -4
  117. reflex/components/radix/themes/components/switch.pyi +5 -4
  118. reflex/components/radix/themes/components/table.pyi +29 -22
  119. reflex/components/radix/themes/components/tabs.pyi +21 -16
  120. reflex/components/radix/themes/components/text_area.pyi +5 -4
  121. reflex/components/radix/themes/components/text_field.pyi +13 -10
  122. reflex/components/radix/themes/components/tooltip.pyi +5 -4
  123. reflex/components/radix/themes/layout/base.pyi +5 -4
  124. reflex/components/radix/themes/layout/box.pyi +5 -4
  125. reflex/components/radix/themes/layout/center.pyi +5 -4
  126. reflex/components/radix/themes/layout/container.pyi +5 -4
  127. reflex/components/radix/themes/layout/flex.pyi +5 -4
  128. reflex/components/radix/themes/layout/grid.pyi +5 -4
  129. reflex/components/radix/themes/layout/list.pyi +21 -16
  130. reflex/components/radix/themes/layout/section.pyi +5 -4
  131. reflex/components/radix/themes/layout/spacer.pyi +5 -4
  132. reflex/components/radix/themes/layout/stack.pyi +13 -10
  133. reflex/components/radix/themes/typography/blockquote.pyi +5 -4
  134. reflex/components/radix/themes/typography/code.pyi +5 -4
  135. reflex/components/radix/themes/typography/heading.pyi +5 -4
  136. reflex/components/radix/themes/typography/link.py +42 -9
  137. reflex/components/radix/themes/typography/link.pyi +311 -6
  138. reflex/components/radix/themes/typography/text.pyi +29 -22
  139. reflex/components/react_player/audio.pyi +5 -4
  140. reflex/components/react_player/react_player.pyi +5 -4
  141. reflex/components/react_player/video.pyi +5 -4
  142. reflex/components/recharts/cartesian.py +2 -1
  143. reflex/components/recharts/cartesian.pyi +65 -46
  144. reflex/components/recharts/charts.py +4 -2
  145. reflex/components/recharts/charts.pyi +36 -24
  146. reflex/components/recharts/general.pyi +24 -18
  147. reflex/components/recharts/polar.py +8 -4
  148. reflex/components/recharts/polar.pyi +16 -10
  149. reflex/components/recharts/recharts.pyi +9 -7
  150. reflex/components/sonner/toast.py +2 -2
  151. reflex/components/sonner/toast.pyi +7 -6
  152. reflex/config.py +3 -77
  153. reflex/constants/__init__.py +1 -0
  154. reflex/constants/base.py +38 -8
  155. reflex/constants/compiler.py +4 -2
  156. reflex/constants/event.py +1 -0
  157. reflex/constants/installer.py +23 -16
  158. reflex/constants/state.py +2 -0
  159. reflex/custom_components/custom_components.py +0 -14
  160. reflex/environment.py +1 -1
  161. reflex/event.py +178 -81
  162. reflex/experimental/__init__.py +0 -30
  163. reflex/istate/proxy.py +5 -3
  164. reflex/page.py +0 -27
  165. reflex/plugins/__init__.py +3 -2
  166. reflex/plugins/base.py +5 -1
  167. reflex/plugins/shared_tailwind.py +158 -0
  168. reflex/plugins/sitemap.py +206 -0
  169. reflex/plugins/tailwind_v3.py +13 -106
  170. reflex/plugins/tailwind_v4.py +15 -108
  171. reflex/reflex.py +1 -0
  172. reflex/state.py +134 -140
  173. reflex/testing.py +57 -9
  174. reflex/utils/build.py +9 -69
  175. reflex/utils/exec.py +59 -161
  176. reflex/utils/export.py +1 -1
  177. reflex/utils/imports.py +0 -4
  178. reflex/utils/misc.py +28 -0
  179. reflex/utils/prerequisites.py +62 -59
  180. reflex/utils/processes.py +6 -6
  181. reflex/utils/pyi_generator.py +21 -9
  182. reflex/utils/serializers.py +14 -1
  183. reflex/utils/types.py +196 -61
  184. reflex/vars/__init__.py +2 -0
  185. reflex/vars/base.py +367 -134
  186. {reflex-0.7.14a5.dist-info → reflex-0.8.0a1.dist-info}/METADATA +12 -5
  187. {reflex-0.7.14a5.dist-info → reflex-0.8.0a1.dist-info}/RECORD +190 -196
  188. reflex/.templates/web/next.config.js +0 -7
  189. reflex/components/base/head.py +0 -20
  190. reflex/components/base/head.pyi +0 -116
  191. reflex/components/next/__init__.py +0 -10
  192. reflex/components/next/base.py +0 -7
  193. reflex/components/next/image.py +0 -117
  194. reflex/components/next/image.pyi +0 -94
  195. reflex/components/next/link.py +0 -20
  196. reflex/components/next/link.pyi +0 -67
  197. reflex/components/next/video.py +0 -38
  198. reflex/components/next/video.pyi +0 -68
  199. reflex/components/suneditor/__init__.py +0 -5
  200. reflex/components/suneditor/editor.py +0 -269
  201. reflex/components/suneditor/editor.pyi +0 -199
  202. reflex/experimental/layout.py +0 -254
  203. {reflex-0.7.14a5.dist-info → reflex-0.8.0a1.dist-info}/WHEEL +0 -0
  204. {reflex-0.7.14a5.dist-info → reflex-0.8.0a1.dist-info}/entry_points.txt +0 -0
  205. {reflex-0.7.14a5.dist-info → reflex-0.8.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -8,7 +8,7 @@ from typing import Any, Literal, overload
8
8
 
9
9
  from reflex.components.core.breakpoints import Breakpoints
10
10
  from reflex.components.el import elements
11
- from reflex.event import EventType
11
+ from reflex.event import EventType, PointerEventInfo
12
12
  from reflex.vars.base import Var
13
13
 
14
14
  class Title(elements.Title):
@@ -30,9 +30,9 @@ class Title(elements.Title):
30
30
  autofocus: bool | None = None,
31
31
  custom_attrs: dict[str, Var | Any] | None = None,
32
32
  on_blur: EventType[()] | None = None,
33
- on_click: EventType[()] | None = None,
34
- on_context_menu: EventType[()] | None = None,
35
- on_double_click: EventType[()] | None = None,
33
+ on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
34
+ on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
35
+ on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
36
36
  on_focus: EventType[()] | None = None,
37
37
  on_mount: EventType[()] | None = None,
38
38
  on_mouse_down: EventType[()] | None = None,
@@ -43,6 +43,7 @@ class Title(elements.Title):
43
43
  on_mouse_over: EventType[()] | None = None,
44
44
  on_mouse_up: EventType[()] | None = None,
45
45
  on_scroll: EventType[()] | None = None,
46
+ on_scroll_end: EventType[()] | None = None,
46
47
  on_unmount: EventType[()] | None = None,
47
48
  **props,
48
49
  ) -> Title:
@@ -264,9 +265,9 @@ class Meta(elements.Meta):
264
265
  autofocus: bool | None = None,
265
266
  custom_attrs: dict[str, Var | Any] | None = None,
266
267
  on_blur: EventType[()] | None = None,
267
- on_click: EventType[()] | None = None,
268
- on_context_menu: EventType[()] | None = None,
269
- on_double_click: EventType[()] | None = None,
268
+ on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
269
+ on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
270
+ on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
270
271
  on_focus: EventType[()] | None = None,
271
272
  on_mount: EventType[()] | None = None,
272
273
  on_mouse_down: EventType[()] | None = None,
@@ -277,6 +278,7 @@ class Meta(elements.Meta):
277
278
  on_mouse_over: EventType[()] | None = None,
278
279
  on_mouse_up: EventType[()] | None = None,
279
280
  on_scroll: EventType[()] | None = None,
281
+ on_scroll_end: EventType[()] | None = None,
280
282
  on_unmount: EventType[()] | None = None,
281
283
  **props,
282
284
  ) -> Meta:
@@ -518,9 +520,9 @@ class Description(elements.Meta):
518
520
  autofocus: bool | None = None,
519
521
  custom_attrs: dict[str, Var | Any] | None = None,
520
522
  on_blur: EventType[()] | None = None,
521
- on_click: EventType[()] | None = None,
522
- on_context_menu: EventType[()] | None = None,
523
- on_double_click: EventType[()] | None = None,
523
+ on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
524
+ on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
525
+ on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
524
526
  on_focus: EventType[()] | None = None,
525
527
  on_mount: EventType[()] | None = None,
526
528
  on_mouse_down: EventType[()] | None = None,
@@ -531,6 +533,7 @@ class Description(elements.Meta):
531
533
  on_mouse_over: EventType[()] | None = None,
532
534
  on_mouse_up: EventType[()] | None = None,
533
535
  on_scroll: EventType[()] | None = None,
536
+ on_scroll_end: EventType[()] | None = None,
534
537
  on_unmount: EventType[()] | None = None,
535
538
  **props,
536
539
  ) -> Description:
@@ -772,9 +775,9 @@ class Image(elements.Meta):
772
775
  autofocus: bool | None = None,
773
776
  custom_attrs: dict[str, Var | Any] | None = None,
774
777
  on_blur: EventType[()] | None = None,
775
- on_click: EventType[()] | None = None,
776
- on_context_menu: EventType[()] | None = None,
777
- on_double_click: EventType[()] | None = None,
778
+ on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
779
+ on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
780
+ on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
778
781
  on_focus: EventType[()] | None = None,
779
782
  on_mount: EventType[()] | None = None,
780
783
  on_mouse_down: EventType[()] | None = None,
@@ -785,6 +788,7 @@ class Image(elements.Meta):
785
788
  on_mouse_over: EventType[()] | None = None,
786
789
  on_mouse_up: EventType[()] | None = None,
787
790
  on_scroll: EventType[()] | None = None,
791
+ on_scroll_end: EventType[()] | None = None,
788
792
  on_unmount: EventType[()] | None = None,
789
793
  **props,
790
794
  ) -> Image:
@@ -1,76 +1,78 @@
1
- """Next.js script wrappers and inline script functionality.
2
-
3
- https://nextjs.org/docs/app/api-reference/components/script
4
- """
1
+ """Wrapper for the script element. Uses the Helmet component to manage the head."""
5
2
 
6
3
  from __future__ import annotations
7
4
 
8
- from typing import Literal
9
-
10
- from reflex.components.component import Component
11
- from reflex.event import EventHandler, no_args_event_spec
12
- from reflex.vars.base import LiteralVar, Var
13
-
14
-
15
- class Script(Component):
16
- """Next.js script component.
17
-
18
- Note that this component differs from reflex.components.base.document.NextScript
19
- in that it is intended for use with custom and user-defined scripts.
20
-
21
- It also differs from reflex.components.base.link.ScriptTag, which is the plain
22
- HTML <script> tag which does not work when rendering a component.
23
- """
24
-
25
- library = "next/script"
26
- tag = "Script"
27
- is_default = True
5
+ from reflex.components import el as elements
6
+ from reflex.components.core.helmet import helmet
7
+ from reflex.utils import console
28
8
 
29
- # Required unless inline script is used
30
- src: Var[str]
31
9
 
32
- # When the script will execute: afterInteractive (defer-like behavior) | beforeInteractive | lazyOnload (async-like behavior)
33
- strategy: Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]] = (
34
- LiteralVar.create("afterInteractive")
35
- )
36
-
37
- # Triggered when the script is loading
38
- on_load: EventHandler[no_args_event_spec]
39
-
40
- # Triggered when the script has loaded
41
- on_ready: EventHandler[no_args_event_spec]
42
-
43
- # Triggered when the script has errored
44
- on_error: EventHandler[no_args_event_spec]
10
+ class Script(elements.Script):
11
+ """Wrapper for the script element."""
45
12
 
46
13
  @classmethod
47
- def create(cls, *children, **props) -> Component:
48
- """Create an inline or user-defined script.
49
-
50
- If a string is provided as the first child, it will be rendered as an inline script
51
- otherwise the `src` prop must be provided.
52
-
53
- The following event triggers are provided:
54
-
55
- on_load: Execute code after the script has finished loading.
56
- on_ready: Execute code after the script has finished loading and every
57
- time the component is mounted.
58
- on_error: Execute code if the script fails to load.
14
+ def create(
15
+ cls,
16
+ *children,
17
+ **props,
18
+ ):
19
+ """Display the script element.
59
20
 
60
21
  Args:
61
- *children: The children of the component.
62
- **props: The props of the component.
22
+ *children: The children of the element.
23
+ **props: The properties of the element.
63
24
 
64
25
  Returns:
65
- The component.
26
+ The script element.
66
27
 
67
28
  Raises:
68
- ValueError: when neither children nor `src` are specified.
29
+ ValueError: If neither children nor src is specified.
69
30
  """
70
- if not children and not props.get("src"):
71
- msg = "Must provide inline script or `src` prop."
31
+ async_ = props.pop("async_", None)
32
+ char_set = props.pop("char_set", None)
33
+ cross_origin = props.pop("cross_origin", None)
34
+ defer = props.pop("defer", None)
35
+ integrity = props.pop("integrity", None)
36
+ referrer_policy = props.pop("referrer_policy", None)
37
+ src = props.pop("src", None)
38
+ type = props.pop("type", None)
39
+ key = props.pop("key", None)
40
+ id = props.pop("id", None)
41
+ class_name = props.pop("class_name", None)
42
+ autofocus = props.pop("autofocus", None)
43
+ custom_attrs = props.pop("custom_attrs", None)
44
+ on_mount = props.pop("on_mount", None)
45
+ on_unmount = props.pop("on_unmount", None)
46
+
47
+ if props:
48
+ console.warn(
49
+ f"rx.script does not support the following properties: {list(props.keys())}"
50
+ )
51
+
52
+ if not children and not src:
53
+ msg = "You must specify either children or src for the script element."
72
54
  raise ValueError(msg)
73
- return super().create(*children, **props)
55
+
56
+ return helmet(
57
+ elements.Script.create(
58
+ *children,
59
+ async_=async_,
60
+ char_set=char_set,
61
+ cross_origin=cross_origin,
62
+ defer=defer,
63
+ integrity=integrity,
64
+ referrer_policy=referrer_policy,
65
+ src=src,
66
+ type=type,
67
+ key=key,
68
+ id=id,
69
+ class_name=class_name,
70
+ autofocus=autofocus,
71
+ custom_attrs=custom_attrs,
72
+ on_mount=on_mount,
73
+ on_unmount=on_unmount,
74
+ )
75
+ )
74
76
 
75
77
 
76
78
  script = Script.create
@@ -6,21 +6,229 @@
6
6
  from collections.abc import Mapping, Sequence
7
7
  from typing import Any, Literal, overload
8
8
 
9
- from reflex.components.component import Component
9
+ from reflex.components import el as elements
10
10
  from reflex.components.core.breakpoints import Breakpoints
11
- from reflex.event import EventType
11
+ from reflex.event import EventType, PointerEventInfo
12
12
  from reflex.vars.base import Var
13
13
 
14
- class Script(Component):
14
+ class Script(elements.Script):
15
15
  @overload
16
16
  @classmethod
17
17
  def create( # type: ignore
18
18
  cls,
19
19
  *children,
20
+ async_: Var[bool] | bool | None = None,
21
+ char_set: Var[str] | str | None = None,
22
+ cross_origin: Literal["", "anonymous", "use-credentials"]
23
+ | Var[Literal["", "anonymous", "use-credentials"]]
24
+ | None = None,
25
+ defer: Var[bool] | bool | None = None,
26
+ integrity: Var[str] | str | None = None,
27
+ referrer_policy: Literal[
28
+ "",
29
+ "no-referrer",
30
+ "no-referrer-when-downgrade",
31
+ "origin",
32
+ "origin-when-cross-origin",
33
+ "same-origin",
34
+ "strict-origin",
35
+ "strict-origin-when-cross-origin",
36
+ "unsafe-url",
37
+ ]
38
+ | Var[
39
+ Literal[
40
+ "",
41
+ "no-referrer",
42
+ "no-referrer-when-downgrade",
43
+ "origin",
44
+ "origin-when-cross-origin",
45
+ "same-origin",
46
+ "strict-origin",
47
+ "strict-origin-when-cross-origin",
48
+ "unsafe-url",
49
+ ]
50
+ ]
51
+ | None = None,
20
52
  src: Var[str] | str | None = None,
21
- strategy: Literal["afterInteractive", "beforeInteractive", "lazyOnload"]
22
- | Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]]
53
+ type: Var[str] | str | None = None,
54
+ access_key: Var[str] | str | None = None,
55
+ auto_capitalize: Literal[
56
+ "characters", "none", "off", "on", "sentences", "words"
57
+ ]
58
+ | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
59
+ | None = None,
60
+ content_editable: Literal["inherit", "plaintext-only", False, True]
61
+ | Var[Literal["inherit", "plaintext-only", False, True]]
62
+ | None = None,
63
+ context_menu: Var[str] | str | None = None,
64
+ dir: Var[str] | str | None = None,
65
+ draggable: Var[bool] | bool | None = None,
66
+ enter_key_hint: Literal[
67
+ "done", "enter", "go", "next", "previous", "search", "send"
68
+ ]
69
+ | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
70
+ | None = None,
71
+ hidden: Var[bool] | bool | None = None,
72
+ input_mode: Literal[
73
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
74
+ ]
75
+ | Var[
76
+ Literal[
77
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
78
+ ]
79
+ ]
23
80
  | None = None,
81
+ item_prop: Var[str] | str | None = None,
82
+ lang: Var[str] | str | None = None,
83
+ role: Literal[
84
+ "alert",
85
+ "alertdialog",
86
+ "application",
87
+ "article",
88
+ "banner",
89
+ "button",
90
+ "cell",
91
+ "checkbox",
92
+ "columnheader",
93
+ "combobox",
94
+ "complementary",
95
+ "contentinfo",
96
+ "definition",
97
+ "dialog",
98
+ "directory",
99
+ "document",
100
+ "feed",
101
+ "figure",
102
+ "form",
103
+ "grid",
104
+ "gridcell",
105
+ "group",
106
+ "heading",
107
+ "img",
108
+ "link",
109
+ "list",
110
+ "listbox",
111
+ "listitem",
112
+ "log",
113
+ "main",
114
+ "marquee",
115
+ "math",
116
+ "menu",
117
+ "menubar",
118
+ "menuitem",
119
+ "menuitemcheckbox",
120
+ "menuitemradio",
121
+ "navigation",
122
+ "none",
123
+ "note",
124
+ "option",
125
+ "presentation",
126
+ "progressbar",
127
+ "radio",
128
+ "radiogroup",
129
+ "region",
130
+ "row",
131
+ "rowgroup",
132
+ "rowheader",
133
+ "scrollbar",
134
+ "search",
135
+ "searchbox",
136
+ "separator",
137
+ "slider",
138
+ "spinbutton",
139
+ "status",
140
+ "switch",
141
+ "tab",
142
+ "table",
143
+ "tablist",
144
+ "tabpanel",
145
+ "term",
146
+ "textbox",
147
+ "timer",
148
+ "toolbar",
149
+ "tooltip",
150
+ "tree",
151
+ "treegrid",
152
+ "treeitem",
153
+ ]
154
+ | Var[
155
+ Literal[
156
+ "alert",
157
+ "alertdialog",
158
+ "application",
159
+ "article",
160
+ "banner",
161
+ "button",
162
+ "cell",
163
+ "checkbox",
164
+ "columnheader",
165
+ "combobox",
166
+ "complementary",
167
+ "contentinfo",
168
+ "definition",
169
+ "dialog",
170
+ "directory",
171
+ "document",
172
+ "feed",
173
+ "figure",
174
+ "form",
175
+ "grid",
176
+ "gridcell",
177
+ "group",
178
+ "heading",
179
+ "img",
180
+ "link",
181
+ "list",
182
+ "listbox",
183
+ "listitem",
184
+ "log",
185
+ "main",
186
+ "marquee",
187
+ "math",
188
+ "menu",
189
+ "menubar",
190
+ "menuitem",
191
+ "menuitemcheckbox",
192
+ "menuitemradio",
193
+ "navigation",
194
+ "none",
195
+ "note",
196
+ "option",
197
+ "presentation",
198
+ "progressbar",
199
+ "radio",
200
+ "radiogroup",
201
+ "region",
202
+ "row",
203
+ "rowgroup",
204
+ "rowheader",
205
+ "scrollbar",
206
+ "search",
207
+ "searchbox",
208
+ "separator",
209
+ "slider",
210
+ "spinbutton",
211
+ "status",
212
+ "switch",
213
+ "tab",
214
+ "table",
215
+ "tablist",
216
+ "tabpanel",
217
+ "term",
218
+ "textbox",
219
+ "timer",
220
+ "toolbar",
221
+ "tooltip",
222
+ "tree",
223
+ "treegrid",
224
+ "treeitem",
225
+ ]
226
+ ]
227
+ | None = None,
228
+ slot: Var[str] | str | None = None,
229
+ spell_check: Var[bool] | bool | None = None,
230
+ tab_index: Var[int] | int | None = None,
231
+ title: Var[str] | str | None = None,
24
232
  style: Sequence[Mapping[str, Any]]
25
233
  | Mapping[str, Any]
26
234
  | Var[Mapping[str, Any]]
@@ -33,12 +241,10 @@ class Script(Component):
33
241
  autofocus: bool | None = None,
34
242
  custom_attrs: dict[str, Var | Any] | None = None,
35
243
  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_error: EventType[()] | None = None,
244
+ on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
245
+ on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
246
+ on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
40
247
  on_focus: EventType[()] | None = None,
41
- on_load: EventType[()] | None = None,
42
248
  on_mount: EventType[()] | None = None,
43
249
  on_mouse_down: EventType[()] | None = None,
44
250
  on_mouse_enter: EventType[()] | None = None,
@@ -47,30 +253,39 @@ class Script(Component):
47
253
  on_mouse_out: EventType[()] | None = None,
48
254
  on_mouse_over: EventType[()] | None = None,
49
255
  on_mouse_up: EventType[()] | None = None,
50
- on_ready: EventType[()] | None = None,
51
256
  on_scroll: EventType[()] | None = None,
257
+ on_scroll_end: EventType[()] | None = None,
52
258
  on_unmount: EventType[()] | None = None,
53
259
  **props,
54
260
  ) -> Script:
55
- """Create an inline or user-defined script.
56
-
57
- If a string is provided as the first child, it will be rendered as an inline script
58
- otherwise the `src` prop must be provided.
59
-
60
- The following event triggers are provided:
61
-
62
- on_load: Execute code after the script has finished loading.
63
- on_ready: Execute code after the script has finished loading and every
64
- time the component is mounted.
65
- on_error: Execute code if the script fails to load.
261
+ """Display the script element.
66
262
 
67
263
  Args:
68
- *children: The children of the component.
69
- src: Required unless inline script is used
70
- strategy: When the script will execute: afterInteractive (defer-like behavior) | beforeInteractive | lazyOnload (async-like behavior)
71
- on_load: Triggered when the script is loading
72
- on_ready: Triggered when the script has loaded
73
- on_error: Triggered when the script has errored
264
+ *children: The children of the element.
265
+ async_: Indicates that the script should be executed asynchronously
266
+ char_set: Character encoding of the external script
267
+ cross_origin: Configures the CORS requests for the script
268
+ defer: Indicates that the script should be executed after the page has finished parsing
269
+ integrity: Security feature allowing browsers to verify what they fetch
270
+ referrer_policy: Specifies which referrer information to send when fetching the script
271
+ src: URL of an external script
272
+ type: Specifies the MIME type of the script
273
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
274
+ auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
275
+ content_editable: Indicates whether the element's content is editable.
276
+ context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
277
+ dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
278
+ draggable: Defines whether the element can be dragged.
279
+ enter_key_hint: Hints what media types the media element is able to play.
280
+ hidden: Defines whether the element is hidden.
281
+ input_mode: Defines the type of the element.
282
+ item_prop: Defines the name of the element for metadata purposes.
283
+ lang: Defines the language used in the element.
284
+ role: Defines the role of the element.
285
+ slot: Assigns a slot in a shadow DOM shadow tree to an element.
286
+ spell_check: Defines whether the element may be checked for spelling errors.
287
+ tab_index: Defines the position of the current element in the tabbing order.
288
+ title: Defines a tooltip for the element.
74
289
  style: The style of the component.
75
290
  key: A unique key for the component.
76
291
  id: The id for the component.
@@ -78,13 +293,13 @@ class Script(Component):
78
293
  class_name: The class name for the component.
79
294
  autofocus: Whether the component should take the focus once the page is loaded
80
295
  custom_attrs: custom attribute
81
- **props: The props of the component.
296
+ **props: The properties of the element.
82
297
 
83
298
  Returns:
84
- The component.
299
+ The script element.
85
300
 
86
301
  Raises:
87
- ValueError: when neither children nor `src` are specified.
302
+ ValueError: If neither children nor src is specified.
88
303
  """
89
304
 
90
305
  script = Script.create
@@ -8,7 +8,7 @@ from typing import Any, overload
8
8
 
9
9
  from reflex.components.component import Component
10
10
  from reflex.components.core.breakpoints import Breakpoints
11
- from reflex.event import EventType
11
+ from reflex.event import EventType, PointerEventInfo
12
12
  from reflex.vars.base import Var
13
13
 
14
14
  class StrictMode(Component):
@@ -29,9 +29,9 @@ class StrictMode(Component):
29
29
  autofocus: bool | None = None,
30
30
  custom_attrs: dict[str, Var | Any] | None = None,
31
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,
32
+ on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
33
+ on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
34
+ on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
35
35
  on_focus: EventType[()] | None = None,
36
36
  on_mount: EventType[()] | None = None,
37
37
  on_mouse_down: EventType[()] | None = None,
@@ -42,6 +42,7 @@ class StrictMode(Component):
42
42
  on_mouse_over: EventType[()] | None = None,
43
43
  on_mouse_up: EventType[()] | None = None,
44
44
  on_scroll: EventType[()] | None = None,
45
+ on_scroll_end: EventType[()] | None = None,
45
46
  on_unmount: EventType[()] | None = None,
46
47
  **props,
47
48
  ) -> StrictMode: