diff --git a/pyi_hashes.json b/pyi_hashes.json index f2fd6d1dbd9..a9df4b46e03 100644 --- a/pyi_hashes.json +++ b/pyi_hashes.json @@ -2,124 +2,124 @@ "reflex/__init__.pyi": "d7767c4fe815246a4409359da60aac25", "reflex/components/__init__.pyi": "76ba0a12cd3a7ba5ab6341a3ae81551f", "reflex/components/base/__init__.pyi": "e9aaf47be1e1977eacee97b880c8f7de", - "reflex/components/base/app_wrap.pyi": "1d0e224e2d4b0538b19c0a038284e9b2", - "reflex/components/base/body.pyi": "7ff1b147ac3d258aeb6d9c7ce381eb82", - "reflex/components/base/document.pyi": "dc29604ddaaffd9dd36ba3c7993000f6", - "reflex/components/base/error_boundary.pyi": "0c30c8470d2cf0781615fc0f5a0ca13c", - "reflex/components/base/fragment.pyi": "6bcf174f5acb14de3fa9c15d8c124c72", - "reflex/components/base/head.pyi": "403d91ad9e41c9b6dcd5c881021b7f61", - "reflex/components/base/link.pyi": "16d81cd54a30394135e72f2097c68a6a", - "reflex/components/base/meta.pyi": "f89d732117cedc39fef771d002dd4da6", - "reflex/components/base/script.pyi": "df2972de2b71ec43a8077c873b2edbf2", - "reflex/components/base/strict_mode.pyi": "13d91eb9ac0a097c20f95cd3aaa2e703", + "reflex/components/base/app_wrap.pyi": "1f0cd142822141d41af8e7c36effd581", + "reflex/components/base/body.pyi": "0c026d10ed92ba378365215a8e56c668", + "reflex/components/base/document.pyi": "38f0fc5353e40c8339686334fd3f562f", + "reflex/components/base/error_boundary.pyi": "b659c4444b06db726542f8d0b17ac40f", + "reflex/components/base/fragment.pyi": "44b703a88d78c430a1600f13277dac5d", + "reflex/components/base/head.pyi": "e640ac465c346e1313e6ec4a4de3cc42", + "reflex/components/base/link.pyi": "22cf7f85347b86ec0aad1510bd841d35", + "reflex/components/base/meta.pyi": "2a138fe7738019cd90497a90f2d5f6d9", + "reflex/components/base/script.pyi": "d7fb00fabc3743ff4da6553048a02e6c", + "reflex/components/base/strict_mode.pyi": "33d9031f5e8ebd1c7379327d8d5d00d9", "reflex/components/core/__init__.pyi": "44bcee7bc4e27e2f4f4707b843acf291", - "reflex/components/core/auto_scroll.pyi": "6f8a2089b8810e08ff1609c616b9e1b1", - "reflex/components/core/banner.pyi": "1608a30ac68b749c13ba38d8088b3d1b", - "reflex/components/core/client_side_routing.pyi": "dd0bfc63117ef5f214e3c66dfc4ff1a2", - "reflex/components/core/clipboard.pyi": "8ef2e904caeceb9ce386f9938ab00269", - "reflex/components/core/debounce.pyi": "a6416b52e2857994861f6f90e2f29391", - "reflex/components/core/html.pyi": "d49588c2f04191cbbf1b4ac1c0bf855d", - "reflex/components/core/sticky.pyi": "6c7d85617f8e85f2aacc6aef90b553a5", - "reflex/components/core/upload.pyi": "aae4f9a95ad5b6f8c596508145839473", + "reflex/components/core/auto_scroll.pyi": "273f7a2f5a6dbdb0a42f3dce0e56e4d4", + "reflex/components/core/banner.pyi": "c77d4b096bac886deea3c0b3c11cbb72", + "reflex/components/core/client_side_routing.pyi": "f76487635bd59ebc8fa7ef095e3d88f8", + "reflex/components/core/clipboard.pyi": "fe540b1761298d1643b1515abca1b1e5", + "reflex/components/core/debounce.pyi": "e063346baf0bc9ed44a12d52cd748f1d", + "reflex/components/core/html.pyi": "e8643bd2644cda1c4ff9ba276a3173f8", + "reflex/components/core/sticky.pyi": "d2597ef9fc6fd8f63be808982b3c2a96", + "reflex/components/core/upload.pyi": "3beaaeb4247808d32bf61014a9b56a9e", "reflex/components/datadisplay/__init__.pyi": "cf087efa8b3960decc6b231cc986cfa9", - "reflex/components/datadisplay/code.pyi": "651fc3d417b998eb1c3d072328f505d0", - "reflex/components/datadisplay/dataeditor.pyi": "601c59f3ced6ab94fcf5527b90472a4f", - "reflex/components/datadisplay/shiki_code_block.pyi": "ac16fd6c23eef7ce0185437ecf2d529d", + "reflex/components/datadisplay/code.pyi": "a35df043c14dcfbd391f210d1058deba", + "reflex/components/datadisplay/dataeditor.pyi": "649df2e6f58fc2273d28ae50c0260d74", + "reflex/components/datadisplay/shiki_code_block.pyi": "2ab608fcf03ae0ce8d19c08ce9588220", "reflex/components/el/__init__.pyi": "f07f5957ca4dc3d95ffdc2ddb75fe2f8", - "reflex/components/el/element.pyi": "323cfb5d67d8ccb58ac36c7cc7641dc3", + "reflex/components/el/element.pyi": "56c029421b35ac7ea29ba549f78bb7ea", "reflex/components/el/elements/__init__.pyi": "baeddd04d4d3a82799420b2a6df368f6", - "reflex/components/el/elements/base.pyi": "697cd6716e3b1127b35299435c3d4e69", - "reflex/components/el/elements/forms.pyi": "14f2ac656d37c4a5343c77e89ad9107b", - "reflex/components/el/elements/inline.pyi": "ab31eec758f1cff8a9d51bf0935b9fca", - "reflex/components/el/elements/media.pyi": "c191a9e00223a97e26a0d6ab99a1919b", - "reflex/components/el/elements/metadata.pyi": "eda94a3283bae6a9b61b4cb1e20c1dbd", - "reflex/components/el/elements/other.pyi": "960bdac0bb9bf6b3cffd241f9b66c0fc", - "reflex/components/el/elements/scripts.pyi": "ac3b8bfbd7777f33fb2c6aa109a5c627", - "reflex/components/el/elements/sectioning.pyi": "5911a1ce4e0a7b9d34b3f23f0fb71203", - "reflex/components/el/elements/tables.pyi": "a23c6d394ef791a1d2ccde2c77c6b1fe", - "reflex/components/el/elements/typography.pyi": "186112efd85bffad2351ea1428efa461", - "reflex/components/gridjs/datatable.pyi": "c60688d31e28d85dbcafee33725abfa3", - "reflex/components/lucide/icon.pyi": "775e6686e491fd46f28a00b19699db3d", - "reflex/components/markdown/markdown.pyi": "73d3116fa28450c90f25b21107285daa", - "reflex/components/moment/moment.pyi": "ab1d6618159693014fdf22b4aa84c877", - "reflex/components/next/base.pyi": "5e75245c2b0ee4715f89efaf42d101d8", - "reflex/components/next/image.pyi": "8c305c03019d37c07560c154a05bf5dd", - "reflex/components/next/link.pyi": "cc438e48a9f31bf16f1cdb6e16017477", - "reflex/components/next/video.pyi": "8f5694a4a2118c5297e2eba479b6f018", - "reflex/components/plotly/plotly.pyi": "addc41e30226783ac97dc774423fcfd1", + "reflex/components/el/elements/base.pyi": "61836f282a9d0f42d877adb8aab36685", + "reflex/components/el/elements/forms.pyi": "29a08bb089f3c473dc220d130371e511", + "reflex/components/el/elements/inline.pyi": "3926e39250855fa375bb050c32291a35", + "reflex/components/el/elements/media.pyi": "ded3991be5f160c18d5988202eeeb435", + "reflex/components/el/elements/metadata.pyi": "30a83e4263eeca71483071d4a2cc04a7", + "reflex/components/el/elements/other.pyi": "f93856a56493f39e395ccab84cc22733", + "reflex/components/el/elements/scripts.pyi": "f2b431833b27d65284768b930855302e", + "reflex/components/el/elements/sectioning.pyi": "f381a563daf2b77e6a15238ba6721b16", + "reflex/components/el/elements/tables.pyi": "bbfb553af107cb1fd9e0a7cd389be3d2", + "reflex/components/el/elements/typography.pyi": "38ddfc079da3ad50ce9b74b2a9ac2d2e", + "reflex/components/gridjs/datatable.pyi": "88f62664cdb5fdbb853a269b8c5f026b", + "reflex/components/lucide/icon.pyi": "cf394db2be1e9ccf7f4b6b6d459c6254", + "reflex/components/markdown/markdown.pyi": "49aa63a67e895c631abb15fcdc8dbded", + "reflex/components/moment/moment.pyi": "5a1d985e6c6af1cedb4e562559dca740", + "reflex/components/next/base.pyi": "2a808cddd09a0e7ec897b69c4c003197", + "reflex/components/next/image.pyi": "12b9b5a309dea23dd92a92f23f7d8e6b", + "reflex/components/next/link.pyi": "c4ad5f70c65425afb7841f35105121c2", + "reflex/components/next/video.pyi": "f77203423e446d914c191ae0f148891e", + "reflex/components/plotly/plotly.pyi": "87c1d12b049ac4c16a4038a5db345727", "reflex/components/radix/__init__.pyi": "8d586cbff1d7130d09476ac72ee73400", "reflex/components/radix/primitives/__init__.pyi": "fe8715decf3e9ae471b56bba14e42cb3", - "reflex/components/radix/primitives/accordion.pyi": "a31599f0b2a1a69a10917137dcb75a9d", - "reflex/components/radix/primitives/base.pyi": "fc910c9bd364b57e1c092fbf8889158d", - "reflex/components/radix/primitives/drawer.pyi": "8f20bac0e36266398be1a124218bda87", - "reflex/components/radix/primitives/form.pyi": "efd2ec67535eb1b1eefaafc0d5e36d8a", - "reflex/components/radix/primitives/progress.pyi": "98b4add410a80a353ab503ad577169c2", - "reflex/components/radix/primitives/slider.pyi": "573837a7d8d90deaf57c911faffed254", + "reflex/components/radix/primitives/accordion.pyi": "4c943a2430e7b3a1d23c0f58998c5bb6", + "reflex/components/radix/primitives/base.pyi": "599b007d07a87b6934b48b5c22d2d528", + "reflex/components/radix/primitives/drawer.pyi": "a0be6607b29f5c3bba9270d5c4b3236d", + "reflex/components/radix/primitives/form.pyi": "1c8cd40f2663fb5caa250f2685a82908", + "reflex/components/radix/primitives/progress.pyi": "d1e6cdd7ceadd407a4022594307062f3", + "reflex/components/radix/primitives/slider.pyi": "5c4628c4157ecb05ac9346b1c2541c37", "reflex/components/radix/themes/__init__.pyi": "a15f9464ad99f248249ffa8e6deea4cf", - "reflex/components/radix/themes/base.pyi": "526db93a3f52bb00ad220f8744eba797", - "reflex/components/radix/themes/color_mode.pyi": "f7515dccd1e315dc28a3cbbe2eabe7ff", + "reflex/components/radix/themes/base.pyi": "a264cb175ca0925008812cc76843f0b7", + "reflex/components/radix/themes/color_mode.pyi": "87cf2232176b7da81a404f89b356bf4b", "reflex/components/radix/themes/components/__init__.pyi": "87bb9ffff641928562da1622d2ca5993", - "reflex/components/radix/themes/components/alert_dialog.pyi": "3832f3e8a6a3eed1bfa969efea627b72", - "reflex/components/radix/themes/components/aspect_ratio.pyi": "f90aa46ef8b29bd076d98321de96315a", - "reflex/components/radix/themes/components/avatar.pyi": "d40e8e25a9c007f2554590abd116a095", - "reflex/components/radix/themes/components/badge.pyi": "422c4d1586e6b22d00a2d5f002989651", - "reflex/components/radix/themes/components/button.pyi": "fc5c290d6df9b5197c65036c9edafa38", - "reflex/components/radix/themes/components/callout.pyi": "f81f5032d90e36705fd5b5ba30d3f3ab", - "reflex/components/radix/themes/components/card.pyi": "fdf71624bdeeba391d1c0545039dd2e7", - "reflex/components/radix/themes/components/checkbox.pyi": "006614845a236f6611c656c05a8db394", - "reflex/components/radix/themes/components/checkbox_cards.pyi": "289d0fd448f654e17f3132234e9d4983", - "reflex/components/radix/themes/components/checkbox_group.pyi": "8eb8cca3e0c5885150576cc60ba19fea", - "reflex/components/radix/themes/components/context_menu.pyi": "5f178adef09c0f36103e33b11326cb2a", - "reflex/components/radix/themes/components/data_list.pyi": "4014ea23eec39cfe98032852665a92ca", - "reflex/components/radix/themes/components/dialog.pyi": "8dc1a09d30aff2fcf28e28988fca170f", - "reflex/components/radix/themes/components/dropdown_menu.pyi": "0cd87cddbe9a83dcfa9cbcc4f9d98dd4", - "reflex/components/radix/themes/components/hover_card.pyi": "973a4911f68cec60f40a8e2ca5e42770", - "reflex/components/radix/themes/components/icon_button.pyi": "55e0b8c8233d1e5a52a8c09c959e4989", - "reflex/components/radix/themes/components/inset.pyi": "a215de3b29b2133626cbfc83544305fe", - "reflex/components/radix/themes/components/popover.pyi": "1fa6f96aef6f148f110fa208aa449ab7", - "reflex/components/radix/themes/components/progress.pyi": "1d0f827e8db089418b2786f82d55512d", - "reflex/components/radix/themes/components/radio.pyi": "a8fcc63bf42129196d70a9571647d4bb", - "reflex/components/radix/themes/components/radio_cards.pyi": "b5222b86e418920de2ef988752f0b577", - "reflex/components/radix/themes/components/radio_group.pyi": "7b95ee1fcd41186f2c7670be273d134f", - "reflex/components/radix/themes/components/scroll_area.pyi": "28352b03135ef2065876a5199b9c150a", - "reflex/components/radix/themes/components/segmented_control.pyi": "0477ee74033ed0f67cd2cb94a47ccea9", - "reflex/components/radix/themes/components/select.pyi": "9c63eb11bab2d2913431ec0c13111b6d", - "reflex/components/radix/themes/components/separator.pyi": "f8c9c18ea7f67e8287f4ebc5c09790b5", - "reflex/components/radix/themes/components/skeleton.pyi": "aeff3cbc53989c4824a5e49e9ea3bbca", - "reflex/components/radix/themes/components/slider.pyi": "242e107d73ec14d984cb88fa8f23ad68", - "reflex/components/radix/themes/components/spinner.pyi": "5050ba710b0c950c29f69cafd93f6c4f", - "reflex/components/radix/themes/components/switch.pyi": "61729a28148bc17acd20e48c12f60a54", - "reflex/components/radix/themes/components/table.pyi": "81c77cecf78ddb3e931c9a5f0f8eccde", - "reflex/components/radix/themes/components/tabs.pyi": "6facf7ebd344f8995934a167af01a9e5", - "reflex/components/radix/themes/components/text_area.pyi": "4d5c343f24c71d89f3cb96c63cf9fc3a", - "reflex/components/radix/themes/components/text_field.pyi": "92552297cc747dd3aae6f382699e319d", - "reflex/components/radix/themes/components/tooltip.pyi": "5e17b67e50410f1124d2150237eab7cf", + "reflex/components/radix/themes/components/alert_dialog.pyi": "0e6155efdb5620d203d27d4f7f2e4a10", + "reflex/components/radix/themes/components/aspect_ratio.pyi": "524d2ddf9cccbc00863c9c9454116f37", + "reflex/components/radix/themes/components/avatar.pyi": "ae2ad0ef281edee9a9bb9bbf512a65ef", + "reflex/components/radix/themes/components/badge.pyi": "0df3005b8f066c54f752b55dadf9a2d9", + "reflex/components/radix/themes/components/button.pyi": "200354cd6ce26abee8d8835d2d856347", + "reflex/components/radix/themes/components/callout.pyi": "5407a3e5958db6fb19eff1476baf6d7e", + "reflex/components/radix/themes/components/card.pyi": "a2ac6ab180a6a5faeba714610bf27be1", + "reflex/components/radix/themes/components/checkbox.pyi": "083cc28ce176222caef7f0e03ae3413d", + "reflex/components/radix/themes/components/checkbox_cards.pyi": "de6cd3836516874d0f9aeaf6535d58be", + "reflex/components/radix/themes/components/checkbox_group.pyi": "7ecb2582245e2d16a2b25e3d608385d5", + "reflex/components/radix/themes/components/context_menu.pyi": "be3d8e50c7b243d84eb2c58a55518966", + "reflex/components/radix/themes/components/data_list.pyi": "0144c3253dbe1ece306ad74f70e00e36", + "reflex/components/radix/themes/components/dialog.pyi": "11a6d7b4d245a515136de48284b37b4b", + "reflex/components/radix/themes/components/dropdown_menu.pyi": "e8df72cff2a4546c903feebc76d36040", + "reflex/components/radix/themes/components/hover_card.pyi": "47117ae8af18b82ec77345150141ab41", + "reflex/components/radix/themes/components/icon_button.pyi": "9dcd31156160f18456a50d3164ae8b07", + "reflex/components/radix/themes/components/inset.pyi": "30202f3553cf735f22f7fbe406501571", + "reflex/components/radix/themes/components/popover.pyi": "0c7efeb292eaa30c3a7f2f3fd9910df1", + "reflex/components/radix/themes/components/progress.pyi": "159c12edacfffbf0d63db9d04c5fd8fc", + "reflex/components/radix/themes/components/radio.pyi": "ad6c041c77f3f71b2d57a62b30a52b71", + "reflex/components/radix/themes/components/radio_cards.pyi": "51f479136ea820a4fbde2d668cd33872", + "reflex/components/radix/themes/components/radio_group.pyi": "e14b8a171ab0000c5d38724c16511dee", + "reflex/components/radix/themes/components/scroll_area.pyi": "7401abb5f45a6e9f30bb0534a95da735", + "reflex/components/radix/themes/components/segmented_control.pyi": "dc8fa759218511f7e08c70d4ac4fa100", + "reflex/components/radix/themes/components/select.pyi": "9cd806aa14bd8957db176fa3076fcdc1", + "reflex/components/radix/themes/components/separator.pyi": "e30c17ca9b0df4e2f5c6c7b556ef8f04", + "reflex/components/radix/themes/components/skeleton.pyi": "e63059dd1f8e46ed5f75f914be5ac382", + "reflex/components/radix/themes/components/slider.pyi": "b62d4f7156c3318e7c7519c50332f075", + "reflex/components/radix/themes/components/spinner.pyi": "98394c7950f165d28ed95e2c56fe0e80", + "reflex/components/radix/themes/components/switch.pyi": "cd9a97ef2874699f4d6ee7975d780ef9", + "reflex/components/radix/themes/components/table.pyi": "d5e233293d79f461fc06fa18780e2350", + "reflex/components/radix/themes/components/tabs.pyi": "3c0c9d30a0dff6a5688f837cb732ab42", + "reflex/components/radix/themes/components/text_area.pyi": "529cc42797d46c46c48456726d10f9d0", + "reflex/components/radix/themes/components/text_field.pyi": "9fbc765955fb7c0342010544edeb973e", + "reflex/components/radix/themes/components/tooltip.pyi": "d1e06545c625ac2ab202d45f827ff93b", "reflex/components/radix/themes/layout/__init__.pyi": "9a52c5b283c864be70b51a8fd6120392", - "reflex/components/radix/themes/layout/base.pyi": "6a255a392bf0d54c924c26e673248971", - "reflex/components/radix/themes/layout/box.pyi": "731cc26fc41d2b174ed4e901f5292479", - "reflex/components/radix/themes/layout/center.pyi": "e0592f33bdec5586a7377ca986f1a966", - "reflex/components/radix/themes/layout/container.pyi": "3c5ddf03873da9bf0f5308d5d6429097", - "reflex/components/radix/themes/layout/flex.pyi": "8d8cfd4f00e21aac8d165ded0f7c600f", - "reflex/components/radix/themes/layout/grid.pyi": "412f164266f810671cf38ca5e50d9cfd", - "reflex/components/radix/themes/layout/list.pyi": "32ce23a3f851698ac0d609e616bd3605", - "reflex/components/radix/themes/layout/section.pyi": "2904116ccc24dcb66285ff2daaac1875", - "reflex/components/radix/themes/layout/spacer.pyi": "3def4df36e8eecdfba0a7d2f1890b908", - "reflex/components/radix/themes/layout/stack.pyi": "b7ec458d254cd09058ca805d553199da", + "reflex/components/radix/themes/layout/base.pyi": "0b6cd62ff88d4462e916217a21bf7eb6", + "reflex/components/radix/themes/layout/box.pyi": "714547c559783b15a5fdb3300992ffa6", + "reflex/components/radix/themes/layout/center.pyi": "505e94aa6a748ff43b985c9c27644cd2", + "reflex/components/radix/themes/layout/container.pyi": "5aa9bff67b100db68d889c5701af1f73", + "reflex/components/radix/themes/layout/flex.pyi": "5e106ca4ecacdf3248fcb0fea237c5a6", + "reflex/components/radix/themes/layout/grid.pyi": "9a73ee691ba33032a5f1f72a385dc917", + "reflex/components/radix/themes/layout/list.pyi": "59ca4d03c5b1eb6e336e5d61a05b8d24", + "reflex/components/radix/themes/layout/section.pyi": "93d76b871cef63963cefdb40a40e09be", + "reflex/components/radix/themes/layout/spacer.pyi": "61dabfe89e842a7660d8ded6f52a8021", + "reflex/components/radix/themes/layout/stack.pyi": "8cef9d5bff3cb4b4e8412cde50d1b791", "reflex/components/radix/themes/typography/__init__.pyi": "ef0ba71353dcac1f3546de45f8721bae", - "reflex/components/radix/themes/typography/blockquote.pyi": "fdd2214a8416bcd4ba644a0bd0015c5a", - "reflex/components/radix/themes/typography/code.pyi": "2e0b487ed1128422bfc4105928dbb18a", - "reflex/components/radix/themes/typography/heading.pyi": "bec5af8f72e3c0a764d77e16608da4a1", - "reflex/components/radix/themes/typography/link.pyi": "196d6ef6c1a15f2d7180a973e8753ea5", - "reflex/components/radix/themes/typography/text.pyi": "33f91de2a0ae94e5802e7c8f0971b1df", - "reflex/components/react_player/audio.pyi": "231e9338b19330a6963928f7e90cb40f", - "reflex/components/react_player/react_player.pyi": "40db798bcb7fa40207d24f49722135ae", - "reflex/components/react_player/video.pyi": "f92885d49cdc565b95b20820d09e2ca2", + "reflex/components/radix/themes/typography/blockquote.pyi": "ceaa17654cb175f7f4da881da0a6e51e", + "reflex/components/radix/themes/typography/code.pyi": "79a16e45df2cb43fd85bb4693302c645", + "reflex/components/radix/themes/typography/heading.pyi": "109b884ba5f44ade3b1a10a1de5bfd43", + "reflex/components/radix/themes/typography/link.pyi": "3dbf0b397e337104a7daad73645ed0ec", + "reflex/components/radix/themes/typography/text.pyi": "deab2b8d5fe12aac1b7a1ef70ec863c7", + "reflex/components/react_player/audio.pyi": "940a1a0c2592a398895604c98577333b", + "reflex/components/react_player/react_player.pyi": "48d2903a4beabafad7c821433c61f816", + "reflex/components/react_player/video.pyi": "91c5c6a2784926398b5a30da80705789", "reflex/components/recharts/__init__.pyi": "a060a4abcd018165bc499173e723cf9e", - "reflex/components/recharts/cartesian.pyi": "934cbaeade6c4915bbde5805a98178bf", - "reflex/components/recharts/charts.pyi": "37a33bffd8cc340bd0ef64282448fbe0", - "reflex/components/recharts/general.pyi": "06d0e97776cc82b946fed465ab36fba4", - "reflex/components/recharts/polar.pyi": "2f81fcda34e8455f57f296d9699cf469", - "reflex/components/recharts/recharts.pyi": "bbaec232c2da035b31b5d0e3888f4801", - "reflex/components/sonner/toast.pyi": "6dc6d5d05d9a8d7d364c0326fb2e6503", - "reflex/components/suneditor/editor.pyi": "267b698bb0dd11df73f39980274858b4" + "reflex/components/recharts/cartesian.pyi": "4320a46e3b37a351beeabc091f64b10f", + "reflex/components/recharts/charts.pyi": "3bddc7fe949f2329e44db29d78812dc2", + "reflex/components/recharts/general.pyi": "5643c628bb8ed03de565323736575035", + "reflex/components/recharts/polar.pyi": "8d8394f2c35add03bb7263f9bb204cd0", + "reflex/components/recharts/recharts.pyi": "05e61639ed173cd9cd9574a0782d7f2f", + "reflex/components/sonner/toast.pyi": "092f9f15c9d9b9559ba2e30c8e186566", + "reflex/components/suneditor/editor.pyi": "fc7e39cef8228d929c1daa4b59d5067a" } diff --git a/reflex/components/component.py b/reflex/components/component.py index d2d5ff50e50..fd296367ca8 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -52,6 +52,7 @@ EventSpec, no_args_event_spec, parse_args_spec, + pointer_event_spec, run_script, unwrap_var_annotation, ) @@ -491,12 +492,12 @@ def _components_from( return () -DEFAULT_TRIGGERS: dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]] = { +DEFAULT_TRIGGERS: Mapping[str, types.ArgsSpec | Sequence[types.ArgsSpec]] = { EventTriggers.ON_FOCUS: no_args_event_spec, EventTriggers.ON_BLUR: no_args_event_spec, - EventTriggers.ON_CLICK: no_args_event_spec, - EventTriggers.ON_CONTEXT_MENU: no_args_event_spec, - EventTriggers.ON_DOUBLE_CLICK: no_args_event_spec, + EventTriggers.ON_CLICK: pointer_event_spec, # pyright: ignore [reportAssignmentType] + EventTriggers.ON_CONTEXT_MENU: pointer_event_spec, # pyright: ignore [reportAssignmentType] + EventTriggers.ON_DOUBLE_CLICK: pointer_event_spec, # pyright: ignore [reportAssignmentType] EventTriggers.ON_MOUSE_DOWN: no_args_event_spec, EventTriggers.ON_MOUSE_ENTER: no_args_event_spec, EventTriggers.ON_MOUSE_LEAVE: no_args_event_spec, @@ -884,7 +885,7 @@ def get_event_triggers(cls) -> dict[str, types.ArgsSpec | Sequence[types.ArgsSpe ) for name, field in cls.get_fields().items() if field.type_origin is EventHandler - } + } # pyright: ignore [reportOperatorIssue] def __repr__(self) -> str: """Represent the component in React. @@ -2134,7 +2135,7 @@ def fn(*args): annotation=arg._var_type, ) for name, arg in zip( - names, parse_args_spec(event.args_spec), strict=True + names, parse_args_spec(event.args_spec)[0], strict=True ) ] ) diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index 89c9dcb3f0c..9d0173203dc 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -396,7 +396,8 @@ def _update_arg_tuple_for_on_drop(cls, arg_value: tuple[Var, Var]): The updated arg_value tuple when arg is "files", otherwise the original arg_value. """ if arg_value[0]._js_expr == "files": - placeholder = parse_args_spec(_on_drop_spec)[0] + placeholders, _ = parse_args_spec(_on_drop_spec) + placeholder = placeholders[0] return (arg_value[0], placeholder) return arg_value diff --git a/reflex/event.py b/reflex/event.py index 55441d7a2e6..7d64483200c 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1,14 +1,12 @@ """Define event classes to connect the frontend and backend.""" -from __future__ import annotations - import dataclasses import inspect import types import urllib.parse from base64 import b64encode -from collections.abc import Callable, Sequence -from functools import partial +from collections.abc import Callable, Mapping, Sequence +from functools import lru_cache, partial from typing import ( TYPE_CHECKING, Annotated, @@ -16,7 +14,6 @@ Generic, NoReturn, Protocol, - TypedDict, TypeVar, get_args, get_origin, @@ -24,12 +21,12 @@ overload, ) -from typing_extensions import Self, TypeAliasType, TypeVarTuple, Unpack +from typing_extensions import Self, TypeAliasType, TypedDict, TypeVarTuple, Unpack from reflex import constants from reflex.constants.compiler import CompileVars, Hooks, Imports from reflex.constants.state import FRONTEND_EVENT_STATE -from reflex.utils import console, format +from reflex.utils import format from reflex.utils.decorator import once from reflex.utils.exceptions import ( EventFnArgMismatchError, @@ -183,6 +180,36 @@ class EventHandler(EventActionsMixin): # Empty string means this event handler is a server side event. state_full_name: str = dataclasses.field(default="") + def __hash__(self): + """Get the hash of the event handler. + + Returns: + The hash of the event handler. + """ + return hash((tuple(self.event_actions.items()), self.fn, self.state_full_name)) + + def get_parameters(self) -> Mapping[str, inspect.Parameter]: + """Get the parameters of the function. + + Returns: + The parameters of the function. + """ + if self.fn is None: + return {} + return inspect.signature(self.fn).parameters + + @property + def _parameters(self) -> Mapping[str, inspect.Parameter]: + """Get the parameters of the function. + + Returns: + The parameters of the function. + """ + if (parameters := getattr(self, "__parameters", None)) is None: + parameters = {**self.get_parameters()} + object.__setattr__(self, "__parameters", parameters) + return parameters + @classmethod def __class_getitem__(cls, args_spec: str) -> Annotated: """Get a typed EventHandler. @@ -204,7 +231,7 @@ def is_background(self) -> bool: """ return getattr(self.fn, BACKGROUND_TASK_MARKER, False) - def __call__(self, *args: Any, **kwargs: Any) -> EventSpec: + def __call__(self, *args: Any, **kwargs: Any) -> "EventSpec": """Pass arguments to the handler to get an event spec. This method configures event handlers that take in arguments. @@ -222,7 +249,7 @@ def __call__(self, *args: Any, **kwargs: Any) -> EventSpec: from reflex.utils.exceptions import EventHandlerTypeError # Get the function args. - fn_args = list(inspect.signature(self.fn).parameters)[1:] + fn_args = list(self._parameters)[1:] if not isinstance( repeated_arg := next( @@ -312,7 +339,7 @@ def __init__( object.__setattr__(self, "client_handler_name", client_handler_name) object.__setattr__(self, "args", args or ()) - def with_args(self, args: tuple[tuple[Var, Var], ...]) -> EventSpec: + def with_args(self, args: tuple[tuple[Var, Var], ...]) -> "EventSpec": """Copy the event spec, with updated args. Args: @@ -328,7 +355,7 @@ def with_args(self, args: tuple[tuple[Var, Var], ...]) -> EventSpec: event_actions=self.event_actions.copy(), ) - def add_args(self, *args: Var) -> EventSpec: + def add_args(self, *args: Var) -> "EventSpec": """Add arguments to the event spec. Args: @@ -343,9 +370,7 @@ def add_args(self, *args: Var) -> EventSpec: from reflex.utils.exceptions import EventHandlerTypeError # Get the remaining unfilled function args. - fn_args = list(inspect.signature(self.handler.fn).parameters)[ - 1 + len(self.args) : - ] + fn_args = list(self.handler._parameters)[1 + len(self.args) :] fn_args = (Var(_js_expr=arg) for arg in fn_args) # Construct the payload. @@ -421,7 +446,7 @@ def __call__(self, *args, **kwargs) -> EventSpec: class EventChain(EventActionsMixin): """Container for a chain of events that will be executed in order.""" - events: Sequence[EventSpec | EventVar | EventCallback] = dataclasses.field( + events: Sequence["EventSpec | EventVar | EventCallback"] = dataclasses.field( default_factory=list ) @@ -432,11 +457,11 @@ class EventChain(EventActionsMixin): @classmethod def create( cls, - value: EventType, + value: "EventType", args_spec: ArgsSpec | Sequence[ArgsSpec], key: str | None = None, **event_chain_kwargs, - ) -> EventChain | Var: + ) -> "EventChain | Var": """Create an event chain from a variety of input types. Args: @@ -643,6 +668,74 @@ def key_event( ) +@dataclasses.dataclass( + init=True, + frozen=True, +) +class JavascriptMouseEvent: + """Interface for a Javascript MouseEvent https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.""" + + button: int = 0 + buttons: list[int] = dataclasses.field(default_factory=list) + clientX: int = 0 # noqa: N815 + clientY: int = 0 # noqa: N815 + altKey: bool = False # noqa: N815 + ctrlKey: bool = False # noqa: N815 + metaKey: bool = False # noqa: N815 + shiftKey: bool = False # noqa: N815 + + +class JavascriptPointerEvent(JavascriptMouseEvent): + """Interface for a Javascript PointerEvent https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent. + + Inherits from JavascriptMouseEvent. + """ + + +class MouseEventInfo(TypedDict): + """Information about a mouse event.""" + + button: int + buttons: int + client_x: int + client_y: int + alt_key: bool + ctrl_key: bool + meta_key: bool + shift_key: bool + + +class PointerEventInfo(MouseEventInfo): + """Information about a pointer event.""" + + +def pointer_event_spec( + e: ObjectVar[JavascriptPointerEvent], +) -> tuple[Var[PointerEventInfo]]: + """Get the pointer event information. + + Args: + e: The pointer event. + + Returns: + The pointer event information. + """ + return ( + Var.create( + { + "button": e.button, + "buttons": e.buttons, + "client_x": e.clientX, + "client_y": e.clientY, + "alt_key": e.altKey, + "ctrl_key": e.ctrlKey, + "meta_key": e.metaKey, + "shift_key": e.shiftKey, + }, + ).to(PointerEventInfo), + ) + + def no_args_event_spec() -> tuple[()]: """Empty event handler. @@ -1149,7 +1242,7 @@ def _callback_arg_spec(eval_result: Any): def call_script( javascript_code: str | Var[str], - callback: EventType[Any] | None = None, + callback: "EventType[Any] | None" = None, ) -> EventSpec: """Create an event handler that executes arbitrary javascript code. @@ -1190,7 +1283,7 @@ def call_script( def call_function( javascript_code: str | Var, - callback: EventType[Any] | None = None, + callback: "EventType[Any] | None" = None, ) -> EventSpec: """Create an event handler that executes arbitrary javascript code. @@ -1226,7 +1319,7 @@ def call_function( def run_script( javascript_code: str | Var, - callback: EventType[Any] | None = None, + callback: "EventType[Any] | None" = None, ) -> EventSpec: """Create an event handler that executes arbitrary javascript code. @@ -1244,7 +1337,7 @@ def run_script( return call_function(ArgsFunctionOperation.create((), javascript_code), callback) -def get_event(state: BaseState, event: str): +def get_event(state: "BaseState", event: str): """Get the event from the given state. Args: @@ -1257,7 +1350,7 @@ def get_event(state: BaseState, event: str): return f"{state.get_name()}.{event}" -def get_hydrate_event(state: BaseState) -> str: +def get_hydrate_event(state: "BaseState") -> str: """Get the name of the hydrate event for the state. Args: @@ -1269,16 +1362,11 @@ def get_hydrate_event(state: BaseState) -> str: return get_event(state, constants.CompileVars.HYDRATE) -def _values_returned_from_event( - event_spec: ArgsSpec | Sequence[ArgsSpec], -) -> list[Any]: +def _values_returned_from_event(event_spec_annotations: list[Any]) -> list[Any]: return [ event_spec_return_type - for arg_spec in ( - [event_spec] if not isinstance(event_spec, Sequence) else list(event_spec) - ) - if (event_spec_return_type := get_type_hints(arg_spec).get("return", None)) - is not None + for event_spec_annotation in event_spec_annotations + if (event_spec_return_type := event_spec_annotation.get("return")) is not None and get_origin(event_spec_return_type) is tuple ] @@ -1306,6 +1394,8 @@ def _check_event_args_subclass_of_callback( # noqa: DAR401 delayed_exceptions[] # noqa: DAR402 EventHandlerArgTypeMismatchError """ + from reflex.utils import console + type_match_found: dict[str, bool] = {} delayed_exceptions: list[EventHandlerArgTypeMismatchError] = [] @@ -1398,22 +1488,23 @@ def call_event_handler( Returns: The event spec from calling the event handler. """ - event_spec_args = parse_args_spec(event_spec) + event_spec_args, event_annotations = parse_args_spec(event_spec) - event_spec_return_types = _values_returned_from_event(event_spec) + event_spec_return_types = _values_returned_from_event(event_annotations) if isinstance(event_callback, EventSpec): + parameters = event_callback.handler._parameters + check_fn_match_arg_spec( event_callback.handler.fn, - event_spec, + parameters, + event_spec_args, key, bool(event_callback.handler.state_full_name) + len(event_callback.args), event_callback.handler.fn.__qualname__, ) - event_callback_spec_args = list( - inspect.signature(event_callback.handler.fn).parameters.keys() - ) + event_callback_spec_args = list(parameters) try: type_hints_of_provided_callback = get_type_hints(event_callback.handler.fn) @@ -1439,18 +1530,19 @@ def call_event_handler( # Handle partial application of EventSpec args return event_callback.add_args(*event_spec_args) + parameters = event_callback._parameters + check_fn_match_arg_spec( event_callback.fn, - event_spec, + parameters, + event_spec_args, key, bool(event_callback.state_full_name), event_callback.fn.__qualname__, ) if event_spec_return_types: - event_callback_spec_args = list( - inspect.signature(event_callback.fn).parameters.keys() - ) + event_callback_spec_args = list(parameters) try: type_hints_of_provided_callback = get_type_hints(event_callback.fn) @@ -1504,6 +1596,7 @@ def resolve_annotation(annotations: dict[str, Any], arg_name: str, spec: ArgsSpe return annotation +@lru_cache def parse_args_spec(arg_spec: ArgsSpec | Sequence[ArgsSpec]): """Parse the args provided in the ArgsSpec of an event trigger. @@ -1514,31 +1607,32 @@ def parse_args_spec(arg_spec: ArgsSpec | Sequence[ArgsSpec]): The parsed args. """ # if there's multiple, the first is the default - arg_spec = arg_spec[0] if isinstance(arg_spec, Sequence) else arg_spec + if isinstance(arg_spec, Sequence): + annotations = [get_type_hints(one_arg_spec) for one_arg_spec in arg_spec] + arg_spec = arg_spec[0] + else: + annotations = [get_type_hints(arg_spec)] + spec = inspect.getfullargspec(arg_spec) - annotations = get_type_hints(arg_spec) return list( arg_spec( *[ Var(f"_{l_arg}").to( unwrap_var_annotation( - resolve_annotation( - annotations, - l_arg, - spec=arg_spec, - ) + resolve_annotation(annotations[0], l_arg, spec=arg_spec) ) ) for l_arg in spec.args ] ) - ) + ), annotations def check_fn_match_arg_spec( user_func: Callable, - arg_spec: ArgsSpec | Sequence[ArgsSpec], + user_func_parameters: Mapping[str, inspect.Parameter], + event_spec_args: Sequence[Var], key: str | None = None, number_of_bound_args: int = 0, func_name: str | None = None, @@ -1548,7 +1642,8 @@ def check_fn_match_arg_spec( Args: user_func: The function to be validated. - arg_spec: The argument specification for the event trigger. + user_func_parameters: The parameters of the function to be validated. + event_spec_args: The argument specification for the event trigger. key: The key of the event trigger. number_of_bound_args: The number of bound arguments to the function. func_name: The name of the function to be validated. @@ -1556,22 +1651,20 @@ def check_fn_match_arg_spec( Raises: EventFnArgMismatchError: Raised if the number of mandatory arguments do not match """ - user_args = list(inspect.signature(user_func).parameters) + user_args = list(user_func_parameters) # Drop the first argument if it's a bound method if inspect.ismethod(user_func) and user_func.__self__ is not None: user_args = user_args[1:] user_default_args = [ p.default - for p in inspect.signature(user_func).parameters.values() + for p in user_func_parameters.values() if p.default is not inspect.Parameter.empty ] number_of_user_args = len(user_args) - number_of_bound_args number_of_user_default_args = len(user_default_args) if user_default_args else 0 - parsed_event_args = parse_args_spec(arg_spec) - - number_of_event_args = len(parsed_event_args) + number_of_event_args = len(event_spec_args) if number_of_user_args - number_of_user_default_args > number_of_event_args: msg = ( @@ -1608,12 +1701,14 @@ def call_event_fn( from reflex.event import EventHandler, EventSpec from reflex.utils.exceptions import EventHandlerValueError - # Check that fn signature matches arg_spec - check_fn_match_arg_spec(fn, arg_spec, key=key) + parsed_args, event_annotations = parse_args_spec(arg_spec) - parsed_args = parse_args_spec(arg_spec) + parameters = inspect.signature(fn).parameters - number_of_fn_args = len(inspect.signature(fn).parameters) + # Check that fn signature matches arg_spec + check_fn_match_arg_spec(fn, parameters, parsed_args, key=key) + + number_of_fn_args = len(parameters) # Call the function with the parsed args. out = fn(*[*parsed_args][:number_of_fn_args]) @@ -1656,7 +1751,7 @@ def get_handler_args( Returns: The handler args. """ - args = inspect.signature(event_spec.handler.fn).parameters + args = event_spec.handler._parameters return event_spec.args if len(args) > 1 else () @@ -1781,7 +1876,7 @@ def create( cls, value: EventSpec | EventHandler, _var_data: VarData | None = None, - ) -> LiteralEventVar: + ) -> "LiteralEventVar": """Create a new LiteralEventVar instance. Args: @@ -1868,7 +1963,7 @@ def create( cls, value: EventChain, _var_data: VarData | None = None, - ) -> LiteralEventChainVar: + ) -> "LiteralEventChainVar": """Create a new LiteralEventChainVar instance. Args: @@ -1927,7 +2022,6 @@ def create( P = TypeVarTuple("P") Q = TypeVarTuple("Q") -T = TypeVar("T") V = TypeVar("V") V2 = TypeVar("V2") V3 = TypeVar("V3") @@ -1948,39 +2042,39 @@ def __init__(self, func: Callable[[Any, Unpack[P]], Any]): @overload def __call__( - self: EventCallback[Unpack[Q]], - ) -> EventCallback[Unpack[Q]]: ... + self: "EventCallback[Unpack[Q]]", + ) -> "EventCallback[Unpack[Q]]": ... @overload def __call__( - self: EventCallback[V, Unpack[Q]], value: V | Var[V] - ) -> EventCallback[Unpack[Q]]: ... + self: "EventCallback[V, Unpack[Q]]", value: V | Var[V] + ) -> "EventCallback[Unpack[Q]]": ... @overload def __call__( - self: EventCallback[V, V2, Unpack[Q]], + self: "EventCallback[V, V2, Unpack[Q]]", value: V | Var[V], value2: V2 | Var[V2], - ) -> EventCallback[Unpack[Q]]: ... + ) -> "EventCallback[Unpack[Q]]": ... @overload def __call__( - self: EventCallback[V, V2, V3, Unpack[Q]], + self: "EventCallback[V, V2, V3, Unpack[Q]]", value: V | Var[V], value2: V2 | Var[V2], value3: V3 | Var[V3], - ) -> EventCallback[Unpack[Q]]: ... + ) -> "EventCallback[Unpack[Q]]": ... @overload def __call__( - self: EventCallback[V, V2, V3, V4, Unpack[Q]], + self: "EventCallback[V, V2, V3, V4, Unpack[Q]]", value: V | Var[V], value2: V2 | Var[V2], value3: V3 | Var[V3], value4: V4 | Var[V4], - ) -> EventCallback[Unpack[Q]]: ... + ) -> "EventCallback[Unpack[Q]]": ... - def __call__(self, *values) -> EventCallback: # pyright: ignore [reportInconsistentOverload] + def __call__(self, *values) -> "EventCallback": # pyright: ignore [reportInconsistentOverload] """Call the function with the values. Args: @@ -1993,11 +2087,11 @@ def __call__(self, *values) -> EventCallback: # pyright: ignore [reportInconsis @overload def __get__( - self: EventCallback[Unpack[P]], instance: None, owner: Any - ) -> EventCallback[Unpack[P]]: ... + self: "EventCallback[Unpack[P]]", instance: None, owner: Any + ) -> "EventCallback[Unpack[P]]": ... @overload - def __get__(self, instance: Any, owner: Any) -> Callable[[Unpack[P]]]: ... + def __get__(self, instance: Any, owner: Any) -> "Callable[[Unpack[P]]]": ... def __get__(self, instance: Any, owner: Any) -> Callable: """Get the function with the instance bound to it. @@ -2021,19 +2115,19 @@ class LambdaEventCallback(Protocol[Unpack[P]]): __code__: types.CodeType @overload - def __call__(self: LambdaEventCallback[()]) -> Any: ... + def __call__(self: "LambdaEventCallback[()]") -> Any: ... @overload - def __call__(self: LambdaEventCallback[V], value: Var[V], /) -> Any: ... + def __call__(self: "LambdaEventCallback[V]", value: "Var[V]", /) -> Any: ... @overload def __call__( - self: LambdaEventCallback[V, V2], value: Var[V], value2: Var[V2], / + self: "LambdaEventCallback[V, V2]", value: Var[V], value2: Var[V2], / ) -> Any: ... @overload def __call__( - self: LambdaEventCallback[V, V2, V3], + self: "LambdaEventCallback[V, V2, V3]", value: Var[V], value2: Var[V2], value3: Var[V3], diff --git a/reflex/state.py b/reflex/state.py index 696c557a11a..5e62c71e1c9 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -190,6 +190,21 @@ def __init__(self, state_cls: type[BaseState]): ) object.__setattr__(self, "state_cls", state_cls) + def __hash__(self): + """Get the hash of the event handler. + + Returns: + The hash of the event handler. + """ + return hash( + ( + tuple(self.event_actions.items()), + self.fn, + self.state_full_name, + self.state_cls, + ) + ) + def setvar(self, var_name: str, value: Any): """Set the state variable to the value of the event. diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index a63153c3d7d..113a81b24b4 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -90,6 +90,7 @@ "EventSpec", "EventType", "KeyInputInfo", + "PointerEventInfo", ], "reflex.style": ["Style"], "reflex.vars.base": ["Var"], @@ -444,7 +445,11 @@ def type_to_ast(typ: Any, cls: type) -> ast.expr: if all(a == b for a, b in zipped) and len(typ_parts) == len(cls_parts): return ast.Name(id=typ.__name__) - + if ( + typ.__module__ in DEFAULT_IMPORTS + and typ.__name__ in DEFAULT_IMPORTS[typ.__module__] + ): + return ast.Name(id=typ.__name__) return ast.Name(id=typ.__module__ + "." + typ.__name__) return ast.Name(id=typ.__name__) if hasattr(typ, "_name"): diff --git a/tests/units/components/test_component.py b/tests/units/components/test_component.py index eb371228277..f80883fff01 100644 --- a/tests/units/components/test_component.py +++ b/tests/units/components/test_component.py @@ -925,16 +925,16 @@ def test_invalid_event_handler_args(component2, test_state): """ # EventHandler args must match with pytest.raises(EventFnArgMismatchError): - component2.create(on_click=test_state.do_something_arg) + component2.create(on_blur=test_state.do_something_arg) # EventHandler args must have at least as many default args as the spec. with pytest.raises(EventFnArgMismatchError): - component2.create(on_click=test_state.do_something_required_optional) + component2.create(on_blur=test_state.do_something_required_optional) # Multiple EventHandler args: all must match with pytest.raises(EventFnArgMismatchError): component2.create( - on_click=[test_state.do_something_arg, test_state.do_something] + on_blur=[test_state.do_something_arg, test_state.do_something] ) # # Event Handler types must match @@ -970,26 +970,26 @@ def test_invalid_event_handler_args(component2, test_state): # lambda cannot return weird values. with pytest.raises(ValueError): - component2.create(on_click=lambda: 1) + component2.create(on_blur=lambda: 1) with pytest.raises(ValueError): - component2.create(on_click=lambda: [1]) + component2.create(on_blur=lambda: [1]) with pytest.raises(ValueError): component2.create( - on_click=lambda: (test_state.do_something_arg(1), test_state.do_something) + on_blur=lambda: (test_state.do_something_arg(1), test_state.do_something) ) # lambda signature must match event trigger. with pytest.raises(EventFnArgMismatchError): - component2.create(on_click=lambda _: test_state.do_something_arg(1)) + component2.create(on_blur=lambda _: test_state.do_something_arg(1)) # lambda returning EventHandler must match spec with pytest.raises(EventFnArgMismatchError): - component2.create(on_click=lambda: test_state.do_something_arg) + component2.create(on_blur=lambda: test_state.do_something_arg) # Mixed EventSpec and EventHandler must match spec. with pytest.raises(EventFnArgMismatchError): component2.create( - on_click=lambda: [ + on_blur=lambda: [ test_state.do_something_arg(1), test_state.do_something_arg, ] @@ -1004,8 +1004,8 @@ def test_valid_event_handler_args(component2, test_state): test_state: A test state. """ # Uncontrolled event handlers should not take args. - component2.create(on_click=test_state.do_something) - component2.create(on_click=test_state.do_something_arg(1)) + component2.create(on_blur=test_state.do_something) + component2.create(on_blur=test_state.do_something_arg(1)) # Does not raise because event handlers are allowed to have less args than the spec. component2.create(on_open=test_state.do_something) @@ -1032,7 +1032,7 @@ def test_valid_event_handler_args(component2, test_state): ) # lambda returning EventHandler is okay if the spec matches. - component2.create(on_click=lambda: test_state.do_something) + component2.create(on_blur=lambda: test_state.do_something) component2.create(on_open=lambda _: test_state.do_something_arg) component2.create(on_prop_event=lambda _: test_state.do_something_arg) component2.create(on_open=lambda: test_state.do_something) @@ -1041,16 +1041,16 @@ def test_valid_event_handler_args(component2, test_state): component2.create(on_prop_event=lambda _: test_state.do_something) # lambda can always return an EventSpec. - component2.create(on_click=lambda: test_state.do_something_arg(1)) + component2.create(on_blur=lambda: test_state.do_something_arg(1)) component2.create(on_open=lambda _: test_state.do_something_arg(1)) component2.create(on_prop_event=lambda _: test_state.do_something_arg(1)) # Return EventSpec and EventHandler (no arg). component2.create( - on_click=lambda: [test_state.do_something_arg(1), test_state.do_something] + on_blur=lambda: [test_state.do_something_arg(1), test_state.do_something] ) component2.create( - on_click=lambda: [test_state.do_something_arg(1), test_state.do_something()] + on_blur=lambda: [test_state.do_something_arg(1), test_state.do_something()] ) # Return 2 EventSpec. @@ -1221,7 +1221,7 @@ def test_stateful_component_memoize_event_trigger(test_state): Args: test_state: A test state. """ - button_component = rx.button("Click me", on_click=test_state.do_something) + button_component = rx.button("Click me", on_blur=test_state.do_something) stateful_component = StatefulComponent.compile_from(button_component) assert isinstance(stateful_component, StatefulComponent) @@ -1410,27 +1410,27 @@ def handler2(self, arg): id="fstring-style-background_color", ), pytest.param( - rx.fragment(on_click=EVENT_CHAIN_VAR), + rx.fragment(on_blur=EVENT_CHAIN_VAR), [EVENT_CHAIN_VAR], id="direct-event-chain", ), pytest.param( - rx.fragment(on_click=EventState.handler), + rx.fragment(on_blur=EventState.handler), [], id="direct-event-handler", ), pytest.param( - rx.fragment(on_click=EventState.handler2(TEST_VAR)), # pyright: ignore [reportCallIssue] + rx.fragment(on_blur=EventState.handler2(TEST_VAR)), # pyright: ignore [reportCallIssue] [ARG_VAR, TEST_VAR], id="direct-event-handler-arg", ), pytest.param( - rx.fragment(on_click=EventState.handler2(EventState.v)), # pyright: ignore [reportCallIssue] + rx.fragment(on_blur=EventState.handler2(EventState.v)), # pyright: ignore [reportCallIssue] [ARG_VAR, EventState.v], id="direct-event-handler-arg2", ), pytest.param( - rx.fragment(on_click=lambda: EventState.handler2(TEST_VAR)), # pyright: ignore [reportCallIssue] + rx.fragment(on_blur=lambda: EventState.handler2(TEST_VAR)), # pyright: ignore [reportCallIssue] [ARG_VAR, TEST_VAR], id="direct-event-handler-lambda", ), @@ -1879,8 +1879,8 @@ class TestComponent(Component): assert custom_triggers.keys() == test_triggers.keys() for trigger_name in custom_component.get_event_triggers(): for v1, v2 in zip( - parse_args_spec(test_triggers[trigger_name]), - parse_args_spec(custom_triggers[trigger_name]), + parse_args_spec(test_triggers[trigger_name])[0], + parse_args_spec(custom_triggers[trigger_name])[0], strict=True, ): assert v1.equals(v2) @@ -2236,38 +2236,38 @@ def do_something(self): [ (rx.box(rx.text("random text")), False), ( - rx.box(rx.text("random text", on_click=rx.console_log("log"))), + rx.box(rx.text("random text", on_blur=rx.console_log("log"))), False, ), ( rx.box( - rx.text("random text", on_click=TriggerState.do_something), + rx.text("random text", on_blur=TriggerState.do_something), rx.text( "random text", - on_click=Var(_js_expr="toggleColorMode").to(EventChain), + on_blur=Var(_js_expr="toggleColorMode").to(EventChain), ), ), True, ), ( rx.box( - rx.text("random text", on_click=rx.console_log("log")), + rx.text("random text", on_blur=rx.console_log("log")), rx.text( "random text", - on_click=Var(_js_expr="toggleColorMode").to(EventChain), + on_blur=Var(_js_expr="toggleColorMode").to(EventChain), ), ), False, ), ( - rx.box(rx.text("random text", on_click=TriggerState.do_something)), + rx.box(rx.text("random text", on_blur=TriggerState.do_something)), True, ), ( rx.box( rx.text( "random text", - on_click=[rx.console_log("log"), rx.window_alert("alert")], + on_blur=[rx.console_log("log"), rx.window_alert("alert")], ), ), False, @@ -2276,7 +2276,7 @@ def do_something(self): rx.box( rx.text( "random text", - on_click=[rx.console_log("log"), TriggerState.do_something], + on_blur=[rx.console_log("log"), TriggerState.do_something], ), ), True,