reflex 0.7.10a1__py3-none-any.whl → 0.7.11__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.

Files changed (53) hide show
  1. reflex/.templates/jinja/web/pages/_app.js.jinja2 +10 -10
  2. reflex/.templates/jinja/web/pages/_document.js.jinja2 +1 -1
  3. reflex/.templates/jinja/web/pages/index.js.jinja2 +1 -1
  4. reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +1 -1
  5. reflex/.templates/jinja/web/pages/utils.js.jinja2 +35 -72
  6. reflex/.templates/jinja/web/utils/context.js.jinja2 +6 -18
  7. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +7 -7
  8. reflex/.templates/web/components/shiki/code.js +5 -4
  9. reflex/compiler/compiler.py +20 -3
  10. reflex/components/base/bare.py +8 -5
  11. reflex/components/base/body.py +2 -4
  12. reflex/components/base/body.pyi +197 -3
  13. reflex/components/base/error_boundary.py +1 -1
  14. reflex/components/base/link.py +3 -3
  15. reflex/components/base/link.pyi +392 -4
  16. reflex/components/base/meta.py +5 -9
  17. reflex/components/base/meta.pyi +608 -28
  18. reflex/components/component.py +13 -27
  19. reflex/components/core/colors.py +35 -4
  20. reflex/components/core/cond.py +2 -2
  21. reflex/components/core/upload.py +2 -2
  22. reflex/components/datadisplay/shiki_code_block.py +2 -2
  23. reflex/components/dynamic.py +5 -2
  24. reflex/components/el/element.py +4 -0
  25. reflex/components/el/elements/forms.py +3 -1
  26. reflex/components/el/elements/inline.py +3 -1
  27. reflex/components/el/elements/metadata.py +1 -1
  28. reflex/components/el/elements/metadata.pyi +1 -0
  29. reflex/components/el/elements/typography.py +3 -1
  30. reflex/components/lucide/icon.py +47 -3
  31. reflex/components/lucide/icon.pyi +45 -0
  32. reflex/components/markdown/markdown.py +6 -7
  33. reflex/components/markdown/markdown.pyi +2 -2
  34. reflex/components/moment/moment.py +1 -1
  35. reflex/components/next/video.py +8 -1
  36. reflex/components/plotly/plotly.py +1 -1
  37. reflex/components/radix/primitives/drawer.py +1 -1
  38. reflex/components/radix/themes/layout/list.py +3 -2
  39. reflex/components/radix/themes/layout/list.pyi +391 -2
  40. reflex/components/suneditor/editor.py +1 -1
  41. reflex/config.py +3 -0
  42. reflex/constants/colors.py +23 -6
  43. reflex/constants/installer.py +2 -2
  44. reflex/state.py +30 -7
  45. reflex/utils/build.py +1 -2
  46. reflex/utils/format.py +16 -6
  47. reflex/utils/pyi_generator.py +1 -0
  48. reflex/utils/types.py +24 -8
  49. {reflex-0.7.10a1.dist-info → reflex-0.7.11.dist-info}/METADATA +1 -1
  50. {reflex-0.7.10a1.dist-info → reflex-0.7.11.dist-info}/RECORD +53 -53
  51. {reflex-0.7.10a1.dist-info → reflex-0.7.11.dist-info}/WHEEL +0 -0
  52. {reflex-0.7.10a1.dist-info → reflex-0.7.11.dist-info}/entry_points.txt +0 -0
  53. {reflex-0.7.10a1.dist-info → reflex-0.7.11.dist-info}/licenses/LICENSE +0 -0
@@ -6,8 +6,9 @@
6
6
  from collections.abc import Iterable, Mapping, Sequence
7
7
  from typing import Any, Literal, overload
8
8
 
9
- from reflex.components.component import Component, ComponentNamespace
9
+ from reflex.components.component import ComponentNamespace
10
10
  from reflex.components.core.breakpoints import Breakpoints
