@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.
- package/dist/components/calendar/fCCalendar.d.ts +8 -2
- package/dist/components/calendar/fCCalendar.d.ts.map +1 -1
- package/dist/components/calendar/index.css +21 -0
- package/dist/components/calendar/index.d.ts +5 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/codeSnippet/index.css +14 -0
- package/dist/components/codeSnippet/index.d.ts +5 -0
- package/dist/components/codeSnippet/index.d.ts.map +1 -0
- package/dist/components/codeSnippet/index.js +1 -0
- package/dist/components/elementRenderer/index.d.ts +3 -0
- package/dist/components/elementRenderer/index.d.ts.map +1 -0
- package/dist/components/elementRenderer/index.js +1 -0
- package/dist/components/image/index.css +43 -0
- package/dist/components/image/index.d.ts +5 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/baseInput/baseInput.d.ts.map +1 -1
- package/dist/components/input/emoji/index.css +16 -0
- package/dist/components/input/emoji/index.d.ts +4 -0
- package/dist/components/input/emoji/index.d.ts.map +1 -0
- package/dist/components/input/emoji/index.js +1 -0
- package/dist/components/input/multimodal/multimodalInput/index.css +227 -0
- package/dist/components/input/multimodal/multimodalInput/index.d.ts +5 -0
- package/dist/components/input/multimodal/multimodalInput/index.d.ts.map +1 -0
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -0
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts +8 -1
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
- package/dist/components/input/multimodal/uploader/index.css +145 -0
- package/dist/components/input/multimodal/uploader/index.d.ts +5 -0
- package/dist/components/input/multimodal/uploader/index.d.ts.map +1 -0
- package/dist/components/input/multimodal/uploader/index.js +1 -0
- package/dist/components/input/textInput/index.css +57 -0
- package/dist/components/input/textInput/index.d.ts +4 -0
- package/dist/components/input/textInput/index.d.ts.map +1 -0
- package/dist/components/input/textInput/index.js +1 -0
- package/dist/components/input/textInput/textInput.d.ts +0 -3
- package/dist/components/input/textInput/textInput.d.ts.map +1 -1
- package/dist/components/map/index.css +13 -0
- package/dist/components/map/index.d.ts +5 -0
- package/dist/components/map/index.d.ts.map +1 -0
- package/dist/components/map/index.js +1 -0
- package/dist/components/map/openLayersMap.d.ts +6 -1
- package/dist/components/map/openLayersMap.d.ts.map +1 -1
- package/dist/components/markdown/index.d.ts +6 -0
- package/dist/components/markdown/index.d.ts.map +1 -0
- package/dist/components/markdown/index.js +1 -0
- package/dist/components/markdown/markedMarkdown.d.ts +7 -1
- package/dist/components/markdown/markedMarkdown.d.ts.map +1 -1
- package/dist/components/media/audio/index.css +182 -0
- package/dist/components/media/audio/index.d.ts +5 -0
- package/dist/components/media/audio/index.d.ts.map +1 -0
- package/dist/components/media/audio/index.js +1 -0
- package/dist/components/media/video/index.css +225 -0
- package/dist/components/media/video/index.d.ts +5 -0
- package/dist/components/media/video/index.d.ts.map +1 -0
- package/dist/components/media/video/index.js +1 -0
- package/dist/components/menu/index.css +26 -0
- package/dist/components/menu/index.d.ts +4 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/messageCanvas/actions/action.d.ts +12 -0
- package/dist/components/messageCanvas/actions/action.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/copy/index.css +8 -0
- package/dist/components/messageCanvas/actions/copy/index.d.ts +3 -0
- package/dist/components/messageCanvas/actions/copy/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/copy/index.js +1 -0
- package/dist/components/messageCanvas/actions/index.css +4 -0
- package/dist/components/messageCanvas/actions/index.d.ts +4 -11
- package/dist/components/messageCanvas/actions/index.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/index.js +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.css +8 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts +3 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts.map +1 -1
- package/dist/components/messageCanvas/index.css +39 -0
- package/dist/components/messageCanvas/index.d.ts +4 -0
- package/dist/components/messageCanvas/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/index.js +1 -0
- package/dist/components/messageSpace/index.css +63 -0
- package/dist/components/messageSpace/index.d.ts +4 -0
- package/dist/components/messageSpace/index.d.ts.map +1 -0
- package/dist/components/messageSpace/index.js +1 -0
- package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
- package/dist/components/multipart/index.css +134 -0
- package/dist/components/multipart/index.d.ts +5 -0
- package/dist/components/multipart/index.d.ts.map +1 -0
- package/dist/components/multipart/index.js +1 -0
- package/dist/components/participantsContainer/index.css +42 -0
- package/dist/components/participantsContainer/index.d.ts +4 -0
- package/dist/components/participantsContainer/index.d.ts.map +1 -0
- package/dist/components/participantsContainer/index.js +1 -0
- package/dist/components/pdfViewer/index.css +60 -0
- package/dist/components/pdfViewer/index.d.ts +5 -0
- package/dist/components/pdfViewer/index.d.ts.map +1 -0
- package/dist/components/pdfViewer/index.js +1 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts +4 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts.map +1 -1
- package/dist/components/promptBuilder/index.css +96 -0
- package/dist/components/promptBuilder/index.d.ts +5 -0
- package/dist/components/promptBuilder/index.d.ts.map +1 -0
- package/dist/components/promptBuilder/index.js +1 -0
- package/dist/components/promptBuilder/mockWebSocket.d.ts +5 -0
- package/dist/components/promptBuilder/mockWebSocket.d.ts.map +1 -0
- package/dist/components/promptBuilder/promptBuilder.d.ts +24 -0
- package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -0
- package/dist/components/question/index.css +14 -0
- package/dist/components/question/index.d.ts +5 -0
- package/dist/components/question/index.d.ts.map +1 -0
- package/dist/components/question/index.js +1 -0
- package/dist/components/question/question.d.ts +7 -1
- package/dist/components/question/question.d.ts.map +1 -1
- package/dist/components/table/index.css +43 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/text/index.css +5 -0
- package/dist/components/text/index.d.ts +7 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +1 -0
- package/dist/components/text/text.d.ts +7 -1
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/timestamp/index.d.ts +3 -0
- package/dist/components/timestamp/index.d.ts.map +1 -0
- package/dist/components/types.d.ts +17 -31
- package/dist/components/types.d.ts.map +1 -1
- package/dist/components/video/index.css +34 -0
- package/dist/components/video/index.d.ts +3 -0
- package/dist/components/video/index.d.ts.map +1 -0
- package/dist/components/video/index.js +1 -0
- package/dist/components/video/youtubeVideo.d.ts +8 -1
- package/dist/components/video/youtubeVideo.d.ts.map +1 -1
- package/dist/components/visualization/chart/index.css +44 -0
- package/dist/components/visualization/chart/index.d.ts +4 -0
- package/dist/components/visualization/chart/index.d.ts.map +1 -0
- package/dist/components/visualization/chart/index.js +1 -0
- package/dist/components/visualization/chart/rechartsTimeSeries.d.ts +8 -1
- package/dist/components/visualization/chart/rechartsTimeSeries.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/index.css +21 -0
- package/dist/components/visualization/mermaidViz/index.d.ts +5 -0
- package/dist/components/visualization/mermaidViz/index.d.ts.map +1 -0
- package/dist/components/visualization/mermaidViz/index.js +1 -0
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts +9 -2
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts +10 -0
- package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts.map +1 -0
- package/dist/components/visualization/perspectiveViz/index.css +16 -0
- package/dist/components/visualization/perspectiveViz/index.d.ts +5 -0
- package/dist/components/visualization/perspectiveViz/index.d.ts.map +1 -0
- package/dist/components/visualization/perspectiveViz/index.js +1 -0
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts +7 -4
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/index.css +45 -0
- package/dist/components/visualization/vegaLiteViz/index.d.ts +5 -0
- package/dist/components/visualization/vegaLiteViz/index.d.ts.map +1 -0
- package/dist/components/visualization/vegaLiteViz/index.js +1 -0
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts +9 -2
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts +20 -0
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts.map +1 -0
- package/dist/components/weather/index.css +77 -0
- package/dist/components/weather/index.d.ts +5 -0
- package/dist/components/weather/index.d.ts.map +1 -0
- package/dist/components/weather/index.js +1 -0
- package/dist/index.css +62 -0
- package/dist/index.js +1 -2
- package/dist/rusticTheme.d.ts +29 -0
- package/dist/rusticTheme.d.ts.map +1 -1
- package/dist/rusticTheme.js +1 -0
- package/package.json +123 -22
- package/dist/index.js.LICENSE.txt +0 -1
|
@@ -0,0 +1,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 @@
|
|
|
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})()));
|
|
@@ -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 @@
|
|
|
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})()));
|
|
@@ -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 @@
|
|
|
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
|
|
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 @@
|
|
|
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 @@
|
|
|
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
|
|
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 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports["@rustic-ai/ui-components"]=a():e["@rustic-ai/ui-components"]=a()}(global,(()=>(()=>{"use strict";var e={n:a=>{var t=a&&a.__esModule?()=>a.default:()=>a;return e.d(t,{a:t}),t},d:(a,t)=>{for(var r in t)e.o(t,r)&&!e.o(a,r)&&Object.defineProperty(a,r,{enumerable:!0,get:t[r]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},a={};e.r(a),e.d(a,{ParticipantRole:()=>k,ParticipantType:()=>A,default:()=>M});const t=require("react/jsx-runtime"),r=require("@mui/material"),n=require("@mui/material/Stack");var i=e.n(n);const c=require("@mui/material/Table");var o=e.n(c);const s=require("@mui/material/TableBody");var l=e.n(s);const u=require("@mui/material/TableCell");var d=e.n(u);const m=require("@mui/material/TableContainer");var b=e.n(m);const p=require("@mui/material/TableHead");var f=e.n(p);const y=require("@mui/material/TablePagination");var g=e.n(y);const h=require("@mui/material/TableRow");var j=e.n(h);const v=require("@mui/material/TableSortLabel");var x=e.n(v);const T=require("@mui/material/Tooltip");var O=e.n(T);const q=require("@mui/material/Typography");var P=e.n(q);const w=require("react");var S,N,k,A;function D(e){return e.name.replaceAll("_","-"),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}function K(){return(0,t.jsx)(D,{name:"expand_all"})}require("pluralize"),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(S||(S={})),function(e){e.Ascending="asc",e.Descending="desc"}(N||(N={})),function(e){e.Owner="owner",e.Member="member"}(k||(k={})),function(e){e.Human="human",e.Agent="agent"}(A||(A={}));const M=function(e){if(0===e.data.length)return(0,t.jsx)(P(),{variant:"body2",children:"No data available"});var a,n,c,s=e.data.length>10,u=(0,w.useState)({}),m=u[0],p=u[1],y=(0,w.useState)(s?10:-1),h=y[0],v=y[1],T=(0,w.useState)(0),q=T[0],S=T[1],k=(0,r.useTheme)(),A=Array.from(new Set(e.data.flatMap((function(e){return Object.keys(e)})))),D=e.headers||A.map((function(e){return{dataKey:e}})),M=(a=e.data,n=Object.keys(m)[0],c=m[n],n&&c?a.slice().sort((function(e,a){var t=Object.keys(m)[0],r=m[t];return e[t]<a[t]?r===N.Descending?1:-1:e[t]>a[t]?r===N.Descending?-1:1:0})):a),R=M.slice(q*h,q*h+h),_=h>0?R:M;function C(e){if(!m[e])return K}return(0,t.jsxs)(i(),{className:"rustic-table",spacing:1,children:[e.title&&(0,t.jsx)(P(),{variant:"h6",className:"rustic-table-title",children:e.title}),e.description&&(0,t.jsx)(P(),{variant:"body1",children:e.description}),(0,t.jsx)(b(),{className:"rustic-table-container",children:(0,t.jsxs)(o(),{"aria-label":e.title||"a table of data",size:"small",stickyHeader:!0,children:[D.length>0&&(0,t.jsx)(f(),{children:(0,t.jsx)(j(),{children:D.map((function(e,a){return(0,t.jsx)(d(),{sortDirection:m[e.dataKey]||!1,children:(0,t.jsx)(O(),{title:(n=e.dataKey,i=m[n],i?Object.keys(N)[Object.values(N).indexOf(i)]:"Sort"),children:(0,t.jsx)(x(),{active:!0,direction:m[e.dataKey],onClick:function(){return function(e){p((function(a){var t,r,n={};switch(a[e]){case N.Ascending:(t={})[e]=N.Descending,n=t;break;case N.Descending:n={};break;default:(r={})[e]=N.Ascending,n=r}return n}))}(e.dataKey)},className:"rustic-table-header",IconComponent:C(e.dataKey),children:e.label||(r=e.dataKey,r.charAt(0).toUpperCase()+r.slice(1))})})},"header-".concat(a));var r,n,i}))})}),(0,t.jsx)(l(),{children:_.map((function(e,a){return(0,t.jsx)(j(),{children:D.map((function(r,n){return(0,t.jsx)(d(),{children:e[r.dataKey]},"cell-".concat(a,"-").concat(n))}))},"row-".concat(a))}))})]})}),s&&(0,t.jsx)(g(),{className:"rustic-table-pagination",component:"div",count:e.data.length,rowsPerPage:h,labelRowsPerPage:"Rows:",page:q,onPageChange:function(e,a){return S(a)},onRowsPerPageChange:function(e){v(+e.target.value),S(0)},sx:{"& .MuiTablePagination-selectLabel":{color:k.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})};return a})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AAEnB,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,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:()=>l,ParticipantType:()=>m,StreamingText:()=>d,Text:()=>f,default:()=>p});const r=require("react/jsx-runtime"),n=require("@mui/material/Alert");var a=e.n(n);const o=require("@mui/material/Typography");var i=e.n(o);const u=require("dompurify");var c=e.n(u);const s=require("react"),d=function(e){var t=(0,s.useState)(c().sanitize(e.text)),n=t[0],o=t[1],u=(0,s.useState)(""),d=u[0],f=u[1];return(0,s.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){for(var t=e.text,r=0,n=e.updatedData;r<n.length;r++){var a=n[r];"string"!=typeof a.text&&(t+=" [MISSING TEXT]",f("Some of the incoming text was not correctly formatted. Some data may be missing.")),t+=a.text}o(c().sanitize(t))}}),[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i(),{variant:"body2",children:n}),d&&(0,r.jsx)(a(),{severity:"error",children:d})]})},f=function(e){return(0,r.jsx)(i(),{variant:"body2",className:"rustic-text",children:c().sanitize(e.text)})};var l,m;!function(e){e.Owner="owner",e.Member="member"}(l||(l={})),function(e){e.Human="human",e.Agent="agent"}(m||(m={}));const p=f;return t})()));
|