reflex 0.8.0a2__py3-none-any.whl → 0.8.0a3__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.

@@ -2,7 +2,7 @@
2
2
  {% from "web/pages/macros.js.jinja2" import renderHooks %}
3
3
 
4
4
  {% block early_imports %}
5
- import '$/styles/__reflex_global_styles.css'
5
+ import reflexGlobalStyles from '$/styles/__reflex_global_styles.css?url';
6
6
  {% endblock %}
7
7
 
8
8
  {% block declaration %}
@@ -20,6 +20,10 @@ import * as {{library_alias}} from "{{library_path}}";
20
20
  {% endblock %}
21
21
 
22
22
  {% block export %}
23
+ export const links = () => [
24
+ { rel: 'stylesheet', href: reflexGlobalStyles, type: 'text/css' }
25
+ ];
26
+
23
27
  function AppWrap({children}) {
24
28
  {{ renderHooks(hooks) }}
25
29
 
@@ -3,11 +3,11 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- import dataclasses
7
6
  from collections.abc import Mapping, Sequence
8
7
  from enum import Enum
9
8
  from typing import Any, Literal, TypedDict, overload
10
9
 
10
+ from reflex.base import Base
11
11
  from reflex.components.component import NoSSRComponent
12
12
  from reflex.components.core.breakpoints import Breakpoints
13
13
  from reflex.event import EventType, PointerEventInfo
@@ -43,8 +43,7 @@ class GridColumnIcons(Enum):
43
43
  Uri = "uri"
44
44
  VideoUri = "video_uri"
45
45
 
46
- @dataclasses.dataclass
47
- class DataEditorThemeBase:
46
+ class DataEditorTheme(Base):
48
47
  accent_color: str | None
49
48
  accent_fg: str | None
50
49
  accent_light: str | None
@@ -78,9 +77,6 @@ class DataEditorThemeBase:
78
77
  text_light: str | None
79
78
  text_medium: str | None
80
79
 
81
- @dataclasses.dataclass(init=False)
82
- class DataEditorTheme(DataEditorThemeBase): ...
83
-
84
80
  class Bounds(TypedDict):
85
81
  x: int
86
82
  y: int
@@ -3,10 +3,10 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- import dataclasses
7
6
  from collections.abc import Mapping, Sequence
8
7
  from typing import Any, Literal, overload
9
8
 
9
+ from reflex.base import Base
10
10
  from reflex.components.component import Component, ComponentNamespace
11
11
  from reflex.components.core.breakpoints import Breakpoints
12
12
  from reflex.components.lucide.icon import Icon
@@ -32,8 +32,7 @@ toast_ref = Var(
32
32
  _var_data=VarData(imports={f"$/{Dirs.STATE_PATH}": [ImportVar(tag="refs")]}),
33
33
  )
34
34
 
35
- @dataclasses.dataclass
36
- class ToastAction:
35
+ class ToastAction(Base):
37
36
  label: str
38
37
  on_click: Any
39
38
 
@@ -130,6 +130,7 @@ class PackageJson(SimpleNamespace):
130
130
  "@react-router/node": cls._react_router_version,
131
131
  "serve": "14.2.4",
132
132
  "react": cls._react_version,
133
+ "react-helmet": "6.1.0",
133
134
  "react-dom": cls._react_version,
134
135
  "isbot": "5.1.26",
135
136
  "socket.io-client": "4.8.1",
reflex/testing.py CHANGED
@@ -22,7 +22,7 @@ import types
22
22
  from collections.abc import AsyncIterator, Callable, Coroutine, Sequence
23
23
  from http.server import SimpleHTTPRequestHandler
24
24
  from pathlib import Path
25
- from typing import TYPE_CHECKING, Any, TypeVar
25
+ from typing import TYPE_CHECKING, Any, Literal, TypeVar
26
26
 
27
27
  import psutil
28
28
  import uvicorn
@@ -526,7 +526,7 @@ class AppHarness:
526
526
  target: Callable[[], T],
527
527
  timeout: TimeoutType = None,
528
528
  step: TimeoutType = None,
529
- ) -> T | bool:
529
+ ) -> T | Literal[False]:
530
530
  """Generic polling logic.
531
531
 
532
532
  Args:
@@ -544,9 +544,10 @@ class AppHarness:
544
544
  step = POLL_INTERVAL
545
545
  deadline = time.time() + timeout
546
546
  while time.time() < deadline:
547
- success = target()
548
- if success:
549
- return success
547
+ with contextlib.suppress(Exception):
548
+ success = target()
549
+ if success:
550
+ return success
550
551
  time.sleep(step)
551
552
  return False
552
553
 
@@ -850,35 +851,55 @@ class AppHarness:
850
851
  return state_manager.states
851
852
 
852
853
  @staticmethod
853
- def poll_for_result(
854
- f: Callable[[], T],
855
- exception: type[Exception] = Exception,
856
- max_attempts: int = 5,
857
- seconds_between_attempts: int = 1,
854
+ def poll_for_or_raise_timeout(
855
+ target: Callable[[], T],
856
+ timeout: TimeoutType = None,
857
+ step: TimeoutType = None,
858
858
  ) -> T:
859
- """Poll for a result from a function.
859
+ """Poll target callable for a truthy return value.
860
+
861
+ Like `_poll_for`, but raises a `TimeoutError` if the target does not
862
+ return a truthy value within the timeout.
860
863
 
861
864
  Args:
862
- f: function to call
863
- exception: exception to catch
864
- max_attempts: maximum number of attempts
865
- seconds_between_attempts: seconds to wait between
865
+ target: callable that returns truthy if polling condition is met.
866
+ timeout: max polling time
867
+ step: interval between checking target()
866
868
 
867
869
  Returns:
868
- Result of the function
870
+ return value of target() if truthy within timeout
869
871
 
870
872
  Raises:
871
- AssertionError: if the function does not return a value
873
+ TimeoutError: when target does not return a truthy value within timeout
872
874
  """