11
+ from reflex.components.el.elements.base import BaseHTML
11
12
  from reflex.components.el.elements.typography import Li, Ol, Ul
12
13
  from reflex.components.markdown.markdown import MarkdownComponentMap
13
14
  from reflex.event import EventType
@@ -31,7 +32,7 @@ LiteralListStyleTypeOrdered = Literal[
31
32
  "katakana",
32
33
  ]
33
34
 
34
- class BaseList(Component, MarkdownComponentMap):
35
+ class BaseList(BaseHTML, MarkdownComponentMap):
35
36
  @overload
36
37
  @classmethod
37
38
  def create( # type: ignore
@@ -75,6 +76,184 @@ class BaseList(Component, MarkdownComponentMap):
75
76
  ]
76
77
  | None = None,
77
78
  items: Iterable | Var[Iterable] | None = None,
79
+ access_key: Var[str] | str | None = None,
80
+ auto_capitalize: Literal[
81
+ "characters", "none", "off", "on", "sentences", "words"
82
+ ]
83
+ | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
84
+ | None = None,
85
+ content_editable: Literal["inherit", "plaintext-only", False, True]
86
+ | Var[Literal["inherit", "plaintext-only", False, True]]
87
+ | None = None,
88
+ context_menu: Var[str] | str | None = None,
89
+ dir: Var[str] | str | None = None,
90
+ draggable: Var[bool] | bool | None = None,
91
+ enter_key_hint: Literal[
92
+ "done", "enter", "go", "next", "previous", "search", "send"
93
+ ]
94
+ | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
95
+ | None = None,
96
+ hidden: Var[bool] | bool | None = None,
97
+ input_mode: Literal[
98
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
99
+ ]
100
+ | Var[
101
+ Literal[
102
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
103
+ ]
104
+ ]
105
+ | None = None,
106
+ item_prop: Var[str] | str | None = None,
107
+ lang: Var[str] | str | None = None,
108
+ role: Literal[
109
+ "alert",
110
+ "alertdialog",
111
+ "application",
112
+ "article",
113
+ "banner",
114
+ "button",
115
+ "cell",
116
+ "checkbox",
117
+ "columnheader",
118
+ "combobox",
119
+ "complementary",
120
+ "contentinfo",
121
+ "definition",
122
+ "dialog",
123
+ "directory",
124
+ "document",
125
+ "feed",
126
+ "figure",
127
+ "form",
128
+ "grid",
129
+ "gridcell",
130
+ "group",
131
+ "heading",
132
+ "img",
133
+ "link",
134
+ "list",
135
+ "listbox",
136
+ "listitem",
137
+ "log",
138
+ "main",
139
+ "marquee",
140
+ "math",
141
+ "menu",
142
+ "menubar",
143
+ "menuitem",
144
+ "menuitemcheckbox",
145
+ "menuitemradio",
146
+ "navigation",
147
+ "none",
148
+ "note",
149
+ "option",
150
+ "presentation",
151
+ "progressbar",
152
+ "radio",
153
+ "radiogroup",
154
+ "region",
155
+ "row",
156
+ "rowgroup",
157
+ "rowheader",
158
+ "scrollbar",
159
+ "search",
160
+ "searchbox",
161
+ "separator",
162
+ "slider",
163
+ "spinbutton",
164
+ "status",
165
+ "switch",
166
+ "tab",
167
+ "table",
168
+ "tablist",
169
+ "tabpanel",
170
+ "term",
171
+ "textbox",
172
+ "timer",
173
+ "toolbar",
174
+ "tooltip",
175
+ "tree",
176
+ "treegrid",
177
+ "treeitem",
178
+ ]
179
+ | Var[
180
+ Literal[
181
+ "alert",
182
+ "alertdialog",
183
+ "application",
184
+ "article",
185
+ "banner",
186
+ "button",
187
+ "cell",
188
+ "checkbox",
189
+ "columnheader",
190
+ "combobox",
191
+ "complementary",
192
+ "contentinfo",
193
+ "definition",
194
+ "dialog",
195
+ "directory",
196
+ "document",
197
+ "feed",
198
+ "figure",
199
+ "form",
200
+ "grid",
201
+ "gridcell",
202
+ "group",
203
+ "heading",
204
+ "img",
205
+ "link",
206
+ "list",
207
+ "listbox",
208
+ "listitem",
209
+ "log",
210
+ "main",
211
+ "marquee",
212
+ "math",
213
+ "menu",
214
+ "menubar",
215
+ "menuitem",
216
+ "menuitemcheckbox",
217
+ "menuitemradio",
218
+ "navigation",
219
+ "none",
220
+ "note",
221
+ "option",
222
+ "presentation",
223
+ "progressbar",
224
+ "radio",
225
+ "radiogroup",
226
+ "region",
227
+ "row",
228
+ "rowgroup",
229
+ "rowheader",
230
+ "scrollbar",
231
+ "search",
232
+ "searchbox",
233
+ "separator",
234
+ "slider",
235
+ "spinbutton",
236
+ "status",
237
+ "switch",
238
+ "tab",
239
+ "table",
240
+ "tablist",
241
+ "tabpanel",
242
+ "term",
243
+ "textbox",
244
+ "timer",
245
+ "toolbar",
246
+ "tooltip",
247
+ "tree",
248
+ "treegrid",
249
+ "treeitem",
250
+ ]
251
+ ]
252
+ | None = None,
253
+ slot: Var[str] | str | None = None,
254
+ spell_check: Var[bool] | bool | None = None,
255
+ tab_index: Var[int] | int | None = None,
256
+ title: Var[str] | str | None = None,
78
257
  style: Sequence[Mapping[str, Any]]
