streamlit-nightly 1.41.2.dev20250108__py2.py3-none-any.whl → 1.41.2.dev20250110__py2.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/config.py +3 -2
- streamlit/config_option.py +9 -18
- streamlit/dataframe_util.py +2 -2
- streamlit/delta_generator.py +6 -2
- streamlit/elements/exception.py +7 -9
- streamlit/elements/widgets/button_group.py +5 -3
- streamlit/elements/widgets/data_editor.py +4 -1
- streamlit/emojis.py +1 -1
- streamlit/proto/ForwardMsg_pb2.py +3 -1
- streamlit/proto/ForwardMsg_pb2.pyi +23 -0
- streamlit/runtime/app_session.py +23 -3
- streamlit/runtime/caching/cache_data_api.py +2 -2
- streamlit/runtime/caching/cache_utils.py +4 -3
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +4 -4
- streamlit/runtime/credentials.py +4 -4
- streamlit/runtime/forward_msg_cache.py +3 -1
- streamlit/runtime/forward_msg_queue.py +32 -4
- streamlit/runtime/fragment.py +1 -1
- streamlit/runtime/pages_manager.py +3 -1
- streamlit/runtime/scriptrunner/exec_code.py +33 -0
- streamlit/runtime/scriptrunner/script_runner.py +5 -3
- streamlit/runtime/scriptrunner_utils/script_requests.py +1 -0
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.CXWFIN7B.js → FileDownload.esm.DgMBFvxE.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.dauERNYc.js → FormClearHelper.C-kz8EZa.js} +1 -1
- streamlit/static/static/js/{Hooks.CqBCxxzg.js → Hooks.BaEjlpBt.js} +1 -1
- streamlit/static/static/js/{InputInstructions.Dm8zppD9.js → InputInstructions.2kJ3lLP5.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CQTs8xxT.js → ProgressBar.BmX5Bd8z.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.BIVWPcSk.js → RenderInPortalIfExists.DvbHx6rz.js} +1 -1
- streamlit/static/static/js/{Toolbar.D_9Mp69H.js → Toolbar.Cs7p2Lp9.js} +1 -1
- streamlit/static/static/js/{base-input.JrivAGt5.js → base-input.CmWUWSJc.js} +4 -4
- streamlit/static/static/js/{createSuper.BLkfEjg8.js → createSuper.D46anxnG.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.4d_NBoKr.js → data-grid-overlay-editor.BspRPTtu.js} +1 -1
- streamlit/static/static/js/{downloader.i394ggfM.js → downloader.BX0QN5eD.js} +1 -1
- streamlit/static/static/js/{es6.BPf5kpFH.js → es6.BlW--gnF.js} +2 -2
- streamlit/static/static/js/{getPrototypeOf.DcAVjrh9.js → getPrototypeOf.BYTPPQIp.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.YDN8GVx9.js → iframeResizer.contentWindow.CNHQyyTg.js} +1 -1
- streamlit/static/static/js/{index.DxsOgtLc.js → index.-JIbeXZC.js} +11 -11
- streamlit/static/static/js/{index.Bj7LBigw.js → index.2kexLuIU.js} +62 -62
- streamlit/static/static/js/{index.D1qR2sOA.js → index.5f81IBZP.js} +1 -1
- streamlit/static/static/js/{index.HktO7F0v.js → index.7441r-sL.js} +1 -1
- streamlit/static/static/js/index.AzFWl1A_.js +3 -0
- streamlit/static/static/js/{index.Df7nX4KF.js → index.B1RTO67W.js} +1 -1
- streamlit/static/static/js/{index.CSmBE6cg.js → index.B2lUWG_g.js} +1 -1
- streamlit/static/static/js/{index.g_BxiUns.js → index.B3F-o9ex.js} +1 -1
- streamlit/static/static/js/{index.DgOwxLz5.js → index.BBK0SZBc.js} +3 -3
- streamlit/static/static/js/{index.DsKBnIk-.js → index.BBQgDj4i.js} +16 -16
- streamlit/static/static/js/{index.SKaK1lYU.js → index.BHVs7_wn.js} +1 -1
- streamlit/static/static/js/{index.kc3Ycvjj.js → index.BRwmGBP4.js} +10 -10
- streamlit/static/static/js/{index.Dz6VQ3qN.js → index.BSabhp-S.js} +2 -2
- streamlit/static/static/js/{index.YfuWGKrN.js → index.BX4DPcrq.js} +1 -1
- streamlit/static/static/js/{index.DyNkf5tM.js → index.BhQrqdv2.js} +1 -1
- streamlit/static/static/js/index.BhRQ3Irc.js +1 -0
- streamlit/static/static/js/index.BqCCfwZM.js +1 -0
- streamlit/static/static/js/{index.BidgRpd5.js → index.BtaWfSZN.js} +1 -1
- streamlit/static/static/js/{index.D7EG5vd0.js → index.BwvnBWfd.js} +2 -2
- streamlit/static/static/js/{index.PriAkdhw.js → index.CAmkSLgk.js} +1 -1
- streamlit/static/static/js/{index.BB2p9KgS.js → index.CKhEFCMB.js} +1 -1
- streamlit/static/static/js/index.CdjxQOw-.js +1 -0
- streamlit/static/static/js/index.ClU6Toj3.js +1 -0
- streamlit/static/static/js/{index.C-TBipT2.js → index.D4cEoG-b.js} +3 -3
- streamlit/static/static/js/{index.D_bHPQ8s.js → index.D7zDVCSD.js} +1 -1
- streamlit/static/static/js/{index.DWU1GWqY.js → index.D8V0ZERG.js} +1 -1
- streamlit/static/static/js/{index.CgkfCbvP.js → index.DAlH7XAu.js} +1 -1
- streamlit/static/static/js/index.DGXjFinj.js +1 -0
- streamlit/static/static/js/{index.B3dyGG7q.js → index.DKFY5Ha1.js} +3 -3
- streamlit/static/static/js/{index.D1CJOG3s.js → index.DRm6hoq7.js} +1 -1
- streamlit/static/static/js/index.DhCGDinQ.js +2 -0
- streamlit/static/static/js/index.Drqk1Tqs.js +1 -0
- streamlit/static/static/js/{index.CMAjN-j5.js → index.DuEIfrbC.js} +1 -1
- streamlit/static/static/js/{index.B6GM885g.js → index.a4u3c2yA.js} +1 -1
- streamlit/static/static/js/{index.DE-FOSSU.js → index.d1dU1FHw.js} +1 -1
- streamlit/static/static/js/{index.B_o9A-oO.js → index.tQ3BfkaX.js} +1 -1
- streamlit/static/static/js/{index.DmHQeMtj.js → index.y-VLJ65m.js} +1 -1
- streamlit/static/static/js/{input.CqdNsSbL.js → input.C7wSNGte.js} +2 -2
- streamlit/static/static/js/{memory.Bkvk-eRa.js → memory.BF0Xc-rJ.js} +1 -1
- streamlit/static/static/js/{mergeWith.DtsbyD6H.js → mergeWith.CHIovAKI.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CR4D4kK1.js → number-overlay-editor.DfAWep9y.js} +1 -1
- streamlit/static/static/js/{sandbox.C5M8yw5Z.js → sandbox.CM0H2h0v.js} +1 -1
- streamlit/static/static/js/{slicedToArray.BL5-s74J.js → slicedToArray.BOBOh4VJ.js} +1 -1
- streamlit/static/static/js/{textarea.DrGlWUDC.js → textarea.CINkGDSQ.js} +2 -2
- streamlit/static/static/js/{timepicker.Bdf2lGHx.js → timepicker.eZuQgQCF.js} +1 -1
- streamlit/static/static/js/{uniqueId.LGvQ35eR.js → uniqueId.vdNgUDff.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.TTzKcGCs.js → useBasicWidgetState.De0NYf9Y.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.ChvkrwHU.js → useOnInputChange.cRNtiNHf.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.ChQqb1TZ.js → withFullScreenWrapper.D4HXFzaF.js} +1 -1
- streamlit/watcher/local_sources_watcher.py +4 -2
- streamlit/web/server/browser_websocket_handler.py +1 -1
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/RECORD +94 -96
- streamlit/static/static/js/index.57g5CAPC.js +0 -1
- streamlit/static/static/js/index.BOBIcAmK.js +0 -1
- streamlit/static/static/js/index.BfABFd7-.js +0 -3
- streamlit/static/static/js/index.C4muCvfN.js +0 -1
- streamlit/static/static/js/index.CAZAG6f3.js +0 -2
- streamlit/static/static/js/index.CJlBME-_.js +0 -1
- streamlit/static/static/js/index.DalTq5GL.js +0 -1
- streamlit/static/static/js/index.V5OLP0n7.js +0 -1
- streamlit/vendor/ipython/__init__.py +0 -0
- streamlit/vendor/ipython/modified_sys_path.py +0 -67
- {streamlit_nightly-1.41.2.dev20250108.data → streamlit_nightly-1.41.2.dev20250110.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/top_level.txt +0 -0
@@ -30,7 +30,7 @@ from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_Session
|
|
30
30
|
from streamlit.proto import AuthRedirect_pb2 as streamlit_dot_proto_dot_AuthRedirect__pb2
|
31
31
|
|
32
32
|
|
33
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/ForwardMsg.proto\x1a\x1fstreamlit/proto/AutoRerun.proto\x1a\x1cstreamlit/proto/Common.proto\x1a\x1bstreamlit/proto/Delta.proto\x1a\x1dstreamlit/proto/GitInfo.proto\x1a\x1astreamlit/proto/Logo.proto\x1a streamlit/proto/Navigation.proto\x1a streamlit/proto/NewSession.proto\x1a streamlit/proto/PageConfig.proto\x1a\x1estreamlit/proto/PageInfo.proto\x1a!streamlit/proto/PageProfile.proto\x1a\"streamlit/proto/PageNotFound.proto\x1a\"streamlit/proto/PagesChanged.proto\x1a#streamlit/proto/ParentMessage.proto\x1a\"streamlit/proto/SessionEvent.proto\x1a#streamlit/proto/SessionStatus.proto\x1a\"streamlit/proto/AuthRedirect.proto\"\xc7\x07\n\nForwardMsg\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12%\n\x08metadata\x18\x02 \x01(\x0b\x32\x13.ForwardMsgMetadata\x12\"\n\x0bnew_session\x18\x04 \x01(\x0b\x32\x0b.NewSessionH\x00\x12\x17\n\x05\x64\x65lta\x18\x05 \x01(\x0b\x32\x06.DeltaH\x00\x12&\n\x11page_info_changed\x18\x0c \x01(\x0b\x32\t.PageInfoH\x00\x12*\n\x13page_config_changed\x18\r \x01(\x0b\x32\x0b.PageConfigH\x00\x12;\n\x0fscript_finished\x18\x06 \x01(\x0e\x32 .ForwardMsg.ScriptFinishedStatusH\x00\x12$\n\x10git_info_changed\x18\x0e \x01(\x0b\x32\x08.GitInfoH\x00\x12$\n\x0cpage_profile\x18\x12 \x01(\x0b\x32\x0c.PageProfileH\x00\x12\x30\n\x16session_status_changed\x18\t \x01(\x0b\x32\x0e.SessionStatusH\x00\x12&\n\rsession_event\x18\n \x01(\x0b\x32\r.SessionEventH\x00\x12!\n\nnavigation\x18\x17 \x01(\x0b\x32\x0b.NavigationH\x00\x12\'\n\x0epage_not_found\x18\x0f \x01(\x0b\x32\r.PageNotFoundH\x00\x12&\n\rpages_changed\x18\x10 \x01(\x0b\x32\r.PagesChangedH\x00\x12/\n\x12\x66ile_urls_response\x18\x13 \x01(\x0b\x32\x11.FileURLsResponseH\x00\x12 \n\nauto_rerun\x18\x15 \x01(\x0b\x32\n.AutoRerunH\x00\x12\x15\n\x04logo\x18\x16 \x01(\x0b\x32\x05.LogoH\x00\x12&\n\rauth_redirect\x18\x18 \x01(\x0b\x32\r.AuthRedirectH\x00\x12(\n\x0eparent_message\x18\x14 \x01(\x0b\x32\x0e.ParentMessageH\x00\x12\x12\n\x08ref_hash\x18\x0b \x01(\tH\x00\x12\x1d\n\x15\x64\x65\x62ug_last_backmsg_id\x18\x11 \x01(\t\"\x98\x01\n\x14ScriptFinishedStatus\x12\x19\n\x15\x46INISHED_SUCCESSFULLY\x10\x00\x12\x1f\n\x1b\x46INISHED_WITH_COMPILE_ERROR\x10\x01\x12\x1c\n\x18\x46INISHED_EARLY_FOR_RERUN\x10\x02\x12&\n\"FINISHED_FRAGMENT_RUN_SUCCESSFULLY\x10\x03\x42\x06\n\x04typeJ\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"\x8e\x01\n\x12\x46orwardMsgMetadata\x12\x11\n\tcacheable\x18\x01 \x01(\x08\x12\x12\n\ndelta_path\x18\x02 \x03(\r\x12\x35\n\x16\x65lement_dimension_spec\x18\x03 \x01(\x0b\x32\x15.ElementDimensionSpec\x12\x1a\n\x12\x61\x63tive_script_hash\x18\x04 \x01(\t\"5\n\x14\x45lementDimensionSpec\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\
|
33
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/ForwardMsg.proto\x1a\x1fstreamlit/proto/AutoRerun.proto\x1a\x1cstreamlit/proto/Common.proto\x1a\x1bstreamlit/proto/Delta.proto\x1a\x1dstreamlit/proto/GitInfo.proto\x1a\x1astreamlit/proto/Logo.proto\x1a streamlit/proto/Navigation.proto\x1a streamlit/proto/NewSession.proto\x1a streamlit/proto/PageConfig.proto\x1a\x1estreamlit/proto/PageInfo.proto\x1a!streamlit/proto/PageProfile.proto\x1a\"streamlit/proto/PageNotFound.proto\x1a\"streamlit/proto/PagesChanged.proto\x1a#streamlit/proto/ParentMessage.proto\x1a\"streamlit/proto/SessionEvent.proto\x1a#streamlit/proto/SessionStatus.proto\x1a\"streamlit/proto/AuthRedirect.proto\"\xc7\x07\n\nForwardMsg\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12%\n\x08metadata\x18\x02 \x01(\x0b\x32\x13.ForwardMsgMetadata\x12\"\n\x0bnew_session\x18\x04 \x01(\x0b\x32\x0b.NewSessionH\x00\x12\x17\n\x05\x64\x65lta\x18\x05 \x01(\x0b\x32\x06.DeltaH\x00\x12&\n\x11page_info_changed\x18\x0c \x01(\x0b\x32\t.PageInfoH\x00\x12*\n\x13page_config_changed\x18\r \x01(\x0b\x32\x0b.PageConfigH\x00\x12;\n\x0fscript_finished\x18\x06 \x01(\x0e\x32 .ForwardMsg.ScriptFinishedStatusH\x00\x12$\n\x10git_info_changed\x18\x0e \x01(\x0b\x32\x08.GitInfoH\x00\x12$\n\x0cpage_profile\x18\x12 \x01(\x0b\x32\x0c.PageProfileH\x00\x12\x30\n\x16session_status_changed\x18\t \x01(\x0b\x32\x0e.SessionStatusH\x00\x12&\n\rsession_event\x18\n \x01(\x0b\x32\r.SessionEventH\x00\x12!\n\nnavigation\x18\x17 \x01(\x0b\x32\x0b.NavigationH\x00\x12\'\n\x0epage_not_found\x18\x0f \x01(\x0b\x32\r.PageNotFoundH\x00\x12&\n\rpages_changed\x18\x10 \x01(\x0b\x32\r.PagesChangedH\x00\x12/\n\x12\x66ile_urls_response\x18\x13 \x01(\x0b\x32\x11.FileURLsResponseH\x00\x12 \n\nauto_rerun\x18\x15 \x01(\x0b\x32\n.AutoRerunH\x00\x12\x15\n\x04logo\x18\x16 \x01(\x0b\x32\x05.LogoH\x00\x12&\n\rauth_redirect\x18\x18 \x01(\x0b\x32\r.AuthRedirectH\x00\x12(\n\x0eparent_message\x18\x14 \x01(\x0b\x32\x0e.ParentMessageH\x00\x12\x12\n\x08ref_hash\x18\x0b \x01(\tH\x00\x12\x1d\n\x15\x64\x65\x62ug_last_backmsg_id\x18\x11 \x01(\t\"\x98\x01\n\x14ScriptFinishedStatus\x12\x19\n\x15\x46INISHED_SUCCESSFULLY\x10\x00\x12\x1f\n\x1b\x46INISHED_WITH_COMPILE_ERROR\x10\x01\x12\x1c\n\x18\x46INISHED_EARLY_FOR_RERUN\x10\x02\x12&\n\"FINISHED_FRAGMENT_RUN_SUCCESSFULLY\x10\x03\x42\x06\n\x04typeJ\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"\x8e\x01\n\x12\x46orwardMsgMetadata\x12\x11\n\tcacheable\x18\x01 \x01(\x08\x12\x12\n\ndelta_path\x18\x02 \x03(\r\x12\x35\n\x16\x65lement_dimension_spec\x18\x03 \x01(\x0b\x32\x15.ElementDimensionSpec\x12\x1a\n\x12\x61\x63tive_script_hash\x18\x04 \x01(\t\"5\n\x14\x45lementDimensionSpec\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\"/\n\x0e\x46orwardMsgList\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ForwardMsgB/\n\x1c\x63om.snowflake.apps.streamlitB\x0f\x46orwardMsgProtob\x06proto3')
|
34
34
|
|
35
35
|
_globals = globals()
|
36
36
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -46,4 +46,6 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
46
46
|
_globals['_FORWARDMSGMETADATA']._serialized_end=1687
|
47
47
|
_globals['_ELEMENTDIMENSIONSPEC']._serialized_start=1689
|
48
48
|
_globals['_ELEMENTDIMENSIONSPEC']._serialized_end=1742
|
49
|
+
_globals['_FORWARDMSGLIST']._serialized_start=1744
|
50
|
+
_globals['_FORWARDMSGLIST']._serialized_end=1791
|
49
51
|
# @@protoc_insertion_point(module_scope)
|
@@ -268,3 +268,26 @@ class ElementDimensionSpec(google.protobuf.message.Message):
|
|
268
268
|
def ClearField(self, field_name: typing.Literal["height", b"height", "width", b"width"]) -> None: ...
|
269
269
|
|
270
270
|
global___ElementDimensionSpec = ElementDimensionSpec
|
271
|
+
|
272
|
+
@typing.final
|
273
|
+
class ForwardMsgList(google.protobuf.message.Message):
|
274
|
+
"""This is a list of ForwardMessages used to have a single protobuf message
|
275
|
+
that encapsulates multiple ForwardMessages. This is used in static streamlit app
|
276
|
+
generation in replaying all of the protobuf messages of a streamlit app. The
|
277
|
+
ForwardMsgList allows us to leverage the built-ins of protobuf in delimiting the ForwardMsgs
|
278
|
+
instead of needing to do that ourselves.
|
279
|
+
"""
|
280
|
+
|
281
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
282
|
+
|
283
|
+
MESSAGES_FIELD_NUMBER: builtins.int
|
284
|
+
@property
|
285
|
+
def messages(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ForwardMsg]: ...
|
286
|
+
def __init__(
|
287
|
+
self,
|
288
|
+
*,
|
289
|
+
messages: collections.abc.Iterable[global___ForwardMsg] | None = ...,
|
290
|
+
) -> None: ...
|
291
|
+
def ClearField(self, field_name: typing.Literal["messages", b"messages"]) -> None: ...
|
292
|
+
|
293
|
+
global___ForwardMsgList = ForwardMsgList
|
streamlit/runtime/app_session.py
CHANGED
@@ -283,7 +283,6 @@ class AppSession:
|
|
283
283
|
"""Process a BackMsg."""
|
284
284
|
try:
|
285
285
|
msg_type = msg.WhichOneof("type")
|
286
|
-
|
287
286
|
if msg_type == "rerun_script":
|
288
287
|
if msg.debug_last_backmsg_id:
|
289
288
|
self._debug_last_backmsg_id = msg.debug_last_backmsg_id
|
@@ -305,7 +304,7 @@ class AppSession:
|
|
305
304
|
_LOGGER.warning('No handler for "%s"', msg_type)
|
306
305
|
|
307
306
|
except Exception as ex:
|
308
|
-
_LOGGER.
|
307
|
+
_LOGGER.exception("Error processing back message")
|
309
308
|
self.handle_backmsg_exception(ex)
|
310
309
|
|
311
310
|
def handle_backmsg_exception(self, e: BaseException) -> None:
|
@@ -357,6 +356,28 @@ class AppSession:
|
|
357
356
|
if client_state:
|
358
357
|
fragment_id = client_state.fragment_id
|
359
358
|
|
359
|
+
# Early check whether this fragment still exists in the fragment storage or
|
360
|
+
# might have been removed by a full app run. This is not merely a
|
361
|
+
# performance optimization, but also fixes following potential situation:
|
362
|
+
# A fragment run might create a new ScriptRunner when the current
|
363
|
+
# ScriptRunner is in state STOPPED (in this case, the 'success' variable
|
364
|
+
# below is false and the new ScriptRunner is created). This will lead to all
|
365
|
+
# events that were not sent / received from the previous script runner to be
|
366
|
+
# ignored in _handle_scriptrunner_event_on_event_loop, because the
|
367
|
+
# _script_runner changed. When the full app rerun ScriptRunner is done
|
368
|
+
# (STOPPED) but its events are not processed before the new ScriptRunner is
|
369
|
+
# created, its finished message is not sent to the frontend and no
|
370
|
+
# full-app-run cleanup is happening. This scenario can be triggered by the
|
371
|
+
# example app described in
|
372
|
+
# https://github.com/streamlit/streamlit/issues/9921, where the dialog
|
373
|
+
# sometimes stays open.
|
374
|
+
if fragment_id and not self._fragment_storage.contains(fragment_id):
|
375
|
+
_LOGGER.info(
|
376
|
+
f"The fragment with id {fragment_id} does not exist anymore - "
|
377
|
+
"it might have been removed during a preceding full-app rerun."
|
378
|
+
)
|
379
|
+
return
|
380
|
+
|
360
381
|
rerun_data = RerunData(
|
361
382
|
client_state.query_string,
|
362
383
|
client_state.widget_states,
|
@@ -576,7 +597,6 @@ class AppSession:
|
|
576
597
|
if event == ScriptRunnerEvent.SCRIPT_STARTED:
|
577
598
|
if self._state != AppSessionState.SHUTDOWN_REQUESTED:
|
578
599
|
self._state = AppSessionState.APP_IS_RUNNING
|
579
|
-
|
580
600
|
assert (
|
581
601
|
page_script_hash is not None
|
582
602
|
), "page_script_hash must be set for the SCRIPT_STARTED event"
|
@@ -273,9 +273,9 @@ class DataCaches(CacheStatsProvider):
|
|
273
273
|
except InvalidCacheStorageContext as e:
|
274
274
|
_LOGGER.error(
|
275
275
|
"Cache params for function %s are incompatible with current "
|
276
|
-
"cache storage manager
|
276
|
+
"cache storage manager.",
|
277
277
|
function_name,
|
278
|
-
e,
|
278
|
+
exc_info=e,
|
279
279
|
)
|
280
280
|
raise
|
281
281
|
|
@@ -486,10 +486,11 @@ def _make_function_key(cache_type: CacheType, func: FunctionType) -> str:
|
|
486
486
|
source_code: str | bytes
|
487
487
|
try:
|
488
488
|
source_code = inspect.getsource(func)
|
489
|
-
except OSError as
|
489
|
+
except OSError as ex:
|
490
490
|
_LOGGER.debug(
|
491
|
-
"Failed to retrieve function's source code when building its key;
|
492
|
-
|
491
|
+
"Failed to retrieve function's source code when building its key; "
|
492
|
+
"falling back to bytecode.",
|
493
|
+
exc_info=ex,
|
493
494
|
)
|
494
495
|
source_code = func.__code__.co_code
|
495
496
|
|
@@ -150,7 +150,7 @@ class LocalDiskCacheStorage(CacheStorage):
|
|
150
150
|
except FileNotFoundError:
|
151
151
|
raise CacheStorageKeyNotFoundError("Key not found in disk cache")
|
152
152
|
except Exception as ex:
|
153
|
-
_LOGGER.
|
153
|
+
_LOGGER.exception("Error reading from cache")
|
154
154
|
raise CacheStorageError("Unable to read from cache") from ex
|
155
155
|
else:
|
156
156
|
raise CacheStorageKeyNotFoundError(
|
@@ -164,15 +164,15 @@ class LocalDiskCacheStorage(CacheStorage):
|
|
164
164
|
try:
|
165
165
|
with streamlit_write(path, binary=True) as output:
|
166
166
|
output.write(value)
|
167
|
-
except errors.Error as
|
168
|
-
_LOGGER.debug(
|
167
|
+
except errors.Error as ex:
|
168
|
+
_LOGGER.debug("Unable to write to cache", exc_info=ex)
|
169
169
|
# Clean up file so we don't leave zero byte files.
|
170
170
|
try:
|
171
171
|
os.remove(path)
|
172
172
|
except (FileNotFoundError, OSError):
|
173
173
|
# If we can't remove the file, it's not a big deal.
|
174
174
|
pass
|
175
|
-
raise CacheStorageError("Unable to write to cache") from
|
175
|
+
raise CacheStorageError("Unable to write to cache") from ex
|
176
176
|
|
177
177
|
def delete(self, key: str) -> None:
|
178
178
|
"""Delete a cache file from disk. If the file does not exist on disk,
|
streamlit/runtime/credentials.py
CHANGED
@@ -199,8 +199,8 @@ class Credentials:
|
|
199
199
|
|
200
200
|
try:
|
201
201
|
os.remove(c._conf_file)
|
202
|
-
except OSError
|
203
|
-
_LOGGER.
|
202
|
+
except OSError:
|
203
|
+
_LOGGER.exception("Error removing credentials file.")
|
204
204
|
|
205
205
|
def save(self) -> None:
|
206
206
|
"""Save to toml file and send email."""
|
@@ -222,8 +222,8 @@ class Credentials:
|
|
222
222
|
|
223
223
|
try:
|
224
224
|
_send_email(self.activation.email)
|
225
|
-
except RequestException
|
226
|
-
_LOGGER.
|
225
|
+
except RequestException:
|
226
|
+
_LOGGER.exception("Error saving email:")
|
227
227
|
|
228
228
|
def activate(self, show_instructions: bool = True) -> None:
|
229
229
|
"""Activate Streamlit.
|
@@ -133,7 +133,9 @@ class ForwardMsgCache(CacheStatsProvider):
|
|
133
133
|
if script_run_count < prev_run_count:
|
134
134
|
_LOGGER.error(
|
135
135
|
"New script_run_count (%s) is < prev_run_count (%s). "
|
136
|
-
"This should never happen!"
|
136
|
+
"This should never happen!",
|
137
|
+
script_run_count,
|
138
|
+
prev_run_count,
|
137
139
|
)
|
138
140
|
script_run_count = prev_run_count
|
139
141
|
self._session_script_run_counts[session] = script_run_count
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
-
from typing import TYPE_CHECKING, Any
|
17
|
+
from typing import TYPE_CHECKING, Any, Callable
|
18
18
|
|
19
19
|
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
20
20
|
|
@@ -33,6 +33,16 @@ class ForwardMsgQueue:
|
|
33
33
|
a single thread.
|
34
34
|
"""
|
35
35
|
|
36
|
+
_before_enqueue_msg: Callable[[ForwardMsg], None] | None = None
|
37
|
+
|
38
|
+
@staticmethod
|
39
|
+
def on_before_enqueue_msg(
|
40
|
+
before_enqueue_msg: Callable[[ForwardMsg], None] | None,
|
41
|
+
) -> None:
|
42
|
+
"""Set a callback to be called before a message is enqueued.
|
43
|
+
Used in static streamlit app generation."""
|
44
|
+
ForwardMsgQueue._before_enqueue_msg = before_enqueue_msg
|
45
|
+
|
36
46
|
def __init__(self):
|
37
47
|
self._queue: list[ForwardMsg] = []
|
38
48
|
# A mapping of (delta_path -> _queue.indexof(msg)) for each
|
@@ -55,6 +65,10 @@ class ForwardMsgQueue:
|
|
55
65
|
|
56
66
|
def enqueue(self, msg: ForwardMsg) -> None:
|
57
67
|
"""Add message into queue, possibly composing it with another message."""
|
68
|
+
|
69
|
+
if ForwardMsgQueue._before_enqueue_msg:
|
70
|
+
ForwardMsgQueue._before_enqueue_msg(msg)
|
71
|
+
|
58
72
|
if not _is_composable_message(msg):
|
59
73
|
self._queue.append(msg)
|
60
74
|
return
|
@@ -103,7 +117,7 @@ class ForwardMsgQueue:
|
|
103
117
|
self._queue = []
|
104
118
|
else:
|
105
119
|
self._queue = [
|
106
|
-
_update_script_finished_message(msg)
|
120
|
+
_update_script_finished_message(msg, fragment_ids_this_run is not None)
|
107
121
|
for msg in self._queue
|
108
122
|
if msg.WhichOneof("type")
|
109
123
|
in {
|
@@ -195,7 +209,9 @@ def _maybe_compose_deltas(old_delta: Delta, new_delta: Delta) -> Delta | None:
|
|
195
209
|
return None
|
196
210
|
|
197
211
|
|
198
|
-
def _update_script_finished_message(
|
212
|
+
def _update_script_finished_message(
|
213
|
+
msg: ForwardMsg, is_fragment_run: bool
|
214
|
+
) -> ForwardMsg:
|
199
215
|
"""
|
200
216
|
When we are here, the message queue is cleared from non-lifecycle messages
|
201
217
|
before they were flushed to the browser.
|
@@ -207,6 +223,18 @@ def _update_script_finished_message(msg: ForwardMsg) -> ForwardMsg:
|
|
207
223
|
Otherwise, a `FINISHED_SUCCESSFULLY` message might trigger a reset of widget
|
208
224
|
states on the frontend.
|
209
225
|
"""
|
210
|
-
if msg.WhichOneof("type") == "script_finished"
|
226
|
+
if msg.WhichOneof("type") == "script_finished" and (
|
227
|
+
# If this is not a fragment run (= full app run), its okay to change the
|
228
|
+
# script_finished type to FINISHED_EARLY_FOR_RERUN because another full app run
|
229
|
+
# is about to start.
|
230
|
+
# If this is a fragment run, it is allowed to change the state of
|
231
|
+
# all script_finished states except for FINISHED_SUCCESSFULLY, which we use to
|
232
|
+
# indicate that a full app run has finished successfully (in other words, a
|
233
|
+
# fragment should not modify the finished status of a full app run, because
|
234
|
+
# the fragment finished state is different and the frontend might not trigger
|
235
|
+
# cleanups etc. correctly).
|
236
|
+
is_fragment_run is False
|
237
|
+
or msg.script_finished != ForwardMsg.ScriptFinishedStatus.FINISHED_SUCCESSFULLY
|
238
|
+
):
|
211
239
|
msg.script_finished = ForwardMsg.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN
|
212
240
|
return msg
|
streamlit/runtime/fragment.py
CHANGED
@@ -97,7 +97,7 @@ class MemoryFragmentStorage(FragmentStorage):
|
|
97
97
|
the FragmentStorage protocol.
|
98
98
|
"""
|
99
99
|
|
100
|
-
def __init__(self):
|
100
|
+
def __init__(self) -> None:
|
101
101
|
self._fragments: dict[str, Fragment] = {}
|
102
102
|
|
103
103
|
# Weirdly, we have to define this above the `set` method, or mypy gets it confused
|
@@ -300,7 +300,9 @@ class PagesManager:
|
|
300
300
|
if isinstance(self.pages_strategy, PagesStrategyV1):
|
301
301
|
if os.path.exists(self.main_script_parent / "pages"):
|
302
302
|
_LOGGER.warning(
|
303
|
-
"st.navigation was called in an app with a pages/ directory.
|
303
|
+
"st.navigation was called in an app with a pages/ directory. "
|
304
|
+
"This may cause unusual app behavior. You may want to rename the "
|
305
|
+
"pages/ directory."
|
304
306
|
)
|
305
307
|
PagesManager.DefaultStrategy = PagesStrategyV2
|
306
308
|
self.pages_strategy = PagesStrategyV2(self)
|
@@ -14,8 +14,10 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
+
import sys
|
17
18
|
from typing import TYPE_CHECKING, Any, Callable
|
18
19
|
|
20
|
+
from streamlit import util
|
19
21
|
from streamlit.delta_generator_singletons import (
|
20
22
|
context_dg_stack,
|
21
23
|
get_default_dg_stack_value,
|
@@ -32,6 +34,37 @@ if TYPE_CHECKING:
|
|
32
34
|
from streamlit.runtime.scriptrunner_utils.script_run_context import ScriptRunContext
|
33
35
|
|
34
36
|
|
37
|
+
class modified_sys_path:
|
38
|
+
"""A context for prepending a directory to sys.path for a second.
|
39
|
+
|
40
|
+
Code inspired by IPython:
|
41
|
+
Source: https://github.com/ipython/ipython/blob/master/IPython/utils/syspathcontext.py#L42
|
42
|
+
"""
|
43
|
+
|
44
|
+
def __init__(self, main_script_path: str):
|
45
|
+
self._main_script_path = main_script_path
|
46
|
+
self._added_path = False
|
47
|
+
|
48
|
+
def __repr__(self) -> str:
|
49
|
+
return util.repr_(self)
|
50
|
+
|
51
|
+
def __enter__(self):
|
52
|
+
if self._main_script_path not in sys.path:
|
53
|
+
sys.path.insert(0, self._main_script_path)
|
54
|
+
self._added_path = True
|
55
|
+
|
56
|
+
def __exit__(self, type, value, traceback):
|
57
|
+
if self._added_path:
|
58
|
+
try:
|
59
|
+
sys.path.remove(self._main_script_path)
|
60
|
+
except ValueError:
|
61
|
+
# It's already removed.
|
62
|
+
pass
|
63
|
+
|
64
|
+
# Returning False causes any exceptions to be re-raised.
|
65
|
+
return False
|
66
|
+
|
67
|
+
|
35
68
|
def exec_func_with_error_handling(
|
36
69
|
func: Callable[[], Any], ctx: ScriptRunContext
|
37
70
|
) -> tuple[
|
@@ -34,7 +34,10 @@ from streamlit.runtime.metrics_util import (
|
|
34
34
|
create_page_profile_message,
|
35
35
|
to_microseconds,
|
36
36
|
)
|
37
|
-
from streamlit.runtime.scriptrunner.exec_code import
|
37
|
+
from streamlit.runtime.scriptrunner.exec_code import (
|
38
|
+
exec_func_with_error_handling,
|
39
|
+
modified_sys_path,
|
40
|
+
)
|
38
41
|
from streamlit.runtime.scriptrunner.script_cache import ScriptCache
|
39
42
|
from streamlit.runtime.scriptrunner_utils.exceptions import (
|
40
43
|
RerunException,
|
@@ -55,7 +58,6 @@ from streamlit.runtime.state import (
|
|
55
58
|
SafeSessionState,
|
56
59
|
SessionState,
|
57
60
|
)
|
58
|
-
from streamlit.vendor.ipython.modified_sys_path import modified_sys_path
|
59
61
|
|
60
62
|
if TYPE_CHECKING:
|
61
63
|
from streamlit.runtime.fragment import FragmentStorage
|
@@ -501,7 +503,7 @@ class ScriptRunner:
|
|
501
503
|
|
502
504
|
except Exception as ex:
|
503
505
|
# We got a compile error. Send an error event and bail immediately.
|
504
|
-
_LOGGER.debug("Fatal script error
|
506
|
+
_LOGGER.debug("Fatal script error", exc_info=ex)
|
505
507
|
self._session_state[SCRIPT_RUN_WITHOUT_ERRORS_KEY] = False
|
506
508
|
self.on_event.send(
|
507
509
|
self,
|
@@ -52,6 +52,7 @@ class RerunData:
|
|
52
52
|
# The queue of fragment_ids waiting to be run.
|
53
53
|
fragment_id_queue: list[str] = field(default_factory=list)
|
54
54
|
is_fragment_scoped_rerun: bool = False
|
55
|
+
# set to true when a script is rerun by the fragment auto-rerun mechanism
|
55
56
|
is_auto_rerun: bool = False
|
56
57
|
|
57
58
|
def __repr__(self) -> str:
|
streamlit/static/index.html
CHANGED
@@ -51,7 +51,7 @@
|
|
51
51
|
<script>
|
52
52
|
window.prerenderReady = false
|
53
53
|
</script>
|
54
|
-
<script type="module" crossorigin src="./static/js/index.
|
54
|
+
<script type="module" crossorigin src="./static/js/index.BRwmGBP4.js"></script>
|
55
55
|
<link rel="stylesheet" crossorigin href="./static/css/index.ZIJkhegp.css">
|
56
56
|
</head>
|
57
57
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
import{r as e,E as n,_ as a}from"./index.
|
1
|
+
import{r as e,E as n,_ as a}from"./index.BRwmGBP4.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};
|
@@ -1 +1 @@
|
|
1
|
-
import{D as a,
|
1
|
+
import{D as a,b_ as i,r as o}from"./index.BRwmGBP4.js";class l{manageFormClearListener(r,s,t){a(this.formClearListener)&&this.lastWidgetMgr===r&&this.lastFormId===s||(this.disconnect(),i(s)&&(this.formClearListener=r.addFormClearedListener(s,t),this.lastWidgetMgr=r,this.lastFormId=s))}disconnect(){var r;(r=this.formClearListener)==null||r.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function d({element:e,widgetMgr:r,onFormCleared:s}){o.useEffect(()=>{if(!i(e.formId))return;const t=r.addFormClearedListener(e.formId,s);return()=>{t.disconnect()}},[e,r,s])}export{l as F,d as u};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as t}from"./index.
|
1
|
+
import{r as t}from"./index.BRwmGBP4.js";const o=r=>{const e=t.useRef();return t.useEffect(()=>{e.current=r},[r]),e.current};export{o as u};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as g,k as d,j as l,
|
1
|
+
import{n as g,k as d,j as l,c3 as p,c4 as f}from"./index.BRwmGBP4.js";const I=d("50%{color:rgba(0,0,0,0);}"),$=g("span",{target:"eva3uk20"})(({includeDot:n,shouldBlink:s,theme:t})=>({...n?{"&::before":{opacity:1,content:'"•"',animation:"none",color:t.colors.gray,margin:`0 ${t.spacing.twoXS}`}}:{},...s?{color:t.colors.red,animationName:`${I}`,animationDuration:"0.5s",animationIterationCount:5}:{}})),b=({dirty:n,value:s,inForm:t,maxLength:a,className:m,type:i="single",allowEnterToSubmit:u=!0})=>{const o=[],r=(e,c=!1)=>{o.push(l($,{includeDot:o.length>0,shouldBlink:c,children:e},o.length))};if(u){const e=t?"submit form":"apply";if(i==="multiline"){const c=f()?"⌘":"Ctrl";r(`Press ${c}+Enter to ${e}`)}else i==="single"&&r(`Press Enter to ${e}`)}return a&&(i!=="chat"||n)&&r(`${s.length}/${a}`,n&&s.length>=a),l(p,{"data-testid":"InputInstructions",className:m,children:o})};export{b as I};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(e,r){if(e){if(typeof e=="string")return oe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oe(e,r)}}function oe(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}function Xe(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a=[],n=!0,o=!1,i,s;try{for(t=t.call(e);!(n=(i=t.next()).done)&&(a.push(i.value),!(r&&a.length===r));n=!0);}catch(l){o=!0,s=l}finally{try{!n&&t.return!=null&&t.return()}finally{if(o)throw s}}return a}}function Ve(e){if(Array.isArray(e))return e}function Ie(e,r){if(e==null)return{};var t=Ae(e,r),a,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}function Ae(e,r){if(e==null)return{};var t={},a=Object.keys(e),n,o;for(o=0;o<a.length;o++)n=a[o],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function
|
1
|
+
import{bq as g,c1 as Le,c2 as I,R as C,r as d,br as O,ab as xe,aw as Te,bX as ke,j as ze,bN as Ee}from"./index.BRwmGBP4.js";var y={small:"small",medium:"medium",large:"large"},_;function L(){return L=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},L.apply(this,arguments)}function ae(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,a)}return t}function P(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ae(Object(t),!0).forEach(function(a){v(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ae(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}function v(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function se(e){var r;return(r={},v(r,y.small,"2px"),v(r,y.medium,"4px"),v(r,y.large,"8px"),r)[e]}var A=g("div",function(e){return{width:"100%"}});A.displayName="StyledRoot";A.displayName="StyledRoot";var M=g("div",function(e){var r=e.$theme,t=r.sizing;return{display:"flex",marginLeft:t.scale500,marginRight:t.scale500,marginTop:t.scale500,marginBottom:t.scale500}});M.displayName="StyledBarContainer";M.displayName="StyledBarContainer";var D=g("div",function(e){var r=e.$theme,t=e.$size,a=e.$steps,n=r.colors,o=r.sizing,i=r.borders,s=i.useRoundedCorners?o.scale0:0;return P({borderTopLeftRadius:s,borderTopRightRadius:s,borderBottomRightRadius:s,borderBottomLeftRadius:s,backgroundColor:Le(n.progressbarTrackFill,"0.16"),height:se(t),flex:1,overflow:"hidden"},a<2?{}:{marginLeft:o.scale300,":first-child":{marginLeft:"0"}})});D.displayName="StyledBar";D.displayName="StyledBar";var H=g("div",function(e){var r=e.$theme,t=e.$value,a=e.$successValue,n=e.$steps,o=e.$index,i=e.$maxValue,s=e.$minValue,l=s===void 0?0:s,u=i||a,R=r.colors,B=r.sizing,$=r.borders,x="".concat(100-(t-l)*100/(u-l),"%"),m={default:"default",awaits:"awaits",inProgress:"inProgress",completed:"completed"},c=m.default;if(n>1){var T=(u-l)/n,j=(t-l)/(u-l)*100,k=Math.floor(j/T);o<k?c=m.completed:o===k?c=m.inProgress:c=m.awaits}var S=$.useRoundedCorners?B.scale0:0,b={transform:"translateX(-".concat(x,")")},N=c===m.inProgress?{animationDuration:"2.1s",animationIterationCount:"infinite",animationTimingFunction:r.animation.linearCurve,animationName:{"0%":{transform:"translateX(-102%)",opacity:1},"50%":{transform:"translateX(0%)",opacity:1},"100%":{transform:"translateX(0%)",opacity:0}}}:c===m.completed?{transform:"translateX(0%)"}:{transform:"translateX(-102%)"};return P({borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,backgroundColor:R.accent,height:"100%",width:"100%",transform:"translateX(-102%)",transition:"transform 0.5s"},n>1?N:b)});H.displayName="StyledBarProgress";H.displayName="StyledBarProgress";var W=g("div",function(e){var r=e.$theme,t=e.$isLeft,a=t===void 0?!1:t,n=e.$size,o=n===void 0?y.medium:n,i=r.colors,s=r.sizing,l=r.borders,u=l.useRoundedCorners?s.scale0:0,R=se(o),B={display:"inline-block",flex:1,marginLeft:"auto",marginRight:"auto",transitionProperty:"background-position",animationDuration:"1.5s",animationIterationCount:"infinite",animationTimingFunction:r.animation.linearCurve,backgroundSize:"300% auto",backgroundRepeat:"no-repeat",backgroundPositionX:a?"-50%":"150%",backgroundImage:"linear-gradient(".concat(a?"90":"270","deg, transparent 0%, ").concat(i.accent," 25%, ").concat(i.accent," 75%, transparent 100%)"),animationName:a?{"0%":{backgroundPositionX:"-50%"},"33%":{backgroundPositionX:"50%"},"66%":{backgroundPositionX:"50%"},"100%":{backgroundPositionX:"150%"}}:{"0%":{backgroundPositionX:"150%"},"33%":{backgroundPositionX:"50%"},"66%":{backgroundPositionX:"50%"},"100%":{backgroundPositionX:"-50%"}}};return P(P({},a?{borderTopLeftRadius:u,borderBottomLeftRadius:u}:{borderTopRightRadius:u,borderBottomRightRadius:u}),{},{height:R},B)});W.displayName="StyledInfiniteBar";W.displayName="StyledInfiniteBar";var F=g("div",function(e){return P(P({textAlign:"center"},e.$theme.typography.font150),{},{color:e.$theme.colors.contentTertiary})});F.displayName="StyledLabel";F.displayName="StyledLabel";var f=(_={},v(_,y.large,{d:"M47.5 4H71.5529C82.2933 4 91 12.9543 91 24C91 35.0457 82.2933 44 71.5529 44H23.4471C12.7067 44 4 35.0457 4 24C4 12.9543 12.7067 4 23.4471 4H47.5195",width:95,height:48,strokeWidth:8,typography:"LabelLarge"}),v(_,y.medium,{d:"M39 2H60.5833C69.0977 2 76 9.16344 76 18C76 26.8366 69.0977 34 60.5833 34H17.4167C8.90228 34 2 26.8366 2 18C2 9.16344 8.90228 2 17.4167 2H39.0195",width:78,height:36,strokeWidth:4,typography:"LabelMedium"}),v(_,y.small,{d:"M32 1H51.6271C57.9082 1 63 6.37258 63 13C63 19.6274 57.9082 25 51.6271 25H12.3729C6.09181 25 1 19.6274 1 13C1 6.37258 6.09181 1 12.3729 1H32.0195",width:64,height:26,strokeWidth:2,typography:"LabelSmall"}),_),le=g("div",function(e){var r=e.$size,t=e.$inline;return{width:f[r].width+"px",height:f[r].height+"px",position:"relative",display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}});le.displayName="StyledProgressBarRoundedRoot";le.displayName="StyledProgressBarRoundedRoot";var G=g("svg",function(e){var r=e.$size;return{width:f[r].width+"px",height:f[r].height+"px",position:"absolute",fill:"none"}});G.displayName="_StyledProgressBarRoundedSvg";G.displayName="_StyledProgressBarRoundedSvg";I(G,function(e){return function(t){return C.createElement(e,L({viewBox:"0 0 ".concat(f[t.$size].width," ").concat(f[t.$size].height),xmlns:"http://www.w3.org/2000/svg"},t))}});var U=g("path",function(e){var r=e.$theme,t=e.$size;return{stroke:r.colors.backgroundTertiary,strokeWidth:f[t].strokeWidth+"px"}});U.displayName="_StyledProgressBarRoundedTrackBackground";U.displayName="_StyledProgressBarRoundedTrackBackground";I(U,function(e){return function(t){return C.createElement(e,L({d:f[t.$size].d},t))}});var Z=g("path",function(e){var r=e.$theme,t=e.$size,a=e.$visible,n=e.$pathLength,o=e.$pathProgress;return{visibility:a?"visible":"hidden",stroke:r.colors.borderAccent,strokeWidth:f[t].strokeWidth+"px",strokeDasharray:n,strokeDashoffset:n*(1-o)+""}});Z.displayName="_StyledProgressBarRoundedTrackForeground";Z.displayName="_StyledProgressBarRoundedTrackForeground";I(Z,function(e){return function(t){return C.createElement(e,L({d:f[t.$size].d},t))}});var ue=g("div",function(e){var r=e.$theme,t=e.$size;return P({color:r.colors.contentPrimary},r.typography[f[t].typography])});ue.displayName="StyledProgressBarRoundedText";ue.displayName="StyledProgressBarRoundedText";function X(e){"@babel/helpers - typeof";return X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},X(e)}var Ce=["overrides","getProgressLabel","value","size","steps","successValue","minValue","maxValue","showLabel","infinite","errorMessage","forwardedRef"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},p.apply(this,arguments)}function w(e,r){return Ve(e)||Xe(e,r)||Ne(e,r)||je()}function je(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(e,r){if(e){if(typeof e=="string")return oe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oe(e,r)}}function oe(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}function Xe(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a=[],n=!0,o=!1,i,s;try{for(t=t.call(e);!(n=(i=t.next()).done)&&(a.push(i.value),!(r&&a.length===r));n=!0);}catch(l){o=!0,s=l}finally{try{!n&&t.return!=null&&t.return()}finally{if(o)throw s}}return a}}function Ve(e){if(Array.isArray(e))return e}function Ie(e,r){if(e==null)return{};var t=Ae(e,r),a,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}function Ae(e,r){if(e==null)return{};var t={},a=Object.keys(e),n,o;for(o=0;o<a.length;o++)n=a[o],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function Me(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function De(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function He(e,r,t){return r&&De(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function We(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&V(e,r)}function V(e,r){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},V(e,r)}function Fe(e){var r=Ze();return function(){var a=E(e),n;if(r){var o=E(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return Ge(this,n)}}function Ge(e,r){if(r&&(X(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ue(e)}function Ue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ze(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(e)}function qe(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var de=function(e){We(t,e);var r=Fe(t);function t(){return Me(this,t),r.apply(this,arguments)}return He(t,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var n=this.props,o=n.overrides,i=o===void 0?{}:o,s=n.getProgressLabel,l=n.value,u=n.size,R=n.steps,B=n.successValue,$=n.minValue,x=n.maxValue,m=n.showLabel,c=n.infinite,T=n.errorMessage,j=n.forwardedRef,k=Ie(n,Ce),S=this.props["aria-label"]||this.props.ariaLabel,b=x!==100?x:B,N=O(i.Root,A),q=w(N,2),fe=q[0],ge=q[1],pe=O(i.BarContainer,M),K=w(pe,2),me=K[0],ye=K[1],be=O(i.Bar,D),J=w(be,2),he=J[0],ve=J[1],Pe=O(i.BarProgress,H),Q=w(Pe,2),Re=Q[0],$e=Q[1],Se=O(i.Label,F),Y=w(Se,2),Oe=Y[0],we=Y[1],Be=O(i.InfiniteBar,W),ee=w(Be,2),re=ee[0],te=ee[1],h={$infinite:c,$size:u,$steps:R,$successValue:b,$minValue:$,$maxValue:b,$value:l};function _e(){for(var ne=[],z=0;z<R;z++)ne.push(d.createElement(he,p({key:z},h,ve),d.createElement(Re,p({$index:z},h,$e))));return ne}return d.createElement(fe,p({ref:j,"data-baseweb":"progress-bar",role:"progressbar","aria-label":S||s(l,b,$),"aria-valuenow":c?null:l,"aria-valuemin":c?null:$,"aria-valuemax":c?null:b,"aria-invalid":T?!0:null,"aria-errormessage":T},k,h,ge),d.createElement(me,p({},h,ye),c?d.createElement(d.Fragment,null,d.createElement(re,p({$isLeft:!0,$size:h.$size},te)),d.createElement(re,p({$size:h.$size},te))):_e()),m&&d.createElement(Oe,p({},h,we),s(l,b,$)))}}]),t}(d.Component);qe(de,"defaultProps",{getProgressLabel:function(r,t,a){return"".concat(Math.round((r-a)/(t-a)*100),"% Loaded")},infinite:!1,overrides:{},showLabel:!1,size:y.medium,steps:1,successValue:100,minValue:0,maxValue:100,value:0});var ce=d.forwardRef(function(e,r){return d.createElement(de,p({forwardedRef:r},e))});ce.displayName="ProgressBar";var ie;(function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"})(ie||(ie={}));function Je({value:e,width:r,size:t="sm",overrides:a}){const n=xe(),o={xs:n.spacing.twoXS,sm:n.spacing.sm,md:n.spacing.lg,lg:n.spacing.xl,xl:n.spacing.twoXL},{activeTheme:i}=C.useContext(Te),s=!ke(i),l={BarContainer:{style:{marginTop:n.spacing.none,marginBottom:n.spacing.none,marginRight:n.spacing.none,marginLeft:n.spacing.none}},Bar:{style:({$theme:u})=>({width:r?r.toString():void 0,marginTop:n.spacing.none,marginBottom:n.spacing.none,marginRight:n.spacing.none,marginLeft:n.spacing.none,height:o[t],backgroundColor:u.colors.progressbarTrackFill,borderTopLeftRadius:n.spacing.twoXS,borderTopRightRadius:n.spacing.twoXS,borderBottomLeftRadius:n.spacing.twoXS,borderBottomRightRadius:n.spacing.twoXS})},BarProgress:{style:()=>({backgroundColor:s?n.colors.primary:n.colors.blue70,borderTopLeftRadius:n.spacing.twoXS,borderTopRightRadius:n.spacing.twoXS,borderBottomLeftRadius:n.spacing.twoXS,borderBottomRightRadius:n.spacing.twoXS})}};return ze(ce,{value:e,overrides:Ee(l,a)})}export{Je as P,ie as S};
|
streamlit/static/static/js/{RenderInPortalIfExists.BIVWPcSk.js → RenderInPortalIfExists.DvbHx6rz.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
import{n as i,r as s,j as r,a as d,P as m,b as p,F as P}from"./index.
|
1
|
+
import{n as i,r as s,j as r,a as d,P as m,b as p,F as P}from"./index.BRwmGBP4.js";const x=i("div",{target:"e1swy67l0"})({"@media print":{display:"none"}}),y=({className:t,scriptRunId:a,numParticles:e,numParticleTypes:o,ParticleComponent:n})=>r(x,{className:t,"data-testid":t,children:d(e).map(l=>{const c=Math.floor(Math.random()*o);return r(n,{particleType:c},a+l)})}),E=s.memo(y),f=({children:t})=>{var e;const a=(e=s.useContext(m))==null?void 0:e();return a?p.createPortal(t,a):r(P,{children:t})};export{E as P,f as R};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as a,E as
|
1
|
+
import{r as a,E as p,_ as v,n as d,au as b,ab as x,j as n,bp as g,ar as E,b6 as T,ax as h,b2 as w,bj as y,bk as z}from"./index.BRwmGBP4.js";var f=a.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(p,v({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))});f.displayName="Fullscreen";var u=a.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(p,v({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))});u.displayName="FullscreenExit";const c="-2.4rem",B=d("div",{target:"esvuqrb0"})(({theme:t,locked:o,target:e})=>({padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:o?c:"-1rem",right:t.spacing.none,transition:"none",...!o&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c},...e&&{[`${e}:hover &, ${e}:active &, ${e}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c}}}})),V=d("div",{target:"esvuqrb1"})(({theme:t})=>({color:b(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1})),H=d("div",{target:"esvuqrb2"})(({width:t,height:o,useContainerWidth:e,topCentered:s})=>({position:"relative",height:e&&o?o:"fit-content",width:e?t:"fit-content",maxWidth:"100%",...s?{display:"flex",justifyContent:"center"}:{}}));function m({label:t,show_label:o,icon:e,onClick:s}){const l=x(),i=o?t:"";return n("div",{"data-testid":"stElementToolbarButton",children:n(g,{content:n(E,{source:t,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:T.TOP,onMouseEnterDelay:1e3,inline:!0,children:h(z,{onClick:r=>{s&&s(),r.stopPropagation()},kind:w.ELEMENT_TOOLBAR,"aria-label":t,children:[e&&n(y,{content:e,size:"md",testid:"stElementToolbarButtonIcon"}),i&&n("span",{children:i})]})})})}const M=({onExpand:t,onCollapse:o,isFullScreen:e,locked:s,children:l,target:i,disableFullscreenMode:r})=>n(B,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:s||e,target:i,children:h(V,{children:[l,t&&!r&&!e&&n(m,{label:"Fullscreen",icon:f,onClick:()=>t()}),o&&!r&&e&&n(m,{label:"Close fullscreen",icon:u,onClick:()=>o()})]})});export{H as S,M as T,m as a};
|