streamlit-nightly 1.45.2.dev20250612__py3-none-any.whl → 1.45.2.dev20250613__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. streamlit/commands/navigation.py +22 -10
  2. streamlit/elements/markdown.py +7 -7
  3. streamlit/elements/widgets/button.py +4 -0
  4. streamlit/navigation/page.py +4 -0
  5. streamlit/proto/Navigation_pb2.py +3 -3
  6. streamlit/proto/Navigation_pb2.pyi +4 -0
  7. streamlit/runtime/caching/__init__.py +3 -3
  8. streamlit/runtime/caching/cached_message_replay.py +11 -4
  9. streamlit/runtime/scriptrunner/script_runner.py +1 -1
  10. streamlit/static/index.html +2 -16
  11. streamlit/static/manifest.json +218 -218
  12. streamlit/static/static/js/{ErrorOutline.esm.DAsQnQAG.js → ErrorOutline.esm.DeqDGwEO.js} +1 -1
  13. streamlit/static/static/js/{FileDownload.esm.CDvOgvtF.js → FileDownload.esm.--sYVXOa.js} +1 -1
  14. streamlit/static/static/js/{FileHelper.DDa1_S8P.js → FileHelper.bloGbv2W.js} +1 -1
  15. streamlit/static/static/js/{FormClearHelper.Cd0equ6H.js → FormClearHelper.CYKg4prI.js} +1 -1
  16. streamlit/static/static/js/{Hooks.CO94IhEZ.js → Hooks.B16qdpVx.js} +1 -1
  17. streamlit/static/static/js/{InputInstructions.DIPLfwqq.js → InputInstructions.DMO4B42t.js} +1 -1
  18. streamlit/static/static/js/{ProgressBar.B96Luxcl.js → ProgressBar.BH1ZwSEk.js} +2 -2
  19. streamlit/static/static/js/{RenderInPortalIfExists.V4gb3DZM.js → RenderInPortalIfExists.IgdXklou.js} +1 -1
  20. streamlit/static/static/js/{Toolbar.CGCqedkz.js → Toolbar.DkIytKhC.js} +1 -1
  21. streamlit/static/static/js/{base-input.8P8uB-P_.js → base-input.CAahP9oF.js} +4 -4
  22. streamlit/static/static/js/{checkbox.BaU0SuPN.js → checkbox.k1RuPBbZ.js} +2 -2
  23. streamlit/static/static/js/{createSuper.zGgxEDDA.js → createSuper.ButEKFwQ.js} +1 -1
  24. streamlit/static/static/js/{data-grid-overlay-editor.BBQL2MW6.js → data-grid-overlay-editor.7XGvfjSS.js} +1 -1
  25. streamlit/static/static/js/{downloader.CmINHiHs.js → downloader.DSilreQW.js} +1 -1
  26. streamlit/static/static/js/{es6.C3QC4mZP.js → es6.yDFTfvZI.js} +2 -2
  27. streamlit/static/static/js/{iframeResizer.contentWindow.DifXO9xe.js → iframeResizer.contentWindow.BSskBUmQ.js} +1 -1
  28. streamlit/static/static/js/{index.BLxZobpt.js → index.80yI-jzZ.js} +1 -1
  29. streamlit/static/static/js/index.9VWuu9bJ.js +1 -0
  30. streamlit/static/static/js/{index.DbuxO4aX.js → index.BAXqDnQ9.js} +1 -1
  31. streamlit/static/static/js/{index.BGlybWkw.js → index.BG8RaQ8E.js} +1 -1
  32. streamlit/static/static/js/{index.D6tuwhtG.js → index.BY47W7LH.js} +1 -1
  33. streamlit/static/static/js/{index.iYTNSFIE.js → index.BZqoA_aJ.js} +1 -1
  34. streamlit/static/static/js/{index.B6UeWScF.js → index.BcW5X6V5.js} +208 -208
  35. streamlit/static/static/js/{index.CerKV33b.js → index.Bo1tG5CG.js} +5 -5
  36. streamlit/static/static/js/{index.D6YD7L9B.js → index.BoHCDi97.js} +2 -2
  37. streamlit/static/static/js/{index.CslLBxh_.js → index.BsCehkC8.js} +1 -1
  38. streamlit/static/static/js/{index.CVlA3XMi.js → index.C0xV4csm.js} +1 -1
  39. streamlit/static/static/js/index.CIXRC_j_.js +1 -0
  40. streamlit/static/static/js/{index.P3Gk3KUg.js → index.CKJtZooB.js} +1 -1
  41. streamlit/static/static/js/{index.hIOqOF3N.js → index.CWeNa-FP.js} +1 -1
  42. streamlit/static/static/js/{index.B7CU3ww0.js → index.Cdi_Zw1a.js} +1 -1
  43. streamlit/static/static/js/{index.jhzg5Fkk.js → index.ChBsbacw.js} +1 -1
  44. streamlit/static/static/js/{index.CqqggdSR.js → index.ChhNrUVT.js} +1 -1
  45. streamlit/static/static/js/{index.CKWanB9Z.js → index.ClCMQ4iK.js} +1 -1
  46. streamlit/static/static/js/{index.9NZLK4V5.js → index.ClCtylIR.js} +1 -1
  47. streamlit/static/static/js/{index.Bt2lRpBU.js → index.CzY5--PW.js} +1 -1
  48. streamlit/static/static/js/{index.BEwSEGpG.js → index.D6veSOdZ.js} +1 -1
  49. streamlit/static/static/js/{index.DegBKQaf.js → index.D9muCjoC.js} +1 -1
  50. streamlit/static/static/js/{index.D6_IUG7D.js → index.DGrpmtEI.js} +1 -1
  51. streamlit/static/static/js/{index.CyOYxgX5.js → index.DLBGcvEx.js} +1 -1
  52. streamlit/static/static/js/{index.D7T7fEUZ.js → index.DNTQOI5W.js} +1 -1
  53. streamlit/static/static/js/{index.vMfNZrTu.js → index.DSpbUJvK.js} +1 -1
  54. streamlit/static/static/js/{index.C9au0nd6.js → index.DqbaNLFW.js} +1 -1
  55. streamlit/static/static/js/{index.Br2GWLEm.js → index.DslKxDZN.js} +1 -1
  56. streamlit/static/static/js/{index.TB4RwQ5L.js → index.EgFq4OeP.js} +1 -1
  57. streamlit/static/static/js/{index.DfDtyiwa.js → index.FC1jA29Z.js} +1 -1
  58. streamlit/static/static/js/{index.Rbok_xK8.js → index.Iveq4NZV.js} +1 -1
  59. streamlit/static/static/js/{index.D2Mj8XID.js → index.O4EQwJsZ.js} +1 -1
  60. streamlit/static/static/js/{index.BExvuXH2.js → index.RQlZs06L.js} +1 -1
  61. streamlit/static/static/js/{index.CUQJU-d8.js → index.VE3QHoXq.js} +111 -106
  62. streamlit/static/static/js/{index.B48AJdNd.js → index.bQ9PFxvm.js} +1 -1
  63. streamlit/static/static/js/{index.BKXdOrM1.js → index.tnjDy4iv.js} +1 -1
  64. streamlit/static/static/js/{index.B0wvsyIn.js → index.y-bXsZ3U.js} +3 -3
  65. streamlit/static/static/js/{input.BpCKuvTL.js → input.5dpw-Sqs.js} +2 -2
  66. streamlit/static/static/js/{memory.DRT-6qe5.js → memory.8YWsO_82.js} +1 -1
  67. streamlit/static/static/js/{mergeWith.C_cG93IR.js → mergeWith.1afHaDFE.js} +1 -1
  68. streamlit/static/static/js/{number-overlay-editor.DmJzexxY.js → number-overlay-editor.CrclsoQd.js} +1 -1
  69. streamlit/static/static/js/{possibleConstructorReturn.CGq_veM9.js → possibleConstructorReturn.Dq7g1SWn.js} +1 -1
  70. streamlit/static/static/js/{sandbox.B6wFYIT9.js → sandbox.ZlQ0WZlh.js} +1 -1
  71. streamlit/static/static/js/{textarea.D9fcLEU8.js → textarea.CY5cwdtO.js} +2 -2
  72. streamlit/static/static/js/{timepicker.Bnuz89hd.js → timepicker.DMqTkd3V.js} +1 -1
  73. streamlit/static/static/js/{toConsumableArray.oLOBJjzs.js → toConsumableArray.Bm0yYM5M.js} +1 -1
  74. streamlit/static/static/js/{uniqueId.Yanu-Bte.js → uniqueId.kDXXTYvS.js} +1 -1
  75. streamlit/static/static/js/{useBasicWidgetState.D2Acm4ak.js → useBasicWidgetState.ClCgm0D-.js} +1 -1
  76. streamlit/static/static/js/{useOnInputChange.CtoO_nCV.js → useOnInputChange.Cwcz7NJx.js} +1 -1
  77. streamlit/static/static/js/{withFullScreenWrapper.DjCGsGNa.js → withFullScreenWrapper.CRbf9QMV.js} +1 -1
  78. {streamlit_nightly-1.45.2.dev20250612.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/METADATA +1 -1
  79. {streamlit_nightly-1.45.2.dev20250612.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/RECORD +83 -83
  80. streamlit/static/static/js/index.BFBJdPsK.js +0 -1
  81. streamlit/static/static/js/index.DRvVsMEA.js +0 -1
  82. {streamlit_nightly-1.45.2.dev20250612.data → streamlit_nightly-1.45.2.dev20250613.data}/scripts/streamlit.cmd +0 -0
  83. {streamlit_nightly-1.45.2.dev20250612.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/WHEEL +0 -0
  84. {streamlit_nightly-1.45.2.dev20250612.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/entry_points.txt +0 -0
  85. {streamlit_nightly-1.45.2.dev20250612.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/top_level.txt +0 -0
@@ -83,7 +83,7 @@ def send_page_not_found(ctx: ScriptRunContext) -> None:
83
83
  def navigation(
84
84
  pages: Sequence[PageType] | Mapping[SectionHeader, Sequence[PageType]],
85
85
  *,
86
- position: Literal["sidebar", "hidden"] = "sidebar",
86
+ position: Literal["sidebar", "hidden", "top"] = "sidebar",
87
87
  expanded: bool = False,
88
88
  ) -> StreamlitPage:
89
89
  """
@@ -128,10 +128,11 @@ def navigation(
128
128
  path inferred from its path or filename. To customize these attributes
129
129
  for your page, initialize your page with ``st.Page``.
130
130
 
131
- position : "sidebar" or "hidden"
131
+ position : "sidebar", "hidden", or "top"
132
132
  The position of the navigation menu. If this is ``"sidebar"``
133
133
  (default), the navigation widget appears at the top of the sidebar. If
134
- this is ``"hidden"``, the navigation widget is not displayed.
134
+ this is ``"hidden"``, the navigation widget is not displayed. If this
135
+ is ``"top"``, the navigation appears in the top header of the app.
135
136
 
136
137
  If there is only one page in ``pages``, the navigation will be hidden
137
138
  for any value of ``position``.
@@ -256,6 +257,13 @@ def navigation(
256
257
  .. _st.Page: https://docs.streamlit.io/develop/api-reference/navigation/st.page
257
258
 
258
259
  """
260
+ # Validate position parameter
261
+ if not isinstance(position, str) or position not in ["sidebar", "hidden", "top"]:
262
+ raise StreamlitAPIException(
263
+ f'Invalid position "{position}". '
264
+ 'The position parameter must be one of "sidebar", "hidden", or "top".'
265
+ )
266
+
259
267
  # Disable the use of the pages feature (ie disregard v1 behavior of Multipage Apps)
260
268
  PagesManager.uses_pages_directory = False
261
269
 
@@ -265,7 +273,7 @@ def navigation(
265
273
  def _navigation(
266
274
  pages: Sequence[PageType] | Mapping[SectionHeader, Sequence[PageType]],
267
275
  *,
268
- position: Literal["sidebar", "hidden"],
276
+ position: Literal["sidebar", "hidden", "top"],
269
277
  expanded: bool,
270
278
  ) -> StreamlitPage:
271
279
  if isinstance(pages, Sequence):
@@ -332,13 +340,17 @@ def _navigation(
332
340
  }
333
341
 
334
342
  msg = ForwardMsg()
335
- if (
336
- position == "hidden"
337
- or config.get_option("client.showSidebarNavigation") is False
338
- ):
343
+ # Handle position logic correctly
344
+ if position == "hidden":
339
345
  msg.navigation.position = NavigationProto.Position.HIDDEN
340
- else:
341
- msg.navigation.position = NavigationProto.Position.SIDEBAR
346
+ elif position == "top":
347
+ msg.navigation.position = NavigationProto.Position.TOP
348
+ elif position == "sidebar":
349
+ # Only apply config override if position is sidebar
350
+ if config.get_option("client.showSidebarNavigation") is False:
351
+ msg.navigation.position = NavigationProto.Position.HIDDEN
352
+ else:
353
+ msg.navigation.position = NavigationProto.Position.SIDEBAR
342
354
 
343
355
  msg.navigation.expanded = expanded
344
356
  msg.navigation.sections[:] = nav_sections.keys()
@@ -43,7 +43,7 @@ class MarkdownMixin:
43
43
  unsafe_allow_html: bool = False,
44
44
  *, # keyword-only arguments:
45
45
  help: str | None = None,
46
- width: Width = "content",
46
+ width: Width = "stretch",
47
47
  ) -> DeltaGenerator:
48
48
  r"""Display string formatted as Markdown.
49
49
 
@@ -119,8 +119,8 @@ class MarkdownMixin:
119
119
 
120
120
  width : int or "stretch" or "content"
121
121
  The width of the markdown element. Can be an integer (pixels),
122
- "stretch" to use the full width of the container, or "content"
123
- (default) to size based on the content.
122
+ "stretch" (default) to use the full width of the container, or "content"
123
+ to size based on the content.
124
124
 
125
125
  Examples
126
126
  --------
@@ -165,7 +165,7 @@ class MarkdownMixin:
165
165
  unsafe_allow_html: bool = False,
166
166
  *, # keyword-only arguments:
167
167
  help: str | None = None,
168
- width: Width = "content",
168
+ width: Width = "stretch",
169
169
  ) -> DeltaGenerator:
170
170
  """Display text in small font.
171
171
 
@@ -206,9 +206,9 @@ class MarkdownMixin:
206
206
  parameter of ``st.markdown``.
207
207
 
208
208
  width : int or "stretch" or "content"
209
- The width of the caption. Can be an integer (pixels), "stretch" to
210
- use the full width of the container, or "content" (default) to size
211
- based on the content.
209
+ The width of the caption. Can be an integer (pixels), "stretch"
210
+ (default) to use the full width of the container, or "content" to
211
+ size based on the content.
212
212
 
213
213
  Examples
214
214
  --------
@@ -932,6 +932,10 @@ class ButtonMixin:
932
932
  page_link_proto.page = page.url_path
933
933
  if label is None:
934
934
  page_link_proto.label = page.title
935
+ if icon is None:
936
+ page_link_proto.icon = page.icon
937
+ # Here the StreamlitPage's icon is already validated
938
+ # (using validate_icon_or_emoji) during its initialization
935
939
  else:
936
940
  # Convert Path to string if necessary
937
941
  if isinstance(page, Path):
@@ -205,6 +205,10 @@ class StreamlitPage:
205
205
 
206
206
  self._page: Path | Callable[[], None] = page
207
207
  self._title: str = title or inferred_name.replace("_", " ")
208
+
209
+ if icon is not None:
210
+ # validate user provided icon.
211
+ validate_icon_or_emoji(icon)
208
212
  self._icon: str = icon or inferred_icon
209
213
 
210
214
  if self._title.strip() == "":
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
15
15
  from streamlit.proto import AppPage_pb2 as streamlit_dot_proto_dot_AppPage__pb2
16
16
 
17
17
 
18
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/Navigation.proto\x1a\x1dstreamlit/proto/AppPage.proto\"\xb4\x01\n\nNavigation\x12\x10\n\x08sections\x18\x01 \x03(\t\x12\x1b\n\tapp_pages\x18\x02 \x03(\x0b\x32\x08.AppPage\x12&\n\x08position\x18\x03 \x01(\x0e\x32\x14.Navigation.Position\x12\x18\n\x10page_script_hash\x18\x04 \x01(\t\x12\x10\n\x08\x65xpanded\x18\x05 \x01(\x08\"#\n\x08Position\x12\n\n\x06HIDDEN\x10\x00\x12\x0b\n\x07SIDEBAR\x10\x01\x42\x1e\n\x1c\x63om.snowflake.apps.streamlitb\x06proto3')
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/Navigation.proto\x1a\x1dstreamlit/proto/AppPage.proto\"\xbd\x01\n\nNavigation\x12\x10\n\x08sections\x18\x01 \x03(\t\x12\x1b\n\tapp_pages\x18\x02 \x03(\x0b\x32\x08.AppPage\x12&\n\x08position\x18\x03 \x01(\x0e\x32\x14.Navigation.Position\x12\x18\n\x10page_script_hash\x18\x04 \x01(\t\x12\x10\n\x08\x65xpanded\x18\x05 \x01(\x08\",\n\x08Position\x12\n\n\x06HIDDEN\x10\x00\x12\x0b\n\x07SIDEBAR\x10\x01\x12\x07\n\x03TOP\x10\x02\x42\x1e\n\x1c\x63om.snowflake.apps.streamlitb\x06proto3')
19
19
 
20
20
  _globals = globals()
21
21
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -24,7 +24,7 @@ if not _descriptor._USE_C_DESCRIPTORS:
24
24
  _globals['DESCRIPTOR']._loaded_options = None
25
25
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlit'
26
26
  _globals['_NAVIGATION']._serialized_start=68
27
- _globals['_NAVIGATION']._serialized_end=248
27
+ _globals['_NAVIGATION']._serialized_end=257
28
28
  _globals['_NAVIGATION_POSITION']._serialized_start=213
29
- _globals['_NAVIGATION_POSITION']._serialized_end=248
29
+ _globals['_NAVIGATION_POSITION']._serialized_end=257
30
30
  # @@protoc_insertion_point(module_scope)
@@ -48,6 +48,8 @@ class Navigation(google.protobuf.message.Message):
48
48
  """do not display the navigation"""
49
49
  SIDEBAR: Navigation._Position.ValueType # 1
50
50
  """display navigation in the sidebar"""
51
+ TOP: Navigation._Position.ValueType # 2
52
+ """display navigation in the top header"""
51
53
 
52
54
  class Position(_Position, metaclass=_PositionEnumTypeWrapper):
53
55
  """Position of the Navigation"""
@@ -56,6 +58,8 @@ class Navigation(google.protobuf.message.Message):
56
58
  """do not display the navigation"""
57
59
  SIDEBAR: Navigation.Position.ValueType # 1
58
60
  """display navigation in the sidebar"""
61
+ TOP: Navigation.Position.ValueType # 2
62
+ """display navigation in the top header"""
59
63
 
60
64
  SECTIONS_FIELD_NUMBER: builtins.int
61
65
  APP_PAGES_FIELD_NUMBER: builtins.int
@@ -72,9 +72,9 @@ def save_block_message(
72
72
  )
73
73
 
74
74
 
75
- def save_media_data(image_data: bytes | str, mimetype: str, image_id: str) -> None:
76
- CACHE_DATA_MESSAGE_REPLAY_CTX.save_image_data(image_data, mimetype, image_id)
77
- CACHE_RESOURCE_MESSAGE_REPLAY_CTX.save_image_data(image_data, mimetype, image_id)
75
+ def save_media_data(media_data: bytes | str, mimetype: str, media_id: str) -> None:
76
+ CACHE_DATA_MESSAGE_REPLAY_CTX.save_media_data(media_data, mimetype, media_id)
77
+ CACHE_RESOURCE_MESSAGE_REPLAY_CTX.save_media_data(media_data, mimetype, media_id)
78
78
 
79
79
 
80
80
  # Create and export public API singletons.
@@ -169,8 +169,9 @@ class CachedMessageReplayContext(threading.local):
169
169
  executing cached functions, so they can be replayed any time the function's
170
170
  execution is skipped because they're in the cache.
171
171
  """
172
- if not runtime.exists():
172
+ if not runtime.exists() or not in_cached_function.get():
173
173
  return
174
+
174
175
  if len(self._cached_message_stack) >= 1:
175
176
  id_to_save = self.select_dg_to_save(invoked_dg_id, used_dg_id)
176
177
 
@@ -200,6 +201,9 @@ class CachedMessageReplayContext(threading.local):
200
201
  used_dg_id: str,
201
202
  returned_dg_id: str,
202
203
  ) -> None:
204
+ if not in_cached_function.get():
205
+ return
206
+
203
207
  id_to_save = self.select_dg_to_save(invoked_dg_id, used_dg_id)
204
208
  for msgs in self._cached_message_stack:
205
209
  msgs.append(BlockMsgData(block_proto, id_to_save, returned_dg_id))
@@ -220,10 +224,13 @@ class CachedMessageReplayContext(threading.local):
220
224
  return acting_on_id
221
225
  return invoked_id
222
226
 
223
- def save_image_data(
224
- self, image_data: bytes | str, mimetype: str, image_id: str
227
+ def save_media_data(
228
+ self, media_data: bytes | str, mimetype: str, media_id: str
225
229
  ) -> None:
226
- self._media_data.append(MediaMsgData(image_data, mimetype, image_id))
230
+ if not in_cached_function.get():
231
+ return
232
+
233
+ self._media_data.append(MediaMsgData(media_data, mimetype, media_id))
227
234
 
228
235
 
229
236
  def replay_cached_messages(
@@ -151,7 +151,7 @@ def _mpa_v1(main_script_path: str) -> None:
151
151
  StreamlitPage(pages_folder / page.name) for page in pages
152
152
  ]
153
153
  # Initialize the navigation with all the pages:
154
- position: Literal["sidebar", "hidden"] = (
154
+ position: Literal["sidebar", "hidden", "top"] = (
155
155
  "hidden"
156
156
  if config.get_option("client.showSidebarNavigation") is False
157
157
  else "sidebar"
@@ -25,21 +25,7 @@
25
25
  <link rel="shortcut icon" href="./favicon.png" />
26
26
  <link
27
27
  rel="preload"
28
- href="./static/media/SourceSans-Regular.ttf.BqTI-3mA.woff2"
29
- as="font"
30
- type="font/woff2"
31
- crossorigin
32
- />
33
- <link
34
- rel="preload"
35
- href="./static/media/SourceSans-Semibold.ttf.BQV5CVwD.woff2"
36
- as="font"
37
- type="font/woff2"
38
- crossorigin
39
- />
40
- <link
41
- rel="preload"
42
- href="./static/media/SourceSans-Bold.ttf.gn7Db9ke.woff2"
28
+ href="./static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2"
43
29
  as="font"
44
30
  type="font/woff2"
45
31
  crossorigin
@@ -51,7 +37,7 @@
51
37
  <script>
52
38
  window.prerenderReady = false
53
39
  </script>
54
- <script type="module" crossorigin src="./static/js/index.CUQJU-d8.js"></script>
40
+ <script type="module" crossorigin src="./static/js/index.VE3QHoXq.js"></script>
55
41
  <link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
56
42
  </head>
57
43
  <body>