streamlit-nightly 1.46.2.dev20250710__py3-none-any.whl → 1.46.2.dev20250712__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 (84) hide show
  1. streamlit/elements/layouts.py +38 -17
  2. streamlit/elements/widgets/chat.py +1 -5
  3. streamlit/proto/Block_pb2.py +33 -31
  4. streamlit/proto/Block_pb2.pyi +3 -1
  5. streamlit/runtime/state/safe_session_state.py +8 -0
  6. streamlit/runtime/state/session_state.py +6 -0
  7. streamlit/static/index.html +1 -1
  8. streamlit/static/manifest.json +218 -218
  9. streamlit/static/static/css/index.CQt5TjGB.css +1 -0
  10. streamlit/static/static/js/{ErrorOutline.esm.DcxmqjUD.js → ErrorOutline.esm.CaUhmcG6.js} +1 -1
  11. streamlit/static/static/js/{FileDownload.esm.jHGWeFoc.js → FileDownload.esm.ZEl-HfEg.js} +1 -1
  12. streamlit/static/static/js/{FileHelper.Zrnryqu0.js → FileHelper.BKIVKQnB.js} +1 -1
  13. streamlit/static/static/js/{FormClearHelper.BYxFNamA.js → FormClearHelper.C4W8xjEX.js} +1 -1
  14. streamlit/static/static/js/{Hooks.Bf489OB5.js → Hooks.Bcs7Dqad.js} +1 -1
  15. streamlit/static/static/js/{InputInstructions.BOAAgTvb.js → InputInstructions.CAp9mFM6.js} +1 -1
  16. streamlit/static/static/js/{ProgressBar.CHyAN4g4.js → ProgressBar.DBmbQ5U6.js} +1 -1
  17. streamlit/static/static/js/{RenderInPortalIfExists.BnEeVRFq.js → RenderInPortalIfExists.BGENGpwt.js} +1 -1
  18. streamlit/static/static/js/{Toolbar.CXl8zpFb.js → Toolbar.CA92Moni.js} +1 -1
  19. streamlit/static/static/js/{base-input.Df0b6Qry.js → base-input.C-H36mFE.js} +1 -1
  20. streamlit/static/static/js/{checkbox._czeraZi.js → checkbox.B6I7DbdE.js} +1 -1
  21. streamlit/static/static/js/{createSuper.ZqMAxMzx.js → createSuper.DEaMobJa.js} +1 -1
  22. streamlit/static/static/js/data-grid-overlay-editor.CxvB719M.js +1 -0
  23. streamlit/static/static/js/{downloader.C4jTgaKc.js → downloader.CDDSxxak.js} +1 -1
  24. streamlit/static/static/js/{es6.Do-e8HO9.js → es6.BMYexa9t.js} +2 -2
  25. streamlit/static/static/js/{iframeResizer.contentWindow.mWYZgJrl.js → iframeResizer.contentWindow.D-l9cCws.js} +1 -1
  26. streamlit/static/static/js/{index.dGEV5Rcv.js → index.1ZtAvXND.js} +1 -1
  27. streamlit/static/static/js/index.B-g_Erog.js +197 -0
  28. streamlit/static/static/js/{index.B1l9OvXj.js → index.BQQ5JTaz.js} +1 -1
  29. streamlit/static/static/js/{index.fAtLaEj3.js → index.Bb5Sxtkx.js} +1 -1
  30. streamlit/static/static/js/{index.BnBtCCi7.js → index.BdazK8za.js} +1 -1
  31. streamlit/static/static/js/{index.MiKM7bk8.js → index.BjJqANY4.js} +1 -1
  32. streamlit/static/static/js/{index.DsGIFS7a.js → index.BoTBd6Jn.js} +1 -1
  33. streamlit/static/static/js/{index.DLiM-whD.js → index.Br2RYgMU.js} +1 -1
  34. streamlit/static/static/js/{index.Ca2H30nP.js → index.Buz-cCdK.js} +1 -1
  35. streamlit/static/static/js/{index.C3rroFP9.js → index.C9PLrvrw.js} +1 -1
  36. streamlit/static/static/js/{index.DmGoE186.js → index.CEUhSvrW.js} +1 -1
  37. streamlit/static/static/js/{index.kBQMwU6d.js → index.CS9yBABI.js} +1 -1
  38. streamlit/static/static/js/{index.rOGHN7Ug.js → index.CZbA_QY0.js} +1 -1
  39. streamlit/static/static/js/{index.eyf91ITY.js → index.C_f3O5DO.js} +1 -1
  40. streamlit/static/static/js/{index.CjIM7ERG.js → index.Ce906Q5W.js} +1 -1
  41. streamlit/static/static/js/{index.BzF3lrfB.js → index.CfoE7jon.js} +1 -1
  42. streamlit/static/static/js/{index.DTxuG-7x.js → index.Ch30W6NP.js} +1 -1
  43. streamlit/static/static/js/{index.DmjIEMLZ.js → index.CphcnmQO.js} +1 -1
  44. streamlit/static/static/js/{index.CF7mP-ZJ.js → index.CqALE_Sz.js} +1 -1
  45. streamlit/static/static/js/{index.mvbBbK3q.js → index.Ct2v9YN2.js} +1 -1
  46. streamlit/static/static/js/{index.DcO57awd.js → index.D9XZpDDt.js} +1 -1
  47. streamlit/static/static/js/{index.CqLB334S.js → index.DBVPN8iJ.js} +1 -1
  48. streamlit/static/static/js/{index.DFXciakO.js → index.DFjvmFUl.js} +1 -1
  49. streamlit/static/static/js/{index.DHdGt5Y8.js → index.DHv7KxuP.js} +1 -1
  50. streamlit/static/static/js/{index.Bys870gz.js → index.DJ6SMXzt.js} +1 -1
  51. streamlit/static/static/js/{index.CoYJofEx.js → index.DMzpbFDn.js} +1 -1
  52. streamlit/static/static/js/{index.rvtw60Rz.js → index.DNoDZbuV.js} +1 -1
  53. streamlit/static/static/js/{index.DGHrEEt1.js → index.DYvo87DK.js} +1 -1
  54. streamlit/static/static/js/{index.BPbIttLy.js → index.Dm8vdcs9.js} +1 -1
  55. streamlit/static/static/js/{index.BF_sb0WL.js → index.DygxY7Lg.js} +1 -1
  56. streamlit/static/static/js/{index.GgXBejJs.js → index.DzH3Qe6P.js} +1 -1
  57. streamlit/static/static/js/{index.D_0R5OBc.js → index.EAQB8Tuq.js} +110 -136
  58. streamlit/static/static/js/{index.-qN84VXE.js → index.Ou3kxN43.js} +1 -1
  59. streamlit/static/static/js/{index.QaE_KRXJ.js → index.aLRZj3JI.js} +1 -1
  60. streamlit/static/static/js/{index.35y_AzR4.js → index.kIS8fJE1.js} +1 -1
  61. streamlit/static/static/js/{index.Ci7nbB2g.js → index.phUFaJLn.js} +1 -1
  62. streamlit/static/static/js/{index.BVdmv4f9.js → index.vRRu8CJW.js} +1 -1
  63. streamlit/static/static/js/{input.CbSNLKWI.js → input.DjnwsrgF.js} +1 -1
  64. streamlit/static/static/js/{memory.jXCvhbgc.js → memory.C-fF2BpE.js} +1 -1
  65. streamlit/static/static/js/{mergeWith.DrPpfkW2.js → mergeWith.Cjweouij.js} +1 -1
  66. streamlit/static/static/js/{number-overlay-editor.DcUxabQJ.js → number-overlay-editor.BFTlQD7x.js} +1 -1
  67. streamlit/static/static/js/{possibleConstructorReturn.CzPR4xGM.js → possibleConstructorReturn.Cy1PJuxU.js} +1 -1
  68. streamlit/static/static/js/{sandbox.Bd0m3BOh.js → sandbox.DvSXZ4R-.js} +1 -1
  69. streamlit/static/static/js/{timepicker.CpLBXuBk.js → timepicker.bPCY7gSF.js} +1 -1
  70. streamlit/static/static/js/{toConsumableArray.D_piEkI9.js → toConsumableArray.DaNXH4b3.js} +1 -1
  71. streamlit/static/static/js/{uniqueId.wDqRFq8o.js → uniqueId.CDZNs_pn.js} +1 -1
  72. streamlit/static/static/js/{useBasicWidgetState.rpbnEZqG.js → useBasicWidgetState.YAhDGDM8.js} +1 -1
  73. streamlit/static/static/js/{useOnInputChange.DLCh37tX.js → useOnInputChange.HiDk3WIa.js} +1 -1
  74. streamlit/static/static/js/{useTextInputAutoExpand.Ba7vlWvW.js → useTextInputAutoExpand.CwuIWHHK.js} +1 -1
  75. streamlit/static/static/js/{withFullScreenWrapper.Cqo3BmOl.js → withFullScreenWrapper.C4lh8vGd.js} +1 -1
  76. {streamlit_nightly-1.46.2.dev20250710.dist-info → streamlit_nightly-1.46.2.dev20250712.dist-info}/METADATA +1 -1
  77. {streamlit_nightly-1.46.2.dev20250710.dist-info → streamlit_nightly-1.46.2.dev20250712.dist-info}/RECORD +81 -81
  78. streamlit/static/static/css/index.CsLB_Bnz.css +0 -1
  79. streamlit/static/static/js/data-grid-overlay-editor.Bok03B1i.js +0 -1
  80. streamlit/static/static/js/index.BIEGVO6Q.js +0 -197
  81. {streamlit_nightly-1.46.2.dev20250710.data → streamlit_nightly-1.46.2.dev20250712.data}/scripts/streamlit.cmd +0 -0
  82. {streamlit_nightly-1.46.2.dev20250710.dist-info → streamlit_nightly-1.46.2.dev20250712.dist-info}/WHEEL +0 -0
  83. {streamlit_nightly-1.46.2.dev20250710.dist-info → streamlit_nightly-1.46.2.dev20250712.dist-info}/entry_points.txt +0 -0
  84. {streamlit_nightly-1.46.2.dev20250710.dist-info → streamlit_nightly-1.46.2.dev20250712.dist-info}/top_level.txt +0 -0
