@rustic-ai/ui-components 0.0.33 → 0.0.35

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 (51) hide show
  1. package/dist/components/dynamicForm/index.js +1 -1
  2. package/dist/components/filePreview/filePreview.d.ts +1 -0
  3. package/dist/components/filePreview/filePreview.d.ts.map +1 -1
  4. package/dist/components/helper.d.ts +6 -1
  5. package/dist/components/helper.d.ts.map +1 -1
  6. package/dist/components/icon/index.js +1 -1
  7. package/dist/components/index.d.ts +7 -6
  8. package/dist/components/index.d.ts.map +1 -1
  9. package/dist/components/input/baseInput/baseInput.d.ts.map +1 -1
  10. package/dist/components/input/emoji/index.js +1 -1
  11. package/dist/components/input/multimodal/multimodalInput/index.css +5 -1
  12. package/dist/components/input/multimodal/multimodalInput/index.js +1 -1
  13. package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
  14. package/dist/components/input/multimodal/uploader/index.css +4 -0
  15. package/dist/components/input/multimodal/uploader/index.js +1 -1
  16. package/dist/components/input/multimodal/uploader/uploader.d.ts.map +1 -1
  17. package/dist/components/input/textInput/index.css +1 -1
  18. package/dist/components/input/textInput/index.js +1 -1
  19. package/dist/components/messageCanvas/actions/copy/index.js +1 -1
  20. package/dist/components/messageCanvas/actions/index.js +1 -1
  21. package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -1
  22. package/dist/components/messageSpace/index.js +1 -1
  23. package/dist/components/multipart/chatCompletion/chatCompletion.d.ts +11 -0
  24. package/dist/components/multipart/chatCompletion/chatCompletion.d.ts.map +1 -0
  25. package/dist/components/multipart/{index.css → chatCompletion/index.css} +4 -0
  26. package/dist/components/multipart/chatCompletion/index.d.ts +4 -0
  27. package/dist/components/multipart/chatCompletion/index.d.ts.map +1 -0
  28. package/dist/components/multipart/chatCompletion/index.js +1 -0
  29. package/dist/components/multipart/multipart/index.css +149 -0
  30. package/dist/components/multipart/{index.d.ts → multipart/index.d.ts} +1 -1
  31. package/dist/components/multipart/multipart/index.d.ts.map +1 -0
  32. package/dist/components/multipart/{index.js → multipart/index.js} +1 -1
  33. package/dist/components/multipart/{multipart.d.ts → multipart/multipart.d.ts} +2 -2
  34. package/dist/components/multipart/multipart/multipart.d.ts.map +1 -0
  35. package/dist/components/promptBuilder/index.js +1 -1
  36. package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -1
  37. package/dist/components/prompts/index.js +1 -1
  38. package/dist/components/prompts/prompts.d.ts.map +1 -1
  39. package/dist/components/question/index.js +1 -1
  40. package/dist/components/text/index.js +1 -1
  41. package/dist/components/types.d.ts +62 -3
  42. package/dist/components/types.d.ts.map +1 -1
  43. package/dist/components/weather/index.js +1 -1
  44. package/dist/index.css +5 -1
  45. package/dist/index.js +1 -1
  46. package/dist/rusticTheme.d.ts +3 -11
  47. package/dist/rusticTheme.d.ts.map +1 -1
  48. package/dist/rusticTheme.js +1 -1
  49. package/package.json +15 -13
  50. package/dist/components/multipart/index.d.ts.map +0 -1
  51. package/dist/components/multipart/multipart.d.ts.map +0 -1
@@ -59,6 +59,10 @@ code {
59
59
  min-width: 220px;
60
60
  }
61
61
 
