streamlit 1.49.0__py3-none-any.whl → 1.50.0__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/column_config.py +2 -0
- streamlit/commands/navigation.py +3 -1
- streamlit/components/v1/custom_component.py +17 -42
- streamlit/config.py +306 -0
- streamlit/connections/base_connection.py +4 -2
- streamlit/dataframe_util.py +3 -2
- streamlit/delta_generator.py +2 -3
- streamlit/elements/arrow.py +63 -43
- streamlit/elements/deck_gl_json_chart.py +1 -0
- streamlit/elements/form.py +6 -6
- streamlit/elements/graphviz_chart.py +23 -6
- streamlit/elements/iframe.py +0 -2
- streamlit/elements/image.py +10 -9
- streamlit/elements/layouts.py +58 -11
- streamlit/elements/lib/built_in_chart_utils.py +95 -29
- streamlit/elements/lib/column_config_utils.py +5 -0
- streamlit/elements/lib/column_types.py +563 -144
- streamlit/elements/lib/dialog.py +1 -0
- streamlit/elements/lib/layout_utils.py +4 -4
- streamlit/elements/lib/pandas_styler_utils.py +30 -14
- streamlit/elements/lib/utils.py +17 -5
- streamlit/elements/map.py +1 -3
- streamlit/elements/media.py +2 -0
- streamlit/elements/metric.py +10 -32
- streamlit/elements/plotly_chart.py +17 -9
- streamlit/elements/pyplot.py +6 -6
- streamlit/elements/vega_charts.py +110 -44
- streamlit/elements/widgets/audio_input.py +48 -0
- streamlit/elements/widgets/button.py +27 -25
- streamlit/elements/widgets/button_group.py +1 -0
- streamlit/elements/widgets/camera_input.py +1 -0
- streamlit/elements/widgets/chat.py +1 -0
- streamlit/elements/widgets/checkbox.py +1 -0
- streamlit/elements/widgets/color_picker.py +1 -0
- streamlit/elements/widgets/data_editor.py +6 -5
- streamlit/elements/widgets/file_uploader.py +1 -0
- streamlit/elements/widgets/multiselect.py +10 -0
- streamlit/elements/widgets/number_input.py +3 -0
- streamlit/elements/widgets/radio.py +1 -0
- streamlit/elements/widgets/select_slider.py +1 -0
- streamlit/elements/widgets/selectbox.py +4 -0
- streamlit/elements/widgets/slider.py +1 -0
- streamlit/elements/widgets/text_widgets.py +6 -0
- streamlit/elements/widgets/time_widgets.py +9 -0
- streamlit/elements/write.py +1 -17
- streamlit/git_util.py +65 -43
- streamlit/material_icon_names.py +1 -1
- streamlit/proto/Arrow_pb2.py +10 -8
- streamlit/proto/Arrow_pb2.pyi +31 -2
- streamlit/proto/AudioInput_pb2.py +2 -2
- streamlit/proto/AudioInput_pb2.pyi +6 -2
- streamlit/proto/Block_pb2.py +11 -11
- streamlit/proto/Block_pb2.pyi +5 -0
- streamlit/proto/NewSession_pb2.py +18 -16
- streamlit/proto/NewSession_pb2.pyi +135 -2
- streamlit/runtime/app_session.py +18 -5
- streamlit/runtime/theme_util.py +148 -0
- streamlit/static/index.html +2 -2
- streamlit/static/manifest.json +221 -221
- streamlit/static/static/css/index.CHEnSPGk.css +1 -0
- streamlit/static/static/css/{index.C8X8rNzw.css → index.CIiu7Ygf.css} +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.u9XvzxL8.js → ErrorOutline.esm.DUpR0_Ka.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CaRyZ-b2.js → FileDownload.esm.CN4j9-1w.js} +1 -1
- streamlit/static/static/js/{FileHelper.Dk2SwIi3.js → FileHelper.CaIUKG91.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.l_UPPvkg.js → FormClearHelper.DTcdrasw.js} +1 -1
- streamlit/static/static/js/{Hooks.BxrVEftw.js → Hooks.BRba_Own.js} +1 -1
- streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +1 -0
- streamlit/static/static/js/{Particles.DkY6FDnc.js → Particles.CElH0XX2.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BPtSM82n.js → ProgressBar.DetlP5aY.js} +2 -2
- streamlit/static/static/js/Toolbar.C77ar7rq.js +1 -0
- streamlit/static/static/js/{base-input.egUI4LjJ.js → base-input.BQft14La.js} +3 -3
- streamlit/static/static/js/{checkbox.ButpszcE.js → checkbox.yZOfXCeX.js} +1 -1
- streamlit/static/static/js/{createSuper.DYJA5xa6.js → createSuper.Dh9w1cs8.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +1 -0
- streamlit/static/static/js/{downloader.B3TjsSPZ.js → downloader.MeHtkq8r.js} +1 -1
- streamlit/static/static/js/{es6.BYSNuG4D.js → es6.VpBPGCnM.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CNPHJsF2.js → iframeResizer.contentWindow.yMw_ARIL.js} +1 -1
- streamlit/static/static/js/{index.DgpIMUsr.js → index.64ejlaaT.js} +1 -1
- streamlit/static/static/js/{index.BBnWuh07.js → index.6xX1278W.js} +90 -91
- streamlit/static/static/js/index.B-hiXRzw.js +1 -0
- streamlit/static/static/js/{index.DtwkPJs5.js → index.B0H9IXUJ.js} +47 -47
- streamlit/static/static/js/{index.0tDq1WXk.js → index.B4cAbHP6.js} +1 -1
- streamlit/static/static/js/{index.CFjU0x00.js → index.B4dUQfni.js} +1 -1
- streamlit/static/static/js/{index.BrD9sbpx.js → index.BPQo7BKk.js} +1 -1
- streamlit/static/static/js/index.Baqa90pe.js +2 -0
- streamlit/static/static/js/{index.uInpwWAP.js → index.Bj9JgOEC.js} +1 -1
- streamlit/static/static/js/index.BjCwMzj4.js +3 -0
- streamlit/static/static/js/{index.C3EXAI-u.js → index.Bm3VbPB5.js} +1 -1
- streamlit/static/static/js/{index.DGcW849X.js → index.Bxz2yX3P.js} +1 -1
- streamlit/static/static/js/{index.CeXLlclc.js → index.BycLveZ4.js} +1 -1
- streamlit/static/static/js/{index.CjQnYKID.js → index.C9BdUqTi.js} +1 -1
- streamlit/static/static/js/index.CFMf5_ez.js +197 -0
- streamlit/static/static/js/index.CGYqqs6j.js +1 -0
- streamlit/static/static/js/{index.CFePF7s4.js → index.CH1tqnSs.js} +1 -1
- streamlit/static/static/js/{index.BoJaJReB.js → index.CMItVsFA.js} +1 -1
- streamlit/static/static/js/{index.CuEFSQ-o.js → index.CTBk8Vk2.js} +1 -1
- streamlit/static/static/js/index.CiAQIz1H.js +7 -0
- streamlit/static/static/js/index.Cj7DSzVR.js +73 -0
- streamlit/static/static/js/index.Ck8rQ9OL.js +1 -0
- streamlit/static/static/js/{index.CqSRo6zQ.js → index.ClELlchS.js} +2 -2
- streamlit/static/static/js/{index.DP1rDFP0.js → index.Cnpi3o3E.js} +1 -1
- streamlit/static/static/js/{index.Cl_966eE.js → index.Ctn27_AE.js} +1 -1
- streamlit/static/static/js/{index.D4jR1m1z.js → index.D2QEXQq_.js} +1 -1
- streamlit/static/static/js/index.DH71Ezyj.js +1 -0
- streamlit/static/static/js/{index.CfiZGqj3.js → index.DHh-U0dK.js} +2 -2
- streamlit/static/static/js/{index.Bp1Of6L8.js → index.DK7hD7_w.js} +1 -1
- streamlit/static/static/js/{index.MQLQLR5Z.js → index.DKv_lNO7.js} +1 -1
- streamlit/static/static/js/index.DNLrMXgm.js +12 -0
- streamlit/static/static/js/index.DW0Grddz.js +1 -0
- streamlit/static/static/js/{index.Cb9gN2T2.js → index.Dbe-Q3C-.js} +1 -1
- streamlit/static/static/js/index.DcPNYEUo.js +1 -0
- streamlit/static/static/js/index.DuxqVQpd.js +1 -0
- streamlit/static/static/js/{index.BH79B25f.js → index.FFOzOWzC.js} +1 -1
- streamlit/static/static/js/{index.DWedOrkQ.js → index.GRUzrudl.js} +1 -1
- streamlit/static/static/js/{input.CbP5ZuQ7.js → input.s6pjQ49A.js} +1 -1
- streamlit/static/static/js/{memory.BuacVo2L.js → memory.Cuvsdfrl.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BZb9zRl_.js → number-overlay-editor.DdgVR5m3.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DSM84rOS.js → possibleConstructorReturn.CqidKeei.js} +1 -1
- streamlit/static/static/js/{sandbox.C480llMG.js → sandbox.CCQREcJx.js} +1 -1
- streamlit/static/static/js/{timepicker.BunxCVp7.js → timepicker.mkJF97Bb.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.B4o8rEx1.js → toConsumableArray.De7I7KVR.js} +1 -1
- streamlit/static/static/js/{uniqueId.tii0yosY.js → uniqueId.RI1LJdtz.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Bnm4FD6K.js → useBasicWidgetState.CedkNjUW.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.Dgtwc1m0.js → useTextInputAutoExpand.Ca7w8dVs.js} +2 -2
- streamlit/static/static/js/{useUpdateUiValue.DjXdMFGw.js → useUpdateUiValue.DeXelfRH.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +1 -0
- streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
- streamlit/string_util.py +58 -1
- streamlit/web/bootstrap.py +0 -31
- streamlit/web/server/routes.py +17 -4
- streamlit/web/server/server.py +1 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/METADATA +1 -1
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/RECORD +137 -136
- streamlit/static/static/css/index.COe1010n.css +0 -1
- streamlit/static/static/js/InputInstructions.C254RU9X.js +0 -1
- streamlit/static/static/js/Toolbar.BO_3WBaS.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.C9gQLEnU.js +0 -1
- streamlit/static/static/js/index.BDZorv41.js +0 -1
- streamlit/static/static/js/index.BeTC4Yl-.js +0 -197
- streamlit/static/static/js/index.BnOd05Ko.js +0 -2
- streamlit/static/static/js/index.Bpe4-O2W.js +0 -1
- streamlit/static/static/js/index.C1qCS-sd.js +0 -1
- streamlit/static/static/js/index.C77g9sAQ.js +0 -3
- streamlit/static/static/js/index.Ca3y4ztK.js +0 -1
- streamlit/static/static/js/index.CbwuUwu4.js +0 -12
- streamlit/static/static/js/index.DKb-BAE2.js +0 -1
- streamlit/static/static/js/index.DStzYLqM.js +0 -73
- streamlit/static/static/js/index.DVKQKDLu.js +0 -1
- streamlit/static/static/js/index.DYbRPmVF.js +0 -1
- streamlit/static/static/js/index.z992t-BQ.js +0 -7
- streamlit/static/static/js/withFullScreenWrapper.0cy2pVf5.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.CBxVaFdk.woff2 +0 -0
- {streamlit-1.49.0.data → streamlit-1.50.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/WHEEL +0 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from typing import TYPE_CHECKING
|
|
19
|
+
|
|
20
|
+
from streamlit.errors import StreamlitAPIException
|
|
21
|
+
from streamlit.url_util import is_url
|
|
22
|
+
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from streamlit.proto.NewSession_pb2 import CustomThemeConfig
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _parse_font_config(
|
|
28
|
+
font_config: str | None,
|
|
29
|
+
property_name: str,
|
|
30
|
+
) -> tuple[str, str | None]:
|
|
31
|
+
"""Parse a single font configuration string.
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
font_config: The font configuration string (e.g., "Inter" or "Inter:https://...")
|
|
35
|
+
property_name: The property name for error messages ("font", "codeFont", "headingFont")
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
A tuple of (font_name, source_url). source_url is None if not provided or not valid.
|
|
40
|
+
"""
|
|
41
|
+
if not font_config:
|
|
42
|
+
return "", None
|
|
43
|
+
|
|
44
|
+
# Strip leading/trailing whitespace from the config
|
|
45
|
+
font_config = font_config.strip()
|
|
46
|
+
|
|
47
|
+
if ":" not in font_config:
|
|
48
|
+
# No colon found, treat the entire string as the font name
|
|
49
|
+
return font_config, None
|
|
50
|
+
|
|
51
|
+
# Note: it is possible there are multiple colons in the string, so we need to split on the first colon.
|
|
52
|
+
font_name, source_url = font_config.split(":", 1)
|
|
53
|
+
# Strip whitespace from both font name and source
|
|
54
|
+
font_name = font_name.strip()
|
|
55
|
+
source_url = source_url.strip()
|
|
56
|
+
|
|
57
|
+
# Check that the href does not contain multiple fonts, so we confirm that "family="
|
|
58
|
+
# only shows up once in the source string (structure applies to Google Fonts only)
|
|
59
|
+
family_occurrences = source_url.count("family=")
|
|
60
|
+
if family_occurrences > 1:
|
|
61
|
+
raise StreamlitAPIException(
|
|
62
|
+
f"The source URL specified in the {property_name} property of config.toml contains multiple fonts. "
|
|
63
|
+
"Please specify only one font in the source URL."
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
is_valid_url = is_url(source_url)
|
|
67
|
+
|
|
68
|
+
# If the source is a valid URL (http/https) but no font name is provided, throw an exception
|
|
69
|
+
if is_valid_url and not font_name:
|
|
70
|
+
raise StreamlitAPIException(
|
|
71
|
+
f"A font family name is required when specifying a source URL "
|
|
72
|
+
f"for the {property_name} property in config.toml."
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
if is_valid_url:
|
|
76
|
+
return font_name, source_url
|
|
77
|
+
|
|
78
|
+
return font_name, None
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _get_font_source_config_name(property_name: str, section: str) -> str:
|
|
82
|
+
"""Get the config name for font sources based on property and section. This is used on the FE
|
|
83
|
+
as the id for the font source link in the html head.
|
|
84
|
+
"""
|
|
85
|
+
if section == "theme":
|
|
86
|
+
return property_name
|
|
87
|
+
return f"{property_name}-sidebar"
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def parse_fonts_with_source(
|
|
91
|
+
msg: CustomThemeConfig,
|
|
92
|
+
body_font_config: str | None,
|
|
93
|
+
code_font_config: str | None,
|
|
94
|
+
heading_font_config: str | None,
|
|
95
|
+
section: str,
|
|
96
|
+
) -> CustomThemeConfig:
|
|
97
|
+
"""Populate the CustomThemeConfig message with the font, codeFont, and headingFont fields set,
|
|
98
|
+
as well as the font_sources field to be added to the html head.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
msg: CustomThemeConfig message to be populated.
|
|
102
|
+
body_font_config: A string with just the font name (e.g., "Inter") or in the format
|
|
103
|
+
"<font_family_name_here>:<source_url_here>".
|
|
104
|
+
code_font_config: A string with just the font name (e.g., "Roboto Mono") or in the format
|
|
105
|
+
"<code_font_family_name_here>:<source_url_here>".
|
|
106
|
+
heading_font_config: A string with just the font name (e.g., "Inter Bold") or in the format
|
|
107
|
+
"<heading_font_family_name_here>:<source_url_here>".
|
|
108
|
+
section: The section of the config.toml file to parse the fonts from.
|
|
109
|
+
|
|
110
|
+
Examples
|
|
111
|
+
--------
|
|
112
|
+
body_font_config: "Inter" (just font name)
|
|
113
|
+
code_font_config: "Tagesschrift:https://fonts.googleapis.com/css2?family=Tagesschrift&display=swap" (with source)
|
|
114
|
+
heading_font_config: "playwrite-cc-za:https://use.typekit.net/xxs7euo.css"
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
Updated CustomThemeConfig message with the font, codeFont, and headingFont fields set.
|
|
119
|
+
Also sets sources in font_sources field to be added to the html (only when source URLs are provided).
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
# Parse body font config
|
|
123
|
+
body_font_name, body_font_source = _parse_font_config(body_font_config, "font")
|
|
124
|
+
if body_font_name:
|
|
125
|
+
msg.body_font = body_font_name
|
|
126
|
+
if body_font_source:
|
|
127
|
+
config_name = _get_font_source_config_name("font", section)
|
|
128
|
+
msg.font_sources.add(config_name=config_name, source_url=body_font_source)
|
|
129
|
+
|
|
130
|
+
# Parse code font config
|
|
131
|
+
code_font_name, code_font_source = _parse_font_config(code_font_config, "codeFont")
|
|
132
|
+
if code_font_name:
|
|
133
|
+
msg.code_font = code_font_name
|
|
134
|
+
if code_font_source:
|
|
135
|
+
config_name = _get_font_source_config_name("codeFont", section)
|
|
136
|
+
msg.font_sources.add(config_name=config_name, source_url=code_font_source)
|
|
137
|
+
|
|
138
|
+
# Parse heading font config
|
|
139
|
+
heading_font_name, heading_font_source = _parse_font_config(
|
|
140
|
+
heading_font_config, "headingFont"
|
|
141
|
+
)
|
|
142
|
+
if heading_font_name:
|
|
143
|
+
msg.heading_font = heading_font_name
|
|
144
|
+
if heading_font_source:
|
|
145
|
+
config_name = _get_font_source_config_name("headingFont", section)
|
|
146
|
+
msg.font_sources.add(config_name=config_name, source_url=heading_font_source)
|
|
147
|
+
|
|
148
|
+
return msg
|
streamlit/static/index.html
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
<script>
|
|
38
38
|
window.prerenderReady = false
|
|
39
39
|
</script>
|
|
40
|
-
<script type="module" crossorigin src="./static/js/index.
|
|
41
|
-
<link rel="stylesheet" crossorigin href="./static/css/index.
|
|
40
|
+
<script type="module" crossorigin src="./static/js/index.6xX1278W.js"></script>
|
|
41
|
+
<link rel="stylesheet" crossorigin href="./static/css/index.CIiu7Ygf.css">
|
|
42
42
|
</head>
|
|
43
43
|
<body>
|
|
44
44
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|