79
258
  | Mapping[str, Any]
80
259
  | Var[Mapping[str, Any]]
@@ -108,6 +287,22 @@ class BaseList(Component, MarkdownComponentMap):
108
287
  *children: The children of the component.
109
288
  list_style_type: The style of the list. Default to "none".
110
289
  items: A list of items to add to the list.
290
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
291
+ auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
292
+ content_editable: Indicates whether the element's content is editable.
293
+ context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
294
+ dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
295
+ draggable: Defines whether the element can be dragged.
296
+ enter_key_hint: Hints what media types the media element is able to play.
297
+ hidden: Defines whether the element is hidden.
298
+ input_mode: Defines the type of the element.
299
+ item_prop: Defines the name of the element for metadata purposes.
300
+ lang: Defines the language used in the element.
301
+ role: Defines the role of the element.
302
+ slot: Assigns a slot in a shadow DOM shadow tree to an element.
303
+ spell_check: Defines whether the element may be checked for spelling errors.
304
+ tab_index: Defines the position of the current element in the tabbing order.
305
+ title: Defines a tooltip for the element.
111
306
  style: The style of the component.
112
307
  key: A unique key for the component.
113
308
  id: The id for the component.
@@ -989,6 +1184,184 @@ class List(ComponentNamespace):
989
1184
  ]
990
1185
  | None = None,
991
1186
  items: Iterable | Var[Iterable] | None = None,
