@rustic-ai/ui-components 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/components/calendar/fCCalendar.d.ts +8 -2
  2. package/dist/components/calendar/fCCalendar.d.ts.map +1 -1
  3. package/dist/components/calendar/index.css +21 -0
  4. package/dist/components/calendar/index.d.ts +5 -0
  5. package/dist/components/calendar/index.d.ts.map +1 -0
  6. package/dist/components/calendar/index.js +1 -0
  7. package/dist/components/codeSnippet/index.css +14 -0
  8. package/dist/components/codeSnippet/index.d.ts +5 -0
  9. package/dist/components/codeSnippet/index.d.ts.map +1 -0
  10. package/dist/components/codeSnippet/index.js +1 -0
  11. package/dist/components/elementRenderer/index.d.ts +3 -0
  12. package/dist/components/elementRenderer/index.d.ts.map +1 -0
  13. package/dist/components/elementRenderer/index.js +1 -0
  14. package/dist/components/image/index.css +43 -0
  15. package/dist/components/image/index.d.ts +5 -0
  16. package/dist/components/image/index.d.ts.map +1 -0
  17. package/dist/components/image/index.js +1 -0
  18. package/dist/components/index.d.ts +4 -1
  19. package/dist/components/index.d.ts.map +1 -1
  20. package/dist/components/input/baseInput/baseInput.d.ts.map +1 -1
  21. package/dist/components/input/emoji/index.css +16 -0
  22. package/dist/components/input/emoji/index.d.ts +4 -0
  23. package/dist/components/input/emoji/index.d.ts.map +1 -0
  24. package/dist/components/input/emoji/index.js +1 -0
  25. package/dist/components/input/multimodal/multimodalInput/index.css +227 -0
  26. package/dist/components/input/multimodal/multimodalInput/index.d.ts +5 -0
  27. package/dist/components/input/multimodal/multimodalInput/index.d.ts.map +1 -0
  28. package/dist/components/input/multimodal/multimodalInput/index.js +1 -0
  29. package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts +8 -1
  30. package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
  31. package/dist/components/input/multimodal/uploader/index.css +145 -0
  32. package/dist/components/input/multimodal/uploader/index.d.ts +5 -0
  33. package/dist/components/input/multimodal/uploader/index.d.ts.map +1 -0
  34. package/dist/components/input/multimodal/uploader/index.js +1 -0
  35. package/dist/components/input/textInput/index.css +57 -0
  36. package/dist/components/input/textInput/index.d.ts +4 -0
  37. package/dist/components/input/textInput/index.d.ts.map +1 -0
  38. package/dist/components/input/textInput/index.js +1 -0
  39. package/dist/components/input/textInput/textInput.d.ts +0 -3
  40. package/dist/components/input/textInput/textInput.d.ts.map +1 -1
  41. package/dist/components/map/index.css +13 -0
  42. package/dist/components/map/index.d.ts +5 -0
  43. package/dist/components/map/index.d.ts.map +1 -0
  44. package/dist/components/map/index.js +1 -0
  45. package/dist/components/map/openLayersMap.d.ts +6 -1
  46. package/dist/components/map/openLayersMap.d.ts.map +1 -1
  47. package/dist/components/markdown/index.d.ts +6 -0
  48. package/dist/components/markdown/index.d.ts.map +1 -0
  49. package/dist/components/markdown/index.js +1 -0
  50. package/dist/components/markdown/markedMarkdown.d.ts +7 -1
  51. package/dist/components/markdown/markedMarkdown.d.ts.map +1 -1
  52. package/dist/components/media/audio/index.css +182 -0
  53. package/dist/components/media/audio/index.d.ts +5 -0
  54. package/dist/components/media/audio/index.d.ts.map +1 -0
  55. package/dist/components/media/audio/index.js +1 -0
  56. package/dist/components/media/video/index.css +225 -0
  57. package/dist/components/media/video/index.d.ts +5 -0
  58. package/dist/components/media/video/index.d.ts.map +1 -0
  59. package/dist/components/media/video/index.js +1 -0
  60. package/dist/components/menu/index.css +26 -0
  61. package/dist/components/menu/index.d.ts +4 -0
  62. package/dist/components/menu/index.d.ts.map +1 -0
  63. package/dist/components/menu/index.js +1 -0
  64. package/dist/components/messageCanvas/actions/action.d.ts +12 -0
  65. package/dist/components/messageCanvas/actions/action.d.ts.map +1 -0
  66. package/dist/components/messageCanvas/actions/copy/index.css +8 -0
  67. package/dist/components/messageCanvas/actions/copy/index.d.ts +3 -0
  68. package/dist/components/messageCanvas/actions/copy/index.d.ts.map +1 -0
  69. package/dist/components/messageCanvas/actions/copy/index.js +1 -0
  70. package/dist/components/messageCanvas/actions/index.css +4 -0
  71. package/dist/components/messageCanvas/actions/index.d.ts +4 -11
  72. package/dist/components/messageCanvas/actions/index.d.ts.map +1 -1
  73. package/dist/components/messageCanvas/actions/index.js +1 -0
  74. package/dist/components/messageCanvas/actions/textToSpeech/index.css +8 -0
  75. package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts +3 -0
  76. package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts.map +1 -0
  77. package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -0
  78. package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts.map +1 -1
  79. package/dist/components/messageCanvas/index.css +39 -0
  80. package/dist/components/messageCanvas/index.d.ts +4 -0
  81. package/dist/components/messageCanvas/index.d.ts.map +1 -0
  82. package/dist/components/messageCanvas/index.js +1 -0
  83. package/dist/components/messageSpace/index.css +63 -0
  84. package/dist/components/messageSpace/index.d.ts +4 -0
  85. package/dist/components/messageSpace/index.d.ts.map +1 -0
  86. package/dist/components/messageSpace/index.js +1 -0
  87. package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
  88. package/dist/components/multipart/index.css +134 -0
  89. package/dist/components/multipart/index.d.ts +5 -0
  90. package/dist/components/multipart/index.d.ts.map +1 -0
  91. package/dist/components/multipart/index.js +1 -0
  92. package/dist/components/participantsContainer/index.css +42 -0
  93. package/dist/components/participantsContainer/index.d.ts +4 -0
  94. package/dist/components/participantsContainer/index.d.ts.map +1 -0
  95. package/dist/components/participantsContainer/index.js +1 -0
  96. package/dist/components/pdfViewer/index.css +60 -0
  97. package/dist/components/pdfViewer/index.d.ts +5 -0
  98. package/dist/components/pdfViewer/index.d.ts.map +1 -0
  99. package/dist/components/pdfViewer/index.js +1 -0
  100. package/dist/components/pdfViewer/pdfViewer.d.ts +4 -0
  101. package/dist/components/pdfViewer/pdfViewer.d.ts.map +1 -1
  102. package/dist/components/promptBuilder/index.css +96 -0
  103. package/dist/components/promptBuilder/index.d.ts +5 -0
  104. package/dist/components/promptBuilder/index.d.ts.map +1 -0
  105. package/dist/components/promptBuilder/index.js +1 -0
  106. package/dist/components/promptBuilder/mockWebSocket.d.ts +5 -0
  107. package/dist/components/promptBuilder/mockWebSocket.d.ts.map +1 -0
  108. package/dist/components/promptBuilder/promptBuilder.d.ts +24 -0
  109. package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -0
  110. package/dist/components/question/index.css +14 -0
  111. package/dist/components/question/index.d.ts +5 -0
  112. package/dist/components/question/index.d.ts.map +1 -0
  113. package/dist/components/question/index.js +1 -0
  114. package/dist/components/question/question.d.ts +7 -1
  115. package/dist/components/question/question.d.ts.map +1 -1
  116. package/dist/components/table/index.css +43 -0
  117. package/dist/components/table/index.d.ts +5 -0
  118. package/dist/components/table/index.d.ts.map +1 -0
  119. package/dist/components/table/index.js +1 -0
  120. package/dist/components/text/index.css +5 -0
  121. package/dist/components/text/index.d.ts +7 -0
  122. package/dist/components/text/index.d.ts.map +1 -0
  123. package/dist/components/text/index.js +1 -0
  124. package/dist/components/text/text.d.ts +7 -1
  125. package/dist/components/text/text.d.ts.map +1 -1
  126. package/dist/components/timestamp/index.d.ts +3 -0
  127. package/dist/components/timestamp/index.d.ts.map +1 -0
  128. package/dist/components/types.d.ts +17 -31
  129. package/dist/components/types.d.ts.map +1 -1
  130. package/dist/components/video/index.css +34 -0
  131. package/dist/components/video/index.d.ts +3 -0
  132. package/dist/components/video/index.d.ts.map +1 -0
  133. package/dist/components/video/index.js +1 -0
  134. package/dist/components/video/youtubeVideo.d.ts +8 -1
  135. package/dist/components/video/youtubeVideo.d.ts.map +1 -1
  136. package/dist/components/visualization/chart/index.css +44 -0
  137. package/dist/components/visualization/chart/index.d.ts +4 -0
  138. package/dist/components/visualization/chart/index.d.ts.map +1 -0
  139. package/dist/components/visualization/chart/index.js +1 -0
  140. package/dist/components/visualization/chart/rechartsTimeSeries.d.ts +8 -1
  141. package/dist/components/visualization/chart/rechartsTimeSeries.d.ts.map +1 -1
  142. package/dist/components/visualization/mermaidViz/index.css +21 -0
  143. package/dist/components/visualization/mermaidViz/index.d.ts +5 -0
  144. package/dist/components/visualization/mermaidViz/index.d.ts.map +1 -0
  145. package/dist/components/visualization/mermaidViz/index.js +1 -0
  146. package/dist/components/visualization/mermaidViz/mermaidViz.d.ts +9 -2
  147. package/dist/components/visualization/mermaidViz/mermaidViz.d.ts.map +1 -1
  148. package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts +10 -0
  149. package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts.map +1 -0
  150. package/dist/components/visualization/perspectiveViz/index.css +16 -0
  151. package/dist/components/visualization/perspectiveViz/index.d.ts +5 -0
  152. package/dist/components/visualization/perspectiveViz/index.d.ts.map +1 -0
  153. package/dist/components/visualization/perspectiveViz/index.js +1 -0
  154. package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts +7 -4
  155. package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts.map +1 -1
  156. package/dist/components/visualization/vegaLiteViz/index.css +45 -0
  157. package/dist/components/visualization/vegaLiteViz/index.d.ts +5 -0
  158. package/dist/components/visualization/vegaLiteViz/index.d.ts.map +1 -0
  159. package/dist/components/visualization/vegaLiteViz/index.js +1 -0
  160. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts +9 -2
  161. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts.map +1 -1
  162. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts +20 -0
  163. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts.map +1 -0
  164. package/dist/components/weather/index.css +77 -0
  165. package/dist/components/weather/index.d.ts +5 -0
  166. package/dist/components/weather/index.d.ts.map +1 -0
  167. package/dist/components/weather/index.js +1 -0
  168. package/dist/index.css +62 -0
  169. package/dist/index.js +1 -2
  170. package/dist/rusticTheme.d.ts +29 -0
  171. package/dist/rusticTheme.d.ts.map +1 -1
  172. package/dist/rusticTheme.js +1 -0
  173. package/package.json +123 -22
  174. 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,5 @@
