reflex 0.6.1a2__py3-none-any.whl → 0.6.2__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/jinja/web/pages/_app.js.jinja2 +6 -8
- reflex/.templates/web/utils/state.js +17 -5
- reflex/app.py +3 -14
- reflex/compiler/compiler.py +25 -1
- reflex/compiler/utils.py +4 -5
- reflex/components/component.py +32 -18
- reflex/components/dynamic.py +39 -9
- reflex/components/el/elements/media.py +89 -0
- reflex/components/el/elements/media.pyi +480 -0
- reflex/config.py +3 -2
- reflex/constants/base.py +22 -12
- reflex/constants/config.py +3 -4
- reflex/constants/custom_components.py +4 -3
- reflex/constants/installer.py +14 -15
- reflex/custom_components/custom_components.py +32 -41
- reflex/event.py +199 -4
- reflex/istate/data.py +126 -0
- reflex/model.py +2 -3
- reflex/reflex.py +5 -14
- reflex/state.py +127 -164
- reflex/utils/build.py +21 -16
- reflex/utils/compat.py +25 -4
- reflex/utils/exceptions.py +12 -0
- reflex/utils/exec.py +2 -2
- reflex/utils/format.py +1 -13
- reflex/utils/path_ops.py +3 -3
- reflex/utils/prerequisites.py +49 -88
- reflex/utils/processes.py +2 -2
- reflex/vars/base.py +48 -37
- {reflex-0.6.1a2.dist-info → reflex-0.6.2.dist-info}/METADATA +1 -2
- {reflex-0.6.1a2.dist-info → reflex-0.6.2.dist-info}/RECORD +34 -33
- {reflex-0.6.1a2.dist-info → reflex-0.6.2.dist-info}/LICENSE +0 -0
- {reflex-0.6.1a2.dist-info → reflex-0.6.2.dist-info}/WHEEL +0 -0
- {reflex-0.6.1a2.dist-info → reflex-0.6.2.dist-info}/entry_points.txt +0 -0
|
@@ -1550,6 +1550,242 @@ class Svg(BaseHTML):
|
|
|
1550
1550
|
"""
|
|
1551
1551
|
...
|
|
1552
1552
|
|
|
1553
|
+
class Text(BaseHTML):
|
|
1554
|
+
@overload
|
|
1555
|
+
@classmethod
|
|
1556
|
+
def create( # type: ignore
|
|
1557
|
+
cls,
|
|
1558
|
+
*children,
|
|
1559
|
+
x: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1560
|
+
y: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1561
|
+
dx: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1562
|
+
dy: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1563
|
+
rotate: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1564
|
+
length_adjust: Optional[Union[Var[str], str]] = None,
|
|
1565
|
+
text_length: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1566
|
+
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1567
|
+
auto_capitalize: Optional[
|
|
1568
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1569
|
+
] = None,
|
|
1570
|
+
content_editable: Optional[
|
|
1571
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1572
|
+
] = None,
|
|
1573
|
+
context_menu: Optional[
|
|
1574
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1575
|
+
] = None,
|
|
1576
|
+
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1577
|
+
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1578
|
+
enter_key_hint: Optional[
|
|
1579
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1580
|
+
] = None,
|
|
1581
|
+
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1582
|
+
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1583
|
+
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1584
|
+
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1585
|
+
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1586
|
+
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1587
|
+
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1588
|
+
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1589
|
+
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1590
|
+
style: Optional[Style] = None,
|
|
1591
|
+
key: Optional[Any] = None,
|
|
1592
|
+
id: Optional[Any] = None,
|
|
1593
|
+
class_name: Optional[Any] = None,
|
|
1594
|
+
autofocus: Optional[bool] = None,
|
|
1595
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
1596
|
+
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1597
|
+
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1598
|
+
on_context_menu: Optional[
|
|
1599
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1600
|
+
] = None,
|
|
1601
|
+
on_double_click: Optional[
|
|
1602
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1603
|
+
] = None,
|
|
1604
|
+
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1605
|
+
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1606
|
+
on_mouse_down: Optional[
|
|
1607
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1608
|
+
] = None,
|
|
1609
|
+
on_mouse_enter: Optional[
|
|
1610
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1611
|
+
] = None,
|
|
1612
|
+
on_mouse_leave: Optional[
|
|
1613
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1614
|
+
] = None,
|
|
1615
|
+
on_mouse_move: Optional[
|
|
1616
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1617
|
+
] = None,
|
|
1618
|
+
on_mouse_out: Optional[
|
|
1619
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1620
|
+
] = None,
|
|
1621
|
+
on_mouse_over: Optional[
|
|
1622
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1623
|
+
] = None,
|
|
1624
|
+
on_mouse_up: Optional[
|
|
1625
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1626
|
+
] = None,
|
|
1627
|
+
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1628
|
+
on_unmount: Optional[
|
|
1629
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1630
|
+
] = None,
|
|
1631
|
+
**props,
|
|
1632
|
+
) -> "Text":
|
|
1633
|
+
"""Create the component.
|
|
1634
|
+
|
|
1635
|
+
Args:
|
|
1636
|
+
*children: The children of the component.
|
|
1637
|
+
x: The x coordinate of the starting point of the text baseline.
|
|
1638
|
+
y: The y coordinate of the starting point of the text baseline.
|
|
1639
|
+
dx: Shifts the text position horizontally from a previous text element.
|
|
1640
|
+
dy: Shifts the text position vertically from a previous text element.
|
|
1641
|
+
rotate: Rotates orientation of each individual glyph.
|
|
1642
|
+
length_adjust: How the text is stretched or compressed to fit the width defined by the text_length attribute.
|
|
1643
|
+
text_length: A width that the text should be scaled to fit.
|
|
1644
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
1645
|
+
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
1646
|
+
content_editable: Indicates whether the element's content is editable.
|
|
1647
|
+
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
1648
|
+
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
1649
|
+
draggable: Defines whether the element can be dragged.
|
|
1650
|
+
enter_key_hint: Hints what media types the media element is able to play.
|
|
1651
|
+
hidden: Defines whether the element is hidden.
|
|
1652
|
+
input_mode: Defines the type of the element.
|
|
1653
|
+
item_prop: Defines the name of the element for metadata purposes.
|
|
1654
|
+
lang: Defines the language used in the element.
|
|
1655
|
+
role: Defines the role of the element.
|
|
1656
|
+
slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
1657
|
+
spell_check: Defines whether the element may be checked for spelling errors.
|
|
1658
|
+
tab_index: Defines the position of the current element in the tabbing order.
|
|
1659
|
+
title: Defines a tooltip for the element.
|
|
1660
|
+
style: The style of the component.
|
|
1661
|
+
key: A unique key for the component.
|
|
1662
|
+
id: The id for the component.
|
|
1663
|
+
class_name: The class name for the component.
|
|
1664
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
1665
|
+
custom_attrs: custom attribute
|
|
1666
|
+
**props: The props of the component.
|
|
1667
|
+
|
|
1668
|
+
Returns:
|
|
1669
|
+
The component.
|
|
1670
|
+
"""
|
|
1671
|
+
...
|
|
1672
|
+
|
|
1673
|
+
class Line(BaseHTML):
|
|
1674
|
+
@overload
|
|
1675
|
+
@classmethod
|
|
1676
|
+
def create( # type: ignore
|
|
1677
|
+
cls,
|
|
1678
|
+
*children,
|
|
1679
|
+
x1: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1680
|
+
x2: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1681
|
+
y1: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1682
|
+
y2: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1683
|
+
path_length: Optional[Union[Var[int], int]] = None,
|
|
1684
|
+
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1685
|
+
auto_capitalize: Optional[
|
|
1686
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1687
|
+
] = None,
|
|
1688
|
+
content_editable: Optional[
|
|
1689
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1690
|
+
] = None,
|
|
1691
|
+
context_menu: Optional[
|
|
1692
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1693
|
+
] = None,
|
|
1694
|
+
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1695
|
+
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1696
|
+
enter_key_hint: Optional[
|
|
1697
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1698
|
+
] = None,
|
|
1699
|
+
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1700
|
+
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1701
|
+
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1702
|
+
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1703
|
+
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1704
|
+
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1705
|
+
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1706
|
+
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1707
|
+
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1708
|
+
style: Optional[Style] = None,
|
|
1709
|
+
key: Optional[Any] = None,
|
|
1710
|
+
id: Optional[Any] = None,
|
|
1711
|
+
class_name: Optional[Any] = None,
|
|
1712
|
+
autofocus: Optional[bool] = None,
|
|
1713
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
1714
|
+
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1715
|
+
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1716
|
+
on_context_menu: Optional[
|
|
1717
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1718
|
+
] = None,
|
|
1719
|
+
on_double_click: Optional[
|
|
1720
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1721
|
+
] = None,
|
|
1722
|
+
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1723
|
+
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1724
|
+
on_mouse_down: Optional[
|
|
1725
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1726
|
+
] = None,
|
|
1727
|
+
on_mouse_enter: Optional[
|
|
1728
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1729
|
+
] = None,
|
|
1730
|
+
on_mouse_leave: Optional[
|
|
1731
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1732
|
+
] = None,
|
|
1733
|
+
on_mouse_move: Optional[
|
|
1734
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1735
|
+
] = None,
|
|
1736
|
+
on_mouse_out: Optional[
|
|
1737
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1738
|
+
] = None,
|
|
1739
|
+
on_mouse_over: Optional[
|
|
1740
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1741
|
+
] = None,
|
|
1742
|
+
on_mouse_up: Optional[
|
|
1743
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1744
|
+
] = None,
|
|
1745
|
+
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1746
|
+
on_unmount: Optional[
|
|
1747
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1748
|
+
] = None,
|
|
1749
|
+
**props,
|
|
1750
|
+
) -> "Line":
|
|
1751
|
+
"""Create the component.
|
|
1752
|
+
|
|
1753
|
+
Args:
|
|
1754
|
+
*children: The children of the component.
|
|
1755
|
+
x1: The x-axis coordinate of the line starting point.
|
|
1756
|
+
x2: The x-axis coordinate of the the line ending point.
|
|
1757
|
+
y1: The y-axis coordinate of the line starting point.
|
|
1758
|
+
y2: The y-axis coordinate of the the line ending point.
|
|
1759
|
+
path_length: The total path length, in user units.
|
|
1760
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
1761
|
+
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
1762
|
+
content_editable: Indicates whether the element's content is editable.
|
|
1763
|
+
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
1764
|
+
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
1765
|
+
draggable: Defines whether the element can be dragged.
|
|
1766
|
+
enter_key_hint: Hints what media types the media element is able to play.
|
|
1767
|
+
hidden: Defines whether the element is hidden.
|
|
1768
|
+
input_mode: Defines the type of the element.
|
|
1769
|
+
item_prop: Defines the name of the element for metadata purposes.
|
|
1770
|
+
lang: Defines the language used in the element.
|
|
1771
|
+
role: Defines the role of the element.
|
|
1772
|
+
slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
1773
|
+
spell_check: Defines whether the element may be checked for spelling errors.
|
|
1774
|
+
tab_index: Defines the position of the current element in the tabbing order.
|
|
1775
|
+
title: Defines a tooltip for the element.
|
|
1776
|
+
style: The style of the component.
|
|
1777
|
+
key: A unique key for the component.
|
|
1778
|
+
id: The id for the component.
|
|
1779
|
+
class_name: The class name for the component.
|
|
1780
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
1781
|
+
custom_attrs: custom attribute
|
|
1782
|
+
**props: The props of the component.
|
|
1783
|
+
|
|
1784
|
+
Returns:
|
|
1785
|
+
The component.
|
|
1786
|
+
"""
|
|
1787
|
+
...
|
|
1788
|
+
|
|
1553
1789
|
class Circle(BaseHTML):
|
|
1554
1790
|
@overload
|
|
1555
1791
|
@classmethod
|
|
@@ -1664,6 +1900,122 @@ class Circle(BaseHTML):
|
|
|
1664
1900
|
"""
|
|
1665
1901
|
...
|
|
1666
1902
|
|
|
1903
|
+
class Ellipse(BaseHTML):
|
|
1904
|
+
@overload
|
|
1905
|
+
@classmethod
|
|
1906
|
+
def create( # type: ignore
|
|
1907
|
+
cls,
|
|
1908
|
+
*children,
|
|
1909
|
+
cx: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1910
|
+
cy: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1911
|
+
rx: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1912
|
+
ry: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
1913
|
+
path_length: Optional[Union[Var[int], int]] = None,
|
|
1914
|
+
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1915
|
+
auto_capitalize: Optional[
|
|
1916
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1917
|
+
] = None,
|
|
1918
|
+
content_editable: Optional[
|
|
1919
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1920
|
+
] = None,
|
|
1921
|
+
context_menu: Optional[
|
|
1922
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1923
|
+
] = None,
|
|
1924
|
+
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1925
|
+
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1926
|
+
enter_key_hint: Optional[
|
|
1927
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
1928
|
+
] = None,
|
|
1929
|
+
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1930
|
+
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1931
|
+
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1932
|
+
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1933
|
+
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1934
|
+
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1935
|
+
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1936
|
+
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1937
|
+
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
1938
|
+
style: Optional[Style] = None,
|
|
1939
|
+
key: Optional[Any] = None,
|
|
1940
|
+
id: Optional[Any] = None,
|
|
1941
|
+
class_name: Optional[Any] = None,
|
|
1942
|
+
autofocus: Optional[bool] = None,
|
|
1943
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
1944
|
+
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1945
|
+
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1946
|
+
on_context_menu: Optional[
|
|
1947
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1948
|
+
] = None,
|
|
1949
|
+
on_double_click: Optional[
|
|
1950
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1951
|
+
] = None,
|
|
1952
|
+
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1953
|
+
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1954
|
+
on_mouse_down: Optional[
|
|
1955
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1956
|
+
] = None,
|
|
1957
|
+
on_mouse_enter: Optional[
|
|
1958
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1959
|
+
] = None,
|
|
1960
|
+
on_mouse_leave: Optional[
|
|
1961
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1962
|
+
] = None,
|
|
1963
|
+
on_mouse_move: Optional[
|
|
1964
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1965
|
+
] = None,
|
|
1966
|
+
on_mouse_out: Optional[
|
|
1967
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1968
|
+
] = None,
|
|
1969
|
+
on_mouse_over: Optional[
|
|
1970
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1971
|
+
] = None,
|
|
1972
|
+
on_mouse_up: Optional[
|
|
1973
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1974
|
+
] = None,
|
|
1975
|
+
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
1976
|
+
on_unmount: Optional[
|
|
1977
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
1978
|
+
] = None,
|
|
1979
|
+
**props,
|
|
1980
|
+
) -> "Ellipse":
|
|
1981
|
+
"""Create the component.
|
|
1982
|
+
|
|
1983
|
+
Args:
|
|
1984
|
+
*children: The children of the component.
|
|
1985
|
+
cx: The x position of the center of the ellipse.
|
|
1986
|
+
cy: The y position of the center of the ellipse.
|
|
1987
|
+
rx: The radius of the ellipse on the x axis.
|
|
1988
|
+
ry: The radius of the ellipse on the y axis.
|
|
1989
|
+
path_length: The total length for the ellipse's circumference, in user units.
|
|
1990
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
1991
|
+
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
1992
|
+
content_editable: Indicates whether the element's content is editable.
|
|
1993
|
+
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
1994
|
+
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
1995
|
+
draggable: Defines whether the element can be dragged.
|
|
1996
|
+
enter_key_hint: Hints what media types the media element is able to play.
|
|
1997
|
+
hidden: Defines whether the element is hidden.
|
|
1998
|
+
input_mode: Defines the type of the element.
|
|
1999
|
+
item_prop: Defines the name of the element for metadata purposes.
|
|
2000
|
+
lang: Defines the language used in the element.
|
|
2001
|
+
role: Defines the role of the element.
|
|
2002
|
+
slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
2003
|
+
spell_check: Defines whether the element may be checked for spelling errors.
|
|
2004
|
+
tab_index: Defines the position of the current element in the tabbing order.
|
|
2005
|
+
title: Defines a tooltip for the element.
|
|
2006
|
+
style: The style of the component.
|
|
2007
|
+
key: A unique key for the component.
|
|
2008
|
+
id: The id for the component.
|
|
2009
|
+
class_name: The class name for the component.
|
|
2010
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
2011
|
+
custom_attrs: custom attribute
|
|
2012
|
+
**props: The props of the component.
|
|
2013
|
+
|
|
2014
|
+
Returns:
|
|
2015
|
+
The component.
|
|
2016
|
+
"""
|
|
2017
|
+
...
|
|
2018
|
+
|
|
1667
2019
|
class Rect(BaseHTML):
|
|
1668
2020
|
@overload
|
|
1669
2021
|
@classmethod
|
|
@@ -2120,6 +2472,130 @@ class LinearGradient(BaseHTML):
|
|
|
2120
2472
|
"""
|
|
2121
2473
|
...
|
|
2122
2474
|
|
|
2475
|
+
class RadialGradient(BaseHTML):
|
|
2476
|
+
@overload
|
|
2477
|
+
@classmethod
|
|
2478
|
+
def create( # type: ignore
|
|
2479
|
+
cls,
|
|
2480
|
+
*children,
|
|
2481
|
+
cx: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2482
|
+
cy: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2483
|
+
fr: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2484
|
+
fx: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2485
|
+
fy: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2486
|
+
gradient_units: Optional[Union[Var[Union[bool, str]], bool, str]] = None,
|
|
2487
|
+
gradient_transform: Optional[Union[Var[Union[bool, str]], bool, str]] = None,
|
|
2488
|
+
r: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2489
|
+
spread_method: Optional[Union[Var[Union[bool, str]], bool, str]] = None,
|
|
2490
|
+
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2491
|
+
auto_capitalize: Optional[
|
|
2492
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
2493
|
+
] = None,
|
|
2494
|
+
content_editable: Optional[
|
|
2495
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
2496
|
+
] = None,
|
|
2497
|
+
context_menu: Optional[
|
|
2498
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
2499
|
+
] = None,
|
|
2500
|
+
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2501
|
+
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2502
|
+
enter_key_hint: Optional[
|
|
2503
|
+
Union[Var[Union[bool, int, str]], bool, int, str]
|
|
2504
|
+
] = None,
|
|
2505
|
+
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2506
|
+
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2507
|
+
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2508
|
+
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2509
|
+
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2510
|
+
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2511
|
+
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2512
|
+
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2513
|
+
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
|
2514
|
+
style: Optional[Style] = None,
|
|
2515
|
+
key: Optional[Any] = None,
|
|
2516
|
+
id: Optional[Any] = None,
|
|
2517
|
+
class_name: Optional[Any] = None,
|
|
2518
|
+
autofocus: Optional[bool] = None,
|
|
2519
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
2520
|
+
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
2521
|
+
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
2522
|
+
on_context_menu: Optional[
|
|
2523
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2524
|
+
] = None,
|
|
2525
|
+
on_double_click: Optional[
|
|
2526
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2527
|
+
] = None,
|
|
2528
|
+
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
2529
|
+
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
2530
|
+
on_mouse_down: Optional[
|
|
2531
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2532
|
+
] = None,
|
|
2533
|
+
on_mouse_enter: Optional[
|
|
2534
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2535
|
+
] = None,
|
|
2536
|
+
on_mouse_leave: Optional[
|
|
2537
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2538
|
+
] = None,
|
|
2539
|
+
on_mouse_move: Optional[
|
|
2540
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2541
|
+
] = None,
|
|
2542
|
+
on_mouse_out: Optional[
|
|
2543
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2544
|
+
] = None,
|
|
2545
|
+
on_mouse_over: Optional[
|
|
2546
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2547
|
+
] = None,
|
|
2548
|
+
on_mouse_up: Optional[
|
|
2549
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2550
|
+
] = None,
|
|
2551
|
+
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
2552
|
+
on_unmount: Optional[
|
|
2553
|
+
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
2554
|
+
] = None,
|
|
2555
|
+
**props,
|
|
2556
|
+
) -> "RadialGradient":
|
|
2557
|
+
"""Create the component.
|
|
2558
|
+
|
|
2559
|
+
Args:
|
|
2560
|
+
*children: The children of the component.
|
|
2561
|
+
cx: The x coordinate of the end circle of the radial gradient.
|
|
2562
|
+
cy: The y coordinate of the end circle of the radial gradient.
|
|
2563
|
+
fr: The radius of the start circle of the radial gradient.
|
|
2564
|
+
fx: The x coordinate of the start circle of the radial gradient.
|
|
2565
|
+
fy: The y coordinate of the start circle of the radial gradient.
|
|
2566
|
+
gradient_units: Units for the gradient.
|
|
2567
|
+
gradient_transform: Transform applied to the gradient.
|
|
2568
|
+
r: The radius of the end circle of the radial gradient.
|
|
2569
|
+
spread_method: Method used to spread the gradient.
|
|
2570
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
2571
|
+
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
2572
|
+
content_editable: Indicates whether the element's content is editable.
|
|
2573
|
+
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
2574
|
+
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
2575
|
+
draggable: Defines whether the element can be dragged.
|
|
2576
|
+
enter_key_hint: Hints what media types the media element is able to play.
|
|
2577
|
+
hidden: Defines whether the element is hidden.
|
|
2578
|
+
input_mode: Defines the type of the element.
|
|
2579
|
+
item_prop: Defines the name of the element for metadata purposes.
|
|
2580
|
+
lang: Defines the language used in the element.
|
|
2581
|
+
role: Defines the role of the element.
|
|
2582
|
+
slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
2583
|
+
spell_check: Defines whether the element may be checked for spelling errors.
|
|
2584
|
+
tab_index: Defines the position of the current element in the tabbing order.
|
|
2585
|
+
title: Defines a tooltip for the element.
|
|
2586
|
+
style: The style of the component.
|
|
2587
|
+
key: A unique key for the component.
|
|
2588
|
+
id: The id for the component.
|
|
2589
|
+
class_name: The class name for the component.
|
|
2590
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
2591
|
+
custom_attrs: custom attribute
|
|
2592
|
+
**props: The props of the component.
|
|
2593
|
+
|
|
2594
|
+
Returns:
|
|
2595
|
+
The component.
|
|
2596
|
+
"""
|
|
2597
|
+
...
|
|
2598
|
+
|
|
2123
2599
|
class Stop(BaseHTML):
|
|
2124
2600
|
@overload
|
|
2125
2601
|
@classmethod
|
|
@@ -2345,12 +2821,16 @@ class Path(BaseHTML):
|
|
|
2345
2821
|
...
|
|
2346
2822
|
|
|
2347
2823
|
class SVG(ComponentNamespace):
|
|
2824
|
+
text = staticmethod(Text.create)
|
|
2825
|
+
line = staticmethod(Line.create)
|
|
2348
2826
|
circle = staticmethod(Circle.create)
|
|
2827
|
+
ellipse = staticmethod(Ellipse.create)
|
|
2349
2828
|
rect = staticmethod(Rect.create)
|
|
2350
2829
|
polygon = staticmethod(Polygon.create)
|
|
2351
2830
|
path = staticmethod(Path.create)
|
|
2352
2831
|
stop = staticmethod(Stop.create)
|
|
2353
2832
|
linear_gradient = staticmethod(LinearGradient.create)
|
|
2833
|
+
radial_gradient = staticmethod(RadialGradient.create)
|
|
2354
2834
|
defs = staticmethod(Defs.create)
|
|
2355
2835
|
|
|
2356
2836
|
@staticmethod
|
reflex/config.py
CHANGED
|
@@ -6,7 +6,8 @@ import importlib
|
|
|
6
6
|
import os
|
|
7
7
|
import sys
|
|
8
8
|
import urllib.parse
|
|
9
|
-
from
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Any, Dict, List, Optional, Set, Union
|
|
10
11
|
|
|
11
12
|
try:
|
|
12
13
|
import pydantic.v1 as pydantic
|
|
@@ -188,7 +189,7 @@ class Config(Base):
|
|
|
188
189
|
telemetry_enabled: bool = True
|
|
189
190
|
|
|
190
191
|
# The bun path
|
|
191
|
-
bun_path: str = constants.Bun.DEFAULT_PATH
|
|
192
|
+
bun_path: Union[str, Path] = constants.Bun.DEFAULT_PATH
|
|
192
193
|
|
|
193
194
|
# List of origins that are allowed to connect to the backend API.
|
|
194
195
|
cors_allowed_origins: List[str] = ["*"]
|
reflex/constants/base.py
CHANGED
|
@@ -6,6 +6,7 @@ import os
|
|
|
6
6
|
import platform
|
|
7
7
|
from enum import Enum
|
|
8
8
|
from importlib import metadata
|
|
9
|
+
from pathlib import Path
|
|
9
10
|
from types import SimpleNamespace
|
|
10
11
|
|
|
11
12
|
from platformdirs import PlatformDirs
|
|
@@ -66,18 +67,19 @@ class Reflex(SimpleNamespace):
|
|
|
66
67
|
# Get directory value from enviroment variables if it exists.
|
|
67
68
|
_dir = os.environ.get("REFLEX_DIR", "")
|
|
68
69
|
|
|
69
|
-
DIR =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
DIR = Path(
|
|
71
|
+
_dir
|
|
72
|
+
or (
|
|
73
|
+
# on windows, we use C:/Users/<username>/AppData/Local/reflex.
|
|
74
|
+
# on macOS, we use ~/Library/Application Support/reflex.
|
|
75
|
+
# on linux, we use ~/.local/share/reflex.
|
|
76
|
+
# If user sets REFLEX_DIR envroment variable use that instead.
|
|
77
|
+
PlatformDirs(MODULE_NAME, False).user_data_dir
|
|
78
|
+
)
|
|
75
79
|
)
|
|
76
80
|
# The root directory of the reflex library.
|
|
77
81
|
|
|
78
|
-
ROOT_DIR =
|
|
79
|
-
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
80
|
-
)
|
|
82
|
+
ROOT_DIR = Path(__file__).parents[2]
|
|
81
83
|
|
|
82
84
|
RELEASES_URL = f"https://api.github.com/repos/reflex-dev/templates/releases"
|
|
83
85
|
|
|
@@ -125,11 +127,11 @@ class Templates(SimpleNamespace):
|
|
|
125
127
|
"""Folders used by the template system of Reflex."""
|
|
126
128
|
|
|
127
129
|
# The template directory used during reflex init.
|
|
128
|
-
BASE =
|
|
130
|
+
BASE = Reflex.ROOT_DIR / Reflex.MODULE_NAME / ".templates"
|
|
129
131
|
# The web subdirectory of the template directory.
|
|
130
|
-
WEB_TEMPLATE =
|
|
132
|
+
WEB_TEMPLATE = BASE / "web"
|
|
131
133
|
# The jinja template directory.
|
|
132
|
-
JINJA_TEMPLATE =
|
|
134
|
+
JINJA_TEMPLATE = BASE / "jinja"
|
|
133
135
|
# Where the code for the templates is stored.
|
|
134
136
|
CODE = "code"
|
|
135
137
|
|
|
@@ -191,6 +193,14 @@ class LogLevel(str, Enum):
|
|
|
191
193
|
levels = list(LogLevel)
|
|
192
194
|
return levels.index(self) <= levels.index(other)
|
|
193
195
|
|
|
196
|
+
def subprocess_level(self):
|
|
197
|
+
"""Return the log level for the subprocess.
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
The log level for the subprocess
|
|
201
|
+
"""
|
|
202
|
+
return self if self != LogLevel.DEFAULT else LogLevel.WARNING
|
|
203
|
+
|
|
194
204
|
|
|
195
205
|
# Server socket configuration variables
|
|
196
206
|
POLLING_MAX_HTTP_BUFFER_SIZE = 1000 * 1000
|
reflex/constants/config.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Config constants."""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from types import SimpleNamespace
|
|
5
6
|
|
|
6
7
|
from reflex.constants.base import Dirs, Reflex
|
|
@@ -17,9 +18,7 @@ class Config(SimpleNamespace):
|
|
|
17
18
|
# The name of the reflex config module.
|
|
18
19
|
MODULE = "rxconfig"
|
|
19
20
|
# The python config file.
|
|
20
|
-
FILE = f"{MODULE}{Ext.PY}"
|
|
21
|
-
# The previous config file.
|
|
22
|
-
PREVIOUS_FILE = f"pcconfig{Ext.PY}"
|
|
21
|
+
FILE = Path(f"{MODULE}{Ext.PY}")
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
class Expiration(SimpleNamespace):
|
|
@@ -37,7 +36,7 @@ class GitIgnore(SimpleNamespace):
|
|
|
37
36
|
"""Gitignore constants."""
|
|
38
37
|
|
|
39
38
|
# The gitignore file.
|
|
40
|
-
FILE = ".gitignore"
|
|
39
|
+
FILE = Path(".gitignore")
|
|
41
40
|
# Files to gitignore.
|
|
42
41
|
DEFAULTS = {Dirs.WEB, "*.db", "__pycache__/", "*.py[cod]", "assets/external/"}
|
|
43
42
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from pathlib import Path
|
|
5
6
|
from types import SimpleNamespace
|
|
6
7
|
|
|
7
8
|
|
|
@@ -11,9 +12,9 @@ class CustomComponents(SimpleNamespace):
|
|
|
11
12
|
# The name of the custom components source directory.
|
|
12
13
|
SRC_DIR = "custom_components"
|
|
13
14
|
# The name of the custom components pyproject.toml file.
|
|
14
|
-
PYPROJECT_TOML = "pyproject.toml"
|
|
15
|
+
PYPROJECT_TOML = Path("pyproject.toml")
|
|
15
16
|
# The name of the custom components package README file.
|
|
16
|
-
PACKAGE_README = "README.md"
|
|
17
|
+
PACKAGE_README = Path("README.md")
|
|
17
18
|
# The name of the custom components package .gitignore file.
|
|
18
19
|
PACKAGE_GITIGNORE = ".gitignore"
|
|
19
20
|
# The name of the distribution directory as result of a build.
|
|
@@ -29,6 +30,6 @@ class CustomComponents(SimpleNamespace):
|
|
|
29
30
|
"testpypi": "https://test.pypi.org/legacy/",
|
|
30
31
|
}
|
|
31
32
|
# The .gitignore file for the custom component project.
|
|
32
|
-
FILE = ".gitignore"
|
|
33
|
+
FILE = Path(".gitignore")
|
|
33
34
|
# Files to gitignore.
|
|
34
35
|
DEFAULTS = {"__pycache__/", "*.py[cod]", "*.egg-info/", "dist/"}
|