1187
+ access_key: Var[str] | str | None = None,
1188
+ auto_capitalize: Literal[
1189
+ "characters", "none", "off", "on", "sentences", "words"
1190
+ ]
1191
+ | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
1192
+ | None = None,
1193
+ content_editable: Literal["inherit", "plaintext-only", False, True]
1194
+ | Var[Literal["inherit", "plaintext-only", False, True]]
1195
+ | None = None,
1196
+ context_menu: Var[str] | str | None = None,
1197
+ dir: Var[str] | str | None = None,
1198
+ draggable: Var[bool] | bool | None = None,
1199
+ enter_key_hint: Literal[
1200
+ "done", "enter", "go", "next", "previous", "search", "send"
1201
+ ]
1202
+ | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
1203
+ | None = None,
1204
+ hidden: Var[bool] | bool | None = None,
1205
+ input_mode: Literal[
1206
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
1207
+ ]
1208
+ | Var[
1209
+ Literal[
1210
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
1211
+ ]
1212
+ ]
1213
+ | None = None,
1214
+ item_prop: Var[str] | str | None = None,
1215
+ lang: Var[str] | str | None = None,
1216
+ role: Literal[
1217
+ "alert",
1218
+ "alertdialog",
1219
+ "application",
1220
+ "article",
1221
+ "banner",
1222
+ "button",
1223
+ "cell",
1224
+ "checkbox",
1225
+ "columnheader",
1226
+ "combobox",
1227
+ "complementary",
1228
+ "contentinfo",
1229
+ "definition",
1230
+ "dialog",
1231
+ "directory",
1232
+ "document",
1233
+ "feed",
1234
+ "figure",
1235
+ "form",
1236
+ "grid",
1237
+ "gridcell",
1238
+ "group",
1239
+ "heading",
1240
+ "img",
1241
+ "link",
1242
+ "list",
1243
+ "listbox",
1244
+ "listitem",
1245
+ "log",
1246
+ "main",
1247
+ "marquee",
1248
+ "math",
1249
+ "menu",
1250
+ "menubar",
1251
+ "menuitem",
1252
+ "menuitemcheckbox",
1253
+ "menuitemradio",
1254
+ "navigation",
1255
+ "none",
1256
+ "note",
1257
+ "option",
1258
+ "presentation",
1259
+ "progressbar",
1260
+ "radio",
1261
+ "radiogroup",
1262
+ "region",
1263
+ "row",
1264
+ "rowgroup",
1265
+ "rowheader",
1266
+ "scrollbar",
1267
+ "search",
1268
+ "searchbox",
1269
+ "separator",
1270
+ "slider",
1271
+ "spinbutton",
1272
+ "status",
1273
+ "switch",
1274
+ "tab",
1275
+ "table",
1276
+ "tablist",
1277
+ "tabpanel",
1278
+ "term",
1279
+ "textbox",
1280
+ "timer",
1281
+ "toolbar",
1282
+ "tooltip",
1283
+ "tree",
1284
+ "treegrid",
1285
+ "treeitem",
1286
+ ]
1287
+ | Var[
1288
+ Literal[
1289
+ "alert",
1290
+ "alertdialog",
1291
+ "application",
1292
+ "article",
1293
+ "banner",
1294
+ "button",
1295
+ "cell",
1296
+ "checkbox",
1297
+ "columnheader",
1298
+ "combobox",
1299
+ "complementary",
1300
+ "contentinfo",
1301
+ "definition",
1302
+ "dialog",
1303
+ "directory",
1304
+ "document",
1305
+ "feed",
1306
+ "figure",
1307
+ "form",
1308
+ "grid",
1309
+ "gridcell",
1310
+ "group",
1311
+ "heading",
1312
+ "img",
1313
+ "link",
1314
+ "list",
1315
+ "listbox",
1316
+ "listitem",
1317
+ "log",
1318
+ "main",
1319
+ "marquee",
1320
+ "math",
1321
+ "menu",
1322
+ "menubar",
1323
+ "menuitem",
1324
+ "menuitemcheckbox",
1325
+ "menuitemradio",
1326
+ "navigation",
1327
+ "none",
1328
+ "note",
1329
+ "option",
1330
+ "presentation",
1331
+ "progressbar",
1332
+ "radio",
1333
+ "radiogroup",
1334
+ "region",
1335
+ "row",
1336
+ "rowgroup",
1337
+ "rowheader",
1338
+ "scrollbar",
1339
+ "search",
1340
+ "searchbox",
1341
+ "separator",
1342
+ "slider",
1343
+ "spinbutton",
1344
+ "status",
1345
+ "switch",
1346
+ "tab",
1347
+ "table",
1348
+ "tablist",
1349
+ "tabpanel",
1350
+ "term",
1351
+ "textbox",
1352
+ "timer",
1353
+ "toolbar",
1354
+ "tooltip",
1355
+ "tree",
1356
+ "treegrid",
1357
+ "treeitem",
1358
+ ]
1359
+ ]
1360
+ | None = None,
1361
+ slot: Var[str] | str | None = None,
1362
+ spell_check: Var[bool] | bool | None = None,
1363
+ tab_index: Var[int] | int | None = None,
1364
+ title: Var[str] | str | None = None,
992
1365
  style: Sequence[Mapping[str, Any]]
