reflex 0.8.8a2__py3-none-any.whl → 0.8.9a1__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.

@@ -296,6 +296,12 @@ class Svg(BaseHTML):
296
296
  height: Var[str | int]
297
297
  # The XML namespace declaration.
298
298
  xmlns: Var[str]
299
+ # The viewBox attribute defines the position and dimension, in user space, of an SVG viewport.
300
+ view_box: Var[str]
301
+ # Controls how the SVG scales to fit its viewport.
302
+ preserve_aspect_ratio: Var[str]
303
+ # Defines a list of transform definitions that are applied to an element and the element's children.
304
+ transform: Var[str]
299
305
 
300
306
 
301
307
  class Text(BaseHTML):
@@ -394,6 +400,16 @@ class Polygon(BaseHTML):
394
400
  path_length: Var[int]
395
401
 
396
402
 
403
+ class Polyline(BaseHTML):
404
+ """The SVG polyline component."""
405
+
406
+ tag = "polyline"
407
+ # List of points (pairs of x,y coordinates) that define the polyline.
408
+ points: Var[str]
409
+ # The total path length, in user units.
410
+ path_length: Var[int]
411
+
412
+
397
413
  class Defs(BaseHTML):
398
414
  """Display the defs element."""
399
415
 
@@ -414,6 +430,9 @@ class LinearGradient(BaseHTML):
414
430
  # Method used to spread the gradient.
415
431
  spread_method: Var[str | bool]
416
432
 
433
+ # Reference to another gradient to inherit from.
434
+ href: Var[str]
435
+
417
436
  # X coordinate of the starting point of the gradient.
418
437
  x1: Var[str | int | float]
419
438
 
@@ -453,6 +472,9 @@ class RadialGradient(BaseHTML):
453
472
  # Transform applied to the gradient.
454
473
  gradient_transform: Var[str | bool]
455
474
 
475
+ # Reference to another gradient to inherit from.
476
+ href: Var[str]
477
+
456
478
  # The radius of the end circle of the radial gradient.
457
479
  r: Var[str | int | float]
458
480
 
@@ -482,6 +504,8 @@ class Path(BaseHTML):
482
504
 
483
505
  # Defines the shape of the path.
484
506
  d: Var[str | int | float]
507
+ # The total path length, in user units.
508
+ path_length: Var[int]
485
509
 
486
510
 
487
511
  class Marker(BaseHTML):
@@ -538,6 +562,459 @@ class G(BaseHTML):
538
562
  transform: Var[str]
539
563
 
540
564
 
