reflex 0.7.8__py3-none-any.whl → 0.7.8.post1__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.

@@ -572,5 +572,5 @@ class ColorModeNamespace(Var):
572
572
  color_mode = color_mode_var_and_namespace = ColorModeNamespace(
573
573
  _js_expr=color_mode._js_expr,
574
574
  _var_type=color_mode._var_type,
575
- _var_data=color_mode._get_default_value(),
575
+ _var_data=color_mode._get_all_var_data(),
576
576
  )
reflex/state.py CHANGED
@@ -1398,6 +1398,29 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1398
1398
  for substate in self.substates.values():
1399
1399
  substate.reset()
1400
1400
 
1401
+ @classmethod
1402
+ @functools.lru_cache
1403
+ def _is_client_storage(cls, prop_name_or_field: str | ModelField) -> bool:
1404
+ """Check if the var is a client storage var.
1405
+
1406
+ Args:
1407
+ prop_name_or_field: The name of the var or the field itself.
1408
+
1409
+ Returns:
1410
+ Whether the var is a client storage var.
1411
+ """
1412
+ if isinstance(prop_name_or_field, str):
1413
+ field = cls.get_fields().get(prop_name_or_field)
1414
+ else:
1415
+ field = prop_name_or_field
1416
+ return field is not None and (
1417
+ isinstance(field.default, ClientStorageBase)
1418
+ or (
1419
+ isinstance(field.type_, type)
1420
+ and issubclass(field.type_, ClientStorageBase)
1421
+ )
1422
+ )
1423
+
1401
1424
  def _reset_client_storage(self):
1402
1425
  """Reset client storage base vars to their default values."""
1403
1426
  # Client-side storage is reset during hydrate so that clearing cookies
@@ -1405,10 +1428,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1405
1428
  fields = self.get_fields()
1406
1429
  for prop_name in self.base_vars:
1407
1430
  field = fields[prop_name]
1408
- if isinstance(field.default, ClientStorageBase) or (
1409
- isinstance(field.type_, type)
1410
- and issubclass(field.type_, ClientStorageBase)
1411
- ):
1431
+ if self._is_client_storage(field):
1412
1432
  setattr(self, prop_name, copy.deepcopy(field.default))
1413
1433
 
1414
1434
  # Recursively reset the substate client storage.
@@ -2360,8 +2380,9 @@ class UpdateVarsInternalState(State):
2360
2380
  for var, value in vars.items():
2361
2381
  state_name, _, var_name = var.rpartition(".")
2362
2382
  var_state_cls = State.get_class_substate(state_name)
2363
- var_state = await self.get_state(var_state_cls)
2364
- setattr(var_state, var_name, value)
2383
+ if var_state_cls._is_client_storage(var_name):
2384
+ var_state = await self.get_state(var_state_cls)
2385
+ setattr(var_state, var_name, value)
2365
2386
 
2366
2387
 
2367
2388
  class OnLoadInternalState(State):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reflex
3
- Version: 0.7.8
3
+ Version: 0.7.8.post1
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
@@ -12,7 +12,7 @@ reflex/page.py,sha256=QUdf3dtlTj0Yoq7KPwFHexRgEddlhSTGfSqxcR8OXXQ,2407
12
12
  reflex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  reflex/reflex.py,sha256=Aw3FVLmA9vwKjYxrhlD9nUZ3Hs6pnizC4EcViY0cpVk,21717
14
14
  reflex/route.py,sha256=nn_hJwtQdjiqH_dHXfqMGWKllnyPQZTSR-KWdHDhoOs,4210
15
- reflex/state.py,sha256=JfwlsoFUzHnfJM8GLAFXw5K_UwK5wJOsetljx6hU6gk,142341
15
+ reflex/state.py,sha256=hZ-192Gp07osYpYFvFReSUNQFIVR7j6_FYwokVZ-DI0,143020
16
16
  reflex/style.py,sha256=8ciwcReoKSrPSwoteXJwv7YTK514tf7jrJ5RfqztmvA,13186
17
17
  reflex/testing.py,sha256=17Xw2bjsSlxnDUnBv3tM7dvO-qKrxq0augI37WzMv4A,36015
18
18
  reflex/.templates/apps/blank/assets/favicon.ico,sha256=baxxgDAQ2V4-G5Q4S2yK5uUJTUGkv-AOWBQ0xd6myUo,4286
@@ -199,7 +199,7 @@ reflex/components/radix/themes/__init__.pyi,sha256=RVeS7TipR51MgmsWJStZwh4QxKBtO
199
199
  reflex/components/radix/themes/base.py,sha256=lwphGEjWXk1Srk1pCJBEV-7anN4vMnWIAIzLgmbxSxU,8690
200
200
  reflex/components/radix/themes/base.pyi,sha256=eztGbh4Hs6hVk_Nuri9vstbGBOQwgbYW28OMcei4wM0,24006
201
201
  reflex/components/radix/themes/color_mode.py,sha256=ffuaHYR4hSxVP17dXbJD5TSwZyoQm6HDIidCFR8gEPU,6491
202
- reflex/components/radix/themes/color_mode.pyi,sha256=fie7i512tUYkW0rHWMuFxpQ3t0FFaqwNupYJ9Ctzq-E,20741
202
+ reflex/components/radix/themes/color_mode.pyi,sha256=BJlpNSm6-q2pvMB8Bl0wP2KXzorh3OYQAN8kvM8_xBE,20740
203
203
  reflex/components/radix/themes/components/__init__.py,sha256=fzc5ghmmbIQ8yaxKQQY83TINb6k2uVPX-wddyTDlQx8,423
204
204
  reflex/components/radix/themes/components/__init__.pyi,sha256=-yTF7ROfG_qxrRL-lmCIidPJtFY5StumKB7VfWsDqSw,1946
205
205
  reflex/components/radix/themes/components/alert_dialog.py,sha256=UDSU4eHsJ-O40Zc1myVnZn3KkJmL1ByOeyu71h6M7PA,3271
@@ -397,8 +397,8 @@ reflex/vars/function.py,sha256=0i-VkxHkDJmZtfQUwUfaF0rlS6WM8azjwQ8k7rEOkyk,13944
397
397
  reflex/vars/number.py,sha256=N-ZeV_ebriaFpuRf8IL7TT3D4h2ti-MUYMOISEw4N8k,27846
398
398
  reflex/vars/object.py,sha256=P_BBOxP4Z53IiHPVx5-P279lFEwdEIYLWcqO_h1UyLo,17134
399
399
  reflex/vars/sequence.py,sha256=N0BwsYbFC4KkeC-N0Bc2NcKyfrbIxGh5FIWDy7Jl7Fs,55192
400
- reflex-0.7.8.dist-info/METADATA,sha256=9KSrCRCpIOgBteqXeb5EQHPtVm3ecsb6nGO9GV1rYYA,11877
401
- reflex-0.7.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
402
- reflex-0.7.8.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
403
- reflex-0.7.8.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
404
- reflex-0.7.8.dist-info/RECORD,,
400
+ reflex-0.7.8.post1.dist-info/METADATA,sha256=evp31KCKOaekDMO3vJJv-ncXfCw3llT5-QLxpKbWL3o,11883
401
+ reflex-0.7.8.post1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
402
+ reflex-0.7.8.post1.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
403
+ reflex-0.7.8.post1.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
404
+ reflex-0.7.8.post1.dist-info/RECORD,,