993
1366
  | Mapping[str, Any]
994
1367
  | Var[Mapping[str, Any]]
@@ -1022,6 +1395,22 @@ class List(ComponentNamespace):
1022
1395
  *children: The children of the component.
1023
1396
  list_style_type: The style of the list. Default to "none".
1024
1397
  items: A list of items to add to the list.
1398
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
1399
+ auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
1400
+ content_editable: Indicates whether the element's content is editable.
1401
+ context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
1402
+ dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
1403
+ draggable: Defines whether the element can be dragged.
1404
+ enter_key_hint: Hints what media types the media element is able to play.
1405
+ hidden: Defines whether the element is hidden.
1406
+ input_mode: Defines the type of the element.
1407
+ item_prop: Defines the name of the element for metadata purposes.
1408
+ lang: Defines the language used in the element.
1409
+ role: Defines the role of the element.
1410
+ slot: Assigns a slot in a shadow DOM shadow tree to an element.
1411
+ spell_check: Defines whether the element may be checked for spelling errors.
1412
+ tab_index: Defines the position of the current element in the tabbing order.
1413
+ title: Defines a tooltip for the element.
1025
1414
  style: The style of the component.
1026
1415
  key: A unique key for the component.
1027
1416
  id: The id for the component.
@@ -103,7 +103,7 @@ class Editor(NoSSRComponent):
103
103
  refer to the library docs for a complete list.
104
104
  """
105
105
 
106
- library = "suneditor-react"
106
+ library = "suneditor-react@3.6.1"
107
107
 
108
108
  tag = "SunEditor"
109
109
 
reflex/config.py CHANGED
@@ -879,6 +879,9 @@ class Config(Base):
879
879
  # Path to file containing key-values pairs to override in the environment; Dotenv format.
880
880
  env_file: str | None = None
881
881
 
882
+ # Whether to automatically create setters for state base vars
883
+ state_auto_setters: bool = True
884
+
882
885
  # Whether to display the sticky "Built with Reflex" badge on all pages.
883
886
  show_built_with_reflex: bool | None = None
884
887
 
@@ -1,7 +1,12 @@
1
1
  """The colors used in Reflex are a wrapper around https://www.radix-ui.com/colors."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  from dataclasses import dataclass
4
- from typing import Literal
6
+ from typing import TYPE_CHECKING, Literal, get_args
7
+
8
+ if TYPE_CHECKING:
9
+ from reflex.vars import Var
5
10
 
