streamlit-nightly 1.42.3.dev20250226__py2.py3-none-any.whl → 1.42.3.dev20250227__py2.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/commands/navigation.py +16 -4
- streamlit/commands/page_config.py +1 -2
- streamlit/elements/widgets/button.py +5 -7
- streamlit/elements/widgets/chat.py +2 -1
- streamlit/errors.py +11 -9
- streamlit/navigation/page.py +2 -10
- streamlit/proto/ChatInput_pb2.py +6 -6
- streamlit/proto/ChatInput_pb2.pyi +5 -1
- streamlit/proto/ForwardMsg_pb2.py +12 -10
- streamlit/proto/PagesChanged_pb2.pyi +3 -1
- streamlit/runtime/app_session.py +1 -13
- streamlit/runtime/pages_manager.py +61 -232
- streamlit/runtime/scriptrunner/script_runner.py +49 -2
- streamlit/runtime/scriptrunner_utils/script_run_context.py +1 -1
- streamlit/source_util.py +4 -90
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.CWn5B5ZN.js → FileDownload.esm.rdZtCw5-.js} +1 -1
- streamlit/static/static/js/FileHelper.BztOEKJy.js +5 -0
- streamlit/static/static/js/{FormClearHelper.BlCIuWCo.js → FormClearHelper.Drd1fMJc.js} +1 -1
- streamlit/static/static/js/{Hooks.DURid8_V.js → Hooks.DWd0hyk4.js} +1 -1
- streamlit/static/static/js/{InputInstructions.gFFpIc6i.js → InputInstructions.B7xrWTG0.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CtXtbXhv.js → ProgressBar.CBgJiTH-.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DKWNQmbm.js → RenderInPortalIfExists.US28tQOn.js} +1 -1
- streamlit/static/static/js/{Toolbar.CKKwksQV.js → Toolbar.CAOt-xaL.js} +1 -1
- streamlit/static/static/js/{base-input.BUY9TLqO.js → base-input.CauNaJqr.js} +1 -1
- streamlit/static/static/js/{checkbox.C4L_5Z9H.js → checkbox.ChzWCtre.js} +1 -1
- streamlit/static/static/js/{createSuper.DprEKsA6.js → createSuper.D_39RJB6.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BArvtwSg.js → data-grid-overlay-editor.rIelkOVS.js} +1 -1
- streamlit/static/static/js/{downloader.C5pxkE2v.js → downloader.Dz5I28nG.js} +1 -1
- streamlit/static/static/js/{es6.DmKjMqyQ.js → es6.DwnEjMMn.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DhqbXIl1.js → iframeResizer.contentWindow.BRiRifwd.js} +1 -1
- streamlit/static/static/js/{index.BEnZZwfW.js → index.BE6MTF-B.js} +1 -1
- streamlit/static/static/js/{index.c_V1HXTs.js → index.BUdhIGhT.js} +1 -1
- streamlit/static/static/js/{index.B-S4HX7x.js → index.BWeYb5ES.js} +1 -1
- streamlit/static/static/js/{index.CTqvpoOz.js → index.Bb4OB39A.js} +1 -1
- streamlit/static/static/js/{index.BoBCblDb.js → index.BrAW6bFJ.js} +1 -1
- streamlit/static/static/js/{index.CXpOPWFV.js → index.CAHGh74D.js} +1 -1
- streamlit/static/static/js/{index.UE_L1IEZ.js → index.CBre8Aui.js} +1 -1
- streamlit/static/static/js/{index.B-vrwvgD.js → index.CM12P2T1.js} +1 -1
- streamlit/static/static/js/{index.Cd03IYkG.js → index.CO3dZWKG.js} +1 -1
- streamlit/static/static/js/{index.CvNhwseQ.js → index.CUz1_nAm.js} +1 -1
- streamlit/static/static/js/{index.BVHfAEko.js → index.C_C365T5.js} +1 -1
- streamlit/static/static/js/{index.NKOzzX__.js → index.CmYiLKNX.js} +1 -1
- streamlit/static/static/js/{index.RFfgDsnM.js → index.CoUzNoRf.js} +1 -1
- streamlit/static/static/js/{index.RrEbViHi.js → index.Ct7MPsA3.js} +1 -1
- streamlit/static/static/js/{index.D2G24Udm.js → index.D1K6NCBQ.js} +1 -1
- streamlit/static/static/js/{index.CoQjULdH.js → index.D2xM-XzG.js} +1 -1
- streamlit/static/static/js/{index.D2-IYCcZ.js → index.D9rv1PQ0.js} +1 -1
- streamlit/static/static/js/{index.ChEJa75P.js → index.DIeegLbv.js} +1 -1
- streamlit/static/static/js/{index.oPGa5nFU.js → index.DJvwxFLn.js} +1 -1
- streamlit/static/static/js/{index.DtIKjlNZ.js → index.DKuQg2D4.js} +1 -1
- streamlit/static/static/js/{index.Bk3A478D.js → index.DWFLx6Tc.js} +6 -6
- streamlit/static/static/js/{index.WAlW9lgW.js → index.DYUhWSq6.js} +1 -1
- streamlit/static/static/js/{index.Bds7Anva.js → index.Db3jGJxa.js} +1 -1
- streamlit/static/static/js/{index.KPwXWqBk.js → index.DfNAkKAr.js} +145 -145
- streamlit/static/static/js/{index.EIkP6R_d.js → index.DgNQKEeQ.js} +1 -1
- streamlit/static/static/js/{index.BmnSGdtS.js → index.Dj91melR.js} +1 -1
- streamlit/static/static/js/{index.C3l2zbST.js → index.DkKZlAsv.js} +1 -1
- streamlit/static/static/js/index.DkgVNhWs.js +1 -0
- streamlit/static/static/js/{index.DNr2W0gq.js → index.Dzp8iBkF.js} +1 -1
- streamlit/static/static/js/index.LL2DLZZA.js +201 -0
- streamlit/static/static/js/index.ORHz8Y8P.js +4537 -0
- streamlit/static/static/js/{index.O5-Wn4Yr.js → index.V3Vj2d9m.js} +1 -1
- streamlit/static/static/js/{index.BUnWa5Cg.js → index.YNWoT4uW.js} +1 -1
- streamlit/static/static/js/index.aL_kqyvR.js +1 -0
- streamlit/static/static/js/{index.BSczaRDm.js → index.fP6rBxlc.js} +1 -1
- streamlit/static/static/js/{index.xTncca7J.js → index.pvQjxG7y.js} +1 -1
- streamlit/static/static/js/{index.doRPQ8od.js → index.wxpL02VY.js} +1 -1
- streamlit/static/static/js/{input.EkJ_AsTP.js → input.D_dn5-2t.js} +1 -1
- streamlit/static/static/js/{memory.BFs17dZE.js → memory.pnMTtWQR.js} +1 -1
- streamlit/static/static/js/{mergeWith.B4u0whL-.js → mergeWith.CRrYodeI.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DwazN43x.js → number-overlay-editor.C65GBS2P.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CZfYLVBb.js → possibleConstructorReturn.BnQk7lq_.js} +1 -1
- streamlit/static/static/js/{sandbox.PjijA1v1.js → sandbox.CrxXt1li.js} +1 -1
- streamlit/static/static/js/{textarea.BGGnQXtw.js → textarea.DiFyO5JY.js} +1 -1
- streamlit/static/static/js/{timepicker.eLEnk1tw.js → timepicker.B1Y7LIk4.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CgKj9NUY.js → toConsumableArray.BWpBUK-j.js} +1 -1
- streamlit/static/static/js/{uniqueId.CPmOGhdZ.js → uniqueId.7ecIUkUs.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Bw_fxTtX.js → useBasicWidgetState.deG0KPm0.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.D8qi7pm4.js → useOnInputChange.CQ7sD7CO.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.BjVufR9b.js → withFullScreenWrapper.D0wnBu3k.js} +1 -1
- streamlit/testing/v1/app_test.py +8 -10
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/RECORD +88 -88
- streamlit/static/static/js/FileHelper.Bii_mi1A.js +0 -5
- streamlit/static/static/js/index.BAfr2RC0.js +0 -3865
- streamlit/static/static/js/index.BCErGZwr.js +0 -1
- streamlit/static/static/js/index.DhcYAj3f.js +0 -1
- streamlit/static/static/js/index.u1gL_Cm_.js +0 -201
- {streamlit_nightly-1.42.3.dev20250226.data → streamlit_nightly-1.42.3.dev20250227.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/top_level.txt +0 -0
streamlit/commands/navigation.py
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
17
|
from pathlib import Path
|
18
|
-
from typing import TYPE_CHECKING, Callable, Literal
|
18
|
+
from typing import TYPE_CHECKING, Callable, Literal, Union
|
19
19
|
|
20
20
|
from typing_extensions import TypeAlias
|
21
21
|
|
@@ -25,6 +25,7 @@ from streamlit.navigation.page import StreamlitPage
|
|
25
25
|
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
26
26
|
from streamlit.proto.Navigation_pb2 import Navigation as NavigationProto
|
27
27
|
from streamlit.runtime.metrics_util import gather_metrics
|
28
|
+
from streamlit.runtime.pages_manager import PagesManager
|
28
29
|
from streamlit.runtime.scriptrunner_utils.script_run_context import (
|
29
30
|
ScriptRunContext,
|
30
31
|
get_script_run_ctx,
|
@@ -34,6 +35,7 @@ if TYPE_CHECKING:
|
|
34
35
|
from streamlit.source_util import PageHash, PageInfo
|
35
36
|
|
36
37
|
SectionHeader: TypeAlias = str
|
38
|
+
PageType: TypeAlias = Union[str, Path, Callable[[], None], StreamlitPage]
|
37
39
|
|
38
40
|
|
39
41
|
def convert_to_streamlit_page(
|
@@ -78,8 +80,7 @@ def send_page_not_found(ctx: ScriptRunContext):
|
|
78
80
|
|
79
81
|
@gather_metrics("navigation")
|
80
82
|
def navigation(
|
81
|
-
pages: list[
|
82
|
-
| dict[SectionHeader, list[str | Path | Callable[[], None] | StreamlitPage]],
|
83
|
+
pages: list[PageType] | dict[SectionHeader, list[PageType]],
|
83
84
|
*,
|
84
85
|
position: Literal["sidebar", "hidden"] = "sidebar",
|
85
86
|
expanded: bool = False,
|
@@ -214,6 +215,18 @@ def navigation(
|
|
214
215
|
- The first page is automatically set as default if none specified
|
215
216
|
- Common widgets should be defined in the entrypoint file for state sharing
|
216
217
|
"""
|
218
|
+
# Disable the use of the pages feature (ie disregard v1 behavior of Multipage Apps)
|
219
|
+
PagesManager.uses_pages_directory = False
|
220
|
+
|
221
|
+
return _navigation(pages, position=position, expanded=expanded)
|
222
|
+
|
223
|
+
|
224
|
+
def _navigation(
|
225
|
+
pages: list[PageType] | dict[SectionHeader, list[PageType]],
|
226
|
+
*,
|
227
|
+
position: Literal["sidebar", "hidden"],
|
228
|
+
expanded: bool,
|
229
|
+
) -> StreamlitPage:
|
217
230
|
if isinstance(pages, list):
|
218
231
|
converted_pages = [convert_to_streamlit_page(p) for p in pages]
|
219
232
|
nav_sections = {"": converted_pages}
|
@@ -222,7 +235,6 @@ def navigation(
|
|
222
235
|
section: [convert_to_streamlit_page(p) for p in section_pages]
|
223
236
|
for section, section_pages in pages.items()
|
224
237
|
}
|
225
|
-
|
226
238
|
page_list = pages_from_nav_sections(nav_sections)
|
227
239
|
|
228
240
|
if not page_list:
|
@@ -165,8 +165,7 @@ def set_page_config(
|
|
165
165
|
https://share.streamlit.io/streamlit/emoji-shortcodes.
|
166
166
|
|
167
167
|
- The string literal, ``"random"``. You can set ``page_icon="random"``
|
168
|
-
to set a random emoji from the supported list above.
|
169
|
-
courtesy of Twemoji and loaded from MaxCDN.
|
168
|
+
to set a random emoji from the supported list above.
|
170
169
|
|
171
170
|
- An icon from the Material Symbols library (rounded style) in the
|
172
171
|
format ``":material/icon_name:"`` where "icon_name" is the name
|
@@ -52,6 +52,7 @@ from streamlit.proto.DownloadButton_pb2 import DownloadButton as DownloadButtonP
|
|
52
52
|
from streamlit.proto.LinkButton_pb2 import LinkButton as LinkButtonProto
|
53
53
|
from streamlit.proto.PageLink_pb2 import PageLink as PageLinkProto
|
54
54
|
from streamlit.runtime.metrics_util import gather_metrics
|
55
|
+
from streamlit.runtime.pages_manager import PagesManager
|
55
56
|
from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
|
56
57
|
from streamlit.runtime.state import (
|
57
58
|
WidgetArgs,
|
@@ -883,22 +884,19 @@ class ButtonMixin:
|
|
883
884
|
for page_data in all_app_pages.values():
|
884
885
|
full_path = page_data["script_path"]
|
885
886
|
page_name = page_data["page_name"]
|
887
|
+
url_pathname = page_data["url_pathname"]
|
886
888
|
if requested_page == full_path:
|
887
889
|
if label is None:
|
888
|
-
page_link_proto.label = page_name
|
890
|
+
page_link_proto.label = page_name
|
889
891
|
page_link_proto.page_script_hash = page_data["page_script_hash"]
|
890
|
-
page_link_proto.page =
|
892
|
+
page_link_proto.page = url_pathname
|
891
893
|
break
|
892
894
|
|
893
895
|
if page_link_proto.page_script_hash == "":
|
894
|
-
is_mpa_v2 = (
|
895
|
-
ctx.pages_manager is not None and ctx.pages_manager.mpa_version == 2
|
896
|
-
)
|
897
|
-
|
898
896
|
raise StreamlitPageNotFoundError(
|
899
|
-
is_mpa_v2=is_mpa_v2,
|
900
897
|
page=page,
|
901
898
|
main_script_directory=main_script_directory,
|
899
|
+
uses_pages_directory=bool(PagesManager.uses_pages_directory),
|
902
900
|
)
|
903
901
|
|
904
902
|
return self.dg._enqueue("page_link", page_link_proto)
|
@@ -25,7 +25,7 @@ from typing import (
|
|
25
25
|
overload,
|
26
26
|
)
|
27
27
|
|
28
|
-
from streamlit import runtime
|
28
|
+
from streamlit import config, runtime
|
29
29
|
from streamlit.delta_generator_singletons import get_dg_singleton_instance
|
30
30
|
from streamlit.elements.lib.file_uploader_utils import normalize_upload_file_type
|
31
31
|
from streamlit.elements.lib.form_utils import is_in_form
|
@@ -597,6 +597,7 @@ class ChatMixin:
|
|
597
597
|
)
|
598
598
|
|
599
599
|
chat_input_proto.file_type[:] = file_type if file_type is not None else []
|
600
|
+
chat_input_proto.max_upload_size_mb = config.get_option("server.maxUploadSize")
|
600
601
|
|
601
602
|
serde = ChatInputSerde(accept_files=bool(accept_file))
|
602
603
|
widget_state = register_widget( # type: ignore[misc]
|
streamlit/errors.py
CHANGED
@@ -376,21 +376,23 @@ class StreamlitMissingPageLabelError(LocalizableStreamlitException):
|
|
376
376
|
class StreamlitPageNotFoundError(LocalizableStreamlitException):
|
377
377
|
"""Exception raised the linked page can not be found."""
|
378
378
|
|
379
|
-
def __init__(
|
379
|
+
def __init__(
|
380
|
+
self, page: str, main_script_directory: str, uses_pages_directory: bool
|
381
|
+
):
|
380
382
|
directory = os.path.basename(main_script_directory)
|
381
383
|
|
382
384
|
message = (
|
383
|
-
"Could not find page: `{page}`. You must provide a
|
384
|
-
"relative to the entrypoint file
|
385
|
-
"
|
385
|
+
"Could not find page: `{page}`. You must provide a `StreamlitPage` "
|
386
|
+
"object or file path relative to the entrypoint file. Only pages "
|
387
|
+
"previously defined by `st.Page` and passed to `st.navigation` are "
|
388
|
+
"allowed."
|
386
389
|
)
|
387
390
|
|
388
|
-
if
|
391
|
+
if uses_pages_directory:
|
389
392
|
message = (
|
390
|
-
"Could not find page: `{page}`. You must provide a
|
391
|
-
"
|
392
|
-
"
|
393
|
-
"allowed."
|
393
|
+
"Could not find page: `{page}`. You must provide a file path "
|
394
|
+
"relative to the entrypoint file (from the directory `{directory}`). "
|
395
|
+
"Only the entrypoint file and files in the `pages/` directory are supported."
|
394
396
|
)
|
395
397
|
|
396
398
|
super().__init__(
|
streamlit/navigation/page.py
CHANGED
@@ -45,12 +45,7 @@ def Page(
|
|
45
45
|
object to execute the page. You can only run the page returned by
|
46
46
|
``st.navigation``, and you can only run it once per app rerun.
|
47
47
|
|
48
|
-
A page can be defined by a Python file or ``Callable``.
|
49
|
-
as a ``StreamlitPage`` source will have ``__name__ == "__page__"``.
|
50
|
-
Functions used as a ``StreamlitPage`` source will have ``__name__``
|
51
|
-
corresponding to the module they were imported from. Only the entrypoint
|
52
|
-
file and functions defined within the entrypoint file have
|
53
|
-
``__name__ == "__main__"`` to adhere to Python convention.
|
48
|
+
A page can be defined by a Python file or ``Callable``.
|
54
49
|
|
55
50
|
Parameters
|
56
51
|
----------
|
@@ -297,10 +292,7 @@ class StreamlitPage:
|
|
297
292
|
return
|
298
293
|
else:
|
299
294
|
code = ctx.pages_manager.get_page_script_byte_code(str(self._page))
|
300
|
-
|
301
|
-
# We create a module named __page__ for this specific
|
302
|
-
# script. This is differentiate it from the `__main__` module
|
303
|
-
module = types.ModuleType("__page__")
|
295
|
+
module = types.ModuleType("__main__")
|
304
296
|
# We want __file__ to be the path to the script
|
305
297
|
module.__dict__["__file__"] = self._page
|
306
298
|
exec(code, module.__dict__)
|
streamlit/proto/ChatInput_pb2.py
CHANGED
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/ChatInput.proto\"\
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/ChatInput.proto\"\xd0\x02\n\tChatInput\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0bplaceholder\x18\x02 \x01(\t\x12\x11\n\tmax_chars\x18\x03 \x01(\r\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x12\r\n\x05value\x18\x05 \x01(\t\x12\x11\n\tset_value\x18\x06 \x01(\x08\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x07 \x01(\t\x12%\n\x08position\x18\x08 \x01(\x0e\x32\x13.ChatInput.Position\x12*\n\x0b\x61\x63\x63\x65pt_file\x18\t \x01(\x0e\x32\x15.ChatInput.AcceptFile\x12\x11\n\tfile_type\x18\n \x03(\t\x12\x1a\n\x12max_upload_size_mb\x18\x0b \x01(\x05\"\x16\n\x08Position\x12\n\n\x06\x42OTTOM\x10\x00\"0\n\nAcceptFile\x12\x08\n\x04NONE\x10\x00\x12\n\n\x06SINGLE\x10\x01\x12\x0c\n\x08MULTIPLE\x10\x02\x42.\n\x1c\x63om.snowflake.apps.streamlitB\x0e\x43hatInputProtob\x06proto3')
|
18
18
|
|
19
19
|
_globals = globals()
|
20
20
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -23,9 +23,9 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
23
23
|
_globals['DESCRIPTOR']._loaded_options = None
|
24
24
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\016ChatInputProto'
|
25
25
|
_globals['_CHATINPUT']._serialized_start=36
|
26
|
-
_globals['_CHATINPUT']._serialized_end=
|
27
|
-
_globals['_CHATINPUT_POSITION']._serialized_start=
|
28
|
-
_globals['_CHATINPUT_POSITION']._serialized_end=
|
29
|
-
_globals['_CHATINPUT_ACCEPTFILE']._serialized_start=
|
30
|
-
_globals['_CHATINPUT_ACCEPTFILE']._serialized_end=
|
26
|
+
_globals['_CHATINPUT']._serialized_end=372
|
27
|
+
_globals['_CHATINPUT_POSITION']._serialized_start=300
|
28
|
+
_globals['_CHATINPUT_POSITION']._serialized_end=322
|
29
|
+
_globals['_CHATINPUT_ACCEPTFILE']._serialized_start=324
|
30
|
+
_globals['_CHATINPUT_ACCEPTFILE']._serialized_end=372
|
31
31
|
# @@protoc_insertion_point(module_scope)
|
@@ -75,6 +75,7 @@ class ChatInput(google.protobuf.message.Message):
|
|
75
75
|
POSITION_FIELD_NUMBER: builtins.int
|
76
76
|
ACCEPT_FILE_FIELD_NUMBER: builtins.int
|
77
77
|
FILE_TYPE_FIELD_NUMBER: builtins.int
|
78
|
+
MAX_UPLOAD_SIZE_MB_FIELD_NUMBER: builtins.int
|
78
79
|
id: builtins.str
|
79
80
|
placeholder: builtins.str
|
80
81
|
max_chars: builtins.int
|
@@ -84,6 +85,8 @@ class ChatInput(google.protobuf.message.Message):
|
|
84
85
|
default: builtins.str
|
85
86
|
position: global___ChatInput.Position.ValueType
|
86
87
|
accept_file: global___ChatInput.AcceptFile.ValueType
|
88
|
+
max_upload_size_mb: builtins.int
|
89
|
+
"""Max file size allowed by server config"""
|
87
90
|
@property
|
88
91
|
def file_type(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
|
89
92
|
"""Supported file types: For example: ["png","jpg","img"]"""
|
@@ -101,7 +104,8 @@ class ChatInput(google.protobuf.message.Message):
|
|
101
104
|
position: global___ChatInput.Position.ValueType = ...,
|
102
105
|
accept_file: global___ChatInput.AcceptFile.ValueType = ...,
|
103
106
|
file_type: collections.abc.Iterable[builtins.str] | None = ...,
|
107
|
+
max_upload_size_mb: builtins.int = ...,
|
104
108
|
) -> None: ...
|
105
|
-
def ClearField(self, field_name: typing.Literal["accept_file", b"accept_file", "default", b"default", "disabled", b"disabled", "file_type", b"file_type", "id", b"id", "max_chars", b"max_chars", "placeholder", b"placeholder", "position", b"position", "set_value", b"set_value", "value", b"value"]) -> None: ...
|
109
|
+
def ClearField(self, field_name: typing.Literal["accept_file", b"accept_file", "default", b"default", "disabled", b"disabled", "file_type", b"file_type", "id", b"id", "max_chars", b"max_chars", "max_upload_size_mb", b"max_upload_size_mb", "placeholder", b"placeholder", "position", b"position", "set_value", b"set_value", "value", b"value"]) -> None: ...
|
106
110
|
|
107
111
|
global___ChatInput = ChatInput
|
@@ -30,7 +30,7 @@ from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_Session
|
|
30
30
|
from streamlit.proto import AuthRedirect_pb2 as streamlit_dot_proto_dot_AuthRedirect__pb2
|
31
31
|
|
32
32
|
|
33
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/ForwardMsg.proto\x1a\x1fstreamlit/proto/AutoRerun.proto\x1a\x1cstreamlit/proto/Common.proto\x1a\x1bstreamlit/proto/Delta.proto\x1a\x1dstreamlit/proto/GitInfo.proto\x1a\x1astreamlit/proto/Logo.proto\x1a streamlit/proto/Navigation.proto\x1a streamlit/proto/NewSession.proto\x1a streamlit/proto/PageConfig.proto\x1a\x1estreamlit/proto/PageInfo.proto\x1a!streamlit/proto/PageProfile.proto\x1a\"streamlit/proto/PageNotFound.proto\x1a\"streamlit/proto/PagesChanged.proto\x1a#streamlit/proto/ParentMessage.proto\x1a\"streamlit/proto/SessionEvent.proto\x1a#streamlit/proto/SessionStatus.proto\x1a\"streamlit/proto/AuthRedirect.proto\"\
|
33
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/ForwardMsg.proto\x1a\x1fstreamlit/proto/AutoRerun.proto\x1a\x1cstreamlit/proto/Common.proto\x1a\x1bstreamlit/proto/Delta.proto\x1a\x1dstreamlit/proto/GitInfo.proto\x1a\x1astreamlit/proto/Logo.proto\x1a streamlit/proto/Navigation.proto\x1a streamlit/proto/NewSession.proto\x1a streamlit/proto/PageConfig.proto\x1a\x1estreamlit/proto/PageInfo.proto\x1a!streamlit/proto/PageProfile.proto\x1a\"streamlit/proto/PageNotFound.proto\x1a\"streamlit/proto/PagesChanged.proto\x1a#streamlit/proto/ParentMessage.proto\x1a\"streamlit/proto/SessionEvent.proto\x1a#streamlit/proto/SessionStatus.proto\x1a\"streamlit/proto/AuthRedirect.proto\"\xcb\x07\n\nForwardMsg\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12%\n\x08metadata\x18\x02 \x01(\x0b\x32\x13.ForwardMsgMetadata\x12\"\n\x0bnew_session\x18\x04 \x01(\x0b\x32\x0b.NewSessionH\x00\x12\x17\n\x05\x64\x65lta\x18\x05 \x01(\x0b\x32\x06.DeltaH\x00\x12&\n\x11page_info_changed\x18\x0c \x01(\x0b\x32\t.PageInfoH\x00\x12*\n\x13page_config_changed\x18\r \x01(\x0b\x32\x0b.PageConfigH\x00\x12;\n\x0fscript_finished\x18\x06 \x01(\x0e\x32 .ForwardMsg.ScriptFinishedStatusH\x00\x12$\n\x10git_info_changed\x18\x0e \x01(\x0b\x32\x08.GitInfoH\x00\x12$\n\x0cpage_profile\x18\x12 \x01(\x0b\x32\x0c.PageProfileH\x00\x12\x30\n\x16session_status_changed\x18\t \x01(\x0b\x32\x0e.SessionStatusH\x00\x12&\n\rsession_event\x18\n \x01(\x0b\x32\r.SessionEventH\x00\x12!\n\nnavigation\x18\x17 \x01(\x0b\x32\x0b.NavigationH\x00\x12\'\n\x0epage_not_found\x18\x0f \x01(\x0b\x32\r.PageNotFoundH\x00\x12*\n\rpages_changed\x18\x10 \x01(\x0b\x32\r.PagesChangedB\x02\x18\x01H\x00\x12/\n\x12\x66ile_urls_response\x18\x13 \x01(\x0b\x32\x11.FileURLsResponseH\x00\x12 \n\nauto_rerun\x18\x15 \x01(\x0b\x32\n.AutoRerunH\x00\x12\x15\n\x04logo\x18\x16 \x01(\x0b\x32\x05.LogoH\x00\x12&\n\rauth_redirect\x18\x18 \x01(\x0b\x32\r.AuthRedirectH\x00\x12(\n\x0eparent_message\x18\x14 \x01(\x0b\x32\x0e.ParentMessageH\x00\x12\x12\n\x08ref_hash\x18\x0b \x01(\tH\x00\x12\x1d\n\x15\x64\x65\x62ug_last_backmsg_id\x18\x11 \x01(\t\"\x98\x01\n\x14ScriptFinishedStatus\x12\x19\n\x15\x46INISHED_SUCCESSFULLY\x10\x00\x12\x1f\n\x1b\x46INISHED_WITH_COMPILE_ERROR\x10\x01\x12\x1c\n\x18\x46INISHED_EARLY_FOR_RERUN\x10\x02\x12&\n\"FINISHED_FRAGMENT_RUN_SUCCESSFULLY\x10\x03\x42\x06\n\x04typeJ\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"\x8e\x01\n\x12\x46orwardMsgMetadata\x12\x11\n\tcacheable\x18\x01 \x01(\x08\x12\x12\n\ndelta_path\x18\x02 \x03(\r\x12\x35\n\x16\x65lement_dimension_spec\x18\x03 \x01(\x0b\x32\x15.ElementDimensionSpec\x12\x1a\n\x12\x61\x63tive_script_hash\x18\x04 \x01(\t\"5\n\x14\x45lementDimensionSpec\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\"/\n\x0e\x46orwardMsgList\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ForwardMsgB/\n\x1c\x63om.snowflake.apps.streamlitB\x0f\x46orwardMsgProtob\x06proto3')
|
34
34
|
|
35
35
|
_globals = globals()
|
36
36
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -38,14 +38,16 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.ForwardMsg_
|
|
38
38
|
if not _descriptor._USE_C_DESCRIPTORS:
|
39
39
|
_globals['DESCRIPTOR']._loaded_options = None
|
40
40
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\017ForwardMsgProto'
|
41
|
+
_globals['_FORWARDMSG'].fields_by_name['pages_changed']._loaded_options = None
|
42
|
+
_globals['_FORWARDMSG'].fields_by_name['pages_changed']._serialized_options = b'\030\001'
|
41
43
|
_globals['_FORWARDMSG']._serialized_start=575
|
42
|
-
_globals['_FORWARDMSG']._serialized_end=
|
43
|
-
_globals['_FORWARDMSG_SCRIPTFINISHEDSTATUS']._serialized_start=
|
44
|
-
_globals['_FORWARDMSG_SCRIPTFINISHEDSTATUS']._serialized_end=
|
45
|
-
_globals['_FORWARDMSGMETADATA']._serialized_start=
|
46
|
-
_globals['_FORWARDMSGMETADATA']._serialized_end=
|
47
|
-
_globals['_ELEMENTDIMENSIONSPEC']._serialized_start=
|
48
|
-
_globals['_ELEMENTDIMENSIONSPEC']._serialized_end=
|
49
|
-
_globals['_FORWARDMSGLIST']._serialized_start=
|
50
|
-
_globals['_FORWARDMSGLIST']._serialized_end=
|
44
|
+
_globals['_FORWARDMSG']._serialized_end=1546
|
45
|
+
_globals['_FORWARDMSG_SCRIPTFINISHEDSTATUS']._serialized_start=1374
|
46
|
+
_globals['_FORWARDMSG_SCRIPTFINISHEDSTATUS']._serialized_end=1526
|
47
|
+
_globals['_FORWARDMSGMETADATA']._serialized_start=1549
|
48
|
+
_globals['_FORWARDMSGMETADATA']._serialized_end=1691
|
49
|
+
_globals['_ELEMENTDIMENSIONSPEC']._serialized_start=1693
|
50
|
+
_globals['_ELEMENTDIMENSIONSPEC']._serialized_end=1746
|
51
|
+
_globals['_FORWARDMSGLIST']._serialized_start=1748
|
52
|
+
_globals['_FORWARDMSGLIST']._serialized_end=1795
|
51
53
|
# @@protoc_insertion_point(module_scope)
|
@@ -29,7 +29,9 @@ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
|
29
29
|
|
30
30
|
@typing.final
|
31
31
|
class PagesChanged(google.protobuf.message.Message):
|
32
|
-
"""
|
32
|
+
"""DEPRECATED - We don't use the proto anymore.
|
33
|
+
Message used to tell the client that the app's pages have changed.
|
34
|
+
"""
|
33
35
|
|
34
36
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
35
37
|
|
streamlit/runtime/app_session.py
CHANGED
@@ -50,7 +50,6 @@ from streamlit.watcher import LocalSourcesWatcher
|
|
50
50
|
|
51
51
|
if TYPE_CHECKING:
|
52
52
|
from streamlit.proto.BackMsg_pb2 import BackMsg
|
53
|
-
from streamlit.proto.PagesChanged_pb2 import PagesChanged
|
54
53
|
from streamlit.runtime.script_data import ScriptData
|
55
54
|
from streamlit.runtime.scriptrunner.script_cache import ScriptCache
|
56
55
|
from streamlit.runtime.state import SessionState
|
@@ -200,9 +199,6 @@ class AppSession:
|
|
200
199
|
self._stop_config_listener = config.on_config_parsed(
|
201
200
|
self._on_source_file_changed, force_connect=True
|
202
201
|
)
|
203
|
-
self._stop_pages_listener = self._pages_manager.register_pages_changed_callback(
|
204
|
-
self._on_pages_changed
|
205
|
-
)
|
206
202
|
secrets_singleton.file_change_listener.connect(self._on_secrets_file_changed)
|
207
203
|
|
208
204
|
def disconnect_file_watchers(self) -> None:
|
@@ -494,14 +490,6 @@ class AppSession:
|
|
494
490
|
# `_on_source_file_changed` just for this purpose sounded finicky.
|
495
491
|
self._on_source_file_changed()
|
496
492
|
|
497
|
-
def _on_pages_changed(self, _) -> None:
|
498
|
-
msg = ForwardMsg()
|
499
|
-
self._populate_app_pages(msg.pages_changed, self._pages_manager.get_pages())
|
500
|
-
self._enqueue_forward_msg(msg)
|
501
|
-
|
502
|
-
if self._local_sources_watcher is not None:
|
503
|
-
self._local_sources_watcher.update_watched_pages()
|
504
|
-
|
505
493
|
def _clear_queue(self, fragment_ids_this_run: list[str] | None = None) -> None:
|
506
494
|
self._browser_queue.clear(
|
507
495
|
retain_lifecycle_msgs=True, fragment_ids_this_run=fragment_ids_this_run
|
@@ -886,7 +874,7 @@ class AppSession:
|
|
886
874
|
self._enqueue_forward_msg(msg)
|
887
875
|
|
888
876
|
def _populate_app_pages(
|
889
|
-
self, msg: NewSession
|
877
|
+
self, msg: NewSession, pages: dict[PageHash, PageInfo]
|
890
878
|
) -> None:
|
891
879
|
for page_script_hash, page_info in pages.items():
|
892
880
|
page_proto = msg.app_pages.add()
|