streamlit-nightly 1.46.2.dev20250708__py3-none-any.whl → 1.46.2.dev20250710__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/elements/vega_charts.py +8 -0
- streamlit/elements/widgets/chat.py +35 -5
- streamlit/runtime/secrets.py +4 -8
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +214 -214
- streamlit/static/static/js/{ErrorOutline.esm.CO5UETnI.js → ErrorOutline.esm.DcxmqjUD.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BodlLZ2E.js → FileDownload.esm.jHGWeFoc.js} +1 -1
- streamlit/static/static/js/{FileHelper.BJWG5mWZ.js → FileHelper.Zrnryqu0.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.Bfl6Fb0k.js → FormClearHelper.BYxFNamA.js} +1 -1
- streamlit/static/static/js/{Hooks.BZNasbgB.js → Hooks.Bf489OB5.js} +1 -1
- streamlit/static/static/js/{InputInstructions.D9_advjq.js → InputInstructions.BOAAgTvb.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BOxvIdHT.js → ProgressBar.CHyAN4g4.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.B-maQ3lr.js → RenderInPortalIfExists.BnEeVRFq.js} +1 -1
- streamlit/static/static/js/{Toolbar.BulWrSVh.js → Toolbar.CXl8zpFb.js} +1 -1
- streamlit/static/static/js/{base-input.oeeD4NYL.js → base-input.Df0b6Qry.js} +1 -1
- streamlit/static/static/js/{checkbox.BqkhIzEX.js → checkbox._czeraZi.js} +1 -1
- streamlit/static/static/js/{createSuper.bxk9uEsc.js → createSuper.ZqMAxMzx.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BFUaa7qj.js → data-grid-overlay-editor.Bok03B1i.js} +1 -1
- streamlit/static/static/js/{downloader.CkJ9l-mW.js → downloader.C4jTgaKc.js} +1 -1
- streamlit/static/static/js/{es6.CwBeRZxt.js → es6.Do-e8HO9.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.B4xDykub.js → iframeResizer.contentWindow.mWYZgJrl.js} +1 -1
- streamlit/static/static/js/{index.CFoM9W4u.js → index.-qN84VXE.js} +1 -1
- streamlit/static/static/js/{index.um9CUbiU.js → index.35y_AzR4.js} +1 -1
- streamlit/static/static/js/{index.FerMd1cU.js → index.B1l9OvXj.js} +1 -1
- streamlit/static/static/js/index.BF_sb0WL.js +73 -0
- streamlit/static/static/js/{index.BHzjJ3JF.js → index.BIEGVO6Q.js} +5 -5
- streamlit/static/static/js/{index.DQXLgrs8.js → index.BPbIttLy.js} +1 -1
- streamlit/static/static/js/{index.BffMV8Pv.js → index.BVdmv4f9.js} +1 -1
- streamlit/static/static/js/{index.zT8XLZtx.js → index.BnBtCCi7.js} +1 -1
- streamlit/static/static/js/{index.D3TXItBH.js → index.Bys870gz.js} +1 -1
- streamlit/static/static/js/{index.DgSLJq20.js → index.BzF3lrfB.js} +1 -1
- streamlit/static/static/js/{index.Bejef4Pk.js → index.C3rroFP9.js} +3 -3
- streamlit/static/static/js/{index.D4WIU5V6.js → index.CF7mP-ZJ.js} +1 -1
- streamlit/static/static/js/{index.B0vAXwMf.js → index.Ca2H30nP.js} +1 -1
- streamlit/static/static/js/{index.BNmqvLux.js → index.Ci7nbB2g.js} +1 -1
- streamlit/static/static/js/{index.aAeBp5Oj.js → index.CjIM7ERG.js} +1 -1
- streamlit/static/static/js/{index.BAyahmk4.js → index.CoYJofEx.js} +1 -1
- streamlit/static/static/js/{index.BPKHA8Id.js → index.CqLB334S.js} +1 -1
- streamlit/static/static/js/{index.DFRMOZ8C.js → index.DFXciakO.js} +173 -173
- streamlit/static/static/js/{index.BGGyfLIH.js → index.DGHrEEt1.js} +1 -1
- streamlit/static/static/js/{index.VY0EoknV.js → index.DHdGt5Y8.js} +1 -1
- streamlit/static/static/js/{index.C795t44A.js → index.DLiM-whD.js} +1 -1
- streamlit/static/static/js/{index.BdnKKSPg.js → index.DTxuG-7x.js} +1 -1
- streamlit/static/static/js/{index.JlbLrYBv.js → index.D_0R5OBc.js} +7 -7
- streamlit/static/static/js/{index.CIeZ4fAx.js → index.DcO57awd.js} +1 -1
- streamlit/static/static/js/{index.CL4vTLmN.js → index.DmGoE186.js} +1 -1
- streamlit/static/static/js/{index.BTHnpf1I.js → index.DmjIEMLZ.js} +1 -1
- streamlit/static/static/js/{index.CfqX1ZBe.js → index.DsGIFS7a.js} +1 -1
- streamlit/static/static/js/{index.D-8V3tc4.js → index.GgXBejJs.js} +1 -1
- streamlit/static/static/js/{index.Ba65H8D9.js → index.MiKM7bk8.js} +1 -1
- streamlit/static/static/js/{index.BP1DQKkm.js → index.QaE_KRXJ.js} +1 -1
- streamlit/static/static/js/{index.BypmpIBL.js → index.dGEV5Rcv.js} +1 -1
- streamlit/static/static/js/{index.B6ClyDWN.js → index.eyf91ITY.js} +1 -1
- streamlit/static/static/js/{index.Dl-ChXDk.js → index.fAtLaEj3.js} +1 -1
- streamlit/static/static/js/{index.oJk4Ge1s.js → index.kBQMwU6d.js} +1 -1
- streamlit/static/static/js/{index.BxVKLNUY.js → index.mvbBbK3q.js} +1 -1
- streamlit/static/static/js/{index.CIEFJvy6.js → index.rOGHN7Ug.js} +1 -1
- streamlit/static/static/js/{index.CGqm8hCs.js → index.rvtw60Rz.js} +1 -1
- streamlit/static/static/js/{input.C3tznRn_.js → input.CbSNLKWI.js} +1 -1
- streamlit/static/static/js/{memory.OHbOX5Ru.js → memory.jXCvhbgc.js} +1 -1
- streamlit/static/static/js/{mergeWith._KN0v5Xp.js → mergeWith.DrPpfkW2.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BKok-OUE.js → number-overlay-editor.DcUxabQJ.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.BfCdE8Gx.js → possibleConstructorReturn.CzPR4xGM.js} +1 -1
- streamlit/static/static/js/{sandbox.BeWP76j9.js → sandbox.Bd0m3BOh.js} +1 -1
- streamlit/static/static/js/{timepicker.C8LfA2ZU.js → timepicker.CpLBXuBk.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.BHlwNsw4.js → toConsumableArray.D_piEkI9.js} +1 -1
- streamlit/static/static/js/{uniqueId.Ds4mfmXu.js → uniqueId.wDqRFq8o.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Ds5amAnj.js → useBasicWidgetState.rpbnEZqG.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CnPrmPV-.js → useOnInputChange.DLCh37tX.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.DRi3Jfhk.js → useTextInputAutoExpand.Ba7vlWvW.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.DtwYvNjS.js → withFullScreenWrapper.Cqo3BmOl.js} +1 -1
- streamlit/watcher/event_based_path_watcher.py +3 -2
- streamlit/watcher/polling_path_watcher.py +2 -1
- {streamlit_nightly-1.46.2.dev20250708.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.46.2.dev20250708.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/RECORD +79 -79
- streamlit/static/static/js/index.D-sXGL7m.js +0 -73
- {streamlit_nightly-1.46.2.dev20250708.data → streamlit_nightly-1.46.2.dev20250710.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.2.dev20250708.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.2.dev20250708.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.2.dev20250708.dist-info → streamlit_nightly-1.46.2.dev20250710.dist-info}/top_level.txt +0 -0
@@ -296,8 +296,16 @@ def _prepare_vega_lite_spec(
|
|
296
296
|
# on vconcat with use_container_width=True as there are unintended
|
297
297
|
# consequences of changing the default autosize for all charts.
|
298
298
|
# fit-x fits the width and height can be adjusted.
|
299
|
+
is_facet_chart = "facet" in spec or (
|
300
|
+
"encoding" in spec
|
301
|
+
and (any(x in spec["encoding"] for x in ["row", "column", "facet"]))
|
302
|
+
)
|
299
303
|
if "vconcat" in spec and use_container_width:
|
300
304
|
spec["autosize"] = {"type": "fit-x", "contains": "padding"}
|
305
|
+
|
306
|
+
elif is_facet_chart:
|
307
|
+
spec["autosize"] = {"type": "pad", "contains": "padding"}
|
308
|
+
|
301
309
|
else:
|
302
310
|
spec["autosize"] = {"type": "fit", "contains": "padding"}
|
303
311
|
|
@@ -62,6 +62,7 @@ from streamlit.runtime.state import (
|
|
62
62
|
WidgetKwargs,
|
63
63
|
register_widget,
|
64
64
|
)
|
65
|
+
from streamlit.runtime.state.session_state_proxy import get_session_state
|
65
66
|
from streamlit.runtime.uploaded_file_manager import DeletedFile, UploadedFile
|
66
67
|
from streamlit.string_util import is_emoji, validate_material_icon
|
67
68
|
|
@@ -582,17 +583,29 @@ class ChatMixin:
|
|
582
583
|
https://doc-chat-input-file-uploader.streamlit.app/
|
583
584
|
height: 350px
|
584
585
|
|
586
|
+
**Example 4: Programmatically set the text via session state**
|
587
|
+
|
588
|
+
You can use ``st.session_state`` to set the text of the chat input widget.
|
589
|
+
|
590
|
+
>>> import streamlit as st
|
591
|
+
>>>
|
592
|
+
>>> if st.button("Set Value"):
|
593
|
+
>>> st.session_state.chat_input = "Hello, world!"
|
594
|
+
>>> st.chat_input(key="chat_input")
|
595
|
+
>>> st.write("Chat input value:", st.session_state.chat_input)
|
596
|
+
|
597
|
+
.. output ::
|
598
|
+
https://doc-chat-input-session-state.streamlit.app/
|
599
|
+
height: 350px
|
585
600
|
"""
|
586
|
-
# We default to an empty string here and disallow user choice intentionally
|
587
|
-
default = ""
|
588
601
|
key = to_key(key)
|
589
602
|
|
590
603
|
check_widget_policies(
|
591
604
|
self.dg,
|
592
605
|
key,
|
593
606
|
on_submit,
|
594
|
-
default_value=
|
595
|
-
writes_allowed=
|
607
|
+
default_value=None,
|
608
|
+
writes_allowed=True,
|
596
609
|
)
|
597
610
|
|
598
611
|
if accept_file not in {True, False, "multiple"}:
|
@@ -647,7 +660,8 @@ class ChatMixin:
|
|
647
660
|
if max_chars is not None:
|
648
661
|
chat_input_proto.max_chars = max_chars
|
649
662
|
|
650
|
-
|
663
|
+
# Setting a default value is currently not supported for chat input.
|
664
|
+
chat_input_proto.default = ""
|
651
665
|
|
652
666
|
chat_input_proto.accept_file = get_chat_input_accept_file_proto_value(
|
653
667
|
accept_file
|
@@ -676,9 +690,25 @@ class ChatMixin:
|
|
676
690
|
|
677
691
|
chat_input_proto.disabled = disabled
|
678
692
|
if widget_state.value_changed and widget_state.value is not None:
|
693
|
+
# Support for programmatically setting the text in the chat input
|
694
|
+
# via session state. Since chat input has a trigger state,
|
695
|
+
# it works a bit differently to other widgets. We are not changing
|
696
|
+
# the actual widget state here, but only inserting the provided value
|
697
|
+
# into the chat input field. The user needs to submit the value in
|
698
|
+
# order for the chat input to reflect the value in the backend state.
|
679
699
|
chat_input_proto.value = widget_state.value
|
680
700
|
chat_input_proto.set_value = True
|
681
701
|
|
702
|
+
session_state = get_session_state()
|
703
|
+
if key is not None and key in session_state:
|
704
|
+
# Reset the session state value to None to reflect the actual state
|
705
|
+
# of the widget. Which is None since the value hasn't been submitted yet.
|
706
|
+
|
707
|
+
# We need to first delete the value and then set it to `None`
|
708
|
+
# to not trigger the "state value cannot be modified" error.
|
709
|
+
del session_state[key]
|
710
|
+
session_state[key] = None
|
711
|
+
|
682
712
|
if ctx:
|
683
713
|
save_for_app_testing(ctx, element_id, widget_state.value)
|
684
714
|
if position == "bottom":
|
streamlit/runtime/secrets.py
CHANGED
@@ -29,7 +29,7 @@ from blinker import Signal
|
|
29
29
|
|
30
30
|
import streamlit.watcher.path_watcher
|
31
31
|
from streamlit import config, runtime
|
32
|
-
from streamlit.errors import StreamlitSecretNotFoundError
|
32
|
+
from streamlit.errors import StreamlitMaxRetriesError, StreamlitSecretNotFoundError
|
33
33
|
from streamlit.logger import get_logger
|
34
34
|
|
35
35
|
_LOGGER: Final = get_logger(__name__)
|
@@ -429,15 +429,11 @@ class Secrets(Mapping[str, Any]):
|
|
429
429
|
self._on_secrets_changed,
|
430
430
|
watcher_type="poll",
|
431
431
|
)
|
432
|
-
except
|
433
|
-
_LOGGER.debug(
|
434
|
-
"Failed to install file watcher for secret file path %s",
|
435
|
-
path,
|
436
|
-
exc_info=True,
|
437
|
-
)
|
432
|
+
except (StreamlitMaxRetriesError, FileNotFoundError): # noqa: PERF203
|
438
433
|
# A user may only have one secrets.toml file defined, so we'd expect
|
439
|
-
# exceptions to be raised when attempting to install a
|
434
|
+
# exceptions to be raised here when attempting to install a
|
440
435
|
# watcher on the nonexistent ones.
|
436
|
+
pass
|
441
437
|
|
442
438
|
# We set file_watchers_installed to True even if the installation attempt
|
443
439
|
# failed to avoid repeatedly trying to install it.
|
streamlit/static/index.html
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
<script>
|
38
38
|
window.prerenderReady = false
|
39
39
|
</script>
|
40
|
-
<script type="module" crossorigin src="./static/js/index.
|
40
|
+
<script type="module" crossorigin src="./static/js/index.D_0R5OBc.js"></script>
|
41
41
|
<link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
|
42
42
|
</head>
|
43
43
|
<body>
|