@@ -21,8 +21,11 @@ from typing_extensions import TypeAlias
21
21
 
22
22
  from streamlit.delta_generator_singletons import get_dg_singleton_instance
23
23
  from streamlit.elements.lib.layout_utils import (
24
+ Height,
24
25
  WidthWithoutContent,
26
+ get_height_config,
25
27
  get_width_config,
28
+ validate_height,
26
29
  validate_width,
27
30
  )
28
31
  from streamlit.elements.lib.utils import Key, compute_and_register_element_id, to_key
@@ -34,7 +37,6 @@ from streamlit.errors import (
34
37
  )
35
38
  from streamlit.proto.Block_pb2 import Block as BlockProto
36
39
  from streamlit.proto.GapSize_pb2 import GapConfig, GapSize
37
- from streamlit.proto.HeightConfig_pb2 import HeightConfig
38
40
  from streamlit.runtime.metrics_util import gather_metrics
39
41
  from streamlit.string_util import validate_icon_or_emoji
40
42
 
@@ -51,9 +53,10 @@ class LayoutsMixin:
51
53
  def container(
52
54
  self,
53
55
  *,
54
- height: int | None = None,
55
56
  border: bool | None = None,
56
57
  key: Key | None = None,
58
+ width: WidthWithoutContent = "stretch",
59
+ height: Height = "content",
57
60
  ) -> DeltaGenerator:
