streamlit-nightly 1.45.2.dev20250611__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.
- streamlit/commands/navigation.py +22 -10
- streamlit/elements/lib/column_types.py +5 -2
- streamlit/elements/markdown.py +32 -3
- streamlit/elements/widgets/button.py +4 -0
- streamlit/navigation/page.py +4 -0
- streamlit/proto/Navigation_pb2.py +3 -3
- streamlit/proto/Navigation_pb2.pyi +4 -0
- streamlit/proto/NewSession_pb2.py +12 -10
- streamlit/proto/NewSession_pb2.pyi +12 -1
- streamlit/runtime/app_session.py +3 -0
- streamlit/runtime/caching/__init__.py +3 -3
- streamlit/runtime/caching/cached_message_replay.py +11 -4
- streamlit/runtime/scriptrunner/script_runner.py +1 -1
- streamlit/static/index.html +3 -17
- streamlit/static/manifest.json +239 -299
- streamlit/static/static/css/{index.B57yoT8i.css → index.CJVRHjQZ.css} +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.BdEPU15-.js → ErrorOutline.esm.DeqDGwEO.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CPW9RVdy.js → FileDownload.esm.--sYVXOa.js} +1 -1
- streamlit/static/static/js/{FileHelper.DIRQHKjC.js → FileHelper.bloGbv2W.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.DBWnhmsU.js → FormClearHelper.CYKg4prI.js} +1 -1
- streamlit/static/static/js/{Hooks.C186ViyU.js → Hooks.B16qdpVx.js} +1 -1
- streamlit/static/static/js/{InputInstructions.Dw8Kfux5.js → InputInstructions.DMO4B42t.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CxUNkTV6.js → ProgressBar.BH1ZwSEk.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.BKXBNQQq.js → RenderInPortalIfExists.IgdXklou.js} +1 -1
- streamlit/static/static/js/Toolbar.DkIytKhC.js +1 -0
- streamlit/static/static/js/{base-input.kjoewkRb.js → base-input.CAahP9oF.js} +4 -4
- streamlit/static/static/js/{checkbox.3isrn_og.js → checkbox.k1RuPBbZ.js} +2 -2
- streamlit/static/static/js/{createSuper.BI6vR8a0.js → createSuper.ButEKFwQ.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.Cm77d4zl.js → data-grid-overlay-editor.7XGvfjSS.js} +1 -1
- streamlit/static/static/js/{downloader.EOCjD0NL.js → downloader.DSilreQW.js} +1 -1
- streamlit/static/static/js/{es6.C5daX2Be.js → es6.yDFTfvZI.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.BMJUZZwp.js → iframeResizer.contentWindow.BSskBUmQ.js} +1 -1
- streamlit/static/static/js/{index.DNadNLPx.js → index.80yI-jzZ.js} +1 -1
- streamlit/static/static/js/index.9VWuu9bJ.js +1 -0
- streamlit/static/static/js/index.BAXqDnQ9.js +1 -0
- streamlit/static/static/js/{index.CC9mIHYY.js → index.BG8RaQ8E.js} +1 -1
- streamlit/static/static/js/{index.CZ4q7an5.js → index.BY47W7LH.js} +1 -1
- streamlit/static/static/js/index.BZqoA_aJ.js +1 -0
- streamlit/static/static/js/{index.Czu-GVzu.js → index.BcW5X6V5.js} +208 -208
- streamlit/static/static/js/{index.B250IT6a.js → index.Bo1tG5CG.js} +22 -22
- streamlit/static/static/js/{index.BOI5cGOL.js → index.BoHCDi97.js} +2 -2
- streamlit/static/static/js/{index.DWiuFOtg.js → index.BsCehkC8.js} +2 -2
- streamlit/static/static/js/{index.ImEyS-hh.js → index.C0xV4csm.js} +1 -1
- streamlit/static/static/js/index.CIXRC_j_.js +1 -0
- streamlit/static/static/js/{index.WILG491-.js → index.CKJtZooB.js} +1 -1
- streamlit/static/static/js/{index.CWBc7XaF.js → index.CWeNa-FP.js} +1 -1
- streamlit/static/static/js/{index.BX1E2ySZ.js → index.Cdi_Zw1a.js} +1 -1
- streamlit/static/static/js/{index.CSPwImJC.js → index.ChBsbacw.js} +1 -1
- streamlit/static/static/js/{index.DT1MtVX-.js → index.ChhNrUVT.js} +1 -1
- streamlit/static/static/js/index.ClCMQ4iK.js +1 -0
- streamlit/static/static/js/{index.BDtaM1CN.js → index.ClCtylIR.js} +1 -1
- streamlit/static/static/js/{index.BahyTNeD.js → index.CzY5--PW.js} +1 -1
- streamlit/static/static/js/{index.Bqgf6rro.js → index.D6veSOdZ.js} +1 -1
- streamlit/static/static/js/{index.BCrEmee_.js → index.D9muCjoC.js} +1 -1
- streamlit/static/static/js/{index.Dn0s0tyl.js → index.DGrpmtEI.js} +1 -1
- streamlit/static/static/js/{index.W6jmNWSX.js → index.DLBGcvEx.js} +1 -1
- streamlit/static/static/js/{index.CrA9QRW0.js → index.DNTQOI5W.js} +1 -1
- streamlit/static/static/js/{index.DINWiL73.js → index.DSpbUJvK.js} +1 -1
- streamlit/static/static/js/{index.N0O5_Lsy.js → index.DqbaNLFW.js} +1 -1
- streamlit/static/static/js/{index.poPmLKfl.js → index.DslKxDZN.js} +1 -1
- streamlit/static/static/js/{index.4R_UCp47.js → index.EgFq4OeP.js} +1 -1
- streamlit/static/static/js/index.FC1jA29Z.js +1 -0
- streamlit/static/static/js/{index.B1mJuAq5.js → index.Iveq4NZV.js} +1 -1
- streamlit/static/static/js/{index.BF4ErgkJ.js → index.O4EQwJsZ.js} +1 -1
- streamlit/static/static/js/{index.DPZr2Uus.js → index.RQlZs06L.js} +1 -1
- streamlit/static/static/js/{index.BhbIE27r.js → index.VE3QHoXq.js} +125 -111
- streamlit/static/static/js/{index.C8tUObTJ.js → index.bQ9PFxvm.js} +1 -1
- streamlit/static/static/js/index.tnjDy4iv.js +1 -0
- streamlit/static/static/js/{index.uWesVSaB.js → index.y-bXsZ3U.js} +3 -3
- streamlit/static/static/js/{input.ClFwD0mq.js → input.5dpw-Sqs.js} +2 -2
- streamlit/static/static/js/{memory.Yyz9MYzu.js → memory.8YWsO_82.js} +1 -1
- streamlit/static/static/js/{mergeWith.DD6Kt92K.js → mergeWith.1afHaDFE.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BikEvrb3.js → number-overlay-editor.CrclsoQd.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.D8TCcIZ-.js → possibleConstructorReturn.Dq7g1SWn.js} +1 -1
- streamlit/static/static/js/{sandbox.CDwm_VZE.js → sandbox.ZlQ0WZlh.js} +1 -1
- streamlit/static/static/js/{textarea.YCA7hvEm.js → textarea.CY5cwdtO.js} +2 -2
- streamlit/static/static/js/{timepicker.B4bN2wJ4.js → timepicker.DMqTkd3V.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.Cs6WL6jE.js → toConsumableArray.Bm0yYM5M.js} +1 -1
- streamlit/static/static/js/{uniqueId.DmJ1AzJ5.js → uniqueId.kDXXTYvS.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.hfDgYzWw.js → useBasicWidgetState.ClCgm0D-.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.DGVbDPHa.js → useOnInputChange.Cwcz7NJx.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.BzKsjBsN.js → withFullScreenWrapper.CRbf9QMV.js} +1 -1
- streamlit/static/static/media/SourceCodeVF-Italic.ttf.Ba1oaZG1.woff2 +0 -0
- streamlit/static/static/media/SourceCodeVF-Upright.ttf.BjWn63N-.woff2 +0 -0
- streamlit/static/static/media/SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2 +0 -0
- streamlit/static/static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2 +0 -0
- streamlit/static/static/media/SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2 +0 -0
- streamlit/static/static/media/SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2 +0 -0
- {streamlit_nightly-1.45.2.dev20250611.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.45.2.dev20250611.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/RECORD +94 -106
- streamlit/static/static/js/Toolbar.BJYum78u.js +0 -1
- streamlit/static/static/js/index.BrZir92w.js +0 -1
- streamlit/static/static/js/index.C_fRYRHk.js +0 -1
- streamlit/static/static/js/index.CtcMvS-_.js +0 -1
- streamlit/static/static/js/index.D-JeS9T4.js +0 -1
- streamlit/static/static/js/index.DMHsm4sn.js +0 -1
- streamlit/static/static/js/index.DXsNtpkK.js +0 -1
- streamlit/static/static/js/index.Uz7GO7SU.js +0 -1
- streamlit/static/static/media/SourceCode-Bold.ttf.CFEfr7-q.woff2 +0 -0
- streamlit/static/static/media/SourceCode-BoldIt.ttf.C-LkFXxa.woff2 +0 -0
- streamlit/static/static/media/SourceCode-It.ttf.CxFOx7N-.woff2 +0 -0
- streamlit/static/static/media/SourceCode-Regular.ttf.CBOlD63d.woff2 +0 -0
- streamlit/static/static/media/SourceCode-Semibold.ttf.CFHwW3Wd.woff2 +0 -0
- streamlit/static/static/media/SourceCode-SemiboldIt.ttf.Cg2yRu82.woff2 +0 -0
- streamlit/static/static/media/SourceSans-Bold.ttf.gn7Db9ke.woff2 +0 -0
- streamlit/static/static/media/SourceSans-BoldIt.ttf.Bp6Ygjgu.woff2 +0 -0
- streamlit/static/static/media/SourceSans-It.ttf.CKnmOrYX.woff2 +0 -0
- streamlit/static/static/media/SourceSans-Regular.ttf.BqTI-3mA.woff2 +0 -0
- streamlit/static/static/media/SourceSans-Semibold.ttf.BQV5CVwD.woff2 +0 -0
- streamlit/static/static/media/SourceSans-SemiboldIt.ttf.C62jiOej.woff2 +0 -0
- streamlit/static/static/media/SourceSerif-Bold.ttf.Csh8T7yr.woff2 +0 -0
- streamlit/static/static/media/SourceSerif-BoldIt.ttf.1j4hxMHI.woff2 +0 -0
- streamlit/static/static/media/SourceSerif-It.ttf.Cr-UUpZM.woff2 +0 -0
- streamlit/static/static/media/SourceSerif-Regular.ttf.BNbBs0kC.woff2 +0 -0
- streamlit/static/static/media/SourceSerif-Semibold.ttf.CL4HK1l8.woff2 +0 -0
- streamlit/static/static/media/SourceSerif-SemiboldIt.ttf.C2G1sf1n.woff2 +0 -0
- {streamlit_nightly-1.45.2.dev20250611.data → streamlit_nightly-1.45.2.dev20250613.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.45.2.dev20250611.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.45.2.dev20250611.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.45.2.dev20250611.dist-info → streamlit_nightly-1.45.2.dev20250613.dist-info}/top_level.txt +0 -0
streamlit/commands/navigation.py
CHANGED
@@ -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 "
|
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
|
-
|
336
|
-
|
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
|
-
|
341
|
-
msg.navigation.position = NavigationProto.Position.
|
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()
|
@@ -32,6 +32,7 @@ NumberFormat: TypeAlias = Literal[
|
|
32
32
|
"localized",
|
33
33
|
"dollar",
|
34
34
|
"euro",
|
35
|
+
"yen",
|
35
36
|
"percent",
|
36
37
|
"compact",
|
37
38
|
"scientific",
|
@@ -416,7 +417,7 @@ def NumberColumn(
|
|
416
417
|
Specifies the default value in this column when a new row is added by
|
417
418
|
the user. This defaults to ``None``.
|
418
419
|
|
419
|
-
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
420
|
+
format: str, "plain", "localized", "percent", "dollar", "euro", "yen", "accounting", "compact", "scientific", "engineering", or None
|
420
421
|
A format string controlling how numbers are displayed.
|
421
422
|
This can be one of the following values:
|
422
423
|
|
@@ -426,6 +427,7 @@ def NumberColumn(
|
|
426
427
|
- ``"percent"``: Show the number as a percentage (e.g. "123456.70%").
|
427
428
|
- ``"dollar"``: Show the number as a dollar amount (e.g. "$1,234.57").
|
428
429
|
- ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
|
430
|
+
- ``"yen"``: Show the number as a yen amount (e.g. "¥1,235").
|
429
431
|
- ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
|
430
432
|
- ``"compact"``: Show the number in a compact format (e.g. "1.2K").
|
431
433
|
- ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
|
@@ -1991,7 +1993,7 @@ def ProgressColumn(
|
|
1991
1993
|
the Markdown directives described in the ``body`` parameter of
|
1992
1994
|
``st.markdown``.
|
1993
1995
|
|
1994
|
-
format: str, "plain", "localized", "percent", "dollar", "euro", "accounting", "compact", "scientific", "engineering", or None
|
1996
|
+
format: str, "plain", "localized", "percent", "dollar", "euro", "yen", "accounting", "compact", "scientific", "engineering", or None
|
1995
1997
|
A format string controlling how the numbers are displayed.
|
1996
1998
|
This can be one of the following values:
|
1997
1999
|
|
@@ -2001,6 +2003,7 @@ def ProgressColumn(
|
|
2001
2003
|
- ``"percent"``: Show the number as a percentage (e.g. "123456.70%").
|
2002
2004
|
- ``"dollar"``: Show the number as a dollar amount (e.g. "$1,234.57").
|
2003
2005
|
- ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
|
2006
|
+
- ``"yen"``: Show the number as a yen amount (e.g. "¥1,235").
|
2004
2007
|
- ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
|
2005
2008
|
- ``"compact"``: Show the number in a compact format (e.g. "1.2K").
|
2006
2009
|
- ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
|
streamlit/elements/markdown.py
CHANGED
@@ -43,6 +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 = "stretch",
|
46
47
|
) -> DeltaGenerator:
|
47
48
|
r"""Display string formatted as Markdown.
|
48
49
|
|
@@ -116,6 +117,11 @@ class MarkdownMixin:
|
|
116
117
|
including the Markdown directives described in the ``body``
|
117
118
|
parameter of ``st.markdown``.
|
118
119
|
|
120
|
+
width : int or "stretch" or "content"
|
121
|
+
The width of the markdown element. Can be an integer (pixels),
|
122
|
+
"stretch" (default) to use the full width of the container, or "content"
|
123
|
+
to size based on the content.
|
124
|
+
|
119
125
|
Examples
|
120
126
|
--------
|
121
127
|
>>> import streamlit as st
|
@@ -147,7 +153,10 @@ class MarkdownMixin:
|
|
147
153
|
if help:
|
148
154
|
markdown_proto.help = help
|
149
155
|
|
150
|
-
|
156
|
+
validate_width(width, allow_content=True)
|
157
|
+
layout_config = LayoutConfig(width=width)
|
158
|
+
|
159
|
+
return self.dg._enqueue("markdown", markdown_proto, layout_config=layout_config)
|
151
160
|
|
152
161
|
@gather_metrics("caption")
|
153
162
|
def caption(
|
@@ -156,6 +165,7 @@ class MarkdownMixin:
|
|
156
165
|
unsafe_allow_html: bool = False,
|
157
166
|
*, # keyword-only arguments:
|
158
167
|
help: str | None = None,
|
168
|
+
width: Width = "stretch",
|
159
169
|
) -> DeltaGenerator:
|
160
170
|
"""Display text in small font.
|
161
171
|
|
@@ -195,6 +205,11 @@ class MarkdownMixin:
|
|
195
205
|
including the Markdown directives described in the ``body``
|
196
206
|
parameter of ``st.markdown``.
|
197
207
|
|
208
|
+
width : int or "stretch" or "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
|
+
|
198
213
|
Examples
|
199
214
|
--------
|
200
215
|
>>> import streamlit as st
|
@@ -210,7 +225,11 @@ class MarkdownMixin:
|
|
210
225
|
caption_proto.element_type = MarkdownProto.Type.CAPTION
|
211
226
|
if help:
|
212
227
|
caption_proto.help = help
|
213
|
-
|
228
|
+
|
229
|
+
validate_width(width, allow_content=True)
|
230
|
+
layout_config = LayoutConfig(width=width)
|
231
|
+
|
232
|
+
return self.dg._enqueue("markdown", caption_proto, layout_config=layout_config)
|
214
233
|
|
215
234
|
@gather_metrics("latex")
|
216
235
|
def latex(
|
@@ -324,6 +343,7 @@ class MarkdownMixin:
|
|
324
343
|
"grey",
|
325
344
|
"primary",
|
326
345
|
] = "blue",
|
346
|
+
width: Width = "content",
|
327
347
|
) -> DeltaGenerator:
|
328
348
|
"""Display a colored badge with an icon and label.
|
329
349
|
|
@@ -378,6 +398,11 @@ class MarkdownMixin:
|
|
378
398
|
``"primary"``, Streamlit will use the default primary accent color
|
379
399
|
unless you set the ``theme.primaryColor`` configuration option.
|
380
400
|
|
401
|
+
width : int or "stretch" or "content"
|
402
|
+
The width of the badge. Can be an integer (pixels), "stretch" to
|
403
|
+
use the full width of the container, or "content" (default) to size
|
404
|
+
based on the content.
|
405
|
+
|
381
406
|
Examples
|
382
407
|
--------
|
383
408
|
Create standalone badges with ``st.badge`` (with or without icons). If
|
@@ -406,7 +431,11 @@ class MarkdownMixin:
|
|
406
431
|
badge_proto = MarkdownProto()
|
407
432
|
badge_proto.body = f":{color}-badge[{icon_str}{escaped_label}]"
|
408
433
|
badge_proto.element_type = MarkdownProto.Type.NATIVE
|
409
|
-
|
434
|
+
|
435
|
+
validate_width(width, allow_content=True)
|
436
|
+
layout_config = LayoutConfig(width=width)
|
437
|
+
|
438
|
+
return self.dg._enqueue("markdown", badge_proto, layout_config=layout_config)
|
410
439
|
|
411
440
|
@property
|
412
441
|
def dg(self) -> DeltaGenerator:
|
@@ -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):
|
streamlit/navigation/page.py
CHANGED
@@ -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\"\
|
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=
|
27
|
+
_globals['_NAVIGATION']._serialized_end=257
|
28
28
|
_globals['_NAVIGATION_POSITION']._serialized_start=213
|
29
|
-
_globals['_NAVIGATION_POSITION']._serialized_end=
|
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
|
@@ -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\"\xa4\x08\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\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x06\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x07\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x08\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\t\x88\x01\x01\" \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_base_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_color\"
|
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\"\xa4\x08\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\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x06\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x07\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x08\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\t\x88\x01\x01\" \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_base_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_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)
|
@@ -24,6 +24,8 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.NewSession_
|
|
24
24
|
if not _descriptor._USE_C_DESCRIPTORS:
|
25
25
|
_globals['DESCRIPTOR']._loaded_options = None
|
26
26
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\017NewSessionProto'
|
27
|
+
_globals['_FONTFACE'].fields_by_name['weight']._loaded_options = None
|
28
|
+
_globals['_FONTFACE'].fields_by_name['weight']._serialized_options = b'\030\001'
|
27
29
|
_globals['_NEWSESSION']._serialized_start=105
|
28
30
|
_globals['_NEWSESSION']._serialized_end=398
|
29
31
|
_globals['_INITIALIZE']._serialized_start=401
|
@@ -39,13 +41,13 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
39
41
|
_globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_start=1681
|
40
42
|
_globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_end=1735
|
41
43
|
_globals['_FONTFACE']._serialized_start=1934
|
42
|
-
_globals['_FONTFACE']._serialized_end=
|
43
|
-
_globals['_RADII']._serialized_start=
|
44
|
-
_globals['_RADII']._serialized_end=
|
45
|
-
_globals['_FONTSIZES']._serialized_start=
|
46
|
-
_globals['_FONTSIZES']._serialized_end=
|
47
|
-
_globals['_USERINFO']._serialized_start=
|
48
|
-
_globals['_USERINFO']._serialized_end=
|
49
|
-
_globals['_ENVIRONMENTINFO']._serialized_start=
|
50
|
-
_globals['_ENVIRONMENTINFO']._serialized_end=
|
44
|
+
_globals['_FONTFACE']._serialized_end=2053
|
45
|
+
_globals['_RADII']._serialized_start=2055
|
46
|
+
_globals['_RADII']._serialized_end=2115
|
47
|
+
_globals['_FONTSIZES']._serialized_start=2117
|
48
|
+
_globals['_FONTSIZES']._serialized_end=2201
|
49
|
+
_globals['_USERINFO']._serialized_start=2203
|
50
|
+
_globals['_USERINFO']._serialized_end=2300
|
51
|
+
_globals['_ENVIRONMENTINFO']._serialized_start=2302
|
52
|
+
_globals['_ENVIRONMENTINFO']._serialized_end=2410
|
51
53
|
# @@protoc_insertion_point(module_scope)
|
@@ -392,20 +392,31 @@ class FontFace(google.protobuf.message.Message):
|
|
392
392
|
URL_FIELD_NUMBER: builtins.int
|
393
393
|
FAMILY_FIELD_NUMBER: builtins.int
|
394
394
|
WEIGHT_FIELD_NUMBER: builtins.int
|
395
|
+
WEIGHT_RANGE_FIELD_NUMBER: builtins.int
|
395
396
|
STYLE_FIELD_NUMBER: builtins.int
|
397
|
+
UNICODE_RANGE_FIELD_NUMBER: builtins.int
|
396
398
|
url: builtins.str
|
397
399
|
family: builtins.str
|
400
|
+
"""Equivalent to font-family @font-face CSS property."""
|
398
401
|
weight: builtins.int
|
402
|
+
"""DEPRECATED: Use weight_range instead which supports single weights & weight ranges."""
|
403
|
+
weight_range: builtins.str
|
404
|
+
"""Equivalent to font-weight @font-face CSS property."""
|
399
405
|
style: builtins.str
|
406
|
+
"""Equivalent to font-style @font-face CSS property."""
|
407
|
+
unicode_range: builtins.str
|
408
|
+
"""Equivalent to unicode-range @font-face CSS property."""
|
400
409
|
def __init__(
|
401
410
|
self,
|
402
411
|
*,
|
403
412
|
url: builtins.str = ...,
|
404
413
|
family: builtins.str = ...,
|
405
414
|
weight: builtins.int = ...,
|
415
|
+
weight_range: builtins.str = ...,
|
406
416
|
style: builtins.str = ...,
|
417
|
+
unicode_range: builtins.str = ...,
|
407
418
|
) -> None: ...
|
408
|
-
def ClearField(self, field_name: typing.Literal["family", b"family", "style", b"style", "url", b"url", "weight", b"weight"]) -> None: ...
|
419
|
+
def ClearField(self, field_name: typing.Literal["family", b"family", "style", b"style", "unicode_range", b"unicode_range", "url", b"url", "weight", b"weight", "weight_range", b"weight_range"]) -> None: ...
|
409
420
|
|
410
421
|
global___FontFace = FontFace
|
411
422
|
|
streamlit/runtime/app_session.py
CHANGED
@@ -987,6 +987,9 @@ def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
|
|
987
987
|
if font_faces is not None:
|
988
988
|
for font_face in font_faces:
|
989
989
|
try:
|
990
|
+
if "weight" in font_face:
|
991
|
+
font_face["weight_range"] = str(font_face["weight"])
|
992
|
+
del font_face["weight"]
|
990
993
|
msg.font_faces.append(ParseDict(font_face, FontFace()))
|
991
994
|
except Exception as e: # noqa: PERF203
|
992
995
|
_LOGGER.warning(
|
@@ -72,9 +72,9 @@ def save_block_message(
|
|
72
72
|
)
|
73
73
|
|
74
74
|
|
75
|
-
def save_media_data(
|
76
|
-
CACHE_DATA_MESSAGE_REPLAY_CTX.
|
77
|
-
CACHE_RESOURCE_MESSAGE_REPLAY_CTX.
|
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
|
224
|
-
self,
|
227
|
+
def save_media_data(
|
228
|
+
self, media_data: bytes | str, mimetype: str, media_id: str
|
225
229
|
) -> None:
|
226
|
-
|
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"
|
streamlit/static/index.html
CHANGED
@@ -25,21 +25,7 @@
|
|
25
25
|
<link rel="shortcut icon" href="./favicon.png" />
|
26
26
|
<link
|
27
27
|
rel="preload"
|
28
|
-
href="./static/media/
|
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,8 +37,8 @@
|
|
51
37
|
<script>
|
52
38
|
window.prerenderReady = false
|
53
39
|
</script>
|
54
|
-
<script type="module" crossorigin src="./static/js/index.
|
55
|
-
<link rel="stylesheet" crossorigin href="./static/css/index.
|
40
|
+
<script type="module" crossorigin src="./static/js/index.VE3QHoXq.js"></script>
|
41
|
+
<link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
|
56
42
|
</head>
|
57
43
|
<body>
|
58
44
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|