@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
|
@@ -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,kCAAkC,CAAA;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"perspectiveViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/perspectiveViz/perspectiveViz.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,kCAAkC,CAAA;AACzC,OAAO,gCAAgC,CAAA;AACvC,OAAO,0CAA0C,CAAA;AACjD,OAAO,+CAA+C,CAAA;AAatD,OAAO,KAAK,EAEV,SAAS,EAET,WAAW,EAEZ,MAAM,aAAa,CAAA;AAsBpB,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,EACpD,OAAO,CAAC,EAAE,WAAW,EAAE,qCAWxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,SAAS,+BAmTvC;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/plotlyGraph/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/plotlyGraph/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,mBAAmB,qBAAqB,CAAA;AACxC,eAAe,WAAW,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 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,{default:()=>S});const n=require("react/jsx-runtime"),r=require("@mui/material/Typography");var a=e.n(r);const o=require("@mui/system/Box");var i=e.n(o);const s=require("plotly.js/dist/plotly.js");var u=e.n(s);const l=require("react-plotly.js/factory");var c=e.n(l);const d=require("@mui/material/Alert");var p=e.n(d);const m=require("@mui/material/styles"),f=require("dompurify");var y=e.n(f);const g=require("marked"),j=require("react");var h,b,v,x,O;function T(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"}(h||(h={})),function(e){e.Running="running",e.Completed="completed",e.Error="error"}(b||(b={})),function(e){e.Append="append",e.Replace="replace"}(v||(v={})),function(e){e.Owner="owner",e.Member="member"}(x||(x={})),function(e){e.Human="human",e.Agent="agent"}(O||(O={}));const q=e=>{const t=(0,m.useTheme)(),[r,o]=(0,j.useState)(e.text),[i,s]=(0,j.useState)(""),u=T(e.updatedData,"title",e.title),l=T(e.updatedData,"description",e.description);function c(e){return"string"!=typeof e?(s("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]/,""),n=g.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return y().sanitize(n)}function f(e){return(0,n.jsx)(a(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:d(e)},sx:{"& table, & th, & td":{border:`1px solid ${t.palette.divider}`}}})}return(0,j.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===v.Replace)t=c(null==n?void 0:n.text);else for(const n of e.updatedData){const r=e.updateType||v.Append,a=c(n.text);r===v.Append?t+=a:r===v.Replace&&(t=a)}o(t)}},[e.text,e.updatedData]),(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)(a(),{variant:"h6",children:u}),l&&f(l),f(r),i&&(0,n.jsx)(p(),{severity:"error",children:i})]})},D=c()(u()),S=function(e){var t,r;const o=Object.assign(Object.assign({},e.plotParams),{className:"rustic-plotly",layout:Object.assign({autosize:!0},e.plotParams.layout),style:Object.assign({width:"100%",height:null!==(r=null===(t=e.plotParams.layout)||void 0===t?void 0:t.height)&&void 0!==r?r:450},e.plotParams.style)});return o.config=Object.assign(Object.assign({},o.config),{displaylogo:!1,responsive:!0,editable:!1,showSendToCloud:!1}),(0,n.jsxs)(i(),{className:"rustic-plotly-container",children:[e.title&&(0,n.jsx)(a(),{variant:"h6",children:e.title}),e.description&&(0,n.jsx)(q,{text:e.description}),(0,n.jsx)(D,Object.assign({},o))]})};return t})());
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import type { PlotlyGraphData } from './plotlyGraph.types';
|
|
2
|
-
|
|
3
|
-
* offering rich features such as zooming, panning, and downloading graphs. It supports customization of graph
|
|
4
|
-
* parameters and configurations to suit various visualization needs.
|
|
5
|
-
*
|
|
6
|
-
* Note: Required dependencies are not bundled, so please install them using npm:
|
|
7
|
-
*
|
|
8
|
-
* ```typescript
|
|
9
|
-
* npm i react-plotly.js plotly.js
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
declare function PlotlyGraph(props: PlotlyGraphData): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function PlotlyGraph(props: PlotlyGraphData): import("react").JSX.Element;
|
|
13
3
|
export default PlotlyGraph;
|
|
14
4
|
//# sourceMappingURL=plotlyGraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plotlyGraph.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/plotlyGraph/plotlyGraph.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"plotlyGraph.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/plotlyGraph/plotlyGraph.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAmB1D,iBAAS,WAAW,CAAC,KAAK,EAAE,eAAe,+BAmC1C;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PlotParams } from
|
|
3
|
-
|
|
1
|
+
import type { Config, Data, Frame, Layout } from 'plotly.js';
|
|
2
|
+
import type { PlotParams } from 'react-plotly.js';
|
|
3
|
+
import type { Updates, VisualizationFormat } from '../../types';
|
|
4
|
+
export type PlotlyJson = Omit<PlotParams, 'divId' | 'data' | 'layout' | 'config' | 'frames'> & {
|
|
5
|
+
data: Data[];
|
|
6
|
+
layout: Partial<Layout>;
|
|
7
|
+
frames?: Frame[];
|
|
8
|
+
config?: Partial<Config>;
|
|
9
|
+
};
|
|
4
10
|
export interface PlotlyGraphFormat extends VisualizationFormat {
|
|
5
11
|
/** Follow [Plotly's documentation](https://plotly.com/javascript/reference/index/) to provide a valid Plotly JSON.
|
|
6
12
|
* Note: It excludes the `divId` field */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plotlyGraph.types.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/plotlyGraph/plotlyGraph.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"plotlyGraph.types.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/plotlyGraph/plotlyGraph.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAI/D,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,UAAU,EACV,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAClD,GAAG;IACF,IAAI,EAAE,IAAI,EAAE,CAAA;IACZ,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IACvB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACzB,CAAA;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D;6CACyC;IACzC,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAE1B,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAE1B,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,mBAAmB,qBAAqB,CAAA;AACxC,eAAe,WAAW,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:()=>$});const r=require("react/jsx-runtime"),n=require("@mui/material/Typography");var a=e.n(n);const o=require("@mui/system/Box");var i=e.n(o);const c=require("@mui/system/Stack");var u=e.n(c);const s=require("@mui/system/useTheme");var l=e.n(s);const d=require("axios");var p=e.n(d);const f=require("react"),m=require("react-dom/server"),v=require("vega"),h=require("vega-embed");var y,b=e.n(h);function g(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"}(y||(y={}));const x=require("@mui/material/Alert");var j=e.n(x);const w=require("@mui/material/styles"),O=require("dompurify");var S=e.n(O);const T=require("marked");var q,D,k,R;!function(e){e.Running="running",e.Completed="completed",e.Error="error"}(q||(q={})),function(e){e.Append="append",e.Replace="replace"}(D||(D={})),function(e){e.Owner="owner",e.Member="member"}(k||(k={})),function(e){e.Human="human",e.Agent="agent"}(R||(R={}));const A=function(e){var t=(0,w.useTheme)(),n=(0,f.useState)(e.text),o=n[0],i=n[1],c=(0,f.useState)(""),u=c[0],s=c[1],l=g(e.updatedData,"title",e.title),d=g(e.updatedData,"description",e.description);function p(e){return"string"!=typeof e?(s("Some of the incoming text was not correctly formatted. Some data may be missing.")," [MISSING TEXT]"):e}function m(e){return(0,r.jsx)(a(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:(n=e,o=n.replace(/^[\u200B-\u200F\uFEFF]/,""),i=T.marked.parse(o,{async:!1,breaks:!0,gfm:!0}),S().sanitize(i))},sx:{"& table, & th, & td":{border:"1px solid ".concat(t.palette.divider)}}});var n,o,i}return(0,f.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===D.Replace)t=p(null==r?void 0:r.text);else for(var n=0,a=e.updatedData;n<a.length;n++){var o=a[n],c=e.updateType||D.Append,u=p(o.text);c===D.Append?t+=u:c===D.Replace&&(t=u)}i(t)}},[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[l&&(0,r.jsx)(a(),{variant:"h6",children:l}),d&&m(d),m(o),u&&(0,r.jsx)(j(),{severity:"error",children:u})]})},F=require("@mui/material"),I=require("@mui/material/Button");var N=e.n(I);const E=require("@mui/material/Drawer");var M=e.n(E);const P=require("@mui/material/IconButton");var C=e.n(P);const _=require("@mui/material/ListItemText");var H=e.n(_);const B=require("@mui/material/Menu");var L=e.n(B);const z=require("@mui/material/MenuItem");var G=e.n(z);const U=require("@mui/material/Tooltip");var W=e.n(U);const J=require("@mui/system");var Q=function(){return Q=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},Q.apply(this,arguments)};function V(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:Q({},t),children:e.name})}var X=function(){return X=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},X.apply(this,arguments)};function K(e){var t=(0,f.useState)(!1),n=t[0],o=t[1],i=(0,f.useRef)(null),c=(0,w.useTheme)(),u=(0,F.useMediaQuery)(c.breakpoints.down("md")),s=u?M():L(),l={borderRadius:"".concat(c.shape.borderRadius,"px"),border:"1px solid ".concat(c.palette.divider)};function d(e){return(0,r.jsxs)(r.Fragment,{children:[e.startDecorator&&(0,r.jsx)(J.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,r.jsx)(H(),{children:(0,r.jsx)(a(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,r.jsx)(J.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}u&&(l=X(X({},l),{borderRadius:"".concat(c.shape.borderRadius,"px ").concat(c.shape.borderRadius,"px 0 0"),borderBottom:0}));var p=e.menuItems.map(function(e){return e.href?(0,r.jsx)(G(),{component:"a",onClick:function(){return o(!1)},href:e.href,download:e.downloadFileName||e.isFiledownload,children:d(e)},e.label):(0,r.jsx)(G(),{onClick:function(t){e.onClick&&e.onClick(t),o(!1)},disabled:!e.onClick,children:d(e)},e.label)});var m,v,h=u?{}:{anchorEl:i.current};return(0,r.jsxs)(r.Fragment,{children:[(m={onClick:function(e){e.stopPropagation(),o(!0)},"aria-label":e.ariaLabel,ref:i,className:"rustic-popover-menu-button"},v=(0,r.jsx)(V,{name:"more_vert"}),e.buttonText?(0,r.jsx)(N(),X({},m,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,r.jsx)(W(),{title:e.ariaLabel,children:(0,r.jsx)(C(),X({},m,{children:e.icon?e.icon:v}))})),(0,r.jsx)(s,X({open:n,onClose:function(){return o(!1)}},h,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":X(X({},l),{backgroundImage:"none",boxShadow:c.shadows[2]})},children:p}))]})}var Y=function(){return Y=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},Y.apply(this,arguments)},Z="source_0";const $=function(e){var t,n=e.theme,o=void 0===n?{dark:"dark"}:n,c=e.refreshIntervalInMs,s=void 0===c?0:c,d=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,["theme","refreshIntervalInMs"]),h=(0,f.useRef)(null),y=(0,f.useRef)(null),x=(0,f.useState)(!1),j=x[0],w=x[1],O=l()(),S="dark"===O.palette.mode,T=O.typography.fontFamily,q=g(d.updatedData,"title",d.title),k=g(d.updatedData,"description",d.description),R=function(e,t){var r={method:t.method||"GET",headers:t.headers,responseType:"text",data:t.body};return(d.getAuthHeaders?d.getAuthHeaders().then(function(e){return r.headers=Y(Y({},r.headers),e.headers),r}):Promise.resolve(r)).then(function(t){return p()(e,t)}).then(function(e){return e.data})};function F(){var e=v.loader();return d.getAuthHeaders&&(e.http=R),e}var I={backgroundColor:O.palette.primary.main,color:O.palette.background.paper,borderRadius:O.shape.borderRadius+"px",padding:"4px 8px",fontSize:O.typography.caption.fontSize,fontFamily:T,fontWeight:O.typography.caption.fontWeight},N={formatTooltip:function(e,t){return(0,m.renderToStaticMarkup)((0,r.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:I,children:Object.entries(e).map(function(e){var n=e[0],a=e[1];return(0,r.jsxs)("div",{children:[(0,r.jsxs)("strong",{children:[t(n),":"]})," ",t(a)]},n)})}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},E=[{label:"Save as SVG"},{label:"Save as PNG"}];function M(){var e,t;if(h.current&&d.spec){var r=Y(Y({config:{font:T}},d.options),{theme:S?o.dark:o.light,tooltip:N,actions:!1,loader:F()});(null===(t=null===(e=d.options)||void 0===e?void 0:e.config)||void 0===t?void 0:t.font)||(r.config.font=T);var n=Y(Y({},d.spec),{name:Z});delete n.title,b()(h.current,n,r).then(function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map(function(n,a){var o="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,o).then(function(e){E[a].href=e,E[a].downloadFileName="".concat(r,".").concat(n)})}),y.current=e.view,w(!1),s>0&&function(){var e=this;if(y.current&&d.spec){P.current&&(clearInterval(P.current),P.current=null);var t=d.spec.data;if(t&&"object"==typeof t&&"url"in t&&t.url){var r=setInterval(function(){return r=e,n=void 0,o=function(){var e,r,n;return function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=c(0),i.throw=c(1),i.return=c(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}(this,function(a){switch(a.label){case 0:if(!y.current)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,F().load(t.url)];case 2:return e=a.sent(),r=JSON.parse(e),n=v.changeset().remove(function(){return!0}).insert(r),y.current.change(Z,n).run(),[3,4];case 3:return a.sent(),w(!0),[3,4];case 4:return[2]}})},new((a=void 0)||(a=Promise))(function(e,t){function i(e){try{u(o.next(e))}catch(e){t(e)}}function c(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof a?r:new a(function(e){e(r)})).then(i,c)}u((o=o.apply(r,n||[])).next())});var r,n,a,o},s);P.current=r}}}()}).catch(function(){w(!0)})}}(0,f.useEffect)(function(){if(h.current){var e=null;return h.current.getBoundingClientRect().width>0?requestAnimationFrame(function(){M()}):(e=new ResizeObserver(function(t){t.some(function(e){return e.contentRect.width>0})&&e&&(requestAnimationFrame(function(){M()}),e.disconnect(),e=null)})).observe(h.current),window.addEventListener("resize",t),function(){window.removeEventListener("resize",t),null==e||e.disconnect()}}function t(){requestAnimationFrame(function(){M()})}},[d.spec,S]),(0,f.useEffect)(function(){var e=setTimeout(function(){if(d.updatedData&&d.updatedData.length>0&&y.current)try{var e=function(e){var t,r=[],n=!1;if(e)if(d.updateType===D.Replace){var a=e.at(-1);if(a&&(null===(t=a.spec)||void 0===t?void 0:t.data)&&"values"in a.spec.data){var o=a.spec.data.values;Array.isArray(o)&&(n=!0,r=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([],o,!0))}}else e.forEach(function(e){var t;if((null===(t=e.spec)||void 0===t?void 0:t.data)&&"values"in e.spec.data){var n=e.spec.data.values;Array.isArray(n)&&r.push.apply(r,n)}});return v.changeset().remove(function(){return n}).insert(r)}(d.updatedData);y.current.change(Z,e).run()}catch(e){console.error("Failed to update streaming data:",e)}},1);return function(){return clearTimeout(e)}},[d.updatedData]);var P=(0,f.useRef)(null);return(0,f.useEffect)(function(){return function(){P.current&&clearInterval(P.current)}},[]),j?(0,r.jsx)(a(),{variant:"body2",children:"Failed to load the chart."}):(0,r.jsxs)(u(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,r.jsx)(i(),{justifyContent:"end",display:"flex",children:(0,r.jsx)(K,{menuItems:E,ariaLabel:"Download options"})}),q&&(0,r.jsx)(a(),{variant:"h6",children:q}),d.description&&(0,r.jsx)(A,{text:d.description,updatedData:d.updateType===D.Replace&&d.updatedData&&(null===(t=d.updatedData)||void 0===t?void 0:t.length)>0&&k?[{text:k}]:void 0}),(0,r.jsxs)(i(),{textAlign:"center",mt:1,children:["string"==typeof d.spec.title&&(0,r.jsx)(a(),{variant:"subtitle2",children:d.spec.title}),d.spec.description&&(0,r.jsx)(a(),{variant:"caption",children:d.spec.description})]}),(0,r.jsx)("div",{ref:h,className:"rustic-vega-lite"})]})};return t})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,()=>(()=>{"use strict";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:()=>Y});const r=require("react/jsx-runtime"),n=require("@mui/material/Typography");var a=e.n(n);const o=require("@mui/system/Box");var i=e.n(o);const s=require("@mui/system/Stack");var c=e.n(s);const u=require("@mui/system/useTheme");var l=e.n(u);const d=require("axios");var p=e.n(d);const m=require("react"),f=require("react-dom/server"),h=require("vega"),v=require("vega-embed");var b,g=e.n(v);function x(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={}));const y=require("@mui/material/Alert");var j=e.n(y);const O=require("@mui/material/styles"),w=require("dompurify");var q=e.n(w);const D=require("marked");var T,R,S,F;!function(e){e.Running="running",e.Completed="completed",e.Error="error"}(T||(T={})),function(e){e.Append="append",e.Replace="replace"}(R||(R={})),function(e){e.Owner="owner",e.Member="member"}(S||(S={})),function(e){e.Human="human",e.Agent="agent"}(F||(F={}));const k=e=>{const t=(0,O.useTheme)(),[n,o]=(0,m.useState)(e.text),[i,s]=(0,m.useState)(""),c=x(e.updatedData,"title",e.title),u=x(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 d(e){const t=e.replace(/^[\u200B-\u200F\uFEFF]/,""),r=D.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return q().sanitize(r)}function p(e){return(0,r.jsx)(a(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:d(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===R.Replace)t=l(null==r?void 0:r.text);else for(const r of e.updatedData){const n=e.updateType||R.Append,a=l(r.text);n===R.Append?t+=a:n===R.Replace&&(t=a)}o(t)}},[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsx)(a(),{variant:"h6",children:c}),u&&p(u),p(n),i&&(0,r.jsx)(j(),{severity:"error",children:i})]})},A=require("@mui/material"),I=require("@mui/material/Button");var N=e.n(I);const M=require("@mui/material/Drawer");var E=e.n(M);const C=require("@mui/material/IconButton");var P=e.n(C);const _=require("@mui/material/ListItemText");var H=e.n(_);const L=require("@mui/material/Menu");var B=e.n(L);const z=require("@mui/material/MenuItem");var $=e.n(z);const G=require("@mui/material/MenuList");var U=e.n(G);const W=require("@mui/material/Tooltip");var J=e.n(W);const Q=require("@mui/system");function V(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})}function X(e){const[t,n]=(0,m.useState)(!1),o=(0,m.useRef)(null),i=(0,O.useTheme)(),s=(0,A.useMediaQuery)(i.breakpoints.down("md")),c=s?E():B();let u={borderRadius:`${i.shape.borderRadius}px`,border:`1px solid ${i.palette.divider}`};function l(e){return(0,r.jsxs)(r.Fragment,{children:[e.startDecorator&&(0,r.jsx)(Q.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,r.jsx)(H(),{children:(0,r.jsx)(a(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,r.jsx)(Q.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}s&&(u=Object.assign(Object.assign({},u),{borderRadius:`${i.shape.borderRadius}px ${i.shape.borderRadius}px 0 0`,borderBottom:0}));const d=e.menuItems.map(e=>e.href?(0,r.jsx)($(),{component:"a",onClick:()=>n(!1),href:e.href,download:e.downloadFileName||e.isFiledownload,children:l(e)},e.label):(0,r.jsx)($(),{onClick:function(t){e.onClick&&e.onClick(t),n(!1)},disabled:!e.onClick,children:l(e)},e.label));function p(e){e.stopPropagation(),n(!0)}const f=s?{}:{anchorEl:o.current};return(0,r.jsxs)(r.Fragment,{children:[function(){const t={onClick:p,"aria-label":e.ariaLabel,ref:o,className:"rustic-popover-menu-button"},n=(0,r.jsx)(V,{name:"more_vert"});return e.buttonText?(0,r.jsx)(N(),Object.assign({},t,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,r.jsx)(J(),{title:e.ariaLabel,children:(0,r.jsx)(P(),Object.assign({},t,{children:e.icon?e.icon:n}))})}(),(0,r.jsx)(c,Object.assign({open:t,onClose:()=>n(!1)},f,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":Object.assign(Object.assign({},u),{backgroundImage:"none",boxShadow:i.shadows[2]})},children:s?(0,r.jsx)(U(),{children:d}):d}))]})}const K="source_0",Y=function(e){var t,{theme:n={dark:"dark"},refreshIntervalInMs:o=0}=e,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,["theme","refreshIntervalInMs"]);const u=(0,m.useRef)(null),d=(0,m.useRef)(null),[v,b]=(0,m.useState)(!1),y=l()(),j="dark"===y.palette.mode,O=y.typography.fontFamily,w=x(s.updatedData,"title",s.title),q=x(s.updatedData,"description",s.description),D=(e,t)=>{const r={method:t.method||"GET",headers:t.headers,responseType:"text",data:t.body};let n;return n=s.getAuthHeaders?s.getAuthHeaders().then(e=>(r.headers=Object.assign(Object.assign({},r.headers),e.headers),r)):Promise.resolve(r),n.then(t=>p()(e,t)).then(e=>e.data)};function T(){const e=h.loader();return s.getAuthHeaders&&(e.http=D),e}const S={backgroundColor:y.palette.primary.main,color:y.palette.background.paper,borderRadius:y.shape.borderRadius+"px",padding:"4px 8px",fontSize:y.typography.caption.fontSize,fontFamily:O,fontWeight:y.typography.caption.fontWeight},F={formatTooltip:(e,t)=>(0,f.renderToStaticMarkup)((0,r.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:S,children:Object.entries(e).map(([e,n])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("strong",{children:[t(e),":"]})," ",t(n)]},e))})),disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},A=[{label:"Save as SVG"},{label:"Save as PNG"}];function I(){var e,t;if(u.current&&s.spec){const r=Object.assign(Object.assign({config:{font:O}},s.options),{theme:j?n.dark:n.light,tooltip:F,actions:!1,loader:T()});(null===(t=null===(e=s.options)||void 0===e?void 0:e.config)||void 0===t?void 0:t.font)||(r.config.font=O);const a=Object.assign(Object.assign({},s.spec),{name:K});delete a.title,g()(u.current,a,r).then(e=>{const t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((n,a)=>{const o="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,o).then(e=>{A[a].href=e,A[a].downloadFileName=`${r}.${n}`})}),d.current=e.view,b(!1),o>0&&function(){if(d.current&&s.spec){N.current&&(clearInterval(N.current),N.current=null);const e=s.spec.data;if(e&&"object"==typeof e&&"url"in e&&e.url){const t=setInterval(()=>{return t=this,r=void 0,a=function*(){if(d.current)try{const t=T(),r=yield t.load(e.url),n=JSON.parse(r),a=h.changeset().remove(()=>!0).insert(n);d.current.change(K,a).run()}catch(e){b(!0)}},new((n=void 0)||(n=Promise))(function(e,o){function i(e){try{c(a.next(e))}catch(e){o(e)}}function s(e){try{c(a.throw(e))}catch(e){o(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(i,s)}c((a=a.apply(t,r||[])).next())});var t,r,n,a},o);N.current=t}}}()}).catch(()=>{b(!0)})}}(0,m.useEffect)(()=>{if(!u.current)return;let e=null;function t(){requestAnimationFrame(()=>{I()})}return u.current.getBoundingClientRect().width>0?requestAnimationFrame(()=>{I()}):(e=new ResizeObserver(t=>{t.some(e=>e.contentRect.width>0)&&e&&(requestAnimationFrame(()=>{I()}),e.disconnect(),e=null)}),e.observe(u.current)),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),null==e||e.disconnect()}},[s.spec,j]),(0,m.useEffect)(()=>{const e=setTimeout(()=>{if(s.updatedData&&s.updatedData.length>0&&d.current)try{const e=function(e){var t;let r=[],n=!1;if(e)if(s.updateType===R.Replace){const a=e.at(-1);if(a&&(null===(t=a.spec)||void 0===t?void 0:t.data)&&"values"in a.spec.data){const e=a.spec.data.values;Array.isArray(e)&&(n=!0,r=[...e])}}else e.forEach(e=>{var t;if((null===(t=e.spec)||void 0===t?void 0:t.data)&&"values"in e.spec.data){const t=e.spec.data.values;Array.isArray(t)&&r.push(...t)}});return h.changeset().remove(()=>n).insert(r)}(s.updatedData);d.current.change(K,e).run()}catch(e){console.error("Failed to update streaming data:",e)}},1);return()=>clearTimeout(e)},[s.updatedData]);const N=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{N.current&&clearInterval(N.current)},[]),v?(0,r.jsx)(a(),{variant:"body2",children:"Failed to load the chart."}):(0,r.jsxs)(c(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,r.jsx)(i(),{sx:{display:"flex",justifyContent:"end"},children:(0,r.jsx)(X,{menuItems:A,ariaLabel:"Download options"})}),w&&(0,r.jsx)(a(),{variant:"h6",children:w}),s.description&&(0,r.jsx)(k,{text:s.description,updatedData:s.updateType===R.Replace&&s.updatedData&&(null===(t=s.updatedData)||void 0===t?void 0:t.length)>0&&q?[{text:q}]:void 0}),(0,r.jsxs)(i(),{sx:{textAlign:"center",mt:1},children:["string"==typeof s.spec.title&&(0,r.jsx)(a(),{variant:"subtitle2",children:s.spec.title}),s.spec.description&&(0,r.jsx)(a(),{variant:"caption",children:s.spec.description})]}),(0,r.jsx)("div",{ref:u,className:"rustic-vega-lite"})]})};return t})());
|
|
@@ -9,6 +9,6 @@ import type { VegaLiteProps } from './vegaLiteViz.types';
|
|
|
9
9
|
* npm i vega-embed
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
|
-
declare function VegaLiteViz({ theme, refreshIntervalInMs, ...props }: VegaLiteProps): import("react
|
|
12
|
+
declare function VegaLiteViz({ theme, refreshIntervalInMs, ...props }: VegaLiteProps): import("react").JSX.Element;
|
|
13
13
|
export default VegaLiteViz;
|
|
14
14
|
//# sourceMappingURL=vegaLiteViz.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vegaLiteViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/vegaLiteViz.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAiB1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAIxD;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,EACnB,KAEC,EACD,mBAAuB,EACvB,GAAG,KAAK,EACT,EAAE,aAAa
|
|
1
|
+
{"version":3,"file":"vegaLiteViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/vegaLiteViz.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAiB1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAIxD;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,EACnB,KAEC,EACD,mBAAuB,EACvB,GAAG,KAAK,EACT,EAAE,aAAa,+BAqVf;AAED,eAAe,WAAW,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 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:()=>w,ParticipantRole:()=>N,ParticipantType:()=>D,UpdateType:()=>T,default:()=>Y});const r=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 s=require("@mui/material/Stack");var c=e.n(s);const l=require("@mui/material/Typography");var u=e.n(l);const d=require("react");var m;function p(e){const t=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:t,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[t]}}function h(e,t,r){var n;return e&&e.length>0&&null!==(n=e[e.length-1][t])&&void 0!==n?n:r}function x(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})}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(m||(m={}));const b=require("@mui/material/Alert");var j=e.n(b);const f=require("@mui/material/styles"),v=require("dompurify");var g=e.n(v);const y=require("marked");var w,T,N,D;!function(e){e.Running="running",e.Completed="completed",e.Error="error"}(w||(w={})),function(e){e.Append="append",e.Replace="replace"}(T||(T={})),function(e){e.Owner="owner",e.Member="member"}(N||(N={})),function(e){e.Human="human",e.Agent="agent"}(D||(D={}));const S=e=>{const t=(0,f.useTheme)(),[n,a]=(0,d.useState)(e.text),[i,o]=(0,d.useState)(""),s=h(e.updatedData,"title",e.title),c=h(e.updatedData,"description",e.description);function l(e){return"string"!=typeof e?(o("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=y.marked.parse(t,{async:!1,breaks:!0,gfm:!0});return g().sanitize(r)}function p(e){return(0,r.jsx)(u(),{component:"div",className:"rustic-markdown",dangerouslySetInnerHTML:{__html:m(e)},sx:{"& table, & th, & td":{border:`1px solid ${t.palette.divider}`}}})}return(0,d.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=l(null==r?void 0:r.text);else for(const r of e.updatedData){const n=e.updateType||T.Append,a=l(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)(u(),{variant:"h6",children:s}),c&&p(c),p(n),i&&(0,r.jsx)(j(),{severity:"error",children:i})]})},q=require("@mui/material"),M=require("@mui/material/Button");var O=e.n(M);const I=require("@mui/material/Drawer");var F=e.n(I);const k=require("@mui/material/IconButton");var C=e.n(k);const R=require("@mui/material/ListItemText");var $=e.n(R);const P=require("@mui/material/Menu");var _=e.n(P);const A=require("@mui/material/MenuItem");var H=e.n(A);const L=require("@mui/material/MenuList");var B=e.n(L);const E=require("@mui/material/Tooltip");var W=e.n(E);const U=require("@mui/system");function G(e){const[t,n]=(0,d.useState)(!1),a=(0,d.useRef)(null),i=(0,f.useTheme)(),o=(0,q.useMediaQuery)(i.breakpoints.down("md")),s=o?F():_();let c={borderRadius:`${i.shape.borderRadius}px`,border:`1px solid ${i.palette.divider}`};function l(e){return(0,r.jsxs)(r.Fragment,{children:[e.startDecorator&&(0,r.jsx)(U.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,r.jsx)($(),{children:(0,r.jsx)(u(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,r.jsx)(U.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}o&&(c=Object.assign(Object.assign({},c),{borderRadius:`${i.shape.borderRadius}px ${i.shape.borderRadius}px 0 0`,borderBottom:0}));const m=e.menuItems.map(e=>e.href?(0,r.jsx)(H(),{component:"a",onClick:()=>n(!1),href:e.href,download:e.downloadFileName||e.isFiledownload,children:l(e)},e.label):(0,r.jsx)(H(),{onClick:function(t){e.onClick&&e.onClick(t),n(!1)},disabled:!e.onClick,children:l(e)},e.label));function p(e){e.stopPropagation(),n(!0)}const h=o?{}:{anchorEl:a.current};return(0,r.jsxs)(r.Fragment,{children:[function(){const t={onClick:p,"aria-label":e.ariaLabel,ref:a,className:"rustic-popover-menu-button"},n=(0,r.jsx)(x,{name:"more_vert"});return e.buttonText?(0,r.jsx)(O(),Object.assign({},t,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,r.jsx)(W(),{title:e.ariaLabel,children:(0,r.jsx)(C(),Object.assign({},t,{children:e.icon?e.icon:n}))})}(),(0,r.jsx)(s,Object.assign({open:t,onClose:()=>n(!1)},h,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":Object.assign(Object.assign({},c),{backgroundImage:"none",boxShadow:i.shadows[2]})},children:o?(0,r.jsx)(B(),{children:m}):m}))]})}const Y=function(e){const[t,n]=(0,d.useState)(e.units);function i(r){return"metric"===e.units&&"imperial"===t?Math.round(1.8*r+32):"imperial"===e.units&&"metric"===t?Math.round(r*(5/9)-32):Math.round(r)}const s=new Date(1e3*e.weather[0].timestamp),l=`${p(e.weather[0].timestamp).shortName} ${s.getDate()}/${s.getFullYear().toString().slice(2)} TODAY`,m=`HIGH: ${i(e.weather[0].temp.high)} / LOW: ${i(e.weather[0].temp.high)}`,h=e.weather.map((e,t)=>{if(0!==t)return(0,r.jsxs)(o(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,r.jsx)(u(),{variant:"h5",component:"span",color:"text.secondary","aria-label":p(e.timestamp).fullName,children:p(e.timestamp).shortName}),(0,r.jsx)("img",{src:e.weatherIcon.icon,alt:e.weatherIcon.description}),(0,r.jsxs)(u(),{variant:"body2",color:"text.secondary",children:["High: ",i(e.temp.high),"°"]}),(0,r.jsxs)(u(),{variant:"body2",color:"text.secondary",children:["Low: ",i(e.temp.low),"°"]})]},t)});return(0,r.jsxs)(o(),{variant:"outlined",className:"rustic-weather",children:[e.title&&(0,r.jsx)(u(),{variant:"h6",children:e.title}),e.description&&(0,r.jsx)(S,{text:e.description}),(0,r.jsx)(G,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:()=>n("metric")},{label:"Fahrenheit",endDecorator:"°F",onClick:()=>n("imperial")}]}),(0,r.jsxs)(c(),{sx:{alignItems:"center"},children:[(0,r.jsx)(u(),{variant:"h4",component:"span",children:e.location}),(0,r.jsxs)(c(),{direction:"row",spacing:1,sx:{alignItems:"center"},className:"rustic-current-weather-description",children:[(0,r.jsx)("img",{src:e.weather[0].weatherIcon.icon,alt:""}),(0,r.jsx)(u(),{variant:"body2",children:e.weather[0].weatherIcon.description})]}),e.weather[0].temp.current&&(0,r.jsxs)(u(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[i(e.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(t)]}),(0,r.jsxs)(c(),{direction:"row",spacing:2,children:[(0,r.jsx)(u(),{variant:"overline",children:l}),(0,r.jsx)(u(),{variant:"overline",children:m})]})]}),(0,r.jsx)(a(),{className:"rustic-daily-weather-container",children:h}),e.weatherProvider&&(0,r.jsxs)(c(),{direction:"row",spacing:1,sx:{alignItems:"center",alignSelf:"center"},className:"rustic-weather-attribution",children:[(0,r.jsx)(x,{name:"cloud"}),(0,r.jsx)(u(),{variant:"body2",children:`Weather data provided by ${e.weatherProvider}`})]})]})};return t})());
|
|
@@ -4,5 +4,5 @@ import type { WeatherProps } from '../types';
|
|
|
4
4
|
|
|
5
5
|
Note: The first item in the `Weather` array is presumed to be the current day's weather.
|
|
6
6
|
*/
|
|
7
|
-
export default function Weather(props: WeatherProps): import("react
|
|
7
|
+
export default function Weather(props: WeatherProps): import("react").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=weather.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../src/components/weather/weather.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAYtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY
|
|
1
|
+
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../src/components/weather/weather.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAYtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,+BA+IlD"}
|
package/dist/index.css
CHANGED
|
@@ -2,31 +2,23 @@
|
|
|
2
2
|
padding: 16px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.rustic-fc-calendar .fc-event-title {
|
|
5
|
+
.rustic-fc-calendar .rustic-fc-event-title {
|
|
6
6
|
text-overflow: ellipsis;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.rustic-fc-calendar .fc-button {
|
|
9
|
+
.rustic-fc-calendar .rustic-fc-button {
|
|
10
10
|
padding: 4px 8px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.rustic-fc-calendar
|
|
14
|
-
.fc
|
|
15
|
-
.fc-button-primary:not(:disabled).fc-button-active:focus,
|
|
16
|
-
.rustic-fc-calendar .fc .fc-button-primary:focus,
|
|
17
|
-
.rustic-fc-calendar .fc .fc-button-primary:not(:disabled):active:focus {
|
|
18
|
-
box-shadow: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
13
|
@media (max-width: 900px) {
|
|
22
|
-
.rustic-fc-calendar .fc-toolbar {
|
|
14
|
+
.rustic-fc-calendar .rustic-fc-toolbar {
|
|
23
15
|
display: flex;
|
|
24
16
|
flex-direction: column;
|
|
25
17
|
gap: 4px;
|
|
26
18
|
align-items: flex-start;
|
|
27
19
|
}
|
|
28
20
|
|
|
29
|
-
.rustic-fc-calendar .fc-toolbar .fc-toolbar-
|
|
21
|
+
.rustic-fc-calendar .rustic-fc-toolbar .rustic-fc-toolbar-section:last-child {
|
|
30
22
|
display: flex;
|
|
31
23
|
justify-content: space-between;
|
|
32
24
|
width: 100%;
|
|
@@ -917,6 +909,12 @@ perspective-viewer-datagrid-toolbar {
|
|
|
917
909
|
display: none;
|
|
918
910
|
}
|
|
919
911
|
|
|
912
|
+
/* Perspective 5 shows each panel's title in a tab; the component renders the
|
|
913
|
+
title itself, and earlier versions kept it hidden in the status bar. */
|
|
914
|
+
.rustic-perspective-viz perspective-viewer-tab {
|
|
915
|
+
display: none;
|
|
916
|
+
}
|
|
917
|
+
|
|
920
918
|
.rustic-vega-lite-container {
|
|
921
919
|
width: 100%;
|
|
922
920
|
height: 100%;
|