58
61
  """Insert a multi-element container.
59
62
 
@@ -67,11 +70,12 @@ class LayoutsMixin:
67
70
 
68
71
  Parameters
69
72
  ----------
70
- height : int or None
71
- Desired height of the container expressed in pixels. If ``None`` (default)
73
+ height : int, "content", or "stretch"
74
+ Desired height of the container expressed in pixels. If ``content`` (default),
72
75
  the container grows to fit its content. If a fixed height, scrolling is
73
76
  enabled for large content and a grey border is shown around the container
74
- to visually separate its scroll surface from the rest of the app.
77
+ to visually separate its scroll surface from the rest of the app. If ``stretch``,
78
+ Streamlit sets the height of the container to match the height of the parent container
75
79
 
76
80
  .. note::
77
81
  Use scrolling containers sparingly. If you use scrolling
@@ -91,6 +95,11 @@ class LayoutsMixin:
91
95
  Additionally, if ``key`` is provided, it will be used as CSS
92
96
  class name prefixed with ``st-key-``.
93
97
 
98
+ width : int or "stretch"
99
+ The desired width of the container expressed in pixels. If this is
100
+ ``"stretch"`` (default), Streamlit sets the width of the container to
101
+ match the width of the parent container. If an integer is provided,
102
+ the container will be set to the specified width.
94
103
 
95
104
  Examples
96
105
  --------
@@ -157,24 +166,23 @@ class LayoutsMixin:
157
166
  key = to_key(key)
158
167
  block_proto = BlockProto()
159
168
  block_proto.allow_empty = False
160
- block_proto.flex_container.border = border or False
161
169
  block_proto.flex_container.wrap = False
162
170
 
171
+ validate_width(width)
172
+ block_proto.width_config.CopyFrom(get_width_config(width))
173
+
163
174
  if isinstance(height, int) or border:
164
175
  block_proto.allow_empty = True
165
176
 
166
- if height:
167
- # Activate scrolling container behavior:
168
- height_config = HeightConfig()
169
- height_config.pixel_height = height
170
- # Use block-level height_config instead of flex_container
171
- block_proto.height_config.CopyFrom(height_config)
177
+ if border is not None:
178
+ block_proto.flex_container.border = border
179
+ elif isinstance(height, int):
180
+ block_proto.flex_container.border = True
181
+ else:
182
+ block_proto.flex_container.border = False
172
183
 
173
- if border is None:
174
- # If border is None, we activated the
175
- # border as default setting for scrolling
176
- # containers.
177
- block_proto.flex_container.border = True
184
+ validate_height(height, allow_content=True)
185
+ block_proto.height_config.CopyFrom(get_height_config(height))
178
186
 
179
187
  if key:
180
188
  # At the moment, the ID is only used for extracting the
@@ -196,6 +204,7 @@ class LayoutsMixin:
196
204
  gap: Literal["small", "medium", "large"] | None = "small",
197
205
  vertical_alignment: Literal["top", "center", "bottom"] = "top",
198
206
  border: bool = False,
207
+ width: WidthWithoutContent = "stretch",
199
208
  ) -> list[DeltaGenerator]:
200
209
  """Insert containers laid out as side-by-side columns.