6
11
  ColorType = Literal[
7
12
  "gray",
@@ -40,10 +45,16 @@ ColorType = Literal[
40
45
  "white",
41
46
  ]
42
47
 
48
+ COLORS = frozenset(get_args(ColorType))
49
+
43
50
  ShadeType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
51
+ MIN_SHADE_VALUE = 1
52
+ MAX_SHADE_VALUE = 12
44
53
 
45
54
 
46
- def format_color(color: ColorType, shade: ShadeType, alpha: bool) -> str:
55
+ def format_color(
56
+ color: ColorType | Var[str], shade: ShadeType | Var[int], alpha: bool | Var[bool]
57
+ ) -> str:
47
58
  """Format a color as a CSS color string.
48
59
 
49
60
  Args:
@@ -54,7 +65,13 @@ def format_color(color: ColorType, shade: ShadeType, alpha: bool) -> str:
54
65
  Returns:
55
66
  The formatted color.
56
67
  """
57
- return f"var(--{color}-{'a' if alpha else ''}{shade})"
68
+ if isinstance(alpha, bool):
69
+ return f"var(--{color}-{'a' if alpha else ''}{shade})"
70
+
71
+ from reflex.components.core import cond
72
+
73
+ alpha_var = cond(alpha, "a", "")
74
+ return f"var(--{color}-{alpha_var}{shade})"
58
75
 
59
76
 
60
77
  @dataclass
@@ -62,13 +79,13 @@ class Color:
62
79
  """A color in the Reflex color palette."""
63
80
 
64
81
  # The color palette to use
65
- color: ColorType
82
+ color: ColorType | Var[str]
66
83
 
67
84
  # The shade of the color to use
68
- shade: ShadeType = 7
85
+ shade: ShadeType | Var[int] = 7
69
86
 
70
87
  # Whether to use the alpha variant of the color
71
- alpha: bool = False
88
+ alpha: bool | Var[bool] = False
72
89
 
73
90
  def __format__(self, format_spec: str) -> str:
74
91
  """Format the color as a CSS color string.
@@ -14,7 +14,7 @@ class Bun(SimpleNamespace):
14
14
  """Bun constants."""
15
15
 
16
16
  # The Bun version.
17
- VERSION = "1.2.11"
17
+ VERSION = "1.2.12"
18
18
 
19
19
  # Min Bun Version
20
20
  MIN_VERSION = "1.2.8"
@@ -75,7 +75,7 @@ fetch-retries=0
75
75
 
76
76
 
77
77
  def _determine_nextjs_version() -> str:
78
- default_version = "15.3.1"
78
+ default_version = "15.3.2"
79
79
  if (version := os.getenv("NEXTJS_VERSION")) and version != default_version:
80
80
  from reflex.utils import console
81
81
 
reflex/state.py CHANGED
@@ -1013,6 +1013,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1013
1013
  Raises:
1014
1014
  VarTypeError: if the variable has an incorrect type
1015
1015
  """
1016
+ from reflex.config import get_config
1016
1017
  from reflex.utils.exceptions import VarTypeError
1017
1018
 
1018
1019
  if not types.is_valid_var_type(prop._var_type):
@@ -1023,7 +1024,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1023
1024
  f'Found var "{prop._js_expr}" with type {prop._var_type}.'
1024
1025
  )
1025
1026
  cls._set_var(prop)
1026
- cls._create_setter(prop)
1027
+ if get_config().state_auto_setters:
1028
+ cls._create_setter(prop)
1027
1029
  cls._set_default_value(prop)
1028
1030
 
1029
1031
  @classmethod
@@ -1400,6 +1402,29 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1400
1402
  for substate in self.substates.values():
1401
1403
  substate.reset()
1402
1404
 
1405
+ @classmethod
1406
+ @functools.lru_cache
1407
+ def _is_client_storage(cls, prop_name_or_field: str | ModelField) -> bool:
1408
+ """Check if the var is a client storage var.
1409
+
1410
+ Args:
1411
+ prop_name_or_field: The name of the var or the field itself.
1412
+
1413
+ Returns:
1414
+ Whether the var is a client storage var.
1415
+ """
1416
+ if isinstance(prop_name_or_field, str):
1417
+ field = cls.get_fields().get(prop_name_or_field)
1418
+ else:
1419
+ field = prop_name_or_field
1420
+ return field is not None and (
1421
+ isinstance(field.default, ClientStorageBase)
1422
+ or (
1423
+ isinstance(field.type_, type)
1424
+ and issubclass(field.type_, ClientStorageBase)
1425
+ )
1426
+ )
1427
+
1403
1428
  def _reset_client_storage(self):
1404
1429
  """Reset client storage base vars to their default values."""
1405
1430
  # Client-side storage is reset during hydrate so that clearing cookies
@@ -1407,10 +1432,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1407
1432
  fields = self.get_fields()
1408
1433
  for prop_name in self.base_vars:
1409
1434
  field = fields[prop_name]