62
+ .rustic-file-preview-name {
63
+ margin-right: 8px;
64
+ }
65
+
62
66
  .rustic-file-preview-modal {
63
67
  width: 90vw;
64
68
  height: 90vh;
@@ -0,0 +1,4 @@
1
+ import '../multipart/multipart.css';
2
+ import ChatCompletion from './chatCompletion';
3
+ export default ChatCompletion;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/multipart/chatCompletion/index.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,eAAe,cAAc,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={9767:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(8732),i=(r(2015),function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)});function a(e){e.name.replaceAll("_","-");var t={};return e.color&&(t={color:e.color}),(0,n.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:i({},t),children:e.name})}},3110:(e,t,r)=>{r.d(t,{default:()=>n});const n=r(9767).A},2500:(e,t,r)=>{r.d(t,{default:()=>n}),r(1737);const n=r(7131).A},1737:(e,t,r)=>{r(8732),r(5642),r(785),r(7447),r(2015)},7131:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(8732),i=r(785),a=r.n(i),o=r(7447),s=r.n(o);r(2015);const l=function(e){return(0,n.jsx)(a(),{variant:"body2",className:"rustic-text",children:s().sanitize(e.text)})}},5642:e=>{e.exports=require("@mui/material/Alert")},785:e=>{e.exports=require("@mui/material/Typography")},7447:e=>{e.exports=require("dompurify")},2015:e=>{e.exports=require("react")},8732:e=>{e.exports=require("react/jsx-runtime")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{default:()=>M});var i=r(8732);const a=require("@mui/material/Box");var o=r.n(a);const s=require("@mui/material/IconButton");var l=r.n(s);const c=require("@mui/material/Tooltip");var u=r.n(c),d=r(2015);const m=require("@mui/material/Card");var p=r.n(m);const f=require("@mui/material/Modal");var h=r.n(f);const x=require("@mui/material/styles");var v,j=r(785),b=r.n(j);!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(v||(v={}));var y=r(9767);const w=require("@mui/material/TextField");var g=r.n(w);const N=require("@mui/material/useMediaQuery");var C=r.n(N);const k=require("@mui/system/Stack");var P=r.n(k);const q=require("@mui/system/useTheme");var O=r.n(q);const S=require("pdfjs-dist"),T=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"}},r=(t[e.action].label.replaceAll(" ","-").toLowerCase(),t[e.action]);return(0,i.jsx)(u(),{title:r.label,children:(0,i.jsx)("span",{children:(0,i.jsx)(l(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,i.jsx)(y.A,{name:r.symbol})})})})};var _={pdf:function(e){var t,r=(0,d.useRef)(null),n=(0,d.useState)(1),a=n[0],s=n[1],l=(0,d.useState)(1),c=l[0],u=l[1],m=(0,d.useState)(1),f=m[0],h=m[1],x=(0,d.useState)(!1),v=x[0],j=x[1],y=(0,d.useState)(),w=y[0],N=y[1],k=O()(),q=C()(k.breakpoints.down("sm")),_=C()(k.breakpoints.between("sm","md"));if(t=e.url,!/\/[^/]+\.pdf$/.test(t))return(0,i.jsx)(p(),{variant:"outlined",className:"rustic-pdf-error",children:(0,i.jsx)(b(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var A=(0,d.useState)((function(){return q?.5:_?1:1.5})),F=A[0],D=A[1];return(0,d.useEffect)((function(){S.GlobalWorkerOptions.workerSrc||(S.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(S.version,"/pdf.worker.mjs")),S.getDocument({url:"".concat(e.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(a).then((function(e){var t=e.getViewport({scale:F}),n=r.current;if(n){var i=n.getContext("2d");if(i){var a=window.devicePixelRatio||1;n.style.width="".concat(t.width,"px"),n.style.height="".concat(t.height,"px"),n.width=t.width*a,n.height=t.height*a;var o={canvasContext:i,viewport:t,transform:[a,0,0,a,0,0]};w&&w.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,F]),v?(0,i.jsx)(p(),{variant:"outlined",className:"rustic-pdf-error",children:(0,i.jsx)(b(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,i.jsxs)(p(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,i.jsxs)(o(),{className:"rustic-pdf-viewer-header",children:[(0,i.jsx)(T,{action:"zoomOut",onClick:function(){D((function(e){return Math.max(e-.2,.2)}))}}),(0,i.jsx)(T,{action:"zoomIn",onClick:function(){D((function(e){return e+.2}))}})]}),(0,i.jsx)(o(),{className:"rustic-pdf-viewer-body",children:(0,i.jsx)(o(),{className:"rustic-pdf-viewer-body-inner",children:(0,i.jsx)("canvas",{ref:r})})}),(0,i.jsxs)(P(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,i.jsx)(T,{action:"previousPage",onClick:function(){a>1&&(s(a-1),h(a-1))},isDisabled:1===a}),(0,i.jsx)(b(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,i.jsx)(g(),{type:"number",value:f,onChange:function(e){var t=parseInt(e.target.value);h(t),!isNaN(t)&&t>=1&&t<=c&&s(t)},size:"small",className:"rustic-pdf-page-input"}),(0,i.jsxs)(b(),{variant:"body1",className:"rustic-page-indicator",children:["of ",c]}),(0,i.jsx)(T,{action:"nextPage",onClick:function(){a<c&&(s(a+1),h(a+1))},isDisabled:a===c})]})]})}};function A(e){var t=(0,x.useTheme)(),r=(0,d.useState)(!1),n=r[0],a=r[1];function o(){a(!1)}var s,c,m=e.file.url&&(s=e.file.url.split("."))[s.length-1].toLowerCase(),f=m&&e.supportedViewers?e.supportedViewers[m]:null,v=!!f,j=e.showFullName?"rustic-flexible-file-preview-width":"rustic-fixed-file-preview-width",w=v?" rustic-cursor-pointer":"",g="rustic-file-preview ".concat(j).concat(w),N=e.showFullName?e.file.name:(c=e.file.name).length<=15?c:c.substring(0,12)+"...";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(p(),{className:g,variant:"outlined",sx:{boxShadow:t.shadows[1]},onClick:function(){a(!0)},children:[(0,i.jsx)(b(),{variant:"subtitle2",className:"rustic-file-preview-name",children:N}),(0,i.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:e.children})]}),v&&(0,i.jsx)(h(),{open:n,onClose:o,className:"rustic-file-preview-modal",children:(0,i.jsxs)("div",{className:"rustic-modal-content",children:[(0,i.jsx)(u(),{title:"Close",children:(0,i.jsx)(l(),{onClick:o,className:"rustic-close-button",children:(0,i.jsx)(y.A,{name:"close"})})}),e.file.url&&(0,i.jsx)(f,{url:e.file.url})]})})]})}A.defaultProps={supportedViewers:_,showFullName:!0};var F=r(3110),D=r(2500);function z(e){return new URL(e).pathname.split("/").pop()}const M=function(e){return(0,i.jsx)(o(),{className:"rustic-multipart",children:e.messages.map((function(t){return"string"==typeof t.content?(0,i.jsx)(D.default,{text:t.content}):(r=t.content,n=[],a="",r.map((function(t){if("text"===t.type)a+=t.text;else if(t.type.endsWith("_url")){var r=t[t.type].url,o={url:r,name:t[t.type].name||z(r)},s=(0,i.jsx)(A,{file:o,showFullName:e.showFullName,children:o.url&&(0,i.jsx)(u(),{title:"Download",className:"rustic-shift-to-right-by-8",children:(0,i.jsx)(l(),{component:"a",href:o.url,download:o.name,children:(0,i.jsx)(F.default,{name:"download"})})})});n.push(s)}})),(0,i.jsxs)(i.Fragment,{children:[a.length>0&&(0,i.jsx)(D.default,{text:a}),n.length>0&&(0,i.jsx)(o(),{className:"rustic-files",children:n})]}));var r,n,a}))})};return n})()));
@@ -0,0 +1,149 @@
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-shift-to-right-by-8 {
42
+ margin-right: -8px;
43
+ }
44
+
45
+ .rustic-file-preview {
46
+ position: relative;
47
+ display: flex;
48
+ align-items: center;
49
+ padding: 8px 16px;
50
+ justify-content: space-between;
51
+ height: 56px;
52
+ }
53
+
54
+ .rustic-fixed-file-preview-width {
55
+ width: 220px;
56
+ }
57
+
58
+ .rustic-flexible-file-preview-width {
59
+ min-width: 220px;
60
+ }
61
+
62
+ .rustic-file-preview-name {
63
+ margin-right: 8px;
64
+ }
65
+
66
+ .rustic-file-preview-modal {
67
+ width: 90vw;
68
+ height: 90vh;
69
+ display: flex;
70
+ align-self: center;
71
+ justify-self: center;
72
+ }
73
+
74
+ .rustic-file-preview-modal .rustic-modal-content {
75
+ position: relative;
76
+ width: 100%;
77
+ }
78
+
79
+ .rustic-modal-content .rustic-close-button {
80
+ position: absolute;
81
+ top: 16px;
82
+ right: 16px;
83
+ }
84
+
85
+ span.rustic-icon-large {
86
+ font-size: 32px;
87
+ }
88
+
89
+ .rustic-pdf-viewer {
90
+ width: 100%;
91
+ height: 100%;
92
+ display: flex;
93
+ flex-direction: column;
94
+ padding: 16px;
95
+ }
96
+
97
+ .rustic-pdf-error {
98
+ padding: 16px;
99
+ width: fit-content;
100
+ }
101
+
102
+ .rustic-pdf-viewer .rustic-pdf-viewer-header {
103
+ display: flex;
104
+ align-items: center;
105
+ margin-bottom: 8px;
106
+ }
107
+
108
+ .rustic-pdf-viewer .rustic-pdf-canvas {
109
+ flex: 1;
110
+ }
111
+
112
+ .rustic-pdf-viewer .rustic-pdf-page-input > div {
113
+ height: 24px;
114
+ width: 56px;
115
+ }
116
+
117
+ .rustic-pdf-viewer .rustic-pdf-page-input input {
118
+ text-align: center;
119
+ }
120
+
121
+ .rustic-pdf-viewer
122
+ .rustic-pdf-page-input
123
+ input[type='number']::-webkit-inner-spin-button {
124
+ display: none;
125
+ }
126
+
127
+ .rustic-pdf-viewer .rustic-page-indicator {
128
+ display: flex;
129
+ align-items: center;
130
+ gap: 8px;
131
+ }
132
+
133
+ .rustic-pdf-viewer-body {
134
+ flex: 1;
135
+ display: flex;
136
+ justify-content: center;
137
+ overflow: auto;
138
+ }
139
+
140
+ .rustic-pdf-viewer-body-inner {
141
+ overflow: auto;
142
+ width: fit-content;
143
+ }
144
+
145
+ .rustic-text {
146
+ white-space: break-spaces;
147
+ overflow-wrap: break-word;
148
+ }
149
+
@@ -1,5 +1,5 @@
1
1
  import './multipart.css';