201
210
 
@@ -244,6 +253,14 @@ class LayoutsMixin:
244
253
  ``False`` (default), no border is shown. If this is ``True``, a
245
254
  border is shown around each column.
246
255
 
256
+ width : int or "stretch"
257
+ The desired width of the columns expressed in pixels. If this is
258
+ ``"stretch"`` (default), Streamlit sets the width of the columns to
259
+ match the width of the parent container. Otherwise, this must be an
260
+ integer. If the specified width is greater than the width of the
261
+ parent container, Streamlit sets the width of the columns to match
262
+ the width of the parent container.
263
+
247
264
  Returns
248
265
  -------
249
266
  list of containers
@@ -413,6 +430,10 @@ class LayoutsMixin:
413
430
  block_proto.flex_container.wrap = True
414
431
  block_proto.flex_container.gap_config.CopyFrom(gap_config)
415
432
  block_proto.flex_container.scale = 1
433
+
434
+ validate_width(width=width)
435
+ block_proto.width_config.CopyFrom(get_width_config(width=width))
436
+
416
437
  row = self.dg._block(block_proto)
417
438
  total_weight = sum(weights)
418
439
  return [row._block(column_proto(w / total_weight)) for w in weights]
@@ -703,11 +703,7 @@ class ChatMixin:
703
703
  if key is not None and key in session_state:
704
704
  # Reset the session state value to None to reflect the actual state
705
705
  # of the widget. Which is None since the value hasn't been submitted yet.
706
-
707
- # We need to first delete the value and then set it to `None`
708
- # to not trigger the "state value cannot be modified" error.
709
- del session_state[key]
710
- session_state[key] = None
706
+ session_state.reset_state_value(key, None)
711
707
 
712
708
  if ctx:
713
709
  save_for_app_testing(ctx, element_id, widget_state.value)
@@ -17,7 +17,7 @@ from streamlit.proto import HeightConfig_pb2 as streamlit_dot_proto_dot_HeightCo
17
17
  from streamlit.proto import GapSize_pb2 as streamlit_dot_proto_dot_GapSize__pb2
18
18
 
19
19
 
