@rustic-ai/ui-components 0.0.19 → 0.0.21
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.
- package/dist/components/calendar/fCCalendar.d.ts +8 -2
- package/dist/components/calendar/fCCalendar.d.ts.map +1 -1
- package/dist/components/calendar/index.css +21 -0
- package/dist/components/calendar/index.d.ts +5 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/codeSnippet/index.css +14 -0
- package/dist/components/codeSnippet/index.d.ts +5 -0
- package/dist/components/codeSnippet/index.d.ts.map +1 -0
- package/dist/components/codeSnippet/index.js +1 -0
- package/dist/components/elementRenderer/elementRenderer.d.ts +2 -2
- package/dist/components/elementRenderer/elementRenderer.d.ts.map +1 -1
- package/dist/components/elementRenderer/index.d.ts +3 -0
- package/dist/components/elementRenderer/index.d.ts.map +1 -0
- package/dist/components/elementRenderer/index.js +1 -0
- package/dist/components/image/index.css +43 -0
- package/dist/components/image/index.d.ts +5 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/baseInput/baseInput.d.ts.map +1 -1
- package/dist/components/input/emoji/index.css +16 -0
- package/dist/components/input/emoji/index.d.ts +4 -0
- package/dist/components/input/emoji/index.d.ts.map +1 -0
- package/dist/components/input/emoji/index.js +1 -0
- package/dist/components/input/multimodal/multimodalInput/index.css +227 -0
- package/dist/components/input/multimodal/multimodalInput/index.d.ts +5 -0
- package/dist/components/input/multimodal/multimodalInput/index.d.ts.map +1 -0
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -0
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts +8 -1
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
- package/dist/components/input/multimodal/uploader/index.css +145 -0
- package/dist/components/input/multimodal/uploader/index.d.ts +5 -0
- package/dist/components/input/multimodal/uploader/index.d.ts.map +1 -0
- package/dist/components/input/multimodal/uploader/index.js +1 -0
- package/dist/components/input/textInput/index.css +57 -0
- package/dist/components/input/textInput/index.d.ts +4 -0
- package/dist/components/input/textInput/index.d.ts.map +1 -0
- package/dist/components/input/textInput/index.js +1 -0
- package/dist/components/input/textInput/textInput.d.ts +0 -3
- package/dist/components/input/textInput/textInput.d.ts.map +1 -1
- package/dist/components/map/index.css +13 -0
- package/dist/components/map/index.d.ts +5 -0
- package/dist/components/map/index.d.ts.map +1 -0
- package/dist/components/map/index.js +1 -0
- package/dist/components/map/openLayersMap.d.ts +6 -1
- package/dist/components/map/openLayersMap.d.ts.map +1 -1
- package/dist/components/markdown/index.d.ts +6 -0
- package/dist/components/markdown/index.d.ts.map +1 -0
- package/dist/components/markdown/index.js +1 -0
- package/dist/components/markdown/markedMarkdown.d.ts +7 -1
- package/dist/components/markdown/markedMarkdown.d.ts.map +1 -1
- package/dist/components/media/audio/index.css +182 -0
- package/dist/components/media/audio/index.d.ts +5 -0
- package/dist/components/media/audio/index.d.ts.map +1 -0
- package/dist/components/media/audio/index.js +1 -0
- package/dist/components/media/video/index.css +225 -0
- package/dist/components/media/video/index.d.ts +5 -0
- package/dist/components/media/video/index.d.ts.map +1 -0
- package/dist/components/media/video/index.js +1 -0
- package/dist/components/menu/index.css +26 -0
- package/dist/components/menu/index.d.ts +4 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/messageCanvas/actions/action.d.ts +12 -0
- package/dist/components/messageCanvas/actions/action.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts +2 -2
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/copy/index.css +8 -0
- package/dist/components/messageCanvas/actions/copy/index.d.ts +3 -0
- package/dist/components/messageCanvas/actions/copy/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/copy/index.js +1 -0
- package/dist/components/messageCanvas/actions/index.css +4 -0
- package/dist/components/messageCanvas/actions/index.d.ts +4 -11
- package/dist/components/messageCanvas/actions/index.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/index.js +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.css +8 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts +3 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts +2 -2
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts.map +1 -1
- package/dist/components/messageCanvas/index.css +39 -0
- package/dist/components/messageCanvas/index.d.ts +4 -0
- package/dist/components/messageCanvas/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/index.js +1 -0
- package/dist/components/messageCanvas/messageCanvas.d.ts +5 -5
- package/dist/components/messageCanvas/messageCanvas.d.ts.map +1 -1
- package/dist/components/messageSpace/index.css +63 -0
- package/dist/components/messageSpace/index.d.ts +4 -0
- package/dist/components/messageSpace/index.d.ts.map +1 -0
- package/dist/components/messageSpace/index.js +1 -0
- package/dist/components/messageSpace/messageSpace.d.ts +6 -3
- package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
- package/dist/components/mockWebSocket.d.ts +5 -0
- package/dist/components/mockWebSocket.d.ts.map +1 -0
- package/dist/components/multipart/index.css +134 -0
- package/dist/components/multipart/index.d.ts +5 -0
- package/dist/components/multipart/index.d.ts.map +1 -0
- package/dist/components/multipart/index.js +1 -0
- package/dist/components/multipart/multipart.d.ts +2 -2
- package/dist/components/multipart/multipart.d.ts.map +1 -1
- package/dist/components/participantsContainer/index.css +42 -0
- package/dist/components/participantsContainer/index.d.ts +5 -0
- package/dist/components/participantsContainer/index.d.ts.map +1 -0
- package/dist/components/participantsContainer/index.js +1 -0
- package/dist/components/participantsContainer/participantsContainer.d.ts +14 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts.map +1 -1
- package/dist/components/pdfViewer/index.css +60 -0
- package/dist/components/pdfViewer/index.d.ts +5 -0
- package/dist/components/pdfViewer/index.d.ts.map +1 -0
- package/dist/components/pdfViewer/index.js +1 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts +4 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts.map +1 -1
- package/dist/components/promptBuilder/index.css +96 -0
- package/dist/components/promptBuilder/index.d.ts +5 -0
- package/dist/components/promptBuilder/index.d.ts.map +1 -0
- package/dist/components/promptBuilder/index.js +1 -0
- package/dist/components/promptBuilder/promptBuilder.d.ts +24 -0
- package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -0
- package/dist/components/question/index.css +14 -0
- package/dist/components/question/index.d.ts +5 -0
- package/dist/components/question/index.d.ts.map +1 -0
- package/dist/components/question/index.js +1 -0
- package/dist/components/question/question.d.ts +7 -1
- package/dist/components/question/question.d.ts.map +1 -1
- package/dist/components/table/index.css +43 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/text/index.css +5 -0
- package/dist/components/text/index.d.ts +7 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +1 -0
- package/dist/components/text/text.d.ts +7 -1
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/timestamp/index.d.ts +3 -0
- package/dist/components/timestamp/index.d.ts.map +1 -0
- package/dist/components/timestamp/index.js +1 -0
- package/dist/components/types.d.ts +20 -50
- package/dist/components/types.d.ts.map +1 -1
- package/dist/components/video/index.css +34 -0
- package/dist/components/video/index.d.ts +3 -0
- package/dist/components/video/index.d.ts.map +1 -0
- package/dist/components/video/index.js +1 -0
- package/dist/components/video/youtubeVideo.d.ts +8 -1
- package/dist/components/video/youtubeVideo.d.ts.map +1 -1
- package/dist/components/visualization/chart/index.css +44 -0
- package/dist/components/visualization/chart/index.d.ts +4 -0
- package/dist/components/visualization/chart/index.d.ts.map +1 -0
- package/dist/components/visualization/chart/index.js +1 -0
- package/dist/components/visualization/chart/rechartsTimeSeries.d.ts +8 -1
- package/dist/components/visualization/chart/rechartsTimeSeries.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/index.css +21 -0
- package/dist/components/visualization/mermaidViz/index.d.ts +5 -0
- package/dist/components/visualization/mermaidViz/index.d.ts.map +1 -0
- package/dist/components/visualization/mermaidViz/index.js +1 -0
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts +9 -2
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts +10 -0
- package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts.map +1 -0
- package/dist/components/visualization/perspectiveViz/index.css +16 -0
- package/dist/components/visualization/perspectiveViz/index.d.ts +5 -0
- package/dist/components/visualization/perspectiveViz/index.d.ts.map +1 -0
- package/dist/components/visualization/perspectiveViz/index.js +1 -0
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts +7 -4
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/index.css +45 -0
- package/dist/components/visualization/vegaLiteViz/index.d.ts +5 -0
- package/dist/components/visualization/vegaLiteViz/index.d.ts.map +1 -0
- package/dist/components/visualization/vegaLiteViz/index.js +1 -0
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts +9 -2
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts +20 -0
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts.map +1 -0
- package/dist/components/weather/index.css +77 -0
- package/dist/components/weather/index.d.ts +5 -0
- package/dist/components/weather/index.d.ts.map +1 -0
- package/dist/components/weather/index.js +1 -0
- package/dist/index.css +62 -0
- package/dist/index.js +1 -2
- package/dist/rusticTheme.d.ts +29 -0
- package/dist/rusticTheme.d.ts.map +1 -1
- package/dist/rusticTheme.js +1 -0
- package/package.json +123 -22
- package/dist/index.js.LICENSE.txt +0 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
.rustic-video {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rustic-video-loading-spinner {
|
|
6
|
+
position: absolute;
|
|
7
|
+
left: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
margin: auto;
|
|
12
|
+
width: 40px;
|
|
13
|
+
height: 40px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.rustic-video-screen .rustic-control-error {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
margin: 16px;
|
|
21
|
+
z-index: 1000;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.rustic-video-screen {
|
|
25
|
+
position: relative;
|
|
26
|
+
/* helps center video when in fullscreen mode */
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.rustic-video-element {
|
|
33
|
+
object-fit: cover;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.rustic-video-title,
|
|
38
|
+
.rustic-video-controls {
|
|
39
|
+
transition: 0.2s ease-in-out;
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rustic-video-title {
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 0;
|
|
46
|
+
padding: 16px;
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
align-items: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.rustic-video-controls {
|
|
53
|
+
position: absolute;
|
|
54
|
+
bottom: 0;
|
|
55
|
+
padding: 16px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.rustic-video-top-controls {
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
align-items: center;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.rustic-video-bottom-controls {
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rustic-video-bottom-controls-left {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.rustic-video-bottom-controls-right {
|
|
76
|
+
display: flex;
|
|
77
|
+
gap: 8px;
|
|
78
|
+
justify-content: space-between;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.rustic-time-controls {
|
|
82
|
+
display: flex;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@media (max-width: 900px) {
|
|
86
|
+
.rustic-video-screen {
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.rustic-video-controls-mobile-preview {
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.rustic-video-bottom-controls-left {
|
|
97
|
+
gap: 8px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.rustic-progress {
|
|
102
|
+
display: flex;
|
|
103
|
+
gap: 24px;
|
|
104
|
+
align-items: center;
|
|
105
|
+
position: relative;
|
|
106
|
+
width: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.rustic-progress-slider {
|
|
110
|
+
height: 8px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* circle that you drag on slider to change the time */
|
|
114
|
+
.rustic-progress-slider .MuiSlider-thumb {
|
|
115
|
+
z-index: 2;
|
|
116
|
+
width: 15px;
|
|
117
|
+
height: 15px;
|
|
118
|
+
}
|
|
119
|
+
/* bar to the left of the thumb (circle), tracking the time */
|
|
120
|
+
.rustic-progress-slider .MuiSlider-track {
|
|
121
|
+
z-index: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.rustic-progress-buffered {
|
|
125
|
+
height: 8px;
|
|
126
|
+
position: absolute;
|
|
127
|
+
border-radius: 12px;
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rustic-volume-settings {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.rustic-volume-slider {
|
|
137
|
+
transition: 0.2s ease-in-out;
|
|
138
|
+
width: 0px;
|
|
139
|
+
height: 5px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* circle that you drag on slider to change the volume */
|
|
143
|
+
.rustic-volume-slider .MuiSlider-thumb {
|
|
144
|
+
width: 10px;
|
|
145
|
+
height: 10px;
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* slider thumb appears on hover or focus */
|
|
150
|
+
.rustic-volume-settings:hover .MuiSlider-thumb,
|
|
151
|
+
.rustic-volume-settings:focus-within .MuiSlider-thumb {
|
|
152
|
+
display: unset;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.rustic-transcript-toggle span {
|
|
156
|
+
line-height: 1.5;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.rustic-playback-rate-button {
|
|
160
|
+
min-width: 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@media (min-width: 900px) {
|
|
164
|
+
/* slider appears on hover or focus */
|
|
165
|
+
.rustic-volume-settings:hover .rustic-volume-slider,
|
|
166
|
+
.rustic-volume-settings:focus-within .rustic-volume-slider {
|
|
167
|
+
width: 64px;
|
|
168
|
+
margin-inline: 8px;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@media (max-width: 900px) {
|
|
173
|
+
.rustic-progress {
|
|
174
|
+
padding-inline: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.rustic-progress-buffered {
|
|
178
|
+
left: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.rustic-volume-settings {
|
|
182
|
+
gap: 8px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.rustic-volume-slider {
|
|
186
|
+
width: 100%;
|
|
187
|
+
margin-right: 24px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.rustic-volume-settings .MuiSlider-thumb {
|
|
191
|
+
display: unset;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
span.rustic-icon-large {
|
|
196
|
+
font-size: 32px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.rustic-time-display {
|
|
200
|
+
margin-left: 8px;
|
|
201
|
+
min-width: fit-content;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@media (max-width: 900px) {
|
|
205
|
+
.rustic-time-container {
|
|
206
|
+
display: flex;
|
|
207
|
+
justify-content: space-between;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.rustic-transcript-container {
|
|
212
|
+
display: flex;
|
|
213
|
+
gap: 16px;
|
|
214
|
+
margin-top: 16px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.rustic-transcript-container hr {
|
|
218
|
+
border-right-width: medium;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.rustic-transcript-content {
|
|
222
|
+
max-height: 25vh;
|
|
223
|
+
overflow-y: scroll;
|
|
224
|
+
}
|
|
225
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/media/video/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,cAAc,aAAa,CAAA;AAC3B,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["@rustic-ai/ui-components"]=n():e["@rustic-ai/ui-components"]=n()}(global,(()=>(()=>{"use strict";var e={n:n=>{var r=n&&n.__esModule?()=>n.default:()=>n;return e.d(r,{a:r}),r},d:(n,r)=>{for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>H});const r=require("react/jsx-runtime"),t=require("@mui/material"),i=require("@mui/material/Alert");var a=e.n(i);const o=require("@mui/material/CircularProgress");var c=e.n(o);const l=require("@mui/material/Typography");var s=e.n(l);const u=require("@mui/system"),m=require("react"),d=require("@mui/material/Box");var f=e.n(d);const p=require("@mui/material/Button");var v=e.n(p);const x=require("@mui/material/LinearProgress");var E=e.n(x);const b=require("@mui/material/Slider");var y=e.n(b);const j=require("@mui/material/Tooltip");var h,g=e.n(j);function N(e){var n=Math.floor(e/3600),r=Math.floor(e%3600/60),t=Math.floor(e%60),i=n>0?"".concat(n,":"):"",a="".concat(n>0?r.toString().padStart(2,"0"):r),o=t.toString().padStart(2,"0");return"".concat(i).concat(a,":").concat(o)}function S(e){return e.name.replaceAll("_","-"),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}require("pluralize"),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(h||(h={}));const T=require("@mui/material/IconButton");var k=e.n(T);function _(e){var n,t={play:{symbol:"play_circle",label:"Play"},pause:{symbol:"pause_circle",label:"Pause"},forward:{symbol:"forward_10",label:"Forward ten seconds"},replay:{symbol:"replay_10",label:"Replay ten seconds"},volumeUp:{symbol:"volume_up",label:"Mute"},volumeOff:{symbol:"volume_off",label:"Unmute"},miniPlayer:{symbol:"picture_in_picture",label:"Mini player"},miniPlayerExit:{symbol:"picture_in_picture_off",label:"Exit mini player"},fullscreen:{symbol:"fullscreen",label:"Fullscreen"},fullscreenExit:{symbol:"fullscreen_exit",label:"Exit fullscreen"},captionsOn:{symbol:"closed_caption",label:"Show captions"},captionsOff:{symbol:"closed_caption_disabled",label:"Hide captions"}};return t[e.action].label.replaceAll(" ","-").toLowerCase(),(0,r.jsx)(g(),{title:t[e.action].label,PopperProps:{container:null!==(n=document.fullscreenElement)&&void 0!==n?n:document.body},children:(0,r.jsx)(k(),{onClick:e.onClick,className:e.className,color:"primary",children:(0,r.jsx)(S,{name:t[e.action].symbol,className:"rustic-icon-large"})})})}function P(e){var n="dark"===(0,t.useTheme)().palette.mode,i=N(e.mediaElement.currentTime);return(0,r.jsxs)(f(),{className:"rustic-progress",children:[function(){for(var t=e.mediaElement.buffered,i=0,a=t.length-1;a>=0;--a){var o=t.start(a),c=t.end(a);if(o<e.mediaElement.currentTime){i=c;break}}var l=i/e.mediaElement.duration*100;return(0,r.jsx)(E(),{className:"rustic-progress-buffered",variant:"determinate",value:l,sx:{backgroundColor:"action.focus","& .MuiLinearProgress-bar":{backgroundColor:n?"secondary.light":"action.selected"}}})}(),(0,r.jsx)(y(),{className:"rustic-progress-slider",size:"small","aria-label":"Time","aria-valuetext":"Current time: ".concat(i),max:e.mediaElement.duration,value:e.mediaElement.currentTime,onChange:function(n,r){e.mediaElement.currentTime=r},valueLabelDisplay:"auto",valueLabelFormat:function(e){return N(e)},color:"secondary",sx:{"& .MuiSlider-rail":{color:"action.focus"}}})]})}function C(e){var n=(0,m.useState)(e.mediaElement.volume),t=n[0],i=n[1],a=(0,m.useState)(e.mediaElement.volume),o=a[0],c=a[1],l=e.mediaElement.muted?"volumeOff":"volumeUp";return(0,r.jsxs)(f(),{className:"rustic-volume-settings",children:[(0,r.jsx)(_,{onClick:function(){e.mediaElement.muted=!e.mediaElement.muted,e.mediaElement.muted?(c(e.mediaElement.volume),i(0)):i(o)},className:"rustic-mute-button",action:l}),(0,r.jsx)(y(),{className:"rustic-volume-slider",size:"small",max:1,step:.1,"aria-label":"Volume","aria-valuetext":"Volume: ".concat(100*t,"%"),value:t,onChange:function(n,r){var t=r;e.mediaElement.muted=0===t,e.mediaElement.volume=t,i(e.mediaElement.volume)}})]})}function B(e){var n=e.isTranscriptVisible?"keyboard_arrow_up":"keyboard_arrow_down",t="".concat(e.isTranscriptVisible?"Hide":"Show"," Transcript");return(0,r.jsx)(v(),{className:"rustic-transcript-toggle",onClick:e.setIsTranscriptVisible,endIcon:(0,r.jsx)(S,{name:n}),children:(0,r.jsx)(s(),{variant:"overline",children:t})})}function q(e){var n=(0,m.useState)(!e.mediaElement.paused),t=n[0],i=n[1],a=t?"pause":"play";return e.mediaElement.onended=function(){i(!1)},e.mediaElement.onpause=function(){i(!1)},e.mediaElement.onplay=function(){i(!0)},(0,r.jsx)(_,{onClick:function(){t?e.mediaElement.pause():e.mediaElement.play().catch((function(n){e.onError("Failed to play the media. Error: ".concat(n.message))}))},action:a,className:"rustic-pause-play-icon"})}function w(e){var n,t=(0,m.useState)(e.mediaElement.playbackRate),i=t[0],a=t[1];return(0,r.jsx)(g(),{title:"Playback rate",PopperProps:{container:null!==(n=document.fullscreenElement)&&void 0!==n?n:document.body},children:(0,r.jsx)(v(),{onClick:function(){var n=1;e.mediaElement.playbackRate<2&&(n=e.mediaElement.playbackRate+.5),e.mediaElement.playbackRate=n,a(n)},className:"rustic-playback-rate-button",children:(0,r.jsxs)(s(),{variant:"body1",children:[i,"X"]})})})}function F(e){var n="replay"===e.movement,t=n?function(){e.mediaElement.currentTime-=10}:function(){e.mediaElement.currentTime+=10},i=n?"replay":"forward";return(0,r.jsx)(_,{onClick:t,action:i})}function O(e){var n=(0,m.useState)(!!document.pictureInPictureElement),t=n[0],i=n[1],a=e.mediaElement,o=t?"miniPlayerExit":"miniPlayer";return a.onleavepictureinpicture=function(){i(!1)},(0,r.jsx)(_,{onClick:function(){t?document.exitPictureInPicture().then((function(){i(!1)})).catch((function(n){e.onError("Failed to exit mini player. Error: ".concat(n.message))})):a.requestPictureInPicture().then((function(){i(!0)})).catch((function(n){e.onError("Failed to enter mini player. Error: ".concat(n.message))}))},action:o})}function I(e){var n=(0,m.useState)(!!document.fullscreenElement),t=n[0],i=n[1],a=e.element,o=t?"fullscreenExit":"fullscreen";return a.onfullscreenchange=function(){i(!!document.fullscreenElement)},(0,r.jsx)(_,{onClick:function(){t?document.exitFullscreen().then((function(){i(!1)})).catch((function(n){e.onError("Failed to exit fullscreen mode. Error: ".concat(n.message))})):a.requestFullscreen().then((function(){i(!0)})).catch((function(n){e.onError("Failed to enter fullscreen mode. Error: ".concat(n.message))}))},action:o})}function L(e){var n=N(e.elapsedTimeInSeconds),t=N(e.durationTimeInSeconds),i="".concat(n," / ").concat(t);return"wide"===e.style?(0,r.jsxs)(f(),{className:"rustic-time-container",children:[(0,r.jsx)(s(),{variant:"overline",children:n}),(0,r.jsx)(s(),{variant:"overline",children:t})]}):(0,r.jsx)(s(),{variant:"overline",className:"rustic-time-display",children:i})}L.defaultProps={style:"condensed"};const M=require("@mui/material/Divider");var R=e.n(M);function V(e){var n=!!document.fullscreenElement;return(0,r.jsxs)(u.Box,{className:"rustic-transcript-container",children:[!n&&(0,r.jsx)(R(),{orientation:"vertical",flexItem:!0}),(0,r.jsx)(s(),{className:"rustic-transcript-content",variant:"body2",children:e.transcript})]})}const H=function(e){var n=(0,m.useState)(!1),i=n[0],o=n[1],l=(0,m.useState)(!1),d=l[0],f=l[1],p=(0,m.useState)(!0),v=p[0],x=p[1],E=(0,m.useState)(!!document.fullscreenElement),b=E[0],y=E[1],j=(0,m.useState)(!1),h=j[0],g=j[1],N=(0,m.useState)(""),S=N[0],T=N[1],k=(0,m.useState)(""),M=k[0],R=k[1],H=(0,m.useState)(0),A=H[0],U=H[1],D=(0,m.useRef)(null),z=(0,m.useRef)(null),Q=(0,t.useTheme)(),X=(0,t.useMediaQuery)(Q.breakpoints.down("md"));(0,m.useEffect)((function(){var e,n,r,t,i,a,o,c;function l(e){R(e),x(!1)}function s(){clearTimeout(c),c=setTimeout((function(){return g(!1)}),3e3)}null===(e=z.current)||void 0===e||e.addEventListener("timeupdate",(function(){z.current&&U(z.current.currentTime)})),null===(n=z.current)||void 0===n||n.addEventListener("canplay",(function(){R(""),x(!1)})),null===(r=z.current)||void 0===r||r.addEventListener("error",(function(){return l("Failed to load the video.")})),null===(t=z.current)||void 0===t||t.addEventListener("stalled",(function(){return l("Failed to fetch video data, but trying.")})),document.addEventListener("fullscreenchange",(function(){y(!!document.fullscreenElement)})),null===(i=D.current)||void 0===i||i.addEventListener("mousemove",(function(){g(!0),s()})),null===(a=D.current)||void 0===a||a.addEventListener("mouseleave",(function(){g(!1)})),null===(o=D.current)||void 0===o||o.addEventListener("keydown",(function(){g(!0),s()}))}),[]);var G={backgroundColor:Q.palette.background.paper,opacity:h?1:0};function J(){if(e.transcript&&i)return(0,r.jsx)(V,{transcript:e.transcript})}function K(){if(e.captions&&e.captions.length>0){var n=d?"captionsOff":"captionsOn";return(0,r.jsx)(_,{action:n,onClick:function(){return f(!d)}})}}function W(){if(e.transcript)return(0,r.jsx)(B,{isTranscriptVisible:i,setIsTranscriptVisible:function(){return o(!i)}})}var Y=X?function(){return b?(0,r.jsx)(r.Fragment,{children:z.current&&D.current&&(0,r.jsxs)(u.Box,{className:"rustic-video-controls",sx:G,children:[(0,r.jsxs)(u.Box,{className:"rustic-video-top-controls",children:[(0,r.jsx)(q,{mediaElement:z.current,onError:T}),(0,r.jsx)(P,{mediaElement:z.current}),(0,r.jsx)(L,{elapsedTimeInSeconds:A,durationTimeInSeconds:z.current.duration})]}),(0,r.jsxs)(u.Box,{className:"rustic-video-bottom-controls",children:[(0,r.jsxs)(u.Box,{className:"rustic-time-controls",children:[(0,r.jsx)(F,{mediaElement:z.current,movement:"replay"}),(0,r.jsx)(F,{mediaElement:z.current,movement:"forward"}),K(),(0,r.jsx)(w,{mediaElement:z.current})]}),W()]}),J()]})}):(0,r.jsx)(r.Fragment,{children:z.current&&D.current&&(0,r.jsxs)(u.Box,{className:"rustic-video-controls-mobile-preview",children:[(0,r.jsx)(q,{mediaElement:z.current,onError:T}),(0,r.jsxs)(u.Box,{className:"rustic-video-controls-right",children:[W(),(0,r.jsx)(I,{element:D.current,onError:T})]})]})})}:function(){return(0,r.jsx)(r.Fragment,{children:z.current&&D.current&&(0,r.jsxs)(u.Box,{className:"rustic-video-controls",sx:G,children:[(0,r.jsx)(P,{mediaElement:z.current}),(0,r.jsxs)(u.Box,{className:"rustic-video-bottom-controls",children:[(0,r.jsxs)(u.Box,{className:"rustic-video-bottom-controls-left",children:[(0,r.jsx)(q,{mediaElement:z.current,onError:T}),(0,r.jsx)(F,{mediaElement:z.current,movement:"replay"}),(0,r.jsx)(F,{mediaElement:z.current,movement:"forward"}),K(),(0,r.jsx)(w,{mediaElement:z.current}),(0,r.jsx)(C,{mediaElement:z.current}),(0,r.jsx)(L,{elapsedTimeInSeconds:A,durationTimeInSeconds:z.current.duration,style:"condensed"})]}),(0,r.jsxs)(u.Box,{className:"rustic-video-bottom-controls-right",children:[W(),(0,r.jsx)(O,{mediaElement:z.current,onError:T}),(0,r.jsx)(I,{element:D.current,onError:T})]})]}),b&&J()]})})};return M.length>0?(0,r.jsx)(a(),{severity:"error",children:M}):(0,r.jsxs)(u.Box,{className:"rustic-video",children:[v&&(0,r.jsx)(c(),{className:"rustic-video-loading-spinner"}),(0,r.jsxs)(u.Box,{ref:D,className:"rustic-video-screen",sx:{visibility:v?"hidden":"visible"},children:[S.length>0&&(0,r.jsx)(a(),{severity:"error",className:"rustic-control-error",onClose:function(){return T("")},children:S}),(!X||b)&&function(){if(z.current&&D.current)return(0,r.jsxs)(u.Box,{className:"rustic-video-title",sx:G,children:[(0,r.jsx)(s(),{variant:"body2",children:e.title}),b&&X&&(0,r.jsxs)(u.Box,{children:[(0,r.jsx)(O,{mediaElement:z.current,onError:T}),(0,r.jsx)(I,{element:D.current,onError:T})]})]})}(),(0,r.jsx)("video",{className:"rustic-video-element",ref:z,src:e.src,poster:e.poster,children:d&&(0,r.jsx)("track",{src:e.captions,kind:"captions",default:!0})}),Y()]}),!b&&J()]})};return n})()));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.rustic-popover-menu ul {
|
|
2
|
+
padding: 0;
|
|
3
|
+
min-width: 100px;
|
|
4
|
+
max-width: 240px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.rustic-popover-menu li {
|
|
8
|
+
padding-block: 8px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.rustic-popover-menu-item-icon {
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rustic-popover-menu-item-start-icon {
|
|
16
|
+
margin-right: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rustic-popover-menu-item-end-icon {
|
|
20
|
+
margin-left: 80px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
span.rustic-icon-large {
|
|
24
|
+
font-size: 32px;
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAE1B,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["@rustic-ai/ui-components"]=r():e["@rustic-ai/ui-components"]=r()}(global,(()=>(()=>{"use strict";var e={n:r=>{var o=r&&r.__esModule?()=>r.default:()=>r;return e.d(o,{a:o}),o},d:(r,o)=>{for(var n in o)e.o(o,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:o[n]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>N});const o=require("react/jsx-runtime"),n=require("@mui/material"),t=require("@mui/material/Button");var a=e.n(t);const i=require("@mui/material/Drawer");var c=e.n(i);const s=require("@mui/material/IconButton");var u=e.n(s);const l=require("@mui/material/ListItemText");var m=e.n(l);const d=require("@mui/material/Menu");var p=e.n(d);const b=require("@mui/material/MenuItem");var f=e.n(b);const x=require("@mui/material/styles"),h=require("@mui/material/Tooltip");var v=e.n(h);const y=require("@mui/material/Typography");var j=e.n(y);const g=require("@mui/system"),q=require("react");function w(e){return e.name.replaceAll("_","-"),(0,o.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}var k=function(){return k=Object.assign||function(e){for(var r,o=1,n=arguments.length;o<n;o++)for(var t in r=arguments[o])Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e},k.apply(this,arguments)};const N=function(e){var r=(0,q.useState)(!1),t=r[0],i=r[1],s=(0,q.useRef)(null),l=(0,x.useTheme)(),d=(0,n.useMediaQuery)(l.breakpoints.down("md")),b=d?c():p(),h={borderRadius:"".concat(l.shape.borderRadius,"px"),border:"1px solid ".concat(l.palette.divider)};function y(e){return(0,o.jsxs)(o.Fragment,{children:[e.startDecorator&&(0,o.jsx)(g.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,o.jsx)(m(),{children:(0,o.jsx)(j(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,o.jsx)(g.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}d&&(h=k(k({},h),{borderRadius:"".concat(l.shape.borderRadius,"px ").concat(l.shape.borderRadius,"px 0 0"),borderBottom:0}));var N=e.menuItems.map((function(e){return e.href?(0,o.jsx)(f(),{component:"a",onClick:function(){return i(!1)},href:e.href,download:e.downloadFileName||e.isFiledownload,children:y(e)},e.label):(0,o.jsx)(f(),{onClick:function(r){e.onClick&&e.onClick(r),i(!1)},disabled:!e.onClick,children:y(e)},e.label)}));var O,T,C=d?{}:{anchorEl:s.current};return(0,o.jsxs)(o.Fragment,{children:[(O={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":e.ariaLabel,ref:s,className:"rustic-popover-menu-button"},T=(0,o.jsx)(w,{name:"more_vert"}),e.buttonText?(0,o.jsx)(a(),k({},O,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,o.jsx)(v(),{title:e.ariaLabel,children:(0,o.jsx)(u(),k({},O,{children:e.icon?e.icon:T}))})),(0,o.jsx)(b,k({open:t,onClose:function(){return i(!1)}},C,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":k(k({},h),{backgroundImage:"none",boxShadow:l.shadows[2]})},children:N}))]})};return r})()));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './action.css';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { Message } from '../../types';
|
|
4
|
+
interface ActionProps {
|
|
5
|
+
label: string;
|
|
6
|
+
message: Message;
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
onClick: (message: Message) => void;
|
|
9
|
+
}
|
|
10
|
+
export default function Action(props: ActionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/components/messageCanvas/actions/action.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,2CAsBhD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Message } from '../../../types';
|
|
2
2
|
export interface CopyTextProps {
|
|
3
|
-
message:
|
|
3
|
+
message: Message;
|
|
4
4
|
}
|
|
5
5
|
export default function CopyText(props: CopyTextProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=copyText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyText.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/copy/copyText.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"copyText.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/copy/copyText.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG7C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA4BpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/copy/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={986:(e,t,o)=>{o.d(t,{default:()=>c});var r=o(997),n=o(934),a=o.n(n),i=o(229),s=o.n(i);o(689);const c=function(e){return(0,r.jsx)(s(),{title:e.label,children:(0,r.jsx)(a(),{color:"inherit","aria-label":e.label,onClick:function(t){t.stopPropagation(),t.preventDefault(),e.onClick(e.message)},className:"rustic-message-actions",children:e.icon})})}},934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{default:()=>i});var e=o(997),t=o(689);function n(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}var a=o(986);const i=function(o){var r=(0,t.useState)("Copy text"),i=r[0],s=r[1];return(0,e.jsx)(a.default,{message:o.message,icon:(0,e.jsx)(n,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){s("Copied"),setTimeout((function(){s("Copy text")}),2e3)})).catch((function(){s("Failed to copy")}))},label:i})}})(),r})()));
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import './
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
label: string;
|
|
6
|
-
message: ThreadableMessage;
|
|
7
|
-
icon: ReactNode;
|
|
8
|
-
onClick: (message: ThreadableMessage) => void;
|
|
9
|
-
}
|
|
10
|
-
export default function Action(props: ActionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
1
|
+
import './action.css';
|
|
2
|
+
import Action from './action';
|
|
3
|
+
export * from '../../types';
|
|
4
|
+
export default Action;
|
|
12
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/messageCanvas/actions/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/messageCanvas/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAErB,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,cAAc,aAAa,CAAA;AAC3B,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{r.r(o),r.d(o,{default:()=>u});var e=r(997),t=r(934),n=r.n(t),i=r(229),a=r.n(i);r(689);const u=function(t){return(0,e.jsx)(a(),{title:t.label,children:(0,e.jsx)(n(),{color:"inherit","aria-label":t.label,onClick:function(e){e.stopPropagation(),e.preventDefault(),t.onClick(t.message)},className:"rustic-message-actions",children:t.icon})})}})(),o})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/textToSpeech/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={986:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(997),n=a(934),o=a.n(n),s=a(229),i=a.n(s);a(689);const l=function(e){return(0,r.jsx)(i(),{title:e.label,children:(0,r.jsx)(o(),{color:"inherit","aria-label":e.label,onClick:function(t){t.stopPropagation(),t.preventDefault(),e.onClick(e.message)},className:"rustic-message-actions",children:e.icon})})}},934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{a.r(r),a.d(r,{default:()=>s});var e=a(997),t=a(689);function n(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}var o=a(986);const s=function(a){var r=(0,t.useState)("Start reading aloud"),s=r[0],i=r[1],l=[a.message.data.title,a.message.data.description,a.message.data.alt,a.message.data.text,a.message.data.transcript].filter(Boolean).join(" "),c=new SpeechSynthesisUtterance(l);return(0,e.jsx)(o.default,{message:a.message,icon:(0,e.jsx)(n,{name:"text_to_speech"}),onClick:function(){window.speechSynthesis.speaking?(window.speechSynthesis.cancel(),i("Start reading aloud")):(c.onend=function(){i("Start reading aloud")},window.speechSynthesis.speak(c),i("Stop reading aloud"))},label:s})}})(),r})()));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Message } from '../../../types';
|
|
2
2
|
export interface TextToSpeechProps {
|
|
3
|
-
message:
|
|
3
|
+
message: Message;
|
|
4
4
|
}
|
|
5
5
|
export default function TextToSpeech(props: TextToSpeechProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=textToSpeech.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textToSpeech.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/textToSpeech/textToSpeech.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"textToSpeech.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/textToSpeech/textToSpeech.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAkC5D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.rustic-message-canvas {
|
|
2
|
+
gap: 4px;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.rustic-message-canvas .rustic-message-container {
|
|
7
|
+
padding: 16px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rustic-message-canvas .rustic-message-actions-container {
|
|
11
|
+
opacity: 0;
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 4px;
|
|
14
|
+
right: 16px;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rustic-message-canvas .rustic-timestamp {
|
|
20
|
+
margin-left: 16px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.rustic-message-canvas:hover .rustic-message-actions-container {
|
|
24
|
+
opacity: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (max-width: 900px) {
|
|
28
|
+
.rustic-message-canvas .rustic-message-actions-container {
|
|
29
|
+
bottom: -20px;
|
|
30
|
+
top: unset;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.rustic-message-canvas .rustic-timestamp {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex: 1;
|
|
36
|
+
justify-content: flex-end;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/messageCanvas/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAE3C,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>v});const r=require("react/jsx-runtime"),a=require("@mui/material"),n=require("@mui/material/Card");var o=e.n(n);const i=require("@mui/material/Stack");var s=e.n(i);const c=require("react"),u=require("@mui/material/Typography");var m=e.n(u);const l=require("pluralize");var d,g=e.n(l);function f(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(d||(d={}));const p=function(e){return(0,r.jsx)(m(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(t=e.timestamp,f(t)<86400?function(e){var t=f(e);if(t<60)return"".concat(g()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(g()("minute",r,!0)," ago")}var a=Math.floor(t/3600);return"".concat(g()("hour",a,!0)," ago")}(t):(a=new Date(t),n=navigator.language,o={month:"short",day:"numeric"},i=new Date,c=(s=a.getFullYear()!==i.getFullYear())?" at ":", ",s&&(o.year="numeric"),a.toLocaleDateString(n,o)+c+a.toLocaleTimeString(n,{hour:"numeric",minute:"2-digit",hour12:!0})))});var t,a,n,o,i,s,c},v=(0,c.forwardRef)((function(e,t){var n=(0,a.useTheme)();return(0,r.jsxs)(s(),{id:e.message.id,className:"rustic-message-canvas",ref:t,children:[(0,r.jsxs)(s(),{direction:"row",alignItems:"center",spacing:1,children:[e.getProfileComponent&&e.getProfileComponent(e.message),(0,r.jsx)(p,{timestamp:e.message.timestamp})]}),e.getActionsComponent&&e.getActionsComponent(e.message)&&(0,r.jsx)(o(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:e.getActionsComponent(e.message)}),(0,r.jsx)(o(),{variant:"outlined",className:"rustic-message-container",children:e.children})]})}));return t})()));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import './messageCanvas.css';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Message } from '../types';
|
|
4
4
|
export interface MessageContainerProps {
|
|
5
5
|
/** A function that returns a React element to display sender details, like names and/or avatars. */
|
|
6
|
-
getProfileComponent?: (message:
|
|
6
|
+
getProfileComponent?: (message: Message) => ReactNode;
|
|
7
7
|
/** A function that returns a single React element which may be composed of several actions supported for the message, such as editing, copying, and deleting, etc.
|
|
8
8
|
* In case no actions are applicable or available for a particular message, the function may return `undefined`.
|
|
9
9
|
* This approach offers flexibility in tailoring message interactions to specific application requirements.
|
|
10
10
|
* To define individual message actions, developers can extend the `Action` component's functionality.
|
|
11
11
|
* One such example is the `CopyText` component.
|
|
12
12
|
*/
|
|
13
|
-
getActionsComponent?: (message:
|
|
13
|
+
getActionsComponent?: (message: Message) => ReactNode | undefined;
|
|
14
14
|
}
|
|
15
15
|
export interface MessageCanvasProps extends MessageContainerProps {
|
|
16
|
-
/** Message information to be displayed. Please see the `MessageSpace` docs for more information about the `
|
|
17
|
-
message:
|
|
16
|
+
/** Message information to be displayed. Please see the `MessageSpace` docs for more information about the `Message` interface. */
|
|
17
|
+
message: Message;
|
|
18
18
|
/** React component to be displayed in the message canvas. */
|
|
19
19
|
children: ReactNode;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/messageCanvas/messageCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAK5B,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGzD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"messageCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/messageCanvas/messageCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAK5B,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,WAAW,qBAAqB;IACpC,oGAAoG;IACpG,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,CAAA;IACrD;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,GAAG,SAAS,CAAA;CAClE;AAED,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,kIAAkI;IAClI,OAAO,EAAE,OAAO,CAAA;IAChB,6DAA6D;IAC7D,QAAQ,EAAE,SAAS,CAAA;CACpB;AAyCD,QAAA,MAAM,aAAa,2FAAmC,CAAA;AACtD,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.rustic-message-space {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
flex: 1;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
height: 100%;
|
|
7
|
+
overflow: auto;
|
|
8
|
+
position: relative;
|
|
9
|
+
scroll-behavior: smooth;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rustic-message-space .rustic-scroll-down-button {
|
|
13
|
+
position: sticky;
|
|
14
|
+
bottom: 16px;
|
|
15
|
+
left: 50%;
|
|
16
|
+
transform: translateX(-50%);
|
|
17
|
+
z-index: 10;
|
|
18
|
+
width: fit-content;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
span.rustic-icon-large {
|
|
22
|
+
font-size: 32px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.rustic-message-canvas {
|
|
26
|
+
gap: 4px;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rustic-message-canvas .rustic-message-container {
|
|
31
|
+
padding: 16px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rustic-message-canvas .rustic-message-actions-container {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 4px;
|
|
38
|
+
right: 16px;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rustic-message-canvas .rustic-timestamp {
|
|
44
|
+
margin-left: 16px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.rustic-message-canvas:hover .rustic-message-actions-container {
|
|
48
|
+
opacity: 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (max-width: 900px) {
|
|
52
|
+
.rustic-message-canvas .rustic-message-actions-container {
|
|
53
|
+
bottom: -20px;
|
|
54
|
+
top: unset;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.rustic-message-canvas .rustic-timestamp {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex: 1;
|
|
60
|
+
justify-content: flex-end;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/messageSpace/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>N});const n=require("react/jsx-runtime"),r=require("@mui/material/Chip");var o=e.n(r);const a=require("@mui/system/Box");var s=e.n(a);const i=require("react");var c=e.n(i);const u=require("@mui/material/Typography");var l=e.n(u),m=function(){return m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},m.apply(this,arguments)};const d=function(e){var t=e.messages[0],r=e.messages.slice(1),o=e.supportedElements[t.format];return(0,n.jsx)(n.Fragment,{children:o?c().createElement(o,m(m({sender:e.sender,ws:e.ws,messageId:t.id,conversationId:t.conversationId},t.data),r.length>0&&{updatedData:r.map((function(e){return e.data}))})):(0,n.jsxs)(l(),{variant:"body2",children:["Unsupported element format: ",t.format]})})};function f(e){return e.name.replaceAll("_","-"),(0,n.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}const g=require("@mui/material"),p=require("@mui/material/Card");var v=e.n(p);const h=require("@mui/material/Stack");var y=e.n(h);const j=require("pluralize");var b,w=e.n(j);function x(e){var t=new Date,n=new Date(e);return Math.floor((t.getTime()-n.getTime())/1e3)}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(b||(b={}));const O=function(e){return(0,n.jsx)(l(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(t=e.timestamp,x(t)<86400?function(e){var t=x(e);if(t<60)return"".concat(w()("second",t,!0)," ago");if(t<3600){var n=Math.floor(t/60);return"".concat(w()("minute",n,!0)," ago")}var r=Math.floor(t/3600);return"".concat(w()("hour",r,!0)," ago")}(t):(r=new Date(t),o=navigator.language,a={month:"short",day:"numeric"},s=new Date,c=(i=r.getFullYear()!==s.getFullYear())?" at ":", ",i&&(a.year="numeric"),r.toLocaleDateString(o,a)+c+r.toLocaleTimeString(o,{hour:"numeric",minute:"2-digit",hour12:!0})))});var t,r,o,a,s,i,c},E=(0,i.forwardRef)((function(e,t){var r=(0,g.useTheme)();return(0,n.jsxs)(y(),{id:e.message.id,className:"rustic-message-canvas",ref:t,children:[(0,n.jsxs)(y(),{direction:"row",alignItems:"center",spacing:1,children:[e.getProfileComponent&&e.getProfileComponent(e.message),(0,n.jsx)(O,{timestamp:e.message.timestamp})]}),e.getActionsComponent&&e.getActionsComponent(e.message)&&(0,n.jsx)(v(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:r.shadows[1]},children:e.getActionsComponent(e.message)}),(0,n.jsx)(v(),{variant:"outlined",className:"rustic-message-container",children:e.children})]})}));var S=function(){return S=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},S.apply(this,arguments)};function T(e,t){var n=t.format.includes("update")?t.threadId:t.id;if(n){var r=S({},e),o=(e[n]||[])[0];return t.format.includes("update")&&o&&o.sender.id!==t.sender.id&&(n=t.id),r[n]||(r[n]=[]),r[n]=r[n].concat(t),r}return e}function C(e){var t,r,a,c=(0,i.useRef)(null),u=(0,i.useRef)(null),l=(0,i.useRef)(),m=(0,i.useState)(!0),g=m[0],p=m[1],v=(0,i.useState)(!0),h=v[0],y=v[1],j=(0,i.useState)(!1),b=j[0],w=j[1],x=(0,i.useState)({}),O=x[0],S=x[1],C=Object.keys(O).length,N=(r=C,a=(0,i.useRef)(0),(0,i.useEffect)((function(){a.current=r})),a.current),P=2e3;function R(){y(!0),l.current&&clearTimeout(l.current),l.current=setTimeout((function(){y(!1)}),P)}function q(){var e=u.current,t=c.current;if(e&&t){var n=e.getBoundingClientRect().bottom,r=t.getBoundingClientRect().bottom;p(r-1<=n)}}function A(){if(function(){var e,t=null===(e=u.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}()){var e=u.current;w(!0),e&&setTimeout((function(){R(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(A,1)}function D(e){S((function(t){return T(t,e)}))}return(0,i.useEffect)((function(){var e=u.current;if(q(),e)return e.addEventListener("scroll",q),window.addEventListener("resize",q),function(){e.removeEventListener("scroll",q),window.removeEventListener("resize",q)}}),[g]),(0,i.useEffect)((function(){A()}),[b]),(0,i.useEffect)((function(){g&&0!==N&&C>N&&(R(),A())}),[g,Object.keys(O).length]),(0,i.useEffect)((function(){var t,n={};null===(t=e.receivedMessages)||void 0===t||t.forEach((function(e){var t=T(n,e);n=t})),S(n)}),[null===(t=e.receivedMessages)||void 0===t?void 0:t.length]),(0,i.useEffect)((function(){e.ws.onReceive&&e.ws.onReceive(D)}),[]),(0,n.jsxs)(s(),{ref:u,className:"rustic-message-space",children:[Object.keys(O).map((function(t,r){var o=O[t],a=o[o.length-1];return(0,n.jsx)(E,{message:a,getActionsComponent:e.getActionsComponent,getProfileComponent:e.getProfileComponent,ref:r===C-1?c:null,children:(0,n.jsx)(d,{ws:e.ws,sender:e.sender,messages:o,supportedElements:e.supportedElements})},t)})),!g&&!h&&(0,n.jsx)(o(),{variant:"rusticSecondary",className:"rustic-scroll-down-button",size:"medium",onClick:A,label:(0,n.jsxs)(n.Fragment,{children:[e.scrollDownLabel,(0,n.jsx)(f,{name:"arrow_downward"})]})})]})}C.defaultProps={scrollDownLabel:"Scroll down"};const N=C;return t})()));
|