873
- attempts = 0
874
- while attempts < max_attempts:
875
- try:
876
- return f()
877
- except exception: # noqa: PERF203
878
- attempts += 1
879
- time.sleep(seconds_between_attempts)
880
- msg = "Function did not return a value"
881
- raise AssertionError(msg)
875
+ result = AppHarness._poll_for(
876
+ target=target,
877
+ timeout=timeout,
878
+ step=step,
879
+ )
880
+ if result is False:
881
+ msg = "Target did not return a truthy value while polling."
882
+ raise TimeoutError(msg)
883
+ return result
884
+
885
+ @staticmethod
886
+ def expect(
887
+ target: Callable[[], T],
888
+ timeout: TimeoutType = None,
889
+ step: TimeoutType = None,
890
+ ):
891
+ """Expect a target callable to return a truthy value within the timeout.
892
+
893
+ Args:
894
+ target: callable that returns truthy if polling condition is met.
895
+ timeout: max polling time
896
+ step: interval between checking target()
897
+ """
898
+ AppHarness.poll_for_or_raise_timeout(
899
+ target=target,
900
+ timeout=timeout,
901
+ step=step,
902
+ )
882
903
 
883
904
 
884
905
  class SimpleHTTPRequestHandlerCustomErrors(SimpleHTTPRequestHandler):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reflex
3
- Version: 0.8.0a2
3
+ Version: 0.8.0a3
4
4
  Summary: Web apps in pure Python.
5
5
  Project-URL: homepage, https://reflex.dev
6
6
  Project-URL: repository, https://github.com/reflex-dev/reflex
@@ -15,7 +15,7 @@ reflex/reflex.py,sha256=eUP0GevShUc1nodfA5_ewB3hgefWU0_x166HGCY8QTs,21606
15
15
  reflex/route.py,sha256=7JXP7-dpqdbUS3iSEqQ5UjOHV3pNxD0wKn6BBCRQggQ,4078
16
16
  reflex/state.py,sha256=yM9bvTISBXpZqhP7gNcIBjBtAC9LCyyDSco9rlXDaNc,90976
17
17
  reflex/style.py,sha256=JxbXXA4MTnXrk0XHEoMBoNC7J-M2oL5Hl3W_QmXvmBg,13222