20
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\x1a!streamlit/proto/WidthConfig.proto\x1a\"streamlit/proto/HeightConfig.proto\x1a\x1dstreamlit/proto/GapSize.proto\"\xe3\r\n\x05\x42lock\x12#\n\x08vertical\x18\x01 \x01(\x0b\x32\x0f.Block.VerticalH\x00\x12\'\n\nhorizontal\x18\x02 \x01(\x0b\x32\x11.Block.HorizontalH\x00\x12\x1f\n\x06\x63olumn\x18\x03 \x01(\x0b\x32\r.Block.ColumnH\x00\x12\'\n\nexpandable\x18\x04 \x01(\x0b\x32\x11.Block.ExpandableH\x00\x12\x1b\n\x04\x66orm\x18\x05 \x01(\x0b\x32\x0b.Block.FormH\x00\x12,\n\rtab_container\x18\x06 \x01(\x0b\x32\x13.Block.TabContainerH\x00\x12\x19\n\x03tab\x18\x07 \x01(\x0b\x32\n.Block.TabH\x00\x12*\n\x0c\x63hat_message\x18\t \x01(\x0b\x32\x12.Block.ChatMessageH\x00\x12!\n\x07popover\x18\n \x01(\x0b\x32\x0e.Block.PopoverH\x00\x12\x1f\n\x06\x64ialog\x18\x0b \x01(\x0b\x32\r.Block.DialogH\x00\x12.\n\x0e\x66lex_container\x18\r \x01(\x0b\x32\x14.Block.FlexContainerH\x00\x12\x13\n\x0b\x61llow_empty\x18\x08 \x01(\x08\x12\x0f\n\x02id\x18\x0c \x01(\tH\x01\x88\x01\x01\x12\x33\n\rheight_config\x18\x0e \x01(\x0b\x32\x17.streamlit.HeightConfigH\x02\x88\x01\x01\x12\x31\n\x0cwidth_config\x18\x0f \x01(\x0b\x32\x16.streamlit.WidthConfigH\x03\x88\x01\x01\x1a*\n\x08Vertical\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12\x0e\n\x06height\x18\x02 \x01(\r\x1a\x19\n\nHorizontal\x12\x0b\n\x03gap\x18\x01 \x01(\t\x1a\xdd\x01\n\rFlexContainer\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12(\n\ngap_config\x18\x02 \x01(\x0b\x32\x14.streamlit.GapConfig\x12\r\n\x05scale\x18\x03 \x01(\x02\x12\x31\n\tdirection\x18\x04 \x01(\x0e\x32\x1e.Block.FlexContainer.Direction\x12\x0c\n\x04wrap\x18\x05 \x01(\x08\"B\n\tDirection\x12\x17\n\x13\x44IRECTION_UNDEFINED\x10\x00\x12\x0c\n\x08VERTICAL\x10\x01\x12\x0e\n\nHORIZONTAL\x10\x02\x1a\xef\x01\n\x06\x43olumn\x12\x0e\n\x06weight\x18\x01 \x01(\x01\x12\x0f\n\x03gap\x18\x02 \x01(\tB\x02\x18\x01\x12;\n\x12vertical_alignment\x18\x03 \x01(\x0e\x32\x1f.Block.Column.VerticalAlignment\x12\x13\n\x0bshow_border\x18\x04 \x01(\x08\x12-\n\ngap_config\x18\x05 \x01(\x0b\x32\x14.streamlit.GapConfigH\x00\x88\x01\x01\"4\n\x11VerticalAlignment\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x43\x45NTER\x10\x01\x12\n\n\x06\x42OTTOM\x10\x02\x42\r\n\x0b_gap_config\x1aM\n\nExpandable\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\x08\x65xpanded\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04icon\x18\x03 \x01(\tB\x0b\n\t_expanded\x1a\x9d\x01\n\x06\x44ialog\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64ismissible\x18\x02 \x01(\x08\x12(\n\x05width\x18\x03 \x01(\x0e\x32\x19.Block.Dialog.DialogWidth\x12\x14\n\x07is_open\x18\x04 \x01(\x08H\x00\x88\x01\x01\"#\n\x0b\x44ialogWidth\x12\t\n\x05SMALL\x10\x00\x12\t\n\x05LARGE\x10\x01\x42\n\n\x08_is_open\x1aY\n\x04\x46orm\x12\x0f\n\x07\x66orm_id\x18\x01 \x01(\t\x12\x17\n\x0f\x63lear_on_submit\x18\x02 \x01(\x08\x12\x0e\n\x06\x62order\x18\x03 \x01(\x08\x12\x17\n\x0f\x65nter_to_submit\x18\x04 \x01(\x08\x1a\x0e\n\x0cTabContainer\x1a\x14\n\x03Tab\x12\r\n\x05label\x18\x01 \x01(\t\x1a\x63\n\x07Popover\x12\r\n\x05label\x18\x01 \x01(\t\x12\x1b\n\x13use_container_width\x18\x02 \x01(\x08\x12\x0c\n\x04help\x18\x03 \x01(\t\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x12\x0c\n\x04icon\x18\x05 \x01(\t\x1a\x8d\x01\n\x0b\x43hatMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x02 \x01(\t\x12\x32\n\x0b\x61vatar_type\x18\x03 \x01(\x0e\x32\x1d.Block.ChatMessage.AvatarType\",\n\nAvatarType\x12\t\n\x05IMAGE\x10\x00\x12\t\n\x05\x45MOJI\x10\x01\x12\x08\n\x04ICON\x10\x02\x42\x06\n\x04typeB\x05\n\x03_idB\x10\n\x0e_height_configB\x0f\n\r_width_configB*\n\x1c\x63om.snowflake.apps.streamlitB\nBlockProtob\x06proto3')
20
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\x1a!streamlit/proto/WidthConfig.proto\x1a\"streamlit/proto/HeightConfig.proto\x1a\x1dstreamlit/proto/GapSize.proto\"\xe7\r\n\x05\x42lock\x12#\n\x08vertical\x18\x01 \x01(\x0b\x32\x0f.Block.VerticalH\x00\x12\'\n\nhorizontal\x18\x02 \x01(\x0b\x32\x11.Block.HorizontalH\x00\x12\x1f\n\x06\x63olumn\x18\x03 \x01(\x0b\x32\r.Block.ColumnH\x00\x12\'\n\nexpandable\x18\x04 \x01(\x0b\x32\x11.Block.ExpandableH\x00\x12\x1b\n\x04\x66orm\x18\x05 \x01(\x0b\x32\x0b.Block.FormH\x00\x12,\n\rtab_container\x18\x06 \x01(\x0b\x32\x13.Block.TabContainerH\x00\x12\x19\n\x03tab\x18\x07 \x01(\x0b\x32\n.Block.TabH\x00\x12*\n\x0c\x63hat_message\x18\t \x01(\x0b\x32\x12.Block.ChatMessageH\x00\x12!\n\x07popover\x18\n \x01(\x0b\x32\x0e.Block.PopoverH\x00\x12\x1f\n\x06\x64ialog\x18\x0b \x01(\x0b\x32\r.Block.DialogH\x00\x12.\n\x0e\x66lex_container\x18\r \x01(\x0b\x32\x14.Block.FlexContainerH\x00\x12\x13\n\x0b\x61llow_empty\x18\x08 \x01(\x08\x12\x0f\n\x02id\x18\x0c \x01(\tH\x01\x88\x01\x01\x12\x33\n\rheight_config\x18\x0e \x01(\x0b\x32\x17.streamlit.HeightConfigH\x02\x88\x01\x01\x12\x31\n\x0cwidth_config\x18\x0f \x01(\x0b\x32\x16.streamlit.WidthConfigH\x03\x88\x01\x01\x1a.\n\x08Vertical\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12\x12\n\x06height\x18\x02 \x01(\rB\x02\x18\x01\x1a\x19\n\nHorizontal\x12\x0b\n\x03gap\x18\x01 \x01(\t\x1a\xdd\x01\n\rFlexContainer\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12(\n\ngap_config\x18\x02 \x01(\x0b\x32\x14.streamlit.GapConfig\x12\r\n\x05scale\x18\x03 \x01(\x02\x12\x31\n\tdirection\x18\x04 \x01(\x0e\x32\x1e.Block.FlexContainer.Direction\x12\x0c\n\x04wrap\x18\x05 \x01(\x08\"B\n\tDirection\x12\x17\n\x13\x44IRECTION_UNDEFINED\x10\x00\x12\x0c\n\x08VERTICAL\x10\x01\x12\x0e\n\nHORIZONTAL\x10\x02\x1a\xef\x01\n\x06\x43olumn\x12\x0e\n\x06weight\x18\x01 \x01(\x01\x12\x0f\n\x03gap\x18\x02 \x01(\tB\x02\x18\x01\x12;\n\x12vertical_alignment\x18\x03 \x01(\x0e\x32\x1f.Block.Column.VerticalAlignment\x12\x13\n\x0bshow_border\x18\x04 \x01(\x08\x12-\n\ngap_config\x18\x05 \x01(\x0b\x32\x14.streamlit.GapConfigH\x00\x88\x01\x01\"4\n\x11VerticalAlignment\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x43\x45NTER\x10\x01\x12\n\n\x06\x42OTTOM\x10\x02\x42\r\n\x0b_gap_config\x1aM\n\nExpandable\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\x08\x65xpanded\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04icon\x18\x03 \x01(\tB\x0b\n\t_expanded\x1a\x9d\x01\n\x06\x44ialog\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64ismissible\x18\x02 \x01(\x08\x12(\n\x05width\x18\x03 \x01(\x0e\x32\x19.Block.Dialog.DialogWidth\x12\x14\n\x07is_open\x18\x04 \x01(\x08H\x00\x88\x01\x01\"#\n\x0b\x44ialogWidth\x12\t\n\x05SMALL\x10\x00\x12\t\n\x05LARGE\x10\x01\x42\n\n\x08_is_open\x1aY\n\x04\x46orm\x12\x0f\n\x07\x66orm_id\x18\x01 \x01(\t\x12\x17\n\x0f\x63lear_on_submit\x18\x02 \x01(\x08\x12\x0e\n\x06\x62order\x18\x03 \x01(\x08\x12\x17\n\x0f\x65nter_to_submit\x18\x04 \x01(\x08\x1a\x0e\n\x0cTabContainer\x1a\x14\n\x03Tab\x12\r\n\x05label\x18\x01 \x01(\t\x1a\x63\n\x07Popover\x12\r\n\x05label\x18\x01 \x01(\t\x12\x1b\n\x13use_container_width\x18\x02 \x01(\x08\x12\x0c\n\x04help\x18\x03 \x01(\t\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x12\x0c\n\x04icon\x18\x05 \x01(\t\x1a\x8d\x01\n\x0b\x43hatMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x02 \x01(\t\x12\x32\n\x0b\x61vatar_type\x18\x03 \x01(\x0e\x32\x1d.Block.ChatMessage.AvatarType\",\n\nAvatarType\x12\t\n\x05IMAGE\x10\x00\x12\t\n\x05\x45MOJI\x10\x01\x12\x08\n\x04ICON\x10\x02\x42\x06\n\x04typeB\x05\n\x03_idB\x10\n\x0e_height_configB\x0f\n\r_width_configB*\n\x1c\x63om.snowflake.apps.streamlitB\nBlockProtob\x06proto3')
21
21
 