565
+ class SvgImage(BaseHTML):
566
+ """The SVG image component."""
567
+
568
+ tag = "image"
569
+
570
+ # URL of the image to display.
571
+ href: Var[str]
572
+
573
+ # X coordinate of the image.
574
+ x: Var[str | int]
575
+
576
+ # Y coordinate of the image.
577
+ y: Var[str | int]
578
+
579
+ # Width of the image.
580
+ width: Var[str | int]
581
+
582
+ # Height of the image.
583
+ height: Var[str | int]
584
+
585
+ # How the image should scale to fit its viewport.
586
+ preserve_aspect_ratio: Var[str]
587
+
588
+ # CORS settings for the image.
589
+ crossorigin: Var[str]
590
+
591
+
592
+ class Use(BaseHTML):
593
+ """The SVG use component for reusing defined elements."""
594
+
595
+ tag = "use"
596
+
597
+ # Reference to the element to reuse.
598
+ href: Var[str]
599
+
600
+ # X coordinate where the referenced element should be positioned.
601
+ x: Var[str | int]
602
+
603
+ # Y coordinate where the referenced element should be positioned.
604
+ y: Var[str | int]
605
+
606
+ # Width of the referenced element.
607
+ width: Var[str | int]
608
+
609
+ # Height of the referenced element.
610
+ height: Var[str | int]
611
+
612
+
613
+ class TSpan(BaseHTML):
614
+ """The SVG tspan component for text spans within text elements."""
615
+
616
+ tag = "tspan"
617
+
618
+ # X coordinate of the text.
619
+ x: Var[str | int]
620
+
621
+ # Y coordinate of the text.
622
+ y: Var[str | int]
623
+
624
+ # Horizontal offset from the previous text element.
625
+ dx: Var[str | int]
626
+
627
+ # Vertical offset from the previous text element.
628
+ dy: Var[str | int]
629
+
630
+ # Rotation of the text.
631
+ rotate: Var[str | int]
632
+
633
+ # How the text is stretched or compressed to fit the width defined by text_length.
634
+ length_adjust: Var[str]
635
+
636
+ # A width that the text should be scaled to fit.
637
+ text_length: Var[str | int]
638
+
639
+
640
+ class TextPath(BaseHTML):
641
+ """The SVG textPath component for text along a path."""
642
+
643
+ tag = "textPath"
644
+
645
+ # Reference to the path along which the text should be rendered.
646
+ href: Var[str]
647
+
648
+ # Inline path data.
649
+ path: Var[str]
650
+
651
+ # Distance along the path from its beginning to the initial position of the text.
652
+ start_offset: Var[str | int]
653
+
654
+ # Method for rendering text along the path.
655
+ method: Var[str]
656
+
657
+ # Spacing method for text.
658
+ spacing: Var[str]
659
+
660
+ # Which side of the path the text should be rendered on.
661
+ side: Var[str]
662
+
663
+ # How the text is stretched or compressed to fit the specified length.
664
+ length_adjust: Var[str]
665
+
666
+ # Target length for the text.
667
+ text_length: Var[str | int]
668
+
669
+
670
+ class Pattern(BaseHTML):
671
+ """The SVG pattern component for defining repeating patterns."""
672
+
673
+ tag = "pattern"
674
+
675
+ # X coordinate of the pattern.
676
+ x: Var[str | int]
677
+
678
+ # Y coordinate of the pattern.
679
+ y: Var[str | int]
680
+
681
+ # Width of the pattern.
682
+ width: Var[str | int]
683
+
684
+ # Height of the pattern.
685
+ height: Var[str | int]
686
+
687
+ # Units for the pattern coordinates.
688
+ pattern_units: Var[str]
689
+
690
+ # Units for the pattern content coordinates.
691
+ pattern_content_units: Var[str]
692
+
693
+ # Transform applied to the pattern.
694
+ pattern_transform: Var[str]
695
+
696
+ # ViewBox definition for the pattern.
697
+ view_box: Var[str]
698
+
699
+ # How the pattern should scale to fit its viewport.
700
+ preserve_aspect_ratio: Var[str]
701
+
702
+ # Reference to another pattern to inherit from.
703
+ href: Var[str]
704
+
705
+
706
+ class ClipPath(BaseHTML):
707
+ """The SVG clipPath component for defining clipping paths."""
708
+
709
+ tag = "clipPath"
710
+
711
+ # Units for the clipping path coordinates.
712
+ clip_path_units: Var[str]
713
+
714
+
715
+ class Symbol(BaseHTML):
716
+ """The SVG symbol component for defining reusable symbols."""
717
+
718
+ tag = "symbol"
719
+
720
+ # ViewBox definition for the symbol.
721
+ view_box: Var[str]
722
+
723
+ # How the symbol should scale to fit its viewport.
724
+ preserve_aspect_ratio: Var[str]
725
+
726
+ # Reference X coordinate.
727
+ ref_x: Var[str | int]
728
+
729
+ # Reference Y coordinate.
730
+ ref_y: Var[str | int]
731
+
732
+
733
+ class Mask(BaseHTML):
734
+ """The SVG mask component for defining masks."""
735
+
736
+ tag = "mask"
737
+
738
+ # X coordinate of the mask.
739
+ x: Var[str | int]
740
+
741
+ # Y coordinate of the mask.
742
+ y: Var[str | int]
743
+
744
+ # Width of the mask.
745
+ width: Var[str | int]
746
+
747
+ # Height of the mask.
748
+ height: Var[str | int]
749
+
750
+ # Units for the mask coordinates.
751
+ mask_units: Var[str]
752
+
753
+ # Units for the mask content coordinates.
754
+ mask_content_units: Var[str]
755
+
756
+
757
+ class ForeignObject(BaseHTML):
758
+ """The SVG foreignObject component for embedding foreign content."""
759
+
760
+ tag = "foreignObject"
761
+
762
+ # X coordinate of the foreign object.
763
+ x: Var[str | int]
764
+
765
+ # Y coordinate of the foreign object.
766
+ y: Var[str | int]
767
+
768
+ # Width of the foreign object.
769
+ width: Var[str | int]
770
+
771
+ # Height of the foreign object.
772
+ height: Var[str | int]
773
+
774
+
775
+ class SvgA(BaseHTML):
776
+ """The SVG anchor component for creating links."""
777
+
778
+ tag = "a"
779
+
780
+ # URL of the link.
781
+ href: Var[str]
782
+
783
+ # Where to open the linked resource.
784
+ target: Var[str]
785
+
786
+ # Download attribute for the link.
787
+ download: Var[str]
788
+
789
+ # Relationship between the current document and the linked resource.
790
+ rel: Var[str]
791
+
792
+ # Language of the linked resource.
793
+ hreflang: Var[str]
794
+
795
+ # MIME type of the linked resource.
796
+ type: Var[str]
797
+
798
+ # Referrer policy for the link.
799
+ referrerpolicy: Var[str]
800
+
801
+
802
+ class Animate(BaseHTML):
803
+ """The SVG animate component for animations."""
804
+
805
+ tag = "animate"
806
+
807
+ # Name of the attribute to animate.
808
+ attribute_name: Var[str]
809
+
810
+ # Starting value of the animation.
811
+ from_: Var[str]
812
+
813
+ # Ending value of the animation.
814
+ to: Var[str]
815
+
816
+ # Duration of the animation.
817
+ dur: Var[str]
818
+
819
+ # When the animation should begin.
820
+ begin: Var[str]
821
+
822
+ # When the animation should end.
823
+ end: Var[str]
824
+
825
+ # Number of times to repeat the animation.
826
+ repeat_count: Var[str]
827
+
828
+ # How values should be calculated during the animation.
829
+ calc_mode: Var[str]
830
+
831
+ # List of values for the animation.
832
+ values: Var[str]
833
+
834
+ # Key times for the animation values.
835
+ key_times: Var[str]
836
+
837
+ # Key splines for smooth transitions.
838
+ key_splines: Var[str]
839
+
840
+ # Whether animation values should accumulate.
841
+ accumulate: Var[str]
842
+
843
+ # Whether animation values should be additive.
844
+ additive: Var[str]
845
+
846
+ # Reference to the target element.
847
+ href: Var[str]
848
+
849
+
850
+ class AnimateMotion(BaseHTML):
851
+ """The SVG animateMotion component for motion animations."""
852
+
853
+ tag = "animateMotion"
854
+
855
+ # Path along which to animate.
856
+ path: Var[str]
857
+
858
+ # Duration of the animation.
859
+ dur: Var[str]
860
+
861
+ # When the animation should begin.
862
+ begin: Var[str]
863
+
864
+ # When the animation should end.
865
+ end: Var[str]
866
+
867
+ # Number of times to repeat the animation.
868
+ repeat_count: Var[str]
869
+
870
+ # Rotation behavior during motion.
871
+ rotate: Var[str]
872
+
873
+ # Key times for the motion.
874
+ key_times: Var[str]
875
+
876
+ # Key points along the path.
877
+ key_points: Var[str]
878
+
879
+ # Reference to the target element.
880
+ href: Var[str]
881
+
882
+
883
+ class AnimateTransform(BaseHTML):
884
+ """The SVG animateTransform component for transform animations."""
885
+
886
+ tag = "animateTransform"
887
+
888
+ # Name of the transform attribute to animate.
889
+ attribute_name: Var[str]
890
+
891
+ # Type of transformation.
892
+ type: Var[str]
893
+
894
+ # Starting value of the transformation.
895
+ from_: Var[str]
896
+
897
+ # Ending value of the transformation.
898
+ to: Var[str]
899
+
900
+ # Duration of the animation.
901
+ dur: Var[str]
902
+
903
+ # When the animation should begin.
904
+ begin: Var[str]
905
+
906
+ # When the animation should end.
907
+ end: Var[str]
908
+
909
+ # Number of times to repeat the animation.
910
+ repeat_count: Var[str]
911
+
912
+ # List of values for the transformation.
913
+ values: Var[str]
914
+
915
+ # Reference to the target element.
916
+ href: Var[str]
917
+
918
+
919
+ class Set(BaseHTML):
920
+ """The SVG set component for setting attribute values."""
921
+
922
+ tag = "set"
923
+
924
+ # Name of the attribute to set.
925
+ attribute_name: Var[str]
926
+
927
+ # Value to set the attribute to.
928
+ to: Var[str]
929
+
930
+ # When to set the attribute.
931
+ begin: Var[str]
932
+
933
+ # Duration for which to maintain the value.
934
+ dur: Var[str]
935
+
936
+ # When to end the setting.
937
+ end: Var[str]
938
+
939
+ # Reference to the target element.
940
+ href: Var[str]
941
+
942
+
943
+ class MPath(BaseHTML):
944
+ """The SVG mpath component for motion path references."""
945
+
946
+ tag = "mpath"
947
+
948
+ # Reference to a path element.
949
+ href: Var[str]
950
+
951
+
952
+ class Desc(BaseHTML):
953
+ """The SVG desc component for descriptions."""
954
+
955
+ tag = "desc"
956
+
957
+
958
+ class Title(BaseHTML):
959
+ """The SVG title component for titles."""
960
+
961
+ tag = "title"
962
+
963
+
964
+ class Metadata(BaseHTML):
965
+ """The SVG metadata component for metadata."""
966
+
967
+ tag = "metadata"
968
+
969
+
970
+ class Script(BaseHTML):
971
+ """The SVG script component for scripts."""
972
+
973
+ tag = "script"
974
+
975
+ # MIME type of the script.
976
+ type: Var[str]
977
+
978
+ # URL of external script.
979
+ href: Var[str]
980
+
981
+ # CORS settings for the script.
982
+ crossorigin: Var[str]
983
+
984
+
985
+ class SvgStyle(BaseHTML):
986
+ """The SVG style component for stylesheets."""
987
+
988
+ tag = "style"
989
+
990
+ # MIME type of the stylesheet.
991
+ type: Var[str]
992
+
993
+ # Media query for the stylesheet.
994
+ media: Var[str]
995
+
996
+ # Title of the stylesheet.
997
+ title: Var[str]
998
+
999
+
1000
+ class Switch(BaseHTML):
1001
+ """The SVG switch component for conditional processing."""
1002
+
1003
+ tag = "switch"
1004
+
1005
+
1006
+ class View(BaseHTML):
1007
+ """The SVG view component for view definitions."""
1008
+
1009
+ tag = "view"
1010
+
1011
+ # ViewBox definition for the view.
1012
+ view_box: Var[str]
1013
+
1014
+ # How the view should scale to fit its viewport.
1015
+ preserve_aspect_ratio: Var[str]
1016
+
1017
+
541
1018
  class SVG(ComponentNamespace):