2
2
  import Multipart from './multipart';
3
- export * from '../types';
3
+ export type * from '../../types';
4
4
  export default Multipart;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/multipart/multipart/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,mBAAmB,aAAa,CAAA;AAChC,eAAe,SAAS,CAAA"}
@@ -1 +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 i in t)e.o(t,i)&&!e.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:t[i]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>R});const t=require("react/jsx-runtime"),i=require("@mui/material/IconButton");var n=e.n(i);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"),h=require("@mui/material/Typography");var x,v=e.n(h);!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(x||(x={}));var j=function(){return j=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},j.apply(this,arguments)};function b(e){e.name.replaceAll("_","-");var r={};return e.color&&(r={color:e.color}),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:j({},r),children:e.name})}const y=require("@mui/material/Box");var w=e.n(y);const g=require("@mui/material/TextField");var N=e.n(g);const C=require("@mui/material/useMediaQuery");var k=e.n(C);const P=require("@mui/system/Stack");var q=e.n(P);const O=require("@mui/system/useTheme");var S=e.n(O);const T=require("pdfjs-dist"),_=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"}},i=(r[e.action].label.replaceAll(" ","-").toLowerCase(),r[e.action]);return(0,t.jsx)(o(),{title:i.label,children:(0,t.jsx)("span",{children:(0,t.jsx)(n(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,t.jsx)(b,{name:i.symbol})})})})};var D={pdf:function(e){var r,i=(0,c.useRef)(null),n=(0,c.useState)(1),a=n[0],o=n[1],s=(0,c.useState)(1),l=s[0],u=s[1],m=(0,c.useState)(1),f=m[0],p=m[1],h=(0,c.useState)(!1),x=h[0],j=h[1],b=(0,c.useState)(),y=b[0],g=b[1],C=S()(),P=k()(C.breakpoints.down("sm")),O=k()(C.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 D=(0,c.useState)((function(){return P?.5:O?1:1.5})),F=D[0],z=D[1];return(0,c.useEffect)((function(){T.GlobalWorkerOptions.workerSrc||(T.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(T.version,"/pdf.worker.mjs")),T.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:F}),t=i.current;if(t){var n=t.getContext("2d");if(n){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:n,viewport:r,transform:[a,0,0,a,0,0]};y&&y.cancel();var s=e.render(o);g(s),s.promise.then((function(){g(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){j(!0)}))}),[e.url,a,F]),x?(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)(w(),{className:"rustic-pdf-viewer-header",children:[(0,t.jsx)(_,{action:"zoomOut",onClick:function(){z((function(e){return Math.max(e-.2,.2)}))}}),(0,t.jsx)(_,{action:"zoomIn",onClick:function(){z((function(e){return e+.2}))}})]}),(0,t.jsx)(w(),{className:"rustic-pdf-viewer-body",children:(0,t.jsx)(w(),{className:"rustic-pdf-viewer-body-inner",children:(0,t.jsx)("canvas",{ref:i})})}),(0,t.jsxs)(q(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,t.jsx)(_,{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)(N(),{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)(_,{action:"nextPage",onClick:function(){a<l&&(o(a+1),p(a+1))},isDisabled:a===l})]})]})}};function F(e){var r=(0,p.useTheme)(),i=(0,c.useState)(!1),a=i[0],s=i[1];function l(){s(!1)}var u,m,h=e.file.url&&(u=e.file.url.split("."))[u.length-1].toLowerCase(),x=h&&e.supportedViewers?e.supportedViewers[h]:null,j=!!x,y=e.showFullName?"rustic-flexible-file-preview-width":"rustic-fixed-file-preview-width",w=j?" rustic-cursor-pointer":"",g="rustic-file-preview ".concat(y).concat(w),N=e.showFullName?e.file.name:(15,(m=e.file.name).length<=15?m:m.substring(0,12)+"...");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d(),{className:g,variant:"outlined",sx:{boxShadow:r.shadows[1]},onClick:function(){s(!0)},children:[(0,t.jsx)(v(),{variant:"subtitle2",children:N}),(0,t.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:e.children})]}),j&&(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)(n(),{onClick:l,className:"rustic-close-button",children:(0,t.jsx)(b,{name:"close"})})}),e.file.url&&(0,t.jsx)(x,{url:e.file.url})]})})]})}F.defaultProps={supportedViewers:D};const z=require("dompurify");var M=e.n(z);const I=function(e){return(0,t.jsx)(v(),{variant:"body2",className:"rustic-text",children:M().sanitize(e.text)})},R=function(e){return(0,t.jsxs)(l(),{className:"rustic-multipart",children:[e.text&&(0,t.jsx)(I,{text:e.text}),(r=e.files.map((function(r,i){return(0,t.jsx)(F,{file:r,showFullName:e.showFullName,children:r.url&&(0,t.jsx)(o(),{title:"Download",className:"rustic-shift-to-right-by-8",children:(0,t.jsx)(n(),{component:"a",href:r.url,download:r.name,children:(0,t.jsx)(b,{name:"download"})})})},i)})),(0,t.jsx)(l(),{className:"rustic-files",children:r}))]});var r};return r})()));
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 i in t)e.o(t,i)&&!e.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:t[i]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>R});const t=require("react/jsx-runtime"),i=require("@mui/material/IconButton");var n=e.n(i);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"),h=require("@mui/material/Typography");var v,x=e.n(h);!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(v||(v={}));var j=function(){return j=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},j.apply(this,arguments)};function b(e){e.name.replaceAll("_","-");var r={};return e.color&&(r={color:e.color}),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:j({},r),children:e.name})}const w=require("@mui/material/Box");var y=e.n(w);const g=require("@mui/material/TextField");var N=e.n(g);const C=require("@mui/material/useMediaQuery");var k=e.n(C);const P=require("@mui/system/Stack");var q=e.n(P);const O=require("@mui/system/useTheme");var S=e.n(O);const T=require("pdfjs-dist"),_=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"}},i=(r[e.action].label.replaceAll(" ","-").toLowerCase(),r[e.action]);return(0,t.jsx)(o(),{title:i.label,children:(0,t.jsx)("span",{children:(0,t.jsx)(n(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,t.jsx)(b,{name:i.symbol})})})})};var F={pdf:function(e){var r,i=(0,c.useRef)(null),n=(0,c.useState)(1),a=n[0],o=n[1],s=(0,c.useState)(1),l=s[0],u=s[1],m=(0,c.useState)(1),f=m[0],p=m[1],h=(0,c.useState)(!1),v=h[0],j=h[1],b=(0,c.useState)(),w=b[0],g=b[1],C=S()(),P=k()(C.breakpoints.down("sm")),O=k()(C.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)(x(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var F=(0,c.useState)((function(){return P?.5:O?1:1.5})),D=F[0],z=F[1];return(0,c.useEffect)((function(){T.GlobalWorkerOptions.workerSrc||(T.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(T.version,"/pdf.worker.mjs")),T.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=i.current;if(t){var n=t.getContext("2d");if(n){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:n,viewport:r,transform:[a,0,0,a,0,0]};w&&w.cancel();var s=e.render(o);g(s),s.promise.then((function(){g(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){j(!0)}))}),[e.url,a,D]),v?(0,t.jsx)(d(),{variant:"outlined",className:"rustic-pdf-error",children:(0,t.jsx)(x(),{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)(_,{action:"zoomOut",onClick:function(){z((function(e){return Math.max(e-.2,.2)}))}}),(0,t.jsx)(_,{action:"zoomIn",onClick:function(){z((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:i})})}),(0,t.jsxs)(q(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,t.jsx)(_,{action:"previousPage",onClick:function(){a>1&&(o(a-1),p(a-1))},isDisabled:1===a}),(0,t.jsx)(x(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,t.jsx)(N(),{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)(x(),{variant:"body1",className:"rustic-page-indicator",children:["of ",l]}),(0,t.jsx)(_,{action:"nextPage",onClick:function(){a<l&&(o(a+1),p(a+1))},isDisabled:a===l})]})]})}};function D(e){var r=(0,p.useTheme)(),i=(0,c.useState)(!1),a=i[0],s=i[1];function l(){s(!1)}var u,m,h=e.file.url&&(u=e.file.url.split("."))[u.length-1].toLowerCase(),v=h&&e.supportedViewers?e.supportedViewers[h]:null,j=!!v,w=e.showFullName?"rustic-flexible-file-preview-width":"rustic-fixed-file-preview-width",y=j?" rustic-cursor-pointer":"",g="rustic-file-preview ".concat(w).concat(y),N=e.showFullName?e.file.name:(m=e.file.name).length<=15?m:m.substring(0,12)+"...";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d(),{className:g,variant:"outlined",sx:{boxShadow:r.shadows[1]},onClick:function(){s(!0)},children:[(0,t.jsx)(x(),{variant:"subtitle2",className:"rustic-file-preview-name",children:N}),(0,t.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:e.children})]}),j&&(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)(n(),{onClick:l,className:"rustic-close-button",children:(0,t.jsx)(b,{name:"close"})})}),e.file.url&&(0,t.jsx)(v,{url:e.file.url})]})})]})}D.defaultProps={supportedViewers:F,showFullName:!0};const z=require("dompurify");var M=e.n(z);const I=function(e){return(0,t.jsx)(x(),{variant:"body2",className:"rustic-text",children:M().sanitize(e.text)})},R=function(e){return(0,t.jsxs)(l(),{className:"rustic-multipart",children:[e.text&&(0,t.jsx)(I,{text:e.text}),(r=e.files.map((function(r,i){return(0,t.jsx)(D,{file:r,showFullName:e.showFullName,children:r.url&&(0,t.jsx)(o(),{title:"Download",className:"rustic-shift-to-right-by-8",children:(0,t.jsx)(n(),{component:"a",href:r.url,download:r.name,children:(0,t.jsx)(b,{name:"download"})})})},i)})),(0,t.jsx)(l(),{className:"rustic-files",children:r}))]});var r};return r})()));
@@ -1,6 +1,6 @@
1
- import '../../index.css';
1
+ import '../../../index.css';
2
2
  import './multipart.css';