22
22
  _globals = globals()
23
23
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -25,38 +25,40 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Block_pb2',
25
25
  if not _descriptor._USE_C_DESCRIPTORS:
26
26
  _globals['DESCRIPTOR']._loaded_options = None
27
27
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\nBlockProto'
28
+ _globals['_BLOCK_VERTICAL'].fields_by_name['height']._loaded_options = None
29
+ _globals['_BLOCK_VERTICAL'].fields_by_name['height']._serialized_options = b'\030\001'
28
30
  _globals['_BLOCK_COLUMN'].fields_by_name['gap']._loaded_options = None
29
31
  _globals['_BLOCK_COLUMN'].fields_by_name['gap']._serialized_options = b'\030\001'
30
32
  _globals['_BLOCK']._serialized_start=134
31
- _globals['_BLOCK']._serialized_end=1897
33
+ _globals['_BLOCK']._serialized_end=1901
32
34
  _globals['_BLOCK_VERTICAL']._serialized_start=699
33
- _globals['_BLOCK_VERTICAL']._serialized_end=741
34
- _globals['_BLOCK_HORIZONTAL']._serialized_start=743
35
- _globals['_BLOCK_HORIZONTAL']._serialized_end=768
36
- _globals['_BLOCK_FLEXCONTAINER']._serialized_start=771
37
- _globals['_BLOCK_FLEXCONTAINER']._serialized_end=992
38
- _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_start=926
39
- _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_end=992
40
- _globals['_BLOCK_COLUMN']._serialized_start=995
41
- _globals['_BLOCK_COLUMN']._serialized_end=1234
42
- _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_start=1167
43
- _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_end=1219
44
- _globals['_BLOCK_EXPANDABLE']._serialized_start=1236
45
- _globals['_BLOCK_EXPANDABLE']._serialized_end=1313
46
- _globals['_BLOCK_DIALOG']._serialized_start=1316
47
- _globals['_BLOCK_DIALOG']._serialized_end=1473
48
- _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_start=1426
49
- _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_end=1461
50
- _globals['_BLOCK_FORM']._serialized_start=1475
51
- _globals['_BLOCK_FORM']._serialized_end=1564
52
- _globals['_BLOCK_TABCONTAINER']._serialized_start=1566
53
- _globals['_BLOCK_TABCONTAINER']._serialized_end=1580
54
- _globals['_BLOCK_TAB']._serialized_start=1582
55
- _globals['_BLOCK_TAB']._serialized_end=1602
56
- _globals['_BLOCK_POPOVER']._serialized_start=1604
57
- _globals['_BLOCK_POPOVER']._serialized_end=1703
58
- _globals['_BLOCK_CHATMESSAGE']._serialized_start=1706
59
- _globals['_BLOCK_CHATMESSAGE']._serialized_end=1847
60
- _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_start=1803
61
- _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_end=1847
35
+ _globals['_BLOCK_VERTICAL']._serialized_end=745
36
+ _globals['_BLOCK_HORIZONTAL']._serialized_start=747
37
+ _globals['_BLOCK_HORIZONTAL']._serialized_end=772
38
+ _globals['_BLOCK_FLEXCONTAINER']._serialized_start=775
39
+ _globals['_BLOCK_FLEXCONTAINER']._serialized_end=996
40
+ _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_start=930
41
+ _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_end=996
42
+ _globals['_BLOCK_COLUMN']._serialized_start=999
43
+ _globals['_BLOCK_COLUMN']._serialized_end=1238
44
+ _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_start=1171
45
+ _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_end=1223
46
+ _globals['_BLOCK_EXPANDABLE']._serialized_start=1240
47
+ _globals['_BLOCK_EXPANDABLE']._serialized_end=1317
48
+ _globals['_BLOCK_DIALOG']._serialized_start=1320
49
+ _globals['_BLOCK_DIALOG']._serialized_end=1477
50
+ _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_start=1430
51
+ _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_end=1465
52
+ _globals['_BLOCK_FORM']._serialized_start=1479
53
+ _globals['_BLOCK_FORM']._serialized_end=1568
54
+ _globals['_BLOCK_TABCONTAINER']._serialized_start=1570
55
+ _globals['_BLOCK_TABCONTAINER']._serialized_end=1584
56
+ _globals['_BLOCK_TAB']._serialized_start=1586
57
+ _globals['_BLOCK_TAB']._serialized_end=1606
58
+ _globals['_BLOCK_POPOVER']._serialized_start=1608
59
+ _globals['_BLOCK_POPOVER']._serialized_end=1707
60
+ _globals['_BLOCK_CHATMESSAGE']._serialized_start=1710
61
+ _globals['_BLOCK_CHATMESSAGE']._serialized_end=1851
62
+ _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_start=1807
63
+ _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_end=1851
62
64
  # @@protoc_insertion_point(module_scope)