542
1019
  """SVG component namespace."""
543
1020
 
@@ -547,6 +1024,7 @@ class SVG(ComponentNamespace):
547
1024
  ellipse = staticmethod(Ellipse.create)
548
1025
  rect = staticmethod(Rect.create)
549
1026
  polygon = staticmethod(Polygon.create)
1027
+ polyline = staticmethod(Polyline.create)
550
1028
  path = staticmethod(Path.create)
551
1029
  stop = staticmethod(Stop.create)
552
1030
  linear_gradient = staticmethod(LinearGradient.create)
@@ -554,6 +1032,28 @@ class SVG(ComponentNamespace):
554
1032
  defs = staticmethod(Defs.create)
555
1033
  marker = staticmethod(Marker.create)
556
1034
  g = staticmethod(G.create)
1035
+ image = staticmethod(SvgImage.create)
1036
+ use = staticmethod(Use.create)
1037
+ tspan = staticmethod(TSpan.create)
1038
+ text_path = staticmethod(TextPath.create)
1039
+ pattern = staticmethod(Pattern.create)
1040
+ clip_path = staticmethod(ClipPath.create)
1041
+ symbol = staticmethod(Symbol.create)
1042
+ mask = staticmethod(Mask.create)
1043
+ foreign_object = staticmethod(ForeignObject.create)
1044
+ a = staticmethod(SvgA.create)
1045
+ animate = staticmethod(Animate.create)
1046
+ animate_motion = staticmethod(AnimateMotion.create)
1047
+ animate_transform = staticmethod(AnimateTransform.create)
1048
+ set = staticmethod(Set.create)
1049
+ mpath = staticmethod(MPath.create)
1050
+ desc = staticmethod(Desc.create)
1051
+ title = staticmethod(Title.create)
1052
+ metadata = staticmethod(Metadata.create)
1053
+ script = staticmethod(Script.create)
1054
+ style = staticmethod(SvgStyle.create)
1055
+ switch = staticmethod(Switch.create)
1056
+ view = staticmethod(View.create)
557
1057
  __call__ = staticmethod(Svg.create)