18
- reflex/testing.py,sha256=Qx7StvOsFn47ToE8vy97zb4e-kANiTDTjjHEbdhtgyg,38678
18
+ reflex/testing.py,sha256=KZ1MEagf3nR_KRug343aH8n5QSRmLQ2p-Pv-huApoZw,39414
19
19
  reflex/.templates/apps/blank/assets/favicon.ico,sha256=baxxgDAQ2V4-G5Q4S2yK5uUJTUGkv-AOWBQ0xd6myUo,4286
20
20
  reflex/.templates/apps/blank/code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  reflex/.templates/apps/blank/code/blank.py,sha256=UmGz7aDxGULYINwLgotQoj-9qqpy7EOfAEpLmOT7C_k,917
@@ -26,7 +26,7 @@ reflex/.templates/jinja/custom_components/demo_app.py.jinja2,sha256=ipbKtObNqQLc
26
26
  reflex/.templates/jinja/custom_components/pyproject.toml.jinja2,sha256=HG-k3pruUlMy7xYz339hgFkNMTLqB-C_FTLKkOgfBPM,630
27
27
  reflex/.templates/jinja/custom_components/src.py.jinja2,sha256=e80PwMI6NoeQtGJ0NXWhYrkqUe7jvvJTFuztYQe-R5w,2403
28
28
  reflex/.templates/jinja/web/package.json.jinja2,sha256=cS9M6ADYDoYL2Kc8m5dYhV8eDaehOXb6qK_IOijT3N0,673
29
- reflex/.templates/jinja/web/pages/_app.js.jinja2,sha256=SxG94qVWuP8VZrRvGiPIirhvP9HqNopzQg2AdDSaOfg,1451
29
+ reflex/.templates/jinja/web/pages/_app.js.jinja2,sha256=10Wdl_7klhhisXfSY604iK0z10HsW_2E4aY2_MJvPeE,1581
30
30
  reflex/.templates/jinja/web/pages/_document.js.jinja2,sha256=v_r79GPGKnw1g9Bg4lK9o_ow5AzBnvKdz0nv3OgJyzU,166
31
31
  reflex/.templates/jinja/web/pages/base_page.js.jinja2,sha256=nteivFZgOhgwxlPvejgaoxKTPGvDRb7_JAXhsZDZeLM,361
32
32
  reflex/.templates/jinja/web/pages/component.js.jinja2,sha256=1Pui62uSL7LYA7FXZrh9ZmhKH8vHYu663eR134hhsAY,86
@@ -124,7 +124,7 @@ reflex/components/datadisplay/__init__.pyi,sha256=rYMwO_X4NvUex6IL2MMTnhdFRp8Lz5
124
124
  reflex/components/datadisplay/code.py,sha256=jmt5pCFnHbbx8JzU5LvevwDL6omlIsdf_AbPsW7s5TI,12418
125
125
  reflex/components/datadisplay/code.pyi,sha256=fp-__tDq6lfjDetBsKq5KVZv2SXzFuK8Z3E41_FGwsA,41575
126
126
  reflex/components/datadisplay/dataeditor.py,sha256=SxvIDyKl9TILOlx6Zga9jCcu0LBc4E1WhrUFJGO6lKs,13496
127
- reflex/components/datadisplay/dataeditor.pyi,sha256=-Z1CmQSf7bsuaMC0okNqsALx8bF76UHkxlwMyVZcWSQ,12470
127
+ reflex/components/datadisplay/dataeditor.pyi,sha256=URCSl_0xAj0AF2yObFenNc76kO14YO9Xikq5Ec347lA,12375
128
128
  reflex/components/datadisplay/logo.py,sha256=xvg5TRVRSi2IKn7Kg4oYzWcaFMHfXxUaCp0cQmuKSn0,1993
129
129
  reflex/components/datadisplay/shiki_code_block.py,sha256=KmohJnAYo6gPERhBT_6o90bzgi6TLQ-AajRVeEcavbQ,24392
130
130
  reflex/components/datadisplay/shiki_code_block.pyi,sha256=iU3sH_KEGBg5R3qwvh0fXG2gP2bw8uX_83--KE2gxQg,57393
@@ -323,7 +323,7 @@ reflex/components/recharts/recharts.py,sha256=jrKDiTpIYVDli2s58xmD-ZvCvQupoRilsm
323
323
  reflex/components/recharts/recharts.pyi,sha256=2RoCZ3gbIcSXOVflgHcL8slbgZvL4KeICquG4edpd3A,7414
