reflex 0.4.2a1__py3-none-any.whl → 0.4.3a2__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/apps/blank/code/blank.py +1 -1
- reflex/.templates/apps/sidebar/README.md +3 -2
- reflex/.templates/apps/sidebar/assets/reflex_white.svg +8 -0
- reflex/.templates/apps/sidebar/code/components/sidebar.py +26 -22
- reflex/.templates/apps/sidebar/code/pages/dashboard.py +6 -5
- reflex/.templates/apps/sidebar/code/pages/settings.py +45 -6
- reflex/.templates/apps/sidebar/code/styles.py +15 -17
- reflex/.templates/apps/sidebar/code/templates/__init__.py +1 -1
- reflex/.templates/apps/sidebar/code/templates/template.py +54 -40
- reflex/.templates/jinja/custom_components/README.md.jinja2 +9 -0
- reflex/.templates/jinja/custom_components/__init__.py.jinja2 +1 -0
- reflex/.templates/jinja/custom_components/demo_app.py.jinja2 +36 -0
- reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +35 -0
- reflex/.templates/jinja/custom_components/src.py.jinja2 +57 -0
- reflex/.templates/jinja/web/utils/context.js.jinja2 +26 -6
- reflex/.templates/web/utils/state.js +206 -146
- reflex/app.py +21 -18
- reflex/compiler/compiler.py +6 -2
- reflex/compiler/templates.py +17 -0
- reflex/compiler/utils.py +2 -2
- reflex/components/core/__init__.py +2 -1
- reflex/components/core/banner.py +99 -11
- reflex/components/core/banner.pyi +215 -2
- reflex/components/el/elements/__init__.py +1 -0
- reflex/components/el/elements/forms.py +6 -0
- reflex/components/el/elements/forms.pyi +4 -0
- reflex/components/markdown/markdown.py +13 -25
- reflex/components/markdown/markdown.pyi +5 -5
- reflex/components/plotly/plotly.py +3 -0
- reflex/components/plotly/plotly.pyi +2 -0
- reflex/components/radix/primitives/drawer.py +3 -7
- reflex/components/radix/themes/components/select.py +4 -4
- reflex/components/radix/themes/components/text_field.pyi +4 -0
- reflex/constants/__init__.py +4 -0
- reflex/constants/colors.py +1 -0
- reflex/constants/compiler.py +4 -3
- reflex/constants/custom_components.py +30 -0
- reflex/custom_components/__init__.py +1 -0
- reflex/custom_components/custom_components.py +565 -0
- reflex/reflex.py +11 -2
- reflex/route.py +4 -0
- reflex/state.py +594 -124
- reflex/testing.py +6 -0
- reflex/utils/exec.py +9 -0
- reflex/utils/prerequisites.py +28 -2
- reflex/utils/telemetry.py +3 -1
- reflex/utils/types.py +23 -0
- reflex/vars.py +48 -17
- reflex/vars.pyi +8 -3
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/METADATA +4 -2
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/RECORD +55 -51
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/WHEEL +1 -1
- reflex/components/base/bare.pyi +0 -84
- reflex/constants/base.pyi +0 -94
- reflex/constants/event.pyi +0 -59
- reflex/constants/route.pyi +0 -50
- reflex/constants/style.pyi +0 -20
- /reflex/.templates/apps/sidebar/assets/{icon.svg → reflex_black.svg} +0 -0
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/LICENSE +0 -0
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/entry_points.txt +0 -0
reflex/components/base/bare.pyi
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/components/base/bare.py"""
|
|
2
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
-
# ------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
-
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
-
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
-
from reflex.style import Style
|
|
10
|
-
from typing import Any, Iterator
|
|
11
|
-
from reflex.components.component import Component
|
|
12
|
-
from reflex.components.tags import Tag
|
|
13
|
-
from reflex.components.tags.tagless import Tagless
|
|
14
|
-
from reflex.vars import Var
|
|
15
|
-
|
|
16
|
-
class Bare(Component):
|
|
17
|
-
@overload
|
|
18
|
-
@classmethod
|
|
19
|
-
def create( # type: ignore
|
|
20
|
-
cls,
|
|
21
|
-
*children,
|
|
22
|
-
contents: Optional[Union[Var[str], str]] = None,
|
|
23
|
-
style: Optional[Style] = None,
|
|
24
|
-
key: Optional[Any] = None,
|
|
25
|
-
id: Optional[Any] = None,
|
|
26
|
-
class_name: Optional[Any] = None,
|
|
27
|
-
autofocus: Optional[bool] = None,
|
|
28
|
-
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
29
|
-
on_blur: Optional[
|
|
30
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
31
|
-
] = None,
|
|
32
|
-
on_click: Optional[
|
|
33
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
34
|
-
] = None,
|
|
35
|
-
on_context_menu: Optional[
|
|
36
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
37
|
-
] = None,
|
|
38
|
-
on_double_click: Optional[
|
|
39
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
40
|
-
] = None,
|
|
41
|
-
on_focus: Optional[
|
|
42
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
43
|
-
] = None,
|
|
44
|
-
on_mount: Optional[
|
|
45
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
46
|
-
] = None,
|
|
47
|
-
on_mouse_down: Optional[
|
|
48
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
49
|
-
] = None,
|
|
50
|
-
on_mouse_enter: Optional[
|
|
51
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
52
|
-
] = None,
|
|
53
|
-
on_mouse_leave: Optional[
|
|
54
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
55
|
-
] = None,
|
|
56
|
-
on_mouse_move: Optional[
|
|
57
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
58
|
-
] = None,
|
|
59
|
-
on_mouse_out: Optional[
|
|
60
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
61
|
-
] = None,
|
|
62
|
-
on_mouse_over: Optional[
|
|
63
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
64
|
-
] = None,
|
|
65
|
-
on_mouse_up: Optional[
|
|
66
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
67
|
-
] = None,
|
|
68
|
-
on_scroll: Optional[
|
|
69
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
70
|
-
] = None,
|
|
71
|
-
on_unmount: Optional[
|
|
72
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
73
|
-
] = None,
|
|
74
|
-
**props
|
|
75
|
-
) -> "Bare":
|
|
76
|
-
"""Create a Bare component, with no tag.
|
|
77
|
-
|
|
78
|
-
Args:
|
|
79
|
-
contents: The contents of the component.
|
|
80
|
-
|
|
81
|
-
Returns:
|
|
82
|
-
The component.
|
|
83
|
-
"""
|
|
84
|
-
...
|
reflex/constants/base.pyi
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/constants/base.py"""
|
|
2
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
-
# ------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
-
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
-
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
-
from reflex.style import Style
|
|
10
|
-
import os
|
|
11
|
-
import platform
|
|
12
|
-
from enum import Enum
|
|
13
|
-
from importlib import metadata
|
|
14
|
-
from types import SimpleNamespace
|
|
15
|
-
from platformdirs import PlatformDirs
|
|
16
|
-
|
|
17
|
-
IS_WINDOWS = platform.system() == "Windows"
|
|
18
|
-
|
|
19
|
-
class Dirs(SimpleNamespace):
|
|
20
|
-
WEB = ".web"
|
|
21
|
-
APP_ASSETS = "assets"
|
|
22
|
-
UTILS = "utils"
|
|
23
|
-
STATIC = "_static"
|
|
24
|
-
STATE_PATH = "/".join([UTILS, "state"])
|
|
25
|
-
COMPONENTS_PATH = "/".join([UTILS, "components"])
|
|
26
|
-
CONTEXTS_PATH = "/".join([UTILS, "context"])
|
|
27
|
-
WEB_PAGES = os.path.join(WEB, "pages")
|
|
28
|
-
WEB_STATIC = os.path.join(WEB, STATIC)
|
|
29
|
-
WEB_UTILS = os.path.join(WEB, UTILS)
|
|
30
|
-
WEB_ASSETS = os.path.join(WEB, "public")
|
|
31
|
-
ENV_JSON = os.path.join(WEB, "env.json")
|
|
32
|
-
REFLEX_JSON = os.path.join(WEB, "reflex.json")
|
|
33
|
-
POSTCSS_JS = os.path.join(WEB, "postcss.config.js")
|
|
34
|
-
|
|
35
|
-
class Reflex(SimpleNamespace):
|
|
36
|
-
MODULE_NAME = "reflex"
|
|
37
|
-
VERSION = metadata.version(MODULE_NAME)
|
|
38
|
-
JSON = os.path.join(Dirs.WEB, "reflex.json")
|
|
39
|
-
_dir = os.environ.get("REFLEX_DIR", "")
|
|
40
|
-
DIR = _dir or PlatformDirs(MODULE_NAME, False).user_data_dir
|
|
41
|
-
ROOT_DIR = os.path.dirname(
|
|
42
|
-
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
class ReflexHostingCLI(SimpleNamespace):
|
|
46
|
-
MODULE_NAME = "reflex-hosting-cli"
|
|
47
|
-
|
|
48
|
-
class Templates(SimpleNamespace):
|
|
49
|
-
template_dir = os.path.join(Reflex.ROOT_DIR, Reflex.MODULE_NAME, ".templates/apps")
|
|
50
|
-
template_dirs = next(os.walk(template_dir))[1]
|
|
51
|
-
Kind = Enum("Kind", {template.upper(): template for template in template_dirs})
|
|
52
|
-
|
|
53
|
-
class Dirs(SimpleNamespace):
|
|
54
|
-
BASE = os.path.join(Reflex.ROOT_DIR, Reflex.MODULE_NAME, ".templates")
|
|
55
|
-
WEB_TEMPLATE = os.path.join(BASE, "web")
|
|
56
|
-
JINJA_TEMPLATE = os.path.join(BASE, "jinja")
|
|
57
|
-
CODE = "code"
|
|
58
|
-
|
|
59
|
-
class Next(SimpleNamespace):
|
|
60
|
-
CONFIG_FILE = "next.config.js"
|
|
61
|
-
SITEMAP_CONFIG_FILE = os.path.join(Dirs.WEB, "next-sitemap.config.js")
|
|
62
|
-
NODE_MODULES = "node_modules"
|
|
63
|
-
PACKAGE_LOCK = "package-lock.json"
|
|
64
|
-
FRONTEND_LISTENING_REGEX = "Local:[\\s]+(.*)"
|
|
65
|
-
|
|
66
|
-
class ColorMode(SimpleNamespace):
|
|
67
|
-
NAME = "colorMode"
|
|
68
|
-
USE = "useColorMode"
|
|
69
|
-
TOGGLE = "toggleColorMode"
|
|
70
|
-
|
|
71
|
-
class Env(str, Enum):
|
|
72
|
-
DEV = "dev"
|
|
73
|
-
PROD = "prod"
|
|
74
|
-
|
|
75
|
-
class LogLevel(str, Enum):
|
|
76
|
-
DEBUG = "debug"
|
|
77
|
-
INFO = "info"
|
|
78
|
-
WARNING = "warning"
|
|
79
|
-
ERROR = "error"
|
|
80
|
-
CRITICAL = "critical"
|
|
81
|
-
|
|
82
|
-
POLLING_MAX_HTTP_BUFFER_SIZE = 1000 * 1000
|
|
83
|
-
|
|
84
|
-
class Ping(SimpleNamespace):
|
|
85
|
-
INTERVAL = 25
|
|
86
|
-
TIMEOUT = 120
|
|
87
|
-
|
|
88
|
-
COOKIES = "cookies"
|
|
89
|
-
LOCAL_STORAGE = "local_storage"
|
|
90
|
-
SKIP_COMPILE_ENV_VAR = "__REFLEX_SKIP_COMPILE"
|
|
91
|
-
PYTEST_CURRENT_TEST = "PYTEST_CURRENT_TEST"
|
|
92
|
-
RELOAD_CONFIG = "__REFLEX_RELOAD_CONFIG"
|
|
93
|
-
REFLEX_VAR_OPENING_TAG = "<reflex.Var>"
|
|
94
|
-
REFLEX_VAR_CLOSING_TAG = "</reflex.Var>"
|
reflex/constants/event.pyi
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/constants/event.py"""
|
|
2
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
-
# ------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
-
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
-
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
-
from reflex.style import Style
|
|
10
|
-
from enum import Enum
|
|
11
|
-
from types import SimpleNamespace
|
|
12
|
-
|
|
13
|
-
class Endpoint(Enum):
|
|
14
|
-
PING = "ping"
|
|
15
|
-
EVENT = "_event"
|
|
16
|
-
UPLOAD = "_upload"
|
|
17
|
-
|
|
18
|
-
def get_url(self) -> str: ...
|
|
19
|
-
|
|
20
|
-
class SocketEvent(SimpleNamespace):
|
|
21
|
-
PING = "ping"
|
|
22
|
-
EVENT = "event"
|
|
23
|
-
|
|
24
|
-
class EventTriggers(SimpleNamespace):
|
|
25
|
-
ON_FOCUS = "on_focus"
|
|
26
|
-
ON_BLUR = "on_blur"
|
|
27
|
-
ON_CANCEL = "on_cancel"
|
|
28
|
-
ON_CLICK = "on_click"
|
|
29
|
-
ON_CHANGE = "on_change"
|
|
30
|
-
ON_CHANGE_END = "on_change_end"
|
|
31
|
-
ON_CHANGE_START = "on_change_start"
|
|
32
|
-
ON_COMPLETE = "on_complete"
|
|
33
|
-
ON_CONTEXT_MENU = "on_context_menu"
|
|
34
|
-
ON_DOUBLE_CLICK = "on_double_click"
|
|
35
|
-
ON_DROP = "on_drop"
|
|
36
|
-
ON_EDIT = "on_edit"
|
|
37
|
-
ON_KEY_DOWN = "on_key_down"
|
|
38
|
-
ON_KEY_UP = "on_key_up"
|
|
39
|
-
ON_MOUSE_DOWN = "on_mouse_down"
|
|
40
|
-
ON_MOUSE_ENTER = "on_mouse_enter"
|
|
41
|
-
ON_MOUSE_LEAVE = "on_mouse_leave"
|
|
42
|
-
ON_MOUSE_MOVE = "on_mouse_move"
|
|
43
|
-
ON_MOUSE_OUT = "on_mouse_out"
|
|
44
|
-
ON_MOUSE_OVER = "on_mouse_over"
|
|
45
|
-
ON_MOUSE_UP = "on_mouse_up"
|
|
46
|
-
ON_OPEN_CHANGE = "on_open_change"
|
|
47
|
-
ON_OPEN_AUTO_FOCUS = "on_open_auto_focus"
|
|
48
|
-
ON_CLOSE_AUTO_FOCUS = "on_close_auto_focus"
|
|
49
|
-
ON_FOCUS_OUTSIDE = "on_focus_outside"
|
|
50
|
-
ON_ESCAPE_KEY_DOWN = "on_escape_key_down"
|
|
51
|
-
ON_POINTER_DOWN_OUTSIDE = "on_pointer_down_outside"
|
|
52
|
-
ON_INTERACT_OUTSIDE = "on_interact_outside"
|
|
53
|
-
ON_SCROLL = "on_scroll"
|
|
54
|
-
ON_SUBMIT = "on_submit"
|
|
55
|
-
ON_MOUNT = "on_mount"
|
|
56
|
-
ON_UNMOUNT = "on_unmount"
|
|
57
|
-
ON_CLEAR_SERVER_ERRORS = "on_clear_server_errors"
|
|
58
|
-
ON_VALUE_COMMIT = "on_value_commit"
|
|
59
|
-
ON_SELECT = "on_select"
|
reflex/constants/route.pyi
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/constants/route.py"""
|
|
2
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
-
# ------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
-
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
-
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
-
from reflex.style import Style
|
|
10
|
-
import re
|
|
11
|
-
from types import SimpleNamespace
|
|
12
|
-
|
|
13
|
-
class RouteArgType(SimpleNamespace):
|
|
14
|
-
SINGLE = str("arg_single")
|
|
15
|
-
LIST = str("arg_list")
|
|
16
|
-
|
|
17
|
-
ROUTER = "router"
|
|
18
|
-
ROUTER_DATA = "router_data"
|
|
19
|
-
|
|
20
|
-
class RouteVar(SimpleNamespace):
|
|
21
|
-
CLIENT_IP = "ip"
|
|
22
|
-
CLIENT_TOKEN = "token"
|
|
23
|
-
HEADERS = "headers"
|
|
24
|
-
PATH = "pathname"
|
|
25
|
-
ORIGIN = "asPath"
|
|
26
|
-
SESSION_ID = "sid"
|
|
27
|
-
QUERY = "query"
|
|
28
|
-
COOKIE = "cookie"
|
|
29
|
-
|
|
30
|
-
ROUTER_DATA_INCLUDE = set((RouteVar.PATH, RouteVar.ORIGIN, RouteVar.QUERY))
|
|
31
|
-
|
|
32
|
-
class RouteRegex(SimpleNamespace):
|
|
33
|
-
ARG = re.compile("\\[(?!\\.)([^\\[\\]]+)\\]")
|
|
34
|
-
CATCHALL = re.compile("(\\[?\\[\\.{3}(?![0-9]).*\\]?\\])")
|
|
35
|
-
STRICT_CATCHALL = re.compile("\\[\\.{3}([a-zA-Z_][\\w]*)\\]")
|
|
36
|
-
OPT_CATCHALL = re.compile("\\[\\[\\.{3}([a-zA-Z_][\\w]*)\\]\\]")
|
|
37
|
-
|
|
38
|
-
class DefaultPage(SimpleNamespace):
|
|
39
|
-
TITLE = "Reflex App"
|
|
40
|
-
DESCRIPTION = "A Reflex app."
|
|
41
|
-
IMAGE = "favicon.ico"
|
|
42
|
-
META_LIST = []
|
|
43
|
-
|
|
44
|
-
class Page404(SimpleNamespace):
|
|
45
|
-
SLUG = "404"
|
|
46
|
-
TITLE = "404 - Not Found"
|
|
47
|
-
IMAGE = "favicon.ico"
|
|
48
|
-
DESCRIPTION = "The page was not found"
|
|
49
|
-
|
|
50
|
-
ROUTE_NOT_FOUND = "routeNotFound"
|
reflex/constants/style.pyi
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"""Stub file for reflex/constants/style.py"""
|
|
2
|
-
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
-
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
-
# ------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
-
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
-
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
-
from reflex.style import Style
|
|
10
|
-
import os
|
|
11
|
-
from types import SimpleNamespace
|
|
12
|
-
from reflex.constants.base import Dirs
|
|
13
|
-
|
|
14
|
-
STYLES_DIR = os.path.join(Dirs.WEB, "styles")
|
|
15
|
-
|
|
16
|
-
class Tailwind(SimpleNamespace):
|
|
17
|
-
VERSION = "tailwindcss@3.3.2"
|
|
18
|
-
CONFIG = os.path.join(Dirs.WEB, "tailwind.config.js")
|
|
19
|
-
CONTENT = ["./pages/**/*.{js,ts,jsx,tsx}", "./utils/**/*.{js,ts,jsx,tsx}"]
|
|
20
|
-
ROOT_STYLE_PATH = "./tailwind.css"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|