streamlit 1.50.0__py3-none-any.whl → 1.52.0__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.
Files changed (406) hide show
  1. streamlit/__init__.py +5 -1
  2. streamlit/commands/execution_control.py +89 -14
  3. streamlit/commands/navigation.py +4 -6
  4. streamlit/commands/page_config.py +4 -6
  5. streamlit/components/v1/component_arrow.py +7 -7
  6. streamlit/components/v2/__init__.py +514 -0
  7. streamlit/components/v2/bidi_component/__init__.py +20 -0
  8. streamlit/components/v2/bidi_component/constants.py +29 -0
  9. streamlit/components/v2/bidi_component/main.py +534 -0
  10. streamlit/components/v2/bidi_component/serialization.py +272 -0
  11. streamlit/components/v2/bidi_component/state.py +92 -0
  12. streamlit/components/v2/component_definition_resolver.py +143 -0
  13. streamlit/components/v2/component_file_watcher.py +403 -0
  14. streamlit/components/v2/component_manager.py +439 -0
  15. streamlit/components/v2/component_manifest_handler.py +122 -0
  16. streamlit/components/v2/component_path_utils.py +245 -0
  17. streamlit/components/v2/component_registry.py +426 -0
  18. streamlit/components/v2/get_bidi_component_manager.py +51 -0
  19. streamlit/components/v2/manifest_scanner.py +615 -0
  20. streamlit/components/v2/presentation.py +198 -0
  21. streamlit/components/v2/types.py +324 -0
  22. streamlit/config.py +456 -53
  23. streamlit/config_option.py +4 -1
  24. streamlit/config_util.py +650 -1
  25. streamlit/connections/snowflake_connection.py +1 -1
  26. streamlit/connections/snowpark_connection.py +1 -1
  27. streamlit/dataframe_util.py +33 -26
  28. streamlit/delta_generator.py +13 -4
  29. streamlit/delta_generator_singletons.py +11 -15
  30. streamlit/deprecation_util.py +17 -6
  31. streamlit/elements/alert.py +16 -0
  32. streamlit/elements/arrow.py +68 -10
  33. streamlit/elements/bokeh_chart.py +10 -78
  34. streamlit/elements/code.py +2 -2
  35. streamlit/elements/deck_gl_json_chart.py +98 -40
  36. streamlit/elements/dialog_decorator.py +2 -1
  37. streamlit/elements/exception.py +4 -2
  38. streamlit/elements/form.py +27 -0
  39. streamlit/elements/graphviz_chart.py +1 -3
  40. streamlit/elements/heading.py +63 -10
  41. streamlit/elements/html.py +13 -2
  42. streamlit/elements/image.py +3 -5
  43. streamlit/elements/layouts.py +59 -33
  44. streamlit/elements/lib/built_in_chart_utils.py +50 -19
  45. streamlit/elements/lib/color_util.py +9 -19
  46. streamlit/elements/lib/column_config_utils.py +9 -12
  47. streamlit/elements/lib/column_types.py +40 -12
  48. streamlit/elements/lib/dialog.py +2 -2
  49. streamlit/elements/lib/image_utils.py +3 -5
  50. streamlit/elements/lib/layout_utils.py +100 -13
  51. streamlit/elements/lib/mutable_status_container.py +2 -2
  52. streamlit/elements/lib/options_selector_utils.py +2 -2
  53. streamlit/elements/lib/pandas_styler_utils.py +17 -9
  54. streamlit/elements/lib/shortcut_utils.py +152 -0
  55. streamlit/elements/lib/utils.py +4 -4
  56. streamlit/elements/map.py +80 -37
  57. streamlit/elements/markdown.py +50 -3
  58. streamlit/elements/media.py +5 -7
  59. streamlit/elements/metric.py +34 -6
  60. streamlit/elements/pdf.py +2 -4
  61. streamlit/elements/plotly_chart.py +197 -20
  62. streamlit/elements/progress.py +2 -4
  63. streamlit/elements/space.py +113 -0
  64. streamlit/elements/spinner.py +1 -1
  65. streamlit/elements/text.py +20 -3
  66. streamlit/elements/toast.py +2 -0
  67. streamlit/elements/vega_charts.py +356 -149
  68. streamlit/elements/widgets/audio_input.py +12 -11
  69. streamlit/elements/widgets/button.py +280 -43
  70. streamlit/elements/widgets/button_group.py +60 -9
  71. streamlit/elements/widgets/camera_input.py +3 -5
  72. streamlit/elements/widgets/chat.py +307 -43
  73. streamlit/elements/widgets/color_picker.py +8 -1
  74. streamlit/elements/widgets/data_editor.py +88 -44
  75. streamlit/elements/widgets/file_uploader.py +9 -11
  76. streamlit/elements/widgets/multiselect.py +4 -3
  77. streamlit/elements/widgets/number_input.py +4 -4
  78. streamlit/elements/widgets/radio.py +10 -3
  79. streamlit/elements/widgets/select_slider.py +8 -5
  80. streamlit/elements/widgets/selectbox.py +6 -3
  81. streamlit/elements/widgets/slider.py +38 -42
  82. streamlit/elements/widgets/text_widgets.py +2 -0
  83. streamlit/elements/widgets/time_widgets.py +587 -21
  84. streamlit/elements/write.py +27 -6
  85. streamlit/emojis.py +1 -1
  86. streamlit/errors.py +137 -0
  87. streamlit/git_util.py +1 -1
  88. streamlit/hello/hello.py +8 -0
  89. streamlit/hello/utils.py +2 -1
  90. streamlit/material_icon_names.py +1 -1
  91. streamlit/navigation/page.py +11 -1
  92. streamlit/net_util.py +2 -2
  93. streamlit/proto/Alert_pb2.pyi +3 -3
  94. streamlit/proto/AppPage_pb2.pyi +7 -1
  95. streamlit/proto/ArrowData_pb2.py +27 -0
  96. streamlit/proto/ArrowData_pb2.pyi +52 -0
  97. streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
  98. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
  99. streamlit/proto/Arrow_pb2.py +10 -10
  100. streamlit/proto/Arrow_pb2.pyi +19 -12
  101. streamlit/proto/AudioInput_pb2.pyi +7 -1
  102. streamlit/proto/Audio_pb2.pyi +7 -1
  103. streamlit/proto/AuthRedirect_pb2.pyi +7 -1
  104. streamlit/proto/AutoRerun_pb2.pyi +7 -1
  105. streamlit/proto/BackMsg_pb2.py +4 -2
  106. streamlit/proto/BackMsg_pb2.pyi +34 -4
  107. streamlit/proto/Balloons_pb2.pyi +7 -1
  108. streamlit/proto/BidiComponent_pb2.py +34 -0
  109. streamlit/proto/BidiComponent_pb2.pyi +159 -0
  110. streamlit/proto/Block_pb2.py +7 -7
  111. streamlit/proto/Block_pb2.pyi +39 -36
  112. streamlit/proto/BokehChart_pb2.pyi +7 -1
  113. streamlit/proto/ButtonGroup_pb2.pyi +9 -9
  114. streamlit/proto/Button_pb2.py +2 -2
  115. streamlit/proto/Button_pb2.pyi +11 -2
  116. streamlit/proto/CameraInput_pb2.pyi +7 -1
  117. streamlit/proto/ChatInput_pb2.py +6 -6
  118. streamlit/proto/ChatInput_pb2.pyi +18 -6
  119. streamlit/proto/Checkbox_pb2.pyi +3 -3
  120. streamlit/proto/ClientState_pb2.pyi +10 -4
  121. streamlit/proto/Code_pb2.pyi +7 -1
  122. streamlit/proto/ColorPicker_pb2.pyi +7 -1
  123. streamlit/proto/Common_pb2.py +3 -3
  124. streamlit/proto/Common_pb2.pyi +35 -23
  125. streamlit/proto/Components_pb2.pyi +19 -13
  126. streamlit/proto/DataFrame_pb2.pyi +55 -49
  127. streamlit/proto/DateInput_pb2.pyi +7 -1
  128. streamlit/proto/DateTimeInput_pb2.py +28 -0
  129. streamlit/proto/DateTimeInput_pb2.pyi +92 -0
  130. streamlit/proto/DeckGlJsonChart_pb2.py +10 -4
  131. streamlit/proto/DeckGlJsonChart_pb2.pyi +12 -6
  132. streamlit/proto/Delta_pb2.pyi +7 -1
  133. streamlit/proto/DocString_pb2.pyi +10 -4
  134. streamlit/proto/DownloadButton_pb2.py +2 -2
  135. streamlit/proto/DownloadButton_pb2.pyi +16 -2
  136. streamlit/proto/Element_pb2.py +7 -3
  137. streamlit/proto/Element_pb2.pyi +33 -5
  138. streamlit/proto/Empty_pb2.pyi +7 -1
  139. streamlit/proto/Exception_pb2.pyi +7 -1
  140. streamlit/proto/Favicon_pb2.pyi +7 -1
  141. streamlit/proto/FileUploader_pb2.pyi +7 -1
  142. streamlit/proto/ForwardMsg_pb2.py +12 -10
  143. streamlit/proto/ForwardMsg_pb2.pyi +42 -15
  144. streamlit/proto/GapSize_pb2.pyi +4 -4
  145. streamlit/proto/GitInfo_pb2.pyi +3 -3
  146. streamlit/proto/GraphVizChart_pb2.pyi +7 -1
  147. streamlit/proto/Heading_pb2.pyi +7 -1
  148. streamlit/proto/HeightConfig_pb2.py +2 -2
  149. streamlit/proto/HeightConfig_pb2.pyi +13 -4
  150. streamlit/proto/Html_pb2.py +2 -2
  151. streamlit/proto/Html_pb2.pyi +11 -2
  152. streamlit/proto/IFrame_pb2.pyi +7 -1
  153. streamlit/proto/Image_pb2.pyi +10 -4
  154. streamlit/proto/Json_pb2.pyi +7 -1
  155. streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
  156. streamlit/proto/LinkButton_pb2.py +2 -2
  157. streamlit/proto/LinkButton_pb2.pyi +15 -2
  158. streamlit/proto/Logo_pb2.pyi +7 -1
  159. streamlit/proto/Markdown_pb2.pyi +3 -3
  160. streamlit/proto/Metric_pb2.pyi +7 -7
  161. streamlit/proto/MetricsEvent_pb2.pyi +10 -4
  162. streamlit/proto/MultiSelect_pb2.pyi +7 -1
  163. streamlit/proto/NamedDataSet_pb2.pyi +7 -1
  164. streamlit/proto/Navigation_pb2.pyi +3 -3
  165. streamlit/proto/NewSession_pb2.py +18 -18
  166. streamlit/proto/NewSession_pb2.pyi +59 -40
  167. streamlit/proto/NumberInput_pb2.pyi +3 -3
  168. streamlit/proto/PageConfig_pb2.pyi +7 -7
  169. streamlit/proto/PageInfo_pb2.pyi +7 -1
  170. streamlit/proto/PageLink_pb2.py +2 -2
  171. streamlit/proto/PageLink_pb2.pyi +11 -2
  172. streamlit/proto/PageNotFound_pb2.pyi +7 -1
  173. streamlit/proto/PageProfile_pb2.pyi +13 -7
  174. streamlit/proto/PagesChanged_pb2.pyi +7 -1
  175. streamlit/proto/ParentMessage_pb2.pyi +7 -1
  176. streamlit/proto/PlotlyChart_pb2.py +8 -6
  177. streamlit/proto/PlotlyChart_pb2.pyi +9 -7
  178. streamlit/proto/Progress_pb2.pyi +7 -1
  179. streamlit/proto/Radio_pb2.pyi +7 -1
  180. streamlit/proto/RootContainer_pb2.pyi +1 -1
  181. streamlit/proto/Selectbox_pb2.pyi +7 -1
  182. streamlit/proto/SessionEvent_pb2.pyi +7 -1
  183. streamlit/proto/SessionStatus_pb2.pyi +7 -1
  184. streamlit/proto/Skeleton_pb2.pyi +3 -3
  185. streamlit/proto/Slider_pb2.pyi +5 -5
  186. streamlit/proto/Snow_pb2.pyi +7 -1
  187. streamlit/proto/Space_pb2.py +27 -0
  188. streamlit/proto/Space_pb2.pyi +48 -0
  189. streamlit/proto/Spinner_pb2.pyi +7 -1
  190. streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
  191. streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
  192. streamlit/proto/TextArea_pb2.pyi +7 -1
  193. streamlit/proto/TextInput_pb2.pyi +3 -3
  194. streamlit/proto/Text_pb2.pyi +7 -1
  195. streamlit/proto/TimeInput_pb2.pyi +7 -1
  196. streamlit/proto/Toast_pb2.pyi +7 -1
  197. streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
  198. streamlit/proto/Video_pb2.pyi +6 -6
  199. streamlit/proto/WidgetStates_pb2.py +2 -2
  200. streamlit/proto/WidgetStates_pb2.pyi +23 -7
  201. streamlit/proto/WidthConfig_pb2.py +2 -2
  202. streamlit/proto/WidthConfig_pb2.pyi +13 -4
  203. streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
  204. streamlit/runtime/app_session.py +65 -2
  205. streamlit/runtime/caching/cache_data_api.py +5 -5
  206. streamlit/runtime/caching/cache_errors.py +4 -1
  207. streamlit/runtime/caching/cache_resource_api.py +5 -4
  208. streamlit/runtime/caching/cache_utils.py +3 -2
  209. streamlit/runtime/caching/cached_message_replay.py +3 -3
  210. streamlit/runtime/caching/hashing.py +4 -5
  211. streamlit/runtime/caching/legacy_cache_api.py +2 -1
  212. streamlit/runtime/connection_factory.py +1 -3
  213. streamlit/runtime/download_data_util.py +53 -0
  214. streamlit/runtime/forward_msg_queue.py +5 -1
  215. streamlit/runtime/fragment.py +2 -1
  216. streamlit/runtime/media_file_manager.py +178 -2
  217. streamlit/runtime/memory_media_file_storage.py +1 -1
  218. streamlit/runtime/metrics_util.py +91 -3
  219. streamlit/runtime/runtime.py +14 -0
  220. streamlit/runtime/scriptrunner/exec_code.py +2 -1
  221. streamlit/runtime/scriptrunner/script_runner.py +5 -3
  222. streamlit/runtime/scriptrunner_utils/script_run_context.py +3 -6
  223. streamlit/runtime/secrets.py +2 -4
  224. streamlit/runtime/session_manager.py +3 -1
  225. streamlit/runtime/state/common.py +30 -5
  226. streamlit/runtime/state/presentation.py +85 -0
  227. streamlit/runtime/state/query_params.py +80 -29
  228. streamlit/runtime/state/safe_session_state.py +2 -2
  229. streamlit/runtime/state/session_state.py +221 -17
  230. streamlit/runtime/state/widgets.py +19 -3
  231. streamlit/runtime/websocket_session_manager.py +3 -1
  232. streamlit/source_util.py +2 -2
  233. streamlit/static/index.html +2 -2
  234. streamlit/static/manifest.json +557 -239
  235. streamlit/static/static/css/{index.CIiu7Ygf.css → index.BpABIXK9.css} +1 -1
  236. streamlit/static/static/css/index.DgR7E2CV.css +1 -0
  237. streamlit/static/static/js/{ErrorOutline.esm.DUpR0_Ka.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
  238. streamlit/static/static/js/{FileDownload.esm.CN4j9-1w.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
  239. streamlit/static/static/js/{FileHelper.CaIUKG91.js → FileHelper.B7Ero7qQ.js} +3 -3
  240. streamlit/static/static/js/{FormClearHelper.DTcdrasw.js → FormClearHelper.CG2XN1_g.js} +1 -1
  241. streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
  242. streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
  243. streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
  244. streamlit/static/static/js/{ProgressBar.DetlP5aY.js → ProgressBar.CGQ8OgfO.js} +2 -2
  245. streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
  246. streamlit/static/static/js/{Toolbar.C77ar7rq.js → Toolbar.B2qFUmd9.js} +1 -1
  247. streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
  248. streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
  249. streamlit/static/static/js/{base-input.BQft14La.js → base-input.o9tL8MDP.js} +4 -4
  250. streamlit/static/static/js/{checkbox.yZOfXCeX.js → checkbox.0BeV1IBL.js} +1 -1
  251. streamlit/static/static/js/{createSuper.Dh9w1cs8.js → createSuper.RBO59fEm.js} +1 -1
  252. streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
  253. streamlit/static/static/js/{downloader.MeHtkq8r.js → downloader.DwNZg3Mw.js} +1 -1
  254. streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
  255. streamlit/static/static/js/{es6.VpBPGCnM.js → es6.x9KsYQg-.js} +2 -2
  256. streamlit/static/static/js/{iframeResizer.contentWindow.yMw_ARIL.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
  257. streamlit/static/static/js/index.5VPOamri.js +1 -0
  258. streamlit/static/static/js/index.8HslT92O.js +14 -0
  259. streamlit/static/static/js/index.AnXMIBz3.js +7 -0
  260. streamlit/static/static/js/index.B0yp3bM1.js +6 -0
  261. streamlit/static/static/js/index.B1fRb5wF.js +1 -0
  262. streamlit/static/static/js/index.B527JZdO.js +3 -0
  263. streamlit/static/static/js/index.BHgV-yW4.js +1 -0
  264. streamlit/static/static/js/index.BQr-XwGV.js +1 -0
  265. streamlit/static/static/js/index.BTtmaLDB.js +1 -0
  266. streamlit/static/static/js/index.BWB_91TA.js +1 -0
  267. streamlit/static/static/js/index.BfEKaEmw.js +1 -0
  268. streamlit/static/static/js/index.BfXjTO8b.js +1 -0
  269. streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
  270. streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
  271. streamlit/static/static/js/index.BuCx76ZV.js +1 -0
  272. streamlit/static/static/js/index.BxjzhVUb.js +2 -0
  273. streamlit/static/static/js/index.By55VdPY.js +1 -0
  274. streamlit/static/static/js/index.CF5MxTbK.js +1 -0
  275. streamlit/static/static/js/index.CLmq_z9K.js +1 -0
  276. streamlit/static/static/js/index.CNH4rdSz.js +1 -0
  277. streamlit/static/static/js/{index.B0H9IXUJ.js → index.CTgm_-jO.js} +10 -41
  278. streamlit/static/static/js/index.C_rK-Swb.js +188 -0
  279. streamlit/static/static/js/index.CjozwSzS.js +1 -0
  280. streamlit/static/static/js/{index.CH1tqnSs.js → index.CkGVt6-G.js} +1 -1
  281. streamlit/static/static/js/index.CuvXOyER.js +2 -0
  282. streamlit/static/static/js/{index.FFOzOWzC.js → index.CyUHWoCC.js} +2 -2
  283. streamlit/static/static/js/index.CyroQtI4.js +2 -0
  284. streamlit/static/static/js/index.D6HmkoDm.js +263 -0
  285. streamlit/static/static/js/index.DAqCNvsO.js +1 -0
  286. streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
  287. streamlit/static/static/js/index.DBalctjj.js +2 -0
  288. streamlit/static/static/js/index.DK0RFJUG.js +11 -0
  289. streamlit/static/static/js/index.DMxc2XFp.js +151 -0
  290. streamlit/static/static/js/index.DO5utP74.js +2 -0
  291. streamlit/static/static/js/index.DS7lf09n.js +1 -0
  292. streamlit/static/static/js/index.DWexTVLY.js +1 -0
  293. streamlit/static/static/js/index.DXxnU5ej.js +1 -0
  294. streamlit/static/static/js/index.DcU3uDvB.js +2 -0
  295. streamlit/static/static/js/index.DlltaH7J.js +1 -0
  296. streamlit/static/static/js/index.DpNTZz82.js +27 -0
  297. streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
  298. streamlit/static/static/js/index.DsgAU5lc.js +1 -0
  299. streamlit/static/static/js/{index.64ejlaaT.js → index.KfXqjDYy.js} +1 -1
  300. streamlit/static/static/js/index.PaidgjCs.js +1 -0
  301. streamlit/static/static/js/index.RJZuWCGA.js +1 -0
  302. streamlit/static/static/js/{index.Ctn27_AE.js → index.hbeqcRTn.js} +53 -122
  303. streamlit/static/static/js/index.q5hIQwAY.js +1 -0
  304. streamlit/static/static/js/index.rORSX6IW.js +1 -0
  305. streamlit/static/static/js/index.uSX757_v.js +1 -0
  306. streamlit/static/static/js/index.x_QRaLMd.js +1 -0
  307. streamlit/static/static/js/{input.s6pjQ49A.js → input.D5oh9-aB.js} +2 -2
  308. streamlit/static/static/js/main.q9oGOg0H.js +13 -0
  309. streamlit/static/static/js/{memory.Cuvsdfrl.js → memory.5kCSFUJS.js} +1 -1
  310. streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
  311. streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
  312. streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
  313. streamlit/static/static/js/{possibleConstructorReturn.CqidKeei.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
  314. streamlit/static/static/js/record.B-tDciZb.js +1 -0
  315. streamlit/static/static/js/{sandbox.CCQREcJx.js → sandbox.DACSyz29.js} +1 -1
  316. streamlit/static/static/js/styled-components.C3R090At.js +1 -0
  317. streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
  318. streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
  319. streamlit/static/static/js/{timepicker.mkJF97Bb.js → timepicker.BdhzPxrv.js} +1 -1
  320. streamlit/static/static/js/timer.C2hYhUse.js +1 -0
  321. streamlit/static/static/js/{toConsumableArray.De7I7KVR.js → toConsumableArray.Db2pdqM2.js} +1 -1
  322. streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
  323. streamlit/static/static/js/urls.BwSlolu9.js +1 -0
  324. streamlit/static/static/js/{useBasicWidgetState.CedkNjUW.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
  325. streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
  326. streamlit/static/static/js/{useTextInputAutoExpand.Ca7w8dVs.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
  327. streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
  328. streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
  329. streamlit/static/static/js/value.B4vHRSi7.js +1 -0
  330. streamlit/static/static/js/wavesurfer.esm.vI8Eid4k.js +73 -0
  331. streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
  332. streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
  333. streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
  334. streamlit/string_util.py +9 -4
  335. streamlit/testing/v1/app_test.py +17 -2
  336. streamlit/testing/v1/element_tree.py +85 -9
  337. streamlit/testing/v1/util.py +2 -2
  338. streamlit/type_util.py +3 -4
  339. streamlit/url_util.py +1 -3
  340. streamlit/user_info.py +1 -2
  341. streamlit/util.py +3 -1
  342. streamlit/watcher/event_based_path_watcher.py +23 -12
  343. streamlit/watcher/local_sources_watcher.py +11 -1
  344. streamlit/watcher/path_watcher.py +9 -6
  345. streamlit/watcher/polling_path_watcher.py +4 -1
  346. streamlit/watcher/util.py +2 -2
  347. streamlit/web/bootstrap.py +24 -0
  348. streamlit/web/cli.py +51 -22
  349. streamlit/web/server/bidi_component_request_handler.py +193 -0
  350. streamlit/web/server/component_file_utils.py +97 -0
  351. streamlit/web/server/component_request_handler.py +8 -21
  352. streamlit/web/server/oauth_authlib_routes.py +5 -2
  353. streamlit/web/server/oidc_mixin.py +3 -1
  354. streamlit/web/server/routes.py +2 -2
  355. streamlit/web/server/server.py +9 -0
  356. streamlit/web/server/server_util.py +3 -1
  357. streamlit/web/server/upload_file_request_handler.py +19 -1
  358. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +10 -7
  359. streamlit-1.52.0.dist-info/RECORD +620 -0
  360. streamlit/static/static/css/index.CHEnSPGk.css +0 -1
  361. streamlit/static/static/js/Hooks.BRba_Own.js +0 -1
  362. streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +0 -1
  363. streamlit/static/static/js/Particles.CElH0XX2.js +0 -1
  364. streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +0 -1
  365. streamlit/static/static/js/index.6xX1278W.js +0 -975
  366. streamlit/static/static/js/index.B-hiXRzw.js +0 -1
  367. streamlit/static/static/js/index.B4cAbHP6.js +0 -1
  368. streamlit/static/static/js/index.B4dUQfni.js +0 -1
  369. streamlit/static/static/js/index.BPQo7BKk.js +0 -1
  370. streamlit/static/static/js/index.Baqa90pe.js +0 -2
  371. streamlit/static/static/js/index.Bj9JgOEC.js +0 -1
  372. streamlit/static/static/js/index.BjCwMzj4.js +0 -3
  373. streamlit/static/static/js/index.Bm3VbPB5.js +0 -1
  374. streamlit/static/static/js/index.Bxz2yX3P.js +0 -1
  375. streamlit/static/static/js/index.BycLveZ4.js +0 -1
  376. streamlit/static/static/js/index.C9BdUqTi.js +0 -1
  377. streamlit/static/static/js/index.CFMf5_ez.js +0 -197
  378. streamlit/static/static/js/index.CGYqqs6j.js +0 -1
  379. streamlit/static/static/js/index.CMItVsFA.js +0 -1
  380. streamlit/static/static/js/index.CTBk8Vk2.js +0 -1
  381. streamlit/static/static/js/index.CiAQIz1H.js +0 -7
  382. streamlit/static/static/js/index.Cj7DSzVR.js +0 -73
  383. streamlit/static/static/js/index.Ck8rQ9OL.js +0 -1
  384. streamlit/static/static/js/index.ClELlchS.js +0 -1617
  385. streamlit/static/static/js/index.Cnpi3o3E.js +0 -1
  386. streamlit/static/static/js/index.D2QEXQq_.js +0 -1
  387. streamlit/static/static/js/index.DH71Ezyj.js +0 -1
  388. streamlit/static/static/js/index.DHh-U0dK.js +0 -3
  389. streamlit/static/static/js/index.DK7hD7_w.js +0 -1
  390. streamlit/static/static/js/index.DKv_lNO7.js +0 -2
  391. streamlit/static/static/js/index.DNLrMXgm.js +0 -12
  392. streamlit/static/static/js/index.DW0Grddz.js +0 -1
  393. streamlit/static/static/js/index.Dbe-Q3C-.js +0 -2
  394. streamlit/static/static/js/index.DcPNYEUo.js +0 -1
  395. streamlit/static/static/js/index.DuxqVQpd.js +0 -1
  396. streamlit/static/static/js/index.GRUzrudl.js +0 -1
  397. streamlit/static/static/js/number-overlay-editor.DdgVR5m3.js +0 -9
  398. streamlit/static/static/js/uniqueId.RI1LJdtz.js +0 -1
  399. streamlit/static/static/js/useUpdateUiValue.DeXelfRH.js +0 -1
  400. streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +0 -1
  401. streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
  402. streamlit-1.50.0.dist-info/RECORD +0 -557
  403. {streamlit-1.50.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
  404. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
  405. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
  406. {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
@@ -65,7 +65,7 @@ GAUGE_HISTOGRAM: MetricType.ValueType # 6
65
65
  """Gauge histogram must use histogram value MetricPoint values."""
66
66
  SUMMARY: MetricType.ValueType # 7
67
67
  """Summary quantiles must use summary value MetricPoint values."""
68
- global___MetricType = MetricType
68
+ Global___MetricType: typing_extensions.TypeAlias = MetricType
69
69
 
70
70
  @typing.final
71
71
  class MetricSet(google.protobuf.message.Message):
@@ -75,17 +75,17 @@ class MetricSet(google.protobuf.message.Message):
75
75
 
76
76
  METRIC_FAMILIES_FIELD_NUMBER: builtins.int
77
77
  @property
78
- def metric_families(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MetricFamily]:
78
+ def metric_families(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___MetricFamily]:
79
79
  """Each MetricFamily has one or more MetricPoints for a single Metric."""
80
80
 
81
81
  def __init__(
82
82
  self,
83
83
  *,
84
- metric_families: collections.abc.Iterable[global___MetricFamily] | None = ...,
84
+ metric_families: collections.abc.Iterable[Global___MetricFamily] | None = ...,
85
85
  ) -> None: ...
86
86
  def ClearField(self, field_name: typing.Literal["metric_families", b"metric_families"]) -> None: ...
87
87
 
88
- global___MetricSet = MetricSet
88
+ Global___MetricSet: typing_extensions.TypeAlias = MetricSet
89
89
 
90
90
  @typing.final
91
91
  class MetricFamily(google.protobuf.message.Message):
@@ -102,28 +102,28 @@ class MetricFamily(google.protobuf.message.Message):
102
102
  METRICS_FIELD_NUMBER: builtins.int
103
103
  name: builtins.str
104
104
  """Required."""
105
- type: global___MetricType.ValueType
105
+ type: Global___MetricType.ValueType
106
106
  """Optional."""
107
107
  unit: builtins.str
108
108
  """Optional."""
109
109
  help: builtins.str
110
110
  """Optional."""
111
111
  @property
112
- def metrics(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Metric]:
112
+ def metrics(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Metric]:
113
113
  """Optional."""
114
114
 
115
115
  def __init__(
116
116
  self,
117
117
  *,
118
118
  name: builtins.str = ...,
119
- type: global___MetricType.ValueType = ...,
119
+ type: Global___MetricType.ValueType = ...,
120
120
  unit: builtins.str = ...,
121
121
  help: builtins.str = ...,
122
- metrics: collections.abc.Iterable[global___Metric] | None = ...,
122
+ metrics: collections.abc.Iterable[Global___Metric] | None = ...,
123
123
  ) -> None: ...
124
124
  def ClearField(self, field_name: typing.Literal["help", b"help", "metrics", b"metrics", "name", b"name", "type", b"type", "unit", b"unit"]) -> None: ...
125
125
 
126
- global___MetricFamily = MetricFamily
126
+ Global___MetricFamily: typing_extensions.TypeAlias = MetricFamily
127
127
 
128
128
  @typing.final
129
129
  class Metric(google.protobuf.message.Message):
@@ -134,22 +134,22 @@ class Metric(google.protobuf.message.Message):
134
134
  LABELS_FIELD_NUMBER: builtins.int
135
135
  METRIC_POINTS_FIELD_NUMBER: builtins.int
136
136
  @property
137
- def labels(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Label]:
137
+ def labels(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Label]:
138
138
  """Optional."""
139
139
 
140
140
  @property
141
- def metric_points(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MetricPoint]:
141
+ def metric_points(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___MetricPoint]:
142
142
  """Optional."""
143
143
 
144
144
  def __init__(
145
145
  self,
146
146
  *,
147
- labels: collections.abc.Iterable[global___Label] | None = ...,
148
- metric_points: collections.abc.Iterable[global___MetricPoint] | None = ...,
147
+ labels: collections.abc.Iterable[Global___Label] | None = ...,
148
+ metric_points: collections.abc.Iterable[Global___MetricPoint] | None = ...,
149
149
  ) -> None: ...
150
150
  def ClearField(self, field_name: typing.Literal["labels", b"labels", "metric_points", b"metric_points"]) -> None: ...
151
151
 
152
- global___Metric = Metric
152
+ Global___Metric: typing_extensions.TypeAlias = Metric
153
153
 
154
154
  @typing.final
155
155
  class Label(google.protobuf.message.Message):
@@ -173,7 +173,7 @@ class Label(google.protobuf.message.Message):
173
173
  ) -> None: ...
174
174
  def ClearField(self, field_name: typing.Literal["name", b"name", "value", b"value"]) -> None: ...
175
175
 
176
- global___Label = Label
176
+ Global___Label: typing_extensions.TypeAlias = Label
177
177
 
178
178
  @typing.final
179
179
  class MetricPoint(google.protobuf.message.Message):
@@ -190,19 +190,19 @@ class MetricPoint(google.protobuf.message.Message):
190
190
  SUMMARY_VALUE_FIELD_NUMBER: builtins.int
191
191
  TIMESTAMP_FIELD_NUMBER: builtins.int
192
192
  @property
193
- def unknown_value(self) -> global___UnknownValue: ...
193
+ def unknown_value(self) -> Global___UnknownValue: ...
194
194
  @property
195
- def gauge_value(self) -> global___GaugeValue: ...
195
+ def gauge_value(self) -> Global___GaugeValue: ...
196
196
  @property
197
- def counter_value(self) -> global___CounterValue: ...
197
+ def counter_value(self) -> Global___CounterValue: ...
198
198
  @property
199
- def histogram_value(self) -> global___HistogramValue: ...
199
+ def histogram_value(self) -> Global___HistogramValue: ...
200
200
  @property
201
- def state_set_value(self) -> global___StateSetValue: ...
201
+ def state_set_value(self) -> Global___StateSetValue: ...
202
202
  @property
203
- def info_value(self) -> global___InfoValue: ...
203
+ def info_value(self) -> Global___InfoValue: ...
204
204
  @property
205
- def summary_value(self) -> global___SummaryValue: ...
205
+ def summary_value(self) -> Global___SummaryValue: ...
206
206
  @property
207
207
  def timestamp(self) -> google.protobuf.timestamp_pb2.Timestamp:
208
208
  """Optional."""
@@ -210,20 +210,20 @@ class MetricPoint(google.protobuf.message.Message):
210
210
  def __init__(
211
211
  self,
212
212
  *,
213
- unknown_value: global___UnknownValue | None = ...,
214
- gauge_value: global___GaugeValue | None = ...,
215
- counter_value: global___CounterValue | None = ...,
216
- histogram_value: global___HistogramValue | None = ...,
217
- state_set_value: global___StateSetValue | None = ...,
218
- info_value: global___InfoValue | None = ...,
219
- summary_value: global___SummaryValue | None = ...,
213
+ unknown_value: Global___UnknownValue | None = ...,
214
+ gauge_value: Global___GaugeValue | None = ...,
215
+ counter_value: Global___CounterValue | None = ...,
216
+ histogram_value: Global___HistogramValue | None = ...,
217
+ state_set_value: Global___StateSetValue | None = ...,
218
+ info_value: Global___InfoValue | None = ...,
219
+ summary_value: Global___SummaryValue | None = ...,
220
220
  timestamp: google.protobuf.timestamp_pb2.Timestamp | None = ...,
221
221
  ) -> None: ...
222
222
  def HasField(self, field_name: typing.Literal["counter_value", b"counter_value", "gauge_value", b"gauge_value", "histogram_value", b"histogram_value", "info_value", b"info_value", "state_set_value", b"state_set_value", "summary_value", b"summary_value", "timestamp", b"timestamp", "unknown_value", b"unknown_value", "value", b"value"]) -> builtins.bool: ...
223
223
  def ClearField(self, field_name: typing.Literal["counter_value", b"counter_value", "gauge_value", b"gauge_value", "histogram_value", b"histogram_value", "info_value", b"info_value", "state_set_value", b"state_set_value", "summary_value", b"summary_value", "timestamp", b"timestamp", "unknown_value", b"unknown_value", "value", b"value"]) -> None: ...
224
224
  def WhichOneof(self, oneof_group: typing.Literal["value", b"value"]) -> typing.Literal["unknown_value", "gauge_value", "counter_value", "histogram_value", "state_set_value", "info_value", "summary_value"] | None: ...
225
225
 
226
- global___MetricPoint = MetricPoint
226
+ Global___MetricPoint: typing_extensions.TypeAlias = MetricPoint
227
227
 
228
228
  @typing.final
229
229
  class UnknownValue(google.protobuf.message.Message):
@@ -245,7 +245,7 @@ class UnknownValue(google.protobuf.message.Message):
245
245
  def ClearField(self, field_name: typing.Literal["double_value", b"double_value", "int_value", b"int_value", "value", b"value"]) -> None: ...
246
246
  def WhichOneof(self, oneof_group: typing.Literal["value", b"value"]) -> typing.Literal["double_value", "int_value"] | None: ...
247
247
 
248
- global___UnknownValue = UnknownValue
248
+ Global___UnknownValue: typing_extensions.TypeAlias = UnknownValue
249
249
 
250
250
  @typing.final
251
251
  class GaugeValue(google.protobuf.message.Message):
@@ -267,7 +267,7 @@ class GaugeValue(google.protobuf.message.Message):
267
267
  def ClearField(self, field_name: typing.Literal["double_value", b"double_value", "int_value", b"int_value", "value", b"value"]) -> None: ...
268
268
  def WhichOneof(self, oneof_group: typing.Literal["value", b"value"]) -> typing.Literal["double_value", "int_value"] | None: ...
269
269
 
270
- global___GaugeValue = GaugeValue
270
+ Global___GaugeValue: typing_extensions.TypeAlias = GaugeValue
271
271
 
272
272
  @typing.final
273
273
  class CounterValue(google.protobuf.message.Message):
@@ -288,7 +288,7 @@ class CounterValue(google.protobuf.message.Message):
288
288
  """
289
289
 
290
290
  @property
291
- def exemplar(self) -> global___Exemplar:
291
+ def exemplar(self) -> Global___Exemplar:
292
292
  """Optional."""
293
293
 
294
294
  def __init__(
@@ -297,13 +297,13 @@ class CounterValue(google.protobuf.message.Message):
297
297
  double_value: builtins.float = ...,
298
298
  int_value: builtins.int = ...,
299
299
  created: google.protobuf.timestamp_pb2.Timestamp | None = ...,
300
- exemplar: global___Exemplar | None = ...,
300
+ exemplar: Global___Exemplar | None = ...,
301
301
  ) -> None: ...
302
302
  def HasField(self, field_name: typing.Literal["created", b"created", "double_value", b"double_value", "exemplar", b"exemplar", "int_value", b"int_value", "total", b"total"]) -> builtins.bool: ...
303
303
  def ClearField(self, field_name: typing.Literal["created", b"created", "double_value", b"double_value", "exemplar", b"exemplar", "int_value", b"int_value", "total", b"total"]) -> None: ...
304
304
  def WhichOneof(self, oneof_group: typing.Literal["total", b"total"]) -> typing.Literal["double_value", "int_value"] | None: ...
305
305
 
306
- global___CounterValue = CounterValue
306
+ Global___CounterValue: typing_extensions.TypeAlias = CounterValue
307
307
 
308
308
  @typing.final
309
309
  class HistogramValue(google.protobuf.message.Message):
@@ -327,7 +327,7 @@ class HistogramValue(google.protobuf.message.Message):
327
327
  upper_bound: builtins.float
328
328
  """Optional."""
329
329
  @property
330
- def exemplar(self) -> global___Exemplar:
330
+ def exemplar(self) -> Global___Exemplar:
331
331
  """Optional."""
332
332
 
333
333
  def __init__(
@@ -335,7 +335,7 @@ class HistogramValue(google.protobuf.message.Message):
335
335
  *,
336
336
  count: builtins.int = ...,
337
337
  upper_bound: builtins.float = ...,
338
- exemplar: global___Exemplar | None = ...,
338
+ exemplar: Global___Exemplar | None = ...,
339
339
  ) -> None: ...
340
340
  def HasField(self, field_name: typing.Literal["exemplar", b"exemplar"]) -> builtins.bool: ...
341
341
  def ClearField(self, field_name: typing.Literal["count", b"count", "exemplar", b"exemplar", "upper_bound", b"upper_bound"]) -> None: ...
@@ -356,7 +356,7 @@ class HistogramValue(google.protobuf.message.Message):
356
356
  """
357
357
 
358
358
  @property
359
- def buckets(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___HistogramValue.Bucket]:
359
+ def buckets(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___HistogramValue.Bucket]:
360
360
  """Optional."""
361
361
 
362
362
  def __init__(
@@ -366,13 +366,13 @@ class HistogramValue(google.protobuf.message.Message):
366
366
  int_value: builtins.int = ...,
367
367
  count: builtins.int = ...,
368
368
  created: google.protobuf.timestamp_pb2.Timestamp | None = ...,
369
- buckets: collections.abc.Iterable[global___HistogramValue.Bucket] | None = ...,
369
+ buckets: collections.abc.Iterable[Global___HistogramValue.Bucket] | None = ...,
370
370
  ) -> None: ...
371
371
  def HasField(self, field_name: typing.Literal["created", b"created", "double_value", b"double_value", "int_value", b"int_value", "sum", b"sum"]) -> builtins.bool: ...
372
372
  def ClearField(self, field_name: typing.Literal["buckets", b"buckets", "count", b"count", "created", b"created", "double_value", b"double_value", "int_value", b"int_value", "sum", b"sum"]) -> None: ...
373
373
  def WhichOneof(self, oneof_group: typing.Literal["sum", b"sum"]) -> typing.Literal["double_value", "int_value"] | None: ...
374
374
 
375
- global___HistogramValue = HistogramValue
375
+ Global___HistogramValue: typing_extensions.TypeAlias = HistogramValue
376
376
 
377
377
  @typing.final
378
378
  class Exemplar(google.protobuf.message.Message):
@@ -388,7 +388,7 @@ class Exemplar(google.protobuf.message.Message):
388
388
  """Optional."""
389
389
 
390
390
  @property
391
- def label(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Label]:
391
+ def label(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Label]:
392
392
  """Labels are additional information about the exemplar value (e.g. trace id).
393
393
  Optional.
394
394
  """
@@ -398,12 +398,12 @@ class Exemplar(google.protobuf.message.Message):
398
398
  *,
399
399
  value: builtins.float = ...,
400
400
  timestamp: google.protobuf.timestamp_pb2.Timestamp | None = ...,
401
- label: collections.abc.Iterable[global___Label] | None = ...,
401
+ label: collections.abc.Iterable[Global___Label] | None = ...,
402
402
  ) -> None: ...
403
403
  def HasField(self, field_name: typing.Literal["timestamp", b"timestamp"]) -> builtins.bool: ...
404
404
  def ClearField(self, field_name: typing.Literal["label", b"label", "timestamp", b"timestamp", "value", b"value"]) -> None: ...
405
405
 
406
- global___Exemplar = Exemplar
406
+ Global___Exemplar: typing_extensions.TypeAlias = Exemplar
407
407
 
408
408
  @typing.final
409
409
  class StateSetValue(google.protobuf.message.Message):
@@ -431,17 +431,17 @@ class StateSetValue(google.protobuf.message.Message):
431
431
 
432
432
  STATES_FIELD_NUMBER: builtins.int
433
433
  @property
434
- def states(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___StateSetValue.State]:
434
+ def states(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___StateSetValue.State]:
435
435
  """Optional."""
436
436
 
437
437
  def __init__(
438
438
  self,
439
439
  *,
440
- states: collections.abc.Iterable[global___StateSetValue.State] | None = ...,
440
+ states: collections.abc.Iterable[Global___StateSetValue.State] | None = ...,
441
441
  ) -> None: ...
442
442
  def ClearField(self, field_name: typing.Literal["states", b"states"]) -> None: ...
443
443
 
444
- global___StateSetValue = StateSetValue
444
+ Global___StateSetValue: typing_extensions.TypeAlias = StateSetValue
445
445
 
446
446
  @typing.final
447
447
  class InfoValue(google.protobuf.message.Message):
@@ -451,17 +451,17 @@ class InfoValue(google.protobuf.message.Message):
451
451
 
452
452
  INFO_FIELD_NUMBER: builtins.int
453
453
  @property
454
- def info(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Label]:
454
+ def info(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Label]:
455
455
  """Optional."""
456
456
 
457
457
  def __init__(
458
458
  self,
459
459
  *,
460
- info: collections.abc.Iterable[global___Label] | None = ...,
460
+ info: collections.abc.Iterable[Global___Label] | None = ...,
461
461
  ) -> None: ...
462
462
  def ClearField(self, field_name: typing.Literal["info", b"info"]) -> None: ...
463
463
 
464
- global___InfoValue = InfoValue
464
+ Global___InfoValue: typing_extensions.TypeAlias = InfoValue
465
465
 
466
466
  @typing.final
467
467
  class SummaryValue(google.protobuf.message.Message):
@@ -503,7 +503,7 @@ class SummaryValue(google.protobuf.message.Message):
503
503
  """
504
504
 
505
505
  @property
506
- def quantile(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SummaryValue.Quantile]:
506
+ def quantile(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___SummaryValue.Quantile]:
507
507
  """Optional."""
508
508
 
509
509
  def __init__(
@@ -513,10 +513,10 @@ class SummaryValue(google.protobuf.message.Message):
513
513
  int_value: builtins.int = ...,
514
514
  count: builtins.int = ...,
515
515
  created: google.protobuf.timestamp_pb2.Timestamp | None = ...,
516
- quantile: collections.abc.Iterable[global___SummaryValue.Quantile] | None = ...,
516
+ quantile: collections.abc.Iterable[Global___SummaryValue.Quantile] | None = ...,
517
517
  ) -> None: ...
518
518
  def HasField(self, field_name: typing.Literal["created", b"created", "double_value", b"double_value", "int_value", b"int_value", "sum", b"sum"]) -> builtins.bool: ...
519
519
  def ClearField(self, field_name: typing.Literal["count", b"count", "created", b"created", "double_value", b"double_value", "int_value", b"int_value", "quantile", b"quantile", "sum", b"sum"]) -> None: ...
520
520
  def WhichOneof(self, oneof_group: typing.Literal["sum", b"sum"]) -> typing.Literal["double_value", "int_value"] | None: ...
521
521
 
522
- global___SummaryValue = SummaryValue
522
+ Global___SummaryValue: typing_extensions.TypeAlias = SummaryValue
@@ -20,7 +20,7 @@ import os
20
20
  import sys
21
21
  import uuid
22
22
  from enum import Enum
23
- from typing import TYPE_CHECKING, Any, Callable, Final
23
+ from typing import TYPE_CHECKING, Any, Final
24
24
 
25
25
  from google.protobuf.json_format import ParseDict
26
26
 
@@ -51,7 +51,9 @@ from streamlit.version import STREAMLIT_VERSION_STRING
51
51
  from streamlit.watcher import LocalSourcesWatcher
52
52
 
53
53
  if TYPE_CHECKING:
54
- from streamlit.proto.BackMsg_pb2 import BackMsg
54
+ from collections.abc import Callable
55
+
56
+ from streamlit.proto.BackMsg_pb2 import BackMsg, DeferredFileRequest
55
57
  from streamlit.runtime.script_data import ScriptData
56
58
  from streamlit.runtime.scriptrunner.script_cache import ScriptCache
57
59
  from streamlit.runtime.state import SessionState
@@ -302,6 +304,15 @@ class AppSession:
302
304
  self._handle_stop_script_request()
303
305
  elif msg_type == "file_urls_request":
304
306
  self._handle_file_urls_request(msg.file_urls_request)
307
+ elif msg_type == "deferred_file_request":
308
+ # Execute deferred callable in a separate thread to avoid blocking
309
+ # the main event loop. Use create_task to run the async handler.
310
+ # Store task reference to prevent garbage collection.
311
+ task = asyncio.create_task(
312
+ self._handle_deferred_file_request(msg.deferred_file_request)
313
+ )
314
+ # Add task name for better debugging
315
+ task.set_name(f"deferred_file_{msg.deferred_file_request.file_id}")
305
316
  else:
306
317
  _LOGGER.warning('No handler for "%s"', msg_type)
307
318
 
@@ -736,11 +747,35 @@ class AppSession:
736
747
  msg.new_session, pages or self._pages_manager.get_pages()
737
748
  )
738
749
  _populate_config_msg(msg.new_session.config)
750
+
751
+ # Handles theme sections
752
+ # [theme] configs
739
753
  _populate_theme_msg(msg.new_session.custom_theme)
754
+ # [theme.light] configs
755
+ _populate_theme_msg(
756
+ msg.new_session.custom_theme.light,
757
+ f"theme.{config.CustomThemeCategories.LIGHT.value}",
758
+ )
759
+ # [theme.dark] configs
760
+ _populate_theme_msg(
761
+ msg.new_session.custom_theme.dark,
762
+ f"theme.{config.CustomThemeCategories.DARK.value}",
763
+ )
764
+ # [theme.sidebar] configs
740
765
  _populate_theme_msg(
741
766
  msg.new_session.custom_theme.sidebar,
742
767
  f"theme.{config.CustomThemeCategories.SIDEBAR.value}",
743
768
  )
769
+ # [theme.light.sidebar] configs
770
+ _populate_theme_msg(
771
+ msg.new_session.custom_theme.light.sidebar,
772
+ f"theme.{config.CustomThemeCategories.LIGHT_SIDEBAR.value}",
773
+ )
774
+ # [theme.dark.sidebar] configs
775
+ _populate_theme_msg(
776
+ msg.new_session.custom_theme.dark.sidebar,
777
+ f"theme.{config.CustomThemeCategories.DARK_SIDEBAR.value}",
778
+ )
744
779
 
745
780
  # Immutable session data. We send this every time a new session is
746
781
  # started, to avoid having to track whether the client has already
@@ -896,6 +931,34 @@ class AppSession:
896
931
 
897
932
  self._enqueue_forward_msg(msg)
898
933
 
934
+ async def _handle_deferred_file_request(self, request: DeferredFileRequest) -> None:
935
+ """Handle a deferred_file_request BackMsg sent by the client.
936
+
937
+ Execute the deferred callable in a separate thread and send the URL back
938
+ to the frontend. This prevents blocking the main event loop if the callable
939
+ is slow.
940
+ """
941
+ response = ForwardMsg()
942
+ response.deferred_file_response.file_id = request.file_id
943
+
944
+ try:
945
+ # Execute the deferred callable in a separate thread to avoid blocking
946
+ # the main event loop. This is critical for shared apps where a slow
947
+ # callable could freeze all sessions.
948
+ url = await asyncio.to_thread(
949
+ runtime.get_instance().media_file_mgr.execute_deferred,
950
+ request.file_id,
951
+ )
952
+ response.deferred_file_response.url = url
953
+ except Exception as e:
954
+ # Send error response if callable execution fails
955
+ _LOGGER.exception(
956
+ "Error executing deferred callable for file_id %s", request.file_id
957
+ )
958
+ response.deferred_file_response.error_msg = str(e)
959
+
960
+ self._enqueue_forward_msg(response)
961
+
899
962
  def _populate_app_pages(
900
963
  self, msg: NewSession, pages: dict[PageHash, PageInfo]
901
964
  ) -> None:
@@ -21,15 +21,14 @@ import threading
21
21
  from typing import (
22
22
  TYPE_CHECKING,
23
23
  Any,
24
- Callable,
25
24
  Final,
26
25
  Literal,
26
+ TypeAlias,
27
27
  TypeVar,
28
- Union,
29
28
  overload,
30
29
  )
31
30
 
32
- from typing_extensions import ParamSpec, TypeAlias
31
+ from typing_extensions import ParamSpec
33
32
 
34
33
  import streamlit as st
35
34
  from streamlit import runtime
@@ -66,6 +65,7 @@ from streamlit.runtime.stats import CacheStat, CacheStatsProvider, group_stats
66
65
  from streamlit.time_util import time_to_seconds
67
66
 
68
67
  if TYPE_CHECKING:
68
+ from collections.abc import Callable
69
69
  from datetime import timedelta
70
70
 
71
71
  from streamlit.runtime.caching.hashing import HashFuncsDict
@@ -75,7 +75,7 @@ _LOGGER: Final = get_logger(__name__)
75
75
  CACHE_DATA_MESSAGE_REPLAY_CTX = CachedMessageReplayContext(CacheType.DATA)
76
76
 
77
77
  # The cache persistence options we support: "disk" or None
78
- CachePersistType: TypeAlias = Union[Literal["disk"], None]
78
+ CachePersistType: TypeAlias = Literal["disk"] | None
79
79
 
80
80
 
81
81
  P = ParamSpec("P")
@@ -372,7 +372,7 @@ class CacheDataAPI:
372
372
  hash_funcs: HashFuncsDict | None = None,
373
373
  ) -> CachedFunc[P, R] | Callable[[Callable[P, R]], CachedFunc[P, R]]:
374
374
  return self._decorator(
375
- func,
375
+ func, # ty: ignore[invalid-argument-type]
376
376
  ttl=ttl,
377
377
  max_entries=max_entries,
378
378
  persist=persist,
@@ -14,12 +14,15 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- from typing import Any, Callable, Generic, TypeVar
17
+ from typing import TYPE_CHECKING, Any, Generic, TypeVar
18
18
 
19
19
  from streamlit import type_util
20
20
  from streamlit.errors import MarkdownFormattedException, StreamlitAPIException
21
21
  from streamlit.runtime.caching.cache_type import CacheType, get_decorator_api_name
22
22
 
23
+ if TYPE_CHECKING:
24
+ from collections.abc import Callable
25
+
23
26
  CACHE_DOCS_URL = "https://docs.streamlit.io/develop/concepts/architecture/caching"
24
27
 
25
28
 
@@ -19,17 +19,18 @@ from __future__ import annotations
19
19
 
20
20
  import math
21
21
  import threading
22
+ from collections.abc import Callable
22
23
  from typing import (
23
24
  TYPE_CHECKING,
24
25
  Any,
25
- Callable,
26
26
  Final,
27
+ TypeAlias,
27
28
  TypeVar,
28
29
  overload,
29
30
  )
30
31
 
31
32
  from cachetools import TTLCache
32
- from typing_extensions import ParamSpec, TypeAlias
33
+ from typing_extensions import ParamSpec
33
34
 
34
35
  import streamlit as st
35
36
  from streamlit.logger import get_logger
@@ -246,8 +247,8 @@ class CacheResourceAPI:
246
247
  validate: ValidateFunc | None = None,
247
248
  hash_funcs: HashFuncsDict | None = None,
248
249
  ) -> CachedFunc[P, R] | Callable[[Callable[P, R]], CachedFunc[P, R]]:
249
- return self._decorator(
250
- func,
250
+ return self._decorator( # ty: ignore
251
+ func, # ty: ignore[invalid-argument-type]
251
252
  ttl=ttl,
252
253
  max_entries=max_entries,
253
254
  show_spinner=show_spinner,
@@ -24,7 +24,7 @@ import threading
24
24
  import time
25
25
  from abc import abstractmethod
26
26
  from collections import defaultdict
27
- from typing import TYPE_CHECKING, Any, Callable, Final, Generic, TypeVar, cast, overload
27
+ from typing import TYPE_CHECKING, Any, Final, Generic, TypeVar, cast, overload
28
28
 
29
29
  from typing_extensions import ParamSpec
30
30
 
@@ -54,6 +54,7 @@ from streamlit.runtime.scriptrunner_utils.script_run_context import (
54
54
 
55
55
  if TYPE_CHECKING:
56
56
  import types
57
+ from collections.abc import Callable
57
58
 
58
59
  from streamlit.runtime.caching.cache_type import CacheType
59
60
 
@@ -218,7 +219,7 @@ class CachedFunc(Generic[P, R]): # ty: ignore[invalid-argument-type]
218
219
  if isinstance(self._info.show_spinner, str):
219
220
  spinner_message = self._info.show_spinner
220
221
  elif self._info.show_spinner is True:
221
- name = self._info.func.__qualname__
222
+ name = cast("types.FunctionType", self._info.func).__qualname__
222
223
  if len(args) == 0 and len(kwargs) == 0:
223
224
  spinner_message = f"Running `{name}()`."
224
225
  else:
@@ -17,7 +17,7 @@ from __future__ import annotations
17
17
  import contextlib
18
18
  import threading
19
19
  from dataclasses import dataclass
20
- from typing import TYPE_CHECKING, Any, Callable, Generic, TypeVar, Union
20
+ from typing import TYPE_CHECKING, Any, Generic, TypeAlias, TypeVar
21
21
 
22
22
  from typing_extensions import ParamSpec
23
23
 
@@ -29,7 +29,7 @@ from streamlit.runtime.scriptrunner_utils.script_run_context import (
29
29
  )
30
30
 
31
31
  if TYPE_CHECKING:
32
- from collections.abc import Iterator
32
+ from collections.abc import Callable, Iterator
33
33
 
34
34
  from google.protobuf.message import Message
35
35
 
@@ -69,7 +69,7 @@ class BlockMsgData:
69
69
  returned_dgs_id: str
70
70
 
71
71
 
72
- MsgData = Union[ElementMsgData, BlockMsgData]
72
+ MsgData: TypeAlias = ElementMsgData | BlockMsgData
73
73
 
74
74
 
75
75
  R = TypeVar("R")
@@ -31,12 +31,11 @@ import tempfile
31
31
  import threading
32
32
  import uuid
33
33
  import weakref
34
+ from collections.abc import Callable
34
35
  from enum import Enum
35
36
  from re import Pattern
36
37
  from types import MappingProxyType
37
- from typing import TYPE_CHECKING, Any, Callable, Final, Union, cast
38
-
39
- from typing_extensions import TypeAlias
38
+ from typing import TYPE_CHECKING, Any, Final, TypeAlias, cast
40
39
 
41
40
  from streamlit import logger, type_util, util
42
41
  from streamlit.errors import StreamlitAPIException
@@ -59,7 +58,7 @@ _PANDAS_SAMPLE_SIZE: Final = 10_000
59
58
  _NP_SIZE_LARGE: Final = 500_000
60
59
  _NP_SAMPLE_SIZE: Final = 100_000
61
60
 
62
- HashFuncsDict: TypeAlias = dict[Union[str, type[Any]], Callable[[Any], Any]]
61
+ HashFuncsDict: TypeAlias = dict[str | type[Any], Callable[[Any], Any]]
63
62
 
64
63
  # Arbitrary item to denote where we found a cycle in a hashed object.
65
64
  # This allows us to hash self-referencing lists, dictionaries, etc.
@@ -419,7 +418,7 @@ class _CacheFuncHasher:
419
418
  if type_util.is_type(obj, "pandas.core.series.Series"):
420
419
  from pandas.util import hash_pandas_object
421
420
 
422
- series_obj: pd.Series = cast("pd.Series", obj)
421
+ series_obj = cast("pd.Series[Any]", obj)
423
422
  self.update(h, series_obj.size)
424
423
  self.update(h, series_obj.dtype.name)
425
424
 
@@ -16,7 +16,8 @@
16
16
 
17
17
  from __future__ import annotations
18
18
 
19
- from typing import TYPE_CHECKING, Any, Callable, TypeVar
19
+ from collections.abc import Callable
20
+ from typing import TYPE_CHECKING, Any, TypeVar
20
21
 
21
22
  from streamlit import deprecation_util
22
23
  from streamlit.runtime.caching import CACHE_DOCS_URL
@@ -369,9 +369,7 @@ def connection_factory( # type: ignore
369
369
  """
370
370
 
371
371
  if name.startswith(_USE_ENV_PREFIX):
372
- # It'd be nice to use str.removeprefix() here, but we won't be able to do that
373
- # until the minimum Python version we support is 3.9.
374
- envvar_name = name[len(_USE_ENV_PREFIX) :]
372
+ envvar_name = name.removeprefix(_USE_ENV_PREFIX)
375
373
  name = os.environ[envvar_name]
376
374
 
377
375
  # type is a nice kwarg name for the st.connection user but is annoying to work with