streamlit-nightly 1.45.2.dev20250613__py3-none-any.whl → 1.45.2.dev20250614__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.
@@ -20,6 +20,11 @@ from pathlib import Path
20
20
  from typing import TYPE_CHECKING, Any, cast
21
21
 
22
22
  from streamlit.delta_generator_singletons import get_dg_singleton_instance
23
+ from streamlit.elements.lib.layout_utils import (
24
+ LayoutConfig,
25
+ Width,
26
+ validate_width,
27
+ )
23
28
  from streamlit.errors import StreamlitAPIException
24
29
  from streamlit.proto.Html_pb2 import Html as HtmlProto
25
30
  from streamlit.runtime.metrics_util import gather_metrics
@@ -35,6 +40,8 @@ class HtmlMixin:
35
40
  def html(
36
41
  self,
37
42
  body: str | Path | SupportsStr | SupportsReprHtml,
43
+ *, # keyword-only arguments:
44
+ width: Width = "stretch",
38
45
  ) -> DeltaGenerator:
39
46
  """Insert HTML into your app.
40
47
 
@@ -70,6 +77,11 @@ class HtmlMixin:
70
77
  to the event container instead of the main container to avoid
71
78
  taking up space in the app.
72
79
 
80
+ width : int or "stretch" or "content"
81
+ The width of the HTML element. Can be an integer (pixels),
82
+ "stretch" (default) to use the full width of the container, or "content"
83
+ to size based on the content.
84
+
73
85
  Example
74
86
  -------
75
87
  >>> import streamlit as st
@@ -107,6 +119,9 @@ class HtmlMixin:
107
119
  if html_content == "":
108
120
  raise StreamlitAPIException("`st.html` body cannot be empty")
109
121
 
122
+ validate_width(width, allow_content=True)
123
+ layout_config = LayoutConfig(width=width)
124
+
110
125
  # Handle the case where there are only style tags - issue #9388
111
126
  # Use event container for style tags so they don't take up space in the app content
112
127
  if _html_only_style_tags(html_content):
@@ -115,7 +130,7 @@ class HtmlMixin:
115
130
  return self._event_dg._enqueue("html", html_proto)
116
131
  # Otherwise, send the html to the main container as normal
117
132
  html_proto.body = html_content
118
- return self.dg._enqueue("html", html_proto)
133
+ return self.dg._enqueue("html", html_proto, layout_config=layout_config)
119
134
 
120
135
  @property
121
136
  def dg(self) -> DeltaGenerator:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamlit-nightly
3
- Version: 1.45.2.dev20250613
3
+ Version: 1.45.2.dev20250614
4
4
  Summary: A faster way to build and share data apps
5
5
  Home-page: https://streamlit.io
6
6
  Author: Snowflake Inc
@@ -70,7 +70,7 @@ streamlit/elements/exception.py,sha256=nD5Y203hMXgyRqIvVDX4cmzYsSwuRe4ILq9BVPHdv
70
70
  streamlit/elements/form.py,sha256=e3lY1moc_yv7RezOtP978fitna5tiyJi4wuH08imUl0,14473
71
71
  streamlit/elements/graphviz_chart.py,sha256=0f_MP_fvM1lpa3ocF-fklCCUFI0uubnLNo4ujR7LowA,4881
72
72
  streamlit/elements/heading.py,sha256=nLPBrDt0K2mF1FjW7IEA2asd-OjXXWPBuD6WkqtjlqE,11989
73
- streamlit/elements/html.py,sha256=AgNP47iofcRA_s6HiyAer_ntvfJ7dEuZyoSEkuiv9o8,5970
73
+ streamlit/elements/html.py,sha256=_Z-NQAXOyBz2A1B41AilhFlJnhaSAHCwuh8ZbDTVm00,6518
74
74
  streamlit/elements/iframe.py,sha256=tdFNbLcf1mSiD3bVSUWBYWone9vZ3LZfcfSJPaW4sl4,8526
75
75
  streamlit/elements/image.py,sha256=Q4wkGPvSaKL1gb_DXzx7lfgeOQXIemKQkOT6HEutcYE,8487
76
76
  streamlit/elements/json.py,sha256=qgNHrV-se9erYFa1G4TR-y4H75ZS2U0ymn-NeyqK0xQ,5055
@@ -551,9 +551,9 @@ streamlit/web/server/server_util.py,sha256=J6n8xa0Sx66nWajMagXYe4MU8D9RIreqYRS1W
551
551
  streamlit/web/server/stats_request_handler.py,sha256=M1g40mgy78f316gP7_W8I__Q4e9x0NoNjiNLQdH58ds,3848
552
552
  streamlit/web/server/upload_file_request_handler.py,sha256=A-wgVOk6TCxf_KU-lQhawygSBKk5fwrD3Zkrz375Yj4,5269
553
553
  streamlit/web/server/websocket_headers.py,sha256=2OHv6G9hLJ0UX8oHDG3UJ86_KK4SJJD8FXOCsZjCKek,2229
554
- streamlit_nightly-1.45.2.dev20250613.data/scripts/streamlit.cmd,sha256=k9768SaQCkiYAPaTp7JtkhAHEHflNQfu6fAM4pri6zo,676
555
- streamlit_nightly-1.45.2.dev20250613.dist-info/METADATA,sha256=h_FgHMcVRtbLcN0NbpQnxukhMzcibP4s6dEKNhqi0jE,8973
556
- streamlit_nightly-1.45.2.dev20250613.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
557
- streamlit_nightly-1.45.2.dev20250613.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
558
- streamlit_nightly-1.45.2.dev20250613.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
559
- streamlit_nightly-1.45.2.dev20250613.dist-info/RECORD,,
554
+ streamlit_nightly-1.45.2.dev20250614.data/scripts/streamlit.cmd,sha256=k9768SaQCkiYAPaTp7JtkhAHEHflNQfu6fAM4pri6zo,676
555
+ streamlit_nightly-1.45.2.dev20250614.dist-info/METADATA,sha256=0c53wzYIPX_-WxEBY9_ShH7Sjq7UDXpwONCqRf4yaEM,8973
556
+ streamlit_nightly-1.45.2.dev20250614.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
557
+ streamlit_nightly-1.45.2.dev20250614.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
558
+ streamlit_nightly-1.45.2.dev20250614.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
559
+ streamlit_nightly-1.45.2.dev20250614.dist-info/RECORD,,