streamlit 1.53.0__py3-none-any.whl → 1.54.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.
- streamlit/__init__.py +1 -31
- streamlit/auth_util.py +91 -2
- streamlit/cli_util.py +3 -2
- streamlit/commands/echo.py +2 -2
- streamlit/commands/execution_control.py +1 -1
- streamlit/commands/logo.py +76 -24
- streamlit/commands/navigation.py +1 -1
- streamlit/components/types/base_custom_component.py +0 -2
- streamlit/components/v1/custom_component.py +0 -2
- streamlit/components/v2/bidi_component/main.py +2 -2
- streamlit/components/v2/component_path_utils.py +17 -29
- streamlit/components/v2/manifest_scanner.py +8 -3
- streamlit/components/v2/presentation.py +1 -1
- streamlit/config.py +57 -13
- streamlit/config_util.py +5 -5
- streamlit/connections/snowflake_connection.py +6 -3
- streamlit/dataframe_util.py +10 -10
- streamlit/deprecation_util.py +19 -1
- streamlit/elements/arrow.py +18 -8
- streamlit/elements/deck_gl_json_chart.py +6 -2
- streamlit/elements/exception.py +4 -2
- streamlit/elements/form.py +1 -1
- streamlit/elements/layouts.py +1 -1
- streamlit/elements/lib/built_in_chart_utils.py +36 -13
- streamlit/elements/lib/color_util.py +21 -2
- streamlit/elements/lib/column_config_utils.py +9 -7
- streamlit/elements/lib/dialog.py +1 -1
- streamlit/elements/lib/image_utils.py +5 -5
- streamlit/elements/lib/layout_utils.py +1 -1
- streamlit/elements/lib/options_selector_utils.py +112 -18
- streamlit/elements/lib/policies.py +1 -1
- streamlit/elements/lib/streamlit_plotly_theme.py +9 -11
- streamlit/elements/lib/utils.py +1 -1
- streamlit/elements/map.py +6 -6
- streamlit/elements/plotly_chart.py +2 -2
- streamlit/elements/toast.py +1 -1
- streamlit/elements/vega_charts.py +30 -7
- streamlit/elements/widgets/button.py +3 -3
- streamlit/elements/widgets/button_group.py +3 -3
- streamlit/elements/widgets/chat.py +1 -1
- streamlit/elements/widgets/data_editor.py +6 -6
- streamlit/elements/widgets/multiselect.py +32 -8
- streamlit/elements/widgets/number_input.py +1 -1
- streamlit/elements/widgets/radio.py +91 -31
- streamlit/elements/widgets/select_slider.py +123 -37
- streamlit/elements/widgets/selectbox.py +38 -16
- streamlit/elements/widgets/slider.py +5 -5
- streamlit/elements/widgets/time_widgets.py +150 -18
- streamlit/elements/write.py +2 -3
- streamlit/env_util.py +1 -1
- streamlit/errors.py +2 -14
- streamlit/external/langchain/streamlit_callback_handler.py +1 -1
- streamlit/hello/dataframe_demo.py +1 -1
- streamlit/hello/plotting_demo.py +19 -12
- streamlit/path_security.py +98 -0
- streamlit/proto/Alert_pb2.py +2 -3
- streamlit/proto/AppPage_pb2.py +2 -3
- streamlit/proto/ArrowData_pb2.py +2 -3
- streamlit/proto/ArrowNamedDataSet_pb2.py +2 -3
- streamlit/proto/ArrowVegaLiteChart_pb2.py +2 -3
- streamlit/proto/Arrow_pb2.py +2 -3
- streamlit/proto/AudioInput_pb2.py +2 -3
- streamlit/proto/Audio_pb2.py +2 -3
- streamlit/proto/AuthRedirect_pb2.py +2 -3
- streamlit/proto/AutoRerun_pb2.py +2 -3
- streamlit/proto/BackMsg_pb2.py +2 -3
- streamlit/proto/Balloons_pb2.py +2 -3
- streamlit/proto/BidiComponent_pb2.py +2 -3
- streamlit/proto/Block_pb2.py +2 -3
- streamlit/proto/BokehChart_pb2.py +2 -3
- streamlit/proto/ButtonGroup_pb2.py +2 -3
- streamlit/proto/ButtonLikeIconPosition_pb2.py +2 -3
- streamlit/proto/Button_pb2.py +2 -3
- streamlit/proto/CameraInput_pb2.py +2 -3
- streamlit/proto/ChatInput_pb2.py +2 -3
- streamlit/proto/Checkbox_pb2.py +2 -3
- streamlit/proto/ClientState_pb2.py +2 -3
- streamlit/proto/Code_pb2.py +2 -3
- streamlit/proto/ColorPicker_pb2.py +2 -3
- streamlit/proto/Common_pb2.py +2 -3
- streamlit/proto/Components_pb2.py +2 -3
- streamlit/proto/DataFrame_pb2.py +2 -3
- streamlit/proto/DateInput_pb2.py +2 -3
- streamlit/proto/DateTimeInput_pb2.py +2 -3
- streamlit/proto/DeckGlJsonChart_pb2.py +2 -3
- streamlit/proto/Delta_pb2.py +2 -3
- streamlit/proto/DocString_pb2.py +2 -3
- streamlit/proto/DownloadButton_pb2.py +2 -3
- streamlit/proto/Element_pb2.py +2 -3
- streamlit/proto/Empty_pb2.py +2 -3
- streamlit/proto/Exception_pb2.py +2 -3
- streamlit/proto/Favicon_pb2.py +2 -3
- streamlit/proto/FileUploader_pb2.py +2 -3
- streamlit/proto/ForwardMsg_pb2.py +2 -3
- streamlit/proto/GapSize_pb2.py +2 -3
- streamlit/proto/GitInfo_pb2.py +2 -3
- streamlit/proto/GraphVizChart_pb2.py +2 -3
- streamlit/proto/Heading_pb2.py +2 -3
- streamlit/proto/HeightConfig_pb2.py +2 -3
- streamlit/proto/Html_pb2.py +2 -3
- streamlit/proto/IFrame_pb2.py +2 -3
- streamlit/proto/Image_pb2.py +2 -3
- streamlit/proto/Json_pb2.py +2 -3
- streamlit/proto/LabelVisibilityMessage_pb2.py +2 -3
- streamlit/proto/LinkButton_pb2.py +2 -3
- streamlit/proto/Logo_pb2.py +6 -5
- streamlit/proto/Logo_pb2.pyi +25 -1
- streamlit/proto/Markdown_pb2.py +2 -3
- streamlit/proto/Metric_pb2.py +2 -3
- streamlit/proto/MetricsEvent_pb2.py +2 -3
- streamlit/proto/MultiSelect_pb2.py +2 -3
- streamlit/proto/NamedDataSet_pb2.py +2 -3
- streamlit/proto/Navigation_pb2.py +2 -3
- streamlit/proto/NewSession_pb2.py +25 -24
- streamlit/proto/NewSession_pb2.pyi +28 -2
- streamlit/proto/NumberInput_pb2.py +2 -3
- streamlit/proto/PageConfig_pb2.py +2 -3
- streamlit/proto/PageInfo_pb2.py +2 -3
- streamlit/proto/PageLink_pb2.py +2 -3
- streamlit/proto/PageNotFound_pb2.py +2 -3
- streamlit/proto/PageProfile_pb2.py +2 -3
- streamlit/proto/PagesChanged_pb2.py +2 -3
- streamlit/proto/ParentMessage_pb2.py +2 -3
- streamlit/proto/PlotlyChart_pb2.py +2 -3
- streamlit/proto/Progress_pb2.py +2 -3
- streamlit/proto/Radio_pb2.py +5 -4
- streamlit/proto/Radio_pb2.pyi +20 -3
- streamlit/proto/RootContainer_pb2.py +2 -3
- streamlit/proto/Selectbox_pb2.py +2 -3
- streamlit/proto/SessionEvent_pb2.py +2 -3
- streamlit/proto/SessionStatus_pb2.py +2 -3
- streamlit/proto/Skeleton_pb2.py +2 -3
- streamlit/proto/Slider_pb2.py +7 -8
- streamlit/proto/Slider_pb2.pyi +9 -1
- streamlit/proto/Snow_pb2.py +2 -3
- streamlit/proto/Space_pb2.py +2 -3
- streamlit/proto/Spinner_pb2.py +2 -3
- streamlit/proto/TextAlignmentConfig_pb2.py +2 -3
- streamlit/proto/TextArea_pb2.py +2 -3
- streamlit/proto/TextInput_pb2.py +2 -3
- streamlit/proto/Text_pb2.py +2 -3
- streamlit/proto/TimeInput_pb2.py +2 -3
- streamlit/proto/Toast_pb2.py +2 -3
- streamlit/proto/Transient_pb2.py +2 -3
- streamlit/proto/VegaLiteChart_pb2.py +2 -3
- streamlit/proto/Video_pb2.py +2 -3
- streamlit/proto/WidgetStates_pb2.py +2 -3
- streamlit/proto/WidthConfig_pb2.py +2 -3
- streamlit/proto/openmetrics_data_model_pb2.py +2 -3
- streamlit/runtime/app_session.py +106 -60
- streamlit/runtime/caching/cache_data_api.py +3 -3
- streamlit/runtime/caching/cache_errors.py +0 -2
- streamlit/runtime/caching/cache_resource_api.py +1 -1
- streamlit/runtime/caching/cache_utils.py +2 -2
- streamlit/runtime/caching/hashing.py +1 -3
- streamlit/runtime/caching/storage/cache_storage_protocol.py +0 -3
- streamlit/runtime/connection_factory.py +1 -1
- streamlit/runtime/credentials.py +2 -2
- streamlit/runtime/metrics_util.py +3 -3
- streamlit/runtime/runtime.py +6 -6
- streamlit/runtime/scriptrunner/script_runner.py +17 -0
- streamlit/runtime/scriptrunner_utils/exceptions.py +0 -4
- streamlit/runtime/scriptrunner_utils/script_run_context.py +13 -31
- streamlit/runtime/secrets.py +3 -4
- streamlit/runtime/state/__init__.py +7 -1
- streamlit/runtime/state/common.py +13 -0
- streamlit/runtime/state/query_params.py +493 -24
- streamlit/runtime/state/session_state.py +179 -4
- streamlit/runtime/state/widgets.py +26 -1
- streamlit/runtime/stats.py +1 -10
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +304 -304
- streamlit/static/static/js/{ErrorOutline.esm.Cxoit62D.js → ErrorOutline.esm.BWk6F-Tz.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.Cym2KVOR.js → FileDownload.esm.AllYUuOW.js} +1 -1
- streamlit/static/static/js/{FileHelper.C47VLeXF.js → FileHelper.BvVTNdmy.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.CUrwwEeX.js → FormClearHelper.C__r5Llk.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DyVOE42q.js → InputInstructions.DOtkdOMV.js} +1 -1
- streamlit/static/static/js/Particles.DCsqQZlE.js +1 -0
- streamlit/static/static/js/{ProgressBar.qKdiDYyx.js → ProgressBar.DLCRvt4m.js} +2 -2
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.DUPp9dS3.js → StreamlitSyntaxHighlighter.CYFWoZHb.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.C_g2CvCE.js → TableChart.esm.D6ydHcIm.js} +1 -1
- streamlit/static/static/js/Toolbar.BHDNzWBx.js +1 -0
- streamlit/static/static/js/{WidgetLabelHelpIconInline.Dy4yV6I2.js → WidgetLabelHelpIconInline.DEXBrVlc.js} +1 -1
- streamlit/static/static/js/{base-input.DQAb60v0.js → base-input.TSQjctlq.js} +4 -4
- streamlit/static/static/js/{checkbox.C0HE0ojW.js → checkbox.BKgfzJZV.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.DBMfH8_e.js → createDownloadLinkElement.CG7nr2a4.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CSZWem5Q.js → data-grid-overlay-editor.ChXO__lP.js} +1 -1
- streamlit/static/static/js/{downloader.Bp8c7mYD.js → downloader.DJ3R_zWA.js} +1 -1
- streamlit/static/static/js/embed.u3PPfLkw.js +193 -0
- streamlit/static/static/js/{es6.j7akTCaI.js → es6.C5Mfy8nd.js} +2 -2
- streamlit/static/static/js/{formatNumber.CfuUiEpF.js → formatNumber.CMRgW9EJ.js} +1 -1
- streamlit/static/static/js/{iconPosition.BVSTKfGd.js → iconPosition.B4EEXI3E.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.BZ3lugzo.js → iframeResizer.contentWindow.WSvOiTW0.js} +1 -1
- streamlit/static/static/js/index.-FOBV3nz.js +1 -0
- streamlit/static/static/js/{index.D0tXFTaW.js → index.-NF8OSF5.js} +1 -1
- streamlit/static/static/js/{index.Dk0CU4R6.js → index.4cBg8kn5.js} +1 -1
- streamlit/static/static/js/{index.DtZTtufl.js → index.B0pzzCsH.js} +1 -1
- streamlit/static/static/js/{index.DSaE74nc.js → index.BID6ND5j.js} +2 -2
- streamlit/static/static/js/index.BMp5bGjh.js +1 -0
- streamlit/static/static/js/{index.CAMxgVFm.js → index.BQcmlvas.js} +1 -1
- streamlit/static/static/js/{index.C0F0G-wg.js → index.BRcmclgI.js} +1 -1
- streamlit/static/static/js/index.BaUZR4IG.js +1 -0
- streamlit/static/static/js/{index.Cow0Hs9V.js → index.BbMJj4PN.js} +1 -1
- streamlit/static/static/js/{index.iboGgrkh.js → index.BdCTJtq3.js} +2 -2
- streamlit/static/static/js/index.BdETLMuI.js +1 -0
- streamlit/static/static/js/index.BnKMWhs1.js +1 -0
- streamlit/static/static/js/index.Br1kXwQW.js +2 -0
- streamlit/static/static/js/{index.B2fTHpId.js → index.Bt2olRE4.js} +1 -1
- streamlit/static/static/js/{index.DBIRzFM7.js → index.Bxwsv5T8.js} +1 -1
- streamlit/static/static/js/index.C4KskYz6.js +1 -0
- streamlit/static/static/js/{index.BgCYNmov.js → index.C6bmbXk0.js} +1 -1
- streamlit/static/static/js/{index.7S_sCSRx.js → index.CEfKfbta.js} +1 -1
- streamlit/static/static/js/index.CIuaA8q0.js +2 -0
- streamlit/static/static/js/{index.CWAvu1Qu.js → index.CV1sObFX.js} +1 -1
- streamlit/static/static/js/{index.C9QftD-S.js → index.CbR6dgaV.js} +1 -1
- streamlit/static/static/js/index.Cq6szKqJ.js +1 -0
- streamlit/static/static/js/index.CyouXqCz.js +1 -0
- streamlit/static/static/js/{index.BMFt07G_.js → index.D1NUgMFI.js} +1 -1
- streamlit/static/static/js/{index.Tq2okoAU.js → index.D7SWG4Om.js} +1 -1
- streamlit/static/static/js/{index.DgJeIFb5.js → index.DAYPEwLI.js} +1 -1
- streamlit/static/static/js/index.DKS75Vfg.js +11 -0
- streamlit/static/static/js/{index.FfR9SXQv.js → index.DOXrMIxB.js} +1 -1
- streamlit/static/static/js/{index.BiVJWMS-.js → index.DOzYX8yS.js} +3 -3
- streamlit/static/static/js/{index.nEa8y_He.js → index.DRFMYcC4.js} +4 -4
- streamlit/static/static/js/{index.dgs1TGpP.js → index.Divl5FCY.js} +1 -1
- streamlit/static/static/js/{index.95DldRtG.js → index.DjAJ_CUa.js} +1 -1
- streamlit/static/static/js/{index.Z0mB4zBp.js → index.Dncue2pm.js} +33 -33
- streamlit/static/static/js/{index.DFT9nVK6.js → index.Drusyo5m.js} +48 -48
- streamlit/static/static/js/{index.1PD6f3vh.js → index.DuUyDGnP.js} +1 -1
- streamlit/static/static/js/{index.DpU0Bc2F.js → index.DvgT2rB2.js} +223 -223
- streamlit/static/static/js/{index.Bukztsaz.js → index.DzutABu5.js} +2 -2
- streamlit/static/static/js/index.Dzw2iPzi.js +3 -0
- streamlit/static/static/js/{index.DYkkO_of.js → index.FsTmxLbT.js} +1 -1
- streamlit/static/static/js/{index.CTQ8QcOV.js → index.OIwPqGYN.js} +1 -1
- streamlit/static/static/js/{index.NtSfVVJe.js → index.RXLN7YFT.js} +2 -2
- streamlit/static/static/js/{index.BU3d_gp1.js → index.YYb2u0jk.js} +2 -2
- streamlit/static/static/js/{index.BXfSsjdq.js → index.h8ejt-W3.js} +1 -1
- streamlit/static/static/js/{index.gPUFpUqs.js → index.lFMCi9am.js} +1 -1
- streamlit/static/static/js/{index.BDA5l7b9.js → index.pOgf4cEj.js} +1 -1
- streamlit/static/static/js/index.s_E0s7LB.js +188 -0
- streamlit/static/static/js/{index.DysJZEAt.js → index.xLCbzoqj.js} +1 -1
- streamlit/static/static/js/{input.Pz8Lwzsi.js → input.BLG7kWaj.js} +2 -2
- streamlit/static/static/js/{main.BeiYkHRo.js → main.D_CmqChN.js} +1 -1
- streamlit/static/static/js/{memory.Dyx_JBbb.js → memory.T8u9KqIQ.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.NLIdF6b9.js → number-overlay-editor.BKBSXkAM.js} +2 -2
- streamlit/static/static/js/{pandasStylerUtils.DsNlDEqS.js → pandasStylerUtils.B4tLYMwS.js} +1 -1
- streamlit/static/static/js/{sandbox.bER7qtR1.js → sandbox.jRlkcPem.js} +1 -1
- streamlit/static/static/js/{styled-components.DcoFBb7G.js → styled-components.D2QhNwzd.js} +1 -1
- streamlit/static/static/js/{throttle.DOaQWO4U.js → throttle.Cyw_V0Dq.js} +1 -1
- streamlit/static/static/js/{timepicker.RjHB2IT4.js → timepicker.PzyuDDWl.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DFAIugL0.js → toConsumableArray.gE9fMkLj.js} +1 -1
- streamlit/static/static/js/uniqueId.B1GeHnT1.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.CTtyymrp.js → useBasicWidgetState.DFklfao0.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.DG5haQGX.js → useIntlLocale.C3tUGWTU.js} +8 -8
- streamlit/static/static/js/{useTextInputAutoExpand.Cnfcep1Z.js → useTextInputAutoExpand.D9nU_y-e.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.ClTdrkJN.js +1 -0
- streamlit/static/static/js/{useWaveformController.DozaayUB.js → useWaveformController.lzTbjMW2.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.SNNFFxhJ.js → withCalculatedWidth.Dxs9I5Oe.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.Dl2f8_gt.js → withFullScreenWrapper.DfpAcJxf.js} +1 -1
- streamlit/string_util.py +2 -2
- streamlit/testing/v1/app_test.py +1 -1
- streamlit/testing/v1/element_tree.py +33 -20
- streamlit/type_util.py +2 -2
- streamlit/url_util.py +2 -2
- streamlit/user_info.py +2 -41
- streamlit/util.py +1 -1
- streamlit/watcher/event_based_path_watcher.py +37 -7
- streamlit/watcher/path_watcher.py +61 -2
- streamlit/watcher/util.py +26 -10
- streamlit/web/bootstrap.py +16 -4
- streamlit/web/cli.py +1 -4
- streamlit/web/server/app_discovery.py +2 -1
- streamlit/web/server/app_static_file_handler.py +9 -0
- streamlit/web/server/bidi_component_request_handler.py +4 -4
- streamlit/web/server/component_file_utils.py +14 -6
- streamlit/web/server/component_request_handler.py +2 -2
- streamlit/web/server/oauth_authlib_routes.py +14 -42
- streamlit/web/server/server.py +1 -1
- streamlit/web/server/server_util.py +23 -1
- streamlit/web/server/starlette/starlette_app.py +7 -1
- streamlit/web/server/starlette/starlette_auth_routes.py +94 -16
- streamlit/web/server/starlette/starlette_path_security_middleware.py +97 -0
- streamlit/web/server/starlette/starlette_routes.py +16 -9
- streamlit/web/server/starlette/starlette_server.py +2 -2
- streamlit/web/server/starlette/starlette_static_routes.py +14 -4
- streamlit/web/server/stats_request_handler.py +1 -3
- {streamlit-1.53.0.dist-info → streamlit-1.54.0.dist-info}/METADATA +10 -25
- {streamlit-1.53.0.dist-info → streamlit-1.54.0.dist-info}/RECORD +291 -291
- {streamlit-1.53.0.dist-info → streamlit-1.54.0.dist-info}/WHEEL +1 -1
- streamlit/commands/experimental_query_params.py +0 -169
- streamlit/static/static/js/Particles.D5ZUTvE6.js +0 -1
- streamlit/static/static/js/Toolbar.BbO8bxwz.js +0 -1
- streamlit/static/static/js/embed.DQBlGL9Q.js +0 -195
- streamlit/static/static/js/index.5CsPRetw.js +0 -1
- streamlit/static/static/js/index.BGgra9Bb.js +0 -188
- streamlit/static/static/js/index.BGzJYcHz.js +0 -1
- streamlit/static/static/js/index.BNpEDrb2.js +0 -1
- streamlit/static/static/js/index.Bk5wGJXh.js +0 -1
- streamlit/static/static/js/index.By8GIgDH.js +0 -1
- streamlit/static/static/js/index.C8VoW8Ph.js +0 -1
- streamlit/static/static/js/index.CZzy-Gct.js +0 -1
- streamlit/static/static/js/index.CeFdbzfR.js +0 -11
- streamlit/static/static/js/index.CkmNfvPD.js +0 -1
- streamlit/static/static/js/index.CsmTnJl4.js +0 -3
- streamlit/static/static/js/index.DZGCJu4I.js +0 -2
- streamlit/static/static/js/index.svncz-Ad.js +0 -2
- streamlit/static/static/js/uniqueId.DEvFPH9n.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.BWnXwmrp.js +0 -1
- streamlit-1.53.0.data/scripts/streamlit.cmd +0 -16
- {streamlit-1.53.0.dist-info → streamlit-1.54.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.53.0.dist-info → streamlit-1.54.0.dist-info}/top_level.txt +0 -0
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026)
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
from typing import Any
|
|
18
|
-
from urllib import parse
|
|
19
|
-
|
|
20
|
-
from streamlit.errors import StreamlitAPIException
|
|
21
|
-
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
|
22
|
-
from streamlit.runtime.metrics_util import gather_metrics
|
|
23
|
-
from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
|
|
24
|
-
from streamlit.runtime.state.query_params import (
|
|
25
|
-
EMBED_OPTIONS_QUERY_PARAM,
|
|
26
|
-
EMBED_QUERY_PARAM,
|
|
27
|
-
EMBED_QUERY_PARAMS_KEYS,
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@gather_metrics("experimental_get_query_params")
|
|
32
|
-
def get_query_params() -> dict[str, list[str]]:
|
|
33
|
-
"""Return the query parameters that is currently showing in the browser's URL bar.
|
|
34
|
-
|
|
35
|
-
Returns
|
|
36
|
-
-------
|
|
37
|
-
dict
|
|
38
|
-
The current query parameters as a dict. "Query parameters" are the part of the URL that comes
|
|
39
|
-
after the first "?".
|
|
40
|
-
|
|
41
|
-
Example
|
|
42
|
-
-------
|
|
43
|
-
Let's say the user's web browser is at
|
|
44
|
-
`http://localhost:8501/?show_map=True&selected=asia&selected=america`.
|
|
45
|
-
Then, you can get the query parameters using the following:
|
|
46
|
-
|
|
47
|
-
>>> import streamlit as st
|
|
48
|
-
>>>
|
|
49
|
-
>>> st.experimental_get_query_params()
|
|
50
|
-
{"show_map": ["True"], "selected": ["asia", "america"]}
|
|
51
|
-
|
|
52
|
-
Note that the values in the returned dict are *always* lists. This is
|
|
53
|
-
because we internally use Python's urllib.parse.parse_qs(), which behaves
|
|
54
|
-
this way. And this behavior makes sense when you consider that every item
|
|
55
|
-
in a query string is potentially a 1-element array.
|
|
56
|
-
|
|
57
|
-
"""
|
|
58
|
-
ctx = get_script_run_ctx()
|
|
59
|
-
if ctx is None:
|
|
60
|
-
return {}
|
|
61
|
-
ctx.mark_experimental_query_params_used()
|
|
62
|
-
# Return new query params dict, but without embed, embed_options query params
|
|
63
|
-
return _exclude_keys_in_dict(
|
|
64
|
-
parse.parse_qs(ctx.query_string, keep_blank_values=True),
|
|
65
|
-
keys_to_exclude=EMBED_QUERY_PARAMS_KEYS,
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@gather_metrics("experimental_set_query_params")
|
|
70
|
-
def set_query_params(**query_params: Any) -> None:
|
|
71
|
-
"""Set the query parameters that are shown in the browser's URL bar.
|
|
72
|
-
|
|
73
|
-
.. warning::
|
|
74
|
-
Query param `embed` cannot be set using this method.
|
|
75
|
-
|
|
76
|
-
Parameters
|
|
77
|
-
----------
|
|
78
|
-
**query_params : dict
|
|
79
|
-
The query parameters to set, as key-value pairs.
|
|
80
|
-
|
|
81
|
-
Example
|
|
82
|
-
-------
|
|
83
|
-
|
|
84
|
-
To point the user's web browser to something like
|
|
85
|
-
"http://localhost:8501/?show_map=True&selected=asia&selected=america",
|
|
86
|
-
you would do the following:
|
|
87
|
-
|
|
88
|
-
>>> import streamlit as st
|
|
89
|
-
>>>
|
|
90
|
-
>>> st.experimental_set_query_params(
|
|
91
|
-
... show_map=True,
|
|
92
|
-
... selected=["asia", "america"],
|
|
93
|
-
... )
|
|
94
|
-
|
|
95
|
-
"""
|
|
96
|
-
ctx = get_script_run_ctx()
|
|
97
|
-
if ctx is None:
|
|
98
|
-
return
|
|
99
|
-
ctx.mark_experimental_query_params_used()
|
|
100
|
-
|
|
101
|
-
msg = ForwardMsg()
|
|
102
|
-
msg.page_info_changed.query_string = _ensure_no_embed_params(
|
|
103
|
-
query_params, ctx.query_string
|
|
104
|
-
)
|
|
105
|
-
ctx.query_string = msg.page_info_changed.query_string
|
|
106
|
-
ctx.enqueue(msg)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def _exclude_keys_in_dict(
|
|
110
|
-
d: dict[str, Any], keys_to_exclude: list[str]
|
|
111
|
-
) -> dict[str, Any]:
|
|
112
|
-
"""Returns new object but without keys defined in keys_to_exclude."""
|
|
113
|
-
return {
|
|
114
|
-
key: value for key, value in d.items() if key.lower() not in keys_to_exclude
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def _extract_key_query_params(
|
|
119
|
-
query_params: dict[str, list[str]], param_key: str
|
|
120
|
-
) -> set[str]:
|
|
121
|
-
"""Extracts key (case-insensitive) query params from Dict, and returns them as Set of str."""
|
|
122
|
-
return {
|
|
123
|
-
item.lower()
|
|
124
|
-
for sublist in [
|
|
125
|
-
[value.lower() for value in query_params[key]]
|
|
126
|
-
for key in query_params
|
|
127
|
-
if key.lower() == param_key and query_params.get(key)
|
|
128
|
-
]
|
|
129
|
-
for item in sublist
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
def _ensure_no_embed_params(
|
|
134
|
-
query_params: dict[str, list[str] | str], query_string: str
|
|
135
|
-
) -> str:
|
|
136
|
-
"""Ensures there are no embed params set (raises StreamlitAPIException) if there is a try,
|
|
137
|
-
also makes sure old param values in query_string are preserved. Returns query_string : str.
|
|
138
|
-
"""
|
|
139
|
-
# Get query params dict without embed, embed_options params
|
|
140
|
-
query_params_without_embed = _exclude_keys_in_dict(
|
|
141
|
-
query_params, keys_to_exclude=EMBED_QUERY_PARAMS_KEYS
|
|
142
|
-
)
|
|
143
|
-
if query_params != query_params_without_embed:
|
|
144
|
-
raise StreamlitAPIException(
|
|
145
|
-
"Query param embed and embed_options (case-insensitive) cannot be set using set_query_params method."
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
all_current_params = parse.parse_qs(query_string, keep_blank_values=True)
|
|
149
|
-
current_embed_params = parse.urlencode(
|
|
150
|
-
{
|
|
151
|
-
EMBED_QUERY_PARAM: list(
|
|
152
|
-
_extract_key_query_params(
|
|
153
|
-
all_current_params, param_key=EMBED_QUERY_PARAM
|
|
154
|
-
)
|
|
155
|
-
),
|
|
156
|
-
EMBED_OPTIONS_QUERY_PARAM: list(
|
|
157
|
-
_extract_key_query_params(
|
|
158
|
-
all_current_params, param_key=EMBED_OPTIONS_QUERY_PARAM
|
|
159
|
-
)
|
|
160
|
-
),
|
|
161
|
-
},
|
|
162
|
-
doseq=True,
|
|
163
|
-
)
|
|
164
|
-
query_string = parse.urlencode(query_params, doseq=True)
|
|
165
|
-
|
|
166
|
-
if query_string:
|
|
167
|
-
separator = "&" if current_embed_params else ""
|
|
168
|
-
return separator.join([query_string, current_embed_params])
|
|
169
|
-
return current_embed_params
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,ak as d,al as p,j as s,a0 as x,F as C,L as f,O as g}from"./index.DFT9nVK6.js";const M=({children:t})=>{const e=a.useContext(d)?.();return e?p.createPortal(t,e):s(x,{children:t})},P=C("div",{target:"e1smm6vf0"})({"@media print":{display:"none"}}),u=({className:t,scriptRunId:e,numParticles:o,numParticleTypes:r,ParticleComponent:n})=>{const{resourceCrossOriginMode:i}=a.useContext(f),c=a.useMemo(()=>g(o).map(()=>Math.floor(Math.random()*r)),[o,r]);return s(P,{className:t,"data-testid":t,children:c.map((l,m)=>s(n,{particleType:l,resourceCrossOriginMode:i},e+m))})},y=a.memo(u);export{y as P,M as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,E as m,_ as u,F as d,m as w,j as n,o as v,l as x,aA as E,P as b,B as g,az as T,b as y,q as B}from"./index.DFT9nVK6.js";var h=s.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(m,u({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))});h.displayName="Fullscreen";var f=s.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(m,u({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))});f.displayName="FullscreenExit";const c="-2.65rem",z=d("div",{target:"e1usqpj00"})(({theme:t,locked:e,target:o})=>({padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:e?c:"-1rem",right:t.spacing.none,transition:"none",...!e&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c},...o&&{[`${o}:hover &, ${o}:active &, ${o}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c}}}})),C=d("div",{target:"e1usqpj01"})(({theme:t})=>({color:w(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1,padding:t.spacing.twoXS})),A=d("div",{target:"e1usqpj02"})(({height:t,useContainerWidth:e,topCentered:o,useContainerHeight:a})=>({position:"relative",height:e&&t?t:a?t||"100%":"fit-content",maxWidth:"100%",width:e?"100%":"fit-content",...o?{display:"flex",justifyContent:"center"}:{}}));function p({label:t,show_label:e,icon:o,onClick:a}){const r=x(),i=e?t:"";return n("div",{"data-testid":"stElementToolbarButton",children:n(E,{content:n(B,{source:t,allowHTML:!1,style:{fontSize:r.fontSizes.sm}}),placement:b.TOP,onMouseEnterDelay:1e3,inline:!0,children:v(y,{onClick:l=>{a&&a(),l.stopPropagation()},kind:g.ELEMENT_TOOLBAR,"aria-label":t,children:[o&&n(T,{content:o,size:"md",testid:"stElementToolbarButtonIcon"}),i&&n("span",{children:i})]})})})}const M=({onExpand:t,onCollapse:e,isFullScreen:o,locked:a,children:r,target:i,disableFullscreenMode:l})=>n(z,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||o,target:i,children:v(C,{"data-testid":"stElementToolbarButtonContainer",children:[r,t&&!l&&!o&&n(p,{label:"Fullscreen",icon:h,onClick:()=>t()}),e&&!l&&o&&n(p,{label:"Close fullscreen",icon:f,onClick:()=>e()})]})});export{A as S,M as T,p as a};
|