1410
- if isinstance(field.default, ClientStorageBase) or (
1411
- isinstance(field.type_, type)
1412
- and issubclass(field.type_, ClientStorageBase)
1413
- ):
1435
+ if self._is_client_storage(field):
1414
1436
  setattr(self, prop_name, copy.deepcopy(field.default))
1415
1437
 
1416
1438
  # Recursively reset the substate client storage.
@@ -2391,8 +2413,9 @@ class UpdateVarsInternalState(State):
2391
2413
  for var, value in vars.items():
2392
2414
  state_name, _, var_name = var.rpartition(".")
2393
2415
  var_state_cls = State.get_class_substate(state_name)
2394
- var_state = await self.get_state(var_state_cls)
2395
- setattr(var_state, var_name, value)
2416
+ if var_state_cls._is_client_storage(var_name):
2417
+ var_state = await self.get_state(var_state_cls)
2418
+ setattr(var_state, var_name, value)
2396
2419
 
2397
2420
 
2398
2421
  class OnLoadInternalState(State):
reflex/utils/build.py CHANGED
@@ -83,7 +83,7 @@ def _zip(
83
83
  files_to_zip: list[str] = []
84
84
  # Traverse the root directory in a top-down manner. In this traversal order,
85
85
  # we can modify the dirs list in-place to remove directories we don't want to include.
86
- for root, dirs, files in os.walk(root_dir, topdown=True):
86
+ for root, dirs, files in os.walk(root_dir, topdown=True, followlinks=True):
87
87
  root = Path(root)
88
88
  # Modify the dirs in-place so excluded and hidden directories are skipped in next traversal.
89
89
  dirs[:] = [
@@ -112,7 +112,6 @@ def _zip(
112
112
  for file in root_dir.glob(glob)
113
113
  if file.name not in files_to_exclude
114
114
  ]
115
-
116
115
  # Create a progress bar for zipping the component.
117
116
  progress = Progress(
118
117
  *Progress.get_default_columns()[:-1],
reflex/utils/format.py CHANGED
@@ -181,10 +181,13 @@ def to_camel_case(text: str, treat_hyphens_as_underscores: bool = True) -> str:
181
181
  Returns:
182
182
  The camel case string.
183
183
  """
184
- char = "_" if not treat_hyphens_as_underscores else "-_"
185
- words = re.split(f"[{char}]", text)
184
+ if treat_hyphens_as_underscores:
185
+ text = text.replace("-", "_")
186
+ words = text.split("_")
186
187
  # Capitalize the first letter of each word except the first one
187
- converted_word = words[0] + "".join(x.capitalize() for x in words[1:])
188
+ if len(words) == 1:
189
+ return words[0]
190
+ converted_word = words[0] + "".join([w.capitalize() for w in words[1:]])
188
191
  return converted_word
189
192
 
190
193
 
@@ -436,12 +439,19 @@ def format_props(*single_props, **key_value_props) -> list[str]:
436
439
  from reflex.vars.base import LiteralVar, Var
437
440
 
438
441
  return [
439
- (
440
- f"{name}={{{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}}}"
442
+ ":".join(
443
+ [
444
+ str(name if "-" not in name else LiteralVar.create(name)),
445
+ str(
446
+ format_prop(
447
+ prop if isinstance(prop, Var) else LiteralVar.create(prop)
448
+ )
449
+ ),
450
+ ]
441
451
  )
442
452
  for name, prop in sorted(key_value_props.items())
443
453
  if prop is not None
444
- ] + [(f"{LiteralVar.create(prop)!s}") for prop in single_props]
454
+ ] + [(f"...{LiteralVar.create(prop)!s}") for prop in single_props]
445
455
 
446
456
 
447
457
  def get_event_handler_parts(handler: EventHandler) -> tuple[str, str]:
@@ -50,6 +50,7 @@ EXCLUDED_PROPS = [
50
50
  "tag",
51
51
  "is_default",
52
52
  "special_props",
53
+ "_is_tag_in_global_scope",
53
54
  "_invalid_children",
54
55
  "_memoization_mode",
55
56
  "_rename_props",