558
1058
 
559
1059
 
@@ -563,6 +1063,7 @@ circle = Circle.create
563
1063
  ellipse = Ellipse.create
564
1064
  rect = Rect.create
565
1065
  polygon = Polygon.create
1066
+ polyline = Polyline.create
566
1067
  path = Path.create
567
1068
  stop = Stop.create
568
1069
  linear_gradient = LinearGradient.create
@@ -570,6 +1071,23 @@ radial_gradient = RadialGradient.create
570
1071
  defs = Defs.create
571
1072
  marker = Marker.create
572
1073
  g = G.create
1074
+ use = Use.create
1075
+ tspan = TSpan.create
1076
+ text_path = TextPath.create
1077
+ pattern = Pattern.create
1078
+ clip_path = ClipPath.create
1079
+ symbol = Symbol.create
1080
+ mask = Mask.create
1081
+ foreign_object = ForeignObject.create
1082
+ animate = Animate.create
1083
+ animate_motion = AnimateMotion.create
1084
+ animate_transform = AnimateTransform.create
1085
+ set_svg = Set.create
1086
+ mpath = MPath.create
1087
+ desc = Desc.create
1088
+ metadata = Metadata.create
1089
+ switch = Switch.create
1090
+ view = View.create
573
1091
  area = Area.create
