@rustic-ai/ui-components 0.0.27 → 0.0.29
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/dynamicForm/index.js +1 -1
- package/dist/components/icon/icon.d.ts +2 -2
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icon/index.d.ts.map +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/input/emoji/index.js +1 -1
- package/dist/components/input/multimodal/multimodalInput/index.css +22 -0
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -1
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
- package/dist/components/input/multimodal/uploader/index.css +22 -0
- package/dist/components/input/multimodal/uploader/index.js +1 -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/map/index.js +1 -1
- package/dist/components/media/audio/index.js +1 -1
- package/dist/components/media/video/index.js +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/messageCanvas/actions/copy/index.js +1 -1
- package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -1
- package/dist/components/messageSpace/index.js +1 -1
- package/dist/components/multipart/index.js +1 -1
- package/dist/components/participantsContainer/index.js +1 -1
- package/dist/components/pdfViewer/index.js +1 -1
- package/dist/components/promptBuilder/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/types.d.ts +10 -0
- package/dist/components/types.d.ts.map +1 -1
- package/dist/components/visualization/chart/index.js +1 -1
- 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/vegaLiteViz/index.js +1 -1
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts +2 -2
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts.map +1 -1
- package/dist/components/weather/index.js +1 -1
- package/dist/index.css +22 -22
- package/dist/index.js +1 -1
- package/package.json +23 -23
|
@@ -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={445:(e,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={445:(e,t,r)=>{r.d(t,{default:()=>l});var a=r(732),o=r(909),n=r.n(o),s=r(603),i=r.n(s);r(15);const l=function(e){return(0,a.jsx)(i(),{title:e.label,children:(0,a.jsx)(n(),{color:"inherit","aria-label":e.label,onClick:function(t){t.stopPropagation(),t.preventDefault(),e.onClick(e.message)},className:"rustic-message-actions",children:e.icon})})}},909:e=>{e.exports=require("@mui/material/IconButton")},603:e=>{e.exports=require("@mui/material/Tooltip")},15:e=>{e.exports=require("react")},732:e=>{e.exports=require("react/jsx-runtime")}},t={};function r(a){var o=t[a];if(void 0!==o)return o.exports;var n=t[a]={exports:{}};return e[a](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 a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},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 a={};r.r(a),r.d(a,{default:()=>c});var o=r(732),n=r(15),s=function(){return s=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};function i(e){e.name.replaceAll("_","-");var t={};return e.color&&(t={color:e.color}),(0,o.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:s({},t),children:e.name})}var l=r(445);const c=function(e){var t=(0,n.useState)("Start reading aloud"),r=t[0],a=t[1],s=[e.message.data.title,e.message.data.description,e.message.data.alt,e.message.data.text,e.message.data.transcript].filter(Boolean).join(" "),c=new SpeechSynthesisUtterance(s);return(0,o.jsx)(l.default,{message:e.message,icon:(0,o.jsx)(i,{name:"text_to_speech"}),onClick:function(){window.speechSynthesis.speaking?(window.speechSynthesis.cancel(),a("Start reading aloud")):(c.onend=function(){a("Start reading aloud")},window.speechSynthesis.speak(c),a("Stop reading aloud"))},label:r})};return a})()));
|
|
@@ -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 n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>C});const n=require("react/jsx-runtime"),r=require("@mui/material/Chip");var o=e.n(r);const s=require("@mui/system/Box");var a=e.n(s);const i=require("react");var c=e.n(i);const u=require("@mui/material/Typography");var l=e.n(u),m=function(){return m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},m.apply(this,arguments)};const d=function(e){var t=e.messages[0],r=e.messages.slice(1),o=e.supportedElements[t.format];return(0,n.jsx)(n.Fragment,{children:o?c().createElement(o,m(m({sender:e.sender,ws:e.ws,messageId:t.id,conversationId:t.conversationId},t.data),r.length>0&&{updatedData:r.map((function(e){return e.data}))})):(0,n.jsxs)(l(),{variant:"body2",children:["Unsupported element format: ",t.format]})})};var f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)};function p(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:f({},t),children:e.name})}const g=require("@mui/material"),v=require("@mui/material/Card");var h=e.n(v);const y=require("@mui/material/Stack");var j,b=e.n(y);!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(j||(j={}));const w=function(e){return(0,n.jsx)(l(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(t=e.timestamp,r=new Date(t),o=navigator.language,s={month:"short",day:"numeric"},a=new Date,i=r.getFullYear()!==a.getFullYear(),c=i?" at ":", ",i&&(s.year="numeric"),r.toLocaleDateString(o,s)+c+r.toLocaleTimeString(o,{hour:"numeric",minute:"2-digit",hour12:!0}))});var t,r,o,s,a,i,c},x=(0,i.forwardRef)((function(e,t){var r=(0,g.useTheme)();return(0,n.jsxs)(b(),{id:e.message.id,className:"rustic-message-canvas",ref:t,children:[(0,n.jsxs)(b(),{direction:"row",alignItems:"center",spacing:1,children:[e.getProfileComponent&&e.getProfileComponent(e.message),(0,n.jsx)(w,{timestamp:e.message.timestamp})]}),e.getActionsComponent&&e.getActionsComponent(e.message)&&(0,n.jsx)(h(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:r.shadows[1]},children:e.getActionsComponent(e.message)}),(0,n.jsx)(h(),{variant:"outlined",className:"rustic-message-container",children:e.children})]})}));var O=function(){return O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},O.apply(this,arguments)};function E(e,t){var n=t.format.includes("update")?t.threadId:t.id;if(n){var r=O({},e),o=(e[n]||[])[0];return t.format.includes("update")&&o&&o.sender.id!==t.sender.id&&(n=t.id),r[n]||(r[n]=[]),r[n]=r[n].concat(t),r}return e}function S(e){var t,r,s,c=(0,i.useRef)(null),u=(0,i.useRef)(null),l=(0,i.useRef)(),m=(0,i.useState)(!0),f=m[0],g=m[1],v=(0,i.useState)(!0),h=v[0],y=v[1],j=(0,i.useState)(!1),b=j[0],w=j[1],O=(0,i.useState)({}),S=O[0],C=O[1],T=Object.keys(S).length,P=(r=T,s=(0,i.useRef)(0),(0,i.useEffect)((function(){s.current=r})),s.current),N=2e3;function R(){y(!0),l.current&&clearTimeout(l.current),l.current=setTimeout((function(){y(!1)}),N)}function A(){var e=u.current,t=c.current;if(e&&t){var n=e.getBoundingClientRect().bottom,r=t.getBoundingClientRect().bottom;g(r-1<=n)}}function q(){if(function(){var e,t=null===(e=u.current)||void 0===e?void 0:e.querySelectorAll("video");return!t||0===t.length||Array.from(t).every((function(e){return e.readyState>=1}))}()){var e=u.current;w(!0),e&&setTimeout((function(){R(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(q,1)}function D(e){C((function(t){return E(t,e)}))}return(0,i.useEffect)((function(){var e=u.current;if(A(),e)return e.addEventListener("scroll",A),window.addEventListener("resize",A),function(){e.removeEventListener("scroll",A),window.removeEventListener("resize",A)}}),[f]),(0,i.useEffect)((function(){q()}),[b]),(0,i.useEffect)((function(){f&&0!==P&&T>P&&(R(),q())}),[f,Object.keys(S).length]),(0,i.useEffect)((function(){var t,n={};null===(t=e.receivedMessages)||void 0===t||t.forEach((function(e){var t=E(n,e);n=t})),C(n)}),[null===(t=e.receivedMessages)||void 0===t?void 0:t.length]),(0,i.useEffect)((function(){e.ws.onReceive&&e.ws.onReceive(D)}),[]),(0,n.jsxs)(a(),{ref:u,className:"rustic-message-space",children:[Object.keys(S).map((function(t,r){var o=S[t],s=o[o.length-1];return(0,n.jsx)(x,{message:s,getActionsComponent:e.getActionsComponent,getProfileComponent:e.getProfileComponent,ref:r===T-1?c:null,children:(0,n.jsx)(d,{ws:e.ws,sender:e.sender,messages:o,supportedElements:e.supportedElements})},t)})),!f&&!h&&(0,n.jsx)(o(),{variant:"rusticSecondary",className:"rustic-scroll-down-button",size:"medium",onClick:q,label:(0,n.jsxs)(n.Fragment,{children:[e.scrollDownLabel,(0,n.jsx)(p,{name:"arrow_downward"})]})})]})}S.defaultProps={scrollDownLabel:"Scroll down"};const C=S;return t})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,
|
|
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 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@rustic-ai/ui-components"]=e():t["@rustic-ai/ui-components"]=e()}(global,(()=>(()=>{"use strict";var t={n:e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},d:(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ParticipantRole:()=>
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@rustic-ai/ui-components"]=e():t["@rustic-ai/ui-components"]=e()}(global,(()=>(()=>{"use strict";var t={n:e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},d:(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ParticipantRole:()=>_,ParticipantType:()=>w,default:()=>S});const r=require("react/jsx-runtime"),a=require("@mui/material/Button");var i=t.n(a);const n=require("@mui/material/Dialog");var c=t.n(n);const s=require("@mui/material/DialogTitle");var o=t.n(s);const l=require("@mui/material/Divider");var p=t.n(l);const u=require("@mui/material/List");var m=t.n(u);const d=require("@mui/material/ListItem");var y=t.n(d);const f=require("@mui/material/ListSubheader");var h=t.n(f);const v=require("@mui/material/Typography");var j=t.n(v);const x=require("@mui/system"),b=require("pluralize");var g=t.n(b);const T=require("react");var O;!function(t){t[t.HOUR=0]="HOUR",t[t.MONTH_DATE=1]="MONTH_DATE"}(O||(O={}));var N=function(){return N=Object.assign||function(t){for(var e,r=1,a=arguments.length;r<a;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},N.apply(this,arguments)};function q(t){t.name.replaceAll("_","-");var e={};return t.color&&(e={color:t.color}),(0,r.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),style:N({},e),children:t.name})}var _,w;function A(t){var e=(0,T.useState)(!1),a=e[0],n=e[1],c=t.participants.length,s=a?t.participants:t.participants.slice(0,3),o="".concat(g()(t.participantType,c)," (").concat(c,")"),l=a?"Show Less":"Show All ".concat(c);return 0===c?(0,r.jsx)(j(),{variant:"caption",className:"rustic-participant-list-no-participants-message",children:"There are currently no participants."}):(0,r.jsx)(m(),{className:"rustic-participant-list",subheader:(0,r.jsxs)(h(),{disableSticky:!0,className:"rustic-participant-list-subheader",children:[(0,r.jsxs)(x.Box,{className:"rustic-participant-list-subheader-title",children:[t.participantTypeIcon,(0,r.jsx)(j(),{variant:"subtitle2",color:"text.secondary",children:o})]}),c>3&&(0,r.jsx)(i(),{onClick:function(){return n(!a)},color:"primary",size:"small",startIcon:(0,r.jsx)(q,{name:"keyboard_arrow_down"}),children:l})]}),children:s.map((function(t){return(0,r.jsxs)(y(),{className:"rustic-participant-list-item",children:[(0,r.jsx)(j(),{variant:"subtitle2",children:t.displayName}),(0,r.jsx)(j(),{variant:t.participantRole===_.Owner?"subtitle2":"caption",children:(e=t.participantRole,e.charAt(0).toUpperCase()+e.slice(1))})]},t.id);var e}))})}!function(t){t.Owner="owner",t.Member="member"}(_||(_={})),function(t){t.Human="human",t.Agent="agent"}(w||(w={}));const S=function(t){function e(t,e){return function(t){return function(t,e,r){if(r||2===arguments.length)for(var a,i=0,n=e.length;i<n;i++)!a&&i in e||(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}([],t,!0).sort((function(t,e){return e.participantRole===_.Owner?1:-1}))}(t.filter((function(t){return t.participantType===e})))}var a=e(t.participants,w.Human),i=e(t.participants,w.Agent),n="".concat(g()("Participant",t.participants.length)," (").concat(t.participants.length,")");return(0,r.jsxs)(c(),{open:t.isParticipantListOpen,onClose:t.onClose,className:"rustic-participants-container",maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(o(),{sx:{borderBottom:"1px solid",borderColor:"divider"},component:"h6",className:"rustic-participants-container-title",children:n}),(0,r.jsx)(A,{participantType:"Human",participantTypeIcon:(0,r.jsx)(q,{name:"account_circle"}),participants:a}),i.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p(),{className:"rustic-participants-container-divider"}),(0,r.jsx)(A,{participantType:"Agent",participantTypeIcon:(0,r.jsx)(q,{name:"smart_toy"}),participants:i})]})]})};return e})()));
|
|
@@ -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
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>S});const r=require("react/jsx-runtime"),n=require("@mui/material/Box");var o=e.n(n);const a=require("@mui/material/Card");var i=e.n(a);const s=require("@mui/material/TextField");var c=e.n(s);const l=require("@mui/material/Typography");var u=e.n(l);const d=require("@mui/material/useMediaQuery");var m=e.n(d);const f=require("@mui/system/Stack");var p=e.n(f);const v=require("@mui/system/useTheme");var b=e.n(v);const h=require("pdfjs-dist"),x=require("react"),y=require("@mui/material/IconButton");var j=e.n(y);const g=require("@mui/material/Tooltip");var w=e.n(g),N=function(){return N=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},N.apply(this,arguments)};function P(e){e.name.replaceAll("_","-");var t={};return e.color&&(t={color:e.color}),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:N({},t),children:e.name})}const k=function(e){var t={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(t[e.action].label.replaceAll(" ","-").toLowerCase(),t[e.action]);return(0,r.jsx)(w(),{title:n.label,children:(0,r.jsx)("span",{children:(0,r.jsx)(j(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,r.jsx)(P,{name:n.symbol})})})})},S=function(e){var t,n=(0,x.useRef)(null),a=(0,x.useState)(1),s=a[0],l=a[1],d=(0,x.useState)(1),f=d[0],v=d[1],y=(0,x.useState)(1),j=y[0],g=y[1],w=(0,x.useState)(!1),N=w[0],P=w[1],S=(0,x.useState)(),C=S[0],q=S[1],O=b()(),_=m()(O.breakpoints.down("sm")),z=m()(O.breakpoints.between("sm","md"));if(t=e.url,!/\/[^/]+\.pdf$/.test(t))return(0,r.jsx)(i(),{variant:"outlined",className:"rustic-pdf-error",children:(0,r.jsx)(u(),{variant:"body2",children:"The provided URL does not point to a PDF file."})});var T=(0,x.useState)((function(){return _?.5:z?1:1.5})),D=T[0],I=T[1];return(0,x.useEffect)((function(){h.GlobalWorkerOptions.workerSrc||(h.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(h.version,"/pdf.worker.mjs")),h.getDocument({url:"".concat(e.url)}).promise.then((function(e){v(e.numPages),function(e){e.getPage(s).then((function(e){var t=e.getViewport({scale:D}),r=n.current;if(r){var o=r.getContext("2d");if(o){var a=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*a,r.height=t.height*a;var i={canvasContext:o,viewport:t,transform:[a,0,0,a,0,0]};C&&C.cancel();var s=e.render(i);q(s),s.promise.then((function(){q(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){P(!0)}))}),[e.url,s,D]),N?(0,r.jsx)(i(),{variant:"outlined",className:"rustic-pdf-error",children:(0,r.jsx)(u(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,r.jsxs)(i(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,r.jsxs)(o(),{className:"rustic-pdf-viewer-header",children:[(0,r.jsx)(k,{action:"zoomOut",onClick:function(){I((function(e){return Math.max(e-.2,.2)}))}}),(0,r.jsx)(k,{action:"zoomIn",onClick:function(){I((function(e){return 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:n})})}),(0,r.jsxs)(p(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,r.jsx)(k,{action:"previousPage",onClick:function(){s>1&&(l(s-1),g(s-1))},isDisabled:1===s}),(0,r.jsx)(u(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,r.jsx)(c(),{type:"number",value:j,onChange:function(e){var t=parseInt(e.target.value);g(t),!isNaN(t)&&t>=1&&t<=f&&l(t)},size:"small",className:"rustic-pdf-page-input"}),(0,r.jsxs)(u(),{variant:"body1",className:"rustic-page-indicator",children:["of ",f]}),(0,r.jsx)(k,{action:"nextPage",onClick:function(){s<f&&(l(s+1),g(s+1))},isDisabled:s===f})]})]})};return t})()));
|
|
@@ -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:()=>
|
|
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 +1 @@
|
|
|
1
|
-
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports["@rustic-ai/ui-components"]=a():e["@rustic-ai/ui-components"]=a()}(global,(()=>(()=>{"use strict";var e={n:a=>{var t=a&&a.__esModule?()=>a.default:()=>a;return e.d(t,{a:t}),t},d:(a,t)=>{for(var r in t)e.o(t,r)&&!e.o(a,r)&&Object.defineProperty(a,r,{enumerable:!0,get:t[r]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},a={};e.r(a),e.d(a,{default:()=>
|
|
1
|
+
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports["@rustic-ai/ui-components"]=a():e["@rustic-ai/ui-components"]=a()}(global,(()=>(()=>{"use strict";var e={n:a=>{var t=a&&a.__esModule?()=>a.default:()=>a;return e.d(t,{a:t}),t},d:(a,t)=>{for(var r in t)e.o(t,r)&&!e.o(a,r)&&Object.defineProperty(a,r,{enumerable:!0,get:t[r]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},a={};e.r(a),e.d(a,{default:()=>K});const t=require("react/jsx-runtime"),r=require("@mui/material"),n=require("@mui/material/Stack");var i=e.n(n);const c=require("@mui/material/Table");var o=e.n(c);const s=require("@mui/material/TableBody");var l=e.n(s);const u=require("@mui/material/TableCell");var d=e.n(u);const m=require("@mui/material/TableContainer");var b=e.n(m);const p=require("@mui/material/TableHead");var f=e.n(p);const y=require("@mui/material/TablePagination");var g=e.n(y);const h=require("@mui/material/TableRow");var v=e.n(h);const j=require("@mui/material/TableSortLabel");var x=e.n(j);const O=require("@mui/material/Tooltip");var T=e.n(O);const q=require("@mui/material/Typography");var P=e.n(q);const w=require("react");var S;!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(S||(S={}));var N,k=function(){return k=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},k.apply(this,arguments)};function A(e){e.name.replaceAll("_","-");var a={};return e.color&&(a={color:e.color}),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:k({},a),children:e.name})}function D(){return(0,t.jsx)(A,{name:"expand_all"})}!function(e){e.Ascending="asc",e.Descending="desc"}(N||(N={}));const K=function(e){if(0===e.data.length)return(0,t.jsx)(P(),{variant:"body2",children:"No data available"});var a,n,c,s=e.data.length>10,u=(0,w.useState)({}),m=u[0],p=u[1],y=(0,w.useState)(s?10:-1),h=y[0],j=y[1],O=(0,w.useState)(0),q=O[0],S=O[1],k=(0,r.useTheme)(),A=Array.from(new Set(e.data.flatMap((function(e){return Object.keys(e)})))),K=e.headers||A.map((function(e){return{dataKey:e}})),_=(a=e.data,n=Object.keys(m)[0],c=m[n],n&&c?a.slice().sort((function(e,a){var t=Object.keys(m)[0],r=m[t];return e[t]<a[t]?r===N.Descending?1:-1:e[t]>a[t]?r===N.Descending?-1:1:0})):a),C=_.slice(q*h,q*h+h),M=h>0?C:_;function R(e){if(!m[e])return D}return(0,t.jsxs)(i(),{className:"rustic-table",spacing:1,children:[e.title&&(0,t.jsx)(P(),{variant:"h6",className:"rustic-table-title",children:e.title}),e.description&&(0,t.jsx)(P(),{variant:"body1",children:e.description}),(0,t.jsx)(b(),{className:"rustic-table-container",children:(0,t.jsxs)(o(),{"aria-label":e.title||"a table of data",size:"small",stickyHeader:!0,children:[K.length>0&&(0,t.jsx)(f(),{children:(0,t.jsx)(v(),{children:K.map((function(e,a){return(0,t.jsx)(d(),{sortDirection:m[e.dataKey]||!1,children:(0,t.jsx)(T(),{title:(n=e.dataKey,i=m[n],i?Object.keys(N)[Object.values(N).indexOf(i)]:"Sort"),children:(0,t.jsx)(x(),{active:!0,direction:m[e.dataKey],onClick:function(){return function(e){p((function(a){var t,r,n={};switch(a[e]){case N.Ascending:(t={})[e]=N.Descending,n=t;break;case N.Descending:n={};break;default:(r={})[e]=N.Ascending,n=r}return n}))}(e.dataKey)},className:"rustic-table-header",IconComponent:R(e.dataKey),children:e.label||(r=e.dataKey,r.charAt(0).toUpperCase()+r.slice(1))})})},"header-".concat(a));var r,n,i}))})}),(0,t.jsx)(l(),{children:M.map((function(e,a){return(0,t.jsx)(v(),{children:K.map((function(r,n){return(0,t.jsx)(d(),{children:e[r.dataKey]},"cell-".concat(a,"-").concat(n))}))},"row-".concat(a))}))})]})}),s&&(0,t.jsx)(g(),{className:"rustic-table-pagination",component:"div",count:e.data.length,rowsPerPage:h,labelRowsPerPage:"Rows:",page:q,onPageChange:function(e,a){return S(a)},onRowsPerPageChange:function(e){j(+e.target.value),S(0)},sx:{"& .MuiTablePagination-selectLabel":{color:k.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})};return a})()));
|
|
@@ -197,6 +197,14 @@ export interface TextInputProps extends Omit<BaseInputProps, 'send' | 'isSendEna
|
|
|
197
197
|
/** WebSocket connection to send and receive messages to and from a backend.*/
|
|
198
198
|
ws: WebSocketClient;
|
|
199
199
|
}
|
|
200
|
+
export interface UploadOption {
|
|
201
|
+
label: string;
|
|
202
|
+
metadata: {
|
|
203
|
+
[key: string]: any;
|
|
204
|
+
};
|
|
205
|
+
acceptedFileTypes?: string;
|
|
206
|
+
iconName?: string;
|
|
207
|
+
}
|
|
200
208
|
export interface UploaderProps {
|
|
201
209
|
/** 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). */
|
|
202
210
|
acceptedFileTypes: string;
|
|
@@ -222,6 +230,8 @@ export interface UploaderProps {
|
|
|
222
230
|
getUploadData?: (fileName: string) => {
|
|
223
231
|
[key: string]: any;
|
|
224
232
|
};
|
|
233
|
+
/** 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.*/
|
|
234
|
+
uploadOptions?: UploadOption[];
|
|
225
235
|
}
|
|
226
236
|
export type MultimodalInputProps = TextInputProps & Omit<UploaderProps, 'messageId' | 'onFileUpdate' | 'filePreviewsContainer' | 'errorMessagesContainer'>;
|
|
227
237
|
export interface ConversationProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAGpE,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAEhD,uEAAuE;AACvE,MAAM,WAAW,MAAM;IACrB,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,MA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AI,EAAE;QACJ,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;CACF;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,mCAAmC;IACnC,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,KAAK,EAAE,QAAQ,GAAG,UAAU,CAAA;CAC7B;AAED,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AAEhE,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,iBAAiB,EACjB,qBAAqB,GAAG,iBAAiB,GAAG,UAAU,CACvD;IACD,+kBAA+kB;IAC/kB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oPAAoP;IACpP,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,yQAAyQ;IACzQ,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,wCAAwC;IACxC,MAAM,EAAE,GAAG,CAAA;CACZ;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU,EAAE,iBAAiB;CAAG"}
|
|
@@ -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 n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>S});const r=require("react/jsx-runtime"),n=require("@mui/material/FormControl");var i=e.n(n);const a=require("@mui/material/IconButton");var o=e.n(a);const s=require("@mui/material/Menu");var c=e.n(s);const l=require("@mui/material/MenuItem");var u=e.n(l);const h=require("@mui/material/Typography");var m=e.n(h);const d=require("@mui/system/Box");var f=e.n(d);const p=require("@mui/system/useTheme");var y=e.n(p);const x=require("react"),g=require("recharts");var v;function j(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===v.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?v.HOUR:v.MONTH_DATE)}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(v||(v={}));var b=function(){return b=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},b.apply(this,arguments)};function C(e){e.name.replaceAll("_","-");var t={};return e.color&&(t={color:e.color}),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:b({},t),children:e.name})}var O=function(){return O=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},O.apply(this,arguments)},k={line:g.LineChart,bar:g.BarChart,area:g.AreaChart};function T(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function A(e){var t=(0,x.useState)(e.defaultChartType||"line"),n=t[0],a=t[1],s=(0,x.useState)(null),l=s[0],h=s[1],d=(0,x.useState)(e.timeSeries),p=d[0],v=d[1],b=y()(),A=p.length>0?Object.keys(p[0]):[],S=A[0],L=A.slice(1),D=(0,x.useState)(T(L)),N=D[0],w=D[1];(0,x.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){var t=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e.timeSeries,!0);e.updatedData.forEach((function(e){t=t.concat(e.timeSeries),v(t)}))}}),[e.timeSeries,e.updatedData]);var M=k[n];function _(e){l?h(null):e&&h(e.currentTarget)}function q(t,r){return N[t]?e.chartColors[r%e.chartColors.length]:"grey"}function H(e){return N[e]?"none":"line-through"}if(0===p.length)return(0,r.jsx)(m(),{variant:"body2",children:"No data available"});var F,R,W,E,P=e.timeSeries[e.timeSeries.length-1],B=(F=e.timeSeries[0][S],R=P[S],W=new Date(F),E=new Date(R),Math.round(Math.abs((E.getTime()-W.getTime())/864e5)));return(0,r.jsxs)(f(),{className:"rustic-recharts-time-series",children:[!e.disableChartTypeToggle&&(0,r.jsxs)(i(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,r.jsx)(o(),{"aria-label":"chart options","aria-expanded":Boolean(l),"aria-haspopup":"true",onClick:_,color:"primary",children:(0,r.jsx)(C,{name:"more_vert"})}),(0,r.jsxs)(c(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:l,open:Boolean(l),onClose:function(e){return _(e)},children:[(0,r.jsx)(m(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(k).map((function(e){return(0,r.jsxs)(u(),{value:e,selected:e===n,onClick:function(){return function(e){a(e),_()}(e)},children:[e.charAt(0).toUpperCase()+e.slice(1)," ","Chart"]},e)}))]})]}),(0,r.jsxs)(f(),{children:[e.title&&(0,r.jsx)(m(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:e.title}),e.description&&(0,r.jsx)(m(),{variant:"caption",className:"rustic-recharts-time-series-description",children:e.description}),(0,r.jsx)(g.ResponsiveContainer,{aspect:e.aspectRatio,width:e.width,maxHeight:e.maxHeight,minWidth:e.minChartWidth,children:(0,r.jsxs)(M,{data:p,margin:e.chartContainerMargin,children:[(0,r.jsx)(g.XAxis,{dataKey:S,tickFormatter:function(e){return j(e,B)},stroke:b.palette.text.primary}),(0,r.jsx)(g.YAxis,{domain:["auto","auto"],width:e.yAxisLabelWidth,tickFormatter:e.yAxisTickFormatter,stroke:b.palette.text.primary}),(0,r.jsx)(g.Tooltip,{labelFormatter:function(e){return[j(e,B)]},formatter:e.tooltipFormatter,contentStyle:{color:b.palette.common.black}}),(0,r.jsx)(g.Legend,{content:function(){return(0,r.jsx)(f(),{className:"rustic-recharts-time-series-legend",children:L.map((function(e,t){return(0,r.jsxs)(f(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=N[e]&&!L.find((function(t){return t!==e&&N[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(N)){for(var n={},i=0,a=L;i<a.length;i++){var o=a[i],s=o===e;n[o]=s}w(n)}else w(r?T(L):O(O({},N),((t={})[e]=!N[e],t)))}(e)},sx:{color:q(e,t)},children:[(0,r.jsx)(C,{name:"crop_16_9"}),(0,r.jsx)(m(),{variant:"body2",display:"inline",sx:{textDecorationLine:H(e)},children:e})]},t)}))})}}),L.map((function(t,i){return N[t]?function(t,i){var a=i%e.chartColors.length,o=N[t]?e.chartColors[a]:"transparent",s={onClick:e.onClick,cursor:"pointer"};switch(n){case"line":return(0,r.jsx)(g.Line,{type:"monotone",isAnimationActive:!1,dataKey:t,name:t,dot:!1,stroke:o,activeDot:e.onClick&&s},t);case"bar":return(0,r.jsx)(g.Bar,{dataKey:t,fill:o,onClick:e.onClick&&s.onClick,cursor:e.onClick&&s.cursor},t);case"area":return(0,r.jsxs)(x.Fragment,{children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:"color".concat(t),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,r.jsx)("stop",{offset:"5%",stopColor:o,stopOpacity:.8}),(0,r.jsx)("stop",{offset:"95%",stopColor:o,stopOpacity:0})]})}),(0,r.jsx)(g.Area,{isAnimationActive:!1,dataKey:t,type:"monotone",stroke:o,fillOpacity:1,fill:"url(#color".concat(t,")"),activeDot:e.onClick&&s},t)]},t)}}(t,i):null})),e.referenceLineYAxis&&e.referenceLineYAxis.map((function(t,n){return(0,r.jsx)(g.ReferenceLine,{y:t,label:e.referenceLineLabel&&e.referenceLineLabel[n],stroke:e.referenceLineColor&&e.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:e.referenceLineStrokeWidth&&e.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}A.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const S=A;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 n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>b});const n=require("react/jsx-runtime"),r=(require("@finos/perspective-viewer"),require("@finos/perspective-viewer-datagrid"),require("@finos/perspective-viewer-d3fc"),require("@finos/perspective-viewer/dist/css/pro.css"),require("@finos/perspective-viewer/dist/css/pro-dark.css"),require("@finos/perspective"));var o=e.n(r);const i=require("@mui/material/styles"),a=require("@mui/material/Typography");var s=e.n(a);const u=require("@mui/system/Stack");var c=e.n(u);const
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>b});const n=require("react/jsx-runtime"),r=(require("@finos/perspective-viewer/dist/esm/perspective-viewer.inline.js"),require("@finos/perspective-viewer-datagrid"),require("@finos/perspective-viewer-d3fc"),require("@finos/perspective-viewer/dist/css/pro.css"),require("@finos/perspective-viewer/dist/css/pro-dark.css"),require("@finos/perspective/dist/esm/perspective.inline.js"));var o=e.n(r);const i=require("@mui/material/styles"),a=require("@mui/material/Typography");var s=e.n(a);const u=require("@mui/system/Stack");var c=e.n(u);const p=require("react");var l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l.apply(this,arguments)};function d(e){return e?e.reduce((function(e,t){var n=t.dataKey,r=t.label;return e[n]=r||n,e}),{}):{}}const b=function(e){if(0===e.data.length)return(0,n.jsx)(s(),{variant:"body2",children:"No data available."});var t=(0,p.useRef)(null),r=(0,i.useTheme)(),a=(0,p.useState)(!1),u=a[0],b=a[1],f=r.palette.mode,m="dark"===f?"Pro Dark":"Pro Light",v=d(e.headers),g="\n /* General Button Styles */\n button, .button:hover, #editor-container, .editable, #settings_button {\n border-radius: 16px !important;\n color: ".concat(r.palette.text.primary," !important;\n /* TODO: add background color after updating the theme */\n }\n \n #settings_button {\n border: 1px solid ").concat(r.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: ").concat("dark"===f?"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 span.button {\n color: ").concat(r.palette.primary.main," !important;\n }\n \n span.button:hover:before {\n background-color: ").concat(r.palette.primary.main," !important;\n }\n \n .button select:hover, .button:hover, .psp-expression-editor__button:hover, \n .sidebar_close_button_inner:hover {\n background-color: ").concat(r.palette.primary.light," !important;\n }\n \n /* Enable Scrolling */\n #plugin_selector_container.open, #status_bar, #menu-bar, #app_panel {\n overflow: scroll !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 ");var h,y,_,x,j,S,w,k,O,q=e.config&&(y=(h=e.config).groupBy,_=h.splitBy,x=h.aggregates,j=h.sort,S=h.filter,w=h.columns,k=null==j?void 0:j.map((function(e){return[v[e[0]]||e[0],e[1]]})),O=x&&Object.fromEntries(Object.entries(x).map((function(e){var t=e[0],n=e[1];return[v[t]||t,n]}))),{group_by:null==y?void 0:y.map((function(e){return v[e]||e})),split_by:null==_?void 0:_.map((function(e){return v[e]||e})),aggregates:O,sort:k,filter:S&&function(e){return e.map((function(e){return[v[e[0]]||e[0],e[1],e[e.length-1]]}))}(S),columns:null==w?void 0:w.map((function(e){return v[e]||e}))});return(0,p.useEffect)((function(){var n=t.current;n&&o().worker().then((function(t){t.table(function(e,t){var n=d(t);return e.map((function(e){for(var t={},r=0,o=Object.entries(e);r<o.length;r++){var i=o[r],a=i[0],s=i[1];t[n[a]||a]=s}return t}))}(e.data,e.headers)).then((function(t){n.load(t).then((function(){return n.restore(l(l({},q),{theme:m,title:e.title,settings:!1})).then((function(){if(n.shadowRoot){var e=new CSSStyleSheet;e.replaceSync(g),n.shadowRoot.adoptedStyleSheets.push(e)}}))}))}))})).catch((function(){b(!0)}))}),[e.data,m]),u?(0,n.jsx)(s(),{variant:"body2",children:"Failed to create table from data."}):(0,n.jsxs)(c(),{direction:"column",className:"rustic-perspective-viz",children:[e.title&&(0,n.jsx)(s(),{variant:"h6",children:e.title}),e.description&&(0,n.jsx)(s(),{variant:"body1",children:e.description}),(0,n.jsx)("perspective-viewer",{ref:t,style:{fontFamily:r.typography.fontFamily}})]})};return t})()));
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import './perspectiveViz.css';
|
|
2
|
-
import '@finos/perspective-viewer';
|
|
2
|
+
import '@finos/perspective-viewer/dist/esm/perspective-viewer.inline.js';
|
|
3
3
|
import '@finos/perspective-viewer-datagrid';
|
|
4
4
|
import '@finos/perspective-viewer-d3fc';
|
|
5
5
|
import '@finos/perspective-viewer/dist/css/pro.css';
|
|
6
6
|
import '@finos/perspective-viewer/dist/css/pro-dark.css';
|
|
7
7
|
import type { TableData, TableHeader } from '../../types';
|
|
8
|
-
export declare function transformTableData(originalData: Array<Record<string, string | number>>, headers?: TableHeader[]): Record<string,
|
|
8
|
+
export declare function transformTableData(originalData: Array<Record<string, string | number>>, headers?: TableHeader[]): Record<string, string | number>[];
|
|
9
9
|
/** The PerspectiveViz component is designed to efficiently display and process large datasets, supporting interactive features such as filtering, sorting, and aggregating data for enhanced analysis and visualization. It integrates with the [Perspective library](https://perspective.finos.org/) to render data in various formats, including datagrids(pivot tables) and charts.
|
|
10
10
|
*
|
|
11
11
|
* Note: [Perspective](https://perspective.finos.org/) libraries are not bundled, so they must be included in the application's build process:
|
|
12
12
|
*
|
|
13
13
|
* ```typescript
|
|
14
|
-
* npm i @finos/perspective
|
|
14
|
+
* npm i @finos/perspective @finos/perspective-viewer @finos/perspective-viewer-d3fc @finos/perspective-viewer-datagrid
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
declare function PerspectiveViz(props: TableData): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perspectiveViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/perspectiveViz/perspectiveViz.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"perspectiveViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/perspectiveViz/perspectiveViz.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,iEAAiE,CAAA;AACxE,OAAO,oCAAoC,CAAA;AAC3C,OAAO,gCAAgC,CAAA;AACvC,OAAO,4CAA4C,CAAA;AACnD,OAAO,iDAAiD,CAAA;AAcxD,OAAO,KAAK,EAEV,SAAS,EAET,WAAW,EAEZ,MAAM,aAAa,CAAA;AAiBpB,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,EACpD,OAAO,CAAC,EAAE,WAAW,EAAE,qCAWxB;AAED;;;;;;;GAOG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,SAAS,2CAwLvC;AAED,eAAe,cAAc,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";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>H});const r=require("react/jsx-runtime"),n=require("@mui/material/Typography");var o=e.n(n);const a=require("@mui/system/Box");var i=e.n(a);const c=require("@mui/system/Stack");var s=e.n(c);const l=require("@mui/system/useTheme");var u=e.n(l);const d=require("react"),p=require("react-dom/server"),m=require("vega-embed");var f=e.n(m);const v=require("dompurify");var h=e.n(v);const b=require("marked");function x(e){var t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=b.marked.parse(t);return h().sanitize(r)}const y=function(e){var t=(0,d.useState)(x(e.text)),n=t[0],a=t[1];return(0,d.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){var t=e.updatedData[e.updatedData.length-1].text;a(x(t))}}),[e.text,e.updatedData]),(0,r.jsx)(o(),{variant:"body2",dangerouslySetInnerHTML:{__html:n}})},j=require("@mui/material"),g=require("@mui/material/Button");var q=e.n(g);const w=require("@mui/material/Drawer");var k=e.n(w);const S=require("@mui/material/IconButton");var O=e.n(S);const F=require("@mui/material/ListItemText");var N=e.n(F);const D=require("@mui/material/Menu");var T=e.n(D);const P=require("@mui/material/MenuItem");var R=e.n(P);const C=require("@mui/material/styles"),I=require("@mui/material/Tooltip");var M=e.n(I);const L=require("@mui/system");var _=function(){return _=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_.apply(this,arguments)};function B(e){e.name.replaceAll("_","-");var t={};return e.color&&(t={color:e.color}),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),style:_({},t),children:e.name})}var z=function(){return z=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},z.apply(this,arguments)};function E(e){var t=(0,d.useState)(!1),n=t[0],a=t[1],i=(0,d.useRef)(null),c=(0,C.useTheme)(),s=(0,j.useMediaQuery)(c.breakpoints.down("md")),l=s?k():T(),u={borderRadius:"".concat(c.shape.borderRadius,"px"),border:"1px solid ".concat(c.palette.divider)};function p(e){return(0,r.jsxs)(r.Fragment,{children:[e.startDecorator&&(0,r.jsx)(L.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,r.jsx)(N(),{children:(0,r.jsx)(o(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,r.jsx)(L.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}s&&(u=z(z({},u),{borderRadius:"".concat(c.shape.borderRadius,"px ").concat(c.shape.borderRadius,"px 0 0"),borderBottom:0}));var m=e.menuItems.map((function(e){return e.href?(0,r.jsx)(R(),{component:"a",onClick:function(){return a(!1)},href:e.href,download:e.downloadFileName||e.isFiledownload,children:p(e)},e.label):(0,r.jsx)(R(),{onClick:function(t){e.onClick&&e.onClick(t),a(!1)},disabled:!e.onClick,children:p(e)},e.label)}));var f,v,h=s?{}:{anchorEl:i.current};return(0,r.jsxs)(r.Fragment,{children:[(f={onClick:function(e){e.stopPropagation(),a(!0)},"aria-label":e.ariaLabel,ref:i,className:"rustic-popover-menu-button"},v=(0,r.jsx)(B,{name:"more_vert"}),e.buttonText?(0,r.jsx)(q(),z({},f,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,r.jsx)(M(),{title:e.ariaLabel,children:(0,r.jsx)(O(),z({},f,{children:e.icon?e.icon:v}))})),(0,r.jsx)(l,z({open:n,onClose:function(){return a(!1)}},h,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":z(z({},u),{backgroundImage:"none",boxShadow:c.shadows[2]})},children:m}))]})}var A=function(){return A=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},A.apply(this,arguments)};function G(e){var t=(0,d.useRef)(null),n=(0,d.useState)(!1),a=n[0],c=n[1],l=u()(),m="dark"===l.palette.mode,v=l.typography.fontFamily,h={backgroundColor:l.palette.primary.main,color:l.palette.background.paper,borderRadius:l.shape.borderRadius+"px",padding:"4px 8px",fontSize:l.typography.caption.fontSize,fontFamily:v,fontWeight:l.typography.caption.fontWeight},b={formatTooltip:function(e,t){return(0,p.renderToStaticMarkup)((0,r.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:h,children:Object.entries(e).map((function(e){var n=e[0],o=e[1];return(0,r.jsxs)("div",{children:[(0,r.jsxs)("strong",{children:[t(n),":"]})," ",t(o)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},x=[{label:"Save as SVG"},{label:"Save as PNG"}];function j(){var r,n,o,a;if(t.current&&e.spec){var i=A(A({config:{font:v}},e.options),{theme:m?null===(r=e.theme)||void 0===r?void 0:r.dark:null===(n=e.theme)||void 0===n?void 0:n.light,tooltip:b,actions:!1});(null===(a=null===(o=e.options)||void 0===o?void 0:o.config)||void 0===a?void 0:a.font)||(i.config.font=v);var s=A({},e.spec);delete s.title,f()(t.current,s,i).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,o){var a="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,a).then((function(e){x[o].href=e,x[o].downloadFileName="".concat(r,".").concat(n)}))})),c(!1)})).catch((function(){c(!0)}))}}return(0,d.useEffect)((function(){function e(){j()}return j(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[e.spec,m]),a?(0,r.jsx)(o(),{variant:"body2",children:"Failed to load the chart."}):(0,r.jsxs)(s(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,r.jsx)(i(),{justifyContent:"end",display:"flex",children:(0,r.jsx)(E,{menuItems:x,ariaLabel:"Download options"})}),e.title&&(0,r.jsx)(o(),{variant:"h6",children:e.title}),e.description&&(0,r.jsx)(y,{text:e.description}),(0,r.jsxs)(i(),{textAlign:"center",mt:1,children:["string"==typeof e.spec.title&&(0,r.jsx)(o(),{variant:"subtitle2",children:e.spec.title}),e.spec.description&&(0,r.jsx)(o(),{variant:"caption",children:e.spec.description})]}),(0,r.jsx)("div",{ref:t,className:"rustic-vega-lite"})]})}const W=G;G.defaultProps={theme:{dark:"dark"}};const H=W;return t})()));
|
|
@@ -2,10 +2,10 @@ import './vegaLiteViz.css';
|
|
|
2
2
|
import type { VegaLiteData } from './vegaLiteViz.types';
|
|
3
3
|
/** The `VegaLiteViz` component is a versatile tool for visualizing data using the Vega-Lite grammar. With support for various graphic types, it empowers users to create engaging and informative data visualizations effortlessly.
|
|
4
4
|
*
|
|
5
|
-
* Note: `vega-embed`
|
|
5
|
+
* Note: `vega-embed`, `marked` and `dompurify` are not bundled, so please install the following packages using npm:
|
|
6
6
|
*
|
|
7
7
|
* ```typescript
|
|
8
|
-
* npm i vega-embed
|
|
8
|
+
* npm i vega-embed marked dompurify
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
11
|
declare function VegaLiteViz(props: VegaLiteData): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vegaLiteViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/vegaLiteViz.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"vegaLiteViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/vegaLiteViz.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAa1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;;;GAOG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,YAAY,2CA+HvC;kBA/HQ,WAAW;;;;;;;AAiIpB,eAAe,WAAW,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 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:()=>
|
|
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})()));
|
package/dist/index.css
CHANGED
|
@@ -311,6 +311,28 @@ emoji-picker {
|
|
|
311
311
|
width: fit-content;
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
.rustic-popover-menu ul {
|
|
315
|
+
padding: 0;
|
|
316
|
+
min-width: 100px;
|
|
317
|
+
max-width: 240px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.rustic-popover-menu li {
|
|
321
|
+
padding-block: 8px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.rustic-popover-menu-item-icon {
|
|
325
|
+
display: flex;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.rustic-popover-menu-item-start-icon {
|
|
329
|
+
margin-right: 8px;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.rustic-popover-menu-item-end-icon {
|
|
333
|
+
margin-left: 80px;
|
|
334
|
+
}
|
|
335
|
+
|
|
314
336
|
.rustic-open-layers-map-canvas {
|
|
315
337
|
width: 100%;
|
|
316
338
|
aspect-ratio: 16/9;
|
|
@@ -598,28 +620,6 @@ span.rustic-open-layers-map-marker {
|
|
|
598
620
|
}
|
|
599
621
|
}
|
|
600
622
|
|
|
601
|
-
.rustic-popover-menu ul {
|
|
602
|
-
padding: 0;
|
|
603
|
-
min-width: 100px;
|
|
604
|
-
max-width: 240px;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.rustic-popover-menu li {
|
|
608
|
-
padding-block: 8px;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
.rustic-popover-menu-item-icon {
|
|
612
|
-
display: flex;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
.rustic-popover-menu-item-start-icon {
|
|
616
|
-
margin-right: 8px;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
.rustic-popover-menu-item-end-icon {
|
|
620
|
-
margin-left: 80px;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
623
|
.rustic-message-actions {
|
|
624
624
|
padding: 4px 8px;
|
|
625
625
|
}
|