1
+ import './video.css';
2
+ import Video from './video';
3
+ export * from '../../types';
4
+ export default Video;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -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,{ParticipantRole:()=>R,ParticipantType:()=>H,default:()=>U});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 P(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 _(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 w(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)(P,{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 C(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 B(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)(P,{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 q(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 O(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)(P,{onClick:t,action:i})}function F(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)(P,{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)(P,{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 M(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})}M.defaultProps={style:"condensed"};const L=require("@mui/material/Divider");var R,H,V=e.n(L);function A(e){var n=!!document.fullscreenElement;return(0,r.jsxs)(u.Box,{className:"rustic-transcript-container",children:[!n&&(0,r.jsx)(V(),{orientation:"vertical",flexItem:!0}),(0,r.jsx)(s(),{className:"rustic-transcript-content",variant:"body2",children:e.transcript})]})}!function(e){e.Owner="owner",e.Member="member"}(R||(R={})),function(e){e.Human="human",e.Agent="agent"}(H||(H={}));const U=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)(""),L=k[0],R=k[1],H=(0,m.useState)(0),V=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)(A,{transcript:e.transcript})}function K(){if(e.captions&&e.captions.length>0){var n=d?"captionsOff":"captionsOn";return(0,r.jsx)(P,{action:n,onClick:function(){return f(!d)}})}}function W(){if(e.transcript)return(0,r.jsx)(C,{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)(B,{mediaElement:z.current,onError:T}),(0,r.jsx)(_,{mediaElement:z.current}),(0,r.jsx)(M,{elapsedTimeInSeconds:V,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)(O,{mediaElement:z.current,movement:"replay"}),(0,r.jsx)(O,{mediaElement:z.current,movement:"forward"}),K(),(0,r.jsx)(q,{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)(B,{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)(_,{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)(B,{mediaElement:z.current,onError:T}),(0,r.jsx)(O,{mediaElement:z.current,movement:"replay"}),(0,r.jsx)(O,{mediaElement:z.current,movement:"forward"}),K(),(0,r.jsx)(q,{mediaElement:z.current}),(0,r.jsx)(w,{mediaElement:z.current}),(0,r.jsx)(M,{elapsedTimeInSeconds:V,durationTimeInSeconds:z.current.duration,style:"condensed"})]}),(0,r.jsxs)(u.Box,{className:"rustic-video-bottom-controls-right",children:[W(),(0,r.jsx)(F,{mediaElement:z.current,onError:T}),(0,r.jsx)(I,{element:D.current,onError:T})]})]}),b&&J()]})})};return L.length>0?(0,r.jsx)(a(),{severity:"error",children:L}):(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)(F,{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,4 @@
1
+ import './popoverMenu.css';
2
+ import PopoverMenu from './popoverMenu';
3
+ export default PopoverMenu;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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 { ThreadableMessage } from '../../types';
4
+ interface ActionProps {
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 {};
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,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,iBAAiB,CAAA;IAC1B,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,2CAsBhD"}
@@ -0,0 +1,8 @@
1
+ span.rustic-icon-large {
2
+ font-size: 32px;
3
+ }
4
+
5
+ .rustic-message-actions {
6
+ padding: 4px 8px;
7
+ }
8
+
@@ -0,0 +1,3 @@
1
+ import CopyText from './copyText';
2
+ export default CopyText;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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:()=>s});var r=o(997),n=o(934),a=o.n(n),i=o(229),c=o.n(i);o(689),o(265);const s=function(e){return(0,r.jsx)(c(),{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})})}},265:(e,t,o)=>{var r,n;!function(e){e.Owner="owner",e.Member="member"}(r||(r={})),function(e){e.Human="human",e.Agent="agent"}(n||(n={}))},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],c=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(){c("Copied"),setTimeout((function(){c("Copy text")}),2e3)})).catch((function(){c("Failed to copy")}))},label:i})}})(),r})()));
@@ -0,0 +1,4 @@
1
+ .rustic-message-actions {
2
+ padding: 4px 8px;
3
+ }
4
+
@@ -1,12 +1,5 @@
1
- import './index.css';
2
- import type { ReactNode } from 'react';
3
- import type { ThreadableMessage } from '../../types';
4
- interface ActionProps {
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.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,iBAAiB,CAAA;IAC1B,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,2CAsBhD"}
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={265:(e,t,r)=>{var o,n;r.d(t,{A:()=>n,_:()=>o}),function(e){e.Owner="owner",e.Member="member"}(o||(o={})),function(e){e.Human="human",e.Agent="agent"}(n||(n={}))},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,{ParticipantRole:()=>u._,ParticipantType:()=>u.A,default:()=>c});var e=r(997),t=r(934),n=r.n(t),i=r(229),a=r.n(i);r(689);var u=r(265);const c=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,8 @@
1
+ span.rustic-icon-large {
2
+ font-size: 32px;
3
+ }
4
+
5
+ .rustic-message-actions {
6
+ padding: 4px 8px;
7
+ }
8
+
@@ -0,0 +1,3 @@
1
+ import TextToSpeech from './textToSpeech';
2
+ export default TextToSpeech;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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:()=>c});var n=a(997),r=a(934),o=a.n(r),s=a(229),i=a.n(s);a(689),a(265);const c=function(e){return(0,n.jsx)(i(),{title:e.label,children:(0,n.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})})}},265:(e,t,a)=>{var n,r;!function(e){e.Owner="owner",e.Member="member"}(n||(n={})),function(e){e.Human="human",e.Agent="agent"}(r||(r={}))},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(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](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 n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 n={};return(()=>{a.r(n),a.d(n,{default:()=>s});var e=a(997),t=a(689);function r(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 n=(0,t.useState)("Start reading aloud"),s=n[0],i=n[1],c=[a.message.data.title,a.message.data.description,a.message.data.alt,a.message.data.text,a.message.data.transcript].filter(Boolean).join(" "),l=new SpeechSynthesisUtterance(c);return(0,e.jsx)(o.default,{message:a.message,icon:(0,e.jsx)(r,{name:"text_to_speech"}),onClick:function(){window.speechSynthesis.speaking?(window.speechSynthesis.cancel(),i("Start reading aloud")):(l.onend=function(){i("Start reading aloud")},window.speechSynthesis.speak(l),i("Stop reading aloud"))},label:s})}})(),n})()));
@@ -1 +1 @@
1
- {"version":3,"file":"textToSpeech.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/textToSpeech/textToSpeech.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGvD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAiC5D"}
1
+ {"version":3,"file":"textToSpeech.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/textToSpeech/textToSpeech.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGvD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,iBAAiB,CAAA;CAC3B;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,4 @@
1
+ import './messageCanvas.css';
2
+ import MessageCanvas from './messageCanvas';
3
+ export default MessageCanvas;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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})()));
@@ -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,4 @@
1
+ import './messageSpace.css';
2
+ import MessageSpace from './messageSpace';
3
+ export default MessageSpace;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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:()=>E});const n=require("react/jsx-runtime"),r=require("@mui/material/Chip");var o=e.n(r);const s=require("@mui/system/Box");var a=e.n(s);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.supportedElements[e.message.format];return(0,n.jsx)(n.Fragment,{children:t?c().createElement(t,m(m({sender:e.sender,ws:e.ws,messageId:e.message.id,conversationId:e.message.conversationId},e.message.data),e.message.threadMessagesData&&{updatedData:e.message.threadMessagesData})):(0,n.jsxs)(l(),{variant:"body2",children:["Unsupported element format: ",e.message.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 w=require("pluralize");var b,j=e.n(w);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 T=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(j()("second",t,!0)," ago");if(t<3600){var n=Math.floor(t/60);return"".concat(j()("minute",n,!0)," ago")}var r=Math.floor(t/3600);return"".concat(j()("hour",r,!0)," ago")}(t):(r=new Date(t),o=navigator.language,s={month:"short",day:"numeric"},a=new Date,c=(i=r.getFullYear()!==a.getFullYear())?" at ":", ",i&&(s.year="numeric"),r.toLocaleDateString(o,s)+c+r.toLocaleTimeString(o,{hour:"numeric",minute:"2-digit",hour12:!0})))});var t,r,o,s,a,i,c},S=(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)(T,{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})]})}));function C(e){var t,r,s,c,u=(0,i.useRef)(null),l=(0,i.useRef)(null),m=(0,i.useRef)(),g=(0,i.useState)(!0),p=g[0],v=g[1],h=(0,i.useState)(!0),y=h[0],w=h[1],b=(0,i.useState)(!1),j=b[0],x=b[1],T=(null===(t=e.messages)||void 0===t?void 0:t.length)||0,C=(s=T,c=(0,i.useRef)(0),(0,i.useEffect)((function(){c.current=s})),c.current),E=2e3;function D(){w(!0),m.current&&clearTimeout(m.current),m.current=setTimeout((function(){w(!1)}),E)}function O(){var e,t=null===(e=l.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}function N(){var e=l.current,t=u.current;if(e&&t){var n=e.getBoundingClientRect().bottom,r=t.getBoundingClientRect().bottom;v(r-1<=n)}}function q(){if(O()){var e=l.current;x(!0),e&&setTimeout((function(){D(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(q,1)}function A(){if(O()){var e=u.current;e&&setTimeout((function(){e.scrollIntoView({block:"start",inline:"nearest"})}),0)}else setTimeout(A,1)}return(0,i.useEffect)((function(){var e=l.current;if(N(),e)return e.addEventListener("scroll",N),window.addEventListener("resize",N),function(){e.removeEventListener("scroll",N),window.removeEventListener("resize",N)}}),[p]),(0,i.useEffect)((function(){q()}),[j]),(0,i.useEffect)((function(){p&&0!==C&&T>C&&(D(),A())}),[p,null===(r=e.messages)||void 0===r?void 0:r.length]),(0,n.jsxs)(a(),{ref:l,className:"rustic-message-space",children:[e.messages&&e.messages.length>0&&e.messages.map((function(t,r){return(0,n.jsx)(S,{message:t,getActionsComponent:e.getActionsComponent,getProfileComponent:e.getProfileComponent,ref:r===T-1?u:null,children:(0,n.jsx)(d,{ws:e.ws,sender:e.sender,message:t,supportedElements:e.supportedElements})},t.id)})),!p&&!y&&(0,n.jsx)(o(),{variant:"rusticSecondary",className:"rustic-scroll-down-button",size:"medium",onClick:function(){var e;null===(e=u.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"}),D()},label:(0,n.jsxs)(n.Fragment,{children:[e.scrollDownLabel,(0,n.jsx)(f,{name:"arrow_downward"})]})})]})}C.defaultProps={scrollDownLabel:"Scroll down"};const E=C;return t})()));
@@ -1 +1 @@
1
- {"version":3,"file":"messageSpace.d.ts","sourceRoot":"","sources":["../../../src/components/messageSpace/messageSpace.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAQ3B,OAAsB,EACpB,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,iBAAiB,EACjB,eAAe,EAChB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,0LAA0L;IAC1L,EAAE,EAAE,eAAe,CAAA;IACnB,0GAA0G;IAC1G,MAAM,EAAE,MAAM,CAAA;IACd,2GAA2G;IAC3G,iBAAiB,EAAE,YAAY,CAAA;IAC/B,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC9B,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAUD;;;;EAIE;AAEF,iBAAwB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CA4J5D;kBA5JuB,YAAY;;;;;eAAZ,YAAY"}
1
+ {"version":3,"file":"messageSpace.d.ts","sourceRoot":"","sources":["../../../src/components/messageSpace/messageSpace.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAQ3B,OAAsB,EACpB,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,iBAAiB,EACjB,eAAe,EAChB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,0LAA0L;IAC1L,EAAE,EAAE,eAAe,CAAA;IACnB,0GAA0G;IAC1G,MAAM,EAAE,MAAM,CAAA;IACd,2GAA2G;IAC3G,iBAAiB,EAAE,YAAY,CAAA;IAC/B,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC9B,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAUD;;;;EAIE;AAEF,iBAAwB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CA+J5D;kBA/JuB,YAAY;;;;;eAAZ,YAAY"}