@rustic-ai/ui-components 0.0.18 → 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 (197) hide show
  1. package/dist/components/calendar/fCCalendar.d.ts +9 -0
  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/codeSnippet.d.ts +7 -0
  8. package/dist/components/codeSnippet/codeSnippet.d.ts.map +1 -1
  9. package/dist/components/codeSnippet/index.css +14 -0
  10. package/dist/components/codeSnippet/index.d.ts +5 -0
  11. package/dist/components/codeSnippet/index.d.ts.map +1 -0
  12. package/dist/components/codeSnippet/index.js +1 -0
  13. package/dist/components/elementRenderer/index.d.ts +3 -0
  14. package/dist/components/elementRenderer/index.d.ts.map +1 -0
  15. package/dist/components/elementRenderer/index.js +1 -0
  16. package/dist/components/filePreview/filePreview.d.ts +17 -1
  17. package/dist/components/filePreview/filePreview.d.ts.map +1 -1
  18. package/dist/components/image/image.d.ts +1 -0
  19. package/dist/components/image/image.d.ts.map +1 -1
  20. package/dist/components/image/index.css +43 -0
  21. package/dist/components/image/index.d.ts +5 -0
  22. package/dist/components/image/index.d.ts.map +1 -0
  23. package/dist/components/image/index.js +1 -0
  24. package/dist/components/index.d.ts +5 -1
  25. package/dist/components/index.d.ts.map +1 -1
  26. package/dist/components/input/baseInput/baseInput.d.ts.map +1 -1
  27. package/dist/components/input/emoji/emoji.d.ts.map +1 -1
  28. package/dist/components/input/emoji/index.css +16 -0
  29. package/dist/components/input/emoji/index.d.ts +4 -0
  30. package/dist/components/input/emoji/index.d.ts.map +1 -0
  31. package/dist/components/input/emoji/index.js +1 -0
  32. package/dist/components/input/multimodal/multimodalInput/index.css +227 -0
  33. package/dist/components/input/multimodal/multimodalInput/index.d.ts +5 -0
  34. package/dist/components/input/multimodal/multimodalInput/index.d.ts.map +1 -0
  35. package/dist/components/input/multimodal/multimodalInput/index.js +1 -0
  36. package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts +8 -1
  37. package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
  38. package/dist/components/input/multimodal/uploader/index.css +145 -0
  39. package/dist/components/input/multimodal/uploader/index.d.ts +5 -0
  40. package/dist/components/input/multimodal/uploader/index.d.ts.map +1 -0
  41. package/dist/components/input/multimodal/uploader/index.js +1 -0
  42. package/dist/components/input/textInput/index.css +57 -0
  43. package/dist/components/input/textInput/index.d.ts +4 -0
  44. package/dist/components/input/textInput/index.d.ts.map +1 -0
  45. package/dist/components/input/textInput/index.js +1 -0
  46. package/dist/components/input/textInput/textInput.d.ts +0 -3
  47. package/dist/components/input/textInput/textInput.d.ts.map +1 -1
  48. package/dist/components/map/index.css +13 -0
  49. package/dist/components/map/index.d.ts +5 -0
  50. package/dist/components/map/index.d.ts.map +1 -0
  51. package/dist/components/map/index.js +1 -0
  52. package/dist/components/map/openLayersMap.d.ts +10 -0
  53. package/dist/components/map/openLayersMap.d.ts.map +1 -1
  54. package/dist/components/markdown/index.d.ts +6 -0
  55. package/dist/components/markdown/index.d.ts.map +1 -0
  56. package/dist/components/markdown/index.js +1 -0
  57. package/dist/components/markdown/markedMarkdown.d.ts +13 -0
  58. package/dist/components/markdown/markedMarkdown.d.ts.map +1 -1
  59. package/dist/components/media/audio/index.css +182 -0
  60. package/dist/components/media/audio/index.d.ts +5 -0
  61. package/dist/components/media/audio/index.d.ts.map +1 -0
  62. package/dist/components/media/audio/index.js +1 -0
  63. package/dist/components/media/audio/sound.d.ts +1 -0
  64. package/dist/components/media/audio/sound.d.ts.map +1 -1
  65. package/dist/components/media/video/index.css +225 -0
  66. package/dist/components/media/video/index.d.ts +5 -0
  67. package/dist/components/media/video/index.d.ts.map +1 -0
  68. package/dist/components/media/video/index.js +1 -0
  69. package/dist/components/media/video/video.d.ts +1 -0
  70. package/dist/components/media/video/video.d.ts.map +1 -1
  71. package/dist/components/menu/index.css +26 -0
  72. package/dist/components/menu/index.d.ts +4 -0
  73. package/dist/components/menu/index.d.ts.map +1 -0
  74. package/dist/components/menu/index.js +1 -0
  75. package/dist/components/menu/popoverMenu.d.ts +3 -0
  76. package/dist/components/menu/popoverMenu.d.ts.map +1 -1
  77. package/dist/components/messageCanvas/actions/action.d.ts +12 -0
  78. package/dist/components/messageCanvas/actions/action.d.ts.map +1 -0
  79. package/dist/components/messageCanvas/actions/copy/index.css +8 -0
  80. package/dist/components/messageCanvas/actions/copy/index.d.ts +3 -0
  81. package/dist/components/messageCanvas/actions/copy/index.d.ts.map +1 -0
  82. package/dist/components/messageCanvas/actions/copy/index.js +1 -0
  83. package/dist/components/messageCanvas/actions/index.css +4 -0
  84. package/dist/components/messageCanvas/actions/index.d.ts +4 -11
  85. package/dist/components/messageCanvas/actions/index.d.ts.map +1 -1
  86. package/dist/components/messageCanvas/actions/index.js +1 -0
  87. package/dist/components/messageCanvas/actions/textToSpeech/index.css +8 -0
  88. package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts +3 -0
  89. package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts.map +1 -0
  90. package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -0
  91. package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts +6 -0
  92. package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts.map +1 -0
  93. package/dist/components/messageCanvas/index.css +39 -0
  94. package/dist/components/messageCanvas/index.d.ts +4 -0
  95. package/dist/components/messageCanvas/index.d.ts.map +1 -0
  96. package/dist/components/messageCanvas/index.js +1 -0
  97. package/dist/components/messageSpace/index.css +63 -0
  98. package/dist/components/messageSpace/index.d.ts +4 -0
  99. package/dist/components/messageSpace/index.d.ts.map +1 -0
  100. package/dist/components/messageSpace/index.js +1 -0
  101. package/dist/components/messageSpace/messageSpace.d.ts +4 -2
  102. package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
  103. package/dist/components/multipart/index.css +134 -0
  104. package/dist/components/multipart/index.d.ts +5 -0
  105. package/dist/components/multipart/index.d.ts.map +1 -0
  106. package/dist/components/multipart/index.js +1 -0
  107. package/dist/components/multipart/multipart.d.ts +1 -0
  108. package/dist/components/multipart/multipart.d.ts.map +1 -1
  109. package/dist/components/participantsContainer/index.css +42 -0
  110. package/dist/components/participantsContainer/index.d.ts +4 -0
  111. package/dist/components/participantsContainer/index.d.ts.map +1 -0
  112. package/dist/components/participantsContainer/index.js +1 -0
  113. package/dist/components/participantsContainer/participantsContainer.d.ts +3 -1
  114. package/dist/components/participantsContainer/participantsContainer.d.ts.map +1 -1
  115. package/dist/components/pdfViewer/index.css +60 -0
  116. package/dist/components/pdfViewer/index.d.ts +5 -0
  117. package/dist/components/pdfViewer/index.d.ts.map +1 -0
  118. package/dist/components/pdfViewer/index.js +1 -0
  119. package/dist/components/pdfViewer/pdfViewer.d.ts +4 -0
  120. package/dist/components/pdfViewer/pdfViewer.d.ts.map +1 -1
  121. package/dist/components/promptBuilder/index.css +96 -0
  122. package/dist/components/promptBuilder/index.d.ts +5 -0
  123. package/dist/components/promptBuilder/index.d.ts.map +1 -0
  124. package/dist/components/promptBuilder/index.js +1 -0
  125. package/dist/components/promptBuilder/mockWebSocket.d.ts +5 -0
  126. package/dist/components/promptBuilder/mockWebSocket.d.ts.map +1 -0
  127. package/dist/components/promptBuilder/promptBuilder.d.ts +24 -0
  128. package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -0
  129. package/dist/components/question/index.css +14 -0
  130. package/dist/components/question/index.d.ts +5 -0
  131. package/dist/components/question/index.d.ts.map +1 -0
  132. package/dist/components/question/index.js +1 -0
  133. package/dist/components/question/question.d.ts +7 -1
  134. package/dist/components/question/question.d.ts.map +1 -1
  135. package/dist/components/table/index.css +43 -0
  136. package/dist/components/table/index.d.ts +5 -0
  137. package/dist/components/table/index.d.ts.map +1 -0
  138. package/dist/components/table/index.js +1 -0
  139. package/dist/components/table/table.d.ts +1 -0
  140. package/dist/components/table/table.d.ts.map +1 -1
  141. package/dist/components/text/index.css +5 -0
  142. package/dist/components/text/index.d.ts +7 -0
  143. package/dist/components/text/index.d.ts.map +1 -0
  144. package/dist/components/text/index.js +1 -0
  145. package/dist/components/text/text.d.ts +12 -0
  146. package/dist/components/text/text.d.ts.map +1 -1
  147. package/dist/components/timestamp/index.d.ts +3 -0
  148. package/dist/components/timestamp/index.d.ts.map +1 -0
  149. package/dist/components/timestamp/timestamp.d.ts +1 -0
  150. package/dist/components/timestamp/timestamp.d.ts.map +1 -1
  151. package/dist/components/types.d.ts +28 -31
  152. package/dist/components/types.d.ts.map +1 -1
  153. package/dist/components/video/index.css +34 -0
  154. package/dist/components/video/index.d.ts +3 -0
  155. package/dist/components/video/index.d.ts.map +1 -0
  156. package/dist/components/video/index.js +1 -0
  157. package/dist/components/video/youtubeVideo.d.ts +8 -0
  158. package/dist/components/video/youtubeVideo.d.ts.map +1 -1
  159. package/dist/components/visualization/chart/index.css +44 -0
  160. package/dist/components/visualization/chart/index.d.ts +4 -0
  161. package/dist/components/visualization/chart/index.d.ts.map +1 -0
  162. package/dist/components/visualization/chart/index.js +1 -0
  163. package/dist/components/visualization/chart/rechartsTimeSeries.d.ts +8 -0
  164. package/dist/components/visualization/chart/rechartsTimeSeries.d.ts.map +1 -1
  165. package/dist/components/visualization/mermaidViz/index.css +21 -0
  166. package/dist/components/visualization/mermaidViz/index.d.ts +5 -0
  167. package/dist/components/visualization/mermaidViz/index.d.ts.map +1 -0
  168. package/dist/components/visualization/mermaidViz/index.js +1 -0
  169. package/dist/components/visualization/mermaidViz/mermaidViz.d.ts +9 -2
  170. package/dist/components/visualization/mermaidViz/mermaidViz.d.ts.map +1 -1
  171. package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts +10 -0
  172. package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts.map +1 -0
  173. package/dist/components/visualization/perspectiveViz/index.css +16 -0
  174. package/dist/components/visualization/perspectiveViz/index.d.ts +5 -0
  175. package/dist/components/visualization/perspectiveViz/index.d.ts.map +1 -0
  176. package/dist/components/visualization/perspectiveViz/index.js +1 -0
  177. package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts +7 -4
  178. package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts.map +1 -1
  179. package/dist/components/visualization/vegaLiteViz/index.css +45 -0
  180. package/dist/components/visualization/vegaLiteViz/index.d.ts +5 -0
  181. package/dist/components/visualization/vegaLiteViz/index.d.ts.map +1 -0
  182. package/dist/components/visualization/vegaLiteViz/index.js +1 -0
  183. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts +9 -2
  184. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts.map +1 -1
  185. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts +20 -0
  186. package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts.map +1 -0
  187. package/dist/components/weather/index.css +77 -0
  188. package/dist/components/weather/index.d.ts +5 -0
  189. package/dist/components/weather/index.d.ts.map +1 -0
  190. package/dist/components/weather/index.js +1 -0
  191. package/dist/index.css +120 -35
  192. package/dist/index.js +1 -2
  193. package/dist/rusticTheme.d.ts +29 -0
  194. package/dist/rusticTheme.d.ts.map +1 -1
  195. package/dist/rusticTheme.js +1 -0
  196. package/package.json +123 -22
  197. package/dist/index.js.LICENSE.txt +0 -1
