reflex 0.8.5a2__py3-none-any.whl → 0.8.6a1__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/{web/vite.config.js → jinja/web/vite.config.js.jinja2} +11 -0
- reflex/.templates/web/utils/state.js +5 -0
- reflex/__init__.py +1 -0
- reflex/__init__.pyi +2 -0
- reflex/app.py +77 -13
- reflex/compiler/templates.py +3 -0
- reflex/components/base/error_boundary.py +2 -0
- reflex/components/datadisplay/dataeditor.py +3 -0
- reflex/components/datadisplay/dataeditor.pyi +2 -0
- reflex/components/el/__init__.pyi +4 -0
- reflex/components/el/elements/__init__.py +1 -0
- reflex/components/el/elements/__init__.pyi +5 -0
- reflex/components/el/elements/media.py +32 -0
- reflex/components/el/elements/media.pyi +261 -0
- reflex/components/lucide/icon.py +4 -1
- reflex/components/lucide/icon.pyi +4 -1
- reflex/components/sonner/toast.py +1 -1
- reflex/config.py +15 -0
- reflex/constants/base.py +3 -0
- reflex/istate/manager.py +2 -1
- reflex/plugins/__init__.py +2 -0
- reflex/plugins/_screenshot.py +144 -0
- reflex/plugins/base.py +14 -1
- reflex/state.py +28 -6
- reflex/testing.py +11 -0
- reflex/utils/decorator.py +1 -0
- reflex/utils/monitoring.py +180 -0
- reflex/utils/prerequisites.py +17 -0
- reflex/utils/token_manager.py +215 -0
- {reflex-0.8.5a2.dist-info → reflex-0.8.6a1.dist-info}/METADATA +5 -2
- {reflex-0.8.5a2.dist-info → reflex-0.8.6a1.dist-info}/RECORD +34 -31
- {reflex-0.8.5a2.dist-info → reflex-0.8.6a1.dist-info}/WHEEL +0 -0
- {reflex-0.8.5a2.dist-info → reflex-0.8.6a1.dist-info}/entry_points.txt +0 -0
- {reflex-0.8.5a2.dist-info → reflex-0.8.6a1.dist-info}/licenses/LICENSE +0 -0
|
@@ -25,6 +25,7 @@ function alwaysUseReactDomServerNode() {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export default defineConfig((config) => ({
|
|
28
|
+
base: "{{base}}",
|
|
28
29
|
plugins: [
|
|
29
30
|
alwaysUseReactDomServerNode(),
|
|
30
31
|
reactRouter(),
|
|
@@ -33,6 +34,16 @@ export default defineConfig((config) => ({
|
|
|
33
34
|
build: {
|
|
34
35
|
rollupOptions: {
|
|
35
36
|
jsx: {},
|
|
37
|
+
output: {
|
|
38
|
+
advancedChunks: {
|
|
39
|
+
groups: [
|
|
40
|
+
{
|
|
41
|
+
test: /env.json/,
|
|
42
|
+
name: "reflex-env",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
36
47
|
},
|
|
37
48
|
},
|
|
38
49
|
server: {
|
|
@@ -530,6 +530,7 @@ export const connect = async (
|
|
|
530
530
|
transports: transports,
|
|
531
531
|
protocols: [reflexEnvironment.version],
|
|
532
532
|
autoUnref: false,
|
|
533
|
+
query: { token: getToken() },
|
|
533
534
|
});
|
|
534
535
|
// Ensure undefined fields in events are sent as null instead of removed
|
|
535
536
|
socket.current.io.encoder.replacer = (k, v) => (v === undefined ? null : v);
|
|
@@ -601,6 +602,10 @@ export const connect = async (
|
|
|
601
602
|
event_processing = false;
|
|
602
603
|
queueEvents([...initialEvents(), event], socket, true, navigate, params);
|
|
603
604
|
});
|
|
605
|
+
socket.current.on("new_token", async (new_token) => {
|
|
606
|
+
token = new_token;
|
|
607
|
+
window.sessionStorage.setItem(TOKEN_KEY, new_token);
|
|
608
|
+
});
|
|
604
609
|
|
|
605
610
|
document.addEventListener("visibilitychange", checkVisibility);
|
|
606
611
|
};
|
reflex/__init__.py
CHANGED
|
@@ -285,6 +285,7 @@ _MAPPING: dict = {
|
|
|
285
285
|
"data_editor_theme",
|
|
286
286
|
],
|
|
287
287
|
"components.sonner.toast": ["toast"],
|
|
288
|
+
"components.props": ["PropsBase"],
|
|
288
289
|
"components.datadisplay.logo": ["logo"],
|
|
289
290
|
"components.gridjs": ["data_table"],
|
|
290
291
|
"components.moment": ["MomentDelta", "moment"],
|
reflex/__init__.pyi
CHANGED
|
@@ -62,6 +62,7 @@ from .components.lucide import icon
|
|
|
62
62
|
from .components.markdown import markdown
|
|
63
63
|
from .components.moment import MomentDelta, moment
|
|
64
64
|
from .components.plotly import plotly
|
|
65
|
+
from .components.props import PropsBase
|
|
65
66
|
from .components.radix.primitives.accordion import accordion
|
|
66
67
|
from .components.radix.primitives.drawer import drawer
|
|
67
68
|
from .components.radix.primitives.form import form
|
|
@@ -193,6 +194,7 @@ __all__ = [
|
|
|
193
194
|
"Model",
|
|
194
195
|
"MomentDelta",
|
|
195
196
|
"NoSSRComponent",
|
|
197
|
+
"PropsBase",
|
|
196
198
|
"Script",
|
|
197
199
|
"SessionStorage",
|
|
198
200
|
"State",
|
reflex/app.py
CHANGED
|
@@ -13,6 +13,7 @@ import io
|
|
|
13
13
|
import json
|
|
14
14
|
import sys
|
|
15
15
|
import traceback
|
|
16
|
+
import urllib.parse
|
|
16
17
|
from collections.abc import (
|
|
17
18
|
AsyncGenerator,
|
|
18
19
|
AsyncIterator,
|
|
@@ -114,6 +115,7 @@ from reflex.utils import (
|
|
|
114
115
|
)
|
|
115
116
|
from reflex.utils.exec import get_compile_context, is_prod_mode, is_testing_env
|
|
116
117
|
from reflex.utils.imports import ImportVar
|
|
118
|
+
from reflex.utils.token_manager import TokenManager
|
|
117
119
|
from reflex.utils.types import ASGIApp, Message, Receive, Scope, Send
|
|
118
120
|
|
|
119
121
|
if TYPE_CHECKING:
|
|
@@ -602,6 +604,11 @@ class App(MiddlewareMixin, LifespanMixin):
|
|
|
602
604
|
|
|
603
605
|
self._compile(prerender_routes=is_prod_mode())
|
|
604
606
|
|
|
607
|
+
config = get_config()
|
|
608
|
+
|
|
609
|
+
for plugin in config.plugins:
|
|
610
|
+
plugin.post_compile(app=self)
|
|
611
|
+
|
|
605
612
|
# We will not be making more vars, so we can clear the global cache to free up memory.
|
|
606
613
|
GLOBAL_CACHE.clear()
|
|
607
614
|
|
|
@@ -1924,6 +1931,13 @@ def upload(app: App):
|
|
|
1924
1931
|
)
|
|
1925
1932
|
)
|
|
1926
1933
|
|
|
1934
|
+
for file in files:
|
|
1935
|
+
if not isinstance(file, StarletteUploadFile):
|
|
1936
|
+
raise UploadValueError(
|
|
1937
|
+
"Uploaded file is not an UploadFile." + str(file)
|
|
1938
|
+
)
|
|
1939
|
+
await file.close()
|
|
1940
|
+
|
|
1927
1941
|
event = Event(
|
|
1928
1942
|
token=token,
|
|
1929
1943
|
name=handler,
|
|
@@ -1958,12 +1972,6 @@ class EventNamespace(AsyncNamespace):
|
|
|
1958
1972
|
# The application object.
|
|
1959
1973
|
app: App
|
|
1960
1974
|
|
|
1961
|
-
# Keep a mapping between socket ID and client token.
|
|
1962
|
-
token_to_sid: dict[str, str]
|
|
1963
|
-
|
|
1964
|
-
# Keep a mapping between client token and socket ID.
|
|
1965
|
-
sid_to_token: dict[str, str]
|
|
1966
|
-
|
|
1967
1975
|
def __init__(self, namespace: str, app: App):
|
|
1968
1976
|
"""Initialize the event namespace.
|
|
1969
1977
|
|
|
@@ -1972,17 +1980,45 @@ class EventNamespace(AsyncNamespace):
|
|
|
1972
1980
|
app: The application object.
|
|
1973
1981
|
"""
|
|
1974
1982
|
super().__init__(namespace)
|
|
1975
|
-
self.token_to_sid = {}
|
|
1976
|
-
self.sid_to_token = {}
|
|
1977
1983
|
self.app = app
|
|
1978
1984
|
|
|
1979
|
-
|
|
1985
|
+
# Use TokenManager for distributed duplicate tab prevention
|
|
1986
|
+
self._token_manager = TokenManager.create()
|
|
1987
|
+
|
|
1988
|
+
@property
|
|
1989
|
+
def token_to_sid(self) -> dict[str, str]:
|
|
1990
|
+
"""Get token to SID mapping for backward compatibility.
|
|
1991
|
+
|
|
1992
|
+
Returns:
|
|
1993
|
+
The token to SID mapping dict.
|
|
1994
|
+
"""
|
|
1995
|
+
# For backward compatibility, expose the underlying dict
|
|
1996
|
+
return self._token_manager.token_to_sid
|
|
1997
|
+
|
|
1998
|
+
@property
|
|
1999
|
+
def sid_to_token(self) -> dict[str, str]:
|
|
2000
|
+
"""Get SID to token mapping for backward compatibility.
|
|
2001
|
+
|
|
2002
|
+
Returns:
|
|
2003
|
+
The SID to token mapping dict.
|
|
2004
|
+
"""
|
|
2005
|
+
# For backward compatibility, expose the underlying dict
|
|
2006
|
+
return self._token_manager.sid_to_token
|
|
2007
|
+
|
|
2008
|
+
async def on_connect(self, sid: str, environ: dict):
|
|
1980
2009
|
"""Event for when the websocket is connected.
|
|
1981
2010
|
|
|
1982
2011
|
Args:
|
|
1983
2012
|
sid: The Socket.IO session id.
|
|
1984
2013
|
environ: The request information, including HTTP headers.
|
|
1985
2014
|
"""
|
|
2015
|
+
query_params = urllib.parse.parse_qs(environ.get("QUERY_STRING", ""))
|
|
2016
|
+
token_list = query_params.get("token", [])
|
|
2017
|
+
if token_list:
|
|
2018
|
+
await self.link_token_to_sid(sid, token_list[0])
|
|
2019
|
+
else:
|
|
2020
|
+
console.warn(f"No token provided in connection for session {sid}")
|
|
2021
|
+
|
|
1986
2022
|
subprotocol = environ.get("HTTP_SEC_WEBSOCKET_PROTOCOL")
|
|
1987
2023
|
if subprotocol and subprotocol != constants.Reflex.VERSION:
|
|
1988
2024
|
console.warn(
|
|
@@ -1995,9 +2031,18 @@ class EventNamespace(AsyncNamespace):
|
|
|
1995
2031
|
Args:
|
|
1996
2032
|
sid: The Socket.IO session id.
|
|
1997
2033
|
"""
|
|
1998
|
-
|
|
2034
|
+
# Get token before cleaning up
|
|
2035
|
+
disconnect_token = self.sid_to_token.get(sid)
|
|
1999
2036
|
if disconnect_token:
|
|
2000
|
-
|
|
2037
|
+
# Use async cleanup through token manager
|
|
2038
|
+
task = asyncio.create_task(
|
|
2039
|
+
self._token_manager.disconnect_token(disconnect_token, sid)
|
|
2040
|
+
)
|
|
2041
|
+
# Don't await to avoid blocking disconnect, but handle potential errors
|
|
2042
|
+
task.add_done_callback(
|
|
2043
|
+
lambda t: t.exception()
|
|
2044
|
+
and console.error(f"Token cleanup error: {t.exception()}")
|
|
2045
|
+
)
|
|
2001
2046
|
|
|
2002
2047
|
async def emit_update(self, update: StateUpdate, sid: str) -> None:
|
|
2003
2048
|
"""Emit an update to the client.
|
|
@@ -2055,8 +2100,13 @@ class EventNamespace(AsyncNamespace):
|
|
|
2055
2100
|
msg = f"Failed to deserialize event data: {fields}."
|
|
2056
2101
|
raise exceptions.EventDeserializationError(msg) from ex
|
|
2057
2102
|
|
|
2058
|
-
|
|
2059
|
-
self.sid_to_token
|
|
2103
|
+
# Correct the token if it doesn't match what we expect for this SID
|
|
2104
|
+
expected_token = self.sid_to_token.get(sid)
|
|
2105
|
+
if expected_token and event.token != expected_token:
|
|
2106
|
+
# Create new event with corrected token since Event is frozen
|
|
2107
|
+
from dataclasses import replace
|
|
2108
|
+
|
|
2109
|
+
event = replace(event, token=expected_token)
|
|
2060
2110
|
|
|
2061
2111
|
# Get the event environment.
|
|
2062
2112
|
if self.app.sio is None:
|
|
@@ -2106,3 +2156,17 @@ class EventNamespace(AsyncNamespace):
|
|
|
2106
2156
|
"""
|
|
2107
2157
|
# Emit the test event.
|
|
2108
2158
|
await self.emit(str(constants.SocketEvent.PING), "pong", to=sid)
|
|
2159
|
+
|
|
2160
|
+
async def link_token_to_sid(self, sid: str, token: str):
|
|
2161
|
+
"""Link a token to a session id.
|
|
2162
|
+
|
|
2163
|
+
Args:
|
|
2164
|
+
sid: The Socket.IO session id.
|
|
2165
|
+
token: The client token.
|
|
2166
|
+
"""
|
|
2167
|
+
# Use TokenManager for duplicate detection and Redis support
|
|
2168
|
+
new_token = await self._token_manager.link_token_to_sid(token, sid)
|
|
2169
|
+
|
|
2170
|
+
if new_token:
|
|
2171
|
+
# Duplicate detected, emit new token to client
|
|
2172
|
+
await self.emit("new_token", new_token, to=sid)
|
reflex/compiler/templates.py
CHANGED
|
@@ -149,6 +149,9 @@ STYLE = get_template("web/styles/styles.css.jinja2")
|
|
|
149
149
|
# Code that generate the package json file
|
|
150
150
|
PACKAGE_JSON = get_template("web/package.json.jinja2")
|
|
151
151
|
|
|
152
|
+
# Code that generate the vite.config.js file
|
|
153
|
+
VITE_CONFIG = get_template("web/vite.config.js.jinja2")
|
|
154
|
+
|
|
152
155
|
# Template containing some macros used in the web pages.
|
|
153
156
|
MACROS = get_template("web/pages/macros.js.jinja2")
|
|
154
157
|
|
|
@@ -197,6 +197,9 @@ class DataEditor(NoSSRComponent):
|
|
|
197
197
|
# Enables or disables the overlay shadow when scrolling vertically.
|
|
198
198
|
fixed_shadow_y: Var[bool]
|
|
199
199
|
|
|
200
|
+
# Controls the presence of the fill indicator
|
|
201
|
+
fill_handle: Var[bool]
|
|
202
|
+
|
|
200
203
|
# The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
|
|
201
204
|
freeze_columns: Var[int]
|
|
202
205
|
|
|
@@ -141,6 +141,7 @@ class DataEditor(NoSSRComponent):
|
|
|
141
141
|
draw_focus_ring: Var[bool] | bool | None = None,
|
|
142
142
|
fixed_shadow_x: Var[bool] | bool | None = None,
|
|
143
143
|
fixed_shadow_y: Var[bool] | bool | None = None,
|
|
144
|
+
fill_handle: Var[bool] | bool | None = None,
|
|
144
145
|
freeze_columns: Var[int] | int | None = None,
|
|
145
146
|
group_header_height: Var[int] | int | None = None,
|
|
146
147
|
header_height: Var[int] | int | None = None,
|
|
@@ -245,6 +246,7 @@ class DataEditor(NoSSRComponent):
|
|
|
245
246
|
draw_focus_ring: Controls the drawing of the focus ring.
|
|
246
247
|
fixed_shadow_x: Enables or disables the overlay shadow when scrolling horizontally.
|
|
247
248
|
fixed_shadow_y: Enables or disables the overlay shadow when scrolling vertically.
|
|
249
|
+
fill_handle: Controls the presence of the fill indicator
|
|
248
250
|
freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
|
|
249
251
|
group_header_height: Controls the header of the group header row.
|
|
250
252
|
header_height: Controls the height of the header row.
|
|
@@ -106,6 +106,7 @@ from .elements.media import (
|
|
|
106
106
|
Line,
|
|
107
107
|
LinearGradient,
|
|
108
108
|
Map,
|
|
109
|
+
Marker,
|
|
109
110
|
Object,
|
|
110
111
|
Path,
|
|
111
112
|
Picture,
|
|
@@ -132,6 +133,7 @@ from .elements.media import (
|
|
|
132
133
|
line,
|
|
133
134
|
linear_gradient,
|
|
134
135
|
map,
|
|
136
|
+
marker,
|
|
135
137
|
object,
|
|
136
138
|
path,
|
|
137
139
|
picture,
|
|
@@ -332,6 +334,7 @@ __all__ = [
|
|
|
332
334
|
"Main",
|
|
333
335
|
"Map",
|
|
334
336
|
"Mark",
|
|
337
|
+
"Marker",
|
|
335
338
|
"Math",
|
|
336
339
|
"Meta",
|
|
337
340
|
"Meter",
|
|
@@ -457,6 +460,7 @@ __all__ = [
|
|
|
457
460
|
"main",
|
|
458
461
|
"map",
|
|
459
462
|
"mark",
|
|
463
|
+
"marker",
|
|
460
464
|
"math",
|
|
461
465
|
"meta",
|
|
462
466
|
"meter",
|
|
@@ -104,6 +104,7 @@ from .media import (
|
|
|
104
104
|
Line,
|
|
105
105
|
LinearGradient,
|
|
106
106
|
Map,
|
|
107
|
+
Marker,
|
|
107
108
|
Object,
|
|
108
109
|
Path,
|
|
109
110
|
Picture,
|
|
@@ -130,6 +131,7 @@ from .media import (
|
|
|
130
131
|
line,
|
|
131
132
|
linear_gradient,
|
|
132
133
|
map,
|
|
134
|
+
marker,
|
|
133
135
|
object,
|
|
134
136
|
path,
|
|
135
137
|
picture,
|
|
@@ -336,6 +338,7 @@ _MAPPING = {
|
|
|
336
338
|
"linear_gradient",
|
|
337
339
|
"radial_gradient",
|
|
338
340
|
"defs",
|
|
341
|
+
"marker",
|
|
339
342
|
],
|
|
340
343
|
"metadata": ["base", "head", "link", "meta", "title", "style"],
|
|
341
344
|
"other": ["details", "dialog", "summary", "slot", "template", "math", "html"],
|
|
@@ -469,6 +472,7 @@ __all__ = [
|
|
|
469
472
|
"Main",
|
|
470
473
|
"Map",
|
|
471
474
|
"Mark",
|
|
475
|
+
"Marker",
|
|
472
476
|
"Math",
|
|
473
477
|
"Meta",
|
|
474
478
|
"Meter",
|
|
@@ -593,6 +597,7 @@ __all__ = [
|
|
|
593
597
|
"main",
|
|
594
598
|
"map",
|
|
595
599
|
"mark",
|
|
600
|
+
"marker",
|
|
596
601
|
"math",
|
|
597
602
|
"meta",
|
|
598
603
|
"meter",
|
|
@@ -484,6 +484,36 @@ class Path(BaseHTML):
|
|
|
484
484
|
d: Var[str | int | float]
|
|
485
485
|
|
|
486
486
|
|
|
487
|
+
class Marker(BaseHTML):
|
|
488
|
+
"""Display the marker element."""
|
|
489
|
+
|
|
490
|
+
tag = "marker"
|
|
491
|
+
|
|
492
|
+
# The height of the marker viewport.
|
|
493
|
+
marker_height: Var[str | int | float]
|
|
494
|
+
|
|
495
|
+
# The width of the marker viewport.
|
|
496
|
+
marker_width: Var[str | int | float]
|
|
497
|
+
|
|
498
|
+
# The coordinate system for the marker attributes.
|
|
499
|
+
marker_units: Var[str]
|
|
500
|
+
|
|
501
|
+
# The orientation of the marker relative to the shape it is attached to.
|
|
502
|
+
orient: Var[str | int | float]
|
|
503
|
+
|
|
504
|
+
# How the svg fragment must be deformed if it is embedded in a container with a different aspect ratio.
|
|
505
|
+
preserve_aspect_ratio: Var[str]
|
|
506
|
+
|
|
507
|
+
# The x coordinate for the reference point of the marker.
|
|
508
|
+
ref_x: Var[str | int | float]
|
|
509
|
+
|
|
510
|
+
# The y coordinate for the reference point of the marker.
|
|
511
|
+
ref_y: Var[str | int | float]
|
|
512
|
+
|
|
513
|
+
# The bound of the SVG viewport for the current SVG fragment.
|
|
514
|
+
view_box: Var[str]
|
|
515
|
+
|
|
516
|
+
|
|
487
517
|
class G(BaseHTML):
|
|
488
518
|
"""The SVG g component, used to group other SVG elements."""
|
|
489
519
|
|
|
@@ -522,6 +552,7 @@ class SVG(ComponentNamespace):
|
|
|
522
552
|
linear_gradient = staticmethod(LinearGradient.create)
|
|
523
553
|
radial_gradient = staticmethod(RadialGradient.create)
|
|
524
554
|
defs = staticmethod(Defs.create)
|
|
555
|
+
marker = staticmethod(Marker.create)
|
|
525
556
|
g = staticmethod(G.create)
|
|
526
557
|
__call__ = staticmethod(Svg.create)
|
|
527
558
|
|
|
@@ -537,6 +568,7 @@ stop = Stop.create
|
|
|
537
568
|
linear_gradient = LinearGradient.create
|
|
538
569
|
radial_gradient = RadialGradient.create
|
|
539
570
|
defs = Defs.create
|
|
571
|
+
marker = Marker.create
|
|
540
572
|
g = G.create
|
|
541
573
|
area = Area.create
|
|
542
574
|
audio = Audio.create
|
|
@@ -6162,6 +6162,265 @@ class Path(BaseHTML):
|
|
|
6162
6162
|
The component.
|
|
6163
6163
|
"""
|
|
6164
6164
|
|
|
6165
|
+
class Marker(BaseHTML):
|
|
6166
|
+
@classmethod
|
|
6167
|
+
def create(
|
|
6168
|
+
cls,
|
|
6169
|
+
*children,
|
|
6170
|
+
marker_height: Var[float | int | str] | float | int | str | None = None,
|
|
6171
|
+
marker_width: Var[float | int | str] | float | int | str | None = None,
|
|
6172
|
+
marker_units: Var[str] | str | None = None,
|
|
6173
|
+
orient: Var[float | int | str] | float | int | str | None = None,
|
|
6174
|
+
preserve_aspect_ratio: Var[str] | str | None = None,
|
|
6175
|
+
ref_x: Var[float | int | str] | float | int | str | None = None,
|
|
6176
|
+
ref_y: Var[float | int | str] | float | int | str | None = None,
|
|
6177
|
+
view_box: Var[str] | str | None = None,
|
|
6178
|
+
access_key: Var[str] | str | None = None,
|
|
6179
|
+
auto_capitalize: Literal[
|
|
6180
|
+
"characters", "none", "off", "on", "sentences", "words"
|
|
6181
|
+
]
|
|
6182
|
+
| Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
|
|
6183
|
+
| None = None,
|
|
6184
|
+
content_editable: Literal["inherit", "plaintext-only", False, True]
|
|
6185
|
+
| Var[Literal["inherit", "plaintext-only", False, True]]
|
|
6186
|
+
| None = None,
|
|
6187
|
+
context_menu: Var[str] | str | None = None,
|
|
6188
|
+
dir: Var[str] | str | None = None,
|
|
6189
|
+
draggable: Var[bool] | bool | None = None,
|
|
6190
|
+
enter_key_hint: Literal[
|
|
6191
|
+
"done", "enter", "go", "next", "previous", "search", "send"
|
|
6192
|
+
]
|
|
6193
|
+
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
|
|
6194
|
+
| None = None,
|
|
6195
|
+
hidden: Var[bool] | bool | None = None,
|
|
6196
|
+
input_mode: Literal[
|
|
6197
|
+
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
|
|
6198
|
+
]
|
|
6199
|
+
| Var[
|
|
6200
|
+
Literal[
|
|
6201
|
+
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
|
|
6202
|
+
]
|
|
6203
|
+
]
|
|
6204
|
+
| None = None,
|
|
6205
|
+
item_prop: Var[str] | str | None = None,
|
|
6206
|
+
lang: Var[str] | str | None = None,
|
|
6207
|
+
role: Literal[
|
|
6208
|
+
"alert",
|
|
6209
|
+
"alertdialog",
|
|
6210
|
+
"application",
|
|
6211
|
+
"article",
|
|
6212
|
+
"banner",
|
|
6213
|
+
"button",
|
|
6214
|
+
"cell",
|
|
6215
|
+
"checkbox",
|
|
6216
|
+
"columnheader",
|
|
6217
|
+
"combobox",
|
|
6218
|
+
"complementary",
|
|
6219
|
+
"contentinfo",
|
|
6220
|
+
"definition",
|
|
6221
|
+
"dialog",
|
|
6222
|
+
"directory",
|
|
6223
|
+
"document",
|
|
6224
|
+
"feed",
|
|
6225
|
+
"figure",
|
|
6226
|
+
"form",
|
|
6227
|
+
"grid",
|
|
6228
|
+
"gridcell",
|
|
6229
|
+
"group",
|
|
6230
|
+
"heading",
|
|
6231
|
+
"img",
|
|
6232
|
+
"link",
|
|
6233
|
+
"list",
|
|
6234
|
+
"listbox",
|
|
6235
|
+
"listitem",
|
|
6236
|
+
"log",
|
|
6237
|
+
"main",
|
|
6238
|
+
"marquee",
|
|
6239
|
+
"math",
|
|
6240
|
+
"menu",
|
|
6241
|
+
"menubar",
|
|
6242
|
+
"menuitem",
|
|
6243
|
+
"menuitemcheckbox",
|
|
6244
|
+
"menuitemradio",
|
|
6245
|
+
"navigation",
|
|
6246
|
+
"none",
|
|
6247
|
+
"note",
|
|
6248
|
+
"option",
|
|
6249
|
+
"presentation",
|
|
6250
|
+
"progressbar",
|
|
6251
|
+
"radio",
|
|
6252
|
+
"radiogroup",
|
|
6253
|
+
"region",
|
|
6254
|
+
"row",
|
|
6255
|
+
"rowgroup",
|
|
6256
|
+
"rowheader",
|
|
6257
|
+
"scrollbar",
|
|
6258
|
+
"search",
|
|
6259
|
+
"searchbox",
|
|
6260
|
+
"separator",
|
|
6261
|
+
"slider",
|
|
6262
|
+
"spinbutton",
|
|
6263
|
+
"status",
|
|
6264
|
+
"switch",
|
|
6265
|
+
"tab",
|
|
6266
|
+
"table",
|
|
6267
|
+
"tablist",
|
|
6268
|
+
"tabpanel",
|
|
6269
|
+
"term",
|
|
6270
|
+
"textbox",
|
|
6271
|
+
"timer",
|
|
6272
|
+
"toolbar",
|
|
6273
|
+
"tooltip",
|
|
6274
|
+
"tree",
|
|
6275
|
+
"treegrid",
|
|
6276
|
+
"treeitem",
|
|
6277
|
+
]
|
|
6278
|
+
| Var[
|
|
6279
|
+
Literal[
|
|
6280
|
+
"alert",
|
|
6281
|
+
"alertdialog",
|
|
6282
|
+
"application",
|
|
6283
|
+
"article",
|
|
6284
|
+
"banner",
|
|
6285
|
+
"button",
|
|
6286
|
+
"cell",
|
|
6287
|
+
"checkbox",
|
|
6288
|
+
"columnheader",
|
|
6289
|
+
"combobox",
|
|
6290
|
+
"complementary",
|
|
6291
|
+
"contentinfo",
|
|
6292
|
+
"definition",
|
|
6293
|
+
"dialog",
|
|
6294
|
+
"directory",
|
|
6295
|
+
"document",
|
|
6296
|
+
"feed",
|
|
6297
|
+
"figure",
|
|
6298
|
+
"form",
|
|
6299
|
+
"grid",
|
|
6300
|
+
"gridcell",
|
|
6301
|
+
"group",
|
|
6302
|
+
"heading",
|
|
6303
|
+
"img",
|
|
6304
|
+
"link",
|
|
6305
|
+
"list",
|
|
6306
|
+
"listbox",
|
|
6307
|
+
"listitem",
|
|
6308
|
+
"log",
|
|
6309
|
+
"main",
|
|
6310
|
+
"marquee",
|
|
6311
|
+
"math",
|
|
6312
|
+
"menu",
|
|
6313
|
+
"menubar",
|
|
6314
|
+
"menuitem",
|
|
6315
|
+
"menuitemcheckbox",
|
|
6316
|
+
"menuitemradio",
|
|
6317
|
+
"navigation",
|
|
6318
|
+
"none",
|
|
6319
|
+
"note",
|
|
6320
|
+
"option",
|
|
6321
|
+
"presentation",
|
|
6322
|
+
"progressbar",
|
|
6323
|
+
"radio",
|
|
6324
|
+
"radiogroup",
|
|
6325
|
+
"region",
|
|
6326
|
+
"row",
|
|
6327
|
+
"rowgroup",
|
|
6328
|
+
"rowheader",
|
|
6329
|
+
"scrollbar",
|
|
6330
|
+
"search",
|
|
6331
|
+
"searchbox",
|
|
6332
|
+
"separator",
|
|
6333
|
+
"slider",
|
|
6334
|
+
"spinbutton",
|
|
6335
|
+
"status",
|
|
6336
|
+
"switch",
|
|
6337
|
+
"tab",
|
|
6338
|
+
"table",
|
|
6339
|
+
"tablist",
|
|
6340
|
+
"tabpanel",
|
|
6341
|
+
"term",
|
|
6342
|
+
"textbox",
|
|
6343
|
+
"timer",
|
|
6344
|
+
"toolbar",
|
|
6345
|
+
"tooltip",
|
|
6346
|
+
"tree",
|
|
6347
|
+
"treegrid",
|
|
6348
|
+
"treeitem",
|
|
6349
|
+
]
|
|
6350
|
+
]
|
|
6351
|
+
| None = None,
|
|
6352
|
+
slot: Var[str] | str | None = None,
|
|
6353
|
+
spell_check: Var[bool] | bool | None = None,
|
|
6354
|
+
tab_index: Var[int] | int | None = None,
|
|
6355
|
+
title: Var[str] | str | None = None,
|
|
6356
|
+
style: Sequence[Mapping[str, Any]]
|
|
6357
|
+
| Mapping[str, Any]
|
|
6358
|
+
| Var[Mapping[str, Any]]
|
|
6359
|
+
| Breakpoints
|
|
6360
|
+
| None = None,
|
|
6361
|
+
key: Any | None = None,
|
|
6362
|
+
id: Any | None = None,
|
|
6363
|
+
ref: Var | None = None,
|
|
6364
|
+
class_name: Any | None = None,
|
|
6365
|
+
custom_attrs: dict[str, Var | Any] | None = None,
|
|
6366
|
+
on_blur: EventType[()] | None = None,
|
|
6367
|
+
on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
6368
|
+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
6369
|
+
on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
6370
|
+
on_focus: EventType[()] | None = None,
|
|
6371
|
+
on_mount: EventType[()] | None = None,
|
|
6372
|
+
on_mouse_down: EventType[()] | None = None,
|
|
6373
|
+
on_mouse_enter: EventType[()] | None = None,
|
|
6374
|
+
on_mouse_leave: EventType[()] | None = None,
|
|
6375
|
+
on_mouse_move: EventType[()] | None = None,
|
|
6376
|
+
on_mouse_out: EventType[()] | None = None,
|
|
6377
|
+
on_mouse_over: EventType[()] | None = None,
|
|
6378
|
+
on_mouse_up: EventType[()] | None = None,
|
|
6379
|
+
on_scroll: EventType[()] | None = None,
|
|
6380
|
+
on_scroll_end: EventType[()] | None = None,
|
|
6381
|
+
on_unmount: EventType[()] | None = None,
|
|
6382
|
+
**props,
|
|
6383
|
+
) -> Marker:
|
|
6384
|
+
"""Create the component.
|
|
6385
|
+
|
|
6386
|
+
Args:
|
|
6387
|
+
*children: The children of the component.
|
|
6388
|
+
marker_height: The height of the marker viewport.
|
|
6389
|
+
marker_width: The width of the marker viewport.
|
|
6390
|
+
marker_units: The coordinate system for the marker attributes.
|
|
6391
|
+
orient: The orientation of the marker relative to the shape it is attached to.
|
|
6392
|
+
preserve_aspect_ratio: How the svg fragment must be deformed if it is embedded in a container with a different aspect ratio.
|
|
6393
|
+
ref_x: The x coordinate for the reference point of the marker.
|
|
6394
|
+
ref_y: The y coordinate for the reference point of the marker.
|
|
6395
|
+
view_box: The bound of the SVG viewport for the current SVG fragment.
|
|
6396
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
6397
|
+
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
6398
|
+
content_editable: Indicates whether the element's content is editable.
|
|
6399
|
+
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
6400
|
+
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
6401
|
+
draggable: Defines whether the element can be dragged.
|
|
6402
|
+
enter_key_hint: Hints what media types the media element is able to play.
|
|
6403
|
+
hidden: Defines whether the element is hidden.
|
|
6404
|
+
input_mode: Defines the type of the element.
|
|
6405
|
+
item_prop: Defines the name of the element for metadata purposes.
|
|
6406
|
+
lang: Defines the language used in the element.
|
|
6407
|
+
role: Defines the role of the element.
|
|
6408
|
+
slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
6409
|
+
spell_check: Defines whether the element may be checked for spelling errors.
|
|
6410
|
+
tab_index: Defines the position of the current element in the tabbing order.
|
|
6411
|
+
title: Defines a tooltip for the element.
|
|
6412
|
+
style: The style of the component.
|
|
6413
|
+
key: A unique key for the component.
|
|
6414
|
+
id: The id for the component.
|
|
6415
|
+
ref: The Var to pass as the ref to the component.
|
|
6416
|
+
class_name: The class name for the component.
|
|
6417
|
+
custom_attrs: custom attribute
|
|
6418
|
+
**props: The props of the component.
|
|
6419
|
+
|
|
6420
|
+
Returns:
|
|
6421
|
+
The component.
|
|
6422
|
+
"""
|
|
6423
|
+
|
|
6165
6424
|
class G(BaseHTML):
|
|
6166
6425
|
@classmethod
|
|
6167
6426
|
def create(
|
|
@@ -6429,6 +6688,7 @@ class SVG(ComponentNamespace):
|
|
|
6429
6688
|
linear_gradient = staticmethod(LinearGradient.create)
|
|
6430
6689
|
radial_gradient = staticmethod(RadialGradient.create)
|
|
6431
6690
|
defs = staticmethod(Defs.create)
|
|
6691
|
+
marker = staticmethod(Marker.create)
|
|
6432
6692
|
g = staticmethod(G.create)
|
|
6433
6693
|
|
|
6434
6694
|
@staticmethod
|
|
@@ -6689,6 +6949,7 @@ stop = Stop.create
|
|
|
6689
6949
|
linear_gradient = LinearGradient.create
|
|
6690
6950
|
radial_gradient = RadialGradient.create
|
|
6691
6951
|
defs = Defs.create
|
|
6952
|
+
marker = Marker.create
|
|
6692
6953
|
g = G.create
|
|
6693
6954
|
area = Area.create
|
|
6694
6955
|
audio = Audio.create
|