streamlit-nightly 1.44.2.dev20250421__py3-none-any.whl → 1.44.2.dev20250423__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/commands/navigation.py +2 -1
- streamlit/components/types/base_custom_component.py +9 -0
- streamlit/components/v1/custom_component.py +21 -0
- streamlit/config.py +5 -1
- streamlit/elements/alert.py +67 -0
- streamlit/elements/exception.py +28 -3
- streamlit/elements/iframe.py +35 -0
- streamlit/elements/lib/layout_utils.py +51 -0
- streamlit/env_util.py +4 -4
- streamlit/errors.py +15 -0
- streamlit/proto/Alert_pb2.py +6 -5
- streamlit/proto/Alert_pb2.pyi +9 -1
- streamlit/proto/Components_pb2.py +10 -10
- streamlit/proto/Components_pb2.pyi +6 -1
- streamlit/proto/Exception_pb2.py +4 -3
- streamlit/proto/Exception_pb2.pyi +9 -1
- streamlit/proto/IFrame_pb2.py +3 -3
- streamlit/proto/IFrame_pb2.pyi +8 -2
- streamlit/proto/MetricsEvent_pb2.py +4 -4
- streamlit/proto/MetricsEvent_pb2.pyi +10 -1
- streamlit/proto/NewSession_pb2.py +2 -2
- streamlit/proto/NewSession_pb2.pyi +16 -1
- streamlit/proto/WidthConfig_pb2.py +27 -0
- streamlit/proto/WidthConfig_pb2.pyi +34 -0
- streamlit/runtime/app_session.py +6 -1
- streamlit/runtime/context.py +72 -4
- streamlit/runtime/context_util.py +49 -0
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.BRFl1bVT.js → ErrorOutline.esm.kwxUkJiQ.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BlVcbv80.js → FileDownload.esm.B4NSS6Sl.js} +1 -1
- streamlit/static/static/js/{FileHelper.Cu8b3qYc.js → FileHelper.D70RJhDu.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.D0_ew-pr.js → FormClearHelper.C-xLj6rB.js} +1 -1
- streamlit/static/static/js/{Hooks.DskP_qUg.js → Hooks.BB7DtXCF.js} +1 -1
- streamlit/static/static/js/{InputInstructions.B57U_Pck.js → InputInstructions.CGY1oTmu.js} +1 -1
- streamlit/static/static/js/{ProgressBar.B5UexUoj.js → ProgressBar.BMrZcYD1.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.CCx_j2kS.js → RenderInPortalIfExists.C7BYLlpF.js} +1 -1
- streamlit/static/static/js/Toolbar.JI3o5o7J.js +1 -0
- streamlit/static/static/js/{base-input.vMZreRbs.js → base-input.ppk9zgs1.js} +1 -1
- streamlit/static/static/js/{checkbox.BvzLW9mz.js → checkbox.49raiX_Q.js} +1 -1
- streamlit/static/static/js/{createSuper.Bw1znQ_0.js → createSuper.87fVAqEV.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.D7LIqz-H.js → data-grid-overlay-editor.B1NKPOjN.js} +1 -1
- streamlit/static/static/js/{downloader.wxNZEkm4.js → downloader.BcfN0KsR.js} +1 -1
- streamlit/static/static/js/{es6.CUH1kXnl.js → es6.SM-d8IW7.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.D1Um7X41.js → iframeResizer.contentWindow.BiLXSNCc.js} +1 -1
- streamlit/static/static/js/{index.DiU_iAr0.js → index.-XsjpKIw.js} +1 -1
- streamlit/static/static/js/{index.DeTKJCBX.js → index.23z_CL39.js} +1 -1
- streamlit/static/static/js/{index.BJ6Emr34.js → index.B5QZmtKU.js} +1 -1
- streamlit/static/static/js/{index.EKcIoWDD.js → index.BHUccop_.js} +1 -1
- streamlit/static/static/js/{index.ClJO7cQG.js → index.BJXqcYGa.js} +119 -119
- streamlit/static/static/js/{index.CZUFT1MU.js → index.BK6Q5McP.js} +1 -1
- streamlit/static/static/js/{index.ByJVLduZ.js → index.BMHV-2Ba.js} +1 -1
- streamlit/static/static/js/index.BMkGp3A8.js +1 -0
- streamlit/static/static/js/{index.DocZB9LB.js → index.BWA7mhkD.js} +54 -54
- streamlit/static/static/js/{index.B-Cvaa60.js → index.BbUIsbcG.js} +1 -1
- streamlit/static/static/js/{index.B8eIzqFV.js → index.BlguKOUW.js} +1 -1
- streamlit/static/static/js/{index.BXIy_sno.js → index.BpwS_2vg.js} +1 -1
- streamlit/static/static/js/{index.DyMFPM-N.js → index.Bpzbt0XE.js} +1 -1
- streamlit/static/static/js/{index.B8aTojaJ.js → index.BtSh2qF2.js} +1 -1
- streamlit/static/static/js/{index.C6Ddq_0T.js → index.C555txyo.js} +1 -1
- streamlit/static/static/js/{index.8SbOAOpf.js → index.C5lCQ63O.js} +1 -1
- streamlit/static/static/js/{index.DbLDusYd.js → index.CCSljmFB.js} +1 -1
- streamlit/static/static/js/{index.DhCNOffY.js → index.CWgDSgiP.js} +1 -1
- streamlit/static/static/js/{index.CLIjAXFe.js → index.CgJwml-l.js} +1 -1
- streamlit/static/static/js/{index.DIVoc7sf.js → index.Chh_6WO_.js} +1 -1
- streamlit/static/static/js/{index.IKI2QU6M.js → index.CpYhueoB.js} +1 -1
- streamlit/static/static/js/{index.Dykp8DiM.js → index.Cs0BKVkf.js} +1 -1
- streamlit/static/static/js/{index.EqUN-1C8.js → index.Cu7GDmYZ.js} +1 -1
- streamlit/static/static/js/{index.J03z7hBk.js → index.CyYnsaI7.js} +1 -1
- streamlit/static/static/js/index.DKW03_hE.js +1 -0
- streamlit/static/static/js/{index.C0-tCzek.js → index.DOW8qES0.js} +1 -1
- streamlit/static/static/js/{index.C0kRoccm.js → index.DOfuaf_0.js} +1 -1
- streamlit/static/static/js/{index.D1Ywuv8r.js → index.DQ8pk-Cx.js} +1 -1
- streamlit/static/static/js/{index.CixhwxuT.js → index.D_eW5hqT.js} +1 -1
- streamlit/static/static/js/{index.Csw8C3i3.js → index.DdB-Sih0.js} +1 -1
- streamlit/static/static/js/{index.DcXPvVuL.js → index.DmyMOJie.js} +1 -1
- streamlit/static/static/js/{index.CR-jcBpI.js → index.DyvfAcMU.js} +1 -1
- streamlit/static/static/js/{index.CYrMenWX.js → index.Gze6P7P8.js} +1 -1
- streamlit/static/static/js/{index.CCgmQo2Y.js → index.esYPLQWk.js} +1 -1
- streamlit/static/static/js/{index._x_ll-5l.js → index.tXJ66r45.js} +1 -1
- streamlit/static/static/js/{index.BLmWFo9v.js → index.tz3no0C-.js} +1 -1
- streamlit/static/static/js/{index.DbSwoQrX.js → index.vUKKnPLN.js} +1 -1
- streamlit/static/static/js/{input.CfYPTrU0.js → input.B1adH3Tq.js} +1 -1
- streamlit/static/static/js/{memory.C6WsZ9vL.js → memory._j_IEh4p.js} +1 -1
- streamlit/static/static/js/{mergeWith.BEl-rFPc.js → mergeWith.CaxCG68D.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.Da6_ovQT.js → number-overlay-editor.CQ4il8-u.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DrzRVntz.js → possibleConstructorReturn.BeSJyC-R.js} +1 -1
- streamlit/static/static/js/{sandbox.BDmQFJ29.js → sandbox.CJ8UEQ_8.js} +1 -1
- streamlit/static/static/js/{textarea.B1KRwam8.js → textarea.BoKsAt5U.js} +1 -1
- streamlit/static/static/js/{timepicker.CJQu2ZZT.js → timepicker.zqbF1i9c.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.c1K-jW6k.js → toConsumableArray.BlqVQ7Zt.js} +1 -1
- streamlit/static/static/js/{uniqueId.DQubPWuJ.js → uniqueId.CB2jSt-Y.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Bnt7ikdj.js → useBasicWidgetState.CCJRj7uP.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.Dq_CVqBo.js → useOnInputChange.Cgjf7qmr.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.5xnZ4GI8.js → withFullScreenWrapper.B-OvwjED.js} +1 -1
- {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250423.dist-info}/METADATA +2 -2
- {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250423.dist-info}/RECORD +100 -96
- {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250423.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/Toolbar.D3gt1ynD.js +0 -1
- streamlit/static/static/js/index.B4uSRoDZ.js +0 -1
- streamlit/static/static/js/index.BUcUcSdx.js +0 -1
- {streamlit_nightly-1.44.2.dev20250421.data → streamlit_nightly-1.44.2.dev20250423.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250423.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.44.2.dev20250421.dist-info → streamlit_nightly-1.44.2.dev20250423.dist-info}/top_level.txt +0 -0
@@ -36,6 +36,7 @@ class ComponentInstance(google.protobuf.message.Message):
|
|
36
36
|
COMPONENT_NAME_FIELD_NUMBER: builtins.int
|
37
37
|
URL_FIELD_NUMBER: builtins.int
|
38
38
|
FORM_ID_FIELD_NUMBER: builtins.int
|
39
|
+
TAB_INDEX_FIELD_NUMBER: builtins.int
|
39
40
|
id: builtins.str
|
40
41
|
"""The instance's "widget ID", used to uniquely identify it."""
|
41
42
|
json_args: builtins.str
|
@@ -48,6 +49,7 @@ class ComponentInstance(google.protobuf.message.Message):
|
|
48
49
|
that they're developing their component in.
|
49
50
|
"""
|
50
51
|
form_id: builtins.str
|
52
|
+
tab_index: builtins.int
|
51
53
|
@property
|
52
54
|
def special_args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SpecialArg]:
|
53
55
|
"""Additional, non-JSON args. These require special processing
|
@@ -63,8 +65,11 @@ class ComponentInstance(google.protobuf.message.Message):
|
|
63
65
|
component_name: builtins.str = ...,
|
64
66
|
url: builtins.str = ...,
|
65
67
|
form_id: builtins.str = ...,
|
68
|
+
tab_index: builtins.int | None = ...,
|
66
69
|
) -> None: ...
|
67
|
-
def
|
70
|
+
def HasField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "tab_index", b"tab_index"]) -> builtins.bool: ...
|
71
|
+
def ClearField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "component_name", b"component_name", "form_id", b"form_id", "id", b"id", "json_args", b"json_args", "special_args", b"special_args", "tab_index", b"tab_index", "url", b"url"]) -> None: ...
|
72
|
+
def WhichOneof(self, oneof_group: typing.Literal["_tab_index", b"_tab_index"]) -> typing.Literal["tab_index"] | None: ...
|
68
73
|
|
69
74
|
global___ComponentInstance = ComponentInstance
|
70
75
|
|
streamlit/proto/Exception_pb2.py
CHANGED
@@ -12,9 +12,10 @@ from google.protobuf.internal import builder as _builder
|
|
12
12
|
_sym_db = _symbol_database.Default()
|
13
13
|
|
14
14
|
|
15
|
+
from streamlit.proto import WidthConfig_pb2 as streamlit_dot_proto_dot_WidthConfig__pb2
|
15
16
|
|
16
17
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/Exception.proto\"
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/Exception.proto\x1a!streamlit/proto/WidthConfig.proto\"\x9e\x01\n\tException\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x1b\n\x13message_is_markdown\x18\x04 \x01(\x08\x12\x13\n\x0bstack_trace\x18\x03 \x03(\t\x12\x12\n\nis_warning\x18\x05 \x01(\x08\x12,\n\x0cwidth_config\x18\x06 \x01(\x0b\x32\x16.streamlit.WidthConfigB.\n\x1c\x63om.snowflake.apps.streamlitB\x0e\x45xceptionProtob\x06proto3')
|
18
19
|
|
19
20
|
_globals = globals()
|
20
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -22,6 +23,6 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Exception_p
|
|
22
23
|
if not _descriptor._USE_C_DESCRIPTORS:
|
23
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
24
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\016ExceptionProto'
|
25
|
-
_globals['_EXCEPTION']._serialized_start=
|
26
|
-
_globals['_EXCEPTION']._serialized_end=
|
26
|
+
_globals['_EXCEPTION']._serialized_start=71
|
27
|
+
_globals['_EXCEPTION']._serialized_end=229
|
27
28
|
# @@protoc_insertion_point(module_scope)
|
@@ -22,6 +22,7 @@ import collections.abc
|
|
22
22
|
import google.protobuf.descriptor
|
23
23
|
import google.protobuf.internal.containers
|
24
24
|
import google.protobuf.message
|
25
|
+
import streamlit.proto.WidthConfig_pb2
|
25
26
|
import typing
|
26
27
|
|
27
28
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
@@ -42,6 +43,7 @@ class Exception(google.protobuf.message.Message):
|
|
42
43
|
MESSAGE_IS_MARKDOWN_FIELD_NUMBER: builtins.int
|
43
44
|
STACK_TRACE_FIELD_NUMBER: builtins.int
|
44
45
|
IS_WARNING_FIELD_NUMBER: builtins.int
|
46
|
+
WIDTH_CONFIG_FIELD_NUMBER: builtins.int
|
45
47
|
type: builtins.str
|
46
48
|
"""The type of the exception. This can be any string, but is usually a valid
|
47
49
|
Python exception type, like 'RuntimeError'.
|
@@ -58,6 +60,10 @@ class Exception(google.protobuf.message.Message):
|
|
58
60
|
def stack_trace(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
|
59
61
|
"""The stack trace to print."""
|
60
62
|
|
63
|
+
@property
|
64
|
+
def width_config(self) -> streamlit.proto.WidthConfig_pb2.WidthConfig:
|
65
|
+
"""Indicates the width setting: "stetch", "content" or a pixel value."""
|
66
|
+
|
61
67
|
def __init__(
|
62
68
|
self,
|
63
69
|
*,
|
@@ -66,7 +72,9 @@ class Exception(google.protobuf.message.Message):
|
|
66
72
|
message_is_markdown: builtins.bool = ...,
|
67
73
|
stack_trace: collections.abc.Iterable[builtins.str] | None = ...,
|
68
74
|
is_warning: builtins.bool = ...,
|
75
|
+
width_config: streamlit.proto.WidthConfig_pb2.WidthConfig | None = ...,
|
69
76
|
) -> None: ...
|
70
|
-
def
|
77
|
+
def HasField(self, field_name: typing.Literal["width_config", b"width_config"]) -> builtins.bool: ...
|
78
|
+
def ClearField(self, field_name: typing.Literal["is_warning", b"is_warning", "message", b"message", "message_is_markdown", b"message_is_markdown", "stack_trace", b"stack_trace", "type", b"type", "width_config", b"width_config"]) -> None: ...
|
71
79
|
|
72
80
|
global___Exception = Exception
|
streamlit/proto/IFrame_pb2.py
CHANGED
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cstreamlit/proto/IFrame.proto\"
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cstreamlit/proto/IFrame.proto\"\x9c\x01\n\x06IFrame\x12\r\n\x03src\x18\x01 \x01(\tH\x00\x12\x10\n\x06srcdoc\x18\x02 \x01(\tH\x00\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x11\n\thas_width\x18\x04 \x01(\x08\x12\x0e\n\x06height\x18\x05 \x01(\x02\x12\x11\n\tscrolling\x18\x07 \x01(\x08\x12\x16\n\ttab_index\x18\x08 \x01(\x05H\x01\x88\x01\x01\x42\x06\n\x04typeB\x0c\n\n_tab_indexB+\n\x1c\x63om.snowflake.apps.streamlitB\x0bIFrameProtob\x06proto3')
|
18
18
|
|
19
19
|
_globals = globals()
|
20
20
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -22,6 +22,6 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.IFrame_pb2'
|
|
22
22
|
if not _descriptor._USE_C_DESCRIPTORS:
|
23
23
|
_globals['DESCRIPTOR']._loaded_options = None
|
24
24
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\013IFrameProto'
|
25
|
-
_globals['_IFRAME']._serialized_start=
|
26
|
-
_globals['_IFRAME']._serialized_end=
|
25
|
+
_globals['_IFRAME']._serialized_start=33
|
26
|
+
_globals['_IFRAME']._serialized_end=189
|
27
27
|
# @@protoc_insertion_point(module_scope)
|
streamlit/proto/IFrame_pb2.pyi
CHANGED
@@ -34,6 +34,7 @@ class IFrame(google.protobuf.message.Message):
|
|
34
34
|
HAS_WIDTH_FIELD_NUMBER: builtins.int
|
35
35
|
HEIGHT_FIELD_NUMBER: builtins.int
|
36
36
|
SCROLLING_FIELD_NUMBER: builtins.int
|
37
|
+
TAB_INDEX_FIELD_NUMBER: builtins.int
|
37
38
|
src: builtins.str
|
38
39
|
"""A URL to load"""
|
39
40
|
srcdoc: builtins.str
|
@@ -42,6 +43,7 @@ class IFrame(google.protobuf.message.Message):
|
|
42
43
|
has_width: builtins.bool
|
43
44
|
height: builtins.float
|
44
45
|
scrolling: builtins.bool
|
46
|
+
tab_index: builtins.int
|
45
47
|
def __init__(
|
46
48
|
self,
|
47
49
|
*,
|
@@ -51,9 +53,13 @@ class IFrame(google.protobuf.message.Message):
|
|
51
53
|
has_width: builtins.bool = ...,
|
52
54
|
height: builtins.float = ...,
|
53
55
|
scrolling: builtins.bool = ...,
|
56
|
+
tab_index: builtins.int | None = ...,
|
54
57
|
) -> None: ...
|
55
|
-
def HasField(self, field_name: typing.Literal["src", b"src", "srcdoc", b"srcdoc", "type", b"type"]) -> builtins.bool: ...
|
56
|
-
def ClearField(self, field_name: typing.Literal["has_width", b"has_width", "height", b"height", "scrolling", b"scrolling", "src", b"src", "srcdoc", b"srcdoc", "type", b"type", "width", b"width"]) -> None: ...
|
58
|
+
def HasField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "src", b"src", "srcdoc", b"srcdoc", "tab_index", b"tab_index", "type", b"type"]) -> builtins.bool: ...
|
59
|
+
def ClearField(self, field_name: typing.Literal["_tab_index", b"_tab_index", "has_width", b"has_width", "height", b"height", "scrolling", b"scrolling", "src", b"src", "srcdoc", b"srcdoc", "tab_index", b"tab_index", "type", b"type", "width", b"width"]) -> None: ...
|
60
|
+
@typing.overload
|
61
|
+
def WhichOneof(self, oneof_group: typing.Literal["_tab_index", b"_tab_index"]) -> typing.Literal["tab_index"] | None: ...
|
62
|
+
@typing.overload
|
57
63
|
def WhichOneof(self, oneof_group: typing.Literal["type", b"type"]) -> typing.Literal["src", "srcdoc"] | None: ...
|
58
64
|
|
59
65
|
global___IFrame = IFrame
|
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
|
|
15
15
|
from streamlit.proto import PageProfile_pb2 as streamlit_dot_proto_dot_PageProfile__pb2
|
16
16
|
|
17
17
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\
|
18
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/MetricsEvent.proto\x1a!streamlit/proto/PageProfile.proto\"\xbf\x07\n\x0cMetricsEvent\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x14\n\x0c\x61nonymous_id\x18\x02 \x01(\t\x12\x15\n\rmachine_id_v3\x18\x03 \x01(\t\x12\x15\n\rmachine_id_v4\x18) \x01(\t\x12\x13\n\x0breport_hash\x18\x04 \x01(\t\x12\x0b\n\x03\x64\x65v\x18\x05 \x01(\x08\x12\x0e\n\x06source\x18\x06 \x01(\t\x12\x19\n\x11streamlit_version\x18\x07 \x01(\t\x12\x10\n\x08is_hello\x18\x08 \x01(\x08\x12\x0e\n\x06\x61pp_id\x18! \x01(\t\x12\x12\n\nsession_id\x18# \x01(\t\x12\x16\n\x0epython_version\x18$ \x01(\t\x12\x11\n\tserver_os\x18* \x01(\t\x12\x13\n\x0bhas_display\x18+ \x01(\x08\x12\x14\n\x0cis_webdriver\x18, \x01(\x08\x12\x11\n\thosted_at\x18\t \x01(\t\x12\r\n\x05owner\x18\n \x01(\t\x12\x0c\n\x04repo\x18\x0b \x01(\t\x12\x0e\n\x06\x62ranch\x18\x0c \x01(\t\x12\x13\n\x0bmain_module\x18\r \x01(\t\x12\x12\n\ncreator_id\x18\x0e \x01(\t\x12\x18\n\x10\x63ontext_page_url\x18\x0f \x01(\t\x12\x1a\n\x12\x63ontext_page_title\x18\x10 \x01(\t\x12\x19\n\x11\x63ontext_page_path\x18\x11 \x01(\t\x12\x1d\n\x15\x63ontext_page_referrer\x18\x12 \x01(\t\x12\x1b\n\x13\x63ontext_page_search\x18\x13 \x01(\t\x12\x16\n\x0e\x63ontext_locale\x18\x14 \x01(\t\x12\x1a\n\x12\x63ontext_user_agent\x18\x15 \x01(\t\x12\r\n\x05label\x18\x16 \x01(\t\x12\x1a\n\x08\x63ommands\x18\x17 \x03(\x0b\x32\x08.Command\x12\x11\n\texec_time\x18\x18 \x01(\x03\x12\x11\n\tprep_time\x18\x19 \x01(\x03\x12\x0e\n\x06\x63onfig\x18\x1a \x03(\t\x12\x1a\n\x12uncaught_exception\x18\x1b \x01(\t\x12\x14\n\x0c\x61ttributions\x18\x1c \x03(\t\x12\n\n\x02os\x18\x1d \x01(\t\x12\x10\n\x08timezone\x18\x1e \x01(\t\x12\x10\n\x08headless\x18\x1f \x01(\x08\x12\x17\n\x0fis_fragment_run\x18 \x01(\x08\x12\x10\n\x08numPages\x18\" \x01(\x03\x12\x18\n\x10page_script_hash\x18% \x01(\t\x12\x14\n\x0c\x61\x63tive_theme\x18& \x01(\t\x12\x17\n\x0ftotal_load_time\x18\' \x01(\x03\x12\"\n\x0c\x62rowser_info\x18( \x01(\x0b\x32\x0c.BrowserInfo\"]\n\x0b\x42rowserInfo\x12\x14\n\x0c\x62rowser_name\x18\x01 \x01(\t\x12\x17\n\x0f\x62rowser_version\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65vice_type\x18\x03 \x01(\t\x12\n\n\x02os\x18\x04 \x01(\tB1\n\x1c\x63om.snowflake.apps.streamlitB\x11MetricsEventProtob\x06proto3')
|
19
19
|
|
20
20
|
_globals = globals()
|
21
21
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -24,7 +24,7 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
24
24
|
_globals['DESCRIPTOR']._loaded_options = None
|
25
25
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\021MetricsEventProto'
|
26
26
|
_globals['_METRICSEVENT']._serialized_start=74
|
27
|
-
_globals['_METRICSEVENT']._serialized_end=
|
28
|
-
_globals['_BROWSERINFO']._serialized_start=
|
29
|
-
_globals['_BROWSERINFO']._serialized_end=
|
27
|
+
_globals['_METRICSEVENT']._serialized_end=1033
|
28
|
+
_globals['_BROWSERINFO']._serialized_start=1035
|
29
|
+
_globals['_BROWSERINFO']._serialized_end=1128
|
30
30
|
# @@protoc_insertion_point(module_scope)
|
@@ -45,6 +45,9 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
45
45
|
APP_ID_FIELD_NUMBER: builtins.int
|
46
46
|
SESSION_ID_FIELD_NUMBER: builtins.int
|
47
47
|
PYTHON_VERSION_FIELD_NUMBER: builtins.int
|
48
|
+
SERVER_OS_FIELD_NUMBER: builtins.int
|
49
|
+
HAS_DISPLAY_FIELD_NUMBER: builtins.int
|
50
|
+
IS_WEBDRIVER_FIELD_NUMBER: builtins.int
|
48
51
|
HOSTED_AT_FIELD_NUMBER: builtins.int
|
49
52
|
OWNER_FIELD_NUMBER: builtins.int
|
50
53
|
REPO_FIELD_NUMBER: builtins.int
|
@@ -87,6 +90,9 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
87
90
|
app_id: builtins.str
|
88
91
|
session_id: builtins.str
|
89
92
|
python_version: builtins.str
|
93
|
+
server_os: builtins.str
|
94
|
+
has_display: builtins.bool
|
95
|
+
is_webdriver: builtins.bool
|
90
96
|
hosted_at: builtins.str
|
91
97
|
"""Host tracking fields:"""
|
92
98
|
owner: builtins.str
|
@@ -143,6 +149,9 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
143
149
|
app_id: builtins.str = ...,
|
144
150
|
session_id: builtins.str = ...,
|
145
151
|
python_version: builtins.str = ...,
|
152
|
+
server_os: builtins.str = ...,
|
153
|
+
has_display: builtins.bool = ...,
|
154
|
+
is_webdriver: builtins.bool = ...,
|
146
155
|
hosted_at: builtins.str = ...,
|
147
156
|
owner: builtins.str = ...,
|
148
157
|
repo: builtins.str = ...,
|
@@ -174,7 +183,7 @@ class MetricsEvent(google.protobuf.message.Message):
|
|
174
183
|
browser_info: global___BrowserInfo | None = ...,
|
175
184
|
) -> None: ...
|
176
185
|
def HasField(self, field_name: typing.Literal["browser_info", b"browser_info"]) -> builtins.bool: ...
|
177
|
-
def ClearField(self, field_name: typing.Literal["active_theme", b"active_theme", "anonymous_id", b"anonymous_id", "app_id", b"app_id", "attributions", b"attributions", "branch", b"branch", "browser_info", b"browser_info", "commands", b"commands", "config", b"config", "context_locale", b"context_locale", "context_page_path", b"context_page_path", "context_page_referrer", b"context_page_referrer", "context_page_search", b"context_page_search", "context_page_title", b"context_page_title", "context_page_url", b"context_page_url", "context_user_agent", b"context_user_agent", "creator_id", b"creator_id", "dev", b"dev", "event", b"event", "exec_time", b"exec_time", "headless", b"headless", "hosted_at", b"hosted_at", "is_fragment_run", b"is_fragment_run", "is_hello", b"is_hello", "label", b"label", "machine_id_v3", b"machine_id_v3", "machine_id_v4", b"machine_id_v4", "main_module", b"main_module", "numPages", b"numPages", "os", b"os", "owner", b"owner", "page_script_hash", b"page_script_hash", "prep_time", b"prep_time", "python_version", b"python_version", "repo", b"repo", "report_hash", b"report_hash", "session_id", b"session_id", "source", b"source", "streamlit_version", b"streamlit_version", "timezone", b"timezone", "total_load_time", b"total_load_time", "uncaught_exception", b"uncaught_exception"]) -> None: ...
|
186
|
+
def ClearField(self, field_name: typing.Literal["active_theme", b"active_theme", "anonymous_id", b"anonymous_id", "app_id", b"app_id", "attributions", b"attributions", "branch", b"branch", "browser_info", b"browser_info", "commands", b"commands", "config", b"config", "context_locale", b"context_locale", "context_page_path", b"context_page_path", "context_page_referrer", b"context_page_referrer", "context_page_search", b"context_page_search", "context_page_title", b"context_page_title", "context_page_url", b"context_page_url", "context_user_agent", b"context_user_agent", "creator_id", b"creator_id", "dev", b"dev", "event", b"event", "exec_time", b"exec_time", "has_display", b"has_display", "headless", b"headless", "hosted_at", b"hosted_at", "is_fragment_run", b"is_fragment_run", "is_hello", b"is_hello", "is_webdriver", b"is_webdriver", "label", b"label", "machine_id_v3", b"machine_id_v3", "machine_id_v4", b"machine_id_v4", "main_module", b"main_module", "numPages", b"numPages", "os", b"os", "owner", b"owner", "page_script_hash", b"page_script_hash", "prep_time", b"prep_time", "python_version", b"python_version", "repo", b"repo", "report_hash", b"report_hash", "server_os", b"server_os", "session_id", b"session_id", "source", b"source", "streamlit_version", b"streamlit_version", "timezone", b"timezone", "total_load_time", b"total_load_time", "uncaught_exception", b"uncaught_exception"]) -> None: ...
|
178
187
|
|
179
188
|
global___MetricsEvent = MetricsEvent
|
180
189
|
|
@@ -16,7 +16,7 @@ from streamlit.proto import AppPage_pb2 as streamlit_dot_proto_dot_AppPage__pb2
|
|
16
16
|
from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_SessionStatus__pb2
|
17
17
|
|
18
18
|
|
19
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\xb6\x07\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x14\n\x0cheading_font\x18\x0c \x01(\t\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\x12\x18\n\x0b\x62\x61se_radius\x18\x12 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62order_color\x18\x13 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12show_widget_border\x18\x14 \x01(\x08H\x02\x88\x01\x01\x12\x17\n\nlink_color\x18\x15 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x04\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x05\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x06\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\x07\x88\x01\x01\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\x42\x0e\n\x0c_base_radiusB\x0f\n\r_border_colorB\x15\n\x13_show_widget_borderB\r\n\x0b_link_colorB\x11\n\x0f_base_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_color\"F\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x0e\n\x06weight\x18\x03 \x01(\x05\x12\r\n\x05style\x18\x04 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"a\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\t\x12\x1a\n\x12installation_id_v4\x18\x06 \x01(\tJ\x04\x08\x02\x10\x03\"
|
19
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\xb6\x07\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x14\n\x0cheading_font\x18\x0c \x01(\t\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\x12\x18\n\x0b\x62\x61se_radius\x18\x12 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62order_color\x18\x13 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12show_widget_border\x18\x14 \x01(\x08H\x02\x88\x01\x01\x12\x17\n\nlink_color\x18\x15 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x04\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x05\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x06\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\x07\x88\x01\x01\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\x42\x0e\n\x0c_base_radiusB\x0f\n\r_border_colorB\x15\n\x13_show_widget_borderB\r\n\x0b_link_colorB\x11\n\x0f_base_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_color\"F\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x0e\n\x06weight\x18\x03 \x01(\x05\x12\r\n\x05style\x18\x04 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"a\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\t\x12\x1a\n\x12installation_id_v4\x18\x06 \x01(\tJ\x04\x08\x02\x10\x03\"l\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\t\x12\x11\n\tserver_os\x18\x03 \x01(\t\x12\x13\n\x0bhas_display\x18\x04 \x01(\x08\x42/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
|
20
20
|
|
21
21
|
_globals = globals()
|
22
22
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -47,5 +47,5 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
47
47
|
_globals['_USERINFO']._serialized_start=2044
|
48
48
|
_globals['_USERINFO']._serialized_end=2141
|
49
49
|
_globals['_ENVIRONMENTINFO']._serialized_start=2143
|
50
|
-
_globals['_ENVIRONMENTINFO']._serialized_end=
|
50
|
+
_globals['_ENVIRONMENTINFO']._serialized_end=2251
|
51
51
|
# @@protoc_insertion_point(module_scope)
|
@@ -485,14 +485,29 @@ class EnvironmentInfo(google.protobuf.message.Message):
|
|
485
485
|
|
486
486
|
STREAMLIT_VERSION_FIELD_NUMBER: builtins.int
|
487
487
|
PYTHON_VERSION_FIELD_NUMBER: builtins.int
|
488
|
+
SERVER_OS_FIELD_NUMBER: builtins.int
|
489
|
+
HAS_DISPLAY_FIELD_NUMBER: builtins.int
|
488
490
|
streamlit_version: builtins.str
|
489
491
|
python_version: builtins.str
|
492
|
+
server_os: builtins.str
|
493
|
+
"""The name of the OS. Typically "windows", "mac", "linux",
|
494
|
+
but can take other values like "ios", "android", "freebsd8".
|
495
|
+
See https://docs.python.org/3/library/sys.html#sys.platform
|
496
|
+
"""
|
497
|
+
has_display: builtins.bool
|
498
|
+
"""True if Linux/BSD and DISPLAY or WAYLAND_DISPLAY environment variables are
|
499
|
+
set. This is used so we can tell when Streamlit is being executed in order
|
500
|
+
to develop the app (has_display = true) or to serve the app (has_display =
|
501
|
+
false).
|
502
|
+
"""
|
490
503
|
def __init__(
|
491
504
|
self,
|
492
505
|
*,
|
493
506
|
streamlit_version: builtins.str = ...,
|
494
507
|
python_version: builtins.str = ...,
|
508
|
+
server_os: builtins.str = ...,
|
509
|
+
has_display: builtins.bool = ...,
|
495
510
|
) -> None: ...
|
496
|
-
def ClearField(self, field_name: typing.Literal["python_version", b"python_version", "streamlit_version", b"streamlit_version"]) -> None: ...
|
511
|
+
def ClearField(self, field_name: typing.Literal["has_display", b"has_display", "python_version", b"python_version", "server_os", b"server_os", "streamlit_version", b"streamlit_version"]) -> None: ...
|
497
512
|
|
498
513
|
global___EnvironmentInfo = EnvironmentInfo
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: streamlit/proto/WidthConfig.proto
|
4
|
+
# Protobuf Python Version: 5.26.1
|
5
|
+
"""Generated protocol buffer code."""
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
9
|
+
from google.protobuf.internal import builder as _builder
|
10
|
+
# @@protoc_insertion_point(imports)
|
11
|
+
|
12
|
+
_sym_db = _symbol_database.Default()
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/WidthConfig.proto\x12\tstreamlit\"`\n\x0bWidthConfig\x12\x15\n\x0buse_stretch\x18\x01 \x01(\x08H\x00\x12\x15\n\x0buse_content\x18\x02 \x01(\x08H\x00\x12\x15\n\x0bpixel_width\x18\x03 \x01(\rH\x00\x42\x0c\n\nwidth_specB+\n\x1c\x63om.snowflake.apps.streamlitB\x0bLayoutProtob\x06proto3')
|
18
|
+
|
19
|
+
_globals = globals()
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.WidthConfig_pb2', _globals)
|
22
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
23
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
24
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\013LayoutProto'
|
25
|
+
_globals['_WIDTHCONFIG']._serialized_start=48
|
26
|
+
_globals['_WIDTHCONFIG']._serialized_end=144
|
27
|
+
# @@protoc_insertion_point(module_scope)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"""
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
3
|
+
isort:skip_file
|
4
|
+
Common layout-related enums and messages that can be reused across different elements."""
|
5
|
+
|
6
|
+
import builtins
|
7
|
+
import google.protobuf.descriptor
|
8
|
+
import google.protobuf.message
|
9
|
+
import typing
|
10
|
+
|
11
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
12
|
+
|
13
|
+
@typing.final
|
14
|
+
class WidthConfig(google.protobuf.message.Message):
|
15
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
16
|
+
|
17
|
+
USE_STRETCH_FIELD_NUMBER: builtins.int
|
18
|
+
USE_CONTENT_FIELD_NUMBER: builtins.int
|
19
|
+
PIXEL_WIDTH_FIELD_NUMBER: builtins.int
|
20
|
+
use_stretch: builtins.bool
|
21
|
+
use_content: builtins.bool
|
22
|
+
pixel_width: builtins.int
|
23
|
+
def __init__(
|
24
|
+
self,
|
25
|
+
*,
|
26
|
+
use_stretch: builtins.bool = ...,
|
27
|
+
use_content: builtins.bool = ...,
|
28
|
+
pixel_width: builtins.int = ...,
|
29
|
+
) -> None: ...
|
30
|
+
def HasField(self, field_name: typing.Literal["pixel_width", b"pixel_width", "use_content", b"use_content", "use_stretch", b"use_stretch", "width_spec", b"width_spec"]) -> builtins.bool: ...
|
31
|
+
def ClearField(self, field_name: typing.Literal["pixel_width", b"pixel_width", "use_content", b"use_content", "use_stretch", b"use_stretch", "width_spec", b"width_spec"]) -> None: ...
|
32
|
+
def WhichOneof(self, oneof_group: typing.Literal["width_spec", b"width_spec"]) -> typing.Literal["use_stretch", "use_content", "pixel_width"] | None: ...
|
33
|
+
|
34
|
+
global___WidthConfig = WidthConfig
|
streamlit/runtime/app_session.py
CHANGED
@@ -16,6 +16,7 @@ from __future__ import annotations
|
|
16
16
|
|
17
17
|
import asyncio
|
18
18
|
import json
|
19
|
+
import os
|
19
20
|
import sys
|
20
21
|
import uuid
|
21
22
|
from enum import Enum
|
@@ -24,7 +25,7 @@ from typing import TYPE_CHECKING, Callable, Final
|
|
24
25
|
from google.protobuf.json_format import ParseDict
|
25
26
|
|
26
27
|
import streamlit.elements.exception as exception_utils
|
27
|
-
from streamlit import config, runtime
|
28
|
+
from streamlit import config, env_util, runtime
|
28
29
|
from streamlit.logger import get_logger
|
29
30
|
from streamlit.proto.ClientState_pb2 import ClientState
|
30
31
|
from streamlit.proto.Common_pb2 import FileURLs, FileURLsRequest
|
@@ -742,6 +743,10 @@ class AppSession:
|
|
742
743
|
|
743
744
|
imsg.environment_info.streamlit_version = STREAMLIT_VERSION_STRING
|
744
745
|
imsg.environment_info.python_version = ".".join(map(str, sys.version_info))
|
746
|
+
imsg.environment_info.server_os = env_util.SYSTEM
|
747
|
+
imsg.environment_info.has_display = (
|
748
|
+
"DISPLAY" in os.environ or "WAYLAND_DISPLAY" in os.environ
|
749
|
+
)
|
745
750
|
|
746
751
|
imsg.session_status.run_on_save = self._run_on_save
|
747
752
|
imsg.session_status.script_is_running = (
|
streamlit/runtime/context.py
CHANGED
@@ -20,6 +20,7 @@ from types import MappingProxyType
|
|
20
20
|
from typing import TYPE_CHECKING, Any, cast
|
21
21
|
|
22
22
|
from streamlit import runtime
|
23
|
+
from streamlit.runtime.context_util import maybe_add_page_path, maybe_trim_page_path
|
23
24
|
from streamlit.runtime.metrics_util import gather_metrics
|
24
25
|
from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
|
25
26
|
|
@@ -302,17 +303,66 @@ class ContextProxy:
|
|
302
303
|
@property
|
303
304
|
@gather_metrics("context.url")
|
304
305
|
def url(self) -> str | None:
|
305
|
-
"""The URL of the user browser
|
306
|
+
"""The read-only URL of the app in the user's browser.
|
307
|
+
|
308
|
+
``st.context.url`` returns the URL through which the user is accessing
|
309
|
+
the app. This includes the scheme, domain name, port, and path. If
|
310
|
+
query parameters or anchors are present in the URL, they are removed
|
311
|
+
and not included in this value.
|
312
|
+
|
313
|
+
Example
|
314
|
+
-------
|
315
|
+
Conditionally show content when you access your app through
|
316
|
+
``localhost``:
|
317
|
+
|
318
|
+
>>> import streamlit as st
|
319
|
+
>>>
|
320
|
+
>>> if st.context.url.startswith("http://localhost"):
|
321
|
+
>>> st.write("You are running the app locally.")
|
322
|
+
"""
|
306
323
|
ctx = get_script_run_ctx()
|
307
324
|
if ctx is None or ctx.context_info is None:
|
308
325
|
return None
|
309
|
-
|
326
|
+
|
327
|
+
url_from_frontend = ctx.context_info.url
|
328
|
+
url_without_page_prefix = maybe_trim_page_path(
|
329
|
+
url_from_frontend, ctx.pages_manager
|
330
|
+
)
|
331
|
+
url_with_page_prefix = maybe_add_page_path(
|
332
|
+
url_without_page_prefix, ctx.pages_manager
|
333
|
+
)
|
334
|
+
|
335
|
+
return url_with_page_prefix
|
310
336
|
|
311
337
|
@property
|
312
338
|
@gather_metrics("context.ip_address")
|
313
339
|
def ip_address(self) -> str | None:
|
314
340
|
"""The read-only IP address of the user's connection.
|
315
|
-
|
341
|
+
|
342
|
+
This should not be used for security measures because it can easily be
|
343
|
+
spoofed. When a user accesses the app through ``localhost``, the IP
|
344
|
+
address is ``None``. Otherwise, the IP address is determined from the
|
345
|
+
|remote_ip|_ attribute of the Tornado request object and may be an
|
346
|
+
IPv4 or IPv6 address.
|
347
|
+
|
348
|
+
.. |remote_ip| replace:: ``remote_ip``
|
349
|
+
.. _remote_ip: https://www.tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest.remote_ip
|
350
|
+
|
351
|
+
Example
|
352
|
+
-------
|
353
|
+
Check if the user has an IPv4 or IPv6 address:
|
354
|
+
|
355
|
+
>>> import streamlit as st
|
356
|
+
>>>
|
357
|
+
>>> ip = st.context.ip_address
|
358
|
+
>>> if ip is None:
|
359
|
+
>>> st.write("No IP address. This is expected in local development.")
|
360
|
+
>>> elif ip.contains(":"):
|
361
|
+
>>> st.write("You have an IPv6 address.")
|
362
|
+
>>> elif ip.contains("."):
|
363
|
+
>>> st.write("You have an IPv4 address.")
|
364
|
+
>>> else:
|
365
|
+
>>> st.error("This should not happen.")
|
316
366
|
"""
|
317
367
|
session_client_request = _get_request()
|
318
368
|
if session_client_request is not None:
|
@@ -325,7 +375,25 @@ class ContextProxy:
|
|
325
375
|
@property
|
326
376
|
@gather_metrics("context.is_embedded")
|
327
377
|
def is_embedded(self) -> bool | None:
|
328
|
-
"""Whether the app is embedded.
|
378
|
+
"""Whether the app is embedded.
|
379
|
+
|
380
|
+
This property returns a boolean value indicating whether the app is
|
381
|
+
running in an embedded context. This is determined by the presence of
|
382
|
+
``embed=true`` as a query parameter in the URL. This is the only way to
|
383
|
+
determine if the app is currently configured for embedding because
|
384
|
+
embedding settings are not accessible through ``st.query_params`` or
|
385
|
+
``st.context.url``.
|
386
|
+
|
387
|
+
Example
|
388
|
+
-------
|
389
|
+
Conditionally show content when the app is running in an embedded
|
390
|
+
context:
|
391
|
+
|
392
|
+
>>> import streamlit as st
|
393
|
+
>>>
|
394
|
+
>>> if st.context.is_embedded:
|
395
|
+
>>> st.write("You are running the app in an embedded context.")
|
396
|
+
"""
|
329
397
|
ctx = get_script_run_ctx()
|
330
398
|
if ctx is None or ctx.context_info is None:
|
331
399
|
return None
|
@@ -0,0 +1,49 @@
|
|
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
|
+
from __future__ import annotations
|
16
|
+
|
17
|
+
from typing import TYPE_CHECKING
|
18
|
+
|
19
|
+
if TYPE_CHECKING:
|
20
|
+
from streamlit.runtime.pages_manager import PagesManager
|
21
|
+
from streamlit.source_util import PageInfo
|
22
|
+
|
23
|
+
|
24
|
+
def maybe_trim_page_path(url: str, page_manager: PagesManager) -> str:
|
25
|
+
"""Trim the page path from the URL if it exists."""
|
26
|
+
url = url.removesuffix("/")
|
27
|
+
|
28
|
+
for page in page_manager.get_pages().values():
|
29
|
+
page_url = page.get("url_pathname", "")
|
30
|
+
if page_url and url.endswith(page_url):
|
31
|
+
return url.removesuffix(page_url)
|
32
|
+
|
33
|
+
return url
|
34
|
+
|
35
|
+
|
36
|
+
def maybe_add_page_path(url: str, page_manager: PagesManager) -> str:
|
37
|
+
"""Add the page path to the URL if it exists."""
|
38
|
+
url = url.removesuffix("/")
|
39
|
+
|
40
|
+
current_page_script_hash = page_manager.current_page_script_hash
|
41
|
+
current_page_info: PageInfo | None = page_manager.get_pages().get(
|
42
|
+
current_page_script_hash, None
|
43
|
+
)
|
44
|
+
if current_page_info is not None:
|
45
|
+
page_url = current_page_info.get("url_pathname", "")
|
46
|
+
if page_url:
|
47
|
+
return f"{url}/{page_url}"
|
48
|
+
|
49
|
+
return url
|
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.BJXqcYGa.js"></script>
|
55
55
|
<link rel="stylesheet" crossorigin href="./static/css/index.DqDwtg6_.css">
|
56
56
|
</head>
|
57
57
|
<body>
|
@@ -1 +1 @@
|
|
1
|
-
import{r,E as a,_ as n}from"./index.
|
1
|
+
import{r,E as a,_ as n}from"./index.BJXqcYGa.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(a,n({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i as E};
|
@@ -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.BJXqcYGa.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};
|