574
1092
  audio = Audio.create
575
1093
  image = img = Img.create
@@ -453,6 +453,7 @@ LUCIDE_ICON_LIST = [
453
453
  "chevrons_up_down",
454
454
  "chevrons_up",
455
455
  "chrome",
456
+ "chromium",
456
457
  "church",
457
458
  "cigarette_off",
458
459
  "cigarette",
@@ -1198,11 +1199,13 @@ LUCIDE_ICON_LIST = [
1198
1199
  "panel_left_close",
1199
1200
  "panel_left_dashed",
1200
1201
  "panel_left_open",
1202
+ "panel_left_right_dashed",
1201
1203
  "panel_left",
1202
1204
  "panel_right_close",
1203
1205
  "panel_right_dashed",
1204
1206
  "panel_right_open",
1205
1207
  "panel_right",
1208
+ "panel_top_bottom_dashed",
1206
1209
  "panel_top_close",
1207
1210
  "panel_top_dashed",
1208
1211
  "panel_top_open",
@@ -249,6 +249,7 @@ class DrawerPortal(DrawerComponent):
249
249
  """
250
250
 
251
251
  class DrawerContent(DrawerComponent):
252
+ def add_style(self) -> dict: ...
252
253
  @classmethod
253
254
  def create(
254
255
  cls,
@@ -309,6 +310,7 @@ class DrawerContent(DrawerComponent):
309
310
  """
310
311
 
311
312
  class DrawerOverlay(DrawerComponent):
313
+ def add_style(self) -> dict: ...
312
314
  @classmethod
313
315
  def create(
314
316
  cls,
@@ -411,6 +413,7 @@ class DrawerClose(DrawerTrigger):
411
413
  """
412
414
 
413
415
  class DrawerTitle(DrawerComponent):
416
+ def add_style(self) -> dict: ...
414
417
  @classmethod
415
418
  def create(
416
419
  cls,
@@ -462,6 +465,7 @@ class DrawerTitle(DrawerComponent):
462
465
  """
463
466
 
464
467
  class DrawerDescription(DrawerComponent):
468
+ def add_style(self) -> dict: ...
465
469
  @classmethod
466
470
  def create(
467
471
  cls,
reflex/config.py CHANGED
@@ -237,7 +237,7 @@ class BaseConfig:
237
237
  env_file: str | None = None
238
238
 
239
239
  # Whether to automatically create setters for state base vars
240
- state_auto_setters: bool = True
240
+ state_auto_setters: bool | None = None
241
241
 
242
242
  # Whether to display the sticky "Built with Reflex" badge on all pages.
243
243
  show_built_with_reflex: bool | None = None
@@ -14,7 +14,7 @@ class Bun(SimpleNamespace):
14
14
  """Bun constants."""
15
15
 
16
16
  # The Bun version.
17
- VERSION = "1.2.20"
17
+ VERSION = "1.2.21"
18
18
 
19
19
  # Min Bun Version
20
20
  MIN_VERSION = "1.2.17"
@@ -75,7 +75,7 @@ fetch-retries=0
75
75
 
76
76
 
77
77
  def _determine_react_router_version() -> str:
78
- default_version = "7.8.1"
78
+ default_version = "7.8.2"
79
79
  if (version := os.getenv("REACT_ROUTER_VERSION")) and version != default_version:
80
80
  from reflex.utils import console
81
81
 
@@ -143,11 +143,11 @@ class PackageJson(SimpleNamespace):
143
143
  "postcss-import": "16.1.1",
144
144
  "@react-router/dev": _react_router_version,
145
145
  "@react-router/fs-routes": _react_router_version,
146
- "vite": "npm:rolldown-vite@7.1.3",
146
+ "vite": "npm:rolldown-vite@7.1.5",
147
147
  }
148
148
  OVERRIDES = {
149
149
  # This should always match the `react` version in DEPENDENCIES for recharts compatibility.
150
150
  "react-is": _react_version,
151
151
  "cookie": "1.0.2",
152
- "vite": "npm:rolldown-vite@7.1.3",
152
+ "vite": "npm:rolldown-vite@7.1.5",
153
153
  }
reflex/environment.py CHANGED
@@ -6,7 +6,6 @@ import concurrent.futures
6
6
  import dataclasses
7
7
  import enum
8
8
  import importlib
9
- import inspect
10
9
  import multiprocessing
11
10
  import os
12
11
  import platform
@@ -159,7 +158,7 @@ def interpret_plugin_env(value: str, field_name: str) -> Plugin:
159
158
  msg = f"Failed to get plugin class {plugin_name!r} from module {import_path!r} for {field_name}: {e}"
160
159
  raise EnvironmentVarValueError(msg) from e
161
160
 
162
- if not inspect.isclass(plugin_class) or not issubclass(plugin_class, Plugin):
161
+ if not isinstance(plugin_class, type) or not issubclass(plugin_class, Plugin):
163
162
  msg = f"Invalid plugin class: {plugin_name!r} for {field_name}. Must be a subclass of Plugin."
164
163
  raise EnvironmentVarValueError(msg)
165
164
 
@@ -236,7 +235,7 @@ def interpret_env_var_value(
236
235
  )
237
236
  for i, v in enumerate(value.split(":"))
238
237
  ]
239
- if inspect.isclass(field_type) and issubclass(field_type, enum.Enum):
238
+ if isinstance(field_type, type) and issubclass(field_type, enum.Enum):
240
239
  return interpret_enum_env(value, field_type, field_name)
241
240
 
242
241
  msg = f"Invalid type for environment variable {field_name}: {field_type}. This is probably an issue in Reflex."
@@ -640,6 +639,12 @@ class EnvironmentVariables:
640
639
  # Enable full logging of debug messages to reflex user directory.
641
640
  REFLEX_ENABLE_FULL_LOGGING: EnvVar[bool] = env_var(False)
642
641
 
642
+ # Whether to enable hot module replacement
643
+ VITE_HMR: EnvVar[bool] = env_var(True)
644
+
645
+ # Whether to force a full reload on changes.
646
+ VITE_FORCE_FULL_RELOAD: EnvVar[bool] = env_var(False)
647
+
643
648
 
644
649
  environment = EnvironmentVariables()
645
650