@rustic-ai/ui-components 2.0.0 → 3.0.0
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 +7 -2
- package/dist/components/calendar/fCCalendar.d.ts.map +1 -1
- package/dist/components/calendar/index.css +4 -12
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/codeSnippet/codeSnippet.d.ts +1 -1
- package/dist/components/codeSnippet/codeSnippet.d.ts.map +1 -1
- package/dist/components/codeSnippet/index.js +1 -1
- package/dist/components/dynamicForm/index.d.ts +2 -1
- package/dist/components/dynamicForm/index.d.ts.map +1 -1
- package/dist/components/dynamicForm/index.js +1 -1
- package/dist/components/dynamicForm/uniformsForm.d.ts +3 -3
- package/dist/components/dynamicForm/uniformsForm.d.ts.map +1 -1
- package/dist/components/elementRenderer/elementRenderer.d.ts +2 -1
- package/dist/components/elementRenderer/elementRenderer.d.ts.map +1 -1
- package/dist/components/elementRenderer/index.js +1 -1
- package/dist/components/filePreview/filePreview.d.ts +2 -2
- package/dist/components/filePreview/filePreview.d.ts.map +1 -1
- package/dist/components/helper.d.ts.map +1 -1
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/image/image.d.ts +1 -1
- package/dist/components/image/image.d.ts.map +1 -1
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/baseInput/baseInput.d.ts +1 -1
- package/dist/components/input/baseInput/baseInput.d.ts.map +1 -1
- package/dist/components/input/emoji/emoji.d.ts +1 -1
- package/dist/components/input/emoji/emoji.d.ts.map +1 -1
- package/dist/components/input/emoji/index.js +1 -1
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -1
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts +1 -1
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
- package/dist/components/input/multimodal/uploader/index.js +1 -1
- package/dist/components/input/multimodal/uploader/uploader.d.ts +2 -1
- package/dist/components/input/multimodal/uploader/uploader.d.ts.map +1 -1
- package/dist/components/input/textInput/index.js +1 -1
- package/dist/components/input/textInput/textInput.d.ts +1 -1
- package/dist/components/input/textInput/textInput.d.ts.map +1 -1
- package/dist/components/map/index.js +1 -1
- package/dist/components/map/openLayersMap.d.ts +1 -1
- package/dist/components/map/openLayersMap.d.ts.map +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/markdown/markedMarkdown.d.ts +1 -1
- package/dist/components/markdown/markedMarkdown.d.ts.map +1 -1
- package/dist/components/media/audio/index.js +1 -1
- package/dist/components/media/audio/sound.d.ts +1 -1
- package/dist/components/media/audio/sound.d.ts.map +1 -1
- package/dist/components/media/controls/commonControls.d.ts +7 -6
- package/dist/components/media/controls/commonControls.d.ts.map +1 -1
- package/dist/components/media/controls/mediaIconButton.d.ts +1 -1
- package/dist/components/media/controls/mediaIconButton.d.ts.map +1 -1
- package/dist/components/media/controls/videoControls.d.ts +2 -2
- package/dist/components/media/controls/videoControls.d.ts.map +1 -1
- package/dist/components/media/timeIndicator/timeIndicator.d.ts +1 -1
- package/dist/components/media/timeIndicator/timeIndicator.d.ts.map +1 -1
- package/dist/components/media/transcript/transcript.d.ts +1 -1
- package/dist/components/media/transcript/transcript.d.ts.map +1 -1
- package/dist/components/media/video/index.js +1 -1
- package/dist/components/media/video/video.d.ts +1 -1
- package/dist/components/media/video/video.d.ts.map +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/popoverMenu.d.ts +2 -2
- package/dist/components/menu/popoverMenu.d.ts.map +1 -1
- package/dist/components/messageArchive/index.js +1 -1
- package/dist/components/messageArchive/messageArchive.d.ts +1 -1
- package/dist/components/messageArchive/messageArchive.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/action.d.ts +2 -1
- package/dist/components/messageCanvas/actions/action.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts +1 -1
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/copy/index.js +1 -1
- package/dist/components/messageCanvas/actions/index.js +1 -1
- package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -1
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts +1 -1
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts.map +1 -1
- package/dist/components/messageCanvas/index.js +1 -1
- package/dist/components/messageCanvas/messageCanvas.d.ts +2 -1
- package/dist/components/messageCanvas/messageCanvas.d.ts.map +1 -1
- package/dist/components/messageSpace/index.js +1 -1
- package/dist/components/messageSpace/messageSpace.d.ts +1 -1
- package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
- package/dist/components/multipart/chatCompletion/chatCompletion.d.ts +2 -1
- package/dist/components/multipart/chatCompletion/chatCompletion.d.ts.map +1 -1
- package/dist/components/multipart/chatCompletion/index.js +1 -1
- package/dist/components/multipart/downloadButton.d.ts +1 -1
- package/dist/components/multipart/downloadButton.d.ts.map +1 -1
- package/dist/components/multipart/multipart/index.js +1 -1
- package/dist/components/multipart/multipart/multipart.d.ts +1 -1
- package/dist/components/multipart/multipart/multipart.d.ts.map +1 -1
- package/dist/components/participantsContainer/index.js +1 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts +1 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts.map +1 -1
- package/dist/components/pdfViewer/controlButton/controlButton.d.ts +1 -1
- package/dist/components/pdfViewer/controlButton/controlButton.d.ts.map +1 -1
- package/dist/components/pdfViewer/index.js +1 -1
- package/dist/components/pdfViewer/pdfViewer.d.ts +2 -1
- package/dist/components/pdfViewer/pdfViewer.d.ts.map +1 -1
- package/dist/components/prompts/index.js +1 -1
- package/dist/components/prompts/prompts.d.ts +1 -1
- package/dist/components/prompts/prompts.d.ts.map +1 -1
- package/dist/components/question/index.js +1 -1
- package/dist/components/question/question.d.ts +1 -1
- package/dist/components/question/question.d.ts.map +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/table.d.ts +2 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/text/text.d.ts +1 -1
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/timestamp/index.js +1 -1
- package/dist/components/timestamp/timestamp.d.ts +1 -1
- package/dist/components/timestamp/timestamp.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/index.d.ts +1 -1
- package/dist/components/visualization/mermaidViz/index.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/index.js +1 -1
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts +1 -1
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts.map +1 -1
- package/dist/components/visualization/perspectiveViz/index.css +6 -0
- package/dist/components/visualization/perspectiveViz/index.js +1 -1
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts +3 -3
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts.map +1 -1
- package/dist/components/visualization/plotlyGraph/index.d.ts +1 -1
- package/dist/components/visualization/plotlyGraph/index.d.ts.map +1 -1
- package/dist/components/visualization/plotlyGraph/index.js +1 -1
- package/dist/components/visualization/plotlyGraph/plotlyGraph.d.ts +1 -11
- package/dist/components/visualization/plotlyGraph/plotlyGraph.d.ts.map +1 -1
- package/dist/components/visualization/plotlyGraph/plotlyGraph.types.d.ts +9 -3
- package/dist/components/visualization/plotlyGraph/plotlyGraph.types.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/index.d.ts +1 -1
- package/dist/components/visualization/vegaLiteViz/index.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/index.js +1 -1
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts +1 -1
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts.map +1 -1
- package/dist/components/weather/index.js +1 -1
- package/dist/components/weather/weather.d.ts +1 -1
- package/dist/components/weather/weather.d.ts.map +1 -1
- package/dist/index.css +10 -12
- package/dist/index.js +1 -1
- package/dist/rusticTheme.d.ts.map +1 -1
- package/dist/rusticTheme.js +1 -1
- package/dist/vendor/uniforms-mui/AutoField.d.ts +7 -0
- package/dist/vendor/uniforms-mui/AutoField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/AutoFields.d.ts +9 -0
- package/dist/vendor/uniforms-mui/AutoFields.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/AutoForm.d.ts +216 -0
- package/dist/vendor/uniforms-mui/AutoForm.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/BaseForm.d.ts +4 -0
- package/dist/vendor/uniforms-mui/BaseForm.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/BoolField.d.ts +15 -0
- package/dist/vendor/uniforms-mui/BoolField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/DateField.d.ts +11 -0
- package/dist/vendor/uniforms-mui/DateField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/ErrorField.d.ts +14 -0
- package/dist/vendor/uniforms-mui/ErrorField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/ErrorsField.d.ts +11 -0
- package/dist/vendor/uniforms-mui/ErrorsField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/HiddenField.d.ts +10 -0
- package/dist/vendor/uniforms-mui/HiddenField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/LICENSE +21 -0
- package/dist/vendor/uniforms-mui/ListAddField.d.ts +18 -0
- package/dist/vendor/uniforms-mui/ListAddField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/ListDelField.d.ts +11 -0
- package/dist/vendor/uniforms-mui/ListDelField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/ListField.d.ts +13 -0
- package/dist/vendor/uniforms-mui/ListField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/ListItemField.d.ts +13 -0
- package/dist/vendor/uniforms-mui/ListItemField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/LongTextField.d.ts +6 -0
- package/dist/vendor/uniforms-mui/LongTextField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/NestField.d.ts +10 -0
- package/dist/vendor/uniforms-mui/NestField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/NumField.d.ts +11 -0
- package/dist/vendor/uniforms-mui/NumField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/QuickForm.d.ts +70 -0
- package/dist/vendor/uniforms-mui/QuickForm.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/RadioField.d.ts +24 -0
- package/dist/vendor/uniforms-mui/RadioField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/SelectField.d.ts +28 -0
- package/dist/vendor/uniforms-mui/SelectField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/SubmitField.d.ts +10 -0
- package/dist/vendor/uniforms-mui/SubmitField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/TextField.d.ts +6 -0
- package/dist/vendor/uniforms-mui/TextField.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/ValidatedForm.d.ts +71 -0
- package/dist/vendor/uniforms-mui/ValidatedForm.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/ValidatedQuickForm.d.ts +142 -0
- package/dist/vendor/uniforms-mui/ValidatedQuickForm.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/index.d.ts +25 -0
- package/dist/vendor/uniforms-mui/index.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/types.d.ts +8 -0
- package/dist/vendor/uniforms-mui/types.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/utils.d.ts +13 -0
- package/dist/vendor/uniforms-mui/utils.d.ts.map +1 -0
- package/dist/vendor/uniforms-mui/wrapField.d.ts +3 -0
- package/dist/vendor/uniforms-mui/wrapField.d.ts.map +1 -0
- package/package.json +95 -104
|
@@ -4,6 +4,6 @@ type DownloadButtonProps = {
|
|
|
4
4
|
fileName: string;
|
|
5
5
|
getAuthHeaders?: GetAuthHeaders;
|
|
6
6
|
};
|
|
7
|
-
export default function DownloadButton(props: DownloadButtonProps): import("react
|
|
7
|
+
export default function DownloadButton(props: DownloadButtonProps): import("react").JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=downloadButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadButton.d.ts","sourceRoot":"","sources":["../../../src/components/multipart/downloadButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"downloadButton.d.ts","sourceRoot":"","sources":["../../../src/components/multipart/downloadButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,KAAK,mBAAmB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BA8ChE"}
|
|
@@ -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={88(e,t,r){var n;function a(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function i(e,t,r){var n;return e&&e.length>0&&null!==(n=e[e.length-1][t])&&void 0!==n?n:r}r.d(t,{l1:()=>a,zT:()=>i}),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(n||(n={}))},8010(e,t,r){r.d(t,{default:()=>a});var n=r(227);r(7159);const a=n.A},227(e,t,r){r.d(t,{A:()=>h});var n=r(8732),a=r(5642),i=r.n(a),o=r(6182),s=r(785),l=r.n(s),c=r(7447),u=r.n(c),d=r(3840),p=r(2015),m=r(88),f=r(7159);const h=function(e){var t=(0,o.useTheme)(),r=(0,p.useState)(e.text),a=r[0],s=r[1],c=(0,p.useState)(""),h=c[0],v=c[1],x=(0,m.zT)(e.updatedData,"title",e.title),b=(0,m.zT)(e.updatedData,"description",e.description);function j(e){return"string"!=typeof e?(v("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}function g(e){return(0,n.jsx)(l(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:(r=e,a=r.replace(/^[\u200B-\u200F\uFEFF]/,""),i=d.marked.parse(a,{async:!1,breaks:!0,gfm:!0}),u().sanitize(i))},sx:{"& table, & th, & td":{border:"1px solid ".concat(t.palette.divider)}}});var r,a,i}return(0,p.useEffect)(function(){if(e.updatedData&&e.updatedData.length>0){var t=e.text,r=e.updatedData.at(-1);if(e.updatedData.length>1&&e.updateType===f.Ur.Replace)t=j(null==r?void 0:r.text);else for(var n=0,a=e.updatedData;n<a.length;n++){var i=a[n],o=e.updateType||f.Ur.Append,l=j(i.text);o===f.Ur.Append?t+=l:o===f.Ur.Replace&&(t=l)}s(t)}},[e.text,e.updatedData]),(0,n.jsxs)(n.Fragment,{children:[x&&(0,n.jsx)(l(),{variant:"h6",children:x}),b&&g(b),g(a),h&&(0,n.jsx)(i(),{severity:"error",children:h})]})}},7159(e,t,r){var n,a,i,o;r.d(t,{Ur:()=>a}),function(e){e.Running="running",e.Completed="completed",e.Error="error"}(n||(n={})),function(e){e.Append="append",e.Replace="replace"}(a||(a={})),function(e){e.Owner="owner",e.Member="member"}(i||(i={})),function(e){e.Human="human",e.Agent="agent"}(o||(o={}))},5642(e){e.exports=require("@mui/material/Alert")},785(e){e.exports=require("@mui/material/Typography")},6182(e){e.exports=require("@mui/material/styles")},7447(e){e.exports=require("dompurify")},3840(e){e.exports=require("marked")},2015(e){e.exports=require("react")},8732(e){e.exports=require("react/jsx-runtime")}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var 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:()=>E});var a=r(8732),i=r(785),o=r.n(i);const s=require("@mui/system/Box");var l=r.n(s),c=r(2015);const u=require("@mui/material/Card");var d=r.n(u);const p=require("@mui/material/IconButton");var m=r.n(p);const f=require("@mui/material/Modal");var h=r.n(f),v=r(6182);const x=require("@mui/material/Tooltip");var b=r.n(x),j=r(88),g=function(){return g=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},g.apply(this,arguments)};function y(e){e.name.replaceAll("_","-");var t={};return e.color&&(t={color:e.color}),(0,a.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:g({},t),children:e.name})}const w=require("@mui/material/Box");var N=r.n(w);const O=require("@mui/material/TextField");var k=r.n(O);const S=require("@mui/material/useMediaQuery");var C=r.n(S);const A=require("@mui/system/Stack");var P=r.n(A);const T=require("@mui/system/useTheme");var q=r.n(T);const D=require("pdfjs-dist"),H=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,a.jsx)(b(),{title:r.label,children:(0,a.jsx)("span",{children:(0,a.jsx)(m(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,a.jsx)(y,{name:r.symbol})})})})};var F={pdf:function(e){var t,r=(0,c.useRef)(null),n=(0,c.useState)(1),i=n[0],s=n[1],l=(0,c.useState)(1),u=l[0],p=l[1],m=(0,c.useState)(1),f=m[0],h=m[1],v=(0,c.useState)(!1),x=v[0],b=v[1],j=(0,c.useState)(),g=j[0],y=j[1],w=q()(),O=C()(w.breakpoints.down("sm")),S=C()(w.breakpoints.between("sm","md"));if(t=e.url,!/\/[^/]+\.pdf$/.test(t))return(0,a.jsx)(d(),{variant:"outlined",className:"rustic-pdf-error",children:(0,a.jsx)(o(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var A=(0,c.useState)(function(){return O?.5:S?1:1.5}),T=A[0],F=A[1];function R(t){D.getDocument({url:e.url,httpHeaders:t}).promise.then(function(e){p(e.numPages),function(e){e.getPage(i).then(function(e){var t=e.getViewport({scale:T}),n=r.current;if(n){var a=n.getContext("2d");if(a){var i=window.devicePixelRatio||1;n.style.width="".concat(t.width,"px"),n.style.height="".concat(t.height,"px"),n.width=t.width*i,n.height=t.height*i;var o={canvas:n,canvasContext:a,viewport:t,transform:[i,0,0,i,0,0]};g&&g.cancel();var s=e.render(o);y(s),s.promise.then(function(){y(void 0)}).catch(function(e){console.error(e)})}}})}(e)}).catch(function(){b(!0)})}return(0,c.useEffect)(function(){D.GlobalWorkerOptions.workerSrc||(D.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(D.version,"/pdf.worker.mjs")),e.getAuthHeaders?e.getAuthHeaders().then(function(e){return R(e.headers)}).catch(function(){return b(!0)}):R()},[e.url,i,T]),x?(0,a.jsx)(d(),{variant:"outlined",className:"rustic-pdf-error",children:(0,a.jsx)(o(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,a.jsxs)(d(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,a.jsxs)(N(),{className:"rustic-pdf-viewer-header",children:[(0,a.jsx)(H,{action:"zoomOut",onClick:function(){F(function(e){return Math.max(e-.2,.2)})}}),(0,a.jsx)(H,{action:"zoomIn",onClick:function(){F(function(e){return e+.2})}})]}),(0,a.jsx)(N(),{className:"rustic-pdf-viewer-body",children:(0,a.jsx)(N(),{className:"rustic-pdf-viewer-body-inner",children:(0,a.jsx)("canvas",{ref:r})})}),(0,a.jsxs)(P(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,a.jsx)(H,{action:"previousPage",onClick:function(){i>1&&(s(i-1),h(i-1))},isDisabled:1===i}),(0,a.jsx)(o(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,a.jsx)(k(),{type:"number",value:f,onChange:function(e){var t=parseInt(e.target.value);h(t),!isNaN(t)&&t>=1&&t<=u&&s(t)},size:"small",className:"rustic-pdf-page-input"}),(0,a.jsxs)(o(),{variant:"body1",className:"rustic-page-indicator",children:["of ",u]}),(0,a.jsx)(H,{action:"nextPage",onClick:function(){i<u&&(s(i+1),h(i+1))},isDisabled:i===u})]})]})}};function R(e){var t=e.supportedViewers,r=void 0===t?F:t,n=e.showFullName,i=void 0===n||n,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}(e,["supportedViewers","showFullName"]),l=(0,v.useTheme)(),u=(0,c.useState)(!1),p=u[0],f=u[1];function x(){f(!1)}var g,w=s.file.url&&(g=s.file.url.split("."))[g.length-1].toLowerCase(),N=w&&r?r[w]:null,O=!!N,k=O?" rustic-cursor-pointer":"",S="rustic-file-preview ".concat(i?"rustic-flexible-file-preview-width":"rustic-fixed-file-preview-width").concat(k),C=i?s.file.name:(0,j.l1)(s.file.name,15);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d(),{className:S,variant:"outlined",sx:{boxShadow:l.shadows[1]},onClick:function(){f(!0)},children:[(0,a.jsx)(o(),{variant:"subtitle2",className:"rustic-file-preview-name",children:C}),(0,a.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:s.children})]}),O&&(0,a.jsx)(h(),{open:p,onClose:x,className:"rustic-file-preview-modal",children:(0,a.jsxs)("div",{className:"rustic-modal-content",children:[(0,a.jsx)(b(),{title:"Close",children:(0,a.jsx)(m(),{onClick:x,className:"rustic-close-button",children:(0,a.jsx)(y,{name:"close"})})}),s.file.url&&(0,a.jsx)(N,{url:s.file.url,getAuthHeaders:s.getAuthHeaders})]})})]})}var _=r(8010),U=function(){return U=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},U.apply(this,arguments)};function z(e){return(0,a.jsx)(b(),{title:"Download",className:"rustic-shift-to-right-by-8",children:e.getAuthHeaders?(0,a.jsx)(m(),{onClick:function(){(0,e.getAuthHeaders)().then(function(t){return fetch(e.url,U({},t))}).then(function(e){return e.blob()}).then(function(t){var r=window.URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=e.fileName,document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(r)}).catch(function(e){throw new Error("Error downloading file. "+e.message)})},children:(0,a.jsx)(y,{name:"download"})}):(0,a.jsx)(m(),{component:"a",href:e.url,download:e.fileName,children:(0,a.jsx)(y,{name:"download"})})})}const E=function(e){return(0,a.jsxs)(l(),{className:"rustic-multipart",children:[(e.title||e.description)&&(0,a.jsxs)("div",{children:[e.title&&(0,a.jsx)(o(),{variant:"h6",children:e.title}),e.description&&(0,a.jsx)(_.default,{text:e.description})]}),e.text&&(0,a.jsx)(_.default,{text:e.text}),(t=e.files.map(function(t,r){return(0,a.jsx)(R,{file:t,showFullName:e.showFullName,getAuthHeaders:e.getAuthHeaders,children:t.url&&(0,a.jsx)(z,{url:t.url,fileName:t.name,getAuthHeaders:e.getAuthHeaders})},r)}),(0,a.jsx)(l(),{className:"rustic-files",children:t}))]});var t};return n})());
|
|
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={88(e,t,r){var n;function s(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function a(e,t,r){var n;return e&&e.length>0&&null!==(n=e[e.length-1][t])&&void 0!==n?n:r}r.d(t,{l1:()=>s,zT:()=>a}),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(n||(n={}))},8010(e,t,r){var n=r(227);r(7159);const s=n.A;r.d(t,["default",0,s])},227(e,t,r){var n=r(8732),s=r(5642),a=r.n(s),o=r(6182),i=r(785),l=r.n(i),c=r(7447),u=r.n(c),d=r(3840),m=r(2015),p=r(88),f=r(7159);r.d(t,["A",0,e=>{const t=(0,o.useTheme)(),[r,s]=(0,m.useState)(e.text),[i,c]=(0,m.useState)(""),h=(0,p.zT)(e.updatedData,"title",e.title),x=(0,p.zT)(e.updatedData,"description",e.description);function v(e){return"string"!=typeof e?(c("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}function b(e){const t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=d.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return u().sanitize(r)}function j(e){return(0,n.jsx)(l(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:b(e)},sx:{"& table, & th, & td":{border:`1px solid ${t.palette.divider}`}}})}return(0,m.useEffect)(()=>{if(e.updatedData&&e.updatedData.length>0){let t=e.text;const r=e.updatedData.at(-1);if(e.updatedData.length>1&&e.updateType===f.Ur.Replace)t=v(null==r?void 0:r.text);else for(const r of e.updatedData){const n=e.updateType||f.Ur.Append,s=v(r.text);n===f.Ur.Append?t+=s:n===f.Ur.Replace&&(t=s)}s(t)}},[e.text,e.updatedData]),(0,n.jsxs)(n.Fragment,{children:[h&&(0,n.jsx)(l(),{variant:"h6",children:h}),x&&j(x),j(r),i&&(0,n.jsx)(a(),{severity:"error",children:i})]})}])},7159(e,t,r){var n,s,a,o;r.d(t,{Ur:()=>s}),function(e){e.Running="running",e.Completed="completed",e.Error="error"}(n||(n={})),function(e){e.Append="append",e.Replace="replace"}(s||(s={})),function(e){e.Owner="owner",e.Member="member"}(a||(a={})),function(e){e.Human="human",e.Agent="agent"}(o||(o={}))},5642(e){e.exports=require("@mui/material/Alert")},785(e){e.exports=require("@mui/material/Typography")},6182(e){e.exports=require("@mui/material/styles")},7447(e){e.exports=require("dompurify")},3840(e){e.exports=require("marked")},2015(e){e.exports=require("react")},8732(e){e.exports=require("react/jsx-runtime")}};const t={};function r(n){const s=t[n];if(void 0!==s)return s.exports;const a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var s=t[n++],a=t[n++],o=a?{enumerable:!0,get:a}:{enumerable:!0,value:t[n++]};r.o(e,s)||Object.defineProperty(e,s,o)}else for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})};let n={};r.r(n),r.d(n,{default:()=>U});var s=r(8732),a=r(785),o=r.n(a);const i=require("@mui/system/Box");var l=r.n(i);const c=require("@mui/material/Card");var u=r.n(c);const d=require("@mui/material/IconButton");var m=r.n(d);const p=require("@mui/material/Modal");var f=r.n(p),h=r(6182);const x=require("@mui/material/Tooltip");var v=r.n(x),b=r(2015),j=r(88);function g(e){e.name.replaceAll("_","-");let t={};return e.color&&(t={color:e.color}),(0,s.jsx)("span",{className:(e.className?e.className+" ":"")+"material-symbols-rounded",style:Object.assign({},t),children:e.name})}const w=require("@mui/material/Box");var y=r.n(w);const N=require("@mui/material/TextField");var O=r.n(N);const k=require("@mui/material/useMediaQuery");var A=r.n(k);const C=require("@mui/system/Stack");var S=r.n(C);const T=require("@mui/system/useTheme");var P=r.n(T);const q=require("pdfjs-dist"),D=function(e){const 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,s.jsx)(v(),{title:r.label,children:(0,s.jsx)("span",{children:(0,s.jsx)(m(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,s.jsx)(g,{name:r.symbol})})})})};const H={pdf:function(e){const t=(0,b.useRef)(null),[r,n]=(0,b.useState)(1),[a,i]=(0,b.useState)(1),[l,c]=(0,b.useState)(1),[d,m]=(0,b.useState)(!1),[p,f]=(0,b.useState)(),h=P()(),x=A()(h.breakpoints.down("sm")),v=A()(h.breakpoints.between("sm","md"));if(j=e.url,!/\/[^/]+\.pdf$/.test(j))return(0,s.jsx)(u(),{variant:"outlined",className:"rustic-pdf-error",children:(0,s.jsx)(o(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var j;const[g,w]=(0,b.useState)(function(){return x?.5:v?1:1.5});function N(n){q.getDocument({url:e.url,httpHeaders:n}).promise.then(e=>{i(e.numPages),function(e){e.getPage(r).then(e=>{const r=e.getViewport({scale:g}),n=t.current;if(!n)return;const s=n.getContext("2d");if(!s)return;const a=window.devicePixelRatio||1;n.style.width=`${r.width}px`,n.style.height=`${r.height}px`,n.width=r.width*a,n.height=r.height*a;const o={canvas:n,canvasContext:s,viewport:r,transform:[a,0,0,a,0,0]};p&&p.cancel();const i=e.render(o);f(i),i.promise.then(()=>{f(void 0)}).catch(e=>{console.error(e)})})}(e)}).catch(()=>{m(!0)})}return(0,b.useEffect)(()=>{q.GlobalWorkerOptions.workerSrc||(q.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${q.version}/pdf.worker.mjs`),e.getAuthHeaders?e.getAuthHeaders().then(e=>N(e.headers)).catch(()=>m(!0)):N()},[e.url,r,g]),d?(0,s.jsx)(u(),{variant:"outlined",className:"rustic-pdf-error",children:(0,s.jsx)(o(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,s.jsxs)(u(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,s.jsxs)(y(),{className:"rustic-pdf-viewer-header",children:[(0,s.jsx)(D,{action:"zoomOut",onClick:function(){w(e=>Math.max(e-.2,.2))}}),(0,s.jsx)(D,{action:"zoomIn",onClick:function(){w(e=>e+.2)}})]}),(0,s.jsx)(y(),{className:"rustic-pdf-viewer-body",children:(0,s.jsx)(y(),{className:"rustic-pdf-viewer-body-inner",children:(0,s.jsx)("canvas",{ref:t})})}),(0,s.jsxs)(S(),{direction:"row",sx:{justifyContent:"center",alignItems:"center",gap:1},children:[(0,s.jsx)(D,{action:"previousPage",onClick:function(){r>1&&(n(r-1),c(r-1))},isDisabled:1===r}),(0,s.jsx)(o(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,s.jsx)(O(),{type:"number",value:l,onChange:function(e){const t=parseInt(e.target.value);c(t),!isNaN(t)&&t>=1&&t<=a&&n(t)},size:"small",className:"rustic-pdf-page-input"}),(0,s.jsxs)(o(),{variant:"body1",className:"rustic-page-indicator",children:["of ",a]}),(0,s.jsx)(D,{action:"nextPage",onClick:function(){r<a&&(n(r+1),c(r+1))},isDisabled:r===a})]})]})}};function F(e){var{supportedViewers:t=H,showFullName:r=!0}=e,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}(e,["supportedViewers","showFullName"]);const a=(0,h.useTheme)(),[i,l]=(0,b.useState)(!1);function c(){l(!1)}const d=n.file.url&&function(e){const t=e.split(".");return t[t.length-1].toLowerCase()}(n.file.url),p=d&&t?t[d]:null,x=!!p,w=`rustic-file-preview ${r?"rustic-flexible-file-preview-width":"rustic-fixed-file-preview-width"}${x?" rustic-cursor-pointer":""}`,y=r?n.file.name:(0,j.l1)(n.file.name,15);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u(),{className:w,variant:"outlined",sx:{boxShadow:a.shadows[1]},onClick:function(){l(!0)},children:[(0,s.jsx)(o(),{variant:"subtitle2",className:"rustic-file-preview-name",children:y}),(0,s.jsx)("div",{onClick:e=>e.stopPropagation(),children:n.children})]}),x&&(0,s.jsx)(f(),{open:i,onClose:c,className:"rustic-file-preview-modal",children:(0,s.jsxs)("div",{className:"rustic-modal-content",children:[(0,s.jsx)(v(),{title:"Close",children:(0,s.jsx)(m(),{onClick:c,className:"rustic-close-button",children:(0,s.jsx)(g,{name:"close"})})}),n.file.url&&(0,s.jsx)(p,{url:n.file.url,getAuthHeaders:n.getAuthHeaders})]})})]})}var R=r(8010);function _(e){return(0,s.jsx)(v(),{title:"Download",className:"rustic-shift-to-right-by-8",children:e.getAuthHeaders?(0,s.jsx)(m(),{onClick:()=>{(0,e.getAuthHeaders)().then(t=>fetch(e.url,Object.assign({},t))).then(e=>e.blob()).then(t=>{const r=window.URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=e.fileName,document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(r)}).catch(e=>{throw new Error("Error downloading file. "+e.message)})},children:(0,s.jsx)(g,{name:"download"})}):(0,s.jsx)(m(),{component:"a",href:e.url,download:e.fileName,children:(0,s.jsx)(g,{name:"download"})})})}const U=function(e){return(0,s.jsxs)(l(),{className:"rustic-multipart",children:[(e.title||e.description)&&(0,s.jsxs)("div",{children:[e.title&&(0,s.jsx)(o(),{variant:"h6",children:e.title}),e.description&&(0,s.jsx)(R.default,{text:e.description})]}),e.text&&(0,s.jsx)(R.default,{text:e.text}),function(){const t=e.files.map((t,r)=>(0,s.jsx)(F,{file:t,showFullName:e.showFullName,getAuthHeaders:e.getAuthHeaders,children:t.url&&(0,s.jsx)(_,{url:t.url,fileName:t.name,getAuthHeaders:e.getAuthHeaders})},r));return(0,s.jsx)(l(),{className:"rustic-files",children:t})}()]})};return n})());
|
|
@@ -2,5 +2,5 @@ import '../../../index.css';
|
|
|
2
2
|
import './multipart.css';
|
|
3
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
|
-
export default function Multipart(props: MultipartProps): import("react
|
|
5
|
+
export default function Multipart(props: MultipartProps): import("react").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=multipart.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAOxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGjD,mKAAmK;AACnK,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,+BAoCtD"}
|
|
@@ -1 +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";
|
|
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";const t={n:e=>{const 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=>{Object.defineProperties(t,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let e={};var r,i,a,n;t.r(e),t.d(e,{ParticipantRole:()=>a,ParticipantType:()=>n,default:()=>P}),function(t){t.Running="running",t.Completed="completed",t.Error="error"}(r||(r={})),function(t){t.Append="append",t.Replace="replace"}(i||(i={})),function(t){t.Owner="owner",t.Member="member"}(a||(a={})),function(t){t.Human="human",t.Agent="agent"}(n||(n={}));const s=require("react/jsx-runtime"),c=require("@mui/material/Avatar");var o=t.n(c);const p=require("@mui/material/Button");var l=t.n(p);const u=require("@mui/material/Dialog");var m=t.n(u);const d=require("@mui/material/DialogTitle");var h=t.n(d);const x=require("@mui/material/Divider");var j=t.n(x);const y=require("@mui/material/List");var f=t.n(y);const b=require("@mui/material/ListItem");var v=t.n(b);const g=require("@mui/material/ListSubheader");var N=t.n(g);const T=require("@mui/material/Typography");var q=t.n(T);const O=require("@mui/system"),_=require("pluralize");var A=t.n(_);const w=require("react");var R;function H(t){t.name.replaceAll("_","-");let e={};return t.color&&(e={color:t.color}),(0,s.jsx)("span",{className:(t.className?t.className+" ":"")+"material-symbols-rounded",style:Object.assign({},e),children:t.name})}function M(t){const[e,r]=(0,w.useState)(!1),i=t.participants.length,n=e?t.participants:t.participants.slice(0,3),c=`${A()(t.participantType,i)} (${i})`,p=e?"Show Less":`Show All ${i}`;return 0===i?(0,s.jsx)(q(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,s.jsx)(f(),{className:"rustic-participant-list",subheader:(0,s.jsxs)(N(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,s.jsxs)(O.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,s.jsx)(q(),{variant:"subtitle2",color:"text.secondary",children:c})]}),i>3&&(0,s.jsx)(l(),{onClick:()=>r(!e),color:"primary",size:"small",startIcon:(0,s.jsx)(H,{name:"keyboard_arrow_down"}),children:p})]}),children:n.map(t=>{return(0,s.jsxs)(v(),{className:"rustic-participant-list-item",children:[(0,s.jsxs)(O.Box,{className:"rustic-participant-profile",children:[(0,s.jsx)(o(),{src:t.icon,className:"rustic-participant-avatar"}),(0,s.jsx)(q(),{variant:"subtitle2",children:t.displayName})]}),(0,s.jsx)(q(),{variant:t.participantRole===a.Owner?"subtitle2":"caption",children:(e=t.participantRole||a.Member,e.charAt(0).toUpperCase()+e.slice(1))})]},t.id);var e})})}!function(t){t[t.HOUR=0]="HOUR",t[t.MONTH_DATE=1]="MONTH_DATE"}(R||(R={}));const P=function(t){function e(t,e){return function(t){return[...t].sort((t,e)=>e.participantRole===a.Owner?1:-1)}(t.filter(t=>t.participantType===e))}const r=e(t.participants,n.Human),i=e(t.participants,n.Agent),c=`${A()("Participant",t.participants.length)} (${t.participants.length})`;return(0,s.jsxs)(m(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(h(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:c}),(0,s.jsx)(M,{participantType:"Human",participantTypeIcon:(0,s.jsx)(H,{name:"account_circle"}),participants:r}),i.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j(),{className:"rustic-participants-container-divider"}),(0,s.jsx)(M,{participantType:"Agent",participantTypeIcon:(0,s.jsx)(H,{name:"smart_toy"}),participants:i})]})]})};return e})());
|
|
@@ -11,6 +11,6 @@ export interface ParticipantsContainerProps {
|
|
|
11
11
|
/** The `ParticipantsContainer` component is responsible for displaying a list of participants within a dialog window. It organizes participants into separate lists based on their type (human or agent) and provides options to toggle between showing a subset of participants and displaying the full list. This component enhances the user experience by presenting participant information in a structured format and allowing users to view additional details as needed.
|
|
12
12
|
*
|
|
13
13
|
* Note: The component does not include the button displayed to toggle between the two views. This button is typically implemented in the parent component that uses the `ParticipantsContainer` component. */
|
|
14
|
-
declare function ParticipantsContainer(props: ParticipantsContainerProps): import("react
|
|
14
|
+
declare function ParticipantsContainer(props: ParticipantsContainerProps): import("react").JSX.Element;
|
|
15
15
|
export default ParticipantsContainer;
|
|
16
16
|
//# sourceMappingURL=participantsContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"participantsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/participantsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AACpC,OAAO,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"participantsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/participantsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AACpC,OAAO,iBAAiB,CAAA;AAkBxB,OAAO,EAAE,KAAK,WAAW,EAAoC,MAAM,UAAU,CAAA;AAE7E,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,6EAA6E;IAC7E,qBAAqB,EAAE,OAAO,CAAA;IAC9B,yDAAyD;IACzD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAwGD;;8MAE8M;AAC9M,iBAAS,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BAyE/D;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -4,6 +4,6 @@ interface ViewerControlButtonProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
isDisabled?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare function ViewerControlButton(props: ViewerControlButtonProps): import("react
|
|
7
|
+
declare function ViewerControlButton(props: ViewerControlButtonProps): import("react").JSX.Element;
|
|
8
8
|
export default ViewerControlButton;
|
|
9
9
|
//# sourceMappingURL=controlButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlButton.d.ts","sourceRoot":"","sources":["../../../../src/components/pdfViewer/controlButton/controlButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controlButton.d.ts","sourceRoot":"","sources":["../../../../src/components/pdfViewer/controlButton/controlButton.tsx"],"names":[],"mappings":"AAKA,UAAU,wBAAwB;IAChC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,CAAA;IACpE,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,+BA2B3D;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -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";
|
|
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";const e={n:t=>{const 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=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{MessageProcessStatus:()=>k,ParticipantRole:()=>q,ParticipantType:()=>S,UpdateType:()=>C,default:()=>O});const r=require("react/jsx-runtime"),n=require("@mui/material/Box");var o=e.n(n);const a=require("@mui/material/Card");var s=e.n(a);const i=require("@mui/material/TextField");var c=e.n(i);const l=require("@mui/material/Typography");var u=e.n(l);const d=require("@mui/material/useMediaQuery");var m=e.n(d);const p=require("@mui/system/Stack");var f=e.n(p);const h=require("@mui/system/useTheme");var b=e.n(h);const x=require("pdfjs-dist"),v=require("react"),g=require("@mui/material/IconButton");var j=e.n(g);const y=require("@mui/material/Tooltip");var w=e.n(y);function N(e){e.name.replaceAll("_","-");let t={};return e.color&&(t={color:e.color}),(0,r.jsx)("span",{className:(e.className?e.className+" ":"")+"material-symbols-rounded",style:Object.assign({},t),children:e.name})}const P=function(e){const 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)(j(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,r.jsx)(N,{name:n.symbol})})})})};var k,C,q,S;!function(e){e.Running="running",e.Completed="completed",e.Error="error"}(k||(k={})),function(e){e.Append="append",e.Replace="replace"}(C||(C={})),function(e){e.Owner="owner",e.Member="member"}(q||(q={})),function(e){e.Human="human",e.Agent="agent"}(S||(S={}));const O=function(e){const t=(0,v.useRef)(null),[n,a]=(0,v.useState)(1),[i,l]=(0,v.useState)(1),[d,p]=(0,v.useState)(1),[h,g]=(0,v.useState)(!1),[j,y]=(0,v.useState)(),w=b()(),N=m()(w.breakpoints.down("sm")),k=m()(w.breakpoints.between("sm","md"));if(C=e.url,!/\/[^/]+\.pdf$/.test(C))return(0,r.jsx)(s(),{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 C;const[q,S]=(0,v.useState)(function(){return N?.5:k?1:1.5});function O(r){x.getDocument({url:e.url,httpHeaders:r}).promise.then(e=>{l(e.numPages),function(e){e.getPage(n).then(e=>{const r=e.getViewport({scale:q}),n=t.current;if(!n)return;const o=n.getContext("2d");if(!o)return;const a=window.devicePixelRatio||1;n.style.width=`${r.width}px`,n.style.height=`${r.height}px`,n.width=r.width*a,n.height=r.height*a;const s={canvas:n,canvasContext:o,viewport:r,transform:[a,0,0,a,0,0]};j&&j.cancel();const i=e.render(s);y(i),i.promise.then(()=>{y(void 0)}).catch(e=>{console.error(e)})})}(e)}).catch(()=>{g(!0)})}return(0,v.useEffect)(()=>{x.GlobalWorkerOptions.workerSrc||(x.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${x.version}/pdf.worker.mjs`),e.getAuthHeaders?e.getAuthHeaders().then(e=>O(e.headers)).catch(()=>g(!0)):O()},[e.url,n,q]),h?(0,r.jsx)(s(),{variant:"outlined",className:"rustic-pdf-error",children:(0,r.jsx)(u(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,r.jsxs)(s(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,r.jsxs)(o(),{className:"rustic-pdf-viewer-header",children:[(0,r.jsx)(P,{action:"zoomOut",onClick:function(){S(e=>Math.max(e-.2,.2))}}),(0,r.jsx)(P,{action:"zoomIn",onClick:function(){S(e=>e+.2)}})]}),(0,r.jsx)(o(),{className:"rustic-pdf-viewer-body",children:(0,r.jsx)(o(),{className:"rustic-pdf-viewer-body-inner",children:(0,r.jsx)("canvas",{ref:t})})}),(0,r.jsxs)(f(),{direction:"row",sx:{justifyContent:"center",alignItems:"center",gap:1},children:[(0,r.jsx)(P,{action:"previousPage",onClick:function(){n>1&&(a(n-1),p(n-1))},isDisabled:1===n}),(0,r.jsx)(u(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,r.jsx)(c(),{type:"number",value:d,onChange:function(e){const t=parseInt(e.target.value);p(t),!isNaN(t)&&t>=1&&t<=i&&a(t)},size:"small",className:"rustic-pdf-page-input"}),(0,r.jsxs)(u(),{variant:"body1",className:"rustic-page-indicator",children:["of ",i]}),(0,r.jsx)(P,{action:"nextPage",onClick:function(){n<i&&(a(n+1),p(n+1))},isDisabled:n===i})]})]})};return t})());
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './pdfViewer.css';
|
|
2
|
+
import type React from 'react';
|
|
2
3
|
import type { PDFViewerProps } from '../types';
|
|
3
4
|
export declare function setPdfWorkerSrc(workerSrc: string): void;
|
|
4
5
|
/** The PDFViewer component, built using [PDF.js](https://mozilla.github.io/pdf.js/), to display PDF documents.
|
|
@@ -17,6 +18,6 @@ export declare function setPdfWorkerSrc(workerSrc: string): void;
|
|
|
17
18
|
* npm i pdfjs-dist
|
|
18
19
|
* ```
|
|
19
20
|
*/
|
|
20
|
-
declare function PDFViewer(props: PDFViewerProps):
|
|
21
|
+
declare function PDFViewer(props: PDFViewerProps): React.JSX.Element;
|
|
21
22
|
export default PDFViewer;
|
|
22
23
|
//# sourceMappingURL=pdfViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdfViewer.d.ts","sourceRoot":"","sources":["../../../src/components/pdfViewer/pdfViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"pdfViewer.d.ts","sourceRoot":"","sources":["../../../src/components/pdfViewer/pdfViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAWxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,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,qBAwMvC;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,
|
|
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";const e={n:t=>{const o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{default:()=>p});const o=require("react/jsx-runtime"),r=require("@mui/material/Box");var n=e.n(r);const s=require("@mui/material/Chip");var i=e.n(s);const a=require("@mui/system/useTheme");var l=e.n(a);const u=require("uuid");var c;function d(e,t,o){const r=e.id,n=[];if(t&&(null==t?void 0:t.trim().length)&&n.push({type:"text",text:t}),o&&o.length>0)for(let e=0;e<(null==o?void 0:o.length);e++)n.push({type:"file_url",file_url:{url:o[e].url,name:o[e].name}});return{messages:[{content:n,role:"user",name:r}]}}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(c||(c={}));const p=function(e){const t=l()(),r=e.prompts.map((r,n)=>(0,o.jsx)(i(),{onClick:()=>function(t){const o=(new Date).toISOString(),r={id:(0,u.v4)(),timestamp:o,sender:e.sender,conversationId:e.conversationId,format:"chatCompletionRequest",data:d(e.sender,t.toString())};e.ws.send(r)}(r),color:"secondary",size:"small",className:"rustic-prompt",sx:Object.assign(Object.assign({backgroundColor:t.palette.background.paper},"inConversation"===e.position&&{border:`1px solid ${t.palette.divider}`}),{"&:hover":{color:t.palette.text.primary,backgroundColor:t.palette.primary.hover}}),label:r},n));return(0,o.jsx)(n(),{className:e.className,children:r})};return t})());
|
|
@@ -8,5 +8,5 @@ The `position` property determines where the prompts are displayed and can be on
|
|
|
8
8
|
- `inConversation`: Prompts are displayed at the top, integrated with other chat messages.
|
|
9
9
|
- `hoverOverInput` (default): Prompts are displayed above the input field at the bottom of the chat interface. Note that prompts with this position will only appear if they are part of the last message in the message list.
|
|
10
10
|
*/
|
|
11
|
-
export default function Prompts(props: PromptsProps): import("react
|
|
11
|
+
export default function Prompts(props: PromptsProps): import("react").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/components/prompts/prompts.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;
|
|
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,+BA8ClD"}
|
|
@@ -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";
|
|
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";const e={n:t=>{const 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=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{MessageProcessStatus:()=>j,ParticipantRole:()=>q,ParticipantType:()=>S,UpdateType:()=>T,default:()=>M});const r=require("react/jsx-runtime"),n=require("@mui/material"),a=require("@mui/material/Box");var i=e.n(a);const o=require("@mui/material/Chip");var s=e.n(o);const u=require("@mui/material/Stack");var c=e.n(u);const d=require("@mui/material/Typography");var l=e.n(d);const p=require("react"),m=require("uuid"),f=require("@mui/material/Alert");var x=e.n(f);const y=require("@mui/material/styles"),g=require("dompurify");var h=e.n(g);const v=require("marked");var b,j,T,q,S;function w(e,t,r){var n;return e&&e.length>0&&null!==(n=e[e.length-1][t])&&void 0!==n?n:r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(b||(b={})),function(e){e.Running="running",e.Completed="completed",e.Error="error"}(j||(j={})),function(e){e.Append="append",e.Replace="replace"}(T||(T={})),function(e){e.Owner="owner",e.Member="member"}(q||(q={})),function(e){e.Human="human",e.Agent="agent"}(S||(S={}));const D=e=>{const t=(0,y.useTheme)(),[n,a]=(0,p.useState)(e.text),[i,o]=(0,p.useState)(""),s=w(e.updatedData,"title",e.title),u=w(e.updatedData,"description",e.description);function c(e){return"string"!=typeof e?(o("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}function d(e){const t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=v.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return h().sanitize(r)}function m(e){return(0,r.jsx)(l(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:d(e)},sx:{"& table, & th, & td":{border:`1px solid ${t.palette.divider}`}}})}return(0,p.useEffect)(()=>{if(e.updatedData&&e.updatedData.length>0){let t=e.text;const r=e.updatedData.at(-1);if(e.updatedData.length>1&&e.updateType===T.Replace)t=c(null==r?void 0:r.text);else for(const r of e.updatedData){const n=e.updateType||T.Append,a=c(r.text);n===T.Append?t+=a:n===T.Replace&&(t=a)}a(t)}},[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)(l(),{variant:"h6",children:s}),u&&m(u),m(n),i&&(0,r.jsx)(x(),{severity:"error",children:i})]})},M=function(e){const[t,a]=(0,p.useState)(e.data||""),o=(0,n.useTheme)(),u=(0,n.useMediaQuery)(o.breakpoints.down("md"))?"column":"row",d=e.options.map((n,i)=>(0,r.jsx)(s(),{onClick:()=>function(t){var r;a(t);const n=(new Date).toISOString(),i={id:(0,m.v4)(),timestamp:n,sender:e.sender,conversationId:e.conversationId,format:"questionResponse",data:{data:t,inReplyTo:e.messageId}};null===(r=e.ws)||void 0===r||r.send(i)}(n),color:"secondary",size:"small",sx:t===n?{"&.Mui-disabled":{backgroundColor:"secondary.light",color:"text.primary"}}:{},className:"rustic-option",disabled:!!t||!e.ws,"aria-disabled":!!t||!e.ws,label:n},i));return(0,r.jsxs)(i(),{className:"rustic-question",children:[(e.title||e.description)&&(0,r.jsxs)(i(),{className:"rustic-question-text",children:[e.title&&(0,r.jsx)(l(),{variant:"h6",className:"rustic-title",children:e.title}),e.description&&(0,r.jsx)(D,{text:e.description})]}),(0,r.jsx)(c(),{direction:u,className:"rustic-options-container",children:d})]})};return t})());
|
|
@@ -9,5 +9,5 @@ import type { QuestionProps } from '../types';
|
|
|
9
9
|
* npm i uuid
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
|
-
export default function Question(props: QuestionProps): import("react
|
|
12
|
+
export default function Question(props: QuestionProps): import("react").JSX.Element;
|
|
13
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;AAWvB,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,UAAU,CAAA;AAEtD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/components/question/question.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAA;AAWvB,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,UAAU,CAAA;AAEtD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAoEpD"}
|
|
@@ -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";
|
|
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";const e={n:t=>{const a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{MessageProcessStatus:()=>H,ParticipantRole:()=>E,ParticipantType:()=>F,UpdateType:()=>K,default:()=>L});const a=require("react/jsx-runtime"),r=require("@mui/material"),n=require("@mui/material/Stack");var i=e.n(n);const s=require("@mui/material/Table");var o=e.n(s);const c=require("@mui/material/TableBody");var l=e.n(c);const u=require("@mui/material/TableCell");var d=e.n(u);const p=require("@mui/material/TableContainer");var m=e.n(p);const b=require("@mui/material/TableHead");var f=e.n(b);const g=require("@mui/material/TablePagination");var h=e.n(g);const y=require("@mui/material/TableRow");var x=e.n(y);const v=require("@mui/material/TableSortLabel");var j=e.n(v);const T=require("@mui/material/Tooltip");var q=e.n(T);const S=require("@mui/material/Typography");var D=e.n(S);const O=require("react");var w;function P(e,t,a){var r;return e&&e.length>0&&null!==(r=e[e.length-1][t])&&void 0!==r?r:a}function k(e){e.name.replaceAll("_","-");let t={};return e.color&&(t={color:e.color}),(0,a.jsx)("span",{className:(e.className?e.className+" ":"")+"material-symbols-rounded",style:Object.assign({},t),children:e.name})}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(w||(w={}));const A=require("@mui/material/Alert");var N=e.n(A);const R=require("@mui/material/styles"),M=require("dompurify");var _=e.n(M);const C=require("marked");var H,K,E,F;!function(e){e.Running="running",e.Completed="completed",e.Error="error"}(H||(H={})),function(e){e.Append="append",e.Replace="replace"}(K||(K={})),function(e){e.Owner="owner",e.Member="member"}(E||(E={})),function(e){e.Human="human",e.Agent="agent"}(F||(F={}));const $=e=>{const t=(0,R.useTheme)(),[r,n]=(0,O.useState)(e.text),[i,s]=(0,O.useState)(""),o=P(e.updatedData,"title",e.title),c=P(e.updatedData,"description",e.description);function l(e){return"string"!=typeof e?(s("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}function u(e){const t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),a=C.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return _().sanitize(a)}function d(e){return(0,a.jsx)(D(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:u(e)},sx:{"& table, & th, & td":{border:`1px solid ${t.palette.divider}`}}})}return(0,O.useEffect)(()=>{if(e.updatedData&&e.updatedData.length>0){let t=e.text;const a=e.updatedData.at(-1);if(e.updatedData.length>1&&e.updateType===K.Replace)t=l(null==a?void 0:a.text);else for(const a of e.updatedData){const r=e.updateType||K.Append,n=l(a.text);r===K.Append?t+=n:r===K.Replace&&(t=n)}n(t)}},[e.text,e.updatedData]),(0,a.jsxs)(a.Fragment,{children:[o&&(0,a.jsx)(D(),{variant:"h6",children:o}),c&&d(c),d(r),i&&(0,a.jsx)(N(),{severity:"error",children:i})]})};var I;function U(){return(0,a.jsx)(k,{name:"expand_all"})}!function(e){e.Ascending="asc",e.Descending="desc"}(I||(I={}));const L=function(e){if(0===e.data.length)return(0,a.jsx)(D(),{variant:"body2",children:"No data available"});const t=e.data.length>10,[n,s]=(0,O.useState)({}),[c,u]=(0,O.useState)(t?10:-1),[p,b]=(0,O.useState)(0),g=(0,r.useTheme)(),y=Array.from(new Set(e.data.flatMap(e=>Object.keys(e)))),v=e.headers||y.map(e=>({dataKey:e})),T=function(e){const t=Object.keys(n)[0],a=n[t];return t&&a?e.slice().sort((e,t)=>{const a=Object.keys(n)[0],r=n[a];return e[a]<t[a]?r===I.Descending?1:-1:e[a]>t[a]?r===I.Descending?-1:1:0}):e}(e.data),S=T.slice(p*c,p*c+c),w=c>0?S:T;function P(e){if(!n[e])return U}function k(e){const t=n[e];return t?Object.keys(I)[Object.values(I).indexOf(t)]:"Sort"}return(0,a.jsxs)(i(),{className:"rustic-table",spacing:1,children:[e.title&&(0,a.jsx)(D(),{variant:"h6",className:"rustic-table-title",children:e.title}),e.description&&(0,a.jsx)($,{text:e.description}),(0,a.jsx)(m(),{className:"rustic-table-container",children:(0,a.jsxs)(o(),{"aria-label":e.title||"a table of data",size:"small",stickyHeader:!0,children:[v.length>0&&(0,a.jsx)(f(),{children:(0,a.jsx)(x(),{children:v.map((e,t)=>{return(0,a.jsx)(d(),{sortDirection:n[e.dataKey]||!1,children:(0,a.jsx)(q(),{title:k(e.dataKey),children:(0,a.jsx)(j(),{active:!0,direction:n[e.dataKey],onClick:()=>{return t=e.dataKey,void s(e=>{let a;switch(e[t]){case I.Ascending:a={[t]:I.Descending};break;case I.Descending:a={};break;default:a={[t]:I.Ascending}}return a});var t},className:"rustic-table-header",IconComponent:P(e.dataKey),children:e.label||(r=e.dataKey,r.charAt(0).toUpperCase()+r.slice(1))})})},`header-${t}`);var r})})}),(0,a.jsx)(l(),{children:w.map((e,t)=>(0,a.jsx)(x(),{children:v.map((r,n)=>(0,a.jsx)(d(),{children:e[r.dataKey]},`cell-${t}-${n}`))},`row-${t}`))})]})}),t&&(0,a.jsx)(h(),{className:"rustic-table-pagination",component:"div",count:e.data.length,rowsPerPage:c,labelRowsPerPage:"Rows:",page:p,onPageChange:(e,t)=>b(t),onRowsPerPageChange:function(e){u(+e.target.value),b(0)},sx:{"& .MuiTablePagination-selectLabel":{color:g.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 t})());
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './table.css';
|
|
2
|
+
import type React from 'react';
|
|
2
3
|
import type { TableData } from '../types';
|
|
3
4
|
/** The `Table` component provides a simple and customizable table display for presenting structured data. It supports rendering data rows with associated headers and allows for easy customization of table title, description, and column headers. Pagination is enabled when the number of rows exceeds 10. */
|
|
4
|
-
export default function Table(props: TableData):
|
|
5
|
+
export default function Table(props: TableData): React.JSX.Element;
|
|
5
6
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAcpB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,UAAU,CAAA;AAetD,kTAAkT;AAClT,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,SAAS,qBAqL7C"}
|
|
@@ -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";
|
|
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";const e={n:t=>{const 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=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{MessageProcessStatus:()=>d,ParticipantRole:()=>l,ParticipantType:()=>f,Text:()=>m,UpdateType:()=>p,default:()=>y});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 s=require("dompurify");var u=e.n(s);const c=require("react");var d,p,l,f;!function(e){e.Running="running",e.Completed="completed",e.Error="error"}(d||(d={})),function(e){e.Append="append",e.Replace="replace"}(p||(p={})),function(e){e.Owner="owner",e.Member="member"}(l||(l={})),function(e){e.Human="human",e.Agent="agent"}(f||(f={}));const m=e=>{const[t,n]=(0,c.useState)(u().sanitize(e.text)),[o,s]=(0,c.useState)("");function d(e){return"string"!=typeof e?(s("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}return(0,c.useEffect)(()=>{if(e.updatedData&&e.updatedData.length>0){let t=e.text;const r=e.updatedData.at(-1);if(e.updatedData.length>1&&e.updateType===p.Replace)t=d(null==r?void 0:r.text);else for(const r of e.updatedData)t+=d(r.text);n(u().sanitize(t))}},[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[e.title&&(0,r.jsx)(i(),{variant:"h6",children:e.title}),e.description&&(0,r.jsx)(i(),{children:e.description}),(0,r.jsx)(i(),{variant:"body1",className:"rustic-text",children:t}),o&&(0,r.jsx)(a(),{severity:"error",children:o})]})},y=m;return t})());
|
|
@@ -12,6 +12,6 @@ import { type TextData } from '../types';
|
|
|
12
12
|
* ```typescript
|
|
13
13
|
* npm i dompurify
|
|
14
14
|
* ``` */
|
|
15
|
-
declare const Text: (props: TextData) => import("react
|
|
15
|
+
declare const Text: (props: TextData) => import("react").JSX.Element;
|
|
16
16
|
export default Text;
|
|
17
17
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AAOnB,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,UAAU,CAAA;AAEpD;;;;;;;;;;;SAWS;AACT,QAAA,MAAM,IAAI,GAAI,OAAO,QAAQ,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AAOnB,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,UAAU,CAAA;AAEpD;;;;;;;;;;;SAWS;AACT,QAAA,MAAM,IAAI,GAAI,OAAO,QAAQ,gCA4C5B,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -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";
|
|
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";const e={n:t=>{const o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{default:()=>u});const o=require("react/jsx-runtime"),r=require("@mui/material/Typography");var n,a=e.n(r);function i(e){const t=new Date(e),o=navigator.language,r={month:"short",day:"numeric"},n=new Date,a=t.getFullYear()!==n.getFullYear(),i=a?" at ":", ";return a&&(r.year="numeric"),t.toLocaleDateString(o,r)+i+t.toLocaleTimeString(o,{hour:"numeric",minute:"2-digit",hour12:!0})}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(n||(n={}));const u=e=>(0,o.jsx)(a(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:i(e.timestamp)});return t})());
|
|
@@ -3,6 +3,6 @@ export interface TimestampProps {
|
|
|
3
3
|
timestamp: string;
|
|
4
4
|
}
|
|
5
5
|
/** The `Timestamp` component is responsible for displaying a timestamp in a visually consistent and formatted manner. It takes an ISO 8601 formatted timestamp as input and utilizes helper functions to format and render the timestamp. */
|
|
6
|
-
declare const Timestamp: (props: TimestampProps) => import("react
|
|
6
|
+
declare const Timestamp: (props: TimestampProps) => import("react").JSX.Element;
|
|
7
7
|
export default Timestamp;
|
|
8
8
|
//# sourceMappingURL=timestamp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../src/components/timestamp/timestamp.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../src/components/timestamp/timestamp.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,6OAA6O;AAC7O,QAAA,MAAM,SAAS,GAAI,OAAO,cAAc,gCAUvC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,mBAAmB,oBAAoB,CAAA;AACvC,eAAe,UAAU,CAAA"}
|
|
@@ -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";
|
|
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";const e={n:t=>{const 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=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{default:()=>O});const r=require("react/jsx-runtime"),n=require("@mui/material/Stack");var a=e.n(n);const i=require("@mui/material/Typography");var o=e.n(i);const u=require("@mui/system/useTheme");var s=e.n(u);const c=require("mermaid");var d=e.n(c);const l=require("react"),m=require("uuid"),p=require("@mui/material/Alert");var f=e.n(p);const g=require("@mui/material/styles"),h=require("dompurify");var y=e.n(h);const v=require("marked");var x,b,j,T,q;function S(e,t,r){var n;return e&&e.length>0&&null!==(n=e[e.length-1][t])&&void 0!==n?n:r}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(x||(x={})),function(e){e.Running="running",e.Completed="completed",e.Error="error"}(b||(b={})),function(e){e.Append="append",e.Replace="replace"}(j||(j={})),function(e){e.Owner="owner",e.Member="member"}(T||(T={})),function(e){e.Human="human",e.Agent="agent"}(q||(q={}));const D=e=>{const t=(0,g.useTheme)(),[n,a]=(0,l.useState)(e.text),[i,u]=(0,l.useState)(""),s=S(e.updatedData,"title",e.title),c=S(e.updatedData,"description",e.description);function d(e){return"string"!=typeof e?(u("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}function m(e){const t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=v.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return y().sanitize(r)}function p(e){return(0,r.jsx)(o(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:m(e)},sx:{"& table, & th, & td":{border:`1px solid ${t.palette.divider}`}}})}return(0,l.useEffect)(()=>{if(e.updatedData&&e.updatedData.length>0){let t=e.text;const r=e.updatedData.at(-1);if(e.updatedData.length>1&&e.updateType===j.Replace)t=d(null==r?void 0:r.text);else for(const r of e.updatedData){const n=e.updateType||j.Append,a=d(r.text);n===j.Append?t+=a:n===j.Replace&&(t=a)}a(t)}},[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)(o(),{variant:"h6",children:s}),c&&p(c),p(n),i&&(0,r.jsx)(f(),{severity:"error",children:i})]})},O=function(e){const t=(0,l.useRef)(null),[n,i]=(0,l.useState)(),u=s()(),c=(0,m.v4)();return(0,l.useEffect)(()=>{const r="dark"===u.palette.mode?"dark":"neutral",n=u.typography.fontFamily;t.current&&(d().initialize(Object.assign({theme:r,themeVariables:{fontFamily:n},layout:"dagre",look:"classic"},e.config)),d().render(`mermaid-svg-${c}`,e.diagram,t.current).then(e=>{t.current&&(t.current.innerHTML=e.svg),i("")}).catch(()=>{var e;null===(e=t.current)||void 0===e||e.replaceChildren(),i("Failed to render the diagram.")}))}),(0,r.jsxs)(a(),{className:"rustic-mermaid-container",children:[e.title&&(0,r.jsx)(o(),{variant:"h6",children:e.title}),e.description&&(0,r.jsx)(D,{text:e.description}),(0,r.jsx)("div",{className:"rustic-mermaid",ref:t}),n&&(0,r.jsx)(o(),{variant:"body2",children:n})]})};return t})());
|
|
@@ -8,6 +8,6 @@ import type { MermaidData } from './mermaidViz.types';
|
|
|
8
8
|
* npm i mermaid uuid
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
declare function MermaidViz(props: MermaidData): import("react
|
|
11
|
+
declare function MermaidViz(props: MermaidData): import("react").JSX.Element;
|
|
12
12
|
export default MermaidViz;
|
|
13
13
|
//# sourceMappingURL=mermaidViz.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaidViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/mermaidViz.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAWzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;;GAOG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,WAAW
|
|
1
|
+
{"version":3,"file":"mermaidViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/mermaidViz.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAWzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;;GAOG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,WAAW,+BA4CrC;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -14,6 +14,12 @@ perspective-viewer-datagrid-toolbar {
|
|
|
14
14
|
display: none;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/* Perspective 5 shows each panel's title in a tab; the component renders the
|
|
18
|
+
title itself, and earlier versions kept it hidden in the status bar. */
|
|
19
|
+
.rustic-perspective-viz perspective-viewer-tab {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
.rustic-markdown p:first-child {
|
|
18
24
|
margin-block-start: 0;
|
|
19
25
|
}
|
|
@@ -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";
|
|
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";const e={n:t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})}};let t={};e.r(t),e.d(t,{MessageProcessStatus:()=>f,ParticipantRole:()=>b,ParticipantType:()=>h,UpdateType:()=>g,default:()=>I,globalPerspectiveWorker:()=>D,initPerspective:()=>R});const n=require("react/jsx-runtime"),r=(require("@perspective-dev/viewer-datagrid"),require("@perspective-dev/viewer-charts"),require("@perspective-dev/viewer/dist/css/pro.css"),require("@perspective-dev/viewer/dist/css/pro-dark.css"),require("@mui/material/styles")),o=require("@mui/material/Typography");var a=e.n(o);const i=require("@mui/system/Stack");var s=e.n(i);const c=require("react"),u=require("@mui/material/Alert");var d=e.n(u);const l=require("dompurify");var p=e.n(l);const m=require("marked");var v,f,g,b,h;function y(e,t,n){var r;return e&&e.length>0&&null!==(r=e[e.length-1][t])&&void 0!==r?r:n}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(v||(v={})),function(e){e.Running="running",e.Completed="completed",e.Error="error"}(f||(f={})),function(e){e.Append="append",e.Replace="replace"}(g||(g={})),function(e){e.Owner="owner",e.Member="member"}(b||(b={})),function(e){e.Human="human",e.Agent="agent"}(h||(h={}));const _=e=>{const t=(0,r.useTheme)(),[o,i]=(0,c.useState)(e.text),[s,u]=(0,c.useState)(""),l=y(e.updatedData,"title",e.title),v=y(e.updatedData,"description",e.description);function f(e){return"string"!=typeof e?(u("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}function b(e){const t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),n=m.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return p().sanitize(n)}function h(e){return(0,n.jsx)(a(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:b(e)},sx:{"& table, & th, & td":{border:`1px solid ${t.palette.divider}`}}})}return(0,c.useEffect)(()=>{if(e.updatedData&&e.updatedData.length>0){let t=e.text;const n=e.updatedData.at(-1);if(e.updatedData.length>1&&e.updateType===g.Replace)t=f(null==n?void 0:n.text);else for(const n of e.updatedData){const r=e.updateType||g.Append,o=f(n.text);r===g.Append?t+=o:r===g.Replace&&(t=o)}i(t)}},[e.text,e.updatedData]),(0,n.jsxs)(n.Fragment,{children:[l&&(0,n.jsx)(a(),{variant:"h6",children:l}),v&&h(v),h(o),s&&(0,n.jsx)(d(),{severity:"error",children:s})]})},x=require("@perspective-dev/client");var w=e.n(x);const S=require("@perspective-dev/server/dist/wasm/perspective-server.wasm");var j=e.n(S);const k=require("@perspective-dev/viewer");var T=e.n(k);const E=require("@perspective-dev/viewer/dist/wasm/perspective-viewer.wasm");var q=e.n(E);let O,D;function R(){return O||(w().init_server(()=>fetch(j())),T().init_client(fetch(q())),O=w().worker().then(e=>{D=e}),O)}let P=0;function F(e){return e?e.reduce((e,t)=>{const{dataKey:n,label:r}=t;return e[n]=r||n,e},{}):{}}const I=function(e){if(0===e.data.length)return(0,n.jsx)(a(),{variant:"body2",children:"No data available."});const t=(0,c.useRef)(!1),o=(0,c.useRef)(null),i=(0,c.useRef)(null),u=(0,r.useTheme)(),[d,l]=(0,c.useState)(!1),[p,m]=(0,c.useState)(),v=u.palette.mode,f="dark"===v?"Pro Dark":"Pro Light",g=F(e.headers),b=`\n /* General Button Styles */\n button, .button:hover, #editor-container, .editable, #settings_button {\n border-radius: 16px !important;\n color: ${u.palette.text.primary} !important;\n /* TODO: add background color after updating the theme */\n }\n \n #settings_button {\n border: 1px solid ${u.palette.primary.light} !important;\n }\n \n /* Hide border for aggregate Selector */\n .aggregate-selector:hover {\n border: none !important;\n }\n \n /* Input and Select Elements */\n input, select, .noselect, #add-expression, .dropdown-width-container, \n .pivot-column-border, .pivot-column, .column-selector-column-border {\n border-radius: 8px !important;\n }\n \n /* Change background color */\n #settings_panel, #column_settings_sidebar {\n background: ${"dark"===v?"dark":"white"} !important;\n background-image: none !important;\n }\n \n /* Expression Edit Button */\n .expression-edit-button {\n display: none;\n }\n \n /* Add padding to expression input */\n #editor-container, .editable {\n padding: 8px !important;\n }\n \n /* Change Button Font Size */\n .button select, .button {\n font-size: 12px !important;\n }\n \n /* Button and Icon Colors */\n #status_bar .hover-target:hover .button>span {\n display:none !important;\n }\n \n #status_bar .hover-target.modal-target .button>span {\n display:none !important;\n }\n \n .button select:hover, .psp-expression-editor__button:hover, \n .sidebar_close_button_inner:hover {\n background-color: ${u.palette.primary.light} !important;\n }\n \n /* Hide unused buttons */\n #debug_open_button.sidebar_close_button, .reset-default-style-disabled, \n .expression-edit-button, #theme, #status, #status_bar .input-sizer {\n display: none !important;\n }\n \n #status_bar .hover-target:hover, #status_bar .hover-target.modal-target {\n height: fit-content !important;\n }\n\n /* Enable Scrolling */\n #plugin_selector_container.open, #status_bar, #menu-bar, #app_panel {\n overflow: auto !important;\n }\n\n #settings_button:hover {\n color: ${u.palette.primary.contrastText} !important;\n background-color: ${u.palette.primary.main} !important;\n }\n `;function h(e){return e.map(e=>[g[e[0]]||e[0],e[1],e[e.length-1]])}(0,c.useEffect)(()=>{let e=!0;return R().then(()=>{e&&m(D)}),()=>{e=!1}},[]);const y=e.config&&function(e){const{groupBy:t,splitBy:n,aggregates:r,sort:o,filter:a,columns:i}=e,s=null==o?void 0:o.map(e=>[g[e[0]]||e[0],e[1]]),c=r&&Object.fromEntries(Object.entries(r).map(([e,t])=>[g[e]||e,t]));return{group_by:null==t?void 0:t.map(e=>g[e]||e),split_by:null==n?void 0:n.map(e=>g[e]||e),aggregates:c,sort:s,filter:a&&h(a),columns:null==i?void 0:i.map(e=>g[e]||e)}}(e.config);return(0,c.useEffect)(()=>{let n=!0;t.current=!1;const r=o.current;if(p){P+=1;const o=`rustic-perspective-${P}`;p.table(function(e,t){const n=F(t);return e.map(e=>{const t={};for(const[r,o]of Object.entries(e))t[n[r]||r]=o;return t})}(e.data,e.headers),{name:o}).then(()=>{var a,s,c;if(r){if(r.shadowRoot){const e=new CSSStyleSheet;e.replaceSync(b),r.shadowRoot.adoptedStyleSheets.push(e)}const u={date_format:{dateStyle:(null===(a=e.config)||void 0===a?void 0:a.dateStyle)||"medium"}},d={};null===(c=null===(s=e.config)||void 0===s?void 0:s.dateColumns)||void 0===c||c.forEach(e=>{d[e]=u}),r.load(p).then(()=>{if(n)return t.current=!0,r.restore(Object.assign(Object.assign({table:o},y),{theme:f,title:e.title,settings:!1,columns_config:d})).then(()=>{var t;if(!n)return;const o=null===(t=e.config)||void 0===t?void 0:t.expansionDepth;if("number"==typeof o){const e=()=>{n?r.getView().then(e=>{n&&e&&(i.current&&(clearInterval(i.current),i.current=null),e.set_depth(o).then(()=>{r.resize()}))}).catch(()=>{}):i.current&&clearInterval(i.current)};e(),i.current=setInterval(e,1e3)}})}).catch(()=>{l(!0)})}})}return()=>{n=!1,i.current&&(clearInterval(i.current),i.current=null),t.current&&r&&"function"==typeof r.eject&&r.eject().then(()=>t.current=!1).catch(()=>{}),t.current=!1}},[p,e.data,f,e.config]),(0,c.useEffect)(()=>{const e=e=>{var t;"No `Table` attached"===(null===(t=e.reason)||void 0===t?void 0:t.message)&&e.preventDefault()};return window.addEventListener("unhandledrejection",e),()=>{window.removeEventListener("unhandledrejection",e);const n=o.current;t.current&&n&&"function"==typeof n.delete&&n.delete().catch(()=>{})}},[]),d?(0,n.jsx)(a(),{variant:"body2",children:"Failed to create table from data."}):(0,n.jsxs)(s(),{direction:"column",className:"rustic-perspective-viz",children:[e.title&&(0,n.jsx)(a(),{variant:"h6",children:e.title}),e.description&&(0,n.jsx)(_,{text:e.description}),(0,n.jsx)("perspective-viewer",{ref:o,style:{fontFamily:u.typography.fontFamily}})]})};return t})());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './perspectiveViz.css';
|
|
2
2
|
import '@perspective-dev/viewer-datagrid';
|
|
3
|
-
import '@perspective-dev/viewer-
|
|
3
|
+
import '@perspective-dev/viewer-charts';
|
|
4
4
|
import '@perspective-dev/viewer/dist/css/pro.css';
|
|
5
5
|
import '@perspective-dev/viewer/dist/css/pro-dark.css';
|
|
6
6
|
import type { TableData, TableHeader } from '../../types';
|
|
@@ -10,7 +10,7 @@ export declare function transformTableData(originalData: Array<Record<string, st
|
|
|
10
10
|
* Note: [Perspective](https://perspective-dev.github.io/) libraries are not bundled, so they must be included in the application's build process:
|
|
11
11
|
*
|
|
12
12
|
* ```node
|
|
13
|
-
* npm i @perspective-dev/server @perspective-dev/client @perspective-dev/viewer @perspective-dev/viewer-
|
|
13
|
+
* npm i @perspective-dev/server @perspective-dev/client @perspective-dev/viewer @perspective-dev/viewer-charts @perspective-dev/viewer-datagrid
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* * **Important**: You must call `initPerspective()` once at the root level of your application before using this component. Additionally, ensure your Webpack configuration supports WebAssembly (WASM) files by adding the following settings:
|
|
@@ -36,6 +36,6 @@ export declare function transformTableData(originalData: Array<Record<string, st
|
|
|
36
36
|
* }
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
|
-
declare function PerspectiveViz(props: TableData): import("react
|
|
39
|
+
declare function PerspectiveViz(props: TableData): import("react").JSX.Element;
|
|
40
40
|
export default PerspectiveViz;
|
|
41
41
|
//# sourceMappingURL=perspectiveViz.d.ts.map
|