3
- import type { MultipartProps } from '../types';
3
+ import type { MultipartProps } from '../../types';
4
4
  /** The `Multipart` component is a versatile message format designed to accommodate both textual content and file attachments within a single message interface. */
5
5
  export default function Multipart(props: MultipartProps): import("react/jsx-runtime").JSX.Element;
6
6
  //# sourceMappingURL=multipart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../../../src/components/multipart/multipart/multipart.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,iBAAiB,CAAA;AAUxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,mKAAmK;AACnK,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,2CA8BtD"}
@@ -1 +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,{default:()=>A});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 h=e.n(g);const v=require("@mui/material/DialogTitle");var b=e.n(v);const x=require("@mui/material/Divider");var y=e.n(x);const j=require("@mui/material/Typography");var q=e.n(j);const S=require("@mui/system"),w=require("react");var C=e.n(w),N=function(){return N=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},N.apply(this,arguments)};const O=function(e){var r=e.messages[0],n=e.messages.slice(1),i=e.supportedElements[r.format];return(0,t.jsx)(t.Fragment,{children:i?C().createElement(i,N(N({sender:e.sender,ws:e.ws,messageId:r.id,conversationId:r.conversationId},r.data),n.length>0&&{updatedData:n.map((function(e){return e.data}))})):(0,t.jsxs)(q(),{variant:"body2",children:["Unsupported element format: ",r.format]})})};var 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)};function B(e){e.name.replaceAll("_","-");var r={};return e.color&&(r={color:e.color}),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:P({},r),children:e.name})}var 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)},D=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))};const A=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],v=p[1],x=(0,w.useState)(!1),j=x[0],C=x[1],N=(0,w.useState)([]),P=N[0],A=N[1],E=(0,w.useState)(null),T=E[0],_=E[1],k=(0,S.useTheme)(),M=P[P.length-1],Q=I(I({},e.ws),{send:function(e){_(e)}});function F(e){A((function(r){return D(D([],r,!0),[e],!1)}))}function R(){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(F)}),[e.ws]),(0,w.useEffect)((function(){P.length>0&&(M&&M.sender.id!==e.sender.id&&d(!1),"promptBuilder"===M.format&&M.data.isLastQuestion&&a(!0))}),[P.length]),0!==P.length)return(0,t.jsxs)(s(),{variant:"outlined",className:"rustic-prompt-builder",children:[(0,t.jsxs)(u(),{open:g,onClose:function(){return v(!1)},"aria-labelledby":"quit-dialog-title","aria-describedby":"quit-dialog-description",sx:{"& .MuiPaper-root":{width:"clamp(320px,50vw,600px)",border:"1px solid ".concat(k.palette.divider)}},children:[(0,t.jsx)(b(),{id:"quit-dialog-title",className:"rustic-align-self-center",children:"Are you sure?"}),(0,t.jsx)(y(),{}),(0,t.jsx)(f(),{children:(0,t.jsx)(h(),{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)(B,{name:"close"}),onClick:function(){v(!1),e.onCancel()},children:"Quit"}),(0,t.jsx)(i(),{variant:"rusticPrimary",onClick:function(){return v(!1)},children:"Continue build"})]})]}),e.getProfileComponent?e.getProfileComponent(P[0]):(0,t.jsx)(q(),{color:"text.secondary",children:"Prompt Builder"}),(0,t.jsx)(y(),{className:"rustic-prompt-builder-divider"}),(0,t.jsxs)(S.Box,{className:"rustic-prompt-builder-questions",children:[function(){if(!j&&P.length>0)return P.map((function(r){if(r.sender.id!==e.sender.id&&"promptBuilder"!==r.format)return(0,t.jsx)(O,{ws:Q,sender:e.sender,messages:[r],supportedElements:e.supportedElements},r.id)}))}(),c&&(0,t.jsx)(l(),{color:"secondary",className:"rustic-align-self-center"})]}),(0,t.jsx)(t.Fragment,{children:!j&&(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)(B,{name:"close"}),onClick:function(){return v(!0)},children:"Quit"}),(0,t.jsx)(i(),{variant:"rusticSecondary",endIcon:(0,t.jsx)(B,{name:"chevron_right"}),onClick:function(){R(),_(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(){R(),C(!0),d(!0),e.onSubmit()},disabled:c,"aria-disabled":c,children:"Generate"})})]})})]})};return r})()));
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,{default:()=>A});const t=require("react/jsx-runtime"),n=require("@mui/material/Button");var i=e.n(n);const o=require("@mui/material/Card");var a=e.n(o);const s=require("@mui/material/CircularProgress");var l=e.n(s);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 h=e.n(g);const v=require("@mui/material/DialogTitle");var b=e.n(v);const x=require("@mui/material/Divider");var y=e.n(x);const j=require("@mui/material/Typography");var q=e.n(j);const w=require("@mui/system"),C=require("react");var N=e.n(C),O=function(){return O=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},O.apply(this,arguments)};const S=function(e){var r=e.messages[0],n=e.messages.slice(1),i=e.supportedElements[r.format];return(0,t.jsx)(t.Fragment,{children:i?N().createElement(i,O(O({sender:e.sender,ws:e.ws,messageId:r.id,conversationId:r.conversationId},r.data),n.length>0&&{updatedData:n.map((function(e){return e.data}))})):(0,t.jsxs)(q(),{variant:"body2",children:["Unsupported element format: ",r.format]})})};var 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)};function B(e){e.name.replaceAll("_","-");var r={};return e.color&&(r={color:e.color}),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:P({},r),children:e.name})}var 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)},D=function(e,r,t){if(t||2===arguments.length)for(var n,i=0,o=r.length;i<o;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))};const A=function(e){var r=(0,C.useState)(!1),n=r[0],o=r[1],s=(0,C.useState)(!1),c=s[0],d=s[1],p=(0,C.useState)(!1),g=p[0],v=p[1],x=(0,C.useState)(!1),j=x[0],N=x[1],O=(0,C.useState)([]),P=O[0],A=O[1],E=(0,C.useState)(null),T=E[0],_=E[1],k=(0,w.useTheme)(),M=P[P.length-1],Q=I(I({},e.ws),{send:function(e){_(e)}});function F(e){A((function(r){return D(D([],r,!0),[e],!1)}))}function R(){if(T){var r=I(I({},T),{threadId:e.messageId});e.ws.send(r)}}if((0,C.useEffect)((function(){e.ws.onReceive&&e.ws.onReceive(F)}),[e.ws]),(0,C.useEffect)((function(){P.length>0&&(M&&M.sender.id!==e.sender.id&&d(!1),"promptBuilder"===M.format&&M.data.isLastQuestion&&o(!0))}),[P.length]),0!==P.length)return(0,t.jsxs)(a(),{variant:"outlined",className:"rustic-prompt-builder",children:[(0,t.jsxs)(u(),{open:g,onClose:function(){return v(!1)},"aria-labelledby":"quit-dialog-title","aria-describedby":"quit-dialog-description",sx:{"& .MuiPaper-root":{width:"clamp(320px,50vw,600px)",border:"1px solid ".concat(k.palette.divider)}},children:[(0,t.jsx)(b(),{id:"quit-dialog-title",className:"rustic-align-self-center",children:"Are you sure?"}),(0,t.jsx)(y(),{}),(0,t.jsx)(f(),{children:(0,t.jsx)(h(),{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:"outlined",color:"secondary",startIcon:(0,t.jsx)(B,{name:"close"}),onClick:function(){v(!1),e.onCancel()},children:"Quit"}),(0,t.jsx)(i(),{variant:"contained",color:"primary",onClick:function(){return v(!1)},children:"Continue build"})]})]}),e.getProfileComponent?e.getProfileComponent(P[0]):(0,t.jsx)(q(),{color:"text.secondary",children:"Prompt Builder"}),(0,t.jsx)(y(),{className:"rustic-prompt-builder-divider"}),(0,t.jsxs)(w.Box,{className:"rustic-prompt-builder-questions",children:[function(){if(!j&&P.length>0)return P.map((function(r){if(r.sender.id!==e.sender.id&&"promptBuilder"!==r.format)return(0,t.jsx)(S,{ws:Q,sender:e.sender,messages:[r],supportedElements:e.supportedElements},r.id)}))}(),c&&(0,t.jsx)(l(),{color:"secondary",className:"rustic-align-self-center"})]}),(0,t.jsx)(t.Fragment,{children:!j&&(0,t.jsxs)(w.Box,{className:"rustic-prompt-builder-buttons",children:[(0,t.jsxs)(w.Box,{className:"rustic-prompt-builder-buttons-left",children:[(0,t.jsx)(i(),{variant:"outlined",color:"secondary",startIcon:(0,t.jsx)(B,{name:"close"}),onClick:function(){return v(!0)},children:"Quit"}),(0,t.jsx)(i(),{variant:"outlined",color:"secondary",endIcon:(0,t.jsx)(B,{name:"chevron_right"}),onClick:function(){R(),_(null),d(!0)},disabled:!T,"aria-disabled":!T,children:"Next question"})]}),n&&(0,t.jsx)(w.Box,{className:"rustic-prompt-builder-buttons-right",children:(0,t.jsx)(i(),{variant:"contained",color:"primary",onClick:function(){R(),N(!0),d(!0),e.onSubmit()},disabled:c,"aria-disabled":c,children:"Generate"})})]})})]})};return r})()));
@@ -1 +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,uDAqP9D"}
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,uDA0P9D"}
@@ -1 +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 o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>s});const r=require("react/jsx-runtime"),o=require("@mui/material/Box");var n=e.n(o);const a=require("@mui/material/Chip");var i=e.n(a);require("react");const u=require("uuid"),s=function(e){var t=e.prompts.map((function(t,o){return(0,r.jsx)(i(),{onClick:function(){return r=t,o=(new Date).toISOString(),n={id:(0,u.v4)(),timestamp:o,sender:e.sender,conversationId:e.conversationId,format:"text",data:{text:r}},void e.ws.send(n);var r,o,n},variant:"rusticSecondary",size:"small",className:"rustic-prompt",label:t},o)}));return(0,r.jsx)(n(),{className:e.className,children:t})};return t})()));
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 o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>p});const t=require("react/jsx-runtime"),o=require("@mui/material/Box");var n=e.n(o);const a=require("@mui/material/Chip");var i=e.n(a);const s=require("@mui/system/useTheme");var u=e.n(s);require("react");const c=require("uuid");var l=function(){return l=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},l.apply(this,arguments)};const p=function(e){var r=u()(),o=e.prompts.map((function(o,n){return(0,t.jsx)(i(),{onClick:function(){return r=o,t=(new Date).toISOString(),n={id:(0,c.v4)(),timestamp:t,sender:e.sender,conversationId:e.conversationId,format:"text",data:{text:r}},void e.ws.send(n);var r,t,n},color:"secondary",size:"small",className:"rustic-prompt",sx:l(l({backgroundColor:r.palette.background.paper},"inConversation"===e.position&&{border:"1px solid ".concat(r.palette.divider)}),{"&:hover":{color:r.palette.text.primary,backgroundColor:r.palette.primary.hover}}),label:o},n)}));return(0,t.jsx)(n(),{className:e.className,children:o})};return r})()));
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/components/prompts/prompts.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAOtB,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,UAAU,CAAA;AAErD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,2CAkClD"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/components/prompts/prompts.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAQtB,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,UAAU,CAAA;AAErD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,2CA8ClD"}
@@ -1 +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,{default:()=>f});const r=require("react/jsx-runtime"),i=require("@mui/material"),o=require("@mui/material/Box");var n=e.n(o);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"),f=function(e){var t=(0,m.useState)(""),o=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:o===t?{"&.Mui-disabled":{backgroundColor:"secondary.light",color:"text.primary"}}:{},className:"rustic-option",disabled:!!o,"aria-disabled":!!o,label:t},i)}));return(0,r.jsxs)(n(),{className:"rustic-question",children:[(e.title||e.description)&&(0,r.jsxs)(n(),{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
+ !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,{default:()=>f});const r=require("react/jsx-runtime"),i=require("@mui/material"),o=require("@mui/material/Box");var n=e.n(o);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"),f=function(e){var t=(0,m.useState)(""),o=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)},color:"secondary",size:"small",sx:o===t?{"&.Mui-disabled":{backgroundColor:"secondary.light",color:"text.primary"}}:{},className:"rustic-option",disabled:!!o,"aria-disabled":!!o,label:t},i)}));return(0,r.jsxs)(n(),{className:"rustic-question",children:[(e.title||e.description)&&(0,r.jsxs)(n(),{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 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{StreamingText:()=>c,Text:()=>f,default:()=>l});const r=require("react/jsx-runtime"),a=require("@mui/material/Alert");var o=e.n(a);const n=require("@mui/material/Typography");var i=e.n(n);const u=require("dompurify");var s=e.n(u);const d=require("react"),c=function(e){var t=(0,d.useState)(s().sanitize(e.text)),a=t[0],n=t[1],u=(0,d.useState)(""),c=u[0],f=u[1];return(0,d.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){for(var t=e.text,r=0,a=e.updatedData;r<a.length;r++){var o=a[r];"string"!=typeof o.text&&(t+=" [MISSING TEXT]",f("Some of the incoming text was not correctly formatted. Some data may be missing.")),t+=o.text}n(s().sanitize(t))}}),[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i(),{variant:"body2",children:a}),c&&(0,r.jsx)(o(),{severity:"error",children:c})]})},f=function(e){return(0,r.jsx)(i(),{variant:"body2",className:"rustic-text",children:s().sanitize(e.text)})},l=f;return t})()));
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={1737:(e,t,r)=>{r.d(t,{A:()=>p});var o=r(8732),a=r(5642),n=r.n(a),i=r(785),s=r.n(i),u=r(7447),d=r.n(u),c=r(2015);const p=function(e){var t=(0,c.useState)(d().sanitize(e.text)),r=t[0],a=t[1],i=(0,c.useState)(""),u=i[0],p=i[1];return(0,c.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){for(var t=e.text,r=0,o=e.updatedData;r<o.length;r++){var n=o[r];"string"!=typeof n.text&&(t+=" [MISSING TEXT]",p("Some of the incoming text was not correctly formatted. Some data may be missing.")),t+=n.text}a(d().sanitize(t))}}),[e.text,e.updatedData]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s(),{variant:"body2",children:r}),u&&(0,o.jsx)(n(),{severity:"error",children:u})]})}},7131:(e,t,r)=>{r.d(t,{A:()=>u});var o=r(8732),a=r(785),n=r.n(a),i=r(7447),s=r.n(i);r(2015);const u=function(e){return(0,o.jsx)(n(),{variant:"body2",className:"rustic-text",children:s().sanitize(e.text)})}},5642:e=>{e.exports=require("@mui/material/Alert")},785:e=>{e.exports=require("@mui/material/Typography")},7447:e=>{e.exports=require("dompurify")},2015:e=>{e.exports=require("react")},8732:e=>{e.exports=require("react/jsx-runtime")}},t={};function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.r(o),r.d(o,{StreamingText:()=>a.A,Text:()=>n.A,default:()=>i});var a=r(1737),n=r(7131);const i=n.A;return o})()));
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { MessageSpaceProps } from './messageSpace/messageSpace';
2
3
  export type MessageData = {
3
4
  [key: string]: any;
@@ -209,14 +210,14 @@ export interface UploadOption {
209
210
  export interface UploaderProps {
210
211
  /** The types of files that are allowed to be selected for upload. For safety reasons, only allow file types that can be handled by your server. Avoid accepting executable file types like .exe, .bat, or .msi. For more information, refer to the [mdn web docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers). */
211
212
  acceptedFileTypes: string;
212
- /** The API endpoint where files will be uploaded. File id will be appended to the end of API endpoint. */
213
+ /** The API endpoint where files will be uploaded. File id will be appended to the end of API endpoint. The response should include the URL of the uploaded file, and the send button will not be enabled until all files have been uploaded. */
213
214
  uploadFileEndpoint: string;
214
215
  /** The API endpoint to delete/cancel uploaded files. File id will be appended to the end of API endpoint. */
215
216
  deleteFileEndpoint: string;
216
217
  /** Used in the API request to link the file with the message that's going to be sent. */
217
218
  messageId: string;
218
- /** A function to handle changes in the file list. The parent component should use this to track file names and handle submit accordingly. */
219
- onFileUpdate: (action: 'add' | 'remove', fileName: string) => void;
219
+ /** A function to handle changes in the file list. The parent component should use this to track file names and handle submit accordingly. Url is only required for the 'update' action. */
220
+ onFileUpdate: (action: 'add' | 'remove' | 'update', fileName: string, url?: string) => void;
220
221
  /** Optional HTML div where the errors should be shown. */
221
222
  errorMessagesContainer?: HTMLDivElement;
222
223
  /** Optional HTML div where the filePreviews should be shown. */
@@ -231,6 +232,12 @@ export interface UploaderProps {
231
232
  getUploadData?: (fileName: string) => {
232
233
  [key: string]: any;
233
234
  };
235
+ /** A function that can be used to get the headers for the file upload requests. */
236
+ getUploadHeaders?: () => Promise<{
237
+ headers: {
238
+ Authorization: string;
239
+ };
240
+ }>;
234
241
  /** Defines the available options for file upload, displayed within a popover menu. If no options are provided, an upload icon button will be displayed by default.*/
235
242
  uploadOptions?: UploadOption[];
236
243
  /** A function to fetch and format existing file data when a file upload fails due to a conflict error (HTTP status code 409). The returned value will be used to determine a unique file name by appending an incremented number to the base name. */
@@ -306,4 +313,56 @@ export interface FormFormat extends DataFormat {
306
313
  }
307
314
  export interface DynamicFormProps extends FormFormat, ConversationProps {
308
315
  }
316
+ interface ContentBase {
317
+ type: 'text' | 'image_url' | 'input_audio' | 'file_url';
318
+ }
319
+ export interface ContentTextPart extends ContentBase {
320
+ type: 'text';
321
+ text: string;
322
+ }
323
+ export interface ContentImagePart extends ContentBase {
324
+ type: 'image_url';
325
+ image_url: {
326
+ url: string;
327
+ detail?: string;
328
+ };
329
+ }
330
+ export interface ContentAudioPart extends ContentBase {
331
+ type: 'input_audio';
332
+ input_audio: {
333
+ data: string;
334
+ format: string;
335
+ };
336
+ }
337
+ export interface ContentFilePart extends ContentBase {
338
+ type: 'file_url';
339
+ file_url: {
340
+ url: string;
341
+ name?: string;
342
+ };
343
+ }
344
+ export type Content = ContentTextPart | ContentImagePart | ContentAudioPart | ContentFilePart;
345
+ export interface ChatCompletionRequest {
346
+ /** A list of messages combined into a single displayable message. Supports various content types, including text, images and files. */
347
+ messages: {
348
+ content: string | Content[];
349
+ role: string;
350
+ }[];
351
+ }
352
+ export interface ChatCompletionProps extends DataFormat, ChatCompletionRequest {
353
+ /**
354
+ * An object mapping file extensions to their respective viewer components.
355
+ * Each key represents a file type (e.g., 'pdf', 'jpg'), and the corresponding value is a React component
356
+ * that takes a `url` prop and renders the appropriate viewer for that file type. This prop is used to decide
357
+ * which viewer component should be used to open and display the file within the modal.
358
+ */
359
+ supportedViewers?: {
360
+ [key: string]: React.ComponentType<{
361
+ url: string;
362
+ }>;
363
+ };
364
+ /** Setting this to true will display long file names in full. If set to false, long names will be shortened. */
365
+ showFullName?: boolean;
366
+ }
367
+ export {};
309
368
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6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WAAW,gBAAiB,SAAQ,WAAW;IACnD,IAAI,EAAE,aAAa,CAAA;IACnB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,EAAE;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED,MAAM,MAAM,OAAO,GACf,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,CAAA;AAEnB,MAAM,WAAW,qBAAqB;IACpC,uIAAuI;IACvI,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC1D;AAED,MAAM,WAAW,mBAAoB,SAAQ,UAAU,EAAE,qBAAqB;IAC5E;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAA;IAC1E,gHAAgH;IAChH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB"}
@@ -1 +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,{default:()=>R});const t=require("react/jsx-runtime"),n=require("@mui/material/Box");var a=e.n(n);const i=require("@mui/material/Card");var o=e.n(i);const c=require("@mui/material/Stack");var s=e.n(c);const l=require("@mui/material/Typography");var u=e.n(l);const m=require("react");var d;!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(d||(d={}));var h=function(e){var r=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:r,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[r]}},p=function(){return p=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},p.apply(this,arguments)};function x(e){e.name.replaceAll("_","-");var r={};return e.color&&(r={color:e.color}),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:p({},r),children:e.name})}const v=require("@mui/material"),f=require("@mui/material/Button");var b=e.n(f);const y=require("@mui/material/Drawer");var j=e.n(y);const w=require("@mui/material/IconButton");var g=e.n(w);const N=require("@mui/material/ListItemText");var T=e.n(N);const O=require("@mui/material/Menu");var S=e.n(O);const q=require("@mui/material/MenuItem");var I=e.n(q);const M=require("@mui/material/styles"),D=require("@mui/material/Tooltip");var C=e.n(D);const k=require("@mui/system");var F=function(){return F=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},F.apply(this,arguments)};function P(e){var r=(0,m.useState)(!1),n=r[0],a=r[1],i=(0,m.useRef)(null),o=(0,M.useTheme)(),c=(0,v.useMediaQuery)(o.breakpoints.down("md")),s=c?j():S(),l={borderRadius:"".concat(o.shape.borderRadius,"px"),border:"1px solid ".concat(o.palette.divider)};function d(e){return(0,t.jsxs)(t.Fragment,{children:[e.startDecorator&&(0,t.jsx)(k.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,t.jsx)(T(),{children:(0,t.jsx)(u(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,t.jsx)(k.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}c&&(l=F(F({},l),{borderRadius:"".concat(o.shape.borderRadius,"px ").concat(o.shape.borderRadius,"px 0 0"),borderBottom:0}));var h=e.menuItems.map((function(e){return e.href?(0,t.jsx)(I(),{component:"a",onClick:function(){return a(!1)},href:e.href,download:e.downloadFileName||e.isFiledownload,children:d(e)},e.label):(0,t.jsx)(I(),{onClick:function(r){e.onClick&&e.onClick(r),a(!1)},disabled:!e.onClick,children:d(e)},e.label)}));var p,f,y=c?{}:{anchorEl:i.current};return(0,t.jsxs)(t.Fragment,{children:[(p={onClick:function(e){e.stopPropagation(),a(!0)},"aria-label":e.ariaLabel,ref:i,className:"rustic-popover-menu-button"},f=(0,t.jsx)(x,{name:"more_vert"}),e.buttonText?(0,t.jsx)(b(),F({},p,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,t.jsx)(C(),{title:e.ariaLabel,children:(0,t.jsx)(g(),F({},p,{children:e.icon?e.icon:f}))})),(0,t.jsx)(s,F({open:n,onClose:function(){return a(!1)}},y,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":F(F({},l),{backgroundImage:"none",boxShadow:o.shadows[2]})},children:h}))]})}const R=function(e){var r=(0,m.useState)(e.units),n=r[0],i=r[1];function c(r){return"metric"===e.units&&"imperial"===n?Math.round(1.8*r+32):"imperial"===e.units&&"metric"===n?Math.round(r*(5/9)-32):Math.round(r)}var l=new Date(1e3*e.weather[0].timestamp),d=h(e.weather[0].timestamp).shortName,p=l.getDate(),v=l.getFullYear().toString().slice(2),f="".concat(d," ").concat(p,"/").concat(v," TODAY"),b="HIGH: ".concat(c(e.weather[0].temp.high)," / LOW: ").concat(c(e.weather[0].temp.high)),y=e.weather.map((function(e,r){if(0!==r)return(0,t.jsxs)(o(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,t.jsx)(u(),{variant:"h5",component:"span",color:"text.secondary","aria-label":h(e.timestamp).fullName,children:h(e.timestamp).shortName}),(0,t.jsx)("img",{src:e.weatherIcon.icon,alt:e.weatherIcon.description}),(0,t.jsxs)(u(),{variant:"body2",color:"text.secondary",children:["High: ",c(e.temp.high),"°"]}),(0,t.jsxs)(u(),{variant:"body2",color:"text.secondary",children:["Low: ",c(e.temp.low),"°"]})]},r)}));return(0,t.jsxs)(o(),{variant:"outlined",className:"rustic-weather",children:[(0,t.jsx)(P,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:function(){return i("metric")}},{label:"Fahrenheit",endDecorator:"°F",onClick:function(){return i("imperial")}}]}),(0,t.jsxs)(s(),{alignItems:"center",children:[(0,t.jsx)(u(),{variant:"h4",component:"span",children:e.location}),(0,t.jsxs)(s(),{direction:"row",alignItems:"center",spacing:1,className:"rustic-current-weather-description",children:[(0,t.jsx)("img",{src:e.weather[0].weatherIcon.icon,alt:""}),(0,t.jsx)(u(),{variant:"body2",children:e.weather[0].weatherIcon.description})]}),e.weather[0].temp.current&&(0,t.jsxs)(u(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[c(e.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(n)]}),(0,t.jsxs)(s(),{direction:"row",spacing:2,children:[(0,t.jsx)(u(),{variant:"overline",children:f}),(0,t.jsx)(u(),{variant:"overline",children:b})]})]}),(0,t.jsx)(a(),{className:"rustic-daily-weather-container",children:y}),e.weatherProvider&&(0,t.jsxs)(s(),{alignItems:"center",direction:"row",spacing:1,alignSelf:"center",className:"rustic-weather-attribution",children:[(0,t.jsx)(x,{name:"cloud"}),(0,t.jsx)(u(),{variant:"body2",children:"Weather data provided by ".concat(e.weatherProvider)})]})]})};return r})()));
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,{default:()=>R});const t=require("react/jsx-runtime"),n=require("@mui/material/Box");var a=e.n(n);const i=require("@mui/material/Card");var o=e.n(i);const c=require("@mui/material/Stack");var s=e.n(c);const l=require("@mui/material/Typography");var u=e.n(l);const m=require("react");var d;function h(e){var r=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:r,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[r]}}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(d||(d={}));var p=function(){return p=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},p.apply(this,arguments)};function x(e){e.name.replaceAll("_","-");var r={};return e.color&&(r={color:e.color}),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:p({},r),children:e.name})}const v=require("@mui/material"),f=require("@mui/material/Button");var b=e.n(f);const y=require("@mui/material/Drawer");var j=e.n(y);const w=require("@mui/material/IconButton");var g=e.n(w);const N=require("@mui/material/ListItemText");var T=e.n(N);const O=require("@mui/material/Menu");var S=e.n(O);const q=require("@mui/material/MenuItem");var I=e.n(q);const M=require("@mui/material/styles"),D=require("@mui/material/Tooltip");var C=e.n(D);const k=require("@mui/system");var F=function(){return F=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},F.apply(this,arguments)};function P(e){var r=(0,m.useState)(!1),n=r[0],a=r[1],i=(0,m.useRef)(null),o=(0,M.useTheme)(),c=(0,v.useMediaQuery)(o.breakpoints.down("md")),s=c?j():S(),l={borderRadius:"".concat(o.shape.borderRadius,"px"),border:"1px solid ".concat(o.palette.divider)};function d(e){return(0,t.jsxs)(t.Fragment,{children:[e.startDecorator&&(0,t.jsx)(k.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,t.jsx)(T(),{children:(0,t.jsx)(u(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,t.jsx)(k.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}c&&(l=F(F({},l),{borderRadius:"".concat(o.shape.borderRadius,"px ").concat(o.shape.borderRadius,"px 0 0"),borderBottom:0}));var h=e.menuItems.map((function(e){return e.href?(0,t.jsx)(I(),{component:"a",onClick:function(){return a(!1)},href:e.href,download:e.downloadFileName||e.isFiledownload,children:d(e)},e.label):(0,t.jsx)(I(),{onClick:function(r){e.onClick&&e.onClick(r),a(!1)},disabled:!e.onClick,children:d(e)},e.label)}));var p,f,y=c?{}:{anchorEl:i.current};return(0,t.jsxs)(t.Fragment,{children:[(p={onClick:function(e){e.stopPropagation(),a(!0)},"aria-label":e.ariaLabel,ref:i,className:"rustic-popover-menu-button"},f=(0,t.jsx)(x,{name:"more_vert"}),e.buttonText?(0,t.jsx)(b(),F({},p,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,t.jsx)(C(),{title:e.ariaLabel,children:(0,t.jsx)(g(),F({},p,{children:e.icon?e.icon:f}))})),(0,t.jsx)(s,F({open:n,onClose:function(){return a(!1)}},y,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":F(F({},l),{backgroundImage:"none",boxShadow:o.shadows[2]})},children:h}))]})}const R=function(e){var r=(0,m.useState)(e.units),n=r[0],i=r[1];function c(r){return"metric"===e.units&&"imperial"===n?Math.round(1.8*r+32):"imperial"===e.units&&"metric"===n?Math.round(r*(5/9)-32):Math.round(r)}var l=new Date(1e3*e.weather[0].timestamp),d=h(e.weather[0].timestamp).shortName,p=l.getDate(),v=l.getFullYear().toString().slice(2),f="".concat(d," ").concat(p,"/").concat(v," TODAY"),b="HIGH: ".concat(c(e.weather[0].temp.high)," / LOW: ").concat(c(e.weather[0].temp.high)),y=e.weather.map((function(e,r){if(0!==r)return(0,t.jsxs)(o(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,t.jsx)(u(),{variant:"h5",component:"span",color:"text.secondary","aria-label":h(e.timestamp).fullName,children:h(e.timestamp).shortName}),(0,t.jsx)("img",{src:e.weatherIcon.icon,alt:e.weatherIcon.description}),(0,t.jsxs)(u(),{variant:"body2",color:"text.secondary",children:["High: ",c(e.temp.high),"°"]}),(0,t.jsxs)(u(),{variant:"body2",color:"text.secondary",children:["Low: ",c(e.temp.low),"°"]})]},r)}));return(0,t.jsxs)(o(),{variant:"outlined",className:"rustic-weather",children:[(0,t.jsx)(P,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:function(){return i("metric")}},{label:"Fahrenheit",endDecorator:"°F",onClick:function(){return i("imperial")}}]}),(0,t.jsxs)(s(),{alignItems:"center",children:[(0,t.jsx)(u(),{variant:"h4",component:"span",children:e.location}),(0,t.jsxs)(s(),{direction:"row",alignItems:"center",spacing:1,className:"rustic-current-weather-description",children:[(0,t.jsx)("img",{src:e.weather[0].weatherIcon.icon,alt:""}),(0,t.jsx)(u(),{variant:"body2",children:e.weather[0].weatherIcon.description})]}),e.weather[0].temp.current&&(0,t.jsxs)(u(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[c(e.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(n)]}),(0,t.jsxs)(s(),{direction:"row",spacing:2,children:[(0,t.jsx)(u(),{variant:"overline",children:f}),(0,t.jsx)(u(),{variant:"overline",children:b})]})]}),(0,t.jsx)(a(),{className:"rustic-daily-weather-container",children:y}),e.weatherProvider&&(0,t.jsxs)(s(),{alignItems:"center",direction:"row",spacing:1,alignSelf:"center",className:"rustic-weather-attribution",children:[(0,t.jsx)(x,{name:"cloud"}),(0,t.jsx)(u(),{variant:"body2",children:"Weather data provided by ".concat(e.weatherProvider)})]})]})};return r})()));
package/dist/index.css CHANGED
@@ -161,7 +161,7 @@ code {
161
161
  }
162
162
 
163
163
  .rustic-base-input .rustic-input-label {
164
- padding-top: 8px;
164
+ padding-top: 10px;
165
165
  }
166
166
 
167
167
  .rustic-base-input .rustic-text-field .MuiOutlinedInput-input {
@@ -235,6 +235,10 @@ emoji-picker {
235
235
  min-width: 220px;
236
236
  }
237
237
 
238
+ .rustic-file-preview-name {
239
+ margin-right: 8px;
240
+ }
241
+
238
242
  .rustic-file-preview-modal {
239
243
  width: 90vw;
240
244
  height: 90vh;