streamlit-nightly 1.46.2.dev20250707__py3-none-any.whl → 1.46.2.dev20250709__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/config.py +37 -0
- streamlit/elements/vega_charts.py +8 -0
- streamlit/elements/widgets/chat.py +35 -5
- streamlit/proto/NewSession_pb2.py +16 -16
- streamlit/proto/NewSession_pb2.pyi +5 -1
- streamlit/runtime/app_session.py +34 -0
- streamlit/runtime/secrets.py +4 -8
- streamlit/runtime/websocket_session_manager.py +8 -0
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +214 -214
- streamlit/static/static/js/{ErrorOutline.esm.Cwi9617t.js → ErrorOutline.esm.CQd6KUc-.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.51ynStRd.js → FileDownload.esm.DViLqD3l.js} +1 -1
- streamlit/static/static/js/{FileHelper.D56tzO8c.js → FileHelper.C4kAiX-d.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.D3Hp66Ed.js → FormClearHelper.3-U9496x.js} +1 -1
- streamlit/static/static/js/{Hooks.BY6BNTRM.js → Hooks.rP-qI29F.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BwiNLSMY.js → InputInstructions.BbLQarVh.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BEUzLotK.js → ProgressBar.XjFCBQue.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.DM17zpkP.js → RenderInPortalIfExists.BjvT0tcH.js} +1 -1
- streamlit/static/static/js/{Toolbar.CkeeikHg.js → Toolbar.CI7e539m.js} +1 -1
- streamlit/static/static/js/{base-input.yvVgWMq1.js → base-input.BwJuQKxC.js} +4 -4
- streamlit/static/static/js/{checkbox.B0zzRnN3.js → checkbox.YcCb7In-.js} +2 -2
- streamlit/static/static/js/{createSuper.DUNTCGyw.js → createSuper.fMnDQXwy.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CkmHJFS4.js → data-grid-overlay-editor.DispNmCy.js} +1 -1
- streamlit/static/static/js/{downloader.SYvlWNHe.js → downloader._vfB-j-e.js} +1 -1
- streamlit/static/static/js/{es6.Dn_Sg6yN.js → es6.DIYMfE-r.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CfNH32kg.js → iframeResizer.contentWindow.CXpyzNXN.js} +1 -1
- streamlit/static/static/js/index.4cT3qV4n.js +1 -0
- streamlit/static/static/js/{index.vvD6DJW9.js → index.5oEU0Akm.js} +2 -2
- streamlit/static/static/js/{index.CQiUN-qB.js → index.B1xRrJhO.js} +2 -2
- streamlit/static/static/js/{index.D6T2dYXA.js → index.BIU1Hwtm.js} +62 -62
- streamlit/static/static/js/{index.nghT_Lxa.js → index.BIsGWvbq.js} +1 -1
- streamlit/static/static/js/index.BJLFstQK.js +1 -0
- streamlit/static/static/js/{index.BWpac6Co.js → index.BNjHNjlf.js} +1 -1
- streamlit/static/static/js/{index.BxbiLBoz.js → index.BQVB466_.js} +1 -1
- streamlit/static/static/js/{index.BUNdJdwv.js → index.BYrFjIUs.js} +1 -1
- streamlit/static/static/js/{index.Jh8NGUS3.js → index.BdEa6sZz.js} +1 -1
- streamlit/static/static/js/{index.BRiZ2gjM.js → index.BgUl4InR.js} +1 -1
- streamlit/static/static/js/{index.DaG51Kxa.js → index.Bo8tNSYW.js} +1 -1
- streamlit/static/static/js/{index.PovmrFJI.js → index.BqJEh5EN.js} +11 -11
- streamlit/static/static/js/{index.HuK1SvDk.js → index.Bqhfg7Oa.js} +1 -1
- streamlit/static/static/js/{index.BruyfZhe.js → index.CQayRGxD.js} +1 -1
- streamlit/static/static/js/{index.B1hWgsYC.js → index.CUirymUQ.js} +1 -1
- streamlit/static/static/js/{index.Ce22m0pL.js → index.Cfv4QyQX.js} +1 -1
- streamlit/static/static/js/index.Chkl1asR.js +1 -0
- streamlit/static/static/js/{index.vgdzRlb1.js → index.ColMLoRT.js} +1 -1
- streamlit/static/static/js/{index.BpDsy6P7.js → index.Cx24fujh.js} +2 -2
- streamlit/static/static/js/{index.D5BdLSQe.js → index.D1VFO1GM.js} +1 -1
- streamlit/static/static/js/{index.GGLK4gvh.js → index.D2-Y5_wx.js} +173 -173
- streamlit/static/static/js/{index.q3-Tm2pt.js → index.D4qwHqKM.js} +1 -1
- streamlit/static/static/js/index.D8bLiwaV.js +1 -0
- streamlit/static/static/js/{index.D_4zzgnM.js → index.D958aGV_.js} +5 -5
- streamlit/static/static/js/{index.D4Y-sPIG.js → index.D9GxqhKH.js} +1 -1
- streamlit/static/static/js/{index.B8GCXUc4.js → index.DG9Ir4m4.js} +1 -1
- streamlit/static/static/js/{index.kOzLZcEm.js → index.DQXpaPor.js} +1 -1
- streamlit/static/static/js/{index.C1ab5uBd.js → index.DfriPCJP.js} +1 -1
- streamlit/static/static/js/{index.D0OXHmxl.js → index.Dga_qPJ0.js} +1 -1
- streamlit/static/static/js/{index.BcKUsmmW.js → index.Dgd7wAuk.js} +3 -3
- streamlit/static/static/js/{index.iaPLfTT0.js → index.Dy7h795S.js} +1 -1
- streamlit/static/static/js/{index.FkXunjOd.js → index.E56AjTPB.js} +2 -2
- streamlit/static/static/js/{index.BfBckj-h.js → index.Jr-tvRTy.js} +1 -1
- streamlit/static/static/js/{index.BzFIXYgy.js → index.LbtilNNP.js} +17 -17
- streamlit/static/static/js/{index.BntKz97_.js → index.atasR7_f.js} +1 -1
- streamlit/static/static/js/{index.Dw7bwHQ9.js → index.c5gLd5mL.js} +1 -1
- streamlit/static/static/js/{input.BPpQxxzu.js → input.Dudaq2DP.js} +2 -2
- streamlit/static/static/js/{memory.CR9Ajd2U.js → memory.DIuUp1Sn.js} +1 -1
- streamlit/static/static/js/{mergeWith.DjeH399x.js → mergeWith.D9D0WgL_.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.D8gzaWdQ.js → number-overlay-editor.DUBtvgiU.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.ChodIDx3.js → possibleConstructorReturn.ql9j_wzC.js} +1 -1
- streamlit/static/static/js/{sandbox.Deilbzun.js → sandbox.D_vlGgEg.js} +1 -1
- streamlit/static/static/js/{timepicker.CQyXj151.js → timepicker.DtFPFwb0.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.Ddyzgz2E.js → toConsumableArray.DMsseOni.js} +1 -1
- streamlit/static/static/js/{uniqueId.Cr5-pyqr.js → uniqueId.BkUMU8CT.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DX8Dvi5d.js → useBasicWidgetState.Cp78gjjh.js} +1 -1
- streamlit/static/static/js/useOnInputChange.CHkjh73V.js +1 -0
- streamlit/static/static/js/{useTextInputAutoExpand.BPsrdzpb.js → useTextInputAutoExpand.CE_GiZ0L.js} +2 -2
- streamlit/static/static/js/{withFullScreenWrapper.DpxbNIyf.js → withFullScreenWrapper.CplO1PK6.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.dev20250707.dist-info → streamlit_nightly-1.46.2.dev20250709.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.46.2.dev20250707.dist-info → streamlit_nightly-1.46.2.dev20250709.dist-info}/RECORD +84 -84
- streamlit/static/static/js/index.B6IBhXXL.js +0 -1
- streamlit/static/static/js/index.CJJTafCM.js +0 -1
- streamlit/static/static/js/index.CP_ebS8J.js +0 -1
- streamlit/static/static/js/index.i0djEkgf.js +0 -1
- streamlit/static/static/js/useOnInputChange.CGiEpYpi.js +0 -1
- {streamlit_nightly-1.46.2.dev20250707.data → streamlit_nightly-1.46.2.dev20250709.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.2.dev20250707.dist-info → streamlit_nightly-1.46.2.dev20250709.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.2.dev20250707.dist-info → streamlit_nightly-1.46.2.dev20250709.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.2.dev20250707.dist-info → streamlit_nightly-1.46.2.dev20250709.dist-info}/top_level.txt +0 -0
streamlit/config.py
CHANGED
@@ -1486,6 +1486,43 @@ _create_theme_options(
|
|
1486
1486
|
""",
|
1487
1487
|
)
|
1488
1488
|
|
1489
|
+
_create_theme_options(
|
1490
|
+
"chartSequentialColors",
|
1491
|
+
categories=["theme"],
|
1492
|
+
description="""
|
1493
|
+
An array of 10 colors to use for sequential charts.
|
1494
|
+
|
1495
|
+
If no chart sequential colors are set (or less than 10 colors provided),
|
1496
|
+
Streamlit uses a default set of colors.
|
1497
|
+
For light themes the default colors are:
|
1498
|
+
[
|
1499
|
+
"#e4f5ff", #blue10
|
1500
|
+
"#c7ebff", #blue20
|
1501
|
+
"#a6dcff", #blue30
|
1502
|
+
"#83c9ff", #blue40
|
1503
|
+
"#60b4ff", #blue50
|
1504
|
+
"#3d9df3", #blue60
|
1505
|
+
"#1c83e1", #blue70
|
1506
|
+
"#0068c9", #blue80
|
1507
|
+
"#0054a3", #blue90
|
1508
|
+
"#004280", #blue100
|
1509
|
+
]
|
1510
|
+
For dark themes the default colors are:
|
1511
|
+
[
|
1512
|
+
"#004280", #blue100
|
1513
|
+
"#0054a3", #blue90
|
1514
|
+
"#0068c9", #blue80
|
1515
|
+
"#1c83e1", #blue70
|
1516
|
+
"#3d9df3", #blue60
|
1517
|
+
"#60b4ff", #blue50
|
1518
|
+
"#83c9ff", #blue40
|
1519
|
+
"#a6dcff", #blue30
|
1520
|
+
"#c7ebff", #blue20
|
1521
|
+
"#e4f5ff", #blue10
|
1522
|
+
]
|
1523
|
+
""",
|
1524
|
+
)
|
1525
|
+
|
1489
1526
|
# Config Section: Secrets #
|
1490
1527
|
|
1491
1528
|
_create_section("secrets", "Secrets configuration.")
|
@@ -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":
|
@@ -16,7 +16,7 @@ from streamlit.proto import AppPage_pb2 as streamlit_dot_proto_dot_AppPage__pb2
|
|
16
16
|
from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_SessionStatus__pb2
|
17
17
|
|
18
18
|
|
19
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\
|
19
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\xbf\x0b\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x14\n\x0cheading_font\x18\x0c \x01(\t\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\x12\x18\n\x0b\x62\x61se_radius\x18\x12 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rbutton_radius\x18\x1a \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0c\x62order_color\x18\x13 \x01(\tH\x02\x88\x01\x01\x12#\n\x16\x64\x61taframe_border_color\x18\x1b \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12show_widget_border\x18\x14 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nlink_color\x18\x15 \x01(\tH\x05\x88\x01\x01\x12\x1b\n\x0elink_underline\x18\x1d \x01(\x08H\x06\x88\x01\x01\x12\x1b\n\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x07\x88\x01\x01\x12\x1d\n\x10\x62\x61se_font_weight\x18\x1e \x01(\x05H\x08\x88\x01\x01\x12\x1d\n\x10\x63ode_font_weight\x18 \x01(\x05H\t\x88\x01\x01\x12\x1b\n\x0e\x63ode_font_size\x18\x1c \x01(\tH\n\x88\x01\x01\x12\x1a\n\x12heading_font_sizes\x18# \x03(\t\x12\x1c\n\x14heading_font_weights\x18\" \x03(\x05\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x0b\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x0c\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\r\x88\x01\x01\x12.\n!dataframe_header_background_color\x18\x1f \x01(\tH\x0e\x88\x01\x01\x12 \n\x18\x63hart_categorical_colors\x18! \x03(\t\x12\x1f\n\x17\x63hart_sequential_colors\x18$ \x03(\t\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\x42\x0e\n\x0c_base_radiusB\x10\n\x0e_button_radiusB\x0f\n\r_border_colorB\x19\n\x17_dataframe_border_colorB\x15\n\x13_show_widget_borderB\r\n\x0b_link_colorB\x11\n\x0f_link_underlineB\x11\n\x0f_base_font_sizeB\x13\n\x11_base_font_weightB\x13\n\x11_code_font_weightB\x11\n\x0f_code_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_colorB$\n\"_dataframe_header_background_color\"w\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x12\n\x06weight\x18\x03 \x01(\x05\x42\x02\x18\x01\x12\x14\n\x0cweight_range\x18\x05 \x01(\t\x12\r\n\x05style\x18\x04 \x01(\t\x12\x15\n\runicode_range\x18\x06 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"a\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\t\x12\x1a\n\x12installation_id_v4\x18\x06 \x01(\tJ\x04\x08\x02\x10\x03\"l\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\t\x12\x11\n\tserver_os\x18\x03 \x01(\t\x12\x13\n\x0bhas_display\x18\x04 \x01(\x08\x42/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
|
20
20
|
|
21
21
|
_globals = globals()
|
22
22
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -35,19 +35,19 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
35
|
_globals['_CONFIG_TOOLBARMODE']._serialized_start=800
|
36
36
|
_globals['_CONFIG_TOOLBARMODE']._serialized_end=863
|
37
37
|
_globals['_CUSTOMTHEMECONFIG']._serialized_start=872
|
38
|
-
_globals['_CUSTOMTHEMECONFIG']._serialized_end=
|
39
|
-
_globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_start=
|
40
|
-
_globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_end=
|
41
|
-
_globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_start=
|
42
|
-
_globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_end=
|
43
|
-
_globals['_FONTFACE']._serialized_start=
|
44
|
-
_globals['_FONTFACE']._serialized_end=
|
45
|
-
_globals['_RADII']._serialized_start=
|
46
|
-
_globals['_RADII']._serialized_end=
|
47
|
-
_globals['_FONTSIZES']._serialized_start=
|
48
|
-
_globals['_FONTSIZES']._serialized_end=
|
49
|
-
_globals['_USERINFO']._serialized_start=
|
50
|
-
_globals['_USERINFO']._serialized_end=
|
51
|
-
_globals['_ENVIRONMENTINFO']._serialized_start=
|
52
|
-
_globals['_ENVIRONMENTINFO']._serialized_end=
|
38
|
+
_globals['_CUSTOMTHEMECONFIG']._serialized_end=2343
|
39
|
+
_globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_start=1940
|
40
|
+
_globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_end=1972
|
41
|
+
_globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_start=1974
|
42
|
+
_globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_end=2028
|
43
|
+
_globals['_FONTFACE']._serialized_start=2345
|
44
|
+
_globals['_FONTFACE']._serialized_end=2464
|
45
|
+
_globals['_RADII']._serialized_start=2466
|
46
|
+
_globals['_RADII']._serialized_end=2526
|
47
|
+
_globals['_FONTSIZES']._serialized_start=2528
|
48
|
+
_globals['_FONTSIZES']._serialized_end=2612
|
49
|
+
_globals['_USERINFO']._serialized_start=2614
|
50
|
+
_globals['_USERINFO']._serialized_end=2711
|
51
|
+
_globals['_ENVIRONMENTINFO']._serialized_start=2713
|
52
|
+
_globals['_ENVIRONMENTINFO']._serialized_end=2821
|
53
53
|
# @@protoc_insertion_point(module_scope)
|
@@ -302,6 +302,7 @@ class CustomThemeConfig(google.protobuf.message.Message):
|
|
302
302
|
CODE_BACKGROUND_COLOR_FIELD_NUMBER: builtins.int
|
303
303
|
DATAFRAME_HEADER_BACKGROUND_COLOR_FIELD_NUMBER: builtins.int
|
304
304
|
CHART_CATEGORICAL_COLORS_FIELD_NUMBER: builtins.int
|
305
|
+
CHART_SEQUENTIAL_COLORS_FIELD_NUMBER: builtins.int
|
305
306
|
primary_color: builtins.str
|
306
307
|
secondary_background_color: builtins.str
|
307
308
|
background_color: builtins.str
|
@@ -350,6 +351,8 @@ class CustomThemeConfig(google.protobuf.message.Message):
|
|
350
351
|
def sidebar(self) -> global___CustomThemeConfig: ...
|
351
352
|
@property
|
352
353
|
def chart_categorical_colors(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
354
|
+
@property
|
355
|
+
def chart_sequential_colors(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
353
356
|
def __init__(
|
354
357
|
self,
|
355
358
|
*,
|
@@ -386,9 +389,10 @@ class CustomThemeConfig(google.protobuf.message.Message):
|
|
386
389
|
code_background_color: builtins.str | None = ...,
|
387
390
|
dataframe_header_background_color: builtins.str | None = ...,
|
388
391
|
chart_categorical_colors: collections.abc.Iterable[builtins.str] | None = ...,
|
392
|
+
chart_sequential_colors: collections.abc.Iterable[builtins.str] | None = ...,
|
389
393
|
) -> None: ...
|
390
394
|
def HasField(self, field_name: typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "border_color", b"border_color", "button_radius", b"button_radius", "code_background_color", b"code_background_color", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font_sizes", b"font_sizes", "link_color", b"link_color", "link_underline", b"link_underline", "radii", b"radii", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar"]) -> builtins.bool: ...
|
391
|
-
def ClearField(self, field_name: typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "background_color", b"background_color", "base", b"base", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "body_font", b"body_font", "border_color", b"border_color", "button_radius", b"button_radius", "chart_categorical_colors", b"chart_categorical_colors", "code_background_color", b"code_background_color", "code_font", b"code_font", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font", b"font", "font_faces", b"font_faces", "font_sizes", b"font_sizes", "heading_font", b"heading_font", "heading_font_sizes", b"heading_font_sizes", "heading_font_weights", b"heading_font_weights", "link_color", b"link_color", "link_underline", b"link_underline", "primary_color", b"primary_color", "radii", b"radii", "secondary_background_color", b"secondary_background_color", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar", "skeleton_background_color", b"skeleton_background_color", "text_color", b"text_color", "widget_background_color", b"widget_background_color", "widget_border_color", b"widget_border_color"]) -> None: ...
|
395
|
+
def ClearField(self, field_name: typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "background_color", b"background_color", "base", b"base", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "body_font", b"body_font", "border_color", b"border_color", "button_radius", b"button_radius", "chart_categorical_colors", b"chart_categorical_colors", "chart_sequential_colors", b"chart_sequential_colors", "code_background_color", b"code_background_color", "code_font", b"code_font", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font", b"font", "font_faces", b"font_faces", "font_sizes", b"font_sizes", "heading_font", b"heading_font", "heading_font_sizes", b"heading_font_sizes", "heading_font_weights", b"heading_font_weights", "link_color", b"link_color", "link_underline", b"link_underline", "primary_color", b"primary_color", "radii", b"radii", "secondary_background_color", b"secondary_background_color", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar", "skeleton_background_color", b"skeleton_background_color", "text_color", b"text_color", "widget_background_color", b"widget_background_color", "widget_border_color", b"widget_border_color"]) -> None: ...
|
392
396
|
@typing.overload
|
393
397
|
def WhichOneof(self, oneof_group: typing.Literal["_base_font_size", b"_base_font_size"]) -> typing.Literal["base_font_size"] | None: ...
|
394
398
|
@typing.overload
|
streamlit/runtime/app_session.py
CHANGED
@@ -949,6 +949,7 @@ def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
|
|
949
949
|
"headingFontSizes",
|
950
950
|
"headingFontWeights",
|
951
951
|
"chartCategoricalColors",
|
952
|
+
"chartSequentialColors",
|
952
953
|
}
|
953
954
|
and option_val is not None
|
954
955
|
):
|
@@ -1115,6 +1116,39 @@ def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
|
|
1115
1116
|
exc_info=e,
|
1116
1117
|
)
|
1117
1118
|
|
1119
|
+
chart_sequential_colors = theme_opts.get("chartSequentialColors", None)
|
1120
|
+
# If chartSequentialColors was configured via config.toml, it's already a list of
|
1121
|
+
# strings. However, if it was provided via env variable or via CLI arg,
|
1122
|
+
# it's a json string that needs to be parsed.
|
1123
|
+
if isinstance(chart_sequential_colors, str):
|
1124
|
+
try:
|
1125
|
+
chart_sequential_colors = json.loads(chart_sequential_colors)
|
1126
|
+
except json.JSONDecodeError as e:
|
1127
|
+
_LOGGER.warning(
|
1128
|
+
"Failed to parse the theme.chartSequentialColors config option: %s.",
|
1129
|
+
chart_sequential_colors,
|
1130
|
+
exc_info=e,
|
1131
|
+
)
|
1132
|
+
chart_sequential_colors = None
|
1133
|
+
|
1134
|
+
if chart_sequential_colors is not None:
|
1135
|
+
# Check that the list has 10 color values
|
1136
|
+
if len(chart_sequential_colors) != 10:
|
1137
|
+
_LOGGER.error(
|
1138
|
+
"Config theme.chartSequentialColors should have 10 color values, "
|
1139
|
+
"but got %s. Defaulting to Streamlit's default colors.",
|
1140
|
+
len(chart_sequential_colors),
|
1141
|
+
)
|
1142
|
+
for color in chart_sequential_colors:
|
1143
|
+
try:
|
1144
|
+
msg.chart_sequential_colors.append(color)
|
1145
|
+
except Exception as e: # noqa: PERF203
|
1146
|
+
_LOGGER.warning(
|
1147
|
+
"Failed to parse the theme.chartSequentialColors config option: %s.",
|
1148
|
+
color,
|
1149
|
+
exc_info=e,
|
1150
|
+
)
|
1151
|
+
|
1118
1152
|
|
1119
1153
|
def _populate_user_info_msg(msg: UserInfo) -> None:
|
1120
1154
|
inst = Installation.instance()
|
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.
|
@@ -137,6 +137,10 @@ class WebsocketSessionManager(SessionManager):
|
|
137
137
|
)
|
138
138
|
del self._active_session_info_by_id[session_id]
|
139
139
|
|
140
|
+
if not self._active_session_info_by_id:
|
141
|
+
# Avoid stale cached scripts when all file watchers and sessions are disconnected
|
142
|
+
self._script_cache.clear()
|
143
|
+
|
140
144
|
def get_active_session_info(self, session_id: str) -> ActiveSessionInfo | None:
|
141
145
|
return self._active_session_info_by_id.get(session_id)
|
142
146
|
|
@@ -151,6 +155,10 @@ class WebsocketSessionManager(SessionManager):
|
|
151
155
|
active_session_info = self._active_session_info_by_id[session_id]
|
152
156
|
del self._active_session_info_by_id[session_id]
|
153
157
|
active_session_info.session.shutdown()
|
158
|
+
|
159
|
+
if not self._active_session_info_by_id:
|
160
|
+
# Avoid stale cached scripts when all file watchers and sessions are disconnected
|
161
|
+
self._script_cache.clear()
|
154
162
|
return
|
155
163
|
|
156
164
|
session_info = self._session_storage.get(session_id)
|
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.BIU1Hwtm.js"></script>
|
41
41
|
<link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
|
42
42
|
</head>
|
43
43
|
<body>
|