reflex 0.7.14a6__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.
- 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/utils/context.js.jinja2 +25 -6
- 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 -32
- 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 +89 -0
- reflex/.templates/web/utils/state.js +155 -67
- reflex/.templates/web/vite.config.js +32 -0
- reflex/__init__.py +1 -6
- reflex/__init__.pyi +0 -4
- reflex/app.py +52 -115
- reflex/base.py +1 -87
- reflex/compiler/compiler.py +40 -3
- reflex/compiler/utils.py +54 -28
- 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 +109 -194
- 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.pyi +9 -7
- reflex/components/datadisplay/dataeditor.pyi +5 -4
- reflex/components/datadisplay/shiki_code_block.pyi +13 -10
- reflex/components/dynamic.py +4 -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 +42 -9
- 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 +7 -6
- reflex/config.py +3 -77
- reflex/constants/__init__.py +1 -0
- reflex/constants/base.py +38 -8
- reflex/constants/compiler.py +4 -2
- reflex/constants/event.py +1 -0
- reflex/constants/installer.py +23 -16
- 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/state.py +134 -140
- reflex/testing.py +57 -9
- reflex/utils/build.py +9 -69
- reflex/utils/exec.py +59 -161
- reflex/utils/export.py +1 -1
- reflex/utils/imports.py +0 -4
- reflex/utils/misc.py +28 -0
- reflex/utils/prerequisites.py +62 -59
- reflex/utils/processes.py +6 -6
- 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.0a1.dist-info}/METADATA +12 -5
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a1.dist-info}/RECORD +190 -197
- 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.0a1.dist-info}/WHEEL +0 -0
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a1.dist-info}/entry_points.txt +0 -0
- {reflex-0.7.14a6.dist-info → reflex-0.8.0a1.dist-info}/licenses/LICENSE +0 -0
reflex/components/base/script.py
CHANGED
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
"""
|
|
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
|
|
9
|
-
|
|
10
|
-
from reflex.
|
|
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
|
-
|
|
33
|
-
|
|
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(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
62
|
-
**props: The
|
|
22
|
+
*children: The children of the element.
|
|
23
|
+
**props: The properties of the element.
|
|
63
24
|
|
|
64
25
|
Returns:
|
|
65
|
-
The
|
|
26
|
+
The script element.
|
|
66
27
|
|
|
67
28
|
Raises:
|
|
68
|
-
ValueError:
|
|
29
|
+
ValueError: If neither children nor src is specified.
|
|
69
30
|
"""
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
"""
|
|
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
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
|
296
|
+
**props: The properties of the element.
|
|
82
297
|
|
|
83
298
|
Returns:
|
|
84
|
-
The
|
|
299
|
+
The script element.
|
|
85
300
|
|
|
86
301
|
Raises:
|
|
87
|
-
ValueError:
|
|
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:
|