@@ -46,7 +46,9 @@ class Block(google.protobuf.message.Message):
46
46
  HEIGHT_FIELD_NUMBER: builtins.int
47
47
  border: builtins.bool
48
48
  height: builtins.int
49
- """Height of the container, activates scrolling"""
49
+ """DEPRECATED: We use height_config on the top-level which is shared
50
+ with other Block types.
51
+ """
50
52
  def __init__(
51
53
  self,
52
54
  *,
@@ -84,6 +84,14 @@ class SafeSessionState:
84
84
  with self._lock:
85
85
  return self._state.is_new_state_value(user_key)
86
86
 
87
+ def reset_state_value(self, user_key: str, value: Any | None) -> None:
88
+ """Reset a new session state value to a given value
89
+ without triggering the "state value cannot be modified" error.
90
+ """
91
+ self._yield_callback()
92
+ with self._lock:
93
+ self._state.reset_state_value(user_key, value)
94
+
87
95
  @property
88
96
  def filtered_state(self) -> dict[str, Any]:
89
97
  """The combined session and widget state, excluding keyless widgets."""
@@ -442,6 +442,12 @@ class SessionState:
442
442
  """True if a value with the given key is in the current session state."""
443
443
  return user_key in self._new_session_state
444
444
 
445
+ def reset_state_value(self, user_key: str, value: Any | None) -> None:
446
+ """Reset a new session state value to a given value
447
+ without triggering the "state value cannot be modified" error.
448
+ """
449
+ self._new_session_state[user_key] = value
450
+
445
451
  def __iter__(self) -> Iterator[Any]:
446
452
  """Return an iterator over the keys of the SessionState.
447
453
  This is a shortcut for `iter(self.keys())`.
@@ -37,7 +37,7 @@
37
37
  <script>
38
38
  window.prerenderReady = false
39
39
  </script>
40
- <script type="module" crossorigin src="./static/js/index.D_0R5OBc.js"></script>
40
+ <script type="module" crossorigin src="./static/js/index.EAQB8Tuq.js"></script>
41
41
  <link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
42
42
  </head>
43
43
  <body>