324
324
  reflex/components/sonner/__init__.py,sha256=L_mdRIy7-ccRGSz5VK6J8O-c-e-D1p9xWw29_ErrvGg,68
325
325
  reflex/components/sonner/toast.py,sha256=3wEwvI_2OyTdDcWJwwpyVeNox902iDQGv6Itgqv1Okw,12392
326
- reflex/components/sonner/toast.pyi,sha256=At5H-1ONwJ76E5R1TeyqM2j4FerXAeJOmM4cYYrCSRM,7835
326
+ reflex/components/sonner/toast.pyi,sha256=eL0uaBTRer4cqDYs2a6k1cmyxVVzOSYjdl8z6b8aCwM,7828
327
327
  reflex/components/tags/__init__.py,sha256=Pc0JU-Tv_W7KCsydXgbKmu7w2VtHNkI6Cx2hTkNhW_Q,152
328
328
  reflex/components/tags/cond_tag.py,sha256=YHxqq34PD-1D88YivO7kn7FsbW8SfPS2McNg7j_nncI,588
329
329
  reflex/components/tags/iter_tag.py,sha256=R7bOI3Xx3mHcSmr6tz8qUlBoDwXsAh2Q6Esd3nsBros,4410
@@ -337,7 +337,7 @@ reflex/constants/compiler.py,sha256=JjUL7myEoRi6-VRo5vxiND2WFaDTBbplfy6iLswazqk,
337
337
  reflex/constants/config.py,sha256=8OIjiBdZZJrRVHsNBheMwopE9AwBFFzau0SXqXKcrPg,1715
338
338
  reflex/constants/custom_components.py,sha256=joJt4CEt1yKy7wsBH6vYo7_QRW0O_fWXrrTf0VY2q14,1317
339
339
  reflex/constants/event.py,sha256=tgoynWQi2L0_Kqc3XhXo7XXL76A-OKhJGHRrNjm7gFw,2885
340
- reflex/constants/installer.py,sha256=f4JgHgC0BiMEf72kykKjONBo62oURJvzt5hVYsvPw9A,4098
340
+ reflex/constants/installer.py,sha256=JjZcvXYxiABnnZnBBMMePr8C4279cECzfTRKxe7rHXs,4135
341
341
  reflex/constants/route.py,sha256=ZClrIF6Wog7tV3R2gLBrfLyO8Wc_jGZy2b1toy1f1Lk,2619
342
342
  reflex/constants/state.py,sha256=uF_7-M9Gid-P3DjAOq4F1ERplyZhiNccowo_jLrdJrg,323
343
343
  reflex/constants/utils.py,sha256=e1ChEvbHfmE_V2UJvCSUhD_qTVAIhEGPpRJSqdSd6PA,780
@@ -394,8 +394,8 @@ reflex/vars/number.py,sha256=tO7pnvFaBsedq1HWT4skytnSqHWMluGEhUbjAUMx8XQ,28190
394
394
  reflex/vars/object.py,sha256=BDmeiwG8v97s_BnR1Egq3NxOKVjv9TfnREB3cz0zZtk,17322
395
395
  reflex/vars/sequence.py,sha256=1kBrqihspyjyQ1XDqFPC8OpVGtZs_EVkOdIKBro5ilA,55249
396
396
  scripts/hatch_build.py,sha256=-4pxcLSFmirmujGpQX9UUxjhIC03tQ_fIQwVbHu9kc0,1861
397
- reflex-0.8.0a2.dist-info/METADATA,sha256=FpZZUmZMmqtA836969_GROu1CweV7js-7MVlmnEge8I,12344
398
- reflex-0.8.0a2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
399
- reflex-0.8.0a2.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
400
- reflex-0.8.0a2.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
401
- reflex-0.8.0a2.dist-info/RECORD,,
397
+ reflex-0.8.0a3.dist-info/METADATA,sha256=NHTFLWFi7bzD4Aj8bFxHDlIxqtyQjYw7E2Ilm0c-VFI,12344
398
+ reflex-0.8.0a3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
399
+ reflex-0.8.0a3.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
400
+ reflex-0.8.0a3.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
401
+ reflex-0.8.0a3.dist-info/RECORD,,