@@ -0,0 +1,134 @@
1
+ .rustic-multipart {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 16px;
5
+ }
6
+
7
+ body {
8
+ margin: 0;
9
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
10
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
11
+ sans-serif;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ code {
17
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
18
+ monospace;
19
+ }
20
+
21
+ .rustic-fit-container {
22
+ object-fit: contain;
23
+ width: 100%;
24
+ height: 100%;
25
+ }
26
+
27
+ .rustic-files {
28
+ display: flex;
29
+ gap: 8px;
30
+ flex-wrap: wrap;
31
+ }
32
+
33
+ .rustic-cursor-pointer {
34
+ cursor: pointer;
35
+ }
36
+
37
+ .rustic-align-self-center {
38
+ align-self: center;
39
+ }
40
+
41
+ .rustic-file-preview {
42
+ position: relative;
43
+ display: flex;
44
+ align-items: center;
45
+ padding: 8px 8px 8px 16px;
46
+ justify-content: space-between;
47
+ width: 220px;
48
+ height: 56px;
49
+ }
50
+
51
+ .rustic-file-preview-modal {
52
+ width: 90vw;
53
+ height: 90vh;
54
+ display: flex;
55
+ align-self: center;
56
+ justify-self: center;
57
+ }
58
+
59
+ .rustic-file-preview-modal .rustic-modal-content {
60
+ position: relative;
61
+ width: 100%;
62
+ }
63
+
64
+ .rustic-modal-content .rustic-close-button {
65
+ position: absolute;
66
+ top: 16px;
67
+ right: 16px;
68
+ }
69
+
70
+ span.rustic-icon-large {
71
+ font-size: 32px;
72
+ }
73
+
74
+ .rustic-pdf-viewer {
75
+ width: 100%;
76
+ height: 100%;
77
+ display: flex;
78
+ flex-direction: column;
79
+ padding: 16px;
80
+ }
81
+
82
+ .rustic-pdf-error {
83
+ padding: 16px;
84
+ width: fit-content;
85
+ }
86
+
87
+ .rustic-pdf-viewer .rustic-pdf-viewer-header {
88
+ display: flex;
89
+ align-items: center;
90
+ margin-bottom: 8px;
91
+ }
92
+
93
+ .rustic-pdf-viewer .rustic-pdf-canvas {
94
+ flex: 1;
95
+ }
96
+
97
+ .rustic-pdf-viewer .rustic-pdf-page-input > div {
98
+ height: 24px;
99
+ width: 56px;
100
+ }
101
+
102
+ .rustic-pdf-viewer .rustic-pdf-page-input input {
103
+ text-align: center;
104
+ }
105
+
106
+ .rustic-pdf-viewer
107
+ .rustic-pdf-page-input
108
+ input[type='number']::-webkit-inner-spin-button {
109
+ display: none;
110
+ }
111
+
112
+ .rustic-pdf-viewer .rustic-page-indicator {
113
+ display: flex;
114
+ align-items: center;
115
+ gap: 8px;
116
+ }
117
+
118
+ .rustic-pdf-viewer-body {
119
+ flex: 1;
120
+ display: flex;
121
+ justify-content: center;
122
+ overflow: auto;
123
+ }
124
+
125
+ .rustic-pdf-viewer-body-inner {
126
+ overflow: auto;
127
+ width: fit-content;
128
+ }
129
+
130
+ .rustic-text {
131
+ white-space: break-spaces;
132
+ overflow-wrap: break-word;
133
+ }
134
+
@@ -0,0 +1,5 @@
1
+ import './multipart.css';
2
+ import Multipart from './multipart';
3
+ export * from '../types';
4
+ export default Multipart;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/multipart/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,cAAc,UAAU,CAAA;AACxB,eAAe,SAAS,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 t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[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,{ParticipantRole:()=>A,ParticipantType:()=>F,default:()=>H});const t=require("react/jsx-runtime"),n=require("@mui/material/IconButton");var i=e.n(n);const a=require("@mui/material/Tooltip");var o=e.n(a);const s=require("@mui/system/Box");var l=e.n(s);const c=require("react"),u=require("@mui/material/Card");var d=e.n(u);const m=require("@mui/material/Modal");var f=e.n(m);const p=require("@mui/material/styles"),x=require("@mui/material/Typography");var h,v=e.n(x);function j(e){return e.name.replaceAll("_","-"),(0,t.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 b=require("@mui/material/Box");var y=e.n(b);const g=require("@mui/material/TextField");var w=e.n(g);const N=require("@mui/material/useMediaQuery");var C=e.n(N);const P=require("@mui/system/Stack");var k=e.n(P);const q=require("@mui/system/useTheme");var S=e.n(q);const O=require("pdfjs-dist"),T=function(e){var r={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(r[e.action].label.replaceAll(" ","-").toLowerCase(),r[e.action]);return(0,t.jsx)(o(),{title:n.label,children:(0,t.jsx)("span",{children:(0,t.jsx)(i(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,t.jsx)(j,{name:n.symbol})})})})};var _={pdf:function(e){var r,n=(0,c.useRef)(null),i=(0,c.useState)(1),a=i[0],o=i[1],s=(0,c.useState)(1),l=s[0],u=s[1],m=(0,c.useState)(1),f=m[0],p=m[1],x=(0,c.useState)(!1),h=x[0],j=x[1],b=(0,c.useState)(),g=b[0],N=b[1],P=S()(),q=C()(P.breakpoints.down("sm")),_=C()(P.breakpoints.between("sm","md"));if(r=e.url,!/\/[^/]+\.pdf$/.test(r))return(0,t.jsx)(d(),{variant:"outlined",className:"rustic-pdf-error",children:(0,t.jsx)(v(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var z=(0,c.useState)((function(){return q?.5:_?1:1.5})),D=z[0],M=z[1];return(0,c.useEffect)((function(){O.GlobalWorkerOptions.workerSrc||(O.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(O.version,"/pdf.worker.mjs")),O.getDocument({url:"".concat(e.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(a).then((function(e){var r=e.getViewport({scale:D}),t=n.current;if(t){var i=t.getContext("2d");if(i){var a=window.devicePixelRatio||1;t.style.width="".concat(r.width,"px"),t.style.height="".concat(r.height,"px"),t.width=r.width*a,t.height=r.height*a;var o={canvasContext:i,viewport:r,transform:[a,0,0,a,0,0]};g&&g.cancel();var s=e.render(o);N(s),s.promise.then((function(){N(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){j(!0)}))}),[e.url,a,D]),h?(0,t.jsx)(d(),{variant:"outlined",className:"rustic-pdf-error",children:(0,t.jsx)(v(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,t.jsxs)(d(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,t.jsxs)(y(),{className:"rustic-pdf-viewer-header",children:[(0,t.jsx)(T,{action:"zoomOut",onClick:function(){M((function(e){return Math.max(e-.2,.2)}))}}),(0,t.jsx)(T,{action:"zoomIn",onClick:function(){M((function(e){return e+.2}))}})]}),(0,t.jsx)(y(),{className:"rustic-pdf-viewer-body",children:(0,t.jsx)(y(),{className:"rustic-pdf-viewer-body-inner",children:(0,t.jsx)("canvas",{ref:n})})}),(0,t.jsxs)(k(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,t.jsx)(T,{action:"previousPage",onClick:function(){a>1&&(o(a-1),p(a-1))},isDisabled:1===a}),(0,t.jsx)(v(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,t.jsx)(w(),{type:"number",value:f,onChange:function(e){var r=parseInt(e.target.value);p(r),!isNaN(r)&&r>=1&&r<=l&&o(r)},size:"small",className:"rustic-pdf-page-input"}),(0,t.jsxs)(v(),{variant:"body1",className:"rustic-page-indicator",children:["of ",l]}),(0,t.jsx)(T,{action:"nextPage",onClick:function(){a<l&&(o(a+1),p(a+1))},isDisabled:a===l})]})]})}};function z(e){var r=(0,p.useTheme)(),n=(0,c.useState)(!1),a=n[0],s=n[1];function l(){s(!1)}var u,m,x=e.file.url&&(u=e.file.url.split("."))[u.length-1].toLowerCase(),h=x&&e.supportedViewers?e.supportedViewers[x]:null,b=!!h;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d(),{className:"rustic-file-preview".concat(b?" rustic-cursor-pointer":""),variant:"outlined",sx:{boxShadow:r.shadows[1]},onClick:function(){s(!0)},children:[(0,t.jsx)(v(),{variant:"subtitle2",children:(m=e.file.name,15,m.length<=15?m:m.substring(0,12)+"...")}),(0,t.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:e.children})]}),b&&(0,t.jsx)(f(),{open:a,onClose:l,className:"rustic-file-preview-modal",children:(0,t.jsxs)("div",{className:"rustic-modal-content",children:[(0,t.jsx)(o(),{title:"Close",children:(0,t.jsx)(i(),{onClick:l,className:"rustic-close-button",children:(0,t.jsx)(j,{name:"close"})})}),e.file.url&&(0,t.jsx)(h,{url:e.file.url})]})})]})}z.defaultProps={supportedViewers:_};const D=require("dompurify");var M=e.n(D);const R=function(e){return(0,t.jsx)(v(),{variant:"body2",className:"rustic-text",children:M().sanitize(e.text)})};var A,F;!function(e){e.Owner="owner",e.Member="member"}(A||(A={})),function(e){e.Human="human",e.Agent="agent"}(F||(F={}));const H=function(e){return(0,t.jsxs)(l(),{className:"rustic-multipart",children:[e.text&&(0,t.jsx)(R,{text:e.text}),(r=e.files.map((function(e,r){return(0,t.jsx)(z,{file:e,children:e.url&&(0,t.jsx)(o(),{title:"Download",children:(0,t.jsx)(i(),{component:"a",href:e.url,download:e.name,children:(0,t.jsx)(j,{name:"download"})})})},r)})),(0,t.jsx)(l(),{className:"rustic-files",children:r}))]});var r};return r})()));
@@ -1,5 +1,6 @@
1
1
  import '../../index.css';
2
2
  import './multipart.css';
3
3
  import type { MultipartData } from '../types';
4
+ /** The `Multipart` component is a versatile message format designed to accommodate both textual content and file attachments within a single message interface. */
4
5
  export default function Multipart(props: MultipartData): import("react/jsx-runtime").JSX.Element;
5
6
  //# sourceMappingURL=multipart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../../src/components/multipart/multipart.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AAUxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,aAAa,2CA8BrD"}
1
+ {"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../../src/components/multipart/multipart.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AAUxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,mKAAmK;AACnK,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,aAAa,2CA8BrD"}
@@ -0,0 +1,42 @@
1
+ .rustic-participant-list {
2
+ padding: 24px;
3
+ }
4
+
5
+ .rustic-participant-list-no-participants-message {
6
+ padding: 24px;
7
+ }
8
+
9
+ .rustic-participants-container-title {
10
+ padding: 24px 32px 16px 32px;
11
+ }
12
+
13
+ .rustic-participant-list-item {
14
+ justify-content: space-between;
15
+ display: flex;
16
+ align-items: center;
17
+ gap: 8px;
18
+ }
19
+
20
+ .rustic-participant-list-subheader {
21
+ display: flex;
22
+ flex-wrap: wrap;
23
+ justify-content: space-between;
24
+ align-items: center;
25
+ gap: 8px;
26
+ margin-bottom: 16px;
27
+ }
28
+
29
+ .rustic-participant-list-subheader-title {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 8px;
33
+ }
34
+
35
+ .rustic-participants-container-divider {
36
+ margin-inline: 24px;
37
+ }
38
+
39
+ span.rustic-icon-large {
40
+ font-size: 32px;
41
+ }
42
+
@@ -0,0 +1,4 @@
1
+ import './participantsContainer.css';
2
+ import ParticipantsContainer from './participantsContainer';
3
+ export default ParticipantsContainer;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/index.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AAEpC,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAE3D,eAAe,qBAAqB,CAAA"}
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@rustic-ai/ui-components"]=e():t["@rustic-ai/ui-components"]=e()}(global,(()=>(()=>{"use strict";var t={n:e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>S});const r=require("react/jsx-runtime"),i=require("@mui/material/Button");var a=t.n(i);const n=require("@mui/material/Dialog");var c=t.n(n);const s=require("@mui/material/DialogTitle");var o=t.n(s);const l=require("@mui/material/Divider");var p=t.n(l);const u=require("@mui/material/List");var m=t.n(u);const d=require("@mui/material/ListItem");var y=t.n(d);const f=require("@mui/material/ListSubheader");var h=t.n(f);const x=require("@mui/material/Typography");var j=t.n(x);const b=require("@mui/system"),v=require("pluralize");var g=t.n(v);const T=require("react");var N,O,q;function _(t){return t.name.replaceAll("_","-"),(0,r.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}!function(t){t[t.HOUR=0]="HOUR",t[t.MONTH_DATE=1]="MONTH_DATE"}(N||(N={})),function(t){t.Owner="owner",t.Member="member"}(O||(O={})),function(t){t.Human="human",t.Agent="agent"}(q||(q={}));function A(t){var e=(0,T.useState)(!1),i=e[0],n=e[1],c=t.participants.length,s=i?t.participants:t.participants.slice(0,3),o="".concat(g()(t.participantType,c)," (").concat(c,")"),l=i?"Show Less":"Show All ".concat(c);return 0===c?(0,r.jsx)(j(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,r.jsx)(m(),{className:"rustic-participant-list",subheader:(0,r.jsxs)(h(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,r.jsxs)(b.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,r.jsx)(j(),{variant:"subtitle2",color:"text.secondary",children:o})]}),c>3&&(0,r.jsx)(a(),{onClick:function(){return n(!i)},color:"primary",size:"small",startIcon:(0,r.jsx)(_,{name:"keyboard_arrow_down"}),children:l})]}),children:s.map((function(t){return(0,r.jsxs)(y(),{className:"rustic-participant-list-item",children:[(0,r.jsx)(j(),{variant:"subtitle2",children:t.displayName}),(0,r.jsx)(j(),{variant:t.participantRole===O.Owner?"subtitle2":"caption",children:(e=t.participantRole,e.charAt(0).toUpperCase()+e.slice(1))})]},t.id);var e}))})}const S=function(t){function e(t,e){return function(t){return function(t,e,r){if(r||2===arguments.length)for(var i,a=0,n=e.length;a<n;a++)!i&&a in e||(i||(i=Array.prototype.slice.call(e,0,a)),i[a]=e[a]);return t.concat(i||Array.prototype.slice.call(e))}([],t,!0).sort((function(t,e){return e.participantRole===O.Owner?1:-1}))}(t.filter((function(t){return t.participantType===e})))}var i=e(t.participants,q.Human),a=e(t.participants,q.Agent),n="".concat(g()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,r.jsxs)(c(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(o(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:n}),(0,r.jsx)(A,{participantType:"Human",participantTypeIcon:(0,r.jsx)(_,{name:"account_circle"}),participants:i}),a.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p(),{className:"rustic-participants-container-divider"}),(0,r.jsx)(A,{participantType:"Agent",participantTypeIcon:(0,r.jsx)(_,{name:"smart_toy"}),participants:a})]})]})};return e})()));
@@ -7,7 +7,9 @@ export interface ParticipantsContainerProps {
7
7
  /** Callback function to close the participants modal. */
8
8
  onClose: () => void;
9
9
  }
10
- /** The `ParticipantsContainer` component is responsible for displaying a list of participants within a dialog window. It organizes participants into separate lists based on their type (human or agent) and provides options to toggle between showing a subset of participants and displaying the full list. This component enhances the user experience by presenting participant information in a structured format and allowing users to view additional details as needed. \n\nNote: The component does not include the button displayed to toggle between the two views. This button is typically implemented in the parent component that uses the `ParticipantsContainer` component. */
10
+ /** The `ParticipantsContainer` component is responsible for displaying a list of participants within a dialog window. It organizes participants into separate lists based on their type (human or agent) and provides options to toggle between showing a subset of participants and displaying the full list. This component enhances the user experience by presenting participant information in a structured format and allowing users to view additional details as needed.
11
+ *
12
+ * Note: The component does not include the button displayed to toggle between the two views. This button is typically implemented in the parent component that uses the `ParticipantsContainer` component. */
11
13
  declare function ParticipantsContainer(props: ParticipantsContainerProps): import("react/jsx-runtime").JSX.Element;
12
14
  export default ParticipantsContainer;
13
15
  //# sourceMappingURL=participantsContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"participantsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/participantsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AAkBpC,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,UAAU,CAAA;AAE7E,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,6EAA6E;IAC7E,qBAAqB,EAAE,OAAO,CAAA;IAC9B,yDAAyD;IACzD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AA+FD,iqBAAiqB;AACjqB,iBAAS,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAyE/D;AAED,eAAe,qBAAqB,CAAA"}
1
+ {"version":3,"file":"participantsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/participantsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AAkBpC,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,UAAU,CAAA;AAE7E,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,6EAA6E;IAC7E,qBAAqB,EAAE,OAAO,CAAA;IAC9B,yDAAyD;IACzD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AA+FD;;8MAE8M;AAC9M,iBAAS,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAyE/D;AAED,eAAe,qBAAqB,CAAA"}
@@ -0,0 +1,60 @@
1
+ .rustic-pdf-viewer {
2
+ width: 100%;
3
+ height: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+ padding: 16px;
7
+ }
8
+
9
+ .rustic-pdf-error {
10
+ padding: 16px;
11
+ width: fit-content;
12
+ }
13
+
14
+ .rustic-pdf-viewer .rustic-pdf-viewer-header {
15
+ display: flex;
16
+ align-items: center;
17
+ margin-bottom: 8px;
18
+ }
19
+
20
+ .rustic-pdf-viewer .rustic-pdf-canvas {
21
+ flex: 1;
22
+ }
23
+
24
+ .rustic-pdf-viewer .rustic-pdf-page-input > div {
25
+ height: 24px;
26
+ width: 56px;
27
+ }
28
+
29
+ .rustic-pdf-viewer .rustic-pdf-page-input input {
30
+ text-align: center;
31
+ }
32
+
33
+ .rustic-pdf-viewer
34
+ .rustic-pdf-page-input
35
+ input[type='number']::-webkit-inner-spin-button {
36
+ display: none;
37
+ }
38
+
39
+ .rustic-pdf-viewer .rustic-page-indicator {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 8px;
43
+ }
44
+
45
+ .rustic-pdf-viewer-body {
46
+ flex: 1;
47
+ display: flex;
48
+ justify-content: center;
49
+ overflow: auto;
50
+ }
51
+
52
+ .rustic-pdf-viewer-body-inner {
53
+ overflow: auto;
54
+ width: fit-content;
55
+ }
56
+
57
+ span.rustic-icon-large {
58
+ font-size: 32px;
59
+ }
60
+
@@ -0,0 +1,5 @@
1
+ import './pdfViewer.css';
2
+ import PDFViewer from './pdfViewer';
3
+ export * from '../types';
4
+ export default PDFViewer;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pdfViewer/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,cAAc,UAAU,CAAA;AACxB,eAAe,SAAS,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 n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},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,{ParticipantRole:()=>k,ParticipantType:()=>S,default:()=>C});const r=require("react/jsx-runtime"),n=require("@mui/material/Box");var a=e.n(n);const o=require("@mui/material/Card");var i=e.n(o);const s=require("@mui/material/TextField");var c=e.n(s);const l=require("@mui/material/Typography");var u=e.n(l);const d=require("@mui/material/useMediaQuery");var m=e.n(d);const f=require("@mui/system/Stack");var p=e.n(f);const v=require("@mui/system/useTheme");var b=e.n(v);const h=require("pdfjs-dist"),x=require("react"),j=require("@mui/material/IconButton");var y=e.n(j);const g=require("@mui/material/Tooltip");var w=e.n(g);function N(e){return e.name.replaceAll("_","-"),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}const P=function(e){var t={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(t[e.action].label.replaceAll(" ","-").toLowerCase(),t[e.action]);return(0,r.jsx)(w(),{title:n.label,children:(0,r.jsx)("span",{children:(0,r.jsx)(y(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,r.jsx)(N,{name:n.symbol})})})})};var k,S;!function(e){e.Owner="owner",e.Member="member"}(k||(k={})),function(e){e.Human="human",e.Agent="agent"}(S||(S={}));const C=function(e){var t,n=(0,x.useRef)(null),o=(0,x.useState)(1),s=o[0],l=o[1],d=(0,x.useState)(1),f=d[0],v=d[1],j=(0,x.useState)(1),y=j[0],g=j[1],w=(0,x.useState)(!1),N=w[0],k=w[1],S=(0,x.useState)(),C=S[0],q=S[1],O=b()(),_=m()(O.breakpoints.down("sm")),T=m()(O.breakpoints.between("sm","md"));if(t=e.url,!/\/[^/]+\.pdf$/.test(t))return(0,r.jsx)(i(),{variant:"outlined",className:"rustic-pdf-error",children:(0,r.jsx)(u(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var z=(0,x.useState)((function(){return _?.5:T?1:1.5})),D=z[0],M=z[1];return(0,x.useEffect)((function(){h.GlobalWorkerOptions.workerSrc||(h.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(h.version,"/pdf.worker.mjs")),h.getDocument({url:"".concat(e.url)}).promise.then((function(e){v(e.numPages),function(e){e.getPage(s).then((function(e){var t=e.getViewport({scale:D}),r=n.current;if(r){var a=r.getContext("2d");if(a){var o=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*o,r.height=t.height*o;var i={canvasContext:a,viewport:t,transform:[o,0,0,o,0,0]};C&&C.cancel();var s=e.render(i);q(s),s.promise.then((function(){q(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){k(!0)}))}),[e.url,s,D]),N?(0,r.jsx)(i(),{variant:"outlined",className:"rustic-pdf-error",children:(0,r.jsx)(u(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,r.jsxs)(i(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,r.jsxs)(a(),{className:"rustic-pdf-viewer-header",children:[(0,r.jsx)(P,{action:"zoomOut",onClick:function(){M((function(e){return Math.max(e-.2,.2)}))}}),(0,r.jsx)(P,{action:"zoomIn",onClick:function(){M((function(e){return e+.2}))}})]}),(0,r.jsx)(a(),{className:"rustic-pdf-viewer-body",children:(0,r.jsx)(a(),{className:"rustic-pdf-viewer-body-inner",children:(0,r.jsx)("canvas",{ref:n})})}),(0,r.jsxs)(p(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,r.jsx)(P,{action:"previousPage",onClick:function(){s>1&&(l(s-1),g(s-1))},isDisabled:1===s}),(0,r.jsx)(u(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,r.jsx)(c(),{type:"number",value:y,onChange:function(e){var t=parseInt(e.target.value);g(t),!isNaN(t)&&t>=1&&t<=f&&l(t)},size:"small",className:"rustic-pdf-page-input"}),(0,r.jsxs)(u(),{variant:"body1",className:"rustic-page-indicator",children:["of ",f]}),(0,r.jsx)(P,{action:"nextPage",onClick:function(){s<f&&(l(s+1),g(s+1))},isDisabled:s===f})]})]})};return t})()));
@@ -12,6 +12,10 @@ export declare function setPdfWorkerSrc(workerSrc: string): void;
12
12
  * ```
13
13
  *
14
14
  * Note: [PDF.js](https://mozilla.github.io/pdf.js/) is not bundled, so it must be included in the application's build process.
15
+ *
16
+ * ```typescript
17
+ * npm i pdfjs-dist
18
+ * ```
15
19
  */
16
20
  declare function PDFViewer(props: PDFViewerProps): import("react/jsx-runtime").JSX.Element;
17
21
  export default PDFViewer;
@@ -1 +1 @@
1
- {"version":3,"file":"pdfViewer.d.ts","sourceRoot":"","sources":["../../../src/components/pdfViewer/pdfViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAaxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,QAEhD;AAMD;;;;;;;;;;;GAWG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,2CA0LvC;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"pdfViewer.d.ts","sourceRoot":"","sources":["../../../src/components/pdfViewer/pdfViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAaxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,QAEhD;AAMD;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,2CA0LvC;AAED,eAAe,SAAS,CAAA"}
@@ -0,0 +1,96 @@
1
+ .rustic-prompt-builder {
2
+ padding: 24px;
3
+ }
4
+
5
+ .rustic-prompt-builder-avatar {
6
+ width: 24px;
7
+ height: 24px;
8
+ }
9
+
10
+ .rustic-prompt-builder-divider {
11
+ margin-top: 16px;
12
+ margin-bottom: 24px;
13
+ }
14
+
15
+ .rustic-prompt-builder-questions {
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: 24px;
19
+ }
20
+
21
+ .rustic-prompt-builder-question {
22
+ gap: 8px;
23
+ }
24
+
25
+ .rustic-prompt-builder-buttons {
26
+ display: flex;
27
+ justify-content: space-between;
28
+ margin-top: 56px;
29
+ gap: 16px;
30
+ }
31
+
32
+ .rustic-prompt-builder-buttons-left {
33
+ width: 100%;
34
+ display: flex;
35
+ gap: 8px;
36
+ justify-content: space-between;
37
+ }
38
+
39
+ .rustic-prompt-builder-dialog-buttons {
40
+ display: flex;
41
+ gap: 16px;
42
+ padding: 24px;
43
+ }
44
+
45
+ @media (max-width: 900px) {
46
+ .rustic-prompt-builder-buttons-right button {
47
+ flex: 1;
48
+ }
49
+
50
+ .rustic-prompt-builder-buttons {
51
+ flex-direction: column;
52
+ }
53
+
54
+ .rustic-prompt-builder-buttons-right {
55
+ display: flex;
56
+ }
57
+ }
58
+
59
+ body {
60
+ margin: 0;
61
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
62
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
63
+ sans-serif;
64
+ -webkit-font-smoothing: antialiased;
65
+ -moz-osx-font-smoothing: grayscale;
66
+ }
67
+
68
+ code {
69
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
70
+ monospace;
71
+ }
72
+
73
+ .rustic-fit-container {
74
+ object-fit: contain;
75
+ width: 100%;
76
+ height: 100%;
77
+ }
78
+
79
+ .rustic-files {
80
+ display: flex;
81
+ gap: 8px;
82
+ flex-wrap: wrap;
83
+ }
84
+
85
+ .rustic-cursor-pointer {
86
+ cursor: pointer;
87
+ }
88
+
89
+ .rustic-align-self-center {
90
+ align-self: center;
91
+ }
92
+
93
+ span.rustic-icon-large {
94
+ font-size: 32px;
95
+ }
96
+
@@ -0,0 +1,5 @@
1
+ import './promptBuilder.css';
2
+ import PromptBuilder from './promptBuilder';
3
+ export * from '../types';
4
+ export default PromptBuilder;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/promptBuilder/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAE3C,cAAc,UAAU,CAAA;AACxB,eAAe,aAAa,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 t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[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,{ParticipantRole:()=>D,ParticipantType:()=>B,default:()=>M});const t=require("react/jsx-runtime"),n=require("@mui/material/Button");var i=e.n(n);const a=require("@mui/material/Card");var s=e.n(a);const o=require("@mui/material/CircularProgress");var l=e.n(o);const c=require("@mui/material/Dialog");var u=e.n(c);const d=require("@mui/material/DialogActions");var m=e.n(d);const p=require("@mui/material/DialogContent");var f=e.n(p);const g=require("@mui/material/DialogContentText");var b=e.n(g);const h=require("@mui/material/DialogTitle");var x=e.n(h);const v=require("@mui/material/Divider");var j=e.n(v);const y=require("@mui/material/Typography");var q=e.n(y);const S=require("@mui/system"),w=require("react");var N=e.n(w),P=function(){return P=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},P.apply(this,arguments)};const C=function(e){var r=e.supportedElements[e.message.format];return(0,t.jsx)(t.Fragment,{children:r?N().createElement(r,P(P({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,t.jsxs)(q(),{variant:"body2",children:["Unsupported element format: ",e.message.format]})})};function O(e){return e.name.replaceAll("_","-"),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}var D,B,I=function(){return I=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},I.apply(this,arguments)},A=function(e,r,t){if(t||2===arguments.length)for(var n,i=0,a=r.length;i<a;i++)!n&&i in r||(n||(n=Array.prototype.slice.call(r,0,i)),n[i]=r[i]);return e.concat(n||Array.prototype.slice.call(r))};!function(e){e.Owner="owner",e.Member="member"}(D||(D={})),function(e){e.Human="human",e.Agent="agent"}(B||(B={}));const M=function(e){var r=(0,w.useState)(!1),n=r[0],a=r[1],o=(0,w.useState)(!1),c=o[0],d=o[1],p=(0,w.useState)(!1),g=p[0],h=p[1],v=(0,w.useState)(!1),y=v[0],N=v[1],P=(0,w.useState)([]),D=P[0],B=P[1],M=(0,w.useState)(null),T=M[0],E=M[1],_=(0,S.useTheme)(),k=D[D.length-1],Q=I(I({},e.ws),{send:function(e){E(e)}});function R(e){var r=JSON.parse(e.data);B((function(e){return A(A([],e,!0),[r],!1)}))}function F(){if(T){var r=I(I({},T),{threadId:e.messageId});e.ws.send(r)}}if((0,w.useEffect)((function(){e.ws.onReceive&&e.ws.onReceive(R)}),[e.ws]),(0,w.useEffect)((function(){D.length>0&&(k&&k.sender.id!==e.sender.id&&d(!1),"promptBuilder"===k.format&&k.data.isLastQuestion&&a(!0))}),[D.length]),0!==D.length)return(0,t.jsxs)(s(),{variant:"outlined",className:"rustic-prompt-builder",children:[(0,t.jsxs)(u(),{open:g,onClose:function(){return h(!1)},"aria-labelledby":"quit-dialog-title","aria-describedby":"quit-dialog-description",sx:{"& .MuiPaper-root":{width:"clamp(320px,50vw,600px)",border:"1px solid ".concat(_.palette.divider)}},children:[(0,t.jsx)(x(),{id:"quit-dialog-title",className:"rustic-align-self-center",children:"Are you sure?"}),(0,t.jsx)(j(),{}),(0,t.jsx)(f(),{children:(0,t.jsx)(b(),{id:"quit-dialog-description",className:"rustic-align-self-center",children:"All progress will be lost."})}),(0,t.jsxs)(m(),{className:"rustic-prompt-builder-dialog-buttons",disableSpacing:!0,children:[(0,t.jsx)(i(),{variant:"rusticSecondary",startIcon:(0,t.jsx)(O,{name:"close"}),onClick:function(){h(!1),e.onCancel()},children:"Quit"}),(0,t.jsx)(i(),{variant:"rusticPrimary",onClick:function(){return h(!1)},children:"Continue build"})]})]}),e.getProfileComponent?e.getProfileComponent(D[0]):(0,t.jsx)(q(),{color:"text.secondary",children:"Prompt Builder"}),(0,t.jsx)(j(),{className:"rustic-prompt-builder-divider"}),(0,t.jsxs)(S.Box,{className:"rustic-prompt-builder-questions",children:[function(){if(!y&&D.length>0)return D.map((function(r){if(r.sender.id!==e.sender.id&&"promptBuilder"!==r.format)return(0,t.jsx)(C,{ws:Q,sender:e.sender,message:r,supportedElements:e.supportedElements},r.id)}))}(),c&&(0,t.jsx)(l(),{color:"secondary",className:"rustic-align-self-center"})]}),(0,t.jsx)(t.Fragment,{children:!y&&(0,t.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons",children:[(0,t.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons-left",children:[(0,t.jsx)(i(),{variant:"rusticSecondary",startIcon:(0,t.jsx)(O,{name:"close"}),onClick:function(){return h(!0)},children:"Quit"}),(0,t.jsx)(i(),{variant:"rusticSecondary",endIcon:(0,t.jsx)(O,{name:"chevron_right"}),onClick:function(){F(),E(null),d(!0)},disabled:!T,"aria-disabled":!T,children:"Next question"})]}),n&&(0,t.jsx)(S.Box,{className:"rustic-prompt-builder-buttons-right",children:(0,t.jsx)(i(),{variant:"rusticPrimary",onClick:function(){F(),N(!0),d(!0),e.onSubmit()},disabled:c,"aria-disabled":c,children:"Generate"})})]})})]})};return r})()));
@@ -0,0 +1,5 @@
1
+ import { type Client } from 'mock-socket';
2
+ import type { MessageData, WebSocketClient } from '../types';
3
+ export declare function sendMessageToClient(socket: Client, format: string, data: MessageData): void;
4
+ export declare function getMockWebSocketClient(webSocketUrl: string): WebSocketClient;
5
+ //# sourceMappingURL=mockWebSocket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockWebSocket.d.ts","sourceRoot":"","sources":["../../../src/components/promptBuilder/mockWebSocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,aAAa,CAAA;AAGpD,OAAO,KAAK,EAAW,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAKrE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,QAalB;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,CAmB5E"}
@@ -0,0 +1,24 @@
1
+ import './promptBuilder.css';
2
+ import '../../index.css';
3
+ import type { PromptBuilderProps } from '../types';
4
+ /**
5
+ The `PromptBuilder` component is an interactive tool designed to help end users construct enhanced prompts through guided conversations with an agent. Users should be able to invoke the PromptBuilder via a button click or a text input command. Once activated, the agent guides the user step-by-step to create a detailed prompt, culminating in a "Generate" button for finalization or a "Next Question" option for further refinement.
6
+
7
+ The expected output of the `PromptBuilder` should not be direct answers to the gathered input. Instead, when the "Generate" button is clicked, the component should produce refined prompt suggestion(s) based on the user's responses during the guided conversation. The `PromptBuilder` does not display the results directly; instead, developers can use the `onSubmit` function to handle the output and choose the most appropriate place to present it within their application.
8
+
9
+ Try out the chat application example below to see how the `PromptBuilder` component can be used in your own application. Please note that the questions asked by agent are fixed as there is no backend involved. This is showcasing an example flow and use case.
10
+
11
+ Notes for implementation:
12
+ - The user will be allowed to start generating prompts when a message has been received with format of `"promptBuilder"` and data field of `isLastQuestion` set to `true`. For example:
13
+ ```
14
+ const newMessage = {
15
+ ...otherRequiredFields,
16
+ format: 'promptBuilder',
17
+ data: {
18
+ isLastQuestion: true
19
+ }
20
+ }
21
+ ```
22
+ */
23
+ export default function PromptBuilder(props: PromptBuilderProps): import("react/jsx-runtime").JSX.Element | undefined;
24
+ //# sourceMappingURL=promptBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/promptBuilder/promptBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iBAAiB,CAAA;AAiBxB,OAAO,KAAK,EAAW,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,uDAsP9D"}
@@ -0,0 +1,14 @@
1
+ .rustic-question .rustic-question-text {
2
+ margin-bottom: 16px;
3
+ }
4
+
5
+ .rustic-question .rustic-option {
6
+ flex: 1;
7
+ min-width: fit-content;
8
+ }
9
+
10
+ .rustic-question .rustic-options-container {
11
+ gap: 8px;
12
+ flex-wrap: wrap;
13
+ }
14
+
@@ -0,0 +1,5 @@
1
+ import './question.css';
2
+ import Question from './question';
3
+ export * from '../types';
4
+ export default Question;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/question/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAA;AAEvB,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,cAAc,UAAU,CAAA;AACxB,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={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},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,{ParticipantRole:()=>f,ParticipantType:()=>b,default:()=>y});const r=require("react/jsx-runtime"),i=require("@mui/material"),n=require("@mui/material/Box");var o=e.n(n);const a=require("@mui/material/Chip");var s=e.n(a);const u=require("@mui/material/Stack");var c=e.n(u);const l=require("@mui/material/Typography");var d=e.n(l);const m=require("react"),p=require("uuid");var f,b;!function(e){e.Owner="owner",e.Member="member"}(f||(f={})),function(e){e.Human="human",e.Agent="agent"}(b||(b={}));const y=function(e){var t=(0,m.useState)(""),n=t[0],a=t[1],u=(0,i.useTheme)(),l=(0,i.useMediaQuery)(u.breakpoints.down("md"))?"column":"row",f=e.options.map((function(t,i){return(0,r.jsx)(s(),{onClick:function(){return function(t){a(t);var r=(new Date).toISOString(),i={id:(0,p.v4)(),timestamp:r,sender:e.sender,conversationId:e.conversationId,format:"text",data:{text:t},inReplyTo:e.messageId};e.ws.send(i)}(t)},variant:"rusticSecondary",size:"small",sx:n===t?{"&.Mui-disabled":{backgroundColor:"secondary.light",color:"text.primary"}}:{},className:"rustic-option",disabled:!!n,"aria-disabled":!!n,label:t},i)}));return(0,r.jsxs)(o(),{className:"rustic-question",children:[(e.title||e.description)&&(0,r.jsxs)(o(),{className:"rustic-question-text",children:[e.title&&(0,r.jsx)(d(),{variant:"subtitle2",className:"rustic-title",children:e.title}),e.description&&(0,r.jsx)(d(),{variant:"caption",children:e.description})]}),(0,r.jsx)(c(),{direction:l,className:"rustic-options-container",children:f})]})};return t})()));
@@ -1,7 +1,13 @@
1
1
  import './question.css';
2
2
  import type { QuestionProps } from '../types';
3
3
  /**
4
- The `Question` component provides a user interface for selecting an option from a list. It is designed to facilitate interactive decision-making and response submission within a conversation or messaging context.
4
+ * The `Question` component provides a user interface for selecting an option from a list. It is designed to facilitate interactive decision-making and response submission within a conversation or messaging context.
5
+ *
6
+ * Note: `uuid` is not bundled, so please install the following package using npm:
7
+ *
8
+ * ```typescript
9
+ * npm i uuid
10
+ * ```
5
11
  */
6
12
  export default function Question(props: QuestionProps): import("react/jsx-runtime").JSX.Element;
7
13
  //# sourceMappingURL=question.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/components/question/question.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAA;AAUvB,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,UAAU,CAAA;AAEtD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAyEpD"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/components/question/question.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAA;AAUvB,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,UAAU,CAAA;AAEtD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAwEpD"}
@@ -0,0 +1,43 @@
1
+ .rustic-table {
2
+ max-width: calc(100vw - 100px);
3
+ }
4
+
5
+ .rustic-table .rustic-table-container {
6
+ max-height: 40vh;
7
+ }
8
+
9
+ .rustic-table .rustic-table-pagination .rustic-table-toolbar {
10
+ padding: 0;
11
+ }
12
+
13
+ .rustic-table .rustic-table-pagination .rustic-table-input {
14
+ margin-left: 0;
15
+ }
16
+
17
+ .rustic-table .rustic-table-header span,
18
+ .rustic-table .rustic-table-header svg {
19
+ font-size: 16px;
20
+ margin-left: 8px;
21
+ }
22
+
23
+ @media (max-width: 900px) {
24
+ .rustic-table .rustic-table-pagination .rustic-table-spacer {
25
+ position: absolute;
26
+ }
27
+
28
+ .rustic-table .rustic-table-pagination .rustic-table-displayed-rows {
29
+ flex: 1;
30
+ display: flex;
31
+ justify-content: flex-end;
32
+ white-space: nowrap;
33
+ }
34
+
35
+ .rustic-table .rustic-table-pagination .rustic-table-actions {
36
+ margin-left: 8px;
37
+ }
38
+ }
39
+
40
+ span.rustic-icon-large {
41
+ font-size: 32px;
42
+ }
43
+
@@ -0,0 +1,5 @@
1
+ import './table.css';
2
+ import Table from './table';
3
+ export * from '../types';
4
+ export default Table;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,cAAc,UAAU,CAAA;AACxB,eAAe,KAAK,CAAA"}